vibeman 0.0.0 → 0.0.2

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 (230) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +114 -0
  3. package/dist/runtime/api/.tsbuildinfo +1 -0
  4. package/dist/runtime/api/agent/agent-service.d.ts +224 -0
  5. package/dist/runtime/api/agent/agent-service.js +895 -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 +362 -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 +315 -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 +182 -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 +125 -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 +16 -0
  19. package/dist/runtime/api/agent/parsers.js +308 -0
  20. package/dist/runtime/api/agent/prompt-service.d.ts +30 -0
  21. package/dist/runtime/api/agent/prompt-service.js +449 -0
  22. package/dist/runtime/api/agent/prompt-service.test.d.ts +1 -0
  23. package/dist/runtime/api/agent/prompt-service.test.js +230 -0
  24. package/dist/runtime/api/agent/routing-policy.d.ts +188 -0
  25. package/dist/runtime/api/agent/routing-policy.js +246 -0
  26. package/dist/runtime/api/api/router-helpers.d.ts +32 -0
  27. package/dist/runtime/api/api/router-helpers.js +31 -0
  28. package/dist/runtime/api/api/routers/ai.d.ts +188 -0
  29. package/dist/runtime/api/api/routers/ai.js +395 -0
  30. package/dist/runtime/api/api/routers/executions.d.ts +98 -0
  31. package/dist/runtime/api/api/routers/executions.js +94 -0
  32. package/dist/runtime/api/api/routers/git.d.ts +45 -0
  33. package/dist/runtime/api/api/routers/git.js +35 -0
  34. package/dist/runtime/api/api/routers/provider-config.d.ts +165 -0
  35. package/dist/runtime/api/api/routers/provider-config.js +252 -0
  36. package/dist/runtime/api/api/routers/settings.d.ts +139 -0
  37. package/dist/runtime/api/api/routers/settings.js +113 -0
  38. package/dist/runtime/api/api/routers/tasks.d.ts +141 -0
  39. package/dist/runtime/api/api/routers/tasks.js +238 -0
  40. package/dist/runtime/api/api/routers/workflows.d.ts +267 -0
  41. package/dist/runtime/api/api/routers/workflows.js +310 -0
  42. package/dist/runtime/api/api/routers/worktrees.d.ts +101 -0
  43. package/dist/runtime/api/api/routers/worktrees.js +80 -0
  44. package/dist/runtime/api/api/trpc.d.ts +118 -0
  45. package/dist/runtime/api/api/trpc.js +34 -0
  46. package/dist/runtime/api/index.d.ts +9 -0
  47. package/dist/runtime/api/index.js +117 -0
  48. package/dist/runtime/api/lib/id-generator.d.ts +70 -0
  49. package/dist/runtime/api/lib/id-generator.js +123 -0
  50. package/dist/runtime/api/lib/image-paste-drop-extension.d.ts +26 -0
  51. package/dist/runtime/api/lib/image-paste-drop-extension.js +125 -0
  52. package/dist/runtime/api/lib/local-config.d.ts +245 -0
  53. package/dist/runtime/api/lib/local-config.js +288 -0
  54. package/dist/runtime/api/lib/logger.d.ts +11 -0
  55. package/dist/runtime/api/lib/logger.js +188 -0
  56. package/dist/runtime/api/lib/markdown-utils.d.ts +8 -0
  57. package/dist/runtime/api/lib/markdown-utils.js +282 -0
  58. package/dist/runtime/api/lib/markdown-utils.test.d.ts +1 -0
  59. package/dist/runtime/api/lib/markdown-utils.test.js +348 -0
  60. package/dist/runtime/api/lib/provider-detection.d.ts +59 -0
  61. package/dist/runtime/api/lib/provider-detection.js +244 -0
  62. package/dist/runtime/api/lib/server/agent-service-singleton.d.ts +6 -0
  63. package/dist/runtime/api/lib/server/agent-service-singleton.js +27 -0
  64. package/dist/runtime/api/lib/server/bootstrap.d.ts +38 -0
  65. package/dist/runtime/api/lib/server/bootstrap.js +197 -0
  66. package/dist/runtime/api/lib/server/git-service-singleton.d.ts +6 -0
  67. package/dist/runtime/api/lib/server/git-service-singleton.js +47 -0
  68. package/dist/runtime/api/lib/server/project-root.d.ts +2 -0
  69. package/dist/runtime/api/lib/server/project-root.js +61 -0
  70. package/dist/runtime/api/lib/server/task-service-singleton.d.ts +7 -0
  71. package/dist/runtime/api/lib/server/task-service-singleton.js +58 -0
  72. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.d.ts +7 -0
  73. package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.js +57 -0
  74. package/dist/runtime/api/lib/tiptap-utils.clamp-selection.test.d.ts +1 -0
  75. package/dist/runtime/api/lib/tiptap-utils.clamp-selection.test.js +27 -0
  76. package/dist/runtime/api/lib/tiptap-utils.d.ts +130 -0
  77. package/dist/runtime/api/lib/tiptap-utils.js +327 -0
  78. package/dist/runtime/api/lib/trpc/client.d.ts +1 -0
  79. package/dist/runtime/api/lib/trpc/client.js +5 -0
  80. package/dist/runtime/api/lib/trpc/server.d.ts +915 -0
  81. package/dist/runtime/api/lib/trpc/server.js +11 -0
  82. package/dist/runtime/api/lib/trpc/ws-server.d.ts +8 -0
  83. package/dist/runtime/api/lib/trpc/ws-server.js +33 -0
  84. package/dist/runtime/api/persistence/database-service.d.ts +14 -0
  85. package/dist/runtime/api/persistence/database-service.js +74 -0
  86. package/dist/runtime/api/persistence/execution-log-persistence.d.ts +90 -0
  87. package/dist/runtime/api/persistence/execution-log-persistence.js +410 -0
  88. package/dist/runtime/api/persistence/execution-log-persistence.test.d.ts +1 -0
  89. package/dist/runtime/api/persistence/execution-log-persistence.test.js +170 -0
  90. package/dist/runtime/api/router.d.ts +918 -0
  91. package/dist/runtime/api/router.js +34 -0
  92. package/dist/runtime/api/settings-service.d.ts +110 -0
  93. package/dist/runtime/api/settings-service.js +613 -0
  94. package/dist/runtime/api/tasks/file-watcher.d.ts +23 -0
  95. package/dist/runtime/api/tasks/file-watcher.js +88 -0
  96. package/dist/runtime/api/tasks/task-file-parser.d.ts +13 -0
  97. package/dist/runtime/api/tasks/task-file-parser.js +161 -0
  98. package/dist/runtime/api/tasks/task-service.d.ts +36 -0
  99. package/dist/runtime/api/tasks/task-service.js +173 -0
  100. package/dist/runtime/api/types/index.d.ts +179 -0
  101. package/dist/runtime/api/types/index.js +1 -0
  102. package/dist/runtime/api/types/settings.d.ts +81 -0
  103. package/dist/runtime/api/types/settings.js +2 -0
  104. package/dist/runtime/api/types.d.ts +2 -0
  105. package/dist/runtime/api/types.js +1 -0
  106. package/dist/runtime/api/utils/env.d.ts +6 -0
  107. package/dist/runtime/api/utils/env.js +12 -0
  108. package/dist/runtime/api/utils/stripNextEnv.d.ts +7 -0
  109. package/dist/runtime/api/utils/stripNextEnv.js +22 -0
  110. package/dist/runtime/api/utils/title-slug.d.ts +6 -0
  111. package/dist/runtime/api/utils/title-slug.js +77 -0
  112. package/dist/runtime/api/utils/url.d.ts +2 -0
  113. package/dist/runtime/api/utils/url.js +19 -0
  114. package/dist/runtime/api/vcs/git-history-service.d.ts +57 -0
  115. package/dist/runtime/api/vcs/git-history-service.js +228 -0
  116. package/dist/runtime/api/vcs/git-service.d.ts +127 -0
  117. package/dist/runtime/api/vcs/git-service.js +284 -0
  118. package/dist/runtime/api/vcs/worktree-service.d.ts +93 -0
  119. package/dist/runtime/api/vcs/worktree-service.js +506 -0
  120. package/dist/runtime/api/vcs/worktree-service.test.d.ts +1 -0
  121. package/dist/runtime/api/vcs/worktree-service.test.js +20 -0
  122. package/dist/runtime/api/workflows/quality-pipeline.d.ts +58 -0
  123. package/dist/runtime/api/workflows/quality-pipeline.js +400 -0
  124. package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +318 -0
  125. package/dist/runtime/api/workflows/vibing-orchestrator.js +1860 -0
  126. package/dist/runtime/web/.next/BUILD_ID +1 -0
  127. package/dist/runtime/web/.next/app-build-manifest.json +59 -0
  128. package/dist/runtime/web/.next/app-path-routes-manifest.json +7 -0
  129. package/dist/runtime/web/.next/build-manifest.json +33 -0
  130. package/dist/runtime/web/.next/package.json +1 -0
  131. package/dist/runtime/web/.next/prerender-manifest.json +61 -0
  132. package/dist/runtime/web/.next/react-loadable-manifest.json +39 -0
  133. package/dist/runtime/web/.next/required-server-files.json +334 -0
  134. package/dist/runtime/web/.next/routes-manifest.json +62 -0
  135. package/dist/runtime/web/.next/server/app/_not-found/page.js +2 -0
  136. package/dist/runtime/web/.next/server/app/_not-found/page.js.nft.json +1 -0
  137. package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  138. package/dist/runtime/web/.next/server/app/_not-found.html +7 -0
  139. package/dist/runtime/web/.next/server/app/_not-found.meta +8 -0
  140. package/dist/runtime/web/.next/server/app/_not-found.rsc +22 -0
  141. package/dist/runtime/web/.next/server/app/api/health/route.js +1 -0
  142. package/dist/runtime/web/.next/server/app/api/health/route.js.nft.json +1 -0
  143. package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -0
  144. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +1 -0
  145. package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js.nft.json +1 -0
  146. package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +1 -0
  147. package/dist/runtime/web/.next/server/app/api/upload/route.js +1 -0
  148. package/dist/runtime/web/.next/server/app/api/upload/route.js.nft.json +1 -0
  149. package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +1 -0
  150. package/dist/runtime/web/.next/server/app/index.html +7 -0
  151. package/dist/runtime/web/.next/server/app/index.meta +7 -0
  152. package/dist/runtime/web/.next/server/app/index.rsc +27 -0
  153. package/dist/runtime/web/.next/server/app/page.js +147 -0
  154. package/dist/runtime/web/.next/server/app/page.js.nft.json +1 -0
  155. package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +1 -0
  156. package/dist/runtime/web/.next/server/app-paths-manifest.json +7 -0
  157. package/dist/runtime/web/.next/server/chunks/217.js +1 -0
  158. package/dist/runtime/web/.next/server/chunks/383.js +6 -0
  159. package/dist/runtime/web/.next/server/chunks/458.js +1 -0
  160. package/dist/runtime/web/.next/server/chunks/576.js +18 -0
  161. package/dist/runtime/web/.next/server/chunks/635.js +22 -0
  162. package/dist/runtime/web/.next/server/chunks/761.js +1 -0
  163. package/dist/runtime/web/.next/server/chunks/777.js +3 -0
  164. package/dist/runtime/web/.next/server/chunks/825.js +1 -0
  165. package/dist/runtime/web/.next/server/chunks/838.js +1 -0
  166. package/dist/runtime/web/.next/server/chunks/973.js +15 -0
  167. package/dist/runtime/web/.next/server/functions-config-manifest.json +4 -0
  168. package/dist/runtime/web/.next/server/middleware-build-manifest.js +1 -0
  169. package/dist/runtime/web/.next/server/middleware-manifest.json +6 -0
  170. package/dist/runtime/web/.next/server/middleware-react-loadable-manifest.js +1 -0
  171. package/dist/runtime/web/.next/server/next-font-manifest.js +1 -0
  172. package/dist/runtime/web/.next/server/next-font-manifest.json +1 -0
  173. package/dist/runtime/web/.next/server/pages/404.html +7 -0
  174. package/dist/runtime/web/.next/server/pages/500.html +1 -0
  175. package/dist/runtime/web/.next/server/pages/_app.js +1 -0
  176. package/dist/runtime/web/.next/server/pages/_app.js.nft.json +1 -0
  177. package/dist/runtime/web/.next/server/pages/_document.js +1 -0
  178. package/dist/runtime/web/.next/server/pages/_document.js.nft.json +1 -0
  179. package/dist/runtime/web/.next/server/pages/_error.js +19 -0
  180. package/dist/runtime/web/.next/server/pages/_error.js.nft.json +1 -0
  181. package/dist/runtime/web/.next/server/pages-manifest.json +6 -0
  182. package/dist/runtime/web/.next/server/server-reference-manifest.js +1 -0
  183. package/dist/runtime/web/.next/server/server-reference-manifest.json +1 -0
  184. package/dist/runtime/web/.next/server/webpack-runtime.js +1 -0
  185. package/dist/runtime/web/.next/static/chunks/18-15c10d3288afef2e.js +1 -0
  186. package/dist/runtime/web/.next/static/chunks/1c0ca389.537bbe362e3ffbd9.js +3 -0
  187. package/dist/runtime/web/.next/static/chunks/22747d63-ad5da0c19f4cfe41.js +71 -0
  188. package/dist/runtime/web/.next/static/chunks/277-0142a939f08738c3.js +63 -0
  189. package/dist/runtime/web/.next/static/chunks/355.056c2645878a799a.js +1 -0
  190. package/dist/runtime/web/.next/static/chunks/420.a5ccf151c9e2b2f1.js +1 -0
  191. package/dist/runtime/web/.next/static/chunks/439.1be0c6242fd248d5.js +15 -0
  192. package/dist/runtime/web/.next/static/chunks/440.c52e7c0f797e22b2.js +1 -0
  193. package/dist/runtime/web/.next/static/chunks/575-e2478287c27da87b.js +1 -0
  194. package/dist/runtime/web/.next/static/chunks/691.920d88c115087314.js +1 -0
  195. package/dist/runtime/web/.next/static/chunks/765-e838910065b50c3d.js +1 -0
  196. package/dist/runtime/web/.next/static/chunks/87c73c54-09e1ba5c70e60a51.js +1 -0
  197. package/dist/runtime/web/.next/static/chunks/891cff7f.0f71fc028f87e683.js +1 -0
  198. package/dist/runtime/web/.next/static/chunks/8bb4d8db-3e2aa02b0a2384b9.js +1 -0
  199. package/dist/runtime/web/.next/static/chunks/9af238c7-271a911d4e99ab18.js +1 -0
  200. package/dist/runtime/web/.next/static/chunks/app/_not-found/page-1cb74d1cba27d0ab.js +1 -0
  201. package/dist/runtime/web/.next/static/chunks/app/api/health/route-105a61ae865ba536.js +1 -0
  202. package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-105a61ae865ba536.js +1 -0
  203. package/dist/runtime/web/.next/static/chunks/app/api/upload/route-105a61ae865ba536.js +1 -0
  204. package/dist/runtime/web/.next/static/chunks/app/layout-8435322f09fd0975.js +1 -0
  205. package/dist/runtime/web/.next/static/chunks/app/page-8c3ba579efc6f918.js +1 -0
  206. package/dist/runtime/web/.next/static/chunks/cac567b0-5b77dd12911823cd.js +1 -0
  207. package/dist/runtime/web/.next/static/chunks/framework-2518f1345b5b2806.js +1 -0
  208. package/dist/runtime/web/.next/static/chunks/main-17665e5e39de9a8a.js +1 -0
  209. package/dist/runtime/web/.next/static/chunks/main-app-c0b0f5ba4f7f9d75.js +1 -0
  210. package/dist/runtime/web/.next/static/chunks/pages/_app-d6f6b3bbc3d81ee1.js +1 -0
  211. package/dist/runtime/web/.next/static/chunks/pages/_error-75a96cf1997cc3b9.js +1 -0
  212. package/dist/runtime/web/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  213. package/dist/runtime/web/.next/static/chunks/webpack-c8de37305b4635cf.js +1 -0
  214. package/dist/runtime/web/.next/static/css/08c950681f1a9a92.css +1 -0
  215. package/dist/runtime/web/.next/static/css/2728291c68f99cb1.css +3 -0
  216. package/dist/runtime/web/.next/static/css/521bd69cc298cd1a.css +1 -0
  217. package/dist/runtime/web/.next/static/css/537e22821e101b87.css +1 -0
  218. package/dist/runtime/web/.next/static/mRpNgPfbYR_0wrODzlg_4/_buildManifest.js +1 -0
  219. package/dist/runtime/web/.next/static/mRpNgPfbYR_0wrODzlg_4/_ssgManifest.js +1 -0
  220. package/dist/runtime/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  221. package/dist/runtime/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  222. package/dist/runtime/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  223. package/dist/runtime/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  224. package/dist/runtime/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  225. package/dist/runtime/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  226. package/dist/runtime/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  227. package/dist/runtime/web/package.json +65 -0
  228. package/dist/runtime/web/server.js +44 -0
  229. package/dist/tsconfig.tsbuildinfo +1 -0
  230. package/package.json +84 -7
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Provider Configuration Router
3
+ * Handles provider detection and local configuration management
4
+ */
5
+ /**
6
+ * Provider Configuration Router
7
+ */
8
+ export declare function buildProviderConfigRoutes(): {
9
+ /**
10
+ * Detect all providers with current status
11
+ */
12
+ detectAllProviders: import("@trpc/server").TRPCQueryProcedure<{
13
+ input: void;
14
+ output: Record<string, import("../../lib/provider-detection.js").DetectionResult>;
15
+ meta: object;
16
+ }>;
17
+ /**
18
+ * Detect specific provider
19
+ */
20
+ detectProvider: import("@trpc/server").TRPCQueryProcedure<{
21
+ input: {
22
+ provider: string;
23
+ };
24
+ output: import("../../lib/provider-detection.js").DetectionResult;
25
+ meta: object;
26
+ }>;
27
+ /**
28
+ * Set explicit provider path
29
+ */
30
+ setProviderPath: import("@trpc/server").TRPCMutationProcedure<{
31
+ input: {
32
+ path: string;
33
+ provider: string;
34
+ };
35
+ output: {
36
+ success: boolean;
37
+ result: import("../../lib/provider-detection.js").DetectionResult;
38
+ };
39
+ meta: object;
40
+ }>;
41
+ /**
42
+ * Clear provider path (reset to auto-detection)
43
+ */
44
+ clearProviderPath: import("@trpc/server").TRPCMutationProcedure<{
45
+ input: {
46
+ provider: string;
47
+ };
48
+ output: {
49
+ success: boolean;
50
+ };
51
+ meta: object;
52
+ }>;
53
+ /**
54
+ * Get local configuration info
55
+ */
56
+ getLocalConfigInfo: import("@trpc/server").TRPCQueryProcedure<{
57
+ input: void;
58
+ output: {
59
+ providers: {
60
+ 'claude-code'?: {
61
+ binPath?: string | undefined;
62
+ detectedPath?: string | undefined;
63
+ lastDetected?: string | undefined;
64
+ detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
65
+ } | undefined;
66
+ codex?: {
67
+ binPath?: string | undefined;
68
+ detectedPath?: string | undefined;
69
+ lastDetected?: string | undefined;
70
+ detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
71
+ } | undefined;
72
+ };
73
+ path: string;
74
+ exists: boolean;
75
+ size?: number;
76
+ };
77
+ meta: object;
78
+ }>;
79
+ /**
80
+ * Clear validation cache (force re-detection)
81
+ */
82
+ clearValidationCache: import("@trpc/server").TRPCMutationProcedure<{
83
+ input: void;
84
+ output: {
85
+ success: boolean;
86
+ };
87
+ meta: object;
88
+ }>;
89
+ /**
90
+ * Get provider detection diagnostics
91
+ */
92
+ getProviderDiagnostics: import("@trpc/server").TRPCQueryProcedure<{
93
+ input: void;
94
+ output: {
95
+ localConfigPath: string;
96
+ localConfigExists: boolean;
97
+ providers: {
98
+ provider: string;
99
+ detection: import("../../lib/provider-detection.js").DetectionResult;
100
+ localConfig: {
101
+ binPath?: string | undefined;
102
+ detectedPath?: string | undefined;
103
+ lastDetected?: string | undefined;
104
+ detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
105
+ } | {
106
+ binPath?: string | undefined;
107
+ detectedPath?: string | undefined;
108
+ lastDetected?: string | undefined;
109
+ detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
110
+ } | undefined;
111
+ cached: {
112
+ available: boolean;
113
+ error: string | undefined;
114
+ version: string | undefined;
115
+ checkedAt: string;
116
+ isFresh: boolean;
117
+ } | null;
118
+ }[];
119
+ };
120
+ meta: object;
121
+ }>;
122
+ };
123
+ /**
124
+ * Test-friendly plain handlers
125
+ */
126
+ export declare function buildProviderConfigRouteHandlers(): {
127
+ readonly detectAllProviders: () => Promise<Record<string, import("../../lib/provider-detection.js").DetectionResult>>;
128
+ readonly detectProvider: (input: {
129
+ provider: string;
130
+ }) => Promise<import("../../lib/provider-detection.js").DetectionResult>;
131
+ readonly setProviderPath: (input: {
132
+ provider: string;
133
+ path: string;
134
+ }) => Promise<{
135
+ success: true;
136
+ result: import("../../lib/provider-detection.js").DetectionResult;
137
+ }>;
138
+ readonly clearProviderPath: (input: {
139
+ provider: string;
140
+ }) => Promise<{
141
+ success: true;
142
+ }>;
143
+ readonly getLocalConfigInfo: () => Promise<{
144
+ providers: {
145
+ 'claude-code'?: {
146
+ binPath?: string | undefined;
147
+ detectedPath?: string | undefined;
148
+ lastDetected?: string | undefined;
149
+ detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
150
+ } | undefined;
151
+ codex?: {
152
+ binPath?: string | undefined;
153
+ detectedPath?: string | undefined;
154
+ lastDetected?: string | undefined;
155
+ detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
156
+ } | undefined;
157
+ };
158
+ path: string;
159
+ exists: boolean;
160
+ size?: number;
161
+ }>;
162
+ readonly clearValidationCache: () => Promise<{
163
+ success: true;
164
+ }>;
165
+ };
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Provider Configuration Router
3
+ * Handles provider detection and local configuration management
4
+ */
5
+ import { z } from 'zod';
6
+ import { publicProcedure } from '../trpc.js';
7
+ import { getProviderDetectionService } from '../../lib/provider-detection.js';
8
+ import { getLocalConfigService } from '../../lib/local-config.js';
9
+ import { log } from '../../lib/logger.js';
10
+ /**
11
+ * Input schemas for API endpoints
12
+ */
13
+ const DetectProviderInputSchema = z.object({
14
+ provider: z.string(),
15
+ });
16
+ const SetProviderPathInputSchema = z.object({
17
+ provider: z.string(),
18
+ path: z.string().trim().min(1, 'Path is required'),
19
+ });
20
+ const ClearProviderPathInputSchema = z.object({
21
+ provider: z.string(),
22
+ });
23
+ /**
24
+ * Provider Configuration Router
25
+ */
26
+ export function buildProviderConfigRoutes() {
27
+ return {
28
+ /**
29
+ * Detect all providers with current status
30
+ */
31
+ detectAllProviders: publicProcedure.query(async () => {
32
+ try {
33
+ const detectionService = getProviderDetectionService();
34
+ const results = await detectionService.detectAllProviders();
35
+ log.debug('Detected all providers', { results }, 'provider-config');
36
+ return results;
37
+ }
38
+ catch (error) {
39
+ const msg = `Failed to detect providers: ${error instanceof Error ? error.message : String(error)}`;
40
+ log.error(msg, error, 'provider-config');
41
+ throw new Error(msg);
42
+ }
43
+ }),
44
+ /**
45
+ * Detect specific provider
46
+ */
47
+ detectProvider: publicProcedure.input(DetectProviderInputSchema).query(async ({ input }) => {
48
+ try {
49
+ const detectionService = getProviderDetectionService();
50
+ const result = await detectionService.detectProvider(input.provider);
51
+ log.debug('Detected provider', { provider: input.provider, result }, 'provider-config');
52
+ return result;
53
+ }
54
+ catch (error) {
55
+ const msg = `Failed to detect provider ${input.provider}: ${error instanceof Error ? error.message : String(error)}`;
56
+ log.error(msg, error, 'provider-config');
57
+ throw new Error(msg);
58
+ }
59
+ }),
60
+ /**
61
+ * Set explicit provider path
62
+ */
63
+ setProviderPath: publicProcedure
64
+ .input(SetProviderPathInputSchema)
65
+ .mutation(async ({ input }) => {
66
+ try {
67
+ const detectionService = getProviderDetectionService();
68
+ const result = await detectionService.setProviderPath(input.provider, input.path);
69
+ if (!result.found) {
70
+ throw new Error(result.error || 'Invalid provider path');
71
+ }
72
+ log.info('Set provider path', { provider: input.provider, path: input.path }, 'provider-config');
73
+ return { success: true, result };
74
+ }
75
+ catch (error) {
76
+ const msg = `Failed to set provider path: ${error instanceof Error ? error.message : String(error)}`;
77
+ log.error(msg, error, 'provider-config');
78
+ throw new Error(msg);
79
+ }
80
+ }),
81
+ /**
82
+ * Clear provider path (reset to auto-detection)
83
+ */
84
+ clearProviderPath: publicProcedure
85
+ .input(ClearProviderPathInputSchema)
86
+ .mutation(async ({ input }) => {
87
+ try {
88
+ const detectionService = getProviderDetectionService();
89
+ await detectionService.clearProviderPath(input.provider);
90
+ log.info('Cleared provider path', { provider: input.provider }, 'provider-config');
91
+ return { success: true };
92
+ }
93
+ catch (error) {
94
+ const msg = `Failed to clear provider path: ${error instanceof Error ? error.message : String(error)}`;
95
+ log.error(msg, error, 'provider-config');
96
+ throw new Error(msg);
97
+ }
98
+ }),
99
+ /**
100
+ * Get local configuration info
101
+ */
102
+ getLocalConfigInfo: publicProcedure.query(async () => {
103
+ try {
104
+ const localConfig = getLocalConfigService();
105
+ await localConfig.initialize();
106
+ const info = await localConfig.getConfigInfo();
107
+ const config = localConfig.getConfig();
108
+ return {
109
+ ...info,
110
+ providers: config.providers || {},
111
+ };
112
+ }
113
+ catch (error) {
114
+ const msg = `Failed to get local config info: ${error instanceof Error ? error.message : String(error)}`;
115
+ log.error(msg, error, 'provider-config');
116
+ throw new Error(msg);
117
+ }
118
+ }),
119
+ /**
120
+ * Clear validation cache (force re-detection)
121
+ */
122
+ clearValidationCache: publicProcedure.mutation(async () => {
123
+ try {
124
+ const localConfig = getLocalConfigService();
125
+ await localConfig.initialize();
126
+ await localConfig.clearValidationCache();
127
+ log.info('Cleared validation cache', undefined, 'provider-config');
128
+ return { success: true };
129
+ }
130
+ catch (error) {
131
+ const msg = `Failed to clear validation cache: ${error instanceof Error ? error.message : String(error)}`;
132
+ log.error(msg, error, 'provider-config');
133
+ throw new Error(msg);
134
+ }
135
+ }),
136
+ /**
137
+ * Get provider detection diagnostics
138
+ */
139
+ getProviderDiagnostics: publicProcedure.query(async () => {
140
+ try {
141
+ const detectionService = getProviderDetectionService();
142
+ const localConfig = getLocalConfigService();
143
+ await localConfig.initialize();
144
+ const detectionResults = await detectionService.detectAllProviders();
145
+ const localConfigInfo = await localConfig.getConfigInfo();
146
+ const providerConfigs = localConfig.getConfig().providers || {};
147
+ const diagnostics = Object.entries(detectionResults).map(([provider, result]) => {
148
+ const config = providerConfigs[provider];
149
+ const cached = localConfig.getCachedValidationResult(provider);
150
+ return {
151
+ provider,
152
+ detection: result,
153
+ localConfig: config,
154
+ cached: cached
155
+ ? {
156
+ available: cached.available,
157
+ error: cached.error,
158
+ version: cached.version,
159
+ checkedAt: cached.checkedAt,
160
+ isFresh: localConfig.isCachedValidationFresh(provider),
161
+ }
162
+ : null,
163
+ };
164
+ });
165
+ return {
166
+ localConfigPath: localConfigInfo.path,
167
+ localConfigExists: localConfigInfo.exists,
168
+ providers: diagnostics,
169
+ };
170
+ }
171
+ catch (error) {
172
+ const msg = `Failed to get provider diagnostics: ${error instanceof Error ? error.message : String(error)}`;
173
+ log.error(msg, error, 'provider-config');
174
+ throw new Error(msg);
175
+ }
176
+ }),
177
+ };
178
+ }
179
+ /**
180
+ * Test-friendly plain handlers
181
+ */
182
+ export function buildProviderConfigRouteHandlers() {
183
+ return {
184
+ async detectAllProviders() {
185
+ try {
186
+ const detectionService = getProviderDetectionService();
187
+ return await detectionService.detectAllProviders();
188
+ }
189
+ catch (error) {
190
+ throw new Error(`Failed to detect providers: ${error instanceof Error ? error.message : String(error)}`);
191
+ }
192
+ },
193
+ async detectProvider(input) {
194
+ try {
195
+ const detectionService = getProviderDetectionService();
196
+ return await detectionService.detectProvider(input.provider);
197
+ }
198
+ catch (error) {
199
+ throw new Error(`Failed to detect provider ${input.provider}: ${error instanceof Error ? error.message : String(error)}`);
200
+ }
201
+ },
202
+ async setProviderPath(input) {
203
+ try {
204
+ const detectionService = getProviderDetectionService();
205
+ const result = await detectionService.setProviderPath(input.provider, input.path);
206
+ if (!result.found) {
207
+ throw new Error(result.error || 'Invalid provider path');
208
+ }
209
+ return { success: true, result };
210
+ }
211
+ catch (error) {
212
+ throw new Error(`Failed to set provider path: ${error instanceof Error ? error.message : String(error)}`);
213
+ }
214
+ },
215
+ async clearProviderPath(input) {
216
+ try {
217
+ const detectionService = getProviderDetectionService();
218
+ await detectionService.clearProviderPath(input.provider);
219
+ return { success: true };
220
+ }
221
+ catch (error) {
222
+ throw new Error(`Failed to clear provider path: ${error instanceof Error ? error.message : String(error)}`);
223
+ }
224
+ },
225
+ async getLocalConfigInfo() {
226
+ try {
227
+ const localConfig = getLocalConfigService();
228
+ await localConfig.initialize();
229
+ const info = await localConfig.getConfigInfo();
230
+ const config = localConfig.getConfig();
231
+ return {
232
+ ...info,
233
+ providers: config.providers || {},
234
+ };
235
+ }
236
+ catch (error) {
237
+ throw new Error(`Failed to get local config info: ${error instanceof Error ? error.message : String(error)}`);
238
+ }
239
+ },
240
+ async clearValidationCache() {
241
+ try {
242
+ const localConfig = getLocalConfigService();
243
+ await localConfig.initialize();
244
+ await localConfig.clearValidationCache();
245
+ return { success: true };
246
+ }
247
+ catch (error) {
248
+ throw new Error(`Failed to clear validation cache: ${error instanceof Error ? error.message : String(error)}`);
249
+ }
250
+ },
251
+ };
252
+ }
@@ -0,0 +1,139 @@
1
+ /**
2
+ * tRPC routes for settings management
3
+ */
4
+ export declare function buildSettingsRoutes(): {
5
+ /**
6
+ * Get current settings
7
+ */
8
+ getSettings: import("@trpc/server").TRPCQueryProcedure<{
9
+ input: void;
10
+ output: import("../../types/settings.js").VibemanSettings;
11
+ meta: object;
12
+ }>;
13
+ /**
14
+ * Detect quality checks using AI and persist them into settings
15
+ */
16
+ detectQualityChecks: import("@trpc/server").TRPCMutationProcedure<{
17
+ input: void;
18
+ output: {
19
+ checks: {
20
+ name: string;
21
+ command: string;
22
+ args: string[];
23
+ timeout: number;
24
+ enabled: boolean;
25
+ }[];
26
+ workingDirectory: string;
27
+ };
28
+ meta: object;
29
+ }>;
30
+ /**
31
+ * Get a specific setting by path
32
+ */
33
+ getSetting: import("@trpc/server").TRPCQueryProcedure<{
34
+ input: {
35
+ path: string[];
36
+ };
37
+ output: unknown;
38
+ meta: object;
39
+ }>;
40
+ /**
41
+ * Update multiple settings
42
+ */
43
+ updateSettings: import("@trpc/server").TRPCMutationProcedure<{
44
+ input: {
45
+ path: string[];
46
+ value?: unknown;
47
+ }[];
48
+ output: {
49
+ success: boolean;
50
+ errors: import("../../types/settings.js").SettingsValidationError[];
51
+ };
52
+ meta: object;
53
+ }>;
54
+ /**
55
+ * Reset settings to defaults
56
+ */
57
+ resetToDefaults: import("@trpc/server").TRPCMutationProcedure<{
58
+ input: void;
59
+ output: import("../../types/settings.js").VibemanSettings;
60
+ meta: object;
61
+ }>;
62
+ /**
63
+ * Validate settings schema
64
+ */
65
+ validateSettings: import("@trpc/server").TRPCQueryProcedure<{
66
+ input: Record<string, unknown>;
67
+ output: {
68
+ valid: boolean;
69
+ errors: import("../../types/settings.js").SettingsValidationError[];
70
+ };
71
+ meta: object;
72
+ }>;
73
+ /**
74
+ * Get settings file information
75
+ */
76
+ getSettingsInfo: import("@trpc/server").TRPCQueryProcedure<{
77
+ input: void;
78
+ output: {
79
+ path: string;
80
+ exists: boolean;
81
+ };
82
+ meta: object;
83
+ }>;
84
+ /**
85
+ * Get available editor presets
86
+ */
87
+ getEditorPresets: import("@trpc/server").TRPCQueryProcedure<{
88
+ input: void;
89
+ output: Record<string, Partial<{
90
+ type?: "vscode" | "cursor" | "vim" | "custom";
91
+ command?: string;
92
+ args?: string[];
93
+ name?: string;
94
+ openFileCommand?: string[];
95
+ openFolderCommand?: string[];
96
+ } | undefined>>;
97
+ meta: object;
98
+ }>;
99
+ /**
100
+ * Get available terminal presets
101
+ */
102
+ getTerminalPresets: import("@trpc/server").TRPCQueryProcedure<{
103
+ input: void;
104
+ output: Record<string, Partial<{
105
+ type?: "system" | "iterm2" | "warp" | "custom";
106
+ command?: string;
107
+ args?: string[];
108
+ name?: string;
109
+ openCommand?: string[];
110
+ } | undefined>>;
111
+ meta: object;
112
+ }>;
113
+ /**
114
+ * Apply editor preset configuration
115
+ */
116
+ applyEditorPreset: import("@trpc/server").TRPCMutationProcedure<{
117
+ input: {
118
+ presetName: string;
119
+ };
120
+ output: {
121
+ success: boolean;
122
+ errors: import("../../types/settings.js").SettingsValidationError[];
123
+ };
124
+ meta: object;
125
+ }>;
126
+ /**
127
+ * Apply terminal preset configuration
128
+ */
129
+ applyTerminalPreset: import("@trpc/server").TRPCMutationProcedure<{
130
+ input: {
131
+ presetName: string;
132
+ };
133
+ output: {
134
+ success: boolean;
135
+ errors: import("../../types/settings.js").SettingsValidationError[];
136
+ };
137
+ meta: object;
138
+ }>;
139
+ };
@@ -0,0 +1,113 @@
1
+ /**
2
+ * tRPC routes for settings management
3
+ */
4
+ import { z } from 'zod';
5
+ import { publicProcedure } from '../trpc.js';
6
+ import { getSettingsService } from '../../settings-service.js';
7
+ import { QualityPipeline } from '../../workflows/quality-pipeline.js';
8
+ import { getProjectRoot } from '../../lib/server/project-root.js';
9
+ // Input validation schemas
10
+ const UpdateSettingsInputSchema = z.array(z.object({
11
+ path: z.array(z.string().min(1)),
12
+ value: z.unknown(),
13
+ }));
14
+ export function buildSettingsRoutes() {
15
+ const settingsService = getSettingsService();
16
+ // Initialize settings service on first router build
17
+ settingsService.initialize().catch(console.error);
18
+ return {
19
+ /**
20
+ * Get current settings
21
+ */
22
+ getSettings: publicProcedure.query(async () => {
23
+ await settingsService.initialize();
24
+ return settingsService.getSettings();
25
+ }),
26
+ /**
27
+ * Detect quality checks using AI and persist them into settings
28
+ */
29
+ detectQualityChecks: publicProcedure.mutation(async () => {
30
+ // TODO: Integrate this into the onboarding flow to auto-bootstrap
31
+ // quality checks on first project setup.
32
+ await settingsService.initialize();
33
+ const pipeline = new QualityPipeline();
34
+ const workingDirectory = getProjectRoot();
35
+ const checks = await pipeline.detectAndPersistChecks(workingDirectory);
36
+ return { checks, workingDirectory };
37
+ }),
38
+ /**
39
+ * Get a specific setting by path
40
+ */
41
+ getSetting: publicProcedure
42
+ .input(z.object({ path: z.array(z.string().min(1)) }))
43
+ .query(async ({ input }) => {
44
+ await settingsService.initialize();
45
+ return settingsService.getSetting(input.path);
46
+ }),
47
+ /**
48
+ * Update multiple settings
49
+ */
50
+ updateSettings: publicProcedure.input(UpdateSettingsInputSchema).mutation(async ({ input }) => {
51
+ await settingsService.initialize();
52
+ const updates = input.map((item) => ({
53
+ path: item.path,
54
+ value: item.value,
55
+ }));
56
+ return await settingsService.updateSettings(updates);
57
+ }),
58
+ /**
59
+ * Reset settings to defaults
60
+ */
61
+ resetToDefaults: publicProcedure.mutation(async () => {
62
+ await settingsService.initialize();
63
+ await settingsService.resetToDefaults();
64
+ return settingsService.getSettings();
65
+ }),
66
+ /**
67
+ * Validate settings schema
68
+ */
69
+ validateSettings: publicProcedure.input(z.record(z.unknown())).query(async ({ input }) => {
70
+ await settingsService.initialize();
71
+ return settingsService.validateSettings(input);
72
+ }),
73
+ /**
74
+ * Get settings file information
75
+ */
76
+ getSettingsInfo: publicProcedure.query(async () => {
77
+ await settingsService.initialize();
78
+ return settingsService.getSettingsInfo();
79
+ }),
80
+ /**
81
+ * Get available editor presets
82
+ */
83
+ getEditorPresets: publicProcedure.query(async () => {
84
+ await settingsService.initialize();
85
+ return settingsService.getEditorPresets();
86
+ }),
87
+ /**
88
+ * Get available terminal presets
89
+ */
90
+ getTerminalPresets: publicProcedure.query(async () => {
91
+ await settingsService.initialize();
92
+ return settingsService.getTerminalPresets();
93
+ }),
94
+ /**
95
+ * Apply editor preset configuration
96
+ */
97
+ applyEditorPreset: publicProcedure
98
+ .input(z.object({ presetName: z.string().min(1) }))
99
+ .mutation(async ({ input }) => {
100
+ await settingsService.initialize();
101
+ return await settingsService.applyEditorPreset(input.presetName);
102
+ }),
103
+ /**
104
+ * Apply terminal preset configuration
105
+ */
106
+ applyTerminalPreset: publicProcedure
107
+ .input(z.object({ presetName: z.string().min(1) }))
108
+ .mutation(async ({ input }) => {
109
+ await settingsService.initialize();
110
+ return await settingsService.applyTerminalPreset(input.presetName);
111
+ }),
112
+ };
113
+ }