MCPcopy
hub / github.com/Doorman11991/smallcode / create

Method create

src/session/persistence.js:35–51  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

33
34 // Create a new session
35 create(model) {
36 const id = this._generateId();
37 const session = {
38 id,
39 title: '',
40 model,
41 messages: [],
42 tokens: { input: 0, output: 0, total: 0 },
43 cost: 0,
44 toolCalls: 0,
45 createdAt: new Date().toISOString(),
46 updatedAt: new Date().toISOString(),
47 };
48 this.current = session;
49 this._save(session);
50 return session;
51 }
52
53 // Resume the most recent session
54 resume() {

Callers 7

contract.test.jsFile · 0.45
buildIndexFunction · 0.45
executeContractToolFunction · 0.45
termFrequencyFunction · 0.45
embedFunction · 0.45
mainFunction · 0.45
commands.jsFile · 0.45

Calls 2

_generateIdMethod · 0.95
_saveMethod · 0.95

Tested by

no test coverage detected