@entelligentsia/forgecli 1.0.3 → 1.0.14
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 +93 -0
- package/README.md +2 -1
- package/dist/CHANGELOG-forge-plugin.md +250 -0
- package/dist/CHANGELOG-pi.md +94 -0
- package/dist/bin/forge.js +0 -0
- package/dist/extensions/forgecli/config-layer.d.ts +16 -0
- package/dist/extensions/forgecli/config-layer.js +5 -0
- package/dist/extensions/forgecli/config-layer.js.map +1 -1
- package/dist/extensions/forgecli/dashboard/component.d.ts +102 -0
- package/dist/extensions/forgecli/dashboard/component.js +882 -0
- package/dist/extensions/forgecli/dashboard/component.js.map +1 -0
- package/dist/extensions/forgecli/dashboard/register.d.ts +2 -0
- package/dist/extensions/forgecli/dashboard/register.js +45 -0
- package/dist/extensions/forgecli/dashboard/register.js.map +1 -0
- package/dist/extensions/forgecli/dashboard/view-model.d.ts +35 -0
- package/dist/extensions/forgecli/dashboard/view-model.js +54 -0
- package/dist/extensions/forgecli/dashboard/view-model.js.map +1 -0
- package/dist/extensions/forgecli/fix-bug.js +72 -7
- package/dist/extensions/forgecli/fix-bug.js.map +1 -1
- package/dist/extensions/forgecli/forge-artifact-tool.js +27 -4
- package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
- package/dist/extensions/forgecli/forge-cli-schema.json +4 -0
- package/dist/extensions/forgecli/forge-commands.js +1 -0
- package/dist/extensions/forgecli/forge-commands.js.map +1 -1
- package/dist/extensions/forgecli/forge-init/phase4-register.js +53 -0
- package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
- package/dist/extensions/forgecli/forge-subagent.js +6 -4
- package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
- package/dist/extensions/forgecli/forge-tools.js +2 -2
- package/dist/extensions/forgecli/forge-tools.js.map +1 -1
- package/dist/extensions/forgecli/index.js +5 -0
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/lib/halt-advisor.d.ts +54 -0
- package/dist/extensions/forgecli/lib/halt-advisor.js +90 -0
- package/dist/extensions/forgecli/lib/halt-advisor.js.map +1 -0
- package/dist/extensions/forgecli/migration-engine.js +25 -12
- package/dist/extensions/forgecli/migration-engine.js.map +1 -1
- package/dist/extensions/forgecli/orchestrator-status-bar.d.ts +25 -0
- package/dist/extensions/forgecli/orchestrator-status-bar.js +183 -0
- package/dist/extensions/forgecli/orchestrator-status-bar.js.map +1 -0
- package/dist/extensions/forgecli/orchestrator-tree.d.ts +96 -0
- package/dist/extensions/forgecli/orchestrator-tree.js +390 -0
- package/dist/extensions/forgecli/orchestrator-tree.js.map +1 -0
- package/dist/extensions/forgecli/project-orientation.js +12 -8
- package/dist/extensions/forgecli/project-orientation.js.map +1 -1
- package/dist/extensions/forgecli/regenerate.d.ts +16 -0
- package/dist/extensions/forgecli/regenerate.js +110 -0
- package/dist/extensions/forgecli/regenerate.js.map +1 -1
- package/dist/extensions/forgecli/run-sprint.js +33 -3
- package/dist/extensions/forgecli/run-sprint.js.map +1 -1
- package/dist/extensions/forgecli/run-task.d.ts +32 -0
- package/dist/extensions/forgecli/run-task.js +185 -12
- package/dist/extensions/forgecli/run-task.js.map +1 -1
- package/dist/extensions/forgecli/subagent/phase-guard.js +15 -5
- package/dist/extensions/forgecli/subagent/phase-guard.js.map +1 -1
- package/dist/extensions/forgecli/subagent/phase-summary-map.d.ts +1 -0
- package/dist/extensions/forgecli/subagent/phase-summary-map.js +17 -0
- package/dist/extensions/forgecli/subagent/phase-summary-map.js.map +1 -1
- package/dist/extensions/forgecli/thread-switcher.js +105 -764
- package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
- package/dist/extensions/forgecli/viewport-events.js +32 -0
- package/dist/extensions/forgecli/viewport-events.js.map +1 -1
- package/dist/forge-payload/.base-pack/commands/fix-bug.md +1 -1
- package/dist/forge-payload/.base-pack/commands/run-sprint.md +1 -1
- package/dist/forge-payload/.base-pack/commands/run-task.md +1 -1
- package/dist/forge-payload/.base-pack/personas/architect.md +1 -1
- package/dist/forge-payload/.base-pack/personas/bug-fixer.md +1 -1
- package/dist/forge-payload/.base-pack/personas/collator.md +3 -3
- package/dist/forge-payload/.base-pack/personas/engineer.md +1 -1
- package/dist/forge-payload/.base-pack/personas/librarian.md +1 -1
- package/dist/forge-payload/.base-pack/personas/orchestrator.md +1 -1
- package/dist/forge-payload/.base-pack/personas/product-manager.md +1 -1
- package/dist/forge-payload/.base-pack/personas/qa-engineer.md +1 -1
- package/dist/forge-payload/.base-pack/personas/supervisor.md +1 -1
- package/dist/forge-payload/.base-pack/workflows/_fragments/event-emission-schema.md +1 -1
- package/dist/forge-payload/.base-pack/workflows/_fragments/friction-emit.md +1 -1
- package/dist/forge-payload/.base-pack/workflows/_fragments/iron-laws.md +1 -1
- package/dist/forge-payload/.base-pack/workflows/_fragments/progress-reporting.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/_fragments/store-cli-verbs.md +29 -5
- package/dist/forge-payload/.base-pack/workflows/architect_approve.md +8 -10
- package/dist/forge-payload/.base-pack/workflows/architect_review_sprint_completion.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/architect_sprint_intake.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/architect_sprint_plan.md +5 -5
- package/dist/forge-payload/.base-pack/workflows/collator_agent.md +5 -7
- package/dist/forge-payload/.base-pack/workflows/commit_task.md +7 -9
- package/dist/forge-payload/.base-pack/workflows/enhance.md +5 -5
- package/dist/forge-payload/.base-pack/workflows/implement_plan.md +9 -9
- package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +12 -13
- package/dist/forge-payload/.base-pack/workflows/plan_task.md +5 -6
- package/dist/forge-payload/.base-pack/workflows/review_code.md +8 -8
- package/dist/forge-payload/.base-pack/workflows/review_plan.md +8 -8
- package/dist/forge-payload/.base-pack/workflows/sprint_retrospective.md +3 -3
- package/dist/forge-payload/.base-pack/workflows/triage.md +13 -10
- package/dist/forge-payload/.base-pack/workflows/update_implementation.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/update_plan.md +2 -2
- package/dist/forge-payload/.base-pack/workflows/validate_task.md +6 -8
- package/dist/forge-payload/.base-pack/workflows-js/wfl-fix-bug.js +490 -0
- package/dist/forge-payload/.base-pack/workflows-js/wfl-run-sprint.js +416 -0
- package/dist/forge-payload/.base-pack/workflows-js/wfl-run-task.js +608 -0
- package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
- package/dist/forge-payload/.schemas/_defs/locator.schema.json +13 -0
- package/dist/forge-payload/.schemas/bug.schema.json +1 -0
- package/dist/forge-payload/.schemas/config.schema.json +2 -3
- package/dist/forge-payload/.schemas/enum-catalog.json +2 -2
- package/dist/forge-payload/.schemas/event.schema.json +16 -0
- package/dist/forge-payload/.schemas/migrations.json +299 -0
- package/dist/forge-payload/.schemas/sprint.schema.json +1 -0
- package/dist/forge-payload/.schemas/task.schema.json +1 -0
- package/dist/forge-payload/commands/health.md +29 -0
- package/dist/forge-payload/commands/rebuild.md +143 -15
- package/dist/forge-payload/commands/update.md +28 -27
- package/dist/forge-payload/hooks/preflight-session.cjs +99 -0
- package/dist/forge-payload/init/phases/phase-3-materialize.md +18 -5
- package/dist/forge-payload/integrity.json +7 -6
- package/dist/forge-payload/meta/fragments/tool-discipline.md +1 -1
- package/dist/forge-payload/meta/personas/meta-architect.md +1 -1
- package/dist/forge-payload/meta/personas/meta-bug-fixer.md +1 -1
- package/dist/forge-payload/meta/personas/meta-collator.md +7 -7
- package/dist/forge-payload/meta/personas/meta-engineer.md +1 -1
- package/dist/forge-payload/meta/personas/meta-orchestrator.md +1 -1
- package/dist/forge-payload/meta/personas/meta-supervisor.md +1 -1
- package/dist/forge-payload/meta/tool-specs/store-cli.spec.md +1 -1
- package/dist/forge-payload/meta/workflows/_fragments/event-emission-schema.md +1 -1
- package/dist/forge-payload/meta/workflows/_fragments/friction-emit.md +1 -1
- package/dist/forge-payload/meta/workflows/_fragments/iron-laws.md +1 -1
- package/dist/forge-payload/meta/workflows/_fragments/progress-reporting.md +2 -2
- package/dist/forge-payload/meta/workflows/_fragments/store-cli-verbs.md +29 -5
- package/dist/forge-payload/meta/workflows/meta-approve.md +8 -10
- package/dist/forge-payload/meta/workflows/meta-bug-triage.md +13 -10
- package/dist/forge-payload/meta/workflows/meta-collate.md +6 -8
- package/dist/forge-payload/meta/workflows/meta-commit.md +7 -9
- package/dist/forge-payload/meta/workflows/meta-enhance.md +5 -5
- package/dist/forge-payload/meta/workflows/meta-fix-bug.md +35 -11
- package/dist/forge-payload/meta/workflows/meta-implement.md +18 -9
- package/dist/forge-payload/meta/workflows/meta-migrate.md +13 -14
- package/dist/forge-payload/meta/workflows/meta-new-sprint.md +3 -3
- package/dist/forge-payload/meta/workflows/meta-orchestrate.md +175 -82
- package/dist/forge-payload/meta/workflows/meta-plan-sprint.md +6 -6
- package/dist/forge-payload/meta/workflows/meta-plan-task.md +12 -6
- package/dist/forge-payload/meta/workflows/meta-retro.md +4 -4
- package/dist/forge-payload/meta/workflows/meta-retrospective.md +4 -4
- package/dist/forge-payload/meta/workflows/meta-review-implementation.md +8 -8
- package/dist/forge-payload/meta/workflows/meta-review-plan.md +8 -8
- package/dist/forge-payload/meta/workflows/meta-review-sprint-completion.md +3 -3
- package/dist/forge-payload/meta/workflows/meta-sprint-intake.md +3 -3
- package/dist/forge-payload/meta/workflows/meta-sprint-plan.md +6 -6
- package/dist/forge-payload/meta/workflows/meta-update-implementation.md +2 -2
- package/dist/forge-payload/meta/workflows/meta-update-plan.md +2 -2
- package/dist/forge-payload/meta/workflows/meta-validate.md +6 -8
- package/dist/forge-payload/schemas/_defs/locator.schema.json +13 -0
- package/dist/forge-payload/schemas/bug.schema.json +1 -0
- package/dist/forge-payload/schemas/config.schema.json +2 -3
- package/dist/forge-payload/schemas/enum-catalog.json +2 -2
- package/dist/forge-payload/schemas/event.schema.json +16 -0
- package/dist/forge-payload/schemas/sprint.schema.json +1 -0
- package/dist/forge-payload/schemas/structure-manifest.json +76 -73
- package/dist/forge-payload/schemas/task.schema.json +1 -0
- package/dist/forge-payload/skills/refresh-kb-links/SKILL.md +14 -7
- package/dist/forge-payload/tools/artifact-store.cjs +242 -0
- package/dist/forge-payload/tools/artifact.cjs +60 -120
- package/dist/forge-payload/tools/banners.cjs +29 -10
- package/dist/forge-payload/tools/check-structure.cjs +88 -7
- package/dist/forge-payload/tools/collate.cjs +16 -2
- package/dist/forge-payload/tools/lib/artifact-kinds.cjs +95 -0
- package/dist/forge-payload/tools/lib/store-nlp.cjs +6 -0
- package/dist/forge-payload/tools/lib/store-query-exec.cjs +39 -5
- package/dist/forge-payload/tools/lib/suggest.cjs +2 -1
- package/dist/forge-payload/tools/manage-config.cjs +5 -7
- package/dist/forge-payload/tools/parse-gates.cjs +73 -1
- package/dist/forge-payload/tools/postflight-gate.cjs +252 -0
- package/dist/forge-payload/tools/preflight-gate.cjs +102 -5
- package/dist/forge-payload/tools/store-cli.cjs +50 -15
- package/dist/forge-payload/tools/substitute-placeholders.cjs +5 -4
- package/dist/forge-payload/tools/verify-phase.cjs +17 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +5 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +81 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +19 -24
- 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/session/session.d.ts +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +14 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +22 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/README.md +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +374 -122
- 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 +424 -232
- 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 +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 +38 -2
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +21 -12
- 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 +6 -10
- 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/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +5 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +3 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +2 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.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 +159 -78
- 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 +16 -11
- 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 +4 -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 +6 -10
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/stream.js +14 -2
- package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -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/abort-signals.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts +9 -7
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +8 -7
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +1 -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/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +10 -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 +179 -79
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +94 -0
- package/node_modules/@earendil-works/pi-coding-agent/README.md +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +3 -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 +27 -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/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +15 -2
- 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-services.d.ts +1 -0
- 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 +1 -0
- 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 +5 -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 +28 -4
- 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/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +8 -2
- 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 +7 -5
- 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/model-registry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +65 -13
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
- 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/resolve-config-value.d.ts +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js +134 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +2 -0
- 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 +10 -6
- 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 +6 -7
- 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 +75 -28
- 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 +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +14 -9
- 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/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +0 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +7 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +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.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 +5 -7
- 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 +6 -7
- 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/render-utils.d.ts +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +17 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.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 +5 -6
- 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/index.d.ts +2 -0
- 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 -0
- 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 +69 -16
- 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 +118 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +1 -3
- 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 +2 -4
- 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/user-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +3 -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 +59 -6
- 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/interactive/theme/theme.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.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 +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.js +13 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/custom-provider.md +13 -10
- package/node_modules/@earendil-works/pi-coding-agent/docs/development.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +12 -6
- package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +25 -12
- package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +13 -5
- package/node_modules/@earendil-works/pi-coding-agent/docs/quickstart.md +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/session-format.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/sessions.md +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +7 -3
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/index.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/index.ts +54 -3
- 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/git-merge-and-resolve.ts +115 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/input-transform-streaming.ts +39 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +443 -61
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/README.md +2 -2
- 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 +24 -83
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +7 -55
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +7 -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 +12 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.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-image.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +34 -7
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +33 -10
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +172 -37
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +6 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +27 -15
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +25 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +96 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@entelligentsia/forge-compress/LICENSE +21 -0
- package/node_modules/@entelligentsia/forge-compress/README.md +85 -0
- package/node_modules/@mariozechner/clipboard/Cargo.toml +3 -3
- package/node_modules/@mariozechner/clipboard/index.d.ts +34 -20
- package/node_modules/@mariozechner/clipboard/index.js +546 -257
- package/node_modules/@mariozechner/clipboard/package.json +5 -6
- package/node_modules/@mariozechner/clipboard/package.json.prepack-backup +14 -14
- package/node_modules/@mariozechner/clipboard/src/lib.rs +4 -9
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/clipboard.linux-x64-gnu.node +0 -0
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/package.json +2 -2
- package/package.json +7 -7
- package/dist/bin/forgecli.d.ts +0 -2
- package/dist/bin/forgecli.js +0 -6
- package/dist/bin/forgecli.js.map +0 -1
- package/dist/extensions/forgecli/config-tui/index.d.ts +0 -5
- package/dist/extensions/forgecli/config-tui/index.js +0 -5
- package/dist/extensions/forgecli/config-tui/index.js.map +0 -1
- package/dist/extensions/forgecli/loaders/persona-skill-loader.d.ts +0 -45
- package/dist/extensions/forgecli/loaders/persona-skill-loader.js +0 -227
- package/dist/extensions/forgecli/loaders/persona-skill-loader.js.map +0 -1
- package/dist/extensions/forgecli/loaders/template-render.d.ts +0 -20
- package/dist/extensions/forgecli/loaders/template-render.js +0 -85
- package/dist/extensions/forgecli/loaders/template-render.js.map +0 -1
- package/dist/extensions/forgecli/loaders/workflow-loader.d.ts +0 -41
- package/dist/extensions/forgecli/loaders/workflow-loader.js +0 -164
- package/dist/extensions/forgecli/loaders/workflow-loader.js.map +0 -1
- package/dist/forge-payload/.base-pack/commands/quiz-agent.md +0 -6
- package/dist/forge-payload/.base-pack/commands/retrospective.md +0 -6
- package/dist/forge-payload/.base-pack/commands/sprint-intake.md +0 -6
- package/dist/forge-payload/.base-pack/commands/sprint-plan.md +0 -6
- package/dist/forge-payload/.base-pack/workflows/fix_bug.md +0 -446
- package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +0 -934
- package/dist/forge-payload/.base-pack/workflows/run_sprint.md +0 -225
- package/dist/forge-payload/commands/calibrate.md +0 -10
- package/dist/forge-payload/commands/materialize.md +0 -119
- package/dist/forge-payload/commands/migrate.md +0 -12
- package/dist/forge-payload/commands/quiz-agent.md +0 -6
- package/dist/forge-payload/commands/regenerate.md +0 -6
- package/dist/forge-payload/commands/store-query.md +0 -6
- package/dist/forge-payload/commands/store-repair.md +0 -6
- package/dist/forge-payload/commands/update-tools.md +0 -10
- package/dist/forge-payload/meta/templates/meta-retrospective.md +0 -28
- package/dist/forge-payload/tools/prompts/sprint-plan-prompt.md +0 -70
- package/dist/forge-payload/tools/schemas/task-list.schema.json +0 -53
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +0 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +0 -20
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +0 -92
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +0 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +0 -10
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +0 -31
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +0 -30
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +0 -170
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +0 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +0 -90
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +0 -1
- package/node_modules/@mariozechner/clipboard-linux-x64-musl/README.md +0 -3
- package/node_modules/@mariozechner/clipboard-linux-x64-musl/clipboard.linux-x64-musl.node +0 -0
- package/node_modules/@mariozechner/clipboard-linux-x64-musl/package.json +0 -25
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// orchestrator-status-bar.ts — One-line status bar for running orchestrations.
|
|
2
|
+
//
|
|
3
|
+
// Two render modes:
|
|
4
|
+
//
|
|
5
|
+
// INACTIVE (default):
|
|
6
|
+
// [HELLO-S01-T01 ● plan ⠋] "preview…" ↓ dashboard
|
|
7
|
+
//
|
|
8
|
+
// Shows a compact summary with status, spinner, and a ↓ hint.
|
|
9
|
+
// Press ↓ to focus the status bar.
|
|
10
|
+
//
|
|
11
|
+
// ACTIVE (user pressed ↓):
|
|
12
|
+
// ▸ [HELLO-S01-T01 ● plan ⠋] "preview…" ⏎ open · esc back
|
|
13
|
+
//
|
|
14
|
+
// Cursor glyph highlights the bar. Enter opens the dashboard overlay.
|
|
15
|
+
// Esc returns focus to the editor.
|
|
16
|
+
//
|
|
17
|
+
// The dashboard overlay (/forge:dashboard) remains the detailed view.
|
|
18
|
+
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
19
|
+
import { matchesKey, Key } from "@earendil-works/pi-tui";
|
|
20
|
+
import { fmtTokenMeter } from "./viewport-renderer.js";
|
|
21
|
+
// ── Braille spinner ────────────────────────────────────────────────────────
|
|
22
|
+
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
23
|
+
const SPINNER_INTERVAL_MS = 100;
|
|
24
|
+
// ── Status glyph for a node ────────────────────────────────────────────────
|
|
25
|
+
function nodeGlyph(status, theme) {
|
|
26
|
+
switch (status) {
|
|
27
|
+
case "completed":
|
|
28
|
+
return theme.fg("success", "✓");
|
|
29
|
+
case "running":
|
|
30
|
+
return theme.fg("accent", "●");
|
|
31
|
+
case "cancelling":
|
|
32
|
+
return theme.fg("warning", "⏳");
|
|
33
|
+
case "cancelled":
|
|
34
|
+
return theme.fg("muted", "⊘");
|
|
35
|
+
case "failed":
|
|
36
|
+
return theme.fg("error", "✗");
|
|
37
|
+
case "escalated":
|
|
38
|
+
return theme.fg("error", "▲");
|
|
39
|
+
case "pending":
|
|
40
|
+
default:
|
|
41
|
+
return theme.fg("dim", "○");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// ── OrchestratorStatusBar ──────────────────────────────────────────────────
|
|
45
|
+
export class OrchestratorStatusBar {
|
|
46
|
+
tree;
|
|
47
|
+
theme;
|
|
48
|
+
active = false;
|
|
49
|
+
invalidationCb;
|
|
50
|
+
spinnerTimer;
|
|
51
|
+
spinnerIdx = 0;
|
|
52
|
+
onAction; // callback to open dashboard
|
|
53
|
+
disposeFns = [];
|
|
54
|
+
constructor(tree, theme) {
|
|
55
|
+
this.tree = tree;
|
|
56
|
+
this.theme = theme;
|
|
57
|
+
const onChange = () => this.invalidationCb?.();
|
|
58
|
+
this.tree.on("change", onChange);
|
|
59
|
+
this.tree.on("tree", onChange);
|
|
60
|
+
this.tree.on("tail", onChange);
|
|
61
|
+
this.tree.on("preview", onChange);
|
|
62
|
+
this.disposeFns.push(() => { this.tree.off("change", onChange); this.tree.off("tree", onChange); this.tree.off("tail", onChange); this.tree.off("preview", onChange); });
|
|
63
|
+
}
|
|
64
|
+
setInvalidationCallback(cb) {
|
|
65
|
+
this.invalidationCb = cb;
|
|
66
|
+
this.ensureSpinnerTimer();
|
|
67
|
+
}
|
|
68
|
+
setOnAction(cb) {
|
|
69
|
+
this.onAction = cb;
|
|
70
|
+
}
|
|
71
|
+
setActive(active) {
|
|
72
|
+
this.active = active;
|
|
73
|
+
this.invalidationCb?.();
|
|
74
|
+
}
|
|
75
|
+
isActive() {
|
|
76
|
+
return this.active;
|
|
77
|
+
}
|
|
78
|
+
ensureSpinnerTimer() {
|
|
79
|
+
if (this.spinnerTimer)
|
|
80
|
+
return;
|
|
81
|
+
this.spinnerTimer = setInterval(() => {
|
|
82
|
+
const anyActive = this.tree.getActiveRoots().some((r) => r.status === "running" || r.status === "cancelling");
|
|
83
|
+
if (!anyActive) {
|
|
84
|
+
// One last render to settle spinner, then stop.
|
|
85
|
+
this.invalidationCb?.();
|
|
86
|
+
if (this.spinnerTimer)
|
|
87
|
+
clearInterval(this.spinnerTimer);
|
|
88
|
+
this.spinnerTimer = undefined;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.spinnerIdx = (this.spinnerIdx + 1) % SPINNER_FRAMES.length;
|
|
92
|
+
this.invalidationCb?.();
|
|
93
|
+
}, SPINNER_INTERVAL_MS);
|
|
94
|
+
}
|
|
95
|
+
render(width) {
|
|
96
|
+
const roots = this.tree.getActiveRoots();
|
|
97
|
+
if (roots.length === 0)
|
|
98
|
+
return []; // Hidden when nothing is running.
|
|
99
|
+
const dim = (s) => this.theme.fg("dim", s);
|
|
100
|
+
const accent = (s) => this.theme.fg("accent", s);
|
|
101
|
+
const bold = (s) => this.theme.bold(this.theme.fg("accent", s));
|
|
102
|
+
// Build a segment for each active root.
|
|
103
|
+
const segments = [];
|
|
104
|
+
for (const root of roots) {
|
|
105
|
+
// Find the deepest running leaf or the root itself.
|
|
106
|
+
const leaf = this.findDeepestRunningLeaf(root.id);
|
|
107
|
+
const displayNode = leaf ?? root;
|
|
108
|
+
const glyph = nodeGlyph(displayNode.status, this.theme);
|
|
109
|
+
// Label: root label, with current phase as suffix if different.
|
|
110
|
+
let label = root.label;
|
|
111
|
+
if (leaf && leaf.id !== root.id) {
|
|
112
|
+
const shortRole = leaf.id.includes(":") ? leaf.id.split(":").slice(1).join(":") : leaf.label;
|
|
113
|
+
label = `${root.label} · ${shortRole}`;
|
|
114
|
+
}
|
|
115
|
+
// Usage footer (right-aligned within segment).
|
|
116
|
+
const usage = this.tree.getSubtreeUsage(root.id);
|
|
117
|
+
const meter = fmtTokenMeter(usage);
|
|
118
|
+
const meterPart = meter ? dim(` ${meter}`) : "";
|
|
119
|
+
// Spinner for running nodes.
|
|
120
|
+
const spin = (displayNode.status === "running" || displayNode.status === "cancelling")
|
|
121
|
+
? ` ${SPINNER_FRAMES[this.spinnerIdx]}`
|
|
122
|
+
: "";
|
|
123
|
+
// Turn preview (truncated).
|
|
124
|
+
const preview = displayNode.lastTurnPreview
|
|
125
|
+
? dim(` "${truncateToWidth(displayNode.lastTurnPreview, 60)}"`)
|
|
126
|
+
: "";
|
|
127
|
+
const segment = `${glyph} ${bold(`[${label}]`)}${spin}${preview}${meterPart}`;
|
|
128
|
+
segments.push(segment);
|
|
129
|
+
}
|
|
130
|
+
// Right-side hint depends on active state.
|
|
131
|
+
const hint = this.active
|
|
132
|
+
? dim(" ⏎ open · esc back")
|
|
133
|
+
: dim(" ↓ dashboard");
|
|
134
|
+
// Compose: join segments with separator, append hint.
|
|
135
|
+
const prefix = this.active ? accent("▸") + " " : "";
|
|
136
|
+
const joined = segments.join(dim(" │ "));
|
|
137
|
+
const line = `${prefix}${joined}${hint}`;
|
|
138
|
+
return [truncateToWidth(line, width)];
|
|
139
|
+
}
|
|
140
|
+
invalidate() {
|
|
141
|
+
// Re-render driven by external invalidationCb → tui.requestRender().
|
|
142
|
+
}
|
|
143
|
+
handleInput(data) {
|
|
144
|
+
if (!this.active)
|
|
145
|
+
return;
|
|
146
|
+
if (matchesKey(data, Key.enter)) {
|
|
147
|
+
this.active = false;
|
|
148
|
+
this.onAction?.(); // open dashboard
|
|
149
|
+
}
|
|
150
|
+
else if (matchesKey(data, Key.escape) || matchesKey(data, Key.up)) {
|
|
151
|
+
this.active = false; // deactivate, return to editor
|
|
152
|
+
}
|
|
153
|
+
this.invalidationCb?.();
|
|
154
|
+
}
|
|
155
|
+
dispose = () => {
|
|
156
|
+
if (this.spinnerTimer) {
|
|
157
|
+
clearInterval(this.spinnerTimer);
|
|
158
|
+
this.spinnerTimer = undefined;
|
|
159
|
+
}
|
|
160
|
+
for (const fn of this.disposeFns)
|
|
161
|
+
fn();
|
|
162
|
+
this.disposeFns = [];
|
|
163
|
+
};
|
|
164
|
+
/** Walk depth-first to find the deepest running/cancelling leaf. */
|
|
165
|
+
findDeepestRunningLeaf(id) {
|
|
166
|
+
const node = this.tree.getNode(id);
|
|
167
|
+
if (!node)
|
|
168
|
+
return undefined;
|
|
169
|
+
if (node.kind === "leaf" && (node.status === "running" || node.status === "cancelling")) {
|
|
170
|
+
return node;
|
|
171
|
+
}
|
|
172
|
+
for (const childId of node.children) {
|
|
173
|
+
const found = this.findDeepestRunningLeaf(childId);
|
|
174
|
+
if (found)
|
|
175
|
+
return found;
|
|
176
|
+
}
|
|
177
|
+
// If no running leaf, return the root if it's running.
|
|
178
|
+
if (node.status === "running" || node.status === "cancelling")
|
|
179
|
+
return node;
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=orchestrator-status-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAC5B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,CAAC,EAAE,CAAC;YACzF,OAAO,IAAI,CAAC;QACb,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;QACzB,CAAC;QACD,uDAAuD;QACvD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY;YAAE,OAAO,IAAI,CAAC;QAC3E,OAAO,SAAS,CAAC;IAClB,CAAC;CACD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
export type NodeKind = "orchestrator" | "leaf";
|
|
3
|
+
export type NodeStatus = "pending" | "running" | "cancelling" | "cancelled" | "completed" | "failed" | "escalated";
|
|
4
|
+
export interface UsageSnapshot {
|
|
5
|
+
input: number;
|
|
6
|
+
output: number;
|
|
7
|
+
cacheRead: number;
|
|
8
|
+
}
|
|
9
|
+
export interface NodeMetrics {
|
|
10
|
+
turn: number;
|
|
11
|
+
toolCount: number;
|
|
12
|
+
errCount: number;
|
|
13
|
+
}
|
|
14
|
+
export interface OrchestratorNode {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
kind: NodeKind;
|
|
18
|
+
parentId: string | null;
|
|
19
|
+
children: string[];
|
|
20
|
+
status: NodeStatus;
|
|
21
|
+
startedAt: number;
|
|
22
|
+
endedAt?: number;
|
|
23
|
+
usage: UsageSnapshot;
|
|
24
|
+
model?: string;
|
|
25
|
+
provider?: string;
|
|
26
|
+
compression?: {
|
|
27
|
+
calls: number;
|
|
28
|
+
tokensSaved: number;
|
|
29
|
+
};
|
|
30
|
+
metrics: NodeMetrics;
|
|
31
|
+
iteration?: number;
|
|
32
|
+
tailBuffer: string[];
|
|
33
|
+
unreadWarnings: number;
|
|
34
|
+
firstTurnPreview?: string;
|
|
35
|
+
lastTurnPreview?: string;
|
|
36
|
+
promptPreview?: string;
|
|
37
|
+
outcomePreview?: string;
|
|
38
|
+
abortController?: AbortController;
|
|
39
|
+
}
|
|
40
|
+
export interface StartNodeOptions {
|
|
41
|
+
parentId?: string;
|
|
42
|
+
label?: string;
|
|
43
|
+
kind?: NodeKind;
|
|
44
|
+
promptPreview?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare class OrchestratorTree extends EventEmitter {
|
|
47
|
+
private nodes;
|
|
48
|
+
private roots;
|
|
49
|
+
startNode(id: string, opts?: StartNodeOptions): OrchestratorNode;
|
|
50
|
+
completeNode(id: string, status: NodeStatus): void;
|
|
51
|
+
setNodeUsage(id: string, usage: UsageSnapshot): void;
|
|
52
|
+
setNodeModel(id: string, model: string, provider: string): void;
|
|
53
|
+
setNodeCompression(id: string, compression: {
|
|
54
|
+
calls: number;
|
|
55
|
+
tokensSaved: number;
|
|
56
|
+
}): void;
|
|
57
|
+
bumpNodeTurn(id: string): void;
|
|
58
|
+
incrementNodeToolCount(id: string, delta?: number): void;
|
|
59
|
+
incrementNodeErrCount(id: string, delta?: number): void;
|
|
60
|
+
setNodeIteration(id: string, iteration: number): void;
|
|
61
|
+
setNodeOutcome(id: string, preview: string): void;
|
|
62
|
+
appendTail(id: string, line: string, opts?: {
|
|
63
|
+
warning?: boolean;
|
|
64
|
+
}): void;
|
|
65
|
+
markTailRead(id: string): void;
|
|
66
|
+
setTurnPreview(id: string, preview: string): void;
|
|
67
|
+
requestCancel(id: string): boolean;
|
|
68
|
+
getAbortSignal(id: string): AbortSignal | undefined;
|
|
69
|
+
getNode(id: string): OrchestratorNode | undefined;
|
|
70
|
+
getChildren(id: string): OrchestratorNode[];
|
|
71
|
+
getAncestors(id: string): OrchestratorNode[];
|
|
72
|
+
getRoots(): OrchestratorNode[];
|
|
73
|
+
/** Active roots: all roots if any are running/cancelling, otherwise
|
|
74
|
+
* only non-terminal roots. Prunes stale terminal roots that have no
|
|
75
|
+
* running descendants — the dashboard should not show completed sprints
|
|
76
|
+
* from prior invocations alongside the current one. */
|
|
77
|
+
getActiveRoots(): OrchestratorNode[];
|
|
78
|
+
/** Returns true if every node in the subtree rooted at `id` has reached a
|
|
79
|
+
* terminal state (completed, failed, cancelled, or escalated). */
|
|
80
|
+
private isSubtreeTerminal;
|
|
81
|
+
/** Re-parent a node from its current position to a new parent (or to root
|
|
82
|
+
* if newParentId is null). Removes from old parent's children and/or
|
|
83
|
+
* roots, adds to new parent's children and/or roots, and updates the
|
|
84
|
+
* node's parentId field. */
|
|
85
|
+
private reparentNode;
|
|
86
|
+
getSubtreeUsage(id: string): UsageSnapshot;
|
|
87
|
+
getSubtreeProgress(id: string): {
|
|
88
|
+
completed: number;
|
|
89
|
+
total: number;
|
|
90
|
+
};
|
|
91
|
+
/** Depth of a node (root = 0). Useful for tree indentation. */
|
|
92
|
+
getDepth(id: string): number;
|
|
93
|
+
private evictIfNeeded;
|
|
94
|
+
private removeSubtree;
|
|
95
|
+
}
|
|
96
|
+
export declare function getOrchestratorTree(): OrchestratorTree;
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
// orchestrator-tree.ts — Generic observable tree for orchestrator > subagent
|
|
2
|
+
// visualization.
|
|
3
|
+
//
|
|
4
|
+
// Sibling to SessionRegistry (which drives the chip strip). The dashboard
|
|
5
|
+
// overlay reads from OrchestratorTree; the chip strip reads from
|
|
6
|
+
// SessionRegistry. Both are written to by the same orchestrator call-sites.
|
|
7
|
+
//
|
|
8
|
+
// The tree is depth-agnostic: Sprint>Tasks>Phases, Fix-bug>Phases, and
|
|
9
|
+
// standalone Run-task are all fan-out trees with the same node shape. Any
|
|
10
|
+
// future orchestrator (run-release, etc.) adds nodes without dashboard
|
|
11
|
+
// changes.
|
|
12
|
+
//
|
|
13
|
+
// Node IDs are dot/colon-separated paths for readability:
|
|
14
|
+
// "FORGE-S27" — sprint root (orchestrator)
|
|
15
|
+
// "FORGE-S27-T01" — task (orchestrator)
|
|
16
|
+
// "FORGE-S27-T01:plan:1" — phase (leaf)
|
|
17
|
+
// "FORGE-S27:ceremony" — ceremony (leaf)
|
|
18
|
+
//
|
|
19
|
+
// LRU-capped at MAX_NODES to bound memory across long-running processes.
|
|
20
|
+
// Ring-buffer tail caps at MAX_TAIL_LINES_PER_NODE.
|
|
21
|
+
import { EventEmitter } from "node:events";
|
|
22
|
+
// ── Constants ──────────────────────────────────────────────────────────────
|
|
23
|
+
const MAX_NODES = 50;
|
|
24
|
+
const MAX_TAIL_LINES_PER_NODE = 2048;
|
|
25
|
+
const MAX_TAIL_APPEND = 500; // per-append cap before trimming
|
|
26
|
+
// ── OrchestratorTree ───────────────────────────────────────────────────────
|
|
27
|
+
export class OrchestratorTree extends EventEmitter {
|
|
28
|
+
nodes = new Map();
|
|
29
|
+
roots = new Set();
|
|
30
|
+
// ── Mutation: lifecycle ────────────────────────────────────────────────
|
|
31
|
+
startNode(id, opts = {}) {
|
|
32
|
+
const existing = this.nodes.get(id);
|
|
33
|
+
if (existing) {
|
|
34
|
+
// Resume — refresh status and timestamps, keep events for visibility.
|
|
35
|
+
existing.status = "running";
|
|
36
|
+
existing.startedAt = Date.now();
|
|
37
|
+
existing.endedAt = undefined;
|
|
38
|
+
existing.abortController = new AbortController();
|
|
39
|
+
// Reconcile parentId: if the caller specifies a different parent,
|
|
40
|
+
// reparent the node so stale root placements self-correct.
|
|
41
|
+
const newParentId = opts.parentId ?? null;
|
|
42
|
+
const oldParentId = existing.parentId;
|
|
43
|
+
if (newParentId !== oldParentId) {
|
|
44
|
+
this.reparentNode(existing, oldParentId, newParentId);
|
|
45
|
+
}
|
|
46
|
+
// Re-apply label/kind if caller supplies them (resume may change role).
|
|
47
|
+
if (opts.label !== undefined)
|
|
48
|
+
existing.label = opts.label;
|
|
49
|
+
if (opts.kind !== undefined)
|
|
50
|
+
existing.kind = opts.kind;
|
|
51
|
+
if (opts.promptPreview !== undefined)
|
|
52
|
+
existing.promptPreview = opts.promptPreview;
|
|
53
|
+
this.emit("change", id);
|
|
54
|
+
this.emit("tree", id);
|
|
55
|
+
return existing;
|
|
56
|
+
}
|
|
57
|
+
const node = {
|
|
58
|
+
id,
|
|
59
|
+
label: opts.label ?? id,
|
|
60
|
+
kind: opts.kind ?? "leaf",
|
|
61
|
+
parentId: opts.parentId ?? null,
|
|
62
|
+
children: [],
|
|
63
|
+
status: "running",
|
|
64
|
+
startedAt: Date.now(),
|
|
65
|
+
usage: { input: 0, output: 0, cacheRead: 0 },
|
|
66
|
+
metrics: { turn: 0, toolCount: 0, errCount: 0 },
|
|
67
|
+
tailBuffer: [],
|
|
68
|
+
unreadWarnings: 0,
|
|
69
|
+
abortController: new AbortController(),
|
|
70
|
+
};
|
|
71
|
+
if (opts.promptPreview) {
|
|
72
|
+
node.promptPreview = opts.promptPreview;
|
|
73
|
+
}
|
|
74
|
+
// Link to parent.
|
|
75
|
+
if (node.parentId) {
|
|
76
|
+
const parent = this.nodes.get(node.parentId);
|
|
77
|
+
if (parent && !parent.children.includes(id)) {
|
|
78
|
+
parent.children.push(id);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.roots.add(id);
|
|
83
|
+
}
|
|
84
|
+
this.nodes.set(id, node);
|
|
85
|
+
this.evictIfNeeded();
|
|
86
|
+
this.emit("change", id);
|
|
87
|
+
this.emit("tree", id);
|
|
88
|
+
return node;
|
|
89
|
+
}
|
|
90
|
+
completeNode(id, status) {
|
|
91
|
+
const node = this.nodes.get(id);
|
|
92
|
+
if (!node)
|
|
93
|
+
return;
|
|
94
|
+
// Idempotent for terminal states — don't clobber a success-path mark.
|
|
95
|
+
if (node.status !== "running" && node.status !== "cancelling")
|
|
96
|
+
return;
|
|
97
|
+
node.status = status;
|
|
98
|
+
node.endedAt = Date.now();
|
|
99
|
+
node.abortController = undefined;
|
|
100
|
+
this.emit("change", id);
|
|
101
|
+
}
|
|
102
|
+
// ── Mutation: telemetry ─────────────────────────────────────────────────
|
|
103
|
+
setNodeUsage(id, usage) {
|
|
104
|
+
const node = this.nodes.get(id);
|
|
105
|
+
if (!node)
|
|
106
|
+
return;
|
|
107
|
+
node.usage = { input: usage.input, output: usage.output, cacheRead: usage.cacheRead };
|
|
108
|
+
this.emit("change", id);
|
|
109
|
+
}
|
|
110
|
+
setNodeModel(id, model, provider) {
|
|
111
|
+
const node = this.nodes.get(id);
|
|
112
|
+
if (!node)
|
|
113
|
+
return;
|
|
114
|
+
// Only emit when the value actually changes — turn_end fires every
|
|
115
|
+
// turn and the model is stable across a phase.
|
|
116
|
+
if (node.provider === provider && node.model === model)
|
|
117
|
+
return;
|
|
118
|
+
node.model = model;
|
|
119
|
+
node.provider = provider;
|
|
120
|
+
this.emit("change", id);
|
|
121
|
+
}
|
|
122
|
+
setNodeCompression(id, compression) {
|
|
123
|
+
const node = this.nodes.get(id);
|
|
124
|
+
if (!node)
|
|
125
|
+
return;
|
|
126
|
+
node.compression = { calls: compression.calls, tokensSaved: compression.tokensSaved };
|
|
127
|
+
this.emit("change", id);
|
|
128
|
+
}
|
|
129
|
+
bumpNodeTurn(id) {
|
|
130
|
+
const node = this.nodes.get(id);
|
|
131
|
+
if (!node)
|
|
132
|
+
return;
|
|
133
|
+
node.metrics.turn++;
|
|
134
|
+
this.emit("change", id);
|
|
135
|
+
}
|
|
136
|
+
incrementNodeToolCount(id, delta = 1) {
|
|
137
|
+
const node = this.nodes.get(id);
|
|
138
|
+
if (!node)
|
|
139
|
+
return;
|
|
140
|
+
node.metrics.toolCount += delta;
|
|
141
|
+
this.emit("change", id);
|
|
142
|
+
}
|
|
143
|
+
incrementNodeErrCount(id, delta = 1) {
|
|
144
|
+
const node = this.nodes.get(id);
|
|
145
|
+
if (!node)
|
|
146
|
+
return;
|
|
147
|
+
node.metrics.errCount += delta;
|
|
148
|
+
this.emit("change", id);
|
|
149
|
+
}
|
|
150
|
+
setNodeIteration(id, iteration) {
|
|
151
|
+
const node = this.nodes.get(id);
|
|
152
|
+
if (!node)
|
|
153
|
+
return;
|
|
154
|
+
node.iteration = iteration;
|
|
155
|
+
this.emit("change", id);
|
|
156
|
+
}
|
|
157
|
+
setNodeOutcome(id, preview) {
|
|
158
|
+
const node = this.nodes.get(id);
|
|
159
|
+
if (!node)
|
|
160
|
+
return;
|
|
161
|
+
node.outcomePreview = preview;
|
|
162
|
+
this.emit("change", id);
|
|
163
|
+
}
|
|
164
|
+
// ── Mutation: tail buffer ───────────────────────────────────────────────
|
|
165
|
+
appendTail(id, line, opts) {
|
|
166
|
+
const node = this.nodes.get(id);
|
|
167
|
+
if (!node)
|
|
168
|
+
return;
|
|
169
|
+
node.tailBuffer.push(line);
|
|
170
|
+
if (node.tailBuffer.length > MAX_TAIL_LINES_PER_NODE) {
|
|
171
|
+
node.tailBuffer.splice(0, node.tailBuffer.length - MAX_TAIL_LINES_PER_NODE);
|
|
172
|
+
}
|
|
173
|
+
if (opts?.warning)
|
|
174
|
+
node.unreadWarnings++;
|
|
175
|
+
this.emit("tail", id);
|
|
176
|
+
}
|
|
177
|
+
markTailRead(id) {
|
|
178
|
+
const node = this.nodes.get(id);
|
|
179
|
+
if (!node)
|
|
180
|
+
return;
|
|
181
|
+
if (node.unreadWarnings === 0)
|
|
182
|
+
return;
|
|
183
|
+
node.unreadWarnings = 0;
|
|
184
|
+
this.emit("change", id);
|
|
185
|
+
}
|
|
186
|
+
setTurnPreview(id, preview) {
|
|
187
|
+
const node = this.nodes.get(id);
|
|
188
|
+
if (!node)
|
|
189
|
+
return;
|
|
190
|
+
if (node.lastTurnPreview === preview)
|
|
191
|
+
return;
|
|
192
|
+
node.lastTurnPreview = preview;
|
|
193
|
+
if (node.firstTurnPreview === undefined)
|
|
194
|
+
node.firstTurnPreview = preview;
|
|
195
|
+
this.emit("preview", id);
|
|
196
|
+
}
|
|
197
|
+
// ── Mutation: cancellation ───────────────────────────────────────────────
|
|
198
|
+
requestCancel(id) {
|
|
199
|
+
const node = this.nodes.get(id);
|
|
200
|
+
if (!node)
|
|
201
|
+
return false;
|
|
202
|
+
if (node.status !== "running")
|
|
203
|
+
return false;
|
|
204
|
+
node.status = "cancelling";
|
|
205
|
+
node.abortController?.abort();
|
|
206
|
+
this.emit("change", id);
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
getAbortSignal(id) {
|
|
210
|
+
return this.nodes.get(id)?.abortController?.signal;
|
|
211
|
+
}
|
|
212
|
+
// ── Queries ──────────────────────────────────────────────────────────────
|
|
213
|
+
getNode(id) {
|
|
214
|
+
return this.nodes.get(id);
|
|
215
|
+
}
|
|
216
|
+
getChildren(id) {
|
|
217
|
+
const node = this.nodes.get(id);
|
|
218
|
+
if (!node)
|
|
219
|
+
return [];
|
|
220
|
+
return node.children
|
|
221
|
+
.map((cid) => this.nodes.get(cid))
|
|
222
|
+
.filter((n) => n !== undefined);
|
|
223
|
+
}
|
|
224
|
+
getAncestors(id) {
|
|
225
|
+
const result = [];
|
|
226
|
+
let current = this.nodes.get(id);
|
|
227
|
+
while (current?.parentId) {
|
|
228
|
+
const parent = this.nodes.get(current.parentId);
|
|
229
|
+
if (parent)
|
|
230
|
+
result.push(parent);
|
|
231
|
+
current = parent;
|
|
232
|
+
}
|
|
233
|
+
return result;
|
|
234
|
+
}
|
|
235
|
+
getRoots() {
|
|
236
|
+
return [...this.roots]
|
|
237
|
+
.map((id) => this.nodes.get(id))
|
|
238
|
+
.filter((n) => n !== undefined);
|
|
239
|
+
}
|
|
240
|
+
/** Active roots: all roots if any are running/cancelling, otherwise
|
|
241
|
+
* only non-terminal roots. Prunes stale terminal roots that have no
|
|
242
|
+
* running descendants — the dashboard should not show completed sprints
|
|
243
|
+
* from prior invocations alongside the current one. */
|
|
244
|
+
getActiveRoots() {
|
|
245
|
+
const roots = this.getRoots();
|
|
246
|
+
const hasActive = roots.some((r) => r.status === "running" || r.status === "cancelling");
|
|
247
|
+
if (!hasActive)
|
|
248
|
+
return roots; // nothing in flight — show all
|
|
249
|
+
return roots.filter((r) => r.status === "running" ||
|
|
250
|
+
r.status === "cancelling" ||
|
|
251
|
+
r.status === "pending" ||
|
|
252
|
+
(r.kind === "orchestrator" && !this.isSubtreeTerminal(r.id)));
|
|
253
|
+
}
|
|
254
|
+
/** Returns true if every node in the subtree rooted at `id` has reached a
|
|
255
|
+
* terminal state (completed, failed, cancelled, or escalated). */
|
|
256
|
+
isSubtreeTerminal(id) {
|
|
257
|
+
const stack = [id];
|
|
258
|
+
while (stack.length > 0) {
|
|
259
|
+
const current = stack.pop();
|
|
260
|
+
const node = this.nodes.get(current);
|
|
261
|
+
if (!node)
|
|
262
|
+
continue;
|
|
263
|
+
if (node.status !== "completed" &&
|
|
264
|
+
node.status !== "failed" &&
|
|
265
|
+
node.status !== "cancelled" &&
|
|
266
|
+
node.status !== "escalated") {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
stack.push(...node.children);
|
|
270
|
+
}
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
/** Re-parent a node from its current position to a new parent (or to root
|
|
274
|
+
* if newParentId is null). Removes from old parent's children and/or
|
|
275
|
+
* roots, adds to new parent's children and/or roots, and updates the
|
|
276
|
+
* node's parentId field. */
|
|
277
|
+
reparentNode(node, oldParentId, newParentId) {
|
|
278
|
+
if (oldParentId === newParentId)
|
|
279
|
+
return;
|
|
280
|
+
// Unlink from old parent (or roots).
|
|
281
|
+
if (oldParentId) {
|
|
282
|
+
const oldParent = this.nodes.get(oldParentId);
|
|
283
|
+
if (oldParent) {
|
|
284
|
+
oldParent.children = oldParent.children.filter((cid) => cid !== node.id);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this.roots.delete(node.id);
|
|
289
|
+
}
|
|
290
|
+
// Link to new parent (or roots).
|
|
291
|
+
if (newParentId) {
|
|
292
|
+
const newParent = this.nodes.get(newParentId);
|
|
293
|
+
if (newParent && !newParent.children.includes(node.id)) {
|
|
294
|
+
newParent.children.push(node.id);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
this.roots.add(node.id);
|
|
299
|
+
}
|
|
300
|
+
node.parentId = newParentId;
|
|
301
|
+
}
|
|
302
|
+
getSubtreeUsage(id) {
|
|
303
|
+
const agg = { input: 0, output: 0, cacheRead: 0 };
|
|
304
|
+
const stack = [id];
|
|
305
|
+
while (stack.length > 0) {
|
|
306
|
+
const current = stack.pop();
|
|
307
|
+
const node = this.nodes.get(current);
|
|
308
|
+
if (!node)
|
|
309
|
+
continue;
|
|
310
|
+
agg.input += node.usage.input;
|
|
311
|
+
agg.output += node.usage.output;
|
|
312
|
+
agg.cacheRead += node.usage.cacheRead;
|
|
313
|
+
stack.push(...node.children);
|
|
314
|
+
}
|
|
315
|
+
return agg;
|
|
316
|
+
}
|
|
317
|
+
getSubtreeProgress(id) {
|
|
318
|
+
let completed = 0;
|
|
319
|
+
let total = 0;
|
|
320
|
+
const stack = [id];
|
|
321
|
+
while (stack.length > 0) {
|
|
322
|
+
const current = stack.pop();
|
|
323
|
+
const node = this.nodes.get(current);
|
|
324
|
+
if (!node)
|
|
325
|
+
continue;
|
|
326
|
+
if (node.kind === "leaf") {
|
|
327
|
+
total++;
|
|
328
|
+
if (node.status === "completed")
|
|
329
|
+
completed++;
|
|
330
|
+
}
|
|
331
|
+
stack.push(...node.children);
|
|
332
|
+
}
|
|
333
|
+
return { completed, total };
|
|
334
|
+
}
|
|
335
|
+
/** Depth of a node (root = 0). Useful for tree indentation. */
|
|
336
|
+
getDepth(id) {
|
|
337
|
+
let depth = 0;
|
|
338
|
+
let current = this.nodes.get(id);
|
|
339
|
+
while (current?.parentId) {
|
|
340
|
+
depth++;
|
|
341
|
+
current = this.nodes.get(current.parentId);
|
|
342
|
+
}
|
|
343
|
+
return depth;
|
|
344
|
+
}
|
|
345
|
+
// ── Private ─────────────────────────────────────────────────────────────
|
|
346
|
+
evictIfNeeded() {
|
|
347
|
+
if (this.nodes.size <= MAX_NODES)
|
|
348
|
+
return;
|
|
349
|
+
// Evict the oldest completed/failed/cancelled root node.
|
|
350
|
+
const roots = this.getRoots();
|
|
351
|
+
const evictable = roots
|
|
352
|
+
.filter((r) => r.status === "completed" ||
|
|
353
|
+
r.status === "failed" ||
|
|
354
|
+
r.status === "cancelled" ||
|
|
355
|
+
r.status === "escalated")
|
|
356
|
+
.sort((a, b) => a.startedAt - b.startedAt);
|
|
357
|
+
if (evictable.length === 0)
|
|
358
|
+
return;
|
|
359
|
+
const victim = evictable[0];
|
|
360
|
+
this.removeSubtree(victim.id);
|
|
361
|
+
}
|
|
362
|
+
removeSubtree(id) {
|
|
363
|
+
const node = this.nodes.get(id);
|
|
364
|
+
if (!node)
|
|
365
|
+
return;
|
|
366
|
+
// Remove all descendants first.
|
|
367
|
+
for (const childId of [...node.children]) {
|
|
368
|
+
this.removeSubtree(childId);
|
|
369
|
+
}
|
|
370
|
+
// Unlink from parent.
|
|
371
|
+
if (node.parentId) {
|
|
372
|
+
const parent = this.nodes.get(node.parentId);
|
|
373
|
+
if (parent) {
|
|
374
|
+
parent.children = parent.children.filter((cid) => cid !== id);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
this.roots.delete(id);
|
|
379
|
+
}
|
|
380
|
+
this.nodes.delete(id);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// ── Singleton ──────────────────────────────────────────────────────────────
|
|
384
|
+
let _tree;
|
|
385
|
+
export function getOrchestratorTree() {
|
|
386
|
+
if (!_tree)
|
|
387
|
+
_tree = new OrchestratorTree();
|
|
388
|
+
return _tree;
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=orchestrator-tree.js.map
|