@stina/extension-api 0.32.0 → 0.33.0-alpha.8cab91c
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/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/schemas/index.cjs +58 -110
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +2752 -3056
- package/dist/schemas/index.d.ts +2752 -3056
- package/dist/schemas/index.js +56 -101
- package/dist/schemas/index.js.map +1 -1
- package/dist/{types.tools-XIdePk7Z.d.cts → types.tools-BYgcVNP4.d.cts} +82 -141
- package/dist/{types.tools-XIdePk7Z.d.ts → types.tools-BYgcVNP4.d.ts} +82 -141
- package/package.json +1 -1
- package/schema/extension-manifest.schema.json +146 -341
- package/src/index.ts +4 -10
- package/src/schemas/components.schema.ts +52 -6
- package/src/schemas/contributions.schema.ts +33 -178
- package/src/schemas/index.ts +4 -18
- package/src/types.components.ts +46 -6
- package/src/types.contributions.ts +39 -142
- package/src/types.ts +1 -9
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,31 @@ 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
|
+
};
|
|
511
|
+
/** Optional grouping configuration. When set, items are visually grouped by this field. */
|
|
512
|
+
groupBy?: ToolSettingsListGroupBy;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Configures grouping for a list view. Items are grouped by the value
|
|
516
|
+
* of `key` on each item; groups appear in the order specified by `order`
|
|
517
|
+
* (with unlisted groups falling back to alphabetical order at the end).
|
|
518
|
+
*/
|
|
519
|
+
interface ToolSettingsListGroupBy {
|
|
520
|
+
/** Key in each item used to determine group membership. */
|
|
521
|
+
key: string;
|
|
522
|
+
/** Explicit ordering of group values. Groups not listed appear afterwards, sorted alphabetically. */
|
|
523
|
+
order?: string[];
|
|
524
|
+
/** Human-friendly labels per group value (rendered as section headers). Falls back to the raw value if missing. */
|
|
525
|
+
labels?: Record<string, string>;
|
|
539
526
|
}
|
|
540
527
|
/**
|
|
541
528
|
* Mapping from tool list data to UI fields
|
|
@@ -637,68 +624,22 @@ interface ProviderDefinition {
|
|
|
637
624
|
suggestedDefaultModel?: string;
|
|
638
625
|
/** Default settings for this provider (e.g., { url: "http://localhost:11434" }) */
|
|
639
626
|
defaultSettings?: Record<string, unknown>;
|
|
640
|
-
/**
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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;
|
|
627
|
+
/**
|
|
628
|
+
* Declarative configuration view rendered with the extensionComponent
|
|
629
|
+
* system. The host owns the settings state — bind fields with
|
|
630
|
+
* `value: "$settings.<key>"` and the host updates the model's
|
|
631
|
+
* settingsOverride when the user edits. `onChangeAction` is optional
|
|
632
|
+
* for input fields in this view; buttons can still use `onClickAction`
|
|
633
|
+
* to call extension actions (e.g. OAuth, "Test connection").
|
|
634
|
+
*/
|
|
635
|
+
configView?: ProviderConfigView;
|
|
687
636
|
}
|
|
688
637
|
/**
|
|
689
|
-
*
|
|
638
|
+
* Component-tree-based configuration view for a provider.
|
|
690
639
|
*/
|
|
691
|
-
interface
|
|
692
|
-
/**
|
|
693
|
-
|
|
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;
|
|
640
|
+
interface ProviderConfigView {
|
|
641
|
+
/** Component tree describing the form. */
|
|
642
|
+
content: ExtensionComponentData;
|
|
702
643
|
}
|
|
703
644
|
/**
|
|
704
645
|
* Tool definition (metadata only, implementation in code)
|
|
@@ -1740,4 +1681,4 @@ interface ActionResult {
|
|
|
1740
1681
|
error?: string;
|
|
1741
1682
|
}
|
|
1742
1683
|
|
|
1743
|
-
export { type
|
|
1684
|
+
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,31 @@ 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
|
+
};
|
|
511
|
+
/** Optional grouping configuration. When set, items are visually grouped by this field. */
|
|
512
|
+
groupBy?: ToolSettingsListGroupBy;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Configures grouping for a list view. Items are grouped by the value
|
|
516
|
+
* of `key` on each item; groups appear in the order specified by `order`
|
|
517
|
+
* (with unlisted groups falling back to alphabetical order at the end).
|
|
518
|
+
*/
|
|
519
|
+
interface ToolSettingsListGroupBy {
|
|
520
|
+
/** Key in each item used to determine group membership. */
|
|
521
|
+
key: string;
|
|
522
|
+
/** Explicit ordering of group values. Groups not listed appear afterwards, sorted alphabetically. */
|
|
523
|
+
order?: string[];
|
|
524
|
+
/** Human-friendly labels per group value (rendered as section headers). Falls back to the raw value if missing. */
|
|
525
|
+
labels?: Record<string, string>;
|
|
539
526
|
}
|
|
540
527
|
/**
|
|
541
528
|
* Mapping from tool list data to UI fields
|
|
@@ -637,68 +624,22 @@ interface ProviderDefinition {
|
|
|
637
624
|
suggestedDefaultModel?: string;
|
|
638
625
|
/** Default settings for this provider (e.g., { url: "http://localhost:11434" }) */
|
|
639
626
|
defaultSettings?: Record<string, unknown>;
|
|
640
|
-
/**
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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;
|
|
627
|
+
/**
|
|
628
|
+
* Declarative configuration view rendered with the extensionComponent
|
|
629
|
+
* system. The host owns the settings state — bind fields with
|
|
630
|
+
* `value: "$settings.<key>"` and the host updates the model's
|
|
631
|
+
* settingsOverride when the user edits. `onChangeAction` is optional
|
|
632
|
+
* for input fields in this view; buttons can still use `onClickAction`
|
|
633
|
+
* to call extension actions (e.g. OAuth, "Test connection").
|
|
634
|
+
*/
|
|
635
|
+
configView?: ProviderConfigView;
|
|
687
636
|
}
|
|
688
637
|
/**
|
|
689
|
-
*
|
|
638
|
+
* Component-tree-based configuration view for a provider.
|
|
690
639
|
*/
|
|
691
|
-
interface
|
|
692
|
-
/**
|
|
693
|
-
|
|
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;
|
|
640
|
+
interface ProviderConfigView {
|
|
641
|
+
/** Component tree describing the form. */
|
|
642
|
+
content: ExtensionComponentData;
|
|
702
643
|
}
|
|
703
644
|
/**
|
|
704
645
|
* Tool definition (metadata only, implementation in code)
|
|
@@ -1740,4 +1681,4 @@ interface ActionResult {
|
|
|
1740
1681
|
error?: string;
|
|
1741
1682
|
}
|
|
1742
1683
|
|
|
1743
|
-
export { type
|
|
1684
|
+
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 };
|