@ours.network/fleet 1.2.0-nightly.16 → 1.2.0-nightly.18

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.
@@ -20,12 +20,19 @@ export function prepareManagedHarness(role, stateDir, cwd, descriptor, env) {
20
20
  args: [bridge],
21
21
  env: [{ name: 'FLEET_OURS_BRIDGE_DESCRIPTOR', value: descriptor }],
22
22
  };
23
+ // Portable allow covers bound identity messaging, not all tools on the server.
24
+ const tools = role.harness === 'codex' && role.permissions?.approval === 'allow'
25
+ ? Object.fromEntries([
26
+ 'current_identity', 'get_messages', 'list_history', 'list_contacts', 'send_message',
27
+ ].map(name => [name, { approval_mode: 'approve' }]))
28
+ : undefined;
23
29
  const native = {
24
30
  mcp_servers: {
25
31
  ours: {
26
32
  command: process.execPath,
27
33
  args: [bridge],
28
34
  env: { FLEET_OURS_BRIDGE_DESCRIPTOR: descriptor },
35
+ ...(tools ? { tools } : {}),
29
36
  },
30
37
  },
31
38
  plugins: { 'ours@ours-codex-marketplace': { enabled: false } },
@@ -35,6 +42,7 @@ export function prepareManagedHarness(role, stateDir, cwd, descriptor, env) {
35
42
  const config = child.CODEX_CONFIG ? JSON.parse(child.CODEX_CONFIG) : {};
36
43
  child.CODEX_CONFIG = JSON.stringify({
37
44
  ...config,
45
+ mcp_servers: { ...config.mcp_servers, ...native.mcp_servers },
38
46
  plugins: { ...config.plugins, ...native.plugins },
39
47
  });
40
48
  // codex-acp otherwise prefers a same-name connector from the user's config.
@@ -1,9 +1,9 @@
1
1
  {
2
- "version": "1.2.0-nightly.16",
3
- "buildId": "165e9b4f7cc7",
4
- "commit": "6f621eee7791b35ceb6ec72ce7260e288f718002",
2
+ "version": "1.2.0-nightly.18",
3
+ "buildId": "ebe5625dea3d",
4
+ "commit": "001f19fafca885730a38f492b8b2a53ade023bd5",
5
5
  "dirty": true,
6
- "builtAt": "2026-09-26T19:18:02.562Z",
6
+ "builtAt": "2026-09-27T07:11:34.187Z",
7
7
  "capabilities": [
8
8
  "cowork.http-management-v1",
9
9
  "monitor.interrupt.after_tool"
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ type JsonObject = Record<string, unknown>;
2
3
  interface TerminalRecoveryOptions {
3
4
  sendToCodex(line: string): void;
4
5
  emitToClient(line: string): void;
@@ -39,6 +40,8 @@ export declare class CodexTerminalRecovery {
39
40
  private finishTurn;
40
41
  }
41
42
  /** Transform one app-server NDJSON request; malformed input passes through. */
42
- export declare function rewriteCodexAppServerRequest(line: string, approval: string, expectedSandbox: string, disableInheritedMcp?: boolean): string;
43
+ export declare function rewriteCodexAppServerRequest(line: string, approval: string, expectedSandbox: string, disableInheritedMcp?: boolean, managedOursTools?: JsonObject): string;
44
+ /** ACP only carries transport fields; read policy from Fleet's complete config. */
45
+ export declare function managedCodexToolPolicy(env: NodeJS.ProcessEnv): JsonObject | undefined;
43
46
  export declare function runCodexAppServerProxy(): void;
44
47
  export {};
@@ -300,9 +300,9 @@ function sandboxMode(policy) {
300
300
  * Fleet keeps the preset's sandbox policy, but restores the independently
301
301
  * configured approval policy on the request Codex actually executes.
302
302
  */
303
- function rewriteMessage(value, approval, expectedSandbox, disableInheritedMcp) {
303
+ function rewriteMessage(value, approval, expectedSandbox, disableInheritedMcp, managedOursTools) {
304
304
  if (Array.isArray(value))
305
- return value.map(candidate => rewriteMessage(candidate, approval, expectedSandbox, disableInheritedMcp));
305
+ return value.map(candidate => rewriteMessage(candidate, approval, expectedSandbox, disableInheritedMcp, managedOursTools));
306
306
  if (!isObject(value) || !isObject(value.params))
307
307
  return value;
308
308
  if (value.method === 'turn/start') {
@@ -318,17 +318,52 @@ function rewriteMessage(value, approval, expectedSandbox, disableInheritedMcp) {
318
318
  params: { ...value.params, config: { ...config, mcp_servers: {} } },
319
319
  };
320
320
  }
321
+ if (managedOursTools
322
+ && (value.method === 'thread/start' || value.method === 'thread/resume')) {
323
+ const config = isObject(value.params.config) ? value.params.config : {};
324
+ const servers = isObject(config.mcp_servers) ? config.mcp_servers : {};
325
+ const ours = servers.ours;
326
+ // Policy cannot create or re-enable a connector that ACP did not inject.
327
+ if (!isObject(ours) || ours.enabled === false)
328
+ return value;
329
+ const tools = isObject(ours.tools) ? { ...ours.tools } : {};
330
+ for (const [name, policy] of Object.entries(managedOursTools)) {
331
+ if (isObject(policy))
332
+ tools[name] = {
333
+ ...(isObject(tools[name]) ? tools[name] : {}), ...policy,
334
+ };
335
+ }
336
+ return { ...value, params: { ...value.params, config: { ...config,
337
+ mcp_servers: { ...servers, ours: { ...ours, tools } },
338
+ } } };
339
+ }
321
340
  return value;
322
341
  }
323
342
  /** Transform one app-server NDJSON request; malformed input passes through. */
324
- export function rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp = false) {
343
+ export function rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp = false, managedOursTools) {
325
344
  try {
326
- return JSON.stringify(rewriteMessage(JSON.parse(line), approval, expectedSandbox, disableInheritedMcp));
345
+ return JSON.stringify(rewriteMessage(JSON.parse(line), approval, expectedSandbox, disableInheritedMcp, managedOursTools));
327
346
  }
328
347
  catch {
329
348
  return line;
330
349
  }
331
350
  }
351
+ /** ACP only carries transport fields; read policy from Fleet's complete config. */
352
+ export function managedCodexToolPolicy(env) {
353
+ if (env.FLEET_OURS_MANAGED !== '1')
354
+ return undefined;
355
+ try {
356
+ const config = JSON.parse(env.CODEX_CONFIG ?? '{}');
357
+ const servers = isObject(config) ? config.mcp_servers : undefined;
358
+ const ours = isObject(servers) ? servers.ours : undefined;
359
+ return isObject(ours) && ours.enabled !== false && isObject(ours.tools)
360
+ ? ours.tools : undefined;
361
+ }
362
+ catch {
363
+ // Invalid config never grants tool approval. ACP owns config diagnostics.
364
+ return undefined;
365
+ }
366
+ }
332
367
  function requiredChoice(name, allowed) {
333
368
  const value = process.env[name];
334
369
  if (value && allowed.has(value))
@@ -355,6 +390,7 @@ export function runCodexAppServerProxy() {
355
390
  const approval = requiredChoice(APPROVAL_ENV, APPROVAL_POLICIES);
356
391
  const expectedSandbox = requiredChoice(SANDBOX_ENV, SANDBOX_MODES);
357
392
  const disableInheritedMcp = process.env[DISABLE_INHERITED_MCP_ENV] === '1';
393
+ const managedOursTools = managedCodexToolPolicy(process.env);
358
394
  const launch = realCodexLaunch();
359
395
  const env = { ...process.env };
360
396
  delete env.CODEX_PATH;
@@ -450,7 +486,7 @@ export function runCodexAppServerProxy() {
450
486
  input.on('line', line => {
451
487
  if (finished)
452
488
  return;
453
- const rewritten = rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp);
489
+ const rewritten = rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp, managedOursTools);
454
490
  recovery.observeClientLine(rewritten);
455
491
  writeToChild(rewritten);
456
492
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/fleet",
3
- "version": "1.2.0-nightly.16",
3
+ "version": "1.2.0-nightly.18",
4
4
  "description": "Harness-agnostic fleet of persistent, identity-bound AI agents. Declarative fleet.yaml, managed native/ACP sessions, supervision, and ours.network messaging.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",
@@ -42,9 +42,9 @@
42
42
  "@agentclientprotocol/sdk": "^1.3.0",
43
43
  "@fastify/static": "^10.1.2",
44
44
  "@fastify/websocket": "^11.2.0",
45
- "@ours.network/cli": "2.8.1-nightly.11",
46
- "@ours.network/mcp": "1.2.0-nightly.8",
47
- "@ours.network/sdk": "3.8.1-nightly.13",
45
+ "@ours.network/cli": "2.8.1-nightly.12",
46
+ "@ours.network/mcp": "1.2.0-nightly.9",
47
+ "@ours.network/sdk": "3.8.1-nightly.14",
48
48
  "commander": "^12.1.0",
49
49
  "fastify": "^5.4.0",
50
50
  "react": "^19.1.1",
@@ -58,7 +58,7 @@
58
58
  "@agentclientprotocol/codex-acp": "1.10.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@ours.network/daemon": "3.8.1-nightly.5",
61
+ "@ours.network/daemon": "3.8.1-nightly.6",
62
62
  "@playwright/test": "^1.54.1",
63
63
  "@types/node": "^20.14.0",
64
64
  "@types/react": "^19.1.9",