@stina/extension-api 1.3.1 → 1.7.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-ZB7GJUPS.js → chunk-S3YP4QPF.js} +1 -1
- package/dist/{chunk-ZB7GJUPS.js.map → chunk-S3YP4QPF.js.map} +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +1 -1
- package/dist/runtime.cjs +53 -6
- 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 +54 -7
- package/dist/runtime.js.map +1 -1
- package/dist/schemas/index.cjs +34 -2
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +91 -5
- package/dist/schemas/index.d.ts +91 -5
- package/dist/schemas/index.js +30 -2
- package/dist/schemas/index.js.map +1 -1
- package/dist/{types.tools-C0GqXQlu.d.cts → types.tools-DcFBsfRV.d.cts} +223 -17
- package/dist/{types.tools-C0GqXQlu.d.ts → types.tools-DcFBsfRV.d.ts} +223 -17
- package/package.json +1 -1
- package/schema/extension-manifest.schema.json +40 -0
- package/src/background.test.ts +33 -0
- package/src/background.ts +9 -0
- package/src/index.ts +8 -0
- package/src/messages.ts +5 -0
- package/src/runtime/accountsApi.ts +26 -0
- package/src/runtime/executionContext.test.ts +113 -0
- package/src/runtime/executionContext.ts +28 -2
- package/src/runtime/index.ts +1 -0
- package/src/runtime.ts +38 -3
- package/src/schemas/accounts.schema.test.ts +58 -0
- package/src/schemas/contributions.schema.ts +48 -0
- package/src/schemas/index.ts +6 -0
- package/src/schemas/permissions.schema.ts +11 -1
- package/src/types.context.ts +111 -0
- package/src/types.contributions.ts +47 -0
- package/src/types.permissions.ts +15 -0
- package/src/types.provider.ts +51 -1
- package/src/types.tools.ts +29 -15
- package/src/types.ts +9 -0
package/dist/schemas/index.d.cts
CHANGED
|
@@ -64,7 +64,7 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
64
64
|
}>>;
|
|
65
65
|
platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["web", "electron", "tui"]>, "many">>;
|
|
66
66
|
main: z.ZodString;
|
|
67
|
-
permissions: z.ZodArray<z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>, "many">;
|
|
67
|
+
permissions: z.ZodArray<z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>, "many">;
|
|
68
68
|
contributes: z.ZodOptional<z.ZodObject<{
|
|
69
69
|
toolSettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
70
|
id: z.ZodString;
|
|
@@ -661,6 +661,19 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
661
661
|
indexes?: string[] | undefined;
|
|
662
662
|
}>;
|
|
663
663
|
}>>;
|
|
664
|
+
accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
665
|
+
provider: z.ZodEnum<["microsoft"]>;
|
|
666
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
667
|
+
reason: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
668
|
+
}, "strip", z.ZodTypeAny, {
|
|
669
|
+
provider: "microsoft";
|
|
670
|
+
scopes: string[];
|
|
671
|
+
reason?: string | Record<string, string> | undefined;
|
|
672
|
+
}, {
|
|
673
|
+
provider: "microsoft";
|
|
674
|
+
scopes: string[];
|
|
675
|
+
reason?: string | Record<string, string> | undefined;
|
|
676
|
+
}>, "many">>;
|
|
664
677
|
}, "strip", z.ZodTypeAny, {
|
|
665
678
|
tools?: {
|
|
666
679
|
description: string | Record<string, string>;
|
|
@@ -789,6 +802,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
789
802
|
indexes?: string[] | undefined;
|
|
790
803
|
}>;
|
|
791
804
|
} | undefined;
|
|
805
|
+
accounts?: {
|
|
806
|
+
provider: "microsoft";
|
|
807
|
+
scopes: string[];
|
|
808
|
+
reason?: string | Record<string, string> | undefined;
|
|
809
|
+
}[] | undefined;
|
|
792
810
|
}, {
|
|
793
811
|
tools?: {
|
|
794
812
|
description: string | Record<string, string>;
|
|
@@ -917,6 +935,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
917
935
|
indexes?: string[] | undefined;
|
|
918
936
|
}>;
|
|
919
937
|
} | undefined;
|
|
938
|
+
accounts?: {
|
|
939
|
+
provider: "microsoft";
|
|
940
|
+
scopes: string[];
|
|
941
|
+
reason?: string | Record<string, string> | undefined;
|
|
942
|
+
}[] | undefined;
|
|
920
943
|
}>>;
|
|
921
944
|
}, "strip", z.ZodTypeAny, {
|
|
922
945
|
description: string;
|
|
@@ -1064,6 +1087,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
1064
1087
|
indexes?: string[] | undefined;
|
|
1065
1088
|
}>;
|
|
1066
1089
|
} | undefined;
|
|
1090
|
+
accounts?: {
|
|
1091
|
+
provider: "microsoft";
|
|
1092
|
+
scopes: string[];
|
|
1093
|
+
reason?: string | Record<string, string> | undefined;
|
|
1094
|
+
}[] | undefined;
|
|
1067
1095
|
} | undefined;
|
|
1068
1096
|
}, {
|
|
1069
1097
|
description: string;
|
|
@@ -1211,6 +1239,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
1211
1239
|
indexes?: string[] | undefined;
|
|
1212
1240
|
}>;
|
|
1213
1241
|
} | undefined;
|
|
1242
|
+
accounts?: {
|
|
1243
|
+
provider: "microsoft";
|
|
1244
|
+
scopes: string[];
|
|
1245
|
+
reason?: string | Record<string, string> | undefined;
|
|
1246
|
+
}[] | undefined;
|
|
1214
1247
|
} | undefined;
|
|
1215
1248
|
}>;
|
|
1216
1249
|
type Platform = z.infer<typeof PlatformSchema>;
|
|
@@ -1228,7 +1261,7 @@ type ExtensionManifest = z.infer<typeof ExtensionManifestSchema>;
|
|
|
1228
1261
|
/**
|
|
1229
1262
|
* Valid exact permission values
|
|
1230
1263
|
*/
|
|
1231
|
-
declare const VALID_PERMISSIONS: readonly ["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"];
|
|
1264
|
+
declare const VALID_PERMISSIONS: readonly ["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"];
|
|
1232
1265
|
/**
|
|
1233
1266
|
* Permission patterns for dynamic permissions (network with host/port)
|
|
1234
1267
|
*/
|
|
@@ -1244,7 +1277,7 @@ declare const StoragePermissionSchema: z.ZodEnum<["storage.collections", "secret
|
|
|
1244
1277
|
/**
|
|
1245
1278
|
* User data permission schema
|
|
1246
1279
|
*/
|
|
1247
|
-
declare const UserDataPermissionSchema: z.ZodEnum<["user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read"]>;
|
|
1280
|
+
declare const UserDataPermissionSchema: z.ZodEnum<["user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use"]>;
|
|
1248
1281
|
/**
|
|
1249
1282
|
* Capability permission schema
|
|
1250
1283
|
*/
|
|
@@ -1257,7 +1290,7 @@ declare const SystemPermissionSchema: z.ZodEnum<["files.read", "files.write", "c
|
|
|
1257
1290
|
* Combined permission schema - validates against all permission types
|
|
1258
1291
|
* Uses z.union with z.enum and z.string().regex() for better JSON Schema generation
|
|
1259
1292
|
*/
|
|
1260
|
-
declare const PermissionSchema: z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>;
|
|
1293
|
+
declare const PermissionSchema: z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>;
|
|
1261
1294
|
/**
|
|
1262
1295
|
* Check if a permission string is valid
|
|
1263
1296
|
*/
|
|
@@ -2472,6 +2505,34 @@ declare const PromptContributionSchema: z.ZodObject<{
|
|
|
2472
2505
|
section?: "system" | "behavior" | "tools" | undefined;
|
|
2473
2506
|
i18n?: Record<string, string> | undefined;
|
|
2474
2507
|
}>;
|
|
2508
|
+
/**
|
|
2509
|
+
* A Microsoft Graph delegated permission name: `Mail.Read`, `Calendars.ReadWrite`.
|
|
2510
|
+
*
|
|
2511
|
+
* Bare names only. A full URI would name some other resource, and Microsoft hands
|
|
2512
|
+
* out tokens for one resource at a time - a manifest mixing Graph with, say,
|
|
2513
|
+
* `https://outlook.office.com/IMAP.AccessAsUser.All` would make the combined
|
|
2514
|
+
* sign-in fail for every extension, not just the one that asked.
|
|
2515
|
+
*/
|
|
2516
|
+
declare const GRAPH_SCOPE_PATTERN: RegExp;
|
|
2517
|
+
/**
|
|
2518
|
+
* Scopes the host always asks for and therefore does not accept from a manifest:
|
|
2519
|
+
* a declared one would be redundant at best.
|
|
2520
|
+
*/
|
|
2521
|
+
declare const HOST_ACCOUNT_SCOPES: readonly ["offline_access", "User.Read", "openid", "profile", "email"];
|
|
2522
|
+
declare const AccountProviderSchema: z.ZodEnum<["microsoft"]>;
|
|
2523
|
+
declare const AccountContributionSchema: z.ZodObject<{
|
|
2524
|
+
provider: z.ZodEnum<["microsoft"]>;
|
|
2525
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
2526
|
+
reason: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
2527
|
+
}, "strip", z.ZodTypeAny, {
|
|
2528
|
+
provider: "microsoft";
|
|
2529
|
+
scopes: string[];
|
|
2530
|
+
reason?: string | Record<string, string> | undefined;
|
|
2531
|
+
}, {
|
|
2532
|
+
provider: "microsoft";
|
|
2533
|
+
scopes: string[];
|
|
2534
|
+
reason?: string | Record<string, string> | undefined;
|
|
2535
|
+
}>;
|
|
2475
2536
|
/**
|
|
2476
2537
|
* Extension contributions
|
|
2477
2538
|
*/
|
|
@@ -3071,6 +3132,19 @@ declare const ExtensionContributionsSchema: z.ZodObject<{
|
|
|
3071
3132
|
indexes?: string[] | undefined;
|
|
3072
3133
|
}>;
|
|
3073
3134
|
}>>;
|
|
3135
|
+
accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3136
|
+
provider: z.ZodEnum<["microsoft"]>;
|
|
3137
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
3138
|
+
reason: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
3139
|
+
}, "strip", z.ZodTypeAny, {
|
|
3140
|
+
provider: "microsoft";
|
|
3141
|
+
scopes: string[];
|
|
3142
|
+
reason?: string | Record<string, string> | undefined;
|
|
3143
|
+
}, {
|
|
3144
|
+
provider: "microsoft";
|
|
3145
|
+
scopes: string[];
|
|
3146
|
+
reason?: string | Record<string, string> | undefined;
|
|
3147
|
+
}>, "many">>;
|
|
3074
3148
|
}, "strip", z.ZodTypeAny, {
|
|
3075
3149
|
tools?: {
|
|
3076
3150
|
description: string | Record<string, string>;
|
|
@@ -3199,6 +3273,11 @@ declare const ExtensionContributionsSchema: z.ZodObject<{
|
|
|
3199
3273
|
indexes?: string[] | undefined;
|
|
3200
3274
|
}>;
|
|
3201
3275
|
} | undefined;
|
|
3276
|
+
accounts?: {
|
|
3277
|
+
provider: "microsoft";
|
|
3278
|
+
scopes: string[];
|
|
3279
|
+
reason?: string | Record<string, string> | undefined;
|
|
3280
|
+
}[] | undefined;
|
|
3202
3281
|
}, {
|
|
3203
3282
|
tools?: {
|
|
3204
3283
|
description: string | Record<string, string>;
|
|
@@ -3327,6 +3406,11 @@ declare const ExtensionContributionsSchema: z.ZodObject<{
|
|
|
3327
3406
|
indexes?: string[] | undefined;
|
|
3328
3407
|
}>;
|
|
3329
3408
|
} | undefined;
|
|
3409
|
+
accounts?: {
|
|
3410
|
+
provider: "microsoft";
|
|
3411
|
+
scopes: string[];
|
|
3412
|
+
reason?: string | Record<string, string> | undefined;
|
|
3413
|
+
}[] | undefined;
|
|
3330
3414
|
}>;
|
|
3331
3415
|
type StatusCardDefinition = z.infer<typeof StatusCardDefinitionSchema>;
|
|
3332
3416
|
type LocalizedString = z.infer<typeof LocalizedStringSchema>;
|
|
@@ -3348,6 +3432,8 @@ type ToolDefinition = z.infer<typeof ToolDefinitionSchema>;
|
|
|
3348
3432
|
type CommandDefinition = z.infer<typeof CommandDefinitionSchema>;
|
|
3349
3433
|
type PromptSection = z.infer<typeof PromptSectionSchema>;
|
|
3350
3434
|
type PromptContribution = z.infer<typeof PromptContributionSchema>;
|
|
3435
|
+
type AccountProvider = z.infer<typeof AccountProviderSchema>;
|
|
3436
|
+
type AccountContribution = z.infer<typeof AccountContributionSchema>;
|
|
3351
3437
|
type ExtensionContributions = z.infer<typeof ExtensionContributionsSchema>;
|
|
3352
3438
|
|
|
3353
3439
|
/**
|
|
@@ -6029,4 +6115,4 @@ declare function validateChatCard(card: unknown): ChatCardValidation;
|
|
|
6029
6115
|
*/
|
|
6030
6116
|
declare function describeChatCardProfile(): string;
|
|
6031
6117
|
|
|
6032
|
-
export { type AllowedCSSProperty, AllowedCSSPropertySchema, type Author, AuthorSchema, type ButtonProps, ButtonPropsSchema, CHAT_CARD_COMPONENTS, CHAT_CARD_PROPS, CalendarEventPropsSchema, CalendarEventStatusSchema, type CapabilityPermission, CapabilityPermissionSchema, ChartKindSchema, ChartPropsSchema, ChartSeriesSchema, type ChatCardComponent, ChatCardComponentSchema, ChatCardSchema, type ChatCardValidation, type CheckboxProps, CheckboxPropsSchema, type ClockProps, ClockPropsSchema, type CollapsibleProps, CollapsiblePropsSchema, type CommandDefinition, CommandDefinitionSchema, type ConditionalGroupProps, ConditionalGroupPropsSchema, type DateTimeInputProps, DateTimeInputPropsSchema, type DividerProps, DividerPropsSchema, type Engines, EnginesSchema, type ExtensionActionCall, ExtensionActionCallSchema, type ExtensionActionRef, ExtensionActionRefSchema, type ExtensionComponentChildren, ExtensionComponentChildrenSchema, type ExtensionComponentData, ExtensionComponentDataSchema, type ExtensionComponentIterator, ExtensionComponentIteratorSchema, type ExtensionComponentStyle, ExtensionComponentStyleSchema, type ExtensionContributions, ExtensionContributionsSchema, type ExtensionDataSource, ExtensionDataSourceSchema, type ExtensionManifest, ExtensionManifestSchema, type FrameProps, FramePropsSchema, type FrameVariant, FrameVariantSchema, type GridProps, GridPropsSchema, type HeaderProps, HeaderPropsSchema, type HorizontalStackProps, HorizontalStackPropsSchema, type IconButtonProps, IconButtonPropsSchema, type IconButtonType, IconButtonTypeSchema, type IconPickerProps, IconPickerPropsSchema, type IconProps, IconPropsSchema, KeyValueListPropsSchema, KeyValueRowSchema, type LabelProps, LabelPropsSchema, type ListProps, ListPropsSchema, type LocalizedString, LocalizedStringSchema, type MarkdownProps, MarkdownPropsSchema, type ModalProps, ModalPropsSchema, type NetworkPermission, NetworkPermissionSchema, NotePropsSchema, NoteVariantSchema, PERMISSION_PATTERNS, type PanelAction, type PanelActionDataSource, PanelActionDataSourceSchema, PanelActionSchema, type PanelComponentView, PanelComponentViewSchema, type PanelDefinition, PanelDefinitionSchema, type PanelProps, PanelPropsSchema, type PanelUnknownView, PanelUnknownViewSchema, type PanelView, PanelViewSchema, type ParagraphProps, ParagraphPropsSchema, type Permission, PermissionSchema, type PillProps, PillPropsSchema, type PillVariant, PillVariantSchema, type Platform, PlatformSchema, ProgressBarPropsSchema, ProgressColorSchema, ProgressShapeSchema, type PromptContribution, PromptContributionSchema, type PromptSection, PromptSectionSchema, type ProviderConfigView, ProviderConfigViewSchema, type ProviderDefinition, ProviderDefinitionSchema, type SelectProps, SelectPropsSchema, StatTilePropsSchema, StatTrendSchema, type StatusCardDefinition, StatusCardDefinitionSchema, type StoragePermission, StoragePermissionSchema, type SystemPermission, SystemPermissionSchema, type TextInputProps, TextInputPropsSchema, type TextPreviewProps, TextPreviewPropsSchema, TimelineEntrySchema, TimelinePropsSchema, TimelineVariantSchema, type ToggleProps, TogglePropsSchema, type ToolDefinition, ToolDefinitionSchema, type ToolSettingsActionDataSource, ToolSettingsActionDataSourceSchema, type ToolSettingsComponentView, ToolSettingsComponentViewSchema, type ToolSettingsListGroupBy, ToolSettingsListGroupBySchema, type ToolSettingsListMapping, ToolSettingsListMappingSchema, type ToolSettingsListView, ToolSettingsListViewSchema, type ToolSettingsView, type ToolSettingsViewDefinition, ToolSettingsViewDefinitionSchema, ToolSettingsViewSchema, type UserDataPermission, UserDataPermissionSchema, VALID_PERMISSIONS, type VerticalStackProps, VerticalStackPropsSchema, WeatherConditionSchema, WeatherForecastPropsSchema, WeatherForecastStepSchema, WeatherNowPropsSchema, WeatherWindSchema, describeChatCardProfile, isValidPermission, validateChatCard };
|
|
6118
|
+
export { type AccountContribution, AccountContributionSchema, type AccountProvider, AccountProviderSchema, type AllowedCSSProperty, AllowedCSSPropertySchema, type Author, AuthorSchema, type ButtonProps, ButtonPropsSchema, CHAT_CARD_COMPONENTS, CHAT_CARD_PROPS, CalendarEventPropsSchema, CalendarEventStatusSchema, type CapabilityPermission, CapabilityPermissionSchema, ChartKindSchema, ChartPropsSchema, ChartSeriesSchema, type ChatCardComponent, ChatCardComponentSchema, ChatCardSchema, type ChatCardValidation, type CheckboxProps, CheckboxPropsSchema, type ClockProps, ClockPropsSchema, type CollapsibleProps, CollapsiblePropsSchema, type CommandDefinition, CommandDefinitionSchema, type ConditionalGroupProps, ConditionalGroupPropsSchema, type DateTimeInputProps, DateTimeInputPropsSchema, type DividerProps, DividerPropsSchema, type Engines, EnginesSchema, type ExtensionActionCall, ExtensionActionCallSchema, type ExtensionActionRef, ExtensionActionRefSchema, type ExtensionComponentChildren, ExtensionComponentChildrenSchema, type ExtensionComponentData, ExtensionComponentDataSchema, type ExtensionComponentIterator, ExtensionComponentIteratorSchema, type ExtensionComponentStyle, ExtensionComponentStyleSchema, type ExtensionContributions, ExtensionContributionsSchema, type ExtensionDataSource, ExtensionDataSourceSchema, type ExtensionManifest, ExtensionManifestSchema, type FrameProps, FramePropsSchema, type FrameVariant, FrameVariantSchema, GRAPH_SCOPE_PATTERN, type GridProps, GridPropsSchema, HOST_ACCOUNT_SCOPES, type HeaderProps, HeaderPropsSchema, type HorizontalStackProps, HorizontalStackPropsSchema, type IconButtonProps, IconButtonPropsSchema, type IconButtonType, IconButtonTypeSchema, type IconPickerProps, IconPickerPropsSchema, type IconProps, IconPropsSchema, KeyValueListPropsSchema, KeyValueRowSchema, type LabelProps, LabelPropsSchema, type ListProps, ListPropsSchema, type LocalizedString, LocalizedStringSchema, type MarkdownProps, MarkdownPropsSchema, type ModalProps, ModalPropsSchema, type NetworkPermission, NetworkPermissionSchema, NotePropsSchema, NoteVariantSchema, PERMISSION_PATTERNS, type PanelAction, type PanelActionDataSource, PanelActionDataSourceSchema, PanelActionSchema, type PanelComponentView, PanelComponentViewSchema, type PanelDefinition, PanelDefinitionSchema, type PanelProps, PanelPropsSchema, type PanelUnknownView, PanelUnknownViewSchema, type PanelView, PanelViewSchema, type ParagraphProps, ParagraphPropsSchema, type Permission, PermissionSchema, type PillProps, PillPropsSchema, type PillVariant, PillVariantSchema, type Platform, PlatformSchema, ProgressBarPropsSchema, ProgressColorSchema, ProgressShapeSchema, type PromptContribution, PromptContributionSchema, type PromptSection, PromptSectionSchema, type ProviderConfigView, ProviderConfigViewSchema, type ProviderDefinition, ProviderDefinitionSchema, type SelectProps, SelectPropsSchema, StatTilePropsSchema, StatTrendSchema, type StatusCardDefinition, StatusCardDefinitionSchema, type StoragePermission, StoragePermissionSchema, type SystemPermission, SystemPermissionSchema, type TextInputProps, TextInputPropsSchema, type TextPreviewProps, TextPreviewPropsSchema, TimelineEntrySchema, TimelinePropsSchema, TimelineVariantSchema, type ToggleProps, TogglePropsSchema, type ToolDefinition, ToolDefinitionSchema, type ToolSettingsActionDataSource, ToolSettingsActionDataSourceSchema, type ToolSettingsComponentView, ToolSettingsComponentViewSchema, type ToolSettingsListGroupBy, ToolSettingsListGroupBySchema, type ToolSettingsListMapping, ToolSettingsListMappingSchema, type ToolSettingsListView, ToolSettingsListViewSchema, type ToolSettingsView, type ToolSettingsViewDefinition, ToolSettingsViewDefinitionSchema, ToolSettingsViewSchema, type UserDataPermission, UserDataPermissionSchema, VALID_PERMISSIONS, type VerticalStackProps, VerticalStackPropsSchema, WeatherConditionSchema, WeatherForecastPropsSchema, WeatherForecastStepSchema, WeatherNowPropsSchema, WeatherWindSchema, describeChatCardProfile, isValidPermission, validateChatCard };
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
64
64
|
}>>;
|
|
65
65
|
platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["web", "electron", "tui"]>, "many">>;
|
|
66
66
|
main: z.ZodString;
|
|
67
|
-
permissions: z.ZodArray<z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>, "many">;
|
|
67
|
+
permissions: z.ZodArray<z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>, "many">;
|
|
68
68
|
contributes: z.ZodOptional<z.ZodObject<{
|
|
69
69
|
toolSettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
70
|
id: z.ZodString;
|
|
@@ -661,6 +661,19 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
661
661
|
indexes?: string[] | undefined;
|
|
662
662
|
}>;
|
|
663
663
|
}>>;
|
|
664
|
+
accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
665
|
+
provider: z.ZodEnum<["microsoft"]>;
|
|
666
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
667
|
+
reason: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
668
|
+
}, "strip", z.ZodTypeAny, {
|
|
669
|
+
provider: "microsoft";
|
|
670
|
+
scopes: string[];
|
|
671
|
+
reason?: string | Record<string, string> | undefined;
|
|
672
|
+
}, {
|
|
673
|
+
provider: "microsoft";
|
|
674
|
+
scopes: string[];
|
|
675
|
+
reason?: string | Record<string, string> | undefined;
|
|
676
|
+
}>, "many">>;
|
|
664
677
|
}, "strip", z.ZodTypeAny, {
|
|
665
678
|
tools?: {
|
|
666
679
|
description: string | Record<string, string>;
|
|
@@ -789,6 +802,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
789
802
|
indexes?: string[] | undefined;
|
|
790
803
|
}>;
|
|
791
804
|
} | undefined;
|
|
805
|
+
accounts?: {
|
|
806
|
+
provider: "microsoft";
|
|
807
|
+
scopes: string[];
|
|
808
|
+
reason?: string | Record<string, string> | undefined;
|
|
809
|
+
}[] | undefined;
|
|
792
810
|
}, {
|
|
793
811
|
tools?: {
|
|
794
812
|
description: string | Record<string, string>;
|
|
@@ -917,6 +935,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
917
935
|
indexes?: string[] | undefined;
|
|
918
936
|
}>;
|
|
919
937
|
} | undefined;
|
|
938
|
+
accounts?: {
|
|
939
|
+
provider: "microsoft";
|
|
940
|
+
scopes: string[];
|
|
941
|
+
reason?: string | Record<string, string> | undefined;
|
|
942
|
+
}[] | undefined;
|
|
920
943
|
}>>;
|
|
921
944
|
}, "strip", z.ZodTypeAny, {
|
|
922
945
|
description: string;
|
|
@@ -1064,6 +1087,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
1064
1087
|
indexes?: string[] | undefined;
|
|
1065
1088
|
}>;
|
|
1066
1089
|
} | undefined;
|
|
1090
|
+
accounts?: {
|
|
1091
|
+
provider: "microsoft";
|
|
1092
|
+
scopes: string[];
|
|
1093
|
+
reason?: string | Record<string, string> | undefined;
|
|
1094
|
+
}[] | undefined;
|
|
1067
1095
|
} | undefined;
|
|
1068
1096
|
}, {
|
|
1069
1097
|
description: string;
|
|
@@ -1211,6 +1239,11 @@ declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
1211
1239
|
indexes?: string[] | undefined;
|
|
1212
1240
|
}>;
|
|
1213
1241
|
} | undefined;
|
|
1242
|
+
accounts?: {
|
|
1243
|
+
provider: "microsoft";
|
|
1244
|
+
scopes: string[];
|
|
1245
|
+
reason?: string | Record<string, string> | undefined;
|
|
1246
|
+
}[] | undefined;
|
|
1214
1247
|
} | undefined;
|
|
1215
1248
|
}>;
|
|
1216
1249
|
type Platform = z.infer<typeof PlatformSchema>;
|
|
@@ -1228,7 +1261,7 @@ type ExtensionManifest = z.infer<typeof ExtensionManifestSchema>;
|
|
|
1228
1261
|
/**
|
|
1229
1262
|
* Valid exact permission values
|
|
1230
1263
|
*/
|
|
1231
|
-
declare const VALID_PERMISSIONS: readonly ["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"];
|
|
1264
|
+
declare const VALID_PERMISSIONS: readonly ["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"];
|
|
1232
1265
|
/**
|
|
1233
1266
|
* Permission patterns for dynamic permissions (network with host/port)
|
|
1234
1267
|
*/
|
|
@@ -1244,7 +1277,7 @@ declare const StoragePermissionSchema: z.ZodEnum<["storage.collections", "secret
|
|
|
1244
1277
|
/**
|
|
1245
1278
|
* User data permission schema
|
|
1246
1279
|
*/
|
|
1247
|
-
declare const UserDataPermissionSchema: z.ZodEnum<["user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read"]>;
|
|
1280
|
+
declare const UserDataPermissionSchema: z.ZodEnum<["user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use"]>;
|
|
1248
1281
|
/**
|
|
1249
1282
|
* Capability permission schema
|
|
1250
1283
|
*/
|
|
@@ -1257,7 +1290,7 @@ declare const SystemPermissionSchema: z.ZodEnum<["files.read", "files.write", "c
|
|
|
1257
1290
|
* Combined permission schema - validates against all permission types
|
|
1258
1291
|
* Uses z.union with z.enum and z.string().regex() for better JSON Schema generation
|
|
1259
1292
|
*/
|
|
1260
|
-
declare const PermissionSchema: z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>;
|
|
1293
|
+
declare const PermissionSchema: z.ZodUnion<[z.ZodEnum<["network:*", "network:localhost", "storage.collections", "secrets.manage", "user.profile.read", "user.list", "user.location.read", "chat.history.read", "chat.current.read", "attachments.read", "accounts.use", "chat.message.write", "provider.register", "tools.register", "tools.list", "tools.execute", "actions.register", "settings.register", "commands.register", "panels.register", "statusCards.register", "events.emit", "scheduler.register", "background.workers", "files.read", "files.write", "clipboard.read", "clipboard.write"]>, z.ZodString]>;
|
|
1261
1294
|
/**
|
|
1262
1295
|
* Check if a permission string is valid
|
|
1263
1296
|
*/
|
|
@@ -2472,6 +2505,34 @@ declare const PromptContributionSchema: z.ZodObject<{
|
|
|
2472
2505
|
section?: "system" | "behavior" | "tools" | undefined;
|
|
2473
2506
|
i18n?: Record<string, string> | undefined;
|
|
2474
2507
|
}>;
|
|
2508
|
+
/**
|
|
2509
|
+
* A Microsoft Graph delegated permission name: `Mail.Read`, `Calendars.ReadWrite`.
|
|
2510
|
+
*
|
|
2511
|
+
* Bare names only. A full URI would name some other resource, and Microsoft hands
|
|
2512
|
+
* out tokens for one resource at a time - a manifest mixing Graph with, say,
|
|
2513
|
+
* `https://outlook.office.com/IMAP.AccessAsUser.All` would make the combined
|
|
2514
|
+
* sign-in fail for every extension, not just the one that asked.
|
|
2515
|
+
*/
|
|
2516
|
+
declare const GRAPH_SCOPE_PATTERN: RegExp;
|
|
2517
|
+
/**
|
|
2518
|
+
* Scopes the host always asks for and therefore does not accept from a manifest:
|
|
2519
|
+
* a declared one would be redundant at best.
|
|
2520
|
+
*/
|
|
2521
|
+
declare const HOST_ACCOUNT_SCOPES: readonly ["offline_access", "User.Read", "openid", "profile", "email"];
|
|
2522
|
+
declare const AccountProviderSchema: z.ZodEnum<["microsoft"]>;
|
|
2523
|
+
declare const AccountContributionSchema: z.ZodObject<{
|
|
2524
|
+
provider: z.ZodEnum<["microsoft"]>;
|
|
2525
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
2526
|
+
reason: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
2527
|
+
}, "strip", z.ZodTypeAny, {
|
|
2528
|
+
provider: "microsoft";
|
|
2529
|
+
scopes: string[];
|
|
2530
|
+
reason?: string | Record<string, string> | undefined;
|
|
2531
|
+
}, {
|
|
2532
|
+
provider: "microsoft";
|
|
2533
|
+
scopes: string[];
|
|
2534
|
+
reason?: string | Record<string, string> | undefined;
|
|
2535
|
+
}>;
|
|
2475
2536
|
/**
|
|
2476
2537
|
* Extension contributions
|
|
2477
2538
|
*/
|
|
@@ -3071,6 +3132,19 @@ declare const ExtensionContributionsSchema: z.ZodObject<{
|
|
|
3071
3132
|
indexes?: string[] | undefined;
|
|
3072
3133
|
}>;
|
|
3073
3134
|
}>>;
|
|
3135
|
+
accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3136
|
+
provider: z.ZodEnum<["microsoft"]>;
|
|
3137
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
3138
|
+
reason: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
3139
|
+
}, "strip", z.ZodTypeAny, {
|
|
3140
|
+
provider: "microsoft";
|
|
3141
|
+
scopes: string[];
|
|
3142
|
+
reason?: string | Record<string, string> | undefined;
|
|
3143
|
+
}, {
|
|
3144
|
+
provider: "microsoft";
|
|
3145
|
+
scopes: string[];
|
|
3146
|
+
reason?: string | Record<string, string> | undefined;
|
|
3147
|
+
}>, "many">>;
|
|
3074
3148
|
}, "strip", z.ZodTypeAny, {
|
|
3075
3149
|
tools?: {
|
|
3076
3150
|
description: string | Record<string, string>;
|
|
@@ -3199,6 +3273,11 @@ declare const ExtensionContributionsSchema: z.ZodObject<{
|
|
|
3199
3273
|
indexes?: string[] | undefined;
|
|
3200
3274
|
}>;
|
|
3201
3275
|
} | undefined;
|
|
3276
|
+
accounts?: {
|
|
3277
|
+
provider: "microsoft";
|
|
3278
|
+
scopes: string[];
|
|
3279
|
+
reason?: string | Record<string, string> | undefined;
|
|
3280
|
+
}[] | undefined;
|
|
3202
3281
|
}, {
|
|
3203
3282
|
tools?: {
|
|
3204
3283
|
description: string | Record<string, string>;
|
|
@@ -3327,6 +3406,11 @@ declare const ExtensionContributionsSchema: z.ZodObject<{
|
|
|
3327
3406
|
indexes?: string[] | undefined;
|
|
3328
3407
|
}>;
|
|
3329
3408
|
} | undefined;
|
|
3409
|
+
accounts?: {
|
|
3410
|
+
provider: "microsoft";
|
|
3411
|
+
scopes: string[];
|
|
3412
|
+
reason?: string | Record<string, string> | undefined;
|
|
3413
|
+
}[] | undefined;
|
|
3330
3414
|
}>;
|
|
3331
3415
|
type StatusCardDefinition = z.infer<typeof StatusCardDefinitionSchema>;
|
|
3332
3416
|
type LocalizedString = z.infer<typeof LocalizedStringSchema>;
|
|
@@ -3348,6 +3432,8 @@ type ToolDefinition = z.infer<typeof ToolDefinitionSchema>;
|
|
|
3348
3432
|
type CommandDefinition = z.infer<typeof CommandDefinitionSchema>;
|
|
3349
3433
|
type PromptSection = z.infer<typeof PromptSectionSchema>;
|
|
3350
3434
|
type PromptContribution = z.infer<typeof PromptContributionSchema>;
|
|
3435
|
+
type AccountProvider = z.infer<typeof AccountProviderSchema>;
|
|
3436
|
+
type AccountContribution = z.infer<typeof AccountContributionSchema>;
|
|
3351
3437
|
type ExtensionContributions = z.infer<typeof ExtensionContributionsSchema>;
|
|
3352
3438
|
|
|
3353
3439
|
/**
|
|
@@ -6029,4 +6115,4 @@ declare function validateChatCard(card: unknown): ChatCardValidation;
|
|
|
6029
6115
|
*/
|
|
6030
6116
|
declare function describeChatCardProfile(): string;
|
|
6031
6117
|
|
|
6032
|
-
export { type AllowedCSSProperty, AllowedCSSPropertySchema, type Author, AuthorSchema, type ButtonProps, ButtonPropsSchema, CHAT_CARD_COMPONENTS, CHAT_CARD_PROPS, CalendarEventPropsSchema, CalendarEventStatusSchema, type CapabilityPermission, CapabilityPermissionSchema, ChartKindSchema, ChartPropsSchema, ChartSeriesSchema, type ChatCardComponent, ChatCardComponentSchema, ChatCardSchema, type ChatCardValidation, type CheckboxProps, CheckboxPropsSchema, type ClockProps, ClockPropsSchema, type CollapsibleProps, CollapsiblePropsSchema, type CommandDefinition, CommandDefinitionSchema, type ConditionalGroupProps, ConditionalGroupPropsSchema, type DateTimeInputProps, DateTimeInputPropsSchema, type DividerProps, DividerPropsSchema, type Engines, EnginesSchema, type ExtensionActionCall, ExtensionActionCallSchema, type ExtensionActionRef, ExtensionActionRefSchema, type ExtensionComponentChildren, ExtensionComponentChildrenSchema, type ExtensionComponentData, ExtensionComponentDataSchema, type ExtensionComponentIterator, ExtensionComponentIteratorSchema, type ExtensionComponentStyle, ExtensionComponentStyleSchema, type ExtensionContributions, ExtensionContributionsSchema, type ExtensionDataSource, ExtensionDataSourceSchema, type ExtensionManifest, ExtensionManifestSchema, type FrameProps, FramePropsSchema, type FrameVariant, FrameVariantSchema, type GridProps, GridPropsSchema, type HeaderProps, HeaderPropsSchema, type HorizontalStackProps, HorizontalStackPropsSchema, type IconButtonProps, IconButtonPropsSchema, type IconButtonType, IconButtonTypeSchema, type IconPickerProps, IconPickerPropsSchema, type IconProps, IconPropsSchema, KeyValueListPropsSchema, KeyValueRowSchema, type LabelProps, LabelPropsSchema, type ListProps, ListPropsSchema, type LocalizedString, LocalizedStringSchema, type MarkdownProps, MarkdownPropsSchema, type ModalProps, ModalPropsSchema, type NetworkPermission, NetworkPermissionSchema, NotePropsSchema, NoteVariantSchema, PERMISSION_PATTERNS, type PanelAction, type PanelActionDataSource, PanelActionDataSourceSchema, PanelActionSchema, type PanelComponentView, PanelComponentViewSchema, type PanelDefinition, PanelDefinitionSchema, type PanelProps, PanelPropsSchema, type PanelUnknownView, PanelUnknownViewSchema, type PanelView, PanelViewSchema, type ParagraphProps, ParagraphPropsSchema, type Permission, PermissionSchema, type PillProps, PillPropsSchema, type PillVariant, PillVariantSchema, type Platform, PlatformSchema, ProgressBarPropsSchema, ProgressColorSchema, ProgressShapeSchema, type PromptContribution, PromptContributionSchema, type PromptSection, PromptSectionSchema, type ProviderConfigView, ProviderConfigViewSchema, type ProviderDefinition, ProviderDefinitionSchema, type SelectProps, SelectPropsSchema, StatTilePropsSchema, StatTrendSchema, type StatusCardDefinition, StatusCardDefinitionSchema, type StoragePermission, StoragePermissionSchema, type SystemPermission, SystemPermissionSchema, type TextInputProps, TextInputPropsSchema, type TextPreviewProps, TextPreviewPropsSchema, TimelineEntrySchema, TimelinePropsSchema, TimelineVariantSchema, type ToggleProps, TogglePropsSchema, type ToolDefinition, ToolDefinitionSchema, type ToolSettingsActionDataSource, ToolSettingsActionDataSourceSchema, type ToolSettingsComponentView, ToolSettingsComponentViewSchema, type ToolSettingsListGroupBy, ToolSettingsListGroupBySchema, type ToolSettingsListMapping, ToolSettingsListMappingSchema, type ToolSettingsListView, ToolSettingsListViewSchema, type ToolSettingsView, type ToolSettingsViewDefinition, ToolSettingsViewDefinitionSchema, ToolSettingsViewSchema, type UserDataPermission, UserDataPermissionSchema, VALID_PERMISSIONS, type VerticalStackProps, VerticalStackPropsSchema, WeatherConditionSchema, WeatherForecastPropsSchema, WeatherForecastStepSchema, WeatherNowPropsSchema, WeatherWindSchema, describeChatCardProfile, isValidPermission, validateChatCard };
|
|
6118
|
+
export { type AccountContribution, AccountContributionSchema, type AccountProvider, AccountProviderSchema, type AllowedCSSProperty, AllowedCSSPropertySchema, type Author, AuthorSchema, type ButtonProps, ButtonPropsSchema, CHAT_CARD_COMPONENTS, CHAT_CARD_PROPS, CalendarEventPropsSchema, CalendarEventStatusSchema, type CapabilityPermission, CapabilityPermissionSchema, ChartKindSchema, ChartPropsSchema, ChartSeriesSchema, type ChatCardComponent, ChatCardComponentSchema, ChatCardSchema, type ChatCardValidation, type CheckboxProps, CheckboxPropsSchema, type ClockProps, ClockPropsSchema, type CollapsibleProps, CollapsiblePropsSchema, type CommandDefinition, CommandDefinitionSchema, type ConditionalGroupProps, ConditionalGroupPropsSchema, type DateTimeInputProps, DateTimeInputPropsSchema, type DividerProps, DividerPropsSchema, type Engines, EnginesSchema, type ExtensionActionCall, ExtensionActionCallSchema, type ExtensionActionRef, ExtensionActionRefSchema, type ExtensionComponentChildren, ExtensionComponentChildrenSchema, type ExtensionComponentData, ExtensionComponentDataSchema, type ExtensionComponentIterator, ExtensionComponentIteratorSchema, type ExtensionComponentStyle, ExtensionComponentStyleSchema, type ExtensionContributions, ExtensionContributionsSchema, type ExtensionDataSource, ExtensionDataSourceSchema, type ExtensionManifest, ExtensionManifestSchema, type FrameProps, FramePropsSchema, type FrameVariant, FrameVariantSchema, GRAPH_SCOPE_PATTERN, type GridProps, GridPropsSchema, HOST_ACCOUNT_SCOPES, type HeaderProps, HeaderPropsSchema, type HorizontalStackProps, HorizontalStackPropsSchema, type IconButtonProps, IconButtonPropsSchema, type IconButtonType, IconButtonTypeSchema, type IconPickerProps, IconPickerPropsSchema, type IconProps, IconPropsSchema, KeyValueListPropsSchema, KeyValueRowSchema, type LabelProps, LabelPropsSchema, type ListProps, ListPropsSchema, type LocalizedString, LocalizedStringSchema, type MarkdownProps, MarkdownPropsSchema, type ModalProps, ModalPropsSchema, type NetworkPermission, NetworkPermissionSchema, NotePropsSchema, NoteVariantSchema, PERMISSION_PATTERNS, type PanelAction, type PanelActionDataSource, PanelActionDataSourceSchema, PanelActionSchema, type PanelComponentView, PanelComponentViewSchema, type PanelDefinition, PanelDefinitionSchema, type PanelProps, PanelPropsSchema, type PanelUnknownView, PanelUnknownViewSchema, type PanelView, PanelViewSchema, type ParagraphProps, ParagraphPropsSchema, type Permission, PermissionSchema, type PillProps, PillPropsSchema, type PillVariant, PillVariantSchema, type Platform, PlatformSchema, ProgressBarPropsSchema, ProgressColorSchema, ProgressShapeSchema, type PromptContribution, PromptContributionSchema, type PromptSection, PromptSectionSchema, type ProviderConfigView, ProviderConfigViewSchema, type ProviderDefinition, ProviderDefinitionSchema, type SelectProps, SelectPropsSchema, StatTilePropsSchema, StatTrendSchema, type StatusCardDefinition, StatusCardDefinitionSchema, type StoragePermission, StoragePermissionSchema, type SystemPermission, SystemPermissionSchema, type TextInputProps, TextInputPropsSchema, type TextPreviewProps, TextPreviewPropsSchema, TimelineEntrySchema, TimelinePropsSchema, TimelineVariantSchema, type ToggleProps, TogglePropsSchema, type ToolDefinition, ToolDefinitionSchema, type ToolSettingsActionDataSource, ToolSettingsActionDataSourceSchema, type ToolSettingsComponentView, ToolSettingsComponentViewSchema, type ToolSettingsListGroupBy, ToolSettingsListGroupBySchema, type ToolSettingsListMapping, ToolSettingsListMappingSchema, type ToolSettingsListView, ToolSettingsListViewSchema, type ToolSettingsView, type ToolSettingsViewDefinition, ToolSettingsViewDefinitionSchema, ToolSettingsViewSchema, type UserDataPermission, UserDataPermissionSchema, VALID_PERMISSIONS, type VerticalStackProps, VerticalStackPropsSchema, WeatherConditionSchema, WeatherForecastPropsSchema, WeatherForecastStepSchema, WeatherNowPropsSchema, WeatherWindSchema, describeChatCardProfile, isValidPermission, validateChatCard };
|
package/dist/schemas/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var VALID_PERMISSIONS = [
|
|
|
15
15
|
"user.location.read",
|
|
16
16
|
"chat.history.read",
|
|
17
17
|
"chat.current.read",
|
|
18
|
+
"attachments.read",
|
|
19
|
+
"accounts.use",
|
|
18
20
|
"chat.message.write",
|
|
19
21
|
"provider.register",
|
|
20
22
|
"tools.register",
|
|
@@ -51,7 +53,15 @@ var NetworkPermissionSchema = z.string().refine(
|
|
|
51
53
|
{ message: "Invalid network permission format" }
|
|
52
54
|
).describe('Network access permission (e.g., "network:*", "network:localhost:11434")');
|
|
53
55
|
var StoragePermissionSchema = z.enum(["storage.collections", "secrets.manage"]).describe("Storage permission");
|
|
54
|
-
var UserDataPermissionSchema = z.enum([
|
|
56
|
+
var UserDataPermissionSchema = z.enum([
|
|
57
|
+
"user.profile.read",
|
|
58
|
+
"user.list",
|
|
59
|
+
"user.location.read",
|
|
60
|
+
"chat.history.read",
|
|
61
|
+
"chat.current.read",
|
|
62
|
+
"attachments.read",
|
|
63
|
+
"accounts.use"
|
|
64
|
+
]).describe("User data access permission");
|
|
55
65
|
var CapabilityPermissionSchema = z.enum([
|
|
56
66
|
"provider.register",
|
|
57
67
|
"tools.register",
|
|
@@ -672,6 +682,19 @@ var StorageCollectionConfigSchema = z3.object({
|
|
|
672
682
|
var StorageContributionsSchema = z3.object({
|
|
673
683
|
collections: z3.record(StorageCollectionConfigSchema).describe("Collection definitions")
|
|
674
684
|
}).describe("Storage contributions");
|
|
685
|
+
var GRAPH_SCOPE_PATTERN = /^[A-Za-z]+(\.[A-Za-z]+)+$/;
|
|
686
|
+
var HOST_ACCOUNT_SCOPES = ["offline_access", "User.Read", "openid", "profile", "email"];
|
|
687
|
+
var AccountProviderSchema = z3.enum(["microsoft"]).describe("External account provider");
|
|
688
|
+
var AccountContributionSchema = z3.object({
|
|
689
|
+
provider: AccountProviderSchema,
|
|
690
|
+
scopes: z3.array(
|
|
691
|
+
z3.string().regex(GRAPH_SCOPE_PATTERN, 'Must be a Microsoft Graph permission name, such as "Mail.Read"').refine(
|
|
692
|
+
(scope) => !HOST_ACCOUNT_SCOPES.some((hostScope) => hostScope.toLowerCase() === scope.toLowerCase()),
|
|
693
|
+
{ message: "Requested by the host already; leave it out" }
|
|
694
|
+
)
|
|
695
|
+
).min(1).describe("Microsoft Graph delegated permissions"),
|
|
696
|
+
reason: LocalizedStringSchema.optional().describe("Why the extension needs them")
|
|
697
|
+
}).describe("An external account the extension works through");
|
|
675
698
|
var ExtensionContributionsSchema = z3.object({
|
|
676
699
|
toolSettings: z3.array(ToolSettingsViewDefinitionSchema).optional().describe("Tool settings views"),
|
|
677
700
|
panels: z3.array(PanelDefinitionSchema).optional().describe("Right panel contributions"),
|
|
@@ -680,7 +703,8 @@ var ExtensionContributionsSchema = z3.object({
|
|
|
680
703
|
tools: z3.array(ToolDefinitionSchema).optional().describe("Tools for Stina to use"),
|
|
681
704
|
commands: z3.array(CommandDefinitionSchema).optional().describe("Slash commands"),
|
|
682
705
|
prompts: z3.array(PromptContributionSchema).optional().describe("Prompt contributions"),
|
|
683
|
-
storage: StorageContributionsSchema.optional().describe("Storage collection declarations")
|
|
706
|
+
storage: StorageContributionsSchema.optional().describe("Storage collection declarations"),
|
|
707
|
+
accounts: z3.array(AccountContributionSchema).optional().describe("External accounts the extension works through, signed in once in Stina's settings")
|
|
684
708
|
}).describe("What an extension can contribute to Stina");
|
|
685
709
|
|
|
686
710
|
// src/schemas/manifest.schema.ts
|
|
@@ -1099,6 +1123,8 @@ function describeChatCardProfile() {
|
|
|
1099
1123
|
}).join("\n");
|
|
1100
1124
|
}
|
|
1101
1125
|
export {
|
|
1126
|
+
AccountContributionSchema,
|
|
1127
|
+
AccountProviderSchema,
|
|
1102
1128
|
AllowedCSSPropertySchema,
|
|
1103
1129
|
AuthorSchema,
|
|
1104
1130
|
ButtonPropsSchema,
|
|
@@ -1131,7 +1157,9 @@ export {
|
|
|
1131
1157
|
ExtensionManifestSchema,
|
|
1132
1158
|
FramePropsSchema,
|
|
1133
1159
|
FrameVariantSchema,
|
|
1160
|
+
GRAPH_SCOPE_PATTERN,
|
|
1134
1161
|
GridPropsSchema,
|
|
1162
|
+
HOST_ACCOUNT_SCOPES,
|
|
1135
1163
|
HeaderPropsSchema,
|
|
1136
1164
|
HorizontalStackPropsSchema,
|
|
1137
1165
|
IconButtonPropsSchema,
|