@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mariozechner/clipboard",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"napi": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"url": "https://github.com/badlogic/clipboard.git"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@napi-rs/cli": "
|
|
26
|
+
"@napi-rs/cli": "3.7.0",
|
|
27
27
|
"ava": "^6.0.1"
|
|
28
28
|
},
|
|
29
29
|
"ava": {
|
|
@@ -36,13 +36,12 @@
|
|
|
36
36
|
"artifacts": "napi artifacts",
|
|
37
37
|
"build": "napi build --platform --release",
|
|
38
38
|
"build:debug": "napi build --platform",
|
|
39
|
-
"prepublishOnly": "napi
|
|
39
|
+
"prepublishOnly": "napi pre-publish -t npm",
|
|
40
40
|
"test": "ava",
|
|
41
|
-
"universal": "napi
|
|
41
|
+
"universal": "napi universalize -o artifacts",
|
|
42
42
|
"version": "napi version"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@mariozechner/clipboard-linux-x64-gnu": "0.3.
|
|
46
|
-
"@mariozechner/clipboard-linux-x64-musl": "0.3.6"
|
|
45
|
+
"@mariozechner/clipboard-linux-x64-gnu": "0.3.9"
|
|
47
46
|
}
|
|
48
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mariozechner/clipboard",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"napi": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"url": "https://github.com/badlogic/clipboard.git"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@napi-rs/cli": "
|
|
26
|
+
"@napi-rs/cli": "3.7.0",
|
|
27
27
|
"ava": "^6.0.1"
|
|
28
28
|
},
|
|
29
29
|
"ava": {
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
"artifacts": "napi artifacts",
|
|
37
37
|
"build": "napi build --platform --release",
|
|
38
38
|
"build:debug": "napi build --platform",
|
|
39
|
-
"prepublishOnly": "napi
|
|
39
|
+
"prepublishOnly": "napi pre-publish -t npm",
|
|
40
40
|
"test": "ava",
|
|
41
|
-
"universal": "napi
|
|
41
|
+
"universal": "napi universalize -o artifacts",
|
|
42
42
|
"version": "napi version"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@mariozechner/clipboard-darwin-arm64": "0.3.
|
|
46
|
-
"@mariozechner/clipboard-darwin-universal": "0.3.
|
|
47
|
-
"@mariozechner/clipboard-darwin-x64": "0.3.
|
|
48
|
-
"@mariozechner/clipboard-linux-arm64-gnu": "0.3.
|
|
49
|
-
"@mariozechner/clipboard-linux-arm64-musl": "0.3.
|
|
50
|
-
"@mariozechner/clipboard-linux-riscv64-gnu": "0.3.
|
|
51
|
-
"@mariozechner/clipboard-linux-x64-gnu": "0.3.
|
|
52
|
-
"@mariozechner/clipboard-linux-x64-musl": "0.3.
|
|
53
|
-
"@mariozechner/clipboard-win32-arm64-msvc": "0.3.
|
|
54
|
-
"@mariozechner/clipboard-win32-x64-msvc": "0.3.
|
|
45
|
+
"@mariozechner/clipboard-darwin-arm64": "0.3.9",
|
|
46
|
+
"@mariozechner/clipboard-darwin-universal": "0.3.9",
|
|
47
|
+
"@mariozechner/clipboard-darwin-x64": "0.3.9",
|
|
48
|
+
"@mariozechner/clipboard-linux-arm64-gnu": "0.3.9",
|
|
49
|
+
"@mariozechner/clipboard-linux-arm64-musl": "0.3.9",
|
|
50
|
+
"@mariozechner/clipboard-linux-riscv64-gnu": "0.3.9",
|
|
51
|
+
"@mariozechner/clipboard-linux-x64-gnu": "0.3.9",
|
|
52
|
+
"@mariozechner/clipboard-linux-x64-musl": "0.3.9",
|
|
53
|
+
"@mariozechner/clipboard-win32-arm64-msvc": "0.3.9",
|
|
54
|
+
"@mariozechner/clipboard-win32-x64-msvc": "0.3.9"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -9,10 +9,9 @@ use clipboard_rs::{
|
|
|
9
9
|
};
|
|
10
10
|
use napi::{
|
|
11
11
|
bindgen_prelude::*,
|
|
12
|
-
threadsafe_function::{
|
|
13
|
-
JsFunction,
|
|
12
|
+
threadsafe_function::{ThreadsafeFunction, ThreadsafeFunctionCallMode},
|
|
14
13
|
};
|
|
15
|
-
use std::{thread, time::Duration};
|
|
14
|
+
use std::{sync::Arc, thread, time::Duration};
|
|
16
15
|
|
|
17
16
|
#[macro_use]
|
|
18
17
|
extern crate napi_derive;
|
|
@@ -162,13 +161,9 @@ pub fn watch() {
|
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
#[napi]
|
|
165
|
-
pub fn call_threadsafe_function(callback:
|
|
166
|
-
let tsfn: ThreadsafeFunction<u32, ErrorStrategy::CalleeHandled> = callback
|
|
167
|
-
.create_threadsafe_function(0, |ctx| {
|
|
168
|
-
ctx.env.create_uint32(ctx.value + 1).map(|v| vec![v])
|
|
169
|
-
})?;
|
|
164
|
+
pub fn call_threadsafe_function(callback: Arc<ThreadsafeFunction<u32, ()>>) -> Result<()> {
|
|
170
165
|
for n in 0..10 {
|
|
171
|
-
let tsfn =
|
|
166
|
+
let tsfn = Arc::clone(&callback);
|
|
172
167
|
thread::spawn(move || {
|
|
173
168
|
tsfn.call(Ok(n), ThreadsafeFunctionCallMode::Blocking);
|
|
174
169
|
});
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entelligentsia/forgecli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Forge SDLC ported onto @earendil-works/pi-coding-agent \u2014 production launcher with three bin aliases (forge/forgecli/4ge). Bundles a curated fork of pi-coding-agent vendored under earendil-works names.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Entelligentsia",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"forge": {
|
|
52
|
-
"bundledVersion": "0.
|
|
52
|
+
"bundledVersion": "1.0.10",
|
|
53
53
|
"forgeRoot": "../forge/forge"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"js-yaml"
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@earendil-works/pi-agent-core": "file:./vendor-pi/earendil-works-pi-agent-core-0.
|
|
79
|
-
"@earendil-works/pi-ai": "file:./vendor-pi/earendil-works-pi-ai-0.
|
|
80
|
-
"@earendil-works/pi-coding-agent": "file:./vendor-pi/earendil-works-pi-coding-agent-0.
|
|
81
|
-
"@earendil-works/pi-tui": "file:./vendor-pi/earendil-works-pi-tui-0.
|
|
78
|
+
"@earendil-works/pi-agent-core": "file:./vendor-pi/earendil-works-pi-agent-core-0.78.0.tgz",
|
|
79
|
+
"@earendil-works/pi-ai": "file:./vendor-pi/earendil-works-pi-ai-0.78.0.tgz",
|
|
80
|
+
"@earendil-works/pi-coding-agent": "file:./vendor-pi/earendil-works-pi-coding-agent-0.78.0-forge.1.tgz",
|
|
81
|
+
"@earendil-works/pi-tui": "file:./vendor-pi/earendil-works-pi-tui-0.78.0.tgz",
|
|
82
82
|
"ajv": "^8.20.0",
|
|
83
83
|
"js-yaml": "^4.1.0",
|
|
84
84
|
"@entelligentsia/forge-compress": "file:../forge-compress",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"typebox": "^1.1.24"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
89
|
+
"@earendil-works/pi-coding-agent": "0.78.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@biomejs/biome": "^2.3.5",
|
package/dist/bin/forgecli.d.ts
DELETED
package/dist/bin/forgecli.js
DELETED
package/dist/bin/forgecli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forgecli.js","sourceRoot":"","sources":["../../src/bin/forgecli.ts"],"names":[],"mappings":";AACA,2EAA2E;AAE3E,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { createConfigTuiComponent, type ConfigTuiComponentOptions } from "./component.js";
|
|
2
|
-
export type { ConfigLayer } from "../config-writer.js";
|
|
3
|
-
export type { View, ConfigBuffer, AvailableModel, InitOptions, ConfigTuiState, ConfigTuiAction, PhaseOverride, ResolvedPersonaEntry, PersonaPickerEntry, PipelineOverrideSummary, TierAssignment, } from "./state/model.js";
|
|
4
|
-
export { CANONICAL_PHASES, initialState, reducer, getActiveView, listResolvedPersonas, listPersonaPickerEntries, uniqueProviders, listPipelineOverrideSummaries, getPhaseOverride, getTierAssignment, getAllTierAssignments, getTierForPersona, getPersonasInTier, writePersonaEntry, deletePersonaEntry, writePhaseOverride, clearPhaseOverride, writeTierAssignment, isConfigEmpty, personaSourceLabel, } from "./state.js";
|
|
5
|
-
export type { InputResult, Screen } from "./screens/types.js";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Config-TUI public re-exports.
|
|
2
|
-
// Phase 3: theming + width safety + data-driven menus + auth error surfacing.
|
|
3
|
-
export { createConfigTuiComponent } from "./component.js";
|
|
4
|
-
export { CANONICAL_PHASES, initialState, reducer, getActiveView, listResolvedPersonas, listPersonaPickerEntries, uniqueProviders, listPipelineOverrideSummaries, getPhaseOverride, getTierAssignment, getAllTierAssignments, getTierForPersona, getPersonasInTier, writePersonaEntry, deletePersonaEntry, writePhaseOverride, clearPhaseOverride, writeTierAssignment, isConfigEmpty, personaSourceLabel, } from "./state.js";
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/config-tui/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,8EAA8E;AAE9E,OAAO,EAAE,wBAAwB,EAAkC,MAAM,gBAAgB,CAAC;AAkB1F,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type Static, Type } from "typebox";
|
|
2
|
-
export declare const PersonaSchema: Type.TObject<{
|
|
3
|
-
name: Type.TString;
|
|
4
|
-
filePath: Type.TString;
|
|
5
|
-
identity: Type.TString;
|
|
6
|
-
body: Type.TString;
|
|
7
|
-
capabilities: Type.TArray<Type.TString>;
|
|
8
|
-
frontmatter: Type.TRecord<"^.*$", Type.TUnknown>;
|
|
9
|
-
}>;
|
|
10
|
-
export type Persona = Static<typeof PersonaSchema>;
|
|
11
|
-
export declare const SkillSchema: Type.TObject<{
|
|
12
|
-
name: Type.TString;
|
|
13
|
-
filePath: Type.TString;
|
|
14
|
-
body: Type.TString;
|
|
15
|
-
capabilities: Type.TArray<Type.TString>;
|
|
16
|
-
frontmatter: Type.TRecord<"^.*$", Type.TUnknown>;
|
|
17
|
-
}>;
|
|
18
|
-
export type Skill = Static<typeof SkillSchema>;
|
|
19
|
-
export type PersonaSkillLoaderErrorCode = "missing_file" | "invalid_frontmatter" | "path_traversal" | "no_project_root" | "validation_failed";
|
|
20
|
-
export declare class PersonaSkillLoaderError extends Error {
|
|
21
|
-
readonly code: PersonaSkillLoaderErrorCode;
|
|
22
|
-
constructor(code: PersonaSkillLoaderErrorCode, message: string);
|
|
23
|
-
}
|
|
24
|
-
export interface LoaderOptions {
|
|
25
|
-
/** Override project root (the directory containing `.forge/`). */
|
|
26
|
-
projectRoot?: string;
|
|
27
|
-
/** cwd to start `.forge/config.json` discovery from. Defaults to `process.cwd()`. */
|
|
28
|
-
cwd?: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Load a Persona record from `<projectRoot>/.forge/personas/<name>.md`.
|
|
32
|
-
*
|
|
33
|
-
* `name` is the filename stem (e.g. `"engineer"` for `engineer.md`). It must
|
|
34
|
-
* not contain path separators or traversal segments — invalid names raise
|
|
35
|
-
* `PersonaSkillLoaderError` with `code: "path_traversal"`.
|
|
36
|
-
*/
|
|
37
|
-
export declare function loadPersona(name: string, opts?: LoaderOptions): Persona;
|
|
38
|
-
/**
|
|
39
|
-
* Load a Skill record from `<projectRoot>/.forge/skills/<name>.md`.
|
|
40
|
-
*
|
|
41
|
-
* `name` is the filename stem. The Forge convention names skill files
|
|
42
|
-
* `<noun>-skills.md` (e.g. `engineer-skills.md`); callers pass the full stem
|
|
43
|
-
* including the `-skills` suffix. The loader does not auto-append it.
|
|
44
|
-
*/
|
|
45
|
-
export declare function loadSkill(name: string, opts?: LoaderOptions): Skill;
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
// Central persona/skill loader — FORGE-S20-T02.
|
|
2
|
-
//
|
|
3
|
-
// Single canonical surface for reading persona and skill markdown files from
|
|
4
|
-
// the user's `.forge/personas/` and `.forge/skills/` directories. Future
|
|
5
|
-
// kickoff handlers (T04 /forge:enhance, T05 /forge:plan, T06 /forge:implement)
|
|
6
|
-
// load typed Persona/Skill records through this module instead of issuing
|
|
7
|
-
// ad-hoc fs.readFile calls. The smoke gate locks the invariant in place.
|
|
8
|
-
//
|
|
9
|
-
// Path resolution anchors at the **project root** containing `.forge/`, not
|
|
10
|
-
// at `forgeRoot` (which points at the bundled plugin source — `.forge/personas/`
|
|
11
|
-
// is a project-local generated directory).
|
|
12
|
-
//
|
|
13
|
-
// Iron Law 6 (no shell-string interpolation): all I/O is via fs synchronous
|
|
14
|
-
// APIs with absolute paths constructed by `path.join`/`path.resolve`. No
|
|
15
|
-
// external process invocation.
|
|
16
|
-
// Iron Law 7 (no silent continuation): every failure mode raises a typed
|
|
17
|
-
// `PersonaSkillLoaderError` with an explicit `code`.
|
|
18
|
-
import * as fs from "node:fs";
|
|
19
|
-
import * as path from "node:path";
|
|
20
|
-
import { Type } from "typebox";
|
|
21
|
-
import { Value } from "typebox/value";
|
|
22
|
-
import { discoverForgeConfig } from "../forge-root.js";
|
|
23
|
-
// ── TypeBox schemas ──────────────────────────────────────────────────────
|
|
24
|
-
export const PersonaSchema = Type.Object({
|
|
25
|
-
name: Type.String(),
|
|
26
|
-
filePath: Type.String(),
|
|
27
|
-
identity: Type.String(),
|
|
28
|
-
body: Type.String(),
|
|
29
|
-
capabilities: Type.Array(Type.String()),
|
|
30
|
-
frontmatter: Type.Record(Type.String(), Type.Unknown()),
|
|
31
|
-
});
|
|
32
|
-
export const SkillSchema = Type.Object({
|
|
33
|
-
name: Type.String(),
|
|
34
|
-
filePath: Type.String(),
|
|
35
|
-
body: Type.String(),
|
|
36
|
-
capabilities: Type.Array(Type.String()),
|
|
37
|
-
frontmatter: Type.Record(Type.String(), Type.Unknown()),
|
|
38
|
-
});
|
|
39
|
-
export class PersonaSkillLoaderError extends Error {
|
|
40
|
-
code;
|
|
41
|
-
constructor(code, message) {
|
|
42
|
-
super(message);
|
|
43
|
-
this.name = "PersonaSkillLoaderError";
|
|
44
|
-
this.code = code;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// ── Project-root discovery ───────────────────────────────────────────────
|
|
48
|
-
function resolveProjectRoot(opts) {
|
|
49
|
-
if (opts?.projectRoot)
|
|
50
|
-
return opts.projectRoot;
|
|
51
|
-
const cwd = opts?.cwd ?? process.cwd();
|
|
52
|
-
const cfg = discoverForgeConfig(cwd);
|
|
53
|
-
if (!cfg) {
|
|
54
|
-
throw new PersonaSkillLoaderError("no_project_root", `No .forge/config.json found walking up from ${cwd}. ` +
|
|
55
|
-
"Run /forge:init to scaffold the project, or pass `projectRoot` explicitly.");
|
|
56
|
-
}
|
|
57
|
-
// configPath = <projectDir>/.forge/config.json → projectDir = parent of .forge/
|
|
58
|
-
return path.dirname(path.dirname(cfg.configPath));
|
|
59
|
-
}
|
|
60
|
-
// ── Name validation (defence in depth) ───────────────────────────────────
|
|
61
|
-
function validateName(name, kind) {
|
|
62
|
-
if (typeof name !== "string" || name.length === 0) {
|
|
63
|
-
throw new PersonaSkillLoaderError("path_traversal", `${kind} name must be a non-empty string`);
|
|
64
|
-
}
|
|
65
|
-
if (name.includes("/") || name.includes("\\") || name.includes("\0")) {
|
|
66
|
-
throw new PersonaSkillLoaderError("path_traversal", `${kind} name contains path separators: ${JSON.stringify(name)}`);
|
|
67
|
-
}
|
|
68
|
-
const parts = name.split(/[/\\]/);
|
|
69
|
-
for (const p of parts) {
|
|
70
|
-
if (p === ".." || p === "." || p === "") {
|
|
71
|
-
throw new PersonaSkillLoaderError("path_traversal", `${kind} name contains traversal segment: ${JSON.stringify(name)}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
// ── Realpath confinement check ───────────────────────────────────────────
|
|
76
|
-
function assertWithinDir(realFile, realDir, kind) {
|
|
77
|
-
const prefix = realDir.endsWith(path.sep) ? realDir : realDir + path.sep;
|
|
78
|
-
if (!realFile.startsWith(prefix)) {
|
|
79
|
-
throw new PersonaSkillLoaderError("path_traversal", `${kind} path escapes ${realDir}: resolved to ${realFile}`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function parseFrontmatter(content) {
|
|
83
|
-
// Normalise CRLF for line-based parsing while preserving body intact below.
|
|
84
|
-
const lines = content.split(/\r?\n/);
|
|
85
|
-
if (lines.length === 0 || lines[0] !== "---") {
|
|
86
|
-
return { frontmatter: {}, body: content };
|
|
87
|
-
}
|
|
88
|
-
const fm = {};
|
|
89
|
-
let i = 1;
|
|
90
|
-
let closed = false;
|
|
91
|
-
for (; i < lines.length; i++) {
|
|
92
|
-
const line = lines[i];
|
|
93
|
-
if (line === "---") {
|
|
94
|
-
closed = true;
|
|
95
|
-
i++;
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
// Allow blank lines inside frontmatter.
|
|
99
|
-
if (line.trim() === "")
|
|
100
|
-
continue;
|
|
101
|
-
const m = /^([A-Za-z0-9_.-]+):\s*(.*)$/.exec(line);
|
|
102
|
-
if (!m) {
|
|
103
|
-
throw new PersonaSkillLoaderError("invalid_frontmatter", `Malformed frontmatter line ${i + 1}: ${JSON.stringify(line)}`);
|
|
104
|
-
}
|
|
105
|
-
const value = m[2].trim();
|
|
106
|
-
// Strip matching surrounding quotes if present.
|
|
107
|
-
let parsed = value;
|
|
108
|
-
if ((value.startsWith('"') && value.endsWith('"') && value.length >= 2) ||
|
|
109
|
-
(value.startsWith("'") && value.endsWith("'") && value.length >= 2)) {
|
|
110
|
-
parsed = value.slice(1, -1);
|
|
111
|
-
}
|
|
112
|
-
fm[m[1]] = parsed;
|
|
113
|
-
}
|
|
114
|
-
if (!closed) {
|
|
115
|
-
throw new PersonaSkillLoaderError("invalid_frontmatter", "Frontmatter block opened with `---` but never closed");
|
|
116
|
-
}
|
|
117
|
-
const body = lines.slice(i).join("\n");
|
|
118
|
-
return { frontmatter: fm, body };
|
|
119
|
-
}
|
|
120
|
-
// ── Capability + identity extraction ─────────────────────────────────────
|
|
121
|
-
function extractCapabilities(body) {
|
|
122
|
-
const lines = body.split(/\r?\n/);
|
|
123
|
-
const heading = /^##\s+Capabilities\s*$/;
|
|
124
|
-
const nextSection = /^##\s+\S/;
|
|
125
|
-
const bullet = /^[-*]\s+(.+)$/;
|
|
126
|
-
const out = [];
|
|
127
|
-
let inSection = false;
|
|
128
|
-
for (const line of lines) {
|
|
129
|
-
if (!inSection) {
|
|
130
|
-
if (heading.test(line))
|
|
131
|
-
inSection = true;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (nextSection.test(line))
|
|
135
|
-
break;
|
|
136
|
-
const m = bullet.exec(line);
|
|
137
|
-
if (m)
|
|
138
|
-
out.push(m[1].trim());
|
|
139
|
-
}
|
|
140
|
-
return out;
|
|
141
|
-
}
|
|
142
|
-
function extractIdentity(body) {
|
|
143
|
-
for (const line of body.split(/\r?\n/)) {
|
|
144
|
-
if (line.trim().length > 0)
|
|
145
|
-
return line.trim();
|
|
146
|
-
}
|
|
147
|
-
return "";
|
|
148
|
-
}
|
|
149
|
-
// ── Internal generic load ────────────────────────────────────────────────
|
|
150
|
-
function loadFile(kind, subdir, name, opts) {
|
|
151
|
-
validateName(name, kind);
|
|
152
|
-
const projectRoot = resolveProjectRoot(opts);
|
|
153
|
-
const baseDir = path.join(projectRoot, ".forge", subdir);
|
|
154
|
-
const candidate = path.join(baseDir, `${name}.md`);
|
|
155
|
-
// Realpath the *directory* first — it must exist for confinement check.
|
|
156
|
-
let realDir;
|
|
157
|
-
try {
|
|
158
|
-
realDir = fs.realpathSync(baseDir);
|
|
159
|
-
}
|
|
160
|
-
catch {
|
|
161
|
-
throw new PersonaSkillLoaderError("missing_file", `${kind} directory does not exist: ${baseDir}`);
|
|
162
|
-
}
|
|
163
|
-
let realFile;
|
|
164
|
-
try {
|
|
165
|
-
realFile = fs.realpathSync(candidate);
|
|
166
|
-
}
|
|
167
|
-
catch {
|
|
168
|
-
throw new PersonaSkillLoaderError("missing_file", `${kind} file not found: ${candidate}`);
|
|
169
|
-
}
|
|
170
|
-
assertWithinDir(realFile, realDir, kind);
|
|
171
|
-
let raw;
|
|
172
|
-
try {
|
|
173
|
-
raw = fs.readFileSync(realFile, "utf8");
|
|
174
|
-
}
|
|
175
|
-
catch (err) {
|
|
176
|
-
const e = err;
|
|
177
|
-
throw new PersonaSkillLoaderError("missing_file", `Failed to read ${kind} file ${realFile}: ${e.message ?? "unknown"}`);
|
|
178
|
-
}
|
|
179
|
-
return { filePath: realFile, doc: parseFrontmatter(raw) };
|
|
180
|
-
}
|
|
181
|
-
// ── Public API ───────────────────────────────────────────────────────────
|
|
182
|
-
/**
|
|
183
|
-
* Load a Persona record from `<projectRoot>/.forge/personas/<name>.md`.
|
|
184
|
-
*
|
|
185
|
-
* `name` is the filename stem (e.g. `"engineer"` for `engineer.md`). It must
|
|
186
|
-
* not contain path separators or traversal segments — invalid names raise
|
|
187
|
-
* `PersonaSkillLoaderError` with `code: "path_traversal"`.
|
|
188
|
-
*/
|
|
189
|
-
export function loadPersona(name, opts) {
|
|
190
|
-
const { filePath, doc } = loadFile("persona", "personas", name, opts);
|
|
191
|
-
const persona = {
|
|
192
|
-
name,
|
|
193
|
-
filePath,
|
|
194
|
-
identity: extractIdentity(doc.body),
|
|
195
|
-
body: doc.body,
|
|
196
|
-
capabilities: extractCapabilities(doc.body),
|
|
197
|
-
frontmatter: doc.frontmatter,
|
|
198
|
-
};
|
|
199
|
-
if (!Value.Check(PersonaSchema, persona)) {
|
|
200
|
-
const errs = [...Value.Errors(PersonaSchema, persona)].map((e) => e.message);
|
|
201
|
-
throw new PersonaSkillLoaderError("validation_failed", `Persona ${name} failed schema validation: ${errs.join("; ")}`);
|
|
202
|
-
}
|
|
203
|
-
return persona;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Load a Skill record from `<projectRoot>/.forge/skills/<name>.md`.
|
|
207
|
-
*
|
|
208
|
-
* `name` is the filename stem. The Forge convention names skill files
|
|
209
|
-
* `<noun>-skills.md` (e.g. `engineer-skills.md`); callers pass the full stem
|
|
210
|
-
* including the `-skills` suffix. The loader does not auto-append it.
|
|
211
|
-
*/
|
|
212
|
-
export function loadSkill(name, opts) {
|
|
213
|
-
const { filePath, doc } = loadFile("skill", "skills", name, opts);
|
|
214
|
-
const skill = {
|
|
215
|
-
name,
|
|
216
|
-
filePath,
|
|
217
|
-
body: doc.body,
|
|
218
|
-
capabilities: extractCapabilities(doc.body),
|
|
219
|
-
frontmatter: doc.frontmatter,
|
|
220
|
-
};
|
|
221
|
-
if (!Value.Check(SkillSchema, skill)) {
|
|
222
|
-
const errs = [...Value.Errors(SkillSchema, skill)].map((e) => e.message);
|
|
223
|
-
throw new PersonaSkillLoaderError("validation_failed", `Skill ${name} failed schema validation: ${errs.join("; ")}`);
|
|
224
|
-
}
|
|
225
|
-
return skill;
|
|
226
|
-
}
|
|
227
|
-
//# sourceMappingURL=persona-skill-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persona-skill-loader.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/loaders/persona-skill-loader.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,+EAA+E;AAC/E,0EAA0E;AAC1E,yEAAyE;AACzE,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,2CAA2C;AAC3C,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,+BAA+B;AAC/B,yEAAyE;AACzE,qDAAqD;AAErD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,4EAA4E;AAE5E,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;CACvD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,IAAI,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C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,KAAK,GAAU;QACpB,IAAI;QACJ,QAAQ;QACR,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC;QAC3C,WAAW,EAAE,GAAG,CAAC,WAAW;KAC5B,CAAC;IACF,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACzE,MAAM,IAAI,uBAAuB,CAChC,mBAAmB,EACnB,SAAS,IAAI,8BAA8B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC5D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type TemplateRenderErrorCode = "missing_template_file" | "missing_var" | "invalid_args";
|
|
2
|
-
export declare class TemplateRenderError extends Error {
|
|
3
|
-
readonly code: TemplateRenderErrorCode;
|
|
4
|
-
constructor(code: TemplateRenderErrorCode, message: string);
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Render a template file by substituting `{NAME}` tokens with values from `vars`.
|
|
8
|
-
*
|
|
9
|
-
* @param templatePath Absolute or cwd-relative path to a UTF-8 template file.
|
|
10
|
-
* @param vars Map from identifier name to substitution value (string).
|
|
11
|
-
* @returns The rendered template as a string.
|
|
12
|
-
*
|
|
13
|
-
* @throws TemplateRenderError({ code: "missing_template_file" }) if the file
|
|
14
|
-
* does not exist or cannot be read.
|
|
15
|
-
* @throws TemplateRenderError({ code: "missing_var" }) if the template
|
|
16
|
-
* references a token whose name is not a key in `vars`.
|
|
17
|
-
* @throws TemplateRenderError({ code: "invalid_args" }) if `templatePath` is
|
|
18
|
-
* not a non-empty string or any value in `vars` is not a string.
|
|
19
|
-
*/
|
|
20
|
-
export declare function renderTemplate(templatePath: string, vars: Record<string, string>): string;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// Shared template-render helper — FORGE-S20-T03.
|
|
2
|
-
//
|
|
3
|
-
// Tiny, dependency-free `{NAME}` substitution helper used by kickoff-message
|
|
4
|
-
// composition in forge-cli command handlers (T05 /forge:plan, T06
|
|
5
|
-
// /forge:implement, and any future kickoff shim that needs argv-driven seed
|
|
6
|
-
// substitution).
|
|
7
|
-
//
|
|
8
|
-
// API:
|
|
9
|
-
// renderTemplate(templatePath: string, vars: Record<string, string>): string
|
|
10
|
-
//
|
|
11
|
-
// Substitution rule (frozen):
|
|
12
|
-
// - Token syntax: `{NAME}` where NAME matches /[A-Za-z_][A-Za-z0-9_]*/.
|
|
13
|
-
// Anything else — `{}`, `{ NAME }`, `{1NAME}`, `{lowercase-dashed}` — is
|
|
14
|
-
// a literal and passes through unchanged.
|
|
15
|
-
// - Missing var (token in template, key absent from `vars`): throws
|
|
16
|
-
// TemplateRenderError("missing_var", ...). Never silently renders "".
|
|
17
|
-
// (Iron Law 7: no silent continuation.)
|
|
18
|
-
// - Extra vars (key in `vars` not referenced in template): ignored.
|
|
19
|
-
// - Values are inserted literally — no HTML/regex escaping. Callers handle
|
|
20
|
-
// downstream sanitisation.
|
|
21
|
-
// - Missing template file: throws TemplateRenderError("missing_template_file", ...).
|
|
22
|
-
//
|
|
23
|
-
// Iron Law 6 (no shell-string interpolation): pure fs.readFileSync, no
|
|
24
|
-
// child_process. Iron Law 7 (no silent continuation): every failure mode
|
|
25
|
-
// raises a typed TemplateRenderError with an explicit code.
|
|
26
|
-
import * as fs from "node:fs";
|
|
27
|
-
export class TemplateRenderError extends Error {
|
|
28
|
-
code;
|
|
29
|
-
constructor(code, message) {
|
|
30
|
-
super(message);
|
|
31
|
-
this.name = "TemplateRenderError";
|
|
32
|
-
this.code = code;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// ── Token grammar ────────────────────────────────────────────────────────
|
|
36
|
-
//
|
|
37
|
-
// Single regex, global, captures the bare identifier. Anchored on `{` and `}`
|
|
38
|
-
// with no whitespace tolerance — `{ NAME }` is a literal, by design.
|
|
39
|
-
const TOKEN_RE = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
40
|
-
// ── Internal: substitute over an in-memory string ────────────────────────
|
|
41
|
-
function substitute(template, vars) {
|
|
42
|
-
return template.replace(TOKEN_RE, (_match, name) => {
|
|
43
|
-
if (!Object.hasOwn(vars, name)) {
|
|
44
|
-
throw new TemplateRenderError("missing_var", `template references {${name}} but no value was supplied in vars`);
|
|
45
|
-
}
|
|
46
|
-
const value = vars[name];
|
|
47
|
-
if (typeof value !== "string") {
|
|
48
|
-
throw new TemplateRenderError("invalid_args", `vars[${JSON.stringify(name)}] must be a string, got ${typeof value}`);
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
// ── Public API ───────────────────────────────────────────────────────────
|
|
54
|
-
/**
|
|
55
|
-
* Render a template file by substituting `{NAME}` tokens with values from `vars`.
|
|
56
|
-
*
|
|
57
|
-
* @param templatePath Absolute or cwd-relative path to a UTF-8 template file.
|
|
58
|
-
* @param vars Map from identifier name to substitution value (string).
|
|
59
|
-
* @returns The rendered template as a string.
|
|
60
|
-
*
|
|
61
|
-
* @throws TemplateRenderError({ code: "missing_template_file" }) if the file
|
|
62
|
-
* does not exist or cannot be read.
|
|
63
|
-
* @throws TemplateRenderError({ code: "missing_var" }) if the template
|
|
64
|
-
* references a token whose name is not a key in `vars`.
|
|
65
|
-
* @throws TemplateRenderError({ code: "invalid_args" }) if `templatePath` is
|
|
66
|
-
* not a non-empty string or any value in `vars` is not a string.
|
|
67
|
-
*/
|
|
68
|
-
export function renderTemplate(templatePath, vars) {
|
|
69
|
-
if (typeof templatePath !== "string" || templatePath.length === 0) {
|
|
70
|
-
throw new TemplateRenderError("invalid_args", "templatePath must be a non-empty string");
|
|
71
|
-
}
|
|
72
|
-
if (vars === null || typeof vars !== "object") {
|
|
73
|
-
throw new TemplateRenderError("invalid_args", "vars must be an object");
|
|
74
|
-
}
|
|
75
|
-
let raw;
|
|
76
|
-
try {
|
|
77
|
-
raw = fs.readFileSync(templatePath, "utf8");
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
const e = err;
|
|
81
|
-
throw new TemplateRenderError("missing_template_file", `failed to read template at ${templatePath}: ${e.code ?? ""} ${e.message ?? "unknown error"}`.trim());
|
|
82
|
-
}
|
|
83
|
-
return substitute(raw, vars);
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=template-render.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-render.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/loaders/template-render.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,6EAA6E;AAC7E,kEAAkE;AAClE,4EAA4E;AAC5E,iBAAiB;AACjB,EAAE;AACF,OAAO;AACP,+EAA+E;AAC/E,EAAE;AACF,8BAA8B;AAC9B,0EAA0E;AAC1E,6EAA6E;AAC7E,8CAA8C;AAC9C,sEAAsE;AACtE,0EAA0E;AAC1E,4CAA4C;AAC5C,sEAAsE;AACtE,6EAA6E;AAC7E,+BAA+B;AAC/B,uFAAuF;AACvF,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,4DAA4D;AAE5D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAM9B,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC7B,IAAI,CAA0B;IAC9C,YAAY,IAA6B,EAAE,OAAe;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG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