@ours.network/fleet 1.1.0-nightly.8 → 1.1.0
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/README.md +231 -46
- package/dist/application/capabilities.js +18 -6
- package/dist/application/fleet-query-service.js +7 -4
- package/dist/application/role-command-service.js +9 -0
- package/dist/application/role-creation-service.d.ts +4 -4
- package/dist/application/role-creation-service.js +9 -2
- package/dist/application/role-repository.d.ts +4 -2
- package/dist/application/role-repository.js +6 -3
- package/dist/application/session-control.d.ts +3 -1
- package/dist/application/session-control.js +4 -2
- package/dist/application/task-room-service.d.ts +92 -39
- package/dist/application/task-room-service.js +579 -173
- package/dist/briefing.js +85 -28
- package/dist/build-info.json +5 -5
- package/dist/canonical-json.d.ts +2 -0
- package/dist/canonical-json.js +10 -0
- package/dist/cli.js +130 -55
- package/dist/config.d.ts +38 -3
- package/dist/config.js +193 -28
- package/dist/creation.d.ts +1 -1
- package/dist/creation.js +7 -4
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +193 -55
- package/dist/doctor.d.ts +2 -0
- package/dist/doctor.js +40 -4
- package/dist/fleet-command-audit.d.ts +59 -9
- package/dist/fleet-command-audit.js +426 -63
- package/dist/fleet-proxy.d.ts +5 -2
- package/dist/harness/claude-code-session.js +2 -1
- package/dist/harness/codex-app-server-proxy.d.ts +40 -0
- package/dist/harness/codex-app-server-proxy.js +348 -14
- package/dist/harness/codex-session.d.ts +9 -2
- package/dist/harness/codex-session.js +18 -2
- package/dist/harness/codex.d.ts +5 -1
- package/dist/harness/codex.js +104 -10
- package/dist/harness/types.d.ts +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -2
- package/dist/init-guidance.d.ts +1 -1
- package/dist/init-guidance.js +1 -1
- package/dist/init-wizard.d.ts +98 -0
- package/dist/init-wizard.js +631 -0
- package/dist/lifecycle-summary.d.ts +134 -0
- package/dist/lifecycle-summary.js +179 -0
- package/dist/loops/config.d.ts +10 -1
- package/dist/loops/config.js +38 -5
- package/dist/model-recovery.d.ts +1 -1
- package/dist/ops.js +2 -17
- package/dist/owner-channel/channel.d.ts +21 -5
- package/dist/owner-channel/channel.js +312 -138
- package/dist/owner-channel/commands.d.ts +28 -6
- package/dist/owner-channel/commands.js +109 -27
- package/dist/owner-channel/lifecycle-outbox.d.ts +24 -0
- package/dist/owner-channel/lifecycle-outbox.js +87 -0
- package/dist/owner-channel/ours-client.d.ts +19 -0
- package/dist/owner-channel/ours-client.js +3 -0
- package/dist/owner-channel/state.d.ts +2 -0
- package/dist/owner-channel/state.js +8 -2
- package/dist/permissions.js +1 -1
- package/dist/preset-migration.d.ts +42 -0
- package/dist/preset-migration.js +450 -0
- package/dist/reports/artifact.d.ts +10 -0
- package/dist/reports/artifact.js +32 -0
- package/dist/reports/index.d.ts +5 -0
- package/dist/reports/index.js +5 -0
- package/dist/reports/render.d.ts +6 -0
- package/dist/reports/render.js +240 -0
- package/dist/reports/service.d.ts +42 -0
- package/dist/reports/service.js +57 -0
- package/dist/reports/tasks.d.ts +52 -0
- package/dist/reports/tasks.js +177 -0
- package/dist/reports/types.d.ts +315 -0
- package/dist/reports/types.js +6 -0
- package/dist/resolved-plan.js +13 -1
- package/dist/rooms-tasks/cli.d.ts +2 -0
- package/dist/rooms-tasks/cli.js +434 -279
- package/dist/rooms-tasks/close.d.ts +9 -1
- package/dist/rooms-tasks/close.js +23 -7
- package/dist/rooms-tasks/config.js +16 -25
- package/dist/rooms-tasks/cowork-adapter.d.ts +5 -0
- package/dist/rooms-tasks/cowork-adapter.js +13 -0
- package/dist/rooms-tasks/deletion.d.ts +51 -0
- package/dist/rooms-tasks/deletion.js +217 -0
- package/dist/rooms-tasks/external-worker.d.ts +8 -0
- package/dist/rooms-tasks/external-worker.js +38 -0
- package/dist/rooms-tasks/launch-snapshot.d.ts +19 -0
- package/dist/rooms-tasks/launch-snapshot.js +181 -0
- package/dist/rooms-tasks/member-overrides.d.ts +30 -0
- package/dist/rooms-tasks/member-overrides.js +204 -0
- package/dist/rooms-tasks/member-startup.d.ts +1 -0
- package/dist/rooms-tasks/member-startup.js +9 -2
- package/dist/rooms-tasks/provision.js +146 -56
- package/dist/rooms-tasks/room-state.d.ts +1 -0
- package/dist/rooms-tasks/room-state.js +12 -1
- package/dist/rooms-tasks/task-room-name.d.ts +12 -0
- package/dist/rooms-tasks/task-room-name.js +61 -0
- package/dist/rooms-tasks/task-state.d.ts +115 -3
- package/dist/rooms-tasks/task-state.js +361 -11
- package/dist/rooms-tasks/templates.d.ts +4 -1
- package/dist/rooms-tasks/templates.js +34 -3
- package/dist/rooms-tasks/terminal.d.ts +3 -0
- package/dist/rooms-tasks/terminal.js +10 -4
- package/dist/rooms-tasks/types.d.ts +92 -7
- package/dist/rooms-tasks/types.js +14 -1
- package/dist/runner.d.ts +3 -0
- package/dist/runner.js +92 -33
- package/dist/session/acp.d.ts +4 -1
- package/dist/session/acp.js +29 -13
- package/dist/session/arbiter.d.ts +2 -1
- package/dist/session/arbiter.js +2 -0
- package/dist/session/codex-app-server-transport.d.ts +53 -0
- package/dist/session/codex-app-server-transport.js +184 -0
- package/dist/session/codex-app-server.d.ts +122 -0
- package/dist/session/codex-app-server.js +1031 -0
- package/dist/session/control.d.ts +2 -2
- package/dist/session/control.js +18 -2
- package/dist/session/conversation-types.d.ts +4 -4
- package/dist/session/types.d.ts +24 -6
- package/dist/session/types.js +28 -0
- package/dist/spawn.d.ts +9 -0
- package/dist/spawn.js +77 -9
- package/dist/web/fleet-config-service.d.ts +1 -0
- package/dist/web/fleet-config-service.js +25 -7
- package/dist/web/runtime.js +11 -6
- package/dist/web/server.js +28 -1
- package/dist/web-app/assets/{index-BbTc5KtZ.js → index-C0h3ALvs.js} +8 -8
- package/dist/web-app/index.html +1 -1
- package/package.json +4 -4
- package/presets/brain-catalog.json +17 -0
- package/presets/fleet/{agents → agent_templates}/Critic.yaml +2 -0
- package/presets/fleet/{agents/Agent.yaml → agent_templates/Developer.yaml} +3 -1
- package/presets/fleet/agent_templates/LocalCoordinator.yaml +50 -0
- package/presets/fleet/agents/{Developer.yaml → FleetCoordinator.yaml} +1 -1
- package/presets/fleet/brains/claude-fable-5-high.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-low.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-max.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-medium.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-xhigh.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-high.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-low.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-max.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-medium.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-xhigh.yaml +5 -0
- package/presets/fleet/brains/claude-sonnet-5-high.yaml +5 -0
- package/presets/fleet/brains/claude-sonnet-5-low.yaml +5 -0
- package/presets/fleet/brains/claude-sonnet-5-max.yaml +5 -0
- package/presets/fleet/brains/claude-sonnet-5-medium.yaml +5 -0
- package/presets/fleet/brains/claude-sonnet-5-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-mini-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-mini-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-mini-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-mini-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-4-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-5-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-5-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-5-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-5-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-luna-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-luna-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-luna-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-luna-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-luna-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-sol-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-sol-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-sol-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-sol-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-sol-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-sol-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-terra-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-terra-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-terra-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-terra-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-terra-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-5-6-terra-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-xhigh.yaml +5 -0
- package/presets/fleet/roles/Coordinator.yaml +37 -0
- package/presets/fleet/roles/Critic.yaml +23 -1
- package/presets/fleet/roles/Developer.yaml +27 -5
- package/presets/fleet/roles/LocalCoordinator.yaml +35 -0
- package/presets/fleet/room_templates/pair.yaml +9 -7
- package/presets/fleet/room_templates/single.yaml +5 -4
- package/presets/fleet/room_templates/team.yaml +12 -8
- package/presets/manifest.json +2 -1
- package/presets/fleet/agents/Architect.yaml +0 -3
- package/presets/fleet/agents/Secretary.yaml +0 -3
- package/presets/fleet/agents/Tester.yaml +0 -3
- package/presets/fleet/roles/Agent.yaml +0 -6
- package/presets/fleet/roles/Architect.yaml +0 -6
- package/presets/fleet/roles/Secretary.yaml +0 -6
- package/presets/fleet/roles/Tester.yaml +0 -6
package/dist/harness/codex.js
CHANGED
|
@@ -16,6 +16,7 @@ const LAUNCHERS = ['auto', 'ours-codex', 'codex'];
|
|
|
16
16
|
const SANDBOX_MODES = ['read-only', 'workspace-write', 'danger-full-access'];
|
|
17
17
|
/** Codex CLI's accepted `--ask-for-approval` values. */
|
|
18
18
|
const APPROVAL_POLICIES = ['untrusted', 'on-request', 'never'];
|
|
19
|
+
const NATIVE_CONFIG_ALLOWLIST = new Set(['model_reasoning_effort']);
|
|
19
20
|
const BUNDLED_CODEX_ACP_VERSION = '1.1.7';
|
|
20
21
|
const CODEX_ACP_PACKAGE = '@agentclientprotocol/codex-acp';
|
|
21
22
|
const CODEX_PROXY_APPROVAL_ENV = 'OURS_FLEET_CODEX_APPROVAL';
|
|
@@ -119,6 +120,34 @@ function approvalPolicy(role) {
|
|
|
119
120
|
throw new Error(`invalid harness_options.approval "${a}"; allowed: ${APPROVAL_POLICIES.join(', ')}`);
|
|
120
121
|
return a;
|
|
121
122
|
}
|
|
123
|
+
/** Native app-server policy comes only from Fleet's public permission contract. */
|
|
124
|
+
function neutralApprovalPolicy(role) {
|
|
125
|
+
if (role.permissions?.approval === 'allow')
|
|
126
|
+
return 'never';
|
|
127
|
+
if (role.permissions?.approval === 'ask')
|
|
128
|
+
return 'untrusted';
|
|
129
|
+
return 'on-request';
|
|
130
|
+
}
|
|
131
|
+
/** Native app-server sandbox comes only from Fleet's public filesystem contract. */
|
|
132
|
+
function neutralSandboxMode(role) {
|
|
133
|
+
if (role.permissions?.filesystem === 'read-only')
|
|
134
|
+
return 'read-only';
|
|
135
|
+
if (role.permissions?.filesystem === 'unrestricted')
|
|
136
|
+
return 'danger-full-access';
|
|
137
|
+
return 'workspace-write';
|
|
138
|
+
}
|
|
139
|
+
/** Native config is fail-closed because Codex adds authority-bearing keys over time. */
|
|
140
|
+
function isNativeConfigKeyAllowed(key) {
|
|
141
|
+
return NATIVE_CONFIG_ALLOWLIST.has(key);
|
|
142
|
+
}
|
|
143
|
+
/** Defense in depth for callers which launch a role after validation was bypassed. */
|
|
144
|
+
export function nativeCodexConfig(role) {
|
|
145
|
+
const options = role.harness_options;
|
|
146
|
+
if (!options?.config)
|
|
147
|
+
return undefined;
|
|
148
|
+
return Object.fromEntries(Object.entries(options.config)
|
|
149
|
+
.filter(([key]) => isNativeConfigKeyAllowed(key)));
|
|
150
|
+
}
|
|
122
151
|
function launcherMode(role) {
|
|
123
152
|
return role.harness_options?.launcher ?? 'auto';
|
|
124
153
|
}
|
|
@@ -126,6 +155,36 @@ function bundledCodexAcp() {
|
|
|
126
155
|
return resolveBundledAcpAgent(CODEX_ACP_PACKAGE, 'codex-acp', 'codex-acp');
|
|
127
156
|
}
|
|
128
157
|
function codexAgentLaunch(role, prep) {
|
|
158
|
+
if (role.session === 'codex-app-server') {
|
|
159
|
+
const configured = role.session_options?.codex_app_server?.command;
|
|
160
|
+
if (Array.isArray(configured))
|
|
161
|
+
return { argv: [...configured], env: prep.env };
|
|
162
|
+
if (typeof configured === 'string')
|
|
163
|
+
return { argv: ['sh', '-c', configured], env: prep.env };
|
|
164
|
+
const launcher = launcherMode(role);
|
|
165
|
+
const options = role.harness_options;
|
|
166
|
+
const flags = [
|
|
167
|
+
...(options?.search ? ['--search'] : []),
|
|
168
|
+
'app-server',
|
|
169
|
+
];
|
|
170
|
+
// Preserve the established `auto` launcher contract without resolving PATH
|
|
171
|
+
// during synchronous launch preparation. The static shell fragment passes
|
|
172
|
+
// every dynamic value as an argv element and `exec`s the selected process.
|
|
173
|
+
if (launcher === 'auto')
|
|
174
|
+
return {
|
|
175
|
+
argv: [
|
|
176
|
+
'sh', '-c',
|
|
177
|
+
'if command -v ours-codex >/dev/null 2>&1; then exec ours-codex "$@"; else exec codex "$@"; fi',
|
|
178
|
+
'ours-fleet-codex', ...flags,
|
|
179
|
+
],
|
|
180
|
+
env: prep.env,
|
|
181
|
+
};
|
|
182
|
+
const command = launcher === 'ours-codex' ? 'ours-codex' : 'codex';
|
|
183
|
+
return {
|
|
184
|
+
argv: [command, ...flags],
|
|
185
|
+
env: prep.env,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
129
188
|
const configured = role.session_options?.acp?.command;
|
|
130
189
|
const resolved = configured == null
|
|
131
190
|
? codexAcpLaunchForResolution(bundledCodexAcp())
|
|
@@ -247,7 +306,7 @@ function hasInstalledOursPlugin(output) {
|
|
|
247
306
|
return false;
|
|
248
307
|
}
|
|
249
308
|
}
|
|
250
|
-
export function makeCodexAdapter(exec = realExec, transport) {
|
|
309
|
+
export function makeCodexAdapter(exec = realExec, transport, nativeTransport) {
|
|
251
310
|
return {
|
|
252
311
|
id: 'codex',
|
|
253
312
|
agentSession: new CodexAgentSessionAdapter({
|
|
@@ -283,7 +342,11 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
283
342
|
permissionModeId: role => acpAgentMode(role),
|
|
284
343
|
mcpServers: () => undefined,
|
|
285
344
|
sessionMeta: () => undefined,
|
|
286
|
-
|
|
345
|
+
approvalPolicy: neutralApprovalPolicy,
|
|
346
|
+
sandbox: neutralSandboxMode,
|
|
347
|
+
nativeConfig: nativeCodexConfig,
|
|
348
|
+
addDirs: role => role.harness_options?.add_dirs,
|
|
349
|
+
}, transport, nativeTransport),
|
|
287
350
|
supportsResume: true,
|
|
288
351
|
async checkPrereqs() {
|
|
289
352
|
const [r, hasOursCodex, plugins] = await Promise.all([
|
|
@@ -319,7 +382,7 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
319
382
|
],
|
|
320
383
|
};
|
|
321
384
|
},
|
|
322
|
-
validateOptions(opts) {
|
|
385
|
+
validateOptions(opts, role) {
|
|
323
386
|
if (opts == null)
|
|
324
387
|
return [];
|
|
325
388
|
if (typeof opts !== 'object' || Array.isArray(opts))
|
|
@@ -328,6 +391,28 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
328
391
|
.filter(k => !OPTION_KEYS.includes(k))
|
|
329
392
|
.map(k => ({ path: `harness_options.${k}`, message: `unknown option; allowed: ${OPTION_KEYS.join(', ')}` }));
|
|
330
393
|
const o = opts;
|
|
394
|
+
if (role?.session === 'codex-app-server') {
|
|
395
|
+
if (o.profile != null)
|
|
396
|
+
errs.push({
|
|
397
|
+
path: 'harness_options.profile',
|
|
398
|
+
message: 'is not accepted for codex-app-server; Codex rejects --profile for app-server',
|
|
399
|
+
});
|
|
400
|
+
if (o.approval != null)
|
|
401
|
+
errs.push({
|
|
402
|
+
path: 'harness_options.approval',
|
|
403
|
+
message: 'is not accepted for codex-app-server; use permissions.approval: ask|auto|allow',
|
|
404
|
+
});
|
|
405
|
+
if (o.permission_mode != null)
|
|
406
|
+
errs.push({
|
|
407
|
+
path: 'harness_options.permission_mode',
|
|
408
|
+
message: 'is not accepted for codex-app-server; use permissions.approval: ask|auto|allow',
|
|
409
|
+
});
|
|
410
|
+
if (o.sandbox != null)
|
|
411
|
+
errs.push({
|
|
412
|
+
path: 'harness_options.sandbox',
|
|
413
|
+
message: 'is not accepted for codex-app-server; use permissions.filesystem: read-only|workspace|unrestricted',
|
|
414
|
+
});
|
|
415
|
+
}
|
|
331
416
|
if (o.launcher != null && !LAUNCHERS.includes(o.launcher))
|
|
332
417
|
errs.push({ path: 'harness_options.launcher', message: `must be one of: ${LAUNCHERS.join(', ')}` });
|
|
333
418
|
if (o.sandbox != null && !SANDBOX_MODES.includes(o.sandbox))
|
|
@@ -351,6 +436,13 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
351
436
|
errs.push({ path: 'harness_options.config', message: 'must be a map of Codex config keys to TOML scalar/array values' });
|
|
352
437
|
else
|
|
353
438
|
for (const [key, value] of Object.entries(o.config)) {
|
|
439
|
+
if (role?.session === 'codex-app-server' && !isNativeConfigKeyAllowed(key)) {
|
|
440
|
+
errs.push({
|
|
441
|
+
path: `harness_options.config.${key}`,
|
|
442
|
+
message: 'is not accepted for codex-app-server; only model_reasoning_effort is allowed',
|
|
443
|
+
});
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
354
446
|
try {
|
|
355
447
|
encodeTomlValue(value);
|
|
356
448
|
}
|
|
@@ -394,7 +486,9 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
394
486
|
],
|
|
395
487
|
};
|
|
396
488
|
},
|
|
397
|
-
nativePermissionOverrides(options) {
|
|
489
|
+
nativePermissionOverrides(options, role) {
|
|
490
|
+
if (role?.session === 'codex-app-server')
|
|
491
|
+
return {};
|
|
398
492
|
const o = options;
|
|
399
493
|
const approval = o?.approval ?? o?.permission_mode; // permission_mode is the alias
|
|
400
494
|
return {
|
|
@@ -422,6 +516,8 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
422
516
|
const translated = this.translatePermissions(role.permissions);
|
|
423
517
|
if (!translated.supported)
|
|
424
518
|
return translated;
|
|
519
|
+
if (role.session === 'codex-app-server')
|
|
520
|
+
return translated;
|
|
425
521
|
const approval = approvalPolicy(role) ?? 'on-request';
|
|
426
522
|
const sandbox = sandboxMode(role) ?? 'workspace-write';
|
|
427
523
|
if (role.session === 'acp') {
|
|
@@ -446,11 +542,7 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
446
542
|
capabilities: codexCapabilities(actual.approval, actual.sandbox),
|
|
447
543
|
};
|
|
448
544
|
}
|
|
449
|
-
return
|
|
450
|
-
...translated,
|
|
451
|
-
native: { approval, sandbox },
|
|
452
|
-
capabilities: codexCapabilities(approval, sandbox),
|
|
453
|
-
};
|
|
545
|
+
return translated;
|
|
454
546
|
},
|
|
455
547
|
effectivePermissionMode(role) {
|
|
456
548
|
if (role.session === 'acp') {
|
|
@@ -463,10 +555,12 @@ export function makeCodexAdapter(exec = realExec, transport) {
|
|
|
463
555
|
fleetMode: fleetModeForApproval(acpModePermissions(nativeMode).approval), nativeMode,
|
|
464
556
|
};
|
|
465
557
|
}
|
|
466
|
-
const nativeMode =
|
|
558
|
+
const nativeMode = neutralApprovalPolicy(role);
|
|
467
559
|
return { fleetMode: fleetModeForApproval(nativeMode), nativeMode };
|
|
468
560
|
},
|
|
469
561
|
inheritedPermissionMode(role) {
|
|
562
|
+
if (role.session === 'codex-app-server')
|
|
563
|
+
return fleetModeForApproval(neutralApprovalPolicy(role));
|
|
470
564
|
return fleetModeForApproval(approvalPolicy(role) ?? 'untrusted');
|
|
471
565
|
},
|
|
472
566
|
vocabulary: {
|
package/dist/harness/types.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export interface HarnessAdapter {
|
|
|
145
145
|
* keyed the same way `translatePermissions().native` is, so the two can be
|
|
146
146
|
* compared directly. Only keys the operator actually wrote appear.
|
|
147
147
|
*/
|
|
148
|
-
nativePermissionOverrides(options: unknown): Record<string, unknown>;
|
|
148
|
+
nativePermissionOverrides(options: unknown, role?: ResolvedRole): Record<string, unknown>;
|
|
149
149
|
/**
|
|
150
150
|
* Host paths this harness needs inside a sandbox, split into a per-role
|
|
151
151
|
* writable home and shared read-only credentials/config. Omit for a
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { loadConfig, findRole, resolvePermissions, ConfigError } from './config.js';
|
|
2
2
|
export type { FleetConfig, ResolvedRole, RoleConfig, OverseeEntry, SessionBackendId, CommonPermissions, FleetPermissionMode, ApprovalMode, SessionOptions, OwnerChannelConfig, } from './config.js';
|
|
3
3
|
export type { HarnessAdapter, BriefingVocab, ExitPolicy, PrereqReport, PrereqCheck, SessionPrep, Launch, AcpLaunch, PermissionTranslation, RoleDirs, ValidationError, } from './harness/types.js';
|
|
4
|
-
export type { AgentSession, SessionHandle, SessionSnapshot, SessionEvent, TurnResult, InterruptOutcome, InterruptResult, TurnCancellationSource, QueuedPrompt, ExitRecord, } from './session/types.js';
|
|
5
|
-
export { interruptOutcome } from './session/types.js';
|
|
4
|
+
export type { AgentSession, SessionHandle, SessionSnapshot, SessionEvent, TurnResult, InterruptOutcome, InterruptResult, TurnCancellationSource, QueuedPrompt, ExitRecord, AgentSessionCapabilities, } from './session/types.js';
|
|
5
|
+
export { interruptOutcome, sessionBackendCapabilities } from './session/types.js';
|
|
6
6
|
export { AcpSession } from './session/acp.js';
|
|
7
|
+
export { CodexAppServerSession } from './session/codex-app-server.js';
|
|
7
8
|
export { OwnerChannel } from './owner-channel/channel.js';
|
|
8
9
|
export { registerAdapter, getAdapter, knownAdapters } from './harness/registry.js';
|
|
9
10
|
export { claudeCodeAdapter, makeClaudeCodeAdapter } from './harness/claude-code.js';
|
|
@@ -16,7 +17,7 @@ export { up, down, restartRoles, rmRole, applyRole } from './ops.js';
|
|
|
16
17
|
export { spawnPermanent, spawnTemp, agentDefinitionFromSpawn, validateSpawnOpts, } from './spawn.js';
|
|
17
18
|
export { RoleRepository } from './application/role-repository.js';
|
|
18
19
|
export { FleetQueryService } from './application/fleet-query-service.js';
|
|
19
|
-
export { AcpRoleSessionAdapter } from './application/session-control.js';
|
|
20
|
+
export { RoleSessionControlAdapter, AcpRoleSessionAdapter, } from './application/session-control.js';
|
|
20
21
|
export { RoleCreationService } from './application/role-creation-service.js';
|
|
21
22
|
export { RoleCommandService, RoleLifecycleService } from './application/role-command-service.js';
|
|
22
23
|
export { StructuredLogService } from './application/log-service.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { loadConfig, findRole, resolvePermissions, ConfigError } from './config.js';
|
|
2
|
-
export { interruptOutcome } from './session/types.js';
|
|
2
|
+
export { interruptOutcome, sessionBackendCapabilities } from './session/types.js';
|
|
3
3
|
export { AcpSession } from './session/acp.js';
|
|
4
|
+
export { CodexAppServerSession } from './session/codex-app-server.js';
|
|
4
5
|
export { OwnerChannel } from './owner-channel/channel.js';
|
|
5
6
|
export { registerAdapter, getAdapter, knownAdapters } from './harness/registry.js';
|
|
6
7
|
export { claudeCodeAdapter, makeClaudeCodeAdapter } from './harness/claude-code.js';
|
|
@@ -12,7 +13,7 @@ export { up, down, restartRoles, rmRole, applyRole } from './ops.js';
|
|
|
12
13
|
export { spawnPermanent, spawnTemp, agentDefinitionFromSpawn, validateSpawnOpts, } from './spawn.js';
|
|
13
14
|
export { RoleRepository } from './application/role-repository.js';
|
|
14
15
|
export { FleetQueryService } from './application/fleet-query-service.js';
|
|
15
|
-
export { AcpRoleSessionAdapter } from './application/session-control.js';
|
|
16
|
+
export { RoleSessionControlAdapter, AcpRoleSessionAdapter, } from './application/session-control.js';
|
|
16
17
|
export { RoleCreationService } from './application/role-creation-service.js';
|
|
17
18
|
export { RoleCommandService, RoleLifecycleService } from './application/role-command-service.js';
|
|
18
19
|
export { StructuredLogService } from './application/log-service.js';
|
package/dist/init-guidance.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const INIT_COMPLETION_GUIDANCE = "\nNext:\n ours-fleet config\n ours-fleet template list\n
|
|
1
|
+
export declare const INIT_COMPLETION_GUIDANCE = "\nNext:\n ours-fleet config\n ours-fleet template list\n review the generated manifest and fleet/{agents,agent_templates,roles,brains,room_templates}/*.yaml\n configure rooms.owner, then create a task with --template single, pair, or team";
|
package/dist/init-guidance.js
CHANGED
|
@@ -2,5 +2,5 @@ export const INIT_COMPLETION_GUIDANCE = `
|
|
|
2
2
|
Next:
|
|
3
3
|
ours-fleet config
|
|
4
4
|
ours-fleet template list
|
|
5
|
-
|
|
5
|
+
review the generated manifest and fleet/{agents,agent_templates,roles,brains,room_templates}/*.yaml
|
|
6
6
|
configure rooms.owner, then create a task with --template single, pair, or team`;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Stats } from 'node:fs';
|
|
2
|
+
import type { ReadStream, WriteStream } from 'node:tty';
|
|
3
|
+
export type Subscription = 'codex' | 'claude';
|
|
4
|
+
export type WorkKind = 'development' | 'review' | 'coordination';
|
|
5
|
+
export type ReasoningPreference = 'quick' | 'balanced' | 'thorough';
|
|
6
|
+
export type AssignmentStrategy = 'one-model' | 'per-job';
|
|
7
|
+
export interface CatalogModel {
|
|
8
|
+
harness: 'codex' | 'claude-code';
|
|
9
|
+
session: 'acp';
|
|
10
|
+
model: string;
|
|
11
|
+
efforts: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface InitAnswers {
|
|
14
|
+
subscriptions: Subscription[];
|
|
15
|
+
assignmentStrategy: AssignmentStrategy;
|
|
16
|
+
models: Record<WorkKind, CatalogModel>;
|
|
17
|
+
reasoning: ReasoningPreference;
|
|
18
|
+
}
|
|
19
|
+
export interface Choice<T> {
|
|
20
|
+
label: string;
|
|
21
|
+
value: T;
|
|
22
|
+
}
|
|
23
|
+
export interface InitPrompter {
|
|
24
|
+
confirm(message: string, detail: string): Promise<boolean | undefined>;
|
|
25
|
+
multiSelect<T>(message: string, choices: Choice<T>[]): Promise<T[] | undefined>;
|
|
26
|
+
select<T>(message: string, choices: Choice<T>[], initial?: number): Promise<T | undefined>;
|
|
27
|
+
note(message: string): void;
|
|
28
|
+
}
|
|
29
|
+
export interface BrainCatalog {
|
|
30
|
+
schema_version: number;
|
|
31
|
+
models: CatalogModel[];
|
|
32
|
+
}
|
|
33
|
+
export interface GeneratedSetup {
|
|
34
|
+
files: Map<string, string>;
|
|
35
|
+
answers: InitAnswers;
|
|
36
|
+
}
|
|
37
|
+
export interface InitPublishResult {
|
|
38
|
+
configPath: string;
|
|
39
|
+
splitRoot: string;
|
|
40
|
+
recoveryPath: string;
|
|
41
|
+
replacedExisting: boolean;
|
|
42
|
+
manifestExisted: boolean;
|
|
43
|
+
rootExisted: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare function validateCatalog(value: BrainCatalog, path?: string): BrainCatalog;
|
|
46
|
+
export declare function askInitQuestions(prompter: InitPrompter, configuration: string): Promise<InitAnswers | undefined>;
|
|
47
|
+
export declare function formatSetupSummary(answers: InitAnswers, configuration: string): string;
|
|
48
|
+
/** Build the exact, deterministic default experience without writing to disk. */
|
|
49
|
+
export declare function generateSetup(answers: InitAnswers): GeneratedSetup;
|
|
50
|
+
/** Run the mutation boundary only after the complete questionnaire is accepted. */
|
|
51
|
+
export declare function executeInitWizard(prompter: InitPrompter, configuration: string, deps: {
|
|
52
|
+
hostSetup(): Promise<void>;
|
|
53
|
+
publish(configuration: string, setup: GeneratedSetup): Promise<InitPublishResult>;
|
|
54
|
+
generate?(answers: InitAnswers): GeneratedSetup;
|
|
55
|
+
preflight?(configuration: string): InitPathState;
|
|
56
|
+
}): Promise<InitPublishResult | undefined>;
|
|
57
|
+
export interface InitPathInspectionDeps {
|
|
58
|
+
exists?(path: string): boolean;
|
|
59
|
+
lstat?(path: string): Stats;
|
|
60
|
+
stat?(path: string): Stats;
|
|
61
|
+
uid?(): number | undefined;
|
|
62
|
+
entries?(path: string): string[];
|
|
63
|
+
}
|
|
64
|
+
export interface InitPathState {
|
|
65
|
+
configPath: string;
|
|
66
|
+
splitRoot: string;
|
|
67
|
+
parent: string;
|
|
68
|
+
manifestExisted: boolean;
|
|
69
|
+
rootExisted: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** Read-only safety gate. Run once before host setup and again under the init lock. */
|
|
72
|
+
export declare function preflightInitPaths(configuration: string, overrides?: InitPathInspectionDeps): InitPathState;
|
|
73
|
+
/** Replace the complete configuration under one lock, retaining a private recovery copy. */
|
|
74
|
+
export declare function publishSetup(configuration: string, setup: GeneratedSetup, hooks?: {
|
|
75
|
+
beforeArtifact?(entry: 'stage' | 'recovery'): void;
|
|
76
|
+
beforePublish?(entry: 'root' | 'manifest'): void;
|
|
77
|
+
}): Promise<InitPublishResult>;
|
|
78
|
+
type Key = 'up' | 'down' | 'space' | 'enter' | 'escape' | 'yes' | 'no' | 'other';
|
|
79
|
+
export declare function decodeKey(chunk: Buffer | string): Key;
|
|
80
|
+
export interface MultiSelectState {
|
|
81
|
+
cursor: number;
|
|
82
|
+
selected: boolean[];
|
|
83
|
+
}
|
|
84
|
+
export declare function updateMultiSelect(state: MultiSelectState, key: Key): MultiSelectState;
|
|
85
|
+
export declare class TerminalPrompter implements InitPrompter {
|
|
86
|
+
private readonly input;
|
|
87
|
+
private readonly output;
|
|
88
|
+
private readonly notes;
|
|
89
|
+
constructor(input: ReadStream, output: WriteStream);
|
|
90
|
+
note(message: string): void;
|
|
91
|
+
confirm(message: string, detail: string): Promise<boolean | undefined>;
|
|
92
|
+
multiSelect<T>(message: string, choices: Choice<T>[]): Promise<T[] | undefined>;
|
|
93
|
+
select<T>(message: string, choices: Choice<T>[], initial?: number): Promise<T | undefined>;
|
|
94
|
+
private render;
|
|
95
|
+
private key;
|
|
96
|
+
}
|
|
97
|
+
export declare const isInteractiveTerminal: (input: NodeJS.ReadStream, output: NodeJS.WriteStream) => boolean;
|
|
98
|
+
export {};
|