MCPcopy Create free account
hub / github.com/cortexkit/magic-context / resolveSessionId

Function resolveSessionId

packages/pi-plugin/src/status-line.ts:122–133  ·  view source on GitHub ↗
(ctx: ExtensionContext)

Source from the content-addressed store, hash-verified

120}
121
122function resolveSessionId(ctx: ExtensionContext): string | undefined {
123 const getSessionId = (
124 ctx.sessionManager as { getSessionId?: () => string | undefined }
125 ).getSessionId;
126 if (typeof getSessionId !== "function") return undefined;
127 try {
128 const id = getSessionId.call(ctx.sessionManager);
129 return typeof id === "string" && id.length > 0 ? id : undefined;
130 } catch {
131 return undefined;
132 }
133}
134
135function fmt(n: number): string {
136 const abs = Math.abs(n);

Callers 2

registerStatusLineFunction · 0.70
updateStatusLineFunction · 0.70

Calls 1

callMethod · 0.80

Tested by

no test coverage detected