vibeman 0.0.1 → 0.0.3
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/index.js +5 -7
- package/dist/runtime/api/.tsbuildinfo +1 -1
- package/dist/runtime/api/agent/agent-service.d.ts +18 -19
- package/dist/runtime/api/agent/agent-service.js +61 -58
- package/dist/runtime/api/agent/ai-providers/claude-code-adapter.d.ts +2 -2
- package/dist/runtime/api/agent/ai-providers/claude-code-adapter.js +25 -36
- package/dist/runtime/api/agent/ai-providers/codex-cli-provider.d.ts +2 -0
- package/dist/runtime/api/agent/ai-providers/codex-cli-provider.js +109 -43
- package/dist/runtime/api/agent/ai-providers/types.d.ts +2 -0
- package/dist/runtime/api/agent/codex-cli-provider.test.js +83 -1
- package/dist/runtime/api/agent/parsers.d.ts +1 -0
- package/dist/runtime/api/agent/parsers.js +75 -8
- package/dist/runtime/api/agent/prompt-service.d.ts +14 -1
- package/dist/runtime/api/agent/prompt-service.js +123 -14
- package/dist/runtime/api/agent/prompt-service.test.js +230 -0
- package/dist/runtime/api/agent/routing-policy.d.ts +25 -42
- package/dist/runtime/api/agent/routing-policy.js +82 -132
- package/dist/runtime/api/agent/routing-policy.test.js +63 -0
- package/dist/runtime/api/api/routers/ai.d.ts +19 -7
- package/dist/runtime/api/api/routers/ai.js +9 -23
- package/dist/runtime/api/api/routers/executions.d.ts +4 -4
- package/dist/runtime/api/api/routers/executions.js +12 -21
- package/dist/runtime/api/api/routers/provider-config.d.ts +165 -0
- package/dist/runtime/api/api/routers/provider-config.js +252 -0
- package/dist/runtime/api/api/routers/tasks.d.ts +9 -9
- package/dist/runtime/api/api/routers/workflows.d.ts +23 -16
- package/dist/runtime/api/api/routers/workflows.js +30 -27
- package/dist/runtime/api/api/routers/worktrees.d.ts +4 -5
- package/dist/runtime/api/api/routers/worktrees.js +11 -11
- package/dist/runtime/api/api/trpc.d.ts +16 -16
- package/dist/runtime/api/index.js +2 -10
- package/dist/runtime/api/lib/local-config.d.ts +245 -0
- package/dist/runtime/api/lib/local-config.js +288 -0
- package/dist/runtime/api/lib/provider-detection.d.ts +59 -0
- package/dist/runtime/api/lib/provider-detection.js +244 -0
- package/dist/runtime/api/lib/server/bootstrap.d.ts +38 -0
- package/dist/runtime/api/lib/server/bootstrap.js +197 -0
- package/dist/runtime/api/lib/server/project-root.js +24 -1
- package/dist/runtime/api/lib/trpc/server.d.ts +143 -30
- package/dist/runtime/api/lib/trpc/server.js +8 -8
- package/dist/runtime/api/lib/trpc/ws-server.js +2 -2
- package/dist/runtime/api/router.d.ts +144 -31
- package/dist/runtime/api/router.js +9 -31
- package/dist/runtime/api/settings-service.js +51 -1
- package/dist/runtime/api/types/index.d.ts +8 -1
- package/dist/runtime/api/types/settings.d.ts +15 -2
- package/dist/runtime/api/workflows/vibing-orchestrator.d.ts +8 -3
- package/dist/runtime/api/workflows/vibing-orchestrator.js +214 -184
- package/dist/runtime/web/.next/BUILD_ID +1 -1
- package/dist/runtime/web/.next/app-build-manifest.json +19 -12
- package/dist/runtime/web/.next/app-path-routes-manifest.json +2 -1
- package/dist/runtime/web/.next/build-manifest.json +2 -2
- package/dist/runtime/web/.next/prerender-manifest.json +10 -10
- package/dist/runtime/web/.next/routes-manifest.json +8 -0
- package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js +1 -0
- package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route.js.nft.json +1 -0
- package/dist/runtime/web/.next/server/app/.vibeman/assets/images/[...path]/route_client-reference-manifest.js +1 -0
- package/dist/runtime/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/runtime/web/.next/server/app/_not-found.html +2 -2
- package/dist/runtime/web/.next/server/app/_not-found.rsc +5 -5
- package/dist/runtime/web/.next/server/app/api/health/route.js +1 -1
- package/dist/runtime/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/dist/runtime/web/.next/server/app/api/images/[...path]/route.js +1 -1
- package/dist/runtime/web/.next/server/app/api/images/[...path]/route_client-reference-manifest.js +1 -1
- package/dist/runtime/web/.next/server/app/api/upload/route.js +1 -1
- package/dist/runtime/web/.next/server/app/api/upload/route_client-reference-manifest.js +1 -1
- package/dist/runtime/web/.next/server/app/index.html +2 -2
- package/dist/runtime/web/.next/server/app/index.rsc +6 -6
- package/dist/runtime/web/.next/server/app/page.js +21 -21
- package/dist/runtime/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/runtime/web/.next/server/app-paths-manifest.json +2 -1
- package/dist/runtime/web/.next/server/chunks/458.js +1 -1
- package/dist/runtime/web/.next/server/pages/404.html +2 -2
- package/dist/runtime/web/.next/server/pages/500.html +1 -1
- package/dist/runtime/web/.next/server/pages-manifest.json +1 -1
- package/dist/runtime/web/.next/server/server-reference-manifest.json +1 -1
- package/dist/runtime/web/.next/static/5_15u1WQCxN1_eHZpldCv/_buildManifest.js +1 -0
- package/dist/runtime/web/.next/static/chunks/{277-0142a939f08738c3.js → 823-6f371a6e829adbba.js} +1 -1
- package/dist/runtime/web/.next/static/chunks/app/.vibeman/assets/images/[...path]/route-751c9265a65409e5.js +1 -0
- package/dist/runtime/web/.next/static/chunks/app/api/health/route-751c9265a65409e5.js +1 -0
- package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-751c9265a65409e5.js +1 -0
- package/dist/runtime/web/.next/static/chunks/app/api/upload/route-751c9265a65409e5.js +1 -0
- package/dist/runtime/web/.next/static/chunks/app/{layout-dc0cfd29075b2160.js → layout-8435322f09fd0975.js} +1 -1
- package/dist/runtime/web/.next/static/chunks/app/page-9fe7d75095b4ccec.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -1
- package/dist/runtime/api/lib/image-paste-drop-extension.d.ts +0 -26
- package/dist/runtime/api/lib/image-paste-drop-extension.js +0 -125
- package/dist/runtime/api/lib/markdown-utils.d.ts +0 -8
- package/dist/runtime/api/lib/markdown-utils.js +0 -282
- package/dist/runtime/api/lib/markdown-utils.test.js +0 -348
- package/dist/runtime/api/lib/tiptap-utils.clamp-selection.test.js +0 -27
- package/dist/runtime/api/lib/tiptap-utils.d.ts +0 -130
- package/dist/runtime/api/lib/tiptap-utils.js +0 -327
- package/dist/runtime/web/.next/static/1HR8N0rJkCvFRtbTPJMyH/_buildManifest.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/api/health/route-105a61ae865ba536.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/api/images/[...path]/route-105a61ae865ba536.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/api/upload/route-105a61ae865ba536.js +0 -1
- package/dist/runtime/web/.next/static/chunks/app/page-f34a8b196b18850b.js +0 -1
- /package/dist/runtime/api/{lib/markdown-utils.test.d.ts → agent/prompt-service.test.d.ts} +0 -0
- /package/dist/runtime/api/{lib/tiptap-utils.clamp-selection.test.d.ts → agent/routing-policy.test.d.ts} +0 -0
- /package/dist/runtime/web/.next/static/{1HR8N0rJkCvFRtbTPJMyH → 5_15u1WQCxN1_eHZpldCv}/_ssgManifest.js +0 -0
|
@@ -4,34 +4,29 @@ import { publicProcedure } from '../trpc.js';
|
|
|
4
4
|
import { ExecutionIdSchema, TaskIdSchema } from '../router-helpers.js';
|
|
5
5
|
import { makeAssertTaskActive } from '../router-helpers.js';
|
|
6
6
|
import { log } from '../../lib/logger.js';
|
|
7
|
-
export function buildExecutionRoutes({ taskService,
|
|
7
|
+
export function buildExecutionRoutes({ taskService, vibingOrchestrator }) {
|
|
8
8
|
const assertTaskActive = makeAssertTaskActive(taskService);
|
|
9
9
|
return {
|
|
10
10
|
executeTask: publicProcedure.input(TaskIdSchema).mutation(async ({ input }) => {
|
|
11
|
-
const orchestrator = await requireOrchestrator();
|
|
12
11
|
assertTaskActive(input.taskId);
|
|
13
|
-
const { executionId } = await
|
|
12
|
+
const { executionId } = await vibingOrchestrator.executeTask(input.taskId);
|
|
14
13
|
return { executionId };
|
|
15
14
|
}),
|
|
16
15
|
stopTaskExecution: publicProcedure.input(ExecutionIdSchema).mutation(async ({ input }) => {
|
|
17
|
-
|
|
18
|
-
await orchestrator.stopExecution(input.executionId);
|
|
16
|
+
await vibingOrchestrator.stopExecution(input.executionId);
|
|
19
17
|
return { success: true };
|
|
20
18
|
}),
|
|
21
19
|
getTaskExecutionStatus: publicProcedure.input(ExecutionIdSchema).query(async ({ input }) => {
|
|
22
|
-
|
|
23
|
-
return orchestrator.getExecutionStatus(input.executionId);
|
|
20
|
+
return vibingOrchestrator.getExecutionStatus(input.executionId);
|
|
24
21
|
}),
|
|
25
22
|
getTaskExecutionLogs: publicProcedure.input(ExecutionIdSchema).query(async ({ input }) => {
|
|
26
23
|
try {
|
|
27
|
-
const
|
|
28
|
-
const persistedLogs = await orchestrator.getPersistedExecutionLogs(input.executionId);
|
|
24
|
+
const persistedLogs = await vibingOrchestrator.getPersistedExecutionLogs(input.executionId);
|
|
29
25
|
return { logs: persistedLogs.logs };
|
|
30
26
|
}
|
|
31
27
|
catch (error) {
|
|
32
28
|
log.error('Failed to get task execution logs', error);
|
|
33
|
-
const
|
|
34
|
-
const logs = orchestrator.getExecutionLogs(input.executionId);
|
|
29
|
+
const logs = vibingOrchestrator.getExecutionLogs(input.executionId);
|
|
35
30
|
const logEntries = logs.map((message, index) => ({
|
|
36
31
|
timestamp: new Date().toISOString(),
|
|
37
32
|
level: 'info',
|
|
@@ -42,12 +37,10 @@ export function buildExecutionRoutes({ taskService, requireOrchestrator, require
|
|
|
42
37
|
}
|
|
43
38
|
}),
|
|
44
39
|
getTaskExecutions: publicProcedure.input(TaskIdSchema).query(async ({ input }) => {
|
|
45
|
-
|
|
46
|
-
return orchestrator.getTaskExecutions(input.taskId);
|
|
40
|
+
return vibingOrchestrator.getTaskExecutions(input.taskId);
|
|
47
41
|
}),
|
|
48
42
|
getTaskExecutionStats: publicProcedure.query(async () => {
|
|
49
|
-
|
|
50
|
-
return orchestrator.getExecutionStats();
|
|
43
|
+
return vibingOrchestrator.getExecutionStats();
|
|
51
44
|
}),
|
|
52
45
|
improveTask: publicProcedure
|
|
53
46
|
.input(z.object({
|
|
@@ -60,8 +53,7 @@ export function buildExecutionRoutes({ taskService, requireOrchestrator, require
|
|
|
60
53
|
}))
|
|
61
54
|
.mutation(async ({ input }) => {
|
|
62
55
|
assertTaskActive(input.taskId);
|
|
63
|
-
const
|
|
64
|
-
const improvement = await orchestrator.improveTaskContent(input.taskId, {
|
|
56
|
+
const improvement = await vibingOrchestrator.improveTaskContent(input.taskId, {
|
|
65
57
|
title: input.title,
|
|
66
58
|
type: input.type,
|
|
67
59
|
priority: input.priority,
|
|
@@ -73,9 +65,8 @@ export function buildExecutionRoutes({ taskService, requireOrchestrator, require
|
|
|
73
65
|
.input(z.object({ executionId: z.string() }))
|
|
74
66
|
.subscription(async function* (opts) {
|
|
75
67
|
const input = opts.input;
|
|
76
|
-
const orchestrator = requireOrchestratorSync();
|
|
77
68
|
// Emit initial status if exists
|
|
78
|
-
const initial =
|
|
69
|
+
const initial = vibingOrchestrator.getExecutionStatus(input.executionId);
|
|
79
70
|
if (initial) {
|
|
80
71
|
yield {
|
|
81
72
|
executionId: initial.id,
|
|
@@ -89,14 +80,14 @@ export function buildExecutionRoutes({ taskService, requireOrchestrator, require
|
|
|
89
80
|
if (update.executionId === input.executionId)
|
|
90
81
|
proxy.emit('data', update);
|
|
91
82
|
};
|
|
92
|
-
|
|
83
|
+
vibingOrchestrator.on('executionUpdated', handleUpdate);
|
|
93
84
|
try {
|
|
94
85
|
for await (const [payload] of on(proxy, 'data', { signal: opts.signal })) {
|
|
95
86
|
yield payload;
|
|
96
87
|
}
|
|
97
88
|
}
|
|
98
89
|
finally {
|
|
99
|
-
|
|
90
|
+
vibingOrchestrator.off('executionUpdated', handleUpdate);
|
|
100
91
|
}
|
|
101
92
|
}),
|
|
102
93
|
};
|
|
@@ -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
|
+
}
|
|
@@ -3,11 +3,11 @@ import type { GitService } from '../../vcs/git-service.js';
|
|
|
3
3
|
export declare function buildTaskRoutes(taskService: TaskService, gitService?: GitService): {
|
|
4
4
|
readonly listTasks: import("@trpc/server").TRPCQueryProcedure<{
|
|
5
5
|
input: {
|
|
6
|
+
status?: "review" | "in-progress" | "backlog" | "done" | undefined;
|
|
6
7
|
type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
|
|
7
|
-
|
|
8
|
+
tags?: string[] | undefined;
|
|
8
9
|
priority?: "low" | "medium" | "high" | undefined;
|
|
9
10
|
search?: string | undefined;
|
|
10
|
-
tags?: string[] | undefined;
|
|
11
11
|
includeDeleted?: boolean | undefined;
|
|
12
12
|
onlyDeleted?: boolean | undefined;
|
|
13
13
|
} | undefined;
|
|
@@ -23,15 +23,15 @@ export declare function buildTaskRoutes(taskService: TaskService, gitService?: G
|
|
|
23
23
|
}>;
|
|
24
24
|
readonly createTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
25
25
|
input: {
|
|
26
|
-
type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
|
|
27
26
|
title: string;
|
|
27
|
+
type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
|
|
28
28
|
content: string;
|
|
29
|
-
status?: "
|
|
30
|
-
priority?: "low" | "medium" | "high" | undefined;
|
|
29
|
+
status?: "review" | "in-progress" | "backlog" | "done" | undefined;
|
|
31
30
|
id?: string | undefined;
|
|
32
31
|
tags?: string[] | undefined;
|
|
33
32
|
due_date?: string | undefined;
|
|
34
33
|
assignee?: string[] | undefined;
|
|
34
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
35
35
|
comments?: string[] | undefined;
|
|
36
36
|
};
|
|
37
37
|
output: import("../../types/index.js").Task;
|
|
@@ -40,13 +40,13 @@ export declare function buildTaskRoutes(taskService: TaskService, gitService?: G
|
|
|
40
40
|
readonly updateTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
41
41
|
input: {
|
|
42
42
|
id: string;
|
|
43
|
-
|
|
44
|
-
status?: "backlog" | "in-progress" | "review" | "done" | undefined;
|
|
45
|
-
priority?: "low" | "medium" | "high" | undefined;
|
|
43
|
+
status?: "review" | "in-progress" | "backlog" | "done" | undefined;
|
|
46
44
|
title?: string | undefined;
|
|
45
|
+
type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
|
|
47
46
|
tags?: string[] | undefined;
|
|
48
47
|
due_date?: string | undefined;
|
|
49
48
|
assignee?: string[] | undefined;
|
|
49
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
50
50
|
comments?: string[] | undefined;
|
|
51
51
|
content?: string | undefined;
|
|
52
52
|
deleted_at?: string | undefined;
|
|
@@ -65,7 +65,7 @@ export declare function buildTaskRoutes(taskService: TaskService, gitService?: G
|
|
|
65
65
|
}>;
|
|
66
66
|
readonly moveTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
67
67
|
input: {
|
|
68
|
-
status: "
|
|
68
|
+
status: "review" | "in-progress" | "backlog" | "done";
|
|
69
69
|
id: string;
|
|
70
70
|
};
|
|
71
71
|
output: import("../../types/index.js").Task;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
|
|
2
2
|
type Deps = {
|
|
3
|
-
|
|
4
|
-
requireOrchestratorSync: () => VibingOrchestrator;
|
|
3
|
+
vibingOrchestrator: VibingOrchestrator;
|
|
5
4
|
};
|
|
6
|
-
export declare function buildWorkflowRoutes({
|
|
5
|
+
export declare function buildWorkflowRoutes({ vibingOrchestrator }: Deps): {
|
|
7
6
|
readonly updateWorkflowOptions: import("@trpc/server").TRPCMutationProcedure<{
|
|
8
7
|
input: {
|
|
8
|
+
workflowId: string;
|
|
9
9
|
config: {
|
|
10
|
+
autoCommit?: boolean | undefined;
|
|
11
|
+
createPR?: boolean | undefined;
|
|
10
12
|
autoQualityChecks?: boolean | undefined;
|
|
11
13
|
requireHumanApproval?: boolean | undefined;
|
|
12
|
-
aiCodeReview?: boolean | undefined;
|
|
13
|
-
autoCommit?: boolean | undefined;
|
|
14
14
|
stepByStepMode?: boolean | undefined;
|
|
15
|
-
createPR?: boolean | undefined;
|
|
16
15
|
autoMerge?: boolean | undefined;
|
|
16
|
+
aiCodeReview?: boolean | undefined;
|
|
17
17
|
aiRoutingOverrides?: {
|
|
18
18
|
execute_task?: {
|
|
19
19
|
provider?: string | undefined;
|
|
20
20
|
model?: string | undefined;
|
|
21
21
|
} | undefined;
|
|
22
|
-
|
|
22
|
+
quality_checks?: {
|
|
23
23
|
provider?: string | undefined;
|
|
24
24
|
model?: string | undefined;
|
|
25
25
|
} | undefined;
|
|
26
|
-
|
|
26
|
+
improve_task?: {
|
|
27
27
|
provider?: string | undefined;
|
|
28
28
|
model?: string | undefined;
|
|
29
29
|
} | undefined;
|
|
@@ -31,9 +31,12 @@ export declare function buildWorkflowRoutes({ requireOrchestrator, requireOrches
|
|
|
31
31
|
provider?: string | undefined;
|
|
32
32
|
model?: string | undefined;
|
|
33
33
|
} | undefined;
|
|
34
|
+
ai_codereview?: {
|
|
35
|
+
provider?: string | undefined;
|
|
36
|
+
model?: string | undefined;
|
|
37
|
+
} | undefined;
|
|
34
38
|
} | undefined;
|
|
35
39
|
};
|
|
36
|
-
workflowId: string;
|
|
37
40
|
};
|
|
38
41
|
output: {
|
|
39
42
|
readonly success: true;
|
|
@@ -44,23 +47,23 @@ export declare function buildWorkflowRoutes({ requireOrchestrator, requireOrches
|
|
|
44
47
|
input: {
|
|
45
48
|
taskId: string;
|
|
46
49
|
config?: {
|
|
50
|
+
autoCommit?: boolean | undefined;
|
|
51
|
+
createPR?: boolean | undefined;
|
|
47
52
|
autoQualityChecks?: boolean | undefined;
|
|
48
53
|
requireHumanApproval?: boolean | undefined;
|
|
49
|
-
aiCodeReview?: boolean | undefined;
|
|
50
|
-
autoCommit?: boolean | undefined;
|
|
51
54
|
stepByStepMode?: boolean | undefined;
|
|
52
|
-
createPR?: boolean | undefined;
|
|
53
55
|
autoMerge?: boolean | undefined;
|
|
56
|
+
aiCodeReview?: boolean | undefined;
|
|
54
57
|
aiRoutingOverrides?: {
|
|
55
58
|
execute_task?: {
|
|
56
59
|
provider?: string | undefined;
|
|
57
60
|
model?: string | undefined;
|
|
58
61
|
} | undefined;
|
|
59
|
-
|
|
62
|
+
quality_checks?: {
|
|
60
63
|
provider?: string | undefined;
|
|
61
64
|
model?: string | undefined;
|
|
62
65
|
} | undefined;
|
|
63
|
-
|
|
66
|
+
improve_task?: {
|
|
64
67
|
provider?: string | undefined;
|
|
65
68
|
model?: string | undefined;
|
|
66
69
|
} | undefined;
|
|
@@ -68,6 +71,10 @@ export declare function buildWorkflowRoutes({ requireOrchestrator, requireOrches
|
|
|
68
71
|
provider?: string | undefined;
|
|
69
72
|
model?: string | undefined;
|
|
70
73
|
} | undefined;
|
|
74
|
+
ai_codereview?: {
|
|
75
|
+
provider?: string | undefined;
|
|
76
|
+
model?: string | undefined;
|
|
77
|
+
} | undefined;
|
|
71
78
|
} | undefined;
|
|
72
79
|
} | undefined;
|
|
73
80
|
};
|
|
@@ -188,12 +195,12 @@ export declare function buildWorkflowRoutes({ requireOrchestrator, requireOrches
|
|
|
188
195
|
output: import("../../types/index.js").VibingExecution | null;
|
|
189
196
|
meta: object;
|
|
190
197
|
}>;
|
|
191
|
-
readonly
|
|
198
|
+
readonly aiReviewCode: import("@trpc/server").TRPCMutationProcedure<{
|
|
192
199
|
input: {
|
|
193
200
|
taskId: string;
|
|
194
201
|
provider?: string | undefined;
|
|
195
|
-
model?: string | undefined;
|
|
196
202
|
workflowId?: string | undefined;
|
|
203
|
+
model?: string | undefined;
|
|
197
204
|
reviewContext?: string | undefined;
|
|
198
205
|
};
|
|
199
206
|
output: {
|