@lazyingart/agintiflow 0.20.135 → 0.20.136
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/package.json +1 -1
- package/scripts/smoke-coding-tools.js +10 -0
- package/src/model-client.js +3 -0
- package/src/workspace-tools.js +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.136",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -671,6 +671,16 @@ try {
|
|
|
671
671
|
assert(sanitizedSmallRead.content === longSmallFile, "small read_file result did not keep full content for the model");
|
|
672
672
|
assert(sanitizedSmallRead.contentTruncated === false, "small read_file result should not be marked truncated");
|
|
673
673
|
assert(!("contentPreview" in sanitizedSmallRead), "small read_file result should not replace full content with preview");
|
|
674
|
+
const limitedReadResult = await executeWorkspaceTool(
|
|
675
|
+
"read_file",
|
|
676
|
+
{ path: "small-read-smoke.md", startLine: 2, lineLimit: 3 },
|
|
677
|
+
{
|
|
678
|
+
commandCwd: workspace,
|
|
679
|
+
allowFileTools: true,
|
|
680
|
+
}
|
|
681
|
+
);
|
|
682
|
+
assert(limitedReadResult.content === "line 001\nline 002\nline 003", "read_file lineLimit did not return the requested line slice");
|
|
683
|
+
assert(limitedReadResult.contentTruncatedByLines === true, "read_file lineLimit should report remaining lines");
|
|
674
684
|
const inspected = await executeWorkspaceTool(
|
|
675
685
|
"inspect_project",
|
|
676
686
|
{ path: ".", maxDepth: 4, limit: 200 },
|
package/src/model-client.js
CHANGED
|
@@ -1153,6 +1153,9 @@ export async function requestNextStep(client, config, messages) {
|
|
|
1153
1153
|
type: "object",
|
|
1154
1154
|
properties: {
|
|
1155
1155
|
path: { type: "string", description: "Workspace-relative file path." },
|
|
1156
|
+
startLine: { type: "integer", description: "Optional 1-based first line to read." },
|
|
1157
|
+
lineLimit: { type: "integer", description: "Optional maximum number of lines to read; use this for large source files." },
|
|
1158
|
+
limit: { type: "integer", description: "Alias for lineLimit for compatibility with older prompts." },
|
|
1156
1159
|
},
|
|
1157
1160
|
required: ["path"],
|
|
1158
1161
|
additionalProperties: false,
|
package/src/workspace-tools.js
CHANGED
|
@@ -407,13 +407,23 @@ async function readTextFile(target) {
|
|
|
407
407
|
async function readFile(config, args) {
|
|
408
408
|
const target = resolveWorkspacePath(config, args.path);
|
|
409
409
|
const { stat, content, hash } = await readTextFile(target);
|
|
410
|
+
const lines = content.split(/\r?\n/);
|
|
411
|
+
const startLine = Math.min(Math.max(Number(args.startLine) || 1, 1), Math.max(lines.length, 1));
|
|
412
|
+
const requestedLineLimit = Number(args.lineLimit || args.limit || 0);
|
|
413
|
+
const lineLimit = Number.isFinite(requestedLineLimit) && requestedLineLimit > 0 ? Math.min(requestedLineLimit, 1000) : 0;
|
|
414
|
+
const selectedLines = lineLimit > 0 ? lines.slice(startLine - 1, startLine - 1 + lineLimit) : lines;
|
|
415
|
+
const selectedContent = selectedLines.join("\n");
|
|
410
416
|
return {
|
|
411
417
|
ok: true,
|
|
412
418
|
toolName: "read_file",
|
|
413
419
|
path: target.relativePath,
|
|
414
420
|
bytes: stat.size,
|
|
415
421
|
sha256: hash,
|
|
416
|
-
content: redactSensitiveText(
|
|
422
|
+
content: redactSensitiveText(selectedContent),
|
|
423
|
+
startLine,
|
|
424
|
+
lineLimit: lineLimit || null,
|
|
425
|
+
lineCount: lines.length,
|
|
426
|
+
contentTruncatedByLines: lineLimit > 0 && startLine - 1 + lineLimit < lines.length,
|
|
417
427
|
};
|
|
418
428
|
}
|
|
419
429
|
|