@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217080011 → 0.0.0-canary-20251219202229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/adapters/ai.d.ts +7 -8
- package/dist/adapters/ai.d.ts.map +1 -0
- package/dist/adapters/factory.d.ts +20 -21
- package/dist/adapters/factory.d.ts.map +1 -0
- package/dist/adapters/fs.d.ts +6 -7
- package/dist/adapters/fs.d.ts.map +1 -0
- package/dist/adapters/git.d.ts +6 -7
- package/dist/adapters/git.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +11 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/logger.d.ts +9 -8
- package/dist/adapters/logger.d.ts.map +1 -0
- package/dist/adapters/watcher.d.ts +6 -7
- package/dist/adapters/watcher.d.ts.map +1 -0
- package/dist/adapters/workspace.d.ts +37 -39
- package/dist/adapters/workspace.d.ts.map +1 -0
- package/dist/ai/agents/claude-code-agent.d.ts +20 -20
- package/dist/ai/agents/claude-code-agent.d.ts.map +1 -0
- package/dist/ai/agents/cursor-agent.d.ts +66 -66
- package/dist/ai/agents/cursor-agent.d.ts.map +1 -0
- package/dist/ai/agents/index.d.ts +10 -0
- package/dist/ai/agents/index.d.ts.map +1 -0
- package/dist/ai/agents/openai-codex-agent.d.ts +20 -20
- package/dist/ai/agents/openai-codex-agent.d.ts.map +1 -0
- package/dist/ai/agents/orchestrator.d.ts +48 -48
- package/dist/ai/agents/orchestrator.d.ts.map +1 -0
- package/dist/ai/agents/simple-agent.d.ts +15 -15
- package/dist/ai/agents/simple-agent.d.ts.map +1 -0
- package/dist/ai/agents/types.d.ts +26 -28
- package/dist/ai/agents/types.d.ts.map +1 -0
- package/dist/ai/client.d.ts +74 -78
- package/dist/ai/client.d.ts.map +1 -0
- package/dist/ai/index.d.ts +8 -16
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/prompts/code-generation.d.ts +6 -10
- package/dist/ai/prompts/code-generation.d.ts.map +1 -0
- package/dist/ai/prompts/index.d.ts +6 -9
- package/dist/ai/prompts/index.d.ts.map +1 -0
- package/dist/ai/prompts/spec-creation.d.ts +7 -13
- package/dist/ai/prompts/spec-creation.d.ts.map +1 -0
- package/dist/ai/providers.d.ts +13 -12
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/formatters/index.d.ts +7 -10
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/json.d.ts +65 -63
- package/dist/formatters/json.d.ts.map +1 -0
- package/dist/formatters/sarif.d.ts +77 -72
- package/dist/formatters/sarif.d.ts.map +1 -0
- package/dist/formatters/text.d.ts +21 -19
- package/dist/formatters/text.d.ts.map +1 -0
- package/dist/index.d.ts +14 -66
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4531 -81
- package/dist/ports/ai.d.ts +41 -38
- package/dist/ports/ai.d.ts.map +1 -0
- package/dist/ports/fs.d.ts +63 -65
- package/dist/ports/fs.d.ts.map +1 -0
- package/dist/ports/git.d.ts +19 -21
- package/dist/ports/git.d.ts.map +1 -0
- package/dist/ports/index.d.ts +10 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/logger.d.ts +58 -65
- package/dist/ports/logger.d.ts.map +1 -0
- package/dist/ports/watcher.d.ts +24 -26
- package/dist/ports/watcher.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/claude-code.d.ts +30 -28
- package/dist/services/agent-guide/adapters/claude-code.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts +34 -32
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts +47 -45
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts.map +1 -0
- package/dist/services/agent-guide/adapters/index.d.ts +15 -13
- package/dist/services/agent-guide/adapters/index.d.ts.map +1 -0
- package/dist/services/agent-guide/agent-guide-service.d.ts +48 -45
- package/dist/services/agent-guide/agent-guide-service.d.ts.map +1 -0
- package/dist/services/agent-guide/index.d.ts +12 -0
- package/dist/services/agent-guide/index.d.ts.map +1 -0
- package/dist/services/agent-guide/types.d.ts +46 -47
- package/dist/services/agent-guide/types.d.ts.map +1 -0
- package/dist/services/build.d.ts +41 -39
- package/dist/services/build.d.ts.map +1 -0
- package/dist/services/ci-check/ci-check-service.d.ts +13 -11
- package/dist/services/ci-check/ci-check-service.d.ts.map +1 -0
- package/dist/services/ci-check/index.d.ts +6 -0
- package/dist/services/ci-check/index.d.ts.map +1 -0
- package/dist/services/ci-check/types.d.ts +100 -102
- package/dist/services/ci-check/types.d.ts.map +1 -0
- package/dist/services/clean.d.ts +38 -37
- package/dist/services/clean.d.ts.map +1 -0
- package/dist/services/config.d.ts +14 -15
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/deps.d.ts +29 -30
- package/dist/services/deps.d.ts.map +1 -0
- package/dist/services/diff.d.ts +20 -21
- package/dist/services/diff.d.ts.map +1 -0
- package/dist/services/doctor/checks/ai.d.ts +10 -0
- package/dist/services/doctor/checks/ai.d.ts.map +1 -0
- package/dist/services/doctor/checks/cli.d.ts +10 -0
- package/dist/services/doctor/checks/cli.d.ts.map +1 -0
- package/dist/services/doctor/checks/config.d.ts +10 -0
- package/dist/services/doctor/checks/config.d.ts.map +1 -0
- package/dist/services/doctor/checks/deps.d.ts +10 -0
- package/dist/services/doctor/checks/deps.d.ts.map +1 -0
- package/dist/services/doctor/checks/index.d.ts +10 -0
- package/dist/services/doctor/checks/index.d.ts.map +1 -0
- package/dist/services/doctor/checks/mcp.d.ts +10 -0
- package/dist/services/doctor/checks/mcp.d.ts.map +1 -0
- package/dist/services/doctor/checks/workspace.d.ts +12 -0
- package/dist/services/doctor/checks/workspace.d.ts.map +1 -0
- package/dist/services/doctor/doctor-service.d.ts +14 -13
- package/dist/services/doctor/doctor-service.d.ts.map +1 -0
- package/dist/services/doctor/index.d.ts +8 -0
- package/dist/services/doctor/index.d.ts.map +1 -0
- package/dist/services/doctor/types.d.ts +70 -72
- package/dist/services/doctor/types.d.ts.map +1 -0
- package/dist/services/implementation/discovery.d.ts +16 -14
- package/dist/services/implementation/discovery.d.ts.map +1 -0
- package/dist/services/implementation/index.d.ts +7 -0
- package/dist/services/implementation/index.d.ts.map +1 -0
- package/dist/services/implementation/resolver.d.ts +31 -27
- package/dist/services/implementation/resolver.d.ts.map +1 -0
- package/dist/services/implementation/types.d.ts +55 -56
- package/dist/services/implementation/types.d.ts.map +1 -0
- package/dist/services/index.d.ts +28 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/integrity-diagram.d.ts +29 -25
- package/dist/services/integrity-diagram.d.ts.map +1 -0
- package/dist/services/integrity.d.ts +100 -96
- package/dist/services/integrity.d.ts.map +1 -0
- package/dist/services/list.d.ts +18 -19
- package/dist/services/list.d.ts.map +1 -0
- package/dist/services/openapi/export-service.d.ts +39 -40
- package/dist/services/openapi/export-service.d.ts.map +1 -0
- package/dist/services/openapi/import-service.d.ts +10 -11
- package/dist/services/openapi/import-service.d.ts.map +1 -0
- package/dist/services/openapi/index.d.ts +10 -0
- package/dist/services/openapi/index.d.ts.map +1 -0
- package/dist/services/openapi/sync-service.d.ts +12 -13
- package/dist/services/openapi/sync-service.d.ts.map +1 -0
- package/dist/services/openapi/types.d.ts +141 -143
- package/dist/services/openapi/types.d.ts.map +1 -0
- package/dist/services/openapi/validate-service.d.ts +10 -11
- package/dist/services/openapi/validate-service.d.ts.map +1 -0
- package/dist/services/regenerator.d.ts +18 -16
- package/dist/services/regenerator.d.ts.map +1 -0
- package/dist/services/registry.d.ts +25 -26
- package/dist/services/registry.d.ts.map +1 -0
- package/dist/services/setup/config-generators.d.ts +14 -13
- package/dist/services/setup/config-generators.d.ts.map +1 -0
- package/dist/services/setup/file-merger.d.ts +5 -7
- package/dist/services/setup/file-merger.d.ts.map +1 -0
- package/dist/services/setup/index.d.ts +10 -0
- package/dist/services/setup/index.d.ts.map +1 -0
- package/dist/services/setup/setup-service.d.ts +10 -8
- package/dist/services/setup/setup-service.d.ts.map +1 -0
- package/dist/services/setup/targets/agents-md.d.ts +12 -0
- package/dist/services/setup/targets/agents-md.d.ts.map +1 -0
- package/dist/services/setup/targets/cli-config.d.ts +12 -0
- package/dist/services/setup/targets/cli-config.d.ts.map +1 -0
- package/dist/services/setup/targets/cursor-rules.d.ts +10 -0
- package/dist/services/setup/targets/cursor-rules.d.ts.map +1 -0
- package/dist/services/setup/targets/index.d.ts +10 -0
- package/dist/services/setup/targets/index.d.ts.map +1 -0
- package/dist/services/setup/targets/mcp-claude.d.ts +11 -0
- package/dist/services/setup/targets/mcp-claude.d.ts.map +1 -0
- package/dist/services/setup/targets/mcp-cursor.d.ts +10 -0
- package/dist/services/setup/targets/mcp-cursor.d.ts.map +1 -0
- package/dist/services/setup/targets/vscode-settings.d.ts +13 -0
- package/dist/services/setup/targets/vscode-settings.d.ts.map +1 -0
- package/dist/services/setup/types.d.ts +51 -53
- package/dist/services/setup/types.d.ts.map +1 -0
- package/dist/services/sync.d.ts +37 -35
- package/dist/services/sync.d.ts.map +1 -0
- package/dist/services/test.d.ts +15 -13
- package/dist/services/test.d.ts.map +1 -0
- package/dist/services/validate-implementation.d.ts +30 -28
- package/dist/services/validate-implementation.d.ts.map +1 -0
- package/dist/services/validate.d.ts +23 -24
- package/dist/services/validate.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/filesystem.d.ts +40 -38
- package/dist/services/verification-cache/adapters/filesystem.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/in-memory.d.ts +21 -19
- package/dist/services/verification-cache/adapters/in-memory.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/index.d.ts +7 -0
- package/dist/services/verification-cache/adapters/index.d.ts.map +1 -0
- package/dist/services/verification-cache/adapters/workspace-state.d.ts +39 -37
- package/dist/services/verification-cache/adapters/workspace-state.d.ts.map +1 -0
- package/dist/services/verification-cache/cache-service.d.ts +55 -53
- package/dist/services/verification-cache/cache-service.d.ts.map +1 -0
- package/dist/services/verification-cache/index.d.ts +7 -0
- package/dist/services/verification-cache/index.d.ts.map +1 -0
- package/dist/services/verification-cache/types.d.ts +84 -85
- package/dist/services/verification-cache/types.d.ts.map +1 -0
- package/dist/services/verify/ai-verifier.d.ts +13 -11
- package/dist/services/verify/ai-verifier.d.ts.map +1 -0
- package/dist/services/verify/behavior-verifier.d.ts +10 -8
- package/dist/services/verify/behavior-verifier.d.ts.map +1 -0
- package/dist/services/verify/index.d.ts +18 -0
- package/dist/services/verify/index.d.ts.map +1 -0
- package/dist/services/verify/structure-verifier.d.ts +12 -8
- package/dist/services/verify/structure-verifier.d.ts.map +1 -0
- package/dist/services/verify/types.d.ts +114 -115
- package/dist/services/verify/types.d.ts.map +1 -0
- package/dist/services/verify/verify-service.d.ts +51 -49
- package/dist/services/verify/verify-service.d.ts.map +1 -0
- package/dist/services/watch.d.ts +22 -21
- package/dist/services/watch.d.ts.map +1 -0
- package/dist/services/workspace-info.d.ts +40 -37
- package/dist/services/workspace-info.d.ts.map +1 -0
- package/dist/templates/app-config.template.d.ts +3 -6
- package/dist/templates/app-config.template.d.ts.map +1 -0
- package/dist/templates/data-view.template.d.ts +3 -6
- package/dist/templates/data-view.template.d.ts.map +1 -0
- package/dist/templates/event.template.d.ts +3 -7
- package/dist/templates/event.template.d.ts.map +1 -0
- package/dist/templates/experiment.template.d.ts +3 -6
- package/dist/templates/experiment.template.d.ts.map +1 -0
- package/dist/templates/handler.template.d.ts +4 -6
- package/dist/templates/handler.template.d.ts.map +1 -0
- package/dist/templates/index.d.ts +17 -20
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/integration.template.d.ts +3 -6
- package/dist/templates/integration.template.d.ts.map +1 -0
- package/dist/templates/knowledge.template.d.ts +3 -6
- package/dist/templates/knowledge.template.d.ts.map +1 -0
- package/dist/templates/migration.template.d.ts +3 -6
- package/dist/templates/migration.template.d.ts.map +1 -0
- package/dist/templates/operation.template.d.ts +3 -7
- package/dist/templates/operation.template.d.ts.map +1 -0
- package/dist/templates/operation.template.test.d.ts +2 -0
- package/dist/templates/operation.template.test.d.ts.map +1 -0
- package/dist/templates/presentation.template.d.ts +3 -7
- package/dist/templates/presentation.template.d.ts.map +1 -0
- package/dist/templates/telemetry.template.d.ts +3 -6
- package/dist/templates/telemetry.template.d.ts.map +1 -0
- package/dist/templates/workflow-runner.template.d.ts +7 -13
- package/dist/templates/workflow-runner.template.d.ts.map +1 -0
- package/dist/templates/workflow.template.d.ts +3 -6
- package/dist/templates/workflow.template.d.ts.map +1 -0
- package/dist/types/config.d.ts +18 -20
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types.d.ts +338 -311
- package/dist/types.d.ts.map +1 -0
- package/package.json +16 -15
- package/dist/_virtual/rolldown_runtime.js +0 -22
- package/dist/adapters/ai.js +0 -82
- package/dist/adapters/factory.js +0 -36
- package/dist/adapters/fs.js +0 -118
- package/dist/adapters/git.js +0 -54
- package/dist/adapters/index.js +0 -7
- package/dist/adapters/logger.js +0 -80
- package/dist/adapters/watcher.js +0 -69
- package/dist/adapters/workspace.js +0 -190
- package/dist/ai/agents/claude-code-agent.js +0 -181
- package/dist/ai/agents/cursor-agent.js +0 -437
- package/dist/ai/agents/index.js +0 -5
- package/dist/ai/agents/openai-codex-agent.js +0 -166
- package/dist/ai/agents/orchestrator.js +0 -142
- package/dist/ai/agents/simple-agent.js +0 -91
- package/dist/ai/client.js +0 -162
- package/dist/ai/index.js +0 -27
- package/dist/ai/prompts/code-generation.js +0 -142
- package/dist/ai/prompts/index.js +0 -12
- package/dist/ai/prompts/spec-creation.js +0 -110
- package/dist/ai/providers.js +0 -40
- package/dist/formatters/index.js +0 -18
- package/dist/formatters/json.js +0 -71
- package/dist/formatters/sarif.js +0 -163
- package/dist/formatters/text.js +0 -208
- package/dist/libs/ai-providers/dist/factory.js +0 -154
- package/dist/libs/ai-providers/dist/index.js +0 -4
- package/dist/libs/ai-providers/dist/legacy.js +0 -72
- package/dist/libs/ai-providers/dist/models.js +0 -287
- package/dist/libs/ai-providers/dist/validation.js +0 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -8
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -72
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -24
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -352
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -211
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -75
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -2
- package/dist/libs/contracts/dist/regenerator/service.js +0 -92
- package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
- package/dist/libs/contracts/dist/registry.js +0 -208
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -35
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -150
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
- package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
- package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
- package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
- package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
- package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
- package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
- package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
- package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
- package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
- package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
- package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
- package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
- package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
- package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
- package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
- package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
- package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
- package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
- package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
- package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
- package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
- package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
- package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
- package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
- package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
- package/dist/services/agent-guide/adapters/claude-code.js +0 -144
- package/dist/services/agent-guide/adapters/cursor-cli.js +0 -135
- package/dist/services/agent-guide/adapters/generic-mcp.js +0 -159
- package/dist/services/agent-guide/adapters/index.js +0 -30
- package/dist/services/agent-guide/agent-guide-service.js +0 -148
- package/dist/services/agent-guide/index.js +0 -5
- package/dist/services/build.js +0 -140
- package/dist/services/ci-check/ci-check-service.js +0 -393
- package/dist/services/ci-check/index.js +0 -2
- package/dist/services/ci-check/types.js +0 -28
- package/dist/services/clean.js +0 -71
- package/dist/services/config.js +0 -76
- package/dist/services/deps.js +0 -62
- package/dist/services/diff.js +0 -33
- package/dist/services/doctor/checks/ai.js +0 -118
- package/dist/services/doctor/checks/cli.js +0 -146
- package/dist/services/doctor/checks/config.js +0 -170
- package/dist/services/doctor/checks/deps.js +0 -180
- package/dist/services/doctor/checks/index.js +0 -6
- package/dist/services/doctor/checks/mcp.js +0 -144
- package/dist/services/doctor/checks/workspace.js +0 -243
- package/dist/services/doctor/doctor-service.js +0 -115
- package/dist/services/doctor/index.js +0 -2
- package/dist/services/doctor/types.js +0 -26
- package/dist/services/implementation/discovery.js +0 -143
- package/dist/services/implementation/index.js +0 -2
- package/dist/services/implementation/resolver.js +0 -223
- package/dist/services/index.js +0 -53
- package/dist/services/integrity-diagram.js +0 -274
- package/dist/services/integrity.js +0 -272
- package/dist/services/list.js +0 -35
- package/dist/services/openapi/export-service.js +0 -51
- package/dist/services/openapi/import-service.js +0 -75
- package/dist/services/openapi/index.js +0 -4
- package/dist/services/openapi/sync-service.js +0 -121
- package/dist/services/openapi/validate-service.js +0 -130
- package/dist/services/regenerator.js +0 -23
- package/dist/services/registry.js +0 -73
- package/dist/services/setup/config-generators.js +0 -237
- package/dist/services/setup/file-merger.js +0 -60
- package/dist/services/setup/index.js +0 -4
- package/dist/services/setup/setup-service.js +0 -95
- package/dist/services/setup/targets/agents-md.js +0 -46
- package/dist/services/setup/targets/cli-config.js +0 -59
- package/dist/services/setup/targets/cursor-rules.js +0 -47
- package/dist/services/setup/targets/mcp-claude.js +0 -59
- package/dist/services/setup/targets/mcp-cursor.js +0 -58
- package/dist/services/setup/targets/vscode-settings.js +0 -62
- package/dist/services/setup/types.js +0 -26
- package/dist/services/sync.js +0 -62
- package/dist/services/test.js +0 -30
- package/dist/services/validate-implementation.js +0 -69
- package/dist/services/validate.js +0 -47
- package/dist/services/verification-cache/adapters/filesystem.js +0 -121
- package/dist/services/verification-cache/adapters/in-memory.js +0 -45
- package/dist/services/verification-cache/adapters/index.js +0 -3
- package/dist/services/verification-cache/adapters/workspace-state.js +0 -90
- package/dist/services/verification-cache/cache-service.js +0 -255
- package/dist/services/verification-cache/index.js +0 -6
- package/dist/services/verification-cache/types.js +0 -15
- package/dist/services/verify/ai-verifier.js +0 -403
- package/dist/services/verify/behavior-verifier.js +0 -185
- package/dist/services/verify/index.js +0 -4
- package/dist/services/verify/structure-verifier.js +0 -195
- package/dist/services/verify/verify-service.js +0 -203
- package/dist/services/watch.js +0 -31
- package/dist/services/workspace-info.js +0 -102
- package/dist/templates/app-config.template.js +0 -106
- package/dist/templates/data-view.template.js +0 -69
- package/dist/templates/event.template.js +0 -39
- package/dist/templates/experiment.template.js +0 -88
- package/dist/templates/handler.template.js +0 -99
- package/dist/templates/index.js +0 -36
- package/dist/templates/integration.template.js +0 -159
- package/dist/templates/knowledge.template.js +0 -74
- package/dist/templates/migration.template.js +0 -61
- package/dist/templates/operation.template.js +0 -104
- package/dist/templates/presentation.template.js +0 -79
- package/dist/templates/telemetry.template.js +0 -90
- package/dist/templates/workflow-runner.template.js +0 -49
- package/dist/templates/workflow.template.js +0 -68
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_CACHE_CONFIG } from "./types.js";
|
|
2
|
-
import { createHash } from "crypto";
|
|
3
|
-
|
|
4
|
-
//#region src/services/verification-cache/cache-service.ts
|
|
5
|
-
/**
|
|
6
|
-
* Verification cache service.
|
|
7
|
-
*
|
|
8
|
-
* Provides content-hash based caching for verification results
|
|
9
|
-
* to avoid redundant checks and reduce AI costs.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Compute SHA256 hash of content.
|
|
13
|
-
*/
|
|
14
|
-
function computeContentHash(content) {
|
|
15
|
-
return createHash("sha256").update(content).digest("hex");
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Convert cache key to string for storage.
|
|
19
|
-
*/
|
|
20
|
-
function cacheKeyToString(key) {
|
|
21
|
-
const parts = [
|
|
22
|
-
`spec:${key.specHash.substring(0, 16)}`,
|
|
23
|
-
`impl:${key.implHash.substring(0, 16)}`,
|
|
24
|
-
`tier:${key.tier}`
|
|
25
|
-
];
|
|
26
|
-
if (key.aiModelVersion) parts.push(`model:${key.aiModelVersion}`);
|
|
27
|
-
return parts.join("|");
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Parse cache key string back to object.
|
|
31
|
-
*/
|
|
32
|
-
function stringToCacheKey(str) {
|
|
33
|
-
try {
|
|
34
|
-
const parts = str.split("|");
|
|
35
|
-
const keyMap = /* @__PURE__ */ new Map();
|
|
36
|
-
for (const part of parts) {
|
|
37
|
-
const [prefix, value] = part.split(":");
|
|
38
|
-
if (prefix && value) keyMap.set(prefix, value);
|
|
39
|
-
}
|
|
40
|
-
const specHash = keyMap.get("spec");
|
|
41
|
-
const implHash = keyMap.get("impl");
|
|
42
|
-
const tier = keyMap.get("tier");
|
|
43
|
-
if (!specHash || !implHash || !tier) return null;
|
|
44
|
-
return {
|
|
45
|
-
specHash,
|
|
46
|
-
implHash,
|
|
47
|
-
tier,
|
|
48
|
-
aiModelVersion: keyMap.get("model")
|
|
49
|
-
};
|
|
50
|
-
} catch {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get TTL for a specific tier.
|
|
56
|
-
*/
|
|
57
|
-
function getTtlForTier(tier, config) {
|
|
58
|
-
switch (tier) {
|
|
59
|
-
case "structure": return config.structureTtlMs;
|
|
60
|
-
case "behavior": return config.behaviorTtlMs;
|
|
61
|
-
case "ai_review": return config.aiTtlMs;
|
|
62
|
-
default: return config.defaultTtlMs;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Verification cache service.
|
|
67
|
-
*/
|
|
68
|
-
var VerificationCacheService = class {
|
|
69
|
-
storage;
|
|
70
|
-
config;
|
|
71
|
-
stats;
|
|
72
|
-
constructor(storage, config = {}) {
|
|
73
|
-
this.storage = storage;
|
|
74
|
-
this.config = {
|
|
75
|
-
...DEFAULT_CACHE_CONFIG,
|
|
76
|
-
...config
|
|
77
|
-
};
|
|
78
|
-
this.stats = {
|
|
79
|
-
hits: 0,
|
|
80
|
-
misses: 0
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Create a cache key from spec and implementation content.
|
|
85
|
-
*/
|
|
86
|
-
createKey(specContent, implContent, tier, aiModelVersion) {
|
|
87
|
-
return {
|
|
88
|
-
specHash: computeContentHash(specContent),
|
|
89
|
-
implHash: computeContentHash(implContent),
|
|
90
|
-
tier,
|
|
91
|
-
aiModelVersion: tier === "ai_review" ? aiModelVersion : void 0
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Look up a cached verification result.
|
|
96
|
-
*/
|
|
97
|
-
async lookup(key) {
|
|
98
|
-
const keyStr = cacheKeyToString(key);
|
|
99
|
-
const entry = await this.storage.get(keyStr);
|
|
100
|
-
if (!entry) {
|
|
101
|
-
this.stats.misses++;
|
|
102
|
-
return {
|
|
103
|
-
hit: false,
|
|
104
|
-
reason: "not_found"
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (entry.meta.expiresAt) {
|
|
108
|
-
const expiresAt = new Date(entry.meta.expiresAt).getTime();
|
|
109
|
-
if (Date.now() > expiresAt) {
|
|
110
|
-
this.stats.misses++;
|
|
111
|
-
await this.storage.delete(keyStr);
|
|
112
|
-
return {
|
|
113
|
-
hit: false,
|
|
114
|
-
reason: "expired"
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (entry.key.specHash !== key.specHash) {
|
|
119
|
-
this.stats.misses++;
|
|
120
|
-
return {
|
|
121
|
-
hit: false,
|
|
122
|
-
reason: "spec_changed"
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
if (entry.key.implHash !== key.implHash) {
|
|
126
|
-
this.stats.misses++;
|
|
127
|
-
return {
|
|
128
|
-
hit: false,
|
|
129
|
-
reason: "impl_changed"
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (key.tier === "ai_review" && key.aiModelVersion && entry.key.aiModelVersion !== key.aiModelVersion) {
|
|
133
|
-
this.stats.misses++;
|
|
134
|
-
return {
|
|
135
|
-
hit: false,
|
|
136
|
-
reason: "model_changed"
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
this.stats.hits++;
|
|
140
|
-
return {
|
|
141
|
-
hit: true,
|
|
142
|
-
entry
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Store a verification result in cache.
|
|
147
|
-
*/
|
|
148
|
-
async store(key, result, options = {}) {
|
|
149
|
-
const keyStr = cacheKeyToString(key);
|
|
150
|
-
const ttl = getTtlForTier(key.tier, this.config);
|
|
151
|
-
const entry = {
|
|
152
|
-
key,
|
|
153
|
-
result,
|
|
154
|
-
meta: {
|
|
155
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
156
|
-
expiresAt: new Date(Date.now() + ttl).toISOString(),
|
|
157
|
-
dependencies: options.dependencies ?? [],
|
|
158
|
-
specName: options.specName,
|
|
159
|
-
implPath: options.implPath
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
await this.storage.set(keyStr, entry);
|
|
163
|
-
await this.pruneIfNeeded();
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Invalidate cache entries for a specific file.
|
|
167
|
-
* Used when a file changes to invalidate dependent caches.
|
|
168
|
-
*/
|
|
169
|
-
async invalidateForFile(filePath) {
|
|
170
|
-
if (!this.config.transitiveInvalidation) return 0;
|
|
171
|
-
const keys = await this.storage.keys();
|
|
172
|
-
let invalidated = 0;
|
|
173
|
-
for (const keyStr of keys) {
|
|
174
|
-
const entry = await this.storage.get(keyStr);
|
|
175
|
-
if (!entry) continue;
|
|
176
|
-
if (entry.meta.dependencies.includes(filePath)) {
|
|
177
|
-
await this.storage.delete(keyStr);
|
|
178
|
-
invalidated++;
|
|
179
|
-
}
|
|
180
|
-
if (entry.meta.specName === filePath || entry.meta.implPath === filePath) {
|
|
181
|
-
await this.storage.delete(keyStr);
|
|
182
|
-
invalidated++;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return invalidated;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Invalidate all cache entries for a specific spec.
|
|
189
|
-
*/
|
|
190
|
-
async invalidateForSpec(specHash) {
|
|
191
|
-
const keys = await this.storage.keys();
|
|
192
|
-
let invalidated = 0;
|
|
193
|
-
for (const keyStr of keys) {
|
|
194
|
-
const parsed = stringToCacheKey(keyStr);
|
|
195
|
-
if (parsed && parsed.specHash.startsWith(specHash.substring(0, 16))) {
|
|
196
|
-
await this.storage.delete(keyStr);
|
|
197
|
-
invalidated++;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return invalidated;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Clear all cache entries.
|
|
204
|
-
*/
|
|
205
|
-
async clear() {
|
|
206
|
-
await this.storage.clear();
|
|
207
|
-
this.stats = {
|
|
208
|
-
hits: 0,
|
|
209
|
-
misses: 0
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Get cache statistics.
|
|
214
|
-
*/
|
|
215
|
-
async getStats() {
|
|
216
|
-
const storageStats = await this.storage.stats?.();
|
|
217
|
-
return {
|
|
218
|
-
totalEntries: storageStats?.entryCount ?? (await this.storage.keys()).length,
|
|
219
|
-
hits: this.stats.hits,
|
|
220
|
-
misses: this.stats.misses,
|
|
221
|
-
hitRate: this.stats.hits + this.stats.misses > 0 ? Math.round(this.stats.hits / (this.stats.hits + this.stats.misses) * 100) : 0,
|
|
222
|
-
memoryUsage: storageStats?.memoryUsage
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Prune cache if over the maximum entry limit.
|
|
227
|
-
*/
|
|
228
|
-
async pruneIfNeeded() {
|
|
229
|
-
const keys = await this.storage.keys();
|
|
230
|
-
if (keys.length <= this.config.maxEntries) return;
|
|
231
|
-
const entries = [];
|
|
232
|
-
for (const keyStr of keys) {
|
|
233
|
-
const entry = await this.storage.get(keyStr);
|
|
234
|
-
if (entry) entries.push({
|
|
235
|
-
key: keyStr,
|
|
236
|
-
createdAt: new Date(entry.meta.createdAt).getTime()
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
entries.sort((a, b) => a.createdAt - b.createdAt);
|
|
240
|
-
const toRemove = entries.length - this.config.maxEntries;
|
|
241
|
-
for (let i = 0; i < toRemove; i++) {
|
|
242
|
-
const entry = entries[i];
|
|
243
|
-
if (entry) await this.storage.delete(entry.key);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* Create a verification cache service with the given storage adapter.
|
|
249
|
-
*/
|
|
250
|
-
function createVerificationCacheService(storage, config) {
|
|
251
|
-
return new VerificationCacheService(storage, config);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
//#endregion
|
|
255
|
-
export { VerificationCacheService, cacheKeyToString, computeContentHash, createVerificationCacheService, stringToCacheKey };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_CACHE_CONFIG } from "./types.js";
|
|
2
|
-
import { VerificationCacheService, cacheKeyToString, computeContentHash, createVerificationCacheService, stringToCacheKey } from "./cache-service.js";
|
|
3
|
-
import { InMemoryCacheStorage, createInMemoryCacheStorage } from "./adapters/in-memory.js";
|
|
4
|
-
import { FileSystemCacheStorage, createFileSystemCacheStorage } from "./adapters/filesystem.js";
|
|
5
|
-
import { WorkspaceStateCacheStorage, createWorkspaceStateCacheStorage } from "./adapters/workspace-state.js";
|
|
6
|
-
import "./adapters/index.js";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region src/services/verification-cache/types.ts
|
|
2
|
-
/**
|
|
3
|
-
* Default cache configuration.
|
|
4
|
-
*/
|
|
5
|
-
const DEFAULT_CACHE_CONFIG = {
|
|
6
|
-
maxEntries: 1e3,
|
|
7
|
-
defaultTtlMs: 1440 * 60 * 1e3,
|
|
8
|
-
structureTtlMs: 10080 * 60 * 1e3,
|
|
9
|
-
behaviorTtlMs: 1440 * 60 * 1e3,
|
|
10
|
-
aiTtlMs: 1440 * 60 * 1e3,
|
|
11
|
-
transitiveInvalidation: true
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export { DEFAULT_CACHE_CONFIG };
|
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
import { generateVerificationPrompt } from "../../libs/contracts/dist/llm/prompts.js";
|
|
2
|
-
import "../../libs/contracts/dist/llm/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/services/verify/ai-verifier.ts
|
|
5
|
-
/**
|
|
6
|
-
* Parse AI response to structured result.
|
|
7
|
-
*/
|
|
8
|
-
function parseAIResponse(response) {
|
|
9
|
-
const jsonMatch = response.match(/```json\n?([\s\S]*?)\n?```/);
|
|
10
|
-
if (jsonMatch?.[1]) try {
|
|
11
|
-
const parsed = JSON.parse(jsonMatch[1]);
|
|
12
|
-
return {
|
|
13
|
-
compliant: parsed.passed ?? false,
|
|
14
|
-
confidence: (parsed.score ?? 0) / 100,
|
|
15
|
-
findings: (parsed.issues ?? []).map((issue) => ({
|
|
16
|
-
category: String(issue.category ?? "semantic"),
|
|
17
|
-
severity: String(issue.severity ?? "warning"),
|
|
18
|
-
message: String(issue.message ?? ""),
|
|
19
|
-
location: issue.location ? String(issue.location) : void 0,
|
|
20
|
-
suggestion: issue.suggestion ? String(issue.suggestion) : void 0
|
|
21
|
-
})),
|
|
22
|
-
rawResponse: response
|
|
23
|
-
};
|
|
24
|
-
} catch {}
|
|
25
|
-
const findings = [];
|
|
26
|
-
const lines = response.split("\n");
|
|
27
|
-
let currentSeverity = "info";
|
|
28
|
-
for (const line of lines) {
|
|
29
|
-
const lineLower = line.toLowerCase();
|
|
30
|
-
if (lineLower.includes("error") || lineLower.includes("critical")) currentSeverity = "error";
|
|
31
|
-
else if (lineLower.includes("warning") || lineLower.includes("should")) currentSeverity = "warning";
|
|
32
|
-
else if (lineLower.includes("info") || lineLower.includes("note")) currentSeverity = "info";
|
|
33
|
-
const bulletMatch = line.match(/^[-*•]\s*(.+)$/);
|
|
34
|
-
const numberedMatch = line.match(/^\d+\.\s*(.+)$/);
|
|
35
|
-
if (bulletMatch || numberedMatch) {
|
|
36
|
-
const content = bulletMatch?.[1] ?? numberedMatch?.[1] ?? "";
|
|
37
|
-
if (content.length > 10) findings.push({
|
|
38
|
-
category: "semantic",
|
|
39
|
-
severity: currentSeverity,
|
|
40
|
-
message: content
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const hasErrors = findings.some((f) => f.severity === "error");
|
|
45
|
-
return {
|
|
46
|
-
compliant: !hasErrors,
|
|
47
|
-
confidence: hasErrors ? .3 : findings.length === 0 ? .9 : .7,
|
|
48
|
-
findings,
|
|
49
|
-
rawResponse: response
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Call AI provider for verification.
|
|
54
|
-
* This is a placeholder - actual implementation would use AI SDK.
|
|
55
|
-
*/
|
|
56
|
-
async function callAI(prompt, config) {
|
|
57
|
-
if (!config.aiApiKey) return `\`\`\`json
|
|
58
|
-
{
|
|
59
|
-
"passed": true,
|
|
60
|
-
"score": 50,
|
|
61
|
-
"compliance": {
|
|
62
|
-
"inputTypes": { "match": true, "issues": [] },
|
|
63
|
-
"outputTypes": { "match": true, "issues": [] },
|
|
64
|
-
"errorHandling": { "coverage": "unknown", "missing": [] },
|
|
65
|
-
"eventEmission": { "correct": true, "issues": [] },
|
|
66
|
-
"policyCompliance": { "auth": true, "rateLimit": true, "pii": true }
|
|
67
|
-
},
|
|
68
|
-
"scenarios": [],
|
|
69
|
-
"issues": [
|
|
70
|
-
{ "severity": "info", "category": "semantic", "message": "AI verification not available - configure AI API key for full analysis" }
|
|
71
|
-
],
|
|
72
|
-
"summary": "AI verification skipped - no API key configured. Structure and behavior checks have been performed."
|
|
73
|
-
}
|
|
74
|
-
\`\`\``;
|
|
75
|
-
try {
|
|
76
|
-
const provider = config.aiProvider ?? "anthropic";
|
|
77
|
-
if (provider === "anthropic") {
|
|
78
|
-
const { anthropic } = await import("@ai-sdk/anthropic");
|
|
79
|
-
const { generateText } = await import("ai");
|
|
80
|
-
return (await generateText({
|
|
81
|
-
model: anthropic("claude-3-5-sonnet-20241022"),
|
|
82
|
-
prompt,
|
|
83
|
-
system: "You are an expert code reviewer analyzing implementation compliance with specifications. Respond with structured JSON."
|
|
84
|
-
})).text;
|
|
85
|
-
} else if (provider === "openai") {
|
|
86
|
-
const { openai } = await import("@ai-sdk/openai");
|
|
87
|
-
const { generateText } = await import("ai");
|
|
88
|
-
return (await generateText({
|
|
89
|
-
model: openai("gpt-4o"),
|
|
90
|
-
prompt,
|
|
91
|
-
system: "You are an expert code reviewer analyzing implementation compliance with specifications. Respond with structured JSON."
|
|
92
|
-
})).text;
|
|
93
|
-
}
|
|
94
|
-
throw new Error(`Unknown AI provider: ${provider}`);
|
|
95
|
-
} catch (error) {
|
|
96
|
-
return `\`\`\`json
|
|
97
|
-
{
|
|
98
|
-
"passed": false,
|
|
99
|
-
"score": 0,
|
|
100
|
-
"issues": [
|
|
101
|
-
{ "severity": "error", "category": "semantic", "message": "AI verification failed: ${error instanceof Error ? error.message : "Unknown error"}" }
|
|
102
|
-
],
|
|
103
|
-
"summary": "AI verification encountered an error"
|
|
104
|
-
}
|
|
105
|
-
\`\`\``;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Run AI-powered verification.
|
|
110
|
-
*/
|
|
111
|
-
async function verifyWithAI(input, config = {}) {
|
|
112
|
-
const { spec, implementationCode, implementationPath } = input;
|
|
113
|
-
const startTime = Date.now();
|
|
114
|
-
const result = parseAIResponse(await callAI(generateVerificationPrompt(spec, implementationCode).taskPrompt, config));
|
|
115
|
-
const issues = result.findings.map((f) => ({
|
|
116
|
-
severity: f.severity,
|
|
117
|
-
category: "semantic",
|
|
118
|
-
message: f.message,
|
|
119
|
-
location: f.location ? { file: f.location } : implementationPath ? { file: implementationPath } : void 0,
|
|
120
|
-
suggestion: f.suggestion
|
|
121
|
-
}));
|
|
122
|
-
const score = Math.round(result.confidence * 100);
|
|
123
|
-
const passed = result.compliant;
|
|
124
|
-
return {
|
|
125
|
-
tier: "ai_review",
|
|
126
|
-
passed,
|
|
127
|
-
score,
|
|
128
|
-
issues,
|
|
129
|
-
suggestions: result.findings.filter((f) => f.suggestion).map((f) => f.suggestion),
|
|
130
|
-
coverage: {
|
|
131
|
-
scenarios: {
|
|
132
|
-
total: 0,
|
|
133
|
-
covered: 0
|
|
134
|
-
},
|
|
135
|
-
errors: {
|
|
136
|
-
total: 0,
|
|
137
|
-
handled: 0
|
|
138
|
-
},
|
|
139
|
-
fields: {
|
|
140
|
-
total: 1,
|
|
141
|
-
implemented: passed ? 1 : 0
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
meta: {
|
|
145
|
-
specName: spec.meta.name,
|
|
146
|
-
specVersion: spec.meta.version,
|
|
147
|
-
implementationPath: implementationPath ?? "unknown",
|
|
148
|
-
verifiedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
149
|
-
duration: Date.now() - startTime
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Create a simpler AI review without calling the API.
|
|
155
|
-
* Used as fallback or for quick checks.
|
|
156
|
-
*/
|
|
157
|
-
function createQuickAIReview(input) {
|
|
158
|
-
const { spec, implementationCode, implementationPath } = input;
|
|
159
|
-
const startTime = Date.now();
|
|
160
|
-
const issues = [];
|
|
161
|
-
if (implementationCode.includes("console.log")) issues.push({
|
|
162
|
-
severity: "warning",
|
|
163
|
-
category: "semantic",
|
|
164
|
-
message: "Console.log statements found - consider using proper logging",
|
|
165
|
-
suggestion: "Use a structured logger instead of console.log"
|
|
166
|
-
});
|
|
167
|
-
if (implementationCode.includes("// TODO") || implementationCode.includes("// FIXME")) issues.push({
|
|
168
|
-
severity: "info",
|
|
169
|
-
category: "semantic",
|
|
170
|
-
message: "TODO/FIXME comments found - implementation may be incomplete",
|
|
171
|
-
suggestion: "Address TODO items before finalizing implementation"
|
|
172
|
-
});
|
|
173
|
-
if (spec.policy.auth !== "anonymous" && !implementationCode.includes("auth")) issues.push({
|
|
174
|
-
severity: "warning",
|
|
175
|
-
category: "semantic",
|
|
176
|
-
message: `Spec requires ${spec.policy.auth} auth but no auth check found`,
|
|
177
|
-
suggestion: "Add authentication check at the handler entry point"
|
|
178
|
-
});
|
|
179
|
-
const score = issues.filter((i) => i.severity === "error").length === 0 ? 80 : 40;
|
|
180
|
-
const passed = issues.filter((i) => i.severity === "error").length === 0;
|
|
181
|
-
return {
|
|
182
|
-
tier: "ai_review",
|
|
183
|
-
passed,
|
|
184
|
-
score,
|
|
185
|
-
issues,
|
|
186
|
-
suggestions: issues.filter((i) => i.suggestion).map((i) => i.suggestion),
|
|
187
|
-
coverage: {
|
|
188
|
-
scenarios: {
|
|
189
|
-
total: 0,
|
|
190
|
-
covered: 0
|
|
191
|
-
},
|
|
192
|
-
errors: {
|
|
193
|
-
total: 0,
|
|
194
|
-
handled: 0
|
|
195
|
-
},
|
|
196
|
-
fields: {
|
|
197
|
-
total: 1,
|
|
198
|
-
implemented: passed ? 1 : 0
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
meta: {
|
|
202
|
-
specName: spec.meta.name,
|
|
203
|
-
specVersion: spec.meta.version,
|
|
204
|
-
implementationPath: implementationPath ?? "unknown",
|
|
205
|
-
verifiedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
206
|
-
duration: Date.now() - startTime
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Generate a prompt for semantic field verification.
|
|
212
|
-
*/
|
|
213
|
-
function generateSemanticFieldPrompt(specFields, implCode) {
|
|
214
|
-
return `You are analyzing a code implementation against its specification.
|
|
215
|
-
|
|
216
|
-
## Spec Schema Fields
|
|
217
|
-
${specFields}
|
|
218
|
-
|
|
219
|
-
## Implementation Code
|
|
220
|
-
\`\`\`typescript
|
|
221
|
-
${implCode}
|
|
222
|
-
\`\`\`
|
|
223
|
-
|
|
224
|
-
## Task
|
|
225
|
-
Analyze the implementation to verify it correctly implements the spec schema fields.
|
|
226
|
-
|
|
227
|
-
For each field in the spec:
|
|
228
|
-
1. Find the corresponding field/property in the implementation
|
|
229
|
-
2. Determine if the naming matches (exact, compatible synonym, or mismatch)
|
|
230
|
-
3. Check if the types are compatible
|
|
231
|
-
4. Identify any missing fields
|
|
232
|
-
|
|
233
|
-
Respond with JSON in this format:
|
|
234
|
-
\`\`\`json
|
|
235
|
-
{
|
|
236
|
-
"fieldMappings": [
|
|
237
|
-
{
|
|
238
|
-
"specField": "nickname",
|
|
239
|
-
"specType": "string",
|
|
240
|
-
"implementationField": "username",
|
|
241
|
-
"implementationType": "string",
|
|
242
|
-
"match": "compatible",
|
|
243
|
-
"aiConfidence": 0.85,
|
|
244
|
-
"suggestion": "Consider renaming 'username' to 'nickname' for exact spec compliance"
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
"intentAlignment": {
|
|
248
|
-
"score": 85,
|
|
249
|
-
"issues": ["Field naming differs from spec"],
|
|
250
|
-
"suggestions": ["Rename fields to match spec exactly for better maintainability"]
|
|
251
|
-
},
|
|
252
|
-
"semanticIssues": []
|
|
253
|
-
}
|
|
254
|
-
\`\`\`
|
|
255
|
-
|
|
256
|
-
Match types:
|
|
257
|
-
- "exact": Field name and type match exactly
|
|
258
|
-
- "compatible": Semantically similar (e.g., "email" vs "emailAddress")
|
|
259
|
-
- "mismatch": Different meaning despite similar naming
|
|
260
|
-
- "missing": Spec field not found in implementation
|
|
261
|
-
`;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Extract field definitions from spec schema.
|
|
265
|
-
*/
|
|
266
|
-
function extractSpecFields(spec) {
|
|
267
|
-
const fields = [];
|
|
268
|
-
/**
|
|
269
|
-
* Helper to safely extract fields from a schema.
|
|
270
|
-
*/
|
|
271
|
-
const extractFromSchema = (schema, direction) => {
|
|
272
|
-
try {
|
|
273
|
-
const shapeFn = schema?._def?.shape;
|
|
274
|
-
if (shapeFn && typeof shapeFn === "function") {
|
|
275
|
-
const shapeObj = shapeFn();
|
|
276
|
-
for (const [key, value] of Object.entries(shapeObj)) {
|
|
277
|
-
const typeName = value?._def?.typeName ?? "unknown";
|
|
278
|
-
fields.push(`- ${key}: ${String(typeName).replace("Zod", "").toLowerCase()} (${direction})`);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
} catch {
|
|
282
|
-
fields.push(`- [unable to extract ${direction} fields]`);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
if (spec.io.input) extractFromSchema(spec.io.input, "input");
|
|
286
|
-
if (spec.io.output && !("resourceRef" in spec.io.output)) extractFromSchema(spec.io.output, "output");
|
|
287
|
-
if (fields.length === 0) return "- [no schema fields could be extracted]";
|
|
288
|
-
return fields.join("\n");
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Parse semantic verification response from AI.
|
|
292
|
-
*/
|
|
293
|
-
function parseSemanticResponse(response) {
|
|
294
|
-
const jsonMatch = response.match(/```json\n?([\s\S]*?)\n?```/);
|
|
295
|
-
if (jsonMatch?.[1]) try {
|
|
296
|
-
const parsed = JSON.parse(jsonMatch[1]);
|
|
297
|
-
return {
|
|
298
|
-
fieldMappings: (parsed.fieldMappings ?? []).map((m) => ({
|
|
299
|
-
specField: String(m.specField ?? ""),
|
|
300
|
-
specType: String(m.specType ?? "unknown"),
|
|
301
|
-
implementationField: m.implementationField ? String(m.implementationField) : void 0,
|
|
302
|
-
implementationType: m.implementationType ? String(m.implementationType) : void 0,
|
|
303
|
-
match: m.match ?? "missing",
|
|
304
|
-
aiConfidence: typeof m.aiConfidence === "number" ? m.aiConfidence : .5,
|
|
305
|
-
suggestion: m.suggestion ? String(m.suggestion) : void 0
|
|
306
|
-
})),
|
|
307
|
-
intentAlignment: {
|
|
308
|
-
score: typeof parsed.intentAlignment?.score === "number" ? parsed.intentAlignment.score : 50,
|
|
309
|
-
issues: Array.isArray(parsed.intentAlignment?.issues) ? parsed.intentAlignment.issues : [],
|
|
310
|
-
suggestions: Array.isArray(parsed.intentAlignment?.suggestions) ? parsed.intentAlignment.suggestions : []
|
|
311
|
-
},
|
|
312
|
-
semanticIssues: (parsed.semanticIssues ?? []).map((i) => ({
|
|
313
|
-
category: String(i.category ?? "semantic"),
|
|
314
|
-
severity: i.severity ?? "warning",
|
|
315
|
-
message: String(i.message ?? ""),
|
|
316
|
-
suggestion: i.suggestion ? String(i.suggestion) : void 0
|
|
317
|
-
})),
|
|
318
|
-
rawResponse: response
|
|
319
|
-
};
|
|
320
|
-
} catch {}
|
|
321
|
-
return {
|
|
322
|
-
fieldMappings: [],
|
|
323
|
-
intentAlignment: {
|
|
324
|
-
score: 50,
|
|
325
|
-
issues: ["Unable to parse AI response for semantic analysis"],
|
|
326
|
-
suggestions: []
|
|
327
|
-
},
|
|
328
|
-
semanticIssues: [],
|
|
329
|
-
rawResponse: response
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Run semantic field-level verification using AI.
|
|
334
|
-
*/
|
|
335
|
-
async function verifySemanticFields(input, config = {}) {
|
|
336
|
-
const { spec, implementationCode } = input;
|
|
337
|
-
return parseSemanticResponse(await callAI(generateSemanticFieldPrompt(extractSpecFields(spec), implementationCode), config));
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Run enhanced AI verification with semantic field analysis.
|
|
341
|
-
*/
|
|
342
|
-
async function verifyWithAIEnhanced(input, config = {}) {
|
|
343
|
-
const { spec, implementationCode, implementationPath } = input;
|
|
344
|
-
const startTime = Date.now();
|
|
345
|
-
const baseReport = await verifyWithAI(input, config);
|
|
346
|
-
let semanticResult;
|
|
347
|
-
if (config.aiApiKey) try {
|
|
348
|
-
semanticResult = await verifySemanticFields(input, config);
|
|
349
|
-
} catch {}
|
|
350
|
-
if (semanticResult) {
|
|
351
|
-
const semanticIssues = [];
|
|
352
|
-
for (const mapping of semanticResult.fieldMappings) if (mapping.match === "missing") semanticIssues.push({
|
|
353
|
-
severity: "error",
|
|
354
|
-
category: "semantic",
|
|
355
|
-
message: `Missing field: '${mapping.specField}' (${mapping.specType}) not found in implementation`,
|
|
356
|
-
suggestion: mapping.suggestion ?? `Add field '${mapping.specField}' to implementation`
|
|
357
|
-
});
|
|
358
|
-
else if (mapping.match === "mismatch") semanticIssues.push({
|
|
359
|
-
severity: "warning",
|
|
360
|
-
category: "semantic",
|
|
361
|
-
message: `Field mismatch: '${mapping.specField}' has incorrect implementation as '${mapping.implementationField}'`,
|
|
362
|
-
suggestion: mapping.suggestion
|
|
363
|
-
});
|
|
364
|
-
else if (mapping.match === "compatible" && mapping.aiConfidence < .8) semanticIssues.push({
|
|
365
|
-
severity: "info",
|
|
366
|
-
category: "semantic",
|
|
367
|
-
message: `Field naming: '${mapping.specField}' implemented as '${mapping.implementationField}' (compatible but not exact)`,
|
|
368
|
-
suggestion: mapping.suggestion
|
|
369
|
-
});
|
|
370
|
-
for (const issue of semanticResult.intentAlignment.issues) semanticIssues.push({
|
|
371
|
-
severity: "warning",
|
|
372
|
-
category: "semantic",
|
|
373
|
-
message: issue
|
|
374
|
-
});
|
|
375
|
-
for (const issue of semanticResult.semanticIssues) semanticIssues.push({
|
|
376
|
-
severity: issue.severity,
|
|
377
|
-
category: "semantic",
|
|
378
|
-
message: issue.message,
|
|
379
|
-
suggestion: issue.suggestion
|
|
380
|
-
});
|
|
381
|
-
baseReport.issues = [...baseReport.issues, ...semanticIssues];
|
|
382
|
-
const totalFields = semanticResult.fieldMappings.length;
|
|
383
|
-
const implementedFields = semanticResult.fieldMappings.filter((m) => m.match === "exact" || m.match === "compatible").length;
|
|
384
|
-
if (totalFields > 0) {
|
|
385
|
-
const fieldScore = Math.round(implementedFields / totalFields * 100);
|
|
386
|
-
baseReport.score = Math.round((baseReport.score + fieldScore) / 2);
|
|
387
|
-
baseReport.coverage.fields = {
|
|
388
|
-
total: totalFields,
|
|
389
|
-
implemented: implementedFields
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
if (semanticIssues.some((i) => i.severity === "error")) baseReport.passed = false;
|
|
393
|
-
baseReport.suggestions = [...baseReport.suggestions, ...semanticResult.intentAlignment.suggestions];
|
|
394
|
-
}
|
|
395
|
-
baseReport.meta = {
|
|
396
|
-
...baseReport.meta,
|
|
397
|
-
duration: Date.now() - startTime
|
|
398
|
-
};
|
|
399
|
-
return baseReport;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
//#endregion
|
|
403
|
-
export { createQuickAIReview, verifySemanticFields, verifyWithAI, verifyWithAIEnhanced };
|