@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217080011 → 0.0.0-canary-20251219202229
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/LICENSE +21 -0
- package/dist/adapters/ai.d.ts +7 -8
- package/dist/adapters/ai.d.ts.map +1 -0
- package/dist/adapters/factory.d.ts +20 -21
- package/dist/adapters/factory.d.ts.map +1 -0
- package/dist/adapters/fs.d.ts +6 -7
- package/dist/adapters/fs.d.ts.map +1 -0
- package/dist/adapters/git.d.ts +6 -7
- package/dist/adapters/git.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +11 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/logger.d.ts +9 -8
- package/dist/adapters/logger.d.ts.map +1 -0
- package/dist/adapters/watcher.d.ts +6 -7
- package/dist/adapters/watcher.d.ts.map +1 -0
- package/dist/adapters/workspace.d.ts +37 -39
- package/dist/adapters/workspace.d.ts.map +1 -0
- package/dist/ai/agents/claude-code-agent.d.ts +20 -20
- package/dist/ai/agents/claude-code-agent.d.ts.map +1 -0
- package/dist/ai/agents/cursor-agent.d.ts +66 -66
- package/dist/ai/agents/cursor-agent.d.ts.map +1 -0
- package/dist/ai/agents/index.d.ts +10 -0
- package/dist/ai/agents/index.d.ts.map +1 -0
- package/dist/ai/agents/openai-codex-agent.d.ts +20 -20
- package/dist/ai/agents/openai-codex-agent.d.ts.map +1 -0
- package/dist/ai/agents/orchestrator.d.ts +48 -48
- package/dist/ai/agents/orchestrator.d.ts.map +1 -0
- package/dist/ai/agents/simple-agent.d.ts +15 -15
- package/dist/ai/agents/simple-agent.d.ts.map +1 -0
- package/dist/ai/agents/types.d.ts +26 -28
- package/dist/ai/agents/types.d.ts.map +1 -0
- package/dist/ai/client.d.ts +74 -78
- package/dist/ai/client.d.ts.map +1 -0
- package/dist/ai/index.d.ts +8 -16
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/prompts/code-generation.d.ts +6 -10
- package/dist/ai/prompts/code-generation.d.ts.map +1 -0
- package/dist/ai/prompts/index.d.ts +6 -9
- package/dist/ai/prompts/index.d.ts.map +1 -0
- package/dist/ai/prompts/spec-creation.d.ts +7 -13
- package/dist/ai/prompts/spec-creation.d.ts.map +1 -0
- package/dist/ai/providers.d.ts +13 -12
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/formatters/index.d.ts +7 -10
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/json.d.ts +65 -63
- package/dist/formatters/json.d.ts.map +1 -0
- package/dist/formatters/sarif.d.ts +77 -72
- package/dist/formatters/sarif.d.ts.map +1 -0
- package/dist/formatters/text.d.ts +21 -19
- package/dist/formatters/text.d.ts.map +1 -0
- package/dist/index.d.ts +14 -66
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4531 -81
- package/dist/ports/ai.d.ts +41 -38
- package/dist/ports/ai.d.ts.map +1 -0
- package/dist/ports/fs.d.ts +63 -65
- package/dist/ports/fs.d.ts.map +1 -0
- package/dist/ports/git.d.ts +19 -21
- package/dist/ports/git.d.ts.map +1 -0
- package/dist/ports/index.d.ts +10 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/logger.d.ts +58 -65
- package/dist/ports/logger.d.ts.map +1 -0
- package/dist/ports/watcher.d.ts +24 -26
- package/dist/ports/watcher.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/claude-code.d.ts +30 -28
- package/dist/services/agent-guide/adapters/claude-code.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts +34 -32
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts +47 -45
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/index.d.ts +15 -13
- package/dist/services/agent-guide/adapters/index.d.ts.map +1 -0
- package/dist/services/agent-guide/agent-guide-service.d.ts +48 -45
- package/dist/services/agent-guide/agent-guide-service.d.ts.map +1 -0
- package/dist/services/agent-guide/index.d.ts +12 -0
- package/dist/services/agent-guide/index.d.ts.map +1 -0
- package/dist/services/agent-guide/types.d.ts +46 -47
- package/dist/services/agent-guide/types.d.ts.map +1 -0
- package/dist/services/build.d.ts +41 -39
- package/dist/services/build.d.ts.map +1 -0
- package/dist/services/ci-check/ci-check-service.d.ts +13 -11
- package/dist/services/ci-check/ci-check-service.d.ts.map +1 -0
- package/dist/services/ci-check/index.d.ts +6 -0
- package/dist/services/ci-check/index.d.ts.map +1 -0
- package/dist/services/ci-check/types.d.ts +100 -102
- package/dist/services/ci-check/types.d.ts.map +1 -0
- package/dist/services/clean.d.ts +38 -37
- package/dist/services/clean.d.ts.map +1 -0
- package/dist/services/config.d.ts +14 -15
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/deps.d.ts +29 -30
- package/dist/services/deps.d.ts.map +1 -0
- package/dist/services/diff.d.ts +20 -21
- package/dist/services/diff.d.ts.map +1 -0
- package/dist/services/doctor/checks/ai.d.ts +10 -0
- package/dist/services/doctor/checks/ai.d.ts.map +1 -0
- package/dist/services/doctor/checks/cli.d.ts +10 -0
- package/dist/services/doctor/checks/cli.d.ts.map +1 -0
- package/dist/services/doctor/checks/config.d.ts +10 -0
- package/dist/services/doctor/checks/config.d.ts.map +1 -0
- package/dist/services/doctor/checks/deps.d.ts +10 -0
- package/dist/services/doctor/checks/deps.d.ts.map +1 -0
- package/dist/services/doctor/checks/index.d.ts +10 -0
- package/dist/services/doctor/checks/index.d.ts.map +1 -0
- package/dist/services/doctor/checks/mcp.d.ts +10 -0
- package/dist/services/doctor/checks/mcp.d.ts.map +1 -0
- package/dist/services/doctor/checks/workspace.d.ts +12 -0
- package/dist/services/doctor/checks/workspace.d.ts.map +1 -0
- package/dist/services/doctor/doctor-service.d.ts +14 -13
- package/dist/services/doctor/doctor-service.d.ts.map +1 -0
- package/dist/services/doctor/index.d.ts +8 -0
- package/dist/services/doctor/index.d.ts.map +1 -0
- package/dist/services/doctor/types.d.ts +70 -72
- package/dist/services/doctor/types.d.ts.map +1 -0
- package/dist/services/implementation/discovery.d.ts +16 -14
- package/dist/services/implementation/discovery.d.ts.map +1 -0
- package/dist/services/implementation/index.d.ts +7 -0
- package/dist/services/implementation/index.d.ts.map +1 -0
- package/dist/services/implementation/resolver.d.ts +31 -27
- package/dist/services/implementation/resolver.d.ts.map +1 -0
- package/dist/services/implementation/types.d.ts +55 -56
- package/dist/services/implementation/types.d.ts.map +1 -0
- package/dist/services/index.d.ts +28 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/integrity-diagram.d.ts +29 -25
- package/dist/services/integrity-diagram.d.ts.map +1 -0
- package/dist/services/integrity.d.ts +100 -96
- package/dist/services/integrity.d.ts.map +1 -0
- package/dist/services/list.d.ts +18 -19
- package/dist/services/list.d.ts.map +1 -0
- package/dist/services/openapi/export-service.d.ts +39 -40
- package/dist/services/openapi/export-service.d.ts.map +1 -0
- package/dist/services/openapi/import-service.d.ts +10 -11
- package/dist/services/openapi/import-service.d.ts.map +1 -0
- package/dist/services/openapi/index.d.ts +10 -0
- package/dist/services/openapi/index.d.ts.map +1 -0
- package/dist/services/openapi/sync-service.d.ts +12 -13
- package/dist/services/openapi/sync-service.d.ts.map +1 -0
- package/dist/services/openapi/types.d.ts +141 -143
- package/dist/services/openapi/types.d.ts.map +1 -0
- package/dist/services/openapi/validate-service.d.ts +10 -11
- package/dist/services/openapi/validate-service.d.ts.map +1 -0
- package/dist/services/regenerator.d.ts +18 -16
- package/dist/services/regenerator.d.ts.map +1 -0
- package/dist/services/registry.d.ts +25 -26
- package/dist/services/registry.d.ts.map +1 -0
- package/dist/services/setup/config-generators.d.ts +14 -13
- package/dist/services/setup/config-generators.d.ts.map +1 -0
- package/dist/services/setup/file-merger.d.ts +5 -7
- package/dist/services/setup/file-merger.d.ts.map +1 -0
- package/dist/services/setup/index.d.ts +10 -0
- package/dist/services/setup/index.d.ts.map +1 -0
- package/dist/services/setup/setup-service.d.ts +10 -8
- package/dist/services/setup/setup-service.d.ts.map +1 -0
- package/dist/services/setup/targets/agents-md.d.ts +12 -0
- package/dist/services/setup/targets/agents-md.d.ts.map +1 -0
- package/dist/services/setup/targets/cli-config.d.ts +12 -0
- package/dist/services/setup/targets/cli-config.d.ts.map +1 -0
- package/dist/services/setup/targets/cursor-rules.d.ts +10 -0
- package/dist/services/setup/targets/cursor-rules.d.ts.map +1 -0
- package/dist/services/setup/targets/index.d.ts +10 -0
- package/dist/services/setup/targets/index.d.ts.map +1 -0
- package/dist/services/setup/targets/mcp-claude.d.ts +11 -0
- package/dist/services/setup/targets/mcp-claude.d.ts.map +1 -0
- package/dist/services/setup/targets/mcp-cursor.d.ts +10 -0
- package/dist/services/setup/targets/mcp-cursor.d.ts.map +1 -0
- package/dist/services/setup/targets/vscode-settings.d.ts +13 -0
- package/dist/services/setup/targets/vscode-settings.d.ts.map +1 -0
- package/dist/services/setup/types.d.ts +51 -53
- package/dist/services/setup/types.d.ts.map +1 -0
- package/dist/services/sync.d.ts +37 -35
- package/dist/services/sync.d.ts.map +1 -0
- package/dist/services/test.d.ts +15 -13
- package/dist/services/test.d.ts.map +1 -0
- package/dist/services/validate-implementation.d.ts +30 -28
- package/dist/services/validate-implementation.d.ts.map +1 -0
- package/dist/services/validate.d.ts +23 -24
- package/dist/services/validate.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/filesystem.d.ts +40 -38
- package/dist/services/verification-cache/adapters/filesystem.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/in-memory.d.ts +21 -19
- package/dist/services/verification-cache/adapters/in-memory.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/index.d.ts +7 -0
- package/dist/services/verification-cache/adapters/index.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/workspace-state.d.ts +39 -37
- package/dist/services/verification-cache/adapters/workspace-state.d.ts.map +1 -0
- package/dist/services/verification-cache/cache-service.d.ts +55 -53
- package/dist/services/verification-cache/cache-service.d.ts.map +1 -0
- package/dist/services/verification-cache/index.d.ts +7 -0
- package/dist/services/verification-cache/index.d.ts.map +1 -0
- package/dist/services/verification-cache/types.d.ts +84 -85
- package/dist/services/verification-cache/types.d.ts.map +1 -0
- package/dist/services/verify/ai-verifier.d.ts +13 -11
- package/dist/services/verify/ai-verifier.d.ts.map +1 -0
- package/dist/services/verify/behavior-verifier.d.ts +10 -8
- package/dist/services/verify/behavior-verifier.d.ts.map +1 -0
- package/dist/services/verify/index.d.ts +18 -0
- package/dist/services/verify/index.d.ts.map +1 -0
- package/dist/services/verify/structure-verifier.d.ts +12 -8
- package/dist/services/verify/structure-verifier.d.ts.map +1 -0
- package/dist/services/verify/types.d.ts +114 -115
- package/dist/services/verify/types.d.ts.map +1 -0
- package/dist/services/verify/verify-service.d.ts +51 -49
- package/dist/services/verify/verify-service.d.ts.map +1 -0
- package/dist/services/watch.d.ts +22 -21
- package/dist/services/watch.d.ts.map +1 -0
- package/dist/services/workspace-info.d.ts +40 -37
- package/dist/services/workspace-info.d.ts.map +1 -0
- package/dist/templates/app-config.template.d.ts +3 -6
- package/dist/templates/app-config.template.d.ts.map +1 -0
- package/dist/templates/data-view.template.d.ts +3 -6
- package/dist/templates/data-view.template.d.ts.map +1 -0
- package/dist/templates/event.template.d.ts +3 -7
- package/dist/templates/event.template.d.ts.map +1 -0
- package/dist/templates/experiment.template.d.ts +3 -6
- package/dist/templates/experiment.template.d.ts.map +1 -0
- package/dist/templates/handler.template.d.ts +4 -6
- package/dist/templates/handler.template.d.ts.map +1 -0
- package/dist/templates/index.d.ts +17 -20
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/integration.template.d.ts +3 -6
- package/dist/templates/integration.template.d.ts.map +1 -0
- package/dist/templates/knowledge.template.d.ts +3 -6
- package/dist/templates/knowledge.template.d.ts.map +1 -0
- package/dist/templates/migration.template.d.ts +3 -6
- package/dist/templates/migration.template.d.ts.map +1 -0
- package/dist/templates/operation.template.d.ts +3 -7
- package/dist/templates/operation.template.d.ts.map +1 -0
- package/dist/templates/operation.template.test.d.ts +2 -0
- package/dist/templates/operation.template.test.d.ts.map +1 -0
- package/dist/templates/presentation.template.d.ts +3 -7
- package/dist/templates/presentation.template.d.ts.map +1 -0
- package/dist/templates/telemetry.template.d.ts +3 -6
- package/dist/templates/telemetry.template.d.ts.map +1 -0
- package/dist/templates/workflow-runner.template.d.ts +7 -13
- package/dist/templates/workflow-runner.template.d.ts.map +1 -0
- package/dist/templates/workflow.template.d.ts +3 -6
- package/dist/templates/workflow.template.d.ts.map +1 -0
- package/dist/types/config.d.ts +18 -20
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types.d.ts +338 -311
- package/dist/types.d.ts.map +1 -0
- package/package.json +16 -15
- package/dist/_virtual/rolldown_runtime.js +0 -22
- package/dist/adapters/ai.js +0 -82
- package/dist/adapters/factory.js +0 -36
- package/dist/adapters/fs.js +0 -118
- package/dist/adapters/git.js +0 -54
- package/dist/adapters/index.js +0 -7
- package/dist/adapters/logger.js +0 -80
- package/dist/adapters/watcher.js +0 -69
- package/dist/adapters/workspace.js +0 -190
- package/dist/ai/agents/claude-code-agent.js +0 -181
- package/dist/ai/agents/cursor-agent.js +0 -437
- package/dist/ai/agents/index.js +0 -5
- package/dist/ai/agents/openai-codex-agent.js +0 -166
- package/dist/ai/agents/orchestrator.js +0 -142
- package/dist/ai/agents/simple-agent.js +0 -91
- package/dist/ai/client.js +0 -162
- package/dist/ai/index.js +0 -27
- package/dist/ai/prompts/code-generation.js +0 -142
- package/dist/ai/prompts/index.js +0 -12
- package/dist/ai/prompts/spec-creation.js +0 -110
- package/dist/ai/providers.js +0 -40
- package/dist/formatters/index.js +0 -18
- package/dist/formatters/json.js +0 -71
- package/dist/formatters/sarif.js +0 -163
- package/dist/formatters/text.js +0 -208
- package/dist/libs/ai-providers/dist/factory.js +0 -154
- package/dist/libs/ai-providers/dist/index.js +0 -4
- package/dist/libs/ai-providers/dist/legacy.js +0 -72
- package/dist/libs/ai-providers/dist/models.js +0 -287
- package/dist/libs/ai-providers/dist/validation.js +0 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -8
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -72
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -24
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -352
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -211
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -75
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -2
- package/dist/libs/contracts/dist/regenerator/service.js +0 -92
- package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
- package/dist/libs/contracts/dist/registry.js +0 -208
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -35
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -150
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
- package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
- package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
- package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
- package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
- package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
- package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
- package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
- package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
- package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
- package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
- package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
- package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
- package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
- package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
- package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
- package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
- package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
- package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
- package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
- package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
- package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
- package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
- package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
- package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
- package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
- package/dist/services/agent-guide/adapters/claude-code.js +0 -144
- package/dist/services/agent-guide/adapters/cursor-cli.js +0 -135
- package/dist/services/agent-guide/adapters/generic-mcp.js +0 -159
- package/dist/services/agent-guide/adapters/index.js +0 -30
- package/dist/services/agent-guide/agent-guide-service.js +0 -148
- package/dist/services/agent-guide/index.js +0 -5
- package/dist/services/build.js +0 -140
- package/dist/services/ci-check/ci-check-service.js +0 -393
- package/dist/services/ci-check/index.js +0 -2
- package/dist/services/ci-check/types.js +0 -28
- package/dist/services/clean.js +0 -71
- package/dist/services/config.js +0 -76
- package/dist/services/deps.js +0 -62
- package/dist/services/diff.js +0 -33
- package/dist/services/doctor/checks/ai.js +0 -118
- package/dist/services/doctor/checks/cli.js +0 -146
- package/dist/services/doctor/checks/config.js +0 -170
- package/dist/services/doctor/checks/deps.js +0 -180
- package/dist/services/doctor/checks/index.js +0 -6
- package/dist/services/doctor/checks/mcp.js +0 -144
- package/dist/services/doctor/checks/workspace.js +0 -243
- package/dist/services/doctor/doctor-service.js +0 -115
- package/dist/services/doctor/index.js +0 -2
- package/dist/services/doctor/types.js +0 -26
- package/dist/services/implementation/discovery.js +0 -143
- package/dist/services/implementation/index.js +0 -2
- package/dist/services/implementation/resolver.js +0 -223
- package/dist/services/index.js +0 -53
- package/dist/services/integrity-diagram.js +0 -274
- package/dist/services/integrity.js +0 -272
- package/dist/services/list.js +0 -35
- package/dist/services/openapi/export-service.js +0 -51
- package/dist/services/openapi/import-service.js +0 -75
- package/dist/services/openapi/index.js +0 -4
- package/dist/services/openapi/sync-service.js +0 -121
- package/dist/services/openapi/validate-service.js +0 -130
- package/dist/services/regenerator.js +0 -23
- package/dist/services/registry.js +0 -73
- package/dist/services/setup/config-generators.js +0 -237
- package/dist/services/setup/file-merger.js +0 -60
- package/dist/services/setup/index.js +0 -4
- package/dist/services/setup/setup-service.js +0 -95
- package/dist/services/setup/targets/agents-md.js +0 -46
- package/dist/services/setup/targets/cli-config.js +0 -59
- package/dist/services/setup/targets/cursor-rules.js +0 -47
- package/dist/services/setup/targets/mcp-claude.js +0 -59
- package/dist/services/setup/targets/mcp-cursor.js +0 -58
- package/dist/services/setup/targets/vscode-settings.js +0 -62
- package/dist/services/setup/types.js +0 -26
- package/dist/services/sync.js +0 -62
- package/dist/services/test.js +0 -30
- package/dist/services/validate-implementation.js +0 -69
- package/dist/services/validate.js +0 -47
- package/dist/services/verification-cache/adapters/filesystem.js +0 -121
- package/dist/services/verification-cache/adapters/in-memory.js +0 -45
- package/dist/services/verification-cache/adapters/index.js +0 -3
- package/dist/services/verification-cache/adapters/workspace-state.js +0 -90
- package/dist/services/verification-cache/cache-service.js +0 -255
- package/dist/services/verification-cache/index.js +0 -6
- package/dist/services/verification-cache/types.js +0 -15
- package/dist/services/verify/ai-verifier.js +0 -403
- package/dist/services/verify/behavior-verifier.js +0 -185
- package/dist/services/verify/index.js +0 -4
- package/dist/services/verify/structure-verifier.js +0 -195
- package/dist/services/verify/verify-service.js +0 -203
- package/dist/services/watch.js +0 -31
- package/dist/services/workspace-info.js +0 -102
- package/dist/templates/app-config.template.js +0 -106
- package/dist/templates/data-view.template.js +0 -69
- package/dist/templates/event.template.js +0 -39
- package/dist/templates/experiment.template.js +0 -88
- package/dist/templates/handler.template.js +0 -99
- package/dist/templates/index.js +0 -36
- package/dist/templates/integration.template.js +0 -159
- package/dist/templates/knowledge.template.js +0 -74
- package/dist/templates/migration.template.js +0 -61
- package/dist/templates/operation.template.js +0 -104
- package/dist/templates/presentation.template.js +0 -79
- package/dist/templates/telemetry.template.js +0 -90
- package/dist/templates/workflow-runner.template.js +0 -49
- package/dist/templates/workflow.template.js +0 -68
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import { jsonSchemaForSpec } from "../jsonschema.js";
|
|
2
|
-
import { isEmitDeclRef } from "../spec.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../libs/contracts/dist/llm/exporters.js
|
|
5
|
-
const DEFAULT_SPEC_OPTIONS = {
|
|
6
|
-
format: "full",
|
|
7
|
-
includeSchemas: true,
|
|
8
|
-
includeScenarios: true,
|
|
9
|
-
includeExamples: true,
|
|
10
|
-
includePolicy: true,
|
|
11
|
-
includeSideEffects: true
|
|
12
|
-
};
|
|
13
|
-
const DEFAULT_FEATURE_OPTIONS = {
|
|
14
|
-
...DEFAULT_SPEC_OPTIONS,
|
|
15
|
-
includeRelatedSpecs: true,
|
|
16
|
-
includeRelatedEvents: true,
|
|
17
|
-
includeRelatedPresentations: true
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Export a single spec to full markdown with all details.
|
|
21
|
-
* Includes: all fields, I/O schemas, policy, events, examples.
|
|
22
|
-
* Best for: Complete documentation, implementation reference.
|
|
23
|
-
*/
|
|
24
|
-
function specToFullMarkdown(spec, options = {}) {
|
|
25
|
-
const opts = {
|
|
26
|
-
...DEFAULT_SPEC_OPTIONS,
|
|
27
|
-
...options
|
|
28
|
-
};
|
|
29
|
-
const m = spec.meta;
|
|
30
|
-
const lines = [];
|
|
31
|
-
lines.push(`# ${m.name}.v${m.version}`);
|
|
32
|
-
lines.push("");
|
|
33
|
-
lines.push(`> ${m.description}`);
|
|
34
|
-
lines.push("");
|
|
35
|
-
lines.push("## Metadata");
|
|
36
|
-
lines.push("");
|
|
37
|
-
lines.push("| Field | Value |");
|
|
38
|
-
lines.push("|-------|-------|");
|
|
39
|
-
lines.push(`| Kind | ${m.kind} |`);
|
|
40
|
-
lines.push(`| Stability | ${m.stability} |`);
|
|
41
|
-
lines.push(`| Owners | ${m.owners.join(", ")} |`);
|
|
42
|
-
lines.push(`| Tags | ${m.tags.join(", ")} |`);
|
|
43
|
-
lines.push("");
|
|
44
|
-
lines.push("## Goal");
|
|
45
|
-
lines.push("");
|
|
46
|
-
lines.push(m.goal);
|
|
47
|
-
lines.push("");
|
|
48
|
-
lines.push("## Context");
|
|
49
|
-
lines.push("");
|
|
50
|
-
lines.push(m.context);
|
|
51
|
-
lines.push("");
|
|
52
|
-
if (opts.includeSchemas) {
|
|
53
|
-
lines.push("## Input/Output");
|
|
54
|
-
lines.push("");
|
|
55
|
-
if (spec.io.input) {
|
|
56
|
-
lines.push("### Input Schema");
|
|
57
|
-
lines.push("");
|
|
58
|
-
lines.push("```json");
|
|
59
|
-
try {
|
|
60
|
-
const schema = jsonSchemaForSpec(spec);
|
|
61
|
-
lines.push(JSON.stringify(schema.input ?? {}, null, 2));
|
|
62
|
-
} catch {
|
|
63
|
-
lines.push("// Schema generation not available");
|
|
64
|
-
}
|
|
65
|
-
lines.push("```");
|
|
66
|
-
lines.push("");
|
|
67
|
-
}
|
|
68
|
-
lines.push("### Output Schema");
|
|
69
|
-
lines.push("");
|
|
70
|
-
lines.push("```json");
|
|
71
|
-
try {
|
|
72
|
-
const schema = jsonSchemaForSpec(spec);
|
|
73
|
-
lines.push(JSON.stringify(schema.output ?? {}, null, 2));
|
|
74
|
-
} catch {
|
|
75
|
-
lines.push("// Schema generation not available");
|
|
76
|
-
}
|
|
77
|
-
lines.push("```");
|
|
78
|
-
lines.push("");
|
|
79
|
-
if (spec.io.errors && Object.keys(spec.io.errors).length) {
|
|
80
|
-
lines.push("### Error Codes");
|
|
81
|
-
lines.push("");
|
|
82
|
-
lines.push("| Code | HTTP | Description | When |");
|
|
83
|
-
lines.push("|------|------|-------------|------|");
|
|
84
|
-
for (const [code, err] of Object.entries(spec.io.errors)) lines.push(`| \`${code}\` | ${err.http ?? 400} | ${err.description} | ${err.when} |`);
|
|
85
|
-
lines.push("");
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (opts.includePolicy) {
|
|
89
|
-
lines.push("## Policy");
|
|
90
|
-
lines.push("");
|
|
91
|
-
lines.push(`- **Auth Required:** ${spec.policy.auth}`);
|
|
92
|
-
lines.push(`- **Idempotent:** ${spec.policy.idempotent ?? m.kind === "query"}`);
|
|
93
|
-
if (spec.policy.rateLimit) lines.push(`- **Rate Limit:** ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);
|
|
94
|
-
if (spec.policy.flags?.length) lines.push(`- **Feature Flags:** ${spec.policy.flags.join(", ")}`);
|
|
95
|
-
if (spec.policy.pii?.length) lines.push(`- **PII Fields:** ${spec.policy.pii.join(", ")}`);
|
|
96
|
-
if (spec.policy.escalate) lines.push(`- **Escalation:** ${spec.policy.escalate}`);
|
|
97
|
-
lines.push("");
|
|
98
|
-
}
|
|
99
|
-
if (opts.includeSideEffects && spec.sideEffects) {
|
|
100
|
-
if (spec.sideEffects.emits?.length) {
|
|
101
|
-
lines.push("## Events Emitted");
|
|
102
|
-
lines.push("");
|
|
103
|
-
for (const e of spec.sideEffects.emits) if (isEmitDeclRef(e)) lines.push(`- \`${e.ref.name}.v${e.ref.version}\` — ${e.when}`);
|
|
104
|
-
else lines.push(`- \`${e.name}.v${e.version}\` — ${e.when}`);
|
|
105
|
-
lines.push("");
|
|
106
|
-
}
|
|
107
|
-
if (spec.sideEffects.analytics?.length) {
|
|
108
|
-
lines.push("## Analytics Events");
|
|
109
|
-
lines.push("");
|
|
110
|
-
for (const a of spec.sideEffects.analytics) lines.push(`- ${a}`);
|
|
111
|
-
lines.push("");
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (opts.includeScenarios && spec.acceptance?.scenarios?.length) {
|
|
115
|
-
lines.push("## Acceptance Scenarios");
|
|
116
|
-
lines.push("");
|
|
117
|
-
for (const s of spec.acceptance.scenarios) {
|
|
118
|
-
lines.push(`### ${s.name}`);
|
|
119
|
-
lines.push("");
|
|
120
|
-
lines.push("**Given:**");
|
|
121
|
-
for (const g of s.given) lines.push(`- ${g}`);
|
|
122
|
-
lines.push("");
|
|
123
|
-
lines.push("**When:**");
|
|
124
|
-
for (const w of s.when) lines.push(`- ${w}`);
|
|
125
|
-
lines.push("");
|
|
126
|
-
lines.push("**Then:**");
|
|
127
|
-
for (const t of s.then) lines.push(`- ${t}`);
|
|
128
|
-
lines.push("");
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (opts.includeExamples && spec.acceptance?.examples?.length) {
|
|
132
|
-
lines.push("## Examples");
|
|
133
|
-
lines.push("");
|
|
134
|
-
for (const ex of spec.acceptance.examples) {
|
|
135
|
-
lines.push(`### ${ex.name}`);
|
|
136
|
-
lines.push("");
|
|
137
|
-
lines.push("**Input:**");
|
|
138
|
-
lines.push("```json");
|
|
139
|
-
lines.push(JSON.stringify(ex.input, null, 2));
|
|
140
|
-
lines.push("```");
|
|
141
|
-
lines.push("");
|
|
142
|
-
lines.push("**Output:**");
|
|
143
|
-
lines.push("```json");
|
|
144
|
-
lines.push(JSON.stringify(ex.output, null, 2));
|
|
145
|
-
lines.push("```");
|
|
146
|
-
lines.push("");
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (spec.transport) {
|
|
150
|
-
lines.push("## Transport Configuration");
|
|
151
|
-
lines.push("");
|
|
152
|
-
if (spec.transport.rest) lines.push(`- **REST:** ${spec.transport.rest.method ?? "POST"} ${spec.transport.rest.path ?? "auto"}`);
|
|
153
|
-
if (spec.transport.gql) lines.push(`- **GraphQL:** ${spec.transport.gql.field ?? "auto"}`);
|
|
154
|
-
if (spec.transport.mcp) lines.push(`- **MCP Tool:** ${spec.transport.mcp.toolName ?? "auto"}`);
|
|
155
|
-
lines.push("");
|
|
156
|
-
}
|
|
157
|
-
return lines.join("\n");
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Export a single spec as an actionable agent prompt.
|
|
161
|
-
* Includes: instructions, full spec, expected output format.
|
|
162
|
-
* Best for: Directly feeding to coding agents for implementation.
|
|
163
|
-
*/
|
|
164
|
-
function specToAgentPrompt(spec, options) {
|
|
165
|
-
const taskType = options?.taskType ?? "implement";
|
|
166
|
-
const m = spec.meta;
|
|
167
|
-
const lines = [];
|
|
168
|
-
const taskVerb = {
|
|
169
|
-
implement: "Implement",
|
|
170
|
-
test: "Write tests for",
|
|
171
|
-
refactor: "Refactor",
|
|
172
|
-
review: "Review"
|
|
173
|
-
}[taskType];
|
|
174
|
-
lines.push(`# Task: ${taskVerb} ${m.name}.v${m.version}`);
|
|
175
|
-
lines.push("");
|
|
176
|
-
lines.push("## Context");
|
|
177
|
-
lines.push("");
|
|
178
|
-
lines.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${m.kind} operation.`);
|
|
179
|
-
lines.push("");
|
|
180
|
-
lines.push(`**Goal:** ${m.goal}`);
|
|
181
|
-
lines.push("");
|
|
182
|
-
lines.push(`**Background:** ${m.context}`);
|
|
183
|
-
lines.push("");
|
|
184
|
-
lines.push("## Specification");
|
|
185
|
-
lines.push("");
|
|
186
|
-
lines.push(specToFullMarkdown(spec));
|
|
187
|
-
lines.push("");
|
|
188
|
-
lines.push("## Instructions");
|
|
189
|
-
lines.push("");
|
|
190
|
-
if (taskType === "implement") {
|
|
191
|
-
lines.push("Implement this specification following these requirements:");
|
|
192
|
-
lines.push("");
|
|
193
|
-
lines.push("1. **Type Safety**: Use TypeScript with strict typing. No `any` types.");
|
|
194
|
-
lines.push("2. **Input Validation**: Validate input against the schema before processing.");
|
|
195
|
-
lines.push("3. **Error Handling**: Implement all error cases defined in the spec.");
|
|
196
|
-
lines.push("4. **Events**: Emit events as specified in sideEffects.emits.");
|
|
197
|
-
lines.push("5. **Policy**: Respect auth, rate limits, and feature flags.");
|
|
198
|
-
lines.push("6. **Idempotency**: " + (spec.policy.idempotent ? "This operation MUST be idempotent." : "This operation may have side effects."));
|
|
199
|
-
lines.push("");
|
|
200
|
-
if (spec.policy.pii?.length) {
|
|
201
|
-
lines.push("**PII Handling**: The following fields contain PII and must be handled carefully:");
|
|
202
|
-
for (const field of spec.policy.pii) lines.push(`- ${field}`);
|
|
203
|
-
lines.push("");
|
|
204
|
-
}
|
|
205
|
-
} else if (taskType === "test") {
|
|
206
|
-
lines.push("Write comprehensive tests for this specification:");
|
|
207
|
-
lines.push("");
|
|
208
|
-
lines.push("1. Test all acceptance scenarios defined in the spec.");
|
|
209
|
-
lines.push("2. Test all error cases with appropriate assertions.");
|
|
210
|
-
lines.push("3. Test edge cases and boundary conditions.");
|
|
211
|
-
lines.push("4. Verify events are emitted correctly.");
|
|
212
|
-
lines.push("5. Use descriptive test names following the pattern: \"should [behavior] when [condition]\"");
|
|
213
|
-
lines.push("");
|
|
214
|
-
} else if (taskType === "refactor") {
|
|
215
|
-
lines.push("Refactor this implementation while preserving all behavior:");
|
|
216
|
-
lines.push("");
|
|
217
|
-
lines.push("1. Maintain compliance with the specification.");
|
|
218
|
-
lines.push("2. Improve code clarity and maintainability.");
|
|
219
|
-
lines.push("3. Reduce complexity where possible.");
|
|
220
|
-
lines.push("4. Ensure all existing tests still pass.");
|
|
221
|
-
lines.push("");
|
|
222
|
-
} else if (taskType === "review") {
|
|
223
|
-
lines.push("Review this implementation against the specification:");
|
|
224
|
-
lines.push("");
|
|
225
|
-
lines.push("1. Verify input/output types match the schema.");
|
|
226
|
-
lines.push("2. Check all error cases are handled.");
|
|
227
|
-
lines.push("3. Verify events are emitted as specified.");
|
|
228
|
-
lines.push("4. Check policy compliance (auth, rate limits).");
|
|
229
|
-
lines.push("5. Report any deviations from the spec.");
|
|
230
|
-
lines.push("");
|
|
231
|
-
}
|
|
232
|
-
if (options?.existingCode) {
|
|
233
|
-
lines.push("## Existing Code");
|
|
234
|
-
lines.push("");
|
|
235
|
-
lines.push("```typescript");
|
|
236
|
-
lines.push(options.existingCode);
|
|
237
|
-
lines.push("```");
|
|
238
|
-
lines.push("");
|
|
239
|
-
}
|
|
240
|
-
lines.push("## Expected Output");
|
|
241
|
-
lines.push("");
|
|
242
|
-
if (taskType === "implement" || taskType === "refactor") {
|
|
243
|
-
lines.push("Provide a complete TypeScript implementation. Include:");
|
|
244
|
-
lines.push("- Type definitions for input/output");
|
|
245
|
-
lines.push("- Handler function with proper error handling");
|
|
246
|
-
lines.push("- JSDoc comments explaining the implementation");
|
|
247
|
-
} else if (taskType === "test") lines.push("Provide a complete test file using the testing framework available (prefer Vitest).");
|
|
248
|
-
else if (taskType === "review") {
|
|
249
|
-
lines.push("Provide a structured review with:");
|
|
250
|
-
lines.push("- Compliance status (pass/fail for each requirement)");
|
|
251
|
-
lines.push("- Issues found with severity (error/warning/info)");
|
|
252
|
-
lines.push("- Suggestions for improvement");
|
|
253
|
-
}
|
|
254
|
-
lines.push("");
|
|
255
|
-
return lines.join("\n");
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Export a feature module to markdown.
|
|
259
|
-
* Includes all related specs, events, and presentations.
|
|
260
|
-
*/
|
|
261
|
-
function featureToMarkdown(feature, deps, options = {}) {
|
|
262
|
-
const opts = {
|
|
263
|
-
...DEFAULT_FEATURE_OPTIONS,
|
|
264
|
-
...options
|
|
265
|
-
};
|
|
266
|
-
const m = feature.meta;
|
|
267
|
-
const lines = [];
|
|
268
|
-
lines.push(`# Feature: ${m.title ?? m.key}`);
|
|
269
|
-
lines.push("");
|
|
270
|
-
if (m.description) {
|
|
271
|
-
lines.push(`> ${m.description}`);
|
|
272
|
-
lines.push("");
|
|
273
|
-
}
|
|
274
|
-
lines.push("## Overview");
|
|
275
|
-
lines.push("");
|
|
276
|
-
lines.push(`- **Key:** \`${m.key}\``);
|
|
277
|
-
lines.push(`- **Stability:** ${m.stability}`);
|
|
278
|
-
lines.push(`- **Owners:** ${m.owners.join(", ")}`);
|
|
279
|
-
if (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(", ")}`);
|
|
280
|
-
lines.push("");
|
|
281
|
-
if (feature.operations?.length) {
|
|
282
|
-
lines.push("## Operations");
|
|
283
|
-
lines.push("");
|
|
284
|
-
lines.push("| Name | Version | Type |");
|
|
285
|
-
lines.push("|------|---------|------|");
|
|
286
|
-
for (const op of feature.operations) {
|
|
287
|
-
const kind = (deps?.specs?.getSpec(op.name, op.version))?.meta.kind ?? "unknown";
|
|
288
|
-
lines.push(`| ${op.name} | v${op.version} | ${kind} |`);
|
|
289
|
-
}
|
|
290
|
-
lines.push("");
|
|
291
|
-
if (opts.includeRelatedSpecs && deps?.specs) {
|
|
292
|
-
lines.push("### Operation Details");
|
|
293
|
-
lines.push("");
|
|
294
|
-
for (const op of feature.operations) {
|
|
295
|
-
const spec = deps.specs.getSpec(op.name, op.version);
|
|
296
|
-
if (spec) {
|
|
297
|
-
lines.push(`---`);
|
|
298
|
-
lines.push("");
|
|
299
|
-
lines.push(specToFullMarkdown(spec, opts));
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
if (feature.events?.length) {
|
|
305
|
-
lines.push("## Events");
|
|
306
|
-
lines.push("");
|
|
307
|
-
lines.push("| Name | Version |");
|
|
308
|
-
lines.push("|------|---------|");
|
|
309
|
-
for (const evt of feature.events) lines.push(`| ${evt.name} | v${evt.version} |`);
|
|
310
|
-
lines.push("");
|
|
311
|
-
}
|
|
312
|
-
if (feature.presentations?.length) {
|
|
313
|
-
lines.push("## Presentations");
|
|
314
|
-
lines.push("");
|
|
315
|
-
lines.push("| Name | Version |");
|
|
316
|
-
lines.push("|------|---------|");
|
|
317
|
-
for (const pres of feature.presentations) lines.push(`| ${pres.name} | v${pres.version} |`);
|
|
318
|
-
lines.push("");
|
|
319
|
-
if (opts.includeRelatedPresentations && deps?.presentations) {
|
|
320
|
-
lines.push("### Presentation Details");
|
|
321
|
-
lines.push("");
|
|
322
|
-
for (const pres of feature.presentations) {
|
|
323
|
-
const p = deps.presentations.get(pres.name, pres.version);
|
|
324
|
-
if (p) {
|
|
325
|
-
lines.push(`#### ${pres.name}.v${pres.version}`);
|
|
326
|
-
lines.push("");
|
|
327
|
-
lines.push(`- **Kind:** ${p.content.kind ?? "unknown"}`);
|
|
328
|
-
if ("componentKey" in p.content) lines.push(`- **Component:** ${p.content.componentKey}`);
|
|
329
|
-
lines.push("");
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
if (feature.capabilities) {
|
|
335
|
-
if (feature.capabilities.provides?.length) {
|
|
336
|
-
lines.push("## Capabilities Provided");
|
|
337
|
-
lines.push("");
|
|
338
|
-
for (const cap of feature.capabilities.provides) lines.push(`- \`${cap.key}.v${cap.version}\``);
|
|
339
|
-
lines.push("");
|
|
340
|
-
}
|
|
341
|
-
if (feature.capabilities.requires?.length) {
|
|
342
|
-
lines.push("## Capabilities Required");
|
|
343
|
-
lines.push("");
|
|
344
|
-
for (const cap of feature.capabilities.requires) lines.push(`- \`${cap.key}\`${cap.version ? `.v${cap.version}` : ""} (${cap.optional ? "optional" : "required"})`);
|
|
345
|
-
lines.push("");
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return lines.join("\n");
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
//#endregion
|
|
352
|
-
export { featureToMarkdown, specToAgentPrompt, specToFullMarkdown };
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { specToFullMarkdown } from "./exporters.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/llm/prompts.js
|
|
4
|
-
/**
|
|
5
|
-
* System prompts for different agent types.
|
|
6
|
-
*/
|
|
7
|
-
const AGENT_SYSTEM_PROMPTS = {
|
|
8
|
-
"claude-code": `You are an expert TypeScript developer working with ContractSpec, a spec-first development framework.
|
|
9
|
-
|
|
10
|
-
Your code follows these principles:
|
|
11
|
-
- Type-safe with comprehensive TypeScript types (no \`any\`)
|
|
12
|
-
- Well-documented with JSDoc comments
|
|
13
|
-
- Production-ready with proper error handling
|
|
14
|
-
- Following SOLID principles and clean code practices
|
|
15
|
-
- Modular and testable
|
|
16
|
-
|
|
17
|
-
When implementing specs:
|
|
18
|
-
1. Validate input against the schema before processing
|
|
19
|
-
2. Handle all error cases defined in the spec
|
|
20
|
-
3. Emit events as specified in sideEffects
|
|
21
|
-
4. Respect policy constraints (auth, rate limits, PII handling)
|
|
22
|
-
5. Follow the acceptance scenarios as your implementation guide
|
|
23
|
-
|
|
24
|
-
Generate clean, idiomatic TypeScript that exactly matches the specification.`,
|
|
25
|
-
"cursor-cli": `You are implementing features for a ContractSpec-driven codebase.
|
|
26
|
-
|
|
27
|
-
ContractSpec is a spec-first framework where specifications define:
|
|
28
|
-
- Operations (commands and queries) with typed I/O
|
|
29
|
-
- Events that operations emit
|
|
30
|
-
- Presentations for UI components
|
|
31
|
-
- Features that group related specs
|
|
32
|
-
|
|
33
|
-
When working with specs:
|
|
34
|
-
- Read the spec carefully before implementing
|
|
35
|
-
- Match the input/output types exactly
|
|
36
|
-
- Implement all error cases
|
|
37
|
-
- Follow the acceptance scenarios
|
|
38
|
-
- Respect policy constraints
|
|
39
|
-
|
|
40
|
-
Use the project's existing patterns and conventions.`,
|
|
41
|
-
"generic-mcp": `You are a code generation assistant working with ContractSpec specifications.
|
|
42
|
-
|
|
43
|
-
ContractSpec specs define:
|
|
44
|
-
- meta: name, version, kind (command/query), description, goal, context
|
|
45
|
-
- io: input schema, output schema, error definitions
|
|
46
|
-
- policy: auth level, rate limits, feature flags, PII handling
|
|
47
|
-
- sideEffects: events to emit, analytics, audit
|
|
48
|
-
- acceptance: scenarios and examples
|
|
49
|
-
|
|
50
|
-
Your task is to generate or modify code that complies with the given specification.
|
|
51
|
-
Follow the spec exactly and handle all defined cases.`
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Generate a verification prompt for AI-powered semantic review.
|
|
55
|
-
*/
|
|
56
|
-
function generateVerificationPrompt(spec, implementationCode) {
|
|
57
|
-
return {
|
|
58
|
-
agent: "generic-mcp",
|
|
59
|
-
taskPrompt: `## Semantic Verification Task
|
|
60
|
-
|
|
61
|
-
Verify that this implementation fulfills the specification's intent.
|
|
62
|
-
|
|
63
|
-
**Specification:**
|
|
64
|
-
${specToFullMarkdown(spec)}
|
|
65
|
-
|
|
66
|
-
**Implementation:**
|
|
67
|
-
\`\`\`typescript
|
|
68
|
-
${implementationCode}
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
Analyze and respond with JSON:
|
|
72
|
-
|
|
73
|
-
\`\`\`json
|
|
74
|
-
{
|
|
75
|
-
"passed": true/false,
|
|
76
|
-
"score": 0-100,
|
|
77
|
-
"compliance": {
|
|
78
|
-
"inputTypes": { "match": true/false, "issues": [] },
|
|
79
|
-
"outputTypes": { "match": true/false, "issues": [] },
|
|
80
|
-
"errorHandling": { "coverage": "full/partial/none", "missing": [] },
|
|
81
|
-
"eventEmission": { "correct": true/false, "issues": [] },
|
|
82
|
-
"policyCompliance": { "auth": true/false, "rateLimit": true/false, "pii": true/false }
|
|
83
|
-
},
|
|
84
|
-
"scenarios": [
|
|
85
|
-
{ "name": "scenario name", "covered": true/false, "notes": "" }
|
|
86
|
-
],
|
|
87
|
-
"issues": [
|
|
88
|
-
{ "severity": "error/warning/info", "category": "type/export/import/scenario/error_handling/semantic", "message": "", "suggestion": "" }
|
|
89
|
-
],
|
|
90
|
-
"summary": "Brief summary of verification results"
|
|
91
|
-
}
|
|
92
|
-
\`\`\``
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Generate a feature implementation plan.
|
|
97
|
-
*/
|
|
98
|
-
function generateImplementationPlan(spec, options) {
|
|
99
|
-
const m = spec.meta;
|
|
100
|
-
const fileStructure = [];
|
|
101
|
-
const basePath = options?.projectRoot ?? "src";
|
|
102
|
-
const specPath = m.name.replace(/\./g, "/");
|
|
103
|
-
if (m.kind === "command" || m.kind === "query") fileStructure.push({
|
|
104
|
-
path: `${basePath}/${specPath}/handler.ts`,
|
|
105
|
-
purpose: "Main handler implementation",
|
|
106
|
-
type: "create"
|
|
107
|
-
}, {
|
|
108
|
-
path: `${basePath}/${specPath}/types.ts`,
|
|
109
|
-
purpose: "Type definitions",
|
|
110
|
-
type: "create"
|
|
111
|
-
}, {
|
|
112
|
-
path: `${basePath}/${specPath}/handler.test.ts`,
|
|
113
|
-
purpose: "Handler tests",
|
|
114
|
-
type: "create"
|
|
115
|
-
});
|
|
116
|
-
const steps = [];
|
|
117
|
-
let order = 1;
|
|
118
|
-
steps.push({
|
|
119
|
-
order: order++,
|
|
120
|
-
title: "Define Types",
|
|
121
|
-
description: "Create TypeScript types for input, output, and internal data structures",
|
|
122
|
-
acceptanceCriteria: [
|
|
123
|
-
"Input type matches spec schema exactly",
|
|
124
|
-
"Output type matches spec schema exactly",
|
|
125
|
-
"Error types defined for all error cases"
|
|
126
|
-
]
|
|
127
|
-
});
|
|
128
|
-
steps.push({
|
|
129
|
-
order: order++,
|
|
130
|
-
title: "Implement Input Validation",
|
|
131
|
-
description: "Add validation logic for the input payload",
|
|
132
|
-
acceptanceCriteria: [
|
|
133
|
-
"All required fields are validated",
|
|
134
|
-
"Type constraints are enforced",
|
|
135
|
-
"Validation errors return appropriate error codes"
|
|
136
|
-
]
|
|
137
|
-
});
|
|
138
|
-
steps.push({
|
|
139
|
-
order: order++,
|
|
140
|
-
title: "Implement Core Logic",
|
|
141
|
-
description: "Implement the main business logic of the operation",
|
|
142
|
-
acceptanceCriteria: spec.acceptance?.scenarios?.map((s) => s.name) ?? ["Operation completes successfully for valid input"]
|
|
143
|
-
});
|
|
144
|
-
if (spec.io.errors && Object.keys(spec.io.errors).length > 0) steps.push({
|
|
145
|
-
order: order++,
|
|
146
|
-
title: "Implement Error Handling",
|
|
147
|
-
description: "Handle all defined error cases",
|
|
148
|
-
acceptanceCriteria: Object.entries(spec.io.errors).map(([code, err]) => `Handle ${code}: ${err.when}`)
|
|
149
|
-
});
|
|
150
|
-
if (spec.sideEffects?.emits?.length) steps.push({
|
|
151
|
-
order: order++,
|
|
152
|
-
title: "Implement Event Emission",
|
|
153
|
-
description: "Emit events as specified",
|
|
154
|
-
acceptanceCriteria: spec.sideEffects.emits.map((e) => {
|
|
155
|
-
if ("ref" in e) return `Emit ${e.ref.name}.v${e.ref.version} when ${e.when}`;
|
|
156
|
-
return `Emit ${e.name}.v${e.version} when ${e.when}`;
|
|
157
|
-
})
|
|
158
|
-
});
|
|
159
|
-
steps.push({
|
|
160
|
-
order: order++,
|
|
161
|
-
title: "Write Tests",
|
|
162
|
-
description: "Create comprehensive test suite",
|
|
163
|
-
acceptanceCriteria: [
|
|
164
|
-
"All acceptance scenarios covered",
|
|
165
|
-
"All error cases tested",
|
|
166
|
-
"Edge cases handled",
|
|
167
|
-
"Events verified"
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
const constraints = {
|
|
171
|
-
policy: [],
|
|
172
|
-
security: [],
|
|
173
|
-
pii: []
|
|
174
|
-
};
|
|
175
|
-
constraints.policy.push(`Auth level: ${spec.policy.auth}`);
|
|
176
|
-
if (spec.policy.idempotent !== void 0) constraints.policy.push(`Idempotent: ${spec.policy.idempotent}`);
|
|
177
|
-
if (spec.policy.rateLimit) constraints.policy.push(`Rate limit: ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);
|
|
178
|
-
if (spec.policy.flags?.length) constraints.policy.push(`Feature flags required: ${spec.policy.flags.join(", ")}`);
|
|
179
|
-
if (spec.policy.escalate) constraints.security.push(`Escalation required: ${spec.policy.escalate}`);
|
|
180
|
-
if (spec.policy.pii?.length) constraints.pii = spec.policy.pii;
|
|
181
|
-
return {
|
|
182
|
-
target: {
|
|
183
|
-
type: "spec",
|
|
184
|
-
name: m.name,
|
|
185
|
-
version: m.version
|
|
186
|
-
},
|
|
187
|
-
context: {
|
|
188
|
-
goal: m.goal,
|
|
189
|
-
description: m.description,
|
|
190
|
-
background: m.context
|
|
191
|
-
},
|
|
192
|
-
specMarkdown: specToFullMarkdown(spec),
|
|
193
|
-
fileStructure,
|
|
194
|
-
steps,
|
|
195
|
-
constraints,
|
|
196
|
-
verificationChecklist: [
|
|
197
|
-
"Input validation works for all cases",
|
|
198
|
-
"Output matches expected schema",
|
|
199
|
-
"All error cases return correct codes",
|
|
200
|
-
"Events are emitted with correct payloads",
|
|
201
|
-
"Auth requirements are enforced",
|
|
202
|
-
"Rate limiting is applied (if applicable)",
|
|
203
|
-
"PII fields are handled correctly",
|
|
204
|
-
"All acceptance scenarios pass",
|
|
205
|
-
"Tests provide adequate coverage"
|
|
206
|
-
]
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
//#endregion
|
|
211
|
-
export { AGENT_SYSTEM_PROMPTS, generateImplementationPlan, generateVerificationPrompt };
|