@stina/extension-api 1.6.0 → 1.9.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.
Files changed (42) hide show
  1. package/dist/{chunk-3Q3YXWOH.js → chunk-S3YP4QPF.js} +1 -1
  2. package/dist/{chunk-3Q3YXWOH.js.map → chunk-S3YP4QPF.js.map} +1 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +12 -4
  5. package/dist/index.d.ts +12 -4
  6. package/dist/index.js +1 -1
  7. package/dist/runtime.cjs +24 -6
  8. package/dist/runtime.cjs.map +1 -1
  9. package/dist/runtime.d.cts +2 -2
  10. package/dist/runtime.d.ts +2 -2
  11. package/dist/runtime.js +25 -7
  12. package/dist/runtime.js.map +1 -1
  13. package/dist/schemas/index.cjs +36 -2
  14. package/dist/schemas/index.cjs.map +1 -1
  15. package/dist/schemas/index.d.cts +92 -6
  16. package/dist/schemas/index.d.ts +92 -6
  17. package/dist/schemas/index.js +32 -2
  18. package/dist/schemas/index.js.map +1 -1
  19. package/dist/{types.tools-R0xGhiBa.d.cts → types.tools-DcFBsfRV.d.cts} +105 -1
  20. package/dist/{types.tools-R0xGhiBa.d.ts → types.tools-DcFBsfRV.d.ts} +105 -1
  21. package/package.json +1 -1
  22. package/schema/extension-manifest.schema.json +39 -0
  23. package/src/background.test.ts +33 -0
  24. package/src/background.ts +9 -0
  25. package/src/index.ts +5 -0
  26. package/src/messages.ts +3 -0
  27. package/src/runtime/accountsApi.ts +26 -0
  28. package/src/runtime/executionContext.test.ts +46 -4
  29. package/src/runtime/executionContext.ts +10 -4
  30. package/src/runtime/index.ts +1 -0
  31. package/src/runtime.ts +15 -3
  32. package/src/schemas/accounts.schema.test.ts +58 -0
  33. package/src/schemas/card.schema.test.ts +24 -0
  34. package/src/schemas/card.schema.ts +13 -0
  35. package/src/schemas/contributions.schema.ts +48 -0
  36. package/src/schemas/index.ts +6 -0
  37. package/src/schemas/permissions.schema.ts +2 -0
  38. package/src/types.components.ts +27 -0
  39. package/src/types.context.ts +68 -0
  40. package/src/types.contributions.ts +47 -0
  41. package/src/types.permissions.ts +8 -0
  42. package/src/types.ts +6 -0
@@ -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", "attachments.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", "attachments.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", "attachments.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", "attachments.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
  /**
@@ -5975,7 +6061,7 @@ type ChatCardComponent = {
5975
6061
  [key: string]: unknown;
5976
6062
  };
5977
6063
  /** Every component name a card may use. Exported so the docs and the tool description stay in step. */
5978
- declare const CHAT_CARD_COMPONENTS: readonly ["VerticalStack", "HorizontalStack", "Grid", "Frame", "List", "Divider", "Header", "Label", "Paragraph", "Markdown", "Icon", "Pill", "WeatherNow", "WeatherForecast", "Chart", "StatTile", "ProgressBar", "KeyValueList", "Timeline", "Note", "CalendarEvent"];
6064
+ declare const CHAT_CARD_COMPONENTS: readonly ["VerticalStack", "HorizontalStack", "Grid", "Frame", "List", "Divider", "Header", "Label", "Paragraph", "Markdown", "Icon", "Pill", "WeatherNow", "WeatherForecast", "Chart", "StatTile", "ProgressBar", "KeyValueList", "Timeline", "Note", "Quote", "CalendarEvent"];
5979
6065
  /**
5980
6066
  * The properties each card component accepts, read off the schemas themselves.
5981
6067
  *
@@ -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 };
@@ -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", "attachments.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", "attachments.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", "attachments.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", "attachments.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
  /**
@@ -5975,7 +6061,7 @@ type ChatCardComponent = {
5975
6061
  [key: string]: unknown;
5976
6062
  };
5977
6063
  /** Every component name a card may use. Exported so the docs and the tool description stay in step. */
5978
- declare const CHAT_CARD_COMPONENTS: readonly ["VerticalStack", "HorizontalStack", "Grid", "Frame", "List", "Divider", "Header", "Label", "Paragraph", "Markdown", "Icon", "Pill", "WeatherNow", "WeatherForecast", "Chart", "StatTile", "ProgressBar", "KeyValueList", "Timeline", "Note", "CalendarEvent"];
6064
+ declare const CHAT_CARD_COMPONENTS: readonly ["VerticalStack", "HorizontalStack", "Grid", "Frame", "List", "Divider", "Header", "Label", "Paragraph", "Markdown", "Icon", "Pill", "WeatherNow", "WeatherForecast", "Chart", "StatTile", "ProgressBar", "KeyValueList", "Timeline", "Note", "Quote", "CalendarEvent"];
5979
6065
  /**
5980
6066
  * The properties each card component accepts, read off the schemas themselves.
5981
6067
  *
@@ -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 };
@@ -16,6 +16,7 @@ var VALID_PERMISSIONS = [
16
16
  "chat.history.read",
17
17
  "chat.current.read",
18
18
  "attachments.read",
19
+ "accounts.use",
19
20
  "chat.message.write",
20
21
  "provider.register",
21
22
  "tools.register",
@@ -58,7 +59,8 @@ var UserDataPermissionSchema = z.enum([
58
59
  "user.location.read",
59
60
  "chat.history.read",
60
61
  "chat.current.read",
61
- "attachments.read"
62
+ "attachments.read",
63
+ "accounts.use"
62
64
  ]).describe("User data access permission");
63
65
  var CapabilityPermissionSchema = z.enum([
64
66
  "provider.register",
@@ -680,6 +682,19 @@ var StorageCollectionConfigSchema = z3.object({
680
682
  var StorageContributionsSchema = z3.object({
681
683
  collections: z3.record(StorageCollectionConfigSchema).describe("Collection definitions")
682
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");
683
698
  var ExtensionContributionsSchema = z3.object({
684
699
  toolSettings: z3.array(ToolSettingsViewDefinitionSchema).optional().describe("Tool settings views"),
685
700
  panels: z3.array(PanelDefinitionSchema).optional().describe("Right panel contributions"),
@@ -688,7 +703,8 @@ var ExtensionContributionsSchema = z3.object({
688
703
  tools: z3.array(ToolDefinitionSchema).optional().describe("Tools for Stina to use"),
689
704
  commands: z3.array(CommandDefinitionSchema).optional().describe("Slash commands"),
690
705
  prompts: z3.array(PromptContributionSchema).optional().describe("Prompt contributions"),
691
- 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")
692
708
  }).describe("What an extension can contribute to Stina");
693
709
 
694
710
  // src/schemas/manifest.schema.ts
@@ -889,6 +905,14 @@ var NoteCardSchema = z5.object({
889
905
  variant: NoteVariantSchema.optional(),
890
906
  style
891
907
  }).strict();
908
+ var QuoteCardSchema = z5.object({
909
+ component: z5.literal("Quote"),
910
+ text: z5.string(),
911
+ source: z5.string().optional(),
912
+ context: z5.string().optional(),
913
+ footer: z5.string().optional(),
914
+ style
915
+ }).strict();
892
916
  var CalendarEventCardSchema = z5.object({
893
917
  component: z5.literal("CalendarEvent"),
894
918
  title: z5.string(),
@@ -925,6 +949,7 @@ var CHAT_CARD_COMPONENTS = [
925
949
  "KeyValueList",
926
950
  "Timeline",
927
951
  "Note",
952
+ "Quote",
928
953
  "CalendarEvent"
929
954
  ];
930
955
  var CARD_MEMBERS = [
@@ -948,6 +973,7 @@ var CARD_MEMBERS = [
948
973
  KeyValueListCardSchema,
949
974
  TimelineCardSchema,
950
975
  NoteCardSchema,
976
+ QuoteCardSchema,
951
977
  CalendarEventCardSchema
952
978
  ];
953
979
  var CHAT_CARD_PROPS = Object.freeze(
@@ -1107,6 +1133,8 @@ function describeChatCardProfile() {
1107
1133
  }).join("\n");
1108
1134
  }
1109
1135
  export {
1136
+ AccountContributionSchema,
1137
+ AccountProviderSchema,
1110
1138
  AllowedCSSPropertySchema,
1111
1139
  AuthorSchema,
1112
1140
  ButtonPropsSchema,
@@ -1139,7 +1167,9 @@ export {
1139
1167
  ExtensionManifestSchema,
1140
1168
  FramePropsSchema,
1141
1169
  FrameVariantSchema,
1170
+ GRAPH_SCOPE_PATTERN,
1142
1171
  GridPropsSchema,
1172
+ HOST_ACCOUNT_SCOPES,
1143
1173
  HeaderPropsSchema,
1144
1174
  HorizontalStackPropsSchema,
1145
1175
  IconButtonPropsSchema,