@tulex-cli/tulex-code 0.1.1
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/README.md +54 -0
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +98 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +121 -0
- package/dist/src/acp-integration/acpAgent.d.ts +59 -0
- package/dist/src/acp-integration/acpAgent.js +3646 -0
- package/dist/src/acp-integration/acpAgent.js.map +1 -0
- package/dist/src/acp-integration/acpAgent.test.d.ts +6 -0
- package/dist/src/acp-integration/acpAgent.test.js +3690 -0
- package/dist/src/acp-integration/acpAgent.test.js.map +1 -0
- package/dist/src/acp-integration/acpAgent.worktree.test.d.ts +16 -0
- package/dist/src/acp-integration/acpAgent.worktree.test.js +354 -0
- package/dist/src/acp-integration/acpAgent.worktree.test.js.map +1 -0
- package/dist/src/acp-integration/authMethods.d.ts +9 -0
- package/dist/src/acp-integration/authMethods.js +28 -0
- package/dist/src/acp-integration/authMethods.js.map +1 -0
- package/dist/src/acp-integration/authMethods.test.d.ts +6 -0
- package/dist/src/acp-integration/authMethods.test.js +23 -0
- package/dist/src/acp-integration/authMethods.test.js.map +1 -0
- package/dist/src/acp-integration/authPreflight.test.d.ts +6 -0
- package/dist/src/acp-integration/authPreflight.test.js +54 -0
- package/dist/src/acp-integration/authPreflight.test.js.map +1 -0
- package/dist/src/acp-integration/errorCodes.d.ts +15 -0
- package/dist/src/acp-integration/errorCodes.js +22 -0
- package/dist/src/acp-integration/errorCodes.js.map +1 -0
- package/dist/src/acp-integration/runtimeOutputDirContext.d.ts +2 -0
- package/dist/src/acp-integration/runtimeOutputDirContext.js +5 -0
- package/dist/src/acp-integration/runtimeOutputDirContext.js.map +1 -0
- package/dist/src/acp-integration/runtimeOutputDirContext.test.d.ts +1 -0
- package/dist/src/acp-integration/runtimeOutputDirContext.test.js +29 -0
- package/dist/src/acp-integration/runtimeOutputDirContext.test.js.map +1 -0
- package/dist/src/acp-integration/service/filesystem.d.ts +17 -0
- package/dist/src/acp-integration/service/filesystem.js +73 -0
- package/dist/src/acp-integration/service/filesystem.js.map +1 -0
- package/dist/src/acp-integration/service/filesystem.test.d.ts +6 -0
- package/dist/src/acp-integration/service/filesystem.test.js +85 -0
- package/dist/src/acp-integration/service/filesystem.test.js.map +1 -0
- package/dist/src/acp-integration/session/HistoryReplayer.d.ts +63 -0
- package/dist/src/acp-integration/session/HistoryReplayer.js +222 -0
- package/dist/src/acp-integration/session/HistoryReplayer.js.map +1 -0
- package/dist/src/acp-integration/session/HistoryReplayer.test.d.ts +6 -0
- package/dist/src/acp-integration/session/HistoryReplayer.test.js +405 -0
- package/dist/src/acp-integration/session/HistoryReplayer.test.js.map +1 -0
- package/dist/src/acp-integration/session/Session.d.ts +150 -0
- package/dist/src/acp-integration/session/Session.js +2381 -0
- package/dist/src/acp-integration/session/Session.js.map +1 -0
- package/dist/src/acp-integration/session/Session.test.d.ts +6 -0
- package/dist/src/acp-integration/session/Session.test.js +3845 -0
- package/dist/src/acp-integration/session/Session.test.js.map +1 -0
- package/dist/src/acp-integration/session/Session.worktree.test.d.ts +18 -0
- package/dist/src/acp-integration/session/Session.worktree.test.js +195 -0
- package/dist/src/acp-integration/session/Session.worktree.test.js.map +1 -0
- package/dist/src/acp-integration/session/SubAgentTracker.d.ts +58 -0
- package/dist/src/acp-integration/session/SubAgentTracker.js +208 -0
- package/dist/src/acp-integration/session/SubAgentTracker.js.map +1 -0
- package/dist/src/acp-integration/session/SubAgentTracker.test.d.ts +6 -0
- package/dist/src/acp-integration/session/SubAgentTracker.test.js +612 -0
- package/dist/src/acp-integration/session/SubAgentTracker.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/BaseEmitter.d.ts +34 -0
- package/dist/src/acp-integration/session/emitters/BaseEmitter.js +53 -0
- package/dist/src/acp-integration/session/emitters/BaseEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.d.ts +61 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.js +124 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.test.js +202 -0
- package/dist/src/acp-integration/session/emitters/MessageEmitter.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.d.ts +39 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.js +83 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.test.js +176 -0
- package/dist/src/acp-integration/session/emitters/PlanEmitter.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.d.ts +82 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.js +284 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.js +607 -0
- package/dist/src/acp-integration/session/emitters/ToolCallEmitter.test.js.map +1 -0
- package/dist/src/acp-integration/session/emitters/index.d.ts +9 -0
- package/dist/src/acp-integration/session/emitters/index.js +10 -0
- package/dist/src/acp-integration/session/emitters/index.js.map +1 -0
- package/dist/src/acp-integration/session/index.d.ts +24 -0
- package/dist/src/acp-integration/session/index.js +16 -0
- package/dist/src/acp-integration/session/index.js.map +1 -0
- package/dist/src/acp-integration/session/permissionUtils.d.ts +9 -0
- package/dist/src/acp-integration/session/permissionUtils.js +165 -0
- package/dist/src/acp-integration/session/permissionUtils.js.map +1 -0
- package/dist/src/acp-integration/session/permissionUtils.test.d.ts +6 -0
- package/dist/src/acp-integration/session/permissionUtils.test.js +83 -0
- package/dist/src/acp-integration/session/permissionUtils.test.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/LlmRewriter.d.ts +26 -0
- package/dist/src/acp-integration/session/rewrite/LlmRewriter.js +131 -0
- package/dist/src/acp-integration/session/rewrite/LlmRewriter.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/LlmRewriter.test.d.ts +6 -0
- package/dist/src/acp-integration/session/rewrite/LlmRewriter.test.js +188 -0
- package/dist/src/acp-integration/session/rewrite/LlmRewriter.test.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.d.ts +42 -0
- package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.js +159 -0
- package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.test.d.ts +6 -0
- package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.test.js +255 -0
- package/dist/src/acp-integration/session/rewrite/MessageRewriteMiddleware.test.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/README.md +35 -0
- package/dist/src/acp-integration/session/rewrite/TurnBuffer.d.ts +25 -0
- package/dist/src/acp-integration/session/rewrite/TurnBuffer.js +53 -0
- package/dist/src/acp-integration/session/rewrite/TurnBuffer.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/TurnBuffer.test.d.ts +6 -0
- package/dist/src/acp-integration/session/rewrite/TurnBuffer.test.js +95 -0
- package/dist/src/acp-integration/session/rewrite/TurnBuffer.test.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/config.d.ts +13 -0
- package/dist/src/acp-integration/session/rewrite/config.js +19 -0
- package/dist/src/acp-integration/session/rewrite/config.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/config.test.d.ts +6 -0
- package/dist/src/acp-integration/session/rewrite/config.test.js +72 -0
- package/dist/src/acp-integration/session/rewrite/config.test.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/index.d.ts +8 -0
- package/dist/src/acp-integration/session/rewrite/index.js +8 -0
- package/dist/src/acp-integration/session/rewrite/index.js.map +1 -0
- package/dist/src/acp-integration/session/rewrite/types.d.ts +36 -0
- package/dist/src/acp-integration/session/rewrite/types.js +7 -0
- package/dist/src/acp-integration/session/rewrite/types.js.map +1 -0
- package/dist/src/acp-integration/session/types.d.ts +93 -0
- package/dist/src/acp-integration/session/types.js +7 -0
- package/dist/src/acp-integration/session/types.js.map +1 -0
- package/dist/src/commands/auth.d.ts +9 -0
- package/dist/src/commands/auth.js +55 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/auth.test.d.ts +6 -0
- package/dist/src/commands/auth.test.js +84 -0
- package/dist/src/commands/auth.test.js.map +1 -0
- package/dist/src/commands/channel/channel-registry.d.ts +4 -0
- package/dist/src/commands/channel/channel-registry.js +33 -0
- package/dist/src/commands/channel/channel-registry.js.map +1 -0
- package/dist/src/commands/channel/config-utils.d.ts +4 -0
- package/dist/src/commands/channel/config-utils.js +66 -0
- package/dist/src/commands/channel/config-utils.js.map +1 -0
- package/dist/src/commands/channel/config-utils.test.d.ts +1 -0
- package/dist/src/commands/channel/config-utils.test.js +142 -0
- package/dist/src/commands/channel/config-utils.test.js.map +1 -0
- package/dist/src/commands/channel/configure.d.ts +4 -0
- package/dist/src/commands/channel/configure.js +65 -0
- package/dist/src/commands/channel/configure.js.map +1 -0
- package/dist/src/commands/channel/pairing.d.ts +8 -0
- package/dist/src/commands/channel/pairing.js +49 -0
- package/dist/src/commands/channel/pairing.js.map +1 -0
- package/dist/src/commands/channel/pidfile.d.ts +25 -0
- package/dist/src/commands/channel/pidfile.js +104 -0
- package/dist/src/commands/channel/pidfile.js.map +1 -0
- package/dist/src/commands/channel/pidfile.test.d.ts +1 -0
- package/dist/src/commands/channel/pidfile.test.js +143 -0
- package/dist/src/commands/channel/pidfile.test.js.map +1 -0
- package/dist/src/commands/channel/start.d.ts +16 -0
- package/dist/src/commands/channel/start.js +352 -0
- package/dist/src/commands/channel/start.js.map +1 -0
- package/dist/src/commands/channel/start.test.d.ts +1 -0
- package/dist/src/commands/channel/start.test.js +156 -0
- package/dist/src/commands/channel/start.test.js.map +1 -0
- package/dist/src/commands/channel/status.d.ts +2 -0
- package/dist/src/commands/channel/status.js +58 -0
- package/dist/src/commands/channel/status.js.map +1 -0
- package/dist/src/commands/channel/stop.d.ts +2 -0
- package/dist/src/commands/channel/stop.js +34 -0
- package/dist/src/commands/channel/stop.js.map +1 -0
- package/dist/src/commands/channel.d.ts +2 -0
- package/dist/src/commands/channel.js +29 -0
- package/dist/src/commands/channel.js.map +1 -0
- package/dist/src/commands/extensions/consent.d.ts +47 -0
- package/dist/src/commands/extensions/consent.js +182 -0
- package/dist/src/commands/extensions/consent.js.map +1 -0
- package/dist/src/commands/extensions/consent.test.d.ts +6 -0
- package/dist/src/commands/extensions/consent.test.js +277 -0
- package/dist/src/commands/extensions/consent.test.js.map +1 -0
- package/dist/src/commands/extensions/disable.d.ts +13 -0
- package/dist/src/commands/extensions/disable.js +65 -0
- package/dist/src/commands/extensions/disable.js.map +1 -0
- package/dist/src/commands/extensions/disable.test.d.ts +6 -0
- package/dist/src/commands/extensions/disable.test.js +101 -0
- package/dist/src/commands/extensions/disable.test.js.map +1 -0
- package/dist/src/commands/extensions/enable.d.ts +13 -0
- package/dist/src/commands/extensions/enable.js +70 -0
- package/dist/src/commands/extensions/enable.js.map +1 -0
- package/dist/src/commands/extensions/enable.test.d.ts +6 -0
- package/dist/src/commands/extensions/enable.test.js +93 -0
- package/dist/src/commands/extensions/enable.test.js.map +1 -0
- package/dist/src/commands/extensions/examples/agent/agents/diary.md +86 -0
- package/dist/src/commands/extensions/examples/agent/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/commands/commands/fs/grep-code.md +3 -0
- package/dist/src/commands/extensions/examples/commands/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
- package/dist/src/commands/extensions/examples/context/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
- package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
- package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +12 -0
- package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
- package/dist/src/commands/extensions/examples/skills/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/skills/skills/synonyms/SKILL.md +48 -0
- package/dist/src/commands/extensions/install.d.ts +17 -0
- package/dist/src/commands/extensions/install.js +105 -0
- package/dist/src/commands/extensions/install.js.map +1 -0
- package/dist/src/commands/extensions/install.test.d.ts +6 -0
- package/dist/src/commands/extensions/install.test.js +164 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -0
- package/dist/src/commands/extensions/link.d.ts +12 -0
- package/dist/src/commands/extensions/link.js +48 -0
- package/dist/src/commands/extensions/link.js.map +1 -0
- package/dist/src/commands/extensions/link.test.d.ts +6 -0
- package/dist/src/commands/extensions/link.test.js +74 -0
- package/dist/src/commands/extensions/link.test.js.map +1 -0
- package/dist/src/commands/extensions/list.d.ts +8 -0
- package/dist/src/commands/extensions/list.js +35 -0
- package/dist/src/commands/extensions/list.js.map +1 -0
- package/dist/src/commands/extensions/list.test.d.ts +6 -0
- package/dist/src/commands/extensions/list.test.js +76 -0
- package/dist/src/commands/extensions/list.test.js.map +1 -0
- package/dist/src/commands/extensions/new.d.ts +7 -0
- package/dist/src/commands/extensions/new.js +95 -0
- package/dist/src/commands/extensions/new.js.map +1 -0
- package/dist/src/commands/extensions/new.test.d.ts +6 -0
- package/dist/src/commands/extensions/new.test.js +59 -0
- package/dist/src/commands/extensions/new.test.js.map +1 -0
- package/dist/src/commands/extensions/settings.d.ts +7 -0
- package/dist/src/commands/extensions/settings.js +115 -0
- package/dist/src/commands/extensions/settings.js.map +1 -0
- package/dist/src/commands/extensions/settings.test.d.ts +6 -0
- package/dist/src/commands/extensions/settings.test.js +251 -0
- package/dist/src/commands/extensions/settings.test.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.d.ts +12 -0
- package/dist/src/commands/extensions/uninstall.js +50 -0
- package/dist/src/commands/extensions/uninstall.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
- package/dist/src/commands/extensions/uninstall.test.js +18 -0
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
- package/dist/src/commands/extensions/update.d.ts +13 -0
- package/dist/src/commands/extensions/update.js +102 -0
- package/dist/src/commands/extensions/update.js.map +1 -0
- package/dist/src/commands/extensions/update.test.d.ts +6 -0
- package/dist/src/commands/extensions/update.test.js +185 -0
- package/dist/src/commands/extensions/update.test.js.map +1 -0
- package/dist/src/commands/extensions/utils.d.ts +8 -0
- package/dist/src/commands/extensions/utils.js +79 -0
- package/dist/src/commands/extensions/utils.js.map +1 -0
- package/dist/src/commands/extensions/utils.test.d.ts +6 -0
- package/dist/src/commands/extensions/utils.test.js +147 -0
- package/dist/src/commands/extensions/utils.test.js.map +1 -0
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +35 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/extensions.test.d.ts +6 -0
- package/dist/src/commands/extensions.test.js +72 -0
- package/dist/src/commands/extensions.test.js.map +1 -0
- package/dist/src/commands/hooks.d.ts +7 -0
- package/dist/src/commands/hooks.js +20 -0
- package/dist/src/commands/hooks.js.map +1 -0
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +247 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +118 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/reconnect.d.ts +7 -0
- package/dist/src/commands/mcp/reconnect.js +154 -0
- package/dist/src/commands/mcp/reconnect.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +54 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +25 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/commands/review/cleanup.d.ts +7 -0
- package/dist/src/commands/review/cleanup.js +81 -0
- package/dist/src/commands/review/cleanup.js.map +1 -0
- package/dist/src/commands/review/deterministic.d.ts +7 -0
- package/dist/src/commands/review/deterministic.js +474 -0
- package/dist/src/commands/review/deterministic.js.map +1 -0
- package/dist/src/commands/review/fetch-pr.d.ts +7 -0
- package/dist/src/commands/review/fetch-pr.js +124 -0
- package/dist/src/commands/review/fetch-pr.js.map +1 -0
- package/dist/src/commands/review/lib/gh.d.ts +34 -0
- package/dist/src/commands/review/lib/gh.js +64 -0
- package/dist/src/commands/review/lib/gh.js.map +1 -0
- package/dist/src/commands/review/lib/git.d.ts +18 -0
- package/dist/src/commands/review/lib/git.js +41 -0
- package/dist/src/commands/review/lib/git.js.map +1 -0
- package/dist/src/commands/review/lib/paths.d.ts +23 -0
- package/dist/src/commands/review/lib/paths.js +37 -0
- package/dist/src/commands/review/lib/paths.js.map +1 -0
- package/dist/src/commands/review/load-rules.d.ts +7 -0
- package/dist/src/commands/review/load-rules.js +112 -0
- package/dist/src/commands/review/load-rules.js.map +1 -0
- package/dist/src/commands/review/pr-context.d.ts +7 -0
- package/dist/src/commands/review/pr-context.js +214 -0
- package/dist/src/commands/review/pr-context.js.map +1 -0
- package/dist/src/commands/review/presubmit.d.ts +7 -0
- package/dist/src/commands/review/presubmit.js +190 -0
- package/dist/src/commands/review/presubmit.js.map +1 -0
- package/dist/src/commands/review.d.ts +7 -0
- package/dist/src/commands/review.js +28 -0
- package/dist/src/commands/review.js.map +1 -0
- package/dist/src/commands/serve.d.ts +21 -0
- package/dist/src/commands/serve.js +214 -0
- package/dist/src/commands/serve.js.map +1 -0
- package/dist/src/commands/sp.d.ts +7 -0
- package/dist/src/commands/sp.js +62 -0
- package/dist/src/commands/sp.js.map +1 -0
- package/dist/src/config/auth.d.ts +10 -0
- package/dist/src/config/auth.js +183 -0
- package/dist/src/config/auth.js.map +1 -0
- package/dist/src/config/auth.test.d.ts +6 -0
- package/dist/src/config/auth.test.js +292 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/config.d.ts +144 -0
- package/dist/src/config/config.js +1618 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/jsonSchemaArg.test.d.ts +6 -0
- package/dist/src/config/jsonSchemaArg.test.js +305 -0
- package/dist/src/config/jsonSchemaArg.test.js.map +1 -0
- package/dist/src/config/keyBindings.d.ts +89 -0
- package/dist/src/config/keyBindings.js +188 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/keyBindings.test.d.ts +6 -0
- package/dist/src/config/keyBindings.test.js +51 -0
- package/dist/src/config/keyBindings.test.js.map +1 -0
- package/dist/src/config/loadedSettingsAdapter.d.ts +15 -0
- package/dist/src/config/loadedSettingsAdapter.js +80 -0
- package/dist/src/config/loadedSettingsAdapter.js.map +1 -0
- package/dist/src/config/loadedSettingsAdapter.test.d.ts +6 -0
- package/dist/src/config/loadedSettingsAdapter.test.js +127 -0
- package/dist/src/config/loadedSettingsAdapter.test.js.map +1 -0
- package/dist/src/config/migration/index.d.ts +59 -0
- package/dist/src/config/migration/index.js +94 -0
- package/dist/src/config/migration/index.js.map +1 -0
- package/dist/src/config/migration/index.test.d.ts +6 -0
- package/dist/src/config/migration/index.test.js +295 -0
- package/dist/src/config/migration/index.test.js.map +1 -0
- package/dist/src/config/migration/scheduler.d.ts +51 -0
- package/dist/src/config/migration/scheduler.js +95 -0
- package/dist/src/config/migration/scheduler.js.map +1 -0
- package/dist/src/config/migration/scheduler.test.d.ts +6 -0
- package/dist/src/config/migration/scheduler.test.js +129 -0
- package/dist/src/config/migration/scheduler.test.js.map +1 -0
- package/dist/src/config/migration/types.d.ts +53 -0
- package/dist/src/config/migration/types.js +7 -0
- package/dist/src/config/migration/types.js.map +1 -0
- package/dist/src/config/migration/versions/v1-to-v2-shared.d.ts +27 -0
- package/dist/src/config/migration/versions/v1-to-v2-shared.js +174 -0
- package/dist/src/config/migration/versions/v1-to-v2-shared.js.map +1 -0
- package/dist/src/config/migration/versions/v1-to-v2.d.ts +81 -0
- package/dist/src/config/migration/versions/v1-to-v2.js +222 -0
- package/dist/src/config/migration/versions/v1-to-v2.js.map +1 -0
- package/dist/src/config/migration/versions/v1-to-v2.test.d.ts +6 -0
- package/dist/src/config/migration/versions/v1-to-v2.test.js +189 -0
- package/dist/src/config/migration/versions/v1-to-v2.test.js.map +1 -0
- package/dist/src/config/migration/versions/v2-to-v3.d.ts +61 -0
- package/dist/src/config/migration/versions/v2-to-v3.js +185 -0
- package/dist/src/config/migration/versions/v2-to-v3.js.map +1 -0
- package/dist/src/config/migration/versions/v2-to-v3.test.d.ts +6 -0
- package/dist/src/config/migration/versions/v2-to-v3.test.js +337 -0
- package/dist/src/config/migration/versions/v2-to-v3.test.js.map +1 -0
- package/dist/src/config/migration/versions/v3-to-v4.d.ts +34 -0
- package/dist/src/config/migration/versions/v3-to-v4.js +126 -0
- package/dist/src/config/migration/versions/v3-to-v4.js.map +1 -0
- package/dist/src/config/migration/versions/v3-to-v4.test.d.ts +6 -0
- package/dist/src/config/migration/versions/v3-to-v4.test.js +164 -0
- package/dist/src/config/migration/versions/v3-to-v4.test.js.map +1 -0
- package/dist/src/config/modelProvidersScope.d.ts +20 -0
- package/dist/src/config/modelProvidersScope.js +39 -0
- package/dist/src/config/modelProvidersScope.js.map +1 -0
- package/dist/src/config/modelProvidersScope.test.d.ts +6 -0
- package/dist/src/config/modelProvidersScope.test.js +66 -0
- package/dist/src/config/modelProvidersScope.test.js.map +1 -0
- package/dist/src/config/path-freshness.test.d.ts +6 -0
- package/dist/src/config/path-freshness.test.js +52 -0
- package/dist/src/config/path-freshness.test.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +13 -0
- package/dist/src/config/sandboxConfig.js +74 -0
- package/dist/src/config/sandboxConfig.js.map +1 -0
- package/dist/src/config/settings.d.ts +119 -0
- package/dist/src/config/settings.js +1015 -0
- package/dist/src/config/settings.js.map +1 -0
- package/dist/src/config/settingsSchema.d.ts +2207 -0
- package/dist/src/config/settingsSchema.js +2246 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/config/settingsSchema.test.d.ts +6 -0
- package/dist/src/config/settingsSchema.test.js +232 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +54 -0
- package/dist/src/config/trustedFolders.js +176 -0
- package/dist/src/config/trustedFolders.js.map +1 -0
- package/dist/src/config/trustedFolders.test.d.ts +6 -0
- package/dist/src/config/trustedFolders.test.js +354 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- package/dist/src/core/auth.d.ts +13 -0
- package/dist/src/core/auth.js +34 -0
- package/dist/src/core/auth.js.map +1 -0
- package/dist/src/core/auth.test.d.ts +6 -0
- package/dist/src/core/auth.test.js +47 -0
- package/dist/src/core/auth.test.js.map +1 -0
- package/dist/src/core/initializer.d.ts +21 -0
- package/dist/src/core/initializer.js +42 -0
- package/dist/src/core/initializer.js.map +1 -0
- package/dist/src/core/initializer.test.d.ts +6 -0
- package/dist/src/core/initializer.test.js +123 -0
- package/dist/src/core/initializer.test.js.map +1 -0
- package/dist/src/core/theme.d.ts +12 -0
- package/dist/src/core/theme.js +25 -0
- package/dist/src/core/theme.js.map +1 -0
- package/dist/src/core/theme.test.d.ts +6 -0
- package/dist/src/core/theme.test.js +57 -0
- package/dist/src/core/theme.test.js.map +1 -0
- package/dist/src/dualOutput/DualOutputBridge.d.ts +84 -0
- package/dist/src/dualOutput/DualOutputBridge.js +293 -0
- package/dist/src/dualOutput/DualOutputBridge.js.map +1 -0
- package/dist/src/dualOutput/DualOutputBridge.test.d.ts +6 -0
- package/dist/src/dualOutput/DualOutputBridge.test.js +157 -0
- package/dist/src/dualOutput/DualOutputBridge.test.js.map +1 -0
- package/dist/src/dualOutput/DualOutputContext.d.ts +19 -0
- package/dist/src/dualOutput/DualOutputContext.js +22 -0
- package/dist/src/dualOutput/DualOutputContext.js.map +1 -0
- package/dist/src/dualOutput/index.d.ts +7 -0
- package/dist/src/dualOutput/index.js +8 -0
- package/dist/src/dualOutput/index.js.map +1 -0
- package/dist/src/export/index.d.ts +6 -0
- package/dist/src/export/index.js +7 -0
- package/dist/src/export/index.js.map +1 -0
- package/dist/src/gemini.d.ts +13 -0
- package/dist/src/gemini.js +908 -0
- package/dist/src/gemini.js.map +1 -0
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +975 -0
- package/dist/src/gemini.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/i18n/index.d.ts +27 -0
- package/dist/src/i18n/index.js +213 -0
- package/dist/src/i18n/index.js.map +1 -0
- package/dist/src/i18n/index.test.d.ts +6 -0
- package/dist/src/i18n/index.test.js +103 -0
- package/dist/src/i18n/index.test.js.map +1 -0
- package/dist/src/i18n/languages.d.ts +43 -0
- package/dist/src/i18n/languages.js +138 -0
- package/dist/src/i18n/languages.js.map +1 -0
- package/dist/src/i18n/locales/ca.js +3951 -0
- package/dist/src/i18n/locales/de.js +2018 -0
- package/dist/src/i18n/locales/en.js +2161 -0
- package/dist/src/i18n/locales/fr.js +2013 -0
- package/dist/src/i18n/locales/ja.js +1780 -0
- package/dist/src/i18n/locales/pt.js +2005 -0
- package/dist/src/i18n/locales/ru.js +1993 -0
- package/dist/src/i18n/locales/zh-TW.js +1729 -0
- package/dist/src/i18n/locales/zh.js +1929 -0
- package/dist/src/i18n/mustTranslateKeys.d.ts +12 -0
- package/dist/src/i18n/mustTranslateKeys.js +111 -0
- package/dist/src/i18n/mustTranslateKeys.js.map +1 -0
- package/dist/src/i18n/mustTranslateKeys.test.d.ts +6 -0
- package/dist/src/i18n/mustTranslateKeys.test.js +103 -0
- package/dist/src/i18n/mustTranslateKeys.test.js.map +1 -0
- package/dist/src/i18n/translationDict.d.ts +9 -0
- package/dist/src/i18n/translationDict.js +17 -0
- package/dist/src/i18n/translationDict.js.map +1 -0
- package/dist/src/nonInteractive/control/ControlContext.d.ts +71 -0
- package/dist/src/nonInteractive/control/ControlContext.js +36 -0
- package/dist/src/nonInteractive/control/ControlContext.js.map +1 -0
- package/dist/src/nonInteractive/control/ControlDispatcher.d.ts +116 -0
- package/dist/src/nonInteractive/control/ControlDispatcher.js +290 -0
- package/dist/src/nonInteractive/control/ControlDispatcher.js.map +1 -0
- package/dist/src/nonInteractive/control/ControlDispatcher.test.d.ts +6 -0
- package/dist/src/nonInteractive/control/ControlDispatcher.test.js +614 -0
- package/dist/src/nonInteractive/control/ControlDispatcher.test.js.map +1 -0
- package/dist/src/nonInteractive/control/ControlService.d.ts +79 -0
- package/dist/src/nonInteractive/control/ControlService.js +139 -0
- package/dist/src/nonInteractive/control/ControlService.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/baseController.d.ts +53 -0
- package/dist/src/nonInteractive/control/controllers/baseController.js +136 -0
- package/dist/src/nonInteractive/control/controllers/baseController.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/hookController.d.ts +25 -0
- package/dist/src/nonInteractive/control/controllers/hookController.js +40 -0
- package/dist/src/nonInteractive/control/controllers/hookController.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/permissionController.d.ts +57 -0
- package/dist/src/nonInteractive/control/controllers/permissionController.js +361 -0
- package/dist/src/nonInteractive/control/controllers/permissionController.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/permissionController.test.d.ts +6 -0
- package/dist/src/nonInteractive/control/controllers/permissionController.test.js +140 -0
- package/dist/src/nonInteractive/control/controllers/permissionController.test.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/sdkMcpController.d.ts +54 -0
- package/dist/src/nonInteractive/control/controllers/sdkMcpController.js +80 -0
- package/dist/src/nonInteractive/control/controllers/sdkMcpController.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/systemController.d.ts +67 -0
- package/dist/src/nonInteractive/control/controllers/systemController.js +326 -0
- package/dist/src/nonInteractive/control/controllers/systemController.js.map +1 -0
- package/dist/src/nonInteractive/control/controllers/systemController.test.d.ts +6 -0
- package/dist/src/nonInteractive/control/controllers/systemController.test.js +121 -0
- package/dist/src/nonInteractive/control/controllers/systemController.test.js.map +1 -0
- package/dist/src/nonInteractive/control/types/serviceAPIs.d.ts +105 -0
- package/dist/src/nonInteractive/control/types/serviceAPIs.js +7 -0
- package/dist/src/nonInteractive/control/types/serviceAPIs.js.map +1 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.d.ts +505 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js +1041 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js.map +1 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.d.ts +6 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js +1304 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js.map +1 -0
- package/dist/src/nonInteractive/io/JsonOutputAdapter.d.ts +29 -0
- package/dist/src/nonInteractive/io/JsonOutputAdapter.js +64 -0
- package/dist/src/nonInteractive/io/JsonOutputAdapter.js.map +1 -0
- package/dist/src/nonInteractive/io/JsonOutputAdapter.test.d.ts +6 -0
- package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js +684 -0
- package/dist/src/nonInteractive/io/JsonOutputAdapter.test.js.map +1 -0
- package/dist/src/nonInteractive/io/StreamJsonInputReader.d.ts +16 -0
- package/dist/src/nonInteractive/io/StreamJsonInputReader.js +54 -0
- package/dist/src/nonInteractive/io/StreamJsonInputReader.js.map +1 -0
- package/dist/src/nonInteractive/io/StreamJsonInputReader.test.d.ts +6 -0
- package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js +178 -0
- package/dist/src/nonInteractive/io/StreamJsonInputReader.test.js.map +1 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.d.ts +84 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.dualOutput.test.d.ts +6 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.dualOutput.test.js +118 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.dualOutput.test.js.map +1 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js +227 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.js.map +1 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.d.ts +6 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js +1046 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js.map +1 -0
- package/dist/src/nonInteractive/io/index.d.ts +6 -0
- package/dist/src/nonInteractive/io/index.js +7 -0
- package/dist/src/nonInteractive/io/index.js.map +1 -0
- package/dist/src/nonInteractive/session.d.ts +8 -0
- package/dist/src/nonInteractive/session.js +664 -0
- package/dist/src/nonInteractive/session.js.map +1 -0
- package/dist/src/nonInteractive/session.test.d.ts +6 -0
- package/dist/src/nonInteractive/session.test.js +680 -0
- package/dist/src/nonInteractive/session.test.js.map +1 -0
- package/dist/src/nonInteractive/types.d.ts +415 -0
- package/dist/src/nonInteractive/types.js +77 -0
- package/dist/src/nonInteractive/types.js.map +1 -0
- package/dist/src/nonInteractiveCli.d.ts +33 -0
- package/dist/src/nonInteractiveCli.js +1058 -0
- package/dist/src/nonInteractiveCli.js.map +1 -0
- package/dist/src/nonInteractiveCliCommands.d.ts +59 -0
- package/dist/src/nonInteractiveCliCommands.js +326 -0
- package/dist/src/nonInteractiveCliCommands.js.map +1 -0
- package/dist/src/nonInteractiveCliCommands.test.d.ts +6 -0
- package/dist/src/nonInteractiveCliCommands.test.js +484 -0
- package/dist/src/nonInteractiveCliCommands.test.js.map +1 -0
- package/dist/src/patches/is-in-ci.d.ts +7 -0
- package/dist/src/patches/is-in-ci.js +15 -0
- package/dist/src/patches/is-in-ci.js.map +1 -0
- package/dist/src/remoteInput/RemoteInputContext.d.ts +8 -0
- package/dist/src/remoteInput/RemoteInputContext.js +9 -0
- package/dist/src/remoteInput/RemoteInputContext.js.map +1 -0
- package/dist/src/remoteInput/RemoteInputWatcher.d.ts +83 -0
- package/dist/src/remoteInput/RemoteInputWatcher.js +201 -0
- package/dist/src/remoteInput/RemoteInputWatcher.js.map +1 -0
- package/dist/src/remoteInput/RemoteInputWatcher.test.d.ts +6 -0
- package/dist/src/remoteInput/RemoteInputWatcher.test.js +100 -0
- package/dist/src/remoteInput/RemoteInputWatcher.test.js.map +1 -0
- package/dist/src/remoteInput/index.d.ts +7 -0
- package/dist/src/remoteInput/index.js +8 -0
- package/dist/src/remoteInput/index.js.map +1 -0
- package/dist/src/serve/auth/deviceFlow.d.ts +595 -0
- package/dist/src/serve/auth/deviceFlow.js +1243 -0
- package/dist/src/serve/auth/deviceFlow.js.map +1 -0
- package/dist/src/serve/auth/deviceFlow.test.d.ts +6 -0
- package/dist/src/serve/auth/deviceFlow.test.js +1314 -0
- package/dist/src/serve/auth/deviceFlow.test.js.map +1 -0
- package/dist/src/serve/auth/qwenDeviceFlowProvider.d.ts +30 -0
- package/dist/src/serve/auth/qwenDeviceFlowProvider.js +331 -0
- package/dist/src/serve/auth/qwenDeviceFlowProvider.js.map +1 -0
- package/dist/src/serve/auth/qwenDeviceFlowProvider.test.d.ts +6 -0
- package/dist/src/serve/auth/qwenDeviceFlowProvider.test.js +301 -0
- package/dist/src/serve/auth/qwenDeviceFlowProvider.test.js.map +1 -0
- package/dist/src/serve/auth.d.ts +101 -0
- package/dist/src/serve/auth.js +216 -0
- package/dist/src/serve/auth.js.map +1 -0
- package/dist/src/serve/capabilities.d.ts +196 -0
- package/dist/src/serve/capabilities.js +227 -0
- package/dist/src/serve/capabilities.js.map +1 -0
- package/dist/src/serve/daemonStatusProvider.d.ts +14 -0
- package/dist/src/serve/daemonStatusProvider.js +252 -0
- package/dist/src/serve/daemonStatusProvider.js.map +1 -0
- package/dist/src/serve/debugMode.d.ts +27 -0
- package/dist/src/serve/debugMode.js +33 -0
- package/dist/src/serve/debugMode.js.map +1 -0
- package/dist/src/serve/demo.d.ts +11 -0
- package/dist/src/serve/demo.js +640 -0
- package/dist/src/serve/demo.js.map +1 -0
- package/dist/src/serve/envSnapshot.d.ts +28 -0
- package/dist/src/serve/envSnapshot.js +199 -0
- package/dist/src/serve/envSnapshot.js.map +1 -0
- package/dist/src/serve/envSnapshot.test.d.ts +6 -0
- package/dist/src/serve/envSnapshot.test.js +181 -0
- package/dist/src/serve/envSnapshot.test.js.map +1 -0
- package/dist/src/serve/eventBus.d.ts +6 -0
- package/dist/src/serve/eventBus.js +15 -0
- package/dist/src/serve/eventBus.js.map +1 -0
- package/dist/src/serve/fs/audit.d.ts +144 -0
- package/dist/src/serve/fs/audit.js +193 -0
- package/dist/src/serve/fs/audit.js.map +1 -0
- package/dist/src/serve/fs/audit.test.d.ts +6 -0
- package/dist/src/serve/fs/audit.test.js +246 -0
- package/dist/src/serve/fs/audit.test.js.map +1 -0
- package/dist/src/serve/fs/contract.test.d.ts +6 -0
- package/dist/src/serve/fs/contract.test.js +211 -0
- package/dist/src/serve/fs/contract.test.js.map +1 -0
- package/dist/src/serve/fs/errors.d.ts +87 -0
- package/dist/src/serve/fs/errors.js +128 -0
- package/dist/src/serve/fs/errors.js.map +1 -0
- package/dist/src/serve/fs/errors.test.d.ts +6 -0
- package/dist/src/serve/fs/errors.test.js +152 -0
- package/dist/src/serve/fs/errors.test.js.map +1 -0
- package/dist/src/serve/fs/index.d.ts +10 -0
- package/dist/src/serve/fs/index.js +11 -0
- package/dist/src/serve/fs/index.js.map +1 -0
- package/dist/src/serve/fs/paths.d.ts +103 -0
- package/dist/src/serve/fs/paths.js +433 -0
- package/dist/src/serve/fs/paths.js.map +1 -0
- package/dist/src/serve/fs/paths.test.d.ts +6 -0
- package/dist/src/serve/fs/paths.test.js +309 -0
- package/dist/src/serve/fs/paths.test.js.map +1 -0
- package/dist/src/serve/fs/policy.d.ts +142 -0
- package/dist/src/serve/fs/policy.js +189 -0
- package/dist/src/serve/fs/policy.js.map +1 -0
- package/dist/src/serve/fs/policy.test.d.ts +6 -0
- package/dist/src/serve/fs/policy.test.js +193 -0
- package/dist/src/serve/fs/policy.test.js.map +1 -0
- package/dist/src/serve/fs/workspaceFileSystem.d.ts +157 -0
- package/dist/src/serve/fs/workspaceFileSystem.js +1377 -0
- package/dist/src/serve/fs/workspaceFileSystem.js.map +1 -0
- package/dist/src/serve/fs/workspaceFileSystem.test.d.ts +6 -0
- package/dist/src/serve/fs/workspaceFileSystem.test.js +880 -0
- package/dist/src/serve/fs/workspaceFileSystem.test.js.map +1 -0
- package/dist/src/serve/httpAcpBridge.d.ts +80 -0
- package/dist/src/serve/httpAcpBridge.js +3559 -0
- package/dist/src/serve/httpAcpBridge.js.map +1 -0
- package/dist/src/serve/httpAcpBridge.test.d.ts +6 -0
- package/dist/src/serve/httpAcpBridge.test.js +4987 -0
- package/dist/src/serve/httpAcpBridge.test.js.map +1 -0
- package/dist/src/serve/inMemoryChannel.d.ts +6 -0
- package/dist/src/serve/inMemoryChannel.js +14 -0
- package/dist/src/serve/inMemoryChannel.js.map +1 -0
- package/dist/src/serve/index.d.ts +15 -0
- package/dist/src/serve/index.js +16 -0
- package/dist/src/serve/index.js.map +1 -0
- package/dist/src/serve/loopbackBinds.d.ts +18 -0
- package/dist/src/serve/loopbackBinds.js +33 -0
- package/dist/src/serve/loopbackBinds.js.map +1 -0
- package/dist/src/serve/routes/workspaceFileRead.d.ts +90 -0
- package/dist/src/serve/routes/workspaceFileRead.js +458 -0
- package/dist/src/serve/routes/workspaceFileRead.js.map +1 -0
- package/dist/src/serve/routes/workspaceFileRead.test.d.ts +6 -0
- package/dist/src/serve/routes/workspaceFileRead.test.js +453 -0
- package/dist/src/serve/routes/workspaceFileRead.test.js.map +1 -0
- package/dist/src/serve/routes/workspaceFileWrite.d.ts +17 -0
- package/dist/src/serve/routes/workspaceFileWrite.js +224 -0
- package/dist/src/serve/routes/workspaceFileWrite.js.map +1 -0
- package/dist/src/serve/routes/workspaceFileWrite.test.d.ts +6 -0
- package/dist/src/serve/routes/workspaceFileWrite.test.js +223 -0
- package/dist/src/serve/routes/workspaceFileWrite.test.js.map +1 -0
- package/dist/src/serve/runQwenServe.d.ts +67 -0
- package/dist/src/serve/runQwenServe.js +616 -0
- package/dist/src/serve/runQwenServe.js.map +1 -0
- package/dist/src/serve/server.d.ts +125 -0
- package/dist/src/serve/server.js +2297 -0
- package/dist/src/serve/server.js.map +1 -0
- package/dist/src/serve/status.d.ts +6 -0
- package/dist/src/serve/status.js +13 -0
- package/dist/src/serve/status.js.map +1 -0
- package/dist/src/serve/types.d.ts +175 -0
- package/dist/src/serve/types.js +10 -0
- package/dist/src/serve/types.js.map +1 -0
- package/dist/src/serve/workspaceAgents.d.ts +47 -0
- package/dist/src/serve/workspaceAgents.js +1171 -0
- package/dist/src/serve/workspaceAgents.js.map +1 -0
- package/dist/src/serve/workspaceAgents.test.d.ts +6 -0
- package/dist/src/serve/workspaceAgents.test.js +823 -0
- package/dist/src/serve/workspaceAgents.test.js.map +1 -0
- package/dist/src/serve/workspaceMemory.d.ts +60 -0
- package/dist/src/serve/workspaceMemory.js +323 -0
- package/dist/src/serve/workspaceMemory.js.map +1 -0
- package/dist/src/serve/workspaceMemory.test.d.ts +6 -0
- package/dist/src/serve/workspaceMemory.test.js +418 -0
- package/dist/src/serve/workspaceMemory.test.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
- package/dist/src/services/BuiltinCommandLoader.js +159 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
- package/dist/src/services/BuiltinCommandLoader.test.js +234 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
- package/dist/src/services/BundledSkillLoader.d.ts +17 -0
- package/dist/src/services/BundledSkillLoader.js +97 -0
- package/dist/src/services/BundledSkillLoader.js.map +1 -0
- package/dist/src/services/BundledSkillLoader.test.d.ts +6 -0
- package/dist/src/services/BundledSkillLoader.test.js +301 -0
- package/dist/src/services/BundledSkillLoader.test.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +69 -0
- package/dist/src/services/CommandService.js +128 -0
- package/dist/src/services/CommandService.js.map +1 -0
- package/dist/src/services/CommandService.test.d.ts +6 -0
- package/dist/src/services/CommandService.test.js +263 -0
- package/dist/src/services/CommandService.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader-extension.test.d.ts +6 -0
- package/dist/src/services/FileCommandLoader-extension.test.js +279 -0
- package/dist/src/services/FileCommandLoader-extension.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader-markdown.test.d.ts +6 -0
- package/dist/src/services/FileCommandLoader-markdown.test.js +111 -0
- package/dist/src/services/FileCommandLoader-markdown.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +64 -0
- package/dist/src/services/FileCommandLoader.js +259 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.d.ts +35 -0
- package/dist/src/services/McpPromptLoader.js +261 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
- package/dist/src/services/McpPromptLoader.test.js +341 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -0
- package/dist/src/services/SkillCommandLoader.d.ts +23 -0
- package/dist/src/services/SkillCommandLoader.js +110 -0
- package/dist/src/services/SkillCommandLoader.js.map +1 -0
- package/dist/src/services/SkillCommandLoader.test.d.ts +6 -0
- package/dist/src/services/SkillCommandLoader.test.js +307 -0
- package/dist/src/services/SkillCommandLoader.test.js.map +1 -0
- package/dist/src/services/command-factory.d.ts +25 -0
- package/dist/src/services/command-factory.js +122 -0
- package/dist/src/services/command-factory.js.map +1 -0
- package/dist/src/services/command-factory.test.d.ts +6 -0
- package/dist/src/services/command-factory.test.js +31 -0
- package/dist/src/services/command-factory.test.js.map +1 -0
- package/dist/src/services/command-migration-tool.d.ts +39 -0
- package/dist/src/services/command-migration-tool.js +135 -0
- package/dist/src/services/command-migration-tool.js.map +1 -0
- package/dist/src/services/command-migration-tool.test.d.ts +6 -0
- package/dist/src/services/command-migration-tool.test.js +175 -0
- package/dist/src/services/command-migration-tool.test.js.map +1 -0
- package/dist/src/services/commandMetadata.d.ts +21 -0
- package/dist/src/services/commandMetadata.js +106 -0
- package/dist/src/services/commandMetadata.js.map +1 -0
- package/dist/src/services/commandMetadata.test.d.ts +6 -0
- package/dist/src/services/commandMetadata.test.js +216 -0
- package/dist/src/services/commandMetadata.test.js.map +1 -0
- package/dist/src/services/commandUtils.d.ts +36 -0
- package/dist/src/services/commandUtils.js +57 -0
- package/dist/src/services/commandUtils.js.map +1 -0
- package/dist/src/services/commandUtils.test.d.ts +6 -0
- package/dist/src/services/commandUtils.test.js +159 -0
- package/dist/src/services/commandUtils.test.js.map +1 -0
- package/dist/src/services/insight/generators/DataProcessor.d.ts +23 -0
- package/dist/src/services/insight/generators/DataProcessor.js +1001 -0
- package/dist/src/services/insight/generators/DataProcessor.js.map +1 -0
- package/dist/src/services/insight/generators/DataProcessor.test.d.ts +6 -0
- package/dist/src/services/insight/generators/DataProcessor.test.js +1210 -0
- package/dist/src/services/insight/generators/DataProcessor.test.js.map +1 -0
- package/dist/src/services/insight/generators/StaticInsightGenerator.d.ts +16 -0
- package/dist/src/services/insight/generators/StaticInsightGenerator.js +63 -0
- package/dist/src/services/insight/generators/StaticInsightGenerator.js.map +1 -0
- package/dist/src/services/insight/generators/StaticInsightGenerator.test.d.ts +6 -0
- package/dist/src/services/insight/generators/StaticInsightGenerator.test.js +60 -0
- package/dist/src/services/insight/generators/StaticInsightGenerator.test.js.map +1 -0
- package/dist/src/services/insight/generators/TemplateRenderer.d.ts +9 -0
- package/dist/src/services/insight/generators/TemplateRenderer.js +49 -0
- package/dist/src/services/insight/generators/TemplateRenderer.js.map +1 -0
- package/dist/src/services/insight/types/QualitativeInsightTypes.d.ts +74 -0
- package/dist/src/services/insight/types/QualitativeInsightTypes.js +2 -0
- package/dist/src/services/insight/types/QualitativeInsightTypes.js.map +1 -0
- package/dist/src/services/insight/types/StaticInsightTypes.d.ts +59 -0
- package/dist/src/services/insight/types/StaticInsightTypes.js +7 -0
- package/dist/src/services/insight/types/StaticInsightTypes.js.map +1 -0
- package/dist/src/services/markdown-command-parser.d.ts +52 -0
- package/dist/src/services/markdown-command-parser.js +60 -0
- package/dist/src/services/markdown-command-parser.js.map +1 -0
- package/dist/src/services/markdown-command-parser.test.d.ts +6 -0
- package/dist/src/services/markdown-command-parser.test.js +146 -0
- package/dist/src/services/markdown-command-parser.test.js.map +1 -0
- package/dist/src/services/notificationService.d.ts +19 -0
- package/dist/src/services/notificationService.js +64 -0
- package/dist/src/services/notificationService.js.map +1 -0
- package/dist/src/services/notificationService.test.d.ts +6 -0
- package/dist/src/services/notificationService.test.js +114 -0
- package/dist/src/services/notificationService.test.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +16 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js +21 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +63 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
- package/dist/src/services/prompt-processors/injectionParser.js +60 -0
- package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +27 -0
- package/dist/src/services/prompt-processors/shellProcessor.js +146 -0
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/types.d.ts +45 -0
- package/dist/src/services/prompt-processors/types.js +20 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -0
- package/dist/src/services/test-commands/example.md +5 -0
- package/dist/src/services/tips/index.d.ts +10 -0
- package/dist/src/services/tips/index.js +21 -0
- package/dist/src/services/tips/index.js.map +1 -0
- package/dist/src/services/tips/tipHistory.d.ts +49 -0
- package/dist/src/services/tips/tipHistory.js +138 -0
- package/dist/src/services/tips/tipHistory.js.map +1 -0
- package/dist/src/services/tips/tipHistory.test.d.ts +6 -0
- package/dist/src/services/tips/tipHistory.test.js +102 -0
- package/dist/src/services/tips/tipHistory.test.js.map +1 -0
- package/dist/src/services/tips/tipRegistry.d.ts +32 -0
- package/dist/src/services/tips/tipRegistry.js +148 -0
- package/dist/src/services/tips/tipRegistry.js.map +1 -0
- package/dist/src/services/tips/tipRegistry.test.d.ts +6 -0
- package/dist/src/services/tips/tipRegistry.test.js +65 -0
- package/dist/src/services/tips/tipRegistry.test.js.map +1 -0
- package/dist/src/services/tips/tipScheduler.d.ts +21 -0
- package/dist/src/services/tips/tipScheduler.js +38 -0
- package/dist/src/services/tips/tipScheduler.js.map +1 -0
- package/dist/src/services/tips/tipScheduler.test.d.ts +6 -0
- package/dist/src/services/tips/tipScheduler.test.js +126 -0
- package/dist/src/services/tips/tipScheduler.test.js.map +1 -0
- package/dist/src/services/types.d.ts +22 -0
- package/dist/src/services/types.js +7 -0
- package/dist/src/services/types.js.map +1 -0
- package/dist/src/startup/worktreeStartup.d.ts +112 -0
- package/dist/src/startup/worktreeStartup.js +350 -0
- package/dist/src/startup/worktreeStartup.js.map +1 -0
- package/dist/src/startup/worktreeStartup.test.d.ts +6 -0
- package/dist/src/startup/worktreeStartup.test.js +332 -0
- package/dist/src/startup/worktreeStartup.test.js.map +1 -0
- package/dist/src/test-utils/customMatchers.d.ts +14 -0
- package/dist/src/test-utils/customMatchers.js +40 -0
- package/dist/src/test-utils/customMatchers.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
- package/dist/src/test-utils/mockCommandContext.js +107 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
- package/dist/src/test-utils/mockCommandContext.test.js +51 -0
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +14 -0
- package/dist/src/test-utils/render.js +15 -0
- package/dist/src/test-utils/render.js.map +1 -0
- package/dist/src/ui/App.d.ts +6 -0
- package/dist/src/ui/App.js +65 -0
- package/dist/src/ui/App.js.map +1 -0
- package/dist/src/ui/AppContainer.d.ts +24 -0
- package/dist/src/ui/AppContainer.js +2853 -0
- package/dist/src/ui/AppContainer.js.map +1 -0
- package/dist/src/ui/AppContainer.test.d.ts +6 -0
- package/dist/src/ui/AppContainer.test.js +2368 -0
- package/dist/src/ui/AppContainer.test.js.map +1 -0
- package/dist/src/ui/CommandFormatMigrationNudge.d.ts +14 -0
- package/dist/src/ui/CommandFormatMigrationNudge.js +44 -0
- package/dist/src/ui/CommandFormatMigrationNudge.js.map +1 -0
- package/dist/src/ui/FeedbackDialog.d.ts +9 -0
- package/dist/src/ui/FeedbackDialog.js +44 -0
- package/dist/src/ui/FeedbackDialog.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +53 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.d.ts +7 -0
- package/dist/src/ui/auth/AuthDialog.js +214 -0
- package/dist/src/ui/auth/AuthDialog.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/AuthDialog.test.js +1029 -0
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/auth/AuthInProgress.d.ts +11 -0
- package/dist/src/ui/auth/AuthInProgress.js +24 -0
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/auth/ProviderSetupSteps.d.ts +11 -0
- package/dist/src/ui/auth/ProviderSetupSteps.js +320 -0
- package/dist/src/ui/auth/ProviderSetupSteps.js.map +1 -0
- package/dist/src/ui/auth/ProviderSetupSteps.test.d.ts +6 -0
- package/dist/src/ui/auth/ProviderSetupSteps.test.js +322 -0
- package/dist/src/ui/auth/ProviderSetupSteps.test.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +76 -0
- package/dist/src/ui/auth/useAuth.js +192 -0
- package/dist/src/ui/auth/useAuth.js.map +1 -0
- package/dist/src/ui/auth/useAuth.test.d.ts +6 -0
- package/dist/src/ui/auth/useAuth.test.js +267 -0
- package/dist/src/ui/auth/useAuth.test.js.map +1 -0
- package/dist/src/ui/auth/useProviderSetupFlow.d.ts +54 -0
- package/dist/src/ui/auth/useProviderSetupFlow.js +380 -0
- package/dist/src/ui/auth/useProviderSetupFlow.js.map +1 -0
- package/dist/src/ui/colors.d.ts +7 -0
- package/dist/src/ui/colors.js +60 -0
- package/dist/src/ui/colors.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
- package/dist/src/ui/commands/aboutCommand.js +69 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -0
- package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
- package/dist/src/ui/commands/agentsCommand.js +42 -0
- package/dist/src/ui/commands/agentsCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.d.ts +7 -0
- package/dist/src/ui/commands/approvalModeCommand.js +89 -0
- package/dist/src/ui/commands/approvalModeCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js +112 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/arenaCommand.agentComplete.test.d.ts +6 -0
- package/dist/src/ui/commands/arenaCommand.agentComplete.test.js +118 -0
- package/dist/src/ui/commands/arenaCommand.agentComplete.test.js.map +1 -0
- package/dist/src/ui/commands/arenaCommand.d.ts +7 -0
- package/dist/src/ui/commands/arenaCommand.js +519 -0
- package/dist/src/ui/commands/arenaCommand.js.map +1 -0
- package/dist/src/ui/commands/arenaCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/arenaCommand.test.js +352 -0
- package/dist/src/ui/commands/arenaCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +7 -0
- package/dist/src/ui/commands/authCommand.js +31 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -0
- package/dist/src/ui/commands/branchCommand.d.ts +7 -0
- package/dist/src/ui/commands/branchCommand.js +49 -0
- package/dist/src/ui/commands/branchCommand.js.map +1 -0
- package/dist/src/ui/commands/branchCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/branchCommand.test.js +57 -0
- package/dist/src/ui/commands/branchCommand.test.js.map +1 -0
- package/dist/src/ui/commands/btwCommand.d.ts +7 -0
- package/dist/src/ui/commands/btwCommand.js +164 -0
- package/dist/src/ui/commands/btwCommand.js.map +1 -0
- package/dist/src/ui/commands/btwCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/btwCommand.test.js +338 -0
- package/dist/src/ui/commands/btwCommand.test.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +54 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.d.ts +7 -0
- package/dist/src/ui/commands/clearCommand.js +122 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +178 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/contextCommand.d.ts +14 -0
- package/dist/src/ui/commands/contextCommand.js +443 -0
- package/dist/src/ui/commands/contextCommand.js.map +1 -0
- package/dist/src/ui/commands/contextCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/contextCommand.test.js +184 -0
- package/dist/src/ui/commands/contextCommand.test.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.d.ts +7 -0
- package/dist/src/ui/commands/copyCommand.js +374 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -0
- package/dist/src/ui/commands/deleteCommand.d.ts +7 -0
- package/dist/src/ui/commands/deleteCommand.js +19 -0
- package/dist/src/ui/commands/deleteCommand.js.map +1 -0
- package/dist/src/ui/commands/deleteCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/deleteCommand.test.js +27 -0
- package/dist/src/ui/commands/deleteCommand.test.js.map +1 -0
- package/dist/src/ui/commands/diffCommand.d.ts +42 -0
- package/dist/src/ui/commands/diffCommand.js +206 -0
- package/dist/src/ui/commands/diffCommand.js.map +1 -0
- package/dist/src/ui/commands/diffCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/diffCommand.test.js +482 -0
- package/dist/src/ui/commands/diffCommand.test.js.map +1 -0
- package/dist/src/ui/commands/directoryCommand.d.ts +13 -0
- package/dist/src/ui/commands/directoryCommand.js +252 -0
- package/dist/src/ui/commands/directoryCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +49 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/doctorCommand.d.ts +7 -0
- package/dist/src/ui/commands/doctorCommand.js +530 -0
- package/dist/src/ui/commands/doctorCommand.js.map +1 -0
- package/dist/src/ui/commands/doctorCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/doctorCommand.test.js +804 -0
- package/dist/src/ui/commands/doctorCommand.test.js.map +1 -0
- package/dist/src/ui/commands/dreamCommand.d.ts +7 -0
- package/dist/src/ui/commands/dreamCommand.js +42 -0
- package/dist/src/ui/commands/dreamCommand.js.map +1 -0
- package/dist/src/ui/commands/dreamCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/dreamCommand.test.js +39 -0
- package/dist/src/ui/commands/dreamCommand.test.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +20 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/exportCommand.d.ts +10 -0
- package/dist/src/ui/commands/exportCommand.js +373 -0
- package/dist/src/ui/commands/exportCommand.js.map +1 -0
- package/dist/src/ui/commands/exportCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/exportCommand.test.js +905 -0
- package/dist/src/ui/commands/exportCommand.test.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +10 -0
- package/dist/src/ui/commands/extensionsCommand.js +185 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/forgetCommand.d.ts +7 -0
- package/dist/src/ui/commands/forgetCommand.js +45 -0
- package/dist/src/ui/commands/forgetCommand.js.map +1 -0
- package/dist/src/ui/commands/forkCommand.d.ts +7 -0
- package/dist/src/ui/commands/forkCommand.js +163 -0
- package/dist/src/ui/commands/forkCommand.js.map +1 -0
- package/dist/src/ui/commands/forkCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/forkCommand.test.js +229 -0
- package/dist/src/ui/commands/forkCommand.test.js.map +1 -0
- package/dist/src/ui/commands/goalCommand.d.ts +7 -0
- package/dist/src/ui/commands/goalCommand.js +181 -0
- package/dist/src/ui/commands/goalCommand.js.map +1 -0
- package/dist/src/ui/commands/goalCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/goalCommand.test.js +328 -0
- package/dist/src/ui/commands/goalCommand.test.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +7 -0
- package/dist/src/ui/commands/helpCommand.js +21 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -0
- package/dist/src/ui/commands/hooksCommand.d.ts +7 -0
- package/dist/src/ui/commands/hooksCommand.js +153 -0
- package/dist/src/ui/commands/hooksCommand.js.map +1 -0
- package/dist/src/ui/commands/hooksCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/hooksCommand.test.js +189 -0
- package/dist/src/ui/commands/hooksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.d.ts +7 -0
- package/dist/src/ui/commands/ideCommand.js +256 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/ui/commands/initCommand.d.ts +7 -0
- package/dist/src/ui/commands/initCommand.js +119 -0
- package/dist/src/ui/commands/initCommand.js.map +1 -0
- package/dist/src/ui/commands/insightCommand.d.ts +7 -0
- package/dist/src/ui/commands/insightCommand.js +195 -0
- package/dist/src/ui/commands/insightCommand.js.map +1 -0
- package/dist/src/ui/commands/insightCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/insightCommand.test.js +173 -0
- package/dist/src/ui/commands/insightCommand.test.js.map +1 -0
- package/dist/src/ui/commands/languageCommand.d.ts +7 -0
- package/dist/src/ui/commands/languageCommand.js +291 -0
- package/dist/src/ui/commands/languageCommand.js.map +1 -0
- package/dist/src/ui/commands/languageCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/languageCommand.test.js +664 -0
- package/dist/src/ui/commands/languageCommand.test.js.map +1 -0
- package/dist/src/ui/commands/lspCommand.d.ts +7 -0
- package/dist/src/ui/commands/lspCommand.js +62 -0
- package/dist/src/ui/commands/lspCommand.js.map +1 -0
- package/dist/src/ui/commands/lspCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/lspCommand.test.js +175 -0
- package/dist/src/ui/commands/lspCommand.test.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +21 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/memoryCommand.js +21 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +226 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/modelCommand.test.js +503 -0
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/permissionsCommand.js +20 -0
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
- package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/planCommand.d.ts +7 -0
- package/dist/src/ui/commands/planCommand.js +88 -0
- package/dist/src/ui/commands/planCommand.js.map +1 -0
- package/dist/src/ui/commands/planCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/planCommand.test.js +113 -0
- package/dist/src/ui/commands/planCommand.test.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +38 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/recapCommand.d.ts +7 -0
- package/dist/src/ui/commands/recapCommand.js +56 -0
- package/dist/src/ui/commands/recapCommand.js.map +1 -0
- package/dist/src/ui/commands/rememberCommand.d.ts +7 -0
- package/dist/src/ui/commands/rememberCommand.js +54 -0
- package/dist/src/ui/commands/rememberCommand.js.map +1 -0
- package/dist/src/ui/commands/renameCommand.d.ts +7 -0
- package/dist/src/ui/commands/renameCommand.js +208 -0
- package/dist/src/ui/commands/renameCommand.js.map +1 -0
- package/dist/src/ui/commands/renameCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/renameCommand.test.js +414 -0
- package/dist/src/ui/commands/renameCommand.test.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +159 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
- package/dist/src/ui/commands/resumeCommand.js +65 -0
- package/dist/src/ui/commands/resumeCommand.js.map +1 -0
- package/dist/src/ui/commands/resumeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/resumeCommand.test.js +135 -0
- package/dist/src/ui/commands/resumeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/rewindCommand.d.ts +7 -0
- package/dist/src/ui/commands/rewindCommand.js +20 -0
- package/dist/src/ui/commands/rewindCommand.js.map +1 -0
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +20 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.d.ts +9 -0
- package/dist/src/ui/commands/setupGithubCommand.js +165 -0
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js +164 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
- package/dist/src/ui/commands/skillsCommand.d.ts +7 -0
- package/dist/src/ui/commands/skillsCommand.js +63 -0
- package/dist/src/ui/commands/skillsCommand.js.map +1 -0
- package/dist/src/ui/commands/skillsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/skillsCommand.test.js +136 -0
- package/dist/src/ui/commands/skillsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +130 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/statuslineCommand.d.ts +7 -0
- package/dist/src/ui/commands/statuslineCommand.js +33 -0
- package/dist/src/ui/commands/statuslineCommand.js.map +1 -0
- package/dist/src/ui/commands/statuslineCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/statuslineCommand.test.js +54 -0
- package/dist/src/ui/commands/statuslineCommand.test.js.map +1 -0
- package/dist/src/ui/commands/summaryCommand.d.ts +7 -0
- package/dist/src/ui/commands/summaryCommand.js +261 -0
- package/dist/src/ui/commands/summaryCommand.js.map +1 -0
- package/dist/src/ui/commands/tasksCommand.d.ts +7 -0
- package/dist/src/ui/commands/tasksCommand.js +222 -0
- package/dist/src/ui/commands/tasksCommand.js.map +1 -0
- package/dist/src/ui/commands/tasksCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/tasksCommand.test.js +365 -0
- package/dist/src/ui/commands/tasksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
- package/dist/src/ui/commands/terminalSetupCommand.js +48 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +7 -0
- package/dist/src/ui/commands/themeCommand.js +20 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +45 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/trustCommand.d.ts +7 -0
- package/dist/src/ui/commands/trustCommand.js +20 -0
- package/dist/src/ui/commands/trustCommand.js.map +1 -0
- package/dist/src/ui/commands/trustCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/trustCommand.test.js +30 -0
- package/dist/src/ui/commands/trustCommand.test.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +298 -0
- package/dist/src/ui/commands/types.js +13 -0
- package/dist/src/ui/commands/types.js.map +1 -0
- package/dist/src/ui/commands/vimCommand.d.ts +7 -0
- package/dist/src/ui/commands/vimCommand.js +27 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -0
- package/dist/src/ui/components/AboutBox.d.ts +12 -0
- package/dist/src/ui/components/AboutBox.js +10 -0
- package/dist/src/ui/components/AboutBox.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.d.ts +20 -0
- package/dist/src/ui/components/AnsiOutput.js +27 -0
- package/dist/src/ui/components/AnsiOutput.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
- package/dist/src/ui/components/AnsiOutput.test.js +134 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
- package/dist/src/ui/components/ApiKeyInput.d.ts +22 -0
- package/dist/src/ui/components/ApiKeyInput.js +35 -0
- package/dist/src/ui/components/ApiKeyInput.js.map +1 -0
- package/dist/src/ui/components/AppHeader.d.ts +10 -0
- package/dist/src/ui/components/AppHeader.js +49 -0
- package/dist/src/ui/components/AppHeader.js.map +1 -0
- package/dist/src/ui/components/AppHeader.test.d.ts +6 -0
- package/dist/src/ui/components/AppHeader.test.js +109 -0
- package/dist/src/ui/components/AppHeader.test.js.map +1 -0
- package/dist/src/ui/components/ApprovalModeDialog.d.ts +21 -0
- package/dist/src/ui/components/ApprovalModeDialog.js +109 -0
- package/dist/src/ui/components/ApprovalModeDialog.js.map +1 -0
- package/dist/src/ui/components/ApprovalModeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ApprovalModeDialog.test.js +63 -0
- package/dist/src/ui/components/ApprovalModeDialog.test.js.map +1 -0
- package/dist/src/ui/components/AsciiArt.d.ts +1 -0
- package/dist/src/ui/components/AsciiArt.js +54 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js +37 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/components/BaseTextInput.d.ts +74 -0
- package/dist/src/ui/components/BaseTextInput.js +144 -0
- package/dist/src/ui/components/BaseTextInput.js.map +1 -0
- package/dist/src/ui/components/BaseTextInput.test.d.ts +6 -0
- package/dist/src/ui/components/BaseTextInput.test.js +78 -0
- package/dist/src/ui/components/BaseTextInput.test.js.map +1 -0
- package/dist/src/ui/components/Composer.d.ts +6 -0
- package/dist/src/ui/components/Composer.js +92 -0
- package/dist/src/ui/components/Composer.js.map +1 -0
- package/dist/src/ui/components/Composer.test.d.ts +6 -0
- package/dist/src/ui/components/Composer.test.js +344 -0
- package/dist/src/ui/components/Composer.test.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.d.ts +14 -0
- package/dist/src/ui/components/ConsentPrompt.js +35 -0
- package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ConsentPrompt.test.js +110 -0
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +20 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js +90 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +10 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +33 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugModeNotification.d.ts +9 -0
- package/dist/src/ui/components/DebugModeNotification.js +23 -0
- package/dist/src/ui/components/DebugModeNotification.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.d.ts +6 -0
- package/dist/src/ui/components/DebugProfiler.js +27 -0
- package/dist/src/ui/components/DebugProfiler.js.map +1 -0
- package/dist/src/ui/components/DialogManager.d.ts +12 -0
- package/dist/src/ui/components/DialogManager.js +247 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/DiffDialog.d.ts +15 -0
- package/dist/src/ui/components/DiffDialog.js +412 -0
- package/dist/src/ui/components/DiffDialog.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +16 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +76 -0
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
- package/dist/src/ui/components/ExitWarning.d.ts +7 -0
- package/dist/src/ui/components/ExitWarning.js +9 -0
- package/dist/src/ui/components/ExitWarning.js.map +1 -0
- package/dist/src/ui/components/ExternalAuthProgress.d.ts +14 -0
- package/dist/src/ui/components/ExternalAuthProgress.js +14 -0
- package/dist/src/ui/components/ExternalAuthProgress.js.map +1 -0
- package/dist/src/ui/components/ExternalAuthProgress.test.d.ts +6 -0
- package/dist/src/ui/components/ExternalAuthProgress.test.js +20 -0
- package/dist/src/ui/components/ExternalAuthProgress.test.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
- package/dist/src/ui/components/FolderTrustDialog.js +58 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js +88 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +7 -0
- package/dist/src/ui/components/Footer.js +104 -0
- package/dist/src/ui/components/Footer.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +22 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +47 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +6 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +29 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -0
- package/dist/src/ui/components/GoalPill.d.ts +25 -0
- package/dist/src/ui/components/GoalPill.js +77 -0
- package/dist/src/ui/components/GoalPill.js.map +1 -0
- package/dist/src/ui/components/GoalPill.test.d.ts +6 -0
- package/dist/src/ui/components/GoalPill.test.js +56 -0
- package/dist/src/ui/components/GoalPill.test.js.map +1 -0
- package/dist/src/ui/components/Header.d.ts +62 -0
- package/dist/src/ui/components/Header.js +155 -0
- package/dist/src/ui/components/Header.js.map +1 -0
- package/dist/src/ui/components/Header.test.d.ts +6 -0
- package/dist/src/ui/components/Header.test.js +142 -0
- package/dist/src/ui/components/Header.test.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +18 -0
- package/dist/src/ui/components/Help.js +236 -0
- package/dist/src/ui/components/Help.js.map +1 -0
- package/dist/src/ui/components/Help.test.d.ts +6 -0
- package/dist/src/ui/components/Help.test.js +243 -0
- package/dist/src/ui/components/Help.test.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +39 -0
- package/dist/src/ui/components/HistoryItemDisplay.js +51 -0
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js +197 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js +34 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +53 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +63 -0
- package/dist/src/ui/components/InputPrompt.js +1220 -0
- package/dist/src/ui/components/InputPrompt.js.map +1 -0
- package/dist/src/ui/components/KeyboardShortcuts.d.ts +7 -0
- package/dist/src/ui/components/KeyboardShortcuts.js +78 -0
- package/dist/src/ui/components/KeyboardShortcuts.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.d.ts +31 -0
- package/dist/src/ui/components/LoadingIndicator.js +46 -0
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/LoadingIndicator.test.js +246 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.d.ts +6 -0
- package/dist/src/ui/components/MainContent.js +437 -0
- package/dist/src/ui/components/MainContent.js.map +1 -0
- package/dist/src/ui/components/MainContent.test.d.ts +6 -0
- package/dist/src/ui/components/MainContent.test.js +621 -0
- package/dist/src/ui/components/MainContent.test.js.map +1 -0
- package/dist/src/ui/components/MemoryDialog.d.ts +10 -0
- package/dist/src/ui/components/MemoryDialog.js +288 -0
- package/dist/src/ui/components/MemoryDialog.js.map +1 -0
- package/dist/src/ui/components/MemoryDialog.test.d.ts +6 -0
- package/dist/src/ui/components/MemoryDialog.test.js +165 -0
- package/dist/src/ui/components/MemoryDialog.test.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +24 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.d.ts +12 -0
- package/dist/src/ui/components/ModelDialog.js +390 -0
- package/dist/src/ui/components/ModelDialog.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelDialog.test.js +489 -0
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +11 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +61 -0
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/Notifications.d.ts +6 -0
- package/dist/src/ui/components/Notifications.js +20 -0
- package/dist/src/ui/components/Notifications.js.map +1 -0
- package/dist/src/ui/components/PermissionsDialog.d.ts +11 -0
- package/dist/src/ui/components/PermissionsDialog.js +547 -0
- package/dist/src/ui/components/PermissionsDialog.js.map +1 -0
- package/dist/src/ui/components/PlanSummaryDisplay.d.ts +14 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js +10 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/PluginChoicePrompt.d.ts +18 -0
- package/dist/src/ui/components/PluginChoicePrompt.js +96 -0
- package/dist/src/ui/components/PluginChoicePrompt.js.map +1 -0
- package/dist/src/ui/components/PluginChoicePrompt.test.d.ts +6 -0
- package/dist/src/ui/components/PluginChoicePrompt.test.js +136 -0
- package/dist/src/ui/components/PluginChoicePrompt.test.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
- package/dist/src/ui/components/PrepareLabel.js +72 -0
- package/dist/src/ui/components/PrepareLabel.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
- package/dist/src/ui/components/PrepareLabel.test.js +71 -0
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
- package/dist/src/ui/components/ProviderUpdatePrompt.d.ts +12 -0
- package/dist/src/ui/components/ProviderUpdatePrompt.js +49 -0
- package/dist/src/ui/components/ProviderUpdatePrompt.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js +35 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +76 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.js +21 -0
- package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/QwenOAuthProgress.d.ts +16 -0
- package/dist/src/ui/components/QwenOAuthProgress.js +65 -0
- package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +6 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js +287 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -0
- package/dist/src/ui/components/RewindSelector.d.ts +22 -0
- package/dist/src/ui/components/RewindSelector.js +264 -0
- package/dist/src/ui/components/RewindSelector.js.map +1 -0
- package/dist/src/ui/components/RewindSelector.test.d.ts +6 -0
- package/dist/src/ui/components/RewindSelector.test.js +146 -0
- package/dist/src/ui/components/RewindSelector.test.js.map +1 -0
- package/dist/src/ui/components/SessionPicker.d.ts +55 -0
- package/dist/src/ui/components/SessionPicker.js +142 -0
- package/dist/src/ui/components/SessionPicker.js.map +1 -0
- package/dist/src/ui/components/SessionPreview.d.ts +20 -0
- package/dist/src/ui/components/SessionPreview.js +97 -0
- package/dist/src/ui/components/SessionPreview.js.map +1 -0
- package/dist/src/ui/components/SessionPreview.test.d.ts +1 -0
- package/dist/src/ui/components/SessionPreview.test.js +124 -0
- package/dist/src/ui/components/SessionPreview.test.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +12 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +17 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/SettingInputPrompt.d.ts +15 -0
- package/dist/src/ui/components/SettingInputPrompt.js +63 -0
- package/dist/src/ui/components/SettingInputPrompt.js.map +1 -0
- package/dist/src/ui/components/SettingInputPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/SettingInputPrompt.test.js +60 -0
- package/dist/src/ui/components/SettingInputPrompt.test.js.map +1 -0
- package/dist/src/ui/components/SettingsCorruptedDialog.d.ts +14 -0
- package/dist/src/ui/components/SettingsCorruptedDialog.js +44 -0
- package/dist/src/ui/components/SettingsCorruptedDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsCorruptedDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsCorruptedDialog.test.js +162 -0
- package/dist/src/ui/components/SettingsCorruptedDialog.test.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.d.ts +18 -0
- package/dist/src/ui/components/SettingsDialog.js +658 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsDialog.test.js +1127 -0
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +17 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +75 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +167 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
- package/dist/src/ui/components/ShellInputPrompt.js +42 -0
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
- package/dist/src/ui/components/ShellModeIndicator.js +5 -0
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
- package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
- package/dist/src/ui/components/ShowMoreLines.js +24 -0
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
- package/dist/src/ui/components/StandaloneSessionPicker.d.ts +11 -0
- package/dist/src/ui/components/StandaloneSessionPicker.js +105 -0
- package/dist/src/ui/components/StandaloneSessionPicker.js.map +1 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.d.ts +6 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.js +667 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.js.map +1 -0
- package/dist/src/ui/components/StatsActivityTab.d.ts +14 -0
- package/dist/src/ui/components/StatsActivityTab.js +85 -0
- package/dist/src/ui/components/StatsActivityTab.js.map +1 -0
- package/dist/src/ui/components/StatsDialog.d.ts +12 -0
- package/dist/src/ui/components/StatsDialog.js +104 -0
- package/dist/src/ui/components/StatsDialog.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.d.ts +13 -0
- package/dist/src/ui/components/StatsDisplay.js +52 -0
- package/dist/src/ui/components/StatsDisplay.js.map +1 -0
- package/dist/src/ui/components/StatsEfficiencyTab.d.ts +11 -0
- package/dist/src/ui/components/StatsEfficiencyTab.js +99 -0
- package/dist/src/ui/components/StatsEfficiencyTab.js.map +1 -0
- package/dist/src/ui/components/StatsHeatmapView.d.ts +12 -0
- package/dist/src/ui/components/StatsHeatmapView.js +40 -0
- package/dist/src/ui/components/StatsHeatmapView.js.map +1 -0
- package/dist/src/ui/components/StatsSessionTab.d.ts +7 -0
- package/dist/src/ui/components/StatsSessionTab.js +40 -0
- package/dist/src/ui/components/StatsSessionTab.js.map +1 -0
- package/dist/src/ui/components/StatusLineDialog.d.ts +22 -0
- package/dist/src/ui/components/StatusLineDialog.js +140 -0
- package/dist/src/ui/components/StatusLineDialog.js.map +1 -0
- package/dist/src/ui/components/StatusLineDialog.test.d.ts +6 -0
- package/dist/src/ui/components/StatusLineDialog.test.js +180 -0
- package/dist/src/ui/components/StatusLineDialog.test.js.map +1 -0
- package/dist/src/ui/components/StickyTodoList.d.ts +14 -0
- package/dist/src/ui/components/StickyTodoList.js +45 -0
- package/dist/src/ui/components/StickyTodoList.js.map +1 -0
- package/dist/src/ui/components/StickyTodoList.test.d.ts +6 -0
- package/dist/src/ui/components/StickyTodoList.test.js +128 -0
- package/dist/src/ui/components/StickyTodoList.test.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +47 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +43 -0
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.js +39 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.d.ts +20 -0
- package/dist/src/ui/components/ThemeDialog.js +137 -0
- package/dist/src/ui/components/ThemeDialog.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ThemeDialog.test.js +75 -0
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
- package/dist/src/ui/components/ThinkingDots.d.ts +11 -0
- package/dist/src/ui/components/ThinkingDots.js +47 -0
- package/dist/src/ui/components/ThinkingDots.js.map +1 -0
- package/dist/src/ui/components/ThinkingIndicator.d.ts +7 -0
- package/dist/src/ui/components/ThinkingIndicator.js +13 -0
- package/dist/src/ui/components/ThinkingIndicator.js.map +1 -0
- package/dist/src/ui/components/Tips.d.ts +6 -0
- package/dist/src/ui/components/Tips.js +37 -0
- package/dist/src/ui/components/Tips.js.map +1 -0
- package/dist/src/ui/components/Tips.test.d.ts +6 -0
- package/dist/src/ui/components/Tips.test.js +145 -0
- package/dist/src/ui/components/Tips.test.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.d.ts +16 -0
- package/dist/src/ui/components/TodoDisplay.js +27 -0
- package/dist/src/ui/components/TodoDisplay.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/TodoDisplay.test.js +77 -0
- package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +11 -0
- package/dist/src/ui/components/ToolStatsDisplay.js +42 -0
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/TrustDialog.d.ts +13 -0
- package/dist/src/ui/components/TrustDialog.js +48 -0
- package/dist/src/ui/components/TrustDialog.js.map +1 -0
- package/dist/src/ui/components/TrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/TrustDialog.test.js +154 -0
- package/dist/src/ui/components/TrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
- package/dist/src/ui/components/UpdateNotification.js +10 -0
- package/dist/src/ui/components/UpdateNotification.js.map +1 -0
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +13 -0
- package/dist/src/ui/components/WelcomeBackDialog.js +43 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
- package/dist/src/ui/components/WorktreeExitDialog.d.ts +26 -0
- package/dist/src/ui/components/WorktreeExitDialog.js +134 -0
- package/dist/src/ui/components/WorktreeExitDialog.js.map +1 -0
- package/dist/src/ui/components/WorktreeExitDialog.test.d.ts +6 -0
- package/dist/src/ui/components/WorktreeExitDialog.test.js +41 -0
- package/dist/src/ui/components/WorktreeExitDialog.test.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentChatContent.d.ts +27 -0
- package/dist/src/ui/components/agent-view/AgentChatContent.js +150 -0
- package/dist/src/ui/components/agent-view/AgentChatContent.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentChatView.d.ts +10 -0
- package/dist/src/ui/components/agent-view/AgentChatView.js +24 -0
- package/dist/src/ui/components/agent-view/AgentChatView.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentComposer.d.ts +10 -0
- package/dist/src/ui/components/agent-view/AgentComposer.js +183 -0
- package/dist/src/ui/components/agent-view/AgentComposer.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentFooter.d.ts +20 -0
- package/dist/src/ui/components/agent-view/AgentFooter.js +15 -0
- package/dist/src/ui/components/agent-view/AgentFooter.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentHeader.d.ts +19 -0
- package/dist/src/ui/components/agent-view/AgentHeader.js +13 -0
- package/dist/src/ui/components/agent-view/AgentHeader.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentTabBar.d.ts +6 -0
- package/dist/src/ui/components/agent-view/AgentTabBar.js +110 -0
- package/dist/src/ui/components/agent-view/AgentTabBar.js.map +1 -0
- package/dist/src/ui/components/agent-view/AgentTabBar.test.d.ts +6 -0
- package/dist/src/ui/components/agent-view/AgentTabBar.test.js +90 -0
- package/dist/src/ui/components/agent-view/AgentTabBar.test.js.map +1 -0
- package/dist/src/ui/components/agent-view/agentHistoryAdapter.d.ts +31 -0
- package/dist/src/ui/components/agent-view/agentHistoryAdapter.js +148 -0
- package/dist/src/ui/components/agent-view/agentHistoryAdapter.js.map +1 -0
- package/dist/src/ui/components/agent-view/agentHistoryAdapter.test.d.ts +6 -0
- package/dist/src/ui/components/agent-view/agentHistoryAdapter.test.js +318 -0
- package/dist/src/ui/components/agent-view/agentHistoryAdapter.test.js.map +1 -0
- package/dist/src/ui/components/agent-view/index.d.ts +11 -0
- package/dist/src/ui/components/agent-view/index.js +12 -0
- package/dist/src/ui/components/agent-view/index.js.map +1 -0
- package/dist/src/ui/components/approvalModeVisuals.d.ts +11 -0
- package/dist/src/ui/components/approvalModeVisuals.js +37 -0
- package/dist/src/ui/components/approvalModeVisuals.js.map +1 -0
- package/dist/src/ui/components/approvalModeVisuals.test.d.ts +6 -0
- package/dist/src/ui/components/approvalModeVisuals.test.js +32 -0
- package/dist/src/ui/components/approvalModeVisuals.test.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaCards.d.ts +21 -0
- package/dist/src/ui/components/arena/ArenaCards.js +99 -0
- package/dist/src/ui/components/arena/ArenaCards.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaCards.test.d.ts +6 -0
- package/dist/src/ui/components/arena/ArenaCards.test.js +128 -0
- package/dist/src/ui/components/arena/ArenaCards.test.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaSelectDialog.d.ts +16 -0
- package/dist/src/ui/components/arena/ArenaSelectDialog.js +213 -0
- package/dist/src/ui/components/arena/ArenaSelectDialog.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaSelectDialog.test.d.ts +6 -0
- package/dist/src/ui/components/arena/ArenaSelectDialog.test.js +149 -0
- package/dist/src/ui/components/arena/ArenaSelectDialog.test.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaStartDialog.d.ts +12 -0
- package/dist/src/ui/components/arena/ArenaStartDialog.js +49 -0
- package/dist/src/ui/components/arena/ArenaStartDialog.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaStatusDialog.d.ts +14 -0
- package/dist/src/ui/components/arena/ArenaStatusDialog.js +111 -0
- package/dist/src/ui/components/arena/ArenaStatusDialog.js.map +1 -0
- package/dist/src/ui/components/arena/ArenaStopDialog.d.ts +15 -0
- package/dist/src/ui/components/arena/ArenaStopDialog.js +113 -0
- package/dist/src/ui/components/arena/ArenaStopDialog.js.map +1 -0
- package/dist/src/ui/components/background-view/BackgroundTasksDialog.d.ts +17 -0
- package/dist/src/ui/components/background-view/BackgroundTasksDialog.js +614 -0
- package/dist/src/ui/components/background-view/BackgroundTasksDialog.js.map +1 -0
- package/dist/src/ui/components/background-view/BackgroundTasksDialog.test.d.ts +6 -0
- package/dist/src/ui/components/background-view/BackgroundTasksDialog.test.js +606 -0
- package/dist/src/ui/components/background-view/BackgroundTasksDialog.test.js.map +1 -0
- package/dist/src/ui/components/background-view/BackgroundTasksPill.d.ts +14 -0
- package/dist/src/ui/components/background-view/BackgroundTasksPill.js +94 -0
- package/dist/src/ui/components/background-view/BackgroundTasksPill.js.map +1 -0
- package/dist/src/ui/components/background-view/BackgroundTasksPill.test.d.ts +6 -0
- package/dist/src/ui/components/background-view/BackgroundTasksPill.test.js +158 -0
- package/dist/src/ui/components/background-view/BackgroundTasksPill.test.js.map +1 -0
- package/dist/src/ui/components/background-view/LiveAgentPanel.d.ts +43 -0
- package/dist/src/ui/components/background-view/LiveAgentPanel.js +361 -0
- package/dist/src/ui/components/background-view/LiveAgentPanel.js.map +1 -0
- package/dist/src/ui/components/background-view/LiveAgentPanel.test.d.ts +6 -0
- package/dist/src/ui/components/background-view/LiveAgentPanel.test.js +595 -0
- package/dist/src/ui/components/background-view/LiveAgentPanel.test.js.map +1 -0
- package/dist/src/ui/components/extensions/ExtensionsManagerDialog.d.ts +12 -0
- package/dist/src/ui/components/extensions/ExtensionsManagerDialog.js +337 -0
- package/dist/src/ui/components/extensions/ExtensionsManagerDialog.js.map +1 -0
- package/dist/src/ui/components/extensions/ExtensionsManagerDialog.test.d.ts +6 -0
- package/dist/src/ui/components/extensions/ExtensionsManagerDialog.test.js +90 -0
- package/dist/src/ui/components/extensions/ExtensionsManagerDialog.test.js.map +1 -0
- package/dist/src/ui/components/extensions/index.d.ts +8 -0
- package/dist/src/ui/components/extensions/index.js +8 -0
- package/dist/src/ui/components/extensions/index.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/ActionSelectionStep.d.ts +15 -0
- package/dist/src/ui/components/extensions/steps/ActionSelectionStep.js +75 -0
- package/dist/src/ui/components/extensions/steps/ActionSelectionStep.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/ActionSelectionStep.test.d.ts +6 -0
- package/dist/src/ui/components/extensions/steps/ActionSelectionStep.test.js +56 -0
- package/dist/src/ui/components/extensions/steps/ActionSelectionStep.test.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/ExtensionDetailStep.d.ts +11 -0
- package/dist/src/ui/components/extensions/steps/ExtensionDetailStep.js +23 -0
- package/dist/src/ui/components/extensions/steps/ExtensionDetailStep.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/ExtensionListStep.d.ts +13 -0
- package/dist/src/ui/components/extensions/steps/ExtensionListStep.js +105 -0
- package/dist/src/ui/components/extensions/steps/ExtensionListStep.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/ExtensionListStep.test.d.ts +6 -0
- package/dist/src/ui/components/extensions/steps/ExtensionListStep.test.js +74 -0
- package/dist/src/ui/components/extensions/steps/ExtensionListStep.test.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/ScopeSelectStep.d.ts +13 -0
- package/dist/src/ui/components/extensions/steps/ScopeSelectStep.js +40 -0
- package/dist/src/ui/components/extensions/steps/ScopeSelectStep.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/UninstallConfirmStep.d.ts +13 -0
- package/dist/src/ui/components/extensions/steps/UninstallConfirmStep.js +38 -0
- package/dist/src/ui/components/extensions/steps/UninstallConfirmStep.js.map +1 -0
- package/dist/src/ui/components/extensions/steps/index.d.ts +10 -0
- package/dist/src/ui/components/extensions/steps/index.js +11 -0
- package/dist/src/ui/components/extensions/steps/index.js.map +1 -0
- package/dist/src/ui/components/extensions/types.d.ts +73 -0
- package/dist/src/ui/components/extensions/types.js +18 -0
- package/dist/src/ui/components/extensions/types.js.map +1 -0
- package/dist/src/ui/components/hooks/HandlerListBody.d.ts +12 -0
- package/dist/src/ui/components/hooks/HandlerListBody.js +54 -0
- package/dist/src/ui/components/hooks/HandlerListBody.js.map +1 -0
- package/dist/src/ui/components/hooks/HandlerListBody.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HandlerListBody.test.js +175 -0
- package/dist/src/ui/components/hooks/HandlerListBody.test.js.map +1 -0
- package/dist/src/ui/components/hooks/HookConfigDetailStep.d.ts +12 -0
- package/dist/src/ui/components/hooks/HookConfigDetailStep.js +48 -0
- package/dist/src/ui/components/hooks/HookConfigDetailStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HookConfigDetailStep.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HookConfigDetailStep.test.js +236 -0
- package/dist/src/ui/components/hooks/HookConfigDetailStep.test.js.map +1 -0
- package/dist/src/ui/components/hooks/HookDetailStep.d.ts +12 -0
- package/dist/src/ui/components/hooks/HookDetailStep.js +11 -0
- package/dist/src/ui/components/hooks/HookDetailStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HookDetailStep.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HookDetailStep.test.js +241 -0
- package/dist/src/ui/components/hooks/HookDetailStep.test.js.map +1 -0
- package/dist/src/ui/components/hooks/HookEventHandlerListStep.d.ts +12 -0
- package/dist/src/ui/components/hooks/HookEventHandlerListStep.js +18 -0
- package/dist/src/ui/components/hooks/HookEventHandlerListStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HookEventHeader.d.ts +13 -0
- package/dist/src/ui/components/hooks/HookEventHeader.js +23 -0
- package/dist/src/ui/components/hooks/HookEventHeader.js.map +1 -0
- package/dist/src/ui/components/hooks/HookEventMatcherListStep.d.ts +12 -0
- package/dist/src/ui/components/hooks/HookEventMatcherListStep.js +28 -0
- package/dist/src/ui/components/hooks/HookEventMatcherListStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HookMatcherDetailStep.d.ts +13 -0
- package/dist/src/ui/components/hooks/HookMatcherDetailStep.js +16 -0
- package/dist/src/ui/components/hooks/HookMatcherDetailStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HookMatcherDetailStep.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HookMatcherDetailStep.test.js +154 -0
- package/dist/src/ui/components/hooks/HookMatcherDetailStep.test.js.map +1 -0
- package/dist/src/ui/components/hooks/HooksDisabledStep.d.ts +10 -0
- package/dist/src/ui/components/hooks/HooksDisabledStep.js +23 -0
- package/dist/src/ui/components/hooks/HooksDisabledStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HooksDisabledStep.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HooksDisabledStep.test.js +86 -0
- package/dist/src/ui/components/hooks/HooksDisabledStep.test.js.map +1 -0
- package/dist/src/ui/components/hooks/HooksListStep.d.ts +12 -0
- package/dist/src/ui/components/hooks/HooksListStep.js +32 -0
- package/dist/src/ui/components/hooks/HooksListStep.js.map +1 -0
- package/dist/src/ui/components/hooks/HooksListStep.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HooksListStep.test.js +144 -0
- package/dist/src/ui/components/hooks/HooksListStep.test.js.map +1 -0
- package/dist/src/ui/components/hooks/HooksManagementDialog.d.ts +7 -0
- package/dist/src/ui/components/hooks/HooksManagementDialog.js +418 -0
- package/dist/src/ui/components/hooks/HooksManagementDialog.js.map +1 -0
- package/dist/src/ui/components/hooks/HooksManagementDialog.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/HooksManagementDialog.test.js +305 -0
- package/dist/src/ui/components/hooks/HooksManagementDialog.test.js.map +1 -0
- package/dist/src/ui/components/hooks/constants.d.ts +26 -0
- package/dist/src/ui/components/hooks/constants.js +227 -0
- package/dist/src/ui/components/hooks/constants.js.map +1 -0
- package/dist/src/ui/components/hooks/constants.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/constants.test.js +317 -0
- package/dist/src/ui/components/hooks/constants.test.js.map +1 -0
- package/dist/src/ui/components/hooks/index.d.ts +12 -0
- package/dist/src/ui/components/hooks/index.js +13 -0
- package/dist/src/ui/components/hooks/index.js.map +1 -0
- package/dist/src/ui/components/hooks/matcherGrouping.d.ts +9 -0
- package/dist/src/ui/components/hooks/matcherGrouping.js +35 -0
- package/dist/src/ui/components/hooks/matcherGrouping.js.map +1 -0
- package/dist/src/ui/components/hooks/matcherGrouping.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/matcherGrouping.test.js +183 -0
- package/dist/src/ui/components/hooks/matcherGrouping.test.js.map +1 -0
- package/dist/src/ui/components/hooks/sourceLabels.d.ts +13 -0
- package/dist/src/ui/components/hooks/sourceLabels.js +35 -0
- package/dist/src/ui/components/hooks/sourceLabels.js.map +1 -0
- package/dist/src/ui/components/hooks/sourceLabels.test.d.ts +6 -0
- package/dist/src/ui/components/hooks/sourceLabels.test.js +81 -0
- package/dist/src/ui/components/hooks/sourceLabels.test.js.map +1 -0
- package/dist/src/ui/components/hooks/types.d.ts +42 -0
- package/dist/src/ui/components/hooks/types.js +13 -0
- package/dist/src/ui/components/hooks/types.js.map +1 -0
- package/dist/src/ui/components/mcp/MCPHealthPill.d.ts +24 -0
- package/dist/src/ui/components/mcp/MCPHealthPill.js +33 -0
- package/dist/src/ui/components/mcp/MCPHealthPill.js.map +1 -0
- package/dist/src/ui/components/mcp/MCPHealthPill.test.d.ts +6 -0
- package/dist/src/ui/components/mcp/MCPHealthPill.test.js +42 -0
- package/dist/src/ui/components/mcp/MCPHealthPill.test.js.map +1 -0
- package/dist/src/ui/components/mcp/MCPManagementDialog.d.ts +7 -0
- package/dist/src/ui/components/mcp/MCPManagementDialog.js +472 -0
- package/dist/src/ui/components/mcp/MCPManagementDialog.js.map +1 -0
- package/dist/src/ui/components/mcp/constants.d.ts +29 -0
- package/dist/src/ui/components/mcp/constants.js +34 -0
- package/dist/src/ui/components/mcp/constants.js.map +1 -0
- package/dist/src/ui/components/mcp/index.d.ts +12 -0
- package/dist/src/ui/components/mcp/index.js +15 -0
- package/dist/src/ui/components/mcp/index.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/AuthenticateStep.d.ts +7 -0
- package/dist/src/ui/components/mcp/steps/AuthenticateStep.js +187 -0
- package/dist/src/ui/components/mcp/steps/AuthenticateStep.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/DisableScopeSelectStep.d.ts +7 -0
- package/dist/src/ui/components/mcp/steps/DisableScopeSelectStep.js +44 -0
- package/dist/src/ui/components/mcp/steps/DisableScopeSelectStep.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/ServerDetailStep.d.ts +7 -0
- package/dist/src/ui/components/mcp/steps/ServerDetailStep.js +108 -0
- package/dist/src/ui/components/mcp/steps/ServerDetailStep.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/ServerListStep.d.ts +7 -0
- package/dist/src/ui/components/mcp/steps/ServerListStep.js +74 -0
- package/dist/src/ui/components/mcp/steps/ServerListStep.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/ServerListStep.test.d.ts +6 -0
- package/dist/src/ui/components/mcp/steps/ServerListStep.test.js +60 -0
- package/dist/src/ui/components/mcp/steps/ServerListStep.test.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/ToolDetailStep.d.ts +7 -0
- package/dist/src/ui/components/mcp/steps/ToolDetailStep.js +49 -0
- package/dist/src/ui/components/mcp/steps/ToolDetailStep.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/ToolListStep.d.ts +7 -0
- package/dist/src/ui/components/mcp/steps/ToolListStep.js +80 -0
- package/dist/src/ui/components/mcp/steps/ToolListStep.js.map +1 -0
- package/dist/src/ui/components/mcp/steps/ToolListStep.test.d.ts +6 -0
- package/dist/src/ui/components/mcp/steps/ToolListStep.test.js +55 -0
- package/dist/src/ui/components/mcp/steps/ToolListStep.test.js.map +1 -0
- package/dist/src/ui/components/mcp/types.d.ts +177 -0
- package/dist/src/ui/components/mcp/types.js +17 -0
- package/dist/src/ui/components/mcp/types.js.map +1 -0
- package/dist/src/ui/components/mcp/utils.d.ts +40 -0
- package/dist/src/ui/components/mcp/utils.js +126 -0
- package/dist/src/ui/components/mcp/utils.js.map +1 -0
- package/dist/src/ui/components/mcp/utils.test.d.ts +6 -0
- package/dist/src/ui/components/mcp/utils.test.js +130 -0
- package/dist/src/ui/components/mcp/utils.test.js.map +1 -0
- package/dist/src/ui/components/messages/AskUserQuestionDialog.d.ts +14 -0
- package/dist/src/ui/components/messages/AskUserQuestionDialog.js +291 -0
- package/dist/src/ui/components/messages/AskUserQuestionDialog.js.map +1 -0
- package/dist/src/ui/components/messages/AskUserQuestionDialog.test.d.ts +6 -0
- package/dist/src/ui/components/messages/AskUserQuestionDialog.test.js +281 -0
- package/dist/src/ui/components/messages/AskUserQuestionDialog.test.js.map +1 -0
- package/dist/src/ui/components/messages/BtwMessage.d.ts +14 -0
- package/dist/src/ui/components/messages/BtwMessage.js +30 -0
- package/dist/src/ui/components/messages/BtwMessage.js.map +1 -0
- package/dist/src/ui/components/messages/BtwMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/BtwMessage.test.js +60 -0
- package/dist/src/ui/components/messages/BtwMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/CompactToolGroupDisplay.d.ts +20 -0
- package/dist/src/ui/components/messages/CompactToolGroupDisplay.js +80 -0
- package/dist/src/ui/components/messages/CompactToolGroupDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/CompactToolGroupDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompactToolGroupDisplay.test.js +139 -0
- package/dist/src/ui/components/messages/CompactToolGroupDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +10 -0
- package/dist/src/ui/components/messages/CompressionMessage.js +50 -0
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ConversationMessages.d.ts +46 -0
- package/dist/src/ui/components/messages/ConversationMessages.js +32 -0
- package/dist/src/ui/components/messages/ConversationMessages.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +19 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +219 -0
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js +296 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffStatsDisplay.d.ts +18 -0
- package/dist/src/ui/components/messages/DiffStatsDisplay.js +50 -0
- package/dist/src/ui/components/messages/DiffStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/DiffStatsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffStatsDisplay.test.js +165 -0
- package/dist/src/ui/components/messages/DiffStatsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/GoalStatusMessage.d.ts +16 -0
- package/dist/src/ui/components/messages/GoalStatusMessage.js +76 -0
- package/dist/src/ui/components/messages/GoalStatusMessage.js.map +1 -0
- package/dist/src/ui/components/messages/GoalStatusMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/GoalStatusMessage.test.js +32 -0
- package/dist/src/ui/components/messages/GoalStatusMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.d.ts +33 -0
- package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.js +196 -0
- package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.test.js +219 -0
- package/dist/src/ui/components/messages/InlineParallelAgentsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/InsightProgressMessage.d.ts +12 -0
- package/dist/src/ui/components/messages/InsightProgressMessage.js +20 -0
- package/dist/src/ui/components/messages/InsightProgressMessage.js.map +1 -0
- package/dist/src/ui/components/messages/MemorySavedMessage.d.ts +18 -0
- package/dist/src/ui/components/messages/MemorySavedMessage.js +15 -0
- package/dist/src/ui/components/messages/MemorySavedMessage.js.map +1 -0
- package/dist/src/ui/components/messages/StatusMessages.d.ts +33 -0
- package/dist/src/ui/components/messages/StatusMessages.js +28 -0
- package/dist/src/ui/components/messages/StatusMessages.js.map +1 -0
- package/dist/src/ui/components/messages/StatusMessages.test.d.ts +6 -0
- package/dist/src/ui/components/messages/StatusMessages.test.js +21 -0
- package/dist/src/ui/components/messages/StatusMessages.test.js.map +1 -0
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/SummaryMessage.js +38 -0
- package/dist/src/ui/components/messages/SummaryMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +16 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +352 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +312 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +58 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js +278 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +619 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +39 -0
- package/dist/src/ui/components/messages/ToolMessage.js +400 -0
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js +575 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +40 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js +75 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +37 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
- package/dist/src/ui/components/shared/EnumSelector.js +44 -0
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +453 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/MultiSelect.d.ts +30 -0
- package/dist/src/ui/components/shared/MultiSelect.js +94 -0
- package/dist/src/ui/components/shared/MultiSelect.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +45 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js +21 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +134 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
- package/dist/src/ui/components/shared/ScopeSelector.js +16 -0
- package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
- package/dist/src/ui/components/shared/ScrollableList.d.ts +19 -0
- package/dist/src/ui/components/shared/ScrollableList.js +97 -0
- package/dist/src/ui/components/shared/ScrollableList.js.map +1 -0
- package/dist/src/ui/components/shared/ScrollableList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/ScrollableList.test.js +158 -0
- package/dist/src/ui/components/shared/ScrollableList.test.js.map +1 -0
- package/dist/src/ui/components/shared/StaticRender.d.ts +25 -0
- package/dist/src/ui/components/shared/StaticRender.js +25 -0
- package/dist/src/ui/components/shared/StaticRender.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.d.ts +25 -0
- package/dist/src/ui/components/shared/TextInput.js +163 -0
- package/dist/src/ui/components/shared/TextInput.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.test.d.ts +6 -0
- package/dist/src/ui/components/shared/TextInput.test.js +91 -0
- package/dist/src/ui/components/shared/TextInput.test.js.map +1 -0
- package/dist/src/ui/components/shared/ToolElapsedTime.d.ts +30 -0
- package/dist/src/ui/components/shared/ToolElapsedTime.js +43 -0
- package/dist/src/ui/components/shared/ToolElapsedTime.js.map +1 -0
- package/dist/src/ui/components/shared/ToolElapsedTime.test.d.ts +6 -0
- package/dist/src/ui/components/shared/ToolElapsedTime.test.js +63 -0
- package/dist/src/ui/components/shared/ToolElapsedTime.test.js.map +1 -0
- package/dist/src/ui/components/shared/ToolStatusIndicator.d.ts +14 -0
- package/dist/src/ui/components/shared/ToolStatusIndicator.js +13 -0
- package/dist/src/ui/components/shared/ToolStatusIndicator.js.map +1 -0
- package/dist/src/ui/components/shared/VirtualizedList.d.ts +49 -0
- package/dist/src/ui/components/shared/VirtualizedList.js +529 -0
- package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -0
- package/dist/src/ui/components/shared/VirtualizedList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/VirtualizedList.test.js +371 -0
- package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer-external-editor.test.d.ts +6 -0
- package/dist/src/ui/components/shared/text-buffer-external-editor.test.js +657 -0
- package/dist/src/ui/components/shared/text-buffer-external-editor.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +503 -0
- package/dist/src/ui/components/shared/text-buffer.js +2181 -0
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +74 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +612 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
- package/dist/src/ui/components/skills/SkillsManagerDialog.d.ts +44 -0
- package/dist/src/ui/components/skills/SkillsManagerDialog.js +423 -0
- package/dist/src/ui/components/skills/SkillsManagerDialog.js.map +1 -0
- package/dist/src/ui/components/stats-helpers.d.ts +30 -0
- package/dist/src/ui/components/stats-helpers.js +79 -0
- package/dist/src/ui/components/stats-helpers.js.map +1 -0
- package/dist/src/ui/components/subagents/constants.d.ts +23 -0
- package/dist/src/ui/components/subagents/constants.js +67 -0
- package/dist/src/ui/components/subagents/constants.js.map +1 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +173 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js +43 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js +176 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +107 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +39 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js +39 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +26 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +28 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +16 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js +145 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/index.d.ts +7 -0
- package/dist/src/ui/components/subagents/index.js +13 -0
- package/dist/src/ui/components/subagents/index.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +73 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +38 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +76 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +12 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +342 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.test.d.ts +6 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.test.js +56 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.test.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +11 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +20 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +214 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/components/subagents/reducers.d.ts +14 -0
- package/dist/src/ui/components/subagents/reducers.js +162 -0
- package/dist/src/ui/components/subagents/reducers.js.map +1 -0
- package/dist/src/ui/components/subagents/types.d.ts +137 -0
- package/dist/src/ui/components/subagents/types.js +15 -0
- package/dist/src/ui/components/subagents/types.js.map +1 -0
- package/dist/src/ui/components/subagents/utils.d.ts +15 -0
- package/dist/src/ui/components/subagents/utils.js +79 -0
- package/dist/src/ui/components/subagents/utils.js.map +1 -0
- package/dist/src/ui/components/views/ContextUsage.d.ts +23 -0
- package/dist/src/ui/components/views/ContextUsage.js +130 -0
- package/dist/src/ui/components/views/ContextUsage.js.map +1 -0
- package/dist/src/ui/components/views/ContextUsage.test.d.ts +6 -0
- package/dist/src/ui/components/views/ContextUsage.test.js +76 -0
- package/dist/src/ui/components/views/ContextUsage.test.js.map +1 -0
- package/dist/src/ui/components/views/DoctorReport.d.ts +18 -0
- package/dist/src/ui/components/views/DoctorReport.js +45 -0
- package/dist/src/ui/components/views/DoctorReport.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.js +49 -0
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +88 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
- package/dist/src/ui/components/views/McpStatus.js +90 -0
- package/dist/src/ui/components/views/McpStatus.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
- package/dist/src/ui/components/views/McpStatus.test.js +117 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
- package/dist/src/ui/components/views/SkillsList.d.ts +12 -0
- package/dist/src/ui/components/views/SkillsList.js +7 -0
- package/dist/src/ui/components/views/SkillsList.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
- package/dist/src/ui/components/views/ToolsList.js +8 -0
- package/dist/src/ui/components/views/ToolsList.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ToolsList.test.js +45 -0
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
- package/dist/src/ui/constants.d.ts +18 -0
- package/dist/src/ui/constants.js +23 -0
- package/dist/src/ui/constants.js.map +1 -0
- package/dist/src/ui/contexts/AgentViewContext.d.ts +49 -0
- package/dist/src/ui/contexts/AgentViewContext.js +187 -0
- package/dist/src/ui/contexts/AgentViewContext.js.map +1 -0
- package/dist/src/ui/contexts/AppContext.d.ts +11 -0
- package/dist/src/ui/contexts/AppContext.js +15 -0
- package/dist/src/ui/contexts/AppContext.js.map +1 -0
- package/dist/src/ui/contexts/BackgroundTaskViewContext.d.ts +60 -0
- package/dist/src/ui/contexts/BackgroundTaskViewContext.js +238 -0
- package/dist/src/ui/contexts/BackgroundTaskViewContext.js.map +1 -0
- package/dist/src/ui/contexts/CompactModeContext.d.ts +13 -0
- package/dist/src/ui/contexts/CompactModeContext.js +13 -0
- package/dist/src/ui/contexts/CompactModeContext.js.map +1 -0
- package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
- package/dist/src/ui/contexts/ConfigContext.js +16 -0
- package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +40 -0
- package/dist/src/ui/contexts/KeypressContext.js +959 -0
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js +1360 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
- package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
- package/dist/src/ui/contexts/OverflowContext.js +38 -0
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
- package/dist/src/ui/contexts/RenderModeContext.d.ts +14 -0
- package/dist/src/ui/contexts/RenderModeContext.js +15 -0
- package/dist/src/ui/contexts/RenderModeContext.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.d.ts +47 -0
- package/dist/src/ui/contexts/SessionContext.js +180 -0
- package/dist/src/ui/contexts/SessionContext.js.map +1 -0
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
- package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
- package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
- package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
- package/dist/src/ui/contexts/StreamingContext.js +15 -0
- package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
- package/dist/src/ui/contexts/TerminalOutputContext.d.ts +12 -0
- package/dist/src/ui/contexts/TerminalOutputContext.js +11 -0
- package/dist/src/ui/contexts/TerminalOutputContext.js.map +1 -0
- package/dist/src/ui/contexts/UIActionsContext.d.ts +91 -0
- package/dist/src/ui/contexts/UIActionsContext.js +22 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/UIStateContext.d.ts +158 -0
- package/dist/src/ui/contexts/UIStateContext.js +20 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
- package/dist/src/ui/contexts/VimModeContext.d.ts +31 -0
- package/dist/src/ui/contexts/VimModeContext.js +60 -0
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
- package/dist/src/ui/contexts/VimModeContext.test.d.ts +11 -0
- package/dist/src/ui/contexts/VimModeContext.test.js +99 -0
- package/dist/src/ui/contexts/VimModeContext.test.js.map +1 -0
- package/dist/src/ui/daemon/DaemonTuiAdapter.d.ts +101 -0
- package/dist/src/ui/daemon/DaemonTuiAdapter.js +695 -0
- package/dist/src/ui/daemon/DaemonTuiAdapter.js.map +1 -0
- package/dist/src/ui/daemon/DaemonTuiAdapter.test.d.ts +6 -0
- package/dist/src/ui/daemon/DaemonTuiAdapter.test.js +784 -0
- package/dist/src/ui/daemon/DaemonTuiAdapter.test.js.map +1 -0
- package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
- package/dist/src/ui/editors/editorSettingsManager.js +48 -0
- package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +33 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +344 -0
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +871 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
- package/dist/src/ui/hooks/keyToAnsi.js +67 -0
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +18 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +287 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +509 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +71 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +837 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/useAgentStreamingState.d.ts +29 -0
- package/dist/src/ui/hooks/useAgentStreamingState.js +109 -0
- package/dist/src/ui/hooks/useAgentStreamingState.js.map +1 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js +21 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.d.ts +37 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.js +44 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +74 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +1 -0
- package/dist/src/ui/hooks/useAnimationFrame.d.ts +25 -0
- package/dist/src/ui/hooks/useAnimationFrame.js +86 -0
- package/dist/src/ui/hooks/useAnimationFrame.js.map +1 -0
- package/dist/src/ui/hooks/useApprovalModeCommand.d.ts +14 -0
- package/dist/src/ui/hooks/useApprovalModeCommand.js +33 -0
- package/dist/src/ui/hooks/useApprovalModeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useArenaCommand.d.ts +13 -0
- package/dist/src/ui/hooks/useArenaCommand.js +21 -0
- package/dist/src/ui/hooks/useArenaCommand.js.map +1 -0
- package/dist/src/ui/hooks/useArenaInProcess.d.ts +14 -0
- package/dist/src/ui/hooks/useArenaInProcess.js +136 -0
- package/dist/src/ui/hooks/useArenaInProcess.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/useAtCompletion.js +184 -0
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useAttentionNotifications.d.ts +22 -0
- package/dist/src/ui/hooks/useAttentionNotifications.js +89 -0
- package/dist/src/ui/hooks/useAttentionNotifications.js.map +1 -0
- package/dist/src/ui/hooks/useAttentionNotifications.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAttentionNotifications.test.js +222 -0
- package/dist/src/ui/hooks/useAttentionNotifications.test.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +32 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +124 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +379 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useAwaySummary.d.ts +35 -0
- package/dist/src/ui/hooks/useAwaySummary.js +141 -0
- package/dist/src/ui/hooks/useAwaySummary.js.map +1 -0
- package/dist/src/ui/hooks/useAwaySummary.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAwaySummary.test.js +103 -0
- package/dist/src/ui/hooks/useAwaySummary.test.js.map +1 -0
- package/dist/src/ui/hooks/useBackgroundTaskView.d.ts +69 -0
- package/dist/src/ui/hooks/useBackgroundTaskView.js +217 -0
- package/dist/src/ui/hooks/useBackgroundTaskView.js.map +1 -0
- package/dist/src/ui/hooks/useBackgroundTaskView.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBackgroundTaskView.test.js +455 -0
- package/dist/src/ui/hooks/useBackgroundTaskView.test.js.map +1 -0
- package/dist/src/ui/hooks/useBatchedScroll.d.ts +14 -0
- package/dist/src/ui/hooks/useBatchedScroll.js +25 -0
- package/dist/src/ui/hooks/useBatchedScroll.js.map +1 -0
- package/dist/src/ui/hooks/useBatchedScroll.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBatchedScroll.test.js +42 -0
- package/dist/src/ui/hooks/useBatchedScroll.test.js.map +1 -0
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
- package/dist/src/ui/hooks/useBracketedPaste.js +32 -0
- package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
- package/dist/src/ui/hooks/useBranchCommand.d.ts +33 -0
- package/dist/src/ui/hooks/useBranchCommand.js +230 -0
- package/dist/src/ui/hooks/useBranchCommand.js.map +1 -0
- package/dist/src/ui/hooks/useBranchCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBranchCommand.test.js +386 -0
- package/dist/src/ui/hooks/useBranchCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +37 -0
- package/dist/src/ui/hooks/useCommandCompletion.js +227 -0
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useCommandMigration.d.ts +16 -0
- package/dist/src/ui/hooks/useCommandMigration.js +40 -0
- package/dist/src/ui/hooks/useCommandMigration.js.map +1 -0
- package/dist/src/ui/hooks/useCompletion.d.ts +24 -0
- package/dist/src/ui/hooks/useCompletion.js +88 -0
- package/dist/src/ui/hooks/useCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useConfigInitMessage.d.ts +6 -0
- package/dist/src/ui/hooks/useConfigInitMessage.js +45 -0
- package/dist/src/ui/hooks/useConfigInitMessage.js.map +1 -0
- package/dist/src/ui/hooks/useConfigInitMessage.test.d.ts +6 -0
- package/dist/src/ui/hooks/useConfigInitMessage.test.js +80 -0
- package/dist/src/ui/hooks/useConfigInitMessage.test.js.map +1 -0
- package/dist/src/ui/hooks/useContextualTips.d.ts +19 -0
- package/dist/src/ui/hooks/useContextualTips.js +65 -0
- package/dist/src/ui/hooks/useContextualTips.js.map +1 -0
- package/dist/src/ui/hooks/useDeleteCommand.d.ts +19 -0
- package/dist/src/ui/hooks/useDeleteCommand.js +167 -0
- package/dist/src/ui/hooks/useDeleteCommand.js.map +1 -0
- package/dist/src/ui/hooks/useDeleteCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useDeleteCommand.test.js +391 -0
- package/dist/src/ui/hooks/useDeleteCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useDialogClose.d.ts +48 -0
- package/dist/src/ui/hooks/useDialogClose.js +102 -0
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -0
- package/dist/src/ui/hooks/useDiffData.d.ts +32 -0
- package/dist/src/ui/hooks/useDiffData.js +72 -0
- package/dist/src/ui/hooks/useDiffData.js.map +1 -0
- package/dist/src/ui/hooks/useDoublePress.d.ts +18 -0
- package/dist/src/ui/hooks/useDoublePress.js +47 -0
- package/dist/src/ui/hooks/useDoublePress.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
- package/dist/src/ui/hooks/useEditorSettings.js +43 -0
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useExportCompletion.d.ts +70 -0
- package/dist/src/ui/hooks/useExportCompletion.js +208 -0
- package/dist/src/ui/hooks/useExportCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useExportCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExportCompletion.test.js +190 -0
- package/dist/src/ui/hooks/useExportCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +71 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +229 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +455 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionsManagerDialog.d.ts +12 -0
- package/dist/src/ui/hooks/useExtensionsManagerDialog.js +21 -0
- package/dist/src/ui/hooks/useExtensionsManagerDialog.js.map +1 -0
- package/dist/src/ui/hooks/useFeedbackDialog.d.ts +18 -0
- package/dist/src/ui/hooks/useFeedbackDialog.js +130 -0
- package/dist/src/ui/hooks/useFeedbackDialog.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +10 -0
- package/dist/src/ui/hooks/useFocus.js +51 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.d.ts +13 -0
- package/dist/src/ui/hooks/useFolderTrust.js +60 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useFollowupSuggestions.d.ts +53 -0
- package/dist/src/ui/hooks/useFollowupSuggestions.js +89 -0
- package/dist/src/ui/hooks/useFollowupSuggestions.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +76 -0
- package/dist/src/ui/hooks/useGeminiStream.js +1899 -0
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.js +61 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js +192 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +24 -0
- package/dist/src/ui/hooks/useHistoryManager.js +183 -0
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js +495 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useHooksDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useHooksDialog.js +21 -0
- package/dist/src/ui/hooks/useHooksDialog.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
- package/dist/src/ui/hooks/useInitializationAuthError.d.ts +22 -0
- package/dist/src/ui/hooks/useInitializationAuthError.js +40 -0
- package/dist/src/ui/hooks/useInitializationAuthError.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.d.ts +20 -0
- package/dist/src/ui/hooks/useInputHistory.js +85 -0
- package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js +83 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +231 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +17 -0
- package/dist/src/ui/hooks/useKeypress.js +27 -0
- package/dist/src/ui/hooks/useKeypress.js.map +1 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
- package/dist/src/ui/hooks/useLaunchEditor.d.ts +5 -0
- package/dist/src/ui/hooks/useLaunchEditor.js +75 -0
- package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +11 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js +50 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +172 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useLogger.d.ts +11 -0
- package/dist/src/ui/hooks/useLogger.js +32 -0
- package/dist/src/ui/hooks/useLogger.js.map +1 -0
- package/dist/src/ui/hooks/useMCPHealth.d.ts +16 -0
- package/dist/src/ui/hooks/useMCPHealth.js +56 -0
- package/dist/src/ui/hooks/useMCPHealth.js.map +1 -0
- package/dist/src/ui/hooks/useMcpDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useMcpDialog.js +21 -0
- package/dist/src/ui/hooks/useMcpDialog.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useMemoryDialog.js +21 -0
- package/dist/src/ui/hooks/useMemoryDialog.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.d.ts +17 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js +83 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +153 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.d.ts +18 -0
- package/dist/src/ui/hooks/useMessageQueue.js +67 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js +219 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.d.ts +15 -0
- package/dist/src/ui/hooks/useModelCommand.js +25 -0
- package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useMouseEvents.d.ts +44 -0
- package/dist/src/ui/hooks/useMouseEvents.js +85 -0
- package/dist/src/ui/hooks/useMouseEvents.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +70 -0
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
- package/dist/src/ui/hooks/usePreferredEditor.d.ts +7 -0
- package/dist/src/ui/hooks/usePreferredEditor.js +25 -0
- package/dist/src/ui/hooks/usePreferredEditor.js.map +1 -0
- package/dist/src/ui/hooks/useProviderUpdates.d.ts +33 -0
- package/dist/src/ui/hooks/useProviderUpdates.js +215 -0
- package/dist/src/ui/hooks/useProviderUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useProviderUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useProviderUpdates.test.js +293 -0
- package/dist/src/ui/hooks/useProviderUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useQwenAuth.d.ts +20 -0
- package/dist/src/ui/hooks/useQwenAuth.js +74 -0
- package/dist/src/ui/hooks/useQwenAuth.js.map +1 -0
- package/dist/src/ui/hooks/useQwenAuth.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js +266 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +33 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js +236 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useResumeCommand.d.ts +31 -0
- package/dist/src/ui/hooks/useResumeCommand.js +114 -0
- package/dist/src/ui/hooks/useResumeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useResumeCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useResumeCommand.test.js +349 -0
- package/dist/src/ui/hooks/useResumeCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +103 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.d.ts +41 -0
- package/dist/src/ui/hooks/useSelectionList.js +276 -0
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSelectionList.test.js +782 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
- package/dist/src/ui/hooks/useSessionPicker.d.ts +95 -0
- package/dist/src/ui/hooks/useSessionPicker.js +383 -0
- package/dist/src/ui/hooks/useSessionPicker.js.map +1 -0
- package/dist/src/ui/hooks/useSessionPicker.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSessionPicker.test.js +94 -0
- package/dist/src/ui/hooks/useSessionPicker.test.js.map +1 -0
- package/dist/src/ui/hooks/useSessionSearchInput.d.ts +69 -0
- package/dist/src/ui/hooks/useSessionSearchInput.js +124 -0
- package/dist/src/ui/hooks/useSessionSearchInput.js.map +1 -0
- package/dist/src/ui/hooks/useSessionSearchInput.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSessionSearchInput.test.js +342 -0
- package/dist/src/ui/hooks/useSessionSearchInput.test.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +14 -0
- package/dist/src/ui/hooks/useShellHistory.js +112 -0
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +193 -0
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js +55 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useSkillsManagerDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useSkillsManagerDialog.js +21 -0
- package/dist/src/ui/hooks/useSkillsManagerDialog.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +27 -0
- package/dist/src/ui/hooks/useSlashCompletion.integration.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSlashCompletion.integration.test.js +84 -0
- package/dist/src/ui/hooks/useSlashCompletion.integration.test.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +490 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +805 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
- package/dist/src/ui/hooks/useStateAndRef.js +26 -0
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
- package/dist/src/ui/hooks/useStatsDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useStatsDialog.js +13 -0
- package/dist/src/ui/hooks/useStatsDialog.js.map +1 -0
- package/dist/src/ui/hooks/useStatusLine.d.ts +84 -0
- package/dist/src/ui/hooks/useStatusLine.js +528 -0
- package/dist/src/ui/hooks/useStatusLine.js.map +1 -0
- package/dist/src/ui/hooks/useStatusLine.test.d.ts +6 -0
- package/dist/src/ui/hooks/useStatusLine.test.js +1039 -0
- package/dist/src/ui/hooks/useStatusLine.test.js.map +1 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +10 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js +21 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalNotification.d.ts +32 -0
- package/dist/src/ui/hooks/useTerminalNotification.js +45 -0
- package/dist/src/ui/hooks/useTerminalNotification.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalNotification.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTerminalNotification.test.js +69 -0
- package/dist/src/ui/hooks/useTerminalNotification.test.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalProgress.d.ts +12 -0
- package/dist/src/ui/hooks/useTerminalProgress.js +76 -0
- package/dist/src/ui/hooks/useTerminalProgress.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalSize.d.ts +13 -0
- package/dist/src/ui/hooks/useTerminalSize.js +30 -0
- package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
- package/dist/src/ui/hooks/useThemeCommand.js +85 -0
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useThemeCommand.test.js +42 -0
- package/dist/src/ui/hooks/useThemeCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.d.ts +12 -0
- package/dist/src/ui/hooks/useTimer.js +58 -0
- package/dist/src/ui/hooks/useTimer.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTimer.test.js +90 -0
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
- package/dist/src/ui/hooks/useTomlMigration.d.ts +1 -0
- package/dist/src/ui/hooks/useTomlMigration.js +2 -0
- package/dist/src/ui/hooks/useTomlMigration.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +624 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useTrustModify.d.ts +17 -0
- package/dist/src/ui/hooks/useTrustModify.js +78 -0
- package/dist/src/ui/hooks/useTrustModify.js.map +1 -0
- package/dist/src/ui/hooks/useTrustModify.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTrustModify.test.js +182 -0
- package/dist/src/ui/hooks/useTrustModify.test.js.map +1 -0
- package/dist/src/ui/hooks/useTurnDiffs.d.ts +34 -0
- package/dist/src/ui/hooks/useTurnDiffs.js +130 -0
- package/dist/src/ui/hooks/useTurnDiffs.js.map +1 -0
- package/dist/src/ui/hooks/useTurnDiffs.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTurnDiffs.test.js +164 -0
- package/dist/src/ui/hooks/useTurnDiffs.test.js.map +1 -0
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +23 -0
- package/dist/src/ui/hooks/useWelcomeBack.js +99 -0
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
- package/dist/src/ui/hooks/useWelcomeBack.test.d.ts +6 -0
- package/dist/src/ui/hooks/useWelcomeBack.test.js +94 -0
- package/dist/src/ui/hooks/useWelcomeBack.test.js.map +1 -0
- package/dist/src/ui/hooks/useWorktreeSession.d.ts +26 -0
- package/dist/src/ui/hooks/useWorktreeSession.js +92 -0
- package/dist/src/ui/hooks/useWorktreeSession.js.map +1 -0
- package/dist/src/ui/hooks/useWorktreeSession.test.d.ts +6 -0
- package/dist/src/ui/hooks/useWorktreeSession.test.js +84 -0
- package/dist/src/ui/hooks/useWorktreeSession.test.js.map +1 -0
- package/dist/src/ui/hooks/vim.d.ts +13 -0
- package/dist/src/ui/hooks/vim.js +1637 -0
- package/dist/src/ui/hooks/vim.js.map +1 -0
- package/dist/src/ui/hooks/vim.test.d.ts +6 -0
- package/dist/src/ui/hooks/vim.test.js +1975 -0
- package/dist/src/ui/hooks/vim.test.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +27 -0
- package/dist/src/ui/keyMatchers.js +71 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/keyMatchers.test.js +421 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- package/dist/src/ui/layouts/DefaultAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js +49 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
- package/dist/src/ui/layouts/DefaultAppLayout.test.d.ts +6 -0
- package/dist/src/ui/layouts/DefaultAppLayout.test.js +185 -0
- package/dist/src/ui/layouts/DefaultAppLayout.test.js.map +1 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js +27 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.test.d.ts +6 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.test.js +135 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.test.js.map +1 -0
- package/dist/src/ui/models/availableModels.d.ts +30 -0
- package/dist/src/ui/models/availableModels.js +103 -0
- package/dist/src/ui/models/availableModels.js.map +1 -0
- package/dist/src/ui/models/availableModels.test.d.ts +6 -0
- package/dist/src/ui/models/availableModels.test.js +142 -0
- package/dist/src/ui/models/availableModels.test.js.map +1 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +33 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/state/extensions.d.ts +43 -0
- package/dist/src/ui/state/extensions.js +63 -0
- package/dist/src/ui/state/extensions.js.map +1 -0
- package/dist/src/ui/statusLinePresets.d.ts +79 -0
- package/dist/src/ui/statusLinePresets.js +310 -0
- package/dist/src/ui/statusLinePresets.js.map +1 -0
- package/dist/src/ui/statusLinePresets.test.d.ts +6 -0
- package/dist/src/ui/statusLinePresets.test.js +221 -0
- package/dist/src/ui/statusLinePresets.test.js.map +1 -0
- package/dist/src/ui/textConstants.d.ts +9 -0
- package/dist/src/ui/textConstants.js +10 -0
- package/dist/src/ui/textConstants.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.d.ts +7 -0
- package/dist/src/ui/themes/ansi-light.js +144 -0
- package/dist/src/ui/themes/ansi-light.js.map +1 -0
- package/dist/src/ui/themes/ansi.d.ts +7 -0
- package/dist/src/ui/themes/ansi.js +154 -0
- package/dist/src/ui/themes/ansi.js.map +1 -0
- package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
- package/dist/src/ui/themes/atom-one-dark.js +140 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
- package/dist/src/ui/themes/ayu-light.d.ts +7 -0
- package/dist/src/ui/themes/ayu-light.js +132 -0
- package/dist/src/ui/themes/ayu-light.js.map +1 -0
- package/dist/src/ui/themes/ayu.d.ts +7 -0
- package/dist/src/ui/themes/ayu.js +106 -0
- package/dist/src/ui/themes/ayu.js.map +1 -0
- package/dist/src/ui/themes/color-utils.d.ts +21 -0
- package/dist/src/ui/themes/color-utils.js +223 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -0
- package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
- package/dist/src/ui/themes/color-utils.test.js +197 -0
- package/dist/src/ui/themes/color-utils.test.js.map +1 -0
- package/dist/src/ui/themes/default-light.d.ts +7 -0
- package/dist/src/ui/themes/default-light.js +100 -0
- package/dist/src/ui/themes/default-light.js.map +1 -0
- package/dist/src/ui/themes/default.d.ts +7 -0
- package/dist/src/ui/themes/default.js +143 -0
- package/dist/src/ui/themes/default.js.map +1 -0
- package/dist/src/ui/themes/detect-terminal-theme.d.ts +75 -0
- package/dist/src/ui/themes/detect-terminal-theme.js +228 -0
- package/dist/src/ui/themes/detect-terminal-theme.js.map +1 -0
- package/dist/src/ui/themes/detect-terminal-theme.test.d.ts +6 -0
- package/dist/src/ui/themes/detect-terminal-theme.test.js +269 -0
- package/dist/src/ui/themes/detect-terminal-theme.test.js.map +1 -0
- package/dist/src/ui/themes/dracula.d.ts +7 -0
- package/dist/src/ui/themes/dracula.js +117 -0
- package/dist/src/ui/themes/dracula.js.map +1 -0
- package/dist/src/ui/themes/github-dark.d.ts +7 -0
- package/dist/src/ui/themes/github-dark.js +140 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -0
- package/dist/src/ui/themes/github-light.d.ts +7 -0
- package/dist/src/ui/themes/github-light.js +142 -0
- package/dist/src/ui/themes/github-light.js.map +1 -0
- package/dist/src/ui/themes/googlecode.d.ts +7 -0
- package/dist/src/ui/themes/googlecode.js +139 -0
- package/dist/src/ui/themes/googlecode.js.map +1 -0
- package/dist/src/ui/themes/no-color.d.ts +7 -0
- package/dist/src/ui/themes/no-color.js +120 -0
- package/dist/src/ui/themes/no-color.js.map +1 -0
- package/dist/src/ui/themes/qwen-dark.d.ts +7 -0
- package/dist/src/ui/themes/qwen-dark.js +107 -0
- package/dist/src/ui/themes/qwen-dark.js.map +1 -0
- package/dist/src/ui/themes/qwen-light.d.ts +7 -0
- package/dist/src/ui/themes/qwen-light.js +133 -0
- package/dist/src/ui/themes/qwen-light.js.map +1 -0
- package/dist/src/ui/themes/semantic-tokens.d.ts +40 -0
- package/dist/src/ui/themes/semantic-tokens.js +103 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
- package/dist/src/ui/themes/shades-of-purple.js +306 -0
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +91 -0
- package/dist/src/ui/themes/theme-manager.js +311 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.test.js +188 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +137 -0
- package/dist/src/ui/themes/theme.js +393 -0
- package/dist/src/ui/themes/theme.js.map +1 -0
- package/dist/src/ui/themes/xcode.d.ts +7 -0
- package/dist/src/ui/themes/xcode.js +147 -0
- package/dist/src/ui/themes/xcode.js.map +1 -0
- package/dist/src/ui/types.d.ts +620 -0
- package/dist/src/ui/types.js +77 -0
- package/dist/src/ui/types.js.map +1 -0
- package/dist/src/ui/utils/CodeColorizer.d.ts +18 -0
- package/dist/src/ui/utils/CodeColorizer.js +155 -0
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +18 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +173 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +303 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +25 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +420 -0
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js +702 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/MermaidDiagram.d.ts +15 -0
- package/dist/src/ui/utils/MermaidDiagram.js +88 -0
- package/dist/src/ui/utils/MermaidDiagram.js.map +1 -0
- package/dist/src/ui/utils/MermaidDiagram.test.d.ts +6 -0
- package/dist/src/ui/utils/MermaidDiagram.test.js +90 -0
- package/dist/src/ui/utils/MermaidDiagram.test.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.d.ts +30 -0
- package/dist/src/ui/utils/TableRenderer.js +563 -0
- package/dist/src/ui/utils/TableRenderer.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/TableRenderer.test.js +568 -0
- package/dist/src/ui/utils/TableRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/approvalModeDisplay.d.ts +8 -0
- package/dist/src/ui/utils/approvalModeDisplay.js +34 -0
- package/dist/src/ui/utils/approvalModeDisplay.js.map +1 -0
- package/dist/src/ui/utils/approvalModeDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/approvalModeDisplay.test.js +35 -0
- package/dist/src/ui/utils/approvalModeDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/asciiCharts.d.ts +44 -0
- package/dist/src/ui/utils/asciiCharts.js +307 -0
- package/dist/src/ui/utils/asciiCharts.js.map +1 -0
- package/dist/src/ui/utils/asciiCharts.test.d.ts +6 -0
- package/dist/src/ui/utils/asciiCharts.test.js +208 -0
- package/dist/src/ui/utils/asciiCharts.test.js.map +1 -0
- package/dist/src/ui/utils/backgroundWorkUtils.d.ts +8 -0
- package/dist/src/ui/utils/backgroundWorkUtils.js +16 -0
- package/dist/src/ui/utils/backgroundWorkUtils.js.map +1 -0
- package/dist/src/ui/utils/backgroundWorkUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/backgroundWorkUtils.test.js +85 -0
- package/dist/src/ui/utils/backgroundWorkUtils.test.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.d.ts +28 -0
- package/dist/src/ui/utils/clipboardUtils.js +522 -0
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.test.js +465 -0
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +112 -0
- package/dist/src/ui/utils/commandUtils.js +285 -0
- package/dist/src/ui/utils/commandUtils.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/commandUtils.test.js +560 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +10 -0
- package/dist/src/ui/utils/computeStats.js +57 -0
- package/dist/src/ui/utils/computeStats.js.map +1 -0
- package/dist/src/ui/utils/customBanner.d.ts +35 -0
- package/dist/src/ui/utils/customBanner.js +361 -0
- package/dist/src/ui/utils/customBanner.js.map +1 -0
- package/dist/src/ui/utils/customBanner.test.d.ts +6 -0
- package/dist/src/ui/utils/customBanner.test.js +439 -0
- package/dist/src/ui/utils/customBanner.test.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.d.ts +25 -0
- package/dist/src/ui/utils/displayUtils.js +46 -0
- package/dist/src/ui/utils/displayUtils.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +61 -0
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
- package/dist/src/ui/utils/export/collect.d.ts +16 -0
- package/dist/src/ui/utils/export/collect.js +509 -0
- package/dist/src/ui/utils/export/collect.js.map +1 -0
- package/dist/src/ui/utils/export/collect.test.d.ts +6 -0
- package/dist/src/ui/utils/export/collect.test.js +80 -0
- package/dist/src/ui/utils/export/collect.test.js.map +1 -0
- package/dist/src/ui/utils/export/formatters/html.d.ts +23 -0
- package/dist/src/ui/utils/export/formatters/html.js +65 -0
- package/dist/src/ui/utils/export/formatters/html.js.map +1 -0
- package/dist/src/ui/utils/export/formatters/json.d.ts +11 -0
- package/dist/src/ui/utils/export/formatters/json.js +13 -0
- package/dist/src/ui/utils/export/formatters/json.js.map +1 -0
- package/dist/src/ui/utils/export/formatters/jsonl.d.ts +11 -0
- package/dist/src/ui/utils/export/formatters/jsonl.js +69 -0
- package/dist/src/ui/utils/export/formatters/jsonl.js.map +1 -0
- package/dist/src/ui/utils/export/formatters/markdown.d.ts +10 -0
- package/dist/src/ui/utils/export/formatters/markdown.js +254 -0
- package/dist/src/ui/utils/export/formatters/markdown.js.map +1 -0
- package/dist/src/ui/utils/export/index.d.ts +13 -0
- package/dist/src/ui/utils/export/index.js +13 -0
- package/dist/src/ui/utils/export/index.js.map +1 -0
- package/dist/src/ui/utils/export/normalize.d.ts +12 -0
- package/dist/src/ui/utils/export/normalize.js +279 -0
- package/dist/src/ui/utils/export/normalize.js.map +1 -0
- package/dist/src/ui/utils/export/normalize.test.d.ts +6 -0
- package/dist/src/ui/utils/export/normalize.test.js +62 -0
- package/dist/src/ui/utils/export/normalize.test.js.map +1 -0
- package/dist/src/ui/utils/export/types.d.ts +93 -0
- package/dist/src/ui/utils/export/types.js +7 -0
- package/dist/src/ui/utils/export/types.js.map +1 -0
- package/dist/src/ui/utils/export/utils.d.ts +9 -0
- package/dist/src/ui/utils/export/utils.js +13 -0
- package/dist/src/ui/utils/export/utils.js.map +1 -0
- package/dist/src/ui/utils/formatters.d.ts +28 -0
- package/dist/src/ui/utils/formatters.js +100 -0
- package/dist/src/ui/utils/formatters.js.map +1 -0
- package/dist/src/ui/utils/formatters.test.d.ts +6 -0
- package/dist/src/ui/utils/formatters.test.js +141 -0
- package/dist/src/ui/utils/formatters.test.js.map +1 -0
- package/dist/src/ui/utils/gradientUtils.d.ts +6 -0
- package/dist/src/ui/utils/gradientUtils.js +11 -0
- package/dist/src/ui/utils/gradientUtils.js.map +1 -0
- package/dist/src/ui/utils/highlight.d.ts +12 -0
- package/dist/src/ui/utils/highlight.js +90 -0
- package/dist/src/ui/utils/highlight.js.map +1 -0
- package/dist/src/ui/utils/highlight.test.d.ts +6 -0
- package/dist/src/ui/utils/highlight.test.js +173 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -0
- package/dist/src/ui/utils/historyMapping.d.ts +44 -0
- package/dist/src/ui/utils/historyMapping.js +110 -0
- package/dist/src/ui/utils/historyMapping.js.map +1 -0
- package/dist/src/ui/utils/historyMapping.test.d.ts +6 -0
- package/dist/src/ui/utils/historyMapping.test.js +376 -0
- package/dist/src/ui/utils/historyMapping.test.js.map +1 -0
- package/dist/src/ui/utils/historyUtils.d.ts +34 -0
- package/dist/src/ui/utils/historyUtils.js +117 -0
- package/dist/src/ui/utils/historyUtils.js.map +1 -0
- package/dist/src/ui/utils/historyUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/historyUtils.test.js +107 -0
- package/dist/src/ui/utils/historyUtils.test.js.map +1 -0
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +19 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +115 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
- package/dist/src/ui/utils/latexRenderer.d.ts +6 -0
- package/dist/src/ui/utils/latexRenderer.js +187 -0
- package/dist/src/ui/utils/latexRenderer.js.map +1 -0
- package/dist/src/ui/utils/latexRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/latexRenderer.test.js +27 -0
- package/dist/src/ui/utils/latexRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/layoutUtils.d.ts +32 -0
- package/dist/src/ui/utils/layoutUtils.js +46 -0
- package/dist/src/ui/utils/layoutUtils.js.map +1 -0
- package/dist/src/ui/utils/layoutUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/layoutUtils.test.js +30 -0
- package/dist/src/ui/utils/layoutUtils.test.js.map +1 -0
- package/dist/src/ui/utils/lowlightLoader.d.ts +43 -0
- package/dist/src/ui/utils/lowlightLoader.js +88 -0
- package/dist/src/ui/utils/lowlightLoader.js.map +1 -0
- package/dist/src/ui/utils/lowlightLoader.test.d.ts +6 -0
- package/dist/src/ui/utils/lowlightLoader.test.js +120 -0
- package/dist/src/ui/utils/lowlightLoader.test.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.js +110 -0
- package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
- package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
- package/dist/src/ui/utils/mergeCompactToolGroups.d.ts +62 -0
- package/dist/src/ui/utils/mergeCompactToolGroups.js +212 -0
- package/dist/src/ui/utils/mergeCompactToolGroups.js.map +1 -0
- package/dist/src/ui/utils/mergeCompactToolGroups.test.d.ts +6 -0
- package/dist/src/ui/utils/mergeCompactToolGroups.test.js +473 -0
- package/dist/src/ui/utils/mergeCompactToolGroups.test.js.map +1 -0
- package/dist/src/ui/utils/mermaidImageRenderer.d.ts +54 -0
- package/dist/src/ui/utils/mermaidImageRenderer.js +955 -0
- package/dist/src/ui/utils/mermaidImageRenderer.js.map +1 -0
- package/dist/src/ui/utils/mermaidImageRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/mermaidImageRenderer.test.js +528 -0
- package/dist/src/ui/utils/mermaidImageRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/mermaidVisualRenderer.d.ts +12 -0
- package/dist/src/ui/utils/mermaidVisualRenderer.js +1097 -0
- package/dist/src/ui/utils/mermaidVisualRenderer.js.map +1 -0
- package/dist/src/ui/utils/mermaidVisualRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/mermaidVisualRenderer.test.js +69 -0
- package/dist/src/ui/utils/mermaidVisualRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/modelsBySource.d.ts +47 -0
- package/dist/src/ui/utils/modelsBySource.js +89 -0
- package/dist/src/ui/utils/modelsBySource.js.map +1 -0
- package/dist/src/ui/utils/modelsBySource.test.d.ts +6 -0
- package/dist/src/ui/utils/modelsBySource.test.js +111 -0
- package/dist/src/ui/utils/modelsBySource.test.js.map +1 -0
- package/dist/src/ui/utils/mouse.d.ts +39 -0
- package/dist/src/ui/utils/mouse.js +169 -0
- package/dist/src/ui/utils/mouse.js.map +1 -0
- package/dist/src/ui/utils/mouse.test.d.ts +6 -0
- package/dist/src/ui/utils/mouse.test.js +117 -0
- package/dist/src/ui/utils/mouse.test.js.map +1 -0
- package/dist/src/ui/utils/osc8.d.ts +124 -0
- package/dist/src/ui/utils/osc8.js +463 -0
- package/dist/src/ui/utils/osc8.js.map +1 -0
- package/dist/src/ui/utils/osc8.test.d.ts +6 -0
- package/dist/src/ui/utils/osc8.test.js +494 -0
- package/dist/src/ui/utils/osc8.test.js.map +1 -0
- package/dist/src/ui/utils/platformConstants.d.ts +75 -0
- package/dist/src/ui/utils/platformConstants.js +78 -0
- package/dist/src/ui/utils/platformConstants.js.map +1 -0
- package/dist/src/ui/utils/restoreGoal.d.ts +47 -0
- package/dist/src/ui/utils/restoreGoal.js +124 -0
- package/dist/src/ui/utils/restoreGoal.js.map +1 -0
- package/dist/src/ui/utils/restoreGoal.test.d.ts +6 -0
- package/dist/src/ui/utils/restoreGoal.test.js +220 -0
- package/dist/src/ui/utils/restoreGoal.test.js.map +1 -0
- package/dist/src/ui/utils/resumeHistoryUtils.d.ts +22 -0
- package/dist/src/ui/utils/resumeHistoryUtils.js +410 -0
- package/dist/src/ui/utils/resumeHistoryUtils.js.map +1 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.js +378 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.js.map +1 -0
- package/dist/src/ui/utils/sessionPickerUtils.d.ts +35 -0
- package/dist/src/ui/utils/sessionPickerUtils.js +69 -0
- package/dist/src/ui/utils/sessionPickerUtils.js.map +1 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.js +79 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.js.map +1 -0
- package/dist/src/ui/utils/statsDataService.d.ts +49 -0
- package/dist/src/ui/utils/statsDataService.js +221 -0
- package/dist/src/ui/utils/statsDataService.js.map +1 -0
- package/dist/src/ui/utils/statsDataService.test.d.ts +6 -0
- package/dist/src/ui/utils/statsDataService.test.js +406 -0
- package/dist/src/ui/utils/statsDataService.test.js.map +1 -0
- package/dist/src/ui/utils/synchronizedOutput.d.ts +16 -0
- package/dist/src/ui/utils/synchronizedOutput.js +88 -0
- package/dist/src/ui/utils/synchronizedOutput.js.map +1 -0
- package/dist/src/ui/utils/synchronizedOutput.test.d.ts +6 -0
- package/dist/src/ui/utils/synchronizedOutput.test.js +154 -0
- package/dist/src/ui/utils/synchronizedOutput.test.js.map +1 -0
- package/dist/src/ui/utils/terminalRedrawOptimizer.d.ts +21 -0
- package/dist/src/ui/utils/terminalRedrawOptimizer.js +108 -0
- package/dist/src/ui/utils/terminalRedrawOptimizer.js.map +1 -0
- package/dist/src/ui/utils/terminalRedrawOptimizer.test.d.ts +6 -0
- package/dist/src/ui/utils/terminalRedrawOptimizer.test.js +85 -0
- package/dist/src/ui/utils/terminalRedrawOptimizer.test.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
- package/dist/src/ui/utils/terminalSetup.js +310 -0
- package/dist/src/ui/utils/terminalSetup.js.map +1 -0
- package/dist/src/ui/utils/textUtils.d.ts +86 -0
- package/dist/src/ui/utils/textUtils.js +360 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -0
- package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/textUtils.test.js +269 -0
- package/dist/src/ui/utils/textUtils.test.js.map +1 -0
- package/dist/src/ui/utils/todoSnapshot.d.ts +13 -0
- package/dist/src/ui/utils/todoSnapshot.js +133 -0
- package/dist/src/ui/utils/todoSnapshot.js.map +1 -0
- package/dist/src/ui/utils/todoSnapshot.test.d.ts +6 -0
- package/dist/src/ui/utils/todoSnapshot.test.js +281 -0
- package/dist/src/ui/utils/todoSnapshot.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +12 -0
- package/dist/src/ui/utils/updateCheck.js +80 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.test.js +145 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
- package/dist/src/utils/acpModelUtils.d.ts +39 -0
- package/dist/src/utils/acpModelUtils.js +61 -0
- package/dist/src/utils/acpModelUtils.js.map +1 -0
- package/dist/src/utils/acpModelUtils.test.d.ts +6 -0
- package/dist/src/utils/acpModelUtils.test.js +31 -0
- package/dist/src/utils/acpModelUtils.test.js.map +1 -0
- package/dist/src/utils/apiPreconnect.d.ts +22 -0
- package/dist/src/utils/apiPreconnect.js +188 -0
- package/dist/src/utils/apiPreconnect.js.map +1 -0
- package/dist/src/utils/apiPreconnect.test.d.ts +6 -0
- package/dist/src/utils/apiPreconnect.test.js +252 -0
- package/dist/src/utils/apiPreconnect.test.js.map +1 -0
- package/dist/src/utils/checks.d.ts +19 -0
- package/dist/src/utils/checks.js +24 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +23 -0
- package/dist/src/utils/cleanup.js +96 -0
- package/dist/src/utils/cleanup.js.map +1 -0
- package/dist/src/utils/commands.d.ts +20 -0
- package/dist/src/utils/commands.js +53 -0
- package/dist/src/utils/commands.js.map +1 -0
- package/dist/src/utils/commands.test.d.ts +6 -0
- package/dist/src/utils/commands.test.js +115 -0
- package/dist/src/utils/commands.test.js.map +1 -0
- package/dist/src/utils/commentJson.d.ts +25 -0
- package/dist/src/utils/commentJson.js +113 -0
- package/dist/src/utils/commentJson.js.map +1 -0
- package/dist/src/utils/commentJson.test.d.ts +6 -0
- package/dist/src/utils/commentJson.test.js +385 -0
- package/dist/src/utils/commentJson.test.js.map +1 -0
- package/dist/src/utils/costCalculator.d.ts +14 -0
- package/dist/src/utils/costCalculator.js +19 -0
- package/dist/src/utils/costCalculator.js.map +1 -0
- package/dist/src/utils/costCalculator.test.d.ts +6 -0
- package/dist/src/utils/costCalculator.test.js +177 -0
- package/dist/src/utils/costCalculator.test.js.map +1 -0
- package/dist/src/utils/cpuProfiler.d.ts +63 -0
- package/dist/src/utils/cpuProfiler.js +341 -0
- package/dist/src/utils/cpuProfiler.js.map +1 -0
- package/dist/src/utils/cpuProfiler.test.d.ts +6 -0
- package/dist/src/utils/cpuProfiler.test.js +293 -0
- package/dist/src/utils/cpuProfiler.test.js.map +1 -0
- package/dist/src/utils/deepMerge.d.ts +9 -0
- package/dist/src/utils/deepMerge.js +58 -0
- package/dist/src/utils/deepMerge.js.map +1 -0
- package/dist/src/utils/deepMerge.test.d.ts +6 -0
- package/dist/src/utils/deepMerge.test.js +143 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -0
- package/dist/src/utils/dialogScopeUtils.d.ts +28 -0
- package/dist/src/utils/dialogScopeUtils.js +51 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/doctorChecks.d.ts +11 -0
- package/dist/src/utils/doctorChecks.js +351 -0
- package/dist/src/utils/doctorChecks.js.map +1 -0
- package/dist/src/utils/doctorChecks.test.d.ts +6 -0
- package/dist/src/utils/doctorChecks.test.js +280 -0
- package/dist/src/utils/doctorChecks.test.js.map +1 -0
- package/dist/src/utils/earlyInputCapture.d.ts +33 -0
- package/dist/src/utils/earlyInputCapture.js +311 -0
- package/dist/src/utils/earlyInputCapture.js.map +1 -0
- package/dist/src/utils/earlyInputCapture.test.d.ts +6 -0
- package/dist/src/utils/earlyInputCapture.test.js +274 -0
- package/dist/src/utils/earlyInputCapture.test.js.map +1 -0
- package/dist/src/utils/envVarResolver.d.ts +39 -0
- package/dist/src/utils/envVarResolver.js +100 -0
- package/dist/src/utils/envVarResolver.js.map +1 -0
- package/dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/dist/src/utils/envVarResolver.test.js +221 -0
- package/dist/src/utils/envVarResolver.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +76 -0
- package/dist/src/utils/errors.js +237 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +536 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/events.d.ts +13 -0
- package/dist/src/utils/events.js +15 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +30 -0
- package/dist/src/utils/gitUtils.js +108 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/gitUtils.test.d.ts +6 -0
- package/dist/src/utils/gitUtils.test.js +172 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.d.ts +16 -0
- package/dist/src/utils/handleAutoUpdate.js +144 -0
- package/dist/src/utils/handleAutoUpdate.js.map +1 -0
- package/dist/src/utils/headlessSafetyWarnings.d.ts +21 -0
- package/dist/src/utils/headlessSafetyWarnings.js +45 -0
- package/dist/src/utils/headlessSafetyWarnings.js.map +1 -0
- package/dist/src/utils/headlessSafetyWarnings.test.d.ts +6 -0
- package/dist/src/utils/headlessSafetyWarnings.test.js +66 -0
- package/dist/src/utils/headlessSafetyWarnings.test.js.map +1 -0
- package/dist/src/utils/housekeeping/cleanup.d.ts +15 -0
- package/dist/src/utils/housekeeping/cleanup.js +69 -0
- package/dist/src/utils/housekeeping/cleanup.js.map +1 -0
- package/dist/src/utils/housekeeping/cleanup.test.d.ts +6 -0
- package/dist/src/utils/housekeeping/cleanup.test.js +166 -0
- package/dist/src/utils/housekeeping/cleanup.test.js.map +1 -0
- package/dist/src/utils/housekeeping/lastInteractionAt.d.ts +9 -0
- package/dist/src/utils/housekeeping/lastInteractionAt.js +22 -0
- package/dist/src/utils/housekeeping/lastInteractionAt.js.map +1 -0
- package/dist/src/utils/housekeeping/scheduler.d.ts +17 -0
- package/dist/src/utils/housekeeping/scheduler.js +130 -0
- package/dist/src/utils/housekeeping/scheduler.js.map +1 -0
- package/dist/src/utils/housekeeping/scheduler.test.d.ts +6 -0
- package/dist/src/utils/housekeeping/scheduler.test.js +190 -0
- package/dist/src/utils/housekeeping/scheduler.test.js.map +1 -0
- package/dist/src/utils/housekeeping/throttledOnce.d.ts +13 -0
- package/dist/src/utils/housekeeping/throttledOnce.js +110 -0
- package/dist/src/utils/housekeeping/throttledOnce.js.map +1 -0
- package/dist/src/utils/housekeeping/throttledOnce.test.d.ts +6 -0
- package/dist/src/utils/housekeeping/throttledOnce.test.js +94 -0
- package/dist/src/utils/housekeeping/throttledOnce.test.js.map +1 -0
- package/dist/src/utils/installationInfo.d.ts +26 -0
- package/dist/src/utils/installationInfo.js +266 -0
- package/dist/src/utils/installationInfo.js.map +1 -0
- package/dist/src/utils/installationInfo.test.d.ts +6 -0
- package/dist/src/utils/installationInfo.test.js +466 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -0
- package/dist/src/utils/languageUtils.d.ts +40 -0
- package/dist/src/utils/languageUtils.js +163 -0
- package/dist/src/utils/languageUtils.js.map +1 -0
- package/dist/src/utils/languageUtils.test.d.ts +6 -0
- package/dist/src/utils/languageUtils.test.js +341 -0
- package/dist/src/utils/languageUtils.test.js.map +1 -0
- package/dist/src/utils/math.d.ts +13 -0
- package/dist/src/utils/math.js +14 -0
- package/dist/src/utils/math.js.map +1 -0
- package/dist/src/utils/memoryDiagnostics.d.ts +65 -0
- package/dist/src/utils/memoryDiagnostics.js +365 -0
- package/dist/src/utils/memoryDiagnostics.js.map +1 -0
- package/dist/src/utils/memoryDiagnostics.test.d.ts +6 -0
- package/dist/src/utils/memoryDiagnostics.test.js +641 -0
- package/dist/src/utils/memoryDiagnostics.test.js.map +1 -0
- package/dist/src/utils/modelConfigUtils.d.ts +55 -0
- package/dist/src/utils/modelConfigUtils.js +186 -0
- package/dist/src/utils/modelConfigUtils.js.map +1 -0
- package/dist/src/utils/modelConfigUtils.test.d.ts +6 -0
- package/dist/src/utils/modelConfigUtils.test.js +1247 -0
- package/dist/src/utils/modelConfigUtils.test.js.map +1 -0
- package/dist/src/utils/nonInteractiveHelpers.d.ts +101 -0
- package/dist/src/utils/nonInteractiveHelpers.js +479 -0
- package/dist/src/utils/nonInteractiveHelpers.js.map +1 -0
- package/dist/src/utils/nonInteractiveHelpers.test.d.ts +6 -0
- package/dist/src/utils/nonInteractiveHelpers.test.js +1038 -0
- package/dist/src/utils/nonInteractiveHelpers.test.js.map +1 -0
- package/dist/src/utils/osc.d.ts +91 -0
- package/dist/src/utils/osc.js +162 -0
- package/dist/src/utils/osc.js.map +1 -0
- package/dist/src/utils/osc.test.d.ts +6 -0
- package/dist/src/utils/osc.test.js +217 -0
- package/dist/src/utils/osc.test.js.map +1 -0
- package/dist/src/utils/package.d.ts +12 -0
- package/dist/src/utils/package.js +24 -0
- package/dist/src/utils/package.js.map +1 -0
- package/dist/src/utils/processUtils.d.ts +13 -0
- package/dist/src/utils/processUtils.js +18 -0
- package/dist/src/utils/processUtils.js.map +1 -0
- package/dist/src/utils/processUtils.test.d.ts +6 -0
- package/dist/src/utils/processUtils.test.js +20 -0
- package/dist/src/utils/processUtils.test.js.map +1 -0
- package/dist/src/utils/readStdin.d.ts +6 -0
- package/dist/src/utils/readStdin.js +60 -0
- package/dist/src/utils/readStdin.js.map +1 -0
- package/dist/src/utils/readStdin.test.d.ts +6 -0
- package/dist/src/utils/readStdin.test.js +88 -0
- package/dist/src/utils/readStdin.test.js.map +1 -0
- package/dist/src/utils/relaunch.d.ts +9 -0
- package/dist/src/utils/relaunch.js +68 -0
- package/dist/src/utils/relaunch.js.map +1 -0
- package/dist/src/utils/relaunch.test.d.ts +6 -0
- package/dist/src/utils/relaunch.test.js +291 -0
- package/dist/src/utils/relaunch.test.js.map +1 -0
- package/dist/src/utils/resolvePath.d.ts +6 -0
- package/dist/src/utils/resolvePath.js +21 -0
- package/dist/src/utils/resolvePath.js.map +1 -0
- package/dist/src/utils/runBudget.d.ts +116 -0
- package/dist/src/utils/runBudget.js +235 -0
- package/dist/src/utils/runBudget.js.map +1 -0
- package/dist/src/utils/runBudget.test.d.ts +6 -0
- package/dist/src/utils/runBudget.test.js +187 -0
- package/dist/src/utils/runBudget.test.js.map +1 -0
- package/dist/src/utils/sandbox-macos-permissive-closed.sb +33 -0
- package/dist/src/utils/sandbox-macos-permissive-open.sb +28 -0
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +38 -0
- package/dist/src/utils/sandbox-macos-restrictive-closed.sb +94 -0
- package/dist/src/utils/sandbox-macos-restrictive-open.sb +97 -0
- package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +99 -0
- package/dist/src/utils/sandbox.d.ts +7 -0
- package/dist/src/utils/sandbox.js +788 -0
- package/dist/src/utils/sandbox.js.map +1 -0
- package/dist/src/utils/sessionPaths.d.ts +19 -0
- package/dist/src/utils/sessionPaths.js +141 -0
- package/dist/src/utils/sessionPaths.js.map +1 -0
- package/dist/src/utils/sessionPaths.test.d.ts +6 -0
- package/dist/src/utils/sessionPaths.test.js +249 -0
- package/dist/src/utils/sessionPaths.test.js.map +1 -0
- package/dist/src/utils/settingsUtils.d.ts +167 -0
- package/dist/src/utils/settingsUtils.js +532 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/src/utils/settingsUtils.test.d.ts +6 -0
- package/dist/src/utils/settingsUtils.test.js +849 -0
- package/dist/src/utils/settingsUtils.test.js.map +1 -0
- package/dist/src/utils/spawnWrapper.d.ts +7 -0
- package/dist/src/utils/spawnWrapper.js +8 -0
- package/dist/src/utils/spawnWrapper.js.map +1 -0
- package/dist/src/utils/standalone-update-verify.d.ts +12 -0
- package/dist/src/utils/standalone-update-verify.js +43 -0
- package/dist/src/utils/standalone-update-verify.js.map +1 -0
- package/dist/src/utils/standalone-update-verify.test.d.ts +6 -0
- package/dist/src/utils/standalone-update-verify.test.js +27 -0
- package/dist/src/utils/standalone-update-verify.test.js.map +1 -0
- package/dist/src/utils/standalone-update.d.ts +27 -0
- package/dist/src/utils/standalone-update.js +714 -0
- package/dist/src/utils/standalone-update.js.map +1 -0
- package/dist/src/utils/standalone-update.test.d.ts +6 -0
- package/dist/src/utils/standalone-update.test.js +301 -0
- package/dist/src/utils/standalone-update.test.js.map +1 -0
- package/dist/src/utils/startupProfiler.d.ts +90 -0
- package/dist/src/utils/startupProfiler.js +267 -0
- package/dist/src/utils/startupProfiler.js.map +1 -0
- package/dist/src/utils/startupProfiler.test.d.ts +1 -0
- package/dist/src/utils/startupProfiler.test.js +293 -0
- package/dist/src/utils/startupProfiler.test.js.map +1 -0
- package/dist/src/utils/startupWarnings.d.ts +6 -0
- package/dist/src/utils/startupWarnings.js +40 -0
- package/dist/src/utils/startupWarnings.js.map +1 -0
- package/dist/src/utils/stdioHelpers.d.ts +31 -0
- package/dist/src/utils/stdioHelpers.js +38 -0
- package/dist/src/utils/stdioHelpers.js.map +1 -0
- package/dist/src/utils/systemInfo.d.ts +78 -0
- package/dist/src/utils/systemInfo.js +208 -0
- package/dist/src/utils/systemInfo.js.map +1 -0
- package/dist/src/utils/systemInfo.test.d.ts +6 -0
- package/dist/src/utils/systemInfo.test.js +380 -0
- package/dist/src/utils/systemInfo.test.js.map +1 -0
- package/dist/src/utils/systemInfoFields.d.ts +18 -0
- package/dist/src/utils/systemInfoFields.js +102 -0
- package/dist/src/utils/systemInfoFields.js.map +1 -0
- package/dist/src/utils/systemInfoFields.test.d.ts +6 -0
- package/dist/src/utils/systemInfoFields.test.js +74 -0
- package/dist/src/utils/systemInfoFields.test.js.map +1 -0
- package/dist/src/utils/terminalSequence.d.ts +21 -0
- package/dist/src/utils/terminalSequence.js +124 -0
- package/dist/src/utils/terminalSequence.js.map +1 -0
- package/dist/src/utils/terminalSequence.test.d.ts +6 -0
- package/dist/src/utils/terminalSequence.test.js +132 -0
- package/dist/src/utils/terminalSequence.test.js.map +1 -0
- package/dist/src/utils/truncatedDiffPreview.d.ts +6 -0
- package/dist/src/utils/truncatedDiffPreview.js +18 -0
- package/dist/src/utils/truncatedDiffPreview.js.map +1 -0
- package/dist/src/utils/updateEventEmitter.d.ts +11 -0
- package/dist/src/utils/updateEventEmitter.js +12 -0
- package/dist/src/utils/updateEventEmitter.js.map +1 -0
- package/dist/src/utils/userPromptExpansionHook.d.ts +9 -0
- package/dist/src/utils/userPromptExpansionHook.js +30 -0
- package/dist/src/utils/userPromptExpansionHook.js.map +1 -0
- package/dist/src/utils/userPromptExpansionHook.test.d.ts +6 -0
- package/dist/src/utils/userPromptExpansionHook.test.js +69 -0
- package/dist/src/utils/userPromptExpansionHook.test.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +12 -0
- package/dist/src/utils/userStartupWarnings.js +74 -0
- package/dist/src/utils/userStartupWarnings.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.test.js +88 -0
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.d.ts +6 -0
- package/dist/src/utils/version.js +11 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/src/utils/warningHandler.d.ts +29 -0
- package/dist/src/utils/warningHandler.js +100 -0
- package/dist/src/utils/warningHandler.js.map +1 -0
- package/dist/src/utils/warningHandler.test.d.ts +6 -0
- package/dist/src/utils/warningHandler.test.js +185 -0
- package/dist/src/utils/warningHandler.test.js.map +1 -0
- package/dist/src/utils/windowTitle.d.ts +12 -0
- package/dist/src/utils/windowTitle.js +19 -0
- package/dist/src/utils/windowTitle.js.map +1 -0
- package/dist/src/utils/windowTitle.test.d.ts +6 -0
- package/dist/src/utils/windowTitle.test.js +49 -0
- package/dist/src/utils/windowTitle.test.js.map +1 -0
- package/dist/src/utils/writeWithBackup.d.ts +49 -0
- package/dist/src/utils/writeWithBackup.js +136 -0
- package/dist/src/utils/writeWithBackup.js.map +1 -0
- package/dist/src/utils/writeWithBackup.test.d.ts +6 -0
- package/dist/src/utils/writeWithBackup.test.js +177 -0
- package/dist/src/utils/writeWithBackup.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +8 -0
- package/dist/src/validateNonInterActiveAuth.js +66 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,2297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import * as path from 'node:path';
|
|
7
|
+
import express from 'express';
|
|
8
|
+
import { APPROVAL_MODES, TrustGateError } from '@tulex-cli/tulex-cli-core';
|
|
9
|
+
import { writeStderrLine } from '../utils/stdioHelpers.js';
|
|
10
|
+
import { bearerAuth, createMutationGate, denyBrowserOriginCors, hostAllowlist, } from './auth.js';
|
|
11
|
+
import { DeviceFlowRegistry, setDeviceFlowRegistry, TooManyActiveDeviceFlowsError, UnsupportedDeviceFlowProviderError, UpstreamDeviceFlowError, } from './auth/deviceFlow.js';
|
|
12
|
+
import { QwenOAuthDeviceFlowProvider } from './auth/qwenDeviceFlowProvider.js';
|
|
13
|
+
import { createDaemonStatusProvider } from './daemonStatusProvider.js';
|
|
14
|
+
import { isLoopbackBind } from './loopbackBinds.js';
|
|
15
|
+
import { canonicalizeWorkspace, createHttpAcpBridge, InvalidClientIdError, InvalidPermissionOptionError, InvalidSessionMetadataError, InvalidSessionScopeError, MAX_WORKSPACE_PATH_LENGTH, McpServerNotFoundError, McpServerRestartFailedError, RestoreInProgressError, SessionLimitExceededError, SessionNotFoundError, WorkspaceInitConflictError, WorkspaceMismatchError, } from './httpAcpBridge.js';
|
|
16
|
+
import { getAdvertisedServeFeatures, getServeProtocolVersions, } from './capabilities.js';
|
|
17
|
+
import { SubscriberLimitExceededError } from './eventBus.js';
|
|
18
|
+
import { CAPABILITIES_SCHEMA_VERSION, } from './types.js';
|
|
19
|
+
import { getDemoHtml } from './demo.js';
|
|
20
|
+
import { mountWorkspaceMemoryRoutes } from './workspaceMemory.js';
|
|
21
|
+
import { mountWorkspaceAgentsRoutes } from './workspaceAgents.js';
|
|
22
|
+
import { createWorkspaceFileSystemFactory, } from './fs/index.js';
|
|
23
|
+
import { registerWorkspaceFileReadRoutes } from './routes/workspaceFileRead.js';
|
|
24
|
+
import { registerWorkspaceFileWriteRoutes } from './routes/workspaceFileWrite.js';
|
|
25
|
+
/**
|
|
26
|
+
* Build a no-op fs-audit emitter that logs a warning every
|
|
27
|
+
* `WARN_EVERY` dropped events with as much context as the audit
|
|
28
|
+
* payload exposes. The default factory uses this so a regression
|
|
29
|
+
* that silently strips audit events shows up in operator logs
|
|
30
|
+
* instead of disappearing — the earlier one-shot warn was a
|
|
31
|
+
* permanent silent no-op after the first event, which made a PR
|
|
32
|
+
* 19/20 regression where `runQwenServe` forgets to inject the real
|
|
33
|
+
* factory completely invisible (every write 403s; nothing in
|
|
34
|
+
* audit; one stale stderr line easy to miss for background
|
|
35
|
+
* daemons). Periodic warning + dropped-event count + first-event
|
|
36
|
+
* `errorKind` + `pathHash` make the regression actionable.
|
|
37
|
+
*
|
|
38
|
+
* PR 19/20's `runQwenServe` injection replaces this with a real
|
|
39
|
+
* per-session emit, so legitimate production traffic never hits
|
|
40
|
+
* the warning.
|
|
41
|
+
*/
|
|
42
|
+
export function createDefaultFsAuditEmit() {
|
|
43
|
+
const WARN_EVERY = 100;
|
|
44
|
+
let droppedCount = 0;
|
|
45
|
+
return (event) => {
|
|
46
|
+
droppedCount += 1;
|
|
47
|
+
if (droppedCount === 1 || droppedCount % WARN_EVERY === 0) {
|
|
48
|
+
const data = event.data;
|
|
49
|
+
const ctx = [];
|
|
50
|
+
if (data?.errorKind)
|
|
51
|
+
ctx.push(`errorKind=${data.errorKind}`);
|
|
52
|
+
if (data?.intent)
|
|
53
|
+
ctx.push(`intent=${data.intent}`);
|
|
54
|
+
if (data?.pathHash)
|
|
55
|
+
ctx.push(`pathHash=${data.pathHash}`);
|
|
56
|
+
const ctxStr = ctx.length > 0 ? ` (${ctx.join(' ')})` : '';
|
|
57
|
+
writeStderrLine(`qwen serve: fs audit emit is the default no-op — ${droppedCount} event(s) dropped so far. ` +
|
|
58
|
+
`Latest type=${event.type}${ctxStr}. ` +
|
|
59
|
+
`Inject deps.fsFactory in createServeApp to wire audit into the EventBus.`);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build the Express app for `qwen serve`. Pure function — no side effects on
|
|
65
|
+
* the network or process; `runQwenServe` does the listen/signal handling.
|
|
66
|
+
*
|
|
67
|
+
* `getPort` is invoked lazily by the host-allowlist middleware so callers
|
|
68
|
+
* binding to port 0 (ephemeral) can supply the actual port after `listen()`
|
|
69
|
+
* resolves. Defaults to `opts.port` for callers (e.g. tests) that pin a port
|
|
70
|
+
* up front.
|
|
71
|
+
*
|
|
72
|
+
* Stage 1 routes shipped (matches §04 of issue #3803):
|
|
73
|
+
* - `GET /health`
|
|
74
|
+
* - `GET /capabilities`
|
|
75
|
+
* - `GET /workspace/mcp`
|
|
76
|
+
* - `GET /workspace/skills`
|
|
77
|
+
* - `GET /workspace/providers`
|
|
78
|
+
* - `GET /workspace/env`
|
|
79
|
+
* - `GET /workspace/preflight`
|
|
80
|
+
* - `POST /session`
|
|
81
|
+
* - `POST /session/:id/load`
|
|
82
|
+
* - `POST /session/:id/resume`
|
|
83
|
+
* - `GET /workspace/:id/sessions`
|
|
84
|
+
* - `GET /session/:id/context`
|
|
85
|
+
* - `GET /session/:id/supported-commands`
|
|
86
|
+
* - `POST /session/:id/prompt`
|
|
87
|
+
* - `POST /session/:id/cancel`
|
|
88
|
+
* - `POST /session/:id/heartbeat`
|
|
89
|
+
* - `POST /session/:id/model`
|
|
90
|
+
* - `GET /session/:id/events` (SSE)
|
|
91
|
+
* - `POST /session/:id/permission/:requestId`
|
|
92
|
+
* - `POST /permission/:requestId`
|
|
93
|
+
*
|
|
94
|
+
* **Workspace validation contract.** `createServeApp` itself does NOT
|
|
95
|
+
* verify that `opts.workspace` exists or is a directory — it
|
|
96
|
+
* canonicalizes via `canonicalizeWorkspace`, which falls back to
|
|
97
|
+
* `path.resolve` on ENOENT so the app boots even against a missing
|
|
98
|
+
* path. `runQwenServe` is the production entry point and DOES
|
|
99
|
+
* perform the `fs.statSync` + `isDirectory()` boot-loud check before
|
|
100
|
+
* calling this function. Tests inject synthetic paths (`/work/bound`
|
|
101
|
+
* etc.) on purpose: they want to exercise the route layer's
|
|
102
|
+
* canonicalization and `workspace_mismatch` translation without
|
|
103
|
+
* needing a real directory on disk. If a future entry point binds
|
|
104
|
+
* `createServeApp` directly to user input, it MUST replicate the
|
|
105
|
+
* `runQwenServe` validation (or call into a shared helper if one is
|
|
106
|
+
* extracted) — otherwise a non-existent `--workspace` would boot
|
|
107
|
+
* a "healthy"-looking daemon whose every spawn fails with cryptic
|
|
108
|
+
* child-process ENOENT.
|
|
109
|
+
*/
|
|
110
|
+
export function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
111
|
+
const app = express();
|
|
112
|
+
// Forward `maxSessions` into the default-constructed bridge so
|
|
113
|
+
// direct callers of `createServeApp` (tests, embeds) get the same
|
|
114
|
+
// cap they configured via `ServeOptions`. Previously the default
|
|
115
|
+
// bridge silently fell back to `DEFAULT_MAX_SESSIONS` (20) and
|
|
116
|
+
// only the `runQwenServe` path piped the option through.
|
|
117
|
+
//
|
|
118
|
+
// Workspace binding mirrors `runQwenServe`: per #3803 §02 the
|
|
119
|
+
// daemon is bound to exactly one workspace (`opts.workspace` or
|
|
120
|
+
// `process.cwd()`). `POST /session` with a mismatched cwd is
|
|
121
|
+
// rejected with 400 `workspace_mismatch`.
|
|
122
|
+
//
|
|
123
|
+
// The value advertised on `/capabilities`, used for the `POST
|
|
124
|
+
// /session` cwd fallback, AND passed into the bridge must be the
|
|
125
|
+
// SAME canonical form — otherwise the bridge's
|
|
126
|
+
// `realpathSync.native` would diverge from what `/capabilities`
|
|
127
|
+
// shows on symlinks / case-insensitive filesystems, and clients
|
|
128
|
+
// echoing the advertised path back would see a response whose
|
|
129
|
+
// `workspaceCwd` differs from what they sent.
|
|
130
|
+
//
|
|
131
|
+
// `deps.boundWorkspace` is the pre-canonicalized fast-path —
|
|
132
|
+
// `runQwenServe` passes it after its own boot-time
|
|
133
|
+
// `canonicalizeWorkspace`, so we skip the redundant
|
|
134
|
+
// `realpathSync.native` here. When omitted (tests, direct embeds)
|
|
135
|
+
// we canonicalize ourselves.
|
|
136
|
+
const boundWorkspace = deps.boundWorkspace ??
|
|
137
|
+
canonicalizeWorkspace(opts.workspace ?? process.cwd());
|
|
138
|
+
const bridge = deps.bridge ??
|
|
139
|
+
createHttpAcpBridge({
|
|
140
|
+
maxSessions: opts.maxSessions,
|
|
141
|
+
// Symmetric with `runQwenServe.ts` — direct embeds / tests that
|
|
142
|
+
// call `createServeApp` without supplying their own bridge and
|
|
143
|
+
// pass `ServeOptions.eventRingSize` would otherwise silently
|
|
144
|
+
// get the default 8000 ring instead of their configured value.
|
|
145
|
+
...(opts.eventRingSize !== undefined
|
|
146
|
+
? { eventRingSize: opts.eventRingSize }
|
|
147
|
+
: {}),
|
|
148
|
+
boundWorkspace,
|
|
149
|
+
// PR 22b/2 (wenshao/gpt-5.5 review fold-in #4304): symmetric
|
|
150
|
+
// with `runQwenServe.ts` — direct embeds / tests that don't
|
|
151
|
+
// inject `deps.bridge` would otherwise silently lose the
|
|
152
|
+
// daemon env + preflight cells the default server app
|
|
153
|
+
// reported pre-injection. Wiring the production status provider
|
|
154
|
+
// here preserves byte-for-byte route output on the default
|
|
155
|
+
// bridge construction path.
|
|
156
|
+
statusProvider: createDaemonStatusProvider(),
|
|
157
|
+
});
|
|
158
|
+
// Allow same-origin requests from the demo page. Browsers send an
|
|
159
|
+
// `Origin` header on same-origin POST/fetch calls; `denyBrowserOriginCors`
|
|
160
|
+
// below would reject them. This middleware strips `Origin` when it
|
|
161
|
+
// matches the daemon's own address so the demo page's API calls pass
|
|
162
|
+
// through. Only loopback origins are matched — non-loopback deployments
|
|
163
|
+
// require the operator to front the daemon with a reverse proxy for
|
|
164
|
+
// browser access anyway (per the threat-model docs).
|
|
165
|
+
let cachedStripPort = -1;
|
|
166
|
+
let cachedSelfOrigins = new Set();
|
|
167
|
+
app.use((req, _res, next) => {
|
|
168
|
+
const origin = req.headers.origin;
|
|
169
|
+
if (origin) {
|
|
170
|
+
const port = getPort();
|
|
171
|
+
if (port !== cachedStripPort) {
|
|
172
|
+
cachedStripPort = port;
|
|
173
|
+
cachedSelfOrigins = new Set([
|
|
174
|
+
`http://127.0.0.1:${port}`,
|
|
175
|
+
`http://localhost:${port}`,
|
|
176
|
+
`http://[::1]:${port}`,
|
|
177
|
+
`http://host.docker.internal:${port}`,
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
if (cachedSelfOrigins.has(origin)) {
|
|
181
|
+
delete req.headers.origin;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
next();
|
|
185
|
+
});
|
|
186
|
+
// Strict-default factory: `trusted: false` so an upstream refactor
|
|
187
|
+
// that forgets to inject `deps.fsFactory` never silently allows
|
|
188
|
+
// writes against an untrusted workspace. Read-shaped intents still
|
|
189
|
+
// succeed (so tests / direct embeds can exercise the read path
|
|
190
|
+
// without a config), but every mutating intent throws
|
|
191
|
+
// `untrusted_workspace`. The default `emit` is a no-op that warns
|
|
192
|
+
// once on first call so a future regression that silently swallows
|
|
193
|
+
// audit events surfaces in operator logs the first time it bites.
|
|
194
|
+
// Callers passing `deps.fsFactory` get full control of trust +
|
|
195
|
+
// audit destination — `runQwenServe` will inject one whose
|
|
196
|
+
// `trusted` mirrors `Config.isTrustedFolder()` and whose `emit`
|
|
197
|
+
// plumbs into the per-session EventBus once PR 19/20 lands.
|
|
198
|
+
const fsFactory = deps.fsFactory ??
|
|
199
|
+
createWorkspaceFileSystemFactory({
|
|
200
|
+
boundWorkspace,
|
|
201
|
+
trusted: false,
|
|
202
|
+
emit: createDefaultFsAuditEmit(),
|
|
203
|
+
});
|
|
204
|
+
// Park the factory on `app.locals` so PR 19/20 route handlers can
|
|
205
|
+
// pick it up via `req.app.locals.fsFactory` without re-threading
|
|
206
|
+
// the value through every handler signature, and so PR 18 tests
|
|
207
|
+
// can assert the factory is reachable. Express types `locals` as
|
|
208
|
+
// a generic record; we cast to keep a precise property name.
|
|
209
|
+
app.locals.fsFactory =
|
|
210
|
+
fsFactory;
|
|
211
|
+
// Surface the bound workspace on `app.locals` so the PR 19 read
|
|
212
|
+
// routes can compute workspace-relative response paths without
|
|
213
|
+
// re-resolving. Same canonical form `/capabilities` advertises
|
|
214
|
+
// and the bridge enforces — keeping every layer in agreement.
|
|
215
|
+
app.locals.boundWorkspace = boundWorkspace;
|
|
216
|
+
// Issue #4175 PR 21 — wire the device-flow registry. Default builds
|
|
217
|
+
// a single Qwen provider; tests inject `deps.deviceFlowRegistry`
|
|
218
|
+
// wholesale (with controlled clock/scheduler) or
|
|
219
|
+
// `deps.deviceFlowProviders` to stub the OAuth client only.
|
|
220
|
+
const deviceFlowProviderMap = new Map();
|
|
221
|
+
for (const provider of deps.deviceFlowProviders ?? []) {
|
|
222
|
+
deviceFlowProviderMap.set(provider.providerId, provider);
|
|
223
|
+
}
|
|
224
|
+
if (!deviceFlowProviderMap.has('qwen-oauth')) {
|
|
225
|
+
deviceFlowProviderMap.set('qwen-oauth', new QwenOAuthDeviceFlowProvider());
|
|
226
|
+
}
|
|
227
|
+
const deviceFlowEventSink = {
|
|
228
|
+
publish(emission, originatorClientId) {
|
|
229
|
+
// PR #4255 fold-in 9: PR 16 (#4249) landed
|
|
230
|
+
// `publishWorkspaceEvent` with the same fan-out semantics as
|
|
231
|
+
// PR 21's `broadcastWorkspaceEvent`. The closed-bus +
|
|
232
|
+
// all-failed-stderr operator-visibility features that PR 21
|
|
233
|
+
// added have been folded INTO `publishWorkspaceEvent`; PR 21
|
|
234
|
+
// now uses the canonical helper.
|
|
235
|
+
bridge.publishWorkspaceEvent({
|
|
236
|
+
type: `auth_device_flow_${emission.type}`,
|
|
237
|
+
data: emission.data,
|
|
238
|
+
...(originatorClientId ? { originatorClientId } : {}),
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
const deviceFlowRegistry = deps.deviceFlowRegistry ??
|
|
243
|
+
new DeviceFlowRegistry({
|
|
244
|
+
events: deviceFlowEventSink,
|
|
245
|
+
audit: {
|
|
246
|
+
record(line) {
|
|
247
|
+
// Structured stderr breadcrumb; deviceFlowId truncated to first
|
|
248
|
+
// 8 chars (mirrors PR 16 audit-event-stamp shape) so log
|
|
249
|
+
// skimmers can follow a flow without retaining full uuids.
|
|
250
|
+
const id = line.deviceFlowId.slice(0, 8);
|
|
251
|
+
const parts = [
|
|
252
|
+
`[serve] auth.device-flow:`,
|
|
253
|
+
`provider=${line.providerId}`,
|
|
254
|
+
`deviceFlowId=${id}...`,
|
|
255
|
+
line.clientId ? `clientId=${line.clientId}` : 'clientId=-',
|
|
256
|
+
`status=${line.status}`,
|
|
257
|
+
];
|
|
258
|
+
if (line.errorKind)
|
|
259
|
+
parts.push(`errorKind=${line.errorKind}`);
|
|
260
|
+
if (line.expiresInMs !== undefined) {
|
|
261
|
+
parts.push(`expiresInMs=${Math.max(0, line.expiresInMs)}`);
|
|
262
|
+
}
|
|
263
|
+
// PR #4255 round-12 #7 (gpt-5.5 review CzSpd): include
|
|
264
|
+
// `line.hint` in the production stderr line. The
|
|
265
|
+
// registry uses the hint slot for operator-only
|
|
266
|
+
// breadcrumbs that aren't surfaced over SSE: the static
|
|
267
|
+
// catch-all hint "provider.poll() threw (raw): ..."
|
|
268
|
+
// (round-8 #1), `lost_success_after_timeout` (round-8
|
|
269
|
+
// #7's split-brain detector), `persist_also_failed_past_expiry`
|
|
270
|
+
// (round-8 #13), `take-over` audit on per-provider
|
|
271
|
+
// singleton, and `deferred (persist in flight; ...)` on
|
|
272
|
+
// cancel-during-persist. Without echoing here, the
|
|
273
|
+
// documented troubleshooting trail is invisible in
|
|
274
|
+
// production. Bound at 1 KiB so a misbehaving caller
|
|
275
|
+
// can't spam stderr.
|
|
276
|
+
if (line.hint) {
|
|
277
|
+
const STDERR_HINT_MAX = 1_024;
|
|
278
|
+
const hint = line.hint.length > STDERR_HINT_MAX
|
|
279
|
+
? `${line.hint.slice(0, STDERR_HINT_MAX)}…[+${line.hint.length - STDERR_HINT_MAX} bytes truncated]`
|
|
280
|
+
: line.hint;
|
|
281
|
+
// Quote the hint so multi-word values stay parseable.
|
|
282
|
+
parts.push(`hint=${JSON.stringify(hint)}`);
|
|
283
|
+
}
|
|
284
|
+
writeStderrLine(parts.join(' '));
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
resolveProvider: (providerId) => deviceFlowProviderMap.get(providerId),
|
|
288
|
+
});
|
|
289
|
+
// Park the registry on `app.locals` so request handlers can reach it
|
|
290
|
+
// without closure capture (and so future helper extracts can find it
|
|
291
|
+
// without threading it through their args). Typed accessor (fold-in 4
|
|
292
|
+
// review thread D) prevents a string-key typo from silently
|
|
293
|
+
// detaching `runQwenServe`'s shutdown dispose call.
|
|
294
|
+
setDeviceFlowRegistry(app, deviceFlowRegistry);
|
|
295
|
+
// Order matters: rejection guards (CORS / Host allowlist / bearer auth)
|
|
296
|
+
// run BEFORE the JSON body parser. Otherwise an unauthenticated POST
|
|
297
|
+
// gets a full 10MB `JSON.parse` before the 401 fires — a trivially
|
|
298
|
+
// amplified CPU/memory cost from any wrong-token client.
|
|
299
|
+
app.use(denyBrowserOriginCors);
|
|
300
|
+
app.use(hostAllowlist(opts.hostname, getPort));
|
|
301
|
+
// --- Demo page: mirrors the `/health` loopback-gating pattern.
|
|
302
|
+
// On loopback binds, registered BEFORE bearerAuth so browsers can
|
|
303
|
+
// reach the page via address-bar navigation (which cannot attach
|
|
304
|
+
// Authorization headers). On non-loopback binds, registered AFTER
|
|
305
|
+
// bearerAuth — an unauthenticated `/demo` on a public interface
|
|
306
|
+
// would leak the full API surface (route enumeration + interactive
|
|
307
|
+
// console), far more than `/health`'s `{"status":"ok"}`.
|
|
308
|
+
// X-Frame-Options: DENY + CSP frame-ancestors 'none' prevent
|
|
309
|
+
// clickjacking — a malicious site embedding the demo in an iframe
|
|
310
|
+
// could trick a user into performing daemon actions via transparent
|
|
311
|
+
// overlay (the iframe's same-origin fetches bypass CORS).
|
|
312
|
+
const demoHandler = (_req, res) => {
|
|
313
|
+
try {
|
|
314
|
+
res
|
|
315
|
+
.type('html')
|
|
316
|
+
.set('X-Frame-Options', 'DENY')
|
|
317
|
+
.set('Content-Security-Policy', "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; connect-src 'self'; frame-ancestors 'none'")
|
|
318
|
+
.send(getDemoHtml(getPort()));
|
|
319
|
+
}
|
|
320
|
+
catch (err) {
|
|
321
|
+
writeStderrLine(`qwen serve: /demo render failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
322
|
+
res.status(500).json({ error: 'Failed to render demo page' });
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
// `/health` is exempted from `bearerAuth` ONLY on loopback binds —
|
|
326
|
+
// the canonical liveness-probe case (k8s/Compose probes don't
|
|
327
|
+
// carry the daemon's bearer; round-tripping a 401 just to know
|
|
328
|
+
// the listener is up is waste). On non-loopback binds the
|
|
329
|
+
// exemption becomes a low-severity info leak (attacker can probe
|
|
330
|
+
// arbitrary IP:port to confirm a `qwen serve` is listening), so
|
|
331
|
+
// we register `/health` AFTER `bearerAuth` and let it 401 like
|
|
332
|
+
// every other route. Operators using the loopback default get the
|
|
333
|
+
// probe-friendly behavior; operators exposing the daemon publicly
|
|
334
|
+
// gate `/health` behind their token alongside everything else.
|
|
335
|
+
// CORS deny + Host allowlist still apply to `/health` in both
|
|
336
|
+
// cases.
|
|
337
|
+
// Shared handler so loopback (pre-auth) and non-loopback (post-auth)
|
|
338
|
+
// routes return the same shape. `?deep=1` exposes bridge counters
|
|
339
|
+
// (`sessions`, `pendingPermissions`) for observability — it is
|
|
340
|
+
// INFORMATIONAL only, not a true liveness probe. Counter getters
|
|
341
|
+
// are size accessors that don't perform per-session/channel pings,
|
|
342
|
+
// so a wedged child (stuck on a request, leaked FD, etc.) won't
|
|
343
|
+
// change the response. We retain the try/catch + 503 as a
|
|
344
|
+
// defense-in-depth net for custom bridge impls whose getters MAY
|
|
345
|
+
// throw — but the real bridge's getters never do, so under normal
|
|
346
|
+
// operation the 503 path is unreachable. Per BQ-6F: the docs
|
|
347
|
+
// (`docs/users/qwen-serve.md` + `qwen-serve-protocol.md`) clarify
|
|
348
|
+
// that deep is for counters, not health verification. Default (no
|
|
349
|
+
// query) stays cheap so high-frequency liveness probes don't load
|
|
350
|
+
// the bridge.
|
|
351
|
+
const healthHandler = (req, res) => {
|
|
352
|
+
const deepQuery = req.query['deep'];
|
|
353
|
+
const deep = deepQuery === '1' || deepQuery === 'true' || deepQuery === '';
|
|
354
|
+
if (!deep) {
|
|
355
|
+
res.status(200).json({ status: 'ok' });
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
res.status(200).json({
|
|
360
|
+
status: 'ok',
|
|
361
|
+
sessions: bridge.sessionCount,
|
|
362
|
+
pendingPermissions: bridge.pendingPermissionCount,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
catch (err) {
|
|
366
|
+
writeStderrLine(`qwen serve: /health deep probe failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
367
|
+
res.status(503).json({ status: 'degraded' });
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
const loopback = isLoopbackBind(opts.hostname);
|
|
371
|
+
// Issue #4175 PR 15. `--require-auth` extends the non-loopback "gate
|
|
372
|
+
// /health behind bearer too" rule to loopback. Without this, an
|
|
373
|
+
// operator who set the flag specifically to harden the loopback
|
|
374
|
+
// default would still see `/health` answering 200 to unauthenticated
|
|
375
|
+
// probes — defeating the flag's purpose. The boot check in
|
|
376
|
+
// `runQwenServe` guarantees `token` is set whenever `requireAuth`
|
|
377
|
+
// is true, so the post-`bearerAuth` registration always has a token
|
|
378
|
+
// to compare against.
|
|
379
|
+
const exposeHealthPreAuth = loopback && !opts.requireAuth;
|
|
380
|
+
if (exposeHealthPreAuth) {
|
|
381
|
+
app.get('/health', healthHandler);
|
|
382
|
+
app.get('/demo', demoHandler);
|
|
383
|
+
}
|
|
384
|
+
app.use(bearerAuth(opts.token));
|
|
385
|
+
app.use(express.json({ limit: '10mb' }));
|
|
386
|
+
if (!exposeHealthPreAuth) {
|
|
387
|
+
// Non-loopback OR loopback with `--require-auth`: register
|
|
388
|
+
// `/health` and `/demo` AFTER `bearerAuth` so probes must carry
|
|
389
|
+
// the token. Otherwise unauthenticated callers can ping any
|
|
390
|
+
// reachable address:port to confirm a daemon exists (and `/demo`
|
|
391
|
+
// leaks the full API surface).
|
|
392
|
+
app.get('/health', healthHandler);
|
|
393
|
+
app.get('/demo', demoHandler);
|
|
394
|
+
}
|
|
395
|
+
// Issue #4175 PR 15. Mutation-route gate factory. Today's existing
|
|
396
|
+
// mutation routes (`POST /session*`, `/permission/:requestId`) opt
|
|
397
|
+
// into the default non-strict mode, which is a passthrough — so
|
|
398
|
+
// backward compatibility is bit-for-bit. Wave 4 PRs will pass
|
|
399
|
+
// `{ strict: true }` for routes (memory CRUD / file edit / tool
|
|
400
|
+
// enable / MCP restart / device-flow auth) that should require a
|
|
401
|
+
// token even when the daemon is on loopback no-token defaults.
|
|
402
|
+
const mutate = createMutationGate({
|
|
403
|
+
tokenConfigured: opts.token !== undefined,
|
|
404
|
+
requireAuth: opts.requireAuth === true,
|
|
405
|
+
});
|
|
406
|
+
app.get('/capabilities', (_req, res) => {
|
|
407
|
+
const envelope = {
|
|
408
|
+
v: CAPABILITIES_SCHEMA_VERSION,
|
|
409
|
+
protocolVersions: getServeProtocolVersions(),
|
|
410
|
+
mode: opts.mode,
|
|
411
|
+
// PR 15. Pass `requireAuth` so the `require_auth` tag appears
|
|
412
|
+
// ONLY when the operator opted in. Tag presence = behavior is
|
|
413
|
+
// on; older daemons without this PR omit the tag and SDKs that
|
|
414
|
+
// post-PR feature-detect on it stay backward compatible.
|
|
415
|
+
features: getAdvertisedServeFeatures(undefined, {
|
|
416
|
+
requireAuth: opts.requireAuth === true,
|
|
417
|
+
}),
|
|
418
|
+
modelServices: [],
|
|
419
|
+
// #3803 §02: surface the bound workspace so clients can detect
|
|
420
|
+
// mismatch pre-flight and omit `cwd` on `POST /session`.
|
|
421
|
+
workspaceCwd: boundWorkspace,
|
|
422
|
+
};
|
|
423
|
+
res.status(200).json(envelope);
|
|
424
|
+
});
|
|
425
|
+
app.get('/workspace/mcp', async (_req, res) => {
|
|
426
|
+
try {
|
|
427
|
+
res.status(200).json(await bridge.getWorkspaceMcpStatus());
|
|
428
|
+
}
|
|
429
|
+
catch (err) {
|
|
430
|
+
sendBridgeError(res, err, { route: 'GET /workspace/mcp' });
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
app.get('/workspace/skills', async (_req, res) => {
|
|
434
|
+
try {
|
|
435
|
+
res.status(200).json(await bridge.getWorkspaceSkillsStatus());
|
|
436
|
+
}
|
|
437
|
+
catch (err) {
|
|
438
|
+
sendBridgeError(res, err, { route: 'GET /workspace/skills' });
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
app.get('/workspace/providers', async (_req, res) => {
|
|
442
|
+
try {
|
|
443
|
+
res.status(200).json(await bridge.getWorkspaceProvidersStatus());
|
|
444
|
+
}
|
|
445
|
+
catch (err) {
|
|
446
|
+
sendBridgeError(res, err, { route: 'GET /workspace/providers' });
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
// Issue #4175 PR 16: workspace memory + agents CRUD. Routes mounted
|
|
450
|
+
// through factories so server.ts stays the composition root while
|
|
451
|
+
// the feature modules own their own validation, error mapping, and
|
|
452
|
+
// event fan-out. Both factories receive the shared `mutate` gate
|
|
453
|
+
// and the request-helpers `parseClientIdHeader` / `safeBody` so
|
|
454
|
+
// strict mutation gating and pollution-key scrubbing match the
|
|
455
|
+
// existing routes bit-for-bit.
|
|
456
|
+
mountWorkspaceMemoryRoutes(app, {
|
|
457
|
+
bridge,
|
|
458
|
+
boundWorkspace,
|
|
459
|
+
mutate,
|
|
460
|
+
parseClientId: parseClientIdHeader,
|
|
461
|
+
safeBody,
|
|
462
|
+
});
|
|
463
|
+
mountWorkspaceAgentsRoutes(app, {
|
|
464
|
+
bridge,
|
|
465
|
+
boundWorkspace,
|
|
466
|
+
mutate,
|
|
467
|
+
parseClientId: parseClientIdHeader,
|
|
468
|
+
safeBody,
|
|
469
|
+
});
|
|
470
|
+
// TODO(#4175 PR 24 — PermissionMediator audit log): emit an
|
|
471
|
+
// `audit.diagnostic_read` event from these two routes so a security
|
|
472
|
+
// operator can correlate "who read what when". Read-only diagnostic
|
|
473
|
+
// surfaces are reconnaissance vectors (env: secret-var presence;
|
|
474
|
+
// preflight: workspace path + CLI entry + Node version) and the absence
|
|
475
|
+
// of audit emission here is a deliberate scope deferral, not an
|
|
476
|
+
// oversight — the audit topic does not yet exist; PR 24 lands the
|
|
477
|
+
// shared `bridge.emitAudit` infrastructure that this and PR 18's
|
|
478
|
+
// `fs.access` events will both use.
|
|
479
|
+
app.get('/workspace/env', async (_req, res) => {
|
|
480
|
+
try {
|
|
481
|
+
res.status(200).json(await bridge.getWorkspaceEnvStatus());
|
|
482
|
+
}
|
|
483
|
+
catch (err) {
|
|
484
|
+
sendBridgeError(res, err, { route: 'GET /workspace/env' });
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
app.get('/workspace/preflight', async (_req, res) => {
|
|
488
|
+
try {
|
|
489
|
+
res.status(200).json(await bridge.getWorkspacePreflightStatus());
|
|
490
|
+
}
|
|
491
|
+
catch (err) {
|
|
492
|
+
sendBridgeError(res, err, { route: 'GET /workspace/preflight' });
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
// Issue #4175 PR 19 — read-only workspace file routes
|
|
496
|
+
// (`GET /file|/list|/glob|/stat`). Registered after the workspace
|
|
497
|
+
// diagnostics routes so the file surface sits next to its sibling
|
|
498
|
+
// workspace-scoped reads and shares the same auth posture (no
|
|
499
|
+
// `mutate()` gate; only the global `bearerAuth` middleware
|
|
500
|
+
// applies). Mutation file routes (`POST /file/write|/edit`) come
|
|
501
|
+
// in PR 20.
|
|
502
|
+
registerWorkspaceFileReadRoutes(app, {
|
|
503
|
+
parseClientId: parseClientIdHeader,
|
|
504
|
+
});
|
|
505
|
+
registerWorkspaceFileWriteRoutes(app, {
|
|
506
|
+
bridge,
|
|
507
|
+
mutate,
|
|
508
|
+
parseClientId: parseClientIdHeader,
|
|
509
|
+
safeBody,
|
|
510
|
+
});
|
|
511
|
+
// -- Issue #4175 PR 21 — auth device-flow routes ------------------------
|
|
512
|
+
app.post('/workspace/auth/device-flow', mutate({ strict: true }), async (req, res) => {
|
|
513
|
+
const body = safeBody(req);
|
|
514
|
+
const providerIdRaw = body['providerId'];
|
|
515
|
+
// PR #4255 review W2: split `invalid_request` (request shape is
|
|
516
|
+
// wrong — missing/non-string field) from `unsupported_provider`
|
|
517
|
+
// (the field is well-formed but its value isn't in the
|
|
518
|
+
// daemon's known set). Conflating the two surfaced misleading
|
|
519
|
+
// remediation hints to SDK consumers branching on `code`
|
|
520
|
+
// ("this provider isn't supported here" when the actual cause
|
|
521
|
+
// was a serializer dropping the field).
|
|
522
|
+
if (typeof providerIdRaw !== 'string' || providerIdRaw.length === 0) {
|
|
523
|
+
res.status(400).json({
|
|
524
|
+
error: '`providerId` must be a non-empty string',
|
|
525
|
+
code: 'invalid_request',
|
|
526
|
+
});
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
// PR #4255 round-12 #3 (gpt-5.5 review CzSpe): validate
|
|
530
|
+
// against the runtime provider map, not the static
|
|
531
|
+
// `DEVICE_FLOW_SUPPORTED_PROVIDERS` tuple. The static tuple
|
|
532
|
+
// is the SDK-facing default; `deps.deviceFlowProviders` is
|
|
533
|
+
// the documented extension hook for tests / future
|
|
534
|
+
// providers. Hardcoding the static tuple here meant
|
|
535
|
+
// injected providers were rejected at the route while still
|
|
536
|
+
// being registered in `deviceFlowProviderMap` — easy to
|
|
537
|
+
// break when adding a second provider.
|
|
538
|
+
if (!deviceFlowProviderMap.has(providerIdRaw)) {
|
|
539
|
+
res.status(400).json({
|
|
540
|
+
error: `Unsupported device-flow provider: ${providerIdRaw}`,
|
|
541
|
+
code: 'unsupported_provider',
|
|
542
|
+
supportedProviders: Array.from(deviceFlowProviderMap.keys()),
|
|
543
|
+
});
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
const providerId = providerIdRaw;
|
|
547
|
+
const clientId = parseClientIdHeader(req, res);
|
|
548
|
+
if (clientId === null)
|
|
549
|
+
return;
|
|
550
|
+
try {
|
|
551
|
+
const { view, attached } = await deviceFlowRegistry.start({
|
|
552
|
+
providerId,
|
|
553
|
+
...(clientId !== undefined ? { initiatorClientId: clientId } : {}),
|
|
554
|
+
});
|
|
555
|
+
// Idempotent take-over → 200 with `attached: true`. Fresh start →
|
|
556
|
+
// 201 + `attached: false`. The registry is the source of truth on
|
|
557
|
+
// which branch fired (it's the one that decided not to call
|
|
558
|
+
// `provider.start()` again).
|
|
559
|
+
res
|
|
560
|
+
.status(attached ? 200 : 201)
|
|
561
|
+
.json(toDeviceFlowStartResponseBody(view, attached, clientId));
|
|
562
|
+
}
|
|
563
|
+
catch (err) {
|
|
564
|
+
if (err instanceof UnsupportedDeviceFlowProviderError) {
|
|
565
|
+
res
|
|
566
|
+
.status(400)
|
|
567
|
+
.json({ error: err.message, code: 'unsupported_provider' });
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
if (err instanceof TooManyActiveDeviceFlowsError) {
|
|
571
|
+
res
|
|
572
|
+
.status(409)
|
|
573
|
+
.json({ error: err.message, code: 'too_many_active_flows' });
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
if (err instanceof UpstreamDeviceFlowError) {
|
|
577
|
+
// IdP-side failure (network / parse / non-2xx). 502 distinguishes
|
|
578
|
+
// "the upstream we depend on misbehaved" from a daemon bug (5xx
|
|
579
|
+
// generic) so SDK clients can branch on retry strategy.
|
|
580
|
+
res.status(502).json({ error: err.message, code: 'upstream_error' });
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
sendBridgeError(res, err, {
|
|
584
|
+
route: 'POST /workspace/auth/device-flow',
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
// PR #4255 fold-in 3: this GET surfaces `userCode` /
|
|
589
|
+
// `verificationUri` / `verificationUriComplete` for pending entries
|
|
590
|
+
// — material an attacker on the same loopback host could use to
|
|
591
|
+
// shoulder-surf the IdP approval flow. POST + DELETE are already
|
|
592
|
+
// strict; aligning GET to `mutate({ strict: true })` closes the
|
|
593
|
+
// information-disclosure asymmetry (the sibling
|
|
594
|
+
// `GET /workspace/auth/status` stays bearer-only because its
|
|
595
|
+
// pendingDeviceFlows entries intentionally omit `userCode`).
|
|
596
|
+
//
|
|
597
|
+
// PR #4291 follow-up review (qwen-latest, #4): GET now also runs
|
|
598
|
+
// `parseClientIdHeader` to drive the `callerIsInitiator` gate in
|
|
599
|
+
// `toDeviceFlowStateBody`. INTENTIONAL contract change: a malformed
|
|
600
|
+
// `X-Qwen-Client-Id` (>128 chars or invalid characters) returns
|
|
601
|
+
// `400 invalid_client_id` instead of the previous 200, matching the
|
|
602
|
+
// POST/DELETE behavior. SDK clients that send the header on POST
|
|
603
|
+
// should send a valid value on GET too. Anonymous callers (header
|
|
604
|
+
// absent) are unaffected and continue to work as pre-PR-4291 — the
|
|
605
|
+
// both-undefined branch in `callerIsInitiator` covers them.
|
|
606
|
+
app.get('/workspace/auth/device-flow/:id', mutate({ strict: true }), async (req, res) => {
|
|
607
|
+
const id = req.params['id'];
|
|
608
|
+
if (!id) {
|
|
609
|
+
res.status(404).json({
|
|
610
|
+
error: 'Device-flow id required',
|
|
611
|
+
code: 'device_flow_not_found',
|
|
612
|
+
});
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const view = deviceFlowRegistry.get(id);
|
|
616
|
+
if (!view) {
|
|
617
|
+
res.status(404).json({
|
|
618
|
+
error: `Device-flow ${id} not found`,
|
|
619
|
+
code: 'device_flow_not_found',
|
|
620
|
+
});
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const clientId = parseClientIdHeader(req, res);
|
|
624
|
+
if (clientId === null)
|
|
625
|
+
return;
|
|
626
|
+
// PR #4291 follow-up review (qwen-latest, N4): when the
|
|
627
|
+
// `callerIsInitiator` gate redacts the verification fields,
|
|
628
|
+
// operators triaging "SDK got HTTP 200 but no userCode" have
|
|
629
|
+
// zero signal in daemon stderr / audit. The redaction happens
|
|
630
|
+
// INSIDE the body shaper which doesn't have an audit sink, so
|
|
631
|
+
// the route handler is the right layer to record it. Use
|
|
632
|
+
// QWEN_SERVE_DEBUG-gated stderr (rather than unconditional
|
|
633
|
+
// audit) — multi-SDK setups sharing a bearer token will cause
|
|
634
|
+
// legitimate "different caller GETs same flow" traffic that
|
|
635
|
+
// would otherwise flood production logs. Operators who hit
|
|
636
|
+
// the symptom can flip QWEN_SERVE_DEBUG=1 and get the
|
|
637
|
+
// breadcrumb on the next reproduction.
|
|
638
|
+
const callerIsInitiator = (view.initiatorClientId === undefined && clientId === undefined) ||
|
|
639
|
+
(view.initiatorClientId !== undefined &&
|
|
640
|
+
clientId !== undefined &&
|
|
641
|
+
clientId === view.initiatorClientId);
|
|
642
|
+
if (!callerIsInitiator &&
|
|
643
|
+
process.env['QWEN_SERVE_DEBUG'] &&
|
|
644
|
+
!['0', 'false', 'off', 'no'].includes((process.env['QWEN_SERVE_DEBUG'] ?? '').trim().toLowerCase())) {
|
|
645
|
+
writeStderrLine(`qwen serve debug: GET /workspace/auth/device-flow/${id} redacted verification fields — caller-clientId mismatch (initiator=${view.initiatorClientId ?? 'anonymous'}, caller=${clientId ?? 'anonymous'})`);
|
|
646
|
+
}
|
|
647
|
+
res.status(200).json(toDeviceFlowStateBody(view, clientId));
|
|
648
|
+
});
|
|
649
|
+
app.delete('/workspace/auth/device-flow/:id', mutate({ strict: true }), (req, res) => {
|
|
650
|
+
const id = req.params['id'];
|
|
651
|
+
if (!id) {
|
|
652
|
+
res.status(404).json({
|
|
653
|
+
error: 'Device-flow id required',
|
|
654
|
+
code: 'device_flow_not_found',
|
|
655
|
+
});
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const clientId = parseClientIdHeader(req, res);
|
|
659
|
+
if (clientId === null)
|
|
660
|
+
return;
|
|
661
|
+
const result = deviceFlowRegistry.cancel(id, clientId);
|
|
662
|
+
if (result === undefined) {
|
|
663
|
+
res.status(404).json({
|
|
664
|
+
error: `Device-flow ${id} not found`,
|
|
665
|
+
code: 'device_flow_not_found',
|
|
666
|
+
});
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
// Both freshly-cancelled and already-terminal are 204 (idempotent).
|
|
670
|
+
res.status(204).end();
|
|
671
|
+
});
|
|
672
|
+
app.get('/workspace/auth/status', (_req, res) => {
|
|
673
|
+
const pending = deviceFlowRegistry.listPending();
|
|
674
|
+
res.status(200).json({
|
|
675
|
+
v: 1,
|
|
676
|
+
workspaceCwd: boundWorkspace,
|
|
677
|
+
// GET /workspace/auth/status read-side intentionally minimal in
|
|
678
|
+
// this PR: a future PR can broaden the per-provider view (e.g.
|
|
679
|
+
// by reading SharedTokenManager.getCachedSnapshot for an `ok` /
|
|
680
|
+
// `expired` cell), but landing the additive route shape now
|
|
681
|
+
// unblocks SDK clients that need to know "is there a flow
|
|
682
|
+
// running?" without subscribing to SSE.
|
|
683
|
+
providers: [],
|
|
684
|
+
pendingDeviceFlows: pending.map((view) => ({
|
|
685
|
+
deviceFlowId: view.deviceFlowId,
|
|
686
|
+
providerId: view.providerId,
|
|
687
|
+
...(view.expiresAt !== undefined ? { expiresAt: view.expiresAt } : {}),
|
|
688
|
+
})),
|
|
689
|
+
// PR #4255 round-12 #3: derive from runtime provider map so
|
|
690
|
+
// injected providers are surfaced. Single source of truth
|
|
691
|
+
// matches the POST validation above.
|
|
692
|
+
supportedDeviceFlowProviders: Array.from(deviceFlowProviderMap.keys()),
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
app.post('/session', mutate(), async (req, res) => {
|
|
696
|
+
const body = safeBody(req);
|
|
697
|
+
// #3803 §02: 1 daemon = 1 workspace. Three input shapes:
|
|
698
|
+
// - `cwd` ABSENT from body → fall back to the daemon's bound
|
|
699
|
+
// workspace (the §02 documented shape — clients pre-flight
|
|
700
|
+
// `caps.workspaceCwd` and may then omit `cwd`).
|
|
701
|
+
// - `cwd` PRESENT but not a string → 400 malformed. A
|
|
702
|
+
// client/orchestrator serialization bug (`cwd: null`,
|
|
703
|
+
// `cwd: 123`, `cwd: {}`) must not silently bind a session
|
|
704
|
+
// to the daemon's workspace; surface the bug instead.
|
|
705
|
+
// - `cwd` PRESENT as a string → fall through to the
|
|
706
|
+
// `path.isAbsolute` check (empty string and relative both
|
|
707
|
+
// fail there with "must be an absolute path when provided").
|
|
708
|
+
//
|
|
709
|
+
// `safeBody` returns an `Object.create(null)` map, so
|
|
710
|
+
// `'cwd' in body` reflects exactly "did the client send the
|
|
711
|
+
// key?" without prototype-chain confusion. The presence-check
|
|
712
|
+
// is safe as long as `PROTOTYPE_POLLUTION_KEYS` doesn't grow to
|
|
713
|
+
// include `cwd` — see the cross-reference in the const's JSDoc
|
|
714
|
+
// for what to do if that invariant ever has to break.
|
|
715
|
+
const hasCwd = 'cwd' in body;
|
|
716
|
+
if (hasCwd && typeof body['cwd'] !== 'string') {
|
|
717
|
+
res
|
|
718
|
+
.status(400)
|
|
719
|
+
.json({ error: '`cwd` must be a string absolute path when provided' });
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
// Length cap BEFORE assignment so a multi-MB `cwd` body can't
|
|
723
|
+
// amplify through downstream interpolations
|
|
724
|
+
// (`WorkspaceMismatchError`'s `.message` echoes `requested` twice;
|
|
725
|
+
// `sendBridgeError` writes it to stderr; `res.json` echoes it
|
|
726
|
+
// again). On the loopback-default-no-token deployment shape this
|
|
727
|
+
// is pre-auth, so a 10 MB cwd body — right under
|
|
728
|
+
// `express.json({limit: '10mb'})` — would otherwise cost
|
|
729
|
+
// ~60 MB per request × `maxConnections` (default 256). The
|
|
730
|
+
// `MAX_WORKSPACE_PATH_LENGTH` constant matches Linux's PATH_MAX
|
|
731
|
+
// (4096); legitimate filesystem paths fit well under it. The
|
|
732
|
+
// `WorkspaceMismatchError` constructor also truncates as a
|
|
733
|
+
// belt-and-suspenders defense for non-route callers (tests,
|
|
734
|
+
// embeds, future entry points that throw the error directly).
|
|
735
|
+
if (hasCwd && body['cwd'].length > MAX_WORKSPACE_PATH_LENGTH) {
|
|
736
|
+
res.status(400).json({
|
|
737
|
+
error: `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
|
|
738
|
+
});
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
const cwd = hasCwd ? body['cwd'] : boundWorkspace;
|
|
742
|
+
if (!path.isAbsolute(cwd)) {
|
|
743
|
+
res
|
|
744
|
+
.status(400)
|
|
745
|
+
.json({ error: '`cwd` must be an absolute path when provided' });
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
const modelServiceId = typeof body['modelServiceId'] === 'string'
|
|
749
|
+
? body['modelServiceId']
|
|
750
|
+
: undefined;
|
|
751
|
+
// Per-request `sessionScope` override (#4175 PR 5). Validate at the
|
|
752
|
+
// route boundary so a 400 surfaces a clear `code: invalid_session_scope`
|
|
753
|
+
// before we touch the bridge — the bridge revalidates as a defense
|
|
754
|
+
// against direct callers, but a typed 4xx is the right shape for HTTP
|
|
755
|
+
// clients. The field is OPTIONAL: omitting it preserves pre-PR
|
|
756
|
+
// behavior bit-for-bit (the daemon-wide `BridgeOptions.sessionScope`
|
|
757
|
+
// takes effect). New clients can pre-flight `caps.features` for
|
|
758
|
+
// `session_scope_override` before sending — see
|
|
759
|
+
// `packages/cli/src/serve/capabilities.ts`.
|
|
760
|
+
const rawSessionScope = body['sessionScope'];
|
|
761
|
+
let sessionScope;
|
|
762
|
+
if (rawSessionScope !== undefined) {
|
|
763
|
+
if (rawSessionScope !== 'single' && rawSessionScope !== 'thread') {
|
|
764
|
+
res.status(400).json({
|
|
765
|
+
error: '`sessionScope` must be "single" or "thread" when provided',
|
|
766
|
+
code: 'invalid_session_scope',
|
|
767
|
+
});
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
sessionScope = rawSessionScope;
|
|
771
|
+
}
|
|
772
|
+
const clientId = parseClientIdHeader(req, res);
|
|
773
|
+
if (clientId === null)
|
|
774
|
+
return;
|
|
775
|
+
try {
|
|
776
|
+
const session = await bridge.spawnOrAttach({
|
|
777
|
+
workspaceCwd: cwd,
|
|
778
|
+
modelServiceId,
|
|
779
|
+
...(clientId !== undefined ? { clientId } : {}),
|
|
780
|
+
...(sessionScope !== undefined ? { sessionScope } : {}),
|
|
781
|
+
});
|
|
782
|
+
// Client may have disconnected during the 1–3s spawn window. If
|
|
783
|
+
// so, the response can't be delivered. The session is otherwise
|
|
784
|
+
// orphaned (in `byId` / `defaultEntry` with no client knowing the
|
|
785
|
+
// id), and under churn this leaks one child per aborted request.
|
|
786
|
+
//
|
|
787
|
+
// Detect "can we still write the response?" via `res.writable`,
|
|
788
|
+
// which stays true until the SOCKET destination side closes
|
|
789
|
+
// (the right signal for our case). The legacy `req.aborted`
|
|
790
|
+
// only flips while the request body is still being received,
|
|
791
|
+
// so a client that completed the POST and then closed during
|
|
792
|
+
// the spawn would slip past it. `req.destroyed` is too eager
|
|
793
|
+
// — clients (incl. supertest) close their writable end after
|
|
794
|
+
// sending the body even though they're still listening for the
|
|
795
|
+
// response. `res.writable` is the documented signal for
|
|
796
|
+
// "ServerResponse can still send to client".
|
|
797
|
+
//
|
|
798
|
+
// Combined with `!session.attached` we only reap when WE spawned
|
|
799
|
+
// a fresh child for this request — if another client legitimately
|
|
800
|
+
// attached, killing it would tear out their work mid-flight.
|
|
801
|
+
// The disconnect-without-reap branch also needs to skip
|
|
802
|
+
// `res.json` — writing to a closed socket would throw EPIPE
|
|
803
|
+
// through Express's default error handler.
|
|
804
|
+
if (!res.writable) {
|
|
805
|
+
if (!session.attached) {
|
|
806
|
+
// `requireZeroAttaches: true` closes the BQ9tV race: if
|
|
807
|
+
// a second client called `spawnOrAttach` for the same
|
|
808
|
+
// workspace between our `await` resolving and this reap
|
|
809
|
+
// dispatching, the bridge will see `attachCount > 0` and
|
|
810
|
+
// skip the kill. Without the flag, that second client's
|
|
811
|
+
// session would die mid-prompt.
|
|
812
|
+
bridge
|
|
813
|
+
.killSession(session.sessionId, { requireZeroAttaches: true })
|
|
814
|
+
.catch(() => {
|
|
815
|
+
// Best-effort cleanup; channel.exited will eventually reap.
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
// tanzhenxin issue 2: when an attaching client disconnects
|
|
820
|
+
// before its 200 response can be written, the
|
|
821
|
+
// `attachCount` bump we did inside `spawnOrAttach` is
|
|
822
|
+
// fictitious — there's no live attaching client. Roll the
|
|
823
|
+
// counter back and let the bridge decide whether to reap
|
|
824
|
+
// (it does if attachCount returns to 0 AND no live SSE
|
|
825
|
+
// subscribers). Without this, both-coalesced-callers-
|
|
826
|
+
// disconnect leaves an orphan agent child no client knows
|
|
827
|
+
// the id of.
|
|
828
|
+
bridge.detachClient(session.sessionId, session.clientId).catch(() => {
|
|
829
|
+
// Best-effort cleanup; channel.exited will eventually reap.
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
res.status(200).json(session);
|
|
835
|
+
}
|
|
836
|
+
catch (err) {
|
|
837
|
+
sendBridgeError(res, err, { route: 'POST /session' });
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
const restoreSessionHandler = (action) => async (req, res) => {
|
|
841
|
+
const sessionId = req.params['id'];
|
|
842
|
+
if (!sessionId) {
|
|
843
|
+
res
|
|
844
|
+
.status(400)
|
|
845
|
+
.json({ error: '`sessionId` route parameter is required' });
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
const body = safeBody(req);
|
|
849
|
+
const cwd = parseOptionalWorkspaceCwd(body, boundWorkspace, res);
|
|
850
|
+
if (cwd === undefined)
|
|
851
|
+
return;
|
|
852
|
+
const clientId = parseClientIdHeader(req, res);
|
|
853
|
+
if (clientId === null)
|
|
854
|
+
return;
|
|
855
|
+
try {
|
|
856
|
+
const session = action === 'load'
|
|
857
|
+
? await bridge.loadSession({
|
|
858
|
+
sessionId,
|
|
859
|
+
workspaceCwd: cwd,
|
|
860
|
+
...(clientId !== undefined ? { clientId } : {}),
|
|
861
|
+
})
|
|
862
|
+
: await bridge.resumeSession({
|
|
863
|
+
sessionId,
|
|
864
|
+
workspaceCwd: cwd,
|
|
865
|
+
...(clientId !== undefined ? { clientId } : {}),
|
|
866
|
+
});
|
|
867
|
+
// Mirror the `POST /session` disconnect-cleanup path (see the
|
|
868
|
+
// long comment above the matching `if (!res.writable)` there
|
|
869
|
+
// for the rationale around `res.writable` vs `req.aborted` /
|
|
870
|
+
// `req.destroyed`, plus the BQ9tV `requireZeroAttaches` race
|
|
871
|
+
// and the tanzhenxin attach-rollback case). Restore needs the
|
|
872
|
+
// same cleanup because a client that disconnects during a
|
|
873
|
+
// multi-second `session/load` would otherwise leave a freshly
|
|
874
|
+
// restored session in `byId` with no client holding its id.
|
|
875
|
+
if (!res.writable) {
|
|
876
|
+
if (!session.attached) {
|
|
877
|
+
bridge
|
|
878
|
+
.killSession(session.sessionId, { requireZeroAttaches: true })
|
|
879
|
+
.catch(() => {
|
|
880
|
+
// Best-effort cleanup; channel.exited will eventually reap.
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
else {
|
|
884
|
+
bridge
|
|
885
|
+
.detachClient(session.sessionId, session.clientId)
|
|
886
|
+
.catch(() => {
|
|
887
|
+
// Best-effort cleanup; channel.exited will eventually reap.
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
res.status(200).json(session);
|
|
893
|
+
}
|
|
894
|
+
catch (err) {
|
|
895
|
+
sendBridgeError(res, err, {
|
|
896
|
+
route: `POST /session/:id/${action}`,
|
|
897
|
+
sessionId,
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
app.post('/session/:id/load', mutate(), restoreSessionHandler('load'));
|
|
902
|
+
app.post('/session/:id/resume', mutate(), restoreSessionHandler('resume'));
|
|
903
|
+
app.get('/session/:id/context', async (req, res) => {
|
|
904
|
+
const sessionId = req.params['id'];
|
|
905
|
+
if (!sessionId) {
|
|
906
|
+
res
|
|
907
|
+
.status(400)
|
|
908
|
+
.json({ error: '`sessionId` route parameter is required' });
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
try {
|
|
912
|
+
res.status(200).json(await bridge.getSessionContextStatus(sessionId));
|
|
913
|
+
}
|
|
914
|
+
catch (err) {
|
|
915
|
+
sendBridgeError(res, err, {
|
|
916
|
+
route: 'GET /session/:id/context',
|
|
917
|
+
sessionId,
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
app.get('/session/:id/supported-commands', async (req, res) => {
|
|
922
|
+
const sessionId = req.params['id'];
|
|
923
|
+
if (!sessionId) {
|
|
924
|
+
res
|
|
925
|
+
.status(400)
|
|
926
|
+
.json({ error: '`sessionId` route parameter is required' });
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
try {
|
|
930
|
+
res
|
|
931
|
+
.status(200)
|
|
932
|
+
.json(await bridge.getSessionSupportedCommandsStatus(sessionId));
|
|
933
|
+
}
|
|
934
|
+
catch (err) {
|
|
935
|
+
sendBridgeError(res, err, {
|
|
936
|
+
route: 'GET /session/:id/supported-commands',
|
|
937
|
+
sessionId,
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
app.post('/session/:id/prompt', mutate(), async (req, res) => {
|
|
942
|
+
const sessionId = req.params['id'];
|
|
943
|
+
const body = safeBody(req);
|
|
944
|
+
const prompt = body['prompt'];
|
|
945
|
+
if (!Array.isArray(prompt) || prompt.length === 0) {
|
|
946
|
+
res.status(400).json({
|
|
947
|
+
error: '`prompt` is required and must be a non-empty array of content blocks',
|
|
948
|
+
});
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
if (!prompt.every((item) =>
|
|
952
|
+
// `typeof item === 'object'` is true for arrays too, so an
|
|
953
|
+
// exclude-arrays check is needed to keep the contract
|
|
954
|
+
// ("ACP content block, like {type: 'text', text: '...'}")
|
|
955
|
+
// honest. Without `!Array.isArray(item)`, `prompt: [[]]`
|
|
956
|
+
// passes validation and a confusing 500 surfaces from the
|
|
957
|
+
// ACP SDK layer.
|
|
958
|
+
typeof item === 'object' && item !== null && !Array.isArray(item))) {
|
|
959
|
+
res.status(400).json({
|
|
960
|
+
error: 'each `prompt` element must be an object (content block)',
|
|
961
|
+
});
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
// Propagate HTTP-client disconnect to an ACP cancel notification so
|
|
965
|
+
// the agent winds down promptly and the per-session FIFO doesn't
|
|
966
|
+
// stay blocked on a dead client. Detached after the prompt settles.
|
|
967
|
+
//
|
|
968
|
+
// Use `res.on('close')` (NOT `req.on('close')`) — `IncomingMessage`'s
|
|
969
|
+
// close event fires once the request body has been fully consumed
|
|
970
|
+
// even when the client is still listening for the response, which
|
|
971
|
+
// would cancel every ordinary prompt the moment its upload
|
|
972
|
+
// finished. `ServerResponse`'s close event only fires when the
|
|
973
|
+
// socket goes away. Guard with `!res.writableEnded` so a normal
|
|
974
|
+
// response flush (which also triggers `res.close`) doesn't fire
|
|
975
|
+
// the abort retroactively.
|
|
976
|
+
const abort = new AbortController();
|
|
977
|
+
const onResClose = () => {
|
|
978
|
+
if (!res.writableEnded)
|
|
979
|
+
abort.abort();
|
|
980
|
+
};
|
|
981
|
+
res.once('close', onResClose);
|
|
982
|
+
const clientId = parseClientIdHeader(req, res);
|
|
983
|
+
if (clientId === null) {
|
|
984
|
+
res.off('close', onResClose);
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
try {
|
|
988
|
+
// SECURITY NOTE: this `...(body as object)` passthrough is
|
|
989
|
+
// intentional — the bridge / ACP SDK ignores fields it
|
|
990
|
+
// doesn't recognize (ACP-spec `_meta` etc are forwarded
|
|
991
|
+
// wholesale to the agent, which is the documented behavior).
|
|
992
|
+
// `sessionId` and `prompt` are forced to the route's view to
|
|
993
|
+
// prevent body-spoofing of the routing key. If a future
|
|
994
|
+
// bridge version starts trusting an additional field by name,
|
|
995
|
+
// that field becomes a client-controlled input surface — at
|
|
996
|
+
// that point switch this to an explicit pick. The same
|
|
997
|
+
// pattern repeats on cancel / model below; review them all
|
|
998
|
+
// together when adding new bridge-trusted fields.
|
|
999
|
+
const result = await bridge.sendPrompt(sessionId, {
|
|
1000
|
+
...body,
|
|
1001
|
+
sessionId,
|
|
1002
|
+
prompt,
|
|
1003
|
+
}, abort.signal, clientId !== undefined ? { clientId } : undefined);
|
|
1004
|
+
res.status(200).json(result);
|
|
1005
|
+
}
|
|
1006
|
+
catch (err) {
|
|
1007
|
+
// The HTTP client disconnecting fires the abort path above and
|
|
1008
|
+
// the bridge re-throws as `AbortError`. That's a normal
|
|
1009
|
+
// wind-down, not an error worth a 500 + stderr stack trace.
|
|
1010
|
+
// Drop it silently — the socket is already closed so we can't
|
|
1011
|
+
// send a response anyway, and active clients (e.g. an IDE
|
|
1012
|
+
// plugin scrubbing a stuck prompt) would otherwise spam the
|
|
1013
|
+
// daemon log.
|
|
1014
|
+
//
|
|
1015
|
+
// BX9_k: narrow the swallow to ONLY the case where WE armed
|
|
1016
|
+
// the abort. The earlier blanket `err.name === 'AbortError'`
|
|
1017
|
+
// could also swallow an internal bridge abort (e.g. the child
|
|
1018
|
+
// process aborting a prompt mid-flight) — leaving the client
|
|
1019
|
+
// with no response and no log trace. If `abort.signal.aborted`
|
|
1020
|
+
// is false, the AbortError came from somewhere we didn't
|
|
1021
|
+
// expect → route it through `sendBridgeError` as a real
|
|
1022
|
+
// failure.
|
|
1023
|
+
if (err instanceof DOMException &&
|
|
1024
|
+
err.name === 'AbortError' &&
|
|
1025
|
+
abort.signal.aborted) {
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
sendBridgeError(res, err, {
|
|
1029
|
+
route: 'POST /session/:id/prompt',
|
|
1030
|
+
sessionId,
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
finally {
|
|
1034
|
+
res.off('close', onResClose);
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
app.post('/session/:id/heartbeat', mutate(), (req, res) => {
|
|
1038
|
+
// #4175 PR 9: clients ping the daemon to update last-seen
|
|
1039
|
+
// bookkeeping. Bridge throws `SessionNotFoundError` for unknown
|
|
1040
|
+
// ids and `InvalidClientIdError` when an `X-Qwen-Client-Id`
|
|
1041
|
+
// header is supplied but not registered for this session — both
|
|
1042
|
+
// are routed through `sendBridgeError` so they share the same
|
|
1043
|
+
// typed shape (`404` and `400 invalid_client_id`) the rest of
|
|
1044
|
+
// the routes use.
|
|
1045
|
+
const sessionId = req.params['id'];
|
|
1046
|
+
if (!sessionId) {
|
|
1047
|
+
res
|
|
1048
|
+
.status(400)
|
|
1049
|
+
.json({ error: '`sessionId` route parameter is required' });
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1053
|
+
if (clientId === null)
|
|
1054
|
+
return;
|
|
1055
|
+
try {
|
|
1056
|
+
const result = bridge.recordHeartbeat(sessionId, clientId !== undefined ? { clientId } : undefined);
|
|
1057
|
+
res.status(200).json(result);
|
|
1058
|
+
}
|
|
1059
|
+
catch (err) {
|
|
1060
|
+
sendBridgeError(res, err, {
|
|
1061
|
+
route: 'POST /session/:id/heartbeat',
|
|
1062
|
+
sessionId,
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
app.post('/session/:id/cancel', mutate(), async (req, res) => {
|
|
1067
|
+
const sessionId = req.params['id'];
|
|
1068
|
+
const body = safeBody(req);
|
|
1069
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1070
|
+
if (clientId === null)
|
|
1071
|
+
return;
|
|
1072
|
+
try {
|
|
1073
|
+
await bridge.cancelSession(sessionId, {
|
|
1074
|
+
...body,
|
|
1075
|
+
sessionId,
|
|
1076
|
+
}, clientId !== undefined ? { clientId } : undefined);
|
|
1077
|
+
res.status(204).end();
|
|
1078
|
+
}
|
|
1079
|
+
catch (err) {
|
|
1080
|
+
sendBridgeError(res, err, {
|
|
1081
|
+
route: 'POST /session/:id/cancel',
|
|
1082
|
+
sessionId,
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
app.delete('/session/:id', async (req, res) => {
|
|
1087
|
+
const sessionId = req.params['id'];
|
|
1088
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1089
|
+
if (clientId === null)
|
|
1090
|
+
return;
|
|
1091
|
+
try {
|
|
1092
|
+
await bridge.closeSession(sessionId, clientId !== undefined ? { clientId } : undefined);
|
|
1093
|
+
res.status(204).end();
|
|
1094
|
+
}
|
|
1095
|
+
catch (err) {
|
|
1096
|
+
sendBridgeError(res, err, {
|
|
1097
|
+
route: 'DELETE /session/:id',
|
|
1098
|
+
sessionId,
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
});
|
|
1102
|
+
app.patch('/session/:id/metadata', (req, res) => {
|
|
1103
|
+
const sessionId = req.params['id'];
|
|
1104
|
+
const body = safeBody(req);
|
|
1105
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1106
|
+
if (clientId === null)
|
|
1107
|
+
return;
|
|
1108
|
+
const displayName = body['displayName'];
|
|
1109
|
+
if (displayName !== undefined && typeof displayName !== 'string') {
|
|
1110
|
+
res.status(400).json({
|
|
1111
|
+
error: '`displayName` must be a string',
|
|
1112
|
+
code: 'invalid_metadata',
|
|
1113
|
+
field: 'displayName',
|
|
1114
|
+
});
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
try {
|
|
1118
|
+
const effective = bridge.updateSessionMetadata(sessionId, { displayName }, clientId !== undefined ? { clientId } : undefined);
|
|
1119
|
+
res.status(200).json({ sessionId, ...effective });
|
|
1120
|
+
}
|
|
1121
|
+
catch (err) {
|
|
1122
|
+
sendBridgeError(res, err, {
|
|
1123
|
+
route: 'PATCH /session/:id/metadata',
|
|
1124
|
+
sessionId,
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
app.get('/workspace/:id/sessions', (req, res) => {
|
|
1129
|
+
// Express decodes URL-encoded path params automatically; clients pass
|
|
1130
|
+
// the absolute workspace cwd encoded (e.g.
|
|
1131
|
+
// GET /workspace/%2Fwork%2Fa/sessions).
|
|
1132
|
+
const workspaceCwd = req.params['id'] ?? '';
|
|
1133
|
+
if (!path.isAbsolute(workspaceCwd)) {
|
|
1134
|
+
res
|
|
1135
|
+
.status(400)
|
|
1136
|
+
.json({ error: '`:id` must decode to an absolute workspace path' });
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
// #3803 §02: reject cross-workspace queries so orchestrators
|
|
1140
|
+
// don't mistake "no sessions here" for "workspace is idle".
|
|
1141
|
+
const key = canonicalizeWorkspace(workspaceCwd);
|
|
1142
|
+
if (key !== boundWorkspace) {
|
|
1143
|
+
res.status(400).json({
|
|
1144
|
+
error: `Workspace mismatch: daemon is bound to "${boundWorkspace}"`,
|
|
1145
|
+
code: 'workspace_mismatch',
|
|
1146
|
+
boundWorkspace,
|
|
1147
|
+
requestedWorkspace: key,
|
|
1148
|
+
});
|
|
1149
|
+
return;
|
|
1150
|
+
}
|
|
1151
|
+
const sessions = bridge.listWorkspaceSessions(workspaceCwd);
|
|
1152
|
+
res.status(200).json({ sessions });
|
|
1153
|
+
});
|
|
1154
|
+
app.post('/session/:id/model', mutate(), async (req, res) => {
|
|
1155
|
+
const sessionId = req.params['id'];
|
|
1156
|
+
const body = safeBody(req);
|
|
1157
|
+
const modelId = body['modelId'];
|
|
1158
|
+
if (typeof modelId !== 'string' || !modelId) {
|
|
1159
|
+
res.status(400).json({
|
|
1160
|
+
error: '`modelId` is required and must be a non-empty string',
|
|
1161
|
+
});
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1165
|
+
if (clientId === null)
|
|
1166
|
+
return;
|
|
1167
|
+
try {
|
|
1168
|
+
const response = await bridge.setSessionModel(sessionId, {
|
|
1169
|
+
...body,
|
|
1170
|
+
sessionId,
|
|
1171
|
+
modelId,
|
|
1172
|
+
}, clientId !== undefined ? { clientId } : undefined);
|
|
1173
|
+
res.status(200).json(response);
|
|
1174
|
+
}
|
|
1175
|
+
catch (err) {
|
|
1176
|
+
sendBridgeError(res, err, {
|
|
1177
|
+
route: 'POST /session/:id/model',
|
|
1178
|
+
sessionId,
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
app.post('/session/:id/approval-mode', mutate({ strict: true }), async (req, res) => {
|
|
1183
|
+
// #4175 Wave 4 PR 17 — first strict-gated session mutation
|
|
1184
|
+
// surface after PR 14 v1. Validates `mode` against the closed
|
|
1185
|
+
// `APPROVAL_MODES` enum and an optional `persist: boolean` flag.
|
|
1186
|
+
// The bridge applies the change inside the ACP child's per-session
|
|
1187
|
+
// `Config` and (when `persist: true`) writes `tools.approvalMode`
|
|
1188
|
+
// to workspace settings via the `persistApprovalMode` hook wired
|
|
1189
|
+
// in `runQwenServe.ts`.
|
|
1190
|
+
const sessionId = req.params['id'];
|
|
1191
|
+
const body = safeBody(req);
|
|
1192
|
+
const mode = body['mode'];
|
|
1193
|
+
const persist = body['persist'];
|
|
1194
|
+
if (typeof mode !== 'string' ||
|
|
1195
|
+
!APPROVAL_MODES.includes(mode)) {
|
|
1196
|
+
res.status(400).json({
|
|
1197
|
+
error: '`mode` is required and must be one of the allowed values',
|
|
1198
|
+
code: 'invalid_approval_mode',
|
|
1199
|
+
allowed: APPROVAL_MODES,
|
|
1200
|
+
});
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
if (persist !== undefined && typeof persist !== 'boolean') {
|
|
1204
|
+
res.status(400).json({
|
|
1205
|
+
error: '`persist` must be a boolean when provided',
|
|
1206
|
+
code: 'invalid_persist_flag',
|
|
1207
|
+
});
|
|
1208
|
+
return;
|
|
1209
|
+
}
|
|
1210
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1211
|
+
if (clientId === null)
|
|
1212
|
+
return;
|
|
1213
|
+
try {
|
|
1214
|
+
const response = await bridge.setSessionApprovalMode(sessionId, mode, { persist: persist === true }, clientId !== undefined ? { clientId } : undefined);
|
|
1215
|
+
res.status(200).json(response);
|
|
1216
|
+
}
|
|
1217
|
+
catch (err) {
|
|
1218
|
+
sendBridgeError(res, err, {
|
|
1219
|
+
route: 'POST /session/:id/approval-mode',
|
|
1220
|
+
sessionId,
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
app.post('/workspace/mcp/:server/restart', mutate({ strict: true }), async (req, res) => {
|
|
1225
|
+
// #4175 Wave 4 PR 17. Forwards through the ACP child's
|
|
1226
|
+
// `McpClientManager.discoverMcpToolsForServer` after a budget
|
|
1227
|
+
// pre-check on PR 14 v1's accounting. Soft refusals are 200 OK
|
|
1228
|
+
// with `{restarted:false, skipped:true, reason}`; unknown server
|
|
1229
|
+
// names or no live ACP channel are hard errors mapped to 4xx/5xx
|
|
1230
|
+
// via sendBridgeError.
|
|
1231
|
+
const serverName = req.params['server'];
|
|
1232
|
+
if (!serverName || typeof serverName !== 'string') {
|
|
1233
|
+
res.status(400).json({
|
|
1234
|
+
error: 'Server name path parameter is required',
|
|
1235
|
+
code: 'invalid_server_name',
|
|
1236
|
+
});
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
// #4282 fold-in 4 (qwen-latest S1): match the
|
|
1240
|
+
// `MAX_TOOL_NAME_LENGTH` cap so the server name (which propagates
|
|
1241
|
+
// into SSE event bodies, ACP messages, and error responses) can't
|
|
1242
|
+
// be used to bloat any of those surfaces with an unbounded
|
|
1243
|
+
// path-parameter input.
|
|
1244
|
+
if (serverName.length > MAX_SERVER_NAME_LENGTH) {
|
|
1245
|
+
res.status(400).json({
|
|
1246
|
+
error: `Server name exceeds ${MAX_SERVER_NAME_LENGTH}-character limit`,
|
|
1247
|
+
code: 'invalid_server_name',
|
|
1248
|
+
});
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
// #4282 fold-in 1 (gpt-5.5 C2): validate `X-Qwen-Client-Id`
|
|
1252
|
+
// against `bridge.knownClientIds()` so the originator stamped
|
|
1253
|
+
// onto `mcp_server_restart*` events is grounded in a known
|
|
1254
|
+
// identity rather than a forged header.
|
|
1255
|
+
const clientId = parseAndValidateWorkspaceClientId(req, res, bridge);
|
|
1256
|
+
if (clientId === null)
|
|
1257
|
+
return;
|
|
1258
|
+
try {
|
|
1259
|
+
const result = await bridge.restartMcpServer(serverName, clientId);
|
|
1260
|
+
res.status(200).json(result);
|
|
1261
|
+
}
|
|
1262
|
+
catch (err) {
|
|
1263
|
+
sendBridgeError(res, err, {
|
|
1264
|
+
route: 'POST /workspace/mcp/:server/restart',
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
app.post('/workspace/init', mutate({ strict: true }), async (req, res) => {
|
|
1269
|
+
// #4175 Wave 4 PR 17. Scaffold-only init: the bridge writes an
|
|
1270
|
+
// empty QWEN.md without invoking the LLM. Default refuses
|
|
1271
|
+
// overwrite (409); body `{force: true}` overrides.
|
|
1272
|
+
const body = safeBody(req);
|
|
1273
|
+
const force = body['force'];
|
|
1274
|
+
if (force !== undefined && typeof force !== 'boolean') {
|
|
1275
|
+
res.status(400).json({
|
|
1276
|
+
error: '`force` must be a boolean when provided',
|
|
1277
|
+
code: 'invalid_force_flag',
|
|
1278
|
+
});
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
// #4282 fold-in 1 (gpt-5.5 C2): validate against known client ids.
|
|
1282
|
+
const clientId = parseAndValidateWorkspaceClientId(req, res, bridge);
|
|
1283
|
+
if (clientId === null)
|
|
1284
|
+
return;
|
|
1285
|
+
try {
|
|
1286
|
+
const result = await bridge.initWorkspace({ force: force === true }, clientId);
|
|
1287
|
+
res.status(200).json(result);
|
|
1288
|
+
}
|
|
1289
|
+
catch (err) {
|
|
1290
|
+
sendBridgeError(res, err, { route: 'POST /workspace/init' });
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
app.post('/workspace/tools/:name/enable', mutate({ strict: true }), async (req, res) => {
|
|
1294
|
+
// #4175 Wave 4 PR 17. Toggles a tool name in the workspace
|
|
1295
|
+
// `tools.disabled` settings list. Strict-gated alongside other
|
|
1296
|
+
// Wave 4 mutation routes; bridge writes the file directly (no
|
|
1297
|
+
// ACP roundtrip) and fan-outs `tool_toggled` to every live
|
|
1298
|
+
// session SSE bus. Already-registered tools in live sessions
|
|
1299
|
+
// are NOT retroactively unregistered — toggling takes effect on
|
|
1300
|
+
// the next ACP child spawn or session refresh.
|
|
1301
|
+
const rawToolName = req.params['name'];
|
|
1302
|
+
if (!rawToolName || typeof rawToolName !== 'string') {
|
|
1303
|
+
res.status(400).json({
|
|
1304
|
+
error: 'Tool name path parameter is required',
|
|
1305
|
+
code: 'invalid_tool_name',
|
|
1306
|
+
});
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
// #4282 fold-in 4 (qwen-latest C3): trim before persistence so the
|
|
1310
|
+
// write path matches the read path. `loadCliConfig` applies
|
|
1311
|
+
// `.trim()` when consuming `tools.disabled` at child spawn, so a
|
|
1312
|
+
// leading/trailing space stored verbatim would never round-trip:
|
|
1313
|
+
// disable would persist `" Bash "`, the spawn would key on
|
|
1314
|
+
// `"Bash"`, and a re-enable for `"Bash"` would leave the original
|
|
1315
|
+
// entry permanently stuck.
|
|
1316
|
+
const toolName = rawToolName.trim();
|
|
1317
|
+
if (toolName.length === 0) {
|
|
1318
|
+
res.status(400).json({
|
|
1319
|
+
error: 'Tool name path parameter is required',
|
|
1320
|
+
code: 'invalid_tool_name',
|
|
1321
|
+
});
|
|
1322
|
+
return;
|
|
1323
|
+
}
|
|
1324
|
+
// #4282 fold-in 2 (deepseek SV1): cap the tool name length so
|
|
1325
|
+
// an extremely long path parameter can't bloat the workspace
|
|
1326
|
+
// settings file. Sized at 256 to comfortably accommodate the
|
|
1327
|
+
// longest legitimate MCP qualified names
|
|
1328
|
+
// (`mcp__<server>__<tool>`) while staying well under any
|
|
1329
|
+
// settings-file pathological-input concern. Mirrors the
|
|
1330
|
+
// explicit caps on `cwd` (`MAX_WORKSPACE_PATH_LENGTH`) and
|
|
1331
|
+
// `X-Qwen-Client-Id` (`MAX_CLIENT_ID_LENGTH`).
|
|
1332
|
+
if (toolName.length > MAX_TOOL_NAME_LENGTH) {
|
|
1333
|
+
res.status(400).json({
|
|
1334
|
+
error: `Tool name exceeds ${MAX_TOOL_NAME_LENGTH}-character limit`,
|
|
1335
|
+
code: 'invalid_tool_name',
|
|
1336
|
+
});
|
|
1337
|
+
return;
|
|
1338
|
+
}
|
|
1339
|
+
const body = safeBody(req);
|
|
1340
|
+
const enabled = body['enabled'];
|
|
1341
|
+
if (typeof enabled !== 'boolean') {
|
|
1342
|
+
res.status(400).json({
|
|
1343
|
+
error: '`enabled` is required and must be a boolean',
|
|
1344
|
+
code: 'invalid_enabled_flag',
|
|
1345
|
+
});
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
// #4282 fold-in 1 (gpt-5.5 C2): validate against known client ids.
|
|
1349
|
+
const clientId = parseAndValidateWorkspaceClientId(req, res, bridge);
|
|
1350
|
+
if (clientId === null)
|
|
1351
|
+
return;
|
|
1352
|
+
try {
|
|
1353
|
+
const result = await bridge.setWorkspaceToolEnabled(toolName, enabled, clientId);
|
|
1354
|
+
res.status(200).json(result);
|
|
1355
|
+
}
|
|
1356
|
+
catch (err) {
|
|
1357
|
+
sendBridgeError(res, err, {
|
|
1358
|
+
route: 'POST /workspace/tools/:name/enable',
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
app.post('/session/:id/permission/:requestId', mutate(), (req, res) => {
|
|
1363
|
+
const sessionId = req.params['id'];
|
|
1364
|
+
const requestId = req.params['requestId'];
|
|
1365
|
+
const response = parsePermissionVoteBody(req, res);
|
|
1366
|
+
if (response === undefined)
|
|
1367
|
+
return;
|
|
1368
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1369
|
+
if (clientId === null)
|
|
1370
|
+
return;
|
|
1371
|
+
let accepted;
|
|
1372
|
+
try {
|
|
1373
|
+
accepted = bridge.respondToSessionPermission(sessionId, requestId, response, clientId !== undefined ? { clientId } : undefined);
|
|
1374
|
+
}
|
|
1375
|
+
catch (err) {
|
|
1376
|
+
sendPermissionVoteError(res, err, {
|
|
1377
|
+
route: 'POST /session/:id/permission/:requestId',
|
|
1378
|
+
sessionId,
|
|
1379
|
+
});
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
if (!accepted) {
|
|
1383
|
+
res.status(404).json({
|
|
1384
|
+
error: 'No pending permission request for session',
|
|
1385
|
+
sessionId,
|
|
1386
|
+
requestId,
|
|
1387
|
+
});
|
|
1388
|
+
return;
|
|
1389
|
+
}
|
|
1390
|
+
res.status(200).json({});
|
|
1391
|
+
});
|
|
1392
|
+
app.post('/permission/:requestId', mutate(), (req, res) => {
|
|
1393
|
+
const requestId = req.params['requestId'];
|
|
1394
|
+
const response = parsePermissionVoteBody(req, res);
|
|
1395
|
+
if (response === undefined)
|
|
1396
|
+
return;
|
|
1397
|
+
const clientId = parseClientIdHeader(req, res);
|
|
1398
|
+
if (clientId === null)
|
|
1399
|
+
return;
|
|
1400
|
+
let accepted;
|
|
1401
|
+
try {
|
|
1402
|
+
accepted = bridge.respondToPermission(requestId, response, clientId !== undefined ? { clientId } : undefined);
|
|
1403
|
+
}
|
|
1404
|
+
catch (err) {
|
|
1405
|
+
sendPermissionVoteError(res, err, {
|
|
1406
|
+
route: 'POST /permission/:requestId',
|
|
1407
|
+
});
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1410
|
+
if (!accepted) {
|
|
1411
|
+
// Either the requestId never existed or another client already won
|
|
1412
|
+
// the race. Stage 1 doesn't distinguish — both surface as 404.
|
|
1413
|
+
res
|
|
1414
|
+
.status(404)
|
|
1415
|
+
.json({ error: 'No pending permission request', requestId });
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
res.status(200).json({});
|
|
1419
|
+
});
|
|
1420
|
+
app.get('/session/:id/events', (req, res) => {
|
|
1421
|
+
const sessionId = req.params['id'];
|
|
1422
|
+
const lastEventId = parseLastEventId(req.headers['last-event-id']);
|
|
1423
|
+
const maxQueued = parseMaxQueuedQuery(req.query['maxQueued'], res);
|
|
1424
|
+
// `parseMaxQueuedQuery` sends its own 400 + JSON body on rejection
|
|
1425
|
+
// (returns `null`) so the SSE handshake doesn't get half-written.
|
|
1426
|
+
// `undefined` means "client didn't ask for an override; use bus
|
|
1427
|
+
// default 256" — proceed as before.
|
|
1428
|
+
if (maxQueued === null)
|
|
1429
|
+
return;
|
|
1430
|
+
let iter;
|
|
1431
|
+
const abort = new AbortController();
|
|
1432
|
+
try {
|
|
1433
|
+
const iterable = bridge.subscribeEvents(sessionId, {
|
|
1434
|
+
signal: abort.signal,
|
|
1435
|
+
lastEventId,
|
|
1436
|
+
...(maxQueued !== undefined ? { maxQueued } : {}),
|
|
1437
|
+
});
|
|
1438
|
+
iter = iterable[Symbol.asyncIterator]();
|
|
1439
|
+
}
|
|
1440
|
+
catch (err) {
|
|
1441
|
+
// `EventBus` throws `SubscriberLimitExceededError` when the
|
|
1442
|
+
// per-session subscriber cap (default 64) is reached.
|
|
1443
|
+
//
|
|
1444
|
+
// Bd1zJ: surface as `429 Too Many Requests` + `Retry-After`
|
|
1445
|
+
// header rather than `200 + stream_error`. The previous
|
|
1446
|
+
// SSE-shaped response triggered `EventSource`'s
|
|
1447
|
+
// auto-reconnect (which honors the `retry:` directive AND
|
|
1448
|
+
// default-reconnects on any closed stream). The reconnect hit
|
|
1449
|
+
// the same cap, looped, amplifying the exact load the limit
|
|
1450
|
+
// exists to prevent.
|
|
1451
|
+
//
|
|
1452
|
+
// `429` is the standard "back off" signal — browsers'
|
|
1453
|
+
// `EventSource` treats `4xx` as terminal and does NOT
|
|
1454
|
+
// auto-reconnect on it, unlike `200 + close` which DOES
|
|
1455
|
+
// reconnect. Body shape mirrors the SSE frame's data field so
|
|
1456
|
+
// a raw-fetch client gets the same structured error.
|
|
1457
|
+
if (err instanceof SubscriberLimitExceededError) {
|
|
1458
|
+
writeStderrLine(`qwen serve: subscriber limit reached for session ${sessionId} (limit=${err.limit}); rejecting new SSE client with 429`);
|
|
1459
|
+
res.setHeader('Retry-After', '5');
|
|
1460
|
+
res.status(429).json({
|
|
1461
|
+
error: err.message,
|
|
1462
|
+
code: 'subscriber_limit_exceeded',
|
|
1463
|
+
limit: err.limit,
|
|
1464
|
+
});
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
sendBridgeError(res, err, {
|
|
1468
|
+
route: 'GET /session/:id/events',
|
|
1469
|
+
sessionId,
|
|
1470
|
+
});
|
|
1471
|
+
return;
|
|
1472
|
+
}
|
|
1473
|
+
res.status(200);
|
|
1474
|
+
res.setHeader('Content-Type', 'text/event-stream');
|
|
1475
|
+
res.setHeader('Cache-Control', 'no-cache, no-transform');
|
|
1476
|
+
res.setHeader('Connection', 'keep-alive');
|
|
1477
|
+
// Disable proxy buffering (nginx); event-stream content type alone
|
|
1478
|
+
// doesn't always reach the client through every proxy.
|
|
1479
|
+
res.setHeader('X-Accel-Buffering', 'no');
|
|
1480
|
+
// Always present on the supported Node versions (engines.node >=22).
|
|
1481
|
+
res.flushHeaders();
|
|
1482
|
+
// Backpressure helper: `res.write` returns false when the kernel send
|
|
1483
|
+
// buffer is full. Without awaiting `drain` Node accumulates the
|
|
1484
|
+
// payload in user-space memory unboundedly — a slow consumer on a
|
|
1485
|
+
// chatty session can balloon daemon RSS. Wait for `drain` (or
|
|
1486
|
+
// close/error) before scheduling the next write.
|
|
1487
|
+
//
|
|
1488
|
+
// Concurrency: serialize ALL writes through a per-connection chain
|
|
1489
|
+
// so the heartbeat (fire-and-forget interval, see below) can't
|
|
1490
|
+
// interleave with the main event-write loop. Without serialization,
|
|
1491
|
+
// the heartbeat firing while the main loop is mid-`drain` await
|
|
1492
|
+
// would issue a second `res.write()` that bypasses the
|
|
1493
|
+
// backpressure guard — and could even interleave bytes between two
|
|
1494
|
+
// SSE frames on the wire. The chain is single-flight: each call
|
|
1495
|
+
// waits for the previous write to settle before scheduling its own.
|
|
1496
|
+
let writeChain = Promise.resolve();
|
|
1497
|
+
const doWrite = (chunk) => new Promise((resolve, reject) => {
|
|
1498
|
+
if (res.writableEnded) {
|
|
1499
|
+
resolve();
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
// `res.write` can throw synchronously when the socket is
|
|
1503
|
+
// already destroyed (typical EPIPE shape). Wrap in try/catch
|
|
1504
|
+
// so that surfaces as a rejection on this promise instead of
|
|
1505
|
+
// escaping the executor and turning into an unhandled
|
|
1506
|
+
// exception. Async failures still arrive via the `'error'`
|
|
1507
|
+
// event handler below — Node's Writable.write callback isn't
|
|
1508
|
+
// documented to receive an error argument (errors come on
|
|
1509
|
+
// the event), so we don't rely on it.
|
|
1510
|
+
let ok;
|
|
1511
|
+
try {
|
|
1512
|
+
ok = res.write(chunk);
|
|
1513
|
+
}
|
|
1514
|
+
catch (err) {
|
|
1515
|
+
reject(err);
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
if (ok) {
|
|
1519
|
+
resolve();
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
const onDrain = () => {
|
|
1523
|
+
res.off('close', onClose);
|
|
1524
|
+
res.off('error', onError);
|
|
1525
|
+
resolve();
|
|
1526
|
+
};
|
|
1527
|
+
const onClose = () => {
|
|
1528
|
+
res.off('drain', onDrain);
|
|
1529
|
+
res.off('error', onError);
|
|
1530
|
+
resolve();
|
|
1531
|
+
};
|
|
1532
|
+
const onError = (err) => {
|
|
1533
|
+
res.off('drain', onDrain);
|
|
1534
|
+
res.off('close', onClose);
|
|
1535
|
+
reject(err);
|
|
1536
|
+
};
|
|
1537
|
+
res.once('drain', onDrain);
|
|
1538
|
+
res.once('close', onClose);
|
|
1539
|
+
res.once('error', onError);
|
|
1540
|
+
});
|
|
1541
|
+
const writeWithBackpressure = (chunk) => {
|
|
1542
|
+
const next = writeChain.then(() => doWrite(chunk));
|
|
1543
|
+
// Tail-swallow rejections on the chain itself so a single failed
|
|
1544
|
+
// write doesn't poison every subsequent call. The CALLER's
|
|
1545
|
+
// returned promise still rejects — chain-internal failures are
|
|
1546
|
+
// someone else's problem, not blockers for queueing.
|
|
1547
|
+
writeChain = next.catch(() => undefined);
|
|
1548
|
+
return next;
|
|
1549
|
+
};
|
|
1550
|
+
// Tell EventSource to retry after 3s on disconnect. Awaiting drain on
|
|
1551
|
+
// the very first write is overkill but cheap — `ok` is true the
|
|
1552
|
+
// overwhelming majority of the time. Always swallow rejection: a
|
|
1553
|
+
// socket that errors before the very first write would otherwise
|
|
1554
|
+
// surface as an unhandled promise rejection (the `res.on('error')`
|
|
1555
|
+
// hook below is what we actually rely on for cleanup).
|
|
1556
|
+
void writeWithBackpressure('retry: 3000\n\n').catch(() => { });
|
|
1557
|
+
// Heartbeat keeps NAT/proxy connections alive and lets the server
|
|
1558
|
+
// notice a dead client through write-back-pressure. Comment frame is
|
|
1559
|
+
// ignored by EventSource.
|
|
1560
|
+
//
|
|
1561
|
+
// KNOWN GAP: this only catches dead connections via write
|
|
1562
|
+
// back-pressure on heartbeat itself. A network partition without TCP
|
|
1563
|
+
// RST can leave the connection looking alive (no FIN received) for
|
|
1564
|
+
// however long Node's keepalive probes take to time out — usually
|
|
1565
|
+
// ~2 hours by default, configurable via `server.keepAliveTimeout`.
|
|
1566
|
+
// Stage 2 may add an explicit application-level idle timeout
|
|
1567
|
+
// (last-byte-written tracking + per-connection deadline).
|
|
1568
|
+
const heartbeatTimer = setInterval(() => {
|
|
1569
|
+
if (!res.writableEnded) {
|
|
1570
|
+
// Heartbeat writes are best-effort; failure swallowed via the
|
|
1571
|
+
// `res.on('error')` hook below.
|
|
1572
|
+
void writeWithBackpressure(': heartbeat\n\n').catch(() => { });
|
|
1573
|
+
}
|
|
1574
|
+
}, 15_000);
|
|
1575
|
+
heartbeatTimer.unref();
|
|
1576
|
+
const cleanup = () => {
|
|
1577
|
+
clearInterval(heartbeatTimer);
|
|
1578
|
+
abort.abort();
|
|
1579
|
+
};
|
|
1580
|
+
req.on('close', cleanup);
|
|
1581
|
+
// Swallow socket-level write errors. When the underlying TCP connection
|
|
1582
|
+
// dies (RST, mid-flight kill -9), the next `res.write` throws EPIPE.
|
|
1583
|
+
// Without an `error` listener Express forwards it to its default error
|
|
1584
|
+
// handler which logs noisily. The req.on('close') path above is what we
|
|
1585
|
+
// actually rely on to tear down the subscription; this listener just
|
|
1586
|
+
// suppresses the noise + ensures cleanup runs even if for some reason
|
|
1587
|
+
// the close event doesn't fire first.
|
|
1588
|
+
res.on('error', (err) => {
|
|
1589
|
+
// Without this log the daemon side is blind to SSE disconnects
|
|
1590
|
+
// (RST, mid-flight kill -9, network blip). Cleanup still runs —
|
|
1591
|
+
// the listener exists primarily so Node doesn't crash on EPIPE
|
|
1592
|
+
// — but operators get a breadcrumb when chasing flaky clients.
|
|
1593
|
+
writeStderrLine(`qwen serve: SSE socket error (session ${sessionId}): ${err.message}`);
|
|
1594
|
+
cleanup();
|
|
1595
|
+
});
|
|
1596
|
+
void (async () => {
|
|
1597
|
+
try {
|
|
1598
|
+
while (true) {
|
|
1599
|
+
const next = await iter.next();
|
|
1600
|
+
if (next.done)
|
|
1601
|
+
break;
|
|
1602
|
+
if (res.writableEnded)
|
|
1603
|
+
break;
|
|
1604
|
+
await writeWithBackpressure(formatSseFrame(next.value));
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
catch (err) {
|
|
1608
|
+
if (!res.writableEnded) {
|
|
1609
|
+
// Don't burn an `id:` slot — `stream_error` is a terminal frame
|
|
1610
|
+
// emitted on the daemon side when the bridge iterator throws, so
|
|
1611
|
+
// it has no place in the per-session monotonic sequence and a
|
|
1612
|
+
// hard-coded `id: 0` would regress the client's `Last-Event-ID`
|
|
1613
|
+
// tracker. `formatSseFrame` omits the `id:` line when the input
|
|
1614
|
+
// event has no id.
|
|
1615
|
+
await writeWithBackpressure(formatSseFrame({
|
|
1616
|
+
v: 1,
|
|
1617
|
+
type: 'stream_error',
|
|
1618
|
+
data: { error: errorMessage(err) },
|
|
1619
|
+
})).catch(() => { });
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
finally {
|
|
1623
|
+
cleanup();
|
|
1624
|
+
if (!res.writableEnded)
|
|
1625
|
+
res.end();
|
|
1626
|
+
}
|
|
1627
|
+
})();
|
|
1628
|
+
});
|
|
1629
|
+
// Final error handler. `express.json()` throws `SyntaxError` (with
|
|
1630
|
+
// `status: 400`) on malformed body — without this 4-arg middleware
|
|
1631
|
+
// Express renders an HTML error page, which trips SDK clients that
|
|
1632
|
+
// expect a JSON body on every response. Anything else bubbling out
|
|
1633
|
+
// is a programmer error; log it and return a JSON 500 (matches the
|
|
1634
|
+
// route-level `sendBridgeError` shape so clients have one error
|
|
1635
|
+
// contract to parse).
|
|
1636
|
+
app.use((err, _req, res, _next) => {
|
|
1637
|
+
if (err instanceof SyntaxError &&
|
|
1638
|
+
'status' in err &&
|
|
1639
|
+
err.status === 400) {
|
|
1640
|
+
res.status(400).json({ error: 'Invalid JSON in request body' });
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
// body-parser raises a typed error with `status: 413` when a
|
|
1644
|
+
// request body exceeds the `express.json({ limit: '10mb' })`
|
|
1645
|
+
// ceiling. Without this branch it falls through to the 500 path
|
|
1646
|
+
// and clients see a misleading "Internal server error" instead
|
|
1647
|
+
// of a clear "payload too large" — which is the kind of error
|
|
1648
|
+
// they can actually act on (chunk the request, raise the limit).
|
|
1649
|
+
if (err &&
|
|
1650
|
+
typeof err === 'object' &&
|
|
1651
|
+
'status' in err &&
|
|
1652
|
+
err.status === 413) {
|
|
1653
|
+
res.status(413).json({ error: 'Request body too large (max 10 MB)' });
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
writeStderrLine(`qwen serve: unhandled error: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`);
|
|
1657
|
+
if (!res.headersSent) {
|
|
1658
|
+
res.status(500).json({ error: 'Internal server error' });
|
|
1659
|
+
}
|
|
1660
|
+
});
|
|
1661
|
+
return app;
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Keys stripped by `safeBody` to defend against prototype-pollution
|
|
1665
|
+
* — see BZ9uv/va/vs/wD/Bd1zz. Routes downstream of `safeBody` spread
|
|
1666
|
+
* the filtered result into objects passed to the bridge / ACP SDK;
|
|
1667
|
+
* without this scrub a client could set
|
|
1668
|
+
* `{"__proto__": {"polluted": true}}` and pollute
|
|
1669
|
+
* `Object.prototype` via downstream spreads.
|
|
1670
|
+
*
|
|
1671
|
+
* **Cross-reference for route maintainers:** the POST `/session`
|
|
1672
|
+
* route distinguishes "absent" from "present" via `'cwd' in body`
|
|
1673
|
+
* against `safeBody`'s output. The semantics rely on this set NOT
|
|
1674
|
+
* overlapping with user-payload keys. If you ever add a key here
|
|
1675
|
+
* that a route's presence-check cares about (highly unlikely — this
|
|
1676
|
+
* set is the JS prototype-attack triple, plus a route would have
|
|
1677
|
+
* to deliberately name a property after one of these), the
|
|
1678
|
+
* presence-check needs to move to the pre-`safeBody` `req.body`
|
|
1679
|
+
* (with its own pollution guard) or `safeBody` needs to return a
|
|
1680
|
+
* separate "raw-keys" set alongside the filtered object.
|
|
1681
|
+
*/
|
|
1682
|
+
const PROTOTYPE_POLLUTION_KEYS = new Set([
|
|
1683
|
+
'__proto__',
|
|
1684
|
+
'constructor',
|
|
1685
|
+
'prototype',
|
|
1686
|
+
]);
|
|
1687
|
+
const CLIENT_ID_HEADER = 'x-qwen-client-id';
|
|
1688
|
+
const MAX_CLIENT_ID_LENGTH = 128;
|
|
1689
|
+
/** #4282 fold-in 2 (deepseek SV1) — see /workspace/tools/:name/enable. */
|
|
1690
|
+
const MAX_TOOL_NAME_LENGTH = 256;
|
|
1691
|
+
/** #4282 fold-in 4 (qwen-latest S1) — see /workspace/mcp/:server/restart. */
|
|
1692
|
+
const MAX_SERVER_NAME_LENGTH = 256;
|
|
1693
|
+
const CLIENT_ID_RE = /^[A-Za-z0-9._:-]+$/;
|
|
1694
|
+
const INVALID_PERMISSION_OUTCOME_ERROR = '`outcome` must be `{ outcome: "cancelled" }` or `{ outcome: "selected", optionId: string }`';
|
|
1695
|
+
/**
|
|
1696
|
+
* Coerce `req.body` into a safe `Record<string, unknown>` for route
|
|
1697
|
+
* handlers. Replaces the 5-site copy-pasted preamble
|
|
1698
|
+
* `typeof req.body === 'object' && req.body !== null ? ... : {}`
|
|
1699
|
+
* (Bd10m).
|
|
1700
|
+
*
|
|
1701
|
+
* Strips the `PROTOTYPE_POLLUTION_KEYS` set before returning. Uses an
|
|
1702
|
+
* `Object.create(null)` target so the returned object itself has no
|
|
1703
|
+
* prototype either, blocking second-order spread-into-default-
|
|
1704
|
+
* prototype attacks.
|
|
1705
|
+
*/
|
|
1706
|
+
function safeBody(req) {
|
|
1707
|
+
const raw = req.body;
|
|
1708
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
|
|
1709
|
+
return Object.create(null);
|
|
1710
|
+
}
|
|
1711
|
+
const out = Object.create(null);
|
|
1712
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
1713
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key))
|
|
1714
|
+
continue;
|
|
1715
|
+
out[key] = value;
|
|
1716
|
+
}
|
|
1717
|
+
return out;
|
|
1718
|
+
}
|
|
1719
|
+
function parseOptionalWorkspaceCwd(body, boundWorkspace, res) {
|
|
1720
|
+
const hasCwd = 'cwd' in body;
|
|
1721
|
+
if (hasCwd && typeof body['cwd'] !== 'string') {
|
|
1722
|
+
res
|
|
1723
|
+
.status(400)
|
|
1724
|
+
.json({ error: '`cwd` must be a string absolute path when provided' });
|
|
1725
|
+
return undefined;
|
|
1726
|
+
}
|
|
1727
|
+
if (hasCwd && body['cwd'].length > MAX_WORKSPACE_PATH_LENGTH) {
|
|
1728
|
+
res.status(400).json({
|
|
1729
|
+
error: `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
|
|
1730
|
+
});
|
|
1731
|
+
return undefined;
|
|
1732
|
+
}
|
|
1733
|
+
const cwd = hasCwd ? body['cwd'] : boundWorkspace;
|
|
1734
|
+
if (!path.isAbsolute(cwd)) {
|
|
1735
|
+
res
|
|
1736
|
+
.status(400)
|
|
1737
|
+
.json({ error: '`cwd` must be an absolute path when provided' });
|
|
1738
|
+
return undefined;
|
|
1739
|
+
}
|
|
1740
|
+
return cwd;
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* PR 21 — translate the registry's redacted `DeviceFlowPublicView` into
|
|
1744
|
+
* the wire shape declared by `DaemonDeviceFlowStartResult`. Splitting
|
|
1745
|
+
* "start response" from "state body" preserves the `attached` field
|
|
1746
|
+
* the start route needs without polluting the GET shape.
|
|
1747
|
+
*/
|
|
1748
|
+
function toDeviceFlowStartResponseBody(view, attached, callerClientId) {
|
|
1749
|
+
const body = {
|
|
1750
|
+
deviceFlowId: view.deviceFlowId,
|
|
1751
|
+
providerId: view.providerId,
|
|
1752
|
+
status: view.status,
|
|
1753
|
+
expiresAt: view.expiresAt ?? 0,
|
|
1754
|
+
intervalMs: view.intervalMs ?? 0,
|
|
1755
|
+
attached,
|
|
1756
|
+
};
|
|
1757
|
+
// PR #4291 follow-up review (gpt-5.5, #3): policy consistency with
|
|
1758
|
+
// `toDeviceFlowStateBody` — only the original starter sees the
|
|
1759
|
+
// verification material. Earlier shape unconditionally returned
|
|
1760
|
+
// `userCode` / `verificationUri` / `verificationUriComplete` on
|
|
1761
|
+
// every POST, including the `attached: true` take-over case, so any
|
|
1762
|
+
// bearer-token holder that POSTed `providerId: <existing>` got the
|
|
1763
|
+
// verification code another client started. That bypassed the
|
|
1764
|
+
// closed-out GET redaction completely. Apply the same gate here.
|
|
1765
|
+
// Fresh starts naturally pass the gate because `view.initiatorClientId`
|
|
1766
|
+
// was set from the same `callerClientId` on this very request.
|
|
1767
|
+
// Take-over callers that don't match the initiator now see the
|
|
1768
|
+
// public envelope only. The both-undefined branch preserves the
|
|
1769
|
+
// anonymous-start → anonymous-reattach use case.
|
|
1770
|
+
const callerIsInitiator = (view.initiatorClientId === undefined && callerClientId === undefined) ||
|
|
1771
|
+
(view.initiatorClientId !== undefined &&
|
|
1772
|
+
callerClientId !== undefined &&
|
|
1773
|
+
callerClientId === view.initiatorClientId);
|
|
1774
|
+
if (callerIsInitiator) {
|
|
1775
|
+
body['userCode'] = view.userCode ?? '';
|
|
1776
|
+
body['verificationUri'] = view.verificationUri ?? '';
|
|
1777
|
+
if (view.verificationUriComplete) {
|
|
1778
|
+
body['verificationUriComplete'] = view.verificationUriComplete;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
// PR #4255 round-12 #6 (gpt-5.5 review CzHOK): minor info-leak
|
|
1782
|
+
// close-out — only echo `initiatorClientId` back to a take-over
|
|
1783
|
+
// POST when the caller is the same client that started the flow
|
|
1784
|
+
// (or when the take-over caller explicitly identified
|
|
1785
|
+
// themselves and matches the original starter). An anonymous
|
|
1786
|
+
// take-over caller (no `X-Qwen-Client-Id`) gets no echo of the
|
|
1787
|
+
// original starter's id; this preserves the symmetry "the
|
|
1788
|
+
// daemon respects the absence of `X-Qwen-Client-Id` as a
|
|
1789
|
+
// privacy signal." Bearer-gated already, so the blast radius
|
|
1790
|
+
// was small, but the asymmetry is now closed.
|
|
1791
|
+
if (view.initiatorClientId &&
|
|
1792
|
+
callerClientId !== undefined &&
|
|
1793
|
+
callerClientId === view.initiatorClientId) {
|
|
1794
|
+
body['initiatorClientId'] = view.initiatorClientId;
|
|
1795
|
+
}
|
|
1796
|
+
return body;
|
|
1797
|
+
}
|
|
1798
|
+
function toDeviceFlowStateBody(view, callerClientId) {
|
|
1799
|
+
const body = {
|
|
1800
|
+
deviceFlowId: view.deviceFlowId,
|
|
1801
|
+
providerId: view.providerId,
|
|
1802
|
+
status: view.status,
|
|
1803
|
+
createdAt: view.createdAt,
|
|
1804
|
+
};
|
|
1805
|
+
if (view.errorKind)
|
|
1806
|
+
body['errorKind'] = view.errorKind;
|
|
1807
|
+
if (view.hint)
|
|
1808
|
+
body['hint'] = view.hint;
|
|
1809
|
+
if (view.expiresAt !== undefined)
|
|
1810
|
+
body['expiresAt'] = view.expiresAt;
|
|
1811
|
+
if (view.intervalMs !== undefined)
|
|
1812
|
+
body['intervalMs'] = view.intervalMs;
|
|
1813
|
+
if (view.lastPolledAt !== undefined)
|
|
1814
|
+
body['lastPolledAt'] = view.lastPolledAt;
|
|
1815
|
+
// PR #4255 follow-up review thread (deepseek-v4-pro): symmetrize with
|
|
1816
|
+
// the POST take-over response shape — only echo `userCode` /
|
|
1817
|
+
// `verificationUri` / `verificationUriComplete` / `initiatorClientId`
|
|
1818
|
+
// back to the original starter (matched by `X-Qwen-Client-Id`). An
|
|
1819
|
+
// anonymous GET caller, or a caller identifying as a different client,
|
|
1820
|
+
// sees only the public envelope (`status` / `errorKind` / `hint` /
|
|
1821
|
+
// timestamps). Bearer-token gated already (the route uses
|
|
1822
|
+
// `mutate({ strict: true })`), so the blast radius was small, but
|
|
1823
|
+
// multi-client setups sharing a single daemon token could otherwise
|
|
1824
|
+
// enumerate other clients' verification codes.
|
|
1825
|
+
//
|
|
1826
|
+
// **Threat model (PR #4291 follow-up review by Copilot):** this gate
|
|
1827
|
+
// is BEST-EFFORT ATTRIBUTION, not authentication. `X-Qwen-Client-Id`
|
|
1828
|
+
// is a syntactic header, not bound to a server-validated identity —
|
|
1829
|
+
// anyone holding the bearer token can spoof it. The bearer token IS
|
|
1830
|
+
// the auth boundary; this gate exists to prevent ACCIDENTAL
|
|
1831
|
+
// cross-client reads in well-behaved multi-SDK setups (and to keep
|
|
1832
|
+
// GET symmetric with the POST take-over shape closed out in
|
|
1833
|
+
// round-12 #6 of #4255). A determined attacker who has compromised
|
|
1834
|
+
// the daemon bearer token already wins; locking down GET further
|
|
1835
|
+
// would require binding identity into bearer-token issuance, which
|
|
1836
|
+
// is a separate architectural change.
|
|
1837
|
+
// PR #4291 follow-up review (qwen-latest, #3): the gate must accept
|
|
1838
|
+
// the both-undefined case too, otherwise an anonymously-started flow
|
|
1839
|
+
// (POST without `X-Qwen-Client-Id` → `initiatorClientId === undefined`)
|
|
1840
|
+
// becomes silently unreadable: even the same anonymous caller GETting
|
|
1841
|
+
// the same id can no longer retrieve `userCode`/`verificationUri` —
|
|
1842
|
+
// the body switches from "what they got from POST" to a redacted
|
|
1843
|
+
// public envelope, with HTTP 200, no error. Pre-PR-4291 GET returned
|
|
1844
|
+
// these fields to anyone with the bearer; this gate's purpose is to
|
|
1845
|
+
// prevent CROSS-client reads, not to lock anonymous flows out of
|
|
1846
|
+
// their own data.
|
|
1847
|
+
const callerIsInitiator = (view.initiatorClientId === undefined && callerClientId === undefined) ||
|
|
1848
|
+
(view.initiatorClientId !== undefined &&
|
|
1849
|
+
callerClientId !== undefined &&
|
|
1850
|
+
callerClientId === view.initiatorClientId);
|
|
1851
|
+
if (callerIsInitiator) {
|
|
1852
|
+
if (view.userCode)
|
|
1853
|
+
body['userCode'] = view.userCode;
|
|
1854
|
+
if (view.verificationUri)
|
|
1855
|
+
body['verificationUri'] = view.verificationUri;
|
|
1856
|
+
if (view.verificationUriComplete) {
|
|
1857
|
+
body['verificationUriComplete'] = view.verificationUriComplete;
|
|
1858
|
+
}
|
|
1859
|
+
if (view.initiatorClientId) {
|
|
1860
|
+
body['initiatorClientId'] = view.initiatorClientId;
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
return body;
|
|
1864
|
+
}
|
|
1865
|
+
function parseClientIdHeader(req, res) {
|
|
1866
|
+
const raw = req.get(CLIENT_ID_HEADER);
|
|
1867
|
+
if (raw === undefined || raw === '')
|
|
1868
|
+
return undefined;
|
|
1869
|
+
if (raw.length > MAX_CLIENT_ID_LENGTH || !CLIENT_ID_RE.test(raw)) {
|
|
1870
|
+
res.status(400).json({
|
|
1871
|
+
error: '`X-Qwen-Client-Id` must be a non-empty token of 128 characters or fewer',
|
|
1872
|
+
code: 'invalid_client_id',
|
|
1873
|
+
});
|
|
1874
|
+
return null;
|
|
1875
|
+
}
|
|
1876
|
+
return raw;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* #4282 fold-in 1 (gpt-5.5 C2). Workspace-level mutation routes validate
|
|
1880
|
+
* the parsed `X-Qwen-Client-Id` against `bridge.knownClientIds()` so the
|
|
1881
|
+
* `originatorClientId` stamped onto fan-out events is grounded in a
|
|
1882
|
+
* client identity the daemon previously issued. Without this check, any
|
|
1883
|
+
* authenticated caller could forge the originator on `tool_toggled`,
|
|
1884
|
+
* `workspace_initialized`, and `mcp_server_restart*` events.
|
|
1885
|
+
*
|
|
1886
|
+
* Mirrors the inline check pattern in `workspaceMemory.ts` /
|
|
1887
|
+
* `workspaceAgents.ts` from PR 16. Returns the validated client id
|
|
1888
|
+
* (or `undefined` when no header was supplied), `null` when a 400 has
|
|
1889
|
+
* already been emitted by `parseClientIdHeader` or this validator.
|
|
1890
|
+
*/
|
|
1891
|
+
function parseAndValidateWorkspaceClientId(req, res, bridge) {
|
|
1892
|
+
const raw = parseClientIdHeader(req, res);
|
|
1893
|
+
if (raw === null || raw === undefined)
|
|
1894
|
+
return raw;
|
|
1895
|
+
if (!bridge.knownClientIds().has(raw)) {
|
|
1896
|
+
res.status(400).json({
|
|
1897
|
+
error: `Client id "${raw}" is not registered for this workspace`,
|
|
1898
|
+
code: 'invalid_client_id',
|
|
1899
|
+
clientId: raw,
|
|
1900
|
+
});
|
|
1901
|
+
return null;
|
|
1902
|
+
}
|
|
1903
|
+
return raw;
|
|
1904
|
+
}
|
|
1905
|
+
function parsePermissionVoteBody(req, res) {
|
|
1906
|
+
const body = safeBody(req);
|
|
1907
|
+
const outcome = body['outcome'];
|
|
1908
|
+
if (!isValidOutcome(outcome)) {
|
|
1909
|
+
res.status(400).json({ error: INVALID_PERMISSION_OUTCOME_ERROR });
|
|
1910
|
+
return undefined;
|
|
1911
|
+
}
|
|
1912
|
+
return {
|
|
1913
|
+
...body,
|
|
1914
|
+
outcome,
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
function isValidOutcome(raw) {
|
|
1918
|
+
if (typeof raw !== 'object' || raw === null)
|
|
1919
|
+
return false;
|
|
1920
|
+
const obj = raw;
|
|
1921
|
+
if (obj['outcome'] === 'cancelled')
|
|
1922
|
+
return true;
|
|
1923
|
+
// `optionId` must be a non-empty string. An empty string is technically a
|
|
1924
|
+
// string but isn't a meaningful selection — letting it through would
|
|
1925
|
+
// forward malformed votes to the bridge and the agent would reject the
|
|
1926
|
+
// unknown option opaquely.
|
|
1927
|
+
return (obj['outcome'] === 'selected' &&
|
|
1928
|
+
typeof obj['optionId'] === 'string' &&
|
|
1929
|
+
obj['optionId'].length > 0);
|
|
1930
|
+
}
|
|
1931
|
+
/** Range bounds for the `?maxQueued=N` query param on `/session/:id/events`. */
|
|
1932
|
+
const MIN_QUERY_MAX_QUEUED = 16;
|
|
1933
|
+
const MAX_QUERY_MAX_QUEUED = 2048;
|
|
1934
|
+
/**
|
|
1935
|
+
* Parse the optional `?maxQueued=N` query param on
|
|
1936
|
+
* `GET /session/:id/events`. Returns:
|
|
1937
|
+
* - `undefined` — param absent, EventBus uses its default cap (256).
|
|
1938
|
+
* - a positive integer in `[16, 2048]` — caller wants a custom cap.
|
|
1939
|
+
* - `null` — malformed value; the function ALREADY sent a 400 JSON
|
|
1940
|
+
* response and the route must short-circuit. (Pre-handshake 400
|
|
1941
|
+
* is safer than half-opening an SSE stream and emitting a
|
|
1942
|
+
* `stream_error` frame the client has to parse — `EventSource`
|
|
1943
|
+
* auto-reconnects on the latter.)
|
|
1944
|
+
*
|
|
1945
|
+
* Cap range rationale: lower bound 16 (smaller is useless for any
|
|
1946
|
+
* replay backlog); upper bound 2048 (so a single subscriber can't
|
|
1947
|
+
* pin ~1 MB of queue memory just by asking).
|
|
1948
|
+
*/
|
|
1949
|
+
function parseMaxQueuedQuery(raw, res) {
|
|
1950
|
+
// Absent param → undefined (use bus default). Present-but-empty
|
|
1951
|
+
// (`?maxQueued=` typed explicitly) → fail-CLOSED 400 — the API
|
|
1952
|
+
// documents fail-closed for any malformed value before opening
|
|
1953
|
+
// SSE, and an empty string is unambiguously malformed (real values
|
|
1954
|
+
// are positive integers in [16, 2048]).
|
|
1955
|
+
if (raw === undefined)
|
|
1956
|
+
return undefined;
|
|
1957
|
+
if (typeof raw !== 'string' || !/^\d+$/.test(raw)) {
|
|
1958
|
+
// Sanitize via JSON.stringify so an attacker-controlled value
|
|
1959
|
+
// containing `\n` / `\r` / other control chars can't inject extra
|
|
1960
|
+
// log lines into stderr (line-based shipper like
|
|
1961
|
+
// journald/Loki/Splunk would otherwise treat the injected line as
|
|
1962
|
+
// a fresh entry). Matches the `workspace_mismatch` log style in
|
|
1963
|
+
// `sendBridgeError`.
|
|
1964
|
+
writeStderrLine(`qwen serve: rejected ?maxQueued ${safeLogValue(raw)} ` +
|
|
1965
|
+
`(not a decimal integer)`);
|
|
1966
|
+
res.status(400).json({
|
|
1967
|
+
error: '`maxQueued` must be a decimal integer',
|
|
1968
|
+
code: 'invalid_max_queued',
|
|
1969
|
+
});
|
|
1970
|
+
return null;
|
|
1971
|
+
}
|
|
1972
|
+
const n = Number.parseInt(raw, 10);
|
|
1973
|
+
if (!Number.isFinite(n) ||
|
|
1974
|
+
n < MIN_QUERY_MAX_QUEUED ||
|
|
1975
|
+
n > MAX_QUERY_MAX_QUEUED) {
|
|
1976
|
+
writeStderrLine(`qwen serve: rejected ?maxQueued ${safeLogValue(raw)} ` +
|
|
1977
|
+
`(outside [${MIN_QUERY_MAX_QUEUED}, ${MAX_QUERY_MAX_QUEUED}])`);
|
|
1978
|
+
res.status(400).json({
|
|
1979
|
+
error: `\`maxQueued\` must be in [${MIN_QUERY_MAX_QUEUED}, ${MAX_QUERY_MAX_QUEUED}]`,
|
|
1980
|
+
code: 'invalid_max_queued',
|
|
1981
|
+
});
|
|
1982
|
+
return null;
|
|
1983
|
+
}
|
|
1984
|
+
return n;
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Wrap an attacker-controllable string for safe interpolation into a
|
|
1988
|
+
* stderr log line. `JSON.stringify` escapes control characters
|
|
1989
|
+
* (`\n`, `\r`, etc.) and wraps the result in quotes — any injection
|
|
1990
|
+
* attempt surfaces as visible-as-quoted-noise rather than a
|
|
1991
|
+
* forged log line. Truncated AFTER stringify to keep the budget
|
|
1992
|
+
* predictable even for control-heavy inputs.
|
|
1993
|
+
*/
|
|
1994
|
+
function safeLogValue(raw) {
|
|
1995
|
+
return JSON.stringify(String(raw)).slice(0, 82);
|
|
1996
|
+
}
|
|
1997
|
+
function parseLastEventId(raw) {
|
|
1998
|
+
// Stricter than Number.parseInt: only accept pure decimal digits to avoid
|
|
1999
|
+
// values like "1abc" or "1.5e10z" silently parsing to 1.
|
|
2000
|
+
if (typeof raw !== 'string' || !/^\d+$/.test(raw)) {
|
|
2001
|
+
// BX9_I: log a breadcrumb for the operator when a non-empty
|
|
2002
|
+
// header is rejected. The client resumed from event 0 instead
|
|
2003
|
+
// of where they meant to — without this line, the loss of
|
|
2004
|
+
// every event buffered during their disconnect was invisible.
|
|
2005
|
+
// Skip the log for missing / empty headers (the common case of
|
|
2006
|
+
// "first connect, no resume").
|
|
2007
|
+
if (typeof raw === 'string' && raw.length > 0) {
|
|
2008
|
+
writeStderrLine(`qwen serve: rejected Last-Event-ID ${safeLogValue(raw)} ` +
|
|
2009
|
+
`(not a decimal integer)`);
|
|
2010
|
+
}
|
|
2011
|
+
return undefined;
|
|
2012
|
+
}
|
|
2013
|
+
const n = Number.parseInt(raw, 10);
|
|
2014
|
+
// Reject values that lose precision as a JS `number`. The bus's monotonic
|
|
2015
|
+
// ids are bounded by `Number.MAX_SAFE_INTEGER` (2^53 - 1); a client that
|
|
2016
|
+
// tries to resume from beyond that is either malicious or broken.
|
|
2017
|
+
if (!Number.isFinite(n) || n > Number.MAX_SAFE_INTEGER) {
|
|
2018
|
+
writeStderrLine(`qwen serve: rejected Last-Event-ID ${safeLogValue(raw)} ` +
|
|
2019
|
+
`(exceeds Number.MAX_SAFE_INTEGER)`);
|
|
2020
|
+
return undefined;
|
|
2021
|
+
}
|
|
2022
|
+
return n;
|
|
2023
|
+
}
|
|
2024
|
+
function sendPermissionVoteError(res, err, ctx) {
|
|
2025
|
+
// BkwQI: voter's `optionId` wasn't in the option set the agent
|
|
2026
|
+
// originally offered (e.g. forging `ProceedAlways*` when the
|
|
2027
|
+
// prompt's `hideAlwaysAllow` policy suppressed it). 400, not
|
|
2028
|
+
// 404 — the requestId IS known, but the chosen option isn't.
|
|
2029
|
+
if (err instanceof InvalidPermissionOptionError) {
|
|
2030
|
+
res.status(400).json({
|
|
2031
|
+
error: err.message,
|
|
2032
|
+
code: 'invalid_option_id',
|
|
2033
|
+
requestId: err.requestId,
|
|
2034
|
+
optionId: err.optionId,
|
|
2035
|
+
});
|
|
2036
|
+
return;
|
|
2037
|
+
}
|
|
2038
|
+
sendBridgeError(res, err, ctx);
|
|
2039
|
+
}
|
|
2040
|
+
function formatSseFrame(event) {
|
|
2041
|
+
// SSE format: id (optional), event (optional), data, blank line.
|
|
2042
|
+
// The `id:` line is intentionally omitted when `event.id` is absent —
|
|
2043
|
+
// terminal/synthetic frames (e.g. daemon-side `stream_error`) must not
|
|
2044
|
+
// burn a slot in the per-session monotonic sequence the client uses for
|
|
2045
|
+
// `Last-Event-ID` reconnect tracking.
|
|
2046
|
+
//
|
|
2047
|
+
// We always emit the payload as a single `data:` line. The EventSource
|
|
2048
|
+
// spec also allows a frame to span multiple `data:` lines (which a
|
|
2049
|
+
// conformant parser joins with `\n`); we don't emit that form because
|
|
2050
|
+
// our payload is JSON without embedded newlines after `JSON.stringify`.
|
|
2051
|
+
// The SDK parser at `sdk-typescript/src/daemon/sse.ts` handles the
|
|
2052
|
+
// multi-line variant on the receive side — input/output asymmetry is
|
|
2053
|
+
// intentional.
|
|
2054
|
+
const dataJson = JSON.stringify(event);
|
|
2055
|
+
const idLine = 'id' in event && event.id !== undefined ? `id: ${event.id}\n` : '';
|
|
2056
|
+
return `${idLine}event: ${event.type}\ndata: ${dataJson}\n\n`;
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* Map a thrown bridge error to an HTTP response.
|
|
2060
|
+
*
|
|
2061
|
+
* `ctx` is operator-facing: route + sessionId folded into the stderr
|
|
2062
|
+
* log line so a bare `ECONNRESET` / `ENOMEM` stack trace is
|
|
2063
|
+
* attributable to a specific session and request without having to
|
|
2064
|
+
* timestamp-correlate against client logs. Pass via the route handlers
|
|
2065
|
+
* — see how they call `sendBridgeError(res, err, { route: 'POST
|
|
2066
|
+
* /session/:id/prompt', sessionId })`. Optional so test/dev call
|
|
2067
|
+
* sites that don't care about the log can omit it.
|
|
2068
|
+
*/
|
|
2069
|
+
function sendBridgeError(res, err, ctx) {
|
|
2070
|
+
if (err instanceof WorkspaceInitConflictError) {
|
|
2071
|
+
// #4175 Wave 4 PR 17. The target file already exists with non-
|
|
2072
|
+
// whitespace content and the caller did not pass `force: true`.
|
|
2073
|
+
// Body carries the resolved path + size so SDK clients can render
|
|
2074
|
+
// a "file already exists; pass force: true to overwrite" prompt
|
|
2075
|
+
// without re-stat'ing the workspace.
|
|
2076
|
+
res.status(409).json({
|
|
2077
|
+
error: err.message,
|
|
2078
|
+
code: 'workspace_init_conflict',
|
|
2079
|
+
path: err.path,
|
|
2080
|
+
existingSize: err.existingSize,
|
|
2081
|
+
});
|
|
2082
|
+
return;
|
|
2083
|
+
}
|
|
2084
|
+
if (err instanceof McpServerNotFoundError) {
|
|
2085
|
+
// #4282 fold-in 1 (gpt-5.5 C5). Stable 404 for "MCP server name
|
|
2086
|
+
// not in `mcpServers` config" so callers can distinguish a typo
|
|
2087
|
+
// from an internal daemon failure.
|
|
2088
|
+
res.status(404).json({
|
|
2089
|
+
error: err.message,
|
|
2090
|
+
code: 'mcp_server_not_found',
|
|
2091
|
+
serverName: err.serverName,
|
|
2092
|
+
});
|
|
2093
|
+
return;
|
|
2094
|
+
}
|
|
2095
|
+
if (err instanceof McpServerRestartFailedError) {
|
|
2096
|
+
// #4282 fold-in 1 (gpt-5.5 C4). 502 because the daemon understood
|
|
2097
|
+
// the request and the upstream (the MCP server / its child
|
|
2098
|
+
// process) failed to come back online. `errorKind: 'protocol_error'`
|
|
2099
|
+
// shares the closed PR-13 taxonomy.
|
|
2100
|
+
res.status(502).json({
|
|
2101
|
+
error: err.message,
|
|
2102
|
+
code: 'mcp_server_restart_failed',
|
|
2103
|
+
errorKind: 'protocol_error',
|
|
2104
|
+
serverName: err.serverName,
|
|
2105
|
+
mcpStatus: err.mcpStatus,
|
|
2106
|
+
});
|
|
2107
|
+
return;
|
|
2108
|
+
}
|
|
2109
|
+
if (err instanceof TrustGateError) {
|
|
2110
|
+
// #4175 Wave 4 PR 17: trust-folder rejection from
|
|
2111
|
+
// `Config.setApprovalMode`. 403 because the daemon understood the
|
|
2112
|
+
// request but the workspace's trust posture forbids the privileged
|
|
2113
|
+
// mode. `errorKind: 'auth_env_error'` shares the closed PR 13
|
|
2114
|
+
// taxonomy so SDK consumers branch on the same enum already used by
|
|
2115
|
+
// preflight / env diagnostics.
|
|
2116
|
+
res.status(403).json({
|
|
2117
|
+
error: err.message,
|
|
2118
|
+
code: 'trust_gate',
|
|
2119
|
+
errorKind: 'auth_env_error',
|
|
2120
|
+
});
|
|
2121
|
+
return;
|
|
2122
|
+
}
|
|
2123
|
+
if (err instanceof SessionNotFoundError) {
|
|
2124
|
+
res.status(404).json({ error: err.message, sessionId: err.sessionId });
|
|
2125
|
+
return;
|
|
2126
|
+
}
|
|
2127
|
+
if (err instanceof InvalidClientIdError) {
|
|
2128
|
+
res.status(400).json({
|
|
2129
|
+
error: err.message,
|
|
2130
|
+
code: 'invalid_client_id',
|
|
2131
|
+
sessionId: err.sessionId,
|
|
2132
|
+
clientId: err.clientId,
|
|
2133
|
+
});
|
|
2134
|
+
return;
|
|
2135
|
+
}
|
|
2136
|
+
if (err instanceof WorkspaceMismatchError) {
|
|
2137
|
+
// #3803 §02 single-workspace mode: the daemon binds to one
|
|
2138
|
+
// workspace at boot; cross-workspace POSTs are rejected here.
|
|
2139
|
+
// 400 (not 404 — the daemon is "fine", the client just picked
|
|
2140
|
+
// the wrong daemon for their workspace). Body includes both
|
|
2141
|
+
// paths so orchestrator-aware clients can route to the right
|
|
2142
|
+
// daemon / spawn a new one.
|
|
2143
|
+
//
|
|
2144
|
+
// Operator log line: unlike SessionNotFoundError (per-session
|
|
2145
|
+
// 404 with rich URL context), workspace_mismatch indicates an
|
|
2146
|
+
// orchestration / deployment drift (operator booted with the
|
|
2147
|
+
// wrong workspace, or client is routing to the wrong daemon).
|
|
2148
|
+
// Without a breadcrumb the daemon's log looks healthy while
|
|
2149
|
+
// every client request silently 400s. Limited to authenticated
|
|
2150
|
+
// requests by the upstream bearer-token gate, so probing-DoS
|
|
2151
|
+
// log noise stays bounded.
|
|
2152
|
+
// SECURITY: `err.requested` is derived from the request body
|
|
2153
|
+
// (`req.workspaceCwd` → `canonicalizeWorkspace` → here). `path.resolve`
|
|
2154
|
+
// + `realpathSync.native` both preserve control characters inside
|
|
2155
|
+
// path segments — they only normalize separators / `..` / `.` and
|
|
2156
|
+
// walk symlinks. A body like `{"cwd": "/legit/path\nqwen serve:
|
|
2157
|
+
// FAKE LOG LINE"}` would otherwise emit two valid-looking daemon
|
|
2158
|
+
// log lines, weaponizing line-based log shippers (Splunk / Loki /
|
|
2159
|
+
// journald → SIEM). `JSON.stringify` escapes control chars and
|
|
2160
|
+
// wraps in quotes so any injection attempt surfaces as
|
|
2161
|
+
// visible-as-quoted-noise rather than forged-line. `err.bound` is
|
|
2162
|
+
// safe (canonicalized at boot from operator-controlled
|
|
2163
|
+
// `--workspace` / `process.cwd()`) but quoted symmetrically for
|
|
2164
|
+
// readability.
|
|
2165
|
+
writeStderrLine(`qwen serve: workspace_mismatch (POST /session): ` +
|
|
2166
|
+
`daemon bound to ${JSON.stringify(err.bound)}, ` +
|
|
2167
|
+
`rejected ${JSON.stringify(err.requested)}`);
|
|
2168
|
+
res.status(400).json({
|
|
2169
|
+
error: err.message,
|
|
2170
|
+
code: 'workspace_mismatch',
|
|
2171
|
+
boundWorkspace: err.bound,
|
|
2172
|
+
requestedWorkspace: err.requested,
|
|
2173
|
+
});
|
|
2174
|
+
return;
|
|
2175
|
+
}
|
|
2176
|
+
if (err instanceof InvalidSessionScopeError) {
|
|
2177
|
+
// Same wire shape as the route-layer 400 (`server.ts` validates
|
|
2178
|
+
// body['sessionScope'] before calling the bridge). A direct embed
|
|
2179
|
+
// / test caller bypassing the route would otherwise see a generic
|
|
2180
|
+
// 500 — the typed translation keeps both layers in agreement so
|
|
2181
|
+
// SDK clients can branch on `code` regardless of which layer
|
|
2182
|
+
// surfaced the rejection.
|
|
2183
|
+
res.status(400).json({
|
|
2184
|
+
error: err.message,
|
|
2185
|
+
code: 'invalid_session_scope',
|
|
2186
|
+
});
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
if (err instanceof InvalidSessionMetadataError) {
|
|
2190
|
+
res.status(400).json({
|
|
2191
|
+
error: err.message,
|
|
2192
|
+
code: 'invalid_metadata',
|
|
2193
|
+
field: err.field,
|
|
2194
|
+
});
|
|
2195
|
+
return;
|
|
2196
|
+
}
|
|
2197
|
+
if (err instanceof SessionLimitExceededError) {
|
|
2198
|
+
// 503 Service Unavailable + `Retry-After` is the canonical
|
|
2199
|
+
// "we'd serve you, but we're full right now" shape. The hint
|
|
2200
|
+
// is intentionally conservative (5s) because a session that
|
|
2201
|
+
// finishes a prompt frees a slot quickly under normal load;
|
|
2202
|
+
// a client that backs off too aggressively wastes capacity.
|
|
2203
|
+
res.set('Retry-After', '5');
|
|
2204
|
+
res.status(503).json({
|
|
2205
|
+
error: err.message,
|
|
2206
|
+
code: 'session_limit_exceeded',
|
|
2207
|
+
limit: err.limit,
|
|
2208
|
+
});
|
|
2209
|
+
return;
|
|
2210
|
+
}
|
|
2211
|
+
if (err instanceof RestoreInProgressError) {
|
|
2212
|
+
// Match `SessionLimitExceededError`'s 5s hint (above) — the
|
|
2213
|
+
// underlying restore can take up to `initTimeoutMs` (default
|
|
2214
|
+
// 10s) on the agent side, so a 1s retry hint pushed clients
|
|
2215
|
+
// into tight loops that kept hitting the same 409.
|
|
2216
|
+
res.set('Retry-After', '5');
|
|
2217
|
+
res.status(409).json({
|
|
2218
|
+
error: err.message,
|
|
2219
|
+
code: 'restore_in_progress',
|
|
2220
|
+
sessionId: err.sessionId,
|
|
2221
|
+
activeAction: err.activeAction,
|
|
2222
|
+
requestedAction: err.requestedAction,
|
|
2223
|
+
});
|
|
2224
|
+
return;
|
|
2225
|
+
}
|
|
2226
|
+
// 5xx is the kind of error operators need to see in their daemon log
|
|
2227
|
+
// — bridge ENOMEM, agent stack trace, unexpected throw, etc. Without
|
|
2228
|
+
// logging here every 500 disappears once the caller consumes the
|
|
2229
|
+
// response body. This is a stop-gap until structured access/error
|
|
2230
|
+
// logging lands (tracked under §10 follow-ups). Use the stdio helper
|
|
2231
|
+
// (not `console.error`) to keep the no-console lint rule happy and
|
|
2232
|
+
// route through the same writer the rest of the daemon uses.
|
|
2233
|
+
const ctxParts = [
|
|
2234
|
+
ctx?.route,
|
|
2235
|
+
ctx?.sessionId ? `session=${ctx.sessionId}` : undefined,
|
|
2236
|
+
].filter(Boolean);
|
|
2237
|
+
const ctxStr = ctxParts.length > 0 ? ` (${ctxParts.join(' ')})` : '';
|
|
2238
|
+
writeStderrLine(`qwen serve: bridge error${ctxStr}: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`);
|
|
2239
|
+
res.status(500).json(errorPayload(err));
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Coerce an arbitrary thrown value to a useful string. Plain `String(err)`
|
|
2243
|
+
* yields `[object Object]` for JSON-RPC-shaped errors (`{code, message,
|
|
2244
|
+
* data}`) which are exactly what the ACP SDK forwards from the agent. Try
|
|
2245
|
+
* the `message` field first, fall back to JSON-stringify, then `String`.
|
|
2246
|
+
*/
|
|
2247
|
+
function errorMessage(err) {
|
|
2248
|
+
if (err instanceof Error)
|
|
2249
|
+
return err.message;
|
|
2250
|
+
if (err && typeof err === 'object') {
|
|
2251
|
+
const maybe = err.message;
|
|
2252
|
+
if (typeof maybe === 'string' && maybe.length > 0)
|
|
2253
|
+
return maybe;
|
|
2254
|
+
try {
|
|
2255
|
+
return JSON.stringify(err);
|
|
2256
|
+
}
|
|
2257
|
+
catch {
|
|
2258
|
+
/* fall through */
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
return String(err);
|
|
2262
|
+
}
|
|
2263
|
+
/**
|
|
2264
|
+
* Build the JSON body for a 5xx response. The ACP SDK forwards
|
|
2265
|
+
* JSON-RPC-shaped errors like `{code: -32000, message: "Internal error",
|
|
2266
|
+
* data: {reason: "model quota exceeded"}}` — discarding `code`/`data`
|
|
2267
|
+
* collapses every distinct failure (quota / rate-limit / auth /
|
|
2268
|
+
* crash) to the same opaque `"Internal error"` string at the client.
|
|
2269
|
+
* Forward both fields so callers can triage from response body alone.
|
|
2270
|
+
* `error` stays as the human-readable string for backward compatibility
|
|
2271
|
+
* with clients that only consumed `error` in the original shape.
|
|
2272
|
+
*
|
|
2273
|
+
* BSA0G acknowledged: forwarding `data` verbatim leaks per-error
|
|
2274
|
+
* detail (file paths in upstream tool failures, partial API response
|
|
2275
|
+
* snippets, etc.) to every authenticated SSE subscriber that
|
|
2276
|
+
* observes 5xx responses. In Stage 1's single-user / small-team
|
|
2277
|
+
* trust model (every authenticated client is the same human or
|
|
2278
|
+
* collaborators they trust) this is acceptable — and the triage
|
|
2279
|
+
* value of the rich error is high. Stage 2 multi-tenant deployments
|
|
2280
|
+
* will need an opt-in `--redact-errors` flag (or per-deployment
|
|
2281
|
+
* policy hook) that strips `data` and replaces it with an
|
|
2282
|
+
* error-class identifier; tracked under #3803 follow-ups.
|
|
2283
|
+
*/
|
|
2284
|
+
function errorPayload(err) {
|
|
2285
|
+
const out = {
|
|
2286
|
+
error: errorMessage(err),
|
|
2287
|
+
};
|
|
2288
|
+
if (err && typeof err === 'object') {
|
|
2289
|
+
const obj = err;
|
|
2290
|
+
if ('code' in obj)
|
|
2291
|
+
out.code = obj['code'];
|
|
2292
|
+
if ('data' in obj)
|
|
2293
|
+
out.data = obj['data'];
|
|
2294
|
+
}
|
|
2295
|
+
return out;
|
|
2296
|
+
}
|
|
2297
|
+
//# sourceMappingURL=server.js.map
|