lody 0.114.1 → 0.115.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.
Files changed (86) hide show
  1. package/README.md +2 -0
  2. package/dist/{session-access-DBWXcozo.js → access-Sut1_1-c.js} +263 -130
  3. package/dist/{acp-http-proxy-CEqdfPIb.js → acp-http-proxy-BeNRWwOZ.js} +2 -2
  4. package/dist/{acp-interaction-owner-C9DnwDek.js → acp-interaction-owner-uSfNzpiU.js} +14 -13
  5. package/dist/{agent-execution-KNblr7op.js → agent-execution-D1-dEIN6.js} +5 -5
  6. package/dist/{analytics-events-DgubpwYf.js → analytics-events-BQIrmfJp.js} +2 -2
  7. package/dist/{app-DO6nxrTQ.js → app-J2sTmsZo.js} +15 -14
  8. package/dist/{auth-BzBqWcHJ.js → auth-CTegS0TL.js} +2 -2
  9. package/dist/{automation-CaVyvwqU.js → automation-BL7x_nUm.js} +15 -14
  10. package/dist/chunks/{vendor-loro-repo-KiPOxZ47.js → vendor-loro-repo-B1zdQ8Qd.js} +3 -2
  11. package/dist/chunks/{vendor-undici-D9lUGEXQ.js → vendor-undici-Cm00wA7x.js} +3 -2
  12. package/dist/chunks/{vendor-undici-Dkj-EYtJ.js → vendor-undici-aSjjVk9-.js} +4 -3
  13. package/dist/claude-acp.js +3 -2
  14. package/dist/{cli-presence-application-BPo9zPWo.js → cli-presence-application-D2Dn0fPM.js} +7 -6
  15. package/dist/{client-CG7iYu4O.js → client-BsIzN-iC.js} +14 -13
  16. package/dist/codex-acp.js +3 -2
  17. package/dist/{command-runtime-CU9xs2mb.js → command-runtime-C7EPuHLe.js} +283 -153
  18. package/dist/{control-IZGSPxqh.js → control-CgRxpxvc.js} +18 -17
  19. package/dist/{fs-atomic-sI-5rfuh.js → cross-workspace-D6-aE1-w.js} +67 -7
  20. package/dist/{daemon-ChBsVK29.js → daemon-DWm2IzH9.js} +11 -10
  21. package/dist/{daemon-runner-Czhapxd-.js → daemon-runner-Bn8O9-a0.js} +9 -8
  22. package/dist/{daemon-session-tools-BkNAXJte.js → daemon-session-tools-BSAgq4O1.js} +25 -24
  23. package/dist/{daemon-shared-lCH0JHQD.js → daemon-shared-NcwWGSEj.js} +2 -2
  24. package/dist/{device-preview-rocdCptj.js → device-preview-BjqAbZ9g.js} +50 -25
  25. package/dist/devin-acp.js +3 -2
  26. package/dist/{discovery-query-hcHHutEn.js → discovery-query-C_7lyBI8.js} +2 -2
  27. package/dist/{dsh-BBMJN1_w.js → dsh-DVyIAYZ9.js} +5 -5
  28. package/dist/{dsh-plugins-DyDJ4nyX.js → dsh-plugins-Dfsqsiu7.js} +5 -4
  29. package/dist/{e2ee-Rp-kqqRV.js → e2ee-CslOKVIM.js} +2 -2
  30. package/dist/{e2ee-execution-intent-kcGw6188.js → e2ee-execution-intent-DYBEG410.js} +4 -4
  31. package/dist/{export-CW3tgEh5.js → export-C-zeWP1i.js} +19 -18
  32. package/dist/{feedback-DXHiE_SV.js → feedback-Dde39k5W.js} +15 -14
  33. package/dist/{feedback-wAp0AIne.js → feedback-jvl2Dz8w.js} +2 -2
  34. package/dist/{github-Ds3oR20B.js → github-BtMkInqL.js} +14 -13
  35. package/dist/grok-acp.js +3 -2
  36. package/dist/{http-transport-DDAJ_zUL.js → http-transport-C1f1XEnB.js} +3 -3
  37. package/dist/{index-BR78_63y.js → index-BTgKuz44.js} +7 -7
  38. package/dist/{index-cUL6BMen.js → index-BUam8GIX.js} +15 -14
  39. package/dist/{index-Z-zMjsvr.js → index-BsfKnSuo.js} +629 -731
  40. package/dist/{index-vrW0djgm.js → index-Ce9khNjj.js} +29 -28
  41. package/dist/{index-DNfm72S8.js → index-Dy-FYtdl.js} +20 -19
  42. package/dist/index.js +7 -6
  43. package/dist/{internal-BlRJVTRc.js → internal-BPOwohVc.js} +25 -24
  44. package/dist/{local-ipc-BQZPuSjl.js → local-ipc-B8vySppK.js} +12 -3
  45. package/dist/{local-project-control-client-vC7RtUIF.js → local-project-control-client-CIBpaXbo.js} +3 -3
  46. package/dist/{lody-mcp-http-protocol-d_6zEbk9.js → lody-mcp-http-protocol-DBLKn7SZ.js} +4 -4
  47. package/dist/{lody-mcp-server-DOkbYw6c.js → lody-mcp-server-B4OeNPT4.js} +22 -19
  48. package/dist/{login-Nwpcfzb7.js → login-Df1IkdeV.js} +7 -6
  49. package/dist/{login-shell-env-DiOZ-bog.js → login-shell-env-HKDW5zwx.js} +2 -2
  50. package/dist/{logout-C13Nc5pT.js → logout-gDuSiB0l.js} +7 -6
  51. package/dist/{machine-DJ0Pn0js.js → machine-bjdZ1hmy.js} +23 -22
  52. package/dist/{machine-protocol-capabilities-LN7bzFSN.js → machine-protocol-capabilities-DEhAj9SH.js} +80 -77
  53. package/dist/{mcp-z0JBqqIQ.js → mcp-DTnh_PAT.js} +20 -19
  54. package/dist/{migrate-DxEEhXQ9.js → migrate-CUdZ3XBR.js} +231 -73
  55. package/dist/{operation-CuFKC3x2.js → operation-CzLcjV3W.js} +16 -15
  56. package/dist/{operation-store-D1TdJgBc.js → operation-store-rllAX2mr.js} +3 -3
  57. package/dist/{presence-BGW-7JQJ.js → presence-CZco7UQH.js} +4 -4
  58. package/dist/{presence-legacy-BI0h0kBA.js → presence-legacy-DIYBtj5j.js} +3 -3
  59. package/dist/{project-BPuPcKZT.js → project-C_EZ2dLN.js} +21 -20
  60. package/dist/{register-hqq68K_S.js → register-VLBUVPh5.js} +26 -26
  61. package/dist/{remote-pairing-BixLRGZN.js → remote-pairing-D24xSpRh.js} +19 -18
  62. package/dist/{reset-identity-Arhv456z.js → reset-identity-DVubJrt0.js} +19 -18
  63. package/dist/{review-DDMytOEX.js → review-6aCgWEdv.js} +2 -2
  64. package/dist/{review-viewer-CkjhHGL8.js → review-viewer-CRYK94SE.js} +3 -3
  65. package/dist/{schedule-C2ooWjeY.js → schedule-CGTbG70S.js} +20 -19
  66. package/dist/{schedule-command-client-Dp2K-GDf.js → schedule-command-client-C6matZWn.js} +19 -18
  67. package/dist/{schedule-command-service-D7OwaAhZ.js → schedule-command-service-2gToipBI.js} +20 -19
  68. package/dist/{schedule-documents-7GqM7IcI.js → schedule-documents-DRc0byQm.js} +3 -3
  69. package/dist/{schedule-recurrence-CGZIb0Pu.js → schedule-recurrence-BVxMRfp4.js} +3 -3
  70. package/dist/{schedule-repository-D8Ui2jvb.js → schedule-repository-dz9iwR0x.js} +3 -3
  71. package/dist/{schedule-run-preparation-BEKS3RjW.js → schedule-run-preparation-1oSQ5i-A.js} +5 -5
  72. package/dist/{schedule-types-DTul4K9c.js → schedule-types-BquxGfza.js} +537 -391
  73. package/dist/{service-CTj21Cv2.js → service-D9xJKmI-.js} +4 -58
  74. package/dist/{session-file-blob-store-bjZk_Pby.js → session-file-blob-store-CBHDgf4e.js} +2 -2
  75. package/dist/{session-image-download-Bz47jmHy.js → session-image-download-DUwc2Fb4.js} +3 -3
  76. package/dist/{session-input-Bm4DZ_ah.js → session-input-MeZheBJ0.js} +2 -2
  77. package/dist/{session-link-CZ1z8J8d.js → session-link-demCF_Y_.js} +2 -2
  78. package/dist/{session-link-export-CF0aLI3O.js → session-link-export-BM1zZQRs.js} +3 -3
  79. package/dist/{session-p5D9mnGA.js → session-npaRR-y3.js} +170 -39
  80. package/dist/{session-operation-targets-yk7bQTAn.js → session-operation-targets-lq3rsTnV.js} +3 -3
  81. package/dist/{setting-CO0xphaD.js → setting-Cq6nKJgF.js} +8 -6
  82. package/dist/{start-DjcjoPvR.js → start-BolVcMOA.js} +391 -142
  83. package/dist/{sync-CUa0QP_M.js → sync-BrDYKZ4H.js} +15 -14
  84. package/dist/{workspace-DA-wPD10.js → workspace-Bthb-nhu.js} +17 -16
  85. package/dist/{workspace-legacy-UCwDS1Zb.js → workspace-legacy-jZ0D5Xl-.js} +184 -66
  86. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
1
  import path__default from "node:path";
2
2
  import { m as mapWithConcurrency } from "./bounded-concurrency-JZXr8Xjv.js";
3
- import { c as createSessionMirror, a as atomicJson } from "./fs-atomic-sI-5rfuh.js";
3
+ import { c as createSessionMirror, m as mapRoomId, d as crossWorkspaceRowWithheld, e as mapMetaKey, b as atomicJson, a as scheduleImportFence, s as sessionImportFence } from "./cross-workspace-D6-aE1-w.js";
4
4
  import fs__default from "node:fs/promises";
5
- import { g as getSessionFileBlobPath } from "./session-file-blob-store-bjZk_Pby.js";
5
+ import { g as getSessionFileBlobPath } from "./session-file-blob-store-CBHDgf4e.js";
6
6
  import { createHash, randomUUID } from "node:crypto";
7
7
  import { o as object, h as unknown, e as array, a as literal, c as string, f as _enum, n as number } from "./chunks/vendor-zod-DAcQjQuC.js";
8
8
  import { y as yauzlExports } from "./chunks/vendor-yauzl-9hnFHTV6.js";
9
9
  import { crc32 } from "node:zlib";
10
10
  import { f as formatErrorMessage } from "./logger-C-G7jpWR.js";
11
11
  import { F as Flock } from "./chunks/vendor-@loro-dev-flock-wasm-BH1ts_Xn.js";
12
- import { g as LoroMap, L as LoroDoc } from "./chunks/vendor-loro-crdt-2CFvB1HS.js";
12
+ import { L as LoroDoc } from "./chunks/vendor-loro-crdt-2CFvB1HS.js";
13
13
  const BUNDLE_FORMAT = "lody-workspace-bundle";
14
14
  const BUNDLE_VERSION = 1;
15
15
  const MANIFEST_PATH = "manifest.json";
@@ -698,60 +698,6 @@ function authorizeFlockChanges(codec, before, after, context) {
698
698
  }
699
699
  return null;
700
700
  }
701
- function mapRoomId(roomId, sourceWorkspaceId, targetWorkspaceId) {
702
- const prefix = `${sourceWorkspaceId}:`;
703
- return roomId.startsWith(prefix) ? `${targetWorkspaceId}:${roomId.slice(prefix.length)}` : roomId;
704
- }
705
- function mapMetaKey(key, sourceWorkspaceId, targetWorkspaceId) {
706
- if ((key[0] === "ef" || key[0] === "efx") && typeof key[1] === "string")
707
- return [key[0], mapRoomId(key[1], sourceWorkspaceId, targetWorkspaceId), ...key.slice(2)];
708
- return [...key];
709
- }
710
- function crossWorkspaceRowWithheld(codec, key) {
711
- return codec === "schedule-registry/v1" && key[0] !== "schedule" && key[0] !== "tombstone";
712
- }
713
- function sessionImportFence(doc, sourceMeta, workspaceId, importedBy) {
714
- const turnIds = /* @__PURE__ */ new Set();
715
- const queueItemIds = /* @__PURE__ */ new Set();
716
- const mirror = createSessionMirror({ doc, initialState: {} });
717
- try {
718
- for (const turn of mirror.historyWriter.readStored())
719
- if (turn.role === "user") turnIds.add(turn.id);
720
- } finally {
721
- mirror.dispose();
722
- }
723
- const queue = doc.getMovableList("mq");
724
- for (let index = 0; index < queue.length; index += 1) {
725
- const item = queue.get(index);
726
- if (!(item instanceof LoroMap)) continue;
727
- queueItemIds.add(item.id);
728
- const userTurnId = item.get("userTurnId");
729
- if (typeof userTurnId === "string" && userTurnId) turnIds.add(userTurnId);
730
- }
731
- for (const field2 of ["latestUserMsgId", "processingUserMsgId"]) {
732
- const id = sourceMeta(field2);
733
- if (typeof id === "string" && id) turnIds.add(id);
734
- }
735
- for (const field2 of ["steerTurnStatuses", "queuePromotionLedger"]) {
736
- const value = sourceMeta(field2);
737
- if (!value || typeof value !== "object") continue;
738
- for (const [id, record] of Object.entries(value)) {
739
- turnIds.add(id);
740
- const userTurnId = record?.userTurnId;
741
- if (typeof userTurnId === "string") turnIds.add(userTurnId);
742
- }
743
- }
744
- return {
745
- workspaceId,
746
- turnIds: [...turnIds],
747
- queueItemIds: [...queueItemIds],
748
- ...importedBy ? { importedBy } : {}
749
- };
750
- }
751
- function scheduleImportFence(doc, workspaceId) {
752
- const activationId = doc.getMap("definition").get("activationId");
753
- return typeof activationId === "string" ? { workspaceId, activationId } : void 0;
754
- }
755
701
  async function withDoc(repo, docId, edit) {
756
702
  const lease = await repo.acquireDoc(docId);
757
703
  try {
@@ -1259,4 +1205,4 @@ export {
1259
1205
  runWorkspaceImport as a,
1260
1206
  runWorkspaceExport as r
1261
1207
  };
1262
- //# sourceMappingURL=service-CTj21Cv2.js.map
1208
+ //# sourceMappingURL=service-D9xJKmI-.js.map
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { l as SessionImagePayloadSchema, m as EncryptedAttachmentSchema } from "./schedule-types-DTul4K9c.js";
2
+ import { l as SessionImagePayloadSchema, m as EncryptedAttachmentSchema } from "./schedule-types-BquxGfza.js";
3
3
  import os__default from "os";
4
4
  import fs__default from "fs";
5
5
  import path__default from "path";
@@ -466,4 +466,4 @@ export {
466
466
  storeLocalSessionImage as s,
467
467
  writeSessionFileBlobBackfillMarker as w
468
468
  };
469
- //# sourceMappingURL=session-file-blob-store-bjZk_Pby.js.map
469
+ //# sourceMappingURL=session-file-blob-store-CBHDgf4e.js.map
@@ -1,6 +1,6 @@
1
1
  import { f as formatErrorMessage } from "./logger-C-G7jpWR.js";
2
- import { n as assertEncryptedAttachmentReference, r as readEncryptedAttachment, o as encryptedAttachmentPath } from "./schedule-types-DTul4K9c.js";
3
- import { b as buildSessionImageApiUrl, c as getSessionImageDownloadApiPath, d as getSessionFileDownloadApiPath } from "./session-access-DBWXcozo.js";
2
+ import { n as assertEncryptedAttachmentReference, r as readEncryptedAttachment, o as encryptedAttachmentPath } from "./schedule-types-BquxGfza.js";
3
+ import { b as buildSessionImageApiUrl, c as getSessionImageDownloadApiPath, d as getSessionFileDownloadApiPath } from "./access-Sut1_1-c.js";
4
4
  const SESSION_IMAGE_DOWNLOAD_RETRY_DELAYS_MS = [250, 750, 1500];
5
5
  const SESSION_IMAGE_DOWNLOAD_MAX_RETRY_AFTER_MS = 3e3;
6
6
  const RETRYABLE_SESSION_IMAGE_DOWNLOAD_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
@@ -176,4 +176,4 @@ export {
176
176
  downloadSessionImageForPrompt as a,
177
177
  downloadEncryptedSessionImageBytes as d
178
178
  };
179
- //# sourceMappingURL=session-image-download-Bz47jmHy.js.map
179
+ //# sourceMappingURL=session-image-download-DUwc2Fb4.js.map
@@ -1,5 +1,5 @@
1
1
  import { i as isSessionFileSourcePath } from "./magpie-import-IrqfCF6i.js";
2
- import { A as AgentConfigCliTypeSchema, p as SessionInputBlocksSchema, s as sanitizeMessageTextSpans, q as normalizeSessionTurnInputConfig, t as reanchorMessageTextSpansForTrim } from "./schedule-types-DTul4K9c.js";
2
+ import { A as AgentConfigCliTypeSchema, p as SessionInputBlocksSchema, s as sanitizeMessageTextSpans, q as normalizeSessionTurnInputConfig, t as reanchorMessageTextSpansForTrim } from "./schedule-types-BquxGfza.js";
3
3
  const collectSessionConversationSources = (history, messageQueue = []) => {
4
4
  const sources = [];
5
5
  for (let index = messageQueue.length - 1; index >= 0; index -= 1) {
@@ -462,4 +462,4 @@ export {
462
462
  queuedInputEvidence as q,
463
463
  resolveSessionConversationConfig as r
464
464
  };
465
- //# sourceMappingURL=session-input-Bm4DZ_ah.js.map
465
+ //# sourceMappingURL=session-input-MeZheBJ0.js.map
@@ -1,4 +1,4 @@
1
- import { S as SESSION_LINK_SCHEMES, L as LODY_PROTOCOLS } from "./presence-BGW-7JQJ.js";
1
+ import { S as SESSION_LINK_SCHEMES, L as LODY_PROTOCOLS } from "./presence-CZco7UQH.js";
2
2
  const ID = /^[A-Za-z0-9_-]+$/u;
3
3
  const SCHEMES = new Set(SESSION_LINK_SCHEMES.map((scheme) => `${scheme}:`));
4
4
  function buildSessionLink(target) {
@@ -55,4 +55,4 @@ export {
55
55
  parseSessionLink as p,
56
56
  resolveSessionLinkId as r
57
57
  };
58
- //# sourceMappingURL=session-link-CZ1z8J8d.js.map
58
+ //# sourceMappingURL=session-link-demCF_Y_.js.map
@@ -1,6 +1,6 @@
1
- import { p as parseSessionLink, b as buildSessionLink } from "./session-link-CZ1z8J8d.js";
1
+ import { p as parseSessionLink, b as buildSessionLink } from "./session-link-demCF_Y_.js";
2
2
  import { f as fromMarkdown } from "./chunks/vendor-mdast-util-from-markdown-DQq6W3Ku.js";
3
- import { S as SESSION_LINK_SCHEMES } from "./presence-BGW-7JQJ.js";
3
+ import { S as SESSION_LINK_SCHEMES } from "./presence-CZco7UQH.js";
4
4
  const schemePattern = [...SESSION_LINK_SCHEMES, "session"].map((scheme) => scheme.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")).join("|");
5
5
  const sessionScheme = new RegExp(`(?:${schemePattern}):\\/\\/`, "u");
6
6
  const sessionUri = new RegExp(
@@ -44,4 +44,4 @@ function normalizeSessionLinksForExport(markdown, workspaceId) {
44
44
  export {
45
45
  normalizeSessionLinksForExport as n
46
46
  };
47
- //# sourceMappingURL=session-link-export-CF0aLI3O.js.map
47
+ //# sourceMappingURL=session-link-export-BM1zZQRs.js.map
@@ -1,31 +1,31 @@
1
1
  import { f as formatErrorMessage, e as formatErrorWithCauses, r as rootLogger, h as routeLoggerToStderr, g as getLogger } from "./logger-C-G7jpWR.js";
2
- import { cj as FlockSyncTimeoutError, ck as FlockSyncUnavailableError, cd as SessionAttachmentTransfer, cl as resolveContainedUploadPath, af as normalizeCliValue, cm as WorkspaceSyncUnavailableError, bZ as createSessionBackend, U as readSessionHistoryMetadata, cn as readHistoryEntry, a6 as runOneShotCommand, ai as makeLocalWorkspaceCatalog, a9 as getAuthContextOrThrow$1, ab as resolveWorkspaceOrThrow, aj as classifyLocalDaemonIpcError, a7 as printJson, bV as getDaemonWorkspace, cg as syncWorkspaceMetaForRead, ag as listWorkspaceGitHubRepositoriesForCliToken, co as readMachineLocalProjects, cp as withMachineRpcClient, bX as listMergedAgentConfigs, bW as getSessionCommandEnvironment, ae as listAliveDocMetas, ac as withWorkspaceManager$1, a8 as resolveStructuredOutputMode$1, cq as dispatchLocalControl, cr as upsertMachineAgentConfig, bY as ensureWorkspaceMetaSynced, cs as deleteMachineAgentConfig, ct as syncCommandTime, cu as resolveDaemonTarget, cv as createCommandAttachmentTransfer, cw as readEncryptedMachineAccess, ci as syncDocForRead, ad as listAliveRoomIds, c3 as localProjectsLegacy, cx as LocalDaemonAvailabilityError, cy as selectLocalProjectBranchSelector, cz as canUseMachineForCliToken, cA as canRequestMachineForCliToken, cB as canDelegateMachineUseForCliToken, ca as selectWorkspaceSummary, aa as listWorkspacesForToken, cf as listWorkspaceCandidates, ch as listAliveSessionMetas, $ as selectTranscriptHistoryPositions } from "./command-runtime-CU9xs2mb.js";
3
- import { s as listWorkspaceAgentRoles, t as readWorkspaceFlockRowsFromFlock, q as getWorkspaceFlockDocId, u as listWorkspaceMcpServers, v as getProjectMcpDefaults, w as deleteWorkspaceMcpServerFromFlock, x as writeWorkspaceMcpServerToFlock, e as isLoroRepoDocDeleted, f as readMachineFlockRowsFromFlock, y as getMachineFlockProviderSetupCancellations, z as getMachineFlockAgentConfigs, B as getMachineFlockProviderSetups, C as writeMachineFlockRowToFlock, D as machineFlockKeys, F as writeAgentConfigToFlock, p as parseRateLimitEntryKey, g as getMachineFlockDocId, j as getMachineFlockRateLimits, h as getMachineFlockAcpCapabilities, G as hasPendingUserTurnActivation, I as SessionStatusFactory, J as resolveActiveAssistantTurnId, K as resolveProjectGitHubRepo, L as deriveDraftSessionTitle, M as isBillingQuotaExempt, N as evaluateBillingQuota, O as countBillableSessionTurns, A as ACP_CAPABILITY_ROW_FAMILIES, P as evaluateSessionCreateQuota, Q as resolveBaseBranchPreference, R as NEW_SESSION_HISTORY_BACKEND, T as formatSessionQuotaRejection, U as FREE_SESSION_TURN_LIMIT } from "./session-access-DBWXcozo.js";
4
- import { Z as snapshotAgentRole, aF as isMultiTargetAgentRole, aG as getAgentRoleTargets, aH as bindAgentRoleTarget, aI as getProjectMcpKey, aJ as getEffectiveDefaultMcpIds, q as normalizeSessionTurnInputConfig, aK as AgentRoleProposalCommandSchema, aL as canReadAgentRole, aM as findAgentRoleRunConfigIssue, aN as normalizeAgentRoleRunConfig, aO as summarizeAgentRunConfigCapabilities, aP as MachineAcpCapabilitiesRefreshResponseSchema, aQ as readChatFailureNotice, aR as withAcpConfigOptionsForModel, aS as normalizeMcpServerIdSelection, aT as hasAgentRunConfigSelection, aU as getAcpModelEffortChoices, aV as getAcpModelSpeedTiers, aW as getAcpModelFastSupport, aX as isAcpFastModeConfigId, aY as ACP_CONFIG_OPTION_OFF_VALUE, aZ as ACP_CONFIG_OPTION_ON_VALUE, am as SessionCancelResponseSchema, a_ as resolveAgentRunConfigSelection, a$ as getDeclaredModelControls, b0 as ACP_FAST_MODE_VALUE_ULTRAFAST, b1 as ACP_FAST_MODE_VALUE_FAST, b2 as isAcpThoughtLevelConfigOption, ai as MachineStatusResponseSchema } from "./schedule-types-DTul4K9c.js";
5
- import { R as RepoTransportError, a as RepoSyncError } from "./chunks/vendor-loro-repo-KiPOxZ47.js";
2
+ import { cm as FlockSyncTimeoutError, cn as FlockSyncUnavailableError, cg as SessionAttachmentTransfer, co as resolveContainedUploadPath, af as normalizeCliValue, cp as WorkspaceSyncUnavailableError, bZ as createSessionBackend, U as readSessionHistoryMetadata, cq as readHistoryEntry, a6 as runOneShotCommand, ai as makeLocalWorkspaceCatalog, a9 as getAuthContextOrThrow$1, ab as resolveWorkspaceOrThrow, aj as classifyLocalDaemonIpcError, a7 as printJson, bV as getDaemonWorkspace, cj as syncWorkspaceMetaForRead, ag as listWorkspaceGitHubRepositoriesForCliToken, cr as readMachineLocalProjects, cs as withMachineRpcClient, bX as listMergedAgentConfigs, bW as getSessionCommandEnvironment, ae as listAliveDocMetas, ac as withWorkspaceManager$1, a8 as resolveStructuredOutputMode$1, ct as dispatchLocalControl, cu as upsertMachineAgentConfig, bY as ensureWorkspaceMetaSynced, cv as deleteMachineAgentConfig, cw as syncCommandTime, cx as resolveDaemonTarget, cy as createCommandAttachmentTransfer, cz as readEncryptedMachineAccess, cl as syncDocForRead, ad as listAliveRoomIds, c3 as localProjectsLegacy, cA as LocalDaemonAvailabilityError, cB as selectLocalProjectBranchSelector, cC as canUseMachineForCliToken, cD as canRequestMachineForCliToken, cE as canDelegateMachineUseForCliToken, ca as selectWorkspaceSummary, aa as listWorkspacesForToken, ci as listWorkspaceCandidates, ck as listAliveSessionMetas, $ as selectTranscriptHistoryPositions } from "./command-runtime-C7EPuHLe.js";
3
+ import { s as listWorkspaceAgentRoles, t as readWorkspaceFlockRowsFromFlock, q as getWorkspaceFlockDocId, u as listWorkspaceMcpServers, v as getProjectMcpDefaults, w as deleteWorkspaceMcpServerFromFlock, x as writeWorkspaceMcpServerToFlock, e as isLoroRepoDocDeleted, f as readMachineFlockRowsFromFlock, y as getMachineFlockProviderSetupCancellations, z as getMachineFlockAgentConfigs, B as getMachineFlockProviderSetups, C as writeMachineFlockRowToFlock, D as machineFlockKeys, F as writeAgentConfigToFlock, p as parseRateLimitEntryKey, g as getMachineFlockDocId, j as getMachineFlockRateLimits, h as getMachineFlockAcpCapabilities, G as hasPendingUserTurnActivation, I as SessionStatusFactory, J as resolveActiveAssistantTurnId, K as resolveProjectGitHubRepo, L as deriveDraftSessionTitle, M as isBillingQuotaExempt, N as evaluateBillingQuota, O as countBillableSessionTurns, P as evaluateSessionCreateQuota, Q as resolveBaseBranchPreference, R as NEW_SESSION_HISTORY_BACKEND, T as formatSessionQuotaRejection, A as ACP_CAPABILITY_ROW_FAMILIES, U as FREE_SESSION_TURN_LIMIT } from "./access-Sut1_1-c.js";
4
+ import { Z as snapshotAgentRole, aG as isMultiTargetAgentRole, aH as getAgentRoleTargets, aI as bindAgentRoleTarget, aJ as getProjectMcpKey, aK as getEffectiveDefaultMcpIds, q as normalizeSessionTurnInputConfig, aL as AgentRoleProposalCommandSchema, aM as canReadAgentRole, aN as findAgentRoleRunConfigIssue, aO as normalizeAgentRoleRunConfig, aP as summarizeAgentRunConfigCapabilities, aQ as MachineAcpCapabilitiesRefreshResponseSchema, aR as readChatFailureNotice, aS as withAcpConfigOptionsForModel, aT as normalizeMcpServerIdSelection, aU as hasAgentRunConfigSelection, aV as reconcileAgentRoleRunConfig, aW as getAcpModelEffortChoices, aX as getAcpModelSpeedTiers, aY as getAcpModelFastSupport, aZ as isAcpFastModeConfigId, a_ as ACP_CONFIG_OPTION_OFF_VALUE, a$ as isAcpNormalSpeedAlias, b0 as ACP_CONFIG_OPTION_ON_VALUE, an as SessionCancelResponseSchema, b1 as resolveAgentRunConfigSelection, b2 as getDeclaredModelControls, b3 as ACP_FAST_MODE_VALUE_ULTRAFAST, b4 as ACP_FAST_MODE_VALUE_FAST, b5 as isAcpThoughtLevelConfigOption, aj as MachineStatusResponseSchema } from "./schedule-types-BquxGfza.js";
5
+ import { R as RepoTransportError, a as RepoSyncError } from "./chunks/vendor-loro-repo-B1zdQ8Qd.js";
6
6
  import { av as TaggedError, cV as runPromise, cI as result, R as fnUntraced, B as tryPromise, d2 as timeout, cS as seconds, bx as catchTag, j as fail, b as flatMap, v as void_, d3 as tapError, d as sync, dq as min, dr as exponential, ds as spaced, dt as minutes, du as jittered, dv as while_, dw as retry, dx as runSync, a3 as make, a2 as gen, C as acquireRelease, aG as promise, s as succeed, a_ as provideService, bl as Scope, aa as close, ab as void_$1, cl as scoped } from "./chunks/vendor-effect-CNM-5PoN.js";
7
7
  import fs__default, { readFile } from "node:fs/promises";
8
8
  import { constants, promises } from "node:fs";
9
9
  import os__default from "node:os";
10
10
  import path__default from "node:path";
11
11
  import { randomUUID, createHash } from "node:crypto";
12
- import { c as copyIntoSessionFileBlobStore, r as removeSessionFileBlob } from "./session-file-blob-store-bjZk_Pby.js";
12
+ import { c as copyIntoSessionFileBlobStore, r as removeSessionFileBlob } from "./session-file-blob-store-CBHDgf4e.js";
13
13
  import { S as SESSION_FILE_MAX_COUNT, a as SESSION_FILE_MAX_SIZE_BYTES, b as SESSION_IMAGE_MAX_SIZE_BYTES, c as SESSION_IMAGE_ALLOWED_MIME_TYPES, p as parseMagpieImportLink, n as normalizeMagpieGateway, M as MAGPIE_TARGETS, m as magpieProviderSettings, s as supportsBuiltinProviderSetup, g as getReadableAcpCapabilityCacheEntryForRuntimeOverrides, d as getAcpCapabilityCacheKey, e as getBuiltinDefaultModeId, f as getReadableAcpCapabilityCacheEntry } from "./magpie-import-IrqfCF6i.js";
14
14
  import { g as getServerNow } from "./time-sync-D63wG9u-.js";
15
- import { R as ResourceListSchemas, m as matchesDiscoveryQuery, a as discoveryPage, b as buildCommandInputBlocks, c as SessionDiscoveryFilterShape, e as matchesSessionDiscovery } from "./discovery-query-hcHHutEn.js";
15
+ import { R as ResourceListSchemas, m as matchesDiscoveryQuery, a as discoveryPage, b as buildCommandInputBlocks, c as SessionDiscoveryFilterShape, e as matchesSessionDiscovery } from "./discovery-query-C_7lyBI8.js";
16
16
  import { isDeepStrictEqual } from "node:util";
17
- import { b as getSessionRoomId, i as isMachineDocRoomId, m as getMachineRoomId, D as isSessionDocRoomId, k as getSessionIdFromRoomId } from "./presence-BGW-7JQJ.js";
17
+ import { b as getSessionRoomId, i as isMachineDocRoomId, m as getMachineRoomId, D as isSessionDocRoomId, k as getSessionIdFromRoomId } from "./presence-CZco7UQH.js";
18
18
  import { C as Command, O as Option } from "./chunks/vendor-commander-BkZcYyor.js";
19
- import { A as AuthClient } from "./auth-BzBqWcHJ.js";
19
+ import { A as AuthClient } from "./auth-CTegS0TL.js";
20
20
  import { r as renderTerminalTable } from "./terminal-table-DSTeeT1J.js";
21
21
  import { g as getCliPlatformKind, f as fileLocksLegacy } from "./cli-platform-Cfc6A61f.js";
22
- import { a as machineSupportsProtocolCapability, M as MACHINE_PROTOCOL_CAPABILITIES, n as negotiatedAcpCapabilitiesRefreshForce, r as resolveNewSessionHistoryBackend, b as machineSupportsPreparedSessionInputProtocol, c as machineSupportsMemoryProviders, O as OPERATION_INBOX_PROTOCOL_VERSION } from "./machine-protocol-capabilities-LN7bzFSN.js";
23
- import { t as makeLocalControlClientAuto, v as SessionToolResultSchema } from "./local-ipc-BQZPuSjl.js";
24
- import { f as flushTelemetry } from "./login-shell-env-DiOZ-bog.js";
25
- import { d as captureSessionCommandEvent } from "./analytics-events-DgubpwYf.js";
26
- import { r as resolveSessionConversationConfig, i as inputBlocksToHistoryItems } from "./session-input-Bm4DZ_ah.js";
22
+ import { a as machineSupportsProtocolCapability, M as MACHINE_PROTOCOL_CAPABILITIES, n as negotiatedAcpCapabilitiesRefreshForce, r as resolveNewSessionHistoryBackend, b as machineSupportsPreparedSessionInputProtocol, c as machineSupportsMemoryProviders, O as OPERATION_INBOX_PROTOCOL_VERSION } from "./machine-protocol-capabilities-DEhAj9SH.js";
23
+ import { t as makeLocalControlClientAuto, v as SessionToolResultSchema } from "./local-ipc-B8vySppK.js";
24
+ import { f as flushTelemetry } from "./login-shell-env-HKDW5zwx.js";
25
+ import { d as captureSessionCommandEvent } from "./analytics-events-BQIrmfJp.js";
26
+ import { r as resolveSessionConversationConfig, i as inputBlocksToHistoryItems } from "./session-input-MeZheBJ0.js";
27
27
  import { v as v4 } from "./chunks/vendor-uuid-ZvTlSCzA.js";
28
- import { r as readSessionOperationTargets } from "./session-operation-targets-yk7bQTAn.js";
28
+ import { r as readSessionOperationTargets } from "./session-operation-targets-lq3rsTnV.js";
29
29
  import { o as object } from "./chunks/vendor-zod-DAcQjQuC.js";
30
30
  import { m as mapWithConcurrency } from "./bounded-concurrency-JZXr8Xjv.js";
31
31
  const MACHINE_CATALOG_RETRY_GUIDANCE = " If no active Operation handle was returned, wait at least 5 seconds between attempts, make at most 3 total attempts (the initial call plus 2 retries), and reuse the identical request and operationId when present. Then stop and report the catalog blocker; do not create a new operationId to retry. If an active Operation handle was returned, let the daemon recover it and await automatic completion.";
@@ -3362,6 +3362,33 @@ async function syncMachineFlockDocsForRead(manager, workspaceId, machineIds, rea
3362
3362
  const failures = results.filter((result2) => !result2.confirmed);
3363
3363
  return failures.length > 0 ? { confirmed: false, error: new AggregateError(failures.map((failure) => failure.error)) } : { confirmed: true };
3364
3364
  }
3365
+ async function confirmSameReplicaMachineFlockOnMiss(manager, workspaceId, machineId, currentFreshness, reason) {
3366
+ if (currentFreshness.confirmed) {
3367
+ return { retried: false, freshness: currentFreshness };
3368
+ }
3369
+ const daemonTarget = await resolveDaemonTarget({ manager, workspaceId, machineId });
3370
+ if (daemonTarget.isLocalEnvironment || !daemonTarget.sameReplica) {
3371
+ return { retried: false, freshness: currentFreshness };
3372
+ }
3373
+ try {
3374
+ await manager.syncFlockDocOrThrow(getMachineFlockDocId(workspaceId, machineId), {
3375
+ reason: `${reason}:${machineId}`,
3376
+ requireRemoteConfirmation: true
3377
+ });
3378
+ return { retried: true, freshness: { confirmed: true } };
3379
+ } catch (error) {
3380
+ getLogger("session").warn(
3381
+ `Machine Flock same-replica miss sync was not confirmed (${reason}:${machineId}): ${formatErrorMessage(error)}`
3382
+ );
3383
+ return {
3384
+ retried: false,
3385
+ freshness: {
3386
+ confirmed: false,
3387
+ error: getSyncRetryability(error) === false ? error : currentFreshness.error
3388
+ }
3389
+ };
3390
+ }
3391
+ }
3365
3392
  function isPathLikeLocalProjectSelector(selector) {
3366
3393
  return selector === "." || selector === ".." || selector.startsWith("./") || selector.startsWith(".\\") || selector.startsWith("../") || selector.startsWith("..\\") || selector.includes("/") || selector.includes("\\") || /^[A-Za-z]:/.test(selector);
3367
3394
  }
@@ -3745,7 +3772,7 @@ function validateModelDependentTurnConfigOptionValues(values, capability, target
3745
3772
  const declaredSpeedTiers = getAcpModelSpeedTiers(capability, targetModelId);
3746
3773
  const declaredFast = getAcpModelFastSupport(capability, targetModelId);
3747
3774
  for (const [id, value] of Object.entries(values)) {
3748
- if (isTurnEffortEntry(optionsById, id)) {
3775
+ if (isTurnEffortEntry(optionsById, id, capability)) {
3749
3776
  if (typeof value !== "string") {
3750
3777
  throw new Error(`Config option "${id}" expects a select value.`);
3751
3778
  }
@@ -3757,7 +3784,7 @@ function validateModelDependentTurnConfigOptionValues(values, capability, target
3757
3784
  { kind: "ACP option", id }
3758
3785
  );
3759
3786
  throw new Error(
3760
- `Invalid reasoning effort for model ${targetModelId}: ${String(value)}. Allowed values: ${efforts.join(", ")}.`
3787
+ efforts.length === 0 ? `Model ${targetModelId} does not offer a reasoning effort option.` : `Invalid reasoning effort for model ${targetModelId}: ${String(value)}. Allowed values: ${efforts.join(", ")}.`
3761
3788
  );
3762
3789
  }
3763
3790
  validatedIds.add(id);
@@ -3806,10 +3833,14 @@ function validateModelDependentTurnConfigOptionValues(values, capability, target
3806
3833
  validatedIds.add(id);
3807
3834
  continue;
3808
3835
  }
3809
- if (value !== ACP_CONFIG_OPTION_ON_VALUE && value !== ACP_CONFIG_OPTION_OFF_VALUE) {
3836
+ if (isAcpNormalSpeedAlias(value)) {
3837
+ validatedIds.add(id);
3810
3838
  continue;
3811
3839
  }
3812
- } else if (typeof value !== "boolean" && value !== ACP_CONFIG_OPTION_ON_VALUE && value !== ACP_CONFIG_OPTION_OFF_VALUE) {
3840
+ if (value !== ACP_CONFIG_OPTION_ON_VALUE) {
3841
+ continue;
3842
+ }
3843
+ } else if (typeof value !== "boolean" && value !== ACP_CONFIG_OPTION_ON_VALUE && !isAcpNormalSpeedAlias(value)) {
3813
3844
  throw new Error(`Config option "${id}" expects a boolean or on/off value.`);
3814
3845
  }
3815
3846
  if (declaredFast === false && (value === true || value === ACP_CONFIG_OPTION_ON_VALUE)) {
@@ -3827,8 +3858,9 @@ function validateModelDependentTurnConfigOptionValues(values, capability, target
3827
3858
  }
3828
3859
  return validatedIds;
3829
3860
  }
3830
- function isTurnEffortEntry(optionsById, id) {
3831
- return isAcpThoughtLevelConfigOption(optionsById.get(id) ?? { id }) || id === "effort";
3861
+ function isTurnEffortEntry(optionsById, id, capability) {
3862
+ const knownOption = optionsById.get(id) ?? capability?.configOptions?.find((option) => option.id === id);
3863
+ return isAcpThoughtLevelConfigOption(knownOption ?? { id }) || id === "effort" || id === "thought_level";
3832
3864
  }
3833
3865
  function filterCompatibleTurnConfigOptionValues(values, capability, targetModelId) {
3834
3866
  if (!values || !capability) {
@@ -3848,7 +3880,7 @@ function filterCompatibleTurnConfigOptionValues(values, capability, targetModelI
3848
3880
  const compatible = Object.fromEntries(
3849
3881
  Object.entries(values).filter(([id, value]) => {
3850
3882
  if (targetModelId) {
3851
- if (isTurnEffortEntry(optionsById, id)) {
3883
+ if (isTurnEffortEntry(optionsById, id, capability)) {
3852
3884
  if (efforts !== void 0) return typeof value === "string" && efforts.includes(value);
3853
3885
  if (keepUnverified) return typeof value === "string";
3854
3886
  } else if (isAcpFastModeConfigId(id)) {
@@ -3860,10 +3892,13 @@ function filterCompatibleTurnConfigOptionValues(values, capability, targetModelI
3860
3892
  if (value === ACP_FAST_MODE_VALUE_FAST) {
3861
3893
  return speedTiers.includes(ACP_FAST_MODE_VALUE_FAST);
3862
3894
  }
3895
+ if (isAcpNormalSpeedAlias(value)) {
3896
+ return true;
3897
+ }
3863
3898
  }
3864
3899
  if (fastSupport === false) return false;
3865
3900
  if (keepUnverified) {
3866
- return typeof value === "boolean" || value === ACP_CONFIG_OPTION_ON_VALUE || value === ACP_CONFIG_OPTION_OFF_VALUE || value === ACP_FAST_MODE_VALUE_FAST || value === ACP_FAST_MODE_VALUE_ULTRAFAST;
3901
+ return typeof value === "boolean" || value === ACP_CONFIG_OPTION_ON_VALUE || isAcpNormalSpeedAlias(value) || value === ACP_FAST_MODE_VALUE_FAST || value === ACP_FAST_MODE_VALUE_ULTRAFAST;
3867
3902
  }
3868
3903
  }
3869
3904
  }
@@ -3961,16 +3996,10 @@ function warnDroppedInheritedMachineFlockSelections(args) {
3961
3996
  );
3962
3997
  }
3963
3998
  }
3964
- async function readAgentAcpCapabilitySnapshot(args) {
3999
+ async function readAgentAcpCapabilityFromRepo(args) {
3965
4000
  if (!args.agentConfigId) {
3966
- return { capability: void 0, freshness: { confirmed: true } };
4001
+ return void 0;
3967
4002
  }
3968
- const freshness = args.localOnly ? { confirmed: true } : await syncMachineFlockDocsForRead(
3969
- args.manager,
3970
- args.workspaceId,
3971
- [args.machineId],
3972
- "session.acp-capabilities"
3973
- );
3974
4003
  const handle = await args.manager.repo.openFlockDoc(
3975
4004
  getMachineFlockDocId(args.workspaceId, args.machineId)
3976
4005
  );
@@ -3980,8 +4009,57 @@ async function readAgentAcpCapabilitySnapshot(args) {
3980
4009
  })
3981
4010
  );
3982
4011
  const cached = capabilities[getAcpCapabilityCacheKey(args.agentConfigId)];
3983
- const capability = "runtimeOverrides" in args ? getReadableAcpCapabilityCacheEntryForRuntimeOverrides(cached, args.runtimeOverrides) : getReadableAcpCapabilityCacheEntry(cached);
3984
- return { capability, freshness };
4012
+ return "runtimeOverrides" in args ? getReadableAcpCapabilityCacheEntryForRuntimeOverrides(cached, args.runtimeOverrides) : getReadableAcpCapabilityCacheEntry(cached);
4013
+ }
4014
+ async function readAgentAcpCapabilitySnapshot(args) {
4015
+ if (!args.agentConfigId) {
4016
+ return { capability: void 0, freshness: { confirmed: true } };
4017
+ }
4018
+ if (args.localOnly) {
4019
+ return {
4020
+ capability: await readAgentAcpCapabilityFromRepo(args),
4021
+ freshness: { confirmed: true }
4022
+ };
4023
+ }
4024
+ const daemonTarget = await resolveDaemonTarget({
4025
+ manager: args.manager,
4026
+ workspaceId: args.workspaceId,
4027
+ machineId: args.machineId
4028
+ });
4029
+ if (!daemonTarget.isLocalEnvironment && daemonTarget.sameReplica) {
4030
+ const localCapability = await readAgentAcpCapabilityFromRepo(args);
4031
+ if (localCapability !== void 0) {
4032
+ return { capability: localCapability, freshness: { confirmed: true } };
4033
+ }
4034
+ const unconfirmed = {
4035
+ confirmed: false,
4036
+ error: new FlockSyncUnavailableError({
4037
+ message: `Machine Flock read used the local daemon replica without remote confirmation (session.acp-capabilities:${args.machineId})`,
4038
+ reason: "local-replica-unconfirmed"
4039
+ })
4040
+ };
4041
+ const confirmedMiss = await confirmSameReplicaMachineFlockOnMiss(
4042
+ args.manager,
4043
+ args.workspaceId,
4044
+ args.machineId,
4045
+ unconfirmed,
4046
+ "session.acp-capabilities"
4047
+ );
4048
+ return {
4049
+ capability: confirmedMiss.retried ? await readAgentAcpCapabilityFromRepo(args) : localCapability,
4050
+ freshness: confirmedMiss.freshness
4051
+ };
4052
+ }
4053
+ const freshness = await syncMachineFlockDocsForRead(
4054
+ args.manager,
4055
+ args.workspaceId,
4056
+ [args.machineId],
4057
+ "session.acp-capabilities"
4058
+ );
4059
+ return {
4060
+ capability: await readAgentAcpCapabilityFromRepo(args),
4061
+ freshness
4062
+ };
3985
4063
  }
3986
4064
  async function readAgentAcpCapability(args) {
3987
4065
  return (await readAgentAcpCapabilitySnapshot(args)).capability;
@@ -4544,12 +4622,41 @@ function selectDefaultAgentConfigForCreate(configs, machineId, currentSession) {
4544
4622
  }
4545
4623
  return configs.length === 1 ? configs[0] : void 0;
4546
4624
  }
4625
+ function sortAgentConfigsForCreate(configs) {
4626
+ configs.sort((left, right) => {
4627
+ const nameCompare = left.name.localeCompare(right.name);
4628
+ if (nameCompare !== 0) {
4629
+ return nameCompare;
4630
+ }
4631
+ return left.id.localeCompare(right.id);
4632
+ });
4633
+ return configs;
4634
+ }
4547
4635
  async function resolveAgentConfigForCreate(args) {
4548
- const { configs, freshness } = await listAgentConfigsForMachine(
4636
+ let { configs, freshness } = await listAgentConfigsForMachine(
4549
4637
  args.manager,
4550
4638
  args.workspaceId,
4551
4639
  args.machineId
4552
4640
  );
4641
+ const selector = normalizeCliValue(args.selector) ?? normalizeCliValue(process.env.LODY_AGENT_CONFIG_ID);
4642
+ const isSelectorMissing = Boolean(selector) && !configs.some(
4643
+ (config) => config.id === selector || normalizeCliValue(config.name) === selector
4644
+ );
4645
+ if (configs.length === 0 || isSelectorMissing) {
4646
+ const confirmedMiss = await confirmSameReplicaMachineFlockOnMiss(
4647
+ args.manager,
4648
+ args.workspaceId,
4649
+ args.machineId,
4650
+ freshness,
4651
+ "session.agent-configs"
4652
+ );
4653
+ freshness = confirmedMiss.freshness;
4654
+ if (confirmedMiss.retried) {
4655
+ configs = sortAgentConfigsForCreate(
4656
+ await listMergedAgentConfigs(args.manager.repo, args.workspaceId, [args.machineId])
4657
+ );
4658
+ }
4659
+ }
4553
4660
  if (configs.length === 0) {
4554
4661
  assertMachineFlockCacheSufficient(freshness, "Agent config catalog is unavailable.", {
4555
4662
  kind: "agent config",
@@ -4557,7 +4664,6 @@ async function resolveAgentConfigForCreate(args) {
4557
4664
  });
4558
4665
  throw new Error(`No agent config exists on machine ${args.machineId}.`);
4559
4666
  }
4560
- const selector = normalizeCliValue(args.selector) ?? normalizeCliValue(process.env.LODY_AGENT_CONFIG_ID);
4561
4667
  if (selector) {
4562
4668
  if (!configs.some(
4563
4669
  (config) => config.id === selector || normalizeCliValue(config.name) === selector
@@ -4675,15 +4781,30 @@ async function resolveLocalProjectRefOnMachineOrThrow(manager, workspaceId, auth
4675
4781
  if (!normalizedSelector) {
4676
4782
  throw new Error("Missing local project selector.");
4677
4783
  }
4678
- const freshness = await syncMachineFlockDocsForRead(
4784
+ let freshness = await syncMachineFlockDocsForRead(
4679
4785
  manager,
4680
4786
  workspaceId,
4681
4787
  [machineId],
4682
4788
  "session.local-projects"
4683
4789
  );
4684
- const localProjects = Object.values(
4790
+ let localProjects = Object.values(
4685
4791
  await readMachineLocalProjects(manager.repo, workspaceId, machineId)
4686
4792
  );
4793
+ if (localProjects.length === 0 || selectLocalProjectsBySelector(localProjects, normalizedSelector).length === 0) {
4794
+ const confirmedMiss = await confirmSameReplicaMachineFlockOnMiss(
4795
+ manager,
4796
+ workspaceId,
4797
+ machineId,
4798
+ freshness,
4799
+ "session.local-projects"
4800
+ );
4801
+ freshness = confirmedMiss.freshness;
4802
+ if (confirmedMiss.retried) {
4803
+ localProjects = Object.values(
4804
+ await readMachineLocalProjects(manager.repo, workspaceId, machineId)
4805
+ );
4806
+ }
4807
+ }
4687
4808
  if (localProjects.length === 0) {
4688
4809
  assertMachineFlockCacheSufficient(freshness, "Local project catalog is unavailable.", {
4689
4810
  kind: "project",
@@ -4904,7 +5025,8 @@ async function validateSessionCreateOptions(args) {
4904
5025
  agentConfig: resolved.agentConfig,
4905
5026
  project: resolved.project,
4906
5027
  openedBySessionId: resolved.openedBySessionId,
4907
- dispatchConfig: args.dispatchConfig ?? resolveTurnDispatchConfig({})
5028
+ dispatchConfig: args.dispatchConfig ?? resolveTurnDispatchConfig({}),
5029
+ ...args.options.agentRoleId ? { agentRoleId: args.options.agentRoleId } : {}
4908
5030
  });
4909
5031
  }
4910
5032
  async function resolveEffectiveSessionCreateDispatchConfig(args) {
@@ -4964,6 +5086,14 @@ async function resolveEffectiveSessionCreateDispatchConfig(args) {
4964
5086
  runtimeOverrides: args.agentConfig.runtimeOverrides,
4965
5087
  localOnly: args.localOnly
4966
5088
  }) : { capability: void 0, freshness: { confirmed: true } };
5089
+ if (args.agentRoleId && capability) {
5090
+ const reconciledRole = reconcileAgentRoleRunConfig(dispatchConfig, capability);
5091
+ if (reconciledRole.configOptionValues && Object.keys(reconciledRole.configOptionValues).length > 0) {
5092
+ dispatchConfig.configOptionValues = reconciledRole.configOptionValues;
5093
+ } else {
5094
+ delete dispatchConfig.configOptionValues;
5095
+ }
5096
+ }
4967
5097
  const compatibleDefaults = filterCompatibleInheritedTurnConfig(
4968
5098
  inheritedDispatchConfig,
4969
5099
  capability
@@ -5119,7 +5249,8 @@ async function prepareSessionInput(auth, workspace, manager, prompt, options, di
5119
5249
  ...openedBySessionId ? { openedBySessionId } : {},
5120
5250
  dispatchConfig,
5121
5251
  localOnly: ownerTarget !== void 0,
5122
- ...Object.hasOwn(authoredDispatchOverrides, "modelId") ? { authoredInheritedModel: { modelId: authoredDispatchOverrides.modelId } } : {}
5252
+ ...Object.hasOwn(authoredDispatchOverrides, "modelId") ? { authoredInheritedModel: { modelId: authoredDispatchOverrides.modelId } } : {},
5253
+ ...options.agentRoleId ? { agentRoleId: options.agentRoleId } : {}
5123
5254
  });
5124
5255
  Object.assign(effectiveDispatchConfig, authoredDispatchOverrides);
5125
5256
  const sessionId = options.sessionId ?? v4();
@@ -6965,4 +7096,4 @@ export {
6965
7096
  validateSessionChatTarget as y,
6966
7097
  MachineOfflineError as z
6967
7098
  };
6968
- //# sourceMappingURL=session-p5D9mnGA.js.map
7099
+ //# sourceMappingURL=session-npaRR-y3.js.map
@@ -1,5 +1,5 @@
1
- import { j as SESSION_DOC_PREFIX, k as getSessionIdFromRoomId } from "./presence-BGW-7JQJ.js";
2
- import { e as isLoroRepoDocDeleted } from "./session-access-DBWXcozo.js";
1
+ import { j as SESSION_DOC_PREFIX, k as getSessionIdFromRoomId } from "./presence-CZco7UQH.js";
2
+ import { e as isLoroRepoDocDeleted } from "./access-Sut1_1-c.js";
3
3
  function collectSessionArchiveTargets(sessionId, sessions) {
4
4
  return collectDescendants(sessionId, sessions, (session) => session.parentSessionId);
5
5
  }
@@ -78,4 +78,4 @@ export {
78
78
  isSessionCollaborationStopped as i,
79
79
  readSessionOperationTargets as r
80
80
  };
81
- //# sourceMappingURL=session-operation-targets-yk7bQTAn.js.map
81
+ //# sourceMappingURL=session-operation-targets-lq3rsTnV.js.map
@@ -18,9 +18,9 @@ import { y as yauzlExports } from "./chunks/vendor-yauzl-9hnFHTV6.js";
18
18
  import { e as formatErrorWithCauses, g as getLogger, f as formatErrorMessage } from "./logger-C-G7jpWR.js";
19
19
  import { d as decompressStream } from "./chunks/vendor-zstd-stream-46u8wyoZ.js";
20
20
  import { c as claudeSdkManifestJson, a as claudeSdkPackageJson } from "./chunks/vendor-@anthropic-ai-claude-agent-sdk-Cnk9IorF.js";
21
- import { g as getCliHttpFetch, e as resolveProxyUrl, f as resolveCliHttpTransportConfig } from "./http-transport-DDAJ_zUL.js";
22
- import { C as CURRENT_MACHINE_PROTOCOL_CAPABILITIES, M as MACHINE_PROTOCOL_CAPABILITIES, P as PI_EXTENSIONS_PROTOCOL_VERSION } from "./machine-protocol-capabilities-LN7bzFSN.js";
23
- import { c as captureCli } from "./login-shell-env-DiOZ-bog.js";
21
+ import { g as getCliHttpFetch, e as resolveProxyUrl, f as resolveCliHttpTransportConfig } from "./http-transport-C1f1XEnB.js";
22
+ import { C as CURRENT_MACHINE_PROTOCOL_CAPABILITIES, M as MACHINE_PROTOCOL_CAPABILITIES, P as PI_EXTENSIONS_PROTOCOL_VERSION } from "./machine-protocol-capabilities-DEhAj9SH.js";
23
+ import { c as captureCli } from "./login-shell-env-HKDW5zwx.js";
24
24
  import { createHash as createHash$1 } from "crypto";
25
25
  import { g as githubCredentialRuntime } from "./github-credential-runtime-Vuv6HxRs.js";
26
26
  import { execFileSync } from "node:child_process";
@@ -1485,7 +1485,9 @@ const KIMI_CODE_MIN_NODE_VERSION = resolveMinimumNodeVersion(
1485
1485
  "Kimi managed runtime manifest",
1486
1486
  `>=${kimiRuntimeManifestJson.minNodeVersion}`
1487
1487
  );
1488
- const BUILTIN_CODEX_CAPABILITY_SOURCE_VERSION = `builtin-codex-acp:${CODEX_ACP_ADAPTER_VERSION}+codex:${CODEX_RUNTIME_VERSION}`;
1488
+ const CODEX_CAPABILITY_SCHEMA_VERSION = "speed-tiers:1";
1489
+ const formatBuiltinCodexCapabilitySourceVersion = (runtimeVersion) => `builtin-codex-acp:${CODEX_ACP_ADAPTER_VERSION}+codex:${runtimeVersion}+${CODEX_CAPABILITY_SCHEMA_VERSION}`;
1490
+ const BUILTIN_CODEX_CAPABILITY_SOURCE_VERSION = formatBuiltinCodexCapabilitySourceVersion(CODEX_RUNTIME_VERSION);
1489
1491
  const BUILTIN_CLAUDE_CAPABILITY_SOURCE_VERSION = `builtin-claude-acp:${CLAUDE_ACP_ADAPTER_VERSION}+agent-sdk:${CLAUDE_AGENT_SDK_VERSION}+claude-code:${CLAUDE_CODE_RUNTIME_VERSION}`;
1490
1492
  const BUILTIN_KIMI_CAPABILITY_SOURCE_VERSION = `builtin-kimi:${KIMI_CODE_VERSION}`;
1491
1493
  const BUILTIN_GROK_CAPABILITY_SOURCE_VERSION = `builtin-grok-acp:${GROK_ACP_ADAPTER_VERSION}+official-grok:${GROK_BUILD_RUNTIME_VERSION}`;
@@ -4121,7 +4123,7 @@ function getAcpCapabilitySourceVersion(input, managedRuntimeVersion, sorbetInsta
4121
4123
  return `builtin-antigravity:${managedRuntimeVersion ?? ANTIGRAVITY_RUNTIME_VERSION}${runtimeOverrideSuffix}`;
4122
4124
  }
4123
4125
  if (input.agentType === "codex") {
4124
- return managedRuntimeVersion ? `builtin-codex-acp:${CODEX_ACP_ADAPTER_VERSION}+codex:${managedRuntimeVersion}` : `${BUILTIN_CODEX_CAPABILITY_SOURCE_VERSION}${runtimeOverrideSuffix}`;
4126
+ return managedRuntimeVersion ? formatBuiltinCodexCapabilitySourceVersion(managedRuntimeVersion) : `${BUILTIN_CODEX_CAPABILITY_SOURCE_VERSION}${runtimeOverrideSuffix}`;
4125
4127
  }
4126
4128
  if (input.agentType === "claude") {
4127
4129
  return managedRuntimeVersion ? `builtin-claude-acp:${CLAUDE_ACP_ADAPTER_VERSION}+agent-sdk:${CLAUDE_AGENT_SDK_VERSION}+claude-code:${managedRuntimeVersion}` : `${BUILTIN_CLAUDE_CAPABILITY_SOURCE_VERSION}${runtimeOverrideSuffix}`;
@@ -4729,4 +4731,4 @@ export {
4729
4731
  normalizeAgentProcessEnv as y,
4730
4732
  getManagedAgentRuntimeManager as z
4731
4733
  };
4732
- //# sourceMappingURL=setting-CO0xphaD.js.map
4734
+ //# sourceMappingURL=setting-Cq6nKJgF.js.map