@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
|
@@ -132,9 +132,17 @@ function validateManifest(manifest, forgeRoot) {
|
|
|
132
132
|
fragments: path.join(basePackDir, 'workflows', '_fragments'),
|
|
133
133
|
templates: path.join(basePackDir, 'templates'),
|
|
134
134
|
commands: path.join(basePackDir, 'commands'),
|
|
135
|
+
'workflows-js': path.join(basePackDir, 'workflows-js'),
|
|
136
|
+
// tools: not base-pack-sourced — source is forgeRoot/tools/ (verbatim vendor).
|
|
137
|
+
// Uses recursive enumeration to include lib/*.cjs with the lib/ prefix.
|
|
138
|
+
tools: path.join(forgeRoot, 'tools'),
|
|
135
139
|
// schemas: not base-pack-sourced — source is forgeRoot/schemas/
|
|
136
140
|
};
|
|
137
141
|
|
|
142
|
+
// Namespaces that require recursive enumeration (files may include path prefixes
|
|
143
|
+
// like lib/*.cjs). The walker returns relative paths with forward slashes.
|
|
144
|
+
const recursiveNs = new Set(['tools']);
|
|
145
|
+
|
|
138
146
|
const manifestOnly = []; // Files in manifest but not in base-pack
|
|
139
147
|
const basePackOnly = []; // Files in base-pack but not in manifest
|
|
140
148
|
|
|
@@ -147,14 +155,31 @@ function validateManifest(manifest, forgeRoot) {
|
|
|
147
155
|
|
|
148
156
|
const manifestFiles = new Set(ns.files || []);
|
|
149
157
|
|
|
150
|
-
// Read base-pack source directory
|
|
158
|
+
// Read base-pack source directory (flat or recursive depending on namespace)
|
|
151
159
|
let basePackFiles = [];
|
|
152
160
|
try {
|
|
153
|
-
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
if (recursiveNs.has(nsKey)) {
|
|
162
|
+
// Recursive walk: enumerate all files, returning paths relative to sourceDir
|
|
163
|
+
// (with forward-slash separators). Excludes *.test.cjs files.
|
|
164
|
+
const walkDir = (dir, prefix) => {
|
|
165
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
166
|
+
for (const entry of entries) {
|
|
167
|
+
const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
168
|
+
if (entry.isDirectory()) {
|
|
169
|
+
walkDir(path.join(dir, entry.name), relPath);
|
|
170
|
+
} else if (entry.isFile() && !entry.name.endsWith('.test.cjs')) {
|
|
171
|
+
basePackFiles.push(relPath);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
walkDir(sourceDir, '');
|
|
176
|
+
} else {
|
|
177
|
+
basePackFiles = fs.readdirSync(sourceDir).filter(f => {
|
|
178
|
+
// Only include regular files, skip subdirectories (like _fragments under workflows)
|
|
179
|
+
const stat = fs.statSync(path.join(sourceDir, f));
|
|
180
|
+
return stat.isFile();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
158
183
|
} catch {
|
|
159
184
|
// Directory doesn't exist — all manifest files are manifestOnly
|
|
160
185
|
for (const f of manifestFiles) {
|
|
@@ -183,9 +208,65 @@ function validateManifest(manifest, forgeRoot) {
|
|
|
183
208
|
return { manifestOnly, basePackOnly };
|
|
184
209
|
}
|
|
185
210
|
|
|
211
|
+
// Checks whether the vendored .forge/tools/ directory is present, and whether
|
|
212
|
+
// the version marker (.forge/tools/.forge-tools-version) matches the active
|
|
213
|
+
// plugin version from .forge/config.json (paths.forgeRef).
|
|
214
|
+
//
|
|
215
|
+
// Returns:
|
|
216
|
+
// { present, vendoredVersion, activeVersion, stale, reason }
|
|
217
|
+
//
|
|
218
|
+
// present — true if .forge/tools/ directory exists
|
|
219
|
+
// vendoredVersion — version string from .forge-tools-version (or null)
|
|
220
|
+
// activeVersion — version string from paths.forgeRef in config (or null)
|
|
221
|
+
// stale — true when: dir absent=false; marker absent=true; versions differ=true
|
|
222
|
+
// reason — 'ok' | 'missing' | 'marker-absent' | 'version-mismatch'
|
|
223
|
+
function checkToolsVersion(projectRoot) {
|
|
224
|
+
const toolsDir = path.join(projectRoot, '.forge', 'tools');
|
|
225
|
+
const markerFile = path.join(toolsDir, '.forge-tools-version');
|
|
226
|
+
const configFile = path.join(projectRoot, '.forge', 'config.json');
|
|
227
|
+
|
|
228
|
+
// Dir absent → not stale (just missing)
|
|
229
|
+
if (!fs.existsSync(toolsDir)) {
|
|
230
|
+
return { present: false, vendoredVersion: null, activeVersion: null, stale: false, reason: 'missing' };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Read active version from config
|
|
234
|
+
let activeVersion = null;
|
|
235
|
+
if (fs.existsSync(configFile)) {
|
|
236
|
+
try {
|
|
237
|
+
const cfg = JSON.parse(fs.readFileSync(configFile, 'utf8'));
|
|
238
|
+
activeVersion = (cfg && cfg.paths && cfg.paths.forgeRef) ? cfg.paths.forgeRef : null;
|
|
239
|
+
} catch {
|
|
240
|
+
// unparseable — leave activeVersion null
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Marker absent → stale
|
|
245
|
+
if (!fs.existsSync(markerFile)) {
|
|
246
|
+
return { present: true, vendoredVersion: null, activeVersion, stale: true, reason: 'marker-absent' };
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Read vendored version from marker
|
|
250
|
+
let vendoredVersion = null;
|
|
251
|
+
try {
|
|
252
|
+
const marker = JSON.parse(fs.readFileSync(markerFile, 'utf8'));
|
|
253
|
+
vendoredVersion = (marker && marker.version) ? marker.version : null;
|
|
254
|
+
} catch {
|
|
255
|
+
// unparseable marker → treat as marker-absent
|
|
256
|
+
return { present: true, vendoredVersion: null, activeVersion, stale: true, reason: 'marker-absent' };
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Version mismatch → stale
|
|
260
|
+
if (activeVersion && vendoredVersion && vendoredVersion !== activeVersion) {
|
|
261
|
+
return { present: true, vendoredVersion, activeVersion, stale: true, reason: 'version-mismatch' };
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return { present: true, vendoredVersion, activeVersion, stale: false, reason: 'ok' };
|
|
265
|
+
}
|
|
266
|
+
|
|
186
267
|
// ── Exports ────────────────────────────────────────────────────────────────────
|
|
187
268
|
|
|
188
|
-
module.exports = { checkNamespaces, validateManifest };
|
|
269
|
+
module.exports = { checkNamespaces, validateManifest, checkToolsVersion };
|
|
189
270
|
|
|
190
271
|
// ── CLI ────────────────────────────────────────────────────────────────────────
|
|
191
272
|
|
|
@@ -108,9 +108,23 @@ function resolveTaskDir(task, sprintDirPath, engPath) {
|
|
|
108
108
|
const normalizedTaskPath = task.path ? task.path.replace(/\\/g, '/').replace(/\/$/, '') : null;
|
|
109
109
|
const normalizedEngPath = engPath ? engPath.replace(/\\/g, '/').replace(/\/$/, '') : '';
|
|
110
110
|
|
|
111
|
-
// Case 1: path is under the engineering root — it IS
|
|
111
|
+
// Case 1: path is under the engineering root — it IS (or is a file inside)
|
|
112
|
+
// the task directory. Some store records carry task.path pointing at a file
|
|
113
|
+
// inside the task dir (e.g. .../FORGE-S22-T04/PLAN.md) rather than the dir
|
|
114
|
+
// itself; in that case basename(path) is the filename, not the dir. Only
|
|
115
|
+
// trust Case 1 when its candidate resolves to a real directory on disk —
|
|
116
|
+
// otherwise fall through to the filesystem scan, which resolves by taskId.
|
|
112
117
|
if (normalizedTaskPath && normalizedEngPath && normalizedTaskPath.startsWith(normalizedEngPath + '/')) {
|
|
113
|
-
|
|
118
|
+
const candidate = path.basename(normalizedTaskPath);
|
|
119
|
+
// Can't verify against disk — preserve legacy behaviour and trust the path.
|
|
120
|
+
if (!sprintDirPath) return resultOk(candidate);
|
|
121
|
+
const candidatePath = path.join(sprintDirPath, candidate);
|
|
122
|
+
// Trust Case 1 only when the candidate is a real directory. If it's a file
|
|
123
|
+
// (task.path pointed at a doc inside the dir) or absent, fall through to the
|
|
124
|
+
// filesystem scan below, which resolves the dir by taskId.
|
|
125
|
+
if (fs.existsSync(candidatePath) && fs.statSync(candidatePath).isDirectory()) {
|
|
126
|
+
return resultOk(candidate);
|
|
127
|
+
}
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
// Case 2 (and fallback for case 1 missing): filesystem scan
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// ── Canonical artifact-kind registry ─────────────────────────────────────────
|
|
4
|
+
//
|
|
5
|
+
// Single source of truth for artifact filenames, bug-mode filename overrides,
|
|
6
|
+
// and the phase→kind mapping. Extracted from artifact.cjs per ADR
|
|
7
|
+
// `doc/decisions/artifact-resolution-abstraction.md` (Phase 1) so that
|
|
8
|
+
// artifact.cjs, store-cli.cjs (set-summary / set-bug-summary), and the
|
|
9
|
+
// forge-cli `forge_artifact` surface all consume ONE catalog instead of
|
|
10
|
+
// maintaining parallel copies.
|
|
11
|
+
//
|
|
12
|
+
// Renaming an artifact file is a one-line edit here.
|
|
13
|
+
|
|
14
|
+
const ARTIFACT_CATALOG = {
|
|
15
|
+
'plan': { filename: 'PLAN.md', type: 'md' },
|
|
16
|
+
'plan-review': { filename: 'PLAN_REVIEW.md', type: 'md' },
|
|
17
|
+
'progress': { filename: 'PROGRESS.md', type: 'md' },
|
|
18
|
+
'code-review': { filename: 'CODE_REVIEW.md', type: 'md' },
|
|
19
|
+
'validation-report': { filename: 'VALIDATION_REPORT.md', type: 'md' },
|
|
20
|
+
'architect-approval': { filename: 'ARCHITECT_APPROVAL.md', type: 'md' },
|
|
21
|
+
'triage': { filename: 'TRIAGE.md', type: 'md' },
|
|
22
|
+
'bug-report': { filename: 'BUG_REPORT.md', type: 'md' },
|
|
23
|
+
'index': { filename: 'INDEX.md', type: 'md' },
|
|
24
|
+
'task-prompt': { filename: 'TASK_PROMPT.md', type: 'md' },
|
|
25
|
+
'sprint-requirements': { filename: 'SPRINT_REQUIREMENTS.md', type: 'md' },
|
|
26
|
+
'sprint-completion-review': { filename: 'SPRINT_COMPLETION_REVIEW.md', type: 'md' },
|
|
27
|
+
'cost-report': { filename: 'COST_REPORT.md', type: 'md' },
|
|
28
|
+
'timesheet': { filename: 'TIMESHEET.md', type: 'md' },
|
|
29
|
+
'plan-summary': { filename: 'PLAN-SUMMARY.json', type: 'json' },
|
|
30
|
+
'review-plan-summary': { filename: 'REVIEW-PLAN-SUMMARY.json', type: 'json' },
|
|
31
|
+
'implementation-summary': { filename: 'IMPLEMENTATION-SUMMARY.json', type: 'json' },
|
|
32
|
+
'review-code-summary': { filename: 'REVIEW-CODE-SUMMARY.json', type: 'json' },
|
|
33
|
+
'review-impl-summary': { filename: 'REVIEW-IMPL-SUMMARY.json', type: 'json' },
|
|
34
|
+
'validation-summary': { filename: 'VALIDATION-SUMMARY.json', type: 'json' },
|
|
35
|
+
'approve-summary': { filename: 'APPROVE-SUMMARY.json', type: 'json' },
|
|
36
|
+
'commit-summary': { filename: 'COMMIT-SUMMARY.json', type: 'json' },
|
|
37
|
+
'triage-summary': { filename: 'TRIAGE-SUMMARY.json', type: 'json' },
|
|
38
|
+
'writeback-summary': { filename: 'WRITEBACK-SUMMARY.json', type: 'json' },
|
|
39
|
+
'collation-summary': { filename: 'COLLATION-SUMMARY.json', type: 'json' },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Per-entity filename overrides. Bug-mode plans and plan-summaries use the
|
|
43
|
+
// BUG_FIX_PLAN prefix to match the long-standing forge convention and the
|
|
44
|
+
// preflight-gate.cjs expectations for review-plan in bug mode. Without this
|
|
45
|
+
// override, plan-fix (routed via plan_task.md post FORGE-BUG-040) writes
|
|
46
|
+
// PLAN.md and review-plan preflight then fails "artifact missing:
|
|
47
|
+
// BUG_FIX_PLAN.md" — see FORGE-BUG-041.
|
|
48
|
+
const ARTIFACT_FILENAME_OVERRIDES = {
|
|
49
|
+
bug: {
|
|
50
|
+
'plan': 'BUG_FIX_PLAN.md',
|
|
51
|
+
'plan-summary': 'BUG-FIX-PLAN-SUMMARY.json',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Phase → artifact-kind. Phases use underscore spellings (mirror of
|
|
56
|
+
// store-helpers VALID_SUMMARY_PHASES); kinds use the hyphenated catalog keys.
|
|
57
|
+
// This is the mapping set-summary / set-bug-summary use to self-resolve the
|
|
58
|
+
// sidecar JSON file from a record's path, so callers never hand-build paths.
|
|
59
|
+
const PHASE_TO_KIND = {
|
|
60
|
+
'plan': 'plan-summary',
|
|
61
|
+
'review_plan': 'review-plan-summary',
|
|
62
|
+
'implementation': 'implementation-summary',
|
|
63
|
+
'code_review': 'review-code-summary',
|
|
64
|
+
'validation': 'validation-summary',
|
|
65
|
+
'triage': 'triage-summary',
|
|
66
|
+
'approve': 'approve-summary',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
function resolveArtifactFilename(entity, artifactName) {
|
|
70
|
+
const override = ARTIFACT_FILENAME_OVERRIDES[entity];
|
|
71
|
+
if (override && override[artifactName]) return override[artifactName];
|
|
72
|
+
const entry = ARTIFACT_CATALOG[artifactName];
|
|
73
|
+
if (!entry) throw new Error(`unknown artifact kind: ${artifactName}`);
|
|
74
|
+
return entry.filename;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Resolve the phase-summary sidecar filename for an entity. Applies the
|
|
78
|
+
// phase→kind map, then the per-entity filename override (so a bug's "plan"
|
|
79
|
+
// summary becomes BUG-FIX-PLAN-SUMMARY.json).
|
|
80
|
+
function resolveSummaryFilename(entity, phase) {
|
|
81
|
+
const kind = PHASE_TO_KIND[phase];
|
|
82
|
+
if (!kind) throw new Error(`unknown phase: ${phase}`);
|
|
83
|
+
return resolveArtifactFilename(entity, kind);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const ARTIFACT_NAMES = Object.keys(ARTIFACT_CATALOG).sort();
|
|
87
|
+
|
|
88
|
+
module.exports = {
|
|
89
|
+
ARTIFACT_CATALOG,
|
|
90
|
+
ARTIFACT_FILENAME_OVERRIDES,
|
|
91
|
+
ARTIFACT_NAMES,
|
|
92
|
+
PHASE_TO_KIND,
|
|
93
|
+
resolveArtifactFilename,
|
|
94
|
+
resolveSummaryFilename,
|
|
95
|
+
};
|
|
@@ -99,6 +99,12 @@ function parseIntentNLP(intent) {
|
|
|
99
99
|
outer:
|
|
100
100
|
for (let i = 0; i < words.length; i++) {
|
|
101
101
|
if (consumed.has(i)) continue;
|
|
102
|
+
// "with <entity>" (and "<entity> for") are FK-follow directives handled in
|
|
103
|
+
// Stage 4 — they must NOT be treated as the primary entity. Otherwise an
|
|
104
|
+
// explicit anchored ID (e.g. "WI-S19-T04 with sprint with feature") loses
|
|
105
|
+
// its entity to the follow-word, its filter is stripped as invalid, and the
|
|
106
|
+
// query degrades into a full-store scan.
|
|
107
|
+
if (i > 0 && words[i - 1] === 'with') continue;
|
|
102
108
|
const w = words[i];
|
|
103
109
|
if (i + 1 < words.length) {
|
|
104
110
|
const bigram = w + ' ' + words[i + 1];
|
|
@@ -5,6 +5,14 @@ const path = require('path');
|
|
|
5
5
|
const { extractExcerpt, loadForgeConfig, findIndexPath } = require('./store-facade.cjs');
|
|
6
6
|
const { extractKeywordsFromIntent } = require('./store-nlp.cjs');
|
|
7
7
|
|
|
8
|
+
// Default safety cap for NLP listings without an explicit limit. Prevents an
|
|
9
|
+
// unbounded query from dumping the entire store into an LLM's context (a single
|
|
10
|
+
// uncapped query consumed ~28% of a plan run's input tokens — see
|
|
11
|
+
// doc/plans/store-query-nlp-response-shape-improvement.md). Callers that need
|
|
12
|
+
// everything use the exact `--sprint`/`--task` flag paths (which bypass this) or
|
|
13
|
+
// pass an explicit limit.
|
|
14
|
+
const DEFAULT_NLP_LIMIT = 25;
|
|
15
|
+
|
|
8
16
|
function escapeRe(s) {
|
|
9
17
|
return String(s).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
10
18
|
}
|
|
@@ -128,7 +136,7 @@ function executeQuery(plan, store, cfg) {
|
|
|
128
136
|
const trace = [];
|
|
129
137
|
const traverse = plan.traverse || plan;
|
|
130
138
|
const singMap = { bug: 'bugs', task: 'tasks', sprint: 'sprints', feature: 'features' };
|
|
131
|
-
|
|
139
|
+
let primary = singMap[traverse.primary] || traverse.primary || 'tasks';
|
|
132
140
|
let filter = { ...(traverse.filter || {}) };
|
|
133
141
|
const follow = traverse.follow || [];
|
|
134
142
|
const kwMatch = traverse.keywordMatch || {};
|
|
@@ -138,6 +146,7 @@ function executeQuery(plan, store, cfg) {
|
|
|
138
146
|
|
|
139
147
|
// Validate + strip invalid filters
|
|
140
148
|
const validation = validatePlan(plan);
|
|
149
|
+
const stripped = {};
|
|
141
150
|
if (validation.warnings.length > 0) {
|
|
142
151
|
const validators = buildFieldValidators();
|
|
143
152
|
const fields = validators[primary];
|
|
@@ -145,14 +154,17 @@ function executeQuery(plan, store, cfg) {
|
|
|
145
154
|
for (const key of Object.keys(filter)) {
|
|
146
155
|
if (!fields[key]) {
|
|
147
156
|
trace.push(`stripped invalid filter key: ${key}`);
|
|
157
|
+
stripped[key] = filter[key];
|
|
148
158
|
delete filter[key];
|
|
149
159
|
} else {
|
|
150
160
|
const spec = fields[key];
|
|
151
161
|
if (spec instanceof RegExp && !spec.test(String(filter[key]))) {
|
|
152
162
|
trace.push(`stripped filter ${key}="${filter[key]}" (value mismatch)`);
|
|
163
|
+
stripped[key] = filter[key];
|
|
153
164
|
delete filter[key];
|
|
154
165
|
} else if (Array.isArray(spec) && !spec.includes(String(filter[key]))) {
|
|
155
166
|
trace.push(`stripped filter ${key}="${filter[key]}" (not in enum)`);
|
|
167
|
+
stripped[key] = filter[key];
|
|
156
168
|
delete filter[key];
|
|
157
169
|
}
|
|
158
170
|
}
|
|
@@ -160,6 +172,21 @@ function executeQuery(plan, store, cfg) {
|
|
|
160
172
|
}
|
|
161
173
|
}
|
|
162
174
|
|
|
175
|
+
// Re-route on a stripped record-anchoring ID: an explicit taskId/bugId that
|
|
176
|
+
// was stripped because `primary` disagreed means the caller named a specific
|
|
177
|
+
// record. Honour it (re-route primary + restore the filter) instead of
|
|
178
|
+
// degrading into a full-collection scan. This is the engine-layer floor that
|
|
179
|
+
// backs up the parser fix in store-nlp.cjs.
|
|
180
|
+
const ID_ROUTE = { taskId: 'tasks', bugId: 'bugs' };
|
|
181
|
+
for (const idKey of Object.keys(ID_ROUTE)) {
|
|
182
|
+
if (stripped[idKey] !== undefined && primary !== ID_ROUTE[idKey]) {
|
|
183
|
+
trace.push(`re-routed primary ${primary} → ${ID_ROUTE[idKey]} (anchored ${idKey}="${stripped[idKey]}")`);
|
|
184
|
+
primary = ID_ROUTE[idKey];
|
|
185
|
+
filter[idKey] = stripped[idKey];
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
163
190
|
// List primary entities
|
|
164
191
|
let entities;
|
|
165
192
|
switch (primary) {
|
|
@@ -201,10 +228,16 @@ function executeQuery(plan, store, cfg) {
|
|
|
201
228
|
return { query: cfg.query || '', path: 'intent-nlp', traversalTrace: trace, count: totalMatched, results: [], relatedFileRefs: [], totalMatched };
|
|
202
229
|
}
|
|
203
230
|
|
|
204
|
-
// Limit
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
231
|
+
// Limit — honour an explicit limit; otherwise apply a default safety cap so an
|
|
232
|
+
// unbounded NLP listing never dumps the whole collection into the model's
|
|
233
|
+
// context. `truncated` + `totalMatched` let the caller detect and, if needed,
|
|
234
|
+
// re-query with an explicit limit or the exact-flag path.
|
|
235
|
+
const effectiveLimit = traverse.limit || DEFAULT_NLP_LIMIT;
|
|
236
|
+
let truncated = false;
|
|
237
|
+
if (entities.length > effectiveLimit) {
|
|
238
|
+
trace.push(`limited to ${effectiveLimit} (of ${totalMatched})${traverse.limit ? '' : ' [default cap]'}`);
|
|
239
|
+
entities = entities.slice(0, effectiveLimit);
|
|
240
|
+
truncated = true;
|
|
208
241
|
}
|
|
209
242
|
|
|
210
243
|
// Build results + follow FKs
|
|
@@ -263,6 +296,7 @@ function executeQuery(plan, store, cfg) {
|
|
|
263
296
|
results: allResults,
|
|
264
297
|
totalMatched,
|
|
265
298
|
returned: allResults.length,
|
|
299
|
+
truncated,
|
|
266
300
|
limit: traverse.limit || null,
|
|
267
301
|
sort: traverse.sort || null,
|
|
268
302
|
relatedFileRefs: [...new Set(relatedFiles)],
|
|
@@ -90,7 +90,8 @@ const DRIFT_MAP = {
|
|
|
90
90
|
'task-completed': ['task-committed'],
|
|
91
91
|
'implemented': ['implementing'],
|
|
92
92
|
'set': ['set-summary'],
|
|
93
|
-
'start': ['startTimestamp']
|
|
93
|
+
'start': ['startTimestamp'],
|
|
94
|
+
'create': ['write']
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
// ---------------------------------------------------------------------------
|
|
@@ -418,7 +418,7 @@ if (subcmd === 'resolve-forge-root') {
|
|
|
418
418
|
|
|
419
419
|
const { config } = readConfig();
|
|
420
420
|
const forgeRef = getByPath(config, 'paths.forgeRef');
|
|
421
|
-
|
|
421
|
+
// Note: paths.forgeRoot read removed in FORGE-S29-T03 (Priority 3 deprecated).
|
|
422
422
|
|
|
423
423
|
// Priority 2: Scan cache/marketplace directories by forgeRef
|
|
424
424
|
if (forgeRef && typeof forgeRef === 'string') {
|
|
@@ -442,14 +442,12 @@ if (subcmd === 'resolve-forge-root') {
|
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
// Priority 3
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
process.exit(0);
|
|
449
|
-
}
|
|
445
|
+
// Priority 3 (paths.forgeRoot fallback) removed — FORGE-S29-T03.
|
|
446
|
+
// paths.forgeRoot is deprecated and no longer used as a resolution fallback.
|
|
447
|
+
// Relying on it masks misconfigured projects and blocks the FORGE_ROOT retirement.
|
|
450
448
|
|
|
451
449
|
// No resolution possible
|
|
452
|
-
console.error('× Cannot resolve Forge plugin root: no CLAUDE_PLUGIN_ROOT env var
|
|
450
|
+
console.error('× Cannot resolve Forge plugin root: no CLAUDE_PLUGIN_ROOT env var and no forgeRef cache match. Run /forge:update to refresh.');
|
|
453
451
|
process.exit(1);
|
|
454
452
|
}
|
|
455
453
|
|
|
@@ -154,4 +154,76 @@ function parseAfter(rest, lineNo) {
|
|
|
154
154
|
return { phase: m[1], verdict };
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
// parseOutputs — same fence-scan logic as parseGates but for ```outputs phase=X blocks.
|
|
158
|
+
// Closed grammar: only `artifact` and `require` directives are allowed.
|
|
159
|
+
// Unknown directives throw (parity with parseGates).
|
|
160
|
+
const OUTPUTS_FENCE_OPEN = /^```outputs\s+phase=([A-Za-z0-9_-]+)\s*$/;
|
|
161
|
+
|
|
162
|
+
function parseOutputs(markdown) {
|
|
163
|
+
if (typeof markdown !== 'string' || markdown.length === 0) return {};
|
|
164
|
+
const lines = markdown.split('\n');
|
|
165
|
+
const result = {};
|
|
166
|
+
let currentPhase = null;
|
|
167
|
+
let inFence = false;
|
|
168
|
+
let fenceStartLine = -1;
|
|
169
|
+
let fenceBuffer = [];
|
|
170
|
+
for (let i = 0; i < lines.length; i++) {
|
|
171
|
+
const line = lines[i];
|
|
172
|
+
const lineNo = i + 1;
|
|
173
|
+
if (!inFence) {
|
|
174
|
+
const m = line.match(OUTPUTS_FENCE_OPEN);
|
|
175
|
+
if (m) {
|
|
176
|
+
currentPhase = m[1];
|
|
177
|
+
if (result[currentPhase]) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
`parse-gates: line ${lineNo}: duplicate outputs block for phase "${currentPhase}"`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
inFence = true;
|
|
183
|
+
fenceStartLine = lineNo;
|
|
184
|
+
fenceBuffer = [];
|
|
185
|
+
}
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
// Inside an outputs fence
|
|
189
|
+
if (FENCE_CLOSE.test(line)) {
|
|
190
|
+
result[currentPhase] = parseOutputsBlock(fenceBuffer, fenceStartLine);
|
|
191
|
+
inFence = false;
|
|
192
|
+
currentPhase = null;
|
|
193
|
+
fenceBuffer = [];
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
fenceBuffer.push({ text: line, lineNo });
|
|
197
|
+
}
|
|
198
|
+
if (inFence) {
|
|
199
|
+
throw new Error(`parse-gates: unterminated \`\`\`outputs fence opened at line ${fenceStartLine}`);
|
|
200
|
+
}
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function parseOutputsBlock(bufferedLines, _fenceStartLine) {
|
|
205
|
+
const spec = { artifacts: [], require: [] };
|
|
206
|
+
for (const { text, lineNo } of bufferedLines) {
|
|
207
|
+
const trimmed = text.trim();
|
|
208
|
+
if (trimmed === '' || trimmed.startsWith('#')) continue;
|
|
209
|
+
const firstSpace = trimmed.search(/\s/);
|
|
210
|
+
if (firstSpace < 0) {
|
|
211
|
+
throw new Error(`parse-gates: line ${lineNo}: malformed directive "${trimmed}"`);
|
|
212
|
+
}
|
|
213
|
+
const directive = trimmed.slice(0, firstSpace);
|
|
214
|
+
const rest = trimmed.slice(firstSpace + 1).trim();
|
|
215
|
+
switch (directive) {
|
|
216
|
+
case 'artifact':
|
|
217
|
+
spec.artifacts.push(parseArtifact(rest, lineNo));
|
|
218
|
+
break;
|
|
219
|
+
case 'require':
|
|
220
|
+
spec.require.push(parsePredicate(rest, lineNo));
|
|
221
|
+
break;
|
|
222
|
+
default:
|
|
223
|
+
throw new Error(`parse-gates: line ${lineNo}: unknown directive "${directive}"`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return spec;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
module.exports = { parseGates, parseOutputs };
|