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
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server Bootstrap - Async-first service initialization
|
|
3
|
+
*
|
|
4
|
+
* Provides ordered initialization of core services before router creation,
|
|
5
|
+
* ensuring all dependencies are ready for synchronous access during runtime.
|
|
6
|
+
*/
|
|
7
|
+
import { log } from '../logger.js';
|
|
8
|
+
import { getSettingsService } from '../../settings-service.js';
|
|
9
|
+
import { TaskService } from '../../tasks/task-service.js';
|
|
10
|
+
import { AgentService } from '../../agent/agent-service.js';
|
|
11
|
+
import { GitService } from '../../vcs/git-service.js';
|
|
12
|
+
import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
|
|
13
|
+
import { getProjectRoot, getVibeDir } from './project-root.js';
|
|
14
|
+
// Ready-only service instances - throw if accessed before bootstrap
|
|
15
|
+
let settingsService = null;
|
|
16
|
+
let taskService = null;
|
|
17
|
+
let agentService = null;
|
|
18
|
+
let gitService = null;
|
|
19
|
+
let worktreeService = null;
|
|
20
|
+
let vibingOrchestrator = null;
|
|
21
|
+
// Bootstrap completion promise for diagnostics/tests
|
|
22
|
+
let ready = null;
|
|
23
|
+
let isBootstrapped = false;
|
|
24
|
+
// Default config fallback for VibingOrchestrator
|
|
25
|
+
const getDefaultVibingConfig = () => ({
|
|
26
|
+
autoQualityChecks: true,
|
|
27
|
+
requireHumanApproval: true,
|
|
28
|
+
aiCodeReview: true,
|
|
29
|
+
retryPolicy: { maxImplementationAttempts: 3 },
|
|
30
|
+
autoCommit: false,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Initialize core services in proper dependency order.
|
|
34
|
+
* Must be called before any service getters or router creation.
|
|
35
|
+
*/
|
|
36
|
+
export async function bootstrap() {
|
|
37
|
+
if (isBootstrapped) {
|
|
38
|
+
log.info('Bootstrap already completed, skipping');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (ready) {
|
|
42
|
+
log.info('Bootstrap already in progress, waiting...');
|
|
43
|
+
return ready;
|
|
44
|
+
}
|
|
45
|
+
const startTime = Date.now();
|
|
46
|
+
log.info('Starting server bootstrap', {}, 'bootstrap');
|
|
47
|
+
ready = (async () => {
|
|
48
|
+
try {
|
|
49
|
+
// Stage 1: Settings Service (foundation)
|
|
50
|
+
const settingsStart = Date.now();
|
|
51
|
+
settingsService = getSettingsService();
|
|
52
|
+
log.info('Settings service initialized', {
|
|
53
|
+
duration: Date.now() - settingsStart,
|
|
54
|
+
}, 'bootstrap');
|
|
55
|
+
// Stage 2: Task Service (depends on settings for vibeDir)
|
|
56
|
+
const taskStart = Date.now();
|
|
57
|
+
const settingsVibeDir = (() => {
|
|
58
|
+
try {
|
|
59
|
+
const s = settingsService.getSettings();
|
|
60
|
+
return s?.development?.vibeDir;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
})();
|
|
66
|
+
const vibeDir = settingsVibeDir ?? getVibeDir();
|
|
67
|
+
taskService = new TaskService(vibeDir);
|
|
68
|
+
await taskService.ensureInitialized();
|
|
69
|
+
log.info('Task service initialized', {
|
|
70
|
+
vibeDir,
|
|
71
|
+
duration: Date.now() - taskStart,
|
|
72
|
+
}, 'bootstrap');
|
|
73
|
+
// Stage 3: Git Service (independent)
|
|
74
|
+
const gitStart = Date.now();
|
|
75
|
+
const projectRoot = getProjectRoot();
|
|
76
|
+
const settingsDefaultBranch = (() => {
|
|
77
|
+
try {
|
|
78
|
+
const s = settingsService.getSettings();
|
|
79
|
+
return s?.development?.git?.defaultBranch;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
})();
|
|
85
|
+
const gitConfig = {
|
|
86
|
+
defaultBranch: settingsDefaultBranch || 'main',
|
|
87
|
+
};
|
|
88
|
+
gitService = new GitService(projectRoot, gitConfig);
|
|
89
|
+
log.info('Git service initialized', {
|
|
90
|
+
projectRoot,
|
|
91
|
+
defaultBranch: gitConfig.defaultBranch,
|
|
92
|
+
duration: Date.now() - gitStart,
|
|
93
|
+
}, 'bootstrap');
|
|
94
|
+
// Stage 4: Agent Service (depends on task service)
|
|
95
|
+
const agentStart = Date.now();
|
|
96
|
+
agentService = new AgentService(taskService, projectRoot);
|
|
97
|
+
log.info('Agent service initialized', {
|
|
98
|
+
duration: Date.now() - agentStart,
|
|
99
|
+
}, 'bootstrap');
|
|
100
|
+
// Stage 5: Worktree Service (depends on git service, settings)
|
|
101
|
+
const worktreeStart = Date.now();
|
|
102
|
+
worktreeService = agentService.getWorktreeService();
|
|
103
|
+
await worktreeService.initialize();
|
|
104
|
+
log.info('Worktree service initialized', {
|
|
105
|
+
duration: Date.now() - worktreeStart,
|
|
106
|
+
}, 'bootstrap');
|
|
107
|
+
// Stage 6: VibingOrchestrator (depends on all previous services)
|
|
108
|
+
const orchestratorStart = Date.now();
|
|
109
|
+
vibingOrchestrator = new VibingOrchestrator(taskService, agentService, worktreeService, getDefaultVibingConfig(), gitService);
|
|
110
|
+
await vibingOrchestrator.initialize();
|
|
111
|
+
log.info('VibingOrchestrator initialized', {
|
|
112
|
+
duration: Date.now() - orchestratorStart,
|
|
113
|
+
}, 'bootstrap');
|
|
114
|
+
isBootstrapped = true;
|
|
115
|
+
const totalDuration = Date.now() - startTime;
|
|
116
|
+
log.info('Server bootstrap completed', {
|
|
117
|
+
totalDuration,
|
|
118
|
+
stages: 6,
|
|
119
|
+
}, 'bootstrap');
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
log.error('Server bootstrap failed', error, 'bootstrap');
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
})();
|
|
126
|
+
return ready;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Ready-only sync getters - throw if called before bootstrap
|
|
130
|
+
*/
|
|
131
|
+
export function getBootstrappedSettingsService() {
|
|
132
|
+
if (!settingsService) {
|
|
133
|
+
throw new Error('Settings service not available - bootstrap() must be called first');
|
|
134
|
+
}
|
|
135
|
+
return settingsService;
|
|
136
|
+
}
|
|
137
|
+
export function getBootstrappedTaskService() {
|
|
138
|
+
if (!taskService) {
|
|
139
|
+
throw new Error('Task service not available - bootstrap() must be called first');
|
|
140
|
+
}
|
|
141
|
+
return taskService;
|
|
142
|
+
}
|
|
143
|
+
export function getBootstrappedAgentService() {
|
|
144
|
+
if (!agentService) {
|
|
145
|
+
throw new Error('Agent service not available - bootstrap() must be called first');
|
|
146
|
+
}
|
|
147
|
+
return agentService;
|
|
148
|
+
}
|
|
149
|
+
export function getBootstrappedGitService() {
|
|
150
|
+
if (!gitService) {
|
|
151
|
+
throw new Error('Git service not available - bootstrap() must be called first');
|
|
152
|
+
}
|
|
153
|
+
return gitService;
|
|
154
|
+
}
|
|
155
|
+
export function getBootstrappedWorktreeService() {
|
|
156
|
+
if (!worktreeService) {
|
|
157
|
+
throw new Error('Worktree service not available - bootstrap() must be called first');
|
|
158
|
+
}
|
|
159
|
+
return worktreeService;
|
|
160
|
+
}
|
|
161
|
+
export function getBootstrappedVibingOrchestrator() {
|
|
162
|
+
if (!vibingOrchestrator) {
|
|
163
|
+
throw new Error('VibingOrchestrator not available - bootstrap() must be called first');
|
|
164
|
+
}
|
|
165
|
+
return vibingOrchestrator;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Get bootstrap completion promise for diagnostics/tests
|
|
169
|
+
*/
|
|
170
|
+
export function getBootstrapReady() {
|
|
171
|
+
return ready;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Check if bootstrap has completed
|
|
175
|
+
*/
|
|
176
|
+
export function isBootstrapComplete() {
|
|
177
|
+
return isBootstrapped;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Test bootstrap function that initializes against a temp workspace
|
|
181
|
+
*/
|
|
182
|
+
export async function testBootstrap(tempWorkspace) {
|
|
183
|
+
// Reset bootstrap state for testing
|
|
184
|
+
settingsService = null;
|
|
185
|
+
taskService = null;
|
|
186
|
+
agentService = null;
|
|
187
|
+
gitService = null;
|
|
188
|
+
worktreeService = null;
|
|
189
|
+
vibingOrchestrator = null;
|
|
190
|
+
ready = null;
|
|
191
|
+
isBootstrapped = false;
|
|
192
|
+
// TODO: Implement temp workspace logic if needed
|
|
193
|
+
if (tempWorkspace) {
|
|
194
|
+
log.info('Test bootstrap with temp workspace', { tempWorkspace }, 'bootstrap');
|
|
195
|
+
}
|
|
196
|
+
return bootstrap();
|
|
197
|
+
}
|
|
@@ -8,7 +8,30 @@ import path from 'path';
|
|
|
8
8
|
export function getProjectRoot() {
|
|
9
9
|
const envRoot = process.env.VIBEMAN_PROJECT_ROOT;
|
|
10
10
|
if (envRoot && envRoot.trim().length > 0) {
|
|
11
|
-
|
|
11
|
+
const trimmedRoot = envRoot.trim();
|
|
12
|
+
if (path.isAbsolute(trimmedRoot)) {
|
|
13
|
+
return path.normalize(trimmedRoot);
|
|
14
|
+
}
|
|
15
|
+
const baseCandidates = [
|
|
16
|
+
process.env.VIBEMAN_PROJECT_ROOT_BASE,
|
|
17
|
+
process.env.INIT_CWD,
|
|
18
|
+
process.env.PWD,
|
|
19
|
+
process.cwd(),
|
|
20
|
+
].filter((candidate) => !!candidate && candidate.trim().length > 0);
|
|
21
|
+
let fallbackResolved = null;
|
|
22
|
+
for (const base of baseCandidates) {
|
|
23
|
+
const resolved = path.resolve(base, trimmedRoot);
|
|
24
|
+
if (!fallbackResolved) {
|
|
25
|
+
fallbackResolved = resolved;
|
|
26
|
+
}
|
|
27
|
+
if (fs.existsSync(resolved)) {
|
|
28
|
+
return resolved;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (fallbackResolved) {
|
|
32
|
+
return fallbackResolved;
|
|
33
|
+
}
|
|
34
|
+
return path.resolve(trimmedRoot);
|
|
12
35
|
}
|
|
13
36
|
// First preference: directory that contains a .git directory/file
|
|
14
37
|
let dir = process.cwd();
|
|
@@ -4,6 +4,98 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4
4
|
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
5
5
|
transformer: true;
|
|
6
6
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
7
|
+
detectAllProviders: import("@trpc/server").TRPCQueryProcedure<{
|
|
8
|
+
input: void;
|
|
9
|
+
output: Record<string, import("../provider-detection.js").DetectionResult>;
|
|
10
|
+
meta: object;
|
|
11
|
+
}>;
|
|
12
|
+
detectProvider: import("@trpc/server").TRPCQueryProcedure<{
|
|
13
|
+
input: {
|
|
14
|
+
provider: string;
|
|
15
|
+
};
|
|
16
|
+
output: import("../provider-detection.js").DetectionResult;
|
|
17
|
+
meta: object;
|
|
18
|
+
}>;
|
|
19
|
+
setProviderPath: import("@trpc/server").TRPCMutationProcedure<{
|
|
20
|
+
input: {
|
|
21
|
+
path: string;
|
|
22
|
+
provider: string;
|
|
23
|
+
};
|
|
24
|
+
output: {
|
|
25
|
+
success: boolean;
|
|
26
|
+
result: import("../provider-detection.js").DetectionResult;
|
|
27
|
+
};
|
|
28
|
+
meta: object;
|
|
29
|
+
}>;
|
|
30
|
+
clearProviderPath: import("@trpc/server").TRPCMutationProcedure<{
|
|
31
|
+
input: {
|
|
32
|
+
provider: string;
|
|
33
|
+
};
|
|
34
|
+
output: {
|
|
35
|
+
success: boolean;
|
|
36
|
+
};
|
|
37
|
+
meta: object;
|
|
38
|
+
}>;
|
|
39
|
+
getLocalConfigInfo: import("@trpc/server").TRPCQueryProcedure<{
|
|
40
|
+
input: void;
|
|
41
|
+
output: {
|
|
42
|
+
providers: {
|
|
43
|
+
'claude-code'?: {
|
|
44
|
+
binPath?: string | undefined;
|
|
45
|
+
detectedPath?: string | undefined;
|
|
46
|
+
lastDetected?: string | undefined;
|
|
47
|
+
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
codex?: {
|
|
50
|
+
binPath?: string | undefined;
|
|
51
|
+
detectedPath?: string | undefined;
|
|
52
|
+
lastDetected?: string | undefined;
|
|
53
|
+
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
};
|
|
56
|
+
path: string;
|
|
57
|
+
exists: boolean;
|
|
58
|
+
size?: number;
|
|
59
|
+
};
|
|
60
|
+
meta: object;
|
|
61
|
+
}>;
|
|
62
|
+
clearValidationCache: import("@trpc/server").TRPCMutationProcedure<{
|
|
63
|
+
input: void;
|
|
64
|
+
output: {
|
|
65
|
+
success: boolean;
|
|
66
|
+
};
|
|
67
|
+
meta: object;
|
|
68
|
+
}>;
|
|
69
|
+
getProviderDiagnostics: import("@trpc/server").TRPCQueryProcedure<{
|
|
70
|
+
input: void;
|
|
71
|
+
output: {
|
|
72
|
+
localConfigPath: string;
|
|
73
|
+
localConfigExists: boolean;
|
|
74
|
+
providers: {
|
|
75
|
+
provider: string;
|
|
76
|
+
detection: import("../provider-detection.js").DetectionResult;
|
|
77
|
+
localConfig: {
|
|
78
|
+
binPath?: string | undefined;
|
|
79
|
+
detectedPath?: string | undefined;
|
|
80
|
+
lastDetected?: string | undefined;
|
|
81
|
+
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
82
|
+
} | {
|
|
83
|
+
binPath?: string | undefined;
|
|
84
|
+
detectedPath?: string | undefined;
|
|
85
|
+
lastDetected?: string | undefined;
|
|
86
|
+
detectionMethod?: "explicit" | "PATH" | "common-location" | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
cached: {
|
|
89
|
+
available: boolean;
|
|
90
|
+
error: string | undefined;
|
|
91
|
+
version: string | undefined;
|
|
92
|
+
checkedAt: string;
|
|
93
|
+
isFresh: boolean;
|
|
94
|
+
} | null;
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
meta: object;
|
|
98
|
+
}>;
|
|
7
99
|
listProviders: import("@trpc/server").TRPCQueryProcedure<{
|
|
8
100
|
input: void;
|
|
9
101
|
output: {
|
|
@@ -25,19 +117,31 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
25
117
|
}>;
|
|
26
118
|
getRoutingPolicy: import("@trpc/server").TRPCQueryProcedure<{
|
|
27
119
|
input: void;
|
|
28
|
-
output:
|
|
120
|
+
output: {
|
|
121
|
+
defaultProvider: string;
|
|
122
|
+
operations?: Partial<Record<"execute_task" | "quality_checks" | "improve_task" | "ai_merge" | "ai_codereview", {
|
|
123
|
+
provider: string;
|
|
124
|
+
options?: {
|
|
125
|
+
temperature?: number | undefined;
|
|
126
|
+
maxTokens?: number | undefined;
|
|
127
|
+
tools?: string[] | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
model?: string | undefined;
|
|
130
|
+
fallback?: string[] | undefined;
|
|
131
|
+
}>> | undefined;
|
|
132
|
+
};
|
|
29
133
|
meta: object;
|
|
30
134
|
}>;
|
|
31
135
|
updateRoutingPolicy: import("@trpc/server").TRPCMutationProcedure<{
|
|
32
136
|
input: {
|
|
33
137
|
policy: {
|
|
34
138
|
defaultProvider?: string | undefined;
|
|
35
|
-
operations?: Partial<Record<"execute_task" | "
|
|
139
|
+
operations?: Partial<Record<"execute_task" | "quality_checks" | "improve_task" | "ai_merge" | "ai_codereview", {
|
|
36
140
|
provider: string;
|
|
37
141
|
options?: {
|
|
142
|
+
temperature?: number | undefined;
|
|
38
143
|
maxTokens?: number | undefined;
|
|
39
144
|
tools?: string[] | undefined;
|
|
40
|
-
temperature?: number | undefined;
|
|
41
145
|
} | undefined;
|
|
42
146
|
model?: string | undefined;
|
|
43
147
|
fallback?: string[] | undefined;
|
|
@@ -62,17 +166,17 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
62
166
|
}>;
|
|
63
167
|
setOperationConfig: import("@trpc/server").TRPCMutationProcedure<{
|
|
64
168
|
input: {
|
|
169
|
+
operation: "execute_task" | "quality_checks" | "improve_task" | "ai_merge" | "ai_codereview";
|
|
65
170
|
config: {
|
|
66
171
|
provider: string;
|
|
67
172
|
options?: {
|
|
173
|
+
temperature?: number | undefined;
|
|
68
174
|
maxTokens?: number | undefined;
|
|
69
175
|
tools?: string[] | undefined;
|
|
70
|
-
temperature?: number | undefined;
|
|
71
176
|
} | undefined;
|
|
72
177
|
model?: string | undefined;
|
|
73
178
|
fallback?: string[] | undefined;
|
|
74
179
|
};
|
|
75
|
-
operation: "execute_task" | "improve_task" | "ai_codereview" | "ai_merge";
|
|
76
180
|
};
|
|
77
181
|
output: {
|
|
78
182
|
success: boolean;
|
|
@@ -241,24 +345,25 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
241
345
|
}>;
|
|
242
346
|
updateWorkflowOptions: import("@trpc/server").TRPCMutationProcedure<{
|
|
243
347
|
input: {
|
|
348
|
+
workflowId: string;
|
|
244
349
|
config: {
|
|
350
|
+
autoCommit?: boolean | undefined;
|
|
351
|
+
createPR?: boolean | undefined;
|
|
245
352
|
autoQualityChecks?: boolean | undefined;
|
|
246
353
|
requireHumanApproval?: boolean | undefined;
|
|
247
|
-
aiCodeReview?: boolean | undefined;
|
|
248
|
-
autoCommit?: boolean | undefined;
|
|
249
354
|
stepByStepMode?: boolean | undefined;
|
|
250
|
-
createPR?: boolean | undefined;
|
|
251
355
|
autoMerge?: boolean | undefined;
|
|
356
|
+
aiCodeReview?: boolean | undefined;
|
|
252
357
|
aiRoutingOverrides?: {
|
|
253
358
|
execute_task?: {
|
|
254
359
|
provider?: string | undefined;
|
|
255
360
|
model?: string | undefined;
|
|
256
361
|
} | undefined;
|
|
257
|
-
|
|
362
|
+
quality_checks?: {
|
|
258
363
|
provider?: string | undefined;
|
|
259
364
|
model?: string | undefined;
|
|
260
365
|
} | undefined;
|
|
261
|
-
|
|
366
|
+
improve_task?: {
|
|
262
367
|
provider?: string | undefined;
|
|
263
368
|
model?: string | undefined;
|
|
264
369
|
} | undefined;
|
|
@@ -266,9 +371,12 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
266
371
|
provider?: string | undefined;
|
|
267
372
|
model?: string | undefined;
|
|
268
373
|
} | undefined;
|
|
374
|
+
ai_codereview?: {
|
|
375
|
+
provider?: string | undefined;
|
|
376
|
+
model?: string | undefined;
|
|
377
|
+
} | undefined;
|
|
269
378
|
} | undefined;
|
|
270
379
|
};
|
|
271
|
-
workflowId: string;
|
|
272
380
|
};
|
|
273
381
|
output: {
|
|
274
382
|
readonly success: true;
|
|
@@ -279,23 +387,23 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
279
387
|
input: {
|
|
280
388
|
taskId: string;
|
|
281
389
|
config?: {
|
|
390
|
+
autoCommit?: boolean | undefined;
|
|
391
|
+
createPR?: boolean | undefined;
|
|
282
392
|
autoQualityChecks?: boolean | undefined;
|
|
283
393
|
requireHumanApproval?: boolean | undefined;
|
|
284
|
-
aiCodeReview?: boolean | undefined;
|
|
285
|
-
autoCommit?: boolean | undefined;
|
|
286
394
|
stepByStepMode?: boolean | undefined;
|
|
287
|
-
createPR?: boolean | undefined;
|
|
288
395
|
autoMerge?: boolean | undefined;
|
|
396
|
+
aiCodeReview?: boolean | undefined;
|
|
289
397
|
aiRoutingOverrides?: {
|
|
290
398
|
execute_task?: {
|
|
291
399
|
provider?: string | undefined;
|
|
292
400
|
model?: string | undefined;
|
|
293
401
|
} | undefined;
|
|
294
|
-
|
|
402
|
+
quality_checks?: {
|
|
295
403
|
provider?: string | undefined;
|
|
296
404
|
model?: string | undefined;
|
|
297
405
|
} | undefined;
|
|
298
|
-
|
|
406
|
+
improve_task?: {
|
|
299
407
|
provider?: string | undefined;
|
|
300
408
|
model?: string | undefined;
|
|
301
409
|
} | undefined;
|
|
@@ -303,6 +411,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
303
411
|
provider?: string | undefined;
|
|
304
412
|
model?: string | undefined;
|
|
305
413
|
} | undefined;
|
|
414
|
+
ai_codereview?: {
|
|
415
|
+
provider?: string | undefined;
|
|
416
|
+
model?: string | undefined;
|
|
417
|
+
} | undefined;
|
|
306
418
|
} | undefined;
|
|
307
419
|
} | undefined;
|
|
308
420
|
};
|
|
@@ -423,12 +535,12 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
423
535
|
output: import("../../types/index.js").VibingExecution | null;
|
|
424
536
|
meta: object;
|
|
425
537
|
}>;
|
|
426
|
-
|
|
538
|
+
aiReviewCode: import("@trpc/server").TRPCMutationProcedure<{
|
|
427
539
|
input: {
|
|
428
540
|
taskId: string;
|
|
429
541
|
provider?: string | undefined;
|
|
430
|
-
model?: string | undefined;
|
|
431
542
|
workflowId?: string | undefined;
|
|
543
|
+
model?: string | undefined;
|
|
432
544
|
reviewContext?: string | undefined;
|
|
433
545
|
};
|
|
434
546
|
output: {
|
|
@@ -583,9 +695,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
583
695
|
cleanupWorktree: import("@trpc/server").TRPCMutationProcedure<{
|
|
584
696
|
input: {
|
|
585
697
|
isConnectedToTask: boolean;
|
|
586
|
-
worktreePath?: string | undefined;
|
|
587
|
-
force?: boolean | undefined;
|
|
588
698
|
taskId?: string | undefined;
|
|
699
|
+
force?: boolean | undefined;
|
|
700
|
+
worktreePath?: string | undefined;
|
|
589
701
|
branchName?: string | undefined;
|
|
590
702
|
};
|
|
591
703
|
output: {
|
|
@@ -653,9 +765,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
653
765
|
}>;
|
|
654
766
|
improveTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
655
767
|
input: {
|
|
768
|
+
title: string;
|
|
656
769
|
type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
|
|
657
770
|
priority: "low" | "medium" | "high";
|
|
658
|
-
title: string;
|
|
659
771
|
content: string;
|
|
660
772
|
taskId: string;
|
|
661
773
|
executionId?: string | undefined;
|
|
@@ -664,6 +776,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
664
776
|
type: string;
|
|
665
777
|
priority: string;
|
|
666
778
|
content: string;
|
|
779
|
+
title?: string;
|
|
667
780
|
executionId: string;
|
|
668
781
|
selectedModel?: string;
|
|
669
782
|
};
|
|
@@ -683,11 +796,11 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
683
796
|
}>;
|
|
684
797
|
listTasks: import("@trpc/server").TRPCQueryProcedure<{
|
|
685
798
|
input: {
|
|
799
|
+
status?: "review" | "in-progress" | "backlog" | "done" | undefined;
|
|
686
800
|
type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
|
|
687
|
-
|
|
801
|
+
tags?: string[] | undefined;
|
|
688
802
|
priority?: "low" | "medium" | "high" | undefined;
|
|
689
803
|
search?: string | undefined;
|
|
690
|
-
tags?: string[] | undefined;
|
|
691
804
|
includeDeleted?: boolean | undefined;
|
|
692
805
|
onlyDeleted?: boolean | undefined;
|
|
693
806
|
} | undefined;
|
|
@@ -703,15 +816,15 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
703
816
|
}>;
|
|
704
817
|
createTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
705
818
|
input: {
|
|
706
|
-
type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
|
|
707
819
|
title: string;
|
|
820
|
+
type: "feature" | "bug" | "chore" | "refactor" | "test" | "doc";
|
|
708
821
|
content: string;
|
|
709
|
-
status?: "
|
|
710
|
-
priority?: "low" | "medium" | "high" | undefined;
|
|
822
|
+
status?: "review" | "in-progress" | "backlog" | "done" | undefined;
|
|
711
823
|
id?: string | undefined;
|
|
712
824
|
tags?: string[] | undefined;
|
|
713
825
|
due_date?: string | undefined;
|
|
714
826
|
assignee?: string[] | undefined;
|
|
827
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
715
828
|
comments?: string[] | undefined;
|
|
716
829
|
};
|
|
717
830
|
output: import("../../types/index.js").Task;
|
|
@@ -720,13 +833,13 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
720
833
|
updateTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
721
834
|
input: {
|
|
722
835
|
id: string;
|
|
723
|
-
|
|
724
|
-
status?: "backlog" | "in-progress" | "review" | "done" | undefined;
|
|
725
|
-
priority?: "low" | "medium" | "high" | undefined;
|
|
836
|
+
status?: "review" | "in-progress" | "backlog" | "done" | undefined;
|
|
726
837
|
title?: string | undefined;
|
|
838
|
+
type?: "feature" | "bug" | "chore" | "refactor" | "test" | "doc" | undefined;
|
|
727
839
|
tags?: string[] | undefined;
|
|
728
840
|
due_date?: string | undefined;
|
|
729
841
|
assignee?: string[] | undefined;
|
|
842
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
730
843
|
comments?: string[] | undefined;
|
|
731
844
|
content?: string | undefined;
|
|
732
845
|
deleted_at?: string | undefined;
|
|
@@ -745,7 +858,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
745
858
|
}>;
|
|
746
859
|
moveTask: import("@trpc/server").TRPCMutationProcedure<{
|
|
747
860
|
input: {
|
|
748
|
-
status: "
|
|
861
|
+
status: "review" | "in-progress" | "backlog" | "done";
|
|
749
862
|
id: string;
|
|
750
863
|
};
|
|
751
864
|
output: import("../../types/index.js").Task;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRouter } from '../../router.js';
|
|
2
|
-
import {
|
|
3
|
-
import { getGitService } from '../server/git-service-singleton.js';
|
|
4
|
-
import { getVibingOrchestrator, getVibingOrchestratorAsync, } from '../server/vibing-orchestrator-singleton.js';
|
|
2
|
+
import { bootstrap, getBootstrappedTaskService, getBootstrappedGitService, getBootstrappedVibingOrchestrator, } from '../server/bootstrap.js';
|
|
5
3
|
// Build the application router for use by the standalone API server.
|
|
6
4
|
// Note: This module no longer starts any WebSocket servers automatically.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
5
|
+
// Services must be bootstrapped before calling this.
|
|
6
|
+
// Ensure bootstrap is complete before creating router
|
|
7
|
+
await bootstrap();
|
|
8
|
+
const taskService = getBootstrappedTaskService();
|
|
9
|
+
const gitService = getBootstrappedGitService();
|
|
10
|
+
const workflowOrchestrator = getBootstrappedVibingOrchestrator();
|
|
11
|
+
export const appRouter = createRouter(taskService, gitService, workflowOrchestrator);
|
|
@@ -5,9 +5,9 @@ export function startTRPCWebSocketServer(router) {
|
|
|
5
5
|
if (typeof global.__VIBEMAN_WSS__ === 'object' && global.__VIBEMAN_WSS__?.started) {
|
|
6
6
|
return; // already started
|
|
7
7
|
}
|
|
8
|
-
// Decide WS port:
|
|
8
|
+
// Decide WS port: (+1) from HTTP port
|
|
9
9
|
const httpPort = Number(process.env.PORT || 3000);
|
|
10
|
-
const wsPort =
|
|
10
|
+
const wsPort = httpPort + 1;
|
|
11
11
|
try {
|
|
12
12
|
const wss = new WebSocketServer({ port: wsPort, path: '/api/trpc' });
|
|
13
13
|
// Handle binding errors gracefully (e.g., EADDRINUSE across HMR workers)
|