lody 0.95.0 → 0.96.0

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/dist/index.js CHANGED
@@ -15,30 +15,30 @@ import * as path from "node:path";
15
15
  import path__default, { posix as posix$1, basename, win32, join as join$2, resolve as resolve$1, relative as relative$1, dirname as dirname$1, isAbsolute as isAbsolute$2, sep as sep$1, delimiter, normalize } from "node:path";
16
16
  import { _ as _coercedNumber, Z as ZodNumber$1, o as object$1, s as string$1, l as literal$1, b as boolean, a as _enum$1, n as number$4, d as discriminatedUnion, c as array$2, r as record$3, u as unknown, e as union$7, f as ZodObject$1, g as ZodLiteral$1, j as json$1, p as preprocess, h as ZodError$1, i as safeParse$1, k as ZodOptional$1, m as ZodNullable$1, q as ZodPipe, t as ZodUnion$1, v as ZodArray$1, w as ZodNever$1, x as ZodDiscriminatedUnion, y as _instanceof, z as _null, A as normalizeParams, $ as $constructor, B as $ZodObject, C as defineLazy, D as $ZodType, E as parse$5, F as safeParse$2, G as parseAsync, H as safeParseAsync$1, I as clone$2, J as looseObject, K as intersection, L as optional$1, M as datetime, N as custom$1, O as toJSONSchema, P as never$1, Q as xor } from "./chunks/schemas-C-NzK2uQ.js";
17
17
  import require$$0$4, { EventEmitter as EventEmitter$1, once as once$1 } from "node:events";
18
- import Tw__default, { execFile, spawn as spawn$1, execFileSync } from "node:child_process";
18
+ import ew__default, { execFile, spawn as spawn$1, execFileSync } from "node:child_process";
19
19
  import process$2 from "node:process";
20
20
  import tty from "node:tty";
21
21
  import * as os from "os";
22
22
  import os__default$1 from "os";
23
23
  import crypto__default$1, { randomFillSync, randomUUID, createHash, randomBytes, timingSafeEqual } from "node:crypto";
24
24
  import require$$0$5, { promisify as promisify$1 } from "util";
25
- import xo, { Transform as Transform$1, Readable as Readable$1 } from "stream";
25
+ import _o, { Transform as Transform$1, Readable as Readable$1 } from "stream";
26
26
  import require$$0$6, { Buffer as Buffer$1 } from "buffer";
27
27
  import require$$0$7, { EventEmitter as EventEmitter$2 } from "events";
28
- import * as Ri from "zlib";
29
- import Ri__default from "zlib";
28
+ import * as Ci from "zlib";
29
+ import Ci__default from "zlib";
30
30
  import require$$0$8 from "tty";
31
31
  import require$$1$2 from "string_decoder";
32
32
  import http from "http";
33
33
  import require$$1__default from "https";
34
34
  import require$$0$9, { promisify, inspect as inspect$1, stripVTControlCharacters, isDeepStrictEqual } from "node:util";
35
- import * as Xt from "node:fs/promises";
36
- import Xt__default, { readFile, readdir, rm, mkdir as mkdir$1, mkdtemp, chmod, writeFile, rename, stat, lstat, symlink, realpath, unlink, open, opendir, link } from "node:fs/promises";
35
+ import * as Qt from "node:fs/promises";
36
+ import Qt__default, { readFile, readdir, rm, mkdir as mkdir$1, mkdtemp, chmod, writeFile, rename, stat, lstat, symlink, realpath, unlink, open, opendir, link } from "node:fs/promises";
37
37
  import zlib__default, { gzip, gunzip as gunzip$1, gunzipSync, brotliDecompressSync } from "node:zlib";
38
38
  import require$$1$7, { exec, execFile as execFile$1, spawn as spawn$2 } from "child_process";
39
39
  import { c as createPlanModeConfigOption, L as LODY_PLAN_MODE_CONFIG_ID } from "./chunks/plan-mode-BLOER-fv.js";
40
40
  import { D as DEEPSEEK_HARNESS_PERMISSION_MODES, a as DEEPSEEK_HARNESS_AGENT_PRESETS, A as ACP_EXTENSION_DSH_CAPABILITY_SOURCE_VERSION, c as createDeepSeekHarnessProfileFiles, b as DEEPSEEK_HARNESS_PROFILE_NAME, d as DEEPSEEK_HARNESS_PROFILE_FILENAMES, e as ACP_EXTENSION_DSH_QUERY_PATH_ENV, f as ACP_EXTENSION_DSH_SESSION_ROOT_ENV, g as createDeepSeekHarnessNpxSpecifiers, h as DEEPSEEK_HARNESS_DEFAULT_SESSION_COMPRESSION, i as DEEPSEEK_HARNESS_VERSION, j as DEEPSEEK_HARNESS_BASE_URL_ENV } from "./chunks/profile-DQaC7SJZ.js";
41
- import { i as imports, _ as __wbg_set_wasm$1, r as rawWasm, L as LoroDoc, E as EphemeralStoreWasm, U as UndoManager, a as isValidContainerId, c as callPendingEvents$3, b as LoroTree, d as LoroText, e as LoroMovableList, f as LoroList, g as LoroMap, V as VersionVector, h as __vite__initWasm, j as decodeImportBlobMeta, __tla as __tla_0 } from "./chunks/loro_wasm_bg-Br-Fa9wV.js";
41
+ import { i as imports, _ as __wbg_set_wasm$1, r as rawWasm, L as LoroDoc, E as EphemeralStoreWasm, U as UndoManager, a as isValidContainerId, c as callPendingEvents$3, b as LoroTree, d as LoroText, e as LoroMovableList, f as LoroList, g as LoroMap, V as VersionVector, h as __vite__initWasm, j as decodeImportBlobMeta, __tla as __tla_0 } from "./chunks/loro_wasm_bg-Dz8BnaUI.js";
42
42
  import { performance as performance$1 } from "perf_hooks";
43
43
  import require$$0$a from "net";
44
44
  import require$$4$2 from "tls";
@@ -64,8 +64,8 @@ import require$$1$6 from "node:dns";
64
64
  import { C as CodeCollabV2FileIndexRequestSchema, a as CodeCollabV2OpenTextRequestSchema, b as CodeCollabV2RefreshTextRequestSchema, c as CodeCollabV2SaveTextRequestSchema, d as CodeCollabV2OpenCurrentDiffRequestSchema, e as CodeCollabV2OpenAllChangesDiffRequestSchema, f as CodeCollabV2OpenTurnDiffRequestSchema, g as CodeCollabV2InitDirectoryRequestSchema, h as CodeCollabV2FileIndexSnapshotSchema, i as CodeCollabV2OpenTextOkSchema, j as CodeCollabV2RefreshTextResponseSchema, k as CodeCollabV2SaveTextResponseSchema, l as CodeCollabV2OpenCurrentDiffResponseSchema, m as CodeCollabV2OpenAllChangesDiffResponseSchema, n as CodeCollabV2OpenTurnDiffResponseSchema, o as CodeCollabV2InitDirectoryOkSchema, p as CodeCollabV2LspUnsupportedSchema, q as CodeCollabV2ErrorSchema, r as CodeCollabV2RpcContentEnvelopeSchema, s as deriveCodeCollabV2ContentKeyId, t as CodeCollabV2ErrorCodeSchema, u as CodeCollabV2RpcResponseSchema, v as deriveCodeCollabV2ContentKeyBytes, w as readCodeCollabFileIndexSignalFromFlock, x as writeCodeCollabFileIndexSignalToFlock, y as writeCodeCollabFileIndexToFlock, z as buildCodeCollabFileIndexState, A as CODE_COLLAB_V2_TEXT_LIMITS, B as CODE_COLLAB_V2_ALL_CHANGES_DIFF_LIMITS, D as computeAllChanges, E as codeCollabFileIndexStatesEqual, F as scanGitDirectoryEntries, G as closeDirectoryQuietly } from "./chunks/directory-handle-35P9qcGk.js";
65
65
  import { finished, pipeline } from "node:stream/promises";
66
66
  import { StringDecoder } from "node:string_decoder";
67
- import { p as packageJson } from "./chunks/package-DlotPnLa.js";
68
- import { r as runtimeManifest } from "./chunks/runtime-manifest-FeOT7MvW.js";
67
+ import { p as packageJson } from "./chunks/package-CZY_YQI4.js";
68
+ import { r as runtimeManifest } from "./chunks/runtime-manifest-DqfOlvSw.js";
69
69
  import { R as RequestError$1, C as ClientSideConnection, P as PROTOCOL_VERSION, n as ndJsonStream, c as client$2, m as methods$1 } from "./chunks/acp-DCoAUZc7.js";
70
70
  import { L as LODY_EXTENSION_METHODS, n as normalizeLodyExtensionMethod } from "./chunks/methods-CvEDMahD.js";
71
71
  import { AsyncLocalStorage as AsyncLocalStorage$1 } from "async_hooks";
@@ -4326,7 +4326,7 @@ Upgrade Node, then re-run: npx lody@latest`;
4326
4326
  }
4327
4327
  const name$2 = "lody";
4328
4328
  const name$1 = "@lody/cli-cloud";
4329
- const version$a = "0.95.0";
4329
+ const version$a = "0.96.0";
4330
4330
  const type$2 = "module";
4331
4331
  const scripts = {
4332
4332
  "dev": "node dev.mjs",
@@ -4337,7 +4337,7 @@ Upgrade Node, then re-run: npx lody@latest`;
4337
4337
  };
4338
4338
  const devDependencies = {
4339
4339
  "dotenv": "^16.6.1",
4340
- "vite": "catalog:",
4340
+ "vite": "^7.0.0",
4341
4341
  "vite-plugin-top-level-await": "catalog:",
4342
4342
  "vite-plugin-wasm": "catalog:"
4343
4343
  };
@@ -5180,7 +5180,7 @@ Upgrade Node, then re-run: npx lody@latest`;
5180
5180
  }
5181
5181
  finalize$1(instance.exports);
5182
5182
  } else {
5183
- const wkmod = wasmModuleOrExports instanceof WebAssembly.Module ? wasmModuleOrExports : await import("./chunks/loro_wasm_bg-Br-Fa9wV.js").then(async (m) => {
5183
+ const wkmod = wasmModuleOrExports instanceof WebAssembly.Module ? wasmModuleOrExports : await import("./chunks/loro_wasm_bg-Dz8BnaUI.js").then(async (m) => {
5184
5184
  await m.__tla;
5185
5185
  return m;
5186
5186
  }).then((n) => n.r);
@@ -6788,6 +6788,8 @@ Upgrade Node, then re-run: npx lody@latest`;
6788
6788
  return Array.isArray(v);
6789
6789
  }
6790
6790
  function applyEventBatchToState(currentState, event, options) {
6791
+ const textState = applySingleTextEvent(currentState, event);
6792
+ if (textState !== void 0) return textState;
6791
6793
  const opts = typeof options === "function" ? {
6792
6794
  getContainerById: options
6793
6795
  } : options || {};
@@ -6800,6 +6802,58 @@ Upgrade Node, then re-run: npx lody@latest`;
6800
6802
  hardenCidDescriptors(next2, currentState);
6801
6803
  return next2;
6802
6804
  }
6805
+ function applySingleTextEvent(state2, batch) {
6806
+ if (batch.events.length !== 1) return void 0;
6807
+ const event = batch.events[0];
6808
+ if (!event || event.diff.type !== "text" || !event.path?.length) return void 0;
6809
+ const parents = [];
6810
+ let node2 = state2;
6811
+ for (const key2 of event.path) {
6812
+ if (node2 === null || typeof node2 !== "object") return void 0;
6813
+ if (Array.isArray(node2)) {
6814
+ if (Object.getPrototypeOf(node2) !== Array.prototype || typeof key2 !== "number" || !Number.isInteger(key2) || key2 < 0 || key2 >= node2.length) return void 0;
6815
+ } else {
6816
+ const proto2 = Object.getPrototypeOf(node2);
6817
+ if (proto2 !== Object.prototype && proto2 !== null || typeof key2 !== "string" || key2 === "__proto__" || key2 === "constructor" || key2 === "prototype" || key2 === "$cid") return void 0;
6818
+ }
6819
+ const descriptor = Object.getOwnPropertyDescriptor(node2, key2);
6820
+ if (!descriptor || !("value" in descriptor)) return void 0;
6821
+ parents.push({
6822
+ node: node2,
6823
+ key: key2
6824
+ });
6825
+ node2 = descriptor.value;
6826
+ }
6827
+ if (typeof node2 !== "string") return void 0;
6828
+ let next2 = applyTextDelta(node2, event.diff.diff);
6829
+ if (next2 === node2) return state2;
6830
+ for (let i2 = parents.length - 1; i2 >= 0; i2--) {
6831
+ const { node: parent, key: key2 } = parents[i2];
6832
+ const arrayCopy = Array.isArray(parent) ? copyDenseArray(parent) : void 0;
6833
+ if (arrayCopy) {
6834
+ arrayCopy[key2] = next2;
6835
+ next2 = arrayCopy;
6836
+ continue;
6837
+ }
6838
+ const descriptors = Object.getOwnPropertyDescriptors(parent);
6839
+ descriptors[key2] = {
6840
+ ...descriptors[key2],
6841
+ value: next2
6842
+ };
6843
+ next2 = Array.isArray(parent) ? Object.defineProperties([], descriptors) : Object.create(Object.getPrototypeOf(parent), descriptors);
6844
+ }
6845
+ return next2;
6846
+ }
6847
+ function copyDenseArray(parent) {
6848
+ if (Reflect.ownKeys(parent).length !== parent.length + 1 || !Object.getOwnPropertyDescriptor(parent, "length")?.writable) return void 0;
6849
+ const copy2 = new Array(parent.length);
6850
+ for (let i2 = 0; i2 < parent.length; i2++) {
6851
+ const descriptor = Object.getOwnPropertyDescriptor(parent, i2);
6852
+ if (!descriptor || !("value" in descriptor) || !descriptor.writable || !descriptor.enumerable || !descriptor.configurable) return void 0;
6853
+ copy2[i2] = descriptor.value;
6854
+ }
6855
+ return copy2;
6856
+ }
6803
6857
  function applySingleEventToDraft(draftRoot, e, ignoreSet, getContainerById, containerToMirrorState, nodeDataWithCid, getNodeDataCid, getSchemaForKey) {
6804
6858
  if (isIgnoredByAncestor(e.target, ignoreSet, getContainerById)) {
6805
6859
  return;
@@ -9995,10 +10049,19 @@ Upgrade Node, then re-run: npx lody@latest`;
9995
10049
  const parsed = SubagentTaskPayloadSchema.safeParse(carrier);
9996
10050
  return parsed.success ? parsed.data : null;
9997
10051
  };
9998
- const mergeSubagentTaskPayload = (prev, incoming) => ({
9999
- ...prev,
10000
- ...incoming
10001
- });
10052
+ const mergeSubagentTaskPayload = (prev, incoming) => {
10053
+ const merged = {
10054
+ ...prev,
10055
+ ...incoming
10056
+ };
10057
+ const prevTerminal = prev.status === "completed" || prev.status === "failed";
10058
+ const incomingTerminal = incoming.status === "completed" || incoming.status === "failed";
10059
+ if (prevTerminal && !incomingTerminal) {
10060
+ merged.status = prev.status;
10061
+ merged.event = prev.event;
10062
+ }
10063
+ return merged;
10064
+ };
10002
10065
  const LODY_TOOL_NAMES = {
10003
10066
  imageGeneration: "ImageGeneration"
10004
10067
  };
@@ -16319,6 +16382,44 @@ Requirements:
16319
16382
  }
16320
16383
  return targets;
16321
16384
  }
16385
+ const isLoroRepoDocDeleted = (value) => {
16386
+ if (!value || typeof value !== "object") {
16387
+ return false;
16388
+ }
16389
+ const candidate = value;
16390
+ if (typeof candidate.exists === "boolean") {
16391
+ return !candidate.exists;
16392
+ }
16393
+ if (typeof candidate.e === "boolean") {
16394
+ return !candidate.e;
16395
+ }
16396
+ if (typeof candidate.deleted === "boolean") {
16397
+ return candidate.deleted;
16398
+ }
16399
+ return false;
16400
+ };
16401
+ async function readSessionOperationTargets(repo, sessionId, operation) {
16402
+ const entries = await repo.listDoc({
16403
+ prefix: SESSION_DOC_PREFIX
16404
+ });
16405
+ const sessions = [];
16406
+ for (const entry of entries) {
16407
+ if (isLoroRepoDocDeleted(entry)) continue;
16408
+ const id2 = getSessionIdFromRoomId(entry.docId);
16409
+ if (id2 === null) continue;
16410
+ sessions.push({
16411
+ ...entry.meta,
16412
+ id: id2
16413
+ });
16414
+ }
16415
+ const root = sessions.find((session2) => session2.id === sessionId);
16416
+ if (!root) throw new Error(`Session metadata missing for ${sessionId}`);
16417
+ const descendants = operation === "archive" ? collectSessionArchiveTargets(sessionId, sessions) : sessions.filter((session2) => session2.id !== sessionId && session2.parentSessionId === sessionId);
16418
+ return [
16419
+ root,
16420
+ ...descendants
16421
+ ];
16422
+ }
16322
16423
  const ElectronPublicBrowserBoundsSchema = object$1({
16323
16424
  x: number$4().finite().nonnegative(),
16324
16425
  y: number$4().finite().nonnegative(),
@@ -17714,6 +17815,76 @@ Requirements:
17714
17815
  };
17715
17816
  });
17716
17817
  };
17818
+ const DEVIN_SUBAGENT_STARTED_META_KEY = "cognition.ai/subagent_started";
17819
+ const DEVIN_SUBAGENT_COMPLETED_META_KEY = "cognition.ai/subagent_completed";
17820
+ const DEVIN_SUBAGENT_CONTEXT_META_KEY = "cognition.ai/subagent_context";
17821
+ const DevinSubagentStartedSchema = object$1({
17822
+ agentId: string$1().min(1),
17823
+ title: string$1().optional(),
17824
+ task: string$1().optional(),
17825
+ profile: string$1().optional(),
17826
+ isBackground: boolean().optional(),
17827
+ model: string$1().optional()
17828
+ });
17829
+ const DevinSubagentCompletedSchema = object$1({
17830
+ agentId: string$1().min(1),
17831
+ success: boolean().optional(),
17832
+ summary: string$1().optional()
17833
+ });
17834
+ const DevinSubagentContextSchema = object$1({
17835
+ parentAgentId: string$1().min(1)
17836
+ });
17837
+ const parseDevinSubagentTaskMeta = (meta) => {
17838
+ if (!isRecord$g(meta)) return null;
17839
+ const completed = DevinSubagentCompletedSchema.safeParse(meta[DEVIN_SUBAGENT_COMPLETED_META_KEY]);
17840
+ if (completed.success) {
17841
+ const c = completed.data;
17842
+ const failed = c.success === false;
17843
+ return {
17844
+ taskId: c.agentId,
17845
+ status: failed ? "failed" : "completed",
17846
+ taskKind: "subagent",
17847
+ event: "task_notification",
17848
+ ...c.summary !== void 0 ? {
17849
+ summary: c.summary
17850
+ } : {},
17851
+ ...failed && c.summary !== void 0 ? {
17852
+ error: c.summary
17853
+ } : {}
17854
+ };
17855
+ }
17856
+ const started = DevinSubagentStartedSchema.safeParse(meta[DEVIN_SUBAGENT_STARTED_META_KEY]);
17857
+ if (started.success) {
17858
+ const s = started.data;
17859
+ const description2 = s.title ?? s.task;
17860
+ return {
17861
+ taskId: s.agentId,
17862
+ status: "in_progress",
17863
+ taskKind: "subagent",
17864
+ event: "task_started",
17865
+ ...description2 !== void 0 ? {
17866
+ description: description2
17867
+ } : {},
17868
+ ...s.profile !== void 0 ? {
17869
+ subagentType: s.profile
17870
+ } : {},
17871
+ ...s.model !== void 0 ? {
17872
+ modelId: s.model
17873
+ } : {},
17874
+ ...s.isBackground !== void 0 ? {
17875
+ isBackgrounded: s.isBackground
17876
+ } : {}
17877
+ };
17878
+ }
17879
+ return null;
17880
+ };
17881
+ const getDevinSubagentContextId = (meta) => {
17882
+ if (!isRecord$g(meta)) return null;
17883
+ const parsed = DevinSubagentContextSchema.safeParse(meta[DEVIN_SUBAGENT_CONTEXT_META_KEY]);
17884
+ if (!parsed.success || parsed.data.parentAgentId === "root") return null;
17885
+ return parsed.data.parentAgentId;
17886
+ };
17887
+ const hasOtherDevinSubagentMeta = (meta) => isRecord$g(meta) && Object.keys(meta).some((key2) => key2.startsWith("cognition.ai/subagent") && key2 !== DEVIN_SUBAGENT_CONTEXT_META_KEY);
17717
17888
  const zMeta = record$3(string$1(), unknown()).nullish();
17718
17889
  const withMeta = (shape) => object$1({
17719
17890
  ...shape,
@@ -18731,11 +18902,15 @@ ${outputTail}` : blockTail.output;
18731
18902
  return [];
18732
18903
  case "tool_call":
18733
18904
  case "tool_call_update": {
18734
- const subagentTask = parseLodyTaskMeta(update2._meta) ?? parseSubagentTaskWire(update2.rawInput);
18905
+ const subagentTask = parseLodyTaskMeta(update2._meta) ?? parseDevinSubagentTaskMeta(update2._meta) ?? parseSubagentTaskWire(update2.rawInput);
18735
18906
  if (subagentTask) {
18907
+ const devinSubagentId = getDevinSubagentContextId(update2._meta);
18736
18908
  return [
18737
18909
  {
18738
18910
  type: "subagent_task",
18911
+ ...devinSubagentId !== null ? {
18912
+ parentTaskId: devinSubagentId
18913
+ } : {},
18739
18914
  ...subagentTask
18740
18915
  }
18741
18916
  ];
@@ -18888,6 +19063,10 @@ ${outputTail}` : blockTail.output;
18888
19063
  this.primeToolCallIndexForBatch(notifications);
18889
19064
  for (const notification of notifications) {
18890
19065
  const { update: update2 } = notification;
19066
+ const devinSubagentOwnerId = getDevinSubagentContextId(update2._meta);
19067
+ if (devinSubagentOwnerId !== null && !hasOtherDevinSubagentMeta(update2._meta) && this.resolveSubagentTaskEntryIndex(devinSubagentOwnerId) !== void 0 && (update2.sessionUpdate !== "tool_call" && update2.sessionUpdate !== "tool_call_update" || this.resolveToolCallEntryIndex(update2.toolCallId) === void 0)) {
19068
+ continue;
19069
+ }
18891
19070
  const turnId = update2._meta?.lody && typeof update2._meta.lody === "object" && typeof update2._meta.lody.turnId === "string" ? update2._meta.lody.turnId : void 0;
18892
19071
  if (turnId) {
18893
19072
  const entryIndex = this.ensureActiveAssistantEntry();
@@ -18960,8 +19139,10 @@ ${outputTail}` : blockTail.output;
18960
19139
  return void 0;
18961
19140
  }
18962
19141
  resolveSubagentTaskEntryIndex(taskId) {
18963
- const cached2 = this.subagentTaskEntryIndexById.get(taskId);
18964
- if (cached2 !== void 0) return cached2;
19142
+ if (this.subagentTaskEntryIndexById.has(taskId)) {
19143
+ const cached2 = this.subagentTaskEntryIndexById.get(taskId);
19144
+ return cached2 === null ? void 0 : cached2;
19145
+ }
18965
19146
  for (let i2 = this.history.length - 1; i2 >= 0; i2--) {
18966
19147
  const items2 = this.readEntryItems(i2);
18967
19148
  if (items2.some((content) => content.type === "subagent_task" && content.taskId === taskId)) {
@@ -18969,6 +19150,7 @@ ${outputTail}` : blockTail.output;
18969
19150
  return i2;
18970
19151
  }
18971
19152
  }
19153
+ this.subagentTaskEntryIndexById.set(taskId, null);
18972
19154
  return void 0;
18973
19155
  }
18974
19156
  readEntryItems(entryIndex) {
@@ -22642,22 +22824,6 @@ ${tailedOutput}` : null;
22642
22824
  [MACHINE_PROTOCOL_CAPABILITIES.localFileResources]: LOCAL_FILE_RESOURCES_PROTOCOL_VERSION,
22643
22825
  [MACHINE_PROTOCOL_CAPABILITIES.acpProtocolAuthentication]: ACP_PROTOCOL_AUTHENTICATION_VERSION
22644
22826
  };
22645
- const isLoroRepoDocDeleted = (value) => {
22646
- if (!value || typeof value !== "object") {
22647
- return false;
22648
- }
22649
- const candidate = value;
22650
- if (typeof candidate.exists === "boolean") {
22651
- return !candidate.exists;
22652
- }
22653
- if (typeof candidate.e === "boolean") {
22654
- return !candidate.e;
22655
- }
22656
- if (typeof candidate.deleted === "boolean") {
22657
- return candidate.deleted;
22658
- }
22659
- return false;
22660
- };
22661
22827
  const collectSessionConversationSources = (history, messageQueue = []) => {
22662
22828
  const sources = [];
22663
22829
  for (let index = messageQueue.length - 1; index >= 0; index -= 1) {
@@ -27723,7 +27889,12 @@ ${context2.authorReply.trim()}
27723
27889
  var f = n.default;
27724
27890
  if (typeof f == "function") {
27725
27891
  var a = function a2() {
27726
- if (this instanceof a2) {
27892
+ var isInstance = false;
27893
+ try {
27894
+ isInstance = this instanceof a2;
27895
+ } catch {
27896
+ }
27897
+ if (isInstance) {
27727
27898
  return Reflect.construct(f, arguments, this.constructor);
27728
27899
  }
27729
27900
  return f.apply(this, arguments);
@@ -28350,7 +28521,7 @@ ${context2.authorReply.trim()}
28350
28521
  if (hasRequiredCommand$1) return command$1;
28351
28522
  hasRequiredCommand$1 = 1;
28352
28523
  const EventEmitter2 = require$$0$4.EventEmitter;
28353
- const childProcess = Tw__default;
28524
+ const childProcess = ew__default;
28354
28525
  const path2 = path__default;
28355
28526
  const fs2 = fs__default;
28356
28527
  const process2 = process$2;
@@ -33292,7 +33463,7 @@ ${originalIndentation}`;
33292
33463
  function requireStream$3() {
33293
33464
  if (hasRequiredStream$3) return stream$3;
33294
33465
  hasRequiredStream$3 = 1;
33295
- stream$3 = xo;
33466
+ stream$3 = _o;
33296
33467
  return stream$3;
33297
33468
  }
33298
33469
  var destroy_1;
@@ -36883,7 +37054,7 @@ ${originalIndentation}`;
36883
37054
  if (hasRequiredReadable$1) return readable$1.exports;
36884
37055
  hasRequiredReadable$1 = 1;
36885
37056
  (function(module2, exports$1) {
36886
- var Stream = xo;
37057
+ var Stream = _o;
36887
37058
  if (process.env.READABLE_STREAM === "disable" && Stream) {
36888
37059
  module2.exports = Stream.Readable;
36889
37060
  Object.assign(module2.exports, Stream);
@@ -39789,7 +39960,7 @@ ${originalIndentation}`;
39789
39960
  const fs2 = fs__default$1;
39790
39961
  const path2 = path__default$1;
39791
39962
  const asyncSeries = requireSeries();
39792
- const zlib = Ri__default;
39963
+ const zlib = Ci__default;
39793
39964
  const { MESSAGE } = requireTripleBeam();
39794
39965
  const { Stream, PassThrough: PassThrough2 } = requireReadable$1();
39795
39966
  const TransportStream = requireWinstonTransport();
@@ -46726,10 +46897,10 @@ ${originalIndentation}`;
46726
46897
  const os2 = os__default$1;
46727
46898
  const path2 = path__default$1;
46728
46899
  const util2 = require$$0$5;
46729
- const zlib = Ri__default;
46900
+ const zlib = Ci__default;
46730
46901
  const hash2 = requireObjectHash();
46731
46902
  const MESSAGE = requireTripleBeam().MESSAGE;
46732
- const PassThrough2 = xo.PassThrough;
46903
+ const PassThrough2 = _o.PassThrough;
46733
46904
  const Transport = requireWinstonTransport();
46734
46905
  const loggerDefaults = {
46735
46906
  json: false,
@@ -47181,7 +47352,7 @@ ${value.slice(value.length - safeTailChars)}`;
47181
47352
  return files;
47182
47353
  }
47183
47354
  async function readDailyLogFile(file2) {
47184
- const raw2 = await Xt__default.readFile(file2.path);
47355
+ const raw2 = await Qt__default.readFile(file2.path);
47185
47356
  if (!file2.compressed) return raw2.toString("utf8");
47186
47357
  return (await gunzip(raw2)).toString("utf8");
47187
47358
  }
@@ -68717,7 +68888,7 @@ ${peerId}`;
68717
68888
  function requirePermessageDeflate$1() {
68718
68889
  if (hasRequiredPermessageDeflate$1) return permessageDeflate$1;
68719
68890
  hasRequiredPermessageDeflate$1 = 1;
68720
- const zlib = Ri__default;
68891
+ const zlib = Ci__default;
68721
68892
  const bufferUtil2 = requireBufferUtil();
68722
68893
  const Limiter = requireLimiter();
68723
68894
  const { kStatusCode } = requireConstants$5();
@@ -69172,7 +69343,7 @@ ${peerId}`;
69172
69343
  function requireReceiver$1() {
69173
69344
  if (hasRequiredReceiver$1) return receiver$1;
69174
69345
  hasRequiredReceiver$1 = 1;
69175
- const { Writable } = xo;
69346
+ const { Writable } = _o;
69176
69347
  const PerMessageDeflate = requirePermessageDeflate$1();
69177
69348
  const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = requireConstants$5();
69178
69349
  const { concat: concat2, toArrayBuffer: toArrayBuffer2, unmask } = requireBufferUtil();
@@ -69539,7 +69710,7 @@ ${peerId}`;
69539
69710
  function requireSender$1() {
69540
69711
  if (hasRequiredSender$1) return sender$1;
69541
69712
  hasRequiredSender$1 = 1;
69542
- const { Duplex } = xo;
69713
+ const { Duplex } = _o;
69543
69714
  const { randomFillSync: randomFillSync2 } = crypto__default;
69544
69715
  const PerMessageDeflate = requirePermessageDeflate$1();
69545
69716
  const { EMPTY_BUFFER, kWebSocket, NOOP } = requireConstants$5();
@@ -70276,7 +70447,7 @@ ${peerId}`;
70276
70447
  const net2 = require$$0$a;
70277
70448
  const tls = require$$4$2;
70278
70449
  const { randomBytes: randomBytes2, createHash: createHash2 } = crypto__default;
70279
- const { Duplex, Readable: Readable2 } = xo;
70450
+ const { Duplex, Readable: Readable2 } = _o;
70280
70451
  const { URL: URL2 } = require$$7$2;
70281
70452
  const PerMessageDeflate = requirePermessageDeflate$1();
70282
70453
  const Receiver = requireReceiver$1();
@@ -71014,7 +71185,7 @@ ${peerId}`;
71014
71185
  if (hasRequiredStream$1) return stream$1;
71015
71186
  hasRequiredStream$1 = 1;
71016
71187
  requireWebsocket$1();
71017
- const { Duplex } = xo;
71188
+ const { Duplex } = _o;
71018
71189
  function emitClose(stream2) {
71019
71190
  stream2.emit("close");
71020
71191
  }
@@ -71165,7 +71336,7 @@ ${peerId}`;
71165
71336
  hasRequiredWebsocketServer = 1;
71166
71337
  const EventEmitter2 = require$$0$7;
71167
71338
  const http$12 = http;
71168
- const { Duplex } = xo;
71339
+ const { Duplex } = _o;
71169
71340
  const { createHash: createHash2 } = crypto__default;
71170
71341
  const extension2 = requireExtension();
71171
71342
  const PerMessageDeflate = requirePermessageDeflate$1();
@@ -72808,68 +72979,7 @@ ${val.stack}`;
72808
72979
  "__wbindgen_closure_wrapper271": __wbindgen_closure_wrapper271
72809
72980
  }
72810
72981
  }, __vite__wasmUrl);
72811
- const memory = __vite__wasmModule.memory;
72812
- const __wbg_rawfileexportencoder_free = __vite__wasmModule.__wbg_rawfileexportencoder_free;
72813
- const __wbg_rawflock_free = __vite__wasmModule.__wbg_rawflock_free;
72814
- const callPendingEvents$1 = __vite__wasmModule.callPendingEvents;
72815
- const rawfileexportencoder_cancel = __vite__wasmModule.rawfileexportencoder_cancel;
72816
- const rawfileexportencoder_continue = __vite__wasmModule.rawfileexportencoder_continue;
72817
- const rawfileexportencoder_result = __vite__wasmModule.rawfileexportencoder_result;
72818
- const rawflock_createExportFileEncoder = __vite__wasmModule.rawflock_createExportFileEncoder;
72819
- const rawflock_delete = __vite__wasmModule.rawflock_delete;
72820
- const rawflock_exportFile = __vite__wasmModule.rawflock_exportFile;
72821
- const rawflock_exportFileDeprecatedV1 = __vite__wasmModule.rawflock_exportFileDeprecatedV1;
72822
- const rawflock_exportFileV2 = __vite__wasmModule.rawflock_exportFileV2;
72823
- const rawflock_exportJson = __vite__wasmModule.rawflock_exportJson;
72824
- const rawflock_finishExportFileEncoder = __vite__wasmModule.rawflock_finishExportFileEncoder;
72825
- const rawflock_fromFile = __vite__wasmModule.rawflock_fromFile;
72826
- const rawflock_fromJson = __vite__wasmModule.rawflock_fromJson;
72827
- const rawflock_get = __vite__wasmModule.rawflock_get;
72828
- const rawflock_getEntry = __vite__wasmModule.rawflock_getEntry;
72829
- const rawflock_getMaxPhysicalTime = __vite__wasmModule.rawflock_getMaxPhysicalTime;
72830
- const rawflock_importFile = __vite__wasmModule.rawflock_importFile;
72831
- const rawflock_importJson = __vite__wasmModule.rawflock_importJson;
72832
- const rawflock_inclusiveVersion = __vite__wasmModule.rawflock_inclusiveVersion;
72833
- const rawflock_isEmpty = __vite__wasmModule.rawflock_isEmpty;
72834
- const rawflock_isInTxn = __vite__wasmModule.rawflock_isInTxn;
72835
- const rawflock_merge = __vite__wasmModule.rawflock_merge;
72836
- const rawflock_new = __vite__wasmModule.rawflock_new;
72837
- const rawflock_peerId = __vite__wasmModule.rawflock_peerId;
72838
- const rawflock_put = __vite__wasmModule.rawflock_put;
72839
- const rawflock_putWithMeta = __vite__wasmModule.rawflock_putWithMeta;
72840
- const rawflock_recoverExportFile = __vite__wasmModule.rawflock_recoverExportFile;
72841
- const rawflock_recoverExportFileDeprecatedV1 = __vite__wasmModule.rawflock_recoverExportFileDeprecatedV1;
72842
- const rawflock_recoverFromFile = __vite__wasmModule.rawflock_recoverFromFile;
72843
- const rawflock_recoverImportFile = __vite__wasmModule.rawflock_recoverImportFile;
72844
- const rawflock_scan = __vite__wasmModule.rawflock_scan;
72845
- const rawflock_scanValues = __vite__wasmModule.rawflock_scanValues;
72846
- const rawflock_setPeerId = __vite__wasmModule.rawflock_setPeerId;
72847
- const rawflock_strictExportFile = __vite__wasmModule.rawflock_strictExportFile;
72848
- const rawflock_strictFromFile = __vite__wasmModule.rawflock_strictFromFile;
72849
- const rawflock_strictImportFile = __vite__wasmModule.rawflock_strictImportFile;
72850
- const rawflock_subscribe = __vite__wasmModule.rawflock_subscribe;
72851
- const rawflock_txnBegin = __vite__wasmModule.rawflock_txnBegin;
72852
- const rawflock_txnCommit = __vite__wasmModule.rawflock_txnCommit;
72853
- const rawflock_txnRollback = __vite__wasmModule.rawflock_txnRollback;
72854
- const rawflock_unsubscribe = __vite__wasmModule.rawflock_unsubscribe;
72855
- const rawflock_version = __vite__wasmModule.rawflock_version;
72856
- const start = __vite__wasmModule.start;
72857
- const rust_zstd_wasm_shim_calloc = __vite__wasmModule.rust_zstd_wasm_shim_calloc;
72858
- const rust_zstd_wasm_shim_free = __vite__wasmModule.rust_zstd_wasm_shim_free;
72859
- const rust_zstd_wasm_shim_malloc = __vite__wasmModule.rust_zstd_wasm_shim_malloc;
72860
- const rust_zstd_wasm_shim_memcmp = __vite__wasmModule.rust_zstd_wasm_shim_memcmp;
72861
- const rust_zstd_wasm_shim_memcpy = __vite__wasmModule.rust_zstd_wasm_shim_memcpy;
72862
- const rust_zstd_wasm_shim_memmove = __vite__wasmModule.rust_zstd_wasm_shim_memmove;
72863
- const rust_zstd_wasm_shim_memset = __vite__wasmModule.rust_zstd_wasm_shim_memset;
72864
- const rust_zstd_wasm_shim_qsort = __vite__wasmModule.rust_zstd_wasm_shim_qsort;
72865
- const __wbindgen_malloc = __vite__wasmModule.__wbindgen_malloc;
72866
- const __wbindgen_realloc = __vite__wasmModule.__wbindgen_realloc;
72867
- const __wbindgen_exn_store = __vite__wasmModule.__wbindgen_exn_store;
72868
- const __wbindgen_free = __vite__wasmModule.__wbindgen_free;
72869
- const __wbindgen_export_4 = __vite__wasmModule.__wbindgen_export_4;
72870
- const __wbindgen_add_to_stack_pointer = __vite__wasmModule.__wbindgen_add_to_stack_pointer;
72871
- const _dyn_core_9b3796e30d99ddb7___ops__function__FnMut_______Output______as_wasm_bindgen_86334783ada81479___closure__WasmClosure___describe__invoke___wasm_bindgen_86334783ada81479___JsValue_____ = __vite__wasmModule._dyn_core_9b3796e30d99ddb7___ops__function__FnMut_______Output______as_wasm_bindgen_86334783ada81479___closure__WasmClosure___describe__invoke___wasm_bindgen_86334783ada81479___JsValue_____;
72872
- const __wbindgen_start = __vite__wasmModule.__wbindgen_start;
72982
+ const { memory, __wbg_rawfileexportencoder_free, __wbg_rawflock_free, callPendingEvents: callPendingEvents$1, rawfileexportencoder_cancel, rawfileexportencoder_continue, rawfileexportencoder_result, rawflock_createExportFileEncoder, rawflock_delete, rawflock_exportFile, rawflock_exportFileDeprecatedV1, rawflock_exportFileV2, rawflock_exportJson, rawflock_finishExportFileEncoder, rawflock_fromFile, rawflock_fromJson, rawflock_get, rawflock_getEntry, rawflock_getMaxPhysicalTime, rawflock_importFile, rawflock_importJson, rawflock_inclusiveVersion, rawflock_isEmpty, rawflock_isInTxn, rawflock_merge, rawflock_new, rawflock_peerId, rawflock_put, rawflock_putWithMeta, rawflock_recoverExportFile, rawflock_recoverExportFileDeprecatedV1, rawflock_recoverFromFile, rawflock_recoverImportFile, rawflock_scan, rawflock_scanValues, rawflock_setPeerId, rawflock_strictExportFile, rawflock_strictFromFile, rawflock_strictImportFile, rawflock_subscribe, rawflock_txnBegin, rawflock_txnCommit, rawflock_txnRollback, rawflock_unsubscribe, rawflock_version, start, rust_zstd_wasm_shim_calloc, rust_zstd_wasm_shim_free, rust_zstd_wasm_shim_malloc, rust_zstd_wasm_shim_memcmp, rust_zstd_wasm_shim_memcpy, rust_zstd_wasm_shim_memmove, rust_zstd_wasm_shim_memset, rust_zstd_wasm_shim_qsort, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_exn_store, __wbindgen_free, __wbindgen_export_4, __wbindgen_add_to_stack_pointer, _dyn_core_9b3796e30d99ddb7___ops__function__FnMut_______Output______as_wasm_bindgen_86334783ada81479___closure__WasmClosure___describe__invoke___wasm_bindgen_86334783ada81479___JsValue_____, __wbindgen_start } = __vite__wasmModule;
72873
72983
  const wasmModule = Object.freeze(Object.defineProperty({
72874
72984
  __proto__: null,
72875
72985
  __wbg_rawfileexportencoder_free,
@@ -114028,7 +114138,7 @@ ${value}`;
114028
114138
  validate: validate2
114029
114139
  });
114030
114140
  };
114031
- const realZlibConstants = Ri__default.constants || {
114141
+ const realZlibConstants = Ci__default.constants || {
114032
114142
  ZLIB_VERNUM: 4736
114033
114143
  };
114034
114144
  const constants = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), {
@@ -114188,11 +114298,11 @@ ${value}`;
114188
114298
  this.#flushFlag = opts.flush ?? 0;
114189
114299
  this.#finishFlushFlag = opts.finishFlush ?? 0;
114190
114300
  this.#fullFlushFlag = opts.fullFlushFlag ?? 0;
114191
- if (typeof Ri[mode2] !== "function") {
114301
+ if (typeof Ci[mode2] !== "function") {
114192
114302
  throw new TypeError("Compression method not supported: " + mode2);
114193
114303
  }
114194
114304
  try {
114195
- this.#handle = new Ri[mode2](opts);
114305
+ this.#handle = new Ci[mode2](opts);
114196
114306
  } catch (er) {
114197
114307
  throw new ZlibError(er, this.constructor);
114198
114308
  }
@@ -117207,7 +117317,7 @@ ${value}`;
117207
117317
  return checkCwd(dir, done2);
117208
117318
  }
117209
117319
  if (preserve) {
117210
- return Xt__default.mkdir(dir, {
117320
+ return Qt__default.mkdir(dir, {
117211
117321
  mode: mode2,
117212
117322
  recursive: true
117213
117323
  }).then((made) => done2(null, made ?? void 0), done2);
@@ -118667,7 +118777,7 @@ ${value}`;
118667
118777
  }
118668
118778
  const version$8 = "1.10.1";
118669
118779
  const dependencies$1 = {
118670
- "@openai/codex": "^0.153.4"
118780
+ "@openai/codex": "^0.154.0"
118671
118781
  };
118672
118782
  const codexPackageJson = {
118673
118783
  version: version$8,
@@ -118677,99 +118787,99 @@ ${value}`;
118677
118787
  const grokPackageJson = {
118678
118788
  version: version$7
118679
118789
  };
118680
- const version$6 = "2.1.258";
118790
+ const version$6 = "2.1.274";
118681
118791
  const platforms = {
118682
118792
  "darwin-arm64": {
118683
118793
  "binary": "claude",
118684
- "checksum": "b63136194160791c27cfa7b0403060d85eb0752991625fde8c09f9acacb17c78",
118685
- "size": 199027600
118794
+ "checksum": "3509913f9d1576316c8845b88837f8fd3bbbcf26625833ac82cfb6b8985da94a",
118795
+ "size": 214149552
118686
118796
  },
118687
118797
  "darwin-x64": {
118688
118798
  "binary": "claude",
118689
- "checksum": "c857db5cd712865623bd61e806cf3f7e8e279c9e5c7c0af5eca06ca6717fc7fb",
118690
- "size": 207778640
118799
+ "checksum": "b18e8c9d7666d8987a174ac65e0019f4ba6befa73d2f75c05cbe92e5093431eb",
118800
+ "size": 222955360
118691
118801
  },
118692
118802
  "linux-arm64": {
118693
118803
  "binary": "claude",
118694
- "checksum": "43dc490af55262edcb3e9b1cb315de22cc09ccb08bd52a4c39bc5eabaa63100f",
118695
- "size": 215014736
118804
+ "checksum": "2db904daea17addff9de557ba26a725916888aa7b546e2c5dd989c20d9d49ab3",
118805
+ "size": 230482160
118696
118806
  },
118697
118807
  "linux-x64": {
118698
118808
  "binary": "claude",
118699
- "checksum": "704f1334ac65d3e89e1c6c1d7663293ad786a6166afdb71b5075337df630f976",
118700
- "size": 215473560
118809
+ "checksum": "15e2d05148f801b5774032faad87e624ecd172e9903288bda448b892eb58fa07",
118810
+ "size": 230580536
118701
118811
  },
118702
118812
  "linux-arm64-musl": {
118703
118813
  "binary": "claude",
118704
- "checksum": "d3bef6ba403fe3efba684fa93e1bb26bc7a08c054bd516639d54e77c77bb9821",
118705
- "size": 207894168
118814
+ "checksum": "5d50bd99667904879d95142dbd604b24d0273c13fb79f3abc2346cb00048049f",
118815
+ "size": 223098528
118706
118816
  },
118707
118817
  "linux-x64-musl": {
118708
118818
  "binary": "claude",
118709
- "checksum": "e74a226cf174d911664aff982486c55ca770d9c00007e52e86b13d10bae72af3",
118710
- "size": 209493960
118819
+ "checksum": "9f64fb9e79752c676234087573f05a794e2a8fbd49c91482c6567be258752e15",
118820
+ "size": 224501720
118711
118821
  },
118712
118822
  "win32-x64": {
118713
118823
  "binary": "claude.exe",
118714
- "checksum": "22f5f3a44093e14c75a4d1c8ce25c730b21dd634318fbe3268e9057d12b17c41",
118715
- "size": 218507936
118824
+ "checksum": "4e4c1746aff835bb05e5ed14cda72d21ee6fbda4147aa99b3135718614da117e",
118825
+ "size": 233691808
118716
118826
  },
118717
118827
  "win32-arm64": {
118718
118828
  "binary": "claude.exe",
118719
- "checksum": "42675c431b6014ad7243fea0ed0e371045dedc89d94aac81a9a0f528e644ed97",
118720
- "size": 209548960
118829
+ "checksum": "da93e462c34ec86efee80c70ac791d3232ed98bd44c6abbafb1b5ffa2a9185c4",
118830
+ "size": 224916128
118721
118831
  }
118722
118832
  };
118723
118833
  const claudeSdkManifestJson = {
118724
118834
  version: version$6,
118725
118835
  platforms
118726
118836
  };
118727
- const version$5 = "0.3.258";
118837
+ const version$5 = "0.3.274";
118728
118838
  const claudeSdkPackageJson = {
118729
118839
  version: version$5
118730
118840
  };
118731
- const sdkVersion = "0.3.258";
118732
- const version$4 = "2.1.258";
118841
+ const sdkVersion = "0.3.274";
118842
+ const version$4 = "2.1.274";
118733
118843
  const artifacts$1 = {
118734
118844
  "darwin-arm64": {
118735
- "fileName": "anthropic-ai-claude-agent-sdk-darwin-arm64-0.3.258.tar.zst",
118736
- "sha256": "dd01a1ae8868c41ac7755e89fa4fc087d28e265b6d7ab122c18317dfd7023ed2",
118737
- "size": 73550133
118845
+ "fileName": "anthropic-ai-claude-agent-sdk-darwin-arm64-0.3.274.tar.zst",
118846
+ "sha256": "81f779d99da5acc67256cb76b95623b819da38780075fce2d074b154cc98d432",
118847
+ "size": 78586296
118738
118848
  },
118739
118849
  "darwin-x64": {
118740
- "fileName": "anthropic-ai-claude-agent-sdk-darwin-x64-0.3.258.tar.zst",
118741
- "sha256": "f46392ec768822fca40d61f6986d7d293a42b3ee5820b0c1a6c14bee474fdb02",
118742
- "size": 77362894
118850
+ "fileName": "anthropic-ai-claude-agent-sdk-darwin-x64-0.3.274.tar.zst",
118851
+ "sha256": "e8d9d7ed00c5011f2608007908a666d259955d3ab9e643e1521528e47e8a9743",
118852
+ "size": 82534099
118743
118853
  },
118744
118854
  "linux-arm64": {
118745
- "fileName": "anthropic-ai-claude-agent-sdk-linux-arm64-0.3.258.tar.zst",
118746
- "sha256": "b2df6e0ac548e348a1609d5cba8c1c22c8f4f98b9a3ab54f5ce2082ff96db0f2",
118747
- "size": 83313235
118855
+ "fileName": "anthropic-ai-claude-agent-sdk-linux-arm64-0.3.274.tar.zst",
118856
+ "sha256": "58fe3450c7e8fea17b4d0b8913986d09e61d88c15f3269dee9728c0f8e50995a",
118857
+ "size": 88429849
118748
118858
  },
118749
118859
  "linux-x64": {
118750
- "fileName": "anthropic-ai-claude-agent-sdk-linux-x64-0.3.258.tar.zst",
118751
- "sha256": "ea9bfd7a1cfe218b9c9451450401d654711787bf1972b8a22d3b5f7b495a73f8",
118752
- "size": 83414920
118860
+ "fileName": "anthropic-ai-claude-agent-sdk-linux-x64-0.3.274.tar.zst",
118861
+ "sha256": "fcb13948a2ad11ec473f5b2a041dd23a918c2aa855593d850b7714017d6da35a",
118862
+ "size": 88486336
118753
118863
  },
118754
118864
  "linux-arm64-musl": {
118755
- "fileName": "anthropic-ai-claude-agent-sdk-linux-arm64-musl-0.3.258.tar.zst",
118756
- "sha256": "9293b47fd63fa6f368fe0a9fa2930fd6963e6108e65b34584f854919df7f227b",
118757
- "size": 81542174
118865
+ "fileName": "anthropic-ai-claude-agent-sdk-linux-arm64-musl-0.3.274.tar.zst",
118866
+ "sha256": "c98eaaa7621354b4fcfae711e8fe8dbf308f103fe217157744c6c557140da751",
118867
+ "size": 86620353
118758
118868
  },
118759
118869
  "linux-x64-musl": {
118760
- "fileName": "anthropic-ai-claude-agent-sdk-linux-x64-musl-0.3.258.tar.zst",
118761
- "sha256": "ba0e031ff3266f41d73a28effc25d4334d992891b0495542ca7cf3b2a75632c8",
118762
- "size": 81733248
118870
+ "fileName": "anthropic-ai-claude-agent-sdk-linux-x64-musl-0.3.274.tar.zst",
118871
+ "sha256": "bad9a39c6d4e408da22b8fd33b1153610aef7f8bfe01c02f03b75a72ca2bc208",
118872
+ "size": 86783220
118763
118873
  },
118764
118874
  "win32-arm64": {
118765
- "fileName": "anthropic-ai-claude-agent-sdk-win32-arm64-0.3.258.tar.zst",
118766
- "sha256": "13cd9e1ad2958bc8dbaaf908362852136b63f8ce4f452beade38d0323a40774d",
118767
- "size": 83257894
118875
+ "fileName": "anthropic-ai-claude-agent-sdk-win32-arm64-0.3.274.tar.zst",
118876
+ "sha256": "db4ee68f49eb522fb82b66353551e0e263528962a323cfcbcddb70ed71bb59da",
118877
+ "size": 88332921
118768
118878
  },
118769
118879
  "win32-x64": {
118770
- "fileName": "anthropic-ai-claude-agent-sdk-win32-x64-0.3.258.tar.zst",
118771
- "sha256": "ae93d318561a4c069d7074726d345224b588e1b3b0a6955b604f6a06ec0c3195",
118772
- "size": 86357676
118880
+ "fileName": "anthropic-ai-claude-agent-sdk-win32-x64-0.3.274.tar.zst",
118881
+ "sha256": "bde43b6ba0925a83dcfd1bb39a8f44409ef5d739cb8579df072e2023ed707cc9",
118882
+ "size": 91391135
118773
118883
  }
118774
118884
  };
118775
118885
  const claudeRuntimeManifestJson = {
@@ -118777,37 +118887,37 @@ ${value}`;
118777
118887
  version: version$4,
118778
118888
  artifacts: artifacts$1
118779
118889
  };
118780
- const version$3 = "0.153.4";
118890
+ const version$3 = "0.154.0";
118781
118891
  const artifacts = {
118782
118892
  "darwin-arm64": {
118783
118893
  "fileName": "codex-package-aarch64-apple-darwin.tar.zst",
118784
- "sha256": "be8a1a895533664ba6f2f11bc30ac8dae3b8ce37a152684229148ad9a8c7d269",
118785
- "size": 80691565
118894
+ "sha256": "03c35174e6562645dfed978bf72556f8e5cb99e10b08da19e99279bad5f28b46",
118895
+ "size": 81072808
118786
118896
  },
118787
118897
  "darwin-x64": {
118788
118898
  "fileName": "codex-package-x86_64-apple-darwin.tar.zst",
118789
- "sha256": "a673331d8a21023dca1ca66443c1a41421a3105e587339ea7f81a06a56d8dd9b",
118790
- "size": 88316449
118899
+ "sha256": "5d312224e73091a68b95dff962e527bbc6e46dcf60a62e5d362ff4bfae3a5c34",
118900
+ "size": 89126142
118791
118901
  },
118792
118902
  "linux-arm64": {
118793
118903
  "fileName": "codex-package-aarch64-unknown-linux-musl.tar.zst",
118794
- "sha256": "01ce0d1c38aca1ccc0c67f7612160cef5d820b452e1093d3a6d28597bfebfdb6",
118795
- "size": 85851511
118904
+ "sha256": "2538433493c16e13a00820a4130d75da317098c0d0c293c464210808b20ce0f9",
118905
+ "size": 86224482
118796
118906
  },
118797
118907
  "linux-x64": {
118798
118908
  "fileName": "codex-package-x86_64-unknown-linux-musl.tar.zst",
118799
- "sha256": "2b5c00df5758d014c79910fdffed43f29a6cae73f37e92d5ec216543ca53e79e",
118800
- "size": 92109110
118909
+ "sha256": "68841a983ff470ae5b84922490b254a53723415e31dd8b8ea7b0811addb0086d",
118910
+ "size": 92155632
118801
118911
  },
118802
118912
  "win32-arm64": {
118803
118913
  "fileName": "codex-package-aarch64-pc-windows-msvc.tar.zst",
118804
- "sha256": "92ff19d1012c1934bb1f9c10bfe15ac9f0af308d2de15b91dfc0f59faf8a77ba",
118805
- "size": 94420871
118914
+ "sha256": "c5f4b5d6c159b0cdd2e2c854f9c0622927caa99c6b796854fda94d10ec3f4cbd",
118915
+ "size": 94862813
118806
118916
  },
118807
118917
  "win32-x64": {
118808
118918
  "fileName": "codex-package-x86_64-pc-windows-msvc.tar.zst",
118809
- "sha256": "f06e52c803cb74fb5fe6d42dc0c3c53ecbbf6822ad0c9d0239a0304165209f29",
118810
- "size": 102002466
118919
+ "sha256": "83e1289a2615836a7f3ef72513211df48293c0d104c95abd233dc95e7d516604",
118920
+ "size": 102338279
118811
118921
  }
118812
118922
  };
118813
118923
  const codexRuntimeManifestJson = {
@@ -121080,20 +121190,20 @@ ${value}`;
121080
121190
  };
121081
121191
  const parsed = DaemonUpgradeIntentSchema.parse(value);
121082
121192
  const dir = path.dirname(DAEMON_UPGRADE_INTENT_FILE);
121083
- await Xt.mkdir(dir, {
121193
+ await Qt.mkdir(dir, {
121084
121194
  recursive: true
121085
121195
  });
121086
121196
  const tmpPath = path.join(dir, `.${path.basename(DAEMON_UPGRADE_INTENT_FILE)}.${process.pid}.tmp`);
121087
- await Xt.writeFile(tmpPath, `${JSON.stringify(parsed, null, 2)}
121197
+ await Qt.writeFile(tmpPath, `${JSON.stringify(parsed, null, 2)}
121088
121198
  `, {
121089
121199
  encoding: "utf8",
121090
121200
  mode: 384
121091
121201
  });
121092
- await Xt.rename(tmpPath, DAEMON_UPGRADE_INTENT_FILE);
121202
+ await Qt.rename(tmpPath, DAEMON_UPGRADE_INTENT_FILE);
121093
121203
  };
121094
121204
  const readDaemonUpgradeIntent = async () => {
121095
121205
  try {
121096
- const raw2 = await Xt.readFile(DAEMON_UPGRADE_INTENT_FILE, "utf8");
121206
+ const raw2 = await Qt.readFile(DAEMON_UPGRADE_INTENT_FILE, "utf8");
121097
121207
  const parsed = DaemonUpgradeIntentSchema.safeParse(JSON.parse(raw2));
121098
121208
  return parsed.success ? parsed.data : null;
121099
121209
  } catch {
@@ -121102,7 +121212,7 @@ ${value}`;
121102
121212
  };
121103
121213
  const clearDaemonUpgradeIntent = async () => {
121104
121214
  try {
121105
- await Xt.unlink(DAEMON_UPGRADE_INTENT_FILE);
121215
+ await Qt.unlink(DAEMON_UPGRADE_INTENT_FILE);
121106
121216
  } catch {
121107
121217
  }
121108
121218
  };
@@ -122534,7 +122644,7 @@ The file is not available yet and could not be downloaded; ask the user to resen
122534
122644
  if (!targetTurnId && callbacks?.allowAutonomousAssistantEntry !== true) {
122535
122645
  callbacks?.logger?.warn(`[${doc.sessionId}] Dropping ${persistableBatch.length} ACP history notifications without an assistant entry target`);
122536
122646
  } else {
122537
- const targetOnly = Boolean(targetTurnId && persistableBatch.every(({ update: update2 }) => (update2.sessionUpdate === "agent_message_chunk" || update2.sessionUpdate === "agent_thought_chunk") && update2.content.type === "text"));
122647
+ const targetOnly = Boolean(targetTurnId && persistableBatch.every(({ update: update2 }) => (update2.sessionUpdate === "agent_message_chunk" || update2.sessionUpdate === "agent_thought_chunk") && update2.content.type === "text" && getDevinSubagentContextId(update2._meta) === null));
122538
122648
  const createId = targetTurnId ? () => targetTurnId : v4;
122539
122649
  await doc.agentWrites.applyAgentBatch({
122540
122650
  notifications: persistableBatch,
@@ -123050,7 +123160,7 @@ ${incoming}`).output;
123050
123160
  return update2._meta?.lody !== null && typeof update2._meta?.lody === "object" && typeof update2._meta.lody.turnId === "string";
123051
123161
  }
123052
123162
  if (update2.sessionUpdate !== "tool_call_update") return true;
123053
- if (parseLodyTaskMeta(update2._meta)) return true;
123163
+ if (parseLodyTaskMeta(update2._meta) ?? parseDevinSubagentTaskMeta(update2._meta)) return true;
123054
123164
  if (update2.status === "completed" || update2.status === "failed") return true;
123055
123165
  const rawInput = update2.rawInput;
123056
123166
  if (rawInput && typeof rawInput === "object" && Object.keys(rawInput).length > 0) {
@@ -123224,6 +123334,7 @@ ${incoming}`).output;
123224
123334
  const extractLatestPlanSnapshot = (batch) => {
123225
123335
  for (let i2 = batch.length - 1; i2 >= 0; i2 -= 1) {
123226
123336
  const update2 = batch[i2]?.update;
123337
+ if (getDevinSubagentContextId(update2?._meta) !== null) continue;
123227
123338
  const entries = update2?.sessionUpdate === "plan" ? update2.entries : update2?.sessionUpdate === "plan_update" && update2.plan.type === "items" ? update2.plan.entries : null;
123228
123339
  if (entries) {
123229
123340
  return entries.map((entry) => ({
@@ -129934,6 +130045,7 @@ ${incoming}`).output;
129934
130045
  supportsFork = false;
129935
130046
  supportsForkAtTurn = false;
129936
130047
  lodyExtensionCapabilities = {};
130048
+ devinSubagentTaskIds = /* @__PURE__ */ new Set();
129937
130049
  worktreeProject;
129938
130050
  authMethods = [];
129939
130051
  authenticationRequired = false;
@@ -130176,6 +130288,16 @@ ${incoming}`).output;
130176
130288
  return;
130177
130289
  }
130178
130290
  this.lastSessionUpdateAtMs = Date.now();
130291
+ const isToolUpdate = params.update.sessionUpdate === "tool_call" || params.update.sessionUpdate === "tool_call_update";
130292
+ const devinLifecycle = parseDevinSubagentTaskMeta(params.update._meta);
130293
+ if (devinLifecycle !== null && isToolUpdate && "toolCallId" in params.update && params.update.toolCallId.length > 0) {
130294
+ this.devinSubagentTaskIds.add(devinLifecycle.taskId);
130295
+ }
130296
+ const devinSubagentOwnerId = getDevinSubagentContextId(params.update._meta);
130297
+ const isDevinSubagentInternal = devinSubagentOwnerId !== null && this.devinSubagentTaskIds.has(devinSubagentOwnerId) && !hasOtherDevinSubagentMeta(params.update._meta);
130298
+ if (isDevinSubagentInternal && !isToolUpdate) {
130299
+ return;
130300
+ }
130179
130301
  if (this.handleUsageUpdate(params.update)) {
130180
130302
  return;
130181
130303
  }
@@ -130753,6 +130875,11 @@ ${incoming}`).output;
130753
130875
  getGrokClientIdentifier() {
130754
130876
  return this.options.agentConfig?.cliType === "builtin" && this.options.agentConfig.agentType === "grok" ? `lody:${this.options.sessionId}` : void 0;
130755
130877
  }
130878
+ getDevinClientCapabilitiesMeta() {
130879
+ return this.options.agentConfig?.agentType === "devin" ? {
130880
+ "cognition.ai/subagentSupport": true
130881
+ } : void 0;
130882
+ }
130756
130883
  getSessionStartMeta(forkSessionTurnId) {
130757
130884
  const clientIdentifier = this.getGrokClientIdentifier();
130758
130885
  const lody = {
@@ -130846,6 +130973,7 @@ ${incoming}`).output;
130846
130973
  const connection2 = new ClientSideConnection(() => this, stream2);
130847
130974
  this.connection = connection2;
130848
130975
  const grokClientIdentifier = this.getGrokClientIdentifier();
130976
+ const devinClientCapabilitiesMeta = this.getDevinClientCapabilitiesMeta();
130849
130977
  this.worktreeProject = void 0;
130850
130978
  this.logger.debug(`[${this.options.sessionId}] Starting ACP client (workdir=${workdir} resumeSessionId=${resumeSessionId ?? "none"} forkSessionId=${forkSessionId ?? "none"})`);
130851
130979
  if (resumeSessionId && forkSessionId) {
@@ -130901,7 +131029,10 @@ ${incoming}`).output;
130901
131029
  },
130902
131030
  elicitation: {
130903
131031
  form: {}
130904
- }
131032
+ },
131033
+ ...devinClientCapabilitiesMeta !== void 0 ? {
131034
+ _meta: devinClientCapabilitiesMeta
131035
+ } : {}
130905
131036
  }
130906
131037
  }), startupAbort), this.logger, "connection.initialize", this.options.sessionId, ACP_INIT_TIMEOUT_MS$1);
130907
131038
  } catch (error2) {
@@ -131188,6 +131319,7 @@ ${incoming}`).output;
131188
131319
  sessionEstablishDurationMs: newSessionDurationMs
131189
131320
  });
131190
131321
  this.acpSessionId = sessionResponse.sessionId;
131322
+ this.devinSubagentTaskIds.clear();
131191
131323
  this.logger.debug(`[${this.options.sessionId}] ACP session id set: ${sessionResponse.sessionId}`);
131192
131324
  this.sessionWorkdir = workdir;
131193
131325
  this.logger.debug(`ACP Session mode set to agent: ${sessionResponse.sessionId}`);
@@ -131233,6 +131365,7 @@ ${incoming}`).output;
131233
131365
  adoptPreparedSession(sessionResponse) {
131234
131366
  this.applySessionResponseState(sessionResponse);
131235
131367
  this.acpSessionId = sessionResponse.sessionId;
131368
+ this.devinSubagentTaskIds.clear();
131236
131369
  this.authenticationRequired = false;
131237
131370
  this.logger.debug(`[${this.options.sessionId}] Adopted replacement ACP session: ${sessionResponse.sessionId}`);
131238
131371
  }
@@ -132629,7 +132762,7 @@ ${error2.message}` : execaMessage;
132629
132762
  function requireBufferStream() {
132630
132763
  if (hasRequiredBufferStream) return bufferStream;
132631
132764
  hasRequiredBufferStream = 1;
132632
- const { PassThrough: PassThroughStream } = xo;
132765
+ const { PassThrough: PassThroughStream } = _o;
132633
132766
  bufferStream = (options) => {
132634
132767
  options = {
132635
132768
  ...options
@@ -132678,7 +132811,7 @@ ${error2.message}` : execaMessage;
132678
132811
  if (hasRequiredGetStream) return getStream.exports;
132679
132812
  hasRequiredGetStream = 1;
132680
132813
  const { constants: BufferConstants } = require$$0$6;
132681
- const stream2 = xo;
132814
+ const stream2 = _o;
132682
132815
  const { promisify: promisify2 } = require$$0$5;
132683
132816
  const bufferStream2 = requireBufferStream();
132684
132817
  const streamPipelinePromisified = promisify2(stream2.pipeline);
@@ -132738,7 +132871,7 @@ ${error2.message}` : execaMessage;
132738
132871
  function requireMergeStream() {
132739
132872
  if (hasRequiredMergeStream) return mergeStream;
132740
132873
  hasRequiredMergeStream = 1;
132741
- const { PassThrough: PassThrough2 } = xo;
132874
+ const { PassThrough: PassThrough2 } = _o;
132742
132875
  mergeStream = function() {
132743
132876
  var sources = [];
132744
132877
  var output = new PassThrough2({
@@ -133383,7 +133516,7 @@ ${error2.message}` : execaMessage;
133383
133516
  hasRequiredFdSlicer = 1;
133384
133517
  var fs2 = fs__default$1;
133385
133518
  var util2 = require$$0$5;
133386
- var stream2 = xo;
133519
+ var stream2 = _o;
133387
133520
  var Readable2 = stream2.Readable;
133388
133521
  var Writable = stream2.Writable;
133389
133522
  var PassThrough2 = stream2.PassThrough;
@@ -133949,14 +134082,14 @@ ${error2.message}` : execaMessage;
133949
134082
  if (hasRequiredYauzl) return yauzl;
133950
134083
  hasRequiredYauzl = 1;
133951
134084
  var fs2 = fs__default$1;
133952
- var zlib = Ri__default;
134085
+ var zlib = Ci__default;
133953
134086
  var fd_slicer = requireFdSlicer();
133954
134087
  var crc322 = requireBufferCrc32();
133955
134088
  var util2 = require$$0$5;
133956
134089
  var EventEmitter2 = require$$0$7.EventEmitter;
133957
- var Transform2 = xo.Transform;
133958
- var PassThrough2 = xo.PassThrough;
133959
- var Writable = xo.Writable;
134090
+ var Transform2 = _o.Transform;
134091
+ var PassThrough2 = _o.PassThrough;
134092
+ var Writable = _o.Writable;
133960
134093
  yauzl.open = open2;
133961
134094
  yauzl.fromFd = fromFd;
133962
134095
  yauzl.fromBuffer = fromBuffer;
@@ -160318,13 +160451,19 @@ ${part.truncated ? TRUNCATION_MARKER : ""}${part.content}`).join("\n\n");
160318
160451
  cause: error2
160319
160452
  });
160320
160453
  }
160454
+ function buildPrewriteSyncError(error2) {
160455
+ return new WorkspaceSyncUnavailableError({
160456
+ message: `${formatErrorMessage(error2)} Retry after checking network connectivity; no changes were written.`,
160457
+ cause: error2
160458
+ });
160459
+ }
160321
160460
  async function syncWorkspaceMetaForRead(manager, reason) {
160322
160461
  try {
160323
160462
  await manager.syncMetaOrThrow({
160324
160463
  reason
160325
160464
  });
160326
160465
  } catch (error2) {
160327
- throw buildOfflineHint(error2);
160466
+ throw reason.endsWith(":prewrite") ? buildPrewriteSyncError(error2) : buildOfflineHint(error2);
160328
160467
  }
160329
160468
  }
160330
160469
  async function syncDocForRead(manager, docId, reason) {
@@ -164347,25 +164486,27 @@ ${entry.text}`).join("\n\n");
164347
164486
  }), "session_turn");
164348
164487
  return history;
164349
164488
  }
164350
- async function listChildSessionIds(manager, parentSessionId) {
164351
- return (await listSessionMetasForWorkspace(manager)).filter((session2) => session2.parentSessionId === parentSessionId && session2.id !== parentSessionId).map((session2) => session2.id);
164352
- }
164353
- async function listArchiveDescendantSessionIds(manager, sessionId) {
164354
- return collectSessionArchiveTargets(sessionId, await listSessionMetasForWorkspace(manager)).map((session2) => session2.id);
164355
- }
164356
- async function archiveSessionWithSyncedMetadata(manager, sessionId) {
164357
- await syncWorkspaceMetaForRead(manager, `session.archive:${sessionId}:prewrite`);
164358
- await resolveSessionMetaOrThrow(manager, sessionId);
164359
- const childSessionIds = await listArchiveDescendantSessionIds(manager, sessionId);
164360
- await applySessionAndChildren(sessionId, childSessionIds, (id2) => manager.repo.upsertDocMeta(getSessionRoomId(id2), buildSessionArchiveMetaPatch()));
164361
- await ensureWorkspaceMetaSynced(manager, `session.archive:${sessionId}`);
164362
- return childSessionIds;
164363
- }
164364
- async function applySessionAndChildren(sessionId, childSessionIds, apply) {
164365
- await Promise.all([
164366
- sessionId,
164367
- ...childSessionIds
164368
- ].map(apply));
164489
+ async function runSessionOperationWithSyncedMetadata(manager, sessionId, operation) {
164490
+ const reason = `session.${operation}:${sessionId}`;
164491
+ await syncWorkspaceMetaForRead(manager, `${reason}:prewrite`);
164492
+ const targets = await readSessionOperationTargets(manager.repo, sessionId, operation);
164493
+ const [root, ...descendants] = targets;
164494
+ if (operation !== "archive" && root.isArchived !== true) {
164495
+ throw new Error(`Session ${sessionId} is not archived.`);
164496
+ }
164497
+ for (const target of operation === "delete" ? [
164498
+ ...targets
164499
+ ].reverse() : targets) {
164500
+ const roomId = getSessionRoomId(target.id);
164501
+ if (operation === "delete") {
164502
+ await manager.repo.deleteDoc(roomId);
164503
+ await manager.cleanSessionDoc(target.id);
164504
+ } else {
164505
+ await manager.repo.upsertDocMeta(roomId, operation === "archive" ? buildSessionArchiveMetaPatch() : buildSessionRestoreMetaPatch());
164506
+ }
164507
+ }
164508
+ await ensureWorkspaceMetaSynced(manager, reason);
164509
+ return descendants.map((session2) => session2.id);
164369
164510
  }
164370
164511
  async function syncMachineFlockDocsForRead(manager, workspaceId, machineIds, reason) {
164371
164512
  await Promise.all(Array.from(new Set(machineIds)).map(async (machineId) => await manager.syncFlockDocOrThrow(getMachineFlockDocId(workspaceId, machineId), {
@@ -164658,8 +164799,16 @@ ${entry.text}`).join("\n\n");
164658
164799
  configOptionValues: parseConfigOptionAssignments(args2.configOption)
164659
164800
  };
164660
164801
  }
164802
+ function findTurnConfigOptionByCategory(capability, category) {
164803
+ return capability?.configOptions?.find((option2) => option2.category === category);
164804
+ }
164805
+ function getTurnSelectorConfigOptionValue(values, capability, category) {
164806
+ const optionId = findTurnConfigOptionByCategory(capability, category)?.id ?? category;
164807
+ const value = values?.[optionId];
164808
+ return typeof value === "string" ? value : void 0;
164809
+ }
164661
164810
  function withBuiltinDefaultTurnMode(config2, target, capability) {
164662
- if (config2.modeId || typeof config2.configOptionValues?.mode === "string") {
164811
+ if (config2.modeId || getTurnSelectorConfigOptionValue(config2.configOptionValues, capability, "mode")) {
164663
164812
  return config2;
164664
164813
  }
164665
164814
  const modeId = getBuiltinDefaultModeId(target.cliType, target.agentType);
@@ -164717,16 +164866,61 @@ ${entry.text}`).join("\n\n");
164717
164866
  }
164718
164867
  }
164719
164868
  }
164720
- function filterCompatibleTurnConfigOptionValues(values, capability) {
164721
- if (!values || !capability?.configOptions) {
164869
+ function validateModelDependentTurnConfigOptionValues(values, capability, targetModelId) {
164870
+ const validatedIds = /* @__PURE__ */ new Set();
164871
+ if (!values || !capability || !targetModelId) {
164872
+ return validatedIds;
164873
+ }
164874
+ const probedModelId = findTurnConfigOptionByCategory(capability, "model")?.currentValue;
164875
+ const optionsById = new Map((capability.configOptions ?? []).map((option2) => [
164876
+ option2.id,
164877
+ option2
164878
+ ]));
164879
+ for (const [id2, value] of Object.entries(values)) {
164880
+ const option2 = optionsById.get(id2);
164881
+ const isEffort = isAcpThoughtLevelConfigOption(option2 ?? {
164882
+ id: id2
164883
+ }) || id2 === "effort";
164884
+ if (isEffort) {
164885
+ const efforts = capability.modelReasoningEfforts?.[targetModelId];
164886
+ if (efforts !== void 0) {
164887
+ if (typeof value !== "string" || !efforts.includes(value)) {
164888
+ throw new Error(`Invalid reasoning effort for model ${targetModelId}: ${String(value)}. Allowed values: ${efforts.join(", ")}.`);
164889
+ }
164890
+ validatedIds.add(id2);
164891
+ } else if (targetModelId !== probedModelId) {
164892
+ validatedIds.add(id2);
164893
+ }
164894
+ } else if (isAcpFastModeConfigId(id2) && targetModelId !== probedModelId) {
164895
+ validatedIds.add(id2);
164896
+ }
164897
+ }
164898
+ return validatedIds;
164899
+ }
164900
+ function filterCompatibleTurnConfigOptionValues(values, capability, targetModelId) {
164901
+ if (!values || !capability) {
164722
164902
  return void 0;
164723
164903
  }
164724
- const optionsById = new Map(capability.configOptions.map((option2) => [
164904
+ const optionsById = new Map((capability.configOptions ?? []).map((option2) => [
164725
164905
  option2.id,
164726
164906
  option2
164727
164907
  ]));
164908
+ const probedModelId = capability.configOptions?.find((option2) => option2.category === "model")?.currentValue;
164728
164909
  const compatible = Object.fromEntries(Object.entries(values).filter(([id2, value]) => {
164729
164910
  const option2 = optionsById.get(id2);
164911
+ if (targetModelId) {
164912
+ const isEffort = isAcpThoughtLevelConfigOption(option2 ?? {
164913
+ id: id2
164914
+ }) || id2 === "effort";
164915
+ if (isEffort) {
164916
+ const efforts = capability.modelReasoningEfforts?.[targetModelId];
164917
+ if (efforts !== void 0) return typeof value === "string" && efforts.includes(value);
164918
+ }
164919
+ if (targetModelId !== probedModelId) {
164920
+ if (isEffort) return typeof value === "string";
164921
+ if (isAcpFastModeConfigId(id2)) return typeof value === "boolean" || value === "on" || value === "off";
164922
+ }
164923
+ }
164730
164924
  return option2 !== void 0 && validateConfigOptionValue(option2, value) === void 0;
164731
164925
  }));
164732
164926
  return Object.keys(compatible).length > 0 ? compatible : void 0;
@@ -164809,20 +165003,47 @@ ${entry.text}`).join("\n\n");
164809
165003
  } : {}
164810
165004
  };
164811
165005
  }
164812
- async function resolveSessionTurnDispatchDefaults(manager, sessionId, agentConfig) {
164813
- const sessionDoc = await manager.getOrCreateSessionDoc(sessionId);
164814
- const history = readSessionHistory(sessionDoc.sessionData.history);
165006
+ function resolveTurnDispatchDefaultsFromHistory(history, agent2) {
165007
+ let fallback2;
164815
165008
  for (let index = history.length - 1; index >= 0; index -= 1) {
164816
165009
  const entry = history[index];
164817
165010
  if (entry?.role !== "user") {
164818
165011
  continue;
164819
165012
  }
164820
- const defaults2 = resolveTurnDispatchConfigFromInputConfig(entry.inputConfig, agentConfig);
164821
- if (defaults2) {
165013
+ const defaults2 = resolveTurnDispatchConfigFromInputConfig(entry.inputConfig, agent2);
165014
+ if (!defaults2) {
165015
+ continue;
165016
+ }
165017
+ if (defaults2.modelId) {
164822
165018
  return defaults2;
164823
165019
  }
165020
+ fallback2 ??= defaults2;
164824
165021
  }
164825
- return void 0;
165022
+ return fallback2;
165023
+ }
165024
+ async function resolveSessionTurnDispatchDefaults(manager, sessionId, agentConfig) {
165025
+ const sessionDoc = await manager.getOrCreateSessionDoc(sessionId);
165026
+ return resolveTurnDispatchDefaultsFromHistory(readSessionHistory(sessionDoc.sessionData.history), agentConfig);
165027
+ }
165028
+ function resolveEffectiveSessionChatDispatchConfig(args2) {
165029
+ const previous = args2.inheritedDispatchConfig;
165030
+ const explicitModeOption = getTurnSelectorConfigOptionValue(args2.dispatchConfig.configOptionValues, args2.capability, "mode");
165031
+ const explicitModelOption = getTurnSelectorConfigOptionValue(args2.dispatchConfig.configOptionValues, args2.capability, "model");
165032
+ const inherited = previous ? {
165033
+ modeId: explicitModeOption ? void 0 : previous.modeId,
165034
+ modelId: explicitModelOption ? void 0 : previous.modelId,
165035
+ configOptionValues: args2.dispatchConfig.modelId && args2.dispatchConfig.modelId !== previous.modelId ? void 0 : previous.configOptionValues
165036
+ } : void 0;
165037
+ const compatible = filterCompatibleInheritedTurnConfig(inherited, args2.capability);
165038
+ if (compatible) {
165039
+ compatible.configOptionValues = filterCompatibleTurnConfigOptionValues(inherited?.configOptionValues, args2.capability, compatible.modelId);
165040
+ }
165041
+ const effective = withBuiltinDefaultTurnMode(mergeTurnDispatchConfig(args2.dispatchConfig, compatible), args2.target, args2.capability);
165042
+ validateTurnModeAndModel(args2.dispatchConfig, args2.capability);
165043
+ const targetModelId = effective.modelId ?? getTurnSelectorConfigOptionValue(effective.configOptionValues, args2.capability, "model");
165044
+ const validatedIds = validateModelDependentTurnConfigOptionValues(args2.dispatchConfig.configOptionValues, args2.capability, targetModelId);
165045
+ validateTurnConfigOptionValues(args2.dispatchConfig.configOptionValues, args2.capability, validatedIds);
165046
+ return effective;
164826
165047
  }
164827
165048
  function buildStructuredWaitError(outputMode, sessionId, userTurnId, error2) {
164828
165049
  const message = formatErrorMessage(error2);
@@ -165843,18 +166064,6 @@ ${entry.text}`).join("\n\n");
165843
166064
  sessionId,
165844
166065
  requester
165845
166066
  });
165846
- const mayApplyBuiltinDefault = Boolean(getBuiltinDefaultModeId(session2.cliType, session2.agentType)) && !dispatchConfig.modeId && typeof dispatchConfig.configOptionValues?.mode !== "string";
165847
- const capability = dispatchConfig.modeId || dispatchConfig.modelId || dispatchConfig.configOptionValues || mayApplyBuiltinDefault ? await readAgentAcpCapability({
165848
- manager,
165849
- workspaceId: workspace.id,
165850
- machineId: session2.machineId,
165851
- agentConfigId: session2.agentConfigId
165852
- }) : void 0;
165853
- if (dispatchConfig.modeId || dispatchConfig.modelId || dispatchConfig.configOptionValues) {
165854
- validateTurnModeAndModel(dispatchConfig, capability);
165855
- validateTurnConfigOptionValues(dispatchConfig.configOptionValues, capability);
165856
- }
165857
- const effectiveDispatchConfig = withBuiltinDefaultTurnMode(dispatchConfig, session2, capability);
165858
166067
  await syncDocForRead(manager, getSessionRoomId(sessionId), `session.chat:${sessionId}:prewrite:doc`);
165859
166068
  const sessionDoc = await manager.getOrCreateSessionDoc(sessionId);
165860
166069
  const quotaHistory = orchestration?.bypassSessionQuota ? void 0 : await checkSessionTurnQuotaAndReadHistory({
@@ -165863,6 +166072,21 @@ ${entry.text}`).join("\n\n");
165863
166072
  sessionDoc,
165864
166073
  userTurnId: orchestration?.userTurnId
165865
166074
  });
166075
+ const historyForDefaults = quotaHistory ?? await readSessionHistory(sessionDoc.sessionData.history);
166076
+ const inheritedDispatchConfig = resolveTurnDispatchDefaultsFromHistory(historyForDefaults, session2);
166077
+ const mayApplyBuiltinDefault = Boolean(getBuiltinDefaultModeId(session2.cliType, session2.agentType)) && !dispatchConfig.modeId && typeof dispatchConfig.configOptionValues?.mode !== "string" && inheritedDispatchConfig?.modeId === void 0 && typeof inheritedDispatchConfig?.configOptionValues?.mode !== "string";
166078
+ const capability = dispatchConfig.modeId || dispatchConfig.modelId || dispatchConfig.configOptionValues || inheritedDispatchConfig?.modeId !== void 0 || inheritedDispatchConfig?.modelId !== void 0 || inheritedDispatchConfig?.configOptionValues !== void 0 || mayApplyBuiltinDefault ? await readAgentAcpCapability({
166079
+ manager,
166080
+ workspaceId: workspace.id,
166081
+ machineId: session2.machineId,
166082
+ agentConfigId: session2.agentConfigId
166083
+ }) : void 0;
166084
+ const effectiveDispatchConfig = resolveEffectiveSessionChatDispatchConfig({
166085
+ dispatchConfig,
166086
+ inheritedDispatchConfig,
166087
+ target: session2,
166088
+ capability
166089
+ });
165866
166090
  const userTurn = await appendUserPromptHistory({
165867
166091
  sessionDoc,
165868
166092
  prompt: prompt2,
@@ -166741,7 +166965,7 @@ ${entry.text}`).join("\n\n");
166741
166965
  reason: `session.archive:${sessionId}:resolve`
166742
166966
  });
166743
166967
  await withWorkspaceManager(auth, workspace, async (manager) => {
166744
- const childSessionIds = await archiveSessionWithSyncedMetadata(manager, sessionId);
166968
+ const childSessionIds = await runSessionOperationWithSyncedMetadata(manager, sessionId, "archive");
166745
166969
  if (options.json) {
166746
166970
  printJson({
166747
166971
  ok: true,
@@ -166761,15 +166985,12 @@ ${entry.text}`).join("\n\n");
166761
166985
  if (!sessionId) {
166762
166986
  throw new Error("Missing session ID. Pass one explicitly or set LODY_SESSION_ID.");
166763
166987
  }
166764
- const workspace = await resolveWorkspaceForSessionOrThrow(auth, sessionId, options.workspace);
166988
+ const workspace = await resolveWorkspaceForSessionOrThrow(auth, sessionId, {
166989
+ workspace: options.workspace,
166990
+ reason: `session.restore:${sessionId}:resolve`
166991
+ });
166765
166992
  await withWorkspaceManager(auth, workspace, async (manager) => {
166766
- const session2 = await resolveSessionMetaOrThrow(manager, sessionId);
166767
- if (session2.isArchived !== true) {
166768
- throw new Error(`Session ${sessionId} is not archived.`);
166769
- }
166770
- const childSessionIds = await listChildSessionIds(manager, sessionId);
166771
- await applySessionAndChildren(sessionId, childSessionIds, (id2) => manager.repo.upsertDocMeta(getSessionRoomId(id2), buildSessionRestoreMetaPatch()));
166772
- await ensureWorkspaceMetaSynced(manager, `session.restore:${sessionId}`);
166993
+ const childSessionIds = await runSessionOperationWithSyncedMetadata(manager, sessionId, "restore");
166773
166994
  if (options.json) {
166774
166995
  printJson({
166775
166996
  ok: true,
@@ -166789,18 +167010,12 @@ ${entry.text}`).join("\n\n");
166789
167010
  if (!sessionId) {
166790
167011
  throw new Error("Missing session ID. Pass one explicitly or set LODY_SESSION_ID.");
166791
167012
  }
166792
- const workspace = await resolveWorkspaceForSessionOrThrow(auth, sessionId, options.workspace);
167013
+ const workspace = await resolveWorkspaceForSessionOrThrow(auth, sessionId, {
167014
+ workspace: options.workspace,
167015
+ reason: `session.delete:${sessionId}:resolve`
167016
+ });
166793
167017
  await withWorkspaceManager(auth, workspace, async (manager) => {
166794
- const session2 = await resolveSessionMetaOrThrow(manager, sessionId);
166795
- if (session2.isArchived !== true) {
166796
- throw new Error(`Session ${sessionId} is not archived. Archive it before deleting.`);
166797
- }
166798
- const childSessionIds = await listChildSessionIds(manager, sessionId);
166799
- await applySessionAndChildren(sessionId, childSessionIds, async (id2) => {
166800
- await manager.repo.deleteDoc(getSessionRoomId(id2));
166801
- await manager.cleanSessionDoc(id2);
166802
- });
166803
- await ensureWorkspaceMetaSynced(manager, `session.delete:${sessionId}`);
167018
+ const childSessionIds = await runSessionOperationWithSyncedMetadata(manager, sessionId, "delete");
166804
167019
  if (options.json) {
166805
167020
  printJson({
166806
167021
  ok: true,
@@ -166821,7 +167036,6 @@ ${entry.text}`).join("\n\n");
166821
167036
  MAX_MCP_SESSION_HISTORY_LIMIT: MAX_MCP_SESSION_HISTORY_LIMIT$1,
166822
167037
  MAX_MCP_SESSION_LIST_LIMIT: MAX_MCP_SESSION_LIST_LIMIT$1,
166823
167038
  applyAgentRunConfigSelection,
166824
- archiveSessionWithSyncedMetadata,
166825
167039
  assertSupportedParentDepth,
166826
167040
  buildSessionArchiveMetaPatch,
166827
167041
  buildSessionRestoreMetaPatch,
@@ -166836,8 +167050,6 @@ ${entry.text}`).join("\n\n");
166836
167050
  filterSessionMetas,
166837
167051
  hasNonPositionalPromptSource,
166838
167052
  isVisibleTranscriptTurn,
166839
- listArchiveDescendantSessionIds,
166840
- listChildSessionIds,
166841
167053
  normalizeCliValue,
166842
167054
  normalizeLocalProjectPathSelector,
166843
167055
  readLocalProjectGitStateOnMachine,
@@ -166848,6 +167060,7 @@ ${entry.text}`).join("\n\n");
166848
167060
  resolveChatArgs,
166849
167061
  resolveCreateAgentSelector,
166850
167062
  resolveCreateCurrentSessionId,
167063
+ resolveEffectiveSessionChatDispatchConfig,
166851
167064
  resolveLocalProjectBranchForCreate,
166852
167065
  resolveLocalProjectCreateGitContext,
166853
167066
  resolveLocalProjectRefOrThrow,
@@ -166859,7 +167072,9 @@ ${entry.text}`).join("\n\n");
166859
167072
  resolveSessionRequester,
166860
167073
  resolveTurnDispatchConfig,
166861
167074
  resolveTurnDispatchConfigFromInputConfig,
167075
+ resolveTurnDispatchDefaultsFromHistory,
166862
167076
  rollbackPendingSessionCreate,
167077
+ runSessionOperationWithSyncedMetadata,
166863
167078
  selectDefaultAgentConfigForCreate,
166864
167079
  selectLocalProjectsBySelector,
166865
167080
  selectSessionTranscriptEntries,
@@ -166938,11 +167153,11 @@ ${entry.text}`).join("\n\n");
166938
167153
  return null;
166939
167154
  }
166940
167155
  try {
166941
- const stat2 = await Xt.stat(absolutePath);
167156
+ const stat2 = await Qt.stat(absolutePath);
166942
167157
  if (!stat2.isFile() || stat2.size > (options?.maxBytes ?? defaultMaxTextFileBytes)) {
166943
167158
  return null;
166944
167159
  }
166945
- const content = await Xt.readFile(absolutePath);
167160
+ const content = await Qt.readFile(absolutePath);
166946
167161
  if (content.includes(0)) {
166947
167162
  return null;
166948
167163
  }
@@ -199323,18 +199538,18 @@ Shutting down gracefully${reason}...`);
199323
199538
  requestedAtMs: options.nowMs ?? Date.now()
199324
199539
  };
199325
199540
  const temporaryPath = `${filePath}.${process.pid}.tmp`;
199326
- await Xt__default.mkdir(path__default.dirname(filePath), {
199541
+ await Qt__default.mkdir(path__default.dirname(filePath), {
199327
199542
  recursive: true,
199328
199543
  mode: 448
199329
199544
  });
199330
- await Xt__default.writeFile(temporaryPath, `${JSON.stringify(request2, null, 2)}
199545
+ await Qt__default.writeFile(temporaryPath, `${JSON.stringify(request2, null, 2)}
199331
199546
  `, {
199332
199547
  mode: 384
199333
199548
  });
199334
199549
  try {
199335
- await Xt__default.rename(temporaryPath, filePath);
199550
+ await Qt__default.rename(temporaryPath, filePath);
199336
199551
  } catch (error2) {
199337
- await Xt__default.rm(temporaryPath, {
199552
+ await Qt__default.rm(temporaryPath, {
199338
199553
  force: true
199339
199554
  });
199340
199555
  throw error2;
@@ -199343,7 +199558,7 @@ Shutting down gracefully${reason}...`);
199343
199558
  }
199344
199559
  async function clearDesktopLocalResetRequest(target = {}) {
199345
199560
  try {
199346
- await Xt__default.unlink(resolveRequestPath(target));
199561
+ await Qt__default.unlink(resolveRequestPath(target));
199347
199562
  return true;
199348
199563
  } catch (error2) {
199349
199564
  if (error2.code === "ENOENT") return false;
@@ -202423,7 +202638,7 @@ Shutting down gracefully${reason}...`);
202423
202638
  function requireLib$1() {
202424
202639
  if (hasRequiredLib$1) return lib$1;
202425
202640
  hasRequiredLib$1 = 1;
202426
- const Stream = xo;
202641
+ const Stream = _o;
202427
202642
  class MuteStream2 extends Stream {
202428
202643
  #isTTY = null;
202429
202644
  constructor(opts = {}) {
@@ -211901,7 +212116,7 @@ ${page}${helpTipBottom}${choiceDescription}${error2}${ansiEscapes.cursorHide}`;
211901
212116
  function requireStreams() {
211902
212117
  if (hasRequiredStreams) return streams;
211903
212118
  hasRequiredStreams = 1;
211904
- var Buffer2 = require$$0$6.Buffer, Transform2 = xo.Transform;
212119
+ var Buffer2 = require$$0$6.Buffer, Transform2 = _o.Transform;
211905
212120
  streams = function(iconv2) {
211906
212121
  iconv2.encodeStream = function encodeStream(encoding2, options) {
211907
212122
  return new IconvLiteEncoderStream(iconv2.getEncoder(encoding2, options), options);
@@ -212121,7 +212336,7 @@ ${page}${helpTipBottom}${choiceDescription}${error2}${ansiEscapes.cursorHide}`;
212121
212336
  return length2;
212122
212337
  };
212123
212338
  if (iconv2.supportsStreams) {
212124
- var Readable2 = xo.Readable;
212339
+ var Readable2 = _o.Readable;
212125
212340
  original.ReadableSetEncoding = Readable2.prototype.setEncoding;
212126
212341
  Readable2.prototype.setEncoding = function setEncoding(enc, options) {
212127
212342
  this._readableState.decoder = iconv2.getDecoder(enc, options);
@@ -212142,7 +212357,7 @@ ${page}${helpTipBottom}${choiceDescription}${error2}${ansiEscapes.cursorHide}`;
212142
212357
  Buffer2.prototype.toString = original.BufferToString;
212143
212358
  Buffer2.prototype.write = original.BufferWrite;
212144
212359
  if (iconv2.supportsStreams) {
212145
- var Readable2 = xo.Readable;
212360
+ var Readable2 = _o.Readable;
212146
212361
  Readable2.prototype.setEncoding = original.ReadableSetEncoding;
212147
212362
  delete Readable2.prototype.collect;
212148
212363
  }
@@ -226820,7 +227035,7 @@ ${page}${helpTipBottom}${choiceDescription}${ansiEscapes.cursorHide}`;
226820
227035
  data = createReviewBundleSnapshot(bundle);
226821
227036
  }
226822
227037
  const { injectReviewSnapshot } = await import("./chunks/index-VoI6Ds2-.js");
226823
- const { resolveReviewViewerTemplate } = await import("./chunks/review-viewer-BXpPp9r0.js").then(async (m) => {
227038
+ const { resolveReviewViewerTemplate } = await import("./chunks/review-viewer-C0rjN6ZQ.js").then(async (m) => {
226824
227039
  await m.__tla;
226825
227040
  return m;
226826
227041
  });
@@ -240229,7 +240444,7 @@ ${result.stdout ?? ""}`;
240229
240444
  };
240230
240445
  const MAX_EXPRESSION = 200;
240231
240446
  function requiredOptions(o) {
240232
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
240447
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o2, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
240233
240448
  const s = o.strict;
240234
240449
  const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
240235
240450
  const optimize2 = _optz === true || _optz === void 0 ? 1 : _optz || 0;
@@ -240240,7 +240455,7 @@ ${result.stdout ?? ""}`;
240240
240455
  strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
240241
240456
  strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
240242
240457
  strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
240243
- strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
240458
+ strictRequired: (_p = (_o2 = o.strictRequired) !== null && _o2 !== void 0 ? _o2 : s) !== null && _p !== void 0 ? _p : false,
240244
240459
  code: o.code ? {
240245
240460
  ...o.code,
240246
240461
  optimize: optimize2,