@absolutejs/ai 0.0.38 → 0.0.40
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/ai/index.js +7 -5
- package/dist/ai/index.js.map +4 -4
- package/dist/ai/ui/index.js +5 -4
- package/dist/ai/ui/index.js.map +3 -3
- package/dist/src/ai/ui/catalog.d.ts +9 -2
- package/dist/types/ai.d.ts +6 -2
- package/package.json +1 -1
package/dist/ai/index.js
CHANGED
|
@@ -2959,6 +2959,7 @@ var streamTurns = async function* (options, renderers, messages, signal, startTi
|
|
|
2959
2959
|
stopReason: undefined,
|
|
2960
2960
|
usage: undefined
|
|
2961
2961
|
};
|
|
2962
|
+
const responseBeforeTurn = turnState.fullResponse;
|
|
2962
2963
|
const stream = options.provider.stream({
|
|
2963
2964
|
cacheSystemPrompt: options.cacheSystemPrompt,
|
|
2964
2965
|
maxTokens: options.maxTokens,
|
|
@@ -2971,7 +2972,7 @@ var streamTurns = async function* (options, renderers, messages, signal, startTi
|
|
|
2971
2972
|
tools: toolDefs
|
|
2972
2973
|
});
|
|
2973
2974
|
yield* consumeStream2(stream, chunkState, renderers, options, turnState, signal);
|
|
2974
|
-
options.onTurn?.(turnState.turn, chunkState.usage);
|
|
2975
|
+
options.onTurn?.(turnState.turn, chunkState.usage, turnState.fullResponse.slice(responseBeforeTurn.length));
|
|
2975
2976
|
runningTotalTokens += (chunkState.usage?.inputTokens ?? 0) + (chunkState.usage?.outputTokens ?? 0);
|
|
2976
2977
|
if (chunkState.stopReason === "max_tokens") {
|
|
2977
2978
|
yield {
|
|
@@ -3686,7 +3687,8 @@ var FORM_FIELD_TYPES = [
|
|
|
3686
3687
|
"number",
|
|
3687
3688
|
"select",
|
|
3688
3689
|
"date",
|
|
3689
|
-
"checkbox"
|
|
3690
|
+
"checkbox",
|
|
3691
|
+
"password"
|
|
3690
3692
|
];
|
|
3691
3693
|
var CHART_MAX_SERIES = 8;
|
|
3692
3694
|
var CHART_MAX_POINTS = 24;
|
|
@@ -3870,7 +3872,7 @@ var parseFormField = (raw) => {
|
|
|
3870
3872
|
field.placeholder = placeholder;
|
|
3871
3873
|
if (raw.required === true)
|
|
3872
3874
|
field.required = true;
|
|
3873
|
-
const value = cleanString(raw.value, CELL_MAX_CHARS);
|
|
3875
|
+
const value = type === "password" ? null : cleanString(raw.value, CELL_MAX_CHARS);
|
|
3874
3876
|
if (value)
|
|
3875
3877
|
field.value = value;
|
|
3876
3878
|
const options = cleanStringArray(raw.options, FORM_SELECT_MAX_OPTIONS, LABEL_MAX_CHARS);
|
|
@@ -4012,7 +4014,7 @@ var statTilesCard = {
|
|
|
4012
4014
|
};
|
|
4013
4015
|
var formCard = {
|
|
4014
4016
|
ack: "(form rendered inline \u2014 the member fills and submits it, which runs the bound tool with their values. Do NOT re-ask for these values in text; wait for the submission)",
|
|
4015
|
-
description:
|
|
4017
|
+
description: `Render an inline form when you need SEVERAL structured inputs from the member before running a tool (task details, scheduling constraints, outreach parameters) \u2014 one form beats asking field-by-field in prose. Bind submit to one of YOUR tools with any values you already know pre-filled in submit.input; on submit the member's field values are merged into submit.input under each field's name and the tool runs exactly like a clicked action button. Field names must therefore be the tool's actual input property names. Never use it for values you could look up yourself. Use type "password" for sensitive values (API keys, secrets, credentials) \u2014 the host renders it masked and never pre-fill a value for it.`,
|
|
4016
4018
|
inputSchema: {
|
|
4017
4019
|
properties: {
|
|
4018
4020
|
description: {
|
|
@@ -5277,5 +5279,5 @@ export {
|
|
|
5277
5279
|
BUILTIN_UI_CARDS
|
|
5278
5280
|
};
|
|
5279
5281
|
|
|
5280
|
-
//# debugId=
|
|
5282
|
+
//# debugId=410FE178F543EAA864756E2164756E21
|
|
5281
5283
|
//# sourceMappingURL=index.js.map
|