nolo-cli 0.8.0-alpha.2 → 0.8.0-alpha.21
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.
- package/README.md +1 -1
- package/_executeModel-42U3VOVZ.js +205 -0
- package/action-TLI3V62L.js +28 -0
- package/addContentAction-57RSIIMR.js +26 -0
- package/addDialogAgentAction-G3VWEA6E.js +68 -0
- package/agentDeleteCommand-5DD2IM3J.js +327 -0
- package/agentEmailCommands-6FACJBU4.js +628 -0
- package/agentListCommands-I6KZYCIG.js +223 -0
- package/agentMachineCommands-VKLIGMZA.js +425 -0
- package/agentPullCommand-O2MTUAFR.js +122 -0
- package/agentRecordCommands-7TZICYDT.js +96 -0
- package/agentRunCommand-L4OM23KV.js +114 -0
- package/agentRunControl-K4VKNEHF.js +57 -0
- package/agentRuntimeLocal-ZYEIPTY4.js +104 -0
- package/agentSlice-BX7GXSNO.js +42 -0
- package/authCommand-EB5JSOX5.js +581 -0
- package/authCommands-XPEHTKSM.js +35 -0
- package/chunk-25LCXTML.js +175 -0
- package/chunk-2ECQG4YX.js +22296 -0
- package/chunk-2FTTDCD4.js +675 -0
- package/chunk-2JCXITPK.js +1078 -0
- package/chunk-3ASDTTEI.js +1774 -0
- package/chunk-3EUW3WEO.js +8 -0
- package/chunk-3LY4F7SV.js +9293 -0
- package/chunk-4CQLVGRV.js +50 -0
- package/chunk-4IJYA27C.js +342 -0
- package/chunk-4O3CARJ4.js +231 -0
- package/chunk-4QEWT7KD.js +933 -0
- package/chunk-4SN6J65J.js +38 -0
- package/chunk-4VNS5WPM.js +42 -0
- package/chunk-4XENYTF5.js +222 -0
- package/chunk-4ZDM73SD.js +34 -0
- package/chunk-5CS33IBL.js +301 -0
- package/chunk-5EFXE3O7.js +138 -0
- package/chunk-5KLGBAAR.js +386 -0
- package/chunk-5MIDPSSK.js +206 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/chunk-63W5N6P3.js +150 -0
- package/chunk-6HYVJV7B.js +102 -0
- package/chunk-6KHNO3SK.js +1948 -0
- package/chunk-6WD3OOJS.js +20 -0
- package/chunk-7DAJ4AI4.js +191 -0
- package/chunk-7GNGZRLZ.js +1939 -0
- package/chunk-7KCUSYT2.js +354 -0
- package/chunk-7U44LYTR.js +238 -0
- package/chunk-AFON4QUU.js +112 -0
- package/chunk-AGFH73SK.js +239 -0
- package/chunk-AL2KDGR2.js +27339 -0
- package/chunk-AS4PVWA4.js +221 -0
- package/chunk-ATNTHIZI.js +13 -0
- package/chunk-AVMKZHBC.js +85 -0
- package/chunk-AZPCASRE.js +36 -0
- package/chunk-BBYVOSU2.js +792 -0
- package/chunk-C3RUNRHT.js +51 -0
- package/chunk-C4FTUXVF.js +146 -0
- package/chunk-CF2WZF4N.js +134 -0
- package/chunk-CF7PE763.js +10 -0
- package/chunk-CKOJQDKR.js +198 -0
- package/chunk-CMKUBIGW.js +1550 -0
- package/chunk-CWMSB67P.js +34 -0
- package/chunk-DCOA4QSN.js +105 -0
- package/chunk-DFFIZ25G.js +30 -0
- package/chunk-DSZUWUYB.js +478 -0
- package/chunk-DWLEOOGR.js +8 -0
- package/chunk-DZ3XJVET.js +231 -0
- package/chunk-EHLHSX7R.js +1433 -0
- package/chunk-ENOG22KJ.js +939 -0
- package/chunk-FSO5B7GH.js +171 -0
- package/chunk-FVYY6MCS.js +1447 -0
- package/chunk-G3SUCT4W.js +8 -0
- package/chunk-GAKEBQD6.js +30 -0
- package/chunk-GBRG75BQ.js +86 -0
- package/chunk-GU3PEVGZ.js +4723 -0
- package/chunk-H33743XH.js +25 -0
- package/chunk-HNMXYYJR.js +12 -0
- package/chunk-HNW7IJSK.js +71 -0
- package/chunk-I42VC5KR.js +15 -0
- package/chunk-I6XMPTMR.js +113 -0
- package/chunk-IDZTNRP2.js +85 -0
- package/chunk-ISNCLGUZ.js +146 -0
- package/chunk-IWX4UW2E.js +548 -0
- package/chunk-JBTJAPUF.js +35 -0
- package/chunk-JEXVIMYZ.js +55 -0
- package/chunk-JRKKFRAV.js +537 -0
- package/chunk-JZPBVBIY.js +94 -0
- package/chunk-KKY4B2Q2.js +21 -0
- package/chunk-KQHGZWSV.js +63 -0
- package/chunk-KUG52IAP.js +8 -0
- package/chunk-KX6YBIHG.js +8 -0
- package/chunk-LCBAMY2M.js +60 -0
- package/chunk-LM6IYQ3F.js +16 -0
- package/chunk-LTRXGFMS.js +83 -0
- package/chunk-M76ECQRD.js +13658 -0
- package/chunk-MRC4Q34M.js +188 -0
- package/chunk-MTU75CZ2.js +91 -0
- package/chunk-N54XAP77.js +19 -0
- package/chunk-O2ZNTTET.js +3272 -0
- package/chunk-O4BU24WZ.js +3212 -0
- package/chunk-OLZBQWZU.js +6 -0
- package/chunk-OOSFSFMA.js +271 -0
- package/chunk-OPZYGHUC.js +89 -0
- package/chunk-OWOHNGCN.js +50 -0
- package/chunk-P3PKED2I.js +962 -0
- package/chunk-QSJ3HFEF.js +8 -0
- package/chunk-RCSJFQPB.js +9036 -0
- package/chunk-RL776AGR.js +190 -0
- package/chunk-ROWQEJRP.js +139 -0
- package/chunk-S7Z2HMCN.js +25 -0
- package/chunk-SDJDLO5W.js +628 -0
- package/chunk-SOTZ6RDN.js +69 -0
- package/chunk-TILFE6LV.js +381 -0
- package/chunk-U4TRT5V4.js +246 -0
- package/chunk-U6VC4MU4.js +8 -0
- package/chunk-UAD2WT54.js +64 -0
- package/chunk-UB6SN4NJ.js +421 -0
- package/chunk-URUUZLPA.js +807 -0
- package/chunk-UTLZINAP.js +3066 -0
- package/chunk-VC6OZXO5.js +298 -0
- package/chunk-VF4K2QE6.js +21 -0
- package/chunk-VHBWHNVT.js +59 -0
- package/chunk-VIDPVFP3.js +20 -0
- package/chunk-VP4WJWKW.js +8882 -0
- package/chunk-VUW5FBDB.js +573 -0
- package/chunk-VVX233PH.js +482 -0
- package/chunk-VX3SXJ3N.js +2052 -0
- package/chunk-W4NVOSFF.js +37 -0
- package/chunk-WWC7I6TA.js +8 -0
- package/chunk-WZSRQNQG.js +2587 -0
- package/chunk-XBUBEFNX.js +34 -0
- package/chunk-XENYHRUE.js +104 -0
- package/chunk-Y5GCAMGP.js +9 -0
- package/chunk-YPRZSPF3.js +148 -0
- package/chunk-Z4NR32XR.js +50 -0
- package/chunk-ZNFJWEN4.js +56 -0
- package/cliExecutor-K3F7DMRO.js +36 -0
- package/clipboardy-BVE3LVEH.js +12001 -0
- package/createAgentAutomationAction-RJF3N2QY.js +866 -0
- package/createDialogAction-DRSPS6CE.js +55 -0
- package/createPageAction-6B2WMNO3.js +172 -0
- package/db-HCJ5PRB5.js +271 -0
- package/dbSlice-Q3TM2FJV.js +60 -0
- package/deleteFile-OW53A6BX.js +41 -0
- package/dialogCommands-4IX4XIZE.js +63 -0
- package/dialogSlice-3M7KX2TX.js +148 -0
- package/docCreateCommands-SIL3NPGT.js +220 -0
- package/docDeleteCommands-7IOMLUS4.js +181 -0
- package/docReadCommands-FNFXUA5L.js +134 -0
- package/docStore-SV7E34D4.js +98 -0
- package/docUpdateCommands-X2HNDVUC.js +318 -0
- package/fetchMessages-KTNM7QAR.js +17 -0
- package/getPricing-3E6UNPKL.js +30 -0
- package/handleSendMessageAction-JYETO5RZ.js +185 -0
- package/index.js +188 -112958
- package/lib-FYYBQIXS.js +19839 -0
- package/localDialogRead-2VRI24F4.js +26 -0
- package/localFirstLog-DHNOY2NA.js +19 -0
- package/localRuntimeAuthority-TEGCOWX4.js +471 -0
- package/localRuntimeDb-LGDF6FQP.js +12 -0
- package/machineCommands-RIO3RP5Q.js +781 -0
- package/machineInfo-M6KB6HZN.js +10 -0
- package/machineWsRunDispatch-W7UYLGB5.js +112 -0
- package/memoryCommands-O4MIPIWQ.js +476 -0
- package/models-4OPOOLFS.js +9 -0
- package/offlineMarxistsAgentCommand-BCPJITJL.js +242 -0
- package/package.json +4 -24
- package/read-GW7ZEI23.js +17 -0
- package/readDocTool-HUFU6OCT.js +16 -0
- package/readlineWorkspace-27JR7WPW.js +5682 -0
- package/removeDialogAgentAction-CXKR4NJI.js +73 -0
- package/runAgentClientLoop-HZFAPJHS.js +293 -0
- package/runtimeDoctorCommands-LRHLPDRC.js +289 -0
- package/setDialogExtraReferencesAction-6RKUSXHX.js +60 -0
- package/setPrimaryDialogAgentAction-T3UTBEFG.js +80 -0
- package/settingSlice-IVKXJXMG.js +199 -0
- package/skillDiscovery-UGSQGX2U.js +16 -0
- package/skillSummaryMarker-42HKSXYY.js +9 -0
- package/slateToRenderMarkdown-Y5IYN73U.js +7 -0
- package/slateUtils-2M7MUTWX.js +19 -0
- package/spaceCommands-E7VOF4LO.js +450 -0
- package/spaceSlice-TSVROA5U.js +149 -0
- package/streamAgentChatTurn-3C5RQZJF.js +4510 -0
- package/tableCommands-O7O2LBEG.js +1286 -0
- package/toolApiClient-QI3YBNWB.js +26 -0
- package/tools-EQDEKR6N.js +87 -0
- package/tuiSummaryLlmCaller-RV3THLZF.js +78 -0
- package/understanding-3CUQQ6SV.js +271 -0
- package/updateCommands-VOSPKXFF.js +31 -0
- package/updateDialogTitleAction-3XV7VWSZ.js +188 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import {
|
|
2
|
+
i18n_default,
|
|
3
|
+
toolRegistry
|
|
4
|
+
} from "./chunk-AL2KDGR2.js";
|
|
5
|
+
import {
|
|
6
|
+
canonicalizeToolNames
|
|
7
|
+
} from "./chunk-P3PKED2I.js";
|
|
8
|
+
import {
|
|
9
|
+
asTrimmedLowercaseString
|
|
10
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
11
|
+
import {
|
|
12
|
+
isRecord
|
|
13
|
+
} from "./chunk-KUG52IAP.js";
|
|
14
|
+
|
|
15
|
+
// packages/ai/tools/toolSchemaCompatibility.ts
|
|
16
|
+
var COMPOSITION_KEYS = ["anyOf", "oneOf", "allOf"];
|
|
17
|
+
var LIMITED_JSON_SCHEMA_PROVIDERS = /* @__PURE__ */ new Set([
|
|
18
|
+
"fireworks"
|
|
19
|
+
]);
|
|
20
|
+
var sanitizeSchemaNode = (value) => {
|
|
21
|
+
if (Array.isArray(value)) {
|
|
22
|
+
return value.map((item) => sanitizeSchemaNode(item));
|
|
23
|
+
}
|
|
24
|
+
if (!isRecord(value)) {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
const next = {};
|
|
28
|
+
for (const [key, child] of Object.entries(value)) {
|
|
29
|
+
if (COMPOSITION_KEYS.includes(key)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
next[key] = sanitizeSchemaNode(child);
|
|
33
|
+
}
|
|
34
|
+
return next;
|
|
35
|
+
};
|
|
36
|
+
var shouldSanitizeProviderSchema = (provider) => LIMITED_JSON_SCHEMA_PROVIDERS.has(asTrimmedLowercaseString(provider));
|
|
37
|
+
var sanitizeToolForProvider = (tool, provider) => {
|
|
38
|
+
if (!shouldSanitizeProviderSchema(provider)) {
|
|
39
|
+
return tool;
|
|
40
|
+
}
|
|
41
|
+
const parameters = tool?.function?.parameters;
|
|
42
|
+
if (!isRecord(parameters)) {
|
|
43
|
+
return tool;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
...tool,
|
|
47
|
+
function: {
|
|
48
|
+
...tool.function,
|
|
49
|
+
parameters: sanitizeSchemaNode(parameters)
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// packages/ai/tools/prepareTools.ts
|
|
55
|
+
var translatedFunctionCache = /* @__PURE__ */ new Map();
|
|
56
|
+
var prepareToolsResultCache = /* @__PURE__ */ new Map();
|
|
57
|
+
var PREPARE_TOOLS_CACHE_LIMIT = 128;
|
|
58
|
+
function getTranslation(keys, defaultVal) {
|
|
59
|
+
for (const key of keys) {
|
|
60
|
+
if (i18n_default.exists(key)) {
|
|
61
|
+
return i18n_default.t(key);
|
|
62
|
+
}
|
|
63
|
+
const aiKey = key.startsWith("ai:") ? key : `ai:${key}`;
|
|
64
|
+
if (i18n_default.exists(aiKey)) {
|
|
65
|
+
return i18n_default.t(aiKey);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return defaultVal;
|
|
69
|
+
}
|
|
70
|
+
function translateSchema(schema) {
|
|
71
|
+
if (!schema || typeof schema !== "object") return schema;
|
|
72
|
+
const nextSchema = JSON.parse(JSON.stringify(schema));
|
|
73
|
+
const toolName = nextSchema.name;
|
|
74
|
+
if (!toolName) return nextSchema;
|
|
75
|
+
const walk = (node, path) => {
|
|
76
|
+
if (!node || typeof node !== "object") return;
|
|
77
|
+
if (typeof node.description === "string") {
|
|
78
|
+
const keysToTry = [
|
|
79
|
+
`${path}.description`,
|
|
80
|
+
`${path}.desc`,
|
|
81
|
+
path,
|
|
82
|
+
node.description
|
|
83
|
+
];
|
|
84
|
+
node.description = getTranslation(keysToTry, node.description);
|
|
85
|
+
}
|
|
86
|
+
if (node.parameters && typeof node.parameters === "object") {
|
|
87
|
+
walk(node.parameters, path);
|
|
88
|
+
}
|
|
89
|
+
if (node.properties && typeof node.properties === "object") {
|
|
90
|
+
for (const [key, child] of Object.entries(node.properties)) {
|
|
91
|
+
const nextPath = path.endsWith(".params") ? `${path}.${key}` : `${path}.params.${key}`;
|
|
92
|
+
walk(child, nextPath);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (node.items && typeof node.items === "object") {
|
|
96
|
+
walk(node.items, path);
|
|
97
|
+
}
|
|
98
|
+
const compositions = ["anyOf", "oneOf", "allOf"];
|
|
99
|
+
for (const comp of compositions) {
|
|
100
|
+
if (Array.isArray(node[comp])) {
|
|
101
|
+
node[comp].forEach((child, idx) => {
|
|
102
|
+
const suffix = child.type === "string" ? "stringDesc" : child.type === "object" ? "objectDesc" : `${idx}`;
|
|
103
|
+
walk(child, `${path}.${suffix}`);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
walk(nextSchema, `tools.${toolName}`);
|
|
109
|
+
return nextSchema;
|
|
110
|
+
}
|
|
111
|
+
function currentI18nLanguage() {
|
|
112
|
+
return typeof i18n_default.language === "string" ? i18n_default.language : "";
|
|
113
|
+
}
|
|
114
|
+
function translateSchemaCached(schema) {
|
|
115
|
+
if (!schema || typeof schema !== "object") return schema;
|
|
116
|
+
const toolName = typeof schema.name === "string" ? schema.name : "";
|
|
117
|
+
if (!toolName) return translateSchema(schema);
|
|
118
|
+
const cacheKey = `${currentI18nLanguage()}\0${toolName}`;
|
|
119
|
+
const hit = translatedFunctionCache.get(cacheKey);
|
|
120
|
+
if (hit) return hit;
|
|
121
|
+
const translated = translateSchema(schema);
|
|
122
|
+
translatedFunctionCache.set(cacheKey, translated);
|
|
123
|
+
return translated;
|
|
124
|
+
}
|
|
125
|
+
function buildPrepareToolsCacheKey(toolNames, disabledToolNames, provider) {
|
|
126
|
+
return [
|
|
127
|
+
currentI18nLanguage(),
|
|
128
|
+
provider ?? "",
|
|
129
|
+
disabledToolNames.join(""),
|
|
130
|
+
toolNames.join("")
|
|
131
|
+
].join("\0");
|
|
132
|
+
}
|
|
133
|
+
function rememberPrepareToolsResult(key, value) {
|
|
134
|
+
if (prepareToolsResultCache.size >= PREPARE_TOOLS_CACHE_LIMIT) {
|
|
135
|
+
const oldest = prepareToolsResultCache.keys().next().value;
|
|
136
|
+
if (oldest !== void 0) {
|
|
137
|
+
prepareToolsResultCache.delete(oldest);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
prepareToolsResultCache.set(key, value);
|
|
141
|
+
}
|
|
142
|
+
var prepareTools = (toolNames, options) => {
|
|
143
|
+
const disabledList = canonicalizeToolNames(options?.disabledToolNames ?? []);
|
|
144
|
+
const disabledToolNames = new Set(disabledList);
|
|
145
|
+
const canonicalNames = canonicalizeToolNames(toolNames).filter(
|
|
146
|
+
(toolName) => !disabledToolNames.has(toolName)
|
|
147
|
+
);
|
|
148
|
+
const cacheKey = buildPrepareToolsCacheKey(
|
|
149
|
+
canonicalNames,
|
|
150
|
+
disabledList,
|
|
151
|
+
options?.provider
|
|
152
|
+
);
|
|
153
|
+
const cached = prepareToolsResultCache.get(cacheKey);
|
|
154
|
+
if (cached) {
|
|
155
|
+
return cached.slice();
|
|
156
|
+
}
|
|
157
|
+
const prepared = canonicalNames.map((toolName) => {
|
|
158
|
+
const regTool = toolRegistry[toolName];
|
|
159
|
+
if (!regTool) return regTool;
|
|
160
|
+
return {
|
|
161
|
+
...regTool,
|
|
162
|
+
function: translateSchemaCached(regTool.function)
|
|
163
|
+
};
|
|
164
|
+
}).map((tool) => sanitizeToolForProvider(tool, options?.provider)).filter(Boolean);
|
|
165
|
+
rememberPrepareToolsResult(cacheKey, prepared);
|
|
166
|
+
return prepared.slice();
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
prepareTools
|
|
171
|
+
};
|