nolo-cli 0.250.0-alpha.1 → 0.252.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/{_executeModel-F4MT6OPO.js → _executeModel-D6G3B45S.js} +51 -51
  2. package/{action-WZTKEF5H.js → action-QQOQ2LP3.js} +3 -3
  3. package/{addContentAction-MLI6GOBV.js → addContentAction-MB22YIDV.js} +6 -6
  4. package/{addDialogAgentAction-ARGQM22H.js → addDialogAgentAction-KNTBVVGY.js} +5 -5
  5. package/{agentDeleteCommand-DBCRHB4S.js → agentDeleteCommand-YCWDGJSF.js} +87 -82
  6. package/{agentEmailCommands-T4PAJ4KG.js → agentEmailCommands-DTWD5FWC.js} +87 -82
  7. package/{agentListCommands-5ULWKQ3E.js → agentListCommands-JTOONLYL.js} +233 -46
  8. package/{agentMachineCommands-65QUOCEY.js → agentMachineCommands-25X7OTLQ.js} +38 -36
  9. package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
  10. package/{agentPullCommand-4EQZYHU4.js → agentPullCommand-6OCNLVGC.js} +1 -1
  11. package/{agentRecordCommands-EKANS3A5.js → agentRecordCommands-SXE3WV2X.js} +86 -81
  12. package/{agentRunCommand-336PXBRJ.js → agentRunCommand-QSIED54S.js} +87 -82
  13. package/{agentRunControl-QMWTWV7C.js → agentRunControl-KNNDEEDI.js} +8 -6
  14. package/{agentRuntimeLocal-KKXJOBD3.js → agentRuntimeLocal-HVJJMB4W.js} +32 -31
  15. package/{agentSlice-FWYXP332.js → agentSlice-NBUJJVRI.js} +7 -7
  16. package/{appDeleteCommands-ERJK367V.js → appDeleteCommands-YU6TT6VN.js} +39 -37
  17. package/{appDeployCommands-LUV6QKQJ.js → appDeployCommands-4DEIX7YP.js} +39 -37
  18. package/{appDeployStatusCommands-WW7IYQD4.js → appDeployStatusCommands-3VKS6GBQ.js} +39 -37
  19. package/{appGetCommands-G7XYYSFO.js → appGetCommands-22FNNROT.js} +39 -37
  20. package/{appListCommands-4RXCIDNI.js → appListCommands-FVGMLHVU.js} +39 -37
  21. package/{authCommand-3C3RN4OU.js → authCommand-5DC3ES4Q.js} +15 -15
  22. package/{authCommands-ZMVEDCQD.js → authCommands-BLXNAUF4.js} +2 -2
  23. package/{chromeOpsCommands-NZITLHWO.js → chromeOpsCommands-AA555ANS.js} +1 -1
  24. package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
  25. package/chunk-2GAUJDA5.js +594 -0
  26. package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
  27. package/{chunk-222CJNC2.js → chunk-2LANL4B5.js} +3 -3
  28. package/{chunk-W4G25PVP.js → chunk-2PB653F5.js} +196 -253
  29. package/{chunk-UF6J7NXV.js → chunk-3272HU62.js} +1 -1
  30. package/chunk-3A5NNQCN.js +64 -0
  31. package/{chunk-7IQA2VJF.js → chunk-3N3JPQBQ.js} +210 -56
  32. package/{chunk-LXKK7QFI.js → chunk-4HAOOY6G.js} +53 -23
  33. package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
  34. package/{chunk-ADOOL3PG.js → chunk-52M4RYVP.js} +1 -1
  35. package/{chunk-U7OMQLRE.js → chunk-5IN2NBDX.js} +9 -9
  36. package/{chunk-BAH3BAUZ.js → chunk-5QEOTC35.js} +5 -5
  37. package/{chunk-E5RYFR7E.js → chunk-5UYDG6HP.js} +19 -0
  38. package/{chunk-Z7A2ZQ5X.js → chunk-64ACTEAE.js} +1 -1
  39. package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
  40. package/{chunk-BFKJ2RS3.js → chunk-7RYODZDD.js} +1 -1
  41. package/{chunk-YWNCRUBZ.js → chunk-7XO73H5X.js} +116 -6
  42. package/{chunk-SMEX763N.js → chunk-7ZOVFB2H.js} +100 -43
  43. package/{chunk-UR4ZMRV3.js → chunk-A5F6DYP2.js} +1 -1
  44. package/{chunk-ZKMS73DK.js → chunk-A6VIMCWI.js} +3 -3
  45. package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
  46. package/{chunk-LTVEOOZL.js → chunk-CIAV4WK2.js} +14 -1
  47. package/{chunk-HZDK56EK.js → chunk-CO2NXG2J.js} +32 -10
  48. package/{chunk-OHUYN3YU.js → chunk-CYGFNMCH.js} +1 -1
  49. package/{chunk-MZVCFV3T.js → chunk-D3WOFN6N.js} +3 -3
  50. package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
  51. package/{chunk-VV5IS3ES.js → chunk-DU3DJYVA.js} +5 -5
  52. package/{chunk-SPU3L3OR.js → chunk-EFM2IPZR.js} +3 -3
  53. package/{chunk-73PZD7JZ.js → chunk-EG3JTV7H.js} +2 -2
  54. package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
  55. package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
  56. package/{chunk-CD64YXRB.js → chunk-F6Q64KRV.js} +1 -1
  57. package/{chunk-TMRJGSK2.js → chunk-FRC2DNTN.js} +1 -1
  58. package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
  59. package/{chunk-I3J7HO3U.js → chunk-FZI2P64R.js} +137 -53
  60. package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
  61. package/{chunk-XHG7QROB.js → chunk-GO7UC5VH.js} +5 -5
  62. package/{chunk-RDBDHGU7.js → chunk-GVH2IP2M.js} +5 -5
  63. package/{chunk-AXZ5DDLB.js → chunk-GWS2X7TX.js} +235 -120
  64. package/{chunk-KHVTT4WW.js → chunk-HF4C5WIU.js} +81 -542
  65. package/{chunk-ATRU65OK.js → chunk-HMREADP6.js} +21 -19
  66. package/chunk-HZD5HXUO.js +405 -0
  67. package/{chunk-VHMPJGT4.js → chunk-ITCOQAHS.js} +3 -3
  68. package/{chunk-BQ4CZEVZ.js → chunk-ITMBFT35.js} +1 -1
  69. package/chunk-IVK2KT3H.js +209 -0
  70. package/{chunk-FFFKAOJN.js → chunk-JAYPSNGR.js} +1 -1
  71. package/{chunk-NEG5LYK5.js → chunk-JCQ3WCQ3.js} +3 -1
  72. package/{chunk-3IVFGQIM.js → chunk-JF5QT3YY.js} +2 -2
  73. package/{chunk-V4IYI3SB.js → chunk-JKALGWDL.js} +2 -2
  74. package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
  75. package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
  76. package/{chunk-HEIIOJGN.js → chunk-LAQC5FAP.js} +4 -4
  77. package/{chunk-I3OW5RAX.js → chunk-LNIA5JVX.js} +8 -8
  78. package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
  79. package/{chunk-W6T4FNZP.js → chunk-LUPZLKXL.js} +192 -352
  80. package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
  81. package/{chunk-SHDJLJWV.js → chunk-N2ZAY2DK.js} +1 -1
  82. package/{chunk-WEZ27JA7.js → chunk-NMXGIRSG.js} +1 -1
  83. package/{chunk-MTM4LRVG.js → chunk-NNUIVAC2.js} +1 -1
  84. package/{chunk-ARFCL53U.js → chunk-NPUHKEOB.js} +4 -4
  85. package/{chunk-32WTED6G.js → chunk-O6LPLIRS.js} +94 -83
  86. package/{chunk-4IQN6FWY.js → chunk-OB4FBZXJ.js} +4 -4
  87. package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
  88. package/{chunk-UPOW5HTG.js → chunk-OMIXG25B.js} +2 -2
  89. package/{chunk-MYYNZG2M.js → chunk-OOV5JN25.js} +4 -4
  90. package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
  91. package/{chunk-OKKA4BCM.js → chunk-P6HMEKLL.js} +114 -56
  92. package/{chunk-VTHWBTRE.js → chunk-PENRYZ4D.js} +1 -1
  93. package/{chunk-VIYVRPMJ.js → chunk-PHREU2KZ.js} +5 -3
  94. package/{chunk-EDT65EUE.js → chunk-PIVTQRX6.js} +45 -15
  95. package/{chunk-KJDN2YRH.js → chunk-QMKWSKWA.js} +4 -4
  96. package/{chunk-6TVYUQRM.js → chunk-QV32GSVO.js} +2 -2
  97. package/{chunk-K7VIXYTZ.js → chunk-R3MV2GII.js} +1 -45
  98. package/{chunk-XJSEST7D.js → chunk-SMCKJJXI.js} +2 -2
  99. package/{chunk-JFRJEPFI.js → chunk-SMZFWEMX.js} +1 -1
  100. package/{chunk-KK3FCYZM.js → chunk-SQL7YNED.js} +7 -4
  101. package/{chunk-D25ONVOH.js → chunk-SSZHE2RK.js} +1 -1
  102. package/{chunk-OLGFIQN2.js → chunk-T4VVQHSE.js} +1 -1
  103. package/{chunk-6QL3SUEK.js → chunk-TDI7ARZO.js} +3 -3
  104. package/{chunk-X6LYQDN5.js → chunk-TDLZA6LJ.js} +13 -10
  105. package/chunk-TRRXYFTR.js +46 -0
  106. package/{chunk-WMKA2DPK.js → chunk-TTUIM3PJ.js} +4 -4
  107. package/{chunk-RHBD22LV.js → chunk-TTWNTFTO.js} +39 -4
  108. package/{chunk-ZM5AZTQG.js → chunk-U7BP25PE.js} +18 -6
  109. package/{chunk-X3OZ655T.js → chunk-UI3Z3HDK.js} +1 -1
  110. package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
  111. package/{chunk-BVEDT6DM.js → chunk-VH7AQEEF.js} +3 -3
  112. package/{chunk-PGDM7AM2.js → chunk-WAOHK3NJ.js} +9 -9
  113. package/{chunk-2FK2KZSL.js → chunk-WLHUANWZ.js} +1 -1
  114. package/{chunk-ZTWDSOXD.js → chunk-WNIBQBOR.js} +1 -1
  115. package/{chunk-SLUZ6FBJ.js → chunk-XBCADGK2.js} +1 -1
  116. package/chunk-XRGBJHZX.js +136 -0
  117. package/{chunk-6XVPMGXK.js → chunk-YB5D2GK4.js} +9 -3
  118. package/{chunk-AKWA6PCE.js → chunk-YQYYYATY.js} +45 -27
  119. package/{chunk-WQDTSK5U.js → chunk-ZMFA2TLE.js} +1 -1
  120. package/{chunk-CFDOIIOZ.js → chunk-ZMXO5G3E.js} +29 -23
  121. package/{chunk-YQO5UKHP.js → chunk-ZNOXY73P.js} +632 -124
  122. package/{cliAgentConfigHelpers-37ZNEY5Y.js → cliAgentConfigHelpers-FKBPFPKR.js} +7 -7
  123. package/{cliAuthorityBrokerClient-SFPC3WVK.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
  124. package/cliAuthorityBrokerProcess-IUCB4XA6.js +22 -0
  125. package/{cliLocalAgentRecordReader-R4CLUHYO.js → cliLocalAgentRecordReader-DWU3LBO2.js} +36 -35
  126. package/{commandRegistry-UIZRI4JV.js → commandRegistry-7FVATZS2.js} +74 -74
  127. package/{contentThunks-ZQSZA4GH.js → contentThunks-25XCB7VY.js} +20 -20
  128. package/{cooldownCommands-TIFCHCUN.js → cooldownCommands-PT5L4LNB.js} +3 -3
  129. package/{createAgentAutomationAction-RQE4F6PR.js → createAgentAutomationAction-FC5RI2LW.js} +20 -20
  130. package/{createDialogAction-JDSMQ34U.js → createDialogAction-IL3ISSQQ.js} +21 -21
  131. package/{createPageAction-VLF6XCYO.js → createPageAction-RVYBEYZV.js} +23 -23
  132. package/{db-CMUTP3W5.js → db-JMGVD4TB.js} +4 -2
  133. package/{dbSlice-656PMWR2.js → dbSlice-WG3ZG6PZ.js} +5 -5
  134. package/{deleteFile-ZCQESEEQ.js → deleteFile-4TIG54YN.js} +3 -3
  135. package/{dialogCommands-PLM7ZFWH.js → dialogCommands-VUJISJZF.js} +48 -42
  136. package/{dialogNotifyCommand-PST75COP.js → dialogNotifyCommand-JKYVSR6K.js} +8 -8
  137. package/{dialogSlice-63DD2ER2.js → dialogSlice-UMP55UAW.js} +18 -18
  138. package/{dialogUsageCommand-6RW2FY6K.js → dialogUsageCommand-IHAXS7DW.js} +5 -5
  139. package/{docCreateCommands-BST5DO7L.js → docCreateCommands-S46F6GKP.js} +38 -36
  140. package/{docDeleteCommands-YE6G2SO4.js → docDeleteCommands-LJG4NK6J.js} +39 -37
  141. package/{docReadCommands-M6T35U3G.js → docReadCommands-YPAYGHNM.js} +38 -36
  142. package/{docStore-7QNJWRJ2.js → docStore-VK3MVJ5Q.js} +6 -6
  143. package/{docUpdateCommands-6DFWGPVG.js → docUpdateCommands-MPTM6267.js} +38 -36
  144. package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
  145. package/{handleSendMessageAction-FCEFFAV4.js → handleSendMessageAction-VPKVNKBU.js} +83 -41
  146. package/{hostCredentialCreate-YEWCAMZN.js → hostCredentialCreate-K56HWPNY.js} +86 -81
  147. package/index.js +23 -11
  148. package/{localDialogRead-CIOTQM5T.js → localDialogRead-NXILOV3T.js} +1 -1
  149. package/{localRuntimeAdapter-Z22ZOZRY.js → localRuntimeAdapter-KVU72FWT.js} +84 -79
  150. package/{localRuntimeAuthority-TYHQCTZN.js → localRuntimeAuthority-QKWTPBQQ.js} +13 -3
  151. package/{localRuntimeDb-BO7IVWAZ.js → localRuntimeDb-3CIC4SKC.js} +1 -1
  152. package/{machineCommands-PT5OJ36V.js → machineCommands-C3O5RKNJ.js} +85 -80
  153. package/{machineWsRunDispatch-DQVNBSVE.js → machineWsRunDispatch-ZLART7ZA.js} +85 -80
  154. package/{markdownToSlate-KIYM7B3P.js → markdownToSlate-PXYAIBVL.js} +1 -1
  155. package/{mcpLocalAuthorizeCommand-GO6AYT63.js → mcpLocalAuthorizeCommand-LO7E4VQ5.js} +15 -11
  156. package/{memberThunks-JFYC4Z5L.js → memberThunks-7DNR6DRD.js} +7 -7
  157. package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
  158. package/package.json +2 -1
  159. package/{projectArchive-4XUC5SLF.js → projectArchive-UBJFYRL7.js} +23 -23
  160. package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
  161. package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
  162. package/{read-BRZHXUJ6.js → read-Z2JOK6F6.js} +3 -3
  163. package/{readDocTool-N7RVFQEE.js → readDocTool-3QYSVWBT.js} +1 -1
  164. package/{readlineWorkspace-7U5QM3OM.js → readlineWorkspace-TSIYF7C6.js} +655 -248
  165. package/{removeDialogAgentAction-J7XU7OUX.js → removeDialogAgentAction-LRKDU4RI.js} +7 -7
  166. package/{runAgentClientLoop-7D7UCAS2.js → runAgentClientLoop-YAHGOWXN.js} +48 -48
  167. package/{runtimeDoctorCommands-RDRJXMXC.js → runtimeDoctorCommands-QGZSKNSE.js} +14 -11
  168. package/{secretCommands-2FEMRUFM.js → secretCommands-BXAQEOES.js} +2 -2
  169. package/{setDialogExtraReferencesAction-Q4V2ZZW2.js → setDialogExtraReferencesAction-KIITOCFP.js} +6 -6
  170. package/{setPrimaryDialogAgentAction-742H5S6T.js → setPrimaryDialogAgentAction-Y36PKFFB.js} +7 -7
  171. package/{settingThunks-IHXUF276.js → settingThunks-YQNG5L6K.js} +5 -5
  172. package/{spaceCommands-WCLD36WH.js → spaceCommands-P644AAZZ.js} +37 -35
  173. package/{streamAgentChatTurn-DVTOINT3.js → streamAgentChatTurn-5CSYAUAY.js} +81 -77
  174. package/{switchDialogAgentAction-HLDLHRRA.js → switchDialogAgentAction-U2VLPPVO.js} +5 -5
  175. package/{tools-BOPINT5S.js → tools-UZ3CDIR2.js} +38 -38
  176. package/{tuiRestart-5F2APN66.js → tuiRestart-GF4DGAAN.js} +7 -7
  177. package/{tuiSummaryLlmCaller-TM5BU73J.js → tuiSummaryLlmCaller-HROLGN4F.js} +13 -13
  178. package/{updateCommands-FBYA5WVG.js → updateCommands-BZ4YDHNM.js} +3 -3
  179. package/{updateDialogTitleAction-S76PUCLQ.js → updateDialogTitleAction-53XCCDK2.js} +20 -20
  180. package/{usageCommand-L4OFWXEU.js → usageCommand-XVJ7ZUTM.js} +2 -2
  181. package/{usageRebuildCommand-7JR33UHS.js → usageRebuildCommand-NK6S3D4J.js} +3 -3
  182. package/{windowsSelfUpdate-M4V77OUB.js → windowsSelfUpdate-4BAXX7C3.js} +2 -2
  183. package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-DYX5ZMAT.js} +2 -2
  184. package/chunk-FGHEF6WI.js +0 -34
  185. package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
  186. package/{chunk-CDIRKCPD.js → chunk-6HL6E7ZD.js} +152 -152
@@ -6,12 +6,12 @@ import {
6
6
  loadFileFromIndexedDb,
7
7
  removeAction,
8
8
  saveFileToIndexedDb
9
- } from "./chunk-X3OZ655T.js";
9
+ } from "./chunk-UI3Z3HDK.js";
10
10
  import {
11
11
  readAction,
12
12
  readRequestManager,
13
13
  resolveAgentReadServers
14
- } from "./chunk-ZM5AZTQG.js";
14
+ } from "./chunk-U7BP25PE.js";
15
15
  import {
16
16
  beginWriteAck,
17
17
  compareRemoteRecordsByComparableTime,
@@ -29,13 +29,13 @@ import {
29
29
  shouldReplaceLocalWithRemoteRecord,
30
30
  shouldReplicateLocalRecord,
31
31
  uploadToCurrentServer
32
- } from "./chunk-WQDTSK5U.js";
32
+ } from "./chunk-ZMFA2TLE.js";
33
33
  import {
34
34
  asyncThunkCreator,
35
35
  buildCreateSlice,
36
36
  createEntityAdapter,
37
37
  noloDeleteRequest
38
- } from "./chunk-6XVPMGXK.js";
38
+ } from "./chunk-YB5D2GK4.js";
39
39
  import {
40
40
  fetchFromClientDb,
41
41
  fetchFromServer,
@@ -1265,6 +1265,15 @@ var upsertAction = async (upsertConfig, thunkApi) => {
1265
1265
  }
1266
1266
  };
1267
1267
 
1268
+ // packages/database/spaceUploadFileMapping.ts
1269
+ function mappings(db) {
1270
+ return db?.sublevel?.("web-space-upload-file-ids", { valueEncoding: "utf8" });
1271
+ }
1272
+ var mappingKey = (userId, pageKey) => JSON.stringify([userId, pageKey]);
1273
+ async function recordWebSpaceUploadFileId(db, userId, pageKey, fileId) {
1274
+ await mappings(db)?.put(mappingKey(userId, pageKey), fileId);
1275
+ }
1276
+
1268
1277
  // packages/database/actions/upload.ts
1269
1278
  var saveToClientDb2 = async (clientDb, dbKey, metadata) => {
1270
1279
  if (!clientDb) {
@@ -1289,7 +1298,7 @@ var uploadFileAction = async (uploadConfig, thunkApi) => {
1289
1298
  const { db: clientDb } = thunkApi.extra;
1290
1299
  const state = thunkApi.getState();
1291
1300
  const { currentServer, syncServers, currentUserId } = getRuntimeServerContext(state);
1292
- const { file, customKey, onProgress, signal } = uploadConfig;
1301
+ const { file, customKey, onProgress, signal, ownerType, spaceId } = uploadConfig;
1293
1302
  const userId = uploadConfig.userId || currentUserId;
1294
1303
  if (!file) {
1295
1304
  const errorMsg = "Invalid arguments for uploadFileAction: file is required.";
@@ -1344,7 +1353,11 @@ var uploadFileAction = async (uploadConfig, thunkApi) => {
1344
1353
  file,
1345
1354
  metadata: fileMetadata,
1346
1355
  customKey: finalDbKey,
1347
- userId
1356
+ userId,
1357
+ // 归属声明一律由调用方显式给出(例如 Space 上传传 ownerType:"space");
1358
+ // 服务端 uploadOwnership.ts 会重新校验,声明本身不构成授权。
1359
+ ...ownerType ? { ownerType } : {},
1360
+ ...spaceId ? { spaceId } : {}
1348
1361
  };
1349
1362
  const uploadServers = resolveUploadReplicationServers({
1350
1363
  currentServer,
@@ -1365,8 +1378,16 @@ var uploadFileAction = async (uploadConfig, thunkApi) => {
1365
1378
  await localCachePromise;
1366
1379
  }
1367
1380
  if (primaryUploadServer && !primaryUploadSucceeded) {
1381
+ if (ownerType === "space") {
1382
+ throw new Error(
1383
+ `Upload into Space "${spaceId}" failed on ${primaryUploadServer}: the Space may not be synced to that server, or you are not allowed to upload into it there. Sync the Space to ${primaryUploadServer} (or use another upload server) and retry. Ownership is server-decided and is never downgraded to a personal file.`
1384
+ );
1385
+ }
1368
1386
  throw new Error(`Primary upload failed on authority server ${primaryUploadServer}`);
1369
1387
  }
1388
+ if (ownerType === "space" && userId && finalDbKey === customKey) {
1389
+ await recordWebSpaceUploadFileId(clientDb, userId, finalDbKey, fileId);
1390
+ }
1370
1391
  const serversToUse = scheduleUploadReplication({
1371
1392
  currentServer,
1372
1393
  syncServers,
@@ -1403,12 +1424,13 @@ var resolveLocalFileId = (fileId) => {
1403
1424
  };
1404
1425
  var readFileContentAction = async ({
1405
1426
  fileId,
1406
- useServerFallback = true
1427
+ useServerFallback = true,
1428
+ localFileId
1407
1429
  }, thunkApi) => {
1408
1430
  if (!fileId || typeof fileId !== "string") {
1409
1431
  throw new Error("readFileContentAction requires a valid fileId string.");
1410
1432
  }
1411
- const localId = resolveLocalFileId(fileId);
1433
+ const localId = localFileId || resolveLocalFileId(fileId);
1412
1434
  const localRecord = await loadFileFromIndexedDb(localId);
1413
1435
  if (localRecord) {
1414
1436
  return {
@@ -1494,7 +1516,7 @@ var dbSlice = createSliceWithThunks({
1494
1516
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
1495
1517
  read: create.asyncThunk(
1496
1518
  async (payload, thunkApi) => {
1497
- const { readAction: readAction2 } = await import("./read-BRZHXUJ6.js");
1519
+ const { readAction: readAction2 } = await import("./read-Z2JOK6F6.js");
1498
1520
  return readAction2(payload, thunkApi);
1499
1521
  },
1500
1522
  {
@@ -1568,7 +1590,7 @@ var dbSlice = createSliceWithThunks({
1568
1590
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
1569
1591
  share: create.asyncThunk(
1570
1592
  async (config, thunkApi) => {
1571
- const { shareResourceAction } = await import("./action-WZTKEF5H.js");
1593
+ const { shareResourceAction } = await import("./action-QQOQ2LP3.js");
1572
1594
  return shareResourceAction(config, thunkApi);
1573
1595
  }
1574
1596
  ),
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YZMNK53S.js";
8
8
  import {
9
9
  resolveLocalUserId
10
- } from "./chunk-UPOW5HTG.js";
10
+ } from "./chunk-OMIXG25B.js";
11
11
  import {
12
12
  toErrorMessage
13
13
  } from "./chunk-HNMXYYJR.js";
@@ -20,17 +20,17 @@ import {
20
20
  } from "./chunk-M2EJHDJP.js";
21
21
  import {
22
22
  getModelPricing
23
- } from "./chunk-AS6L5KSD.js";
23
+ } from "./chunk-P4R5KXU7.js";
24
24
  import {
25
25
  getModelConfig
26
- } from "./chunk-CD2DK5JA.js";
26
+ } from "./chunk-OKH74FML.js";
27
27
  import {
28
28
  isRecord
29
29
  } from "./chunk-KUG52IAP.js";
30
30
  import {
31
31
  isNoloHostedProvider,
32
32
  isPlatformHostedImageModel
33
- } from "./chunk-PQ63BDV3.js";
33
+ } from "./chunk-JPXACKSW.js";
34
34
 
35
35
  // packages/core/publicAgentSeeds.ts
36
36
  var AGENT_SEED_DEFAULTS = {
@@ -5,15 +5,18 @@ import {
5
5
  ANTIGRAVITY_CLOUD_CODE_BASE_URL,
6
6
  isAntigravityCloudCodeBaseUrl,
7
7
  isAntigravityOAuthAgent
8
- } from "./chunk-CTWCZKNS.js";
8
+ } from "./chunk-6SOWMEAY.js";
9
+ import {
10
+ isAgentCredentialShared
11
+ } from "./chunk-LVZVSLKO.js";
9
12
  import {
10
13
  isOpenAiResponsesModel,
11
14
  resolvePlatformChatCompletionsEndpoint,
12
15
  resolvePlatformResponsesEndpoint
13
- } from "./chunk-ESN4WNWU.js";
16
+ } from "./chunk-2JHGUL5K.js";
14
17
  import {
15
18
  findModelConfig
16
- } from "./chunk-CD2DK5JA.js";
19
+ } from "./chunk-OKH74FML.js";
17
20
  import {
18
21
  asOptionalTrimmedString
19
22
  } from "./chunk-G3SUCT4W.js";
@@ -67,7 +70,7 @@ function hasOwnCustomProviderKey(agentConfig) {
67
70
  if (isAntigravityCloudCodeBaseUrl(endpoint)) return false;
68
71
  return Boolean(asOptionalTrimmedString(agentConfig.apiKey));
69
72
  }
70
- function resolveAgentCallPlan(agentConfig, _env) {
73
+ function resolveAgentCallPlan(agentConfig, _env, capabilities) {
71
74
  const apiKeyRef = asTrimmedLowercaseString(agentConfig.apiKeyRef);
72
75
  const provider = asTrimmedLowercaseString(
73
76
  agentConfig.provider ?? agentConfig.apiSource
@@ -149,7 +152,8 @@ function resolveAgentCallPlan(agentConfig, _env) {
149
152
  };
150
153
  }
151
154
  if (agentConfig.customProviderUrl || agentConfig.apiSource === "custom") {
152
- const transport2 = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
155
+ const useLocalCredential = capabilities?.canResolveLocalCredential === true && agentConfig.apiSource === "custom" && agentConfig.useServerProxy === false && !isAgentCredentialShared(agentConfig) && Boolean(asOptionalTrimmedString(agentConfig.credentialRef) || asOptionalTrimmedString(agentConfig.apiKey));
156
+ const transport2 = !useLocalCredential && agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
153
157
  const endpoint2 = asOptionalTrimmedString(agentConfig.customProviderUrl) ?? "";
154
158
  const upstreamWire2 = resolveCustomUpstreamWire(
155
159
  endpoint2,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-AXZ5DDLB.js";
4
+ } from "./chunk-GWS2X7TX.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-PGDM7AM2.js";
7
+ } from "./chunk-WAOHK3NJ.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-W4G25PVP.js";
10
+ } from "./chunk-2PB653F5.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-USGHJSGO.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-KX6YBIHG.js";
17
17
  import {
18
18
  applyToolSurfaceConstraints
19
- } from "./chunk-NEG5LYK5.js";
19
+ } from "./chunk-JCQ3WCQ3.js";
20
20
  import {
21
21
  ownedAgentKey
22
22
  } from "./chunk-M2EJHDJP.js";
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-4O22PGNQ.js";
39
39
  import {
40
40
  t
41
- } from "./chunk-E5RYFR7E.js";
41
+ } from "./chunk-5UYDG6HP.js";
42
42
  import {
43
43
  toErrorMessage
44
44
  } from "./chunk-HNMXYYJR.js";
@@ -8,13 +8,13 @@ import {
8
8
  import {
9
9
  resolveMachineId
10
10
  } from "./chunk-S73EPYNC.js";
11
+ import {
12
+ getDefaultCliLocalRuntimeDb
13
+ } from "./chunk-7RYODZDD.js";
11
14
  import {
12
15
  gBase64,
13
16
  isExternalSessionKind
14
17
  } from "./chunk-YJPK35HB.js";
15
- import {
16
- getDefaultCliLocalRuntimeDb
17
- } from "./chunk-BFKJ2RS3.js";
18
18
  import {
19
19
  createMemoryKey,
20
20
  createMemoryOwnerIndexKey,
@@ -12,10 +12,10 @@ import {
12
12
  } from "./chunk-4O22PGNQ.js";
13
13
  import {
14
14
  scheduleWindowsSelfUpdate
15
- } from "./chunk-TMRJGSK2.js";
15
+ } from "./chunk-FRC2DNTN.js";
16
16
  import {
17
17
  t
18
- } from "./chunk-E5RYFR7E.js";
18
+ } from "./chunk-5UYDG6HP.js";
19
19
  import {
20
20
  normalizeServerOrigin
21
21
  } from "./chunk-CF7PE763.js";
@@ -4,7 +4,7 @@ import {
4
4
  openrouterModels,
5
5
  platformHostedModels,
6
6
  zaiModels
7
- } from "./chunk-PQ63BDV3.js";
7
+ } from "./chunk-JPXACKSW.js";
8
8
 
9
9
  // packages/ai/llm/models.ts
10
10
  var withProvider = (provider) => (models) => models.map((model) => ({ ...model, provider }));
@@ -1,133 +1,3 @@
1
- // packages/cli/client/cliExitSync.ts
2
- import { AsyncLocalStorage } from "node:async_hooks";
3
- var scopes = new AsyncLocalStorage();
4
- var KNOWN_SYNC_FAILURE_CODES = /* @__PURE__ */ new Set([
5
- "owner_mismatch",
6
- "owner_origin_mismatch",
7
- "owner_grant_revoked",
8
- "owner_oauth_unavailable",
9
- "invalid_grant",
10
- "auth_no_token",
11
- "token_expired",
12
- "user_batch_authority_controlled",
13
- "tombstone_conflict"
14
- ]);
15
- var SYNC_FAILURE_CODE_RE = /"(?:code|error|reason)"\s*:\s*"([A-Za-z0-9_.:-]{1,48})"/;
16
- function classifyDialogSyncFailure(error) {
17
- if (error instanceof Error && error.name === "AbortError") return "aborted";
18
- if (error instanceof Error && error.name === "TimeoutError") return "timeout";
19
- const match = error instanceof Error ? /^remote dialog evidence write failed: HTTP (\d{3})\b([\s\S]*)$/.exec(error.message) : null;
20
- if (!match) return "transport_or_sync";
21
- const candidate = SYNC_FAILURE_CODE_RE.exec(match[2] ?? "")?.[1]?.toLowerCase();
22
- const code = candidate && KNOWN_SYNC_FAILURE_CODES.has(candidate) ? candidate : void 0;
23
- return code ? `http_${match[1]}(${code})` : `http_${match[1]}`;
24
- }
25
- function startOwnedDialogSync(fetchImpl, start) {
26
- const scope = scopes.getStore();
27
- if (!scope) return start(fetchImpl);
28
- if (scope.closed) return Promise.reject(new Error("dialog_sync_scope_closed"));
29
- const entry = { watermark: scope.entries.length + 1, httpOkRecords: 0, controller: new AbortController(), state: "pending", done: Promise.resolve() };
30
- scope.entries.push(entry);
31
- const trackedFetch = async (url, init) => {
32
- entry.controller.signal.throwIfAborted();
33
- const signal = init?.signal ? AbortSignal.any([init.signal, entry.controller.signal]) : entry.controller.signal;
34
- const response = await fetchImpl(url, { ...init, signal });
35
- signal.throwIfAborted();
36
- if (response.ok && String(url).includes("/api/v1/db/write/")) entry.httpOkRecords++;
37
- return response;
38
- };
39
- entry.done = Promise.resolve().then(() => start(trackedFetch)).then((result) => {
40
- if (entry.state === "pending") entry.state = "completed";
41
- return result;
42
- }, (error) => {
43
- if (entry.state === "pending") {
44
- entry.state = "failed";
45
- entry.failureClass = classifyDialogSyncFailure(error);
46
- }
47
- throw error;
48
- });
49
- void entry.done.catch(() => {
50
- });
51
- return entry.done;
52
- }
53
- function drain(scope, unsafeRunner = false) {
54
- if (scope.drain) return scope.drain;
55
- scope.closed = true;
56
- scope.drain = (async () => {
57
- const entries = scope.entries.slice();
58
- let timer;
59
- const abortPending = (classification) => {
60
- for (const entry of entries) if (entry.state === "pending") {
61
- entry.state = "timeout";
62
- entry.failureClass = classification;
63
- entry.controller.abort(new Error("dialog_sync_drain_stopped"));
64
- }
65
- };
66
- try {
67
- if (unsafeRunner) abortPending("runner_not_stopped");
68
- else if (entries.length) await Promise.race([
69
- Promise.allSettled(entries.map((entry) => entry.done)),
70
- new Promise((resolve) => {
71
- timer = setTimeout(() => {
72
- abortPending("timeout");
73
- resolve();
74
- }, scope.timeoutMs);
75
- })
76
- ]);
77
- } finally {
78
- if (timer) clearTimeout(timer);
79
- }
80
- const failed = entries.filter((entry) => entry.state !== "completed");
81
- for (const entry of failed) scope.output.write(`[nolo] dialog_sync ${entry.state}: watermark=${entry.watermark} httpOkRecords=${entry.httpOkRecords} class=${entry.failureClass ?? entry.state}; local history retained; remote sync incomplete.
82
- `);
83
- return failed.length === 0;
84
- })();
85
- return scope.drain;
86
- }
87
- function exitCliFromWatchdog(code, exit, stopRunner) {
88
- const scope = scopes.getStore();
89
- if (!scope) {
90
- exit(code);
91
- return Promise.resolve();
92
- }
93
- if (scope.watchdogExit) return scope.watchdogExit;
94
- scope.closed = true;
95
- scope.watchdogExit = (async () => {
96
- let stopped = false;
97
- try {
98
- stopped = await stopRunner();
99
- } catch {
100
- }
101
- if (!stopped) scope.output.write("[nolo] dialog_sync failed: class=runner_not_stopped; cancelling pending sync before hard exit.\n");
102
- const complete = await drain(scope, !stopped);
103
- exit(code === 0 || !complete ? 1 : code);
104
- })();
105
- return scope.watchdogExit;
106
- }
107
- async function runCliCommandWithSyncDrain(command, options) {
108
- const timeoutMs = Number.isFinite(options.timeoutMs) && (options.timeoutMs ?? 0) > 0 ? options.timeoutMs : 15e3;
109
- await scopes.run({ entries: [], closed: false, output: options.output, timeoutMs }, async () => {
110
- const scope = scopes.getStore();
111
- let code = 70;
112
- let commandError;
113
- let commandThrew = false;
114
- try {
115
- code = await command();
116
- } catch (error) {
117
- commandThrew = true;
118
- commandError = error;
119
- }
120
- if (scope.watchdogExit) {
121
- await scope.watchdogExit;
122
- if (commandThrew) throw commandError;
123
- return;
124
- }
125
- const complete = await drain(scope);
126
- if (commandThrew) throw commandError;
127
- await options.exit(code === 0 && !complete ? 1 : code);
128
- });
129
- }
130
-
131
1
  // packages/cli/diagnostics/normalizeError.ts
132
2
  var MAX_CAUSE_DEPTH = 4;
133
3
  var MAX_AGGREGATE_ERRORS = 8;
@@ -904,10 +774,6 @@ function getLogger(component) {
904
774
  }
905
775
 
906
776
  export {
907
- classifyDialogSyncFailure,
908
- startOwnedDialogSync,
909
- exitCliFromWatchdog,
910
- runCliCommandWithSyncDrain,
911
777
  normalizeError,
912
778
  getProcessRingBuffer,
913
779
  resolveDefaultLogPath,
@@ -206,7 +206,7 @@ async function readDocFunc(args, thunkApi) {
206
206
  throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
207
207
  }
208
208
  try {
209
- const { readAction } = await import("./read-BRZHXUJ6.js");
209
+ const { readAction } = await import("./read-Z2JOK6F6.js");
210
210
  const pageData = await readAction({ dbKey: id }, thunkApi);
211
211
  if (!pageData) {
212
212
  throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  t
3
- } from "./chunk-E5RYFR7E.js";
3
+ } from "./chunk-5UYDG6HP.js";
4
4
 
5
5
  // packages/cli/windowsSelfUpdate.ts
6
6
  import { spawn } from "node:child_process";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-X4O7FJF5.js";
11
11
  import {
12
12
  getModelContextWindow
13
- } from "./chunk-MAA42MMV.js";
13
+ } from "./chunk-2FZVXOFX.js";
14
14
  import {
15
15
  isRecord
16
16
  } from "./chunk-KUG52IAP.js";
@@ -21,7 +21,7 @@ import {
21
21
  isFireworksKimiModel,
22
22
  isNoloHostedProvider,
23
23
  resolvePlatformEffectiveModel
24
- } from "./chunk-PQ63BDV3.js";
24
+ } from "./chunk-JPXACKSW.js";
25
25
  import {
26
26
  asTrimmedLowercaseString
27
27
  } from "./chunk-QSJ3HFEF.js";