llmist 1.6.0 → 1.6.2
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/dist/{chunk-X5XQ6M5P.js → chunk-T3DIKQWU.js} +35 -7
- package/dist/chunk-T3DIKQWU.js.map +1 -0
- package/dist/{chunk-QR5IQXEM.js → chunk-TDRPJP2Q.js} +2 -2
- package/dist/cli.cjs +36 -8
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +4 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +34 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/testing/index.cjs +34 -6
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-X5XQ6M5P.js.map +0 -1
- /package/dist/{chunk-QR5IQXEM.js.map → chunk-TDRPJP2Q.js.map} +0 -0
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
init_strategy,
|
|
31
31
|
init_stream_processor,
|
|
32
32
|
resolveHintTemplate
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-T3DIKQWU.js";
|
|
34
34
|
|
|
35
35
|
// src/index.ts
|
|
36
36
|
init_builder();
|
|
@@ -971,4 +971,4 @@ export {
|
|
|
971
971
|
Gadget,
|
|
972
972
|
z
|
|
973
973
|
};
|
|
974
|
-
//# sourceMappingURL=chunk-
|
|
974
|
+
//# sourceMappingURL=chunk-TDRPJP2Q.js.map
|
package/dist/cli.cjs
CHANGED
|
@@ -1074,7 +1074,7 @@ function applyLineLimit(lines, limit) {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
return lines;
|
|
1076
1076
|
}
|
|
1077
|
-
function createGadgetOutputViewer(store) {
|
|
1077
|
+
function createGadgetOutputViewer(store, maxOutputChars = DEFAULT_MAX_OUTPUT_CHARS) {
|
|
1078
1078
|
return createGadget({
|
|
1079
1079
|
name: "GadgetOutputViewer",
|
|
1080
1080
|
description: "View stored output from gadgets that returned too much data. Use patterns to filter lines (like grep) and limit to control output size. Patterns are applied first in order, then the limit is applied to the result.",
|
|
@@ -1139,19 +1139,43 @@ function createGadgetOutputViewer(store) {
|
|
|
1139
1139
|
if (limit) {
|
|
1140
1140
|
lines = applyLineLimit(lines, limit);
|
|
1141
1141
|
}
|
|
1142
|
+
let output = lines.join("\n");
|
|
1142
1143
|
const totalLines = stored.lineCount;
|
|
1143
1144
|
const returnedLines = lines.length;
|
|
1144
1145
|
if (returnedLines === 0) {
|
|
1145
1146
|
return `No lines matched the filters. Original output had ${totalLines} lines.`;
|
|
1146
1147
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1148
|
+
let truncatedBySize = false;
|
|
1149
|
+
let linesIncluded = returnedLines;
|
|
1150
|
+
if (output.length > maxOutputChars) {
|
|
1151
|
+
truncatedBySize = true;
|
|
1152
|
+
let truncatedOutput = "";
|
|
1153
|
+
linesIncluded = 0;
|
|
1154
|
+
for (const line of lines) {
|
|
1155
|
+
if (truncatedOutput.length + line.length + 1 > maxOutputChars) break;
|
|
1156
|
+
truncatedOutput += line + "\n";
|
|
1157
|
+
linesIncluded++;
|
|
1158
|
+
}
|
|
1159
|
+
output = truncatedOutput;
|
|
1160
|
+
}
|
|
1161
|
+
let header;
|
|
1162
|
+
if (truncatedBySize) {
|
|
1163
|
+
const remainingLines = returnedLines - linesIncluded;
|
|
1164
|
+
header = `[Showing ${linesIncluded} of ${totalLines} lines (truncated due to size limit)]
|
|
1165
|
+
[... ${remainingLines.toLocaleString()} more lines. Use limit parameter to paginate, e.g., limit: "${linesIncluded + 1}-${linesIncluded + 200}"]
|
|
1149
1166
|
`;
|
|
1150
|
-
|
|
1167
|
+
} else if (returnedLines < totalLines) {
|
|
1168
|
+
header = `[Showing ${returnedLines} of ${totalLines} lines]
|
|
1169
|
+
`;
|
|
1170
|
+
} else {
|
|
1171
|
+
header = `[Showing all ${totalLines} lines]
|
|
1172
|
+
`;
|
|
1173
|
+
}
|
|
1174
|
+
return header + output;
|
|
1151
1175
|
}
|
|
1152
1176
|
});
|
|
1153
1177
|
}
|
|
1154
|
-
var import_zod, patternSchema;
|
|
1178
|
+
var import_zod, patternSchema, DEFAULT_MAX_OUTPUT_CHARS;
|
|
1155
1179
|
var init_output_viewer = __esm({
|
|
1156
1180
|
"src/gadgets/output-viewer.ts"() {
|
|
1157
1181
|
"use strict";
|
|
@@ -1163,6 +1187,7 @@ var init_output_viewer = __esm({
|
|
|
1163
1187
|
before: import_zod.z.number().int().min(0).default(0).describe("Context lines before each match (like grep -B)"),
|
|
1164
1188
|
after: import_zod.z.number().int().min(0).default(0).describe("Context lines after each match (like grep -A)")
|
|
1165
1189
|
});
|
|
1190
|
+
DEFAULT_MAX_OUTPUT_CHARS = 76800;
|
|
1166
1191
|
}
|
|
1167
1192
|
});
|
|
1168
1193
|
|
|
@@ -3338,7 +3363,10 @@ var init_agent = __esm({
|
|
|
3338
3363
|
const contextWindow = limits?.contextWindow ?? FALLBACK_CONTEXT_WINDOW;
|
|
3339
3364
|
this.outputLimitCharLimit = Math.floor(contextWindow * (limitPercent / 100) * CHARS_PER_TOKEN);
|
|
3340
3365
|
if (this.outputLimitEnabled) {
|
|
3341
|
-
this.registry.register(
|
|
3366
|
+
this.registry.register(
|
|
3367
|
+
"GadgetOutputViewer",
|
|
3368
|
+
createGadgetOutputViewer(this.outputStore, this.outputLimitCharLimit)
|
|
3369
|
+
);
|
|
3342
3370
|
}
|
|
3343
3371
|
this.hooks = this.mergeOutputLimiterHook(options.hooks);
|
|
3344
3372
|
const baseBuilder = new LLMMessageBuilder(options.promptConfig);
|
|
@@ -6587,7 +6615,7 @@ var import_commander2 = require("commander");
|
|
|
6587
6615
|
// package.json
|
|
6588
6616
|
var package_default = {
|
|
6589
6617
|
name: "llmist",
|
|
6590
|
-
version: "1.
|
|
6618
|
+
version: "1.6.1",
|
|
6591
6619
|
description: "Universal TypeScript LLM client with streaming-first agent framework. Works with any model - no structured outputs or native tool calling required. Implements its own flexible grammar for function calling.",
|
|
6592
6620
|
type: "module",
|
|
6593
6621
|
main: "dist/index.cjs",
|
|
@@ -9721,7 +9749,7 @@ async function executeAgent(promptArg, options, env) {
|
|
|
9721
9749
|
try {
|
|
9722
9750
|
await executeInDocker(ctx, devMode);
|
|
9723
9751
|
} catch (error) {
|
|
9724
|
-
if (error instanceof
|
|
9752
|
+
if (error instanceof DockerSkipError) {
|
|
9725
9753
|
} else {
|
|
9726
9754
|
throw error;
|
|
9727
9755
|
}
|