llmz 0.0.13 → 0.0.15
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/CLAUDE.md +363 -0
- package/README.md +61 -34
- package/dist/abort-signal.d.ts +40 -0
- package/dist/chat.d.ts +325 -0
- package/dist/{chunk-KH6JQYQA.js → chunk-2D2DE7CD.js} +2 -2
- package/dist/chunk-3G3BS5IA.cjs +256 -0
- package/dist/{chunk-SNDVQU5A.js → chunk-3JYCCI4S.js} +1 -1
- package/dist/chunk-A7QHWVD7.js +493 -0
- package/dist/{chunk-IH2WQFO5.js → chunk-EE6NVDID.js} +1 -1
- package/dist/{chunk-4L6D2A6O.cjs → chunk-FZJHYLM2.cjs} +14 -14
- package/dist/{chunk-JGVAZO4X.cjs → chunk-GZPN7RGH.cjs} +2 -2
- package/dist/{chunk-SHJDRZF5.cjs → chunk-PIDLNYIP.cjs} +25 -25
- package/dist/{chunk-PRVFVXT4.js → chunk-RBRTK37G.js} +383 -4
- package/dist/{chunk-HJKOSEH2.cjs → chunk-TCRRSS44.cjs} +397 -18
- package/dist/chunk-VPTFUOIK.js +256 -0
- package/dist/{chunk-276Q6EWP.cjs → chunk-WHNOR4ZU.cjs} +3 -0
- package/dist/chunk-XGJOEQMW.cjs +493 -0
- package/dist/{chunk-4MNIJGK6.js → chunk-ZORRILUV.js} +3 -0
- package/dist/context.d.ts +412 -4
- package/dist/{dual-modes-T53P72CH.js → dual-modes-7FI4T35O.js} +3 -3
- package/dist/{dual-modes-VLIGPIHX.cjs → dual-modes-OFHV2C3X.cjs} +4 -4
- package/dist/exit-XAYKJ6TR.cjs +8 -0
- package/dist/{exit-YORW76T3.js → exit-YLO7BY7Z.js} +2 -2
- package/dist/exit.d.ts +369 -2
- package/dist/index.cjs +253 -28
- package/dist/index.d.ts +71 -1
- package/dist/index.js +242 -17
- package/dist/{llmz-ROOX7RYI.js → llmz-67EZPJ4E.js} +113 -39
- package/dist/{llmz-QLZBDG2Z.cjs → llmz-WVNKAMCP.cjs} +123 -49
- package/dist/llmz.d.ts +142 -5
- package/dist/objects.d.ts +350 -1
- package/dist/result.d.ts +809 -6
- package/dist/snapshots.d.ts +181 -1
- package/dist/{tool-QP4MVRWI.cjs → tool-O4SFRIE4.cjs} +4 -4
- package/dist/{tool-N6ODRRGH.js → tool-PCOYOCRH.js} +3 -3
- package/dist/tool.d.ts +470 -2
- package/dist/{truncator-IY2MXOMC.js → truncator-BSP6PQPC.js} +2 -2
- package/dist/truncator-W3NXBLYJ.cjs +10 -0
- package/dist/types.d.ts +3 -0
- package/dist/{typings-GDMY6VY2.js → typings-WYHEFCYB.js} +2 -2
- package/dist/{typings-2CPHOFDN.cjs → typings-Y45GMPZT.cjs} +3 -3
- package/dist/utils-L5QAQXV2.cjs +39 -0
- package/dist/{utils-N24IHDFA.js → utils-RQHQ2KOG.js} +1 -1
- package/docs/TODO.md +919 -0
- package/package.json +3 -3
- package/dist/chunk-C6WNNTEV.cjs +0 -212
- package/dist/chunk-GWFYZDUR.cjs +0 -105
- package/dist/chunk-JAGB2AOU.js +0 -212
- package/dist/chunk-JMSZKB4T.js +0 -105
- package/dist/exit-TRXEU4OU.cjs +0 -8
- package/dist/truncator-DUMWEGQO.cjs +0 -10
- package/dist/utils-A7WNEFTA.cjs +0 -39
|
@@ -6,11 +6,11 @@ var _chunkIKSIOIIPcjs = require('./chunk-IKSIOIIP.cjs');
|
|
|
6
6
|
var _chunkZRCU35UVcjs = require('./chunk-ZRCU35UV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkGZPN7RGHcjs = require('./chunk-GZPN7RGH.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkWHNOR4ZUcjs = require('./chunk-WHNOR4ZU.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -53,7 +53,7 @@ function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
|
|
|
53
53
|
}
|
|
54
54
|
if (typeof currentObj !== "object" || currentObj === null) {
|
|
55
55
|
const value = JSON.stringify(currentObj);
|
|
56
|
-
currentLength +=
|
|
56
|
+
currentLength += _chunkWHNOR4ZUcjs.getTokenizer.call(void 0, ).count(value);
|
|
57
57
|
return value;
|
|
58
58
|
}
|
|
59
59
|
const indentation = " ".repeat(currentIndent);
|
|
@@ -66,7 +66,7 @@ function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
|
|
|
66
66
|
result += indentation + " ".repeat(indent) + recurse(currentObj[i], depth + 1, currentIndent + indent);
|
|
67
67
|
}
|
|
68
68
|
result += "\n" + indentation + "]";
|
|
69
|
-
currentLength +=
|
|
69
|
+
currentLength += _chunkWHNOR4ZUcjs.getTokenizer.call(void 0, ).count(result);
|
|
70
70
|
return result;
|
|
71
71
|
} else {
|
|
72
72
|
let result = "{\n";
|
|
@@ -85,11 +85,11 @@ function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
|
|
|
85
85
|
result += ",\n" + indentation + `... (${numKeys - maxKeys} more keys)`;
|
|
86
86
|
}
|
|
87
87
|
result += "\n" + indentation + "}";
|
|
88
|
-
currentLength +=
|
|
88
|
+
currentLength += _chunkWHNOR4ZUcjs.getTokenizer.call(void 0, ).count(result);
|
|
89
89
|
return result;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
const output =
|
|
92
|
+
const output = _chunkWHNOR4ZUcjs.getTokenizer.call(void 0, ).truncate(recurse(obj, 0, 0), maxLength);
|
|
93
93
|
return { output, truncated: wasTruncated };
|
|
94
94
|
}
|
|
95
95
|
function extractType(value, generic = true) {
|
|
@@ -154,9 +154,9 @@ function previewValue(value, length = LONG_TEXT_LENGTH) {
|
|
|
154
154
|
}
|
|
155
155
|
const previewStr = (str) => {
|
|
156
156
|
if (str.length > length) {
|
|
157
|
-
return
|
|
157
|
+
return _chunkWHNOR4ZUcjs.escapeString.call(void 0, str.slice(0, length)) + " ... <truncated>";
|
|
158
158
|
}
|
|
159
|
-
return
|
|
159
|
+
return _chunkWHNOR4ZUcjs.escapeString.call(void 0, str);
|
|
160
160
|
};
|
|
161
161
|
const previewObj = (obj) => {
|
|
162
162
|
const mapped = _chunkUQOBUJIQcjs.mapKeys_default.call(void 0, obj, (_value, key) => previewStr(key));
|
|
@@ -336,7 +336,7 @@ var inspect = (value, name, options = DEFAULT_OPTIONS) => {
|
|
|
336
336
|
} else if (genericType === "boolean") {
|
|
337
337
|
return header + previewValue(value);
|
|
338
338
|
} else if (typeof value === "string") {
|
|
339
|
-
if (
|
|
339
|
+
if (_chunkWHNOR4ZUcjs.getTokenizer.call(void 0, ).count(value) < options.tokens) {
|
|
340
340
|
return header + previewValue(value);
|
|
341
341
|
} else {
|
|
342
342
|
return header + previewLongText(value);
|
|
@@ -491,15 +491,15 @@ ${variables_example}
|
|
|
491
491
|
role: "system",
|
|
492
492
|
content: replacePlaceholders(canTalk ? system_md_default : system_md_default2, {
|
|
493
493
|
is_message_enabled: canTalk,
|
|
494
|
-
"tools.d.ts":
|
|
494
|
+
"tools.d.ts": _chunkGZPN7RGHcjs.wrapContent.call(void 0, dts, {
|
|
495
495
|
preserve: "both",
|
|
496
496
|
minTokens: 500
|
|
497
497
|
}),
|
|
498
|
-
identity:
|
|
498
|
+
identity: _chunkGZPN7RGHcjs.wrapContent.call(void 0, ((_a = props.instructions) == null ? void 0 : _a.length) ? props.instructions : "No specific instructions provided", {
|
|
499
499
|
preserve: "both",
|
|
500
500
|
minTokens: 1e3
|
|
501
501
|
}),
|
|
502
|
-
transcript:
|
|
502
|
+
transcript: _chunkGZPN7RGHcjs.wrapContent.call(void 0, props.transcript.toString(), {
|
|
503
503
|
preserve: "bottom",
|
|
504
504
|
minTokens: 500
|
|
505
505
|
}),
|
|
@@ -508,7 +508,7 @@ ${variables_example}
|
|
|
508
508
|
writeable_vars: writeable_vars.join(", "),
|
|
509
509
|
variables_example,
|
|
510
510
|
exits,
|
|
511
|
-
components:
|
|
511
|
+
components: _chunkGZPN7RGHcjs.wrapContent.call(void 0,
|
|
512
512
|
props.components.map((component) => _chunkZRCU35UVcjs.getComponentReference.call(void 0, component.definition)).join("\n\n"),
|
|
513
513
|
{
|
|
514
514
|
preserve: "top",
|
|
@@ -586,13 +586,13 @@ Code:
|
|
|
586
586
|
|
|
587
587
|
\`\`\`tsx
|
|
588
588
|
\u25A0fn_start
|
|
589
|
-
${
|
|
589
|
+
${_chunkGZPN7RGHcjs.wrapContent.call(void 0, props.code)}
|
|
590
590
|
\u25A0fn_end
|
|
591
591
|
\`\`\`
|
|
592
592
|
|
|
593
593
|
Error:
|
|
594
594
|
\`\`\`
|
|
595
|
-
${
|
|
595
|
+
${_chunkGZPN7RGHcjs.wrapContent.call(void 0, props.message, { flex: 4 })}
|
|
596
596
|
\`\`\`
|
|
597
597
|
|
|
598
598
|
Please fix the error and try again.
|
|
@@ -615,11 +615,11 @@ var getCodeExecutionErrorMessage = async (props) => {
|
|
|
615
615
|
|
|
616
616
|
An error occurred while executing the code.
|
|
617
617
|
|
|
618
|
-
${
|
|
618
|
+
${_chunkGZPN7RGHcjs.wrapContent.call(void 0, props.message, { preserve: "top", flex: 4 })}
|
|
619
619
|
|
|
620
620
|
Stack Trace:
|
|
621
621
|
\`\`\`
|
|
622
|
-
${
|
|
622
|
+
${_chunkGZPN7RGHcjs.wrapContent.call(void 0, _chunkIKSIOIIPcjs.cleanStackTrace.call(void 0, props.stacktrace), { flex: 6, preserve: "top" })}
|
|
623
623
|
\`\`\`
|
|
624
624
|
|
|
625
625
|
Let the user know that an error occurred, and if possible, try something else. Do not repeat yourself in the message.
|
|
@@ -642,7 +642,7 @@ var getThinkingMessage = async (props) => {
|
|
|
642
642
|
if (inspected) {
|
|
643
643
|
acc.push(inspected);
|
|
644
644
|
} else {
|
|
645
|
-
acc.push(`Value of ${key} is ${
|
|
645
|
+
acc.push(`Value of ${key} is ${_chunkGZPN7RGHcjs.wrapContent.call(void 0, JSON.stringify(value, null, 2))}`);
|
|
646
646
|
}
|
|
647
647
|
return acc;
|
|
648
648
|
}, []);
|
|
@@ -653,7 +653,7 @@ var getThinkingMessage = async (props) => {
|
|
|
653
653
|
if (inspected) {
|
|
654
654
|
return inspected;
|
|
655
655
|
} else {
|
|
656
|
-
return `Value at index ${index} is ${
|
|
656
|
+
return `Value at index ${index} is ${_chunkGZPN7RGHcjs.wrapContent.call(void 0, JSON.stringify(value, null, 2))}`;
|
|
657
657
|
}
|
|
658
658
|
});
|
|
659
659
|
context = mapped.join("\n\n");
|
|
@@ -671,7 +671,7 @@ The assistant requested to think. Here's the context:
|
|
|
671
671
|
-------------------
|
|
672
672
|
Reason: ${props.reason || "Thinking requested"}
|
|
673
673
|
Context:
|
|
674
|
-
${
|
|
674
|
+
${_chunkGZPN7RGHcjs.wrapContent.call(void 0, context, { preserve: "top" })}
|
|
675
675
|
-------------------
|
|
676
676
|
|
|
677
677
|
Please continue with the conversation (\u25A0fn_start).
|
|
@@ -690,19 +690,19 @@ var getSnapshotResolvedMessage = (props) => {
|
|
|
690
690
|
injectedVariables[variable.name] = variable.value;
|
|
691
691
|
variablesMessage += `
|
|
692
692
|
// Variable "${variable.name}" restored with its full value:
|
|
693
|
-
// ${
|
|
693
|
+
// ${_chunkGZPN7RGHcjs.wrapContent.call(void 0, _nullishCoalesce(((_a = inspect(variable.value)) == null ? void 0 : _a.split("\n").join("\n// ")), () => ( "")))}
|
|
694
694
|
declare const ${variable.name}: ${variable.type}
|
|
695
695
|
`;
|
|
696
696
|
} else {
|
|
697
697
|
variablesMessage += `
|
|
698
698
|
// The variable "${variable.name}" was too large to be restored with its full value, here's a preview of its last known value:
|
|
699
|
-
// ${
|
|
699
|
+
// ${_chunkGZPN7RGHcjs.wrapContent.call(void 0, variable.preview.split("\n").join("\n// "))}
|
|
700
700
|
// Important: To restore the full value, please re-run the code that generated this variable in the first place.
|
|
701
701
|
let ${variable.name}: undefined | ${variable.type} = undefined;
|
|
702
702
|
`;
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
const output =
|
|
705
|
+
const output = _chunkGZPN7RGHcjs.wrapContent.call(void 0, _nullishCoalesce(((_b = inspect(props.snapshot.status.value)) == null ? void 0 : _b.split("\n").join("\n * ")), () => ( "")), {
|
|
706
706
|
preserve: "top",
|
|
707
707
|
flex: 4
|
|
708
708
|
});
|
|
@@ -724,7 +724,7 @@ ${_chunkIKSIOIIPcjs.cleanStackTrace.call(void 0, props.snapshot.stack).split("\n
|
|
|
724
724
|
Continue the conversation from here, without repeating the above code, as it has already been executed. Here's the variables you can rely on:
|
|
725
725
|
|
|
726
726
|
\`\`\`tsx
|
|
727
|
-
${
|
|
727
|
+
${_chunkGZPN7RGHcjs.wrapContent.call(void 0, variablesMessage)}
|
|
728
728
|
\`\`\`
|
|
729
729
|
|
|
730
730
|
You can now assume that the code you about to generate can rely on the variables "${Object.keys(injectedVariables).join('", "')}" being available.
|
|
@@ -747,7 +747,7 @@ var getSnapshotRejectedMessage = (props) => {
|
|
|
747
747
|
throw new Error("Snapshot is not resolved");
|
|
748
748
|
}
|
|
749
749
|
const errorMessage = _nullishCoalesce(inspect(props.snapshot.status.error), () => ( "Unknown Error"));
|
|
750
|
-
const output =
|
|
750
|
+
const output = _chunkGZPN7RGHcjs.wrapContent.call(void 0, _nullishCoalesce(errorMessage.split("\n").join("\n * "), () => ( "Unknown Error")), {
|
|
751
751
|
preserve: "both",
|
|
752
752
|
minTokens: 100
|
|
753
753
|
});
|