@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217083314 → 1.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +1 -22
- package/dist/adapters/ai.js +1 -82
- package/dist/adapters/factory.js +1 -36
- package/dist/adapters/fs.js +1 -118
- package/dist/adapters/git.js +1 -54
- package/dist/adapters/index.js +1 -7
- package/dist/adapters/logger.js +1 -80
- package/dist/adapters/watcher.js +1 -69
- package/dist/adapters/workspace.js +2 -190
- package/dist/ai/agents/claude-code-agent.js +9 -146
- package/dist/ai/agents/cursor-agent.js +17 -286
- package/dist/ai/agents/index.js +1 -5
- package/dist/ai/agents/openai-codex-agent.js +8 -140
- package/dist/ai/agents/orchestrator.js +1 -142
- package/dist/ai/agents/simple-agent.js +4 -80
- package/dist/ai/client.js +1 -162
- package/dist/ai/index.js +1 -27
- package/dist/ai/prompts/code-generation.js +13 -55
- package/dist/ai/prompts/index.js +1 -12
- package/dist/ai/prompts/spec-creation.js +20 -61
- package/dist/ai/providers.js +1 -40
- package/dist/formatters/index.js +1 -18
- package/dist/formatters/json.js +1 -71
- package/dist/formatters/sarif.js +1 -163
- package/dist/formatters/text.js +2 -208
- package/dist/index.js +1 -81
- package/dist/services/agent-guide/adapters/claude-code.js +3 -144
- package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
- package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
- package/dist/services/agent-guide/adapters/index.js +1 -30
- package/dist/services/agent-guide/agent-guide-service.js +1 -148
- package/dist/services/agent-guide/index.js +1 -5
- package/dist/services/build.js +1 -140
- package/dist/services/ci-check/ci-check-service.js +1 -393
- package/dist/services/ci-check/index.js +1 -2
- package/dist/services/ci-check/types.js +1 -28
- package/dist/services/clean.js +1 -71
- package/dist/services/config.js +1 -76
- package/dist/services/deps.js +1 -62
- package/dist/services/diff.js +1 -33
- package/dist/services/doctor/checks/ai.js +2 -118
- package/dist/services/doctor/checks/cli.js +1 -146
- package/dist/services/doctor/checks/config.js +1 -170
- package/dist/services/doctor/checks/deps.js +1 -180
- package/dist/services/doctor/checks/index.js +1 -6
- package/dist/services/doctor/checks/mcp.js +1 -144
- package/dist/services/doctor/checks/workspace.js +1 -243
- package/dist/services/doctor/doctor-service.js +2 -115
- package/dist/services/doctor/index.js +1 -2
- package/dist/services/doctor/types.js +1 -26
- package/dist/services/implementation/discovery.js +2 -143
- package/dist/services/implementation/index.js +1 -2
- package/dist/services/implementation/resolver.js +1 -223
- package/dist/services/index.js +1 -53
- package/dist/services/integrity-diagram.js +6 -274
- package/dist/services/integrity.js +1 -272
- package/dist/services/list.js +1 -35
- package/dist/services/openapi/export-service.js +2 -51
- package/dist/services/openapi/import-service.js +1 -75
- package/dist/services/openapi/index.js +1 -4
- package/dist/services/openapi/sync-service.js +1 -121
- package/dist/services/openapi/validate-service.js +1 -130
- package/dist/services/regenerator.js +1 -23
- package/dist/services/registry.js +1 -73
- package/dist/services/setup/config-generators.js +26 -113
- package/dist/services/setup/file-merger.js +2 -60
- package/dist/services/setup/index.js +1 -4
- package/dist/services/setup/setup-service.js +1 -95
- package/dist/services/setup/targets/agents-md.js +1 -46
- package/dist/services/setup/targets/cli-config.js +1 -59
- package/dist/services/setup/targets/cursor-rules.js +1 -47
- package/dist/services/setup/targets/mcp-claude.js +1 -59
- package/dist/services/setup/targets/mcp-cursor.js +1 -58
- package/dist/services/setup/targets/vscode-settings.js +1 -62
- package/dist/services/setup/types.js +1 -26
- package/dist/services/sync.js +1 -62
- package/dist/services/test.js +1 -30
- package/dist/services/validate-implementation.js +1 -69
- package/dist/services/validate.js +1 -47
- package/dist/services/verification-cache/adapters/filesystem.js +1 -121
- package/dist/services/verification-cache/adapters/in-memory.js +1 -45
- package/dist/services/verification-cache/adapters/index.js +1 -3
- package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
- package/dist/services/verification-cache/cache-service.js +1 -255
- package/dist/services/verification-cache/index.js +1 -6
- package/dist/services/verification-cache/types.js +1 -15
- package/dist/services/verify/ai-verifier.js +9 -336
- package/dist/services/verify/behavior-verifier.js +1 -185
- package/dist/services/verify/index.js +1 -4
- package/dist/services/verify/structure-verifier.js +2 -195
- package/dist/services/verify/verify-service.js +3 -203
- package/dist/services/watch.js +1 -31
- package/dist/services/workspace-info.js +2 -102
- package/dist/templates/app-config.template.js +28 -101
- package/dist/templates/data-view.template.js +27 -42
- package/dist/templates/event.template.js +14 -29
- package/dist/templates/experiment.template.js +51 -77
- package/dist/templates/handler.template.js +17 -53
- package/dist/templates/index.js +1 -36
- package/dist/templates/integration.template.js +50 -134
- package/dist/templates/knowledge.template.js +21 -62
- package/dist/templates/migration.template.js +26 -50
- package/dist/templates/operation.template.js +28 -44
- package/dist/templates/presentation.template.js +20 -46
- package/dist/templates/telemetry.template.js +53 -74
- package/dist/templates/workflow-runner.template.js +6 -12
- package/dist/templates/workflow.template.js +24 -51
- package/package.json +10 -15
- package/dist/adapters/ai.d.ts +0 -11
- package/dist/adapters/factory.d.ts +0 -28
- package/dist/adapters/fs.d.ts +0 -10
- package/dist/adapters/git.d.ts +0 -10
- package/dist/adapters/logger.d.ts +0 -17
- package/dist/adapters/watcher.d.ts +0 -10
- package/dist/adapters/workspace.d.ts +0 -93
- package/dist/ai/agents/claude-code-agent.d.ts +0 -21
- package/dist/ai/agents/cursor-agent.d.ts +0 -67
- package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
- package/dist/ai/agents/orchestrator.d.ts +0 -49
- package/dist/ai/agents/simple-agent.d.ts +0 -16
- package/dist/ai/agents/types.d.ts +0 -35
- package/dist/ai/client.d.ts +0 -82
- package/dist/ai/index.d.ts +0 -16
- package/dist/ai/prompts/code-generation.d.ts +0 -25
- package/dist/ai/prompts/index.d.ts +0 -9
- package/dist/ai/prompts/spec-creation.d.ts +0 -28
- package/dist/ai/providers.d.ts +0 -28
- package/dist/formatters/index.d.ts +0 -10
- package/dist/formatters/json.d.ts +0 -88
- package/dist/formatters/sarif.d.ts +0 -100
- package/dist/formatters/text.d.ts +0 -34
- package/dist/index.d.ts +0 -66
- 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/ports/ai.d.ts +0 -58
- package/dist/ports/fs.d.ts +0 -80
- package/dist/ports/git.d.ts +0 -32
- package/dist/ports/logger.d.ts +0 -87
- package/dist/ports/watcher.d.ts +0 -51
- package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
- package/dist/services/agent-guide/adapters/index.d.ts +0 -22
- package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
- package/dist/services/agent-guide/types.d.ts +0 -57
- package/dist/services/build.d.ts +0 -58
- package/dist/services/ci-check/ci-check-service.d.ts +0 -15
- package/dist/services/ci-check/types.d.ts +0 -142
- package/dist/services/clean.d.ts +0 -40
- package/dist/services/config.d.ts +0 -25
- package/dist/services/deps.d.ts +0 -52
- package/dist/services/diff.d.ts +0 -33
- package/dist/services/doctor/doctor-service.d.ts +0 -23
- package/dist/services/doctor/types.d.ts +0 -117
- package/dist/services/implementation/discovery.d.ts +0 -29
- package/dist/services/implementation/resolver.d.ts +0 -43
- package/dist/services/implementation/types.d.ts +0 -78
- package/dist/services/integrity-diagram.d.ts +0 -35
- package/dist/services/integrity.d.ts +0 -133
- package/dist/services/list.d.ts +0 -30
- package/dist/services/openapi/export-service.d.ts +0 -52
- package/dist/services/openapi/import-service.d.ts +0 -15
- package/dist/services/openapi/sync-service.d.ts +0 -18
- package/dist/services/openapi/types.d.ts +0 -184
- package/dist/services/openapi/validate-service.d.ts +0 -15
- package/dist/services/regenerator.d.ts +0 -17
- package/dist/services/registry.d.ts +0 -52
- package/dist/services/setup/config-generators.d.ts +0 -41
- package/dist/services/setup/file-merger.d.ts +0 -26
- package/dist/services/setup/setup-service.d.ts +0 -11
- package/dist/services/setup/types.d.ts +0 -84
- package/dist/services/sync.d.ts +0 -40
- package/dist/services/test.d.ts +0 -14
- package/dist/services/validate-implementation.d.ts +0 -31
- package/dist/services/validate.d.ts +0 -40
- package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
- package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
- package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
- package/dist/services/verification-cache/cache-service.d.ts +0 -69
- package/dist/services/verification-cache/types.d.ts +0 -123
- package/dist/services/verify/ai-verifier.d.ts +0 -24
- package/dist/services/verify/behavior-verifier.d.ts +0 -11
- package/dist/services/verify/structure-verifier.d.ts +0 -11
- package/dist/services/verify/types.d.ts +0 -136
- package/dist/services/verify/verify-service.d.ts +0 -59
- package/dist/services/watch.d.ts +0 -24
- package/dist/services/workspace-info.d.ts +0 -61
- package/dist/templates/app-config.template.d.ts +0 -6
- package/dist/templates/data-view.template.d.ts +0 -6
- package/dist/templates/event.template.d.ts +0 -10
- package/dist/templates/experiment.template.d.ts +0 -6
- package/dist/templates/handler.template.d.ts +0 -15
- package/dist/templates/index.d.ts +0 -20
- package/dist/templates/integration.template.d.ts +0 -6
- package/dist/templates/knowledge.template.d.ts +0 -6
- package/dist/templates/migration.template.d.ts +0 -6
- package/dist/templates/operation.template.d.ts +0 -10
- package/dist/templates/presentation.template.d.ts +0 -10
- package/dist/templates/telemetry.template.d.ts +0 -6
- package/dist/templates/workflow-runner.template.d.ts +0 -15
- package/dist/templates/workflow.template.d.ts +0 -6
- package/dist/types/config.d.ts +0 -33
- package/dist/types.d.ts +0 -323
|
@@ -1,143 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Patterns for detecting spec references in source code.
|
|
4
|
-
*/
|
|
5
|
-
const SPEC_REFERENCE_PATTERNS = {
|
|
6
|
-
namedImport: /import\s*\{[^}]*\b(\w+(?:Spec|Contract|Command|Query))\b[^}]*\}\s*from/g,
|
|
7
|
-
defaultImport: /import\s+(\w+(?:Spec|Contract|Command|Query))\s+from/g,
|
|
8
|
-
contractHandler: /ContractHandler\s*<\s*typeof\s+(\w+)\s*>/g,
|
|
9
|
-
typeofSpec: /typeof\s+(\w+(?:Spec|Contract|Command|Query))\b/g,
|
|
10
|
-
specAssignment: /(?:spec|contract)\s*[:=]\s*(\w+(?:Spec|Contract|Command|Query))\b/gi
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* File patterns that indicate implementation types.
|
|
14
|
-
*/
|
|
15
|
-
const IMPLEMENTATION_TYPE_PATTERNS = {
|
|
16
|
-
".handler.ts": "handler",
|
|
17
|
-
".handler.tsx": "handler",
|
|
18
|
-
".service.ts": "service",
|
|
19
|
-
".service.tsx": "service",
|
|
20
|
-
".test.ts": "test",
|
|
21
|
-
".test.tsx": "test",
|
|
22
|
-
".spec.ts": "test",
|
|
23
|
-
".spec.tsx": "test",
|
|
24
|
-
".component.tsx": "component",
|
|
25
|
-
".tsx": "component",
|
|
26
|
-
".form.tsx": "form",
|
|
27
|
-
".hook.ts": "hook",
|
|
28
|
-
".hook.tsx": "hook"
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Infer implementation type from file path.
|
|
32
|
-
*/
|
|
33
|
-
function inferImplementationType(filePath) {
|
|
34
|
-
const lowerPath = filePath.toLowerCase();
|
|
35
|
-
for (const [pattern, type] of Object.entries(IMPLEMENTATION_TYPE_PATTERNS)) if (lowerPath.endsWith(pattern)) return type;
|
|
36
|
-
if (lowerPath.includes("/handlers/")) return "handler";
|
|
37
|
-
if (lowerPath.includes("/services/")) return "service";
|
|
38
|
-
if (lowerPath.includes("/components/")) return "component";
|
|
39
|
-
if (lowerPath.includes("/forms/")) return "form";
|
|
40
|
-
if (lowerPath.includes("/hooks/")) return "hook";
|
|
41
|
-
if (lowerPath.includes("/__tests__/")) return "test";
|
|
42
|
-
return "other";
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Extract spec references from source code.
|
|
46
|
-
*/
|
|
47
|
-
function extractSpecReferences(code, filePath) {
|
|
48
|
-
const matches = [];
|
|
49
|
-
const seenSpecs = /* @__PURE__ */ new Set();
|
|
50
|
-
const addMatch = (specName, referenceType, lineNumber) => {
|
|
51
|
-
const key = `${specName}:${referenceType}`;
|
|
52
|
-
if (seenSpecs.has(key)) return;
|
|
53
|
-
seenSpecs.add(key);
|
|
54
|
-
matches.push({
|
|
55
|
-
filePath,
|
|
56
|
-
specName,
|
|
57
|
-
referenceType,
|
|
58
|
-
lineNumber,
|
|
59
|
-
inferredType: inferImplementationType(filePath)
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
const getLineNumber = (position) => {
|
|
63
|
-
return code.substring(0, position).split("\n").length;
|
|
64
|
-
};
|
|
65
|
-
let match;
|
|
66
|
-
const handlerPattern = new RegExp(SPEC_REFERENCE_PATTERNS.contractHandler);
|
|
67
|
-
while ((match = handlerPattern.exec(code)) !== null) addMatch(match[1], "handler", getLineNumber(match.index));
|
|
68
|
-
const typeofPattern = new RegExp(SPEC_REFERENCE_PATTERNS.typeofSpec);
|
|
69
|
-
while ((match = typeofPattern.exec(code)) !== null) addMatch(match[1], "typeof", getLineNumber(match.index));
|
|
70
|
-
const namedPattern = new RegExp(SPEC_REFERENCE_PATTERNS.namedImport);
|
|
71
|
-
while ((match = namedPattern.exec(code)) !== null) {
|
|
72
|
-
const specNames = match[0].match(/\b(\w+(?:Spec|Contract|Command|Query))\b/g);
|
|
73
|
-
if (specNames) for (const name of specNames) addMatch(name, "import", getLineNumber(match.index));
|
|
74
|
-
}
|
|
75
|
-
const defaultPattern = new RegExp(SPEC_REFERENCE_PATTERNS.defaultImport);
|
|
76
|
-
while ((match = defaultPattern.exec(code)) !== null) addMatch(match[1], "import", getLineNumber(match.index));
|
|
77
|
-
const assignPattern = new RegExp(SPEC_REFERENCE_PATTERNS.specAssignment);
|
|
78
|
-
while ((match = assignPattern.exec(code)) !== null) addMatch(match[1], "unknown", getLineNumber(match.index));
|
|
79
|
-
return matches;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Default glob patterns for implementation files.
|
|
83
|
-
*/
|
|
84
|
-
const DEFAULT_INCLUDE_PATTERNS = ["**/*.ts", "**/*.tsx"];
|
|
85
|
-
const DEFAULT_EXCLUDE_PATTERNS = [
|
|
86
|
-
"**/node_modules/**",
|
|
87
|
-
"**/dist/**",
|
|
88
|
-
"**/.git/**",
|
|
89
|
-
"**/*.d.ts",
|
|
90
|
-
"**/*.contracts.ts",
|
|
91
|
-
"**/*.spec.ts",
|
|
92
|
-
"**/*.feature.ts",
|
|
93
|
-
"**/*.event.ts",
|
|
94
|
-
"**/*.presentation.ts"
|
|
95
|
-
];
|
|
96
|
-
/**
|
|
97
|
-
* Discover implementations that reference a specific spec.
|
|
98
|
-
*/
|
|
99
|
-
async function discoverImplementationsForSpec(specName, adapters, options = {}) {
|
|
100
|
-
const { fs } = adapters;
|
|
101
|
-
const includePatterns = options.includePatterns ?? DEFAULT_INCLUDE_PATTERNS;
|
|
102
|
-
const excludePatterns = options.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS;
|
|
103
|
-
const allMatches = [];
|
|
104
|
-
for (const pattern of includePatterns) {
|
|
105
|
-
const files = await fs.glob({
|
|
106
|
-
pattern,
|
|
107
|
-
ignore: excludePatterns
|
|
108
|
-
});
|
|
109
|
-
for (const filePath of files) try {
|
|
110
|
-
const matchingRefs = extractSpecReferences(await fs.readFile(filePath), filePath).filter((ref) => ref.specName === specName);
|
|
111
|
-
allMatches.push(...matchingRefs);
|
|
112
|
-
} catch {}
|
|
113
|
-
}
|
|
114
|
-
return allMatches;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Discover all spec references in the workspace.
|
|
118
|
-
* Returns a map of spec name to implementation references.
|
|
119
|
-
*/
|
|
120
|
-
async function discoverAllImplementations(adapters, options = {}) {
|
|
121
|
-
const { fs } = adapters;
|
|
122
|
-
const includePatterns = options.includePatterns ?? DEFAULT_INCLUDE_PATTERNS;
|
|
123
|
-
const excludePatterns = options.excludePatterns ?? DEFAULT_EXCLUDE_PATTERNS;
|
|
124
|
-
const specToImplementations = /* @__PURE__ */ new Map();
|
|
125
|
-
for (const pattern of includePatterns) {
|
|
126
|
-
const files = await fs.glob({
|
|
127
|
-
pattern,
|
|
128
|
-
ignore: excludePatterns
|
|
129
|
-
});
|
|
130
|
-
for (const filePath of files) try {
|
|
131
|
-
const references = extractSpecReferences(await fs.readFile(filePath), filePath);
|
|
132
|
-
for (const ref of references) {
|
|
133
|
-
const existing = specToImplementations.get(ref.specName) ?? [];
|
|
134
|
-
existing.push(ref);
|
|
135
|
-
specToImplementations.set(ref.specName, existing);
|
|
136
|
-
}
|
|
137
|
-
} catch {}
|
|
138
|
-
}
|
|
139
|
-
return specToImplementations;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
//#endregion
|
|
143
|
-
export { discoverAllImplementations, discoverImplementationsForSpec, extractSpecReferences, inferImplementationType };
|
|
1
|
+
const e={namedImport:/import\s*\{[^}]*\b(\w+(?:Spec|Contract|Command|Query))\b[^}]*\}\s*from/g,defaultImport:/import\s+(\w+(?:Spec|Contract|Command|Query))\s+from/g,contractHandler:/ContractHandler\s*<\s*typeof\s+(\w+)\s*>/g,typeofSpec:/typeof\s+(\w+(?:Spec|Contract|Command|Query))\b/g,specAssignment:/(?:spec|contract)\s*[:=]\s*(\w+(?:Spec|Contract|Command|Query))\b/gi},t={".handler.ts":`handler`,".handler.tsx":`handler`,".service.ts":`service`,".service.tsx":`service`,".test.ts":`test`,".test.tsx":`test`,".spec.ts":`test`,".spec.tsx":`test`,".component.tsx":`component`,".tsx":`component`,".form.tsx":`form`,".hook.ts":`hook`,".hook.tsx":`hook`};function n(e){let n=e.toLowerCase();for(let[e,r]of Object.entries(t))if(n.endsWith(e))return r;return n.includes(`/handlers/`)?`handler`:n.includes(`/services/`)?`service`:n.includes(`/components/`)?`component`:n.includes(`/forms/`)?`form`:n.includes(`/hooks/`)?`hook`:n.includes(`/__tests__/`)?`test`:`other`}function r(t,r){let i=[],a=new Set,o=(e,t,o)=>{let s=`${e}:${t}`;a.has(s)||(a.add(s),i.push({filePath:r,specName:e,referenceType:t,lineNumber:o,inferredType:n(r)}))},s=e=>t.substring(0,e).split(`
|
|
2
|
+
`).length,c,l=new RegExp(e.contractHandler);for(;(c=l.exec(t))!==null;)o(c[1],`handler`,s(c.index));let u=new RegExp(e.typeofSpec);for(;(c=u.exec(t))!==null;)o(c[1],`typeof`,s(c.index));let d=new RegExp(e.namedImport);for(;(c=d.exec(t))!==null;){let e=c[0].match(/\b(\w+(?:Spec|Contract|Command|Query))\b/g);if(e)for(let t of e)o(t,`import`,s(c.index))}let f=new RegExp(e.defaultImport);for(;(c=f.exec(t))!==null;)o(c[1],`import`,s(c.index));let p=new RegExp(e.specAssignment);for(;(c=p.exec(t))!==null;)o(c[1],`unknown`,s(c.index));return i}const i=[`**/*.ts`,`**/*.tsx`],a=[`**/node_modules/**`,`**/dist/**`,`**/.git/**`,`**/*.d.ts`,`**/*.contracts.ts`,`**/*.spec.ts`,`**/*.feature.ts`,`**/*.event.ts`,`**/*.presentation.ts`];async function o(e,t,n={}){let{fs:o}=t,s=n.includePatterns??i,c=n.excludePatterns??a,l=[];for(let t of s){let n=await o.glob({pattern:t,ignore:c});for(let t of n)try{let n=r(await o.readFile(t),t).filter(t=>t.specName===e);l.push(...n)}catch{}}return l}async function s(e,t={}){let{fs:n}=e,o=t.includePatterns??i,s=t.excludePatterns??a,c=new Map;for(let e of o){let t=await n.glob({pattern:e,ignore:s});for(let e of t)try{let t=r(await n.readFile(e),e);for(let e of t){let t=c.get(e.specName)??[];t.push(e),c.set(e.specName,t)}}catch{}}return c}export{s as discoverAllImplementations,o as discoverImplementationsForSpec,r as extractSpecReferences,n as inferImplementationType};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getImplementationSummary, resolveAllImplementations, resolveImplementations } from "./resolver.js";
|
|
1
|
+
import{discoverAllImplementations as e,discoverImplementationsForSpec as t,extractSpecReferences as n,inferImplementationType as r}from"./discovery.js";import{getImplementationSummary as i,resolveAllImplementations as a,resolveImplementations as o}from"./resolver.js";
|
|
@@ -1,223 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { discoverImplementationsForSpec } from "./discovery.js";
|
|
3
|
-
import { createHash } from "crypto";
|
|
4
|
-
|
|
5
|
-
//#region src/services/implementation/resolver.ts
|
|
6
|
-
/**
|
|
7
|
-
* Implementation resolver service.
|
|
8
|
-
*
|
|
9
|
-
* Resolves all implementations for a spec by merging:
|
|
10
|
-
* 1. Explicit mappings from spec.implementations
|
|
11
|
-
* 2. Auto-discovered references from workspace scanning
|
|
12
|
-
* 3. Convention-based paths (naming conventions)
|
|
13
|
-
*/
|
|
14
|
-
const DEFAULT_OPTIONS = {
|
|
15
|
-
includeExplicit: true,
|
|
16
|
-
includeDiscovered: true,
|
|
17
|
-
includeConvention: true,
|
|
18
|
-
computeHashes: true
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Convert string to kebab-case.
|
|
22
|
-
*/
|
|
23
|
-
function toKebabCase(value) {
|
|
24
|
-
return value.replace(/\./g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Compute SHA256 hash of content.
|
|
28
|
-
*/
|
|
29
|
-
function computeHash(content) {
|
|
30
|
-
return createHash("sha256").update(content).digest("hex");
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get convention-based implementation paths for a spec.
|
|
34
|
-
*/
|
|
35
|
-
function getConventionPaths(specType, specName, outputDir) {
|
|
36
|
-
const kebab = toKebabCase(specName);
|
|
37
|
-
const paths = [];
|
|
38
|
-
if (specType === "operation") {
|
|
39
|
-
paths.push({
|
|
40
|
-
path: `${outputDir}/handlers/${kebab}.handler.ts`,
|
|
41
|
-
type: "handler"
|
|
42
|
-
});
|
|
43
|
-
paths.push({
|
|
44
|
-
path: `${outputDir}/handlers/${kebab}.handler.test.ts`,
|
|
45
|
-
type: "test"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (specType === "presentation") {
|
|
49
|
-
paths.push({
|
|
50
|
-
path: `${outputDir}/components/${kebab}.tsx`,
|
|
51
|
-
type: "component"
|
|
52
|
-
});
|
|
53
|
-
paths.push({
|
|
54
|
-
path: `${outputDir}/components/${kebab}.test.tsx`,
|
|
55
|
-
type: "test"
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
if (specType === "form") {
|
|
59
|
-
paths.push({
|
|
60
|
-
path: `${outputDir}/forms/${kebab}.form.tsx`,
|
|
61
|
-
type: "form"
|
|
62
|
-
});
|
|
63
|
-
paths.push({
|
|
64
|
-
path: `${outputDir}/forms/${kebab}.form.test.tsx`,
|
|
65
|
-
type: "test"
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (specType === "event") {
|
|
69
|
-
paths.push({
|
|
70
|
-
path: `${outputDir}/handlers/${kebab}.handler.ts`,
|
|
71
|
-
type: "handler"
|
|
72
|
-
});
|
|
73
|
-
paths.push({
|
|
74
|
-
path: `${outputDir}/handlers/${kebab}.handler.test.ts`,
|
|
75
|
-
type: "test"
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return paths;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Determine overall implementation status.
|
|
82
|
-
*/
|
|
83
|
-
function determineStatus(implementations) {
|
|
84
|
-
if (implementations.length === 0) return "missing";
|
|
85
|
-
const existingImpls = implementations.filter((i) => i.exists);
|
|
86
|
-
implementations.filter((i) => i.type !== "test");
|
|
87
|
-
if (existingImpls.filter((i) => i.type !== "test").length === 0) return "missing";
|
|
88
|
-
if (implementations.every((i) => i.exists)) return "implemented";
|
|
89
|
-
return "partial";
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Resolve all implementations for a spec file.
|
|
93
|
-
*/
|
|
94
|
-
async function resolveImplementations(specFile, adapters, config, options = {}) {
|
|
95
|
-
const opts = {
|
|
96
|
-
...DEFAULT_OPTIONS,
|
|
97
|
-
...options
|
|
98
|
-
};
|
|
99
|
-
const { fs } = adapters;
|
|
100
|
-
if (!await fs.exists(specFile)) throw new Error(`Spec file not found: ${specFile}`);
|
|
101
|
-
const specContent = await fs.readFile(specFile);
|
|
102
|
-
const specHash = opts.computeHashes ? computeHash(specContent) : void 0;
|
|
103
|
-
const scan = scanSpecSource(specContent, specFile);
|
|
104
|
-
const specName = scan.name ?? fs.basename(specFile).replace(/\.[jt]s$/, "");
|
|
105
|
-
const specVersion = scan.version ?? 1;
|
|
106
|
-
const specType = scan.specType ?? "operation";
|
|
107
|
-
const implementations = [];
|
|
108
|
-
const seenPaths = /* @__PURE__ */ new Set();
|
|
109
|
-
const addImpl = async (path, type, source, description) => {
|
|
110
|
-
if (seenPaths.has(path)) return;
|
|
111
|
-
seenPaths.add(path);
|
|
112
|
-
const exists = await fs.exists(path);
|
|
113
|
-
let contentHash;
|
|
114
|
-
if (exists && opts.computeHashes) try {
|
|
115
|
-
contentHash = computeHash(await fs.readFile(path));
|
|
116
|
-
} catch {}
|
|
117
|
-
implementations.push({
|
|
118
|
-
path,
|
|
119
|
-
type,
|
|
120
|
-
source,
|
|
121
|
-
exists,
|
|
122
|
-
contentHash,
|
|
123
|
-
description
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
if (opts.includeExplicit) {
|
|
127
|
-
const explicitImpls = parseExplicitImplementations(specContent);
|
|
128
|
-
for (const impl of explicitImpls) await addImpl(impl.path, impl.type, "explicit", impl.description);
|
|
129
|
-
}
|
|
130
|
-
if (opts.includeDiscovered) {
|
|
131
|
-
const discovered = await discoverImplementationsForSpec(specName, adapters, opts);
|
|
132
|
-
const specNameVariants = getSpecNameVariants(specName);
|
|
133
|
-
for (const variant of specNameVariants) {
|
|
134
|
-
const variantDiscovered = await discoverImplementationsForSpec(variant, adapters, opts);
|
|
135
|
-
discovered.push(...variantDiscovered);
|
|
136
|
-
}
|
|
137
|
-
for (const ref of discovered) {
|
|
138
|
-
if (ref.filePath === specFile) continue;
|
|
139
|
-
await addImpl(ref.filePath, ref.inferredType, "discovered");
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (opts.includeConvention) {
|
|
143
|
-
const conventionPaths = getConventionPaths(specType, specName, opts.outputDir ?? config.outputDir ?? "./src");
|
|
144
|
-
for (const { path, type } of conventionPaths) await addImpl(path, type, "convention");
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
specName,
|
|
148
|
-
specVersion,
|
|
149
|
-
specPath: specFile,
|
|
150
|
-
specType,
|
|
151
|
-
implementations,
|
|
152
|
-
status: determineStatus(implementations),
|
|
153
|
-
specHash
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Parse explicit implementations from spec source code.
|
|
158
|
-
* Looks for: implementations: [{ path: '...', type: '...' }]
|
|
159
|
-
*/
|
|
160
|
-
function parseExplicitImplementations(code) {
|
|
161
|
-
const implementations = [];
|
|
162
|
-
const implMatch = code.match(/implementations\s*:\s*\[([\s\S]*?)\]/);
|
|
163
|
-
if (!implMatch) return implementations;
|
|
164
|
-
const implBlock = implMatch[1];
|
|
165
|
-
if (!implBlock) return implementations;
|
|
166
|
-
const objRegex = /\{\s*path\s*:\s*['"`]([^'"`]+)['"`]\s*,\s*type\s*:\s*['"`]([^'"`]+)['"`](?:\s*,\s*description\s*:\s*['"`]([^'"`]+)['"`])?\s*\}/g;
|
|
167
|
-
let match;
|
|
168
|
-
while ((match = objRegex.exec(implBlock)) !== null) implementations.push({
|
|
169
|
-
path: match[1],
|
|
170
|
-
type: match[2],
|
|
171
|
-
description: match[3]
|
|
172
|
-
});
|
|
173
|
-
return implementations;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Get common variants of a spec name for discovery.
|
|
177
|
-
*/
|
|
178
|
-
function getSpecNameVariants(specName) {
|
|
179
|
-
const variants = [];
|
|
180
|
-
const base = specName.replace(/Spec$/, "").replace(/Contract$/, "").replace(/Command$/, "").replace(/Query$/, "");
|
|
181
|
-
if (base !== specName) {
|
|
182
|
-
variants.push(base);
|
|
183
|
-
variants.push(`${base}Spec`);
|
|
184
|
-
variants.push(`${base}Contract`);
|
|
185
|
-
}
|
|
186
|
-
const parts = specName.split(".");
|
|
187
|
-
if (parts.length > 1) {
|
|
188
|
-
const pascalName = parts.map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join("");
|
|
189
|
-
variants.push(pascalName);
|
|
190
|
-
}
|
|
191
|
-
return variants;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Resolve implementations for multiple spec files.
|
|
195
|
-
*/
|
|
196
|
-
async function resolveAllImplementations(specFiles, adapters, config, options = {}) {
|
|
197
|
-
const results = [];
|
|
198
|
-
for (const specFile of specFiles) try {
|
|
199
|
-
const result = await resolveImplementations(specFile, adapters, config, options);
|
|
200
|
-
results.push(result);
|
|
201
|
-
} catch (error) {
|
|
202
|
-
console.error(`Failed to resolve implementations for ${specFile}:`, error);
|
|
203
|
-
}
|
|
204
|
-
return results;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Get implementation summary statistics.
|
|
208
|
-
*/
|
|
209
|
-
function getImplementationSummary(results) {
|
|
210
|
-
const implemented = results.filter((r) => r.status === "implemented").length;
|
|
211
|
-
const partial = results.filter((r) => r.status === "partial").length;
|
|
212
|
-
const missing = results.filter((r) => r.status === "missing").length;
|
|
213
|
-
return {
|
|
214
|
-
total: results.length,
|
|
215
|
-
implemented,
|
|
216
|
-
partial,
|
|
217
|
-
missing,
|
|
218
|
-
coverage: results.length > 0 ? Math.round(implemented / results.length * 100) : 100
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
//#endregion
|
|
223
|
-
export { getImplementationSummary, resolveAllImplementations, resolveImplementations };
|
|
1
|
+
import{discoverImplementationsForSpec as e}from"./discovery.js";import{scanSpecSource as t}from"@lssm/module.contractspec-workspace";import{createHash as n}from"crypto";const r={includeExplicit:!0,includeDiscovered:!0,includeConvention:!0,computeHashes:!0};function i(e){return e.replace(/\./g,`-`).replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function a(e){return n(`sha256`).update(e).digest(`hex`)}function o(e,t,n){let r=i(t),a=[];return e===`operation`&&(a.push({path:`${n}/handlers/${r}.handler.ts`,type:`handler`}),a.push({path:`${n}/handlers/${r}.handler.test.ts`,type:`test`})),e===`presentation`&&(a.push({path:`${n}/components/${r}.tsx`,type:`component`}),a.push({path:`${n}/components/${r}.test.tsx`,type:`test`})),e===`form`&&(a.push({path:`${n}/forms/${r}.form.tsx`,type:`form`}),a.push({path:`${n}/forms/${r}.form.test.tsx`,type:`test`})),e===`event`&&(a.push({path:`${n}/handlers/${r}.handler.ts`,type:`handler`}),a.push({path:`${n}/handlers/${r}.handler.test.ts`,type:`test`})),a}function s(e){if(e.length===0)return`missing`;let t=e.filter(e=>e.exists);return e.filter(e=>e.type!==`test`),t.filter(e=>e.type!==`test`).length===0?`missing`:e.every(e=>e.exists)?`implemented`:`partial`}async function c(n,i,c,d={}){let f={...r,...d},{fs:p}=i;if(!await p.exists(n))throw Error(`Spec file not found: ${n}`);let m=await p.readFile(n),h=f.computeHashes?a(m):void 0,g=t(m,n),_=g.name??p.basename(n).replace(/\.[jt]s$/,``),v=g.version??1,y=g.specType??`operation`,b=[],x=new Set,S=async(e,t,n,r)=>{if(x.has(e))return;x.add(e);let i=await p.exists(e),o;if(i&&f.computeHashes)try{o=a(await p.readFile(e))}catch{}b.push({path:e,type:t,source:n,exists:i,contentHash:o,description:r})};if(f.includeExplicit){let e=l(m);for(let t of e)await S(t.path,t.type,`explicit`,t.description)}if(f.includeDiscovered){let t=await e(_,i,f),r=u(_);for(let n of r){let r=await e(n,i,f);t.push(...r)}for(let e of t)e.filePath!==n&&await S(e.filePath,e.inferredType,`discovered`)}if(f.includeConvention){let e=o(y,_,f.outputDir??c.outputDir??`./src`);for(let{path:t,type:n}of e)await S(t,n,`convention`)}return{specName:_,specVersion:v,specPath:n,specType:y,implementations:b,status:s(b),specHash:h}}function l(e){let t=[],n=e.match(/implementations\s*:\s*\[([\s\S]*?)\]/);if(!n)return t;let r=n[1];if(!r)return t;let i=/\{\s*path\s*:\s*['"`]([^'"`]+)['"`]\s*,\s*type\s*:\s*['"`]([^'"`]+)['"`](?:\s*,\s*description\s*:\s*['"`]([^'"`]+)['"`])?\s*\}/g,a;for(;(a=i.exec(r))!==null;)t.push({path:a[1],type:a[2],description:a[3]});return t}function u(e){let t=[],n=e.replace(/Spec$/,``).replace(/Contract$/,``).replace(/Command$/,``).replace(/Query$/,``);n!==e&&(t.push(n),t.push(`${n}Spec`),t.push(`${n}Contract`));let r=e.split(`.`);if(r.length>1){let e=r.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``);t.push(e)}return t}async function d(e,t,n,r={}){let i=[];for(let a of e)try{let e=await c(a,t,n,r);i.push(e)}catch(e){console.error(`Failed to resolve implementations for ${a}:`,e)}return i}function f(e){let t=e.filter(e=>e.status===`implemented`).length,n=e.filter(e=>e.status===`partial`).length,r=e.filter(e=>e.status===`missing`).length;return{total:e.length,implemented:t,partial:n,missing:r,coverage:e.length>0?Math.round(t/e.length*100):100}}export{f as getImplementationSummary,d as resolveAllImplementations,c as resolveImplementations};
|
package/dist/services/index.js
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { validateSpec, validateSpecs } from "./validate.js";
|
|
3
|
-
import { validateImplementationFiles } from "./validate-implementation.js";
|
|
4
|
-
import { compareSpecs } from "./diff.js";
|
|
5
|
-
import { analyzeDeps, exportGraphAsDot, getContractNode, getGraphStats } from "./deps.js";
|
|
6
|
-
import { groupSpecsByType, listSpecs } from "./list.js";
|
|
7
|
-
import { getApiKey, loadWorkspaceConfig, mergeWorkspaceConfig } from "./config.js";
|
|
8
|
-
import { buildSpec } from "./build.js";
|
|
9
|
-
import { importFromOpenApiService } from "./openapi/import-service.js";
|
|
10
|
-
import { syncWithOpenApiService } from "./openapi/sync-service.js";
|
|
11
|
-
import { validateAgainstOpenApiService } from "./openapi/validate-service.js";
|
|
12
|
-
import { exportOpenApi } from "./openapi/export-service.js";
|
|
13
|
-
import "./openapi/index.js";
|
|
14
|
-
import { RegistryClient, addToRegistry, listFromRegistry, resolveRegistryUrl, searchRegistry } from "./registry.js";
|
|
15
|
-
import { syncSpecs } from "./sync.js";
|
|
16
|
-
import { watchSpecs } from "./watch.js";
|
|
17
|
-
import { cleanArtifacts } from "./clean.js";
|
|
18
|
-
import { runTests } from "./test.js";
|
|
19
|
-
import { createRegeneratorService } from "./regenerator.js";
|
|
20
|
-
import { findAllConfigFiles, formatWorkspaceInfo, getExtendedWorkspaceInfo, mergeMonorepoConfigs } from "./workspace-info.js";
|
|
21
|
-
import { analyzeIntegrity, filterIssuesBySeverity, filterIssuesByType, getAllSpecs } from "./integrity.js";
|
|
22
|
-
import { generateMermaidDiagram } from "./integrity-diagram.js";
|
|
23
|
-
import { ALL_SETUP_TARGETS, SETUP_TARGET_LABELS } from "./setup/types.js";
|
|
24
|
-
import { generateAgentsMd, generateClaudeMcpConfig, generateContractsrcConfig, generateCursorMcpConfig, generateCursorRules, generateVscodeSettings, getClaudeDesktopConfigPath } from "./setup/config-generators.js";
|
|
25
|
-
import { deepMergeOverwrite, deepMergePreserve, formatJson, safeParseJson } from "./setup/file-merger.js";
|
|
26
|
-
import { runSetup } from "./setup/setup-service.js";
|
|
27
|
-
import "./setup/index.js";
|
|
28
|
-
import { ALL_CHECK_CATEGORIES, CHECK_CATEGORY_LABELS } from "./doctor/types.js";
|
|
29
|
-
import { formatCheckResult, formatDoctorSummary, runDoctor } from "./doctor/doctor-service.js";
|
|
30
|
-
import "./doctor/index.js";
|
|
31
|
-
import { ALL_CI_CHECK_CATEGORIES, CI_CHECK_CATEGORY_LABELS } from "./ci-check/types.js";
|
|
32
|
-
import { discoverAllImplementations, discoverImplementationsForSpec, extractSpecReferences, inferImplementationType } from "./implementation/discovery.js";
|
|
33
|
-
import { getImplementationSummary, resolveAllImplementations, resolveImplementations } from "./implementation/resolver.js";
|
|
34
|
-
import { DEFAULT_CACHE_CONFIG } from "./verification-cache/types.js";
|
|
35
|
-
import { VerificationCacheService, cacheKeyToString, computeContentHash, createVerificationCacheService, stringToCacheKey } from "./verification-cache/cache-service.js";
|
|
36
|
-
import { InMemoryCacheStorage, createInMemoryCacheStorage } from "./verification-cache/adapters/in-memory.js";
|
|
37
|
-
import { FileSystemCacheStorage, createFileSystemCacheStorage } from "./verification-cache/adapters/filesystem.js";
|
|
38
|
-
import { WorkspaceStateCacheStorage, createWorkspaceStateCacheStorage } from "./verification-cache/adapters/workspace-state.js";
|
|
39
|
-
import "./verification-cache/index.js";
|
|
40
|
-
import { runCIChecks } from "./ci-check/ci-check-service.js";
|
|
41
|
-
import "./ci-check/index.js";
|
|
42
|
-
import { ClaudeCodeAdapter, claudeCodeAdapter } from "./agent-guide/adapters/claude-code.js";
|
|
43
|
-
import { CursorCLIAdapter, cursorCLIAdapter } from "./agent-guide/adapters/cursor-cli.js";
|
|
44
|
-
import { GenericMCPAdapter, genericMCPAdapter } from "./agent-guide/adapters/generic-mcp.js";
|
|
45
|
-
import { agentAdapters, getAgentAdapter, listAgentTypes } from "./agent-guide/adapters/index.js";
|
|
46
|
-
import { AgentGuideService, agentGuideService, createAgentGuideService } from "./agent-guide/agent-guide-service.js";
|
|
47
|
-
import "./agent-guide/index.js";
|
|
48
|
-
import { verifyStructure } from "./verify/structure-verifier.js";
|
|
49
|
-
import { verifyBehavior } from "./verify/behavior-verifier.js";
|
|
50
|
-
import { createQuickAIReview, verifySemanticFields, verifyWithAI, verifyWithAIEnhanced } from "./verify/ai-verifier.js";
|
|
51
|
-
import { VerifyService, createVerifyService, verifyService } from "./verify/verify-service.js";
|
|
52
|
-
import "./verify/index.js";
|
|
53
|
-
import "./implementation/index.js";
|
|
1
|
+
import{detectPackageManager as e,findPackageRoot as t,findWorkspaceRoot as n,getWorkspaceInfo as r}from"../adapters/workspace.js";import{validateSpec as i,validateSpecs as a}from"./validate.js";import{validateImplementationFiles as o}from"./validate-implementation.js";import{compareSpecs as s}from"./diff.js";import{analyzeDeps as c,exportGraphAsDot as l,getContractNode as u,getGraphStats as d}from"./deps.js";import{groupSpecsByType as f,listSpecs as p}from"./list.js";import{getApiKey as m,loadWorkspaceConfig as h,mergeWorkspaceConfig as g}from"./config.js";import{buildSpec as _}from"./build.js";import{importFromOpenApiService as v}from"./openapi/import-service.js";import{syncWithOpenApiService as y}from"./openapi/sync-service.js";import{validateAgainstOpenApiService as b}from"./openapi/validate-service.js";import{exportOpenApi as x}from"./openapi/export-service.js";import"./openapi/index.js";import{RegistryClient as S,addToRegistry as C,listFromRegistry as w,resolveRegistryUrl as T,searchRegistry as E}from"./registry.js";import{syncSpecs as D}from"./sync.js";import{watchSpecs as O}from"./watch.js";import{cleanArtifacts as k}from"./clean.js";import{runTests as A}from"./test.js";import{createRegeneratorService as j}from"./regenerator.js";import{findAllConfigFiles as M,formatWorkspaceInfo as N,getExtendedWorkspaceInfo as P,mergeMonorepoConfigs as F}from"./workspace-info.js";import{analyzeIntegrity as I,filterIssuesBySeverity as L,filterIssuesByType as R,getAllSpecs as z}from"./integrity.js";import{generateMermaidDiagram as B}from"./integrity-diagram.js";import{ALL_SETUP_TARGETS as V,SETUP_TARGET_LABELS as H}from"./setup/types.js";import{generateAgentsMd as U,generateClaudeMcpConfig as W,generateContractsrcConfig as G,generateCursorMcpConfig as K,generateCursorRules as q,generateVscodeSettings as J,getClaudeDesktopConfigPath as Y}from"./setup/config-generators.js";import{deepMergeOverwrite as X,deepMergePreserve as Z,formatJson as Q,safeParseJson as $}from"./setup/file-merger.js";import{runSetup as ee}from"./setup/setup-service.js";import"./setup/index.js";import{ALL_CHECK_CATEGORIES as te,CHECK_CATEGORY_LABELS as ne}from"./doctor/types.js";import{formatCheckResult as re,formatDoctorSummary as ie,runDoctor as ae}from"./doctor/doctor-service.js";import"./doctor/index.js";import{ALL_CI_CHECK_CATEGORIES as oe,CI_CHECK_CATEGORY_LABELS as se}from"./ci-check/types.js";import{discoverAllImplementations as ce,discoverImplementationsForSpec as le,extractSpecReferences as ue,inferImplementationType as de}from"./implementation/discovery.js";import{getImplementationSummary as fe,resolveAllImplementations as pe,resolveImplementations as me}from"./implementation/resolver.js";import{DEFAULT_CACHE_CONFIG as he}from"./verification-cache/types.js";import{VerificationCacheService as ge,cacheKeyToString as _e,computeContentHash as ve,createVerificationCacheService as ye,stringToCacheKey as be}from"./verification-cache/cache-service.js";import{InMemoryCacheStorage as xe,createInMemoryCacheStorage as Se}from"./verification-cache/adapters/in-memory.js";import{FileSystemCacheStorage as Ce,createFileSystemCacheStorage as we}from"./verification-cache/adapters/filesystem.js";import{WorkspaceStateCacheStorage as Te,createWorkspaceStateCacheStorage as Ee}from"./verification-cache/adapters/workspace-state.js";import"./verification-cache/index.js";import{runCIChecks as De}from"./ci-check/ci-check-service.js";import"./ci-check/index.js";import{ClaudeCodeAdapter as Oe,claudeCodeAdapter as ke}from"./agent-guide/adapters/claude-code.js";import{CursorCLIAdapter as Ae,cursorCLIAdapter as je}from"./agent-guide/adapters/cursor-cli.js";import{GenericMCPAdapter as Me,genericMCPAdapter as Ne}from"./agent-guide/adapters/generic-mcp.js";import{agentAdapters as Pe,getAgentAdapter as Fe,listAgentTypes as Ie}from"./agent-guide/adapters/index.js";import{AgentGuideService as Le,agentGuideService as Re,createAgentGuideService as ze}from"./agent-guide/agent-guide-service.js";import"./agent-guide/index.js";import{verifyStructure as Be}from"./verify/structure-verifier.js";import{verifyBehavior as Ve}from"./verify/behavior-verifier.js";import{createQuickAIReview as He,verifySemanticFields as Ue,verifyWithAI as We,verifyWithAIEnhanced as Ge}from"./verify/ai-verifier.js";import{VerifyService as Ke,createVerifyService as qe,verifyService as Je}from"./verify/verify-service.js";import"./verify/index.js";import"./implementation/index.js";
|