@stina/extension-api 0.32.0 → 0.33.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.
@@ -180,6 +180,11 @@ interface ParagraphProps extends ExtensionComponentData {
180
180
  interface ButtonProps extends ExtensionComponentData {
181
181
  component: 'Button';
182
182
  text: string;
183
+ /** Visual style. Defaults to "normal". */
184
+ type?: 'normal' | 'primary' | 'danger' | 'accent';
185
+ /** Optional tooltip shown on hover. */
186
+ title?: string;
187
+ disabled?: boolean;
183
188
  onClickAction: ExtensionActionRef;
184
189
  }
185
190
  /** The extension API properties for the TextInput component. */
@@ -188,14 +193,46 @@ interface TextInputProps extends ExtensionComponentData {
188
193
  label: string;
189
194
  placeholder?: string;
190
195
  value?: string;
191
- onChangeAction: ExtensionActionRef;
196
+ onChangeAction?: ExtensionActionRef;
197
+ }
198
+ /** The extension API properties for the PasswordInput component. */
199
+ interface PasswordInputProps extends ExtensionComponentData {
200
+ component: 'PasswordInput';
201
+ label: string;
202
+ placeholder?: string;
203
+ value?: string;
204
+ onChangeAction?: ExtensionActionRef;
205
+ }
206
+ /** The extension API properties for the NumberInput component. */
207
+ interface NumberInputProps extends ExtensionComponentData {
208
+ component: 'NumberInput';
209
+ label: string;
210
+ placeholder?: string;
211
+ value?: string | number;
212
+ /** Optional minimum value. */
213
+ min?: number;
214
+ /** Optional maximum value. */
215
+ max?: number;
216
+ /** Optional step. */
217
+ step?: number;
218
+ onChangeAction?: ExtensionActionRef;
219
+ }
220
+ /** The extension API properties for the TextArea component. */
221
+ interface TextAreaProps extends ExtensionComponentData {
222
+ component: 'TextArea';
223
+ label: string;
224
+ placeholder?: string;
225
+ value?: string;
226
+ /** Number of visible text rows. Defaults to 4. */
227
+ rows?: number;
228
+ onChangeAction?: ExtensionActionRef;
192
229
  }
193
230
  /** The extension API properties for the DateTimeInput component. */
194
231
  interface DateTimeInputProps extends ExtensionComponentData {
195
232
  component: 'DateTimeInput';
196
233
  label: string;
197
234
  value?: string;
198
- onChangeAction: ExtensionActionRef;
235
+ onChangeAction?: ExtensionActionRef;
199
236
  }
200
237
  /** The extension API properties for the Select component. */
201
238
  interface SelectProps extends ExtensionComponentData {
@@ -206,14 +243,14 @@ interface SelectProps extends ExtensionComponentData {
206
243
  value: string;
207
244
  }>;
208
245
  selectedValue?: string;
209
- onChangeAction: ExtensionActionRef;
246
+ onChangeAction?: ExtensionActionRef;
210
247
  }
211
248
  /** The extension API properties for the IconPicker component. */
212
249
  interface IconPickerProps extends ExtensionComponentData {
213
250
  component: 'IconPicker';
214
251
  label?: string;
215
252
  value?: string;
216
- onChangeAction: ExtensionActionRef;
253
+ onChangeAction?: ExtensionActionRef;
217
254
  }
218
255
  /** The extension API properties for the VerticalStack component. */
219
256
  interface VerticalStackProps extends ExtensionComponentData {
@@ -279,7 +316,7 @@ interface ToggleProps extends ExtensionComponentData {
279
316
  description?: string;
280
317
  checked?: boolean;
281
318
  disabled?: boolean;
282
- onChangeAction: ExtensionActionRef;
319
+ onChangeAction?: ExtensionActionRef;
283
320
  }
284
321
  /** The extension API properties for the Collapsible component. */
285
322
  interface CollapsibleProps extends ExtensionComponentData {
@@ -319,7 +356,7 @@ interface CheckboxProps extends ExtensionComponentData {
319
356
  /** Whether to strike through the label when checked. Defaults to true. */
320
357
  strikethrough?: boolean;
321
358
  /** Action to call when the checkbox state changes. */
322
- onChangeAction: ExtensionActionRef;
359
+ onChangeAction?: ExtensionActionRef;
323
360
  }
324
361
  /** The extension API properties for the Markdown component. */
325
362
  interface MarkdownProps extends ExtensionComponentData {
@@ -394,18 +431,10 @@ interface ListProps extends ExtensionComponentData {
394
431
  children: ExtensionComponentChildren;
395
432
  }
396
433
 
397
- /**
398
- * Contribution Types
399
- *
400
- * Types for extension contributions: settings, panels, providers, tools, commands, prompts.
401
- */
402
-
403
434
  /**
404
435
  * What an extension can contribute to Stina
405
436
  */
406
437
  interface ExtensionContributions {
407
- /** User-configurable settings */
408
- settings?: SettingDefinition[];
409
438
  /** Tool settings views for UI */
410
439
  toolSettings?: ToolSettingsViewDefinition[];
411
440
  /** Right panel contributions */
@@ -428,71 +457,6 @@ interface ExtensionContributions {
428
457
  };
429
458
  };
430
459
  }
431
- /**
432
- * Setting definition for the UI
433
- */
434
- interface SettingDefinition {
435
- /** Setting ID (namespaced automatically) */
436
- id: string;
437
- /** Display title */
438
- title: string;
439
- /** Help text */
440
- description?: string;
441
- /** Setting type */
442
- type: 'string' | 'number' | 'boolean' | 'select';
443
- /** Default value */
444
- default?: unknown;
445
- /** For select type: available options */
446
- options?: {
447
- value: string;
448
- label: string;
449
- }[];
450
- /** For select type: load options from tool */
451
- optionsToolId?: string;
452
- /** Params for options tool */
453
- optionsParams?: Record<string, unknown>;
454
- /** Mapping for options tool response */
455
- optionsMapping?: SettingOptionsMapping;
456
- /** Tool ID for creating a new option */
457
- createToolId?: string;
458
- /** Label for create action */
459
- createLabel?: string;
460
- /** Fields for create form */
461
- createFields?: SettingDefinition[];
462
- /** Static params always sent to create tool */
463
- createParams?: Record<string, unknown>;
464
- /** Mapping for create tool response */
465
- createMapping?: SettingCreateMapping;
466
- /** Validation rules */
467
- validation?: {
468
- required?: boolean;
469
- min?: number;
470
- max?: number;
471
- pattern?: string;
472
- };
473
- }
474
- /**
475
- * Mapping for select field options from tool response
476
- */
477
- interface SettingOptionsMapping {
478
- /** Key for items array in tool result data */
479
- itemsKey: string;
480
- /** Key for option value */
481
- valueKey: string;
482
- /** Key for option label */
483
- labelKey: string;
484
- /** Optional key for description */
485
- descriptionKey?: string;
486
- }
487
- /**
488
- * Mapping for create tool response
489
- */
490
- interface SettingCreateMapping {
491
- /** Key for result data object */
492
- resultKey?: string;
493
- /** Key for option value (defaults to "id") */
494
- valueKey: string;
495
- }
496
460
  /**
497
461
  * Tool settings view definition (UI schema)
498
462
  */
@@ -505,8 +469,6 @@ interface ToolSettingsViewDefinition {
505
469
  description?: string;
506
470
  /** View configuration */
507
471
  view: ToolSettingsView;
508
- /** Fields for create/edit forms (uses SettingDefinition) */
509
- fields?: SettingDefinition[];
510
472
  }
511
473
  /**
512
474
  * Tool settings view types
@@ -536,6 +498,16 @@ interface ToolSettingsListView {
536
498
  idParam?: string;
537
499
  /** Static params always sent to list tool */
538
500
  listParams?: Record<string, unknown>;
501
+ /**
502
+ * Component-tree-based create/edit form. Fields bind to the current
503
+ * item via `value: "$item.<key>"` (or `selectedValue` / `checked`),
504
+ * and the host saves the resulting object via `upsertToolId` when
505
+ * the user clicks "Save".
506
+ */
507
+ editView?: {
508
+ /** Root component to render in the create/edit modal. */
509
+ content: ExtensionComponentData;
510
+ };
539
511
  }
540
512
  /**
541
513
  * Mapping from tool list data to UI fields
@@ -637,68 +609,22 @@ interface ProviderDefinition {
637
609
  suggestedDefaultModel?: string;
638
610
  /** Default settings for this provider (e.g., { url: "http://localhost:11434" }) */
639
611
  defaultSettings?: Record<string, unknown>;
640
- /** Schema for provider-specific configuration UI */
641
- configSchema?: ProviderConfigSchema;
642
- }
643
- /**
644
- * Schema for provider-specific configuration.
645
- * Used to generate UI forms for configuring provider settings.
646
- */
647
- interface ProviderConfigSchema {
648
- /** Property definitions */
649
- properties: Record<string, ProviderConfigProperty>;
650
- /** Display order of properties in UI (optional, defaults to object key order) */
651
- order?: string[];
652
- }
653
- /**
654
- * Property types for provider configuration
655
- */
656
- type ProviderConfigPropertyType = 'string' | 'number' | 'boolean' | 'select' | 'password' | 'url';
657
- /**
658
- * Single property in a provider configuration schema.
659
- * Defines how a setting should be rendered and validated in the UI.
660
- */
661
- interface ProviderConfigProperty {
662
- /** Property type - determines UI control */
663
- type: ProviderConfigPropertyType;
664
- /** Display label */
665
- title: string;
666
- /** Help text shown below the input */
667
- description?: string;
668
- /** Default value */
669
- default?: unknown;
670
- /** Whether the field is required */
671
- required?: boolean;
672
- /** Placeholder text for input fields */
673
- placeholder?: string;
674
- /** For 'select' type: static options */
675
- options?: ProviderConfigSelectOption[];
676
- /** Validation rules */
677
- validation?: ProviderConfigValidation;
678
- }
679
- /**
680
- * Option for select-type properties
681
- */
682
- interface ProviderConfigSelectOption {
683
- /** Value stored in settings */
684
- value: string;
685
- /** Display label */
686
- label: string;
612
+ /**
613
+ * Declarative configuration view rendered with the extensionComponent
614
+ * system. The host owns the settings state — bind fields with
615
+ * `value: "$settings.<key>"` and the host updates the model's
616
+ * settingsOverride when the user edits. `onChangeAction` is optional
617
+ * for input fields in this view; buttons can still use `onClickAction`
618
+ * to call extension actions (e.g. OAuth, "Test connection").
619
+ */
620
+ configView?: ProviderConfigView;
687
621
  }
688
622
  /**
689
- * Validation rules for a property
623
+ * Component-tree-based configuration view for a provider.
690
624
  */
691
- interface ProviderConfigValidation {
692
- /** Regex pattern the value must match */
693
- pattern?: string;
694
- /** Minimum string length */
695
- minLength?: number;
696
- /** Maximum string length */
697
- maxLength?: number;
698
- /** Minimum number value */
699
- min?: number;
700
- /** Maximum number value */
701
- max?: number;
625
+ interface ProviderConfigView {
626
+ /** Component tree describing the form. */
627
+ content: ExtensionComponentData;
702
628
  }
703
629
  /**
704
630
  * Tool definition (metadata only, implementation in code)
@@ -1740,4 +1666,4 @@ interface ActionResult {
1740
1666
  error?: string;
1741
1667
  }
1742
1668
 
1743
- export { type BackgroundTaskConfig as $, type ActionResult as A, type ProviderConfigValidation as B, type ChatMessage as C, type ExtensionContext as D, type ExtensionContributions as E, type Disposable as F, type GetModelsOptions as G, type SettingsAPI 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 UserAPI as V, type UserProfile as W, type ChatAPI as X, type ChatInstructionMessage as Y, type LogAPI as Z, type BackgroundWorkersAPI as _, type ChatOptions as a, type BackgroundTaskCallback as a0, type BackgroundTaskContext as a1, type BackgroundTaskHealth as a2, type BackgroundRestartPolicy as a3, type Query as a4, type QueryOptions as a5, type StorageAPI as a6, type SecretsAPI as a7, type StorageCollectionConfig as a8, type StorageContributions as a9, type DividerProps as aA, type IconProps as aB, type IconButtonType as aC, type IconButtonProps as aD, type PanelAction as aE, type PanelProps as aF, type ToggleProps as aG, type CollapsibleProps as aH, type FrameVariant as aI, type FrameProps as aJ, type ListProps as aK, type PillVariant as aL, type PillProps as aM, type CheckboxProps as aN, type MarkdownProps as aO, type TextPreviewProps as aP, type ModalProps as aQ, type ConditionalGroupProps as aR, type ExecutionContext as aS, type AIProvider as aa, type ToolCall as ab, type Tool as ac, type Action as ad, type ExtensionModule as ae, type HugeIconName as af, type AllowedCSSProperty as ag, type ExtensionComponentStyle as ah, type ExtensionComponentData as ai, type ExtensionComponentIterator as aj, type ExtensionComponentChildren as ak, type ExtensionActionCall as al, type ExtensionActionRef as am, type ExtensionDataSource as an, type ExtensionPanelDefinition as ao, type HeaderProps as ap, type LabelProps as aq, type ParagraphProps as ar, type ButtonProps as as, type TextInputProps as at, type DateTimeInputProps as au, type SelectProps as av, type IconPickerProps as aw, type VerticalStackProps as ax, type HorizontalStackProps as ay, type GridProps as az, type StreamEvent as b, type SettingDefinition as c, type SettingOptionsMapping as d, type SettingCreateMapping as e, type ToolSettingsViewDefinition as f, type ToolSettingsView as g, type ToolSettingsListView as h, type ToolSettingsListMapping as i, type ToolSettingsComponentView as j, type ToolSettingsActionDataSource as k, type PanelView as l, type PanelComponentView as m, type PanelActionDataSource as n, type PanelUnknownView as o, type ProviderDefinition 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 ProviderConfigSchema as w, type ProviderConfigProperty as x, type ProviderConfigPropertyType as y, type ProviderConfigSelectOption as z };
1669
+ export { type StorageAPI as $, type ActionResult as A, type SchedulerAPI as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SchedulerJobRequest as F, type GetModelsOptions as G, type SchedulerSchedule as H, type UserProfile as I, type ChatAPI as J, type ChatInstructionMessage as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type LogAPI as O, type PanelDefinition as P, type BackgroundWorkersAPI as Q, type BackgroundTaskConfig as R, type SchedulerFirePayload as S, type ToolResult as T, type UserAPI as U, type BackgroundTaskCallback as V, type BackgroundTaskContext as W, type BackgroundTaskHealth as X, type BackgroundRestartPolicy as Y, type Query as Z, type QueryOptions as _, type ChatOptions as a, type SecretsAPI as a0, type StorageCollectionConfig as a1, type StorageContributions as a2, type AIProvider as a3, type ToolCall as a4, type Tool as a5, type Action as a6, type ExtensionModule as a7, type HugeIconName as a8, type AllowedCSSProperty as a9, type PanelAction as aA, type PanelProps as aB, type ToggleProps as aC, type CollapsibleProps as aD, type FrameVariant as aE, type FrameProps as aF, type ListProps as aG, type PillVariant as aH, type PillProps as aI, type CheckboxProps as aJ, type MarkdownProps as aK, type TextPreviewProps as aL, type ModalProps as aM, type ConditionalGroupProps as aN, type ExecutionContext as aO, type ExtensionComponentStyle as aa, type ExtensionComponentData as ab, type ExtensionComponentIterator as ac, type ExtensionComponentChildren as ad, type ExtensionActionCall as ae, type ExtensionActionRef as af, type ExtensionDataSource as ag, type ExtensionPanelDefinition as ah, type HeaderProps as ai, type LabelProps as aj, type ParagraphProps as ak, type ButtonProps as al, type TextInputProps as am, type PasswordInputProps as an, type NumberInputProps as ao, type TextAreaProps as ap, type DateTimeInputProps as aq, type SelectProps as ar, type IconPickerProps as as, type VerticalStackProps as at, type HorizontalStackProps as au, type GridProps as av, type DividerProps as aw, type IconProps as ax, type IconButtonType as ay, type IconButtonProps as az, type StreamEvent as b, type ToolSettingsViewDefinition as c, type ToolSettingsView as d, type ToolSettingsListView as e, type ToolSettingsListMapping as f, type ToolSettingsComponentView as g, type ToolSettingsActionDataSource as h, type PanelView as i, type PanelComponentView as j, type PanelActionDataSource as k, type PanelUnknownView as l, type ProviderDefinition as m, type ProviderConfigView as n, type PromptContribution as o, type PromptSection as p, type ToolDefinition as q, resolveLocalizedString as r, type ToolConfirmationConfig as s, type CommandDefinition as t, type ExtensionContext as u, type SettingsAPI as v, type ProvidersAPI as w, type ToolsAPI as x, type ActionsAPI as y, type EventsAPI as z };
@@ -180,6 +180,11 @@ interface ParagraphProps extends ExtensionComponentData {
180
180
  interface ButtonProps extends ExtensionComponentData {
181
181
  component: 'Button';
182
182
  text: string;
183
+ /** Visual style. Defaults to "normal". */
184
+ type?: 'normal' | 'primary' | 'danger' | 'accent';
185
+ /** Optional tooltip shown on hover. */
186
+ title?: string;
187
+ disabled?: boolean;
183
188
  onClickAction: ExtensionActionRef;
184
189
  }
185
190
  /** The extension API properties for the TextInput component. */
@@ -188,14 +193,46 @@ interface TextInputProps extends ExtensionComponentData {
188
193
  label: string;
189
194
  placeholder?: string;
190
195
  value?: string;
191
- onChangeAction: ExtensionActionRef;
196
+ onChangeAction?: ExtensionActionRef;
197
+ }
198
+ /** The extension API properties for the PasswordInput component. */
199
+ interface PasswordInputProps extends ExtensionComponentData {
200
+ component: 'PasswordInput';
201
+ label: string;
202
+ placeholder?: string;
203
+ value?: string;
204
+ onChangeAction?: ExtensionActionRef;
205
+ }
206
+ /** The extension API properties for the NumberInput component. */
207
+ interface NumberInputProps extends ExtensionComponentData {
208
+ component: 'NumberInput';
209
+ label: string;
210
+ placeholder?: string;
211
+ value?: string | number;
212
+ /** Optional minimum value. */
213
+ min?: number;
214
+ /** Optional maximum value. */
215
+ max?: number;
216
+ /** Optional step. */
217
+ step?: number;
218
+ onChangeAction?: ExtensionActionRef;
219
+ }
220
+ /** The extension API properties for the TextArea component. */
221
+ interface TextAreaProps extends ExtensionComponentData {
222
+ component: 'TextArea';
223
+ label: string;
224
+ placeholder?: string;
225
+ value?: string;
226
+ /** Number of visible text rows. Defaults to 4. */
227
+ rows?: number;
228
+ onChangeAction?: ExtensionActionRef;
192
229
  }
193
230
  /** The extension API properties for the DateTimeInput component. */
194
231
  interface DateTimeInputProps extends ExtensionComponentData {
195
232
  component: 'DateTimeInput';
196
233
  label: string;
197
234
  value?: string;
198
- onChangeAction: ExtensionActionRef;
235
+ onChangeAction?: ExtensionActionRef;
199
236
  }
200
237
  /** The extension API properties for the Select component. */
201
238
  interface SelectProps extends ExtensionComponentData {
@@ -206,14 +243,14 @@ interface SelectProps extends ExtensionComponentData {
206
243
  value: string;
207
244
  }>;
208
245
  selectedValue?: string;
209
- onChangeAction: ExtensionActionRef;
246
+ onChangeAction?: ExtensionActionRef;
210
247
  }
211
248
  /** The extension API properties for the IconPicker component. */
212
249
  interface IconPickerProps extends ExtensionComponentData {
213
250
  component: 'IconPicker';
214
251
  label?: string;
215
252
  value?: string;
216
- onChangeAction: ExtensionActionRef;
253
+ onChangeAction?: ExtensionActionRef;
217
254
  }
218
255
  /** The extension API properties for the VerticalStack component. */
219
256
  interface VerticalStackProps extends ExtensionComponentData {
@@ -279,7 +316,7 @@ interface ToggleProps extends ExtensionComponentData {
279
316
  description?: string;
280
317
  checked?: boolean;
281
318
  disabled?: boolean;
282
- onChangeAction: ExtensionActionRef;
319
+ onChangeAction?: ExtensionActionRef;
283
320
  }
284
321
  /** The extension API properties for the Collapsible component. */
285
322
  interface CollapsibleProps extends ExtensionComponentData {
@@ -319,7 +356,7 @@ interface CheckboxProps extends ExtensionComponentData {
319
356
  /** Whether to strike through the label when checked. Defaults to true. */
320
357
  strikethrough?: boolean;
321
358
  /** Action to call when the checkbox state changes. */
322
- onChangeAction: ExtensionActionRef;
359
+ onChangeAction?: ExtensionActionRef;
323
360
  }
324
361
  /** The extension API properties for the Markdown component. */
325
362
  interface MarkdownProps extends ExtensionComponentData {
@@ -394,18 +431,10 @@ interface ListProps extends ExtensionComponentData {
394
431
  children: ExtensionComponentChildren;
395
432
  }
396
433
 
397
- /**
398
- * Contribution Types
399
- *
400
- * Types for extension contributions: settings, panels, providers, tools, commands, prompts.
401
- */
402
-
403
434
  /**
404
435
  * What an extension can contribute to Stina
405
436
  */
406
437
  interface ExtensionContributions {
407
- /** User-configurable settings */
408
- settings?: SettingDefinition[];
409
438
  /** Tool settings views for UI */
410
439
  toolSettings?: ToolSettingsViewDefinition[];
411
440
  /** Right panel contributions */
@@ -428,71 +457,6 @@ interface ExtensionContributions {
428
457
  };
429
458
  };
430
459
  }
431
- /**
432
- * Setting definition for the UI
433
- */
434
- interface SettingDefinition {
435
- /** Setting ID (namespaced automatically) */
436
- id: string;
437
- /** Display title */
438
- title: string;
439
- /** Help text */
440
- description?: string;
441
- /** Setting type */
442
- type: 'string' | 'number' | 'boolean' | 'select';
443
- /** Default value */
444
- default?: unknown;
445
- /** For select type: available options */
446
- options?: {
447
- value: string;
448
- label: string;
449
- }[];
450
- /** For select type: load options from tool */
451
- optionsToolId?: string;
452
- /** Params for options tool */
453
- optionsParams?: Record<string, unknown>;
454
- /** Mapping for options tool response */
455
- optionsMapping?: SettingOptionsMapping;
456
- /** Tool ID for creating a new option */
457
- createToolId?: string;
458
- /** Label for create action */
459
- createLabel?: string;
460
- /** Fields for create form */
461
- createFields?: SettingDefinition[];
462
- /** Static params always sent to create tool */
463
- createParams?: Record<string, unknown>;
464
- /** Mapping for create tool response */
465
- createMapping?: SettingCreateMapping;
466
- /** Validation rules */
467
- validation?: {
468
- required?: boolean;
469
- min?: number;
470
- max?: number;
471
- pattern?: string;
472
- };
473
- }
474
- /**
475
- * Mapping for select field options from tool response
476
- */
477
- interface SettingOptionsMapping {
478
- /** Key for items array in tool result data */
479
- itemsKey: string;
480
- /** Key for option value */
481
- valueKey: string;
482
- /** Key for option label */
483
- labelKey: string;
484
- /** Optional key for description */
485
- descriptionKey?: string;
486
- }
487
- /**
488
- * Mapping for create tool response
489
- */
490
- interface SettingCreateMapping {
491
- /** Key for result data object */
492
- resultKey?: string;
493
- /** Key for option value (defaults to "id") */
494
- valueKey: string;
495
- }
496
460
  /**
497
461
  * Tool settings view definition (UI schema)
498
462
  */
@@ -505,8 +469,6 @@ interface ToolSettingsViewDefinition {
505
469
  description?: string;
506
470
  /** View configuration */
507
471
  view: ToolSettingsView;
508
- /** Fields for create/edit forms (uses SettingDefinition) */
509
- fields?: SettingDefinition[];
510
472
  }
511
473
  /**
512
474
  * Tool settings view types
@@ -536,6 +498,16 @@ interface ToolSettingsListView {
536
498
  idParam?: string;
537
499
  /** Static params always sent to list tool */
538
500
  listParams?: Record<string, unknown>;
501
+ /**
502
+ * Component-tree-based create/edit form. Fields bind to the current
503
+ * item via `value: "$item.<key>"` (or `selectedValue` / `checked`),
504
+ * and the host saves the resulting object via `upsertToolId` when
505
+ * the user clicks "Save".
506
+ */
507
+ editView?: {
508
+ /** Root component to render in the create/edit modal. */
509
+ content: ExtensionComponentData;
510
+ };
539
511
  }
540
512
  /**
541
513
  * Mapping from tool list data to UI fields
@@ -637,68 +609,22 @@ interface ProviderDefinition {
637
609
  suggestedDefaultModel?: string;
638
610
  /** Default settings for this provider (e.g., { url: "http://localhost:11434" }) */
639
611
  defaultSettings?: Record<string, unknown>;
640
- /** Schema for provider-specific configuration UI */
641
- configSchema?: ProviderConfigSchema;
642
- }
643
- /**
644
- * Schema for provider-specific configuration.
645
- * Used to generate UI forms for configuring provider settings.
646
- */
647
- interface ProviderConfigSchema {
648
- /** Property definitions */
649
- properties: Record<string, ProviderConfigProperty>;
650
- /** Display order of properties in UI (optional, defaults to object key order) */
651
- order?: string[];
652
- }
653
- /**
654
- * Property types for provider configuration
655
- */
656
- type ProviderConfigPropertyType = 'string' | 'number' | 'boolean' | 'select' | 'password' | 'url';
657
- /**
658
- * Single property in a provider configuration schema.
659
- * Defines how a setting should be rendered and validated in the UI.
660
- */
661
- interface ProviderConfigProperty {
662
- /** Property type - determines UI control */
663
- type: ProviderConfigPropertyType;
664
- /** Display label */
665
- title: string;
666
- /** Help text shown below the input */
667
- description?: string;
668
- /** Default value */
669
- default?: unknown;
670
- /** Whether the field is required */
671
- required?: boolean;
672
- /** Placeholder text for input fields */
673
- placeholder?: string;
674
- /** For 'select' type: static options */
675
- options?: ProviderConfigSelectOption[];
676
- /** Validation rules */
677
- validation?: ProviderConfigValidation;
678
- }
679
- /**
680
- * Option for select-type properties
681
- */
682
- interface ProviderConfigSelectOption {
683
- /** Value stored in settings */
684
- value: string;
685
- /** Display label */
686
- label: string;
612
+ /**
613
+ * Declarative configuration view rendered with the extensionComponent
614
+ * system. The host owns the settings state — bind fields with
615
+ * `value: "$settings.<key>"` and the host updates the model's
616
+ * settingsOverride when the user edits. `onChangeAction` is optional
617
+ * for input fields in this view; buttons can still use `onClickAction`
618
+ * to call extension actions (e.g. OAuth, "Test connection").
619
+ */
620
+ configView?: ProviderConfigView;
687
621
  }
688
622
  /**
689
- * Validation rules for a property
623
+ * Component-tree-based configuration view for a provider.
690
624
  */
691
- interface ProviderConfigValidation {
692
- /** Regex pattern the value must match */
693
- pattern?: string;
694
- /** Minimum string length */
695
- minLength?: number;
696
- /** Maximum string length */
697
- maxLength?: number;
698
- /** Minimum number value */
699
- min?: number;
700
- /** Maximum number value */
701
- max?: number;
625
+ interface ProviderConfigView {
626
+ /** Component tree describing the form. */
627
+ content: ExtensionComponentData;
702
628
  }
703
629
  /**
704
630
  * Tool definition (metadata only, implementation in code)
@@ -1740,4 +1666,4 @@ interface ActionResult {
1740
1666
  error?: string;
1741
1667
  }
1742
1668
 
1743
- export { type BackgroundTaskConfig as $, type ActionResult as A, type ProviderConfigValidation as B, type ChatMessage as C, type ExtensionContext as D, type ExtensionContributions as E, type Disposable as F, type GetModelsOptions as G, type SettingsAPI 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 UserAPI as V, type UserProfile as W, type ChatAPI as X, type ChatInstructionMessage as Y, type LogAPI as Z, type BackgroundWorkersAPI as _, type ChatOptions as a, type BackgroundTaskCallback as a0, type BackgroundTaskContext as a1, type BackgroundTaskHealth as a2, type BackgroundRestartPolicy as a3, type Query as a4, type QueryOptions as a5, type StorageAPI as a6, type SecretsAPI as a7, type StorageCollectionConfig as a8, type StorageContributions as a9, type DividerProps as aA, type IconProps as aB, type IconButtonType as aC, type IconButtonProps as aD, type PanelAction as aE, type PanelProps as aF, type ToggleProps as aG, type CollapsibleProps as aH, type FrameVariant as aI, type FrameProps as aJ, type ListProps as aK, type PillVariant as aL, type PillProps as aM, type CheckboxProps as aN, type MarkdownProps as aO, type TextPreviewProps as aP, type ModalProps as aQ, type ConditionalGroupProps as aR, type ExecutionContext as aS, type AIProvider as aa, type ToolCall as ab, type Tool as ac, type Action as ad, type ExtensionModule as ae, type HugeIconName as af, type AllowedCSSProperty as ag, type ExtensionComponentStyle as ah, type ExtensionComponentData as ai, type ExtensionComponentIterator as aj, type ExtensionComponentChildren as ak, type ExtensionActionCall as al, type ExtensionActionRef as am, type ExtensionDataSource as an, type ExtensionPanelDefinition as ao, type HeaderProps as ap, type LabelProps as aq, type ParagraphProps as ar, type ButtonProps as as, type TextInputProps as at, type DateTimeInputProps as au, type SelectProps as av, type IconPickerProps as aw, type VerticalStackProps as ax, type HorizontalStackProps as ay, type GridProps as az, type StreamEvent as b, type SettingDefinition as c, type SettingOptionsMapping as d, type SettingCreateMapping as e, type ToolSettingsViewDefinition as f, type ToolSettingsView as g, type ToolSettingsListView as h, type ToolSettingsListMapping as i, type ToolSettingsComponentView as j, type ToolSettingsActionDataSource as k, type PanelView as l, type PanelComponentView as m, type PanelActionDataSource as n, type PanelUnknownView as o, type ProviderDefinition 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 ProviderConfigSchema as w, type ProviderConfigProperty as x, type ProviderConfigPropertyType as y, type ProviderConfigSelectOption as z };
1669
+ export { type StorageAPI as $, type ActionResult as A, type SchedulerAPI as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SchedulerJobRequest as F, type GetModelsOptions as G, type SchedulerSchedule as H, type UserProfile as I, type ChatAPI as J, type ChatInstructionMessage as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type LogAPI as O, type PanelDefinition as P, type BackgroundWorkersAPI as Q, type BackgroundTaskConfig as R, type SchedulerFirePayload as S, type ToolResult as T, type UserAPI as U, type BackgroundTaskCallback as V, type BackgroundTaskContext as W, type BackgroundTaskHealth as X, type BackgroundRestartPolicy as Y, type Query as Z, type QueryOptions as _, type ChatOptions as a, type SecretsAPI as a0, type StorageCollectionConfig as a1, type StorageContributions as a2, type AIProvider as a3, type ToolCall as a4, type Tool as a5, type Action as a6, type ExtensionModule as a7, type HugeIconName as a8, type AllowedCSSProperty as a9, type PanelAction as aA, type PanelProps as aB, type ToggleProps as aC, type CollapsibleProps as aD, type FrameVariant as aE, type FrameProps as aF, type ListProps as aG, type PillVariant as aH, type PillProps as aI, type CheckboxProps as aJ, type MarkdownProps as aK, type TextPreviewProps as aL, type ModalProps as aM, type ConditionalGroupProps as aN, type ExecutionContext as aO, type ExtensionComponentStyle as aa, type ExtensionComponentData as ab, type ExtensionComponentIterator as ac, type ExtensionComponentChildren as ad, type ExtensionActionCall as ae, type ExtensionActionRef as af, type ExtensionDataSource as ag, type ExtensionPanelDefinition as ah, type HeaderProps as ai, type LabelProps as aj, type ParagraphProps as ak, type ButtonProps as al, type TextInputProps as am, type PasswordInputProps as an, type NumberInputProps as ao, type TextAreaProps as ap, type DateTimeInputProps as aq, type SelectProps as ar, type IconPickerProps as as, type VerticalStackProps as at, type HorizontalStackProps as au, type GridProps as av, type DividerProps as aw, type IconProps as ax, type IconButtonType as ay, type IconButtonProps as az, type StreamEvent as b, type ToolSettingsViewDefinition as c, type ToolSettingsView as d, type ToolSettingsListView as e, type ToolSettingsListMapping as f, type ToolSettingsComponentView as g, type ToolSettingsActionDataSource as h, type PanelView as i, type PanelComponentView as j, type PanelActionDataSource as k, type PanelUnknownView as l, type ProviderDefinition as m, type ProviderConfigView as n, type PromptContribution as o, type PromptSection as p, type ToolDefinition as q, resolveLocalizedString as r, type ToolConfirmationConfig as s, type CommandDefinition as t, type ExtensionContext as u, type SettingsAPI as v, type ProvidersAPI as w, type ToolsAPI as x, type ActionsAPI as y, type EventsAPI as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stina/extension-api",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",