@classic-homes/agent-chat 0.11.0 → 0.13.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/README.md +67 -2
- package/dist/components/AgentChat.svelte +60 -25
- package/dist/components/AgentChat.svelte.d.ts +11 -1
- package/dist/components/AgentChat.svelte.d.ts.map +1 -1
- package/dist/components/ArtifactPanel.svelte +4 -2
- package/dist/components/AssistantMessage.svelte +58 -16
- package/dist/components/AssistantMessage.svelte.d.ts +2 -0
- package/dist/components/AssistantMessage.svelte.d.ts.map +1 -1
- package/dist/components/ChatHeader.svelte +4 -1
- package/dist/components/ChatHeader.svelte.d.ts +2 -0
- package/dist/components/ChatHeader.svelte.d.ts.map +1 -1
- package/dist/components/ChatLauncher.svelte +175 -0
- package/dist/components/ChatLauncher.svelte.d.ts +26 -0
- package/dist/components/ChatLauncher.svelte.d.ts.map +1 -0
- package/dist/components/Composer.svelte +7 -3
- package/dist/components/Composer.svelte.d.ts.map +1 -1
- package/dist/components/FloatingWindow.svelte +280 -0
- package/dist/components/FloatingWindow.svelte.d.ts +35 -0
- package/dist/components/FloatingWindow.svelte.d.ts.map +1 -0
- package/dist/components/Markdown.svelte +4 -0
- package/dist/components/Markdown.svelte.d.ts.map +1 -1
- package/dist/components/MessageFeedback.svelte +11 -4
- package/dist/components/MessageFeedback.svelte.d.ts.map +1 -1
- package/dist/components/MessageFiles.svelte +133 -40
- package/dist/components/MessageFiles.svelte.d.ts +6 -0
- package/dist/components/MessageFiles.svelte.d.ts.map +1 -1
- package/dist/components/MessageItem.svelte +2 -0
- package/dist/components/MessageItem.svelte.d.ts +2 -0
- package/dist/components/MessageItem.svelte.d.ts.map +1 -1
- package/dist/components/MessageList.svelte +40 -7
- package/dist/components/MessageList.svelte.d.ts +3 -1
- package/dist/components/MessageList.svelte.d.ts.map +1 -1
- package/dist/components/ShortcutsDialog.svelte +10 -3
- package/dist/components/ShortcutsDialog.svelte.d.ts +2 -0
- package/dist/components/ShortcutsDialog.svelte.d.ts.map +1 -1
- package/dist/components/UiFrame.svelte +12 -4
- package/dist/components/UiFrame.svelte.d.ts.map +1 -1
- package/dist/components/UserMessage.svelte +10 -1
- package/dist/components/UserMessage.svelte.d.ts.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +94 -61
- package/dist/reducer.d.ts +11 -0
- package/dist/reducer.d.ts.map +1 -1
- package/dist/reducer.js +18 -2
- package/dist/session.svelte.d.ts +40 -0
- package/dist/session.svelte.d.ts.map +1 -1
- package/dist/session.svelte.js +178 -23
- package/dist/shortcuts.d.ts +7 -0
- package/dist/shortcuts.d.ts.map +1 -1
- package/dist/shortcuts.js +9 -0
- package/dist/surface-geometry.d.ts +60 -0
- package/dist/surface-geometry.d.ts.map +1 -0
- package/dist/surface-geometry.js +112 -0
- package/dist/surface.svelte.d.ts +79 -0
- package/dist/surface.svelte.d.ts.map +1 -0
- package/dist/surface.svelte.js +178 -0
- package/dist/thinking.d.ts +10 -0
- package/dist/thinking.d.ts.map +1 -0
- package/dist/thinking.js +61 -0
- package/dist/ui-frame-protocol.d.ts +6 -0
- package/dist/ui-frame-protocol.d.ts.map +1 -1
- package/dist/ui-frame-protocol.js +11 -0
- package/package.json +8 -7
- package/dist/artifact-pages.test.d.ts +0 -2
- package/dist/artifact-pages.test.d.ts.map +0 -1
- package/dist/artifact-pages.test.js +0 -102
- package/dist/components/a11y.svelte.test.d.ts +0 -2
- package/dist/components/a11y.svelte.test.d.ts.map +0 -1
- package/dist/components/a11y.svelte.test.js +0 -183
- package/dist/components/agent-picker.svelte.test.d.ts +0 -2
- package/dist/components/agent-picker.svelte.test.d.ts.map +0 -1
- package/dist/components/agent-picker.svelte.test.js +0 -84
- package/dist/components/composer.svelte.test.d.ts +0 -2
- package/dist/components/composer.svelte.test.d.ts.map +0 -1
- package/dist/components/composer.svelte.test.js +0 -162
- package/dist/components/continue.svelte.test.d.ts +0 -2
- package/dist/components/continue.svelte.test.d.ts.map +0 -1
- package/dist/components/continue.svelte.test.js +0 -109
- package/dist/components/conversation-chrome.svelte.test.d.ts +0 -2
- package/dist/components/conversation-chrome.svelte.test.d.ts.map +0 -1
- package/dist/components/conversation-chrome.svelte.test.js +0 -147
- package/dist/components/feedback.svelte.test.d.ts +0 -2
- package/dist/components/feedback.svelte.test.d.ts.map +0 -1
- package/dist/components/feedback.svelte.test.js +0 -99
- package/dist/components/live-fixes.svelte.test.d.ts +0 -2
- package/dist/components/live-fixes.svelte.test.d.ts.map +0 -1
- package/dist/components/live-fixes.svelte.test.js +0 -127
- package/dist/components/markdown-prose.svelte.test.d.ts +0 -2
- package/dist/components/markdown-prose.svelte.test.d.ts.map +0 -1
- package/dist/components/markdown-prose.svelte.test.js +0 -26
- package/dist/components/messages.svelte.test.d.ts +0 -2
- package/dist/components/messages.svelte.test.d.ts.map +0 -1
- package/dist/components/messages.svelte.test.js +0 -215
- package/dist/components/regenerate.svelte.test.d.ts +0 -2
- package/dist/components/regenerate.svelte.test.d.ts.map +0 -1
- package/dist/components/regenerate.svelte.test.js +0 -108
- package/dist/components/welcome.svelte.test.d.ts +0 -2
- package/dist/components/welcome.svelte.test.d.ts.map +0 -1
- package/dist/components/welcome.svelte.test.js +0 -119
- package/dist/composer-keys.test.d.ts +0 -2
- package/dist/composer-keys.test.d.ts.map +0 -1
- package/dist/composer-keys.test.js +0 -16
- package/dist/markdown.test.d.ts +0 -2
- package/dist/markdown.test.d.ts.map +0 -1
- package/dist/markdown.test.js +0 -35
- package/dist/reducer.test.d.ts +0 -2
- package/dist/reducer.test.d.ts.map +0 -1
- package/dist/reducer.test.js +0 -153
- package/dist/ui-frame-protocol.test.d.ts +0 -2
- package/dist/ui-frame-protocol.test.d.ts.map +0 -1
- package/dist/ui-frame-protocol.test.js +0 -48
- package/dist/ui-frame-relay.test.d.ts +0 -2
- package/dist/ui-frame-relay.test.d.ts.map +0 -1
- package/dist/ui-frame-relay.test.js +0 -36
package/dist/markdown.js
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
import DOMPurify from 'dompurify';
|
|
11
11
|
const OWN_CLASS_RE = /^agent-[\w-]+( agent-[\w-]+)*$/;
|
|
12
12
|
let hooked = false;
|
|
13
|
+
// Image hosts of the parseMarkdown call currently sanitizing; undefined outside it, so the
|
|
14
|
+
// hooks below never touch other DOMPurify users on the page.
|
|
15
|
+
let activeImageHosts;
|
|
13
16
|
function ensureHook() {
|
|
14
17
|
if (hooked || typeof DOMPurify.addHook !== 'function')
|
|
15
18
|
return;
|
|
@@ -18,6 +21,39 @@ function ensureHook() {
|
|
|
18
21
|
if (data.attrName === 'class' && !OWN_CLASS_RE.test(data.attrValue))
|
|
19
22
|
data.keepAttr = false;
|
|
20
23
|
});
|
|
24
|
+
// Defence in depth: the parser escapes all model text, so these only ever see our own tags.
|
|
25
|
+
DOMPurify.addHook('afterSanitizeAttributes', (node) => {
|
|
26
|
+
if (!activeImageHosts)
|
|
27
|
+
return;
|
|
28
|
+
const el = node;
|
|
29
|
+
if (typeof el.tagName !== 'string')
|
|
30
|
+
return;
|
|
31
|
+
const tag = el.tagName.toLowerCase();
|
|
32
|
+
if (tag === 'input') {
|
|
33
|
+
if ((el.getAttribute('type') ?? '').toLowerCase() !== 'checkbox') {
|
|
34
|
+
el.remove();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
el.setAttribute('disabled', '');
|
|
38
|
+
}
|
|
39
|
+
if (tag !== 'img')
|
|
40
|
+
el.removeAttribute('src');
|
|
41
|
+
else {
|
|
42
|
+
const src = el.getAttribute('src');
|
|
43
|
+
if (src === null || !isAllowedImageUrl(src, activeImageHosts))
|
|
44
|
+
el.remove();
|
|
45
|
+
}
|
|
46
|
+
if (el.hasAttribute('role') || el.hasAttribute('tabindex')) {
|
|
47
|
+
const region = el.getAttribute('role') === 'region' && el.getAttribute('tabindex') === '0';
|
|
48
|
+
const scroller = (tag === 'div' && el.classList.contains('agent-table-wrap')) || tag === 'pre';
|
|
49
|
+
if (!region || !scroller) {
|
|
50
|
+
el.removeAttribute('role');
|
|
51
|
+
el.removeAttribute('tabindex');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (el.hasAttribute('aria-label') && tag !== 'input' && tag !== 'div')
|
|
55
|
+
el.removeAttribute('aria-label');
|
|
56
|
+
});
|
|
21
57
|
}
|
|
22
58
|
const DOMPURIFY_CONFIG = {
|
|
23
59
|
ALLOWED_TAGS: [
|
|
@@ -60,12 +96,27 @@ const DOMPURIFY_CONFIG = {
|
|
|
60
96
|
'type',
|
|
61
97
|
'checked',
|
|
62
98
|
'disabled',
|
|
99
|
+
'aria-label',
|
|
100
|
+
'role',
|
|
101
|
+
'tabindex',
|
|
63
102
|
],
|
|
64
103
|
ALLOWED_URI_REGEXP: /^(?:(?:https?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,
|
|
65
104
|
};
|
|
66
105
|
// Sentinels for the scrolling wrapper around tables (see parseMarkdown).
|
|
67
106
|
const TABLE_OPEN = '\u0000TO\u0000';
|
|
68
107
|
const TABLE_CLOSE = '\u0000TC\u0000';
|
|
108
|
+
const TABLE_WRAP_OPEN = '<div class="agent-table-wrap" tabindex="0" role="region" aria-label="Table">';
|
|
109
|
+
function tagRegistry() {
|
|
110
|
+
const trusted = [];
|
|
111
|
+
return {
|
|
112
|
+
tag: (html) => {
|
|
113
|
+
trusted.push(html);
|
|
114
|
+
return `\u0000T${trusted.length - 1}\u0000`;
|
|
115
|
+
},
|
|
116
|
+
// eslint-disable-next-line no-control-regex -- NUL delimits the sentinels on purpose
|
|
117
|
+
restore: (html) => html.replace(/\u0000T(\d+)\u0000/g, (_, i) => trusted[Number(i)]),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
69
120
|
const DEFAULT_IMAGE_HOSTS = ['classichomes.com', '.classichomes.com'];
|
|
70
121
|
export function escapeHtml(text) {
|
|
71
122
|
return text.replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -83,17 +134,18 @@ export function isSafeUrl(url) {
|
|
|
83
134
|
function pageOrigin() {
|
|
84
135
|
return typeof window !== 'undefined' ? window.location.origin : undefined;
|
|
85
136
|
}
|
|
137
|
+
// Base for resolving relative URLs when there is no page (SSR): only a URL that stays on it is
|
|
138
|
+
// same-origin. `/\\host/x` and `//host/x` resolve to another host and fail the check.
|
|
139
|
+
const NO_PAGE_ORIGIN = 'https://same-origin.invalid';
|
|
86
140
|
export function isAllowedImageUrl(url, hosts = DEFAULT_IMAGE_HOSTS) {
|
|
87
141
|
if (!isSafeUrl(url))
|
|
88
142
|
return false;
|
|
89
|
-
if (url.startsWith('/') && !url.startsWith('//'))
|
|
90
|
-
return true;
|
|
91
143
|
try {
|
|
92
|
-
const origin = pageOrigin();
|
|
93
|
-
const parsed = new URL(url, origin
|
|
144
|
+
const origin = pageOrigin() ?? NO_PAGE_ORIGIN;
|
|
145
|
+
const parsed = new URL(url, origin);
|
|
94
146
|
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:')
|
|
95
147
|
return false;
|
|
96
|
-
if (
|
|
148
|
+
if (parsed.origin === origin)
|
|
97
149
|
return true;
|
|
98
150
|
const host = parsed.hostname.toLowerCase();
|
|
99
151
|
return hosts.some((h) => h.startsWith('.') ? host.endsWith(h) || host === h.slice(1) : host === h);
|
|
@@ -116,7 +168,10 @@ export function parseMarkdown(text, options = {}) {
|
|
|
116
168
|
ensureHook();
|
|
117
169
|
const CODE = '\u0000CB';
|
|
118
170
|
const INLINE = '\u0000IC';
|
|
119
|
-
|
|
171
|
+
// NUL is reserved for the sentinels below; model text cannot forge one.
|
|
172
|
+
// eslint-disable-next-line no-control-regex -- strips NUL so text cannot forge a sentinel
|
|
173
|
+
let html = text.replace(/\r\n/g, '\n').replace(/\u0000/g, '');
|
|
174
|
+
const { tag, restore } = tagRegistry();
|
|
120
175
|
const codeBlocks = [];
|
|
121
176
|
html = html.replace(/```([\w-]*)[^\n]*\n([\s\S]*?)```/g, (_, lang, code) => {
|
|
122
177
|
const cls = lang
|
|
@@ -130,14 +185,13 @@ export function parseMarkdown(text, options = {}) {
|
|
|
130
185
|
inlineCodes.push(`<code>${escapeHtml(code)}</code>`);
|
|
131
186
|
return `${INLINE}${inlineCodes.length - 1}${INLINE}`;
|
|
132
187
|
});
|
|
133
|
-
html = parseBlockquotes(html);
|
|
134
|
-
html = parseTables(html);
|
|
135
|
-
html = parseLists(html);
|
|
136
|
-
|
|
137
|
-
//
|
|
138
|
-
html = html
|
|
139
|
-
|
|
140
|
-
.replaceAll(TABLE_CLOSE, '</div>');
|
|
188
|
+
html = parseBlockquotes(html, tag);
|
|
189
|
+
html = parseTables(html, tag);
|
|
190
|
+
html = parseLists(html, tag);
|
|
191
|
+
// Escape everything (sentinels contain no escapable characters), then put back only our own
|
|
192
|
+
// tags, so a literal `<input>`, `<table>` or `<div>` in the text is never trusted.
|
|
193
|
+
html = restore(escapeHtml(html));
|
|
194
|
+
html = html.replaceAll(TABLE_OPEN, TABLE_WRAP_OPEN).replaceAll(TABLE_CLOSE, '</div>');
|
|
141
195
|
html = html.replace(/^[\t ]*(?:---+|\*\*\*+|___+)[\t ]*$/gm, '<hr>');
|
|
142
196
|
html = html.replace(/^#### (.+)$/gm, '<h4>$1</h4>');
|
|
143
197
|
html = html.replace(/^### (.+)$/gm, '<h4>$1</h4>');
|
|
@@ -170,38 +224,15 @@ export function parseMarkdown(text, options = {}) {
|
|
|
170
224
|
if (!html.startsWith('<'))
|
|
171
225
|
html = `<p>${html}</p>`;
|
|
172
226
|
html = html.replace(/<p>\s*<\/p>/g, '');
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
'tbody',
|
|
181
|
-
'tr',
|
|
182
|
-
'th',
|
|
183
|
-
'td',
|
|
184
|
-
'ul',
|
|
185
|
-
'ol',
|
|
186
|
-
'li',
|
|
187
|
-
'br',
|
|
188
|
-
'input',
|
|
189
|
-
];
|
|
190
|
-
const tagPattern = tags.map((t) => `<\\/?${t}[^>]*>`).join('|');
|
|
191
|
-
const markerPattern = markers.map((m) => `${m}\\d+${m}`).join('|');
|
|
192
|
-
const pattern = new RegExp(`(${tagPattern}|${markerPattern})`, 'gi');
|
|
193
|
-
return html
|
|
194
|
-
.split(pattern)
|
|
195
|
-
.map((part) => {
|
|
196
|
-
if (tags.some((t) => new RegExp(`^<\\/?${t}[^>]*>$`, 'i').test(part)))
|
|
197
|
-
return part;
|
|
198
|
-
if (markers.some((m) => part.startsWith(m) && part.endsWith(m)))
|
|
199
|
-
return part;
|
|
200
|
-
return escapeHtml(part);
|
|
201
|
-
})
|
|
202
|
-
.join('');
|
|
227
|
+
activeImageHosts = hosts;
|
|
228
|
+
try {
|
|
229
|
+
return DOMPurify.sanitize(html, DOMPURIFY_CONFIG);
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
activeImageHosts = undefined;
|
|
233
|
+
}
|
|
203
234
|
}
|
|
204
|
-
function parseBlockquotes(html) {
|
|
235
|
+
function parseBlockquotes(html, tag) {
|
|
205
236
|
const lines = html.split('\n');
|
|
206
237
|
const out = [];
|
|
207
238
|
let i = 0;
|
|
@@ -212,7 +243,7 @@ function parseBlockquotes(html) {
|
|
|
212
243
|
quote.push(lines[i].replace(/^\s*>+\s?/, ''));
|
|
213
244
|
i += 1;
|
|
214
245
|
}
|
|
215
|
-
out.push(
|
|
246
|
+
out.push(`${tag('<blockquote class="agent-blockquote">')}${quote.join(tag('<br>'))}${tag('</blockquote>')}`);
|
|
216
247
|
continue;
|
|
217
248
|
}
|
|
218
249
|
out.push(lines[i]);
|
|
@@ -241,36 +272,36 @@ function parseItem(line) {
|
|
|
241
272
|
};
|
|
242
273
|
return null;
|
|
243
274
|
}
|
|
244
|
-
function buildList(items, start, indent) {
|
|
275
|
+
function buildList(items, start, indent, tag) {
|
|
245
276
|
const first = items[start];
|
|
246
277
|
const startAttr = first.type === 'ol' && first.start !== 1 ? ` start="${first.start}"` : '';
|
|
247
|
-
let html = `<${first.type}${startAttr}${first.task !== undefined ? ' class="agent-tasklist"' : ''}
|
|
278
|
+
let html = tag(`<${first.type}${startAttr}${first.task !== undefined ? ' class="agent-tasklist"' : ''}>`);
|
|
248
279
|
let i = start;
|
|
249
280
|
while (i < items.length && items[i].indent >= indent) {
|
|
250
281
|
const item = items[i];
|
|
251
282
|
if (item.indent > indent) {
|
|
252
|
-
const nested = buildList(items, i, item.indent);
|
|
283
|
+
const nested = buildList(items, i, item.indent, tag);
|
|
253
284
|
html += nested.html;
|
|
254
285
|
i = nested.end;
|
|
255
286
|
continue;
|
|
256
287
|
}
|
|
257
288
|
const box = item.task === undefined
|
|
258
289
|
? ''
|
|
259
|
-
: `<input type="checkbox" disabled${item.task ? ' checked' : ''}
|
|
290
|
+
: `${tag(`<input type="checkbox" disabled${item.task ? ' checked aria-label="Done"' : ' aria-label="Not done"'}>`)} `;
|
|
260
291
|
if (i + 1 < items.length && items[i + 1].indent > indent) {
|
|
261
|
-
html +=
|
|
262
|
-
const nested = buildList(items, i + 1, items[i + 1].indent);
|
|
263
|
-
html += `${nested.html}</li
|
|
292
|
+
html += `${tag('<li>')}${box}${item.content}`;
|
|
293
|
+
const nested = buildList(items, i + 1, items[i + 1].indent, tag);
|
|
294
|
+
html += `${nested.html}${tag('</li>')}`;
|
|
264
295
|
i = nested.end;
|
|
265
296
|
}
|
|
266
297
|
else {
|
|
267
|
-
html +=
|
|
298
|
+
html += `${tag('<li>')}${box}${item.content}${tag('</li>')}`;
|
|
268
299
|
i += 1;
|
|
269
300
|
}
|
|
270
301
|
}
|
|
271
|
-
return { html: `${html}
|
|
302
|
+
return { html: `${html}${tag(`</${first.type}>`)}`, end: i };
|
|
272
303
|
}
|
|
273
|
-
function parseLists(html) {
|
|
304
|
+
function parseLists(html, tag) {
|
|
274
305
|
const lines = html.split('\n');
|
|
275
306
|
const out = [];
|
|
276
307
|
let i = 0;
|
|
@@ -295,7 +326,7 @@ function parseLists(html) {
|
|
|
295
326
|
else
|
|
296
327
|
break;
|
|
297
328
|
}
|
|
298
|
-
out.push(buildList(items, 0, item.indent).html);
|
|
329
|
+
out.push(buildList(items, 0, item.indent, tag).html);
|
|
299
330
|
}
|
|
300
331
|
return out.join('\n');
|
|
301
332
|
}
|
|
@@ -306,7 +337,7 @@ const cells = (line) => line
|
|
|
306
337
|
.replace(/\|$/, '')
|
|
307
338
|
.split('|')
|
|
308
339
|
.map((c) => c.trim());
|
|
309
|
-
function parseTables(html) {
|
|
340
|
+
function parseTables(html, tag) {
|
|
310
341
|
const lines = html.split('\n');
|
|
311
342
|
const out = [];
|
|
312
343
|
let i = 0;
|
|
@@ -320,9 +351,11 @@ function parseTables(html) {
|
|
|
320
351
|
rows.push(cells(lines[j]));
|
|
321
352
|
j += 1;
|
|
322
353
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
354
|
+
const cell = (name, c) => `${tag(`<${name}>`)}${c}${tag(`</${name}>`)}`;
|
|
355
|
+
const row = (r, name) => `${tag('<tr>')}${r.map((c) => cell(name, c)).join('')}${tag('</tr>')}`;
|
|
356
|
+
out.push(`${TABLE_OPEN}${tag('<table class="agent-table"><thead>')}${row(header, 'th')}${tag('</thead><tbody>')}${rows
|
|
357
|
+
.map((r) => row(r, 'td'))
|
|
358
|
+
.join('')}${tag('</tbody></table>')}${TABLE_CLOSE}`);
|
|
326
359
|
i = j;
|
|
327
360
|
continue;
|
|
328
361
|
}
|
package/dist/reducer.d.ts
CHANGED
|
@@ -80,6 +80,12 @@ export interface AssistantMessage {
|
|
|
80
80
|
mode?: BackendMode;
|
|
81
81
|
/** The user's rating of this answer, when given. */
|
|
82
82
|
feedback?: TurnRating;
|
|
83
|
+
/**
|
|
84
|
+
* Internal: the stored turn this request was sent to replace (regenerate, edit, retry). Kept
|
|
85
|
+
* only until the runtime accepts the request (`start`); a retry of a request that never
|
|
86
|
+
* started replaces this turn instead of the never-stored request.
|
|
87
|
+
*/
|
|
88
|
+
replaces?: string;
|
|
83
89
|
createdAt: number;
|
|
84
90
|
}
|
|
85
91
|
export type ChatMessage = UserMessage | AssistantMessage;
|
|
@@ -92,6 +98,11 @@ export declare function newUserMessage(requestId: string, text: string, options?
|
|
|
92
98
|
export declare function describeContext(context: DocumentContext): string;
|
|
93
99
|
/** Fold one stream event into the assistant message it belongs to. Returns a new object. */
|
|
94
100
|
export declare function applyEvent(message: AssistantMessage, event: ChatEvent): AssistantMessage;
|
|
101
|
+
/**
|
|
102
|
+
* Whether Continue can carry on this answer: it was cut short (output limit) or stopped, and has
|
|
103
|
+
* text. A dropped connection or an error is retried instead.
|
|
104
|
+
*/
|
|
105
|
+
export declare function isContinuable(message: AssistantMessage): boolean;
|
|
95
106
|
/**
|
|
96
107
|
* Prepare a retry of the turn `requestId`: returns the user message to resend and the transcript
|
|
97
108
|
* without that turn (its user message and the failed assistant reply), so the retried turn
|
package/dist/reducer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/lib/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,UAAU,EACV,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACX,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MA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ACvB,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG,SAAS,CAOxD;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAkBxD;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/reducer.js
CHANGED
|
@@ -35,8 +35,12 @@ export function describeContext(context) {
|
|
|
35
35
|
/** Fold one stream event into the assistant message it belongs to. Returns a new object. */
|
|
36
36
|
export function applyEvent(message, event) {
|
|
37
37
|
switch (event.type) {
|
|
38
|
-
case 'start':
|
|
39
|
-
|
|
38
|
+
case 'start': {
|
|
39
|
+
const next = { ...message, mode: event.mode };
|
|
40
|
+
// Accepted: the runtime has removed the replaced turn and stored this one.
|
|
41
|
+
delete next.replaces;
|
|
42
|
+
return next;
|
|
43
|
+
}
|
|
40
44
|
case 'delta':
|
|
41
45
|
return { ...message, text: message.text + event.text };
|
|
42
46
|
case 'proposal':
|
|
@@ -145,6 +149,9 @@ export function applyEvent(message, event) {
|
|
|
145
149
|
calls: message.usage.calls + 1,
|
|
146
150
|
},
|
|
147
151
|
};
|
|
152
|
+
case 'client_call':
|
|
153
|
+
// Answered by the session against the live page; nothing to show in the transcript.
|
|
154
|
+
return message;
|
|
148
155
|
case 'error':
|
|
149
156
|
return {
|
|
150
157
|
...message,
|
|
@@ -165,6 +172,15 @@ export function applyEvent(message, event) {
|
|
|
165
172
|
};
|
|
166
173
|
}
|
|
167
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Whether Continue can carry on this answer: it was cut short (output limit) or stopped, and has
|
|
177
|
+
* text. A dropped connection or an error is retried instead.
|
|
178
|
+
*/
|
|
179
|
+
export function isContinuable(message) {
|
|
180
|
+
return ((message.status === 'incomplete' || message.status === 'cancelled') &&
|
|
181
|
+
(message.finishReason === 'length' || message.finishReason === 'cancelled') &&
|
|
182
|
+
!!message.text);
|
|
183
|
+
}
|
|
168
184
|
/**
|
|
169
185
|
* Prepare a retry of the turn `requestId`: returns the user message to resend and the transcript
|
|
170
186
|
* without that turn (its user message and the failed assistant reply), so the retried turn
|
package/dist/session.svelte.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface ChatSessionOptions {
|
|
|
22
22
|
conversationId: string | null;
|
|
23
23
|
status: string;
|
|
24
24
|
}) => void;
|
|
25
|
+
/**
|
|
26
|
+
* After Stop, how long to keep reading the stream for the runtime's `done` (so text the agent
|
|
27
|
+
* produced before the cancel landed still shows) before giving up locally. Default 3000 ms.
|
|
28
|
+
*/
|
|
29
|
+
cancelGraceMs?: number;
|
|
25
30
|
}
|
|
26
31
|
export type SessionStatus = 'idle' | 'loading' | 'streaming';
|
|
27
32
|
/**
|
|
@@ -45,13 +50,35 @@ export declare class ChatSession {
|
|
|
45
50
|
bytes: number;
|
|
46
51
|
status: "uploaded" | "indexed" | "failed";
|
|
47
52
|
}[];
|
|
53
|
+
/** The unsent composer text, kept here so it survives the view being remounted. */
|
|
54
|
+
draft: string;
|
|
48
55
|
private controller;
|
|
49
56
|
/** The request being streamed; differs from the shown answer's id while continuing it. */
|
|
50
57
|
private streamRequestId;
|
|
58
|
+
/** Set once Stop was pressed for the running stream (the server cancel is on its way). */
|
|
59
|
+
private cancelling;
|
|
60
|
+
private cancelTimer;
|
|
61
|
+
/** Bumped by each load and reset, so a superseded load drops its result. */
|
|
62
|
+
private loadToken;
|
|
51
63
|
private readonly options;
|
|
64
|
+
private readonly listeners;
|
|
52
65
|
constructor(options: ChatSessionOptions);
|
|
66
|
+
/**
|
|
67
|
+
* Observe this session's stream events for as long as a view needs them. A session can
|
|
68
|
+
* outlive the component showing it (a host moving the chat between surfaces), so views
|
|
69
|
+
* subscribe instead of owning the `onEvent` option. Returns the unsubscribe.
|
|
70
|
+
*/
|
|
71
|
+
subscribe(listener: (event: ChatEvent) => void): () => void;
|
|
53
72
|
get streaming(): boolean;
|
|
54
73
|
get current(): AssistantMessage | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Forget the current conversation (the host started a new chat): stops reading a running
|
|
76
|
+
* stream without cancelling it on the server (the turn finishes there and stays in its
|
|
77
|
+
* conversation) and clears the transcript.
|
|
78
|
+
*/
|
|
79
|
+
reset(): void;
|
|
80
|
+
/** Stop reading the running stream, if any; its `run` then leaves the session alone. */
|
|
81
|
+
private detach;
|
|
55
82
|
/** Load an existing conversation's transcript and re-attach to a running turn if any. */
|
|
56
83
|
load(conversationId: string): Promise<void>;
|
|
57
84
|
/**
|
|
@@ -67,6 +94,11 @@ export declare class ChatSession {
|
|
|
67
94
|
* in the view and in the runtime's transcript, rather than duplicated.
|
|
68
95
|
*/
|
|
69
96
|
retry(requestId: string): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* The stored turn a resend of `requestId` replaces: the request itself once the runtime
|
|
99
|
+
* accepted it, else the turn that request was meant to replace (the runtime never stored it).
|
|
100
|
+
*/
|
|
101
|
+
private replacesFor;
|
|
70
102
|
/** Ask again for a new answer to the latest question, replacing the current one. */
|
|
71
103
|
regenerate(requestId: string): Promise<void>;
|
|
72
104
|
/** Change the latest question and answer it again, replacing that turn. */
|
|
@@ -84,8 +116,16 @@ export declare class ChatSession {
|
|
|
84
116
|
* runtime refuses it.
|
|
85
117
|
*/
|
|
86
118
|
rate(requestId: string, rating: TurnRating | null, comment?: string): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Stop the running answer. The runtime is asked to cancel and the stream is read on until its
|
|
121
|
+
* `done`, so text produced before the cancel landed still shows (and a later Continue appends
|
|
122
|
+
* after it); after `cancelGraceMs` the stream is dropped locally. The answer shows as stopped
|
|
123
|
+
* at once.
|
|
124
|
+
*/
|
|
87
125
|
cancel(): void;
|
|
88
126
|
private run;
|
|
127
|
+
/** The turn's stream is over: restore a failed continuation, go idle, tell the host. */
|
|
128
|
+
private finish;
|
|
89
129
|
private toolName;
|
|
90
130
|
private update;
|
|
91
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.svelte.d.ts","sourceRoot":"","sources":["../src/lib/session.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EAET,UAAU,EACV,eAAe,EACf,OAAO,EACP,UAAU,EACX,MAAM,gCAAgC,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"session.svelte.d.ts","sourceRoot":"","sources":["../src/lib/session.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EAET,UAAU,EACV,eAAe,EACf,OAAO,EACP,UAAU,EACX,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mGAAmG;IACnG,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IACtD,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,SAAS,E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