nolo-cli 0.12.0-alpha.1 → 0.12.0-alpha.11

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 (82) hide show
  1. package/{_executeModel-MWAY74HA.js → _executeModel-4F7VZR5U.js} +24 -23
  2. package/{action-RAXNQQKC.js → action-OTOWUMPW.js} +3 -3
  3. package/{addContentAction-ZHI7TVV3.js → addContentAction-JGBUVR7K.js} +2 -2
  4. package/{addDialogAgentAction-JWXPKXNC.js → addDialogAgentAction-V6CL2UCF.js} +1 -1
  5. package/{agentDeleteCommand-LXR5A5FV.js → agentDeleteCommand-MMRSG6AB.js} +15 -14
  6. package/{agentEmailCommands-DXRAP7BB.js → agentEmailCommands-VW5FKADD.js} +28 -27
  7. package/{agentListCommands-ZFMS5ZLY.js → agentListCommands-2PZHIQ3I.js} +16 -15
  8. package/{agentMachineCommands-ZJLYVV52.js → agentMachineCommands-T2R7HVRV.js} +17 -16
  9. package/{agentRecordCommands-DFS626TB.js → agentRecordCommands-5DLPK3IV.js} +28 -27
  10. package/{agentRunCommand-GWBIE2TS.js → agentRunCommand-P6EH5DN7.js} +29 -28
  11. package/{agentRuntimeLocal-YNZSHMZC.js → agentRuntimeLocal-QDJCBXM2.js} +12 -11
  12. package/{agentSlice-T2PXOEPQ.js → agentSlice-6JAJOU3X.js} +2 -2
  13. package/{chunk-G3B356GF.js → chunk-2BVGERJ2.js} +67 -3
  14. package/{chunk-WWU275LU.js → chunk-3MI5LDDU.js} +2 -2
  15. package/{chunk-OPZYGHUC.js → chunk-3WGLLTK4.js} +59 -1
  16. package/chunk-5MMAK75Q.js +15 -0
  17. package/{chunk-ZR4VHQ5D.js → chunk-5S4SWV5G.js} +38 -26
  18. package/{chunk-JUN3HFMN.js → chunk-5V524MHX.js} +25 -15
  19. package/{chunk-5ITRDSHY.js → chunk-7HVCFCZK.js} +65 -18
  20. package/{chunk-JZDIW766.js → chunk-ARSC56DC.js} +1 -1
  21. package/{chunk-3QKO4EHV.js → chunk-AS3ZQ3O2.js} +16 -25
  22. package/{chunk-43UD5ZP7.js → chunk-B4KT7RN2.js} +4 -4
  23. package/{chunk-YTQLJYLB.js → chunk-C3BFP57W.js} +95 -2
  24. package/{chunk-QCA3EPYK.js → chunk-CGDQDXKZ.js} +1 -1
  25. package/{chunk-7MYHLZ3F.js → chunk-DPFWKRHG.js} +1 -1
  26. package/{chunk-LHSJMY5V.js → chunk-E2BT7DBP.js} +3 -3
  27. package/{chunk-AM53Q2SD.js → chunk-FSUZIGIG.js} +28 -39
  28. package/{chunk-4GBNEA5B.js → chunk-H5Y2H2N6.js} +1 -1
  29. package/{chunk-S73OEOHH.js → chunk-JFANOO7I.js} +3 -15
  30. package/{chunk-ZPFRLGIZ.js → chunk-JHYLX2QV.js} +70 -37
  31. package/{chunk-OCDEWRE2.js → chunk-JKWWVF2I.js} +1 -1
  32. package/{chunk-WTYKCU4W.js → chunk-JU7J7EAV.js} +37 -37
  33. package/{chunk-EBH7G34M.js → chunk-LIO7AK5S.js} +2 -2
  34. package/{chunk-6OVCRC72.js → chunk-LUKQQJFL.js} +39 -2
  35. package/{chunk-DRMGJFGQ.js → chunk-MG6BVV3T.js} +31 -17
  36. package/{chunk-RSEUHW6T.js → chunk-MQRZ5QUH.js} +1 -1
  37. package/{chunk-RZ735TLX.js → chunk-MZHSAPZP.js} +167 -20
  38. package/{chunk-OPKKB25T.js → chunk-O4FOPRCP.js} +1 -1
  39. package/{chunk-S3UTETIC.js → chunk-OGGHETUE.js} +19 -4
  40. package/{chunk-4EH7AR52.js → chunk-OPM2DE2J.js} +1 -1
  41. package/{chunk-UG3WOFU6.js → chunk-QJSTNKJY.js} +1 -1
  42. package/{chunk-DE5BA4O6.js → chunk-QUHUVG6Y.js} +2 -2
  43. package/{chunk-YDCZVUFP.js → chunk-RQSOAMPJ.js} +16 -0
  44. package/{chunk-6LMFFG3K.js → chunk-RWO5DGXI.js} +2 -2
  45. package/{chunk-4BTHUYMY.js → chunk-TA7VKOHU.js} +23 -9
  46. package/{chunk-MEVCDATU.js → chunk-TQYYGE6G.js} +3 -3
  47. package/{chunk-TSKWE74T.js → chunk-TYPHUVK5.js} +13 -1
  48. package/{chunk-RNQ5BLR2.js → chunk-VBSWHE5W.js} +1 -1
  49. package/{chunk-NITP2JDG.js → chunk-VKG4HXYV.js} +1 -1
  50. package/{chunk-3HHTVM6G.js → chunk-WVTBAALN.js} +1 -1
  51. package/{chunk-GPZM7QH6.js → chunk-Y5P3ZRGC.js} +4 -4
  52. package/{chunk-GDBCUWQ3.js → chunk-YUMYYXPI.js} +31 -167
  53. package/{createAgentAutomationAction-G32GKDGV.js → createAgentAutomationAction-4NY4JLOK.js} +9 -8
  54. package/{createDialogAction-TISANRZK.js → createDialogAction-I5WUWFJ6.js} +10 -9
  55. package/{createPageAction-O7KOYNV4.js → createPageAction-HFTIQ7TW.js} +9 -8
  56. package/{dbSlice-WDP2ZZHK.js → dbSlice-J4PUZ6Y5.js} +1 -1
  57. package/{dialogCommands-6JPB3YQY.js → dialogCommands-SVXRJFZS.js} +16 -15
  58. package/{dialogSlice-PRHHYSP5.js → dialogSlice-35LA3ZRG.js} +9 -8
  59. package/{docCreateCommands-75E6TZNN.js → docCreateCommands-Z7RIAYKQ.js} +15 -14
  60. package/{docDeleteCommands-EJHLN7LW.js → docDeleteCommands-NEYHUVZF.js} +16 -15
  61. package/{docReadCommands-RJYBC4FS.js → docReadCommands-I4US2SDE.js} +15 -14
  62. package/{docStore-H5VWKT5D.js → docStore-3CP2IO6M.js} +10 -9
  63. package/{docUpdateCommands-MG4CNISV.js → docUpdateCommands-UU5HQBRP.js} +15 -14
  64. package/{getPricing-6TOZXPAU.js → getPricing-UGDJHI7M.js} +2 -2
  65. package/{handleSendMessageAction-QTUGICSZ.js → handleSendMessageAction-FWTLQGOZ.js} +9 -8
  66. package/index.js +36 -36
  67. package/{machineCommands-MAV7M3TK.js → machineCommands-J5JWJQ6I.js} +28 -27
  68. package/{machineWsRunDispatch-ZOEGTKHC.js → machineWsRunDispatch-U476S4G2.js} +27 -26
  69. package/package.json +1 -1
  70. package/{readlineWorkspace-SWQKC7ZS.js → readlineWorkspace-AQCPSGS7.js} +260 -87
  71. package/{removeDialogAgentAction-GTX5AN54.js → removeDialogAgentAction-XUZYQBV4.js} +3 -3
  72. package/{runAgentClientLoop-P25HACXX.js → runAgentClientLoop-FP2K33ZO.js} +20 -19
  73. package/{setDialogExtraReferencesAction-WFQ63KYO.js → setDialogExtraReferencesAction-PTAIFKGM.js} +1 -1
  74. package/{setPrimaryDialogAgentAction-P57FXTSU.js → setPrimaryDialogAgentAction-HRFTDB44.js} +3 -3
  75. package/{settingSlice-CK5YZGNI.js → settingSlice-VGRJUSE5.js} +2 -2
  76. package/{skillDiscovery-ZYHSX7VD.js → skillDiscovery-6M2BZUFN.js} +1 -1
  77. package/{spaceCommands-6O5EFEM5.js → spaceCommands-GN73BCOB.js} +15 -14
  78. package/{spaceSlice-4EXTYXS4.js → spaceSlice-WTFNKOVA.js} +11 -8
  79. package/{streamAgentChatTurn-Q3FJAHG2.js → streamAgentChatTurn-HBAQQVNK.js} +244 -26
  80. package/{tools-AHNQE4GP.js → tools-TPQYTLQZ.js} +15 -14
  81. package/{tuiSummaryLlmCaller-TXLF4MEI.js → tuiSummaryLlmCaller-XDC7WG4K.js} +6 -4
  82. package/{updateDialogTitleAction-XZDVLKVX.js → updateDialogTitleAction-AWXNPUQJ.js} +9 -8
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  trimTrailingSlash
3
- } from "./chunk-TSKWE74T.js";
3
+ } from "./chunk-TYPHUVK5.js";
4
4
  import {
5
5
  asTrimmedLowercaseString
6
6
  } from "./chunk-QSJ3HFEF.js";
@@ -1,18 +1,15 @@
1
1
  import {
2
2
  MODEL_LOOKUP_MAP
3
- } from "./chunk-S3UTETIC.js";
4
- import {
5
- compactWhitespace
6
- } from "./chunk-DWLEOOGR.js";
3
+ } from "./chunk-OGGHETUE.js";
7
4
  import {
8
5
  ALL_MODELS
9
6
  } from "./chunk-IKXL2HZ3.js";
10
7
  import {
11
8
  addContentAction
12
- } from "./chunk-3HHTVM6G.js";
9
+ } from "./chunk-WVTBAALN.js";
13
10
  import {
14
11
  upload
15
- } from "./chunk-NITP2JDG.js";
12
+ } from "./chunk-VKG4HXYV.js";
16
13
  import {
17
14
  getRuntimeServerContext
18
15
  } from "./chunk-TSUJOM6N.js";
@@ -2083,14 +2080,6 @@ var normalizeAssistantContentBuffer = async (contentBuffer, dialogId, messageId,
2083
2080
  return updated;
2084
2081
  };
2085
2082
 
2086
- // packages/core/clipCompactText.ts
2087
- function clipCompactText(value, max, ellipsis = "...") {
2088
- const compact = compactWhitespace(value);
2089
- if (compact.length <= max) return compact;
2090
- if (max <= ellipsis.length) return compact.slice(0, max);
2091
- return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
2092
- }
2093
-
2094
2083
  // packages/ai/context/retention.ts
2095
2084
  var SAFE_BUFFER_RATIO = 0.95;
2096
2085
  var CACHE_FIRST_RETENTION_STRENGTH = 0.95;
@@ -2273,7 +2262,6 @@ function planCompression(input) {
2273
2262
  }
2274
2263
 
2275
2264
  export {
2276
- clipCompactText,
2277
2265
  planContextUsage,
2278
2266
  estimateTokenCount,
2279
2267
  DEFAULT_CONTEXT_WINDOW,
@@ -18,7 +18,7 @@ import {
18
18
  isBuiltinNoloAgentRef,
19
19
  t,
20
20
  toolLabel
21
- } from "./chunk-5ITRDSHY.js";
21
+ } from "./chunk-7HVCFCZK.js";
22
22
  import {
23
23
  CliProviderQuotaError
24
24
  } from "./chunk-CMKUBIGW.js";
@@ -28,10 +28,10 @@ import {
28
28
  import {
29
29
  readDbRecord,
30
30
  resolveAgentRecordFromHybridStore
31
- } from "./chunk-QCA3EPYK.js";
31
+ } from "./chunk-CGDQDXKZ.js";
32
32
  import {
33
33
  normalizeAgentHandle
34
- } from "./chunk-RNQ5BLR2.js";
34
+ } from "./chunk-VBSWHE5W.js";
35
35
  import {
36
36
  NOLO_PROJECT_MANAGER_AGENT_KEY,
37
37
  isLocalCliAgentKey
@@ -48,14 +48,14 @@ import {
48
48
  formatStatusRunCard,
49
49
  formatStopRunCard,
50
50
  isAgentRunTerminalStatus
51
- } from "./chunk-RZ735TLX.js";
51
+ } from "./chunk-MZHSAPZP.js";
52
52
  import {
53
53
  isGatewayHttpStatus
54
- } from "./chunk-YDCZVUFP.js";
54
+ } from "./chunk-RQSOAMPJ.js";
55
55
  import {
56
56
  buildMemorySubjectsForAgent,
57
57
  resolveAgentMemoryPolicy
58
- } from "./chunk-G3B356GF.js";
58
+ } from "./chunk-2BVGERJ2.js";
59
59
  import {
60
60
  parseExternalSkillMarkdown,
61
61
  parseSkillDocProtocol
@@ -64,14 +64,14 @@ import {
64
64
  API_REPORTED_COST_MULTIPLIER,
65
65
  normalizeUsage,
66
66
  parseUiAskChoiceContent
67
- } from "./chunk-AM53Q2SD.js";
67
+ } from "./chunk-FSUZIGIG.js";
68
68
  import {
69
69
  buildSkillDiscoveryContextBlock
70
- } from "./chunk-3QKO4EHV.js";
70
+ } from "./chunk-AS3ZQ3O2.js";
71
71
  import {
72
72
  buildPlatformChatCompletionRequest,
73
73
  parsePlatformChatCompletionData
74
- } from "./chunk-ZR4VHQ5D.js";
74
+ } from "./chunk-5S4SWV5G.js";
75
75
  import {
76
76
  resolveAgentRuntimeConfigFromRecord
77
77
  } from "./chunk-NCGFB7NN.js";
@@ -80,18 +80,20 @@ import {
80
80
  LOCAL_TURN_ABORTED_CODE,
81
81
  readActionGate,
82
82
  readCommandActionGatePayload
83
- } from "./chunk-4BTHUYMY.js";
83
+ } from "./chunk-TA7VKOHU.js";
84
84
  import {
85
85
  resolvePlatformChatCompletionsEndpoint
86
- } from "./chunk-TSKWE74T.js";
86
+ } from "./chunk-TYPHUVK5.js";
87
87
  import {
88
88
  DEFAULT_CONTEXT_WINDOW,
89
- clipCompactText,
90
89
  getModelContextWindow
91
- } from "./chunk-S73OEOHH.js";
90
+ } from "./chunk-JFANOO7I.js";
91
+ import {
92
+ clipCompactText
93
+ } from "./chunk-5MMAK75Q.js";
92
94
  import {
93
95
  findModelConfig
94
- } from "./chunk-S3UTETIC.js";
96
+ } from "./chunk-OGGHETUE.js";
95
97
  import {
96
98
  buildMemoryOverlayLayer,
97
99
  buildMemoryUseGuidanceLayer
@@ -151,6 +153,12 @@ var INTENT_PROVIDER = "deepseek";
151
153
  var QUICK_CHAT_INTENT_TIMEOUT_MS = 4e3;
152
154
  var SHORT_GREETING_MAX_LENGTH = 20;
153
155
  var SHORT_GREETING_PATTERN = /^(?:hi|hello|hey|hiya|yo|sup|howdy|嗨|哈喽|哈囉|你好|您好|在吗|在嘛|喂|早上好|中午好|下午好|晚上好|拜拜|再见|谢谢|thanks|thx|ok|好的|收到|了解)[!.。,、~~]?$/iu;
156
+ var VALID_QUICK_CHAT_SKILLS = /* @__PURE__ */ new Set([
157
+ "table",
158
+ "doc",
159
+ "code",
160
+ "pagebuilder"
161
+ ]);
154
162
  function isShortGreeting(text) {
155
163
  const trimmed = text.trim();
156
164
  if (!trimmed) return false;
@@ -206,10 +214,11 @@ ${agentList}
206
214
  - \u7528\u6237\u8981\u65B0\u5EFA/\u6574\u7406/\u5F55\u5165/\u6279\u91CF\u5904\u7406\u8868\u683C\u6570\u636E\uFF08\u5EFA\u8868\u3001\u52A0\u884C\u3001\u6539\u5217\u3001\u6309\u6761\u4EF6\u6574\u7406\u6570\u636E\uFF09\u2192 skills \u542B "table"
207
215
  - \u7528\u6237\u8981\u5199/\u6DA6\u8272/\u6539\u5199/\u7EED\u5199/\u6392\u7248\u4E00\u7BC7\u6587\u6863\u6216\u6587\u7AE0 \u2192 skills \u542B "doc"
208
216
  - \u7528\u6237\u8981\u5199/\u6539/\u5B9E\u73B0/\u4FEE bug/refactor/\u8865\u6D4B\u8BD5/\u5BA1\u67E5\u5E76\u4FEE\u6539\u4EE3\u7801 \u2192 skills \u542B "code"\uFF08\u4EC5\u95EE\u901A\u7528\u77E5\u8BC6\u3001\u7EAF\u95F2\u804A\u3001\u53EA\u67E5\u770B git/\u4ED3\u5E93\u72B6\u6001\u800C\u4E0D\u4FEE\u6539\u4EE3\u7801\u65F6\u4E0D\u6302 "code"\uFF09
217
+ - \u7528\u6237\u60F3\u8981\u4E00\u4E2A\u53EF\u4EA4\u4E92\u7684\u53EF\u89C6\u5316\u9875\u9762/\u62A5\u544A/\u770B\u677F/\u4E3B\u9875/\u6559\u7A0B/\u5BF9\u6BD4\u9875/\u8BA1\u5212\u9875\uFF08\u5982"\u505A\u4E2A\u65E5\u62A5""\u505A\u4E00\u4E2A\u4E2A\u4EBA\u4E3B\u9875""\u505A\u4E2A\u9500\u552E\u770B\u677F""\u505A\u4E2A\u65B9\u6848\u5BF9\u6BD4\u9875""\u505A\u4E2A\u5B66\u4E60\u8BA1\u5212\u9875"\uFF09\u2192 skills \u542B "pagebuilder"
209
218
  - \u666E\u901A\u95EE\u7B54/\u7EAF\u95F2\u804A/\u5EFA\u5E94\u7528 \u2192 skills \u4E3A []
210
219
 
211
220
  \u53EA\u8F93\u51FA JSON\uFF0C\u4E0D\u8981\u8F93\u51FA\u5176\u4ED6\u5185\u5BB9\uFF1A
212
- {"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "needsWorkspace": <true \u6216 false>, "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F "table" | "doc" | "code"\uFF0C\u672A\u547D\u4E2D\u7ED9 []>}`;
221
+ {"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "needsWorkspace": <true \u6216 false>, "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F ${[...VALID_QUICK_CHAT_SKILLS].map((s) => `"${s}"`).join(" | ")}\uFF0C\u672A\u547D\u4E2D\u7ED9 []>}`;
213
222
  }
214
223
  function parseQuickChatIntentResult(content, tierAgents) {
215
224
  try {
@@ -226,7 +235,7 @@ function parseQuickChatIntentResult(content, tierAgents) {
226
235
  let skills;
227
236
  if (Array.isArray(rawSkills)) {
228
237
  const filtered = [...new Set(rawSkills)].filter(
229
- (s) => s === "table" || s === "doc" || s === "code"
238
+ (s) => typeof s === "string" && VALID_QUICK_CHAT_SKILLS.has(s)
230
239
  );
231
240
  if (filtered.length > 0) skills = filtered;
232
241
  }
@@ -808,14 +817,14 @@ var THEME_PALETTES = {
808
817
  muted: { hex: "6E7781", ansiFallback: "\x1B[90m" }
809
818
  },
810
819
  dark: {
811
- accent: { hex: "58A6FF", ansiFallback: "\x1B[34m" },
812
- // GitHub sky blue
813
- chrome: { hex: "6E7681", ansiFallback: "\x1B[90m" },
814
- success: { hex: "3FB950", ansiFallback: "\x1B[32m" },
815
- warning: { hex: "D29922", ansiFallback: "\x1B[33m" },
816
- info: { hex: "58A6FF", ansiFallback: "\x1B[36m" },
817
- danger: { hex: "FF7B72", ansiFallback: "\x1B[31m" },
818
- muted: { hex: "B1BAC4", ansiFallback: "\x1B[90m" }
820
+ accent: { hex: "89B4FA", ansiFallback: "\x1B[34m" },
821
+ // Catppuccin Mocha Blue
822
+ chrome: { hex: "6C7086", ansiFallback: "\x1B[90m" },
823
+ success: { hex: "A6E3A1", ansiFallback: "\x1B[32m" },
824
+ warning: { hex: "F9E2AF", ansiFallback: "\x1B[33m" },
825
+ info: { hex: "89B4FA", ansiFallback: "\x1B[36m" },
826
+ danger: { hex: "F38BA8", ansiFallback: "\x1B[31m" },
827
+ muted: { hex: "A6ADC8", ansiFallback: "\x1B[90m" }
819
828
  }
820
829
  },
821
830
  wave: {
@@ -967,7 +976,7 @@ function hexToSgr(hex) {
967
976
  }
968
977
  var SURFACE_HEX = {
969
978
  trail: { light: "E4E8EC", dark: "313244" },
970
- catppuccin: { light: "E8ECF0", dark: "161B22" },
979
+ catppuccin: { light: "E8ECF0", dark: "181825" },
971
980
  wave: { light: "E5E1D6", dark: "2A2A37" },
972
981
  iris: { light: "E9E8F2", dark: "2A2740" },
973
982
  rose: { light: "F2EAE4", dark: "26233A" },
@@ -3151,6 +3160,12 @@ ${options.agentName} > `);
3151
3160
  spinner.show(activeLabel);
3152
3161
  options.activityReporter?.(activeLabel);
3153
3162
  }
3163
+ if (event.type === "tool-result" && options.onAgentRunStatus && (event.toolName === "startAgentRun" || event.toolName === "controlAgentRun")) {
3164
+ const snapshot = extractAgentRunStatusSnapshot(event);
3165
+ if (snapshot) {
3166
+ options.onAgentRunStatus(snapshot);
3167
+ }
3168
+ }
3154
3169
  };
3155
3170
  return {
3156
3171
  spinner,
@@ -3199,6 +3214,30 @@ ${options.agentName} > (no text response)
3199
3214
  }
3200
3215
  };
3201
3216
  }
3217
+ function extractAgentRunStatusSnapshot(event) {
3218
+ if (event.type !== "tool-result") return null;
3219
+ const content = typeof event.content === "string" ? event.content.trim() : "";
3220
+ if (!content.startsWith("{")) return null;
3221
+ try {
3222
+ const parsed = JSON.parse(content);
3223
+ const runId = typeof parsed.runId === "string" ? parsed.runId : "";
3224
+ const status = typeof parsed.status === "string" ? parsed.status : "running";
3225
+ const agentName = typeof parsed.agentName === "string" ? parsed.agentName : typeof parsed.name === "string" ? parsed.name : void 0;
3226
+ const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
3227
+ const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
3228
+ const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
3229
+ return {
3230
+ runId,
3231
+ agentName,
3232
+ status,
3233
+ logTail,
3234
+ logLines,
3235
+ errorMessage
3236
+ };
3237
+ } catch {
3238
+ return null;
3239
+ }
3240
+ }
3202
3241
 
3203
3242
  // packages/cli/client/agentRunStream.ts
3204
3243
  async function readStreamingAgentRun(options, res, existingSpinner) {
@@ -3581,7 +3620,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3581
3620
  // packages/cli/client/agentRun.ts
3582
3621
  import { ulid } from "ulid";
3583
3622
  async function loadRunLocalAgentTurn() {
3584
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YNZSHMZC.js");
3623
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QDJCBXM2.js");
3585
3624
  return runLocalAgentTurn;
3586
3625
  }
3587
3626
  async function resolveCurrentMachineId(options) {
@@ -4018,7 +4057,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4018
4057
  } : void 0;
4019
4058
  const currentDialogId = options.continueDialogId ?? ulid();
4020
4059
  const runChildTurn = async (input) => {
4021
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YNZSHMZC.js");
4060
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QDJCBXM2.js");
4022
4061
  return runLocalAgentTurn(input);
4023
4062
  };
4024
4063
  const createFreshChildBaseAdapter = () => {
@@ -4243,8 +4282,7 @@ function workflowRefToCandidatePath(cwd, ref) {
4243
4282
  return resolve(cwd, "docs", "workflows", `${fileName}.md`);
4244
4283
  }
4245
4284
  var SKILL_SEARCH_DIRS = [
4246
- ".agents/skills",
4247
- "docs/skills"
4285
+ ".agents/skills"
4248
4286
  ];
4249
4287
  function skillRefToCandidatePath(cwd, ref) {
4250
4288
  const normalized = ref.trim();
@@ -4255,15 +4293,10 @@ function skillRefToCandidatePath(cwd, ref) {
4255
4293
  }
4256
4294
  const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
4257
4295
  for (const dir of SKILL_SEARCH_DIRS) {
4258
- if (dir === "docs/skills") {
4259
- const flatPath = resolve(cwd, dir, `${fileName}.md`);
4260
- if (existsSync(flatPath)) return flatPath;
4261
- } else {
4262
- const skillMdPath = resolve(cwd, dir, fileName, "SKILL.md");
4263
- if (existsSync(skillMdPath)) return skillMdPath;
4264
- }
4296
+ const skillMdPath = resolve(cwd, dir, fileName, "SKILL.md");
4297
+ if (existsSync(skillMdPath)) return skillMdPath;
4265
4298
  }
4266
- return resolve(cwd, "docs", "skills", `${fileName}.md`);
4299
+ return resolve(cwd, ".agents", "skills", fileName, "SKILL.md");
4267
4300
  }
4268
4301
  async function resolveWorkflowReference(ref, cwd = process.cwd()) {
4269
4302
  const path = workflowRefToCandidatePath(cwd, ref);
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CWMSB67P.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-S3UTETIC.js";
9
+ } from "./chunk-OGGHETUE.js";
10
10
  import {
11
11
  asOptionalFiniteNumber
12
12
  } from "./chunk-WWC7I6TA.js";
@@ -10,7 +10,7 @@ import {
10
10
  toTimestampMs,
11
11
  upsert,
12
12
  write
13
- } from "./chunk-NITP2JDG.js";
13
+ } from "./chunk-VKG4HXYV.js";
14
14
  import {
15
15
  createUserKey,
16
16
  createUserPreferenceKey,
@@ -763,41 +763,41 @@ var catppuccin = {
763
763
  textOnPrimary: "#FFFFFF"
764
764
  },
765
765
  dark: {
766
- // Ghostty GitHub Dark Default — #0D1117 canvas + sky blue #58A6FF accent
767
- primary: "#58A6FF",
768
- primaryLight: "#79C0FF",
769
- primaryDark: "#1F6FEB",
770
- primaryGradient: "linear-gradient(135deg, #58A6FF, #79C0FF)",
771
- primaryGhost: "rgba(88,166,255,0.10)",
772
- primaryHover: "rgba(88,166,255,0.12)",
773
- borderAccent: "#1F6FEB",
774
- success: "#3FB950",
775
- warning: "#D29922",
776
- info: "#58A6FF",
777
- error: "#FF7B72",
778
- background: "#0D1117",
779
- backgroundSecondary: "#161B22",
780
- backgroundTertiary: "#21262D",
781
- backgroundGhost: "rgba(13,17,23,0.94)",
782
- backgroundHover: "#1C2128",
783
- backgroundSelected: "#1F6FEB",
784
- backgroundElevated: "#161B22",
785
- text: "#E6EDF3",
786
- textSecondary: "#B1BAC4",
787
- textTertiary: "#8B949E",
788
- textQuaternary: "#6E7681",
789
- textLight: "#30363D",
790
- placeholder: "#6E7681",
791
- border: "#30363D",
792
- borderHover: "#424A53",
793
- borderLight: "#21262D",
794
- messageBackground: "#161B22",
795
- codeBackground: "#161B22",
796
- shadowLight: "rgba(13,17,23,0.18)",
797
- shadowMedium: "rgba(13,17,23,0.30)",
798
- shadowHeavy: "rgba(13,17,23,0.44)",
799
- textHeading: "#E6EDF3",
800
- textOnPrimary: "#0D1117"
766
+ // Catppuccin Mocha — 柔和夜间色调(告别高对比刺眼黑白,偏向 Ghostty Catppuccin Mocha)
767
+ primary: "#89B4FA",
768
+ primaryLight: "#B4BEFE",
769
+ primaryDark: "#74C7EC",
770
+ primaryGradient: "linear-gradient(135deg, #89B4FA, #B4BEFE)",
771
+ primaryGhost: "rgba(137,180,250,0.12)",
772
+ primaryHover: "rgba(137,180,250,0.16)",
773
+ borderAccent: "#89B4FA",
774
+ success: "#A6E3A1",
775
+ warning: "#F9E2AF",
776
+ info: "#89B4FA",
777
+ error: "#F38BA8",
778
+ background: "#1E1E2E",
779
+ backgroundSecondary: "#181825",
780
+ backgroundTertiary: "#313244",
781
+ backgroundGhost: "rgba(30,30,46,0.94)",
782
+ backgroundHover: "#313244",
783
+ backgroundSelected: "#45475A",
784
+ backgroundElevated: "#181825",
785
+ text: "#CDD6F4",
786
+ textSecondary: "#BAC2DE",
787
+ textTertiary: "#A6ADC8",
788
+ textQuaternary: "#6C7086",
789
+ textLight: "#45475A",
790
+ placeholder: "#6C7086",
791
+ border: "#313244",
792
+ borderHover: "#45475A",
793
+ borderLight: "#181825",
794
+ messageBackground: "#181825",
795
+ codeBackground: "#11111B",
796
+ shadowLight: "rgba(17,17,27,0.22)",
797
+ shadowMedium: "rgba(17,17,27,0.36)",
798
+ shadowHeavy: "rgba(17,17,27,0.52)",
799
+ textHeading: "#CDD6F4",
800
+ textOnPrimary: "#1E1E2E"
801
801
  }
802
802
  };
803
803
 
@@ -1594,7 +1594,7 @@ var selectTheme = createSelector(
1594
1594
  surface: c.backgroundSecondary,
1595
1595
  surfaceElevated: c.backgroundTertiary,
1596
1596
  surfaceCanvas: c.background,
1597
- surfaceSidebar: isDark ? c.backgroundSecondary : c.background,
1597
+ surfaceSidebar: c.background,
1598
1598
  surfacePanel: c.backgroundSecondary,
1599
1599
  surfaceCard: c.messageBackground,
1600
1600
  surfaceRaised: isDark ? c.backgroundTertiary : c.backgroundSecondary,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-5ITRDSHY.js";
3
+ } from "./chunk-7HVCFCZK.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-W4NVOSFF.js";
@@ -12,7 +12,7 @@ import {
12
12
  resolveAgentRecordFromHybridStore,
13
13
  sanitizeAgentRecordForCliOutput,
14
14
  writeAgentRecord
15
- } from "./chunk-QCA3EPYK.js";
15
+ } from "./chunk-CGDQDXKZ.js";
16
16
  import {
17
17
  resolveCliAgentKeyInput
18
18
  } from "./chunk-VHBWHNVT.js";
@@ -1,6 +1,12 @@
1
+ import {
2
+ isImageUrlPart
3
+ } from "./chunk-TYPHUVK5.js";
1
4
  import {
2
5
  canonicalizeToolNames
3
- } from "./chunk-43UD5ZP7.js";
6
+ } from "./chunk-B4KT7RN2.js";
7
+ import {
8
+ asTrimmedLowercaseString
9
+ } from "./chunk-QSJ3HFEF.js";
4
10
  import {
5
11
  asTrimmedString
6
12
  } from "./chunk-3EUW3WEO.js";
@@ -232,8 +238,39 @@ var buildCurrentTimeBlock = (now = /* @__PURE__ */ new Date(), timeZone = resolv
232
238
  "\u5F53\u7528\u6237\u8BF4\u201C\u4ECA\u5929\u201D\u201C\u4ECA\u65E5\u201D\u6216 today \u65F6\uFF0C\u9ED8\u8BA4\u6307\u5F53\u524D\u672C\u5730\u65E5\u671F\uFF0C\u9664\u975E\u7528\u6237\u660E\u786E\u7ED9\u51FA\u5176\u5B83\u65E5\u671F\u3002"
233
239
  ].join("\n");
234
240
 
241
+ // packages/core/chat/bareImageUrlShape.ts
242
+ function requiresBareImageUrl(args) {
243
+ const model = asTrimmedLowercaseString(args.model);
244
+ if (!model.startsWith("gpt-")) return false;
245
+ const provider = asTrimmedLowercaseString(args.provider);
246
+ if (provider === "opencode-go") return true;
247
+ return asTrimmedLowercaseString(args.endpoint).includes("opencode.ai/zen/go");
248
+ }
249
+ function toBareImageUrlContent(content) {
250
+ if (!Array.isArray(content)) return content;
251
+ let changed = false;
252
+ const parts = content.map((part) => {
253
+ if (!isImageUrlPart(part)) return part;
254
+ const imageUrl = part.image_url;
255
+ if (!imageUrl || typeof imageUrl !== "object") return part;
256
+ const url = imageUrl.url;
257
+ if (typeof url !== "string" || !url) return part;
258
+ changed = true;
259
+ return { ...part, image_url: url };
260
+ });
261
+ return changed ? parts : content;
262
+ }
263
+ function toBareImageUrlMessages(messages) {
264
+ return messages.map((message) => {
265
+ const content = toBareImageUrlContent(message.content);
266
+ return content === message.content ? message : { ...message, content };
267
+ });
268
+ }
269
+
235
270
  export {
236
271
  buildIdentityBlock,
237
272
  buildRuntimeGuidanceBlocks,
238
- buildCurrentTimeBlock
273
+ buildCurrentTimeBlock,
274
+ requiresBareImageUrl,
275
+ toBareImageUrlMessages
239
276
  };
@@ -1,27 +1,33 @@
1
1
  import {
2
2
  applyChatCompletionDelta,
3
- finalizeAccumulatedToolCalls,
4
3
  flushChatCompletionStream,
4
+ providerHttpFailure,
5
5
  readSseFrames,
6
6
  throwIfChatCompletionStreamFailed
7
- } from "./chunk-ZR4VHQ5D.js";
7
+ } from "./chunk-5S4SWV5G.js";
8
8
  import {
9
9
  parseToolArgumentsJson
10
- } from "./chunk-4BTHUYMY.js";
10
+ } from "./chunk-TA7VKOHU.js";
11
11
  import {
12
12
  createThinkParserState,
13
- extractThinkContent
14
- } from "./chunk-OPZYGHUC.js";
13
+ createToolCallAccumulator,
14
+ extractThinkContent,
15
+ finalizeAccumulatedToolCalls
16
+ } from "./chunk-3WGLLTK4.js";
17
+ import {
18
+ requiresBareImageUrl,
19
+ toBareImageUrlMessages
20
+ } from "./chunk-LUKQQJFL.js";
15
21
  import {
16
22
  buildProviderAuthHeaders,
17
23
  buildProviderExecutionPlan,
18
24
  toOpenAiCompatibleMessages
19
- } from "./chunk-TSKWE74T.js";
25
+ } from "./chunk-TYPHUVK5.js";
20
26
  import {
21
27
  canonicalizeToolName,
22
28
  createGlob,
23
29
  resolveExecutableOnPath
24
- } from "./chunk-43UD5ZP7.js";
30
+ } from "./chunk-B4KT7RN2.js";
25
31
  import {
26
32
  toErrorMessage
27
33
  } from "./chunk-HNMXYYJR.js";
@@ -81,9 +87,14 @@ function parseSseDataLineJson(line) {
81
87
 
82
88
  // packages/agent-runtime/openAiCompatibleProvider.ts
83
89
  function buildOpenAiCompatibleChatCompletionRequest(args) {
90
+ const messages = toOpenAiCompatibleMessages(args.messages);
84
91
  const body = {
85
92
  model: args.providerConfig.model,
86
- messages: toOpenAiCompatibleMessages(args.messages),
93
+ messages: requiresBareImageUrl({
94
+ endpoint: args.providerConfig.endpoint,
95
+ provider: args.providerConfig.provider,
96
+ model: args.providerConfig.model
97
+ }) ? toBareImageUrlMessages(messages) : messages,
87
98
  stream: args.stream ?? false,
88
99
  ...args.providerConfig.requestOptions,
89
100
  ...args.tools && args.tools.length > 0 ? { tools: args.tools } : {},
@@ -121,6 +132,9 @@ function parseOpenAiCompatibleChatCompletionResponse(args) {
121
132
  ...reasoning ? { reasoning_content: reasoning } : {},
122
133
  ...typeof choiceMessage?.reasoning_content === "string" && choiceMessage.reasoning_content ? { reasoning_content: choiceMessage.reasoning_content } : {},
123
134
  ...typeof rawFinishReason === "string" && rawFinishReason.length > 0 ? { finish_reason: rawFinishReason } : {},
135
+ // 非流式:拿到完整的 200 JSON body 本身就证明这次调用走完了,
136
+ // 不必等 finish_reason(有从不发它的上游,见 AgentRuntimeResult)。
137
+ stream_complete: true,
124
138
  usage: args.data?.usage,
125
139
  trace: args.trace
126
140
  };
@@ -137,7 +151,7 @@ async function readOpenAiCompatibleSseCompletion(args) {
137
151
  content: "",
138
152
  reasoning: "",
139
153
  usage: void 0,
140
- accumulatedToolCalls: {},
154
+ accumulatedToolCalls: createToolCallAccumulator(),
141
155
  thinkState: createThinkParserState(),
142
156
  onTextDelta: args.onTextDelta,
143
157
  onReasoningDelta: args.onReasoningDelta
@@ -152,7 +166,7 @@ async function readOpenAiCompatibleSseCompletion(args) {
152
166
  content: state.content,
153
167
  ...state.reasoning ? { reasoning_content: state.reasoning } : {},
154
168
  ...tool_calls.length > 0 ? { tool_calls } : {},
155
- ...state.usage ? { usage: state.usage } : {},
169
+ ...state.usage ? { usage: state.usage, stream_complete: true } : {},
156
170
  ...state.finishReason ? { finish_reason: state.finishReason } : {}
157
171
  };
158
172
  }
@@ -183,13 +197,12 @@ async function executeOpenAiCompatibleChatCompletion(args) {
183
197
  }
184
198
  }
185
199
  if (!res.ok) {
186
- const raw2 = await res.text().catch(() => "");
187
- let data2 = raw2;
188
- try {
189
- data2 = JSON.parse(raw2);
190
- } catch {
191
- }
192
- throw new Error(`local provider failed: HTTP ${res.status} ${JSON.stringify(data2)}`);
200
+ throw providerHttpFailure({
201
+ label: "local provider",
202
+ status: res.status,
203
+ raw: await res.text().catch(() => ""),
204
+ messages: args.messages
205
+ });
193
206
  }
194
207
  const contentType = res.headers.get("content-type") ?? "";
195
208
  const isEventStream = contentType.includes("text/event-stream");
@@ -206,6 +219,7 @@ async function executeOpenAiCompatibleChatCompletion(args) {
206
219
  ...streamed.tool_calls ? { tool_calls: streamed.tool_calls } : {},
207
220
  ...streamed.reasoning_content ? { reasoning_content: streamed.reasoning_content } : {},
208
221
  ...streamed.usage ? { usage: streamed.usage } : {},
222
+ ...streamed.stream_complete ? { stream_complete: true } : {},
209
223
  ...streamed.finish_reason ? { finish_reason: streamed.finish_reason } : {},
210
224
  trace: args.messages
211
225
  };
@@ -2,7 +2,7 @@ import {
2
2
  CORE_DRAIN_REASON,
3
3
  isGatewayHttpStatus,
4
4
  parseRetryAfterHeaderMs
5
- } from "./chunk-YDCZVUFP.js";
5
+ } from "./chunk-RQSOAMPJ.js";
6
6
  import {
7
7
  asTrimmedLowercaseString
8
8
  } from "./chunk-QSJ3HFEF.js";