@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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { AparteIconProvider, AparteIconName } from './icon-provider.js';
|
|
11
11
|
import { AparteAvatarProvider } from './avatar-provider.js';
|
|
12
|
-
import { AparteLocale } from './locale.js';
|
|
12
|
+
import { AparteLocale, AparteLocaleExtensions } from './locale.js';
|
|
13
13
|
import { AparteAction, AparteActionZone } from './action-provider.js';
|
|
14
14
|
import type { AparteStatusRenderer } from './status-renderer.js';
|
|
15
15
|
import type { AparteErrorRenderer } from './error-renderer.js';
|
|
@@ -19,8 +19,9 @@ import type { AparteSiblingNavRenderer } from './sibling-nav-renderer.js';
|
|
|
19
19
|
import type { AparteBubbleShellRenderer } from './bubble-shell-renderer.js';
|
|
20
20
|
import type { AparteAIProvider, AparteAIModel, AparteModelConfig } from '../types/model-provider.js';
|
|
21
21
|
import type { AparteTransport } from '../transport/index.js';
|
|
22
|
-
import type { AparteTool, AparteToolHandler, AparteToolRenderer } from '../types/tools.js';
|
|
22
|
+
import type { AparteTool, AparteToolHandler, AparteToolRenderer, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling } from '../types/tools.js';
|
|
23
23
|
import type { AparteSegmentDefaults } from '../types/segments.js';
|
|
24
|
+
import type { AparteStreamBlock } from '../types/stream-blocks.js';
|
|
24
25
|
import type { AparteBubbleActionsConfig, AparteBubbleActionName, AparteHostHandlersConfig } from '../types/models.js';
|
|
25
26
|
import type { AparteConversationManager } from '../conversations/conversation-manager.js';
|
|
26
27
|
import { type AparteSanitizer } from './sanitize.js';
|
|
@@ -53,14 +54,12 @@ export declare const APARTE_DEFAULT_BUBBLE_ACTIONS: {
|
|
|
53
54
|
* The host-handler declarations — nothing declared.
|
|
54
55
|
*
|
|
55
56
|
* Same rule as {@link APARTE_DEFAULT_BUBBLE_ACTIONS}, applied outside the action bar: an
|
|
56
|
-
* image tile you can click
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* image tile you can click is a request core forwards to the app. Undeclared, it is
|
|
58
|
+
* not rendered (and the tile is not even signalled as clickable) instead of doing
|
|
59
|
+
* nothing.
|
|
59
60
|
*/
|
|
60
61
|
export declare const APARTE_DEFAULT_HOST_HANDLERS: {
|
|
61
62
|
readonly attachmentPreview: false;
|
|
62
|
-
readonly artifactRedownload: false;
|
|
63
|
-
readonly artifactRehydrate: false;
|
|
64
63
|
};
|
|
65
64
|
export interface AparteModelPreference {
|
|
66
65
|
provider: string;
|
|
@@ -91,16 +90,6 @@ export interface AparteStreamingMarkdownRenderer {
|
|
|
91
90
|
* is registered the chat falls back to the one-shot `AparteMarkdownProvider`.
|
|
92
91
|
*/
|
|
93
92
|
export type AparteStreamingMarkdownProvider = (target: HTMLElement) => AparteStreamingMarkdownRenderer;
|
|
94
|
-
/**
|
|
95
|
-
* Builds the HTML document used as an artifact preview iframe `srcdoc` for a
|
|
96
|
-
* given artifact kind (react/html/svg/js/css/…). Supplied by the consuming app
|
|
97
|
-
* — e.g. a React/Babel/Tailwind live preview that loads those libs from a CDN.
|
|
98
|
-
* Core ships only a CDN-free fallback (svg/css/html/js render offline; other
|
|
99
|
-
* kinds degrade to a read-only code view), so the engine stays zero-network and
|
|
100
|
-
* framework-agnostic. The app opts into richer previews via
|
|
101
|
-
* {@link AparteConfig.setArtifactPreviewBuilder}.
|
|
102
|
-
*/
|
|
103
|
-
export type AparteArtifactPreviewBuilder = (kind: string, body: string, title: string) => string;
|
|
104
93
|
export declare class AparteConfig {
|
|
105
94
|
private _markdownProvider?;
|
|
106
95
|
private _streamingMarkdownProvider?;
|
|
@@ -116,7 +105,6 @@ export declare class AparteConfig {
|
|
|
116
105
|
private _iconProvider?;
|
|
117
106
|
private _avatarProvider?;
|
|
118
107
|
private _keyProvider?;
|
|
119
|
-
private _artifactPreviewBuilder?;
|
|
120
108
|
private _locale;
|
|
121
109
|
private _actions;
|
|
122
110
|
private _listeners;
|
|
@@ -141,9 +129,12 @@ export declare class AparteConfig {
|
|
|
141
129
|
/** Host policy for the elicitation panel's free-text escape — see {@link setElicitationOptions}. */
|
|
142
130
|
private _elicitationAllowOther;
|
|
143
131
|
private _elicitationLayout;
|
|
132
|
+
/** Whether a single choice answers on the click (buttons) or keeps its radios + the composer's button. */
|
|
133
|
+
private _elicitationAnswerOnClick;
|
|
144
134
|
private _elicitationFieldRenderer?;
|
|
145
135
|
private _transport;
|
|
146
136
|
private _modelPreferenceProvider?;
|
|
137
|
+
private _approvalPolicy;
|
|
147
138
|
private _conversationManager?;
|
|
148
139
|
private _elicitationPresenters;
|
|
149
140
|
/** Warn once per config, not once per request — a tool loop can ask repeatedly. */
|
|
@@ -167,6 +158,8 @@ export declare class AparteConfig {
|
|
|
167
158
|
private _elicitationQueue;
|
|
168
159
|
private _tools;
|
|
169
160
|
private _toolRenderers;
|
|
161
|
+
/** Tagged blocks the stream parser recognises in the prose — see {@link registerStreamBlock}. */
|
|
162
|
+
private _streamBlocks;
|
|
170
163
|
private _segmentDefaults;
|
|
171
164
|
private _hostHandlers;
|
|
172
165
|
private _bubbleActionsConfig;
|
|
@@ -193,7 +186,7 @@ export declare class AparteConfig {
|
|
|
193
186
|
* @example
|
|
194
187
|
* aparteGlobalConfig.setBubbleActions({ retry: true, edit: true }) // you run AparteClient
|
|
195
188
|
* aparteGlobalConfig.setBubbleActions({ feedback: true }) // you listen for aparte-feedback
|
|
196
|
-
* aparteGlobalConfig.setBubbleActions({ copy: false }) //
|
|
189
|
+
* aparteGlobalConfig.setBubbleActions({ copy: false }) // hides copy; calls merge, so anything turned on above stays on
|
|
197
190
|
* // Explicit per-role ordered sets (replace the flag defaults for that role):
|
|
198
191
|
* aparteGlobalConfig.setBubbleActions({ user: ['edit', 'copy'], assistant: ['copy', 'thumbUp', 'thumbDown', 'retry'] })
|
|
199
192
|
*/
|
|
@@ -203,7 +196,7 @@ export declare class AparteConfig {
|
|
|
203
196
|
* trigger only for the ones you claim — see {@link AparteHostHandlersConfig}.
|
|
204
197
|
*
|
|
205
198
|
* @example
|
|
206
|
-
* aparteGlobalConfig.setHostHandlers({ attachmentPreview: true
|
|
199
|
+
* aparteGlobalConfig.setHostHandlers({ attachmentPreview: true });
|
|
207
200
|
*/
|
|
208
201
|
setHostHandlers(config: AparteHostHandlersConfig): void;
|
|
209
202
|
/** Returns the resolved host-handler declarations (undeclared = false). */
|
|
@@ -289,15 +282,6 @@ export declare class AparteConfig {
|
|
|
289
282
|
* @param provider Object implementing AparteIconProvider interface
|
|
290
283
|
*/
|
|
291
284
|
setIconProvider(provider: AparteIconProvider): void;
|
|
292
|
-
/**
|
|
293
|
-
* Register an artifact preview builder (app-level). When set, the artifact
|
|
294
|
-
* renderer uses it to build the preview iframe `srcdoc`; when unset, core's
|
|
295
|
-
* CDN-free fallback is used. This is how the product opts into a
|
|
296
|
-
* React/Babel/Tailwind live preview without leaking those into core.
|
|
297
|
-
*/
|
|
298
|
-
setArtifactPreviewBuilder(builder: AparteArtifactPreviewBuilder): void;
|
|
299
|
-
/** The registered artifact preview builder, or undefined for the core fallback. */
|
|
300
|
-
getArtifactPreviewBuilder(): AparteArtifactPreviewBuilder | undefined;
|
|
301
285
|
/**
|
|
302
286
|
* The icon set as a **complete** provider: every name resolves, falling back
|
|
303
287
|
* to `APARTE_DEFAULT_ICON_FALLBACKS` for anything the registered provider doesn't
|
|
@@ -370,7 +354,7 @@ export declare class AparteConfig {
|
|
|
370
354
|
* Set the current locale
|
|
371
355
|
* @param locale AparteLocale object defining all strings
|
|
372
356
|
*/
|
|
373
|
-
setLocale(locale: AparteLocale): void;
|
|
357
|
+
setLocale(locale: AparteLocale & AparteLocaleExtensions): void;
|
|
374
358
|
/**
|
|
375
359
|
* Restore the built-in English locale (the same `APARTE_DEFAULT_LOCALE` core ships
|
|
376
360
|
* with). Counterpart of {@link setLocale} for language toggles — avoids
|
|
@@ -378,15 +362,25 @@ export declare class AparteConfig {
|
|
|
378
362
|
*/
|
|
379
363
|
resetLocale(): void;
|
|
380
364
|
/**
|
|
381
|
-
* Get the current locale
|
|
365
|
+
* Get the current locale.
|
|
366
|
+
*
|
|
367
|
+
* Typed as the closed list PLUS the open half, and the asymmetry is the point:
|
|
368
|
+
* `t()` keys on `AparteLocale` alone — a typo there is a compile error — while a
|
|
369
|
+
* plugin reading its OWN key off this object gets `string | undefined` and
|
|
370
|
+
* supplies its own default at the call site.
|
|
371
|
+
*
|
|
372
|
+
* `t()` is the one that has to be narrow, because it is the one that fails
|
|
373
|
+
* silently: it returns `''` for a key nobody declared, and an empty label is
|
|
374
|
+
* invisible on screen and in the console. A misspelt read here is `undefined`,
|
|
375
|
+
* which the `?? 'fallback'` every caller already writes turns into the default.
|
|
382
376
|
*/
|
|
383
|
-
getLocale(): AparteLocale;
|
|
377
|
+
getLocale(): AparteLocale & AparteLocaleExtensions;
|
|
384
378
|
/**
|
|
385
379
|
* Extend the current locale with partial translations.
|
|
386
380
|
* Useful for plugins to register their own strings.
|
|
387
381
|
* @param translations Partial locale object to merge
|
|
388
382
|
*/
|
|
389
|
-
extendLocale(translations: Partial<AparteLocale>): void;
|
|
383
|
+
extendLocale(translations: Partial<AparteLocale> & AparteLocaleExtensions): void;
|
|
390
384
|
/**
|
|
391
385
|
* Get icon HTML string by name
|
|
392
386
|
* Falls back to textual representation if no provider is set
|
|
@@ -446,6 +440,37 @@ export declare class AparteConfig {
|
|
|
446
440
|
* });
|
|
447
441
|
*/
|
|
448
442
|
setModelPreferenceProvider(provider: AparteModelPreferenceProvider): void;
|
|
443
|
+
/**
|
|
444
|
+
* Decide per CALL whether a tool runs, asks, or is refused — a mode, not a flag.
|
|
445
|
+
*
|
|
446
|
+
* With a policy registered, the client's default approval channel evaluates it for
|
|
447
|
+
* every tool call: `allow` runs without asking, `ask` puts the call to the person
|
|
448
|
+
* exactly as a `needsApproval` tool is, `deny` refuses it with the policy's own
|
|
449
|
+
* `reason` as what the model reads. `undefined` leaves the tool's `needsApproval`
|
|
450
|
+
* to decide, as before. `null` removes the policy.
|
|
451
|
+
*
|
|
452
|
+
* `@aparte/plugin-approval` builds one from a classification of your tool names and
|
|
453
|
+
* a switchable mode (plan / ask / auto-edit / auto); a host that owns its own
|
|
454
|
+
* `approvalResolver` on `AparteClientOptions` is not affected — that resolver
|
|
455
|
+
* already decides everything.
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* ```ts
|
|
459
|
+
* aparteGlobalConfig.setApprovalPolicy((call) =>
|
|
460
|
+
* call.name === 'run_command'
|
|
461
|
+
* ? { verdict: 'ask' }
|
|
462
|
+
* : { verdict: 'allow' });
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
setApprovalPolicy(policy: AparteApprovalPolicy | null): void;
|
|
466
|
+
/** The registered approval policy, or `null`. */
|
|
467
|
+
getApprovalPolicy(): AparteApprovalPolicy | null;
|
|
468
|
+
/**
|
|
469
|
+
* What the policy says about one call, with the tool's own `needsApproval` as the
|
|
470
|
+
* answer when it has no opinion. The one place the two are combined, so the client's
|
|
471
|
+
* gate predicate and its approval channel cannot disagree.
|
|
472
|
+
*/
|
|
473
|
+
ruleOnToolCall(call: AparteToolCall): AparteApprovalRuling;
|
|
449
474
|
/**
|
|
450
475
|
* Restore previously saved model preference via the registered provider.
|
|
451
476
|
* Should be called once at app startup, before any component mounts.
|
|
@@ -499,15 +524,27 @@ export declare class AparteConfig {
|
|
|
499
524
|
* collecting structured data, not two different questions asked mid-conversation.
|
|
500
525
|
* No product asks a person two questions by stacking them in one box; it is kept
|
|
501
526
|
* as an option because the form case is real, not because it was the right default.
|
|
527
|
+
*
|
|
528
|
+
* `answerOnClick` decides how a question asked ON ITS OWN with a single choice — an
|
|
529
|
+
* `enum` without `multiple` or a `default`, a `boolean` without a `default` — is
|
|
530
|
+
* answered. `true` (default) renders the options as buttons and the click is the
|
|
531
|
+
* answer: one decision, one gesture, the shape every chat product uses for "which
|
|
532
|
+
* one?". `false` keeps the radios and the composer's button, so a person can
|
|
533
|
+
* change their mind before committing — the shape a form or a screen reader
|
|
534
|
+
* flow may prefer, and the one a host that wants a uniform "select, then send"
|
|
535
|
+
* across every question asks for. A form of several questions always collects and
|
|
536
|
+
* submits, whatever this says.
|
|
502
537
|
*/
|
|
503
538
|
setElicitationOptions(options: {
|
|
504
539
|
allowOther?: boolean;
|
|
505
540
|
layout?: 'stepped' | 'stacked';
|
|
541
|
+
answerOnClick?: boolean;
|
|
506
542
|
}): void;
|
|
507
543
|
/** The elicitation policy (see {@link setElicitationOptions}). */
|
|
508
544
|
getElicitationOptions(): {
|
|
509
545
|
allowOther: boolean;
|
|
510
546
|
layout: 'stepped' | 'stacked';
|
|
547
|
+
answerOnClick: boolean;
|
|
511
548
|
};
|
|
512
549
|
/**
|
|
513
550
|
* Render one field of the question panel yourself.
|
|
@@ -621,6 +658,31 @@ export declare class AparteConfig {
|
|
|
621
658
|
unregisterToolRenderer(toolName: string): void;
|
|
622
659
|
/** Get the renderer for a specific tool name. Returns undefined if none registered. */
|
|
623
660
|
getToolRenderer(toolName: string): AparteToolRenderer | undefined;
|
|
661
|
+
/**
|
|
662
|
+
* Teach the stream parser a tagged block: `<tag attr="…">…</tag>` in the model's
|
|
663
|
+
* prose becomes the segment `toSegment` builds, streamed delta by delta.
|
|
664
|
+
*
|
|
665
|
+
* The parser does the work once for every grammar — the earliest opening tag wins
|
|
666
|
+
* against a code fence and a reasoning delimiter, a tag cut at a chunk boundary is
|
|
667
|
+
* held back, attributes are parsed quoted or bare, and the block is closed at
|
|
668
|
+
* `</tag>` or at the end of the stream. What the segment IS is yours: a `type` of
|
|
669
|
+
* your own with a renderer from `registerSegmentRenderer`, or a built-in one. One
|
|
670
|
+
* grammar per tag; registering the same tag again replaces it.
|
|
671
|
+
*
|
|
672
|
+
* Read by the stream adapter when a turn starts, so a block registered mid-turn
|
|
673
|
+
* applies from the next turn. See {@link AparteStreamBlock}.
|
|
674
|
+
*
|
|
675
|
+
* @example
|
|
676
|
+
* aparteGlobalConfig.registerStreamBlock({
|
|
677
|
+
* tag: 'cite',
|
|
678
|
+
* toSegment: ({ attrs, id }) => ({ id, type: 'citation', url: attrs['url'] ?? '', content: '' }),
|
|
679
|
+
* });
|
|
680
|
+
*/
|
|
681
|
+
registerStreamBlock(block: AparteStreamBlock): void;
|
|
682
|
+
/** Forget a block grammar by its tag. */
|
|
683
|
+
unregisterStreamBlock(tag: string): void;
|
|
684
|
+
/** The registered block grammars, in registration order. */
|
|
685
|
+
getStreamBlocks(): AparteStreamBlock[];
|
|
624
686
|
/**
|
|
625
687
|
* Register a AparteConversationManager so any UI controller can persist & load
|
|
626
688
|
* conversations without coupling to a framework wrapper.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-config.d.ts","sourceRoot":"","sources":["../../src/config/aparte-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAiC,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-config.d.ts","sourceRoot":"","sources":["../../src/config/aparte-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAiC,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAyB,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EACR,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EACjE,oBAAoB,EAAE,oBAAoB,EAC7C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KA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;AAKpD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,6BAA6B;IAC1C,mFAAmF;IACnF,MAAM,EAAE,YAAY,CAAC;IACrB,iDAAiD;IACjD,WAAW,EAAE,iBAAiB,CAAC;CAClC"}
|
|
@@ -49,6 +49,12 @@ export interface AparteIconProvider {
|
|
|
49
49
|
unarchive?: () => string;
|
|
50
50
|
/** Download / save to disk */
|
|
51
51
|
download?: () => string;
|
|
52
|
+
/** A row's actions button (⋯) */
|
|
53
|
+
more?: () => string;
|
|
54
|
+
/** Pin a conversation */
|
|
55
|
+
pin?: () => string;
|
|
56
|
+
/** Delete (a bin) */
|
|
57
|
+
trash?: () => string;
|
|
52
58
|
}
|
|
53
59
|
/** Icon names available in the provider */
|
|
54
60
|
export type AparteIconName = keyof AparteIconProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-provider.d.ts","sourceRoot":"","sources":["../../src/config/icon-provider.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,kBAAkB;IAM/B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,MAAM,CAAC;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,MAAM,CAAC;IACpB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;IACvB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;IACzB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,gDAAgD;IAChD,IAAI,C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CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAsB,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { aparteGlobalConfig, AparteConfig, APARTE_DEFAULT_BUBBLE_ACTIONS, APARTE
|
|
|
2
2
|
export { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config-context.js';
|
|
3
3
|
export { subscribeConfigChange, APARTE_CONFIG_CHANGE } from './config-subscribe.js';
|
|
4
4
|
export type { AparteConfigAware } from './config-context.js';
|
|
5
|
-
export type { AparteConfigChangeEventDetail, AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteModelPreference, AparteModelPreferenceProvider
|
|
5
|
+
export type { AparteConfigChangeEventDetail, AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteModelPreference, AparteModelPreferenceProvider } from './aparte-config.js';
|
|
6
6
|
export type { AparteSanitizer } from './sanitize.js';
|
|
7
7
|
export { defaultSanitizer, isSafeUrl } from './sanitize.js';
|
|
8
8
|
export type { AparteIconProvider, AparteIconName } from './icon-provider.js';
|
|
@@ -14,7 +14,7 @@ export type { AparteAttachmentRenderer } from './attachment-renderer.js';
|
|
|
14
14
|
export type { AparteElicitationFieldRenderer, AparteElicitationFieldContext, AparteElicitationFieldControl, } from './elicitation-field-renderer.js';
|
|
15
15
|
export type { AparteSiblingNavRenderer } from './sibling-nav-renderer.js';
|
|
16
16
|
export type { AparteBubbleShellRenderer } from './bubble-shell-renderer.js';
|
|
17
|
-
export type { AparteLocale } from './locale.js';
|
|
17
|
+
export type { AparteLocale, AparteLocaleExtensions } from './locale.js';
|
|
18
18
|
export { APARTE_DEFAULT_LOCALE } from './locale.js';
|
|
19
19
|
export type { AparteAction, AparteActionZone } from './action-provider.js';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,MAAM,oBAAoB,CAAC;AACnI,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,uBAAuB,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,
|
|
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,MAAM,oBAAoB,CAAC;AACnI,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,uBAAuB,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACjR,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,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,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"}
|
package/dist/config/locale.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Every translatable string core itself renders — the CLOSED list.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Core keeps only the English default in memory (`APARTE_DEFAULT_LOCALE`); other
|
|
5
|
+
* languages arrive through `aparteGlobalConfig.setLocale()`.
|
|
6
|
+
*
|
|
7
|
+
* Closed, and an alias rather than an interface, on purpose. This used to end with
|
|
8
|
+
* `[key: string]: string | undefined`, and that one line disabled the only
|
|
9
|
+
* compile-time check the locale had: `AparteConfig.t(key: keyof AparteLocale)` looks
|
|
10
|
+
* airtight, but with an index signature `keyof` widens to `string` and EVERY literal
|
|
11
|
+
* typechecks. A renamed key compiled clean, `t()` returned `''` at runtime, and the UI
|
|
12
|
+
* rendered an empty label with no error and no warning — which is how `submitButton`,
|
|
13
|
+
* `stopButton` and `actionUpload` each shipped read-but-never-declared, the last one
|
|
14
|
+
* reported by a user from a live language switcher.
|
|
15
|
+
*
|
|
16
|
+
* The open half is {@link AparteLocaleExtensions}, and an ALIAS is what lets the two
|
|
17
|
+
* meet: TypeScript gives a type alias an implicit index signature and an interface
|
|
18
|
+
* none, so only this form is assignable to the extensions record that
|
|
19
|
+
* `setLocale`/`extendLocale` accept and `getLocale` returns.
|
|
7
20
|
*/
|
|
8
|
-
export
|
|
21
|
+
export type AparteLocale = {
|
|
9
22
|
inputPlaceholder: string;
|
|
10
23
|
sendButton: string;
|
|
11
24
|
copy: string;
|
|
@@ -35,18 +48,62 @@ export interface AparteLocale {
|
|
|
35
48
|
approveTool?: string;
|
|
36
49
|
/** Reject button on a tool awaiting human approval (default: "Reject") */
|
|
37
50
|
rejectTool?: string;
|
|
38
|
-
/** Short suffix for tokens-per-second perf chip (default: "tok/s") */
|
|
39
|
-
tokensPerSecondLabel?: string;
|
|
40
51
|
/** Aria-label / tooltip for the message info ("i") action button (default: "Details") */
|
|
41
52
|
messageInfo?: string;
|
|
42
53
|
/** Default title for a new conversation (default: "New Chat") */
|
|
43
54
|
newChat: string;
|
|
44
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* The "Delete" item of a row's menu (default: "Delete"). Used to be the aria-label
|
|
57
|
+
* of a permanent ✕ on every row ("Delete conversation"); the menu is named after
|
|
58
|
+
* the row, so the item carries only the verb.
|
|
59
|
+
*/
|
|
45
60
|
deleteConversation: string;
|
|
46
|
-
/**
|
|
61
|
+
/** The "Archive" item of a row's menu (default: "Archive") */
|
|
47
62
|
archiveConversation?: string;
|
|
48
|
-
/**
|
|
63
|
+
/** The same item on an archived row (default: "Unarchive") */
|
|
49
64
|
unarchiveConversation?: string;
|
|
65
|
+
/** Accessible name of the ⋯ button that opens a row's menu (default: "Conversation actions") */
|
|
66
|
+
conversationActions?: string;
|
|
67
|
+
/** The "Rename" item of a row's menu (default: "Rename") */
|
|
68
|
+
renameConversation?: string;
|
|
69
|
+
/** Accessible name of the inline input a rename opens (default: "Conversation title") */
|
|
70
|
+
conversationTitle?: string;
|
|
71
|
+
/** The "Pin" item of a row's menu (default: "Pin") */
|
|
72
|
+
pinConversation?: string;
|
|
73
|
+
/** The same item on a pinned row (default: "Unpin") */
|
|
74
|
+
unpinConversation?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The question asked before a delete (default: "Delete “{title}”?"). `{title}` is
|
|
77
|
+
* replaced with the row's title; a delete is the one action of the menu that asks
|
|
78
|
+
* first, because it is the one that cannot be undone.
|
|
79
|
+
*/
|
|
80
|
+
deleteConversationConfirm?: string;
|
|
81
|
+
/** The button that declines that question (default: "Cancel") */
|
|
82
|
+
cancel?: string;
|
|
83
|
+
/** Heading of the pinned rows, which come first (default: "Pinned") */
|
|
84
|
+
conversationGroupPinned?: string;
|
|
85
|
+
/** Heading of the rows updated today (default: "Today") */
|
|
86
|
+
conversationGroupToday?: string;
|
|
87
|
+
/** … yesterday (default: "Yesterday") */
|
|
88
|
+
conversationGroupYesterday?: string;
|
|
89
|
+
/** … in the seven days before that (default: "Previous 7 days") */
|
|
90
|
+
conversationGroupWeek?: string;
|
|
91
|
+
/** … in the thirty days before that (default: "Previous 30 days"). Older rows are headed by their month, formatted with `tag`. */
|
|
92
|
+
conversationGroupMonth?: string;
|
|
93
|
+
/** Accessible name of `<aparte-scroll-rail>`, the ticks beside the transcript (default: "Conversation outline") */
|
|
94
|
+
scrollRailLabel?: string;
|
|
95
|
+
/** Accessible name of `<aparte-sidebar>` (default: "Conversations") */
|
|
96
|
+
sidebarLabel?: string;
|
|
97
|
+
/** Accessible name of the seam between a split's two panes (default: "Resize the panes") */
|
|
98
|
+
splitHandleLabel?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Accessible name of the transcript itself (default: "Transcript").
|
|
101
|
+
*
|
|
102
|
+
* The scroll surface is a tab stop, because in WebKit a scrollable region that is
|
|
103
|
+
* not focusable cannot be scrolled from the keyboard at all. A tab stop with no
|
|
104
|
+
* name is announced as "group", so the name ships with the tab stop, not after it.
|
|
105
|
+
*/
|
|
106
|
+
transcript?: string;
|
|
50
107
|
/** The free-text fallback option in a choice (default: "Other…") */
|
|
51
108
|
elicitationOther?: string;
|
|
52
109
|
/** Placeholder of the free-text input that option reveals (default: "Type your answer…") */
|
|
@@ -79,14 +136,15 @@ export interface AparteLocale {
|
|
|
79
136
|
*/
|
|
80
137
|
stopButton?: string;
|
|
81
138
|
/**
|
|
82
|
-
* The
|
|
83
|
-
*
|
|
139
|
+
* The tag a `recommended` option wears beside its label (default: "Recommended").
|
|
140
|
+
* Said, not only tinted: a tint is a hint the eye may miss and a screen reader
|
|
141
|
+
* never gets.
|
|
84
142
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* the
|
|
143
|
+
* (`elicitationNext` lived here until 2026-08-28, for the composer's button while a
|
|
144
|
+
* form had questions ahead. That meaning is gone with the button's "advance" mode
|
|
145
|
+
* — the chips are the navigation — so the key went with it, not deprecated.)
|
|
88
146
|
*/
|
|
89
|
-
|
|
147
|
+
elicitationRecommended?: string;
|
|
90
148
|
/**
|
|
91
149
|
* The affordance that declines the request (default: "Skip").
|
|
92
150
|
*
|
|
@@ -139,14 +197,11 @@ export interface AparteLocale {
|
|
|
139
197
|
/** Accessible name of the `<aparte-context>` gauge. Optional, like the keys above. */
|
|
140
198
|
contextLabel?: string;
|
|
141
199
|
/**
|
|
142
|
-
* Title line of the message `
|
|
143
|
-
* turns (default: "Conversation summary").
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* compacted into an English header.
|
|
147
|
-
* is a separate, per-call knob (the compactor deliberately ships no locale
|
|
148
|
-
* system); this key is the UI-side title and follows the locale like every
|
|
149
|
-
* other string the user reads.
|
|
200
|
+
* Title line of the summary message `@aparte/plugin-compaction` injects in place
|
|
201
|
+
* of the summarised turns (default: "Conversation summary"). The plugin reads it
|
|
202
|
+
* through `config.t()`, so the notice follows the locale like every other string
|
|
203
|
+
* the user reads — it used to be hardcoded, with an emoji, so a French chat
|
|
204
|
+
* compacted into an English header.
|
|
150
205
|
*/
|
|
151
206
|
compactionSummaryTitle?: string;
|
|
152
207
|
/**
|
|
@@ -170,12 +225,23 @@ export interface AparteLocale {
|
|
|
170
225
|
toolCompleted?: string;
|
|
171
226
|
toolRejected?: string;
|
|
172
227
|
toolStopped?: string;
|
|
228
|
+
/** The tool row's word when the handler threw — a crash, not a refusal nor a stop (default: "Failed"). */
|
|
229
|
+
toolFailed?: string;
|
|
173
230
|
/** Label above a tool call's arguments (default: "Input") */
|
|
174
231
|
toolInput?: string;
|
|
175
232
|
/** Label above a tool call's result (default: "Output") */
|
|
176
233
|
toolOutput?: string;
|
|
177
234
|
/** Accessible name for the group of approval options (default: "Your decision") */
|
|
178
235
|
approvalOptionsLabel?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Heading over the call's arguments in the approval panel (default: "Arguments").
|
|
238
|
+
*
|
|
239
|
+
* The panel named the tool and nothing else, while the arguments — the thing
|
|
240
|
+
* actually being approved — stayed in the transcript row behind a closed
|
|
241
|
+
* disclosure. Same word family as {@link toolInput} and deliberately not that
|
|
242
|
+
* key: that one heads a section of a transcript row, this one heads a decision.
|
|
243
|
+
*/
|
|
244
|
+
approvalArgsLabel?: string;
|
|
179
245
|
/**
|
|
180
246
|
* The composer's attach-file button (default: "Attach file").
|
|
181
247
|
*
|
|
@@ -191,6 +257,36 @@ export interface AparteLocale {
|
|
|
191
257
|
* these declarations on the other.
|
|
192
258
|
*/
|
|
193
259
|
actionUpload?: string;
|
|
260
|
+
/**
|
|
261
|
+
* The ✕ on a pending attachment, named after the file it drops (default:
|
|
262
|
+
* "Remove {name}").
|
|
263
|
+
*
|
|
264
|
+
* `{name}` is substituted with the file's own name — the convention
|
|
265
|
+
* `approvalAsk` and `deleteConversationConfirm` already use. The button is
|
|
266
|
+
* icon-only, so this string is the whole of what a screen-reader user hears.
|
|
267
|
+
*/
|
|
268
|
+
removeAttachment?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Placeholder of a searchable select's filter field (default: "Search…").
|
|
271
|
+
*
|
|
272
|
+
* VISIBLE text, which is what separates it from most of this file: it was a
|
|
273
|
+
* literal in the primitive, so a French page opened the model picker and read
|
|
274
|
+
* "Search..." in the box.
|
|
275
|
+
*/
|
|
276
|
+
selectSearchPlaceholder?: string;
|
|
277
|
+
/** Accessible name of that filter field, which has no visible label (default: "Search options") */
|
|
278
|
+
selectSearchLabel?: string;
|
|
279
|
+
/**
|
|
280
|
+
* The `<aparte-model-selector>` trigger before a model is picked (default:
|
|
281
|
+
* "Select a model..."). The one string that element takes from the locale.
|
|
282
|
+
*/
|
|
283
|
+
modelSelectorPlaceholder?: string;
|
|
284
|
+
/**
|
|
285
|
+
* Accessible name of `@aparte/plugin-approval`'s mode switch (default: "Approval
|
|
286
|
+
* mode"). The switch is an `<aparte-select>` with no visible label, so this string
|
|
287
|
+
* is the whole of what a screen-reader user hears there.
|
|
288
|
+
*/
|
|
289
|
+
approvalModeLabel?: string;
|
|
194
290
|
/**
|
|
195
291
|
* The artifact card's download button (default: "Download").
|
|
196
292
|
*
|
|
@@ -260,9 +356,26 @@ export interface AparteLocale {
|
|
|
260
356
|
tag?: string;
|
|
261
357
|
/** Direction of the text (ltr or rtl) - defaults to ltr */
|
|
262
358
|
direction?: 'ltr' | 'rtl';
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* The extension half: any other key a plugin or an app wants to carry.
|
|
362
|
+
*
|
|
363
|
+
* This used to be an index signature ON `AparteLocale` — `[key: string]: string |
|
|
364
|
+
* undefined` — and it silently disabled the only compile-time check the locale had.
|
|
365
|
+
* `AparteConfig.t(key: keyof AparteLocale)` looks airtight; with an index signature,
|
|
366
|
+
* `keyof` widens to `string` and EVERY literal typechecks. A renamed key
|
|
367
|
+
* (`t('copy')` typed as `t('copyCodeBlock')`) compiled clean, `t()` returned `''`
|
|
368
|
+
* at runtime, and the UI rendered an empty label with no error and no warning. It was
|
|
369
|
+
* one of the six deliberate mistakes an audit planted, and the only guard that could
|
|
370
|
+
* have caught it was this type.
|
|
371
|
+
*
|
|
372
|
+
* So the two halves are separate now: {@link AparteLocale} is CLOSED — it is the list
|
|
373
|
+
* `t()` keys on — and this is the open bag beside it. {@link AparteConfig.setLocale}
|
|
374
|
+
* and {@link AparteConfig.extendLocale} accept the intersection, so a plugin still
|
|
375
|
+
* ships its own strings in the same object; only `t()` stays narrow, which is where
|
|
376
|
+
* the typo has to be caught.
|
|
377
|
+
*/
|
|
378
|
+
export type AparteLocaleExtensions = Record<string, string | undefined>;
|
|
266
379
|
/**
|
|
267
380
|
* Default English Locale (Zero-dependency)
|
|
268
381
|
* Hardcoded to ensure the core works out-of-the-box.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/config/locale.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/config/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GAAG;IAEvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAA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cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAwFnC,CAAC"}
|
|
@@ -15,6 +15,15 @@
|
|
|
15
15
|
* coverage, register DOMPurify via `aparteGlobalConfig.setHtmlSanitizer`.
|
|
16
16
|
*/
|
|
17
17
|
export type AparteSanitizer = (html: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Tags dropped wholesale — content and all (never unwrapped to text).
|
|
20
|
+
*
|
|
21
|
+
* Exported for the DOM-free path's own suite: both of `fallbackScrub`'s regexes
|
|
22
|
+
* are built from this Set, and the test that proves it loops over the Set rather
|
|
23
|
+
* than a copy. Not re-exported from the package barrel — it is core's list, not
|
|
24
|
+
* a contract.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DANGEROUS_TAGS: Set<string>;
|
|
18
27
|
export declare function isSafeUrl(value: string, tag: string): boolean;
|
|
19
28
|
/**
|
|
20
29
|
* The built-in sanitizer. Parses `html` with the platform DOMParser, rebuilds an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,aAKzB,CAAC;AAqIH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7D;AA4OD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAY9B,CAAC"}
|