@opengsd/gsd-pi 1.2.0-dev.5457a158 → 1.2.0-dev.822c9439
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/dist/headless-events.js +7 -5
- package/dist/mcp-server.js +2 -1
- package/dist/resource-loader.d.ts +9 -5
- package/dist/resource-loader.js +114 -6
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +5 -4
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +30 -64
- package/dist/resources/extensions/async-jobs/await-tool.js +80 -12
- package/dist/resources/extensions/async-jobs/index.js +65 -0
- package/dist/resources/extensions/async-jobs/job-manager.js +12 -1
- package/dist/resources/extensions/bg-shell/bg-shell-command.js +6 -6
- package/dist/resources/extensions/bg-shell/bg-shell-tool.js +10 -7
- package/dist/resources/extensions/bg-shell/overlay.js +9 -6
- package/dist/resources/extensions/bg-shell/process-manager.js +54 -25
- package/dist/resources/extensions/bg-shell/readiness-detector.js +11 -0
- package/dist/resources/extensions/browser-tools/engine/managed-gsd-browser.js +209 -88
- package/dist/resources/extensions/browser-tools/engine/selection.js +73 -5
- package/dist/resources/extensions/browser-tools/index.js +69 -12
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +3 -2
- package/dist/resources/extensions/gsd/auto/custom-verify-retry-store.js +17 -2
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +33 -13
- package/dist/resources/extensions/gsd/auto/dispatch-history.js +105 -0
- package/dist/resources/extensions/gsd/auto/dispatch-key.js +37 -0
- package/dist/resources/extensions/gsd/auto/loop.js +4 -1
- package/dist/resources/extensions/gsd/auto/orchestrator.js +89 -54
- package/dist/resources/extensions/gsd/auto/phases.js +49 -6
- package/dist/resources/extensions/gsd/auto/session.js +3 -0
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +11 -34
- package/dist/resources/extensions/gsd/auto-dispatch.js +50 -58
- package/dist/resources/extensions/gsd/auto-model-selection.js +36 -13
- package/dist/resources/extensions/gsd/auto-post-unit.js +30 -12
- package/dist/resources/extensions/gsd/auto-prompts.js +78 -19
- package/dist/resources/extensions/gsd/auto-start.js +12 -12
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +45 -21
- package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +5 -4
- package/dist/resources/extensions/gsd/auto-verification.js +23 -30
- package/dist/resources/extensions/gsd/auto-worktree.js +14 -1
- package/dist/resources/extensions/gsd/auto.js +37 -1
- package/dist/resources/extensions/gsd/blocked-models.js +28 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +26 -6
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +23 -6
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +19 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +172 -59
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +302 -80
- package/dist/resources/extensions/gsd/browser-daemon-auto-prep.js +83 -0
- package/dist/resources/extensions/gsd/browser-evidence.js +8 -2
- package/dist/resources/extensions/gsd/closeout-wizard.js +92 -0
- package/dist/resources/extensions/gsd/commands/context.js +16 -2
- package/dist/resources/extensions/gsd/commands-handlers.js +46 -3
- package/dist/resources/extensions/gsd/consent-question.js +353 -0
- package/dist/resources/extensions/gsd/consent-verdict.js +63 -0
- package/dist/resources/extensions/gsd/constants.js +0 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +8 -3
- package/dist/resources/extensions/gsd/db/queries.js +26 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +10 -35
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +5 -5
- package/dist/resources/extensions/gsd/doctor-git-checks.js +2 -18
- package/dist/resources/extensions/gsd/engine-hook-contract.js +70 -0
- package/dist/resources/extensions/gsd/exec-sandbox.js +30 -10
- package/dist/resources/extensions/gsd/files.js +33 -19
- package/dist/resources/extensions/gsd/gsd-command-home.js +22 -12
- package/dist/resources/extensions/gsd/gsd-db.js +2 -1
- package/dist/resources/extensions/gsd/guidance.js +60 -0
- package/dist/resources/extensions/gsd/guided-flow.js +6 -3
- package/dist/resources/extensions/gsd/markdown-renderer.js +10 -0
- package/dist/resources/extensions/gsd/mcp-filter.js +2 -19
- package/dist/resources/extensions/gsd/milestone-closeout.js +85 -24
- package/dist/resources/extensions/gsd/milestone-planning-persistence.js +2 -2
- package/dist/resources/extensions/gsd/milestone-reopen-events.js +3 -5
- package/dist/resources/extensions/gsd/parsers-legacy.js +16 -4
- package/dist/resources/extensions/gsd/preferences-models.js +2 -2
- package/dist/resources/extensions/gsd/projection-flush.js +7 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +3 -3
- package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/research-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/prompts/run-uat.md +7 -5
- package/dist/resources/extensions/gsd/prompts/system.md +5 -2
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
- package/dist/resources/extensions/gsd/reactive-graph.js +8 -1
- package/dist/resources/extensions/gsd/roadmap-slices.js +25 -3
- package/dist/resources/extensions/gsd/safety/destructive-confirmation.js +108 -0
- package/dist/resources/extensions/gsd/session-lock.js +1 -1
- package/dist/resources/extensions/gsd/state.js +5 -0
- package/dist/resources/extensions/gsd/tool-contract.js +14 -3
- package/dist/resources/extensions/gsd/tool-presentation-plan.js +4 -4
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +3 -2
- package/dist/resources/extensions/gsd/tools/complete-slice.js +22 -12
- package/dist/resources/extensions/gsd/tools/complete-task.js +3 -2
- package/dist/resources/extensions/gsd/tools/exec-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +2 -2
- package/dist/resources/extensions/gsd/tools/plan-task.js +2 -2
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +2 -2
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +2 -2
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +2 -2
- package/dist/resources/extensions/gsd/tools/reopen-task.js +2 -2
- package/dist/resources/extensions/gsd/tools/replan-slice.js +2 -2
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +67 -2
- package/dist/resources/extensions/gsd/uat-policy.js +42 -16
- package/dist/resources/extensions/gsd/unit-context-composer.js +65 -0
- package/dist/resources/extensions/gsd/unit-registry.js +7 -20
- package/dist/resources/extensions/gsd/verdict-parser.js +1 -1
- package/dist/resources/extensions/gsd/verification-verdict.js +2 -1
- package/dist/resources/extensions/gsd/web-app-uat.js +45 -8
- package/dist/resources/extensions/gsd/workflow-event-ledger.js +91 -0
- package/dist/resources/extensions/gsd/workflow-event-vocabulary.js +46 -0
- package/dist/resources/extensions/gsd/workflow-events.js +6 -18
- package/dist/resources/extensions/gsd/workflow-reconcile.js +21 -56
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +3 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +7 -1
- package/dist/resources/extensions/gsd/worktree.js +8 -1
- package/dist/resources/extensions/search-the-web/native-search.js +5 -3
- package/dist/resources/extensions/shared/browser-contract.js +59 -0
- package/dist/resources/extensions/shared/gsd-browser-cli.js +116 -6
- package/dist/resources/shared/gsd-browser-path-sync.js +214 -0
- package/dist/resources/shared/package-manager-detection.js +1 -1
- package/dist/resources/shared/package.json +3 -0
- package/dist/resources/skills/create-skill/SKILL.md +3 -0
- package/dist/resources/skills/create-skill/references/executable-code.md +1 -1
- package/dist/resources/skills/create-skill/references/skill-structure.md +1 -0
- package/dist/resources/skills/create-skill/workflows/add-reference.md +8 -3
- package/dist/resources/skills/create-skill/workflows/add-script.md +4 -2
- package/dist/resources/skills/create-skill/workflows/add-template.md +3 -1
- package/dist/resources/skills/create-skill/workflows/add-workflow.md +8 -3
- package/dist/resources/skills/create-skill/workflows/upgrade-to-router.md +10 -5
- package/dist/resources/skills/create-skill/workflows/verify-skill.md +9 -4
- package/dist/resources/skills/spike-wrap-up/SKILL.md +9 -9
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-check.d.ts +2 -0
- package/dist/update-check.js +24 -1
- package/dist/update-cmd.js +20 -3
- 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 +3 -3
- 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/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.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- 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/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +11 -11
- package/dist/web/standalone/.next/server/chunks/8357.js +2 -2
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +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/{796.cf859a427a2cb2ac.js → 796.e0bdc932325d7e03.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-fbea77b5f9953368.js → webpack-f0285ce91d4ec9ef.js} +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
- package/dist/web/standalone/package.json +1 -1
- package/package.json +1 -1
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/dist/rpc.d.ts +1 -0
- package/packages/contracts/dist/rpc.d.ts.map +1 -1
- package/packages/contracts/dist/rpc.js.map +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +5 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +5 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +7 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +8 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js +11 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-auth.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-auth.js +4 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-auth.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +3 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/dist/cli.js +10 -5
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/moonshot-tool-schema.d.ts +29 -0
- package/packages/mcp-server/dist/moonshot-tool-schema.d.ts.map +1 -0
- package/packages/mcp-server/dist/moonshot-tool-schema.js +50 -0
- package/packages/mcp-server/dist/moonshot-tool-schema.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +4 -0
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +18 -18
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +99 -38
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +5 -4
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/harness/env/nodejs.d.ts +1 -0
- package/packages/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/harness/env/nodejs.js +34 -3
- package/packages/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/packages/pi-agent-core/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +3 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/README.md +1 -0
- package/packages/pi-ai/dist/image-models.generated.d.ts +2 -2
- package/packages/pi-ai/dist/image-models.generated.js +6 -6
- package/packages/pi-ai/dist/image-models.generated.js.map +1 -1
- package/packages/pi-ai/dist/index.d.ts +2 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +2 -0
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +239 -153
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +256 -145
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +12 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-shared.d.ts +5 -0
- package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-shared.js +12 -3
- package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +7 -3
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.d.ts +9 -0
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.js +34 -0
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.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 +6 -2
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/package.json +3 -2
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +19 -13
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/provider-readiness.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/provider-readiness.js +13 -6
- package/packages/pi-coding-agent/dist/core/provider-readiness.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +53 -11
- package/packages/pi-coding-agent/dist/core/tools/bash.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 +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/utils/shell.d.ts +28 -2
- package/packages/pi-coding-agent/dist/utils/shell.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/utils/shell.js +56 -10
- package/packages/pi-coding-agent/dist/utils/shell.js.map +1 -1
- package/packages/pi-coding-agent/package.json +7 -7
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +9 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +5 -4
- package/src/resources/extensions/async-jobs/async-bash-cancel.test.ts +360 -0
- package/src/resources/extensions/async-jobs/async-bash-tool.ts +33 -56
- package/src/resources/extensions/async-jobs/await-tool.test.ts +139 -0
- package/src/resources/extensions/async-jobs/await-tool.ts +82 -12
- package/src/resources/extensions/async-jobs/index.ts +79 -0
- package/src/resources/extensions/async-jobs/job-manager.ts +21 -1
- package/src/resources/extensions/bg-shell/bg-shell-command.ts +6 -6
- package/src/resources/extensions/bg-shell/bg-shell-tool.ts +10 -6
- package/src/resources/extensions/bg-shell/overlay.ts +9 -5
- package/src/resources/extensions/bg-shell/process-manager.ts +50 -25
- package/src/resources/extensions/bg-shell/readiness-detector.ts +12 -0
- package/src/resources/extensions/bg-shell/tests/lifecycle-and-utilities.test.ts +48 -1
- package/src/resources/extensions/browser-tools/engine/managed-gsd-browser.ts +265 -98
- package/src/resources/extensions/browser-tools/engine/selection.ts +90 -4
- package/src/resources/extensions/browser-tools/index.ts +71 -13
- package/src/resources/extensions/browser-tools/tests/browser-engine-selection.test.mjs +83 -13
- package/src/resources/extensions/browser-tools/tests/gsd-browser-launch-config.test.mjs +40 -1
- package/src/resources/extensions/browser-tools/tests/managed-gsd-browser-tools.test.mjs +136 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +3 -2
- package/src/resources/extensions/gsd/auto/custom-verify-retry-store.ts +21 -3
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +32 -9
- package/src/resources/extensions/gsd/auto/dispatch-history.ts +152 -0
- package/src/resources/extensions/gsd/auto/dispatch-key.ts +39 -0
- package/src/resources/extensions/gsd/auto/loop.ts +4 -1
- package/src/resources/extensions/gsd/auto/orchestrator.ts +98 -56
- package/src/resources/extensions/gsd/auto/phases.ts +65 -26
- package/src/resources/extensions/gsd/auto/session.ts +3 -0
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +18 -48
- package/src/resources/extensions/gsd/auto-dispatch.ts +48 -61
- package/src/resources/extensions/gsd/auto-model-selection.ts +41 -12
- package/src/resources/extensions/gsd/auto-post-unit.ts +33 -12
- package/src/resources/extensions/gsd/auto-prompts.ts +115 -35
- package/src/resources/extensions/gsd/auto-start.ts +12 -14
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +83 -28
- package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +4 -4
- package/src/resources/extensions/gsd/auto-verification.ts +26 -28
- package/src/resources/extensions/gsd/auto-worktree.ts +14 -1
- package/src/resources/extensions/gsd/auto.ts +44 -1
- package/src/resources/extensions/gsd/blocked-models.ts +49 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +34 -5
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +23 -6
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +24 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +211 -59
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +350 -86
- package/src/resources/extensions/gsd/browser-daemon-auto-prep.ts +108 -0
- package/src/resources/extensions/gsd/browser-evidence.ts +18 -2
- package/src/resources/extensions/gsd/closeout-wizard.ts +102 -0
- package/src/resources/extensions/gsd/commands/context.ts +16 -2
- package/src/resources/extensions/gsd/commands-handlers.ts +46 -3
- package/src/resources/extensions/gsd/consent-question.ts +431 -0
- package/src/resources/extensions/gsd/consent-verdict.ts +86 -0
- package/src/resources/extensions/gsd/constants.ts +0 -3
- package/src/resources/extensions/gsd/crash-recovery.ts +10 -2
- package/src/resources/extensions/gsd/db/queries.ts +37 -0
- package/src/resources/extensions/gsd/dispatch-guard.ts +8 -31
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +5 -4
- package/src/resources/extensions/gsd/doctor-git-checks.ts +2 -19
- package/src/resources/extensions/gsd/engine-hook-contract.ts +79 -0
- package/src/resources/extensions/gsd/exec-sandbox.ts +49 -9
- package/src/resources/extensions/gsd/files.ts +33 -12
- package/src/resources/extensions/gsd/gsd-command-home.ts +13 -3
- package/src/resources/extensions/gsd/gsd-db.ts +4 -3
- package/src/resources/extensions/gsd/guidance.ts +78 -0
- package/src/resources/extensions/gsd/guided-flow.ts +21 -26
- package/src/resources/extensions/gsd/markdown-renderer.ts +11 -0
- package/src/resources/extensions/gsd/mcp-filter.ts +2 -23
- package/src/resources/extensions/gsd/milestone-closeout.ts +109 -24
- package/src/resources/extensions/gsd/milestone-planning-persistence.ts +2 -2
- package/src/resources/extensions/gsd/milestone-reopen-events.ts +3 -6
- package/src/resources/extensions/gsd/parsers-legacy.ts +16 -4
- package/src/resources/extensions/gsd/preferences-models.ts +2 -1
- package/src/resources/extensions/gsd/projection-flush.ts +20 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +3 -3
- package/src/resources/extensions/gsd/prompts/execute-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/research-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/prompts/run-uat.md +7 -5
- package/src/resources/extensions/gsd/prompts/system.md +5 -2
- package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
- package/src/resources/extensions/gsd/reactive-graph.ts +11 -1
- package/src/resources/extensions/gsd/roadmap-slices.ts +28 -3
- package/src/resources/extensions/gsd/safety/destructive-confirmation.ts +134 -0
- package/src/resources/extensions/gsd/session-lock.ts +1 -1
- package/src/resources/extensions/gsd/state.ts +5 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +97 -1
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +198 -26
- package/src/resources/extensions/gsd/tests/auto-remote-session-lock-cleanup.test.ts +65 -3
- package/src/resources/extensions/gsd/tests/blocked-models.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/browser-automation-contract-fixture.ts +39 -0
- package/src/resources/extensions/gsd/tests/browser-contract.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/browser-daemon-auto-prep.test.ts +144 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/consent-question.test.ts +351 -0
- package/src/resources/extensions/gsd/tests/custom-verify-retry-store.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +10 -10
- package/src/resources/extensions/gsd/tests/destructive-confirmation.test.ts +303 -0
- package/src/resources/extensions/gsd/tests/discuss-routing-fixes.test.ts +12 -2
- package/src/resources/extensions/gsd/tests/dispatch-history.test.ts +273 -0
- package/src/resources/extensions/gsd/tests/dispatch-run-uat-browser-tools.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/doctor-git-checks-terminal.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/dynamic-bash-no-cap.test.ts +132 -0
- package/src/resources/extensions/gsd/tests/engine-hook-contract.test.ts +148 -0
- package/src/resources/extensions/gsd/tests/exec-graceful-kill.test.ts +193 -0
- package/src/resources/extensions/gsd/tests/exec-tool.test.ts +29 -1
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +35 -1
- package/src/resources/extensions/gsd/tests/gsd-command-home.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/guidance.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +2 -6
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +7 -11
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +20 -58
- package/src/resources/extensions/gsd/tests/integration/gsd-integration-fixture.ts +80 -0
- package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +199 -0
- package/src/resources/extensions/gsd/tests/mcp-project-config.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/milestone-closeout.test.ts +95 -4
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/oauth-api-model-routing.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/parsers-legacy-importers.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/phases-terminal-complete-idempotent.test.ts +242 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +124 -6
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +19 -1
- package/src/resources/extensions/gsd/tests/teardown-chdir-failure-clears-registry.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/tool-unavailable-retry.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/transport-gate-double-complete.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/uat-policy.test.ts +112 -29
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/uok-audit-unified.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/web-app-uat.test.ts +44 -1
- package/src/resources/extensions/gsd/tests/workflow-events.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/workflow-reconcile.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +273 -38
- package/src/resources/extensions/gsd/tests/worktree-teardown-safety.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/worktree.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/write-gate-seam.test.ts +358 -0
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +67 -1
- package/src/resources/extensions/gsd/tool-contract.ts +38 -3
- package/src/resources/extensions/gsd/tool-presentation-plan.ts +4 -4
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +3 -2
- package/src/resources/extensions/gsd/tools/complete-slice.ts +22 -12
- package/src/resources/extensions/gsd/tools/complete-task.ts +3 -2
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +2 -2
- package/src/resources/extensions/gsd/tools/plan-task.ts +2 -2
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +2 -2
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +2 -2
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +2 -2
- package/src/resources/extensions/gsd/tools/reopen-task.ts +2 -2
- package/src/resources/extensions/gsd/tools/replan-slice.ts +2 -2
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +81 -2
- package/src/resources/extensions/gsd/uat-policy.ts +62 -16
- package/src/resources/extensions/gsd/unit-context-composer.ts +99 -0
- package/src/resources/extensions/gsd/unit-registry.ts +7 -20
- package/src/resources/extensions/gsd/verdict-parser.ts +1 -1
- package/src/resources/extensions/gsd/verification-verdict.ts +4 -2
- package/src/resources/extensions/gsd/web-app-uat.ts +51 -8
- package/src/resources/extensions/gsd/workflow-event-ledger.ts +131 -0
- package/src/resources/extensions/gsd/workflow-event-vocabulary.ts +59 -0
- package/src/resources/extensions/gsd/workflow-events.ts +12 -20
- package/src/resources/extensions/gsd/workflow-reconcile.ts +29 -62
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +3 -8
- package/src/resources/extensions/gsd/worktree-manager.ts +6 -1
- package/src/resources/extensions/gsd/worktree.ts +7 -1
- package/src/resources/extensions/search-the-web/native-search.ts +5 -3
- package/src/resources/extensions/shared/browser-contract.ts +66 -0
- package/src/resources/extensions/shared/gsd-browser-cli.ts +141 -6
- package/src/resources/shared/gsd-browser-path-sync.ts +273 -0
- package/src/resources/shared/package-manager-detection.ts +1 -1
- package/src/resources/shared/package.json +3 -0
- package/src/resources/skills/create-skill/SKILL.md +3 -0
- package/src/resources/skills/create-skill/references/executable-code.md +1 -1
- package/src/resources/skills/create-skill/references/skill-structure.md +1 -0
- package/src/resources/skills/create-skill/workflows/add-reference.md +8 -3
- package/src/resources/skills/create-skill/workflows/add-script.md +4 -2
- package/src/resources/skills/create-skill/workflows/add-template.md +3 -1
- package/src/resources/skills/create-skill/workflows/add-workflow.md +8 -3
- package/src/resources/skills/create-skill/workflows/upgrade-to-router.md +10 -5
- package/src/resources/skills/create-skill/workflows/verify-skill.md +9 -4
- package/src/resources/skills/spike-wrap-up/SKILL.md +9 -9
- package/dist/resources/extensions/gsd/user-input-boundary.js +0 -218
- package/dist/resources/skills/gsd-browser/SKILL.md +0 -41
- package/src/resources/extensions/gsd/tests/user-input-boundary.test.ts +0 -173
- package/src/resources/extensions/gsd/user-input-boundary.ts +0 -216
- package/src/resources/skills/gsd-browser/SKILL.md +0 -41
- /package/dist/web/standalone/.next/static/{2p9Rv9pQflAxCBbGVI2vb → yWwBo-w09Y_W-nmeeWFRp}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{2p9Rv9pQflAxCBbGVI2vb → yWwBo-w09Y_W-nmeeWFRp}/_ssgManifest.js +0 -0
|
@@ -55,6 +55,32 @@ function parseGsdBrowserVersion(output: string): string | null {
|
|
|
55
55
|
return output.match(/\b(\d+\.\d+\.\d+)\b/)?.[1] ?? null;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
function splitCommandLine(commandLine: string): string[] {
|
|
59
|
+
const parts = commandLine.match(/(?:"[^"]*"|'[^']*'|[^\s"']+)/g) ?? [];
|
|
60
|
+
return parts.map((part) => {
|
|
61
|
+
const quote = part[0];
|
|
62
|
+
if ((quote === '"' || quote === "'") && part.endsWith(quote)) {
|
|
63
|
+
return part.slice(1, -1);
|
|
64
|
+
}
|
|
65
|
+
return part;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function buildPathGsdBrowserVersionInvocation(platform: NodeJS.Platform): { command: string; args: string[] } {
|
|
70
|
+
if (platform === "win32") {
|
|
71
|
+
return { command: "cmd", args: ["/d", "/s", "/c", "gsd-browser", "--version"] };
|
|
72
|
+
}
|
|
73
|
+
return { command: "gsd-browser", args: ["--version"] };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
77
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function resolveExplicitGsdBrowserCliPath(env: NodeJS.ProcessEnv): string | undefined {
|
|
81
|
+
return env.GSD_BROWSER_CLI_PATH?.trim() || env.GSD_BROWSER_BIN_PATH?.trim() || undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
58
84
|
function resolveBundledGsdBrowserPackageVersion(): string | null {
|
|
59
85
|
try {
|
|
60
86
|
const requireFromHere = createRequire(import.meta.url);
|
|
@@ -66,20 +92,29 @@ function resolveBundledGsdBrowserPackageVersion(): string | null {
|
|
|
66
92
|
}
|
|
67
93
|
}
|
|
68
94
|
|
|
95
|
+
// The `gsd-browser --version` subprocess result cannot change mid-session (the
|
|
96
|
+
// engine-switch guard forbids restarting with a different engine), and both the
|
|
97
|
+
// availability probe and the launch-config resolution ask for it at session
|
|
98
|
+
// start — memoize so the up-to-2s spawn happens once per process.
|
|
99
|
+
let cachedPathProbeVersion: string | null | undefined;
|
|
100
|
+
|
|
69
101
|
function resolvePathGsdBrowserVersion(env: NodeJS.ProcessEnv): string | null {
|
|
70
102
|
const explicit = env.GSD_BROWSER_PATH_VERSION?.trim();
|
|
71
103
|
if (explicit) return parseGsdBrowserVersion(explicit);
|
|
104
|
+
if (cachedPathProbeVersion !== undefined) return cachedPathProbeVersion;
|
|
72
105
|
|
|
73
106
|
try {
|
|
74
|
-
|
|
107
|
+
const invocation = buildPathGsdBrowserVersionInvocation(process.platform);
|
|
108
|
+
cachedPathProbeVersion = parseGsdBrowserVersion(execFileSync(invocation.command, invocation.args, {
|
|
75
109
|
encoding: "utf-8",
|
|
76
110
|
env,
|
|
77
111
|
stdio: ["ignore", "pipe", "ignore"],
|
|
78
112
|
timeout: 2000,
|
|
79
113
|
}));
|
|
80
114
|
} catch {
|
|
81
|
-
|
|
115
|
+
cachedPathProbeVersion = null;
|
|
82
116
|
}
|
|
117
|
+
return cachedPathProbeVersion;
|
|
83
118
|
}
|
|
84
119
|
|
|
85
120
|
function shouldPreferPathGsdBrowser(env: NodeJS.ProcessEnv): boolean {
|
|
@@ -91,7 +126,7 @@ function shouldPreferPathGsdBrowser(env: NodeJS.ProcessEnv): boolean {
|
|
|
91
126
|
}
|
|
92
127
|
|
|
93
128
|
export function resolveBundledGsdBrowserCliPath(env: NodeJS.ProcessEnv = process.env): string | null {
|
|
94
|
-
const explicit =
|
|
129
|
+
const explicit = resolveExplicitGsdBrowserCliPath(env);
|
|
95
130
|
if (explicit) return explicit;
|
|
96
131
|
|
|
97
132
|
try {
|
|
@@ -115,6 +150,45 @@ export function resolveBundledGsdBrowserCliPath(env: NodeJS.ProcessEnv = process
|
|
|
115
150
|
return null;
|
|
116
151
|
}
|
|
117
152
|
|
|
153
|
+
export type GsdBrowserCliAvailability =
|
|
154
|
+
| { available: true; via: "explicit-env" | "bundled" | "path"; detail: string }
|
|
155
|
+
| { available: false; detail: string };
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Cheap availability probe for the gsd-browser CLI: explicit env overrides,
|
|
159
|
+
* then the bundled @opengsd/gsd-browser binary (filesystem checks only), then
|
|
160
|
+
* a PATH lookup (one short subprocess, memoized). Used by Browser Automation
|
|
161
|
+
* Engine resolution to decide whether the managed engine is provable before
|
|
162
|
+
* preferring it over legacy Playwright. `via` names the provable source, not
|
|
163
|
+
* necessarily the launch source — resolveGsdBrowserMcpLaunchConfig may still
|
|
164
|
+
* prefer a newer PATH CLI over the bundled one.
|
|
165
|
+
*/
|
|
166
|
+
export function resolveGsdBrowserCliAvailability(env: NodeJS.ProcessEnv = process.env): GsdBrowserCliAvailability {
|
|
167
|
+
const explicitCommand = env.GSD_BROWSER_MCP_COMMAND?.trim();
|
|
168
|
+
if (explicitCommand) {
|
|
169
|
+
return { available: true, via: "explicit-env", detail: `GSD_BROWSER_MCP_COMMAND=${explicitCommand}` };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const explicitCliPath = resolveExplicitGsdBrowserCliPath(env);
|
|
173
|
+
if (explicitCliPath) {
|
|
174
|
+
return existsSync(explicitCliPath)
|
|
175
|
+
? { available: true, via: "explicit-env", detail: `CLI at ${explicitCliPath}` }
|
|
176
|
+
: { available: false, detail: `configured gsd-browser CLI path does not exist: ${explicitCliPath}` };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const bundledCliPath = resolveBundledGsdBrowserCliPath(env);
|
|
180
|
+
if (bundledCliPath) {
|
|
181
|
+
return { available: true, via: "bundled", detail: `bundled CLI at ${bundledCliPath}` };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const pathVersion = resolvePathGsdBrowserVersion(env);
|
|
185
|
+
if (pathVersion) {
|
|
186
|
+
return { available: true, via: "path", detail: `gsd-browser ${pathVersion} on PATH` };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return { available: false, detail: "no bundled or PATH gsd-browser CLI found" };
|
|
190
|
+
}
|
|
191
|
+
|
|
118
192
|
export function buildGsdBrowserSessionName(projectRoot: string, suffix?: string): string {
|
|
119
193
|
const resolvedProjectRoot = resolve(projectRoot);
|
|
120
194
|
const base = sanitizeSessionSegment(basename(resolvedProjectRoot)) || "project";
|
|
@@ -123,6 +197,35 @@ export function buildGsdBrowserSessionName(projectRoot: string, suffix?: string)
|
|
|
123
197
|
return cleanSuffix ? `gsd-${base}-${hash}-${cleanSuffix}` : `gsd-${base}-${hash}`;
|
|
124
198
|
}
|
|
125
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Recognize an MCP server config (from .mcp.json / Claude settings) as a
|
|
202
|
+
* gsd-browser server. Paired with resolveGsdBrowserMcpLaunchConfig: this module
|
|
203
|
+
* writes the config shape, so it also owns recognizing it. New launch shapes
|
|
204
|
+
* are taught here, in one place.
|
|
205
|
+
*/
|
|
206
|
+
export function isGsdBrowserMcpServerConfig(config: unknown): boolean {
|
|
207
|
+
if (!isRecord(config)) return false;
|
|
208
|
+
|
|
209
|
+
const command = typeof config.command === "string" ? config.command : "";
|
|
210
|
+
if (command.includes("gsd-browser") || command.includes("@opengsd/gsd-browser")) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (isRecord(config.env)) {
|
|
215
|
+
const env = config.env;
|
|
216
|
+
if (
|
|
217
|
+
typeof env.GSD_BROWSER_CLI_PATH === "string"
|
|
218
|
+
|| typeof env.GSD_BROWSER_BIN_PATH === "string"
|
|
219
|
+
|| typeof env.GSD_BROWSER_MCP_COMMAND === "string"
|
|
220
|
+
) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const args = Array.isArray(config.args) ? config.args.filter((arg): arg is string => typeof arg === "string") : [];
|
|
226
|
+
return args.some((arg) => arg.includes("gsd-browser") || arg.includes("@opengsd/gsd-browser"));
|
|
227
|
+
}
|
|
228
|
+
|
|
126
229
|
export function resolveGsdBrowserMcpLaunchConfig(
|
|
127
230
|
projectRoot: string,
|
|
128
231
|
env: NodeJS.ProcessEnv = process.env,
|
|
@@ -132,8 +235,9 @@ export function resolveGsdBrowserMcpLaunchConfig(
|
|
|
132
235
|
const serverName = env.GSD_BROWSER_MCP_NAME?.trim() || GSD_BROWSER_MCP_SERVER_NAME;
|
|
133
236
|
const explicitArgs = parseJsonEnv<unknown>(env, "GSD_BROWSER_MCP_ARGS");
|
|
134
237
|
const explicitEnv = parseJsonEnv<Record<string, string>>(env, "GSD_BROWSER_MCP_ENV");
|
|
135
|
-
const
|
|
136
|
-
const
|
|
238
|
+
const explicitCommandLine = env.GSD_BROWSER_MCP_COMMAND?.trim();
|
|
239
|
+
const [explicitCommand, ...explicitCommandArgs] = explicitCommandLine ? splitCommandLine(explicitCommandLine) : [];
|
|
240
|
+
const explicitCliPath = resolveExplicitGsdBrowserCliPath(env);
|
|
137
241
|
const preferPathCli = !explicitCommand && !explicitCliPath && shouldPreferPathGsdBrowser(env);
|
|
138
242
|
const bundledCliPath = !explicitCommand && !explicitCliPath && !preferPathCli
|
|
139
243
|
? resolveBundledGsdBrowserCliPath(env)
|
|
@@ -144,6 +248,10 @@ export function resolveGsdBrowserMcpLaunchConfig(
|
|
|
144
248
|
// profile/cookies persist across pi sessions for the same project. gsd-browser
|
|
145
249
|
// rejects --identity-scope unless --identity-key is also supplied.
|
|
146
250
|
const identityKey = env.GSD_BROWSER_IDENTITY_KEY?.trim() || buildGsdBrowserSessionName(resolvedProjectRoot);
|
|
251
|
+
// identity-project must be a safe identifier (no path separators); full paths
|
|
252
|
+
// cause daemon startup to fail with "invalid name".
|
|
253
|
+
const identityProject =
|
|
254
|
+
env.GSD_BROWSER_IDENTITY_PROJECT?.trim() || buildGsdBrowserSessionName(resolvedProjectRoot);
|
|
147
255
|
const command =
|
|
148
256
|
explicitCommand
|
|
149
257
|
|| explicitCliPath
|
|
@@ -153,6 +261,7 @@ export function resolveGsdBrowserMcpLaunchConfig(
|
|
|
153
261
|
const args = Array.isArray(explicitArgs) && explicitArgs.length > 0
|
|
154
262
|
? explicitArgs.map(String)
|
|
155
263
|
: [
|
|
264
|
+
...explicitCommandArgs,
|
|
156
265
|
...(bundledCliPath ? [bundledCliPath] : []),
|
|
157
266
|
"mcp",
|
|
158
267
|
"--session",
|
|
@@ -162,7 +271,7 @@ export function resolveGsdBrowserMcpLaunchConfig(
|
|
|
162
271
|
"--identity-key",
|
|
163
272
|
identityKey,
|
|
164
273
|
"--identity-project",
|
|
165
|
-
|
|
274
|
+
identityProject,
|
|
166
275
|
];
|
|
167
276
|
const cwd = env.GSD_BROWSER_MCP_CWD?.trim() || resolvedProjectRoot;
|
|
168
277
|
|
|
@@ -176,3 +285,29 @@ export function resolveGsdBrowserMcpLaunchConfig(
|
|
|
176
285
|
sessionName,
|
|
177
286
|
};
|
|
178
287
|
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* CLI invocation that starts the gsd-browser session daemon with the same
|
|
291
|
+
* session and identity flags as {@link resolveGsdBrowserMcpLaunchConfig}, so
|
|
292
|
+
* browser UAT can warm Chrome/CDP before the first MCP navigation.
|
|
293
|
+
*/
|
|
294
|
+
export function resolveGsdBrowserDaemonStartInvocation(
|
|
295
|
+
projectRoot: string,
|
|
296
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
297
|
+
options: GsdBrowserMcpLaunchOptions = {},
|
|
298
|
+
): Pick<GsdBrowserMcpLaunchConfig, "command" | "args" | "cwd" | "env"> {
|
|
299
|
+
const launch = resolveGsdBrowserMcpLaunchConfig(projectRoot, env, options);
|
|
300
|
+
const mcpIndex = launch.args.indexOf("mcp");
|
|
301
|
+
if (mcpIndex < 0) {
|
|
302
|
+
throw new Error("gsd-browser launch config is missing mcp subcommand");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const prefix = launch.args.slice(0, mcpIndex);
|
|
306
|
+
const sessionFlags = launch.args.slice(mcpIndex + 1);
|
|
307
|
+
return {
|
|
308
|
+
command: launch.command,
|
|
309
|
+
args: [...prefix, "daemon", "start", ...sessionFlags],
|
|
310
|
+
cwd: launch.cwd,
|
|
311
|
+
...(launch.env ? { env: launch.env } : {}),
|
|
312
|
+
};
|
|
313
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process'
|
|
2
|
+
import { chmodSync, copyFileSync, existsSync, lstatSync, readlinkSync, realpathSync } from 'node:fs'
|
|
3
|
+
import { homedir } from 'node:os'
|
|
4
|
+
import { dirname, isAbsolute, join, delimiter as pathDelimiter, resolve as resolvePath } from 'node:path'
|
|
5
|
+
import { isPnpmInstall, pathStartsWith } from './package-manager-detection.js'
|
|
6
|
+
|
|
7
|
+
export interface GsdBrowserPathReconcileResult {
|
|
8
|
+
action: 'none' | 'synced' | 'shadowed'
|
|
9
|
+
pathCli?: string
|
|
10
|
+
installedCli?: string
|
|
11
|
+
syncTarget?: string
|
|
12
|
+
message?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function isBunGlobalInstall(argv1: string | undefined, env: NodeJS.ProcessEnv): boolean {
|
|
16
|
+
if ('bun' in process.versions) return true
|
|
17
|
+
if (!argv1) return false
|
|
18
|
+
|
|
19
|
+
const bunBinDirs: string[] = []
|
|
20
|
+
if (env.BUN_INSTALL) bunBinDirs.push(join(env.BUN_INSTALL, 'bin'))
|
|
21
|
+
bunBinDirs.push(join(homedir(), '.bun', 'bin'))
|
|
22
|
+
|
|
23
|
+
return bunBinDirs.some((dir) => pathStartsWith(argv1, dir))
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function gsdBrowserBinaryName(platform: NodeJS.Platform): string {
|
|
27
|
+
return platform === 'win32' ? 'gsd-browser.cmd' : 'gsd-browser'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function tryResolveFromBinDir(binDir: string, platform: NodeJS.Platform): string | null {
|
|
31
|
+
const primary = join(binDir, gsdBrowserBinaryName(platform))
|
|
32
|
+
if (existsSync(primary)) return primary
|
|
33
|
+
|
|
34
|
+
if (platform === 'win32') {
|
|
35
|
+
const fallback = join(binDir, 'gsd-browser')
|
|
36
|
+
if (existsSync(fallback)) return fallback
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return null
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function tryResolveFromPackageRoot(
|
|
43
|
+
rootDir: string,
|
|
44
|
+
platform: NodeJS.Platform,
|
|
45
|
+
): string | null {
|
|
46
|
+
const candidate = join(rootDir, '@opengsd', 'gsd-browser', 'bin', gsdBrowserBinaryName(platform))
|
|
47
|
+
if (existsSync(candidate)) return candidate
|
|
48
|
+
|
|
49
|
+
if (platform === 'win32') {
|
|
50
|
+
const fallback = join(rootDir, '@opengsd', 'gsd-browser', 'bin', 'gsd-browser')
|
|
51
|
+
if (existsSync(fallback)) return fallback
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return null
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function tryExecLookup(
|
|
58
|
+
command: string,
|
|
59
|
+
args: string[],
|
|
60
|
+
env: NodeJS.ProcessEnv,
|
|
61
|
+
platform: NodeJS.Platform,
|
|
62
|
+
resolve: (dir: string, platform: NodeJS.Platform) => string | null,
|
|
63
|
+
): string | null {
|
|
64
|
+
try {
|
|
65
|
+
const dir = execFileSync(command, args, {
|
|
66
|
+
encoding: 'utf-8',
|
|
67
|
+
env,
|
|
68
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
69
|
+
timeout: 5000,
|
|
70
|
+
}).trim()
|
|
71
|
+
return resolve(dir, platform)
|
|
72
|
+
} catch {
|
|
73
|
+
return null
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function resolvePathBinary(env: NodeJS.ProcessEnv, platform: NodeJS.Platform): string | null {
|
|
78
|
+
if (platform === 'win32') {
|
|
79
|
+
try {
|
|
80
|
+
const out = execFileSync('where', ['gsd-browser'], {
|
|
81
|
+
encoding: 'utf-8',
|
|
82
|
+
env,
|
|
83
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
84
|
+
timeout: 5000,
|
|
85
|
+
}).trim()
|
|
86
|
+
const first = out.split(/\r?\n/).map((line) => line.trim()).find(Boolean)
|
|
87
|
+
return first && existsSync(first) ? first : null
|
|
88
|
+
} catch {
|
|
89
|
+
return null
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for (const entry of (env.PATH ?? '').split(pathDelimiter)) {
|
|
94
|
+
if (!entry) continue
|
|
95
|
+
const candidate = join(entry, 'gsd-browser')
|
|
96
|
+
if (existsSync(candidate)) return candidate
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return null
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function resolveRealPath(pathValue: string): string {
|
|
103
|
+
try {
|
|
104
|
+
return realpathSync(pathValue)
|
|
105
|
+
} catch {
|
|
106
|
+
return resolvePath(pathValue)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function resolveSymlinkTarget(pathCli: string): string {
|
|
111
|
+
try {
|
|
112
|
+
const stat = lstatSync(pathCli)
|
|
113
|
+
if (!stat.isSymbolicLink()) return pathCli
|
|
114
|
+
|
|
115
|
+
const target = readlinkSync(pathCli)
|
|
116
|
+
return isAbsolute(target) ? target : resolvePath(dirname(pathCli), target)
|
|
117
|
+
} catch {
|
|
118
|
+
// PATH entry vanished or is inaccessible between resolution and sync.
|
|
119
|
+
// Fall back to the original path; subsequent sync will surface a useful
|
|
120
|
+
// error rather than escaping as an unhandled throw.
|
|
121
|
+
return pathCli
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function resolveHomeDir(env: NodeJS.ProcessEnv): string {
|
|
126
|
+
const fromEnv = env.HOME?.trim() || env.USERPROFILE?.trim()
|
|
127
|
+
return resolvePath(fromEnv || homedir())
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function canAutoSyncTarget(targetPath: string, env: NodeJS.ProcessEnv): boolean {
|
|
131
|
+
const home = resolveHomeDir(env)
|
|
132
|
+
const resolved = resolvePath(targetPath)
|
|
133
|
+
return pathStartsWith(resolved, home)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function syncBinary(installedCli: string, targetPath: string, platform: NodeJS.Platform): void {
|
|
137
|
+
const source = resolveRealPath(installedCli)
|
|
138
|
+
copyFileSync(source, targetPath)
|
|
139
|
+
if (platform !== 'win32') {
|
|
140
|
+
chmodSync(targetPath, 0o755)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Resolve the gsd-browser binary installed by the active global package manager.
|
|
146
|
+
*/
|
|
147
|
+
export function resolveGlobalGsdBrowserCliPath(
|
|
148
|
+
options: { env?: NodeJS.ProcessEnv; argv1?: string; platform?: NodeJS.Platform } = {},
|
|
149
|
+
): string | null {
|
|
150
|
+
const env = options.env ?? process.env
|
|
151
|
+
const argv1 = options.argv1 ?? process.argv[1]
|
|
152
|
+
const platform = options.platform ?? process.platform
|
|
153
|
+
|
|
154
|
+
if (isBunGlobalInstall(argv1, env)) {
|
|
155
|
+
return (
|
|
156
|
+
tryExecLookup('bun', ['pm', 'bin', '-g'], env, platform, tryResolveFromBinDir)
|
|
157
|
+
?? (env.BUN_INSTALL ? tryResolveFromBinDir(join(env.BUN_INSTALL, 'bin'), platform) : null)
|
|
158
|
+
?? tryResolveFromBinDir(join(homedir(), '.bun', 'bin'), platform)
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (isPnpmInstall(argv1, env)) {
|
|
163
|
+
return (
|
|
164
|
+
tryExecLookup('pnpm', ['bin', '-g'], env, platform, tryResolveFromBinDir)
|
|
165
|
+
?? tryExecLookup('pnpm', ['root', '-g'], env, platform, tryResolveFromPackageRoot)
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
tryExecLookup('npm', ['bin', '-g'], env, platform, tryResolveFromBinDir)
|
|
171
|
+
?? tryExecLookup('npm', ['root', '-g'], env, platform, tryResolveFromPackageRoot)
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Resolve the gsd-browser binary that wins on PATH (`command -v` / `where`).
|
|
177
|
+
*/
|
|
178
|
+
export function resolveGsdBrowserOnPath(
|
|
179
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
180
|
+
platform: NodeJS.Platform = process.platform,
|
|
181
|
+
): string | null {
|
|
182
|
+
return resolvePathBinary(env, platform)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* After a global gsd-browser install, ensure the PATH-resolved binary matches
|
|
187
|
+
* the freshly installed global binary when an older copy is shadowing it.
|
|
188
|
+
*/
|
|
189
|
+
export function reconcileGsdBrowserPathAfterInstall(
|
|
190
|
+
options: {
|
|
191
|
+
latestVersion: string
|
|
192
|
+
compareSemver: (a: string, b: string) => number
|
|
193
|
+
resolvePathVersion: (env: NodeJS.ProcessEnv) => string | null
|
|
194
|
+
env?: NodeJS.ProcessEnv
|
|
195
|
+
argv1?: string
|
|
196
|
+
platform?: NodeJS.Platform
|
|
197
|
+
},
|
|
198
|
+
): GsdBrowserPathReconcileResult {
|
|
199
|
+
const env = options.env ?? process.env
|
|
200
|
+
const argv1 = options.argv1 ?? process.argv[1]
|
|
201
|
+
const platform = options.platform ?? process.platform
|
|
202
|
+
|
|
203
|
+
const installedCli = resolveGlobalGsdBrowserCliPath({ env, argv1, platform })
|
|
204
|
+
if (!installedCli) {
|
|
205
|
+
return { action: 'none' }
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const pathCli = resolveGsdBrowserOnPath(env, platform)
|
|
209
|
+
const installedReal = resolveRealPath(installedCli)
|
|
210
|
+
if (pathCli && resolveRealPath(pathCli) === installedReal) {
|
|
211
|
+
return { action: 'none', pathCli, installedCli }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const pathVersion = options.resolvePathVersion(env)
|
|
215
|
+
if (pathVersion && options.compareSemver(pathVersion, options.latestVersion) >= 0) {
|
|
216
|
+
return { action: 'none', pathCli: pathCli ?? undefined, installedCli }
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (!pathCli) {
|
|
220
|
+
return {
|
|
221
|
+
action: 'shadowed',
|
|
222
|
+
installedCli,
|
|
223
|
+
message:
|
|
224
|
+
'Installed gsd-browser globally, but no gsd-browser was found on PATH. Add your package manager global bin directory to PATH.',
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const syncTarget = resolveSymlinkTarget(pathCli)
|
|
229
|
+
if (!canAutoSyncTarget(syncTarget, env)) {
|
|
230
|
+
return {
|
|
231
|
+
action: 'shadowed',
|
|
232
|
+
pathCli,
|
|
233
|
+
installedCli,
|
|
234
|
+
syncTarget,
|
|
235
|
+
message:
|
|
236
|
+
`PATH resolves gsd-browser to ${pathCli}, but the updated global install is at ${installedCli}. ` +
|
|
237
|
+
'Move your package manager global bin directory ahead of the stale location on PATH, or update the stale binary manually.',
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
let syncSucceeded = false
|
|
242
|
+
try {
|
|
243
|
+
syncBinary(installedCli, syncTarget, platform)
|
|
244
|
+
syncSucceeded = true
|
|
245
|
+
} catch {
|
|
246
|
+
// Fall through to shadowed guidance.
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (syncSucceeded) {
|
|
250
|
+
const refreshedVersion = options.resolvePathVersion(env)
|
|
251
|
+
const verified = refreshedVersion !== null
|
|
252
|
+
&& options.compareSemver(refreshedVersion, options.latestVersion) >= 0
|
|
253
|
+
return {
|
|
254
|
+
action: 'synced',
|
|
255
|
+
pathCli,
|
|
256
|
+
installedCli,
|
|
257
|
+
syncTarget,
|
|
258
|
+
message: verified
|
|
259
|
+
? `Synced PATH-resolved gsd-browser at ${syncTarget} to the updated global install.`
|
|
260
|
+
: `Synced PATH-resolved gsd-browser at ${syncTarget} to the updated global install. Could not verify the new version on PATH; restart your shell or rerun if it still reports the old version.`,
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return {
|
|
265
|
+
action: 'shadowed',
|
|
266
|
+
pathCli,
|
|
267
|
+
installedCli,
|
|
268
|
+
syncTarget,
|
|
269
|
+
message:
|
|
270
|
+
`PATH resolves gsd-browser to ${pathCli}, but the updated global install is at ${installedCli}. ` +
|
|
271
|
+
'Move your package manager global bin directory ahead of the stale location on PATH, or update the stale binary manually.',
|
|
272
|
+
}
|
|
273
|
+
}
|
|
@@ -12,7 +12,7 @@ function hasPnpmPath(value: string | undefined): boolean {
|
|
|
12
12
|
)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function pathStartsWith(pathValue: string | undefined, dir: string): boolean {
|
|
15
|
+
export function pathStartsWith(pathValue: string | undefined, dir: string): boolean {
|
|
16
16
|
if (!pathValue) return false
|
|
17
17
|
const resolvedPath = resolvePath(pathValue)
|
|
18
18
|
const resolvedDir = resolvePath(dir)
|
|
@@ -174,6 +174,9 @@ description: ... # What it does AND when to use it (third person)
|
|
|
174
174
|
---
|
|
175
175
|
```
|
|
176
176
|
|
|
177
|
+
Frontmatter must parse as YAML. Quote description values containing `:` or use
|
|
178
|
+
a folded block (`description: >`) for longer trigger descriptions.
|
|
179
|
+
|
|
177
180
|
Name conventions: `create-*`, `manage-*`, `setup-*`, `generate-*`, `build-*`
|
|
178
181
|
</yaml_requirements>
|
|
179
182
|
|
|
@@ -45,7 +45,7 @@ skill-name/
|
|
|
45
45
|
**Reference pattern**: In SKILL.md, reference scripts using the `scripts/` path:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
python ~/.
|
|
48
|
+
python ~/.agents/skills/skill-name/scripts/analyze.py input.har
|
|
49
49
|
```
|
|
50
50
|
</scripts_directory>
|
|
51
51
|
</file_organization>
|
|
@@ -109,6 +109,7 @@ description: What it does and when to use it (third person, specific triggers)
|
|
|
109
109
|
- No XML tags
|
|
110
110
|
- Third person (never first or second person)
|
|
111
111
|
- Include what it does AND when to use it
|
|
112
|
+
- Must parse as YAML; quote values containing `:` or use `description: >`
|
|
112
113
|
|
|
113
114
|
**Critical rule**: Always write in third person.
|
|
114
115
|
- ✅ "Processes Excel files and generates reports"
|
|
@@ -10,16 +10,21 @@
|
|
|
10
10
|
## Step 1: Select the Skill
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
|
|
13
|
+
# User-global skills
|
|
14
|
+
ls ~/.agents/skills/ 2>/dev/null
|
|
15
|
+
# Project-local skills
|
|
16
|
+
ls .agents/skills/ 2>/dev/null
|
|
14
17
|
```
|
|
15
18
|
|
|
16
19
|
Present numbered list, ask: "Which skill needs a new reference?"
|
|
17
20
|
|
|
21
|
+
Determine `{skill-path}`: use `.agents/skills/{skill-name}` (project-local) if found there, otherwise `~/.agents/skills/{skill-name}` (user-global). Project-local takes precedence because the skill catalog loads it first on name collision.
|
|
22
|
+
|
|
18
23
|
## Step 2: Analyze Current Structure
|
|
19
24
|
|
|
20
25
|
```bash
|
|
21
|
-
cat
|
|
22
|
-
ls
|
|
26
|
+
cat {skill-path}/SKILL.md
|
|
27
|
+
ls {skill-path}/references/ 2>/dev/null
|
|
23
28
|
```
|
|
24
29
|
|
|
25
30
|
Determine:
|
|
@@ -12,6 +12,8 @@ Ask (if not already provided):
|
|
|
12
12
|
- Which skill needs a script?
|
|
13
13
|
- What operation should the script perform?
|
|
14
14
|
|
|
15
|
+
Determine `{skill-path}`: use `.agents/skills/{skill-name}` (project-local) if found there, otherwise `~/.agents/skills/{skill-name}` (user-global). Project-local takes precedence because the skill catalog loads it first on name collision.
|
|
16
|
+
|
|
15
17
|
## Step 2: Analyze Script Need
|
|
16
18
|
|
|
17
19
|
Confirm this is a good script candidate:
|
|
@@ -24,7 +26,7 @@ If not a good fit, suggest alternatives (inline code in workflow, reference exam
|
|
|
24
26
|
## Step 3: Create Scripts Directory
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
mkdir -p
|
|
29
|
+
mkdir -p {skill-path}/scripts
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
## Step 4: Design Script
|
|
@@ -58,7 +60,7 @@ set -euo pipefail
|
|
|
58
60
|
## Step 6: Make Executable (if bash)
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
|
-
chmod +x
|
|
63
|
+
chmod +x {skill-path}/scripts/{script-name}.sh
|
|
62
64
|
```
|
|
63
65
|
|
|
64
66
|
## Step 7: Update Workflow to Use Script
|
|
@@ -12,6 +12,8 @@ Ask (if not already provided):
|
|
|
12
12
|
- Which skill needs a template?
|
|
13
13
|
- What output does this template structure?
|
|
14
14
|
|
|
15
|
+
Determine `{skill-path}`: use `.agents/skills/{skill-name}` (project-local) if found there, otherwise `~/.agents/skills/{skill-name}` (user-global). Project-local takes precedence because the skill catalog loads it first on name collision.
|
|
16
|
+
|
|
15
17
|
## Step 2: Analyze Template Need
|
|
16
18
|
|
|
17
19
|
Confirm this is a good template candidate:
|
|
@@ -24,7 +26,7 @@ If not a good fit, suggest alternatives (workflow guidance, reference examples).
|
|
|
24
26
|
## Step 3: Create Templates Directory
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
mkdir -p
|
|
29
|
+
mkdir -p {skill-path}/templates
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
## Step 4: Design Template Structure
|
|
@@ -12,17 +12,22 @@
|
|
|
12
12
|
**DO NOT use AskUserQuestion** - there may be many skills.
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
|
|
15
|
+
# User-global skills
|
|
16
|
+
ls ~/.agents/skills/ 2>/dev/null
|
|
17
|
+
# Project-local skills
|
|
18
|
+
ls .agents/skills/ 2>/dev/null
|
|
16
19
|
```
|
|
17
20
|
|
|
18
21
|
Present numbered list, ask: "Which skill needs a new workflow?"
|
|
19
22
|
|
|
23
|
+
Determine `{skill-path}`: use `.agents/skills/{skill-name}` (project-local) if found there, otherwise `~/.agents/skills/{skill-name}` (user-global). Project-local takes precedence because the skill catalog loads it first on name collision.
|
|
24
|
+
|
|
20
25
|
## Step 2: Analyze Current Structure
|
|
21
26
|
|
|
22
27
|
Read the skill:
|
|
23
28
|
```bash
|
|
24
|
-
cat
|
|
25
|
-
ls
|
|
29
|
+
cat {skill-path}/SKILL.md
|
|
30
|
+
ls {skill-path}/workflows/ 2>/dev/null
|
|
26
31
|
```
|
|
27
32
|
|
|
28
33
|
Determine:
|
|
@@ -10,17 +10,22 @@
|
|
|
10
10
|
## Step 1: Select the Skill
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
|
|
13
|
+
# User-global skills
|
|
14
|
+
ls ~/.agents/skills/ 2>/dev/null
|
|
15
|
+
# Project-local skills
|
|
16
|
+
ls .agents/skills/ 2>/dev/null
|
|
14
17
|
```
|
|
15
18
|
|
|
16
19
|
Present numbered list, ask: "Which skill should be upgraded to the router pattern?"
|
|
17
20
|
|
|
21
|
+
Determine `{skill-path}`: use `.agents/skills/{skill-name}` (project-local) if found there, otherwise `~/.agents/skills/{skill-name}` (user-global). Project-local takes precedence because the skill catalog loads it first on name collision.
|
|
22
|
+
|
|
18
23
|
## Step 2: Verify It Needs Upgrading
|
|
19
24
|
|
|
20
25
|
Read the skill:
|
|
21
26
|
```bash
|
|
22
|
-
cat
|
|
23
|
-
ls
|
|
27
|
+
cat {skill-path}/SKILL.md
|
|
28
|
+
ls {skill-path}/
|
|
24
29
|
```
|
|
25
30
|
|
|
26
31
|
**Already a router?** (has workflows/ and intake question)
|
|
@@ -65,8 +70,8 @@ Ask: "Does this breakdown look right? Any adjustments?"
|
|
|
65
70
|
## Step 4: Create Directory Structure
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
|
-
mkdir -p
|
|
69
|
-
mkdir -p
|
|
73
|
+
mkdir -p {skill-path}/workflows
|
|
74
|
+
mkdir -p {skill-path}/references
|
|
70
75
|
```
|
|
71
76
|
|
|
72
77
|
## Step 5: Extract Workflows
|