@specforge/cli 0.1.0 → 0.2.5
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/dist/cli/commands/debug/register.js +1 -1
- package/dist/cli/commands/debug/register.js.map +1 -1
- package/dist/cli/commands/debug/types.d.ts.map +1 -1
- package/dist/cli/commands/debug/types.js +4 -2
- package/dist/cli/commands/debug/types.js.map +1 -1
- package/dist/cli/commands/init.types.d.ts +4 -4
- package/dist/cli/commands/init.types.d.ts.map +1 -1
- package/dist/cli/commands/init.types.js.map +1 -1
- package/dist/cli/commands/scaffold/agent-types.js +1 -1
- package/dist/cli/commands/scaffold/agent-types.js.map +1 -1
- package/dist/cli/config/agent-teams.types.d.ts +35 -12
- package/dist/cli/config/agent-teams.types.d.ts.map +1 -1
- package/dist/cli/config/agent-teams.types.js.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-orchestrator.d.ts +21 -3
- package/dist/cli/templates/agents/content/core/sfag-orchestrator.d.ts.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-orchestrator.js +114 -48
- package/dist/cli/templates/agents/content/core/sfag-orchestrator.js.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-spec-creator.d.ts.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-spec-creator.js +124 -83
- package/dist/cli/templates/agents/content/core/sfag-spec-creator.js.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.d.ts +22 -3
- package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.d.ts.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.js +225 -160
- package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.js.map +1 -1
- package/dist/cli/templates/agents/content/core/sfag-work-resolver.d.ts +16 -0
- package/dist/cli/templates/agents/content/core/sfag-work-resolver.d.ts.map +1 -0
- package/dist/cli/templates/agents/content/core/sfag-work-resolver.js +199 -0
- package/dist/cli/templates/agents/content/core/sfag-work-resolver.js.map +1 -0
- package/dist/cli/templates/agents/index.d.ts.map +1 -1
- package/dist/cli/templates/agents/index.js +2 -0
- package/dist/cli/templates/agents/index.js.map +1 -1
- package/dist/cli/templates/content/sf-commit.d.ts +1 -1
- package/dist/cli/templates/content/sf-commit.d.ts.map +1 -1
- package/dist/cli/templates/content/sf-commit.js +2 -2
- package/dist/cli/templates/content/sf-commit.js.map +1 -1
- package/dist/cli/templates/content/sf-reset.d.ts +5 -2
- package/dist/cli/templates/content/sf-reset.d.ts.map +1 -1
- package/dist/cli/templates/content/sf-reset.js +41 -27
- package/dist/cli/templates/content/sf-reset.js.map +1 -1
- package/dist/lib/prompt-generator.d.ts +15 -3
- package/dist/lib/prompt-generator.d.ts.map +1 -1
- package/dist/lib/prompt-generator.js +14 -6
- package/dist/lib/prompt-generator.js.map +1 -1
- package/dist/lib/workflow-definitions.js +2 -2
- package/dist/lib/workflow-definitions.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/__tests__/complete-planning-double-call.test.d.ts +2 -0
- package/dist/tools/__tests__/complete-planning-double-call.test.d.ts.map +1 -0
- package/dist/tools/core/__tests__/file-existence-injection.test.d.ts +2 -0
- package/dist/tools/core/__tests__/file-existence-injection.test.d.ts.map +1 -0
- package/dist/tools/core/__tests__/git-injection.test.d.ts +2 -0
- package/dist/tools/core/__tests__/git-injection.test.d.ts.map +1 -0
- package/dist/tools/core/file-existence-injection.d.ts +22 -0
- package/dist/tools/core/file-existence-injection.d.ts.map +1 -0
- package/dist/tools/core/file-existence-injection.js +49 -0
- package/dist/tools/core/file-existence-injection.js.map +1 -0
- package/dist/tools/core/git-injection.d.ts +58 -0
- package/dist/tools/core/git-injection.d.ts.map +1 -0
- package/dist/tools/core/git-injection.js +79 -0
- package/dist/tools/core/git-injection.js.map +1 -0
- package/dist/tools/core/index.d.ts +1 -0
- package/dist/tools/core/index.d.ts.map +1 -1
- package/dist/tools/core/index.js +1 -0
- package/dist/tools/core/index.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +358 -440
- package/dist/tools/index.js.map +1 -1
- package/dist/transport/__tests__/remote.test.d.ts +2 -0
- package/dist/transport/__tests__/remote.test.d.ts.map +1 -0
- package/dist/transport/remote.d.ts.map +1 -1
- package/dist/transport/remote.js +23 -4
- package/dist/transport/remote.js.map +1 -1
- package/dist/types/index.d.ts +12 -32
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +0 -15
- package/dist/validation/index.js.map +1 -1
- package/node_modules/@specforge/api-types/README.md +38 -0
- package/node_modules/@specforge/api-types/dist/client/appsync-client.d.ts +21 -0
- package/node_modules/@specforge/api-types/dist/client/appsync-client.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/client/appsync-client.js +2 -0
- package/node_modules/@specforge/api-types/dist/client/appsync-client.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/client/index.d.ts +2 -0
- package/node_modules/@specforge/api-types/dist/client/index.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/client/index.js +2 -0
- package/node_modules/@specforge/api-types/dist/client/index.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/index.d.ts +5 -0
- package/node_modules/@specforge/api-types/dist/index.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/index.js +9 -0
- package/node_modules/@specforge/api-types/dist/index.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/error-guidance.d.ts +74 -0
- package/node_modules/@specforge/api-types/dist/mcp/error-guidance.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/error-guidance.js +21 -0
- package/node_modules/@specforge/api-types/dist/mcp/error-guidance.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/index.d.ts +4 -0
- package/node_modules/@specforge/api-types/dist/mcp/index.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/index.js +8 -0
- package/node_modules/@specforge/api-types/dist/mcp/index.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/lifecycle-envelope.d.ts +18 -0
- package/node_modules/@specforge/api-types/dist/mcp/lifecycle-envelope.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/lifecycle-envelope.js +2 -0
- package/node_modules/@specforge/api-types/dist/mcp/lifecycle-envelope.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/standard-envelope.d.ts +39 -0
- package/node_modules/@specforge/api-types/dist/mcp/standard-envelope.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/mcp/standard-envelope.js +2 -0
- package/node_modules/@specforge/api-types/dist/mcp/standard-envelope.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/billing-record.d.ts +18 -0
- package/node_modules/@specforge/api-types/dist/runtime/billing-record.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/billing-record.js +7 -0
- package/node_modules/@specforge/api-types/dist/runtime/billing-record.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/blueprint-record.d.ts +40 -0
- package/node_modules/@specforge/api-types/dist/runtime/blueprint-record.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/blueprint-record.js +19 -0
- package/node_modules/@specforge/api-types/dist/runtime/blueprint-record.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/dependency-tree.d.ts +96 -0
- package/node_modules/@specforge/api-types/dist/runtime/dependency-tree.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/dependency-tree.js +23 -0
- package/node_modules/@specforge/api-types/dist/runtime/dependency-tree.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/epic-record.d.ts +117 -0
- package/node_modules/@specforge/api-types/dist/runtime/epic-record.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/epic-record.js +13 -0
- package/node_modules/@specforge/api-types/dist/runtime/epic-record.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/feedback-record.d.ts +27 -0
- package/node_modules/@specforge/api-types/dist/runtime/feedback-record.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/feedback-record.js +7 -0
- package/node_modules/@specforge/api-types/dist/runtime/feedback-record.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/fields.d.ts +31 -0
- package/node_modules/@specforge/api-types/dist/runtime/fields.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/fields.js +156 -0
- package/node_modules/@specforge/api-types/dist/runtime/fields.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/index.d.ts +18 -0
- package/node_modules/@specforge/api-types/dist/runtime/index.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/index.js +18 -0
- package/node_modules/@specforge/api-types/dist/runtime/index.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/pagination.d.ts +38 -0
- package/node_modules/@specforge/api-types/dist/runtime/pagination.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/pagination.js +54 -0
- package/node_modules/@specforge/api-types/dist/runtime/pagination.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-invitation.d.ts +14 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-invitation.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-invitation.js +2 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-invitation.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-member.d.ts +13 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-member.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-member.js +2 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-member.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-validation.d.ts +26 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-validation.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-validation.js +5 -0
- package/node_modules/@specforge/api-types/dist/runtime/project-validation.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project.d.ts +55 -0
- package/node_modules/@specforge/api-types/dist/runtime/project.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/project.js +10 -0
- package/node_modules/@specforge/api-types/dist/runtime/project.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/response.d.ts +22 -0
- package/node_modules/@specforge/api-types/dist/runtime/response.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/response.js +14 -0
- package/node_modules/@specforge/api-types/dist/runtime/response.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/specification-record.d.ts +90 -0
- package/node_modules/@specforge/api-types/dist/runtime/specification-record.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/specification-record.js +11 -0
- package/node_modules/@specforge/api-types/dist/runtime/specification-record.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/status.d.ts +26 -0
- package/node_modules/@specforge/api-types/dist/runtime/status.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/status.js +56 -0
- package/node_modules/@specforge/api-types/dist/runtime/status.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/summary.d.ts +58 -0
- package/node_modules/@specforge/api-types/dist/runtime/summary.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/summary.js +42 -0
- package/node_modules/@specforge/api-types/dist/runtime/summary.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/ticket-record.d.ts +212 -0
- package/node_modules/@specforge/api-types/dist/runtime/ticket-record.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/ticket-record.js +18 -0
- package/node_modules/@specforge/api-types/dist/runtime/ticket-record.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/user.d.ts +13 -0
- package/node_modules/@specforge/api-types/dist/runtime/user.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/runtime/user.js +9 -0
- package/node_modules/@specforge/api-types/dist/runtime/user.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-billing-store.d.ts +17 -0
- package/node_modules/@specforge/api-types/dist/stores/i-billing-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-billing-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-billing-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-blueprint-store.d.ts +59 -0
- package/node_modules/@specforge/api-types/dist/stores/i-blueprint-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-blueprint-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-blueprint-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-epic-store.d.ts +120 -0
- package/node_modules/@specforge/api-types/dist/stores/i-epic-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-epic-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-epic-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-feedback-store.d.ts +13 -0
- package/node_modules/@specforge/api-types/dist/stores/i-feedback-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-feedback-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-feedback-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-project-store.d.ts +48 -0
- package/node_modules/@specforge/api-types/dist/stores/i-project-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-project-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-project-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-sharing-store.d.ts +37 -0
- package/node_modules/@specforge/api-types/dist/stores/i-sharing-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-sharing-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-sharing-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-spec-store.d.ts +159 -0
- package/node_modules/@specforge/api-types/dist/stores/i-spec-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-spec-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-spec-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-dependency-store.d.ts +87 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-dependency-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-dependency-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-dependency-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-store.d.ts +347 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-ticket-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-user-store.d.ts +5 -0
- package/node_modules/@specforge/api-types/dist/stores/i-user-store.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/i-user-store.js +2 -0
- package/node_modules/@specforge/api-types/dist/stores/i-user-store.js.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/index.d.ts +11 -0
- package/node_modules/@specforge/api-types/dist/stores/index.d.ts.map +1 -0
- package/node_modules/@specforge/api-types/dist/stores/index.js +11 -0
- package/node_modules/@specforge/api-types/dist/stores/index.js.map +1 -0
- package/node_modules/@specforge/api-types/package.json +43 -0
- package/node_modules/@specforge/report-types/README.md +11 -0
- package/node_modules/@specforge/report-types/dist/index.d.ts +2 -0
- package/node_modules/@specforge/report-types/dist/index.d.ts.map +1 -0
- package/node_modules/@specforge/report-types/dist/index.js +2 -0
- package/node_modules/@specforge/report-types/dist/index.js.map +1 -0
- package/node_modules/@specforge/report-types/dist/reports.d.ts +90 -0
- package/node_modules/@specforge/report-types/dist/reports.d.ts.map +1 -0
- package/node_modules/@specforge/report-types/dist/reports.js +15 -0
- package/node_modules/@specforge/report-types/dist/reports.js.map +1 -0
- package/node_modules/@specforge/report-types/package.json +40 -0
- package/node_modules/@specforge/session-types/CHANGELOG.md +56 -0
- package/node_modules/@specforge/session-types/README.md +18 -0
- package/node_modules/@specforge/session-types/dist/index.d.ts +47 -0
- package/node_modules/@specforge/session-types/dist/index.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/index.js +47 -0
- package/node_modules/@specforge/session-types/dist/index.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/aggregator-input.d.ts +46 -0
- package/node_modules/@specforge/session-types/dist/runtime/aggregator-input.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/aggregator-input.js +41 -0
- package/node_modules/@specforge/session-types/dist/runtime/aggregator-input.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/discovery.d.ts +9 -0
- package/node_modules/@specforge/session-types/dist/runtime/discovery.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/discovery.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/discovery.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/enums.d.ts +51 -0
- package/node_modules/@specforge/session-types/dist/runtime/enums.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/enums.js +161 -0
- package/node_modules/@specforge/session-types/dist/runtime/enums.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-config.d.ts +177 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-config.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-config.js +96 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-config.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-record-event.d.ts +8 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-record-event.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-record-event.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-record-event.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session-aggregate.d.ts +489 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session-aggregate.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session-aggregate.js +152 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session-aggregate.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session.d.ts +8 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/implementation-session.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-contract.d.ts +319 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-contract.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-contract.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-contract.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-planning-guidance.d.ts +128 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-planning-guidance.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-planning-guidance.js +30 -0
- package/node_modules/@specforge/session-types/dist/runtime/lifecycle-planning-guidance.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/parsed-git-evidence.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/parsed-git-evidence.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/parsed-git-evidence.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/parsed-git-evidence.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-config.d.ts +82 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-config.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-config.js +61 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-config.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-entity-score-datapoint.d.ts +34 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-entity-score-datapoint.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-entity-score-datapoint.js +14 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-entity-score-datapoint.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-operations.d.ts +6 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-operations.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-operations.js +65 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-operations.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-phase-transition.d.ts +34 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-phase-transition.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-phase-transition.js +22 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-phase-transition.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-action.d.ts +73 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-action.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-action.js +61 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-action.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-aggregate.d.ts +249 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-aggregate.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-aggregate.js +96 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session-aggregate.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session.d.ts +574 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session.js +40 -0
- package/node_modules/@specforge/session-types/dist/runtime/planning-session.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/process-guidance.d.ts +221 -0
- package/node_modules/@specforge/session-types/dist/runtime/process-guidance.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/process-guidance.js +41 -0
- package/node_modules/@specforge/session-types/dist/runtime/process-guidance.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-acceptance-check.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-acceptance-check.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-acceptance-check.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-acceptance-check.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-action.d.ts +9 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-action.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-action.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-action.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-file-change.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-file-change.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-file-change.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-file-change.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-impl-step-completion.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-impl-step-completion.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-impl-step-completion.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-impl-step-completion.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-resolution.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-resolution.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-resolution.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-resolution.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-test-result.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-test-result.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-test-result.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session-test-result.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session.d.ts +4 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/work-session.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/working-context.d.ts +43 -0
- package/node_modules/@specforge/session-types/dist/runtime/working-context.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/working-context.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/working-context.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/write-plan.d.ts +146 -0
- package/node_modules/@specforge/session-types/dist/runtime/write-plan.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/runtime/write-plan.js +2 -0
- package/node_modules/@specforge/session-types/dist/runtime/write-plan.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/discovery.d.ts +76 -0
- package/node_modules/@specforge/session-types/dist/schema/discovery.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/discovery.js +42 -0
- package/node_modules/@specforge/session-types/dist/schema/discovery.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-record-event.d.ts +48 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-record-event.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-record-event.js +28 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-record-event.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-session.d.ts +37 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-session.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-session.js +24 -0
- package/node_modules/@specforge/session-types/dist/schema/implementation-session.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/index.d.ts +12 -0
- package/node_modules/@specforge/session-types/dist/schema/index.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/index.js +12 -0
- package/node_modules/@specforge/session-types/dist/schema/index.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/parsed-git-evidence.d.ts +74 -0
- package/node_modules/@specforge/session-types/dist/schema/parsed-git-evidence.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/parsed-git-evidence.js +31 -0
- package/node_modules/@specforge/session-types/dist/schema/parsed-git-evidence.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-acceptance-check.d.ts +27 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-acceptance-check.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-acceptance-check.js +11 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-acceptance-check.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-action.d.ts +94 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-action.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-action.js +76 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-action.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-file-change.d.ts +42 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-file-change.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-file-change.js +25 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-file-change.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-impl-step-completion.d.ts +27 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-impl-step-completion.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-impl-step-completion.js +11 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-impl-step-completion.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-resolution.d.ts +42 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-resolution.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-resolution.js +28 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-resolution.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-test-result.d.ts +72 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-test-result.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-test-result.js +43 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session-test-result.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session.d.ts +203 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session.js +86 -0
- package/node_modules/@specforge/session-types/dist/schema/work-session.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/config-store-interface.d.ts +17 -0
- package/node_modules/@specforge/session-types/dist/stores/config-store-interface.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/config-store-interface.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/config-store-interface.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/discovery-store.d.ts +31 -0
- package/node_modules/@specforge/session-types/dist/stores/discovery-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/discovery-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/discovery-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-record-event-store.d.ts +19 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-record-event-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-record-event-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-record-event-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-aggregate-store.d.ts +16 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-aggregate-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-aggregate-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-aggregate-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-store.d.ts +28 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/implementation-session-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-entity-score-datapoint-store.d.ts +12 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-entity-score-datapoint-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-entity-score-datapoint-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-entity-score-datapoint-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-phase-transition-store.d.ts +10 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-phase-transition-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-phase-transition-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-phase-transition-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-action-store.d.ts +13 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-action-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-action-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-action-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-aggregate-store.d.ts +10 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-aggregate-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-aggregate-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-aggregate-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-store.d.ts +20 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/planning-session-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-acceptance-check-store.d.ts +15 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-acceptance-check-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-acceptance-check-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-acceptance-check-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-action-store.d.ts +29 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-action-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-action-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-action-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-file-change-store.d.ts +9 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-file-change-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-file-change-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-file-change-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-impl-step-completion-store.d.ts +9 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-impl-step-completion-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-impl-step-completion-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-impl-step-completion-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-resolution-store.d.ts +10 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-resolution-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-resolution-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-resolution-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-store.d.ts +23 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-test-result-store.d.ts +8 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-test-result-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-test-result-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/work-session-test-result-store.js.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/working-context-store.d.ts +27 -0
- package/node_modules/@specforge/session-types/dist/stores/working-context-store.d.ts.map +1 -0
- package/node_modules/@specforge/session-types/dist/stores/working-context-store.js +2 -0
- package/node_modules/@specforge/session-types/dist/stores/working-context-store.js.map +1 -0
- package/node_modules/@specforge/session-types/package.json +43 -0
- package/node_modules/@specforge/spec-types/README.md +28 -0
- package/node_modules/@specforge/spec-types/dist/index.d.ts +4 -0
- package/node_modules/@specforge/spec-types/dist/index.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/index.js +6 -0
- package/node_modules/@specforge/spec-types/dist/index.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/json-schema/v1.1/openspec.schema.json +1129 -0
- package/node_modules/@specforge/spec-types/dist/openspec-schema.d.ts +4 -0
- package/node_modules/@specforge/spec-types/dist/openspec-schema.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/openspec-schema.js +77 -0
- package/node_modules/@specforge/spec-types/dist/openspec-schema.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/auxiliary.d.ts +14 -0
- package/node_modules/@specforge/spec-types/dist/runtime/auxiliary.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/auxiliary.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/auxiliary.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/blueprint.d.ts +7 -0
- package/node_modules/@specforge/spec-types/dist/runtime/blueprint.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/blueprint.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/blueprint.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/epic.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/epic.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/epic.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/epic.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/index.d.ts +7 -0
- package/node_modules/@specforge/spec-types/dist/runtime/index.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/index.js +7 -0
- package/node_modules/@specforge/spec-types/dist/runtime/index.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/api-contract.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/api-contract.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/api-contract.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/api-contract.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/goal.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/goal.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/goal.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/goal.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/guardrail.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/guardrail.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/guardrail.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/guardrail.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/index.d.ts +10 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/index.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/index.js +10 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/index.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/nfr.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/nfr.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/nfr.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/nfr.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/requirement.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/requirement.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/requirement.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/requirement.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/scope.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/scope.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/scope.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/scope.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/shared-pattern.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/shared-pattern.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/shared-pattern.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/shared-pattern.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/structure-item.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/structure-item.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/structure-item.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/structure-item.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/tech-stack.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/tech-stack.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/tech-stack.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/planning/tech-stack.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/specification.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/specification.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/specification.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/specification.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/ticket.d.ts +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/ticket.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/runtime/ticket.js +2 -0
- package/node_modules/@specforge/spec-types/dist/runtime/ticket.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/auxiliary.d.ts +266 -0
- package/node_modules/@specforge/spec-types/dist/schema/auxiliary.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/auxiliary.js +143 -0
- package/node_modules/@specforge/spec-types/dist/schema/auxiliary.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/blueprint.d.ts +47 -0
- package/node_modules/@specforge/spec-types/dist/schema/blueprint.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/blueprint.js +33 -0
- package/node_modules/@specforge/spec-types/dist/schema/blueprint.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/entity-field-schemas.d.ts +33 -0
- package/node_modules/@specforge/spec-types/dist/schema/entity-field-schemas.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/entity-field-schemas.js +181 -0
- package/node_modules/@specforge/spec-types/dist/schema/entity-field-schemas.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/epic.d.ts +955 -0
- package/node_modules/@specforge/spec-types/dist/schema/epic.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/epic.js +33 -0
- package/node_modules/@specforge/spec-types/dist/schema/epic.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/index.d.ts +12 -0
- package/node_modules/@specforge/spec-types/dist/schema/index.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/index.js +25 -0
- package/node_modules/@specforge/spec-types/dist/schema/index.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/node-verb-steps.d.ts +174 -0
- package/node_modules/@specforge/spec-types/dist/schema/node-verb-steps.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/node-verb-steps.js +317 -0
- package/node_modules/@specforge/spec-types/dist/schema/node-verb-steps.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/patterns.d.ts +274 -0
- package/node_modules/@specforge/spec-types/dist/schema/patterns.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/patterns.js +106 -0
- package/node_modules/@specforge/spec-types/dist/schema/patterns.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/api-contract.d.ts +44 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/api-contract.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/api-contract.js +13 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/api-contract.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/epic-category.d.ts +21 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/epic-category.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/epic-category.js +14 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/epic-category.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/goal.d.ts +27 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/goal.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/goal.js +13 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/goal.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/guardrail.d.ts +29 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/guardrail.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/guardrail.js +14 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/guardrail.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/index.d.ts +12 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/index.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/index.js +12 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/index.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/nfr.d.ts +27 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/nfr.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/nfr.js +15 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/nfr.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/planning-type.d.ts +17 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/planning-type.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/planning-type.js +16 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/planning-type.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/requirement.d.ts +63 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/requirement.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/requirement.js +16 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/requirement.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/scope.d.ts +19 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/scope.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/scope.js +8 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/scope.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/shared-pattern.d.ts +51 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/shared-pattern.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/shared-pattern.js +16 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/shared-pattern.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/structure-item.d.ts +19 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/structure-item.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/structure-item.js +8 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/structure-item.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/tech-stack.d.ts +27 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/tech-stack.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/tech-stack.js +14 -0
- package/node_modules/@specforge/spec-types/dist/schema/planning/tech-stack.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/specification.d.ts +1839 -0
- package/node_modules/@specforge/spec-types/dist/schema/specification.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/specification.js +43 -0
- package/node_modules/@specforge/spec-types/dist/schema/specification.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.d.ts +58 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.js +73 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-ids.d.ts +71 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-ids.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-ids.js +96 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-ids.js.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/ticket.d.ts +444 -0
- package/node_modules/@specforge/spec-types/dist/schema/ticket.d.ts.map +1 -0
- package/node_modules/@specforge/spec-types/dist/schema/ticket.js +49 -0
- package/node_modules/@specforge/spec-types/dist/schema/ticket.js.map +1 -0
- package/node_modules/@specforge/spec-types/package.json +41 -0
- package/package.json +40 -25
- package/src/cli/templates/agents/content/core/sfag-orchestrator.ts +135 -51
- package/src/cli/templates/agents/content/core/sfag-spec-creator.ts +124 -83
- package/src/cli/templates/agents/content/core/sfag-ticket-implementer.ts +247 -163
- package/src/cli/templates/agents/content/core/sfag-work-resolver.ts +211 -0
- package/src/cli/templates/agents/index.ts +2 -0
- package/src/cli/templates/content/sf-commit.ts +2 -2
- package/src/cli/templates/content/sf-reset.ts +45 -28
- package/src/cli/templates/skills/specforge-orchestrator.md +15 -10
- package/src/cli/templates/skills/specforge-worker.md +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transport/remote.ts"],"sourcesContent":["/**\n * RemoteTransport — HTTP POST transport to SpecForge API Gateway\n *\n * Extracted from ApiClient.call() to implement ITransport.\n *\n * Endpoint resolution: when `config.apiUrl` matches `CHANNEL.endpoint.primary`\n * (i.e. no `SPECFORGE_API_URL` override is active), the transport delegates\n * to `resolveEndpoint` on the first call so the URL flows from the\n * canary-channel client probe (PLAN-canary-channel.md §D) — primary first,\n * fallback on DNS-class failure, cached for 5 min. On a 401/403 the cache\n * is invalidated so the next call re-probes.\n */\n\nimport type { ITransport, TransportOrigin } from './interface.js';\nimport { CHANNEL } from '../channel.js';\nimport {\n resolveEndpoint,\n invalidate,\n shouldInvalidateOnStatus,\n} from './resolve-endpoint.js';\n\nexport interface RemoteTransportConfig {\n apiUrl: string;\n apiKey: string;\n debug?: boolean;\n timeout?: number;\n /**\n * Calling context, sent as the `X-SpecForge-Origin` header (M9.7). Defaults to\n * `mcp` (agent traffic); the human CLI surface passes `cli`.\n */\n origin?: TransportOrigin;\n}\n\nconst DEFAULT_TIMEOUT = 30000;\nconst MCP_CACHE_KEY = 'mcp-endpoint-cache';\n\nexport class RemoteTransport implements ITransport {\n private config: RemoteTransportConfig;\n /** Resolved URL pinned for this transport instance after the first call. */\n private resolvedUrl: string | null = null;\n\n constructor(config: RemoteTransportConfig) {\n this.config = config;\n }\n\n /**\n * Pick the URL for this call. When `config.apiUrl` is the channel default,\n * defer to the resolver. Otherwise (env override / explicit test fixture),\n * use the configured URL directly.\n */\n private async pickUrl(): Promise<string> {\n if (this.resolvedUrl) return this.resolvedUrl;\n
|
|
1
|
+
{"version":3,"sources":["../../src/transport/remote.ts"],"sourcesContent":["/**\n * RemoteTransport — HTTP POST transport to SpecForge API Gateway\n *\n * Extracted from ApiClient.call() to implement ITransport.\n *\n * Endpoint resolution: when `config.apiUrl` matches `CHANNEL.endpoint.primary`\n * (i.e. no `SPECFORGE_API_URL` override is active), the transport delegates\n * to `resolveEndpoint` on the first call so the URL flows from the\n * canary-channel client probe (PLAN-canary-channel.md §D) — primary first,\n * fallback on DNS-class failure, cached for 5 min. On a 401/403 the cache\n * is invalidated so the next call re-probes.\n */\n\nimport type { ITransport, TransportOrigin } from './interface.js';\nimport { CHANNEL } from '../channel.js';\nimport {\n resolveEndpoint,\n invalidate,\n shouldInvalidateOnStatus,\n} from './resolve-endpoint.js';\n\nexport interface RemoteTransportConfig {\n apiUrl: string;\n apiKey: string;\n debug?: boolean;\n timeout?: number;\n /**\n * Calling context, sent as the `X-SpecForge-Origin` header (M9.7). Defaults to\n * `mcp` (agent traffic); the human CLI surface passes `cli`.\n */\n origin?: TransportOrigin;\n}\n\nconst DEFAULT_TIMEOUT = 30000;\nconst MCP_CACHE_KEY = 'mcp-endpoint-cache';\n\n/** Parse a URL, returning null instead of throwing on malformed input. */\nfunction safeUrl(u: string): URL | null {\n try {\n return new URL(u);\n } catch {\n return null;\n }\n}\n\n/** True when `apiUrl` targets one of the channel's hosts (on any surface path). */\nfunction isChannelHost(apiUrl: string): boolean {\n const h = safeUrl(apiUrl)?.host;\n if (!h) return false;\n return (\n h === safeUrl(CHANNEL.endpoint.primary)?.host ||\n h === safeUrl(CHANNEL.endpoint.fallback)?.host\n );\n}\n\nexport class RemoteTransport implements ITransport {\n private config: RemoteTransportConfig;\n /** Resolved URL pinned for this transport instance after the first call. */\n private resolvedUrl: string | null = null;\n\n constructor(config: RemoteTransportConfig) {\n this.config = config;\n }\n\n /**\n * Pick the URL for this call. When `config.apiUrl` is the channel default,\n * defer to the resolver. Otherwise (env override / explicit test fixture),\n * use the configured URL directly.\n */\n private async pickUrl(): Promise<string> {\n if (this.resolvedUrl) return this.resolvedUrl;\n\n // Match the channel by HOST, not by exact URL. `createCliClient` rewrites the\n // default `/local` (MCP/agent) surface to `/cli` (human CLI), so an exact\n // `=== CHANNEL.endpoint.primary` check wrongly classified the CLI surface as\n // an \"override\" and skipped the resolver entirely — meaning `specforge login`\n // hit the dead primary with NO fallback. Comparing hosts makes BOTH surfaces\n // go through the primary→fallback probe.\n const apiUrl = safeUrl(this.config.apiUrl);\n if (!apiUrl || !isChannelHost(this.config.apiUrl)) {\n // A genuine override (env var / explicit test fixture) — use it verbatim.\n this.resolvedUrl = this.config.apiUrl;\n return this.resolvedUrl;\n }\n\n // Resolve the live host via the /health probes (primary → fallback), then\n // re-apply THIS transport's surface path (`/cli` or `/local`) onto the\n // resolved host so the fallback works on either surface.\n const resolvedBase = await resolveEndpoint({\n ...CHANNEL.endpoint,\n cacheKey: MCP_CACHE_KEY,\n });\n const resolved = safeUrl(resolvedBase);\n if (resolved && apiUrl) {\n resolved.pathname = apiUrl.pathname;\n this.resolvedUrl = resolved.toString().replace(/\\/$/, '');\n } else {\n this.resolvedUrl = resolvedBase;\n }\n if (this.config.debug) {\n console.log(`[RemoteTransport] Resolved MCP endpoint: ${this.resolvedUrl}`);\n }\n return this.resolvedUrl;\n }\n\n async execute<T = unknown>(\n operation: string,\n args: Record<string, unknown>\n ): Promise<T> {\n const timeout = this.config.timeout ?? DEFAULT_TIMEOUT;\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeout);\n\n try {\n if (this.config.debug) {\n console.log(`[RemoteTransport] Calling operation: ${operation}`, {\n args: Object.keys(args),\n });\n }\n\n const url = await this.pickUrl();\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${this.config.apiKey}`,\n // M9.7: server-derived feedback/telemetry provenance. The backend\n // reads this header (never a request-body `source` field).\n 'X-SpecForge-Origin': this.config.origin ?? 'mcp',\n },\n body: JSON.stringify({ operation, args }),\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n // Auth failures may indicate the channel was rotated under us;\n // invalidate so the next call re-probes.\n if (\n shouldInvalidateOnStatus(response.status) &&\n isChannelHost(this.config.apiUrl)\n ) {\n await invalidate(MCP_CACHE_KEY);\n this.resolvedUrl = null;\n }\n const errorText = await response.text();\n const statusMessage = getStatusMessage(response.status);\n throw new Error(\n `API request failed: ${response.status} ${statusMessage}\\n${errorText}`\n );\n }\n\n // Transport is a dumb pipe (M9, approach A): return the raw response body.\n // Response-shape interpretation lives in the consumer that owns the\n // contract — `ApiClient.call` unwraps the `/cli` `{ data } / { error }`\n // shape; the agent `/local` path interprets the M8 envelope itself.\n const body = (await response.json()) as T;\n\n if (this.config.debug) {\n console.log(`[RemoteTransport] Operation completed: ${operation}`);\n }\n\n return body;\n } catch (error) {\n clearTimeout(timeoutId);\n if (error instanceof Error && error.name === 'AbortError') {\n throw new Error(\n `Request timed out after ${timeout}ms for operation: ${operation}`\n );\n }\n throw error;\n }\n }\n}\n\nfunction getStatusMessage(status: number): string {\n const messages: Record<number, string> = {\n 400: 'Bad Request',\n 401: 'Unauthorized - Check your API key',\n 403: 'Forbidden - Insufficient permissions',\n 404: 'Not Found',\n 429: 'Too Many Requests - Rate limit exceeded',\n 500: 'Internal Server Error',\n 501: 'Not Implemented',\n 502: 'Bad Gateway',\n 503: 'Service Unavailable',\n 504: 'Gateway Timeout',\n };\n return messages[status] || 'Unknown Error';\n}\n"],"mappings":"AAcA,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;AAGtB,SAAS,QAAQ,GAAuB;AACtC,MAAI;AACF,WAAO,IAAI,IAAI,CAAC;AAAA,EAClB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGA,SAAS,cAA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AAK;AAAA,IACL,KAAK;AAAA,EACP;AACA,SAAO,SAAS,MAAM,KAAK;AAC7B;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SpecForge MCP Type Definitions
|
|
3
3
|
*
|
|
4
|
-
* Most wire-protocol types live in
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Most wire-protocol types live in the surviving type packages
|
|
5
|
+
* (@specforge/spec-types for spec-domain schema/runtime, @specforge/api-types
|
|
6
|
+
* for API/wire entities, @specforge/report-types for status reports). This file
|
|
7
|
+
* re-exports them under stable CLI names and defines a small set of CLI-internal
|
|
8
|
+
* shapes: work sessions, implementation context, discovery/attempt summaries,
|
|
9
|
+
* git-link records, and structured acceptance criteria with normalization helpers.
|
|
9
10
|
*/
|
|
10
|
-
export type { SpecificationStatus, EpicStatus,
|
|
11
|
-
import type {
|
|
12
|
-
export type {
|
|
13
|
-
import type {
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
import type { DependencyTicketSummary } from '@specforge/types/api';
|
|
11
|
+
export type { SpecificationStatus, EpicStatus, Specification, Epic, Ticket, TicketImplementation, NamingConventions, SpecificationCodeStandards, ReturnTypes, EpicSharedPatterns, EpicCommonFiles, TicketTechnicalDetails, } from '@specforge/spec-types';
|
|
12
|
+
import type { Specification, Epic, Ticket } from '@specforge/spec-types';
|
|
13
|
+
export type { TicketStatus, Project, DependencyTicketSummary, } from '@specforge/api-types';
|
|
14
|
+
import type { TicketStatus, DependencyTicketSummary } from '@specforge/api-types';
|
|
15
|
+
export type { SpecificationStatusReport, EpicStatusReport, ImplementationSummary, TimeReport, BlockersReport, } from '@specforge/report-types';
|
|
16
|
+
export type { WorkSessionAcceptanceCheck, WorkSessionImplStepCompletion, } from '@specforge/session-types';
|
|
17
17
|
/**
|
|
18
18
|
* Structured acceptance criterion with validation state.
|
|
19
19
|
*/
|
|
@@ -140,16 +140,6 @@ export interface TicketAcceptanceCriterion {
|
|
|
140
140
|
createdAt?: string;
|
|
141
141
|
updatedAt?: string;
|
|
142
142
|
}
|
|
143
|
-
export interface WorkSessionACValidation {
|
|
144
|
-
id: string;
|
|
145
|
-
workSessionId: string;
|
|
146
|
-
criterionId: string;
|
|
147
|
-
validated: boolean;
|
|
148
|
-
validatedAt?: string;
|
|
149
|
-
notes?: string;
|
|
150
|
-
createdAt?: string;
|
|
151
|
-
updatedAt?: string;
|
|
152
|
-
}
|
|
153
143
|
export interface TicketImplementationStep {
|
|
154
144
|
id: string;
|
|
155
145
|
ticketId: string;
|
|
@@ -158,16 +148,6 @@ export interface TicketImplementationStep {
|
|
|
158
148
|
createdAt?: string;
|
|
159
149
|
updatedAt?: string;
|
|
160
150
|
}
|
|
161
|
-
export interface WorkSessionStepCompletion {
|
|
162
|
-
id: string;
|
|
163
|
-
workSessionId: string;
|
|
164
|
-
stepId: string;
|
|
165
|
-
completed: boolean;
|
|
166
|
-
completedAt?: string;
|
|
167
|
-
notes?: string;
|
|
168
|
-
createdAt?: string;
|
|
169
|
-
updatedAt?: string;
|
|
170
|
-
}
|
|
171
151
|
export type TestType = 'unit' | 'integration' | 'e2e' | 'manual' | 'typescript' | 'lint' | 'build' | 'typecheck' | 'format' | 'security' | 'custom';
|
|
172
152
|
export interface WorkSessionTestResult {
|
|
173
153
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,YAAY,EACV,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,IAAI,EACJ,MAAM,EACN,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC1B,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,sBA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AC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oDAAoD;AACpD,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAMrD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * SpecForge MCP Type Definitions\n *\n * Most wire-protocol types live in `@specforge/types` (the canonical source\n * of truth). This file re-exports them under stable CLI names and defines a\n * small set of CLI-internal shapes: work sessions, implementation context,\n * discovery/attempt summaries, git-link records, and structured acceptance\n * criteria with normalization helpers.\n */\n\n// -----------------------------------------------------------------------------\n// Schema enums and primitive types — re-exported from @specforge/types/schema\n// -----------------------------------------------------------------------------\n\nexport type {\n SpecificationStatus,\n EpicStatus,\n TicketStatus,\n DependencyType,\n} from '@specforge/types/schema';\n\nimport type {\n SpecificationStatus,\n EpicStatus,\n TicketStatus,\n} from '@specforge/types/schema';\n\n// -----------------------------------------------------------------------------\n// Runtime entity shapes — re-exported from @specforge/types/runtime\n// -----------------------------------------------------------------------------\n\nexport type {\n Project,\n Specification,\n NamingConventions,\n SpecificationCodeStandards,\n ReturnTypes,\n Epic,\n EpicSharedPatterns,\n EpicCommonFiles,\n Ticket,\n TicketTechnicalDetails,\n TicketDependency,\n} from '@specforge/types/runtime';\n\nimport type {\n Specification,\n Epic,\n Ticket,\n} from '@specforge/types/runtime';\n\nexport type { TicketImplementation } from '@specforge/types/schema';\n\n// -----------------------------------------------------------------------------\n// API wire types — re-exported from @specforge/types/api\n// -----------------------------------------------------------------------------\n\nexport type {\n ListResponse,\n DependencyTicketSummary,\n SpecificationStatusReport,\n EpicStatusReport,\n ImplementationSummary,\n TimeReport,\n BlockersReport,\n TicketUpdate,\n BulkUpdateRequest,\n BulkUpdateResult,\n BulkCreateTicketDefinition,\n BulkCreateDependencyDefinition,\n BulkCreateTicketsRequest,\n BulkCreatedTicketInfo,\n BulkCreateTicketsResult,\n BulkDependencyDefinition,\n BulkAddDependenciesRequest,\n BulkAddDependenciesResult,\n LookupProjectRequest,\n LookupProjectResult,\n LookupSpecificationRequest,\n LookupSpecificationResult,\n LookupEpicRequest,\n LookupEpicResult,\n LookupTicketRequest,\n LookupTicketResult,\n} from '@specforge/types/api';\n\nimport type { DependencyTicketSummary } from '@specforge/types/api';\n\n// =============================================================================\n// CLI-internal types below — no canonical equivalent in @specforge/types\n// =============================================================================\n\n// -----------------------------------------------------------------------------\n// Structured acceptance criteria (TS-001)\n// -----------------------------------------------------------------------------\n\n/**\n * Structured acceptance criterion with validation state.\n */\nexport interface AcceptanceCriterion {\n id: string;\n description: string;\n validated: boolean;\n validatedAt?: string;\n validatedBy?: string;\n notes?: string;\n}\n\n/**\n * Normalizes acceptance criteria from legacy string[] format to structured\n * `AcceptanceCriterion[]`. Provides backwards compatibility for old data\n * stored as string arrays.\n */\nexport function normalizeAcceptanceCriteria(\n criteria: (string | AcceptanceCriterion)[]\n): AcceptanceCriterion[] {\n return criteria.map((c, index) => {\n if (typeof c === 'string') {\n return {\n id: `ac-${index}-${Date.now()}`,\n description: c,\n validated: false,\n };\n }\n return c;\n });\n}\n\n// -----------------------------------------------------------------------------\n// Implementation context (returned by get_implementation_context)\n// -----------------------------------------------------------------------------\n\nexport interface RelatedTicketSummary {\n id: string;\n title: string;\n status: TicketStatus;\n sameEpic: boolean;\n}\n\nexport interface TestResultSummary {\n id: string;\n testType?: string;\n allPassed: boolean;\n passed: number;\n failed: number;\n total: number;\n runAt: string;\n}\n\nexport interface PreviousAttempt {\n attemptNumber: number;\n startedAt: string;\n endedAt?: string;\n result: 'completed' | 'failed' | 'in_progress';\n testResults: TestResultSummary[];\n summary?: string;\n}\n\nexport interface DiscoverySummary {\n id: string;\n type: string;\n severity: string;\n status: string;\n title: string;\n description: string;\n createdAt: string;\n}\n\nexport interface ActiveSessionSummary {\n id: string;\n status: string;\n startedAt: string;\n config: unknown;\n ticketsCompleted: string[];\n ticketsFailed: string[];\n ticketsSkipped: string[];\n totalActiveMinutes: number;\n}\n\n/**\n * Implementation context returned by get_implementation_context.\n */\nexport interface ImplementationContext {\n /** The ticket being implemented */\n ticket: Ticket;\n /** The epic containing the ticket */\n epic: Epic;\n /** The specification containing the epic */\n specification: Specification;\n /** Dependency information */\n dependencies: {\n /** Tickets that must be completed before this one */\n blockedBy: DependencyTicketSummary[];\n /** Tickets waiting on this one */\n blocks: DependencyTicketSummary[];\n };\n /** Related tickets */\n relatedTickets: RelatedTicketSummary[];\n /** Patterns and conventions from the project */\n patterns?: Record<string, unknown>;\n /** Active implementation session (Phase 5) */\n activeSession: ActiveSessionSummary | null;\n /** Previous implementation attempts (Phase 5) */\n previousAttempts: PreviousAttempt[];\n /** Related discoveries (Phase 5) */\n relatedDiscoveries: DiscoverySummary[];\n}\n\n// -----------------------------------------------------------------------------\n// Work session state (session-scoped tables)\n// -----------------------------------------------------------------------------\n\nexport interface WorkSession {\n id: string;\n ticketId: string;\n specificationId: string;\n projectId: string;\n epicId: string;\n implementationSessionId?: string;\n status: 'active' | 'paused' | 'completed' | 'failed';\n startedAt: string;\n pausedAt?: string;\n completedAt?: string;\n actualHours?: number;\n filesCreated?: string[];\n filesModified?: string[];\n filesDeleted?: string[];\n testsPassed?: boolean;\n retryCount: number;\n retryLog?: unknown;\n actions?: unknown;\n completionAttempts?: unknown;\n tokensUsed?: { inputTokens: number; outputTokens: number };\n costUsd?: number;\n durationMs?: number;\n commitSha?: string;\n modelUsed?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface TicketAcceptanceCriterion {\n id: string;\n ticketId: string;\n description: string;\n order: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface WorkSessionACValidation {\n id: string;\n workSessionId: string;\n criterionId: string;\n validated: boolean;\n validatedAt?: string;\n notes?: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface TicketImplementationStep {\n id: string;\n ticketId: string;\n text: string;\n order: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface WorkSessionStepCompletion {\n id: string;\n workSessionId: string;\n stepId: string;\n completed: boolean;\n completedAt?: string;\n notes?: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\n// -----------------------------------------------------------------------------\n// Test result types\n// -----------------------------------------------------------------------------\n\nexport type TestType =\n | 'unit'\n | 'integration'\n | 'e2e'\n | 'manual'\n | 'typescript'\n | 'lint'\n | 'build'\n | 'typecheck'\n | 'format'\n | 'security'\n | 'custom';\n\nexport interface WorkSessionTestResult {\n id: string;\n workSessionId: string;\n testType: TestType;\n passed: boolean;\n totalTests: number;\n passedTests: number;\n failedTests: number;\n skippedTests: number;\n coverage?: number;\n errorDetails?: string;\n command?: string;\n exitCode?: number;\n durationMs?: number;\n errorCount?: number;\n warningCount?: number;\n summary?: string;\n suites?: Array<{\n name: string;\n passed: number;\n failed: number;\n skipped?: number;\n duration?: number;\n }>;\n runAt: string;\n}\n\n/** @deprecated Use WorkSessionTestResult instead */\nexport type TicketTestResult = WorkSessionTestResult;\n\n// -----------------------------------------------------------------------------\n// Git integration\n// -----------------------------------------------------------------------------\n\nexport type LinkType = 'commit' | 'pull_request' | 'branch';\n\nexport interface TicketLink {\n id: string;\n ticketId: string;\n linkType: LinkType;\n url: string;\n sha?: string;\n prNumber?: number;\n title?: string;\n status?: string;\n createdAt: string;\n}\n\n// -----------------------------------------------------------------------------\n// Silence unused-import warnings for enum aliases referenced only by JSDoc\n// -----------------------------------------------------------------------------\n// (Each of these is re-exported above; the local `import type` pulls them\n// in so that embedded JSDoc cross-references resolve in editors.)\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype _ReferencedEnums = SpecificationStatus | EpicStatus;\n"],"mappings":"AAiHO,SAAS,4BACd,UACuB;AACvB,SAAO,SAAS,IAAI,CAAC,GAAG,UAAU;AAChC,QAAI,OAAO,MAAM,UAAU;AACzB,aAAO;AAAA,QACL,IAAI,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;AAAA,QAC7B,aAAa;AAAA,QACb,WAAW;AAAA,MACb;AAAA,IACF;AACA,WAAO;AAAA,EACT,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * SpecForge MCP Type Definitions\n *\n * Most wire-protocol types live in the surviving type packages\n * (@specforge/spec-types for spec-domain schema/runtime, @specforge/api-types\n * for API/wire entities, @specforge/report-types for status reports). This file\n * re-exports them under stable CLI names and defines a small set of CLI-internal\n * shapes: work sessions, implementation context, discovery/attempt summaries,\n * git-link records, and structured acceptance criteria with normalization helpers.\n */\n\n// -----------------------------------------------------------------------------\n// Spec-domain schema enums + entities + pattern shapes — from @specforge/spec-types\n// -----------------------------------------------------------------------------\n\nexport type {\n SpecificationStatus,\n EpicStatus,\n Specification,\n Epic,\n Ticket,\n TicketImplementation,\n NamingConventions,\n SpecificationCodeStandards,\n ReturnTypes,\n EpicSharedPatterns,\n EpicCommonFiles,\n TicketTechnicalDetails,\n} from '@specforge/spec-types';\n\nimport type {\n SpecificationStatus,\n EpicStatus,\n Specification,\n Epic,\n Ticket,\n} from '@specforge/spec-types';\n\n// -----------------------------------------------------------------------------\n// Canonical 5-value TicketStatus + Project entity + dependency summary — from\n// @specforge/api-types (the API/wire entity home; TicketStatus carries `blocked`).\n// -----------------------------------------------------------------------------\n\nexport type {\n TicketStatus,\n Project,\n DependencyTicketSummary,\n} from '@specforge/api-types';\n\nimport type {\n TicketStatus,\n DependencyTicketSummary,\n} from '@specforge/api-types';\n\n// -----------------------------------------------------------------------------\n// Status / analytic reports — from @specforge/report-types (the report family\n// embeds the spec-domain entities + Project; the CLI is its sole type-consumer).\n// -----------------------------------------------------------------------------\n\nexport type {\n SpecificationStatusReport,\n EpicStatusReport,\n ImplementationSummary,\n TimeReport,\n BlockersReport,\n} from '@specforge/report-types';\n\n// -----------------------------------------------------------------------------\n// Canonical work-session child-state types — re-exported from\n// @specforge/session-types (the single source of truth after the M14\n// convergence + the M15.1a DDB rename). These replace the former divergent\n// CLI-local AC-validation / step-completion shapes (which had `validated`/\n// `completed` and were missing `ticketId`/`projectId`): one name + one shape\n// end-to-end (`checked`/`done` + `ticketId`/`projectId`), no aliases.\n// -----------------------------------------------------------------------------\n\nexport type {\n WorkSessionAcceptanceCheck,\n WorkSessionImplStepCompletion,\n} from '@specforge/session-types';\n\n// =============================================================================\n// CLI-internal types below — no canonical equivalent in the type packages\n// =============================================================================\n\n// -----------------------------------------------------------------------------\n// Structured acceptance criteria (TS-001)\n// -----------------------------------------------------------------------------\n\n/**\n * Structured acceptance criterion with validation state.\n */\nexport interface AcceptanceCriterion {\n id: string;\n description: string;\n validated: boolean;\n validatedAt?: string;\n validatedBy?: string;\n notes?: string;\n}\n\n/**\n * Normalizes acceptance criteria from legacy string[] format to structured\n * `AcceptanceCriterion[]`. Provides backwards compatibility for old data\n * stored as string arrays.\n */\nexport function normalizeAcceptanceCriteria(\n criteria: (string | AcceptanceCriterion)[]\n): AcceptanceCriterion[] {\n return criteria.map((c, index) => {\n if (typeof c === 'string') {\n return {\n id: `ac-${index}-${Date.now()}`,\n description: c,\n validated: false,\n };\n }\n return c;\n });\n}\n\n// -----------------------------------------------------------------------------\n// Implementation context (returned by get_implementation_context)\n// -----------------------------------------------------------------------------\n\nexport interface RelatedTicketSummary {\n id: string;\n title: string;\n status: TicketStatus;\n sameEpic: boolean;\n}\n\nexport interface TestResultSummary {\n id: string;\n testType?: string;\n allPassed: boolean;\n passed: number;\n failed: number;\n total: number;\n runAt: string;\n}\n\nexport interface PreviousAttempt {\n attemptNumber: number;\n startedAt: string;\n endedAt?: string;\n result: 'completed' | 'failed' | 'in_progress';\n testResults: TestResultSummary[];\n summary?: string;\n}\n\nexport interface DiscoverySummary {\n id: string;\n type: string;\n severity: string;\n status: string;\n title: string;\n description: string;\n createdAt: string;\n}\n\nexport interface ActiveSessionSummary {\n id: string;\n status: string;\n startedAt: string;\n config: unknown;\n ticketsCompleted: string[];\n ticketsFailed: string[];\n ticketsSkipped: string[];\n totalActiveMinutes: number;\n}\n\n/**\n * Implementation context returned by get_implementation_context.\n */\nexport interface ImplementationContext {\n /** The ticket being implemented */\n ticket: Ticket;\n /** The epic containing the ticket */\n epic: Epic;\n /** The specification containing the epic */\n specification: Specification;\n /** Dependency information */\n dependencies: {\n /** Tickets that must be completed before this one */\n blockedBy: DependencyTicketSummary[];\n /** Tickets waiting on this one */\n blocks: DependencyTicketSummary[];\n };\n /** Related tickets */\n relatedTickets: RelatedTicketSummary[];\n /** Patterns and conventions from the project */\n patterns?: Record<string, unknown>;\n /** Active implementation session (Phase 5) */\n activeSession: ActiveSessionSummary | null;\n /** Previous implementation attempts (Phase 5) */\n previousAttempts: PreviousAttempt[];\n /** Related discoveries (Phase 5) */\n relatedDiscoveries: DiscoverySummary[];\n}\n\n// -----------------------------------------------------------------------------\n// Work session state (session-scoped tables)\n// -----------------------------------------------------------------------------\n\nexport interface WorkSession {\n id: string;\n ticketId: string;\n specificationId: string;\n projectId: string;\n epicId: string;\n implementationSessionId?: string;\n status: 'active' | 'paused' | 'completed' | 'failed';\n startedAt: string;\n pausedAt?: string;\n completedAt?: string;\n actualHours?: number;\n filesCreated?: string[];\n filesModified?: string[];\n filesDeleted?: string[];\n testsPassed?: boolean;\n retryCount: number;\n retryLog?: unknown;\n actions?: unknown;\n completionAttempts?: unknown;\n tokensUsed?: { inputTokens: number; outputTokens: number };\n costUsd?: number;\n durationMs?: number;\n commitSha?: string;\n modelUsed?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface TicketAcceptanceCriterion {\n id: string;\n ticketId: string;\n description: string;\n order: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface TicketImplementationStep {\n id: string;\n ticketId: string;\n text: string;\n order: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\n// -----------------------------------------------------------------------------\n// Test result types\n// -----------------------------------------------------------------------------\n\nexport type TestType =\n | 'unit'\n | 'integration'\n | 'e2e'\n | 'manual'\n | 'typescript'\n | 'lint'\n | 'build'\n | 'typecheck'\n | 'format'\n | 'security'\n | 'custom';\n\nexport interface WorkSessionTestResult {\n id: string;\n workSessionId: string;\n testType: TestType;\n passed: boolean;\n totalTests: number;\n passedTests: number;\n failedTests: number;\n skippedTests: number;\n coverage?: number;\n errorDetails?: string;\n command?: string;\n exitCode?: number;\n durationMs?: number;\n errorCount?: number;\n warningCount?: number;\n summary?: string;\n suites?: Array<{\n name: string;\n passed: number;\n failed: number;\n skipped?: number;\n duration?: number;\n }>;\n runAt: string;\n}\n\n/** @deprecated Use WorkSessionTestResult instead */\nexport type TicketTestResult = WorkSessionTestResult;\n\n// -----------------------------------------------------------------------------\n// Git integration\n// -----------------------------------------------------------------------------\n\nexport type LinkType = 'commit' | 'pull_request' | 'branch';\n\nexport interface TicketLink {\n id: string;\n ticketId: string;\n linkType: LinkType;\n url: string;\n sha?: string;\n prNumber?: number;\n title?: string;\n status?: string;\n createdAt: string;\n}\n\n// -----------------------------------------------------------------------------\n// Silence unused-import warnings for enum aliases referenced only by JSDoc\n// -----------------------------------------------------------------------------\n// (Each of these is re-exported above; the local `import type` pulls them\n// in so that embedded JSDoc cross-references resolve in editors.)\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype _ReferencedEnums = SpecificationStatus | EpicStatus;\n"],"mappings":"AA0GO,SAAS,4BACd,UACuB;AACvB,SAAO,SAAS,IAAI,CAAC,GAAG,UAAU;AAChC,QAAI,OAAO,MAAM,UAAU;AACzB,aAAO;AAAA,QACL,IAAI,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;AAAA,QAC7B,aAAa;AAAA,QACb,WAAW;AAAA,MACb;AAAA,IACF;AACA,WAAO;AAAA,EACT,CAAC;AACH;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,eAAe,EACf,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IAG/B,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,MAAM;gBAFnB,OAAO,EAAE,MAAM,EACR,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM;CAKtB;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IAGxB,UAAU,EAAE,MAAM;IAClB,SAAS,CAAC,EAAE,MAAM;gBAFzB,OAAO,EAAE,MAAM,EACR,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,YAAA;CAK5B;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAQxE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAUnE;A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ACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAUnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,CAeN;AAMD,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAwKtD,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,gBAAgB,CAkB7D;AA2BD;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAiCpD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAKN"}
|
package/dist/validation/index.js
CHANGED
|
@@ -211,9 +211,6 @@ const toolValidators = {
|
|
|
211
211
|
if (args.filesDeleted !== void 0) {
|
|
212
212
|
validateArray(args.filesDeleted, "filesDeleted");
|
|
213
213
|
}
|
|
214
|
-
if (args.blockReason !== void 0) {
|
|
215
|
-
validateStringLength(args.blockReason, "blockReason", 1, 5e3);
|
|
216
|
-
}
|
|
217
214
|
if (args.clearBlockReason !== void 0 && typeof args.clearBlockReason !== "boolean") {
|
|
218
215
|
throw new Error("clearBlockReason must be a boolean");
|
|
219
216
|
}
|
|
@@ -234,15 +231,6 @@ const toolValidators = {
|
|
|
234
231
|
validateArray(args.filesDeleted, "filesDeleted");
|
|
235
232
|
}
|
|
236
233
|
},
|
|
237
|
-
start_review_session: (args) => {
|
|
238
|
-
validateRequired(args.specificationId, "specificationId");
|
|
239
|
-
},
|
|
240
|
-
action_review_session: (args) => {
|
|
241
|
-
validateRequired(args.specificationId, "specificationId");
|
|
242
|
-
},
|
|
243
|
-
complete_review_session: (args) => {
|
|
244
|
-
validateRequired(args.specificationId, "specificationId");
|
|
245
|
-
},
|
|
246
234
|
reopen_specification: (args) => {
|
|
247
235
|
validateRequired(args.specificationId, "specificationId");
|
|
248
236
|
},
|
|
@@ -254,9 +242,6 @@ const toolValidators = {
|
|
|
254
242
|
// Utilities
|
|
255
243
|
feedback: () => {
|
|
256
244
|
},
|
|
257
|
-
reset_work_session: (args) => {
|
|
258
|
-
validateRequired(args.specificationId, "specificationId");
|
|
259
|
-
},
|
|
260
245
|
link_pull_request: (args) => {
|
|
261
246
|
validateRequired(args.ticketId, "ticketId");
|
|
262
247
|
if (!args.prNumber && !args.prUrl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/validation/index.ts"],"sourcesContent":["/**\n * Validation Utilities for MCP Tools\n *\n * Provides comprehensive input validation and error handling for all MCP tools.\n * Validation is run before each tool call to ensure proper argument types and formats.\n */\n\n// Re-export ticket validation utilities\nexport {\n type TicketComplexity,\n type WarningSeverity,\n type StrictnessLevel,\n type ValidationWarning,\n type TicketValidationResult,\n type ComplexityRules,\n type TicketValidationInput,\n validationRules,\n validateTicket,\n filterWarningsByStrictness,\n getComplexityRules,\n isValidComplexity,\n getComplexityDescription,\n suggestComplexity,\n} from './ticket-validation.js';\n\n/**\n * Custom error class for validation failures\n * Includes field name and error code for structured error handling\n */\nexport class ValidationError extends Error {\n constructor(\n message: string,\n public field: string,\n public code: string\n ) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\n/**\n * API Error class for handling HTTP errors from the backend\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public statusCode: number,\n public errorCode?: string\n ) {\n super(message);\n this.name = 'ApiError';\n }\n}\n\n// ============================================================================\n// Basic Validators\n// ============================================================================\n\n/**\n * Validate that a value is present (not null, undefined, or empty string)\n */\nexport function validateRequired(value: unknown, fieldName: string): void {\n if (value === undefined || value === null || value === '') {\n throw new ValidationError(\n `${fieldName} is required`,\n fieldName,\n 'REQUIRED'\n );\n }\n}\n\n/**\n * Validate that a value is a valid UUID format\n */\nexport function validateUUID(value: string, fieldName: string): void {\n validateRequired(value, fieldName);\n const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n if (!uuidRegex.test(value)) {\n throw new ValidationError(\n `${fieldName} must be a valid UUID`,\n fieldName,\n 'INVALID_UUID'\n );\n }\n}\n\n/**\n * Validate that a value is one of the allowed enum values\n */\nexport function validateEnum(\n value: string,\n fieldName: string,\n allowedValues: string[]\n): void {\n validateRequired(value, fieldName);\n if (!allowedValues.includes(value)) {\n throw new ValidationError(\n `${fieldName} must be one of: ${allowedValues.join(', ')}`,\n fieldName,\n 'INVALID_ENUM'\n );\n }\n}\n\n/**\n * Validate that a number is within a range\n */\nexport function validateRange(\n value: number,\n fieldName: string,\n min: number,\n max: number\n): void {\n if (typeof value !== 'number' || isNaN(value)) {\n throw new ValidationError(\n `${fieldName} must be a number`,\n fieldName,\n 'INVALID_NUMBER'\n );\n }\n if (value < min || value > max) {\n throw new ValidationError(\n `${fieldName} must be between ${min} and ${max}`,\n fieldName,\n 'OUT_OF_RANGE'\n );\n }\n}\n\n/**\n * Validate that a value is an array, with optional item validation\n */\nexport function validateArray(\n value: unknown,\n fieldName: string,\n itemValidator?: (item: unknown, index: number) => void\n): void {\n if (!Array.isArray(value)) {\n throw new ValidationError(\n `${fieldName} must be an array`,\n fieldName,\n 'INVALID_ARRAY'\n );\n }\n if (itemValidator) {\n value.forEach((item, index) => {\n try {\n itemValidator(item, index);\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : String(error);\n throw new ValidationError(\n `${fieldName}[${index}]: ${message}`,\n `${fieldName}[${index}]`,\n 'INVALID_ITEM'\n );\n }\n });\n }\n}\n\n/**\n * Validate a 40-character hex SHA\n */\nexport function validateSha(value: string, fieldName: string = 'sha'): void {\n validateRequired(value, fieldName);\n if (!/^[a-f0-9]{40}$/i.test(value)) {\n throw new ValidationError(\n `${fieldName} must be a 40-character hex string`,\n fieldName,\n 'INVALID_SHA'\n );\n }\n}\n\n/**\n * Validate an ISO 8601 date string\n */\nexport function validateDate(value: string, fieldName: string): void {\n validateRequired(value, fieldName);\n const date = new Date(value);\n if (isNaN(date.getTime())) {\n throw new ValidationError(\n `${fieldName} must be a valid ISO 8601 date`,\n fieldName,\n 'INVALID_DATE'\n );\n }\n}\n\n/**\n * Validate a string length\n */\nexport function validateStringLength(\n value: string,\n fieldName: string,\n minLength: number,\n maxLength: number\n): void {\n if (typeof value !== 'string') {\n throw new ValidationError(\n `${fieldName} must be a string`,\n fieldName,\n 'INVALID_STRING'\n );\n }\n if (value.length < minLength || value.length > maxLength) {\n throw new ValidationError(\n `${fieldName} must be between ${minLength} and ${maxLength} characters`,\n fieldName,\n 'INVALID_LENGTH'\n );\n }\n}\n\n// ============================================================================\n// Tool-Specific Validators\n// ============================================================================\n\ntype ValidatorFn = (args: Record<string, unknown>) => void;\n\n/**\n * Validators for each tool (22 tools)\n * These are applied before the tool handler is called\n */\nexport const toolValidators: Record<string, ValidatorFn> = {\n // Queries\n get: (args) => {\n validateRequired(args.type, 'type');\n validateEnum(\n args.type as string,\n 'type',\n ['project', 'specification', 'epic', 'ticket', 'implementation_session']\n );\n },\n\n list: (args) => {\n validateRequired(args.type, 'type');\n validateEnum(\n args.type as string,\n 'type',\n ['projects', 'specifications', 'epics', 'tickets']\n );\n },\n\n search: (args) => {\n if (!args.query && !args.files && !args.tags && !args.relatedTo) {\n throw new ValidationError(\n 'At least one filter is required: query, files, tags, or relatedTo',\n 'query',\n 'REQUIRED_ONE_OF'\n );\n }\n if (args.query) {\n validateStringLength(args.query as string, 'query', 1, 500);\n }\n if (args.limit !== undefined) {\n validateRange(args.limit as number, 'limit', 1, 100);\n }\n if (args.offset !== undefined) {\n validateRange(args.offset as number, 'offset', 0, 10000);\n }\n },\n\n get_next_actionable_tickets: (args) => {\n // Either specificationId or projectId is required\n if (!args.specificationId && !args.projectId) {\n throw new ValidationError(\n 'Either specificationId or projectId is required',\n 'specificationId/projectId',\n 'REQUIRED_ONE_OF'\n );\n }\n if (args.limit !== undefined) {\n validateRange(args.limit as number, 'limit', 1, 100);\n }\n },\n\n get_blocked_tickets: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n get_report: (args) => {\n validateRequired(args.type, 'type');\n validateRequired(args.scope, 'scope');\n validateRequired(args.scopeId, 'scopeId');\n },\n\n // Lifecycle. Planning verbs inject identity from local config (M9): SPS takes\n // an optional specificationId (falls back to config), APS takes only\n // `operation` (sessionId injected), CPS takes nothing (sessionId injected).\n // So no specificationId/sessionId requirements here — the handlers resolve\n // and validate them.\n start_planning_session: () => {\n /* specificationId optional — handler falls back to config */\n },\n\n action_planning_session: (args) => {\n validateRequired(args.operation, 'operation');\n },\n\n complete_planning_session: () => {\n /* no args — sessionId injected from config */\n },\n\n start_work_session: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n },\n\n action_work_session: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n if (args.filesCreated !== undefined) {\n validateArray(args.filesCreated, 'filesCreated');\n }\n if (args.filesModified !== undefined) {\n validateArray(args.filesModified, 'filesModified');\n }\n if (args.filesDeleted !== undefined) {\n validateArray(args.filesDeleted, 'filesDeleted');\n }\n if (args.blockReason !== undefined) {\n validateStringLength(args.blockReason as string, 'blockReason', 1, 5000);\n }\n if (args.clearBlockReason !== undefined && typeof args.clearBlockReason !== 'boolean') {\n throw new Error('clearBlockReason must be a boolean');\n }\n },\n\n complete_work_session: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n validateRequired(args.summary, 'summary');\n if (args.summary) {\n validateStringLength(args.summary as string, 'summary', 1, 10000);\n }\n if (args.filesModified !== undefined) {\n validateArray(args.filesModified, 'filesModified');\n }\n if (args.filesCreated !== undefined) {\n validateArray(args.filesCreated, 'filesCreated');\n }\n if (args.filesDeleted !== undefined) {\n validateArray(args.filesDeleted, 'filesDeleted');\n }\n },\n\n start_review_session: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n action_review_session: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n complete_review_session: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n reopen_specification: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n // Mutation\n create_specification: (args) => {\n validateRequired(args.projectId, 'projectId');\n validateRequired(args.title, 'title');\n },\n\n // Utilities\n feedback: () => {\n // Validated by feedback handler\n },\n\n reset_work_session: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n link_pull_request: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n if (!args.prNumber && !args.prUrl) {\n throw new ValidationError(\n 'Either prNumber or prUrl must be provided',\n 'prNumber',\n 'REQUIRED_ONE_OF'\n );\n }\n if (args.prNumber !== undefined && typeof args.prNumber !== 'number') {\n throw new ValidationError(\n 'prNumber must be a number',\n 'prNumber',\n 'INVALID_NUMBER'\n );\n }\n if (args.prUrl !== undefined) {\n const url = args.prUrl as string;\n if (!url.includes('github.com') && !url.includes('gitlab.com') && !url.includes('bitbucket.org')) {\n throw new ValidationError(\n 'prUrl must be a valid GitHub, GitLab, or Bitbucket URL',\n 'prUrl',\n 'INVALID_URL'\n );\n }\n }\n },\n\n // Orchestration\n get_critical_path: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n get_dependency_tree: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n};\n\n// ============================================================================\n// Error Transformation\n// ============================================================================\n\n/**\n * MCP error response format\n */\nexport interface MCPErrorResponse {\n content: Array<{\n type: 'text';\n text: string;\n }>;\n isError: true;\n}\n\n/**\n * Transform an error into MCP error response format\n */\nexport function formatMCPError(error: Error): MCPErrorResponse {\n let message = error.message;\n\n if (error instanceof ValidationError) {\n message = `Validation error for '${error.field}': ${error.message} (${error.code})`;\n } else if (error instanceof ApiError) {\n message = formatApiErrorMessage(error);\n }\n\n return {\n content: [\n {\n type: 'text',\n text: message,\n },\n ],\n isError: true,\n };\n}\n\n/**\n * Format API error message based on status code\n */\nfunction formatApiErrorMessage(error: ApiError): string {\n switch (error.statusCode) {\n case 400:\n return `Bad request: ${error.message}`;\n case 401:\n return 'Authentication failed. Check your API key.';\n case 403:\n return 'Permission denied. Your API key may lack required permissions.';\n case 404:\n return `Resource not found: ${error.message}`;\n case 429:\n return 'Rate limit exceeded. Please wait before retrying.';\n case 500:\n case 502:\n case 503:\n case 504:\n return 'Server error. Please try again later.';\n default:\n return error.message;\n }\n}\n\n/**\n * Transform HTTP/network errors into ApiError\n */\nexport function transformError(error: unknown): Error {\n if (error instanceof ValidationError || error instanceof ApiError) {\n return error;\n }\n\n if (error instanceof Error) {\n // Network errors\n if (error.message.includes('ECONNREFUSED')) {\n return new ApiError(\n 'Unable to connect to SpecForge API. Check your network connection.',\n 0,\n 'NETWORK_ERROR'\n );\n }\n if (error.message.includes('ETIMEDOUT')) {\n return new ApiError(\n 'Request timed out. Please try again.',\n 0,\n 'TIMEOUT'\n );\n }\n if (error.message.includes('ECONNRESET')) {\n return new ApiError(\n 'Connection was reset. Please try again.',\n 0,\n 'CONNECTION_RESET'\n );\n }\n\n return error;\n }\n\n return new Error(String(error));\n}\n\n/**\n * Run validation for a specific tool\n * @throws ValidationError if validation fails\n */\nexport function validateToolArgs(\n toolName: string,\n args: Record<string, unknown>\n): void {\n const validator = toolValidators[toolName];\n if (validator) {\n validator(args);\n }\n}\n"],"mappings":"AAQA;AAAA,EAQE;AAAA,EACA;AAAA,EACA;AAA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;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,OAAO,KAAK,CAAC;AAChC;AAMO,SAAS,iBACd,UACA,MACM;AACN,QAAM,YAAY,eAAe,QAAQ;AACzC,MAAI,WAAW;AACb,cAAU,IAAI;AAAA,EAChB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/validation/index.ts"],"sourcesContent":["/**\n * Validation Utilities for MCP Tools\n *\n * Provides comprehensive input validation and error handling for all MCP tools.\n * Validation is run before each tool call to ensure proper argument types and formats.\n */\n\n// Re-export ticket validation utilities\nexport {\n type TicketComplexity,\n type WarningSeverity,\n type StrictnessLevel,\n type ValidationWarning,\n type TicketValidationResult,\n type ComplexityRules,\n type TicketValidationInput,\n validationRules,\n validateTicket,\n filterWarningsByStrictness,\n getComplexityRules,\n isValidComplexity,\n getComplexityDescription,\n suggestComplexity,\n} from './ticket-validation.js';\n\n/**\n * Custom error class for validation failures\n * Includes field name and error code for structured error handling\n */\nexport class ValidationError extends Error {\n constructor(\n message: string,\n public field: string,\n public code: string\n ) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\n/**\n * API Error class for handling HTTP errors from the backend\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public statusCode: number,\n public errorCode?: string\n ) {\n super(message);\n this.name = 'ApiError';\n }\n}\n\n// ============================================================================\n// Basic Validators\n// ============================================================================\n\n/**\n * Validate that a value is present (not null, undefined, or empty string)\n */\nexport function validateRequired(value: unknown, fieldName: string): void {\n if (value === undefined || value === null || value === '') {\n throw new ValidationError(\n `${fieldName} is required`,\n fieldName,\n 'REQUIRED'\n );\n }\n}\n\n/**\n * Validate that a value is a valid UUID format\n */\nexport function validateUUID(value: string, fieldName: string): void {\n validateRequired(value, fieldName);\n const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n if (!uuidRegex.test(value)) {\n throw new ValidationError(\n `${fieldName} must be a valid UUID`,\n fieldName,\n 'INVALID_UUID'\n );\n }\n}\n\n/**\n * Validate that a value is one of the allowed enum values\n */\nexport function validateEnum(\n value: string,\n fieldName: string,\n allowedValues: string[]\n): void {\n validateRequired(value, fieldName);\n if (!allowedValues.includes(value)) {\n throw new ValidationError(\n `${fieldName} must be one of: ${allowedValues.join(', ')}`,\n fieldName,\n 'INVALID_ENUM'\n );\n }\n}\n\n/**\n * Validate that a number is within a range\n */\nexport function validateRange(\n value: number,\n fieldName: string,\n min: number,\n max: number\n): void {\n if (typeof value !== 'number' || isNaN(value)) {\n throw new ValidationError(\n `${fieldName} must be a number`,\n fieldName,\n 'INVALID_NUMBER'\n );\n }\n if (value < min || value > max) {\n throw new ValidationError(\n `${fieldName} must be between ${min} and ${max}`,\n fieldName,\n 'OUT_OF_RANGE'\n );\n }\n}\n\n/**\n * Validate that a value is an array, with optional item validation\n */\nexport function validateArray(\n value: unknown,\n fieldName: string,\n itemValidator?: (item: unknown, index: number) => void\n): void {\n if (!Array.isArray(value)) {\n throw new ValidationError(\n `${fieldName} must be an array`,\n fieldName,\n 'INVALID_ARRAY'\n );\n }\n if (itemValidator) {\n value.forEach((item, index) => {\n try {\n itemValidator(item, index);\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : String(error);\n throw new ValidationError(\n `${fieldName}[${index}]: ${message}`,\n `${fieldName}[${index}]`,\n 'INVALID_ITEM'\n );\n }\n });\n }\n}\n\n/**\n * Validate a 40-character hex SHA\n */\nexport function validateSha(value: string, fieldName: string = 'sha'): void {\n validateRequired(value, fieldName);\n if (!/^[a-f0-9]{40}$/i.test(value)) {\n throw new ValidationError(\n `${fieldName} must be a 40-character hex string`,\n fieldName,\n 'INVALID_SHA'\n );\n }\n}\n\n/**\n * Validate an ISO 8601 date string\n */\nexport function validateDate(value: string, fieldName: string): void {\n validateRequired(value, fieldName);\n const date = new Date(value);\n if (isNaN(date.getTime())) {\n throw new ValidationError(\n `${fieldName} must be a valid ISO 8601 date`,\n fieldName,\n 'INVALID_DATE'\n );\n }\n}\n\n/**\n * Validate a string length\n */\nexport function validateStringLength(\n value: string,\n fieldName: string,\n minLength: number,\n maxLength: number\n): void {\n if (typeof value !== 'string') {\n throw new ValidationError(\n `${fieldName} must be a string`,\n fieldName,\n 'INVALID_STRING'\n );\n }\n if (value.length < minLength || value.length > maxLength) {\n throw new ValidationError(\n `${fieldName} must be between ${minLength} and ${maxLength} characters`,\n fieldName,\n 'INVALID_LENGTH'\n );\n }\n}\n\n// ============================================================================\n// Tool-Specific Validators\n// ============================================================================\n\ntype ValidatorFn = (args: Record<string, unknown>) => void;\n\n/**\n * Validators for each tool (22 tools)\n * These are applied before the tool handler is called\n */\nexport const toolValidators: Record<string, ValidatorFn> = {\n // Queries\n get: (args) => {\n validateRequired(args.type, 'type');\n validateEnum(\n args.type as string,\n 'type',\n ['project', 'specification', 'epic', 'ticket', 'implementation_session']\n );\n },\n\n list: (args) => {\n validateRequired(args.type, 'type');\n validateEnum(\n args.type as string,\n 'type',\n ['projects', 'specifications', 'epics', 'tickets']\n );\n },\n\n search: (args) => {\n if (!args.query && !args.files && !args.tags && !args.relatedTo) {\n throw new ValidationError(\n 'At least one filter is required: query, files, tags, or relatedTo',\n 'query',\n 'REQUIRED_ONE_OF'\n );\n }\n if (args.query) {\n validateStringLength(args.query as string, 'query', 1, 500);\n }\n if (args.limit !== undefined) {\n validateRange(args.limit as number, 'limit', 1, 100);\n }\n if (args.offset !== undefined) {\n validateRange(args.offset as number, 'offset', 0, 10000);\n }\n },\n\n get_next_actionable_tickets: (args) => {\n // Either specificationId or projectId is required\n if (!args.specificationId && !args.projectId) {\n throw new ValidationError(\n 'Either specificationId or projectId is required',\n 'specificationId/projectId',\n 'REQUIRED_ONE_OF'\n );\n }\n if (args.limit !== undefined) {\n validateRange(args.limit as number, 'limit', 1, 100);\n }\n },\n\n get_blocked_tickets: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n get_report: (args) => {\n validateRequired(args.type, 'type');\n validateRequired(args.scope, 'scope');\n validateRequired(args.scopeId, 'scopeId');\n },\n\n // Lifecycle. Planning verbs inject identity from local config (M9): SPS takes\n // an optional specificationId (falls back to config), APS takes only\n // `operation` (sessionId injected), CPS takes nothing (sessionId injected).\n // So no specificationId/sessionId requirements here — the handlers resolve\n // and validate them.\n start_planning_session: () => {\n /* specificationId optional — handler falls back to config */\n },\n\n action_planning_session: (args) => {\n validateRequired(args.operation, 'operation');\n },\n\n complete_planning_session: () => {\n /* no args — sessionId injected from config */\n },\n\n start_work_session: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n },\n\n action_work_session: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n if (args.filesCreated !== undefined) {\n validateArray(args.filesCreated, 'filesCreated');\n }\n if (args.filesModified !== undefined) {\n validateArray(args.filesModified, 'filesModified');\n }\n if (args.filesDeleted !== undefined) {\n validateArray(args.filesDeleted, 'filesDeleted');\n }\n if (args.clearBlockReason !== undefined && typeof args.clearBlockReason !== 'boolean') {\n throw new Error('clearBlockReason must be a boolean');\n }\n },\n\n complete_work_session: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n validateRequired(args.summary, 'summary');\n if (args.summary) {\n validateStringLength(args.summary as string, 'summary', 1, 10000);\n }\n if (args.filesModified !== undefined) {\n validateArray(args.filesModified, 'filesModified');\n }\n if (args.filesCreated !== undefined) {\n validateArray(args.filesCreated, 'filesCreated');\n }\n if (args.filesDeleted !== undefined) {\n validateArray(args.filesDeleted, 'filesDeleted');\n }\n },\n\n reopen_specification: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n // Mutation\n create_specification: (args) => {\n validateRequired(args.projectId, 'projectId');\n validateRequired(args.title, 'title');\n },\n\n // Utilities\n feedback: () => {\n // Validated by feedback handler\n },\n\n link_pull_request: (args) => {\n validateRequired(args.ticketId, 'ticketId');\n if (!args.prNumber && !args.prUrl) {\n throw new ValidationError(\n 'Either prNumber or prUrl must be provided',\n 'prNumber',\n 'REQUIRED_ONE_OF'\n );\n }\n if (args.prNumber !== undefined && typeof args.prNumber !== 'number') {\n throw new ValidationError(\n 'prNumber must be a number',\n 'prNumber',\n 'INVALID_NUMBER'\n );\n }\n if (args.prUrl !== undefined) {\n const url = args.prUrl as string;\n if (!url.includes('github.com') && !url.includes('gitlab.com') && !url.includes('bitbucket.org')) {\n throw new ValidationError(\n 'prUrl must be a valid GitHub, GitLab, or Bitbucket URL',\n 'prUrl',\n 'INVALID_URL'\n );\n }\n }\n },\n\n // Orchestration\n get_critical_path: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n\n get_dependency_tree: (args) => {\n validateRequired(args.specificationId, 'specificationId');\n },\n};\n\n// ============================================================================\n// Error Transformation\n// ============================================================================\n\n/**\n * MCP error response format\n */\nexport interface MCPErrorResponse {\n content: Array<{\n type: 'text';\n text: string;\n }>;\n isError: true;\n}\n\n/**\n * Transform an error into MCP error response format\n */\nexport function formatMCPError(error: Error): MCPErrorResponse {\n let message = error.message;\n\n if (error instanceof ValidationError) {\n message = `Validation error for '${error.field}': ${error.message} (${error.code})`;\n } else if (error instanceof ApiError) {\n message = formatApiErrorMessage(error);\n }\n\n return {\n content: [\n {\n type: 'text',\n text: message,\n },\n ],\n isError: true,\n };\n}\n\n/**\n * Format API error message based on status code\n */\nfunction formatApiErrorMessage(error: ApiError): string {\n switch (error.statusCode) {\n case 400:\n return `Bad request: ${error.message}`;\n case 401:\n return 'Authentication failed. Check your API key.';\n case 403:\n return 'Permission denied. Your API key may lack required permissions.';\n case 404:\n return `Resource not found: ${error.message}`;\n case 429:\n return 'Rate limit exceeded. Please wait before retrying.';\n case 500:\n case 502:\n case 503:\n case 504:\n return 'Server error. Please try again later.';\n default:\n return error.message;\n }\n}\n\n/**\n * Transform HTTP/network errors into ApiError\n */\nexport function transformError(error: unknown): Error {\n if (error instanceof ValidationError || error instanceof ApiError) {\n return error;\n }\n\n if (error instanceof Error) {\n // Network errors\n if (error.message.includes('ECONNREFUSED')) {\n return new ApiError(\n 'Unable to connect to SpecForge API. Check your network connection.',\n 0,\n 'NETWORK_ERROR'\n );\n }\n if (error.message.includes('ETIMEDOUT')) {\n return new ApiError(\n 'Request timed out. Please try again.',\n 0,\n 'TIMEOUT'\n );\n }\n if (error.message.includes('ECONNRESET')) {\n return new ApiError(\n 'Connection was reset. Please try again.',\n 0,\n 'CONNECTION_RESET'\n );\n }\n\n return error;\n }\n\n return new Error(String(error));\n}\n\n/**\n * Run validation for a specific tool\n * @throws ValidationError if validation fails\n */\nexport function validateToolArgs(\n toolName: string,\n args: Record<string, unknown>\n): void {\n const validator = toolValidators[toolName];\n if (validator) {\n validator(args);\n }\n}\n"],"mappings":"AAQA;AAAA,EAQE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMA,MAAM,wBAAwB,MAAM;AAAA,EACzC,YACE,SACO,OACA,MACP;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAKO,MAAM,iBAAiB,MAAM;AAAA,EAClC,YACE,SACO,YACA,WACP;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AASO,SAAS,iBAAiB,OAAgB,WAAyB;AACxE,MAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,UAAM,IAAI;AAAA,MACR,GAAG,SAAS;AAAA,MACZ;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAKO,SAAS,aAAa,OAAe,WAAyB;AACnE,mBAAiB,OAAO,SAAS;AACjC,QAAM,YAAY;AAClB,MAAI,CAAC,UAAU,KAAK,KAAK,GAAG;AAC1B,UAAM,IAAI;AAAA,MACR,GAAG,SAAS;AAAA,MACZ;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAKO,SAAS,aACd,OACA,WACA,eACM;AACN,mBAAiB,OAAO,SAAS;AACjC,MAAI,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A,QAAI,MAAM,QAAQ,SAAS,YAAY,GAAG;AACxC,aAAO,IAAI;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,OAAO,KAAK,CAAC;AAChC;AAMO,SAAS,iBACd,UACA,MACM;AACN,QAAM,YAAY,eAAe,QAAQ;AACzC,MAAI,WAAW;AACb,cAAU,IAAI;AAAA,EAChB;AACF;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @specforge/api-types
|
|
2
|
+
|
|
3
|
+
Catch-all type contracts for SpecForge.
|
|
4
|
+
|
|
5
|
+
## Scope (catch-all rule)
|
|
6
|
+
|
|
7
|
+
If a type is **not** a lifecycle session-type (those live in `@specforge/session-types`), it belongs here. spec-domain types — Spec, Epic, Ticket entities — live in `@specforge/spec-types`; everything else (User, Project, sharing, derived views, API helpers, and the store interfaces for non-session entities) lives in this package.
|
|
8
|
+
|
|
9
|
+
## What's inside
|
|
10
|
+
|
|
11
|
+
### Entity runtime types (`src/runtime/`)
|
|
12
|
+
|
|
13
|
+
- `user.ts` — User entity
|
|
14
|
+
- `project.ts` — Project entity (with denormalized counts)
|
|
15
|
+
- `project-member.ts`, `project-invitation.ts` — sharing entities
|
|
16
|
+
- `dependency-tree.ts` — derived view consumed by tree aggregator + webapp UI
|
|
17
|
+
- `fields.ts` — field-selection helpers for list operations
|
|
18
|
+
- `pagination.ts` — pagination input/info shapes + helpers
|
|
19
|
+
- `summary.ts` — summary-mode response shapes
|
|
20
|
+
- `response.ts` — response-mode types (full/minimal/id-only)
|
|
21
|
+
- `status.ts` — ticket-status enums + transition helpers
|
|
22
|
+
|
|
23
|
+
### Store interfaces (`src/stores/`)
|
|
24
|
+
|
|
25
|
+
All non-session-types store contracts:
|
|
26
|
+
|
|
27
|
+
- `i-user-store.ts`, `i-project-store.ts`, `i-sharing-store.ts` — user + sharing
|
|
28
|
+
- `i-spec-store.ts`, `i-epic-store.ts`, `i-ticket-store.ts`, `i-ticket-dependency-store.ts`, `i-blueprint-store.ts` — spec hierarchy
|
|
29
|
+
|
|
30
|
+
Sessions stay in `@specforge/session-types`. Read-only impls (planning) and full impls (spec hierarchy) live in `@specforge/operations`.
|
|
31
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
|
|
34
|
+
- AWS SDK / smithy / sigv4 imports are forbidden (ESLint-enforced).
|
|
35
|
+
- zod is allowed for entity schemas.
|
|
36
|
+
- This package is consumed by `@specforge/lifecycle` and `@specforge/operations`.
|
|
37
|
+
|
|
38
|
+
Per M4.7 milestone spec.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural contract for the AppSync GraphQL client.
|
|
3
|
+
*
|
|
4
|
+
* The concrete implementation (SigV4-signed, SSM-backed) lives in
|
|
5
|
+
* `@specforge/operations` and `implements` this interface. Relocated here in
|
|
6
|
+
* M7.4c so consumers that only need to *call* the client (e.g. the
|
|
7
|
+
* `@specforge/resolvers` notifier) can type against the contract without
|
|
8
|
+
* importing `@specforge/operations` — breaking the resolvers→operations
|
|
9
|
+
* arch-level cycle (monorepo-topology §2.1c).
|
|
10
|
+
*/
|
|
11
|
+
export interface AppSyncClient {
|
|
12
|
+
/** Resolve (and cache) the AppSync GraphQL endpoint URL. */
|
|
13
|
+
getApiUrl(): Promise<string>;
|
|
14
|
+
query<T>(query: string, variables?: Record<string, unknown>, options?: {
|
|
15
|
+
operationName?: string;
|
|
16
|
+
}): Promise<T>;
|
|
17
|
+
mutate<T>(mutation: string, variables?: Record<string, unknown>, options?: {
|
|
18
|
+
operationName?: string;
|
|
19
|
+
}): Promise<T>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=appsync-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appsync-client.d.ts","sourceRoot":"","sources":["../../src/client/appsync-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,CAAC,CAAC,EACL,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,MAAM,CAAC,CAAC,EACN,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,CAAC,CAAC,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appsync-client.js","sourceRoot":"","sources":["../../src/client/appsync-client.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Entity records, derived views, and API-surface helpers.
|
|
2
|
+
export * from './runtime/index.js';
|
|
3
|
+
// Store contracts for non-session entities.
|
|
4
|
+
export * from './stores/index.js';
|
|
5
|
+
// Client contracts (structural interfaces; implementations live in operations).
|
|
6
|
+
export * from './client/index.js';
|
|
7
|
+
// MCP wire envelopes + error-guidance contract.
|
|
8
|
+
export * from './mcp/index.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,cAAc,oBAAoB,CAAC;AAEnC,4CAA4C;AAC5C,cAAc,mBAAmB,CAAC;AAElC,gFAAgF;AAChF,cAAc,mBAAmB,CAAC;AAElC,gDAAgD;AAChD,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type contract for the error-guidance composer pipeline (ME.4).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the lifecycle guidance pipeline (`PlanningAgentResponse.guidance`),
|
|
5
|
+
* but for the failure modes that produce an `McpStandardErrorEnvelope` — auth,
|
|
6
|
+
* shape, not-found, conflict, precondition, unknown-tool, bare exceptions.
|
|
7
|
+
*
|
|
8
|
+
* This file is a PURE type contract: no runtime, no composer. The three
|
|
9
|
+
* composers (`composeCrudErrorGuidance` in `@specforge/core`,
|
|
10
|
+
* `composeAuthErrorGuidance` / `composeBasicErrorGuidance` in
|
|
11
|
+
* `@specforge/platform`) all consume `ErrorGuidanceInput` and return a non-null
|
|
12
|
+
* `ErrorGuidance` (MB.17.2 amended the ME.4 `INTERNAL → null` convention: every
|
|
13
|
+
* code now emits a recovery hint). The M8 dispatcher's `normaliseError` is the
|
|
14
|
+
* single place that assembles the envelope from the returned guidance — the
|
|
15
|
+
* composers never reference `McpStandardErrorEnvelope` (Option A, ME.4 §2 decision).
|
|
16
|
+
*
|
|
17
|
+
* Canonical reference: docs/architecture/lifecycle-response-convention.md
|
|
18
|
+
* §"Error envelope guidance".
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Output of the error-guidance composer pipeline. `prose` is the canonical
|
|
22
|
+
* agent-facing message — same convention as lifecycle's
|
|
23
|
+
* `PlanningAgentResponse.guidance` (clients read prose verbatim; never parse
|
|
24
|
+
* it). `next_actions` / `related` are structured accessories for UI clients
|
|
25
|
+
* that want to render tool affordances.
|
|
26
|
+
*/
|
|
27
|
+
export interface ErrorGuidance {
|
|
28
|
+
prose: string;
|
|
29
|
+
next_actions?: {
|
|
30
|
+
tool: string;
|
|
31
|
+
args?: Record<string, unknown>;
|
|
32
|
+
reason?: string;
|
|
33
|
+
}[];
|
|
34
|
+
related?: {
|
|
35
|
+
tool: string;
|
|
36
|
+
args?: Record<string, unknown>;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Closed set of entity types an error can reference. Declared here so both the
|
|
41
|
+
* CRUD error classes (operations) and the composers (core/platform) share one
|
|
42
|
+
* definition.
|
|
43
|
+
*/
|
|
44
|
+
export type ErrorGuidanceEntityType = 'spec' | 'epic' | 'ticket' | 'planning_session' | 'blueprint' | 'project' | 'pull_request' | 'dependency' | 'ticket_blueprint_ref';
|
|
45
|
+
/** The seven MCP error codes a public tool can surface (ME.4 §2.5). */
|
|
46
|
+
export type ErrorGuidanceCode = 'NOT_FOUND' | 'VALIDATION_FAILED' | 'CONFLICT' | 'PRECONDITION_FAILED' | 'UNAUTHORISED' | 'UNKNOWN_TOOL' | 'INTERNAL';
|
|
47
|
+
/**
|
|
48
|
+
* Shared input shape consumed by all three composers. Materialised by each
|
|
49
|
+
* typed error class's `toGuidanceInput(ctx)` (CRUD/auth) or synthesised by the
|
|
50
|
+
* dispatcher (basic / unknown-tool).
|
|
51
|
+
*/
|
|
52
|
+
export interface ErrorGuidanceInput {
|
|
53
|
+
code: ErrorGuidanceCode;
|
|
54
|
+
/** Verb that threw. */
|
|
55
|
+
tool: string;
|
|
56
|
+
args?: Record<string, unknown>;
|
|
57
|
+
context: {
|
|
58
|
+
entityType?: ErrorGuidanceEntityType;
|
|
59
|
+
entityId?: string;
|
|
60
|
+
/** VALIDATION_FAILED — the field that failed the schema. */
|
|
61
|
+
failingField?: string;
|
|
62
|
+
/** PRECONDITION_FAILED — status the verb required. */
|
|
63
|
+
expectedStatus?: string;
|
|
64
|
+
/** PRECONDITION_FAILED — status the entity is actually in. */
|
|
65
|
+
actualStatus?: string;
|
|
66
|
+
/** CONFLICT — the pre-existing entity that collides. */
|
|
67
|
+
conflictingEntityId?: string;
|
|
68
|
+
/** UNAUTHORISED — the scope/permission that was missing. */
|
|
69
|
+
requiredScope?: string;
|
|
70
|
+
/** UNKNOWN_TOOL — the registered verbs, for the "did you mean" hint. */
|
|
71
|
+
availableTools?: string[];
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=error-guidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-guidance.d.ts","sourceRoot":"","sources":["../../src/mcp/error-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnF,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,MAAM,GACN,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,YAAY,GACZ,sBAAsB,CAAC;AAE3B,uEAAuE;AACvE,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,mBAAmB,GACnB,UAAU,GACV,qBAAqB,GACrB,cAAc,GACd,cAAc,GACd,UAAU,CAAC;AAEf;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,uBAAuB,CAAC;QACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,4DAA4D;QAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,sDAAsD;QACtD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,8DAA8D;QAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,wDAAwD;QACxD,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,4DAA4D;QAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,wEAAwE;QACxE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type contract for the error-guidance composer pipeline (ME.4).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the lifecycle guidance pipeline (`PlanningAgentResponse.guidance`),
|
|
5
|
+
* but for the failure modes that produce an `McpStandardErrorEnvelope` — auth,
|
|
6
|
+
* shape, not-found, conflict, precondition, unknown-tool, bare exceptions.
|
|
7
|
+
*
|
|
8
|
+
* This file is a PURE type contract: no runtime, no composer. The three
|
|
9
|
+
* composers (`composeCrudErrorGuidance` in `@specforge/core`,
|
|
10
|
+
* `composeAuthErrorGuidance` / `composeBasicErrorGuidance` in
|
|
11
|
+
* `@specforge/platform`) all consume `ErrorGuidanceInput` and return a non-null
|
|
12
|
+
* `ErrorGuidance` (MB.17.2 amended the ME.4 `INTERNAL → null` convention: every
|
|
13
|
+
* code now emits a recovery hint). The M8 dispatcher's `normaliseError` is the
|
|
14
|
+
* single place that assembles the envelope from the returned guidance — the
|
|
15
|
+
* composers never reference `McpStandardErrorEnvelope` (Option A, ME.4 §2 decision).
|
|
16
|
+
*
|
|
17
|
+
* Canonical reference: docs/architecture/lifecycle-response-convention.md
|
|
18
|
+
* §"Error envelope guidance".
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=error-guidance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-guidance.js","sourceRoot":"","sources":["../../src/mcp/error-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AAIxC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// MCP wire envelopes shared by CLI, webapp, and external MCP clients.
|
|
2
|
+
export * from './lifecycle-envelope.js';
|
|
3
|
+
// Error-guidance contract consumed by the composer pipeline (ME.4) and the
|
|
4
|
+
// M8 standard-error envelope.
|
|
5
|
+
export * from './error-guidance.js';
|
|
6
|
+
// Standard (non-lifecycle) error envelope (M8).
|
|
7
|
+
export * from './standard-envelope.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,cAAc,yBAAyB,CAAC;AAExC,2EAA2E;AAC3E,8BAA8B;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,gDAAgD;AAChD,cAAc,wBAAwB,CAAC"}
|