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,188 +0,0 @@
1
- import pino from 'pino';
2
- // Check if we're running in browser context
3
- const isBrowser = typeof globalThis !== 'undefined' && 'window' in globalThis;
4
- // Simple environment detection to avoid import issues
5
- function isDevelopment() {
6
- return process.env.NODE_ENV === 'development';
7
- }
8
- // Environment detection - check both environment variable and process args for verbose mode
9
- const isVerbose = process.env.VERBOSE === 'true' ||
10
- (typeof process !== 'undefined' &&
11
- process.argv &&
12
- (process.argv.includes('--verbose') || process.argv.includes('-v')));
13
- // Optional explicit log level/format override
14
- const envLogLevel = (process.env.VIBEMAN_LOG_LEVEL || process.env.LOG_LEVEL || '').toLowerCase();
15
- const envLogStyle = (process.env.VIBEMAN_LOG_STYLE || process.env.LOG_STYLE || '').toLowerCase();
16
- const paramSplitter = process.env.VIBEMAN_LOG_SPLIT || process.env.LOG_SPLIT || ' | ';
17
- // Determine log level based on environment and verbose flag
18
- function getLogLevel() {
19
- if (envLogLevel &&
20
- ['silent', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'].includes(envLogLevel)) {
21
- return envLogLevel;
22
- }
23
- if (isVerbose)
24
- return 'debug';
25
- if (isDevelopment())
26
- return 'info';
27
- return 'error';
28
- }
29
- // Create logger configuration
30
- const loggerConfig = {
31
- level: getLogLevel(),
32
- ...(isBrowser
33
- ? {
34
- // Browser configuration - use simple console
35
- browser: { asObject: false },
36
- }
37
- : {
38
- // Node.js configuration
39
- formatters: {
40
- level: (label) => ({ level: label }),
41
- log: (object) => object,
42
- },
43
- transport: {
44
- target: 'pino-pretty',
45
- options: (() => {
46
- const base = {
47
- colorize: true,
48
- translateTime: 'HH:MM:ss',
49
- ignore: 'pid,hostname',
50
- };
51
- if (envLogStyle !== 'pretty') {
52
- base.singleLine = false;
53
- base.hideObject = false; // allow error objects to render stacks
54
- return base;
55
- }
56
- // Pretty (multi-line) with inline context, print objects nicely
57
- base.levelFirst = true;
58
- base.messageFormat = (log, messageKey) => log?.context ? `[${log.context}] ${log[messageKey]}` : log[messageKey];
59
- return base;
60
- })(),
61
- },
62
- }),
63
- };
64
- // Create the logger instance
65
- export const logger = pino(loggerConfig);
66
- // Context-aware logger factory
67
- export function createContextLogger(context) {
68
- return logger.child({ context });
69
- }
70
- // Convenience methods for common logging patterns
71
- export const log = {
72
- error: (message, error, context) => {
73
- const contextLogger = context ? createContextLogger(context) : logger;
74
- const msg = context ? `[${context}] ${message}` : message;
75
- if (error instanceof Error) {
76
- // Keep error object so stack renders, even in compact
77
- contextLogger.error({ err: error }, msg);
78
- }
79
- else if (error) {
80
- contextLogger.error({ err: error }, msg);
81
- }
82
- else {
83
- contextLogger.error(msg);
84
- }
85
- },
86
- warn: (message, data, context) => {
87
- const contextLogger = context ? createContextLogger(context) : logger;
88
- const msg = context ? `[${context}] ${message}` : message;
89
- if (data && envLogStyle !== 'pretty') {
90
- const entries = Object.entries(data);
91
- const messageEntry = entries.find(([k]) => k === 'message');
92
- const other = entries.filter(([k]) => k !== 'message');
93
- const pairs = other.map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(paramSplitter);
94
- const body = (() => {
95
- if (!messageEntry)
96
- return '';
97
- const val = messageEntry[1];
98
- if (typeof val === 'string')
99
- return `\n${val}`; // print as-is (newlines preserved)
100
- return `\n${JSON.stringify(val, null, 2)}`;
101
- })();
102
- contextLogger.warn(pairs ? `${msg} ${pairs}${body}` : `${msg}${body}`);
103
- }
104
- else if (data) {
105
- contextLogger.warn(data, msg);
106
- }
107
- else {
108
- contextLogger.warn(msg);
109
- }
110
- },
111
- info: (message, data, context) => {
112
- const contextLogger = context ? createContextLogger(context) : logger;
113
- const msg = context ? `[${context}] ${message}` : message;
114
- if (data && envLogStyle !== 'pretty') {
115
- const entries = Object.entries(data);
116
- const messageEntry = entries.find(([k]) => k === 'message');
117
- const other = entries.filter(([k]) => k !== 'message');
118
- const pairs = other.map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(paramSplitter);
119
- const body = (() => {
120
- if (!messageEntry)
121
- return '';
122
- const val = messageEntry[1];
123
- if (typeof val === 'string')
124
- return `\n${val}`;
125
- return `\n${JSON.stringify(val, null, 2)}`;
126
- })();
127
- contextLogger.info(pairs ? `${msg} ${pairs}${body}` : `${msg}${body}`);
128
- }
129
- else if (data) {
130
- contextLogger.info(data, msg);
131
- }
132
- else {
133
- contextLogger.info(msg);
134
- }
135
- },
136
- debug: (message, data, context) => {
137
- const contextLogger = context ? createContextLogger(context) : logger;
138
- const msg = context ? `[${context}] ${message}` : message;
139
- if (data && envLogStyle !== 'pretty') {
140
- const entries = Object.entries(data);
141
- const messageEntry = entries.find(([k]) => k === 'message');
142
- const other = entries.filter(([k]) => k !== 'message');
143
- const pairs = other.map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(paramSplitter);
144
- const body = (() => {
145
- if (!messageEntry)
146
- return '';
147
- const val = messageEntry[1];
148
- if (typeof val === 'string')
149
- return `\n${val}`;
150
- return `\n${JSON.stringify(val, null, 2)}`;
151
- })();
152
- contextLogger.debug(pairs ? `${msg} ${pairs}${body}` : `${msg}${body}`);
153
- }
154
- else if (data) {
155
- contextLogger.debug(data, msg);
156
- }
157
- else {
158
- contextLogger.debug(msg);
159
- }
160
- },
161
- trace: (message, data, context) => {
162
- const contextLogger = context ? createContextLogger(context) : logger;
163
- const msg = context ? `[${context}] ${message}` : message;
164
- if (data && envLogStyle !== 'pretty') {
165
- const entries = Object.entries(data);
166
- const messageEntry = entries.find(([k]) => k === 'message');
167
- const other = entries.filter(([k]) => k !== 'message');
168
- const pairs = other.map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(paramSplitter);
169
- const body = (() => {
170
- if (!messageEntry)
171
- return '';
172
- const val = messageEntry[1];
173
- if (typeof val === 'string')
174
- return `\n${val}`;
175
- return `\n${JSON.stringify(val, null, 2)}`;
176
- })();
177
- contextLogger.trace(pairs ? `${msg} ${pairs}${body}` : `${msg}${body}`);
178
- }
179
- else if (data) {
180
- contextLogger.trace(data, msg);
181
- }
182
- else {
183
- contextLogger.trace(msg);
184
- }
185
- },
186
- };
187
- // Export default logger for direct use
188
- export default logger;
@@ -1,59 +0,0 @@
1
- /**
2
- * Enhanced Provider Detection Service
3
- * Robust detection logic for AI provider CLI tools with multiple fallback strategies
4
- */
5
- export interface DetectionResult {
6
- found: boolean;
7
- path?: string;
8
- version?: string;
9
- method?: 'explicit' | 'PATH' | 'common-location';
10
- error?: string;
11
- }
12
- export interface ProviderInfo {
13
- name: string;
14
- command: string;
15
- versionArgsList?: string[][];
16
- versionRegex: RegExp;
17
- }
18
- /**
19
- * Provider definitions for detection
20
- */
21
- export declare const PROVIDER_DEFINITIONS: Record<string, ProviderInfo>;
22
- /**
23
- * Enhanced Provider Detection Service
24
- */
25
- export declare class ProviderDetectionService {
26
- private localConfig;
27
- constructor();
28
- /**
29
- * Detect a specific provider with all fallback strategies
30
- */
31
- detectProvider(providerId: string): Promise<DetectionResult>;
32
- /**
33
- * Detect all configured providers
34
- */
35
- detectAllProviders(): Promise<Record<string, DetectionResult>>;
36
- /**
37
- * Validate a specific binary path
38
- */
39
- validateBinaryPath(binPath: string, provider: ProviderInfo, method?: DetectionResult['method']): Promise<DetectionResult>;
40
- /**
41
- * Set explicit provider path and cache it
42
- */
43
- setProviderPath(providerId: string, binPath: string): Promise<DetectionResult>;
44
- /**
45
- * Clear cached provider configuration
46
- */
47
- clearProviderPath(providerId: string): Promise<void>;
48
- /**
49
- * Get cached detection results if still fresh
50
- */
51
- getCachedResult(providerId: string): Promise<DetectionResult | null>;
52
- private checkExplicitConfig;
53
- private checkSystemCommand;
54
- private getVersion;
55
- private resolveCommand;
56
- private toLocalConfigKey;
57
- private cacheDetectionResult;
58
- }
59
- export declare function getProviderDetectionService(): ProviderDetectionService;
@@ -1,244 +0,0 @@
1
- /**
2
- * Enhanced Provider Detection Service
3
- * Robust detection logic for AI provider CLI tools with multiple fallback strategies
4
- */
5
- import { exec, execFile } from 'child_process';
6
- import { promisify } from 'util';
7
- import fs from 'fs/promises';
8
- import which from 'which';
9
- import { log } from './logger.js';
10
- import { getLocalConfigService } from './local-config.js';
11
- const execAsync = promisify(exec);
12
- const execFileAsync = promisify(execFile);
13
- /**
14
- * Provider definitions for detection
15
- */
16
- export const PROVIDER_DEFINITIONS = {
17
- 'claude-code': {
18
- name: 'Claude Code',
19
- command: 'claude',
20
- versionArgsList: [['--version'], ['-v']],
21
- versionRegex: /(\d+\.\d+\.\d+)/,
22
- },
23
- codex: {
24
- name: 'Codex CLI',
25
- command: 'codex',
26
- versionArgsList: [['--version'], ['-v']],
27
- versionRegex: /(\d+\.\d+\.\d+)/,
28
- },
29
- };
30
- /**
31
- * Enhanced Provider Detection Service
32
- */
33
- export class ProviderDetectionService {
34
- constructor() {
35
- this.localConfig = getLocalConfigService();
36
- // Ensure local config is initialized
37
- this.localConfig.initialize().catch((error) => {
38
- log.error('Failed to initialize local config for provider detection', error, 'provider-detection');
39
- });
40
- }
41
- /**
42
- * Detect a specific provider with all fallback strategies
43
- */
44
- async detectProvider(providerId) {
45
- const provider = PROVIDER_DEFINITIONS[providerId];
46
- if (!provider) {
47
- return {
48
- found: false,
49
- error: `Unknown provider: ${providerId}`,
50
- };
51
- }
52
- log.debug(`Detecting provider: ${provider.name}`, { providerId }, 'provider-detection');
53
- // Strategy 1: Check explicit configuration from local config
54
- const explicitResult = await this.checkExplicitConfig(providerId, provider);
55
- if (explicitResult.found) {
56
- log.info(`Provider found via explicit config: ${provider.name}`, explicitResult, 'provider-detection');
57
- return explicitResult;
58
- }
59
- // Strategy 2: Resolve via system command lookup
60
- const systemResult = await this.checkSystemCommand(provider);
61
- if (systemResult.found) {
62
- log.info(`Provider found on system PATH: ${provider.name}`, systemResult, 'provider-detection');
63
- await this.cacheDetectionResult(providerId, systemResult);
64
- return systemResult;
65
- }
66
- // All strategies failed
67
- const result = {
68
- found: false,
69
- error: `${provider.name} not found via explicit config or system PATH`,
70
- };
71
- log.warn(`Provider not found: ${provider.name}`, result, 'provider-detection');
72
- return result;
73
- }
74
- /**
75
- * Detect all configured providers
76
- */
77
- async detectAllProviders() {
78
- const results = {};
79
- for (const providerId of Object.keys(PROVIDER_DEFINITIONS)) {
80
- try {
81
- results[providerId] = await this.detectProvider(providerId);
82
- }
83
- catch (error) {
84
- results[providerId] = {
85
- found: false,
86
- error: `Detection failed: ${error instanceof Error ? error.message : String(error)}`,
87
- };
88
- }
89
- }
90
- return results;
91
- }
92
- /**
93
- * Validate a specific binary path
94
- */
95
- async validateBinaryPath(binPath, provider, method = 'explicit') {
96
- try {
97
- // Check if file exists and is executable
98
- const stats = await fs.stat(binPath);
99
- if (!stats.isFile()) {
100
- return {
101
- found: false,
102
- error: `Path is not a file: ${binPath}`,
103
- };
104
- }
105
- // Try to execute version command
106
- const version = await this.getVersion(binPath, provider);
107
- return {
108
- found: true,
109
- path: binPath,
110
- version,
111
- method,
112
- };
113
- }
114
- catch (error) {
115
- return {
116
- found: false,
117
- path: binPath,
118
- error: `Validation failed: ${error instanceof Error ? error.message : String(error)}`,
119
- };
120
- }
121
- }
122
- /**
123
- * Set explicit provider path and cache it
124
- */
125
- async setProviderPath(providerId, binPath) {
126
- const provider = PROVIDER_DEFINITIONS[providerId];
127
- if (!provider) {
128
- return {
129
- found: false,
130
- error: `Unknown provider: ${providerId}`,
131
- };
132
- }
133
- const result = await this.validateBinaryPath(binPath, provider);
134
- if (result.found) {
135
- const localId = this.toLocalConfigKey(providerId);
136
- await this.localConfig.setProviderPath(localId, binPath, 'explicit');
137
- }
138
- return result;
139
- }
140
- /**
141
- * Clear cached provider configuration
142
- */
143
- async clearProviderPath(providerId) {
144
- const localId = this.toLocalConfigKey(providerId);
145
- await this.localConfig.clearProviderPath(localId);
146
- }
147
- /**
148
- * Get cached detection results if still fresh
149
- */
150
- async getCachedResult(providerId) {
151
- if (this.localConfig.isCachedValidationFresh(providerId)) {
152
- const cached = this.localConfig.getCachedValidationResult(providerId);
153
- if (cached) {
154
- const localId = this.toLocalConfigKey(providerId);
155
- return {
156
- found: cached.available,
157
- path: cached.available
158
- ? this.localConfig.getProviderConfig(localId)?.detectedPath
159
- : undefined,
160
- version: cached.version,
161
- error: cached.error,
162
- };
163
- }
164
- }
165
- return null;
166
- }
167
- // Private detection strategies
168
- async checkExplicitConfig(providerId, provider) {
169
- const localId = this.toLocalConfigKey(providerId);
170
- const config = this.localConfig.getProviderConfig(localId);
171
- if (!config?.binPath) {
172
- return { found: false };
173
- }
174
- return this.validateBinaryPath(config.binPath, provider, 'explicit');
175
- }
176
- async checkSystemCommand(provider) {
177
- const resolvedPath = await this.resolveCommand(provider.command);
178
- if (!resolvedPath) {
179
- return { found: false };
180
- }
181
- return this.validateBinaryPath(resolvedPath, provider, 'PATH');
182
- }
183
- async getVersion(binPath, provider) {
184
- const argSets = provider.versionArgsList ?? [['--version']];
185
- for (const args of argSets) {
186
- try {
187
- const { stdout, stderr } = await execFileAsync(binPath, args, { timeout: 10000 });
188
- const output = (stdout + stderr).trim();
189
- const match = output.match(provider.versionRegex);
190
- if (match?.[1]) {
191
- return match[1];
192
- }
193
- }
194
- catch (error) {
195
- log.debug(`Version command failed for ${binPath}`, { args, error }, 'provider-detection');
196
- }
197
- }
198
- return undefined;
199
- }
200
- async resolveCommand(command) {
201
- try {
202
- return await which(command);
203
- }
204
- catch (error) {
205
- log.debug(`which lookup failed for ${command}`, error, 'provider-detection');
206
- }
207
- if (process.platform !== 'win32') {
208
- try {
209
- const { stdout } = await execAsync(`command -v ${command}`, { timeout: 5000 });
210
- const resolved = stdout.trim().split('\n')[0];
211
- return resolved ? resolved : null;
212
- }
213
- catch (error) {
214
- log.debug(`command -v lookup failed for ${command}`, error, 'provider-detection');
215
- }
216
- }
217
- return null;
218
- }
219
- toLocalConfigKey(providerId) {
220
- return providerId === 'claude-code' ? 'claude-code' : 'codex';
221
- }
222
- async cacheDetectionResult(providerId, result) {
223
- if (result.found && result.path) {
224
- const localId = this.toLocalConfigKey(providerId);
225
- if (result.method === 'explicit') {
226
- await this.localConfig.setProviderPath(localId, result.path, 'explicit');
227
- }
228
- else {
229
- await this.localConfig.updateDetectedProvider(localId, result.path, result.method || 'PATH');
230
- }
231
- }
232
- await this.localConfig.cacheValidationResult(providerId, {
233
- available: result.found,
234
- error: result.error,
235
- version: result.version,
236
- });
237
- }
238
- }
239
- // Singleton instance
240
- let providerDetectionService = null;
241
- export function getProviderDetectionService() {
242
- providerDetectionService ?? (providerDetectionService = new ProviderDetectionService());
243
- return providerDetectionService;
244
- }
@@ -1,6 +0,0 @@
1
- import { AgentService } from '../../agent/agent-service.js';
2
- declare global {
3
- var __vibeman_agent_service__: unknown;
4
- }
5
- export declare function getAgentService(): AgentService;
6
- export declare function resetAgentService(): void;
@@ -1,27 +0,0 @@
1
- import { AgentService } from '../../agent/agent-service.js';
2
- import { getTaskService } from './task-service-singleton.js';
3
- import { getSettingsService } from '../../settings-service.js';
4
- import { getProjectRoot, getVibeDir } from './project-root.js';
5
- export function getAgentService() {
6
- if (!globalThis.__vibeman_agent_service__) {
7
- const taskService = getTaskService();
8
- const settingsVibeDir = (() => {
9
- try {
10
- const svc = getSettingsService();
11
- const s = svc.getSettings();
12
- return s?.development?.vibeDir;
13
- }
14
- catch {
15
- return undefined;
16
- }
17
- })();
18
- const projectRoot = getProjectRoot();
19
- const vibeDir = settingsVibeDir || getVibeDir();
20
- globalThis.__vibeman_agent_service__ = new AgentService(taskService, projectRoot);
21
- console.log(`🤖 Agent Service initialized (projectRoot=${projectRoot}, vibeDir=${vibeDir})`);
22
- }
23
- return globalThis.__vibeman_agent_service__;
24
- }
25
- export function resetAgentService() {
26
- globalThis.__vibeman_agent_service__ = undefined;
27
- }
@@ -1,38 +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 { getSettingsService } from '../../settings-service.js';
8
- import { TaskService } from '../../tasks/task-service.js';
9
- import { AgentService } from '../../agent/agent-service.js';
10
- import { GitService } from '../../vcs/git-service.js';
11
- import { WorktreeService } from '../../vcs/worktree-service.js';
12
- import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
13
- /**
14
- * Initialize core services in proper dependency order.
15
- * Must be called before any service getters or router creation.
16
- */
17
- export declare function bootstrap(): Promise<void>;
18
- /**
19
- * Ready-only sync getters - throw if called before bootstrap
20
- */
21
- export declare function getBootstrappedSettingsService(): ReturnType<typeof getSettingsService>;
22
- export declare function getBootstrappedTaskService(): TaskService;
23
- export declare function getBootstrappedAgentService(): AgentService;
24
- export declare function getBootstrappedGitService(): GitService;
25
- export declare function getBootstrappedWorktreeService(): WorktreeService;
26
- export declare function getBootstrappedVibingOrchestrator(): VibingOrchestrator;
27
- /**
28
- * Get bootstrap completion promise for diagnostics/tests
29
- */
30
- export declare function getBootstrapReady(): Promise<void> | null;
31
- /**
32
- * Check if bootstrap has completed
33
- */
34
- export declare function isBootstrapComplete(): boolean;
35
- /**
36
- * Test bootstrap function that initializes against a temp workspace
37
- */
38
- export declare function testBootstrap(tempWorkspace?: string): Promise<void>;