vibeman 0.0.5 → 0.0.7

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 (239) hide show
  1. package/dist/api.js +43 -0
  2. package/dist/index.js +227 -104
  3. package/dist/ui/assets/index-C_kQPI1m.js +9 -0
  4. package/dist/ui/index.html +12 -0
  5. package/package.json +13 -46
  6. package/README.md +0 -12
  7. package/dist/runtime/api/.tsbuildinfo +0 -1
  8. package/dist/runtime/api/agent/agent-service.d.ts +0 -229
  9. package/dist/runtime/api/agent/agent-service.js +0 -963
  10. package/dist/runtime/api/agent/ai-providers/amp-cli-provider.d.ts +0 -38
  11. package/dist/runtime/api/agent/ai-providers/amp-cli-provider.js +0 -268
  12. package/dist/runtime/api/agent/ai-providers/claude-code-adapter.d.ts +0 -61
  13. package/dist/runtime/api/agent/ai-providers/claude-code-adapter.js +0 -362
  14. package/dist/runtime/api/agent/ai-providers/codex-cli-provider.d.ts +0 -36
  15. package/dist/runtime/api/agent/ai-providers/codex-cli-provider.js +0 -375
  16. package/dist/runtime/api/agent/ai-providers/gemini-cli-provider.d.ts +0 -24
  17. package/dist/runtime/api/agent/ai-providers/gemini-cli-provider.js +0 -291
  18. package/dist/runtime/api/agent/ai-providers/index.d.ts +0 -9
  19. package/dist/runtime/api/agent/ai-providers/index.js +0 -9
  20. package/dist/runtime/api/agent/ai-providers/types.d.ts +0 -185
  21. package/dist/runtime/api/agent/ai-providers/types.js +0 -5
  22. package/dist/runtime/api/agent/amp-cli-provider.test.d.ts +0 -1
  23. package/dist/runtime/api/agent/amp-cli-provider.test.js +0 -99
  24. package/dist/runtime/api/agent/codex-cli-provider.test.d.ts +0 -1
  25. package/dist/runtime/api/agent/codex-cli-provider.test.js +0 -172
  26. package/dist/runtime/api/agent/core-agent-service.d.ts +0 -119
  27. package/dist/runtime/api/agent/core-agent-service.js +0 -267
  28. package/dist/runtime/api/agent/parsers.d.ts +0 -16
  29. package/dist/runtime/api/agent/parsers.js +0 -308
  30. package/dist/runtime/api/agent/prompt-service.d.ts +0 -30
  31. package/dist/runtime/api/agent/prompt-service.js +0 -452
  32. package/dist/runtime/api/agent/prompt-service.test.d.ts +0 -1
  33. package/dist/runtime/api/agent/prompt-service.test.js +0 -265
  34. package/dist/runtime/api/agent/routing-policy.d.ts +0 -171
  35. package/dist/runtime/api/agent/routing-policy.js +0 -196
  36. package/dist/runtime/api/agent/routing-policy.test.d.ts +0 -1
  37. package/dist/runtime/api/agent/routing-policy.test.js +0 -63
  38. package/dist/runtime/api/api/router-helpers.d.ts +0 -32
  39. package/dist/runtime/api/api/router-helpers.js +0 -31
  40. package/dist/runtime/api/api/routers/ai.d.ts +0 -200
  41. package/dist/runtime/api/api/routers/ai.js +0 -396
  42. package/dist/runtime/api/api/routers/executions.d.ts +0 -93
  43. package/dist/runtime/api/api/routers/executions.js +0 -94
  44. package/dist/runtime/api/api/routers/git.d.ts +0 -45
  45. package/dist/runtime/api/api/routers/git.js +0 -35
  46. package/dist/runtime/api/api/routers/provider-config.d.ts +0 -199
  47. package/dist/runtime/api/api/routers/provider-config.js +0 -252
  48. package/dist/runtime/api/api/routers/settings.d.ts +0 -158
  49. package/dist/runtime/api/api/routers/settings.js +0 -129
  50. package/dist/runtime/api/api/routers/tasks.d.ts +0 -141
  51. package/dist/runtime/api/api/routers/tasks.js +0 -238
  52. package/dist/runtime/api/api/routers/workflows.d.ts +0 -275
  53. package/dist/runtime/api/api/routers/workflows.js +0 -311
  54. package/dist/runtime/api/api/routers/worktrees.d.ts +0 -101
  55. package/dist/runtime/api/api/routers/worktrees.js +0 -80
  56. package/dist/runtime/api/api/trpc.d.ts +0 -118
  57. package/dist/runtime/api/api/trpc.js +0 -34
  58. package/dist/runtime/api/index.d.ts +0 -9
  59. package/dist/runtime/api/index.js +0 -117
  60. package/dist/runtime/api/lib/id-generator.d.ts +0 -70
  61. package/dist/runtime/api/lib/id-generator.js +0 -123
  62. package/dist/runtime/api/lib/local-config.d.ts +0 -335
  63. package/dist/runtime/api/lib/local-config.js +0 -304
  64. package/dist/runtime/api/lib/logger.d.ts +0 -11
  65. package/dist/runtime/api/lib/logger.js +0 -188
  66. package/dist/runtime/api/lib/provider-detection.d.ts +0 -61
  67. package/dist/runtime/api/lib/provider-detection.js +0 -326
  68. package/dist/runtime/api/lib/server/agent-service-singleton.d.ts +0 -6
  69. package/dist/runtime/api/lib/server/agent-service-singleton.js +0 -27
  70. package/dist/runtime/api/lib/server/bootstrap.d.ts +0 -38
  71. package/dist/runtime/api/lib/server/bootstrap.js +0 -197
  72. package/dist/runtime/api/lib/server/git-service-singleton.d.ts +0 -6
  73. package/dist/runtime/api/lib/server/git-service-singleton.js +0 -47
  74. package/dist/runtime/api/lib/server/project-root.d.ts +0 -2
  75. package/dist/runtime/api/lib/server/project-root.js +0 -61
  76. package/dist/runtime/api/lib/server/task-service-singleton.d.ts +0 -7
  77. package/dist/runtime/api/lib/server/task-service-singleton.js +0 -58
  78. package/dist/runtime/api/lib/server/vibeman-info.d.ts +0 -5
  79. package/dist/runtime/api/lib/server/vibeman-info.js +0 -85
  80. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.d.ts +0 -7
  81. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.js +0 -57
  82. package/dist/runtime/api/lib/trpc/server.d.ts +0 -965
  83. package/dist/runtime/api/lib/trpc/server.js +0 -11
  84. package/dist/runtime/api/lib/trpc/ws-server.d.ts +0 -8
  85. package/dist/runtime/api/lib/trpc/ws-server.js +0 -33
  86. package/dist/runtime/api/persistence/database-service.d.ts +0 -14
  87. package/dist/runtime/api/persistence/database-service.js +0 -74
  88. package/dist/runtime/api/persistence/execution-log-persistence.d.ts +0 -90
  89. package/dist/runtime/api/persistence/execution-log-persistence.js +0 -426
  90. package/dist/runtime/api/persistence/execution-log-persistence.test.d.ts +0 -1
  91. package/dist/runtime/api/persistence/execution-log-persistence.test.js +0 -170
  92. package/dist/runtime/api/router.d.ts +0 -968
  93. package/dist/runtime/api/router.js +0 -34
  94. package/dist/runtime/api/settings-service.d.ts +0 -110
  95. package/dist/runtime/api/settings-service.js +0 -678
  96. package/dist/runtime/api/tasks/file-watcher.d.ts +0 -23
  97. package/dist/runtime/api/tasks/file-watcher.js +0 -88
  98. package/dist/runtime/api/tasks/task-file-parser.d.ts +0 -14
  99. package/dist/runtime/api/tasks/task-file-parser.js +0 -180
  100. package/dist/runtime/api/tasks/task-service.d.ts +0 -36
  101. package/dist/runtime/api/tasks/task-service.js +0 -173
  102. package/dist/runtime/api/tasks/task-updater.d.ts +0 -62
  103. package/dist/runtime/api/tasks/task-updater.js +0 -260
  104. package/dist/runtime/api/tasks/task-updater.test.d.ts +0 -1
  105. package/dist/runtime/api/tasks/task-updater.test.js +0 -303
  106. package/dist/runtime/api/types/index.d.ts +0 -186
  107. package/dist/runtime/api/types/index.js +0 -1
  108. package/dist/runtime/api/types/settings.d.ts +0 -105
  109. package/dist/runtime/api/types/settings.js +0 -2
  110. package/dist/runtime/api/types.d.ts +0 -2
  111. package/dist/runtime/api/types.js +0 -1
  112. package/dist/runtime/api/utils/env.d.ts +0 -6
  113. package/dist/runtime/api/utils/env.js +0 -12
  114. package/dist/runtime/api/utils/stripNextEnv.d.ts +0 -7
  115. package/dist/runtime/api/utils/stripNextEnv.js +0 -22
  116. package/dist/runtime/api/utils/title-slug.d.ts +0 -6
  117. package/dist/runtime/api/utils/title-slug.js +0 -77
  118. package/dist/runtime/api/utils/url.d.ts +0 -2
  119. package/dist/runtime/api/utils/url.js +0 -19
  120. package/dist/runtime/api/vcs/git-history-service.d.ts +0 -57
  121. package/dist/runtime/api/vcs/git-history-service.js +0 -228
  122. package/dist/runtime/api/vcs/git-service.d.ts +0 -136
  123. package/dist/runtime/api/vcs/git-service.js +0 -307
  124. package/dist/runtime/api/vcs/worktree-service.d.ts +0 -93
  125. package/dist/runtime/api/vcs/worktree-service.js +0 -518
  126. package/dist/runtime/api/vcs/worktree-service.test.d.ts +0 -1
  127. package/dist/runtime/api/vcs/worktree-service.test.js +0 -20
  128. package/dist/runtime/api/workflows/quality-pipeline.d.ts +0 -58
  129. package/dist/runtime/api/workflows/quality-pipeline.js +0 -401
  130. package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +0 -406
  131. package/dist/runtime/api/workflows/vibing-orchestrator.js +0 -2462
  132. package/dist/runtime/api/workflows/workflow-effects.d.ts +0 -45
  133. package/dist/runtime/api/workflows/workflow-effects.js +0 -49
  134. package/dist/runtime/api/workflows/workflow-reconciler.d.ts +0 -65
  135. package/dist/runtime/api/workflows/workflow-reconciler.js +0 -226
  136. package/dist/runtime/api/workflows/workflow-reducer.d.ts +0 -26
  137. package/dist/runtime/api/workflows/workflow-reducer.js +0 -288
  138. package/dist/runtime/api/workflows/workflow-reducer.test.d.ts +0 -1
  139. package/dist/runtime/api/workflows/workflow-reducer.test.js +0 -247
  140. package/dist/runtime/api/workflows/workflow-schema.d.ts +0 -546
  141. package/dist/runtime/api/workflows/workflow-schema.js +0 -256
  142. package/dist/runtime/web/.next/BUILD_ID +0 -1
  143. package/dist/runtime/web/.next/app-build-manifest.json +0 -66
  144. package/dist/runtime/web/.next/app-path-routes-manifest.json +0 -8
  145. package/dist/runtime/web/.next/build-manifest.json +0 -33
  146. package/dist/runtime/web/.next/package.json +0 -1
  147. package/dist/runtime/web/.next/prerender-manifest.json +0 -61
  148. package/dist/runtime/web/.next/react-loadable-manifest.json +0 -8
  149. package/dist/runtime/web/.next/required-server-files.json +0 -334
  150. package/dist/runtime/web/.next/routes-manifest.json +0 -70
  151. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js +0 -1
  152. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js.nft.json +0 -1
  153. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route_client-reference-manifest.js +0 -1
  154. package/dist/runtime/web/.next/server/app/_not-found/page.js +0 -2
  155. package/dist/runtime/web/.next/server/app/_not-found/page.js.nft.json +0 -1
  156. package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
  157. package/dist/runtime/web/.next/server/app/_not-found.html +0 -7
  158. package/dist/runtime/web/.next/server/app/_not-found.meta +0 -8
  159. package/dist/runtime/web/.next/server/app/_not-found.rsc +0 -22
  160. package/dist/runtime/web/.next/server/app/api/health/route.js +0 -1
  161. package/dist/runtime/web/.next/server/app/api/health/route.js.nft.json +0 -1
  162. package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +0 -1
  163. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +0 -1
  164. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js.nft.json +0 -1
  165. package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +0 -1
  166. package/dist/runtime/web/.next/server/app/api/upload/route.js +0 -1
  167. package/dist/runtime/web/.next/server/app/api/upload/route.js.nft.json +0 -1
  168. package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +0 -1
  169. package/dist/runtime/web/.next/server/app/index.html +0 -7
  170. package/dist/runtime/web/.next/server/app/index.meta +0 -7
  171. package/dist/runtime/web/.next/server/app/index.rsc +0 -27
  172. package/dist/runtime/web/.next/server/app/page.js +0 -112
  173. package/dist/runtime/web/.next/server/app/page.js.nft.json +0 -1
  174. package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +0 -1
  175. package/dist/runtime/web/.next/server/app-paths-manifest.json +0 -8
  176. package/dist/runtime/web/.next/server/chunks/210.js +0 -1
  177. package/dist/runtime/web/.next/server/chunks/291.js +0 -18
  178. package/dist/runtime/web/.next/server/chunks/552.js +0 -22
  179. package/dist/runtime/web/.next/server/chunks/780.js +0 -1
  180. package/dist/runtime/web/.next/server/chunks/905.js +0 -6
  181. package/dist/runtime/web/.next/server/chunks/98.js +0 -1
  182. package/dist/runtime/web/.next/server/functions-config-manifest.json +0 -4
  183. package/dist/runtime/web/.next/server/middleware-build-manifest.js +0 -1
  184. package/dist/runtime/web/.next/server/middleware-manifest.json +0 -6
  185. package/dist/runtime/web/.next/server/middleware-react-loadable-manifest.js +0 -1
  186. package/dist/runtime/web/.next/server/next-font-manifest.js +0 -1
  187. package/dist/runtime/web/.next/server/next-font-manifest.json +0 -1
  188. package/dist/runtime/web/.next/server/pages/404.html +0 -7
  189. package/dist/runtime/web/.next/server/pages/500.html +0 -1
  190. package/dist/runtime/web/.next/server/pages/_app.js +0 -1
  191. package/dist/runtime/web/.next/server/pages/_app.js.nft.json +0 -1
  192. package/dist/runtime/web/.next/server/pages/_document.js +0 -1
  193. package/dist/runtime/web/.next/server/pages/_document.js.nft.json +0 -1
  194. package/dist/runtime/web/.next/server/pages/_error.js +0 -19
  195. package/dist/runtime/web/.next/server/pages/_error.js.nft.json +0 -1
  196. package/dist/runtime/web/.next/server/pages-manifest.json +0 -6
  197. package/dist/runtime/web/.next/server/server-reference-manifest.js +0 -1
  198. package/dist/runtime/web/.next/server/server-reference-manifest.json +0 -1
  199. package/dist/runtime/web/.next/server/webpack-runtime.js +0 -1
  200. package/dist/runtime/web/.next/static/LJFZk_8tvKFN_Ee4HqUuM/_buildManifest.js +0 -1
  201. package/dist/runtime/web/.next/static/LJFZk_8tvKFN_Ee4HqUuM/_ssgManifest.js +0 -1
  202. package/dist/runtime/web/.next/static/chunks/05c91ade-7d09b2b280adffd1.js +0 -1
  203. package/dist/runtime/web/.next/static/chunks/201-51bef3fa8c832e2e.js +0 -1
  204. package/dist/runtime/web/.next/static/chunks/524-89747ed9b0294f8a.js +0 -1
  205. package/dist/runtime/web/.next/static/chunks/554-8bec6e9cca6acc67.js +0 -1
  206. package/dist/runtime/web/.next/static/chunks/764.86e9503a69d45a85.js +0 -1
  207. package/dist/runtime/web/.next/static/chunks/7ab4dc20-239138e0ae7af24a.js +0 -1
  208. package/dist/runtime/web/.next/static/chunks/905-342391e3d3a3678f.js +0 -20
  209. package/dist/runtime/web/.next/static/chunks/a8a5ce16-4edea7df2d9b544a.js +0 -79
  210. package/dist/runtime/web/.next/static/chunks/ad74d572-4c1b162e2c15acaa.js +0 -1
  211. package/dist/runtime/web/.next/static/chunks/app/.vibeman/assets/images/[...path]/route-7b752a8641f96c1f.js +0 -1
  212. package/dist/runtime/web/.next/static/chunks/app/_not-found/page-34e66b251c2b5044.js +0 -1
  213. package/dist/runtime/web/.next/static/chunks/app/api/health/route-7b752a8641f96c1f.js +0 -1
  214. package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-7b752a8641f96c1f.js +0 -1
  215. package/dist/runtime/web/.next/static/chunks/app/api/upload/route-7b752a8641f96c1f.js +0 -1
  216. package/dist/runtime/web/.next/static/chunks/app/layout-df9ac93cb02b2385.js +0 -1
  217. package/dist/runtime/web/.next/static/chunks/app/page-6610743f7de5f92a.js +0 -1
  218. package/dist/runtime/web/.next/static/chunks/c25e0690-e9b798b8de667da1.js +0 -1
  219. package/dist/runtime/web/.next/static/chunks/framework-57157ec4d37f64aa.js +0 -1
  220. package/dist/runtime/web/.next/static/chunks/main-app-156cc0c60371bd78.js +0 -1
  221. package/dist/runtime/web/.next/static/chunks/main-df25d367c47b1fec.js +0 -1
  222. package/dist/runtime/web/.next/static/chunks/pages/_app-9f629a5e1131d19f.js +0 -1
  223. package/dist/runtime/web/.next/static/chunks/pages/_error-9238238274c7efcd.js +0 -1
  224. package/dist/runtime/web/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  225. package/dist/runtime/web/.next/static/chunks/webpack-cd50e39b423d1808.js +0 -1
  226. package/dist/runtime/web/.next/static/css/2728291c68f99cb1.css +0 -3
  227. package/dist/runtime/web/.next/static/css/4fbf378a264bd4ea.css +0 -1
  228. package/dist/runtime/web/.next/static/css/521bd69cc298cd1a.css +0 -1
  229. package/dist/runtime/web/.next/static/css/537e22821e101b87.css +0 -1
  230. package/dist/runtime/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  231. package/dist/runtime/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  232. package/dist/runtime/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  233. package/dist/runtime/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  234. package/dist/runtime/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  235. package/dist/runtime/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  236. package/dist/runtime/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  237. package/dist/runtime/web/package.json +0 -65
  238. package/dist/runtime/web/server.js +0 -44
  239. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,9 +0,0 @@
1
- /**
2
- * AI Providers Module
3
- * Export all provider types and implementations
4
- */
5
- export { ClaudeCodeAdapter } from './claude-code-adapter.js';
6
- export { CodexCliProvider } from './codex-cli-provider.js';
7
- export { GeminiCliProvider } from './gemini-cli-provider.js';
8
- export { AmpCliProvider } from './amp-cli-provider.js';
9
- export * from './types.js';
@@ -1,9 +0,0 @@
1
- /**
2
- * AI Providers Module
3
- * Export all provider types and implementations
4
- */
5
- export { ClaudeCodeAdapter } from './claude-code-adapter.js';
6
- export { CodexCliProvider } from './codex-cli-provider.js';
7
- export { GeminiCliProvider } from './gemini-cli-provider.js';
8
- export { AmpCliProvider } from './amp-cli-provider.js';
9
- export * from './types.js';
@@ -1,185 +0,0 @@
1
- /**
2
- * Core AI Provider Abstraction
3
- * Defines the contract for AI execution providers (Claude, OpenAI, Local LLMs, etc.)
4
- */
5
- /**
6
- * Model information for available AI models
7
- */
8
- export interface ModelInfo {
9
- id: string;
10
- name: string;
11
- displayName: string;
12
- provider: string;
13
- contextWindow?: number;
14
- maxOutputTokens?: number;
15
- costPerInputToken?: number;
16
- costPerOutputToken?: number;
17
- capabilities?: string[];
18
- }
19
- /**
20
- * Tool permissions for AI execution
21
- * Source: https://docs.anthropic.com/en/docs/claude-code/settings#tools-available-to-claude
22
- */
23
- export type ToolPermission = 'Bash' | 'Edit' | 'Glob' | 'Grep' | 'MultiEdit' | 'NotebookEdit' | 'NotebookRead' | 'Read' | 'Task' | 'TodoWrite' | 'WebSearch' | 'WebFetch' | 'Write';
24
- /**
25
- * Execution options for AI providers
26
- */
27
- export interface ExecutionOptions {
28
- workingDirectory?: string;
29
- model?: string;
30
- temperature?: number;
31
- maxTokens?: number;
32
- tools?: ToolPermission[];
33
- timeout?: number;
34
- abortSignal?: AbortSignal;
35
- systemPrompt?: string;
36
- appendSystemPrompt?: string;
37
- /**
38
- * Permission mode for Claude Code SDK (provider-specific hint).
39
- * - default: standard prompts/permissions
40
- * - acceptEdits: auto-approve file edits and common FS ops
41
- * - bypassPermissions: auto-approve all tool uses (dangerous; headless automation)
42
- */
43
- permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions';
44
- /** Optional list of image file paths to attach (Codex CLI: --image) */
45
- images?: string[];
46
- /** Optional effort hint for reasoning presets (e.g., 'minimal'|'low'|'medium'|'high'|'extra_high'); informational only */
47
- effort?: string;
48
- /**
49
- * Enable Codex CLI full-auto + danger-full-access sandbox mode (>= v0.73) so automation
50
- * can edit files and run privileged commands.
51
- */
52
- dangerouslyBypassApprovalsAndSandbox?: boolean;
53
- }
54
- /**
55
- * Message types for streaming execution
56
- */
57
- export interface ExecutionMessage {
58
- type: 'init' | 'assistant' | 'tool_use' | 'result' | 'error' | 'system';
59
- timestamp: string;
60
- content?: string | any;
61
- metadata?: Record<string, any>;
62
- }
63
- /**
64
- * Initialization message
65
- */
66
- export interface InitMessage extends ExecutionMessage {
67
- type: 'init';
68
- sessionId: string;
69
- model: string;
70
- provider: string;
71
- }
72
- /**
73
- * Assistant message (AI response)
74
- */
75
- export interface AssistantMessage extends ExecutionMessage {
76
- type: 'assistant';
77
- content: string;
78
- toolCalls?: ToolCall[];
79
- }
80
- /**
81
- * Tool call information
82
- */
83
- export interface ToolCall {
84
- id: string;
85
- name: string;
86
- input?: any;
87
- output?: any;
88
- }
89
- /**
90
- * Tool use message
91
- */
92
- export interface ToolUseMessage extends ExecutionMessage {
93
- type: 'tool_use';
94
- tool: string;
95
- input: any;
96
- output?: any;
97
- }
98
- /**
99
- * Result message (final output)
100
- */
101
- export interface ResultMessage extends ExecutionMessage {
102
- type: 'result';
103
- success: boolean;
104
- result?: string;
105
- error?: string;
106
- usage?: {
107
- promptTokens: number;
108
- completionTokens: number;
109
- totalTokens: number;
110
- cost?: number;
111
- };
112
- duration?: number;
113
- }
114
- /**
115
- * Execution result for synchronous execution
116
- */
117
- export interface ExecutionResult {
118
- id: string;
119
- provider: string;
120
- model: string;
121
- content: string;
122
- usage: {
123
- promptTokens: number;
124
- completionTokens: number;
125
- totalTokens: number;
126
- cost?: number;
127
- };
128
- duration: number;
129
- error?: string;
130
- }
131
- /**
132
- * Provider capabilities
133
- */
134
- export interface ProviderCapabilities {
135
- streaming: boolean;
136
- tools: boolean;
137
- functionCalling: boolean;
138
- vision: boolean;
139
- codeExecution: boolean;
140
- maxContextWindow: number;
141
- maxOutputTokens: number;
142
- }
143
- /**
144
- * Provider status
145
- */
146
- export interface ProviderStatus {
147
- available: boolean;
148
- error?: string;
149
- models: ModelInfo[];
150
- capabilities: ProviderCapabilities;
151
- }
152
- /**
153
- * Core AI Provider interface
154
- * All AI providers must implement this interface
155
- */
156
- export interface AIProvider {
157
- /**
158
- * Provider identifier
159
- */
160
- readonly name: string;
161
- /**
162
- * Provider display name
163
- */
164
- readonly displayName: string;
165
- /**
166
- * Execute a prompt and return streaming messages
167
- */
168
- execute(prompt: string, options?: ExecutionOptions): AsyncIterableIterator<ExecutionMessage>;
169
- /**
170
- * Execute a prompt and return the final result (convenience method)
171
- */
172
- executeSync?(prompt: string, options?: ExecutionOptions): Promise<ExecutionResult>;
173
- /**
174
- * Detect available models for this provider
175
- */
176
- detectAvailableModels(): Promise<ModelInfo[]>;
177
- /**
178
- * Validate provider setup and configuration
179
- */
180
- validateSetup(): Promise<ProviderStatus>;
181
- /**
182
- * Get provider capabilities
183
- */
184
- getCapabilities(): ProviderCapabilities;
185
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Core AI Provider Abstraction
3
- * Defines the contract for AI execution providers (Claude, OpenAI, Local LLMs, etc.)
4
- */
5
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,99 +0,0 @@
1
- import { describe, it, expect, vi, afterEach } from 'vitest';
2
- // Toggle real CLI integration via env
3
- const USE_REAL = process.env.VITEST_USE_REAL_AMP === 'true';
4
- describe('AmpCliProvider (mocked)', () => {
5
- afterEach(() => {
6
- vi.resetAllMocks();
7
- });
8
- it('streams stdout, passes flags, and returns result', async () => {
9
- vi.resetModules();
10
- vi.doMock('child_process', () => {
11
- let captured = [];
12
- return {
13
- __captured: () => captured,
14
- spawn: (cmd, args, opts) => {
15
- captured = [cmd, args, opts];
16
- const { EventEmitter } = require('events');
17
- const stdout = new EventEmitter();
18
- const stderr = new EventEmitter();
19
- const proc = new EventEmitter();
20
- proc.stdout = stdout;
21
- proc.stderr = stderr;
22
- setTimeout(() => stdout.emit('data', Buffer.from('Hello from Amp\n')), 10);
23
- setTimeout(() => proc.emit('exit', 0, null), 20);
24
- return proc;
25
- },
26
- exec: vi.fn(),
27
- execFile: vi.fn(),
28
- };
29
- });
30
- const { AmpCliProvider } = await import('./ai-providers/amp-cli-provider.js');
31
- const provider = new AmpCliProvider({ defaultTimeoutMs: 1000, ampBinPath: 'amp' });
32
- const messages = [];
33
- const iter = provider.execute('What is this project about?', {
34
- workingDirectory: process.cwd(),
35
- model: 'auto',
36
- dangerouslyBypassApprovalsAndSandbox: true,
37
- });
38
- for await (const m of iter)
39
- messages.push(m);
40
- const resultMsg = messages.find((m) => m.type === 'result');
41
- expect(!!resultMsg).toBe(true);
42
- const assistantMsg = messages.find((m) => m.type === 'assistant');
43
- if (assistantMsg && typeof assistantMsg.content === 'string') {
44
- expect(assistantMsg.content.length).toBeGreaterThan(0);
45
- }
46
- else if (resultMsg && typeof resultMsg.result === 'string') {
47
- expect(resultMsg.result.length).toBeGreaterThan(0);
48
- }
49
- const mockSpawn = await import('child_process');
50
- const captured = mockSpawn.__captured();
51
- expect(captured[0]).toBe('amp');
52
- expect(Array.isArray(captured[1])).toBe(true);
53
- expect(captured[1]).toContain('-x');
54
- // Amp integration runs in auto mode (no explicit model flag)
55
- expect(captured[1]).not.toContain('--use-sonnet');
56
- // Check bypass
57
- expect(captured[1]).toContain('--dangerously-allow-all');
58
- // Check prompt passed as arg
59
- const promptArg = captured[1][1];
60
- expect(promptArg).toContain('What is this project about?');
61
- });
62
- it('prepends system prompts', async () => {
63
- vi.resetModules();
64
- vi.doMock('child_process', () => {
65
- let captured = [];
66
- return {
67
- __captured: () => captured,
68
- spawn: (cmd, args, opts) => {
69
- captured = [cmd, args, opts];
70
- const { EventEmitter } = require('events');
71
- const stdout = new EventEmitter();
72
- const proc = new EventEmitter();
73
- proc.stdout = stdout;
74
- setTimeout(() => stdout.emit('data', Buffer.from('Done\n')), 5);
75
- setTimeout(() => proc.emit('exit', 0, null), 10);
76
- return proc;
77
- },
78
- exec: vi.fn(),
79
- execFile: vi.fn(),
80
- };
81
- });
82
- const { AmpCliProvider } = await import('./ai-providers/amp-cli-provider.js');
83
- const provider = new AmpCliProvider({ ampBinPath: 'amp' });
84
- const iter = provider.execute('Implement feature', {
85
- workingDirectory: '/tmp/project',
86
- systemPrompt: 'Base system prompt',
87
- appendSystemPrompt: 'Additional guidance',
88
- });
89
- for await (const _ of iter) {
90
- // drain iterator
91
- }
92
- const mockSpawn = await import('child_process');
93
- const captured = mockSpawn.__captured();
94
- const promptArg = captured[1][1];
95
- expect(promptArg).toContain('Base system prompt');
96
- expect(promptArg).toContain('Additional guidance');
97
- expect(promptArg).toContain('Implement feature');
98
- });
99
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,172 +0,0 @@
1
- import { describe, it, expect, vi, afterEach } from 'vitest';
2
- // Toggle real CLI integration via env
3
- const USE_REAL = process.env.VITEST_USE_REAL_CODEX === 'true';
4
- // Note: we dynamically import the provider after (un)mocking per test block
5
- describe('CodexCliProvider (mocked)', () => {
6
- afterEach(() => {
7
- vi.resetAllMocks();
8
- });
9
- it('streams stdout, passes images flag, and returns result', async () => {
10
- vi.resetModules();
11
- vi.doMock('child_process', () => {
12
- let captured = [];
13
- return {
14
- __captured: () => captured,
15
- spawn: (cmd, args, opts) => {
16
- captured = [cmd, args, opts];
17
- const { EventEmitter } = require('events');
18
- const stdout = new EventEmitter();
19
- const stderr = new EventEmitter();
20
- const proc = new EventEmitter();
21
- proc.stdout = stdout;
22
- proc.stderr = stderr;
23
- setTimeout(() => stdout.emit('data', Buffer.from('Hello from Codex\n')), 10);
24
- setTimeout(() => proc.emit('exit', 0, null), 20);
25
- return proc;
26
- },
27
- exec: vi.fn(),
28
- execFile: vi.fn(),
29
- };
30
- });
31
- const { CodexCliProvider } = await import('./ai-providers/codex-cli-provider.js');
32
- const provider = new CodexCliProvider({ defaultTimeoutMs: 1000, codexBinPath: 'codex' });
33
- const messages = [];
34
- const iter = provider.execute('What is this project about?', {
35
- workingDirectory: process.cwd(),
36
- images: ['a.png', 'b.jpg'],
37
- effort: 'minimal',
38
- model: 'gpt-5.2',
39
- });
40
- for await (const m of iter)
41
- messages.push(m);
42
- const resultMsg = messages.find((m) => m.type === 'result');
43
- expect(!!resultMsg).toBe(true);
44
- const assistantMsg = messages.find((m) => m.type === 'assistant');
45
- if (assistantMsg && typeof assistantMsg.content === 'string') {
46
- expect(assistantMsg.content.length).toBeGreaterThan(0);
47
- }
48
- else if (resultMsg && typeof resultMsg.result === 'string') {
49
- expect(resultMsg.result.length).toBeGreaterThan(0);
50
- }
51
- const mockSpawn = await import('child_process');
52
- const captured = mockSpawn.__captured();
53
- expect(Array.isArray(captured[1])).toBe(true);
54
- expect(captured[1]).toContain('--image');
55
- expect(captured[1]).toContain('a.png,b.jpg');
56
- const modelIdx = captured[1].indexOf('--model');
57
- expect(modelIdx).toBeGreaterThan(-1);
58
- expect(captured[1][modelIdx + 1]).toBe('gpt-5.2');
59
- const configIdx = captured[1].indexOf('-c');
60
- expect(configIdx).toBeGreaterThan(-1);
61
- expect(captured[1][configIdx + 1]).toBe('model_reasoning_effort=low');
62
- });
63
- it('maps reasoning level encoded in model name to CLI flags', async () => {
64
- vi.resetModules();
65
- vi.doMock('child_process', () => {
66
- let captured = [];
67
- return {
68
- __captured: () => captured,
69
- spawn: (cmd, args, opts) => {
70
- captured = [cmd, args, opts];
71
- const { EventEmitter } = require('events');
72
- const stdout = new EventEmitter();
73
- const proc = new EventEmitter();
74
- proc.stdout = stdout;
75
- setTimeout(() => stdout.emit('data', Buffer.from('Reasoned\n')), 10);
76
- setTimeout(() => proc.emit('exit', 0, null), 20);
77
- return proc;
78
- },
79
- exec: vi.fn(),
80
- execFile: vi.fn(),
81
- };
82
- });
83
- const { CodexCliProvider } = await import('./ai-providers/codex-cli-provider.js');
84
- const provider = new CodexCliProvider({ codexBinPath: 'codex' });
85
- const messages = [];
86
- const iter = provider.execute('Solve with depth', {
87
- workingDirectory: process.cwd(),
88
- model: 'gpt-5.1-codex-max-extra-high',
89
- });
90
- for await (const m of iter)
91
- messages.push(m);
92
- const mockSpawn = await import('child_process');
93
- const captured = mockSpawn.__captured();
94
- const modelIdx = captured[1].indexOf('--model');
95
- expect(modelIdx).toBeGreaterThan(-1);
96
- expect(captured[1][modelIdx + 1]).toBe('gpt-5.1-codex-max');
97
- const configIdx = captured[1].indexOf('-c');
98
- expect(configIdx).toBeGreaterThan(-1);
99
- expect(captured[1][configIdx + 1]).toBe('model_reasoning_effort=extra_high');
100
- });
101
- it('prepends system prompts and toggles sandbox bypass flag', async () => {
102
- vi.resetModules();
103
- vi.doMock('child_process', () => {
104
- let captured = [];
105
- return {
106
- __captured: () => captured,
107
- spawn: (cmd, args, opts) => {
108
- captured = [cmd, args, opts];
109
- const { EventEmitter } = require('events');
110
- const stdout = new EventEmitter();
111
- const proc = new EventEmitter();
112
- proc.stdout = stdout;
113
- setTimeout(() => stdout.emit('data', Buffer.from('Done\n')), 5);
114
- setTimeout(() => proc.emit('exit', 0, null), 10);
115
- return proc;
116
- },
117
- exec: vi.fn(),
118
- execFile: vi.fn(),
119
- };
120
- });
121
- const { CodexCliProvider } = await import('./ai-providers/codex-cli-provider.js');
122
- const provider = new CodexCliProvider({ codexBinPath: 'codex' });
123
- const iter = provider.execute('Implement feature', {
124
- workingDirectory: '/tmp/project',
125
- systemPrompt: 'Base system prompt',
126
- appendSystemPrompt: 'Additional guidance',
127
- dangerouslyBypassApprovalsAndSandbox: true,
128
- });
129
- for await (const _ of iter) {
130
- // drain iterator
131
- }
132
- const mockSpawn = await import('child_process');
133
- const captured = mockSpawn.__captured();
134
- expect(captured[1][1]).toContain('Base system prompt');
135
- expect(captured[1][1]).toContain('Additional guidance');
136
- const fullAutoIdx = captured[1].indexOf('--full-auto');
137
- expect(fullAutoIdx).toBeGreaterThan(-1);
138
- const sandboxIdx = captured[1].indexOf('--sandbox');
139
- expect(sandboxIdx).toBeGreaterThan(-1);
140
- expect(captured[1][sandboxIdx + 1]).toBe('danger-full-access');
141
- });
142
- });
143
- // Real integration (opt-in)
144
- (USE_REAL ? describe : describe.skip)('CodexCliProvider (real CLI)', () => {
145
- it('answers a simple model question and prints output', { timeout: 120000 }, async () => {
146
- vi.resetModules();
147
- vi.doUnmock('child_process');
148
- const { CodexCliProvider } = await import('./ai-providers/codex-cli-provider.js');
149
- const provider = new CodexCliProvider({
150
- defaultWorkingDirectory: process.cwd(),
151
- defaultTimeoutMs: 120000,
152
- });
153
- const prompt = 'Just answer 1 + 1 = ? for testing.';
154
- let assistant = '';
155
- let sawResult = false;
156
- for await (const m of provider.execute(prompt, {
157
- workingDirectory: process.cwd(),
158
- timeout: 120000,
159
- })) {
160
- console.log('[CODEX]', m.type, typeof m.content === 'string' ? m.content : '');
161
- if (m.type === 'assistant' && typeof m.content === 'string') {
162
- if (!assistant)
163
- assistant = m.content.trim();
164
- }
165
- if (m.type === 'result') {
166
- sawResult = true;
167
- }
168
- }
169
- expect(sawResult).toBe(true);
170
- expect(assistant.length).toBeGreaterThan(0);
171
- });
172
- });
@@ -1,119 +0,0 @@
1
- /**
2
- * Core Agent Service - Pure AI Execution Engine
3
- * Provider-agnostic AI execution service
4
- */
5
- import { EventEmitter } from 'events';
6
- import { AIProvider, ExecutionOptions, ExecutionMessage, ModelInfo, ProviderStatus } from './ai-providers/index.js';
7
- /**
8
- * Execution state tracking
9
- */
10
- export interface ExecutionState {
11
- id: string;
12
- provider: string;
13
- status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
14
- startTime: string;
15
- endTime?: string;
16
- error?: string;
17
- messages: ExecutionMessage[];
18
- result?: string;
19
- usage?: {
20
- promptTokens: number;
21
- completionTokens: number;
22
- totalTokens: number;
23
- cost?: number;
24
- };
25
- abortController?: AbortController;
26
- }
27
- /**
28
- * Execution request
29
- */
30
- export interface ExecutionRequest {
31
- prompt: string;
32
- options?: ExecutionOptions;
33
- provider?: string;
34
- metadata?: Record<string, any>;
35
- executionId?: string;
36
- }
37
- /**
38
- * Execution update event
39
- */
40
- export interface ExecutionUpdate {
41
- executionId: string;
42
- status: ExecutionState['status'];
43
- message?: ExecutionMessage;
44
- error?: string;
45
- }
46
- /**
47
- * Agent Service Configuration
48
- */
49
- export interface AgentServiceConfig {
50
- defaultProvider?: string;
51
- executionTimeout?: number;
52
- }
53
- /**
54
- * Pure AI Execution Service
55
- * Manages AI providers and executions without business logic
56
- */
57
- export declare class CoreAgentService extends EventEmitter {
58
- private providers;
59
- private defaultProvider;
60
- private executions;
61
- private config;
62
- constructor(config?: AgentServiceConfig);
63
- /**
64
- * Register an AI provider
65
- */
66
- registerProvider(name: string, provider: AIProvider): void;
67
- /**
68
- * Set default provider
69
- */
70
- setDefaultProvider(name: string): void;
71
- /**
72
- * Get default provider name
73
- */
74
- getDefaultProvider(): string | null;
75
- /**
76
- * Get provider by name
77
- */
78
- getProvider(name: string): AIProvider | null;
79
- /**
80
- * Get all registered providers
81
- */
82
- getProviders(): Map<string, AIProvider>;
83
- /**
84
- * Execute a prompt with streaming
85
- */
86
- execute(request: ExecutionRequest): Promise<string>;
87
- /**
88
- * Get execution status
89
- */
90
- getExecutionStatus(executionId: string): ExecutionState | null;
91
- /**
92
- * Get execution messages
93
- */
94
- getExecutionMessages(executionId: string): ExecutionMessage[];
95
- /**
96
- * Stop an execution
97
- */
98
- stopExecution(executionId: string): Promise<void>;
99
- /**
100
- * Get all executions
101
- */
102
- getAllExecutions(): ExecutionState[];
103
- /**
104
- * Clear completed executions
105
- */
106
- clearCompletedExecutions(): number;
107
- /**
108
- * Validate all providers
109
- */
110
- validateProviders(): Promise<Map<string, ProviderStatus>>;
111
- /**
112
- * Get available models from all providers
113
- */
114
- getAvailableModels(): Promise<ModelInfo[]>;
115
- /**
116
- * Generate execution ID
117
- */
118
- private generateExecutionId;
119
- }