@aparte/core 0.16.11 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/dist/client/aparte-client.d.ts +42 -3
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +22 -0
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +55 -14
- package/dist/components/chat/aparte-chat.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-action.d.ts +5 -3
- package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-toolbar.d.ts +5 -2
- package/dist/components/composer/aparte-composer-toolbar.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer.d.ts +27 -0
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/context/aparte-context.d.ts +8 -0
- package/dist/components/context/aparte-context.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +82 -17
- package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
- package/dist/components/scroll-rail/aparte-scroll-rail.d.ts.map +1 -1
- package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
- package/dist/components/split/aparte-split.d.ts.map +1 -1
- package/dist/components/suggestions/aparte-suggestions.d.ts +37 -3
- package/dist/components/suggestions/aparte-suggestions.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +55 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/action-provider.d.ts +14 -14
- package/dist/config/action-provider.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +109 -14
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/bubble-shell-renderer.d.ts +50 -12
- package/dist/config/bubble-shell-renderer.d.ts.map +1 -1
- package/dist/config/locale.d.ts +33 -1
- package/dist/config/locale.d.ts.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/conversations/conversation-controller.d.ts +14 -0
- package/dist/conversations/conversation-controller.d.ts.map +1 -1
- package/dist/conversations/conversation-manager.d.ts +57 -19
- package/dist/conversations/conversation-manager.d.ts.map +1 -1
- package/dist/conversations/types.d.ts +18 -11
- package/dist/conversations/types.d.ts.map +1 -1
- package/dist/custom-elements.json +12007 -11027
- package/dist/{dialog-triggers-cYGTlfZf.js → dialog-triggers-CJWw0P3l.js} +652 -161
- package/dist/dialog-triggers-CJWw0P3l.js.map +1 -0
- package/dist/generated/element-attributes.d.ts +15 -9
- package/dist/generated/element-attributes.d.ts.map +1 -1
- package/dist/host/aparte-chat-host.d.ts +30 -0
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/index.css +1 -8393
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +644 -111
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +1 -1
- package/dist/index.node.js.map +1 -1
- package/dist/interop/element-props.d.ts +1 -1
- package/dist/primitives/select/aparte-optgroup.d.ts +1 -0
- package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts +12 -1
- package/dist/primitives/select/aparte-select.d.ts.map +1 -1
- package/dist/renderers/markdown-stream.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/dist/runtime/message-repository.d.ts +16 -3
- package/dist/runtime/message-repository.d.ts.map +1 -1
- package/dist/types/chat.d.ts +41 -46
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/event-map.d.ts +7 -7
- package/dist/types/event-map.d.ts.map +1 -1
- package/dist/types/events.d.ts +7 -6
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/imperative-api.d.ts +16 -0
- package/dist/types/imperative-api.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/models.d.ts +9 -0
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/segments.d.ts +56 -13
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +14 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/event-target.d.ts +31 -0
- package/dist/utils/event-target.d.ts.map +1 -0
- package/dist/utils/transcript.d.ts +13 -0
- package/dist/utils/transcript.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/dialog-triggers-cYGTlfZf.js.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Replace the *structural skeleton* of `<aparte-chat-bubble>` — the markup the
|
|
5
5
|
* bubble renders once and then populates — while keeping all of its behavior
|
|
6
6
|
* (segments, streaming, action bar, avatar, branch picker). This is the
|
|
7
|
-
* whole-structure override that
|
|
7
|
+
* whole-structure override that `renderBubble` (wrapper-level,
|
|
8
8
|
* replaces the element entirely) is not: here the native bubble stays in charge.
|
|
9
9
|
*
|
|
10
10
|
* Return an HTML **string** or a ready **HTMLElement** (charter §6:
|
|
@@ -13,17 +13,55 @@
|
|
|
13
13
|
*
|
|
14
14
|
* - Root element **must** be `.aparte-message` (it carries `data-role` and receives
|
|
15
15
|
* `data-streaming` / `data-error`; the styles target it).
|
|
16
|
-
* - Include the region hooks you want the bubble to populate
|
|
17
|
-
* stay empty (every lookup is null-guarded —
|
|
18
|
-
*
|
|
19
|
-
* - `.aparte-
|
|
20
|
-
* - `.aparte-
|
|
21
|
-
* - `.aparte-
|
|
22
|
-
* - `.aparte-
|
|
23
|
-
* - `.aparte-content`
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
16
|
+
* - Include the region hooks you want the bubble to populate, in the order the default
|
|
17
|
+
* shell renders them. Any you omit simply stay empty (every lookup is null-guarded —
|
|
18
|
+
* graceful degradation):
|
|
19
|
+
* - `.aparte-avatar` — filled by the avatar provider / initial
|
|
20
|
+
* - `.aparte-name` — the display name (you set it from `ctx.name`)
|
|
21
|
+
* - `.aparte-timestamp` — the formatted time
|
|
22
|
+
* - `.aparte-attachments` — user-message attachment chips
|
|
23
|
+
* - `.aparte-message-content` — the painted content box, and it HOLDS the next three
|
|
24
|
+
* (`.aparte-segments`, `.aparte-content`, `.aparte-waiting`):
|
|
25
|
+
* the background, the radius and the padding of a user
|
|
26
|
+
* message are declared on this box, so rendering the three
|
|
27
|
+
* as its siblings leaves a message with no bubble — every
|
|
28
|
+
* behaviour intact, the look gone. The bubble hides the box
|
|
29
|
+
* when the turn has nothing to show, so an attachments-only
|
|
30
|
+
* message does not draw an empty coloured rectangle
|
|
31
|
+
* - `.aparte-segments` — streamed/structured segments
|
|
32
|
+
* - `.aparte-content` — simple markdown content
|
|
33
|
+
* - `.aparte-waiting` — the dots between "user sends" and the first token. The
|
|
34
|
+
* bubble only SHOWS and HIDES this region; the markup that
|
|
35
|
+
* paints is yours: a `.aparte-dots` span holding three
|
|
36
|
+
* `.aparte-dot` spans (the stylesheet animates them), and a
|
|
37
|
+
* `.aparte-sr-only` span for the label the screen reader
|
|
38
|
+
* hears. With the label alone the region has nothing to
|
|
39
|
+
* draw and the reader watches an empty box while the model
|
|
40
|
+
* composes
|
|
41
|
+
* - `.aparte-footer` — the row that holds the branch picker and the actions
|
|
42
|
+
* - `.aparte-branch-picker` — with `.aparte-branch-prev` / `.aparte-branch-label` /
|
|
43
|
+
* `.aparte-branch-next` for sibling navigation, and
|
|
44
|
+
* `.aparte-branch-status` (a `.aparte-sr-only` span with
|
|
45
|
+
* `aria-live="polite"`) for the announcement
|
|
46
|
+
* - `.aparte-action-bar` — copy/retry/edit/… + custom actions
|
|
47
|
+
*
|
|
48
|
+
* Omitting most of these costs you something you can see. **The two that fail silently
|
|
49
|
+
* are `.aparte-waiting` and `.aparte-branch-status`**: without the first there is no
|
|
50
|
+
* "thinking" state at all while the model composes, and without the second a
|
|
51
|
+
* screen-reader user gets no word that the branch moved — the arrows deliberately do
|
|
52
|
+
* not take focus, so nothing else announces it.
|
|
53
|
+
*
|
|
54
|
+
* ARIA is the one thing this list does NOT ask of you. A shell is markup, and a contract
|
|
55
|
+
* that also demanded a `role` and a name would lose both the first time an author forgot
|
|
56
|
+
* one, silently. So the bubble writes `role="article"` and the accessible name onto your
|
|
57
|
+
* root itself, after your shell renders — unless the root already carries a `role`, which
|
|
58
|
+
* is how you override it: the bubble then leaves the accessible name to you as well.
|
|
59
|
+
*
|
|
60
|
+
* Two more classes carry the DEFAULT LAYOUT and nothing else — the bubble never queries
|
|
61
|
+
* them, so a shell that lays itself out differently is free to drop both: `.aparte-body`
|
|
62
|
+
* (the column beside the avatar, and the containing block the footer floats in) and
|
|
63
|
+
* `.aparte-header` (the name and time row). Keep them and the default stylesheet lays
|
|
64
|
+
* your shell out like the native bubble.
|
|
27
65
|
*
|
|
28
66
|
* Prefer `renderBubble` (wrapper) when you want a fully custom element; use this
|
|
29
67
|
* when you want to keep the native bubble's machinery but reshape its layout.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubble-shell-renderer.d.ts","sourceRoot":"","sources":["../../src/config/bubble-shell-renderer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bubble-shell-renderer.d.ts","sourceRoot":"","sources":["../../src/config/bubble-shell-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE;IAC1C,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACzB,KAAK,MAAM,GAAG,WAAW,CAAC"}
|
package/dist/config/locale.d.ts
CHANGED
|
@@ -17,6 +17,18 @@
|
|
|
17
17
|
* meet: TypeScript gives a type alias an implicit index signature and an interface
|
|
18
18
|
* none, so only this form is assignable to the extensions record that
|
|
19
19
|
* `setLocale`/`extendLocale` accept and `getLocale` returns.
|
|
20
|
+
*
|
|
21
|
+
* Eleven keys here are rendered by no core file — the artifact card's six, its two
|
|
22
|
+
* sandbox lines, the compaction summary's title, the approval mode picker's label and the
|
|
23
|
+
* model selector's placeholder, all drawn by a plugin. They belong in this bag anyway: the
|
|
24
|
+
* locale is one flat object every package shares, so a translator fills one record and
|
|
25
|
+
* `@aparte/locale-fr` needs no companion per plugin. They are the
|
|
26
|
+
* exception rather than the pattern, though, and a closed one: a plugin of your own
|
|
27
|
+
* reads its strings off `getLocale()` and defaults them at the call site (the
|
|
28
|
+
* localization guide shows it), and `check:locale-keys` holds those eleven in
|
|
29
|
+
* `PLUGIN_OWNED` and refuses a twelfth. The reason is that a key here is a published name
|
|
30
|
+
* before it is a word: it ships in every locale package, and the frozen surface then
|
|
31
|
+
* keeps it for two releases.
|
|
20
32
|
*/
|
|
21
33
|
export type AparteLocale = {
|
|
22
34
|
inputPlaceholder: string;
|
|
@@ -52,6 +64,10 @@ export type AparteLocale = {
|
|
|
52
64
|
messageInfo?: string;
|
|
53
65
|
/** Default title for a new conversation (default: "New Chat") */
|
|
54
66
|
newChat: string;
|
|
67
|
+
/** Read by a screen reader while the conversation list is on its way (default: "Loading conversations") */
|
|
68
|
+
loadingConversations: string;
|
|
69
|
+
/** Read by a screen reader while a conversation's messages are on their way (default: "Loading the conversation") */
|
|
70
|
+
loadingConversation: string;
|
|
55
71
|
/**
|
|
56
72
|
* The "Delete" item of a row's menu (default: "Delete"). Used to be the aria-label
|
|
57
73
|
* of a permanent ✕ on every row ("Delete conversation"); the menu is named after
|
|
@@ -356,7 +372,23 @@ export type AparteLocale = {
|
|
|
356
372
|
* have chosen French strings, French formatting is what you meant.
|
|
357
373
|
*/
|
|
358
374
|
tag?: string;
|
|
359
|
-
/**
|
|
375
|
+
/**
|
|
376
|
+
* Reading direction — `'ltr'` or `'rtl'`. Written as `dir` onto the viewport's
|
|
377
|
+
* scroll container and onto `<aparte-composer>`, so everything inside inherits it.
|
|
378
|
+
*
|
|
379
|
+
* Undefined on purpose in the English default, for the reason `tag` above is:
|
|
380
|
+
* `undefined` means "follow the host". The default used to be the literal
|
|
381
|
+
* `'ltr'`, which meant core wrote `dir="ltr"` on its own DOM — so a page that
|
|
382
|
+
* had said `<html dir="rtl">` got a mirrored app shell around a chat that was
|
|
383
|
+
* still left-to-right, and nothing said why. Not declaring it lets the host's
|
|
384
|
+
* direction inherit, which is what a library should do with a decision the page
|
|
385
|
+
* has already taken.
|
|
386
|
+
*
|
|
387
|
+
* A locale that wants the direction PINNED still declares it, and that is the
|
|
388
|
+
* case it exists for: `@aparte/locale-ar` would say `'rtl'` whatever the page
|
|
389
|
+
* around it does. `setLocale` replaces the object wholesale, so nothing merges a
|
|
390
|
+
* default back in.
|
|
391
|
+
*/
|
|
360
392
|
direction?: 'ltr' | 'rtl';
|
|
361
393
|
};
|
|
362
394
|
/**
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;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,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAGhB,GAAG,EAAE,MAAM,CAAC;IAGZ,IAAI,EAAE,MAAM,CAAC;IAGb,oEAAoE;IACpE,YAAY,EAAE,MAAM,CA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AM,CAAC;IACxB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;;;;OAgBG;IACH,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,YA0FnC,CAAC"}
|
|
@@ -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;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,aAKzB,CAAC;AAqIH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7D;
|
|
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;AAoPD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAY9B,CAAC"}
|
|
@@ -24,6 +24,11 @@ export interface AparteChatBinding {
|
|
|
24
24
|
clearMessages(options?: {
|
|
25
25
|
revokeAttachments?: boolean;
|
|
26
26
|
}): void;
|
|
27
|
+
/**
|
|
28
|
+
* The transcript is on its way, or no longer: a conversation was chosen and its
|
|
29
|
+
* messages are being fetched. The DOM binding sets the viewport's `loading`.
|
|
30
|
+
*/
|
|
31
|
+
setLoading?(loading: boolean): void;
|
|
27
32
|
/**
|
|
28
33
|
* Export the full conversation tree for persistence.
|
|
29
34
|
* Optional: only available when the binding wraps a `AparteMessageRepository`
|
|
@@ -87,6 +92,8 @@ export declare class AparteConversationController {
|
|
|
87
92
|
private _subscribedTo;
|
|
88
93
|
/** Between bind() and unbind(): the only time a manager subscription may be installed. */
|
|
89
94
|
private _bound;
|
|
95
|
+
/** The binding shows the wait this controller asked for — see `_showWait`. */
|
|
96
|
+
private _waitShown;
|
|
90
97
|
/**
|
|
91
98
|
* React to an external mutation of the manager (another component deleting or
|
|
92
99
|
* archiving the active conversation). Without this the binding would keep
|
|
@@ -136,6 +143,13 @@ export declare class AparteConversationController {
|
|
|
136
143
|
* reload never kills an in-flight response.
|
|
137
144
|
*/
|
|
138
145
|
setConversationId(id: string | null): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* The binding's wait, owned here: whoever runs `setConversationId` last clears it
|
|
148
|
+
* — a loaded conversation or a new chat that replaces a fetch, a delete of the
|
|
149
|
+
* one being fetched — so a wait shown for one call never outlives the call that
|
|
150
|
+
* superseded it.
|
|
151
|
+
*/
|
|
152
|
+
private _showWait;
|
|
139
153
|
/**
|
|
140
154
|
* Snapshot the binding's current messages and push them to the manager.
|
|
141
155
|
* No-op when there is no active conversation or no manager registered.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-controller.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,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C,cAAc,CAA6B;IACnD,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,qBAAqB,CAAqC;IAClE,OAAO,CAAC,mBAAmB,CAA6B;IACxD,wFAAwF;IACxF,OAAO,CAAC,aAAa,CAA0C;IAC/D,0FAA0F;IAC1F,OAAO,CAAC,MAAM,CAAS;
|
|
1
|
+
{"version":3,"file":"conversation-controller.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAOlF;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,2EAA2E;IAC3E,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC7C,0EAA0E;IAC1E,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5C,qCAAqC;IACrC,WAAW,IAAI,aAAa,EAAE,CAAC;IAC/B,kEAAkE;IAClE,aAAa,CAAC,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/D;;;OAGG;IACH,UAAU,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,UAAU,CAAC,IAAI,yBAAyB,GAAG,SAAS,CAAC;IACrD;;;;;OAKG;IACH,UAAU,CAAC,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,mC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d;;;;;;;;;;OAUG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAwKzD;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAUjB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;YA+BR,6BAA6B;CAiE9C"}
|
|
@@ -39,20 +39,6 @@ export declare function applyRetention(messages: AparteMessage[], tree: Exported
|
|
|
39
39
|
messages: AparteMessage[];
|
|
40
40
|
tree: ExportedMessageRepository | undefined;
|
|
41
41
|
};
|
|
42
|
-
/**
|
|
43
|
-
* Framework-agnostic conversation manager.
|
|
44
|
-
*
|
|
45
|
-
* Usage:
|
|
46
|
-
* ```ts
|
|
47
|
-
* const manager = new AparteConversationManager(myAdapter);
|
|
48
|
-
* await manager.init(); // load from storage
|
|
49
|
-
* const conv = await manager.createNew(); // returns new AparteConversation
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* The manager emits synchronous notifications to registered listeners on every
|
|
53
|
-
* mutation so framework wrappers (Angular signals, Vue reactive, etc.) can
|
|
54
|
-
* react without polling.
|
|
55
|
-
*/
|
|
56
42
|
export declare class AparteConversationManager {
|
|
57
43
|
private _adapter;
|
|
58
44
|
private _conversations;
|
|
@@ -61,6 +47,14 @@ export declare class AparteConversationManager {
|
|
|
61
47
|
private _initialized;
|
|
62
48
|
private _retention;
|
|
63
49
|
private _titleProvider;
|
|
50
|
+
/** Ids whose messages are in memory. Every id, after a loadAll(); only fetched ones after loadMeta(). */
|
|
51
|
+
private _loaded;
|
|
52
|
+
/** One fetch per id at a time: a second ensureFull(id) while the first is in flight joins it. */
|
|
53
|
+
private _fetching;
|
|
54
|
+
/** One append per id at a time: the next addMessage(id) reads what the previous one wrote. */
|
|
55
|
+
private _appending;
|
|
56
|
+
/** The list on its way: a conversation created meanwhile waits for it, or the list would replace it. */
|
|
57
|
+
private _initPromise;
|
|
64
58
|
constructor(adapter: AparteStorageAdapter, options?: ConversationManagerOptions);
|
|
65
59
|
/**
|
|
66
60
|
* Replace how a new conversation is titled from its first user message.
|
|
@@ -70,8 +64,31 @@ export declare class AparteConversationManager {
|
|
|
70
64
|
setTitleProvider(provider: AparteConversationTitleProvider | null): void;
|
|
71
65
|
/** The registered title provider, or `null` when the default applies. */
|
|
72
66
|
getTitleProvider(): AparteConversationTitleProvider | null;
|
|
73
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Load all conversations from the adapter. Call once at app startup.
|
|
69
|
+
*
|
|
70
|
+
* A later call re-reads the list from the store: rows it no longer lists are
|
|
71
|
+
* dropped, and a conversation whose messages are already in memory keeps them —
|
|
72
|
+
* so the one on screen goes on being persisted.
|
|
73
|
+
*/
|
|
74
74
|
init(): Promise<void>;
|
|
75
|
+
/** Whether a conversation's messages are in memory (always, without split storage). */
|
|
76
|
+
isLoaded(id: string): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch a conversation's messages through the adapter's loadFull(), the first time
|
|
79
|
+
* they are needed; later calls resolve at once. The row keeps its place and its meta;
|
|
80
|
+
* the messages (and the tree) come from the full record, and a message written to
|
|
81
|
+
* the row while the fetch ran goes after them. Resolves `false` when the store has no
|
|
82
|
+
* such record (or answers with another id) — the row is then NOT loaded, and says so,
|
|
83
|
+
* rather than counting as an empty conversation.
|
|
84
|
+
*/
|
|
85
|
+
ensureFull(id: string): Promise<boolean>;
|
|
86
|
+
/**
|
|
87
|
+
* The row with its messages in memory — fetched first when they are not, so a
|
|
88
|
+
* metadata change never writes a row back without them. `null` when the id is
|
|
89
|
+
* unknown or the store has no record to fetch.
|
|
90
|
+
*/
|
|
91
|
+
private _full;
|
|
75
92
|
/**
|
|
76
93
|
* Whether `init()` has completed at least once. Consumers use this to
|
|
77
94
|
* distinguish "manager still hydrating from storage" from "manager
|
|
@@ -87,14 +104,27 @@ export declare class AparteConversationManager {
|
|
|
87
104
|
get activeConversations(): AparteConversation[];
|
|
88
105
|
/** Archived conversations, newest first. */
|
|
89
106
|
get archivedConversations(): AparteConversation[];
|
|
90
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Create a new empty conversation, persist it, and make it active. Untitled by
|
|
109
|
+
* default: the list shows its locale's `newChat` word for an empty title, so the
|
|
110
|
+
* store never carries an English string a French UI would then display.
|
|
111
|
+
*/
|
|
91
112
|
createNew(title?: string): Promise<AparteConversation>;
|
|
92
113
|
/** Switch active conversation without touching storage. */
|
|
93
114
|
select(id: string): void;
|
|
94
115
|
/** Deselect the active conversation (no conv selected). */
|
|
95
116
|
clearActive(): void;
|
|
96
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Append a message to a conversation. Auto-generates title from first user message.
|
|
119
|
+
*
|
|
120
|
+
* One append at a time per conversation: two sends that overlap (a suggestion and a
|
|
121
|
+
* quick type, coalesced into one new conversation) both suspend before reading the
|
|
122
|
+
* record — for the messages, then for the title provider — so both used to read a
|
|
123
|
+
* conversation with no user message in it yet, and the second one's text became the
|
|
124
|
+
* title.
|
|
125
|
+
*/
|
|
97
126
|
addMessage(convId: string, msg: AparteMessage): Promise<void>;
|
|
127
|
+
private _append;
|
|
98
128
|
/**
|
|
99
129
|
* Replace the flat active-path messages and optionally the full branch tree.
|
|
100
130
|
* `messages` is always written (active path, for sidebar/title/compat).
|
|
@@ -105,6 +135,13 @@ export declare class AparteConversationManager {
|
|
|
105
135
|
delete(id: string): Promise<void>;
|
|
106
136
|
/** Archive a conversation (soft-delete). */
|
|
107
137
|
archive(id: string): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* A metadata change, through the adapter's own hook when it has one (the row is
|
|
140
|
+
* updated in memory, nothing else travels), else through `save()` — with the
|
|
141
|
+
* messages fetched first, so a row the list came with (`messages: []`) is never
|
|
142
|
+
* written back over the stored ones.
|
|
143
|
+
*/
|
|
144
|
+
private _meta;
|
|
108
145
|
/** Restore an archived conversation. */
|
|
109
146
|
unarchive(id: string): Promise<void>;
|
|
110
147
|
/**
|
|
@@ -126,8 +163,9 @@ export declare class AparteConversationManager {
|
|
|
126
163
|
private _replace;
|
|
127
164
|
private _notify;
|
|
128
165
|
/**
|
|
129
|
-
* The title of a conversation, decided
|
|
130
|
-
*
|
|
166
|
+
* The title of a conversation, decided on its first user message — and again if
|
|
167
|
+
* that message is edited while the title is still the manager's: the provider's
|
|
168
|
+
* answer when one is registered and answers, else the default.
|
|
131
169
|
*/
|
|
132
170
|
private _title;
|
|
133
171
|
private _autoTitle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-manager.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation-manager.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAIlF,KAAK,QAAQ,GAAG,CAAC,aAAa,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAEjH,MAAM,WAAW,0BAA0B;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,+BAA+B,CAAC;IAChD;;;;;;OAMG;IACH,SAAS,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,aAAa,EAAE,EACzB,IAAI,EAAE,yBAAyB,GAAG,SAAS,EAC3C,WAA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;YACW,MAAM;IAYpB,OAAO,CAAC,UAAU;CAOrB"}
|
|
@@ -16,8 +16,21 @@ export declare const APARTE_CONVERSATION_SCHEMA_VERSION: 2;
|
|
|
16
16
|
*/
|
|
17
17
|
export interface AparteConversation {
|
|
18
18
|
id: string;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The title. Decided by the manager from the first user message (the text as
|
|
21
|
+
* typed, or what the title provider returns), or typed by the user. Empty when
|
|
22
|
+
* the conversation has no text yet: the list shows its locale's `newChat` word,
|
|
23
|
+
* and the store never carries a UI string.
|
|
24
|
+
*/
|
|
20
25
|
title: string;
|
|
26
|
+
/**
|
|
27
|
+
* `true` while the title is the manager's decision. Editing the first user
|
|
28
|
+
* message then re-titles; a title typed by the user (`updateTitle`) clears it
|
|
29
|
+
* and is kept whatever happens to the messages. Absent on records written
|
|
30
|
+
* before this field existed, which reads as "typed": an old title is never
|
|
31
|
+
* overwritten.
|
|
32
|
+
*/
|
|
33
|
+
autoTitle?: boolean;
|
|
21
34
|
createdAt: number;
|
|
22
35
|
updatedAt: number;
|
|
23
36
|
messages: AparteMessage[];
|
|
@@ -34,8 +47,6 @@ export interface AparteConversation {
|
|
|
34
47
|
archivedAt?: number;
|
|
35
48
|
/** When truthy the conversation is pinned at the top of the list. */
|
|
36
49
|
pinnedAt?: number;
|
|
37
|
-
/** Optional folder/tag id for organisation (V2+). */
|
|
38
|
-
folderId?: string;
|
|
39
50
|
/**
|
|
40
51
|
* Schema version of this record. Absent on legacy data (pre-versioning):
|
|
41
52
|
* adapters should treat `undefined` as version 0 and migrate on read.
|
|
@@ -54,13 +65,6 @@ export interface AparteConversationMeta {
|
|
|
54
65
|
updatedAt: number;
|
|
55
66
|
archivedAt?: number;
|
|
56
67
|
pinnedAt?: number;
|
|
57
|
-
folderId?: string;
|
|
58
|
-
/** Truncated last message body (≤200 chars) — for sidebar previews. */
|
|
59
|
-
lastMessagePreview?: string;
|
|
60
|
-
/** Cached message count for the sidebar badge / archive logic. */
|
|
61
|
-
messageCount?: number;
|
|
62
|
-
/** Sum of input+output tokens across messages, when available. */
|
|
63
|
-
totalTokens?: number;
|
|
64
68
|
/** Persisted schema version of the row. */
|
|
65
69
|
schemaVersion?: number;
|
|
66
70
|
}
|
|
@@ -92,7 +96,10 @@ export interface AparteAttachmentRow {
|
|
|
92
96
|
* artifact gallery index. Each is a product's own table — the shape of a "memory
|
|
93
97
|
* fact" or of a settings entry is the app's decision — and a public contract
|
|
94
98
|
* carrying one app's schema binds every other adapter to it. An app that needs
|
|
95
|
-
* them extends this interface in its own code.
|
|
99
|
+
* them extends this interface in its own code. Nor is a row's own bookkeeping: a
|
|
100
|
+
* folder id, a cached last-message preview, a message count and a token total are
|
|
101
|
+
* things a store computes for itself, so they live on the adapter's own row shape
|
|
102
|
+
* rather than on `AparteConversation` / `AparteConversationMeta`.
|
|
96
103
|
*/
|
|
97
104
|
export interface AparteStorageAdapter {
|
|
98
105
|
/** Return all stored conversations (full payload), ordered by updatedAt desc. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/conversations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,EAAG,CAAU,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/conversations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,EAAG,CAAU,C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