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,197 +0,0 @@
1
- /**
2
- * Server Bootstrap - Async-first service initialization
3
- *
4
- * Provides ordered initialization of core services before router creation,
5
- * ensuring all dependencies are ready for synchronous access during runtime.
6
- */
7
- import { log } from '../logger.js';
8
- import { getSettingsService } from '../../settings-service.js';
9
- import { TaskService } from '../../tasks/task-service.js';
10
- import { AgentService } from '../../agent/agent-service.js';
11
- import { GitService } from '../../vcs/git-service.js';
12
- import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
13
- import { getProjectRoot, getVibeDir } from './project-root.js';
14
- // Ready-only service instances - throw if accessed before bootstrap
15
- let settingsService = null;
16
- let taskService = null;
17
- let agentService = null;
18
- let gitService = null;
19
- let worktreeService = null;
20
- let vibingOrchestrator = null;
21
- // Bootstrap completion promise for diagnostics/tests
22
- let ready = null;
23
- let isBootstrapped = false;
24
- // Default config fallback for VibingOrchestrator
25
- const getDefaultVibingConfig = () => ({
26
- autoQualityChecks: true,
27
- requireHumanApproval: true,
28
- aiCodeReview: true,
29
- retryPolicy: { maxImplementationAttempts: 3 },
30
- autoCommit: false,
31
- });
32
- /**
33
- * Initialize core services in proper dependency order.
34
- * Must be called before any service getters or router creation.
35
- */
36
- export async function bootstrap() {
37
- if (isBootstrapped) {
38
- log.info('Bootstrap already completed, skipping');
39
- return;
40
- }
41
- if (ready) {
42
- log.info('Bootstrap already in progress, waiting...');
43
- return ready;
44
- }
45
- const startTime = Date.now();
46
- log.info('Starting server bootstrap', {}, 'bootstrap');
47
- ready = (async () => {
48
- try {
49
- // Stage 1: Settings Service (foundation)
50
- const settingsStart = Date.now();
51
- settingsService = getSettingsService();
52
- log.info('Settings service initialized', {
53
- duration: Date.now() - settingsStart,
54
- }, 'bootstrap');
55
- // Stage 2: Task Service (depends on settings for vibeDir)
56
- const taskStart = Date.now();
57
- const settingsVibeDir = (() => {
58
- try {
59
- const s = settingsService.getSettings();
60
- return s?.development?.vibeDir;
61
- }
62
- catch {
63
- return undefined;
64
- }
65
- })();
66
- const vibeDir = settingsVibeDir ?? getVibeDir();
67
- taskService = new TaskService(vibeDir);
68
- await taskService.ensureInitialized();
69
- log.info('Task service initialized', {
70
- vibeDir,
71
- duration: Date.now() - taskStart,
72
- }, 'bootstrap');
73
- // Stage 3: Git Service (independent)
74
- const gitStart = Date.now();
75
- const projectRoot = getProjectRoot();
76
- const settingsDefaultBranch = (() => {
77
- try {
78
- const s = settingsService.getSettings();
79
- return s?.development?.git?.defaultBranch;
80
- }
81
- catch {
82
- return undefined;
83
- }
84
- })();
85
- const gitConfig = {
86
- defaultBranch: settingsDefaultBranch || 'main',
87
- };
88
- gitService = new GitService(projectRoot, gitConfig);
89
- log.info('Git service initialized', {
90
- projectRoot,
91
- defaultBranch: gitConfig.defaultBranch,
92
- duration: Date.now() - gitStart,
93
- }, 'bootstrap');
94
- // Stage 4: Agent Service (depends on task service)
95
- const agentStart = Date.now();
96
- agentService = new AgentService(taskService, projectRoot);
97
- log.info('Agent service initialized', {
98
- duration: Date.now() - agentStart,
99
- }, 'bootstrap');
100
- // Stage 5: Worktree Service (depends on git service, settings)
101
- const worktreeStart = Date.now();
102
- worktreeService = agentService.getWorktreeService();
103
- await worktreeService.initialize();
104
- log.info('Worktree service initialized', {
105
- duration: Date.now() - worktreeStart,
106
- }, 'bootstrap');
107
- // Stage 6: VibingOrchestrator (depends on all previous services)
108
- const orchestratorStart = Date.now();
109
- vibingOrchestrator = new VibingOrchestrator(taskService, agentService, worktreeService, getDefaultVibingConfig(), gitService);
110
- await vibingOrchestrator.initialize();
111
- log.info('VibingOrchestrator initialized', {
112
- duration: Date.now() - orchestratorStart,
113
- }, 'bootstrap');
114
- isBootstrapped = true;
115
- const totalDuration = Date.now() - startTime;
116
- log.info('Server bootstrap completed', {
117
- totalDuration,
118
- stages: 6,
119
- }, 'bootstrap');
120
- }
121
- catch (error) {
122
- log.error('Server bootstrap failed', error, 'bootstrap');
123
- throw error;
124
- }
125
- })();
126
- return ready;
127
- }
128
- /**
129
- * Ready-only sync getters - throw if called before bootstrap
130
- */
131
- export function getBootstrappedSettingsService() {
132
- if (!settingsService) {
133
- throw new Error('Settings service not available - bootstrap() must be called first');
134
- }
135
- return settingsService;
136
- }
137
- export function getBootstrappedTaskService() {
138
- if (!taskService) {
139
- throw new Error('Task service not available - bootstrap() must be called first');
140
- }
141
- return taskService;
142
- }
143
- export function getBootstrappedAgentService() {
144
- if (!agentService) {
145
- throw new Error('Agent service not available - bootstrap() must be called first');
146
- }
147
- return agentService;
148
- }
149
- export function getBootstrappedGitService() {
150
- if (!gitService) {
151
- throw new Error('Git service not available - bootstrap() must be called first');
152
- }
153
- return gitService;
154
- }
155
- export function getBootstrappedWorktreeService() {
156
- if (!worktreeService) {
157
- throw new Error('Worktree service not available - bootstrap() must be called first');
158
- }
159
- return worktreeService;
160
- }
161
- export function getBootstrappedVibingOrchestrator() {
162
- if (!vibingOrchestrator) {
163
- throw new Error('VibingOrchestrator not available - bootstrap() must be called first');
164
- }
165
- return vibingOrchestrator;
166
- }
167
- /**
168
- * Get bootstrap completion promise for diagnostics/tests
169
- */
170
- export function getBootstrapReady() {
171
- return ready;
172
- }
173
- /**
174
- * Check if bootstrap has completed
175
- */
176
- export function isBootstrapComplete() {
177
- return isBootstrapped;
178
- }
179
- /**
180
- * Test bootstrap function that initializes against a temp workspace
181
- */
182
- export async function testBootstrap(tempWorkspace) {
183
- // Reset bootstrap state for testing
184
- settingsService = null;
185
- taskService = null;
186
- agentService = null;
187
- gitService = null;
188
- worktreeService = null;
189
- vibingOrchestrator = null;
190
- ready = null;
191
- isBootstrapped = false;
192
- // TODO: Implement temp workspace logic if needed
193
- if (tempWorkspace) {
194
- log.info('Test bootstrap with temp workspace', { tempWorkspace }, 'bootstrap');
195
- }
196
- return bootstrap();
197
- }
@@ -1,6 +0,0 @@
1
- import { GitService, GitConfig } from '../../vcs/git-service.js';
2
- declare global {
3
- var __vibeman_git_service__: unknown;
4
- }
5
- export declare function getGitService(config?: GitConfig): GitService;
6
- export declare function resetGitService(): void;
@@ -1,47 +0,0 @@
1
- import { GitService } from '../../vcs/git-service.js';
2
- import { getSettingsService } from '../../settings-service.js';
3
- import { getProjectRoot, getVibeDir } from './project-root.js';
4
- export function getGitService(config) {
5
- if (!globalThis.__vibeman_git_service__) {
6
- // Resolve project root robustly (handles being launched from apps/api)
7
- const projectRoot = getProjectRoot();
8
- // Get vibeDir from settings, fallback to detected project .vibeman
9
- const settingsVibeDir = (() => {
10
- try {
11
- const svc = getSettingsService();
12
- const s = svc.getSettings();
13
- return s?.development?.vibeDir;
14
- }
15
- catch {
16
- return undefined;
17
- }
18
- })();
19
- const vibeDir = settingsVibeDir || getVibeDir();
20
- // Prefer settings default branch; fall back to 'main'
21
- const settingsDefaultBranch = (() => {
22
- try {
23
- const svc = getSettingsService();
24
- // Best effort; initialize may not have been awaited here
25
- // but service returns defaults if not yet loaded from disk
26
- const s = svc.getSettings();
27
- return s?.development?.git?.defaultBranch;
28
- }
29
- catch {
30
- return undefined;
31
- }
32
- })();
33
- const envConfig = {
34
- defaultBranch: settingsDefaultBranch || 'main',
35
- };
36
- globalThis.__vibeman_git_service__ = new GitService(projectRoot, {
37
- ...envConfig,
38
- ...config,
39
- });
40
- const settingsInfo = { defaultBranch: envConfig.defaultBranch };
41
- console.log(`🔧 Git Service initialized (root=${projectRoot}, vibeDir=${vibeDir}, defaultBranch=${settingsInfo.defaultBranch})`);
42
- }
43
- return globalThis.__vibeman_git_service__;
44
- }
45
- export function resetGitService() {
46
- globalThis.__vibeman_git_service__ = undefined;
47
- }
@@ -1,2 +0,0 @@
1
- export declare function getProjectRoot(): string;
2
- export declare function getVibeDir(): string;
@@ -1,61 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- // Find the repository project root by walking up from CWD
4
- // Preference order:
5
- // - env VIBEMAN_PROJECT_ROOT
6
- // - nearest directory containing .git or .vibeman
7
- // - fallback to process.cwd()
8
- export function getProjectRoot() {
9
- const envRoot = process.env.VIBEMAN_PROJECT_ROOT;
10
- if (envRoot && envRoot.trim().length > 0) {
11
- const trimmedRoot = envRoot.trim();
12
- if (path.isAbsolute(trimmedRoot)) {
13
- return path.normalize(trimmedRoot);
14
- }
15
- const baseCandidates = [
16
- process.env.VIBEMAN_PROJECT_ROOT_BASE,
17
- process.env.INIT_CWD,
18
- process.env.PWD,
19
- process.cwd(),
20
- ].filter((candidate) => !!candidate && candidate.trim().length > 0);
21
- let fallbackResolved = null;
22
- for (const base of baseCandidates) {
23
- const resolved = path.resolve(base, trimmedRoot);
24
- if (!fallbackResolved) {
25
- fallbackResolved = resolved;
26
- }
27
- if (fs.existsSync(resolved)) {
28
- return resolved;
29
- }
30
- }
31
- if (fallbackResolved) {
32
- return fallbackResolved;
33
- }
34
- return path.resolve(trimmedRoot);
35
- }
36
- // First preference: directory that contains a .git directory/file
37
- let dir = process.cwd();
38
- const { root } = path.parse(dir);
39
- while (true) {
40
- if (fs.existsSync(path.join(dir, '.git'))) {
41
- return dir;
42
- }
43
- if (dir === root)
44
- break;
45
- dir = path.dirname(dir);
46
- }
47
- // Fallback: nearest directory with .vibeman (if repo is checked out without .git, e.g. tarball)
48
- dir = process.cwd();
49
- while (true) {
50
- if (fs.existsSync(path.join(dir, '.vibeman'))) {
51
- return dir;
52
- }
53
- if (dir === root)
54
- break;
55
- dir = path.dirname(dir);
56
- }
57
- return process.cwd();
58
- }
59
- export function getVibeDir() {
60
- return path.join(getProjectRoot(), '.vibeman');
61
- }
@@ -1,7 +0,0 @@
1
- import { TaskService } from '../../tasks/task-service.js';
2
- declare global {
3
- var __vibeman_task_service__: unknown;
4
- var __vibeman_task_service_init__: unknown;
5
- }
6
- export declare function getTaskService(): TaskService;
7
- export declare function getTaskServiceAsync(): Promise<TaskService>;
@@ -1,58 +0,0 @@
1
- import { getSettingsService } from '../../settings-service.js';
2
- import { TaskService } from '../../tasks/task-service.js';
3
- import { isProduction } from '../../utils/env.js';
4
- import { getVibeDir } from './project-root.js';
5
- export function getTaskService() {
6
- if (!globalThis.__vibeman_task_service__) {
7
- const settingsVibeDir = (() => {
8
- try {
9
- const svc = getSettingsService();
10
- const s = svc.getSettings();
11
- return s?.development?.vibeDir;
12
- }
13
- catch {
14
- return undefined;
15
- }
16
- })();
17
- // Ensure we use the repo-level .vibeman even when launched from a subpackage
18
- const vibeDir = settingsVibeDir ?? getVibeDir();
19
- globalThis.__vibeman_task_service__ = new TaskService(vibeDir);
20
- console.log(`🗂️ Task Service initialized (vibeDir=${vibeDir})`);
21
- globalThis.__vibeman_task_service__
22
- .ensureInitialized()
23
- .catch((e) => console.error('TaskService init error:', e));
24
- }
25
- return globalThis.__vibeman_task_service__;
26
- }
27
- export async function getTaskServiceAsync() {
28
- if (globalThis.__vibeman_task_service__) {
29
- return globalThis.__vibeman_task_service__;
30
- }
31
- if (!globalThis.__vibeman_task_service_init__) {
32
- const settingsVibeDir = (() => {
33
- try {
34
- const svc = getSettingsService();
35
- const s = svc.getSettings();
36
- return s?.development?.vibeDir;
37
- }
38
- catch {
39
- return undefined;
40
- }
41
- })();
42
- const vibeDir = settingsVibeDir ?? getVibeDir();
43
- globalThis.__vibeman_task_service__ = new TaskService(vibeDir);
44
- globalThis.__vibeman_task_service_init__ = globalThis.__vibeman_task_service__
45
- .initialize()
46
- .then(() => globalThis.__vibeman_task_service__);
47
- }
48
- return globalThis.__vibeman_task_service_init__;
49
- }
50
- // Cleanup on process exit
51
- if (isProduction()) {
52
- process.on('SIGTERM', () => {
53
- if (globalThis.__vibeman_task_service__) {
54
- globalThis.__vibeman_task_service__.stop();
55
- globalThis.__vibeman_task_service__ = undefined;
56
- }
57
- });
58
- }
@@ -1,7 +0,0 @@
1
- import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
2
- declare global {
3
- var __vibeman_vibing_orchestrator__: unknown;
4
- var __vibeman_vibing_orchestrator_init__: unknown;
5
- }
6
- export declare function getVibingOrchestrator(): VibingOrchestrator;
7
- export declare function getVibingOrchestratorAsync(): Promise<VibingOrchestrator>;
@@ -1,57 +0,0 @@
1
- import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
2
- import { getTaskService } from './task-service-singleton.js';
3
- import { getAgentService } from './agent-service-singleton.js';
4
- import { getGitService } from './git-service-singleton.js';
5
- import { isProduction } from '../../utils/env.js';
6
- // Default config fallback for VibingOrchestrator
7
- const getDefaultVibingConfig = () => ({
8
- autoQualityChecks: true,
9
- requireHumanApproval: true,
10
- aiCodeReview: true,
11
- retryPolicy: { maxImplementationAttempts: 3 },
12
- autoCommit: false,
13
- });
14
- export function getVibingOrchestrator() {
15
- if (!globalThis.__vibeman_vibing_orchestrator__) {
16
- const taskService = getTaskService();
17
- const agentService = getAgentService();
18
- const gitService = getGitService();
19
- globalThis.__vibeman_vibing_orchestrator__ = new VibingOrchestrator(taskService, agentService, agentService.getWorktreeService(), getDefaultVibingConfig(), gitService);
20
- }
21
- // Kick off one-time initialization in background (non-blocking)
22
- if (!globalThis.__vibeman_vibing_orchestrator_init__) {
23
- globalThis.__vibeman_vibing_orchestrator_init__ = globalThis.__vibeman_vibing_orchestrator__
24
- .initialize()
25
- .catch((e) => console.error('VibingOrchestrator init error:', e))
26
- .finally(() => {
27
- globalThis.__vibeman_vibing_orchestrator_init__ = undefined;
28
- });
29
- }
30
- return globalThis.__vibeman_vibing_orchestrator__;
31
- }
32
- export async function getVibingOrchestratorAsync() {
33
- if (globalThis.__vibeman_vibing_orchestrator__) {
34
- return globalThis.__vibeman_vibing_orchestrator__;
35
- }
36
- if (!globalThis.__vibeman_vibing_orchestrator_init__) {
37
- const taskService = getTaskService();
38
- const agentService = getAgentService();
39
- const gitService = getGitService();
40
- globalThis.__vibeman_vibing_orchestrator__ = new VibingOrchestrator(taskService, agentService, agentService.getWorktreeService(), getDefaultVibingConfig(), gitService);
41
- globalThis.__vibeman_vibing_orchestrator_init__ = globalThis.__vibeman_vibing_orchestrator__
42
- .initialize()
43
- .catch((e) => console.error('VibingOrchestrator init error:', e));
44
- }
45
- await globalThis.__vibeman_vibing_orchestrator_init__;
46
- return globalThis.__vibeman_vibing_orchestrator__;
47
- }
48
- // Cleanup on process exit
49
- if (isProduction()) {
50
- process.on('SIGTERM', () => {
51
- if (globalThis.__vibeman_vibing_orchestrator__) {
52
- // VibingOrchestrator doesn't have a stop method, but we can clean up the reference
53
- globalThis.__vibeman_vibing_orchestrator__ = undefined;
54
- globalThis.__vibeman_vibing_orchestrator_init__ = undefined;
55
- }
56
- });
57
- }
@@ -1 +0,0 @@
1
- export declare const trpc: "The property 'useContext' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'useUtils' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'Provider' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'createClient' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'useQueries' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'useSuspenseQueries' in your router collides with a built-in method, rename this router or procedure on your backend.";
@@ -1,5 +0,0 @@
1
- import { createTRPCReact } from '@trpc/react-query';
2
- // The web app consumes the API as an external service and
3
- // does not have access to the tRPC Router type at build time.
4
- // Use `any` here to avoid coupling and keep the bundle lean.
5
- export const trpc = createTRPCReact();