@aparte/core 0.10.0 → 0.11.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 +54 -33
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/client/stream-adapter.d.ts +6 -1
- package/dist/client/stream-adapter.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +25 -4
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +8 -4
- package/dist/components/chat/aparte-chat.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-action.d.ts +5 -5
- package/dist/components/composer/aparte-composer-add-attachment.d.ts +5 -4
- package/dist/components/composer/aparte-composer-add-attachment.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts +5 -3
- package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-cancel.d.ts +2 -2
- package/dist/components/composer/aparte-composer-input.d.ts +8 -5
- package/dist/components/composer/aparte-composer-input.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-send.d.ts +2 -2
- package/dist/components/composer/aparte-composer-toolbar.d.ts +3 -3
- package/dist/components/composer/aparte-composer.d.ts +54 -10
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +19 -12
- package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
- package/dist/components/elicitation/aparte-elicitation.d.ts +12 -0
- package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
- package/dist/components/status/aparte-chat-status.d.ts +9 -0
- package/dist/components/status/aparte-chat-status.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +15 -4
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +20 -1
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/locale.d.ts +43 -0
- package/dist/config/locale.d.ts.map +1 -1
- package/dist/custom-elements.json +8517 -7601
- package/dist/elicitation/approval-panel.d.ts +42 -0
- package/dist/elicitation/approval-panel.d.ts.map +1 -0
- package/dist/elicitation/index.d.ts +4 -1
- package/dist/elicitation/index.d.ts.map +1 -1
- package/dist/elicitation/panel.d.ts +1 -1
- package/dist/elicitation/panel.d.ts.map +1 -1
- package/dist/elicitation/types.d.ts +116 -9
- package/dist/elicitation/types.d.ts.map +1 -1
- package/dist/generated/element-attributes.d.ts +173 -0
- package/dist/generated/element-attributes.d.ts.map +1 -0
- package/dist/index.css +615 -92
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +341 -254
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +3 -3
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +46 -44
- package/dist/index.node.js.map +1 -1
- package/dist/interop/element-props.d.ts +26 -1
- package/dist/interop/element-props.d.ts.map +1 -1
- package/dist/{index-BnKBciDG.js → is-awaiting-reply-Cb7H3YfN.js} +1448 -1544
- package/dist/is-awaiting-reply-Cb7H3YfN.js.map +1 -0
- package/dist/primitives/select/aparte-optgroup.d.ts +3 -0
- package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
- package/dist/primitives/select/aparte-option.d.ts +1 -0
- package/dist/primitives/select/aparte-option.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts +22 -18
- 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/artifact/card.d.ts.map +1 -1
- package/dist/renderers/segments/pipeline-waiting.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/dist/types/element-attributes.d.ts +42 -0
- package/dist/types/element-attributes.d.ts.map +1 -0
- package/dist/types/event-map.d.ts +1 -2
- package/dist/types/event-map.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/segments.d.ts +1 -8
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +15 -21
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/segments.d.ts +8 -0
- package/dist/utils/segments.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/index-BnKBciDG.js.map +0 -1
- package/dist/renderers/segments/progress.d.ts +0 -3
- package/dist/renderers/segments/progress.d.ts.map +0 -1
|
@@ -5,10 +5,27 @@ import { AparteChatRequest, AparteChatMessage } from '../types/chat.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Resolves a human-in-the-loop tool approval for a `needsApproval` tool call.
|
|
7
7
|
* Resolves `{ approved, payload? }`; the `signal` aborts a pending decision.
|
|
8
|
+
*
|
|
9
|
+
* It receives the CALL, not just its id. You cannot ask a person "run this?" without
|
|
10
|
+
* naming what — the built-in channel needs the tool's name for its question, and an
|
|
11
|
+
* id alone forced a lookup table filled by one event and read by another, which is the
|
|
12
|
+
* shape that breaks in silence.
|
|
8
13
|
*/
|
|
9
|
-
export type AparteToolApprovalResolver = (
|
|
14
|
+
export type AparteToolApprovalResolver = (call: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
input: Record<string, unknown>;
|
|
18
|
+
}, signal: AbortSignal) => Promise<{
|
|
10
19
|
approved: boolean;
|
|
11
20
|
payload?: unknown;
|
|
21
|
+
/**
|
|
22
|
+
* What the user said to do instead, on a refusal.
|
|
23
|
+
*
|
|
24
|
+
* It becomes the tool_result the model reads, which is possible at all only
|
|
25
|
+
* because a refusal now hands the model a turn. Optional and additive: a resolver
|
|
26
|
+
* that returns a bare `{ approved }` behaves exactly as before.
|
|
27
|
+
*/
|
|
28
|
+
instruction?: string;
|
|
12
29
|
}>;
|
|
13
30
|
/**
|
|
14
31
|
* Decides how a conversation is compacted: which messages are summarized away
|
|
@@ -35,10 +52,12 @@ export interface AparteClientOptions {
|
|
|
35
52
|
keyResolver?: (providerId: string) => string | Record<string, string> | Promise<string | Record<string, string> | undefined | null> | undefined | null;
|
|
36
53
|
/**
|
|
37
54
|
* Custom human-in-the-loop approval resolver for tools marked
|
|
38
|
-
* `needsApproval`.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* (CLI / webhook) with no DOM.
|
|
55
|
+
* `needsApproval`. Without one, the gate asks at the composer through
|
|
56
|
+
* `requestUserInput`, like every other request for the user. Inject this to
|
|
57
|
+
* decide from the call itself — it receives `(call, signal)` — or to drive
|
|
58
|
+
* approval from a headless source (CLI / webhook) with no DOM.
|
|
59
|
+
*
|
|
60
|
+
* It may return an `instruction`, which the model reads as part of the refusal.
|
|
42
61
|
*/
|
|
43
62
|
approvalResolver?: AparteToolApprovalResolver;
|
|
44
63
|
/**
|
|
@@ -201,37 +220,28 @@ export declare class AparteClient {
|
|
|
201
220
|
*/
|
|
202
221
|
abort(): void;
|
|
203
222
|
/**
|
|
204
|
-
*
|
|
205
|
-
* tool call (dispatched by the built-in Approve/Reject UI or an app-level
|
|
206
|
-
* approval surface). Resolves `{ approved, payload }` — `approved` is `true`
|
|
207
|
-
* only on an explicit approve, and `payload` carries any arbitrary data a
|
|
208
|
-
* custom approval UI attached to the decision (the built-in gate sends
|
|
209
|
-
* none). The `signal` (an AbortController registered in
|
|
210
|
-
* `_activeToolControllers`) lets `abort()` cleanly resolve a pending
|
|
211
|
-
* approval to `{ approved: false }` — there is no timeout, since a human may
|
|
212
|
-
* take any amount of time to decide.
|
|
213
|
-
*/
|
|
214
|
-
/**
|
|
215
|
-
* Await the human's Approve/Reject for one tool call.
|
|
223
|
+
* Ask the human at the COMPOSER, and report what they decided.
|
|
216
224
|
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* executed action came apart, which is the entire failure mode an approval gate
|
|
224
|
-
* exists to prevent — and the handler behind it is arbitrary consumer code.
|
|
225
|
+
* The default channel, replacing a `document` listener for `aparte-tool-decision`
|
|
226
|
+
* that existed only because the buttons lived in a segment renderer with no
|
|
227
|
+
* reference to this client. Routing through `requestUserInput` puts the decision
|
|
228
|
+
* where every other request for the user already goes, which is the whole point:
|
|
229
|
+
* one queue, one panel slot, one teardown, and the same behaviour whether the
|
|
230
|
+
* request came from a tool handler or from this gate.
|
|
225
231
|
*
|
|
226
|
-
* The
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* button keeps working as long as it fires from inside its own chat.
|
|
232
|
+
* The tool NAME is the question; the arguments stay in the transcript, on the pill
|
|
233
|
+
* this request is anchored to. A panel capped at 50vh cannot hold a diff or a plan,
|
|
234
|
+
* and the transcript is already scrollable, copyable and persisted.
|
|
230
235
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
236
|
+
* `aparte-tool-decision` is GONE with the buttons that dispatched it, and so is the
|
|
237
|
+
* `document` listener that answered it. It existed only because a segment renderer
|
|
238
|
+
* has no reference to this client; two seams that can disagree about who answers a
|
|
239
|
+
* decision are one seam too many, and the ratified elicitation rule already said so
|
|
240
|
+
* — "a typed presenter registered per config instance, never window events". A host
|
|
241
|
+
* that wants to answer programmatically registers an `approvalResolver` (headless,
|
|
242
|
+
* no DOM) or its own presenter, both strictly more capable than an id on an event.
|
|
233
243
|
*/
|
|
234
|
-
private
|
|
244
|
+
private _askForApproval;
|
|
235
245
|
/**
|
|
236
246
|
* Resolve the auth for a provider: `options.keyResolver` takes precedence,
|
|
237
247
|
* then the aparteGlobalConfig key channel (`setKeyProvider`) so a key registered
|
|
@@ -381,12 +391,23 @@ export declare class AparteClient {
|
|
|
381
391
|
* or aborted). Extracted from `_streamLoop`. `messages` is mutated in place.
|
|
382
392
|
*/
|
|
383
393
|
private _maybeRunSyntheticTool;
|
|
394
|
+
/**
|
|
395
|
+
* What the loop does after one tool call. THREE outcomes, because a boolean
|
|
396
|
+
* conflated two questions that a refusal answers differently.
|
|
397
|
+
*
|
|
398
|
+
* - `'continue'` — run the next tool call of this turn.
|
|
399
|
+
* - `'respond'` — skip this turn's remaining calls, then take another turn so the
|
|
400
|
+
* model reads what happened. A human refusal: the model asked for
|
|
401
|
+
* several calls and refusing one cannot license the others, but a
|
|
402
|
+
* refusal it never reads is one the user has to retype as a message.
|
|
403
|
+
* - `'halt'` — the run is over: an abort, a turn limit, a missing handler.
|
|
404
|
+
*/
|
|
384
405
|
/**
|
|
385
406
|
* Handle one `tool_use` stream event from {@link _streamLoop}: the built-in
|
|
386
407
|
* `create_artifact`, per-tool renderer selection, the human-in-the-loop
|
|
387
408
|
* approval gate, and running the registered handler (timeout / abort).
|
|
388
409
|
* Mutates the shared `messages` / `toolCallsThisTurn` history in place and
|
|
389
|
-
* returns
|
|
410
|
+
* returns what the loop should do next.
|
|
390
411
|
*/
|
|
391
412
|
private _handleToolUseEvent;
|
|
392
413
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-client.d.ts","sourceRoot":"","sources":["../../src/client/aparte-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS9E,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAoC,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAK7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAoE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-client.d.ts","sourceRoot":"","sources":["../../src/client/aparte-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS9E,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAoC,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAK7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAoE,MAAM,kBAAkB,CAAC;AAqC1I;;;;;;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,eAAe;IAsC7B;;;;OAIG;YACW,YAAY;IAS1B;;;;;;;;;;OAUG;YACW,WAAW;IAmEzB;;;;;;OAMG;IACG,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmJ/C;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,qBAAqB;YAMf,YAAY;IAiE1B;;;OAGG;YACW,WAAW;IAuEzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAsBtB;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,uBAAuB;YAYjB,WAAW;IA0JzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,kBAAkB;IA2B1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,eAAe;IAoBvB;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;OAMG;YACW,oBAAoB;IAsClC;;;;;;;OAOG;YACW,sBAAsB;IAiEpC;;;;;;;;;;OAUG;IACH;;;;;;OAMG;YACW,mBAAmB;IAuQjC;;;OAGG;YACW,WAAW;IAmezB;;;;;;;;OAQG;YACW,mBAAmB;IA6EjC;;OAEG;IACH,OAAO,CAAC,cAAc;IAMtB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA8C7B,4EAA4E;IAC5E,OAAO,CAAC,oBAAoB,CAAqB;IACjD,OAAO,CAAC,uBAAuB;CAUlC"}
|
|
@@ -126,9 +126,14 @@ export interface AparteStreamRunOptions {
|
|
|
126
126
|
needsApproval?: boolean;
|
|
127
127
|
} | undefined;
|
|
128
128
|
/** HITL approval resolver for `needsApproval` tools. */
|
|
129
|
-
approvalResolver?: (
|
|
129
|
+
approvalResolver?: (call: {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
input: Record<string, unknown>;
|
|
133
|
+
}, signal: AbortSignal) => Promise<{
|
|
130
134
|
approved: boolean;
|
|
131
135
|
payload?: unknown;
|
|
136
|
+
instruction?: string;
|
|
132
137
|
}>;
|
|
133
138
|
/** The DOM adapter (from {@link createStreamAdapter}). */
|
|
134
139
|
emitter: AparteStreamRunEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-adapter.d.ts","sourceRoot":"","sources":["../../src/client/stream-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOzF,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIvE;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAC1B;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpF;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAA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AAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1E,UAAU,CAAC,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IACzE,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,0BAA0B;IACvC,4DAA4D;IAC5D,MAAM,EAAE,mBAAmB,CAAC;IAC5B,kEAAkE;IAClE,MAAM,EAAE,YAAY,CAAC;IACrB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,sBAAsB,CA6S5F;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,cAAc,CAAC,iBAAiB,CAAC,EACzC,MAAM,EAAE,WAAW,GACpB,aAAa,CAAC,iBAAiB,CAAC,CA4BlC"}
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import type { AparteSegment, AparteAttachment, AparteUsage, AparteMessage } from '../../types/index.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* One message: plain content or a list of rich segments, in light DOM.
|
|
4
|
+
*
|
|
5
|
+
* All seven events are declared by hand rather than left to the analyser, which
|
|
6
|
+
* found six. `aparte-branch-navigate` is dispatched from the `_onBranchPickerClick`
|
|
7
|
+
* arrow class field, and the auto-detection visits `ts.isMethodDeclaration` only —
|
|
8
|
+
* so the one event belonging to the branch picker was the one missing from the
|
|
9
|
+
* manifest, and from the generated reference, for as long as both existed.
|
|
10
|
+
*
|
|
11
|
+
* @element aparte-chat-bubble
|
|
12
|
+
*
|
|
13
|
+
* @attr {string} role - The message role. `data-role` is the styled mirror of it.
|
|
14
|
+
* @attr {string} data-role - `user` / `assistant` / `system`; what the CSS keys off.
|
|
15
|
+
* @attr {string} content - Plain text content, for a bubble with no segments.
|
|
16
|
+
* @attr {number | string} timestamp - Epoch milliseconds OR a date string: `_updateTimestamp` accepts either and only coerces when the value is numeric.
|
|
17
|
+
* @attr {string} message-id - How streaming and the action bar address this bubble.
|
|
18
|
+
* @attr {boolean} streaming - Hides the action bar and shows the caret while a reply is in flight.
|
|
19
|
+
* @attr {string} name - The display name in the header.
|
|
20
|
+
*
|
|
21
|
+
* @fires {CustomEvent<AparteActionEventDetail>} aparte-action - A custom action-bar button was pressed.
|
|
22
|
+
* @fires {CustomEvent<AparteRetryEventDetail>} aparte-retry - Retry was pressed; the host forks the turn.
|
|
23
|
+
* @fires {CustomEvent<AparteEditEventDetail>} aparte-edit - An edit was saved.
|
|
24
|
+
* @fires {CustomEvent<AparteFeedbackEventDetail>} aparte-feedback - Thumbs up or down.
|
|
25
|
+
* @fires {CustomEvent<AparteMessageInfoEventDetail>} aparte-message-info - The info affordance was pressed.
|
|
26
|
+
* @fires {CustomEvent<AparteBranchNavigateEventDetail>} aparte-branch-navigate - The `‹1/2›` picker moved between sibling versions.
|
|
27
|
+
* @fires {CustomEvent<AparteAttachmentPreviewEventDetail>} aparte-attachment-preview - An attached image was clicked, asking the app to open it full-size.
|
|
4
28
|
*
|
|
5
|
-
* Message component supporting both simple content and rich segments.
|
|
6
|
-
* Uses Light DOM for global CSS styling.
|
|
7
|
-
*
|
|
8
29
|
* @example
|
|
9
30
|
* <!-- Rendered for you by the viewport. Written by hand only when you drive the DOM
|
|
10
31
|
* yourself: `message-id` is what streaming and the action bar address it by. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-chat-bubble.d.ts","sourceRoot":"","sources":["../../../src/components/bubble/aparte-chat-bubble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,gBAAgB,EAOhB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;AAgE9B
|
|
1
|
+
{"version":3,"file":"aparte-chat-bubble.d.ts","sourceRoot":"","sources":["../../../src/components/bubble/aparte-chat-bubble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,gBAAgB,EAOhB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;AAgE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,eAAe,CAA+B;IACtD,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,YAAY,CAA0B;IAC9C,OAAO,CAAC,MAAM,CAA4B;IAC1C,gFAAgF;IAChF,OAAO,CAAC,cAAc,CAA6B;IACnD,4EAA4E;IAC5E,OAAO,CAAC,aAAa,CAAK;IAC1B,4EAA4E;IAC5E,OAAO,CAAC,aAAa,CAAK;IAC1B,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAS;IACzB,wGAAwG;IACxG,OAAO,CAAC,UAAU,CAAoC;IAEtD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAOxC;;IASD,OAAO,CAAC,eAAe,CAwBrB;IAEF;;;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AAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IA8BpD,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,OAAO;IAmFf;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAyBtB;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,WAAW;IA0BnB,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,cAAc;IAqBtB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,eAAe;IA+BvB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,kBAAkB;IA6D1B,0EAA0E;IAC1E,OAAO,CAAC,QAAQ;IAShB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,oBAAoB,CAc1B;IAEF,OAAO,CAAC,mBAAmB;IAiC3B,OAAO,CAAC,gBAAgB;IAuDxB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAQ7B,0EAA0E;IAC1E,OAAO,CAAC,oBAAoB;IAoB5B,iGAAiG;IACjG,OAAO,CAAC,iBAAiB;IAsCzB,wEAAwE;IACxE,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,kBAAkB;IAgG1B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IA8BtB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,gBAAgB;CAsBzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AparteChatViewport } from '../viewport/aparte-chat-viewport.js';
|
|
2
2
|
import type { AparteComposer } from '../composer/aparte-composer.js';
|
|
3
|
+
import '../elicitation/aparte-elicitation.js';
|
|
3
4
|
/**
|
|
4
5
|
* AparteChat - The Shell
|
|
5
6
|
*
|
|
@@ -19,10 +20,13 @@ import type { AparteComposer } from '../composer/aparte-composer.js';
|
|
|
19
20
|
* Size the element via CSS (a height, or let it fill a sized parent).
|
|
20
21
|
*
|
|
21
22
|
* @element aparte-chat
|
|
22
|
-
* @attr placeholder
|
|
23
|
-
* @attr disabled
|
|
24
|
-
* @attr center-empty - Center the composer as a welcome state until the first message, then slide to the normal layout
|
|
25
|
-
* @attr
|
|
23
|
+
* @attr {string} placeholder - Placeholder for the composer input (default composition)
|
|
24
|
+
* @attr {boolean} disabled - Disables the composer
|
|
25
|
+
* @attr {boolean} center-empty - Center the composer as a welcome state until the first message, then slide to the normal layout
|
|
26
|
+
* @attr {boolean} framework-managed - The wrapper's explicit hands-off signal: set it and this
|
|
27
|
+
* element composes none of its own children, because the framework owns them. All four
|
|
28
|
+
* wrappers set it; it was read by this element and declared by nothing until now.
|
|
29
|
+
* @attr {boolean} attachments - Add the file picker + chips strip to the default composition (opt-in: the host must consume the files — an `AparteClient` does, a hand-rolled loop must read `event.detail.files`)
|
|
26
30
|
*
|
|
27
31
|
* @example
|
|
28
32
|
* <!-- Left empty it fills in a viewport, an input and a send button. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat/aparte-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat/aparte-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,sCAAsC,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,SAAS,CAAiC;IAElD;;;;OAIG;IACH,OAAO,CAAC,UAAU,CAAS;IAE3B,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAK5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAmB9F,6EAA6E;IAC7E,IAAI,QAAQ,IAAI,kBAAkB,GAAG,IAAI,CAExC;IAED,qEAAqE;IACrE,IAAI,QAAQ,IAAI,cAAc,GAAG,IAAI,CAEpC;IAED,OAAO,CAAC,OAAO;IAsDf;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAuBxB,6EAA6E;IAC7E,OAAO,CAAC,YAAY;IAKpB,yEAAyE;IACzE,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { AparteComposer } from './aparte-composer.js';
|
|
2
2
|
/**
|
|
3
|
-
* @element aparte-composer-action
|
|
4
|
-
*
|
|
5
3
|
* Generic action button primitive for <aparte-composer>.
|
|
4
|
+
*
|
|
5
|
+
* @element aparte-composer-action
|
|
6
6
|
* The consumer declares it directly in markup — no global registration needed.
|
|
7
7
|
*
|
|
8
|
-
* @attr icon
|
|
9
|
-
* @attr label
|
|
10
|
-
* @attr disabled
|
|
8
|
+
* @attr {string} icon - Icon key for aparteGlobalConfig.getIcon(), or raw SVG/HTML starting with `<`
|
|
9
|
+
* @attr {string} label - Accessible label (also used as tooltip)
|
|
10
|
+
* @attr {boolean} disabled - Disables the button
|
|
11
11
|
*
|
|
12
12
|
* @fires aparte-action-click - Bubbles up when the button is clicked
|
|
13
13
|
* detail: { actionId: string, composer: AparteComposer | null }
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-add-attachment
|
|
3
|
-
*
|
|
4
2
|
* File picker button for <aparte-composer>.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-add-attachment
|
|
5
5
|
* Opens a native file picker on click, then pushes picked files to root.addAttachments().
|
|
6
6
|
* Also sets up drag & drop on the nearest <aparte-composer> root.
|
|
7
7
|
*
|
|
8
|
-
* @attr accept
|
|
9
|
-
* @attr multiple
|
|
8
|
+
* @attr {string} accept - MIME types / extensions passed to the file input (e.g. "image/*,.pdf")
|
|
9
|
+
* @attr {boolean} multiple - Allow multiple file selection (default: true)
|
|
10
|
+
* @attr {boolean} disabled - Greys out the picker and ignores drops.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
13
|
* <!-- Opt-in: nothing consumes the files unless your host does (an AparteClient, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-add-attachment.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-add-attachment.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"aparte-composer-add-attachment.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-add-attachment.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,2BAA4B,SAAQ,WAAW;IACxD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,aAAa,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQvF,OAAO,CAAC,QAAQ;IAIhB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,cAAc;IA8BtB,OAAO,CAAC,YAAY;CAGvB"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-attachments
|
|
3
|
-
*
|
|
4
2
|
* Renders a square thumbnail tile for each file attached to the root composer.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-attachments
|
|
5
5
|
* Image files show the actual picture; other files show an extension badge.
|
|
6
6
|
* The filename and a remove (✗) button surface on hover. Clicking an image asks
|
|
7
7
|
* the app to open it full-size (`aparte-attachment-preview`) — only when the app
|
|
8
8
|
* declared `attachmentPreview` via `aparteGlobalConfig.setHostHandlers()`.
|
|
9
9
|
* Automatically hidden when there are no attachments.
|
|
10
10
|
* Must be a descendant of <aparte-composer>.
|
|
11
|
-
|
|
11
|
+
*
|
|
12
|
+
* @fires {CustomEvent<AparteAttachmentPreviewEventDetail>} aparte-attachment-preview - An attached image was clicked; the app opens it full-size, and only if it declared `attachmentPreview`.
|
|
13
|
+
*
|
|
12
14
|
* @example
|
|
13
15
|
* <!-- The strip hides itself while nothing is attached. Pair it with the picker, and
|
|
14
16
|
* only if your loop actually reads the files from the send event. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-attachments.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-attachments.ts"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"aparte-composer-attachments.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-attachments.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,yBAA0B,SAAQ,WAAW;IACtD,OAAO,CAAC,aAAa,CAAsB;IAC3C,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAgB;IAEnC,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,cAAc;IAYtB,kEAAkE;IAClE,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,OAAO;IA0Df,0EAA0E;IAC1E,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,OAAO;CAGlB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-cancel
|
|
3
|
-
*
|
|
4
2
|
* Cancel/stop streaming button primitive for <aparte-composer>.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-cancel
|
|
5
5
|
* Must be a descendant of <aparte-composer>.
|
|
6
6
|
*
|
|
7
7
|
* Hidden when not streaming. Visible only during active streaming.
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-input
|
|
3
|
-
*
|
|
4
2
|
* Contenteditable text input primitive.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-input
|
|
5
5
|
* Must be a descendant of <aparte-composer>.
|
|
6
6
|
*
|
|
7
|
+
* @fires aparte-composer-submit - Enter was pressed with content. No detail; the composer reads its own value.
|
|
8
|
+
*
|
|
7
9
|
* Behaviour: Enter submits (calls root.submit()), Shift+Enter inserts newline.
|
|
8
10
|
* Auto-expands up to max-height. Paste strips HTML, handles image paste.
|
|
9
11
|
*
|
|
10
|
-
* @attr
|
|
11
|
-
* @attr
|
|
12
|
-
* @attr
|
|
12
|
+
* @attr {boolean} disabled - Makes the field non-editable; the composer's own `disabled` also reaches it.
|
|
13
|
+
* @attr {string} placeholder - Placeholder text (fallback: reads from aparte-composer)
|
|
14
|
+
* @attr {number} max-height - Max height in px before scroll (default: 200)
|
|
15
|
+
* @attr {number} min-height - Min height in px. When omitted, the stylesheet's
|
|
13
16
|
* min-height governs (44px in aparte.css) — so themes can
|
|
14
17
|
* resize the editor in pure CSS without being fought by
|
|
15
18
|
* an inline height.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-input.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-input.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"aparte-composer-input.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-input.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAChD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,aAAa,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAWzB,oBAAoB,IAAI,IAAI;IAU5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IASvF,QAAQ,IAAI,MAAM;IAkBlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ7B,KAAK,IAAI,IAAI;IAQJ,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IAErB,2EAA2E;IAC3E,QAAQ,IAAI,IAAI;IAchB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,cAAc;IAoCtB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,aAAa;IAmBrB;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,eAAe;CAO1B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-toolbar
|
|
3
|
-
*
|
|
4
2
|
* The composer's bottom row — the strip a mode picker, a model selector or a token
|
|
5
3
|
* counter belongs in, rather than a bar of your own floating below the chat. Purely
|
|
6
4
|
* structural: it lays its children out in a row and gets out of the way.
|
|
7
5
|
*
|
|
6
|
+
* @element aparte-composer-toolbar
|
|
7
|
+
*
|
|
8
8
|
* **Position is the DOM order.** `margin-inline-start: auto` on a child pushes it (and
|
|
9
9
|
* everything after it) to the end of the row. That is the whole placement API on
|
|
10
10
|
* purpose: there is no `left`/`right` to be wrong about, so the row reads correctly in a
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* The row is not part of the default `<aparte-chat>` shell — nothing is drawn until you
|
|
14
14
|
* put something in it.
|
|
15
15
|
*
|
|
16
|
-
* @attr data-empty - Reflected BY the element while it holds no element child; the
|
|
16
|
+
* @attr {boolean} data-empty - Reflected BY the element while it holds no element child; the
|
|
17
17
|
* stylesheet hides it then. Read-only, do not set it yourself.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
@@ -46,16 +46,29 @@ export interface AparteComposerChangeEventDetail {
|
|
|
46
46
|
composer: AparteComposer;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* The root context for every `aparte-composer-*` primitive. It imposes no visual
|
|
50
|
+
* layout — the consumer owns the structure — and holds the shared state the parts
|
|
51
|
+
* read: the value, the streaming flag, pending attachments, the panel slot.
|
|
52
|
+
*
|
|
53
|
+
* Prose first, on purpose: when `@element` opens a docblock there is no free text
|
|
54
|
+
* left for the analyser to use, and this component's description came out empty in
|
|
55
|
+
* the manifest and blank on the generated reference page.
|
|
56
|
+
*
|
|
57
|
+
* `aparte-abort` and `aparte-message-aborted` have to be declared by hand and always
|
|
58
|
+
* will: they go out through `window.dispatchEvent` (they concern the whole page, not
|
|
59
|
+
* this subtree), and the analyser's fallback only recognises `this.dispatchEvent`.
|
|
50
60
|
*
|
|
51
|
-
*
|
|
52
|
-
* Does NOT impose any visual layout — the consumer controls structure.
|
|
61
|
+
* @element aparte-composer
|
|
53
62
|
*
|
|
54
|
-
* @attr placeholder
|
|
55
|
-
* @attr disabled
|
|
56
|
-
* @attr target
|
|
63
|
+
* @attr {string} placeholder - Forwarded to `<aparte-composer-input>` through the internal bus.
|
|
64
|
+
* @attr {boolean} disabled - Disables the whole composer, every part included.
|
|
65
|
+
* @attr {string} target - The id of the `<aparte-chat>` this composer drives.
|
|
57
66
|
*
|
|
58
|
-
* @fires aparte-send
|
|
67
|
+
* @fires {CustomEvent<AparteSendEventDetail>} aparte-send - A message was submitted: the text, its attachments and the target.
|
|
68
|
+
* @fires aparte-cancel - The stop button was pressed. No detail; the two window events below carry the target.
|
|
69
|
+
* @fires {CustomEvent<AparteAbortEventDetail>} aparte-abort - Dispatched on `window`: stop the run for this target.
|
|
70
|
+
* @fires {CustomEvent<AparteMessageAbortedEventDetail>} aparte-message-aborted - Dispatched on `window`: the run for this target ended early.
|
|
71
|
+
* @fires {CustomEvent<AparteComposerChangeEventDetail>} aparte-composer-change - Any of value / streaming / disabled / attachments / panel changed, folded into one event.
|
|
59
72
|
*/
|
|
60
73
|
export declare class AparteComposer extends HTMLElement {
|
|
61
74
|
private _value;
|
|
@@ -67,6 +80,20 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
67
80
|
private _panelMode;
|
|
68
81
|
private _panelSubmitEnabled;
|
|
69
82
|
private _panelOnSubmit;
|
|
83
|
+
/**
|
|
84
|
+
* Who owns the one panel slot, and how to tell them they lost it.
|
|
85
|
+
*
|
|
86
|
+
* There is exactly one slot, `showPanel` empties it unconditionally, and nothing
|
|
87
|
+
* used to say whose it was. Three paths therefore closed a panel whose owner was
|
|
88
|
+
* still awaiting an answer, and none of them told the owner: a second `showPanel`,
|
|
89
|
+
* the owner-of-record's own `hidePanel`, and — the one that actually bit —
|
|
90
|
+
* `_handleMessageDone`, which fires on EVERY turn end. A question still open when a
|
|
91
|
+
* turn finished lost its panel while `<aparte-elicitation>` kept `_pending` set,
|
|
92
|
+
* so the request never settled AND every later request was short-circuited for the
|
|
93
|
+
* life of the page.
|
|
94
|
+
*/
|
|
95
|
+
private _panelToken;
|
|
96
|
+
private _panelOnEvict;
|
|
70
97
|
private static readonly _STATE_EVENTS;
|
|
71
98
|
private _onMessageStart;
|
|
72
99
|
private _onMessageDone;
|
|
@@ -154,14 +181,31 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
154
181
|
* used to set on a child: an attribute is themeable, is visible to a consumer's
|
|
155
182
|
* own rules, and does not clobber a `display` the consumer had set (the restore
|
|
156
183
|
* wrote `''`, not the previous value).
|
|
184
|
+
*
|
|
185
|
+
* Returns the TOKEN for this panel. Pass it back to `hidePanel` so a presenter
|
|
186
|
+
* that has already lost the slot cannot close the panel that replaced it, and
|
|
187
|
+
* supply `onEvict` to be told when that happens — an owner that is not told is an
|
|
188
|
+
* owner whose promise nobody can settle.
|
|
157
189
|
*/
|
|
158
190
|
showPanel(panel: HTMLElement, options?: {
|
|
159
191
|
submitEnabled?: boolean;
|
|
160
192
|
onSubmit?: () => void;
|
|
161
193
|
mode?: 'advance' | 'submit';
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
194
|
+
/** Called when something other than this owner closes the panel. */
|
|
195
|
+
onEvict?: () => void;
|
|
196
|
+
}): symbol;
|
|
197
|
+
/**
|
|
198
|
+
* Remove the panel and restore the composer's own controls.
|
|
199
|
+
*
|
|
200
|
+
* With a `token`, this closes the panel only if that token still owns the slot —
|
|
201
|
+
* so a presenter settling late cannot tear down the panel that replaced it. With
|
|
202
|
+
* no token it closes whatever is there, which is what a consumer driving the
|
|
203
|
+
* composer directly means, and what `reset()` needs.
|
|
204
|
+
*/
|
|
205
|
+
hidePanel(token?: symbol): void;
|
|
206
|
+
/** Close the panel AND tell its owner, so a pending request never orphans. */
|
|
207
|
+
private _evictPanel;
|
|
208
|
+
private _teardownPanel;
|
|
165
209
|
/**
|
|
166
210
|
* Update the send button's state while a panel is active.
|
|
167
211
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,kBAAkB,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3C,iBAAiB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACzC,oBAAoB,EAAE;QAAE,WAAW,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IAC9C,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChC,cAAc,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;KAAE,CAAC;CAC3F;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,sBAAsB,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAA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AK,IAAI,IAAI;IAOtB,KAAK,CAAC,CAAC,SAAS,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,IAAI;IAa5F,GAAG,CAAC,CAAC,SAAS,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI;IAQ9G;;mFAE+E;IAC/E,OAAO,CAAC,kBAAkB;IAK1B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,kBAAkB;CAO7B"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AparteConversationList — conversation history sidebar primitive
|
|
3
|
-
*
|
|
4
|
-
* Framework-agnostic web component. The host sets the `conversations`
|
|
5
|
-
* JS property and the `active-id` attribute; the component renders the
|
|
6
|
-
* list and fires events for user interactions.
|
|
7
|
-
*
|
|
8
|
-
* @fires {CustomEvent<AparteConversationSelectDetail>} aparte-select-conversation
|
|
9
|
-
* @fires {CustomEvent<AparteConversationDeleteDetail>} aparte-delete-conversation
|
|
10
|
-
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-archive-conversation
|
|
11
|
-
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-unarchive-conversation
|
|
12
|
-
*/
|
|
13
1
|
export interface AparteConversationListItem {
|
|
14
2
|
id: string;
|
|
15
3
|
title: string;
|
|
@@ -28,6 +16,25 @@ export interface AparteConversationArchiveDetail {
|
|
|
28
16
|
id: string;
|
|
29
17
|
}
|
|
30
18
|
/**
|
|
19
|
+
* Conversation-history sidebar — a framework-agnostic web component. The host sets
|
|
20
|
+
* the `conversations` JS property and the `active-id` attribute; this renders the
|
|
21
|
+
* list and fires the user's intent, never acting on it itself.
|
|
22
|
+
*
|
|
23
|
+
* These four `@fires` reached the manifest through neither of its two paths, which
|
|
24
|
+
* is why this element had no `events` key at all. The tag block was in a docblock at
|
|
25
|
+
* the top of the file, separated from the class by imports and four interfaces — and
|
|
26
|
+
* TypeScript attaches only the adjacent comment. The fallback could not save it
|
|
27
|
+
* either: the analyser's auto-detection visits `ts.isMethodDeclaration` only, and
|
|
28
|
+
* every dispatch here happens inside the `_onClick` arrow class field.
|
|
29
|
+
*
|
|
30
|
+
* @element aparte-conversation-list
|
|
31
|
+
* @attr {string} active-id - The id of the conversation to render as selected.
|
|
32
|
+
*
|
|
33
|
+
* @fires {CustomEvent<AparteConversationSelectDetail>} aparte-select-conversation - A row was activated; the host loads that conversation.
|
|
34
|
+
* @fires {CustomEvent<AparteConversationDeleteDetail>} aparte-delete-conversation - The delete action was pressed. Nothing is removed here.
|
|
35
|
+
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-archive-conversation - The archive action was pressed on a live conversation.
|
|
36
|
+
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-unarchive-conversation - The same action on an already-archived one; same detail shape, opposite intent.
|
|
37
|
+
*
|
|
31
38
|
* @example
|
|
32
39
|
* // The host owns the data: set the `conversations` property, listen for the intent.
|
|
33
40
|
* const list = document.querySelector('aparte-conversation-list')!;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-conversation-list.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-list/aparte-conversation-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aparte-conversation-list.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-list/aparte-conversation-list.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,0BAA0B;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;GACD;IACC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,8BAA8B;IAC3C,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,8BAA8B;IAC3C,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,+BAA+B;IAC5C,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;IACnD,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,SAAS,CAAuB;IAExC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAID,iBAAiB,IAAI,IAAI;IAWzB,oBAAoB,IAAI,IAAI;IAI5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQ9F;;;;OAIG;IACH,OAAO,CAAC,eAAe,CAIrB;IAIF,sEAAsE;IACtE,IAAI,aAAa,CAAC,KAAK,EAAE,0BAA0B,EAAE,EAGpD;IAED,IAAI,aAAa,IAAI,0BAA0B,EAAE,CAEhD;IAID,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,WAAW;IAiDnB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ,CAkCd;IAEF,OAAO,CAAC,UAAU,CAOhB;IAEF,sEAAsE;IACtE,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,IAAI;CAQf"}
|
|
@@ -23,6 +23,18 @@
|
|
|
23
23
|
import { type AparteConfigAware } from '../../config/config-context.js';
|
|
24
24
|
import type { AparteConfig } from '../../config/aparte-config.js';
|
|
25
25
|
/**
|
|
26
|
+
* The default presenter for a request to the human. It renders nothing itself: it
|
|
27
|
+
* registers as the presenter for the config governing its subtree, and mounts a panel
|
|
28
|
+
* inside the nearest `<aparte-composer>` when something asks — a tool handler calling
|
|
29
|
+
* `requestUserInput`, or core's own approval gate.
|
|
30
|
+
*
|
|
31
|
+
* It dispatches no events on purpose. A request is answered through the typed presenter
|
|
32
|
+
* contract, not by listening for one; the `aparte-tool-decision` event this replaced
|
|
33
|
+
* existed only because the buttons used to live in a segment renderer with no reference
|
|
34
|
+
* to the client.
|
|
35
|
+
*
|
|
36
|
+
* @element aparte-elicitation
|
|
37
|
+
*
|
|
26
38
|
* @example
|
|
27
39
|
* <!-- Renders nothing by itself: it registers as the presenter for its subtree, so a
|
|
28
40
|
* tool handler calling requestUserInput() gets its panel mounted in the composer. -->
|