vibeman 0.0.5 → 0.0.6

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 (241) hide show
  1. package/dist/api.js +49 -0
  2. package/dist/cli.js +135 -0
  3. package/dist/ui/index-gnk6rhxs.js +9 -0
  4. package/dist/ui/index.html +10 -0
  5. package/dist/ui/index.js +2 -0
  6. package/package.json +10 -46
  7. package/README.md +0 -12
  8. package/dist/index.js +0 -114
  9. package/dist/runtime/api/.tsbuildinfo +0 -1
  10. package/dist/runtime/api/agent/agent-service.d.ts +0 -229
  11. package/dist/runtime/api/agent/agent-service.js +0 -963
  12. package/dist/runtime/api/agent/ai-providers/amp-cli-provider.d.ts +0 -38
  13. package/dist/runtime/api/agent/ai-providers/amp-cli-provider.js +0 -268
  14. package/dist/runtime/api/agent/ai-providers/claude-code-adapter.d.ts +0 -61
  15. package/dist/runtime/api/agent/ai-providers/claude-code-adapter.js +0 -362
  16. package/dist/runtime/api/agent/ai-providers/codex-cli-provider.d.ts +0 -36
  17. package/dist/runtime/api/agent/ai-providers/codex-cli-provider.js +0 -375
  18. package/dist/runtime/api/agent/ai-providers/gemini-cli-provider.d.ts +0 -24
  19. package/dist/runtime/api/agent/ai-providers/gemini-cli-provider.js +0 -291
  20. package/dist/runtime/api/agent/ai-providers/index.d.ts +0 -9
  21. package/dist/runtime/api/agent/ai-providers/index.js +0 -9
  22. package/dist/runtime/api/agent/ai-providers/types.d.ts +0 -185
  23. package/dist/runtime/api/agent/ai-providers/types.js +0 -5
  24. package/dist/runtime/api/agent/amp-cli-provider.test.d.ts +0 -1
  25. package/dist/runtime/api/agent/amp-cli-provider.test.js +0 -99
  26. package/dist/runtime/api/agent/codex-cli-provider.test.d.ts +0 -1
  27. package/dist/runtime/api/agent/codex-cli-provider.test.js +0 -172
  28. package/dist/runtime/api/agent/core-agent-service.d.ts +0 -119
  29. package/dist/runtime/api/agent/core-agent-service.js +0 -267
  30. package/dist/runtime/api/agent/parsers.d.ts +0 -16
  31. package/dist/runtime/api/agent/parsers.js +0 -308
  32. package/dist/runtime/api/agent/prompt-service.d.ts +0 -30
  33. package/dist/runtime/api/agent/prompt-service.js +0 -452
  34. package/dist/runtime/api/agent/prompt-service.test.d.ts +0 -1
  35. package/dist/runtime/api/agent/prompt-service.test.js +0 -265
  36. package/dist/runtime/api/agent/routing-policy.d.ts +0 -171
  37. package/dist/runtime/api/agent/routing-policy.js +0 -196
  38. package/dist/runtime/api/agent/routing-policy.test.d.ts +0 -1
  39. package/dist/runtime/api/agent/routing-policy.test.js +0 -63
  40. package/dist/runtime/api/api/router-helpers.d.ts +0 -32
  41. package/dist/runtime/api/api/router-helpers.js +0 -31
  42. package/dist/runtime/api/api/routers/ai.d.ts +0 -200
  43. package/dist/runtime/api/api/routers/ai.js +0 -396
  44. package/dist/runtime/api/api/routers/executions.d.ts +0 -93
  45. package/dist/runtime/api/api/routers/executions.js +0 -94
  46. package/dist/runtime/api/api/routers/git.d.ts +0 -45
  47. package/dist/runtime/api/api/routers/git.js +0 -35
  48. package/dist/runtime/api/api/routers/provider-config.d.ts +0 -199
  49. package/dist/runtime/api/api/routers/provider-config.js +0 -252
  50. package/dist/runtime/api/api/routers/settings.d.ts +0 -158
  51. package/dist/runtime/api/api/routers/settings.js +0 -129
  52. package/dist/runtime/api/api/routers/tasks.d.ts +0 -141
  53. package/dist/runtime/api/api/routers/tasks.js +0 -238
  54. package/dist/runtime/api/api/routers/workflows.d.ts +0 -275
  55. package/dist/runtime/api/api/routers/workflows.js +0 -311
  56. package/dist/runtime/api/api/routers/worktrees.d.ts +0 -101
  57. package/dist/runtime/api/api/routers/worktrees.js +0 -80
  58. package/dist/runtime/api/api/trpc.d.ts +0 -118
  59. package/dist/runtime/api/api/trpc.js +0 -34
  60. package/dist/runtime/api/index.d.ts +0 -9
  61. package/dist/runtime/api/index.js +0 -117
  62. package/dist/runtime/api/lib/id-generator.d.ts +0 -70
  63. package/dist/runtime/api/lib/id-generator.js +0 -123
  64. package/dist/runtime/api/lib/local-config.d.ts +0 -335
  65. package/dist/runtime/api/lib/local-config.js +0 -304
  66. package/dist/runtime/api/lib/logger.d.ts +0 -11
  67. package/dist/runtime/api/lib/logger.js +0 -188
  68. package/dist/runtime/api/lib/provider-detection.d.ts +0 -61
  69. package/dist/runtime/api/lib/provider-detection.js +0 -326
  70. package/dist/runtime/api/lib/server/agent-service-singleton.d.ts +0 -6
  71. package/dist/runtime/api/lib/server/agent-service-singleton.js +0 -27
  72. package/dist/runtime/api/lib/server/bootstrap.d.ts +0 -38
  73. package/dist/runtime/api/lib/server/bootstrap.js +0 -197
  74. package/dist/runtime/api/lib/server/git-service-singleton.d.ts +0 -6
  75. package/dist/runtime/api/lib/server/git-service-singleton.js +0 -47
  76. package/dist/runtime/api/lib/server/project-root.d.ts +0 -2
  77. package/dist/runtime/api/lib/server/project-root.js +0 -61
  78. package/dist/runtime/api/lib/server/task-service-singleton.d.ts +0 -7
  79. package/dist/runtime/api/lib/server/task-service-singleton.js +0 -58
  80. package/dist/runtime/api/lib/server/vibeman-info.d.ts +0 -5
  81. package/dist/runtime/api/lib/server/vibeman-info.js +0 -85
  82. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.d.ts +0 -7
  83. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.js +0 -57
  84. package/dist/runtime/api/lib/trpc/server.d.ts +0 -965
  85. package/dist/runtime/api/lib/trpc/server.js +0 -11
  86. package/dist/runtime/api/lib/trpc/ws-server.d.ts +0 -8
  87. package/dist/runtime/api/lib/trpc/ws-server.js +0 -33
  88. package/dist/runtime/api/persistence/database-service.d.ts +0 -14
  89. package/dist/runtime/api/persistence/database-service.js +0 -74
  90. package/dist/runtime/api/persistence/execution-log-persistence.d.ts +0 -90
  91. package/dist/runtime/api/persistence/execution-log-persistence.js +0 -426
  92. package/dist/runtime/api/persistence/execution-log-persistence.test.d.ts +0 -1
  93. package/dist/runtime/api/persistence/execution-log-persistence.test.js +0 -170
  94. package/dist/runtime/api/router.d.ts +0 -968
  95. package/dist/runtime/api/router.js +0 -34
  96. package/dist/runtime/api/settings-service.d.ts +0 -110
  97. package/dist/runtime/api/settings-service.js +0 -678
  98. package/dist/runtime/api/tasks/file-watcher.d.ts +0 -23
  99. package/dist/runtime/api/tasks/file-watcher.js +0 -88
  100. package/dist/runtime/api/tasks/task-file-parser.d.ts +0 -14
  101. package/dist/runtime/api/tasks/task-file-parser.js +0 -180
  102. package/dist/runtime/api/tasks/task-service.d.ts +0 -36
  103. package/dist/runtime/api/tasks/task-service.js +0 -173
  104. package/dist/runtime/api/tasks/task-updater.d.ts +0 -62
  105. package/dist/runtime/api/tasks/task-updater.js +0 -260
  106. package/dist/runtime/api/tasks/task-updater.test.d.ts +0 -1
  107. package/dist/runtime/api/tasks/task-updater.test.js +0 -303
  108. package/dist/runtime/api/types/index.d.ts +0 -186
  109. package/dist/runtime/api/types/index.js +0 -1
  110. package/dist/runtime/api/types/settings.d.ts +0 -105
  111. package/dist/runtime/api/types/settings.js +0 -2
  112. package/dist/runtime/api/types.d.ts +0 -2
  113. package/dist/runtime/api/types.js +0 -1
  114. package/dist/runtime/api/utils/env.d.ts +0 -6
  115. package/dist/runtime/api/utils/env.js +0 -12
  116. package/dist/runtime/api/utils/stripNextEnv.d.ts +0 -7
  117. package/dist/runtime/api/utils/stripNextEnv.js +0 -22
  118. package/dist/runtime/api/utils/title-slug.d.ts +0 -6
  119. package/dist/runtime/api/utils/title-slug.js +0 -77
  120. package/dist/runtime/api/utils/url.d.ts +0 -2
  121. package/dist/runtime/api/utils/url.js +0 -19
  122. package/dist/runtime/api/vcs/git-history-service.d.ts +0 -57
  123. package/dist/runtime/api/vcs/git-history-service.js +0 -228
  124. package/dist/runtime/api/vcs/git-service.d.ts +0 -136
  125. package/dist/runtime/api/vcs/git-service.js +0 -307
  126. package/dist/runtime/api/vcs/worktree-service.d.ts +0 -93
  127. package/dist/runtime/api/vcs/worktree-service.js +0 -518
  128. package/dist/runtime/api/vcs/worktree-service.test.d.ts +0 -1
  129. package/dist/runtime/api/vcs/worktree-service.test.js +0 -20
  130. package/dist/runtime/api/workflows/quality-pipeline.d.ts +0 -58
  131. package/dist/runtime/api/workflows/quality-pipeline.js +0 -401
  132. package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +0 -406
  133. package/dist/runtime/api/workflows/vibing-orchestrator.js +0 -2462
  134. package/dist/runtime/api/workflows/workflow-effects.d.ts +0 -45
  135. package/dist/runtime/api/workflows/workflow-effects.js +0 -49
  136. package/dist/runtime/api/workflows/workflow-reconciler.d.ts +0 -65
  137. package/dist/runtime/api/workflows/workflow-reconciler.js +0 -226
  138. package/dist/runtime/api/workflows/workflow-reducer.d.ts +0 -26
  139. package/dist/runtime/api/workflows/workflow-reducer.js +0 -288
  140. package/dist/runtime/api/workflows/workflow-reducer.test.d.ts +0 -1
  141. package/dist/runtime/api/workflows/workflow-reducer.test.js +0 -247
  142. package/dist/runtime/api/workflows/workflow-schema.d.ts +0 -546
  143. package/dist/runtime/api/workflows/workflow-schema.js +0 -256
  144. package/dist/runtime/web/.next/BUILD_ID +0 -1
  145. package/dist/runtime/web/.next/app-build-manifest.json +0 -66
  146. package/dist/runtime/web/.next/app-path-routes-manifest.json +0 -8
  147. package/dist/runtime/web/.next/build-manifest.json +0 -33
  148. package/dist/runtime/web/.next/package.json +0 -1
  149. package/dist/runtime/web/.next/prerender-manifest.json +0 -61
  150. package/dist/runtime/web/.next/react-loadable-manifest.json +0 -8
  151. package/dist/runtime/web/.next/required-server-files.json +0 -334
  152. package/dist/runtime/web/.next/routes-manifest.json +0 -70
  153. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js +0 -1
  154. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js.nft.json +0 -1
  155. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route_client-reference-manifest.js +0 -1
  156. package/dist/runtime/web/.next/server/app/_not-found/page.js +0 -2
  157. package/dist/runtime/web/.next/server/app/_not-found/page.js.nft.json +0 -1
  158. package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
  159. package/dist/runtime/web/.next/server/app/_not-found.html +0 -7
  160. package/dist/runtime/web/.next/server/app/_not-found.meta +0 -8
  161. package/dist/runtime/web/.next/server/app/_not-found.rsc +0 -22
  162. package/dist/runtime/web/.next/server/app/api/health/route.js +0 -1
  163. package/dist/runtime/web/.next/server/app/api/health/route.js.nft.json +0 -1
  164. package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +0 -1
  165. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +0 -1
  166. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js.nft.json +0 -1
  167. package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +0 -1
  168. package/dist/runtime/web/.next/server/app/api/upload/route.js +0 -1
  169. package/dist/runtime/web/.next/server/app/api/upload/route.js.nft.json +0 -1
  170. package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +0 -1
  171. package/dist/runtime/web/.next/server/app/index.html +0 -7
  172. package/dist/runtime/web/.next/server/app/index.meta +0 -7
  173. package/dist/runtime/web/.next/server/app/index.rsc +0 -27
  174. package/dist/runtime/web/.next/server/app/page.js +0 -112
  175. package/dist/runtime/web/.next/server/app/page.js.nft.json +0 -1
  176. package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +0 -1
  177. package/dist/runtime/web/.next/server/app-paths-manifest.json +0 -8
  178. package/dist/runtime/web/.next/server/chunks/210.js +0 -1
  179. package/dist/runtime/web/.next/server/chunks/291.js +0 -18
  180. package/dist/runtime/web/.next/server/chunks/552.js +0 -22
  181. package/dist/runtime/web/.next/server/chunks/780.js +0 -1
  182. package/dist/runtime/web/.next/server/chunks/905.js +0 -6
  183. package/dist/runtime/web/.next/server/chunks/98.js +0 -1
  184. package/dist/runtime/web/.next/server/functions-config-manifest.json +0 -4
  185. package/dist/runtime/web/.next/server/middleware-build-manifest.js +0 -1
  186. package/dist/runtime/web/.next/server/middleware-manifest.json +0 -6
  187. package/dist/runtime/web/.next/server/middleware-react-loadable-manifest.js +0 -1
  188. package/dist/runtime/web/.next/server/next-font-manifest.js +0 -1
  189. package/dist/runtime/web/.next/server/next-font-manifest.json +0 -1
  190. package/dist/runtime/web/.next/server/pages/404.html +0 -7
  191. package/dist/runtime/web/.next/server/pages/500.html +0 -1
  192. package/dist/runtime/web/.next/server/pages/_app.js +0 -1
  193. package/dist/runtime/web/.next/server/pages/_app.js.nft.json +0 -1
  194. package/dist/runtime/web/.next/server/pages/_document.js +0 -1
  195. package/dist/runtime/web/.next/server/pages/_document.js.nft.json +0 -1
  196. package/dist/runtime/web/.next/server/pages/_error.js +0 -19
  197. package/dist/runtime/web/.next/server/pages/_error.js.nft.json +0 -1
  198. package/dist/runtime/web/.next/server/pages-manifest.json +0 -6
  199. package/dist/runtime/web/.next/server/server-reference-manifest.js +0 -1
  200. package/dist/runtime/web/.next/server/server-reference-manifest.json +0 -1
  201. package/dist/runtime/web/.next/server/webpack-runtime.js +0 -1
  202. package/dist/runtime/web/.next/static/LJFZk_8tvKFN_Ee4HqUuM/_buildManifest.js +0 -1
  203. package/dist/runtime/web/.next/static/LJFZk_8tvKFN_Ee4HqUuM/_ssgManifest.js +0 -1
  204. package/dist/runtime/web/.next/static/chunks/05c91ade-7d09b2b280adffd1.js +0 -1
  205. package/dist/runtime/web/.next/static/chunks/201-51bef3fa8c832e2e.js +0 -1
  206. package/dist/runtime/web/.next/static/chunks/524-89747ed9b0294f8a.js +0 -1
  207. package/dist/runtime/web/.next/static/chunks/554-8bec6e9cca6acc67.js +0 -1
  208. package/dist/runtime/web/.next/static/chunks/764.86e9503a69d45a85.js +0 -1
  209. package/dist/runtime/web/.next/static/chunks/7ab4dc20-239138e0ae7af24a.js +0 -1
  210. package/dist/runtime/web/.next/static/chunks/905-342391e3d3a3678f.js +0 -20
  211. package/dist/runtime/web/.next/static/chunks/a8a5ce16-4edea7df2d9b544a.js +0 -79
  212. package/dist/runtime/web/.next/static/chunks/ad74d572-4c1b162e2c15acaa.js +0 -1
  213. package/dist/runtime/web/.next/static/chunks/app/.vibeman/assets/images/[...path]/route-7b752a8641f96c1f.js +0 -1
  214. package/dist/runtime/web/.next/static/chunks/app/_not-found/page-34e66b251c2b5044.js +0 -1
  215. package/dist/runtime/web/.next/static/chunks/app/api/health/route-7b752a8641f96c1f.js +0 -1
  216. package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-7b752a8641f96c1f.js +0 -1
  217. package/dist/runtime/web/.next/static/chunks/app/api/upload/route-7b752a8641f96c1f.js +0 -1
  218. package/dist/runtime/web/.next/static/chunks/app/layout-df9ac93cb02b2385.js +0 -1
  219. package/dist/runtime/web/.next/static/chunks/app/page-6610743f7de5f92a.js +0 -1
  220. package/dist/runtime/web/.next/static/chunks/c25e0690-e9b798b8de667da1.js +0 -1
  221. package/dist/runtime/web/.next/static/chunks/framework-57157ec4d37f64aa.js +0 -1
  222. package/dist/runtime/web/.next/static/chunks/main-app-156cc0c60371bd78.js +0 -1
  223. package/dist/runtime/web/.next/static/chunks/main-df25d367c47b1fec.js +0 -1
  224. package/dist/runtime/web/.next/static/chunks/pages/_app-9f629a5e1131d19f.js +0 -1
  225. package/dist/runtime/web/.next/static/chunks/pages/_error-9238238274c7efcd.js +0 -1
  226. package/dist/runtime/web/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  227. package/dist/runtime/web/.next/static/chunks/webpack-cd50e39b423d1808.js +0 -1
  228. package/dist/runtime/web/.next/static/css/2728291c68f99cb1.css +0 -3
  229. package/dist/runtime/web/.next/static/css/4fbf378a264bd4ea.css +0 -1
  230. package/dist/runtime/web/.next/static/css/521bd69cc298cd1a.css +0 -1
  231. package/dist/runtime/web/.next/static/css/537e22821e101b87.css +0 -1
  232. package/dist/runtime/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  233. package/dist/runtime/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  234. package/dist/runtime/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  235. package/dist/runtime/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  236. package/dist/runtime/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  237. package/dist/runtime/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  238. package/dist/runtime/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  239. package/dist/runtime/web/package.json +0 -65
  240. package/dist/runtime/web/server.js +0 -44
  241. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,63 +0,0 @@
1
- import { describe, it, expect, beforeAll, afterAll, afterEach } from 'vitest';
2
- import { RoutingPolicyManager, } from './routing-policy.js';
3
- import { getSettingsService } from '../settings-service.js';
4
- const settingsService = getSettingsService();
5
- const BASE_POLICY = {
6
- defaultProvider: 'claude-code',
7
- operations: {},
8
- };
9
- let originalRoutingPolicy;
10
- async function setRoutingPolicy(value) {
11
- const result = await settingsService.updateSettings([
12
- { path: ['agents', 'routingPolicy'], value },
13
- ]);
14
- if (!result.success) {
15
- throw new Error(`Failed to set routing policy: ${JSON.stringify(result.errors)}`);
16
- }
17
- }
18
- describe('RoutingPolicyManager resolve precedence', () => {
19
- beforeAll(async () => {
20
- await settingsService.initialize();
21
- const manager = new RoutingPolicyManager();
22
- originalRoutingPolicy = await manager.getPolicy();
23
- await setRoutingPolicy(BASE_POLICY);
24
- });
25
- afterEach(async () => {
26
- await setRoutingPolicy(BASE_POLICY);
27
- });
28
- afterAll(async () => {
29
- await setRoutingPolicy(originalRoutingPolicy);
30
- });
31
- it('falls back to settings when no operation config or overrides', async () => {
32
- const rpm = new RoutingPolicyManager();
33
- const resolved = await rpm.resolveProviderForOperation('execute_task');
34
- expect(resolved.provider).toBe('claude-code');
35
- expect(resolved.model).toBe('claude-sonnet-4-20250514');
36
- });
37
- it('uses operation-specific policy when provided', async () => {
38
- const rpm = new RoutingPolicyManager();
39
- await rpm.updatePolicy({
40
- operations: {
41
- ai_merge: { provider: 'codex', model: 'gpt-5.1-codex' },
42
- },
43
- });
44
- const resolved = await rpm.resolveProviderForOperation('ai_merge');
45
- expect(resolved.provider).toBe('codex');
46
- expect(resolved.model).toBe('gpt-5.1-codex');
47
- });
48
- it('when override sets provider without model, does not inherit mismatched model', async () => {
49
- const rpm = new RoutingPolicyManager();
50
- await rpm.updatePolicy({ operations: {} });
51
- const override = { provider: 'codex' };
52
- const resolved = await rpm.resolveProviderForOperation('execute_task', override);
53
- expect(resolved.provider).toBe('codex');
54
- expect(resolved.model).toBeUndefined();
55
- });
56
- it('override with provider+model takes full precedence', async () => {
57
- const rpm = new RoutingPolicyManager();
58
- const override = { provider: 'codex', model: 'gpt-5.1-codex' };
59
- const resolved = await rpm.resolveProviderForOperation('execute_task', override);
60
- expect(resolved.provider).toBe('codex');
61
- expect(resolved.model).toBe('gpt-5.1-codex');
62
- });
63
- });
@@ -1,32 +0,0 @@
1
- import { z } from 'zod';
2
- import type { TaskService } from '../tasks/task-service.js';
3
- export declare const TaskIdSchema: z.ZodObject<{
4
- taskId: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- taskId: string;
7
- }, {
8
- taskId: string;
9
- }>;
10
- export declare const ExecutionIdSchema: z.ZodObject<{
11
- executionId: z.ZodString;
12
- }, "strip", z.ZodTypeAny, {
13
- executionId: string;
14
- }, {
15
- executionId: string;
16
- }>;
17
- export declare const WorkflowIdSchema: z.ZodObject<{
18
- workflowId: z.ZodString;
19
- }, "strip", z.ZodTypeAny, {
20
- workflowId: string;
21
- }, {
22
- workflowId: string;
23
- }>;
24
- export declare const WorktreePathSchema: z.ZodObject<{
25
- worktreePath: z.ZodString;
26
- }, "strip", z.ZodTypeAny, {
27
- worktreePath: string;
28
- }, {
29
- worktreePath: string;
30
- }>;
31
- export declare const withErrors: <TArgs extends any[], TRes>(action: string, tag: string, fn: (...args: TArgs) => Promise<TRes>) => (...args: TArgs) => Promise<TRes>;
32
- export declare function makeAssertTaskActive(taskService: TaskService): (id: string) => import("../types/index.js").Task;
@@ -1,31 +0,0 @@
1
- import { z } from 'zod';
2
- import { log } from '../lib/logger.js';
3
- // Shared input schemas
4
- export const TaskIdSchema = z.object({ taskId: z.string() });
5
- export const ExecutionIdSchema = z.object({ executionId: z.string() });
6
- export const WorkflowIdSchema = z.object({ workflowId: z.string() });
7
- export const WorktreePathSchema = z.object({ worktreePath: z.string() });
8
- // Centralized error formatter for consistent messages
9
- export const withErrors = (action, tag, fn) => {
10
- return async (...args) => {
11
- try {
12
- return await fn(...args);
13
- }
14
- catch (error) {
15
- log.error(`Error in ${action}`, error, tag);
16
- const msg = error instanceof Error ? error.message : String(error);
17
- throw new Error(`Failed to ${action}: ${msg}`);
18
- }
19
- };
20
- };
21
- // Factory for active-task assertion to avoid repeating checks
22
- export function makeAssertTaskActive(taskService) {
23
- return (id) => {
24
- const t = taskService.getTask(id);
25
- if (!t)
26
- throw new Error(`Task ${id} not found`);
27
- if (t.deleted_at)
28
- throw new Error(`Task ${id} is deleted`);
29
- return t;
30
- };
31
- }
@@ -1,200 +0,0 @@
1
- /**
2
- * AI Router - Multi-Model Orchestration API
3
- * Provides tRPC endpoints for managing AI providers and routing policies
4
- */
5
- import type { AgentService } from '../../agent/agent-service.js';
6
- import { type RoutingPolicy, type RoutableOperation } from '../../agent/routing-policy.js';
7
- /**
8
- * Build AI router with required dependencies
9
- */
10
- export declare function buildAIRoutes(options: {
11
- agentService: AgentService;
12
- }): {
13
- /**
14
- * List all registered AI providers with health status
15
- */
16
- listProviders: import("@trpc/server").TRPCQueryProcedure<{
17
- input: void;
18
- output: {
19
- name: string;
20
- displayName: string;
21
- available: boolean;
22
- error: string | undefined;
23
- capabilities: import("../../agent/ai-providers/types.js").ProviderCapabilities;
24
- models: import("../../agent/ai-providers/types.js").ModelInfo[];
25
- }[];
26
- meta: object;
27
- }>;
28
- /**
29
- * List available models from providers
30
- */
31
- listModels: import("@trpc/server").TRPCQueryProcedure<{
32
- input: {
33
- provider?: string | undefined;
34
- } | undefined;
35
- output: import("../../agent/ai-providers/types.js").ModelInfo[];
36
- meta: object;
37
- }>;
38
- /**
39
- * Get current routing policy
40
- */
41
- getRoutingPolicy: import("@trpc/server").TRPCQueryProcedure<{
42
- input: void;
43
- output: {
44
- defaultProvider: string;
45
- operations?: Partial<Record<"execute_task" | "quality_checks" | "ai_codereview" | "ai_merge" | "improve_task", {
46
- provider: string;
47
- options?: {
48
- temperature?: number | undefined;
49
- maxTokens?: number | undefined;
50
- tools?: string[] | undefined;
51
- } | undefined;
52
- model?: string | undefined;
53
- fallback?: string[] | undefined;
54
- }>> | undefined;
55
- };
56
- meta: object;
57
- }>;
58
- /**
59
- * Update routing policy
60
- */
61
- updateRoutingPolicy: import("@trpc/server").TRPCMutationProcedure<{
62
- input: {
63
- policy: {
64
- defaultProvider?: string | undefined;
65
- operations?: Partial<Record<"execute_task" | "quality_checks" | "ai_codereview" | "ai_merge" | "improve_task", {
66
- provider: string;
67
- options?: {
68
- temperature?: number | undefined;
69
- maxTokens?: number | undefined;
70
- tools?: string[] | undefined;
71
- } | undefined;
72
- model?: string | undefined;
73
- fallback?: string[] | undefined;
74
- }>> | undefined;
75
- };
76
- };
77
- output: {
78
- success: boolean;
79
- policy: any;
80
- };
81
- meta: object;
82
- }>;
83
- /**
84
- * Set default provider
85
- */
86
- setDefaultProvider: import("@trpc/server").TRPCMutationProcedure<{
87
- input: {
88
- provider: string;
89
- };
90
- output: {
91
- success: boolean;
92
- provider: string;
93
- };
94
- meta: object;
95
- }>;
96
- /**
97
- * Set operation-specific configuration
98
- */
99
- setOperationConfig: import("@trpc/server").TRPCMutationProcedure<{
100
- input: {
101
- config: {
102
- provider: string;
103
- options?: {
104
- temperature?: number | undefined;
105
- maxTokens?: number | undefined;
106
- tools?: string[] | undefined;
107
- } | undefined;
108
- model?: string | undefined;
109
- fallback?: string[] | undefined;
110
- };
111
- operation: "execute_task" | "quality_checks" | "ai_codereview" | "ai_merge" | "improve_task";
112
- };
113
- output: {
114
- success: boolean;
115
- };
116
- meta: object;
117
- }>;
118
- /**
119
- * Validate provider setup and refresh health status
120
- */
121
- validateProviders: import("@trpc/server").TRPCMutationProcedure<{
122
- input: {
123
- force?: boolean | undefined;
124
- } | undefined;
125
- output: {
126
- success: boolean;
127
- results: {
128
- provider: string;
129
- available: boolean;
130
- error: string | undefined;
131
- modelCount: number;
132
- capabilities: import("../../agent/ai-providers/types.js").ProviderCapabilities;
133
- }[];
134
- totalProviders: number;
135
- availableProviders: number;
136
- };
137
- meta: object;
138
- }>;
139
- };
140
- /**
141
- * Test-friendly plain handlers mirroring the AI routes, without tRPC wrappers.
142
- * Useful for unit tests that call functions directly.
143
- */
144
- export declare function buildAIRouteHandlers(options: {
145
- agentService: AgentService;
146
- }): {
147
- readonly listProviders: () => Promise<{
148
- name: string;
149
- displayName: any;
150
- available: boolean;
151
- error: string | undefined;
152
- capabilities: any;
153
- models: import("../../agent/ai-providers/types.js").ModelInfo[];
154
- }[]>;
155
- readonly listModels: (input?: {
156
- provider?: string;
157
- }) => Promise<any>;
158
- readonly getRoutingPolicy: () => Promise<any>;
159
- readonly updateRoutingPolicy: (input: {
160
- policy: Partial<RoutingPolicy>;
161
- }) => Promise<{
162
- readonly success: true;
163
- readonly policy: any;
164
- }>;
165
- readonly setDefaultProvider: (input: {
166
- provider: string;
167
- }) => Promise<{
168
- readonly success: true;
169
- readonly provider: string;
170
- }>;
171
- readonly setOperationConfig: (input: {
172
- operation: RoutableOperation;
173
- config: any;
174
- }) => Promise<{
175
- readonly success: true;
176
- }>;
177
- readonly validateProviders: () => Promise<{
178
- success: true;
179
- results: {
180
- provider: string;
181
- available: boolean;
182
- error: string | undefined;
183
- modelCount: number;
184
- capabilities: import("../../agent/ai-providers/types.js").ProviderCapabilities;
185
- }[];
186
- totalProviders: number;
187
- availableProviders: number;
188
- }>;
189
- readonly getProviderHealth: () => Promise<{
190
- totalProviders: number;
191
- availableProviders: number;
192
- unavailableProviders: number;
193
- providers: Array<{
194
- name: string;
195
- available: boolean;
196
- error?: string;
197
- modelCount: number;
198
- }>;
199
- }>;
200
- };