nolo-cli 0.157.0-alpha.1 → 0.159.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 (143) hide show
  1. package/{_executeModel-5WS2PA62.js → _executeModel-JISIM4PS.js} +41 -41
  2. package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
  3. package/{action-ZJYUBXFC.js → action-GPPJC5TI.js} +4 -4
  4. package/{addContentAction-TVHB4526.js → addContentAction-BI6RDRTQ.js} +7 -7
  5. package/{addDialogAgentAction-FDPBU6K6.js → addDialogAgentAction-4RJYUSIK.js} +6 -6
  6. package/{agentDeleteCommand-Q6M4F3U6.js → agentDeleteCommand-2NMZDFL5.js} +54 -54
  7. package/{agentEmailCommands-FNH6FEHS.js → agentEmailCommands-VQ2QGKL4.js} +56 -56
  8. package/{agentListCommands-JUNMFS6E.js → agentListCommands-3CJ4GF6C.js} +21 -21
  9. package/{agentMachineCommands-VNLDEKNT.js → agentMachineCommands-BMOEPV5C.js} +20 -19
  10. package/{agentProviderCommands-X2HQE6HY.js → agentProviderCommands-CUBOAVPB.js} +2 -2
  11. package/{agentRecordCommands-47XXRVPI.js → agentRecordCommands-XRB7BLWV.js} +54 -54
  12. package/{agentRunCommand-QEXFJUXQ.js → agentRunCommand-VKCTAW55.js} +56 -55
  13. package/{agentRunControl-2C5GM3BW.js → agentRunControl-PPYWJRIJ.js} +4 -4
  14. package/{agentRuntimeLocal-O5GDAFTN.js → agentRuntimeLocal-7JDS3OAL.js} +14 -14
  15. package/{agentSlice-E3XS5FTQ.js → agentSlice-ST6QQ5FD.js} +7 -7
  16. package/{appDeleteCommands-C2J5RQ3I.js → appDeleteCommands-UVWHW4TJ.js} +19 -19
  17. package/{appDeployCommands-3YRK7PSU.js → appDeployCommands-67JPR4JU.js} +19 -19
  18. package/{appDeployStatusCommands-FPAX7MOK.js → appDeployStatusCommands-UTC6IR5V.js} +19 -19
  19. package/{appGetCommands-XAC2V766.js → appGetCommands-KLLIGWNC.js} +19 -19
  20. package/{appListCommands-ZJL2W5O7.js → appListCommands-AZKNWJUR.js} +19 -19
  21. package/{authCommand-J3XILHWW.js → authCommand-MSINEFHH.js} +12 -292
  22. package/{authCommands-77CHYBGF.js → authCommands-AMNIAKEG.js} +2 -2
  23. package/{builtinSkillRegistry-A6VSPJEJ.js → builtinSkillRegistry-H3AY27TR.js} +1 -1
  24. package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
  25. package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
  26. package/{chunk-Z6KQDSZW.js → chunk-2SGAI64X.js} +2 -2
  27. package/{chunk-C5VPAHIU.js → chunk-32ZKZET7.js} +1 -1
  28. package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
  29. package/{chunk-MM3662RS.js → chunk-42W7LKBM.js} +1 -1
  30. package/{chunk-FPWT3RH2.js → chunk-4CYTNZG3.js} +14 -14
  31. package/{chunk-L6EQV5OC.js → chunk-4JOZECCA.js} +3 -3
  32. package/{chunk-YBNHPX4S.js → chunk-4RJJDA57.js} +1 -1
  33. package/{chunk-B2EGWZJG.js → chunk-5MPS5OOY.js} +1 -1
  34. package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
  35. package/{chunk-UUPR3TD7.js → chunk-7RF4O6AT.js} +1 -3
  36. package/{chunk-ZD2BLOY6.js → chunk-B5MSFO6R.js} +3 -3
  37. package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
  38. package/{chunk-UTIMX333.js → chunk-C3WXTFRP.js} +1 -1
  39. package/{chunk-ROPSATAB.js → chunk-CON6SI7N.js} +1 -1
  40. package/{chunk-4Z245KOA.js → chunk-DC3SZCRR.js} +6 -2
  41. package/{chunk-X5SUT4CN.js → chunk-DD7BZWJ6.js} +6 -6
  42. package/{chunk-ANJTRG52.js → chunk-DFWLD7WU.js} +1 -38
  43. package/{chunk-PSJWPSKS.js → chunk-EWO77ZGF.js} +9 -43
  44. package/{chunk-DW7MGLMG.js → chunk-FUNTOSV3.js} +26 -22
  45. package/{chunk-MVJVF4ED.js → chunk-FVZVJA54.js} +7 -6
  46. package/{chunk-ZWG3C7VI.js → chunk-GB552UJS.js} +36 -1
  47. package/{chunk-EJU23ST5.js → chunk-GJNYJH7O.js} +682 -639
  48. package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
  49. package/{chunk-QDA4Y5O6.js → chunk-HXSN43Y5.js} +21 -17
  50. package/{chunk-7GC3EKUG.js → chunk-IE7G4BF5.js} +3 -3
  51. package/{chunk-T6CBQ6BN.js → chunk-INFHX73M.js} +1 -1
  52. package/{chunk-CE7PIHQD.js → chunk-IRTOYSA2.js} +3 -3
  53. package/{chunk-PEO24UB5.js → chunk-IULXURBL.js} +39 -12
  54. package/{chunk-WZ6OU4NX.js → chunk-J2ATF74A.js} +2 -2
  55. package/{chunk-SKPPKHD3.js → chunk-J4S44CSW.js} +2 -2
  56. package/{chunk-KOB75UNU.js → chunk-JKXXZUO4.js} +18 -2
  57. package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
  58. package/{chunk-RUNKPFM5.js → chunk-JPSTJHGJ.js} +12 -8
  59. package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
  60. package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
  61. package/{chunk-TZTWMGE3.js → chunk-M2P3OGXZ.js} +3 -3
  62. package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
  63. package/{chunk-2MTE2PEH.js → chunk-MGSNS22D.js} +1 -1
  64. package/{chunk-FDT27L7S.js → chunk-MJKKEGF5.js} +8 -6
  65. package/{chunk-H4KACZMG.js → chunk-MNRZCEYU.js} +263 -128
  66. package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
  67. package/{chunk-6MPAEODB.js → chunk-NDZOXXIM.js} +17 -3
  68. package/{chunk-VAZHH6FO.js → chunk-NJTXRGCJ.js} +18 -12
  69. package/{chunk-G47IPDOK.js → chunk-NUE735UT.js} +1 -1
  70. package/{chunk-HKT6QXP3.js → chunk-O4KVUI4W.js} +2 -2
  71. package/{chunk-36OMEXXR.js → chunk-OON4OBWI.js} +1 -1
  72. package/{chunk-7A4LJCDR.js → chunk-OVQFMCVI.js} +4 -4
  73. package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
  74. package/{chunk-OH2M7WEU.js → chunk-PIYYH2LE.js} +3 -3
  75. package/{chunk-EM3YOZJ4.js → chunk-PKC7D6SX.js} +3 -3
  76. package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
  77. package/{chunk-TYND6RDQ.js → chunk-QI2WVWXV.js} +73 -2
  78. package/{chunk-IYBIRCQV.js → chunk-QOYJE6NX.js} +1 -1
  79. package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
  80. package/{chunk-XFKZ3MCV.js → chunk-R6ABE4UC.js} +223 -67
  81. package/{chunk-KX6LPG7W.js → chunk-RE5I35J7.js} +2 -2
  82. package/{chunk-VSOWPETY.js → chunk-RGYDJ352.js} +7 -7
  83. package/{chunk-D4OWHT5Y.js → chunk-SPKLALBU.js} +2 -2
  84. package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
  85. package/{chunk-6TF64IF2.js → chunk-U6TTTB6V.js} +16 -2
  86. package/{chunk-3XZKV7QQ.js → chunk-US6MKPE7.js} +1 -1
  87. package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
  88. package/{chunk-HXHSTRGH.js → chunk-VYNMQ6HW.js} +0 -27
  89. package/{chunk-7BSQK2UC.js → chunk-WRCZXJ4N.js} +2 -2
  90. package/{chunk-ZEHTARJA.js → chunk-XEF4HW56.js} +42 -96
  91. package/chunk-Y5GCAMGP.js +9 -0
  92. package/{chunk-7KYVUFDG.js → chunk-YNCJYU4X.js} +2 -264
  93. package/{chunk-SCJD2PNK.js → chunk-YPG7TUQD.js} +3 -3
  94. package/{chunk-TJ2VPCBE.js → chunk-ZIGIN5IX.js} +2 -2
  95. package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
  96. package/{chunk-HP6O6LTV.js → chunk-ZVQHBIWV.js} +6 -6
  97. package/{commandRegistry-OUBQIF62.js → commandRegistry-ROBNQFWA.js} +79 -87
  98. package/{contentThunks-B3FRQGP7.js → contentThunks-EWOJGG2I.js} +17 -16
  99. package/{createAgentAutomationAction-T2YFJ6MY.js → createAgentAutomationAction-I43ICGXU.js} +17 -16
  100. package/{createDialogAction-2NFGFBXW.js → createDialogAction-IIAHRXND.js} +18 -17
  101. package/{createPageAction-LDAVZDN7.js → createPageAction-OVK7PG4L.js} +17 -16
  102. package/{dbSlice-5QGKMQLO.js → dbSlice-DC2J53RC.js} +6 -6
  103. package/{deleteFile-EW6QNRRT.js → deleteFile-KYWEMNFX.js} +4 -4
  104. package/{dialogCommands-ZLBEAQHE.js → dialogCommands-K4OVKDYD.js} +22 -21
  105. package/{dialogSlice-64S3J6CP.js → dialogSlice-U22CFPRN.js} +16 -15
  106. package/{docCreateCommands-XOG5BBFQ.js → docCreateCommands-GI377ZFI.js} +17 -17
  107. package/{docDeleteCommands-NCW3BBRX.js → docDeleteCommands-NBQNTVHB.js} +18 -18
  108. package/{docReadCommands-OT7X44Y3.js → docReadCommands-6SKEW6AO.js} +17 -17
  109. package/{docStore-NIP7OO4I.js → docStore-SS2QUBG6.js} +7 -7
  110. package/{docUpdateCommands-JW7OWW2J.js → docUpdateCommands-NJ7JD6VA.js} +17 -17
  111. package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
  112. package/{handleSendMessageAction-TOKA7ED7.js → handleSendMessageAction-YVPRHPQR.js} +30 -29
  113. package/index.js +7 -7
  114. package/{localRuntimeAdapter-EQM6LFYC.js → localRuntimeAdapter-CC7ZPJRV.js} +54 -52
  115. package/{machineCommands-WJ7FZ67T.js → machineCommands-XEWIUHTY.js} +58 -56
  116. package/{machineWsRunDispatch-BQT4DEA2.js → machineWsRunDispatch-JYEWCXGP.js} +53 -53
  117. package/{memberThunks-KRV5YXOB.js → memberThunks-2DWKLE6W.js} +7 -7
  118. package/package.json +1 -1
  119. package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
  120. package/{providerPresetApply-CRZFMQD5.js → providerPresetApply-PKUOHQJT.js} +5 -5
  121. package/{providerRegistry-7IS43D3X.js → providerRegistry-HNQLIFN2.js} +5 -5
  122. package/{read-5KAZHHDM.js → read-L7QEJETH.js} +4 -4
  123. package/{readDocTool-5QO34OSX.js → readDocTool-QELXV2GW.js} +1 -1
  124. package/{readlineWorkspace-JHJSU5DS.js → readlineWorkspace-7MZPTN5U.js} +330 -117
  125. package/{removeDialogAgentAction-6X63HMI3.js → removeDialogAgentAction-376XSUP2.js} +8 -8
  126. package/{runAgentClientLoop-5QIGEALK.js → runAgentClientLoop-MLEVVWUH.js} +45 -40
  127. package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-HEN5IPIH.js} +4 -4
  128. package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
  129. package/{setDialogExtraReferencesAction-4MAYKKYW.js → setDialogExtraReferencesAction-QBDSH63D.js} +7 -7
  130. package/{setPrimaryDialogAgentAction-EGBAMREH.js → setPrimaryDialogAgentAction-537QFGW3.js} +8 -8
  131. package/settingThunks-4Z43ZSAT.js +923 -0
  132. package/{spaceCommands-ZWDPTURU.js → spaceCommands-UM3ZQKJU.js} +17 -17
  133. package/{streamAgentChatTurn-456DWXNY.js → streamAgentChatTurn-J7HYND6V.js} +48 -48
  134. package/{switchDialogAgentAction-YBKTD6DO.js → switchDialogAgentAction-CSO6AKRL.js} +6 -6
  135. package/{tableCommands-U3QDY4L6.js → tableCommands-LBH3QPPO.js} +1 -1
  136. package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
  137. package/{tools-IWNXKK4Y.js → tools-3CEH74XY.js} +34 -33
  138. package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-VSNIIH63.js} +6 -6
  139. package/{updateCommands-NQXAGFM7.js → updateCommands-LXZLG44Y.js} +2 -2
  140. package/{updateDialogTitleAction-SX53FZWO.js → updateDialogTitleAction-C557RTYG.js} +17 -16
  141. package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
  142. package/chunk-W4S6OTSC.js +0 -35
  143. package/settingThunks-FTDRZNSJ.js +0 -1371
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getModelContextWindow
3
- } from "./chunk-2MTE2PEH.js";
3
+ } from "./chunk-MGSNS22D.js";
4
4
  import {
5
5
  isRecord
6
6
  } from "./chunk-KUG52IAP.js";
@@ -854,6 +854,8 @@ var STREAM_USAGE_PROVIDERS = /* @__PURE__ */ new Set([
854
854
  // kimi-code CLI also sends include_usage). Custom agents pointing at the
855
855
  // same endpoint are covered by the endpoint check below, not here.
856
856
  "kimi-code",
857
+ // MiniMax 官方 API(api.minimaxi.com):OpenAI 兼容流式端点,支持 stream_options.include_usage。
858
+ "minimax",
857
859
  // OpenDesign (open-design.ai) and OpenCode Go (opencode.ai): OpenAI-compatible
858
860
  // aggregation / subscription endpoints. Verified to emit terminal usage with
859
861
  // prompt_tokens_details.cached_tokens.
@@ -862,10 +864,22 @@ var STREAM_USAGE_PROVIDERS = /* @__PURE__ */ new Set([
862
864
  "opencode-go"
863
865
  ]);
864
866
  var KIMI_CODE_ENDPOINT_MARKER = "api.kimi.com";
867
+ function extractHostname(endpoint) {
868
+ try {
869
+ const raw = endpoint.includes("://") ? endpoint : `https://${endpoint}`;
870
+ return new URL(raw).hostname.toLowerCase();
871
+ } catch {
872
+ return null;
873
+ }
874
+ }
875
+ var isMiniMaxEndpoint = (endpoint) => {
876
+ const host = extractHostname(endpoint);
877
+ return host === "api.minimaxi.com" || host === "api.minimax.chat";
878
+ };
865
879
  var isSupportedCustomEndpoint = (endpoint) => {
866
880
  if (typeof endpoint !== "string") return false;
867
881
  const ep = endpoint.toLowerCase();
868
- return ep.includes(KIMI_CODE_ENDPOINT_MARKER) || ep.includes("open-design.ai") || ep.includes("opencode.ai") || isOllamaEndpoint(endpoint);
882
+ return isMiniMaxEndpoint(endpoint) || ep.includes(KIMI_CODE_ENDPOINT_MARKER) || ep.includes("open-design.ai") || ep.includes("opencode.ai") || isOllamaEndpoint(endpoint);
869
883
  };
870
884
  var EXTRA_USAGE_FIELD_PROVIDERS = /* @__PURE__ */ new Set(["openrouter"]);
871
885
  var normalizeProviderName = (providerName) => asTrimmedLowercaseString(providerName);
@@ -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-5KAZHHDM.js");
209
+ const { readAction } = await import("./read-L7QEJETH.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
  getModelConfig
3
- } from "./chunk-TRW43TSC.js";
3
+ } from "./chunk-6EQD4AQL.js";
4
4
  import {
5
5
  isPlatformHostedDeepseekModel,
6
6
  isPlatformHostedOpenAIImageModel,
@@ -4,32 +4,6 @@ import {
4
4
  import {
5
5
  normalizeServerOrigin
6
6
  } from "./chunk-CF7PE763.js";
7
- import {
8
- asTrimmedLowercaseString
9
- } from "./chunk-QSJ3HFEF.js";
10
-
11
- // packages/app/theme/fontPreference.ts
12
- var FONT_PRESET_ALIASES = {
13
- system: "system",
14
- default: "system",
15
- hei: "hei",
16
- heiti: "hei",
17
- sans: "hei",
18
- song: "song",
19
- songti: "song",
20
- serif: "song",
21
- kai: "kai",
22
- kaiti: "kai",
23
- "kai-ti": "kai",
24
- "fang-song": "fang-song",
25
- fangsong: "fang-song",
26
- "fang song": "fang-song"
27
- };
28
- var normalizeFontPreset = (value) => {
29
- const normalized = asTrimmedLowercaseString(value);
30
- if (!Object.hasOwn(FONT_PRESET_ALIASES, normalized)) return void 0;
31
- return FONT_PRESET_ALIASES[normalized];
32
- };
33
7
 
34
8
  // packages/ai/policy/types.ts
35
9
  var DEFAULT_AGENT_BASE_POLICY = {
@@ -147,7 +121,6 @@ var normalizeAgentUpdateFieldList = (value, fallback = DEFAULT_AUTO_APPROVED_SEL
147
121
  };
148
122
 
149
123
  export {
150
- normalizeFontPreset,
151
124
  DEFAULT_AGENT_BASE_POLICY,
152
125
  DEFAULT_USER_PREFERENCE_PROFILE,
153
126
  AGENT_UPDATE_FIELD_NAMES,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  selectIdentityToken
3
- } from "./chunk-SEJ5OS6F.js";
3
+ } from "./chunk-PXYBUFDB.js";
4
4
  import {
5
5
  isAbortError
6
6
  } from "./chunk-7DPNBQSV.js";
@@ -996,7 +996,7 @@ function peek(draft, prop) {
996
996
  return source[prop];
997
997
  }
998
998
  function isRelocatedBaseRef(state, prop, value) {
999
- if (state.type_ !== 1 || !state.allIndicesReassigned_ || state.assigned_?.get(prop) || !isDraftable(value) || value[DRAFT_STATE]) {
999
+ if (state.type_ !== 1 || !state.allIndicesReassigned_ || !isDraftable(value) || value[DRAFT_STATE]) {
1000
1000
  return false;
1001
1001
  }
1002
1002
  return state.baseRefs_.has(value);
@@ -9,7 +9,7 @@ import {
9
9
  resolveRawAgentInput,
10
10
  resolveServerUrl,
11
11
  writeUsage
12
- } from "./chunk-KOB75UNU.js";
12
+ } from "./chunk-JKXXZUO4.js";
13
13
  import {
14
14
  getReadableCliDb
15
15
  } from "./chunk-P5QACQDK.js";
@@ -27,7 +27,7 @@ import {
27
27
  resolveBoundMachineId,
28
28
  resolveFileWriteGateEnabled,
29
29
  resolveLocalUserId
30
- } from "./chunk-EJU23ST5.js";
30
+ } from "./chunk-GJNYJH7O.js";
31
31
  import {
32
32
  clearCredentialAvailability,
33
33
  readCredentialEntry,
@@ -39,7 +39,7 @@ import {
39
39
  t,
40
40
  toolLabel,
41
41
  toolLabelVariants
42
- } from "./chunk-SW4S4XYB.js";
42
+ } from "./chunk-2AB2HA4M.js";
43
43
  import {
44
44
  _appendEntityBatch,
45
45
  _appendEvidenceBatch,
@@ -54,10 +54,13 @@ import {
54
54
  loadMemoryVNextCatalog,
55
55
  putMemoryEvidenceVNext
56
56
  } from "./chunk-TY3TIUJK.js";
57
+ import {
58
+ parsePositiveFiniteNumberOrFallback
59
+ } from "./chunk-Y5GCAMGP.js";
57
60
  import {
58
61
  readDbRecord,
59
62
  resolveAgentRecordFromHybridStore
60
- } from "./chunk-HKT6QXP3.js";
63
+ } from "./chunk-O4KVUI4W.js";
61
64
  import {
62
65
  isLocalCliAgentKey
63
66
  } from "./chunk-NBTY7YJF.js";
@@ -72,30 +75,31 @@ import {
72
75
  } from "./chunk-BMQ2MJUK.js";
73
76
  import {
74
77
  resolveCliLocalRuntimeKeyCapability
75
- } from "./chunk-XFKZ3MCV.js";
78
+ } from "./chunk-R6ABE4UC.js";
76
79
  import {
77
80
  isTransientFetchError
78
- } from "./chunk-I2ZMGXXF.js";
81
+ } from "./chunk-KFHREHUQ.js";
79
82
  import {
80
83
  parseUiCard,
81
84
  uiCardFallback
82
- } from "./chunk-RUNKPFM5.js";
85
+ } from "./chunk-JPSTJHGJ.js";
83
86
  import {
84
87
  isGatewayHttpStatus
85
88
  } from "./chunk-NF64D32W.js";
86
- import {
87
- parsePositiveFiniteNumberOrFallback
88
- } from "./chunk-XPWGOTBQ.js";
89
89
  import {
90
90
  buildMemorySubjectsForAgent,
91
91
  chooseMemoryOwners,
92
92
  loadMemoryCandidatesFromDb,
93
93
  resolveAgentMemoryPolicy
94
- } from "./chunk-7A4LJCDR.js";
94
+ } from "./chunk-OVQFMCVI.js";
95
95
  import {
96
96
  API_REPORTED_COST_MULTIPLIER,
97
- parseUiAskChoiceContent
98
- } from "./chunk-H4KACZMG.js";
97
+ estimateMessagesTokens,
98
+ parseUiAskChoiceContent,
99
+ resolveAgentContextWindow,
100
+ resolveOccupancy,
101
+ resolveOccupancyWindow
102
+ } from "./chunk-MNRZCEYU.js";
99
103
  import {
100
104
  isOAuthApiKeyRef
101
105
  } from "./chunk-UKZX3NHN.js";
@@ -107,14 +111,10 @@ import {
107
111
  LOCAL_AGENT_CONFIG_MISSING_CODE,
108
112
  LOCAL_TURN_ABORTED_CODE,
109
113
  readActionGate
110
- } from "./chunk-PEO24UB5.js";
114
+ } from "./chunk-IULXURBL.js";
111
115
  import {
112
- devinChannelContextWindow,
113
116
  resolveAgentRuntimeConfigFromRecord
114
- } from "./chunk-ANJTRG52.js";
115
- import {
116
- isDevinOAuthAgent
117
- } from "./chunk-5ZUL4CUO.js";
117
+ } from "./chunk-DFWLD7WU.js";
118
118
  import {
119
119
  createThinkParserState,
120
120
  flushThinkParser,
@@ -137,10 +137,7 @@ import {
137
137
  } from "./chunk-3MZAGMYY.js";
138
138
  import {
139
139
  normalizeUsage
140
- } from "./chunk-ZWG3C7VI.js";
141
- import {
142
- findModelContextWindow
143
- } from "./chunk-2MTE2PEH.js";
140
+ } from "./chunk-GB552UJS.js";
144
141
  import {
145
142
  clipCompactText
146
143
  } from "./chunk-5MMAK75Q.js";
@@ -166,7 +163,7 @@ import {
166
163
  } from "./chunk-5EMSBTQ6.js";
167
164
  import {
168
165
  isAntigravityOAuthAgent
169
- } from "./chunk-JGRPBIZZ.js";
166
+ } from "./chunk-SQX235S2.js";
170
167
  import {
171
168
  createRunActivityTracker,
172
169
  createShellApprovalChild,
@@ -179,7 +176,7 @@ import {
179
176
  serverOriginForDialog,
180
177
  settleRunTerminalAuthoritatively,
181
178
  spawnLocalBackgroundRun
182
- } from "./chunk-MM3662RS.js";
179
+ } from "./chunk-42W7LKBM.js";
183
180
  import {
184
181
  formatAgentListCard,
185
182
  formatFinishedRunCard,
@@ -190,15 +187,12 @@ import {
190
187
  formatStopRunCard,
191
188
  isAgentRunTerminalStatus
192
189
  } from "./chunk-PJNFNEJE.js";
193
- import {
194
- estimateTokenCount
195
- } from "./chunk-PSCNXBYA.js";
196
190
  import {
197
191
  resolveClientVersion
198
- } from "./chunk-SUKSWFLP.js";
192
+ } from "./chunk-PIG2IUVZ.js";
199
193
  import {
200
194
  findModelConfig
201
- } from "./chunk-TRW43TSC.js";
195
+ } from "./chunk-6EQD4AQL.js";
202
196
  import {
203
197
  asTrimmedString
204
198
  } from "./chunk-3EUW3WEO.js";
@@ -434,40 +428,6 @@ ${cardText}` : cardText;
434
428
  // packages/chat/messages/attachmentWriteRollout.ts
435
429
  var ENABLE_REMOTE_ATTACHMENT_PART_WRITES = false;
436
430
 
437
- // packages/ai/context/contextOccupancy.ts
438
- function estimateMessagesTokens(messages) {
439
- return messages.reduce((total, message) => {
440
- const content = typeof message.content === "string" ? message.content : message.content == null ? "" : JSON.stringify(message.content);
441
- return total + estimateTokenCount(content) + 4;
442
- }, 0);
443
- }
444
- function historyTokensBeforeLatestAssistant(messages) {
445
- const total = estimateMessagesTokens(messages);
446
- const latest = messages[messages.length - 1];
447
- if (latest?.role !== "assistant") return total;
448
- return Math.max(0, total - estimateMessagesTokens([latest]));
449
- }
450
- function resolveOccupancy(input) {
451
- if (input.authoritativeInput !== void 0 && input.authoritativeInput > 0) {
452
- const generated = Math.max(0, input.generatedSinceAuthority ?? 0);
453
- return {
454
- tokens: input.authoritativeInput + generated,
455
- estimated: generated > 0
456
- };
457
- }
458
- return {
459
- tokens: Math.max(0, input.baselineEstimate ?? 0),
460
- estimated: true
461
- };
462
- }
463
- function resolveOccupancyWindow(ref) {
464
- if (!ref.model) return void 0;
465
- if (isDevinOAuthAgent(ref)) {
466
- return devinChannelContextWindow(ref.model) ?? findModelContextWindow(ref.model, ref.provider);
467
- }
468
- return findModelContextWindow(ref.model, ref.provider);
469
- }
470
-
471
431
  // packages/cli/client/tokenUsage.ts
472
432
  var PLATFORM_CREDIT_UNIT = "credits";
473
433
  var isUsableModelId = (model) => {
@@ -491,34 +451,10 @@ function resolveAgentModelIdentity(opts) {
491
451
  ...model ? { model } : {}
492
452
  };
493
453
  }
494
- function resolveAgentContextWindow(opts) {
454
+ function resolveAgentContextWindow2(opts) {
495
455
  const model = resolveEffectiveModel(opts);
496
456
  if (model) return resolveContextWindow(model);
497
- const byName = opts.agentName?.trim() ? resolveOccupancyWindow({ model: opts.agentName }) : void 0;
498
- if (byName !== void 0) return byName;
499
- const candidates = [
500
- ...modelSlugCandidates(opts.agentKey, 2),
501
- ...modelSlugCandidates(opts.agentName, 1)
502
- ];
503
- for (const candidate of candidates) {
504
- const window = resolveOccupancyWindow({ model: candidate });
505
- if (window !== void 0) return window;
506
- }
507
- return void 0;
508
- }
509
- var AGENT_KEY_PREFIX = /^agent-[a-z0-9]+-/i;
510
- function modelSlugCandidates(source, maxDrop) {
511
- const raw = source?.trim();
512
- if (!raw) return [];
513
- const base = raw.replace(/\s+/g, "-").toLowerCase();
514
- const seed = base.replace(AGENT_KEY_PREFIX, "");
515
- const out = [seed];
516
- if (seed !== base) out.push(base);
517
- const segments = seed.split("-");
518
- for (let drop = 1; drop <= maxDrop && drop < segments.length; drop++) {
519
- out.push(segments.slice(drop).join("-"));
520
- }
521
- return [...new Set(out.filter(Boolean))];
457
+ return resolveAgentContextWindow(opts);
522
458
  }
523
459
  var PROVIDER_LOOKUP_ORDER = [
524
460
  "openrouter",
@@ -11245,7 +11181,7 @@ function isBalanceExhaustedError(error) {
11245
11181
 
11246
11182
  // packages/cli/client/agentRun.ts
11247
11183
  async function loadRunLocalAgentTurn() {
11248
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-O5GDAFTN.js");
11184
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-7JDS3OAL.js");
11249
11185
  return runLocalAgentTurn;
11250
11186
  }
11251
11187
  var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
@@ -11342,7 +11278,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
11342
11278
  // runtimeKey 接线:不传下去则本地 run 的 runtimeKey 在 agentRun 层就断了
11343
11279
  // ——adapter 收不到 → docker workload 永不创建,非 docker 云后端也不会
11344
11280
  // fail-closed(死代码)。
11345
- ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {}
11281
+ ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {},
11282
+ ...options.dockerWorkspaceMode ? { dockerWorkspaceMode: options.dockerWorkspaceMode } : {}
11346
11283
  });
11347
11284
  }
11348
11285
  function resolveLocalRuntimeAdapter(options) {
@@ -11350,7 +11287,8 @@ function resolveLocalRuntimeAdapter(options) {
11350
11287
  cwd: options.localRuntimeCwd,
11351
11288
  // 与 buildDefaultLocalRuntimeAdapter 同口径:注入式 factory 也必须拿到
11352
11289
  // runtimeKey,否则注入了 adapter 的本地 run 会静默丢掉 docker 语义。
11353
- ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {}
11290
+ ...options.runtimeKey ? { runtimeKey: options.runtimeKey } : {},
11291
+ ...options.dockerWorkspaceMode ? { dockerWorkspaceMode: options.dockerWorkspaceMode } : {}
11354
11292
  }) || buildDefaultLocalRuntimeAdapter(options);
11355
11293
  }
11356
11294
  function wrapAdapterEphemeral(adapter) {
@@ -12341,6 +12279,9 @@ async function runLocalAgentTurnForCliWithAdapter(options, settings, resolvedBas
12341
12279
  parentDialogId: options.parentDialogId,
12342
12280
  runtimeContext: runtimeContextWithOwnership,
12343
12281
  runKind: options.env.NOLO_AGENT_RUN_CHILD === "1" ? "subtask" : "interactive",
12282
+ // 展示能力由宿主声明(TUI=narrow),非交互 CLI/后台留空 → unknown;
12283
+ // 排版段只在能力已知时由 localLoop 注入,server 线不读该字段。
12284
+ ...options.responseViewport ? { responseViewport: options.responseViewport } : {},
12344
12285
  background: options.background,
12345
12286
  noStream: options.noStream,
12346
12287
  ...options.contextBlockScopes?.length ? { contextBlockScopes: options.contextBlockScopes } : options.extraContextBlocks?.length ? { contextBlocks: options.extraContextBlocks } : {},
@@ -15770,6 +15711,12 @@ async function runAgentRunCommand(args, deps) {
15770
15711
  } } : {},
15771
15712
  agentName: targetAgentKey,
15772
15713
  agentKey: targetAgentKey,
15714
+ // 当前执行链未提供可靠的最终展示能力,按约定使用 unknown(只注入行为段,不猜
15715
+ // 宽/窄屏;`stdout.isTTY` 只说明是不是终端,说明不了宽度)。这不表示宿主永远
15716
+ // 无法获得尺寸:将来接入时应传展示能力,不应由调用方拼接准则文本。
15717
+ // 放在 buildRunOptions 这个唯一构造点上,首轮 / quota fallback / 队列 drain
15718
+ // 三处 runner(...) 调用自动一致;远端分支走 server 线,不读该字段。
15719
+ responseViewport: "unknown",
15773
15720
  serverUrl: resolveServerUrl(env),
15774
15721
  message: formatTurnMessage(turnMessage),
15775
15722
  imageUrls: parsed.imageUrls.map(normalizeCliImageInput),
@@ -15789,6 +15736,7 @@ async function runAgentRunCommand(args, deps) {
15789
15736
  // runtimeKey 与 machine-shell 的组合已在 parseAgentRunArgs 入口显式拒绝,
15790
15737
  // 这里直接透传即可(不再静默丢弃参数)。
15791
15738
  ...parsed.runtimeKey ? { runtimeKey: parsed.runtimeKey } : {},
15739
+ ...parsed.dockerWorkspaceMode ? { dockerWorkspaceMode: parsed.dockerWorkspaceMode } : {},
15792
15740
  ...parsed.continueDialogId ? { continueDialogId: parsed.continueDialogId } : {},
15793
15741
  ...parsed.strictContinueHistory ? { strictContinueHistory: true } : {},
15794
15742
  ...parsed.spaceId ? { spaceId: parsed.spaceId } : {},
@@ -16059,10 +16007,8 @@ export {
16059
16007
  redactSecrets,
16060
16008
  safeAskText,
16061
16009
  TUI_TREE_MARKER,
16062
- estimateMessagesTokens,
16063
- historyTokensBeforeLatestAssistant,
16064
16010
  resolveAgentModelIdentity,
16065
- resolveAgentContextWindow,
16011
+ resolveAgentContextWindow2 as resolveAgentContextWindow,
16066
16012
  platformCreditsFromUsage,
16067
16013
  formatCreditsChip,
16068
16014
  formatTokenCount,
@@ -0,0 +1,9 @@
1
+ // packages/core/positiveFiniteNumberOrFallback.ts
2
+ function parsePositiveFiniteNumberOrFallback(value, fallback) {
3
+ const parsed = Number(value);
4
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
5
+ }
6
+
7
+ export {
8
+ parsePositiveFiniteNumberOrFallback
9
+ };