nolo-cli 0.8.0-alpha.11 → 0.8.0-alpha.13

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-GPU2276G.js → _executeModel-EBU7YBDV.js} +26 -22
  2. package/{action-PAXRPJJF.js → action-SQGI5JY5.js} +5 -4
  3. package/{addContentAction-CZVWF3QZ.js → addContentAction-ZX2PUS3X.js} +4 -3
  4. package/{addDialogAgentAction-CCIDTPHC.js → addDialogAgentAction-ULADQX2Q.js} +3 -2
  5. package/{agentDeleteCommand-4ZZFM6AT.js → agentDeleteCommand-GNVYHOGZ.js} +11 -8
  6. package/{agentEmailCommands-C4FIVQYV.js → agentEmailCommands-IC52LATA.js} +29 -25
  7. package/{agentListCommands-VQAKVNEX.js → agentListCommands-FM4OWXYT.js} +12 -9
  8. package/{agentMachineCommands-ONFDXZUQ.js → agentMachineCommands-SFWC6KN4.js} +11 -8
  9. package/{agentRecordCommands-QANUGHLK.js → agentRecordCommands-VLMLWLCM.js} +29 -25
  10. package/{agentRunCommand-A3OSRB5Q.js → agentRunCommand-D2PVHUGR.js} +30 -25
  11. package/{agentRuntimeLocal-62ZB2ODP.js → agentRuntimeLocal-XL5PLRJV.js} +16 -12
  12. package/{agentSlice-GCGLVR2N.js → agentSlice-IIC7AISR.js} +5 -4
  13. package/{chunk-YOUZDXU7.js → chunk-3N55DSXH.js} +21 -17
  14. package/chunk-4ZDM73SD.js +34 -0
  15. package/{chunk-TDIQFT2F.js → chunk-5CS33IBL.js} +1 -1
  16. package/{chunk-IYQV26RA.js → chunk-6A3LI5TZ.js} +2 -2
  17. package/{chunk-VEJLAVTC.js → chunk-6CBN7GGH.js} +2 -2
  18. package/{chunk-BSTNFPHD.js → chunk-6XKX2N2E.js} +1 -1
  19. package/{chunk-7OC5VCLW.js → chunk-7EPLXPTM.js} +4 -4
  20. package/{chunk-GCMRDRCQ.js → chunk-7IPLJUYC.js} +1 -1
  21. package/{chunk-53DNV5AT.js → chunk-7U4TQSWU.js} +3 -3
  22. package/{chunk-GGUO4FKF.js → chunk-7XN726FS.js} +41 -19
  23. package/{chunk-I3D64LRJ.js → chunk-BKPVTIEK.js} +4 -4
  24. package/{chunk-7YLKNMOM.js → chunk-DAB7DRXD.js} +6 -6
  25. package/{chunk-LM25IZBJ.js → chunk-DG7AAAR3.js} +1 -1
  26. package/{chunk-F6QQI5YI.js → chunk-DGFWICQJ.js} +1 -1
  27. package/chunk-DSNONPGW.js +386 -0
  28. package/{chunk-LAWBMYBC.js → chunk-FE2TZO7Z.js} +2 -2
  29. package/{chunk-R2HXWML7.js → chunk-HLM6MG7F.js} +19 -20
  30. package/chunk-I42VC5KR.js +15 -0
  31. package/{chunk-J5KV47ZW.js → chunk-IBJC3GOP.js} +2 -2
  32. package/chunk-JEXVIMYZ.js +55 -0
  33. package/{chunk-6B7G54GE.js → chunk-KH4OXCBK.js} +5 -5
  34. package/{chunk-SYOF5TAS.js → chunk-MXLQWBVM.js} +36 -95
  35. package/chunk-OPZYGHUC.js +89 -0
  36. package/{chunk-J4576WMJ.js → chunk-PCWC3JTN.js} +1 -1
  37. package/{chunk-HEIIIZBX.js → chunk-Q2YZULBH.js} +1 -1
  38. package/{chunk-KB7YFGL6.js → chunk-Q3K5K4KS.js} +1 -1
  39. package/{chunk-IAXBCTTE.js → chunk-QO4YO77G.js} +2 -2
  40. package/{chunk-GGXABIPP.js → chunk-RJKDVL4L.js} +2 -2
  41. package/{chunk-CJH2VTEU.js → chunk-RLCFUU46.js} +3 -3
  42. package/{chunk-2UZXR7WO.js → chunk-SACYB45H.js} +19 -378
  43. package/{chunk-PN7AFLOK.js → chunk-SH2CFQOH.js} +3 -13
  44. package/{chunk-XBIUN5CR.js → chunk-TWPGVS2U.js} +2 -2
  45. package/{chunk-G5H7RNFL.js → chunk-V2AISYMA.js} +2 -2
  46. package/{chunk-TZNCFAUP.js → chunk-XOH46MRF.js} +8 -15
  47. package/{chunk-CQAHS7YO.js → chunk-YDESHYQC.js} +56 -12
  48. package/{chunk-AUGHVUFE.js → chunk-YYUCRDOK.js} +1 -1
  49. package/{chunk-H2RMRZJE.js → chunk-ZDXZSXYQ.js} +1 -1
  50. package/{chunk-NXZGF7F7.js → chunk-ZQ2UM4KG.js} +1 -1
  51. package/{chunk-QR5IPGT3.js → chunk-ZRS4MX3R.js} +170 -176
  52. package/{createAgentAutomationAction-537X433B.js → createAgentAutomationAction-GNRYFKTT.js} +12 -10
  53. package/{createDialogAction-YUD4RKBS.js → createDialogAction-Q4ISCARO.js} +15 -13
  54. package/{createPageAction-KJMFHL4C.js → createPageAction-7YCAZPK3.js} +13 -11
  55. package/{dbSlice-C4UJLRZP.js → dbSlice-TO2TSMWM.js} +3 -2
  56. package/{dialogCommands-H74KJKHC.js → dialogCommands-DWSE4PMW.js} +13 -10
  57. package/{dialogSlice-ETSD4YWS.js → dialogSlice-5KZA46HM.js} +12 -10
  58. package/{docCreateCommands-ADUSU34K.js → docCreateCommands-UFJL5PUM.js} +12 -9
  59. package/{docDeleteCommands-ZXV3S5OS.js → docDeleteCommands-XHEIBAB2.js} +13 -10
  60. package/{docReadCommands-YYYI6LT7.js → docReadCommands-PEDIC2CW.js} +12 -9
  61. package/{docStore-ZBF5DDKR.js → docStore-M7K7QFVS.js} +13 -11
  62. package/{docUpdateCommands-7MGJ3BYA.js → docUpdateCommands-WBRODQ7P.js} +12 -9
  63. package/{fetchMessages-JOCYIFKL.js → fetchMessages-U6ZHN56A.js} +3 -2
  64. package/{handleSendMessageAction-MGKI62Y6.js → handleSendMessageAction-SEV4YIPL.js} +12 -10
  65. package/index.js +40 -36
  66. package/{localDialogRead-D3BELSTF.js → localDialogRead-Z5UTAJPU.js} +1 -1
  67. package/{machineCommands-RMTMN7VQ.js → machineCommands-T4DN3MOU.js} +28 -24
  68. package/{machineWsRunDispatch-UIP355FN.js → machineWsRunDispatch-QRIIT2AK.js} +28 -24
  69. package/package.json +1 -1
  70. package/{readlineWorkspace-CRNQRZ6D.js → readlineWorkspace-DXOTOVHL.js} +163 -31
  71. package/{removeDialogAgentAction-CXLST3N6.js → removeDialogAgentAction-3MUQGFZX.js} +5 -4
  72. package/{runAgentClientLoop-2S334SGA.js → runAgentClientLoop-UEQEP3XG.js} +21 -19
  73. package/{setDialogExtraReferencesAction-LP6VYGU7.js → setDialogExtraReferencesAction-MXHX2HPK.js} +3 -2
  74. package/{setPrimaryDialogAgentAction-D3GGH23T.js → setPrimaryDialogAgentAction-7DLDZHDT.js} +5 -4
  75. package/{settingSlice-J4I3Z5H7.js → settingSlice-PNLASZGI.js} +4 -3
  76. package/{spaceCommands-NDEWMFZJ.js → spaceCommands-ORSFAWEY.js} +11 -8
  77. package/{spaceSlice-RLB6RTHO.js → spaceSlice-HOMW64JA.js} +12 -10
  78. package/{streamAgentChatTurn-Y2TTYPBD.js → streamAgentChatTurn-REWDBIL3.js} +28 -26
  79. package/{tools-YZYLY2ZQ.js → tools-L4UQS5VW.js} +19 -17
  80. package/tuiSummaryLlmCaller-JSI4GL6W.js +78 -0
  81. package/{understanding-HCSFPE7R.js → understanding-YH4X3XU6.js} +3 -2
  82. package/{updateDialogTitleAction-LQV6QLBW.js → updateDialogTitleAction-CKLNP73H.js} +14 -11
@@ -368,8 +368,9 @@ async function runCompleteWithTimeout(args) {
368
368
  })
369
369
  );
370
370
  }
371
+ let result;
371
372
  try {
372
- const result = racers.length === 0 ? await complete : await Promise.race([complete, ...racers]);
373
+ result = racers.length === 0 ? await complete : await Promise.race([complete, ...racers]);
373
374
  ok = true;
374
375
  return result;
375
376
  } catch (error) {
@@ -383,7 +384,26 @@ async function runCompleteWithTimeout(args) {
383
384
  } finally {
384
385
  if (timer) clearTimeout(timer);
385
386
  if (signal && abortListener) signal.removeEventListener("abort", abortListener);
386
- emitLoopEvent(input, { kind: "llm-end", round, atMs: Date.now(), ok });
387
+ const usage = result?.usage;
388
+ const cacheHit = Number(usage?.cache_read_input_tokens ?? usage?.prompt_cache_hit_tokens ?? 0);
389
+ const cacheMiss = Number(usage?.cache_creation_input_tokens ?? usage?.prompt_cache_miss_tokens ?? 0);
390
+ const inputTokens = Number(usage?.input_tokens ?? usage?.prompt_tokens ?? 0);
391
+ const outputTokens = Number(usage?.output_tokens ?? usage?.completion_tokens ?? 0);
392
+ emitLoopEvent(input, {
393
+ kind: "llm-end",
394
+ round,
395
+ atMs: Date.now(),
396
+ ok,
397
+ ...inputTokens > 0 || cacheHit > 0 || cacheMiss > 0 ? {
398
+ cache: {
399
+ inputTokens,
400
+ outputTokens,
401
+ cacheHitTokens: cacheHit,
402
+ cacheMissTokens: cacheMiss,
403
+ hitRatio: inputTokens > 0 ? Math.round(cacheHit / inputTokens * 1e4) / 1e4 : 0
404
+ }
405
+ } : {}
406
+ });
387
407
  }
388
408
  }
389
409
  function clip2(value, max = 240) {
@@ -483,8 +503,8 @@ function buildActionGate(args) {
483
503
  toolCallId: args.toolCallId
484
504
  };
485
505
  }
486
- var MAX_HISTORICAL_TOOL_CONTENT_CHARS = 2400;
487
- var MAX_IN_TURN_TOOL_CONTENT_CHARS = 6e3;
506
+ var MAX_HISTORICAL_TOOL_CONTENT_CHARS = 1600;
507
+ var MAX_IN_TURN_TOOL_CONTENT_CHARS = 4e3;
488
508
  function summarizeToolContentForProvider(content, maxChars, label) {
489
509
  if (typeof content !== "string") return content;
490
510
  if (content.length <= maxChars) return content;
@@ -574,13 +594,21 @@ function mergeTurnUsage(current, next) {
574
594
  if (!next) return current;
575
595
  const read = (usage) => ({
576
596
  input: Number(usage.input_tokens ?? usage.prompt_tokens ?? 0),
577
- output: Number(usage.output_tokens ?? usage.completion_tokens ?? 0)
597
+ output: Number(usage.output_tokens ?? usage.completion_tokens ?? 0),
598
+ cacheHit: Number(
599
+ usage.cache_read_input_tokens ?? usage.prompt_cache_hit_tokens ?? 0
600
+ ),
601
+ cacheMiss: Number(
602
+ usage.cache_creation_input_tokens ?? usage.prompt_cache_miss_tokens ?? 0
603
+ )
578
604
  });
579
605
  const right = read(next);
580
- const left = current ? read(current) : { input: 0, output: 0 };
606
+ const left = current ? read(current) : { input: 0, output: 0, cacheHit: 0, cacheMiss: 0 };
581
607
  return {
582
608
  input_tokens: right.input || left.input,
583
- output_tokens: left.output + right.output
609
+ output_tokens: left.output + right.output,
610
+ cache_read_input_tokens: left.cacheHit + right.cacheHit,
611
+ cache_creation_input_tokens: left.cacheMiss + right.cacheMiss
584
612
  };
585
613
  }
586
614
  function extractUserInputText(content) {
@@ -862,89 +890,6 @@ async function runLocalAgentTurn(input) {
862
890
  };
863
891
  }
864
892
 
865
- // packages/agent-runtime/thinkTagParser.ts
866
- var OPEN_TAG = "<think>";
867
- var CLOSE_TAG = "</think>";
868
- function longestTagPrefixLength(buffer, tag) {
869
- const max = Math.min(buffer.length, tag.length - 1);
870
- for (let len = max; len > 0; len--) {
871
- if (tag.startsWith(buffer.slice(-len))) {
872
- return len;
873
- }
874
- }
875
- return 0;
876
- }
877
- function extractThinkContent(content) {
878
- const regex = new RegExp(`${OPEN_TAG}([\\s\\S]*?)${CLOSE_TAG}`, "g");
879
- const matches = [...content.matchAll(regex)];
880
- if (matches.length === 0) {
881
- return { content };
882
- }
883
- const reasoning = matches.map((m) => m[1]).join("\n");
884
- const cleaned = content.replace(regex, "");
885
- return { content: cleaned.replace(/^\n/, ""), reasoning };
886
- }
887
- function createThinkParserState() {
888
- return { mode: "content", buffer: "", trimNextVisible: false };
889
- }
890
- function processThinkChunk(chunk, state) {
891
- let visible = "";
892
- let reasoning = "";
893
- let { mode, buffer, trimNextVisible } = state;
894
- buffer += chunk;
895
- while (true) {
896
- if (mode === "content") {
897
- const idx = buffer.indexOf(OPEN_TAG);
898
- if (idx === -1) {
899
- const keep = longestTagPrefixLength(buffer, OPEN_TAG);
900
- visible += buffer.slice(0, buffer.length - keep);
901
- buffer = buffer.slice(buffer.length - keep);
902
- break;
903
- }
904
- visible += buffer.slice(0, idx);
905
- buffer = buffer.slice(idx + OPEN_TAG.length);
906
- mode = "reasoning";
907
- } else {
908
- const idx = buffer.indexOf(CLOSE_TAG);
909
- if (idx === -1) {
910
- const keep = longestTagPrefixLength(buffer, CLOSE_TAG);
911
- reasoning += buffer.slice(0, buffer.length - keep);
912
- buffer = buffer.slice(buffer.length - keep);
913
- break;
914
- }
915
- reasoning += buffer.slice(0, idx);
916
- buffer = buffer.slice(idx + CLOSE_TAG.length);
917
- mode = "content";
918
- trimNextVisible = true;
919
- }
920
- }
921
- if (mode === "content" && visible.length > 0 && trimNextVisible) {
922
- visible = visible.replace(/^\n/, "");
923
- trimNextVisible = false;
924
- }
925
- return { content: visible, reasoning, state: { mode, buffer, trimNextVisible } };
926
- }
927
- function flushThinkParser(state) {
928
- const { mode, buffer, trimNextVisible } = state;
929
- if (mode === "reasoning") {
930
- return {
931
- content: "",
932
- reasoning: buffer,
933
- state: { mode: "content", buffer: "", trimNextVisible: false }
934
- };
935
- }
936
- let visible = buffer;
937
- const nextTrim = trimNextVisible;
938
- if (nextTrim) {
939
- visible = visible.replace(/^\n/, "");
940
- }
941
- return {
942
- content: visible,
943
- reasoning: "",
944
- state: { mode: "content", buffer: "", trimNextVisible: false }
945
- };
946
- }
947
-
948
893
  export {
949
894
  readCommandActionGatePayload,
950
895
  readActionGate,
@@ -954,9 +899,5 @@ export {
954
899
  LOCAL_AGENT_CONFIG_MISSING_CODE,
955
900
  EMPTY_ASSISTANT_REPAIR_PROMPT,
956
901
  LOCAL_TURN_ABORTED_CODE,
957
- runLocalAgentTurn,
958
- extractThinkContent,
959
- createThinkParserState,
960
- processThinkChunk,
961
- flushThinkParser
902
+ runLocalAgentTurn
962
903
  };
@@ -0,0 +1,89 @@
1
+ // packages/agent-runtime/thinkTagParser.ts
2
+ var OPEN_TAG = "<think>";
3
+ var CLOSE_TAG = "</think>";
4
+ function longestTagPrefixLength(buffer, tag) {
5
+ const max = Math.min(buffer.length, tag.length - 1);
6
+ for (let len = max; len > 0; len--) {
7
+ if (tag.startsWith(buffer.slice(-len))) {
8
+ return len;
9
+ }
10
+ }
11
+ return 0;
12
+ }
13
+ function extractThinkContent(content) {
14
+ const regex = new RegExp(`${OPEN_TAG}([\\s\\S]*?)${CLOSE_TAG}`, "g");
15
+ const matches = [...content.matchAll(regex)];
16
+ if (matches.length === 0) {
17
+ return { content };
18
+ }
19
+ const reasoning = matches.map((m) => m[1]).join("\n");
20
+ const cleaned = content.replace(regex, "");
21
+ return { content: cleaned.replace(/^\n/, ""), reasoning };
22
+ }
23
+ function createThinkParserState() {
24
+ return { mode: "content", buffer: "", trimNextVisible: false };
25
+ }
26
+ function processThinkChunk(chunk, state) {
27
+ let visible = "";
28
+ let reasoning = "";
29
+ let { mode, buffer, trimNextVisible } = state;
30
+ buffer += chunk;
31
+ while (true) {
32
+ if (mode === "content") {
33
+ const idx = buffer.indexOf(OPEN_TAG);
34
+ if (idx === -1) {
35
+ const keep = longestTagPrefixLength(buffer, OPEN_TAG);
36
+ visible += buffer.slice(0, buffer.length - keep);
37
+ buffer = buffer.slice(buffer.length - keep);
38
+ break;
39
+ }
40
+ visible += buffer.slice(0, idx);
41
+ buffer = buffer.slice(idx + OPEN_TAG.length);
42
+ mode = "reasoning";
43
+ } else {
44
+ const idx = buffer.indexOf(CLOSE_TAG);
45
+ if (idx === -1) {
46
+ const keep = longestTagPrefixLength(buffer, CLOSE_TAG);
47
+ reasoning += buffer.slice(0, buffer.length - keep);
48
+ buffer = buffer.slice(buffer.length - keep);
49
+ break;
50
+ }
51
+ reasoning += buffer.slice(0, idx);
52
+ buffer = buffer.slice(idx + CLOSE_TAG.length);
53
+ mode = "content";
54
+ trimNextVisible = true;
55
+ }
56
+ }
57
+ if (mode === "content" && visible.length > 0 && trimNextVisible) {
58
+ visible = visible.replace(/^\n/, "");
59
+ trimNextVisible = false;
60
+ }
61
+ return { content: visible, reasoning, state: { mode, buffer, trimNextVisible } };
62
+ }
63
+ function flushThinkParser(state) {
64
+ const { mode, buffer, trimNextVisible } = state;
65
+ if (mode === "reasoning") {
66
+ return {
67
+ content: "",
68
+ reasoning: buffer,
69
+ state: { mode: "content", buffer: "", trimNextVisible: false }
70
+ };
71
+ }
72
+ let visible = buffer;
73
+ const nextTrim = trimNextVisible;
74
+ if (nextTrim) {
75
+ visible = visible.replace(/^\n/, "");
76
+ }
77
+ return {
78
+ content: visible,
79
+ reasoning: "",
80
+ state: { mode: "content", buffer: "", trimNextVisible: false }
81
+ };
82
+ }
83
+
84
+ export {
85
+ extractThinkContent,
86
+ createThinkParserState,
87
+ processThinkChunk,
88
+ flushThinkParser
89
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dialogMessageKey
3
- } from "./chunk-PN7AFLOK.js";
3
+ } from "./chunk-SH2CFQOH.js";
4
4
  import {
5
5
  asOptionalFiniteNumber
6
6
  } from "./chunk-WWC7I6TA.js";
@@ -2,7 +2,7 @@ import {
2
2
  createMemoryKey,
3
3
  memoryOwnerRange,
4
4
  memorySubjectKindRange
5
- } from "./chunk-PN7AFLOK.js";
5
+ } from "./chunk-SH2CFQOH.js";
6
6
 
7
7
  // packages/ai/memory/queryShared.ts
8
8
  var chooseMemoryOwners = (input) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-TZNCFAUP.js";
4
+ } from "./chunk-XOH46MRF.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-VEJLAVTC.js";
4
+ } from "./chunk-6CBN7GGH.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -10,7 +10,7 @@ import {
10
10
  sanitizeShareData,
11
11
  shareKey,
12
12
  toNonEmptyString
13
- } from "./chunk-PN7AFLOK.js";
13
+ } from "./chunk-SH2CFQOH.js";
14
14
  import {
15
15
  noloDeleteRequest,
16
16
  noloWriteRequest,
@@ -2,7 +2,7 @@ import {
2
2
  buildLocalAgentLookupKeys,
3
3
  normalizeAgentHandle,
4
4
  shouldReadAgentKeyRemotely
5
- } from "./chunk-F6QQI5YI.js";
5
+ } from "./chunk-DGFWICQJ.js";
6
6
  import {
7
7
  resolveCliAgentKeyInput
8
8
  } from "./chunk-VHBWHNVT.js";
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-HNMXYYJR.js";
23
23
  import {
24
24
  createAgentKey
25
- } from "./chunk-PN7AFLOK.js";
25
+ } from "./chunk-SH2CFQOH.js";
26
26
 
27
27
  // packages/cli/agentRecordHelpers.ts
28
28
  import { readFileSync } from "node:fs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-GGXABIPP.js";
4
+ } from "./chunk-RJKDVL4L.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
8
8
  import {
9
9
  buildSkillDocMarkdown
10
- } from "./chunk-NXZGF7F7.js";
10
+ } from "./chunk-ZQ2UM4KG.js";
11
11
  import {
12
12
  createSpaceKey
13
13
  } from "./chunk-UAD2WT54.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-ISNCLGUZ.js";
20
20
  import {
21
21
  require_index_umd
22
- } from "./chunk-PN7AFLOK.js";
22
+ } from "./chunk-SH2CFQOH.js";
23
23
  import {
24
24
  asTrimmedLowercaseString
25
25
  } from "./chunk-QSJ3HFEF.js";