nolo-cli 0.7.0 → 0.8.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 (175) hide show
  1. package/_executeModel-GPU2276G.js +198 -0
  2. package/action-PAXRPJJF.js +27 -0
  3. package/addContentAction-CZVWF3QZ.js +25 -0
  4. package/addDialogAgentAction-CCIDTPHC.js +67 -0
  5. package/agentDeleteCommand-4ZZFM6AT.js +323 -0
  6. package/agentEmailCommands-C4FIVQYV.js +621 -0
  7. package/agentListCommands-VQAKVNEX.js +219 -0
  8. package/agentMachineCommands-ONFDXZUQ.js +421 -0
  9. package/agentPullCommand-O2MTUAFR.js +122 -0
  10. package/agentRecordCommands-QANUGHLK.js +89 -0
  11. package/agentRunCommand-A3OSRB5Q.js +102 -0
  12. package/agentRunControl-K4VKNEHF.js +57 -0
  13. package/agentRuntimeLocal-62ZB2ODP.js +99 -0
  14. package/agentSlice-GCGLVR2N.js +41 -0
  15. package/authCommand-WXMD3IPR.js +574 -0
  16. package/authCommands-X74AFDTC.js +26 -0
  17. package/chunk-2EISRLRC.js +238 -0
  18. package/chunk-2FTTDCD4.js +675 -0
  19. package/chunk-2MALU52L.js +51 -0
  20. package/chunk-2UZXR7WO.js +3631 -0
  21. package/chunk-3ASDTTEI.js +1774 -0
  22. package/chunk-3EUW3WEO.js +8 -0
  23. package/chunk-3LY4F7SV.js +9293 -0
  24. package/chunk-4CQLVGRV.js +50 -0
  25. package/chunk-4IJYA27C.js +342 -0
  26. package/chunk-4SN6J65J.js +38 -0
  27. package/chunk-4VNS5WPM.js +42 -0
  28. package/chunk-53DNV5AT.js +421 -0
  29. package/chunk-572EKYLF.js +792 -0
  30. package/chunk-5MIDPSSK.js +206 -0
  31. package/chunk-5MMAK75Q.js +15 -0
  32. package/chunk-63W5N6P3.js +150 -0
  33. package/chunk-6B7G54GE.js +1078 -0
  34. package/chunk-6HYVJV7B.js +102 -0
  35. package/chunk-6WD3OOJS.js +20 -0
  36. package/chunk-7OC5VCLW.js +929 -0
  37. package/chunk-7YLKNMOM.js +562 -0
  38. package/chunk-ATNTHIZI.js +13 -0
  39. package/chunk-AUGHVUFE.js +69 -0
  40. package/chunk-AVMKZHBC.js +85 -0
  41. package/chunk-AZPCASRE.js +36 -0
  42. package/chunk-BR2WP3DF.js +548 -0
  43. package/chunk-BSTNFPHD.js +231 -0
  44. package/chunk-CF2WZF4N.js +134 -0
  45. package/chunk-CF7PE763.js +10 -0
  46. package/chunk-CJH2VTEU.js +360 -0
  47. package/chunk-CKOJQDKR.js +198 -0
  48. package/chunk-CM54RSSA.js +206 -0
  49. package/chunk-CQAHS7YO.js +4300 -0
  50. package/chunk-CWMSB67P.js +34 -0
  51. package/chunk-DFFIZ25G.js +30 -0
  52. package/chunk-DWLEOOGR.js +8 -0
  53. package/chunk-DZ3XJVET.js +231 -0
  54. package/chunk-EHLHSX7R.js +1433 -0
  55. package/chunk-ELRRLDWI.js +478 -0
  56. package/chunk-EYEEHCU4.js +3066 -0
  57. package/chunk-F6QQI5YI.js +19 -0
  58. package/chunk-G3SUCT4W.js +8 -0
  59. package/chunk-G5H7RNFL.js +807 -0
  60. package/chunk-GAKEBQD6.js +30 -0
  61. package/chunk-GBRG75BQ.js +86 -0
  62. package/chunk-GCMRDRCQ.js +190 -0
  63. package/chunk-GGUO4FKF.js +27158 -0
  64. package/chunk-GGXABIPP.js +628 -0
  65. package/chunk-H2RMRZJE.js +113 -0
  66. package/chunk-H33743XH.js +25 -0
  67. package/chunk-HEIIIZBX.js +104 -0
  68. package/chunk-HNMXYYJR.js +12 -0
  69. package/chunk-I3D64LRJ.js +1447 -0
  70. package/chunk-IAXBCTTE.js +175 -0
  71. package/chunk-IDZTNRP2.js +85 -0
  72. package/chunk-ISNCLGUZ.js +146 -0
  73. package/chunk-IYQV26RA.js +138 -0
  74. package/chunk-J4576WMJ.js +91 -0
  75. package/chunk-J5KV47ZW.js +222 -0
  76. package/chunk-JBTJAPUF.js +35 -0
  77. package/chunk-JZPBVBIY.js +94 -0
  78. package/chunk-KB7YFGL6.js +34 -0
  79. package/chunk-KKY4B2Q2.js +21 -0
  80. package/chunk-KQHGZWSV.js +63 -0
  81. package/chunk-KUG52IAP.js +8 -0
  82. package/chunk-KX6YBIHG.js +8 -0
  83. package/chunk-LAWBMYBC.js +171 -0
  84. package/chunk-LCBAMY2M.js +60 -0
  85. package/chunk-LM25IZBJ.js +902 -0
  86. package/chunk-LM6IYQ3F.js +16 -0
  87. package/chunk-M76ECQRD.js +13658 -0
  88. package/chunk-MRC4Q34M.js +188 -0
  89. package/chunk-NXZGF7F7.js +2878 -0
  90. package/chunk-OF5H3QWS.js +300 -0
  91. package/chunk-OLZBQWZU.js +6 -0
  92. package/chunk-OWOHNGCN.js +50 -0
  93. package/chunk-PN7AFLOK.js +3401 -0
  94. package/chunk-QR5IPGT3.js +24674 -0
  95. package/chunk-QSJ3HFEF.js +8 -0
  96. package/chunk-QYXLLLGL.js +4519 -0
  97. package/chunk-R2HXWML7.js +1949 -0
  98. package/chunk-ROWQEJRP.js +139 -0
  99. package/chunk-S7Z2HMCN.js +25 -0
  100. package/chunk-SYOF5TAS.js +962 -0
  101. package/chunk-TDIQFT2F.js +301 -0
  102. package/chunk-TILFE6LV.js +381 -0
  103. package/chunk-TZNCFAUP.js +2157 -0
  104. package/chunk-U4TRT5V4.js +246 -0
  105. package/chunk-U6VC4MU4.js +8 -0
  106. package/chunk-UAD2WT54.js +64 -0
  107. package/chunk-USZMK5UT.js +105 -0
  108. package/chunk-VEJLAVTC.js +2052 -0
  109. package/chunk-VF4K2QE6.js +21 -0
  110. package/chunk-VHBWHNVT.js +59 -0
  111. package/chunk-VIDPVFP3.js +20 -0
  112. package/chunk-VP4WJWKW.js +8882 -0
  113. package/chunk-VQ2AJRGD.js +148 -0
  114. package/chunk-W4NVOSFF.js +37 -0
  115. package/chunk-WWC7I6TA.js +8 -0
  116. package/chunk-X7W4TNB4.js +1550 -0
  117. package/chunk-XBIUN5CR.js +191 -0
  118. package/chunk-XDVAYP26.js +537 -0
  119. package/chunk-XKIMRZO2.js +221 -0
  120. package/chunk-Y5GCAMGP.js +9 -0
  121. package/chunk-YOUZDXU7.js +9013 -0
  122. package/chunk-Z4NR32XR.js +50 -0
  123. package/chunk-ZNFJWEN4.js +56 -0
  124. package/cliExecutor-DNE7TCC4.js +36 -0
  125. package/clipboardy-BVE3LVEH.js +12001 -0
  126. package/createAgentAutomationAction-537X433B.js +864 -0
  127. package/createDialogAction-YUD4RKBS.js +52 -0
  128. package/createPageAction-KJMFHL4C.js +169 -0
  129. package/db-HCJ5PRB5.js +271 -0
  130. package/dbSlice-C4UJLRZP.js +59 -0
  131. package/deleteFile-4SKGPHOZ.js +41 -0
  132. package/dialogCommands-H74KJKHC.js +59 -0
  133. package/dialogSlice-ETSD4YWS.js +146 -0
  134. package/docCreateCommands-ADUSU34K.js +215 -0
  135. package/docDeleteCommands-ZXV3S5OS.js +176 -0
  136. package/docReadCommands-YYYI6LT7.js +129 -0
  137. package/docStore-ZBF5DDKR.js +96 -0
  138. package/docUpdateCommands-7MGJ3BYA.js +313 -0
  139. package/fetchMessages-JOCYIFKL.js +16 -0
  140. package/getPricing-PWPJ6MNV.js +30 -0
  141. package/handleSendMessageAction-MGKI62Y6.js +183 -0
  142. package/index.js +184 -112288
  143. package/lib-FYYBQIXS.js +19839 -0
  144. package/localDialogRead-D3BELSTF.js +26 -0
  145. package/localFirstLog-DHNOY2NA.js +19 -0
  146. package/localRuntimeAuthority-TEGCOWX4.js +471 -0
  147. package/localRuntimeDb-LGDF6FQP.js +12 -0
  148. package/machineCommands-RMTMN7VQ.js +774 -0
  149. package/machineInfo-M6KB6HZN.js +10 -0
  150. package/machineWsRunDispatch-UIP355FN.js +105 -0
  151. package/memoryCommands-O4MIPIWQ.js +476 -0
  152. package/models-XLEOET3E.js +9 -0
  153. package/offlineMarxistsAgentCommand-BCPJITJL.js +242 -0
  154. package/package.json +3 -25
  155. package/read-RIJCIVKX.js +17 -0
  156. package/readDocTool-GZD2N3LO.js +16 -0
  157. package/readlineWorkspace-CRNQRZ6D.js +5374 -0
  158. package/removeDialogAgentAction-CXLST3N6.js +72 -0
  159. package/runAgentClientLoop-2S334SGA.js +288 -0
  160. package/runtimeDoctorCommands-LRHLPDRC.js +289 -0
  161. package/setDialogExtraReferencesAction-LP6VYGU7.js +59 -0
  162. package/setPrimaryDialogAgentAction-D3GGH23T.js +79 -0
  163. package/settingSlice-J4I3Z5H7.js +198 -0
  164. package/skillSummaryMarker-42HKSXYY.js +9 -0
  165. package/slateToRenderMarkdown-Y5IYN73U.js +7 -0
  166. package/slateUtils-2M7MUTWX.js +19 -0
  167. package/spaceCommands-NDEWMFZJ.js +450 -0
  168. package/spaceSlice-RLB6RTHO.js +145 -0
  169. package/streamAgentChatTurn-Y2TTYPBD.js +4503 -0
  170. package/tableCommands-GOFP7QKA.js +1286 -0
  171. package/toolApiClient-QI3YBNWB.js +26 -0
  172. package/tools-YZYLY2ZQ.js +83 -0
  173. package/understanding-HCSFPE7R.js +318 -0
  174. package/updateCommands-VOSPKXFF.js +31 -0
  175. package/updateDialogTitleAction-LQV6QLBW.js +185 -0
@@ -0,0 +1,206 @@
1
+ // packages/agent-runtime/modelLayerOverride.ts
2
+ var MODEL_LAYER_KEYS = [
3
+ "provider",
4
+ "model",
5
+ "apiSource",
6
+ "cliProvider",
7
+ "useServerProxy",
8
+ "apiKey",
9
+ "apiKeyRef",
10
+ "apiKeyHeader",
11
+ "customProviderUrl",
12
+ "credentialRef",
13
+ "credentialSynced",
14
+ "temperature",
15
+ "top_p",
16
+ "frequency_penalty",
17
+ "presence_penalty",
18
+ "max_tokens",
19
+ "reasoning_effort",
20
+ "enableThinking",
21
+ "thinkingBudget"
22
+ ];
23
+ function mergeReferences(base, extra) {
24
+ const safeBase = Array.isArray(base) ? base : [];
25
+ const safeExtra = Array.isArray(extra) ? extra : [];
26
+ const seen = /* @__PURE__ */ new Set();
27
+ const merged = [];
28
+ for (const item of [...safeBase, ...safeExtra]) {
29
+ const key = item?.dbKey;
30
+ if (key && seen.has(key)) continue;
31
+ if (key) seen.add(key);
32
+ if (item) merged.push(item);
33
+ }
34
+ return merged;
35
+ }
36
+ var asNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
37
+ function buildModelLayerOverride(agent) {
38
+ if (!agent || !asNonEmptyString(agent.provider) || !asNonEmptyString(agent.model)) {
39
+ return null;
40
+ }
41
+ const override = {
42
+ provider: agent.provider,
43
+ model: agent.model
44
+ };
45
+ for (const key of MODEL_LAYER_KEYS) {
46
+ if (key === "provider" || key === "model") continue;
47
+ const value = agent[key];
48
+ if (value !== void 0) {
49
+ override[key] = value;
50
+ }
51
+ }
52
+ if (Array.isArray(agent.references) && agent.references.length > 0) {
53
+ override.references = agent.references;
54
+ }
55
+ return override;
56
+ }
57
+ function applyModelLayerOverride(base, override) {
58
+ const next = { ...base };
59
+ for (const key of MODEL_LAYER_KEYS) {
60
+ delete next[key];
61
+ }
62
+ for (const key of MODEL_LAYER_KEYS) {
63
+ const value = override[key];
64
+ if (value !== void 0) {
65
+ next[key] = value;
66
+ }
67
+ }
68
+ const merged = mergeReferences(
69
+ base.references,
70
+ override.references
71
+ );
72
+ if (merged.length > 0) {
73
+ next.references = merged;
74
+ } else {
75
+ delete next.references;
76
+ }
77
+ return next;
78
+ }
79
+
80
+ // packages/agent-runtime/turnContext.ts
81
+ var DEFAULT_RECENT_CONTENT_LIMIT = 10;
82
+ var asTrimmed = (value) => typeof value === "string" ? value.trim() : "";
83
+ var asFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
84
+ var spaceRecordKey = (spaceId) => spaceId.startsWith("space-") ? spaceId : `space-${spaceId}`;
85
+ var makeLayer = (id, content, cacheScope = "turn") => ({ id, owner: "runtime", cacheScope, content });
86
+ var renderSpaceStructure = (spaceRecord, recentLimit) => {
87
+ const categories = spaceRecord.categories ?? {};
88
+ const validCategories = Object.entries(categories).filter((entry) => entry[1] !== null).sort(
89
+ (a, b) => asFiniteNumber(a[1].order) - asFiniteNumber(b[1].order)
90
+ );
91
+ const categoryNameById = /* @__PURE__ */ new Map();
92
+ let struct = "Directory Structure (Categories):\n";
93
+ if (validCategories.length === 0) struct += "(No categories defined)\n";
94
+ validCategories.forEach(([id, category]) => {
95
+ const name = asTrimmed(category.name) || id;
96
+ categoryNameById.set(id, name);
97
+ struct += `- ${name} (ID: ${id})
98
+ `;
99
+ });
100
+ const contents = spaceRecord.contents ?? {};
101
+ const recentContents = recentLimit > 0 ? Object.values(contents).filter((content) => content !== null).sort(
102
+ (a, b) => asFiniteNumber(b.updatedAt) - asFiniteNumber(a.updatedAt)
103
+ ).slice(0, recentLimit) : [];
104
+ if (recentContents.length > 0) {
105
+ struct += `
106
+ Recent Contents (Top ${recentLimit}):
107
+ `;
108
+ recentContents.forEach((content) => {
109
+ const categoryId = asTrimmed(content.categoryId);
110
+ const categoryName = categoryId ? categoryNameById.get(categoryId) || "Unknown" : "Uncategorized";
111
+ struct += `- [${asTrimmed(content.type) || "content"}] ${asTrimmed(content.title)} (Category: ${categoryName}, dbKey: ${asTrimmed(content.contentKey)})
112
+ `;
113
+ });
114
+ }
115
+ return struct;
116
+ };
117
+ var buildSpaceContextLayer = async (args) => {
118
+ const spaceId = asTrimmed(args.spaceId);
119
+ if (!spaceId) return null;
120
+ const recentLimit = args.recentContentLimit ?? DEFAULT_RECENT_CONTENT_LIMIT;
121
+ let spaceRecord = null;
122
+ let readError = null;
123
+ try {
124
+ spaceRecord = await args.source.readRecord(spaceRecordKey(spaceId));
125
+ } catch (error) {
126
+ readError = error instanceof Error ? error.message : String(error);
127
+ }
128
+ if (!spaceRecord) {
129
+ return makeLayer(
130
+ "space-context",
131
+ [
132
+ "--- \u5F53\u524D\u7A7A\u95F4\uFF08Space\uFF09---",
133
+ `\u672C\u5BF9\u8BDD\u8BB0\u5F55\u58F0\u660E\u5C5E\u4E8E Space ${spaceId}\uFF0C\u4F46\u5F53\u524D\u65E0\u6CD5\u8BFB\u53D6\u8BE5 Space \u7684\u6570\u636E${readError ? `\uFF08${readError}\uFF09` : "\uFF08\u8BB0\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u8FBE\uFF09"}\u3002`,
134
+ "\u5982\u88AB\u95EE\u53CA\uFF0C\u8BF7\u5982\u5B9E\u8BF4\u660E\u300C\u5BF9\u8BDD\u5C5E\u4E8E\u8BE5 Space \u4F46\u6682\u65F6\u8BFB\u4E0D\u5230\u7A7A\u95F4\u8BE6\u60C5\u300D\uFF0C\u4E0D\u8981\u58F0\u79F0\u5BF9\u8BDD\u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u7A7A\u95F4\u3002"
135
+ ].join("\n")
136
+ );
137
+ }
138
+ const name = asTrimmed(spaceRecord.name);
139
+ const description = asTrimmed(spaceRecord.description);
140
+ const structure = renderSpaceStructure(spaceRecord, recentLimit);
141
+ return makeLayer(
142
+ "space-context",
143
+ [
144
+ "--- \u5F53\u524D\u7A7A\u95F4\uFF08Space\uFF09---",
145
+ "\u672C\u5BF9\u8BDD\u5C5E\u4E8E\u4EE5\u4E0B Space\uFF1A",
146
+ `Space Title: ${name || spaceId}`,
147
+ `Space ID: ${spaceId}`,
148
+ `Description: ${description || "N/A"}`,
149
+ "",
150
+ structure.trimEnd()
151
+ ].join("\n")
152
+ );
153
+ };
154
+ var buildSkillDiscoveryLayer = (skills, boundFolder) => {
155
+ if (skills.length === 0) return null;
156
+ const lines = [
157
+ "--- \u53EF\u7528\u6280\u80FD\uFF08Skills\uFF09---",
158
+ `\u5DE5\u4F5C\u533A ${boundFolder} \u4E2D\u53D1\u73B0\u4E86 ${skills.length} \u4E2A\u6280\u80FD\uFF08SKILL.md\uFF09\uFF1A`,
159
+ "\u6A21\u578B\u53EF\u6309\u9700\u7528 readFile \u8BFB\u53D6\u4EE5\u4E0B\u6587\u4EF6\u83B7\u53D6\u8BE6\u7EC6\u6307\u4EE4\uFF1A",
160
+ "",
161
+ ...skills.map(
162
+ (s) => `- ${s.name}: ${s.description}
163
+ path: ${s.relativePath}`
164
+ )
165
+ ];
166
+ return makeLayer("skill-discovery", lines.join("\n"));
167
+ };
168
+ var buildLinkedSpacesSection = async (args) => {
169
+ const ids = (args.linkedSpaceIds ?? []).filter(
170
+ (id) => typeof id === "string" && id.trim() !== ""
171
+ );
172
+ if (ids.length === 0) return null;
173
+ const lines = [];
174
+ for (const rawId of ids) {
175
+ const spaceId = asTrimmed(rawId);
176
+ let spaceData = null;
177
+ try {
178
+ spaceData = await args.source.readRecord(spaceRecordKey(spaceId));
179
+ } catch {
180
+ spaceData = null;
181
+ }
182
+ if (spaceData) {
183
+ const name = asTrimmed(spaceData.name) || spaceId;
184
+ const desc = asTrimmed(spaceData.description);
185
+ lines.push(`- ${name} (ID: ${spaceId})${desc ? `: ${desc}` : ""}`);
186
+ } else {
187
+ lines.push(`- [\u65E0\u6CD5\u8BBF\u95EE] ${spaceId}`);
188
+ }
189
+ }
190
+ if (lines.length === 0) return null;
191
+ return [
192
+ "--- \u5173\u8054\u7A7A\u95F4 (Linked Spaces) ---",
193
+ "\u4EE5\u4E0B\u662F Agent \u53EF\u8BBF\u95EE\u7684\u5176\u4ED6\u5DE5\u4F5C\u7A7A\u95F4\uFF08\u7C97\u7565\u4E0A\u4E0B\u6587\uFF09\uFF1A",
194
+ lines.join("\n"),
195
+ "",
196
+ "\u63D0\u793A\uFF1A\u5982\u9700\u67E5\u8BE2\u8FD9\u4E9B\u7A7A\u95F4\u7684\u8BE6\u7EC6\u5185\u5BB9\uFF0C\u53EF\u4F7F\u7528 read \u5DE5\u5177\u914D\u5408\u5BF9\u5E94\u7684 dbKey\u3002"
197
+ ].join("\n");
198
+ };
199
+
200
+ export {
201
+ buildModelLayerOverride,
202
+ applyModelLayerOverride,
203
+ buildSpaceContextLayer,
204
+ buildSkillDiscoveryLayer,
205
+ buildLinkedSpacesSection
206
+ };