@stina/extension-api 0.22.0 → 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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/manifest.schema.ts","../../src/schemas/permissions.schema.ts","../../src/schemas/contributions.schema.ts","../../src/schemas/components.schema.ts"],"sourcesContent":["/**\n * Manifest Schema\n *\n * Zod schema for extension manifest files (manifest.json).\n * This is the main schema that combines all sub-schemas.\n */\n\nimport { z } from 'zod'\nimport { PermissionSchema } from './permissions.schema.js'\nimport { ExtensionContributionsSchema } from './contributions.schema.js'\n\n/**\n * Platform schema\n */\nexport const PlatformSchema = z\n .enum(['web', 'electron', 'tui'])\n .describe('Supported platform')\n\n/**\n * Author schema\n */\nexport const AuthorSchema = z\n .object({\n name: z.string().min(1).describe('Author name'),\n url: z.string().url().optional().describe('Author URL'),\n })\n .describe('Author information')\n\n/**\n * Engines schema\n */\nexport const EnginesSchema = z\n .object({\n stina: z.string().describe('Minimum Stina version required'),\n })\n .describe('Engine requirements')\n\n/**\n * Extension manifest schema\n */\nexport const ExtensionManifestSchema = z\n .object({\n id: z\n .string()\n .regex(/^[a-z0-9-]+$/, 'ID must be lowercase alphanumeric with hyphens')\n .describe('Unique identifier (e.g., \"ollama-provider\")'),\n name: z.string().min(1).describe('Human-readable name'),\n version: z\n .string()\n .regex(/^\\d+\\.\\d+\\.\\d+/, 'Must be semver format (e.g., \"1.0.0\")')\n .describe('Version string (semver)'),\n description: z.string().min(1).describe('Short description'),\n author: AuthorSchema.describe('Author information'),\n repository: z.string().url().optional().describe('Repository URL'),\n license: z.string().optional().describe('License identifier'),\n engines: EnginesSchema.optional().describe('Minimum Stina version required'),\n platforms: z.array(PlatformSchema).optional().describe('Supported platforms'),\n main: z.string().describe('Entry point file (relative to extension root)'),\n permissions: z.array(PermissionSchema).describe('Required permissions'),\n contributes: ExtensionContributionsSchema.optional().describe('What the extension contributes'),\n })\n .describe('Extension manifest format')\n\n// =============================================================================\n// Type Exports\n// =============================================================================\n\nexport type Platform = z.infer<typeof PlatformSchema>\nexport type Author = z.infer<typeof AuthorSchema>\nexport type Engines = z.infer<typeof EnginesSchema>\nexport type ExtensionManifest = z.infer<typeof ExtensionManifestSchema>\n","/**\n * Permission Schema\n *\n * Zod schema for extension permission strings.\n * Generates both TypeScript types and JSON Schema.\n */\n\nimport { z } from 'zod'\n\n/**\n * Valid exact permission values\n */\nexport const VALID_PERMISSIONS = [\n 'network:*',\n 'network:localhost',\n 'storage.collections',\n 'secrets.manage',\n 'user.profile.read',\n 'user.location.read',\n 'chat.history.read',\n 'chat.current.read',\n 'chat.message.write',\n 'provider.register',\n 'tools.register',\n 'actions.register',\n 'settings.register',\n 'commands.register',\n 'panels.register',\n 'events.emit',\n 'scheduler.register',\n 'background.workers',\n 'files.read',\n 'files.write',\n 'clipboard.read',\n 'clipboard.write',\n] as const\n\n/**\n * Permission patterns for dynamic permissions (network with host/port)\n */\nexport const PERMISSION_PATTERNS = [\n /^network:localhost:\\d+$/, // network:localhost:11434\n /^network:[a-zA-Z0-9.-]+$/, // network:api.example.com\n /^network:[a-zA-Z0-9.-]+:\\d+$/, // network:api.example.com:8080\n]\n\n/**\n * Network permission schema - matches exact values and patterns\n */\nconst NetworkPermissionSchema = z\n .string()\n .refine(\n (val) => {\n // Check exact matches first\n if (val === 'network:*' || val === 'network:localhost') {\n return true\n }\n // Check dynamic patterns\n return PERMISSION_PATTERNS.some((pattern) => pattern.test(val))\n },\n { message: 'Invalid network permission format' }\n )\n .describe('Network access permission (e.g., \"network:*\", \"network:localhost:11434\")')\n\n/**\n * Storage permission schema\n */\nconst StoragePermissionSchema = z.enum(['storage.collections', 'secrets.manage']).describe('Storage permission')\n\n/**\n * User data permission schema\n */\nconst UserDataPermissionSchema = z\n .enum(['user.profile.read', 'user.location.read', 'chat.history.read', 'chat.current.read'])\n .describe('User data access permission')\n\n/**\n * Capability permission schema\n */\nconst CapabilityPermissionSchema = z\n .enum([\n 'provider.register',\n 'tools.register',\n 'actions.register',\n 'settings.register',\n 'commands.register',\n 'panels.register',\n 'events.emit',\n 'scheduler.register',\n 'chat.message.write',\n 'background.workers',\n ])\n .describe('Capability permission')\n\n/**\n * System permission schema\n */\nconst SystemPermissionSchema = z\n .enum(['files.read', 'files.write', 'clipboard.read', 'clipboard.write'])\n .describe('System permission')\n\n/**\n * Regex pattern for dynamic network permissions (host with optional port)\n * Matches: network:api.example.com, network:localhost:11434, network:api.example.com:8080\n */\nconst NETWORK_PERMISSION_REGEX = /^network:[a-zA-Z0-9.-]+(:\\d+)?$/\n\n/**\n * Combined permission schema - validates against all permission types\n * Uses z.union with z.enum and z.string().regex() for better JSON Schema generation\n */\nexport const PermissionSchema = z\n .union([\n z.enum(VALID_PERMISSIONS),\n z.string().regex(NETWORK_PERMISSION_REGEX, 'Invalid network permission format'),\n ])\n .describe('Extension permission')\n\n/**\n * Check if a permission string is valid\n */\nexport function isValidPermission(permission: string): boolean {\n return PermissionSchema.safeParse(permission).success\n}\n\n// Re-export individual schemas for more specific validation if needed\nexport {\n NetworkPermissionSchema,\n StoragePermissionSchema,\n UserDataPermissionSchema,\n CapabilityPermissionSchema,\n SystemPermissionSchema,\n}\n\n// Type exports\nexport type Permission = z.infer<typeof PermissionSchema>\nexport type NetworkPermission = 'network:*' | `network:localhost` | `network:localhost:${number}` | `network:${string}`\nexport type StoragePermission = z.infer<typeof StoragePermissionSchema>\nexport type UserDataPermission = z.infer<typeof UserDataPermissionSchema>\nexport type CapabilityPermission = z.infer<typeof CapabilityPermissionSchema>\nexport type SystemPermission = z.infer<typeof SystemPermissionSchema>\n","/**\n * Contributions Schema\n *\n * Zod schemas for extension contributions: settings, panels, providers, tools, commands, prompts.\n */\n\nimport { z } from 'zod'\nimport { ExtensionComponentDataSchema } from './components.schema.js'\n\n// =============================================================================\n// Localization\n// =============================================================================\n\n/**\n * Localized string - either a simple string or a map of language codes to strings\n */\nexport const LocalizedStringSchema = z\n .union([z.string(), z.record(z.string())])\n .describe('String or localized string map')\n\n// =============================================================================\n// Settings\n// =============================================================================\n\n/**\n * Options mapping for select field options from tool response\n */\nexport const SettingOptionsMappingSchema = z\n .object({\n itemsKey: z.string().describe('Key for items array in tool result data'),\n valueKey: z.string().describe('Key for option value'),\n labelKey: z.string().describe('Key for option label'),\n descriptionKey: z.string().optional().describe('Optional key for description'),\n })\n .describe('Mapping for select field options')\n\n/**\n * Create mapping for create tool response\n */\nexport const SettingCreateMappingSchema = z\n .object({\n resultKey: z.string().optional().describe('Key for result data object'),\n valueKey: z.string().describe('Key for option value (defaults to \"id\")'),\n })\n .describe('Mapping for create tool response')\n\n/**\n * Validation rules for settings\n */\nexport const SettingValidationSchema = z\n .object({\n required: z.boolean().optional().describe('Whether the field is required'),\n min: z.number().optional().describe('Minimum value (number) or length (string)'),\n max: z.number().optional().describe('Maximum value (number) or length (string)'),\n pattern: z.string().optional().describe('Regex pattern for validation'),\n })\n .describe('Validation rules')\n\n/**\n * Setting definition type interface for recursive typing\n */\nexport interface SettingDefinitionType {\n id: string\n title: string\n description?: string\n type: 'string' | 'number' | 'boolean' | 'select'\n default?: unknown\n options?: { value: string; label: string }[]\n optionsToolId?: string\n optionsParams?: Record<string, unknown>\n optionsMapping?: z.infer<typeof SettingOptionsMappingSchema>\n createToolId?: string\n createLabel?: string\n createFields?: SettingDefinitionType[]\n createParams?: Record<string, unknown>\n createMapping?: z.infer<typeof SettingCreateMappingSchema>\n validation?: z.infer<typeof SettingValidationSchema>\n}\n\nexport const SettingDefinitionSchema: z.ZodType<SettingDefinitionType> = z.lazy(() =>\n z\n .object({\n id: z.string().describe('Setting ID (namespaced automatically)'),\n title: z.string().describe('Display title'),\n description: z.string().optional().describe('Help text'),\n type: z.enum(['string', 'number', 'boolean', 'select']).describe('Setting type'),\n default: z.unknown().optional().describe('Default value'),\n options: z\n .array(z.object({ value: z.string(), label: z.string() }))\n .optional()\n .describe('For select type: available options'),\n optionsToolId: z.string().optional().describe('For select type: load options from tool'),\n optionsParams: z.record(z.unknown()).optional().describe('Params for options tool'),\n optionsMapping: SettingOptionsMappingSchema.optional().describe('Mapping for options tool response'),\n createToolId: z.string().optional().describe('Tool ID for creating a new option'),\n createLabel: z.string().optional().describe('Label for create action'),\n createFields: z.array(SettingDefinitionSchema).optional().describe('Fields for create form'),\n createParams: z.record(z.unknown()).optional().describe('Static params for create tool'),\n createMapping: SettingCreateMappingSchema.optional().describe('Mapping for create tool response'),\n validation: SettingValidationSchema.optional().describe('Validation rules'),\n })\n .superRefine((data, ctx) => {\n // Validate that create* fields are only used with type: 'select'\n const hasCreateFields =\n data.createToolId !== undefined ||\n data.createLabel !== undefined ||\n data.createFields !== undefined ||\n data.createParams !== undefined ||\n data.createMapping !== undefined\n\n if (hasCreateFields && data.type !== 'select') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'create* fields (createToolId, createLabel, createFields, createParams, createMapping) are only valid for type \"select\"',\n path: ['type'],\n })\n }\n\n // Validate that select type has options or optionsToolId\n if (data.type === 'select') {\n const hasOptions = data.options && data.options.length > 0\n const hasOptionsToolId = data.optionsToolId !== undefined\n\n if (!hasOptions && !hasOptionsToolId) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Setting of type \"select\" must have \"options\" or \"optionsToolId\"',\n path: ['type'],\n })\n }\n }\n })\n .describe('Setting definition')\n)\n\n// =============================================================================\n// Tool Settings Views\n// =============================================================================\n\n/**\n * Tool settings list mapping\n */\nexport const ToolSettingsListMappingSchema = z\n .object({\n itemsKey: z.string().describe('Key for items array in tool result data'),\n countKey: z.string().optional().describe('Key for total count'),\n idKey: z.string().describe('Key for item ID'),\n labelKey: z.string().describe('Key for item label'),\n descriptionKey: z.string().optional().describe('Key for item description'),\n secondaryKey: z.string().optional().describe('Key for secondary label'),\n })\n .describe('Mapping from tool list data to UI fields')\n\n/**\n * Action-based data source for tool settings\n */\nexport const ToolSettingsActionDataSourceSchema = z\n .object({\n action: z.string().describe('Action ID to call for fetching data'),\n params: z.record(z.unknown()).optional().describe('Parameters to pass to the action'),\n refreshOn: z.array(z.string()).optional().describe('Event names that trigger refresh'),\n })\n .describe('Action-based data source')\n\n/**\n * List view backed by tools\n */\nexport const ToolSettingsListViewSchema = z\n .object({\n kind: z.literal('list').describe('View kind'),\n listToolId: z.string().describe('Tool ID for listing items'),\n getToolId: z.string().optional().describe('Tool ID for fetching details'),\n upsertToolId: z.string().optional().describe('Tool ID for creating/updating items'),\n deleteToolId: z.string().optional().describe('Tool ID for deleting items'),\n mapping: ToolSettingsListMappingSchema.describe('Mapping from tool data to UI'),\n searchParam: z.string().optional().describe('Param name for search query'),\n limitParam: z.string().optional().describe('Param name for limit'),\n idParam: z.string().optional().describe('Param name for get/delete ID'),\n listParams: z.record(z.unknown()).optional().describe('Static params for list tool'),\n })\n .describe('List view backed by tools')\n\n/**\n * Component-based tool settings view\n */\nexport const ToolSettingsComponentViewSchema = z\n .object({\n kind: z.literal('component').describe('View kind'),\n data: z.record(ToolSettingsActionDataSourceSchema).optional().describe('Data sources'),\n content: ExtensionComponentDataSchema.describe('Root component to render'),\n })\n .describe('Component-based tool settings view')\n\n/**\n * Tool settings view types\n */\nexport const ToolSettingsViewSchema = z\n .union([ToolSettingsListViewSchema, ToolSettingsComponentViewSchema])\n .describe('Tool settings view')\n\n/**\n * Tool settings view definition\n */\nexport const ToolSettingsViewDefinitionSchema = z\n .object({\n id: z.string().describe('Unique view ID within the extension'),\n title: z.string().describe('Display title'),\n description: z.string().optional().describe('Help text'),\n view: ToolSettingsViewSchema.describe('View configuration'),\n fields: z.array(SettingDefinitionSchema).optional().describe('Fields for create/edit forms'),\n })\n .describe('Tool settings view definition')\n\n// =============================================================================\n// Panels\n// =============================================================================\n\n/**\n * Action-based data source for panels\n */\nexport const PanelActionDataSourceSchema = z\n .object({\n action: z.string().describe('Action ID to call for fetching data'),\n params: z.record(z.unknown()).optional().describe('Parameters to pass to the action'),\n refreshOn: z.array(z.string()).optional().describe('Event names that trigger refresh'),\n })\n .describe('Panel data source')\n\n/**\n * Component-based panel view\n */\nexport const PanelComponentViewSchema = z\n .object({\n kind: z.literal('component').describe('View kind'),\n data: z.record(PanelActionDataSourceSchema).optional().describe('Data sources'),\n content: ExtensionComponentDataSchema.describe('Root component to render'),\n })\n .describe('Component-based panel view')\n\n/**\n * Unknown panel view (for extensibility)\n */\nexport const PanelUnknownViewSchema = z\n .object({\n kind: z.string().describe('View kind'),\n })\n .passthrough()\n .describe('Unknown panel view')\n\n/**\n * Panel view schema\n */\nexport const PanelViewSchema = z\n .union([PanelComponentViewSchema, PanelUnknownViewSchema])\n .describe('Panel view')\n\n/**\n * Panel definition\n */\nexport const PanelDefinitionSchema = z\n .object({\n id: z.string().describe('Unique panel ID within the extension'),\n title: z.string().describe('Display title'),\n icon: z.string().optional().describe('Icon name (from huge-icons)'),\n view: PanelViewSchema.describe('Panel view schema'),\n })\n .describe('Panel definition')\n\n// =============================================================================\n// Providers\n// =============================================================================\n\n/**\n * Provider config property type\n */\nexport const ProviderConfigPropertyTypeSchema = z\n .enum(['string', 'number', 'boolean', 'select', 'password', 'url'])\n .describe('Property type')\n\n/**\n * Provider config select option\n */\nexport const ProviderConfigSelectOptionSchema = z\n .object({\n value: z.string().describe('Value stored in settings'),\n label: z.string().describe('Display label'),\n })\n .describe('Select option')\n\n/**\n * Provider config validation\n */\nexport const ProviderConfigValidationSchema = z\n .object({\n pattern: z.string().optional().describe('Regex pattern the value must match'),\n minLength: z.number().optional().describe('Minimum string length'),\n maxLength: z.number().optional().describe('Maximum string length'),\n min: z.number().optional().describe('Minimum number value'),\n max: z.number().optional().describe('Maximum number value'),\n })\n .describe('Validation rules')\n\n/**\n * Provider config property\n */\nexport const ProviderConfigPropertySchema = z\n .object({\n type: ProviderConfigPropertyTypeSchema.describe('Property type'),\n title: z.string().describe('Display label'),\n description: z.string().optional().describe('Help text'),\n default: z.unknown().optional().describe('Default value'),\n required: z.boolean().optional().describe('Whether the field is required'),\n placeholder: z.string().optional().describe('Placeholder text'),\n options: z.array(ProviderConfigSelectOptionSchema).optional().describe('For select type'),\n validation: ProviderConfigValidationSchema.optional().describe('Validation rules'),\n })\n .describe('Provider config property')\n\n/**\n * Provider config schema\n */\nexport const ProviderConfigSchemaSchema = z\n .object({\n properties: z.record(ProviderConfigPropertySchema).describe('Property definitions'),\n order: z.array(z.string()).optional().describe('Display order of properties'),\n })\n .describe('Provider configuration schema')\n\n/**\n * Provider definition\n */\nexport const ProviderDefinitionSchema = z\n .object({\n id: z.string().describe('Provider ID'),\n name: z.string().describe('Display name'),\n description: z.string().optional().describe('Description'),\n suggestedDefaultModel: z.string().optional().describe('Suggested default model'),\n defaultSettings: z.record(z.unknown()).optional().describe('Default settings'),\n configSchema: ProviderConfigSchemaSchema.optional().describe('Configuration UI schema'),\n })\n .describe('Provider definition')\n\n// =============================================================================\n// Tools\n// =============================================================================\n\n/**\n * Tool definition\n */\nexport const ToolDefinitionSchema = z\n .object({\n id: z.string().describe('Tool ID'),\n name: LocalizedStringSchema.describe('Display name'),\n description: LocalizedStringSchema.describe('Description for Stina'),\n parameters: z.record(z.unknown()).optional().describe('Parameter schema (JSON Schema)'),\n })\n .describe('Tool definition')\n\n// =============================================================================\n// Commands\n// =============================================================================\n\n/**\n * Command definition\n */\nexport const CommandDefinitionSchema = z\n .object({\n id: z.string().describe('Command ID (e.g., \"weather\" for /weather)'),\n name: z.string().describe('Display name'),\n description: z.string().describe('Description'),\n })\n .describe('Command definition')\n\n// =============================================================================\n// Prompts\n// =============================================================================\n\n/**\n * Prompt section\n */\nexport const PromptSectionSchema = z\n .enum(['system', 'behavior', 'tools'])\n .describe('Prompt section placement')\n\n/**\n * Prompt contribution\n */\nexport const PromptContributionSchema = z\n .object({\n id: z.string().describe('Unique ID within the extension'),\n title: z.string().optional().describe('Optional title for the prompt chunk'),\n section: PromptSectionSchema.optional().describe('Prompt section placement'),\n text: z.string().optional().describe('Plain text prompt content'),\n i18n: z.record(z.string()).optional().describe('Localized prompt content'),\n order: z.number().optional().describe('Ordering hint (lower comes first)'),\n })\n .describe('Prompt contribution')\n\n// =============================================================================\n// Storage\n// =============================================================================\n\n/**\n * Storage collection config schema\n */\nexport const StorageCollectionConfigSchema = z\n .object({\n indexes: z.array(z.string()).optional().describe('Fields to index for fast queries'),\n })\n .describe('Collection configuration')\n\n/**\n * Storage contributions schema\n */\nexport const StorageContributionsSchema = z\n .object({\n collections: z.record(StorageCollectionConfigSchema).describe('Collection definitions'),\n })\n .describe('Storage contributions')\n\n// =============================================================================\n// Extension Contributions\n// =============================================================================\n\n/**\n * Extension contributions\n */\nexport const ExtensionContributionsSchema = z\n .object({\n settings: z.array(SettingDefinitionSchema).optional().describe('User-configurable settings'),\n toolSettings: z.array(ToolSettingsViewDefinitionSchema).optional().describe('Tool settings views'),\n panels: z.array(PanelDefinitionSchema).optional().describe('Right panel contributions'),\n providers: z.array(ProviderDefinitionSchema).optional().describe('AI providers'),\n tools: z.array(ToolDefinitionSchema).optional().describe('Tools for Stina to use'),\n commands: z.array(CommandDefinitionSchema).optional().describe('Slash commands'),\n prompts: z.array(PromptContributionSchema).optional().describe('Prompt contributions'),\n storage: StorageContributionsSchema.optional().describe('Storage collection declarations'),\n })\n .describe('What an extension can contribute to Stina')\n\n// =============================================================================\n// Type Exports\n// =============================================================================\n\nexport type LocalizedString = z.infer<typeof LocalizedStringSchema>\nexport type SettingOptionsMapping = z.infer<typeof SettingOptionsMappingSchema>\nexport type SettingCreateMapping = z.infer<typeof SettingCreateMappingSchema>\nexport type SettingValidation = z.infer<typeof SettingValidationSchema>\nexport type SettingDefinition = z.infer<typeof SettingDefinitionSchema>\nexport type ToolSettingsListMapping = z.infer<typeof ToolSettingsListMappingSchema>\nexport type ToolSettingsActionDataSource = z.infer<typeof ToolSettingsActionDataSourceSchema>\nexport type ToolSettingsListView = z.infer<typeof ToolSettingsListViewSchema>\nexport type ToolSettingsComponentView = z.infer<typeof ToolSettingsComponentViewSchema>\nexport type ToolSettingsView = z.infer<typeof ToolSettingsViewSchema>\nexport type ToolSettingsViewDefinition = z.infer<typeof ToolSettingsViewDefinitionSchema>\nexport type PanelActionDataSource = z.infer<typeof PanelActionDataSourceSchema>\nexport type PanelComponentView = z.infer<typeof PanelComponentViewSchema>\nexport type PanelUnknownView = z.infer<typeof PanelUnknownViewSchema>\nexport type PanelView = z.infer<typeof PanelViewSchema>\nexport type PanelDefinition = z.infer<typeof PanelDefinitionSchema>\nexport type ProviderConfigPropertyType = z.infer<typeof ProviderConfigPropertyTypeSchema>\nexport type ProviderConfigSelectOption = z.infer<typeof ProviderConfigSelectOptionSchema>\nexport type ProviderConfigValidation = z.infer<typeof ProviderConfigValidationSchema>\nexport type ProviderConfigProperty = z.infer<typeof ProviderConfigPropertySchema>\nexport type ProviderConfigSchema = z.infer<typeof ProviderConfigSchemaSchema>\nexport type ProviderDefinition = z.infer<typeof ProviderDefinitionSchema>\nexport type ToolDefinition = z.infer<typeof ToolDefinitionSchema>\nexport type CommandDefinition = z.infer<typeof CommandDefinitionSchema>\nexport type PromptSection = z.infer<typeof PromptSectionSchema>\nexport type PromptContribution = z.infer<typeof PromptContributionSchema>\nexport type StorageCollectionConfig = z.infer<typeof StorageCollectionConfigSchema>\nexport type StorageContributions = z.infer<typeof StorageContributionsSchema>\nexport type ExtensionContributions = z.infer<typeof ExtensionContributionsSchema>\n","/**\n * Component Schema\n *\n * Zod schemas for extension UI components.\n */\n\nimport { z } from 'zod'\n\n// =============================================================================\n// CSS Properties\n// =============================================================================\n\n/**\n * Allowed CSS property names for extension component styling.\n */\nexport const AllowedCSSPropertySchema = z.enum([\n // Colors\n 'color',\n 'background-color',\n 'background',\n 'border-color',\n // Borders\n 'border',\n 'border-width',\n 'border-style',\n 'border-radius',\n 'border-top',\n 'border-right',\n 'border-bottom',\n 'border-left',\n 'border-top-left-radius',\n 'border-top-right-radius',\n 'border-bottom-left-radius',\n 'border-bottom-right-radius',\n // Spacing\n 'padding',\n 'padding-top',\n 'padding-right',\n 'padding-bottom',\n 'padding-left',\n 'margin',\n 'margin-top',\n 'margin-right',\n 'margin-bottom',\n 'margin-left',\n 'gap',\n 'row-gap',\n 'column-gap',\n // Typography\n 'font-size',\n 'font-weight',\n 'font-style',\n 'text-align',\n 'text-decoration',\n 'line-height',\n 'letter-spacing',\n 'white-space',\n 'word-break',\n 'overflow-wrap',\n // Layout (safe properties)\n 'width',\n 'height',\n 'min-width',\n 'min-height',\n 'max-width',\n 'max-height',\n 'flex',\n 'flex-grow',\n 'flex-shrink',\n 'flex-basis',\n 'flex-wrap',\n 'align-self',\n 'justify-self',\n 'align-items',\n 'justify-content',\n // Visual\n 'opacity',\n 'visibility',\n 'overflow',\n 'overflow-x',\n 'overflow-y',\n 'box-shadow',\n 'outline',\n 'cursor',\n 'border-collapse',\n 'border-spacing',\n])\n\n/**\n * Style object for extension components.\n */\nexport const ExtensionComponentStyleSchema = z\n .record(AllowedCSSPropertySchema, z.string())\n .describe('Safe CSS styles for the component')\n\n// =============================================================================\n// Base Component\n// =============================================================================\n\n/**\n * Base component data schema - allows additional properties\n */\nexport const ExtensionComponentDataSchema: z.ZodType<{\n component: string\n style?: Record<string, string>\n [key: string]: unknown\n}> = z.lazy(() =>\n z\n .object({\n component: z.string().describe('Component type name'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Extension component definition')\n)\n\n// =============================================================================\n// Action References\n// =============================================================================\n\n/**\n * Action call with parameters\n */\nexport const ExtensionActionCallSchema = z\n .object({\n action: z.string().describe('Name of the registered action'),\n params: z.record(z.unknown()).optional().describe('Parameters to pass'),\n })\n .describe('Action call with parameters')\n\n/**\n * Action reference - can be a simple string or full action call\n */\nexport const ExtensionActionRefSchema = z\n .union([z.string(), ExtensionActionCallSchema])\n .describe('Action reference')\n\n// =============================================================================\n// Iterator & Children\n// =============================================================================\n\n/**\n * Iterator for rendering a list of components from data\n */\nexport const ExtensionComponentIteratorSchema = z\n .object({\n each: z.union([z.string(), z.array(z.unknown())]).describe('Data source to iterate over'),\n as: z.string().describe('Variable name for current item in scope'),\n items: z.array(ExtensionComponentDataSchema).describe('Components to render for each item'),\n })\n .describe('Iterator for rendering lists')\n\n/**\n * Children can be either a static array of components or an iterator\n */\nexport const ExtensionComponentChildrenSchema = z\n .union([z.array(ExtensionComponentDataSchema), ExtensionComponentIteratorSchema])\n .describe('Child components or iterator')\n\n// =============================================================================\n// Data Source\n// =============================================================================\n\n/**\n * Data source definition for fetching data via an action\n */\nexport const ExtensionDataSourceSchema = z\n .object({\n action: z.string().describe('Action to call for fetching data'),\n params: z.record(z.unknown()).optional().describe('Parameters to pass to the action'),\n refreshOn: z.array(z.string()).optional().describe('Event names that trigger a refresh'),\n })\n .describe('Data source definition')\n\n// =============================================================================\n// Component Props Schemas\n// =============================================================================\n\nexport const HeaderPropsSchema = z\n .object({\n component: z.literal('Header'),\n level: z.number().min(1).max(6).describe('Heading level (1-6)'),\n title: z.string().describe('Header title'),\n description: z.union([z.string(), z.array(z.string())]).optional().describe('Description text'),\n icon: z.string().optional().describe('Icon name'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Header component')\n\nexport const LabelPropsSchema = z\n .object({\n component: z.literal('Label'),\n text: z.string().describe('Label text'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Label component')\n\nexport const ParagraphPropsSchema = z\n .object({\n component: z.literal('Paragraph'),\n text: z.string().describe('Paragraph text'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Paragraph component')\n\nexport const ButtonPropsSchema = z\n .object({\n component: z.literal('Button'),\n text: z.string().describe('Button text'),\n onClickAction: ExtensionActionRefSchema.describe('Action to call on click'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Button component')\n\nexport const TextInputPropsSchema = z\n .object({\n component: z.literal('TextInput'),\n label: z.string().describe('Input label'),\n placeholder: z.string().optional().describe('Placeholder text'),\n value: z.string().optional().describe('Current value'),\n onChangeAction: ExtensionActionRefSchema.describe('Action to call on change'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('TextInput component')\n\nexport const DateTimeInputPropsSchema = z\n .object({\n component: z.literal('DateTimeInput'),\n label: z.string().describe('Input label'),\n value: z.string().optional().describe('Current value'),\n onChangeAction: ExtensionActionRefSchema.describe('Action to call on change'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('DateTimeInput component')\n\nexport const SelectPropsSchema = z\n .object({\n component: z.literal('Select'),\n label: z.string().describe('Select label'),\n options: z.array(z.object({ label: z.string(), value: z.string() })).describe('Available options'),\n selectedValue: z.string().optional().describe('Currently selected value'),\n onChangeAction: ExtensionActionRefSchema.describe('Action to call on change'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Select component')\n\nexport const VerticalStackPropsSchema = z\n .object({\n component: z.literal('VerticalStack'),\n gap: z.number().optional().describe('Gap between children'),\n children: ExtensionComponentChildrenSchema.describe('Child components'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('VerticalStack layout component')\n\nexport const HorizontalStackPropsSchema = z\n .object({\n component: z.literal('HorizontalStack'),\n gap: z.number().optional().describe('Gap between children'),\n children: ExtensionComponentChildrenSchema.describe('Child components'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('HorizontalStack layout component')\n\nexport const GridPropsSchema = z\n .object({\n component: z.literal('Grid'),\n columns: z.number().describe('Number of columns'),\n gap: z.number().optional().describe('Gap between items'),\n children: ExtensionComponentChildrenSchema.describe('Child components'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Grid layout component')\n\nexport const DividerPropsSchema = z\n .object({\n component: z.literal('Divider'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Divider component')\n\nexport const IconPropsSchema = z\n .object({\n component: z.literal('Icon'),\n name: z.string().describe('Icon name'),\n title: z.string().optional().describe('Icon title'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Icon component')\n\nexport const IconButtonTypeSchema = z\n .enum(['normal', 'primary', 'danger', 'accent'])\n .describe('Button type')\n\nexport const IconButtonPropsSchema = z\n .object({\n component: z.literal('IconButton'),\n icon: z.string().describe('Icon name'),\n tooltip: z.string().describe('Tooltip text'),\n active: z.boolean().optional().describe('Whether the button is active'),\n disabled: z.boolean().optional().describe('Whether the button is disabled'),\n type: IconButtonTypeSchema.optional().describe('Button style type'),\n onClickAction: ExtensionActionRefSchema.describe('Action to call on click'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('IconButton component')\n\nexport const PanelActionSchema = z\n .object({\n icon: z.string().describe('Icon name'),\n tooltip: z.string().describe('Tooltip text'),\n action: ExtensionActionRefSchema.describe('Action to call'),\n type: IconButtonTypeSchema.optional().describe('Button style type'),\n })\n .describe('Panel action button')\n\nexport const PanelPropsSchema = z\n .object({\n component: z.literal('Panel'),\n title: z.string().describe('Panel title'),\n description: z.union([z.string(), z.array(z.string())]).optional().describe('Description text'),\n icon: z.string().optional().describe('Icon name'),\n actions: z.array(PanelActionSchema).optional().describe('Action buttons'),\n content: ExtensionComponentDataSchema.optional().describe('Panel content'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Panel component')\n\nexport const TogglePropsSchema = z\n .object({\n component: z.literal('Toggle'),\n label: z.string().optional().describe('Toggle label'),\n description: z.string().optional().describe('Description text'),\n checked: z.boolean().optional().describe('Whether the toggle is checked'),\n disabled: z.boolean().optional().describe('Whether the toggle is disabled'),\n onChangeAction: ExtensionActionRefSchema.describe('Action to call on change'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Toggle component')\n\nexport const CollapsiblePropsSchema = z\n .object({\n component: z.literal('Collapsible'),\n title: z.string().describe('Title displayed in the header'),\n description: z.union([z.string(), z.array(z.string())]).optional().describe('Description text'),\n icon: z.string().optional().describe('Icon name'),\n defaultExpanded: z.boolean().optional().describe('Whether expanded by default'),\n content: ExtensionComponentDataSchema.optional().describe('Content when expanded'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Collapsible component')\n\nexport const PillVariantSchema = z\n .enum(['default', 'primary', 'success', 'warning', 'danger', 'accent'])\n .describe('Pill color variant')\n\nexport const PillPropsSchema = z\n .object({\n component: z.literal('Pill'),\n text: z.string().describe('Pill text'),\n icon: z.string().optional().describe('Icon name'),\n variant: PillVariantSchema.optional().describe('Color variant'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Pill component')\n\nexport const CheckboxPropsSchema = z\n .object({\n component: z.literal('Checkbox'),\n label: z.string().describe('Checkbox label'),\n checked: z.boolean().optional().describe('Whether the checkbox is checked'),\n disabled: z.boolean().optional().describe('Whether the checkbox is disabled'),\n strikethrough: z.boolean().optional().describe('Strike through label when checked'),\n onChangeAction: ExtensionActionRefSchema.describe('Action to call on change'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Checkbox component')\n\nexport const MarkdownPropsSchema = z\n .object({\n component: z.literal('Markdown'),\n content: z.string().describe('Markdown content'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Markdown component')\n\nexport const ModalPropsSchema = z\n .object({\n component: z.literal('Modal'),\n title: z.string().describe('Modal title'),\n open: z.boolean().optional().describe('Whether the modal is open'),\n maxWidth: z.string().optional().describe('Max width of the modal'),\n body: ExtensionComponentDataSchema.optional().describe('Modal body content'),\n footer: ExtensionComponentDataSchema.optional().describe('Modal footer content'),\n onCloseAction: ExtensionActionRefSchema.optional().describe('Action to call on close'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('Modal component')\n\nexport const ConditionalGroupPropsSchema = z\n .object({\n component: z.literal('ConditionalGroup'),\n condition: z.string().describe('Condition expression to evaluate'),\n children: ExtensionComponentChildrenSchema.describe('Children to render when condition is true'),\n style: ExtensionComponentStyleSchema.optional(),\n })\n .passthrough()\n .describe('ConditionalGroup component')\n\n// =============================================================================\n// Type Exports\n// =============================================================================\n\nexport type AllowedCSSProperty = z.infer<typeof AllowedCSSPropertySchema>\nexport type ExtensionComponentStyle = z.infer<typeof ExtensionComponentStyleSchema>\nexport type ExtensionComponentData = z.infer<typeof ExtensionComponentDataSchema>\nexport type ExtensionActionCall = z.infer<typeof ExtensionActionCallSchema>\nexport type ExtensionActionRef = z.infer<typeof ExtensionActionRefSchema>\nexport type ExtensionComponentIterator = z.infer<typeof ExtensionComponentIteratorSchema>\nexport type ExtensionComponentChildren = z.infer<typeof ExtensionComponentChildrenSchema>\nexport type ExtensionDataSource = z.infer<typeof ExtensionDataSourceSchema>\nexport type IconButtonType = z.infer<typeof IconButtonTypeSchema>\nexport type PillVariant = z.infer<typeof PillVariantSchema>\nexport type PanelAction = z.infer<typeof PanelActionSchema>\nexport type HeaderProps = z.infer<typeof HeaderPropsSchema>\nexport type LabelProps = z.infer<typeof LabelPropsSchema>\nexport type ParagraphProps = z.infer<typeof ParagraphPropsSchema>\nexport type ButtonProps = z.infer<typeof ButtonPropsSchema>\nexport type TextInputProps = z.infer<typeof TextInputPropsSchema>\nexport type DateTimeInputProps = z.infer<typeof DateTimeInputPropsSchema>\nexport type SelectProps = z.infer<typeof SelectPropsSchema>\nexport type VerticalStackProps = z.infer<typeof VerticalStackPropsSchema>\nexport type HorizontalStackProps = z.infer<typeof HorizontalStackPropsSchema>\nexport type GridProps = z.infer<typeof GridPropsSchema>\nexport type DividerProps = z.infer<typeof DividerPropsSchema>\nexport type IconProps = z.infer<typeof IconPropsSchema>\nexport type IconButtonProps = z.infer<typeof IconButtonPropsSchema>\nexport type PanelProps = z.infer<typeof PanelPropsSchema>\nexport type ToggleProps = z.infer<typeof TogglePropsSchema>\nexport type CollapsibleProps = z.infer<typeof CollapsiblePropsSchema>\nexport type PillProps = z.infer<typeof PillPropsSchema>\nexport type CheckboxProps = z.infer<typeof CheckboxPropsSchema>\nexport type MarkdownProps = z.infer<typeof MarkdownPropsSchema>\nexport type ModalProps = z.infer<typeof ModalPropsSchema>\nexport type ConditionalGroupProps = z.infer<typeof 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S,qBAAqB;AAK1B,IAAM,0BAA0BA,GACpC,OAAO;AAAA,EACN,IAAIA,GACD,OAAO,EACP,MAAM,gBAAgB,gDAAgD,EACtE,SAAS,6CAA6C;AAAA,EACzD,MAAMA,GAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,qBAAqB;AAAA,EACtD,SAASA,GACN,OAAO,EACP,MAAM,kBAAkB,uCAAuC,EAC/D,SAAS,yBAAyB;AAAA,EACrC,aAAaA,GAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,mBAAmB;AAAA,EAC3D,QAAQ,aAAa,SAAS,oBAAoB;AAAA,EAClD,YAAYA,GAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,gBAAgB;AAAA,EACjE,SAASA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oBAAoB;AAAA,EAC5D,SAAS,cAAc,SAAS,EAAE,SAAS,gCAAgC;AAAA,EAC3E,WAAWA,GAAE,MAAM,cAAc,EAAE,SAAS,EAAE,SAAS,qBAAqB;AAAA,EAC5E,MAAMA,GAAE,OAAO,EAAE,SAAS,+CAA+C;AAAA,EACzE,aAAaA,GAAE,MAAM,gBAAgB,EAAE,SAAS,sBAAsB;AAAA,EACtE,aAAa,6BAA6B,SAAS,EAAE,SAAS,gCAAgC;AAChG,CAAC,EACA,SAAS,2BAA2B;","names":["z","z","z","z","z"]}
|
|
@@ -379,6 +379,15 @@ interface ExtensionContributions {
|
|
|
379
379
|
commands?: CommandDefinition[];
|
|
380
380
|
/** Prompt contributions for the system prompt */
|
|
381
381
|
prompts?: PromptContribution[];
|
|
382
|
+
/** Storage collection declarations */
|
|
383
|
+
storage?: {
|
|
384
|
+
collections: {
|
|
385
|
+
[name: string]: {
|
|
386
|
+
/** Fields to index for fast queries */
|
|
387
|
+
indexes?: string[];
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
};
|
|
382
391
|
}
|
|
383
392
|
/**
|
|
384
393
|
* Setting definition for the UI
|
|
@@ -819,6 +828,277 @@ type StreamEvent = {
|
|
|
819
828
|
message: string;
|
|
820
829
|
};
|
|
821
830
|
|
|
831
|
+
/**
|
|
832
|
+
* Storage Types
|
|
833
|
+
*
|
|
834
|
+
* Types for the new collection-based document storage API.
|
|
835
|
+
* Provides a MongoDB-inspired but simplified query syntax for extensions.
|
|
836
|
+
*/
|
|
837
|
+
/**
|
|
838
|
+
* Query syntax for filtering documents in a collection.
|
|
839
|
+
* Supports exact matching and comparison operators.
|
|
840
|
+
*
|
|
841
|
+
* @example
|
|
842
|
+
* // Exact match
|
|
843
|
+
* { status: "active" }
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* // Comparison operators
|
|
847
|
+
* { age: { $gt: 18 }, status: { $in: ["active", "pending"] } }
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* // String contains (case-insensitive)
|
|
851
|
+
* { name: { $contains: "john" } }
|
|
852
|
+
*/
|
|
853
|
+
interface Query {
|
|
854
|
+
[field: string]: unknown | {
|
|
855
|
+
$gt?: unknown;
|
|
856
|
+
} | {
|
|
857
|
+
$gte?: unknown;
|
|
858
|
+
} | {
|
|
859
|
+
$lt?: unknown;
|
|
860
|
+
} | {
|
|
861
|
+
$lte?: unknown;
|
|
862
|
+
} | {
|
|
863
|
+
$ne?: unknown;
|
|
864
|
+
} | {
|
|
865
|
+
$in?: unknown[];
|
|
866
|
+
} | {
|
|
867
|
+
$contains?: string;
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Optional modifiers for query operations.
|
|
872
|
+
* Allows sorting, pagination, and limiting results.
|
|
873
|
+
*/
|
|
874
|
+
interface QueryOptions {
|
|
875
|
+
/**
|
|
876
|
+
* Sort results by one or more fields.
|
|
877
|
+
* @example { createdAt: 'desc', name: 'asc' }
|
|
878
|
+
*/
|
|
879
|
+
sort?: {
|
|
880
|
+
[field: string]: 'asc' | 'desc';
|
|
881
|
+
};
|
|
882
|
+
/**
|
|
883
|
+
* Maximum number of documents to return.
|
|
884
|
+
*/
|
|
885
|
+
limit?: number;
|
|
886
|
+
/**
|
|
887
|
+
* Number of documents to skip (for pagination).
|
|
888
|
+
*/
|
|
889
|
+
offset?: number;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Storage API for extension-scoped document storage.
|
|
893
|
+
* All operations are automatically scoped to the calling extension.
|
|
894
|
+
* Data is stored as JSON documents in collections.
|
|
895
|
+
*/
|
|
896
|
+
interface StorageAPI {
|
|
897
|
+
/**
|
|
898
|
+
* Store a document in a collection.
|
|
899
|
+
* Creates the document if it doesn't exist, or replaces it if it does.
|
|
900
|
+
*
|
|
901
|
+
* @param collection - The name of the collection
|
|
902
|
+
* @param id - Unique identifier for the document within the collection
|
|
903
|
+
* @param data - The document data to store
|
|
904
|
+
*
|
|
905
|
+
* @example
|
|
906
|
+
* await storage.put('users', 'user-123', { name: 'John', age: 30 })
|
|
907
|
+
*/
|
|
908
|
+
put<T extends object>(collection: string, id: string, data: T): Promise<void>;
|
|
909
|
+
/**
|
|
910
|
+
* Retrieve a document from a collection by its ID.
|
|
911
|
+
*
|
|
912
|
+
* @param collection - The name of the collection
|
|
913
|
+
* @param id - The document ID to retrieve
|
|
914
|
+
* @returns The document data, or undefined if not found
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* const user = await storage.get<User>('users', 'user-123')
|
|
918
|
+
*/
|
|
919
|
+
get<T>(collection: string, id: string): Promise<T | undefined>;
|
|
920
|
+
/**
|
|
921
|
+
* Delete a document from a collection.
|
|
922
|
+
*
|
|
923
|
+
* @param collection - The name of the collection
|
|
924
|
+
* @param id - The document ID to delete
|
|
925
|
+
* @returns True if the document was deleted, false if it didn't exist
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* const wasDeleted = await storage.delete('users', 'user-123')
|
|
929
|
+
*/
|
|
930
|
+
delete(collection: string, id: string): Promise<boolean>;
|
|
931
|
+
/**
|
|
932
|
+
* Find documents matching a query.
|
|
933
|
+
*
|
|
934
|
+
* @param collection - The name of the collection
|
|
935
|
+
* @param query - Optional query to filter documents
|
|
936
|
+
* @param options - Optional query modifiers (sort, limit, offset)
|
|
937
|
+
* @returns Array of matching documents
|
|
938
|
+
*
|
|
939
|
+
* @example
|
|
940
|
+
* // Find all active users, sorted by name
|
|
941
|
+
* const users = await storage.find<User>('users',
|
|
942
|
+
* { status: 'active' },
|
|
943
|
+
* { sort: { name: 'asc' }, limit: 10 }
|
|
944
|
+
* )
|
|
945
|
+
*/
|
|
946
|
+
find<T>(collection: string, query?: Query, options?: QueryOptions): Promise<T[]>;
|
|
947
|
+
/**
|
|
948
|
+
* Find a single document matching a query.
|
|
949
|
+
* Returns the first match if multiple documents match.
|
|
950
|
+
*
|
|
951
|
+
* @param collection - The name of the collection
|
|
952
|
+
* @param query - Query to filter documents
|
|
953
|
+
* @returns The first matching document, or undefined if none found
|
|
954
|
+
*
|
|
955
|
+
* @example
|
|
956
|
+
* const user = await storage.findOne<User>('users', { email: 'john@example.com' })
|
|
957
|
+
*/
|
|
958
|
+
findOne<T>(collection: string, query: Query): Promise<T | undefined>;
|
|
959
|
+
/**
|
|
960
|
+
* Count documents matching a query.
|
|
961
|
+
*
|
|
962
|
+
* @param collection - The name of the collection
|
|
963
|
+
* @param query - Optional query to filter documents
|
|
964
|
+
* @returns The number of matching documents
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* const activeCount = await storage.count('users', { status: 'active' })
|
|
968
|
+
*/
|
|
969
|
+
count(collection: string, query?: Query): Promise<number>;
|
|
970
|
+
/**
|
|
971
|
+
* Store multiple documents in a collection in a single operation.
|
|
972
|
+
* More efficient than multiple individual put calls.
|
|
973
|
+
*
|
|
974
|
+
* @param collection - The name of the collection
|
|
975
|
+
* @param docs - Array of documents with their IDs
|
|
976
|
+
*
|
|
977
|
+
* @example
|
|
978
|
+
* await storage.putMany('users', [
|
|
979
|
+
* { id: 'user-1', data: { name: 'John' } },
|
|
980
|
+
* { id: 'user-2', data: { name: 'Jane' } }
|
|
981
|
+
* ])
|
|
982
|
+
*/
|
|
983
|
+
putMany<T extends object>(collection: string, docs: Array<{
|
|
984
|
+
id: string;
|
|
985
|
+
data: T;
|
|
986
|
+
}>): Promise<void>;
|
|
987
|
+
/**
|
|
988
|
+
* Delete multiple documents matching a query.
|
|
989
|
+
*
|
|
990
|
+
* @param collection - The name of the collection
|
|
991
|
+
* @param query - Query to match documents for deletion
|
|
992
|
+
* @returns The number of documents deleted
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* const deleted = await storage.deleteMany('users', { status: 'inactive' })
|
|
996
|
+
*/
|
|
997
|
+
deleteMany(collection: string, query: Query): Promise<number>;
|
|
998
|
+
/**
|
|
999
|
+
* Drop an entire collection, deleting all its documents.
|
|
1000
|
+
* Use with caution - this operation cannot be undone.
|
|
1001
|
+
*
|
|
1002
|
+
* @param collection - The name of the collection to drop
|
|
1003
|
+
*
|
|
1004
|
+
* @example
|
|
1005
|
+
* await storage.dropCollection('temp-data')
|
|
1006
|
+
*/
|
|
1007
|
+
dropCollection(collection: string): Promise<void>;
|
|
1008
|
+
/**
|
|
1009
|
+
* List all collections owned by this extension.
|
|
1010
|
+
*
|
|
1011
|
+
* @returns Array of collection names
|
|
1012
|
+
*
|
|
1013
|
+
* @example
|
|
1014
|
+
* const collections = await storage.listCollections()
|
|
1015
|
+
* // ['users', 'settings', 'cache']
|
|
1016
|
+
*/
|
|
1017
|
+
listCollections(): Promise<string[]>;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Secrets API for secure storage of sensitive values.
|
|
1021
|
+
* All operations are automatically scoped to the calling extension.
|
|
1022
|
+
* Values are encrypted at rest.
|
|
1023
|
+
*/
|
|
1024
|
+
interface SecretsAPI {
|
|
1025
|
+
/**
|
|
1026
|
+
* Store a secret value.
|
|
1027
|
+
* Creates the secret if it doesn't exist, or replaces it if it does.
|
|
1028
|
+
*
|
|
1029
|
+
* @param key - Unique key for the secret
|
|
1030
|
+
* @param value - The secret value to store
|
|
1031
|
+
*
|
|
1032
|
+
* @example
|
|
1033
|
+
* await secrets.set('api-key', 'sk-1234567890')
|
|
1034
|
+
*/
|
|
1035
|
+
set(key: string, value: string): Promise<void>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Retrieve a secret value.
|
|
1038
|
+
*
|
|
1039
|
+
* @param key - The secret key to retrieve
|
|
1040
|
+
* @returns The secret value, or undefined if not found
|
|
1041
|
+
*
|
|
1042
|
+
* @example
|
|
1043
|
+
* const apiKey = await secrets.get('api-key')
|
|
1044
|
+
*/
|
|
1045
|
+
get(key: string): Promise<string | undefined>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Delete a secret.
|
|
1048
|
+
*
|
|
1049
|
+
* @param key - The secret key to delete
|
|
1050
|
+
* @returns True if the secret was deleted, false if it didn't exist
|
|
1051
|
+
*
|
|
1052
|
+
* @example
|
|
1053
|
+
* const wasDeleted = await secrets.delete('api-key')
|
|
1054
|
+
*/
|
|
1055
|
+
delete(key: string): Promise<boolean>;
|
|
1056
|
+
/**
|
|
1057
|
+
* List all secret keys owned by this extension.
|
|
1058
|
+
* Only returns the keys, not the secret values.
|
|
1059
|
+
*
|
|
1060
|
+
* @returns Array of secret keys
|
|
1061
|
+
*
|
|
1062
|
+
* @example
|
|
1063
|
+
* const keys = await secrets.list()
|
|
1064
|
+
* // ['api-key', 'webhook-secret']
|
|
1065
|
+
*/
|
|
1066
|
+
list(): Promise<string[]>;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Configuration for a storage collection in the extension manifest.
|
|
1070
|
+
* Allows extensions to declare collections and their indexing requirements.
|
|
1071
|
+
*/
|
|
1072
|
+
interface StorageCollectionConfig {
|
|
1073
|
+
/**
|
|
1074
|
+
* Fields that should be indexed for fast queries.
|
|
1075
|
+
* Indexed fields allow efficient filtering and sorting.
|
|
1076
|
+
*
|
|
1077
|
+
* @example ['status', 'createdAt', 'userId']
|
|
1078
|
+
*/
|
|
1079
|
+
indexes?: string[];
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Storage contributions section in the extension manifest.
|
|
1083
|
+
* Declares the collections an extension will use.
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* {
|
|
1087
|
+
* collections: {
|
|
1088
|
+
* users: { indexes: ['email', 'status'] },
|
|
1089
|
+
* settings: {}
|
|
1090
|
+
* }
|
|
1091
|
+
* }
|
|
1092
|
+
*/
|
|
1093
|
+
interface StorageContributions {
|
|
1094
|
+
/**
|
|
1095
|
+
* Map of collection names to their configuration.
|
|
1096
|
+
*/
|
|
1097
|
+
collections: {
|
|
1098
|
+
[name: string]: StorageCollectionConfig;
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
|
|
822
1102
|
/**
|
|
823
1103
|
* Extension Context Types
|
|
824
1104
|
*
|
|
@@ -845,15 +1125,29 @@ interface Disposable {
|
|
|
845
1125
|
* - Makes code easier to reason about and debug
|
|
846
1126
|
* - Allows scheduler jobs to create context for the correct user
|
|
847
1127
|
*
|
|
1128
|
+
* ## Storage and Secrets
|
|
1129
|
+
*
|
|
1130
|
+
* The context provides both extension-scoped and user-scoped storage:
|
|
1131
|
+
* - `storage`: Extension-wide document storage (shared across all users)
|
|
1132
|
+
* - `userStorage`: User-specific document storage (isolated per user)
|
|
1133
|
+
* - `secrets`: Extension-wide secrets (shared across all users)
|
|
1134
|
+
* - `userSecrets`: User-specific secrets (isolated per user)
|
|
1135
|
+
*
|
|
848
1136
|
* @example
|
|
849
1137
|
* ```typescript
|
|
850
1138
|
* // In a tool execute handler:
|
|
851
1139
|
* execute: async (params, context) => {
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
*
|
|
1140
|
+
* // Extension-wide storage (shared across all users)
|
|
1141
|
+
* const config = await context.storage.get<Config>('settings', 'global-config')
|
|
1142
|
+
*
|
|
1143
|
+
* // User-specific storage (isolated per user)
|
|
1144
|
+
* const prefs = await context.userStorage.get<Preferences>('preferences', 'theme')
|
|
1145
|
+
* await context.userStorage.put('preferences', 'theme', { mode: 'dark' })
|
|
1146
|
+
*
|
|
1147
|
+
* // Secrets access
|
|
1148
|
+
* const apiKey = await context.secrets.get('api-key')
|
|
1149
|
+
* const userToken = await context.userSecrets.get('oauth-token')
|
|
1150
|
+
*
|
|
857
1151
|
* console.log(`Running in extension ${context.extension.id}`)
|
|
858
1152
|
* }
|
|
859
1153
|
* ```
|
|
@@ -871,6 +1165,14 @@ interface ExecutionContext {
|
|
|
871
1165
|
readonly version: string;
|
|
872
1166
|
readonly storagePath: string;
|
|
873
1167
|
};
|
|
1168
|
+
/** Extension-scoped storage (same for all users) */
|
|
1169
|
+
readonly storage: StorageAPI;
|
|
1170
|
+
/** User-scoped storage (isolated per user) */
|
|
1171
|
+
readonly userStorage: StorageAPI;
|
|
1172
|
+
/** Extension-scoped secrets */
|
|
1173
|
+
readonly secrets: SecretsAPI;
|
|
1174
|
+
/** User-scoped secrets */
|
|
1175
|
+
readonly userSecrets: SecretsAPI;
|
|
874
1176
|
}
|
|
875
1177
|
/**
|
|
876
1178
|
* Context provided to extension's activate function.
|
|
@@ -903,10 +1205,10 @@ interface ExtensionContext {
|
|
|
903
1205
|
readonly user?: UserAPI;
|
|
904
1206
|
/** Chat access (if permitted) */
|
|
905
1207
|
readonly chat?: ChatAPI;
|
|
906
|
-
/**
|
|
907
|
-
readonly database?: DatabaseAPI;
|
|
908
|
-
/** Local storage (if permitted) */
|
|
1208
|
+
/** Collection-based document storage (if permitted) */
|
|
909
1209
|
readonly storage?: StorageAPI;
|
|
1210
|
+
/** Secure secrets storage (if permitted) */
|
|
1211
|
+
readonly secrets?: SecretsAPI;
|
|
910
1212
|
/** Background workers (if permitted) */
|
|
911
1213
|
readonly backgroundWorkers?: BackgroundWorkersAPI;
|
|
912
1214
|
/** Logging (always available) */
|
|
@@ -1081,82 +1383,6 @@ interface ChatInstructionMessage {
|
|
|
1081
1383
|
interface ChatAPI {
|
|
1082
1384
|
appendInstruction(message: ChatInstructionMessage): Promise<void>;
|
|
1083
1385
|
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Database API for extension-specific tables
|
|
1086
|
-
*/
|
|
1087
|
-
interface DatabaseAPI {
|
|
1088
|
-
/**
|
|
1089
|
-
* Execute a SQL query (only extension's prefixed tables allowed)
|
|
1090
|
-
*/
|
|
1091
|
-
execute<T = unknown>(sql: string, params?: unknown[]): Promise<T[]>;
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Simple key-value storage API with support for user-scoped storage.
|
|
1095
|
-
*
|
|
1096
|
-
* ## Global vs User-Scoped Storage
|
|
1097
|
-
*
|
|
1098
|
-
* Extensions have access to two types of storage:
|
|
1099
|
-
* - **Global storage**: Shared across all users, accessed via `get()`, `set()`, etc.
|
|
1100
|
-
* - **User-scoped storage**: Isolated per user, accessed via `getForUser()`, `setForUser()`, etc.
|
|
1101
|
-
*
|
|
1102
|
-
* Use global storage for extension-wide settings and user-scoped storage for
|
|
1103
|
-
* user preferences, session data, or any data that should be private to a user.
|
|
1104
|
-
*
|
|
1105
|
-
* @example
|
|
1106
|
-
* ```typescript
|
|
1107
|
-
* // Global storage (extension-wide)
|
|
1108
|
-
* await storage.set('apiEndpoint', 'https://api.example.com')
|
|
1109
|
-
* const endpoint = await storage.get<string>('apiEndpoint')
|
|
1110
|
-
*
|
|
1111
|
-
* // User-scoped storage (per-user)
|
|
1112
|
-
* if (context.userId) {
|
|
1113
|
-
* await storage.setForUser(context.userId, 'preferences', { theme: 'dark' })
|
|
1114
|
-
* const prefs = await storage.getForUser<Preferences>(context.userId, 'preferences')
|
|
1115
|
-
* }
|
|
1116
|
-
* ```
|
|
1117
|
-
*/
|
|
1118
|
-
interface StorageAPI {
|
|
1119
|
-
/**
|
|
1120
|
-
* Get a value by key (global/extension-scoped)
|
|
1121
|
-
*/
|
|
1122
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
1123
|
-
/**
|
|
1124
|
-
* Set a value (global/extension-scoped)
|
|
1125
|
-
*/
|
|
1126
|
-
set(key: string, value: unknown): Promise<void>;
|
|
1127
|
-
/**
|
|
1128
|
-
* Delete a key (global/extension-scoped)
|
|
1129
|
-
*/
|
|
1130
|
-
delete(key: string): Promise<void>;
|
|
1131
|
-
/**
|
|
1132
|
-
* Get all keys (global/extension-scoped)
|
|
1133
|
-
*/
|
|
1134
|
-
keys(): Promise<string[]>;
|
|
1135
|
-
/**
|
|
1136
|
-
* Get a value by key for a specific user (user-scoped)
|
|
1137
|
-
* @param userId The user ID
|
|
1138
|
-
* @param key The storage key
|
|
1139
|
-
*/
|
|
1140
|
-
getForUser<T>(userId: string, key: string): Promise<T | undefined>;
|
|
1141
|
-
/**
|
|
1142
|
-
* Set a value for a specific user (user-scoped)
|
|
1143
|
-
* @param userId The user ID
|
|
1144
|
-
* @param key The storage key
|
|
1145
|
-
* @param value The value to store
|
|
1146
|
-
*/
|
|
1147
|
-
setForUser(userId: string, key: string, value: unknown): Promise<void>;
|
|
1148
|
-
/**
|
|
1149
|
-
* Delete a key for a specific user (user-scoped)
|
|
1150
|
-
* @param userId The user ID
|
|
1151
|
-
* @param key The storage key
|
|
1152
|
-
*/
|
|
1153
|
-
deleteForUser(userId: string, key: string): Promise<void>;
|
|
1154
|
-
/**
|
|
1155
|
-
* Get all keys for a specific user (user-scoped)
|
|
1156
|
-
* @param userId The user ID
|
|
1157
|
-
*/
|
|
1158
|
-
keysForUser(userId: string): Promise<string[]>;
|
|
1159
|
-
}
|
|
1160
1386
|
/**
|
|
1161
1387
|
* Logging API
|
|
1162
1388
|
*/
|
|
@@ -1429,4 +1655,4 @@ interface ActionResult {
|
|
|
1429
1655
|
error?: string;
|
|
1430
1656
|
}
|
|
1431
1657
|
|
|
1432
|
-
export { type
|
|
1658
|
+
export { type BackgroundTaskCallback as $, type ActionResult as A, type ExtensionContext as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SettingsAPI as F, type GetModelsOptions as G, type ProvidersAPI as H, type ToolsAPI as I, type ActionsAPI as J, type EventsAPI as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type SchedulerAPI as O, type PanelDefinition as P, type SchedulerJobRequest as Q, type SchedulerSchedule as R, type SchedulerFirePayload as S, type ToolResult as T, type UserAPI as U, type UserProfile as V, type ChatAPI as W, type ChatInstructionMessage as X, type LogAPI as Y, type BackgroundWorkersAPI as Z, type BackgroundTaskConfig as _, type ChatOptions as a, type BackgroundTaskContext as a0, type BackgroundTaskHealth as a1, type BackgroundRestartPolicy as a2, type Query as a3, type QueryOptions as a4, type StorageAPI as a5, type SecretsAPI as a6, type StorageCollectionConfig as a7, type StorageContributions as a8, type AIProvider as a9, type IconButtonProps as aA, type PanelAction as aB, type PanelProps as aC, type ToggleProps as aD, type CollapsibleProps as aE, type PillVariant as aF, type PillProps as aG, type CheckboxProps as aH, type MarkdownProps as aI, type ModalProps as aJ, type ConditionalGroupProps as aK, type ExecutionContext as aL, type ToolCall as aa, type Tool as ab, type Action as ac, type ExtensionModule as ad, type AllowedCSSProperty as ae, type ExtensionComponentStyle as af, type ExtensionComponentData as ag, type ExtensionComponentIterator as ah, type ExtensionComponentChildren as ai, type ExtensionActionCall as aj, type ExtensionActionRef as ak, type ExtensionDataSource as al, type ExtensionPanelDefinition as am, type HeaderProps as an, type LabelProps as ao, type ParagraphProps as ap, type ButtonProps as aq, type TextInputProps as ar, type DateTimeInputProps as as, type SelectProps as at, type VerticalStackProps as au, type HorizontalStackProps as av, type GridProps as aw, type DividerProps as ax, type IconProps as ay, type IconButtonType 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 CommandDefinition as u, type ProviderConfigSchema as v, type ProviderConfigProperty as w, type ProviderConfigPropertyType as x, type ProviderConfigSelectOption as y, type ProviderConfigValidation as z };
|