@stina/extension-api 1.16.0 → 1.18.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.
@@ -162,14 +162,14 @@ interface ExtensionPanelDefinition {
162
162
  interface HeaderProps extends ExtensionComponentData {
163
163
  component: 'Header';
164
164
  level: number;
165
- title: string;
166
- description?: string | string[];
165
+ title: LocalizedString;
166
+ description?: LocalizedString | LocalizedString[];
167
167
  icon?: HugeIconName;
168
168
  }
169
169
  /** The extension API properties for the Label component. */
170
170
  interface LabelProps extends ExtensionComponentData {
171
171
  component: 'Label';
172
- text: string;
172
+ text: LocalizedString;
173
173
  }
174
174
  /**
175
175
  * The extension API properties for the Clock component.
@@ -186,40 +186,40 @@ interface ClockProps extends ExtensionComponentData {
186
186
  /** The extension API properties for the paragraph component. */
187
187
  interface ParagraphProps extends ExtensionComponentData {
188
188
  component: 'Paragraph';
189
- text: string;
189
+ text: LocalizedString;
190
190
  }
191
191
  /** The extension API properties for the Button component. */
192
192
  interface ButtonProps extends ExtensionComponentData {
193
193
  component: 'Button';
194
- text: string;
194
+ text: LocalizedString;
195
195
  /** Visual style. Defaults to "normal". */
196
196
  type?: 'normal' | 'primary' | 'danger' | 'accent';
197
197
  /** Optional tooltip shown on hover. */
198
- title?: string;
198
+ title?: LocalizedString;
199
199
  disabled?: boolean;
200
200
  onClickAction: ExtensionActionRef;
201
201
  }
202
202
  /** The extension API properties for the TextInput component. */
203
203
  interface TextInputProps extends ExtensionComponentData {
204
204
  component: 'TextInput';
205
- label: string;
206
- placeholder?: string;
205
+ label: LocalizedString;
206
+ placeholder?: LocalizedString;
207
207
  value?: string;
208
208
  onChangeAction?: ExtensionActionRef;
209
209
  }
210
210
  /** The extension API properties for the PasswordInput component. */
211
211
  interface PasswordInputProps extends ExtensionComponentData {
212
212
  component: 'PasswordInput';
213
- label: string;
214
- placeholder?: string;
213
+ label: LocalizedString;
214
+ placeholder?: LocalizedString;
215
215
  value?: string;
216
216
  onChangeAction?: ExtensionActionRef;
217
217
  }
218
218
  /** The extension API properties for the NumberInput component. */
219
219
  interface NumberInputProps extends ExtensionComponentData {
220
220
  component: 'NumberInput';
221
- label: string;
222
- placeholder?: string;
221
+ label: LocalizedString;
222
+ placeholder?: LocalizedString;
223
223
  value?: string | number;
224
224
  /** Optional minimum value. */
225
225
  min?: number;
@@ -232,8 +232,8 @@ interface NumberInputProps extends ExtensionComponentData {
232
232
  /** The extension API properties for the TextArea component. */
233
233
  interface TextAreaProps extends ExtensionComponentData {
234
234
  component: 'TextArea';
235
- label: string;
236
- placeholder?: string;
235
+ label: LocalizedString;
236
+ placeholder?: LocalizedString;
237
237
  value?: string;
238
238
  /** Number of visible text rows. Defaults to 4. */
239
239
  rows?: number;
@@ -242,16 +242,16 @@ interface TextAreaProps extends ExtensionComponentData {
242
242
  /** The extension API properties for the DateTimeInput component. */
243
243
  interface DateTimeInputProps extends ExtensionComponentData {
244
244
  component: 'DateTimeInput';
245
- label: string;
245
+ label: LocalizedString;
246
246
  value?: string;
247
247
  onChangeAction?: ExtensionActionRef;
248
248
  }
249
249
  /** The extension API properties for the Select component. */
250
250
  interface SelectProps extends ExtensionComponentData {
251
251
  component: 'Select';
252
- label: string;
252
+ label: LocalizedString;
253
253
  options: Array<{
254
- label: string;
254
+ label: LocalizedString;
255
255
  value: string;
256
256
  }>;
257
257
  selectedValue?: string;
@@ -260,7 +260,7 @@ interface SelectProps extends ExtensionComponentData {
260
260
  /** The extension API properties for the IconPicker component. */
261
261
  interface IconPickerProps extends ExtensionComponentData {
262
262
  component: 'IconPicker';
263
- label?: string;
263
+ label?: LocalizedString;
264
264
  value?: string;
265
265
  onChangeAction?: ExtensionActionRef;
266
266
  }
@@ -291,7 +291,7 @@ interface DividerProps extends ExtensionComponentData {
291
291
  interface IconProps extends ExtensionComponentData {
292
292
  component: 'Icon';
293
293
  name: HugeIconName;
294
- title?: string;
294
+ title?: LocalizedString;
295
295
  }
296
296
  /** Button type for IconButton. */
297
297
  type IconButtonType = 'normal' | 'primary' | 'danger' | 'accent';
@@ -299,7 +299,7 @@ type IconButtonType = 'normal' | 'primary' | 'danger' | 'accent';
299
299
  interface IconButtonProps extends ExtensionComponentData {
300
300
  component: 'IconButton';
301
301
  icon: HugeIconName;
302
- tooltip: string;
302
+ tooltip: LocalizedString;
303
303
  active?: boolean;
304
304
  disabled?: boolean;
305
305
  type?: IconButtonType;
@@ -308,15 +308,15 @@ interface IconButtonProps extends ExtensionComponentData {
308
308
  /** Action button definition for Panel component. */
309
309
  interface PanelAction {
310
310
  icon: HugeIconName;
311
- tooltip: string;
311
+ tooltip: LocalizedString;
312
312
  action: ExtensionActionRef;
313
313
  type?: IconButtonType;
314
314
  }
315
315
  /** The extension API properties for the Panel component. */
316
316
  interface PanelProps extends ExtensionComponentData {
317
317
  component: 'Panel';
318
- title: string;
319
- description?: string | string[];
318
+ title: LocalizedString;
319
+ description?: LocalizedString | LocalizedString[];
320
320
  icon?: HugeIconName;
321
321
  actions?: PanelAction[];
322
322
  content?: ExtensionComponentData;
@@ -324,8 +324,8 @@ interface PanelProps extends ExtensionComponentData {
324
324
  /** The extension API properties for the Toggle component. */
325
325
  interface ToggleProps extends ExtensionComponentData {
326
326
  component: 'Toggle';
327
- label?: string;
328
- description?: string;
327
+ label?: LocalizedString;
328
+ description?: LocalizedString;
329
329
  checked?: boolean;
330
330
  disabled?: boolean;
331
331
  onChangeAction?: ExtensionActionRef;
@@ -334,9 +334,9 @@ interface ToggleProps extends ExtensionComponentData {
334
334
  interface CollapsibleProps extends ExtensionComponentData {
335
335
  component: 'Collapsible';
336
336
  /** Title displayed in the header. */
337
- title: string;
337
+ title: LocalizedString;
338
338
  /** Optional description rendered under the title. */
339
- description?: string | string[];
339
+ description?: LocalizedString | LocalizedString[];
340
340
  /** Optional icon shown to the left of the title. */
341
341
  icon?: HugeIconName;
342
342
  /** Whether the section is expanded by default. */
@@ -350,7 +350,7 @@ type PillVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'a
350
350
  interface PillProps extends ExtensionComponentData {
351
351
  component: 'Pill';
352
352
  /** Text to display in the pill. */
353
- text: string;
353
+ text: LocalizedString;
354
354
  /** Optional icon shown to the left of the text. */
355
355
  icon?: HugeIconName;
356
356
  /** Color variant. Defaults to 'default'. */
@@ -360,7 +360,7 @@ interface PillProps extends ExtensionComponentData {
360
360
  interface CheckboxProps extends ExtensionComponentData {
361
361
  component: 'Checkbox';
362
362
  /** Label text displayed next to the checkbox. */
363
- label: string;
363
+ label: LocalizedString;
364
364
  /** Whether the checkbox is checked. */
365
365
  checked?: boolean;
366
366
  /** Whether the checkbox is disabled. */
@@ -374,7 +374,7 @@ interface CheckboxProps extends ExtensionComponentData {
374
374
  interface MarkdownProps extends ExtensionComponentData {
375
375
  component: 'Markdown';
376
376
  /** Markdown content to render. */
377
- content: string;
377
+ content: LocalizedString;
378
378
  }
379
379
  /** The extension API properties for the TextPreview component. */
380
380
  interface TextPreviewProps extends ExtensionComponentData {
@@ -388,7 +388,7 @@ interface TextPreviewProps extends ExtensionComponentData {
388
388
  interface ModalProps extends ExtensionComponentData {
389
389
  component: 'Modal';
390
390
  /** Title displayed in the modal header. */
391
- title: string;
391
+ title: LocalizedString;
392
392
  /** Whether the modal is open. */
393
393
  open?: boolean;
394
394
  /** Optional max width for the modal (e.g., '600px', '80%'). Defaults to '600px'. */
@@ -426,7 +426,7 @@ type FrameVariant = 'border' | 'solid';
426
426
  interface FrameProps extends ExtensionComponentData {
427
427
  component: 'Frame';
428
428
  /** Optional title displayed in the header. Can be a plain string or extension components. */
429
- title?: string | ExtensionComponentChildren;
429
+ title?: LocalizedString | ExtensionComponentChildren;
430
430
  /** Whether the content can be toggled (collapsed/expanded) by clicking the title. Requires title to be set. */
431
431
  collapsible?: boolean;
432
432
  /** Whether the frame content is expanded by default. Only used when collapsible is true. Defaults to true. */
@@ -513,7 +513,7 @@ interface WeatherForecastStep {
513
513
  interface WeatherForecastProps extends ExtensionComponentData {
514
514
  component: 'WeatherForecast';
515
515
  /** Heading above the row, e.g. "Kommande timmar". */
516
- title?: string;
516
+ title?: LocalizedString;
517
517
  /** Icon shown to the left of the title. */
518
518
  icon?: HugeIconName;
519
519
  /** Written after every temperature. Defaults to `°`. */
@@ -551,7 +551,7 @@ interface ChartProps extends ExtensionComponentData {
551
551
  /** One per point, along the horizontal axis. */
552
552
  labels?: string[];
553
553
  /** Heading above the plot. With a single series this is what names it, so no legend is drawn. */
554
- title?: string;
554
+ title?: LocalizedString;
555
555
  /** Icon shown to the left of the title. */
556
556
  icon?: HugeIconName;
557
557
  /** Written after every value, e.g. `°`, ` mm`, ` kr`. */
@@ -576,12 +576,12 @@ type StatTrend = 'up' | 'down' | 'flat';
576
576
  interface StatTileProps extends ExtensionComponentData {
577
577
  component: 'StatTile';
578
578
  /** What the number is, e.g. "Förbrukning i går". */
579
- label: string;
579
+ label: LocalizedString;
580
580
  value: string | number;
581
581
  /** Written after the value in smaller type, e.g. `kWh`. */
582
582
  unit?: string;
583
583
  /** One quiet line under the number. */
584
- caption?: string;
584
+ caption?: LocalizedString;
585
585
  icon?: HugeIconName;
586
586
  /** `flat` draws no arrow. */
587
587
  trend?: StatTrend;
@@ -619,7 +619,7 @@ type ProgressColor = 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'neu
619
619
  interface ProgressBarProps extends ExtensionComponentData {
620
620
  component: 'ProgressBar';
621
621
  /** What is being measured, e.g. "Stressnivå". Shown beside the reading. */
622
- label: string;
622
+ label: LocalizedString;
623
623
  value: number;
624
624
  /** Bottom of the range. Defaults to 0. */
625
625
  min?: number;
@@ -634,7 +634,7 @@ interface ProgressBarProps extends ExtensionComponentData {
634
634
  /** The readout in words, when the bare number does not say it. Replaces value and unit. */
635
635
  valueLabel?: string;
636
636
  /** One quiet line under the reading. */
637
- caption?: string;
637
+ caption?: LocalizedString;
638
638
  icon?: HugeIconName;
639
639
  }
640
640
  /** One row of a KeyValueList. */
@@ -690,7 +690,7 @@ interface TimelineEntry {
690
690
  interface TimelineProps extends ExtensionComponentData {
691
691
  component: 'Timeline';
692
692
  /** Heading above the rail, e.g. "I dag". */
693
- title?: string;
693
+ title?: LocalizedString;
694
694
  /** Icon shown to the left of the title. */
695
695
  icon?: HugeIconName;
696
696
  entries: TimelineEntry[];
@@ -713,7 +713,7 @@ type NoteVariant = 'default' | 'accent' | 'success' | 'warning' | 'danger';
713
713
  */
714
714
  interface NoteProps extends ExtensionComponentData {
715
715
  component: 'Note';
716
- title?: string;
716
+ title?: LocalizedString;
717
717
  /** Icon shown to the left of the title. */
718
718
  icon?: HugeIconName;
719
719
  /** Trailing badge next to the title: a source, a category, a time. */
@@ -812,7 +812,7 @@ interface AgendaDay {
812
812
  interface AgendaProps extends ExtensionComponentData {
813
813
  component: 'Agenda';
814
814
  /** Heading above the days. */
815
- title?: string;
815
+ title?: LocalizedString;
816
816
  /** Icon shown to the left of the title. */
817
817
  icon?: HugeIconName;
818
818
  days: AgendaDay[];
@@ -894,6 +894,29 @@ interface AccountContribution {
894
894
  /** Why the extension needs them, shown next to the scopes in the settings. */
895
895
  reason?: LocalizedString;
896
896
  }
897
+ /**
898
+ * What a settings view is about, which decides where Stina shows it.
899
+ *
900
+ * An extension never picks a place in the settings menu: the menu belongs to Stina and
901
+ * changes between versions. It says what the view is *about*, and Stina puts each topic
902
+ * where it belongs, the way `accounts`, `providers` and `statusCards` already work.
903
+ *
904
+ * - `accounts`: connects Stina to an account or a service (a mailbox, a calendar feed).
905
+ * Shown with the other connected accounts.
906
+ * - `notifications`: when and how the extension may get in touch. Shown with Stina's own
907
+ * notification settings.
908
+ * - `personal`: facts about the user the extension relies on (a home town for the
909
+ * weather). Shown with the profile.
910
+ * - `tracking`: things Stina keeps track of for the user that are worth looking through
911
+ * now and then (people, projects, reminders). Gets its own row in the register.
912
+ *
913
+ * A view without a topic, or with one this version of Stina does not know, is shown on
914
+ * the extension's own page. That is always a working place, only a less fitting one, so
915
+ * a topic added later never breaks an older Stina.
916
+ */
917
+ type ExtensionSettingsTopic = 'accounts' | 'notifications' | 'personal' | 'tracking';
918
+ /** Every topic this version of the API knows, in no particular order. */
919
+ declare const EXTENSION_SETTINGS_TOPICS: readonly ExtensionSettingsTopic[];
897
920
  /**
898
921
  * Tool settings view definition (UI schema)
899
922
  */
@@ -901,9 +924,11 @@ interface ToolSettingsViewDefinition {
901
924
  /** Unique view ID within the extension */
902
925
  id: string;
903
926
  /** Display title */
904
- title: string;
927
+ title: LocalizedString;
905
928
  /** Help text */
906
- description?: string;
929
+ description?: LocalizedString;
930
+ /** What the view is about, and so where Stina shows it. See {@link ExtensionSettingsTopic}. */
931
+ topic?: ExtensionSettingsTopic;
907
932
  /** View configuration */
908
933
  view: ToolSettingsView;
909
934
  }
@@ -959,7 +984,7 @@ interface ToolSettingsListGroupBy {
959
984
  /** Explicit ordering of group values. Groups not listed appear afterwards, sorted alphabetically. */
960
985
  order?: string[];
961
986
  /** Human-friendly labels per group value (rendered as section headers). Falls back to the raw value if missing. */
962
- labels?: Record<string, string>;
987
+ labels?: Record<string, LocalizedString>;
963
988
  }
964
989
  /**
965
990
  * Mapping from tool list data to UI fields
@@ -1008,7 +1033,7 @@ interface PanelDefinition {
1008
1033
  /** Unique panel ID within the extension */
1009
1034
  id: string;
1010
1035
  /** Display title */
1011
- title: string;
1036
+ title: LocalizedString;
1012
1037
  /** Icon name (from huge-icons) */
1013
1038
  icon?: string;
1014
1039
  /** Panel view schema */
@@ -1029,7 +1054,7 @@ interface StatusCardDefinition {
1029
1054
  /** Unique card ID within the extension */
1030
1055
  id: string;
1031
1056
  /** What it is called where the user picks it */
1032
- title: string;
1057
+ title: LocalizedString;
1033
1058
  /** Icon name (from huge-icons) */
1034
1059
  icon?: string;
1035
1060
  /**
@@ -2665,4 +2690,4 @@ interface ActionResult {
2665
2690
  error?: string;
2666
2691
  }
2667
2692
 
2668
- export { type ConnectedAccountsAPI as $, type ActionResult as A, type ProvidersAPI as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type ToolsAPI as F, type GetModelsOptions as G, type HugeIconName as H, type ActionsAPI as I, type EventsAPI as J, type SchedulerAPI as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type SchedulerJobRequest as O, type PanelDefinition as P, type SchedulerSchedule as Q, type UserProfile as R, type SchedulerFirePayload as S, type ToolResult as T, type UserAPI as U, type VoiceSessionOptions as V, type ChatAPI as W, type ChatInstructionMessage as X, type ConversationPresentation as Y, type AttachmentsAPI as Z, type AttachmentContent as _, type ChatOptions as a, type MarkdownProps as a$, type ConnectedAccount as a0, type AccountAccessToken as a1, type LogAPI as a2, type BackgroundWorkersAPI as a3, type BackgroundTaskConfig as a4, type BackgroundTaskCallback as a5, type BackgroundTaskContext as a6, type BackgroundTaskHealth as a7, type BackgroundRestartPolicy as a8, type Query as a9, type ClockProps as aA, type ParagraphProps as aB, type ButtonProps as aC, type TextInputProps as aD, type PasswordInputProps as aE, type NumberInputProps as aF, type TextAreaProps as aG, type DateTimeInputProps as aH, type SelectProps as aI, type IconPickerProps as aJ, type VerticalStackProps as aK, type HorizontalStackProps as aL, type GridProps as aM, type DividerProps as aN, type IconProps as aO, type IconButtonType as aP, type IconButtonProps as aQ, type PanelAction as aR, type PanelProps as aS, type ToggleProps as aT, type CollapsibleProps as aU, type FrameVariant as aV, type FrameProps as aW, type ListProps as aX, type PillVariant as aY, type PillProps as aZ, type CheckboxProps as a_, type QueryOptions as aa, type StorageAPI as ab, type SecretsAPI as ac, type StorageCollectionConfig as ad, type StorageContributions as ae, type AIProvider as af, type ModelCapabilities as ag, type ChatImage as ah, type ChatFile as ai, type ToolCall as aj, type VoiceTransportRequest as ak, type Tool as al, type ToolAttachment as am, type Action as an, type ExtensionModule as ao, type AllowedCSSProperty as ap, type ExtensionComponentStyle as aq, type ExtensionComponentData as ar, type ExtensionComponentIterator as as, type ExtensionComponentChildren as at, type ExtensionActionCall as au, type ExtensionActionRef as av, type ExtensionDataSource as aw, type ExtensionPanelDefinition as ax, type HeaderProps as ay, type LabelProps as az, type StreamEvent as b, type TextPreviewProps as b0, type ModalProps as b1, type ConditionalGroupProps as b2, type WeatherCondition as b3, type WeatherWind as b4, type WeatherNowProps as b5, type WeatherForecastStep as b6, type WeatherForecastProps as b7, type ChartKind as b8, type ChartSeries as b9, type ChartProps as ba, type StatTrend as bb, type StatTileProps as bc, type ProgressShape as bd, type ProgressColor as be, type ProgressBarProps as bf, type KeyValueRow as bg, type KeyValueListProps as bh, type TimelineVariant as bi, type TimelineEntry as bj, type TimelineProps as bk, type NoteVariant as bl, type NoteProps as bm, type CalendarEventStatus as bn, type CalendarEventProps as bo, type AgendaEvent as bp, type AgendaDay as bq, type AgendaProps as br, type ExecutionContext as bs, type VoiceSessionDescriptor as c, type ToolSettingsViewDefinition as d, type ToolSettingsView as e, type ToolSettingsListView as f, type ToolSettingsListMapping as g, type ToolSettingsComponentView as h, type ToolSettingsActionDataSource as i, type StatusCardDefinition as j, type PanelView as k, type PanelComponentView as l, type PanelActionDataSource as m, type PanelUnknownView as n, type ProviderDefinition as o, type ProviderConfigView as p, type PromptContribution as q, resolveLocalizedString as r, type PromptSection as s, type ToolDefinition as t, type ToolConfirmationConfig as u, type CommandDefinition as v, type AccountProvider as w, type AccountContribution as x, type ExtensionContext as y, type SettingsAPI as z };
2693
+ export { type AttachmentsAPI as $, type ActionResult as A, type ExtensionContext as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SettingsAPI as F, type GetModelsOptions as G, type HugeIconName as H, type ProvidersAPI as I, type ToolsAPI as J, type ActionsAPI as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type EventsAPI as O, type PanelDefinition as P, type SchedulerAPI as Q, type SchedulerJobRequest as R, type SchedulerFirePayload as S, type ToolResult as T, type SchedulerSchedule as U, type VoiceSessionOptions as V, type UserAPI as W, type UserProfile as X, type ChatAPI as Y, type ChatInstructionMessage as Z, type ConversationPresentation as _, type ChatOptions as a, type PillProps as a$, type AttachmentContent as a0, type ConnectedAccountsAPI as a1, type ConnectedAccount as a2, type AccountAccessToken as a3, type LogAPI as a4, type BackgroundWorkersAPI as a5, type BackgroundTaskConfig as a6, type BackgroundTaskCallback as a7, type BackgroundTaskContext as a8, type BackgroundTaskHealth as a9, type HeaderProps as aA, type LabelProps as aB, type ClockProps as aC, type ParagraphProps as aD, type ButtonProps as aE, type TextInputProps as aF, type PasswordInputProps as aG, type NumberInputProps as aH, type TextAreaProps as aI, type DateTimeInputProps as aJ, type SelectProps as aK, type IconPickerProps as aL, type VerticalStackProps as aM, type HorizontalStackProps as aN, type GridProps as aO, type DividerProps as aP, type IconProps as aQ, type IconButtonType as aR, type IconButtonProps as aS, type PanelAction as aT, type PanelProps as aU, type ToggleProps as aV, type CollapsibleProps as aW, type FrameVariant as aX, type FrameProps as aY, type ListProps as aZ, type PillVariant as a_, type BackgroundRestartPolicy as aa, type Query as ab, type QueryOptions as ac, type StorageAPI as ad, type SecretsAPI as ae, type StorageCollectionConfig as af, type StorageContributions as ag, type AIProvider as ah, type ModelCapabilities as ai, type ChatImage as aj, type ChatFile as ak, type ToolCall as al, type VoiceTransportRequest as am, type Tool as an, type ToolAttachment as ao, type Action as ap, type ExtensionModule as aq, type AllowedCSSProperty as ar, type ExtensionComponentStyle as as, type ExtensionComponentData as at, type ExtensionComponentIterator as au, type ExtensionComponentChildren as av, type ExtensionActionCall as aw, type ExtensionActionRef as ax, type ExtensionDataSource as ay, type ExtensionPanelDefinition as az, type StreamEvent as b, type CheckboxProps as b0, type MarkdownProps as b1, type TextPreviewProps as b2, type ModalProps as b3, type ConditionalGroupProps as b4, type WeatherCondition as b5, type WeatherWind as b6, type WeatherNowProps as b7, type WeatherForecastStep as b8, type WeatherForecastProps as b9, type ChartKind as ba, type ChartSeries as bb, type ChartProps as bc, type StatTrend as bd, type StatTileProps as be, type ProgressShape as bf, type ProgressColor as bg, type ProgressBarProps as bh, type KeyValueRow as bi, type KeyValueListProps as bj, type TimelineVariant as bk, type TimelineEntry as bl, type TimelineProps as bm, type NoteVariant as bn, type NoteProps as bo, type CalendarEventStatus as bp, type CalendarEventProps as bq, type AgendaEvent as br, type AgendaDay as bs, type AgendaProps as bt, type ExecutionContext as bu, type VoiceSessionDescriptor as c, EXTENSION_SETTINGS_TOPICS as d, type ToolSettingsViewDefinition as e, type ExtensionSettingsTopic as f, type ToolSettingsView as g, type ToolSettingsListView as h, type ToolSettingsListMapping as i, type ToolSettingsComponentView as j, type ToolSettingsActionDataSource as k, type StatusCardDefinition as l, type PanelView as m, type PanelComponentView as n, type PanelActionDataSource as o, type PanelUnknownView as p, type ProviderDefinition as q, resolveLocalizedString as r, type ProviderConfigView as s, type PromptContribution as t, type PromptSection as u, type ToolDefinition as v, type ToolConfirmationConfig as w, type CommandDefinition as x, type AccountProvider as y, type AccountContribution as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stina/extension-api",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -156,13 +156,34 @@
156
156
  "description": "Unique view ID within the extension"
157
157
  },
158
158
  "title": {
159
- "type": "string",
159
+ "anyOf": [
160
+ {
161
+ "type": "string"
162
+ },
163
+ {
164
+ "type": "object",
165
+ "additionalProperties": {
166
+ "type": "string"
167
+ }
168
+ }
169
+ ],
160
170
  "description": "Display title"
161
171
  },
162
172
  "description": {
163
- "type": "string",
173
+ "anyOf": [
174
+ {
175
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/0"
176
+ },
177
+ {
178
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/1"
179
+ }
180
+ ],
164
181
  "description": "Help text"
165
182
  },
183
+ "topic": {
184
+ "type": "string",
185
+ "description": "What the view is about, which decides where Stina shows it: accounts, notifications, personal or tracking. Without one, or with one Stina does not know, the view is shown on the extension's own page."
186
+ },
166
187
  "view": {
167
188
  "anyOf": [
168
189
  {
@@ -358,7 +379,7 @@
358
379
  "labels": {
359
380
  "type": "object",
360
381
  "additionalProperties": {
361
- "type": "string"
382
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/description"
362
383
  },
363
384
  "description": "Human-friendly labels per group value (rendered as section headers)"
364
385
  }
@@ -466,7 +487,14 @@
466
487
  "description": "Unique panel ID within the extension"
467
488
  },
468
489
  "title": {
469
- "type": "string",
490
+ "anyOf": [
491
+ {
492
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/0"
493
+ },
494
+ {
495
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/1"
496
+ }
497
+ ],
470
498
  "description": "Display title"
471
499
  },
472
500
  "icon": {
@@ -577,7 +605,14 @@
577
605
  "description": "Unique card ID within the extension"
578
606
  },
579
607
  "title": {
580
- "type": "string",
608
+ "anyOf": [
609
+ {
610
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/0"
611
+ },
612
+ {
613
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/1"
614
+ }
615
+ ],
581
616
  "description": "What it is called where the user picks it"
582
617
  },
583
618
  "icon": {
@@ -700,13 +735,10 @@
700
735
  "name": {
701
736
  "anyOf": [
702
737
  {
703
- "type": "string"
738
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/0"
704
739
  },
705
740
  {
706
- "type": "object",
707
- "additionalProperties": {
708
- "type": "string"
709
- }
741
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/1"
710
742
  }
711
743
  ],
712
744
  "description": "Display name"
@@ -714,10 +746,10 @@
714
746
  "description": {
715
747
  "anyOf": [
716
748
  {
717
- "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/tools/items/properties/name/anyOf/0"
749
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/0"
718
750
  },
719
751
  {
720
- "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/tools/items/properties/name/anyOf/1"
752
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/title/anyOf/1"
721
753
  }
722
754
  ],
723
755
  "description": "Description for Stina"
@@ -732,14 +764,7 @@
732
764
  "description": "Whether this tool requires user confirmation before execution (default: true)"
733
765
  },
734
766
  "confirmationPrompt": {
735
- "anyOf": [
736
- {
737
- "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/tools/items/properties/name/anyOf/0"
738
- },
739
- {
740
- "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/tools/items/properties/name/anyOf/1"
741
- }
742
- ],
767
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/description",
743
768
  "description": "Custom confirmation prompt"
744
769
  }
745
770
  },
@@ -880,7 +905,7 @@
880
905
  "description": "Microsoft Graph delegated permissions"
881
906
  },
882
907
  "reason": {
883
- "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/tools/items/properties/confirmationPrompt",
908
+ "$ref": "#/definitions/ExtensionManifest/properties/contributes/properties/toolSettings/items/properties/description",
884
909
  "description": "Why the extension needs them"
885
910
  }
886
911
  },
package/src/index.ts CHANGED
@@ -10,6 +10,7 @@
10
10
  // Localization
11
11
  export type { LocalizedString } from './types.js'
12
12
  export { resolveLocalizedString } from './types.js'
13
+ export { EXTENSION_SETTINGS_TOPICS } from './types.js'
13
14
 
14
15
  // Types
15
16
  export type {
@@ -18,6 +19,7 @@ export type {
18
19
  Platform,
19
20
  ExtensionContributions,
20
21
  ToolSettingsViewDefinition,
22
+ ExtensionSettingsTopic,
21
23
  ToolSettingsView,
22
24
  ToolSettingsListView,
23
25
  ToolSettingsListMapping,
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  import { z } from 'zod'
31
+ import { LocalizedStringSchema } from './localization.schema.js'
31
32
  import { ExtensionComponentStyleSchema } from './components.schema.js'
32
33
  import {
33
34
  WeatherConditionSchema,
@@ -111,7 +112,7 @@ const FrameCardSchema = z
111
112
  component: z.literal('Frame'),
112
113
  // Only the string form: the components form of a title is for panels that
113
114
  // put controls in their header, which a card has no business doing.
114
- title: z.string().optional(),
115
+ title: LocalizedStringSchema.optional(),
115
116
  collapsible: z.boolean().optional(),
116
117
  defaultExpanded: z.boolean().optional(),
117
118
  variant: FrameVariantSchema.optional(),
@@ -132,8 +133,8 @@ const HeaderCardSchema = z
132
133
  .object({
133
134
  component: z.literal('Header'),
134
135
  level: z.number().min(1).max(6),
135
- title: z.string(),
136
- description: z.union([z.string(), z.array(z.string())]).optional(),
136
+ title: LocalizedStringSchema,
137
+ description: z.union([LocalizedStringSchema, z.array(LocalizedStringSchema)]).optional(),
137
138
  icon: z.string().optional(),
138
139
  style,
139
140
  })
@@ -159,7 +160,7 @@ const IconCardSchema = z
159
160
  .object({
160
161
  component: z.literal('Icon'),
161
162
  name: z.string(),
162
- title: z.string().optional(),
163
+ title: LocalizedStringSchema.optional(),
163
164
  style,
164
165
  })
165
166
  .strict()
@@ -167,7 +168,7 @@ const IconCardSchema = z
167
168
  const PillCardSchema = z
168
169
  .object({
169
170
  component: z.literal('Pill'),
170
- text: z.string(),
171
+ text: LocalizedStringSchema,
171
172
  icon: z.string().optional(),
172
173
  variant: PillVariantSchema.optional(),
173
174
  style,
@@ -197,7 +198,7 @@ const WeatherNowCardSchema = z
197
198
  const WeatherForecastCardSchema = z
198
199
  .object({
199
200
  component: z.literal('WeatherForecast'),
200
- title: z.string().optional(),
201
+ title: LocalizedStringSchema.optional(),
201
202
  icon: z.string().optional(),
202
203
  unit: z.string().optional(),
203
204
  steps: z
@@ -237,7 +238,7 @@ const ChartCardSchema = z
237
238
  .min(1)
238
239
  .max(8),
239
240
  labels: z.array(z.string()).max(200).optional(),
240
- title: z.string().optional(),
241
+ title: LocalizedStringSchema.optional(),
241
242
  icon: z.string().optional(),
242
243
  unit: z.string().optional(),
243
244
  zeroBaseline: z.boolean().optional(),
@@ -249,10 +250,10 @@ const ChartCardSchema = z
249
250
  const StatTileCardSchema = z
250
251
  .object({
251
252
  component: z.literal('StatTile'),
252
- label: z.string(),
253
+ label: LocalizedStringSchema,
253
254
  value: z.union([z.string(), z.number()]),
254
255
  unit: z.string().optional(),
255
- caption: z.string().optional(),
256
+ caption: LocalizedStringSchema.optional(),
256
257
  icon: z.string().optional(),
257
258
  trend: StatTrendSchema.optional(),
258
259
  trendLabel: z.string().optional(),
@@ -264,7 +265,7 @@ const StatTileCardSchema = z
264
265
  const ProgressBarCardSchema = z
265
266
  .object({
266
267
  component: z.literal('ProgressBar'),
267
- label: z.string(),
268
+ label: LocalizedStringSchema,
268
269
  value: z.number(),
269
270
  min: z.number().optional(),
270
271
  max: z.number().optional(),
@@ -272,7 +273,7 @@ const ProgressBarCardSchema = z
272
273
  color: ProgressColorSchema.optional(),
273
274
  unit: z.string().optional(),
274
275
  valueLabel: z.string().optional(),
275
- caption: z.string().optional(),
276
+ caption: LocalizedStringSchema.optional(),
276
277
  icon: z.string().optional(),
277
278
  style,
278
279
  })
@@ -296,7 +297,7 @@ const KeyValueListCardSchema = z
296
297
  const TimelineCardSchema = z
297
298
  .object({
298
299
  component: z.literal('Timeline'),
299
- title: z.string().optional(),
300
+ title: LocalizedStringSchema.optional(),
300
301
  icon: z.string().optional(),
301
302
  entries: z
302
303
  .array(
@@ -323,7 +324,7 @@ const TimelineCardSchema = z
323
324
  const NoteCardSchema = z
324
325
  .object({
325
326
  component: z.literal('Note'),
326
- title: z.string().optional(),
327
+ title: LocalizedStringSchema.optional(),
327
328
  icon: z.string().optional(),
328
329
  badge: z.string().optional(),
329
330
  content: z.string(),