nolo-cli 0.90.0-alpha.1 → 0.91.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 (173) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-W26HVI75.js → _executeModel-H35GQ2XO.js} +61 -60
  3. package/{action-6DXQGJMX.js → action-3ZOODRBC.js} +11 -11
  4. package/{addContentAction-I7VX5SAC.js → addContentAction-IJHG2ZV7.js} +9 -9
  5. package/{addDialogAgentAction-OJSFV7DZ.js → addDialogAgentAction-IGFS2UBX.js} +11 -11
  6. package/{agentDeleteCommand-XNFWCKBH.js → agentDeleteCommand-XOFMXMHW.js} +43 -42
  7. package/{agentEmailCommands-W3X3EJ3V.js → agentEmailCommands-H2SEP6ZQ.js} +82 -78
  8. package/{agentGrantCommands-YW6PQAQ2.js → agentGrantCommands-M3XFO6EN.js} +2 -2
  9. package/{agentListCommands-DFWFU6XO.js → agentListCommands-RYGH6NUL.js} +72 -80
  10. package/{agentMachineCommands-LMFOAEL4.js → agentMachineCommands-XELOBZIP.js} +37 -36
  11. package/{agentProviderCommands-ZBYHGTGY.js → agentProviderCommands-JCRK6ST2.js} +1 -1
  12. package/{agentPullCommand-GLOOXJ2E.js → agentPullCommand-HF4A42D4.js} +3 -3
  13. package/agentRecordCommands-43HAXAZO.js +130 -0
  14. package/{agentRunCommand-HTBVIBGV.js → agentRunCommand-GIPN6DBO.js} +80 -75
  15. package/{agentRunControl-XLGD3UZ5.js → agentRunControl-AVJR4JW4.js} +2 -2
  16. package/{agentRuntimeLocal-2JFG4HDU.js → agentRuntimeLocal-SDOSSCLU.js} +38 -33
  17. package/{agentSlice-ZNLGFUB5.js → agentSlice-B2DLZMAC.js} +11 -11
  18. package/{appDeleteCommands-2UN4N2NR.js → appDeleteCommands-7OR5MAOR.js} +37 -36
  19. package/{appDeployCommands-37D74KRR.js → appDeployCommands-5GNI723H.js} +37 -36
  20. package/{appDeployStatusCommands-QBLWL2IA.js → appDeployStatusCommands-WL2NG3SG.js} +37 -36
  21. package/{appGetCommands-6KXIDF2T.js → appGetCommands-7BVKQS44.js} +37 -36
  22. package/{appListCommands-G2WFGEWQ.js → appListCommands-5VXFJOBU.js} +37 -36
  23. package/{authCommand-V2DJ7DB7.js → authCommand-N4Q6463J.js} +115 -23
  24. package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
  25. package/{builtinSkillRegistry-WBGYKIAZ.js → builtinSkillRegistry-JPY2DKRF.js} +7 -7
  26. package/{chatQueueReduxAdapter-XCJHIY3R.js → chatQueueReduxAdapter-3KDRKXTT.js} +29 -29
  27. package/{chromeCommands-VOIRNJBL.js → chromeCommands-NKU3OWKH.js} +36 -11
  28. package/{chromeOpsCommands-M7DPCX2T.js → chromeOpsCommands-OQDJGD4Y.js} +31 -1
  29. package/{chunk-4BYPU626.js → chunk-232453C2.js} +994 -1036
  30. package/{chunk-SMZSWB44.js → chunk-25GAGMRK.js} +6 -83
  31. package/{chunk-PH5J5VUY.js → chunk-3IYMTWYZ.js} +22 -22
  32. package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
  33. package/{chunk-TVNI5FLG.js → chunk-46CRK7XP.js} +7 -7
  34. package/{chunk-2ADBVBEM.js → chunk-55VQ4OPL.js} +4 -4
  35. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  36. package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
  37. package/{chunk-3R5PH4IP.js → chunk-64TIEZHF.js} +1 -1
  38. package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
  39. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  40. package/{chunk-WXPVOQD7.js → chunk-6PELJ3DS.js} +533 -236
  41. package/{chunk-NFMHIUY3.js → chunk-7EMJBGCA.js} +966 -218
  42. package/{chunk-HYZHJ5GW.js → chunk-7YMUSSHQ.js} +93 -93
  43. package/chunk-ACTMNVHM.js +93 -0
  44. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  45. package/{chunk-UKWGR5SS.js → chunk-AUXHZ2M5.js} +186 -397
  46. package/{chunk-7MYYE7WX.js → chunk-B4PW6UAI.js} +61 -34
  47. package/{chunk-4DRWWIOL.js → chunk-B7ANJQWZ.js} +2 -2
  48. package/{chunk-XKQJJK4F.js → chunk-BAAKVSMZ.js} +4 -4
  49. package/{chunk-FQYMLZ6C.js → chunk-BFCXG6AJ.js} +16 -16
  50. package/{chunk-ZBT3WNBK.js → chunk-BJUDYFV5.js} +10 -2
  51. package/chunk-BMQ2MJUK.js +153 -0
  52. package/{chunk-TL6L5XUT.js → chunk-BNGW5ASC.js} +94 -16
  53. package/{chunk-JTK3TJYV.js → chunk-BTSYHR7J.js} +4 -4
  54. package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
  55. package/{chunk-JEDZAO7L.js → chunk-D2W6WRHT.js} +13 -8
  56. package/{chunk-6BEA566T.js → chunk-D76D3RTR.js} +2 -2
  57. package/{chunk-HQCSU3DI.js → chunk-DCLMZ5TX.js} +4 -4
  58. package/{chunk-L2ICPOAL.js → chunk-EFZKILX6.js} +4 -4
  59. package/{chunk-JBBZ5KUM.js → chunk-EHO5EGU4.js} +23 -76
  60. package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
  61. package/{chunk-ABQYVJBJ.js → chunk-ETZWFV6M.js} +1 -1
  62. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  63. package/{chunk-VHJLQHPQ.js → chunk-F64B2W3R.js} +110 -34
  64. package/{chunk-AQZRTHDZ.js → chunk-G4EMOUX3.js} +886 -154
  65. package/{chunk-XTUY5EL4.js → chunk-GJUKGFHG.js} +74 -16
  66. package/{chunk-XMGHGEN6.js → chunk-GMVELWJG.js} +3 -3
  67. package/chunk-GMZLP5DV.js +82 -0
  68. package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
  69. package/{chunk-N3OAPEZE.js → chunk-HBTA2SGQ.js} +97 -21
  70. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  71. package/{chunk-3CR2LC6X.js → chunk-HNRASX3X.js} +8 -8
  72. package/{chunk-CPH3W5A7.js → chunk-I3TQJXQ7.js} +94 -3
  73. package/{chunk-GRYGRGPS.js → chunk-IS5VEM2G.js} +140 -15
  74. package/{chunk-MJHQ3NRV.js → chunk-ISHYYQJC.js} +5 -3
  75. package/{chunk-ZAB3A45K.js → chunk-K7M4I3PF.js} +30 -7
  76. package/{chunk-2AYMFHUG.js → chunk-KQOD3G2X.js} +165 -15
  77. package/{chunk-YOXYA2GU.js → chunk-LNPYTNMG.js} +10 -5
  78. package/{chunk-F2CGG72C.js → chunk-LS2MI3B4.js} +45 -45
  79. package/{chunk-GII32WZW.js → chunk-M2EJHDJP.js} +3 -0
  80. package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
  81. package/{chunk-DNQPPRHY.js → chunk-N3XA2O6O.js} +1 -1
  82. package/{chunk-5DFFKASO.js → chunk-NILSKYOE.js} +3 -3
  83. package/chunk-OCZKATRC.js +129 -0
  84. package/{chunk-K7M3MWCE.js → chunk-OOSVFT6S.js} +2 -2
  85. package/{chunk-QCZX4FTW.js → chunk-OY5IJI2N.js} +194 -21
  86. package/{chunk-HMEMJ7GH.js → chunk-PAYUVQ6P.js} +7749 -1320
  87. package/{chunk-ASGDO77C.js → chunk-Q67DOFOO.js} +92 -4
  88. package/{chunk-UA5S3LQQ.js → chunk-QALRKMHF.js} +11 -10
  89. package/{chunk-RZANZZL2.js → chunk-QDSINZM3.js} +1 -1
  90. package/{chunk-DPQ2WVBY.js → chunk-QJLEMM2V.js} +1 -1
  91. package/{chunk-IIKPWSPX.js → chunk-R4SQ3LGW.js} +1 -1
  92. package/{chunk-UTCCPWB2.js → chunk-RZ6CQZB2.js} +34 -20
  93. package/{chunk-SAFZABH7.js → chunk-SV5IJK6K.js} +1 -1
  94. package/{chunk-576IMUGH.js → chunk-T5V7HA3K.js} +1 -1
  95. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  96. package/chunk-UNYJU5L6.js +780 -0
  97. package/{chunk-QFMFJZLO.js → chunk-V7E4PXQD.js} +1 -1
  98. package/{chunk-QHETQ3KI.js → chunk-VBSVA6CB.js} +2 -2
  99. package/{chunk-A2C4AKKM.js → chunk-VETFWL5K.js} +1 -1
  100. package/chunk-VJVNU77E.js +83 -0
  101. package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
  102. package/{chunk-3CMTBX3X.js → chunk-W2P25VGS.js} +25 -6
  103. package/{chunk-CLI4LFSM.js → chunk-WC6A2Q7S.js} +5 -3
  104. package/{chunk-Z33ARZCP.js → chunk-WT2IAJAJ.js} +4 -4
  105. package/chunk-X6YIXGPT.js +870 -0
  106. package/{chunk-5V4NJHRM.js → chunk-YMPTI7RZ.js} +9 -9
  107. package/{chunk-5NMZNPTN.js → chunk-YRIFJ6XQ.js} +13 -13
  108. package/{chunk-FZGV4FGK.js → chunk-YRRASA5Q.js} +268 -143
  109. package/{chunk-2F4VYGFW.js → chunk-Z5W7UMQV.js} +4 -3
  110. package/{chunk-ND2J3NRB.js → chunk-ZGJLSHER.js} +2 -2
  111. package/{chunk-VRLI2WNW.js → chunk-ZI2MEZMT.js} +314 -142
  112. package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
  113. package/commandRegistry-BP5JLW24.js +822 -0
  114. package/{contentThunks-VURN3DFW.js → contentThunks-2HYFUXUM.js} +29 -29
  115. package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  116. package/{createAgentAutomationAction-QZAAY77R.js → createAgentAutomationAction-DCKUSJH7.js} +29 -29
  117. package/{createDialogAction-CHGXVTAC.js → createDialogAction-NRIAEH2A.js} +32 -32
  118. package/{createPageAction-IOGAFIN7.js → createPageAction-AUJHHXGG.js} +35 -35
  119. package/{dbSlice-YXQ6RYIH.js → dbSlice-HFPIJT5P.js} +8 -8
  120. package/{deleteFile-YG6QMJLU.js → deleteFile-UEAD5A5Z.js} +3 -3
  121. package/{dialogCommands-XREAP6WQ.js → dialogCommands-UJRGCRN6.js} +42 -39
  122. package/{dialogSlice-DOPGWGS4.js → dialogSlice-AHU4XXIW.js} +35 -29
  123. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  124. package/{docCreateCommands-3PYZGSCL.js → docCreateCommands-ZOV3ZBLW.js} +39 -38
  125. package/{docDeleteCommands-3Y6MU44Q.js → docDeleteCommands-G4KAXJYQ.js} +39 -38
  126. package/{docReadCommands-UBANMAFR.js → docReadCommands-B2MM3JIT.js} +38 -37
  127. package/{docStore-SYYFBENY.js → docStore-SITH63V3.js} +9 -9
  128. package/{docUpdateCommands-4GK2X6BN.js → docUpdateCommands-2QNF5CYN.js} +39 -38
  129. package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
  130. package/{getPricing-F2C65RIX.js → getPricing-OX7B4R6B.js} +3 -3
  131. package/{handleSendMessageAction-NPVTY2GE.js → handleSendMessageAction-7ZMJMWLC.js} +72 -80
  132. package/index.js +74 -877
  133. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
  134. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
  135. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
  136. package/{machineCommands-I66X2XB7.js → machineCommands-YCTD5KOL.js} +75 -71
  137. package/{machineWsRunDispatch-W4FVBOUM.js → machineWsRunDispatch-JFMD4ZAW.js} +73 -69
  138. package/{memberThunks-5T4J6KXQ.js → memberThunks-SKFZ37VS.js} +9 -9
  139. package/{models-WW7VFNXB.js → models-T3SG6MJ5.js} +2 -2
  140. package/oauthTokenStore-ITEB663N.js +23 -0
  141. package/{offlineMarxistsAgentCommand-JEWCIAWM.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
  142. package/package.json +1 -1
  143. package/pdf-U6KSUEZZ.js +26435 -0
  144. package/processSpawn-SOAV3FEV.js +11 -0
  145. package/profileConfig-ZGOFORWV.js +43 -0
  146. package/{providerPresetApply-OCWWKBSD.js → providerPresetApply-2QTBYN36.js} +7 -7
  147. package/{providerRegistry-ZJQU7AJ7.js → providerRegistry-SVXE4G4T.js} +7 -7
  148. package/{read-M2Q6WEKB.js → read-IEJLLUXY.js} +5 -5
  149. package/{readDocTool-T37P3YPB.js → readDocTool-4SPYCP2Y.js} +5 -3
  150. package/{readlineWorkspace-VY5AMOGR.js → readlineWorkspace-M3PLTBLD.js} +2396 -2018
  151. package/{removeDialogAgentAction-HB3JBVAI.js → removeDialogAgentAction-LILXTOQY.js} +14 -14
  152. package/{runAgentClientLoop-3NDADLVE.js → runAgentClientLoop-QMCXBOBH.js} +55 -55
  153. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
  154. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  155. package/{setDialogExtraReferencesAction-4XLHRV37.js → setDialogExtraReferencesAction-LVNHLNT5.js} +10 -10
  156. package/{setPrimaryDialogAgentAction-C3JOFC4W.js → setPrimaryDialogAgentAction-DCKO5NTW.js} +14 -14
  157. package/{settingSlice-CZRURSTH.js → settingSlice-CNE75ISY.js} +10 -10
  158. package/{spaceCommands-ENYCUUZH.js → spaceCommands-3U6OHM6O.js} +39 -38
  159. package/{streamAgentChatTurn-634OFUSR.js → streamAgentChatTurn-JPMJQSEE.js} +144 -84
  160. package/{switchDialogAgentAction-C6KVUKJP.js → switchDialogAgentAction-JSYUQ5CG.js} +11 -11
  161. package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
  162. package/{toolApiClient-7PSIFQPJ.js → toolApiClient-INIQCPGY.js} +3 -3
  163. package/{tools-ILBLCF7D.js → tools-XQ5GIH6P.js} +49 -49
  164. package/{tuiSummaryLlmCaller-LFUBZKXK.js → tuiSummaryLlmCaller-L63PDJUD.js} +16 -15
  165. package/{updateCommands-2M74UL7P.js → updateCommands-ECWKIWLQ.js} +3 -3
  166. package/{updateDialogTitleAction-RKFET73N.js → updateDialogTitleAction-EGAZMLUB.js} +32 -32
  167. package/agentRecordCommands-FVVVCQFM.js +0 -126
  168. package/chunk-Q5FJJ6XI.js +0 -103
  169. package/chunk-S7Z2HMCN.js +0 -25
  170. package/chunk-WS22FPWT.js +0 -79
  171. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  172. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  173. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isAgentRunTerminalStatus
3
- } from "./chunk-NTW5GWDM.js";
3
+ } from "./chunk-3VNWWVKB.js";
4
4
  import {
5
5
  isCompiledBinary,
6
6
  resolveCliEntrypointPath
@@ -11,6 +11,60 @@ import { homedir as nodeHomedir } from "node:os";
11
11
  import { dirname, isAbsolute, join, resolve } from "node:path";
12
12
  import * as nodeFs from "node:fs";
13
13
  import { execFileSync as nodeExecFileSync, spawn as nodeSpawn } from "node:child_process";
14
+
15
+ // packages/ai/tools/agent/runFailureClass.ts
16
+ var RATE_LIMIT_PATTERN = /429|rate.?limit|quota|insufficient.?balance|UPSTREAM_402|cooling|冷却/i;
17
+ var PROVIDER_ERROR_PATTERN = /provider|upstream|5\d\d|bad.?gateway|service.?unavailable|overloaded/i;
18
+ var MALFORMED_PATTERN = /MALFORMED_FUNCTION_CALL|malformed|invalid.?function.?call|invalid.?tool.?call/i;
19
+ var STALLED_PATTERN = /stall|no.?progress|repetition|stagnant|无进展|卡死/i;
20
+ var TOOL_ERROR_PATTERN = /tool.?error|tool.?fail|工具/i;
21
+ function classifyRunFailure(input) {
22
+ const status = typeof input.status === "string" ? input.status : "";
23
+ if (status === "done" || status === "killed" || status === "cancelled") {
24
+ return void 0;
25
+ }
26
+ const reason = typeof input.failureReason === "string" ? input.failureReason : "";
27
+ const message = typeof input.errorMessage === "string" ? input.errorMessage : "";
28
+ switch (reason) {
29
+ case "provider_rate_limited":
30
+ return { failureClass: "rate_limited", retryable: true };
31
+ case "provider_error":
32
+ return MALFORMED_PATTERN.test(message) ? { failureClass: "provider_error", retryable: false } : { failureClass: "provider_error", retryable: true };
33
+ case "stalled":
34
+ return { failureClass: "stalled", retryable: false };
35
+ case "tool_error":
36
+ return { failureClass: "tool_error", retryable: false };
37
+ case "config_unresolved":
38
+ return { failureClass: "unknown", retryable: false };
39
+ case "cancelled":
40
+ return void 0;
41
+ default:
42
+ break;
43
+ }
44
+ if (message) {
45
+ if (RATE_LIMIT_PATTERN.test(message)) {
46
+ return { failureClass: "rate_limited", retryable: true };
47
+ }
48
+ if (MALFORMED_PATTERN.test(message)) {
49
+ return { failureClass: "provider_error", retryable: false };
50
+ }
51
+ if (STALLED_PATTERN.test(message)) {
52
+ return { failureClass: "stalled", retryable: false };
53
+ }
54
+ if (TOOL_ERROR_PATTERN.test(message)) {
55
+ return { failureClass: "tool_error", retryable: false };
56
+ }
57
+ if (PROVIDER_ERROR_PATTERN.test(message)) {
58
+ return { failureClass: "provider_error", retryable: true };
59
+ }
60
+ }
61
+ if (status === "failed" || status === "timeout" || status === "orphaned") {
62
+ return { failureClass: "unknown", retryable: false };
63
+ }
64
+ return void 0;
65
+ }
66
+
67
+ // packages/cli/agentRunControl.ts
14
68
  var RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
15
69
  "done",
16
70
  "failed",
@@ -794,6 +848,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
794
848
  logPath,
795
849
  queuePath,
796
850
  batchId,
851
+ ...typeof input.credentialGroup === "string" && input.credentialGroup.trim() ? { credentialGroup: input.credentialGroup.trim() } : {},
797
852
  ...typeof input.parentDialogId === "string" && input.parentDialogId.trim() ? { parentDialogId: input.parentDialogId.trim() } : {},
798
853
  ...dodCommands && dodCommands.length > 0 ? { dodCommands } : {},
799
854
  ...spawnHead ? { spawnHead } : {},
@@ -925,6 +980,15 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
925
980
  } else if (update.status === "killed") {
926
981
  record2.failureReason = "cancelled";
927
982
  }
983
+ const classification = classifyRunFailure({
984
+ status: update.status,
985
+ failureReason: record2.failureReason,
986
+ errorMessage: update.note ?? record2.note
987
+ });
988
+ if (classification) {
989
+ record2.failureClass = classification.failureClass;
990
+ record2.retryable = classification.retryable;
991
+ }
928
992
  const resolvedToolCount = typeof update.toolCallCount === "number" ? update.toolCallCount : record2.activity?.counters?.toolCalls;
929
993
  if (typeof resolvedToolCount === "number") {
930
994
  record2.toolCallCount = resolvedToolCount;
@@ -1044,6 +1108,15 @@ function checkStaleRun(runId, deps = {}) {
1044
1108
  const at = now().toISOString();
1045
1109
  latest.status = "orphaned";
1046
1110
  latest.note = pidReused ? "orphaned: process gone (pid reused by another process)" : "orphaned: process gone without writing terminal status";
1111
+ const orphanClassification = classifyRunFailure({
1112
+ status: "orphaned",
1113
+ failureReason: latest.failureReason,
1114
+ errorMessage: latest.note
1115
+ });
1116
+ if (orphanClassification) {
1117
+ latest.failureClass = orphanClassification.failureClass;
1118
+ latest.retryable = orphanClassification.retryable;
1119
+ }
1047
1120
  latest.endedAt = at;
1048
1121
  latest.reconciledAt = at;
1049
1122
  latest.pid = void 0;
@@ -1259,6 +1332,18 @@ function printStatusOnce(record, deps) {
1259
1332
  }
1260
1333
  if (record.note) deps.output.write(`note: ${record.note}
1261
1334
  `);
1335
+ if (record.failureReason) deps.output.write(`failure: ${record.failureReason}
1336
+ `);
1337
+ if (record.failureClass) {
1338
+ deps.output.write(
1339
+ `class: ${record.failureClass}${typeof record.retryable === "boolean" ? ` (retryable=${record.retryable})` : ""}
1340
+ `
1341
+ );
1342
+ }
1343
+ if (record.credentialGroup) {
1344
+ deps.output.write(`credGroup: ${record.credentialGroup}
1345
+ `);
1346
+ }
1262
1347
  const activitySummary = formatActivitySummary(record.activity);
1263
1348
  if (activitySummary) deps.output.write(`${activitySummary}
1264
1349
  `);
@@ -1388,14 +1473,20 @@ async function terminateRunProcess(record, initialSignal, deps) {
1388
1473
  signalGroup(initialSignal);
1389
1474
  if (initialSignal === "SIGTERM") {
1390
1475
  const deadline = nowMs() + TERMINATE_GRACE_MS;
1391
- while (!isPidGone(pid, deps) && nowMs() < deadline) {
1476
+ const maxIterations = Math.ceil(TERMINATE_GRACE_MS / TERMINATE_POLL_MS) + 1;
1477
+ let iterations = 0;
1478
+ while (!isPidGone(pid, deps) && nowMs() < deadline && iterations < maxIterations) {
1479
+ iterations += 1;
1392
1480
  await sleep(TERMINATE_POLL_MS);
1393
1481
  }
1394
1482
  }
1395
1483
  if (!isPidGone(pid, deps)) {
1396
1484
  signalGroup("SIGKILL");
1397
1485
  const killDeadline = nowMs() + TERMINATE_KILL_GRACE_MS;
1398
- while (!isPidGone(pid, deps) && nowMs() < killDeadline) {
1486
+ const maxIterations = Math.ceil(TERMINATE_KILL_GRACE_MS / TERMINATE_POLL_MS) + 1;
1487
+ let iterations = 0;
1488
+ while (!isPidGone(pid, deps) && nowMs() < killDeadline && iterations < maxIterations) {
1489
+ iterations += 1;
1399
1490
  await sleep(TERMINATE_POLL_MS);
1400
1491
  }
1401
1492
  }
@@ -7,7 +7,14 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-A2C4AKKM.js";
10
+ } from "./chunk-VETFWL5K.js";
11
+ import {
12
+ isLevelLockError
13
+ } from "./chunk-URMS4XY2.js";
14
+ import {
15
+ resolveLocalDialogDbCandidates,
16
+ resolveServerDbPath
17
+ } from "./chunk-GLKOYSRU.js";
11
18
  import {
12
19
  fetchWithTransientRetry
13
20
  } from "./chunk-5UTFL4QJ.js";
@@ -18,19 +25,12 @@ import {
18
25
  import {
19
26
  buildDialogAttachmentPlan,
20
27
  extractFileContentIds
21
- } from "./chunk-3BMYXEUW.js";
22
- import {
23
- isLevelLockError
24
- } from "./chunk-URMS4XY2.js";
25
- import {
26
- resolveLocalDialogDbCandidates,
27
- resolveServerDbPath
28
- } from "./chunk-GLKOYSRU.js";
28
+ } from "./chunk-6O4IK4V2.js";
29
29
  import {
30
30
  boundSummaryText,
31
31
  buildDialogReadEnvelope,
32
32
  projectDialogReadForAgent
33
- } from "./chunk-YOXYA2GU.js";
33
+ } from "./chunk-LNPYTNMG.js";
34
34
  import {
35
35
  toErrorMessage
36
36
  } from "./chunk-HNMXYYJR.js";
@@ -51,7 +51,7 @@ import {
51
51
  import {
52
52
  asNonEmptyStringArray,
53
53
  asTrimmedNonEmptyStringArray
54
- } from "./chunk-VMFTFOWF.js";
54
+ } from "./chunk-3AH7LNUB.js";
55
55
  import {
56
56
  createClientLogger
57
57
  } from "./chunk-QOKAKDPE.js";
@@ -210,7 +210,8 @@ var VALUE_FLAGS = /* @__PURE__ */ new Set([
210
210
  "--token",
211
211
  "--machine-key",
212
212
  "--user",
213
- "--max-response-chars"
213
+ "--max-response-chars",
214
+ "--per-dialog"
214
215
  ]);
215
216
  function hasFlag(args, flag) {
216
217
  return args.includes(flag);
@@ -724,7 +725,7 @@ function isExplicitDialogIdMismatch(meta, dialogId) {
724
725
  return meta && typeof meta === "object" && "id" in meta && meta.id != null && String(meta.id) !== dialogId;
725
726
  }
726
727
  async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog) {
727
- const reader = readLocalDialog ?? (await import("./localDialogRead-BTFJ4V2I.js")).readDialogFromLocalDb;
728
+ const reader = readLocalDialog ?? (await import("./localDialogRead-EBRS242U.js")).readDialogFromLocalDb;
728
729
  const result = await reader({ dialogKey, dialogId, limit });
729
730
  return {
730
731
  ...result,
@@ -741,7 +742,7 @@ async function readLocalDialogAtDbPathDefault(args) {
741
742
  const [{ Level }, { safeJsonEncoding }, { fetchMessages }] = await Promise.all([
742
743
  import("./levelLazyShim-GZBKODGI.js"),
743
744
  import("./serverStoreFactory-YMXDF4NI.js"),
744
- import("./fetchMessages-EIU7UFFK.js")
745
+ import("./fetchMessages-67MEFPZR.js")
745
746
  ]);
746
747
  const db = new Level(args.dbPath, {
747
748
  valueEncoding: safeJsonEncoding,
@@ -1820,6 +1821,129 @@ async function runDialogDeleteCommand(args, deps = {}) {
1820
1821
  }
1821
1822
  return hasErrors ? 1 : 0;
1822
1823
  }
1824
+ function printSearchUsage(output) {
1825
+ output.write(`Usage:
1826
+ nolo dialog search <query> [--limit <n>] [--per-dialog <n>] [--json]
1827
+
1828
+ Options:
1829
+ --limit <n> Max dialogs to return (default 20, max 50).
1830
+ --per-dialog <n> Max match snippets per dialog (default 3, max 10).
1831
+ --json Print machine-readable JSON.
1832
+ --server <url> Override NOLO_SERVER/BASE_URL.
1833
+ --token <jwt> Override AUTH_TOKEN.
1834
+
1835
+ Searches messages across the current user's dialogs via the server endpoint.
1836
+ Server requires NOLO_DIALOG_SEARCH=1 to be enabled.
1837
+ `);
1838
+ }
1839
+ async function runDialogSearchCommand(args, deps = {}) {
1840
+ const env = deps.env ?? process.env;
1841
+ const output = deps.output ?? process.stdout;
1842
+ if (hasFlag(args, "--help") || hasFlag(args, "-h")) {
1843
+ printSearchUsage(output);
1844
+ return 0;
1845
+ }
1846
+ const query = readFirstPositional(args);
1847
+ if (!query) {
1848
+ output.write("[nolo] dialog search requires a search query.\n\n");
1849
+ printSearchUsage(output);
1850
+ return 1;
1851
+ }
1852
+ const authToken = resolveAuthToken(args, env);
1853
+ if (!authToken) {
1854
+ output.write("[nolo] dialog search requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
1855
+ return 1;
1856
+ }
1857
+ const fetchImpl = deps.fetchImpl ?? fetch;
1858
+ const serverUrl = resolveServerUrl(args, env);
1859
+ const serverUrls = resolveServerCandidates(args, env, serverUrl);
1860
+ const limitRaw = readOption(args, "--limit");
1861
+ const perDialogRaw = readOption(args, "--per-dialog");
1862
+ const queryParams = new URLSearchParams({ q: query });
1863
+ if (limitRaw) queryParams.set("limit", limitRaw);
1864
+ if (perDialogRaw) queryParams.set("perDialog", perDialogRaw);
1865
+ const isJson = hasFlag(args, "--json");
1866
+ let lastError = null;
1867
+ let lastStatus = null;
1868
+ let searchResult = null;
1869
+ for (const candidateBase of serverUrls) {
1870
+ const trimmedBase = candidateBase.replace(/\/+$/, "");
1871
+ const targetUrl = `${trimmedBase}/api/dialog-search?${queryParams.toString()}`;
1872
+ try {
1873
+ const res = await fetchImpl(targetUrl, {
1874
+ method: "GET",
1875
+ headers: {
1876
+ Authorization: `Bearer ${authToken}`
1877
+ }
1878
+ });
1879
+ lastStatus = res.status;
1880
+ if (!res.ok) {
1881
+ const errorData = await res.json().catch(() => ({}));
1882
+ if (res.status === 403) {
1883
+ const hint = errorData?.hint ? ` (${errorData.hint})` : "";
1884
+ const msg = errorData?.message ? `: ${errorData.message}` : "";
1885
+ throw new Error(`Server returned 403 Forbidden${hint}${msg}. Please ensure NOLO_DIALOG_SEARCH=1 is enabled on the server.`);
1886
+ }
1887
+ if (res.status === 401) {
1888
+ throw new Error(`Server returned 401 Unauthorized. Please check your AUTH_TOKEN.`);
1889
+ }
1890
+ throw new Error(`HTTP ${res.status}: ${JSON.stringify(errorData)}`);
1891
+ }
1892
+ searchResult = await res.json();
1893
+ break;
1894
+ } catch (err) {
1895
+ lastError = err;
1896
+ }
1897
+ }
1898
+ if (!searchResult) {
1899
+ const errorMsg = lastError ? toErrorMessage(lastError) : "Failed to connect to candidate servers";
1900
+ if (isJson) {
1901
+ output.write(JSON.stringify({ error: errorMsg, status: lastStatus }, null, 2) + "\n");
1902
+ } else {
1903
+ output.write(`[nolo] dialog search failed: ${errorMsg}
1904
+ `);
1905
+ }
1906
+ return 1;
1907
+ }
1908
+ if (isJson) {
1909
+ output.write(JSON.stringify(searchResult, null, 2) + "\n");
1910
+ return 0;
1911
+ }
1912
+ const { dialogs, totalMatches, scannedDialogs, scannedMessages, elapsedMs, truncated } = searchResult;
1913
+ output.write(`query: ${query}
1914
+ `);
1915
+ output.write(`scanned: ${scannedDialogs} dialogs, ${scannedMessages} messages (${elapsedMs}ms)
1916
+ `);
1917
+ output.write(`matches: ${totalMatches} total match(es) across ${dialogs?.length ?? 0} dialog(s)`);
1918
+ if (truncated) {
1919
+ output.write(" [truncated]");
1920
+ }
1921
+ output.write("\n");
1922
+ if (!Array.isArray(dialogs) || dialogs.length === 0) {
1923
+ output.write("\nNo matching dialog messages found.\n");
1924
+ return 0;
1925
+ }
1926
+ for (const d of dialogs) {
1927
+ output.write(`
1928
+ ${d.title}
1929
+ `);
1930
+ output.write(`id=${d.dialogId}
1931
+ `);
1932
+ output.write(`updatedAt=${d.updatedAt ?? "-"}
1933
+ `);
1934
+ output.write(`matches=${d.matchCount}
1935
+ `);
1936
+ if (Array.isArray(d.matches) && d.matches.length > 0) {
1937
+ for (const m of d.matches) {
1938
+ const role = m.role ? `[${m.role}]` : "";
1939
+ const snippet = String(m.snippet ?? "").replace(/\r?\n/g, " ");
1940
+ output.write(` - ${role} ${snippet}
1941
+ `);
1942
+ }
1943
+ }
1944
+ }
1945
+ return 0;
1946
+ }
1823
1947
 
1824
1948
  export {
1825
1949
  normalizeDialogRecord,
@@ -1832,5 +1956,6 @@ export {
1832
1956
  runDialogStatusCommand,
1833
1957
  runDialogQueryCommand,
1834
1958
  runDialogListCommand,
1835
- runDialogDeleteCommand
1959
+ runDialogDeleteCommand,
1960
+ runDialogSearchCommand
1836
1961
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  trimTrailingSlash
3
- } from "./chunk-K7M3MWCE.js";
3
+ } from "./chunk-OOSVFT6S.js";
4
4
  import {
5
5
  toErrorMessage
6
6
  } from "./chunk-HNMXYYJR.js";
@@ -41,7 +41,7 @@ var ANTIGRAVITY_CLOUD_CODE_BASE_URL = "https://daily-cloudcode-pa.googleapis.com
41
41
  var ANTIGRAVITY_CLOUD_CODE_HOST = "cloudcode-pa.googleapis.com";
42
42
  var ANTIGRAVITY_LEGACY_GENERIC_BASE_RE = /^https?:\/\/cloudcode-pa\.googleapis\.com$/i;
43
43
  function getAntigravityUserAgent() {
44
- const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.1.4";
44
+ const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.18.1";
45
45
  const os = process.platform === "win32" ? "windows" : process.platform;
46
46
  const arch = process.arch === "x64" ? "amd64" : process.arch === "ia32" ? "386" : process.arch;
47
47
  return `antigravity/hub/${version} ${os}/${arch}`;
@@ -129,7 +129,9 @@ async function refreshAntigravityToken(credential, deps = {}) {
129
129
  payload = {};
130
130
  }
131
131
  if (!response.ok) {
132
- const detail = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : rawBodyText.trim() || `HTTP ${response.status}`;
132
+ const errorCode = typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : void 0;
133
+ const errorDescription = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : void 0;
134
+ const detail = (errorCode && errorDescription && errorDescription !== errorCode ? `${errorCode}: ${errorDescription}` : errorCode ?? errorDescription ?? rawBodyText.trim()) || `HTTP ${response.status}`;
133
135
  throw new Error(`Antigravity token refresh failed: ${detail}`);
134
136
  }
135
137
  if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ANTIGRAVITY_CLOUD_CODE_BASE_URL
3
- } from "./chunk-MJHQ3NRV.js";
3
+ } from "./chunk-ISHYYQJC.js";
4
4
  import {
5
5
  kimiCodeModels,
6
6
  moonshotModels,
@@ -9,13 +9,13 @@ import {
9
9
  qwenTokenPlanModels,
10
10
  stepfunModels,
11
11
  stepfunStepPlanModels
12
- } from "./chunk-VRLI2WNW.js";
12
+ } from "./chunk-ZI2MEZMT.js";
13
13
  import {
14
14
  PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE,
15
15
  PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
16
16
  PLATFORM_HOSTED_DEEPSEEK_PRO_OFF_PEAK_PRICE,
17
17
  PLATFORM_HOSTED_DEEPSEEK_PRO_PEAK_PRICE
18
- } from "./chunk-ASGDO77C.js";
18
+ } from "./chunk-Q67DOFOO.js";
19
19
 
20
20
  // packages/integrations/commandcode/models.ts
21
21
  var commandCodeModels = [
@@ -279,6 +279,9 @@ var SUBSCRIPTION_OAUTH_PROVIDERS = [
279
279
  defaultReasoningEffort: "medium",
280
280
  modelOptions: [
281
281
  { id: "gpt-6-astra", label: "GPT-6 Astra", hasVision: true, recommended: true },
282
+ // GPT-6.1 Sol 已列入 Codex 订阅通道选型指南,但按账号灰度("when available
283
+ // to your account and client"),未开通的账号选它会 400,不影响其他选项。
284
+ { id: "gpt-6.1-sol", label: "GPT-6.1 Sol", hasVision: true },
282
285
  { id: "gpt-5.6-sol", label: "GPT-5.6 Sol", hasVision: true },
283
286
  { id: "gpt-5.6-terra", label: "GPT-5.6 Terra", hasVision: true },
284
287
  { id: "gpt-5.6-luna", label: "GPT-5.6 Luna", hasVision: true }
@@ -324,11 +327,13 @@ var SUBSCRIPTION_OAUTH_PROVIDERS = [
324
327
  description: "Anthropic Subscription",
325
328
  apiKeyRef: "claude",
326
329
  provider: "anthropic",
327
- defaultModel: "claude-sonnet-5",
330
+ defaultModel: "claude-sonnet-5-5",
328
331
  defaultReasoningEffort: "high",
329
332
  modelOptions: [
333
+ { id: "claude-opus-5-5", label: "Claude Opus 5.5", hasVision: true, recommended: true },
334
+ { id: "claude-sonnet-5-5", label: "Claude Sonnet 5.5", hasVision: true },
330
335
  { id: "claude-sonnet-5", label: "Claude Sonnet 5", hasVision: true },
331
- { id: "claude-opus-5", label: "Claude Opus 5", hasVision: true, recommended: true },
336
+ { id: "claude-opus-5", label: "Claude Opus 5", hasVision: true },
332
337
  { id: "claude-opus-4-8", label: "Claude Opus 4.8", hasVision: true },
333
338
  { id: "claude-fable-5", label: "Claude Fable 5", hasVision: true }
334
339
  ]
@@ -539,7 +544,12 @@ var CUSTOM_API_KEY_TEMPLATES = [
539
544
  label: "OpenAI API",
540
545
  provider: "openai",
541
546
  baseUrl: "https://api.openai.com/v1",
542
- defaultModel: "gpt-6-astra",
547
+ defaultModel: "gpt-6.1-sol",
548
+ modelOptions: [
549
+ { id: "gpt-6.1-sol", label: "GPT-6.1 Sol", hasVision: true, recommended: true },
550
+ { id: "gpt-6-astra", label: "GPT-6 Astra", hasVision: true },
551
+ { id: "gpt-6-luna", label: "GPT-6 Luna", hasVision: true }
552
+ ],
543
553
  commercialKind: "api",
544
554
  accessVariant: "metered_key"
545
555
  },
@@ -549,7 +559,7 @@ var CUSTOM_API_KEY_TEMPLATES = [
549
559
  label: "Anthropic API",
550
560
  provider: "anthropic",
551
561
  baseUrl: "https://api.anthropic.com",
552
- defaultModel: "claude-sonnet-5",
562
+ defaultModel: "claude-sonnet-5-5",
553
563
  apiKeyHeader: "x-api-key",
554
564
  commercialKind: "api",
555
565
  accessVariant: "metered_key"
@@ -575,6 +585,19 @@ var CUSTOM_API_KEY_TEMPLATES = [
575
585
  commercialKind: "api",
576
586
  accessVariant: "metered_key"
577
587
  },
588
+ // anthropic/claude-sonnet-5、qwen/qwen3.8-27b),不维护易腐的静态清单。
589
+ {
590
+ kind: "api_key_template",
591
+ id: "openrouter-api",
592
+ label: "OpenRouter API \u7528\u91CF\u8BA1\u8D39",
593
+ description: "OpenRouter \u805A\u5408\u7F51\u5173\uFF08OpenAI \u517C\u5BB9\uFF0C\u4E00\u4E2A Key \u8BBF\u95EE\u591A\u5BB6\u6A21\u578B\uFF0C\u6309\u91CF\u8BA1\u8D39\uFF09",
594
+ provider: "openrouter",
595
+ baseUrl: "https://openrouter.ai/api/v1",
596
+ defaultModel: "anthropic/claude-sonnet-5",
597
+ keyFormatHint: "\u5728 openrouter.ai/keys \u521B\u5EFA\uFF0C\u5F62\u5982 sk-or-\u2026",
598
+ commercialKind: "api",
599
+ accessVariant: "metered_key"
600
+ },
578
601
  // DeepSeek 模型统一改走 nolo provider(Ollama Cloud,thinking=max 快 28-49%)。
579
602
  // 现按用户选择回归:自带 Key 的 metered 通道与平台托管通道并存,互不影响。
580
603
  {