@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 @@
|
|
|
1
|
+
{"version":3,"file":"task-body.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/task/task-body.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,yEAAyE;AACzE,0CAA0C;AAI1C,6EAA6E;AAE7E,MAAM,UAAU,oBAAoB,CAAC,MAAyB,EAAE,WAAmB;IAClF,KAAK,IAAI,CAAC,GAAG,WAAW,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ;YAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC;AAYD,+DAA+D;AAC/D,MAAM,WAAW,GAAsB,CAAC,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAE9G,MAAM,UAAU,mBAAmB,CAAC,SAA8C;IACjF,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,SAAS;QAC9C,MAAM,CAAC,GAAG,GAAmB,CAAC;QAC9B,MAAM,KAAK,GAAa,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,CAAC,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClF,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,CAAC,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;QACnE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,CAAC,0CAA0C,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,aAAqB,EAAE,MAAc,EAAE,cAAuB;IAC7F,MAAM,KAAK,GAAG,CAAC,mDAAmD,MAAM,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5F,IAAI,cAAc,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACjC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type PhaseDescriptor } from "./task-phases.js";
|
|
2
|
+
import type { TaskRecord } from "./task-record.js";
|
|
3
|
+
export declare function actionForRole(role: string): string;
|
|
4
|
+
export interface OrchestratorEmitContext {
|
|
5
|
+
/** Entity identifier — required when entityType is "task". */
|
|
6
|
+
taskId?: string;
|
|
7
|
+
/** Entity identifier — required when entityType is "bug". */
|
|
8
|
+
bugId?: string;
|
|
9
|
+
/** Discriminator for entity-keyed event construction. */
|
|
10
|
+
entityType: "task" | "bug";
|
|
11
|
+
sprintId: string;
|
|
12
|
+
phase: PhaseDescriptor;
|
|
13
|
+
iteration: number;
|
|
14
|
+
startMs: number;
|
|
15
|
+
endMs: number;
|
|
16
|
+
model: string;
|
|
17
|
+
provider: string;
|
|
18
|
+
usage: {
|
|
19
|
+
input: number;
|
|
20
|
+
output: number;
|
|
21
|
+
cacheRead: number;
|
|
22
|
+
cacheWrite: number;
|
|
23
|
+
};
|
|
24
|
+
judgement: Record<string, unknown> | undefined;
|
|
25
|
+
storeCli: string;
|
|
26
|
+
cwd: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function isoCompact(ms: number): string;
|
|
29
|
+
export declare function buildPhaseEvent(ec: OrchestratorEmitContext): Record<string, unknown>;
|
|
30
|
+
export declare function emitEvent(storeCli: string, cwd: string, sprintId: string, event: Record<string, unknown>): {
|
|
31
|
+
ok: boolean;
|
|
32
|
+
stderr: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Emit a phase event for an INCOMPLETE attempt (cancelled / failed) so its
|
|
36
|
+
* provider-billed tokens reach the store. Bug B: the cancel and halt-on-failure
|
|
37
|
+
* branches used to return without emitting, so collate's COST_REPORT
|
|
38
|
+
* under-counted real spend by exactly the aborted passes (CART-S02-T03
|
|
39
|
+
* baseline: 259,950 tokens across two aborted plan attempts, invisible).
|
|
40
|
+
*
|
|
41
|
+
* The event is the canonical phase event (schema-unchanged) with
|
|
42
|
+
* `verdict: "aborted" | "failed"` marking the outcome.
|
|
43
|
+
*
|
|
44
|
+
* Zero-token attempts are skipped — there is no spend to account, and a
|
|
45
|
+
* token-less event would be flagged as a husk by collate's ingestion-quality
|
|
46
|
+
* pass. Never throws: emission must not perturb the cancel/halt return paths.
|
|
47
|
+
*
|
|
48
|
+
* @param opts.decorate Optional event mutation hook applied before emit
|
|
49
|
+
* (fix-bug uses it for the BUG_TYPE_TOKENS `type` field).
|
|
50
|
+
* @returns true when the event was emitted and store-cli accepted it.
|
|
51
|
+
*/
|
|
52
|
+
export declare function emitIncompletePhaseEvent(opts: {
|
|
53
|
+
emitCtx: OrchestratorEmitContext;
|
|
54
|
+
outcome: "aborted" | "failed";
|
|
55
|
+
notes?: string;
|
|
56
|
+
decorate?: (event: Record<string, unknown>) => void;
|
|
57
|
+
onDebug?: (rec: Record<string, unknown>) => void;
|
|
58
|
+
}): boolean;
|
|
59
|
+
export declare function judgementFromSummary(record: TaskRecord | null, phaseRole: string, summaryKeyByRole?: Record<string, string | null>): Record<string, unknown> | undefined;
|
|
60
|
+
export declare function drainFrictionFile(frictionPath: string, ec: OrchestratorEmitContext): {
|
|
61
|
+
emitted: number;
|
|
62
|
+
failed: number;
|
|
63
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// task-events.ts — orchestrator event composition + emission helpers.
|
|
2
|
+
// Extracted from run-task.ts (no logic changes). run-task.ts re-exports these.
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { SUMMARY_KEY_BY_ROLE } from "./task-phases.js";
|
|
6
|
+
// Map phase.role → action token used in event.action / eventId.
|
|
7
|
+
export function actionForRole(role) {
|
|
8
|
+
return role.replace(/-/g, "_");
|
|
9
|
+
}
|
|
10
|
+
export function isoCompact(ms) {
|
|
11
|
+
return new Date(ms)
|
|
12
|
+
.toISOString()
|
|
13
|
+
.replace(/[-:]/g, "")
|
|
14
|
+
.replace(/\.\d{3}Z$/, "Z");
|
|
15
|
+
}
|
|
16
|
+
export function buildPhaseEvent(ec) {
|
|
17
|
+
const action = actionForRole(ec.phase.role);
|
|
18
|
+
const entityId = ec.entityType === "bug" ? ec.bugId : ec.taskId;
|
|
19
|
+
const eventId = `${isoCompact(ec.startMs)}_${entityId}_${ec.phase.personaNoun}_${action}`;
|
|
20
|
+
const durationMs = Math.max(0, ec.endMs - ec.startMs);
|
|
21
|
+
const event = {
|
|
22
|
+
eventId,
|
|
23
|
+
sprintId: ec.sprintId,
|
|
24
|
+
role: ec.phase.role,
|
|
25
|
+
action: `/forge:${action.replace(/_/g, "-")}`,
|
|
26
|
+
phase: ec.phase.role,
|
|
27
|
+
iteration: ec.iteration,
|
|
28
|
+
startTimestamp: new Date(ec.startMs).toISOString(),
|
|
29
|
+
endTimestamp: new Date(ec.endMs).toISOString(),
|
|
30
|
+
durationMinutes: Math.round((durationMs / 60000) * 100) / 100,
|
|
31
|
+
model: ec.model,
|
|
32
|
+
provider: ec.provider,
|
|
33
|
+
};
|
|
34
|
+
if (ec.entityType === "bug") {
|
|
35
|
+
event.bugId = ec.bugId;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
event.taskId = ec.taskId;
|
|
39
|
+
}
|
|
40
|
+
if (ec.usage.input > 0 || ec.usage.output > 0 || ec.usage.cacheRead > 0 || ec.usage.cacheWrite > 0) {
|
|
41
|
+
event.inputTokens = ec.usage.input;
|
|
42
|
+
event.outputTokens = ec.usage.output;
|
|
43
|
+
event.cacheReadTokens = ec.usage.cacheRead;
|
|
44
|
+
event.cacheWriteTokens = ec.usage.cacheWrite;
|
|
45
|
+
event.tokenSource = "reported";
|
|
46
|
+
}
|
|
47
|
+
if (ec.judgement && typeof ec.judgement === "object") {
|
|
48
|
+
const j = ec.judgement;
|
|
49
|
+
if (typeof j.verdict === "string")
|
|
50
|
+
event.verdict = j.verdict;
|
|
51
|
+
if (typeof j.notes === "string")
|
|
52
|
+
event.notes = j.notes;
|
|
53
|
+
}
|
|
54
|
+
return event;
|
|
55
|
+
}
|
|
56
|
+
export function emitEvent(storeCli, cwd, sprintId, event) {
|
|
57
|
+
const result = spawnSync("node", [storeCli, "emit", sprintId, JSON.stringify(event)], {
|
|
58
|
+
cwd,
|
|
59
|
+
encoding: "utf8",
|
|
60
|
+
});
|
|
61
|
+
return { ok: result.status === 0, stderr: typeof result.stderr === "string" ? result.stderr : "" };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Emit a phase event for an INCOMPLETE attempt (cancelled / failed) so its
|
|
65
|
+
* provider-billed tokens reach the store. Bug B: the cancel and halt-on-failure
|
|
66
|
+
* branches used to return without emitting, so collate's COST_REPORT
|
|
67
|
+
* under-counted real spend by exactly the aborted passes (CART-S02-T03
|
|
68
|
+
* baseline: 259,950 tokens across two aborted plan attempts, invisible).
|
|
69
|
+
*
|
|
70
|
+
* The event is the canonical phase event (schema-unchanged) with
|
|
71
|
+
* `verdict: "aborted" | "failed"` marking the outcome.
|
|
72
|
+
*
|
|
73
|
+
* Zero-token attempts are skipped — there is no spend to account, and a
|
|
74
|
+
* token-less event would be flagged as a husk by collate's ingestion-quality
|
|
75
|
+
* pass. Never throws: emission must not perturb the cancel/halt return paths.
|
|
76
|
+
*
|
|
77
|
+
* @param opts.decorate Optional event mutation hook applied before emit
|
|
78
|
+
* (fix-bug uses it for the BUG_TYPE_TOKENS `type` field).
|
|
79
|
+
* @returns true when the event was emitted and store-cli accepted it.
|
|
80
|
+
*/
|
|
81
|
+
export function emitIncompletePhaseEvent(opts) {
|
|
82
|
+
try {
|
|
83
|
+
const { emitCtx, outcome } = opts;
|
|
84
|
+
const u = emitCtx.usage;
|
|
85
|
+
if (u.input + u.output + u.cacheRead + u.cacheWrite <= 0) {
|
|
86
|
+
opts.onDebug?.({ kind: "incomplete_emit_skipped", reason: "no-tokens", outcome });
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const judgement = { verdict: outcome };
|
|
90
|
+
if (opts.notes)
|
|
91
|
+
judgement.notes = opts.notes;
|
|
92
|
+
const event = buildPhaseEvent({ ...emitCtx, judgement });
|
|
93
|
+
opts.decorate?.(event);
|
|
94
|
+
const res = emitEvent(emitCtx.storeCli, emitCtx.cwd, emitCtx.sprintId, event);
|
|
95
|
+
opts.onDebug?.(res.ok
|
|
96
|
+
? { kind: "incomplete_emit_ok", eventId: event.eventId, outcome }
|
|
97
|
+
: { kind: "incomplete_emit_failed", stderr: res.stderr, outcome });
|
|
98
|
+
return res.ok;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
102
|
+
opts.onDebug?.({ kind: "incomplete_emit_failed", stderr: msg, outcome: opts.outcome });
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export function judgementFromSummary(record, phaseRole, summaryKeyByRole) {
|
|
107
|
+
if (!record || !record.summaries)
|
|
108
|
+
return undefined;
|
|
109
|
+
const keyMap = summaryKeyByRole ?? SUMMARY_KEY_BY_ROLE;
|
|
110
|
+
const summaryKey = keyMap[phaseRole];
|
|
111
|
+
if (!summaryKey)
|
|
112
|
+
return undefined;
|
|
113
|
+
const blob = record.summaries[summaryKey];
|
|
114
|
+
return blob && typeof blob === "object" ? blob : undefined;
|
|
115
|
+
}
|
|
116
|
+
// Drain .forge/cache/FRICTION-{phase}.jsonl: stamp each judgement-only record
|
|
117
|
+
// with the subagent's runtime attribution and emit as event type "friction".
|
|
118
|
+
// Truncate only after all emits succeed (Plan-11 open-question A.3).
|
|
119
|
+
export function drainFrictionFile(frictionPath, ec) {
|
|
120
|
+
if (!fs.existsSync(frictionPath))
|
|
121
|
+
return { emitted: 0, failed: 0 };
|
|
122
|
+
const raw = fs.readFileSync(frictionPath, "utf8");
|
|
123
|
+
const lines = raw.split("\n").filter((l) => l.trim().length > 0);
|
|
124
|
+
if (lines.length === 0)
|
|
125
|
+
return { emitted: 0, failed: 0 };
|
|
126
|
+
let emitted = 0;
|
|
127
|
+
let failed = 0;
|
|
128
|
+
for (let i = 0; i < lines.length; i++) {
|
|
129
|
+
let judgement;
|
|
130
|
+
try {
|
|
131
|
+
judgement = JSON.parse(lines[i]);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
failed++;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const action = actionForRole(ec.phase.role);
|
|
138
|
+
const entityId = ec.entityType === "bug" ? ec.bugId : ec.taskId;
|
|
139
|
+
const eventId = `${isoCompact(ec.startMs)}_${entityId}_${ec.phase.personaNoun}_friction_${i}`;
|
|
140
|
+
const event = {
|
|
141
|
+
eventId,
|
|
142
|
+
sprintId: ec.sprintId,
|
|
143
|
+
role: ec.phase.role,
|
|
144
|
+
action: `/forge:${action.replace(/_/g, "-")}`,
|
|
145
|
+
phase: ec.phase.role,
|
|
146
|
+
iteration: ec.iteration,
|
|
147
|
+
startTimestamp: new Date(ec.startMs).toISOString(),
|
|
148
|
+
endTimestamp: new Date(ec.endMs).toISOString(),
|
|
149
|
+
durationMinutes: Math.round(((ec.endMs - ec.startMs) / 60000) * 100) / 100,
|
|
150
|
+
model: ec.model,
|
|
151
|
+
provider: ec.provider,
|
|
152
|
+
type: "friction",
|
|
153
|
+
workflow: typeof judgement.workflow === "string" ? judgement.workflow : ec.phase.role,
|
|
154
|
+
persona: typeof judgement.persona === "string" ? judgement.persona : ec.phase.personaNoun,
|
|
155
|
+
issue: judgement.issue,
|
|
156
|
+
};
|
|
157
|
+
if (ec.entityType === "bug") {
|
|
158
|
+
event.bugId = ec.bugId;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
event.taskId = ec.taskId;
|
|
162
|
+
}
|
|
163
|
+
if (judgement.subkind !== undefined)
|
|
164
|
+
event.subkind = judgement.subkind;
|
|
165
|
+
if (judgement.evidence !== undefined)
|
|
166
|
+
event.evidence = judgement.evidence;
|
|
167
|
+
if (judgement.notes !== undefined)
|
|
168
|
+
event.notes = judgement.notes;
|
|
169
|
+
const r = emitEvent(ec.storeCli, ec.cwd, ec.sprintId, event);
|
|
170
|
+
if (r.ok)
|
|
171
|
+
emitted++;
|
|
172
|
+
else
|
|
173
|
+
failed++;
|
|
174
|
+
}
|
|
175
|
+
if (failed === 0) {
|
|
176
|
+
try {
|
|
177
|
+
fs.unlinkSync(frictionPath);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
/* non-fatal */
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { emitted, failed };
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=task-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-events.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/task/task-events.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+EAA+E;AAE/E,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAwB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG7E,gEAAgE;AAChE,MAAM,UAAU,aAAa,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC;AA2BD,MAAM,UAAU,UAAU,CAAC,EAAU;IACpC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC;SACjB,WAAW,EAAE;SACb,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;SACpB,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAA2B;IAC1D,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,EAAE,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAO,CAAC;IAClE,MAAM,OAAO,GAAG,GAAG,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,QAAQ,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,IAAI,MAAM,EAA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AAE,CAAC;IACf,CAAC;IAED,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC;YACJ,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACR,eAAe;QAChB,CAAC;IACF,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type PreflightResult = "proceed" | "halt" | "escalate";
|
|
2
|
+
/** Structured gate failure shape emitted by preflight-gate.cjs on stdout (exit 1). */
|
|
3
|
+
export interface GateFailureData {
|
|
4
|
+
phase: string;
|
|
5
|
+
reasonCode: string;
|
|
6
|
+
detail: string;
|
|
7
|
+
remediation: string;
|
|
8
|
+
}
|
|
9
|
+
/** Extended result carrying the structured failure alongside the status enum. */
|
|
10
|
+
export interface PreflightOutcome {
|
|
11
|
+
result: PreflightResult;
|
|
12
|
+
/** Parsed structured failure from stdout, or null on pass / escalate. */
|
|
13
|
+
gateFailure: GateFailureData | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function runPreflightGate(preflightGate: string, role: string, taskId: string, cwd: string, entityType?: "task" | "bug"): PreflightResult;
|
|
16
|
+
/**
|
|
17
|
+
* Run postflight-gate.cjs after a phase subagent returns, before FSM advance.
|
|
18
|
+
* Mirrors runPreflightGateWithData — same argv-array discipline, same structured-JSON
|
|
19
|
+
* parsing from stdout on exit 1.
|
|
20
|
+
*
|
|
21
|
+
* Returns:
|
|
22
|
+
* "ok" — gate passed (or no outputs block for this phase); advance may proceed.
|
|
23
|
+
* "unsatisfied" — gate failed; do NOT advance FSM; halt and call runHaltAdvisor.
|
|
24
|
+
* "error" — gate binary missing or parse error; treat as pass-through (additive).
|
|
25
|
+
*/
|
|
26
|
+
export declare function runPostflightGate(postflightGate: string, role: string, taskId: string, cwd: string): {
|
|
27
|
+
result: "ok" | "unsatisfied" | "error";
|
|
28
|
+
gateFailure: GateFailureData | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Upgraded variant that returns structured failure data alongside the status enum.
|
|
32
|
+
* Callers that need the advisory data should use this function directly.
|
|
33
|
+
*/
|
|
34
|
+
export declare function runPreflightGateWithData(preflightGate: string, role: string, taskId: string, cwd: string, entityType?: "task" | "bug"): PreflightOutcome;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// task-gates.ts — preflight / postflight gate execution helpers.
|
|
2
|
+
// Extracted from run-task.ts (no logic changes). run-task.ts re-exports these.
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
export function runPreflightGate(preflightGate, role, taskId, cwd, entityType) {
|
|
6
|
+
const outcome = runPreflightGateWithData(preflightGate, role, taskId, cwd, entityType);
|
|
7
|
+
return outcome.result;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Run postflight-gate.cjs after a phase subagent returns, before FSM advance.
|
|
11
|
+
* Mirrors runPreflightGateWithData — same argv-array discipline, same structured-JSON
|
|
12
|
+
* parsing from stdout on exit 1.
|
|
13
|
+
*
|
|
14
|
+
* Returns:
|
|
15
|
+
* "ok" — gate passed (or no outputs block for this phase); advance may proceed.
|
|
16
|
+
* "unsatisfied" — gate failed; do NOT advance FSM; halt and call runHaltAdvisor.
|
|
17
|
+
* "error" — gate binary missing or parse error; treat as pass-through (additive).
|
|
18
|
+
*/
|
|
19
|
+
export function runPostflightGate(postflightGate, role, taskId, cwd) {
|
|
20
|
+
if (!fs.existsSync(postflightGate)) {
|
|
21
|
+
// postflight-gate.cjs not present in this forgeRoot — pass through (additive).
|
|
22
|
+
return { result: "ok", gateFailure: null };
|
|
23
|
+
}
|
|
24
|
+
const spawnResult = spawnSync("node", [postflightGate, "--phase", role, "--task", taskId], {
|
|
25
|
+
cwd,
|
|
26
|
+
encoding: "utf8",
|
|
27
|
+
});
|
|
28
|
+
if (spawnResult.status === 0)
|
|
29
|
+
return { result: "ok", gateFailure: null };
|
|
30
|
+
if (spawnResult.status === 2)
|
|
31
|
+
return { result: "error", gateFailure: null };
|
|
32
|
+
// Exit 1: parse structured JSON from stdout
|
|
33
|
+
let gateFailure = null;
|
|
34
|
+
try {
|
|
35
|
+
const stdout = typeof spawnResult.stdout === "string" ? spawnResult.stdout.trim() : "";
|
|
36
|
+
if (stdout) {
|
|
37
|
+
const parsed = JSON.parse(stdout);
|
|
38
|
+
if (parsed && typeof parsed.reasonCode === "string") {
|
|
39
|
+
gateFailure = parsed;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// stdout not valid JSON — gate failure but no structured data
|
|
45
|
+
}
|
|
46
|
+
return { result: "unsatisfied", gateFailure };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Upgraded variant that returns structured failure data alongside the status enum.
|
|
50
|
+
* Callers that need the advisory data should use this function directly.
|
|
51
|
+
*/
|
|
52
|
+
export function runPreflightGateWithData(preflightGate, role, taskId, cwd, entityType) {
|
|
53
|
+
const entityFlag = entityType === "bug" ? "--bug" : "--task";
|
|
54
|
+
const spawnResult = spawnSync("node", [preflightGate, "--phase", role, entityFlag, taskId], {
|
|
55
|
+
cwd,
|
|
56
|
+
encoding: "utf8",
|
|
57
|
+
});
|
|
58
|
+
if (spawnResult.status === 0)
|
|
59
|
+
return { result: "proceed", gateFailure: null };
|
|
60
|
+
if (spawnResult.status === 2)
|
|
61
|
+
return { result: "escalate", gateFailure: null };
|
|
62
|
+
// Exit 1: parse structured JSON from stdout
|
|
63
|
+
let gateFailure = null;
|
|
64
|
+
try {
|
|
65
|
+
const stdout = typeof spawnResult.stdout === "string" ? spawnResult.stdout.trim() : "";
|
|
66
|
+
if (stdout) {
|
|
67
|
+
const parsed = JSON.parse(stdout);
|
|
68
|
+
if (parsed && typeof parsed.reasonCode === "string") {
|
|
69
|
+
gateFailure = parsed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// stdout not valid JSON — gate failure but no structured data
|
|
75
|
+
}
|
|
76
|
+
return { result: "halt", gateFailure };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=task-gates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-gates.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/task/task-gates.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,+EAA+E;AAE/E,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAqB/C,MAAM,UAAU,gBAAgB,CAC/B,aAAqB,EACrB,IAAY,EACZ,MAAc,EACd,GAAW,EACX,UAA2B;IAE3B,MAAM,OAAO,GAAG,wBAAwB,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IACvF,OAAO,OAAO,CAAC,MAAM,CAAC;AACvB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAChC,cAAsB,EACtB,IAAY,EACZ,MAAc,EACd,GAAW;IAEX,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACpC,+EAA+E;QAC/E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC5C,CAAC;IACD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE;QAC1F,GAAG;QACH,QAAQ,EAAE,MAAM;KAChB,CAAC,CAAC;IACH,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IACzE,IAAI,WAAW,CAAC,MAA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AAW,EAAE,IAAI,EAAE,CAAC;IAC/E,4CAA4C;IAC5C,IAAI,WAAW,GAA2B,IAAI,CAAC;IAC/C,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,OAAO,WAAW,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvF,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAoB,CAAC;YACrD,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;gBACrD,WAAW,GAAG,MAAM,CAAC;YACtB,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,8DAA8D;IAC/D,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { MergedConfig } from "../../config/config-layer.js";
|
|
3
|
+
import { type SubagentResult } from "../../forge-subagent.js";
|
|
4
|
+
import { attachViewportObserver } from "../../viewport/events.js";
|
|
5
|
+
import { type PhaseDescriptor } from "./task-phases.js";
|
|
6
|
+
import { type TaskRecord } from "./task-record.js";
|
|
7
|
+
import type { RunTaskPipelineOptions, RunTaskPipelineResult } from "./run-task-types.js";
|
|
8
|
+
export interface PhaseDispatchParams {
|
|
9
|
+
opts: RunTaskPipelineOptions;
|
|
10
|
+
phase: PhaseDescriptor;
|
|
11
|
+
taskId: string;
|
|
12
|
+
cwd: string;
|
|
13
|
+
ctx: ExtensionCommandContext;
|
|
14
|
+
storeCli: string;
|
|
15
|
+
currentPhaseIndex: number;
|
|
16
|
+
iterationCounts: Record<string, number>;
|
|
17
|
+
dispatchCounts: Record<string, number>;
|
|
18
|
+
modelRoutingConfig: MergedConfig;
|
|
19
|
+
registry: RunTaskPipelineOptions["registry"];
|
|
20
|
+
cacheSessionId: string;
|
|
21
|
+
taskRecordAtStart: TaskRecord | null;
|
|
22
|
+
/** Raw sub-workflow markdown already loaded + marker-checked by the caller. */
|
|
23
|
+
subWorkflowMd: string;
|
|
24
|
+
}
|
|
25
|
+
export type PhaseDispatchOutcome = {
|
|
26
|
+
kind: "return";
|
|
27
|
+
result: RunTaskPipelineResult;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "ok";
|
|
30
|
+
result: SubagentResult;
|
|
31
|
+
finishPhaseNode: (status: "completed" | "failed" | "escalated") => void;
|
|
32
|
+
observer: ReturnType<typeof attachViewportObserver>;
|
|
33
|
+
phaseStart: number;
|
|
34
|
+
writeDebug: (rec: Record<string, unknown>) => void;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Run a single phase's subagent dispatch and classify the immediate outcome
|
|
38
|
+
* (persona-load failure, subagent throw, cancellation, or non-zero exit) into
|
|
39
|
+
* a discriminated result. On success returns `kind: "ok"` with the live locals
|
|
40
|
+
* the caller's loop needs for verdict/postflight handling and advance.
|
|
41
|
+
*/
|
|
42
|
+
export declare function dispatchPhase(p: PhaseDispatchParams): Promise<PhaseDispatchOutcome>;
|