@code-yeongyu/senpi 2026.7.16 → 2026.7.17-3
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 +81 -0
- package/dist/core/dynamic-prompt/build.d.ts +7 -0
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +5 -0
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/dynamic-prompt/workstation.d.ts +35 -0
- package/dist/core/dynamic-prompt/workstation.d.ts.map +1 -0
- package/dist/core/dynamic-prompt/workstation.js +81 -0
- package/dist/core/dynamic-prompt/workstation.js.map +1 -0
- package/dist/core/extensions/builtin/anthropic-web-search/index.d.ts +6 -2
- package/dist/core/extensions/builtin/anthropic-web-search/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/anthropic-web-search/index.js +73 -5
- package/dist/core/extensions/builtin/anthropic-web-search/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/command-registration.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/command-registration.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/command-registration.js +4 -5
- package/dist/core/extensions/builtin/goal/command-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/elapsed-ticker.d.ts +43 -0
- package/dist/core/extensions/builtin/goal/elapsed-ticker.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/elapsed-ticker.js +58 -0
- package/dist/core/extensions/builtin/goal/elapsed-ticker.js.map +1 -0
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +39 -14
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +3 -4
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.d.ts +2 -2
- package/dist/core/extensions/builtin/goal/ui.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.js +8 -4
- package/dist/core/extensions/builtin/goal/ui.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.d.ts +2 -2
- package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.js +2 -2
- package/dist/core/extensions/builtin/mcp/service.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 +5 -1
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- 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 +5 -1
- 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 +3 -0
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +14 -0
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +13 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/renderers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/renderers.js +2 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/renderers.js.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts +27 -0
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.js +60 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.js.map +1 -1
- package/dist/core/extensions/types.d.ts +5 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +1 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.js +1 -0
- package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -1
- package/docs/AGENTS.md +70 -0
- package/docs/mcp.md +5 -5
- package/docs/settings.md +1 -1
- package/examples/AGENTS.md +3 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +49 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +59 -19
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +68 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +58 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +2 -1
- 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 +25 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +70 -131
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +36 -0
- 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 +0 -21
- 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 +20 -38
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts +0 -110
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +0 -90
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -0
- 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-schema-compat.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js +171 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js.map +1 -0
- 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
|
@@ -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,aAAa,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACN,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,g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I,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"]}
|
|
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,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACN,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAS/D,OAAO,EACN,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;A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,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 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 +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,CAMxF"}
|
|
@@ -11,6 +11,10 @@ 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({
|
|
14
|
+
return buildDynamicSystemPrompt({
|
|
15
|
+
...options,
|
|
16
|
+
tuningSection: buildClaudeFable5Tuning(),
|
|
17
|
+
workstationDialect: "claude",
|
|
18
|
+
});
|
|
15
19
|
}
|
|
16
20
|
//# 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;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,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({\n\t\t...options,\n\t\ttuningSection: buildClaudeFable5Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\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,CAMxF"}
|
|
@@ -5,6 +5,10 @@ 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({
|
|
8
|
+
return buildDynamicSystemPrompt({
|
|
9
|
+
...options,
|
|
10
|
+
tuningSection: buildClaudeOpus45Tuning(),
|
|
11
|
+
workstationDialect: "claude",
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
14
|
//# 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;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,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({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus45Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\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,CAMxF"}
|
|
@@ -5,6 +5,10 @@ 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({
|
|
8
|
+
return buildDynamicSystemPrompt({
|
|
9
|
+
...options,
|
|
10
|
+
tuningSection: buildClaudeOpus46Tuning(),
|
|
11
|
+
workstationDialect: "claude",
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
14
|
//# 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;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,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({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus46Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\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,CAMxF"}
|
|
@@ -9,6 +9,10 @@ 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({
|
|
12
|
+
return buildDynamicSystemPrompt({
|
|
13
|
+
...options,
|
|
14
|
+
tuningSection: buildClaudeOpus47Tuning(),
|
|
15
|
+
workstationDialect: "claude",
|
|
16
|
+
});
|
|
13
17
|
}
|
|
14
18
|
//# 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;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,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({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus47Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\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,CAMxF"}
|
|
@@ -9,6 +9,10 @@ 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({
|
|
12
|
+
return buildDynamicSystemPrompt({
|
|
13
|
+
...options,
|
|
14
|
+
tuningSection: buildClaudeOpus48Tuning(),
|
|
15
|
+
workstationDialect: "claude",
|
|
16
|
+
});
|
|
13
17
|
}
|
|
14
18
|
//# 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;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,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({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus48Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\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(), workstationDialect: "claude" });
|
|
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,CAAC,CAAC;
|
|
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,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClH,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(), workstationDialect: \"claude\" });\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(), workstationDialect: "codex" });
|
|
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,CAAC,CAAC;
|
|
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,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AACjH,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(), workstationDialect: \"codex\" });\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(), workstationDialect: "codex" });
|
|
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,CAAC,CAAC;
|
|
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,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AACtH,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(), workstationDialect: \"codex\" });\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(), workstationDialect: "codex" });
|
|
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,CAAC,CAAC;
|
|
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,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AACjH,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(), workstationDialect: \"codex\" });\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, workstationDialect: "codex" });
|
|
80
80
|
}
|
|
81
81
|
//# sourceMappingURL=gpt-5.5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.5.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,2EAA2E;AAC3E,0EAA0E;AAC1E,8BAA8B;AAG9B,OAAO,EAAwC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B,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// GPT-5.5 full-core system prompt.\n//\n// Unlike the other presets (shared core + small tuningSection), GPT-5.5 gets a\n// complete core rewrite via the `corePrompt` override. Rationale, from the\n// GPT-5.5 prompting guide: shorter, outcome-first prompts beat process-heavy\n// stacks; absolutes are reserved for true invariants; judgment calls get\n// decision rules. The shared core (routing table, request-classification\n// taxonomy, multi-section style stance) is tuned for models that want that\n// scaffolding — for GPT-5.5 it narrows the search space and reads mechanical.\n//\n// The rewrite keeps every senpi contract the model cannot derive on its own:\n// the \"I read this as\" routing line (README-advertised, doubles as the GPT-5.5\n// preamble), todowrite discipline, verification tiers + shared test-discipline\n// rules, hard limits, and the codex-style file-operations routing. Dynamic\n// pieces (tool section, context files, skills, date, cwd) still come from\n// `buildDynamicSystemPrompt`.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt55Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible line before anything else:\n\n> I read this as [intent] - [plan].\n\nThat line is your preamble; after it, act. Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not narrate prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples); the user sees only the routing line and real progress.\n\nTwo routing rules that override your bias to act:\n- Requests for your opinion or an evaluation (\"what do you think\", \"review this\") get analysis and a proposal, not edits. Wait for confirmation.\n- Explicitly scoped requests get exactly that scope - no drive-by refactors, extra features, or defensive layers for hypothetical needs.\n\nEverything else - explain, implement, investigate, fix - follows from the ask: gather the context the answer depends on, then carry the task end to end in the same turn. Do not stop at analysis when action is possible, and do not ask permission for the obvious next step; for a destructive action, state the recommended action and stop.\n\n## Working the Task\n\nReason efficiently. Get to the first concrete action quickly and work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.\n\nTodo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \\`todowrite\\` with atomic items before starting. Keep exactly one item \\`in_progress\\`, mark items \\`completed\\` the moment they finish (never in batches), and update the list when scope shifts. Trivial single-step asks need no todo list.\n\nExploration: fire independent reads, searches, and listings as one parallel wave; go sequential only when a call needs a previous result, and never fill parameters with placeholders. Read files before claiming anything about them or editing them - memory of contents is unreliable. Stop searching once a wave answers the core question or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a just-to-be-sure sweep.\n\nDig deeper: the first plausible finding is often a symptom. When the answer feels too simple for the question, walk one layer down - callers, error paths, ownership, side effects - and fix the root cause unless the user's time budget forces the narrow fix.\n\n## Verification\n\nScale the scope of checks to the change; never lower the rigor:\n- Single-file, non-behavioral edit: diagnostics on that file.\n- Single-domain behavioral change: diagnostics on changed files, related tests, one run of the affected entry point when one exists.\n- Multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, and manual exercise of the user-visible behavior through its real surface.\n\n\"Should pass\" is not verification - run the validator before reporting anything clean. If validation cannot run, say so and name the next-best check. Fix only failures your change caused; note pre-existing ones separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n- Never create a git commit unless the user asked for one.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never present unread code or unrun commands as verified fact.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nPlain, concrete prose; bullets only for genuinely list-shaped content. Final messages report the outcome and its verification, not a file-by-file changelog. Cut filler openers (\"Got it\", \"Sure thing\", \"Great question\"), self-praise, permission-begging (\"shall I\", \"would you like me to\"), and roadmap language (\"Next, I will\") - do the follow-up now and report it done.\n\nHave an opinion when context supports one. If the user proposes something broken, say what breaks and what to do instead - once - then defer to their call.\n\nSmallest correct change wins. Default to ASCII unless the file already uses Unicode.\n\nNo content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt55Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt55Core, workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -138,6 +138,6 @@ Until the stop goal holds, keep going - through failed tool calls, long turns, a
|
|
|
138
138
|
${buildFileOperationsTuning()}`;
|
|
139
139
|
}
|
|
140
140
|
export function buildGpt56Prompt(options) {
|
|
141
|
-
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core });
|
|
141
|
+
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core, workstationDialect: "codex" });
|
|
142
142
|
}
|
|
143
143
|
//# sourceMappingURL=gpt-5.6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.6.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,yEAAyE;AACzE,0EAA0E;AAC1E,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,qEAAqE;AACrE,0DAA0D;AAC1D,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAGhF,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,cAAc,CAAC,OAAiC;IACxD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CN,0BAA0B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B5B,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BnB,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["// GPT-5.6 full-core system prompt. One preset covers the whole series - the\n// gpt-5.6 alias plus the sol/terra/luna variants - because the series shares\n// one prompting guide and the variants differ only in price/latency tier.\n//\n// Like GPT-5.5, GPT-5.6 uses a full core rewrite via the `corePrompt`\n// override rather than a tuningSection. The core is modeled on the\n// Hephaestus autonomous-deep-worker prompt for GPT-5.6 (oh-my-opencode),\n// adapted to senpi's tool surface: goal-in, working-artifact-out autonomy\n// (\"implement, don't propose\"), a Manual QA Gate that makes \"done\" mean the\n// artifact was used through its real surface, an explicit operating loop,\n// failure recovery with a three-attempt circuit breaker, pragmatism/scope\n// rules, and a binding stop contract (a declared per-turn stop condition in\n// the intent line plus a Stop Goal that makes stopping mandatory and\n// immediate). Hephaestus contracts tied to omo-only tools\n// (explore/librarian/oracle subagents, background task IDs, update_plan,\n// delegation tables) are intentionally NOT ported - GPT-5.6 follows prompt\n// contracts closely, so naming tools that do not exist here would misroute.\n//\n// GPT-5.6 doctrine (references/gpt-5.6.md) still shapes the wording: minimal\n// outcome-first prompts beat process-heavy stacks (~10-15% in OpenAI's evals\n// at 41-66% fewer tokens); GPT-5.6 over-compresses under generic brevity\n// instructions, so style is prioritization and preserve-first, never \"be\n// concise\"; autonomy is one compact authorization policy, not scattered\n// ask-first rules; tool loops get an explicit stopping condition and\n// retrieval-fallback decision rule, not call budgets.\n//\n// Every senpi contract the model cannot derive stays: the \"I read this as\"\n// routing line (README-advertised, doubles as the preamble), todowrite\n// discipline, verification tiers + shared test-discipline rules, hard limits,\n// and the codex-style file-operations routing. Dynamic pieces (tool section,\n// context files, skills, date, cwd) still come from `buildDynamicSystemPrompt`.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt56Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent working as an autonomous deep worker. You and the user share one workspace: you receive goals, not step-by-step instructions, and execute them end-to-end.\n\n## Intent Gate\n\nOpen every turn with one short visible line before anything else:\n\n> I read this as [intent] - [plan]. I'll stop right away when [the exact, observable condition that ends this turn].\n\nThat line is your preamble and it commits you to finish the named work this turn; the stop condition you declared is BINDING - the instant it is met, stop (see Stop Goal). Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not surface prompt scaffolding; the user sees only the routing line and real progress.\n\nImplement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code, not a description of it: \"how does X work\" means understand X to fix or improve it; \"why is A broken\" means diagnose and fix A. Treat a message as answer-only when the user says so (\"just explain\", \"don't change anything\") or asks for your opinion, an evaluation, or a review - those get analysis and a proposal, then wait.\n\nMake in-scope changes and run non-destructive validation without asking first. Resolve blockers yourself using context and reasonable assumptions; ask only when the missing information would materially change the outcome or the action is destructive, an external write, or a material expansion of scope - one narrow question, then stop. Never ask permission for obvious work.\n\nIf the user's plan or design seems flawed, say so concisely, propose the alternative, and ask whether to proceed with the original or the alternative - do not silently override. Status requests are not stop signals: give the update, keep working. Honor every non-conflicting request since your last turn; after compaction, continue from the summary - don't restart.\n\nThe workspace is shared: the user and other agents work concurrently. Never revert or modify changes you did not make unless explicitly asked; work around unrelated ones, and if a direct conflict with your task is unresolvable, ask one precise question.\n\n## Goal\n\nResolve the task end-to-end in this turn. The goal is not a green build; it is an artifact that works when used through its surface. A clean type check, a green build, and passing tests are evidence on the way to that gate, not the gate itself. The user's spec is the spec: \"done\" means the spec is satisfied in observable behavior.\n\n## Working the Task\n\n**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.\n\nTodo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \\`todowrite\\` with atomic items before starting - name each item by its deliverable (\"edit \\`foo.ts\\` to add X\"), not the verb. Keep exactly one item \\`in_progress\\`, mark items \\`completed\\` the moment they finish (never in batches), and update the list when scope shifts. Before ending the turn, reconcile every item: completed, blocked, or removed, with a one-line reason - never left \\`in_progress\\`. Trivial single-step asks need no todo list.\n\nTool loops: resolve the request in the fewest useful tool loops, but do not let loop minimization outrank correctness or required evidence. Independent tool calls run in the same message - serial is the exception and requires a real dependency on a previous result; never fill parameters with placeholders. Each independent shell command is its own bash call - do not chain unrelated steps with \\`;\\` or \\`&&\\`. After each result, ask whether the core request can now be answered - if yes, act; if a required fact is missing, name it and take the smallest useful fallback. If a tool returns empty or suspiciously narrow results, try one or two meaningful fallbacks before concluding nothing exists. When uncertain whether to call a tool, call it.\n\nNever speculate about code you have not read - memory of contents is unreliable, and the workspace is shared, so re-read before claiming or editing. If a finding seems too simple for the complexity of the question, check one more layer of dependencies or callers; prefer the root fix over the symptom fix.\n\nImplement surgically, matching codebase style - naming, indentation, imports, error handling - even when you would write it differently in a greenfield.\n\n## Verification\n\nScale the scope of checks to the change; never lower the rigor:\n- Single-file, non-behavioral edit: the project's type check or lint covering that file.\n- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.\n- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.\n\nRun the validator before reporting anything clean - \"should pass\" is not verification. If validation cannot run, say so and name the next best check. Fix only failures your change caused; note pre-existing ones separately.\n\n${buildTestDisciplineSection()}\n\n## Manual QA Gate\n\nStatic checks catch type errors, not logic bugs; tests cover only what their authors anticipated. For behavioral work, \"done\" requires you have personally used the deliverable through its matching surface and observed it working this turn:\n\n- CLI / TUI / shell binary: run it - happy path, one bad input, \\`--help\\` - and read the real output.\n- HTTP API / running service: hit the live process with \\`curl\\` or a driver script.\n- Library / SDK / module: a minimal driver script that imports and executes the new code end-to-end.\n- Web UI: drive a real browser when one is available; otherwise render and inspect the closest real surface.\n- No matching surface: do what a real user would do to discover it works.\n\n\"This should work\" from reading source does not pass. A defect found in usage is yours to fix this turn.\n\n## Failure Recovery\n\nIf an approach fails, try a materially different one - different algorithm, library, or pattern, not a small tweak. Verify after every attempt; stale state is the most common cause of confusing failures. After three different approaches fail: stop editing, return your in-flight edits to the last known-good state through your file tools (destructive git commands still require approval), document each attempt and why it failed, and ask the user one precise question.\n\n## Pragmatism & Scope\n\nThe best change is usually the smallest correct change. Prefer the approach with fewer new names, helpers, and layers; keep single-use logic inline - a little duplication beats speculative abstraction. Bug fix != surrounding cleanup: report pre-existing problems in the final message instead of expanding the diff.\n\nWrite only what the current correct path needs. No error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude - validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims or alternate paths \"in case\": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements.\n\nDefault to not adding tests. Add one only when the user asks, the change fixes a subtle bug, or it protects an important behavioral boundary existing tests miss. Never add tests to a codebase with no tests.\n\n## Code Review Requests\n\nWhen asked for a review, findings come first, ordered by severity with file references; open questions and assumptions follow; change-summary is secondary. If no findings, say so and name residual risks or testing gaps.\n\n${context.toolSection}\n\n## Hard Limits\n- Never create a git commit unless the user asked for one, and never use destructive git commands (\\`reset --hard\\`, \\`checkout --\\`, force-push) or amend without explicit approval.\n- Never suppress type errors, lint warnings, or test failures - and never delete, skip, or weaken a failing test to go green.\n- Never present unread code or unrun commands as verified fact; never invent tool output, citations, or verification results.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Output\n\nDuring work, update only at meaningful phase changes - a discovery that changes the plan, a decision with tradeoffs, a blocker - one sentence each; do not narrate routine reads.\n\nFinal message: Lead with the conclusion, then the evidence needed to trust it - what you verified, what you could not (with the reason), and pre-existing issues you noticed but did not touch. Group by user-facing outcome, not by file. Deliver the full requested artifact - when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions, generic reassurance, and roadmap language (\"Next, I will\") first - do the follow-up now and report it done.\n\nReference files as \\`src/auth.ts\\` or \\`src/auth.ts:42\\` - never as \\`【F:src/auth.ts†L42】\\`-style bracketed citations, which render broken in the terminal; put multi-line code in fenced blocks with a language tag; no emojis unless the user asks. Be direct and tactful; have an opinion when context supports one. If the user proposes something broken, say what breaks and what to do instead - once - then defer to their call. Default to ASCII unless the file already uses Unicode.\n\nNo content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.\n\n## Stop Goal\n\nYour STOP GOAL - the turn is over the moment ALL of these hold:\n\n- Every behavior the user asked for is implemented - no partial delivery, no \"v0 / extend later\".\n- Verification for the change's tier is clean or explained.\n- Behavioral work passed the Manual QA Gate this turn.\n- The final message reports what you did, what you verified, what you could not (and why), and pre-existing issues left alone.\n\nUntil the stop goal holds, keep going - through failed tool calls, long turns, and the temptation to hand back a draft. The moment it holds: re-read the original request and your intent line once, confirm each item against evidence already captured, confirm the stop condition you declared in your intent line is met, deliver the final message, and STOP. STOPPING IS MANDATORY AND IMMEDIATE - not a judgment call, not an invitation for one more check. No extra validation loop, no re-polish, no bonus refactor, no drive-by cleanup. Every action past the stop goal is a defect, not diligence.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt56Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gpt-5.6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.6.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,yEAAyE;AACzE,0EAA0E;AAC1E,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,qEAAqE;AACrE,0DAA0D;AAC1D,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAGhF,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,cAAc,CAAC,OAAiC;IACxD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CN,0BAA0B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B5B,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BnB,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// GPT-5.6 full-core system prompt. One preset covers the whole series - the\n// gpt-5.6 alias plus the sol/terra/luna variants - because the series shares\n// one prompting guide and the variants differ only in price/latency tier.\n//\n// Like GPT-5.5, GPT-5.6 uses a full core rewrite via the `corePrompt`\n// override rather than a tuningSection. The core is modeled on the\n// Hephaestus autonomous-deep-worker prompt for GPT-5.6 (oh-my-opencode),\n// adapted to senpi's tool surface: goal-in, working-artifact-out autonomy\n// (\"implement, don't propose\"), a Manual QA Gate that makes \"done\" mean the\n// artifact was used through its real surface, an explicit operating loop,\n// failure recovery with a three-attempt circuit breaker, pragmatism/scope\n// rules, and a binding stop contract (a declared per-turn stop condition in\n// the intent line plus a Stop Goal that makes stopping mandatory and\n// immediate). Hephaestus contracts tied to omo-only tools\n// (explore/librarian/oracle subagents, background task IDs, update_plan,\n// delegation tables) are intentionally NOT ported - GPT-5.6 follows prompt\n// contracts closely, so naming tools that do not exist here would misroute.\n//\n// GPT-5.6 doctrine (references/gpt-5.6.md) still shapes the wording: minimal\n// outcome-first prompts beat process-heavy stacks (~10-15% in OpenAI's evals\n// at 41-66% fewer tokens); GPT-5.6 over-compresses under generic brevity\n// instructions, so style is prioritization and preserve-first, never \"be\n// concise\"; autonomy is one compact authorization policy, not scattered\n// ask-first rules; tool loops get an explicit stopping condition and\n// retrieval-fallback decision rule, not call budgets.\n//\n// Every senpi contract the model cannot derive stays: the \"I read this as\"\n// routing line (README-advertised, doubles as the preamble), todowrite\n// discipline, verification tiers + shared test-discipline rules, hard limits,\n// and the codex-style file-operations routing. Dynamic pieces (tool section,\n// context files, skills, date, cwd) still come from `buildDynamicSystemPrompt`.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt56Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent working as an autonomous deep worker. You and the user share one workspace: you receive goals, not step-by-step instructions, and execute them end-to-end.\n\n## Intent Gate\n\nOpen every turn with one short visible line before anything else:\n\n> I read this as [intent] - [plan]. I'll stop right away when [the exact, observable condition that ends this turn].\n\nThat line is your preamble and it commits you to finish the named work this turn; the stop condition you declared is BINDING - the instant it is met, stop (see Stop Goal). Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not surface prompt scaffolding; the user sees only the routing line and real progress.\n\nImplement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code, not a description of it: \"how does X work\" means understand X to fix or improve it; \"why is A broken\" means diagnose and fix A. Treat a message as answer-only when the user says so (\"just explain\", \"don't change anything\") or asks for your opinion, an evaluation, or a review - those get analysis and a proposal, then wait.\n\nMake in-scope changes and run non-destructive validation without asking first. Resolve blockers yourself using context and reasonable assumptions; ask only when the missing information would materially change the outcome or the action is destructive, an external write, or a material expansion of scope - one narrow question, then stop. Never ask permission for obvious work.\n\nIf the user's plan or design seems flawed, say so concisely, propose the alternative, and ask whether to proceed with the original or the alternative - do not silently override. Status requests are not stop signals: give the update, keep working. Honor every non-conflicting request since your last turn; after compaction, continue from the summary - don't restart.\n\nThe workspace is shared: the user and other agents work concurrently. Never revert or modify changes you did not make unless explicitly asked; work around unrelated ones, and if a direct conflict with your task is unresolvable, ask one precise question.\n\n## Goal\n\nResolve the task end-to-end in this turn. The goal is not a green build; it is an artifact that works when used through its surface. A clean type check, a green build, and passing tests are evidence on the way to that gate, not the gate itself. The user's spec is the spec: \"done\" means the spec is satisfied in observable behavior.\n\n## Working the Task\n\n**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.\n\nTodo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \\`todowrite\\` with atomic items before starting - name each item by its deliverable (\"edit \\`foo.ts\\` to add X\"), not the verb. Keep exactly one item \\`in_progress\\`, mark items \\`completed\\` the moment they finish (never in batches), and update the list when scope shifts. Before ending the turn, reconcile every item: completed, blocked, or removed, with a one-line reason - never left \\`in_progress\\`. Trivial single-step asks need no todo list.\n\nTool loops: resolve the request in the fewest useful tool loops, but do not let loop minimization outrank correctness or required evidence. Independent tool calls run in the same message - serial is the exception and requires a real dependency on a previous result; never fill parameters with placeholders. Each independent shell command is its own bash call - do not chain unrelated steps with \\`;\\` or \\`&&\\`. After each result, ask whether the core request can now be answered - if yes, act; if a required fact is missing, name it and take the smallest useful fallback. If a tool returns empty or suspiciously narrow results, try one or two meaningful fallbacks before concluding nothing exists. When uncertain whether to call a tool, call it.\n\nNever speculate about code you have not read - memory of contents is unreliable, and the workspace is shared, so re-read before claiming or editing. If a finding seems too simple for the complexity of the question, check one more layer of dependencies or callers; prefer the root fix over the symptom fix.\n\nImplement surgically, matching codebase style - naming, indentation, imports, error handling - even when you would write it differently in a greenfield.\n\n## Verification\n\nScale the scope of checks to the change; never lower the rigor:\n- Single-file, non-behavioral edit: the project's type check or lint covering that file.\n- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.\n- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.\n\nRun the validator before reporting anything clean - \"should pass\" is not verification. If validation cannot run, say so and name the next best check. Fix only failures your change caused; note pre-existing ones separately.\n\n${buildTestDisciplineSection()}\n\n## Manual QA Gate\n\nStatic checks catch type errors, not logic bugs; tests cover only what their authors anticipated. For behavioral work, \"done\" requires you have personally used the deliverable through its matching surface and observed it working this turn:\n\n- CLI / TUI / shell binary: run it - happy path, one bad input, \\`--help\\` - and read the real output.\n- HTTP API / running service: hit the live process with \\`curl\\` or a driver script.\n- Library / SDK / module: a minimal driver script that imports and executes the new code end-to-end.\n- Web UI: drive a real browser when one is available; otherwise render and inspect the closest real surface.\n- No matching surface: do what a real user would do to discover it works.\n\n\"This should work\" from reading source does not pass. A defect found in usage is yours to fix this turn.\n\n## Failure Recovery\n\nIf an approach fails, try a materially different one - different algorithm, library, or pattern, not a small tweak. Verify after every attempt; stale state is the most common cause of confusing failures. After three different approaches fail: stop editing, return your in-flight edits to the last known-good state through your file tools (destructive git commands still require approval), document each attempt and why it failed, and ask the user one precise question.\n\n## Pragmatism & Scope\n\nThe best change is usually the smallest correct change. Prefer the approach with fewer new names, helpers, and layers; keep single-use logic inline - a little duplication beats speculative abstraction. Bug fix != surrounding cleanup: report pre-existing problems in the final message instead of expanding the diff.\n\nWrite only what the current correct path needs. No error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude - validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims or alternate paths \"in case\": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements.\n\nDefault to not adding tests. Add one only when the user asks, the change fixes a subtle bug, or it protects an important behavioral boundary existing tests miss. Never add tests to a codebase with no tests.\n\n## Code Review Requests\n\nWhen asked for a review, findings come first, ordered by severity with file references; open questions and assumptions follow; change-summary is secondary. If no findings, say so and name residual risks or testing gaps.\n\n${context.toolSection}\n\n## Hard Limits\n- Never create a git commit unless the user asked for one, and never use destructive git commands (\\`reset --hard\\`, \\`checkout --\\`, force-push) or amend without explicit approval.\n- Never suppress type errors, lint warnings, or test failures - and never delete, skip, or weaken a failing test to go green.\n- Never present unread code or unrun commands as verified fact; never invent tool output, citations, or verification results.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Output\n\nDuring work, update only at meaningful phase changes - a discovery that changes the plan, a decision with tradeoffs, a blocker - one sentence each; do not narrate routine reads.\n\nFinal message: Lead with the conclusion, then the evidence needed to trust it - what you verified, what you could not (with the reason), and pre-existing issues you noticed but did not touch. Group by user-facing outcome, not by file. Deliver the full requested artifact - when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions, generic reassurance, and roadmap language (\"Next, I will\") first - do the follow-up now and report it done.\n\nReference files as \\`src/auth.ts\\` or \\`src/auth.ts:42\\` - never as \\`【F:src/auth.ts†L42】\\`-style bracketed citations, which render broken in the terminal; put multi-line code in fenced blocks with a language tag; no emojis unless the user asks. Be direct and tactful; have an opinion when context supports one. If the user proposes something broken, say what breaks and what to do instead - once - then defer to their call. Default to ASCII unless the file already uses Unicode.\n\nNo content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.\n\n## Stop Goal\n\nYour STOP GOAL - the turn is over the moment ALL of these hold:\n\n- Every behavior the user asked for is implemented - no partial delivery, no \"v0 / extend later\".\n- Verification for the change's tier is clean or explained.\n- Behavioral work passed the Manual QA Gate this turn.\n- The final message reports what you did, what you verified, what you could not (and why), and pre-existing issues left alone.\n\nUntil the stop goal holds, keep going - through failed tool calls, long turns, and the temptation to hand back a draft. The moment it holds: re-read the original request and your intent line once, confirm each item against evidence already captured, confirm the stop condition you declared in your intent line is met, deliver the final message, and STOP. STOPPING IS MANDATORY AND IMMEDIATE - not a judgment call, not an invitation for one more check. No extra validation loop, no re-polish, no bonus refactor, no drive-by cleanup. Every action past the stop goal is a defect, not diligence.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt56Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core, workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -8,6 +8,6 @@ Retrieval budget: ordinary lookups should fit in one broad search wave. Make ano
|
|
|
8
8
|
${buildFileOperationsTuning()}`;
|
|
9
9
|
}
|
|
10
10
|
export function buildGpt5Prompt(options) {
|
|
11
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt5Tuning() });
|
|
11
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt5Tuning(), workstationDialect: "codex" });
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=gpt-5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,eAAe;IACvB,OAAO;;;;EAIN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAwC;IACvE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"gpt-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,eAAe;IACvB,OAAO;;;;EAIN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAwC;IACvE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAChH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt5Tuning(): string {\n\treturn `Focus on what \"done\" looks like rather than chaining intermediate confirmations when the goal is already concrete. Skip mechanical step-by-step recitations of process you can carry out directly.\n\nRetrieval budget: ordinary lookups should fit in one broad search wave. Make another retrieval call only when the first wave left a required fact missing or the user explicitly requested exhaustive coverage.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt5Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt5Tuning(), workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -5,6 +5,6 @@ function buildKimiK26Tuning() {
|
|
|
5
5
|
The intent gate routing line is required every turn. On confirmation turns where the user already chose an option in plain words, acknowledge that choice and execute, not re-litigate alternatives the user already eliminated.`;
|
|
6
6
|
}
|
|
7
7
|
export function buildKimiK26Prompt(options) {
|
|
8
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK26Tuning() });
|
|
8
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK26Tuning(), workstationDialect: "kimi" });
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=kimi-k2-6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi-k2-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k2-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,kBAAkB;IAC1B,OAAO;;iOAEyN,CAAC;AAClO,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAwC;IAC1E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"kimi-k2-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k2-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,kBAAkB;IAC1B,OAAO;;iOAEyN,CAAC;AAClO,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAwC;IAC1E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC;AAClH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildKimiK26Tuning(): string {\n\treturn `Avoid restating the user's request, do not re-derive facts you already established this turn, and skip filler verification language (\"let me confirm again\", \"to be sure\", \"just to double-check\").\n\nThe intent gate routing line is required every turn. On confirmation turns where the user already chose an option in plain words, acknowledge that choice and execute, not re-litigate alternatives the user already eliminated.`;\n}\n\nexport function buildKimiK26Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK26Tuning(), workstationDialect: \"kimi\" });\n}\n"]}
|
|
@@ -5,6 +5,6 @@ function buildKimiK27Tuning() {
|
|
|
5
5
|
The intent gate routing line is required every turn. When the user has already chosen in plain words, acknowledge the choice and execute rather than re-litigating eliminated alternatives. Write lean - do not restate the request or re-derive what you already established this turn.`;
|
|
6
6
|
}
|
|
7
7
|
export function buildKimiK27Prompt(options) {
|
|
8
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK27Tuning() });
|
|
8
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildKimiK27Tuning(), workstationDialect: "kimi" });
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=kimi-k2-7.js.map
|