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,396 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Router - Multi-Model Orchestration API
|
|
3
|
-
* Provides tRPC endpoints for managing AI providers and routing policies
|
|
4
|
-
*/
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
import { publicProcedure } from '../trpc.js';
|
|
7
|
-
import { RoutingPolicySchema, OperationConfigSchema, } from '../../agent/routing-policy.js';
|
|
8
|
-
import { log } from '../../lib/logger.js';
|
|
9
|
-
import { getSettingsService } from '../../settings-service.js';
|
|
10
|
-
/**
|
|
11
|
-
* Input schemas for API endpoints
|
|
12
|
-
*/
|
|
13
|
-
const ListModelsInputSchema = z.object({
|
|
14
|
-
provider: z.string().optional(),
|
|
15
|
-
});
|
|
16
|
-
const UpdateRoutingPolicyInputSchema = z.object({
|
|
17
|
-
policy: RoutingPolicySchema.partial(),
|
|
18
|
-
});
|
|
19
|
-
const SetDefaultProviderInputSchema = z.object({
|
|
20
|
-
provider: z.string(),
|
|
21
|
-
});
|
|
22
|
-
const SetOperationConfigInputSchema = z.object({
|
|
23
|
-
operation: z.enum(['execute_task', 'quality_checks', 'ai_codereview', 'ai_merge', 'improve_task']),
|
|
24
|
-
config: OperationConfigSchema,
|
|
25
|
-
});
|
|
26
|
-
const ValidateProvidersInputSchema = z.object({
|
|
27
|
-
force: z.boolean().optional(),
|
|
28
|
-
});
|
|
29
|
-
/**
|
|
30
|
-
* Build AI router with required dependencies
|
|
31
|
-
*/
|
|
32
|
-
export function buildAIRoutes(options) {
|
|
33
|
-
const { agentService } = options;
|
|
34
|
-
return {
|
|
35
|
-
/**
|
|
36
|
-
* List all registered AI providers with health status
|
|
37
|
-
*/
|
|
38
|
-
listProviders: publicProcedure.query(async () => {
|
|
39
|
-
try {
|
|
40
|
-
const providers = agentService.getAvailableProviders();
|
|
41
|
-
const providerStatuses = await agentService.validateProviders();
|
|
42
|
-
const result = Array.from(providers.entries()).map(([name, provider]) => {
|
|
43
|
-
const status = providerStatuses.get(name);
|
|
44
|
-
return {
|
|
45
|
-
name,
|
|
46
|
-
displayName: provider.displayName,
|
|
47
|
-
available: status?.available || false,
|
|
48
|
-
error: status?.error,
|
|
49
|
-
capabilities: status?.capabilities || provider.getCapabilities(),
|
|
50
|
-
models: status?.models || [],
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
log.debug('Listed AI providers', { count: result.length }, 'ai-router');
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
const msg = `Failed to list providers: ${error instanceof Error ? error.message : String(error)}`;
|
|
58
|
-
log.error(msg, error, 'ai-router');
|
|
59
|
-
throw new Error(msg);
|
|
60
|
-
}
|
|
61
|
-
}),
|
|
62
|
-
/**
|
|
63
|
-
* List available models from providers
|
|
64
|
-
*/
|
|
65
|
-
listModels: publicProcedure.input(ListModelsInputSchema.optional()).query(async ({ input }) => {
|
|
66
|
-
try {
|
|
67
|
-
if (input?.provider) {
|
|
68
|
-
// Get models from specific provider
|
|
69
|
-
const provider = agentService.getAvailableProviders().get(input.provider);
|
|
70
|
-
if (!provider) {
|
|
71
|
-
throw new Error(`Provider ${input.provider} not found`);
|
|
72
|
-
}
|
|
73
|
-
const models = await provider.detectAvailableModels();
|
|
74
|
-
log.debug('Listed models for provider', { provider: input.provider, count: models.length }, 'ai-router');
|
|
75
|
-
return models;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
// Get models from all providers
|
|
79
|
-
const models = await agentService.getAvailableModels();
|
|
80
|
-
log.debug('Listed all available models', { count: models.length }, 'ai-router');
|
|
81
|
-
return models;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
const msg = `Failed to list models: ${error instanceof Error ? error.message : String(error)}`;
|
|
86
|
-
log.error(msg, error, 'ai-router');
|
|
87
|
-
throw new Error(msg);
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
/**
|
|
91
|
-
* Get current routing policy
|
|
92
|
-
*/
|
|
93
|
-
getRoutingPolicy: publicProcedure.query(async () => {
|
|
94
|
-
try {
|
|
95
|
-
const rpm = agentService.getRoutingPolicyManager?.();
|
|
96
|
-
if (!rpm) {
|
|
97
|
-
const settings = getSettingsService().getSettings();
|
|
98
|
-
return {
|
|
99
|
-
defaultProvider: settings.agents.defaultProvider || 'claude-code',
|
|
100
|
-
operations: {},
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const policy = (rpm.getEffectivePolicy
|
|
104
|
-
? await rpm.getEffectivePolicy()
|
|
105
|
-
: await rpm.getPolicy());
|
|
106
|
-
log.debug('Retrieved routing policy', { policy }, 'ai-router');
|
|
107
|
-
return policy;
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
const msg = `Failed to get routing policy: ${error instanceof Error ? error.message : String(error)}`;
|
|
111
|
-
log.error(msg, error, 'ai-router');
|
|
112
|
-
throw new Error(msg);
|
|
113
|
-
}
|
|
114
|
-
}),
|
|
115
|
-
/**
|
|
116
|
-
* Update routing policy
|
|
117
|
-
*/
|
|
118
|
-
updateRoutingPolicy: publicProcedure
|
|
119
|
-
.input(UpdateRoutingPolicyInputSchema)
|
|
120
|
-
.mutation(async ({ input }) => {
|
|
121
|
-
try {
|
|
122
|
-
const routingManager = agentService.getRoutingPolicyManager();
|
|
123
|
-
if (!routingManager) {
|
|
124
|
-
throw new Error('Routing policy manager not available');
|
|
125
|
-
}
|
|
126
|
-
await routingManager.updatePolicy(input.policy);
|
|
127
|
-
const updatedPolicy = await routingManager.getPolicy();
|
|
128
|
-
log.info('Updated routing policy', { updates: input.policy }, 'ai-router');
|
|
129
|
-
return { success: true, policy: updatedPolicy };
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
const msg = `Failed to update routing policy: ${error instanceof Error ? error.message : String(error)}`;
|
|
133
|
-
log.error(msg, error, 'ai-router');
|
|
134
|
-
throw new Error(msg);
|
|
135
|
-
}
|
|
136
|
-
}),
|
|
137
|
-
/**
|
|
138
|
-
* Set default provider
|
|
139
|
-
*/
|
|
140
|
-
setDefaultProvider: publicProcedure
|
|
141
|
-
.input(SetDefaultProviderInputSchema)
|
|
142
|
-
.mutation(async ({ input }) => {
|
|
143
|
-
try {
|
|
144
|
-
const routingManager = agentService.getRoutingPolicyManager();
|
|
145
|
-
if (!routingManager) {
|
|
146
|
-
throw new Error('Routing policy manager not available');
|
|
147
|
-
}
|
|
148
|
-
// Validate provider exists
|
|
149
|
-
const providers = agentService.getAvailableProviders();
|
|
150
|
-
if (!providers.has(input.provider)) {
|
|
151
|
-
throw new Error(`Provider ${input.provider} not found`);
|
|
152
|
-
}
|
|
153
|
-
await routingManager.setDefaultProvider(input.provider);
|
|
154
|
-
log.info('Set default provider', { provider: input.provider }, 'ai-router');
|
|
155
|
-
return { success: true, provider: input.provider };
|
|
156
|
-
}
|
|
157
|
-
catch (error) {
|
|
158
|
-
const msg = `Failed to set default provider: ${error instanceof Error ? error.message : String(error)}`;
|
|
159
|
-
log.error(msg, error, 'ai-router');
|
|
160
|
-
throw new Error(msg);
|
|
161
|
-
}
|
|
162
|
-
}),
|
|
163
|
-
/**
|
|
164
|
-
* Set operation-specific configuration
|
|
165
|
-
*/
|
|
166
|
-
setOperationConfig: publicProcedure
|
|
167
|
-
.input(SetOperationConfigInputSchema)
|
|
168
|
-
.mutation(async ({ input }) => {
|
|
169
|
-
try {
|
|
170
|
-
const routingManager = agentService.getRoutingPolicyManager();
|
|
171
|
-
if (!routingManager) {
|
|
172
|
-
throw new Error('Routing policy manager not available');
|
|
173
|
-
}
|
|
174
|
-
// Validate provider exists
|
|
175
|
-
const providers = agentService.getAvailableProviders();
|
|
176
|
-
if (!providers.has(input.config.provider)) {
|
|
177
|
-
throw new Error(`Provider ${input.config.provider} not found`);
|
|
178
|
-
}
|
|
179
|
-
// Validate fallback providers if specified
|
|
180
|
-
if (input.config.fallback) {
|
|
181
|
-
for (const fallbackProvider of input.config.fallback) {
|
|
182
|
-
if (!providers.has(fallbackProvider)) {
|
|
183
|
-
throw new Error(`Fallback provider ${fallbackProvider} not found`);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
await routingManager.setOperationConfig(input.operation, input.config);
|
|
188
|
-
log.info('Set operation config', { operation: input.operation, config: input.config }, 'ai-router');
|
|
189
|
-
return { success: true };
|
|
190
|
-
}
|
|
191
|
-
catch (error) {
|
|
192
|
-
const msg = `Failed to set operation config: ${error instanceof Error ? error.message : String(error)}`;
|
|
193
|
-
log.error(msg, error, 'ai-router');
|
|
194
|
-
throw new Error(msg);
|
|
195
|
-
}
|
|
196
|
-
}),
|
|
197
|
-
/**
|
|
198
|
-
* Validate provider setup and refresh health status
|
|
199
|
-
*/
|
|
200
|
-
validateProviders: publicProcedure
|
|
201
|
-
.input(ValidateProvidersInputSchema.optional())
|
|
202
|
-
.mutation(async ({ input }) => {
|
|
203
|
-
try {
|
|
204
|
-
const results = await agentService.validateProviders();
|
|
205
|
-
const validation = Array.from(results.entries()).map(([name, status]) => ({
|
|
206
|
-
provider: name,
|
|
207
|
-
available: status.available,
|
|
208
|
-
error: status.error,
|
|
209
|
-
modelCount: status.models.length,
|
|
210
|
-
capabilities: status.capabilities,
|
|
211
|
-
}));
|
|
212
|
-
log.info('Validated providers', {
|
|
213
|
-
force: input?.force || false,
|
|
214
|
-
results: validation,
|
|
215
|
-
}, 'ai-router');
|
|
216
|
-
return {
|
|
217
|
-
success: true,
|
|
218
|
-
results: validation,
|
|
219
|
-
totalProviders: validation.length,
|
|
220
|
-
availableProviders: validation.filter((p) => p.available).length,
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
catch (error) {
|
|
224
|
-
const msg = `Failed to validate providers: ${error instanceof Error ? error.message : String(error)}`;
|
|
225
|
-
log.error(msg, error, 'ai-router');
|
|
226
|
-
throw new Error(msg);
|
|
227
|
-
}
|
|
228
|
-
}),
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Test-friendly plain handlers mirroring the AI routes, without tRPC wrappers.
|
|
233
|
-
* Useful for unit tests that call functions directly.
|
|
234
|
-
*/
|
|
235
|
-
export function buildAIRouteHandlers(options) {
|
|
236
|
-
const { agentService } = options;
|
|
237
|
-
return {
|
|
238
|
-
async listProviders() {
|
|
239
|
-
try {
|
|
240
|
-
const providers = agentService.getAvailableProviders();
|
|
241
|
-
const providerStatuses = await agentService.validateProviders();
|
|
242
|
-
return Array.from(providers.entries()).map(([name, provider]) => {
|
|
243
|
-
const status = providerStatuses.get(name);
|
|
244
|
-
return {
|
|
245
|
-
name,
|
|
246
|
-
displayName: provider.displayName,
|
|
247
|
-
available: status?.available || false,
|
|
248
|
-
error: status?.error,
|
|
249
|
-
capabilities: status?.capabilities || provider.getCapabilities?.(),
|
|
250
|
-
models: status?.models || [],
|
|
251
|
-
};
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
catch (error) {
|
|
255
|
-
throw new Error(`Failed to list providers: ${error instanceof Error ? error.message : String(error)}`);
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
async listModels(input) {
|
|
259
|
-
try {
|
|
260
|
-
if (input?.provider) {
|
|
261
|
-
const provider = agentService.getAvailableProviders().get(input.provider);
|
|
262
|
-
if (!provider)
|
|
263
|
-
throw new Error(`Provider ${input.provider} not found`);
|
|
264
|
-
return await provider.detectAvailableModels();
|
|
265
|
-
}
|
|
266
|
-
return await agentService.getAvailableModels();
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
throw new Error(`Failed to list models: ${error instanceof Error ? error.message : String(error)}`);
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
async getRoutingPolicy() {
|
|
273
|
-
try {
|
|
274
|
-
const rpm = agentService.getRoutingPolicyManager?.() ||
|
|
275
|
-
agentService.routingPolicyManager;
|
|
276
|
-
const policy = await rpm?.getPolicy();
|
|
277
|
-
if (!policy) {
|
|
278
|
-
const settings = getSettingsService().getSettings();
|
|
279
|
-
return {
|
|
280
|
-
defaultProvider: settings.agents.defaultProvider || 'claude-code',
|
|
281
|
-
operations: {},
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
return policy;
|
|
285
|
-
}
|
|
286
|
-
catch (error) {
|
|
287
|
-
throw new Error(`Failed to get routing policy: ${error instanceof Error ? error.message : String(error)}`);
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
async updateRoutingPolicy(input) {
|
|
291
|
-
try {
|
|
292
|
-
const routingManager = agentService.getRoutingPolicyManager?.() ||
|
|
293
|
-
agentService.routingPolicyManager;
|
|
294
|
-
if (!routingManager)
|
|
295
|
-
throw new Error('Routing policy manager not available');
|
|
296
|
-
await routingManager.updatePolicy(input.policy);
|
|
297
|
-
const updatedPolicy = await routingManager.getPolicy();
|
|
298
|
-
return { success: true, policy: updatedPolicy };
|
|
299
|
-
}
|
|
300
|
-
catch (error) {
|
|
301
|
-
throw new Error(`Failed to update routing policy: ${error instanceof Error ? error.message : String(error)}`);
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
async setDefaultProvider(input) {
|
|
305
|
-
try {
|
|
306
|
-
const routingManager = agentService.getRoutingPolicyManager?.() ||
|
|
307
|
-
agentService.routingPolicyManager;
|
|
308
|
-
if (!routingManager)
|
|
309
|
-
throw new Error('Routing policy manager not available');
|
|
310
|
-
const providers = agentService.getAvailableProviders();
|
|
311
|
-
if (!providers.has(input.provider))
|
|
312
|
-
throw new Error(`Provider ${input.provider} not found`);
|
|
313
|
-
await routingManager.setDefaultProvider(input.provider);
|
|
314
|
-
return { success: true, provider: input.provider };
|
|
315
|
-
}
|
|
316
|
-
catch (error) {
|
|
317
|
-
throw new Error(`Failed to set default provider: ${error instanceof Error ? error.message : String(error)}`);
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
async setOperationConfig(input) {
|
|
321
|
-
try {
|
|
322
|
-
const routingManager = agentService.getRoutingPolicyManager?.() ||
|
|
323
|
-
agentService.routingPolicyManager;
|
|
324
|
-
if (!routingManager)
|
|
325
|
-
throw new Error('Routing policy manager not available');
|
|
326
|
-
const providers = agentService.getAvailableProviders();
|
|
327
|
-
if (!providers.has(input.config.provider)) {
|
|
328
|
-
throw new Error(`Provider ${input.config.provider} not found`);
|
|
329
|
-
}
|
|
330
|
-
if (input.config.fallback) {
|
|
331
|
-
for (const fallbackProvider of input.config.fallback) {
|
|
332
|
-
if (!providers.has(fallbackProvider)) {
|
|
333
|
-
throw new Error(`Fallback provider ${fallbackProvider} not found`);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
await routingManager.setOperationConfig(input.operation, input.config);
|
|
338
|
-
return { success: true };
|
|
339
|
-
}
|
|
340
|
-
catch (error) {
|
|
341
|
-
throw new Error(`Failed to set operation config: ${error instanceof Error ? error.message : String(error)}`);
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
async validateProviders() {
|
|
345
|
-
try {
|
|
346
|
-
const results = await agentService.validateProviders();
|
|
347
|
-
const validation = Array.from(results.entries()).map(([name, status]) => ({
|
|
348
|
-
provider: name,
|
|
349
|
-
available: status.available,
|
|
350
|
-
error: status.error,
|
|
351
|
-
modelCount: status.models.length,
|
|
352
|
-
capabilities: status.capabilities,
|
|
353
|
-
}));
|
|
354
|
-
return {
|
|
355
|
-
success: true,
|
|
356
|
-
results: validation,
|
|
357
|
-
totalProviders: validation.length,
|
|
358
|
-
availableProviders: validation.filter((p) => p.available).length,
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
catch (error) {
|
|
362
|
-
throw new Error(`Failed to validate providers: ${error instanceof Error ? error.message : String(error)}`);
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
async getProviderHealth() {
|
|
366
|
-
try {
|
|
367
|
-
const providers = agentService.getAvailableProviders();
|
|
368
|
-
const statuses = await agentService.validateProviders();
|
|
369
|
-
const health = {
|
|
370
|
-
totalProviders: providers.size,
|
|
371
|
-
availableProviders: 0,
|
|
372
|
-
unavailableProviders: 0,
|
|
373
|
-
providers: [],
|
|
374
|
-
};
|
|
375
|
-
for (const [name] of providers) {
|
|
376
|
-
const status = statuses.get(name);
|
|
377
|
-
const isAvailable = status?.available || false;
|
|
378
|
-
if (isAvailable)
|
|
379
|
-
health.availableProviders++;
|
|
380
|
-
else
|
|
381
|
-
health.unavailableProviders++;
|
|
382
|
-
health.providers.push({
|
|
383
|
-
name,
|
|
384
|
-
available: isAvailable,
|
|
385
|
-
error: status?.error,
|
|
386
|
-
modelCount: status?.models.length || 0,
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
return health;
|
|
390
|
-
}
|
|
391
|
-
catch (error) {
|
|
392
|
-
throw new Error(`Failed to get provider health: ${error instanceof Error ? error.message : String(error)}`);
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
};
|
|
396
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { TaskService } from '../../tasks/task-service.js';
|
|
2
|
-
import type { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
|
|
3
|
-
type Deps = {
|
|
4
|
-
taskService: TaskService;
|
|
5
|
-
vibingOrchestrator: VibingOrchestrator;
|
|
6
|
-
};
|
|
7
|
-
export declare function buildExecutionRoutes({ taskService, vibingOrchestrator }: Deps): {
|
|
8
|
-
readonly executeTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
9
|
-
input: {
|
|
10
|
-
taskId: string;
|
|
11
|
-
};
|
|
12
|
-
output: {
|
|
13
|
-
readonly executionId: string;
|
|
14
|
-
};
|
|
15
|
-
meta: object;
|
|
16
|
-
}>;
|
|
17
|
-
readonly stopTaskExecution: import("@trpc/server").TRPCMutationProcedure<{
|
|
18
|
-
input: {
|
|
19
|
-
executionId: string;
|
|
20
|
-
};
|
|
21
|
-
output: {
|
|
22
|
-
readonly success: true;
|
|
23
|
-
};
|
|
24
|
-
meta: object;
|
|
25
|
-
}>;
|
|
26
|
-
readonly getTaskExecutionStatus: import("@trpc/server").TRPCQueryProcedure<{
|
|
27
|
-
input: {
|
|
28
|
-
executionId: string;
|
|
29
|
-
};
|
|
30
|
-
output: import("../../types/index.js").AgentExecution | null;
|
|
31
|
-
meta: object;
|
|
32
|
-
}>;
|
|
33
|
-
readonly getTaskExecutionLogs: import("@trpc/server").TRPCQueryProcedure<{
|
|
34
|
-
input: {
|
|
35
|
-
executionId: string;
|
|
36
|
-
};
|
|
37
|
-
output: {
|
|
38
|
-
logs: any[];
|
|
39
|
-
};
|
|
40
|
-
meta: object;
|
|
41
|
-
}>;
|
|
42
|
-
readonly getTaskExecutions: import("@trpc/server").TRPCQueryProcedure<{
|
|
43
|
-
input: {
|
|
44
|
-
taskId: string;
|
|
45
|
-
};
|
|
46
|
-
output: import("../../types/index.js").AgentExecution[];
|
|
47
|
-
meta: object;
|
|
48
|
-
}>;
|
|
49
|
-
readonly getTaskExecutionStats: import("@trpc/server").TRPCQueryProcedure<{
|
|
50
|
-
input: void;
|
|
51
|
-
output: {
|
|
52
|
-
total: number;
|
|
53
|
-
pending: number;
|
|
54
|
-
running: number;
|
|
55
|
-
completed: number;
|
|
56
|
-
failed: number;
|
|
57
|
-
cancelled: number;
|
|
58
|
-
worktrees: {
|
|
59
|
-
active: number;
|
|
60
|
-
total: number;
|
|
61
|
-
enabled: boolean;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
meta: object;
|
|
65
|
-
}>;
|
|
66
|
-
readonly improveTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
67
|
-
input: {
|
|
68
|
-
type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
|
|
69
|
-
priority: "low" | "medium" | "high";
|
|
70
|
-
title: string;
|
|
71
|
-
content: string;
|
|
72
|
-
taskId: string;
|
|
73
|
-
executionId?: string | undefined;
|
|
74
|
-
};
|
|
75
|
-
output: {
|
|
76
|
-
readonly executionId: string;
|
|
77
|
-
};
|
|
78
|
-
meta: object;
|
|
79
|
-
}>;
|
|
80
|
-
readonly onExecutionUpdate: import("@trpc/server").TRPCSubscriptionProcedure<{
|
|
81
|
-
input: {
|
|
82
|
-
executionId: string;
|
|
83
|
-
};
|
|
84
|
-
output: AsyncIterable<{
|
|
85
|
-
executionId: string;
|
|
86
|
-
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
87
|
-
logs: string[];
|
|
88
|
-
error?: string;
|
|
89
|
-
}, void, any>;
|
|
90
|
-
meta: object;
|
|
91
|
-
}>;
|
|
92
|
-
};
|
|
93
|
-
export {};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { on, EventEmitter } from 'events';
|
|
3
|
-
import { publicProcedure } from '../trpc.js';
|
|
4
|
-
import { ExecutionIdSchema, TaskIdSchema } from '../router-helpers.js';
|
|
5
|
-
import { makeAssertTaskActive } from '../router-helpers.js';
|
|
6
|
-
import { log } from '../../lib/logger.js';
|
|
7
|
-
export function buildExecutionRoutes({ taskService, vibingOrchestrator }) {
|
|
8
|
-
const assertTaskActive = makeAssertTaskActive(taskService);
|
|
9
|
-
return {
|
|
10
|
-
executeTask: publicProcedure.input(TaskIdSchema).mutation(async ({ input }) => {
|
|
11
|
-
assertTaskActive(input.taskId);
|
|
12
|
-
const { executionId } = await vibingOrchestrator.executeTask(input.taskId);
|
|
13
|
-
return { executionId };
|
|
14
|
-
}),
|
|
15
|
-
stopTaskExecution: publicProcedure.input(ExecutionIdSchema).mutation(async ({ input }) => {
|
|
16
|
-
await vibingOrchestrator.stopExecution(input.executionId);
|
|
17
|
-
return { success: true };
|
|
18
|
-
}),
|
|
19
|
-
getTaskExecutionStatus: publicProcedure.input(ExecutionIdSchema).query(async ({ input }) => {
|
|
20
|
-
return vibingOrchestrator.getExecutionStatus(input.executionId);
|
|
21
|
-
}),
|
|
22
|
-
getTaskExecutionLogs: publicProcedure.input(ExecutionIdSchema).query(async ({ input }) => {
|
|
23
|
-
try {
|
|
24
|
-
const persistedLogs = await vibingOrchestrator.getPersistedExecutionLogs(input.executionId);
|
|
25
|
-
return { logs: persistedLogs.logs };
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
log.error('Failed to get task execution logs', error);
|
|
29
|
-
const logs = vibingOrchestrator.getExecutionLogs(input.executionId);
|
|
30
|
-
const logEntries = logs.map((message, index) => ({
|
|
31
|
-
timestamp: new Date().toISOString(),
|
|
32
|
-
level: 'info',
|
|
33
|
-
message,
|
|
34
|
-
data: { index },
|
|
35
|
-
}));
|
|
36
|
-
return { logs: logEntries };
|
|
37
|
-
}
|
|
38
|
-
}),
|
|
39
|
-
getTaskExecutions: publicProcedure.input(TaskIdSchema).query(async ({ input }) => {
|
|
40
|
-
return vibingOrchestrator.getTaskExecutions(input.taskId);
|
|
41
|
-
}),
|
|
42
|
-
getTaskExecutionStats: publicProcedure.query(async () => {
|
|
43
|
-
return vibingOrchestrator.getExecutionStats();
|
|
44
|
-
}),
|
|
45
|
-
improveTask: publicProcedure
|
|
46
|
-
.input(z.object({
|
|
47
|
-
taskId: z.string(),
|
|
48
|
-
title: z.string(),
|
|
49
|
-
type: z.enum(['feature', 'bug', 'chore', 'refactor', 'test', 'doc']),
|
|
50
|
-
priority: z.enum(['low', 'medium', 'high']),
|
|
51
|
-
content: z.string(),
|
|
52
|
-
executionId: z.string().optional(),
|
|
53
|
-
}))
|
|
54
|
-
.mutation(async ({ input }) => {
|
|
55
|
-
assertTaskActive(input.taskId);
|
|
56
|
-
const { executionId } = await vibingOrchestrator.startTaskImprovement(input.taskId, {
|
|
57
|
-
title: input.title,
|
|
58
|
-
type: input.type,
|
|
59
|
-
priority: input.priority,
|
|
60
|
-
content: input.content,
|
|
61
|
-
}, { executionId: input.executionId });
|
|
62
|
-
return { executionId };
|
|
63
|
-
}),
|
|
64
|
-
onExecutionUpdate: publicProcedure
|
|
65
|
-
.input(z.object({ executionId: z.string() }))
|
|
66
|
-
.subscription(async function* (opts) {
|
|
67
|
-
const input = opts.input;
|
|
68
|
-
// Emit initial status if exists
|
|
69
|
-
const initial = vibingOrchestrator.getExecutionStatus(input.executionId);
|
|
70
|
-
if (initial) {
|
|
71
|
-
yield {
|
|
72
|
-
executionId: initial.id,
|
|
73
|
-
status: initial.status,
|
|
74
|
-
logs: initial.logs,
|
|
75
|
-
error: initial.error,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
const proxy = new EventEmitter();
|
|
79
|
-
const handleUpdate = (update) => {
|
|
80
|
-
if (update.executionId === input.executionId)
|
|
81
|
-
proxy.emit('data', update);
|
|
82
|
-
};
|
|
83
|
-
vibingOrchestrator.on('executionUpdated', handleUpdate);
|
|
84
|
-
try {
|
|
85
|
-
for await (const [payload] of on(proxy, 'data', { signal: opts.signal })) {
|
|
86
|
-
yield payload;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
finally {
|
|
90
|
-
vibingOrchestrator.off('executionUpdated', handleUpdate);
|
|
91
|
-
}
|
|
92
|
-
}),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { TaskService } from '../../tasks/task-service.js';
|
|
2
|
-
import type { GitService } from '../../vcs/git-service.js';
|
|
3
|
-
export declare function buildGitRoutes(taskService: TaskService, gitService: GitService): {
|
|
4
|
-
readonly getGitStatus: import("@trpc/server").TRPCQueryProcedure<{
|
|
5
|
-
input: void;
|
|
6
|
-
output: {
|
|
7
|
-
current: string;
|
|
8
|
-
staged: string[];
|
|
9
|
-
modified: string[];
|
|
10
|
-
untracked: string[];
|
|
11
|
-
ahead: number;
|
|
12
|
-
behind: number;
|
|
13
|
-
};
|
|
14
|
-
meta: object;
|
|
15
|
-
}>;
|
|
16
|
-
readonly createBranch: import("@trpc/server").TRPCMutationProcedure<{
|
|
17
|
-
input: {
|
|
18
|
-
taskId: string;
|
|
19
|
-
baseBranch?: string | undefined;
|
|
20
|
-
};
|
|
21
|
-
output: import("../../vcs/git-service.js").BranchInfo;
|
|
22
|
-
meta: object;
|
|
23
|
-
}>;
|
|
24
|
-
readonly commitChanges: import("@trpc/server").TRPCMutationProcedure<{
|
|
25
|
-
input: {
|
|
26
|
-
taskId: string;
|
|
27
|
-
message?: string | undefined;
|
|
28
|
-
files?: string[] | undefined;
|
|
29
|
-
};
|
|
30
|
-
output: import("../../vcs/git-service.js").CommitInfo;
|
|
31
|
-
meta: object;
|
|
32
|
-
}>;
|
|
33
|
-
readonly getCommitHistory: import("@trpc/server").TRPCQueryProcedure<{
|
|
34
|
-
input: {
|
|
35
|
-
maxCount?: number | undefined;
|
|
36
|
-
};
|
|
37
|
-
output: import("../../vcs/git-service.js").CommitInfo[];
|
|
38
|
-
meta: object;
|
|
39
|
-
}>;
|
|
40
|
-
readonly hasUncommittedChanges: import("@trpc/server").TRPCQueryProcedure<{
|
|
41
|
-
input: void;
|
|
42
|
-
output: boolean;
|
|
43
|
-
meta: object;
|
|
44
|
-
}>;
|
|
45
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { publicProcedure } from '../trpc.js';
|
|
3
|
-
import { makeAssertTaskActive } from '../router-helpers.js';
|
|
4
|
-
export function buildGitRoutes(taskService, gitService) {
|
|
5
|
-
const assertTaskActive = makeAssertTaskActive(taskService);
|
|
6
|
-
return {
|
|
7
|
-
getGitStatus: publicProcedure.query(async () => {
|
|
8
|
-
return await gitService.getStatus();
|
|
9
|
-
}),
|
|
10
|
-
createBranch: publicProcedure
|
|
11
|
-
.input(z.object({ taskId: z.string(), baseBranch: z.string().optional() }))
|
|
12
|
-
.mutation(async ({ input }) => {
|
|
13
|
-
const task = assertTaskActive(input.taskId);
|
|
14
|
-
return await gitService.createBranch(task, input.baseBranch);
|
|
15
|
-
}),
|
|
16
|
-
commitChanges: publicProcedure
|
|
17
|
-
.input(z.object({
|
|
18
|
-
taskId: z.string(),
|
|
19
|
-
message: z.string().optional(),
|
|
20
|
-
files: z.array(z.string()).optional(),
|
|
21
|
-
}))
|
|
22
|
-
.mutation(async ({ input }) => {
|
|
23
|
-
const task = assertTaskActive(input.taskId);
|
|
24
|
-
return await gitService.commitChanges(task, input.message, input.files);
|
|
25
|
-
}),
|
|
26
|
-
getCommitHistory: publicProcedure
|
|
27
|
-
.input(z.object({ maxCount: z.number().optional() }))
|
|
28
|
-
.query(async ({ input }) => {
|
|
29
|
-
return await gitService.getCommitHistory(input.maxCount);
|
|
30
|
-
}),
|
|
31
|
-
hasUncommittedChanges: publicProcedure.query(async () => {
|
|
32
|
-
return await gitService.hasUncommittedChanges();
|
|
33
|
-
}),
|
|
34
|
-
};
|
|
35
|
-
}
|