@g9tm/aiassistant 1.7.0 → 1.8.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/dist/assistant.js +6 -0
- package/dist/flows.js +2 -2
- package/dist/pages.d.ts +7 -1
- package/dist/pages.js +2 -1
- package/package.json +2 -2
package/dist/assistant.js
CHANGED
|
@@ -226,6 +226,12 @@ export class Assistant {
|
|
|
226
226
|
r = { ok: false, error: "device_error" };
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
+
// A tool that drew something for the person (a how-to card, the places a code is used) shows it in the conversation
|
|
230
|
+
// now, as a flow's answer does; the model's own words follow when the run ends.
|
|
231
|
+
if (r.ok && Array.isArray(r.blocks) && r.blocks.length > 0) {
|
|
232
|
+
this.store.local("assistant", r.say ?? "", new Date(timer(this.host).now()).toISOString(), r.blocks, "device");
|
|
233
|
+
this.emit();
|
|
234
|
+
}
|
|
229
235
|
const body = { callId, ok: r.ok };
|
|
230
236
|
if (r.output !== undefined)
|
|
231
237
|
body.output = r.output;
|
package/dist/flows.js
CHANGED
|
@@ -140,7 +140,7 @@ function walk(p, pi, q, qi, slots) {
|
|
|
140
140
|
slots[name] = q.raw[qi] ?? "";
|
|
141
141
|
if (walk(p, pi + 1, q, qi + 1, slots))
|
|
142
142
|
return true;
|
|
143
|
-
|
|
143
|
+
Reflect.deleteProperty(slots, name);
|
|
144
144
|
return false;
|
|
145
145
|
}
|
|
146
146
|
if (t.length > 2 && t.charAt(0) === "{" && t.charAt(t.length - 1) === "}") {
|
|
@@ -150,7 +150,7 @@ function walk(p, pi, q, qi, slots) {
|
|
|
150
150
|
if (walk(p, pi + 1, q, end, slots))
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
Reflect.deleteProperty(slots, name);
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
return qi < q.tokens.length && q.tokens[qi] === t && walk(p, pi + 1, q, qi + 1, slots);
|
package/dist/pages.d.ts
CHANGED
|
@@ -24,11 +24,17 @@ export declare const pageCalls: {
|
|
|
24
24
|
/**
|
|
25
25
|
* Starts a run of a non-conversation capability (`POST capabilities/{id}/runs`, for a host's own screens without a
|
|
26
26
|
* chat) and follows it on the assistant: `snapshot().run` shows its stages, then its `result` (output, provenance).
|
|
27
|
-
* Returns the run's id; a refusal throws its `ApiError` (`assistant-limit` with the limit reached).
|
|
27
|
+
* Returns the run's id; a refusal throws its `ApiError` (`assistant-limit` with the limit reached). `items` runs a
|
|
28
|
+
* one-shot over several inputs side by side (`concurrency`, `stopOnFailure`); `maxTokens` is the run's own cap.
|
|
28
29
|
*/
|
|
29
30
|
export declare function runCapability(assistant: Assistant, id: string, options?: {
|
|
30
31
|
input?: Record<string, unknown>;
|
|
31
32
|
key?: string;
|
|
33
|
+
files?: string[];
|
|
34
|
+
items?: Record<string, unknown>[];
|
|
35
|
+
concurrency?: number;
|
|
36
|
+
stopOnFailure?: boolean;
|
|
37
|
+
maxTokens?: number;
|
|
32
38
|
}): Promise<string>;
|
|
33
39
|
/** The pages' texts over the assistant's: the host's texts and the core's win, then the pages' own. */
|
|
34
40
|
export declare function pageTexts(texts: Texts): Texts;
|
package/dist/pages.js
CHANGED
|
@@ -23,7 +23,8 @@ export const pageCalls = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Starts a run of a non-conversation capability (`POST capabilities/{id}/runs`, for a host's own screens without a
|
|
25
25
|
* chat) and follows it on the assistant: `snapshot().run` shows its stages, then its `result` (output, provenance).
|
|
26
|
-
* Returns the run's id; a refusal throws its `ApiError` (`assistant-limit` with the limit reached).
|
|
26
|
+
* Returns the run's id; a refusal throws its `ApiError` (`assistant-limit` with the limit reached). `items` runs a
|
|
27
|
+
* one-shot over several inputs side by side (`concurrency`, `stopOnFailure`); `maxTokens` is the run's own cap.
|
|
27
28
|
*/
|
|
28
29
|
export async function runCapability(assistant, id, options = {}) {
|
|
29
30
|
const r = await assistant.api.post("capabilities/" + enc(id) + "/runs", options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/aiassistant",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Headless client of the G9 AI assistant: API client, run state, transports, block view models, safe text and Persian helpers. No DOM, no framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@g9tm/aiassistant-contracts": "1.
|
|
36
|
+
"@g9tm/aiassistant-contracts": "1.8.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc -p tsconfig.json",
|