@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
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
// init-phase-dispatch.ts —
|
|
2
|
-
//
|
|
3
|
-
// CallerContextStore + AskBroker wrapping, runForgeSubagent dispatch,
|
|
4
|
-
// verify-gate routing, and retry-once semantics. Sequential fan-out (Option A)
|
|
5
|
-
// for collect (5 domains) and discover (7 KB-doc IDs).
|
|
1
|
+
// init-phase-dispatch.ts — the single-subagent runner for the /forge:init step
|
|
2
|
+
// machine (FORGE-S33-T02, rewritten by FORGE-S35-T02 Slice 1).
|
|
6
3
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
4
|
+
// Owns model resolution, CallerContextStore + AskBroker wrapping,
|
|
5
|
+
// runForgeSubagent dispatch, and the live TUI wiring (SessionRegistry +
|
|
6
|
+
// OrchestratorTree + viewport observer) for ONE subagent step. Intra-phase
|
|
7
|
+
// routing (fan-out, gate, index/context ordering, retries) now lives in the
|
|
8
|
+
// step table (init-steps.ts + run-init-pipeline.ts); this module is a leaf.
|
|
9
|
+
//
|
|
10
|
+
// The Phase-2 `gate` subagent was DELETED in Slice 1 — its readiness check
|
|
11
|
+
// became a deterministic step precondition.
|
|
12
|
+
//
|
|
13
|
+
// IL10 — NEVER calls store-cli emit; the orchestrator composes and emits phase
|
|
14
|
+
// events from result.{model,provider,usage} after each subagent step returns.
|
|
9
15
|
//
|
|
10
16
|
// Layering: may import from orchestrators/init/ siblings, ../../<peer> modules,
|
|
11
17
|
// node:* builtins, @earendil-works/pi-coding-agent types.
|
|
@@ -20,13 +26,13 @@ import { resolveModelForPhase } from "../../config/model-resolver.js";
|
|
|
20
26
|
import { getSessionRegistry } from "../../session-registry.js";
|
|
21
27
|
import { getOrchestratorTree } from "../../orchestrator-tree.js";
|
|
22
28
|
import { attachViewportObserver } from "../../viewport/events.js";
|
|
23
|
-
import {
|
|
24
|
-
// ──
|
|
29
|
+
import { INIT_SESSION_ID, ROLE_TIER } from "./init-phases.js";
|
|
30
|
+
// ── Phase-prompt reader ───────────────────────────────────────────────────────
|
|
25
31
|
/**
|
|
26
32
|
* Read the phase prompt from the bundled init/phases/ directory.
|
|
27
33
|
* Throws on missing file — caller catches and returns failure.
|
|
28
34
|
*/
|
|
29
|
-
function readInitPhasePrompt(bundleRoot, phaseNum) {
|
|
35
|
+
export function readInitPhasePrompt(bundleRoot, phaseNum) {
|
|
30
36
|
const phasesDir = path.join(bundleRoot, "init", "phases");
|
|
31
37
|
const pattern = `phase-${phaseNum}-`;
|
|
32
38
|
let files;
|
|
@@ -43,6 +49,43 @@ function readInitPhasePrompt(bundleRoot, phaseNum) {
|
|
|
43
49
|
}
|
|
44
50
|
return fs.readFileSync(path.join(phasesDir, filename), "utf8");
|
|
45
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Read the shared Phase-2 KB-doc generation procedure (Slice 2 / FORGE-S35-T03).
|
|
54
|
+
* This is `init/generation/generate-kb-doc.md` — the write path, confidence
|
|
55
|
+
* header, verify-back, and not-applicable stub format shared by EVERY Phase-2
|
|
56
|
+
* subagent. It forms the base of every kb-doc / index / context prompt; the
|
|
57
|
+
* per-step substance fragment and the AGENT PARAMS block are appended by the
|
|
58
|
+
* pipeline. Throws on missing file — caller catches and returns failure (IL7).
|
|
59
|
+
*/
|
|
60
|
+
export function readInitSharedProcedure(bundleRoot) {
|
|
61
|
+
const file = path.join(bundleRoot, "init", "generation", "generate-kb-doc.md");
|
|
62
|
+
try {
|
|
63
|
+
return fs.readFileSync(file, "utf8");
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const e = err;
|
|
67
|
+
throw new Error(`Cannot read shared procedure generate-kb-doc.md at ${file}: ${e.message ?? "unknown"}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Read one per-step substance fragment from `init/phases/phase-2/<name>.md`
|
|
72
|
+
* (Slice 2 / FORGE-S35-T03). `name` is a KB_DOC_ID basename (e.g. "stack",
|
|
73
|
+
* "domain-model") or one of "index" / "context". Each fragment carries only its
|
|
74
|
+
* own docId's topic focus, discovery input, required output, and not-applicable
|
|
75
|
+
* stub — so a subagent never sees a sibling's work. Throws a descriptive error
|
|
76
|
+
* on missing file (naming the fragment) — caller catches and returns failure.
|
|
77
|
+
*/
|
|
78
|
+
export function readInitPhase2Fragment(bundleRoot, name) {
|
|
79
|
+
const file = path.join(bundleRoot, "init", "phases", "phase-2", `${name}.md`);
|
|
80
|
+
try {
|
|
81
|
+
return fs.readFileSync(file, "utf8");
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
const e = err;
|
|
85
|
+
throw new Error(`Cannot read Phase-2 substance fragment '${name}' at ${file}: ${e.message ?? "unknown"}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// ── Model resolution ──────────────────────────────────────────────────────────
|
|
46
89
|
/**
|
|
47
90
|
* Resolve model for a sub-role within the init pipeline. Reads the intended
|
|
48
91
|
* tier from ROLE_TIER[modelRole] ("sonnet" / "haiku") and resolves the concrete
|
|
@@ -53,21 +96,19 @@ function readInitPhasePrompt(bundleRoot, phaseNum) {
|
|
|
53
96
|
* still comes from config; resolution is "inherit" (undefined model) when config
|
|
54
97
|
* specifies nothing for the role.
|
|
55
98
|
*/
|
|
56
|
-
function resolveInitModel(modelRole, personaNoun, modelRoutingConfig) {
|
|
99
|
+
export function resolveInitModel(modelRole, personaNoun, modelRoutingConfig) {
|
|
57
100
|
const tier = ROLE_TIER[modelRole];
|
|
58
101
|
const resolution = resolveModelForPhase("default", modelRole, personaNoun, modelRoutingConfig);
|
|
59
102
|
return { ...resolution, tier };
|
|
60
103
|
}
|
|
104
|
+
// ── Single-agent dispatch ─────────────────────────────────────────────────────
|
|
61
105
|
/**
|
|
62
106
|
* Dispatch a single subagent for the init pipeline and return its SubagentResult.
|
|
63
107
|
* All runForgeSubagent calls are wrapped in CallerContextStore.asSubagent +
|
|
64
|
-
* AskBroker.withUI (IL10 / FORGE-BUG-040 parity).
|
|
65
|
-
*
|
|
66
|
-
* TOD03: If CallerContextStore proves overly strict about the PhaseRole values
|
|
67
|
-
* used here ("plan" / "implement"), widen PhaseRole in T03 or T04 to include
|
|
68
|
-
* init-specific roles. See plan D4 for the reasoning.
|
|
108
|
+
* AskBroker.withUI (IL10 / FORGE-BUG-040 parity). This is the sole subagent
|
|
109
|
+
* runner invoked by the step machine's subagent steps.
|
|
69
110
|
*/
|
|
70
|
-
async function dispatchSingleAgent(subLabel, subRole, modelRole, prompt, _schema, personaNoun, p) {
|
|
111
|
+
export async function dispatchSingleAgent(subLabel, subRole, modelRole, prompt, _schema, personaNoun, p) {
|
|
71
112
|
const { cwd, ctx, opts, modelRoutingConfig, bundleRoot } = p;
|
|
72
113
|
// Init's orchestration personas ship in the bundle's base-pack. `.forge/personas/`
|
|
73
114
|
// is not materialized until Phase 3 — and may be absent entirely on a fresh or
|
|
@@ -91,7 +132,7 @@ async function dispatchSingleAgent(subLabel, subRole, modelRole, prompt, _schema
|
|
|
91
132
|
const tree = getOrchestratorTree();
|
|
92
133
|
const iteration = (p.dispatchCounts[subLabel] = (p.dispatchCounts[subLabel] ?? 0) + 1);
|
|
93
134
|
const nodeId = `${INIT_SESSION_ID}:${subLabel}:${iteration}`;
|
|
94
|
-
registry.startPhase(INIT_SESSION_ID, subLabel, p.
|
|
135
|
+
registry.startPhase(INIT_SESSION_ID, subLabel, p.orderHint);
|
|
95
136
|
tree.startNode(nodeId, {
|
|
96
137
|
parentId: INIT_SESSION_ID,
|
|
97
138
|
label: subLabel,
|
|
@@ -140,174 +181,4 @@ async function dispatchSingleAgent(subLabel, subRole, modelRole, prompt, _schema
|
|
|
140
181
|
tree.completeNode(nodeId, nodeStatus);
|
|
141
182
|
return result;
|
|
142
183
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Fan-out: dispatch one subagent per item in items, sequentially (Option A).
|
|
145
|
-
* Surfaces the sequential cap via ctx.ui.notify before the first dispatch.
|
|
146
|
-
* Returns an array of SubagentResult in order. On any failure, stops early
|
|
147
|
-
* and returns partial results plus a non-null `failedItem`.
|
|
148
|
-
*/
|
|
149
|
-
async function dispatchFanout(items, promptFn, subRole, modelRole, subLabel, schema, personaNoun, phaseLabel, basePrompt, p) {
|
|
150
|
-
const { ctx } = p;
|
|
151
|
-
ctx.ui.notify(` init dispatch: sequential ${items.length}-agent fan-out for "${phaseLabel}" ` +
|
|
152
|
-
`(meta uses parallel; this port is sequential — slower but simpler)`, "info");
|
|
153
|
-
const results = [];
|
|
154
|
-
for (const item of items) {
|
|
155
|
-
const prompt = promptFn(item, basePrompt);
|
|
156
|
-
const result = await dispatchSingleAgent(subLabel(item), subRole, modelRole, prompt, schema, personaNoun, p);
|
|
157
|
-
results.push(result);
|
|
158
|
-
if (result.exitCode !== 0) {
|
|
159
|
-
return { results, failedItem: item };
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return { results, failedItem: null };
|
|
163
|
-
}
|
|
164
|
-
// ── Main export ───────────────────────────────────────────────────────────────
|
|
165
|
-
/**
|
|
166
|
-
* Dispatch a single /forge:init phase. Returns a discriminated outcome:
|
|
167
|
-
*
|
|
168
|
-
* - `{ kind: "skip" }` for deterministic phases (orchestrator handles them).
|
|
169
|
-
* - `{ kind: "return", result }` for failures / early-exit.
|
|
170
|
-
* - `{ kind: "ok", result }` carrying the last SubagentResult on success.
|
|
171
|
-
*/
|
|
172
|
-
export async function dispatchInitPhase(p) {
|
|
173
|
-
const { phase, phaseIndex, ctx, bundleRoot, kbFolder, isoTimestamp } = p;
|
|
174
|
-
// Deterministic phases are handled by the orchestrator directly.
|
|
175
|
-
if (phase.kind === "deterministic") {
|
|
176
|
-
return { kind: "skip" };
|
|
177
|
-
}
|
|
178
|
-
// ── Phase 1: collect (5 domain fan-out + config-writer) ──────────────────
|
|
179
|
-
if (phase.name === "collect") {
|
|
180
|
-
let phasePrompt;
|
|
181
|
-
try {
|
|
182
|
-
phasePrompt = readInitPhasePrompt(bundleRoot, 1);
|
|
183
|
-
}
|
|
184
|
-
catch (err) {
|
|
185
|
-
const e = err;
|
|
186
|
-
ctx.ui.notify(`× init dispatch: cannot read Phase 1 prompt: ${e.message ?? "unknown"}`, "error");
|
|
187
|
-
return { kind: "return", result: { status: "failed", lastPhase: phaseIndex, failure: `prompt read failed: ${e.message ?? "unknown"}` } };
|
|
188
|
-
}
|
|
189
|
-
// Domain discovery fan-out (5 sequential agents).
|
|
190
|
-
// kbFolder is passed so each agent honors the phase-1-collect.md
|
|
191
|
-
// "orchestrator already supplied kbFolder → skip this prompt" contract.
|
|
192
|
-
// The interactive KB-folder prompt is owned solely by the forge-init.ts
|
|
193
|
-
// handler prologue; without this param the subagents re-ask it (and that
|
|
194
|
-
// mid-fan-out ask cannot reliably surface as an actionable modal).
|
|
195
|
-
const { results: domainResults, failedItem: failedDomain } = await dispatchFanout(DOMAINS, (domain, base) => `${base}\n\n<!-- AGENT PARAMS -->\ndomain: ${domain}\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`, "plan", "discovery", (domain) => `discovery:${domain}`, phase.schema, phase.persona ?? "engineer", "collect:discovery", phasePrompt, p);
|
|
196
|
-
if (failedDomain !== null) {
|
|
197
|
-
return {
|
|
198
|
-
kind: "return",
|
|
199
|
-
result: {
|
|
200
|
-
status: "failed",
|
|
201
|
-
lastPhase: phaseIndex,
|
|
202
|
-
failure: `Phase 1 discovery agent failed for domain "${failedDomain}"`,
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
// Config-writer agent. kbFolder supplied so it writes paths.engineering
|
|
207
|
-
// from the orchestrator-resolved value and skips the interactive prompt.
|
|
208
|
-
const configPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS -->\nrole: config-writer\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`;
|
|
209
|
-
let configResult = await dispatchSingleAgent("config-writer", "plan", "config", configPrompt, phase.schema, phase.persona ?? "engineer", p);
|
|
210
|
-
// Retry-once if config-writer returned non-zero exit or verifyExit != 0.
|
|
211
|
-
const configFailed = configResult.exitCode !== 0;
|
|
212
|
-
if (configFailed) {
|
|
213
|
-
ctx.ui.notify(` init dispatch: config-writer failed (exit ${configResult.exitCode}), retrying…`, "info");
|
|
214
|
-
const retryPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS: RETRY -->\nrole: config-writer\nisoTimestamp: ${isoTimestamp}\n`;
|
|
215
|
-
configResult = await dispatchSingleAgent("config-writer:retry", "plan", "config", retryPrompt, phase.schema, phase.persona ?? "engineer", p);
|
|
216
|
-
if (configResult.exitCode !== 0) {
|
|
217
|
-
return {
|
|
218
|
-
kind: "return",
|
|
219
|
-
result: {
|
|
220
|
-
status: "failed",
|
|
221
|
-
lastPhase: phaseIndex,
|
|
222
|
-
failure: "Phase 1 config-writer failed after retry",
|
|
223
|
-
},
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// Use the last domain result as the "representative" result for the phase.
|
|
228
|
-
// The orchestrator (T03) composes the phase event from whichever result it
|
|
229
|
-
// tracks; returning configResult here is simplest and correct.
|
|
230
|
-
void domainResults; // consumed above; suppress unused-var
|
|
231
|
-
return { kind: "ok", result: configResult };
|
|
232
|
-
}
|
|
233
|
-
// ── Phase 2: discover (gate + 7 KB-doc fan-out + index + context) ────────
|
|
234
|
-
if (phase.name === "discover") {
|
|
235
|
-
let phasePrompt;
|
|
236
|
-
try {
|
|
237
|
-
phasePrompt = readInitPhasePrompt(bundleRoot, 2);
|
|
238
|
-
}
|
|
239
|
-
catch (err) {
|
|
240
|
-
const e = err;
|
|
241
|
-
ctx.ui.notify(`× init dispatch: cannot read Phase 2 prompt: ${e.message ?? "unknown"}`, "error");
|
|
242
|
-
return { kind: "return", result: { status: "failed", lastPhase: phaseIndex, failure: `prompt read failed: ${e.message ?? "unknown"}` } };
|
|
243
|
-
}
|
|
244
|
-
// Gate agent (haiku-tier — just checks readiness).
|
|
245
|
-
const gatePrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS -->\nrole: gate\nisoTimestamp: ${isoTimestamp}\n`;
|
|
246
|
-
const gateResult = await dispatchSingleAgent("gate", "implement", "gate", gatePrompt, undefined, phase.persona ?? "engineer", p);
|
|
247
|
-
if (gateResult.exitCode !== 0) {
|
|
248
|
-
ctx.ui.notify(`× init dispatch: Phase 2 gate failed — halting.`, "error");
|
|
249
|
-
return {
|
|
250
|
-
kind: "return",
|
|
251
|
-
result: { status: "failed", lastPhase: phaseIndex, failure: "Phase 2 gate failed" },
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
// KB-doc fan-out (7 sequential agents), retry each failed doc once.
|
|
255
|
-
const { ctx: _ctx } = p;
|
|
256
|
-
_ctx.ui.notify(` init dispatch: sequential ${KB_DOC_IDS.length}-agent fan-out for "discover:kb-docs" ` +
|
|
257
|
-
`(meta uses parallel; this port is sequential — slower but simpler)`, "info");
|
|
258
|
-
const kbResults = [];
|
|
259
|
-
for (const docId of KB_DOC_IDS) {
|
|
260
|
-
const kbPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS -->\nrole: kb-doc\ndocId: ${docId}\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`;
|
|
261
|
-
let kbResult = await dispatchSingleAgent(`kb-doc:${docId}`, "plan", "kb-doc", kbPrompt, phase.schema, phase.persona ?? "engineer", p);
|
|
262
|
-
if (kbResult.exitCode !== 0) {
|
|
263
|
-
// Retry once.
|
|
264
|
-
ctx.ui.notify(` init dispatch: kb-doc "${docId}" failed, retrying…`, "info");
|
|
265
|
-
const retryKbPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS: RETRY -->\nrole: kb-doc\ndocId: ${docId}\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`;
|
|
266
|
-
kbResult = await dispatchSingleAgent(`kb-doc:${docId}:retry`, "plan", "kb-doc", retryKbPrompt, phase.schema, phase.persona ?? "engineer", p);
|
|
267
|
-
if (kbResult.exitCode !== 0) {
|
|
268
|
-
return {
|
|
269
|
-
kind: "return",
|
|
270
|
-
result: {
|
|
271
|
-
status: "failed",
|
|
272
|
-
lastPhase: phaseIndex,
|
|
273
|
-
failure: `Phase 2 kb-doc "${docId}" failed after retry`,
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
kbResults.push(kbResult);
|
|
279
|
-
}
|
|
280
|
-
// Index agent.
|
|
281
|
-
const indexPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS -->\nrole: index\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`;
|
|
282
|
-
const indexResult = await dispatchSingleAgent("index", "plan", "index", indexPrompt, undefined, phase.persona ?? "engineer", p);
|
|
283
|
-
if (indexResult.exitCode !== 0) {
|
|
284
|
-
return {
|
|
285
|
-
kind: "return",
|
|
286
|
-
result: { status: "failed", lastPhase: phaseIndex, failure: "Phase 2 index agent failed" },
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
// Context agent — retry-once on failure.
|
|
290
|
-
const contextPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS -->\nrole: context\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`;
|
|
291
|
-
let contextResult = await dispatchSingleAgent("context", "plan", "context", contextPrompt, undefined, phase.persona ?? "engineer", p);
|
|
292
|
-
if (contextResult.exitCode !== 0) {
|
|
293
|
-
ctx.ui.notify(` init dispatch: context agent failed, retrying…`, "info");
|
|
294
|
-
const retryContextPrompt = `${phasePrompt}\n\n<!-- AGENT PARAMS: RETRY -->\nrole: context\nkbFolder: ${kbFolder}\nisoTimestamp: ${isoTimestamp}\n`;
|
|
295
|
-
contextResult = await dispatchSingleAgent("context:retry", "plan", "context", retryContextPrompt, undefined, phase.persona ?? "engineer", p);
|
|
296
|
-
if (contextResult.exitCode !== 0) {
|
|
297
|
-
return {
|
|
298
|
-
kind: "return",
|
|
299
|
-
result: { status: "failed", lastPhase: phaseIndex, failure: "Phase 2 context agent failed after retry" },
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
void kbResults; // consumed above; suppress unused-var
|
|
304
|
-
return { kind: "ok", result: contextResult };
|
|
305
|
-
}
|
|
306
|
-
// Unsupported LLM phase kind — should not happen with the current table.
|
|
307
|
-
ctx.ui.notify(`× init dispatch: unsupported phase "${phase.name}" (kind=${phase.kind}) — skipping`, "error");
|
|
308
|
-
return {
|
|
309
|
-
kind: "return",
|
|
310
|
-
result: { status: "failed", lastPhase: phaseIndex, failure: `unsupported phase "${phase.name}"` },
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
184
|
//# sourceMappingURL=init-phase-dispatch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-phase-dispatch.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/init/init-phase-dispatch.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,mEAAmE;AACnE,sEAAsE;AACtE,+EAA+E;AAC/E,uDAAuD;AACvD,EAAE;AACF,+EAA+E;AAC/E,mFAAmF;AACnF,EAAE;AACF,gFAAgF;AAChF,0DAA0D;AAC1D,8EAA8E;AAE9E,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE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SAAS,EACT,KAAK,CAAC,OAAO,IAAI,UAAU,EAC3B,CAAC,CACD,CAAC;QACF,IAAI,aAAa,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,kDAAkD,EAAE,MAAM,CAAC,CAAC;YAC1E,MAAM,kBAAkB,GACvB,GAAG,WAAW,8DAA8D,QAAQ,mBAAmB,YAAY,IAAI,CAAC;YACzH,aAAa,GAAG,MAAM,mBAAmB,CACxC,eAAe,EACf,MAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,KAAK,CAAC,OAAO,IAAI,UAAU,EAC3B,CAAC,CACD,CAAC;YACF,IAAI,aAAa,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;gBAClC,OAAO;oBACN,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,0CAA0C,EAAE;iBACxG,CAAC;YACH,CAAC;QACF,CAAC;QAED,KAAK,SAAS,CAAC,CAAC,sCAAsC;QACtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IAC9C,CAAC;IAED,yEAAyE;IACzE,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,uCAAuC,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,IAAI,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7G,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,sBAAsB,KAAK,CAAC,IAAI,GAAG,EAAE;KACjG,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"init-phase-dispatch.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/init/init-phase-dispatch.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/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AM,EAAE,UAAU,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -7,46 +7,3 @@ export { DOMAINS, KB_DOC_IDS, ROLE_TIER };
|
|
|
7
7
|
* /forge:dashboard overlay render from (parity with run-task using its taskId).
|
|
8
8
|
*/
|
|
9
9
|
export declare const INIT_SESSION_ID = "forge-init";
|
|
10
|
-
/**
|
|
11
|
-
* Execution strategy for an init phase.
|
|
12
|
-
* - `subagent_fanout` — spawn N parallel subagents (one per domain/docId).
|
|
13
|
-
* - `subagent_single` — spawn exactly one subagent.
|
|
14
|
-
* - `deterministic` — run local tool invocations; no LLM subagent.
|
|
15
|
-
*/
|
|
16
|
-
export type InitPhaseKind = "subagent_fanout" | "subagent_single" | "deterministic";
|
|
17
|
-
/**
|
|
18
|
-
* Descriptor for a single /forge:init phase.
|
|
19
|
-
* Mirrors PhaseDescriptor from orchestrators/task/task-phases.ts, extended with
|
|
20
|
-
* init-specific fields.
|
|
21
|
-
*/
|
|
22
|
-
export interface InitPhaseDescriptor {
|
|
23
|
-
/** Human label (also used as the phase key for checkpoints). */
|
|
24
|
-
name: string;
|
|
25
|
-
/** Execution strategy — drives dispatcher behaviour in T02. */
|
|
26
|
-
kind: InitPhaseKind;
|
|
27
|
-
/**
|
|
28
|
-
* For `subagent_fanout` phases: the items to fan out over.
|
|
29
|
-
* Phase 1 (collect) uses `domains`; Phase 2 (discover) uses `docIds`.
|
|
30
|
-
*/
|
|
31
|
-
domains?: readonly string[];
|
|
32
|
-
docIds?: readonly string[];
|
|
33
|
-
/** Persona noun for persona-load (LLM phases only). */
|
|
34
|
-
persona?: string;
|
|
35
|
-
/** Key into ROLE_TIER for model resolution (LLM phases only). */
|
|
36
|
-
modelRole?: string;
|
|
37
|
-
/** TypeBox schema passed to runForgeSubagent (LLM phases only). */
|
|
38
|
-
schema?: object;
|
|
39
|
-
/** Name of the verify function (matches export in verifiers.ts, T02+). */
|
|
40
|
-
verifyFn?: "verifyPhase1" | "verifyPhase2" | "verifyPhase3";
|
|
41
|
-
/**
|
|
42
|
-
* Maximum retry count.
|
|
43
|
-
* 0 = hard-halt on first failure (no retry);
|
|
44
|
-
* 1 = retry once before halting.
|
|
45
|
-
*/
|
|
46
|
-
retryCap: number;
|
|
47
|
-
}
|
|
48
|
-
export declare const INIT_PHASES: InitPhaseDescriptor[];
|
|
49
|
-
/** Look up a phase descriptor by name, or undefined if not found. */
|
|
50
|
-
export declare function initPhaseByName(name: string): InitPhaseDescriptor | undefined;
|
|
51
|
-
/** Index of a phase in INIT_PHASES by name, or -1 if not found. */
|
|
52
|
-
export declare function initPhaseIndexByName(name: string): number;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
// init-phases.ts —
|
|
2
|
-
// Scaffolded by FORGE-S33-T01.
|
|
1
|
+
// init-phases.ts — shared constants for the /forge:init pipeline.
|
|
3
2
|
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
3
|
+
// FORGE-S35-T02 (Slice 1) retired the coarse `INIT_PHASES` descriptor table,
|
|
4
|
+
// `initPhaseByName`, and `initPhaseIndexByName`: the flat step machine
|
|
5
|
+
// (init-steps.ts + the INIT_STEPS table in run-init-pipeline.ts) fully subsumes
|
|
6
|
+
// the intra-phase routing they encoded. Keeping them as inert data would drift
|
|
7
|
+
// from the step model and mislead downstream slices, so they were deleted.
|
|
8
|
+
//
|
|
9
|
+
// This module now only re-exports the init-wide constants (DOMAINS, KB_DOC_IDS,
|
|
10
|
+
// ROLE_TIER, schemas) plus the synthetic session id, so callers that import
|
|
11
|
+
// from init-phases.ts keep a single import site.
|
|
12
|
+
import { DOMAINS, KB_DOC_IDS, ROLE_TIER, } from "./run-init-types.js";
|
|
8
13
|
// Re-export constants so callers that only import from init-phases.ts get
|
|
9
14
|
// everything they need without extra imports.
|
|
10
15
|
export { DOMAINS, KB_DOC_IDS, ROLE_TIER };
|
|
@@ -15,57 +20,4 @@ export { DOMAINS, KB_DOC_IDS, ROLE_TIER };
|
|
|
15
20
|
* /forge:dashboard overlay render from (parity with run-task using its taskId).
|
|
16
21
|
*/
|
|
17
22
|
export const INIT_SESSION_ID = "forge-init";
|
|
18
|
-
// ── Phase table ───────────────────────────────────────────────────────────────
|
|
19
|
-
//
|
|
20
|
-
// Four entries matching the phases declared in wfl-init.js meta.phases:
|
|
21
|
-
// Collect / Discover / Materialize / Register
|
|
22
|
-
//
|
|
23
|
-
// Intra-phase routing (e.g. config-writer sub-step in Phase 1, gate+scaffold
|
|
24
|
-
// + index + context sub-steps in Phase 2) is deferred to T02
|
|
25
|
-
// (init-phase-dispatch.ts); the table captures coarse phase shape only.
|
|
26
|
-
export const INIT_PHASES = [
|
|
27
|
-
{
|
|
28
|
-
name: "collect",
|
|
29
|
-
kind: "subagent_fanout",
|
|
30
|
-
domains: DOMAINS,
|
|
31
|
-
persona: "engineer",
|
|
32
|
-
modelRole: "discovery",
|
|
33
|
-
schema: DISCOVERY_SCHEMA,
|
|
34
|
-
verifyFn: "verifyPhase1",
|
|
35
|
-
retryCap: 1,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "discover",
|
|
39
|
-
kind: "subagent_fanout",
|
|
40
|
-
docIds: KB_DOC_IDS,
|
|
41
|
-
persona: "engineer",
|
|
42
|
-
modelRole: "kb-doc",
|
|
43
|
-
schema: KB_DOC_SCHEMA,
|
|
44
|
-
verifyFn: "verifyPhase2",
|
|
45
|
-
retryCap: 1,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "materialize",
|
|
49
|
-
kind: "deterministic",
|
|
50
|
-
modelRole: "materialize",
|
|
51
|
-
schema: PHASE_RESULT_SCHEMA,
|
|
52
|
-
verifyFn: "verifyPhase3",
|
|
53
|
-
retryCap: 0,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: "register",
|
|
57
|
-
kind: "deterministic",
|
|
58
|
-
modelRole: "register",
|
|
59
|
-
schema: OK_SCHEMA,
|
|
60
|
-
retryCap: 0,
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
/** Look up a phase descriptor by name, or undefined if not found. */
|
|
64
|
-
export function initPhaseByName(name) {
|
|
65
|
-
return INIT_PHASES.find((p) => p.name === name);
|
|
66
|
-
}
|
|
67
|
-
/** Index of a phase in INIT_PHASES by name, or -1 if not found. */
|
|
68
|
-
export function initPhaseIndexByName(name) {
|
|
69
|
-
return INIT_PHASES.findIndex((p) => p.name === name);
|
|
70
|
-
}
|
|
71
23
|
//# sourceMappingURL=init-phases.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-phases.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/init/init-phases.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"init-phases.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/init/init-phases.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,uEAAuE;AACvE,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAC3E,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,iDAAiD;AAEjD,OAAO,EACN,OAAO,EACP,UAAU,EACV,SAAS,GACT,MAAM,qBAAqB,CAAC;AAE7B,0EAA0E;AAC1E,8CAA8C;AAC9C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { PhaseRole } from "../../subagent/caller-context.js";
|
|
2
|
+
import type { SubagentResult } from "../../forge-subagent.js";
|
|
3
|
+
export type StepId = string;
|
|
4
|
+
/**
|
|
5
|
+
* Runtime context threaded through a single pipeline run. Opaque to the machine
|
|
6
|
+
* primitives — the orchestrator defines the concrete shape and reads/writes its
|
|
7
|
+
* own mutable pipeline state (configCache, verify flags, …) through it.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: within a wave, steps run CONCURRENTLY and share this one ctx object, so
|
|
10
|
+
* the machine never stashes per-step run results on it (that would race). A
|
|
11
|
+
* subagent step's `requiredOutput` receives its own dispatch result as the
|
|
12
|
+
* second argument instead. Only single-step waves (deterministic gates) mutate
|
|
13
|
+
* ctx fields, so those reads/writes are race-free.
|
|
14
|
+
*/
|
|
15
|
+
export interface StepRuntimeCtx {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface StepCheckResult {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
reason?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Deterministic precondition / postcondition — never fabricates LLM facts.
|
|
24
|
+
* `requiredOutput` receives the step's own subagent dispatch result (if any) as
|
|
25
|
+
* `lastResult`; `precondition` is always called with `lastResult` undefined.
|
|
26
|
+
*/
|
|
27
|
+
export type StepCheck = (ctx: StepRuntimeCtx, lastResult?: SubagentResult) => Promise<StepCheckResult>;
|
|
28
|
+
/** A deterministic step: local tool/fs work, spawns NO subagent. */
|
|
29
|
+
export interface DeterministicRun {
|
|
30
|
+
kind: "deterministic";
|
|
31
|
+
thunk: (ctx: StepRuntimeCtx) => Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/** A scoped single-responsibility subagent descriptor. */
|
|
34
|
+
export interface SubagentRun {
|
|
35
|
+
kind: "subagent";
|
|
36
|
+
/** Which bundled phase prompt to read (1 = collect, 2 = discover). */
|
|
37
|
+
promptPhase: 1 | 2;
|
|
38
|
+
/** Dispatch label / OrchestratorTree node id fragment. */
|
|
39
|
+
subLabel: string;
|
|
40
|
+
/** CallerContextStore role the dispatch runs under. */
|
|
41
|
+
subRole: PhaseRole;
|
|
42
|
+
/** ROLE_TIER key for model resolution. */
|
|
43
|
+
modelRole: string;
|
|
44
|
+
/** Persona noun (loaded from the bundle base-pack). */
|
|
45
|
+
persona: string;
|
|
46
|
+
/** TypeBox schema passed to runForgeSubagent (optional). */
|
|
47
|
+
schema?: object;
|
|
48
|
+
/** Coarse phase group used for IL10 phase-event naming. */
|
|
49
|
+
phaseGroup: string;
|
|
50
|
+
/** Inject the per-step `<!-- AGENT PARAMS -->` block onto the base prompt. */
|
|
51
|
+
buildPrompt: (basePrompt: string, ctx: StepRuntimeCtx) => string;
|
|
52
|
+
}
|
|
53
|
+
export type StepRun = DeterministicRun | SubagentRun;
|
|
54
|
+
export interface RetryPolicy {
|
|
55
|
+
/** 0 = hard-halt on first requiredOutput failure; 1 = one rerun then halt. */
|
|
56
|
+
maxReruns: number;
|
|
57
|
+
}
|
|
58
|
+
export interface Step {
|
|
59
|
+
id: StepId;
|
|
60
|
+
/** Ordering edges — the only serialization constraint (topo layering). */
|
|
61
|
+
dependsOn: StepId[];
|
|
62
|
+
/** Deterministic gate checked BEFORE run/dispatch. */
|
|
63
|
+
precondition?: StepCheck;
|
|
64
|
+
run: StepRun;
|
|
65
|
+
/** Deterministic postcondition checked AFTER each run. */
|
|
66
|
+
requiredOutput?: StepCheck;
|
|
67
|
+
retryPolicy: RetryPolicy;
|
|
68
|
+
}
|
|
69
|
+
export interface StepOutcome {
|
|
70
|
+
ok: boolean;
|
|
71
|
+
reason?: string;
|
|
72
|
+
/** True when the step actually dispatched a subagent (for IL10 emission). */
|
|
73
|
+
dispatched: boolean;
|
|
74
|
+
/** Number of run attempts (initial + reruns). */
|
|
75
|
+
attempts: number;
|
|
76
|
+
/** The subagent result for a dispatched step (undefined for deterministic). */
|
|
77
|
+
result?: SubagentResult;
|
|
78
|
+
/**
|
|
79
|
+
* Wall-clock bracket for THIS step (epoch ms). Captured per step so IL10
|
|
80
|
+
* emission attributes each subagent's own duration and builds a per-step
|
|
81
|
+
* unique event timestamp — NOT the shared wave bracket (which over-attributes
|
|
82
|
+
* duration and collides eventIds across a fan-out wave).
|
|
83
|
+
*/
|
|
84
|
+
startMs: number;
|
|
85
|
+
endMs: number;
|
|
86
|
+
}
|
|
87
|
+
/** Dispatch a subagent step and return its result. Injected so tests can spy. */
|
|
88
|
+
export type SubagentDispatcher = (run: SubagentRun, ctx: StepRuntimeCtx) => Promise<SubagentResult>;
|
|
89
|
+
export interface RunStepDeps {
|
|
90
|
+
ctx: StepRuntimeCtx;
|
|
91
|
+
dispatchSubagent: SubagentDispatcher;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Drive one step: check precondition (halt pre-dispatch on failure) → run
|
|
95
|
+
* (deterministic thunk OR subagent) → check requiredOutput → on failure rerun
|
|
96
|
+
* up to `retryPolicy.maxReruns`, else halt.
|
|
97
|
+
*
|
|
98
|
+
* A precondition failure returns `{ ok:false, dispatched:false }` with ZERO
|
|
99
|
+
* dispatches — the gate is always checked before any subagent is spawned.
|
|
100
|
+
*/
|
|
101
|
+
export declare function runStep(step: Step, deps: RunStepDeps): Promise<StepOutcome>;
|
|
102
|
+
/**
|
|
103
|
+
* Dispatch every step in a wave concurrently via `Promise.all`. Steps sharing a
|
|
104
|
+
* wave are independent (no unresolved dependency), so they overlap. Returns the
|
|
105
|
+
* outcomes in the wave's step order. Concurrency is bounded by wave width
|
|
106
|
+
* (≤ 10 for the kb-doc wave), so no explicit limiter is needed this slice.
|
|
107
|
+
*/
|
|
108
|
+
export declare function runWave(steps: Step[], run: (step: Step) => Promise<StepOutcome>): Promise<StepOutcome[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Group steps into topo-sorted waves (Kahn layering): every step whose
|
|
111
|
+
* dependencies are all satisfied by earlier waves lands in the next wave.
|
|
112
|
+
* Declaration order is preserved within a wave. Throws on a dependency cycle.
|
|
113
|
+
* Edges to unknown step ids are ignored (treated as already-satisfied).
|
|
114
|
+
*/
|
|
115
|
+
export declare function topoSortWaves(steps: Step[]): Step[][];
|