@cleocode/adapters 2026.11.2 → 2026.11.3-canary.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.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "schema": 2,
3
- "sourceHash": "a3e7beba4e0f300c5317416a0d780c676f407cfb94045e02fd506fb3046e6a38"
3
+ "sourceHash": "8034596e7abb416a12355374e9702f02699183c838b57f32299168624f61c5ef"
4
4
  }
package/dist/index.js CHANGED
@@ -1372,10 +1372,22 @@ var init_orca_execution = __esm({
1372
1372
  status: z4.string().optional(),
1373
1373
  terminal: z4.object({
1374
1374
  handle: identifier,
1375
- connected: z4.boolean(),
1376
- writable: z4.boolean(),
1377
- executionHostId: identifier
1375
+ connected: z4.boolean().optional(),
1376
+ writable: z4.boolean().optional(),
1377
+ executionHostId: identifier,
1378
+ worktreePath: identifier.optional(),
1379
+ processId: z4.number().int().positive().optional(),
1380
+ hostPlatform: z4.string().optional(),
1381
+ surface: z4.string().optional(),
1382
+ tabId: identifier.optional()
1378
1383
  }).optional(),
1384
+ focus: z4.object({
1385
+ handle: identifier,
1386
+ tabId: identifier,
1387
+ worktreeId: identifier,
1388
+ navigated: z4.boolean()
1389
+ }).optional(),
1390
+ close: z4.object({ handle: identifier, ptyKilled: z4.boolean() }).optional(),
1379
1391
  runtime: z4.object({
1380
1392
  runtimeId: identifier,
1381
1393
  reachable: z4.boolean(),
@@ -47066,6 +47078,46 @@ var init_install = __esm({
47066
47078
  }
47067
47079
  });
47068
47080
 
47081
+ // packages/adapters/src/orca-execution.ts
47082
+ import {
47083
+ ORCA_LEAD_LAUNCH_REFUSAL,
47084
+ orcaAccountReplySchema as orcaAccountReplySchema2,
47085
+ orcaCommandRegistrySchema as orcaCommandRegistrySchema2,
47086
+ orcaContextSchema as orcaContextSchema2,
47087
+ orcaLaunchSchema as orcaLaunchSchema2,
47088
+ orcaReplySchema as orcaReplySchema2,
47089
+ orcaReportMessageSchema as orcaReportMessageSchema2,
47090
+ orcaReportSourceSchema as orcaReportSourceSchema2,
47091
+ orcaWorkerDonePayloadSchema as orcaWorkerDonePayloadSchema2
47092
+ } from "@cleocode/contracts/orca-execution.js";
47093
+ var MAX_DIAGNOSTIC_LENGTH, MAX_RECEIPT_LENGTH, OrcaExecutionError;
47094
+ var init_orca_execution2 = __esm({
47095
+ "packages/adapters/src/orca-execution.ts"() {
47096
+ "use strict";
47097
+ MAX_DIAGNOSTIC_LENGTH = 4096;
47098
+ MAX_RECEIPT_LENGTH = 65536;
47099
+ OrcaExecutionError = class extends Error {
47100
+ /** Numeric CLI refusal status, independent of a worker's exit. */
47101
+ exitCode = 63;
47102
+ /** Stable refusal code. */
47103
+ code;
47104
+ /** Recovery instruction that never disables the lead policy. */
47105
+ fix;
47106
+ /** Bounded original receipt, when available; oversized receipts are diagnostic only. */
47107
+ receipt;
47108
+ /** Construct a refusal before any unsupported operation runs. */
47109
+ constructor(code, message, fix, receipt = null) {
47110
+ super(message.slice(0, MAX_DIAGNOSTIC_LENGTH));
47111
+ this.name = "OrcaExecutionError";
47112
+ this.code = code;
47113
+ this.fix = fix;
47114
+ const truncated = "[truncated]\n";
47115
+ this.receipt = receipt !== null && receipt.length > MAX_RECEIPT_LENGTH ? truncated + receipt.slice(0, MAX_RECEIPT_LENGTH - truncated.length) : receipt;
47116
+ }
47117
+ };
47118
+ }
47119
+ });
47120
+
47069
47121
  // packages/adapters/src/providers/shared/agent-spawn-wrapper.ts
47070
47122
  import { spawnSync } from "node:child_process";
47071
47123
  import { readFileSync as readFileSync6 } from "node:fs";
@@ -47539,6 +47591,7 @@ var init_spawn2 = __esm({
47539
47591
  "packages/adapters/src/providers/claude-code/spawn.ts"() {
47540
47592
  "use strict";
47541
47593
  init_src();
47594
+ init_orca_execution2();
47542
47595
  init_agent_spawn_wrapper();
47543
47596
  init_lead_tool_strip();
47544
47597
  init_prompt_file();
@@ -47631,6 +47684,34 @@ var init_spawn2 = __esm({
47631
47684
  leadMcp: leadMcp.report
47632
47685
  };
47633
47686
  }
47687
+ if (context.leadTerminalLauncher) {
47688
+ const command = resolveAbsoluteBinary("claude");
47689
+ if (!command || !context.onLeadStarted) {
47690
+ throw new Error(
47691
+ "The guarded Orca lead needs an absolute claude binary and a lifecycle recorder."
47692
+ );
47693
+ }
47694
+ const terminal = await context.leadTerminalLauncher(
47695
+ {
47696
+ command,
47697
+ args: buildClaudeArgs(context, tmpFile, settingsArgs, leadMcp),
47698
+ cwd: context.workingDirectory ?? process.cwd(),
47699
+ tempDir: dir,
47700
+ env: envStrings(context.options)
47701
+ },
47702
+ context.onLeadStarted
47703
+ );
47704
+ return {
47705
+ instanceId,
47706
+ taskId: context.taskId,
47707
+ providerId: "claude-code",
47708
+ status: "running",
47709
+ startTime,
47710
+ leadMcp: leadMcp.report,
47711
+ leadTempDir: dir,
47712
+ leadTerminal: terminal
47713
+ };
47714
+ }
47634
47715
  if (leadModeOf(context.options) === "interactive") {
47635
47716
  const env = envStrings(context.options);
47636
47717
  const exit = await runInteractiveLead(
@@ -47704,10 +47785,18 @@ var init_spawn2 = __esm({
47704
47785
  ...leadMcp ? { leadMcp: leadMcp.report, leadTempDir: dirname7(tmpFile) } : {}
47705
47786
  };
47706
47787
  } catch (error48) {
47707
- console.error(`[ClaudeCodeSpawnProvider] Failed to spawn: ${getErrorMessage(error48)}`);
47708
47788
  if (tmpFile) {
47709
47789
  await removeSpawnPromptFile(tmpFile);
47710
47790
  }
47791
+ if (context.leadTerminalLauncher) {
47792
+ if (error48 instanceof OrcaExecutionError) throw error48;
47793
+ throw new OrcaExecutionError(
47794
+ "E_LEAD_TOOLS_UNSTRIPPED",
47795
+ getErrorMessage(error48),
47796
+ "Inspect the guarded Orca terminal setup and use --adapter claude-code; keep orchestrate.leadWorker.v1 enabled."
47797
+ );
47798
+ }
47799
+ console.error(`[ClaudeCodeSpawnProvider] Failed to spawn: ${getErrorMessage(error48)}`);
47711
47800
  return {
47712
47801
  instanceId,
47713
47802
  taskId: context.taskId,