@burdenoff/fe-libs 2026.1027.9 → 2026.1027.11
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/shared/agent-tools/adapters/assistant.d.ts +15 -2
- package/dist/shared/agent-tools/adapters/assistant.js +18 -15
- package/dist/shared/agent-tools/shell/shellTools.js +2 -0
- package/dist/shared/agent-tools/types.d.ts +7 -0
- package/dist/shared/assistant/api.js +154 -125
- package/dist/shared/assistant/capabilities.d.ts +1 -0
- package/dist/shared/assistant/capabilities.js +1 -0
- package/dist/shared/assistant/operations.d.ts +1 -0
- package/dist/shared/assistant/operations.js +2 -2
- package/dist/shared/assistant/ui/AssistantChatArea.js +1 -1
- package/dist/shared/assistant/voice/assistantPollSchedule.d.ts +5 -9
- package/dist/shared-agent-tools.js +10 -10
- package/dist/shared-assistant.js +308 -308
- package/package.json +1 -1
|
@@ -38,7 +38,20 @@ export interface ClientToolOffer {
|
|
|
38
38
|
tools: readonly AnyDefinedAgentTool[];
|
|
39
39
|
manifest: ClientToolManifestEntry[];
|
|
40
40
|
}
|
|
41
|
-
export declare function offerClientTools(
|
|
41
|
+
export declare function offerClientTools(options: {
|
|
42
|
+
writeCapable: boolean;
|
|
43
|
+
}, tools?: readonly AnyDefinedAgentTool[]): ClientToolOffer;
|
|
44
|
+
/**
|
|
45
|
+
* Whether a mode that must not change data may still offer `tool`: it reads
|
|
46
|
+
* (`readOnly`) or only moves the person around the app (`navigation`).
|
|
47
|
+
*
|
|
48
|
+
* ★ BOFF-9908: Ask is promised read-only, so it is offered nothing else — not
|
|
49
|
+
* the confirmation-gated actions, not the canvas edits, and not the generic
|
|
50
|
+
* `ui_click` / `ui_fill` / `ui_select` / `ui_press_key`, which can press any
|
|
51
|
+
* ordinary button. The runner executes only offered tools, so leaving a tool
|
|
52
|
+
* out of the offer is what keeps the mode read-only.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isReadOnlyModeTool(tool: AnyDefinedAgentTool): boolean;
|
|
42
55
|
/**
|
|
43
56
|
* The tools registered right now, as the prompt's `clientTools`. Product tools
|
|
44
57
|
* come first, then the shared ones (`app_`, `ui_`), so if the cap is reached
|
|
@@ -60,7 +73,7 @@ export declare const CLIENT_TOOL_ORPHAN_MS = 20000;
|
|
|
60
73
|
/** The well-formed entries of an untrusted `clientToolRequests` value. */
|
|
61
74
|
export declare function parseClientToolRequests(raw: unknown): ClientToolRequest[];
|
|
62
75
|
export interface ClientToolRunnerOptions {
|
|
63
|
-
/** The definitions this turn advertised (`offerClientTools().tools`). */
|
|
76
|
+
/** The definitions this turn advertised (`offerClientTools(...).tools`). */
|
|
64
77
|
tools: readonly AnyDefinedAgentTool[];
|
|
65
78
|
/** Post one result to the sandbox. Rejects when the post did not land. */
|
|
66
79
|
post: (callId: string, result: AgentToolResult) => Promise<void>;
|
|
@@ -18,14 +18,17 @@ function c(e) {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function l(e = r()) {
|
|
22
|
-
let
|
|
21
|
+
function l(e, t = r()) {
|
|
22
|
+
let n = e.writeCapable ? t : t.filter(u), i = d(n), a = new Set(i.map((e) => e.name));
|
|
23
23
|
return {
|
|
24
|
-
tools:
|
|
25
|
-
manifest:
|
|
24
|
+
tools: n.filter((e) => a.has(e.name)),
|
|
25
|
+
manifest: i
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
function u(e
|
|
28
|
+
function u(e) {
|
|
29
|
+
return e.annotations?.readOnly === !0 || e.annotations?.navigation === !0;
|
|
30
|
+
}
|
|
31
|
+
function d(e = r()) {
|
|
29
32
|
let n = (e) => e.startsWith("app_") || e.startsWith("ui_"), i = [...e.filter((e) => !n(e.name)), ...e.filter((e) => n(e.name))], a = [], o = 2;
|
|
30
33
|
for (let e of i) {
|
|
31
34
|
let n = c(e), r = s.encode(JSON.stringify(n)).length + 1;
|
|
@@ -37,14 +40,14 @@ function u(e = r()) {
|
|
|
37
40
|
}
|
|
38
41
|
return a;
|
|
39
42
|
}
|
|
40
|
-
var
|
|
41
|
-
function
|
|
43
|
+
var f = /^ct_[0-9a-f]{32}$/, p = 4, m = 2e4;
|
|
44
|
+
function h(e) {
|
|
42
45
|
if (!Array.isArray(e)) return [];
|
|
43
46
|
let t = [];
|
|
44
|
-
for (let n of e.slice(0,
|
|
47
|
+
for (let n of e.slice(0, p)) {
|
|
45
48
|
if (typeof n != "object" || !n || Array.isArray(n)) continue;
|
|
46
49
|
let { callId: e, tool: r, input: i } = n;
|
|
47
|
-
typeof e != "string" || !
|
|
50
|
+
typeof e != "string" || !f.test(e) || typeof r != "string" || r.length === 0 || r.length > 64 || typeof i != "object" || !i || Array.isArray(i) || t.push({
|
|
48
51
|
callId: e,
|
|
49
52
|
tool: r,
|
|
50
53
|
input: i
|
|
@@ -52,7 +55,7 @@ function m(e) {
|
|
|
52
55
|
}
|
|
53
56
|
return t;
|
|
54
57
|
}
|
|
55
|
-
function
|
|
58
|
+
function g(r) {
|
|
56
59
|
let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = !1, c = r.now ?? Date.now, l = r.orphanMs ?? 2e4, u = c(), d, f = () => {
|
|
57
60
|
d !== void 0 && clearInterval(d), d = void 0;
|
|
58
61
|
}, p = () => {
|
|
@@ -63,7 +66,7 @@ function h(r) {
|
|
|
63
66
|
f();
|
|
64
67
|
}
|
|
65
68
|
}, Math.max(1e3, Math.floor(l / 4))));
|
|
66
|
-
},
|
|
69
|
+
}, m = () => {
|
|
67
70
|
if (!r.onActivity) return;
|
|
68
71
|
let e = [...a.keys()].map((e) => g.get(e)).filter((e) => typeof e == "string");
|
|
69
72
|
r.onActivity(e.length > 0 ? e.join(", ") : null);
|
|
@@ -81,20 +84,20 @@ function h(r) {
|
|
|
81
84
|
return;
|
|
82
85
|
}
|
|
83
86
|
let l = new AbortController();
|
|
84
|
-
a.set(t.callId, l), g.set(t.callId, c.title),
|
|
87
|
+
a.set(t.callId, l), g.set(t.callId, c.title), m(), p(), i(c, t.input, {
|
|
85
88
|
initiator: "assistant",
|
|
86
89
|
signal: l.signal
|
|
87
90
|
}).then((e) => {
|
|
88
91
|
if (!l.signal.aborted) return _(t.callId, e);
|
|
89
92
|
}).finally(() => {
|
|
90
|
-
a.delete(t.callId), g.delete(t.callId),
|
|
93
|
+
a.delete(t.callId), g.delete(t.callId), m();
|
|
91
94
|
});
|
|
92
95
|
};
|
|
93
96
|
return {
|
|
94
97
|
receive(e) {
|
|
95
98
|
if (s) return;
|
|
96
99
|
u = c();
|
|
97
|
-
let t =
|
|
100
|
+
let t = h(e), n = new Set(t.map((e) => e.callId));
|
|
98
101
|
for (let [e, t] of a) n.has(e) || t.abort();
|
|
99
102
|
for (let e of t) o.has(e.callId) || v(e);
|
|
100
103
|
},
|
|
@@ -107,4 +110,4 @@ function h(r) {
|
|
|
107
110
|
};
|
|
108
111
|
}
|
|
109
112
|
//#endregion
|
|
110
|
-
export { a as CLIENT_TOOL_MANIFEST_MAX_BYTES, o as CLIENT_TOOL_MANIFEST_MAX_TOOLS,
|
|
113
|
+
export { a as CLIENT_TOOL_MANIFEST_MAX_BYTES, o as CLIENT_TOOL_MANIFEST_MAX_TOOLS, m as CLIENT_TOOL_ORPHAN_MS, d as buildClientToolManifest, g as createClientToolRunner, u as isReadOnlyModeTool, l as offerClientTools, h as parseClientToolRequests };
|
|
@@ -110,6 +110,7 @@ function p(e) {
|
|
|
110
110
|
title: "Open a page",
|
|
111
111
|
description: "Opens a page of the app in the person's tab. Pass a page label from app_list_pages (e.g. \"Runs\") or an in-app path starting with \"/\". Refused while the current page has unsaved changes.",
|
|
112
112
|
input: i.strictObject({ destination: i.string().trim().min(1).max(200).describe("A page label from app_list_pages, or an in-app path starting with \"/\".") }),
|
|
113
|
+
annotations: { navigation: !0 },
|
|
113
114
|
execute: ({ destination: t }) => {
|
|
114
115
|
let r = e();
|
|
115
116
|
d(r);
|
|
@@ -133,6 +134,7 @@ function p(e) {
|
|
|
133
134
|
"dark",
|
|
134
135
|
"system"
|
|
135
136
|
]).describe("The appearance to switch to.") }),
|
|
137
|
+
annotations: { navigation: !0 },
|
|
136
138
|
execute: ({ mode: t }) => {
|
|
137
139
|
let { setThemeMode: r } = e();
|
|
138
140
|
if (!r) throw new n("NEEDS_USER", "This app does not let the theme be changed here.");
|
|
@@ -26,6 +26,13 @@ export interface AgentToolAnnotations {
|
|
|
26
26
|
untrustedContent?: boolean;
|
|
27
27
|
/** The tool changes something that matters: it is confirmed before it runs. */
|
|
28
28
|
consequential?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The tool changes only where the person is in the app (the page, the
|
|
31
|
+
* appearance), never their data. A read-only assistant mode offers it along
|
|
32
|
+
* with the `readOnly` tools (`offerClientTools`). Not a WebMCP hint: it is
|
|
33
|
+
* never sent to the browser or to the assistant.
|
|
34
|
+
*/
|
|
35
|
+
navigation?: boolean;
|
|
29
36
|
}
|
|
30
37
|
/** What the confirmation dialog says. Plain text — never markup. */
|
|
31
38
|
export interface AgentToolConfirmation {
|