@genesislcap/ai-assistant 15.23.3 → 15.24.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/ai-assistant.api.json +419 -50
- package/dist/ai-assistant.d.ts +217 -683
- package/dist/chat-driver.cjs.map +1 -1
- package/dist/chat-driver.mjs.map +1 -1
- package/dist/custom-elements.json +310 -609
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +16 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/components/settings-modal/index.d.ts +1 -0
- package/dist/dts/components/settings-modal/index.d.ts.map +1 -1
- package/dist/dts/components/settings-modal/settings-modal.d.ts +215 -0
- package/dist/dts/components/settings-modal/settings-modal.d.ts.map +1 -0
- package/dist/dts/components/settings-modal/settings-modal.template.d.ts.map +1 -1
- package/dist/dts/main/attachment-controller.d.ts +66 -0
- package/dist/dts/main/attachment-controller.d.ts.map +1 -0
- package/dist/dts/main/budget-controller.d.ts +368 -0
- package/dist/dts/main/budget-controller.d.ts.map +1 -0
- package/dist/dts/main/composer-menu-controller.d.ts +113 -0
- package/dist/dts/main/composer-menu-controller.d.ts.map +1 -0
- package/dist/dts/main/composer-resize-controller.d.ts +80 -0
- package/dist/dts/main/composer-resize-controller.d.ts.map +1 -0
- package/dist/dts/main/context-gate-controller.d.ts +197 -0
- package/dist/dts/main/context-gate-controller.d.ts.map +1 -0
- package/dist/dts/main/cost-ledger-controller.d.ts +228 -0
- package/dist/dts/main/cost-ledger-controller.d.ts.map +1 -0
- package/dist/dts/main/main.d.ts +201 -722
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.types.d.ts +25 -0
- package/dist/dts/main/main.types.d.ts.map +1 -1
- package/dist/dts/main/meta-snapshot.d.ts +50 -0
- package/dist/dts/main/meta-snapshot.d.ts.map +1 -0
- package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +18 -0
- package/dist/esm/components/settings-modal/index.js +1 -0
- package/dist/esm/components/settings-modal/settings-modal.js +436 -0
- package/dist/esm/components/settings-modal/settings-modal.template.js +15 -4
- package/dist/esm/main/attachment-controller.js +254 -0
- package/dist/esm/main/budget-controller.js +745 -0
- package/dist/esm/main/composer-menu-controller.js +234 -0
- package/dist/esm/main/composer-resize-controller.js +119 -0
- package/dist/esm/main/context-gate-controller.js +289 -0
- package/dist/esm/main/cost-ledger-controller.js +498 -0
- package/dist/esm/main/main.js +501 -2268
- package/dist/esm/main/meta-snapshot.js +108 -0
- package/dist/esm/state/persistence/session-persister.js +5 -4
- package/docs/migration-GENC-1580.md +209 -0
- package/package.json +16 -16
|
@@ -286,4 +286,20 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
|
|
|
286
286
|
*/
|
|
287
287
|
private appendInlineMessage;
|
|
288
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Narrow a driver to an orchestrator, or `undefined` for a bare `ChatDriver`.
|
|
291
|
+
*
|
|
292
|
+
* **The one place in the package that tests for this type** (`docs/code-health.md`
|
|
293
|
+
* §11.2 constraint 3). Orchestration-only capabilities — the agent pin, the
|
|
294
|
+
* flow-owner lock, the context guard — are reached through it, so when §7.1 lifts
|
|
295
|
+
* those onto `AiDriver` and they stop being orchestrator-only, this function is
|
|
296
|
+
* what changes rather than every consumer.
|
|
297
|
+
*
|
|
298
|
+
* Lives beside the class rather than on the assistant element because two modules
|
|
299
|
+
* need it: the element (for its own driver) and the session persister (for the
|
|
300
|
+
* driver it restores into), and a private element accessor cannot serve both.
|
|
301
|
+
*
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
export declare function asOrchestrator(driver?: AiDriver): OrchestratingDriver | undefined;
|
|
289
305
|
//# sourceMappingURL=orchestrating-driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/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,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAmC7E,mBAAmB;IAwJ3B,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrF,qDAAqD;IACrD,uBAAuB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIjE;;;;OAIG;IACH,iBAAiB,IAAI,wBAAwB,GAAG,SAAS;IAiDzD,4CAA4C;IAC5C,cAAc,IAAI,WAAW,GAAG,SAAS;YAI3B,UAAU;IA2GxB;;;;;;;;;;OAUG;YACW,kBAAkB;IAuBhC;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAKd;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB9B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IAoCrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAgCd,QAAQ;IAmMtB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAe5B"}
|
|
1
|
+
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,KAAK,EAAE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d;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB9B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IAoCrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAgCd,QAAQ;IAmMtB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAe5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAEjF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { SettingsModalController, type SettingsModalDeps, type SettingsModalTabsElement, } from './settings-modal';
|
|
1
2
|
export { SettingsModalTemplate, type SettingsModalTab } from './settings-modal.template';
|
|
2
3
|
export { settingsModalStyles } from './settings-modal.styles';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings-modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings-modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { ChatConfig } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { Modal } from '@genesislcap/rapid-design-system';
|
|
3
|
+
import type { SettingsContextUsage } from '../../main/main.types';
|
|
4
|
+
import type { AssistantAppSettingsHeading, AssistantAppSettingsProvider, AssistantAppSettingsToggle } from '../../provider/assistant-app-settings';
|
|
5
|
+
import type { MetaEventType } from '../../state/debug-event-log';
|
|
6
|
+
import type { ResolvedCostHistoryConfig } from '../../utils/resolve-cost-history-config';
|
|
7
|
+
import type { SettingsModalTab } from './settings-modal.template';
|
|
8
|
+
/** Design-system tabs element bound to the settings modal tab bar. */
|
|
9
|
+
export type SettingsModalTabsElement = HTMLElement & {
|
|
10
|
+
activeid?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* What the controller needs from its host.
|
|
14
|
+
*
|
|
15
|
+
* The DOM refs (`modal`, `tabsEl`) are callbacks rather than controller state
|
|
16
|
+
* because the template owns them: it writes them by name through `ref(...)`, so
|
|
17
|
+
* they have to stay real properties on the element. The same is NOT true of the
|
|
18
|
+
* four `*Slotted` arrays — `slotted(...)` also writes by name, but those are read
|
|
19
|
+
* by the visibility getters, so the controller owns them and the element keeps
|
|
20
|
+
* delegating get/**set** pairs for the template to write through.
|
|
21
|
+
*/
|
|
22
|
+
export interface SettingsModalDeps {
|
|
23
|
+
chatConfig: () => ChatConfig;
|
|
24
|
+
contextTokens: () => number | undefined;
|
|
25
|
+
contextLimit: () => number | undefined;
|
|
26
|
+
/** The budget meter's own gate — the money sibling of the context indicator. */
|
|
27
|
+
budgetUsageVisible: () => boolean;
|
|
28
|
+
/** Resolved `chatConfig.costHistory`, owned by the cost ledger. */
|
|
29
|
+
costConfig: () => ResolvedCostHistoryConfig;
|
|
30
|
+
costHistoryLength: () => number;
|
|
31
|
+
liveCostSessionTitle: () => string | undefined;
|
|
32
|
+
providerStatusCount: () => number;
|
|
33
|
+
/**
|
|
34
|
+
* The live session store, read only to keep the lifetime-usage gate reactive to
|
|
35
|
+
* a session swap — it depends on `getStateKey()`, which is not observable.
|
|
36
|
+
*/
|
|
37
|
+
sessionRef: () => unknown;
|
|
38
|
+
stateKey: () => string | undefined;
|
|
39
|
+
popoutMode: () => string | undefined;
|
|
40
|
+
headerTitle: () => string | undefined;
|
|
41
|
+
appSettingsProvider: () => AssistantAppSettingsProvider;
|
|
42
|
+
modal: () => Modal | undefined;
|
|
43
|
+
tabsEl: () => SettingsModalTabsElement | undefined;
|
|
44
|
+
/** Asked for on open, so the figures are fresh when someone is looking at them. */
|
|
45
|
+
requestBudgetRefresh: () => void;
|
|
46
|
+
logMeta: (type: MetaEventType, detail?: Record<string, unknown>) => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The settings modal: which of its sections have anything in them, the two-tab
|
|
50
|
+
* state, and the design-system tab bar's selection and underline.
|
|
51
|
+
*
|
|
52
|
+
* This file is also the `settings-modal.ts` the folder never had (`docs/code-health.md`
|
|
53
|
+
* §3) — the 943-line template and 853-line stylesheet previously bound against a
|
|
54
|
+
* component that existed only as ~25 getters on the assistant element.
|
|
55
|
+
*
|
|
56
|
+
* **Every section gate answers "is there anything in here", never "should this
|
|
57
|
+
* feature exist".** A slot with no assigned nodes, a toggle list whose `visible()`
|
|
58
|
+
* predicates all say no, a cost tab with nothing switched on — each collapses its
|
|
59
|
+
* own container rather than leaving a heading over emptiness or a flex gap after
|
|
60
|
+
* nothing. That is why the gates nest (`…HeadingVisible` is broader than
|
|
61
|
+
* `…SectionVisible`) instead of each re-deriving the config.
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export declare class SettingsModalController {
|
|
66
|
+
private readonly deps;
|
|
67
|
+
/** Whether the modal is open. */
|
|
68
|
+
open: boolean;
|
|
69
|
+
/** Active tab. Reset to `'settings'` on every open and close — see `openModal`. */
|
|
70
|
+
tab: SettingsModalTab;
|
|
71
|
+
/**
|
|
72
|
+
* Bumped to re-render the app toggles when the host provider notifies a change.
|
|
73
|
+
*
|
|
74
|
+
* A revision counter rather than a copy of the provider's values: the provider
|
|
75
|
+
* owns them, may compute `visible()` and `getValue()` on demand, and is free to
|
|
76
|
+
* change without telling us which entry moved. Every toggle getter reads this
|
|
77
|
+
* first, so one bump invalidates the lot.
|
|
78
|
+
*/
|
|
79
|
+
appSettingsRevision: number;
|
|
80
|
+
/**
|
|
81
|
+
* Light-DOM nodes assigned to the modal's four slots, written by the template's
|
|
82
|
+
* `slotted(...)` bindings through the element's delegating setters.
|
|
83
|
+
*/
|
|
84
|
+
modelSlotted: HTMLElement[];
|
|
85
|
+
appSlotted: HTMLElement[];
|
|
86
|
+
costCurrentSlotted: HTMLElement[];
|
|
87
|
+
costHistorySlotted: HTMLElement[];
|
|
88
|
+
private unsubAppSettingsProvider?;
|
|
89
|
+
constructor(deps: SettingsModalDeps);
|
|
90
|
+
/** Whether the AI Model section has slotted content, context usage or budget figures. */
|
|
91
|
+
get modelSectionVisible(): boolean;
|
|
92
|
+
/** Built-in context window indicator (generic platform concern). */
|
|
93
|
+
get contextUsageVisible(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The indicator's figures, pre-formatted, or `undefined` when there is nothing
|
|
96
|
+
* measurable — see {@link SettingsContextUsage} for why absence is the point.
|
|
97
|
+
*
|
|
98
|
+
* The gate above and this getter must agree on when there is something to show,
|
|
99
|
+
* so both test exactly `tokens != null && limit != null`. A zero `limit` is
|
|
100
|
+
* therefore still "showable" and still renders `Infinity%`, exactly as before;
|
|
101
|
+
* that is a separate (and much more obscure) question about a provider
|
|
102
|
+
* reporting a zero-token window, and silently changing it here would move
|
|
103
|
+
* behaviour under cover of a bug fix.
|
|
104
|
+
*/
|
|
105
|
+
get contextUsage(): SettingsContextUsage | undefined;
|
|
106
|
+
/** Whether the UI Builder section should render. */
|
|
107
|
+
get appSectionVisible(): boolean;
|
|
108
|
+
/** App toggles currently visible per each entry's `visible()` predicate. */
|
|
109
|
+
get visibleAppSettingsToggles(): AssistantAppSettingsToggle[];
|
|
110
|
+
/**
|
|
111
|
+
* Host-supplied heading for the toggle group, or `undefined` for none — the
|
|
112
|
+
* assistant has no default. Suppressed when no toggle is currently visible, so a
|
|
113
|
+
* `visible()` predicate hiding the last one takes its heading with it rather
|
|
114
|
+
* than leaving a label over nothing.
|
|
115
|
+
*/
|
|
116
|
+
get appSettingsTogglesHeading(): AssistantAppSettingsHeading | undefined;
|
|
117
|
+
getAppSettingValue(id: string): boolean;
|
|
118
|
+
setAppSettingValue(id: string, value: boolean): void;
|
|
119
|
+
/** Subscribe to host provider changes. Re-entrant: unwires any previous subscription first. */
|
|
120
|
+
wireAppSettingsProvider(): void;
|
|
121
|
+
unwireAppSettingsProvider(): void;
|
|
122
|
+
get costCurrentSectionVisible(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Whether the build-history section has anything in it — the built-in row list,
|
|
125
|
+
* or a host's own markup in the `settings-cost-history` slot.
|
|
126
|
+
*
|
|
127
|
+
* Slotted content is checked FIRST, ahead of `enabled`. That flag governs the
|
|
128
|
+
* *built-in* ledger: it gates the row writes, the reload, and the lifetime sum —
|
|
129
|
+
* and it defaults to `false` (`cost?.enabled === true`), while the Usage tab
|
|
130
|
+
* itself shows for `showCost`/`showTokens`, which default true. So a host can
|
|
131
|
+
* legitimately render its own build history into the slot and never opt into our
|
|
132
|
+
* `localStorage` ledger. Short-circuiting on `enabled` above the slot check hid
|
|
133
|
+
* that host's markup outright, since the slot is the only thing in the container.
|
|
134
|
+
*/
|
|
135
|
+
get costHistorySectionVisible(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the "Build history" heading has anything under it.
|
|
138
|
+
*
|
|
139
|
+
* Broader than {@link SettingsModalController.costHistorySectionVisible} because
|
|
140
|
+
* the heading also covers the lifetime total, which renders before the first row
|
|
141
|
+
* exists (rows are written as spend accrues, the lifetime section only needs
|
|
142
|
+
* history switched on). Gating the heading on the rows alone left that total
|
|
143
|
+
* sitting under nothing.
|
|
144
|
+
*/
|
|
145
|
+
get costHistoryHeadingVisible(): boolean;
|
|
146
|
+
/** Whether the built-in Usage tab summary block has anything to show. */
|
|
147
|
+
get costSummaryVisible(): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Whether the lifetime-usage section has anything to say.
|
|
150
|
+
*
|
|
151
|
+
* Requires build history: with it off there are no rows, so `cumulativeUsage`
|
|
152
|
+
* falls back to the live session and the section would restate the block
|
|
153
|
+
* directly below it under a "lifetime" heading it hasn't earned.
|
|
154
|
+
*/
|
|
155
|
+
get costLifetimeVisible(): boolean;
|
|
156
|
+
/** Whether the Usage tab should appear at all. */
|
|
157
|
+
get costTabVisible(): boolean;
|
|
158
|
+
/** Whether session token usage should render on the Usage tab. */
|
|
159
|
+
get sessionTokensVisible(): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Whether the chat header (and settings cog) should render — i.e. whether the
|
|
162
|
+
* modal would have anything in it at all. The one gate that asks about the whole
|
|
163
|
+
* feature rather than one section, which is why it enumerates the config flags
|
|
164
|
+
* instead of composing the section gates: a section can be empty right now and
|
|
165
|
+
* still be configured on, and the cog must not flicker with its contents.
|
|
166
|
+
*/
|
|
167
|
+
get cogVisible(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Open the modal, resetting to the Settings tab.
|
|
170
|
+
*
|
|
171
|
+
* The `show()` call is deferred through a self-requeueing update because the
|
|
172
|
+
* modal is a template `ref` — on the very first open it does not exist yet, so
|
|
173
|
+
* this waits for FAST to bind it rather than dropping the open. Bails if
|
|
174
|
+
* something closed the modal while it waited.
|
|
175
|
+
*/
|
|
176
|
+
openModal(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Close the modal.
|
|
179
|
+
*
|
|
180
|
+
* When the design-system modal is genuinely open, `close()` is all this does:
|
|
181
|
+
* that fires its own dismiss event, which lands in {@link SettingsModalController.onClosed}
|
|
182
|
+
* and clears the state there. Clearing it here as well would run the reset twice
|
|
183
|
+
* and race the modal's own closing animation.
|
|
184
|
+
*/
|
|
185
|
+
closeModal(): void;
|
|
186
|
+
/** The modal's own dismiss path — a backdrop click or Escape, as well as `closeModal`. */
|
|
187
|
+
onClosed(): void;
|
|
188
|
+
/** Select a tab, refusing one that is not currently available. */
|
|
189
|
+
setTab(tab: SettingsModalTab): void;
|
|
190
|
+
/** Sync the active tab when the design-system tab bar changes. */
|
|
191
|
+
onTabsChange(event: Event): void;
|
|
192
|
+
/**
|
|
193
|
+
* Ensure the Settings tab is selected when the modal opens.
|
|
194
|
+
*
|
|
195
|
+
* Driven by `click()` rather than by writing `activeid`, because the
|
|
196
|
+
* design-system tab bar owns its own selection and animation state; clicking is
|
|
197
|
+
* the only path that updates all of it coherently. Each branch returns after
|
|
198
|
+
* clicking, since the resulting `change` event brings us back here.
|
|
199
|
+
*/
|
|
200
|
+
private resetTabsOnOpen;
|
|
201
|
+
/** Return to the Settings tab when the modal closes on Usage. */
|
|
202
|
+
private resetTabsOnClose;
|
|
203
|
+
/**
|
|
204
|
+
* Snap the tab underline to the Settings tab without animating from Usage.
|
|
205
|
+
* Used after hide/show when the aria state is correct but the indicator drifted.
|
|
206
|
+
*
|
|
207
|
+
* Reaches into the tab bar's private fields, which is deliberate and contained:
|
|
208
|
+
* the design system exposes no way to reposition the indicator without a
|
|
209
|
+
* transition, and re-entering through `click()` here would animate the very
|
|
210
|
+
* slide this exists to suppress. One retry, because the indicator is inside the
|
|
211
|
+
* tab bar's shadow root and may not be rendered on the first pass.
|
|
212
|
+
*/
|
|
213
|
+
private snapTabIndicator;
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=settings-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-modal.d.ts","sourceRoot":"","sources":["../../../../src/components/settings-modal/settings-modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,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,kBAAkB,IAAI,OAAO,CAOhC;IAED;;;;;;OAMG;IACH,IACI,mBAAmB,IAAI,OAAO,CAgBjC;IAED,kDAAkD;IAClD,IACI,cAAc,IAAI,OAAO,CAQ5B;IAED,kEAAkE;IAClE,IACI,oBAAoB,IAAI,OAAO,CAElC;IAID;;;;;;OAMG;IACH,IACI,UAAU,IAAI,OAAO,CAkBxB;IAID;;;;;;;OAOG;IACH,SAAS,IAAI,IAAI;IAqBjB;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI;IAWlB,0FAA0F;IAC1F,QAAQ,IAAI,IAAI;IAMhB,kEAAkE;IAClE,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI;IAKnC,kEAAkE;IAClE,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAOhC;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAwBvB,iEAAiE;IACjE,OAAO,CAAC,gBAAgB;IAcxB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;CAsBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-modal.template.d.ts","sourceRoot":"","sources":["../../../../src/components/settings-modal/settings-modal.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqH7D;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-modal.template.d.ts","sourceRoot":"","sources":["../../../../src/components/settings-modal/settings-modal.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqH7D;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,MAAM,CAAC;AAsJnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,2BAA2B,GACtC,aAAa,MAAM,EACnB,WAAW,MAAM,EACjB,SAAS,MAAM,KACd,YAAY,CAAC,qBAAqB,CAUpC,CAAC;AA4aF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CA+MpC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ChatAttachment } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { MetaEventType } from '../state/debug-event-log';
|
|
3
|
+
/** The outcome of reading a batch of picked files. */
|
|
4
|
+
export interface ProcessedFiles {
|
|
5
|
+
attachments: ChatAttachment[];
|
|
6
|
+
errors: string[];
|
|
7
|
+
}
|
|
8
|
+
/** What the controller needs from its host beyond the shadow root. */
|
|
9
|
+
export interface AttachmentDeps {
|
|
10
|
+
/** `chatConfig.ui.acceptedFiles` — unset means attachments are off entirely. */
|
|
11
|
+
acceptedFiles: () => string | undefined;
|
|
12
|
+
logMeta: (type: MetaEventType, detail?: Record<string, unknown>) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The composer's file attachments: what is pending on the next message, what was
|
|
16
|
+
* rejected and why, and the reading and validation that gets a picked `File` into
|
|
17
|
+
* a {@link ChatAttachment}.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare class AttachmentController {
|
|
22
|
+
/** Typed `HTMLElement` — the hidden file input is all this needs from the DOM. */
|
|
23
|
+
private readonly host;
|
|
24
|
+
private readonly deps;
|
|
25
|
+
/** Attachments pending on the next message. */
|
|
26
|
+
attachments: ChatAttachment[];
|
|
27
|
+
/** Rejection messages for files the last pick refused. */
|
|
28
|
+
errors: string[];
|
|
29
|
+
constructor(
|
|
30
|
+
/** Typed `HTMLElement` — the hidden file input is all this needs from the DOM. */
|
|
31
|
+
host: HTMLElement, deps: AttachmentDeps);
|
|
32
|
+
/** Open the OS file picker via the hidden input the template renders. */
|
|
33
|
+
triggerFileInput(): void;
|
|
34
|
+
/** `@change` on the hidden input. Fire-and-forget; the read is async. */
|
|
35
|
+
handleFileSelect(e: Event): void;
|
|
36
|
+
remove(attachment: ChatAttachment): void;
|
|
37
|
+
dismissError(message: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Hand the pending attachments to a send and clear both lists in one step.
|
|
40
|
+
*
|
|
41
|
+
* Read-and-clear as one method rather than two statements: the previous inline
|
|
42
|
+
* form copied the array and then blanked the fields separately, leaving a state
|
|
43
|
+
* the element could be observed in between the two.
|
|
44
|
+
*/
|
|
45
|
+
take(): ChatAttachment[] | undefined;
|
|
46
|
+
/** Drop everything pending, without handing it anywhere. */
|
|
47
|
+
clear(): void;
|
|
48
|
+
/** Total bytes already committed, for budgeting a further pick against the cap. */
|
|
49
|
+
pendingBytes(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Read and validate a batch of files without committing them — for
|
|
52
|
+
* `submitMessage({ files })`, which must be able to refuse the whole message
|
|
53
|
+
* rather than half-attach it.
|
|
54
|
+
*/
|
|
55
|
+
process(files: File[], existingBytes?: number): Promise<ProcessedFiles>;
|
|
56
|
+
private isAccepted;
|
|
57
|
+
private readAsText;
|
|
58
|
+
/**
|
|
59
|
+
* The base64 payload of a file, without any `data:` prefix — the raw form
|
|
60
|
+
* `ChatImageAttachment.data` specifies (transports add their own framing).
|
|
61
|
+
*/
|
|
62
|
+
private readAsBase64;
|
|
63
|
+
/** The picker path: read the picked files and APPEND whatever passed. */
|
|
64
|
+
private loadSelected;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=attachment-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-controller.d.ts","sourceRoot":"","sources":["../../../src/main/attachment-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B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