nolo-cli 0.11.0 → 0.12.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 (123) hide show
  1. package/{_executeModel-ZEDPX6OF.js → _executeModel-MWAY74HA.js} +51 -50
  2. package/{action-AA4IJ5K2.js → action-RAXNQQKC.js} +8 -9
  3. package/{addContentAction-QYVO4SYP.js → addContentAction-ZHI7TVV3.js} +7 -9
  4. package/{addDialogAgentAction-WVVKT5WQ.js → addDialogAgentAction-JWXPKXNC.js} +9 -10
  5. package/{agentDeleteCommand-RDPGYIWF.js → agentDeleteCommand-LXR5A5FV.js} +38 -28
  6. package/{agentEmailCommands-2HJJKS5F.js → agentEmailCommands-DXRAP7BB.js} +64 -62
  7. package/{agentListCommands-HFEVV3ZW.js → agentListCommands-ZFMS5ZLY.js} +127 -31
  8. package/{agentMachineCommands-25ZOENJU.js → agentMachineCommands-ZJLYVV52.js} +37 -26
  9. package/{agentPullCommand-GOL2S4W2.js → agentPullCommand-KRBRIFIY.js} +7 -7
  10. package/{agentRecordCommands-GTCOAM3L.js → agentRecordCommands-DFS626TB.js} +56 -54
  11. package/{agentRunCommand-YBS3JDLD.js → agentRunCommand-GWBIE2TS.js} +59 -59
  12. package/{agentRunControl-K4VKNEHF.js → agentRunControl-IX4F5W2C.js} +3 -3
  13. package/{agentRuntimeLocal-UQBMQI2M.js → agentRuntimeLocal-YNZSHMZC.js} +30 -15
  14. package/{agentSlice-6EKOBCCS.js → agentSlice-T2PXOEPQ.js} +8 -9
  15. package/{authCommand-O2OWACN4.js → authCommand-DMW336GT.js} +15 -15
  16. package/{authCommands-H7365TZP.js → authCommands-GH5T6RYV.js} +6 -6
  17. package/{chunk-7D3JY6C2.js → chunk-3HHTVM6G.js} +64 -5
  18. package/{chunk-AFON4QUU.js → chunk-3QKO4EHV.js} +3 -3
  19. package/{chunk-4SOKXIW4.js → chunk-43UD5ZP7.js} +8 -11
  20. package/{chunk-S3GS2PRL.js → chunk-4BTHUYMY.js} +597 -68
  21. package/{chunk-SV5MWASH.js → chunk-4EH7AR52.js} +12 -12
  22. package/{chunk-FXXSGWAJ.js → chunk-4GBNEA5B.js} +1 -1
  23. package/{chunk-PXZAAB4L.js → chunk-4LG74DRG.js} +4 -4
  24. package/{chunk-2FTTDCD4.js → chunk-4ON5AV72.js} +2 -1
  25. package/{chunk-IWX4UW2E.js → chunk-524BDL33.js} +89 -8
  26. package/{chunk-X2S7JTIG.js → chunk-5ITRDSHY.js} +1240 -136
  27. package/{chunk-ISNCLGUZ.js → chunk-5NBHQD4D.js} +4 -3
  28. package/{chunk-GBDSZATH.js → chunk-6LMFFG3K.js} +3 -3
  29. package/{chunk-OUI3ZHYD.js → chunk-6OVCRC72.js} +1 -1
  30. package/{chunk-CKOJQDKR.js → chunk-7JJCGV7N.js} +146 -3
  31. package/{chunk-MQI77IRB.js → chunk-7MYHLZ3F.js} +2 -2
  32. package/{chunk-5MOUAAMK.js → chunk-AM53Q2SD.js} +194 -2564
  33. package/chunk-BYXBJQAS.js +0 -0
  34. package/{chunk-LAX2JSTX.js → chunk-DE5BA4O6.js} +20 -2
  35. package/{chunk-BX6U3ETE.js → chunk-DRMGJFGQ.js} +293 -89
  36. package/{chunk-KJR5KAUQ.js → chunk-EBH7G34M.js} +20 -7
  37. package/{chunk-E4HNJSHC.js → chunk-G3B356GF.js} +16 -18
  38. package/{chunk-KQQVGRA3.js → chunk-GDBCUWQ3.js} +35 -29
  39. package/{chunk-Q3UKJVU4.js → chunk-GPZM7QH6.js} +10 -10
  40. package/chunk-IKXL2HZ3.js +70 -0
  41. package/{chunk-QNMFBBZK.js → chunk-IVAOVLM7.js} +1 -1
  42. package/{chunk-EVZKZF32.js → chunk-JUN3HFMN.js} +182 -75
  43. package/{chunk-NEM67FX7.js → chunk-JZDIW766.js} +1 -1
  44. package/{chunk-TACHTH5D.js → chunk-LHSJMY5V.js} +18 -18
  45. package/{chunk-XYZA7S7V.js → chunk-MEVCDATU.js} +6 -6
  46. package/{chunk-YOCHZD7D.js → chunk-NCGFB7NN.js} +5 -3
  47. package/{chunk-O26GI2JP.js → chunk-NITP2JDG.js} +39 -8
  48. package/{chunk-YPRZSPF3.js → chunk-OCDEWRE2.js} +1 -1
  49. package/{chunk-PNEW2Z3T.js → chunk-OHEKYYJF.js} +7 -7
  50. package/chunk-OOIN7HSO.js +146 -0
  51. package/{chunk-DWGAEFJL.js → chunk-OPKKB25T.js} +1 -1
  52. package/{chunk-AEZAORLG.js → chunk-QCA3EPYK.js} +5 -5
  53. package/{chunk-C4FTUXVF.js → chunk-QLUFR47U.js} +11 -1
  54. package/{chunk-C2MDQQ4O.js → chunk-RNQ5BLR2.js} +1 -1
  55. package/{chunk-L53FGHA4.js → chunk-RSEUHW6T.js} +1 -1
  56. package/{chunk-2W2VYVI5.js → chunk-RZ735TLX.js} +527 -176
  57. package/chunk-S3UTETIC.js +4885 -0
  58. package/chunk-S73OEOHH.js +2286 -0
  59. package/{chunk-YTBMA7NO.js → chunk-TSKWE74T.js} +58 -8
  60. package/{chunk-5OIFWVX7.js → chunk-UG3WOFU6.js} +1 -1
  61. package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
  62. package/{chunk-IPYUUY4E.js → chunk-WPHL6ALY.js} +1 -1
  63. package/{chunk-3NSIQZZ6.js → chunk-WTYKCU4W.js} +9 -9
  64. package/{chunk-LP65VRCI.js → chunk-WWU275LU.js} +6 -6
  65. package/{chunk-XFOLQLDN.js → chunk-XHQWJUW4.js} +2 -2
  66. package/{chunk-D6OQHXVG.js → chunk-YDCZVUFP.js} +7 -7
  67. package/{chunk-PXQN7IBQ.js → chunk-YTQLJYLB.js} +2 -2
  68. package/{chunk-ZEYDOXHF.js → chunk-ZPFRLGIZ.js} +1467 -869
  69. package/{chunk-ZPRK73XY.js → chunk-ZR4VHQ5D.js} +14 -13
  70. package/cliEnvHelpers-VYC2OPTB.js +30 -0
  71. package/{createAgentAutomationAction-LTI5QU35.js → createAgentAutomationAction-G32GKDGV.js} +25 -26
  72. package/{createDialogAction-OJJ7L3L3.js → createDialogAction-TISANRZK.js} +26 -27
  73. package/{createPageAction-5MXWVRGY.js → createPageAction-O7KOYNV4.js} +26 -27
  74. package/{dbSlice-RQFQQVHT.js → dbSlice-WDP2ZZHK.js} +6 -7
  75. package/{deleteFile-7XP5BGC7.js → deleteFile-M7UNIUOO.js} +4 -4
  76. package/{dialogCommands-JTJ3RPPW.js → dialogCommands-6JPB3YQY.js} +33 -23
  77. package/{dialogSlice-OWROKURJ.js → dialogSlice-PRHHYSP5.js} +26 -27
  78. package/{docCreateCommands-WJBEW2V7.js → docCreateCommands-75E6TZNN.js} +33 -23
  79. package/{docDeleteCommands-BVEHJOY5.js → docDeleteCommands-EJHLN7LW.js} +34 -25
  80. package/{docReadCommands-NEWOZIJV.js → docReadCommands-RJYBC4FS.js} +33 -23
  81. package/{docStore-3DXRYBMD.js → docStore-H5VWKT5D.js} +25 -26
  82. package/{docUpdateCommands-C7WHT7UU.js → docUpdateCommands-MG4CNISV.js} +33 -23
  83. package/fetchMessages-KTNM7QAR.js +1 -1
  84. package/{getPricing-3E6UNPKL.js → getPricing-6TOZXPAU.js} +7 -3
  85. package/{handleSendMessageAction-B5PRR7BE.js → handleSendMessageAction-QTUGICSZ.js} +29 -30
  86. package/index.js +77 -76
  87. package/{localDialogRead-YSKFFRTT.js → localDialogRead-2VRI24F4.js} +1 -1
  88. package/{machineCommands-IIIREAEK.js → machineCommands-MAV7M3TK.js} +63 -61
  89. package/{machineWsRunDispatch-3SIU6ILW.js → machineWsRunDispatch-ZOEGTKHC.js} +55 -53
  90. package/{memoryCommands-O4MIPIWQ.js → memoryCommands-AFMES3LN.js} +5 -5
  91. package/{models-4OPOOLFS.js → models-LSCRJJ6P.js} +2 -2
  92. package/package.json +1 -1
  93. package/{read-QJNKRROM.js → read-2MIMRBZ2.js} +4 -4
  94. package/{readDocTool-H6X6KO6X.js → readDocTool-QHVGQHUJ.js} +1 -1
  95. package/{readlineWorkspace-HGP3I3OC.js → readlineWorkspace-SWQKC7ZS.js} +1113 -678
  96. package/{removeDialogAgentAction-TCT35SOF.js → removeDialogAgentAction-GTX5AN54.js} +13 -13
  97. package/{runAgentClientLoop-EFM4PTVI.js → runAgentClientLoop-P25HACXX.js} +47 -47
  98. package/{runtimeDoctorCommands-ID43Z7VX.js → runtimeDoctorCommands-QNF3J3UV.js} +6 -6
  99. package/{setDialogExtraReferencesAction-CGYLZMFH.js → setDialogExtraReferencesAction-WFQ63KYO.js} +9 -10
  100. package/{setPrimaryDialogAgentAction-F6BFQDJU.js → setPrimaryDialogAgentAction-P57FXTSU.js} +13 -13
  101. package/{settingSlice-2I5HMG47.js → settingSlice-CK5YZGNI.js} +7 -8
  102. package/{skillDiscovery-UGSQGX2U.js → skillDiscovery-ZYHSX7VD.js} +3 -3
  103. package/{spaceCommands-MT7BWCIL.js → spaceCommands-6O5EFEM5.js} +37 -29
  104. package/{spaceSlice-BS5TSW3W.js → spaceSlice-4EXTYXS4.js} +28 -27
  105. package/{streamAgentChatTurn-I3VBFNR3.js → streamAgentChatTurn-Q3FJAHG2.js} +222 -128
  106. package/{toolApiClient-C7P7YSE4.js → toolApiClient-QI3YBNWB.js} +2 -2
  107. package/{tools-XSD2BOEN.js → tools-AHNQE4GP.js} +34 -34
  108. package/{tuiSummaryLlmCaller-32NRHTT2.js → tuiSummaryLlmCaller-TXLF4MEI.js} +8 -6
  109. package/{updateCommands-VOSPKXFF.js → updateCommands-XZDOOYFH.js} +13 -5
  110. package/{updateDialogTitleAction-7FYNJOGP.js → updateDialogTitleAction-XZDVLKVX.js} +29 -29
  111. package/chunk-5MMAK75Q.js +0 -15
  112. package/chunk-AZPCASRE.js +0 -36
  113. package/chunk-BBYVOSU2.js +0 -792
  114. package/chunk-DCOA4QSN.js +0 -105
  115. package/chunk-UAD2WT54.js +0 -64
  116. package/{chunk-JK7VW2FN.js → chunk-5MIDPSSK.js} +3 -3
  117. package/{chunk-5CS33IBL.js → chunk-PDL2AV3E.js} +3 -3
  118. package/{chunk-5MMZUWSG.js → chunk-TOILAPLH.js} +5 -5
  119. package/{chunk-OOM6SJNR.js → chunk-TSUJOM6N.js} +6 -6
  120. package/{db-6QED3ZVO.js → db-HCJ5PRB5.js} +3 -3
  121. package/{offlineMarxistsAgentCommand-BCPJITJL.js → offlineMarxistsAgentCommand-5OOWZLJI.js} +3 -3
  122. package/{tableCommands-M3DJUETS.js → tableCommands-E4SQWDOX.js} +6 -6
  123. package/{understanding-ZOESBLF3.js → understanding-3CUQQ6SV.js} +3 -3
@@ -1,20 +1,21 @@
1
1
  import {
2
2
  ANTIGRAVITY_CLOUD_CODE_BASE_URL,
3
3
  isAntigravityOAuthAgent
4
- } from "./chunk-FXXSGWAJ.js";
4
+ } from "./chunk-4GBNEA5B.js";
5
5
  import {
6
6
  clipMultilineText,
7
- fetchAndSerializeTable
8
- } from "./chunk-2W2VYVI5.js";
7
+ fetchAndSerializeTable,
8
+ waitForAbortableDelay
9
+ } from "./chunk-RZ735TLX.js";
9
10
  import {
10
11
  CORE_DRAIN_REASON,
11
12
  isGatewayHttpStatus,
12
13
  normalizeNonNegativeMs,
13
14
  parseRetryAfterHeaderMs
14
- } from "./chunk-D6OQHXVG.js";
15
+ } from "./chunk-YDCZVUFP.js";
15
16
  import {
16
17
  slateToSimplifiedMarkdown
17
- } from "./chunk-QNMFBBZK.js";
18
+ } from "./chunk-IVAOVLM7.js";
18
19
  import {
19
20
  extractCategorizedMentions
20
21
  } from "./chunk-VP4WJWKW.js";
@@ -22,77 +23,81 @@ import {
22
23
  resolvePageSkillMetadata
23
24
  } from "./chunk-VC6OZXO5.js";
24
25
  import {
25
- estimateTokenCount,
26
26
  fetchAndCacheMessages,
27
27
  shouldUseServerProxy
28
- } from "./chunk-5MOUAAMK.js";
28
+ } from "./chunk-AM53Q2SD.js";
29
29
  import {
30
30
  fetchServerSyncedCredential
31
- } from "./chunk-Q3UKJVU4.js";
32
- import {
33
- createSpaceKey
34
- } from "./chunk-UAD2WT54.js";
35
- import {
36
- read
37
- } from "./chunk-O26GI2JP.js";
38
- import {
39
- MEMORY_USE_GUIDANCE,
40
- wrapHistoricalSummaryWithReplayGuard
41
- } from "./chunk-KKY4B2Q2.js";
31
+ } from "./chunk-GPZM7QH6.js";
42
32
  import {
43
33
  buildCurrentTimeBlock,
44
34
  buildIdentityBlock,
45
35
  buildRuntimeGuidanceBlocks
46
- } from "./chunk-OUI3ZHYD.js";
36
+ } from "./chunk-6OVCRC72.js";
47
37
  import {
48
- OPENAI_RESPONSES_ENDPOINT,
49
38
  buildProviderAuthHeaders,
50
39
  convertMessagesToResponsesInput,
51
40
  isOpenAiResponsesModel,
52
- resolvePlatformChatCompletionsEndpoint
53
- } from "./chunk-YTBMA7NO.js";
41
+ preserveAgentStateFields,
42
+ resolvePlatformChatCompletionsEndpoint,
43
+ resolvePlatformResponsesEndpoint
44
+ } from "./chunk-TSKWE74T.js";
54
45
  import {
55
46
  canonicalizeToolNames
56
- } from "./chunk-4SOKXIW4.js";
47
+ } from "./chunk-43UD5ZP7.js";
48
+ import {
49
+ estimateTokenCount
50
+ } from "./chunk-S73OEOHH.js";
57
51
  import {
52
+ clampReasoningEffort,
58
53
  getModelConfig,
59
54
  isModelSupportReasoningEffort
60
- } from "./chunk-BBYVOSU2.js";
55
+ } from "./chunk-S3UTETIC.js";
61
56
  import {
62
57
  createFileCredentialBroker
63
- } from "./chunk-5CS33IBL.js";
58
+ } from "./chunk-PDL2AV3E.js";
59
+ import {
60
+ MEMORY_USE_GUIDANCE,
61
+ wrapHistoricalSummaryWithReplayGuard
62
+ } from "./chunk-KKY4B2Q2.js";
63
+ import {
64
+ extractCustomId
65
+ } from "./chunk-DFFIZ25G.js";
66
+ import {
67
+ toErrorMessage
68
+ } from "./chunk-HNMXYYJR.js";
64
69
  import {
65
70
  isDeepInfraKimiModel,
66
71
  isFireworksKimiModel,
67
72
  resolveFireworksKimiModel
68
- } from "./chunk-IWX4UW2E.js";
73
+ } from "./chunk-524BDL33.js";
74
+ import {
75
+ createSpaceKey
76
+ } from "./chunk-3HHTVM6G.js";
77
+ import {
78
+ read
79
+ } from "./chunk-NITP2JDG.js";
69
80
  import {
70
81
  asNonEmptyStringArray
71
82
  } from "./chunk-I42VC5KR.js";
72
- import {
73
- extractCustomId
74
- } from "./chunk-DFFIZ25G.js";
75
83
  import {
76
84
  asTrimmedLowercaseString
77
85
  } from "./chunk-QSJ3HFEF.js";
78
- import {
79
- toErrorMessage
80
- } from "./chunk-HNMXYYJR.js";
81
86
  import {
82
87
  getRuntimeServerContext
83
- } from "./chunk-OOM6SJNR.js";
88
+ } from "./chunk-TSUJOM6N.js";
84
89
  import {
85
90
  isAbortError
86
91
  } from "./chunk-OOSFSFMA.js";
87
92
  import {
88
93
  asTrimmedString
89
94
  } from "./chunk-3EUW3WEO.js";
90
- import {
91
- isLoopbackUrl
92
- } from "./chunk-4SN6J65J.js";
93
95
  import {
94
96
  API_ENDPOINTS
95
97
  } from "./chunk-LCBAMY2M.js";
98
+ import {
99
+ isLoopbackUrl
100
+ } from "./chunk-4SN6J65J.js";
96
101
  import {
97
102
  asOptionalTrimmedString
98
103
  } from "./chunk-G3SUCT4W.js";
@@ -408,6 +413,45 @@ var resolveToolsFromKeys = async (keys, dispatch, preloaded) => {
408
413
  };
409
414
  };
410
415
 
416
+ // packages/agent-runtime/responsesConversationState.ts
417
+ function supportsResponsesConversationState(agent) {
418
+ return normalizeIdentityPart(agent.provider) === "openai";
419
+ }
420
+ var normalizeIdentityPart = (value) => typeof value === "string" ? value.trim().toLowerCase() : "";
421
+ function normalizeResponsesConversationState(value) {
422
+ if (!value || typeof value !== "object") return null;
423
+ const raw = value;
424
+ const provider = normalizeIdentityPart(raw.provider);
425
+ const model = normalizeIdentityPart(raw.model);
426
+ const responseId = typeof raw.responseId === "string" ? raw.responseId.trim() : "";
427
+ if (!provider || !model || !responseId) return null;
428
+ return { provider, model, responseId };
429
+ }
430
+ function selectResponsesConversationState(value, agent) {
431
+ if (!supportsResponsesConversationState(agent)) return null;
432
+ const state = normalizeResponsesConversationState(value);
433
+ if (!state) return null;
434
+ if (state.provider !== normalizeIdentityPart(agent.provider)) return null;
435
+ if (state.model !== normalizeIdentityPart(agent.model)) return null;
436
+ return state;
437
+ }
438
+ function updateResponsesConversationState(agent, responseId) {
439
+ if (!supportsResponsesConversationState(agent)) return null;
440
+ const provider = normalizeIdentityPart(agent.provider);
441
+ const model = normalizeIdentityPart(agent.model);
442
+ const normalizedResponseId = typeof responseId === "string" ? responseId.trim() : "";
443
+ if (!provider || !model || !normalizedResponseId) return null;
444
+ return { provider, model, responseId: normalizedResponseId };
445
+ }
446
+ function isResponsesConversationStateRejection(status, responseBody) {
447
+ if (![400, 404, 409].includes(status)) return false;
448
+ const text = typeof responseBody === "string" ? responseBody.trim().toLowerCase() : "";
449
+ if (!text) return false;
450
+ const mentionsResponseState = /previous[\s_-]*response/.test(text) || /response[\s_-]*(?:id|state)/.test(text);
451
+ const rejectsState = /not[\s_-]*found/.test(text) || /does not exist/.test(text) || /invalid/.test(text) || /expired/.test(text) || /unknown/.test(text);
452
+ return mentionsResponseState && rejectsState;
453
+ }
454
+
411
455
  // packages/agent-runtime/agentCallPlan.ts
412
456
  var CODEX_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses";
413
457
  var CURSOR_AGENT_URL = "https://api2.cursor.sh/agent.v1.AgentService/Run";
@@ -523,7 +567,7 @@ function resolveAgentCallPlan(agentConfig, _env) {
523
567
  endpointKey: agentConfig.endpointKey
524
568
  });
525
569
  const upstreamWire = useResponses ? "responses" : "chat.completions";
526
- const endpoint = useResponses ? OPENAI_RESPONSES_ENDPOINT : resolvePlatformChatCompletionsEndpoint(provider) ?? "";
570
+ const endpoint = useResponses ? resolvePlatformResponsesEndpoint(provider) ?? "" : resolvePlatformChatCompletionsEndpoint(provider) ?? "";
527
571
  return {
528
572
  authMethod: { kind: "platform-key" },
529
573
  transport,
@@ -662,7 +706,7 @@ function createHash(_algo) {
662
706
  };
663
707
  }
664
708
  var hasLayerContent = (layer) => Boolean(layer.content);
665
- var estimateContextTokens = (content) => Math.ceil(content.length / 4);
709
+ var estimateContextTokens = (content) => estimateTokenCount(content);
666
710
  var compileContextLayers = (layers) => {
667
711
  const compiledLayers = [];
668
712
  for (const layer of layers) {
@@ -711,10 +755,22 @@ var CONTEXT_USAGE_INSTRUCTIONS = `\u53C2\u8003\u8D44\u6599\u4F7F\u7528\u8BF4\u66
711
755
  - \u5F53\u901A\u7528\u6307\u4EE4\u4E0E\u66F4\u5177\u4F53\u7684"\u6309 Agent / \u6309\u6587\u6863"\u7684\u89C4\u5219\u53D1\u751F\u51B2\u7A81\u65F6\uFF0C\u5FC5\u987B\u4F18\u5148\u9075\u5B88\u66F4\u5177\u4F53\u3001\u4F18\u5148\u7EA7\u66F4\u9AD8\u7684\u89C4\u5219\u3002`;
712
756
  var AGENT_ORCHESTRATION_RUN_INSTRUCTIONS = `--- \u591A Agent \u7F16\u6392\uFF08\u540E\u53F0 Run\uFF09 ---
713
757
  \u4F60\u53EF\u7528 startAgentRun \u540E\u53F0\u542F\u52A8\u5B50 Agent\uFF08fork+exec\uFF0C\u8FD4\u56DE runId\uFF09\uFF0C\u7528 controlAgentRun \u89C2\u5BDF/\u505C\u6B62\uFF08wait+signal+proc\uFF09\u3002\u6838\u5FC3\u7EAA\u5F8B\uFF08\u53CD\u9762\u6559\u6750\uFF1A\u5B50\u4EE3\u7406\u5D29\u6E83/\u6302\u8D77\u800C\u7F16\u6392\u5668\u6BEB\u65E0\u5BDF\u89C9\uFF09\uFF1A
714
- 1. \u6D3E\u53D1\u540E\u5FC5\u987B\u8F6E\u8BE2\u3002startAgentRun \u62FF\u5230 runId \u540E\uFF0C\u7528 controlAgentRun(action:"status", runId, tailLines:30) \u8F6E\u8BE2\uFF08\u5EFA\u8BAE 5\u201310s \u4E00\u6B21\uFF09\uFF0C\u4E0D\u8981\u53EA\u9760\u804A\u5929\u590D\u8FF0\u7ED3\u679C\u3002\u4E0D\u8F6E\u8BE2 = \u6CA1\u7F16\u6392\u3002
715
- 2. \u8BFB\u65E5\u5FD7\u786E\u8BA4\u8FDB\u5C55\u3002tailLines>0 \u8BFB\u5B9E\u9645\u8F93\u51FA/\u5DE5\u5177\u8C03\u7528\uFF0C\u4E0D\u53EA\u770B status=running\u2014\u2014\u540E\u53F0\u76D1\u89C6\u5668\u53EF\u80FD\u7A7A\u8F6C\u3002
716
- 3. stop \u524D\u5148\u770B\u65E5\u5FD7\u3002\u7528 status \u5224\u65AD\u662F\u771F\u5361\u6B7B\u8FD8\u662F\u6B63\u5E38\u8DD1\uFF0C\u786E\u8BA4\u9700\u8981\u53EB\u505C\u518D controlAgentRun(action:"stop", runId)\uFF1B\u7528 list/status \u786E\u8BA4 run \u771F\u5B9E\u5B58\u5728\u4E14\u975E\u7EC8\u6001\uFF0C\u522B\u5047\u8BBE"\u6D3E\u53D1\u4E86\u5C31\u5728\u8DD1"\u3002
758
+ 1. \u5148\u53D1\u73B0\u518D\u6D3E\u53D1\u3002\u8C03\u7528 listAgents \u8BFB\u53D6\u5B89\u5168\u6458\u8981\u3002\u9009\u4EBA\u6309\u4F18\u5148\u7EA7\uFF1A\u7279\u5B9A\u5DE5\u5177\u9700\u6C42 \u2192 \u4EFB\u52A1\u6863\u4E0E\u6210\u672C/\u80FD\u529B\u5339\u914D \u2192 \u80DC\u4EFB\u8005\u4E2D\u7684 isFavorite \u2192 modelAbility / inputPrice/outputPrice\u3002
759
+ - \u5148\u4F30\u4EFB\u52A1\u6863\uFF1A\u5FAE/\u7B80\u5355\uFF08\u22642 \u6B65\u3001\u6587\u6848\u3001\u5355\u70B9 polish\uFF09\uFF5C\u4E2D\uFF08\u591A\u6587\u4EF6\u8BFB\u6539\u9A8C\uFF09\uFF5C\u9AD8\uFF08\u67B6\u6784\u3001\u6DF1 review\u3001\u9AD8\u98CE\u9669\u63A8\u7406\uFF09\u3002
760
+ - \u9AD8\u4EF7/\u9876\u6863\u6A21\u578B\uFF08Opus\u3001GPT-5.6 Sol\u3001\u540C\u7EA7 Pro/K \u9876\u6863\u7B49\uFF09\u9ED8\u8BA4\u4E0D\u63A5\u7B80\u5355\u6D3B\uFF1B\u7B80\u5355\u6D3B\u4F18\u5148 Flash/Luna/\u4F4E\u4EF7\u6216\u6536\u85CF\u91CC\u7684\u8F7B\u91CF\u5019\u9009\u3002
761
+ - \u7981\u6B62\u51ED\u540D\u5B57\u7F16\u9020\u7EC6\u80FD\u529B\uFF0C\u4F46\u5141\u8BB8\u7528\u4EF7\u683C\u3001modelAbility \u53CA\u660E\u663E\u9876\u6863\u65CF\u7CFB\u505A\u7C97\u6863\u4F4D\u5339\u914D\uFF0C\u907F\u514D\u5927\u6A21\u578B\u5E72\u6742\u6D3B\u3002\u4E0D\u8981\u67E5\u6307\u6D3E\u8868\uFF0C\u4E0D\u8981\u6C42 recommendedFor\u3002
762
+ 2. coding \u662F\u9ED8\u8BA4\u80FD\u529B\u3002tools \u53EA\u7528\u4E8E\u6D4F\u89C8\u5668\u3001\u56FE\u7247\u3001\u8868\u683C\u3001\u90AE\u4EF6\u3001\u6570\u636E\u5E93\u7B49\u7279\u5B9A\u5DE5\u5177\u4EFB\u52A1\uFF1B\u4E0D\u8981\u56E0\u4E3A coding agent \u7684 tools \u6458\u8981\u4E3A\u7A7A\u5C31\u6DD8\u6C70\u5B83\u3002
763
+ 3. listAgents \u8FD4\u56DE\u7684 id\u3001publicKey\u3001handle \u53EA\u662F\u5019\u9009\u6807\u8BC6\u3002\u9009\u4E2D\u540E\u4F18\u5148\u8C03\u7528 readAgent \u89E3\u6790\u53EF\u8FD0\u884C\u7684 agentKey\uFF0C\u518D\u628A\u8BE5 agentKey \u4F20\u7ED9 startAgentRun\uFF1B\u4E0D\u8981\u51ED\u5C55\u793A\u540D\u79F0\u6216 id \u731C key\uFF0C\u4E5F\u4E0D\u8981\u7D22\u53D6 prompt\u3001\u5BC6\u94A5\u6216\u6570\u636E\u5E93 key \u6765\u9009\u4EBA\u3002\u6CA1\u6709 readAgent \u65F6\u53EA\u80FD\u4F7F\u7528\u5DF2\u6709\u4E0A\u4E0B\u6587\u4E2D\u660E\u786E\u7684 agentKey\u3002
764
+ 4. \u6D3E\u53D1\u540E\u5FC5\u987B\u8F6E\u8BE2\u3002startAgentRun \u62FF\u5230 runId \u540E\uFF0C\u7528 controlAgentRun(action:"status", runId, tailLines:30) \u8F6E\u8BE2\uFF08\u5EFA\u8BAE 5\u201310s \u4E00\u6B21\uFF09\uFF0C\u4E0D\u8981\u53EA\u9760\u804A\u5929\u590D\u8FF0\u7ED3\u679C\u3002\u4E0D\u8F6E\u8BE2 = \u6CA1\u7F16\u6392\u3002
765
+ 5. \u8BFB\u65E5\u5FD7\u786E\u8BA4\u8FDB\u5C55\u3002tailLines>0 \u8BFB\u5B9E\u9645\u8F93\u51FA/\u5DE5\u5177\u8C03\u7528\uFF0C\u4E0D\u53EA\u770B status=running\u2014\u2014\u540E\u53F0\u76D1\u89C6\u5668\u53EF\u80FD\u7A7A\u8F6C\u3002
766
+ 6. stop \u524D\u5148\u770B\u65E5\u5FD7\u3002\u7528 status \u5224\u65AD\u662F\u771F\u5361\u6B7B\u8FD8\u662F\u6B63\u5E38\u8DD1\uFF0C\u786E\u8BA4\u9700\u8981\u53EB\u505C\u518D controlAgentRun(action:"stop", runId)\uFF1B\u7528 list/status \u786E\u8BA4 run \u771F\u5B9E\u5B58\u5728\u4E14\u975E\u7EC8\u6001\uFF0C\u522B\u5047\u8BBE"\u6D3E\u53D1\u4E86\u5C31\u5728\u8DD1"\u3002
717
767
  \u5DE5\u5177\u9009\u62E9\uFF1A\u5B50\u4EFB\u52A1 <100s \u4E14\u8981\u7ACB\u5373\u62FF\u7ED3\u679C \u2192 callAgent\uFF08\u540C\u6B65\uFF09\uFF1B\u957F\u4EFB\u52A1 / \u5E76\u884C / \u9700\u8981\u89C2\u5BDF\u6216\u53EB\u505C \u2192 startAgentRun\uFF08\u672C\u6BB5\uFF09\u3002`;
768
+ var AGENT_COLLABORATION_INSTRUCTIONS = `--- \u591A Agent \u534F\u4F5C\uFF08\u8BA1\u5212 \u2192 \u6D3E\u53D1 \u2192 \u5BA1\u67E5\uFF09 ---
769
+ \u7528\u5B50\u4EE3\u7406\u5B8C\u6210\u4E2D\u5927\u578B\u4EFB\u52A1\u65F6\uFF0C\u6309\u4E09\u6BB5\u7EAA\u5F8B\u6267\u884C\uFF1A
770
+ 1. \u8BA1\u5212\u5148\u884C\uFF1A\u52A8\u624B\u524D\u5148\u60F3\u6E05\u695A\u76EE\u6807\u3001\u8FB9\u754C\u3001\u9A8C\u8BC1\u65B9\u5F0F\u548C\u505C\u6B62\u6761\u4EF6\uFF1B\u9884\u8BA1 3 \u6B65\u4EE5\u4E0A\uFF08\u8BFB\u6539\u9A8C\u3001\u591A\u6587\u4EF6\u3001\u4EFB\u4F55\u6D3E\u53D1\uFF09\u5148\u5B9A\u8BA1\u5212\uFF0C\u518D\u51B3\u5B9A\u81EA\u5DF1\u505A\u5B8C\u8FD8\u662F\u6D3E\u53D1\u3002
771
+ 2. \u6D3E\u53D1\u539F\u5219\uFF1A\u5B50\u4EFB\u52A1\u81EA\u5305\u542B\u3001\u8FB9\u754C\u6E05\u6670\u3001\u80FD\u5E76\u884C\u5219\u5E76\u884C\uFF1B\u7ED9\u6267\u884C\u8005\u5199\u6E05\u4EFB\u52A1\u3001\u9A8C\u6536\u548C\u7981\u533A\uFF0C\u4E0D\u4F20\u65E0\u5173\u5386\u53F2\u3002\u6D3E\u53D1\u540E\u8F6E\u8BE2\u7ED3\u679C\uFF0C\u4E0D\u5047\u8BBE\u6210\u529F\u3002
772
+ 3. \u72EC\u7ACB\u5BA1\u67E5\uFF1A\u91CD\u8981\u4EA7\u51FA\uFF08\u4EE3\u7801\u3001\u8FC1\u79FB\u3001\u6570\u636E\u53D8\u66F4\uFF09\u4EA4\u7ED9\u975E\u4F5C\u8005\uFF08\u6700\u597D\u662F\u4E0D\u540C\u6A21\u578B\u7684\uFF09\u72EC\u7ACB review\uFF1Breview \u53EA\u770B diff/\u8BC1\u636E\uFF0C\u4EA7\u51FA finding \u6216 Clean review\uFF0C\u518D\u51B3\u5B9A\u8FD4\u5DE5\u6216\u6536\u5C3E\u3002
773
+ \u6700\u5C0F\u5B9E\u73B0\uFF1A\u80FD\u5220\u89E3\u51B3\u5C31\u4E0D\u52A0\uFF0C\u80FD\u590D\u7528\u5C31\u4E0D\u65B0\u5EFA\uFF1B\u65B0\u62BD\u8C61\u524D\u5148\u641C\u5DF2\u6709\u5B9E\u73B0\u3002\u4E0D\u8981\u4E3A\u4E86\u663E\u5F97\u5FD9\u788C\u800C\u6D3E\u53D1\u6216\u8FC7\u5EA6\u8BBE\u8BA1\u3002`;
718
774
  var MENU_USAGE_INSTRUCTIONS = `--- \u4EA4\u4E92\u8BF4\u660E ---
719
775
  \u6240\u6709\u7528\u6237\u8F93\u5165\u5747\u4E3A\u7EAF\u6587\u672C\u6D88\u606F\uFF0C\u76F4\u63A5\u7406\u89E3\u5373\u53EF\uFF0C\u4E0D\u8981\u5728\u56DE\u590D\u4E2D\u63D0\u53CA\u6309\u94AE\u3001\u83DC\u5355\u3001\u754C\u9762\u7B49 UI \u5143\u7D20\u3002
720
776
 
@@ -817,6 +873,16 @@ var TOOL_GUIDED_SECTIONS = [
817
873
  tools.includes("startAgentRun") || tools.includes("controlAgentRun") ? AGENT_ORCHESTRATION_RUN_INSTRUCTIONS : ""
818
874
  ].filter(Boolean).join("\n\n")
819
875
  },
876
+ {
877
+ id: "agentCollaboration",
878
+ triggerTools: [
879
+ "callAgent",
880
+ "runStreamingAgent",
881
+ "startAgentRun",
882
+ "controlAgentRun"
883
+ ],
884
+ build: () => AGENT_COLLABORATION_INSTRUCTIONS
885
+ },
820
886
  { id: "menuUsage", triggerTools: ["ui_ask_choice"], build: () => MENU_USAGE_INSTRUCTIONS },
821
887
  {
822
888
  id: "webAccess",
@@ -993,6 +1059,7 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
993
1059
  { id: "startup-protocol", owner: "platform", cacheScope: "static", content: startupProtocol },
994
1060
  { id: "core-persona", owner: "agent", cacheScope: "session", content: corePersonaSection },
995
1061
  { id: "agent-orchestration", owner: "platform", cacheScope: "session", content: toolSections.agentOrchestration },
1062
+ { id: "agent-collaboration", owner: "platform", cacheScope: "session", content: toolSections.agentCollaboration },
996
1063
  { id: "web-access", owner: "platform", cacheScope: "session", content: toolSections.webAccess },
997
1064
  { id: "menu-usage", owner: "platform", cacheScope: "session", content: toolSections.menuUsage },
998
1065
  { id: "clarification-mode", owner: "platform", cacheScope: "session", content: clarifyingSection },
@@ -1033,6 +1100,8 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
1033
1100
  };
1034
1101
 
1035
1102
  // packages/integrations/openai/providerBodyCompatibility.ts
1103
+ var MOONSHOT_KIMI_K3_MODEL = "kimi-k3";
1104
+ var isMoonshotKimiK3 = (provider, model) => asTrimmedLowercaseString(provider) === "moonshot" && asTrimmedLowercaseString(model) === MOONSHOT_KIMI_K3_MODEL;
1036
1105
  var normalizeChatCompletionsBodyForProvider = ({
1037
1106
  body,
1038
1107
  provider,
@@ -1044,6 +1113,16 @@ var normalizeChatCompletionsBodyForProvider = ({
1044
1113
  delete nextBody.reasoning;
1045
1114
  delete nextBody.reasoning_effort;
1046
1115
  }
1116
+ if (isMoonshotKimiK3(provider, model)) {
1117
+ delete nextBody.temperature;
1118
+ delete nextBody.top_p;
1119
+ delete nextBody.frequency_penalty;
1120
+ delete nextBody.presence_penalty;
1121
+ if (typeof nextBody.max_tokens === "number") {
1122
+ nextBody.max_completion_tokens = nextBody.max_tokens;
1123
+ delete nextBody.max_tokens;
1124
+ }
1125
+ }
1047
1126
  return nextBody;
1048
1127
  };
1049
1128
 
@@ -1108,15 +1187,7 @@ var sanitizeChatCompletionsMessage = (message) => {
1108
1187
  };
1109
1188
  const name = asOptionalTrimmedString(message.name);
1110
1189
  if (name) sanitized.name = name;
1111
- const toolCallId = asOptionalTrimmedString(message.tool_call_id);
1112
- if (toolCallId) sanitized.tool_call_id = toolCallId;
1113
- if (Array.isArray(message.tool_calls)) {
1114
- sanitized.tool_calls = message.tool_calls;
1115
- }
1116
- if (message.role === "assistant" && typeof message.reasoning_content === "string" && message.reasoning_content) {
1117
- sanitized.reasoning_content = message.reasoning_content;
1118
- }
1119
- return sanitized;
1190
+ return preserveAgentStateFields(message, sanitized);
1120
1191
  };
1121
1192
  var buildRequestBody = (options) => {
1122
1193
  const {
@@ -1143,7 +1214,10 @@ var buildRequestBody = (options) => {
1143
1214
  });
1144
1215
  Object.assign(bodyData, usageRequestOptions);
1145
1216
  if (reasoning_effort && isModelSupportReasoningEffort(model)) {
1146
- bodyData.reasoning_effort = reasoning_effort;
1217
+ const clamped = clampReasoningEffort(reasoning_effort, providerName);
1218
+ if (clamped) {
1219
+ bodyData.reasoning_effort = clamped;
1220
+ }
1147
1221
  }
1148
1222
  if (typeof temperature === "number") bodyData.temperature = temperature;
1149
1223
  if (typeof top_p === "number") bodyData.top_p = top_p;
@@ -1219,9 +1293,32 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
1219
1293
  };
1220
1294
 
1221
1295
  // packages/integrations/openai/generateResponseRequestBody.ts
1222
- function generateResponseRequestBody(agentConfig, msgs, contexts, prependSystemPrompt = true) {
1296
+ var DEFAULT_RESPONSES_COMPACTION_THRESHOLD = 2e5;
1297
+ function resolveResponsesCompactionThreshold(agentConfig) {
1298
+ const configured = Number(
1299
+ agentConfig.responsesCompactionThreshold ?? agentConfig.responses_compaction_threshold
1300
+ );
1301
+ return Number.isFinite(configured) && configured > 0 ? Math.floor(configured) : DEFAULT_RESPONSES_COMPACTION_THRESHOLD;
1302
+ }
1303
+ function selectResponsesContinuationMessages(msgs) {
1304
+ let lastAssistantIndex = -1;
1305
+ for (let index = msgs.length - 1; index >= 0; index -= 1) {
1306
+ if (msgs[index]?.role === "assistant") {
1307
+ lastAssistantIndex = index;
1308
+ break;
1309
+ }
1310
+ }
1311
+ const candidates = lastAssistantIndex >= 0 ? msgs.slice(lastAssistantIndex + 1) : msgs;
1312
+ return candidates.filter((message) => message.role !== "system");
1313
+ }
1314
+ function generateResponseRequestBody(agentConfig, msgs, contexts, prependSystemPrompt = true, responsesState) {
1223
1315
  const language = typeof navigator !== "undefined" && navigator.language ? navigator.language : "zh-CN";
1224
- const input = convertMessagesToResponsesInput(msgs);
1316
+ const state = responsesState !== void 0 ? responsesState : selectResponsesConversationState(agentConfig.responsesState, agentConfig);
1317
+ const supportsServerState = supportsResponsesConversationState(agentConfig);
1318
+ const stateful = supportsServerState && state && agentConfig.store !== false ? state : null;
1319
+ const input = convertMessagesToResponsesInput(
1320
+ stateful ? selectResponsesContinuationMessages(msgs) : msgs
1321
+ );
1225
1322
  const body = {
1226
1323
  model: agentConfig.model,
1227
1324
  input,
@@ -1257,6 +1354,25 @@ function generateResponseRequestBody(agentConfig, msgs, contexts, prependSystemP
1257
1354
  if (agentConfig.metadata !== void 0) {
1258
1355
  body.metadata = agentConfig.metadata;
1259
1356
  }
1357
+ if (stateful) {
1358
+ body.previous_response_id = stateful.responseId;
1359
+ if (agentConfig.context_management === void 0) {
1360
+ body.context_management = [
1361
+ {
1362
+ type: "compaction",
1363
+ compact_threshold: resolveResponsesCompactionThreshold(agentConfig)
1364
+ }
1365
+ ];
1366
+ }
1367
+ } else if (supportsServerState && responsesState === void 0 && agentConfig.previous_response_id !== void 0) {
1368
+ body.previous_response_id = agentConfig.previous_response_id;
1369
+ }
1370
+ if (supportsServerState && agentConfig.store !== void 0) {
1371
+ body.store = agentConfig.store;
1372
+ }
1373
+ if (supportsServerState && agentConfig.context_management !== void 0) {
1374
+ body.context_management = agentConfig.context_management;
1375
+ }
1260
1376
  return body;
1261
1377
  }
1262
1378
 
@@ -1331,7 +1447,8 @@ var generateRequestBody = ({
1331
1447
  messages,
1332
1448
  contexts,
1333
1449
  stableMessages,
1334
- prependSystemPrompt = true
1450
+ prependSystemPrompt = true,
1451
+ responsesState
1335
1452
  }) => {
1336
1453
  const provider = (agentConfig.provider || "").toLowerCase();
1337
1454
  const imageSettings = getImageOutputSettings(agentConfig, provider);
@@ -1347,7 +1464,8 @@ var generateRequestBody = ({
1347
1464
  agentConfigForRequest,
1348
1465
  [...stableMessages ?? [], ...messages],
1349
1466
  contexts,
1350
- prependSystemPrompt
1467
+ prependSystemPrompt,
1468
+ responsesState
1351
1469
  );
1352
1470
  }
1353
1471
  const baseBody = generateOpenAIRequestBody(
@@ -1385,26 +1503,12 @@ var isRetryableServerProxyFetchError = (error) => {
1385
1503
  );
1386
1504
  };
1387
1505
  var waitForServerProxyRetry = async (retryAfterMs, signal) => {
1388
- if (retryAfterMs <= 0) return;
1389
- if (signal?.aborted) {
1390
- const abortError = new Error("Aborted");
1391
- abortError.name = "AbortError";
1392
- throw abortError;
1393
- }
1394
- await new Promise((resolve, reject) => {
1395
- const onAbort = () => {
1396
- clearTimeout(timeoutId);
1397
- signal?.removeEventListener("abort", onAbort);
1398
- const abortError = new Error("Aborted");
1399
- abortError.name = "AbortError";
1400
- reject(abortError);
1401
- };
1402
- const timeoutId = setTimeout(() => {
1403
- signal?.removeEventListener("abort", onAbort);
1404
- resolve();
1405
- }, normalizeNonNegativeMs(retryAfterMs, DEFAULT_SERVER_PROXY_RETRY_AFTER_MS));
1406
- signal?.addEventListener("abort", onAbort, { once: true });
1407
- });
1506
+ const delayMs = normalizeNonNegativeMs(
1507
+ retryAfterMs,
1508
+ DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
1509
+ );
1510
+ if (delayMs <= 0) return;
1511
+ await waitForAbortableDelay(delayMs, signal);
1408
1512
  };
1409
1513
  var performServerProxyFetchWithRetry = async ({
1410
1514
  execute,
@@ -1926,6 +2030,9 @@ export {
1926
2030
  mergeReferences,
1927
2031
  resolveReferenceAssets,
1928
2032
  resolveToolsFromKeys,
2033
+ selectResponsesConversationState,
2034
+ updateResponsesConversationState,
2035
+ isResponsesConversationStateRejection,
1929
2036
  resolveClientWire,
1930
2037
  resolveAgentCallPlan,
1931
2038
  generateRequestBody,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-EVZKZF32.js";
4
+ } from "./chunk-JUN3HFMN.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,20 +1,23 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-X2S7JTIG.js";
4
+ } from "./chunk-5ITRDSHY.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-2W2VYVI5.js";
8
- import {
9
- readPipeText,
10
- spawnProcess
11
- } from "./chunk-IDZTNRP2.js";
7
+ } from "./chunk-RZ735TLX.js";
12
8
  import {
13
9
  runLocalAgentTurn
14
- } from "./chunk-S3GS2PRL.js";
10
+ } from "./chunk-4BTHUYMY.js";
15
11
  import {
16
12
  resolveLocalRuntimeEnvFromPolicy
17
- } from "./chunk-5CS33IBL.js";
13
+ } from "./chunk-PDL2AV3E.js";
14
+ import {
15
+ toErrorMessage
16
+ } from "./chunk-HNMXYYJR.js";
17
+ import {
18
+ readPipeText,
19
+ spawnProcess
20
+ } from "./chunk-IDZTNRP2.js";
18
21
  import {
19
22
  asRecordOrEmpty
20
23
  } from "./chunk-KX6YBIHG.js";
@@ -22,14 +25,8 @@ import {
22
25
  asTrimmedNonEmptyStringArray
23
26
  } from "./chunk-I42VC5KR.js";
24
27
  import {
25
- parseUserIdFromAuthToken
26
- } from "./chunk-ISNCLGUZ.js";
27
- import {
28
- DEFAULT_NOLO_SERVER_URL
29
- } from "./chunk-OLZBQWZU.js";
30
- import {
31
- toErrorMessage
32
- } from "./chunk-HNMXYYJR.js";
28
+ isRecord
29
+ } from "./chunk-KUG52IAP.js";
33
30
  import {
34
31
  asTrimmedString
35
32
  } from "./chunk-3EUW3WEO.js";
@@ -37,8 +34,11 @@ import {
37
34
  asOptionalPositiveFiniteNumber
38
35
  } from "./chunk-U6VC4MU4.js";
39
36
  import {
40
- isRecord
41
- } from "./chunk-KUG52IAP.js";
37
+ parseUserIdFromAuthToken
38
+ } from "./chunk-5NBHQD4D.js";
39
+ import {
40
+ DEFAULT_NOLO_SERVER_URL
41
+ } from "./chunk-OLZBQWZU.js";
42
42
  import {
43
43
  asOptionalTrimmedString
44
44
  } from "./chunk-G3SUCT4W.js";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-5MOUAAMK.js";
3
+ } from "./chunk-AM53Q2SD.js";
4
4
  import {
5
5
  require_date_fns
6
6
  } from "./chunk-M76ECQRD.js";
7
- import {
8
- patch,
9
- readAndWait
10
- } from "./chunk-O26GI2JP.js";
11
7
  import {
12
8
  require_react
13
9
  } from "./chunk-3ASDTTEI.js";
14
10
  import {
15
11
  toErrorMessage
16
12
  } from "./chunk-HNMXYYJR.js";
13
+ import {
14
+ patch,
15
+ readAndWait
16
+ } from "./chunk-NITP2JDG.js";
17
17
  import {
18
18
  asOptionalTrimmedString
19
19
  } from "./chunk-G3SUCT4W.js";
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
367
367
  }
368
368
  }
369
369
  async function createDocState(args, thunkApi) {
370
- const { createPageAction } = await import("./createPageAction-5MXWVRGY.js");
370
+ const { createPageAction } = await import("./createPageAction-O7KOYNV4.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  asOptionalFiniteNumber
3
3
  } from "./chunk-WWC7I6TA.js";
4
- import {
5
- asTrimmedString
6
- } from "./chunk-3EUW3WEO.js";
7
4
  import {
8
5
  isRecord
9
6
  } from "./chunk-KUG52IAP.js";
7
+ import {
8
+ asTrimmedString
9
+ } from "./chunk-3EUW3WEO.js";
10
10
  import {
11
11
  asOptionalTrimmedString
12
12
  } from "./chunk-G3SUCT4W.js";
@@ -261,6 +261,8 @@ function pickAllowlistedAgentConfigFields(source, dbKey) {
261
261
  }
262
262
  const tools = uniqueToolNames(source.tools) ?? uniqueToolNames(source.toolNames);
263
263
  if (tools) snapshot.tools = tools;
264
+ const enabledPacks = uniqueToolNames(source.enabledPacks);
265
+ if (enabledPacks) snapshot.enabledPacks = enabledPacks;
264
266
  for (const key of DESKTOP_AGENT_CONFIG_SNAPSHOT_OBJECT_FIELDS) {
265
267
  const value = sanitizePlainObject(source[key]);
266
268
  if (value) {
@@ -1,11 +1,8 @@
1
- import {
2
- resolveFileCategory
3
- } from "./chunk-AZPCASRE.js";
4
1
  import {
5
2
  loadFileFromIndexedDb,
6
3
  removeAction,
7
4
  saveFileToIndexedDb
8
- } from "./chunk-IPYUUY4E.js";
5
+ } from "./chunk-WPHL6ALY.js";
9
6
  import {
10
7
  fileKey,
11
8
  getFileIdFromKey,
@@ -15,7 +12,7 @@ import {
15
12
  readAction,
16
13
  readRequestManager,
17
14
  resolveAgentReadServers
18
- } from "./chunk-XFOLQLDN.js";
15
+ } from "./chunk-XHQWJUW4.js";
19
16
  import {
20
17
  asyncThunkCreator,
21
18
  buildCreateSlice,
@@ -35,7 +32,7 @@ import {
35
32
  shouldReplaceLocalWithRemoteRecord,
36
33
  shouldReplicateLocalRecord,
37
34
  uploadToCurrentServer
38
- } from "./chunk-OOM6SJNR.js";
35
+ } from "./chunk-TSUJOM6N.js";
39
36
  import {
40
37
  fetchFromClientDb,
41
38
  fetchFromServer,
@@ -456,6 +453,39 @@ var upsertAction = async (upsertConfig, thunkApi) => {
456
453
  }
457
454
  };
458
455
 
456
+ // packages/app/utils/fileUtils.ts
457
+ var fileConstructor = typeof globalThis !== "undefined" && typeof globalThis.File === "function" ? globalThis.File : void 0;
458
+ var isImageMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("image/");
459
+ var IMAGE_FILE_NAME_RE = /\.(avif|bmp|gif|heic|heif|ico|jpe?g|png|svg|tiff?|webp)$/i;
460
+ var VIDEO_FILE_NAME_RE = /\.(avi|m4v|mkv|mov|mp4|mpeg|mpg|webm)$/i;
461
+ var AUDIO_FILE_NAME_RE = /\.(aac|flac|m4a|mp3|ogg|wav|weba)$/i;
462
+ var DOCUMENT_FILE_NAME_RE = /\.(csv|doc|docx|md|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx)$/i;
463
+ var isImageFileName = (value) => typeof value === "string" && IMAGE_FILE_NAME_RE.test(value.trim());
464
+ var isVideoMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("video/");
465
+ var isAudioMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("audio/");
466
+ var isPdfMimeType = (value) => typeof value === "string" && value.toLowerCase() === "application/pdf";
467
+ var isDocumentMimeType = (value) => {
468
+ if (typeof value !== "string") return false;
469
+ const normalized = value.toLowerCase();
470
+ return isPdfMimeType(normalized) || normalized === "text/plain" || normalized === "text/markdown" || normalized === "text/csv" || normalized === "application/msword" || normalized === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || normalized === "application/vnd.ms-powerpoint" || normalized === "application/vnd.openxmlformats-officedocument.presentationml.presentation" || normalized === "application/vnd.ms-excel" || normalized === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || normalized === "application/rtf" || normalized === "application/vnd.oasis.opendocument.text";
471
+ };
472
+ var resolveFileCategory = ({
473
+ mimeType,
474
+ fileName
475
+ }) => {
476
+ if (isImageMimeType(mimeType) || isImageFileName(fileName)) return "image";
477
+ if (isVideoMimeType(mimeType) || typeof fileName === "string" && VIDEO_FILE_NAME_RE.test(fileName.trim())) {
478
+ return "video";
479
+ }
480
+ if (isAudioMimeType(mimeType) || typeof fileName === "string" && AUDIO_FILE_NAME_RE.test(fileName.trim())) {
481
+ return "audio";
482
+ }
483
+ if (isDocumentMimeType(mimeType) || typeof fileName === "string" && DOCUMENT_FILE_NAME_RE.test(fileName.trim())) {
484
+ return "document";
485
+ }
486
+ return "other";
487
+ };
488
+
459
489
  // packages/database/actions/upload.ts
460
490
  var saveToClientDb2 = async (clientDb, dbKey, metadata) => {
461
491
  if (!clientDb) {
@@ -674,7 +704,7 @@ var dbSlice = createSliceWithThunks({
674
704
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
675
705
  read: create.asyncThunk(
676
706
  async (payload, thunkApi) => {
677
- const { readAction: readAction2 } = await import("./read-QJNKRROM.js");
707
+ const { readAction: readAction2 } = await import("./read-2MIMRBZ2.js");
678
708
  return readAction2(payload, thunkApi);
679
709
  },
680
710
  {
@@ -748,7 +778,7 @@ var dbSlice = createSliceWithThunks({
748
778
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
749
779
  share: create.asyncThunk(
750
780
  async (config, thunkApi) => {
751
- const { shareResourceAction } = await import("./action-AA4IJ5K2.js");
781
+ const { shareResourceAction } = await import("./action-RAXNQQKC.js");
752
782
  return shareResourceAction(config, thunkApi);
753
783
  }
754
784
  ),
@@ -784,6 +814,7 @@ var dbSlice_default = dbSlice.reducer;
784
814
  export {
785
815
  readAndWaitAction,
786
816
  toTimestampMs,
817
+ resolveFileCategory,
787
818
  uploadFileAction,
788
819
  dbAdapter,
789
820
  selectById,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CWMSB67P.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-BBYVOSU2.js";
9
+ } from "./chunk-S3UTETIC.js";
10
10
  import {
11
11
  asOptionalFiniteNumber
12
12
  } from "./chunk-WWC7I6TA.js";