@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217083314 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +1 -22
- package/dist/adapters/ai.js +1 -82
- package/dist/adapters/factory.js +1 -36
- package/dist/adapters/fs.js +1 -118
- package/dist/adapters/git.js +1 -54
- package/dist/adapters/index.js +1 -7
- package/dist/adapters/logger.js +1 -80
- package/dist/adapters/watcher.js +1 -69
- package/dist/adapters/workspace.js +2 -190
- package/dist/ai/agents/claude-code-agent.js +9 -146
- package/dist/ai/agents/cursor-agent.js +17 -286
- package/dist/ai/agents/index.js +1 -5
- package/dist/ai/agents/openai-codex-agent.js +8 -140
- package/dist/ai/agents/orchestrator.js +1 -142
- package/dist/ai/agents/simple-agent.js +4 -80
- package/dist/ai/client.js +1 -162
- package/dist/ai/index.js +1 -27
- package/dist/ai/prompts/code-generation.js +13 -55
- package/dist/ai/prompts/index.js +1 -12
- package/dist/ai/prompts/spec-creation.js +20 -61
- package/dist/ai/providers.js +1 -40
- package/dist/formatters/index.js +1 -18
- package/dist/formatters/json.js +1 -71
- package/dist/formatters/sarif.js +1 -163
- package/dist/formatters/text.js +2 -208
- package/dist/index.js +1 -81
- package/dist/node_modules/@ai-sdk/anthropic/dist/index.js +1 -0
- package/dist/node_modules/@ai-sdk/openai/dist/index.js +11 -0
- package/dist/node_modules/@ai-sdk/provider/dist/index.js +3 -0
- package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +5 -0
- package/dist/node_modules/chalk/source/index.js +2 -0
- package/dist/node_modules/chalk/source/utilities.js +4 -0
- package/dist/node_modules/chalk/source/vendor/ansi-styles/index.js +1 -0
- package/dist/node_modules/chalk/source/vendor/supports-color/browser.js +1 -0
- package/dist/node_modules/cli-cursor/index.js +1 -0
- package/dist/node_modules/cli-spinners/index.js +1 -0
- package/dist/node_modules/cli-spinners/spinners.js +1 -0
- package/dist/node_modules/eventsource-parser/dist/index.js +5 -0
- package/dist/node_modules/eventsource-parser/dist/stream.js +1 -0
- package/dist/node_modules/get-east-asian-width/index.js +1 -0
- package/dist/node_modules/get-east-asian-width/lookup.js +1 -0
- package/dist/node_modules/is-interactive/index.js +1 -0
- package/dist/node_modules/is-unicode-supported/index.js +1 -0
- package/dist/node_modules/log-symbols/browser-symbols.js +1 -0
- package/dist/node_modules/mimic-function/index.js +1 -0
- package/dist/node_modules/onetime/index.js +1 -0
- package/dist/node_modules/ora/index.js +6 -0
- package/dist/node_modules/restore-cursor/index.js +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/index.js +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/signals.js +1 -0
- package/dist/node_modules/stdin-discarder/index.js +1 -0
- package/dist/node_modules/string-width/index.js +1 -0
- package/dist/node_modules/strip-ansi/index.js +1 -0
- package/dist/node_modules/strip-ansi/node_modules/ansi-regex/index.js +1 -0
- package/dist/services/agent-guide/adapters/claude-code.js +3 -144
- package/dist/services/agent-guide/adapters/cursor-cli.js +3 -135
- package/dist/services/agent-guide/adapters/generic-mcp.js +3 -159
- package/dist/services/agent-guide/adapters/index.js +1 -30
- package/dist/services/agent-guide/agent-guide-service.js +1 -148
- package/dist/services/agent-guide/index.js +1 -5
- package/dist/services/build.js +1 -140
- package/dist/services/ci-check/ci-check-service.js +1 -393
- package/dist/services/ci-check/index.js +1 -2
- package/dist/services/ci-check/types.js +1 -28
- package/dist/services/clean.js +1 -71
- package/dist/services/config.js +1 -76
- package/dist/services/deps.js +1 -62
- package/dist/services/diff.js +1 -33
- package/dist/services/doctor/checks/ai.js +2 -118
- package/dist/services/doctor/checks/cli.js +1 -146
- package/dist/services/doctor/checks/config.js +1 -170
- package/dist/services/doctor/checks/deps.js +1 -180
- package/dist/services/doctor/checks/index.js +1 -6
- package/dist/services/doctor/checks/mcp.js +1 -144
- package/dist/services/doctor/checks/workspace.js +1 -243
- package/dist/services/doctor/doctor-service.js +2 -115
- package/dist/services/doctor/index.js +1 -2
- package/dist/services/doctor/types.js +1 -26
- package/dist/services/implementation/discovery.js +2 -143
- package/dist/services/implementation/index.js +1 -2
- package/dist/services/implementation/resolver.js +1 -223
- package/dist/services/index.js +1 -53
- package/dist/services/integrity-diagram.js +6 -274
- package/dist/services/integrity.js +1 -272
- package/dist/services/list.js +1 -35
- package/dist/services/openapi/export-service.js +2 -51
- package/dist/services/openapi/import-service.js +1 -75
- package/dist/services/openapi/index.js +1 -4
- package/dist/services/openapi/sync-service.js +1 -121
- package/dist/services/openapi/validate-service.js +1 -130
- package/dist/services/regenerator.js +1 -23
- package/dist/services/registry.js +1 -73
- package/dist/services/setup/config-generators.js +26 -113
- package/dist/services/setup/file-merger.js +2 -60
- package/dist/services/setup/index.js +1 -4
- package/dist/services/setup/setup-service.js +1 -95
- package/dist/services/setup/targets/agents-md.js +1 -46
- package/dist/services/setup/targets/cli-config.js +1 -59
- package/dist/services/setup/targets/cursor-rules.js +1 -47
- package/dist/services/setup/targets/mcp-claude.js +1 -59
- package/dist/services/setup/targets/mcp-cursor.js +1 -58
- package/dist/services/setup/targets/vscode-settings.js +1 -62
- package/dist/services/setup/types.js +1 -26
- package/dist/services/sync.js +1 -62
- package/dist/services/test.js +1 -30
- package/dist/services/validate-implementation.js +1 -69
- package/dist/services/validate.js +1 -47
- package/dist/services/verification-cache/adapters/filesystem.js +1 -121
- package/dist/services/verification-cache/adapters/in-memory.js +1 -45
- package/dist/services/verification-cache/adapters/index.js +1 -3
- package/dist/services/verification-cache/adapters/workspace-state.js +1 -90
- package/dist/services/verification-cache/cache-service.js +1 -255
- package/dist/services/verification-cache/index.js +1 -6
- package/dist/services/verification-cache/types.js +1 -15
- package/dist/services/verify/ai-verifier.js +9 -336
- package/dist/services/verify/behavior-verifier.js +1 -185
- package/dist/services/verify/index.js +1 -4
- package/dist/services/verify/structure-verifier.js +2 -195
- package/dist/services/verify/verify-service.js +3 -203
- package/dist/services/watch.js +1 -31
- package/dist/services/workspace-info.js +2 -102
- package/dist/templates/app-config.template.js +28 -101
- package/dist/templates/data-view.template.js +27 -42
- package/dist/templates/event.template.js +14 -29
- package/dist/templates/experiment.template.js +51 -77
- package/dist/templates/handler.template.js +17 -53
- package/dist/templates/index.js +1 -36
- package/dist/templates/integration.template.js +50 -134
- package/dist/templates/knowledge.template.js +21 -62
- package/dist/templates/migration.template.js +26 -50
- package/dist/templates/operation.template.js +28 -44
- package/dist/templates/presentation.template.js +20 -46
- package/dist/templates/telemetry.template.js +53 -74
- package/dist/templates/workflow-runner.template.js +6 -12
- package/dist/templates/workflow.template.js +24 -51
- package/package.json +10 -16
- package/dist/adapters/ai.d.ts +0 -11
- package/dist/adapters/factory.d.ts +0 -28
- package/dist/adapters/fs.d.ts +0 -10
- package/dist/adapters/git.d.ts +0 -10
- package/dist/adapters/logger.d.ts +0 -17
- package/dist/adapters/watcher.d.ts +0 -10
- package/dist/adapters/workspace.d.ts +0 -93
- package/dist/ai/agents/claude-code-agent.d.ts +0 -21
- package/dist/ai/agents/cursor-agent.d.ts +0 -67
- package/dist/ai/agents/openai-codex-agent.d.ts +0 -21
- package/dist/ai/agents/orchestrator.d.ts +0 -49
- package/dist/ai/agents/simple-agent.d.ts +0 -16
- package/dist/ai/agents/types.d.ts +0 -35
- package/dist/ai/client.d.ts +0 -82
- package/dist/ai/index.d.ts +0 -16
- package/dist/ai/prompts/code-generation.d.ts +0 -25
- package/dist/ai/prompts/index.d.ts +0 -9
- package/dist/ai/prompts/spec-creation.d.ts +0 -28
- package/dist/ai/providers.d.ts +0 -28
- package/dist/formatters/index.d.ts +0 -10
- package/dist/formatters/json.d.ts +0 -88
- package/dist/formatters/sarif.d.ts +0 -100
- package/dist/formatters/text.d.ts +0 -34
- package/dist/index.d.ts +0 -66
- package/dist/libs/ai-providers/dist/factory.js +0 -154
- package/dist/libs/ai-providers/dist/index.js +0 -4
- package/dist/libs/ai-providers/dist/legacy.js +0 -72
- package/dist/libs/ai-providers/dist/models.js +0 -287
- package/dist/libs/ai-providers/dist/validation.js +0 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -8
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -72
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -24
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -352
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -211
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -75
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -2
- package/dist/libs/contracts/dist/regenerator/service.js +0 -92
- package/dist/libs/contracts/dist/regenerator/utils.js +0 -51
- package/dist/libs/contracts/dist/registry.js +0 -208
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -35
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -150
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/contracts-transformers/dist/common/utils.js +0 -47
- package/dist/libs/contracts-transformers/dist/openapi/exporter.js +0 -1
- package/dist/libs/contracts-transformers/dist/openapi/importer.js +0 -255
- package/dist/libs/contracts-transformers/dist/openapi/index.js +0 -4
- package/dist/libs/contracts-transformers/dist/openapi/parser.js +0 -231
- package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +0 -201
- package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +0 -137
- package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +0 -101
- package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +0 -84
- package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +0 -30
- package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +0 -96
- package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +0 -151
- package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +0 -344
- package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +0 -122
- package/dist/modules/contractspec-workspace/dist/templates/app-config.js +0 -105
- package/dist/modules/contractspec-workspace/dist/templates/data-view.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/event.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/experiment.js +0 -87
- package/dist/modules/contractspec-workspace/dist/templates/handler.js +0 -95
- package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +0 -104
- package/dist/modules/contractspec-workspace/dist/templates/integration.js +0 -62
- package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +0 -68
- package/dist/modules/contractspec-workspace/dist/templates/migration.js +0 -60
- package/dist/modules/contractspec-workspace/dist/templates/operation.js +0 -100
- package/dist/modules/contractspec-workspace/dist/templates/presentation.js +0 -78
- package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +0 -89
- package/dist/modules/contractspec-workspace/dist/templates/utils.js +0 -38
- package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +0 -48
- package/dist/modules/contractspec-workspace/dist/templates/workflow.js +0 -67
- package/dist/modules/contractspec-workspace/dist/types/generation-types.js +0 -20
- package/dist/ports/ai.d.ts +0 -58
- package/dist/ports/fs.d.ts +0 -80
- package/dist/ports/git.d.ts +0 -32
- package/dist/ports/logger.d.ts +0 -87
- package/dist/ports/watcher.d.ts +0 -51
- package/dist/services/agent-guide/adapters/claude-code.d.ts +0 -34
- package/dist/services/agent-guide/adapters/cursor-cli.d.ts +0 -38
- package/dist/services/agent-guide/adapters/generic-mcp.d.ts +0 -52
- package/dist/services/agent-guide/adapters/index.d.ts +0 -22
- package/dist/services/agent-guide/agent-guide-service.d.ts +0 -55
- package/dist/services/agent-guide/types.d.ts +0 -57
- package/dist/services/build.d.ts +0 -58
- package/dist/services/ci-check/ci-check-service.d.ts +0 -15
- package/dist/services/ci-check/types.d.ts +0 -142
- package/dist/services/clean.d.ts +0 -40
- package/dist/services/config.d.ts +0 -25
- package/dist/services/deps.d.ts +0 -52
- package/dist/services/diff.d.ts +0 -33
- package/dist/services/doctor/doctor-service.d.ts +0 -23
- package/dist/services/doctor/types.d.ts +0 -117
- package/dist/services/implementation/discovery.d.ts +0 -29
- package/dist/services/implementation/resolver.d.ts +0 -43
- package/dist/services/implementation/types.d.ts +0 -78
- package/dist/services/integrity-diagram.d.ts +0 -35
- package/dist/services/integrity.d.ts +0 -133
- package/dist/services/list.d.ts +0 -30
- package/dist/services/openapi/export-service.d.ts +0 -52
- package/dist/services/openapi/import-service.d.ts +0 -15
- package/dist/services/openapi/sync-service.d.ts +0 -18
- package/dist/services/openapi/types.d.ts +0 -184
- package/dist/services/openapi/validate-service.d.ts +0 -15
- package/dist/services/regenerator.d.ts +0 -17
- package/dist/services/registry.d.ts +0 -52
- package/dist/services/setup/config-generators.d.ts +0 -41
- package/dist/services/setup/file-merger.d.ts +0 -26
- package/dist/services/setup/setup-service.d.ts +0 -11
- package/dist/services/setup/types.d.ts +0 -84
- package/dist/services/sync.d.ts +0 -40
- package/dist/services/test.d.ts +0 -14
- package/dist/services/validate-implementation.d.ts +0 -31
- package/dist/services/validate.d.ts +0 -40
- package/dist/services/verification-cache/adapters/filesystem.d.ts +0 -45
- package/dist/services/verification-cache/adapters/in-memory.d.ts +0 -26
- package/dist/services/verification-cache/adapters/workspace-state.d.ts +0 -48
- package/dist/services/verification-cache/cache-service.d.ts +0 -69
- package/dist/services/verification-cache/types.d.ts +0 -123
- package/dist/services/verify/ai-verifier.d.ts +0 -24
- package/dist/services/verify/behavior-verifier.d.ts +0 -11
- package/dist/services/verify/structure-verifier.d.ts +0 -11
- package/dist/services/verify/types.d.ts +0 -136
- package/dist/services/verify/verify-service.d.ts +0 -59
- package/dist/services/watch.d.ts +0 -24
- package/dist/services/workspace-info.d.ts +0 -61
- package/dist/templates/app-config.template.d.ts +0 -6
- package/dist/templates/data-view.template.d.ts +0 -6
- package/dist/templates/event.template.d.ts +0 -10
- package/dist/templates/experiment.template.d.ts +0 -6
- package/dist/templates/handler.template.d.ts +0 -15
- package/dist/templates/index.d.ts +0 -20
- package/dist/templates/integration.template.d.ts +0 -6
- package/dist/templates/knowledge.template.d.ts +0 -6
- package/dist/templates/migration.template.d.ts +0 -6
- package/dist/templates/operation.template.d.ts +0 -10
- package/dist/templates/presentation.template.d.ts +0 -10
- package/dist/templates/telemetry.template.d.ts +0 -6
- package/dist/templates/workflow-runner.template.d.ts +0 -15
- package/dist/templates/workflow.template.d.ts +0 -6
- package/dist/types/config.d.ts +0 -33
- package/dist/types.d.ts +0 -323
|
@@ -1,70 +1,14 @@
|
|
|
1
|
-
import
|
|
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: `
|
|
1
|
+
import{openai as e}from"../../node_modules/@ai-sdk/openai/dist/index.js";import{generateText as t}from"ai";var n=class{name=`openai-codex`;apiKey;constructor(){this.apiKey=process.env.OPENAI_API_KEY}canHandle(e){return!!this.apiKey}async generate(n){if(!this.apiKey)return{success:!1,errors:[`OPENAI_API_KEY not set. OpenAI Codex agent requires API access.`]};try{let r=this.isComplexTask(n)?`o1`:`gpt-4o`,i=e(r),a=this.buildSystemPrompt(n),o=await t({model:i,prompt:this.buildUserPrompt(n),system:a,temperature:.2});return{success:!0,code:this.extractCode(o.text),metadata:{model:r,agentMode:`openai-codex`,usage:o.usage}}}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}async validate(n){if(!this.apiKey)return{success:!1,errors:[`OPENAI_API_KEY not set`]};try{let r=await t({model:e(`gpt-4o`),prompt:`
|
|
58
2
|
Review this code implementation against its specification.
|
|
59
3
|
|
|
60
4
|
SPECIFICATION:
|
|
61
5
|
\`\`\`typescript
|
|
62
|
-
${
|
|
6
|
+
${n.specCode}
|
|
63
7
|
\`\`\`
|
|
64
8
|
|
|
65
9
|
IMPLEMENTATION:
|
|
66
10
|
\`\`\`typescript
|
|
67
|
-
${
|
|
11
|
+
${n.existingCode||`// No implementation`}
|
|
68
12
|
\`\`\`
|
|
69
13
|
|
|
70
14
|
Provide a detailed validation report including:
|
|
@@ -74,42 +18,7 @@ Provide a detailed validation report including:
|
|
|
74
18
|
4. Recommendations for improvement
|
|
75
19
|
|
|
76
20
|
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.
|
|
21
|
+
`,system:`You are a senior software engineer performing thorough code review.`,temperature:.3}),i=this.detectIssues(r.text);return{success:!i,code:r.text,errors:i?this.extractErrors(r.text):[],warnings:this.extractWarnings(r.text),metadata:{agentMode:`openai-codex`,validationType:`ai-review`}}}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}isComplexTask(e){let t=[`algorithm`,`optimization`,`complex logic`,`state management`,`concurrent`,`distributed`],n=(e.specCode+(e.existingCode||``)).toLowerCase();return t.some(e=>n.includes(e))}buildSystemPrompt(e){let t=`You are an expert TypeScript/JavaScript developer.
|
|
113
22
|
|
|
114
23
|
Generate production-quality code that is:
|
|
115
24
|
- Type-safe and well-typed
|
|
@@ -118,49 +27,8 @@ Generate production-quality code that is:
|
|
|
118
27
|
- Properly handling errors and edge cases
|
|
119
28
|
- Testable and maintainable
|
|
120
29
|
|
|
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
|
-
};
|
|
30
|
+
Output only the code without explanations unless specifically asked.`;return e.type===`test`?t+`
|
|
164
31
|
|
|
165
|
-
|
|
166
|
-
|
|
32
|
+
Generate comprehensive test suites using Vitest.`:t}buildUserPrompt(e){switch(e.type){case`generate`:return`Implement this specification:\n\n${e.specCode}\n\nProvide complete, production-ready TypeScript code.`;case`test`:return`Create comprehensive tests:\n\nSpec:\n${e.specCode}\n\nImplementation:\n${e.existingCode}\n\nGenerate complete Vitest test suite.`;case`refactor`:return`Refactor this code while maintaining functionality:\n\n${e.existingCode}\n\nSpec:\n${e.specCode}`;default:return e.specCode}}extractCode(e){let t=e.match(/```(?:typescript|ts|tsx|javascript|js)?\n([\s\S]*?)\n```/);return t&&t[1]?t[1]:e}detectIssues(e){let t=[`issue`,`problem`,`bug`,`error`,`incorrect`,`missing`,`fails`,`violation`],n=e.toLowerCase();return t.some(e=>n.includes(e))}extractErrors(e){let t=[],n=e.split(`
|
|
33
|
+
`);for(let e of n)(e.toLowerCase().includes(`error`)||e.toLowerCase().includes(`bug`)||e.toLowerCase().includes(`fails`))&&t.push(e.trim());return t}extractWarnings(e){let t=[],n=e.split(`
|
|
34
|
+
`);for(let e of n)(e.toLowerCase().includes(`warning`)||e.toLowerCase().includes(`should`)||e.toLowerCase().includes(`consider`))&&t.push(e.trim());return t}};export{n as OpenAICodexAgent};
|
|
@@ -1,142 +1 @@
|
|
|
1
|
-
import {
|
|
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 chalk from "chalk";
|
|
6
|
-
import ora from "ora";
|
|
7
|
-
|
|
8
|
-
//#region src/ai/agents/orchestrator.ts
|
|
9
|
-
/**
|
|
10
|
-
* Agent Orchestrator - Coordinates between different AI agents
|
|
11
|
-
* Selects the appropriate agent based on config and task requirements
|
|
12
|
-
*/
|
|
13
|
-
var AgentOrchestrator = class {
|
|
14
|
-
agents;
|
|
15
|
-
defaultAgent;
|
|
16
|
-
constructor(config) {
|
|
17
|
-
this.config = config;
|
|
18
|
-
this.agents = /* @__PURE__ */ new Map();
|
|
19
|
-
const simpleAgent = new SimpleAgent(config);
|
|
20
|
-
const cursorAgent = new CursorAgent();
|
|
21
|
-
const claudeAgent = new ClaudeCodeAgent();
|
|
22
|
-
const openaiAgent = new OpenAICodexAgent();
|
|
23
|
-
this.agents.set("simple", simpleAgent);
|
|
24
|
-
this.agents.set("cursor", cursorAgent);
|
|
25
|
-
this.agents.set("claude-code", claudeAgent);
|
|
26
|
-
this.agents.set("openai-codex", openaiAgent);
|
|
27
|
-
this.defaultAgent = simpleAgent;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Execute a task using the configured agent with fallback support
|
|
31
|
-
*/
|
|
32
|
-
async executeTask(task) {
|
|
33
|
-
const agentMode = this.getAgentMode();
|
|
34
|
-
const agent = this.agents.get(agentMode);
|
|
35
|
-
if (!agent) {
|
|
36
|
-
console.log(chalk.yellow(`⚠️ Agent '${agentMode}' not found, using simple agent`));
|
|
37
|
-
return this.defaultAgent.generate(task);
|
|
38
|
-
}
|
|
39
|
-
if (!agent.canHandle(task)) {
|
|
40
|
-
console.log(chalk.yellow(`⚠️ Agent '${agentMode}' cannot handle this task, falling back to simple agent`));
|
|
41
|
-
return this.defaultAgent.generate(task);
|
|
42
|
-
}
|
|
43
|
-
const spinner = ora(`Executing with ${agentMode} agent...`).start();
|
|
44
|
-
try {
|
|
45
|
-
const result = task.type === "validate" ? await agent.validate(task) : await agent.generate(task);
|
|
46
|
-
if (result.success) {
|
|
47
|
-
spinner.succeed(chalk.green(`${agentMode} agent completed successfully`));
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
spinner.warn(chalk.yellow(`${agentMode} agent failed, trying fallback...`));
|
|
51
|
-
const fallbackMode = this.getFallbackMode(agentMode);
|
|
52
|
-
if (fallbackMode && fallbackMode !== agentMode) {
|
|
53
|
-
const fallbackAgent = this.agents.get(fallbackMode);
|
|
54
|
-
if (fallbackAgent && fallbackAgent.canHandle(task)) return task.type === "validate" ? await fallbackAgent.validate(task) : await fallbackAgent.generate(task);
|
|
55
|
-
}
|
|
56
|
-
spinner.info(chalk.gray("Using simple agent as ultimate fallback"));
|
|
57
|
-
return task.type === "validate" ? await this.defaultAgent.validate(task) : await this.defaultAgent.generate(task);
|
|
58
|
-
} catch (error) {
|
|
59
|
-
spinner.fail(chalk.red("Agent execution failed"));
|
|
60
|
-
console.log(chalk.gray("Falling back to simple agent..."));
|
|
61
|
-
return task.type === "validate" ? await this.defaultAgent.validate(task) : await this.defaultAgent.generate(task);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Generate code from specification
|
|
66
|
-
*/
|
|
67
|
-
async generate(specCode, targetPath) {
|
|
68
|
-
return this.executeTask({
|
|
69
|
-
type: "generate",
|
|
70
|
-
specCode,
|
|
71
|
-
targetPath
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Generate tests for implementation
|
|
76
|
-
*/
|
|
77
|
-
async generateTests(specCode, implementationCode) {
|
|
78
|
-
return this.executeTask({
|
|
79
|
-
type: "test",
|
|
80
|
-
specCode,
|
|
81
|
-
existingCode: implementationCode
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Validate implementation against specification
|
|
86
|
-
*/
|
|
87
|
-
async validate(specCode, implementationCode) {
|
|
88
|
-
return this.executeTask({
|
|
89
|
-
type: "validate",
|
|
90
|
-
specCode,
|
|
91
|
-
existingCode: implementationCode
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Refactor existing code
|
|
96
|
-
*/
|
|
97
|
-
async refactor(specCode, existingCode) {
|
|
98
|
-
return this.executeTask({
|
|
99
|
-
type: "refactor",
|
|
100
|
-
specCode,
|
|
101
|
-
existingCode
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* List available agents and their status
|
|
106
|
-
*/
|
|
107
|
-
async getAvailableAgents() {
|
|
108
|
-
const results = [];
|
|
109
|
-
for (const [mode, agent] of this.agents) {
|
|
110
|
-
const canHandle = agent.canHandle({
|
|
111
|
-
type: "generate",
|
|
112
|
-
specCode: "test"
|
|
113
|
-
});
|
|
114
|
-
results.push({
|
|
115
|
-
mode,
|
|
116
|
-
available: canHandle,
|
|
117
|
-
reason: canHandle ? void 0 : "Not configured or dependencies missing"
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return results;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Get the configured agent mode
|
|
124
|
-
*/
|
|
125
|
-
getAgentMode() {
|
|
126
|
-
return this.config.agentMode || "simple";
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Get fallback mode for an agent
|
|
130
|
-
*/
|
|
131
|
-
getFallbackMode(mode) {
|
|
132
|
-
return {
|
|
133
|
-
cursor: "claude-code",
|
|
134
|
-
"claude-code": "openai-codex",
|
|
135
|
-
"openai-codex": "simple",
|
|
136
|
-
simple: "simple"
|
|
137
|
-
}[mode];
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
//#endregion
|
|
142
|
-
export { AgentOrchestrator };
|
|
1
|
+
import{SimpleAgent as e}from"./simple-agent.js";import{CursorAgent as t}from"./cursor-agent.js";import{ClaudeCodeAgent as n}from"./claude-code-agent.js";import{OpenAICodexAgent as r}from"./openai-codex-agent.js";import i from"../../node_modules/chalk/source/index.js";import a from"../../node_modules/ora/index.js";var o=class{agents;defaultAgent;constructor(i){this.config=i,this.agents=new Map;let a=new e(i),o=new t,s=new n,c=new r;this.agents.set(`simple`,a),this.agents.set(`cursor`,o),this.agents.set(`claude-code`,s),this.agents.set(`openai-codex`,c),this.defaultAgent=a}async executeTask(e){let t=this.getAgentMode(),n=this.agents.get(t);if(!n)return console.log(i.yellow(`⚠️ Agent '${t}' not found, using simple agent`)),this.defaultAgent.generate(e);if(!n.canHandle(e))return console.log(i.yellow(`⚠️ Agent '${t}' cannot handle this task, falling back to simple agent`)),this.defaultAgent.generate(e);let r=a(`Executing with ${t} agent...`).start();try{let a=e.type===`validate`?await n.validate(e):await n.generate(e);if(a.success)return r.succeed(i.green(`${t} agent completed successfully`)),a;r.warn(i.yellow(`${t} agent failed, trying fallback...`));let o=this.getFallbackMode(t);if(o&&o!==t){let t=this.agents.get(o);if(t&&t.canHandle(e))return e.type===`validate`?await t.validate(e):await t.generate(e)}return r.info(i.gray(`Using simple agent as ultimate fallback`)),e.type===`validate`?await this.defaultAgent.validate(e):await this.defaultAgent.generate(e)}catch{return r.fail(i.red(`Agent execution failed`)),console.log(i.gray(`Falling back to simple agent...`)),e.type===`validate`?await this.defaultAgent.validate(e):await this.defaultAgent.generate(e)}}async generate(e,t){return this.executeTask({type:`generate`,specCode:e,targetPath:t})}async generateTests(e,t){return this.executeTask({type:`test`,specCode:e,existingCode:t})}async validate(e,t){return this.executeTask({type:`validate`,specCode:e,existingCode:t})}async refactor(e,t){return this.executeTask({type:`refactor`,specCode:e,existingCode:t})}async getAvailableAgents(){let e=[];for(let[t,n]of this.agents){let r=n.canHandle({type:`generate`,specCode:`test`});e.push({mode:t,available:r,reason:r?void 0:`Not configured or dependencies missing`})}return e}getAgentMode(){return this.config.agentMode||`simple`}getFallbackMode(e){return{cursor:`claude-code`,"claude-code":`openai-codex`,"openai-codex":`simple`,simple:`simple`}[e]}};export{o as AgentOrchestrator};
|
|
@@ -1,91 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { buildComponentPrompt, buildFormPrompt, buildHandlerPrompt, buildTestPrompt, getCodeGenSystemPrompt } from "../prompts/code-generation.js";
|
|
3
|
-
import { generateText } from "ai";
|
|
4
|
-
|
|
5
|
-
//#region src/ai/agents/simple-agent.ts
|
|
6
|
-
/**
|
|
7
|
-
* Simple LLM-based agent using direct API calls
|
|
8
|
-
* This is the default fallback for basic code generation
|
|
9
|
-
*/
|
|
10
|
-
var SimpleAgent = class {
|
|
11
|
-
name = "simple";
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this.config = config;
|
|
14
|
-
}
|
|
15
|
-
canHandle(task) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
async generate(task) {
|
|
19
|
-
try {
|
|
20
|
-
const result = await generateText({
|
|
21
|
-
model: getAIProvider(this.config),
|
|
22
|
-
prompt: this.buildPrompt(task),
|
|
23
|
-
system: getCodeGenSystemPrompt()
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
success: true,
|
|
27
|
-
code: result.text,
|
|
28
|
-
metadata: {
|
|
29
|
-
model: this.config.aiModel,
|
|
30
|
-
provider: this.config.aiProvider,
|
|
31
|
-
tokens: result.usage
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
} catch (error) {
|
|
35
|
-
return {
|
|
36
|
-
success: false,
|
|
37
|
-
errors: [error instanceof Error ? error.message : String(error)]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
async validate(task) {
|
|
42
|
-
try {
|
|
43
|
-
const result = await generateText({
|
|
44
|
-
model: getAIProvider(this.config),
|
|
45
|
-
prompt: `
|
|
1
|
+
import{getAIProvider as e}from"../providers.js";import{buildComponentPrompt as t,buildFormPrompt as n,buildHandlerPrompt as r,buildTestPrompt as i,getCodeGenSystemPrompt as a}from"../prompts/code-generation.js";import{generateText as o}from"ai";var s=class{name=`simple`;constructor(e){this.config=e}canHandle(e){return!0}async generate(t){try{let n=await o({model:e(this.config),prompt:this.buildPrompt(t),system:a()});return{success:!0,code:n.text,metadata:{model:this.config.aiModel,provider:this.config.aiProvider,tokens:n.usage}}}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}async validate(t){try{let n=await o({model:e(this.config),prompt:`
|
|
46
2
|
Review the following implementation against its specification.
|
|
47
3
|
|
|
48
4
|
Specification:
|
|
49
|
-
${
|
|
5
|
+
${t.specCode}
|
|
50
6
|
|
|
51
7
|
Implementation:
|
|
52
|
-
${
|
|
8
|
+
${t.existingCode||`// No implementation provided`}
|
|
53
9
|
|
|
54
10
|
Provide a detailed validation report:
|
|
55
11
|
1. Does the implementation match the spec?
|
|
56
12
|
2. Are there any missing features?
|
|
57
13
|
3. Are there any bugs or issues?
|
|
58
14
|
4. Suggestions for improvement
|
|
59
|
-
`,
|
|
60
|
-
system: "You are a code review expert. Provide thorough, constructive feedback."
|
|
61
|
-
});
|
|
62
|
-
const hasErrors = result.text.toLowerCase().includes("error") || result.text.toLowerCase().includes("missing") || result.text.toLowerCase().includes("incorrect");
|
|
63
|
-
return {
|
|
64
|
-
success: !hasErrors,
|
|
65
|
-
code: result.text,
|
|
66
|
-
warnings: hasErrors ? ["Implementation may not match specification"] : [],
|
|
67
|
-
metadata: { validationType: "simple-llm" }
|
|
68
|
-
};
|
|
69
|
-
} catch (error) {
|
|
70
|
-
return {
|
|
71
|
-
success: false,
|
|
72
|
-
errors: [error instanceof Error ? error.message : String(error)]
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
buildPrompt(task) {
|
|
77
|
-
switch (task.type) {
|
|
78
|
-
case "generate":
|
|
79
|
-
if (task.specCode.includes(".contracts.") || task.specCode.includes("kind:")) return buildHandlerPrompt(task.specCode);
|
|
80
|
-
else if (task.specCode.includes(".presentation.")) return buildComponentPrompt(task.specCode);
|
|
81
|
-
else if (task.specCode.includes(".form.")) return buildFormPrompt(task.specCode);
|
|
82
|
-
return `Generate implementation for:\n${task.specCode}`;
|
|
83
|
-
case "test": return buildTestPrompt(task.specCode, task.existingCode || "", "handler");
|
|
84
|
-
case "validate": return `Validate this implementation:\n${task.existingCode}`;
|
|
85
|
-
default: return task.specCode;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
export { SimpleAgent };
|
|
15
|
+
`,system:`You are a code review expert. Provide thorough, constructive feedback.`}),r=n.text.toLowerCase().includes(`error`)||n.text.toLowerCase().includes(`missing`)||n.text.toLowerCase().includes(`incorrect`);return{success:!r,code:n.text,warnings:r?[`Implementation may not match specification`]:[],metadata:{validationType:`simple-llm`}}}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}buildPrompt(e){switch(e.type){case`generate`:return e.specCode.includes(`.contracts.`)||e.specCode.includes(`kind:`)?r(e.specCode):e.specCode.includes(`.presentation.`)?t(e.specCode):e.specCode.includes(`.form.`)?n(e.specCode):`Generate implementation for:\n${e.specCode}`;case`test`:return i(e.specCode,e.existingCode||``,`handler`);case`validate`:return`Validate this implementation:\n${e.existingCode}`;default:return e.specCode}}};export{s as SimpleAgent};
|
package/dist/ai/client.js
CHANGED
|
@@ -1,162 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildEventSpecPrompt, buildOperationSpecPrompt, buildPresentationSpecPrompt, getSystemPrompt } from "./prompts/spec-creation.js";
|
|
3
|
-
import { buildComponentPrompt, buildFormPrompt, buildHandlerPrompt, buildTestPrompt, getCodeGenSystemPrompt } from "./prompts/code-generation.js";
|
|
4
|
-
import { generateObject, generateText, streamText } from "ai";
|
|
5
|
-
import * as z$1 from "zod";
|
|
6
|
-
|
|
7
|
-
//#region src/ai/client.ts
|
|
8
|
-
/**
|
|
9
|
-
* AI Client for spec creation and code generation
|
|
10
|
-
*/
|
|
11
|
-
var AIClient = class {
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this.config = config;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Generate operation spec from natural language description
|
|
17
|
-
*/
|
|
18
|
-
async generateOperationSpec(description, kind) {
|
|
19
|
-
return (await generateObject({
|
|
20
|
-
model: getAIProvider(this.config),
|
|
21
|
-
schema: z$1.object({
|
|
22
|
-
name: z$1.string().describe("Dot notation name like \"domain.operation\""),
|
|
23
|
-
version: z$1.number().int().positive().default(1),
|
|
24
|
-
description: z$1.string().describe("Clear, concise summary"),
|
|
25
|
-
goal: z$1.string().describe("Business purpose"),
|
|
26
|
-
context: z$1.string().describe("Background and constraints"),
|
|
27
|
-
stability: z$1.enum([
|
|
28
|
-
"experimental",
|
|
29
|
-
"beta",
|
|
30
|
-
"stable",
|
|
31
|
-
"deprecated"
|
|
32
|
-
]).default("beta"),
|
|
33
|
-
owners: z$1.array(z$1.string()).describe("Team/person owners with @ prefix"),
|
|
34
|
-
tags: z$1.array(z$1.string()).describe("Categorization tags"),
|
|
35
|
-
auth: z$1.enum([
|
|
36
|
-
"anonymous",
|
|
37
|
-
"user",
|
|
38
|
-
"admin"
|
|
39
|
-
]).describe("Required auth level"),
|
|
40
|
-
inputShape: z$1.string().describe("Description of input structure"),
|
|
41
|
-
outputShape: z$1.string().describe("Description of output structure"),
|
|
42
|
-
flags: z$1.array(z$1.string()).describe("Feature flags").default([]),
|
|
43
|
-
possibleEvents: z$1.array(z$1.string()).describe("Events this may emit").default([]),
|
|
44
|
-
analytics: z$1.array(z$1.string()).describe("Analytics events to track").default([])
|
|
45
|
-
}),
|
|
46
|
-
prompt: buildOperationSpecPrompt(description, kind),
|
|
47
|
-
system: getSystemPrompt()
|
|
48
|
-
})).object;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Generate event spec from description
|
|
52
|
-
*/
|
|
53
|
-
async generateEventSpec(description) {
|
|
54
|
-
return (await generateObject({
|
|
55
|
-
model: getAIProvider(this.config),
|
|
56
|
-
schema: z$1.object({
|
|
57
|
-
name: z$1.string().describe("Dot notation name like \"domain.event_name\""),
|
|
58
|
-
version: z$1.number().int().positive().default(1),
|
|
59
|
-
description: z$1.string().describe("When this event is emitted"),
|
|
60
|
-
stability: z$1.enum([
|
|
61
|
-
"experimental",
|
|
62
|
-
"beta",
|
|
63
|
-
"stable",
|
|
64
|
-
"deprecated"
|
|
65
|
-
]).default("beta"),
|
|
66
|
-
owners: z$1.array(z$1.string()).default([]),
|
|
67
|
-
tags: z$1.array(z$1.string()).default([]),
|
|
68
|
-
payloadShape: z$1.string().describe("Description of event payload"),
|
|
69
|
-
piiFields: z$1.array(z$1.string()).describe("PII field paths").default([])
|
|
70
|
-
}),
|
|
71
|
-
prompt: buildEventSpecPrompt(description),
|
|
72
|
-
system: getSystemPrompt()
|
|
73
|
-
})).object;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Generate presentation spec from description
|
|
77
|
-
*/
|
|
78
|
-
async generatePresentationSpec(description, kind) {
|
|
79
|
-
return (await generateObject({
|
|
80
|
-
model: getAIProvider(this.config),
|
|
81
|
-
schema: z$1.object({
|
|
82
|
-
name: z$1.string(),
|
|
83
|
-
version: z$1.number().int().positive().default(1),
|
|
84
|
-
description: z$1.string(),
|
|
85
|
-
stability: z$1.enum([
|
|
86
|
-
"experimental",
|
|
87
|
-
"beta",
|
|
88
|
-
"stable",
|
|
89
|
-
"deprecated"
|
|
90
|
-
]).default("beta"),
|
|
91
|
-
owners: z$1.array(z$1.string()).default([]),
|
|
92
|
-
tags: z$1.array(z$1.string()).default([]),
|
|
93
|
-
componentKey: z$1.string().optional(),
|
|
94
|
-
propsShape: z$1.string().optional(),
|
|
95
|
-
content: z$1.string().optional(),
|
|
96
|
-
mimeType: z$1.string().optional(),
|
|
97
|
-
dataShape: z$1.string().optional()
|
|
98
|
-
}),
|
|
99
|
-
prompt: buildPresentationSpecPrompt(description, kind),
|
|
100
|
-
system: getSystemPrompt()
|
|
101
|
-
})).object;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Generate handler implementation from spec
|
|
105
|
-
*/
|
|
106
|
-
async generateHandler(specCode) {
|
|
107
|
-
return (await generateText({
|
|
108
|
-
model: getAIProvider(this.config),
|
|
109
|
-
prompt: buildHandlerPrompt(specCode),
|
|
110
|
-
system: getCodeGenSystemPrompt()
|
|
111
|
-
})).text;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Generate React component from presentation spec
|
|
115
|
-
*/
|
|
116
|
-
async generateComponent(specCode) {
|
|
117
|
-
return (await generateText({
|
|
118
|
-
model: getAIProvider(this.config),
|
|
119
|
-
prompt: buildComponentPrompt(specCode),
|
|
120
|
-
system: getCodeGenSystemPrompt()
|
|
121
|
-
})).text;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Generate form component from form spec
|
|
125
|
-
*/
|
|
126
|
-
async generateForm(specCode) {
|
|
127
|
-
return (await generateText({
|
|
128
|
-
model: getAIProvider(this.config),
|
|
129
|
-
prompt: buildFormPrompt(specCode),
|
|
130
|
-
system: getCodeGenSystemPrompt()
|
|
131
|
-
})).text;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Generate tests for implementation
|
|
135
|
-
*/
|
|
136
|
-
async generateTests(specCode, implementationCode, testType) {
|
|
137
|
-
return (await generateText({
|
|
138
|
-
model: getAIProvider(this.config),
|
|
139
|
-
prompt: buildTestPrompt(specCode, implementationCode, testType),
|
|
140
|
-
system: getCodeGenSystemPrompt()
|
|
141
|
-
})).text;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Stream code generation for better UX
|
|
145
|
-
*/
|
|
146
|
-
async streamCodeGeneration(prompt, onChunk) {
|
|
147
|
-
const result = await streamText({
|
|
148
|
-
model: getAIProvider(this.config),
|
|
149
|
-
prompt,
|
|
150
|
-
system: getCodeGenSystemPrompt()
|
|
151
|
-
});
|
|
152
|
-
let fullText = "";
|
|
153
|
-
for await (const chunk of result.textStream) {
|
|
154
|
-
fullText += chunk;
|
|
155
|
-
onChunk(chunk);
|
|
156
|
-
}
|
|
157
|
-
return fullText;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
//#endregion
|
|
162
|
-
export { AIClient };
|
|
1
|
+
import{getAIProvider as e}from"./providers.js";import{buildEventSpecPrompt as t,buildOperationSpecPrompt as n,buildPresentationSpecPrompt as r,getSystemPrompt as i}from"./prompts/spec-creation.js";import{buildComponentPrompt as a,buildFormPrompt as o,buildHandlerPrompt as s,buildTestPrompt as c,getCodeGenSystemPrompt as l}from"./prompts/code-generation.js";import{generateObject as u,generateText as d,streamText as f}from"ai";import*as p from"zod";var m=class{constructor(e){this.config=e}async generateOperationSpec(t,r){return(await u({model:e(this.config),schema:p.object({name:p.string().describe(`Dot notation name like "domain.operation"`),version:p.number().int().positive().default(1),description:p.string().describe(`Clear, concise summary`),goal:p.string().describe(`Business purpose`),context:p.string().describe(`Background and constraints`),stability:p.enum([`experimental`,`beta`,`stable`,`deprecated`]).default(`beta`),owners:p.array(p.string()).describe(`Team/person owners with @ prefix`),tags:p.array(p.string()).describe(`Categorization tags`),auth:p.enum([`anonymous`,`user`,`admin`]).describe(`Required auth level`),inputShape:p.string().describe(`Description of input structure`),outputShape:p.string().describe(`Description of output structure`),flags:p.array(p.string()).describe(`Feature flags`).default([]),possibleEvents:p.array(p.string()).describe(`Events this may emit`).default([]),analytics:p.array(p.string()).describe(`Analytics events to track`).default([])}),prompt:n(t,r),system:i()})).object}async generateEventSpec(n){return(await u({model:e(this.config),schema:p.object({name:p.string().describe(`Dot notation name like "domain.event_name"`),version:p.number().int().positive().default(1),description:p.string().describe(`When this event is emitted`),stability:p.enum([`experimental`,`beta`,`stable`,`deprecated`]).default(`beta`),owners:p.array(p.string()).default([]),tags:p.array(p.string()).default([]),payloadShape:p.string().describe(`Description of event payload`),piiFields:p.array(p.string()).describe(`PII field paths`).default([])}),prompt:t(n),system:i()})).object}async generatePresentationSpec(t,n){return(await u({model:e(this.config),schema:p.object({name:p.string(),version:p.number().int().positive().default(1),description:p.string(),stability:p.enum([`experimental`,`beta`,`stable`,`deprecated`]).default(`beta`),owners:p.array(p.string()).default([]),tags:p.array(p.string()).default([]),componentKey:p.string().optional(),propsShape:p.string().optional(),content:p.string().optional(),mimeType:p.string().optional(),dataShape:p.string().optional()}),prompt:r(t,n),system:i()})).object}async generateHandler(t){return(await d({model:e(this.config),prompt:s(t),system:l()})).text}async generateComponent(t){return(await d({model:e(this.config),prompt:a(t),system:l()})).text}async generateForm(t){return(await d({model:e(this.config),prompt:o(t),system:l()})).text}async generateTests(t,n,r){return(await d({model:e(this.config),prompt:c(t,n,r),system:l()})).text}async streamCodeGeneration(t,n){let r=await f({model:e(this.config),prompt:t,system:l()}),i=``;for await(let e of r.textStream)i+=e,n(e);return i}};export{m as AIClient};
|
package/dist/ai/index.js
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getAIProvider, getRecommendedModels, validateProvider } from "./providers.js";
|
|
3
|
-
import { AIClient } from "./client.js";
|
|
4
|
-
import { SimpleAgent } from "./agents/simple-agent.js";
|
|
5
|
-
import { CursorAgent } from "./agents/cursor-agent.js";
|
|
6
|
-
import { ClaudeCodeAgent } from "./agents/claude-code-agent.js";
|
|
7
|
-
import { OpenAICodexAgent } from "./agents/openai-codex-agent.js";
|
|
8
|
-
import { AgentOrchestrator } from "./agents/orchestrator.js";
|
|
9
|
-
import "./agents/index.js";
|
|
10
|
-
import { prompts_exports } from "./prompts/index.js";
|
|
11
|
-
|
|
12
|
-
//#region src/ai/index.ts
|
|
13
|
-
var ai_exports = /* @__PURE__ */ __export({
|
|
14
|
-
AIClient: () => AIClient,
|
|
15
|
-
AgentOrchestrator: () => AgentOrchestrator,
|
|
16
|
-
ClaudeCodeAgent: () => ClaudeCodeAgent,
|
|
17
|
-
CursorAgent: () => CursorAgent,
|
|
18
|
-
OpenAICodexAgent: () => OpenAICodexAgent,
|
|
19
|
-
SimpleAgent: () => SimpleAgent,
|
|
20
|
-
getAIProvider: () => getAIProvider,
|
|
21
|
-
getRecommendedModels: () => getRecommendedModels,
|
|
22
|
-
prompts: () => prompts_exports,
|
|
23
|
-
validateProvider: () => validateProvider
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { ai_exports };
|
|
1
|
+
import{__export as e}from"../_virtual/rolldown_runtime.js";import{getAIProvider as t,getRecommendedModels as n,validateProvider as r}from"./providers.js";import{AIClient as i}from"./client.js";import{SimpleAgent as a}from"./agents/simple-agent.js";import{CursorAgent as o}from"./agents/cursor-agent.js";import{ClaudeCodeAgent as s}from"./agents/claude-code-agent.js";import{OpenAICodexAgent as c}from"./agents/openai-codex-agent.js";import{AgentOrchestrator as l}from"./agents/orchestrator.js";import"./agents/index.js";import{prompts_exports as u}from"./prompts/index.js";var d=e({AIClient:()=>i,AgentOrchestrator:()=>l,ClaudeCodeAgent:()=>s,CursorAgent:()=>o,OpenAICodexAgent:()=>c,SimpleAgent:()=>a,getAIProvider:()=>t,getRecommendedModels:()=>n,prompts:()=>u,validateProvider:()=>r});export{d as ai_exports};
|