@ours.network/fleet 1.1.0-nightly.2 → 1.1.0-nightly.21
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 +204 -55
- package/dist/agent-recovery-gate.d.ts +17 -0
- package/dist/agent-recovery-gate.js +135 -0
- package/dist/application/capabilities.js +18 -6
- package/dist/application/fleet-query-service.js +20 -5
- package/dist/application/role-command-service.js +9 -0
- package/dist/application/role-creation-service.d.ts +6 -25
- package/dist/application/role-creation-service.js +34 -72
- 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 +58 -6
- package/dist/application/task-room-service.js +435 -79
- package/dist/briefing.js +74 -24
- package/dist/build-info.json +4 -4
- package/dist/canonical-json.d.ts +2 -0
- package/dist/canonical-json.js +10 -0
- package/dist/cli.js +241 -76
- package/dist/config-yaml.d.ts +1 -1
- package/dist/config.d.ts +75 -3
- package/dist/config.js +274 -34
- package/dist/creation.d.ts +1 -1
- package/dist/creation.js +3 -2
- package/dist/daemon-recovery.d.ts +93 -0
- package/dist/daemon-recovery.js +328 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +192 -66
- package/dist/doctor.d.ts +2 -0
- package/dist/doctor.js +54 -4
- package/dist/fleet-command-audit.d.ts +165 -0
- package/dist/fleet-command-audit.js +555 -0
- package/dist/fleet-proxy.d.ts +7 -2
- package/dist/fleet-proxy.js +30 -8
- package/dist/harness/agent-session.d.ts +5 -0
- package/dist/harness/claude-code-session.d.ts +2 -0
- package/dist/harness/claude-code-session.js +6 -1
- package/dist/harness/claude-code.js +2 -0
- 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 +11 -2
- package/dist/harness/codex-session.js +22 -2
- package/dist/harness/codex.d.ts +5 -1
- package/dist/harness/codex.js +110 -10
- package/dist/harness/types.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -3
- package/dist/init-guidance.d.ts +1 -1
- package/dist/init-guidance.js +4 -3
- package/dist/init-wizard.d.ts +98 -0
- package/dist/init-wizard.js +629 -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-env.d.ts +2 -2
- package/dist/model-env.js +1 -1
- package/dist/model-recovery.d.ts +1 -1
- package/dist/ops.js +2 -17
- package/dist/owner-channel/channel.d.ts +58 -0
- package/dist/owner-channel/channel.js +321 -42
- package/dist/owner-channel/commands.d.ts +6 -1
- package/dist/owner-channel/commands.js +34 -19
- 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-bootstrap.d.ts +10 -0
- package/dist/preset-bootstrap.js +85 -0
- package/dist/preset-migration.d.ts +42 -0
- package/dist/preset-migration.js +414 -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 +514 -75
- package/dist/rooms-tasks/close.d.ts +9 -1
- package/dist/rooms-tasks/close.js +20 -4
- package/dist/rooms-tasks/config.js +16 -14
- package/dist/rooms-tasks/cowork-adapter.d.ts +1 -0
- package/dist/rooms-tasks/cowork-adapter.js +6 -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 +1 -0
- package/dist/rooms-tasks/external-worker.js +14 -9
- 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/provision.js +184 -49
- package/dist/rooms-tasks/room-state.d.ts +1 -0
- package/dist/rooms-tasks/room-state.js +12 -1
- 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 -2
- package/dist/rooms-tasks/templates.js +42 -78
- package/dist/rooms-tasks/terminal.d.ts +3 -0
- package/dist/rooms-tasks/terminal.js +7 -3
- package/dist/rooms-tasks/types.d.ts +96 -17
- package/dist/rooms-tasks/types.js +14 -4
- package/dist/runner.d.ts +12 -2
- package/dist/runner.js +124 -43
- package/dist/session/acp.d.ts +9 -1
- package/dist/session/acp.js +35 -9
- 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 +14 -1
- package/dist/session/control.js +38 -0
- 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 +15 -31
- package/dist/spawn.js +117 -237
- package/dist/temp-lifecycle.d.ts +1 -1
- package/dist/watchdog/config.d.ts +10 -7
- package/dist/watchdog/config.js +29 -19
- package/dist/watchdog/run.js +4 -13
- package/dist/web/fleet-config-service.d.ts +1 -0
- package/dist/web/fleet-config-service.js +27 -8
- package/dist/web/runtime.js +11 -6
- package/dist/web/server.js +28 -1
- package/dist/web/topology-promote.js +8 -1
- package/dist/web-app/assets/index-C0h3ALvs.js +10 -0
- package/dist/web-app/index.html +1 -1
- package/package.json +3 -2
- package/presets/brain-catalog.json +16 -0
- package/presets/fleet/agent_templates/Critic.yaml +4 -0
- package/presets/fleet/agent_templates/Developer.yaml +4 -0
- package/presets/fleet/agent_templates/LocalCoordinator.yaml +4 -0
- package/presets/fleet/agents/FleetCoordinator.yaml +3 -0
- package/presets/fleet/brains/claude-default.yaml +5 -0
- 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/roles/Coordinator.yaml +30 -0
- package/presets/fleet/roles/Critic.yaml +19 -0
- package/presets/fleet/roles/Developer.yaml +19 -0
- package/presets/fleet/roles/LocalCoordinator.yaml +25 -0
- package/presets/fleet/room_templates/pair.yaml +10 -0
- package/presets/fleet/room_templates/single.yaml +7 -0
- package/presets/fleet/room_templates/team.yaml +12 -0
- package/presets/fleet.yaml +7 -0
- package/presets/manifest.json +6 -0
- package/dist/web-app/assets/index-BbE9EX6n.js +0 -10
|
@@ -4,11 +4,12 @@ import type { OwnerChannelHandle, OwnerChannelManagementRequest } from '../owner
|
|
|
4
4
|
import type { ScheduledLoopManagerHandle } from '../loops/manager.js';
|
|
5
5
|
import type { SpawnOpts } from '../spawn.js';
|
|
6
6
|
import type { ManagedFleetSpawnResult } from '../fleet-proxy.js';
|
|
7
|
+
import { type FleetAuditPresentation, type FleetCommandOutcomeClass } from '../fleet-command-audit.js';
|
|
7
8
|
export interface ControlRequest {
|
|
8
9
|
version: 1 | 2 | 3;
|
|
9
10
|
id: string;
|
|
10
11
|
token: string;
|
|
11
|
-
command: 'status' | 'snapshot' | 'submit_prompt' | 'respond_permission' | 'interrupt' | 'follow' | 'events_since' | 'owner_channel_manage' | 'loop_status' | 'loop_run_now' | 'loop_disable' | 'loop_enable' | 'reload_config' | 'conversation_page' | 'conversation_follow' | 'submit_prompt_v2' | 'interrupt_v2' | 'respond_permission_v2' | 'fleet_spawn';
|
|
12
|
+
command: 'status' | 'snapshot' | 'submit_prompt' | 'respond_permission' | 'interrupt' | 'follow' | 'events_since' | 'owner_channel_manage' | 'loop_status' | 'loop_run_now' | 'loop_disable' | 'loop_enable' | 'reload_config' | 'conversation_page' | 'conversation_follow' | 'submit_prompt_v2' | 'interrupt_v2' | 'respond_permission_v2' | 'fleet_spawn' | 'fleet_audit_begin' | 'fleet_audit_finish';
|
|
12
13
|
text?: string;
|
|
13
14
|
permissionId?: string;
|
|
14
15
|
optionId?: string;
|
|
@@ -30,6 +31,16 @@ export interface ControlRequest {
|
|
|
30
31
|
sessionGeneration?: string;
|
|
31
32
|
/** Typed managed-spawn request accepted only over the authenticated role control plane. */
|
|
32
33
|
spawn?: SpawnOpts;
|
|
34
|
+
audit?: {
|
|
35
|
+
requestId?: string;
|
|
36
|
+
argv?: string[];
|
|
37
|
+
correlationId?: string;
|
|
38
|
+
class?: FleetCommandOutcomeClass;
|
|
39
|
+
exitCode?: number;
|
|
40
|
+
effect?: 'not_started' | 'completed' | 'unknown';
|
|
41
|
+
resourceIds?: Record<string, string>;
|
|
42
|
+
presentations?: FleetAuditPresentation[];
|
|
43
|
+
};
|
|
33
44
|
}
|
|
34
45
|
export interface ControlResponse {
|
|
35
46
|
version: 1;
|
|
@@ -105,6 +116,7 @@ export declare class RoleControlServer {
|
|
|
105
116
|
private loopManager?;
|
|
106
117
|
private reloadConfig?;
|
|
107
118
|
private fleetSpawner?;
|
|
119
|
+
private fleetAuditor?;
|
|
108
120
|
constructor(stateDir: string, session: AgentSession, log: (line: string) => void);
|
|
109
121
|
start(): Promise<void>;
|
|
110
122
|
close(): Promise<void>;
|
|
@@ -113,6 +125,7 @@ export declare class RoleControlServer {
|
|
|
113
125
|
setLoopManager(loopManager: ScheduledLoopManagerHandle | undefined): void;
|
|
114
126
|
setConfigReloader(reloadConfig: (() => Promise<unknown>) | undefined): void;
|
|
115
127
|
setFleetSpawner(fleetSpawner: ((options: SpawnOpts) => Promise<ManagedFleetSpawnResult>) | undefined): void;
|
|
128
|
+
setFleetAuditor(auditor: RoleControlServer['fleetAuditor']): void;
|
|
116
129
|
private accept;
|
|
117
130
|
private handle;
|
|
118
131
|
/** Version and capability gate shared by every conversation v3 command. */
|
package/dist/session/control.js
CHANGED
|
@@ -3,6 +3,7 @@ import { chmodSync, existsSync, readFileSync, rmSync, writeFileSync } from 'node
|
|
|
3
3
|
import { createConnection, createServer } from 'node:net';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { SessionControlError } from './types.js';
|
|
6
|
+
import { validateFleetAuditBegin, validateFleetAuditFinish, } from '../fleet-command-audit.js';
|
|
6
7
|
import { interruptSession, queueSessionPrompt, respondSessionPermission, respondSessionPermissionV2, } from '../application/session-mutations.js';
|
|
7
8
|
const MAX_LINE_BYTES = 64 * 1024;
|
|
8
9
|
/** Commands that require protocol version 3. */
|
|
@@ -119,6 +120,7 @@ export class RoleControlServer {
|
|
|
119
120
|
loopManager;
|
|
120
121
|
reloadConfig;
|
|
121
122
|
fleetSpawner;
|
|
123
|
+
fleetAuditor;
|
|
122
124
|
constructor(stateDir, session, log) {
|
|
123
125
|
this.session = session;
|
|
124
126
|
this.log = log;
|
|
@@ -164,6 +166,7 @@ export class RoleControlServer {
|
|
|
164
166
|
setFleetSpawner(fleetSpawner) {
|
|
165
167
|
this.fleetSpawner = fleetSpawner;
|
|
166
168
|
}
|
|
169
|
+
setFleetAuditor(auditor) { this.fleetAuditor = auditor; }
|
|
167
170
|
accept(socket) {
|
|
168
171
|
this.sockets.add(socket);
|
|
169
172
|
socket.setEncoding('utf8');
|
|
@@ -233,6 +236,9 @@ export class RoleControlServer {
|
|
|
233
236
|
features: [
|
|
234
237
|
'events_since', 'observer_follow', 'retained_range',
|
|
235
238
|
...(this.session.conversationPage ? ['conversation_v3'] : []),
|
|
239
|
+
...(this.session.capabilities?.steering ? ['steering'] : []),
|
|
240
|
+
...(this.session.capabilities?.permissions ? ['permissions'] : []),
|
|
241
|
+
...(this.session.capabilities?.messagePhases ? ['message_phases'] : []),
|
|
236
242
|
],
|
|
237
243
|
},
|
|
238
244
|
});
|
|
@@ -311,6 +317,38 @@ export class RoleControlServer {
|
|
|
311
317
|
this.write(socket, { version: 1, id: request.id, ok: true, result });
|
|
312
318
|
return;
|
|
313
319
|
}
|
|
320
|
+
case 'fleet_audit_begin': {
|
|
321
|
+
if (!this.fleetAuditor)
|
|
322
|
+
throw new SessionControlError('rejected', 'fleet auditing is unavailable');
|
|
323
|
+
try {
|
|
324
|
+
validateFleetAuditBegin(request.audit);
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
throw new SessionControlError('rejected', 'valid fleet audit begin fields are required');
|
|
328
|
+
}
|
|
329
|
+
const result = await this.fleetAuditor.begin(request.audit.requestId, request.audit.argv);
|
|
330
|
+
this.write(socket, { version: 1, id: request.id, ok: true, result });
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
case 'fleet_audit_finish': {
|
|
334
|
+
if (!this.fleetAuditor)
|
|
335
|
+
throw new SessionControlError('rejected', 'fleet auditing is unavailable');
|
|
336
|
+
try {
|
|
337
|
+
validateFleetAuditFinish(request.audit);
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
throw new SessionControlError('rejected', 'valid fleet audit finish fields are required');
|
|
341
|
+
}
|
|
342
|
+
const audit = request.audit;
|
|
343
|
+
const result = await this.fleetAuditor.finish({
|
|
344
|
+
correlationId: audit.correlationId, class: audit.class, effect: audit.effect,
|
|
345
|
+
...(audit.exitCode === undefined ? {} : { exitCode: audit.exitCode }),
|
|
346
|
+
...(audit.resourceIds ? { resourceIds: audit.resourceIds } : {}),
|
|
347
|
+
...(audit.presentations ? { presentations: audit.presentations } : {}),
|
|
348
|
+
});
|
|
349
|
+
this.write(socket, { version: 1, id: request.id, ok: true, result });
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
314
352
|
case 'owner_channel_manage': {
|
|
315
353
|
if (!request.ownerChannel || typeof request.ownerChannel.action !== 'string')
|
|
316
354
|
throw new SessionControlError('rejected', 'owner-channel management action is required');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { PromptOrigin, TurnCancellationSource, TurnOutcome } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Durable conversation domain schema for
|
|
3
|
+
* Durable conversation domain schema for managed-session consoles.
|
|
4
4
|
*
|
|
5
5
|
* `SessionEvent` in ./types.js remains the compact diagnostic projection; the
|
|
6
6
|
* types here describe the durable per-role conversation ledger. Nothing in this
|
|
7
|
-
* file touches the wire:
|
|
8
|
-
*
|
|
7
|
+
* file touches the wire: transport updates are reduced into these shapes by a
|
|
8
|
+
* session adapter, and the store assigns `seq`/`eventId`/timestamps.
|
|
9
9
|
*/
|
|
10
10
|
export type ConversationEventKind = 'prompt.admitted' | 'prompt.started' | 'prompt.interrupt_requested' | 'message.chunk' | 'message.replace' | 'thought.chunk' | 'thought.replace' | 'plan.replace' | 'tool.upsert' | 'tool.content_chunk' | 'permission.requested' | 'permission.resolved' | 'monitor.delivery' | 'usage.updated' | 'turn.state' | 'turn.completed' | 'session.state' | 'session.info' | 'capabilities.updated' | 'error'
|
|
11
|
-
/** A well-formed
|
|
11
|
+
/** A well-formed transport update this version cannot represent. Bounded, never a crash. */
|
|
12
12
|
| 'unsupported';
|
|
13
13
|
/** Where a conversation record came from. Typed provenance, never prompt text. */
|
|
14
14
|
export type ConversationSource = 'owner_admin_console' | 'owner_channel' | 'fleet_monitor' | 'scheduled_loop' | 'startup' | 'local_console' | 'agent' | 'agent_replay';
|
package/dist/session/types.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type PromptOrigin = {
|
|
|
33
33
|
commandId: string;
|
|
34
34
|
};
|
|
35
35
|
export interface RuntimeSelectorMetadata {
|
|
36
|
-
/** Exact provider/model identifier reported by the live
|
|
36
|
+
/** Exact provider/model identifier reported by the live managed session. */
|
|
37
37
|
value: string;
|
|
38
38
|
/** Complete provider-supplied label for that exact value, when available. */
|
|
39
39
|
label?: string;
|
|
@@ -75,6 +75,8 @@ export interface TurnResult {
|
|
|
75
75
|
export type ControlFailureKind = 'offline' | 'control-unavailable' | 'timeout' | 'rejected' | 'backend';
|
|
76
76
|
/** Stable body-free reason shared by ACP recovery and durable ingress. */
|
|
77
77
|
export declare const ACP_CANCEL_DEADLINE_EXCEEDED = "ACP_CANCEL_DEADLINE_EXCEEDED";
|
|
78
|
+
/** Native Codex equivalent; kept distinct so diagnostics name the failing transport. */
|
|
79
|
+
export declare const CODEX_APP_SERVER_CANCEL_DEADLINE_EXCEEDED = "CODEX_APP_SERVER_CANCEL_DEADLINE_EXCEEDED";
|
|
78
80
|
export declare class SessionControlError extends Error {
|
|
79
81
|
readonly kind: ControlFailureKind;
|
|
80
82
|
/** Stable body-free machine reason for recovery/audit decisions. */
|
|
@@ -170,7 +172,7 @@ export interface SubmitPromptOptions {
|
|
|
170
172
|
interruptSource?: TurnCancellationSource;
|
|
171
173
|
/** Typed in-process provenance. Text markers never grant this origin. */
|
|
172
174
|
origin?: PromptOrigin;
|
|
173
|
-
/**
|
|
175
|
+
/** Inject into active work when the selected backend supports steering. */
|
|
174
176
|
steer?: boolean;
|
|
175
177
|
/** Audit-grade actor detail persisted with the conversation admission record. */
|
|
176
178
|
actor?: {
|
|
@@ -200,11 +202,25 @@ export interface SessionSnapshot {
|
|
|
200
202
|
activity?: SessionActivity;
|
|
201
203
|
}
|
|
202
204
|
export interface SessionActivity {
|
|
203
|
-
/**
|
|
205
|
+
/** Tool calls currently reserved (lifecycle open or permission pending). */
|
|
204
206
|
activeToolCalls: number;
|
|
205
207
|
/** When the agent last sent ANY session update, replay excluded. */
|
|
206
208
|
lastUpdateAt?: string;
|
|
207
209
|
}
|
|
210
|
+
/** Provider-neutral behavior exposed by a session transport. */
|
|
211
|
+
export interface AgentSessionCapabilities {
|
|
212
|
+
streaming: boolean;
|
|
213
|
+
durableConversation: boolean;
|
|
214
|
+
promptInput: boolean;
|
|
215
|
+
interrupt: boolean;
|
|
216
|
+
steering: boolean;
|
|
217
|
+
permissions: boolean;
|
|
218
|
+
toolBoundaryDelivery: boolean;
|
|
219
|
+
messagePhases: boolean;
|
|
220
|
+
resume: boolean;
|
|
221
|
+
}
|
|
222
|
+
/** Conservative static capabilities used before a live session is reachable. */
|
|
223
|
+
export declare function sessionBackendCapabilities(backend: SessionBackendId, harness?: string): AgentSessionCapabilities;
|
|
208
224
|
export type SessionEventKind = 'state' | 'agent_text' | 'thought' | 'tool_call' | 'tool_update' | 'permission' | 'monitor_delivery' | 'turn_stop' | 'error';
|
|
209
225
|
/** What a settled permission request resolved to. */
|
|
210
226
|
export type PermissionDecision = 'allowed' | 'denied' | 'cancelled';
|
|
@@ -219,7 +235,7 @@ export interface SessionEvent {
|
|
|
219
235
|
text?: string;
|
|
220
236
|
/**
|
|
221
237
|
* Adapter-authenticated presentation phase for assistant text. Only the
|
|
222
|
-
* exact Codex
|
|
238
|
+
* exact Codex phase marker is promoted; absence/unknown values stay unset.
|
|
223
239
|
*/
|
|
224
240
|
messagePhase?: 'commentary' | 'final_answer';
|
|
225
241
|
/** Stable adapter message/item id when supplied. */
|
|
@@ -261,11 +277,13 @@ export interface ConversationHandlePage {
|
|
|
261
277
|
/**
|
|
262
278
|
* The live, harness-neutral contract between Fleet and one agent session.
|
|
263
279
|
* Harness adapters construct this handle; orchestration code must not depend
|
|
264
|
-
* on
|
|
280
|
+
* on any concrete transport which implements it.
|
|
265
281
|
*/
|
|
266
282
|
export interface AgentSession {
|
|
267
283
|
readonly backend: SessionBackendId;
|
|
268
284
|
readonly pid: number;
|
|
285
|
+
/** Live capabilities; optional only for source compatibility with external adapters. */
|
|
286
|
+
readonly capabilities?: AgentSessionCapabilities;
|
|
269
287
|
isAlive(): boolean;
|
|
270
288
|
snapshot(): SessionSnapshot;
|
|
271
289
|
conversationPage?(request: {
|
|
@@ -283,7 +301,7 @@ export interface AgentSession {
|
|
|
283
301
|
queuePrompt(text: string, options?: SubmitPromptOptions): Promise<QueuedPrompt>;
|
|
284
302
|
/** Queue a prompt and wait for its terminal result. */
|
|
285
303
|
submitPrompt(text: string, options?: SubmitPromptOptions): Promise<TurnResult>;
|
|
286
|
-
/** Monitor-only
|
|
304
|
+
/** Monitor-only safe-boundary delivery. Never implies human/control cancellation. */
|
|
287
305
|
submitPromptAfterTool?(text: string, options?: SubmitPromptOptions): Promise<TurnResult>;
|
|
288
306
|
/**
|
|
289
307
|
* Cancel the active turn. Resolves when the cancellation has taken effect —
|
package/dist/session/types.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Stable body-free reason shared by ACP recovery and durable ingress. */
|
|
2
2
|
export const ACP_CANCEL_DEADLINE_EXCEEDED = 'ACP_CANCEL_DEADLINE_EXCEEDED';
|
|
3
|
+
/** Native Codex equivalent; kept distinct so diagnostics name the failing transport. */
|
|
4
|
+
export const CODEX_APP_SERVER_CANCEL_DEADLINE_EXCEEDED = 'CODEX_APP_SERVER_CANCEL_DEADLINE_EXCEEDED';
|
|
3
5
|
export class SessionControlError extends Error {
|
|
4
6
|
kind;
|
|
5
7
|
reasonCode;
|
|
@@ -53,3 +55,29 @@ export function turnResult(accepted, outcome, detail, output, cancellationSource
|
|
|
53
55
|
...(outcome === 'cancelled' && cancellationSource ? { cancellationSource } : {}),
|
|
54
56
|
};
|
|
55
57
|
}
|
|
58
|
+
/** Conservative static capabilities used before a live session is reachable. */
|
|
59
|
+
export function sessionBackendCapabilities(backend, harness) {
|
|
60
|
+
if (backend === 'codex-app-server')
|
|
61
|
+
return {
|
|
62
|
+
streaming: true,
|
|
63
|
+
durableConversation: true,
|
|
64
|
+
promptInput: true,
|
|
65
|
+
interrupt: true,
|
|
66
|
+
steering: true,
|
|
67
|
+
permissions: true,
|
|
68
|
+
toolBoundaryDelivery: false,
|
|
69
|
+
messagePhases: true,
|
|
70
|
+
resume: true,
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
streaming: true,
|
|
74
|
+
durableConversation: true,
|
|
75
|
+
promptInput: true,
|
|
76
|
+
interrupt: true,
|
|
77
|
+
steering: false,
|
|
78
|
+
permissions: true,
|
|
79
|
+
toolBoundaryDelivery: true,
|
|
80
|
+
messagePhases: harness === 'codex',
|
|
81
|
+
resume: true,
|
|
82
|
+
};
|
|
83
|
+
}
|
package/dist/spawn.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IsolationConfig } from './isolation/types.js';
|
|
2
|
-
import
|
|
2
|
+
import type { AgentLoopsConfig } from './loops/config.js';
|
|
3
|
+
import { type ApprovalMode, type FilesystemMode, type ResolvedRole, type MonitorConfig, type UnattendedMode, type RoomMemberStartup, type AgentDefinition, type AgentSelection } from './config.js';
|
|
3
4
|
import { type OpsDeps } from './ops.js';
|
|
4
5
|
import { type CreationDeps, type CreationProvenance } from './creation.js';
|
|
5
6
|
import './harness/claude-code.js';
|
|
@@ -13,34 +14,18 @@ export declare let lastProvenance: CreationProvenance | undefined;
|
|
|
13
14
|
export interface SpawnOpts {
|
|
14
15
|
name: string;
|
|
15
16
|
temp?: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
brain?: AgentSelection;
|
|
18
|
+
role?: AgentSelection;
|
|
19
|
+
/** Trusted canonical definition used by room provisioning; never a second schema. */
|
|
20
|
+
agentDefinition?: AgentDefinition;
|
|
20
21
|
identity?: string;
|
|
21
22
|
cwd?: string;
|
|
22
23
|
coordinator?: string;
|
|
23
|
-
/** null explicitly selects the harness default; undefined retains normal fleet inheritance. */
|
|
24
|
-
model?: string | null;
|
|
25
|
-
permissionMode?: string;
|
|
26
24
|
approval?: ApprovalMode;
|
|
27
25
|
filesystem?: FilesystemMode;
|
|
28
26
|
unattended?: UnattendedMode;
|
|
29
|
-
sandbox?: string;
|
|
30
|
-
profile?: string;
|
|
31
|
-
launcher?: string;
|
|
32
|
-
search?: boolean;
|
|
33
|
-
codexConfig?: Record<string, string | number | boolean>;
|
|
34
|
-
reasoningEffort?: string | null;
|
|
35
|
-
addDirs?: string[];
|
|
36
|
-
monitor?: boolean;
|
|
37
27
|
/** Typed external monitor configuration used by trusted creation surfaces. */
|
|
38
28
|
monitorConfig?: Partial<MonitorConfig>;
|
|
39
|
-
bioFile?: string;
|
|
40
|
-
personaFile?: string;
|
|
41
|
-
/** Inline profile values for trusted typed callers such as the local web service. */
|
|
42
|
-
bio?: string;
|
|
43
|
-
persona?: string;
|
|
44
29
|
/** Internal, non-sensitive provenance correlation for typed presentation layers. */
|
|
45
30
|
surface?: 'cli' | 'web' | 'agent';
|
|
46
31
|
creationActionId?: string;
|
|
@@ -56,17 +41,18 @@ export interface SpawnOpts {
|
|
|
56
41
|
* input in this release.
|
|
57
42
|
*/
|
|
58
43
|
isolationFile?: string;
|
|
44
|
+
/** Trusted YAML containing exactly a top-level `loops:` map. Temporary launches only. */
|
|
45
|
+
loopsFile?: string;
|
|
46
|
+
/** Explicitly override any selected Agent Template loops with none. */
|
|
47
|
+
noLoops?: boolean;
|
|
48
|
+
/** Internal source label retained after room-member plan resolution. */
|
|
49
|
+
loopSource?: 'agent-template' | 'cli' | 'omitted';
|
|
59
50
|
overseeInterval?: string;
|
|
60
51
|
configPath?: string;
|
|
61
52
|
dryRun?: boolean;
|
|
62
53
|
json?: boolean;
|
|
63
54
|
}
|
|
64
|
-
export declare function
|
|
65
|
-
bio?: string;
|
|
66
|
-
persona?: string;
|
|
67
|
-
};
|
|
68
|
-
/** Pure option-to-role mapping shared by CLI and application services. */
|
|
69
|
-
export declare function buildRoleConfig(o: SpawnOpts, defaultHarness?: string): RoleConfig;
|
|
55
|
+
export declare function agentDefinitionFromSpawn(o: SpawnOpts): AgentDefinition;
|
|
70
56
|
/**
|
|
71
57
|
* Read and validate an `--isolation-file`. The file is the existing
|
|
72
58
|
* `isolation:` mapping and nothing else — the same schema, the same validator
|
|
@@ -77,9 +63,9 @@ export declare function buildRoleConfig(o: SpawnOpts, defaultHarness?: string):
|
|
|
77
63
|
* must fail before any artifact exists.
|
|
78
64
|
*/
|
|
79
65
|
export declare function readIsolationFile(path: string): IsolationConfig;
|
|
66
|
+
/** Read a private canonical temporary-loop override before any creation side effect. */
|
|
67
|
+
export declare function readLoopsFile(path: string): AgentLoopsConfig;
|
|
80
68
|
export declare function validateSpawnOpts(o: SpawnOpts): void;
|
|
81
|
-
/** Read mission text without trimming or newline rewriting. */
|
|
82
|
-
export declare function readMissionFile(path: string): string;
|
|
83
69
|
/** The ours identity a spawn will bind: explicit, else the role name. */
|
|
84
70
|
export declare const effectiveIdentity: (o: SpawnOpts) => string;
|
|
85
71
|
export interface SpawnDryRun {
|
|
@@ -88,8 +74,6 @@ export interface SpawnDryRun {
|
|
|
88
74
|
roleDocument: Record<string, unknown>;
|
|
89
75
|
resolvedRole: ResolvedRole;
|
|
90
76
|
}
|
|
91
|
-
/** Bare Agent document written by v2 spawn: inline Role × inline Brain + operations. */
|
|
92
|
-
export declare function buildAgentDocument(raw: RoleConfig): Record<string, unknown>;
|
|
93
77
|
/**
|
|
94
78
|
* Validate and resolve a spawn without reserving names, contacting the daemon,
|
|
95
79
|
* or writing state. Collision checks are necessarily a point-in-time snapshot.
|