nolo-cli 0.191.0-alpha.2 → 0.191.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 (149) hide show
  1. package/{_executeModel-WQ2D4ZRH.js → _executeModel-4HQQXPN4.js} +44 -46
  2. package/{action-BHWB4MOK.js → action-HNG2JKWK.js} +3 -3
  3. package/{addContentAction-BY375D35.js → addContentAction-FEN3H2EE.js} +6 -6
  4. package/{addDialogAgentAction-HOZYOCWC.js → addDialogAgentAction-DDA6S3WS.js} +5 -5
  5. package/{agentDeleteCommand-TTCVC74A.js → agentDeleteCommand-HZFWSKED.js} +57 -59
  6. package/{agentEmailCommands-PTG35KER.js → agentEmailCommands-HRYMVHC7.js} +59 -61
  7. package/{agentListCommands-MAG736RU.js → agentListCommands-HE2CCZEW.js} +33 -31
  8. package/{agentMachineCommands-ATOZK3R5.js → agentMachineCommands-ISSULCRR.js} +23 -23
  9. package/{agentProviderCommands-XSZUCNIR.js → agentProviderCommands-4EAYN3ZY.js} +3 -3
  10. package/{agentRecordCommands-KGRPIJN5.js → agentRecordCommands-WGAMWQLA.js} +57 -59
  11. package/{agentRunCommand-75VVJTNU.js → agentRunCommand-7EQ64FIB.js} +59 -61
  12. package/{agentRunControl-6HHESKDB.js → agentRunControl-EJPBPVLU.js} +5 -5
  13. package/{agentRuntimeLocal-NAAYNHCW.js → agentRuntimeLocal-ONSIOOQB.js} +20 -20
  14. package/{agentSlice-UJPIKKKP.js → agentSlice-CHWNVAS5.js} +6 -6
  15. package/{appDeleteCommands-VDHCDVBF.js → appDeleteCommands-RNAF4V5C.js} +25 -25
  16. package/{appDeployCommands-V6UTKVXR.js → appDeployCommands-LTIZ4QH7.js} +25 -25
  17. package/{appDeployStatusCommands-4UIFSEPC.js → appDeployStatusCommands-OJJR4LDK.js} +25 -25
  18. package/{appGetCommands-XKDXLC3C.js → appGetCommands-UJZF6U4V.js} +25 -25
  19. package/{appListCommands-BELRVX2Y.js → appListCommands-M5C5BIDY.js} +25 -25
  20. package/{authCommand-RV5MQDWN.js → authCommand-RMUBRAXF.js} +11 -11
  21. package/{builtinSkillRegistry-7MBUY5EY.js → builtinSkillRegistry-XDBPVNY6.js} +3 -5
  22. package/{chromeOpsCommands-C46BXHEE.js → chromeOpsCommands-P4PFQDT7.js} +19 -4
  23. package/{chunk-7UODCAWW.js → chunk-32GANJHJ.js} +1 -1
  24. package/{chunk-G6OOUQWJ.js → chunk-4KB6WQUL.js} +2 -0
  25. package/{chunk-LHOR5MC2.js → chunk-4KYV2TAI.js} +164 -323
  26. package/{chunk-5EFNSNAV.js → chunk-6CFXWUYE.js} +7 -7
  27. package/{chunk-6XIE5ZGI.js → chunk-6HIGYUBQ.js} +1 -1
  28. package/{chunk-LBXUNNDS.js → chunk-6K2AKJAD.js} +1 -1
  29. package/{chunk-U5ZHUOLT.js → chunk-6OBTQSJ2.js} +2 -2
  30. package/{chunk-XPL63OIC.js → chunk-7SUYSFPG.js} +140 -66
  31. package/{chunk-53RSTB7T.js → chunk-7TMVGMM3.js} +26 -31
  32. package/{chunk-ZBCBFOWC.js → chunk-A2ZMIRLN.js} +2 -2
  33. package/{chunk-MJWUBTK7.js → chunk-AOYR4XOA.js} +1 -1
  34. package/{chunk-IIX6VWLW.js → chunk-AV6IE6NM.js} +224 -38
  35. package/{chunk-WFUIXNKC.js → chunk-BMXR7CFX.js} +3 -3
  36. package/{chunk-JIFYXQRD.js → chunk-BTYQAODF.js} +26 -8
  37. package/{chunk-VHGD6FHV.js → chunk-BZKBX5BO.js} +28 -5
  38. package/{chunk-Q6RMLYSA.js → chunk-CMLBKYEI.js} +4 -2
  39. package/chunk-CMTTXP5Y.js +291 -0
  40. package/{chunk-OHRDHS4N.js → chunk-CVCRAO6Q.js} +9 -4
  41. package/{chunk-SM56M7N7.js → chunk-DBRXPVWY.js} +39 -5
  42. package/{chunk-2KBNF477.js → chunk-DSVR6ZAV.js} +30 -21
  43. package/{chunk-ADTJJVDJ.js → chunk-DXDG4XLD.js} +2838 -2255
  44. package/{chunk-R5LJWMZE.js → chunk-EMXVOJDB.js} +3 -3
  45. package/{chunk-KHCLMKZZ.js → chunk-EY7V7REW.js} +280 -6
  46. package/{chunk-KGP7UTNN.js → chunk-FNXSQ7A3.js} +15 -15
  47. package/{chunk-BTBT2566.js → chunk-FSEGCTZQ.js} +1 -1
  48. package/{chunk-CNMQATUF.js → chunk-GL7W7TTR.js} +2 -2
  49. package/{chunk-5KTQVMCX.js → chunk-GOO6G4PY.js} +85 -0
  50. package/{chunk-HTLIKE5U.js → chunk-GVMF62PR.js} +2 -2
  51. package/{chunk-UZHYRBUB.js → chunk-H4CFODT7.js} +137 -61
  52. package/{chunk-R4BMKAR5.js → chunk-HAB2UDLT.js} +1 -1
  53. package/{chunk-3NPXGNSK.js → chunk-HVXL4VOO.js} +348 -87
  54. package/{chunk-32ZKZET7.js → chunk-HWZT5DKX.js} +1 -1
  55. package/{chunk-GYVLAHA4.js → chunk-IY7DGZSY.js} +10 -4
  56. package/{chunk-FEDJHD5X.js → chunk-J5Z2SSIY.js} +6 -6
  57. package/{chunk-UVWBGWBO.js → chunk-JA6WCCDO.js} +3 -3
  58. package/{chunk-YE6A72XL.js → chunk-JI5MQU5B.js} +35 -31
  59. package/{chunk-TFSMPRAY.js → chunk-JLOCKFSI.js} +4 -4
  60. package/{chunk-UBLITLAZ.js → chunk-K2GL335R.js} +13 -3
  61. package/{chunk-DS5DAOIY.js → chunk-KYQXW7DL.js} +3 -3
  62. package/{chunk-5HAPEKNH.js → chunk-LFJRTOUV.js} +158 -43
  63. package/{chunk-N7E3LQ4A.js → chunk-LGW6A7GK.js} +1 -1
  64. package/{chunk-UNOILAZP.js → chunk-M6AGLVV4.js} +74 -2
  65. package/{chunk-BA2FHPS4.js → chunk-MOCY5LJI.js} +1 -1
  66. package/{chunk-INFHX73M.js → chunk-MR6L6U46.js} +55 -3
  67. package/{chunk-CTPFBJAF.js → chunk-N7IBYQEC.js} +182 -91
  68. package/{chunk-QU3TLYBR.js → chunk-NHI3JZP4.js} +32 -8
  69. package/{chunk-B2N5GZBU.js → chunk-OHYCQKPW.js} +6 -6
  70. package/{chunk-WAZ6BTSC.js → chunk-OOERQPG5.js} +1 -1
  71. package/{chunk-EHB4CKUI.js → chunk-OTKNEZE3.js} +9 -9
  72. package/chunk-OVBUUU7L.js +2648 -0
  73. package/{chunk-PVD7CRYV.js → chunk-P7SUBTGZ.js} +3 -3
  74. package/{chunk-RJ3EYB5G.js → chunk-PRIROPK4.js} +1 -1
  75. package/chunk-PRJ473FK.js +63 -0
  76. package/{chunk-K6TZSON4.js → chunk-PXERKNSJ.js} +1 -1
  77. package/{chunk-B6EZB6DW.js → chunk-QAYCF4CH.js} +2 -2
  78. package/{chunk-5DPVRMSY.js → chunk-RBJASUX4.js} +1 -1
  79. package/{chunk-NVOYW6H4.js → chunk-RDKNGJ5M.js} +12 -8
  80. package/{chunk-GTP6VNWH.js → chunk-RQ22OZD7.js} +3 -3
  81. package/{chunk-2E5M3JVS.js → chunk-RWGIVUH3.js} +11 -5
  82. package/{chunk-DFF6B7P7.js → chunk-RXUKDHS5.js} +1 -1
  83. package/{chunk-JLR5NWP2.js → chunk-RXX262QX.js} +17 -3
  84. package/{chunk-GC64WGMD.js → chunk-SM3NSZJV.js} +16 -5
  85. package/{chunk-A5BLRE3G.js → chunk-T3U2KQF4.js} +2 -2
  86. package/{chunk-HLAL63BZ.js → chunk-T43B7LB2.js} +1 -1
  87. package/{chunk-LCSAJ5TJ.js → chunk-UDKNC3CV.js} +3 -3
  88. package/{chunk-VE3FEZIT.js → chunk-WKGOIXFV.js} +5 -5
  89. package/{chunk-4YMD7B4Y.js → chunk-WPOKOKZA.js} +2 -2
  90. package/{chunk-YIRADHSY.js → chunk-WYKMOZTW.js} +1 -1
  91. package/{chunk-WRCZXJ4N.js → chunk-X4F26D5K.js} +2 -0
  92. package/{chunk-4MYCKDSI.js → chunk-XUOF4MA7.js} +2 -2
  93. package/{chunk-PD2YRFAI.js → chunk-Y5ZEHS3F.js} +1 -1
  94. package/{chunk-4CEAZRZ4.js → chunk-YU2DGFKG.js} +1 -1
  95. package/{chunk-TVGX5QIN.js → chunk-YUA6OAH5.js} +2 -2
  96. package/{chunk-53PBXLID.js → chunk-Z3MQYKRN.js} +17 -17
  97. package/{chunk-I3HWJODB.js → chunk-ZHOKF4MY.js} +31 -26
  98. package/{chunk-2XUOREKD.js → chunk-ZI5MFQ42.js} +5 -4
  99. package/{chunk-DYQXB46J.js → chunk-ZSCIGIJS.js} +1 -1
  100. package/{commandRegistry-4JHVRMW7.js → commandRegistry-O2657YC7.js} +86 -66
  101. package/{contentThunks-HQBAAXNW.js → contentThunks-THWDEBJU.js} +17 -17
  102. package/{cooldownCommands-4XKJFEBW.js → cooldownCommands-V4EEBD55.js} +3 -3
  103. package/{createAgentAutomationAction-KELPOVMP.js → createAgentAutomationAction-2ZZTFGWG.js} +17 -17
  104. package/{createDialogAction-Z3SASMTM.js → createDialogAction-FCRKPKIT.js} +20 -22
  105. package/{createPageAction-PNHOIG44.js → createPageAction-EC25JTKW.js} +18 -19
  106. package/{dbSlice-QAUXABCC.js → dbSlice-JK7LWBDO.js} +5 -5
  107. package/{deleteFile-R5OBP7OM.js → deleteFile-CE24BROO.js} +3 -3
  108. package/{dialogCommands-4BGV6DPD.js → dialogCommands-QH7BJ3DJ.js} +26 -26
  109. package/{dialogSlice-QHV6I3OQ.js → dialogSlice-Z5E7POEN.js} +16 -16
  110. package/{docCreateCommands-3CW75UF2.js → docCreateCommands-KP42NGIF.js} +26 -27
  111. package/{docDeleteCommands-NL4ZYMN5.js → docDeleteCommands-7YOCX5GC.js} +27 -28
  112. package/{docReadCommands-HXCNVDPQ.js → docReadCommands-EJEIAOKQ.js} +26 -27
  113. package/{docStore-LVMUSECS.js → docStore-6MHLMMWO.js} +6 -6
  114. package/{docUpdateCommands-RMVBAMDE.js → docUpdateCommands-ACJLISGA.js} +26 -27
  115. package/{getPricing-E2PLNWCR.js → getPricing-3PQY3TGI.js} +3 -3
  116. package/{handleSendMessageAction-7TONIXHY.js → handleSendMessageAction-MTOPN4D3.js} +86 -42
  117. package/index.js +7 -7
  118. package/{lib-4YTWAGY7.js → lib-5KKIBFIT.js} +439 -272
  119. package/{localRuntimeAdapter-HRAB7P5E.js → localRuntimeAdapter-4USQ3EP7.js} +55 -57
  120. package/{machineCommands-OTXFRTDA.js → machineCommands-CJMSDSOO.js} +56 -58
  121. package/{machineWsRunDispatch-KWVWOHHG.js → machineWsRunDispatch-YIPO76QH.js} +56 -58
  122. package/{memberThunks-ZAE52VIP.js → memberThunks-WT2KVRP4.js} +158 -55
  123. package/{models-UUNO6DOL.js → models-PJBE6JDV.js} +2 -2
  124. package/package.json +1 -1
  125. package/{providerPresetApply-JGNMO2KX.js → providerPresetApply-ISA35424.js} +5 -5
  126. package/{providerRegistry-33J3ZYFJ.js → providerRegistry-QIQCHVNP.js} +5 -5
  127. package/{read-D6NEWSGG.js → read-ILTT75DW.js} +3 -3
  128. package/{readDocTool-NTAXO7SX.js → readDocTool-374CFJYO.js} +1 -1
  129. package/{readlineWorkspace-CEX5TXGM.js → readlineWorkspace-RORGDWZN.js} +291 -99
  130. package/{removeDialogAgentAction-YEPO5AYI.js → removeDialogAgentAction-BDLO7UC2.js} +7 -7
  131. package/{runAgentClientLoop-DCV4BD2W.js → runAgentClientLoop-CDCBSUWW.js} +41 -43
  132. package/{runtimeDoctorCommands-NYBOTA6D.js → runtimeDoctorCommands-AM2V5YVH.js} +5 -5
  133. package/{secretCommands-N6CMCJDZ.js → secretCommands-G5XYCXZB.js} +308 -1
  134. package/{setDialogExtraReferencesAction-EH5GWDAJ.js → setDialogExtraReferencesAction-GBIT7WAG.js} +6 -6
  135. package/{setPrimaryDialogAgentAction-PNWRK6IY.js → setPrimaryDialogAgentAction-PGBTR247.js} +7 -7
  136. package/{settingThunks-7VCWB6P7.js → settingThunks-XQJZVA4D.js} +38 -7
  137. package/{skillDiscovery-F3TMVQOJ.js → skillDiscovery-DO5372J5.js} +2 -3
  138. package/{spaceCommands-ZUI4CTSO.js → spaceCommands-BTSANKDH.js} +23 -23
  139. package/{streamAgentChatTurn-NKFKMFQ2.js → streamAgentChatTurn-VUF3EUMS.js} +66 -59
  140. package/{switchDialogAgentAction-23BFWJMV.js → switchDialogAgentAction-O7WTPLKG.js} +5 -5
  141. package/{tools-626VXEY7.js → tools-GAAYAIEW.js} +35 -37
  142. package/{tuiSummaryLlmCaller-FSOADMXK.js → tuiSummaryLlmCaller-MKOLOSH3.js} +11 -11
  143. package/{updateCommands-KE6LP3QX.js → updateCommands-W7TXEV7N.js} +3 -3
  144. package/{updateDialogTitleAction-RNNQAMXG.js → updateDialogTitleAction-LE2DBQDS.js} +17 -17
  145. package/{windowsSelfUpdate-26TSFXEZ.js → windowsSelfUpdate-575VQ6QO.js} +2 -2
  146. package/chunk-7KWPNGVJ.js +0 -150
  147. package/chunk-AETZ7AD6.js +0 -274
  148. package/chunk-EUGTFFO6.js +0 -42
  149. package/chunk-VYNMQ6HW.js +0 -138
@@ -1,15 +1,20 @@
1
1
  import {
2
- patch,
3
- remove,
2
+ upsertSSREntity,
4
3
  write
5
- } from "./chunk-B2N5GZBU.js";
4
+ } from "./chunk-OHYCQKPW.js";
6
5
  import {
7
- getRuntimeServerContext
8
- } from "./chunk-7UODCAWW.js";
6
+ getRuntimeServerContext,
7
+ resolveRecordAuthority
8
+ } from "./chunk-32GANJHJ.js";
9
9
  import {
10
+ TIMEOUT,
10
11
  asyncThunkCreator,
11
- buildCreateSlice
12
- } from "./chunk-WRCZXJ4N.js";
12
+ buildCreateSlice,
13
+ noloRequest
14
+ } from "./chunk-X4F26D5K.js";
15
+ import {
16
+ isLevelNotFoundError
17
+ } from "./chunk-OW765XBU.js";
13
18
  import {
14
19
  applyAgentSecretMigrationUpdates,
15
20
  migrateAgentSecrets,
@@ -24,6 +29,9 @@ import {
24
29
  import {
25
30
  isRecord
26
31
  } from "./chunk-KUG52IAP.js";
32
+ import {
33
+ API_ENDPOINTS
34
+ } from "./chunk-LCBAMY2M.js";
27
35
  import {
28
36
  createAgentKey,
29
37
  createUserKey,
@@ -36,6 +44,106 @@ import {
36
44
  asOptionalTrimmedString
37
45
  } from "./chunk-G3SUCT4W.js";
38
46
 
47
+ // packages/database/agentUpdate.ts
48
+ var AgentUpdateError = class extends Error {
49
+ kind;
50
+ status;
51
+ code;
52
+ fieldErrors;
53
+ privateSaved;
54
+ agent;
55
+ constructor(failure) {
56
+ super(failure.message ?? "Agent \u4FDD\u5B58\u5931\u8D25");
57
+ this.name = "AgentUpdateError";
58
+ this.kind = failure.kind;
59
+ Object.assign(this, failure);
60
+ }
61
+ };
62
+ var agentUpdateFailure = (error) => {
63
+ const value = error instanceof AgentUpdateError ? error : new AgentUpdateError({
64
+ kind: "server",
65
+ message: error instanceof Error ? error.message : "Agent \u4FDD\u5B58\u5931\u8D25"
66
+ });
67
+ return {
68
+ kind: value.kind,
69
+ status: value.status,
70
+ code: value.code,
71
+ fieldErrors: value.fieldErrors,
72
+ message: value.message,
73
+ ...value.privateSaved ? { privateSaved: true, agent: value.agent } : {}
74
+ };
75
+ };
76
+ async function agentRequest(server, state, path, method, body) {
77
+ const controller = new AbortController();
78
+ const timeout = setTimeout(() => controller.abort(), TIMEOUT);
79
+ try {
80
+ const response = await noloRequest(server, {
81
+ url: `${API_ENDPOINTS.DATABASE}/${path}`,
82
+ method,
83
+ ...body === void 0 ? {} : { body: JSON.stringify(body) }
84
+ }, state, controller.signal);
85
+ const result = await response.json().catch(() => ({}));
86
+ if (!response.ok) {
87
+ throw new AgentUpdateError({
88
+ kind: response.status === 403 ? "forbidden" : response.status === 409 ? "conflict" : response.status === 400 ? "validation" : "server",
89
+ status: response.status,
90
+ code: result.code ?? result.error,
91
+ fieldErrors: result.fieldErrors,
92
+ message: result.message ?? `Agent \u8BF7\u6C42\u5931\u8D25 (${response.status})`
93
+ });
94
+ }
95
+ return result;
96
+ } catch (error) {
97
+ if (error instanceof AgentUpdateError) throw error;
98
+ throw new AgentUpdateError({
99
+ kind: "network",
100
+ code: controller.signal.aborted ? "timeout" : "network_error",
101
+ message: "\u672A\u786E\u8BA4\u4FDD\u5B58\u7ED3\u679C\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u5E76\u6838\u5B9E\u670D\u52A1\u7AEF\u8BB0\u5F55\u540E\u518D\u64CD\u4F5C"
102
+ });
103
+ } finally {
104
+ clearTimeout(timeout);
105
+ }
106
+ }
107
+ async function updateAgentRecord(options) {
108
+ const { server, state, dbKey, changes } = options;
109
+ if (dbKey.startsWith("agent-local-")) {
110
+ if (!options.localDb) throw new AgentUpdateError({ kind: "conflict", code: "missing_local_database", message: "\u672C\u5730\u5B58\u50A8\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u4FDD\u5B58 Agent" });
111
+ let previous;
112
+ const storageFailure = () => new AgentUpdateError({
113
+ kind: "conflict",
114
+ code: "local_storage_error",
115
+ message: "\u672C\u5730\u5B58\u50A8\u8BFB\u5199\u5931\u8D25\uFF0C\u672A\u786E\u8BA4 Agent \u4FDD\u5B58\u7ED3\u679C\uFF0C\u8BF7\u68C0\u67E5\u8BBE\u5907\u5B58\u50A8\u540E\u91CD\u8BD5"
116
+ });
117
+ try {
118
+ previous = await options.localDb.get(dbKey);
119
+ } catch (error) {
120
+ if (!isLevelNotFoundError(error)) throw storageFailure();
121
+ }
122
+ if (!previous) throw new AgentUpdateError({ kind: "conflict", code: "local_agent_missing", message: "\u672C\u5730 Agent \u4E0D\u5B58\u5728" });
123
+ const merge = (base, patch) => {
124
+ const result2 = { ...base };
125
+ for (const [key, value] of Object.entries(patch)) {
126
+ if (value === null) delete result2[key];
127
+ else if (value !== void 0) result2[key] = typeof value === "object" && !Array.isArray(value) ? merge(result2[key], value) : value;
128
+ }
129
+ return result2;
130
+ };
131
+ const saved = merge(previous, { ...changes, isPublic: false, userId: "local" });
132
+ saved.updatedAt = Date.now();
133
+ try {
134
+ await options.localDb.put(dbKey, saved);
135
+ } catch {
136
+ throw storageFailure();
137
+ }
138
+ return saved;
139
+ }
140
+ const result = await agentRequest(server, state, `patch/${encodeURIComponent(dbKey)}`, "PATCH", changes);
141
+ if (!result.data || typeof result.data !== "object") {
142
+ throw new AgentUpdateError({ kind: "server", code: "invalid_agent_response", message: "\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u6743\u5A01 Agent \u8BB0\u5F55" });
143
+ }
144
+ return result.data;
145
+ }
146
+
39
147
  // packages/ai/chat/agentCredentialSyncClient.ts
40
148
  function buildUrl(currentServer, credentialRef) {
41
149
  return `${currentServer}/api/agent-credentials/${encodeURIComponent(credentialRef)}`;
@@ -334,6 +442,9 @@ var processAgentUpdateChanges = (data, userId, previousAgent) => {
334
442
  changes.whitelist = [];
335
443
  }
336
444
  }
445
+ for (const key of Object.keys(changes)) {
446
+ if (data[key] === null) changes[key] = null;
447
+ }
337
448
  return changes;
338
449
  };
339
450
  var slice = createSliceWithThunks({
@@ -347,7 +458,7 @@ var slice = createSliceWithThunks({
347
458
  const overrides = {};
348
459
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
349
460
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
350
- const { _executeModel } = await import("./_executeModel-WQ2D4ZRH.js");
461
+ const { _executeModel } = await import("./_executeModel-4HQQXPN4.js");
351
462
  return _executeModel(
352
463
  {
353
464
  isStreaming: args.isStreaming ?? false,
@@ -368,7 +479,7 @@ var slice = createSliceWithThunks({
368
479
  * - 循环直到无工具调用或触发其他运行时停止条件
369
480
  */
370
481
  runAgent: create.asyncThunk(async (args, thunkApi) => {
371
- const { runAgentClientLoop } = await import("./runAgentClientLoop-DCV4BD2W.js");
482
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-CDCBSUWW.js");
372
483
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
373
484
  {
374
485
  agentKey: args.agentKey,
@@ -384,7 +495,7 @@ var slice = createSliceWithThunks({
384
495
  * 聊天轮次流式 Agent 调用
385
496
  */
386
497
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
387
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-NKFKMFQ2.js");
498
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-VUF3EUMS.js");
388
499
  return streamAgentChatTurnHandler(args, thunkApi);
389
500
  }),
390
501
  /**
@@ -487,15 +598,7 @@ var slice = createSliceWithThunks({
487
598
  return agent;
488
599
  }
489
600
  ),
490
- /**
491
- * 更新 Agent(支持局部字段 patch):
492
- * - patch 私有副本
493
- * - 如提供 previousAgent,则同步更新 / 删除公共副本
494
- *
495
- * 注意:
496
- * - Tool 场景下一般不提供 previousAgent,此时只保证私有副本被更新;
497
- * 公共副本(应用市场)不做强一致保证。
498
- */
601
+ // 旧快照只能辅助凭据迁移,不能作为持久化基底;否则会覆盖服务端较新的模型。
499
602
  updateAgent: create.asyncThunk(
500
603
  async ({ userId, agentId, formData, previousAgent }, thunkApi) => {
501
604
  const effectiveUserId = asOptionalTrimmedString(userId) ?? "local";
@@ -525,85 +628,73 @@ var slice = createSliceWithThunks({
525
628
  changes.apiKey = null;
526
629
  }
527
630
  }
528
- let localExists = false;
529
631
  try {
530
- const { db } = thunkApi.extra;
531
- const localData = await db.get(privateKey);
532
- localExists = !!localData;
533
- } catch (e) {
534
- }
535
- if (localExists) {
536
- await thunkApi.dispatch(
537
- patch({
538
- dbKey: privateKey,
539
- changes
540
- })
541
- ).unwrap();
542
- } else if (previousAgent) {
543
- const merged = {
544
- ...previousAgent,
545
- ...changes,
546
- id: normalizedAgentId,
547
- type: previousAgent.type || "agent" /* AGENT */,
548
- userId: effectiveUserId
549
- };
550
- await thunkApi.dispatch(
551
- write({
552
- data: merged,
553
- customKey: privateKey,
554
- userId: effectiveUserId
555
- })
556
- ).unwrap();
557
- } else {
558
- await thunkApi.dispatch(
559
- patch({
560
- dbKey: privateKey,
561
- changes
562
- })
563
- ).unwrap();
564
- }
565
- if (previousAgent && effectiveUserId !== "local") {
566
- const wasPublic = !!previousAgent.isPublic;
567
- const hasIsPublicChange = Object.prototype.hasOwnProperty.call(
568
- changes,
569
- "isPublic"
570
- );
571
- const nowPublic = hasIsPublicChange ? !!changes.isPublic : wasPublic;
572
- if (nowPublic) {
573
- const authorName = await readAuthorNameSnapshot(
574
- thunkApi.extra?.db,
575
- effectiveUserId
576
- );
577
- const mergedPublic = withAuthorNameSnapshot(
578
- {
579
- ...previousAgent,
580
- ...changes,
632
+ const state = thunkApi.getState();
633
+ const context = getRuntimeServerContext(state);
634
+ const { currentServer } = context;
635
+ const db = thunkApi.extra?.db;
636
+ const localOnly = effectiveUserId === "local";
637
+ const authority = resolveRecordAuthority({
638
+ dbKey: privateKey,
639
+ currentServer,
640
+ currentUserId: effectiveUserId,
641
+ userAuthorityRegistry: context.userAuthorityRegistry
642
+ });
643
+ const server = authority.authorityServer ?? currentServer ?? "";
644
+ if (!server && !localOnly) throw new AgentUpdateError({
645
+ kind: "network",
646
+ code: "missing_server",
647
+ message: "\u672A\u8FDE\u63A5\u670D\u52A1\u7AEF\uFF0C\u672A\u786E\u8BA4\u4FDD\u5B58\u7ED3\u679C"
648
+ });
649
+ const saved = await updateAgentRecord({ server, state, dbKey: privateKey, changes, localDb: db });
650
+ const entity = { ...saved, dbKey: privateKey };
651
+ thunkApi.dispatch(upsertSSREntity(entity));
652
+ try {
653
+ if (db && !localOnly) await db.put(privateKey, saved);
654
+ } catch (error) {
655
+ throw new AgentUpdateError({
656
+ ...agentUpdateFailure(error),
657
+ kind: "conflict",
658
+ code: "local_cache_failed",
659
+ privateSaved: true,
660
+ agent: saved,
661
+ message: "\u79C1\u6709\u8BB0\u5F55\u5DF2\u4FDD\u5B58\uFF0C\u672C\u5730\u7F13\u5B58\u66F4\u65B0\u5931\u8D25\uFF1B\u8BF7\u52FF\u91CD\u65B0\u63D0\u4EA4\u6574\u6B21\u7F16\u8F91"
662
+ });
663
+ }
664
+ try {
665
+ if (!localOnly && saved.isPublic) {
666
+ const authorName = await readAuthorNameSnapshot(db, effectiveUserId);
667
+ const projection = withAuthorNameSnapshot({
668
+ ...saved,
581
669
  id: normalizedAgentId,
582
- type: previousAgent.type || "agent" /* AGENT */,
670
+ type: saved.type || "agent" /* AGENT */,
583
671
  userId: effectiveUserId
584
- },
585
- authorName
586
- );
587
- await thunkApi.dispatch(
588
- write({
589
- data: mergedPublic,
672
+ }, authorName);
673
+ await agentRequest(server, state, "write", "POST", {
674
+ data: projection,
590
675
  customKey: publicKey,
591
676
  userId: effectiveUserId
592
- })
593
- ).unwrap();
594
- } else if (wasPublic && !nowPublic) {
595
- await thunkApi.dispatch(remove(publicKey)).unwrap();
677
+ });
678
+ } else if (!localOnly && Object.hasOwn(changes, "isPublic") && changes.isPublic === false) {
679
+ try {
680
+ await agentRequest(server, state, `delete/${encodeURIComponent(publicKey)}`, "DELETE");
681
+ } catch (error) {
682
+ if (!(error instanceof AgentUpdateError && error.status === 404)) throw error;
683
+ }
684
+ }
685
+ } catch (error) {
686
+ throw new AgentUpdateError({
687
+ ...agentUpdateFailure(error),
688
+ code: "public_sync_failed",
689
+ privateSaved: true,
690
+ agent: saved,
691
+ message: "\u79C1\u6709\u8BB0\u5F55\u5DF2\u4FDD\u5B58\uFF0C\u516C\u5171\u526F\u672C\u540C\u6B65\u5931\u8D25\uFF1B\u8BF7\u52FF\u91CD\u65B0\u63D0\u4EA4\u6574\u6B21\u7F16\u8F91"
692
+ });
596
693
  }
694
+ return saved;
695
+ } catch (error) {
696
+ return thunkApi.rejectWithValue(agentUpdateFailure(error));
597
697
  }
598
- const base = previousAgent ?? {};
599
- const mergedPrivate = {
600
- ...base,
601
- ...changes,
602
- id: normalizedAgentId,
603
- type: base.type || "agent" /* AGENT */,
604
- userId: effectiveUserId
605
- };
606
- return mergedPrivate;
607
698
  }
608
699
  )
609
700
  })
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-HNMXYYJR.js";
4
4
  import {
5
5
  trimTrailingSlash
6
- } from "./chunk-4YMD7B4Y.js";
6
+ } from "./chunk-WPOKOKZA.js";
7
7
  import {
8
8
  commandCodeModels,
9
9
  kimiCodeModels,
@@ -14,7 +14,7 @@ import {
14
14
  qwenTokenPlanModels,
15
15
  stepfunModels,
16
16
  stepfunStepPlanModels
17
- } from "./chunk-GC64WGMD.js";
17
+ } from "./chunk-SM3NSZJV.js";
18
18
  import {
19
19
  asOptionalFiniteNumber
20
20
  } from "./chunk-WWC7I6TA.js";
@@ -26,7 +26,7 @@ import {
26
26
  PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
27
27
  PLATFORM_HOSTED_DEEPSEEK_PRO_OFF_PEAK_PRICE,
28
28
  PLATFORM_HOSTED_DEEPSEEK_PRO_PEAK_PRICE
29
- } from "./chunk-5KTQVMCX.js";
29
+ } from "./chunk-GOO6G4PY.js";
30
30
  import {
31
31
  asTrimmedLowercaseString
32
32
  } from "./chunk-QSJ3HFEF.js";
@@ -370,13 +370,17 @@ var SUBSCRIPTION_OAUTH_PROVIDERS = [
370
370
  defaultModel: "gpt-6-astra",
371
371
  defaultReasoningEffort: "medium",
372
372
  modelOptions: [
373
+ // 只列每个家族的最新代(owner 2026-11-01 决定):旧代 id 不再作为独立选项,
374
+ // 存量 agent 记录里的旧 model id 由 OAuth 通道的家族别名表透明重定向到对应
375
+ // 最新代(sol 系→6.1 Sol、terra 系→6.1 Terra、luna 系→6 Luna),不丢对话。
373
376
  { id: "gpt-6-astra", label: "GPT-6 Astra", hasVision: true, recommended: true },
374
377
  // GPT-6.1 Sol 已列入 Codex 订阅通道选型指南,但按账号灰度("when available
375
378
  // to your account and client"),未开通的账号选它会 400,不影响其他选项。
376
379
  { id: "gpt-6.1-sol", label: "GPT-6.1 Sol", hasVision: true },
377
- { id: "gpt-5.6-sol", label: "GPT-5.6 Sol", hasVision: true },
378
- { id: "gpt-5.6-terra", label: "GPT-5.6 Terra", hasVision: true },
379
- { id: "gpt-5.6-luna", label: "GPT-5.6 Luna", hasVision: true }
380
+ // GPT-6.1 Terra 上游已实测返回元数据,同样按账号级白名单灰度,未开通的账号选它会 400,不影响其他选项。
381
+ { id: "gpt-6.1-terra", label: "GPT-6.1 Terra", hasVision: true },
382
+ // GPT-6 Luna 是 luna 家族的上游最新代(无 6.1-luna);更老的 gpt-5.6-luna 重定向到它。
383
+ { id: "gpt-6-luna", label: "GPT-6 Luna", hasVision: true }
380
384
  ]
381
385
  },
382
386
  {
@@ -493,8 +497,9 @@ var SUBSCRIPTION_OAUTH_PROVIDERS = [
493
497
  { id: "claude-sonnet-4-6", label: "Claude Sonnet 4.6", hasVision: true },
494
498
  { id: "gpt-6-astra-medium", label: "GPT-6 Astra Medium", hasVision: true },
495
499
  { id: "gpt-6-astra-high", label: "GPT-6 Astra High", hasVision: true },
496
- // GPT-6 Sol/Luna 已随上游上线(medium/high 档实测可调);chatgpt OAuth
497
- // 的 Codex 后端目前只放出 gpt-6-astra,Sol/Luna 在该通道仍 400。
500
+ // GPT-6 Sol/Luna 已随上游上线(medium/high 档实测可调)。注:2026-11-01 实测
501
+ // chatgpt OAuth 的 Codex 后端已放出 gpt-6-sol / gpt-6-luna(responses 返回 200),
502
+ // 该通道「Sol/Luna 仍 400」的旧结论已过时。
498
503
  { id: "gpt-6-sol-medium", label: "GPT-6 Sol Medium", hasVision: true },
499
504
  { id: "gpt-6-sol-high", label: "GPT-6 Sol High", hasVision: true },
500
505
  { id: "gpt-6-luna-medium", label: "GPT-6 Luna Medium", hasVision: true },
@@ -844,6 +849,25 @@ var CUSTOM_API_KEY_TEMPLATES = [
844
849
  defaultModel: "deepseek-ai/DeepSeek-V4.1-Flash",
845
850
  commercialKind: "api",
846
851
  accessVariant: "metered_key"
852
+ },
853
+ // LongCat 官方 API(longcat.chat / longcat.ai):高性能 Agentic 模型,
854
+ // 1M 上下文、最大输出 256K tokens,OpenAI 兼容格式。
855
+ {
856
+ kind: "api_key_template",
857
+ id: "longcat-api",
858
+ label: "LongCat API",
859
+ description: "LongCat \u5B98\u65B9\u5F00\u653E\u5E73\u53F0\uFF08\u9AD8\u6027\u80FD Agentic \u6A21\u578B\uFF0C1M \u4E0A\u4E0B\u6587\uFF0COpenAI \u517C\u5BB9\uFF09",
860
+ provider: "longcat",
861
+ baseUrl: "https://api.longcat.chat/openai/v1",
862
+ defaultModel: "LongCat-2.5",
863
+ modelOptions: [
864
+ { id: "LongCat-2.5", label: "LongCat 2.5", recommended: true },
865
+ { id: "LongCat-2.5-Preview", label: "LongCat 2.5 Preview" },
866
+ { id: "LongCat-2.0", label: "LongCat 2.0" }
867
+ ],
868
+ keyFormatHint: "\u5728 longcat.chat \u63A7\u5236\u53F0 API Keys \u83B7\u53D6\uFF08\u5F62\u5982 ak_\u2026\uFF09\u3002",
869
+ commercialKind: "api",
870
+ accessVariant: "metered_key"
847
871
  }
848
872
  ];
849
873
  var ALL_PROVIDER_REGISTRY = [
@@ -6,12 +6,12 @@ import {
6
6
  loadFileFromIndexedDb,
7
7
  removeAction,
8
8
  saveFileToIndexedDb
9
- } from "./chunk-BA2FHPS4.js";
9
+ } from "./chunk-MOCY5LJI.js";
10
10
  import {
11
11
  readAction,
12
12
  readRequestManager,
13
13
  resolveAgentReadServers
14
- } from "./chunk-LBXUNNDS.js";
14
+ } from "./chunk-6K2AKJAD.js";
15
15
  import {
16
16
  beginWriteAck,
17
17
  compareRemoteRecordsByComparableTime,
@@ -28,13 +28,13 @@ import {
28
28
  shouldReplaceLocalWithRemoteRecord,
29
29
  shouldReplicateLocalRecord,
30
30
  uploadToCurrentServer
31
- } from "./chunk-7UODCAWW.js";
31
+ } from "./chunk-32GANJHJ.js";
32
32
  import {
33
33
  asyncThunkCreator,
34
34
  buildCreateSlice,
35
35
  createEntityAdapter,
36
36
  noloDeleteRequest
37
- } from "./chunk-WRCZXJ4N.js";
37
+ } from "./chunk-X4F26D5K.js";
38
38
  import {
39
39
  fetchFromClientDb,
40
40
  fetchFromServer,
@@ -708,7 +708,7 @@ var dbSlice = createSliceWithThunks({
708
708
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
709
709
  read: create.asyncThunk(
710
710
  async (payload, thunkApi) => {
711
- const { readAction: readAction2 } = await import("./read-D6NEWSGG.js");
711
+ const { readAction: readAction2 } = await import("./read-ILTT75DW.js");
712
712
  return readAction2(payload, thunkApi);
713
713
  },
714
714
  {
@@ -782,7 +782,7 @@ var dbSlice = createSliceWithThunks({
782
782
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
783
783
  share: create.asyncThunk(
784
784
  async (config, thunkApi) => {
785
- const { shareResourceAction } = await import("./action-BHWB4MOK.js");
785
+ const { shareResourceAction } = await import("./action-HNG2JKWK.js");
786
786
  return shareResourceAction(config, thunkApi);
787
787
  }
788
788
  ),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  t
3
- } from "./chunk-UNOILAZP.js";
3
+ } from "./chunk-M6AGLVV4.js";
4
4
 
5
5
  // packages/cli/windowsSelfUpdate.ts
6
6
  import { spawn } from "node:child_process";
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-HS7MLR74.js";
4
4
  import {
5
5
  performServerProxyFetchWithRetry
6
- } from "./chunk-FEDJHD5X.js";
6
+ } from "./chunk-J5Z2SSIY.js";
7
7
  import {
8
8
  fetchServerSyncedCredential
9
- } from "./chunk-CTPFBJAF.js";
9
+ } from "./chunk-N7IBYQEC.js";
10
10
  import {
11
11
  buildSkillGuidancePromptBlock
12
- } from "./chunk-5HAPEKNH.js";
12
+ } from "./chunk-LFJRTOUV.js";
13
13
  import {
14
14
  CREDENTIAL_HYGIENE_RULE,
15
15
  DELETE_SAFETY_RED_LINE,
@@ -23,7 +23,7 @@ import {
23
23
  compileContextLayers,
24
24
  detectDispatchIntentFromMessages,
25
25
  resolveToolGuidedSections
26
- } from "./chunk-I3HWJODB.js";
26
+ } from "./chunk-ZHOKF4MY.js";
27
27
  import {
28
28
  convertMessagesToResponsesInput,
29
29
  getUsageRequestOptions,
@@ -32,11 +32,11 @@ import {
32
32
  resolveReasoningReplayOptions,
33
33
  shouldStripReasoningContentForOutbound,
34
34
  stablePromptCacheKey
35
- } from "./chunk-OHRDHS4N.js";
35
+ } from "./chunk-CVCRAO6Q.js";
36
36
  import {
37
37
  resolveAgentCallPlan,
38
38
  resolveClientWire
39
- } from "./chunk-WFUIXNKC.js";
39
+ } from "./chunk-BMXR7CFX.js";
40
40
  import {
41
41
  createFileCredentialBroker
42
42
  } from "./chunk-76YUTLOT.js";
@@ -53,12 +53,12 @@ import {
53
53
  } from "./chunk-HNMXYYJR.js";
54
54
  import {
55
55
  buildProviderAuthHeaders
56
- } from "./chunk-4YMD7B4Y.js";
56
+ } from "./chunk-WPOKOKZA.js";
57
57
  import {
58
58
  clampReasoningEffort,
59
59
  getModelConfig,
60
60
  isModelSupportReasoningEffort
61
- } from "./chunk-GC64WGMD.js";
61
+ } from "./chunk-SM3NSZJV.js";
62
62
  import {
63
63
  isRecord
64
64
  } from "./chunk-KUG52IAP.js";
@@ -79,7 +79,7 @@ import {
79
79
  isFireworksKimiModel,
80
80
  isPlatformMimoProviderModel,
81
81
  resolveFireworksKimiModel
82
- } from "./chunk-5KTQVMCX.js";
82
+ } from "./chunk-GOO6G4PY.js";
83
83
 
84
84
  // packages/agent-runtime/responsesConversationState.ts
85
85
  function supportsResponsesConversationState(agent) {