eust-w 1d75b03430 feat: register executors in one catalog and add Claude Code (FR-D1)
Adding an executor touched the contracts, the API's availability check, the
worker and the console separately. Now it is an adapter plus one entry in
@wishforge/contracts' providerCatalog (name, executable variable, whether the
model proxy isolates its credentials) and one in the worker's
providerRegistry; the API, the console's options and MCP's submit_wish read
the catalog, and a test checks every entry is registered with the worker.

The CodeBuddy adapter already parsed Claude-Code-style stream-json, so it is
now a StreamJsonCliAdapter with a dialect per CLI. Claude Code runs headless
with --verbose and --permission-mode bypassPermissions inside the per-run
sandbox and receives only ANTHROPIC_* credentials (WF_CLAUDE_BIN). Like
CodeBuddy it is development-only until the model proxy supports it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 20:23:05 +08:00

63 lines
1.9 KiB
JavaScript

import { resolve } from 'node:path';
import { environment, loadLocalEnvironment, startServices } from './local-services.mjs';
loadLocalEnvironment();
const root = process.cwd();
const worker = (role, token) => ({
name: role,
cwd: root,
args: ['--import', 'tsx', 'apps/worker/src/main.ts'],
env: environment([/^TEMPORAL_/, /^WF_CONTROL_PLANE_URL$/, /^WF_DISPATCH_TENANTS$/], {
WF_WORKER_ROLE: role,
[token]: process.env[token],
}),
});
await startServices(
[
{
name: 'git',
cwd: root,
args: ['--import', 'tsx', 'apps/git-service/src/main.ts'],
env: environment([/^WF_GIT_/]),
url: 'http://127.0.0.1:4504/health',
identity: 'git-storage',
},
{
name: 'api',
cwd: resolve(root, 'apps/api'),
args: ['--import', 'tsx', 'src/main.ts'],
env: environment([/^DATABASE_URL$/, /^WF_/, /^S3_/, /^OIDC_/, /^TEMPORAL_/, /^VAULT_/, /^PORT$/, /^HOST$/]),
url: 'http://127.0.0.1:4000/health',
identity: 'wishforge-control-plane',
},
{
name: 'provisioner',
cwd: root,
args: ['apps/provisioner/main.mjs'],
env: environment([
/^WF_PROVISIONER_/,
/^WF_LOCAL_/,
/^WF_TENANT_ID$/,
/^WF_RESOURCE_GRANT_SECRET$/,
/^WF_CONTROL_PLANE_URL$/,
/^TEMPORAL_/,
/^WF_GIT_ALLOW_LOCAL_HTTP$/,
/^WF_CODEBUDDY_BIN$/,
/^WF_CLAUDE_BIN$/,
]),
url: 'http://127.0.0.1:4450/healthz',
identity: 'wishforge-provisioner',
},
worker('coordinator', 'WF_WORKER_TOKEN'),
worker('deployer', 'WF_DEPLOYER_TOKEN'),
{
name: 'web',
cwd: resolve(root, 'apps/web'),
args: [resolve(root, 'node_modules/next/dist/bin/next'), 'dev', '--hostname', '127.0.0.1', '--port', '3000'],
env: environment([]),
url: 'http://127.0.0.1:3000/api/session',
},
],
'WishForge console: http://localhost:3000 · API: http://127.0.0.1:4000 · Temporal: http://127.0.0.1:8233',
);