@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,437 +0,0 @@
|
|
|
1
|
-
import { join } from "path";
|
|
2
|
-
import { existsSync } from "fs";
|
|
3
|
-
import { exec, spawn } from "child_process";
|
|
4
|
-
import { mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
5
|
-
import { homedir, tmpdir } from "os";
|
|
6
|
-
import { promisify } from "util";
|
|
7
|
-
|
|
8
|
-
//#region src/ai/agents/cursor-agent.ts
|
|
9
|
-
/**
|
|
10
|
-
* Cursor/Windsurf Agent - Fully Implemented
|
|
11
|
-
* Leverages Windsurf AI capabilities and Cursor IDE integration for code generation and validation
|
|
12
|
-
*/
|
|
13
|
-
promisify(exec);
|
|
14
|
-
var CursorAgent = class {
|
|
15
|
-
name = "cursor";
|
|
16
|
-
cursorPath = null;
|
|
17
|
-
isWindsurf = false;
|
|
18
|
-
composerPort;
|
|
19
|
-
constructor() {
|
|
20
|
-
this.composerPort = process.env.CURSOR_COMPOSER_PORT || "3000";
|
|
21
|
-
this.detectEnvironment();
|
|
22
|
-
}
|
|
23
|
-
canHandle(task) {
|
|
24
|
-
return this.isCursorAvailable();
|
|
25
|
-
}
|
|
26
|
-
async generate(task) {
|
|
27
|
-
try {
|
|
28
|
-
const workDir = join(tmpdir(), `cursor-agent-${Date.now()}`);
|
|
29
|
-
await mkdir(workDir, { recursive: true });
|
|
30
|
-
const result = await this.executeWithBestMethod(task, workDir);
|
|
31
|
-
await this.cleanupWorkDir(workDir);
|
|
32
|
-
return result;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
return {
|
|
35
|
-
success: false,
|
|
36
|
-
errors: [error instanceof Error ? error.message : String(error)]
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
async validate(task) {
|
|
41
|
-
try {
|
|
42
|
-
const workDir = join(tmpdir(), `cursor-validate-${Date.now()}`);
|
|
43
|
-
await mkdir(workDir, { recursive: true });
|
|
44
|
-
await this.setupValidationWorkspace(task, workDir);
|
|
45
|
-
const result = await this.executeWithBestMethod({
|
|
46
|
-
...task,
|
|
47
|
-
type: "validate"
|
|
48
|
-
}, workDir);
|
|
49
|
-
await this.cleanupWorkDir(workDir);
|
|
50
|
-
return result;
|
|
51
|
-
} catch (error) {
|
|
52
|
-
return {
|
|
53
|
-
success: false,
|
|
54
|
-
errors: [error instanceof Error ? error.message : String(error)]
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Detect if running in Cursor/Windsurf environment
|
|
60
|
-
*/
|
|
61
|
-
detectEnvironment() {
|
|
62
|
-
this.isWindsurf = !!(process.env.WINDSURF_SESSION || process.env.CURSOR_USER_DATA || process.env.VSCODE_CWD?.includes("Cursor") || process.env.VSCODE_CWD?.includes("Windsurf"));
|
|
63
|
-
const possiblePaths = [
|
|
64
|
-
"/usr/local/bin/cursor",
|
|
65
|
-
"/Applications/Cursor.app/Contents/MacOS/Cursor",
|
|
66
|
-
"/Applications/Windsurf.app/Contents/MacOS/Windsurf",
|
|
67
|
-
join(homedir(), ".cursor", "cursor"),
|
|
68
|
-
join(homedir(), "AppData", "Local", "Programs", "cursor", "Cursor.exe"),
|
|
69
|
-
join(homedir(), "AppData", "Local", "Programs", "windsurf", "Windsurf.exe"),
|
|
70
|
-
"cursor",
|
|
71
|
-
"windsurf"
|
|
72
|
-
];
|
|
73
|
-
for (const path of possiblePaths) if (path.includes("cursor") || path.includes("Cursor") || path.includes("windsurf") || path.includes("Windsurf")) try {
|
|
74
|
-
if (existsSync(path)) {
|
|
75
|
-
this.cursorPath = path;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
} catch {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Execute task using the best available method
|
|
84
|
-
*/
|
|
85
|
-
async executeWithBestMethod(task, workDir) {
|
|
86
|
-
const methods = [{
|
|
87
|
-
name: "cursor-cli",
|
|
88
|
-
fn: () => this.useCursorCLI(task, workDir)
|
|
89
|
-
}, {
|
|
90
|
-
name: "file-based",
|
|
91
|
-
fn: () => this.useFileBasedApproach(task, workDir)
|
|
92
|
-
}];
|
|
93
|
-
for (const method of methods) try {
|
|
94
|
-
const result = await method.fn();
|
|
95
|
-
if (result.success) return result;
|
|
96
|
-
} catch (error) {
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
success: false,
|
|
101
|
-
warnings: [
|
|
102
|
-
"Cursor agent could not connect to IDE.",
|
|
103
|
-
"Ensure Cursor/Windsurf is running with API enabled.",
|
|
104
|
-
"Falling back to simple agent mode is recommended."
|
|
105
|
-
],
|
|
106
|
-
errors: ["All Cursor integration methods failed"],
|
|
107
|
-
metadata: {
|
|
108
|
-
agentMode: "cursor",
|
|
109
|
-
status: "unavailable",
|
|
110
|
-
suggestion: "Use --agent-mode claude-code or --agent-mode simple"
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Use Windsurf's native API
|
|
116
|
-
*/
|
|
117
|
-
/**
|
|
118
|
-
* Use Cursor Composer API
|
|
119
|
-
*/
|
|
120
|
-
/**
|
|
121
|
-
* Use Cursor CLI directly
|
|
122
|
-
*/
|
|
123
|
-
async useCursorCLI(task, workDir) {
|
|
124
|
-
if (!this.cursorPath) throw new Error("Cursor executable not found");
|
|
125
|
-
const specPath = join(workDir, "spec.ts");
|
|
126
|
-
const outputPath = join(workDir, "output.ts");
|
|
127
|
-
const instructionsPath = join(workDir, "INSTRUCTIONS.md");
|
|
128
|
-
await writeFile(specPath, task.specCode);
|
|
129
|
-
await writeFile(instructionsPath, this.buildDetailedPrompt(task));
|
|
130
|
-
if (task.existingCode) await writeFile(join(workDir, "existing.ts"), task.existingCode);
|
|
131
|
-
return new Promise((resolve, reject) => {
|
|
132
|
-
const args = [
|
|
133
|
-
"--wait",
|
|
134
|
-
"--new-window",
|
|
135
|
-
workDir
|
|
136
|
-
];
|
|
137
|
-
const cursor = spawn(this.cursorPath, args, {
|
|
138
|
-
cwd: workDir,
|
|
139
|
-
stdio: "pipe",
|
|
140
|
-
detached: false
|
|
141
|
-
});
|
|
142
|
-
let stdout = "";
|
|
143
|
-
let stderr = "";
|
|
144
|
-
cursor.stdout?.on("data", (data) => {
|
|
145
|
-
stdout += data.toString();
|
|
146
|
-
});
|
|
147
|
-
cursor.stderr?.on("data", (data) => {
|
|
148
|
-
stderr += data.toString();
|
|
149
|
-
});
|
|
150
|
-
cursor.on("error", (error) => {
|
|
151
|
-
reject(error);
|
|
152
|
-
});
|
|
153
|
-
cursor.on("close", async (code) => {
|
|
154
|
-
if (existsSync(outputPath)) try {
|
|
155
|
-
resolve({
|
|
156
|
-
success: true,
|
|
157
|
-
code: await readFile(outputPath, "utf-8"),
|
|
158
|
-
metadata: {
|
|
159
|
-
agentMode: "cursor",
|
|
160
|
-
method: "cli",
|
|
161
|
-
exitCode: code
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
} catch (error) {
|
|
165
|
-
reject(/* @__PURE__ */ new Error("Failed to read generated output"));
|
|
166
|
-
}
|
|
167
|
-
else reject(/* @__PURE__ */ new Error(`Cursor CLI exited with code ${code}. No output generated.`));
|
|
168
|
-
});
|
|
169
|
-
setTimeout(() => {
|
|
170
|
-
cursor.kill();
|
|
171
|
-
reject(/* @__PURE__ */ new Error("Cursor CLI timeout"));
|
|
172
|
-
}, 6e4);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* File-based approach - create workspace and instructions for manual completion
|
|
177
|
-
*/
|
|
178
|
-
async useFileBasedApproach(task, workDir) {
|
|
179
|
-
const specPath = join(workDir, "SPECIFICATION.ts");
|
|
180
|
-
const instructionsPath = join(workDir, "INSTRUCTIONS.md");
|
|
181
|
-
const templatePath = join(workDir, "template.ts");
|
|
182
|
-
await writeFile(specPath, task.specCode);
|
|
183
|
-
await writeFile(instructionsPath, this.buildDetailedPrompt(task));
|
|
184
|
-
await writeFile(templatePath, this.generateTemplate(task));
|
|
185
|
-
await writeFile(join(workDir, "README.md"), `# Cursor Agent Workspace
|
|
186
|
-
|
|
187
|
-
This workspace was prepared for Cursor AI code generation.
|
|
188
|
-
|
|
189
|
-
## Files:
|
|
190
|
-
- **SPECIFICATION.ts**: The contract specification
|
|
191
|
-
- **INSTRUCTIONS.md**: Detailed instructions for the AI
|
|
192
|
-
- **template.ts**: Starting template
|
|
193
|
-
|
|
194
|
-
## To Complete:
|
|
195
|
-
1. Open this folder in Cursor
|
|
196
|
-
2. Review INSTRUCTIONS.md
|
|
197
|
-
3. Use Cursor AI to generate code based on the spec
|
|
198
|
-
4. Save the result as output.ts
|
|
199
|
-
|
|
200
|
-
Workspace path: ${workDir}
|
|
201
|
-
`);
|
|
202
|
-
return {
|
|
203
|
-
success: false,
|
|
204
|
-
warnings: [
|
|
205
|
-
"Cursor agent created workspace but cannot auto-execute.",
|
|
206
|
-
`Workspace prepared at: ${workDir}`,
|
|
207
|
-
"Open this folder in Cursor IDE to complete code generation."
|
|
208
|
-
],
|
|
209
|
-
code: this.generateTemplate(task),
|
|
210
|
-
metadata: {
|
|
211
|
-
agentMode: "cursor",
|
|
212
|
-
method: "file-based",
|
|
213
|
-
workDir
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Setup workspace for validation
|
|
219
|
-
*/
|
|
220
|
-
async setupValidationWorkspace(task, workDir) {
|
|
221
|
-
await writeFile(join(workDir, "specification.ts"), task.specCode);
|
|
222
|
-
await writeFile(join(workDir, "implementation.ts"), task.existingCode || "// No implementation");
|
|
223
|
-
await writeFile(join(workDir, "VALIDATION_INSTRUCTIONS.md"), this.buildValidationPrompt(task));
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Prepare files for API submission
|
|
227
|
-
*/
|
|
228
|
-
async prepareFilesForAPI(task, workDir) {
|
|
229
|
-
const files = [{
|
|
230
|
-
path: "spec.ts",
|
|
231
|
-
content: task.specCode
|
|
232
|
-
}];
|
|
233
|
-
if (task.existingCode) files.push({
|
|
234
|
-
path: "existing.ts",
|
|
235
|
-
content: task.existingCode
|
|
236
|
-
});
|
|
237
|
-
return files;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Build detailed prompt for cursor
|
|
241
|
-
*/
|
|
242
|
-
buildDetailedPrompt(task) {
|
|
243
|
-
const header = `# AI Code Generation Task - Cursor Agent\n\n**Task Type:** ${task.type}\n**Generated:** ${(/* @__PURE__ */ new Date()).toISOString()}\n\n`;
|
|
244
|
-
const specification = `## Specification\n\n\`\`\`typescript\n${task.specCode}\n\`\`\`\n\n`;
|
|
245
|
-
const taskInstructions = {
|
|
246
|
-
generate: `## Task: Generate Implementation
|
|
247
|
-
|
|
248
|
-
### Requirements:
|
|
249
|
-
1. **Type Safety**: Use strict TypeScript with comprehensive types
|
|
250
|
-
2. **Error Handling**: Implement robust error handling and validation
|
|
251
|
-
3. **Documentation**: Add JSDoc comments for all public APIs
|
|
252
|
-
4. **Best Practices**: Follow SOLID principles and clean code practices
|
|
253
|
-
5. **Testing**: Design code to be easily testable
|
|
254
|
-
6. **Production Ready**: Code should be ready for production use
|
|
255
|
-
|
|
256
|
-
### Implementation Guidelines:
|
|
257
|
-
- Parse and validate all inputs according to the specification
|
|
258
|
-
- Handle all edge cases and error scenarios
|
|
259
|
-
- Use modern TypeScript features appropriately
|
|
260
|
-
- Ensure proper async/await usage if needed
|
|
261
|
-
- Add meaningful variable and function names
|
|
262
|
-
- Keep functions focused and single-purpose
|
|
263
|
-
|
|
264
|
-
### Output Format:
|
|
265
|
-
Provide complete, executable TypeScript code that fully implements the specification.
|
|
266
|
-
Include all necessary imports and type definitions.`,
|
|
267
|
-
validate: `## Task: Validate Implementation
|
|
268
|
-
|
|
269
|
-
### Current Implementation:
|
|
270
|
-
\`\`\`typescript
|
|
271
|
-
${task.existingCode || "// No implementation provided"}
|
|
272
|
-
\`\`\`
|
|
273
|
-
|
|
274
|
-
### Validation Criteria:
|
|
275
|
-
1. **Specification Compliance**: Does it match all requirements?
|
|
276
|
-
2. **Type Safety**: Are all types correct and complete?
|
|
277
|
-
3. **Error Handling**: Is error handling adequate?
|
|
278
|
-
4. **Code Quality**: Does it follow best practices?
|
|
279
|
-
5. **Completeness**: Are there missing features?
|
|
280
|
-
|
|
281
|
-
### Review Checklist:
|
|
282
|
-
- [ ] All specified inputs/outputs are handled
|
|
283
|
-
- [ ] Types match the specification exactly
|
|
284
|
-
- [ ] Error cases are properly handled
|
|
285
|
-
- [ ] Code is production-ready
|
|
286
|
-
- [ ] No obvious bugs or issues
|
|
287
|
-
- [ ] Performance is acceptable
|
|
288
|
-
- [ ] Code is maintainable
|
|
289
|
-
|
|
290
|
-
### Output Format:
|
|
291
|
-
Provide a detailed validation report with:
|
|
292
|
-
- **Status**: Pass/Fail
|
|
293
|
-
- **Issues Found**: List all problems
|
|
294
|
-
- **Recommendations**: Specific improvements needed
|
|
295
|
-
- **Code Quality Score**: Rate the implementation`,
|
|
296
|
-
test: `## Task: Generate Tests
|
|
297
|
-
|
|
298
|
-
### Implementation to Test:
|
|
299
|
-
\`\`\`typescript
|
|
300
|
-
${task.existingCode || ""}
|
|
301
|
-
\`\`\`
|
|
302
|
-
|
|
303
|
-
### Test Requirements:
|
|
304
|
-
1. **Coverage**: Test all code paths and edge cases
|
|
305
|
-
2. **Framework**: Use Vitest
|
|
306
|
-
3. **Structure**: Organize tests logically (describe/it blocks)
|
|
307
|
-
4. **Assertions**: Use clear, meaningful assertions
|
|
308
|
-
5. **Mocking**: Mock external dependencies appropriately
|
|
309
|
-
|
|
310
|
-
### Test Categories Needed:
|
|
311
|
-
- Unit tests for individual functions
|
|
312
|
-
- Integration tests for workflows
|
|
313
|
-
- Edge case tests
|
|
314
|
-
- Error handling tests
|
|
315
|
-
- Performance tests (if applicable)
|
|
316
|
-
|
|
317
|
-
### Output Format:
|
|
318
|
-
Complete Vitest test file with comprehensive test coverage.`,
|
|
319
|
-
refactor: `## Task: Refactor Code
|
|
320
|
-
|
|
321
|
-
### Current Code:
|
|
322
|
-
\`\`\`typescript
|
|
323
|
-
${task.existingCode || ""}
|
|
324
|
-
\`\`\`
|
|
325
|
-
|
|
326
|
-
### Refactoring Goals:
|
|
327
|
-
1. **Maintainability**: Improve code organization and readability
|
|
328
|
-
2. **Performance**: Optimize where beneficial
|
|
329
|
-
3. **Type Safety**: Enhance type definitions
|
|
330
|
-
4. **Error Handling**: Improve error handling robustness
|
|
331
|
-
5. **Documentation**: Add missing documentation
|
|
332
|
-
|
|
333
|
-
### Refactoring Guidelines:
|
|
334
|
-
- Preserve all existing functionality
|
|
335
|
-
- Extract reusable components
|
|
336
|
-
- Eliminate code duplication
|
|
337
|
-
- Improve naming and structure
|
|
338
|
-
- Add type guards where beneficial
|
|
339
|
-
- Enhance error messages
|
|
340
|
-
|
|
341
|
-
### Output Format:
|
|
342
|
-
Refactored code that maintains functionality while improving quality.`
|
|
343
|
-
};
|
|
344
|
-
return header + specification + (taskInstructions[task.type] || taskInstructions.generate);
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Build validation-specific prompt
|
|
348
|
-
*/
|
|
349
|
-
buildValidationPrompt(task) {
|
|
350
|
-
return `# Implementation Validation Report
|
|
351
|
-
|
|
352
|
-
## Specification
|
|
353
|
-
\`\`\`typescript
|
|
354
|
-
${task.specCode}
|
|
355
|
-
\`\`\`
|
|
356
|
-
|
|
357
|
-
## Implementation
|
|
358
|
-
\`\`\`typescript
|
|
359
|
-
${task.existingCode || "// No implementation"}
|
|
360
|
-
\`\`\`
|
|
361
|
-
|
|
362
|
-
## Validation Checklist
|
|
363
|
-
|
|
364
|
-
### 1. Specification Compliance
|
|
365
|
-
- [ ] All required features implemented
|
|
366
|
-
- [ ] Input/output types match specification
|
|
367
|
-
- [ ] Behavior matches documented requirements
|
|
368
|
-
|
|
369
|
-
### 2. Code Quality
|
|
370
|
-
- [ ] Follows TypeScript best practices
|
|
371
|
-
- [ ] Proper error handling
|
|
372
|
-
- [ ] Meaningful variable names
|
|
373
|
-
- [ ] Appropriate code organization
|
|
374
|
-
|
|
375
|
-
### 3. Type Safety
|
|
376
|
-
- [ ] No type assertions (as) unless necessary
|
|
377
|
-
- [ ] Proper generic usage
|
|
378
|
-
- [ ] Complete type coverage
|
|
379
|
-
|
|
380
|
-
### 4. Production Readiness
|
|
381
|
-
- [ ] No console.log statements
|
|
382
|
-
- [ ] Proper error handling
|
|
383
|
-
- [ ] Edge cases covered
|
|
384
|
-
- [ ] Performance considerations
|
|
385
|
-
|
|
386
|
-
### 5. Maintainability
|
|
387
|
-
- [ ] Clear documentation
|
|
388
|
-
- [ ] Testable code structure
|
|
389
|
-
- [ ] No code smells
|
|
390
|
-
- [ ] SOLID principles followed
|
|
391
|
-
|
|
392
|
-
## Instructions
|
|
393
|
-
Review the implementation against the specification and complete the checklist.
|
|
394
|
-
Provide detailed feedback for each failed item.
|
|
395
|
-
Suggest specific improvements with code examples where applicable.`;
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Generate basic template for task
|
|
399
|
-
*/
|
|
400
|
-
generateTemplate(task) {
|
|
401
|
-
return `// Auto-generated template for ${task.type} task
|
|
402
|
-
// Specification:
|
|
403
|
-
${task.specCode.split("\n").map((line) => `// ${line}`).join("\n")}
|
|
404
|
-
|
|
405
|
-
// TODO: Implement according to specification
|
|
406
|
-
// Use Cursor AI to complete this implementation
|
|
407
|
-
|
|
408
|
-
export function implementation() {
|
|
409
|
-
// Implementation goes here
|
|
410
|
-
throw new Error('Not implemented');
|
|
411
|
-
}
|
|
412
|
-
`;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Cleanup temporary work directory
|
|
416
|
-
*/
|
|
417
|
-
async cleanupWorkDir(workDir) {
|
|
418
|
-
try {
|
|
419
|
-
await rm(workDir, {
|
|
420
|
-
recursive: true,
|
|
421
|
-
force: true
|
|
422
|
-
});
|
|
423
|
-
} catch {}
|
|
424
|
-
}
|
|
425
|
-
isCursorAvailable() {
|
|
426
|
-
return this.isWindsurf || this.cursorPath !== null || this.hasComposerAPI();
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* Check if Cursor Composer API might be available
|
|
430
|
-
*/
|
|
431
|
-
hasComposerAPI() {
|
|
432
|
-
return !!(process.env.CURSOR_COMPOSER_PORT || process.env.CURSOR_API_ENABLED || this.isWindsurf);
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
//#endregion
|
|
437
|
-
export { CursorAgent };
|
package/dist/ai/agents/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { SimpleAgent } from "./simple-agent.js";
|
|
2
|
-
import { CursorAgent } from "./cursor-agent.js";
|
|
3
|
-
import { ClaudeCodeAgent } from "./claude-code-agent.js";
|
|
4
|
-
import { OpenAICodexAgent } from "./openai-codex-agent.js";
|
|
5
|
-
import { AgentOrchestrator } from "./orchestrator.js";
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { openai } from "@ai-sdk/openai";
|
|
2
|
-
import { generateText } from "ai";
|
|
3
|
-
|
|
4
|
-
//#region src/ai/agents/openai-codex-agent.ts
|
|
5
|
-
/**
|
|
6
|
-
* OpenAI Codex Agent - Uses OpenAI's code-optimized models
|
|
7
|
-
* Supports GPT-4o and o1 reasoning models for complex code generation
|
|
8
|
-
*/
|
|
9
|
-
var OpenAICodexAgent = class {
|
|
10
|
-
name = "openai-codex";
|
|
11
|
-
apiKey;
|
|
12
|
-
constructor() {
|
|
13
|
-
this.apiKey = process.env.OPENAI_API_KEY;
|
|
14
|
-
}
|
|
15
|
-
canHandle(task) {
|
|
16
|
-
return !!this.apiKey;
|
|
17
|
-
}
|
|
18
|
-
async generate(task) {
|
|
19
|
-
if (!this.apiKey) return {
|
|
20
|
-
success: false,
|
|
21
|
-
errors: ["OPENAI_API_KEY not set. OpenAI Codex agent requires API access."]
|
|
22
|
-
};
|
|
23
|
-
try {
|
|
24
|
-
const modelName = this.isComplexTask(task) ? "o1" : "gpt-4o";
|
|
25
|
-
const model = openai(modelName);
|
|
26
|
-
const systemPrompt = this.buildSystemPrompt(task);
|
|
27
|
-
const result = await generateText({
|
|
28
|
-
model,
|
|
29
|
-
prompt: this.buildUserPrompt(task),
|
|
30
|
-
system: systemPrompt,
|
|
31
|
-
temperature: .2
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
success: true,
|
|
35
|
-
code: this.extractCode(result.text),
|
|
36
|
-
metadata: {
|
|
37
|
-
model: modelName,
|
|
38
|
-
agentMode: "openai-codex",
|
|
39
|
-
usage: result.usage
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
} catch (error) {
|
|
43
|
-
return {
|
|
44
|
-
success: false,
|
|
45
|
-
errors: [error instanceof Error ? error.message : String(error)]
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
async validate(task) {
|
|
50
|
-
if (!this.apiKey) return {
|
|
51
|
-
success: false,
|
|
52
|
-
errors: ["OPENAI_API_KEY not set"]
|
|
53
|
-
};
|
|
54
|
-
try {
|
|
55
|
-
const result = await generateText({
|
|
56
|
-
model: openai("gpt-4o"),
|
|
57
|
-
prompt: `
|
|
58
|
-
Review this code implementation against its specification.
|
|
59
|
-
|
|
60
|
-
SPECIFICATION:
|
|
61
|
-
\`\`\`typescript
|
|
62
|
-
${task.specCode}
|
|
63
|
-
\`\`\`
|
|
64
|
-
|
|
65
|
-
IMPLEMENTATION:
|
|
66
|
-
\`\`\`typescript
|
|
67
|
-
${task.existingCode || "// No implementation"}
|
|
68
|
-
\`\`\`
|
|
69
|
-
|
|
70
|
-
Provide a detailed validation report including:
|
|
71
|
-
1. Specification compliance
|
|
72
|
-
2. Code quality assessment
|
|
73
|
-
3. Potential bugs or issues
|
|
74
|
-
4. Recommendations for improvement
|
|
75
|
-
|
|
76
|
-
Format as a structured report.
|
|
77
|
-
`,
|
|
78
|
-
system: "You are a senior software engineer performing thorough code review.",
|
|
79
|
-
temperature: .3
|
|
80
|
-
});
|
|
81
|
-
const hasIssues = this.detectIssues(result.text);
|
|
82
|
-
return {
|
|
83
|
-
success: !hasIssues,
|
|
84
|
-
code: result.text,
|
|
85
|
-
errors: hasIssues ? this.extractErrors(result.text) : [],
|
|
86
|
-
warnings: this.extractWarnings(result.text),
|
|
87
|
-
metadata: {
|
|
88
|
-
agentMode: "openai-codex",
|
|
89
|
-
validationType: "ai-review"
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
} catch (error) {
|
|
93
|
-
return {
|
|
94
|
-
success: false,
|
|
95
|
-
errors: [error instanceof Error ? error.message : String(error)]
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
isComplexTask(task) {
|
|
100
|
-
const complexIndicators = [
|
|
101
|
-
"algorithm",
|
|
102
|
-
"optimization",
|
|
103
|
-
"complex logic",
|
|
104
|
-
"state management",
|
|
105
|
-
"concurrent",
|
|
106
|
-
"distributed"
|
|
107
|
-
];
|
|
108
|
-
const taskStr = (task.specCode + (task.existingCode || "")).toLowerCase();
|
|
109
|
-
return complexIndicators.some((indicator) => taskStr.includes(indicator));
|
|
110
|
-
}
|
|
111
|
-
buildSystemPrompt(task) {
|
|
112
|
-
const basePrompt = `You are an expert TypeScript/JavaScript developer.
|
|
113
|
-
|
|
114
|
-
Generate production-quality code that is:
|
|
115
|
-
- Type-safe and well-typed
|
|
116
|
-
- Documented with clear comments
|
|
117
|
-
- Following best practices and SOLID principles
|
|
118
|
-
- Properly handling errors and edge cases
|
|
119
|
-
- Testable and maintainable
|
|
120
|
-
|
|
121
|
-
Output only the code without explanations unless specifically asked.`;
|
|
122
|
-
if (task.type === "test") return basePrompt + "\n\nGenerate comprehensive test suites using Vitest.";
|
|
123
|
-
return basePrompt;
|
|
124
|
-
}
|
|
125
|
-
buildUserPrompt(task) {
|
|
126
|
-
switch (task.type) {
|
|
127
|
-
case "generate": return `Implement this specification:\n\n${task.specCode}\n\nProvide complete, production-ready TypeScript code.`;
|
|
128
|
-
case "test": return `Create comprehensive tests:\n\nSpec:\n${task.specCode}\n\nImplementation:\n${task.existingCode}\n\nGenerate complete Vitest test suite.`;
|
|
129
|
-
case "refactor": return `Refactor this code while maintaining functionality:\n\n${task.existingCode}\n\nSpec:\n${task.specCode}`;
|
|
130
|
-
default: return task.specCode;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
extractCode(text) {
|
|
134
|
-
const match = text.match(/```(?:typescript|ts|tsx|javascript|js)?\n([\s\S]*?)\n```/);
|
|
135
|
-
return match && match[1] ? match[1] : text;
|
|
136
|
-
}
|
|
137
|
-
detectIssues(text) {
|
|
138
|
-
const issueKeywords = [
|
|
139
|
-
"issue",
|
|
140
|
-
"problem",
|
|
141
|
-
"bug",
|
|
142
|
-
"error",
|
|
143
|
-
"incorrect",
|
|
144
|
-
"missing",
|
|
145
|
-
"fails",
|
|
146
|
-
"violation"
|
|
147
|
-
];
|
|
148
|
-
const lower = text.toLowerCase();
|
|
149
|
-
return issueKeywords.some((keyword) => lower.includes(keyword));
|
|
150
|
-
}
|
|
151
|
-
extractErrors(text) {
|
|
152
|
-
const errors = [];
|
|
153
|
-
const lines = text.split("\n");
|
|
154
|
-
for (const line of lines) if (line.toLowerCase().includes("error") || line.toLowerCase().includes("bug") || line.toLowerCase().includes("fails")) errors.push(line.trim());
|
|
155
|
-
return errors;
|
|
156
|
-
}
|
|
157
|
-
extractWarnings(text) {
|
|
158
|
-
const warnings = [];
|
|
159
|
-
const lines = text.split("\n");
|
|
160
|
-
for (const line of lines) if (line.toLowerCase().includes("warning") || line.toLowerCase().includes("should") || line.toLowerCase().includes("consider")) warnings.push(line.trim());
|
|
161
|
-
return warnings;
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
//#endregion
|
|
166
|
-
export { OpenAICodexAgent };
|