MCPcopy
hub / github.com/shareAI-lab/Kode-CLI / parse

Method parse

kode-agent-sdk/src/utils/session-id.ts:11–36  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

9
10export class SessionId {
11 static parse(id: string): SessionIdComponents {
12 const parts = id.split('/');
13 const components: SessionIdComponents = {
14 agentTemplate: '',
15 rootId: '',
16 forkIds: [],
17 };
18
19 for (const part of parts) {
20 if (part.startsWith('org-')) {
21 components.orgId = part.slice(4);
22 } else if (part.startsWith('team-')) {
23 components.teamId = part.slice(5);
24 } else if (part.startsWith('user-')) {
25 components.userId = part.slice(5);
26 } else if (part.startsWith('agent-')) {
27 components.agentTemplate = part.slice(6);
28 } else if (part.startsWith('session-')) {
29 components.rootId = part.slice(8);
30 } else if (part.startsWith('fork-')) {
31 components.forkIds.push(part.slice(5));
32 }
33 }
34
35 return components;
36 }
37
38 static generate(opts: {
39 orgId?: string;

Callers 15

readPackageJsonFunction · 0.80
readPackageJsonFunction · 0.80
readJsonArrayFileFunction · 0.80
normalizeTextOutputFunction · 0.80
parseJsonOrJsoncFunction · 0.80
loadLspServersFromFileFunction · 0.80
processBufferMethod · 0.80
editNotebookFileFunction · 0.80
callFileReadToolFunction · 0.80
safeJsonParseFunction · 0.80

Calls 1

pushMethod · 0.45

Tested by 8

createAcpProcessFunction · 0.64
createAcpHarnessFunction · 0.64
createInMemoryAcpFunction · 0.64
snapshotGlobalConfigFunction · 0.64
runHelpFunction · 0.64
runHelpFunction · 0.64
runHelpFunction · 0.64
parseJsonResponseFunction · 0.64