@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,185 +0,0 @@
|
|
|
1
|
-
import { isEmitDeclRef } from "../../libs/contracts/dist/spec.js";
|
|
2
|
-
|
|
3
|
-
//#region src/services/verify/behavior-verifier.ts
|
|
4
|
-
/**
|
|
5
|
-
* Check if a scenario is likely covered by the implementation.
|
|
6
|
-
*/
|
|
7
|
-
function checkScenarioCoverage(code, scenario) {
|
|
8
|
-
const keywords = [
|
|
9
|
-
...scenario.given,
|
|
10
|
-
...scenario.when,
|
|
11
|
-
...scenario.then
|
|
12
|
-
].flatMap((s) => s.toLowerCase().split(/\s+/).filter((w) => w.length > 3));
|
|
13
|
-
const codeLower = code.toLowerCase();
|
|
14
|
-
const foundKeywords = keywords.filter((kw) => codeLower.includes(kw));
|
|
15
|
-
const coverage = keywords.length > 0 ? foundKeywords.length / keywords.length : 0;
|
|
16
|
-
const scenarioNameLower = scenario.name.toLowerCase().replace(/\s+/g, "");
|
|
17
|
-
const hasTestForScenario = codeLower.includes(scenarioNameLower) || codeLower.includes(`test('${scenario.name.toLowerCase()}'`) || codeLower.includes(`it('${scenario.name.toLowerCase()}'`) || codeLower.includes(`describe('${scenario.name.toLowerCase()}'`);
|
|
18
|
-
const passed = coverage >= .3 || hasTestForScenario;
|
|
19
|
-
return {
|
|
20
|
-
name: scenario.name,
|
|
21
|
-
type: "scenario",
|
|
22
|
-
passed,
|
|
23
|
-
expected: `Given: ${scenario.given.join("; ")}; When: ${scenario.when.join("; ")}; Then: ${scenario.then.join("; ")}`,
|
|
24
|
-
details: passed ? void 0 : `Scenario keywords not found in implementation (${Math.round(coverage * 100)}% coverage)`
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Check if an example is likely handled.
|
|
29
|
-
*/
|
|
30
|
-
function checkExampleCoverage(code, example) {
|
|
31
|
-
const inputStr = JSON.stringify(example.input);
|
|
32
|
-
const outputStr = JSON.stringify(example.output);
|
|
33
|
-
const inputValues = extractStringValues(example.input);
|
|
34
|
-
const outputValues = extractStringValues(example.output);
|
|
35
|
-
const codeLower = code.toLowerCase();
|
|
36
|
-
const foundInputValues = inputValues.filter((v) => codeLower.includes(v.toLowerCase()));
|
|
37
|
-
const foundOutputValues = outputValues.filter((v) => codeLower.includes(v.toLowerCase()));
|
|
38
|
-
const avgCoverage = ((inputValues.length > 0 ? foundInputValues.length / inputValues.length : 1) + (outputValues.length > 0 ? foundOutputValues.length / outputValues.length : 1)) / 2;
|
|
39
|
-
const passed = avgCoverage >= .2;
|
|
40
|
-
return {
|
|
41
|
-
name: example.name,
|
|
42
|
-
type: "example",
|
|
43
|
-
passed,
|
|
44
|
-
expected: `Input: ${inputStr.slice(0, 100)}...; Output: ${outputStr.slice(0, 100)}...`,
|
|
45
|
-
details: passed ? void 0 : `Example values not found in implementation (${Math.round(avgCoverage * 100)}% coverage)`
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Extract string values from an object for comparison.
|
|
50
|
-
*/
|
|
51
|
-
function extractStringValues(obj) {
|
|
52
|
-
const values = [];
|
|
53
|
-
function extract(value) {
|
|
54
|
-
if (typeof value === "string" && value.length > 2) values.push(value);
|
|
55
|
-
else if (Array.isArray(value)) value.forEach(extract);
|
|
56
|
-
else if (value && typeof value === "object") Object.values(value).forEach(extract);
|
|
57
|
-
}
|
|
58
|
-
extract(obj);
|
|
59
|
-
return values;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Check if an error case is handled.
|
|
63
|
-
*/
|
|
64
|
-
function checkErrorCaseCoverage(code, errorCode, errorDef) {
|
|
65
|
-
const hasErrorCode = code.includes(errorCode);
|
|
66
|
-
const hasHttpStatus = errorDef.http ? code.includes(String(errorDef.http)) : true;
|
|
67
|
-
const whenKeywords = errorDef.when.toLowerCase().split(/\s+/).filter((w) => w.length > 3);
|
|
68
|
-
const codeLower = code.toLowerCase();
|
|
69
|
-
const foundWhenKeywords = whenKeywords.filter((kw) => codeLower.includes(kw));
|
|
70
|
-
const whenCoverage = whenKeywords.length > 0 ? foundWhenKeywords.length / whenKeywords.length : 1;
|
|
71
|
-
const passed = hasErrorCode && (hasHttpStatus || whenCoverage >= .3);
|
|
72
|
-
return {
|
|
73
|
-
name: `Error: ${errorCode}`,
|
|
74
|
-
type: "error",
|
|
75
|
-
passed,
|
|
76
|
-
expected: `When: ${errorDef.when}; Return: ${errorCode} (HTTP ${errorDef.http ?? 400})`,
|
|
77
|
-
details: passed ? void 0 : !hasErrorCode ? `Error code '${errorCode}' not found in implementation` : `Error condition not properly implemented`
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Check if events are emitted in the right conditions.
|
|
82
|
-
*/
|
|
83
|
-
function checkEventConditions(code, spec) {
|
|
84
|
-
const events = spec.sideEffects?.emits ?? [];
|
|
85
|
-
const checks = [];
|
|
86
|
-
for (const event of events) {
|
|
87
|
-
const eventName = isEmitDeclRef(event) ? event.ref.name : event.name;
|
|
88
|
-
const when = event.when;
|
|
89
|
-
const whenKeywords = when.toLowerCase().split(/\s+/).filter((w) => w.length > 3);
|
|
90
|
-
const codeLower = code.toLowerCase();
|
|
91
|
-
const hasEvent = codeLower.includes(eventName.toLowerCase());
|
|
92
|
-
const foundKeywords = whenKeywords.filter((kw) => codeLower.includes(kw));
|
|
93
|
-
const conditionCoverage = whenKeywords.length > 0 ? foundKeywords.length / whenKeywords.length : 1;
|
|
94
|
-
checks.push({
|
|
95
|
-
name: `Event: ${eventName}`,
|
|
96
|
-
type: "scenario",
|
|
97
|
-
passed: hasEvent && conditionCoverage >= .3,
|
|
98
|
-
expected: `Emit ${eventName} when: ${when}`,
|
|
99
|
-
details: !hasEvent ? `Event '${eventName}' not found` : conditionCoverage < .3 ? `Event condition not properly implemented` : void 0
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return checks;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Check if idempotency is properly handled.
|
|
106
|
-
*/
|
|
107
|
-
function checkIdempotency(code, spec) {
|
|
108
|
-
if (spec.policy.idempotent === void 0) return null;
|
|
109
|
-
if (!spec.policy.idempotent) return null;
|
|
110
|
-
const idempotentPatterns = [
|
|
111
|
-
"idempotency",
|
|
112
|
-
"idempotent",
|
|
113
|
-
"already exists",
|
|
114
|
-
"upsert",
|
|
115
|
-
"on conflict",
|
|
116
|
-
"if not exists",
|
|
117
|
-
"dedupe",
|
|
118
|
-
"duplicate"
|
|
119
|
-
];
|
|
120
|
-
const codeLower = code.toLowerCase();
|
|
121
|
-
const hasIdempotentPattern = idempotentPatterns.some((p) => codeLower.includes(p));
|
|
122
|
-
return {
|
|
123
|
-
name: "Idempotency",
|
|
124
|
-
type: "scenario",
|
|
125
|
-
passed: hasIdempotentPattern,
|
|
126
|
-
expected: "Operation should be idempotent (safe to retry)",
|
|
127
|
-
details: hasIdempotentPattern ? void 0 : "No idempotency pattern found for idempotent operation"
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Run all behavior checks and produce a verification report.
|
|
132
|
-
*/
|
|
133
|
-
function verifyBehavior(input) {
|
|
134
|
-
const { spec, implementationCode, implementationPath } = input;
|
|
135
|
-
const startTime = Date.now();
|
|
136
|
-
const checks = [];
|
|
137
|
-
for (const scenario of spec.acceptance?.scenarios ?? []) checks.push(checkScenarioCoverage(implementationCode, scenario));
|
|
138
|
-
for (const example of spec.acceptance?.examples ?? []) checks.push(checkExampleCoverage(implementationCode, example));
|
|
139
|
-
for (const [code, errorDef] of Object.entries(spec.io.errors ?? {})) checks.push(checkErrorCaseCoverage(implementationCode, code, errorDef));
|
|
140
|
-
checks.push(...checkEventConditions(implementationCode, spec));
|
|
141
|
-
const idempotencyCheck = checkIdempotency(implementationCode, spec);
|
|
142
|
-
if (idempotencyCheck) checks.push(idempotencyCheck);
|
|
143
|
-
const issues = checks.filter((c) => !c.passed).map((c) => ({
|
|
144
|
-
severity: c.type === "error" ? "error" : "warning",
|
|
145
|
-
category: c.type === "scenario" ? "scenario" : c.type === "example" ? "scenario" : "error_handling",
|
|
146
|
-
message: c.details ?? `${c.type} not covered: ${c.name}`,
|
|
147
|
-
location: implementationPath ? { file: implementationPath } : void 0,
|
|
148
|
-
suggestion: c.expected ? `Expected: ${c.expected}` : void 0
|
|
149
|
-
}));
|
|
150
|
-
const scenarioChecks = checks.filter((c) => c.type === "scenario");
|
|
151
|
-
const errorChecks = checks.filter((c) => c.type === "error");
|
|
152
|
-
const passedCount = checks.filter((c) => c.passed).length;
|
|
153
|
-
const score = checks.length > 0 ? Math.round(passedCount / checks.length * 100) : 100;
|
|
154
|
-
return {
|
|
155
|
-
tier: "behavior",
|
|
156
|
-
passed: issues.filter((i) => i.severity === "error").length === 0,
|
|
157
|
-
score,
|
|
158
|
-
issues,
|
|
159
|
-
suggestions: checks.filter((c) => !c.passed && c.expected).map((c) => `${c.name}: ${c.expected}`),
|
|
160
|
-
coverage: {
|
|
161
|
-
scenarios: {
|
|
162
|
-
total: scenarioChecks.length,
|
|
163
|
-
covered: scenarioChecks.filter((c) => c.passed).length
|
|
164
|
-
},
|
|
165
|
-
errors: {
|
|
166
|
-
total: errorChecks.length,
|
|
167
|
-
handled: errorChecks.filter((c) => c.passed).length
|
|
168
|
-
},
|
|
169
|
-
fields: {
|
|
170
|
-
total: checks.length,
|
|
171
|
-
implemented: passedCount
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
meta: {
|
|
175
|
-
specName: spec.meta.name,
|
|
176
|
-
specVersion: spec.meta.version,
|
|
177
|
-
implementationPath: implementationPath ?? "unknown",
|
|
178
|
-
verifiedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
179
|
-
duration: Date.now() - startTime
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
//#endregion
|
|
185
|
-
export { verifyBehavior };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { verifyStructure } from "./structure-verifier.js";
|
|
2
|
-
import { verifyBehavior } from "./behavior-verifier.js";
|
|
3
|
-
import { createQuickAIReview, verifySemanticFields, verifyWithAI, verifyWithAIEnhanced } from "./ai-verifier.js";
|
|
4
|
-
import { VerifyService, createVerifyService, verifyService } from "./verify-service.js";
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { isEmitDeclRef } from "../../libs/contracts/dist/spec.js";
|
|
2
|
-
|
|
3
|
-
//#region src/services/verify/structure-verifier.ts
|
|
4
|
-
/**
|
|
5
|
-
* Check if code exports a handler function.
|
|
6
|
-
*/
|
|
7
|
-
function checkHandlerExport(code) {
|
|
8
|
-
const hasExport = /export\s+(async\s+)?function\s+\w+/.test(code) || /export\s+const\s+\w+\s*=\s*(async\s*)?\(/.test(code) || /export\s+default\s+(async\s+)?function/.test(code) || /export\s+\{\s*\w+/.test(code);
|
|
9
|
-
return {
|
|
10
|
-
name: "handler_export",
|
|
11
|
-
passed: hasExport,
|
|
12
|
-
details: hasExport ? void 0 : "No exported handler function found",
|
|
13
|
-
suggestion: "Export a function that handles the operation: export async function handle(...) { }"
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Check if code imports from @lssm/lib.contracts.
|
|
18
|
-
*/
|
|
19
|
-
function checkContractsImport(code) {
|
|
20
|
-
const hasImport = code.includes("from '@lssm/lib.contracts'") || code.includes("from \"@lssm/lib.contracts\"");
|
|
21
|
-
return {
|
|
22
|
-
name: "contracts_import",
|
|
23
|
-
passed: hasImport,
|
|
24
|
-
details: hasImport ? void 0 : "Missing import from @lssm/lib.contracts",
|
|
25
|
-
suggestion: "Add: import { ... } from '@lssm/lib.contracts';"
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Check if code imports from @lssm/lib.schema.
|
|
30
|
-
*/
|
|
31
|
-
function checkSchemaImport(code, spec) {
|
|
32
|
-
if (!(spec.io.input !== null || spec.io.output !== null)) return {
|
|
33
|
-
name: "schema_import",
|
|
34
|
-
passed: true
|
|
35
|
-
};
|
|
36
|
-
const hasImport = code.includes("from '@lssm/lib.schema'") || code.includes("from \"@lssm/lib.schema\"");
|
|
37
|
-
return {
|
|
38
|
-
name: "schema_import",
|
|
39
|
-
passed: hasImport,
|
|
40
|
-
details: hasImport ? void 0 : "Missing import from @lssm/lib.schema",
|
|
41
|
-
suggestion: "Add: import { ... } from '@lssm/lib.schema';"
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Check for TypeScript any usage.
|
|
46
|
-
*/
|
|
47
|
-
function checkNoAnyType(code) {
|
|
48
|
-
const anyPattern = /:\s*any\b|as\s+any\b|<any>/;
|
|
49
|
-
const lines = code.split("\n");
|
|
50
|
-
const anyUsages = [];
|
|
51
|
-
for (let i = 0; i < lines.length; i++) {
|
|
52
|
-
const line = lines[i] ?? "";
|
|
53
|
-
if (line.trim().startsWith("//") || line.trim().startsWith("*")) continue;
|
|
54
|
-
if (anyPattern.test(line)) anyUsages.push(i + 1);
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
name: "no_any_type",
|
|
58
|
-
passed: anyUsages.length === 0,
|
|
59
|
-
details: anyUsages.length > 0 ? `Found 'any' type on lines: ${anyUsages.slice(0, 5).join(", ")}${anyUsages.length > 5 ? "..." : ""}` : void 0,
|
|
60
|
-
suggestion: "Replace any with proper types from the spec schema"
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Check if error codes from spec are handled.
|
|
65
|
-
*/
|
|
66
|
-
function checkErrorHandling(code, spec) {
|
|
67
|
-
const errors = spec.io.errors;
|
|
68
|
-
if (!errors || Object.keys(errors).length === 0) return {
|
|
69
|
-
name: "error_handling",
|
|
70
|
-
passed: true
|
|
71
|
-
};
|
|
72
|
-
const errorCodes = Object.keys(errors);
|
|
73
|
-
const missingErrors = [];
|
|
74
|
-
for (const errorCode of errorCodes) if (!code.includes(errorCode)) missingErrors.push(errorCode);
|
|
75
|
-
return {
|
|
76
|
-
name: "error_handling",
|
|
77
|
-
passed: missingErrors.length === 0,
|
|
78
|
-
details: missingErrors.length > 0 ? `Missing error handling for: ${missingErrors.join(", ")}` : void 0,
|
|
79
|
-
suggestion: "Implement handlers for all error cases defined in the spec"
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Check if events are emitted.
|
|
84
|
-
*/
|
|
85
|
-
function checkEventEmission(code, spec) {
|
|
86
|
-
const events = spec.sideEffects?.emits;
|
|
87
|
-
if (!events || events.length === 0) return {
|
|
88
|
-
name: "event_emission",
|
|
89
|
-
passed: true
|
|
90
|
-
};
|
|
91
|
-
const hasEmitPattern = code.includes("emit(") || code.includes(".emit(") || code.includes("publish(") || code.includes(".publish(") || code.includes("dispatchEvent") || code.includes("eventBus");
|
|
92
|
-
const eventNames = events.map((e) => {
|
|
93
|
-
if (isEmitDeclRef(e)) return e.ref.name;
|
|
94
|
-
return e.name;
|
|
95
|
-
});
|
|
96
|
-
const mentionedEvents = eventNames.filter((name) => code.includes(name));
|
|
97
|
-
return {
|
|
98
|
-
name: "event_emission",
|
|
99
|
-
passed: hasEmitPattern && mentionedEvents.length > 0,
|
|
100
|
-
details: !hasEmitPattern ? "No event emission pattern found" : mentionedEvents.length === 0 ? `Events not referenced: ${eventNames.join(", ")}` : void 0,
|
|
101
|
-
suggestion: "Emit events as specified in sideEffects.emits"
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Check for validation of input.
|
|
106
|
-
*/
|
|
107
|
-
function checkInputValidation(code, spec) {
|
|
108
|
-
if (!spec.io.input) return {
|
|
109
|
-
name: "input_validation",
|
|
110
|
-
passed: true
|
|
111
|
-
};
|
|
112
|
-
const hasValidation = code.includes(".parse(") || code.includes(".safeParse(") || code.includes("validate(") || code.includes(".validate(") || code.includes("schema.") || code.includes("zodSchema") || code.includes(".getZod()");
|
|
113
|
-
return {
|
|
114
|
-
name: "input_validation",
|
|
115
|
-
passed: hasValidation,
|
|
116
|
-
details: hasValidation ? void 0 : "No input validation pattern found",
|
|
117
|
-
suggestion: "Validate input using the schema: schema.parse(input) or schema.safeParse(input)"
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Check for async/await usage on async operations.
|
|
122
|
-
*/
|
|
123
|
-
function checkAsyncPatterns(code, spec) {
|
|
124
|
-
const isAsync = /export\s+(const\s+\w+\s*=\s*)?async/.test(code) || /async\s+function/.test(code);
|
|
125
|
-
if (!(spec.meta.kind === "command")) return {
|
|
126
|
-
name: "async_patterns",
|
|
127
|
-
passed: true
|
|
128
|
-
};
|
|
129
|
-
return {
|
|
130
|
-
name: "async_patterns",
|
|
131
|
-
passed: isAsync,
|
|
132
|
-
details: isAsync ? void 0 : "Handler should be async for command operations",
|
|
133
|
-
suggestion: "Make the handler function async: export async function handle(...)"
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Run all structure checks and produce a verification report.
|
|
138
|
-
*/
|
|
139
|
-
function verifyStructure(input) {
|
|
140
|
-
const { spec, implementationCode, implementationPath } = input;
|
|
141
|
-
const startTime = Date.now();
|
|
142
|
-
const checks = [
|
|
143
|
-
checkHandlerExport(implementationCode),
|
|
144
|
-
checkContractsImport(implementationCode),
|
|
145
|
-
checkSchemaImport(implementationCode, spec),
|
|
146
|
-
checkNoAnyType(implementationCode),
|
|
147
|
-
checkErrorHandling(implementationCode, spec),
|
|
148
|
-
checkEventEmission(implementationCode, spec),
|
|
149
|
-
checkInputValidation(implementationCode, spec),
|
|
150
|
-
checkAsyncPatterns(implementationCode, spec)
|
|
151
|
-
];
|
|
152
|
-
const issues = checks.filter((c) => !c.passed).map((c) => ({
|
|
153
|
-
severity: c.name === "no_any_type" ? "warning" : "error",
|
|
154
|
-
category: c.name.includes("import") ? "import" : c.name.includes("export") ? "export" : "type",
|
|
155
|
-
message: c.details ?? `Check failed: ${c.name}`,
|
|
156
|
-
location: implementationPath ? { file: implementationPath } : void 0,
|
|
157
|
-
suggestion: c.suggestion
|
|
158
|
-
}));
|
|
159
|
-
const passedCount = checks.filter((c) => c.passed).length;
|
|
160
|
-
const score = Math.round(passedCount / checks.length * 100);
|
|
161
|
-
const passed = issues.filter((i) => i.severity === "error").length === 0;
|
|
162
|
-
const suggestions = checks.filter((c) => !c.passed && c.suggestion).map((c) => c.suggestion);
|
|
163
|
-
const errorCount = Object.keys(spec.io.errors ?? {}).length;
|
|
164
|
-
return {
|
|
165
|
-
tier: "structure",
|
|
166
|
-
passed,
|
|
167
|
-
score,
|
|
168
|
-
issues,
|
|
169
|
-
suggestions,
|
|
170
|
-
coverage: {
|
|
171
|
-
scenarios: {
|
|
172
|
-
total: 0,
|
|
173
|
-
covered: 0
|
|
174
|
-
},
|
|
175
|
-
errors: {
|
|
176
|
-
total: errorCount,
|
|
177
|
-
handled: checks.find((c) => c.name === "error_handling")?.passed ? errorCount : 0
|
|
178
|
-
},
|
|
179
|
-
fields: {
|
|
180
|
-
total: checks.length,
|
|
181
|
-
implemented: passedCount
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
meta: {
|
|
185
|
-
specName: spec.meta.name,
|
|
186
|
-
specVersion: spec.meta.version,
|
|
187
|
-
implementationPath: implementationPath ?? "unknown",
|
|
188
|
-
verifiedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
189
|
-
duration: Date.now() - startTime
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
//#endregion
|
|
195
|
-
export { verifyStructure };
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { verifyStructure } from "./structure-verifier.js";
|
|
2
|
-
import { verifyBehavior } from "./behavior-verifier.js";
|
|
3
|
-
import { createQuickAIReview, verifyWithAI } from "./ai-verifier.js";
|
|
4
|
-
|
|
5
|
-
//#region src/services/verify/verify-service.ts
|
|
6
|
-
const DEFAULT_CONFIG = { verbose: false };
|
|
7
|
-
const TIER_ORDER = [
|
|
8
|
-
"structure",
|
|
9
|
-
"behavior",
|
|
10
|
-
"ai_review"
|
|
11
|
-
];
|
|
12
|
-
/**
|
|
13
|
-
* Verification Service
|
|
14
|
-
*
|
|
15
|
-
* Main service for verifying implementations against specs.
|
|
16
|
-
*/
|
|
17
|
-
var VerifyService = class {
|
|
18
|
-
config;
|
|
19
|
-
constructor(config = {}) {
|
|
20
|
-
this.config = {
|
|
21
|
-
...DEFAULT_CONFIG,
|
|
22
|
-
...config
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Run verification on an implementation.
|
|
27
|
-
*/
|
|
28
|
-
async verify(spec, implementationCode, options = {}) {
|
|
29
|
-
const startTime = Date.now();
|
|
30
|
-
const reports = /* @__PURE__ */ new Map();
|
|
31
|
-
const allIssues = [];
|
|
32
|
-
const input = {
|
|
33
|
-
spec,
|
|
34
|
-
implementationCode
|
|
35
|
-
};
|
|
36
|
-
const tiersToRun = options.tiers ?? ["structure", "behavior"];
|
|
37
|
-
for (const tier of TIER_ORDER) {
|
|
38
|
-
if (!tiersToRun.includes(tier)) continue;
|
|
39
|
-
let report;
|
|
40
|
-
switch (tier) {
|
|
41
|
-
case "structure":
|
|
42
|
-
report = verifyStructure(input);
|
|
43
|
-
break;
|
|
44
|
-
case "behavior":
|
|
45
|
-
report = verifyBehavior(input);
|
|
46
|
-
break;
|
|
47
|
-
case "ai_review":
|
|
48
|
-
if (this.config.aiApiKey) report = await verifyWithAI(input, this.config);
|
|
49
|
-
else report = createQuickAIReview(input);
|
|
50
|
-
break;
|
|
51
|
-
default: continue;
|
|
52
|
-
}
|
|
53
|
-
reports.set(tier, report);
|
|
54
|
-
allIssues.push(...report.issues);
|
|
55
|
-
if (options.failFast && !report.passed) break;
|
|
56
|
-
}
|
|
57
|
-
const reportsArray = Array.from(reports.values());
|
|
58
|
-
return {
|
|
59
|
-
passed: reportsArray.every((r) => r.passed),
|
|
60
|
-
score: reportsArray.length > 0 ? Math.round(reportsArray.reduce((sum, r) => sum + r.score, 0) / reportsArray.length) : 100,
|
|
61
|
-
reports,
|
|
62
|
-
allIssues,
|
|
63
|
-
summary: this.generateSummary(reportsArray, allIssues),
|
|
64
|
-
duration: Date.now() - startTime
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Run only structure verification (Tier 1).
|
|
69
|
-
*/
|
|
70
|
-
verifyStructure(spec, implementationCode, implementationPath) {
|
|
71
|
-
return verifyStructure({
|
|
72
|
-
spec,
|
|
73
|
-
implementationCode,
|
|
74
|
-
implementationPath
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Run only behavior verification (Tier 2).
|
|
79
|
-
*/
|
|
80
|
-
verifyBehavior(spec, implementationCode, implementationPath) {
|
|
81
|
-
return verifyBehavior({
|
|
82
|
-
spec,
|
|
83
|
-
implementationCode,
|
|
84
|
-
implementationPath
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Run only AI verification (Tier 3).
|
|
89
|
-
*/
|
|
90
|
-
async verifyAI(spec, implementationCode, implementationPath) {
|
|
91
|
-
const input = {
|
|
92
|
-
spec,
|
|
93
|
-
implementationCode,
|
|
94
|
-
implementationPath
|
|
95
|
-
};
|
|
96
|
-
if (this.config.aiApiKey) return verifyWithAI(input, this.config);
|
|
97
|
-
return createQuickAIReview(input);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Quick verification (structure only, fast).
|
|
101
|
-
*/
|
|
102
|
-
quickVerify(spec, implementationCode) {
|
|
103
|
-
return verifyStructure({
|
|
104
|
-
spec,
|
|
105
|
-
implementationCode
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Generate a human-readable summary of verification results.
|
|
110
|
-
*/
|
|
111
|
-
generateSummary(reports, allIssues) {
|
|
112
|
-
const parts = [];
|
|
113
|
-
const passed = reports.every((r) => r.passed);
|
|
114
|
-
const avgScore = reports.length > 0 ? Math.round(reports.reduce((sum, r) => sum + r.score, 0) / reports.length) : 100;
|
|
115
|
-
parts.push(passed ? "✓ Verification passed" : "✗ Verification failed");
|
|
116
|
-
parts.push(`Score: ${avgScore}/100`);
|
|
117
|
-
parts.push("");
|
|
118
|
-
for (const report of reports) {
|
|
119
|
-
const icon = report.passed ? "✓" : "✗";
|
|
120
|
-
parts.push(`${icon} ${report.tier}: ${report.score}/100`);
|
|
121
|
-
}
|
|
122
|
-
parts.push("");
|
|
123
|
-
const errors = allIssues.filter((i) => i.severity === "error");
|
|
124
|
-
const warnings = allIssues.filter((i) => i.severity === "warning");
|
|
125
|
-
const infos = allIssues.filter((i) => i.severity === "info");
|
|
126
|
-
if (errors.length > 0) parts.push(`Errors: ${errors.length}`);
|
|
127
|
-
if (warnings.length > 0) parts.push(`Warnings: ${warnings.length}`);
|
|
128
|
-
if (infos.length > 0) parts.push(`Info: ${infos.length}`);
|
|
129
|
-
return parts.join("\n");
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Format verification result as markdown.
|
|
133
|
-
*/
|
|
134
|
-
formatAsMarkdown(result) {
|
|
135
|
-
const lines = [];
|
|
136
|
-
lines.push(`# Verification Report`);
|
|
137
|
-
lines.push("");
|
|
138
|
-
lines.push(`**Status:** ${result.passed ? "✓ Passed" : "✗ Failed"}`);
|
|
139
|
-
lines.push(`**Score:** ${result.score}/100`);
|
|
140
|
-
lines.push(`**Duration:** ${result.duration}ms`);
|
|
141
|
-
lines.push("");
|
|
142
|
-
for (const [tier, report] of result.reports) {
|
|
143
|
-
lines.push(`## ${this.formatTierName(tier)}`);
|
|
144
|
-
lines.push("");
|
|
145
|
-
lines.push(`**Status:** ${report.passed ? "✓ Passed" : "✗ Failed"}`);
|
|
146
|
-
lines.push(`**Score:** ${report.score}/100`);
|
|
147
|
-
lines.push("");
|
|
148
|
-
if (report.issues.length > 0) {
|
|
149
|
-
lines.push("### Issues");
|
|
150
|
-
lines.push("");
|
|
151
|
-
for (const issue of report.issues) {
|
|
152
|
-
const icon = issue.severity === "error" ? "❌" : issue.severity === "warning" ? "⚠️" : "ℹ️";
|
|
153
|
-
lines.push(`${icon} **${issue.category}**: ${issue.message}`);
|
|
154
|
-
if (issue.suggestion) lines.push(` - Suggestion: ${issue.suggestion}`);
|
|
155
|
-
}
|
|
156
|
-
lines.push("");
|
|
157
|
-
}
|
|
158
|
-
if (report.coverage.scenarios.total > 0) lines.push(`**Scenarios:** ${report.coverage.scenarios.covered}/${report.coverage.scenarios.total}`);
|
|
159
|
-
if (report.coverage.errors.total > 0) lines.push(`**Errors handled:** ${report.coverage.errors.handled}/${report.coverage.errors.total}`);
|
|
160
|
-
lines.push("");
|
|
161
|
-
}
|
|
162
|
-
const allSuggestions = Array.from(result.reports.values()).flatMap((r) => r.suggestions);
|
|
163
|
-
if (allSuggestions.length > 0) {
|
|
164
|
-
lines.push("## Suggestions");
|
|
165
|
-
lines.push("");
|
|
166
|
-
for (const suggestion of allSuggestions.slice(0, 10)) lines.push(`- ${suggestion}`);
|
|
167
|
-
if (allSuggestions.length > 10) lines.push(`- ... and ${allSuggestions.length - 10} more`);
|
|
168
|
-
lines.push("");
|
|
169
|
-
}
|
|
170
|
-
return lines.join("\n");
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Format tier name for display.
|
|
174
|
-
*/
|
|
175
|
-
formatTierName(tier) {
|
|
176
|
-
switch (tier) {
|
|
177
|
-
case "structure": return "Tier 1: Structure";
|
|
178
|
-
case "behavior": return "Tier 2: Behavior";
|
|
179
|
-
case "ai_review": return "Tier 3: AI Review";
|
|
180
|
-
default: return tier;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Update configuration.
|
|
185
|
-
*/
|
|
186
|
-
configure(config) {
|
|
187
|
-
this.config = {
|
|
188
|
-
...this.config,
|
|
189
|
-
...config
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Create a new VerifyService instance.
|
|
195
|
-
*/
|
|
196
|
-
function createVerifyService(config) {
|
|
197
|
-
return new VerifyService(config);
|
|
198
|
-
}
|
|
199
|
-
/** Default singleton instance */
|
|
200
|
-
const verifyService = new VerifyService();
|
|
201
|
-
|
|
202
|
-
//#endregion
|
|
203
|
-
export { VerifyService, createVerifyService, verifyService };
|
package/dist/services/watch.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { validateSpec } from "./validate.js";
|
|
2
|
-
import { buildSpec } from "./build.js";
|
|
3
|
-
|
|
4
|
-
//#region src/services/watch.ts
|
|
5
|
-
function watchSpecs(adapters, config, options, overrides) {
|
|
6
|
-
const { watcher, fs, logger } = adapters;
|
|
7
|
-
const w = watcher.watch(options);
|
|
8
|
-
const validateFn = overrides?.validate ?? (async (specPath) => {
|
|
9
|
-
await validateSpec(specPath, {
|
|
10
|
-
fs,
|
|
11
|
-
logger
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
const buildFn = overrides?.build ?? (async (specPath) => {
|
|
15
|
-
await buildSpec(specPath, {
|
|
16
|
-
fs,
|
|
17
|
-
logger
|
|
18
|
-
}, config);
|
|
19
|
-
});
|
|
20
|
-
w.on(async (event) => {
|
|
21
|
-
if (event.type !== "change") return;
|
|
22
|
-
logger.info("watchSpecs.changed", { path: event.path });
|
|
23
|
-
if (options.runValidate) await validateFn(event.path);
|
|
24
|
-
if (options.runBuild) if (options.dryRun) logger.info("[dry-run] watchSpecs skipped build", { path: event.path });
|
|
25
|
-
else await buildFn(event.path);
|
|
26
|
-
});
|
|
27
|
-
return w;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
export { watchSpecs };
|