nolo-cli 0.26.2 → 0.27.0
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/{_executeModel-ZPNYAEFW.js → _executeModel-GBJY45QW.js} +18 -18
- package/{agentDeleteCommand-5ZV4433K.js → agentDeleteCommand-VFHDZJG3.js} +12 -12
- package/{agentEmailCommands-Z7KOYDVQ.js → agentEmailCommands-NV64EI7G.js} +24 -24
- package/{agentListCommands-UQUXJYUN.js → agentListCommands-BDDUYHLP.js} +14 -14
- package/{agentMachineCommands-53O6P6L5.js → agentMachineCommands-2KYBYNLE.js} +13 -13
- package/{agentRecordCommands-ZRYNBSSS.js → agentRecordCommands-3OX576G3.js} +23 -23
- package/{agentRunCommand-B73MKVOG.js → agentRunCommand-FZOGN67Y.js} +23 -23
- package/{agentRuntimeLocal-GVNERRKQ.js → agentRuntimeLocal-552R4CZA.js} +9 -9
- package/{agentSlice-OJBHIL34.js → agentSlice-7AEBCNVZ.js} +1 -1
- package/{appDeleteCommands-23Z3Z6KE.js → appDeleteCommands-IPJT6IYW.js} +13 -13
- package/{appDeployCommands-3MFAR4Z7.js → appDeployCommands-24P4CADQ.js} +13 -13
- package/{appDeployStatusCommands-JHU6GSN4.js → appDeployStatusCommands-3DRZOUAG.js} +13 -13
- package/{appGetCommands-24J55H2Y.js → appGetCommands-JEOSBLUL.js} +13 -13
- package/{appListCommands-HE5KP3PH.js → appListCommands-EIBM54WR.js} +13 -13
- package/{authCommand-KGRK6MNU.js → authCommand-MKMYHD52.js} +6 -6
- package/{chunk-CWTT2NZ6.js → chunk-3X4IYB22.js} +2 -2
- package/{chunk-JJ2WUBFN.js → chunk-4FRIAKSZ.js} +1 -1
- package/{chunk-S7AV3NCK.js → chunk-56CPK6JE.js} +11 -11
- package/{chunk-KURQBS7S.js → chunk-6MBOZ4UP.js} +1 -1
- package/{chunk-PTKI7TIN.js → chunk-7OYLPHDL.js} +84 -32
- package/{chunk-AZW5AHMW.js → chunk-7WMLPRXP.js} +1 -1
- package/{chunk-AOPOTHFK.js → chunk-FRN5QOKN.js} +1 -1
- package/{chunk-LEHTC2FI.js → chunk-GT3GG2H7.js} +2 -1
- package/{chunk-AAWJ5S3G.js → chunk-H7N2NOJF.js} +1 -1
- package/{chunk-MCXQNEJ3.js → chunk-HALKDXKP.js} +1 -1
- package/{chunk-GGB6MPHD.js → chunk-HQFXBRI2.js} +16 -16
- package/{chunk-ZFL3LTU7.js → chunk-J7PB5GXH.js} +2 -2
- package/{chunk-CMKUBIGW.js → chunk-JDSUTNYY.js} +2 -2
- package/{chunk-PY7VGC5M.js → chunk-JQ3LNEMS.js} +3 -2
- package/{chunk-PMCKFQYC.js → chunk-KXEWHQAW.js} +1 -1
- package/{chunk-G36SUBHA.js → chunk-L3QFIBZG.js} +1 -1
- package/{chunk-GNGOZMU2.js → chunk-N32A423D.js} +2 -2
- package/{chunk-TNM27YZ7.js → chunk-NCRWA6ZB.js} +3 -3
- package/{chunk-5DWZ46RJ.js → chunk-O5VFD7V6.js} +1 -1
- package/{chunk-YJY7HODU.js → chunk-PVWFM7JP.js} +1 -1
- package/{chunk-ADE6577S.js → chunk-Q4TAIQTA.js} +11 -11
- package/{chunk-GD23ZX7Z.js → chunk-QCUS52YR.js} +3 -3
- package/{chunk-SIUEKVK4.js → chunk-TTPVLL5F.js} +103 -25
- package/{chunk-5EDKWSQN.js → chunk-UADEEVDX.js} +12 -266
- package/{chunk-XNZJVYFS.js → chunk-UTYJ47H2.js} +1 -1
- package/{chunk-RM464B7I.js → chunk-V7BUGVT2.js} +2 -2
- package/{chunk-TWA4L7J7.js → chunk-VV4TYWNV.js} +1 -1
- package/{chunk-TLYHUIWF.js → chunk-W2IOPRHX.js} +3 -3
- package/{chunk-CV6BM7LU.js → chunk-X43U4JUJ.js} +1 -1
- package/{chunk-PXPISYEH.js → chunk-XS7UPVR7.js} +2 -2
- package/{chunk-CZHE6LLV.js → chunk-YTA2QOEE.js} +20 -0
- package/{chunk-P3RZ6DHN.js → chunk-YZV4676I.js} +24 -15
- package/{chunk-LLDGWLML.js → chunk-Z3ORPMOA.js} +8 -8
- package/chunk-ZJ7WLPDP.js +553 -0
- package/{chunk-J2WT5CEO.js → chunk-ZNFZGHKL.js} +1 -1
- package/{cliExecutor-K3F7DMRO.js → cliExecutor-BBUVQU4L.js} +1 -1
- package/{createAgentAutomationAction-PO62NUR7.js → createAgentAutomationAction-YB65NAU5.js} +6 -6
- package/{createDialogAction-ORFRYI3C.js → createDialogAction-6USRBKKL.js} +7 -7
- package/{createPageAction-XWVMNTYH.js → createPageAction-ZGE3SG6J.js} +6 -6
- package/{dialogCommands-XTJHROXM.js → dialogCommands-O4CJJRTQ.js} +13 -13
- package/{dialogSlice-DJXC53YW.js → dialogSlice-HMRBZCSE.js} +6 -6
- package/{docCreateCommands-T2XRVXYS.js → docCreateCommands-2U5AIF3O.js} +12 -12
- package/{docDeleteCommands-L7RXFXY3.js → docDeleteCommands-EDCAUQEF.js} +13 -13
- package/{docReadCommands-M5PYNADQ.js → docReadCommands-KFMBFGPY.js} +12 -12
- package/{docStore-6LKLLFDW.js → docStore-ZGGDZFCC.js} +7 -7
- package/{docUpdateCommands-OA5EGPLQ.js → docUpdateCommands-57M4XOT7.js} +12 -12
- package/{getPricing-6C3C47Y4.js → getPricing-X6I23RN6.js} +3 -3
- package/{handleSendMessageAction-ILFGZTN5.js → handleSendMessageAction-ANCZXLQY.js} +6 -6
- package/index.js +47 -47
- package/{machineCommands-AKAQGPAO.js → machineCommands-6EG5U6TU.js} +23 -23
- package/{machineWsRunDispatch-RSBERM64.js → machineWsRunDispatch-SFIKRI4G.js} +22 -22
- package/{models-ILWKIX2Y.js → models-YT32CTT5.js} +2 -2
- package/package.json +1 -1
- package/{readlineWorkspace-TUH3SFHO.js → readlineWorkspace-TVIHBRN2.js} +30 -27
- package/{runAgentClientLoop-C3QB2EXV.js → runAgentClientLoop-SJ6QQ3ZS.js} +15 -15
- package/{spaceCommands-SXYOFGUJ.js → spaceCommands-XK46FRYG.js} +12 -12
- package/{spaceSlice-6BHMRP5O.js → spaceSlice-FNFNVXPQ.js} +6 -6
- package/{streamAgentChatTurn-GF5W5OIP.js → streamAgentChatTurn-HHIWP44U.js} +18 -18
- package/{tools-KBCLJ43G.js → tools-CT7AFBI3.js} +10 -10
- package/{tuiSummaryLlmCaller-ARIMGILF.js → tuiSummaryLlmCaller-GCUPULOV.js} +4 -4
- package/{updateDialogTitleAction-LMHZUY4Q.js → updateDialogTitleAction-7RFN5GA4.js} +6 -6
- package/chunk-ZUXIXYJI.js +0 -297
|
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
|
|
|
300
300
|
const overrides = {};
|
|
301
301
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
302
302
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
303
|
-
const { _executeModel } = await import("./_executeModel-
|
|
303
|
+
const { _executeModel } = await import("./_executeModel-GBJY45QW.js");
|
|
304
304
|
return _executeModel(
|
|
305
305
|
{
|
|
306
306
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
|
|
|
321
321
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
322
322
|
*/
|
|
323
323
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
324
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
324
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-SJ6QQ3ZS.js");
|
|
325
325
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
326
326
|
{
|
|
327
327
|
agentKey: args.agentKey,
|
|
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
|
|
|
337
337
|
* 聊天轮次流式 Agent 调用
|
|
338
338
|
*/
|
|
339
339
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
340
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
340
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-HHIWP44U.js");
|
|
341
341
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
342
342
|
}),
|
|
343
343
|
/**
|
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
providerHttpFailure,
|
|
5
5
|
readSseFrames,
|
|
6
6
|
throwIfChatCompletionStreamFailed
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HALKDXKP.js";
|
|
8
8
|
import {
|
|
9
|
-
parseToolArgumentsJson
|
|
10
|
-
|
|
9
|
+
parseToolArgumentsJson,
|
|
10
|
+
resolveHistoricalToolContentCap
|
|
11
|
+
} from "./chunk-YZV4676I.js";
|
|
11
12
|
import {
|
|
12
13
|
createThinkParserState,
|
|
13
14
|
createToolCallAccumulator,
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
import {
|
|
19
20
|
requiresBareImageUrl,
|
|
20
21
|
toBareImageUrlMessages
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZJ7WLPDP.js";
|
|
22
23
|
import {
|
|
23
24
|
shouldStripReasoningContentForOutbound,
|
|
24
25
|
toOpenAiCompatibleMessages
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
import {
|
|
27
28
|
buildProviderAuthHeaders,
|
|
28
29
|
buildProviderExecutionPlan
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XS7UPVR7.js";
|
|
30
31
|
import {
|
|
31
32
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
32
33
|
buildNoloWorkspaceCommandArgs,
|
|
@@ -1204,10 +1205,43 @@ async function executeLocalToolWithPolicy(args) {
|
|
|
1204
1205
|
|
|
1205
1206
|
// packages/agent-runtime/localWorkspaceTools.ts
|
|
1206
1207
|
import { existsSync as existsSync2 } from "node:fs";
|
|
1208
|
+
import { createHash } from "node:crypto";
|
|
1207
1209
|
import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
1208
1210
|
import { dirname, relative, resolve, sep } from "node:path";
|
|
1209
1211
|
import { spawnSync, spawn as spawnChildProcess } from "node:child_process";
|
|
1210
1212
|
|
|
1213
|
+
// packages/core/readRangeLedger.ts
|
|
1214
|
+
function filterRetainedLedgerRecords(records, retainedCap) {
|
|
1215
|
+
return records.filter((record) => record.chars <= retainedCap);
|
|
1216
|
+
}
|
|
1217
|
+
function isValidRange(range) {
|
|
1218
|
+
return Number.isInteger(range.startLine) && Number.isInteger(range.endLine) && range.endLine >= range.startLine;
|
|
1219
|
+
}
|
|
1220
|
+
function mergeLineRanges(ranges) {
|
|
1221
|
+
const sorted = ranges.filter(isValidRange).slice().sort((a, b) => a.startLine - b.startLine);
|
|
1222
|
+
const merged = [];
|
|
1223
|
+
for (const range of sorted) {
|
|
1224
|
+
const last = merged[merged.length - 1];
|
|
1225
|
+
if (last && range.startLine <= last.endLine + 1) {
|
|
1226
|
+
last.endLine = Math.max(last.endLine, range.endLine);
|
|
1227
|
+
} else {
|
|
1228
|
+
merged.push({ startLine: range.startLine, endLine: range.endLine });
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
return merged;
|
|
1232
|
+
}
|
|
1233
|
+
function isLineRangeCovered(request, covered) {
|
|
1234
|
+
if (!isValidRange(request)) return false;
|
|
1235
|
+
let open = request.startLine;
|
|
1236
|
+
for (const range of mergeLineRanges(covered)) {
|
|
1237
|
+
if (range.endLine < open) continue;
|
|
1238
|
+
if (range.startLine > open) return false;
|
|
1239
|
+
open = range.endLine + 1;
|
|
1240
|
+
if (open > request.endLine) return true;
|
|
1241
|
+
}
|
|
1242
|
+
return open > request.endLine;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1211
1245
|
// packages/agent-runtime/runtimeCompat.ts
|
|
1212
1246
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
1213
1247
|
import { join } from "node:path";
|
|
@@ -1557,7 +1591,7 @@ function buildReadWorkspaceDescription(variant) {
|
|
|
1557
1591
|
if (variant === "antiShell") {
|
|
1558
1592
|
return "Read a UTF-8 text file inside the workspace. Prefer readFile over shell commands (cat/head/tail).";
|
|
1559
1593
|
}
|
|
1560
|
-
return "Read a UTF-8 text file inside the workspace. Use lines for focused range reads after searchFiles to save tokens.";
|
|
1594
|
+
return "Read a UTF-8 text file inside the workspace. Use lines for focused range reads after searchFiles to save tokens. A range already delivered earlier for an unchanged file answers with a short notice instead of resending (force:true refetches).";
|
|
1561
1595
|
}
|
|
1562
1596
|
function buildReadWorkspaceParameters(variant) {
|
|
1563
1597
|
const path = buildWorkspacePathProperty();
|
|
@@ -1572,9 +1606,13 @@ function buildReadWorkspaceParameters(variant) {
|
|
|
1572
1606
|
required: ["path"]
|
|
1573
1607
|
};
|
|
1574
1608
|
}
|
|
1609
|
+
const force = {
|
|
1610
|
+
type: "boolean",
|
|
1611
|
+
description: "Refetch even when the requested range was already delivered earlier and the file is unchanged (e.g. after context compaction)."
|
|
1612
|
+
};
|
|
1575
1613
|
return {
|
|
1576
1614
|
type: "object",
|
|
1577
|
-
properties: { path, lines },
|
|
1615
|
+
properties: { path, lines, force },
|
|
1578
1616
|
required: ["path"]
|
|
1579
1617
|
};
|
|
1580
1618
|
}
|
|
@@ -3097,6 +3135,7 @@ ${tail}`,
|
|
|
3097
3135
|
truncatedByCharLimit: true
|
|
3098
3136
|
};
|
|
3099
3137
|
}
|
|
3138
|
+
var READ_FILE_LEDGER_MAX_RECORDS = 64;
|
|
3100
3139
|
async function readFileTool(args) {
|
|
3101
3140
|
const parsed = parseWorkspaceToolArguments(args.call.arguments);
|
|
3102
3141
|
const requestedPath = requireWorkspaceToolPath(parsed);
|
|
@@ -3117,26 +3156,61 @@ async function readFileTool(args) {
|
|
|
3117
3156
|
totalLines: sliced.totalLines
|
|
3118
3157
|
});
|
|
3119
3158
|
const isTruncated = sliced.truncated || truncatedRead.truncatedByCharLimit;
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3159
|
+
const relativePath = normalizeWorkspaceRelativePath({
|
|
3160
|
+
workspaceRoot: resolve(args.workspaceRoot),
|
|
3161
|
+
targetPath: absolutePath
|
|
3162
|
+
});
|
|
3163
|
+
const force = parsed.force === true;
|
|
3164
|
+
const ledger = args.readLedger;
|
|
3165
|
+
const requestRange = { startLine: sliced.startLine, endLine: sliced.endLine };
|
|
3166
|
+
const fingerprint = createHash("sha1").update(content).digest("hex").slice(0, 20);
|
|
3167
|
+
let entry = ledger?.get(relativePath);
|
|
3168
|
+
if (entry && entry.fingerprint !== fingerprint) {
|
|
3169
|
+
entry = void 0;
|
|
3170
|
+
ledger?.delete(relativePath);
|
|
3171
|
+
}
|
|
3172
|
+
if (!force && entry && ledger) {
|
|
3173
|
+
const retainedCap = resolveHistoricalToolContentCap("readFile", 0);
|
|
3174
|
+
const retained = filterRetainedLedgerRecords(entry.records, retainedCap);
|
|
3175
|
+
if (retained.length > 0 && isLineRangeCovered(requestRange, retained)) {
|
|
3176
|
+
return {
|
|
3177
|
+
content: `[readFile] ${relativePath} lines ${requestRange.startLine}-${requestRange.endLine} were already delivered earlier and the file is unchanged; not resending. Pass force:true to refetch.`,
|
|
3178
|
+
metadata: {
|
|
3179
|
+
path: relativePath,
|
|
3180
|
+
startLine: requestRange.startLine,
|
|
3181
|
+
endLine: requestRange.endLine,
|
|
3182
|
+
totalLines: sliced.totalLines,
|
|
3183
|
+
deduped: true,
|
|
3184
|
+
...warnings.length ? { warnings: [...warnings, buildReadFileSliceHint(sliced.totalLines)] } : {},
|
|
3185
|
+
...activity ? { activity } : {}
|
|
3186
|
+
}
|
|
3187
|
+
};
|
|
3138
3188
|
}
|
|
3189
|
+
}
|
|
3190
|
+
const metadata = {
|
|
3191
|
+
path: relativePath,
|
|
3192
|
+
bytes: Buffer.byteLength(truncatedRead.content),
|
|
3193
|
+
totalBytes: Buffer.byteLength(content),
|
|
3194
|
+
startLine: sliced.startLine,
|
|
3195
|
+
endLine: sliced.endLine,
|
|
3196
|
+
totalLines: sliced.totalLines,
|
|
3197
|
+
truncated: isTruncated,
|
|
3198
|
+
...truncatedRead.truncatedByCharLimit ? { truncatedByByteLimit: true, truncatedByCharLimit: true } : {},
|
|
3199
|
+
...sliceArgs.maxLines ? { maxLines: sliceArgs.maxLines } : {},
|
|
3200
|
+
...sliceArgs.tailLines ? { tailLines: sliceArgs.tailLines } : {},
|
|
3201
|
+
...warnings.length ? { warnings: [...warnings, buildReadFileSliceHint(sliced.totalLines)] } : {},
|
|
3202
|
+
...activity ? { activity } : {}
|
|
3139
3203
|
};
|
|
3204
|
+
if (!isTruncated && ledger) {
|
|
3205
|
+
const persistedChars = truncatedRead.content.length + "\n\n[tool metadata]\n".length + JSON.stringify(metadata).length;
|
|
3206
|
+
const records = entry?.records ?? [];
|
|
3207
|
+
records.push({ ...requestRange, chars: persistedChars });
|
|
3208
|
+
ledger.set(relativePath, {
|
|
3209
|
+
fingerprint,
|
|
3210
|
+
records: records.slice(-READ_FILE_LEDGER_MAX_RECORDS)
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
return { content: truncatedRead.content, metadata };
|
|
3140
3214
|
}
|
|
3141
3215
|
async function writeFileTool(args) {
|
|
3142
3216
|
const parsed = parseWorkspaceToolArguments(args.call.arguments);
|
|
@@ -3894,6 +3968,7 @@ async function listProcessesTool(args) {
|
|
|
3894
3968
|
}
|
|
3895
3969
|
function createLocalWorkspaceToolExecutors(args) {
|
|
3896
3970
|
const fileAccess = args.confirmExternalFileAccess ? { confirmExternalFileAccess: args.confirmExternalFileAccess } : {};
|
|
3971
|
+
const readFileLedger = /* @__PURE__ */ new Map();
|
|
3897
3972
|
const searchBinaryResolvers = {
|
|
3898
3973
|
...args.resolveRipgrepBinary ? { resolveRipgrepBinary: args.resolveRipgrepBinary } : {},
|
|
3899
3974
|
...args.resolveGrepBinary ? { resolveGrepBinary: args.resolveGrepBinary } : {}
|
|
@@ -3918,6 +3993,7 @@ function createLocalWorkspaceToolExecutors(args) {
|
|
|
3918
3993
|
readFile: (call) => readFileTool({
|
|
3919
3994
|
call,
|
|
3920
3995
|
workspaceRoot: args.workspaceRoot,
|
|
3996
|
+
readLedger: readFileLedger,
|
|
3921
3997
|
...fileAccess
|
|
3922
3998
|
}),
|
|
3923
3999
|
writeFile: (call) => writeFileTool({
|
|
@@ -4089,6 +4165,8 @@ export {
|
|
|
4089
4165
|
evaluateShellCommandPolicy,
|
|
4090
4166
|
resolveLocalToolPolicy,
|
|
4091
4167
|
executeLocalToolWithPolicy,
|
|
4168
|
+
filterRetainedLedgerRecords,
|
|
4169
|
+
isLineRangeCovered,
|
|
4092
4170
|
getProcessRegistry,
|
|
4093
4171
|
buildLocalWorkspaceToolset,
|
|
4094
4172
|
buildLocalWorkspacePolicyToolNames,
|