@aparte/core 0.15.0 → 0.16.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/aparte-client.d.ts +53 -51
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/client/lifecycle-events.d.ts +0 -12
- package/dist/client/lifecycle-events.d.ts.map +1 -1
- package/dist/client/stream-adapter.d.ts +2 -12
- package/dist/client/stream-adapter.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +45 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts +0 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-send.d.ts +11 -11
- package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer.d.ts +20 -11
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/context/aparte-context.d.ts +31 -8
- package/dist/components/context/aparte-context.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +93 -36
- 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 +19 -1
- package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/scroll-rail/aparte-scroll-rail.d.ts +105 -0
- package/dist/components/scroll-rail/aparte-scroll-rail.d.ts.map +1 -0
- package/dist/components/scroll-rail/index.d.ts +3 -0
- package/dist/components/scroll-rail/index.d.ts.map +1 -0
- package/dist/components/sidebar/aparte-sidebar.d.ts +186 -0
- package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -0
- package/dist/components/sidebar/index.d.ts +3 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/split/aparte-split.d.ts +354 -0
- package/dist/components/split/aparte-split.d.ts.map +1 -0
- package/dist/components/split/geometry.d.ts +65 -0
- package/dist/components/split/geometry.d.ts.map +1 -0
- package/dist/components/split/index.d.ts +3 -0
- package/dist/components/split/index.d.ts.map +1 -0
- package/dist/components/suggestions/aparte-suggestions.d.ts +7 -1
- package/dist/components/suggestions/aparte-suggestions.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +52 -2
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +95 -33
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/icon-provider.d.ts +6 -0
- package/dist/config/icon-provider.d.ts.map +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/locale.d.ts +140 -27
- package/dist/config/locale.d.ts.map +1 -1
- package/dist/config/sanitize.d.ts +9 -0
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/conversations/conversation-controller.d.ts +13 -1
- package/dist/conversations/conversation-controller.d.ts.map +1 -1
- package/dist/conversations/conversation-manager.d.ts +9 -0
- package/dist/conversations/conversation-manager.d.ts.map +1 -1
- package/dist/custom-elements.json +9838 -7333
- package/dist/{is-awaiting-reply-BZ_iJ3s3.js → dialog-triggers-CVCxqKg3.js} +718 -1182
- package/dist/dialog-triggers-CVCxqKg3.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/panel.d.ts +24 -16
- package/dist/elicitation/panel.d.ts.map +1 -1
- package/dist/elicitation/types.d.ts +31 -0
- package/dist/elicitation/types.d.ts.map +1 -1
- package/dist/generated/element-attributes.d.ts +47 -1
- package/dist/generated/element-attributes.d.ts.map +1 -1
- package/dist/{glyphs-B3BZ2TIb.js → glyphs-DQTeOj4w.js} +22 -13
- package/dist/{glyphs-B3BZ2TIb.js.map → glyphs-DQTeOj4w.js.map} +1 -1
- package/dist/host/aparte-chat-host.d.ts +10 -2
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/icons/extended.d.ts +4 -2
- package/dist/icons/extended.d.ts.map +1 -1
- package/dist/icons/glyphs.d.ts +9 -0
- package/dist/icons/glyphs.d.ts.map +1 -1
- package/dist/icons.js +16 -15
- package/dist/icons.js.map +1 -1
- package/dist/index.css +1217 -396
- package/dist/index.d.ts +26 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2097 -295
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +21 -5
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +39 -34
- package/dist/index.node.js.map +1 -1
- package/dist/interop/dialog-triggers.d.ts +27 -0
- package/dist/interop/dialog-triggers.d.ts.map +1 -0
- package/dist/interop/element-props.d.ts +16 -8
- package/dist/interop/element-props.d.ts.map +1 -1
- package/dist/parsers/aparte-stream-parser.d.ts +52 -22
- package/dist/parsers/aparte-stream-parser.d.ts.map +1 -1
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts.map +1 -1
- package/dist/renderers/segment-renderers.d.ts.map +1 -1
- package/dist/renderers/segments/code.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/dist/runtime/message-repository.d.ts.map +1 -1
- package/dist/transport/backend-handler.d.ts.map +1 -1
- package/dist/transport/backend-transport.d.ts +6 -1
- package/dist/transport/backend-transport.d.ts.map +1 -1
- package/dist/types/chat.d.ts +8 -14
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/element-map.d.ts +54 -4
- package/dist/types/element-map.d.ts.map +1 -1
- package/dist/types/event-map.d.ts +16 -10
- package/dist/types/event-map.d.ts.map +1 -1
- package/dist/types/events.d.ts +59 -117
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/imperative-api.d.ts +3 -1
- package/dist/types/imperative-api.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/models.d.ts +11 -31
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/segments.d.ts +11 -47
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/stream-blocks.d.ts +57 -0
- package/dist/types/stream-blocks.d.ts.map +1 -0
- package/dist/types/tools.d.ts +57 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/copy-text.d.ts +24 -0
- package/dist/utils/copy-text.d.ts.map +1 -0
- package/dist/utils/css-escape.d.ts +5 -0
- package/dist/utils/css-escape.d.ts.map +1 -1
- package/dist/utils/tool-input.d.ts +20 -0
- package/dist/utils/tool-input.d.ts.map +1 -0
- package/package.json +10 -3
- package/dist/is-awaiting-reply-BZ_iJ3s3.js.map +0 -1
- package/dist/renderers/segments/artifact/binary-file.d.ts +0 -45
- package/dist/renderers/segments/artifact/binary-file.d.ts.map +0 -1
- package/dist/renderers/segments/artifact/card.d.ts +0 -3
- package/dist/renderers/segments/artifact/card.d.ts.map +0 -1
- package/dist/renderers/segments/artifact/preview-document.d.ts +0 -27
- package/dist/renderers/segments/artifact/preview-document.d.ts.map +0 -1
- package/dist/renderers/segments/artifact/shared.d.ts +0 -29
- package/dist/renderers/segments/artifact/shared.d.ts.map +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { AparteArtifactSegment } from '../../../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Module-level cache of sandbox-produced previews keyed by segment.id.
|
|
4
|
-
* Lets re-mounts (branch switch, conversation toggle, persisted reload after
|
|
5
|
-
* a previous mount) restore the preview instantly without re-running the
|
|
6
|
-
* sandbox. Lifetime = current page session; cleared on full reload.
|
|
7
|
-
*/
|
|
8
|
-
type CachedPreview = {
|
|
9
|
-
buffer: Uint8Array | ArrayBuffer;
|
|
10
|
-
mime: string;
|
|
11
|
-
name: string;
|
|
12
|
-
bytes: number;
|
|
13
|
-
previewHtml: string | null;
|
|
14
|
-
};
|
|
15
|
-
export declare function cacheBinaryArtifact(id: string, entry: CachedPreview): void;
|
|
16
|
-
/**
|
|
17
|
-
* Record every `aparte-artifact-ready` so the binary-artifact path can tell whether
|
|
18
|
-
* it has already asked the host to generate this file — see the dedupe at
|
|
19
|
-
* {@link maybeRehydrateBinaryArtifact}, which is the only reader.
|
|
20
|
-
*
|
|
21
|
-
* ## Why this is a function and not a module-level `addEventListener`
|
|
22
|
-
*
|
|
23
|
-
* It WAS module-level, and it was surviving bundling by luck.
|
|
24
|
-
* `packages/core/package.json` declares `sideEffects` as a short list that does NOT
|
|
25
|
-
* include this file — so the module is advertised to bundlers as side-effect-FREE while
|
|
26
|
-
* carrying a top-level listener, which is a side effect. It was retained only
|
|
27
|
-
* because `artifactRenderer` in the same module is a used binding; a bundler was
|
|
28
|
-
* within its rights to drop the file and the listener with it, and pdf/xlsx/docx
|
|
29
|
-
* artifacts would then stop regenerating in a consumer's production build while
|
|
30
|
-
* every local check stayed green. Verified as surviving today in a real Vite build
|
|
31
|
-
* of the Svelte example — but "it happens to survive" is not a contract.
|
|
32
|
-
*
|
|
33
|
-
* `sideEffects` cannot simply be corrected to name this file, either: the build
|
|
34
|
-
* bundles into a CONTENT-HASHED shared chunk, so there is no stable path to list.
|
|
35
|
-
*
|
|
36
|
-
* Installed from the two registration entry points instead. That is not later in
|
|
37
|
-
* any way that matters: an artifact can only render once a renderer is registered,
|
|
38
|
-
* and the map is read only while rendering one.
|
|
39
|
-
*/
|
|
40
|
-
export declare function installArtifactReadyHook(): void;
|
|
41
|
-
export declare function renderBinaryFileArtifact(segment: AparteArtifactSegment, kind: string): string;
|
|
42
|
-
export declare function setupBinaryFileArtifact(element: HTMLElement, segment: AparteArtifactSegment, kind: string): void;
|
|
43
|
-
export declare function updateBinaryFileArtifact(element: HTMLElement, segment: AparteArtifactSegment, isStreaming: boolean): void;
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=binary-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary-file.d.ts","sourceRoot":"","sources":["../../../../src/renderers/segments/artifact/binary-file.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAWrE;;;;;GAKG;AACH,KAAK,aAAa,GAAG;IACjB,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAQF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAQ1E;AAuBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAO/C;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAyE7F;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAkJhH;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CA6BzH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/renderers/segments/artifact/card.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAkB5F,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CAAC,qBAAqB,CAyTzE,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a previewed artifact is allowed to FETCH. Inline script and style are
|
|
3
|
-
* permitted (that IS the preview); no fetch, no XHR, no websocket, no remote image,
|
|
4
|
-
* no font. Without this the sandbox still lets injected code beacon out to any
|
|
5
|
-
* origin, so the policy does real work — measured blocked in Chromium, Firefox and
|
|
6
|
-
* WebKit.
|
|
7
|
-
*
|
|
8
|
-
* WHAT IT DOES NOT STOP, stated because the sentence here used to claim otherwise:
|
|
9
|
-
* the frame NAVIGATING ITSELF. Assigning `location.href` is a navigation, not a
|
|
10
|
-
* fetch, and no directive in this policy governs it — CSP's `navigate-to` was
|
|
11
|
-
* removed from the spec and never shipped, and the parent page's `frame-src` does
|
|
12
|
-
* not apply to a navigation the frame initiates. Reproduced in all three engines;
|
|
13
|
-
* in Firefox and WebKit the frame then RENDERS the attacker's page inside the card,
|
|
14
|
-
* which is a phishing surface as well as an exfiltration channel.
|
|
15
|
-
*
|
|
16
|
-
* What still holds, and is why this is serious rather than fatal: the sandbox has
|
|
17
|
-
* no `allow-same-origin`, so the frame's origin is opaque — it cannot read the host
|
|
18
|
-
* page, its storage, or the API key — and no `allow-forms` or
|
|
19
|
-
* `allow-top-navigation`, so it can neither POST nor move the tab.
|
|
20
|
-
*
|
|
21
|
-
* The honest summary for a consumer: a previewed artifact cannot reach your page or
|
|
22
|
-
* your data, and can phone home once. Previewing model-authored HTML is running
|
|
23
|
-
* untrusted content in a box, not running nothing.
|
|
24
|
-
*/
|
|
25
|
-
export declare const PREVIEW_CSP = "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:";
|
|
26
|
-
export declare function buildSafePreviewDocument(kind: string, body: string, title: string): string;
|
|
27
|
-
//# sourceMappingURL=preview-document.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-document.d.ts","sourceRoot":"","sources":["../../../../src/renderers/segments/artifact/preview-document.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW,6GAA6G,CAAC;AAkDtI,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1F"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The leaves the artifact card and the binary-file path BOTH use.
|
|
3
|
-
*
|
|
4
|
-
* Scoped by a call-site census, not by intuition. The obvious-looking candidates are
|
|
5
|
-
* not here: `BINARY_FILE_KINDS` reads as shared and is used only by the card (which
|
|
6
|
-
* consults it to delegate), `PREVIEWABLE_KINDS`, `languageForKind` and
|
|
7
|
-
* `downloadTextArtifact` are card-only, and `FILE_ICON_LABEL` and `formatBytes` are
|
|
8
|
-
* binary-only. A first draft of this module took all of them and would have been a
|
|
9
|
-
* grab-bag named for one of its three jobs.
|
|
10
|
-
*
|
|
11
|
-
* What is genuinely shared is small: fence stripping (which the plain code renderer
|
|
12
|
-
* needs too), the kind→label map, and the throttle pair behind the debounced
|
|
13
|
-
* re-highlight.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Strip leading/trailing markdown code fences (``` or ~~~, optional lang tag).
|
|
17
|
-
* Also strips any content that appears after the closing fence (small models
|
|
18
|
-
* frequently duplicate lines after the closing ``` block).
|
|
19
|
-
*
|
|
20
|
-
* Char-based scanner — no regex.
|
|
21
|
-
*/
|
|
22
|
-
export declare function stripCodeFences(content: string): string;
|
|
23
|
-
export declare function labelForKind(kind: string): string;
|
|
24
|
-
/** Cap a segmentId→timestamp throttle map so a long session can't grow it without
|
|
25
|
-
* bound (one entry per streamed segment). Values are timestamps (tiny), so the cap
|
|
26
|
-
* is generous; delete-then-set refreshes recency, evict the oldest key when full.
|
|
27
|
-
* Evicting a stale entry costs at most one extra highlight/dispatch — never
|
|
28
|
-
* incorrect, since both debounce windows are far shorter than the cap horizon. */
|
|
29
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/renderers/segments/artifact/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsBvD;AAsCD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoBjD;AAED;;;;mFAImF"}
|