@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821
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 +4532 -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 +29 -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/quickstart/dependencies.d.ts +32 -0
- package/dist/services/quickstart/dependencies.d.ts.map +1 -0
- package/dist/services/quickstart/index.d.ts +10 -0
- package/dist/services/quickstart/index.d.ts.map +1 -0
- package/dist/services/quickstart/quickstart-service.d.ts +21 -0
- package/dist/services/quickstart/quickstart-service.d.ts.map +1 -0
- package/dist/services/quickstart/types.d.ts +78 -0
- package/dist/services/quickstart/types.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 +22 -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,272 +0,0 @@
|
|
|
1
|
-
import { scanAllSpecsFromSource } from "../modules/contractspec-workspace/dist/analysis/spec-scan.js";
|
|
2
|
-
import { isFeatureFile, scanFeatureSource } from "../modules/contractspec-workspace/dist/analysis/feature-scan.js";
|
|
3
|
-
|
|
4
|
-
//#region src/services/integrity.ts
|
|
5
|
-
/**
|
|
6
|
-
* Contract integrity analysis service.
|
|
7
|
-
*
|
|
8
|
-
* Analyzes contract specs and features to detect:
|
|
9
|
-
* - Orphaned specs (not linked to any feature)
|
|
10
|
-
* - Unresolved references (broken event/op/presentation refs)
|
|
11
|
-
* - Feature coverage metrics
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Build a spec key from name and version.
|
|
15
|
-
*/
|
|
16
|
-
function specKey(name, version) {
|
|
17
|
-
return `${name}.v${version}`;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Create an empty spec inventory.
|
|
21
|
-
*/
|
|
22
|
-
function createEmptyInventory() {
|
|
23
|
-
return {
|
|
24
|
-
operations: /* @__PURE__ */ new Map(),
|
|
25
|
-
events: /* @__PURE__ */ new Map(),
|
|
26
|
-
presentations: /* @__PURE__ */ new Map(),
|
|
27
|
-
capabilities: /* @__PURE__ */ new Map(),
|
|
28
|
-
workflows: /* @__PURE__ */ new Map(),
|
|
29
|
-
dataViews: /* @__PURE__ */ new Map(),
|
|
30
|
-
forms: /* @__PURE__ */ new Map(),
|
|
31
|
-
migrations: /* @__PURE__ */ new Map(),
|
|
32
|
-
experiments: /* @__PURE__ */ new Map(),
|
|
33
|
-
integrations: /* @__PURE__ */ new Map(),
|
|
34
|
-
knowledge: /* @__PURE__ */ new Map(),
|
|
35
|
-
telemetry: /* @__PURE__ */ new Map(),
|
|
36
|
-
appConfigs: /* @__PURE__ */ new Map(),
|
|
37
|
-
policies: /* @__PURE__ */ new Map(),
|
|
38
|
-
testSpecs: /* @__PURE__ */ new Map()
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Get the inventory map for a spec type.
|
|
43
|
-
*/
|
|
44
|
-
function getInventoryMap(inventory, specType) {
|
|
45
|
-
return {
|
|
46
|
-
operation: inventory.operations,
|
|
47
|
-
event: inventory.events,
|
|
48
|
-
presentation: inventory.presentations,
|
|
49
|
-
capability: inventory.capabilities,
|
|
50
|
-
workflow: inventory.workflows,
|
|
51
|
-
"data-view": inventory.dataViews,
|
|
52
|
-
form: inventory.forms,
|
|
53
|
-
migration: inventory.migrations,
|
|
54
|
-
experiment: inventory.experiments,
|
|
55
|
-
integration: inventory.integrations,
|
|
56
|
-
knowledge: inventory.knowledge,
|
|
57
|
-
telemetry: inventory.telemetry,
|
|
58
|
-
"app-config": inventory.appConfigs,
|
|
59
|
-
policy: inventory.policies,
|
|
60
|
-
"test-spec": inventory.testSpecs
|
|
61
|
-
}[specType];
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Analyze contract integrity.
|
|
65
|
-
*/
|
|
66
|
-
async function analyzeIntegrity(adapters, options = {}) {
|
|
67
|
-
const { fs, logger } = adapters;
|
|
68
|
-
logger.info("Starting integrity analysis...", { options });
|
|
69
|
-
const files = await fs.glob({ pattern: options.pattern });
|
|
70
|
-
const inventory = createEmptyInventory();
|
|
71
|
-
const features = [];
|
|
72
|
-
const issues = [];
|
|
73
|
-
for (const file of files) {
|
|
74
|
-
const content = await fs.readFile(file);
|
|
75
|
-
if (isFeatureFile(file)) {
|
|
76
|
-
const feature = scanFeatureSource(content, file);
|
|
77
|
-
features.push(feature);
|
|
78
|
-
} else {
|
|
79
|
-
const specs = scanAllSpecsFromSource(content, file);
|
|
80
|
-
for (const spec of specs) if (spec.specType !== "unknown" && spec.specType !== "feature") {
|
|
81
|
-
const map = getInventoryMap(inventory, spec.specType);
|
|
82
|
-
if (map && spec.name && spec.version !== void 0) {
|
|
83
|
-
const key = specKey(spec.name, spec.version);
|
|
84
|
-
map.set(key, {
|
|
85
|
-
name: spec.name,
|
|
86
|
-
version: spec.version,
|
|
87
|
-
file: spec.filePath,
|
|
88
|
-
type: spec.specType,
|
|
89
|
-
stability: spec.stability
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
const relevantFeatures = options.featureKey ? features.filter((f) => f.key === options.featureKey) : features;
|
|
96
|
-
const referencedSpecs = /* @__PURE__ */ new Set();
|
|
97
|
-
for (const feature of relevantFeatures) {
|
|
98
|
-
for (const ref of feature.operations) {
|
|
99
|
-
const key = specKey(ref.name, ref.version);
|
|
100
|
-
referencedSpecs.add(`operation:${key}`);
|
|
101
|
-
if (!inventory.operations.has(key)) issues.push({
|
|
102
|
-
severity: "error",
|
|
103
|
-
type: "unresolved-ref",
|
|
104
|
-
message: `Operation ${ref.name}.v${ref.version} not found`,
|
|
105
|
-
file: feature.filePath,
|
|
106
|
-
featureKey: feature.key,
|
|
107
|
-
specType: "operation",
|
|
108
|
-
ref
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
for (const ref of feature.events) {
|
|
112
|
-
const key = specKey(ref.name, ref.version);
|
|
113
|
-
referencedSpecs.add(`event:${key}`);
|
|
114
|
-
if (!inventory.events.has(key)) issues.push({
|
|
115
|
-
severity: "error",
|
|
116
|
-
type: "unresolved-ref",
|
|
117
|
-
message: `Event ${ref.name}.v${ref.version} not found`,
|
|
118
|
-
file: feature.filePath,
|
|
119
|
-
featureKey: feature.key,
|
|
120
|
-
specType: "event",
|
|
121
|
-
ref
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
for (const ref of feature.presentations) {
|
|
125
|
-
const key = specKey(ref.name, ref.version);
|
|
126
|
-
referencedSpecs.add(`presentation:${key}`);
|
|
127
|
-
if (!inventory.presentations.has(key)) issues.push({
|
|
128
|
-
severity: "error",
|
|
129
|
-
type: "unresolved-ref",
|
|
130
|
-
message: `Presentation ${ref.name}.v${ref.version} not found`,
|
|
131
|
-
file: feature.filePath,
|
|
132
|
-
featureKey: feature.key,
|
|
133
|
-
specType: "presentation",
|
|
134
|
-
ref
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
for (const ref of feature.experiments) {
|
|
138
|
-
const key = specKey(ref.name, ref.version);
|
|
139
|
-
referencedSpecs.add(`experiment:${key}`);
|
|
140
|
-
if (!inventory.experiments.has(key)) issues.push({
|
|
141
|
-
severity: "error",
|
|
142
|
-
type: "unresolved-ref",
|
|
143
|
-
message: `Experiment ${ref.name}.v${ref.version} not found`,
|
|
144
|
-
file: feature.filePath,
|
|
145
|
-
featureKey: feature.key,
|
|
146
|
-
specType: "experiment",
|
|
147
|
-
ref
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
for (const ref of feature.capabilities.provides) {
|
|
151
|
-
const key = specKey(ref.name, ref.version);
|
|
152
|
-
referencedSpecs.add(`capability:${key}`);
|
|
153
|
-
if (!inventory.capabilities.has(key)) issues.push({
|
|
154
|
-
severity: "warning",
|
|
155
|
-
type: "unresolved-ref",
|
|
156
|
-
message: `Provided capability ${ref.name}.v${ref.version} not found`,
|
|
157
|
-
file: feature.filePath,
|
|
158
|
-
featureKey: feature.key,
|
|
159
|
-
specType: "capability",
|
|
160
|
-
ref
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
for (const ref of feature.capabilities.requires) {
|
|
164
|
-
const key = specKey(ref.name, ref.version);
|
|
165
|
-
referencedSpecs.add(`capability:${key}`);
|
|
166
|
-
}
|
|
167
|
-
for (const link of feature.opToPresentationLinks) {
|
|
168
|
-
const opKey = specKey(link.op.name, link.op.version);
|
|
169
|
-
const presKey = specKey(link.pres.name, link.pres.version);
|
|
170
|
-
if (!inventory.operations.has(opKey)) issues.push({
|
|
171
|
-
severity: "error",
|
|
172
|
-
type: "broken-link",
|
|
173
|
-
message: `Linked operation ${link.op.name}.v${link.op.version} not found`,
|
|
174
|
-
file: feature.filePath,
|
|
175
|
-
featureKey: feature.key,
|
|
176
|
-
specType: "operation",
|
|
177
|
-
ref: link.op
|
|
178
|
-
});
|
|
179
|
-
if (!inventory.presentations.has(presKey)) issues.push({
|
|
180
|
-
severity: "error",
|
|
181
|
-
type: "broken-link",
|
|
182
|
-
message: `Linked presentation ${link.pres.name}.v${link.pres.version} not found`,
|
|
183
|
-
file: feature.filePath,
|
|
184
|
-
featureKey: feature.key,
|
|
185
|
-
specType: "presentation",
|
|
186
|
-
ref: link.pres
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
const orphanedSpecs = [];
|
|
191
|
-
const typesThatCanBeOrphaned = [
|
|
192
|
-
"operation",
|
|
193
|
-
"event",
|
|
194
|
-
"presentation",
|
|
195
|
-
"experiment"
|
|
196
|
-
];
|
|
197
|
-
for (const type of typesThatCanBeOrphaned) {
|
|
198
|
-
const map = getInventoryMap(inventory, type);
|
|
199
|
-
if (!map) continue;
|
|
200
|
-
for (const [key, location] of map) if (!referencedSpecs.has(`${type}:${key}`)) {
|
|
201
|
-
orphanedSpecs.push(location);
|
|
202
|
-
issues.push({
|
|
203
|
-
severity: "warning",
|
|
204
|
-
type: "orphaned",
|
|
205
|
-
message: `${type} ${location.name}.v${location.version} is not linked to any feature`,
|
|
206
|
-
file: location.file,
|
|
207
|
-
specName: location.name,
|
|
208
|
-
specType: location.type
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
const coverageByType = {};
|
|
213
|
-
for (const type of typesThatCanBeOrphaned) {
|
|
214
|
-
const map = getInventoryMap(inventory, type);
|
|
215
|
-
if (!map) continue;
|
|
216
|
-
const total = map.size;
|
|
217
|
-
let covered = 0;
|
|
218
|
-
for (const key of map.keys()) if (referencedSpecs.has(`${type}:${key}`)) covered++;
|
|
219
|
-
coverageByType[type] = {
|
|
220
|
-
total,
|
|
221
|
-
covered,
|
|
222
|
-
orphaned: total - covered
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
const totalSpecs = Object.values(coverageByType).reduce((sum, c) => sum + c.total, 0);
|
|
226
|
-
const coveredSpecs = Object.values(coverageByType).reduce((sum, c) => sum + c.covered, 0);
|
|
227
|
-
const coverage = {
|
|
228
|
-
total: totalSpecs,
|
|
229
|
-
linkedToFeature: coveredSpecs,
|
|
230
|
-
orphaned: totalSpecs - coveredSpecs,
|
|
231
|
-
byType: coverageByType
|
|
232
|
-
};
|
|
233
|
-
const healthy = !issues.some((i) => i.severity === "error");
|
|
234
|
-
logger.info("Integrity analysis complete", {
|
|
235
|
-
features: features.length,
|
|
236
|
-
totalSpecs,
|
|
237
|
-
orphaned: orphanedSpecs.length,
|
|
238
|
-
issues: issues.length,
|
|
239
|
-
healthy
|
|
240
|
-
});
|
|
241
|
-
return {
|
|
242
|
-
inventory,
|
|
243
|
-
features: relevantFeatures,
|
|
244
|
-
coverage,
|
|
245
|
-
issues,
|
|
246
|
-
orphanedSpecs,
|
|
247
|
-
healthy
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Get all specs from inventory as a flat list.
|
|
252
|
-
*/
|
|
253
|
-
function getAllSpecs(inventory) {
|
|
254
|
-
const all = [];
|
|
255
|
-
for (const map of Object.values(inventory)) for (const spec of map.values()) all.push(spec);
|
|
256
|
-
return all;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Filter issues by type.
|
|
260
|
-
*/
|
|
261
|
-
function filterIssuesByType(issues, type) {
|
|
262
|
-
return issues.filter((i) => i.type === type);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Filter issues by severity.
|
|
266
|
-
*/
|
|
267
|
-
function filterIssuesBySeverity(issues, severity) {
|
|
268
|
-
return issues.filter((i) => i.severity === severity);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
//#endregion
|
|
272
|
-
export { analyzeIntegrity, filterIssuesBySeverity, filterIssuesByType, getAllSpecs };
|
package/dist/services/list.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { scanSpecSource } from "../modules/contractspec-workspace/dist/analysis/spec-scan.js";
|
|
2
|
-
|
|
3
|
-
//#region src/services/list.ts
|
|
4
|
-
/**
|
|
5
|
-
* List specs service.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* List all spec files in the workspace.
|
|
9
|
-
*/
|
|
10
|
-
async function listSpecs(adapters, options = {}) {
|
|
11
|
-
const { fs } = adapters;
|
|
12
|
-
const files = await fs.glob({ pattern: options.pattern });
|
|
13
|
-
const results = [];
|
|
14
|
-
for (const file of files) {
|
|
15
|
-
const result = scanSpecSource(await fs.readFile(file), file);
|
|
16
|
-
if (options.type && result.specType !== options.type) continue;
|
|
17
|
-
results.push(result);
|
|
18
|
-
}
|
|
19
|
-
return results;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Group specs by type.
|
|
23
|
-
*/
|
|
24
|
-
function groupSpecsByType(specs) {
|
|
25
|
-
const groups = /* @__PURE__ */ new Map();
|
|
26
|
-
for (const spec of specs) {
|
|
27
|
-
const group = groups.get(spec.specType) ?? [];
|
|
28
|
-
group.push(spec);
|
|
29
|
-
groups.set(spec.specType, group);
|
|
30
|
-
}
|
|
31
|
-
return groups;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
export { groupSpecsByType, listSpecs };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { SpecRegistry } from "../../libs/contracts/dist/registry.js";
|
|
2
|
-
import { openApiForRegistry } from "../../libs/contracts/dist/openapi.js";
|
|
3
|
-
import "../../libs/contracts/dist/index.js";
|
|
4
|
-
|
|
5
|
-
//#region src/services/openapi/export-service.ts
|
|
6
|
-
/**
|
|
7
|
-
* OpenAPI export service - generates OpenAPI documents from SpecRegistry.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Export OpenAPI document from a SpecRegistry.
|
|
11
|
-
*/
|
|
12
|
-
async function exportOpenApi(options, adapters) {
|
|
13
|
-
const { fs, logger } = adapters;
|
|
14
|
-
const { registryPath, outputPath = "./openapi.json" } = options;
|
|
15
|
-
logger.info("Loading registry...", { registryPath });
|
|
16
|
-
const registry = await loadRegistry(registryPath, fs);
|
|
17
|
-
logger.info("Generating OpenAPI document...");
|
|
18
|
-
const document = openApiForRegistry(registry, {
|
|
19
|
-
title: options.title,
|
|
20
|
-
version: options.version,
|
|
21
|
-
description: options.description,
|
|
22
|
-
servers: options.servers
|
|
23
|
-
});
|
|
24
|
-
const json = JSON.stringify(document, null, 2) + "\n";
|
|
25
|
-
const resolvedPath = fs.resolve(outputPath);
|
|
26
|
-
await fs.mkdir(fs.dirname(resolvedPath));
|
|
27
|
-
await fs.writeFile(resolvedPath, json);
|
|
28
|
-
logger.info(`OpenAPI document written to ${resolvedPath}`);
|
|
29
|
-
return {
|
|
30
|
-
document,
|
|
31
|
-
outputPath: resolvedPath,
|
|
32
|
-
json
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Load a SpecRegistry from a module.
|
|
37
|
-
*/
|
|
38
|
-
async function loadRegistry(modulePath, fs) {
|
|
39
|
-
const exports = await import(fs.resolve(modulePath));
|
|
40
|
-
if (exports instanceof SpecRegistry) return exports;
|
|
41
|
-
if (exports.registry instanceof SpecRegistry) return exports.registry;
|
|
42
|
-
const factory = typeof exports.createRegistry === "function" ? exports.createRegistry : typeof exports.default === "function" ? exports.default : void 0;
|
|
43
|
-
if (factory) {
|
|
44
|
-
const result = await factory();
|
|
45
|
-
if (result instanceof SpecRegistry) return result;
|
|
46
|
-
}
|
|
47
|
-
throw new Error(`Registry module ${modulePath} must export a SpecRegistry instance or a factory function returning one.`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//#endregion
|
|
51
|
-
export { exportOpenApi };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { parseOpenApi } from "../../libs/contracts-transformers/dist/openapi/parser.js";
|
|
2
|
-
import { importFromOpenApi } from "../../libs/contracts-transformers/dist/openapi/importer.js";
|
|
3
|
-
import "../../libs/contracts-transformers/dist/openapi/index.js";
|
|
4
|
-
import { dirname, join } from "path";
|
|
5
|
-
|
|
6
|
-
//#region src/services/openapi/import-service.ts
|
|
7
|
-
/**
|
|
8
|
-
* OpenAPI import service - imports specs from OpenAPI documents.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Import ContractSpec specs from an OpenAPI document.
|
|
12
|
-
*/
|
|
13
|
-
async function importFromOpenApiService(options, adapters) {
|
|
14
|
-
const { fs, logger } = adapters;
|
|
15
|
-
const { source, outputDir, prefix, tags, exclude, defaultStability, defaultOwners, defaultAuth, dryRun = false } = options;
|
|
16
|
-
logger.info(`Importing from OpenAPI: ${source}`);
|
|
17
|
-
const parseResult = await parseOpenApi(source, {
|
|
18
|
-
fetch: globalThis.fetch,
|
|
19
|
-
readFile: (path) => fs.readFile(path)
|
|
20
|
-
});
|
|
21
|
-
if (parseResult.warnings.length > 0) for (const warning of parseResult.warnings) logger.warn(`Parse warning: ${warning}`);
|
|
22
|
-
logger.info(`Parsed ${parseResult.operations.length} operations from ${parseResult.info.title} v${parseResult.info.version}`);
|
|
23
|
-
const importResult = importFromOpenApi(parseResult, {
|
|
24
|
-
prefix,
|
|
25
|
-
tags,
|
|
26
|
-
exclude,
|
|
27
|
-
defaultStability,
|
|
28
|
-
defaultOwners,
|
|
29
|
-
defaultAuth
|
|
30
|
-
});
|
|
31
|
-
logger.info(`Import result: ${importResult.summary.imported} imported, ${importResult.summary.skipped} skipped, ${importResult.summary.errors} errors`);
|
|
32
|
-
const files = [];
|
|
33
|
-
const skippedOperations = [];
|
|
34
|
-
const errorMessages = [];
|
|
35
|
-
for (const spec of importResult.specs) {
|
|
36
|
-
const filePath = join(outputDir, spec.fileName);
|
|
37
|
-
if (dryRun) logger.info(`[DRY RUN] Would create: ${filePath}`);
|
|
38
|
-
else {
|
|
39
|
-
const dir = dirname(filePath);
|
|
40
|
-
await fs.mkdir(dir);
|
|
41
|
-
await fs.writeFile(filePath, spec.code);
|
|
42
|
-
logger.info(`Created: ${filePath}`);
|
|
43
|
-
}
|
|
44
|
-
files.push({
|
|
45
|
-
path: filePath,
|
|
46
|
-
operationId: spec.source.sourceId,
|
|
47
|
-
specName: spec.fileName.replace(".ts", "")
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
for (const skipped of importResult.skipped) {
|
|
51
|
-
skippedOperations.push({
|
|
52
|
-
operationId: skipped.sourceId,
|
|
53
|
-
reason: skipped.reason
|
|
54
|
-
});
|
|
55
|
-
logger.debug(`Skipped: ${skipped.sourceId} - ${skipped.reason}`);
|
|
56
|
-
}
|
|
57
|
-
for (const error of importResult.errors) {
|
|
58
|
-
errorMessages.push({
|
|
59
|
-
operationId: error.sourceId,
|
|
60
|
-
error: error.error
|
|
61
|
-
});
|
|
62
|
-
logger.error(`Error: ${error.sourceId} - ${error.error}`);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
imported: importResult.summary.imported,
|
|
66
|
-
skipped: importResult.summary.skipped,
|
|
67
|
-
errors: importResult.summary.errors,
|
|
68
|
-
files,
|
|
69
|
-
skippedOperations,
|
|
70
|
-
errorMessages
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
export { importFromOpenApiService };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { parseOpenApi } from "../../libs/contracts-transformers/dist/openapi/parser.js";
|
|
2
|
-
import { importFromOpenApi } from "../../libs/contracts-transformers/dist/openapi/importer.js";
|
|
3
|
-
import "../../libs/contracts-transformers/dist/openapi/index.js";
|
|
4
|
-
import { dirname, join } from "path";
|
|
5
|
-
|
|
6
|
-
//#region src/services/openapi/sync-service.ts
|
|
7
|
-
/**
|
|
8
|
-
* OpenAPI sync service - syncs specs with OpenAPI sources.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Sync ContractSpec specs with OpenAPI sources.
|
|
12
|
-
*/
|
|
13
|
-
async function syncWithOpenApiService(options, config, adapters) {
|
|
14
|
-
const { fs, logger } = adapters;
|
|
15
|
-
const { sources: optSources, sourceName, interactive, force, dryRun } = options;
|
|
16
|
-
const { sources: configSources, outputDir } = config;
|
|
17
|
-
let sourcesToSync = optSources ?? configSources ?? [];
|
|
18
|
-
if (sourceName) {
|
|
19
|
-
sourcesToSync = sourcesToSync.filter((s) => s.name === sourceName);
|
|
20
|
-
if (sourcesToSync.length === 0) throw new Error(`Source not found: ${sourceName}`);
|
|
21
|
-
}
|
|
22
|
-
if (sourcesToSync.length === 0) {
|
|
23
|
-
logger.warn("No OpenAPI sources configured. Add sources to .contractsrc.json");
|
|
24
|
-
return {
|
|
25
|
-
added: 0,
|
|
26
|
-
updated: 0,
|
|
27
|
-
unchanged: 0,
|
|
28
|
-
conflicts: 0,
|
|
29
|
-
changes: []
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const result = {
|
|
33
|
-
added: 0,
|
|
34
|
-
updated: 0,
|
|
35
|
-
unchanged: 0,
|
|
36
|
-
conflicts: 0,
|
|
37
|
-
changes: []
|
|
38
|
-
};
|
|
39
|
-
for (const source of sourcesToSync) {
|
|
40
|
-
logger.info(`Syncing with source: ${source.name}`);
|
|
41
|
-
const sourceLocation = source.url ?? source.file;
|
|
42
|
-
if (!sourceLocation) {
|
|
43
|
-
logger.warn(`Source ${source.name} has no url or file configured`);
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
const parseResult = await parseOpenApi(sourceLocation, {
|
|
47
|
-
fetch: globalThis.fetch,
|
|
48
|
-
readFile: (path) => fs.readFile(path)
|
|
49
|
-
});
|
|
50
|
-
logger.info(`Parsed ${parseResult.operations.length} operations from ${source.name}`);
|
|
51
|
-
const importResult = importFromOpenApi(parseResult, {
|
|
52
|
-
prefix: source.prefix,
|
|
53
|
-
tags: source.tags,
|
|
54
|
-
exclude: source.exclude,
|
|
55
|
-
defaultStability: source.defaultStability,
|
|
56
|
-
defaultAuth: source.defaultAuth
|
|
57
|
-
});
|
|
58
|
-
for (const imported of importResult.specs) {
|
|
59
|
-
const filePath = join(outputDir, imported.fileName);
|
|
60
|
-
if (!await fs.exists(filePath)) {
|
|
61
|
-
if (!dryRun) {
|
|
62
|
-
const dir = dirname(filePath);
|
|
63
|
-
await fs.mkdir(dir);
|
|
64
|
-
await fs.writeFile(filePath, imported.code);
|
|
65
|
-
}
|
|
66
|
-
result.added++;
|
|
67
|
-
result.changes.push({
|
|
68
|
-
operationId: imported.source.sourceId,
|
|
69
|
-
action: "added",
|
|
70
|
-
path: filePath
|
|
71
|
-
});
|
|
72
|
-
logger.info(`Added: ${imported.source.sourceId}`);
|
|
73
|
-
} else if (await fs.readFile(filePath) === imported.code) {
|
|
74
|
-
result.unchanged++;
|
|
75
|
-
result.changes.push({
|
|
76
|
-
operationId: imported.source.sourceId,
|
|
77
|
-
action: "unchanged",
|
|
78
|
-
path: filePath
|
|
79
|
-
});
|
|
80
|
-
} else if (force === "openapi") {
|
|
81
|
-
if (!dryRun) await fs.writeFile(filePath, imported.code);
|
|
82
|
-
result.updated++;
|
|
83
|
-
result.changes.push({
|
|
84
|
-
operationId: imported.source.sourceId,
|
|
85
|
-
action: "updated",
|
|
86
|
-
path: filePath
|
|
87
|
-
});
|
|
88
|
-
logger.info(`Updated: ${imported.source.sourceId}`);
|
|
89
|
-
} else if (force === "contractspec") {
|
|
90
|
-
result.unchanged++;
|
|
91
|
-
result.changes.push({
|
|
92
|
-
operationId: imported.source.sourceId,
|
|
93
|
-
action: "unchanged",
|
|
94
|
-
path: filePath
|
|
95
|
-
});
|
|
96
|
-
logger.info(`Kept: ${imported.source.sourceId}`);
|
|
97
|
-
} else if (interactive) {
|
|
98
|
-
result.conflicts++;
|
|
99
|
-
result.changes.push({
|
|
100
|
-
operationId: imported.source.sourceId,
|
|
101
|
-
action: "conflict",
|
|
102
|
-
path: filePath
|
|
103
|
-
});
|
|
104
|
-
logger.warn(`Conflict: ${imported.source.sourceId} - needs resolution`);
|
|
105
|
-
} else {
|
|
106
|
-
result.conflicts++;
|
|
107
|
-
result.changes.push({
|
|
108
|
-
operationId: imported.source.sourceId,
|
|
109
|
-
action: "conflict",
|
|
110
|
-
path: filePath
|
|
111
|
-
});
|
|
112
|
-
logger.warn(`Conflict: ${imported.source.sourceId}`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
logger.info(`Sync complete: ${result.added} added, ${result.updated} updated, ${result.unchanged} unchanged, ${result.conflicts} conflicts`);
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
//#endregion
|
|
121
|
-
export { syncWithOpenApiService };
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { parseOpenApi } from "../../libs/contracts-transformers/dist/openapi/parser.js";
|
|
2
|
-
import "../../libs/contracts-transformers/dist/openapi/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/services/openapi/validate-service.ts
|
|
5
|
-
/**
|
|
6
|
-
* OpenAPI validation service - validates specs against OpenAPI sources.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Validate ContractSpec specs against an OpenAPI source.
|
|
10
|
-
*/
|
|
11
|
-
async function validateAgainstOpenApiService(options, adapters) {
|
|
12
|
-
const { fs, logger } = adapters;
|
|
13
|
-
const { specPath, openApiSource, ignoreDescriptions, ignoreTags, ignoreTransport } = options;
|
|
14
|
-
logger.info(`Validating specs against OpenAPI: ${openApiSource}`);
|
|
15
|
-
const parseResult = await parseOpenApi(openApiSource, {
|
|
16
|
-
fetch: globalThis.fetch,
|
|
17
|
-
readFile: (path) => fs.readFile(path)
|
|
18
|
-
});
|
|
19
|
-
logger.info(`Parsed ${parseResult.operations.length} operations from ${parseResult.info.title}`);
|
|
20
|
-
const operationsMap = /* @__PURE__ */ new Map();
|
|
21
|
-
for (const op of parseResult.operations) operationsMap.set(op.operationId, op);
|
|
22
|
-
const results = [];
|
|
23
|
-
let specsValidated = 0;
|
|
24
|
-
let specsWithDiffs = 0;
|
|
25
|
-
const stat = await fs.stat(specPath);
|
|
26
|
-
const specFiles = [];
|
|
27
|
-
if (stat.isDirectory) {
|
|
28
|
-
const files = await fs.glob({
|
|
29
|
-
pattern: "**/*.ts",
|
|
30
|
-
cwd: specPath,
|
|
31
|
-
ignore: [
|
|
32
|
-
"node_modules/**",
|
|
33
|
-
"dist/**",
|
|
34
|
-
"*.test.ts",
|
|
35
|
-
"*.spec.ts"
|
|
36
|
-
],
|
|
37
|
-
absolute: true
|
|
38
|
-
});
|
|
39
|
-
specFiles.push(...files);
|
|
40
|
-
} else specFiles.push(specPath);
|
|
41
|
-
logger.info(`Found ${specFiles.length} spec files to validate`);
|
|
42
|
-
for (const file of specFiles) try {
|
|
43
|
-
const content = await fs.readFile(file);
|
|
44
|
-
const operationIdMatch = content.match(/operationId:\s*['"]([^'"]+)['"]/) || content.match(/name:\s*['"]([^'"]+)['"]/) || content.match(/export\s+const\s+(\w+)Spec\s*=/);
|
|
45
|
-
if (!operationIdMatch || !operationIdMatch[1]) {
|
|
46
|
-
logger.debug(`Could not extract operationId from ${file}`);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
const specName = operationIdMatch[1];
|
|
50
|
-
specsValidated++;
|
|
51
|
-
let matchingOp;
|
|
52
|
-
matchingOp = operationsMap.get(specName);
|
|
53
|
-
if (!matchingOp) {
|
|
54
|
-
const snakeName = specName.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
55
|
-
matchingOp = operationsMap.get(snakeName);
|
|
56
|
-
}
|
|
57
|
-
if (!matchingOp) {
|
|
58
|
-
for (const [opId, op] of operationsMap) if (opId.toLowerCase().includes(specName.toLowerCase()) || specName.toLowerCase().includes(opId.toLowerCase())) {
|
|
59
|
-
matchingOp = op;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (!matchingOp) {
|
|
64
|
-
results.push({
|
|
65
|
-
specPath: file,
|
|
66
|
-
valid: false,
|
|
67
|
-
diffs: [{
|
|
68
|
-
path: "",
|
|
69
|
-
type: "removed",
|
|
70
|
-
description: `No matching operation found in OpenAPI for spec: ${specName}`
|
|
71
|
-
}]
|
|
72
|
-
});
|
|
73
|
-
specsWithDiffs++;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
const diffs = [];
|
|
77
|
-
if (matchingOp.deprecated && !content.includes("deprecated")) diffs.push({
|
|
78
|
-
path: "meta.stability",
|
|
79
|
-
type: "modified",
|
|
80
|
-
description: "OpenAPI operation is deprecated but spec does not indicate deprecation"
|
|
81
|
-
});
|
|
82
|
-
if (!ignoreTransport) {
|
|
83
|
-
const pathMatch = content.match(/path:\s*['"]([^'"]+)['"]/);
|
|
84
|
-
if (pathMatch && pathMatch[1] !== matchingOp.path) diffs.push({
|
|
85
|
-
path: "transport.rest.path",
|
|
86
|
-
type: "modified",
|
|
87
|
-
description: `Path mismatch: spec has "${pathMatch[1]}", OpenAPI has "${matchingOp.path}"`
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (!ignoreTransport) {
|
|
91
|
-
const methodMatch = content.match(/method:\s*['"]([^'"]+)['"]/);
|
|
92
|
-
if (methodMatch?.[1] && methodMatch[1].toLowerCase() !== matchingOp.method.toLowerCase()) diffs.push({
|
|
93
|
-
path: "transport.rest.method",
|
|
94
|
-
type: "modified",
|
|
95
|
-
description: `Method mismatch: spec has "${methodMatch[1]}", OpenAPI has "${matchingOp.method.toUpperCase()}"`
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const valid$1 = diffs.length === 0;
|
|
99
|
-
if (!valid$1) specsWithDiffs++;
|
|
100
|
-
results.push({
|
|
101
|
-
specPath: file,
|
|
102
|
-
operationId: matchingOp.operationId,
|
|
103
|
-
valid: valid$1,
|
|
104
|
-
diffs
|
|
105
|
-
});
|
|
106
|
-
} catch (error) {
|
|
107
|
-
logger.error(`Error validating ${file}: ${error}`);
|
|
108
|
-
results.push({
|
|
109
|
-
specPath: file,
|
|
110
|
-
valid: false,
|
|
111
|
-
diffs: [{
|
|
112
|
-
path: "",
|
|
113
|
-
type: "modified",
|
|
114
|
-
description: `Error: ${error instanceof Error ? error.message : String(error)}`
|
|
115
|
-
}]
|
|
116
|
-
});
|
|
117
|
-
specsWithDiffs++;
|
|
118
|
-
}
|
|
119
|
-
const valid = specsWithDiffs === 0;
|
|
120
|
-
logger.info(`Validation ${valid ? "passed" : "failed"}: ${specsValidated} specs checked, ${specsWithDiffs} with differences`);
|
|
121
|
-
return {
|
|
122
|
-
valid,
|
|
123
|
-
specsValidated,
|
|
124
|
-
specsWithDiffs,
|
|
125
|
-
results
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
//#endregion
|
|
130
|
-
export { validateAgainstOpenApiService };
|