@entelligentsia/forgecli 1.0.25 → 1.0.40
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 +341 -0
- package/README.md +2 -0
- package/dist/CHANGELOG-forge-plugin.md +264 -0
- package/dist/CHANGELOG-pi.md +143 -0
- package/dist/bin/argv.d.ts +2 -2
- package/dist/bin/argv.js +37 -0
- package/dist/bin/argv.js.map +1 -1
- package/dist/bin/forge.js +30 -16
- package/dist/bin/forge.js.map +1 -1
- package/dist/bin/init.d.ts +23 -0
- package/dist/bin/init.js +123 -0
- package/dist/bin/init.js.map +1 -0
- package/dist/bin/reset.d.ts +39 -0
- package/dist/bin/reset.js +101 -0
- package/dist/bin/reset.js.map +1 -0
- package/dist/bin/uninstall.d.ts +20 -0
- package/dist/bin/uninstall.js +141 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/extensions/forgecli/claude-bootstrap/bootstrap.d.ts +40 -0
- package/dist/extensions/forgecli/claude-bootstrap/bootstrap.js +384 -0
- package/dist/extensions/forgecli/claude-bootstrap/bootstrap.js.map +1 -0
- package/dist/extensions/forgecli/claude-bootstrap/settings-merge.d.ts +46 -0
- package/dist/extensions/forgecli/claude-bootstrap/settings-merge.js +245 -0
- package/dist/extensions/forgecli/claude-bootstrap/settings-merge.js.map +1 -0
- package/dist/extensions/forgecli/claude-bootstrap/uninstall.d.ts +23 -0
- package/dist/extensions/forgecli/claude-bootstrap/uninstall.js +235 -0
- package/dist/extensions/forgecli/claude-bootstrap/uninstall.js.map +1 -0
- package/dist/extensions/forgecli/commands/reset.d.ts +16 -0
- package/dist/extensions/forgecli/commands/reset.js +83 -0
- package/dist/extensions/forgecli/commands/reset.js.map +1 -0
- package/dist/extensions/forgecli/dashboard/component.js +10 -7
- package/dist/extensions/forgecli/dashboard/component.js.map +1 -1
- package/dist/extensions/forgecli/forge-commands.d.ts +7 -2
- package/dist/extensions/forgecli/forge-commands.js +19 -5
- package/dist/extensions/forgecli/forge-commands.js.map +1 -1
- package/dist/extensions/forgecli/forge-subagent.d.ts +4 -4
- package/dist/extensions/forgecli/hooks/forge-permissions.js +20 -6
- package/dist/extensions/forgecli/hooks/forge-permissions.js.map +1 -1
- package/dist/extensions/forgecli/index.js +6 -3
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/lib/forge-root.d.ts +6 -0
- package/dist/extensions/forgecli/lib/forge-root.js +52 -0
- package/dist/extensions/forgecli/lib/forge-root.js.map +1 -1
- package/dist/extensions/forgecli/lib/payload-manifest.d.ts +62 -0
- package/dist/extensions/forgecli/lib/payload-manifest.js +151 -0
- package/dist/extensions/forgecli/lib/payload-manifest.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/advisory-render.d.ts +9 -0
- package/dist/extensions/forgecli/orchestrators/advisory-render.js +107 -0
- package/dist/extensions/forgecli/orchestrators/advisory-render.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-body.d.ts +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-body.js +65 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-body.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-id.d.ts +23 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-id.js +140 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-id.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-phase-dispatch.d.ts +54 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-phase-dispatch.js +349 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-phase-dispatch.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-phases.d.ts +11 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-phases.js +82 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-phases.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-state.d.ts +14 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-state.js +100 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-state.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-triage-routing.d.ts +72 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-triage-routing.js +204 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-triage-routing.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.d.ts +38 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.js +198 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-verdict.d.ts +3 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-verdict.js +55 -0
- package/dist/extensions/forgecli/orchestrators/bug/bug-verdict.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-command.d.ts +7 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-command.js +293 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-command.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.d.ts +2 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.js +501 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-types.d.ts +41 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-types.js +5 -0
- package/dist/extensions/forgecli/orchestrators/bug/run-bug-types.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-entry.d.ts +43 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-entry.js +85 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-entry.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-misc.d.ts +8 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-misc.js +37 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-misc.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-notify.d.ts +28 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-notify.js +45 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-notify.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-transcript-session.d.ts +26 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-transcript-session.js +75 -0
- package/dist/extensions/forgecli/orchestrators/common/orchestrator-transcript-session.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/recovery-menu.d.ts +24 -0
- package/dist/extensions/forgecli/orchestrators/common/recovery-menu.js +58 -0
- package/dist/extensions/forgecli/orchestrators/common/recovery-menu.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.d.ts +53 -0
- package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.js +131 -0
- package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/common/summary-recovery.d.ts +24 -0
- package/dist/extensions/forgecli/orchestrators/common/summary-recovery.js +37 -0
- package/dist/extensions/forgecli/orchestrators/common/summary-recovery.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/fix-bug.d.ts +9 -93
- package/dist/extensions/forgecli/orchestrators/fix-bug.js +23 -1721
- package/dist/extensions/forgecli/orchestrators/fix-bug.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/halt-advisor.js +25 -3
- package/dist/extensions/forgecli/orchestrators/halt-advisor.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/run-sprint.d.ts +3 -12
- package/dist/extensions/forgecli/orchestrators/run-sprint.js +48 -270
- package/dist/extensions/forgecli/orchestrators/run-sprint.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/run-task.d.ts +10 -214
- package/dist/extensions/forgecli/orchestrators/run-task.js +31 -1481
- package/dist/extensions/forgecli/orchestrators/run-task.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/sprint/sprint-ceremony.d.ts +33 -0
- package/dist/extensions/forgecli/orchestrators/sprint/sprint-ceremony.js +135 -0
- package/dist/extensions/forgecli/orchestrators/sprint/sprint-ceremony.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/sprint/sprint-state.d.ts +18 -0
- package/dist/extensions/forgecli/orchestrators/sprint/sprint-state.js +55 -0
- package/dist/extensions/forgecli/orchestrators/sprint/sprint-state.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-command.d.ts +9 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-command.js +174 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-command.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.d.ts +2 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.js +494 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-types.d.ts +62 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-types.js +5 -0
- package/dist/extensions/forgecli/orchestrators/task/run-task-types.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-body.d.ts +4 -0
- package/dist/extensions/forgecli/orchestrators/task/task-body.js +48 -0
- package/dist/extensions/forgecli/orchestrators/task/task-body.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-events.d.ts +63 -0
- package/dist/extensions/forgecli/orchestrators/task/task-events.js +185 -0
- package/dist/extensions/forgecli/orchestrators/task/task-events.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-gates.d.ts +34 -0
- package/dist/extensions/forgecli/orchestrators/task/task-gates.js +78 -0
- package/dist/extensions/forgecli/orchestrators/task/task-gates.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-phase-dispatch.d.ts +42 -0
- package/dist/extensions/forgecli/orchestrators/task/task-phase-dispatch.js +370 -0
- package/dist/extensions/forgecli/orchestrators/task/task-phase-dispatch.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-phases.d.ts +17 -0
- package/dist/extensions/forgecli/orchestrators/task/task-phases.js +48 -0
- package/dist/extensions/forgecli/orchestrators/task/task-phases.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-record.d.ts +9 -0
- package/dist/extensions/forgecli/orchestrators/task/task-record.js +58 -0
- package/dist/extensions/forgecli/orchestrators/task/task-record.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-state.d.ts +14 -0
- package/dist/extensions/forgecli/orchestrators/task/task-state.js +35 -0
- package/dist/extensions/forgecli/orchestrators/task/task-state.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.d.ts +36 -0
- package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.js +187 -0
- package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.js.map +1 -0
- package/dist/extensions/forgecli/store/store-resolver.d.ts +15 -0
- package/dist/extensions/forgecli/store/store-resolver.js +118 -18
- package/dist/extensions/forgecli/store/store-resolver.js.map +1 -1
- package/dist/extensions/forgecli/update/forge-update-command.js +10 -7
- package/dist/extensions/forgecli/update/forge-update-command.js.map +1 -1
- package/dist/forge-payload/.base-pack/workflows/collator_agent.md +5 -6
- package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +1 -1
- package/dist/forge-payload/.base-pack/workflows-js/wfl-init.js +449 -0
- package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
- package/dist/forge-payload/.schemas/enum-catalog.json +2 -2
- package/dist/forge-payload/.schemas/migrations.json +170 -0
- package/dist/forge-payload/.schemas/payload-manifest.schema.json +100 -0
- package/dist/forge-payload/commands/add-pipeline.md +1 -1
- package/dist/forge-payload/commands/add-task.md +3 -3
- package/dist/forge-payload/{.base-pack/commands → commands}/approve.md +2 -2
- package/dist/forge-payload/commands/ask.md +1 -1
- package/dist/forge-payload/commands/check-agent.md +8 -24
- package/dist/forge-payload/{.base-pack/commands → commands}/collate.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/commit.md +2 -2
- package/dist/forge-payload/commands/config.md +1 -1
- package/dist/forge-payload/commands/enhance.md +31 -5
- package/dist/forge-payload/{.base-pack/commands → commands}/fix-bug.md +2 -2
- package/dist/forge-payload/commands/health.md +1 -1
- package/dist/forge-payload/{.base-pack/commands → commands}/implement.md +2 -2
- package/dist/forge-payload/commands/init.md +186 -67
- package/dist/forge-payload/{.base-pack/commands → commands}/new-sprint.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/plan-sprint.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/plan.md +2 -2
- package/dist/forge-payload/commands/rebuild.md +3 -3
- package/dist/forge-payload/commands/remove.md +1 -1
- package/dist/forge-payload/commands/repair.md +1 -1
- package/dist/forge-payload/commands/report-bug.md +1 -1
- package/dist/forge-payload/commands/reset.md +117 -0
- package/dist/forge-payload/{.base-pack/commands → commands}/retro.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/review-code.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/review-plan.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/run-sprint.md +2 -2
- package/dist/forge-payload/{.base-pack/commands → commands}/run-task.md +2 -2
- package/dist/forge-payload/commands/status.md +1 -1
- package/dist/forge-payload/commands/update.md +3 -3
- package/dist/forge-payload/{.base-pack/commands → commands}/validate.md +2 -2
- package/dist/forge-payload/hooks/forge-permissions.cjs +29 -6
- package/dist/forge-payload/hooks/lib/common.cjs +228 -0
- package/dist/forge-payload/hooks/lib/plugin-detection.cjs +106 -0
- package/dist/forge-payload/hooks/lib/update-msg.cjs +23 -0
- package/dist/forge-payload/hooks/lib/update-url.cjs +46 -0
- package/dist/forge-payload/hooks/lib/write-registry.js +53 -0
- package/dist/forge-payload/init/discovery/discover-database.md +32 -0
- package/dist/forge-payload/init/discovery/discover-processes.md +31 -0
- package/dist/forge-payload/init/discovery/discover-routing.md +31 -0
- package/dist/forge-payload/init/discovery/discover-stack.md +33 -0
- package/dist/forge-payload/init/discovery/discover-testing.md +34 -0
- package/dist/forge-payload/init/generation/generate-commands.md +171 -0
- package/dist/forge-payload/init/generation/generate-kb-doc.md +60 -0
- package/dist/forge-payload/init/generation/generate-persona.md +73 -0
- package/dist/forge-payload/init/generation/generate-skill.md +66 -0
- package/dist/forge-payload/init/generation/generate-template.md +60 -0
- package/dist/forge-payload/init/generation/generate-tools.md +133 -0
- package/dist/forge-payload/init/generation/generate-workflows.md +78 -0
- package/dist/forge-payload/init/phases/phase-1-collect.md +10 -2
- package/dist/forge-payload/init/phases/phase-3-materialize.md +5 -1
- package/dist/forge-payload/init/phases/phase-4-register.md +8 -0
- package/dist/forge-payload/init/workflow-gen-plan.json +17 -0
- package/dist/forge-payload/integrity.json +33 -18
- package/dist/forge-payload/meta/workflows/meta-collate.md +5 -6
- package/dist/forge-payload/meta/workflows/meta-migrate.md +1 -1
- package/dist/forge-payload/payload-manifest.json +314 -0
- package/dist/forge-payload/schemas/enum-catalog.json +2 -2
- package/dist/forge-payload/schemas/payload-manifest.schema.json +100 -0
- package/dist/forge-payload/schemas/structure-manifest.json +5 -12
- package/dist/forge-payload/tools/forge-preflight.cjs +268 -0
- package/dist/forge-payload/tools/lib/paths.cjs +12 -11
- package/dist/forge-payload/tools/lib/pricing.cjs +31 -11
- package/dist/forge-payload/tools/query-logger.cjs +34 -0
- package/dist/forge-payload/tools/reset-plan.cjs +210 -0
- package/dist/forge-payload/tools/store.cjs +4 -1
- package/dist/forge-payload/tools/substitute-placeholders.cjs +14 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +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 +1 -1
- 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/execution-env.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +20 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +92 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +18 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +10 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +31 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +30 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +170 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +26 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +90 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +6 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +12 -4
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +45 -0
- 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 +45 -0
- 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 +1804 -815
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2031 -1384
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +71 -27
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +24 -16
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +35 -13
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +12 -4
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.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 +13 -1
- 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/oauth/openai-codex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +1 -1
- 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 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.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 +143 -0
- package/node_modules/@earendil-works/pi-coding-agent/README.md +26 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.d.ts +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.js +48 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.d.ts +17 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js +128 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +4 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +4 -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 +16 -3
- 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 +4 -3
- 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/branch-summarization.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +9 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +19 -6
- 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 +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 +4 -4
- 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 +10 -3
- 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 +47 -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 +28 -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/footer-data-provider.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js +29 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts +1 -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 +44 -5
- 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/package-manager.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +47 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +58 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +24 -26
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +72 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +13 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +112 -37
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +7 -33
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -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 +103 -70
- 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 +20 -2
- 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 +97 -30
- 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/slash-commands.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.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 +1 -1
- 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/find.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts +36 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js +202 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +5 -4
- 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/main.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +72 -32
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js +39 -34
- package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +10 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- 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 +20 -0
- 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/tool-execution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +22 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js +91 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +7 -0
- 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 +101 -5
- 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/print-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.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 +1 -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/package-manager-cli.d.ts +6 -2
- 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 +111 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +78 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js +54 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.d.ts +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js +22 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/containerization.md +111 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/docs.json +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +67 -13
- package/node_modules/@earendil-works/pi-coding-agent/docs/index.md +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/prompt-templates.md +9 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/security.md +59 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/skills.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +36 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/tmux.md +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +10 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +19 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-header.ts +1 -1
- 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/doom-overlay/index.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/index.ts +531 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +185 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +19 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/handoff.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/interactive-shell.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-qa-tests.ts +152 -81
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/project-trust.ts +64 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/qna.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/question.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/questionnaire.ts +1 -1
- 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/snake.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/space-invaders.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/summarize.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/tic-tac-toe.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/todo.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/tools.ts +5 -0
- 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 -419
- package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -8
- package/node_modules/@earendil-works/pi-tui/README.md +13 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +102 -43
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +11 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +2 -2
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +4 -7
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -77
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +20 -4
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +244 -42
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +46 -15
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +8 -7
- package/dist/forge-payload/.base-pack/commands/check-agent.md +0 -22
- package/dist/forge-payload/.base-pack/commands/enhance.md +0 -37
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// bug-phases.ts — bug phase descriptor table, bug-event type tokens, terminal
|
|
2
|
+
// states, and the orchestrator-owned post-triage status transitions. Extracted
|
|
3
|
+
// VERBATIM from fix-bug.ts (FORGE-S31 file-size refactor); no logic changes.
|
|
4
|
+
// ── Bug phase descriptor table ──────────────────────────────────────────────
|
|
5
|
+
//
|
|
6
|
+
// Decoded from .forge/workflows/fix_bug.md and the task prompt's BUG_PHASES.
|
|
7
|
+
// triage / plan-fix / implement all read the same fix_bug.md body — the
|
|
8
|
+
// workflow handles all three phases through prose.
|
|
9
|
+
// FORGE-S25-T16: readPersonaDirBug / readPipelineNamesBug extracted to
|
|
10
|
+
// lib/catalog-helpers.ts and imported above with aliases (H-4, N-H-G).
|
|
11
|
+
export const BUG_PHASES = [
|
|
12
|
+
// FORGE-BUG-040: each phase points at its own phase-scoped subagent workflow.
|
|
13
|
+
// Previously triage/plan-fix/implement all pointed at fix_bug.md (the
|
|
14
|
+
// orchestrator-only body), which caused the triage subagent to execute
|
|
15
|
+
// the full lifecycle in a single invocation. plan-fix and implement reuse
|
|
16
|
+
// plan_task.md / implement_plan.md (bug-mode) per meta-fix-bug.md
|
|
17
|
+
// § Pipeline Phases — the bug-mode entity-kind detection is built into
|
|
18
|
+
// those workflows already.
|
|
19
|
+
{ role: "triage", workflowFile: "triage", personaNoun: "bug-fixer", isReview: false, maxIterations: 1 },
|
|
20
|
+
{ role: "plan-fix", workflowFile: "plan_task", personaNoun: "engineer", isReview: false, maxIterations: 1 },
|
|
21
|
+
{ role: "review-plan", workflowFile: "review_plan", personaNoun: "supervisor", isReview: true, maxIterations: 3 },
|
|
22
|
+
{ role: "implement", workflowFile: "implement_plan", personaNoun: "engineer", isReview: false, maxIterations: 1 },
|
|
23
|
+
{ role: "review-code", workflowFile: "review_code", personaNoun: "supervisor", isReview: true, maxIterations: 3 },
|
|
24
|
+
{ role: "approve", workflowFile: "architect_approve", personaNoun: "architect", isReview: true, maxIterations: 3 },
|
|
25
|
+
{ role: "commit", workflowFile: "commit_task", personaNoun: "engineer", isReview: false, maxIterations: 1 },
|
|
26
|
+
];
|
|
27
|
+
// FEAT-009 (halt-recovery UX): the bug status a record must hold for a given
|
|
28
|
+
// phase to (re-)run — the status `resetPipelineState` sets when rewinding the
|
|
29
|
+
// fix-bug pipeline to that phase. The bug FSM is intentionally coarse
|
|
30
|
+
// (reported → triaged → in-progress → fixed): `triage` owns reported→triaged→
|
|
31
|
+
// in-progress, then NO phase writes bug.status until `commit` does
|
|
32
|
+
// in-progress→fixed (meta-fix-bug.md § Iron Laws #2 — verdicts travel through
|
|
33
|
+
// summaries, not status). So every post-triage phase resets to `in-progress`;
|
|
34
|
+
// only `triage` resets to `reported`. The reset is therefore dominated by the
|
|
35
|
+
// resume-state phaseIndex, with status forced to the right coarse bucket.
|
|
36
|
+
export const BUG_PHASE_PRE_STATUS = {
|
|
37
|
+
triage: "reported",
|
|
38
|
+
"plan-fix": "in-progress",
|
|
39
|
+
"review-plan": "in-progress",
|
|
40
|
+
implement: "in-progress",
|
|
41
|
+
"review-code": "in-progress",
|
|
42
|
+
approve: "in-progress",
|
|
43
|
+
commit: "in-progress",
|
|
44
|
+
};
|
|
45
|
+
/** Index of a bug phase in the BUG_PHASES table by role, or -1 if unknown. */
|
|
46
|
+
export function bugPhaseIndexByRole(role) {
|
|
47
|
+
return BUG_PHASES.findIndex((p) => p.role === role);
|
|
48
|
+
}
|
|
49
|
+
// ── Bug-event type tokens ──────────────────────────────────────────────────
|
|
50
|
+
// Explicit mapping per review finding #3. Non-review phases always emit the
|
|
51
|
+
// pass token. Review phases select pass or fail based on ec.judgement.verdict.
|
|
52
|
+
// The event-vocabulary contract test scans this literal block here.
|
|
53
|
+
export const BUG_TYPE_TOKENS = {
|
|
54
|
+
triage: { pass: "bug-triaged", fail: "bug-triaged" },
|
|
55
|
+
"plan-fix": { pass: "fix-planned", fail: "fix-planned" },
|
|
56
|
+
"review-plan": { pass: "fix-review-passed", fail: "fix-review-failed" },
|
|
57
|
+
implement: { pass: "fix-implemented", fail: "fix-implemented" },
|
|
58
|
+
"review-code": { pass: "fix-code-review-passed", fail: "fix-code-review-failed" },
|
|
59
|
+
approve: { pass: "fix-approved", fail: "fix-revision-requested" },
|
|
60
|
+
commit: { pass: "bug-committed", fail: "bug-commit-failed" },
|
|
61
|
+
};
|
|
62
|
+
// ── Bug FSM transitions ────────────────────────────────────────────────────
|
|
63
|
+
// Mirrors store-cli BUG_TRANSITIONS. Terminal: `fixed`.
|
|
64
|
+
// `approved` and `verified` enum values were dropped in forge v0.44.0
|
|
65
|
+
// (FORGE-BUG-002 trap). The canonical source is store-cli.cjs.
|
|
66
|
+
export const BUG_TERMINAL_STATES = new Set(["fixed"]);
|
|
67
|
+
// Post-triage status transitions the ORCHESTRATOR owns (meta-fix-bug.md
|
|
68
|
+
// step 2: "On return, orchestrator transitions status: triaged then
|
|
69
|
+
// in-progress" — a required two-step state-machine contract; the FSM
|
|
70
|
+
// forbids the one-step reported → in-progress jump). First live firing of
|
|
71
|
+
// commit-task.cjs exposed this as unimplemented: bugs reached the commit
|
|
72
|
+
// phase still 'reported' and the terminal-status guard fired every run.
|
|
73
|
+
// Returns the ordered list of statuses to write from the given status —
|
|
74
|
+
// idempotent on resume (already in-progress / terminal → no-op).
|
|
75
|
+
export function postTriageTransitions(status) {
|
|
76
|
+
if (status === "reported")
|
|
77
|
+
return ["triaged", "in-progress"];
|
|
78
|
+
if (status === "triaged")
|
|
79
|
+
return ["in-progress"];
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=bug-phases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug-phases.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/bug/bug-phases.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAI7E,+EAA+E;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AAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEtD,wEAAwE;AACxE,oEAAoE;AACpE,qEAAqE;AACrE,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,wEAAwE;AACxE,iEAAiE;AACjE,MAAM,UAAU,qBAAqB,CAAC,MAA0B;IAC/D,IAAI,MAAM,KAAK,UAAU;QAAE,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC7D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface RunBugState {
|
|
2
|
+
bugId: string;
|
|
3
|
+
phaseIndex: number;
|
|
4
|
+
iterationCounts: Record<string, number>;
|
|
5
|
+
halted: boolean;
|
|
6
|
+
/** Set on cancellation so the resume prompt says "cancelled" vs "halted". */
|
|
7
|
+
status?: "cancelled" | "halted" | "running";
|
|
8
|
+
lastError?: string;
|
|
9
|
+
savedAt: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function readBugState(cwd: string, bugId: string, sessionId?: string): RunBugState | null;
|
|
12
|
+
export declare function writeBugState(cwd: string, state: RunBugState): void;
|
|
13
|
+
export declare function deleteBugState(cwd: string, bugId: string): void;
|
|
14
|
+
export declare function isBugStateStale(state: RunBugState): boolean;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// bug-state.ts — bug-pipeline state persistence (RunBugState + the cache-file
|
|
2
|
+
// read/write/delete/stale helpers). Extracted VERBATIM from fix-bug.ts
|
|
3
|
+
// (FORGE-S31 file-size refactor); no logic changes.
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { validateId } from "../common/orchestrator-misc.js";
|
|
7
|
+
function bugStateFilePath(cwd, bugId, sessionId) {
|
|
8
|
+
if (!validateId(bugId)) {
|
|
9
|
+
throw new Error(`Invalid bugId for state file path: ${bugId}`);
|
|
10
|
+
}
|
|
11
|
+
const suffix = sessionId ?? process.env.FORGE_SESSION_ID ?? `${process.pid}`;
|
|
12
|
+
return path.join(cwd, ".forge", "cache", `fix-bug-state-${bugId}-${suffix}.json`);
|
|
13
|
+
}
|
|
14
|
+
export function readBugState(cwd, bugId, sessionId) {
|
|
15
|
+
// If a specific session ID is given, read that file directly.
|
|
16
|
+
if (sessionId || process.env.FORGE_SESSION_ID) {
|
|
17
|
+
const fp = bugStateFilePath(cwd, bugId, sessionId);
|
|
18
|
+
try {
|
|
19
|
+
if (!fs.existsSync(fp))
|
|
20
|
+
return null;
|
|
21
|
+
const raw = fs.readFileSync(fp, "utf8");
|
|
22
|
+
return JSON.parse(raw);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// No specific session — glob for the most recent matching state file.
|
|
29
|
+
// Single-writer assumption: normally only one session per bug.
|
|
30
|
+
const cacheDir = path.join(cwd, ".forge", "cache");
|
|
31
|
+
const prefix = `fix-bug-state-${bugId}-`;
|
|
32
|
+
let bestFile = null;
|
|
33
|
+
let bestMtime = 0;
|
|
34
|
+
try {
|
|
35
|
+
const entries = fs.readdirSync(cacheDir);
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
if (!entry.startsWith(prefix) || !entry.endsWith(".json"))
|
|
38
|
+
continue;
|
|
39
|
+
const fp = path.join(cacheDir, entry);
|
|
40
|
+
try {
|
|
41
|
+
const st = fs.statSync(fp);
|
|
42
|
+
if (st.mtimeMs > bestMtime) {
|
|
43
|
+
bestMtime = st.mtimeMs;
|
|
44
|
+
bestFile = fp;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch { }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
if (!bestFile)
|
|
54
|
+
return null;
|
|
55
|
+
try {
|
|
56
|
+
const raw = fs.readFileSync(bestFile, "utf8");
|
|
57
|
+
return JSON.parse(raw);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function writeBugState(cwd, state) {
|
|
64
|
+
// Guard: never write state for PENDING bugIds — wait for real bugId capture.
|
|
65
|
+
if (state.bugId.startsWith("PENDING-"))
|
|
66
|
+
return;
|
|
67
|
+
const fp = bugStateFilePath(cwd, state.bugId);
|
|
68
|
+
const dir = path.dirname(fp);
|
|
69
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
70
|
+
fs.writeFileSync(fp, JSON.stringify(state, null, 2), "utf8");
|
|
71
|
+
}
|
|
72
|
+
export function deleteBugState(cwd, bugId) {
|
|
73
|
+
// Clean up all state files for this bug (all sessions)
|
|
74
|
+
const cacheDir = path.join(cwd, ".forge", "cache");
|
|
75
|
+
const statePrefix = `fix-bug-state-${bugId}-`;
|
|
76
|
+
const debugPrefix = `fix-bug-debug-${bugId}`;
|
|
77
|
+
try {
|
|
78
|
+
const entries = fs.readdirSync(cacheDir);
|
|
79
|
+
for (const entry of entries) {
|
|
80
|
+
if ((entry.startsWith(statePrefix) && entry.endsWith(".json")) || entry.startsWith(debugPrefix)) {
|
|
81
|
+
try {
|
|
82
|
+
fs.unlinkSync(path.join(cacheDir, entry));
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
/* non-fatal */
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// non-fatal
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export function isBugStateStale(state) {
|
|
95
|
+
const savedAt = new Date(state.savedAt).getTime();
|
|
96
|
+
const ageMs = Date.now() - savedAt;
|
|
97
|
+
const sevenDaysMs = 7 * 24 * 60 * 60 * 1000;
|
|
98
|
+
return ageMs > sevenDaysMs;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=bug-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug-state.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/bug/bug-state.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uEAAuE;AACvE,oDAAoD;AAEpD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAe5D,SAAS,gBAAgB,CAAC,GAAW,EAAE,KAAa,EAAE,SAAkB;IACvE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC7E,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,IAAI,MAAM,OAAO,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,KAAa,EAAE,SAAkB;IAC1E,8DAA8D;IAC9D,IAAI,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC/C,MAAM,EAAE,GAAG,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC;YACJ,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;gBAAE,OAAO,IAAI,CAAC;YACpC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;QACvC,CAAC;QAA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AC;oBACR,eAAe;gBAChB,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,YAAY;IACb,CAAC;AACF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAkB;IACjD,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;IACnC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,OAAO,KAAK,GAAG,WAAW,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { PhaseDescriptor } from "../run-task.js";
|
|
3
|
+
import type { BugRecord } from "./bug-id.js";
|
|
4
|
+
import type { RunBugPipelineResult } from "./run-bug-types.js";
|
|
5
|
+
export interface MaybeSkipParams {
|
|
6
|
+
phase: PhaseDescriptor;
|
|
7
|
+
bugId: string;
|
|
8
|
+
cwd: string;
|
|
9
|
+
ctx: ExtensionCommandContext;
|
|
10
|
+
storeCli: string;
|
|
11
|
+
/** Bug record read at the top of §6a (same read the caller already did). */
|
|
12
|
+
bugNow: BugRecord | null;
|
|
13
|
+
summaryKeyByRole: Record<string, string | null>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* §6a — decide whether the current phase should be skipped because the bug is
|
|
17
|
+
* already in a done state. When skipping, writes a synthetic summary so
|
|
18
|
+
* downstream `after <phase>` verdict checks succeed. Returns true when the
|
|
19
|
+
* caller should `currentPhaseIndex++; continue;`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function maybeSkipPhase(p: MaybeSkipParams): boolean;
|
|
22
|
+
export interface CaptureTriageBugIdParams {
|
|
23
|
+
bugId: string;
|
|
24
|
+
cwd: string;
|
|
25
|
+
ctx: ExtensionCommandContext;
|
|
26
|
+
storeCli: string;
|
|
27
|
+
currentPhaseIndex: number;
|
|
28
|
+
iterationCounts: Record<string, number>;
|
|
29
|
+
debugLogDisabled: boolean;
|
|
30
|
+
toolExecutionEvents: Array<{
|
|
31
|
+
toolName?: string;
|
|
32
|
+
result?: unknown;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export type CaptureTriageBugIdOutcome = {
|
|
36
|
+
kind: "return";
|
|
37
|
+
result: RunBugPipelineResult;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "ok";
|
|
40
|
+
bugId: string;
|
|
41
|
+
debugLogPath: string | null;
|
|
42
|
+
writeDebug: (rec: Record<string, unknown>) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Post-triage bugId capture: for new bugs the triage subagent creates the bug
|
|
46
|
+
* record via store-cli; capture the real id by scanning tool_execution_end
|
|
47
|
+
* events, with a list-and-filter fallback. On success re-initializes the debug
|
|
48
|
+
* log under the real id and returns the updated locals. Preserves the PENDING-
|
|
49
|
+
* nuance: the orchestrator transcript writer keeps the PENDING entityId — this
|
|
50
|
+
* only updates the loop's local bugId.
|
|
51
|
+
*/
|
|
52
|
+
export declare function captureTriageBugId(p: CaptureTriageBugIdParams, writeDebug: (rec: Record<string, unknown>) => void, debugLogPath: string | null): CaptureTriageBugIdOutcome;
|
|
53
|
+
export interface RouteAfterTriageParams {
|
|
54
|
+
bugId: string;
|
|
55
|
+
cwd: string;
|
|
56
|
+
ctx: ExtensionCommandContext;
|
|
57
|
+
storeCli: string;
|
|
58
|
+
currentPhaseIndex: number;
|
|
59
|
+
}
|
|
60
|
+
export type RouteAfterTriageOutcome = {
|
|
61
|
+
kind: "jump";
|
|
62
|
+
toIndex: number;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "advance";
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* §6c — orchestrator-owned post-triage status transitions, then the Path A/B
|
|
68
|
+
* branch read from bug.summaries.triage.route. Path A skips plan-fix +
|
|
69
|
+
* review-plan (jumps to implement); Path B / missing / any other value advances
|
|
70
|
+
* normally.
|
|
71
|
+
*/
|
|
72
|
+
export declare function routeAfterTriage(p: RouteAfterTriageParams): RouteAfterTriageOutcome;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// bug-triage-routing.ts — bug-specific control flow extracted VERBATIM from
|
|
2
|
+
// fix-bug.ts's phase loop (FORGE-S31 file-size refactor). Two self-contained
|
|
3
|
+
// blocks, each a pure-ish helper the pipeline switches on:
|
|
4
|
+
//
|
|
5
|
+
// 1. maybeSkipPhase — the state-aware phase-skip heuristic (§6a): skip a
|
|
6
|
+
// non-review phase whose output is already reflected in the bug status,
|
|
7
|
+
// writing a synthetic summary so downstream predecessor-verdict checks pass.
|
|
8
|
+
// 2. captureTriageBugId — post-triage bugId capture (§ bugId capture): read the
|
|
9
|
+
// real FORGE-BUG-NNN from triage events, fall back to a list-and-filter,
|
|
10
|
+
// then re-initialize the debug log under the real id. Preserves the
|
|
11
|
+
// PENDING- nuance exactly — the transcript writer keeps the PENDING entityId.
|
|
12
|
+
// 3. routeAfterTriage — the orchestrator-owned post-triage status transitions
|
|
13
|
+
// (§6c) followed by the Path A/B branch read from bug.summaries.triage.route.
|
|
14
|
+
// The source-introspection contract test scans the `postTriageTransitions`
|
|
15
|
+
// wiring here.
|
|
16
|
+
//
|
|
17
|
+
// No logic changes; the inline `continue` / `return` paths are surfaced as small
|
|
18
|
+
// discriminated results.
|
|
19
|
+
import { spawnSync } from "node:child_process";
|
|
20
|
+
import * as fs from "node:fs";
|
|
21
|
+
import * as path from "node:path";
|
|
22
|
+
import { loadGovernorProjectConfig } from "../../governor-config.js";
|
|
23
|
+
import { BUG_PHASES, postTriageTransitions } from "./bug-phases.js";
|
|
24
|
+
import { extractBugIdFromEvents, readBugRecord } from "./bug-id.js";
|
|
25
|
+
// ── 6a. Phase skip (state-aware, defense-in-depth) ─────────────
|
|
26
|
+
// Belt-and-suspenders alongside the explicit summaries.triage.route
|
|
27
|
+
// branch (handled in routeAfterTriage below). Some subagents in some
|
|
28
|
+
// runtimes still go end-to-end during triage instead of just triaging
|
|
29
|
+
// — rather than roll back the work they did, skip non-review phases
|
|
30
|
+
// whose output is already reflected in the bug status. Review phases
|
|
31
|
+
// are never skipped — they are quality gates that must always run.
|
|
32
|
+
//
|
|
33
|
+
// Post-v0.44.0: terminal status is `fixed` only. `approved` and
|
|
34
|
+
// `verified` are no longer valid bug status values; references removed.
|
|
35
|
+
const PHASE_SKIP_STATES = {
|
|
36
|
+
"plan-fix": new Set(["fixed"]),
|
|
37
|
+
implement: new Set(["fixed"]),
|
|
38
|
+
commit: new Set(["fixed"]), // commit writes the terminal status; skip if already there
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* §6a — decide whether the current phase should be skipped because the bug is
|
|
42
|
+
* already in a done state. When skipping, writes a synthetic summary so
|
|
43
|
+
* downstream `after <phase>` verdict checks succeed. Returns true when the
|
|
44
|
+
* caller should `currentPhaseIndex++; continue;`.
|
|
45
|
+
*/
|
|
46
|
+
export function maybeSkipPhase(p) {
|
|
47
|
+
const { phase, bugId, cwd, ctx, storeCli, bugNow, summaryKeyByRole } = p;
|
|
48
|
+
const skipStates = PHASE_SKIP_STATES[phase.role];
|
|
49
|
+
if (!(skipStates && bugNow?.status && skipStates.has(bugNow.status) && !phase.isReview)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
ctx.ui.notify(`⊘ forge:fix-bug — skipping ${phase.role}: bug ${bugId} is already '${bugNow.status}' (work already done).`, "info");
|
|
53
|
+
// Write a synthetic "approved" summary so downstream `after` predecessor
|
|
54
|
+
// verdict checks find a verdict and don't block review phases.
|
|
55
|
+
const summaryKey = summaryKeyByRole[phase.role];
|
|
56
|
+
if (summaryKey) {
|
|
57
|
+
const synthSummary = {
|
|
58
|
+
objective: `Phase ${phase.role} skipped — bug already ${bugNow.status}`,
|
|
59
|
+
findings: ["Subagent completed fix during triage (Path A); phase output implicitly satisfied."],
|
|
60
|
+
// Non-review phases should have verdict "n/a" — the phase
|
|
61
|
+
// didn't produce a gate verdict. This matches the `after
|
|
62
|
+
// <phase> = n/a` preflight gate contract. Review phases
|
|
63
|
+
// use "approved" since they are gate phases.
|
|
64
|
+
verdict: phase.isReview ? "approved" : "n/a",
|
|
65
|
+
written_at: new Date().toISOString(),
|
|
66
|
+
};
|
|
67
|
+
const synthFile = path.join(cwd, ".forge", "cache", `synthetic-summary-${bugId}-${summaryKey}.json`);
|
|
68
|
+
fs.writeFileSync(synthFile, JSON.stringify(synthSummary, null, 2), "utf8");
|
|
69
|
+
const synthResult = spawnSync("node", [storeCli, "set-bug-summary", bugId, summaryKey, synthFile], {
|
|
70
|
+
cwd,
|
|
71
|
+
encoding: "utf8",
|
|
72
|
+
});
|
|
73
|
+
if (synthResult.status !== 0) {
|
|
74
|
+
ctx.ui.notify(`⚠ forge:fix-bug — synthetic summary write failed for ${phase.role}: ${String(synthResult.stderr).trim()}`, "warning");
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
fs.unlinkSync(synthFile);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* non-fatal */
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Post-triage bugId capture: for new bugs the triage subagent creates the bug
|
|
87
|
+
* record via store-cli; capture the real id by scanning tool_execution_end
|
|
88
|
+
* events, with a list-and-filter fallback. On success re-initializes the debug
|
|
89
|
+
* log under the real id and returns the updated locals. Preserves the PENDING-
|
|
90
|
+
* nuance: the orchestrator transcript writer keeps the PENDING entityId — this
|
|
91
|
+
* only updates the loop's local bugId.
|
|
92
|
+
*/
|
|
93
|
+
export function captureTriageBugId(p, writeDebug, debugLogPath) {
|
|
94
|
+
const { cwd, ctx, storeCli, currentPhaseIndex, iterationCounts, debugLogDisabled, toolExecutionEvents } = p;
|
|
95
|
+
let bugId = p.bugId;
|
|
96
|
+
const capturedBugId = extractBugIdFromEvents(toolExecutionEvents, loadGovernorProjectConfig(cwd).prefix);
|
|
97
|
+
if (capturedBugId) {
|
|
98
|
+
ctx.ui.notify(`forge:fix-bug — captured bug ID: ${capturedBugId}`, "info");
|
|
99
|
+
bugId = capturedBugId;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// Fallback: list bugs and find the most recent one created after pipeline start.
|
|
103
|
+
const listResult = spawnSync("node", [storeCli, "list", "bug", "--json"], { cwd, encoding: "utf8" });
|
|
104
|
+
if (listResult.status === 0 && listResult.stdout) {
|
|
105
|
+
try {
|
|
106
|
+
const bugs = JSON.parse(listResult.stdout);
|
|
107
|
+
if (Array.isArray(bugs)) {
|
|
108
|
+
// Find most recent bug whose reportedAt is after the pipeline start
|
|
109
|
+
const pipelineStartIso = new Date(parseInt(bugId.replace("PENDING-", ""))).toISOString();
|
|
110
|
+
const recent = bugs
|
|
111
|
+
.filter((b) => b.reportedAt && b.reportedAt >= pipelineStartIso)
|
|
112
|
+
.sort((a, b) => String(b.reportedAt).localeCompare(String(a.reportedAt)))[0];
|
|
113
|
+
if (recent &&
|
|
114
|
+
recent.bugId &&
|
|
115
|
+
typeof recent.bugId === "string" &&
|
|
116
|
+
recent.bugId.startsWith("FORGE-BUG-")) {
|
|
117
|
+
bugId = recent.bugId;
|
|
118
|
+
ctx.ui.notify(`forge:fix-bug — captured bug ID via store fallback: ${bugId}`, "info");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
/* parse failure — fall through to assertion */
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Defensive guard: if bugId is still PENDING after triage, pipeline cannot proceed.
|
|
128
|
+
if (bugId.startsWith("PENDING-")) {
|
|
129
|
+
ctx.ui.notify("× forge:fix-bug — failed to capture real bug ID after triage. Cannot proceed with PENDING placeholder.", "error");
|
|
130
|
+
return {
|
|
131
|
+
kind: "return",
|
|
132
|
+
result: {
|
|
133
|
+
status: "failed",
|
|
134
|
+
lastPhaseIndex: currentPhaseIndex,
|
|
135
|
+
iterationCounts,
|
|
136
|
+
lastError: "bugId still PENDING after triage",
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// Re-initialize debug log now that real bugId is available.
|
|
141
|
+
if (!debugLogDisabled) {
|
|
142
|
+
debugLogPath = path.join(cwd, ".forge", "cache", `fix-bug-debug-${bugId}.jsonl`);
|
|
143
|
+
const capturedPath = debugLogPath;
|
|
144
|
+
writeDebug = (rec) => {
|
|
145
|
+
try {
|
|
146
|
+
fs.mkdirSync(path.dirname(capturedPath), { recursive: true });
|
|
147
|
+
try {
|
|
148
|
+
const st = fs.statSync(capturedPath);
|
|
149
|
+
if (st.size > 10 * 1024 * 1024) {
|
|
150
|
+
const all = fs.readFileSync(capturedPath, "utf8");
|
|
151
|
+
const lines = all.split("\n");
|
|
152
|
+
const keep = Math.floor(lines.length * 0.8);
|
|
153
|
+
fs.writeFileSync(capturedPath, lines.slice(-keep).join("\n"), "utf8");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
/* file may not exist yet */
|
|
158
|
+
}
|
|
159
|
+
fs.appendFileSync(capturedPath, `${JSON.stringify({ ts: new Date().toISOString(), phase: "triage", ...rec })}\n`, "utf8");
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
// non-fatal
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
writeDebug({ kind: "bugid_captured", bugId });
|
|
166
|
+
}
|
|
167
|
+
return { kind: "ok", bugId, debugLogPath, writeDebug };
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* §6c — orchestrator-owned post-triage status transitions, then the Path A/B
|
|
171
|
+
* branch read from bug.summaries.triage.route. Path A skips plan-fix +
|
|
172
|
+
* review-plan (jumps to implement); Path B / missing / any other value advances
|
|
173
|
+
* normally.
|
|
174
|
+
*/
|
|
175
|
+
export function routeAfterTriage(p) {
|
|
176
|
+
const { bugId, cwd, ctx, storeCli, currentPhaseIndex } = p;
|
|
177
|
+
const bugAfterTriage = readBugRecord(bugId, storeCli, cwd);
|
|
178
|
+
// Orchestrator-owned post-triage transitions (meta-fix-bug.md
|
|
179
|
+
// step 2). Two sequential writes through store-cli (the FSM
|
|
180
|
+
// authority); failure warns but does not halt — the commit
|
|
181
|
+
// phase's status guard is the backstop.
|
|
182
|
+
for (const target of postTriageTransitions(bugAfterTriage?.status)) {
|
|
183
|
+
const upd = spawnSync("node", [storeCli, "update-status", "bug", bugId, "status", target], {
|
|
184
|
+
cwd,
|
|
185
|
+
encoding: "utf8",
|
|
186
|
+
});
|
|
187
|
+
if (upd.status !== 0) {
|
|
188
|
+
ctx.ui.notify(`⚠ forge:fix-bug — post-triage transition to '${target}' failed: ${(upd.stderr ?? "").toString().trim()}`, "warning");
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const triageSummary = bugAfterTriage?.summaries?.triage;
|
|
193
|
+
const route = triageSummary?.route;
|
|
194
|
+
if (route === "A") {
|
|
195
|
+
const skipUntilIndex = BUG_PHASES.findIndex((ph) => ph.role === "implement");
|
|
196
|
+
if (skipUntilIndex > currentPhaseIndex + 1) {
|
|
197
|
+
ctx.ui.notify(`⊘ forge:fix-bug — Path A selected by triage; skipping plan-fix and review-plan.`, "info");
|
|
198
|
+
return { kind: "jump", toIndex: skipUntilIndex };
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// route === "B", missing, or any other value → fall through to standard advance
|
|
202
|
+
return { kind: "advance" };
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=bug-triage-routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug-triage-routing.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/bug/bug-triage-routing.ts"],"names":[],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AAK,CAAC;IACnC,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QACnB,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;QAC7E,IAAI,cAAc,GAAG,iBAAiB,GAAG,CAAC,EAAE,CAAC;YAC5C,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,iFAAiF,EAAE,MAAM,CAAC,CAAC;YACzG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;QAClD,CAAC;IACF,CAAC;IACD,gFAAgF;IAChF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { MergedConfig } from "../../config/config-layer.js";
|
|
3
|
+
import type { OrchestratorTranscriptWriter } from "../../subagent/orchestrator-transcript.js";
|
|
4
|
+
import { type PhaseDescriptor } from "../run-task.js";
|
|
5
|
+
import type { RunBugPipelineResult } from "./run-bug-types.js";
|
|
6
|
+
export type BugVerdictLoopOutcome = {
|
|
7
|
+
kind: "advance";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "loopback";
|
|
10
|
+
toIndex: number;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "return";
|
|
13
|
+
result: RunBugPipelineResult;
|
|
14
|
+
};
|
|
15
|
+
export interface BugVerdictLoopParams {
|
|
16
|
+
phase: PhaseDescriptor;
|
|
17
|
+
bugId: string;
|
|
18
|
+
storeCli: string;
|
|
19
|
+
cwd: string;
|
|
20
|
+
forgeRoot: string;
|
|
21
|
+
iterationCounts: Record<string, number>;
|
|
22
|
+
currentPhaseIndex: number;
|
|
23
|
+
modelRoutingConfig: MergedConfig;
|
|
24
|
+
ctx: ExtensionCommandContext;
|
|
25
|
+
orchTranscript: OrchestratorTranscriptWriter;
|
|
26
|
+
/** Per-role phase-summary key map (BUG_SUMMARY_KEY_BY_ROLE). */
|
|
27
|
+
summaryKeyByRole: Record<string, string | null>;
|
|
28
|
+
/** Closure that finalizes this dispatch's OrchestratorTree node. */
|
|
29
|
+
finishPhaseNode: (status: "completed" | "failed" | "escalated") => void;
|
|
30
|
+
/** Per-phase completion-recovery guard (forge-engineering#41) — roles that
|
|
31
|
+
* already consumed their one set-bug-summary recovery attempt this run. */
|
|
32
|
+
recoveredPhases: Set<string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Evaluate the review-phase verdict and decide the loop's next move.
|
|
36
|
+
* Mirrors the inline block that previously lived in runBugPipelineInner.
|
|
37
|
+
*/
|
|
38
|
+
export declare function handleBugReviewVerdict(p: BugVerdictLoopParams): Promise<BugVerdictLoopOutcome>;
|