@ours.network/fleet 0.13.0 → 0.13.1

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.
@@ -207,6 +207,11 @@ export function makeClaudeCodeAdapter(exec = realExec) {
207
207
  : bundledAcpAgent('@agentclientprotocol/claude-agent-acp', 'claude-agent-acp', 'claude-agent-acp');
208
208
  return { argv, env: prep.env };
209
209
  },
210
+ // Same source as buildLaunch's --permission-mode flag, so the tmux and ACP
211
+ // backends cannot disagree about what a role's permissions translate to.
212
+ acpPermissionModeId(role) {
213
+ return permissionMode(role);
214
+ },
210
215
  isolationPaths(_role, _dirs) {
211
216
  const claudeHome = join(home(), '.claude');
212
217
  return {
@@ -98,6 +98,12 @@ export interface HarnessAdapter {
98
98
  prepareSession(role: ResolvedRole, dirs: RoleDirs): Promise<SessionPrep>;
99
99
  buildLaunch(role: ResolvedRole, mode: 'fresh' | 'resume', s: SessionState, prep: SessionPrep): Launch;
100
100
  buildAcpLaunch?(role: ResolvedRole, prep: SessionPrep): AcpLaunch;
101
+ /**
102
+ * The native permission-mode id an ACP session should run at, from the same
103
+ * translation `buildLaunch` uses for its CLI flag. `undefined` keeps the
104
+ * agent's default. Omit for a harness whose ACP agent has no modes.
105
+ */
106
+ acpPermissionModeId?(role: ResolvedRole): string | undefined;
101
107
  /**
102
108
  * REQUIRED. Every adapter must either translate neutral permissions or
103
109
  * explicitly declare that it cannot. Enforced at registration.
package/dist/runner.js CHANGED
@@ -442,6 +442,7 @@ export async function runOnce(name, opts = {}, partialDeps = {}) {
442
442
  stateDir: dir,
443
443
  mode,
444
444
  permissions: perms,
445
+ modeId: adapter.acpPermissionModeId?.(role),
445
446
  log: deps.log,
446
447
  });
447
448
  pid = acpSession.pid;
@@ -8,6 +8,8 @@ export interface AcpSessionOptions {
8
8
  stateDir: string;
9
9
  mode: 'fresh' | 'resume';
10
10
  permissions: CommonPermissions;
11
+ /** Native permission-mode id to request via session/set_mode; undefined keeps the agent default. */
12
+ modeId?: string;
11
13
  log(line: string): void;
12
14
  }
13
15
  /**
@@ -251,6 +251,22 @@ export class AcpSession {
251
251
  this.sessionId = created.sessionId;
252
252
  }
253
253
  writeFileSync(this.sessionFile, this.sessionId + '\n', { mode: 0o600 });
254
+ // Deliver the configured permission mode whichever way the session came up
255
+ // (new, resume or load) — the launch flag never reaches an ACP agent. A
256
+ // refusal is loud but never fatal: the session then simply runs at the
257
+ // agent's own default.
258
+ if (this.options.modeId) {
259
+ try {
260
+ await this.connection.agent.request(acp.methods.agent.session.setMode, {
261
+ sessionId: this.sessionId,
262
+ modeId: this.options.modeId,
263
+ });
264
+ }
265
+ catch (e) {
266
+ this.options.log(`[${this.options.name}] acp: session/set_mode "${this.options.modeId}" failed ` +
267
+ `(${e instanceof Error ? e.message : String(e)}) — session runs at the agent default permission mode`);
268
+ }
269
+ }
254
270
  this.readiness = 'idle';
255
271
  this.events.emit('state', { status: 'idle', text: `ACP session ${this.sessionId}` });
256
272
  }
package/dist/spawn.js CHANGED
@@ -253,6 +253,7 @@ function provenanceSettings(o, defaults) {
253
253
  ? { value: explicitModel, source: 'cli' }
254
254
  : { value: inheritedModel, source: inheritedModel ? 'fleet-default' : 'built-in' },
255
255
  coordinator: provenanceOf(o.coordinator, undefined, undefined),
256
+ permission_mode: provenanceOf(o.permissionMode, undefined, undefined),
256
257
  approval: provenanceOf(o.approval, perms.approval, 'ask'),
257
258
  filesystem: provenanceOf(o.filesystem, perms.filesystem, 'workspace'),
258
259
  unattended: provenanceOf(o.unattended, perms.unattended, 'deny'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/fleet",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Harness-agnostic fleet of persistent, identity-bound AI agents. Declarative fleet.yaml, tmux or ACP sessions, supervision, and ours.network messaging.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",