vibeman 0.0.0 → 0.0.1

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 (220) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +116 -0
  3. package/dist/runtime/api/.tsbuildinfo +1 -0
  4. package/dist/runtime/api/agent/agent-service.d.ts +226 -0
  5. package/dist/runtime/api/agent/agent-service.js +901 -0
  6. package/dist/runtime/api/agent/ai-providers/claude-code-adapter.d.ts +61 -0
  7. package/dist/runtime/api/agent/ai-providers/claude-code-adapter.js +373 -0
  8. package/dist/runtime/api/agent/ai-providers/codex-cli-provider.d.ts +34 -0
  9. package/dist/runtime/api/agent/ai-providers/codex-cli-provider.js +281 -0
  10. package/dist/runtime/api/agent/ai-providers/index.d.ts +9 -0
  11. package/dist/runtime/api/agent/ai-providers/index.js +7 -0
  12. package/dist/runtime/api/agent/ai-providers/types.d.ts +180 -0
  13. package/dist/runtime/api/agent/ai-providers/types.js +5 -0
  14. package/dist/runtime/api/agent/codex-cli-provider.test.d.ts +1 -0
  15. package/dist/runtime/api/agent/codex-cli-provider.test.js +88 -0
  16. package/dist/runtime/api/agent/core-agent-service.d.ts +119 -0
  17. package/dist/runtime/api/agent/core-agent-service.js +267 -0
  18. package/dist/runtime/api/agent/parsers.d.ts +15 -0
  19. package/dist/runtime/api/agent/parsers.js +241 -0
  20. package/dist/runtime/api/agent/prompt-service.d.ts +17 -0
  21. package/dist/runtime/api/agent/prompt-service.js +340 -0
  22. package/dist/runtime/api/agent/routing-policy.d.ts +188 -0
  23. package/dist/runtime/api/agent/routing-policy.js +246 -0
  24. package/dist/runtime/api/api/router-helpers.d.ts +32 -0
  25. package/dist/runtime/api/api/router-helpers.js +31 -0
  26. package/dist/runtime/api/api/routers/ai.d.ts +188 -0
  27. package/dist/runtime/api/api/routers/ai.js +410 -0
  28. package/dist/runtime/api/api/routers/executions.d.ts +98 -0
  29. package/dist/runtime/api/api/routers/executions.js +103 -0
  30. package/dist/runtime/api/api/routers/git.d.ts +45 -0
  31. package/dist/runtime/api/api/routers/git.js +35 -0
  32. package/dist/runtime/api/api/routers/settings.d.ts +139 -0
  33. package/dist/runtime/api/api/routers/settings.js +113 -0
  34. package/dist/runtime/api/api/routers/tasks.d.ts +141 -0
  35. package/dist/runtime/api/api/routers/tasks.js +238 -0
  36. package/dist/runtime/api/api/routers/workflows.d.ts +268 -0
  37. package/dist/runtime/api/api/routers/workflows.js +308 -0
  38. package/dist/runtime/api/api/routers/worktrees.d.ts +102 -0
  39. package/dist/runtime/api/api/routers/worktrees.js +80 -0
  40. package/dist/runtime/api/api/trpc.d.ts +118 -0
  41. package/dist/runtime/api/api/trpc.js +34 -0
  42. package/dist/runtime/api/index.d.ts +9 -0
  43. package/dist/runtime/api/index.js +125 -0
  44. package/dist/runtime/api/lib/id-generator.d.ts +70 -0
  45. package/dist/runtime/api/lib/id-generator.js +123 -0
  46. package/dist/runtime/api/lib/image-paste-drop-extension.d.ts +26 -0
  47. package/dist/runtime/api/lib/image-paste-drop-extension.js +125 -0
  48. package/dist/runtime/api/lib/logger.d.ts +11 -0
  49. package/dist/runtime/api/lib/logger.js +188 -0
  50. package/dist/runtime/api/lib/markdown-utils.d.ts +8 -0
  51. package/dist/runtime/api/lib/markdown-utils.js +282 -0
  52. package/dist/runtime/api/lib/markdown-utils.test.d.ts +1 -0
  53. package/dist/runtime/api/lib/markdown-utils.test.js +348 -0
  54. package/dist/runtime/api/lib/server/agent-service-singleton.d.ts +6 -0
  55. package/dist/runtime/api/lib/server/agent-service-singleton.js +27 -0
  56. package/dist/runtime/api/lib/server/git-service-singleton.d.ts +6 -0
  57. package/dist/runtime/api/lib/server/git-service-singleton.js +47 -0
  58. package/dist/runtime/api/lib/server/project-root.d.ts +2 -0
  59. package/dist/runtime/api/lib/server/project-root.js +38 -0
  60. package/dist/runtime/api/lib/server/task-service-singleton.d.ts +7 -0
  61. package/dist/runtime/api/lib/server/task-service-singleton.js +58 -0
  62. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.d.ts +7 -0
  63. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.js +57 -0
  64. package/dist/runtime/api/lib/tiptap-utils.clamp-selection.test.d.ts +1 -0
  65. package/dist/runtime/api/lib/tiptap-utils.clamp-selection.test.js +27 -0
  66. package/dist/runtime/api/lib/tiptap-utils.d.ts +130 -0
  67. package/dist/runtime/api/lib/tiptap-utils.js +327 -0
  68. package/dist/runtime/api/lib/trpc/client.d.ts +1 -0
  69. package/dist/runtime/api/lib/trpc/client.js +5 -0
  70. package/dist/runtime/api/lib/trpc/server.d.ts +822 -0
  71. package/dist/runtime/api/lib/trpc/server.js +11 -0
  72. package/dist/runtime/api/lib/trpc/ws-server.d.ts +8 -0
  73. package/dist/runtime/api/lib/trpc/ws-server.js +33 -0
  74. package/dist/runtime/api/persistence/database-service.d.ts +14 -0
  75. package/dist/runtime/api/persistence/database-service.js +74 -0
  76. package/dist/runtime/api/persistence/execution-log-persistence.d.ts +90 -0
  77. package/dist/runtime/api/persistence/execution-log-persistence.js +410 -0
  78. package/dist/runtime/api/persistence/execution-log-persistence.test.d.ts +1 -0
  79. package/dist/runtime/api/persistence/execution-log-persistence.test.js +170 -0
  80. package/dist/runtime/api/router.d.ts +825 -0
  81. package/dist/runtime/api/router.js +56 -0
  82. package/dist/runtime/api/settings-service.d.ts +110 -0
  83. package/dist/runtime/api/settings-service.js +611 -0
  84. package/dist/runtime/api/tasks/file-watcher.d.ts +23 -0
  85. package/dist/runtime/api/tasks/file-watcher.js +88 -0
  86. package/dist/runtime/api/tasks/task-file-parser.d.ts +13 -0
  87. package/dist/runtime/api/tasks/task-file-parser.js +161 -0
  88. package/dist/runtime/api/tasks/task-service.d.ts +36 -0
  89. package/dist/runtime/api/tasks/task-service.js +173 -0
  90. package/dist/runtime/api/types/index.d.ts +179 -0
  91. package/dist/runtime/api/types/index.js +1 -0
  92. package/dist/runtime/api/types/settings.d.ts +81 -0
  93. package/dist/runtime/api/types/settings.js +2 -0
  94. package/dist/runtime/api/types.d.ts +2 -0
  95. package/dist/runtime/api/types.js +1 -0
  96. package/dist/runtime/api/utils/env.d.ts +6 -0
  97. package/dist/runtime/api/utils/env.js +12 -0
  98. package/dist/runtime/api/utils/stripNextEnv.d.ts +7 -0
  99. package/dist/runtime/api/utils/stripNextEnv.js +22 -0
  100. package/dist/runtime/api/utils/title-slug.d.ts +6 -0
  101. package/dist/runtime/api/utils/title-slug.js +77 -0
  102. package/dist/runtime/api/utils/url.d.ts +2 -0
  103. package/dist/runtime/api/utils/url.js +19 -0
  104. package/dist/runtime/api/vcs/git-history-service.d.ts +57 -0
  105. package/dist/runtime/api/vcs/git-history-service.js +228 -0
  106. package/dist/runtime/api/vcs/git-service.d.ts +127 -0
  107. package/dist/runtime/api/vcs/git-service.js +284 -0
  108. package/dist/runtime/api/vcs/worktree-service.d.ts +93 -0
  109. package/dist/runtime/api/vcs/worktree-service.js +506 -0
  110. package/dist/runtime/api/vcs/worktree-service.test.d.ts +1 -0
  111. package/dist/runtime/api/vcs/worktree-service.test.js +20 -0
  112. package/dist/runtime/api/workflows/quality-pipeline.d.ts +58 -0
  113. package/dist/runtime/api/workflows/quality-pipeline.js +400 -0
  114. package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +313 -0
  115. package/dist/runtime/api/workflows/vibing-orchestrator.js +1861 -0
  116. package/dist/runtime/web/.next/BUILD_ID +1 -0
  117. package/dist/runtime/web/.next/app-build-manifest.json +59 -0
  118. package/dist/runtime/web/.next/app-path-routes-manifest.json +7 -0
  119. package/dist/runtime/web/.next/build-manifest.json +33 -0
  120. package/dist/runtime/web/.next/package.json +1 -0
  121. package/dist/runtime/web/.next/prerender-manifest.json +61 -0
  122. package/dist/runtime/web/.next/react-loadable-manifest.json +39 -0
  123. package/dist/runtime/web/.next/required-server-files.json +334 -0
  124. package/dist/runtime/web/.next/routes-manifest.json +62 -0
  125. package/dist/runtime/web/.next/server/app/_not-found/page.js +2 -0
  126. package/dist/runtime/web/.next/server/app/_not-found/page.js.nft.json +1 -0
  127. package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  128. package/dist/runtime/web/.next/server/app/_not-found.html +7 -0
  129. package/dist/runtime/web/.next/server/app/_not-found.meta +8 -0
  130. package/dist/runtime/web/.next/server/app/_not-found.rsc +22 -0
  131. package/dist/runtime/web/.next/server/app/api/health/route.js +1 -0
  132. package/dist/runtime/web/.next/server/app/api/health/route.js.nft.json +1 -0
  133. package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -0
  134. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +1 -0
  135. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js.nft.json +1 -0
  136. package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +1 -0
  137. package/dist/runtime/web/.next/server/app/api/upload/route.js +1 -0
  138. package/dist/runtime/web/.next/server/app/api/upload/route.js.nft.json +1 -0
  139. package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +1 -0
  140. package/dist/runtime/web/.next/server/app/index.html +7 -0
  141. package/dist/runtime/web/.next/server/app/index.meta +7 -0
  142. package/dist/runtime/web/.next/server/app/index.rsc +27 -0
  143. package/dist/runtime/web/.next/server/app/page.js +147 -0
  144. package/dist/runtime/web/.next/server/app/page.js.nft.json +1 -0
  145. package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +1 -0
  146. package/dist/runtime/web/.next/server/app-paths-manifest.json +7 -0
  147. package/dist/runtime/web/.next/server/chunks/217.js +1 -0
  148. package/dist/runtime/web/.next/server/chunks/383.js +6 -0
  149. package/dist/runtime/web/.next/server/chunks/458.js +1 -0
  150. package/dist/runtime/web/.next/server/chunks/576.js +18 -0
  151. package/dist/runtime/web/.next/server/chunks/635.js +22 -0
  152. package/dist/runtime/web/.next/server/chunks/761.js +1 -0
  153. package/dist/runtime/web/.next/server/chunks/777.js +3 -0
  154. package/dist/runtime/web/.next/server/chunks/825.js +1 -0
  155. package/dist/runtime/web/.next/server/chunks/838.js +1 -0
  156. package/dist/runtime/web/.next/server/chunks/973.js +15 -0
  157. package/dist/runtime/web/.next/server/functions-config-manifest.json +4 -0
  158. package/dist/runtime/web/.next/server/middleware-build-manifest.js +1 -0
  159. package/dist/runtime/web/.next/server/middleware-manifest.json +6 -0
  160. package/dist/runtime/web/.next/server/middleware-react-loadable-manifest.js +1 -0
  161. package/dist/runtime/web/.next/server/next-font-manifest.js +1 -0
  162. package/dist/runtime/web/.next/server/next-font-manifest.json +1 -0
  163. package/dist/runtime/web/.next/server/pages/404.html +7 -0
  164. package/dist/runtime/web/.next/server/pages/500.html +1 -0
  165. package/dist/runtime/web/.next/server/pages/_app.js +1 -0
  166. package/dist/runtime/web/.next/server/pages/_app.js.nft.json +1 -0
  167. package/dist/runtime/web/.next/server/pages/_document.js +1 -0
  168. package/dist/runtime/web/.next/server/pages/_document.js.nft.json +1 -0
  169. package/dist/runtime/web/.next/server/pages/_error.js +19 -0
  170. package/dist/runtime/web/.next/server/pages/_error.js.nft.json +1 -0
  171. package/dist/runtime/web/.next/server/pages-manifest.json +6 -0
  172. package/dist/runtime/web/.next/server/server-reference-manifest.js +1 -0
  173. package/dist/runtime/web/.next/server/server-reference-manifest.json +1 -0
  174. package/dist/runtime/web/.next/server/webpack-runtime.js +1 -0
  175. package/dist/runtime/web/.next/static/1HR8N0rJkCvFRtbTPJMyH/_buildManifest.js +1 -0
  176. package/dist/runtime/web/.next/static/1HR8N0rJkCvFRtbTPJMyH/_ssgManifest.js +1 -0
  177. package/dist/runtime/web/.next/static/chunks/18-15c10d3288afef2e.js +1 -0
  178. package/dist/runtime/web/.next/static/chunks/1c0ca389.537bbe362e3ffbd9.js +3 -0
  179. package/dist/runtime/web/.next/static/chunks/22747d63-ad5da0c19f4cfe41.js +71 -0
  180. package/dist/runtime/web/.next/static/chunks/277-0142a939f08738c3.js +63 -0
  181. package/dist/runtime/web/.next/static/chunks/355.056c2645878a799a.js +1 -0
  182. package/dist/runtime/web/.next/static/chunks/420.a5ccf151c9e2b2f1.js +1 -0
  183. package/dist/runtime/web/.next/static/chunks/439.1be0c6242fd248d5.js +15 -0
  184. package/dist/runtime/web/.next/static/chunks/440.c52e7c0f797e22b2.js +1 -0
  185. package/dist/runtime/web/.next/static/chunks/575-e2478287c27da87b.js +1 -0
  186. package/dist/runtime/web/.next/static/chunks/691.920d88c115087314.js +1 -0
  187. package/dist/runtime/web/.next/static/chunks/765-e838910065b50c3d.js +1 -0
  188. package/dist/runtime/web/.next/static/chunks/87c73c54-09e1ba5c70e60a51.js +1 -0
  189. package/dist/runtime/web/.next/static/chunks/891cff7f.0f71fc028f87e683.js +1 -0
  190. package/dist/runtime/web/.next/static/chunks/8bb4d8db-3e2aa02b0a2384b9.js +1 -0
  191. package/dist/runtime/web/.next/static/chunks/9af238c7-271a911d4e99ab18.js +1 -0
  192. package/dist/runtime/web/.next/static/chunks/app/_not-found/page-1cb74d1cba27d0ab.js +1 -0
  193. package/dist/runtime/web/.next/static/chunks/app/api/health/route-105a61ae865ba536.js +1 -0
  194. package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-105a61ae865ba536.js +1 -0
  195. package/dist/runtime/web/.next/static/chunks/app/api/upload/route-105a61ae865ba536.js +1 -0
  196. package/dist/runtime/web/.next/static/chunks/app/layout-dc0cfd29075b2160.js +1 -0
  197. package/dist/runtime/web/.next/static/chunks/app/page-f34a8b196b18850b.js +1 -0
  198. package/dist/runtime/web/.next/static/chunks/cac567b0-5b77dd12911823cd.js +1 -0
  199. package/dist/runtime/web/.next/static/chunks/framework-2518f1345b5b2806.js +1 -0
  200. package/dist/runtime/web/.next/static/chunks/main-17665e5e39de9a8a.js +1 -0
  201. package/dist/runtime/web/.next/static/chunks/main-app-c0b0f5ba4f7f9d75.js +1 -0
  202. package/dist/runtime/web/.next/static/chunks/pages/_app-d6f6b3bbc3d81ee1.js +1 -0
  203. package/dist/runtime/web/.next/static/chunks/pages/_error-75a96cf1997cc3b9.js +1 -0
  204. package/dist/runtime/web/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  205. package/dist/runtime/web/.next/static/chunks/webpack-c8de37305b4635cf.js +1 -0
  206. package/dist/runtime/web/.next/static/css/08c950681f1a9a92.css +1 -0
  207. package/dist/runtime/web/.next/static/css/2728291c68f99cb1.css +3 -0
  208. package/dist/runtime/web/.next/static/css/521bd69cc298cd1a.css +1 -0
  209. package/dist/runtime/web/.next/static/css/537e22821e101b87.css +1 -0
  210. package/dist/runtime/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  211. package/dist/runtime/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  212. package/dist/runtime/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  213. package/dist/runtime/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  214. package/dist/runtime/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  215. package/dist/runtime/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  216. package/dist/runtime/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  217. package/dist/runtime/web/package.json +65 -0
  218. package/dist/runtime/web/server.js +44 -0
  219. package/dist/tsconfig.tsbuildinfo +1 -0
  220. package/package.json +80 -7
@@ -0,0 +1,268 @@
1
+ import type { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
2
+ type Deps = {
3
+ requireOrchestrator: () => Promise<VibingOrchestrator>;
4
+ requireOrchestratorSync: () => VibingOrchestrator;
5
+ };
6
+ export declare function buildWorkflowRoutes({ requireOrchestrator, requireOrchestratorSync }: Deps): {
7
+ readonly updateWorkflowOptions: import("@trpc/server").TRPCMutationProcedure<{
8
+ input: {
9
+ config: {
10
+ autoQualityChecks?: boolean | undefined;
11
+ requireHumanApproval?: boolean | undefined;
12
+ aiCodeReview?: boolean | undefined;
13
+ autoCommit?: boolean | undefined;
14
+ stepByStepMode?: boolean | undefined;
15
+ createPR?: boolean | undefined;
16
+ autoMerge?: boolean | undefined;
17
+ aiRoutingOverrides?: {
18
+ execute_task?: {
19
+ provider?: string | undefined;
20
+ model?: string | undefined;
21
+ } | undefined;
22
+ improve_task?: {
23
+ provider?: string | undefined;
24
+ model?: string | undefined;
25
+ } | undefined;
26
+ ai_codereview?: {
27
+ provider?: string | undefined;
28
+ model?: string | undefined;
29
+ } | undefined;
30
+ ai_merge?: {
31
+ provider?: string | undefined;
32
+ model?: string | undefined;
33
+ } | undefined;
34
+ } | undefined;
35
+ };
36
+ workflowId: string;
37
+ };
38
+ output: {
39
+ readonly success: true;
40
+ };
41
+ meta: object;
42
+ }>;
43
+ readonly startWorkflow: import("@trpc/server").TRPCMutationProcedure<{
44
+ input: {
45
+ taskId: string;
46
+ config?: {
47
+ autoQualityChecks?: boolean | undefined;
48
+ requireHumanApproval?: boolean | undefined;
49
+ aiCodeReview?: boolean | undefined;
50
+ autoCommit?: boolean | undefined;
51
+ stepByStepMode?: boolean | undefined;
52
+ createPR?: boolean | undefined;
53
+ autoMerge?: boolean | undefined;
54
+ aiRoutingOverrides?: {
55
+ execute_task?: {
56
+ provider?: string | undefined;
57
+ model?: string | undefined;
58
+ } | undefined;
59
+ improve_task?: {
60
+ provider?: string | undefined;
61
+ model?: string | undefined;
62
+ } | undefined;
63
+ ai_codereview?: {
64
+ provider?: string | undefined;
65
+ model?: string | undefined;
66
+ } | undefined;
67
+ ai_merge?: {
68
+ provider?: string | undefined;
69
+ model?: string | undefined;
70
+ } | undefined;
71
+ } | undefined;
72
+ } | undefined;
73
+ };
74
+ output: {
75
+ workflowId: string;
76
+ };
77
+ meta: object;
78
+ }>;
79
+ readonly continueWorkflow: import("@trpc/server").TRPCMutationProcedure<{
80
+ input: {
81
+ workflowId: string;
82
+ };
83
+ output: {
84
+ readonly success: true;
85
+ };
86
+ meta: object;
87
+ }>;
88
+ readonly runValidation: import("@trpc/server").TRPCMutationProcedure<{
89
+ input: {
90
+ workflowId: string;
91
+ };
92
+ output: {
93
+ readonly success: true;
94
+ };
95
+ meta: object;
96
+ }>;
97
+ readonly runMerge: import("@trpc/server").TRPCMutationProcedure<{
98
+ input: {
99
+ workflowId: string;
100
+ provider?: string | undefined;
101
+ model?: string | undefined;
102
+ };
103
+ output: {
104
+ readonly success: true;
105
+ };
106
+ meta: object;
107
+ }>;
108
+ readonly runCleanup: import("@trpc/server").TRPCMutationProcedure<{
109
+ input: {
110
+ workflowId: string;
111
+ };
112
+ output: {
113
+ readonly success: true;
114
+ };
115
+ meta: object;
116
+ }>;
117
+ readonly pauseWorkflow: import("@trpc/server").TRPCMutationProcedure<{
118
+ input: {
119
+ workflowId: string;
120
+ };
121
+ output: {
122
+ readonly success: true;
123
+ };
124
+ meta: object;
125
+ }>;
126
+ readonly resetWorkflow: import("@trpc/server").TRPCMutationProcedure<{
127
+ input: {
128
+ workflowId: string;
129
+ force?: boolean | undefined;
130
+ deleteWorktree?: boolean | undefined;
131
+ };
132
+ output: {
133
+ success: true;
134
+ };
135
+ meta: object;
136
+ }>;
137
+ readonly approveWorkflow: import("@trpc/server").TRPCMutationProcedure<{
138
+ input: {
139
+ workflowId: string;
140
+ comments?: string | undefined;
141
+ };
142
+ output: {
143
+ readonly success: true;
144
+ };
145
+ meta: object;
146
+ }>;
147
+ readonly rejectWorkflow: import("@trpc/server").TRPCMutationProcedure<{
148
+ input: {
149
+ workflowId: string;
150
+ feedback: string;
151
+ };
152
+ output: {
153
+ readonly success: true;
154
+ };
155
+ meta: object;
156
+ }>;
157
+ readonly onTaskWorkflowEvents: import("@trpc/server").TRPCSubscriptionProcedure<{
158
+ input: {
159
+ taskId?: string | undefined;
160
+ } | undefined;
161
+ output: AsyncIterable<{
162
+ type: "started" | "phase" | "completed" | "failed" | "updated" | "deleted";
163
+ workflowId: string;
164
+ phase?: string;
165
+ workflow?: any;
166
+ executionId?: string;
167
+ }, void, any>;
168
+ meta: object;
169
+ }>;
170
+ readonly getWorkflow: import("@trpc/server").TRPCQueryProcedure<{
171
+ input: {
172
+ workflowId: string;
173
+ };
174
+ output: import("../../types/index.js").VibingExecution | null;
175
+ meta: object;
176
+ }>;
177
+ readonly getWorkflowsByTaskId: import("@trpc/server").TRPCQueryProcedure<{
178
+ input: {
179
+ taskId: string;
180
+ };
181
+ output: import("../../types/index.js").VibingExecution[];
182
+ meta: object;
183
+ }>;
184
+ readonly getLatestWorkflowByTaskId: import("@trpc/server").TRPCQueryProcedure<{
185
+ input: {
186
+ taskId: string;
187
+ };
188
+ output: import("../../types/index.js").VibingExecution | null;
189
+ meta: object;
190
+ }>;
191
+ readonly reviewCode: import("@trpc/server").TRPCMutationProcedure<{
192
+ input: {
193
+ taskId: string;
194
+ provider?: string | undefined;
195
+ model?: string | undefined;
196
+ workflowId?: string | undefined;
197
+ reviewContext?: string | undefined;
198
+ };
199
+ output: {
200
+ executionId: string;
201
+ reviewSummary: string;
202
+ recommendations: string[];
203
+ qualityScore: number;
204
+ };
205
+ meta: object;
206
+ }>;
207
+ readonly approveAndContinueReview: import("@trpc/server").TRPCMutationProcedure<{
208
+ input: {
209
+ workflowId: string;
210
+ };
211
+ output: {
212
+ success: true;
213
+ };
214
+ meta: object;
215
+ }>;
216
+ readonly markCompleted: import("@trpc/server").TRPCMutationProcedure<{
217
+ input: {
218
+ workflowId: string;
219
+ };
220
+ output: {
221
+ success: true;
222
+ };
223
+ meta: object;
224
+ }>;
225
+ readonly checkWorktreeStatus: import("@trpc/server").TRPCMutationProcedure<{
226
+ input: {
227
+ workflowId: string;
228
+ };
229
+ output: {
230
+ clean: boolean;
231
+ uncommittedFiles: string[];
232
+ worktreePath?: string;
233
+ };
234
+ meta: object;
235
+ }>;
236
+ readonly rerunImplementation: import("@trpc/server").TRPCMutationProcedure<{
237
+ input: {
238
+ workflowId: string;
239
+ provider?: string | undefined;
240
+ model?: string | undefined;
241
+ feedback?: string | undefined;
242
+ };
243
+ output: {
244
+ success: true;
245
+ };
246
+ meta: object;
247
+ }>;
248
+ readonly skipToNextPhase: import("@trpc/server").TRPCMutationProcedure<{
249
+ input: {
250
+ workflowId: string;
251
+ };
252
+ output: {
253
+ success: true;
254
+ };
255
+ meta: object;
256
+ }>;
257
+ readonly rerunFromPhase: import("@trpc/server").TRPCMutationProcedure<{
258
+ input: {
259
+ workflowId: string;
260
+ phase: "completed" | "failed" | "draft" | "awaiting-review" | "approved" | "merged" | "paused" | "implementing" | "validating" | "ai-reviewing" | "merging" | "cleaning";
261
+ };
262
+ output: {
263
+ success: true;
264
+ };
265
+ meta: object;
266
+ }>;
267
+ };
268
+ export {};
@@ -0,0 +1,308 @@
1
+ import { z } from 'zod';
2
+ import { on, EventEmitter } from 'events';
3
+ import { publicProcedure } from '../trpc.js';
4
+ import { TRPCError } from '@trpc/server';
5
+ export function buildWorkflowRoutes({ requireOrchestrator, requireOrchestratorSync }) {
6
+ const OperationOverrideSchema = z.object({
7
+ provider: z.string().optional(),
8
+ model: z.string().optional(),
9
+ });
10
+ const WorkflowAIRoutingOverrides = z
11
+ .object({
12
+ execute_task: OperationOverrideSchema.optional(),
13
+ improve_task: OperationOverrideSchema.optional(),
14
+ ai_codereview: OperationOverrideSchema.optional(),
15
+ ai_merge: OperationOverrideSchema.optional(),
16
+ })
17
+ .partial();
18
+ const WorkflowConfig = z.object({
19
+ autoQualityChecks: z.boolean().optional(),
20
+ requireHumanApproval: z.boolean().optional(),
21
+ stepByStepMode: z.boolean().optional(),
22
+ autoCommit: z.boolean().optional(),
23
+ createPR: z.boolean().optional(),
24
+ autoMerge: z.boolean().optional(),
25
+ aiCodeReview: z.boolean().optional(),
26
+ aiRoutingOverrides: WorkflowAIRoutingOverrides.optional(),
27
+ });
28
+ const WorkflowConfigOpt = WorkflowConfig.optional();
29
+ return {
30
+ updateWorkflowOptions: publicProcedure
31
+ .input(z.object({ workflowId: z.string(), config: WorkflowConfig }))
32
+ .mutation(async ({ input }) => {
33
+ const orchestrator = await requireOrchestrator();
34
+ await orchestrator.updateWorkflowOptions(input.workflowId, input.config);
35
+ return { success: true };
36
+ }),
37
+ startWorkflow: publicProcedure
38
+ .input(z.object({ taskId: z.string(), config: WorkflowConfigOpt }))
39
+ .mutation(async ({ input }) => {
40
+ const orchestrator = await requireOrchestrator();
41
+ const workflowId = await orchestrator.startWorkflow(input.taskId, input.config || {});
42
+ return { workflowId };
43
+ }),
44
+ continueWorkflow: publicProcedure
45
+ .input(z.object({ workflowId: z.string() }))
46
+ .mutation(async ({ input }) => {
47
+ try {
48
+ const orchestrator = await requireOrchestrator();
49
+ await orchestrator.continueWorkflow(input.workflowId);
50
+ return { success: true };
51
+ }
52
+ catch (err) {
53
+ const msg = err instanceof Error ? err.message : String(err);
54
+ console.error('continueWorkflow failed:', msg);
55
+ throw new TRPCError({ code: 'BAD_REQUEST', message: msg });
56
+ }
57
+ }),
58
+ runValidation: publicProcedure
59
+ .input(z.object({ workflowId: z.string() }))
60
+ .mutation(async ({ input }) => {
61
+ const orchestrator = await requireOrchestrator();
62
+ await orchestrator.runValidation(input.workflowId);
63
+ return { success: true };
64
+ }),
65
+ runMerge: publicProcedure
66
+ .input(z.object({
67
+ workflowId: z.string(),
68
+ provider: z.string().optional(),
69
+ model: z.string().optional(),
70
+ }))
71
+ .mutation(async ({ input }) => {
72
+ const orchestrator = await requireOrchestrator();
73
+ await orchestrator.runMerge(input.workflowId, {
74
+ provider: input.provider,
75
+ model: input.model,
76
+ });
77
+ return { success: true };
78
+ }),
79
+ runCleanup: publicProcedure
80
+ .input(z.object({ workflowId: z.string() }))
81
+ .mutation(async ({ input }) => {
82
+ const orchestrator = await requireOrchestrator();
83
+ await orchestrator.runCleanup(input.workflowId);
84
+ return { success: true };
85
+ }),
86
+ pauseWorkflow: publicProcedure
87
+ .input(z.object({ workflowId: z.string() }))
88
+ .mutation(async ({ input }) => {
89
+ const orchestrator = await requireOrchestrator();
90
+ await orchestrator.pauseWorkflow(input.workflowId);
91
+ return { success: true };
92
+ }),
93
+ resetWorkflow: publicProcedure
94
+ .input(z.object({
95
+ workflowId: z.string(),
96
+ deleteWorktree: z.boolean().optional(),
97
+ force: z.boolean().optional(),
98
+ }))
99
+ .mutation(async ({ input }) => {
100
+ const orchestrator = await requireOrchestrator();
101
+ await orchestrator.resetWorkflow(input.workflowId, {
102
+ deleteWorktree: input.deleteWorktree,
103
+ force: input.force,
104
+ });
105
+ return { success: true };
106
+ }),
107
+ approveWorkflow: publicProcedure
108
+ .input(z.object({ workflowId: z.string(), comments: z.string().optional() }))
109
+ .mutation(async ({ input }) => {
110
+ const orchestrator = await requireOrchestrator();
111
+ await orchestrator.approveWorkflow(input.workflowId);
112
+ return { success: true };
113
+ }),
114
+ rejectWorkflow: publicProcedure
115
+ .input(z.object({ workflowId: z.string(), feedback: z.string() }))
116
+ .mutation(async ({ input }) => {
117
+ const orchestrator = await requireOrchestrator();
118
+ await orchestrator.rejectWorkflow(input.workflowId, input.feedback);
119
+ return { success: true };
120
+ }),
121
+ onTaskWorkflowEvents: publicProcedure
122
+ .input(z.object({ taskId: z.string().optional() }).optional())
123
+ .subscription(async function* (opts) {
124
+ const input = opts.input;
125
+ const orchestrator = requireOrchestratorSync();
126
+ const proxy = new EventEmitter();
127
+ const handleStarted = (workflow) => {
128
+ if (!input?.taskId || workflow.taskId === input.taskId)
129
+ proxy.emit('data', { type: 'started', workflowId: workflow.id, workflow });
130
+ };
131
+ const handlePhaseChanged = (data) => {
132
+ if (!input?.taskId || data.workflow?.taskId === input.taskId) {
133
+ // Dedupe terminal phases: completed/failed are emitted via dedicated events
134
+ if (data.newPhase !== 'completed' && data.newPhase !== 'failed') {
135
+ proxy.emit('data', {
136
+ type: 'phase',
137
+ workflowId: data.workflowId,
138
+ phase: data.newPhase,
139
+ workflow: data.workflow,
140
+ });
141
+ }
142
+ }
143
+ };
144
+ const handleCompleted = (workflow) => {
145
+ if (!input?.taskId || workflow.taskId === input.taskId)
146
+ proxy.emit('data', { type: 'completed', workflowId: workflow.id, workflow });
147
+ };
148
+ const handleFailed = (workflow) => {
149
+ if (!input?.taskId || workflow.taskId === input.taskId)
150
+ proxy.emit('data', { type: 'failed', workflowId: workflow.id, workflow });
151
+ };
152
+ // New: forward execution start events at the task level
153
+ const handleExecStarted = (data) => {
154
+ if (!input?.taskId || data?.workflow?.taskId === input.taskId) {
155
+ proxy.emit('data', {
156
+ type: 'phase',
157
+ workflowId: data.workflowId,
158
+ phase: data.phase || data.workflow?.phase,
159
+ workflow: data.workflow,
160
+ executionId: data.executionId,
161
+ });
162
+ }
163
+ };
164
+ // Forward additional workflow lifecycle/snapshot events
165
+ const handleUpdated = (workflow) => {
166
+ if (!input?.taskId || workflow.taskId === input.taskId)
167
+ proxy.emit('data', { type: 'updated', workflowId: workflow.id, workflow });
168
+ };
169
+ const handleDeleted = (info) => {
170
+ if (!input?.taskId || info?.taskId === input.taskId)
171
+ proxy.emit('data', { type: 'deleted', workflowId: info.workflowId });
172
+ };
173
+ const handlePaused = (workflow) => {
174
+ if (!input?.taskId || workflow.taskId === input.taskId)
175
+ proxy.emit('data', { type: 'updated', workflowId: workflow.id, workflow });
176
+ };
177
+ const handleOptionsUpdated = (workflow) => {
178
+ if (!input?.taskId || workflow.taskId === input.taskId)
179
+ proxy.emit('data', { type: 'updated', workflowId: workflow.id, workflow });
180
+ };
181
+ orchestrator.on('workflowStarted', handleStarted);
182
+ orchestrator.on('workflowPhaseChanged', handlePhaseChanged);
183
+ orchestrator.on('workflowCompleted', handleCompleted);
184
+ orchestrator.on('workflowFailed', handleFailed);
185
+ orchestrator.on('workflowExecutionStarted', handleExecStarted);
186
+ orchestrator.on('workflowUpdated', handleUpdated);
187
+ orchestrator.on('workflowDeleted', handleDeleted);
188
+ orchestrator.on('workflowPaused', handlePaused);
189
+ orchestrator.on('workflowOptionsUpdated', handleOptionsUpdated);
190
+ try {
191
+ for await (const [payload] of on(proxy, 'data', { signal: opts.signal })) {
192
+ yield payload;
193
+ }
194
+ }
195
+ finally {
196
+ orchestrator.off('workflowStarted', handleStarted);
197
+ orchestrator.off('workflowPhaseChanged', handlePhaseChanged);
198
+ orchestrator.off('workflowCompleted', handleCompleted);
199
+ orchestrator.off('workflowFailed', handleFailed);
200
+ orchestrator.off('workflowExecutionStarted', handleExecStarted);
201
+ orchestrator.off('workflowUpdated', handleUpdated);
202
+ orchestrator.off('workflowDeleted', handleDeleted);
203
+ orchestrator.off('workflowPaused', handlePaused);
204
+ orchestrator.off('workflowOptionsUpdated', handleOptionsUpdated);
205
+ }
206
+ }),
207
+ // Additional workflow helpers used by UI
208
+ getWorkflow: publicProcedure
209
+ .input(z.object({ workflowId: z.string() }))
210
+ .query(async ({ input }) => {
211
+ const orchestrator = await requireOrchestrator();
212
+ return orchestrator.getWorkflow(input.workflowId);
213
+ }),
214
+ getWorkflowsByTaskId: publicProcedure
215
+ .input(z.object({ taskId: z.string() }))
216
+ .query(async ({ input }) => {
217
+ const orchestrator = await requireOrchestrator();
218
+ return orchestrator.getTaskWorkflows(input.taskId);
219
+ }),
220
+ getLatestWorkflowByTaskId: publicProcedure
221
+ .input(z.object({ taskId: z.string() }))
222
+ .query(async ({ input }) => {
223
+ const orchestrator = await requireOrchestrator();
224
+ return orchestrator.getLatestWorkflowByTask(input.taskId);
225
+ }),
226
+ reviewCode: publicProcedure
227
+ .input(z.object({
228
+ taskId: z.string(),
229
+ workflowId: z.string().optional(),
230
+ reviewContext: z.string().optional(),
231
+ provider: z.string().optional(),
232
+ model: z.string().optional(),
233
+ }))
234
+ .mutation(async ({ input }) => {
235
+ const orchestrator = await requireOrchestrator();
236
+ return await orchestrator.reviewCode(input.taskId, input.reviewContext, {
237
+ workflowId: input.workflowId,
238
+ provider: input.provider,
239
+ model: input.model,
240
+ });
241
+ }),
242
+ approveAndContinueReview: publicProcedure
243
+ .input(z.object({ workflowId: z.string() }))
244
+ .mutation(async ({ input }) => {
245
+ const orchestrator = await requireOrchestrator();
246
+ await orchestrator.approveAndContinueReview(input.workflowId);
247
+ return { success: true };
248
+ }),
249
+ markCompleted: publicProcedure
250
+ .input(z.object({ workflowId: z.string() }))
251
+ .mutation(async ({ input }) => {
252
+ const orchestrator = await requireOrchestrator();
253
+ await orchestrator.markWorkflowCompleted(input.workflowId);
254
+ return { success: true };
255
+ }),
256
+ checkWorktreeStatus: publicProcedure
257
+ .input(z.object({ workflowId: z.string() }))
258
+ .mutation(async ({ input }) => {
259
+ const orchestrator = await requireOrchestrator();
260
+ return await orchestrator.checkWorktreeStatus(input.workflowId);
261
+ }),
262
+ rerunImplementation: publicProcedure
263
+ .input(z.object({
264
+ workflowId: z.string(),
265
+ feedback: z.string().optional(),
266
+ provider: z.string().optional(),
267
+ model: z.string().optional(),
268
+ }))
269
+ .mutation(async ({ input }) => {
270
+ const orchestrator = await requireOrchestrator();
271
+ await orchestrator.rerunImplementation(input.workflowId, input.feedback, {
272
+ provider: input.provider,
273
+ model: input.model,
274
+ });
275
+ return { success: true };
276
+ }),
277
+ skipToNextPhase: publicProcedure
278
+ .input(z.object({ workflowId: z.string() }))
279
+ .mutation(async ({ input }) => {
280
+ const orchestrator = await requireOrchestrator();
281
+ await orchestrator.skipToNextPhase(input.workflowId);
282
+ return { success: true };
283
+ }),
284
+ rerunFromPhase: publicProcedure
285
+ .input(z.object({
286
+ workflowId: z.string(),
287
+ phase: z.enum([
288
+ 'draft',
289
+ 'implementing',
290
+ 'validating',
291
+ 'ai-reviewing',
292
+ 'awaiting-review',
293
+ 'paused',
294
+ 'approved',
295
+ 'merging',
296
+ 'merged',
297
+ 'cleaning',
298
+ 'completed',
299
+ 'failed',
300
+ ]),
301
+ }))
302
+ .mutation(async ({ input }) => {
303
+ const orchestrator = await requireOrchestrator();
304
+ await orchestrator.rerunPhase(input.workflowId, input.phase);
305
+ return { success: true };
306
+ }),
307
+ };
308
+ }
@@ -0,0 +1,102 @@
1
+ import type { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
2
+ type Deps = {
3
+ requireOrchestrator: () => Promise<VibingOrchestrator>;
4
+ requireOrchestratorSync: () => VibingOrchestrator;
5
+ };
6
+ export declare function buildWorktreeRoutes({ requireOrchestrator, requireOrchestratorSync }: Deps): {
7
+ readonly listWorktrees: import("@trpc/server").TRPCQueryProcedure<{
8
+ input: void;
9
+ output: (import("../../types/index.js").WorktreeInfo & {
10
+ isConnectedToTask: boolean;
11
+ })[];
12
+ meta: object;
13
+ }>;
14
+ readonly syncWorktreeState: import("@trpc/server").TRPCMutationProcedure<{
15
+ input: void;
16
+ output: {
17
+ readonly success: true;
18
+ readonly message: "Worktree state synchronized";
19
+ };
20
+ meta: object;
21
+ }>;
22
+ readonly getWorktreeInfo: import("@trpc/server").TRPCQueryProcedure<{
23
+ input: {
24
+ taskId: string;
25
+ };
26
+ output: any;
27
+ meta: object;
28
+ }>;
29
+ readonly createWorktree: import("@trpc/server").TRPCMutationProcedure<{
30
+ input: {
31
+ taskId: string;
32
+ };
33
+ output: any;
34
+ meta: object;
35
+ }>;
36
+ readonly deleteWorktree: import("@trpc/server").TRPCMutationProcedure<{
37
+ input: {
38
+ taskId: string;
39
+ force?: boolean | undefined;
40
+ };
41
+ output: {
42
+ readonly success: true;
43
+ };
44
+ meta: object;
45
+ }>;
46
+ readonly openInEditor: import("@trpc/server").TRPCMutationProcedure<{
47
+ input: {
48
+ worktreePath: string;
49
+ };
50
+ output: {
51
+ readonly success: true;
52
+ };
53
+ meta: object;
54
+ }>;
55
+ readonly openInTerminal: import("@trpc/server").TRPCMutationProcedure<{
56
+ input: {
57
+ worktreePath: string;
58
+ };
59
+ output: {
60
+ readonly success: true;
61
+ };
62
+ meta: object;
63
+ }>;
64
+ readonly createWorktreePR: import("@trpc/server").TRPCMutationProcedure<{
65
+ input: {
66
+ taskId: string;
67
+ baseBranch?: string | undefined;
68
+ };
69
+ output: {
70
+ success: boolean;
71
+ pullRequest?: any;
72
+ error?: string;
73
+ };
74
+ meta: object;
75
+ }>;
76
+ readonly createPullRequest: import("@trpc/server").TRPCMutationProcedure<{
77
+ input: {
78
+ taskId: string;
79
+ baseBranch?: string | undefined;
80
+ };
81
+ output: {
82
+ success: boolean;
83
+ pullRequest?: any;
84
+ error?: string;
85
+ };
86
+ meta: object;
87
+ }>;
88
+ readonly cleanupWorktree: import("@trpc/server").TRPCMutationProcedure<{
89
+ input: {
90
+ isConnectedToTask: boolean;
91
+ worktreePath?: string | undefined;
92
+ force?: boolean | undefined;
93
+ taskId?: string | undefined;
94
+ branchName?: string | undefined;
95
+ };
96
+ output: {
97
+ readonly success: true;
98
+ };
99
+ meta: object;
100
+ }>;
101
+ };
102
+ export {};