@dudko.dev/agent-web-ui 0.0.5 → 0.0.7
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/README.md +81 -3
- package/dist/{chunk-NHU6WQM5.js → chunk-3TMUUU3O.js} +424 -0
- package/dist/{chunk-627OXMFG.js → chunk-HIHUK7YA.js} +5 -0
- package/dist/{chunk-S5AHUAFG.js → chunk-JEW2ZWYX.js} +4 -0
- package/dist/{chunk-VZCQXE3P.js → chunk-UO2Q7AIV.js} +4 -0
- package/dist/{chunk-V33T6VX3.js → chunk-VG5NLFI5.js} +4 -0
- package/dist/controller.cjs +460 -16
- package/dist/controller.d.cts +53 -5
- package/dist/controller.d.ts +53 -5
- package/dist/controller.js +58 -17
- package/dist/{en-Dg2MtzcJ.d.cts → en-CPCAidve.d.cts} +4 -0
- package/dist/{en-Dg2MtzcJ.d.ts → en-CPCAidve.d.ts} +4 -0
- package/dist/index.cjs +447 -3
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +37 -1
- package/dist/{labels-ipy-ydkp.d.cts → labels-Dnh2tn8S.d.cts} +8 -0
- package/dist/{labels-CCPL7t17.d.ts → labels-h-grbo5N.d.ts} +8 -0
- package/dist/locales/be.cjs +9 -0
- package/dist/locales/be.d.cts +1 -1
- package/dist/locales/be.d.ts +1 -1
- package/dist/locales/be.js +5 -1
- package/dist/locales/bg.cjs +9 -0
- package/dist/locales/bg.d.cts +1 -1
- package/dist/locales/bg.d.ts +1 -1
- package/dist/locales/bg.js +5 -1
- package/dist/locales/ca.cjs +9 -0
- package/dist/locales/ca.d.cts +1 -1
- package/dist/locales/ca.d.ts +1 -1
- package/dist/locales/ca.js +5 -1
- package/dist/locales/cs.cjs +9 -0
- package/dist/locales/cs.d.cts +1 -1
- package/dist/locales/cs.d.ts +1 -1
- package/dist/locales/cs.js +5 -1
- package/dist/locales/da.cjs +9 -0
- package/dist/locales/da.d.cts +1 -1
- package/dist/locales/da.d.ts +1 -1
- package/dist/locales/da.js +5 -1
- package/dist/locales/de.cjs +9 -0
- package/dist/locales/de.d.cts +1 -1
- package/dist/locales/de.d.ts +1 -1
- package/dist/locales/de.js +5 -1
- package/dist/locales/el.cjs +9 -0
- package/dist/locales/el.d.cts +1 -1
- package/dist/locales/el.d.ts +1 -1
- package/dist/locales/el.js +5 -1
- package/dist/locales/en.cjs +9 -0
- package/dist/locales/en.d.cts +1 -1
- package/dist/locales/en.d.ts +1 -1
- package/dist/locales/en.js +5 -1
- package/dist/locales/es-419.cjs +9 -0
- package/dist/locales/es-419.d.cts +1 -1
- package/dist/locales/es-419.d.ts +1 -1
- package/dist/locales/es-419.js +2 -2
- package/dist/locales/es.cjs +9 -0
- package/dist/locales/es.d.cts +1 -1
- package/dist/locales/es.d.ts +1 -1
- package/dist/locales/es.js +2 -2
- package/dist/locales/fi.cjs +9 -0
- package/dist/locales/fi.d.cts +1 -1
- package/dist/locales/fi.d.ts +1 -1
- package/dist/locales/fi.js +5 -1
- package/dist/locales/fr-CA.cjs +9 -0
- package/dist/locales/fr-CA.d.cts +1 -1
- package/dist/locales/fr-CA.d.ts +1 -1
- package/dist/locales/fr-CA.js +2 -2
- package/dist/locales/fr.cjs +9 -0
- package/dist/locales/fr.d.cts +1 -1
- package/dist/locales/fr.d.ts +1 -1
- package/dist/locales/fr.js +2 -2
- package/dist/locales/gn.cjs +9 -0
- package/dist/locales/gn.d.cts +1 -1
- package/dist/locales/gn.d.ts +1 -1
- package/dist/locales/gn.js +5 -1
- package/dist/locales/hr.cjs +9 -0
- package/dist/locales/hr.d.cts +1 -1
- package/dist/locales/hr.d.ts +1 -1
- package/dist/locales/hr.js +5 -1
- package/dist/locales/ht.cjs +9 -0
- package/dist/locales/ht.d.cts +1 -1
- package/dist/locales/ht.d.ts +1 -1
- package/dist/locales/ht.js +5 -1
- package/dist/locales/hu.cjs +9 -0
- package/dist/locales/hu.d.cts +1 -1
- package/dist/locales/hu.d.ts +1 -1
- package/dist/locales/hu.js +5 -1
- package/dist/locales/index.cjs +5 -0
- package/dist/locales/index.d.cts +3 -3
- package/dist/locales/index.d.ts +3 -3
- package/dist/locales/index.js +1 -1
- package/dist/locales/it.cjs +9 -0
- package/dist/locales/it.d.cts +1 -1
- package/dist/locales/it.d.ts +1 -1
- package/dist/locales/it.js +5 -1
- package/dist/locales/nb.cjs +9 -0
- package/dist/locales/nb.d.cts +1 -1
- package/dist/locales/nb.d.ts +1 -1
- package/dist/locales/nb.js +5 -1
- package/dist/locales/nl.cjs +9 -0
- package/dist/locales/nl.d.cts +1 -1
- package/dist/locales/nl.d.ts +1 -1
- package/dist/locales/nl.js +5 -1
- package/dist/locales/pl.cjs +9 -0
- package/dist/locales/pl.d.cts +1 -1
- package/dist/locales/pl.d.ts +1 -1
- package/dist/locales/pl.js +5 -1
- package/dist/locales/pt-BR.cjs +9 -0
- package/dist/locales/pt-BR.d.cts +1 -1
- package/dist/locales/pt-BR.d.ts +1 -1
- package/dist/locales/pt-BR.js +5 -1
- package/dist/locales/pt.cjs +9 -0
- package/dist/locales/pt.d.cts +1 -1
- package/dist/locales/pt.d.ts +1 -1
- package/dist/locales/pt.js +5 -1
- package/dist/locales/qu.cjs +9 -0
- package/dist/locales/qu.d.cts +1 -1
- package/dist/locales/qu.d.ts +1 -1
- package/dist/locales/qu.js +5 -1
- package/dist/locales/ro.cjs +9 -0
- package/dist/locales/ro.d.cts +1 -1
- package/dist/locales/ro.d.ts +1 -1
- package/dist/locales/ro.js +5 -1
- package/dist/locales/ru.cjs +9 -0
- package/dist/locales/ru.d.cts +1 -1
- package/dist/locales/ru.d.ts +1 -1
- package/dist/locales/ru.js +5 -1
- package/dist/locales/sk.cjs +9 -0
- package/dist/locales/sk.d.cts +1 -1
- package/dist/locales/sk.d.ts +1 -1
- package/dist/locales/sk.js +5 -1
- package/dist/locales/sq.cjs +9 -0
- package/dist/locales/sq.d.cts +1 -1
- package/dist/locales/sq.d.ts +1 -1
- package/dist/locales/sq.js +5 -1
- package/dist/locales/sr-Latn.cjs +9 -0
- package/dist/locales/sr-Latn.d.cts +1 -1
- package/dist/locales/sr-Latn.d.ts +1 -1
- package/dist/locales/sr-Latn.js +2 -2
- package/dist/locales/sr.cjs +9 -0
- package/dist/locales/sr.d.cts +1 -1
- package/dist/locales/sr.d.ts +1 -1
- package/dist/locales/sr.js +2 -2
- package/dist/locales/sv.cjs +9 -0
- package/dist/locales/sv.d.cts +1 -1
- package/dist/locales/sv.d.ts +1 -1
- package/dist/locales/sv.js +5 -1
- package/dist/locales/tr.cjs +9 -0
- package/dist/locales/tr.d.cts +1 -1
- package/dist/locales/tr.d.ts +1 -1
- package/dist/locales/tr.js +5 -1
- package/dist/locales/uk.cjs +9 -0
- package/dist/locales/uk.d.cts +1 -1
- package/dist/locales/uk.d.ts +1 -1
- package/dist/locales/uk.js +5 -1
- package/dist/page-context-BAmw4p6d.d.cts +244 -0
- package/dist/page-context-BAmw4p6d.d.ts +244 -0
- package/dist/pipeline-format.cjs +842 -0
- package/dist/pipeline-format.d.cts +512 -0
- package/dist/pipeline-format.d.ts +512 -0
- package/dist/pipeline-format.js +788 -0
- package/dist/styles.css +55 -0
- package/dist/{types-CQquuZpl.d.cts → types-B5cyqkWY.d.cts} +1 -1
- package/dist/{types-CXZfZVP5.d.ts → types-BgNjWN5Z.d.ts} +1 -1
- package/package.json +12 -2
package/dist/index.cjs
CHANGED
|
@@ -46,12 +46,17 @@ __export(src_exports, {
|
|
|
46
46
|
NAMED_FILES_MAX: () => NAMED_FILES_MAX,
|
|
47
47
|
NAMED_FILES_SCAN_MAX: () => NAMED_FILES_SCAN_MAX,
|
|
48
48
|
NAMED_FILES_TEXT_MAX: () => NAMED_FILES_TEXT_MAX,
|
|
49
|
+
PAGE_CONTEXT_ASK_ON_SEND: () => PAGE_CONTEXT_ASK_ON_SEND,
|
|
50
|
+
PAGE_CONTEXT_MAX_CHARS: () => PAGE_CONTEXT_MAX_CHARS,
|
|
51
|
+
PAGE_CONTEXT_SELECTION_MAX: () => PAGE_CONTEXT_SELECTION_MAX,
|
|
52
|
+
PAGE_CONTEXT_VALUE_MAX: () => PAGE_CONTEXT_VALUE_MAX,
|
|
49
53
|
PROMPT_ARM_MS: () => PROMPT_ARM_MS,
|
|
50
54
|
QUESTION_TIMEOUT_MS: () => QUESTION_TIMEOUT_MS,
|
|
51
55
|
RECORDING_DEFAULT_MAX_MS: () => RECORDING_DEFAULT_MAX_MS,
|
|
52
56
|
RECORDING_TYPES: () => RECORDING_TYPES,
|
|
53
57
|
SpeechOutputError: () => SpeechOutputError,
|
|
54
58
|
activeElementOf: () => activeElementOf,
|
|
59
|
+
addressWithoutQuery: () => addressWithoutQuery,
|
|
55
60
|
agentCoreIfLoaded: () => agentCoreIfLoaded,
|
|
56
61
|
agentStateReducer: () => agentStateReducer,
|
|
57
62
|
agentStatusOf: () => agentStatusOf,
|
|
@@ -68,6 +73,7 @@ __export(src_exports, {
|
|
|
68
73
|
audioTypeOf: () => audioTypeOf,
|
|
69
74
|
boxLength: () => boxLength,
|
|
70
75
|
buildSandboxedDocument: () => buildSandboxedDocument,
|
|
76
|
+
capPageContext: () => capPageContext,
|
|
71
77
|
chatTitle: () => chatTitle,
|
|
72
78
|
clampFrameHeight: () => clampFrameHeight,
|
|
73
79
|
coalesce: () => coalesce,
|
|
@@ -77,6 +83,7 @@ __export(src_exports, {
|
|
|
77
83
|
createBrowserSpeaker: () => createBrowserSpeaker,
|
|
78
84
|
createElicitationQueue: () => createElicitationQueue,
|
|
79
85
|
createInitialAgentState: () => createInitialAgentState,
|
|
86
|
+
createPageContextCollector: () => createPageContextCollector,
|
|
80
87
|
createPromptArming: () => createPromptArming,
|
|
81
88
|
createQuestionQueue: () => createQuestionQueue,
|
|
82
89
|
createRecordingRecognizer: () => createRecordingRecognizer,
|
|
@@ -102,6 +109,7 @@ __export(src_exports, {
|
|
|
102
109
|
fileKindOf: () => fileKindOf,
|
|
103
110
|
fileNameOf: () => fileNameOf,
|
|
104
111
|
filterCommands: () => filterCommands,
|
|
112
|
+
focusEntries: () => focusEntries,
|
|
105
113
|
followOtherTabs: () => followOtherTabs,
|
|
106
114
|
followsAfterResize: () => followsAfterResize,
|
|
107
115
|
followsAfterScroll: () => followsAfterScroll,
|
|
@@ -112,12 +120,15 @@ __export(src_exports, {
|
|
|
112
120
|
formatProbability: () => formatProbability,
|
|
113
121
|
formatTokens: () => formatTokens,
|
|
114
122
|
freeAttachmentPath: () => freeAttachmentPath,
|
|
123
|
+
headingsInView: () => headingsInView,
|
|
115
124
|
imageSizeOf: () => imageSizeOf,
|
|
116
125
|
imagesInOutput: () => imagesInOutput,
|
|
117
126
|
inputCounterShown: () => inputCounterShown,
|
|
118
127
|
insertionFits: () => insertionFits,
|
|
128
|
+
isEditableElement: () => isEditableElement,
|
|
119
129
|
isEventInside: () => isEventInside,
|
|
120
130
|
isOneCharacter: () => isOneCharacter,
|
|
131
|
+
isSecretField: () => isSecretField,
|
|
121
132
|
isShadowRoot: () => isShadowRoot,
|
|
122
133
|
languageOfText: () => languageOfText,
|
|
123
134
|
lessonsOf: () => lessonsOf,
|
|
@@ -144,6 +155,8 @@ __export(src_exports, {
|
|
|
144
155
|
noticesOf: () => noticesOf,
|
|
145
156
|
overflowOf: () => overflowOf,
|
|
146
157
|
ownUnsaved: () => ownUnsaved,
|
|
158
|
+
pageContextOff: () => pageContextOff,
|
|
159
|
+
pageContextRows: () => pageContextRows,
|
|
147
160
|
parseSlash: () => parseSlash,
|
|
148
161
|
pathsNamedIn: () => pathsNamedIn,
|
|
149
162
|
pendingApprovalsOf: () => pendingApprovalsOf,
|
|
@@ -156,6 +169,7 @@ __export(src_exports, {
|
|
|
156
169
|
recordingSupported: () => recordingSupported,
|
|
157
170
|
remoteAnswerOf: () => remoteAnswerOf,
|
|
158
171
|
rootOf: () => rootOf,
|
|
172
|
+
roundCoordinate: () => roundCoordinate,
|
|
159
173
|
sandboxTokens: () => sandboxTokens,
|
|
160
174
|
sandboxedCsp: () => sandboxedCsp,
|
|
161
175
|
saveAttachments: () => saveAttachments,
|
|
@@ -172,6 +186,7 @@ __export(src_exports, {
|
|
|
172
186
|
subagentTree: () => subagentTree,
|
|
173
187
|
textExcerpt: () => textExcerpt,
|
|
174
188
|
tokenizeHtml: () => tokenizeHtml,
|
|
189
|
+
trackPageFocus: () => trackPageFocus,
|
|
175
190
|
unchangedSince: () => unchangedSince,
|
|
176
191
|
voiceFor: () => voiceFor,
|
|
177
192
|
voiceMessageName: () => voiceMessageName,
|
|
@@ -181,6 +196,7 @@ __export(src_exports, {
|
|
|
181
196
|
withAttachments: () => withAttachments,
|
|
182
197
|
withCspFirst: () => withCspFirst,
|
|
183
198
|
withPolicyFirst: () => withPolicyFirst,
|
|
199
|
+
withoutAskOnSend: () => withoutAskOnSend,
|
|
184
200
|
withoutOwnWords: () => withoutOwnWords,
|
|
185
201
|
workspacePathOf: () => workspacePathOf
|
|
186
202
|
});
|
|
@@ -2229,6 +2245,10 @@ var defaultLabels = {
|
|
|
2229
2245
|
questionOther: "Other…",
|
|
2230
2246
|
questionOtherLabel: "Your answer",
|
|
2231
2247
|
questionSkip: "Skip",
|
|
2248
|
+
pageContextSharing: "Sharing",
|
|
2249
|
+
pageContextNotSharing: "Not shared with this message",
|
|
2250
|
+
pageContextDontShare: "Don’t share with this message",
|
|
2251
|
+
pageContextAskedOnSend: "asked when you send",
|
|
2232
2252
|
questionExpiresIn: (time) => `If you do not answer, the agent decides by itself in ${time}`,
|
|
2233
2253
|
questionRemote: "Answered in the other tab, where the agent is running.",
|
|
2234
2254
|
questionAutomatic: (reason) => `The agent went on without your answer: ${reason}.`,
|
|
@@ -2698,6 +2718,414 @@ var downscaleImage = async (file, opts = {}) => {
|
|
|
2698
2718
|
return out && out.size < file.size ? out : file;
|
|
2699
2719
|
};
|
|
2700
2720
|
|
|
2721
|
+
// src/page-context.ts
|
|
2722
|
+
var PAGE_CONTEXT_VALUE_MAX = 500;
|
|
2723
|
+
var PAGE_CONTEXT_SELECTION_MAX = 500;
|
|
2724
|
+
var PAGE_CONTEXT_MAX_CHARS = 2e3;
|
|
2725
|
+
var HEADINGS_MAX = 8;
|
|
2726
|
+
var CLIP = "…";
|
|
2727
|
+
var clip = (text2, max) => text2.length > max ? `${text2.slice(0, Math.max(0, max - 1))}${CLIP}` : text2;
|
|
2728
|
+
var oneLine = (text2) => text2.replace(/\s+/g, " ").trim();
|
|
2729
|
+
var pageEnv = () => {
|
|
2730
|
+
const g = globalThis;
|
|
2731
|
+
if (typeof g.window === "undefined") return {};
|
|
2732
|
+
const w = g;
|
|
2733
|
+
return {
|
|
2734
|
+
location: w.location,
|
|
2735
|
+
document: w.document,
|
|
2736
|
+
getSelection: () => w.getSelection?.() ?? null,
|
|
2737
|
+
innerWidth: w.innerWidth,
|
|
2738
|
+
innerHeight: w.innerHeight,
|
|
2739
|
+
scrollY: w.scrollY,
|
|
2740
|
+
matchMedia: (q) => w.matchMedia(q),
|
|
2741
|
+
...g.navigator?.geolocation ? { geolocation: g.navigator.geolocation } : {},
|
|
2742
|
+
now: () => Date.now(),
|
|
2743
|
+
timeZone: () => Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
2744
|
+
screenWidth: g.screen?.width ?? w.innerWidth
|
|
2745
|
+
};
|
|
2746
|
+
};
|
|
2747
|
+
var pageContextOff = (options) => !options || !options.extra && !Object.values(options.collect ?? {}).some((v) => v !== false && v != null);
|
|
2748
|
+
var addressWithoutQuery = (href) => {
|
|
2749
|
+
try {
|
|
2750
|
+
const u = new URL(href);
|
|
2751
|
+
if (u.protocol !== "http:" && u.protocol !== "https:") return void 0;
|
|
2752
|
+
return `${u.origin}${u.pathname}`;
|
|
2753
|
+
} catch {
|
|
2754
|
+
return void 0;
|
|
2755
|
+
}
|
|
2756
|
+
};
|
|
2757
|
+
var autocompleteTokens = (el) => (el.getAttribute("autocomplete") ?? "").toLowerCase().split(/\s+/).filter(Boolean);
|
|
2758
|
+
var isSecretField = (el) => {
|
|
2759
|
+
const type = (el.type ?? el.getAttribute("type") ?? "").toLowerCase();
|
|
2760
|
+
if (type === "password" || type === "hidden") return true;
|
|
2761
|
+
return autocompleteTokens(el).some(
|
|
2762
|
+
(t) => t.startsWith("cc-") || t === "one-time-code" || t === "current-password" || t === "new-password"
|
|
2763
|
+
);
|
|
2764
|
+
};
|
|
2765
|
+
var IMPLICIT_ROLE = {
|
|
2766
|
+
a: "link",
|
|
2767
|
+
button: "button",
|
|
2768
|
+
textarea: "textbox",
|
|
2769
|
+
select: "combobox",
|
|
2770
|
+
h1: "heading",
|
|
2771
|
+
h2: "heading",
|
|
2772
|
+
h3: "heading",
|
|
2773
|
+
summary: "button"
|
|
2774
|
+
};
|
|
2775
|
+
var roleOf = (el) => {
|
|
2776
|
+
const explicit = el.getAttribute("role");
|
|
2777
|
+
if (explicit) return explicit.split(/\s+/)[0];
|
|
2778
|
+
const tag = el.tagName.toLowerCase();
|
|
2779
|
+
if (tag === "input") {
|
|
2780
|
+
const type = (el.type ?? el.getAttribute("type") ?? "text").toLowerCase();
|
|
2781
|
+
if (type === "checkbox") return "checkbox";
|
|
2782
|
+
if (type === "radio") return "radio";
|
|
2783
|
+
if (type === "button" || type === "submit" || type === "reset") return "button";
|
|
2784
|
+
if (type === "range") return "slider";
|
|
2785
|
+
if (type === "search") return "searchbox";
|
|
2786
|
+
return "textbox";
|
|
2787
|
+
}
|
|
2788
|
+
if (tag !== "textarea" && tag !== "select" && isEditableElement(el)) return "textbox";
|
|
2789
|
+
return IMPLICIT_ROLE[tag] ?? tag;
|
|
2790
|
+
};
|
|
2791
|
+
var EDITABLE_ROLES = /* @__PURE__ */ new Set(["textbox", "searchbox", "combobox", "spinbutton"]);
|
|
2792
|
+
var isEditableElement = (el) => {
|
|
2793
|
+
const tag = el.tagName.toLowerCase();
|
|
2794
|
+
if (tag === "input" || tag === "textarea" || tag === "select") return true;
|
|
2795
|
+
if (el.isContentEditable === true) return true;
|
|
2796
|
+
const ce = el.getAttribute("contenteditable");
|
|
2797
|
+
if (ce !== null && ce.toLowerCase() !== "false") return true;
|
|
2798
|
+
const role = (el.getAttribute("role") ?? "").toLowerCase().split(/\s+/)[0] ?? "";
|
|
2799
|
+
return EDITABLE_ROLES.has(role);
|
|
2800
|
+
};
|
|
2801
|
+
var nameOf = (el, env) => {
|
|
2802
|
+
const aria = el.getAttribute("aria-label");
|
|
2803
|
+
if (aria) return aria;
|
|
2804
|
+
const by = el.getAttribute("aria-labelledby");
|
|
2805
|
+
if (by) {
|
|
2806
|
+
const text2 = by.split(/\s+/).map((id) => env.document?.getElementById?.(id)?.textContent ?? "").join(" ");
|
|
2807
|
+
if (text2.trim()) return text2;
|
|
2808
|
+
}
|
|
2809
|
+
const label = el.labels && el.labels.length ? el.labels[0]?.textContent ?? "" : "";
|
|
2810
|
+
if (label.trim()) return label;
|
|
2811
|
+
const placeholder = el.getAttribute("placeholder") ?? el.getAttribute("title");
|
|
2812
|
+
if (placeholder) return placeholder;
|
|
2813
|
+
return isEditableElement(el) ? "" : el.textContent ?? "";
|
|
2814
|
+
};
|
|
2815
|
+
var focusEntries = (env, includeValues) => {
|
|
2816
|
+
const el = env.document?.activeElement;
|
|
2817
|
+
if (!el) return {};
|
|
2818
|
+
const tag = el.tagName.toLowerCase();
|
|
2819
|
+
if (tag === "body" || tag === "html") return {};
|
|
2820
|
+
const out = { "focus.role": roleOf(el) };
|
|
2821
|
+
const name = clip(oneLine(nameOf(el, env)), 120);
|
|
2822
|
+
if (name) out["focus.label"] = name;
|
|
2823
|
+
out["focus.type"] = tag === "input" ? `input:${(el.type ?? "text").toLowerCase()}` : tag;
|
|
2824
|
+
if (includeValues && isEditableElement(el) && !isSecretField(el)) {
|
|
2825
|
+
const isControl = tag === "input" || tag === "textarea" || tag === "select";
|
|
2826
|
+
const raw = isControl ? el.value : el.textContent;
|
|
2827
|
+
const value = typeof raw === "string" ? raw.trim() : "";
|
|
2828
|
+
if (value) out["focus.value"] = clip(value, PAGE_CONTEXT_VALUE_MAX);
|
|
2829
|
+
}
|
|
2830
|
+
return out;
|
|
2831
|
+
};
|
|
2832
|
+
var headingsInView = (env) => {
|
|
2833
|
+
const all = env.document?.querySelectorAll?.("h1, h2, h3");
|
|
2834
|
+
if (!all) return void 0;
|
|
2835
|
+
const height = env.innerHeight ?? Infinity;
|
|
2836
|
+
const shown = [];
|
|
2837
|
+
for (let i = 0; i < all.length && shown.length < HEADINGS_MAX; i++) {
|
|
2838
|
+
const h = all[i];
|
|
2839
|
+
const box = h.getBoundingClientRect?.();
|
|
2840
|
+
if (box && (box.bottom < 0 || box.top > height)) continue;
|
|
2841
|
+
const text2 = clip(oneLine(h.textContent ?? ""), 120);
|
|
2842
|
+
if (text2) shown.push(text2);
|
|
2843
|
+
}
|
|
2844
|
+
return shown.length ? clip(shown.join(" / "), PAGE_CONTEXT_VALUE_MAX) : void 0;
|
|
2845
|
+
};
|
|
2846
|
+
var roundCoordinate = (value, precision) => {
|
|
2847
|
+
const p = Math.min(6, Math.max(0, Math.floor(precision)));
|
|
2848
|
+
const f = 10 ** p;
|
|
2849
|
+
return Math.round(value * f) / f;
|
|
2850
|
+
};
|
|
2851
|
+
var localIso = (ms) => {
|
|
2852
|
+
const d = new Date(ms);
|
|
2853
|
+
const pad2 = (n) => String(Math.abs(n)).padStart(2, "0");
|
|
2854
|
+
const off = -d.getTimezoneOffset();
|
|
2855
|
+
const sign = off >= 0 ? "+" : "-";
|
|
2856
|
+
return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}T${pad2(d.getHours())}:${pad2(d.getMinutes())}${sign}${pad2(Math.floor(Math.abs(off) / 60))}:${pad2(Math.abs(off) % 60)}`;
|
|
2857
|
+
};
|
|
2858
|
+
var capPageContext = (context, max) => {
|
|
2859
|
+
let left = max;
|
|
2860
|
+
const out = {};
|
|
2861
|
+
for (const [k, v] of Object.entries(context)) {
|
|
2862
|
+
const text2 = v === null ? "" : String(v);
|
|
2863
|
+
const room = left - k.length - 2;
|
|
2864
|
+
if (room <= 0) break;
|
|
2865
|
+
if (typeof v === "string" && text2.length > room) {
|
|
2866
|
+
if (room < 8) break;
|
|
2867
|
+
out[k] = clip(text2, room);
|
|
2868
|
+
left = 0;
|
|
2869
|
+
break;
|
|
2870
|
+
}
|
|
2871
|
+
if (typeof v !== "string" && text2.length > room) break;
|
|
2872
|
+
out[k] = v;
|
|
2873
|
+
left -= k.length + 2 + text2.length;
|
|
2874
|
+
}
|
|
2875
|
+
return out;
|
|
2876
|
+
};
|
|
2877
|
+
var trackPageFocus = (doc, isInside) => {
|
|
2878
|
+
let lastElement;
|
|
2879
|
+
let lastSelection;
|
|
2880
|
+
const deepActive = () => {
|
|
2881
|
+
let el = doc.activeElement;
|
|
2882
|
+
while (el?.shadowRoot?.activeElement) el = el.shadowRoot.activeElement;
|
|
2883
|
+
return el;
|
|
2884
|
+
};
|
|
2885
|
+
const isPageElement = (el) => {
|
|
2886
|
+
const tag = el?.tagName?.toLowerCase();
|
|
2887
|
+
return Boolean(tag) && tag !== "body" && tag !== "html";
|
|
2888
|
+
};
|
|
2889
|
+
const onFocus = (e) => {
|
|
2890
|
+
const target = e.composedPath?.()[0] ?? e.target;
|
|
2891
|
+
if (isPageElement(target) && !isInside(target)) lastElement = target;
|
|
2892
|
+
};
|
|
2893
|
+
const onSelection = () => {
|
|
2894
|
+
const sel = doc.getSelection();
|
|
2895
|
+
if (!sel || isInside(sel.anchorNode)) return;
|
|
2896
|
+
const text2 = sel.toString().trim();
|
|
2897
|
+
lastSelection = text2 || void 0;
|
|
2898
|
+
};
|
|
2899
|
+
doc.addEventListener("focusin", onFocus, true);
|
|
2900
|
+
doc.addEventListener("selectionchange", onSelection);
|
|
2901
|
+
return {
|
|
2902
|
+
element() {
|
|
2903
|
+
const now = deepActive();
|
|
2904
|
+
if (isPageElement(now) && !isInside(now)) return now;
|
|
2905
|
+
const last = lastElement;
|
|
2906
|
+
return last && last.isConnected !== false ? lastElement : void 0;
|
|
2907
|
+
},
|
|
2908
|
+
selection() {
|
|
2909
|
+
const sel = doc.getSelection();
|
|
2910
|
+
if (sel && !isInside(sel.anchorNode)) {
|
|
2911
|
+
const text2 = sel.toString().trim();
|
|
2912
|
+
if (text2) return text2;
|
|
2913
|
+
}
|
|
2914
|
+
return lastSelection;
|
|
2915
|
+
},
|
|
2916
|
+
stop() {
|
|
2917
|
+
doc.removeEventListener("focusin", onFocus, true);
|
|
2918
|
+
doc.removeEventListener("selectionchange", onSelection);
|
|
2919
|
+
lastElement = void 0;
|
|
2920
|
+
lastSelection = void 0;
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
};
|
|
2924
|
+
var PAGE_CONTEXT_ASK_ON_SEND = /* @__PURE__ */ Symbol.for("@dudko.dev/agent-web-ui:page-context-ask");
|
|
2925
|
+
var createPageContextCollector = (options, env = pageEnv) => {
|
|
2926
|
+
let position;
|
|
2927
|
+
let denied = false;
|
|
2928
|
+
let tracker;
|
|
2929
|
+
let asking;
|
|
2930
|
+
const geoSettings = (raw) => {
|
|
2931
|
+
const o = typeof raw === "object" && raw ? raw : {};
|
|
2932
|
+
return {
|
|
2933
|
+
precision: typeof o.precision === "number" ? o.precision : 2,
|
|
2934
|
+
maxAgeMs: typeof o.maxAgeMs === "number" ? o.maxAgeMs : 10 * 6e4,
|
|
2935
|
+
timeoutMs: typeof o.timeoutMs === "number" ? o.timeoutMs : 1e4
|
|
2936
|
+
};
|
|
2937
|
+
};
|
|
2938
|
+
const askPosition = (e, s) => {
|
|
2939
|
+
if (asking) return asking;
|
|
2940
|
+
const geo = e.geolocation;
|
|
2941
|
+
if (!geo) return Promise.resolve(void 0);
|
|
2942
|
+
asking = new Promise((resolve) => {
|
|
2943
|
+
let done = false;
|
|
2944
|
+
const finish = (p) => {
|
|
2945
|
+
if (done) return;
|
|
2946
|
+
done = true;
|
|
2947
|
+
asking = void 0;
|
|
2948
|
+
resolve(p);
|
|
2949
|
+
};
|
|
2950
|
+
const timer = setTimeout(() => finish(void 0), s.timeoutMs + 1e3);
|
|
2951
|
+
try {
|
|
2952
|
+
geo.getCurrentPosition(
|
|
2953
|
+
(p) => {
|
|
2954
|
+
clearTimeout(timer);
|
|
2955
|
+
const now = e.now?.() ?? Date.now();
|
|
2956
|
+
position = {
|
|
2957
|
+
latitude: p.coords.latitude,
|
|
2958
|
+
longitude: p.coords.longitude,
|
|
2959
|
+
accuracy: p.coords.accuracy,
|
|
2960
|
+
at: now
|
|
2961
|
+
};
|
|
2962
|
+
finish(position);
|
|
2963
|
+
},
|
|
2964
|
+
(err) => {
|
|
2965
|
+
clearTimeout(timer);
|
|
2966
|
+
if (err?.code === 1) denied = true;
|
|
2967
|
+
finish(void 0);
|
|
2968
|
+
},
|
|
2969
|
+
{ timeout: s.timeoutMs, maximumAge: s.maxAgeMs, enableHighAccuracy: false }
|
|
2970
|
+
);
|
|
2971
|
+
} catch {
|
|
2972
|
+
clearTimeout(timer);
|
|
2973
|
+
finish(void 0);
|
|
2974
|
+
}
|
|
2975
|
+
});
|
|
2976
|
+
return asking;
|
|
2977
|
+
};
|
|
2978
|
+
const fresh = (e, maxAgeMs) => position && (e.now?.() ?? Date.now()) - position.at <= maxAgeMs ? position : void 0;
|
|
2979
|
+
const geoEntries = (p, precision) => ({
|
|
2980
|
+
"geo.latitude": roundCoordinate(p.latitude, precision),
|
|
2981
|
+
"geo.longitude": roundCoordinate(p.longitude, precision),
|
|
2982
|
+
// The accuracy is never better than the rounding: at 2 decimals, about a kilometre.
|
|
2983
|
+
"geo.accuracy": Math.max(
|
|
2984
|
+
Math.round(p.accuracy),
|
|
2985
|
+
Math.round(111e3 / 10 ** Math.min(6, precision))
|
|
2986
|
+
)
|
|
2987
|
+
});
|
|
2988
|
+
const read = (base, o) => {
|
|
2989
|
+
const t = tracker;
|
|
2990
|
+
const e = t ? {
|
|
2991
|
+
...base,
|
|
2992
|
+
// Delegated one by one: a real Document's getters and methods live on its prototype.
|
|
2993
|
+
document: {
|
|
2994
|
+
...base.document?.title !== void 0 ? { title: base.document.title } : {},
|
|
2995
|
+
...base.document?.referrer !== void 0 ? { referrer: base.document.referrer } : {},
|
|
2996
|
+
...base.document?.documentElement ? { documentElement: base.document.documentElement } : {},
|
|
2997
|
+
activeElement: t.element() ?? null,
|
|
2998
|
+
querySelectorAll: (q) => base.document?.querySelectorAll?.(q) ?? [],
|
|
2999
|
+
getElementById: (id) => base.document?.getElementById?.(id) ?? null
|
|
3000
|
+
},
|
|
3001
|
+
getSelection: () => {
|
|
3002
|
+
const text2 = t.selection();
|
|
3003
|
+
return text2 ? { toString: () => text2 } : null;
|
|
3004
|
+
}
|
|
3005
|
+
} : base;
|
|
3006
|
+
const c = o.collect ?? {};
|
|
3007
|
+
const out = {};
|
|
3008
|
+
if (c.url && e.location) {
|
|
3009
|
+
const url = addressWithoutQuery(e.location.href);
|
|
3010
|
+
if (url) out.url = clip(url, PAGE_CONTEXT_VALUE_MAX);
|
|
3011
|
+
}
|
|
3012
|
+
if (c.path && e.location) out.path = clip(e.location.pathname, PAGE_CONTEXT_VALUE_MAX);
|
|
3013
|
+
if (c.title && e.document?.title)
|
|
3014
|
+
out.title = clip(oneLine(e.document.title), PAGE_CONTEXT_VALUE_MAX);
|
|
3015
|
+
if (c.language && e.document?.documentElement?.lang)
|
|
3016
|
+
out.language = e.document.documentElement.lang.slice(0, 35);
|
|
3017
|
+
if (c.referrer && e.document?.referrer) {
|
|
3018
|
+
const ref = addressWithoutQuery(e.document.referrer);
|
|
3019
|
+
if (ref) out.referrer = clip(ref, PAGE_CONTEXT_VALUE_MAX);
|
|
3020
|
+
}
|
|
3021
|
+
if (c.focus) {
|
|
3022
|
+
const includeValues = typeof c.focus === "object" && c.focus.includeValues === true;
|
|
3023
|
+
Object.assign(out, focusEntries(e, includeValues));
|
|
3024
|
+
}
|
|
3025
|
+
if (c.selection) {
|
|
3026
|
+
const max = typeof c.selection === "object" && typeof c.selection.maxChars === "number" ? Math.max(1, Math.min(PAGE_CONTEXT_VALUE_MAX * 4, c.selection.maxChars)) : PAGE_CONTEXT_SELECTION_MAX;
|
|
3027
|
+
const text2 = (e.getSelection?.()?.toString() ?? "").trim();
|
|
3028
|
+
if (text2) out.selection = clip(text2, max);
|
|
3029
|
+
}
|
|
3030
|
+
if (c.viewport && e.innerWidth && e.innerHeight)
|
|
3031
|
+
out.viewport = `${e.innerWidth}x${e.innerHeight}`;
|
|
3032
|
+
if (c.scroll && typeof e.scrollY === "number") {
|
|
3033
|
+
const total = (e.document?.documentElement?.scrollHeight ?? 0) - (e.innerHeight ?? 0);
|
|
3034
|
+
out.scroll = total > 0 ? `${Math.round(Math.min(100, e.scrollY / total * 100))}% (${Math.round(e.scrollY)}px)` : `0% (${Math.round(e.scrollY)}px)`;
|
|
3035
|
+
}
|
|
3036
|
+
if (c.headings) {
|
|
3037
|
+
const h = headingsInView(e);
|
|
3038
|
+
if (h) out.headings = h;
|
|
3039
|
+
}
|
|
3040
|
+
if (c.time) {
|
|
3041
|
+
const tz = e.timeZone?.();
|
|
3042
|
+
if (tz) out.timeZone = tz;
|
|
3043
|
+
out.localTime = localIso(e.now?.() ?? Date.now());
|
|
3044
|
+
}
|
|
3045
|
+
if (c.colorScheme && e.matchMedia) {
|
|
3046
|
+
out.colorScheme = e.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
3047
|
+
}
|
|
3048
|
+
if (c.device && e.matchMedia) {
|
|
3049
|
+
const coarse = e.matchMedia("(pointer: coarse)").matches;
|
|
3050
|
+
const w = e.screenWidth ?? e.innerWidth ?? 0;
|
|
3051
|
+
out.device = coarse ? w && w < 768 ? "phone" : "tablet" : "desktop";
|
|
3052
|
+
}
|
|
3053
|
+
return out;
|
|
3054
|
+
};
|
|
3055
|
+
const finishContext = (o, out) => {
|
|
3056
|
+
let extra;
|
|
3057
|
+
try {
|
|
3058
|
+
extra = o.extra?.();
|
|
3059
|
+
} catch {
|
|
3060
|
+
extra = void 0;
|
|
3061
|
+
}
|
|
3062
|
+
if (extra && typeof extra === "object") {
|
|
3063
|
+
for (const [k, v] of Object.entries(extra)) {
|
|
3064
|
+
if (v === void 0) continue;
|
|
3065
|
+
if (v === null || typeof v === "boolean" || typeof v === "number" && Number.isFinite(v))
|
|
3066
|
+
out[k] = v;
|
|
3067
|
+
else if (typeof v === "string") out[k] = clip(v, PAGE_CONTEXT_VALUE_MAX * 4);
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
const include = o.include ? new Set(o.include) : void 0;
|
|
3071
|
+
const exclude = new Set(o.exclude ?? []);
|
|
3072
|
+
const kept = {};
|
|
3073
|
+
for (const [k, v] of Object.entries(out)) {
|
|
3074
|
+
if (include && !include.has(k) || exclude.has(k)) continue;
|
|
3075
|
+
kept[k] = v;
|
|
3076
|
+
}
|
|
3077
|
+
const capped = capPageContext(kept, o.maxChars ?? PAGE_CONTEXT_MAX_CHARS);
|
|
3078
|
+
return Object.keys(capped).length ? capped : void 0;
|
|
3079
|
+
};
|
|
3080
|
+
return {
|
|
3081
|
+
get geolocationDenied() {
|
|
3082
|
+
return denied;
|
|
3083
|
+
},
|
|
3084
|
+
setTracker(next) {
|
|
3085
|
+
tracker = next;
|
|
3086
|
+
},
|
|
3087
|
+
preview() {
|
|
3088
|
+
const o = options();
|
|
3089
|
+
if (pageContextOff(o)) return void 0;
|
|
3090
|
+
const e = env();
|
|
3091
|
+
const out = read(e, o);
|
|
3092
|
+
const g = o.collect?.geolocation;
|
|
3093
|
+
if (g && !denied && e.geolocation) {
|
|
3094
|
+
const s = geoSettings(g);
|
|
3095
|
+
const p = fresh(e, s.maxAgeMs);
|
|
3096
|
+
if (p) Object.assign(out, geoEntries(p, s.precision));
|
|
3097
|
+
else out["geo.latitude"] = PAGE_CONTEXT_ASK_ON_SEND;
|
|
3098
|
+
}
|
|
3099
|
+
return finishContext(o, out);
|
|
3100
|
+
},
|
|
3101
|
+
async collect(opts = {}) {
|
|
3102
|
+
const o = options();
|
|
3103
|
+
if (pageContextOff(o)) return void 0;
|
|
3104
|
+
const e = env();
|
|
3105
|
+
const out = read(e, o);
|
|
3106
|
+
const g = o.collect?.geolocation;
|
|
3107
|
+
if (g && !denied) {
|
|
3108
|
+
const s = geoSettings(g);
|
|
3109
|
+
const p = fresh(e, s.maxAgeMs) ?? (opts.ask ? await askPosition(e, s) : void 0);
|
|
3110
|
+
if (p) Object.assign(out, geoEntries(p, s.precision));
|
|
3111
|
+
}
|
|
3112
|
+
return finishContext(o, out);
|
|
3113
|
+
}
|
|
3114
|
+
};
|
|
3115
|
+
};
|
|
3116
|
+
var pageContextRows = (context, askedOnSend) => Object.entries(context ?? {}).map(([key, v]) => ({
|
|
3117
|
+
key: v === PAGE_CONTEXT_ASK_ON_SEND ? "geo" : key,
|
|
3118
|
+
value: v === PAGE_CONTEXT_ASK_ON_SEND ? askedOnSend : v === null ? "" : String(v)
|
|
3119
|
+
}));
|
|
3120
|
+
var withoutAskOnSend = (context) => {
|
|
3121
|
+
if (!context) return void 0;
|
|
3122
|
+
const out = {};
|
|
3123
|
+
for (const [k, v] of Object.entries(context)) {
|
|
3124
|
+
if (v !== PAGE_CONTEXT_ASK_ON_SEND) out[k] = v;
|
|
3125
|
+
}
|
|
3126
|
+
return Object.keys(out).length ? out : void 0;
|
|
3127
|
+
};
|
|
3128
|
+
|
|
2701
3129
|
// src/format.ts
|
|
2702
3130
|
var previewValue = (value, max = 140) => {
|
|
2703
3131
|
if (value === void 0) return "";
|
|
@@ -3315,15 +3743,15 @@ var ChatHistoryStore = class {
|
|
|
3315
3743
|
}
|
|
3316
3744
|
};
|
|
3317
3745
|
var attachmentsText = (attachments, texts = {}) => attachments.length > 0 && attachments.every((a) => a.mediaType.toLowerCase().startsWith("audio/")) ? texts.voiceMessage ?? "Voice message" : attachments.map((a) => a.name).join(", ");
|
|
3318
|
-
var
|
|
3746
|
+
var oneLine2 = (text2) => (text2 ?? "").replace(/\s+/g, " ").trim();
|
|
3319
3747
|
var chatTitle = (messages, texts = {}) => {
|
|
3320
3748
|
const at = messages.findIndex((m) => m.role === "user");
|
|
3321
3749
|
const user = at >= 0 ? messages[at] : void 0;
|
|
3322
|
-
let first =
|
|
3750
|
+
let first = oneLine2(user?.content);
|
|
3323
3751
|
if (!first && user?.attachments?.length) {
|
|
3324
3752
|
const answer = messages.slice(at + 1).find((m) => m.role === "assistant");
|
|
3325
3753
|
const heard = answer?.transcripts?.find((t) => t.source === "attachment")?.text;
|
|
3326
|
-
first =
|
|
3754
|
+
first = oneLine2(heard) || oneLine2(attachmentsText(user.attachments, texts));
|
|
3327
3755
|
}
|
|
3328
3756
|
if (!first) return "New chat";
|
|
3329
3757
|
return first.length > 60 ? `${first.slice(0, 59)}…` : first;
|
|
@@ -4202,12 +4630,17 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4202
4630
|
NAMED_FILES_MAX,
|
|
4203
4631
|
NAMED_FILES_SCAN_MAX,
|
|
4204
4632
|
NAMED_FILES_TEXT_MAX,
|
|
4633
|
+
PAGE_CONTEXT_ASK_ON_SEND,
|
|
4634
|
+
PAGE_CONTEXT_MAX_CHARS,
|
|
4635
|
+
PAGE_CONTEXT_SELECTION_MAX,
|
|
4636
|
+
PAGE_CONTEXT_VALUE_MAX,
|
|
4205
4637
|
PROMPT_ARM_MS,
|
|
4206
4638
|
QUESTION_TIMEOUT_MS,
|
|
4207
4639
|
RECORDING_DEFAULT_MAX_MS,
|
|
4208
4640
|
RECORDING_TYPES,
|
|
4209
4641
|
SpeechOutputError,
|
|
4210
4642
|
activeElementOf,
|
|
4643
|
+
addressWithoutQuery,
|
|
4211
4644
|
agentCoreIfLoaded,
|
|
4212
4645
|
agentStateReducer,
|
|
4213
4646
|
agentStatusOf,
|
|
@@ -4224,6 +4657,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4224
4657
|
audioTypeOf,
|
|
4225
4658
|
boxLength,
|
|
4226
4659
|
buildSandboxedDocument,
|
|
4660
|
+
capPageContext,
|
|
4227
4661
|
chatTitle,
|
|
4228
4662
|
clampFrameHeight,
|
|
4229
4663
|
coalesce,
|
|
@@ -4233,6 +4667,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4233
4667
|
createBrowserSpeaker,
|
|
4234
4668
|
createElicitationQueue,
|
|
4235
4669
|
createInitialAgentState,
|
|
4670
|
+
createPageContextCollector,
|
|
4236
4671
|
createPromptArming,
|
|
4237
4672
|
createQuestionQueue,
|
|
4238
4673
|
createRecordingRecognizer,
|
|
@@ -4258,6 +4693,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4258
4693
|
fileKindOf,
|
|
4259
4694
|
fileNameOf,
|
|
4260
4695
|
filterCommands,
|
|
4696
|
+
focusEntries,
|
|
4261
4697
|
followOtherTabs,
|
|
4262
4698
|
followsAfterResize,
|
|
4263
4699
|
followsAfterScroll,
|
|
@@ -4268,12 +4704,15 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4268
4704
|
formatProbability,
|
|
4269
4705
|
formatTokens,
|
|
4270
4706
|
freeAttachmentPath,
|
|
4707
|
+
headingsInView,
|
|
4271
4708
|
imageSizeOf,
|
|
4272
4709
|
imagesInOutput,
|
|
4273
4710
|
inputCounterShown,
|
|
4274
4711
|
insertionFits,
|
|
4712
|
+
isEditableElement,
|
|
4275
4713
|
isEventInside,
|
|
4276
4714
|
isOneCharacter,
|
|
4715
|
+
isSecretField,
|
|
4277
4716
|
isShadowRoot,
|
|
4278
4717
|
languageOfText,
|
|
4279
4718
|
lessonsOf,
|
|
@@ -4300,6 +4739,8 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4300
4739
|
noticesOf,
|
|
4301
4740
|
overflowOf,
|
|
4302
4741
|
ownUnsaved,
|
|
4742
|
+
pageContextOff,
|
|
4743
|
+
pageContextRows,
|
|
4303
4744
|
parseSlash,
|
|
4304
4745
|
pathsNamedIn,
|
|
4305
4746
|
pendingApprovalsOf,
|
|
@@ -4312,6 +4753,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4312
4753
|
recordingSupported,
|
|
4313
4754
|
remoteAnswerOf,
|
|
4314
4755
|
rootOf,
|
|
4756
|
+
roundCoordinate,
|
|
4315
4757
|
sandboxTokens,
|
|
4316
4758
|
sandboxedCsp,
|
|
4317
4759
|
saveAttachments,
|
|
@@ -4328,6 +4770,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4328
4770
|
subagentTree,
|
|
4329
4771
|
textExcerpt,
|
|
4330
4772
|
tokenizeHtml,
|
|
4773
|
+
trackPageFocus,
|
|
4331
4774
|
unchangedSince,
|
|
4332
4775
|
voiceFor,
|
|
4333
4776
|
voiceMessageName,
|
|
@@ -4337,6 +4780,7 @@ var createAudioSpeaker = (options) => (text2, { lang, onState }) => {
|
|
|
4337
4780
|
withAttachments,
|
|
4338
4781
|
withCspFirst,
|
|
4339
4782
|
withPolicyFirst,
|
|
4783
|
+
withoutAskOnSend,
|
|
4340
4784
|
withoutOwnWords,
|
|
4341
4785
|
workspacePathOf
|
|
4342
4786
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,8 @@ import * as Core from '@dudko.dev/agent-web';
|
|
|
2
2
|
import { AgentEvent, IUsage, Skill, ToolApprovalRequest, ToolApprovalContext, ToolApprovalDecision } from '@dudko.dev/agent-web';
|
|
3
3
|
import { A as AgentUiState, C as ChatAttachment, R as RemoteRunView, L as LessonView, a as ChatMessage, b as ApprovalView, S as SubagentView, i as SubagentNode } from './types-DnBCok3z.cjs';
|
|
4
4
|
export { h as AgentStatus, j as AppView, B as BrowserOAuthProvider, k as BrowserOAuthProviderOptions, l as BudgetView, m as CompactionView, n as ConnectedMcp, D as DecisionView, E as ElicitationView, F as FetchView, o as McpAppsConnectionLike, p as McpCatalogEntry, M as McpElicitationFieldSchema, c as McpElicitationHandler, f as McpElicitationOptions, d as McpElicitationRequest, e as McpElicitationResult, g as McpElicitationSchema, q as McpHttpServerConfig, r as McpModule, s as McpOAuthCallback, t as McpOAuthRegistration, u as McpOAuthRegistrationKind, v as McpProtocolMode, w as McpServerInstructions, x as McpServerProtocol, y as McpServerResult, z as MediaView, G as ModelLoadState, Q as QuestionView, H as QueuedMessageView, I as ReplanState, J as SkillConsentView, K as StepEscalationView, N as StepView, T as ToolCallView, O as TranscriptView, U as UserNoteView, W as WrittenFileView } from './types-DnBCok3z.cjs';
|
|
5
|
-
export { a as ATTACHMENT_BOUNDS, b as AgentLabels, A as AgentLabelsOverride, c as AttachmentBounds, d as AttachmentFiles, e as AttachmentOverLimit, f as AttachmentTextOptions, g as AttachmentTransform, C as ComposerAttachment, h as ComposerNotice, E as ELICITATION_MAX_OPTIONS, i as ELICITATION_TIMEOUT_MS, j as ELICITATION_VALUE_MAX_CHARS, k as ElicitationControl, l as ElicitationDraft, m as ElicitationDraftValue, n as ElicitationField, o as ElicitationFormOutcome, p as ElicitationIssue, q as ElicitationIssueKind, r as ElicitationLink, s as ElicitationOption, t as ElicitationOutcomeReason, u as ElicitationQueue, v as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NotReadyInput, w as NotReadyIntent, x as NotReadyReason, y as NoticeTexts, P as PendingElicitation, S as SavedAttachments, z as SlashCommand, B as SteerIntent, T as TextExcerpt, W as WaitingSendStep, D as attachmentFileName, G as attachmentKindOf, H as attachmentLabel, J as attachmentOverLimit, K as attachmentRefusal, L as attachmentTransformOf, O as boxLength, Q as createElicitationQueue, R as dataUrlParts, U as defaultLabels, V as defaultNoticeTexts, X as elicitationConnectOptions, Y as elicitationFields, Z as elicitationFormAnswer, _ as elicitationInitialDraft, $ as elicitationLink, a0 as elicitationSettings, a1 as elicitationTimeoutOf, a2 as excerptNote, a3 as fileKindOf, a4 as fileNameOf, a5 as filterCommands, a6 as formatClock, a7 as formatCountdown, a8 as formatElapsed, a9 as freeAttachmentPath, aa as inputCounterShown, ab as insertionFits, ac as isOneCharacter, ad as lineCountOf, ae as longTextName, af as longTextRoute, ag as mediaFamilyOf, ah as menuKeyTarget, ai as menuSections, aj as mergeLabels, ak as messageOverLimit, al as micProblemText, am as notReadyIntent, an as notReadyReason, ao as noticesOf, ap as overflowOf, aq as parseSlash, ar as saveAttachments, as as steerIntent, at as textExcerpt, au as voiceMessageName, av as waitingSendStep, aw as withAttachments } from './labels-
|
|
5
|
+
export { a as ATTACHMENT_BOUNDS, b as AgentLabels, A as AgentLabelsOverride, c as AttachmentBounds, d as AttachmentFiles, e as AttachmentOverLimit, f as AttachmentTextOptions, g as AttachmentTransform, C as ComposerAttachment, h as ComposerNotice, E as ELICITATION_MAX_OPTIONS, i as ELICITATION_TIMEOUT_MS, j as ELICITATION_VALUE_MAX_CHARS, k as ElicitationControl, l as ElicitationDraft, m as ElicitationDraftValue, n as ElicitationField, o as ElicitationFormOutcome, p as ElicitationIssue, q as ElicitationIssueKind, r as ElicitationLink, s as ElicitationOption, t as ElicitationOutcomeReason, u as ElicitationQueue, v as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NotReadyInput, w as NotReadyIntent, x as NotReadyReason, y as NoticeTexts, P as PendingElicitation, S as SavedAttachments, z as SlashCommand, B as SteerIntent, T as TextExcerpt, W as WaitingSendStep, D as attachmentFileName, G as attachmentKindOf, H as attachmentLabel, J as attachmentOverLimit, K as attachmentRefusal, L as attachmentTransformOf, O as boxLength, Q as createElicitationQueue, R as dataUrlParts, U as defaultLabels, V as defaultNoticeTexts, X as elicitationConnectOptions, Y as elicitationFields, Z as elicitationFormAnswer, _ as elicitationInitialDraft, $ as elicitationLink, a0 as elicitationSettings, a1 as elicitationTimeoutOf, a2 as excerptNote, a3 as fileKindOf, a4 as fileNameOf, a5 as filterCommands, a6 as formatClock, a7 as formatCountdown, a8 as formatElapsed, a9 as freeAttachmentPath, aa as inputCounterShown, ab as insertionFits, ac as isOneCharacter, ad as lineCountOf, ae as longTextName, af as longTextRoute, ag as mediaFamilyOf, ah as menuKeyTarget, ai as menuSections, aj as mergeLabels, ak as messageOverLimit, al as micProblemText, am as notReadyIntent, an as notReadyReason, ao as noticesOf, ap as overflowOf, aq as parseSlash, ar as saveAttachments, as as steerIntent, at as textExcerpt, au as voiceMessageName, av as waitingSendStep, aw as withAttachments } from './labels-Dnh2tn8S.cjs';
|
|
6
|
+
export { G as GeolocationCollect, d as PAGE_CONTEXT_ASK_ON_SEND, e as PAGE_CONTEXT_MAX_CHARS, f as PAGE_CONTEXT_SELECTION_MAX, g as PAGE_CONTEXT_VALUE_MAX, a as PageContext, h as PageContextCollect, b as PageContextCollector, i as PageContextElement, j as PageContextEnv, P as PageContextOptions, k as PageContextValue, l as PageFocusTracker, m as addressWithoutQuery, n as capPageContext, c as createPageContextCollector, o as focusEntries, p as headingsInView, q as isEditableElement, r as isSecretField, s as pageContextOff, u as pageContextRows, v as roundCoordinate, t as trackPageFocus, w as withoutAskOnSend } from './page-context-BAmw4p6d.cjs';
|
|
6
7
|
export { A as ASK_USER_TOOL_NAME, P as PendingQuestion, a as QUESTION_TIMEOUT_MS, Q as QuestionOutcomeReason, b as QuestionQueue, c as QuestionQueueOptions, d as askUserOutputKept, e as askUserWith, f as createQuestionQueue, q as questionChoiceOf, g as questionOtherOf, h as questionTimeoutOf, w as withoutOwnWords } from './questions-Dw--IEjT.cjs';
|
|
7
8
|
import './mcp-app.cjs';
|
|
8
9
|
import './mcp-app-policy-DXKQ2jjM.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import * as Core from '@dudko.dev/agent-web';
|
|
|
2
2
|
import { AgentEvent, IUsage, Skill, ToolApprovalRequest, ToolApprovalContext, ToolApprovalDecision } from '@dudko.dev/agent-web';
|
|
3
3
|
import { A as AgentUiState, C as ChatAttachment, R as RemoteRunView, L as LessonView, a as ChatMessage, b as ApprovalView, S as SubagentView, i as SubagentNode } from './types-DnBCok3z.js';
|
|
4
4
|
export { h as AgentStatus, j as AppView, B as BrowserOAuthProvider, k as BrowserOAuthProviderOptions, l as BudgetView, m as CompactionView, n as ConnectedMcp, D as DecisionView, E as ElicitationView, F as FetchView, o as McpAppsConnectionLike, p as McpCatalogEntry, M as McpElicitationFieldSchema, c as McpElicitationHandler, f as McpElicitationOptions, d as McpElicitationRequest, e as McpElicitationResult, g as McpElicitationSchema, q as McpHttpServerConfig, r as McpModule, s as McpOAuthCallback, t as McpOAuthRegistration, u as McpOAuthRegistrationKind, v as McpProtocolMode, w as McpServerInstructions, x as McpServerProtocol, y as McpServerResult, z as MediaView, G as ModelLoadState, Q as QuestionView, H as QueuedMessageView, I as ReplanState, J as SkillConsentView, K as StepEscalationView, N as StepView, T as ToolCallView, O as TranscriptView, U as UserNoteView, W as WrittenFileView } from './types-DnBCok3z.js';
|
|
5
|
-
export { a as ATTACHMENT_BOUNDS, b as AgentLabels, A as AgentLabelsOverride, c as AttachmentBounds, d as AttachmentFiles, e as AttachmentOverLimit, f as AttachmentTextOptions, g as AttachmentTransform, C as ComposerAttachment, h as ComposerNotice, E as ELICITATION_MAX_OPTIONS, i as ELICITATION_TIMEOUT_MS, j as ELICITATION_VALUE_MAX_CHARS, k as ElicitationControl, l as ElicitationDraft, m as ElicitationDraftValue, n as ElicitationField, o as ElicitationFormOutcome, p as ElicitationIssue, q as ElicitationIssueKind, r as ElicitationLink, s as ElicitationOption, t as ElicitationOutcomeReason, u as ElicitationQueue, v as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NotReadyInput, w as NotReadyIntent, x as NotReadyReason, y as NoticeTexts, P as PendingElicitation, S as SavedAttachments, z as SlashCommand, B as SteerIntent, T as TextExcerpt, W as WaitingSendStep, D as attachmentFileName, G as attachmentKindOf, H as attachmentLabel, J as attachmentOverLimit, K as attachmentRefusal, L as attachmentTransformOf, O as boxLength, Q as createElicitationQueue, R as dataUrlParts, U as defaultLabels, V as defaultNoticeTexts, X as elicitationConnectOptions, Y as elicitationFields, Z as elicitationFormAnswer, _ as elicitationInitialDraft, $ as elicitationLink, a0 as elicitationSettings, a1 as elicitationTimeoutOf, a2 as excerptNote, a3 as fileKindOf, a4 as fileNameOf, a5 as filterCommands, a6 as formatClock, a7 as formatCountdown, a8 as formatElapsed, a9 as freeAttachmentPath, aa as inputCounterShown, ab as insertionFits, ac as isOneCharacter, ad as lineCountOf, ae as longTextName, af as longTextRoute, ag as mediaFamilyOf, ah as menuKeyTarget, ai as menuSections, aj as mergeLabels, ak as messageOverLimit, al as micProblemText, am as notReadyIntent, an as notReadyReason, ao as noticesOf, ap as overflowOf, aq as parseSlash, ar as saveAttachments, as as steerIntent, at as textExcerpt, au as voiceMessageName, av as waitingSendStep, aw as withAttachments } from './labels-
|
|
5
|
+
export { a as ATTACHMENT_BOUNDS, b as AgentLabels, A as AgentLabelsOverride, c as AttachmentBounds, d as AttachmentFiles, e as AttachmentOverLimit, f as AttachmentTextOptions, g as AttachmentTransform, C as ComposerAttachment, h as ComposerNotice, E as ELICITATION_MAX_OPTIONS, i as ELICITATION_TIMEOUT_MS, j as ELICITATION_VALUE_MAX_CHARS, k as ElicitationControl, l as ElicitationDraft, m as ElicitationDraftValue, n as ElicitationField, o as ElicitationFormOutcome, p as ElicitationIssue, q as ElicitationIssueKind, r as ElicitationLink, s as ElicitationOption, t as ElicitationOutcomeReason, u as ElicitationQueue, v as ElicitationQueueOptions, F as FileKind, I as INPUT_COUNTER_FROM, M as MenuSection, N as NotReadyInput, w as NotReadyIntent, x as NotReadyReason, y as NoticeTexts, P as PendingElicitation, S as SavedAttachments, z as SlashCommand, B as SteerIntent, T as TextExcerpt, W as WaitingSendStep, D as attachmentFileName, G as attachmentKindOf, H as attachmentLabel, J as attachmentOverLimit, K as attachmentRefusal, L as attachmentTransformOf, O as boxLength, Q as createElicitationQueue, R as dataUrlParts, U as defaultLabels, V as defaultNoticeTexts, X as elicitationConnectOptions, Y as elicitationFields, Z as elicitationFormAnswer, _ as elicitationInitialDraft, $ as elicitationLink, a0 as elicitationSettings, a1 as elicitationTimeoutOf, a2 as excerptNote, a3 as fileKindOf, a4 as fileNameOf, a5 as filterCommands, a6 as formatClock, a7 as formatCountdown, a8 as formatElapsed, a9 as freeAttachmentPath, aa as inputCounterShown, ab as insertionFits, ac as isOneCharacter, ad as lineCountOf, ae as longTextName, af as longTextRoute, ag as mediaFamilyOf, ah as menuKeyTarget, ai as menuSections, aj as mergeLabels, ak as messageOverLimit, al as micProblemText, am as notReadyIntent, an as notReadyReason, ao as noticesOf, ap as overflowOf, aq as parseSlash, ar as saveAttachments, as as steerIntent, at as textExcerpt, au as voiceMessageName, av as waitingSendStep, aw as withAttachments } from './labels-h-grbo5N.js';
|
|
6
|
+
export { G as GeolocationCollect, d as PAGE_CONTEXT_ASK_ON_SEND, e as PAGE_CONTEXT_MAX_CHARS, f as PAGE_CONTEXT_SELECTION_MAX, g as PAGE_CONTEXT_VALUE_MAX, a as PageContext, h as PageContextCollect, b as PageContextCollector, i as PageContextElement, j as PageContextEnv, P as PageContextOptions, k as PageContextValue, l as PageFocusTracker, m as addressWithoutQuery, n as capPageContext, c as createPageContextCollector, o as focusEntries, p as headingsInView, q as isEditableElement, r as isSecretField, s as pageContextOff, u as pageContextRows, v as roundCoordinate, t as trackPageFocus, w as withoutAskOnSend } from './page-context-BAmw4p6d.js';
|
|
6
7
|
export { A as ASK_USER_TOOL_NAME, P as PendingQuestion, a as QUESTION_TIMEOUT_MS, Q as QuestionOutcomeReason, b as QuestionQueue, c as QuestionQueueOptions, d as askUserOutputKept, e as askUserWith, f as createQuestionQueue, q as questionChoiceOf, g as questionOtherOf, h as questionTimeoutOf, w as withoutOwnWords } from './questions-Dw--IEjT.js';
|
|
7
8
|
import './mcp-app.js';
|
|
8
9
|
import './mcp-app-policy-DXKQ2jjM.js';
|