@aparte/core 1.8.0 → 1.10.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/client/agent-runner.d.ts +8 -3
- package/dist/client/agent-runner.d.ts.map +1 -1
- package/dist/client/aparte-client.d.ts +48 -11
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/client/stream-adapter.d.ts +5 -0
- package/dist/client/stream-adapter.d.ts.map +1 -1
- package/dist/client/wire-history.d.ts +21 -1
- package/dist/client/wire-history.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +13 -3
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +64 -0
- package/dist/components/chat/aparte-chat.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-action.d.ts +2 -1
- package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-add-attachment.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-input.d.ts +3 -1
- package/dist/components/composer/aparte-composer-input.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-send.d.ts +11 -0
- package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer.d.ts +2 -1
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/context/aparte-context.d.ts +1 -1
- package/dist/components/context/aparte-context.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +43 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
- package/dist/components/conversation-list/index.d.ts +1 -1
- package/dist/components/conversation-list/index.d.ts.map +1 -1
- package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/launcher/aparte-launcher.d.ts.map +1 -1
- package/dist/components/scroll-rail/aparte-scroll-rail.d.ts +1 -1
- package/dist/components/scroll-rail/aparte-scroll-rail.d.ts.map +1 -1
- package/dist/components/sidebar/aparte-sidebar.d.ts +14 -1
- package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
- package/dist/components/split/aparte-split.d.ts +1 -1
- package/dist/components/split/aparte-split.d.ts.map +1 -1
- package/dist/components/suggestions/aparte-suggestions.d.ts +3 -2
- package/dist/components/suggestions/aparte-suggestions.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +3 -0
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +108 -13
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/link-target.d.ts +39 -0
- package/dist/config/link-target.d.ts.map +1 -0
- package/dist/config/sanitize.d.ts +22 -3
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/step-label.d.ts +22 -0
- package/dist/config/step-label.d.ts.map +1 -0
- package/dist/context/checkpoint-state.d.ts +0 -7
- package/dist/context/checkpoint-state.d.ts.map +1 -1
- package/dist/context/measure.d.ts +3 -1
- package/dist/context/measure.d.ts.map +1 -1
- package/dist/conversations/conversation-controller.d.ts +56 -0
- package/dist/conversations/conversation-controller.d.ts.map +1 -1
- package/dist/conversations/open-conversation.d.ts +28 -0
- package/dist/conversations/open-conversation.d.ts.map +1 -0
- package/dist/custom-elements.json +1969 -335
- package/dist/{defer-hydration-BE2ToXC_.js → defer-hydration-OFqdbk3O.js} +991 -299
- package/dist/defer-hydration-OFqdbk3O.js.map +1 -0
- package/dist/elicitation/approval-panel.d.ts +1 -1
- package/dist/elicitation/approval-panel.d.ts.map +1 -1
- package/dist/elicitation/option-keys.d.ts +26 -0
- package/dist/elicitation/option-keys.d.ts.map +1 -0
- package/dist/elicitation/types.d.ts +16 -0
- package/dist/elicitation/types.d.ts.map +1 -1
- package/dist/generated/element-attributes.d.ts +13 -6
- package/dist/generated/element-attributes.d.ts.map +1 -1
- package/dist/{glyphs-LolG04CC.js → glyphs-BgKFtByg.js} +10 -10
- package/dist/{glyphs-LolG04CC.js.map → glyphs-BgKFtByg.js.map} +1 -1
- package/dist/host/aparte-chat-host.d.ts +42 -1
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/icons/extended.d.ts +9 -0
- package/dist/icons/extended.d.ts.map +1 -1
- package/dist/icons.js +20 -11
- package/dist/icons.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +310 -197
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +8 -3
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +61 -58
- package/dist/index.node.js.map +1 -1
- package/dist/interop/chat-events.d.ts +64 -0
- package/dist/interop/chat-events.d.ts.map +1 -0
- package/dist/interop/element-props.d.ts +6 -0
- package/dist/interop/element-props.d.ts.map +1 -1
- package/dist/interop/element-spec.d.ts +85 -0
- package/dist/interop/element-spec.d.ts.map +1 -0
- package/dist/primitives/progress-spinner/aparte-progress-spinner.d.ts +1 -1
- package/dist/primitives/progress-spinner/aparte-progress-spinner.d.ts.map +1 -1
- package/dist/primitives/select/aparte-option.d.ts +1 -1
- package/dist/primitives/select/aparte-option.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts.map +1 -1
- package/dist/renderers/citations.d.ts.map +1 -1
- package/dist/transport/agent-handler.d.ts +14 -4
- package/dist/transport/agent-handler.d.ts.map +1 -1
- package/dist/types/element-attributes.d.ts +5 -2
- package/dist/types/element-attributes.d.ts.map +1 -1
- package/dist/types/events.d.ts +15 -13
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/imperative-api.d.ts +26 -0
- package/dist/types/imperative-api.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/models.d.ts +26 -0
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/segments.d.ts +2 -1
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +60 -5
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/segments.d.ts +1 -0
- package/dist/utils/segments.d.ts.map +1 -1
- package/dist/utils/tool-line.d.ts +9 -8
- package/dist/utils/tool-line.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/defer-hydration-BE2ToXC_.js.map +0 -1
package/dist/config/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type { AparteConfigAware } from './config-context.js';
|
|
|
5
5
|
export type { AparteConfigChangeEventDetail, AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteCodeLanguageRenderer, AparteCodeLanguageContext, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteModelPreference, AparteModelPreferenceProvider } from './aparte-config.js';
|
|
6
6
|
export type { AparteSanitizer } from './sanitize.js';
|
|
7
7
|
export type { AparteImageDecision, AparteImagePolicy } from './image-policy.js';
|
|
8
|
+
export type { AparteLinkDecision, AparteLinkTarget } from './link-target.js';
|
|
8
9
|
export { defaultSanitizer, isSafeUrl } from './sanitize.js';
|
|
9
10
|
export type { AparteIconProvider, AparteIconName, AparteCoreIconName } from './icon-provider.js';
|
|
10
11
|
export { APARTE_DEFAULT_ICON_FALLBACKS } from './icon-provider.js';
|
|
@@ -15,6 +16,7 @@ export type { AparteAttachmentRenderer } from './attachment-renderer.js';
|
|
|
15
16
|
export type { AparteElicitationFieldRenderer, AparteElicitationFieldContext, AparteElicitationFieldControl, } from './elicitation-field-renderer.js';
|
|
16
17
|
export type { AparteSiblingNavRenderer } from './sibling-nav-renderer.js';
|
|
17
18
|
export type { AparteBubbleShellRenderer } from './bubble-shell-renderer.js';
|
|
19
|
+
export type { AparteStepLabel, AparteStepLabelContext } from './step-label.js';
|
|
18
20
|
export type { AparteLocale, AparteLocaleExtensions } from './locale.js';
|
|
19
21
|
export { APARTE_DEFAULT_LOCALE } from './locale.js';
|
|
20
22
|
export type { AparteAction, AparteActionZone } from './action-provider.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtJ,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKhI,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACpF,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACxU,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC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AAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EACR,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,GAChC,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Where the links a reply holds open: every one in a new tab, or only the ones to another site. */
|
|
2
|
+
export type AparteLinkTarget = 'new-tab' | 'external-only';
|
|
3
|
+
/**
|
|
4
|
+
* What a link drawn by hand sets: `{ target: '_blank', rel: 'noopener noreferrer' }`, a new tab
|
|
5
|
+
* that cannot reach back, or `{}`, the page itself.
|
|
6
|
+
*/
|
|
7
|
+
export interface AparteLinkDecision {
|
|
8
|
+
readonly target?: '_blank';
|
|
9
|
+
readonly rel?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The `target` and `rel` a link to `href` gets under `mode`, `wish` being the `target` its markup
|
|
13
|
+
* asked for: a new tab, unless the mode is `'external-only'` or the link stays in the page or
|
|
14
|
+
* hands over to another app, which get the sanitizer's clamp.
|
|
15
|
+
*/
|
|
16
|
+
export declare function linkTargetAttributes(mode: AparteLinkTarget, href: string, wish: string): ReadonlyArray<[string, string]>;
|
|
17
|
+
/** What a link to `href` sets under `mode`, asked for no target of its own: what `decideLink` answers. */
|
|
18
|
+
export declare function linkDecision(mode: AparteLinkTarget, href: string): AparteLinkDecision;
|
|
19
|
+
/**
|
|
20
|
+
* Apply the link target to sanitized HTML. Every `<a href>` gets the `target`
|
|
21
|
+
* `linkTargetAttributes` decides from its address and the target it carries; one that opens a
|
|
22
|
+
* new tab also gets `rel` holding what it had plus `noopener noreferrer` (never `opener`), and
|
|
23
|
+
* one that stays in the page keeps its `rel` as written. Both are written after its other
|
|
24
|
+
* attributes so both paths build the same tree. HTML with nothing to
|
|
25
|
+
* change comes back as it came: serialized again, it would be rewritten where the pass changed
|
|
26
|
+
* nothing, and `'external-only'` over the built-in sanitizer changes nothing at all.
|
|
27
|
+
*
|
|
28
|
+
* In a browser it walks an inert `<template>`; without a DOM it reads the tags the way the
|
|
29
|
+
* sanitizer's own DOM-free path does.
|
|
30
|
+
*/
|
|
31
|
+
export declare function applyLinkTarget(html: string, mode: AparteLinkTarget): string;
|
|
32
|
+
/**
|
|
33
|
+
* The same pass for a runtime with no DOM (a server render, a Worker). Like the sanitizer's
|
|
34
|
+
* DOM-free path it is a safety net, not a parser: it reads tags with the sanitizer's own reader,
|
|
35
|
+
* leaves comments and raw-text elements alone, and writes back only the tags it changed.
|
|
36
|
+
* Exported for the parity suite; not from the package barrel.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyLinkTargetWithoutDom(html: string, mode: AparteLinkTarget): string;
|
|
39
|
+
//# sourceMappingURL=link-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-target.d.ts","sourceRoot":"","sources":["../../src/config/link-target.ts"],"names":[],"mappings":"AAsBA,oGAAoG;AACpG,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,eAAe,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAGxH;AAED,0GAA0G;AAC1G,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAGrF;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAG5E;AAgFD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAkCtF"}
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
* Registering DOMPurify alone replaces this one, and its defaults keep what a
|
|
18
18
|
* chat must refuse — measured on DOMPurify 3.4: inline layout styles, `aparte-`
|
|
19
19
|
* classes, `--aparte-*` properties, `<form>`/`<button>`, a password `<input>`,
|
|
20
|
-
* `id
|
|
20
|
+
* and `id`. Where a link opens is not one of them: `AparteConfig.sanitizeHtml` applies
|
|
21
|
+
* the link target (`link-target.ts`) and the image policy after whichever sanitizer is
|
|
22
|
+
* set, since DOMPurify drops `target` and an external link then navigated the chat's frame.
|
|
21
23
|
*/
|
|
22
24
|
export type AparteSanitizer = (html: string) => string;
|
|
23
25
|
/**
|
|
@@ -29,6 +31,12 @@ export type AparteSanitizer = (html: string) => string;
|
|
|
29
31
|
* a contract.
|
|
30
32
|
*/
|
|
31
33
|
export declare const DANGEROUS_TAGS: Set<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Whitespace + C0 control chars, used to obfuscate a scheme (e.g. " javascript:" or "java\tscript:").
|
|
36
|
+
* Exported for the link target's pass (`link-target.ts`), which reads an address the same way; not
|
|
37
|
+
* from the package barrel.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CONTROL_WS: RegExp;
|
|
32
40
|
/**
|
|
33
41
|
* The attributes core READS, as a command or as a boundary, on an element it finds by
|
|
34
42
|
* walking the DOM: a delegated click listener (`data-aparte-dialog-open`, the sidebar
|
|
@@ -51,6 +59,16 @@ export declare const RESERVED_ATTRIBUTE_PREFIXES: string[];
|
|
|
51
59
|
/** True when `name` (lower case) is an attribute core reads, so model markup may not carry it. */
|
|
52
60
|
export declare function isReservedAttribute(name: string): boolean;
|
|
53
61
|
export declare function isSafeUrl(value: string, tag: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The `target` and `rel` an `<a>` gets. The model's `target` is read as a WISH and clamped;
|
|
64
|
+
* `rel` is never copied. `href` is the one that was kept ('' when it was dropped).
|
|
65
|
+
*
|
|
66
|
+
* This is the floor, and the whole of `setLinkTarget('external-only')`: the config's link pass
|
|
67
|
+
* (`link-target.ts`) applies it again after whichever sanitizer is set, and under the default,
|
|
68
|
+
* `'new-tab'`, opens a same-site link in a new tab on top of it. Exported for that pass; not
|
|
69
|
+
* from the package barrel.
|
|
70
|
+
*/
|
|
71
|
+
export declare function linkAttributes(href: string, targetWish: string): Array<[string, string]>;
|
|
54
72
|
/**
|
|
55
73
|
* One tag read from `nameAt` (the first letter of its name) the way a browser's tokenizer reads
|
|
56
74
|
* it: a quote ends where its match is, an unquoted value at a space or `>`, `/` and a closing
|
|
@@ -58,8 +76,9 @@ export declare function isSafeUrl(value: string, tag: string): boolean;
|
|
|
58
76
|
* entities that can spell a checked character decoded. `end` is the index past its `>`, or `-1`
|
|
59
77
|
* when the text ends inside the tag.
|
|
60
78
|
*
|
|
61
|
-
* Exported for the
|
|
62
|
-
* tags in the same text this scrub wrote; not
|
|
79
|
+
* Exported for the DOM-free passes of the image policy (`image-policy.ts`) and the link target
|
|
80
|
+
* (`link-target.ts`), which have to find the same tags in the same text this scrub wrote; not
|
|
81
|
+
* from the package barrel.
|
|
63
82
|
*/
|
|
64
83
|
export declare function readTag(html: string, nameAt: number): {
|
|
65
84
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,aAKzB,CAAC;AA8DH;;;;GAIG;AAEH,eAAO,MAAM,UAAU,QAAsB,CAAC;AAoC9C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,aAM9B,CAAC;AAEH,6GAA6G;AAC7G,eAAO,MAAM,2BAA2B,UAAsE,CAAC;AAE/G,kGAAkG;AAClG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAqDD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7D;AA4HD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0BxF;AAoID;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAoClH;AAgFD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAY9B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a step is called on screen: the words shown for the name a run announced.
|
|
3
|
+
*
|
|
4
|
+
* A server that streams `step-start { name }` sends a stable key (`slot-wait`, `restore`,
|
|
5
|
+
* `reread`), and the page knows the person's language. The app maps one to the other with
|
|
6
|
+
* {@link AparteConfig.registerStepLabel}; core never makes a label up.
|
|
7
|
+
*/
|
|
8
|
+
import type { AparteLocale } from './locale.js';
|
|
9
|
+
/** What a step label function is told when the page asks for its words. */
|
|
10
|
+
export interface AparteStepLabelContext {
|
|
11
|
+
/** The step's name, as the run announced it: the key the label stands for. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The config's locale as it is now. The function is asked again when the locale changes. */
|
|
14
|
+
locale: AparteLocale;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The words shown for a step: plain text, never HTML — or a function of the locale, asked at
|
|
18
|
+
* every draw, so a language switch changes what a step that is open says. A label that says
|
|
19
|
+
* nothing, or a function that throws, leaves the name itself.
|
|
20
|
+
*/
|
|
21
|
+
export type AparteStepLabel = string | ((context: AparteStepLabelContext) => string);
|
|
22
|
+
//# sourceMappingURL=step-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-label.d.ts","sourceRoot":"","sources":["../../src/config/step-label.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,2EAA2E;AAC3E,MAAM,WAAW,sBAAsB;IACnC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,MAAM,EAAE,YAAY,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,MAAM,CAAC,CAAC"}
|
|
@@ -18,13 +18,6 @@ export interface CheckpointWatcherOptions {
|
|
|
18
18
|
*/
|
|
19
19
|
active?(): boolean;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* The id of the chat `el` belongs to: the nearest `<aparte-chat>` or `[data-aparte-chat]`
|
|
23
|
-
* above it that HAS one, `undefined` for an unnamed chat. The same climb the bubble, the
|
|
24
|
-
* composer and the gauge make for their own events, so an event naming a chat and an element
|
|
25
|
-
* answering for it agree about which is which.
|
|
26
|
-
*/
|
|
27
|
-
export declare function chatIdOf(el: Element): string | undefined;
|
|
28
21
|
/**
|
|
29
22
|
* Says on the bubble what a compaction is doing to the message it will sit on.
|
|
30
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-state.d.ts","sourceRoot":"","sources":["../../src/context/checkpoint-state.ts"],"names":[],"mappings":"AAMA,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACrC,iGAAiG;IACjG,KAAK,IAAI,MAAM,GAAG,SAAS,CAAC;IAC5B,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAChD;;;;;OAKG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC;;;;OAIG;IACH,MAAM,CAAC,IAAI,OAAO,CAAC;CACtB;AAED
|
|
1
|
+
{"version":3,"file":"checkpoint-state.d.ts","sourceRoot":"","sources":["../../src/context/checkpoint-state.ts"],"names":[],"mappings":"AAMA,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACrC,iGAAiG;IACjG,KAAK,IAAI,MAAM,GAAG,SAAS,CAAC;IAC5B,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAChD;;;;;OAKG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC;;;;OAIG;IACH,MAAM,CAAC,IAAI,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,sBAAsB;IAOnB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IANrC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,OAAO,CAAM;IACrB,iHAAiH;IACjH,OAAO,CAAC,OAAO,CAA4B;gBAEd,QAAQ,EAAE,wBAAwB;IAE/D,gFAAgF;IAChF,KAAK,IAAI,MAAM,IAAI;IA4CnB,mDAAmD;IACnD,KAAK,IAAI,IAAI;IAYb,qFAAqF;IACrF,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,MAAM;CAejB"}
|
|
@@ -43,7 +43,9 @@ export declare function estimateRequestTokens(request: {
|
|
|
43
43
|
* The estimate of what the wire sends for these messages: the same serialisation the
|
|
44
44
|
* client builds its history with (`wireMessages`) — a reply's thinking is not sent, its
|
|
45
45
|
* text is, and a tool call and its result count as the envelope and the `tool` message
|
|
46
|
-
* the wire carries. A failed
|
|
46
|
+
* the wire carries. A failed reply and one still in flight send nothing, and neither does a
|
|
47
|
+
* message whose reply failed for good (`withoutAbandonedTurns`); one whose reply failed on
|
|
48
|
+
* the network is counted, since it goes with the next message.
|
|
47
49
|
*
|
|
48
50
|
* Not `estimateTokens(message.content)`: assistant replies keep their text in
|
|
49
51
|
* `segments` with `content` empty, so that sum would read a whole conversation as free.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/context/measure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,WAAW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,MAAM,GAAG,SAAS,CAIjG;AAkCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,yBAAyB,GAAG,oBAAoB,CAmCrF"}
|
|
@@ -76,6 +76,8 @@ export interface AparteConversationControllerOptions {
|
|
|
76
76
|
* - Lazily create a conversation on the first user `aparte-send` if none active.
|
|
77
77
|
* - Persist updates triggered by `aparte-path-changed` (branch nav, retry, edit).
|
|
78
78
|
* - Dispatch `aparte-abort` when the active conversation changes mid-stream.
|
|
79
|
+
* - Leave the open conversation readable on the host while bound, so `AparteClient` can say
|
|
80
|
+
* which conversation each turn belongs to (`StreamRunOptions.conversationId`).
|
|
79
81
|
*
|
|
80
82
|
* Usage:
|
|
81
83
|
* ```ts
|
|
@@ -93,6 +95,11 @@ export declare class AparteConversationController {
|
|
|
93
95
|
private _isStreaming;
|
|
94
96
|
private _isLoadingConversation;
|
|
95
97
|
private _ensureInFlight;
|
|
98
|
+
/**
|
|
99
|
+
* The conversation this chat's first message is creating, from the moment `createNew()`
|
|
100
|
+
* is called until it resolves — see {@link pendingId}.
|
|
101
|
+
*/
|
|
102
|
+
private _pendingId;
|
|
96
103
|
/** The conversation the turn in flight started in, and what the lists were told of it. */
|
|
97
104
|
private _turn;
|
|
98
105
|
/** The reply the turn in flight writes into, from its `aparte-message-start`. */
|
|
@@ -123,6 +130,27 @@ export declare class AparteConversationController {
|
|
|
123
130
|
constructor(binding: AparteChatBinding, options?: AparteConversationControllerOptions);
|
|
124
131
|
/** The current active conversation id (null when none selected). */
|
|
125
132
|
get activeId(): string | null;
|
|
133
|
+
/**
|
|
134
|
+
* The conversation this chat's first message is creating, while it is being created:
|
|
135
|
+
* set when the send calls `createNew()`, `null` again once {@link activeId} holds it.
|
|
136
|
+
*
|
|
137
|
+
* It is this chat's own, whatever the manager says. The manager has ONE `activeId`,
|
|
138
|
+
* which every chat on it writes when it opens or creates a conversation; with two chats
|
|
139
|
+
* it names the one that moved last. A wrapper that is handed this id back — through
|
|
140
|
+
* `onConversationCreated`, or bound to the manager's `activeId`, which changes before
|
|
141
|
+
* the creation resolves — knows from it that the chat already shows that conversation.
|
|
142
|
+
*/
|
|
143
|
+
get pendingId(): string | null;
|
|
144
|
+
/**
|
|
145
|
+
* The conversation a message sent now belongs to: the open one, or — for the first
|
|
146
|
+
* message of a chat — the one that send is creating. The client hears the send right
|
|
147
|
+
* after this controller does, so the creation has already started and its id is known
|
|
148
|
+
* ({@link pendingId}); this controller's own id follows once the conversation is saved.
|
|
149
|
+
* `_ensureConversationAndPersist` reads the same two places to decide where the message
|
|
150
|
+
* is saved, so a turn is carried to the conversation its message was written in. Never
|
|
151
|
+
* the manager's `activeId`: that may be another chat's conversation.
|
|
152
|
+
*/
|
|
153
|
+
private _openId;
|
|
126
154
|
/**
|
|
127
155
|
* Lazily resolve the conversation manager. Returns `undefined` if none is
|
|
128
156
|
* registered — the controller then runs in degraded mode: optimistic UI
|
|
@@ -131,6 +159,24 @@ export declare class AparteConversationController {
|
|
|
131
159
|
* conversation lifecycle yet.
|
|
132
160
|
*/
|
|
133
161
|
private _manager;
|
|
162
|
+
/**
|
|
163
|
+
* The manager a config change could not take the open conversation away from: the new
|
|
164
|
+
* config's manager does not hold it, or the new config has none. The chat keeps saving
|
|
165
|
+
* that conversation where it lives until it opens another — see {@link followConfig}.
|
|
166
|
+
*/
|
|
167
|
+
private _keptManager;
|
|
168
|
+
/** Release handle for a wait on a new manager still loading its list (see followConfig). */
|
|
169
|
+
private _stopConfigWait;
|
|
170
|
+
/**
|
|
171
|
+
* The chat was given another config (`AparteChatHost.setConfig`), and its conversation
|
|
172
|
+
* manager may be another one. Nothing on screen is lost either way:
|
|
173
|
+
* - the new manager holds the open conversation: it is opened again from there, and saved there;
|
|
174
|
+
* - it does not, or the new config has no manager: the chat keeps the manager it had for
|
|
175
|
+
* the conversation it shows, and goes on saving it there; the next conversation it
|
|
176
|
+
* opens comes from the new config.
|
|
177
|
+
* A manager still loading its list is waited for before it is asked.
|
|
178
|
+
*/
|
|
179
|
+
followConfig(): void;
|
|
134
180
|
/**
|
|
135
181
|
* Degraded mode is legitimate — a host that never opted into the conversation
|
|
136
182
|
* lifecycle has no manager and should not be nagged. Registering one on the
|
|
@@ -161,6 +207,8 @@ export declare class AparteConversationController {
|
|
|
161
207
|
* Attach event listeners to the binding host. Returns an unbind function.
|
|
162
208
|
*/
|
|
163
209
|
bind(): () => void;
|
|
210
|
+
/** Takes the open-conversation reader off the host (see `bind`). */
|
|
211
|
+
private _withdrawOpenConversation;
|
|
164
212
|
/** Detach event listeners. */
|
|
165
213
|
/** Release handle for the hydration-retry subscription (see setConversationId). */
|
|
166
214
|
private _stopHydrationRetry;
|
|
@@ -224,6 +272,14 @@ export declare class AparteConversationController {
|
|
|
224
272
|
*/
|
|
225
273
|
private _persistOnceSummarised;
|
|
226
274
|
private _persistActive;
|
|
275
|
+
/**
|
|
276
|
+
* The conversation the manager names as active, for a chat that has none: only when this
|
|
277
|
+
* controller is the one chat on that manager (an app that called `manager.createNew()`
|
|
278
|
+
* itself and never gave the id to the chat), and only an empty conversation, whose
|
|
279
|
+
* messages are in memory — a save from this chat must not write over messages it never
|
|
280
|
+
* showed. With several chats the manager's `activeId` names whichever moved last.
|
|
281
|
+
*/
|
|
282
|
+
private _adoptable;
|
|
227
283
|
private _ensureConversationAndPersist;
|
|
228
284
|
}
|
|
229
285
|
//# sourceMappingURL=conversation-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-controller.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-controller.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAkD,MAAM,mBAAmB,CAAC;AACvG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation-controller.d.ts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B;;;;OAIG;IACH,OAAO,CAAC,YAAY,CAA0C;IAC9D,4FAA4F;IAC5F,OAAO,CAAC,eAAe,CAA6B;IAEpD;;;;;;;;OAQG;IACH,YAAY,IAAI,IAAI;IAkCpB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,4BAA4B;IAWpC;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ;IAgBhB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;IACH,IAAI,IAAI,MAAM,IAAI;IAwJlB,oEAAoE;IACpE,OAAO,CAAC,yBAAyB,CAA6B;IAE9D,8BAA8B;IAC9B,mFAAmF;IACnF,OAAO,CAAC,mBAAmB,CAA6B;IAExD,MAAM,IAAI,IAAI;IA0Ed;;;;;;;;;;OAUG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBzD,oFAAoF;IACpF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,KAAK,SAAS,GAIpB;IAED,OAAO,CAAC,WAAW;IAWnB,gGAAgG;IAChG,OAAO,CAAC,YAAY;IAOpB,0DAA0D;IAC1D,OAAO,CAAC,UAAU;YAQJ,aAAa;IAc3B,OAAO,CAAC,aAAa;YAKP,iBAAiB;IA2L/B;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAUjB;;;;;;;;;OASG;IACH;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,cAAc;IA+BtB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;YAUJ,6BAA6B;CAmF9C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which conversation a chat has open, readable from outside the chat.
|
|
3
|
+
*
|
|
4
|
+
* The conversation controller is the one that knows: it opens, switches and creates a
|
|
5
|
+
* chat's conversation. `AparteClient` does not live in the chat, it lives beside it — it
|
|
6
|
+
* finds the element it renders into by id — so the controller leaves a reader on the
|
|
7
|
+
* chat's host element, and the client climbs from the element it renders into until it
|
|
8
|
+
* finds one.
|
|
9
|
+
*
|
|
10
|
+
* A symbol slot on the element, as `attachConfig` leaves an instance config: no attribute
|
|
11
|
+
* written into a DOM a framework owns, and no method on the element for an app to take as
|
|
12
|
+
* API. `Symbol.for`, so two copies of core on one page still agree on the slot.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Leave `read` on `host`, the chat's element, for {@link openConversationOf}. Returns what
|
|
16
|
+
* takes it away again — and only if it is still the one that was left, so the teardown of a
|
|
17
|
+
* controller a framework has already replaced on the same element undoes nothing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function offerOpenConversation(host: HTMLElement, read: () => string | null): () => void;
|
|
20
|
+
/**
|
|
21
|
+
* The id of the conversation open in the chat `el` is in, as of this moment — `null` when
|
|
22
|
+
* the chat has none open, or when nothing manages the chat's conversations at all.
|
|
23
|
+
*
|
|
24
|
+
* Read when the person acts, not before: it answers for now, and a conversation the person
|
|
25
|
+
* opens a moment later is another answer.
|
|
26
|
+
*/
|
|
27
|
+
export declare function openConversationOf(el: Element | null | undefined): string | null;
|
|
28
|
+
//# sourceMappingURL=open-conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-conversation.d.ts","sourceRoot":"","sources":["../../src/conversations/open-conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,MAAM,IAAI,CAM9F;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAMhF"}
|