gsd-pi 2.76.0 → 2.77.0-dev.538325aea
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 +32 -30
- package/dist/claude-cli-check.js +32 -3
- package/dist/cli.js +13 -21
- package/dist/extension-registry.js +1 -1
- package/dist/headless-ui.d.ts +1 -1
- package/dist/headless.js +2 -4
- package/dist/loader.js +0 -1
- package/dist/mcp-server.d.ts +7 -0
- package/dist/mcp-server.js +35 -1
- package/dist/onboarding.js +50 -5
- package/dist/provider-migrations.d.ts +2 -2
- package/dist/provider-migrations.js +2 -1
- package/dist/remote-questions-config.js +1 -1
- package/dist/resource-loader.d.ts +1 -1
- package/dist/resource-loader.js +2 -8
- package/dist/resources/agents/researcher.md +1 -1
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +1 -1
- package/dist/resources/extensions/aws-auth/index.js +2 -1
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +6 -9
- package/dist/resources/extensions/bg-shell/process-manager.js +2 -1
- package/dist/resources/extensions/browser-tools/index.js +0 -1
- package/dist/resources/extensions/claude-code-cli/index.js +1 -1
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +106 -17
- package/dist/resources/extensions/claude-code-cli/readiness.js +31 -8
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +94 -27
- package/dist/resources/extensions/gsd/auto/loop.js +9 -0
- package/dist/resources/extensions/gsd/auto/phases.js +104 -11
- package/dist/resources/extensions/gsd/auto/run-unit.js +38 -2
- package/dist/resources/extensions/gsd/auto/session.js +22 -1
- package/dist/resources/extensions/gsd/auto-dispatch.js +56 -17
- package/dist/resources/extensions/gsd/auto-model-selection.js +53 -16
- package/dist/resources/extensions/gsd/auto-post-unit.js +59 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +69 -1
- package/dist/resources/extensions/gsd/auto-start.js +74 -59
- package/dist/resources/extensions/gsd/auto-verification.js +33 -0
- package/dist/resources/extensions/gsd/auto-worktree.js +51 -53
- package/dist/resources/extensions/gsd/auto.js +70 -28
- package/dist/resources/extensions/gsd/blocked-models.js +68 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +93 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +39 -9
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +93 -0
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +3 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +12 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +52 -6
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +84 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +34 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +93 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +54 -89
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +968 -23
- package/dist/resources/extensions/gsd/compaction-snapshot.js +121 -0
- package/dist/resources/extensions/gsd/complexity-classifier.js +5 -3
- package/dist/resources/extensions/gsd/db-writer.js +88 -16
- package/dist/resources/extensions/gsd/dispatch-guard.js +44 -3
- package/dist/resources/extensions/gsd/doctor-git-checks.js +23 -29
- package/dist/resources/extensions/gsd/doctor-providers.js +51 -5
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +1 -0
- package/dist/resources/extensions/gsd/error-classifier.js +31 -3
- package/dist/resources/extensions/gsd/exec-history.js +120 -0
- package/dist/resources/extensions/gsd/exec-sandbox.js +258 -0
- package/dist/resources/extensions/gsd/gitignore.js +1 -0
- package/dist/resources/extensions/gsd/gsd-db.js +168 -23
- package/dist/resources/extensions/gsd/guided-flow.js +191 -2
- package/dist/resources/extensions/gsd/health-widget.js +4 -1
- package/dist/resources/extensions/gsd/hook-emitter.js +108 -0
- package/dist/resources/extensions/gsd/init-wizard.js +15 -1
- package/dist/resources/extensions/gsd/key-manager.js +28 -0
- package/dist/resources/extensions/gsd/memory-backfill.js +126 -0
- package/dist/resources/extensions/gsd/memory-store.js +19 -0
- package/dist/resources/extensions/gsd/model-router.js +36 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +44 -9
- package/dist/resources/extensions/gsd/preferences-types.js +9 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +83 -0
- package/dist/resources/extensions/gsd/preferences.js +17 -17
- package/dist/resources/extensions/gsd/prompt-loader.js +22 -7
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +2 -0
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
- package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/dist/resources/extensions/gsd/prompts/execute-task.md +3 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -0
- package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -0
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +13 -5
- package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
- package/dist/resources/extensions/gsd/state.js +43 -4
- package/dist/resources/extensions/gsd/token-counter.js +22 -5
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +16 -10
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +59 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +126 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +26 -1
- package/dist/resources/extensions/gsd/tools/resume-tool.js +23 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +20 -3
- package/dist/resources/extensions/gsd/workflow-mcp.js +3 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +6 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
- package/dist/resources/extensions/mcp-client/index.js +1 -1
- package/dist/resources/extensions/ollama/index.js +1 -2
- package/dist/resources/extensions/ollama/ollama-chat-provider.js +5 -15
- package/dist/resources/extensions/remote-questions/config.js +12 -1
- package/dist/resources/extensions/search-the-web/command-search-provider.js +5 -4
- package/dist/resources/extensions/search-the-web/native-search.js +45 -13
- package/dist/resources/extensions/universal-config/index.js +1 -1
- package/dist/resources/skills/api-design/SKILL.md +190 -0
- package/dist/resources/skills/create-mcp-server/SKILL.md +121 -0
- package/dist/resources/skills/decompose-into-slices/SKILL.md +139 -0
- package/dist/resources/skills/dependency-upgrade/SKILL.md +158 -0
- package/dist/resources/skills/design-an-interface/SKILL.md +102 -0
- package/dist/resources/skills/forensics/SKILL.md +153 -0
- package/dist/resources/skills/grill-me/SKILL.md +93 -0
- package/dist/resources/skills/handoff/SKILL.md +121 -0
- package/dist/resources/skills/observability/SKILL.md +174 -0
- package/dist/resources/skills/security-review/SKILL.md +181 -0
- package/dist/resources/skills/spike-wrap-up/SKILL.md +138 -0
- package/dist/resources/skills/tdd/SKILL.md +112 -0
- package/dist/resources/skills/verify-before-complete/SKILL.md +98 -0
- package/dist/resources/skills/write-docs/SKILL.md +82 -0
- package/dist/resources/skills/write-milestone-brief/SKILL.md +135 -0
- package/dist/security-overrides.d.ts +4 -1
- package/dist/security-overrides.js +16 -3
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +11 -11
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/required-server-files.json +4 -4
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +11 -11
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2826.d445fb428ef41fa1.js +9 -0
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-5b113fd32bc2a1c3.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-5fc74f13a25fa1bb.js → webpack-1832629448831fdc.js} +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/dist/web-mode.js +1 -1
- package/dist/welcome-screen.js +19 -15
- package/dist/wizard.js +4 -5
- package/package.json +25 -7
- package/packages/daemon/package.json +2 -2
- package/packages/gsd-agent-core/dist/agent-session.d.ts +716 -0
- package/packages/gsd-agent-core/dist/agent-session.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/agent-session.js +2595 -0
- package/packages/gsd-agent-core/dist/agent-session.js.map +1 -0
- package/packages/gsd-agent-core/dist/artifact-manager.d.ts +52 -0
- package/packages/gsd-agent-core/dist/artifact-manager.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/artifact-manager.js +118 -0
- package/packages/gsd-agent-core/dist/artifact-manager.js.map +1 -0
- package/packages/gsd-agent-core/dist/bash-executor.d.ts +57 -0
- package/packages/gsd-agent-core/dist/bash-executor.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/bash-executor.js +282 -0
- package/packages/gsd-agent-core/dist/bash-executor.js.map +1 -0
- package/packages/gsd-agent-core/dist/blob-store.d.ts +39 -0
- package/packages/gsd-agent-core/dist/blob-store.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/blob-store.js +151 -0
- package/packages/gsd-agent-core/dist/blob-store.js.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts +90 -0
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.js +207 -0
- package/packages/gsd-agent-core/dist/compaction/branch-summarization.js.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/compaction.d.ts +137 -0
- package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/compaction.js +621 -0
- package/packages/gsd-agent-core/dist/compaction/compaction.js.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/index.d.ts +7 -0
- package/packages/gsd-agent-core/dist/compaction/index.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/index.js +7 -0
- package/packages/gsd-agent-core/dist/compaction/index.js.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/utils.d.ts +78 -0
- package/packages/gsd-agent-core/dist/compaction/utils.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/compaction/utils.js +263 -0
- package/packages/gsd-agent-core/dist/compaction/utils.js.map +1 -0
- package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts +90 -0
- package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/compaction-orchestrator.js +338 -0
- package/packages/gsd-agent-core/dist/compaction-orchestrator.js.map +1 -0
- package/packages/gsd-agent-core/dist/contextual-tips.d.ts +43 -0
- package/packages/gsd-agent-core/dist/contextual-tips.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/contextual-tips.js +208 -0
- package/packages/gsd-agent-core/dist/contextual-tips.js.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts +18 -0
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js +250 -0
- package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/index.d.ts +37 -0
- package/packages/gsd-agent-core/dist/export-html/index.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/index.js +257 -0
- package/packages/gsd-agent-core/dist/export-html/index.js.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/template.css +971 -0
- package/packages/gsd-agent-core/dist/export-html/template.html +54 -0
- package/packages/gsd-agent-core/dist/export-html/template.js +1583 -0
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts +38 -0
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.js +70 -0
- package/packages/gsd-agent-core/dist/export-html/tool-renderer.js.map +1 -0
- package/packages/gsd-agent-core/dist/export-html/vendor/highlight.min.js +1213 -0
- package/packages/gsd-agent-core/dist/export-html/vendor/marked.min.js +6 -0
- package/packages/gsd-agent-core/dist/fallback-resolver.d.ts +75 -0
- package/packages/gsd-agent-core/dist/fallback-resolver.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/fallback-resolver.js +118 -0
- package/packages/gsd-agent-core/dist/fallback-resolver.js.map +1 -0
- package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts +44 -0
- package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/image-overflow-recovery.js +99 -0
- package/packages/gsd-agent-core/dist/image-overflow-recovery.js.map +1 -0
- package/packages/gsd-agent-core/dist/index.d.ts +14 -0
- package/packages/gsd-agent-core/dist/index.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/index.js +19 -0
- package/packages/gsd-agent-core/dist/index.js.map +1 -0
- package/packages/gsd-agent-core/dist/keybindings.d.ts +47 -0
- package/packages/gsd-agent-core/dist/keybindings.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/keybindings.js +156 -0
- package/packages/gsd-agent-core/dist/keybindings.js.map +1 -0
- package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts +42 -0
- package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/lifecycle-hooks.js +204 -0
- package/packages/gsd-agent-core/dist/lifecycle-hooks.js.map +1 -0
- package/packages/gsd-agent-core/dist/retry-handler.d.ts +128 -0
- package/packages/gsd-agent-core/dist/retry-handler.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/retry-handler.js +518 -0
- package/packages/gsd-agent-core/dist/retry-handler.js.map +1 -0
- package/packages/gsd-agent-core/dist/sdk.d.ts +159 -0
- package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/sdk.js +375 -0
- package/packages/gsd-agent-core/dist/sdk.js.map +1 -0
- package/packages/gsd-agent-core/dist/system-prompt.d.ts +28 -0
- package/packages/gsd-agent-core/dist/system-prompt.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/system-prompt.js +201 -0
- package/packages/gsd-agent-core/dist/system-prompt.js.map +1 -0
- package/packages/gsd-agent-core/package.json +25 -0
- package/packages/gsd-agent-core/scripts/copy-assets.cjs +43 -0
- package/packages/gsd-agent-core/src/agent-session.test.ts +169 -0
- package/packages/gsd-agent-core/src/agent-session.ts +3358 -0
- package/packages/gsd-agent-core/src/artifact-manager.ts +126 -0
- package/packages/gsd-agent-core/src/bash-executor.ts +352 -0
- package/packages/gsd-agent-core/src/blob-store.ts +154 -0
- package/packages/gsd-agent-core/src/compaction/branch-summarization.ts +317 -0
- package/packages/gsd-agent-core/src/compaction/compaction.ts +855 -0
- package/packages/gsd-agent-core/src/compaction/index.ts +7 -0
- package/packages/gsd-agent-core/src/compaction/utils.ts +312 -0
- package/packages/gsd-agent-core/src/compaction-orchestrator.ts +449 -0
- package/packages/gsd-agent-core/src/contextual-tips.ts +232 -0
- package/packages/gsd-agent-core/src/export-html/ansi-to-html.ts +259 -0
- package/packages/gsd-agent-core/src/export-html/index.ts +345 -0
- package/packages/gsd-agent-core/src/export-html/template.css +971 -0
- package/packages/gsd-agent-core/src/export-html/template.html +54 -0
- package/packages/gsd-agent-core/src/export-html/template.js +1583 -0
- package/packages/gsd-agent-core/src/export-html/tool-renderer.ts +114 -0
- package/packages/gsd-agent-core/src/export-html/vendor/highlight.min.js +1213 -0
- package/packages/gsd-agent-core/src/export-html/vendor/marked.min.js +6 -0
- package/packages/gsd-agent-core/src/fallback-resolver.ts +193 -0
- package/packages/gsd-agent-core/src/image-overflow-recovery.ts +120 -0
- package/packages/gsd-agent-core/src/index.ts +68 -0
- package/packages/gsd-agent-core/src/keybindings.ts +220 -0
- package/packages/gsd-agent-core/src/lifecycle-hooks.ts +284 -0
- package/packages/gsd-agent-core/src/retry-handler.ts +620 -0
- package/packages/gsd-agent-core/src/sdk.ts +550 -0
- package/packages/gsd-agent-core/src/system-prompt.ts +270 -0
- package/packages/gsd-agent-core/tsconfig.json +28 -0
- package/packages/gsd-agent-core/tsconfig.tsbuildinfo +1 -0
- package/packages/gsd-agent-modes/dist/cli/args.d.ts +58 -0
- package/packages/gsd-agent-modes/dist/cli/args.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/args.js +324 -0
- package/packages/gsd-agent-modes/dist/cli/args.js.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts +13 -0
- package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/config-selector.js +32 -0
- package/packages/gsd-agent-modes/dist/cli/config-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts +15 -0
- package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/file-processor.js +86 -0
- package/packages/gsd-agent-modes/dist/cli/file-processor.js.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/list-models.d.ts +21 -0
- package/packages/gsd-agent-modes/dist/cli/list-models.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/list-models.js +114 -0
- package/packages/gsd-agent-modes/dist/cli/list-models.js.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts +10 -0
- package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/cli/session-picker.js +37 -0
- package/packages/gsd-agent-modes/dist/cli/session-picker.js.map +1 -0
- package/packages/gsd-agent-modes/dist/index.d.ts +7 -0
- package/packages/gsd-agent-modes/dist/index.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/index.js +7 -0
- package/packages/gsd-agent-modes/dist/index.js.map +1 -0
- package/packages/gsd-agent-modes/dist/main.d.ts +8 -0
- package/packages/gsd-agent-modes/dist/main.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/main.js +491 -0
- package/packages/gsd-agent-modes/dist/main.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts +34 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js +330 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +29 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +141 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts +36 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +157 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js +48 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +43 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts +11 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js +47 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +44 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js +474 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts +15 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js +32 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +22 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +70 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js +75 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js +140 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts +12 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js +133 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts +33 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js +82 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js +111 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts +24 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js +63 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts +33 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js +118 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +32 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +230 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts +34 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js +36 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts +48 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js +72 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +63 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +213 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts +86 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js +536 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js +93 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts +30 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js +169 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js +267 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts +21 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts +97 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js +810 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +71 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +320 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js +34 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +46 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js +45 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js +46 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts +15 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js +40 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +111 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +984 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js +61 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts +109 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js +1035 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js +112 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +12 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +38 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +27 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +793 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +62 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts +22 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +118 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts +7 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js +68 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +50 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +358 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +3409 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts +77 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js +529 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js +15 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts +28 -0
- package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/print-mode.js +84 -0
- package/packages/gsd-agent-modes/dist/modes/print-mode.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts +17 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js +49 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts +37 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js +84 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts +243 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js +464 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts +25 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +750 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts +511 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js +8 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts +19 -0
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js +45 -0
- package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js.map +1 -0
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts +22 -0
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js +21 -0
- package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js.map +1 -0
- package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts +4 -0
- package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/pi-tui-compat.js +3 -0
- package/packages/gsd-agent-modes/dist/pi-tui-compat.js.map +1 -0
- package/packages/gsd-agent-modes/dist/theme.d.ts +15 -0
- package/packages/gsd-agent-modes/dist/theme.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/theme.js +23 -0
- package/packages/gsd-agent-modes/dist/theme.js.map +1 -0
- package/packages/gsd-agent-modes/dist/utils/theme.d.ts +16 -0
- package/packages/gsd-agent-modes/dist/utils/theme.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/utils/theme.js +11 -0
- package/packages/gsd-agent-modes/dist/utils/theme.js.map +1 -0
- package/packages/gsd-agent-modes/package.json +23 -0
- package/packages/gsd-agent-modes/src/cli/args.ts +350 -0
- package/packages/gsd-agent-modes/src/cli/config-selector.ts +54 -0
- package/packages/gsd-agent-modes/src/cli/file-processor.ts +107 -0
- package/packages/gsd-agent-modes/src/cli/list-models.ts +141 -0
- package/packages/gsd-agent-modes/src/cli/session-picker.ts +59 -0
- package/packages/gsd-agent-modes/src/index.ts +6 -0
- package/packages/gsd-agent-modes/src/main.ts +614 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/provider-display-name.test.ts +18 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/timestamp.test.ts +38 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/tool-execution.test.ts +171 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/armin.ts +382 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/assistant-message.ts +178 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/bash-execution.ts +212 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/bordered-loader.ts +66 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/branch-summary-message.ts +59 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/chat-frame.ts +67 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/compaction-summary-message.ts +60 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/config-selector.ts +597 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/countdown-timer.ts +41 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/custom-editor.ts +88 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/custom-message.ts +100 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/daxnuts.ts +165 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/diff.ts +147 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.test.ts +73 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.ts +89 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/extension-editor.ts +151 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/extension-input.ts +100 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/extension-selector.ts +156 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/footer.ts +257 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/index.ts +35 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/keybinding-hints.ts +84 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/login-dialog.ts +257 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/model-selector.ts +656 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/oauth-selector.ts +122 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/provider-manager.ts +210 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/scoped-models-selector.ts +342 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector-search.ts +194 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector.ts +1011 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/settings-selector.ts +452 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/show-images-selector.ts +45 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/skill-invocation-message.ts +56 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/theme-selector.ts +63 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/thinking-selector.ts +64 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/timestamp.ts +48 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/tool-execution.ts +1157 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/tree-render-utils.ts +81 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/tree-selector.ts +1208 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/user-message-selector.ts +145 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/user-message.ts +44 -0
- package/packages/gsd-agent-modes/src/modes/interactive/components/visual-truncate.ts +50 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller-ordering.test.ts +1430 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.test.ts +71 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.ts +957 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/extension-ui-controller.ts +63 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.test.ts +183 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.ts +140 -0
- package/packages/gsd-agent-modes/src/modes/interactive/controllers/model-controller.ts +77 -0
- package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-ordering.test.ts +44 -0
- package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-state.ts +49 -0
- package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode.ts +4195 -0
- package/packages/gsd-agent-modes/src/modes/interactive/slash-command-handlers.ts +670 -0
- package/packages/gsd-agent-modes/src/modes/interactive/utils/shorten-path.ts +14 -0
- package/packages/gsd-agent-modes/src/modes/print-mode.ts +106 -0
- package/packages/gsd-agent-modes/src/modes/rpc/jsonl.ts +58 -0
- package/packages/gsd-agent-modes/src/modes/rpc/remote-terminal.ts +109 -0
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-client.ts +572 -0
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-mode.ts +902 -0
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-protocol-v2.test.ts +971 -0
- package/packages/gsd-agent-modes/src/modes/rpc/rpc-types.ts +335 -0
- package/packages/gsd-agent-modes/src/modes/shared/command-context-actions.ts +53 -0
- package/packages/gsd-agent-modes/src/pi-coding-agent-compat.ts +42 -0
- package/packages/gsd-agent-modes/src/pi-tui-compat.ts +4 -0
- package/packages/gsd-agent-modes/src/theme.ts +25 -0
- package/packages/gsd-agent-modes/src/utils/theme.ts +24 -0
- package/packages/gsd-agent-modes/tsconfig.json +28 -0
- package/packages/gsd-agent-modes/tsconfig.tsbuildinfo +1 -0
- package/packages/gsd-agent-types/dist/index.d.ts +176 -0
- package/packages/gsd-agent-types/dist/index.d.ts.map +1 -0
- package/packages/gsd-agent-types/dist/index.js +24 -0
- package/packages/gsd-agent-types/dist/index.js.map +1 -0
- package/packages/gsd-agent-types/package.json +24 -0
- package/packages/gsd-agent-types/src/index.ts +206 -0
- package/packages/gsd-agent-types/tsconfig.json +25 -0
- package/packages/gsd-agent-types/tsconfig.tsbuildinfo +1 -0
- package/packages/mcp-server/dist/remote-questions.d.ts +45 -0
- package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -0
- package/packages/mcp-server/dist/remote-questions.js +732 -0
- package/packages/mcp-server/dist/remote-questions.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +7 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +77 -11
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts +14 -0
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +49 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +163 -25
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +4 -3
- package/packages/mcp-server/src/mcp-server.test.ts +67 -0
- package/packages/mcp-server/src/remote-questions.test.ts +294 -0
- package/packages/mcp-server/src/remote-questions.ts +916 -0
- package/packages/mcp-server/src/server.ts +94 -18
- package/packages/mcp-server/src/session-manager.ts +43 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +146 -1
- package/packages/mcp-server/src/workflow-tools.ts +215 -43
- package/packages/mcp-server/tsconfig.test.json +19 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/dist/tsconfig.tsbuildinfo +1 -0
- package/packages/native/package.json +1 -1
- package/packages/native/tsconfig.json +2 -1
- package/packages/pi-agent-core/dist/agent-loop.js +12 -0
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/types.d.ts +30 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +14 -0
- package/packages/pi-agent-core/src/types.ts +34 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/custom.d.ts +38 -0
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/custom.js +41 -0
- package/packages/pi-ai/dist/models/custom.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +13 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +27 -4
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +13 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +80 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +60 -15
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.d.ts +10 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +16 -1
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/dist/providers/think-tag-parser.d.ts +17 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.js +75 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.js.map +1 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.js +41 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +12 -2
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +164 -14
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +15 -3
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +67 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +16 -3
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +67 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js +289 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js.map +1 -0
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/models/custom.ts +42 -0
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +1 -1
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -0
- package/packages/pi-ai/src/providers/anthropic-shared.ts +26 -5
- package/packages/pi-ai/src/providers/anthropic.ts +15 -4
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
- package/packages/pi-ai/src/providers/openai-completions.ts +57 -16
- package/packages/pi-ai/src/providers/simple-options.ts +17 -1
- package/packages/pi-ai/src/providers/think-tag-parser.test.ts +44 -0
- package/packages/pi-ai/src/providers/think-tag-parser.ts +94 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +200 -23
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +12 -2
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +84 -0
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +15 -5
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +84 -0
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +16 -5
- package/packages/pi-ai/src/utils/oauth/oauth-providers.test.ts +363 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +3 -2
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +32 -2
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +4 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +35 -2
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +233 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +205 -2
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts +53 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.js +337 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +234 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.d.ts +3 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.js +92 -12
- package/packages/pi-coding-agent/dist/core/model-discovery.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.test.js +16 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js +40 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js +203 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-discovery.test.js +61 -1
- package/packages/pi-coding-agent/dist/core/model-registry-discovery.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +90 -10
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/redact-secrets.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.js +49 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.js +67 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +10 -6
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js +45 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +55 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +5 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js +13 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +7 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +29 -21
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +3 -2
- package/packages/pi-coding-agent/src/core/agent-session.ts +38 -2
- package/packages/pi-coding-agent/src/core/extensions/index.ts +16 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +5 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +351 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +258 -0
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +269 -0
- package/packages/pi-coding-agent/src/core/hooks-runner.ts +460 -0
- package/packages/pi-coding-agent/src/core/index.ts +10 -0
- package/packages/pi-coding-agent/src/core/model-discovery.test.ts +19 -0
- package/packages/pi-coding-agent/src/core/model-discovery.ts +99 -12
- package/packages/pi-coding-agent/src/core/model-registry-auth-header.test.ts +44 -0
- package/packages/pi-coding-agent/src/core/model-registry-custom-caps.test.ts +245 -0
- package/packages/pi-coding-agent/src/core/model-registry-discovery.test.ts +75 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +102 -10
- package/packages/pi-coding-agent/src/core/redact-secrets.test.ts +86 -0
- package/packages/pi-coding-agent/src/core/redact-secrets.ts +58 -0
- package/packages/pi-coding-agent/src/core/session-manager.test.ts +65 -1
- package/packages/pi-coding-agent/src/core/session-manager.ts +10 -6
- package/packages/pi-coding-agent/src/core/settings-manager.ts +57 -0
- package/packages/pi-coding-agent/src/index.ts +16 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +6 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/provider-manager.ts +16 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +36 -22
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +13 -1
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/pkg/dist/core/export-html/ansi-to-html.js +1 -0
- package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/pkg/dist/core/export-html/index.d.ts +1 -1
- package/pkg/dist/core/export-html/index.d.ts.map +1 -1
- package/pkg/dist/core/export-html/index.js +39 -5
- package/pkg/dist/core/export-html/index.js.map +1 -1
- package/pkg/dist/core/export-html/tool-renderer.d.ts +2 -2
- package/pkg/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/pkg/dist/core/export-html/tool-renderer.js.map +1 -1
- package/pkg/package.json +1 -1
- package/scripts/ensure-workspace-builds.cjs +2 -0
- package/scripts/install.js +512 -0
- package/scripts/link-workspace-packages.cjs +3 -0
- package/scripts/postinstall.js +9 -178
- package/src/resources/agents/researcher.md +1 -1
- package/src/resources/extensions/async-jobs/async-bash-tool.ts +1 -1
- package/src/resources/extensions/aws-auth/index.ts +2 -1
- package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +4 -7
- package/src/resources/extensions/bg-shell/index.ts +2 -1
- package/src/resources/extensions/bg-shell/process-manager.ts +2 -1
- package/src/resources/extensions/browser-tools/index.ts +2 -1
- package/src/resources/extensions/claude-code-cli/index.ts +1 -1
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +115 -23
- package/src/resources/extensions/claude-code-cli/readiness.ts +32 -8
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +97 -26
- package/src/resources/extensions/claude-code-cli/tests/provider-registration.test.ts +27 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +176 -8
- package/src/resources/extensions/gsd/auto/loop-deps.ts +14 -0
- package/src/resources/extensions/gsd/auto/loop.ts +9 -0
- package/src/resources/extensions/gsd/auto/phases.ts +131 -10
- package/src/resources/extensions/gsd/auto/run-unit.ts +40 -2
- package/src/resources/extensions/gsd/auto/session.ts +35 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +59 -16
- package/src/resources/extensions/gsd/auto-model-selection.ts +71 -15
- package/src/resources/extensions/gsd/auto-post-unit.ts +62 -3
- package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +62 -1
- package/src/resources/extensions/gsd/auto-start.ts +80 -74
- package/src/resources/extensions/gsd/auto-verification.ts +33 -0
- package/src/resources/extensions/gsd/auto-worktree.ts +62 -63
- package/src/resources/extensions/gsd/auto.ts +73 -28
- package/src/resources/extensions/gsd/blocked-models.ts +98 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +120 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +40 -9
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +109 -0
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +5 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +15 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +54 -6
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +89 -26
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +35 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +111 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +55 -90
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +898 -32
- package/src/resources/extensions/gsd/compaction-snapshot.ts +165 -0
- package/src/resources/extensions/gsd/complexity-classifier.ts +5 -3
- package/src/resources/extensions/gsd/db-writer.ts +88 -17
- package/src/resources/extensions/gsd/dispatch-guard.ts +44 -2
- package/src/resources/extensions/gsd/doctor-git-checks.ts +23 -27
- package/src/resources/extensions/gsd/doctor-providers.ts +59 -6
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +2 -0
- package/src/resources/extensions/gsd/error-classifier.ts +36 -3
- package/src/resources/extensions/gsd/exec-history.ts +153 -0
- package/src/resources/extensions/gsd/exec-sandbox.ts +326 -0
- package/src/resources/extensions/gsd/gitignore.ts +1 -1
- package/src/resources/extensions/gsd/gsd-db.ts +186 -23
- package/src/resources/extensions/gsd/guided-flow.ts +223 -2
- package/src/resources/extensions/gsd/health-widget.ts +3 -1
- package/src/resources/extensions/gsd/hook-emitter.ts +188 -0
- package/src/resources/extensions/gsd/init-wizard.ts +15 -1
- package/src/resources/extensions/gsd/journal.ts +2 -1
- package/src/resources/extensions/gsd/key-manager.ts +28 -0
- package/src/resources/extensions/gsd/memory-backfill.ts +140 -0
- package/src/resources/extensions/gsd/memory-store.ts +26 -0
- package/src/resources/extensions/gsd/model-router.ts +42 -1
- package/src/resources/extensions/gsd/pre-execution-checks.ts +46 -10
- package/src/resources/extensions/gsd/preferences-types.ts +46 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +79 -0
- package/src/resources/extensions/gsd/preferences.ts +17 -17
- package/src/resources/extensions/gsd/prompt-loader.ts +30 -7
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/debug-diagnose.md +2 -0
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
- package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/src/resources/extensions/gsd/prompts/execute-task.md +3 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +17 -4
- package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
- package/src/resources/extensions/gsd/state.ts +45 -4
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +188 -2
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +95 -1
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +122 -0
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +33 -3
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/blocked-models.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/bundled-skill-triggers.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +68 -66
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +8 -4
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +9 -9
- package/src/resources/extensions/gsd/tests/dispatch-guard-summary-db-mismatch.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +148 -3
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +306 -1
- package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +237 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +210 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +58 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +40 -9
- package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +447 -1
- package/src/resources/extensions/gsd/tests/init-wizard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git-symlink-cwd.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +78 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/integration/worktree-e2e.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/load-memory-block.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +356 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +110 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/prompt-loader-extension-dir.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +103 -4
- package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +388 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -0
- package/src/resources/extensions/gsd/tests/save-gate-result-render.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +413 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +32 -40
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/token-counter.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/tool-compatibility.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +136 -8
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +65 -2
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +78 -5
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +3 -1
- package/src/resources/extensions/gsd/token-counter.ts +22 -5
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +81 -0
- package/src/resources/extensions/gsd/tools/exec-tool.ts +183 -0
- package/src/resources/extensions/gsd/tools/memory-tools.ts +31 -1
- package/src/resources/extensions/gsd/tools/resume-tool.ts +40 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +26 -3
- package/src/resources/extensions/gsd/workflow-logger.ts +4 -1
- package/src/resources/extensions/gsd/workflow-mcp.ts +3 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +6 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
- package/src/resources/extensions/mcp-client/index.ts +1 -1
- package/src/resources/extensions/ollama/index.ts +3 -3
- package/src/resources/extensions/ollama/ollama-chat-provider.ts +6 -18
- package/src/resources/extensions/remote-questions/config.ts +15 -4
- package/src/resources/extensions/search-the-web/command-search-provider.ts +5 -4
- package/src/resources/extensions/search-the-web/index.ts +2 -1
- package/src/resources/extensions/search-the-web/native-search.ts +48 -12
- package/src/resources/extensions/shared/tests/format-utils.test.ts +5 -3
- package/src/resources/extensions/universal-config/index.ts +1 -1
- package/src/resources/skills/api-design/SKILL.md +190 -0
- package/src/resources/skills/create-mcp-server/SKILL.md +121 -0
- package/src/resources/skills/decompose-into-slices/SKILL.md +139 -0
- package/src/resources/skills/dependency-upgrade/SKILL.md +158 -0
- package/src/resources/skills/design-an-interface/SKILL.md +102 -0
- package/src/resources/skills/forensics/SKILL.md +153 -0
- package/src/resources/skills/grill-me/SKILL.md +93 -0
- package/src/resources/skills/handoff/SKILL.md +121 -0
- package/src/resources/skills/observability/SKILL.md +174 -0
- package/src/resources/skills/security-review/SKILL.md +181 -0
- package/src/resources/skills/spike-wrap-up/SKILL.md +138 -0
- package/src/resources/skills/tdd/SKILL.md +112 -0
- package/src/resources/skills/verify-before-complete/SKILL.md +98 -0
- package/src/resources/skills/write-docs/SKILL.md +82 -0
- package/src/resources/skills/write-milestone-brief/SKILL.md +135 -0
- package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +0 -9
- package/dist/web/standalone/.next/static/chunks/app/page-151349214571e2b6.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- package/packages/native/tsconfig.tsbuildinfo +0 -1
- /package/dist/web/standalone/.next/static/{ssX7BLv3Dw9Fb4CtrCGeR → gy6_foLMsEzdGBT19c3hr}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{ssX7BLv3Dw9Fb4CtrCGeR → gy6_foLMsEzdGBT19c3hr}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC Client for programmatic access to the coding agent.
|
|
3
|
+
*
|
|
4
|
+
* Spawns the agent in RPC mode and provides a typed API for all operations.
|
|
5
|
+
*/
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
7
|
+
import { attachJsonlLineReader, serializeJsonLine } from "./jsonl.js";
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// RPC Client
|
|
10
|
+
// ============================================================================
|
|
11
|
+
export class RpcClient {
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.options = options;
|
|
14
|
+
this.process = null;
|
|
15
|
+
this.stopReadingStdout = null;
|
|
16
|
+
this.eventListeners = [];
|
|
17
|
+
this.pendingRequests = new Map();
|
|
18
|
+
this.requestId = 0;
|
|
19
|
+
this.stderr = "";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Start the RPC agent process.
|
|
23
|
+
*/
|
|
24
|
+
async start() {
|
|
25
|
+
if (this.process) {
|
|
26
|
+
throw new Error("Client already started");
|
|
27
|
+
}
|
|
28
|
+
const cliPath = this.options.cliPath ?? "dist/cli.js";
|
|
29
|
+
const args = ["--mode", "rpc"];
|
|
30
|
+
if (this.options.provider) {
|
|
31
|
+
args.push("--provider", this.options.provider);
|
|
32
|
+
}
|
|
33
|
+
if (this.options.model) {
|
|
34
|
+
args.push("--model", this.options.model);
|
|
35
|
+
}
|
|
36
|
+
if (this.options.args) {
|
|
37
|
+
args.push(...this.options.args);
|
|
38
|
+
}
|
|
39
|
+
this.process = spawn("node", [cliPath, ...args], {
|
|
40
|
+
cwd: this.options.cwd,
|
|
41
|
+
env: { ...process.env, ...this.options.env },
|
|
42
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
43
|
+
});
|
|
44
|
+
// Collect stderr for debugging
|
|
45
|
+
this._stderrHandler = (data) => {
|
|
46
|
+
this.stderr += data.toString();
|
|
47
|
+
};
|
|
48
|
+
this.process.stderr?.on("data", this._stderrHandler);
|
|
49
|
+
// Set up strict JSONL reader for stdout.
|
|
50
|
+
this.stopReadingStdout = attachJsonlLineReader(this.process.stdout, (line) => {
|
|
51
|
+
this.handleLine(line);
|
|
52
|
+
});
|
|
53
|
+
// Detect unexpected subprocess exit and reject all pending requests
|
|
54
|
+
this.process.on("exit", (code, signal) => {
|
|
55
|
+
if (this.pendingRequests.size > 0) {
|
|
56
|
+
const reason = signal ? `signal ${signal}` : `code ${code}`;
|
|
57
|
+
const error = new Error(`Agent process exited unexpectedly (${reason}). Stderr: ${this.stderr}`);
|
|
58
|
+
for (const [id, pending] of this.pendingRequests) {
|
|
59
|
+
this.pendingRequests.delete(id);
|
|
60
|
+
pending.reject(error);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
// Wait a moment for process to initialize
|
|
65
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
66
|
+
if (this.process.exitCode !== null) {
|
|
67
|
+
throw new Error(`Agent process exited immediately with code ${this.process.exitCode}. Stderr: ${this.stderr}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Stop the RPC agent process.
|
|
72
|
+
*/
|
|
73
|
+
async stop() {
|
|
74
|
+
if (!this.process)
|
|
75
|
+
return;
|
|
76
|
+
this.stopReadingStdout?.();
|
|
77
|
+
this.stopReadingStdout = null;
|
|
78
|
+
if (this._stderrHandler) {
|
|
79
|
+
this.process.stderr?.removeListener("data", this._stderrHandler);
|
|
80
|
+
this._stderrHandler = undefined;
|
|
81
|
+
}
|
|
82
|
+
this.process.kill("SIGTERM");
|
|
83
|
+
// Wait for process to exit
|
|
84
|
+
await new Promise((resolve) => {
|
|
85
|
+
const timeout = setTimeout(() => {
|
|
86
|
+
this.process?.kill("SIGKILL");
|
|
87
|
+
resolve();
|
|
88
|
+
}, 1000);
|
|
89
|
+
this.process?.on("exit", () => {
|
|
90
|
+
clearTimeout(timeout);
|
|
91
|
+
resolve();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
this.process = null;
|
|
95
|
+
this.pendingRequests.clear();
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Subscribe to agent events.
|
|
99
|
+
*/
|
|
100
|
+
onEvent(listener) {
|
|
101
|
+
this.eventListeners.push(listener);
|
|
102
|
+
return () => {
|
|
103
|
+
const index = this.eventListeners.indexOf(listener);
|
|
104
|
+
if (index !== -1) {
|
|
105
|
+
this.eventListeners.splice(index, 1);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get collected stderr output (useful for debugging).
|
|
111
|
+
*/
|
|
112
|
+
getStderr() {
|
|
113
|
+
return this.stderr;
|
|
114
|
+
}
|
|
115
|
+
// =========================================================================
|
|
116
|
+
// Command Methods
|
|
117
|
+
// =========================================================================
|
|
118
|
+
/**
|
|
119
|
+
* Send a prompt to the agent.
|
|
120
|
+
* Returns immediately after sending; use onEvent() to receive streaming events.
|
|
121
|
+
* Use waitForIdle() to wait for completion.
|
|
122
|
+
*/
|
|
123
|
+
async prompt(message, images) {
|
|
124
|
+
await this.send({ type: "prompt", message, images });
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Queue a steering message to interrupt the agent mid-run.
|
|
128
|
+
*/
|
|
129
|
+
async steer(message, images) {
|
|
130
|
+
await this.send({ type: "steer", message, images });
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Queue a follow-up message to be processed after the agent finishes.
|
|
134
|
+
*/
|
|
135
|
+
async followUp(message, images) {
|
|
136
|
+
await this.send({ type: "follow_up", message, images });
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Abort current operation.
|
|
140
|
+
*/
|
|
141
|
+
async abort() {
|
|
142
|
+
await this.send({ type: "abort" });
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Start a new session, optionally with parent tracking.
|
|
146
|
+
* @param parentSession - Optional parent session path for lineage tracking
|
|
147
|
+
* @returns Object with `cancelled: true` if an extension cancelled the new session
|
|
148
|
+
*/
|
|
149
|
+
async newSession(parentSession) {
|
|
150
|
+
const response = await this.send({ type: "new_session", parentSession });
|
|
151
|
+
return this.getData(response);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get current session state.
|
|
155
|
+
*/
|
|
156
|
+
async getState() {
|
|
157
|
+
const response = await this.send({ type: "get_state" });
|
|
158
|
+
return this.getData(response);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Set model by provider and ID.
|
|
162
|
+
*/
|
|
163
|
+
async setModel(provider, modelId) {
|
|
164
|
+
const response = await this.send({ type: "set_model", provider, modelId });
|
|
165
|
+
return this.getData(response);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Cycle to next model.
|
|
169
|
+
*/
|
|
170
|
+
async cycleModel() {
|
|
171
|
+
const response = await this.send({ type: "cycle_model" });
|
|
172
|
+
return this.getData(response);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get list of available models.
|
|
176
|
+
*/
|
|
177
|
+
async getAvailableModels() {
|
|
178
|
+
const response = await this.send({ type: "get_available_models" });
|
|
179
|
+
return this.getData(response).models;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Set thinking level.
|
|
183
|
+
*/
|
|
184
|
+
async setThinkingLevel(level) {
|
|
185
|
+
await this.send({ type: "set_thinking_level", level });
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Cycle thinking level.
|
|
189
|
+
*/
|
|
190
|
+
async cycleThinkingLevel() {
|
|
191
|
+
const response = await this.send({ type: "cycle_thinking_level" });
|
|
192
|
+
return this.getData(response);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Set steering mode.
|
|
196
|
+
*/
|
|
197
|
+
async setSteeringMode(mode) {
|
|
198
|
+
await this.send({ type: "set_steering_mode", mode });
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Set follow-up mode.
|
|
202
|
+
*/
|
|
203
|
+
async setFollowUpMode(mode) {
|
|
204
|
+
await this.send({ type: "set_follow_up_mode", mode });
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Compact session context.
|
|
208
|
+
*/
|
|
209
|
+
async compact(customInstructions) {
|
|
210
|
+
const response = await this.send({ type: "compact", customInstructions });
|
|
211
|
+
return this.getData(response);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Set auto-compaction enabled/disabled.
|
|
215
|
+
*/
|
|
216
|
+
async setAutoCompaction(enabled) {
|
|
217
|
+
await this.send({ type: "set_auto_compaction", enabled });
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Set auto-retry enabled/disabled.
|
|
221
|
+
*/
|
|
222
|
+
async setAutoRetry(enabled) {
|
|
223
|
+
await this.send({ type: "set_auto_retry", enabled });
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Abort in-progress retry.
|
|
227
|
+
*/
|
|
228
|
+
async abortRetry() {
|
|
229
|
+
await this.send({ type: "abort_retry" });
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Execute a bash command.
|
|
233
|
+
*/
|
|
234
|
+
async bash(command) {
|
|
235
|
+
const response = await this.send({ type: "bash", command });
|
|
236
|
+
return this.getData(response);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Abort running bash command.
|
|
240
|
+
*/
|
|
241
|
+
async abortBash() {
|
|
242
|
+
await this.send({ type: "abort_bash" });
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get session statistics.
|
|
246
|
+
*/
|
|
247
|
+
async getSessionStats() {
|
|
248
|
+
const response = await this.send({ type: "get_session_stats" });
|
|
249
|
+
return this.getData(response);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Export session to HTML.
|
|
253
|
+
*/
|
|
254
|
+
async exportHtml(outputPath) {
|
|
255
|
+
const response = await this.send({ type: "export_html", outputPath });
|
|
256
|
+
return this.getData(response);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Switch to a different session file.
|
|
260
|
+
* @returns Object with `cancelled: true` if an extension cancelled the switch
|
|
261
|
+
*/
|
|
262
|
+
async switchSession(sessionPath) {
|
|
263
|
+
const response = await this.send({ type: "switch_session", sessionPath });
|
|
264
|
+
return this.getData(response);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Fork from a specific message.
|
|
268
|
+
* @returns Object with `text` (the message text) and `cancelled` (if extension cancelled)
|
|
269
|
+
*/
|
|
270
|
+
async fork(entryId) {
|
|
271
|
+
const response = await this.send({ type: "fork", entryId });
|
|
272
|
+
return this.getData(response);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Get messages available for forking.
|
|
276
|
+
*/
|
|
277
|
+
async getForkMessages() {
|
|
278
|
+
const response = await this.send({ type: "get_fork_messages" });
|
|
279
|
+
return this.getData(response).messages;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Get text of last assistant message.
|
|
283
|
+
*/
|
|
284
|
+
async getLastAssistantText() {
|
|
285
|
+
const response = await this.send({ type: "get_last_assistant_text" });
|
|
286
|
+
return this.getData(response).text;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Set the session display name.
|
|
290
|
+
*/
|
|
291
|
+
async setSessionName(name) {
|
|
292
|
+
await this.send({ type: "set_session_name", name });
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Get all messages in the session.
|
|
296
|
+
*/
|
|
297
|
+
async getMessages() {
|
|
298
|
+
const response = await this.send({ type: "get_messages" });
|
|
299
|
+
return this.getData(response).messages;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Get available commands (extension commands, prompt templates, skills).
|
|
303
|
+
*/
|
|
304
|
+
async getCommands() {
|
|
305
|
+
const response = await this.send({ type: "get_commands" });
|
|
306
|
+
return this.getData(response).commands;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Send a UI response to a pending extension_ui_request.
|
|
310
|
+
* Fire-and-forget — no request/response correlation.
|
|
311
|
+
*/
|
|
312
|
+
sendUIResponse(id, response) {
|
|
313
|
+
if (!this.process?.stdin) {
|
|
314
|
+
throw new Error("Client not started");
|
|
315
|
+
}
|
|
316
|
+
this.process.stdin.write(serializeJsonLine({
|
|
317
|
+
type: "extension_ui_response",
|
|
318
|
+
id,
|
|
319
|
+
...response,
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Initialize a v2 protocol session. Must be sent as the first command.
|
|
324
|
+
* Returns the negotiated protocol version, session ID, and server capabilities.
|
|
325
|
+
*/
|
|
326
|
+
async init(options) {
|
|
327
|
+
const response = await this.send({ type: "init", protocolVersion: 2, clientId: options?.clientId });
|
|
328
|
+
return this.getData(response);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Request a graceful shutdown of the agent process.
|
|
332
|
+
* Waits for the response before the process exits.
|
|
333
|
+
*/
|
|
334
|
+
async shutdown() {
|
|
335
|
+
await this.send({ type: "shutdown" });
|
|
336
|
+
// Wait for process to exit after shutdown acknowledgment
|
|
337
|
+
if (this.process) {
|
|
338
|
+
await new Promise((resolve) => {
|
|
339
|
+
const timeout = setTimeout(() => {
|
|
340
|
+
this.process?.kill("SIGKILL");
|
|
341
|
+
resolve();
|
|
342
|
+
}, 5000);
|
|
343
|
+
this.process?.on("exit", () => {
|
|
344
|
+
clearTimeout(timeout);
|
|
345
|
+
resolve();
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Subscribe to specific event types (v2 only).
|
|
352
|
+
* Pass ["*"] to receive all events, or a list of event type strings to filter.
|
|
353
|
+
*/
|
|
354
|
+
async subscribe(events) {
|
|
355
|
+
await this.send({ type: "subscribe", events });
|
|
356
|
+
}
|
|
357
|
+
// =========================================================================
|
|
358
|
+
// Helpers
|
|
359
|
+
// =========================================================================
|
|
360
|
+
/**
|
|
361
|
+
* Wait for agent to become idle (no streaming).
|
|
362
|
+
* Resolves when agent_end event is received.
|
|
363
|
+
*/
|
|
364
|
+
waitForIdle(timeout = 60000) {
|
|
365
|
+
return new Promise((resolve, reject) => {
|
|
366
|
+
const timer = setTimeout(() => {
|
|
367
|
+
unsubscribe();
|
|
368
|
+
reject(new Error(`Timeout waiting for agent to become idle. Stderr: ${this.stderr}`));
|
|
369
|
+
}, timeout);
|
|
370
|
+
const unsubscribe = this.onEvent((event) => {
|
|
371
|
+
if (event.type === "agent_end") {
|
|
372
|
+
clearTimeout(timer);
|
|
373
|
+
unsubscribe();
|
|
374
|
+
resolve();
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Collect events until agent becomes idle.
|
|
381
|
+
*/
|
|
382
|
+
collectEvents(timeout = 60000) {
|
|
383
|
+
return new Promise((resolve, reject) => {
|
|
384
|
+
const events = [];
|
|
385
|
+
const timer = setTimeout(() => {
|
|
386
|
+
unsubscribe();
|
|
387
|
+
reject(new Error(`Timeout collecting events. Stderr: ${this.stderr}`));
|
|
388
|
+
}, timeout);
|
|
389
|
+
const unsubscribe = this.onEvent((event) => {
|
|
390
|
+
events.push(event);
|
|
391
|
+
if (event.type === "agent_end") {
|
|
392
|
+
clearTimeout(timer);
|
|
393
|
+
unsubscribe();
|
|
394
|
+
resolve(events);
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Send prompt and wait for completion, returning all events.
|
|
401
|
+
*/
|
|
402
|
+
async promptAndWait(message, images, timeout = 60000) {
|
|
403
|
+
const eventsPromise = this.collectEvents(timeout);
|
|
404
|
+
await this.prompt(message, images);
|
|
405
|
+
return eventsPromise;
|
|
406
|
+
}
|
|
407
|
+
// =========================================================================
|
|
408
|
+
// Internal
|
|
409
|
+
// =========================================================================
|
|
410
|
+
handleLine(line) {
|
|
411
|
+
try {
|
|
412
|
+
const data = JSON.parse(line);
|
|
413
|
+
// Check if it's a response to a pending request
|
|
414
|
+
if (data.type === "response" && data.id && this.pendingRequests.has(data.id)) {
|
|
415
|
+
const pending = this.pendingRequests.get(data.id);
|
|
416
|
+
this.pendingRequests.delete(data.id);
|
|
417
|
+
pending.resolve(data);
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
// Otherwise it's an event
|
|
421
|
+
for (const listener of this.eventListeners) {
|
|
422
|
+
listener(data);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
catch {
|
|
426
|
+
// Ignore non-JSON lines
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
async send(command) {
|
|
430
|
+
if (!this.process?.stdin) {
|
|
431
|
+
throw new Error("Client not started");
|
|
432
|
+
}
|
|
433
|
+
const id = `req_${++this.requestId}`;
|
|
434
|
+
const fullCommand = { ...command, id };
|
|
435
|
+
return new Promise((resolve, reject) => {
|
|
436
|
+
const timeout = setTimeout(() => {
|
|
437
|
+
this.pendingRequests.delete(id);
|
|
438
|
+
reject(new Error(`Timeout waiting for response to ${command.type}. Stderr: ${this.stderr}`));
|
|
439
|
+
}, 30000);
|
|
440
|
+
this.pendingRequests.set(id, {
|
|
441
|
+
resolve: (response) => {
|
|
442
|
+
clearTimeout(timeout);
|
|
443
|
+
resolve(response);
|
|
444
|
+
},
|
|
445
|
+
reject: (error) => {
|
|
446
|
+
clearTimeout(timeout);
|
|
447
|
+
reject(error);
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
this.process.stdin.write(serializeJsonLine(fullCommand));
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
getData(response) {
|
|
454
|
+
if (!response.success) {
|
|
455
|
+
const errorResponse = response;
|
|
456
|
+
throw new Error(errorResponse.error);
|
|
457
|
+
}
|
|
458
|
+
// Type assertion: we trust response.data matches T based on the command sent.
|
|
459
|
+
// This is safe because each public method specifies the correct T for its command.
|
|
460
|
+
const successResponse = response;
|
|
461
|
+
return successResponse.data;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
//# sourceMappingURL=rpc-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-client.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI9D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAqCtE,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAM,OAAO,SAAS;IAUrB,YAAoB,UAA4B,EAAE;QAA9B,YAAO,GAAP,OAAO,CAAuB;QAT1C,YAAO,GAAwB,IAAI,CAAC;QACpC,sBAAiB,GAAwB,IAAI,CAAC;QAE9C,mBAAc,GAAuB,EAAE,CAAC;QACxC,oBAAe,GACtB,IAAI,GAAG,EAAE,CAAC;QACH,cAAS,GAAG,CAAC,CAAC;QACd,WAAM,GAAG,EAAE,CAAC;IAEiC,CAAC;IAEtD;;OAEG;IACH,KAAK,CAAC,KAAK;QACV,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC3C,CAAC;Q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CAAC,CAAC;gBACnB,CAAC;gBACD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;oBACjB,YAAY,CAAC,OAAO,CAAC,CAAC;oBACtB,MAAM,CAAC,KAAK,CAAC,CAAC;gBACf,CAAC;aACD,CAAC,CAAC;YAEH,IAAI,CAAC,OAAQ,CAAC,KAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACJ,CAAC;IAEO,OAAO,CAAI,QAAqB;QACvC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACvB,MAAM,aAAa,GAAG,QAAoD,CAAC;YAC3E,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;QACD,8EAA8E;QAC9E,mFAAmF;QACnF,MAAM,eAAe,GAAG,QAAkE,CAAC;QAC3F,OAAO,eAAe,CAAC,IAAS,CAAC;IAClC,CAAC;CACD","sourcesContent":["/**\n * RPC Client for programmatic access to the coding agent.\n *\n * Spawns the agent in RPC mode and provides a typed API for all operations.\n */\n\nimport { type ChildProcess, spawn } from \"node:child_process\";\nimport type { AgentEvent, AgentMessage, ThinkingLevel } from \"@gsd/pi-agent-core\";\nimport type { ImageContent } from \"@gsd/pi-ai\";\nimport type { SessionStats, BashResult, CompactionResult } from \"@gsd/agent-types\";\nimport { attachJsonlLineReader, serializeJsonLine } from \"./jsonl.js\";\nimport type { RpcCommand, RpcInitResult, RpcResponse, RpcSessionState, RpcSlashCommand } from \"./rpc-types.js\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/** Distributive Omit that works with union types */\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\n\n/** RpcCommand without the id field (for internal send) */\ntype RpcCommandBody = DistributiveOmit<RpcCommand, \"id\">;\n\nexport interface RpcClientOptions {\n\t/** Path to the CLI entry point (default: searches for dist/cli.js) */\n\tcliPath?: string;\n\t/** Working directory for the agent */\n\tcwd?: string;\n\t/** Environment variables */\n\tenv?: Record<string, string>;\n\t/** Provider to use */\n\tprovider?: string;\n\t/** Model ID to use */\n\tmodel?: string;\n\t/** Additional CLI arguments */\n\targs?: string[];\n}\n\nexport interface ModelInfo {\n\tprovider: string;\n\tid: string;\n\tcontextWindow: number;\n\treasoning: boolean;\n}\n\nexport type RpcEventListener = (event: AgentEvent) => void;\n\n// ============================================================================\n// RPC Client\n// ============================================================================\n\nexport class RpcClient {\n\tprivate process: ChildProcess | null = null;\n\tprivate stopReadingStdout: (() => void) | null = null;\n\tprivate _stderrHandler?: (data: Buffer) => void;\n\tprivate eventListeners: RpcEventListener[] = [];\n\tprivate pendingRequests: Map<string, { resolve: (response: RpcResponse) => void; reject: (error: Error) => void }> =\n\t\tnew Map();\n\tprivate requestId = 0;\n\tprivate stderr = \"\";\n\n\tconstructor(private options: RpcClientOptions = {}) {}\n\n\t/**\n\t * Start the RPC agent process.\n\t */\n\tasync start(): Promise<void> {\n\t\tif (this.process) {\n\t\t\tthrow new Error(\"Client already started\");\n\t\t}\n\n\t\tconst cliPath = this.options.cliPath ?? \"dist/cli.js\";\n\t\tconst args = [\"--mode\", \"rpc\"];\n\n\t\tif (this.options.provider) {\n\t\t\targs.push(\"--provider\", this.options.provider);\n\t\t}\n\t\tif (this.options.model) {\n\t\t\targs.push(\"--model\", this.options.model);\n\t\t}\n\t\tif (this.options.args) {\n\t\t\targs.push(...this.options.args);\n\t\t}\n\n\t\tthis.process = spawn(\"node\", [cliPath, ...args], {\n\t\t\tcwd: this.options.cwd,\n\t\t\tenv: { ...process.env, ...this.options.env },\n\t\t\tstdio: [\"pipe\", \"pipe\", \"pipe\"],\n\t\t});\n\n\t\t// Collect stderr for debugging\n\t\tthis._stderrHandler = (data: Buffer) => {\n\t\t\tthis.stderr += data.toString();\n\t\t};\n\t\tthis.process.stderr?.on(\"data\", this._stderrHandler);\n\n\t\t// Set up strict JSONL reader for stdout.\n\t\tthis.stopReadingStdout = attachJsonlLineReader(this.process.stdout!, (line: string) => {\n\t\t\tthis.handleLine(line);\n\t\t});\n\n\t\t// Detect unexpected subprocess exit and reject all pending requests\n\t\tthis.process.on(\"exit\", (code, signal) => {\n\t\t\tif (this.pendingRequests.size > 0) {\n\t\t\t\tconst reason = signal ? `signal ${signal}` : `code ${code}`;\n\t\t\t\tconst error = new Error(`Agent process exited unexpectedly (${reason}). Stderr: ${this.stderr}`);\n\t\t\t\tfor (const [id, pending] of this.pendingRequests) {\n\t\t\t\t\tthis.pendingRequests.delete(id);\n\t\t\t\t\tpending.reject(error);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Wait a moment for process to initialize\n\t\tawait new Promise((resolve) => setTimeout(resolve, 100));\n\n\t\tif (this.process.exitCode !== null) {\n\t\t\tthrow new Error(`Agent process exited immediately with code ${this.process.exitCode}. Stderr: ${this.stderr}`);\n\t\t}\n\t}\n\n\t/**\n\t * Stop the RPC agent process.\n\t */\n\tasync stop(): Promise<void> {\n\t\tif (!this.process) return;\n\n\t\tthis.stopReadingStdout?.();\n\t\tthis.stopReadingStdout = null;\n\t\tif (this._stderrHandler) {\n\t\t\tthis.process.stderr?.removeListener(\"data\", this._stderrHandler);\n\t\t\tthis._stderrHandler = undefined;\n\t\t}\n\t\tthis.process.kill(\"SIGTERM\");\n\n\t\t// Wait for process to exit\n\t\tawait new Promise<void>((resolve) => {\n\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\tthis.process?.kill(\"SIGKILL\");\n\t\t\t\tresolve();\n\t\t\t}, 1000);\n\n\t\t\tthis.process?.on(\"exit\", () => {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\n\t\tthis.process = null;\n\t\tthis.pendingRequests.clear();\n\t}\n\n\t/**\n\t * Subscribe to agent events.\n\t */\n\tonEvent(listener: RpcEventListener): () => void {\n\t\tthis.eventListeners.push(listener);\n\t\treturn () => {\n\t\t\tconst index = this.eventListeners.indexOf(listener);\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.eventListeners.splice(index, 1);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Get collected stderr output (useful for debugging).\n\t */\n\tgetStderr(): string {\n\t\treturn this.stderr;\n\t}\n\n\t// =========================================================================\n\t// Command Methods\n\t// =========================================================================\n\n\t/**\n\t * Send a prompt to the agent.\n\t * Returns immediately after sending; use onEvent() to receive streaming events.\n\t * Use waitForIdle() to wait for completion.\n\t */\n\tasync prompt(message: string, images?: ImageContent[]): Promise<void> {\n\t\tawait this.send({ type: \"prompt\", message, images });\n\t}\n\n\t/**\n\t * Queue a steering message to interrupt the agent mid-run.\n\t */\n\tasync steer(message: string, images?: ImageContent[]): Promise<void> {\n\t\tawait this.send({ type: \"steer\", message, images });\n\t}\n\n\t/**\n\t * Queue a follow-up message to be processed after the agent finishes.\n\t */\n\tasync followUp(message: string, images?: ImageContent[]): Promise<void> {\n\t\tawait this.send({ type: \"follow_up\", message, images });\n\t}\n\n\t/**\n\t * Abort current operation.\n\t */\n\tasync abort(): Promise<void> {\n\t\tawait this.send({ type: \"abort\" });\n\t}\n\n\t/**\n\t * Start a new session, optionally with parent tracking.\n\t * @param parentSession - Optional parent session path for lineage tracking\n\t * @returns Object with `cancelled: true` if an extension cancelled the new session\n\t */\n\tasync newSession(parentSession?: string): Promise<{ cancelled: boolean }> {\n\t\tconst response = await this.send({ type: \"new_session\", parentSession });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Get current session state.\n\t */\n\tasync getState(): Promise<RpcSessionState> {\n\t\tconst response = await this.send({ type: \"get_state\" });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Set model by provider and ID.\n\t */\n\tasync setModel(provider: string, modelId: string): Promise<{ provider: string; id: string }> {\n\t\tconst response = await this.send({ type: \"set_model\", provider, modelId });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Cycle to next model.\n\t */\n\tasync cycleModel(): Promise<{\n\t\tmodel: { provider: string; id: string };\n\t\tthinkingLevel: ThinkingLevel;\n\t\tisScoped: boolean;\n\t} | null> {\n\t\tconst response = await this.send({ type: \"cycle_model\" });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Get list of available models.\n\t */\n\tasync getAvailableModels(): Promise<ModelInfo[]> {\n\t\tconst response = await this.send({ type: \"get_available_models\" });\n\t\treturn this.getData<{ models: ModelInfo[] }>(response).models;\n\t}\n\n\t/**\n\t * Set thinking level.\n\t */\n\tasync setThinkingLevel(level: ThinkingLevel): Promise<void> {\n\t\tawait this.send({ type: \"set_thinking_level\", level });\n\t}\n\n\t/**\n\t * Cycle thinking level.\n\t */\n\tasync cycleThinkingLevel(): Promise<{ level: ThinkingLevel } | null> {\n\t\tconst response = await this.send({ type: \"cycle_thinking_level\" });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Set steering mode.\n\t */\n\tasync setSteeringMode(mode: \"all\" | \"one-at-a-time\"): Promise<void> {\n\t\tawait this.send({ type: \"set_steering_mode\", mode });\n\t}\n\n\t/**\n\t * Set follow-up mode.\n\t */\n\tasync setFollowUpMode(mode: \"all\" | \"one-at-a-time\"): Promise<void> {\n\t\tawait this.send({ type: \"set_follow_up_mode\", mode });\n\t}\n\n\t/**\n\t * Compact session context.\n\t */\n\tasync compact(customInstructions?: string): Promise<CompactionResult> {\n\t\tconst response = await this.send({ type: \"compact\", customInstructions });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Set auto-compaction enabled/disabled.\n\t */\n\tasync setAutoCompaction(enabled: boolean): Promise<void> {\n\t\tawait this.send({ type: \"set_auto_compaction\", enabled });\n\t}\n\n\t/**\n\t * Set auto-retry enabled/disabled.\n\t */\n\tasync setAutoRetry(enabled: boolean): Promise<void> {\n\t\tawait this.send({ type: \"set_auto_retry\", enabled });\n\t}\n\n\t/**\n\t * Abort in-progress retry.\n\t */\n\tasync abortRetry(): Promise<void> {\n\t\tawait this.send({ type: \"abort_retry\" });\n\t}\n\n\t/**\n\t * Execute a bash command.\n\t */\n\tasync bash(command: string): Promise<BashResult> {\n\t\tconst response = await this.send({ type: \"bash\", command });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Abort running bash command.\n\t */\n\tasync abortBash(): Promise<void> {\n\t\tawait this.send({ type: \"abort_bash\" });\n\t}\n\n\t/**\n\t * Get session statistics.\n\t */\n\tasync getSessionStats(): Promise<SessionStats> {\n\t\tconst response = await this.send({ type: \"get_session_stats\" });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Export session to HTML.\n\t */\n\tasync exportHtml(outputPath?: string): Promise<{ path: string }> {\n\t\tconst response = await this.send({ type: \"export_html\", outputPath });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Switch to a different session file.\n\t * @returns Object with `cancelled: true` if an extension cancelled the switch\n\t */\n\tasync switchSession(sessionPath: string): Promise<{ cancelled: boolean }> {\n\t\tconst response = await this.send({ type: \"switch_session\", sessionPath });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Fork from a specific message.\n\t * @returns Object with `text` (the message text) and `cancelled` (if extension cancelled)\n\t */\n\tasync fork(entryId: string): Promise<{ text: string; cancelled: boolean }> {\n\t\tconst response = await this.send({ type: \"fork\", entryId });\n\t\treturn this.getData(response);\n\t}\n\n\t/**\n\t * Get messages available for forking.\n\t */\n\tasync getForkMessages(): Promise<Array<{ entryId: string; text: string }>> {\n\t\tconst response = await this.send({ type: \"get_fork_messages\" });\n\t\treturn this.getData<{ messages: Array<{ entryId: string; text: string }> }>(response).messages;\n\t}\n\n\t/**\n\t * Get text of last assistant message.\n\t */\n\tasync getLastAssistantText(): Promise<string | null> {\n\t\tconst response = await this.send({ type: \"get_last_assistant_text\" });\n\t\treturn this.getData<{ text: string | null }>(response).text;\n\t}\n\n\t/**\n\t * Set the session display name.\n\t */\n\tasync setSessionName(name: string): Promise<void> {\n\t\tawait this.send({ type: \"set_session_name\", name });\n\t}\n\n\t/**\n\t * Get all messages in the session.\n\t */\n\tasync getMessages(): Promise<AgentMessage[]> {\n\t\tconst response = await this.send({ type: \"get_messages\" });\n\t\treturn this.getData<{ messages: AgentMessage[] }>(response).messages;\n\t}\n\n\t/**\n\t * Get available commands (extension commands, prompt templates, skills).\n\t */\n\tasync getCommands(): Promise<RpcSlashCommand[]> {\n\t\tconst response = await this.send({ type: \"get_commands\" });\n\t\treturn this.getData<{ commands: RpcSlashCommand[] }>(response).commands;\n\t}\n\n\t/**\n\t * Send a UI response to a pending extension_ui_request.\n\t * Fire-and-forget — no request/response correlation.\n\t */\n\tsendUIResponse(id: string, response: { value?: string; values?: string[]; confirmed?: boolean; cancelled?: boolean }): void {\n\t\tif (!this.process?.stdin) {\n\t\t\tthrow new Error(\"Client not started\");\n\t\t}\n\t\tthis.process.stdin.write(serializeJsonLine({\n\t\t\ttype: \"extension_ui_response\",\n\t\t\tid,\n\t\t\t...response,\n\t\t}));\n\t}\n\n\t/**\n\t * Initialize a v2 protocol session. Must be sent as the first command.\n\t * Returns the negotiated protocol version, session ID, and server capabilities.\n\t */\n\tasync init(options?: { clientId?: string }): Promise<RpcInitResult> {\n\t\tconst response = await this.send({ type: \"init\", protocolVersion: 2, clientId: options?.clientId });\n\t\treturn this.getData<RpcInitResult>(response);\n\t}\n\n\t/**\n\t * Request a graceful shutdown of the agent process.\n\t * Waits for the response before the process exits.\n\t */\n\tasync shutdown(): Promise<void> {\n\t\tawait this.send({ type: \"shutdown\" });\n\t\t// Wait for process to exit after shutdown acknowledgment\n\t\tif (this.process) {\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\t\tthis.process?.kill(\"SIGKILL\");\n\t\t\t\t\tresolve();\n\t\t\t\t}, 5000);\n\t\t\t\tthis.process?.on(\"exit\", () => {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Subscribe to specific event types (v2 only).\n\t * Pass [\"*\"] to receive all events, or a list of event type strings to filter.\n\t */\n\tasync subscribe(events: string[]): Promise<void> {\n\t\tawait this.send({ type: \"subscribe\", events });\n\t}\n\n\t// =========================================================================\n\t// Helpers\n\t// =========================================================================\n\n\t/**\n\t * Wait for agent to become idle (no streaming).\n\t * Resolves when agent_end event is received.\n\t */\n\twaitForIdle(timeout = 60000): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tunsubscribe();\n\t\t\t\treject(new Error(`Timeout waiting for agent to become idle. Stderr: ${this.stderr}`));\n\t\t\t}, timeout);\n\n\t\t\tconst unsubscribe = this.onEvent((event) => {\n\t\t\t\tif (event.type === \"agent_end\") {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Collect events until agent becomes idle.\n\t */\n\tcollectEvents(timeout = 60000): Promise<AgentEvent[]> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst events: AgentEvent[] = [];\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tunsubscribe();\n\t\t\t\treject(new Error(`Timeout collecting events. Stderr: ${this.stderr}`));\n\t\t\t}, timeout);\n\n\t\t\tconst unsubscribe = this.onEvent((event) => {\n\t\t\t\tevents.push(event);\n\t\t\t\tif (event.type === \"agent_end\") {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tresolve(events);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Send prompt and wait for completion, returning all events.\n\t */\n\tasync promptAndWait(message: string, images?: ImageContent[], timeout = 60000): Promise<AgentEvent[]> {\n\t\tconst eventsPromise = this.collectEvents(timeout);\n\t\tawait this.prompt(message, images);\n\t\treturn eventsPromise;\n\t}\n\n\t// =========================================================================\n\t// Internal\n\t// =========================================================================\n\n\tprivate handleLine(line: string): void {\n\t\ttry {\n\t\t\tconst data = JSON.parse(line);\n\n\t\t\t// Check if it's a response to a pending request\n\t\t\tif (data.type === \"response\" && data.id && this.pendingRequests.has(data.id)) {\n\t\t\t\tconst pending = this.pendingRequests.get(data.id)!;\n\t\t\t\tthis.pendingRequests.delete(data.id);\n\t\t\t\tpending.resolve(data as RpcResponse);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise it's an event\n\t\t\tfor (const listener of this.eventListeners) {\n\t\t\t\tlistener(data as AgentEvent);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Ignore non-JSON lines\n\t\t}\n\t}\n\n\tprivate async send(command: RpcCommandBody): Promise<RpcResponse> {\n\t\tif (!this.process?.stdin) {\n\t\t\tthrow new Error(\"Client not started\");\n\t\t}\n\n\t\tconst id = `req_${++this.requestId}`;\n\t\tconst fullCommand = { ...command, id } as RpcCommand;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\tthis.pendingRequests.delete(id);\n\t\t\t\treject(new Error(`Timeout waiting for response to ${command.type}. Stderr: ${this.stderr}`));\n\t\t\t}, 30000);\n\n\t\t\tthis.pendingRequests.set(id, {\n\t\t\t\tresolve: (response) => {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\tresolve(response);\n\t\t\t\t},\n\t\t\t\treject: (error) => {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\treject(error);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.process!.stdin!.write(serializeJsonLine(fullCommand));\n\t\t});\n\t}\n\n\tprivate getData<T>(response: RpcResponse): T {\n\t\tif (!response.success) {\n\t\t\tconst errorResponse = response as Extract<RpcResponse, { success: false }>;\n\t\t\tthrow new Error(errorResponse.error);\n\t\t}\n\t\t// Type assertion: we trust response.data matches T based on the command sent.\n\t\t// This is safe because each public method specifies the correct T for its command.\n\t\tconst successResponse = response as Extract<RpcResponse, { success: true; data: unknown }>;\n\t\treturn successResponse.data as T;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC mode: Headless operation with JSON stdin/stdout protocol.
|
|
3
|
+
*
|
|
4
|
+
* Used for embedding the agent in other applications.
|
|
5
|
+
* Receives commands as JSON on stdin, outputs events and responses as JSON on stdout.
|
|
6
|
+
*
|
|
7
|
+
* Protocol:
|
|
8
|
+
* - Commands: JSON objects with `type` field, optional `id` for correlation
|
|
9
|
+
* - Responses: JSON objects with `type: "response"`, `command`, `success`, and optional `data`/`error`
|
|
10
|
+
* - Events: AgentSessionEvent objects streamed as they occur
|
|
11
|
+
* - Extension UI: Extension UI requests are emitted, client responds with extension_ui_response
|
|
12
|
+
*/
|
|
13
|
+
import type { AgentSession } from "@gsd/agent-core";
|
|
14
|
+
export type { RpcCommand, RpcExtensionUIRequest, RpcExtensionUIResponse, RpcInitResult, RpcProtocolVersion, RpcResponse, RpcSessionState, RpcV2Event, } from "./rpc-types.js";
|
|
15
|
+
/**
|
|
16
|
+
* Opaque handle type representing an active RPC mode session.
|
|
17
|
+
* The value is always a never-resolving Promise (RPC mode runs until process exit).
|
|
18
|
+
*/
|
|
19
|
+
export type RpcMode = Promise<never>;
|
|
20
|
+
/**
|
|
21
|
+
* Run in RPC mode.
|
|
22
|
+
* Listens for JSON commands on stdin, outputs events and responses on stdout.
|
|
23
|
+
*/
|
|
24
|
+
export declare function runRpcMode(session: AgentSession): Promise<never>;
|
|
25
|
+
//# sourceMappingURL=rpc-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAmBpD,YAAY,EACX,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,UAAU,GACV,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAErC;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CA+0BtE"}
|