vibeman 0.0.3 → 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 (231) 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 -80
  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 -225
  11. package/dist/runtime/api/agent/agent-service.js +0 -904
  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 -347
  16. package/dist/runtime/api/agent/ai-providers/index.d.ts +0 -9
  17. package/dist/runtime/api/agent/ai-providers/index.js +0 -7
  18. package/dist/runtime/api/agent/ai-providers/types.d.ts +0 -182
  19. package/dist/runtime/api/agent/ai-providers/types.js +0 -5
  20. package/dist/runtime/api/agent/codex-cli-provider.test.d.ts +0 -1
  21. package/dist/runtime/api/agent/codex-cli-provider.test.js +0 -170
  22. package/dist/runtime/api/agent/core-agent-service.d.ts +0 -119
  23. package/dist/runtime/api/agent/core-agent-service.js +0 -267
  24. package/dist/runtime/api/agent/parsers.d.ts +0 -16
  25. package/dist/runtime/api/agent/parsers.js +0 -308
  26. package/dist/runtime/api/agent/prompt-service.d.ts +0 -30
  27. package/dist/runtime/api/agent/prompt-service.js +0 -449
  28. package/dist/runtime/api/agent/prompt-service.test.d.ts +0 -1
  29. package/dist/runtime/api/agent/prompt-service.test.js +0 -230
  30. package/dist/runtime/api/agent/routing-policy.d.ts +0 -171
  31. package/dist/runtime/api/agent/routing-policy.js +0 -196
  32. package/dist/runtime/api/agent/routing-policy.test.d.ts +0 -1
  33. package/dist/runtime/api/agent/routing-policy.test.js +0 -63
  34. package/dist/runtime/api/api/router-helpers.d.ts +0 -32
  35. package/dist/runtime/api/api/router-helpers.js +0 -31
  36. package/dist/runtime/api/api/routers/ai.d.ts +0 -200
  37. package/dist/runtime/api/api/routers/ai.js +0 -396
  38. package/dist/runtime/api/api/routers/executions.d.ts +0 -98
  39. package/dist/runtime/api/api/routers/executions.js +0 -94
  40. package/dist/runtime/api/api/routers/git.d.ts +0 -45
  41. package/dist/runtime/api/api/routers/git.js +0 -35
  42. package/dist/runtime/api/api/routers/provider-config.d.ts +0 -165
  43. package/dist/runtime/api/api/routers/provider-config.js +0 -252
  44. package/dist/runtime/api/api/routers/settings.d.ts +0 -139
  45. package/dist/runtime/api/api/routers/settings.js +0 -113
  46. package/dist/runtime/api/api/routers/tasks.d.ts +0 -141
  47. package/dist/runtime/api/api/routers/tasks.js +0 -238
  48. package/dist/runtime/api/api/routers/workflows.d.ts +0 -275
  49. package/dist/runtime/api/api/routers/workflows.js +0 -311
  50. package/dist/runtime/api/api/routers/worktrees.d.ts +0 -101
  51. package/dist/runtime/api/api/routers/worktrees.js +0 -80
  52. package/dist/runtime/api/api/trpc.d.ts +0 -118
  53. package/dist/runtime/api/api/trpc.js +0 -34
  54. package/dist/runtime/api/index.d.ts +0 -9
  55. package/dist/runtime/api/index.js +0 -117
  56. package/dist/runtime/api/lib/id-generator.d.ts +0 -70
  57. package/dist/runtime/api/lib/id-generator.js +0 -123
  58. package/dist/runtime/api/lib/local-config.d.ts +0 -245
  59. package/dist/runtime/api/lib/local-config.js +0 -288
  60. package/dist/runtime/api/lib/logger.d.ts +0 -11
  61. package/dist/runtime/api/lib/logger.js +0 -188
  62. package/dist/runtime/api/lib/provider-detection.d.ts +0 -59
  63. package/dist/runtime/api/lib/provider-detection.js +0 -244
  64. package/dist/runtime/api/lib/server/agent-service-singleton.d.ts +0 -6
  65. package/dist/runtime/api/lib/server/agent-service-singleton.js +0 -27
  66. package/dist/runtime/api/lib/server/bootstrap.d.ts +0 -38
  67. package/dist/runtime/api/lib/server/bootstrap.js +0 -197
  68. package/dist/runtime/api/lib/server/git-service-singleton.d.ts +0 -6
  69. package/dist/runtime/api/lib/server/git-service-singleton.js +0 -47
  70. package/dist/runtime/api/lib/server/project-root.d.ts +0 -2
  71. package/dist/runtime/api/lib/server/project-root.js +0 -61
  72. package/dist/runtime/api/lib/server/task-service-singleton.d.ts +0 -7
  73. package/dist/runtime/api/lib/server/task-service-singleton.js +0 -58
  74. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.d.ts +0 -7
  75. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.js +0 -57
  76. package/dist/runtime/api/lib/trpc/client.d.ts +0 -1
  77. package/dist/runtime/api/lib/trpc/client.js +0 -5
  78. package/dist/runtime/api/lib/trpc/server.d.ts +0 -935
  79. package/dist/runtime/api/lib/trpc/server.js +0 -11
  80. package/dist/runtime/api/lib/trpc/ws-server.d.ts +0 -8
  81. package/dist/runtime/api/lib/trpc/ws-server.js +0 -33
  82. package/dist/runtime/api/persistence/database-service.d.ts +0 -14
  83. package/dist/runtime/api/persistence/database-service.js +0 -74
  84. package/dist/runtime/api/persistence/execution-log-persistence.d.ts +0 -90
  85. package/dist/runtime/api/persistence/execution-log-persistence.js +0 -410
  86. package/dist/runtime/api/persistence/execution-log-persistence.test.d.ts +0 -1
  87. package/dist/runtime/api/persistence/execution-log-persistence.test.js +0 -170
  88. package/dist/runtime/api/router.d.ts +0 -938
  89. package/dist/runtime/api/router.js +0 -34
  90. package/dist/runtime/api/settings-service.d.ts +0 -110
  91. package/dist/runtime/api/settings-service.js +0 -661
  92. package/dist/runtime/api/tasks/file-watcher.d.ts +0 -23
  93. package/dist/runtime/api/tasks/file-watcher.js +0 -88
  94. package/dist/runtime/api/tasks/task-file-parser.d.ts +0 -13
  95. package/dist/runtime/api/tasks/task-file-parser.js +0 -161
  96. package/dist/runtime/api/tasks/task-service.d.ts +0 -36
  97. package/dist/runtime/api/tasks/task-service.js +0 -173
  98. package/dist/runtime/api/types/index.d.ts +0 -186
  99. package/dist/runtime/api/types/index.js +0 -1
  100. package/dist/runtime/api/types/settings.d.ts +0 -94
  101. package/dist/runtime/api/types/settings.js +0 -2
  102. package/dist/runtime/api/types.d.ts +0 -2
  103. package/dist/runtime/api/types.js +0 -1
  104. package/dist/runtime/api/utils/env.d.ts +0 -6
  105. package/dist/runtime/api/utils/env.js +0 -12
  106. package/dist/runtime/api/utils/stripNextEnv.d.ts +0 -7
  107. package/dist/runtime/api/utils/stripNextEnv.js +0 -22
  108. package/dist/runtime/api/utils/title-slug.d.ts +0 -6
  109. package/dist/runtime/api/utils/title-slug.js +0 -77
  110. package/dist/runtime/api/utils/url.d.ts +0 -2
  111. package/dist/runtime/api/utils/url.js +0 -19
  112. package/dist/runtime/api/vcs/git-history-service.d.ts +0 -57
  113. package/dist/runtime/api/vcs/git-history-service.js +0 -228
  114. package/dist/runtime/api/vcs/git-service.d.ts +0 -127
  115. package/dist/runtime/api/vcs/git-service.js +0 -284
  116. package/dist/runtime/api/vcs/worktree-service.d.ts +0 -93
  117. package/dist/runtime/api/vcs/worktree-service.js +0 -506
  118. package/dist/runtime/api/vcs/worktree-service.test.d.ts +0 -1
  119. package/dist/runtime/api/vcs/worktree-service.test.js +0 -20
  120. package/dist/runtime/api/workflows/quality-pipeline.d.ts +0 -58
  121. package/dist/runtime/api/workflows/quality-pipeline.js +0 -400
  122. package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +0 -318
  123. package/dist/runtime/api/workflows/vibing-orchestrator.js +0 -1891
  124. package/dist/runtime/web/.next/BUILD_ID +0 -1
  125. package/dist/runtime/web/.next/app-build-manifest.json +0 -66
  126. package/dist/runtime/web/.next/app-path-routes-manifest.json +0 -8
  127. package/dist/runtime/web/.next/build-manifest.json +0 -33
  128. package/dist/runtime/web/.next/package.json +0 -1
  129. package/dist/runtime/web/.next/prerender-manifest.json +0 -61
  130. package/dist/runtime/web/.next/react-loadable-manifest.json +0 -39
  131. package/dist/runtime/web/.next/required-server-files.json +0 -334
  132. package/dist/runtime/web/.next/routes-manifest.json +0 -70
  133. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js +0 -1
  134. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js.nft.json +0 -1
  135. package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route_client-reference-manifest.js +0 -1
  136. package/dist/runtime/web/.next/server/app/_not-found/page.js +0 -2
  137. package/dist/runtime/web/.next/server/app/_not-found/page.js.nft.json +0 -1
  138. package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
  139. package/dist/runtime/web/.next/server/app/_not-found.html +0 -7
  140. package/dist/runtime/web/.next/server/app/_not-found.meta +0 -8
  141. package/dist/runtime/web/.next/server/app/_not-found.rsc +0 -22
  142. package/dist/runtime/web/.next/server/app/api/health/route.js +0 -1
  143. package/dist/runtime/web/.next/server/app/api/health/route.js.nft.json +0 -1
  144. package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +0 -1
  145. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +0 -1
  146. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js.nft.json +0 -1
  147. package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +0 -1
  148. package/dist/runtime/web/.next/server/app/api/upload/route.js +0 -1
  149. package/dist/runtime/web/.next/server/app/api/upload/route.js.nft.json +0 -1
  150. package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +0 -1
  151. package/dist/runtime/web/.next/server/app/index.html +0 -7
  152. package/dist/runtime/web/.next/server/app/index.meta +0 -7
  153. package/dist/runtime/web/.next/server/app/index.rsc +0 -27
  154. package/dist/runtime/web/.next/server/app/page.js +0 -147
  155. package/dist/runtime/web/.next/server/app/page.js.nft.json +0 -1
  156. package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +0 -1
  157. package/dist/runtime/web/.next/server/app-paths-manifest.json +0 -8
  158. package/dist/runtime/web/.next/server/chunks/217.js +0 -1
  159. package/dist/runtime/web/.next/server/chunks/383.js +0 -6
  160. package/dist/runtime/web/.next/server/chunks/458.js +0 -1
  161. package/dist/runtime/web/.next/server/chunks/576.js +0 -18
  162. package/dist/runtime/web/.next/server/chunks/635.js +0 -22
  163. package/dist/runtime/web/.next/server/chunks/761.js +0 -1
  164. package/dist/runtime/web/.next/server/chunks/777.js +0 -3
  165. package/dist/runtime/web/.next/server/chunks/825.js +0 -1
  166. package/dist/runtime/web/.next/server/chunks/838.js +0 -1
  167. package/dist/runtime/web/.next/server/chunks/973.js +0 -15
  168. package/dist/runtime/web/.next/server/functions-config-manifest.json +0 -4
  169. package/dist/runtime/web/.next/server/middleware-build-manifest.js +0 -1
  170. package/dist/runtime/web/.next/server/middleware-manifest.json +0 -6
  171. package/dist/runtime/web/.next/server/middleware-react-loadable-manifest.js +0 -1
  172. package/dist/runtime/web/.next/server/next-font-manifest.js +0 -1
  173. package/dist/runtime/web/.next/server/next-font-manifest.json +0 -1
  174. package/dist/runtime/web/.next/server/pages/404.html +0 -7
  175. package/dist/runtime/web/.next/server/pages/500.html +0 -1
  176. package/dist/runtime/web/.next/server/pages/_app.js +0 -1
  177. package/dist/runtime/web/.next/server/pages/_app.js.nft.json +0 -1
  178. package/dist/runtime/web/.next/server/pages/_document.js +0 -1
  179. package/dist/runtime/web/.next/server/pages/_document.js.nft.json +0 -1
  180. package/dist/runtime/web/.next/server/pages/_error.js +0 -19
  181. package/dist/runtime/web/.next/server/pages/_error.js.nft.json +0 -1
  182. package/dist/runtime/web/.next/server/pages-manifest.json +0 -6
  183. package/dist/runtime/web/.next/server/server-reference-manifest.js +0 -1
  184. package/dist/runtime/web/.next/server/server-reference-manifest.json +0 -1
  185. package/dist/runtime/web/.next/server/webpack-runtime.js +0 -1
  186. package/dist/runtime/web/.next/static/5_15u1WQCxN1_eHZpldCv/_buildManifest.js +0 -1
  187. package/dist/runtime/web/.next/static/5_15u1WQCxN1_eHZpldCv/_ssgManifest.js +0 -1
  188. package/dist/runtime/web/.next/static/chunks/18-15c10d3288afef2e.js +0 -1
  189. package/dist/runtime/web/.next/static/chunks/1c0ca389.537bbe362e3ffbd9.js +0 -3
  190. package/dist/runtime/web/.next/static/chunks/22747d63-ad5da0c19f4cfe41.js +0 -71
  191. package/dist/runtime/web/.next/static/chunks/355.056c2645878a799a.js +0 -1
  192. package/dist/runtime/web/.next/static/chunks/420.a5ccf151c9e2b2f1.js +0 -1
  193. package/dist/runtime/web/.next/static/chunks/439.1be0c6242fd248d5.js +0 -15
  194. package/dist/runtime/web/.next/static/chunks/440.c52e7c0f797e22b2.js +0 -1
  195. package/dist/runtime/web/.next/static/chunks/575-e2478287c27da87b.js +0 -1
  196. package/dist/runtime/web/.next/static/chunks/691.920d88c115087314.js +0 -1
  197. package/dist/runtime/web/.next/static/chunks/765-e838910065b50c3d.js +0 -1
  198. package/dist/runtime/web/.next/static/chunks/823-6f371a6e829adbba.js +0 -63
  199. package/dist/runtime/web/.next/static/chunks/87c73c54-09e1ba5c70e60a51.js +0 -1
  200. package/dist/runtime/web/.next/static/chunks/891cff7f.0f71fc028f87e683.js +0 -1
  201. package/dist/runtime/web/.next/static/chunks/8bb4d8db-3e2aa02b0a2384b9.js +0 -1
  202. package/dist/runtime/web/.next/static/chunks/9af238c7-271a911d4e99ab18.js +0 -1
  203. package/dist/runtime/web/.next/static/chunks/app/.vibeman/assets/images/[...path]/route-751c9265a65409e5.js +0 -1
  204. package/dist/runtime/web/.next/static/chunks/app/_not-found/page-1cb74d1cba27d0ab.js +0 -1
  205. package/dist/runtime/web/.next/static/chunks/app/api/health/route-751c9265a65409e5.js +0 -1
  206. package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-751c9265a65409e5.js +0 -1
  207. package/dist/runtime/web/.next/static/chunks/app/api/upload/route-751c9265a65409e5.js +0 -1
  208. package/dist/runtime/web/.next/static/chunks/app/layout-8435322f09fd0975.js +0 -1
  209. package/dist/runtime/web/.next/static/chunks/app/page-9fe7d75095b4ccec.js +0 -1
  210. package/dist/runtime/web/.next/static/chunks/cac567b0-5b77dd12911823cd.js +0 -1
  211. package/dist/runtime/web/.next/static/chunks/framework-2518f1345b5b2806.js +0 -1
  212. package/dist/runtime/web/.next/static/chunks/main-17665e5e39de9a8a.js +0 -1
  213. package/dist/runtime/web/.next/static/chunks/main-app-c0b0f5ba4f7f9d75.js +0 -1
  214. package/dist/runtime/web/.next/static/chunks/pages/_app-d6f6b3bbc3d81ee1.js +0 -1
  215. package/dist/runtime/web/.next/static/chunks/pages/_error-75a96cf1997cc3b9.js +0 -1
  216. package/dist/runtime/web/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  217. package/dist/runtime/web/.next/static/chunks/webpack-c8de37305b4635cf.js +0 -1
  218. package/dist/runtime/web/.next/static/css/08c950681f1a9a92.css +0 -1
  219. package/dist/runtime/web/.next/static/css/2728291c68f99cb1.css +0 -3
  220. package/dist/runtime/web/.next/static/css/521bd69cc298cd1a.css +0 -1
  221. package/dist/runtime/web/.next/static/css/537e22821e101b87.css +0 -1
  222. package/dist/runtime/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  223. package/dist/runtime/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  224. package/dist/runtime/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  225. package/dist/runtime/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  226. package/dist/runtime/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  227. package/dist/runtime/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  228. package/dist/runtime/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  229. package/dist/runtime/web/package.json +0 -65
  230. package/dist/runtime/web/server.js +0 -44
  231. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,94 +0,0 @@
1
- import { z } from 'zod';
2
- import { on, EventEmitter } from 'events';
3
- import { publicProcedure } from '../trpc.js';
4
- import { ExecutionIdSchema, TaskIdSchema } from '../router-helpers.js';
5
- import { makeAssertTaskActive } from '../router-helpers.js';
6
- import { log } from '../../lib/logger.js';
7
- export function buildExecutionRoutes({ taskService, vibingOrchestrator }) {
8
- const assertTaskActive = makeAssertTaskActive(taskService);
9
- return {
10
- executeTask: publicProcedure.input(TaskIdSchema).mutation(async ({ input }) => {
11
- assertTaskActive(input.taskId);
12
- const { executionId } = await vibingOrchestrator.executeTask(input.taskId);
13
- return { executionId };
14
- }),
15
- stopTaskExecution: publicProcedure.input(ExecutionIdSchema).mutation(async ({ input }) => {
16
- await vibingOrchestrator.stopExecution(input.executionId);
17
- return { success: true };
18
- }),
19
- getTaskExecutionStatus: publicProcedure.input(ExecutionIdSchema).query(async ({ input }) => {
20
- return vibingOrchestrator.getExecutionStatus(input.executionId);
21
- }),
22
- getTaskExecutionLogs: publicProcedure.input(ExecutionIdSchema).query(async ({ input }) => {
23
- try {
24
- const persistedLogs = await vibingOrchestrator.getPersistedExecutionLogs(input.executionId);
25
- return { logs: persistedLogs.logs };
26
- }
27
- catch (error) {
28
- log.error('Failed to get task execution logs', error);
29
- const logs = vibingOrchestrator.getExecutionLogs(input.executionId);
30
- const logEntries = logs.map((message, index) => ({
31
- timestamp: new Date().toISOString(),
32
- level: 'info',
33
- message,
34
- data: { index },
35
- }));
36
- return { logs: logEntries };
37
- }
38
- }),
39
- getTaskExecutions: publicProcedure.input(TaskIdSchema).query(async ({ input }) => {
40
- return vibingOrchestrator.getTaskExecutions(input.taskId);
41
- }),
42
- getTaskExecutionStats: publicProcedure.query(async () => {
43
- return vibingOrchestrator.getExecutionStats();
44
- }),
45
- improveTask: publicProcedure
46
- .input(z.object({
47
- taskId: z.string(),
48
- title: z.string(),
49
- type: z.enum(['feature', 'bug', 'chore', 'refactor', 'test', 'doc']),
50
- priority: z.enum(['low', 'medium', 'high']),
51
- content: z.string(),
52
- executionId: z.string().optional(),
53
- }))
54
- .mutation(async ({ input }) => {
55
- assertTaskActive(input.taskId);
56
- const improvement = await vibingOrchestrator.improveTaskContent(input.taskId, {
57
- title: input.title,
58
- type: input.type,
59
- priority: input.priority,
60
- content: input.content,
61
- }, { executionId: input.executionId });
62
- return improvement;
63
- }),
64
- onExecutionUpdate: publicProcedure
65
- .input(z.object({ executionId: z.string() }))
66
- .subscription(async function* (opts) {
67
- const input = opts.input;
68
- // Emit initial status if exists
69
- const initial = vibingOrchestrator.getExecutionStatus(input.executionId);
70
- if (initial) {
71
- yield {
72
- executionId: initial.id,
73
- status: initial.status,
74
- logs: initial.logs,
75
- error: initial.error,
76
- };
77
- }
78
- const proxy = new EventEmitter();
79
- const handleUpdate = (update) => {
80
- if (update.executionId === input.executionId)
81
- proxy.emit('data', update);
82
- };
83
- vibingOrchestrator.on('executionUpdated', handleUpdate);
84
- try {
85
- for await (const [payload] of on(proxy, 'data', { signal: opts.signal })) {
86
- yield payload;
87
- }
88
- }
89
- finally {
90
- vibingOrchestrator.off('executionUpdated', handleUpdate);
91
- }
92
- }),
93
- };
94
- }
@@ -1,45 +0,0 @@
1
- import type { TaskService } from '../../tasks/task-service.js';
2
- import type { GitService } from '../../vcs/git-service.js';
3
- export declare function buildGitRoutes(taskService: TaskService, gitService: GitService): {
4
- readonly getGitStatus: import("@trpc/server").TRPCQueryProcedure<{
5
- input: void;
6
- output: {
7
- current: string;
8
- staged: string[];
9
- modified: string[];
10
- untracked: string[];
11
- ahead: number;
12
- behind: number;
13
- };
14
- meta: object;
15
- }>;
16
- readonly createBranch: import("@trpc/server").TRPCMutationProcedure<{
17
- input: {
18
- taskId: string;
19
- baseBranch?: string | undefined;
20
- };
21
- output: import("../../vcs/git-service.js").BranchInfo;
22
- meta: object;
23
- }>;
24
- readonly commitChanges: import("@trpc/server").TRPCMutationProcedure<{
25
- input: {
26
- taskId: string;
27
- message?: string | undefined;
28
- files?: string[] | undefined;
29
- };
30
- output: import("../../vcs/git-service.js").CommitInfo;
31
- meta: object;
32
- }>;
33
- readonly getCommitHistory: import("@trpc/server").TRPCQueryProcedure<{
34
- input: {
35
- maxCount?: number | undefined;
36
- };
37
- output: import("../../vcs/git-service.js").CommitInfo[];
38
- meta: object;
39
- }>;
40
- readonly hasUncommittedChanges: import("@trpc/server").TRPCQueryProcedure<{
41
- input: void;
42
- output: boolean;
43
- meta: object;
44
- }>;
45
- };
@@ -1,35 +0,0 @@
1
- import { z } from 'zod';
2
- import { publicProcedure } from '../trpc.js';
3
- import { makeAssertTaskActive } from '../router-helpers.js';
4
- export function buildGitRoutes(taskService, gitService) {
5
- const assertTaskActive = makeAssertTaskActive(taskService);
6
- return {
7
- getGitStatus: publicProcedure.query(async () => {
8
- return await gitService.getStatus();
9
- }),
10
- createBranch: publicProcedure
11
- .input(z.object({ taskId: z.string(), baseBranch: z.string().optional() }))
12
- .mutation(async ({ input }) => {
13
- const task = assertTaskActive(input.taskId);
14
- return await gitService.createBranch(task, input.baseBranch);
15
- }),
16
- commitChanges: publicProcedure
17
- .input(z.object({
18
- taskId: z.string(),
19
- message: z.string().optional(),
20
- files: z.array(z.string()).optional(),
21
- }))
22
- .mutation(async ({ input }) => {
23
- const task = assertTaskActive(input.taskId);
24
- return await gitService.commitChanges(task, input.message, input.files);
25
- }),
26
- getCommitHistory: publicProcedure
27
- .input(z.object({ maxCount: z.number().optional() }))
28
- .query(async ({ input }) => {
29
- return await gitService.getCommitHistory(input.maxCount);
30
- }),
31
- hasUncommittedChanges: publicProcedure.query(async () => {
32
- return await gitService.hasUncommittedChanges();
33
- }),
34
- };
35
- }
@@ -1,165 +0,0 @@
1
- /**
2
- * Provider Configuration Router
3
- * Handles provider detection and local configuration management
4
- */
5
- /**
6
- * Provider Configuration Router
7
- */
8
- export declare function buildProviderConfigRoutes(): {
9
- /**
10
- * Detect all providers with current status
11
- */
12
- detectAllProviders: import("@trpc/server").TRPCQueryProcedure<{
13
- input: void;
14
- output: Record<string, import("../../lib/provider-detection.js").DetectionResult>;
15
- meta: object;
16
- }>;
17
- /**
18
- * Detect specific provider
19
- */
20
- detectProvider: import("@trpc/server").TRPCQueryProcedure<{
21
- input: {
22
- provider: string;
23
- };
24
- output: import("../../lib/provider-detection.js").DetectionResult;
25
- meta: object;
26
- }>;
27
- /**
28
- * Set explicit provider path
29
- */
30
- setProviderPath: import("@trpc/server").TRPCMutationProcedure<{
31
- input: {
32
- path: string;
33
- provider: string;
34
- };
35
- output: {
36
- success: boolean;
37
- result: import("../../lib/provider-detection.js").DetectionResult;
38
- };
39
- meta: object;
40
- }>;
41
- /**
42
- * Clear provider path (reset to auto-detection)
43
- */
44
- clearProviderPath: import("@trpc/server").TRPCMutationProcedure<{
45
- input: {
46
- provider: string;
47
- };
48
- output: {
49
- success: boolean;
50
- };
51
- meta: object;
52
- }>;
53
- /**
54
- * Get local configuration info
55
- */
56
- getLocalConfigInfo: import("@trpc/server").TRPCQueryProcedure<{
57
- input: void;
58
- output: {
59
- providers: {
60
- 'claude-code'?: {
61
- binPath?: string | undefined;
62
- detectedPath?: string | undefined;
63
- lastDetected?: string | undefined;
64
- detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
65
- } | undefined;
66
- codex?: {
67
- binPath?: string | undefined;
68
- detectedPath?: string | undefined;
69
- lastDetected?: string | undefined;
70
- detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
71
- } | undefined;
72
- };
73
- path: string;
74
- exists: boolean;
75
- size?: number;
76
- };
77
- meta: object;
78
- }>;
79
- /**
80
- * Clear validation cache (force re-detection)
81
- */
82
- clearValidationCache: import("@trpc/server").TRPCMutationProcedure<{
83
- input: void;
84
- output: {
85
- success: boolean;
86
- };
87
- meta: object;
88
- }>;
89
- /**
90
- * Get provider detection diagnostics
91
- */
92
- getProviderDiagnostics: import("@trpc/server").TRPCQueryProcedure<{
93
- input: void;
94
- output: {
95
- localConfigPath: string;
96
- localConfigExists: boolean;
97
- providers: {
98
- provider: string;
99
- detection: import("../../lib/provider-detection.js").DetectionResult;
100
- localConfig: {
101
- binPath?: string | undefined;
102
- detectedPath?: string | undefined;
103
- lastDetected?: string | undefined;
104
- detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
105
- } | {
106
- binPath?: string | undefined;
107
- detectedPath?: string | undefined;
108
- lastDetected?: string | undefined;
109
- detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
110
- } | undefined;
111
- cached: {
112
- available: boolean;
113
- error: string | undefined;
114
- version: string | undefined;
115
- checkedAt: string;
116
- isFresh: boolean;
117
- } | null;
118
- }[];
119
- };
120
- meta: object;
121
- }>;
122
- };
123
- /**
124
- * Test-friendly plain handlers
125
- */
126
- export declare function buildProviderConfigRouteHandlers(): {
127
- readonly detectAllProviders: () => Promise<Record<string, import("../../lib/provider-detection.js").DetectionResult>>;
128
- readonly detectProvider: (input: {
129
- provider: string;
130
- }) => Promise<import("../../lib/provider-detection.js").DetectionResult>;
131
- readonly setProviderPath: (input: {
132
- provider: string;
133
- path: string;
134
- }) => Promise<{
135
- success: true;
136
- result: import("../../lib/provider-detection.js").DetectionResult;
137
- }>;
138
- readonly clearProviderPath: (input: {
139
- provider: string;
140
- }) => Promise<{
141
- success: true;
142
- }>;
143
- readonly getLocalConfigInfo: () => Promise<{
144
- providers: {
145
- 'claude-code'?: {
146
- binPath?: string | undefined;
147
- detectedPath?: string | undefined;
148
- lastDetected?: string | undefined;
149
- detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
150
- } | undefined;
151
- codex?: {
152
- binPath?: string | undefined;
153
- detectedPath?: string | undefined;
154
- lastDetected?: string | undefined;
155
- detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
156
- } | undefined;
157
- };
158
- path: string;
159
- exists: boolean;
160
- size?: number;
161
- }>;
162
- readonly clearValidationCache: () => Promise<{
163
- success: true;
164
- }>;
165
- };
@@ -1,252 +0,0 @@
1
- /**
2
- * Provider Configuration Router
3
- * Handles provider detection and local configuration management
4
- */
5
- import { z } from 'zod';
6
- import { publicProcedure } from '../trpc.js';
7
- import { getProviderDetectionService } from '../../lib/provider-detection.js';
8
- import { getLocalConfigService } from '../../lib/local-config.js';
9
- import { log } from '../../lib/logger.js';
10
- /**
11
- * Input schemas for API endpoints
12
- */
13
- const DetectProviderInputSchema = z.object({
14
- provider: z.string(),
15
- });
16
- const SetProviderPathInputSchema = z.object({
17
- provider: z.string(),
18
- path: z.string().trim().min(1, 'Path is required'),
19
- });
20
- const ClearProviderPathInputSchema = z.object({
21
- provider: z.string(),
22
- });
23
- /**
24
- * Provider Configuration Router
25
- */
26
- export function buildProviderConfigRoutes() {
27
- return {
28
- /**
29
- * Detect all providers with current status
30
- */
31
- detectAllProviders: publicProcedure.query(async () => {
32
- try {
33
- const detectionService = getProviderDetectionService();
34
- const results = await detectionService.detectAllProviders();
35
- log.debug('Detected all providers', { results }, 'provider-config');
36
- return results;
37
- }
38
- catch (error) {
39
- const msg = `Failed to detect providers: ${error instanceof Error ? error.message : String(error)}`;
40
- log.error(msg, error, 'provider-config');
41
- throw new Error(msg);
42
- }
43
- }),
44
- /**
45
- * Detect specific provider
46
- */
47
- detectProvider: publicProcedure.input(DetectProviderInputSchema).query(async ({ input }) => {
48
- try {
49
- const detectionService = getProviderDetectionService();
50
- const result = await detectionService.detectProvider(input.provider);
51
- log.debug('Detected provider', { provider: input.provider, result }, 'provider-config');
52
- return result;
53
- }
54
- catch (error) {
55
- const msg = `Failed to detect provider ${input.provider}: ${error instanceof Error ? error.message : String(error)}`;
56
- log.error(msg, error, 'provider-config');
57
- throw new Error(msg);
58
- }
59
- }),
60
- /**
61
- * Set explicit provider path
62
- */
63
- setProviderPath: publicProcedure
64
- .input(SetProviderPathInputSchema)
65
- .mutation(async ({ input }) => {
66
- try {
67
- const detectionService = getProviderDetectionService();
68
- const result = await detectionService.setProviderPath(input.provider, input.path);
69
- if (!result.found) {
70
- throw new Error(result.error || 'Invalid provider path');
71
- }
72
- log.info('Set provider path', { provider: input.provider, path: input.path }, 'provider-config');
73
- return { success: true, result };
74
- }
75
- catch (error) {
76
- const msg = `Failed to set provider path: ${error instanceof Error ? error.message : String(error)}`;
77
- log.error(msg, error, 'provider-config');
78
- throw new Error(msg);
79
- }
80
- }),
81
- /**
82
- * Clear provider path (reset to auto-detection)
83
- */
84
- clearProviderPath: publicProcedure
85
- .input(ClearProviderPathInputSchema)
86
- .mutation(async ({ input }) => {
87
- try {
88
- const detectionService = getProviderDetectionService();
89
- await detectionService.clearProviderPath(input.provider);
90
- log.info('Cleared provider path', { provider: input.provider }, 'provider-config');
91
- return { success: true };
92
- }
93
- catch (error) {
94
- const msg = `Failed to clear provider path: ${error instanceof Error ? error.message : String(error)}`;
95
- log.error(msg, error, 'provider-config');
96
- throw new Error(msg);
97
- }
98
- }),
99
- /**
100
- * Get local configuration info
101
- */
102
- getLocalConfigInfo: publicProcedure.query(async () => {
103
- try {
104
- const localConfig = getLocalConfigService();
105
- await localConfig.initialize();
106
- const info = await localConfig.getConfigInfo();
107
- const config = localConfig.getConfig();
108
- return {
109
- ...info,
110
- providers: config.providers || {},
111
- };
112
- }
113
- catch (error) {
114
- const msg = `Failed to get local config info: ${error instanceof Error ? error.message : String(error)}`;
115
- log.error(msg, error, 'provider-config');
116
- throw new Error(msg);
117
- }
118
- }),
119
- /**
120
- * Clear validation cache (force re-detection)
121
- */
122
- clearValidationCache: publicProcedure.mutation(async () => {
123
- try {
124
- const localConfig = getLocalConfigService();
125
- await localConfig.initialize();
126
- await localConfig.clearValidationCache();
127
- log.info('Cleared validation cache', undefined, 'provider-config');
128
- return { success: true };
129
- }
130
- catch (error) {
131
- const msg = `Failed to clear validation cache: ${error instanceof Error ? error.message : String(error)}`;
132
- log.error(msg, error, 'provider-config');
133
- throw new Error(msg);
134
- }
135
- }),
136
- /**
137
- * Get provider detection diagnostics
138
- */
139
- getProviderDiagnostics: publicProcedure.query(async () => {
140
- try {
141
- const detectionService = getProviderDetectionService();
142
- const localConfig = getLocalConfigService();
143
- await localConfig.initialize();
144
- const detectionResults = await detectionService.detectAllProviders();
145
- const localConfigInfo = await localConfig.getConfigInfo();
146
- const providerConfigs = localConfig.getConfig().providers || {};
147
- const diagnostics = Object.entries(detectionResults).map(([provider, result]) => {
148
- const config = providerConfigs[provider];
149
- const cached = localConfig.getCachedValidationResult(provider);
150
- return {
151
- provider,
152
- detection: result,
153
- localConfig: config,
154
- cached: cached
155
- ? {
156
- available: cached.available,
157
- error: cached.error,
158
- version: cached.version,
159
- checkedAt: cached.checkedAt,
160
- isFresh: localConfig.isCachedValidationFresh(provider),
161
- }
162
- : null,
163
- };
164
- });
165
- return {
166
- localConfigPath: localConfigInfo.path,
167
- localConfigExists: localConfigInfo.exists,
168
- providers: diagnostics,
169
- };
170
- }
171
- catch (error) {
172
- const msg = `Failed to get provider diagnostics: ${error instanceof Error ? error.message : String(error)}`;
173
- log.error(msg, error, 'provider-config');
174
- throw new Error(msg);
175
- }
176
- }),
177
- };
178
- }
179
- /**
180
- * Test-friendly plain handlers
181
- */
182
- export function buildProviderConfigRouteHandlers() {
183
- return {
184
- async detectAllProviders() {
185
- try {
186
- const detectionService = getProviderDetectionService();
187
- return await detectionService.detectAllProviders();
188
- }
189
- catch (error) {
190
- throw new Error(`Failed to detect providers: ${error instanceof Error ? error.message : String(error)}`);
191
- }
192
- },
193
- async detectProvider(input) {
194
- try {
195
- const detectionService = getProviderDetectionService();
196
- return await detectionService.detectProvider(input.provider);
197
- }
198
- catch (error) {
199
- throw new Error(`Failed to detect provider ${input.provider}: ${error instanceof Error ? error.message : String(error)}`);
200
- }
201
- },
202
- async setProviderPath(input) {
203
- try {
204
- const detectionService = getProviderDetectionService();
205
- const result = await detectionService.setProviderPath(input.provider, input.path);
206
- if (!result.found) {
207
- throw new Error(result.error || 'Invalid provider path');
208
- }
209
- return { success: true, result };
210
- }
211
- catch (error) {
212
- throw new Error(`Failed to set provider path: ${error instanceof Error ? error.message : String(error)}`);
213
- }
214
- },
215
- async clearProviderPath(input) {
216
- try {
217
- const detectionService = getProviderDetectionService();
218
- await detectionService.clearProviderPath(input.provider);
219
- return { success: true };
220
- }
221
- catch (error) {
222
- throw new Error(`Failed to clear provider path: ${error instanceof Error ? error.message : String(error)}`);
223
- }
224
- },
225
- async getLocalConfigInfo() {
226
- try {
227
- const localConfig = getLocalConfigService();
228
- await localConfig.initialize();
229
- const info = await localConfig.getConfigInfo();
230
- const config = localConfig.getConfig();
231
- return {
232
- ...info,
233
- providers: config.providers || {},
234
- };
235
- }
236
- catch (error) {
237
- throw new Error(`Failed to get local config info: ${error instanceof Error ? error.message : String(error)}`);
238
- }
239
- },
240
- async clearValidationCache() {
241
- try {
242
- const localConfig = getLocalConfigService();
243
- await localConfig.initialize();
244
- await localConfig.clearValidationCache();
245
- return { success: true };
246
- }
247
- catch (error) {
248
- throw new Error(`Failed to clear validation cache: ${error instanceof Error ? error.message : String(error)}`);
249
- }
250
- },
251
- };
252
- }