@entelligentsia/forgecli 1.1.0 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +4 -0
- package/dist/CHANGELOG-forge-plugin.md +114 -0
- package/dist/CHANGELOG-pi.md +56 -0
- package/dist/extensions/forgecli/forge-subagent.js +58 -0
- package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/grove.d.ts +38 -0
- package/dist/extensions/forgecli/mcp-bridge/grove.js +88 -2
- package/dist/extensions/forgecli/mcp-bridge/grove.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/json-rpc-stdio.d.ts +26 -2
- package/dist/extensions/forgecli/mcp-bridge/json-rpc-stdio.js +68 -13
- package/dist/extensions/forgecli/mcp-bridge/json-rpc-stdio.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/mcp-bridge.js +13 -2
- package/dist/extensions/forgecli/mcp-bridge/mcp-bridge.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/mcp-session.d.ts +3 -3
- package/dist/extensions/forgecli/mcp-bridge/mcp-session.js +3 -6
- package/dist/extensions/forgecli/mcp-bridge/mcp-session.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.d.ts +49 -40
- package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.js +59 -188
- package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/init-phases.d.ts +0 -43
- package/dist/extensions/forgecli/orchestrators/init/init-phases.js +11 -59
- package/dist/extensions/forgecli/orchestrators/init/init-phases.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/init-steps.d.ts +115 -0
- package/dist/extensions/forgecli/orchestrators/init/init-steps.js +125 -0
- package/dist/extensions/forgecli/orchestrators/init/init-steps.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/init/run-init-pipeline.js +400 -211
- package/dist/extensions/forgecli/orchestrators/init/run-init-pipeline.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/run-init-types.d.ts +8 -2
- package/dist/extensions/forgecli/orchestrators/init/run-init-types.js +15 -5
- package/dist/extensions/forgecli/orchestrators/init/run-init-types.js.map +1 -1
- package/dist/forge-payload/.base-pack/workflows-js/wfl-init.js +99 -38
- package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
- package/dist/forge-payload/.init/generation/generate-kb-doc.md +24 -0
- package/dist/forge-payload/.schemas/migrations.json +77 -0
- package/dist/forge-payload/init/generation/generate-kb-doc.md +24 -0
- package/dist/forge-payload/init/phases/phase-2/context.md +23 -0
- package/dist/forge-payload/init/phases/phase-2/database.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/deployment.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/domain-concepts.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/domain-model.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/entity-model.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/index.md +25 -0
- package/dist/forge-payload/init/phases/phase-2/processes.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/routing.md +25 -0
- package/dist/forge-payload/init/phases/phase-2/stack-checklist.md +25 -0
- package/dist/forge-payload/init/phases/phase-2/stack.md +27 -0
- package/dist/forge-payload/init/phases/phase-2/testing.md +26 -0
- package/dist/forge-payload/init/phases/phase-2-discover.md +15 -9
- package/dist/forge-payload/payload-manifest.json +2 -2
- package/dist/forge-payload/tools/seed-store.cjs +14 -0
- package/dist/forge-payload/tools/verify-phase.cjs +61 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +10 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +4 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +20 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +16 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +61 -41
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +15 -45
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +15 -45
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +461 -22
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +140 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +141 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts +10 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts +82 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts +88 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +75 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +33 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +101 -84
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +41 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +15 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +109 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +15 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +56 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +39 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +13 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +5 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +33 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +16 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +14 -17
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts +20 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +87 -68
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +20 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +15 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +52 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +60 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +18 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +10 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +143 -130
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +14 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +26 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +55 -8
- package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +58 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +28 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/session-format.md +18 -8
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/entry-renderer.ts +41 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/question.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
- package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
|
@@ -66,32 +66,64 @@ export class JsonRpcStdioClient {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Send a request and await its result. Rejects on error / timeout / exit.
|
|
71
|
+
* `onProgress`, if given, fires for each `notifications/progress` the server
|
|
72
|
+
* emits for this request (and each one also resets the inactivity timer).
|
|
73
|
+
*/
|
|
74
|
+
request(method, params, onProgress) {
|
|
71
75
|
if (!this.child)
|
|
72
76
|
return Promise.reject(new Error("client not started"));
|
|
73
77
|
if (this.exited) {
|
|
74
78
|
return Promise.reject(this.exitError ?? new Error("client closed"));
|
|
75
79
|
}
|
|
76
80
|
const id = this.nextId++;
|
|
77
|
-
|
|
81
|
+
// Opt into MCP progress: servers emit `notifications/progress` keyed off
|
|
82
|
+
// this token. We use the request id itself so a progress notification maps
|
|
83
|
+
// straight back to its pending entry. Without a token grove never emits
|
|
84
|
+
// progress and a long delegated call dies at the flat deadline.
|
|
85
|
+
const withMeta = this.withProgressToken(params, id);
|
|
86
|
+
const payload = JSON.stringify({ jsonrpc: "2.0", id, method, params: withMeta }) + "\n";
|
|
78
87
|
return new Promise((resolve, reject) => {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
reject
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
const pending = {
|
|
89
|
+
resolve,
|
|
90
|
+
reject,
|
|
91
|
+
method,
|
|
92
|
+
onProgress,
|
|
93
|
+
timer: undefined,
|
|
94
|
+
reset: () => {
|
|
95
|
+
clearTimeout(pending.timer);
|
|
96
|
+
pending.timer = setTimeout(() => {
|
|
97
|
+
this.pending.delete(id);
|
|
98
|
+
reject(new Error(`request "${method}" timed out after ${this.timeoutMs}ms without activity`));
|
|
99
|
+
}, this.timeoutMs);
|
|
100
|
+
// Don't let a pending timer hold the process open.
|
|
101
|
+
pending.timer.unref?.();
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
pending.reset();
|
|
105
|
+
this.pending.set(id, pending);
|
|
86
106
|
this.child.stdin.write(payload, (err) => {
|
|
87
107
|
if (err) {
|
|
88
108
|
this.pending.delete(id);
|
|
89
|
-
clearTimeout(timer);
|
|
109
|
+
clearTimeout(pending.timer);
|
|
90
110
|
reject(err);
|
|
91
111
|
}
|
|
92
112
|
});
|
|
93
113
|
});
|
|
94
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Return a shallow copy of `params` with `_meta.progressToken` set to `token`,
|
|
117
|
+
* without mutating the caller's object. MCP reserves `params._meta` for this;
|
|
118
|
+
* servers that don't emit progress simply ignore it.
|
|
119
|
+
*/
|
|
120
|
+
withProgressToken(params, token) {
|
|
121
|
+
const base = params && typeof params === "object" ? params : {};
|
|
122
|
+
const meta = base._meta && typeof base._meta === "object"
|
|
123
|
+
? base._meta
|
|
124
|
+
: {};
|
|
125
|
+
return { ...base, _meta: { ...meta, progressToken: token } };
|
|
126
|
+
}
|
|
95
127
|
/** Fire-and-forget notification (no id, no response expected). */
|
|
96
128
|
notify(method, params) {
|
|
97
129
|
if (!this.child || this.exited)
|
|
@@ -141,9 +173,12 @@ export class JsonRpcStdioClient {
|
|
|
141
173
|
// Non-JSON line (a server log to stdout); ignore.
|
|
142
174
|
return;
|
|
143
175
|
}
|
|
144
|
-
// Notifications / server-initiated messages carry no id we issued
|
|
145
|
-
|
|
176
|
+
// Notifications / server-initiated messages carry no id we issued — a
|
|
177
|
+
// progress notification refreshes its request's inactivity timer.
|
|
178
|
+
if (msg.id === undefined || msg.id === null) {
|
|
179
|
+
this.onNotification(msg);
|
|
146
180
|
return;
|
|
181
|
+
}
|
|
147
182
|
if (typeof msg.id !== "number")
|
|
148
183
|
return;
|
|
149
184
|
const pending = this.pending.get(msg.id);
|
|
@@ -157,6 +192,26 @@ export class JsonRpcStdioClient {
|
|
|
157
192
|
}
|
|
158
193
|
pending.resolve(msg.result);
|
|
159
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Handle a server-initiated notification. Only `notifications/progress` is
|
|
197
|
+
* actioned: it restarts the inactivity timer of the request whose
|
|
198
|
+
* `progressToken` it carries (the request id we assigned), turning the flat
|
|
199
|
+
* request deadline into an idle timeout that survives long, live operations.
|
|
200
|
+
*/
|
|
201
|
+
onNotification(msg) {
|
|
202
|
+
if (msg.method !== "notifications/progress")
|
|
203
|
+
return;
|
|
204
|
+
const params = msg.params;
|
|
205
|
+
const token = params?.progressToken;
|
|
206
|
+
if (typeof token !== "number")
|
|
207
|
+
return;
|
|
208
|
+
const pending = this.pending.get(token);
|
|
209
|
+
if (!pending)
|
|
210
|
+
return;
|
|
211
|
+
pending.reset();
|
|
212
|
+
if (params)
|
|
213
|
+
pending.onProgress?.(params);
|
|
214
|
+
}
|
|
160
215
|
fail(err) {
|
|
161
216
|
if (!this.exitError)
|
|
162
217
|
this.exitError = err;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-rpc-stdio.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/mcp-bridge/json-rpc-stdio.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,0EAA0E;AAC1E,sBAAsB;AACtB,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAuC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"json-rpc-stdio.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/mcp-bridge/json-rpc-stdio.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,0EAA0E;AAC1E,sBAAsB;AACtB,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAuC,MAAM,oBAAoB,CAAC;AAuDhF,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,OA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IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,IAAI,MAAM;YAAE,OAAO,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEO,IAAI,CAAC,GAAU;QACtB,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IAEO,SAAS,CAAC,GAAU;QAC3B,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACD"}
|
|
@@ -33,9 +33,20 @@ export function buildToolDefinition(session, descriptor, opts) {
|
|
|
33
33
|
// Pass the MCP JSON Schema straight through — see header note.
|
|
34
34
|
parameters: (descriptor.inputSchema ?? { type: "object", properties: {} }),
|
|
35
35
|
promptGuidelines: opts.promptGuidelines,
|
|
36
|
-
async execute(_toolCallId, params, signal) {
|
|
36
|
+
async execute(_toolCallId, params, signal, onUpdate) {
|
|
37
37
|
try {
|
|
38
|
-
|
|
38
|
+
// Surface the server's progress notifications as live tool updates so
|
|
39
|
+
// the user sees liveness during a long call (e.g. grove's delegated
|
|
40
|
+
// explore, which reports "turn 2/7 · …" per inner-loop turn) instead
|
|
41
|
+
// of a silent wait. Partial updates carry text only; the final result
|
|
42
|
+
// still comes from the resolved call below.
|
|
43
|
+
const onProgress = onUpdate
|
|
44
|
+
? (p) => {
|
|
45
|
+
const text = p.message ?? `working (${p.progress ?? "?"}/${p.total ?? "?"})`;
|
|
46
|
+
onUpdate({ content: [{ type: "text", text }], details: {} });
|
|
47
|
+
}
|
|
48
|
+
: undefined;
|
|
49
|
+
const result = await session.callTool(descriptor.name, (params ?? {}), signal, onProgress);
|
|
39
50
|
return {
|
|
40
51
|
content: toToolContent(result.content, result.isError ? "tool error" : "OK"),
|
|
41
52
|
details: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-bridge.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/mcp-bridge/mcp-bridge.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,iFAAiF;AACjF,4EAA4E;AAC5E,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,sEAAsE;AACtE,+EAA+E;AAC/E,yBAAyB;AAIzB,OAAO,EACN,eAAe,GAIf,MAAM,kBAAkB,CAAC;AAU1B,kFAAkF;AAClF,SAAS,aAAa,CACrB,OAA+C,EAC/C,QAAgB;IAEhB,MAAM,KAAK,GAAG,OAAO;SACnB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;SACzC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,CAAC,IAAc,EAAE,CAAC,CAAC,CAAC;IAClE,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAClC,OAAmB,EACnB,UAA6B,EAC7B,IAAuB;IAEvB,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IACxD,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,UAAU,CAAC,WAAW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AAC,IAAI,CAAC;YACnC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,OAAO;YACP,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE;SAC9B,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7C,MAAM,GAAG,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JsonRpcStdioOptions } from "./json-rpc-stdio.js";
|
|
1
|
+
import { type JsonRpcStdioOptions, type ProgressNotification } from "./json-rpc-stdio.js";
|
|
2
2
|
/** One tool as advertised by an MCP server's tools/list. */
|
|
3
3
|
export interface McpToolDescriptor {
|
|
4
4
|
name: string;
|
|
@@ -32,7 +32,7 @@ export interface McpSession {
|
|
|
32
32
|
readonly serverInfo?: McpServerInfo;
|
|
33
33
|
initialize(): Promise<void>;
|
|
34
34
|
listTools(): Promise<McpToolDescriptor[]>;
|
|
35
|
-
callTool(name: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<McpCallResult>;
|
|
35
|
+
callTool(name: string, args: Record<string, unknown>, signal?: AbortSignal, onProgress?: (p: ProgressNotification) => void): Promise<McpCallResult>;
|
|
36
36
|
close(): Promise<void>;
|
|
37
37
|
}
|
|
38
38
|
/** McpSession backed by a spawned stdio child (e.g. `grove serve`). */
|
|
@@ -43,6 +43,6 @@ export declare class StdioMcpSession implements McpSession {
|
|
|
43
43
|
constructor(opts: JsonRpcStdioOptions);
|
|
44
44
|
initialize(): Promise<void>;
|
|
45
45
|
listTools(): Promise<McpToolDescriptor[]>;
|
|
46
|
-
callTool(name: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<McpCallResult>;
|
|
46
|
+
callTool(name: string, args: Record<string, unknown>, signal?: AbortSignal, onProgress?: (p: ProgressNotification) => void): Promise<McpCallResult>;
|
|
47
47
|
close(): Promise<void>;
|
|
48
48
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// framing grove's `serve` mode speaks. Deliberately tiny: discovery + call,
|
|
6
6
|
// nothing else. The `McpSession` interface is what synthesizeTools() depends on,
|
|
7
7
|
// so tests can inject a fake without spawning a process.
|
|
8
|
-
import { JsonRpcStdioClient } from "./json-rpc-stdio.js";
|
|
8
|
+
import { JsonRpcStdioClient, } from "./json-rpc-stdio.js";
|
|
9
9
|
const MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
10
10
|
/** McpSession backed by a spawned stdio child (e.g. `grove serve`). */
|
|
11
11
|
export class StdioMcpSession {
|
|
@@ -33,13 +33,10 @@ export class StdioMcpSession {
|
|
|
33
33
|
const result = (await this.client.request("tools/list", {}));
|
|
34
34
|
return Array.isArray(result?.tools) ? result.tools : [];
|
|
35
35
|
}
|
|
36
|
-
async callTool(name, args, signal) {
|
|
36
|
+
async callTool(name, args, signal, onProgress) {
|
|
37
37
|
if (signal?.aborted)
|
|
38
38
|
throw new Error("aborted");
|
|
39
|
-
const result = (await this.client.request("tools/call", {
|
|
40
|
-
name,
|
|
41
|
-
arguments: args ?? {},
|
|
42
|
-
}));
|
|
39
|
+
const result = (await this.client.request("tools/call", { name, arguments: args ?? {} }, onProgress));
|
|
43
40
|
return {
|
|
44
41
|
content: Array.isArray(result?.content) ? result.content : [],
|
|
45
42
|
isError: result?.isError === true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-session.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/mcp-bridge/mcp-session.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,iFAAiF;AACjF,yDAAyD;AAEzD,OAAO,
|
|
1
|
+
{"version":3,"file":"mcp-session.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/mcp-bridge/mcp-session.ts"],"names":[],"m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AQ,CACb,IAAY,EACZ,IAA6B,EAC7B,MAAoB,EACpB,UAA8C;QAE9C,IAAI,MAAM,EAAE,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACxC,YAAY,EACZ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,EAC/B,UAAU,CACV,CAAkB,CAAC;QACpB,OAAO;YACN,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7D,OAAO,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI;SACjC,CAAC;IACH,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;CACD"}
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { PhaseRole } from "../../subagent/caller-context.js";
|
|
2
3
|
import type { MergedConfig } from "../../config/config-layer.js";
|
|
3
4
|
import { type SubagentResult } from "../../forge-subagent.js";
|
|
4
5
|
import { getSubagentTools } from "../../forge-tools.js";
|
|
5
|
-
import
|
|
6
|
+
import { resolveModelForPhase } from "../../config/model-resolver.js";
|
|
6
7
|
import type { RunInitOptions } from "./run-init-types.js";
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Failure reason when status="failed". */
|
|
13
|
-
failure?: string;
|
|
14
|
-
}
|
|
15
|
-
/** Inputs required by dispatchInitPhase. */
|
|
16
|
-
export interface InitPhaseDispatchParams {
|
|
8
|
+
/**
|
|
9
|
+
* Inputs required by dispatchSingleAgent. Carries only what one subagent
|
|
10
|
+
* dispatch needs — no phase descriptor (the step table owns routing).
|
|
11
|
+
*/
|
|
12
|
+
export interface InitDispatchParams {
|
|
17
13
|
opts: RunInitOptions;
|
|
18
|
-
phase: InitPhaseDescriptor;
|
|
19
|
-
/** 0-based index of this phase in INIT_PHASES. */
|
|
20
|
-
phaseIndex: number;
|
|
21
14
|
cwd: string;
|
|
22
15
|
ctx: ExtensionCommandContext;
|
|
23
|
-
/** Absolute path to the vendored bundle root (contains init/phases/). */
|
|
16
|
+
/** Absolute path to the vendored bundle root (contains init/phases/ + base-pack). */
|
|
24
17
|
bundleRoot: string;
|
|
25
|
-
/** KB folder name (e.g. "engineering"). */
|
|
26
|
-
kbFolder: string;
|
|
27
|
-
/** ISO 8601 timestamp passed down to each subagent prompt. */
|
|
28
|
-
isoTimestamp: string;
|
|
29
18
|
/** Merged model-routing config from layered config. */
|
|
30
19
|
modelRoutingConfig: MergedConfig;
|
|
31
20
|
/** Raw forge tool definitions (optional — carries forge_ask_user). */
|
|
@@ -33,32 +22,52 @@ export interface InitPhaseDispatchParams {
|
|
|
33
22
|
/**
|
|
34
23
|
* Per-dispatch attempt counter keyed by sub-role label, for OrchestratorTree
|
|
35
24
|
* node identity (`<INIT_SESSION_ID>:<role>:<attempt>`). Mutated by
|
|
36
|
-
* dispatchSingleAgent
|
|
37
|
-
* a phase it keeps re-dispatches (e.g. config-writer retry) on distinct nodes.
|
|
25
|
+
* dispatchSingleAgent so re-dispatches (retries) land on distinct nodes.
|
|
38
26
|
*/
|
|
39
27
|
dispatchCounts: Record<string, number>;
|
|
28
|
+
/** Ordering hint (wave index) for SessionRegistry.startPhase. */
|
|
29
|
+
orderHint: number;
|
|
40
30
|
}
|
|
41
31
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
* Read the phase prompt from the bundled init/phases/ directory.
|
|
33
|
+
* Throws on missing file — caller catches and returns failure.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readInitPhasePrompt(bundleRoot: string, phaseNum: 1 | 2): string;
|
|
36
|
+
/**
|
|
37
|
+
* Read the shared Phase-2 KB-doc generation procedure (Slice 2 / FORGE-S35-T03).
|
|
38
|
+
* This is `init/generation/generate-kb-doc.md` — the write path, confidence
|
|
39
|
+
* header, verify-back, and not-applicable stub format shared by EVERY Phase-2
|
|
40
|
+
* subagent. It forms the base of every kb-doc / index / context prompt; the
|
|
41
|
+
* per-step substance fragment and the AGENT PARAMS block are appended by the
|
|
42
|
+
* pipeline. Throws on missing file — caller catches and returns failure (IL7).
|
|
43
|
+
*/
|
|
44
|
+
export declare function readInitSharedProcedure(bundleRoot: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Read one per-step substance fragment from `init/phases/phase-2/<name>.md`
|
|
47
|
+
* (Slice 2 / FORGE-S35-T03). `name` is a KB_DOC_ID basename (e.g. "stack",
|
|
48
|
+
* "domain-model") or one of "index" / "context". Each fragment carries only its
|
|
49
|
+
* own docId's topic focus, discovery input, required output, and not-applicable
|
|
50
|
+
* stub — so a subagent never sees a sibling's work. Throws a descriptive error
|
|
51
|
+
* on missing file (naming the fragment) — caller catches and returns failure.
|
|
52
|
+
*/
|
|
53
|
+
export declare function readInitPhase2Fragment(bundleRoot: string, name: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve model for a sub-role within the init pipeline. Reads the intended
|
|
56
|
+
* tier from ROLE_TIER[modelRole] ("sonnet" / "haiku") and resolves the concrete
|
|
57
|
+
* {provider, model} via resolveModelForPhase, using modelRole as the phase key
|
|
58
|
+
* and the given personaNoun (matching task-phase-dispatch, which passes the
|
|
59
|
+
* role — never a display label — as the phase key). The tier is returned
|
|
60
|
+
* alongside the resolution so callers can surface it via notify. Concrete model
|
|
61
|
+
* still comes from config; resolution is "inherit" (undefined model) when config
|
|
62
|
+
* specifies nothing for the role.
|
|
47
63
|
*/
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
} | {
|
|
51
|
-
kind: "return";
|
|
52
|
-
result: InitPipelineResult;
|
|
53
|
-
} | {
|
|
54
|
-
kind: "ok";
|
|
55
|
-
result: SubagentResult;
|
|
64
|
+
export declare function resolveInitModel(modelRole: string, personaNoun: string, modelRoutingConfig: MergedConfig): ReturnType<typeof resolveModelForPhase> & {
|
|
65
|
+
tier: "sonnet" | "haiku" | undefined;
|
|
56
66
|
};
|
|
57
67
|
/**
|
|
58
|
-
* Dispatch a single
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* - `{ kind: "ok", result }` carrying the last SubagentResult on success.
|
|
68
|
+
* Dispatch a single subagent for the init pipeline and return its SubagentResult.
|
|
69
|
+
* All runForgeSubagent calls are wrapped in CallerContextStore.asSubagent +
|
|
70
|
+
* AskBroker.withUI (IL10 / FORGE-BUG-040 parity). This is the sole subagent
|
|
71
|
+
* runner invoked by the step machine's subagent steps.
|
|
63
72
|
*/
|
|
64
|
-
export declare function
|
|
73
|
+
export declare function dispatchSingleAgent(subLabel: string, subRole: PhaseRole, modelRole: string, prompt: string, _schema: object | undefined, personaNoun: string, p: InitDispatchParams): Promise<SubagentResult>;
|