@letta-ai/letta-code 0.34.74 → 0.34.75

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 +1 @@
1
- {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/cron/scheduler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAuB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EAWd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAElB,KAAK,iBAAiB,GAAG,CACvB,UAAU,EAAE,eAAe,EAC3B,aAAa,EAAE,aAAa,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;AAqBnB,eAAO,MAAM,wBAAwB,+BAA+B,CAAC;AAErE,wBAAgB,yBAAyB,CACvC,KAAK,qBAAwC,GAC5C,kBAAkB,CAEpB;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAKT;AAiED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE5C;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,gBAAgB,GACvB,MAAM,CAER;AAiFD,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAQjE;AAcD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,EA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ound-queue.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/inbound-queue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,GACxB,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,GACxB,MAAM,EAAE,CAQV;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,eAAe,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,OAAO,CA+BT"}
1
+ {"version":3,"file":"inbound-queue.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/inbound-queue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,GACxB,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,GACxB,MAAM,EAAE,CAQV;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,eAAe,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,OAAO,CAgCT"}
@@ -1 +1 @@
1
- {"version":3,"file":"recorded-tool-results.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/recorded-tool-results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,GAC5B,cAAc,EAAE,CAQlB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,qBAAqB,EAC7B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,cAAc,EAAE,CAWlB"}
1
+ {"version":3,"file":"recorded-tool-results.d.ts","sourceRoot":"","sources":["../../../../src/websocket/listener/recorded-tool-results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAKjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,GAC5B,cAAc,EAAE,CAQlB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,qBAAqB,EAC7B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,cAAc,EAAE,CAelB"}
@@ -16,6 +16,9 @@ export declare function evictConversationRuntimeIfIdle(runtime: ConversationRunt
16
16
  export declare function getListenerStatus(listener: ListenerRuntime): "idle" | "receiving" | "processing";
17
17
  export declare function emitListenerStatus(listener: ListenerRuntime, onStatusChange: StartListenerOptions["onStatusChange"] | undefined, connectionId: string | undefined): void;
18
18
  export declare function getConversationRuntimeKey(agentId?: string | null, conversationId?: string | null): string;
19
+ export declare function isSidebandOnlyScope(listener: ListenerRuntime, key: string): boolean;
20
+ export declare function markSidebandOnlyScope(listener: ListenerRuntime, key: string): void;
21
+ export declare function markLocalTurnScope(runtime: ConversationRuntime): void;
19
22
  export declare function createConversationRuntime(listener: ListenerRuntime, agentId?: string | null, conversationId?: string | null): ConversationRuntime;
20
23
  export declare function getConversationRuntime(listener: ListenerRuntime, agentId?: string | null, conversationId?: string | null): ConversationRuntime | null;
21
24
  export declare function getOrCreateConversationRuntime(listener: ListenerRuntime, agentId?: string | null, conversationId?: string | null): ConversationRuntime;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/websocket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Q,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,GACA,OAAO,CAuBT;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,eAAe,EACxB,MAAM,CAAC,EAAE;IACP,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,GACA,MAAM,CAER"}
package/letta.js CHANGED
@@ -6156,7 +6156,7 @@ var package_default;
6156
6156
  var init_package = __esm(() => {
6157
6157
  package_default = {
6158
6158
  name: "@letta-ai/letta-code",
6159
- version: "0.34.74",
6159
+ version: "0.34.75",
6160
6160
  lettaStartupLogProtocol: 1,
6161
6161
  lettaConfigDirProtocol: 1,
6162
6162
  description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
@@ -212280,7 +212280,7 @@ var init_mcp_client = __esm(() => {
212280
212280
  init_streamableHttp();
212281
212281
  DEFAULT_CLIENT_INFO = {
212282
212282
  name: "letta-code",
212283
- version: "0.34.74"
212283
+ version: "0.34.75"
212284
212284
  };
212285
212285
  });
212286
212286
 
@@ -238756,9 +238756,13 @@ function enqueueInboundUserMessage(runtime, incoming, actingUserId, options = {}
238756
238756
  if (!enqueuedItem) {
238757
238757
  return false;
238758
238758
  }
238759
+ markLocalTurnScope(runtime);
238759
238760
  runtime.queuedMessagesByItemId.set(enqueuedItem.id, incoming);
238760
238761
  return true;
238761
238762
  }
238763
+ var init_inbound_queue = __esm(() => {
238764
+ init_runtime6();
238765
+ });
238762
238766
 
238763
238767
  // src/websocket/listener/turn-correlation.ts
238764
238768
  function takeDequeuedClientMessageIds(runtime, batchId) {
@@ -238827,6 +238831,7 @@ function createTurnCorrelation(runtime, message, batchId) {
238827
238831
  }
238828
238832
  var MAX_CLIENT_MESSAGE_IDS_PER_RUN = 32, MAX_RECENT_RUN_CORRELATIONS = 32, MAX_RECENT_CONVERSATIONS = 256;
238829
238833
  var init_turn_correlation = __esm(() => {
238834
+ init_inbound_queue();
238830
238835
  init_runtime6();
238831
238836
  });
238832
238837
 
@@ -251033,7 +251038,7 @@ class CodexAppServerClient {
251033
251038
  await this.request("initialize", {
251034
251039
  clientInfo: {
251035
251040
  name: "letta-code",
251036
- version: "0.34.74"
251041
+ version: "0.34.75"
251037
251042
  },
251038
251043
  capabilities: null
251039
251044
  });
@@ -255561,7 +255566,7 @@ async function fetchParentConversationMessages(params) {
255561
255566
  }
255562
255567
  return messages.reverse();
255563
255568
  }
255564
- function contentText3(content) {
255569
+ function contentText2(content) {
255565
255570
  if (typeof content === "string")
255566
255571
  return content;
255567
255572
  if (!Array.isArray(content))
@@ -255587,7 +255592,7 @@ function renderToolCall(call) {
255587
255592
  }
255588
255593
  function renderToolResult(result3) {
255589
255594
  const raw2 = result3.tool_return ?? result3.func_response;
255590
- const text2 = typeof raw2 === "string" ? raw2 : contentText3(raw2) || (raw2 == null ? "" : JSON.stringify(raw2));
255595
+ const text2 = typeof raw2 === "string" ? raw2 : contentText2(raw2) || (raw2 == null ? "" : JSON.stringify(raw2));
255591
255596
  return {
255592
255597
  type: "tool_result",
255593
255598
  call_id: result3.tool_call_id ?? undefined,
@@ -255623,11 +255628,11 @@ function userEvents(text2, speaker) {
255623
255628
  function renderMessage(message2) {
255624
255629
  switch (message2.message_type) {
255625
255630
  case "user_message": {
255626
- const text2 = stripNonScheduledSystemReminders(contentText3(message2.content)).trim();
255631
+ const text2 = stripNonScheduledSystemReminders(contentText2(message2.content)).trim();
255627
255632
  return userEvents(text2, message2.name ?? undefined);
255628
255633
  }
255629
255634
  case "assistant_message": {
255630
- const text2 = contentText3(message2.content).trim();
255635
+ const text2 = contentText2(message2.content).trim();
255631
255636
  return text2 ? [
255632
255637
  {
255633
255638
  type: "message",
@@ -263786,7 +263791,7 @@ function recordedToolResults(record5, pendingToolCallIds) {
263786
263791
  type: "approval",
263787
263792
  tool_call_id: id,
263788
263793
  approve: false,
263789
- reason: STALE_APPROVAL_RECOVERY_DENIAL_REASON
263794
+ reason: record5.toolCallIds.includes(id) && record5.unstartedToolCallIds?.includes(id) === false ? STARTED_TOOL_CALL_RECOVERY_DENIAL_REASON : STALE_APPROVAL_RECOVERY_DENIAL_REASON
263790
263795
  });
263791
263796
  }
263792
263797
  var init_recorded_tool_results = __esm(() => {
@@ -265252,6 +265257,9 @@ __export(exports_runtime, {
265252
265257
  setActiveRuntime: () => setActiveRuntime,
265253
265258
  safeEmitWsEvent: () => safeEmitWsEvent,
265254
265259
  nextEventSeq: () => nextEventSeq,
265260
+ markSidebandOnlyScope: () => markSidebandOnlyScope,
265261
+ markLocalTurnScope: () => markLocalTurnScope,
265262
+ isSidebandOnlyScope: () => isSidebandOnlyScope,
265255
265263
  invalidateExternalToolNotifications: () => invalidateExternalToolNotifications,
265256
265264
  hasInterruptedCacheForScope: () => hasInterruptedCacheForScope,
265257
265265
  getRuntimeAuthorityEpoch: () => getRuntimeAuthorityEpoch,
@@ -265409,6 +265417,20 @@ function getConversationRuntimeKey(agentId, conversationId) {
265409
265417
  const normalizedAgentId = normalizeCwdAgentId(agentId);
265410
265418
  return `agent:${normalizedAgentId ?? "__unknown__"}::conversation:${normalizedConversationId}`;
265411
265419
  }
265420
+ function isSidebandOnlyScope(listener, key4) {
265421
+ return sidebandScopesByListener.get(listener)?.has(key4) ?? false;
265422
+ }
265423
+ function markSidebandOnlyScope(listener, key4) {
265424
+ let scopes = sidebandScopesByListener.get(listener);
265425
+ if (!scopes) {
265426
+ scopes = new Set;
265427
+ sidebandScopesByListener.set(listener, scopes);
265428
+ }
265429
+ scopes.add(key4);
265430
+ }
265431
+ function markLocalTurnScope(runtime) {
265432
+ sidebandScopesByListener.get(runtime.listener)?.delete(runtime.key);
265433
+ }
265412
265434
  function createConversationRuntime(listener, agentId, conversationId) {
265413
265435
  const normalizedAgentId = normalizeCwdAgentId(agentId);
265414
265436
  const normalizedConversationId = normalizeConversationId(conversationId);
@@ -265591,7 +265613,7 @@ function hasInterruptedCacheForScope(runtime, params) {
265591
265613
  function getPendingControlRequestCount(runtime, params) {
265592
265614
  return getPendingControlRequests(runtime, params).length;
265593
265615
  }
265594
- var activeRuntime = null, activeRuntimeAuthorityEpoch = 0, authorityEpochByRuntime, WORKTREE_WATCHER_IDLE_STOP_MS, watcherIdleStopsByListener, __watcherIdleStopTestUtils;
265616
+ var activeRuntime = null, activeRuntimeAuthorityEpoch = 0, authorityEpochByRuntime, WORKTREE_WATCHER_IDLE_STOP_MS, watcherIdleStopsByListener, __watcherIdleStopTestUtils, sidebandScopesByListener;
265595
265617
  var init_runtime6 = __esm(() => {
265596
265618
  init_ws_event_redaction();
265597
265619
  init_background_process_snapshot();
@@ -265616,6 +265638,7 @@ var init_runtime6 = __esm(() => {
265616
265638
  return watcherIdleStopsByListener.get(listener)?.has(scopeKey2) ?? false;
265617
265639
  }
265618
265640
  };
265641
+ sidebandScopesByListener = new WeakMap;
265619
265642
  });
265620
265643
 
265621
265644
  // src/websocket/listener/startup-frame-buffer.ts
@@ -268831,6 +268854,7 @@ var init_queue = __esm(() => {
268831
268854
  init_debug();
268832
268855
  init_connection();
268833
268856
  init_image_policy();
268857
+ init_inbound_queue();
268834
268858
  init_protocol_outbound();
268835
268859
  init_runtime6();
268836
268860
  init_transport2();
@@ -269420,6 +269444,7 @@ var discardQueuedItem = (runtime, item) => {
269420
269444
  var init_conversation_runtime = __esm(() => {
269421
269445
  init_queue_runtime();
269422
269446
  init_debug();
269447
+ init_inbound_queue();
269423
269448
  init_input_disposition();
269424
269449
  init_input_disposition_retention();
269425
269450
  init_input_terminal_journal();
@@ -269634,24 +269659,24 @@ async function fireCronTask(task2, timing2, socket, opts, processQueuedTurn, tri
269634
269659
  });
269635
269660
  return false;
269636
269661
  }
269637
- const rawRuntime = getOrCreateConversationRuntime(listener, task2.agent_id, targetConversationId);
269638
- if (!rawRuntime) {
269662
+ if (isSidebandOnlyScope(listener, getConversationRuntimeKey(task2.agent_id, targetConversationId))) {
269639
269663
  setLastRunOutcome(task2.id, {
269640
269664
  outcome: "failed",
269641
269665
  reason: "runtime_unavailable",
269642
269666
  runAt: timing2.schedulerNow,
269643
- error: "Conversation runtime unavailable"
269667
+ error: "Conversation is only held for remote worker control"
269644
269668
  });
269645
269669
  safeAppendCronRunLogForTask(task2, {
269646
269670
  status: "error",
269647
269671
  outcome: "failed",
269648
269672
  reason: "runtime_unavailable",
269649
- error: "Conversation runtime unavailable",
269673
+ error: "Conversation is only held for remote worker control",
269650
269674
  runAtMs: timing2.schedulerNow.getTime(),
269651
269675
  scheduledFor: task2.scheduled_for
269652
269676
  });
269653
269677
  return false;
269654
269678
  }
269679
+ const rawRuntime = getOrCreateConversationRuntime(listener, task2.agent_id, targetConversationId);
269655
269680
  const conversationRuntime = ensureConversationQueueRuntime(listener, rawRuntime);
269656
269681
  if (trigger === "automatic" && getTask(task2.id)?.status !== "active") {
269657
269682
  return false;
@@ -274006,6 +274031,48 @@ var init_approval = __esm(() => {
274006
274031
  init_turn_status();
274007
274032
  });
274008
274033
 
274034
+ // src/tools/interactive-policy.ts
274035
+ var INTERACTIVE_USER_INPUT_TOOL_NAMES;
274036
+ var init_interactive_policy = __esm(() => {
274037
+ INTERACTIVE_USER_INPUT_TOOL_NAMES = [
274038
+ "AskUserQuestionAsync"
274039
+ ];
274040
+ });
274041
+
274042
+ // src/tools/tool-policy.ts
274043
+ function intersectToolAllowlists(ceiling, narrower) {
274044
+ return narrower.filter((name) => ceiling.some((allowed) => getInternalToolName(allowed) === getInternalToolName(name)));
274045
+ }
274046
+ function resolveTurnToolSelection(turn, policy) {
274047
+ const base2 = turn.clientToolset?.base ?? policy?.toolset?.base;
274048
+ const include = turn.clientToolset?.include ?? policy?.toolset?.include;
274049
+ const clientToolset = base2 === undefined && include === undefined ? undefined : {
274050
+ ...base2 !== undefined ? { base: base2 } : {},
274051
+ ...include !== undefined ? { include: [...include] } : {}
274052
+ };
274053
+ const policyAllowlist = policy?.allowlist;
274054
+ const clientToolAllowlist = policyAllowlist === undefined ? turn.clientToolAllowlist : turn.clientToolAllowlist === undefined ? [...policyAllowlist] : intersectToolAllowlists(policyAllowlist, turn.clientToolAllowlist);
274055
+ const excludeInteractiveTools = turn.excludeInteractiveTools ?? policy?.exclude_interactive;
274056
+ return {
274057
+ ...clientToolset ? { clientToolset } : {},
274058
+ ...clientToolAllowlist !== undefined ? { clientToolAllowlist } : {},
274059
+ ...excludeInteractiveTools !== undefined ? { excludeInteractiveTools } : {}
274060
+ };
274061
+ }
274062
+ function mergeClientToolsetFields(primary, fallback) {
274063
+ const base2 = primary?.base ?? fallback?.base;
274064
+ const include = primary?.include ?? fallback?.include;
274065
+ if (base2 === undefined && include === undefined)
274066
+ return;
274067
+ return {
274068
+ ...base2 !== undefined ? { base: base2 } : {},
274069
+ ...include !== undefined ? { include } : {}
274070
+ };
274071
+ }
274072
+ var init_tool_policy = __esm(() => {
274073
+ init_tool_name_mapping();
274074
+ });
274075
+
274009
274076
  // src/websocket/listener/external-tools.ts
274010
274077
  function createExternalToolNotificationState() {
274011
274078
  return {
@@ -274288,6 +274355,17 @@ function resolveRuntimeToolOwner(runtime, runtimeScope, submittingConnectionId)
274288
274355
  ...owner.toolPolicy ? { toolPolicy: owner.toolPolicy } : {}
274289
274356
  };
274290
274357
  }
274358
+ function resolveRuntimeToolContextOptions(runtime, scope, connectionId, overrides = {}) {
274359
+ const owner = resolveRuntimeToolOwner(runtime, scope, connectionId);
274360
+ const selection = resolveTurnToolSelection(overrides, owner.toolPolicy);
274361
+ return {
274362
+ externalToolOwnerConnectionId: owner.connectionId,
274363
+ clientToolset: selection.clientToolset,
274364
+ clientToolAllowlist: selection.clientToolAllowlist,
274365
+ ...selection.excludeInteractiveTools ? { exclude: [...INTERACTIVE_USER_INPUT_TOOL_NAMES] } : {},
274366
+ foregroundYieldMs: owner.toolPolicy?.foreground_yield_ms
274367
+ };
274368
+ }
274291
274369
  function updateRuntimeExternalTools(runtime, connectionId, updates) {
274292
274370
  for (const update2 of updates) {
274293
274371
  for (const runtimeScope of update2.runtimes) {
@@ -274387,7 +274465,9 @@ var EXTERNAL_TOOL_CALL_TIMEOUT_MS, registeredToolsByRuntime, lastSubmittingConne
274387
274465
  var init_external_tools = __esm(() => {
274388
274466
  init_external_tool_background_eligibility();
274389
274467
  init_foreground_yield();
274468
+ init_interactive_policy();
274390
274469
  init_manager2();
274470
+ init_tool_policy();
274391
274471
  init_debug();
274392
274472
  init_connection();
274393
274473
  init_runtime6();
@@ -279063,40 +279143,6 @@ var init_stream2 = __esm(() => {
279063
279143
  init_stream_terminal_eof_guard();
279064
279144
  });
279065
279145
 
279066
- // src/tools/tool-policy.ts
279067
- function intersectToolAllowlists(ceiling, narrower) {
279068
- return narrower.filter((name) => ceiling.some((allowed) => getInternalToolName(allowed) === getInternalToolName(name)));
279069
- }
279070
- function resolveTurnToolSelection(turn, policy) {
279071
- const base2 = turn.clientToolset?.base ?? policy?.toolset?.base;
279072
- const include = turn.clientToolset?.include ?? policy?.toolset?.include;
279073
- const clientToolset = base2 === undefined && include === undefined ? undefined : {
279074
- ...base2 !== undefined ? { base: base2 } : {},
279075
- ...include !== undefined ? { include: [...include] } : {}
279076
- };
279077
- const policyAllowlist = policy?.allowlist;
279078
- const clientToolAllowlist = policyAllowlist === undefined ? turn.clientToolAllowlist : turn.clientToolAllowlist === undefined ? [...policyAllowlist] : intersectToolAllowlists(policyAllowlist, turn.clientToolAllowlist);
279079
- const excludeInteractiveTools = turn.excludeInteractiveTools ?? policy?.exclude_interactive;
279080
- return {
279081
- ...clientToolset ? { clientToolset } : {},
279082
- ...clientToolAllowlist !== undefined ? { clientToolAllowlist } : {},
279083
- ...excludeInteractiveTools !== undefined ? { excludeInteractiveTools } : {}
279084
- };
279085
- }
279086
- function mergeClientToolsetFields(primary, fallback) {
279087
- const base2 = primary?.base ?? fallback?.base;
279088
- const include = primary?.include ?? fallback?.include;
279089
- if (base2 === undefined && include === undefined)
279090
- return;
279091
- return {
279092
- ...base2 !== undefined ? { base: base2 } : {},
279093
- ...include !== undefined ? { include } : {}
279094
- };
279095
- }
279096
- var init_tool_policy = __esm(() => {
279097
- init_tool_name_mapping();
279098
- });
279099
-
279100
279146
  // src/tools/toolset.ts
279101
279147
  var exports_toolset = {};
279102
279148
  __export(exports_toolset, {
@@ -452441,6 +452487,7 @@ async function executeRecoveredApprovalContinuation(params) {
452441
452487
  return;
452442
452488
  }
452443
452489
  const preparedToolContext = await prepareToolExecutionContext({
452490
+ ...resolveRuntimeToolContextOptions(runtime.listener, scope, selectedDeliveryOwnerId ?? opts?.connectionId),
452444
452491
  connectionId: resolveTurnExecutionConnectionId(runtime.listener, scope, opts?.connectionId),
452445
452492
  agentId: recovered.agentId,
452446
452493
  conversationId: recovered.conversationId,
@@ -452999,9 +453046,12 @@ async function resolveStaleApprovals(runtime, socket, turnLease, deps = {}) {
452999
453046
  agent_id: runtime.agentId,
453000
453047
  conversation_id: recoveryConversationId
453001
453048
  };
453049
+ if (await getRecoveryEligibility(runtime) !== "owned")
453050
+ return null;
453002
453051
  const modAdapters = runtime.agentId ? await ensureListenerModAdaptersForAgent(runtime.listener, runtime.agentId) : [];
453003
453052
  const preparedToolContext = await prepareToolExecutionContext({
453004
453053
  connectionId: resolveTurnExecutionConnectionId(runtime.listener, scope, runtime.activeConnectionId ?? undefined),
453054
+ ...resolveRuntimeToolContextOptions(runtime.listener, scope),
453005
453055
  agentId: runtime.agentId,
453006
453056
  conversationId: recoveryConversationId,
453007
453057
  workingDirectory: recoveryWorkingDirectory,
@@ -453019,6 +453069,8 @@ async function resolveStaleApprovals(runtime, socket, turnLease, deps = {}) {
453019
453069
  const recoveryActingUserId = recoveryRecord?.actingUserId;
453020
453070
  pendingApprovals = await filterStillPending(pendingApprovals);
453021
453071
  while (pendingApprovals.length > 0) {
453072
+ if (await getRecoveryEligibility(runtime) !== "owned")
453073
+ return null;
453022
453074
  assertCurrentTurnLease();
453023
453075
  const recoveryBatchId = resolveRecoveryBatchId(runtime, pendingApprovals);
453024
453076
  if (!recoveryBatchId) {
@@ -453429,6 +453481,7 @@ var init_send = __esm(() => {
453429
453481
  init_protocol_outbound();
453430
453482
  init_recorded_tool_results();
453431
453483
  init_recovery();
453484
+ init_recovery_ownership();
453432
453485
  init_recovery_read();
453433
453486
  init_skill_injection();
453434
453487
  init_turn_input_state();
@@ -457507,12 +457560,12 @@ function rowToolCalls(row, index, diagnostics2) {
457507
457560
  }
457508
457561
  return calls;
457509
457562
  }
457510
- function contentText4(content) {
457563
+ function contentText3(content) {
457511
457564
  if (typeof content === "string") {
457512
457565
  if (content.startsWith(CONTENT_JSON_PREFIX)) {
457513
457566
  const encoded = content.slice(CONTENT_JSON_PREFIX.length);
457514
457567
  try {
457515
- return contentText4(JSON.parse(encoded));
457568
+ return contentText3(JSON.parse(encoded));
457516
457569
  } catch {
457517
457570
  return encoded;
457518
457571
  }
@@ -457598,7 +457651,7 @@ var init_hermes = __esm(() => {
457598
457651
  });
457599
457652
  };
457600
457653
  if (row.role === "user") {
457601
- const content = contentText4(row.content);
457654
+ const content = contentText3(row.content);
457602
457655
  if (content) {
457603
457656
  emit({
457604
457657
  type: "message",
@@ -457618,7 +457671,7 @@ var init_hermes = __esm(() => {
457618
457671
  ...timestamp ? { timestamp } : {}
457619
457672
  });
457620
457673
  }
457621
- const content = contentText4(row.content);
457674
+ const content = contentText3(row.content);
457622
457675
  if (content) {
457623
457676
  emit({
457624
457677
  type: "message",
@@ -457641,7 +457694,7 @@ var init_hermes = __esm(() => {
457641
457694
  if (row.role === "tool") {
457642
457695
  emit({
457643
457696
  type: "tool_result",
457644
- content: contentText4(row.content),
457697
+ content: contentText3(row.content),
457645
457698
  ...typeof row.tool_call_id === "string" && row.tool_call_id ? { callId: row.tool_call_id } : {},
457646
457699
  ...timestamp ? { timestamp } : {}
457647
457700
  });
@@ -462649,6 +462702,16 @@ async function startTurnInput(params) {
462649
462702
  stream: sender.accept(result3)
462650
462703
  };
462651
462704
  }
462705
+ function getPostStopErrorDetails(latestErrorInfo, runErrorInfo2, fallbackError) {
462706
+ const errorDetail3 = getApprovalToolCallDesyncErrorText(latestErrorInfo ?? {}) || latestErrorInfo?.detail || latestErrorInfo?.message || runErrorInfo2?.detail || runErrorInfo2?.message || fallbackError || null;
462707
+ const retryErrorDetail = [
462708
+ latestErrorInfo?.detail,
462709
+ latestErrorInfo?.message,
462710
+ runErrorInfo2?.detail,
462711
+ runErrorInfo2?.message
462712
+ ].find(isProviderStreamTimeoutDetail) ?? errorDetail3;
462713
+ return { errorDetail: errorDetail3, retryErrorDetail };
462714
+ }
462652
462715
  function getProviderRetryLimit(errorDetail3) {
462653
462716
  return isProviderStreamTimeoutDetail(errorDetail3) ? 1 : LLM_API_ERROR_MAX_RETRIES;
462654
462717
  }
@@ -462744,6 +462807,7 @@ var init_turn_send = __esm(() => {
462744
462807
  init_queue();
462745
462808
  init_recoverable_notices();
462746
462809
  init_recovery();
462810
+ init_recovery_error_policy();
462747
462811
  init_send();
462748
462812
  init_skill_injection();
462749
462813
  init_turn_input_state();
@@ -462771,14 +462835,6 @@ function buildListenReminderContext(params) {
462771
462835
  };
462772
462836
  }
462773
462837
 
462774
- // src/tools/interactive-policy.ts
462775
- var INTERACTIVE_USER_INPUT_TOOL_NAMES;
462776
- var init_interactive_policy = __esm(() => {
462777
- INTERACTIVE_USER_INPUT_TOOL_NAMES = [
462778
- "AskUserQuestionAsync"
462779
- ];
462780
- });
462781
-
462782
462838
  // src/telemetry/input.ts
462783
462839
  function extractTelemetryInputText(content) {
462784
462840
  if (typeof content === "string") {
@@ -462940,6 +462996,7 @@ async function prepareListenerTurn(params) {
462940
462996
  if (isInterrupted()) {
462941
462997
  return { kind: "interrupted" };
462942
462998
  }
462999
+ markLocalTurnScope(runtime);
462943
463000
  setCurrentAgentId(agentId);
462944
463001
  setCurrentAgentName(listenAgentMetadata?.name ?? null);
462945
463002
  setConversationId(conversationId);
@@ -463101,12 +463158,6 @@ async function prepareListenerTurn(params) {
463101
463158
  if (connectionId) {
463102
463159
  recordRuntimeSubmittingConnection(runtime.listener, toolRuntimeScope, connectionId);
463103
463160
  }
463104
- const toolOwner = resolveRuntimeToolOwner(runtime.listener, toolRuntimeScope, connectionId);
463105
- const toolSelection = resolveTurnToolSelection({
463106
- clientToolset: msg.clientToolset,
463107
- clientToolAllowlist: msg.clientToolAllowlist,
463108
- excludeInteractiveTools: msg.excludeInteractiveTools
463109
- }, toolOwner.toolPolicy);
463110
463161
  const preparedToolContext = await prepareToolExecutionContextForScope({
463111
463162
  readScopeState: (read2) => retryApprovalRecoveryRead(read2, () => {
463112
463163
  if (isInterrupted())
@@ -463121,10 +463172,7 @@ async function prepareListenerTurn(params) {
463121
463172
  mcpOriginatorSuperRunId: getEffectiveMcpOriginatorId(msg),
463122
463173
  resolveClientMessageIds,
463123
463174
  turnStartedAt: msg.receivedAt,
463124
- externalToolOwnerConnectionId: toolOwner.connectionId,
463125
- clientToolset: toolSelection.clientToolset,
463126
- clientToolAllowlist: toolSelection.clientToolAllowlist,
463127
- ...toolSelection.excludeInteractiveTools ? { exclude: [...INTERACTIVE_USER_INPUT_TOOL_NAMES] } : {},
463175
+ ...resolveRuntimeToolContextOptions(runtime.listener, toolRuntimeScope, connectionId, msg),
463128
463176
  workingDirectory,
463129
463177
  permissionModeState,
463130
463178
  skillsDirectory: listenerOptions?.skillsDirectory,
@@ -463132,7 +463180,6 @@ async function prepareListenerTurn(params) {
463132
463180
  bundledSkills: runtime.bundledSkills,
463133
463181
  workspaceSandbox: runtime.workspaceSandbox,
463134
463182
  executionSettings: runtime.executionSettings,
463135
- foregroundYieldMs: toolOwner.toolPolicy?.foreground_yield_ms,
463136
463183
  cachedAgent,
463137
463184
  ...agentId ? { modContext: createListenerAgentModContext(agentId) } : {},
463138
463185
  modAdapters,
@@ -463203,8 +463250,6 @@ var init_turn_setup = __esm(() => {
463203
463250
  init_runtime_context();
463204
463251
  init_error_reporting();
463205
463252
  init_client_preferences();
463206
- init_interactive_policy();
463207
- init_tool_policy();
463208
463253
  init_toolset();
463209
463254
  init_debug();
463210
463255
  init_shell_context();
@@ -463584,23 +463629,22 @@ async function handleIncomingMessageInner(msg, socket, runtime, onStatusChange,
463584
463629
  break;
463585
463630
  }
463586
463631
  const latestErrorInfo = result3.errorInfo;
463587
- const errorDetail3 = getApprovalToolCallDesyncErrorText(latestErrorInfo ?? {}) || latestErrorInfo?.detail || latestErrorInfo?.message || runErrorInfo2?.detail || runErrorInfo2?.message || fallbackError || null;
463588
- const retryErrorDetail = [
463589
- latestErrorInfo?.detail,
463590
- latestErrorInfo?.message,
463591
- runErrorInfo2?.detail,
463592
- runErrorInfo2?.message
463593
- ].find(isProviderStreamTimeoutDetail) ?? errorDetail3;
463632
+ const { errorDetail: errorDetail3, retryErrorDetail } = getPostStopErrorDetails(latestErrorInfo, runErrorInfo2, fallbackError);
463594
463633
  const quotaError = latestErrorInfo ?? runErrorInfo2 ?? errorDetail3;
463595
463634
  const deploymentInterrupted = isCloudApiDeploymentInterrupted(latestErrorInfo) || isCloudApiDeploymentInterrupted(runErrorInfo2);
463596
- if (!deploymentInterrupted && shouldAttemptPostStopApprovalRecovery({
463635
+ const shouldRecoverApproval = !deploymentInterrupted && shouldAttemptPostStopApprovalRecovery({
463597
463636
  stopReason,
463598
463637
  runIdsSeen: msgRunIds.length,
463599
463638
  retries: postStopApprovalRecoveryRetries,
463600
463639
  runErrorDetail: errorDetail3,
463601
463640
  latestErrorText: latestErrorInfo?.detail ?? latestErrorInfo?.message ?? null,
463602
463641
  fallbackError
463603
- })) {
463642
+ });
463643
+ const ownsApprovalRecovery = shouldRecoverApproval && await getRecoveryEligibility(runtime) === "owned";
463644
+ if (shouldRecoverApproval && finishIfInterrupted(lastRunId || runtime.activeRunId)) {
463645
+ break;
463646
+ }
463647
+ if (ownsApprovalRecovery) {
463604
463648
  postStopApprovalRecoveryRetries += 1;
463605
463649
  emitRecoverableStatusNotice(socket, runtime, {
463606
463650
  kind: "stale_approval_conflict_recovery",
@@ -464048,6 +464092,7 @@ var init_turn = __esm(() => {
464048
464092
  init_protocol_outbound();
464049
464093
  init_recoverable_notices();
464050
464094
  init_recovery();
464095
+ init_recovery_ownership();
464051
464096
  init_runtime6();
464052
464097
  init_send();
464053
464098
  init_skill_injection();
@@ -464462,6 +464507,7 @@ var init_inbound_dispatch = __esm(() => {
464462
464507
  init_mcp_originator_tokens();
464463
464508
  init_debug();
464464
464509
  init_connection();
464510
+ init_inbound_queue();
464465
464511
  init_input_disposition();
464466
464512
  init_input_disposition_ownership();
464467
464513
  init_input_disposition_rollback();
@@ -472727,6 +472773,7 @@ async function handleRuntimeStartCommand(parsed, context3) {
472727
472773
  expectInboundTeleport(scopedRuntime, parsed.teleport_id);
472728
472774
  }
472729
472775
  assertConnectionOpen();
472776
+ markLocalTurnScope(scopedRuntime);
472730
472777
  subscribeListenerConnection(context3.runtime, connectionId, runtimeScope);
472731
472778
  registerRuntimeExternalTools(context3.runtime, connectionId, runtimeScope, parsed.external_tools ?? [], parsed.tool_policy);
472732
472779
  if (parsed.wait_for_replay) {
@@ -472792,6 +472839,7 @@ var init_runtime_start = __esm(() => {
472792
472839
  init_external_tools();
472793
472840
  init_permission_mode();
472794
472841
  init_queue();
472842
+ init_runtime6();
472795
472843
  init_runtime_start_validation();
472796
472844
  init_teleport();
472797
472845
  LEGACY_SUMMARY_PREFIX_BY_SOURCE_TAG = {
@@ -473717,6 +473765,7 @@ async function routeInputFrame(deps) {
473717
473765
  var init_input_frame_router = __esm(() => {
473718
473766
  init_mcp_originator_tokens();
473719
473767
  init_inbound_dispatch();
473768
+ init_inbound_queue();
473720
473769
  init_input_ack();
473721
473770
  init_input_disposition();
473722
473771
  init_input_disposition_rollback();
@@ -474511,7 +474560,14 @@ async function handleTaskControlCommand(command, context3) {
474511
474560
  safeSocketSend(socket, response2, response2.type, command.type);
474512
474561
  return;
474513
474562
  }
474514
- const parent = getOrCreateScopedRuntime2(runtime, command.runtime.agent_id, command.runtime.conversation_id);
474563
+ const { agent_id, conversation_id } = command.runtime;
474564
+ const sidebandOnly = command.type !== "launch_subagent" || command.notify === "caller";
474565
+ if (sidebandOnly && !getConversationRuntime(runtime, agent_id, conversation_id)) {
474566
+ markSidebandOnlyScope(runtime, getConversationRuntimeKey(agent_id, conversation_id));
474567
+ }
474568
+ const parent = getOrCreateScopedRuntime2(runtime, agent_id, conversation_id);
474569
+ if (!sidebandOnly)
474570
+ markLocalTurnScope(parent);
474515
474571
  const response = command.type === "launch_subagent" ? await handleLaunchSubagentCommand(command, parent, connectionId) : command.type === "subagent_message" ? await handleSubagentMessageCommand(command, parent) : await handleSubagentStopCommand(command, parent);
474516
474572
  sendReply(response);
474517
474573
  };
@@ -474522,6 +474578,7 @@ async function handleTaskControlCommand(command, context3) {
474522
474578
  }
474523
474579
  }
474524
474580
  var init_task_control = __esm(() => {
474581
+ init_runtime6();
474525
474582
  init_monitors2();
474526
474583
  init_stop_conversation();
474527
474584
  init_subagent_control();
@@ -475145,7 +475202,8 @@ function installProcessEventRouting(params) {
475145
475202
  setMessageQueueAdder((queuedMessage) => {
475146
475203
  if (!queuedMessage.agentId || !queuedMessage.conversationId)
475147
475204
  return;
475148
- if (isRuntimeTeleportPending(runtime, queuedMessage.agentId, queuedMessage.conversationId))
475205
+ const key4 = getConversationRuntimeKey(queuedMessage.agentId, queuedMessage.conversationId);
475206
+ if (isSidebandOnlyScope(runtime, key4) || isRuntimeTeleportPending(runtime, queuedMessage.agentId, queuedMessage.conversationId))
475149
475207
  return;
475150
475208
  const targetRuntime = getOrCreateScopedRuntime(runtime, queuedMessage.agentId, queuedMessage.conversationId);
475151
475209
  if (!targetRuntime?.queueRuntime)
@@ -475173,7 +475231,7 @@ function getMostRecentlyActiveConversation(runtime) {
475173
475231
  let latest = null;
475174
475232
  let latestAt = -1;
475175
475233
  for (const conversationRuntime of runtime.conversationRuntimes.values()) {
475176
- if (!conversationRuntime.agentId)
475234
+ if (!conversationRuntime.agentId || isSidebandOnlyScope(runtime, conversationRuntime.key))
475177
475235
  continue;
475178
475236
  const activeAt = conversationRuntime.isProcessing ? Number.POSITIVE_INFINITY : conversationRuntime.contextTracker.contextTokensHistory.at(-1)?.timestamp ?? 0;
475179
475237
  if (activeAt > latestAt) {
@@ -476209,7 +476267,12 @@ async function recoverApprovalStateForSync(runtime, scope, deps = {}, opts = {})
476209
476267
  clearRecoveredApprovalState(runtime);
476210
476268
  return "deferred";
476211
476269
  }
476212
- runtime.pendingInterruptedResults = buildFreshDenialApprovals(pendingApprovals, STALE_APPROVAL_RECOVERY_DENIAL_REASON);
476270
+ runtime.pendingInterruptedResults = staleDenialDecisions.filter((decision) => decision.type === "deny").map(({ approval, reason }) => ({
476271
+ type: "approval",
476272
+ tool_call_id: approval.toolCallId,
476273
+ approve: false,
476274
+ reason
476275
+ }));
476213
476276
  runtime.pendingInterruptedContext = {
476214
476277
  agentId: scope.agent_id,
476215
476278
  conversationId: scope.conversation_id,
@@ -476250,7 +476313,8 @@ var init_recovery_sync = __esm(() => {
476250
476313
  async function replaySyncStateForRuntime(listenerRuntime, socket, scope, opts) {
476251
476314
  const syncScopedRuntime = getOrCreateScopedRuntime(listenerRuntime, scope.agent_id, scope.conversation_id);
476252
476315
  const recoverFn = opts?.recoverApprovalStateForSync ?? recoverApprovalStateForSync;
476253
- if (opts?.recoverApprovals ?? true) {
476316
+ const canRecover = !isSidebandOnlyScope(listenerRuntime, syncScopedRuntime.key);
476317
+ if (canRecover && (opts?.recoverApprovals ?? true)) {
476254
476318
  try {
476255
476319
  await recoverFn(syncScopedRuntime, scope, undefined, {
476256
476320
  resumeInterruptedTurn: opts?.resumeInterruptedTurn === true
@@ -476266,7 +476330,7 @@ async function replaySyncStateForRuntime(listenerRuntime, socket, scope, opts) {
476266
476330
  }
476267
476331
  }
476268
476332
  }
476269
- if (syncScopedRuntime.recoveredApprovalState && (syncScopedRuntime.recoveredApprovalState.autoDecisions?.length ?? 0) > 0) {
476333
+ if (canRecover && syncScopedRuntime.recoveredApprovalState && (syncScopedRuntime.recoveredApprovalState.autoDecisions?.length ?? 0) > 0) {
476270
476334
  let signalLeaseReady;
476271
476335
  let releaseLeaseBarrier;
476272
476336
  const leaseReady = new Promise((resolve39) => {
@@ -476315,6 +476379,7 @@ var init_sync_replay = __esm(() => {
476315
476379
  init_conversation_runtime();
476316
476380
  init_recovery();
476317
476381
  init_recovery_sync();
476382
+ init_runtime6();
476318
476383
  init_turn();
476319
476384
  init_warmup();
476320
476385
  });
@@ -548281,4 +548346,4 @@ function registerBunOAuthFlows() {
548281
548346
  registerBunOAuthFlows();
548282
548347
  await init_src5().then(() => exports_src2);
548283
548348
 
548284
- //# debugId=928B7A44932DBCE064756E2164756E21
548349
+ //# debugId=1A69A6302AC3853F64756E2164756E21