@code-yeongyu/senpi 2026.7.17-5 → 2026.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -59
- package/dist/core/dynamic-prompt/build.d.ts +0 -7
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +0 -5
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.d.ts +0 -1
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.js +2 -20
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/config-schema.d.ts +1 -8
- package/dist/core/extensions/builtin/mcp/config-schema.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/config-schema.js +0 -23
- package/dist/core/extensions/builtin/mcp/config-schema.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/config.d.ts +0 -13
- package/dist/core/extensions/builtin/mcp/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/config.js +0 -36
- package/dist/core/extensions/builtin/mcp/config.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.d.ts +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.js +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/policy.js +1 -1
- package/dist/core/extensions/builtin/mcp/expose/policy.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/status.js +1 -1
- package/dist/core/extensions/builtin/mcp/expose/status.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tier-b.d.ts +3 -3
- package/dist/core/extensions/builtin/mcp/expose/tier-b.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tier-b.js +10 -10
- package/dist/core/extensions/builtin/mcp/expose/tier-b.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tool-search.d.ts +3 -3
- package/dist/core/extensions/builtin/mcp/expose/tool-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tool-search.js +14 -14
- package/dist/core/extensions/builtin/mcp/expose/tool-search.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/index.js +5 -5
- package/dist/core/extensions/builtin/mcp/index.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-snapshot.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-snapshot.js +0 -1
- package/dist/core/extensions/builtin/mcp/service-snapshot.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-types.d.ts +0 -12
- package/dist/core/extensions/builtin/mcp/service-types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-types.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.d.ts +2 -2
- package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.js +3 -4
- package/dist/core/extensions/builtin/mcp/service.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/status.js +0 -1
- package/dist/core/extensions/builtin/mcp/status.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +1 -5
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +1 -5
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +1 -5
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +1 -5
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +1 -5
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +7 -5
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.js +3 -20
- package/dist/core/extensions/builtin/websearch/index.js.map +1 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +4 -20
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +0 -20
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +0 -13
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +1 -8
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/docs/extensions.md +0 -46
- package/docs/mcp.md +5 -21
- package/examples/AGENTS.md +0 -3
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -48
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +19 -59
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +2 -69
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +0 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +4 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +1 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +1 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +1 -25
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +21 -31
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +9 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +27 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts +0 -31
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +0 -19
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js +0 -3
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js +1 -2
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.d.ts +0 -11
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.js +1 -40
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.js +7 -92
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts +1 -8
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js +27 -129
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js +6 -140
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js +6 -28
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js +18 -51
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js +9 -70
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts +2 -5
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +2 -13
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js +2 -19
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
- package/dist/core/dynamic-prompt/workstation.d.ts +0 -35
- package/dist/core/dynamic-prompt/workstation.d.ts.map +0 -1
- package/dist/core/dynamic-prompt/workstation.js +0 -81
- package/dist/core/dynamic-prompt/workstation.js.map +0 -1
- package/docs/AGENTS.md +0 -70
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts +0 -19
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js +0 -215
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js.map +0 -1
|
@@ -12,17 +12,6 @@ export type McpSessionContext = Pick<ExtensionContext, "cwd" | "isProjectTrusted
|
|
|
12
12
|
* requirement narrow lets tests pass a two-line fake.
|
|
13
13
|
*/
|
|
14
14
|
sessionManager?: Pick<ExtensionContext["sessionManager"], "getEntries">;
|
|
15
|
-
/**
|
|
16
|
-
* Extension-declared MCP servers. Read on every attach so reattach/reload
|
|
17
|
-
* paths pick up the current declarations without caching them in the MCP
|
|
18
|
-
* builtin.
|
|
19
|
-
*/
|
|
20
|
-
getRegisteredMcpServers?: () => readonly {
|
|
21
|
-
name: string;
|
|
22
|
-
config: Record<string, unknown>;
|
|
23
|
-
extensionPath: string;
|
|
24
|
-
registrationCwd: string;
|
|
25
|
-
}[];
|
|
26
15
|
};
|
|
27
16
|
export interface McpSessionOptions {
|
|
28
17
|
readonly agentDir?: string;
|
|
@@ -43,7 +32,6 @@ export interface McpServerSnapshot {
|
|
|
43
32
|
name: string;
|
|
44
33
|
configState: ResolvedMcpServer["state"] | "removed";
|
|
45
34
|
configHash: string | null;
|
|
46
|
-
source: ResolvedMcpServer["source"] | null;
|
|
47
35
|
sourcePath: string | null;
|
|
48
36
|
lifecycleState: ServerConnectionState | "cached" | "not_spawned";
|
|
49
37
|
generation: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-types.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service-types.ts"],"names":[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AAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,0BAA0B,EAAE,OAAO,CAAC;IACpC,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,0FAA0F;IAC1F,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-types.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExtensionContext, SessionShutdownEvent, SessionStartEvent } from \"../../types.ts\";\nimport type { ServerAuthPlan } from \"./auth/context.ts\";\nimport type { McpCachedServerCatalog } from \"./catalog-cache.ts\";\nimport type { ResolvedMcpServer } from \"./config-schema.ts\";\nimport type { ServerConnection, ServerConnectionState } from \"./connection.ts\";\nimport type { McpLogger } from \"./log.ts\";\n\nexport type McpDisposeReason = Extract<SessionShutdownEvent[\"reason\"], \"quit\" | \"reload\">;\nexport type McpSessionContext = Pick<ExtensionContext, \"cwd\" | \"isProjectTrusted\"> & {\n\t/**\n\t * Session history access, present on the real ExtensionContext. Only\n\t * getEntries is needed (attach-time promotion rehydration); keeping the\n\t * requirement narrow lets tests pass a two-line fake.\n\t */\n\tsessionManager?: Pick<ExtensionContext[\"sessionManager\"], \"getEntries\">;\n
|
|
1
|
+
{"version":3,"file":"service-types.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExtensionContext, SessionShutdownEvent, SessionStartEvent } from \"../../types.ts\";\nimport type { ServerAuthPlan } from \"./auth/context.ts\";\nimport type { McpCachedServerCatalog } from \"./catalog-cache.ts\";\nimport type { ResolvedMcpServer } from \"./config-schema.ts\";\nimport type { ServerConnection, ServerConnectionState } from \"./connection.ts\";\nimport type { McpLogger } from \"./log.ts\";\n\nexport type McpDisposeReason = Extract<SessionShutdownEvent[\"reason\"], \"quit\" | \"reload\">;\nexport type McpSessionContext = Pick<ExtensionContext, \"cwd\" | \"isProjectTrusted\"> & {\n\t/**\n\t * Session history access, present on the real ExtensionContext. Only\n\t * getEntries is needed (attach-time promotion rehydration); keeping the\n\t * requirement narrow lets tests pass a two-line fake.\n\t */\n\tsessionManager?: Pick<ExtensionContext[\"sessionManager\"], \"getEntries\">;\n};\n\nexport interface McpSessionOptions {\n\treadonly agentDir?: string;\n\treadonly env?: Record<string, string | undefined>;\n\treadonly logDir?: string;\n\treadonly projectTrusted?: boolean;\n}\n\nexport interface McpServiceSnapshot {\n\tdisposed: boolean;\n\tdisposeCount: number;\n\tlastDisposeReason: McpDisposeReason | null;\n\tsessionStartCount: number;\n\tlastSessionStartReason: SessionStartEvent[\"reason\"] | null;\n\thasSessionContext: boolean;\n\tconnectionCount: number;\n}\n\nexport interface McpServerSnapshot {\n\tname: string;\n\tconfigState: ResolvedMcpServer[\"state\"] | \"removed\";\n\tconfigHash: string | null;\n\tsourcePath: string | null;\n\tlifecycleState: ServerConnectionState | \"cached\" | \"not_spawned\";\n\tgeneration: number | null;\n\tpid: number | null;\n\tlastError: string | null;\n\tuptimeMs: number | null;\n\tcounters: McpServerCounters;\n}\n\nexport interface McpServerCounters {\n\tcallCount: number;\n\terrorCount: number;\n\ttotalLatencyMs: number;\n\treconnectCount: number;\n}\n\nexport interface McpConnectionEntry {\n\treadonly key: string;\n\treadonly name: string;\n\treadonly configHash: string;\n\treadonly connection: ServerConnection;\n\treadonly logger: McpLogger;\n\treadonly createdAtMs: number;\n\treadonly counters: McpServerCounters;\n\treadonly agentDir?: string;\n\treadonly authPlan?: ServerAuthPlan;\n\tcachedCatalog?: McpCachedServerCatalog;\n\tcacheRefreshedAfterConnect: boolean;\n\t/** Full mcp tool names last registered for this server (list_changed diffing). */\n\tknownToolNames?: string[];\n\t/** Latest `/mcp status` list_changed delta line, e.g. \"2 added (inactive), 1 removed\". */\n\tlastListChangedDelta?: string;\n\t/** Teardown for the list_changed coalescer + subscription. */\n\tdisposeListChanged?: () => void;\n}\n"]}
|
|
@@ -32,7 +32,7 @@ export declare class McpService {
|
|
|
32
32
|
/** Connected servers that list resources (todo 39), for mention expansion. */
|
|
33
33
|
getMcpResourceServers(): readonly McpResourceServer[];
|
|
34
34
|
/** Reveal skill-owned tools (todo 37): activation is effective the next
|
|
35
|
-
* turn, exactly like an
|
|
35
|
+
* turn, exactly like an mcp_search promotion. Unknown names are ignored. */
|
|
36
36
|
activateSkillMcpTools(names: readonly string[]): void;
|
|
37
37
|
handleSessionShutdown(event: SessionShutdownEvent): Promise<void>;
|
|
38
38
|
dispose(reason: McpDisposeReason): Promise<void>;
|
|
@@ -45,7 +45,7 @@ export declare class McpService {
|
|
|
45
45
|
recordCall(name: string, elapsedMs: number, failed: boolean): void;
|
|
46
46
|
getSnapshot(): McpServiceSnapshot;
|
|
47
47
|
/**
|
|
48
|
-
* Replay
|
|
48
|
+
* Replay mcp_search activation markers from session history through the
|
|
49
49
|
* live tier-B activation path (see tool-search.ts). Returns newly activated
|
|
50
50
|
* names; safe to call repeatedly (already-active names are skipped).
|
|
51
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAI5F,OAAO,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAI5F,OAAO,EAAiB,qBAAqB,EAA4B,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAwC,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAYlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,OAAO,KAAK,EAEX,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAEnE,qBAAa,UAAU;;IAoBhB,aAAa,CAClB,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,iBAAiB,EACtB,GAAG,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,CAA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C,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAOjE;IAED,WAAW,IAAI,kBAAkB,CAUhC;IA0JD;;;;OAIG;IACH,+BAA+B,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,EAAE,CAGtE;IAED;;;;;OAKG;IACH,yBAAyB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,EAAE,CAGhE;IAaD,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,0BAA0B,EAAE,gBAAgB,CAAC,CAEjF;IAED,aAAa,CACZ,IAAI,EAAE,MAAM,GAEV;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAC9G,SAAS,CASX;IAED,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEtD;IAED;8DAC0D;IAC1D,0BAA0B,IAAI,MAAM,GAAG,OAAO,GAAG,SAAS,CAEzD;CACD;AAID,wBAAgB,aAAa,IAAI,UAAU,CAK1C;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAI,gBAAgB,CAE1G;AASD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { detectLiteralBearerWarnings, resolveServerAuth } from "./auth/context.js";
|
|
2
2
|
import { collectToolCatalog } from "./catalog.js";
|
|
3
3
|
import { getValidCachedServer, readMcpCatalogCache } from "./catalog-cache.js";
|
|
4
|
-
import { loadMcpConfig,
|
|
4
|
+
import { loadMcpConfig, resolveSkillMcpServer, visitSpawnableMcpServers } from "./config.js";
|
|
5
5
|
import { ServerConnection } from "./connection.js";
|
|
6
6
|
import { mapMcpCatalogNames } from "./expose/register.js";
|
|
7
7
|
import { cleanupMcpOutputArtifacts } from "./guard/output-guard.js";
|
|
@@ -44,7 +44,6 @@ export class McpService {
|
|
|
44
44
|
env: options.env,
|
|
45
45
|
projectTrusted: options.projectTrusted ?? ctx.isProjectTrusted(),
|
|
46
46
|
});
|
|
47
|
-
mergeExtensionMcpServers(config, ctx.getRegisteredMcpServers?.() ?? []);
|
|
48
47
|
this.#config = config;
|
|
49
48
|
this.#pi = _pi;
|
|
50
49
|
this.#authAgentDir = options.agentDir;
|
|
@@ -111,7 +110,7 @@ export class McpService {
|
|
|
111
110
|
return this.#tierBRegistration?.resourceServers ?? [];
|
|
112
111
|
}
|
|
113
112
|
/** Reveal skill-owned tools (todo 37): activation is effective the next
|
|
114
|
-
* turn, exactly like an
|
|
113
|
+
* turn, exactly like an mcp_search promotion. Unknown names are ignored. */
|
|
115
114
|
activateSkillMcpTools(names) {
|
|
116
115
|
this.#tierBRegistration?.activate(names);
|
|
117
116
|
}
|
|
@@ -335,7 +334,7 @@ export class McpService {
|
|
|
335
334
|
this.#historyScanned = false;
|
|
336
335
|
}
|
|
337
336
|
/**
|
|
338
|
-
* Replay
|
|
337
|
+
* Replay mcp_search activation markers from session history through the
|
|
339
338
|
* live tier-B activation path (see tool-search.ts). Returns newly activated
|
|
340
339
|
* names; safe to call repeatedly (already-active names are skipped).
|
|
341
340
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,aAA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arnings, resolveServerAuth } from \"./auth/context.ts\";\nimport { collectToolCatalog } from \"./catalog.ts\";\nimport { getValidCachedServer, readMcpCatalogCache } from \"./catalog-cache.ts\";\nimport { loadMcpConfig, mergeExtensionMcpServers, resolveSkillMcpServer, visitSpawnableMcpServers } from \"./config.ts\";\nimport type { McpServerConfig, ResolvedMcpConfig, ResolvedMcpServer } from \"./config-schema.ts\";\nimport { ServerConnection } from \"./connection.ts\";\nimport { mapMcpCatalogNames } from \"./expose/register.ts\";\nimport type { McpSessionRegistration } from \"./expose/session.ts\";\nimport type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport { cleanupMcpOutputArtifacts } from \"./guard/output-guard.ts\";\nimport { markMcpConnectionNeedsAuth } from \"./health.ts\";\nimport { configureMcpConnectionLifecycle, disposeMcpConnectionLifecycle } from \"./idle.ts\";\nimport { createMcpLogger } from \"./log.ts\";\nimport {\n\tbuildMcpTombstoneDefinition,\n\tcreateMcpListChangeCoalescer,\n\tdiffMcpToolNames,\n\tformatMcpListChangedDelta,\n} from \"./notifications.ts\";\nimport { configureMcpReconnect, disposeMcpReconnect, reconnectMcpNow } from \"./reconnect.ts\";\nimport type { McpResourceServer } from \"./resources.ts\";\nimport { getMcpServiceExposureStatus } from \"./service-exposure.ts\";\nimport { registerMcpServiceDirectTools } from \"./service-register.ts\";\nimport { buildMcpServerSnapshot } from \"./service-snapshot.ts\";\nimport type {\n\tMcpConnectionEntry,\n\tMcpDisposeReason,\n\tMcpServerSnapshot,\n\tMcpServiceSnapshot,\n\tMcpSessionContext,\n\tMcpSessionOptions,\n} from \"./service-types.ts\";\nimport {\n\tconnectAndRefreshMcpCatalog,\n\tignoreStartupNeedsAuth,\n\traceMcpStartupConnect,\n\tshouldRaceMcpStartup,\n} from \"./startup-race.ts\";\n\nexport { registerToolsPreservingActiveSet } from \"./active-set.ts\";\n\nexport class McpService {\n\t#disposed = false;\n\t#disposeCount = 0;\n\t#lastDisposeReason: McpDisposeReason | null = null;\n\t#sessionContext: McpSessionContext | null = null;\n\t#sessionStartCount = 0;\n\t#lastSessionStartReason: SessionStartEvent[\"reason\"] | null = null;\n\t#toolRefreshGeneration = 0;\n\t#config: ResolvedMcpConfig | null = null;\n\t#authAgentDir: string | undefined;\n\t#authEnv: Record<string, string | undefined> | undefined;\n\treadonly #pendingAuth = new Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider>();\n\t#refreshActiveSetWhenNoTools = false;\n\t#tierBRegistration: McpSessionRegistration | undefined;\n\t#historyScanned = false;\n\t#sessionOptions: McpSessionOptions = {};\n\t#pi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined;\n\treadonly #connections = new Map<string, McpConnectionEntry>();\n\treadonly #connectionKeysByName = new Map<string, string>();\n\n\tasync attachSession(\n\t\tevent: SessionStartEvent,\n\t\tctx: McpSessionContext,\n\t\t_pi?: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t\toptions: McpSessionOptions = {},\n\t): Promise<void> {\n\t\tthis.#sessionContext = ctx;\n\t\tthis.#sessionStartCount += 1;\n\t\tthis.#lastSessionStartReason = event.reason;\n\t\tconst config = loadMcpConfig({\n\t\t\tagentDir: options.agentDir,\n\t\t\tcwd: ctx.cwd,\n\t\t\tenv: options.env,\n\t\t\tprojectTrusted: options.projectTrusted ?? ctx.isProjectTrusted(),\n\t\t});\n\t\tmergeExtensionMcpServers(config, ctx.getRegisteredMcpServers?.() ?? []);\n\t\tthis.#config = config;\n\t\tthis.#pi = _pi;\n\t\tthis.#authAgentDir = options.agentDir;\n\t\tthis.#authEnv = options.env;\n\t\tthis.#sessionOptions = options;\n\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\tawait this.#syncFromConfig(config, options, event.reason !== \"reload\", _pi, toolRefreshGeneration);\n\t\tif (_pi !== undefined) await this.#registerDirectTools(_pi);\n\t\t// Replay promotion markers from the (possibly resumed) session history\n\t\t// BEFORE the first turn: the request tool snapshot is taken before the\n\t\t// per-turn context event fires, so the context-event replay alone lands\n\t\t// one turn late. Doing it here puts restored tools on the very first\n\t\t// wire payload after a --continue/resume.\n\t\tif (_pi !== undefined) this.#rehydrateFromSessionHistory(ctx);\n\t}\n\n\t/**\n\t * Register skill-declared MCP servers (todo 37). Skill servers are forced\n\t * into search mode with no directTools, so their catalogs register with\n\t * ZERO active tools until activateSkillMcpTools reveals them. A name\n\t * collision with a system-configured server keeps the system config and\n\t * returns a warning (system wins).\n\t */\n\tasync attachSkillMcpServers(\n\t\tdeclared: ReadonlyMap<string, { raw: Parameters<typeof resolveSkillMcpServer>[1]; sourcePath: string }>,\n\t): Promise<string[]> {\n\t\tconst config = this.#config;\n\t\tconst pi = this.#pi;\n\t\tif (config === null || pi === undefined) return [];\n\t\tconst warnings: string[] = [];\n\t\tlet added = 0;\n\t\tfor (const [name, decl] of declared) {\n\t\t\tconst existing = config.servers[name];\n\t\t\tif (existing !== undefined && existing.source !== \"skill\") {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`MCP server '${name}' from skill ${decl.sourcePath} collides with the ${existing.source} config; system config wins.`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveSkillMcpServer(name, decl.raw, decl.sourcePath);\n\t\t\tif (existing !== undefined && existing.configHash === resolved.configHash) continue;\n\t\t\tconfig.servers[name] = resolved;\n\t\t\tadded += 1;\n\t\t}\n\t\tif (added > 0) {\n\t\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\t\tawait this.#syncFromConfig(config, this.#sessionOptions, false, pi, toolRefreshGeneration);\n\t\t\tawait this.#registerDirectTools(pi);\n\t\t}\n\t\treturn warnings;\n\t}\n\n\t/** Registered searchable catalog (mapped name + server-side tool name),\n\t * used by the skills loader to compute activation targets. */\n\tgetTierBSearchable(): ReadonlyArray<{ name: string; toolName: string; server: string }> {\n\t\treturn this.#tierBRegistration?.searchable ?? [];\n\t}\n\n\t/** Connected servers that list prompts (todo 40), for slash registration. */\n\tgetMcpPromptServers(): readonly import(\"./prompts.ts\").McpPromptServer[] {\n\t\treturn this.#tierBRegistration?.promptServers ?? [];\n\t}\n\n\t/** Connected servers that list resources (todo 39), for mention expansion. */\n\tgetMcpResourceServers(): readonly McpResourceServer[] {\n\t\treturn this.#tierBRegistration?.resourceServers ?? [];\n\t}\n\n\t/** Reveal skill-owned tools (todo 37): activation is effective the next\n\t * turn, exactly like an tool_search promotion. Unknown names are ignored. */\n\tactivateSkillMcpTools(names: readonly string[]): void {\n\t\tthis.#tierBRegistration?.activate(names);\n\t}\n\n\t#rehydrateFromSessionHistory(ctx: McpSessionContext): void {\n\t\tconst entries = ctx.sessionManager?.getEntries() ?? [];\n\t\tif (entries.length === 0) return;\n\t\tthis.rehydrateActiveToolsFromHistory(entries);\n\t}\n\n\tasync handleSessionShutdown(event: SessionShutdownEvent): Promise<void> {\n\t\tif (shouldDisposeMcpService(event.reason)) await this.dispose(event.reason);\n\t}\n\n\tasync dispose(reason: McpDisposeReason): Promise<void> {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tthis.#disposeCount += 1;\n\t\tthis.#lastDisposeReason = reason;\n\t\tthis.#sessionContext = null;\n\t\tthis.#config = null;\n\t\tconst entries = [...this.#connections.values()];\n\t\tthis.#connections.clear();\n\t\tthis.#connectionKeysByName.clear();\n\t\tawait Promise.all(entries.map((entry) => disposeEntryConnection(entry)));\n\t\tawait cleanupMcpOutputArtifacts();\n\t}\n\n\tisDisposed(): boolean {\n\t\treturn this.#disposed;\n\t}\n\n\tgetConnection(name: string): ServerConnection | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key)?.connection;\n\t}\n\n\tasync reconnectServer(name: string): Promise<void> {\n\t\tconst entry = this.#entryForName(name);\n\t\tif (entry === undefined) throw new Error(`Unknown MCP server: ${name || \"<missing>\"}`);\n\t\tawait reconnectMcpNow(entry.connection);\n\t}\n\n\tgetServerSnapshots(): McpServerSnapshot[] {\n\t\tconst names = new Set<string>(Object.keys(this.#config?.servers ?? {}));\n\t\tfor (const entry of this.#connections.values()) names.add(entry.name);\n\t\treturn [...names].sort().map((name) => this.#serverSnapshot(name));\n\t}\n\n\tgetLogLines(name: string, maxLines: number): string[] {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst lines = key === undefined ? [] : (this.#connections.get(key)?.logger.getRingBuffer() ?? []);\n\t\treturn lines.slice(Math.max(0, lines.length - maxLines));\n\t}\n\n\tasync getServerExposureStatus(name: string): Promise<McpServerExposureStatus> {\n\t\treturn await getMcpServiceExposureStatus(name, this.#config, this.#entryForName(name));\n\t}\n\n\trecordCall(name: string, elapsedMs: number, failed: boolean): void {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst entry = key === undefined ? undefined : this.#connections.get(key);\n\t\tif (entry === undefined) return;\n\t\tentry.counters.callCount += 1;\n\t\tentry.counters.totalLatencyMs += elapsedMs;\n\t\tif (failed) entry.counters.errorCount += 1;\n\t}\n\n\tgetSnapshot(): McpServiceSnapshot {\n\t\treturn {\n\t\t\tdisposed: this.#disposed,\n\t\t\tdisposeCount: this.#disposeCount,\n\t\t\tlastDisposeReason: this.#lastDisposeReason,\n\t\t\tsessionStartCount: this.#sessionStartCount,\n\t\t\tlastSessionStartReason: this.#lastSessionStartReason,\n\t\t\thasSessionContext: this.#sessionContext !== null,\n\t\t\tconnectionCount: this.#connections.size,\n\t\t};\n\t}\n\n\tasync #syncFromConfig(\n\t\tconfig: ResolvedMcpConfig,\n\t\toptions: McpSessionOptions,\n\t\tuseCache: boolean,\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined,\n\t\ttoolRefreshGeneration: number,\n\t): Promise<void> {\n\t\tconst cache = await readMcpCatalogCache(options.agentDir);\n\t\tconst hadConnectionsBeforeSync = this.#connections.size > 0;\n\t\tthis.#refreshActiveSetWhenNoTools = Object.keys(config.servers).length > 0 || hadConnectionsBeforeSync;\n\t\tconst wanted = new Map<string, ResolvedMcpServer>();\n\t\tvisitSpawnableMcpServers(config, (name, server) => {\n\t\t\twanted.set(name, server);\n\t\t});\n\t\tconst disposals: Promise<void>[] = [];\n\t\tfor (const entry of this.#connections.values()) {\n\t\t\tconst server = wanted.get(entry.name);\n\t\t\tconst key = server?.configHash === undefined ? undefined : `${entry.name}\\0${server.configHash}`;\n\t\t\tif (key === entry.key) continue;\n\t\t\tthis.#connections.delete(entry.key);\n\t\t\tthis.#connectionKeysByName.delete(entry.name);\n\t\t\tdisposals.push(disposeEntryConnection(entry));\n\t\t}\n\t\tawait Promise.all(disposals);\n\n\t\tconst connects: Promise<void>[] = [];\n\t\tfor (const [name, server] of wanted) {\n\t\t\tif (server.config === undefined || server.configHash === undefined) continue;\n\t\t\tconst key = `${name}\\0${server.configHash}`;\n\t\t\tif (this.#connections.has(key)) continue;\n\t\t\tconst logger = createMcpLogger(name, { logDir: options.logDir });\n\t\t\tconst authPlan = resolveServerAuth({\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tfor (const warning of detectLiteralBearerWarnings(name, server.config)) logger.warn(warning);\n\t\t\tconst connection = new ServerConnection({\n\t\t\t\tauthProvider: authPlan.provider,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tconst cachedCatalog = useCache ? getValidCachedServer(cache, name, server.configHash) : undefined;\n\t\t\tconst entry: McpConnectionEntry = {\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tauthPlan,\n\t\t\t\tcacheRefreshedAfterConnect: false,\n\t\t\t\tcachedCatalog,\n\t\t\t\tkey,\n\t\t\t\tname,\n\t\t\t\tconfigHash: server.configHash,\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\tcreatedAtMs: Date.now(),\n\t\t\t\tcounters: { callCount: 0, errorCount: 0, totalLatencyMs: 0, reconnectCount: 0 },\n\t\t\t};\n\t\t\tconfigureMcpConnectionLifecycle(connection, server.config, logger);\n\t\t\tconfigureMcpReconnect({\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\treconnect: async () => {\n\t\t\t\t\tentry.counters.reconnectCount += 1;\n\t\t\t\t\tentry.cacheRefreshedAfterConnect = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait entry.authPlan?.refresh?.ensureFresh();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst authError = markMcpConnectionNeedsAuth(entry.connection, error);\n\t\t\t\t\t\tif (authError !== undefined) {\n\t\t\t\t\t\t\tentry.logger.warn(authError.message);\n\t\t\t\t\t\t\tthrow authError;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tawait entry.connection.renew();\n\t\t\t\t\tawait connectAndRefreshMcpCatalog(entry, server.config);\n\t\t\t\t},\n\t\t\t\tshouldReconnect: () => !this.#disposed && this.#entryForName(name) === entry,\n\t\t\t});\n\t\t\tthis.#connections.set(key, entry);\n\t\t\tthis.#connectionKeysByName.set(name, key);\n\t\t\tthis.#wireListChanged(entry);\n\t\t\tif (shouldRaceMcpStartup(server.config.lifecycle)) {\n\t\t\t\tconnects.push(\n\t\t\t\t\traceMcpStartupConnect({\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\tregisterDirectTools: (targetPi) => this.#registerDirectTools(targetPi),\n\t\t\t\t\t\tserverConfig: server.config,\n\t\t\t\t\t\tshouldRefreshTools: () => !this.#disposed && this.#toolRefreshGeneration === toolRefreshGeneration,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (cachedCatalog === undefined) {\n\t\t\t\tconnects.push(ignoreStartupNeedsAuth(entry, connectAndRefreshMcpCatalog(entry, server.config)));\n\t\t\t}\n\t\t}\n\t\tawait Promise.all(connects);\n\t}\n\n\t#wireListChanged(entry: McpConnectionEntry): void {\n\t\tconst sink = { logger: { error: (message: string, data?: unknown) => entry.logger.error(message, data) } };\n\t\tconst coalescer = createMcpListChangeCoalescer({\n\t\t\tonRefresh: () => this.#handleServerToolsChanged(entry),\n\t\t\tscope: `mcp.list_changed.${entry.name}`,\n\t\t\tsink,\n\t\t});\n\t\tconst unsubscribe = entry.connection.onToolsChanged(() => coalescer.notify());\n\t\tentry.disposeListChanged = () => {\n\t\t\tunsubscribe();\n\t\t\tcoalescer.dispose();\n\t\t};\n\t}\n\n\t// Re-list a server on a coalesced list_changed and re-register: added tools\n\t// enter INACTIVE (registerToolsPreservingActiveSet keeps the active set), and\n\t// removed tools are tombstoned so a stale call fails cleanly.\n\tasync #handleServerToolsChanged(entry: McpConnectionEntry): Promise<void> {\n\t\tconst pi = this.#pi;\n\t\tconst config = this.#config;\n\t\tif (pi === undefined || config === null) return;\n\t\tconst server = config.servers[entry.name];\n\t\tif (server?.config === undefined || entry.connection.state !== \"connected\") return;\n\t\tconst catalog = await collectToolCatalog(entry.name, entry.connection, server.config, {\n\t\t\tagentDir: entry.agentDir,\n\t\t\toutputGuard: config.settings.outputGuard,\n\t\t});\n\t\tconst newNames = mapMcpCatalogNames(catalog).map(({ name }) => name);\n\t\tconst diff = diffMcpToolNames(entry.knownToolNames ?? newNames, newNames);\n\t\t// Tombstone removed tools BEFORE re-registration so the subsequent\n\t\t// setActiveTools (which excludes them) leaves the tombstones inactive.\n\t\tfor (const removed of diff.removed) pi.registerTool(buildMcpTombstoneDefinition(removed, entry.name));\n\t\tawait this.#registerDirectTools(pi);\n\t\tentry.knownToolNames = newNames;\n\t\tentry.lastListChangedDelta = formatMcpListChangedDelta(diff);\n\t}\n\n\tasync #registerDirectTools(\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t): Promise<void> {\n\t\tconst config = this.#config;\n\t\tif (config === null) return;\n\t\tthis.#tierBRegistration = await registerMcpServiceDirectTools(pi, config, this.#connections.values(), {\n\t\t\trefreshActiveSetWhenEmpty: this.#refreshActiveSetWhenNoTools,\n\t\t});\n\t\t// A (re-)registration recomputes the active set from config alone, so any\n\t\t// promotions recorded in history are worth replaying on the next scan.\n\t\tthis.#historyScanned = false;\n\t}\n\n\t/**\n\t * Replay tool_search activation markers from session history through the\n\t * live tier-B activation path (see tool-search.ts). Returns newly activated\n\t * names; safe to call repeatedly (already-active names are skipped).\n\t */\n\trehydrateActiveToolsFromHistory(messages: readonly unknown[]): string[] {\n\t\tthis.#historyScanned = true;\n\t\treturn this.#tierBRegistration?.rehydrateFromHistory(messages) ?? [];\n\t}\n\n\t/**\n\t * Once-per-registration variant for per-turn context events: scanning the\n\t * full history each turn would cost O(history) JSON serialization, and a\n\t * live session's active set only drifts from history when a (re-)registration\n\t * rebuilt it — so scan once after each registration and skip otherwise.\n\t */\n\tmaybeRehydrateFromHistory(messages: readonly unknown[]): string[] {\n\t\tif (this.#historyScanned) return [];\n\t\treturn this.rehydrateActiveToolsFromHistory(messages);\n\t}\n\n\t#serverSnapshot(name: string): McpServerSnapshot {\n\t\tconst connection = this.getConnection(name);\n\t\tconnection?.refreshCapturedDiagnostics();\n\t\treturn buildMcpServerSnapshot(name, this.#config?.servers[name], connection, this.#entryForName(name));\n\t}\n\n\t#entryForName(name: string): McpConnectionEntry | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key);\n\t}\n\n\tgetPendingAuth(): Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider> {\n\t\treturn this.#pendingAuth;\n\t}\n\n\tgetAuthTarget(\n\t\tname: string,\n\t):\n\t\t| { config: McpServerConfig; agentDir?: string; env?: Record<string, string | undefined>; callbackUrl?: string }\n\t\t| undefined {\n\t\tconst server = this.#config?.servers[name];\n\t\tif (server?.config === undefined) return undefined;\n\t\treturn {\n\t\t\tconfig: server.config,\n\t\t\tagentDir: this.#authAgentDir,\n\t\t\tenv: this.#authEnv,\n\t\t\tcallbackUrl: this.#config?.settings.oauthCallbackUrl,\n\t\t};\n\t}\n\n\tgetCachedInstructions(name: string): string | undefined {\n\t\treturn this.#entryForName(name)?.cachedCatalog?.instructions;\n\t}\n\n\t/** Resolved `settings.nativeToolSearch` (auto | true | false | undefined).\n\t * Drives the native provider tool-search adapter gate. */\n\tgetNativeToolSearchSetting(): \"auto\" | boolean | undefined {\n\t\treturn this.#config?.settings.nativeToolSearch;\n\t}\n}\n\nlet service: McpService | null = null;\n\nexport function getMcpService(): McpService {\n\tif (service === null || service.isDisposed()) {\n\t\tservice = new McpService();\n\t}\n\treturn service;\n}\n\nexport function shouldDisposeMcpService(reason: SessionShutdownEvent[\"reason\"]): reason is McpDisposeReason {\n\treturn reason === \"quit\" || reason === \"reload\";\n}\n\nasync function disposeEntryConnection(entry: McpConnectionEntry): Promise<void> {\n\tentry.disposeListChanged?.();\n\tdisposeMcpReconnect(entry.connection);\n\tdisposeMcpConnectionLifecycle(entry.connection);\n\tawait entry.connection.dispose();\n}\n\nexport function resetMcpServiceForTests(): void {\n\tservice = null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB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AAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB;SACpD,CAAC;IACH,CAAC;IAED,qBAAqB,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,YAAY,CAAC;IAC9D,CAAC;IAED;8DAC0D;IAC1D,0BAA0B;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAChD,CAAC;CACD;AAED,IAAI,OAAO,GAAsB,IAAI,CAAC;AAEtC,MAAM,UAAU,aAAa;IAC5B,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC9C,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAsC;IAC7E,OAAO,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,QAAQ,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,KAAyB;IAC9D,KAAK,CAAC,kBAAkB,EAAE,EAAE,CAAC;IAC7B,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACtC,6BAA6B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,uBAAuB;IACtC,OAAO,GAAG,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { ExtensionAPI, SessionShutdownEvent, SessionStartEvent } from \"../../types.ts\";\nimport { detectLiteralBearerWarnings, resolveServerAuth } from \"./auth/context.ts\";\nimport { collectToolCatalog } from \"./catalog.ts\";\nimport { getValidCachedServer, readMcpCatalogCache } from \"./catalog-cache.ts\";\nimport { loadMcpConfig, resolveSkillMcpServer, visitSpawnableMcpServers } from \"./config.ts\";\nimport type { McpServerConfig, ResolvedMcpConfig, ResolvedMcpServer } from \"./config-schema.ts\";\nimport { ServerConnection } from \"./connection.ts\";\nimport { mapMcpCatalogNames } from \"./expose/register.ts\";\nimport type { McpSessionRegistration } from \"./expose/session.ts\";\nimport type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport { cleanupMcpOutputArtifacts } from \"./guard/output-guard.ts\";\nimport { markMcpConnectionNeedsAuth } from \"./health.ts\";\nimport { configureMcpConnectionLifecycle, disposeMcpConnectionLifecycle } from \"./idle.ts\";\nimport { createMcpLogger } from \"./log.ts\";\nimport {\n\tbuildMcpTombstoneDefinition,\n\tcreateMcpListChangeCoalescer,\n\tdiffMcpToolNames,\n\tformatMcpListChangedDelta,\n} from \"./notifications.ts\";\nimport { configureMcpReconnect, disposeMcpReconnect, reconnectMcpNow } from \"./reconnect.ts\";\nimport type { McpResourceServer } from \"./resources.ts\";\nimport { getMcpServiceExposureStatus } from \"./service-exposure.ts\";\nimport { registerMcpServiceDirectTools } from \"./service-register.ts\";\nimport { buildMcpServerSnapshot } from \"./service-snapshot.ts\";\nimport type {\n\tMcpConnectionEntry,\n\tMcpDisposeReason,\n\tMcpServerSnapshot,\n\tMcpServiceSnapshot,\n\tMcpSessionContext,\n\tMcpSessionOptions,\n} from \"./service-types.ts\";\nimport {\n\tconnectAndRefreshMcpCatalog,\n\tignoreStartupNeedsAuth,\n\traceMcpStartupConnect,\n\tshouldRaceMcpStartup,\n} from \"./startup-race.ts\";\n\nexport { registerToolsPreservingActiveSet } from \"./active-set.ts\";\n\nexport class McpService {\n\t#disposed = false;\n\t#disposeCount = 0;\n\t#lastDisposeReason: McpDisposeReason | null = null;\n\t#sessionContext: McpSessionContext | null = null;\n\t#sessionStartCount = 0;\n\t#lastSessionStartReason: SessionStartEvent[\"reason\"] | null = null;\n\t#toolRefreshGeneration = 0;\n\t#config: ResolvedMcpConfig | null = null;\n\t#authAgentDir: string | undefined;\n\t#authEnv: Record<string, string | undefined> | undefined;\n\treadonly #pendingAuth = new Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider>();\n\t#refreshActiveSetWhenNoTools = false;\n\t#tierBRegistration: McpSessionRegistration | undefined;\n\t#historyScanned = false;\n\t#sessionOptions: McpSessionOptions = {};\n\t#pi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined;\n\treadonly #connections = new Map<string, McpConnectionEntry>();\n\treadonly #connectionKeysByName = new Map<string, string>();\n\n\tasync attachSession(\n\t\tevent: SessionStartEvent,\n\t\tctx: McpSessionContext,\n\t\t_pi?: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t\toptions: McpSessionOptions = {},\n\t): Promise<void> {\n\t\tthis.#sessionContext = ctx;\n\t\tthis.#sessionStartCount += 1;\n\t\tthis.#lastSessionStartReason = event.reason;\n\t\tconst config = loadMcpConfig({\n\t\t\tagentDir: options.agentDir,\n\t\t\tcwd: ctx.cwd,\n\t\t\tenv: options.env,\n\t\t\tprojectTrusted: options.projectTrusted ?? ctx.isProjectTrusted(),\n\t\t});\n\t\tthis.#config = config;\n\t\tthis.#pi = _pi;\n\t\tthis.#authAgentDir = options.agentDir;\n\t\tthis.#authEnv = options.env;\n\t\tthis.#sessionOptions = options;\n\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\tawait this.#syncFromConfig(config, options, event.reason !== \"reload\", _pi, toolRefreshGeneration);\n\t\tif (_pi !== undefined) await this.#registerDirectTools(_pi);\n\t\t// Replay promotion markers from the (possibly resumed) session history\n\t\t// BEFORE the first turn: the request tool snapshot is taken before the\n\t\t// per-turn context event fires, so the context-event replay alone lands\n\t\t// one turn late. Doing it here puts restored tools on the very first\n\t\t// wire payload after a --continue/resume.\n\t\tif (_pi !== undefined) this.#rehydrateFromSessionHistory(ctx);\n\t}\n\n\t/**\n\t * Register skill-declared MCP servers (todo 37). Skill servers are forced\n\t * into search mode with no directTools, so their catalogs register with\n\t * ZERO active tools until activateSkillMcpTools reveals them. A name\n\t * collision with a system-configured server keeps the system config and\n\t * returns a warning (system wins).\n\t */\n\tasync attachSkillMcpServers(\n\t\tdeclared: ReadonlyMap<string, { raw: Parameters<typeof resolveSkillMcpServer>[1]; sourcePath: string }>,\n\t): Promise<string[]> {\n\t\tconst config = this.#config;\n\t\tconst pi = this.#pi;\n\t\tif (config === null || pi === undefined) return [];\n\t\tconst warnings: string[] = [];\n\t\tlet added = 0;\n\t\tfor (const [name, decl] of declared) {\n\t\t\tconst existing = config.servers[name];\n\t\t\tif (existing !== undefined && existing.source !== \"skill\") {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`MCP server '${name}' from skill ${decl.sourcePath} collides with the ${existing.source} config; system config wins.`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveSkillMcpServer(name, decl.raw, decl.sourcePath);\n\t\t\tif (existing !== undefined && existing.configHash === resolved.configHash) continue;\n\t\t\tconfig.servers[name] = resolved;\n\t\t\tadded += 1;\n\t\t}\n\t\tif (added > 0) {\n\t\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\t\tawait this.#syncFromConfig(config, this.#sessionOptions, false, pi, toolRefreshGeneration);\n\t\t\tawait this.#registerDirectTools(pi);\n\t\t}\n\t\treturn warnings;\n\t}\n\n\t/** Registered searchable catalog (mapped name + server-side tool name),\n\t * used by the skills loader to compute activation targets. */\n\tgetTierBSearchable(): ReadonlyArray<{ name: string; toolName: string; server: string }> {\n\t\treturn this.#tierBRegistration?.searchable ?? [];\n\t}\n\n\t/** Connected servers that list prompts (todo 40), for slash registration. */\n\tgetMcpPromptServers(): readonly import(\"./prompts.ts\").McpPromptServer[] {\n\t\treturn this.#tierBRegistration?.promptServers ?? [];\n\t}\n\n\t/** Connected servers that list resources (todo 39), for mention expansion. */\n\tgetMcpResourceServers(): readonly McpResourceServer[] {\n\t\treturn this.#tierBRegistration?.resourceServers ?? [];\n\t}\n\n\t/** Reveal skill-owned tools (todo 37): activation is effective the next\n\t * turn, exactly like an mcp_search promotion. Unknown names are ignored. */\n\tactivateSkillMcpTools(names: readonly string[]): void {\n\t\tthis.#tierBRegistration?.activate(names);\n\t}\n\n\t#rehydrateFromSessionHistory(ctx: McpSessionContext): void {\n\t\tconst entries = ctx.sessionManager?.getEntries() ?? [];\n\t\tif (entries.length === 0) return;\n\t\tthis.rehydrateActiveToolsFromHistory(entries);\n\t}\n\n\tasync handleSessionShutdown(event: SessionShutdownEvent): Promise<void> {\n\t\tif (shouldDisposeMcpService(event.reason)) await this.dispose(event.reason);\n\t}\n\n\tasync dispose(reason: McpDisposeReason): Promise<void> {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tthis.#disposeCount += 1;\n\t\tthis.#lastDisposeReason = reason;\n\t\tthis.#sessionContext = null;\n\t\tthis.#config = null;\n\t\tconst entries = [...this.#connections.values()];\n\t\tthis.#connections.clear();\n\t\tthis.#connectionKeysByName.clear();\n\t\tawait Promise.all(entries.map((entry) => disposeEntryConnection(entry)));\n\t\tawait cleanupMcpOutputArtifacts();\n\t}\n\n\tisDisposed(): boolean {\n\t\treturn this.#disposed;\n\t}\n\n\tgetConnection(name: string): ServerConnection | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key)?.connection;\n\t}\n\n\tasync reconnectServer(name: string): Promise<void> {\n\t\tconst entry = this.#entryForName(name);\n\t\tif (entry === undefined) throw new Error(`Unknown MCP server: ${name || \"<missing>\"}`);\n\t\tawait reconnectMcpNow(entry.connection);\n\t}\n\n\tgetServerSnapshots(): McpServerSnapshot[] {\n\t\tconst names = new Set<string>(Object.keys(this.#config?.servers ?? {}));\n\t\tfor (const entry of this.#connections.values()) names.add(entry.name);\n\t\treturn [...names].sort().map((name) => this.#serverSnapshot(name));\n\t}\n\n\tgetLogLines(name: string, maxLines: number): string[] {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst lines = key === undefined ? [] : (this.#connections.get(key)?.logger.getRingBuffer() ?? []);\n\t\treturn lines.slice(Math.max(0, lines.length - maxLines));\n\t}\n\n\tasync getServerExposureStatus(name: string): Promise<McpServerExposureStatus> {\n\t\treturn await getMcpServiceExposureStatus(name, this.#config, this.#entryForName(name));\n\t}\n\n\trecordCall(name: string, elapsedMs: number, failed: boolean): void {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst entry = key === undefined ? undefined : this.#connections.get(key);\n\t\tif (entry === undefined) return;\n\t\tentry.counters.callCount += 1;\n\t\tentry.counters.totalLatencyMs += elapsedMs;\n\t\tif (failed) entry.counters.errorCount += 1;\n\t}\n\n\tgetSnapshot(): McpServiceSnapshot {\n\t\treturn {\n\t\t\tdisposed: this.#disposed,\n\t\t\tdisposeCount: this.#disposeCount,\n\t\t\tlastDisposeReason: this.#lastDisposeReason,\n\t\t\tsessionStartCount: this.#sessionStartCount,\n\t\t\tlastSessionStartReason: this.#lastSessionStartReason,\n\t\t\thasSessionContext: this.#sessionContext !== null,\n\t\t\tconnectionCount: this.#connections.size,\n\t\t};\n\t}\n\n\tasync #syncFromConfig(\n\t\tconfig: ResolvedMcpConfig,\n\t\toptions: McpSessionOptions,\n\t\tuseCache: boolean,\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined,\n\t\ttoolRefreshGeneration: number,\n\t): Promise<void> {\n\t\tconst cache = await readMcpCatalogCache(options.agentDir);\n\t\tconst hadConnectionsBeforeSync = this.#connections.size > 0;\n\t\tthis.#refreshActiveSetWhenNoTools = Object.keys(config.servers).length > 0 || hadConnectionsBeforeSync;\n\t\tconst wanted = new Map<string, ResolvedMcpServer>();\n\t\tvisitSpawnableMcpServers(config, (name, server) => {\n\t\t\twanted.set(name, server);\n\t\t});\n\t\tconst disposals: Promise<void>[] = [];\n\t\tfor (const entry of this.#connections.values()) {\n\t\t\tconst server = wanted.get(entry.name);\n\t\t\tconst key = server?.configHash === undefined ? undefined : `${entry.name}\\0${server.configHash}`;\n\t\t\tif (key === entry.key) continue;\n\t\t\tthis.#connections.delete(entry.key);\n\t\t\tthis.#connectionKeysByName.delete(entry.name);\n\t\t\tdisposals.push(disposeEntryConnection(entry));\n\t\t}\n\t\tawait Promise.all(disposals);\n\n\t\tconst connects: Promise<void>[] = [];\n\t\tfor (const [name, server] of wanted) {\n\t\t\tif (server.config === undefined || server.configHash === undefined) continue;\n\t\t\tconst key = `${name}\\0${server.configHash}`;\n\t\t\tif (this.#connections.has(key)) continue;\n\t\t\tconst logger = createMcpLogger(name, { logDir: options.logDir });\n\t\t\tconst authPlan = resolveServerAuth({\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tfor (const warning of detectLiteralBearerWarnings(name, server.config)) logger.warn(warning);\n\t\t\tconst connection = new ServerConnection({\n\t\t\t\tauthProvider: authPlan.provider,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tconst cachedCatalog = useCache ? getValidCachedServer(cache, name, server.configHash) : undefined;\n\t\t\tconst entry: McpConnectionEntry = {\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tauthPlan,\n\t\t\t\tcacheRefreshedAfterConnect: false,\n\t\t\t\tcachedCatalog,\n\t\t\t\tkey,\n\t\t\t\tname,\n\t\t\t\tconfigHash: server.configHash,\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\tcreatedAtMs: Date.now(),\n\t\t\t\tcounters: { callCount: 0, errorCount: 0, totalLatencyMs: 0, reconnectCount: 0 },\n\t\t\t};\n\t\t\tconfigureMcpConnectionLifecycle(connection, server.config, logger);\n\t\t\tconfigureMcpReconnect({\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\treconnect: async () => {\n\t\t\t\t\tentry.counters.reconnectCount += 1;\n\t\t\t\t\tentry.cacheRefreshedAfterConnect = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait entry.authPlan?.refresh?.ensureFresh();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst authError = markMcpConnectionNeedsAuth(entry.connection, error);\n\t\t\t\t\t\tif (authError !== undefined) {\n\t\t\t\t\t\t\tentry.logger.warn(authError.message);\n\t\t\t\t\t\t\tthrow authError;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tawait entry.connection.renew();\n\t\t\t\t\tawait connectAndRefreshMcpCatalog(entry, server.config);\n\t\t\t\t},\n\t\t\t\tshouldReconnect: () => !this.#disposed && this.#entryForName(name) === entry,\n\t\t\t});\n\t\t\tthis.#connections.set(key, entry);\n\t\t\tthis.#connectionKeysByName.set(name, key);\n\t\t\tthis.#wireListChanged(entry);\n\t\t\tif (shouldRaceMcpStartup(server.config.lifecycle)) {\n\t\t\t\tconnects.push(\n\t\t\t\t\traceMcpStartupConnect({\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\tregisterDirectTools: (targetPi) => this.#registerDirectTools(targetPi),\n\t\t\t\t\t\tserverConfig: server.config,\n\t\t\t\t\t\tshouldRefreshTools: () => !this.#disposed && this.#toolRefreshGeneration === toolRefreshGeneration,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (cachedCatalog === undefined) {\n\t\t\t\tconnects.push(ignoreStartupNeedsAuth(entry, connectAndRefreshMcpCatalog(entry, server.config)));\n\t\t\t}\n\t\t}\n\t\tawait Promise.all(connects);\n\t}\n\n\t#wireListChanged(entry: McpConnectionEntry): void {\n\t\tconst sink = { logger: { error: (message: string, data?: unknown) => entry.logger.error(message, data) } };\n\t\tconst coalescer = createMcpListChangeCoalescer({\n\t\t\tonRefresh: () => this.#handleServerToolsChanged(entry),\n\t\t\tscope: `mcp.list_changed.${entry.name}`,\n\t\t\tsink,\n\t\t});\n\t\tconst unsubscribe = entry.connection.onToolsChanged(() => coalescer.notify());\n\t\tentry.disposeListChanged = () => {\n\t\t\tunsubscribe();\n\t\t\tcoalescer.dispose();\n\t\t};\n\t}\n\n\t// Re-list a server on a coalesced list_changed and re-register: added tools\n\t// enter INACTIVE (registerToolsPreservingActiveSet keeps the active set), and\n\t// removed tools are tombstoned so a stale call fails cleanly.\n\tasync #handleServerToolsChanged(entry: McpConnectionEntry): Promise<void> {\n\t\tconst pi = this.#pi;\n\t\tconst config = this.#config;\n\t\tif (pi === undefined || config === null) return;\n\t\tconst server = config.servers[entry.name];\n\t\tif (server?.config === undefined || entry.connection.state !== \"connected\") return;\n\t\tconst catalog = await collectToolCatalog(entry.name, entry.connection, server.config, {\n\t\t\tagentDir: entry.agentDir,\n\t\t\toutputGuard: config.settings.outputGuard,\n\t\t});\n\t\tconst newNames = mapMcpCatalogNames(catalog).map(({ name }) => name);\n\t\tconst diff = diffMcpToolNames(entry.knownToolNames ?? newNames, newNames);\n\t\t// Tombstone removed tools BEFORE re-registration so the subsequent\n\t\t// setActiveTools (which excludes them) leaves the tombstones inactive.\n\t\tfor (const removed of diff.removed) pi.registerTool(buildMcpTombstoneDefinition(removed, entry.name));\n\t\tawait this.#registerDirectTools(pi);\n\t\tentry.knownToolNames = newNames;\n\t\tentry.lastListChangedDelta = formatMcpListChangedDelta(diff);\n\t}\n\n\tasync #registerDirectTools(\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t): Promise<void> {\n\t\tconst config = this.#config;\n\t\tif (config === null) return;\n\t\tthis.#tierBRegistration = await registerMcpServiceDirectTools(pi, config, this.#connections.values(), {\n\t\t\trefreshActiveSetWhenEmpty: this.#refreshActiveSetWhenNoTools,\n\t\t});\n\t\t// A (re-)registration recomputes the active set from config alone, so any\n\t\t// promotions recorded in history are worth replaying on the next scan.\n\t\tthis.#historyScanned = false;\n\t}\n\n\t/**\n\t * Replay mcp_search activation markers from session history through the\n\t * live tier-B activation path (see tool-search.ts). Returns newly activated\n\t * names; safe to call repeatedly (already-active names are skipped).\n\t */\n\trehydrateActiveToolsFromHistory(messages: readonly unknown[]): string[] {\n\t\tthis.#historyScanned = true;\n\t\treturn this.#tierBRegistration?.rehydrateFromHistory(messages) ?? [];\n\t}\n\n\t/**\n\t * Once-per-registration variant for per-turn context events: scanning the\n\t * full history each turn would cost O(history) JSON serialization, and a\n\t * live session's active set only drifts from history when a (re-)registration\n\t * rebuilt it — so scan once after each registration and skip otherwise.\n\t */\n\tmaybeRehydrateFromHistory(messages: readonly unknown[]): string[] {\n\t\tif (this.#historyScanned) return [];\n\t\treturn this.rehydrateActiveToolsFromHistory(messages);\n\t}\n\n\t#serverSnapshot(name: string): McpServerSnapshot {\n\t\tconst connection = this.getConnection(name);\n\t\tconnection?.refreshCapturedDiagnostics();\n\t\treturn buildMcpServerSnapshot(name, this.#config?.servers[name], connection, this.#entryForName(name));\n\t}\n\n\t#entryForName(name: string): McpConnectionEntry | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key);\n\t}\n\n\tgetPendingAuth(): Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider> {\n\t\treturn this.#pendingAuth;\n\t}\n\n\tgetAuthTarget(\n\t\tname: string,\n\t):\n\t\t| { config: McpServerConfig; agentDir?: string; env?: Record<string, string | undefined>; callbackUrl?: string }\n\t\t| undefined {\n\t\tconst server = this.#config?.servers[name];\n\t\tif (server?.config === undefined) return undefined;\n\t\treturn {\n\t\t\tconfig: server.config,\n\t\t\tagentDir: this.#authAgentDir,\n\t\t\tenv: this.#authEnv,\n\t\t\tcallbackUrl: this.#config?.settings.oauthCallbackUrl,\n\t\t};\n\t}\n\n\tgetCachedInstructions(name: string): string | undefined {\n\t\treturn this.#entryForName(name)?.cachedCatalog?.instructions;\n\t}\n\n\t/** Resolved `settings.nativeToolSearch` (auto | true | false | undefined).\n\t * Drives the native provider tool-search adapter gate. */\n\tgetNativeToolSearchSetting(): \"auto\" | boolean | undefined {\n\t\treturn this.#config?.settings.nativeToolSearch;\n\t}\n}\n\nlet service: McpService | null = null;\n\nexport function getMcpService(): McpService {\n\tif (service === null || service.isDisposed()) {\n\t\tservice = new McpService();\n\t}\n\treturn service;\n}\n\nexport function shouldDisposeMcpService(reason: SessionShutdownEvent[\"reason\"]): reason is McpDisposeReason {\n\treturn reason === \"quit\" || reason === \"reload\";\n}\n\nasync function disposeEntryConnection(entry: McpConnectionEntry): Promise<void> {\n\tentry.disposeListChanged?.();\n\tdisposeMcpReconnect(entry.connection);\n\tdisposeMcpConnectionLifecycle(entry.connection);\n\tawait entry.connection.dispose();\n}\n\nexport function resetMcpServiceForTests(): void {\n\tservice = null;\n}\n"]}
|
|
@@ -16,7 +16,6 @@ function formatRow(row) {
|
|
|
16
16
|
snapshot.name,
|
|
17
17
|
snapshot.configState,
|
|
18
18
|
`state=${snapshot.lifecycleState}`,
|
|
19
|
-
`origin=${snapshot.source ?? "n/a"}`,
|
|
20
19
|
`source=${snapshot.sourcePath ?? "n/a"}`,
|
|
21
20
|
`tools=${row.exposure.toolCount ?? "?"}`,
|
|
22
21
|
`uptime=${formatUptime(snapshot.uptimeMs)}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/status.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,SAAuC,EACvC,iBAAqE;IAErE,OAAO,OAAO,CAAC,GAAG,CACjB,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClC,QAAQ,EAAE,MAAM,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC;QAChD,QAAQ;KACR,CAAC,CAAC,CACH,C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Q,GAAG,IAAI,CAAC,GAAG,CAAC;AAC1C,CAAC","sourcesContent":["import type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport type { McpServerSnapshot } from \"./service-types.ts\";\n\nexport interface McpStatusRow {\n\treadonly exposure: McpServerExposureStatus;\n\treadonly snapshot: McpServerSnapshot;\n}\n\nexport async function buildMcpStatusRows(\n\tsnapshots: readonly McpServerSnapshot[],\n\tgetExposureStatus: (name: string) => Promise<McpServerExposureStatus>,\n): Promise<McpStatusRow[]> {\n\treturn Promise.all(\n\t\tsnapshots.map(async (snapshot) => ({\n\t\t\texposure: await getExposureStatus(snapshot.name),\n\t\t\tsnapshot,\n\t\t})),\n\t);\n}\n\nexport function formatMcpStatus(title: string, rows: readonly McpStatusRow[]): string {\n\treturn [title, ...rows.map(formatRow)].join(\"\\n\");\n}\n\nfunction formatRow(row: McpStatusRow): string {\n\tconst snapshot = row.snapshot;\n\tconst averageLatencyMs =\n\t\tsnapshot.counters.callCount === 0\n\t\t\t? 0\n\t\t\t: Math.round(snapshot.counters.totalLatencyMs / snapshot.counters.callCount);\n\treturn [\n\t\tsnapshot.name,\n\t\tsnapshot.configState,\n\t\t`state=${snapshot.lifecycleState}`,\n\t\t`source=${snapshot.sourcePath ?? \"n/a\"}`,\n\t\t`tools=${row.exposure.toolCount ?? \"?\"}`,\n\t\t`uptime=${formatUptime(snapshot.uptimeMs)}`,\n\t\t`calls=${snapshot.counters.callCount}`,\n\t\t`errors=${snapshot.counters.errorCount}`,\n\t\t`latency=${averageLatencyMs}ms`,\n\t\t`reconnects=${snapshot.counters.reconnectCount}`,\n\t\tsnapshot.lastError ? `lastError=${snapshot.lastError}` : \"\",\n\t\trow.exposure.hint ? `hint=${row.exposure.hint}` : \"\",\n\t]\n\t\t.filter((part) => part.length > 0)\n\t\t.join(\" \");\n}\n\nfunction formatUptime(uptimeMs: number | null): string {\n\tif (uptimeMs === null) return \"n/a\";\n\tif (uptimeMs < 1000) return \"<1s\";\n\treturn `${Math.round(uptimeMs / 1000)}s`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-fable-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAclH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-fable-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAclH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAExF"}
|
|
@@ -11,10 +11,6 @@ Terse shorthand between tool calls is fine; your final summary is for a reader w
|
|
|
11
11
|
Do not stop, summarize, or suggest a new session on account of context limits. Continue the work.`;
|
|
12
12
|
}
|
|
13
13
|
export function buildClaudeFable5Prompt(options) {
|
|
14
|
-
return buildDynamicSystemPrompt({
|
|
15
|
-
...options,
|
|
16
|
-
tuningSection: buildClaudeFable5Tuning(),
|
|
17
|
-
workstationDialect: "claude",
|
|
18
|
-
});
|
|
14
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeFable5Tuning() });
|
|
19
15
|
}
|
|
20
16
|
//# sourceMappingURL=claude-fable-5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-fable-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;;;kGAQ0F,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"claude-fable-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;;;kGAQ0F,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeFable5Tuning(): string {\n\treturn `When you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. When weighing a choice, give a recommendation, not a survey.\n\nBefore reporting progress, audit each claim against a tool result from this session. Only report work you can point to evidence for; if something is not yet verified, say so explicitly. If tests fail, say so with the output.\n\nPause for the user only when the work genuinely requires them: a destructive or irreversible action, a real scope change, or input only they can provide. If you hit one of these, ask and end the turn rather than ending on a promise. Before ending your turn, check your last paragraph: if it is a plan, a question, or a promise about work you have not done, do that work now with tool calls.\n\nTerse shorthand between tool calls is fine; your final summary is for a reader who did not see it. Lead with the outcome in complete sentences, then supporting detail. Keep output short by dropping detail that does not change what the reader does next, not by compressing into fragments, arrow chains, or labels you made up mid-task.\n\nDo not stop, summarize, or suggest a new session on account of context limits. Continue the work.`;\n}\n\nexport function buildClaudeFable5Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeFable5Tuning() });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAExF"}
|
|
@@ -5,10 +5,6 @@ function buildClaudeOpus45Tuning() {
|
|
|
5
5
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
6
6
|
}
|
|
7
7
|
export function buildClaudeOpus45Prompt(options) {
|
|
8
|
-
return buildDynamicSystemPrompt({
|
|
9
|
-
...options,
|
|
10
|
-
tuningSection: buildClaudeOpus45Tuning(),
|
|
11
|
-
workstationDialect: "claude",
|
|
12
|
-
});
|
|
8
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus45Tuning() });
|
|
13
9
|
}
|
|
14
10
|
//# sourceMappingURL=claude-opus-4-5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"claude-opus-4-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus45Tuning(): string {\n\treturn `Break complex tasks into ordered steps with clear dependencies before executing. When a request covers a set of items, apply it to every item rather than only the first, and state the scope you applied.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus45Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus45Tuning() });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-6.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-6.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAExF"}
|
|
@@ -5,10 +5,6 @@ function buildClaudeOpus46Tuning() {
|
|
|
5
5
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
6
6
|
}
|
|
7
7
|
export function buildClaudeOpus46Prompt(options) {
|
|
8
|
-
return buildDynamicSystemPrompt({
|
|
9
|
-
...options,
|
|
10
|
-
tuningSection: buildClaudeOpus46Tuning(),
|
|
11
|
-
workstationDialect: "claude",
|
|
12
|
-
});
|
|
8
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus46Tuning() });
|
|
13
9
|
}
|
|
14
10
|
//# sourceMappingURL=claude-opus-4-6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"claude-opus-4-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus46Tuning(): string {\n\treturn `Choose an approach and commit to it; revisit only when new information directly contradicts your reasoning. When a request covers a set of items, apply it to every item and state the scope you applied.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus46Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus46Tuning() });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAExF"}
|
|
@@ -9,10 +9,6 @@ For frontend design with no specified visual direction, derive one from the proj
|
|
|
9
9
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildClaudeOpus47Prompt(options) {
|
|
12
|
-
return buildDynamicSystemPrompt({
|
|
13
|
-
...options,
|
|
14
|
-
tuningSection: buildClaudeOpus47Tuning(),
|
|
15
|
-
workstationDialect: "claude",
|
|
16
|
-
});
|
|
12
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus47Tuning() });
|
|
17
13
|
}
|
|
18
14
|
//# sourceMappingURL=claude-opus-4-7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"claude-opus-4-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus47Tuning(): string {\n\treturn `Apply instructions at the scope the user evidently intends: \"every\", \"all\", and \"each\" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.\n\nPrefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up.\n\nFor frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus47Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus47Tuning() });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-8.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-8.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAExF"}
|
|
@@ -9,10 +9,6 @@ For frontend design with no specified visual direction, derive one from the proj
|
|
|
9
9
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildClaudeOpus48Prompt(options) {
|
|
12
|
-
return buildDynamicSystemPrompt({
|
|
13
|
-
...options,
|
|
14
|
-
tuningSection: buildClaudeOpus48Tuning(),
|
|
15
|
-
workstationDialect: "claude",
|
|
16
|
-
});
|
|
12
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus48Tuning() });
|
|
17
13
|
}
|
|
18
14
|
//# sourceMappingURL=claude-opus-4-8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-8.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"claude-opus-4-8.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus48Tuning(): string {\n\treturn `Apply instructions at the scope the user evidently intends: \"every\", \"all\", and \"each\" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.\n\nPrefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up. After a user turn, reason over what changed; do not re-derive facts already established in the conversation.\n\nFor frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus48Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildClaudeOpus48Tuning() });\n}\n"]}
|
|
@@ -9,6 +9,6 @@ Code toward the destination: define the outcome, constraints, and stopping condi
|
|
|
9
9
|
The intent gate routing line is non-optional every turn. For non-trivial tasks, call todowrite with atomic items before starting, keep exactly one item in progress, and complete each item immediately when done.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildGlm52Prompt(options) {
|
|
12
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGlm52Tuning()
|
|
12
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGlm52Tuning() });
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=glm-5-2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glm-5-2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/glm-5-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,gBAAgB;IACxB,OAAO;;;;;;mNAM2M,CAAC;AACpN,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"glm-5-2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/glm-5-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,gBAAgB;IACxB,OAAO;;;;;;mNAM2M,CAAC;AACpN,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildGlm52Tuning(): string {\n\treturn `You are running on GLM 5.2: Opus 4.6-class agent behavior tuned toward Fable 5 decisiveness and GPT 5.5 outcome-first coding. Apply literal scopes literally - \"every\", \"all\", and \"for each\" mean the full set. Prefer sufficient context over exhaustive context, pick minor decisions and note them, and use matching tools or skills immediately instead of under-reaching.\n\nCalibrate deliberation. Use extended reasoning only for genuine multi-step uncertainty; routine classification, file edits, and lookups should be decided directly. A cheap tool call beats long internal debate: act, inspect evidence, and verify.\n\nCode toward the destination: define the outcome, constraints, and stopping condition, then work without mechanical step-by-step recitation. In ultrawork mode, maintain absolute certainty discipline: preserve the goal, prove completion with evidence, and do not deliver partial work.\n\nThe intent gate routing line is non-optional every turn. For non-trivial tasks, call todowrite with atomic items before starting, keep exactly one item in progress, and complete each item immediately when done.`;\n}\n\nexport function buildGlm52Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGlm52Tuning() });\n}\n"]}
|
|
@@ -12,6 +12,6 @@ Compact after major milestones, not every turn. Keep the system prompt functiona
|
|
|
12
12
|
${buildFileOperationsTuning()}`;
|
|
13
13
|
}
|
|
14
14
|
export function buildGpt52Prompt(options) {
|
|
15
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt52Tuning()
|
|
15
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt52Tuning() });
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=gpt-5.2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;;;EAQN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"gpt-5.2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;;;EAQN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt52Tuning(): string {\n\treturn `Constrain verbosity explicitly: \"3-6 sentences\", \"max 5 bullets\", \"no preamble\". Do not over-explain simple tasks.\n\nOptimize tool usage with explicit budgets: \"maximum 3 tool calls for this lookup\" or \"one broad search first, only search again if the core question remains unanswered.\"\n\nImplement EXACTLY and ONLY what was requested. No extra features, no scope drift.\n\nCompact after major milestones, not every turn. Keep the system prompt functionally identical when resuming.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt52Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt52Tuning() });\n}\n"]}
|
|
@@ -10,6 +10,6 @@ After compaction, continue from the current state rather than re-deriving prior
|
|
|
10
10
|
${buildFileOperationsTuning()}`;
|
|
11
11
|
}
|
|
12
12
|
export function buildGpt53CodexPrompt(options) {
|
|
13
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt53CodexTuning()
|
|
13
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt53CodexTuning() });
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=gpt-5.3-codex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.3-codex.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.3-codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,qBAAqB;IAC7B,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAwC;IAC7E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"gpt-5.3-codex.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.3-codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,qBAAqB;IAC7B,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAwC;IAC7E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt53CodexTuning(): string {\n\treturn `Bias hard toward action. Implement directly with reasonable assumptions rather than stopping to ask. Do not produce upfront plans or preambles before acting — start working immediately.\n\nDo not re-state the goal between steps. When a milestone completes, move to the next without summarizing unless the user asked for a summary.\n\nAfter compaction, continue from the current state rather than re-deriving prior conclusions. Treat compacted items as opaque.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt53CodexPrompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt53CodexTuning() });\n}\n"]}
|
|
@@ -10,6 +10,6 @@ State when each tool should and should not be called. Specify parallel vs sequen
|
|
|
10
10
|
${buildFileOperationsTuning()}`;
|
|
11
11
|
}
|
|
12
12
|
export function buildGpt54Prompt(options) {
|
|
13
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt54Tuning()
|
|
13
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt54Tuning() });
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=gpt-5.4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.4.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"gpt-5.4.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt54Tuning(): string {\n\treturn `Use explicit section structure and step sequences for multi-step tasks — ordered steps with dependencies. When a specific response shape is needed, declare exact fields and order upfront, no extra text.\n\nDefault to medium reasoning effort. Escalate to high only for multi-constraint optimization, subtle bugs, or novel architecture decisions. Use low for classification, extraction, formatting.\n\nState when each tool should and should not be called. Specify parallel vs sequential tool use.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt54Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt54Tuning() });\n}\n"]}
|
|
@@ -76,6 +76,6 @@ No content restrictions: any topic, blunt language, unverified sources - handle
|
|
|
76
76
|
${buildFileOperationsTuning()}`;
|
|
77
77
|
}
|
|
78
78
|
export function buildGpt55Prompt(options) {
|
|
79
|
-
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt55Core
|
|
79
|
+
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt55Core });
|
|
80
80
|
}
|
|
81
81
|
//# sourceMappingURL=gpt-5.5.js.map
|