vibeman 0.0.5 → 0.0.6
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 +49 -0
- package/dist/cli.js +135 -0
- package/dist/ui/index-gnk6rhxs.js +9 -0
- package/dist/ui/index.html +10 -0
- package/dist/ui/index.js +2 -0
- package/package.json +10 -46
- package/README.md +0 -12
- package/dist/index.js +0 -114
- 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,197 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { GitService } from '../../vcs/git-service.js';
|
|
2
|
-
import { getSettingsService } from '../../settings-service.js';
|
|
3
|
-
import { getProjectRoot, getVibeDir } from './project-root.js';
|
|
4
|
-
export function getGitService(config) {
|
|
5
|
-
if (!globalThis.__vibeman_git_service__) {
|
|
6
|
-
// Resolve project root robustly (handles being launched from apps/api)
|
|
7
|
-
const projectRoot = getProjectRoot();
|
|
8
|
-
// Get vibeDir from settings, fallback to detected project .vibeman
|
|
9
|
-
const settingsVibeDir = (() => {
|
|
10
|
-
try {
|
|
11
|
-
const svc = getSettingsService();
|
|
12
|
-
const s = svc.getSettings();
|
|
13
|
-
return s?.development?.vibeDir;
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
})();
|
|
19
|
-
const vibeDir = settingsVibeDir || getVibeDir();
|
|
20
|
-
// Prefer settings default branch; fall back to 'main'
|
|
21
|
-
const settingsDefaultBranch = (() => {
|
|
22
|
-
try {
|
|
23
|
-
const svc = getSettingsService();
|
|
24
|
-
// Best effort; initialize may not have been awaited here
|
|
25
|
-
// but service returns defaults if not yet loaded from disk
|
|
26
|
-
const s = svc.getSettings();
|
|
27
|
-
return s?.development?.git?.defaultBranch;
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
})();
|
|
33
|
-
const envConfig = {
|
|
34
|
-
defaultBranch: settingsDefaultBranch || 'main',
|
|
35
|
-
};
|
|
36
|
-
globalThis.__vibeman_git_service__ = new GitService(projectRoot, {
|
|
37
|
-
...envConfig,
|
|
38
|
-
...config,
|
|
39
|
-
});
|
|
40
|
-
const settingsInfo = { defaultBranch: envConfig.defaultBranch };
|
|
41
|
-
console.log(`🔧 Git Service initialized (root=${projectRoot}, vibeDir=${vibeDir}, defaultBranch=${settingsInfo.defaultBranch})`);
|
|
42
|
-
}
|
|
43
|
-
return globalThis.__vibeman_git_service__;
|
|
44
|
-
}
|
|
45
|
-
export function resetGitService() {
|
|
46
|
-
globalThis.__vibeman_git_service__ = undefined;
|
|
47
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
// Find the repository project root by walking up from CWD
|
|
4
|
-
// Preference order:
|
|
5
|
-
// - env VIBEMAN_PROJECT_ROOT
|
|
6
|
-
// - nearest directory containing .git or .vibeman
|
|
7
|
-
// - fallback to process.cwd()
|
|
8
|
-
export function getProjectRoot() {
|
|
9
|
-
const envRoot = process.env.VIBEMAN_PROJECT_ROOT;
|
|
10
|
-
if (envRoot && envRoot.trim().length > 0) {
|
|
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);
|
|
35
|
-
}
|
|
36
|
-
// First preference: directory that contains a .git directory/file
|
|
37
|
-
let dir = process.cwd();
|
|
38
|
-
const { root } = path.parse(dir);
|
|
39
|
-
while (true) {
|
|
40
|
-
if (fs.existsSync(path.join(dir, '.git'))) {
|
|
41
|
-
return dir;
|
|
42
|
-
}
|
|
43
|
-
if (dir === root)
|
|
44
|
-
break;
|
|
45
|
-
dir = path.dirname(dir);
|
|
46
|
-
}
|
|
47
|
-
// Fallback: nearest directory with .vibeman (if repo is checked out without .git, e.g. tarball)
|
|
48
|
-
dir = process.cwd();
|
|
49
|
-
while (true) {
|
|
50
|
-
if (fs.existsSync(path.join(dir, '.vibeman'))) {
|
|
51
|
-
return dir;
|
|
52
|
-
}
|
|
53
|
-
if (dir === root)
|
|
54
|
-
break;
|
|
55
|
-
dir = path.dirname(dir);
|
|
56
|
-
}
|
|
57
|
-
return process.cwd();
|
|
58
|
-
}
|
|
59
|
-
export function getVibeDir() {
|
|
60
|
-
return path.join(getProjectRoot(), '.vibeman');
|
|
61
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TaskService } from '../../tasks/task-service.js';
|
|
2
|
-
declare global {
|
|
3
|
-
var __vibeman_task_service__: unknown;
|
|
4
|
-
var __vibeman_task_service_init__: unknown;
|
|
5
|
-
}
|
|
6
|
-
export declare function getTaskService(): TaskService;
|
|
7
|
-
export declare function getTaskServiceAsync(): Promise<TaskService>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { getSettingsService } from '../../settings-service.js';
|
|
2
|
-
import { TaskService } from '../../tasks/task-service.js';
|
|
3
|
-
import { isProduction } from '../../utils/env.js';
|
|
4
|
-
import { getVibeDir } from './project-root.js';
|
|
5
|
-
export function getTaskService() {
|
|
6
|
-
if (!globalThis.__vibeman_task_service__) {
|
|
7
|
-
const settingsVibeDir = (() => {
|
|
8
|
-
try {
|
|
9
|
-
const svc = getSettingsService();
|
|
10
|
-
const s = svc.getSettings();
|
|
11
|
-
return s?.development?.vibeDir;
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
})();
|
|
17
|
-
// Ensure we use the repo-level .vibeman even when launched from a subpackage
|
|
18
|
-
const vibeDir = settingsVibeDir ?? getVibeDir();
|
|
19
|
-
globalThis.__vibeman_task_service__ = new TaskService(vibeDir);
|
|
20
|
-
console.log(`🗂️ Task Service initialized (vibeDir=${vibeDir})`);
|
|
21
|
-
globalThis.__vibeman_task_service__
|
|
22
|
-
.ensureInitialized()
|
|
23
|
-
.catch((e) => console.error('TaskService init error:', e));
|
|
24
|
-
}
|
|
25
|
-
return globalThis.__vibeman_task_service__;
|
|
26
|
-
}
|
|
27
|
-
export async function getTaskServiceAsync() {
|
|
28
|
-
if (globalThis.__vibeman_task_service__) {
|
|
29
|
-
return globalThis.__vibeman_task_service__;
|
|
30
|
-
}
|
|
31
|
-
if (!globalThis.__vibeman_task_service_init__) {
|
|
32
|
-
const settingsVibeDir = (() => {
|
|
33
|
-
try {
|
|
34
|
-
const svc = getSettingsService();
|
|
35
|
-
const s = svc.getSettings();
|
|
36
|
-
return s?.development?.vibeDir;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
})();
|
|
42
|
-
const vibeDir = settingsVibeDir ?? getVibeDir();
|
|
43
|
-
globalThis.__vibeman_task_service__ = new TaskService(vibeDir);
|
|
44
|
-
globalThis.__vibeman_task_service_init__ = globalThis.__vibeman_task_service__
|
|
45
|
-
.initialize()
|
|
46
|
-
.then(() => globalThis.__vibeman_task_service__);
|
|
47
|
-
}
|
|
48
|
-
return globalThis.__vibeman_task_service_init__;
|
|
49
|
-
}
|
|
50
|
-
// Cleanup on process exit
|
|
51
|
-
if (isProduction()) {
|
|
52
|
-
process.on('SIGTERM', () => {
|
|
53
|
-
if (globalThis.__vibeman_task_service__) {
|
|
54
|
-
globalThis.__vibeman_task_service__.stop();
|
|
55
|
-
globalThis.__vibeman_task_service__ = undefined;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { simpleGit } from 'simple-git';
|
|
5
|
-
import { log } from '../logger.js';
|
|
6
|
-
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
function readPackageJson(pkgPath) {
|
|
8
|
-
try {
|
|
9
|
-
return JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
log.warn('Failed to read package.json', { error, path: pkgPath }, 'vibeman-info');
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function findGitRoot(startDir) {
|
|
17
|
-
let dir = startDir;
|
|
18
|
-
const { root } = path.parse(dir);
|
|
19
|
-
while (true) {
|
|
20
|
-
if (fs.existsSync(path.join(dir, '.git'))) {
|
|
21
|
-
return dir;
|
|
22
|
-
}
|
|
23
|
-
if (dir === root)
|
|
24
|
-
break;
|
|
25
|
-
dir = path.dirname(dir);
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
function findPackageRoot(startDir, packageName) {
|
|
30
|
-
let dir = startDir;
|
|
31
|
-
const { root } = path.parse(dir);
|
|
32
|
-
while (true) {
|
|
33
|
-
const pkgPath = path.join(dir, 'package.json');
|
|
34
|
-
if (fs.existsSync(pkgPath)) {
|
|
35
|
-
const pkg = readPackageJson(pkgPath);
|
|
36
|
-
if (pkg?.name === packageName) {
|
|
37
|
-
return dir;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (dir === root)
|
|
41
|
-
break;
|
|
42
|
-
dir = path.dirname(dir);
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
function readPackageVersion(pkgPath) {
|
|
47
|
-
const pkg = readPackageJson(pkgPath);
|
|
48
|
-
if (!pkg)
|
|
49
|
-
return undefined;
|
|
50
|
-
const version = pkg.version;
|
|
51
|
-
return typeof version === 'string' && version.trim().length > 0 ? version.trim() : undefined;
|
|
52
|
-
}
|
|
53
|
-
function resolveVibemanVersion(gitRoot, packageRoot) {
|
|
54
|
-
if (gitRoot) {
|
|
55
|
-
const cliPackage = path.join(gitRoot, 'apps', 'cli', 'package.json');
|
|
56
|
-
if (fs.existsSync(cliPackage)) {
|
|
57
|
-
const version = readPackageVersion(cliPackage);
|
|
58
|
-
if (version)
|
|
59
|
-
return version;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (packageRoot) {
|
|
63
|
-
const cliPackage = path.join(packageRoot, 'package.json');
|
|
64
|
-
if (fs.existsSync(cliPackage)) {
|
|
65
|
-
return readPackageVersion(cliPackage);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
export async function getVibemanInfo() {
|
|
71
|
-
const gitRoot = findGitRoot(moduleDir);
|
|
72
|
-
let gitShortHash;
|
|
73
|
-
if (gitRoot) {
|
|
74
|
-
try {
|
|
75
|
-
const hash = await simpleGit(gitRoot).revparse(['--short', 'HEAD']);
|
|
76
|
-
gitShortHash = hash.trim();
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
log.warn('Failed to resolve Vibeman git hash', { error, gitRoot }, 'vibeman-info');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const packageRoot = findPackageRoot(moduleDir, '@vibeman/cli');
|
|
83
|
-
const version = resolveVibemanVersion(gitRoot, packageRoot);
|
|
84
|
-
return { version, gitShortHash };
|
|
85
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
|
|
2
|
-
declare global {
|
|
3
|
-
var __vibeman_vibing_orchestrator__: unknown;
|
|
4
|
-
var __vibeman_vibing_orchestrator_init__: unknown;
|
|
5
|
-
}
|
|
6
|
-
export declare function getVibingOrchestrator(): VibingOrchestrator;
|
|
7
|
-
export declare function getVibingOrchestratorAsync(): Promise<VibingOrchestrator>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { VibingOrchestrator } from '../../workflows/vibing-orchestrator.js';
|
|
2
|
-
import { getTaskService } from './task-service-singleton.js';
|
|
3
|
-
import { getAgentService } from './agent-service-singleton.js';
|
|
4
|
-
import { getGitService } from './git-service-singleton.js';
|
|
5
|
-
import { isProduction } from '../../utils/env.js';
|
|
6
|
-
// Default config fallback for VibingOrchestrator
|
|
7
|
-
const getDefaultVibingConfig = () => ({
|
|
8
|
-
autoQualityChecks: true,
|
|
9
|
-
requireHumanApproval: true,
|
|
10
|
-
aiCodeReview: true,
|
|
11
|
-
retryPolicy: { maxImplementationAttempts: 3 },
|
|
12
|
-
autoCommit: false,
|
|
13
|
-
});
|
|
14
|
-
export function getVibingOrchestrator() {
|
|
15
|
-
if (!globalThis.__vibeman_vibing_orchestrator__) {
|
|
16
|
-
const taskService = getTaskService();
|
|
17
|
-
const agentService = getAgentService();
|
|
18
|
-
const gitService = getGitService();
|
|
19
|
-
globalThis.__vibeman_vibing_orchestrator__ = new VibingOrchestrator(taskService, agentService, agentService.getWorktreeService(), getDefaultVibingConfig(), gitService);
|
|
20
|
-
}
|
|
21
|
-
// Kick off one-time initialization in background (non-blocking)
|
|
22
|
-
if (!globalThis.__vibeman_vibing_orchestrator_init__) {
|
|
23
|
-
globalThis.__vibeman_vibing_orchestrator_init__ = globalThis.__vibeman_vibing_orchestrator__
|
|
24
|
-
.initialize()
|
|
25
|
-
.catch((e) => console.error('VibingOrchestrator init error:', e))
|
|
26
|
-
.finally(() => {
|
|
27
|
-
globalThis.__vibeman_vibing_orchestrator_init__ = undefined;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return globalThis.__vibeman_vibing_orchestrator__;
|
|
31
|
-
}
|
|
32
|
-
export async function getVibingOrchestratorAsync() {
|
|
33
|
-
if (globalThis.__vibeman_vibing_orchestrator__) {
|
|
34
|
-
return globalThis.__vibeman_vibing_orchestrator__;
|
|
35
|
-
}
|
|
36
|
-
if (!globalThis.__vibeman_vibing_orchestrator_init__) {
|
|
37
|
-
const taskService = getTaskService();
|
|
38
|
-
const agentService = getAgentService();
|
|
39
|
-
const gitService = getGitService();
|
|
40
|
-
globalThis.__vibeman_vibing_orchestrator__ = new VibingOrchestrator(taskService, agentService, agentService.getWorktreeService(), getDefaultVibingConfig(), gitService);
|
|
41
|
-
globalThis.__vibeman_vibing_orchestrator_init__ = globalThis.__vibeman_vibing_orchestrator__
|
|
42
|
-
.initialize()
|
|
43
|
-
.catch((e) => console.error('VibingOrchestrator init error:', e));
|
|
44
|
-
}
|
|
45
|
-
await globalThis.__vibeman_vibing_orchestrator_init__;
|
|
46
|
-
return globalThis.__vibeman_vibing_orchestrator__;
|
|
47
|
-
}
|
|
48
|
-
// Cleanup on process exit
|
|
49
|
-
if (isProduction()) {
|
|
50
|
-
process.on('SIGTERM', () => {
|
|
51
|
-
if (globalThis.__vibeman_vibing_orchestrator__) {
|
|
52
|
-
// VibingOrchestrator doesn't have a stop method, but we can clean up the reference
|
|
53
|
-
globalThis.__vibeman_vibing_orchestrator__ = undefined;
|
|
54
|
-
globalThis.__vibeman_vibing_orchestrator_init__ = undefined;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|