@stina/extension-api 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-U3PEHSBG.js → chunk-DGUM43GV.js} +2 -8
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-PTPOHFA4.js +9 -0
- package/dist/{chunk-U3PEHSBG.js.map → chunk-PTPOHFA4.js.map} +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +134 -41
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +138 -43
- package/dist/runtime.js.map +1 -1
- package/dist/schemas/index.cjs +711 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.cts +4707 -0
- package/dist/schemas/index.d.ts +4707 -0
- package/dist/schemas/index.js +615 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/{types.tools-BXGZf8zc.d.cts → types.tools-6o0mTWW-.d.cts} +311 -85
- package/dist/{types.tools-BXGZf8zc.d.ts → types.tools-6o0mTWW-.d.ts} +311 -85
- package/package.json +16 -4
- package/schema/extension-manifest.schema.json +993 -0
- package/scripts/generate-schema.ts +41 -0
- package/src/background.test.ts +33 -0
- package/src/background.ts +24 -0
- package/src/index.ts +8 -2
- package/src/messages.ts +31 -4
- package/src/runtime.ts +149 -43
- package/src/schemas/components.schema.ts +465 -0
- package/src/schemas/contributions.schema.ts +473 -0
- package/src/schemas/index.ts +162 -0
- package/src/schemas/manifest.schema.ts +71 -0
- package/src/schemas/permissions.schema.ts +141 -0
- package/src/types.context.ts +36 -93
- package/src/types.contributions.ts +9 -0
- package/src/types.permissions.ts +1 -1
- package/src/types.storage.ts +287 -0
- package/src/types.ts +10 -2
- package/tsup.config.ts +1 -1
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/schemas/index.ts
|
|
21
|
+
var schemas_exports = {};
|
|
22
|
+
__export(schemas_exports, {
|
|
23
|
+
AllowedCSSPropertySchema: () => AllowedCSSPropertySchema,
|
|
24
|
+
AuthorSchema: () => AuthorSchema,
|
|
25
|
+
ButtonPropsSchema: () => ButtonPropsSchema,
|
|
26
|
+
CapabilityPermissionSchema: () => CapabilityPermissionSchema,
|
|
27
|
+
CheckboxPropsSchema: () => CheckboxPropsSchema,
|
|
28
|
+
CollapsiblePropsSchema: () => CollapsiblePropsSchema,
|
|
29
|
+
CommandDefinitionSchema: () => CommandDefinitionSchema,
|
|
30
|
+
ConditionalGroupPropsSchema: () => ConditionalGroupPropsSchema,
|
|
31
|
+
DateTimeInputPropsSchema: () => DateTimeInputPropsSchema,
|
|
32
|
+
DividerPropsSchema: () => DividerPropsSchema,
|
|
33
|
+
EnginesSchema: () => EnginesSchema,
|
|
34
|
+
ExtensionActionCallSchema: () => ExtensionActionCallSchema,
|
|
35
|
+
ExtensionActionRefSchema: () => ExtensionActionRefSchema,
|
|
36
|
+
ExtensionComponentChildrenSchema: () => ExtensionComponentChildrenSchema,
|
|
37
|
+
ExtensionComponentDataSchema: () => ExtensionComponentDataSchema,
|
|
38
|
+
ExtensionComponentIteratorSchema: () => ExtensionComponentIteratorSchema,
|
|
39
|
+
ExtensionComponentStyleSchema: () => ExtensionComponentStyleSchema,
|
|
40
|
+
ExtensionContributionsSchema: () => ExtensionContributionsSchema,
|
|
41
|
+
ExtensionDataSourceSchema: () => ExtensionDataSourceSchema,
|
|
42
|
+
ExtensionManifestSchema: () => ExtensionManifestSchema,
|
|
43
|
+
GridPropsSchema: () => GridPropsSchema,
|
|
44
|
+
HeaderPropsSchema: () => HeaderPropsSchema,
|
|
45
|
+
HorizontalStackPropsSchema: () => HorizontalStackPropsSchema,
|
|
46
|
+
IconButtonPropsSchema: () => IconButtonPropsSchema,
|
|
47
|
+
IconButtonTypeSchema: () => IconButtonTypeSchema,
|
|
48
|
+
IconPropsSchema: () => IconPropsSchema,
|
|
49
|
+
LabelPropsSchema: () => LabelPropsSchema,
|
|
50
|
+
LocalizedStringSchema: () => LocalizedStringSchema,
|
|
51
|
+
MarkdownPropsSchema: () => MarkdownPropsSchema,
|
|
52
|
+
ModalPropsSchema: () => ModalPropsSchema,
|
|
53
|
+
NetworkPermissionSchema: () => NetworkPermissionSchema,
|
|
54
|
+
PERMISSION_PATTERNS: () => PERMISSION_PATTERNS,
|
|
55
|
+
PanelActionDataSourceSchema: () => PanelActionDataSourceSchema,
|
|
56
|
+
PanelActionSchema: () => PanelActionSchema,
|
|
57
|
+
PanelComponentViewSchema: () => PanelComponentViewSchema,
|
|
58
|
+
PanelDefinitionSchema: () => PanelDefinitionSchema,
|
|
59
|
+
PanelPropsSchema: () => PanelPropsSchema,
|
|
60
|
+
PanelUnknownViewSchema: () => PanelUnknownViewSchema,
|
|
61
|
+
PanelViewSchema: () => PanelViewSchema,
|
|
62
|
+
ParagraphPropsSchema: () => ParagraphPropsSchema,
|
|
63
|
+
PermissionSchema: () => PermissionSchema,
|
|
64
|
+
PillPropsSchema: () => PillPropsSchema,
|
|
65
|
+
PillVariantSchema: () => PillVariantSchema,
|
|
66
|
+
PlatformSchema: () => PlatformSchema,
|
|
67
|
+
PromptContributionSchema: () => PromptContributionSchema,
|
|
68
|
+
PromptSectionSchema: () => PromptSectionSchema,
|
|
69
|
+
ProviderConfigPropertySchema: () => ProviderConfigPropertySchema,
|
|
70
|
+
ProviderConfigPropertyTypeSchema: () => ProviderConfigPropertyTypeSchema,
|
|
71
|
+
ProviderConfigSchemaSchema: () => ProviderConfigSchemaSchema,
|
|
72
|
+
ProviderConfigSelectOptionSchema: () => ProviderConfigSelectOptionSchema,
|
|
73
|
+
ProviderConfigValidationSchema: () => ProviderConfigValidationSchema,
|
|
74
|
+
ProviderDefinitionSchema: () => ProviderDefinitionSchema,
|
|
75
|
+
SelectPropsSchema: () => SelectPropsSchema,
|
|
76
|
+
SettingCreateMappingSchema: () => SettingCreateMappingSchema,
|
|
77
|
+
SettingDefinitionSchema: () => SettingDefinitionSchema,
|
|
78
|
+
SettingOptionsMappingSchema: () => SettingOptionsMappingSchema,
|
|
79
|
+
SettingValidationSchema: () => SettingValidationSchema,
|
|
80
|
+
StoragePermissionSchema: () => StoragePermissionSchema,
|
|
81
|
+
SystemPermissionSchema: () => SystemPermissionSchema,
|
|
82
|
+
TextInputPropsSchema: () => TextInputPropsSchema,
|
|
83
|
+
TogglePropsSchema: () => TogglePropsSchema,
|
|
84
|
+
ToolDefinitionSchema: () => ToolDefinitionSchema,
|
|
85
|
+
ToolSettingsActionDataSourceSchema: () => ToolSettingsActionDataSourceSchema,
|
|
86
|
+
ToolSettingsComponentViewSchema: () => ToolSettingsComponentViewSchema,
|
|
87
|
+
ToolSettingsListMappingSchema: () => ToolSettingsListMappingSchema,
|
|
88
|
+
ToolSettingsListViewSchema: () => ToolSettingsListViewSchema,
|
|
89
|
+
ToolSettingsViewDefinitionSchema: () => ToolSettingsViewDefinitionSchema,
|
|
90
|
+
ToolSettingsViewSchema: () => ToolSettingsViewSchema,
|
|
91
|
+
UserDataPermissionSchema: () => UserDataPermissionSchema,
|
|
92
|
+
VALID_PERMISSIONS: () => VALID_PERMISSIONS,
|
|
93
|
+
VerticalStackPropsSchema: () => VerticalStackPropsSchema,
|
|
94
|
+
isValidPermission: () => isValidPermission
|
|
95
|
+
});
|
|
96
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
97
|
+
|
|
98
|
+
// src/schemas/manifest.schema.ts
|
|
99
|
+
var import_zod4 = require("zod");
|
|
100
|
+
|
|
101
|
+
// src/schemas/permissions.schema.ts
|
|
102
|
+
var import_zod = require("zod");
|
|
103
|
+
var VALID_PERMISSIONS = [
|
|
104
|
+
"network:*",
|
|
105
|
+
"network:localhost",
|
|
106
|
+
"storage.collections",
|
|
107
|
+
"secrets.manage",
|
|
108
|
+
"user.profile.read",
|
|
109
|
+
"user.location.read",
|
|
110
|
+
"chat.history.read",
|
|
111
|
+
"chat.current.read",
|
|
112
|
+
"chat.message.write",
|
|
113
|
+
"provider.register",
|
|
114
|
+
"tools.register",
|
|
115
|
+
"actions.register",
|
|
116
|
+
"settings.register",
|
|
117
|
+
"commands.register",
|
|
118
|
+
"panels.register",
|
|
119
|
+
"events.emit",
|
|
120
|
+
"scheduler.register",
|
|
121
|
+
"background.workers",
|
|
122
|
+
"files.read",
|
|
123
|
+
"files.write",
|
|
124
|
+
"clipboard.read",
|
|
125
|
+
"clipboard.write"
|
|
126
|
+
];
|
|
127
|
+
var PERMISSION_PATTERNS = [
|
|
128
|
+
/^network:localhost:\d+$/,
|
|
129
|
+
// network:localhost:11434
|
|
130
|
+
/^network:[a-zA-Z0-9.-]+$/,
|
|
131
|
+
// network:api.example.com
|
|
132
|
+
/^network:[a-zA-Z0-9.-]+:\d+$/
|
|
133
|
+
// network:api.example.com:8080
|
|
134
|
+
];
|
|
135
|
+
var NetworkPermissionSchema = import_zod.z.string().refine(
|
|
136
|
+
(val) => {
|
|
137
|
+
if (val === "network:*" || val === "network:localhost") {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
return PERMISSION_PATTERNS.some((pattern) => pattern.test(val));
|
|
141
|
+
},
|
|
142
|
+
{ message: "Invalid network permission format" }
|
|
143
|
+
).describe('Network access permission (e.g., "network:*", "network:localhost:11434")');
|
|
144
|
+
var StoragePermissionSchema = import_zod.z.enum(["storage.collections", "secrets.manage"]).describe("Storage permission");
|
|
145
|
+
var UserDataPermissionSchema = import_zod.z.enum(["user.profile.read", "user.location.read", "chat.history.read", "chat.current.read"]).describe("User data access permission");
|
|
146
|
+
var CapabilityPermissionSchema = import_zod.z.enum([
|
|
147
|
+
"provider.register",
|
|
148
|
+
"tools.register",
|
|
149
|
+
"actions.register",
|
|
150
|
+
"settings.register",
|
|
151
|
+
"commands.register",
|
|
152
|
+
"panels.register",
|
|
153
|
+
"events.emit",
|
|
154
|
+
"scheduler.register",
|
|
155
|
+
"chat.message.write",
|
|
156
|
+
"background.workers"
|
|
157
|
+
]).describe("Capability permission");
|
|
158
|
+
var SystemPermissionSchema = import_zod.z.enum(["files.read", "files.write", "clipboard.read", "clipboard.write"]).describe("System permission");
|
|
159
|
+
var NETWORK_PERMISSION_REGEX = /^network:[a-zA-Z0-9.-]+(:\d+)?$/;
|
|
160
|
+
var PermissionSchema = import_zod.z.union([
|
|
161
|
+
import_zod.z.enum(VALID_PERMISSIONS),
|
|
162
|
+
import_zod.z.string().regex(NETWORK_PERMISSION_REGEX, "Invalid network permission format")
|
|
163
|
+
]).describe("Extension permission");
|
|
164
|
+
function isValidPermission(permission) {
|
|
165
|
+
return PermissionSchema.safeParse(permission).success;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/schemas/contributions.schema.ts
|
|
169
|
+
var import_zod3 = require("zod");
|
|
170
|
+
|
|
171
|
+
// src/schemas/components.schema.ts
|
|
172
|
+
var import_zod2 = require("zod");
|
|
173
|
+
var AllowedCSSPropertySchema = import_zod2.z.enum([
|
|
174
|
+
// Colors
|
|
175
|
+
"color",
|
|
176
|
+
"background-color",
|
|
177
|
+
"background",
|
|
178
|
+
"border-color",
|
|
179
|
+
// Borders
|
|
180
|
+
"border",
|
|
181
|
+
"border-width",
|
|
182
|
+
"border-style",
|
|
183
|
+
"border-radius",
|
|
184
|
+
"border-top",
|
|
185
|
+
"border-right",
|
|
186
|
+
"border-bottom",
|
|
187
|
+
"border-left",
|
|
188
|
+
"border-top-left-radius",
|
|
189
|
+
"border-top-right-radius",
|
|
190
|
+
"border-bottom-left-radius",
|
|
191
|
+
"border-bottom-right-radius",
|
|
192
|
+
// Spacing
|
|
193
|
+
"padding",
|
|
194
|
+
"padding-top",
|
|
195
|
+
"padding-right",
|
|
196
|
+
"padding-bottom",
|
|
197
|
+
"padding-left",
|
|
198
|
+
"margin",
|
|
199
|
+
"margin-top",
|
|
200
|
+
"margin-right",
|
|
201
|
+
"margin-bottom",
|
|
202
|
+
"margin-left",
|
|
203
|
+
"gap",
|
|
204
|
+
"row-gap",
|
|
205
|
+
"column-gap",
|
|
206
|
+
// Typography
|
|
207
|
+
"font-size",
|
|
208
|
+
"font-weight",
|
|
209
|
+
"font-style",
|
|
210
|
+
"text-align",
|
|
211
|
+
"text-decoration",
|
|
212
|
+
"line-height",
|
|
213
|
+
"letter-spacing",
|
|
214
|
+
"white-space",
|
|
215
|
+
"word-break",
|
|
216
|
+
"overflow-wrap",
|
|
217
|
+
// Layout (safe properties)
|
|
218
|
+
"width",
|
|
219
|
+
"height",
|
|
220
|
+
"min-width",
|
|
221
|
+
"min-height",
|
|
222
|
+
"max-width",
|
|
223
|
+
"max-height",
|
|
224
|
+
"flex",
|
|
225
|
+
"flex-grow",
|
|
226
|
+
"flex-shrink",
|
|
227
|
+
"flex-basis",
|
|
228
|
+
"flex-wrap",
|
|
229
|
+
"align-self",
|
|
230
|
+
"justify-self",
|
|
231
|
+
"align-items",
|
|
232
|
+
"justify-content",
|
|
233
|
+
// Visual
|
|
234
|
+
"opacity",
|
|
235
|
+
"visibility",
|
|
236
|
+
"overflow",
|
|
237
|
+
"overflow-x",
|
|
238
|
+
"overflow-y",
|
|
239
|
+
"box-shadow",
|
|
240
|
+
"outline",
|
|
241
|
+
"cursor",
|
|
242
|
+
"border-collapse",
|
|
243
|
+
"border-spacing"
|
|
244
|
+
]);
|
|
245
|
+
var ExtensionComponentStyleSchema = import_zod2.z.record(AllowedCSSPropertySchema, import_zod2.z.string()).describe("Safe CSS styles for the component");
|
|
246
|
+
var ExtensionComponentDataSchema = import_zod2.z.lazy(
|
|
247
|
+
() => import_zod2.z.object({
|
|
248
|
+
component: import_zod2.z.string().describe("Component type name"),
|
|
249
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
250
|
+
}).passthrough().describe("Extension component definition")
|
|
251
|
+
);
|
|
252
|
+
var ExtensionActionCallSchema = import_zod2.z.object({
|
|
253
|
+
action: import_zod2.z.string().describe("Name of the registered action"),
|
|
254
|
+
params: import_zod2.z.record(import_zod2.z.unknown()).optional().describe("Parameters to pass")
|
|
255
|
+
}).describe("Action call with parameters");
|
|
256
|
+
var ExtensionActionRefSchema = import_zod2.z.union([import_zod2.z.string(), ExtensionActionCallSchema]).describe("Action reference");
|
|
257
|
+
var ExtensionComponentIteratorSchema = import_zod2.z.object({
|
|
258
|
+
each: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.unknown())]).describe("Data source to iterate over"),
|
|
259
|
+
as: import_zod2.z.string().describe("Variable name for current item in scope"),
|
|
260
|
+
items: import_zod2.z.array(ExtensionComponentDataSchema).describe("Components to render for each item")
|
|
261
|
+
}).describe("Iterator for rendering lists");
|
|
262
|
+
var ExtensionComponentChildrenSchema = import_zod2.z.union([import_zod2.z.array(ExtensionComponentDataSchema), ExtensionComponentIteratorSchema]).describe("Child components or iterator");
|
|
263
|
+
var ExtensionDataSourceSchema = import_zod2.z.object({
|
|
264
|
+
action: import_zod2.z.string().describe("Action to call for fetching data"),
|
|
265
|
+
params: import_zod2.z.record(import_zod2.z.unknown()).optional().describe("Parameters to pass to the action"),
|
|
266
|
+
refreshOn: import_zod2.z.array(import_zod2.z.string()).optional().describe("Event names that trigger a refresh")
|
|
267
|
+
}).describe("Data source definition");
|
|
268
|
+
var HeaderPropsSchema = import_zod2.z.object({
|
|
269
|
+
component: import_zod2.z.literal("Header"),
|
|
270
|
+
level: import_zod2.z.number().min(1).max(6).describe("Heading level (1-6)"),
|
|
271
|
+
title: import_zod2.z.string().describe("Header title"),
|
|
272
|
+
description: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional().describe("Description text"),
|
|
273
|
+
icon: import_zod2.z.string().optional().describe("Icon name"),
|
|
274
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
275
|
+
}).passthrough().describe("Header component");
|
|
276
|
+
var LabelPropsSchema = import_zod2.z.object({
|
|
277
|
+
component: import_zod2.z.literal("Label"),
|
|
278
|
+
text: import_zod2.z.string().describe("Label text"),
|
|
279
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
280
|
+
}).passthrough().describe("Label component");
|
|
281
|
+
var ParagraphPropsSchema = import_zod2.z.object({
|
|
282
|
+
component: import_zod2.z.literal("Paragraph"),
|
|
283
|
+
text: import_zod2.z.string().describe("Paragraph text"),
|
|
284
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
285
|
+
}).passthrough().describe("Paragraph component");
|
|
286
|
+
var ButtonPropsSchema = import_zod2.z.object({
|
|
287
|
+
component: import_zod2.z.literal("Button"),
|
|
288
|
+
text: import_zod2.z.string().describe("Button text"),
|
|
289
|
+
onClickAction: ExtensionActionRefSchema.describe("Action to call on click"),
|
|
290
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
291
|
+
}).passthrough().describe("Button component");
|
|
292
|
+
var TextInputPropsSchema = import_zod2.z.object({
|
|
293
|
+
component: import_zod2.z.literal("TextInput"),
|
|
294
|
+
label: import_zod2.z.string().describe("Input label"),
|
|
295
|
+
placeholder: import_zod2.z.string().optional().describe("Placeholder text"),
|
|
296
|
+
value: import_zod2.z.string().optional().describe("Current value"),
|
|
297
|
+
onChangeAction: ExtensionActionRefSchema.describe("Action to call on change"),
|
|
298
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
299
|
+
}).passthrough().describe("TextInput component");
|
|
300
|
+
var DateTimeInputPropsSchema = import_zod2.z.object({
|
|
301
|
+
component: import_zod2.z.literal("DateTimeInput"),
|
|
302
|
+
label: import_zod2.z.string().describe("Input label"),
|
|
303
|
+
value: import_zod2.z.string().optional().describe("Current value"),
|
|
304
|
+
onChangeAction: ExtensionActionRefSchema.describe("Action to call on change"),
|
|
305
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
306
|
+
}).passthrough().describe("DateTimeInput component");
|
|
307
|
+
var SelectPropsSchema = import_zod2.z.object({
|
|
308
|
+
component: import_zod2.z.literal("Select"),
|
|
309
|
+
label: import_zod2.z.string().describe("Select label"),
|
|
310
|
+
options: import_zod2.z.array(import_zod2.z.object({ label: import_zod2.z.string(), value: import_zod2.z.string() })).describe("Available options"),
|
|
311
|
+
selectedValue: import_zod2.z.string().optional().describe("Currently selected value"),
|
|
312
|
+
onChangeAction: ExtensionActionRefSchema.describe("Action to call on change"),
|
|
313
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
314
|
+
}).passthrough().describe("Select component");
|
|
315
|
+
var VerticalStackPropsSchema = import_zod2.z.object({
|
|
316
|
+
component: import_zod2.z.literal("VerticalStack"),
|
|
317
|
+
gap: import_zod2.z.number().optional().describe("Gap between children"),
|
|
318
|
+
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
319
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
320
|
+
}).passthrough().describe("VerticalStack layout component");
|
|
321
|
+
var HorizontalStackPropsSchema = import_zod2.z.object({
|
|
322
|
+
component: import_zod2.z.literal("HorizontalStack"),
|
|
323
|
+
gap: import_zod2.z.number().optional().describe("Gap between children"),
|
|
324
|
+
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
325
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
326
|
+
}).passthrough().describe("HorizontalStack layout component");
|
|
327
|
+
var GridPropsSchema = import_zod2.z.object({
|
|
328
|
+
component: import_zod2.z.literal("Grid"),
|
|
329
|
+
columns: import_zod2.z.number().describe("Number of columns"),
|
|
330
|
+
gap: import_zod2.z.number().optional().describe("Gap between items"),
|
|
331
|
+
children: ExtensionComponentChildrenSchema.describe("Child components"),
|
|
332
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
333
|
+
}).passthrough().describe("Grid layout component");
|
|
334
|
+
var DividerPropsSchema = import_zod2.z.object({
|
|
335
|
+
component: import_zod2.z.literal("Divider"),
|
|
336
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
337
|
+
}).passthrough().describe("Divider component");
|
|
338
|
+
var IconPropsSchema = import_zod2.z.object({
|
|
339
|
+
component: import_zod2.z.literal("Icon"),
|
|
340
|
+
name: import_zod2.z.string().describe("Icon name"),
|
|
341
|
+
title: import_zod2.z.string().optional().describe("Icon title"),
|
|
342
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
343
|
+
}).passthrough().describe("Icon component");
|
|
344
|
+
var IconButtonTypeSchema = import_zod2.z.enum(["normal", "primary", "danger", "accent"]).describe("Button type");
|
|
345
|
+
var IconButtonPropsSchema = import_zod2.z.object({
|
|
346
|
+
component: import_zod2.z.literal("IconButton"),
|
|
347
|
+
icon: import_zod2.z.string().describe("Icon name"),
|
|
348
|
+
tooltip: import_zod2.z.string().describe("Tooltip text"),
|
|
349
|
+
active: import_zod2.z.boolean().optional().describe("Whether the button is active"),
|
|
350
|
+
disabled: import_zod2.z.boolean().optional().describe("Whether the button is disabled"),
|
|
351
|
+
type: IconButtonTypeSchema.optional().describe("Button style type"),
|
|
352
|
+
onClickAction: ExtensionActionRefSchema.describe("Action to call on click"),
|
|
353
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
354
|
+
}).passthrough().describe("IconButton component");
|
|
355
|
+
var PanelActionSchema = import_zod2.z.object({
|
|
356
|
+
icon: import_zod2.z.string().describe("Icon name"),
|
|
357
|
+
tooltip: import_zod2.z.string().describe("Tooltip text"),
|
|
358
|
+
action: ExtensionActionRefSchema.describe("Action to call"),
|
|
359
|
+
type: IconButtonTypeSchema.optional().describe("Button style type")
|
|
360
|
+
}).describe("Panel action button");
|
|
361
|
+
var PanelPropsSchema = import_zod2.z.object({
|
|
362
|
+
component: import_zod2.z.literal("Panel"),
|
|
363
|
+
title: import_zod2.z.string().describe("Panel title"),
|
|
364
|
+
description: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional().describe("Description text"),
|
|
365
|
+
icon: import_zod2.z.string().optional().describe("Icon name"),
|
|
366
|
+
actions: import_zod2.z.array(PanelActionSchema).optional().describe("Action buttons"),
|
|
367
|
+
content: ExtensionComponentDataSchema.optional().describe("Panel content"),
|
|
368
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
369
|
+
}).passthrough().describe("Panel component");
|
|
370
|
+
var TogglePropsSchema = import_zod2.z.object({
|
|
371
|
+
component: import_zod2.z.literal("Toggle"),
|
|
372
|
+
label: import_zod2.z.string().optional().describe("Toggle label"),
|
|
373
|
+
description: import_zod2.z.string().optional().describe("Description text"),
|
|
374
|
+
checked: import_zod2.z.boolean().optional().describe("Whether the toggle is checked"),
|
|
375
|
+
disabled: import_zod2.z.boolean().optional().describe("Whether the toggle is disabled"),
|
|
376
|
+
onChangeAction: ExtensionActionRefSchema.describe("Action to call on change"),
|
|
377
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
378
|
+
}).passthrough().describe("Toggle component");
|
|
379
|
+
var CollapsiblePropsSchema = import_zod2.z.object({
|
|
380
|
+
component: import_zod2.z.literal("Collapsible"),
|
|
381
|
+
title: import_zod2.z.string().describe("Title displayed in the header"),
|
|
382
|
+
description: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional().describe("Description text"),
|
|
383
|
+
icon: import_zod2.z.string().optional().describe("Icon name"),
|
|
384
|
+
defaultExpanded: import_zod2.z.boolean().optional().describe("Whether expanded by default"),
|
|
385
|
+
content: ExtensionComponentDataSchema.optional().describe("Content when expanded"),
|
|
386
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
387
|
+
}).passthrough().describe("Collapsible component");
|
|
388
|
+
var PillVariantSchema = import_zod2.z.enum(["default", "primary", "success", "warning", "danger", "accent"]).describe("Pill color variant");
|
|
389
|
+
var PillPropsSchema = import_zod2.z.object({
|
|
390
|
+
component: import_zod2.z.literal("Pill"),
|
|
391
|
+
text: import_zod2.z.string().describe("Pill text"),
|
|
392
|
+
icon: import_zod2.z.string().optional().describe("Icon name"),
|
|
393
|
+
variant: PillVariantSchema.optional().describe("Color variant"),
|
|
394
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
395
|
+
}).passthrough().describe("Pill component");
|
|
396
|
+
var CheckboxPropsSchema = import_zod2.z.object({
|
|
397
|
+
component: import_zod2.z.literal("Checkbox"),
|
|
398
|
+
label: import_zod2.z.string().describe("Checkbox label"),
|
|
399
|
+
checked: import_zod2.z.boolean().optional().describe("Whether the checkbox is checked"),
|
|
400
|
+
disabled: import_zod2.z.boolean().optional().describe("Whether the checkbox is disabled"),
|
|
401
|
+
strikethrough: import_zod2.z.boolean().optional().describe("Strike through label when checked"),
|
|
402
|
+
onChangeAction: ExtensionActionRefSchema.describe("Action to call on change"),
|
|
403
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
404
|
+
}).passthrough().describe("Checkbox component");
|
|
405
|
+
var MarkdownPropsSchema = import_zod2.z.object({
|
|
406
|
+
component: import_zod2.z.literal("Markdown"),
|
|
407
|
+
content: import_zod2.z.string().describe("Markdown content"),
|
|
408
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
409
|
+
}).passthrough().describe("Markdown component");
|
|
410
|
+
var ModalPropsSchema = import_zod2.z.object({
|
|
411
|
+
component: import_zod2.z.literal("Modal"),
|
|
412
|
+
title: import_zod2.z.string().describe("Modal title"),
|
|
413
|
+
open: import_zod2.z.boolean().optional().describe("Whether the modal is open"),
|
|
414
|
+
maxWidth: import_zod2.z.string().optional().describe("Max width of the modal"),
|
|
415
|
+
body: ExtensionComponentDataSchema.optional().describe("Modal body content"),
|
|
416
|
+
footer: ExtensionComponentDataSchema.optional().describe("Modal footer content"),
|
|
417
|
+
onCloseAction: ExtensionActionRefSchema.optional().describe("Action to call on close"),
|
|
418
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
419
|
+
}).passthrough().describe("Modal component");
|
|
420
|
+
var ConditionalGroupPropsSchema = import_zod2.z.object({
|
|
421
|
+
component: import_zod2.z.literal("ConditionalGroup"),
|
|
422
|
+
condition: import_zod2.z.string().describe("Condition expression to evaluate"),
|
|
423
|
+
children: ExtensionComponentChildrenSchema.describe("Children to render when condition is true"),
|
|
424
|
+
style: ExtensionComponentStyleSchema.optional()
|
|
425
|
+
}).passthrough().describe("ConditionalGroup component");
|
|
426
|
+
|
|
427
|
+
// src/schemas/contributions.schema.ts
|
|
428
|
+
var LocalizedStringSchema = import_zod3.z.union([import_zod3.z.string(), import_zod3.z.record(import_zod3.z.string())]).describe("String or localized string map");
|
|
429
|
+
var SettingOptionsMappingSchema = import_zod3.z.object({
|
|
430
|
+
itemsKey: import_zod3.z.string().describe("Key for items array in tool result data"),
|
|
431
|
+
valueKey: import_zod3.z.string().describe("Key for option value"),
|
|
432
|
+
labelKey: import_zod3.z.string().describe("Key for option label"),
|
|
433
|
+
descriptionKey: import_zod3.z.string().optional().describe("Optional key for description")
|
|
434
|
+
}).describe("Mapping for select field options");
|
|
435
|
+
var SettingCreateMappingSchema = import_zod3.z.object({
|
|
436
|
+
resultKey: import_zod3.z.string().optional().describe("Key for result data object"),
|
|
437
|
+
valueKey: import_zod3.z.string().describe('Key for option value (defaults to "id")')
|
|
438
|
+
}).describe("Mapping for create tool response");
|
|
439
|
+
var SettingValidationSchema = import_zod3.z.object({
|
|
440
|
+
required: import_zod3.z.boolean().optional().describe("Whether the field is required"),
|
|
441
|
+
min: import_zod3.z.number().optional().describe("Minimum value (number) or length (string)"),
|
|
442
|
+
max: import_zod3.z.number().optional().describe("Maximum value (number) or length (string)"),
|
|
443
|
+
pattern: import_zod3.z.string().optional().describe("Regex pattern for validation")
|
|
444
|
+
}).describe("Validation rules");
|
|
445
|
+
var SettingDefinitionSchema = import_zod3.z.lazy(
|
|
446
|
+
() => import_zod3.z.object({
|
|
447
|
+
id: import_zod3.z.string().describe("Setting ID (namespaced automatically)"),
|
|
448
|
+
title: import_zod3.z.string().describe("Display title"),
|
|
449
|
+
description: import_zod3.z.string().optional().describe("Help text"),
|
|
450
|
+
type: import_zod3.z.enum(["string", "number", "boolean", "select"]).describe("Setting type"),
|
|
451
|
+
default: import_zod3.z.unknown().optional().describe("Default value"),
|
|
452
|
+
options: import_zod3.z.array(import_zod3.z.object({ value: import_zod3.z.string(), label: import_zod3.z.string() })).optional().describe("For select type: available options"),
|
|
453
|
+
optionsToolId: import_zod3.z.string().optional().describe("For select type: load options from tool"),
|
|
454
|
+
optionsParams: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Params for options tool"),
|
|
455
|
+
optionsMapping: SettingOptionsMappingSchema.optional().describe("Mapping for options tool response"),
|
|
456
|
+
createToolId: import_zod3.z.string().optional().describe("Tool ID for creating a new option"),
|
|
457
|
+
createLabel: import_zod3.z.string().optional().describe("Label for create action"),
|
|
458
|
+
createFields: import_zod3.z.array(SettingDefinitionSchema).optional().describe("Fields for create form"),
|
|
459
|
+
createParams: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Static params for create tool"),
|
|
460
|
+
createMapping: SettingCreateMappingSchema.optional().describe("Mapping for create tool response"),
|
|
461
|
+
validation: SettingValidationSchema.optional().describe("Validation rules")
|
|
462
|
+
}).superRefine((data, ctx) => {
|
|
463
|
+
const hasCreateFields = data.createToolId !== void 0 || data.createLabel !== void 0 || data.createFields !== void 0 || data.createParams !== void 0 || data.createMapping !== void 0;
|
|
464
|
+
if (hasCreateFields && data.type !== "select") {
|
|
465
|
+
ctx.addIssue({
|
|
466
|
+
code: import_zod3.z.ZodIssueCode.custom,
|
|
467
|
+
message: 'create* fields (createToolId, createLabel, createFields, createParams, createMapping) are only valid for type "select"',
|
|
468
|
+
path: ["type"]
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
if (data.type === "select") {
|
|
472
|
+
const hasOptions = data.options && data.options.length > 0;
|
|
473
|
+
const hasOptionsToolId = data.optionsToolId !== void 0;
|
|
474
|
+
if (!hasOptions && !hasOptionsToolId) {
|
|
475
|
+
ctx.addIssue({
|
|
476
|
+
code: import_zod3.z.ZodIssueCode.custom,
|
|
477
|
+
message: 'Setting of type "select" must have "options" or "optionsToolId"',
|
|
478
|
+
path: ["type"]
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}).describe("Setting definition")
|
|
483
|
+
);
|
|
484
|
+
var ToolSettingsListMappingSchema = import_zod3.z.object({
|
|
485
|
+
itemsKey: import_zod3.z.string().describe("Key for items array in tool result data"),
|
|
486
|
+
countKey: import_zod3.z.string().optional().describe("Key for total count"),
|
|
487
|
+
idKey: import_zod3.z.string().describe("Key for item ID"),
|
|
488
|
+
labelKey: import_zod3.z.string().describe("Key for item label"),
|
|
489
|
+
descriptionKey: import_zod3.z.string().optional().describe("Key for item description"),
|
|
490
|
+
secondaryKey: import_zod3.z.string().optional().describe("Key for secondary label")
|
|
491
|
+
}).describe("Mapping from tool list data to UI fields");
|
|
492
|
+
var ToolSettingsActionDataSourceSchema = import_zod3.z.object({
|
|
493
|
+
action: import_zod3.z.string().describe("Action ID to call for fetching data"),
|
|
494
|
+
params: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Parameters to pass to the action"),
|
|
495
|
+
refreshOn: import_zod3.z.array(import_zod3.z.string()).optional().describe("Event names that trigger refresh")
|
|
496
|
+
}).describe("Action-based data source");
|
|
497
|
+
var ToolSettingsListViewSchema = import_zod3.z.object({
|
|
498
|
+
kind: import_zod3.z.literal("list").describe("View kind"),
|
|
499
|
+
listToolId: import_zod3.z.string().describe("Tool ID for listing items"),
|
|
500
|
+
getToolId: import_zod3.z.string().optional().describe("Tool ID for fetching details"),
|
|
501
|
+
upsertToolId: import_zod3.z.string().optional().describe("Tool ID for creating/updating items"),
|
|
502
|
+
deleteToolId: import_zod3.z.string().optional().describe("Tool ID for deleting items"),
|
|
503
|
+
mapping: ToolSettingsListMappingSchema.describe("Mapping from tool data to UI"),
|
|
504
|
+
searchParam: import_zod3.z.string().optional().describe("Param name for search query"),
|
|
505
|
+
limitParam: import_zod3.z.string().optional().describe("Param name for limit"),
|
|
506
|
+
idParam: import_zod3.z.string().optional().describe("Param name for get/delete ID"),
|
|
507
|
+
listParams: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Static params for list tool")
|
|
508
|
+
}).describe("List view backed by tools");
|
|
509
|
+
var ToolSettingsComponentViewSchema = import_zod3.z.object({
|
|
510
|
+
kind: import_zod3.z.literal("component").describe("View kind"),
|
|
511
|
+
data: import_zod3.z.record(ToolSettingsActionDataSourceSchema).optional().describe("Data sources"),
|
|
512
|
+
content: ExtensionComponentDataSchema.describe("Root component to render")
|
|
513
|
+
}).describe("Component-based tool settings view");
|
|
514
|
+
var ToolSettingsViewSchema = import_zod3.z.union([ToolSettingsListViewSchema, ToolSettingsComponentViewSchema]).describe("Tool settings view");
|
|
515
|
+
var ToolSettingsViewDefinitionSchema = import_zod3.z.object({
|
|
516
|
+
id: import_zod3.z.string().describe("Unique view ID within the extension"),
|
|
517
|
+
title: import_zod3.z.string().describe("Display title"),
|
|
518
|
+
description: import_zod3.z.string().optional().describe("Help text"),
|
|
519
|
+
view: ToolSettingsViewSchema.describe("View configuration"),
|
|
520
|
+
fields: import_zod3.z.array(SettingDefinitionSchema).optional().describe("Fields for create/edit forms")
|
|
521
|
+
}).describe("Tool settings view definition");
|
|
522
|
+
var PanelActionDataSourceSchema = import_zod3.z.object({
|
|
523
|
+
action: import_zod3.z.string().describe("Action ID to call for fetching data"),
|
|
524
|
+
params: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Parameters to pass to the action"),
|
|
525
|
+
refreshOn: import_zod3.z.array(import_zod3.z.string()).optional().describe("Event names that trigger refresh")
|
|
526
|
+
}).describe("Panel data source");
|
|
527
|
+
var PanelComponentViewSchema = import_zod3.z.object({
|
|
528
|
+
kind: import_zod3.z.literal("component").describe("View kind"),
|
|
529
|
+
data: import_zod3.z.record(PanelActionDataSourceSchema).optional().describe("Data sources"),
|
|
530
|
+
content: ExtensionComponentDataSchema.describe("Root component to render")
|
|
531
|
+
}).describe("Component-based panel view");
|
|
532
|
+
var PanelUnknownViewSchema = import_zod3.z.object({
|
|
533
|
+
kind: import_zod3.z.string().describe("View kind")
|
|
534
|
+
}).passthrough().describe("Unknown panel view");
|
|
535
|
+
var PanelViewSchema = import_zod3.z.union([PanelComponentViewSchema, PanelUnknownViewSchema]).describe("Panel view");
|
|
536
|
+
var PanelDefinitionSchema = import_zod3.z.object({
|
|
537
|
+
id: import_zod3.z.string().describe("Unique panel ID within the extension"),
|
|
538
|
+
title: import_zod3.z.string().describe("Display title"),
|
|
539
|
+
icon: import_zod3.z.string().optional().describe("Icon name (from huge-icons)"),
|
|
540
|
+
view: PanelViewSchema.describe("Panel view schema")
|
|
541
|
+
}).describe("Panel definition");
|
|
542
|
+
var ProviderConfigPropertyTypeSchema = import_zod3.z.enum(["string", "number", "boolean", "select", "password", "url"]).describe("Property type");
|
|
543
|
+
var ProviderConfigSelectOptionSchema = import_zod3.z.object({
|
|
544
|
+
value: import_zod3.z.string().describe("Value stored in settings"),
|
|
545
|
+
label: import_zod3.z.string().describe("Display label")
|
|
546
|
+
}).describe("Select option");
|
|
547
|
+
var ProviderConfigValidationSchema = import_zod3.z.object({
|
|
548
|
+
pattern: import_zod3.z.string().optional().describe("Regex pattern the value must match"),
|
|
549
|
+
minLength: import_zod3.z.number().optional().describe("Minimum string length"),
|
|
550
|
+
maxLength: import_zod3.z.number().optional().describe("Maximum string length"),
|
|
551
|
+
min: import_zod3.z.number().optional().describe("Minimum number value"),
|
|
552
|
+
max: import_zod3.z.number().optional().describe("Maximum number value")
|
|
553
|
+
}).describe("Validation rules");
|
|
554
|
+
var ProviderConfigPropertySchema = import_zod3.z.object({
|
|
555
|
+
type: ProviderConfigPropertyTypeSchema.describe("Property type"),
|
|
556
|
+
title: import_zod3.z.string().describe("Display label"),
|
|
557
|
+
description: import_zod3.z.string().optional().describe("Help text"),
|
|
558
|
+
default: import_zod3.z.unknown().optional().describe("Default value"),
|
|
559
|
+
required: import_zod3.z.boolean().optional().describe("Whether the field is required"),
|
|
560
|
+
placeholder: import_zod3.z.string().optional().describe("Placeholder text"),
|
|
561
|
+
options: import_zod3.z.array(ProviderConfigSelectOptionSchema).optional().describe("For select type"),
|
|
562
|
+
validation: ProviderConfigValidationSchema.optional().describe("Validation rules")
|
|
563
|
+
}).describe("Provider config property");
|
|
564
|
+
var ProviderConfigSchemaSchema = import_zod3.z.object({
|
|
565
|
+
properties: import_zod3.z.record(ProviderConfigPropertySchema).describe("Property definitions"),
|
|
566
|
+
order: import_zod3.z.array(import_zod3.z.string()).optional().describe("Display order of properties")
|
|
567
|
+
}).describe("Provider configuration schema");
|
|
568
|
+
var ProviderDefinitionSchema = import_zod3.z.object({
|
|
569
|
+
id: import_zod3.z.string().describe("Provider ID"),
|
|
570
|
+
name: import_zod3.z.string().describe("Display name"),
|
|
571
|
+
description: import_zod3.z.string().optional().describe("Description"),
|
|
572
|
+
suggestedDefaultModel: import_zod3.z.string().optional().describe("Suggested default model"),
|
|
573
|
+
defaultSettings: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Default settings"),
|
|
574
|
+
configSchema: ProviderConfigSchemaSchema.optional().describe("Configuration UI schema")
|
|
575
|
+
}).describe("Provider definition");
|
|
576
|
+
var ToolDefinitionSchema = import_zod3.z.object({
|
|
577
|
+
id: import_zod3.z.string().describe("Tool ID"),
|
|
578
|
+
name: LocalizedStringSchema.describe("Display name"),
|
|
579
|
+
description: LocalizedStringSchema.describe("Description for Stina"),
|
|
580
|
+
parameters: import_zod3.z.record(import_zod3.z.unknown()).optional().describe("Parameter schema (JSON Schema)")
|
|
581
|
+
}).describe("Tool definition");
|
|
582
|
+
var CommandDefinitionSchema = import_zod3.z.object({
|
|
583
|
+
id: import_zod3.z.string().describe('Command ID (e.g., "weather" for /weather)'),
|
|
584
|
+
name: import_zod3.z.string().describe("Display name"),
|
|
585
|
+
description: import_zod3.z.string().describe("Description")
|
|
586
|
+
}).describe("Command definition");
|
|
587
|
+
var PromptSectionSchema = import_zod3.z.enum(["system", "behavior", "tools"]).describe("Prompt section placement");
|
|
588
|
+
var PromptContributionSchema = import_zod3.z.object({
|
|
589
|
+
id: import_zod3.z.string().describe("Unique ID within the extension"),
|
|
590
|
+
title: import_zod3.z.string().optional().describe("Optional title for the prompt chunk"),
|
|
591
|
+
section: PromptSectionSchema.optional().describe("Prompt section placement"),
|
|
592
|
+
text: import_zod3.z.string().optional().describe("Plain text prompt content"),
|
|
593
|
+
i18n: import_zod3.z.record(import_zod3.z.string()).optional().describe("Localized prompt content"),
|
|
594
|
+
order: import_zod3.z.number().optional().describe("Ordering hint (lower comes first)")
|
|
595
|
+
}).describe("Prompt contribution");
|
|
596
|
+
var StorageCollectionConfigSchema = import_zod3.z.object({
|
|
597
|
+
indexes: import_zod3.z.array(import_zod3.z.string()).optional().describe("Fields to index for fast queries")
|
|
598
|
+
}).describe("Collection configuration");
|
|
599
|
+
var StorageContributionsSchema = import_zod3.z.object({
|
|
600
|
+
collections: import_zod3.z.record(StorageCollectionConfigSchema).describe("Collection definitions")
|
|
601
|
+
}).describe("Storage contributions");
|
|
602
|
+
var ExtensionContributionsSchema = import_zod3.z.object({
|
|
603
|
+
settings: import_zod3.z.array(SettingDefinitionSchema).optional().describe("User-configurable settings"),
|
|
604
|
+
toolSettings: import_zod3.z.array(ToolSettingsViewDefinitionSchema).optional().describe("Tool settings views"),
|
|
605
|
+
panels: import_zod3.z.array(PanelDefinitionSchema).optional().describe("Right panel contributions"),
|
|
606
|
+
providers: import_zod3.z.array(ProviderDefinitionSchema).optional().describe("AI providers"),
|
|
607
|
+
tools: import_zod3.z.array(ToolDefinitionSchema).optional().describe("Tools for Stina to use"),
|
|
608
|
+
commands: import_zod3.z.array(CommandDefinitionSchema).optional().describe("Slash commands"),
|
|
609
|
+
prompts: import_zod3.z.array(PromptContributionSchema).optional().describe("Prompt contributions"),
|
|
610
|
+
storage: StorageContributionsSchema.optional().describe("Storage collection declarations")
|
|
611
|
+
}).describe("What an extension can contribute to Stina");
|
|
612
|
+
|
|
613
|
+
// src/schemas/manifest.schema.ts
|
|
614
|
+
var PlatformSchema = import_zod4.z.enum(["web", "electron", "tui"]).describe("Supported platform");
|
|
615
|
+
var AuthorSchema = import_zod4.z.object({
|
|
616
|
+
name: import_zod4.z.string().min(1).describe("Author name"),
|
|
617
|
+
url: import_zod4.z.string().url().optional().describe("Author URL")
|
|
618
|
+
}).describe("Author information");
|
|
619
|
+
var EnginesSchema = import_zod4.z.object({
|
|
620
|
+
stina: import_zod4.z.string().describe("Minimum Stina version required")
|
|
621
|
+
}).describe("Engine requirements");
|
|
622
|
+
var ExtensionManifestSchema = import_zod4.z.object({
|
|
623
|
+
id: import_zod4.z.string().regex(/^[a-z0-9-]+$/, "ID must be lowercase alphanumeric with hyphens").describe('Unique identifier (e.g., "ollama-provider")'),
|
|
624
|
+
name: import_zod4.z.string().min(1).describe("Human-readable name"),
|
|
625
|
+
version: import_zod4.z.string().regex(/^\d+\.\d+\.\d+/, 'Must be semver format (e.g., "1.0.0")').describe("Version string (semver)"),
|
|
626
|
+
description: import_zod4.z.string().min(1).describe("Short description"),
|
|
627
|
+
author: AuthorSchema.describe("Author information"),
|
|
628
|
+
repository: import_zod4.z.string().url().optional().describe("Repository URL"),
|
|
629
|
+
license: import_zod4.z.string().optional().describe("License identifier"),
|
|
630
|
+
engines: EnginesSchema.optional().describe("Minimum Stina version required"),
|
|
631
|
+
platforms: import_zod4.z.array(PlatformSchema).optional().describe("Supported platforms"),
|
|
632
|
+
main: import_zod4.z.string().describe("Entry point file (relative to extension root)"),
|
|
633
|
+
permissions: import_zod4.z.array(PermissionSchema).describe("Required permissions"),
|
|
634
|
+
contributes: ExtensionContributionsSchema.optional().describe("What the extension contributes")
|
|
635
|
+
}).describe("Extension manifest format");
|
|
636
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
637
|
+
0 && (module.exports = {
|
|
638
|
+
AllowedCSSPropertySchema,
|
|
639
|
+
AuthorSchema,
|
|
640
|
+
ButtonPropsSchema,
|
|
641
|
+
CapabilityPermissionSchema,
|
|
642
|
+
CheckboxPropsSchema,
|
|
643
|
+
CollapsiblePropsSchema,
|
|
644
|
+
CommandDefinitionSchema,
|
|
645
|
+
ConditionalGroupPropsSchema,
|
|
646
|
+
DateTimeInputPropsSchema,
|
|
647
|
+
DividerPropsSchema,
|
|
648
|
+
EnginesSchema,
|
|
649
|
+
ExtensionActionCallSchema,
|
|
650
|
+
ExtensionActionRefSchema,
|
|
651
|
+
ExtensionComponentChildrenSchema,
|
|
652
|
+
ExtensionComponentDataSchema,
|
|
653
|
+
ExtensionComponentIteratorSchema,
|
|
654
|
+
ExtensionComponentStyleSchema,
|
|
655
|
+
ExtensionContributionsSchema,
|
|
656
|
+
ExtensionDataSourceSchema,
|
|
657
|
+
ExtensionManifestSchema,
|
|
658
|
+
GridPropsSchema,
|
|
659
|
+
HeaderPropsSchema,
|
|
660
|
+
HorizontalStackPropsSchema,
|
|
661
|
+
IconButtonPropsSchema,
|
|
662
|
+
IconButtonTypeSchema,
|
|
663
|
+
IconPropsSchema,
|
|
664
|
+
LabelPropsSchema,
|
|
665
|
+
LocalizedStringSchema,
|
|
666
|
+
MarkdownPropsSchema,
|
|
667
|
+
ModalPropsSchema,
|
|
668
|
+
NetworkPermissionSchema,
|
|
669
|
+
PERMISSION_PATTERNS,
|
|
670
|
+
PanelActionDataSourceSchema,
|
|
671
|
+
PanelActionSchema,
|
|
672
|
+
PanelComponentViewSchema,
|
|
673
|
+
PanelDefinitionSchema,
|
|
674
|
+
PanelPropsSchema,
|
|
675
|
+
PanelUnknownViewSchema,
|
|
676
|
+
PanelViewSchema,
|
|
677
|
+
ParagraphPropsSchema,
|
|
678
|
+
PermissionSchema,
|
|
679
|
+
PillPropsSchema,
|
|
680
|
+
PillVariantSchema,
|
|
681
|
+
PlatformSchema,
|
|
682
|
+
PromptContributionSchema,
|
|
683
|
+
PromptSectionSchema,
|
|
684
|
+
ProviderConfigPropertySchema,
|
|
685
|
+
ProviderConfigPropertyTypeSchema,
|
|
686
|
+
ProviderConfigSchemaSchema,
|
|
687
|
+
ProviderConfigSelectOptionSchema,
|
|
688
|
+
ProviderConfigValidationSchema,
|
|
689
|
+
ProviderDefinitionSchema,
|
|
690
|
+
SelectPropsSchema,
|
|
691
|
+
SettingCreateMappingSchema,
|
|
692
|
+
SettingDefinitionSchema,
|
|
693
|
+
SettingOptionsMappingSchema,
|
|
694
|
+
SettingValidationSchema,
|
|
695
|
+
StoragePermissionSchema,
|
|
696
|
+
SystemPermissionSchema,
|
|
697
|
+
TextInputPropsSchema,
|
|
698
|
+
TogglePropsSchema,
|
|
699
|
+
ToolDefinitionSchema,
|
|
700
|
+
ToolSettingsActionDataSourceSchema,
|
|
701
|
+
ToolSettingsComponentViewSchema,
|
|
702
|
+
ToolSettingsListMappingSchema,
|
|
703
|
+
ToolSettingsListViewSchema,
|
|
704
|
+
ToolSettingsViewDefinitionSchema,
|
|
705
|
+
ToolSettingsViewSchema,
|
|
706
|
+
UserDataPermissionSchema,
|
|
707
|
+
VALID_PERMISSIONS,
|
|
708
|
+
VerticalStackPropsSchema,
|
|
709
|
+
isValidPermission
|
|
710
|
+
});
|
|
711
|
+
//# sourceMappingURL=index.cjs.map
|