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,80 +0,0 @@
1
- import { z } from 'zod';
2
- import { publicProcedure } from '../trpc.js';
3
- import { TaskIdSchema, WorktreePathSchema, withErrors } from '../router-helpers.js';
4
- import { log } from '../../lib/logger.js';
5
- export function buildWorktreeRoutes({ vibingOrchestrator }) {
6
- return {
7
- listWorktrees: publicProcedure.query(withErrors('list worktrees', 'router:listWorktrees', async () => {
8
- const orchestrator = vibingOrchestrator;
9
- return await orchestrator.listWorktrees();
10
- })),
11
- syncWorktreeState: publicProcedure.mutation(withErrors('sync worktree state', 'router:syncWorktreeState', async () => {
12
- const orchestrator = vibingOrchestrator;
13
- await orchestrator.syncWorktreeState();
14
- return { success: true, message: 'Worktree state synchronized' };
15
- })),
16
- getWorktreeInfo: publicProcedure.input(TaskIdSchema).query(async ({ input }) => {
17
- const orchestrator = vibingOrchestrator;
18
- const worktree = orchestrator.getWorktreeInfo(input.taskId);
19
- if (!worktree)
20
- return null;
21
- const { git, ...serializableWorktree } = worktree;
22
- return serializableWorktree;
23
- }),
24
- createWorktree: publicProcedure.input(TaskIdSchema).mutation(async ({ input }) => {
25
- const orchestrator = vibingOrchestrator;
26
- const worktree = await orchestrator.createWorktree(input.taskId);
27
- const { git, ...serializableWorktree } = worktree;
28
- return serializableWorktree;
29
- }),
30
- deleteWorktree: publicProcedure
31
- .input(z.object({ taskId: z.string(), force: z.coerce.boolean().optional() }))
32
- .mutation(async ({ input }) => {
33
- const orchestrator = vibingOrchestrator;
34
- await orchestrator.deleteWorktree(input.taskId, input.force || false);
35
- if (orchestrator) {
36
- await orchestrator.removeWorkflowsByTask(input.taskId);
37
- }
38
- return { success: true };
39
- }),
40
- openInEditor: publicProcedure.input(WorktreePathSchema).mutation(withErrors('open in editor', 'router:openInEditor', async ({ input }) => {
41
- const orchestrator = vibingOrchestrator;
42
- await orchestrator.openInEditor(input.worktreePath);
43
- // Ensure we return a clean, serializable object
44
- return { success: true };
45
- })),
46
- openInTerminal: publicProcedure.input(WorktreePathSchema).mutation(withErrors('open in terminal', 'router:openInTerminal', async ({ input }) => {
47
- const orchestrator = vibingOrchestrator;
48
- await orchestrator.openInTerminal(input.worktreePath);
49
- // Ensure we return a clean, serializable object
50
- return { success: true };
51
- })),
52
- // TODO: Deprecated alias; prefer createPullRequest
53
- createWorktreePR: publicProcedure
54
- .input(z.object({ taskId: z.string(), baseBranch: z.string().optional().default('main') }))
55
- .mutation(async ({ input }) => {
56
- const orchestrator = vibingOrchestrator;
57
- log.warn('Deprecated route used: createWorktreePR; prefer createPullRequest', { taskId: input.taskId }, 'router:createWorktreePR');
58
- return await orchestrator.createPullRequest(input.taskId, input.baseBranch);
59
- }),
60
- createPullRequest: publicProcedure
61
- .input(z.object({ taskId: z.string(), baseBranch: z.string().optional().default('main') }))
62
- .mutation(withErrors('create pull request', 'router:createPullRequest', async ({ input }) => {
63
- const orchestrator = vibingOrchestrator;
64
- return await orchestrator.createPullRequest(input.taskId, input.baseBranch);
65
- })),
66
- cleanupWorktree: publicProcedure
67
- .input(z.object({
68
- taskId: z.string().optional(),
69
- worktreePath: z.string().optional(),
70
- branchName: z.string().optional(),
71
- isConnectedToTask: z.boolean(),
72
- force: z.coerce.boolean().optional().default(false),
73
- }))
74
- .mutation(async ({ input }) => {
75
- const orchestrator = vibingOrchestrator;
76
- await orchestrator.cleanupWorktree(input);
77
- return { success: true };
78
- }),
79
- };
80
- }
@@ -1,118 +0,0 @@
1
- import { z } from 'zod';
2
- import superjson from 'superjson';
3
- import type { TaskService } from '../tasks/task-service.js';
4
- export interface Context {
5
- taskService?: TaskService;
6
- }
7
- export declare const t: import("@trpc/server").TRPCRootObject<Context, object, {
8
- transformer: typeof superjson;
9
- }, {
10
- ctx: Context;
11
- meta: object;
12
- errorShape: import("@trpc/server").TRPCDefaultErrorShape;
13
- transformer: true;
14
- }>;
15
- export declare const router: import("@trpc/server").TRPCRouterBuilder<{
16
- ctx: Context;
17
- meta: object;
18
- errorShape: import("@trpc/server").TRPCDefaultErrorShape;
19
- transformer: true;
20
- }>;
21
- export declare const publicProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, object, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
22
- export declare const TaskCreateSchema: z.ZodObject<{
23
- id: z.ZodOptional<z.ZodString>;
24
- title: z.ZodString;
25
- type: z.ZodEnum<["feature", "bug", "chore", "refactor", "test", "doc"]>;
26
- status: z.ZodDefault<z.ZodEnum<["backlog", "in-progress", "review", "done"]>>;
27
- tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
28
- due_date: z.ZodOptional<z.ZodString>;
29
- assignee: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
30
- priority: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
31
- comments: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
32
- content: z.ZodString;
33
- }, "strip", z.ZodTypeAny, {
34
- status: "review" | "in-progress" | "backlog" | "done";
35
- title: string;
36
- type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
37
- tags: string[];
38
- assignee: string[];
39
- priority: "low" | "medium" | "high";
40
- comments: string[];
41
- content: string;
42
- id?: string | undefined;
43
- due_date?: string | undefined;
44
- }, {
45
- title: string;
46
- type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
47
- content: string;
48
- status?: "review" | "in-progress" | "backlog" | "done" | undefined;
49
- id?: string | undefined;
50
- tags?: string[] | undefined;
51
- due_date?: string | undefined;
52
- assignee?: string[] | undefined;
53
- priority?: "low" | "medium" | "high" | undefined;
54
- comments?: string[] | undefined;
55
- }>;
56
- export declare const TaskUpdateSchema: z.ZodObject<{
57
- title: z.ZodOptional<z.ZodString>;
58
- type: z.ZodOptional<z.ZodEnum<["feature", "bug", "chore", "refactor", "test", "doc"]>>;
59
- status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["backlog", "in-progress", "review", "done"]>>>;
60
- tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
61
- due_date: z.ZodOptional<z.ZodOptional<z.ZodString>>;
62
- assignee: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
63
- priority: z.ZodOptional<z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>>;
64
- comments: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
65
- content: z.ZodOptional<z.ZodString>;
66
- } & {
67
- id: z.ZodString;
68
- deleted_at: z.ZodOptional<z.ZodString>;
69
- }, "strip", z.ZodTypeAny, {
70
- id: string;
71
- status?: "review" | "in-progress" | "backlog" | "done" | undefined;
72
- title?: string | undefined;
73
- type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
74
- tags?: string[] | undefined;
75
- due_date?: string | undefined;
76
- assignee?: string[] | undefined;
77
- priority?: "low" | "medium" | "high" | undefined;
78
- comments?: string[] | undefined;
79
- content?: string | undefined;
80
- deleted_at?: string | undefined;
81
- }, {
82
- id: string;
83
- status?: "review" | "in-progress" | "backlog" | "done" | undefined;
84
- title?: string | undefined;
85
- type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
86
- tags?: string[] | undefined;
87
- due_date?: string | undefined;
88
- assignee?: string[] | undefined;
89
- priority?: "low" | "medium" | "high" | undefined;
90
- comments?: string[] | undefined;
91
- content?: string | undefined;
92
- deleted_at?: string | undefined;
93
- }>;
94
- export declare const TaskFilterSchema: z.ZodObject<{
95
- status: z.ZodOptional<z.ZodEnum<["backlog", "in-progress", "review", "done"]>>;
96
- type: z.ZodOptional<z.ZodEnum<["feature", "bug", "chore", "refactor", "test", "doc"]>>;
97
- priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
98
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
99
- search: z.ZodOptional<z.ZodString>;
100
- includeDeleted: z.ZodOptional<z.ZodBoolean>;
101
- onlyDeleted: z.ZodOptional<z.ZodBoolean>;
102
- }, "strip", z.ZodTypeAny, {
103
- status?: "review" | "in-progress" | "backlog" | "done" | undefined;
104
- type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
105
- tags?: string[] | undefined;
106
- priority?: "low" | "medium" | "high" | undefined;
107
- search?: string | undefined;
108
- includeDeleted?: boolean | undefined;
109
- onlyDeleted?: boolean | undefined;
110
- }, {
111
- status?: "review" | "in-progress" | "backlog" | "done" | undefined;
112
- type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
113
- tags?: string[] | undefined;
114
- priority?: "low" | "medium" | "high" | undefined;
115
- search?: string | undefined;
116
- includeDeleted?: boolean | undefined;
117
- onlyDeleted?: boolean | undefined;
118
- }>;
@@ -1,34 +0,0 @@
1
- import { initTRPC } from '@trpc/server';
2
- import { z } from 'zod';
3
- import superjson from 'superjson';
4
- export const t = initTRPC.context().create({
5
- transformer: superjson,
6
- });
7
- export const router = t.router;
8
- export const publicProcedure = t.procedure;
9
- // Input validation schemas
10
- export const TaskCreateSchema = z.object({
11
- id: z.string().optional(), // Made optional - will be auto-generated if not provided
12
- title: z.string(),
13
- type: z.enum(['feature', 'bug', 'chore', 'refactor', 'test', 'doc']),
14
- status: z.enum(['backlog', 'in-progress', 'review', 'done']).default('backlog'),
15
- tags: z.array(z.string()).default([]),
16
- due_date: z.string().optional(),
17
- assignee: z.array(z.string()).default([]),
18
- priority: z.enum(['low', 'medium', 'high']).default('medium'),
19
- comments: z.array(z.string()).default([]),
20
- content: z.string(),
21
- });
22
- export const TaskUpdateSchema = TaskCreateSchema.partial().extend({
23
- id: z.string(),
24
- deleted_at: z.string().optional(),
25
- });
26
- export const TaskFilterSchema = z.object({
27
- status: z.enum(['backlog', 'in-progress', 'review', 'done']).optional(),
28
- type: z.enum(['feature', 'bug', 'chore', 'refactor', 'test', 'doc']).optional(),
29
- priority: z.enum(['low', 'medium', 'high']).optional(),
30
- tags: z.array(z.string()).optional(),
31
- search: z.string().optional(),
32
- includeDeleted: z.boolean().optional(),
33
- onlyDeleted: z.boolean().optional(),
34
- });
@@ -1,9 +0,0 @@
1
- /**
2
- * Starts a standalone HTTP server that serves tRPC over HTTP and WebSocket on the same port.
3
- * HTTP endpoint: /trpc
4
- * WebSocket path: /trpc
5
- */
6
- export declare function startApiServer({ port, host }: {
7
- port: number;
8
- host: string;
9
- }): Promise<void>;
@@ -1,117 +0,0 @@
1
- import { createServer } from 'http';
2
- import { nodeHTTPRequestHandler } from '@trpc/server/adapters/node-http';
3
- import { applyWSSHandler } from '@trpc/server/adapters/ws';
4
- import { WebSocketServer } from 'ws';
5
- import { appRouter } from './lib/trpc/server.js';
6
- import { getTaskService } from './lib/server/task-service-singleton.js';
7
- import { log } from './lib/logger.js';
8
- import { pathToFileURL } from 'url';
9
- function getNumberEnv(name, fallback) {
10
- const raw = process.env[name];
11
- const n = raw ? Number(raw) : NaN;
12
- return Number.isFinite(n) ? n : fallback;
13
- }
14
- /**
15
- * Starts a standalone HTTP server that serves tRPC over HTTP and WebSocket on the same port.
16
- * HTTP endpoint: /trpc
17
- * WebSocket path: /trpc
18
- */
19
- export async function startApiServer({ port, host }) {
20
- const httpServer = createServer((req, res) => {
21
- // Basic CORS for local dev
22
- res.setHeader('Access-Control-Allow-Origin', '*');
23
- res.setHeader('Access-Control-Allow-Methods', 'GET,POST,PUT,DELETE,OPTIONS');
24
- res.setHeader('Access-Control-Allow-Headers', 'Content-Type,Authorization');
25
- if (req.method === 'OPTIONS') {
26
- res.writeHead(200);
27
- res.end();
28
- return;
29
- }
30
- if (req.url?.startsWith('/trpc')) {
31
- const host = req.headers.host || 'localhost';
32
- const url = new URL(req.url, `http://${host}`);
33
- // Strip the /trpc prefix and any leading slash; omit query string
34
- const rawPath = url.pathname.replace(/^\/trpc\/?/, '');
35
- const trpcPath = rawPath.replace(/^\/+/, '');
36
- return nodeHTTPRequestHandler({
37
- router: appRouter,
38
- createContext: () => ({ taskService: getTaskService() }),
39
- req: req,
40
- res: res,
41
- path: trpcPath,
42
- });
43
- }
44
- if (req.url === '/api/health') {
45
- res.writeHead(200, { 'Content-Type': 'application/json' });
46
- res.end(JSON.stringify({ status: 'ok', timestamp: new Date().toISOString() }));
47
- return;
48
- }
49
- res.writeHead(404, { 'Content-Type': 'application/json' });
50
- res.end(JSON.stringify({ error: 'Not Found' }));
51
- });
52
- // Share same HTTP server for WS, listening on /trpc
53
- const wss = new WebSocketServer({ noServer: true });
54
- // Upgrade handler for WebSocket path filtering
55
- httpServer.on('upgrade', (request, socket, head) => {
56
- const { url } = request;
57
- if (!url || !url.startsWith('/trpc')) {
58
- socket.destroy();
59
- return;
60
- }
61
- wss.handleUpgrade(request, socket, head, (ws) => {
62
- wss.emit('connection', ws, request);
63
- });
64
- });
65
- // Hook tRPC WS handler
66
- applyWSSHandler({
67
- wss,
68
- router: appRouter,
69
- createContext: () => ({ taskService: getTaskService() }),
70
- });
71
- await new Promise((resolve) => {
72
- httpServer.listen(port, host, () => resolve());
73
- });
74
- const addr = httpServer.address();
75
- const actualPort = typeof addr === 'object' && addr && 'port' in addr ? addr.port : port;
76
- log.info('API server listening', { port: actualPort, host, path: '/trpc' }, 'api-server');
77
- console.log(`📡 API ready at http://${host}:${actualPort}/trpc (HTTP & WS)`);
78
- // Graceful shutdown
79
- const shutdown = () => {
80
- try {
81
- wss.close();
82
- }
83
- catch (error) {
84
- log.error('Failed to close WebSocket server', error, 'api-server');
85
- }
86
- try {
87
- httpServer.close();
88
- }
89
- catch (error) {
90
- log.error('Failed to close HTTP server', error, 'api-server');
91
- }
92
- process.exit(0);
93
- };
94
- process.on('SIGINT', shutdown);
95
- process.on('SIGTERM', shutdown);
96
- }
97
- // Self-executing entry when run directly under ESM (e.g., tsx src/index.ts or node dist/index.js)
98
- try {
99
- const isMain = process.argv[1] ? pathToFileURL(process.argv[1]).href === import.meta.url : false;
100
- if (isMain) {
101
- const host = process.env.HOST || 'localhost';
102
- const resolveApiPort = async () => {
103
- const port = getNumberEnv('PORT', 3000);
104
- return port + 1;
105
- };
106
- (async () => {
107
- const port = await resolveApiPort();
108
- startApiServer({ port, host }).catch((err) => {
109
- console.error('Failed to start API server:', err);
110
- process.exit(1);
111
- });
112
- })();
113
- }
114
- }
115
- catch {
116
- // ignore
117
- }
@@ -1,70 +0,0 @@
1
- /**
2
- * Unified ID generation utility for consistent ID creation across the application
3
- */
4
- export type IdPrefix = 'workflow' | 'exec' | 'improve' | 'merge' | 'review' | 'claude' | 'task' | 'session';
5
- interface IdGeneratorOptions {
6
- /**
7
- * Use UUID v4 for guaranteed uniqueness (default: true)
8
- */
9
- useUuid?: boolean;
10
- /**
11
- * Include timestamp for sortability (default: false)
12
- */
13
- includeTimestamp?: boolean;
14
- /**
15
- * Custom separator between parts (default: '_')
16
- */
17
- separator?: string;
18
- }
19
- /**
20
- * Generate a unique ID with consistent format
21
- *
22
- * @param prefix - The prefix to identify the ID type
23
- * @param options - Configuration options for ID generation
24
- * @returns A unique identifier string
25
- *
26
- * @example
27
- * generateId('workflow') // 'workflow_550e8400-e29b-41d4-a716-446655440000'
28
- * generateId('exec', { includeTimestamp: true }) // 'exec_1703123456789_550e8400-e29b-41d4'
29
- */
30
- export declare function generateId(prefix: IdPrefix | string, options?: IdGeneratorOptions): string;
31
- /**
32
- * Generate a short, human-readable ID (less secure, for display purposes)
33
- *
34
- * @param prefix - The prefix to identify the ID type
35
- * @returns A shorter identifier string
36
- *
37
- * @example
38
- * generateShortId('task') // 'task_a1b2c3d4'
39
- */
40
- export declare function generateShortId(prefix: IdPrefix | string): string;
41
- /**
42
- * Parse an ID to extract its components
43
- *
44
- * @param id - The ID to parse
45
- * @param separator - The separator used in the ID
46
- * @returns Parsed components of the ID
47
- */
48
- export declare function parseId(id: string, separator?: string): {
49
- prefix: string;
50
- timestamp?: number;
51
- uuid?: string;
52
- full: string;
53
- };
54
- /**
55
- * Validate if a string is a valid UUID v4
56
- */
57
- export declare function isValidUuid(id: string): boolean;
58
- /**
59
- * Extract the UUID portion from a prefixed ID
60
- */
61
- export declare function extractUuid(id: string): string | null;
62
- /**
63
- * Create a batch of IDs efficiently
64
- */
65
- export declare function generateBatchIds(prefix: IdPrefix | string, count: number, options?: IdGeneratorOptions): string[];
66
- /**
67
- * Generate a deterministic ID based on input (useful for idempotency)
68
- */
69
- export declare function generateDeterministicId(prefix: IdPrefix | string, input: string): Promise<string>;
70
- export {};
@@ -1,123 +0,0 @@
1
- import { v4 as uuidv4 } from 'uuid';
2
- /**
3
- * Generate a unique ID with consistent format
4
- *
5
- * @param prefix - The prefix to identify the ID type
6
- * @param options - Configuration options for ID generation
7
- * @returns A unique identifier string
8
- *
9
- * @example
10
- * generateId('workflow') // 'workflow_550e8400-e29b-41d4-a716-446655440000'
11
- * generateId('exec', { includeTimestamp: true }) // 'exec_1703123456789_550e8400-e29b-41d4'
12
- */
13
- export function generateId(prefix, options = {}) {
14
- const { useUuid = true, includeTimestamp = false, separator = '_' } = options;
15
- const parts = [prefix];
16
- if (includeTimestamp) {
17
- // Use high-resolution timestamp for better uniqueness
18
- parts.push(Date.now().toString());
19
- }
20
- if (useUuid) {
21
- parts.push(uuidv4());
22
- }
23
- else {
24
- // Fallback to crypto.randomUUID if available (browser/Node 19+)
25
- if (typeof crypto !== 'undefined' && crypto.randomUUID) {
26
- parts.push(crypto.randomUUID());
27
- }
28
- else {
29
- // Legacy fallback with better entropy
30
- const timestamp = Date.now();
31
- const random1 = Math.random().toString(36).substring(2, 11);
32
- const random2 = Math.random().toString(36).substring(2, 7);
33
- const counter = getCounter();
34
- parts.push(`${timestamp.toString(36)}${random1}${random2}${counter.toString(36)}`);
35
- }
36
- }
37
- return parts.join(separator);
38
- }
39
- /**
40
- * Generate a short, human-readable ID (less secure, for display purposes)
41
- *
42
- * @param prefix - The prefix to identify the ID type
43
- * @returns A shorter identifier string
44
- *
45
- * @example
46
- * generateShortId('task') // 'task_a1b2c3d4'
47
- */
48
- export function generateShortId(prefix) {
49
- const timestamp = Date.now().toString(36).slice(-4);
50
- const random = Math.random().toString(36).substring(2, 6);
51
- return `${prefix}_${timestamp}${random}`;
52
- }
53
- /**
54
- * Parse an ID to extract its components
55
- *
56
- * @param id - The ID to parse
57
- * @param separator - The separator used in the ID
58
- * @returns Parsed components of the ID
59
- */
60
- export function parseId(id, separator = '_') {
61
- const parts = id.split(separator);
62
- const result = {
63
- prefix: parts[0] || '',
64
- full: id,
65
- };
66
- // Check if second part is a timestamp (13+ digit number for millisecond timestamps)
67
- // This avoids treating short numbers like "123" as timestamps
68
- if (parts[1] && /^\d{13,}$/.test(parts[1])) {
69
- result.timestamp = parseInt(parts[1], 10);
70
- // When timestamp is present, UUID is the third part onward
71
- result.uuid = parts.slice(2).join(separator);
72
- }
73
- else {
74
- // No timestamp, so UUID is everything after the prefix
75
- result.uuid = parts.slice(1).join(separator);
76
- }
77
- return result;
78
- }
79
- /**
80
- * Validate if a string is a valid UUID v4
81
- */
82
- export function isValidUuid(id) {
83
- const uuidV4Regex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
84
- return uuidV4Regex.test(id);
85
- }
86
- /**
87
- * Extract the UUID portion from a prefixed ID
88
- */
89
- export function extractUuid(id) {
90
- const parts = id.split('_');
91
- const lastPart = parts[parts.length - 1];
92
- return isValidUuid(lastPart) ? lastPart : null;
93
- }
94
- // Counter for additional entropy in fallback ID generation
95
- let counter = 0;
96
- function getCounter() {
97
- counter = (counter + 1) % 10000;
98
- return counter;
99
- }
100
- /**
101
- * Create a batch of IDs efficiently
102
- */
103
- export function generateBatchIds(prefix, count, options) {
104
- return Array.from({ length: count }, () => generateId(prefix, options));
105
- }
106
- /**
107
- * Generate a deterministic ID based on input (useful for idempotency)
108
- */
109
- export async function generateDeterministicId(prefix, input) {
110
- // Use Web Crypto API if available
111
- if (typeof crypto !== 'undefined' && crypto.subtle) {
112
- const encoder = new TextEncoder();
113
- const data = encoder.encode(input);
114
- const hashBuffer = await crypto.subtle.digest('SHA-256', data);
115
- const hashArray = Array.from(new Uint8Array(hashBuffer));
116
- const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
117
- return `${prefix}_${hashHex.substring(0, 32)}`;
118
- }
119
- // Fallback for Node.js
120
- const cryptoModule = await import('crypto');
121
- const hash = cryptoModule.createHash('sha256').update(input).digest('hex');
122
- return `${prefix}_${hash.substring(0, 32)}`;
123
- }