vibeman 0.0.5 → 0.0.7
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.
- package/dist/api.js +43 -0
- package/dist/index.js +227 -104
- package/dist/ui/assets/index-C_kQPI1m.js +9 -0
- package/dist/ui/index.html +12 -0
- package/package.json +13 -46
- package/README.md +0 -12
- package/dist/runtime/api/.tsbuildinfo +0 -1
- package/dist/runtime/api/agent/agent-service.d.ts +0 -229
- package/dist/runtime/api/agent/agent-service.js +0 -963
- package/dist/runtime/api/agent/ai-providers/amp-cli-provider.d.ts +0 -38
- package/dist/runtime/api/agent/ai-providers/amp-cli-provider.js +0 -268
- package/dist/runtime/api/agent/ai-providers/claude-code-adapter.d.ts +0 -61
- package/dist/runtime/api/agent/ai-providers/claude-code-adapter.js +0 -362
- package/dist/runtime/api/agent/ai-providers/codex-cli-provider.d.ts +0 -36
- package/dist/runtime/api/agent/ai-providers/codex-cli-provider.js +0 -375
- package/dist/runtime/api/agent/ai-providers/gemini-cli-provider.d.ts +0 -24
- package/dist/runtime/api/agent/ai-providers/gemini-cli-provider.js +0 -291
- package/dist/runtime/api/agent/ai-providers/index.d.ts +0 -9
- package/dist/runtime/api/agent/ai-providers/index.js +0 -9
- package/dist/runtime/api/agent/ai-providers/types.d.ts +0 -185
- package/dist/runtime/api/agent/ai-providers/types.js +0 -5
- package/dist/runtime/api/agent/amp-cli-provider.test.d.ts +0 -1
- package/dist/runtime/api/agent/amp-cli-provider.test.js +0 -99
- package/dist/runtime/api/agent/codex-cli-provider.test.d.ts +0 -1
- package/dist/runtime/api/agent/codex-cli-provider.test.js +0 -172
- package/dist/runtime/api/agent/core-agent-service.d.ts +0 -119
- package/dist/runtime/api/agent/core-agent-service.js +0 -267
- package/dist/runtime/api/agent/parsers.d.ts +0 -16
- package/dist/runtime/api/agent/parsers.js +0 -308
- package/dist/runtime/api/agent/prompt-service.d.ts +0 -30
- package/dist/runtime/api/agent/prompt-service.js +0 -452
- package/dist/runtime/api/agent/prompt-service.test.d.ts +0 -1
- package/dist/runtime/api/agent/prompt-service.test.js +0 -265
- package/dist/runtime/api/agent/routing-policy.d.ts +0 -171
- package/dist/runtime/api/agent/routing-policy.js +0 -196
- package/dist/runtime/api/agent/routing-policy.test.d.ts +0 -1
- package/dist/runtime/api/agent/routing-policy.test.js +0 -63
- package/dist/runtime/api/api/router-helpers.d.ts +0 -32
- package/dist/runtime/api/api/router-helpers.js +0 -31
- package/dist/runtime/api/api/routers/ai.d.ts +0 -200
- package/dist/runtime/api/api/routers/ai.js +0 -396
- package/dist/runtime/api/api/routers/executions.d.ts +0 -93
- package/dist/runtime/api/api/routers/executions.js +0 -94
- package/dist/runtime/api/api/routers/git.d.ts +0 -45
- package/dist/runtime/api/api/routers/git.js +0 -35
- package/dist/runtime/api/api/routers/provider-config.d.ts +0 -199
- package/dist/runtime/api/api/routers/provider-config.js +0 -252
- package/dist/runtime/api/api/routers/settings.d.ts +0 -158
- package/dist/runtime/api/api/routers/settings.js +0 -129
- package/dist/runtime/api/api/routers/tasks.d.ts +0 -141
- package/dist/runtime/api/api/routers/tasks.js +0 -238
- package/dist/runtime/api/api/routers/workflows.d.ts +0 -275
- package/dist/runtime/api/api/routers/workflows.js +0 -311
- package/dist/runtime/api/api/routers/worktrees.d.ts +0 -101
- package/dist/runtime/api/api/routers/worktrees.js +0 -80
- package/dist/runtime/api/api/trpc.d.ts +0 -118
- package/dist/runtime/api/api/trpc.js +0 -34
- package/dist/runtime/api/index.d.ts +0 -9
- package/dist/runtime/api/index.js +0 -117
- package/dist/runtime/api/lib/id-generator.d.ts +0 -70
- package/dist/runtime/api/lib/id-generator.js +0 -123
- package/dist/runtime/api/lib/local-config.d.ts +0 -335
- package/dist/runtime/api/lib/local-config.js +0 -304
- package/dist/runtime/api/lib/logger.d.ts +0 -11
- package/dist/runtime/api/lib/logger.js +0 -188
- package/dist/runtime/api/lib/provider-detection.d.ts +0 -61
- package/dist/runtime/api/lib/provider-detection.js +0 -326
- package/dist/runtime/api/lib/server/agent-service-singleton.d.ts +0 -6
- package/dist/runtime/api/lib/server/agent-service-singleton.js +0 -27
- package/dist/runtime/api/lib/server/bootstrap.d.ts +0 -38
- package/dist/runtime/api/lib/server/bootstrap.js +0 -197
- package/dist/runtime/api/lib/server/git-service-singleton.d.ts +0 -6
- package/dist/runtime/api/lib/server/git-service-singleton.js +0 -47
- package/dist/runtime/api/lib/server/project-root.d.ts +0 -2
- package/dist/runtime/api/lib/server/project-root.js +0 -61
- package/dist/runtime/api/lib/server/task-service-singleton.d.ts +0 -7
- package/dist/runtime/api/lib/server/task-service-singleton.js +0 -58
- package/dist/runtime/api/lib/server/vibeman-info.d.ts +0 -5
- package/dist/runtime/api/lib/server/vibeman-info.js +0 -85
- package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.d.ts +0 -7
- package/dist/runtime/api/lib/server/vibing-orchestrator-singleton.js +0 -57
- package/dist/runtime/api/lib/trpc/server.d.ts +0 -965
- package/dist/runtime/api/lib/trpc/server.js +0 -11
- package/dist/runtime/api/lib/trpc/ws-server.d.ts +0 -8
- package/dist/runtime/api/lib/trpc/ws-server.js +0 -33
- package/dist/runtime/api/persistence/database-service.d.ts +0 -14
- package/dist/runtime/api/persistence/database-service.js +0 -74
- package/dist/runtime/api/persistence/execution-log-persistence.d.ts +0 -90
- package/dist/runtime/api/persistence/execution-log-persistence.js +0 -426
- package/dist/runtime/api/persistence/execution-log-persistence.test.d.ts +0 -1
- package/dist/runtime/api/persistence/execution-log-persistence.test.js +0 -170
- package/dist/runtime/api/router.d.ts +0 -968
- package/dist/runtime/api/router.js +0 -34
- package/dist/runtime/api/settings-service.d.ts +0 -110
- package/dist/runtime/api/settings-service.js +0 -678
- package/dist/runtime/api/tasks/file-watcher.d.ts +0 -23
- package/dist/runtime/api/tasks/file-watcher.js +0 -88
- package/dist/runtime/api/tasks/task-file-parser.d.ts +0 -14
- package/dist/runtime/api/tasks/task-file-parser.js +0 -180
- package/dist/runtime/api/tasks/task-service.d.ts +0 -36
- package/dist/runtime/api/tasks/task-service.js +0 -173
- package/dist/runtime/api/tasks/task-updater.d.ts +0 -62
- package/dist/runtime/api/tasks/task-updater.js +0 -260
- package/dist/runtime/api/tasks/task-updater.test.d.ts +0 -1
- package/dist/runtime/api/tasks/task-updater.test.js +0 -303
- package/dist/runtime/api/types/index.d.ts +0 -186
- package/dist/runtime/api/types/index.js +0 -1
- package/dist/runtime/api/types/settings.d.ts +0 -105
- package/dist/runtime/api/types/settings.js +0 -2
- package/dist/runtime/api/types.d.ts +0 -2
- package/dist/runtime/api/types.js +0 -1
- package/dist/runtime/api/utils/env.d.ts +0 -6
- package/dist/runtime/api/utils/env.js +0 -12
- package/dist/runtime/api/utils/stripNextEnv.d.ts +0 -7
- package/dist/runtime/api/utils/stripNextEnv.js +0 -22
- package/dist/runtime/api/utils/title-slug.d.ts +0 -6
- package/dist/runtime/api/utils/title-slug.js +0 -77
- package/dist/runtime/api/utils/url.d.ts +0 -2
- package/dist/runtime/api/utils/url.js +0 -19
- package/dist/runtime/api/vcs/git-history-service.d.ts +0 -57
- package/dist/runtime/api/vcs/git-history-service.js +0 -228
- package/dist/runtime/api/vcs/git-service.d.ts +0 -136
- package/dist/runtime/api/vcs/git-service.js +0 -307
- package/dist/runtime/api/vcs/worktree-service.d.ts +0 -93
- package/dist/runtime/api/vcs/worktree-service.js +0 -518
- package/dist/runtime/api/vcs/worktree-service.test.d.ts +0 -1
- package/dist/runtime/api/vcs/worktree-service.test.js +0 -20
- package/dist/runtime/api/workflows/quality-pipeline.d.ts +0 -58
- package/dist/runtime/api/workflows/quality-pipeline.js +0 -401
- package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +0 -406
- package/dist/runtime/api/workflows/vibing-orchestrator.js +0 -2462
- package/dist/runtime/api/workflows/workflow-effects.d.ts +0 -45
- package/dist/runtime/api/workflows/workflow-effects.js +0 -49
- package/dist/runtime/api/workflows/workflow-reconciler.d.ts +0 -65
- package/dist/runtime/api/workflows/workflow-reconciler.js +0 -226
- package/dist/runtime/api/workflows/workflow-reducer.d.ts +0 -26
- package/dist/runtime/api/workflows/workflow-reducer.js +0 -288
- package/dist/runtime/api/workflows/workflow-reducer.test.d.ts +0 -1
- package/dist/runtime/api/workflows/workflow-reducer.test.js +0 -247
- package/dist/runtime/api/workflows/workflow-schema.d.ts +0 -546
- package/dist/runtime/api/workflows/workflow-schema.js +0 -256
- package/dist/runtime/web/.next/BUILD_ID +0 -1
- package/dist/runtime/web/.next/app-build-manifest.json +0 -66
- package/dist/runtime/web/.next/app-path-routes-manifest.json +0 -8
- package/dist/runtime/web/.next/build-manifest.json +0 -33
- package/dist/runtime/web/.next/package.json +0 -1
- package/dist/runtime/web/.next/prerender-manifest.json +0 -61
- package/dist/runtime/web/.next/react-loadable-manifest.json +0 -8
- package/dist/runtime/web/.next/required-server-files.json +0 -334
- package/dist/runtime/web/.next/routes-manifest.json +0 -70
- package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js +0 -1
- package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route_client-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/app/_not-found/page.js +0 -2
- package/dist/runtime/web/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/app/_not-found.html +0 -7
- package/dist/runtime/web/.next/server/app/_not-found.meta +0 -8
- package/dist/runtime/web/.next/server/app/_not-found.rsc +0 -22
- package/dist/runtime/web/.next/server/app/api/health/route.js +0 -1
- package/dist/runtime/web/.next/server/app/api/health/route.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +0 -1
- package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/app/api/upload/route.js +0 -1
- package/dist/runtime/web/.next/server/app/api/upload/route.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/app/index.html +0 -7
- package/dist/runtime/web/.next/server/app/index.meta +0 -7
- package/dist/runtime/web/.next/server/app/index.rsc +0 -27
- package/dist/runtime/web/.next/server/app/page.js +0 -112
- package/dist/runtime/web/.next/server/app/page.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/app-paths-manifest.json +0 -8
- package/dist/runtime/web/.next/server/chunks/210.js +0 -1
- package/dist/runtime/web/.next/server/chunks/291.js +0 -18
- package/dist/runtime/web/.next/server/chunks/552.js +0 -22
- package/dist/runtime/web/.next/server/chunks/780.js +0 -1
- package/dist/runtime/web/.next/server/chunks/905.js +0 -6
- package/dist/runtime/web/.next/server/chunks/98.js +0 -1
- package/dist/runtime/web/.next/server/functions-config-manifest.json +0 -4
- package/dist/runtime/web/.next/server/middleware-build-manifest.js +0 -1
- package/dist/runtime/web/.next/server/middleware-manifest.json +0 -6
- package/dist/runtime/web/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/dist/runtime/web/.next/server/next-font-manifest.js +0 -1
- package/dist/runtime/web/.next/server/next-font-manifest.json +0 -1
- package/dist/runtime/web/.next/server/pages/404.html +0 -7
- package/dist/runtime/web/.next/server/pages/500.html +0 -1
- package/dist/runtime/web/.next/server/pages/_app.js +0 -1
- package/dist/runtime/web/.next/server/pages/_app.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/pages/_document.js +0 -1
- package/dist/runtime/web/.next/server/pages/_document.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/pages/_error.js +0 -19
- package/dist/runtime/web/.next/server/pages/_error.js.nft.json +0 -1
- package/dist/runtime/web/.next/server/pages-manifest.json +0 -6
- package/dist/runtime/web/.next/server/server-reference-manifest.js +0 -1
- package/dist/runtime/web/.next/server/server-reference-manifest.json +0 -1
- package/dist/runtime/web/.next/server/webpack-runtime.js +0 -1
- package/dist/runtime/web/.next/static/LJFZk_8tvKFN_Ee4HqUuM/_buildManifest.js +0 -1
- package/dist/runtime/web/.next/static/LJFZk_8tvKFN_Ee4HqUuM/_ssgManifest.js +0 -1
- package/dist/runtime/web/.next/static/chunks/05c91ade-7d09b2b280adffd1.js +0 -1
- package/dist/runtime/web/.next/static/chunks/201-51bef3fa8c832e2e.js +0 -1
- package/dist/runtime/web/.next/static/chunks/524-89747ed9b0294f8a.js +0 -1
- package/dist/runtime/web/.next/static/chunks/554-8bec6e9cca6acc67.js +0 -1
- package/dist/runtime/web/.next/static/chunks/764.86e9503a69d45a85.js +0 -1
- package/dist/runtime/web/.next/static/chunks/7ab4dc20-239138e0ae7af24a.js +0 -1
- package/dist/runtime/web/.next/static/chunks/905-342391e3d3a3678f.js +0 -20
- package/dist/runtime/web/.next/static/chunks/a8a5ce16-4edea7df2d9b544a.js +0 -79
- package/dist/runtime/web/.next/static/chunks/ad74d572-4c1b162e2c15acaa.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/.vibeman/assets/images/[...path]/route-7b752a8641f96c1f.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/_not-found/page-34e66b251c2b5044.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/api/health/route-7b752a8641f96c1f.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-7b752a8641f96c1f.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/api/upload/route-7b752a8641f96c1f.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/layout-df9ac93cb02b2385.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/page-6610743f7de5f92a.js +0 -1
- package/dist/runtime/web/.next/static/chunks/c25e0690-e9b798b8de667da1.js +0 -1
- package/dist/runtime/web/.next/static/chunks/framework-57157ec4d37f64aa.js +0 -1
- package/dist/runtime/web/.next/static/chunks/main-app-156cc0c60371bd78.js +0 -1
- package/dist/runtime/web/.next/static/chunks/main-df25d367c47b1fec.js +0 -1
- package/dist/runtime/web/.next/static/chunks/pages/_app-9f629a5e1131d19f.js +0 -1
- package/dist/runtime/web/.next/static/chunks/pages/_error-9238238274c7efcd.js +0 -1
- package/dist/runtime/web/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/dist/runtime/web/.next/static/chunks/webpack-cd50e39b423d1808.js +0 -1
- package/dist/runtime/web/.next/static/css/2728291c68f99cb1.css +0 -3
- package/dist/runtime/web/.next/static/css/4fbf378a264bd4ea.css +0 -1
- package/dist/runtime/web/.next/static/css/521bd69cc298cd1a.css +0 -1
- package/dist/runtime/web/.next/static/css/537e22821e101b87.css +0 -1
- package/dist/runtime/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/dist/runtime/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/dist/runtime/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/dist/runtime/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/dist/runtime/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/dist/runtime/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/dist/runtime/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/dist/runtime/web/package.json +0 -65
- package/dist/runtime/web/server.js +0 -44
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local Configuration Manager
|
|
3
|
-
* Handles machine-specific configuration that should not be committed to git
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from 'events';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
declare const LocalConfigSchema: z.ZodObject<{
|
|
8
|
-
providers: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
'claude-code': z.ZodOptional<z.ZodObject<{
|
|
10
|
-
binPath: z.ZodOptional<z.ZodString>;
|
|
11
|
-
detectedPath: z.ZodOptional<z.ZodString>;
|
|
12
|
-
lastDetected: z.ZodOptional<z.ZodString>;
|
|
13
|
-
detectionMethod: z.ZodOptional<z.ZodEnum<["explicit", "PATH", "common-location"]>>;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
binPath?: string | undefined;
|
|
16
|
-
detectedPath?: string | undefined;
|
|
17
|
-
lastDetected?: string | undefined;
|
|
18
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
binPath?: string | undefined;
|
|
21
|
-
detectedPath?: string | undefined;
|
|
22
|
-
lastDetected?: string | undefined;
|
|
23
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
24
|
-
}>>;
|
|
25
|
-
codex: z.ZodOptional<z.ZodObject<{
|
|
26
|
-
binPath: z.ZodOptional<z.ZodString>;
|
|
27
|
-
detectedPath: z.ZodOptional<z.ZodString>;
|
|
28
|
-
lastDetected: z.ZodOptional<z.ZodString>;
|
|
29
|
-
detectionMethod: z.ZodOptional<z.ZodEnum<["explicit", "PATH", "common-location"]>>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
binPath?: string | undefined;
|
|
32
|
-
detectedPath?: string | undefined;
|
|
33
|
-
lastDetected?: string | undefined;
|
|
34
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
35
|
-
}, {
|
|
36
|
-
binPath?: string | undefined;
|
|
37
|
-
detectedPath?: string | undefined;
|
|
38
|
-
lastDetected?: string | undefined;
|
|
39
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
40
|
-
}>>;
|
|
41
|
-
gemini: z.ZodOptional<z.ZodObject<{
|
|
42
|
-
binPath: z.ZodOptional<z.ZodString>;
|
|
43
|
-
detectedPath: z.ZodOptional<z.ZodString>;
|
|
44
|
-
lastDetected: z.ZodOptional<z.ZodString>;
|
|
45
|
-
detectionMethod: z.ZodOptional<z.ZodEnum<["explicit", "PATH", "common-location"]>>;
|
|
46
|
-
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
binPath?: string | undefined;
|
|
48
|
-
detectedPath?: string | undefined;
|
|
49
|
-
lastDetected?: string | undefined;
|
|
50
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
51
|
-
}, {
|
|
52
|
-
binPath?: string | undefined;
|
|
53
|
-
detectedPath?: string | undefined;
|
|
54
|
-
lastDetected?: string | undefined;
|
|
55
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
56
|
-
}>>;
|
|
57
|
-
amp: z.ZodOptional<z.ZodObject<{
|
|
58
|
-
binPath: z.ZodOptional<z.ZodString>;
|
|
59
|
-
detectedPath: z.ZodOptional<z.ZodString>;
|
|
60
|
-
lastDetected: z.ZodOptional<z.ZodString>;
|
|
61
|
-
detectionMethod: z.ZodOptional<z.ZodEnum<["explicit", "PATH", "common-location"]>>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
binPath?: string | undefined;
|
|
64
|
-
detectedPath?: string | undefined;
|
|
65
|
-
lastDetected?: string | undefined;
|
|
66
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
binPath?: string | undefined;
|
|
69
|
-
detectedPath?: string | undefined;
|
|
70
|
-
lastDetected?: string | undefined;
|
|
71
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
72
|
-
}>>;
|
|
73
|
-
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
'claude-code'?: {
|
|
75
|
-
binPath?: string | undefined;
|
|
76
|
-
detectedPath?: string | undefined;
|
|
77
|
-
lastDetected?: string | undefined;
|
|
78
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
79
|
-
} | undefined;
|
|
80
|
-
codex?: {
|
|
81
|
-
binPath?: string | undefined;
|
|
82
|
-
detectedPath?: string | undefined;
|
|
83
|
-
lastDetected?: string | undefined;
|
|
84
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
85
|
-
} | undefined;
|
|
86
|
-
gemini?: {
|
|
87
|
-
binPath?: string | undefined;
|
|
88
|
-
detectedPath?: string | undefined;
|
|
89
|
-
lastDetected?: string | undefined;
|
|
90
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
91
|
-
} | undefined;
|
|
92
|
-
amp?: {
|
|
93
|
-
binPath?: string | undefined;
|
|
94
|
-
detectedPath?: string | undefined;
|
|
95
|
-
lastDetected?: string | undefined;
|
|
96
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
97
|
-
} | undefined;
|
|
98
|
-
}, {
|
|
99
|
-
'claude-code'?: {
|
|
100
|
-
binPath?: string | undefined;
|
|
101
|
-
detectedPath?: string | undefined;
|
|
102
|
-
lastDetected?: string | undefined;
|
|
103
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
codex?: {
|
|
106
|
-
binPath?: string | undefined;
|
|
107
|
-
detectedPath?: string | undefined;
|
|
108
|
-
lastDetected?: string | undefined;
|
|
109
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
110
|
-
} | undefined;
|
|
111
|
-
gemini?: {
|
|
112
|
-
binPath?: string | undefined;
|
|
113
|
-
detectedPath?: string | undefined;
|
|
114
|
-
lastDetected?: string | undefined;
|
|
115
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
116
|
-
} | undefined;
|
|
117
|
-
amp?: {
|
|
118
|
-
binPath?: string | undefined;
|
|
119
|
-
detectedPath?: string | undefined;
|
|
120
|
-
lastDetected?: string | undefined;
|
|
121
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
122
|
-
} | undefined;
|
|
123
|
-
}>>;
|
|
124
|
-
cache: z.ZodOptional<z.ZodObject<{
|
|
125
|
-
lastProviderValidation: z.ZodOptional<z.ZodString>;
|
|
126
|
-
validationResults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
127
|
-
available: z.ZodBoolean;
|
|
128
|
-
error: z.ZodOptional<z.ZodString>;
|
|
129
|
-
version: z.ZodOptional<z.ZodString>;
|
|
130
|
-
checkedAt: z.ZodString;
|
|
131
|
-
}, "strip", z.ZodTypeAny, {
|
|
132
|
-
available: boolean;
|
|
133
|
-
checkedAt: string;
|
|
134
|
-
error?: string | undefined;
|
|
135
|
-
version?: string | undefined;
|
|
136
|
-
}, {
|
|
137
|
-
available: boolean;
|
|
138
|
-
checkedAt: string;
|
|
139
|
-
error?: string | undefined;
|
|
140
|
-
version?: string | undefined;
|
|
141
|
-
}>>>;
|
|
142
|
-
}, "strip", z.ZodTypeAny, {
|
|
143
|
-
lastProviderValidation?: string | undefined;
|
|
144
|
-
validationResults?: Record<string, {
|
|
145
|
-
available: boolean;
|
|
146
|
-
checkedAt: string;
|
|
147
|
-
error?: string | undefined;
|
|
148
|
-
version?: string | undefined;
|
|
149
|
-
}> | undefined;
|
|
150
|
-
}, {
|
|
151
|
-
lastProviderValidation?: string | undefined;
|
|
152
|
-
validationResults?: Record<string, {
|
|
153
|
-
available: boolean;
|
|
154
|
-
checkedAt: string;
|
|
155
|
-
error?: string | undefined;
|
|
156
|
-
version?: string | undefined;
|
|
157
|
-
}> | undefined;
|
|
158
|
-
}>>;
|
|
159
|
-
}, "strip", z.ZodTypeAny, {
|
|
160
|
-
providers?: {
|
|
161
|
-
'claude-code'?: {
|
|
162
|
-
binPath?: string | undefined;
|
|
163
|
-
detectedPath?: string | undefined;
|
|
164
|
-
lastDetected?: string | undefined;
|
|
165
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
166
|
-
} | undefined;
|
|
167
|
-
codex?: {
|
|
168
|
-
binPath?: string | undefined;
|
|
169
|
-
detectedPath?: string | undefined;
|
|
170
|
-
lastDetected?: string | undefined;
|
|
171
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
172
|
-
} | undefined;
|
|
173
|
-
gemini?: {
|
|
174
|
-
binPath?: string | undefined;
|
|
175
|
-
detectedPath?: string | undefined;
|
|
176
|
-
lastDetected?: string | undefined;
|
|
177
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
178
|
-
} | undefined;
|
|
179
|
-
amp?: {
|
|
180
|
-
binPath?: string | undefined;
|
|
181
|
-
detectedPath?: string | undefined;
|
|
182
|
-
lastDetected?: string | undefined;
|
|
183
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
184
|
-
} | undefined;
|
|
185
|
-
} | undefined;
|
|
186
|
-
cache?: {
|
|
187
|
-
lastProviderValidation?: string | undefined;
|
|
188
|
-
validationResults?: Record<string, {
|
|
189
|
-
available: boolean;
|
|
190
|
-
checkedAt: string;
|
|
191
|
-
error?: string | undefined;
|
|
192
|
-
version?: string | undefined;
|
|
193
|
-
}> | undefined;
|
|
194
|
-
} | undefined;
|
|
195
|
-
}, {
|
|
196
|
-
providers?: {
|
|
197
|
-
'claude-code'?: {
|
|
198
|
-
binPath?: string | undefined;
|
|
199
|
-
detectedPath?: string | undefined;
|
|
200
|
-
lastDetected?: string | undefined;
|
|
201
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
202
|
-
} | undefined;
|
|
203
|
-
codex?: {
|
|
204
|
-
binPath?: string | undefined;
|
|
205
|
-
detectedPath?: string | undefined;
|
|
206
|
-
lastDetected?: string | undefined;
|
|
207
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
208
|
-
} | undefined;
|
|
209
|
-
gemini?: {
|
|
210
|
-
binPath?: string | undefined;
|
|
211
|
-
detectedPath?: string | undefined;
|
|
212
|
-
lastDetected?: string | undefined;
|
|
213
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
214
|
-
} | undefined;
|
|
215
|
-
amp?: {
|
|
216
|
-
binPath?: string | undefined;
|
|
217
|
-
detectedPath?: string | undefined;
|
|
218
|
-
lastDetected?: string | undefined;
|
|
219
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
220
|
-
} | undefined;
|
|
221
|
-
} | undefined;
|
|
222
|
-
cache?: {
|
|
223
|
-
lastProviderValidation?: string | undefined;
|
|
224
|
-
validationResults?: Record<string, {
|
|
225
|
-
available: boolean;
|
|
226
|
-
checkedAt: string;
|
|
227
|
-
error?: string | undefined;
|
|
228
|
-
version?: string | undefined;
|
|
229
|
-
}> | undefined;
|
|
230
|
-
} | undefined;
|
|
231
|
-
}>;
|
|
232
|
-
export type LocalConfig = z.infer<typeof LocalConfigSchema>;
|
|
233
|
-
export interface LocalConfigServiceConfig {
|
|
234
|
-
configDir?: string;
|
|
235
|
-
configFileName?: string;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Local Configuration Service
|
|
239
|
-
* Manages machine-specific configuration stored in local-only directory
|
|
240
|
-
*/
|
|
241
|
-
export declare class LocalConfigService extends EventEmitter {
|
|
242
|
-
private config;
|
|
243
|
-
private configPath;
|
|
244
|
-
private initialized;
|
|
245
|
-
constructor(options?: LocalConfigServiceConfig);
|
|
246
|
-
/**
|
|
247
|
-
* Initialize the local config service
|
|
248
|
-
*/
|
|
249
|
-
initialize(): Promise<void>;
|
|
250
|
-
/**
|
|
251
|
-
* Get the full local configuration
|
|
252
|
-
*/
|
|
253
|
-
getConfig(): LocalConfig;
|
|
254
|
-
/**
|
|
255
|
-
* Get provider-specific configuration
|
|
256
|
-
*/
|
|
257
|
-
getProviderConfig(provider: 'claude-code' | 'codex' | 'gemini' | 'amp'): {
|
|
258
|
-
binPath?: string | undefined;
|
|
259
|
-
detectedPath?: string | undefined;
|
|
260
|
-
lastDetected?: string | undefined;
|
|
261
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
262
|
-
} | {
|
|
263
|
-
binPath?: string | undefined;
|
|
264
|
-
detectedPath?: string | undefined;
|
|
265
|
-
lastDetected?: string | undefined;
|
|
266
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
267
|
-
} | {
|
|
268
|
-
binPath?: string | undefined;
|
|
269
|
-
detectedPath?: string | undefined;
|
|
270
|
-
lastDetected?: string | undefined;
|
|
271
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
272
|
-
} | {
|
|
273
|
-
binPath?: string | undefined;
|
|
274
|
-
detectedPath?: string | undefined;
|
|
275
|
-
lastDetected?: string | undefined;
|
|
276
|
-
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
277
|
-
} | undefined;
|
|
278
|
-
/**
|
|
279
|
-
* Set provider binary path and detection info
|
|
280
|
-
*/
|
|
281
|
-
setProviderPath(provider: 'claude-code' | 'codex' | 'gemini' | 'amp', binPath: string, detectionMethod?: 'explicit' | 'PATH' | 'common-location'): Promise<void>;
|
|
282
|
-
updateDetectedProvider(provider: 'claude-code' | 'codex' | 'gemini' | 'amp', detectedPath: string, detectionMethod?: 'PATH' | 'common-location'): Promise<void>;
|
|
283
|
-
/**
|
|
284
|
-
* Clear provider configuration
|
|
285
|
-
*/
|
|
286
|
-
clearProviderPath(provider: 'claude-code' | 'codex' | 'gemini' | 'amp'): Promise<void>;
|
|
287
|
-
/**
|
|
288
|
-
* Cache provider validation results
|
|
289
|
-
*/
|
|
290
|
-
cacheValidationResult(provider: string, result: {
|
|
291
|
-
available: boolean;
|
|
292
|
-
error?: string;
|
|
293
|
-
version?: string;
|
|
294
|
-
}): Promise<void>;
|
|
295
|
-
/**
|
|
296
|
-
* Get cached validation result
|
|
297
|
-
*/
|
|
298
|
-
getCachedValidationResult(provider: string): {
|
|
299
|
-
available: boolean;
|
|
300
|
-
error?: string;
|
|
301
|
-
version?: string;
|
|
302
|
-
checkedAt: string;
|
|
303
|
-
} | undefined;
|
|
304
|
-
/**
|
|
305
|
-
* Check if cached validation is still fresh (within last 5 minutes)
|
|
306
|
-
*/
|
|
307
|
-
isCachedValidationFresh(provider: string): boolean;
|
|
308
|
-
/**
|
|
309
|
-
* Clear all cached validation results
|
|
310
|
-
*/
|
|
311
|
-
clearValidationCache(): Promise<void>;
|
|
312
|
-
/**
|
|
313
|
-
* Get configuration file information
|
|
314
|
-
*/
|
|
315
|
-
getConfigInfo(): Promise<{
|
|
316
|
-
path: string;
|
|
317
|
-
exists: boolean;
|
|
318
|
-
size?: number;
|
|
319
|
-
}>;
|
|
320
|
-
/**
|
|
321
|
-
* Export configuration for debugging/backup
|
|
322
|
-
*/
|
|
323
|
-
exportConfig(): Promise<string>;
|
|
324
|
-
/**
|
|
325
|
-
* Import configuration from JSON string
|
|
326
|
-
*/
|
|
327
|
-
importConfig(configJson: string): Promise<void>;
|
|
328
|
-
private ensureConfigDirectory;
|
|
329
|
-
private loadConfig;
|
|
330
|
-
private saveConfig;
|
|
331
|
-
private fileExists;
|
|
332
|
-
private mergeWithDefaults;
|
|
333
|
-
}
|
|
334
|
-
export declare function getLocalConfigService(config?: LocalConfigServiceConfig): LocalConfigService;
|
|
335
|
-
export {};
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local Configuration Manager
|
|
3
|
-
* Handles machine-specific configuration that should not be committed to git
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from 'events';
|
|
6
|
-
import fs from 'fs/promises';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { log } from './logger.js';
|
|
10
|
-
import { getProjectRoot } from './server/project-root.js';
|
|
11
|
-
// Schema for local configuration
|
|
12
|
-
const LocalConfigSchema = z.object({
|
|
13
|
-
providers: z
|
|
14
|
-
.object({
|
|
15
|
-
'claude-code': z
|
|
16
|
-
.object({
|
|
17
|
-
binPath: z.string().optional(),
|
|
18
|
-
detectedPath: z.string().optional(),
|
|
19
|
-
lastDetected: z.string().optional(), // ISO date
|
|
20
|
-
detectionMethod: z.enum(['explicit', 'PATH', 'common-location']).optional(),
|
|
21
|
-
})
|
|
22
|
-
.optional(),
|
|
23
|
-
codex: z
|
|
24
|
-
.object({
|
|
25
|
-
binPath: z.string().optional(),
|
|
26
|
-
detectedPath: z.string().optional(),
|
|
27
|
-
lastDetected: z.string().optional(),
|
|
28
|
-
detectionMethod: z.enum(['explicit', 'PATH', 'common-location']).optional(),
|
|
29
|
-
})
|
|
30
|
-
.optional(),
|
|
31
|
-
gemini: z
|
|
32
|
-
.object({
|
|
33
|
-
binPath: z.string().optional(),
|
|
34
|
-
detectedPath: z.string().optional(),
|
|
35
|
-
lastDetected: z.string().optional(), // ISO date
|
|
36
|
-
detectionMethod: z.enum(['explicit', 'PATH', 'common-location']).optional(),
|
|
37
|
-
})
|
|
38
|
-
.optional(),
|
|
39
|
-
amp: z
|
|
40
|
-
.object({
|
|
41
|
-
binPath: z.string().optional(),
|
|
42
|
-
detectedPath: z.string().optional(),
|
|
43
|
-
lastDetected: z.string().optional(), // ISO date
|
|
44
|
-
detectionMethod: z.enum(['explicit', 'PATH', 'common-location']).optional(),
|
|
45
|
-
})
|
|
46
|
-
.optional(),
|
|
47
|
-
})
|
|
48
|
-
.optional(),
|
|
49
|
-
cache: z
|
|
50
|
-
.object({
|
|
51
|
-
lastProviderValidation: z.string().optional(), // ISO date
|
|
52
|
-
validationResults: z
|
|
53
|
-
.record(z.object({
|
|
54
|
-
available: z.boolean(),
|
|
55
|
-
error: z.string().optional(),
|
|
56
|
-
version: z.string().optional(),
|
|
57
|
-
checkedAt: z.string(), // ISO date
|
|
58
|
-
}))
|
|
59
|
-
.optional(),
|
|
60
|
-
})
|
|
61
|
-
.optional(),
|
|
62
|
-
});
|
|
63
|
-
// Default local configuration
|
|
64
|
-
const DEFAULT_LOCAL_CONFIG = {
|
|
65
|
-
providers: {},
|
|
66
|
-
cache: {},
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Local Configuration Service
|
|
70
|
-
* Manages machine-specific configuration stored in local-only directory
|
|
71
|
-
*/
|
|
72
|
-
export class LocalConfigService extends EventEmitter {
|
|
73
|
-
constructor(options = {}) {
|
|
74
|
-
super();
|
|
75
|
-
this.config = { ...DEFAULT_LOCAL_CONFIG };
|
|
76
|
-
this.initialized = false;
|
|
77
|
-
const configDir = options.configDir ?? '.vibeman/.local';
|
|
78
|
-
const configFileName = options.configFileName ?? 'local-config.json';
|
|
79
|
-
// Store in project-local directory that should be gitignored
|
|
80
|
-
const projectRoot = getProjectRoot();
|
|
81
|
-
this.configPath = path.join(projectRoot, configDir, configFileName);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Initialize the local config service
|
|
85
|
-
*/
|
|
86
|
-
async initialize() {
|
|
87
|
-
if (this.initialized)
|
|
88
|
-
return;
|
|
89
|
-
try {
|
|
90
|
-
await this.ensureConfigDirectory();
|
|
91
|
-
await this.loadConfig();
|
|
92
|
-
this.initialized = true;
|
|
93
|
-
log.info('Local config service initialized', { configPath: this.configPath }, 'local-config');
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
log.error('Failed to initialize local config service', error, 'local-config');
|
|
97
|
-
throw error;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Get the full local configuration
|
|
102
|
-
*/
|
|
103
|
-
getConfig() {
|
|
104
|
-
return { ...this.config };
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Get provider-specific configuration
|
|
108
|
-
*/
|
|
109
|
-
getProviderConfig(provider) {
|
|
110
|
-
return this.config.providers?.[provider];
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Set provider binary path and detection info
|
|
114
|
-
*/
|
|
115
|
-
async setProviderPath(provider, binPath, detectionMethod = 'explicit') {
|
|
116
|
-
if (!this.config.providers) {
|
|
117
|
-
this.config.providers = {};
|
|
118
|
-
}
|
|
119
|
-
if (!this.config.providers[provider]) {
|
|
120
|
-
this.config.providers[provider] = {};
|
|
121
|
-
}
|
|
122
|
-
this.config.providers[provider].binPath = binPath;
|
|
123
|
-
this.config.providers[provider].detectedPath = binPath;
|
|
124
|
-
this.config.providers[provider].lastDetected = new Date().toISOString();
|
|
125
|
-
this.config.providers[provider].detectionMethod = detectionMethod;
|
|
126
|
-
await this.saveConfig();
|
|
127
|
-
this.emit('providerPathChanged', { provider, binPath, detectionMethod });
|
|
128
|
-
}
|
|
129
|
-
async updateDetectedProvider(provider, detectedPath, detectionMethod = 'PATH') {
|
|
130
|
-
if (!this.config.providers) {
|
|
131
|
-
this.config.providers = {};
|
|
132
|
-
}
|
|
133
|
-
if (!this.config.providers[provider]) {
|
|
134
|
-
this.config.providers[provider] = {};
|
|
135
|
-
}
|
|
136
|
-
this.config.providers[provider].detectedPath = detectedPath;
|
|
137
|
-
this.config.providers[provider].lastDetected = new Date().toISOString();
|
|
138
|
-
this.config.providers[provider].detectionMethod = detectionMethod;
|
|
139
|
-
await this.saveConfig();
|
|
140
|
-
this.emit('providerPathDetected', { provider, detectedPath, detectionMethod });
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Clear provider configuration
|
|
144
|
-
*/
|
|
145
|
-
async clearProviderPath(provider) {
|
|
146
|
-
if (this.config.providers?.[provider]) {
|
|
147
|
-
delete this.config.providers[provider];
|
|
148
|
-
await this.saveConfig();
|
|
149
|
-
this.emit('providerPathCleared', { provider });
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Cache provider validation results
|
|
154
|
-
*/
|
|
155
|
-
async cacheValidationResult(provider, result) {
|
|
156
|
-
if (!this.config.cache) {
|
|
157
|
-
this.config.cache = {};
|
|
158
|
-
}
|
|
159
|
-
if (!this.config.cache.validationResults) {
|
|
160
|
-
this.config.cache.validationResults = {};
|
|
161
|
-
}
|
|
162
|
-
this.config.cache.validationResults[provider] = {
|
|
163
|
-
...result,
|
|
164
|
-
checkedAt: new Date().toISOString(),
|
|
165
|
-
};
|
|
166
|
-
this.config.cache.lastProviderValidation = new Date().toISOString();
|
|
167
|
-
await this.saveConfig();
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Get cached validation result
|
|
171
|
-
*/
|
|
172
|
-
getCachedValidationResult(provider) {
|
|
173
|
-
return this.config.cache?.validationResults?.[provider];
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Check if cached validation is still fresh (within last 5 minutes)
|
|
177
|
-
*/
|
|
178
|
-
isCachedValidationFresh(provider) {
|
|
179
|
-
const cached = this.getCachedValidationResult(provider);
|
|
180
|
-
if (!cached)
|
|
181
|
-
return false;
|
|
182
|
-
const cacheAge = Date.now() - new Date(cached.checkedAt).getTime();
|
|
183
|
-
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
|
|
184
|
-
return cacheAge < CACHE_TTL;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Clear all cached validation results
|
|
188
|
-
*/
|
|
189
|
-
async clearValidationCache() {
|
|
190
|
-
if (this.config.cache) {
|
|
191
|
-
this.config.cache.validationResults = {};
|
|
192
|
-
this.config.cache.lastProviderValidation = undefined;
|
|
193
|
-
await this.saveConfig();
|
|
194
|
-
this.emit('validationCacheCleared');
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Get configuration file information
|
|
199
|
-
*/
|
|
200
|
-
async getConfigInfo() {
|
|
201
|
-
const exists = await this.fileExists(this.configPath);
|
|
202
|
-
let size;
|
|
203
|
-
if (exists) {
|
|
204
|
-
try {
|
|
205
|
-
const stats = await fs.stat(this.configPath);
|
|
206
|
-
size = stats.size;
|
|
207
|
-
}
|
|
208
|
-
catch {
|
|
209
|
-
// Ignore errors getting file size
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
return { path: this.configPath, exists, size };
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Export configuration for debugging/backup
|
|
216
|
-
*/
|
|
217
|
-
async exportConfig() {
|
|
218
|
-
return JSON.stringify(this.config, null, 2);
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Import configuration from JSON string
|
|
222
|
-
*/
|
|
223
|
-
async importConfig(configJson) {
|
|
224
|
-
try {
|
|
225
|
-
const parsed = JSON.parse(configJson);
|
|
226
|
-
const validated = LocalConfigSchema.parse(parsed);
|
|
227
|
-
this.config = validated;
|
|
228
|
-
await this.saveConfig();
|
|
229
|
-
this.emit('configImported', this.config);
|
|
230
|
-
}
|
|
231
|
-
catch (error) {
|
|
232
|
-
throw new Error(`Invalid config format: ${error instanceof Error ? error.message : String(error)}`);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
// Private methods
|
|
236
|
-
async ensureConfigDirectory() {
|
|
237
|
-
const configDir = path.dirname(this.configPath);
|
|
238
|
-
try {
|
|
239
|
-
await fs.access(configDir);
|
|
240
|
-
}
|
|
241
|
-
catch {
|
|
242
|
-
await fs.mkdir(configDir, { recursive: true });
|
|
243
|
-
log.info('Created local config directory', { configDir }, 'local-config');
|
|
244
|
-
// Create .gitignore to ensure this directory is not committed
|
|
245
|
-
const gitignorePath = path.join(configDir, '.gitignore');
|
|
246
|
-
try {
|
|
247
|
-
await fs.writeFile(gitignorePath, '# Local configuration - do not commit\n*\n!.gitignore\n');
|
|
248
|
-
}
|
|
249
|
-
catch (error) {
|
|
250
|
-
log.warn('Failed to create .gitignore in local config directory', error, 'local-config');
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
async loadConfig() {
|
|
255
|
-
try {
|
|
256
|
-
await fs.access(this.configPath);
|
|
257
|
-
const data = await fs.readFile(this.configPath, 'utf-8');
|
|
258
|
-
const parsed = JSON.parse(data);
|
|
259
|
-
// Validate and use parsed config
|
|
260
|
-
const validated = LocalConfigSchema.parse(parsed);
|
|
261
|
-
this.config = this.mergeWithDefaults(validated);
|
|
262
|
-
log.debug('Local config loaded from file', { configPath: this.configPath }, 'local-config');
|
|
263
|
-
}
|
|
264
|
-
catch (error) {
|
|
265
|
-
log.debug('Local config file not found or invalid, using defaults', { error: String(error) }, 'local-config');
|
|
266
|
-
this.config = { ...DEFAULT_LOCAL_CONFIG };
|
|
267
|
-
await this.saveConfig();
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
async saveConfig() {
|
|
271
|
-
const data = JSON.stringify(this.config, null, 2);
|
|
272
|
-
await fs.writeFile(this.configPath, data, 'utf-8');
|
|
273
|
-
log.debug('Local config saved to file', { configPath: this.configPath }, 'local-config');
|
|
274
|
-
}
|
|
275
|
-
async fileExists(filePath) {
|
|
276
|
-
try {
|
|
277
|
-
await fs.access(filePath);
|
|
278
|
-
return true;
|
|
279
|
-
}
|
|
280
|
-
catch {
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
mergeWithDefaults(config) {
|
|
285
|
-
return {
|
|
286
|
-
...DEFAULT_LOCAL_CONFIG,
|
|
287
|
-
...config,
|
|
288
|
-
providers: {
|
|
289
|
-
...DEFAULT_LOCAL_CONFIG.providers,
|
|
290
|
-
...config.providers,
|
|
291
|
-
},
|
|
292
|
-
cache: {
|
|
293
|
-
...DEFAULT_LOCAL_CONFIG.cache,
|
|
294
|
-
...config.cache,
|
|
295
|
-
},
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
// Singleton instance
|
|
300
|
-
let localConfigService = null;
|
|
301
|
-
export function getLocalConfigService(config) {
|
|
302
|
-
localConfigService ?? (localConfigService = new LocalConfigService(config));
|
|
303
|
-
return localConfigService;
|
|
304
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Logger } from 'pino';
|
|
2
|
-
export declare const logger: Logger;
|
|
3
|
-
export declare function createContextLogger(context: string): Logger;
|
|
4
|
-
export declare const log: {
|
|
5
|
-
error: (message: string, error?: Error | unknown, context?: string) => void;
|
|
6
|
-
warn: (message: string, data?: unknown, context?: string) => void;
|
|
7
|
-
info: (message: string, data?: unknown, context?: string) => void;
|
|
8
|
-
debug: (message: string, data?: unknown, context?: string) => void;
|
|
9
|
-
trace: (message: string, data?: unknown, context?: string) => void;
|
|
10
|
-
};
|
|
11
|
-
export default logger;
|