@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102

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.
Files changed (257) hide show
  1. package/dist/_virtual/rolldown_runtime.js +22 -1
  2. package/dist/adapters/ai.js +82 -1
  3. package/dist/adapters/factory.js +36 -1
  4. package/dist/adapters/fs.js +118 -1
  5. package/dist/adapters/git.js +54 -1
  6. package/dist/adapters/index.js +7 -1
  7. package/dist/adapters/logger.js +80 -1
  8. package/dist/adapters/watcher.js +69 -1
  9. package/dist/adapters/workspace.js +190 -2
  10. package/dist/ai/agents/claude-code-agent.js +146 -9
  11. package/dist/ai/agents/cursor-agent.js +286 -17
  12. package/dist/ai/agents/index.js +5 -1
  13. package/dist/ai/agents/openai-codex-agent.js +140 -8
  14. package/dist/ai/agents/orchestrator.js +142 -1
  15. package/dist/ai/agents/simple-agent.js +80 -4
  16. package/dist/ai/client.js +162 -1
  17. package/dist/ai/index.js +27 -1
  18. package/dist/ai/prompts/code-generation.js +55 -13
  19. package/dist/ai/prompts/index.js +12 -1
  20. package/dist/ai/prompts/spec-creation.js +61 -20
  21. package/dist/ai/providers.js +40 -1
  22. package/dist/formatters/index.js +18 -1
  23. package/dist/formatters/json.js +71 -1
  24. package/dist/formatters/sarif.js +163 -1
  25. package/dist/formatters/text.js +208 -2
  26. package/dist/index.js +81 -1
  27. package/dist/libs/ai-providers/dist/factory.js +154 -1
  28. package/dist/libs/ai-providers/dist/index.js +4 -1
  29. package/dist/libs/ai-providers/dist/legacy.js +72 -1
  30. package/dist/libs/ai-providers/dist/models.js +287 -1
  31. package/dist/libs/ai-providers/dist/validation.js +1 -1
  32. package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -1
  33. package/dist/libs/contracts/dist/client/index.js +5 -1
  34. package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
  35. package/dist/libs/contracts/dist/client/react/form-render.js +4 -1
  36. package/dist/libs/contracts/dist/client/react/index.js +4 -1
  37. package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
  38. package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -1
  39. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
  40. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
  41. package/dist/libs/contracts/dist/docs/index.js +29 -1
  42. package/dist/libs/contracts/dist/docs/presentations.js +71 -1
  43. package/dist/libs/contracts/dist/docs/registry.js +44 -1
  44. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
  45. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
  46. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
  47. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
  48. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
  49. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
  50. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
  51. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
  52. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
  53. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
  54. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
  55. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
  56. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
  57. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
  58. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
  59. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
  60. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
  61. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
  62. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
  63. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
  64. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
  65. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
  66. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
  67. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
  68. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
  69. package/dist/libs/contracts/dist/events.js +8 -1
  70. package/dist/libs/contracts/dist/experiments/evaluator.js +1 -1
  71. package/dist/libs/contracts/dist/index.js +72 -1
  72. package/dist/libs/contracts/dist/install.js +2 -1
  73. package/dist/libs/contracts/dist/integrations/contracts.js +377 -1
  74. package/dist/libs/contracts/dist/integrations/index.js +18 -1
  75. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -1
  76. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -1
  77. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -1
  78. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -1
  79. package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -1
  80. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -1
  81. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -1
  82. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -1
  83. package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -1
  84. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -1
  85. package/dist/libs/contracts/dist/integrations/providers/index.js +11 -1
  86. package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -1
  87. package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -1
  88. package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -1
  89. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -1
  90. package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -1
  91. package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -1
  92. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -1
  93. package/dist/libs/contracts/dist/jsonschema.js +24 -1
  94. package/dist/libs/contracts/dist/knowledge/contracts.js +306 -1
  95. package/dist/libs/contracts/dist/knowledge/index.js +7 -1
  96. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -1
  97. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -1
  98. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -1
  99. package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -1
  100. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -1
  101. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -1
  102. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -1
  103. package/dist/libs/contracts/dist/llm/exporters.js +352 -4
  104. package/dist/libs/contracts/dist/llm/index.js +2 -1
  105. package/dist/libs/contracts/dist/llm/prompts.js +143 -7
  106. package/dist/libs/contracts/dist/onboarding-base.js +196 -1
  107. package/dist/libs/contracts/dist/openapi.js +75 -1
  108. package/dist/libs/contracts/dist/ownership.js +21 -1
  109. package/dist/libs/contracts/dist/presentations.js +1 -1
  110. package/dist/libs/contracts/dist/presentations.v2.js +11 -1
  111. package/dist/libs/contracts/dist/prompt.js +1 -1
  112. package/dist/libs/contracts/dist/promptRegistry.js +1 -1
  113. package/dist/libs/contracts/dist/regenerator/index.js +2 -1
  114. package/dist/libs/contracts/dist/regenerator/service.js +92 -1
  115. package/dist/libs/contracts/dist/regenerator/utils.js +51 -1
  116. package/dist/libs/contracts/dist/registry.js +208 -1
  117. package/dist/libs/contracts/dist/resources.js +1 -1
  118. package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -1
  119. package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -1
  120. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -1
  121. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +34 -1
  122. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -1
  123. package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -1
  124. package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -1
  125. package/dist/libs/contracts/dist/schema/dist/index.js +6 -1
  126. package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -1
  127. package/dist/libs/contracts/dist/server/index.js +8 -1
  128. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -1
  129. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -1
  130. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
  131. package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -1
  132. package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -1
  133. package/dist/libs/contracts/dist/server/provider-mcp.js +1 -1
  134. package/dist/libs/contracts/dist/server/rest-elysia.js +1 -1
  135. package/dist/libs/contracts/dist/server/rest-express.js +1 -1
  136. package/dist/libs/contracts/dist/server/rest-generic.js +1 -1
  137. package/dist/libs/contracts/dist/server/rest-next-app.js +1 -1
  138. package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -1
  139. package/dist/libs/contracts/dist/spec.js +35 -1
  140. package/dist/libs/contracts/dist/telemetry/index.js +1 -1
  141. package/dist/libs/contracts/dist/telemetry/tracker.js +1 -1
  142. package/dist/libs/contracts/dist/tests/index.js +1 -1
  143. package/dist/libs/contracts/dist/tests/runner.js +150 -1
  144. package/dist/libs/contracts/dist/workflow/index.js +1 -1
  145. package/dist/libs/contracts/dist/workflow/runner.js +1 -1
  146. package/dist/libs/contracts-transformers/dist/common/utils.js +47 -1
  147. package/dist/libs/contracts-transformers/dist/openapi/exporter.js +1 -1
  148. package/dist/libs/contracts-transformers/dist/openapi/importer.js +255 -2
  149. package/dist/libs/contracts-transformers/dist/openapi/index.js +4 -1
  150. package/dist/libs/contracts-transformers/dist/openapi/parser.js +231 -1
  151. package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +201 -4
  152. package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +50 -13
  153. package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +50 -18
  154. package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +84 -2
  155. package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +30 -1
  156. package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +96 -1
  157. package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +151 -1
  158. package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +344 -1
  159. package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +122 -1
  160. package/dist/modules/contractspec-workspace/dist/templates/app-config.js +100 -28
  161. package/dist/modules/contractspec-workspace/dist/templates/data-view.js +41 -27
  162. package/dist/modules/contractspec-workspace/dist/templates/event.js +28 -14
  163. package/dist/modules/contractspec-workspace/dist/templates/experiment.js +76 -51
  164. package/dist/modules/contractspec-workspace/dist/templates/handler.js +49 -17
  165. package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +97 -26
  166. package/dist/modules/contractspec-workspace/dist/templates/integration.js +46 -23
  167. package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +59 -19
  168. package/dist/modules/contractspec-workspace/dist/templates/migration.js +49 -26
  169. package/dist/modules/contractspec-workspace/dist/templates/operation.js +40 -28
  170. package/dist/modules/contractspec-workspace/dist/templates/presentation.js +45 -20
  171. package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +73 -53
  172. package/dist/modules/contractspec-workspace/dist/templates/utils.js +38 -1
  173. package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +12 -6
  174. package/dist/modules/contractspec-workspace/dist/templates/workflow.js +50 -24
  175. package/dist/modules/contractspec-workspace/dist/types/generation-types.js +20 -1
  176. package/dist/services/agent-guide/adapters/claude-code.js +144 -3
  177. package/dist/services/agent-guide/adapters/cursor-cli.js +135 -3
  178. package/dist/services/agent-guide/adapters/generic-mcp.js +159 -3
  179. package/dist/services/agent-guide/adapters/index.js +30 -1
  180. package/dist/services/agent-guide/agent-guide-service.js +148 -1
  181. package/dist/services/agent-guide/index.js +5 -1
  182. package/dist/services/build.js +140 -1
  183. package/dist/services/ci-check/ci-check-service.js +393 -1
  184. package/dist/services/ci-check/index.js +2 -1
  185. package/dist/services/ci-check/types.js +28 -1
  186. package/dist/services/clean.js +71 -1
  187. package/dist/services/config.js +76 -1
  188. package/dist/services/deps.js +62 -1
  189. package/dist/services/diff.js +33 -1
  190. package/dist/services/doctor/checks/ai.js +118 -2
  191. package/dist/services/doctor/checks/cli.js +146 -1
  192. package/dist/services/doctor/checks/config.js +170 -1
  193. package/dist/services/doctor/checks/deps.js +180 -1
  194. package/dist/services/doctor/checks/index.js +6 -1
  195. package/dist/services/doctor/checks/mcp.js +144 -1
  196. package/dist/services/doctor/checks/workspace.js +243 -1
  197. package/dist/services/doctor/doctor-service.js +115 -2
  198. package/dist/services/doctor/index.js +2 -1
  199. package/dist/services/doctor/types.js +26 -1
  200. package/dist/services/implementation/discovery.js +143 -2
  201. package/dist/services/implementation/index.js +2 -1
  202. package/dist/services/implementation/resolver.js +223 -1
  203. package/dist/services/index.js +53 -1
  204. package/dist/services/integrity-diagram.js +274 -6
  205. package/dist/services/integrity.js +272 -1
  206. package/dist/services/list.js +35 -1
  207. package/dist/services/openapi/export-service.js +51 -2
  208. package/dist/services/openapi/import-service.js +75 -1
  209. package/dist/services/openapi/index.js +4 -1
  210. package/dist/services/openapi/sync-service.js +121 -1
  211. package/dist/services/openapi/validate-service.js +130 -1
  212. package/dist/services/regenerator.js +23 -1
  213. package/dist/services/registry.js +73 -1
  214. package/dist/services/setup/config-generators.js +113 -26
  215. package/dist/services/setup/file-merger.js +60 -2
  216. package/dist/services/setup/index.js +4 -1
  217. package/dist/services/setup/setup-service.js +95 -1
  218. package/dist/services/setup/targets/agents-md.js +46 -1
  219. package/dist/services/setup/targets/cli-config.js +59 -1
  220. package/dist/services/setup/targets/cursor-rules.js +47 -1
  221. package/dist/services/setup/targets/mcp-claude.js +59 -1
  222. package/dist/services/setup/targets/mcp-cursor.js +58 -1
  223. package/dist/services/setup/targets/vscode-settings.js +62 -1
  224. package/dist/services/setup/types.js +26 -1
  225. package/dist/services/sync.js +62 -1
  226. package/dist/services/test.js +30 -1
  227. package/dist/services/validate-implementation.js +69 -1
  228. package/dist/services/validate.js +47 -1
  229. package/dist/services/verification-cache/adapters/filesystem.js +121 -1
  230. package/dist/services/verification-cache/adapters/in-memory.js +45 -1
  231. package/dist/services/verification-cache/adapters/index.js +3 -1
  232. package/dist/services/verification-cache/adapters/workspace-state.js +90 -1
  233. package/dist/services/verification-cache/cache-service.js +255 -1
  234. package/dist/services/verification-cache/index.js +6 -1
  235. package/dist/services/verification-cache/types.js +15 -1
  236. package/dist/services/verify/ai-verifier.js +336 -9
  237. package/dist/services/verify/behavior-verifier.js +185 -1
  238. package/dist/services/verify/index.js +4 -1
  239. package/dist/services/verify/structure-verifier.js +195 -2
  240. package/dist/services/verify/verify-service.js +203 -3
  241. package/dist/services/watch.js +31 -1
  242. package/dist/services/workspace-info.js +102 -2
  243. package/dist/templates/app-config.template.js +101 -28
  244. package/dist/templates/data-view.template.js +42 -27
  245. package/dist/templates/event.template.js +29 -14
  246. package/dist/templates/experiment.template.js +77 -51
  247. package/dist/templates/handler.template.js +53 -17
  248. package/dist/templates/index.js +36 -1
  249. package/dist/templates/integration.template.js +134 -50
  250. package/dist/templates/knowledge.template.js +62 -21
  251. package/dist/templates/migration.template.js +50 -26
  252. package/dist/templates/operation.template.js +44 -28
  253. package/dist/templates/presentation.template.js +46 -20
  254. package/dist/templates/telemetry.template.js +74 -53
  255. package/dist/templates/workflow-runner.template.js +12 -6
  256. package/dist/templates/workflow.template.js +51 -24
  257. package/package.json +13 -9
@@ -1,14 +1,69 @@
1
- import{anthropic as e}from"@ai-sdk/anthropic";import{generateText as t}from"ai";var n=class{name=`claude-code`;apiKey;constructor(){this.apiKey=process.env.ANTHROPIC_API_KEY}canHandle(e){return!!this.apiKey}async generate(n){if(!this.apiKey)return{success:!1,errors:[`ANTHROPIC_API_KEY not set. Claude Code agent requires API access.`]};try{let r=e(`claude-3-7-sonnet-20250219`),i=this.buildSystemPrompt(n),a=await t({model:r,prompt:this.buildUserPrompt(n),system:i,temperature:.2});return{success:!0,code:this.extractCode(a.text),metadata:{model:`claude-3-7-sonnet`,agentMode:`claude-code`,usage:a.usage}}}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}async validate(n){if(!this.apiKey)return{success:!1,errors:[`ANTHROPIC_API_KEY not set`]};try{let r=await t({model:e(`claude-3-7-sonnet-20250219`),prompt:`
1
+ import { anthropic } from "@ai-sdk/anthropic";
2
+ import { generateText } from "ai";
3
+
4
+ //#region src/ai/agents/claude-code-agent.ts
5
+ /**
6
+ * Claude Code Agent - Uses Anthropic's advanced code capabilities
7
+ * with extended context and agentic workflows
8
+ */
9
+ var ClaudeCodeAgent = class {
10
+ name = "claude-code";
11
+ apiKey;
12
+ constructor() {
13
+ this.apiKey = process.env.ANTHROPIC_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: ["ANTHROPIC_API_KEY not set. Claude Code agent requires API access."]
22
+ };
23
+ try {
24
+ const model = anthropic("claude-3-7-sonnet-20250219");
25
+ const systemPrompt = this.buildSystemPrompt(task);
26
+ const result = await generateText({
27
+ model,
28
+ prompt: this.buildUserPrompt(task),
29
+ system: systemPrompt,
30
+ temperature: .2
31
+ });
32
+ return {
33
+ success: true,
34
+ code: this.extractCode(result.text),
35
+ metadata: {
36
+ model: "claude-3-7-sonnet",
37
+ agentMode: "claude-code",
38
+ usage: result.usage
39
+ }
40
+ };
41
+ } catch (error) {
42
+ return {
43
+ success: false,
44
+ errors: [error instanceof Error ? error.message : String(error)]
45
+ };
46
+ }
47
+ }
48
+ async validate(task) {
49
+ if (!this.apiKey) return {
50
+ success: false,
51
+ errors: ["ANTHROPIC_API_KEY not set"]
52
+ };
53
+ try {
54
+ const result = await generateText({
55
+ model: anthropic("claude-3-7-sonnet-20250219"),
56
+ prompt: `
2
57
  You are an expert code reviewer. Carefully analyze this implementation against its specification.
3
58
 
4
59
  SPECIFICATION:
5
60
  \`\`\`typescript
6
- ${n.specCode}
61
+ ${task.specCode}
7
62
  \`\`\`
8
63
 
9
64
  IMPLEMENTATION:
10
65
  \`\`\`typescript
11
- ${n.existingCode||`// No implementation provided`}
66
+ ${task.existingCode || "// No implementation provided"}
12
67
  \`\`\`
13
68
 
14
69
  Provide a structured validation report:
@@ -27,7 +82,31 @@ Provide a structured validation report:
27
82
  - Are there any missing edge cases?
28
83
 
29
84
  Be thorough and precise. Use a critical but constructive tone.
30
- `,system:`You are a senior software engineer performing a critical 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),suggestions:this.extractSuggestions(r.text),metadata:{agentMode:`claude-code`,validationType:`comprehensive`}}}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}buildSystemPrompt(e){let t=`You are an expert TypeScript developer specializing in contract-driven development.
85
+ `,
86
+ system: "You are a senior software engineer performing a critical code review.",
87
+ temperature: .3
88
+ });
89
+ const hasErrors = this.detectIssues(result.text);
90
+ return {
91
+ success: !hasErrors,
92
+ code: result.text,
93
+ errors: hasErrors ? this.extractErrors(result.text) : [],
94
+ warnings: this.extractWarnings(result.text),
95
+ suggestions: this.extractSuggestions(result.text),
96
+ metadata: {
97
+ agentMode: "claude-code",
98
+ validationType: "comprehensive"
99
+ }
100
+ };
101
+ } catch (error) {
102
+ return {
103
+ success: false,
104
+ errors: [error instanceof Error ? error.message : String(error)]
105
+ };
106
+ }
107
+ }
108
+ buildSystemPrompt(task) {
109
+ const basePrompt = `You are an expert TypeScript developer specializing in contract-driven development.
31
110
 
32
111
  Your code is:
33
112
  - Type-safe with comprehensive TypeScript types
@@ -36,9 +115,67 @@ Your code is:
36
115
  - Following SOLID principles and best practices
37
116
  - Modular and testable
38
117
 
39
- Generate clean, idiomatic TypeScript code that exactly matches the specification.`;return e.type===`test`?t+`
118
+ Generate clean, idiomatic TypeScript code that exactly matches the specification.`;
119
+ if (task.type === "test") return basePrompt + "\n\nYou are also an expert in testing. Write comprehensive tests using Vitest.";
120
+ return basePrompt;
121
+ }
122
+ buildUserPrompt(task) {
123
+ const prompts = {
124
+ generate: `Generate a complete, production-ready implementation for this specification:\n\n${task.specCode}\n\nProvide ONLY the TypeScript code, no explanations.`,
125
+ test: `Generate comprehensive tests for this code:\n\nSpec:\n${task.specCode}\n\nImplementation:\n${task.existingCode}\n\nProvide complete Vitest test suite.`,
126
+ refactor: `Refactor this code while preserving functionality:\n\n${task.existingCode}\n\nSpec:\n${task.specCode}`,
127
+ validate: `Validate this implementation:\n\nSpec:\n${task.specCode}\n\nCode:\n${task.existingCode}`
128
+ };
129
+ return prompts[task.type] || prompts.generate;
130
+ }
131
+ extractCode(text) {
132
+ const codeBlockMatch = text.match(/```(?:typescript|ts|tsx)?\n([\s\S]*?)\n```/);
133
+ if (codeBlockMatch && codeBlockMatch[1]) return codeBlockMatch[1];
134
+ return text;
135
+ }
136
+ detectIssues(reviewText) {
137
+ const errorIndicators = [
138
+ "missing",
139
+ "incorrect",
140
+ "bug",
141
+ "error",
142
+ "violation",
143
+ "does not",
144
+ "fails to",
145
+ "not implemented",
146
+ "critical"
147
+ ];
148
+ const lowerText = reviewText.toLowerCase();
149
+ return errorIndicators.some((indicator) => lowerText.includes(indicator));
150
+ }
151
+ extractErrors(text) {
152
+ const errors = [];
153
+ const lines = text.split("\n");
154
+ for (const line of lines) {
155
+ const lower = line.toLowerCase();
156
+ if (lower.includes("error") || lower.includes("bug") || lower.includes("incorrect") || lower.includes("missing")) errors.push(line.trim());
157
+ }
158
+ return errors.length > 0 ? errors : ["Code review identified issues"];
159
+ }
160
+ extractWarnings(text) {
161
+ const warnings = [];
162
+ const lines = text.split("\n");
163
+ for (const line of lines) {
164
+ const lower = line.toLowerCase();
165
+ if (lower.includes("warning") || lower.includes("should") || lower.includes("consider")) warnings.push(line.trim());
166
+ }
167
+ return warnings;
168
+ }
169
+ extractSuggestions(text) {
170
+ const suggestions = [];
171
+ const lines = text.split("\n");
172
+ for (const line of lines) {
173
+ const lower = line.toLowerCase();
174
+ if (lower.includes("suggest") || lower.includes("recommend") || lower.includes("could") || lower.includes("improvement")) suggestions.push(line.trim());
175
+ }
176
+ return suggestions;
177
+ }
178
+ };
40
179
 
41
- You are also an expert in testing. Write comprehensive tests using Vitest.`:t}buildUserPrompt(e){let t={generate:`Generate a complete, production-ready implementation for this specification:\n\n${e.specCode}\n\nProvide ONLY the TypeScript code, no explanations.`,test:`Generate comprehensive tests for this code:\n\nSpec:\n${e.specCode}\n\nImplementation:\n${e.existingCode}\n\nProvide complete Vitest test suite.`,refactor:`Refactor this code while preserving functionality:\n\n${e.existingCode}\n\nSpec:\n${e.specCode}`,validate:`Validate this implementation:\n\nSpec:\n${e.specCode}\n\nCode:\n${e.existingCode}`};return t[e.type]||t.generate}extractCode(e){let t=e.match(/```(?:typescript|ts|tsx)?\n([\s\S]*?)\n```/);return t&&t[1]?t[1]:e}detectIssues(e){let t=[`missing`,`incorrect`,`bug`,`error`,`violation`,`does not`,`fails to`,`not implemented`,`critical`],n=e.toLowerCase();return t.some(e=>n.includes(e))}extractErrors(e){let t=[],n=e.split(`
42
- `);for(let e of n){let n=e.toLowerCase();(n.includes(`error`)||n.includes(`bug`)||n.includes(`incorrect`)||n.includes(`missing`))&&t.push(e.trim())}return t.length>0?t:[`Code review identified issues`]}extractWarnings(e){let t=[],n=e.split(`
43
- `);for(let e of n){let n=e.toLowerCase();(n.includes(`warning`)||n.includes(`should`)||n.includes(`consider`))&&t.push(e.trim())}return t}extractSuggestions(e){let t=[],n=e.split(`
44
- `);for(let e of n){let n=e.toLowerCase();(n.includes(`suggest`)||n.includes(`recommend`)||n.includes(`could`)||n.includes(`improvement`))&&t.push(e.trim())}return t}};export{n as ClaudeCodeAgent};
180
+ //#endregion
181
+ export { ClaudeCodeAgent };
@@ -1,4 +1,188 @@
1
- import{join as e}from"path";import{existsSync as t}from"fs";import{exec as n,spawn as r}from"child_process";import{mkdir as i,readFile as a,rm as o,writeFile as s}from"fs/promises";import{homedir as c,tmpdir as l}from"os";import{promisify as u}from"util";u(n);var d=class{name=`cursor`;cursorPath=null;isWindsurf=!1;composerPort;constructor(){this.composerPort=process.env.CURSOR_COMPOSER_PORT||`3000`,this.detectEnvironment()}canHandle(e){return this.isCursorAvailable()}async generate(t){try{let n=e(l(),`cursor-agent-${Date.now()}`);await i(n,{recursive:!0});let r=await this.executeWithBestMethod(t,n);return await this.cleanupWorkDir(n),r}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}async validate(t){try{let n=e(l(),`cursor-validate-${Date.now()}`);await i(n,{recursive:!0}),await this.setupValidationWorkspace(t,n);let r=await this.executeWithBestMethod({...t,type:`validate`},n);return await this.cleanupWorkDir(n),r}catch(e){return{success:!1,errors:[e instanceof Error?e.message:String(e)]}}}detectEnvironment(){this.isWindsurf=!!(process.env.WINDSURF_SESSION||process.env.CURSOR_USER_DATA||process.env.VSCODE_CWD?.includes(`Cursor`)||process.env.VSCODE_CWD?.includes(`Windsurf`));let n=[`/usr/local/bin/cursor`,`/Applications/Cursor.app/Contents/MacOS/Cursor`,`/Applications/Windsurf.app/Contents/MacOS/Windsurf`,e(c(),`.cursor`,`cursor`),e(c(),`AppData`,`Local`,`Programs`,`cursor`,`Cursor.exe`),e(c(),`AppData`,`Local`,`Programs`,`windsurf`,`Windsurf.exe`),`cursor`,`windsurf`];for(let e of n)if(e.includes(`cursor`)||e.includes(`Cursor`)||e.includes(`windsurf`)||e.includes(`Windsurf`))try{if(t(e)){this.cursorPath=e;break}}catch{continue}}async executeWithBestMethod(e,t){let n=[{name:`cursor-cli`,fn:()=>this.useCursorCLI(e,t)},{name:`file-based`,fn:()=>this.useFileBasedApproach(e,t)}];for(let e of n)try{let t=await e.fn();if(t.success)return t}catch{continue}return{success:!1,warnings:[`Cursor agent could not connect to IDE.`,`Ensure Cursor/Windsurf is running with API enabled.`,`Falling back to simple agent mode is recommended.`],errors:[`All Cursor integration methods failed`],metadata:{agentMode:`cursor`,status:`unavailable`,suggestion:`Use --agent-mode claude-code or --agent-mode simple`}}}async useCursorCLI(n,i){if(!this.cursorPath)throw Error(`Cursor executable not found`);let o=e(i,`spec.ts`),c=e(i,`output.ts`),l=e(i,`INSTRUCTIONS.md`);return await s(o,n.specCode),await s(l,this.buildDetailedPrompt(n)),n.existingCode&&await s(e(i,`existing.ts`),n.existingCode),new Promise((e,n)=>{let o=[`--wait`,`--new-window`,i],s=r(this.cursorPath,o,{cwd:i,stdio:`pipe`,detached:!1}),l=``,u=``;s.stdout?.on(`data`,e=>{l+=e.toString()}),s.stderr?.on(`data`,e=>{u+=e.toString()}),s.on(`error`,e=>{n(e)}),s.on(`close`,async r=>{if(t(c))try{e({success:!0,code:await a(c,`utf-8`),metadata:{agentMode:`cursor`,method:`cli`,exitCode:r}})}catch{n(Error(`Failed to read generated output`))}else n(Error(`Cursor CLI exited with code ${r}. No output generated.`))}),setTimeout(()=>{s.kill(),n(Error(`Cursor CLI timeout`))},6e4)})}async useFileBasedApproach(t,n){let r=e(n,`SPECIFICATION.ts`),i=e(n,`INSTRUCTIONS.md`),a=e(n,`template.ts`);return await s(r,t.specCode),await s(i,this.buildDetailedPrompt(t)),await s(a,this.generateTemplate(t)),await s(e(n,`README.md`),`# Cursor Agent Workspace
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
2
186
 
3
187
  This workspace was prepared for Cursor AI code generation.
4
188
 
@@ -13,8 +197,53 @@ This workspace was prepared for Cursor AI code generation.
13
197
  3. Use Cursor AI to generate code based on the spec
14
198
  4. Save the result as output.ts
15
199
 
16
- Workspace path: ${n}
17
- `),{success:!1,warnings:[`Cursor agent created workspace but cannot auto-execute.`,`Workspace prepared at: ${n}`,`Open this folder in Cursor IDE to complete code generation.`],code:this.generateTemplate(t),metadata:{agentMode:`cursor`,method:`file-based`,workDir:n}}}async setupValidationWorkspace(t,n){await s(e(n,`specification.ts`),t.specCode),await s(e(n,`implementation.ts`),t.existingCode||`// No implementation`),await s(e(n,`VALIDATION_INSTRUCTIONS.md`),this.buildValidationPrompt(t))}async prepareFilesForAPI(e,t){let n=[{path:`spec.ts`,content:e.specCode}];return e.existingCode&&n.push({path:`existing.ts`,content:e.existingCode}),n}buildDetailedPrompt(e){let t=`# AI Code Generation Task - Cursor Agent\n\n**Task Type:** ${e.type}\n**Generated:** ${new Date().toISOString()}\n\n`,n=`## Specification\n\n\`\`\`typescript\n${e.specCode}\n\`\`\`\n\n`,r={generate:`## Task: Generate Implementation
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
18
247
 
19
248
  ### Requirements:
20
249
  1. **Type Safety**: Use strict TypeScript with comprehensive types
@@ -34,11 +263,12 @@ Workspace path: ${n}
34
263
 
35
264
  ### Output Format:
36
265
  Provide complete, executable TypeScript code that fully implements the specification.
37
- Include all necessary imports and type definitions.`,validate:`## Task: Validate Implementation
266
+ Include all necessary imports and type definitions.`,
267
+ validate: `## Task: Validate Implementation
38
268
 
39
269
  ### Current Implementation:
40
270
  \`\`\`typescript
41
- ${e.existingCode||`// No implementation provided`}
271
+ ${task.existingCode || "// No implementation provided"}
42
272
  \`\`\`
43
273
 
44
274
  ### Validation Criteria:
@@ -62,11 +292,12 @@ Provide a detailed validation report with:
62
292
  - **Status**: Pass/Fail
63
293
  - **Issues Found**: List all problems
64
294
  - **Recommendations**: Specific improvements needed
65
- - **Code Quality Score**: Rate the implementation`,test:`## Task: Generate Tests
295
+ - **Code Quality Score**: Rate the implementation`,
296
+ test: `## Task: Generate Tests
66
297
 
67
298
  ### Implementation to Test:
68
299
  \`\`\`typescript
69
- ${e.existingCode||``}
300
+ ${task.existingCode || ""}
70
301
  \`\`\`
71
302
 
72
303
  ### Test Requirements:
@@ -84,11 +315,12 @@ ${e.existingCode||``}
84
315
  - Performance tests (if applicable)
85
316
 
86
317
  ### Output Format:
87
- Complete Vitest test file with comprehensive test coverage.`,refactor:`## Task: Refactor Code
318
+ Complete Vitest test file with comprehensive test coverage.`,
319
+ refactor: `## Task: Refactor Code
88
320
 
89
321
  ### Current Code:
90
322
  \`\`\`typescript
91
- ${e.existingCode||``}
323
+ ${task.existingCode || ""}
92
324
  \`\`\`
93
325
 
94
326
  ### Refactoring Goals:
@@ -107,16 +339,24 @@ ${e.existingCode||``}
107
339
  - Enhance error messages
108
340
 
109
341
  ### Output Format:
110
- Refactored code that maintains functionality while improving quality.`};return t+n+(r[e.type]||r.generate)}buildValidationPrompt(e){return`# Implementation Validation Report
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
111
351
 
112
352
  ## Specification
113
353
  \`\`\`typescript
114
- ${e.specCode}
354
+ ${task.specCode}
115
355
  \`\`\`
116
356
 
117
357
  ## Implementation
118
358
  \`\`\`typescript
119
- ${e.existingCode||`// No implementation`}
359
+ ${task.existingCode || "// No implementation"}
120
360
  \`\`\`
121
361
 
122
362
  ## Validation Checklist
@@ -152,11 +392,15 @@ ${e.existingCode||`// No implementation`}
152
392
  ## Instructions
153
393
  Review the implementation against the specification and complete the checklist.
154
394
  Provide detailed feedback for each failed item.
155
- Suggest specific improvements with code examples where applicable.`}generateTemplate(e){return`// Auto-generated template for ${e.type} task
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
156
402
  // Specification:
157
- ${e.specCode.split(`
158
- `).map(e=>`// ${e}`).join(`
159
- `)}
403
+ ${task.specCode.split("\n").map((line) => `// ${line}`).join("\n")}
160
404
 
161
405
  // TODO: Implement according to specification
162
406
  // Use Cursor AI to complete this implementation
@@ -165,4 +409,29 @@ export function implementation() {
165
409
  // Implementation goes here
166
410
  throw new Error('Not implemented');
167
411
  }
168
- `}async cleanupWorkDir(e){try{await o(e,{recursive:!0,force:!0})}catch{}}isCursorAvailable(){return this.isWindsurf||this.cursorPath!==null||this.hasComposerAPI()}hasComposerAPI(){return!!(process.env.CURSOR_COMPOSER_PORT||process.env.CURSOR_API_ENABLED||this.isWindsurf)}};export{d as CursorAgent};
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 };
@@ -1 +1,5 @@
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{AgentOrchestrator as i}from"./orchestrator.js";
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";