@epicdm/flowstate-extension-core 1.0.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.
@@ -0,0 +1,1972 @@
1
+ /**
2
+ * Comprehensive TypeScript types for VS Code extension package.json manifests.
3
+ *
4
+ * Covers the full VS Code Extension Manifest specification including all stable
5
+ * (GA) contribution points. Based on the VS Code Extension API documentation.
6
+ *
7
+ * @see https://code.visualstudio.com/api/references/extension-manifest
8
+ * @see https://code.visualstudio.com/api/references/contribution-points
9
+ */
10
+ /**
11
+ * A string that may be localized. When localized, it uses the `%key%` syntax
12
+ * in the manifest, resolving to a value in the `package.nls.json` file.
13
+ * In the resolved form it can be either a plain string or a structured object
14
+ * with both the localized value and the original key.
15
+ */
16
+ type LocalizedString = string | {
17
+ value: string;
18
+ original: string;
19
+ };
20
+ /**
21
+ * Icon definition supporting light/dark theme variants.
22
+ */
23
+ interface IconDefinition {
24
+ light: string;
25
+ dark: string;
26
+ }
27
+ /**
28
+ * Icon reference — either a single path string or a light/dark pair.
29
+ */
30
+ type IconReference = string | IconDefinition;
31
+ /**
32
+ * Valid extension categories in the VS Code marketplace.
33
+ */
34
+ type ExtensionCategory = 'Azure' | 'Data Science' | 'Debuggers' | 'Education' | 'Extension Packs' | 'Formatters' | 'Keymaps' | 'Language Packs' | 'Linters' | 'Machine Learning' | 'Notebooks' | 'Other' | 'Programming Languages' | 'SCM Providers' | 'Snippets' | 'Testing' | 'Themes' | 'Visualization';
35
+ /**
36
+ * Where an extension should run.
37
+ * - `'ui'` — runs in the local (UI) extension host
38
+ * - `'workspace'` — runs in the remote workspace extension host
39
+ */
40
+ type ExtensionKind = 'ui' | 'workspace';
41
+ /**
42
+ * Declares how an extension behaves in untrusted workspaces.
43
+ */
44
+ interface UntrustedWorkspaceCapability {
45
+ supported: boolean | 'limited';
46
+ description?: string;
47
+ restrictedConfigurations?: string[];
48
+ }
49
+ /**
50
+ * Declares how an extension behaves in virtual workspaces.
51
+ */
52
+ interface VirtualWorkspaceCapability {
53
+ supported: boolean | 'limited';
54
+ description?: string;
55
+ }
56
+ /**
57
+ * Extension capabilities declaration.
58
+ */
59
+ interface ExtensionCapabilities {
60
+ untrustedWorkspaces?: UntrustedWorkspaceCapability;
61
+ virtualWorkspaces?: VirtualWorkspaceCapability | boolean;
62
+ }
63
+ /**
64
+ * A badge to display on the marketplace page.
65
+ */
66
+ interface Badge {
67
+ url: string;
68
+ href: string;
69
+ description: string;
70
+ }
71
+ /**
72
+ * Repository reference in package.json format.
73
+ */
74
+ type RepositoryReference = string | {
75
+ type: string;
76
+ url: string;
77
+ directory?: string;
78
+ };
79
+ /**
80
+ * Bugs reference in package.json format.
81
+ */
82
+ type BugsReference = string | {
83
+ url?: string;
84
+ email?: string;
85
+ };
86
+ /**
87
+ * A command contribution.
88
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.commands
89
+ */
90
+ interface CommandContribution {
91
+ command: string;
92
+ title: LocalizedString;
93
+ category?: LocalizedString;
94
+ icon?: IconReference;
95
+ enablement?: string;
96
+ shortTitle?: LocalizedString;
97
+ }
98
+ /**
99
+ * A menu item contribution.
100
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.menus
101
+ */
102
+ interface MenuContribution {
103
+ command?: string;
104
+ submenu?: string;
105
+ alt?: string;
106
+ when?: string;
107
+ group?: string;
108
+ }
109
+ /**
110
+ * A submenu contribution.
111
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.submenus
112
+ */
113
+ interface SubmenuContribution {
114
+ id: string;
115
+ label: LocalizedString;
116
+ icon?: IconReference;
117
+ }
118
+ /**
119
+ * A keyboard shortcut contribution.
120
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.keybindings
121
+ */
122
+ interface KeybindingContribution {
123
+ command: string;
124
+ key?: string;
125
+ when?: string;
126
+ mac?: string;
127
+ linux?: string;
128
+ win?: string;
129
+ args?: unknown;
130
+ }
131
+ /**
132
+ * Language icon definition.
133
+ */
134
+ interface LanguageIcon {
135
+ light: string;
136
+ dark: string;
137
+ }
138
+ /**
139
+ * A language contribution.
140
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.languages
141
+ */
142
+ interface LanguageContribution {
143
+ id: string;
144
+ extensions?: string[];
145
+ filenames?: string[];
146
+ filenamePatterns?: string[];
147
+ firstLine?: string;
148
+ aliases?: string[];
149
+ mimetypes?: string[];
150
+ configuration?: string;
151
+ icon?: LanguageIcon;
152
+ }
153
+ /**
154
+ * A TextMate grammar contribution.
155
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.grammars
156
+ */
157
+ interface GrammarContribution {
158
+ language?: string;
159
+ scopeName: string;
160
+ path: string;
161
+ embeddedLanguages?: Record<string, string>;
162
+ tokenTypes?: Record<string, string>;
163
+ balancedBracketScopes?: string[];
164
+ unbalancedBracketScopes?: string[];
165
+ injectTo?: string[];
166
+ }
167
+ /**
168
+ * A snippet contribution.
169
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.snippets
170
+ */
171
+ interface SnippetContribution {
172
+ language?: string;
173
+ path: string;
174
+ }
175
+ /**
176
+ * Valid UI theme identifiers for color themes.
177
+ */
178
+ type UITheme = 'vs' | 'vs-dark' | 'hc-black' | 'hc-light';
179
+ /**
180
+ * A color theme contribution.
181
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.themes
182
+ */
183
+ interface ThemeContribution {
184
+ label: LocalizedString;
185
+ id?: string;
186
+ uiTheme: UITheme;
187
+ path: string;
188
+ }
189
+ /**
190
+ * An icon theme contribution.
191
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.iconThemes
192
+ */
193
+ interface IconThemeContribution {
194
+ id: string;
195
+ label: LocalizedString;
196
+ path: string;
197
+ }
198
+ /**
199
+ * A product icon theme contribution.
200
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.productIconThemes
201
+ */
202
+ interface ProductIconThemeContribution {
203
+ id: string;
204
+ label: LocalizedString;
205
+ path: string;
206
+ }
207
+ /**
208
+ * Color defaults for different themes.
209
+ */
210
+ interface ColorDefaults {
211
+ light: string;
212
+ dark: string;
213
+ highContrast?: string;
214
+ highContrastLight?: string;
215
+ }
216
+ /**
217
+ * A color contribution.
218
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.colors
219
+ */
220
+ interface ColorContribution {
221
+ id: string;
222
+ description: LocalizedString;
223
+ defaults: ColorDefaults;
224
+ }
225
+ /**
226
+ * The scope of a configuration setting.
227
+ */
228
+ type ConfigurationScope = 'application' | 'machine' | 'machine-overridable' | 'window' | 'resource' | 'language-overridable';
229
+ /**
230
+ * Presentation style for editing a configuration value.
231
+ */
232
+ type EditPresentation = 'singlelineText' | 'multilineText';
233
+ /**
234
+ * JSON Schema type values.
235
+ */
236
+ type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
237
+ /**
238
+ * A configuration property schema, modeled after JSON Schema with VS Code
239
+ * extensions for scope, edit presentation, deprecation, etc.
240
+ */
241
+ interface ConfigurationPropertySchema {
242
+ type?: JsonSchemaType | JsonSchemaType[];
243
+ default?: unknown;
244
+ description?: LocalizedString;
245
+ markdownDescription?: string;
246
+ scope?: ConfigurationScope;
247
+ enum?: unknown[];
248
+ enumDescriptions?: LocalizedString[];
249
+ enumItemLabels?: string[];
250
+ markdownEnumDescriptions?: string[];
251
+ deprecationMessage?: string;
252
+ markdownDeprecationMessage?: string;
253
+ editPresentation?: EditPresentation;
254
+ order?: number;
255
+ tags?: string[];
256
+ minimum?: number;
257
+ maximum?: number;
258
+ exclusiveMinimum?: number;
259
+ exclusiveMaximum?: number;
260
+ multipleOf?: number;
261
+ minLength?: number;
262
+ maxLength?: number;
263
+ pattern?: string;
264
+ patternErrorMessage?: string;
265
+ format?: string;
266
+ items?: ConfigurationPropertySchema;
267
+ minItems?: number;
268
+ maxItems?: number;
269
+ uniqueItems?: boolean;
270
+ properties?: Record<string, ConfigurationPropertySchema>;
271
+ additionalProperties?: boolean | ConfigurationPropertySchema;
272
+ required?: string[];
273
+ oneOf?: ConfigurationPropertySchema[];
274
+ anyOf?: ConfigurationPropertySchema[];
275
+ allOf?: ConfigurationPropertySchema[];
276
+ if?: ConfigurationPropertySchema;
277
+ then?: ConfigurationPropertySchema;
278
+ else?: ConfigurationPropertySchema;
279
+ }
280
+ /**
281
+ * A configuration contribution.
282
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.configuration
283
+ */
284
+ interface ConfigurationContribution {
285
+ title?: LocalizedString;
286
+ order?: number;
287
+ properties?: Record<string, ConfigurationPropertySchema>;
288
+ }
289
+ /**
290
+ * A JSON schema validation contribution.
291
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.jsonValidation
292
+ */
293
+ interface JsonValidationContribution {
294
+ fileMatch: string | string[];
295
+ url: string;
296
+ }
297
+ /**
298
+ * A view container contribution (sidebar or panel).
299
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.viewsContainers
300
+ */
301
+ interface ViewContainerContribution {
302
+ id: string;
303
+ title: LocalizedString;
304
+ icon: string;
305
+ }
306
+ /**
307
+ * View type discriminator.
308
+ */
309
+ type ViewType = 'tree' | 'webview';
310
+ /**
311
+ * View visibility state.
312
+ */
313
+ type ViewVisibility = 'visible' | 'hidden' | 'collapsed';
314
+ /**
315
+ * A view contribution.
316
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.views
317
+ */
318
+ interface ViewContribution {
319
+ type?: ViewType;
320
+ id: string;
321
+ name: LocalizedString;
322
+ icon?: string;
323
+ when?: string;
324
+ contextualTitle?: LocalizedString;
325
+ visibility?: ViewVisibility;
326
+ }
327
+ /**
328
+ * A welcome view contribution.
329
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.viewsWelcome
330
+ */
331
+ interface ViewWelcomeContribution {
332
+ view: string;
333
+ contents: LocalizedString;
334
+ when?: string;
335
+ group?: string;
336
+ enablement?: string;
337
+ }
338
+ /**
339
+ * A custom editor selector.
340
+ */
341
+ interface CustomEditorSelector {
342
+ filenamePattern?: string;
343
+ }
344
+ /**
345
+ * Custom editor priority.
346
+ */
347
+ type CustomEditorPriority = 'default' | 'builtin' | 'option';
348
+ /**
349
+ * A custom editor contribution.
350
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.customEditors
351
+ */
352
+ interface CustomEditorContribution {
353
+ viewType: string;
354
+ displayName: LocalizedString;
355
+ selector: CustomEditorSelector[];
356
+ priority?: CustomEditorPriority;
357
+ }
358
+ /**
359
+ * A debugger configuration snippet.
360
+ */
361
+ interface DebugConfigurationSnippet {
362
+ label: string;
363
+ description?: string;
364
+ body: Record<string, unknown>;
365
+ }
366
+ /**
367
+ * A debugger contribution.
368
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.debuggers
369
+ */
370
+ interface DebuggerContribution {
371
+ type: string;
372
+ label?: LocalizedString;
373
+ program?: string;
374
+ runtime?: string;
375
+ args?: string[];
376
+ runtimeArgs?: string[];
377
+ variables?: Record<string, string>;
378
+ initialConfigurations?: Record<string, unknown>[];
379
+ configurationSnippets?: DebugConfigurationSnippet[];
380
+ configurationAttributes?: Record<string, unknown>;
381
+ languages?: string[];
382
+ when?: string;
383
+ deprecated?: string;
384
+ }
385
+ /**
386
+ * A breakpoint contribution.
387
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.breakpoints
388
+ */
389
+ interface BreakpointContribution {
390
+ language: string;
391
+ when?: string;
392
+ }
393
+ /**
394
+ * A task definition contribution.
395
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.taskDefinitions
396
+ */
397
+ interface TaskDefinitionContribution {
398
+ type: string;
399
+ required?: string[];
400
+ properties?: Record<string, ConfigurationPropertySchema>;
401
+ when?: string;
402
+ }
403
+ /**
404
+ * Severity level for problem matchers.
405
+ */
406
+ type ProblemSeverity = 'error' | 'warning' | 'info';
407
+ /**
408
+ * Apply-to scope for problem matchers.
409
+ */
410
+ type ProblemApplyTo = 'allDocuments' | 'openDocuments' | 'closedDocuments';
411
+ /**
412
+ * File location style for problem matchers.
413
+ */
414
+ type FileLocationKind = 'absolute' | 'relative' | 'autoDetect';
415
+ /**
416
+ * Problem matcher background pattern.
417
+ */
418
+ interface ProblemBackground {
419
+ activeOnStart?: boolean;
420
+ beginsPattern?: string;
421
+ endsPattern?: string;
422
+ }
423
+ /**
424
+ * A problem pattern contribution.
425
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.problemPatterns
426
+ */
427
+ interface ProblemPatternContribution {
428
+ name?: string;
429
+ regexp: string;
430
+ message?: number;
431
+ file?: number;
432
+ location?: number;
433
+ line?: number;
434
+ column?: number;
435
+ endLine?: number;
436
+ endColumn?: number;
437
+ code?: number;
438
+ severity?: number;
439
+ loop?: boolean;
440
+ kind?: string;
441
+ }
442
+ /**
443
+ * A problem matcher contribution.
444
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.problemMatchers
445
+ */
446
+ interface ProblemMatcherContribution {
447
+ name?: string;
448
+ label?: LocalizedString;
449
+ owner?: string;
450
+ source?: string;
451
+ applyTo?: ProblemApplyTo;
452
+ fileLocation?: FileLocationKind | [FileLocationKind, string];
453
+ pattern?: ProblemPatternContribution | ProblemPatternContribution[] | string;
454
+ severity?: ProblemSeverity;
455
+ background?: ProblemBackground;
456
+ }
457
+ /**
458
+ * A notebook selector for matching notebooks by type.
459
+ */
460
+ interface NotebookSelector {
461
+ filenamePattern?: string;
462
+ excludeFileNamePattern?: string;
463
+ }
464
+ /**
465
+ * A notebook contribution.
466
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.notebooks
467
+ */
468
+ interface NotebookContribution {
469
+ type: string;
470
+ displayName: LocalizedString;
471
+ selector: NotebookSelector[];
472
+ priority?: 'default' | 'option';
473
+ }
474
+ /**
475
+ * Messaging requirement for notebook renderers.
476
+ */
477
+ type NotebookRendererMessaging = 'always' | 'optional' | 'never';
478
+ /**
479
+ * A notebook renderer contribution.
480
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.notebookRenderer
481
+ */
482
+ interface NotebookRendererContribution {
483
+ id: string;
484
+ displayName: LocalizedString;
485
+ mimeTypes: string[];
486
+ entrypoint: string | {
487
+ extends: string;
488
+ path: string;
489
+ };
490
+ dependencies?: string[];
491
+ requiresMessaging?: NotebookRendererMessaging;
492
+ }
493
+ /**
494
+ * An authentication provider contribution.
495
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.authentication
496
+ */
497
+ interface AuthenticationContribution {
498
+ id: string;
499
+ label: LocalizedString;
500
+ }
501
+ /**
502
+ * Walkthrough step media — one of image, markdown, or SVG.
503
+ */
504
+ interface WalkthroughStepMedia {
505
+ image?: string | {
506
+ light: string;
507
+ dark: string;
508
+ hc: string;
509
+ hcLight: string;
510
+ };
511
+ markdown?: string;
512
+ svg?: string;
513
+ altText?: string;
514
+ }
515
+ /**
516
+ * A walkthrough step contribution.
517
+ */
518
+ interface WalkthroughStepContribution {
519
+ id: string;
520
+ title: LocalizedString;
521
+ description: LocalizedString;
522
+ media: WalkthroughStepMedia;
523
+ completionEvents?: string[];
524
+ when?: string;
525
+ }
526
+ /**
527
+ * A walkthrough contribution.
528
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.walkthroughs
529
+ */
530
+ interface WalkthroughContribution {
531
+ id: string;
532
+ title: LocalizedString;
533
+ icon?: string;
534
+ description: LocalizedString;
535
+ featuredFor?: string[];
536
+ when?: string;
537
+ steps: WalkthroughStepContribution[];
538
+ }
539
+ /**
540
+ * A localization translation entry.
541
+ */
542
+ interface LocalizationTranslation {
543
+ id: string;
544
+ path: string;
545
+ }
546
+ /**
547
+ * A localization contribution.
548
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.localizations
549
+ */
550
+ interface LocalizationContribution {
551
+ languageId: string;
552
+ languageName?: string;
553
+ localizedLanguageName?: string;
554
+ translations: LocalizationTranslation[];
555
+ }
556
+ /**
557
+ * A code action kind with title.
558
+ *
559
+ * @internal This contribution point is used internally by VS Code but is not
560
+ * part of the official stable extension API documentation. Included for
561
+ * completeness when parsing real-world manifests that may declare it.
562
+ */
563
+ interface CodeActionKindEntry {
564
+ kind: string;
565
+ title: LocalizedString;
566
+ description?: LocalizedString;
567
+ }
568
+ /**
569
+ * A code action contribution.
570
+ *
571
+ * @internal This contribution point is used internally by VS Code but is not
572
+ * part of the official stable extension API documentation. Included for
573
+ * completeness when parsing real-world manifests that may declare it.
574
+ */
575
+ interface CodeActionContribution {
576
+ languages: string[];
577
+ actions: CodeActionKindEntry[];
578
+ }
579
+ /**
580
+ * A semantic token type contribution.
581
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.semanticTokenTypes
582
+ */
583
+ interface SemanticTokenTypeContribution {
584
+ id: string;
585
+ superType?: string;
586
+ description?: LocalizedString;
587
+ }
588
+ /**
589
+ * A semantic token modifier contribution.
590
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.semanticTokenModifiers
591
+ */
592
+ interface SemanticTokenModifierContribution {
593
+ id: string;
594
+ description?: LocalizedString;
595
+ }
596
+ /**
597
+ * A semantic token scope map contribution.
598
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.semanticTokenScopes
599
+ */
600
+ interface SemanticTokenScopeContribution {
601
+ language?: string;
602
+ scopes: Record<string, string[]>;
603
+ }
604
+ /**
605
+ * A resource label formatter contribution.
606
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.resourceLabelFormatters
607
+ */
608
+ interface ResourceLabelFormatterContribution {
609
+ scheme: string;
610
+ authority?: string;
611
+ formatting: {
612
+ label: string;
613
+ separator?: string;
614
+ stripPathStartingSeparator?: boolean;
615
+ tildify?: boolean;
616
+ workspaceSuffix?: string;
617
+ };
618
+ }
619
+ /**
620
+ * A terminal profile contribution.
621
+ */
622
+ interface TerminalProfile {
623
+ id: string;
624
+ title: LocalizedString;
625
+ icon?: IconReference;
626
+ }
627
+ /**
628
+ * Terminal contributions.
629
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.terminal
630
+ */
631
+ interface TerminalContribution {
632
+ profiles?: TerminalProfile[];
633
+ }
634
+ /**
635
+ * Default icon definition with font path and character.
636
+ */
637
+ interface IconDefault {
638
+ fontPath: string;
639
+ fontCharacter: string;
640
+ }
641
+ /**
642
+ * An icon contribution.
643
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.icons
644
+ */
645
+ interface IconContribution {
646
+ description: LocalizedString;
647
+ default: IconDefault;
648
+ }
649
+ /**
650
+ * A TypeScript server plugin contribution.
651
+ *
652
+ * Enables extensions to provide TypeScript language service plugins that
653
+ * enhance the editor's TypeScript/JavaScript language features.
654
+ *
655
+ * @see https://code.visualstudio.com/api/references/contribution-points#contributes.typescriptServerPlugins
656
+ */
657
+ interface TypescriptServerPluginContribution {
658
+ /** The npm module name of the TypeScript server plugin. */
659
+ name: string;
660
+ /** Whether to enable the plugin for JavaScript files. Defaults to false. */
661
+ enableForWorkspaceTypeScriptVersions?: boolean;
662
+ /** Languages supported by this plugin. */
663
+ languages?: string[];
664
+ }
665
+ /**
666
+ * A start entry contribution (displayed on the Start page).
667
+ *
668
+ * @internal This contribution point is used internally by VS Code but is not
669
+ * part of the official stable extension API documentation. Included for
670
+ * completeness when parsing real-world manifests that may declare it.
671
+ */
672
+ interface StartEntryContribution {
673
+ title: LocalizedString;
674
+ description?: LocalizedString;
675
+ command: string;
676
+ when?: string;
677
+ category?: LocalizedString;
678
+ }
679
+ /**
680
+ * All stable VS Code extension contribution points.
681
+ *
682
+ * Each contribution point maps to a named interface above.
683
+ * Menu items are keyed by menu location (e.g., `editor/context`,
684
+ * `commandPalette`, `view/title`, etc.).
685
+ *
686
+ * @see https://code.visualstudio.com/api/references/contribution-points
687
+ */
688
+ interface VSCodeContributes {
689
+ commands?: CommandContribution[];
690
+ menus?: Record<string, MenuContribution[]>;
691
+ submenus?: SubmenuContribution[];
692
+ keybindings?: KeybindingContribution[];
693
+ languages?: LanguageContribution[];
694
+ grammars?: GrammarContribution[];
695
+ snippets?: SnippetContribution[];
696
+ themes?: ThemeContribution[];
697
+ iconThemes?: IconThemeContribution[];
698
+ productIconThemes?: ProductIconThemeContribution[];
699
+ colors?: ColorContribution[];
700
+ configuration?: ConfigurationContribution | ConfigurationContribution[];
701
+ configurationDefaults?: Record<string, unknown>;
702
+ jsonValidation?: JsonValidationContribution[];
703
+ viewsContainers?: Record<string, ViewContainerContribution[]>;
704
+ views?: Record<string, ViewContribution[]>;
705
+ viewsWelcome?: ViewWelcomeContribution[];
706
+ customEditors?: CustomEditorContribution[];
707
+ debuggers?: DebuggerContribution[];
708
+ breakpoints?: BreakpointContribution[];
709
+ taskDefinitions?: TaskDefinitionContribution[];
710
+ problemMatchers?: ProblemMatcherContribution[];
711
+ problemPatterns?: ProblemPatternContribution[];
712
+ notebooks?: NotebookContribution[];
713
+ notebookRenderer?: NotebookRendererContribution[];
714
+ authentication?: AuthenticationContribution[];
715
+ walkthroughs?: WalkthroughContribution[];
716
+ localizations?: LocalizationContribution[];
717
+ codeActions?: CodeActionContribution[];
718
+ semanticTokenTypes?: SemanticTokenTypeContribution[];
719
+ semanticTokenModifiers?: SemanticTokenModifierContribution[];
720
+ semanticTokenScopes?: SemanticTokenScopeContribution[];
721
+ resourceLabelFormatters?: ResourceLabelFormatterContribution[];
722
+ terminal?: TerminalContribution;
723
+ icons?: Record<string, IconContribution>;
724
+ typescriptServerPlugins?: TypescriptServerPluginContribution[];
725
+ startEntries?: StartEntryContribution[];
726
+ }
727
+ /**
728
+ * The full VS Code extension package.json manifest.
729
+ *
730
+ * This interface covers all standard and VS-Code-specific fields that an
731
+ * extension can declare. The three required fields are `name`, `publisher`,
732
+ * and `version`.
733
+ *
734
+ * @see https://code.visualstudio.com/api/references/extension-manifest
735
+ */
736
+ interface VSCodeExtensionManifest {
737
+ /** The extension identifier (npm package name). */
738
+ name: string;
739
+ /** The publisher identifier (marketplace publisher ID). */
740
+ publisher: string;
741
+ /** The extension version (semver). */
742
+ version: string;
743
+ /** Engine compatibility — `vscode` key is required. */
744
+ engines: {
745
+ vscode: string;
746
+ };
747
+ /** Human-readable display name. */
748
+ displayName?: LocalizedString;
749
+ /** Short description of the extension. */
750
+ description?: LocalizedString;
751
+ /** Marketplace categories. */
752
+ categories?: ExtensionCategory[];
753
+ /** Marketplace keywords (max 5). */
754
+ keywords?: string[];
755
+ /** Relative path to the extension icon (128x128 PNG). */
756
+ icon?: string;
757
+ /** If true, the extension is marked as Preview in the marketplace. */
758
+ preview?: boolean;
759
+ /** Badges displayed on the marketplace page. */
760
+ badges?: Badge[];
761
+ /** Markdown rendering engine — `'github'` or `'standard'`. */
762
+ markdown?: 'github' | 'standard';
763
+ /** Q&A link — `'marketplace'`, `false`, or a URL string. */
764
+ qna?: 'marketplace' | false | string;
765
+ /** Pricing model — `'Free'` or `'Trial'`. */
766
+ pricing?: 'Free' | 'Trial';
767
+ /** Gallery banner appearance on the marketplace detail page. */
768
+ galleryBanner?: {
769
+ color?: string;
770
+ theme?: 'dark' | 'light';
771
+ };
772
+ /** Sponsor link displayed on the marketplace page. */
773
+ sponsor?: {
774
+ url: string;
775
+ };
776
+ /** Path to the extension's main entry point (Node.js). */
777
+ main?: string;
778
+ /** Path to the extension's browser entry point. */
779
+ browser?: string;
780
+ /** Events that trigger extension activation. */
781
+ activationEvents?: string[];
782
+ /** Where the extension should run. */
783
+ extensionKind?: ExtensionKind[];
784
+ /** Extension IDs that this extension depends on. */
785
+ extensionDependencies?: string[];
786
+ /** Extension IDs bundled together as an extension pack. */
787
+ extensionPack?: string[];
788
+ /** Capability declarations (untrusted/virtual workspace support). */
789
+ capabilities?: ExtensionCapabilities;
790
+ /** All contribution points. */
791
+ contributes?: VSCodeContributes;
792
+ /** Path to the localization bundle directory. */
793
+ l10n?: string;
794
+ /** Repository information. */
795
+ repository?: RepositoryReference;
796
+ /** Bug tracker information. */
797
+ bugs?: BugsReference;
798
+ /** Extension homepage URL. */
799
+ homepage?: string;
800
+ /** SPDX license identifier. */
801
+ license?: string;
802
+ /** npm scripts. */
803
+ scripts?: Record<string, string>;
804
+ /** Runtime dependencies. */
805
+ dependencies?: Record<string, string>;
806
+ /** Development dependencies. */
807
+ devDependencies?: Record<string, string>;
808
+ }
809
+
810
+ /**
811
+ * Types for installed extensions, compatibility assessment, and VSIX scanning.
812
+ *
813
+ * These types model the unified extension storage format shared across all
814
+ * FlowState platforms (Tauri desktop, Next.js web, mobile, sidecar).
815
+ *
816
+ * @see https://code.visualstudio.com/api/references/extension-manifest
817
+ */
818
+
819
+ /**
820
+ * Overall compatibility level for a VS Code extension in FlowState.
821
+ *
822
+ * - `'full'` — All contribution points and APIs are supported
823
+ * - `'partial'` — Some contribution points work, others require unavailable runtime
824
+ * - `'declarative-only'` — Only declarative contributions (themes, snippets, grammars) work
825
+ * - `'unsupported'` — Extension cannot run in FlowState
826
+ */
827
+ type CompatibilityLevel = 'full' | 'partial' | 'declarative-only' | 'unsupported';
828
+ /**
829
+ * Detailed compatibility assessment for a VS Code extension.
830
+ *
831
+ * Produced by the compatibility scoring algorithm after scanning an extension's
832
+ * manifest and (optionally) its source code for API namespace usage.
833
+ */
834
+ interface CompatibilityReport {
835
+ /** Overall compatibility level. */
836
+ level: CompatibilityLevel;
837
+ /** Contribution points that FlowState can handle on the current platform. */
838
+ supported: string[];
839
+ /** Contribution points that require runtime not yet available. */
840
+ unsupported: string[];
841
+ /** VS Code API namespaces detected via static analysis (e.g., `'vscode.window'`, `'vscode.workspace'`). */
842
+ apiNamespacesUsed: string[];
843
+ /** User-facing warning messages about compatibility limitations. */
844
+ warnings: string[];
845
+ }
846
+ /**
847
+ * Source format of an installed extension.
848
+ *
849
+ * - `'fsext'` — Native FlowState extension package
850
+ * - `'vsix'` — VS Code extension (from Open VSX or sideloaded)
851
+ * - `'builtin'` — Bundled with FlowState
852
+ */
853
+ type ExtensionSource = 'fsext' | 'vsix' | 'builtin';
854
+ /**
855
+ * Registry from which an extension was obtained.
856
+ *
857
+ * - `'flowstate'` — FlowState marketplace
858
+ * - `'openvsx'` — Open VSX registry
859
+ */
860
+ type ExtensionRegistry = 'flowstate' | 'openvsx';
861
+ /**
862
+ * Installation scope of an extension.
863
+ *
864
+ * - `'user'` — Available across all workspaces for this user
865
+ * - `'workspace'` — Only available in a specific workspace
866
+ */
867
+ type ExtensionScope = 'user' | 'workspace';
868
+ /**
869
+ * Minimal FlowState plugin manifest shape used by extension-core.
870
+ *
871
+ * This captures the essential fields without importing from `flowstate-app-framework`,
872
+ * keeping `extension-core` zero-dependency. Consumers can intersect this with the
873
+ * full `PluginManifest` type from the framework package when needed.
874
+ */
875
+ interface FlowStateManifest {
876
+ /** Unique plugin identifier. */
877
+ id: string;
878
+ /** Human-readable display name. */
879
+ displayName: string;
880
+ /** Semantic version. */
881
+ version: string;
882
+ /** Publisher or author name. */
883
+ publisher?: string;
884
+ /** Path to the main entry point module. */
885
+ main: string;
886
+ /** Path to the browser-specific entry point. */
887
+ browser?: string;
888
+ /** Plugin category. */
889
+ category?: string;
890
+ /** FlowState extension type inferred from the manifest. */
891
+ extensionType?: string;
892
+ /** Activation events controlling when the extension loads. */
893
+ activationEvents?: string[];
894
+ /** Contribution points for extending FlowState. */
895
+ contributes?: Record<string, unknown>;
896
+ }
897
+ /**
898
+ * Unified storage model for installed extensions.
899
+ *
900
+ * Both `.fsext` (native FlowState) and `.vsix` (VS Code) extensions resolve
901
+ * to this record after installation. This is the canonical shape stored in
902
+ * the local extension database across all platforms.
903
+ */
904
+ interface InstalledExtension {
905
+ /** Publisher/name identifier (e.g., `'esbenp.prettier-vscode'`). */
906
+ id: string;
907
+ /** Publisher namespace. */
908
+ publisher: string;
909
+ /** Extension name within namespace. */
910
+ name: string;
911
+ /** Installed version (semver). */
912
+ version: string;
913
+ /** Human-readable display name. */
914
+ displayName: string;
915
+ /** Source format of the extension. */
916
+ source: ExtensionSource;
917
+ /** Registry from which the extension was obtained. */
918
+ registry: ExtensionRegistry;
919
+ /** Translated FlowState manifest. */
920
+ manifest: FlowStateManifest;
921
+ /** Original VS Code manifest (present when `source` is `'vsix'`). */
922
+ vsCodeManifest?: VSCodeExtensionManifest;
923
+ /** Installation scope. */
924
+ scope: ExtensionScope;
925
+ /** Whether the extension is currently enabled. */
926
+ enabled: boolean;
927
+ /** ISO 8601 timestamp of when the extension was installed. */
928
+ installedAt: string;
929
+ /** Path to the extracted extension files on disk. */
930
+ extensionPath: string;
931
+ /** Compatibility assessment for the current platform. */
932
+ compatibility: CompatibilityReport;
933
+ }
934
+ /**
935
+ * Result of scanning a `.vsix` archive.
936
+ *
937
+ * Produced by the VSIX scanner after unpacking, manifest extraction,
938
+ * validation, classification, and compatibility assessment.
939
+ */
940
+ interface VsixScanResult {
941
+ /** Original VS Code extension manifest (package.json). */
942
+ vsCodeManifest: VSCodeExtensionManifest;
943
+ /** Translated FlowState manifest. */
944
+ flowstateManifest: FlowStateManifest;
945
+ /** Whether this extension uses only declarative contribution points. */
946
+ isDeclarative: boolean;
947
+ /** List of contribution point keys used by the extension. */
948
+ contributionPoints: string[];
949
+ /**
950
+ * Extracted asset files keyed by relative path.
951
+ *
952
+ * Uses `Uint8Array` instead of `Buffer` for cross-platform compatibility
953
+ * (works in browsers, Node.js, Deno, and Tauri WebView).
954
+ */
955
+ assets: Map<string, Uint8Array>;
956
+ /** Runtime compatibility assessment. */
957
+ compatibility: CompatibilityReport;
958
+ }
959
+
960
+ /**
961
+ * Manifest adapter for bidirectional translation between VS Code and FlowState formats.
962
+ *
963
+ * - `vsCodeToFlowState()` — converts VS Code `package.json` → `FlowStateManifest`
964
+ * - `flowStateToVsCode()` — converts `FlowStateManifest` → `Partial<VSCodeExtensionManifest>`
965
+ *
966
+ * Both functions are pure, deterministic, and side-effect free.
967
+ */
968
+
969
+ /**
970
+ * Map a VS Code marketplace category to its FlowState equivalent.
971
+ *
972
+ * @param vsCodeCategory - The VS Code category string (e.g., `'Programming Languages'`)
973
+ * @returns The kebab-case FlowState category, or `undefined` if unmapped
974
+ */
975
+ declare function mapCategory(vsCodeCategory: string | undefined): string | undefined;
976
+ /**
977
+ * Map VS Code activation events to FlowState activation events.
978
+ *
979
+ * Most events pass through as-is. The notable mapping is:
980
+ * - `onStartupFinished` → `onStartup`
981
+ *
982
+ * @param manifest - The VS Code extension manifest
983
+ * @returns Array of FlowState activation event strings
984
+ */
985
+ declare function mapActivationEvents(manifest: VSCodeExtensionManifest): string[];
986
+ /**
987
+ * Infer the FlowState extension type from a VS Code manifest.
988
+ *
989
+ * Uses the following heuristics:
990
+ * 1. If the extension only contributes `themes`, `iconThemes`, or `productIconThemes` → `'theme'`
991
+ * 2. If the extension contributes `localizations` → `'pack'` (language pack)
992
+ * 3. If `extensionKind` includes `'workspace'` → `'app'`
993
+ * 4. Default → `'ui-extension'`
994
+ *
995
+ * @param manifest - The VS Code extension manifest
996
+ * @returns The FlowState extension type string
997
+ */
998
+ declare function mapExtensionKind(manifest: VSCodeExtensionManifest): string;
999
+ /**
1000
+ * Translate a VS Code extension manifest to a FlowState manifest.
1001
+ *
1002
+ * This is a pure function that maps VS Code `package.json` fields to the
1003
+ * equivalent FlowState `FlowStateManifest` shape. The translation is:
1004
+ *
1005
+ * - **Lossless** for declarative fields (themes, snippets, grammars, etc.)
1006
+ * - **Deterministic** — same input always produces same output
1007
+ * - **Side-effect free** — no I/O, no mutations
1008
+ *
1009
+ * @param manifest - A VS Code extension package.json parsed as `VSCodeExtensionManifest`
1010
+ * @returns A `FlowStateManifest` suitable for FlowState's extension system
1011
+ *
1012
+ * @example
1013
+ * ```typescript
1014
+ * const vsCodeManifest: VSCodeExtensionManifest = {
1015
+ * name: 'prettier-vscode',
1016
+ * publisher: 'esbenp',
1017
+ * version: '10.1.0',
1018
+ * engines: { vscode: '^1.80.0' },
1019
+ * main: './dist/extension.js',
1020
+ * };
1021
+ *
1022
+ * const flowstateManifest = vsCodeToFlowState(vsCodeManifest);
1023
+ * // { id: 'esbenp.prettier-vscode', displayName: 'prettier-vscode', ... }
1024
+ * ```
1025
+ */
1026
+ declare function vsCodeToFlowState(manifest: VSCodeExtensionManifest): FlowStateManifest;
1027
+ /**
1028
+ * Map a FlowState category back to its VS Code marketplace equivalent.
1029
+ *
1030
+ * @param flowstateCategory - The kebab-case FlowState category (e.g., `'programming-languages'`)
1031
+ * @returns The VS Code Title Case category, or `undefined` if unmapped
1032
+ */
1033
+ declare function reverseCategory(flowstateCategory: string | undefined): string | undefined;
1034
+ /**
1035
+ * Reverse map FlowState activation events back to VS Code format.
1036
+ *
1037
+ * - `onStartup` → `onStartupFinished`
1038
+ * - All other events pass through as-is
1039
+ *
1040
+ * @param events - FlowState activation event strings
1041
+ * @returns Array of VS Code activation event strings
1042
+ */
1043
+ declare function reverseActivationEvents(events: string[] | undefined): string[];
1044
+ /**
1045
+ * Map a FlowState extension type back to VS Code `extensionKind`.
1046
+ *
1047
+ * - `'app'` → `['workspace']`
1048
+ * - `'theme'` → `['ui']`
1049
+ * - `'pack'` → `['ui']`
1050
+ * - `'ui-extension'` or `undefined` → `undefined` (VS Code default)
1051
+ *
1052
+ * @param extensionType - The FlowState extension type
1053
+ * @returns VS Code `extensionKind` array, or `undefined` for default
1054
+ */
1055
+ declare function reverseExtensionKind(extensionType: string | undefined): Array<'ui' | 'workspace'> | undefined;
1056
+ /**
1057
+ * Translate a FlowState manifest back to a VS Code extension manifest.
1058
+ *
1059
+ * This is a pure function that maps `FlowStateManifest` fields to the
1060
+ * equivalent VS Code `package.json` shape. The result is `Partial` because
1061
+ * some required VS Code fields (like `engines.vscode`) cannot be inferred
1062
+ * from a FlowState manifest alone.
1063
+ *
1064
+ * FlowState-specific metadata is stored under the `flowstate` key in the
1065
+ * output for round-trip preservation.
1066
+ *
1067
+ * @param manifest - A FlowState manifest
1068
+ * @returns A partial VS Code extension manifest suitable for cross-publishing
1069
+ *
1070
+ * @example
1071
+ * ```typescript
1072
+ * const fsManifest: FlowStateManifest = {
1073
+ * id: 'esbenp.prettier-vscode',
1074
+ * displayName: 'Prettier',
1075
+ * version: '10.1.0',
1076
+ * main: './dist/extension.js',
1077
+ * };
1078
+ *
1079
+ * const vsCodeManifest = flowStateToVsCode(fsManifest);
1080
+ * // { name: 'prettier-vscode', publisher: 'esbenp', version: '10.1.0', ... }
1081
+ * ```
1082
+ */
1083
+ declare function flowStateToVsCode(manifest: FlowStateManifest): Partial<VSCodeExtensionManifest>;
1084
+
1085
+ /**
1086
+ * Contribution point keys that are purely declarative (no runtime code needed).
1087
+ *
1088
+ * Extensions using only these contribution points can run in FlowState without
1089
+ * a VS Code extension host.
1090
+ */
1091
+ declare const DECLARATIVE_CONTRIBUTION_POINTS: Set<string>;
1092
+ /** Error codes for VSIX scanning failures. */
1093
+ type VsixScanErrorCode = 'INVALID_ZIP' | 'MISSING_MANIFEST' | 'INVALID_MANIFEST';
1094
+ /**
1095
+ * Typed error thrown by the VSIX scanner.
1096
+ */
1097
+ declare class VsixScanError extends Error {
1098
+ readonly code: VsixScanErrorCode;
1099
+ constructor(code: VsixScanErrorCode, message: string);
1100
+ }
1101
+ /**
1102
+ * Determine whether an extension uses only declarative contribution points.
1103
+ *
1104
+ * An extension is declarative if:
1105
+ * 1. It has no `main` or `browser` entry point
1106
+ * 2. All of its contribution point keys are in the declarative set
1107
+ *
1108
+ * @param manifest - The VS Code extension manifest
1109
+ * @returns `true` if the extension is purely declarative
1110
+ */
1111
+ declare function classifyDeclarative(manifest: VSCodeExtensionManifest): boolean;
1112
+ /**
1113
+ * Enumerate all active contribution point keys from a manifest.
1114
+ *
1115
+ * @param manifest - The VS Code extension manifest
1116
+ * @returns Sorted array of contribution point keys with non-empty values
1117
+ */
1118
+ declare function enumerateContributionPoints(manifest: VSCodeExtensionManifest): string[];
1119
+ /**
1120
+ * Scan JS files in an asset map for VS Code API namespace usage.
1121
+ *
1122
+ * This is best-effort static analysis using regex matching, not a full parser.
1123
+ * It looks for `vscode.<namespace>` patterns in `.js` files.
1124
+ *
1125
+ * @param assets - Map of relative file paths to file contents
1126
+ * @returns Deduplicated, sorted array of `vscode.<namespace>` strings
1127
+ */
1128
+ declare function detectApiNamespaces(assets: Map<string, Uint8Array>): string[];
1129
+ /**
1130
+ * Build a compatibility report from manifest analysis and API detection.
1131
+ *
1132
+ * @param manifest - The VS Code extension manifest
1133
+ * @param apiNamespaces - Detected API namespace strings
1134
+ * @returns A complete `CompatibilityReport`
1135
+ */
1136
+ declare function buildCompatibilityReport(manifest: VSCodeExtensionManifest, apiNamespaces: string[]): CompatibilityReport;
1137
+ /**
1138
+ * Scan a VSIX archive and produce a complete scan result.
1139
+ *
1140
+ * @param data - The raw VSIX file contents as a `Uint8Array`
1141
+ * @returns A `VsixScanResult` with manifest, classification, and compatibility data
1142
+ *
1143
+ * @throws {VsixScanError} With code `'INVALID_ZIP'` if decompression fails
1144
+ * @throws {VsixScanError} With code `'MISSING_MANIFEST'` if `extension/package.json` not found
1145
+ * @throws {VsixScanError} With code `'INVALID_MANIFEST'` if manifest JSON is invalid or missing required fields
1146
+ *
1147
+ * @example
1148
+ * ```typescript
1149
+ * const vsixData = await fetch(vsixUrl).then(r => r.arrayBuffer());
1150
+ * const result = scanVsix(new Uint8Array(vsixData));
1151
+ * console.log(result.isDeclarative); // true for theme extensions
1152
+ * ```
1153
+ */
1154
+ declare function scanVsix(data: Uint8Array): VsixScanResult;
1155
+
1156
+ /**
1157
+ * Platform-aware compatibility scoring for VS Code extensions.
1158
+ *
1159
+ * Evaluates extensions against FlowState's supported capabilities per platform
1160
+ * (desktop, web, mobile) and produces a numeric score, compatibility level,
1161
+ * per-contribution-point breakdown, and actionable recommendations.
1162
+ */
1163
+
1164
+ /** Target platform for compatibility evaluation. */
1165
+ type Platform = 'desktop' | 'web' | 'mobile';
1166
+ /** Support status for a contribution point on a given platform. */
1167
+ type SupportStatus = 'native' | 'polyfill' | 'partial' | 'unsupported';
1168
+ /** Compatibility score for a single contribution point. */
1169
+ interface ContributionPointScore {
1170
+ /** The contribution point key (e.g., `'themes'`, `'commands'`). */
1171
+ key: string;
1172
+ /** Support status on the target platform. */
1173
+ status: SupportStatus;
1174
+ /** Numeric weight derived from the support status (0–1). */
1175
+ weight: number;
1176
+ }
1177
+ /** Complete compatibility score for an extension on a target platform. */
1178
+ interface CompatibilityScore {
1179
+ /** Numeric score from 0 to 100. */
1180
+ score: number;
1181
+ /** Compatibility level derived from the numeric score. */
1182
+ level: CompatibilityLevel;
1183
+ /** The platform this score was computed for. */
1184
+ platform: Platform;
1185
+ /** Per-contribution-point breakdown. */
1186
+ breakdown: ContributionPointScore[];
1187
+ /** Base compatibility report from the scanner. */
1188
+ report: CompatibilityReport;
1189
+ /** Actionable recommendations for improving compatibility. */
1190
+ recommendations: string[];
1191
+ }
1192
+ /**
1193
+ * Numeric weights for each support status.
1194
+ *
1195
+ * - `native` = 1.0 — FlowState handles this natively
1196
+ * - `polyfill` = 0.8 — Works via compatibility layer
1197
+ * - `partial` = 0.5 — Some features work
1198
+ * - `unsupported` = 0 — Cannot run
1199
+ */
1200
+ declare const SUPPORT_WEIGHTS: Record<SupportStatus, number>;
1201
+ /**
1202
+ * Platform support matrix mapping each contribution point to its support
1203
+ * status per platform.
1204
+ *
1205
+ * Desktop (Tauri) supports the most contribution points.
1206
+ * Web (Next.js) supports declarative + some UI contributions.
1207
+ * Mobile supports only basic declarative contributions.
1208
+ */
1209
+ declare const PLATFORM_SUPPORT: Record<Platform, Record<string, SupportStatus>>;
1210
+ /**
1211
+ * Returns the support matrix for a given platform.
1212
+ *
1213
+ * Contribution points not present in the matrix are considered `'unsupported'`.
1214
+ *
1215
+ * @param platform - The target platform
1216
+ * @returns Map of contribution point keys to their support status
1217
+ */
1218
+ declare function getPlatformSupport(platform: Platform): Record<string, SupportStatus>;
1219
+ /**
1220
+ * Score a VS Code extension's compatibility with a target platform.
1221
+ *
1222
+ * @param manifest - The VS Code extension manifest
1223
+ * @param platform - The target platform to score against
1224
+ * @param apiNamespaces - Optional array of detected API namespace strings
1225
+ * @returns A complete `CompatibilityScore`
1226
+ */
1227
+ declare function scoreExtension(manifest: VSCodeExtensionManifest, platform: Platform, apiNamespaces?: string[]): CompatibilityScore;
1228
+ /**
1229
+ * Generate actionable recommendations based on the scoring breakdown.
1230
+ *
1231
+ * @param breakdown - Per-contribution-point score breakdown
1232
+ * @param manifest - The VS Code extension manifest
1233
+ * @param platform - The target platform
1234
+ * @returns Array of recommendation strings
1235
+ */
1236
+ declare function generateRecommendations(breakdown: ContributionPointScore[], manifest: VSCodeExtensionManifest, platform: Platform): string[];
1237
+
1238
+ /**
1239
+ * Extension dependency resolver — builds a dependency graph from VS Code
1240
+ * extension manifests and produces a topologically sorted installation order.
1241
+ *
1242
+ * Handles both `extensionDependencies` (hard dependencies) and `extensionPack`
1243
+ * (pack members). Detects circular dependencies using Kahn's algorithm.
1244
+ */
1245
+
1246
+ /** A node in the dependency graph representing a single extension. */
1247
+ interface ExtensionNode {
1248
+ /** Normalized `publisher.name` identifier. */
1249
+ id: string;
1250
+ /** Hard dependency extension IDs. */
1251
+ extensionDependencies: string[];
1252
+ /** Pack member extension IDs. */
1253
+ extensionPack: string[];
1254
+ }
1255
+ /** A directed edge in the dependency graph. */
1256
+ interface DependencyEdge {
1257
+ /** The dependent extension (the one that requires the other). */
1258
+ from: string;
1259
+ /** The dependency (the one that must be installed first). */
1260
+ to: string;
1261
+ /** Edge type — `'dependency'` for hard deps, `'pack'` for pack members. */
1262
+ type: 'dependency' | 'pack';
1263
+ }
1264
+ /** The complete dependency graph structure. */
1265
+ interface DependencyGraph {
1266
+ /** All known extension nodes keyed by normalized ID. */
1267
+ nodes: Map<string, ExtensionNode>;
1268
+ /** All directed edges in the graph. */
1269
+ edges: DependencyEdge[];
1270
+ /** Adjacency list: extension ID → set of IDs it depends on. */
1271
+ adjacency: Map<string, Set<string>>;
1272
+ }
1273
+ /** Successful resolution with a sorted installation order. */
1274
+ interface DependencyResolutionSuccess {
1275
+ ok: true;
1276
+ /** Extension IDs in topological order (install first → last). */
1277
+ order: string[];
1278
+ /** The underlying dependency graph. */
1279
+ graph: DependencyGraph;
1280
+ }
1281
+ /** Failed resolution due to circular dependencies. */
1282
+ interface DependencyResolutionError {
1283
+ ok: false;
1284
+ /** The type of error. */
1285
+ error: 'circular-dependency';
1286
+ /** Extension IDs involved in the cycle(s). */
1287
+ participants: string[];
1288
+ /** The underlying dependency graph. */
1289
+ graph: DependencyGraph;
1290
+ }
1291
+ /** Result of dependency resolution — either success or error. */
1292
+ type DependencyResolution = DependencyResolutionSuccess | DependencyResolutionError;
1293
+ /**
1294
+ * Normalize an extension ID for case-insensitive matching.
1295
+ *
1296
+ * VS Code marketplace treats extension IDs as case-insensitive.
1297
+ *
1298
+ * @param id - The extension ID (e.g., `'EsbenP.prettier-vscode'`)
1299
+ * @returns Lowercased ID (e.g., `'esbenp.prettier-vscode'`)
1300
+ */
1301
+ declare function normalizeExtensionId(id: string): string;
1302
+ /**
1303
+ * Extract an `ExtensionNode` from a VS Code extension manifest.
1304
+ *
1305
+ * @param manifest - The VS Code extension manifest
1306
+ * @returns An `ExtensionNode` with normalized IDs
1307
+ */
1308
+ declare function extractDependencyNode(manifest: VSCodeExtensionManifest): ExtensionNode;
1309
+ /**
1310
+ * Build a dependency graph from an array of extension nodes.
1311
+ *
1312
+ * Dependencies that reference extensions not in the input set are added
1313
+ * as leaf nodes (no dependencies of their own).
1314
+ *
1315
+ * @param nodes - Array of extension nodes
1316
+ * @returns A complete `DependencyGraph`
1317
+ */
1318
+ declare function buildDependencyGraph(nodes: ExtensionNode[]): DependencyGraph;
1319
+ /**
1320
+ * Resolve dependencies and produce a topologically sorted installation order.
1321
+ *
1322
+ * Uses Kahn's algorithm (BFS-based topological sort) for deterministic ordering
1323
+ * and straightforward cycle detection. Extensions with no dependencies appear
1324
+ * first in the result.
1325
+ *
1326
+ * @param nodes - Array of extension nodes to resolve
1327
+ * @returns A `DependencyResolution` — either success with sorted order, or error with cycle participants
1328
+ */
1329
+ declare function resolveDependencies(nodes: ExtensionNode[]): DependencyResolution;
1330
+
1331
+ /**
1332
+ * TypeScript types for the Open VSX Registry REST API.
1333
+ *
1334
+ * These types model the request parameters and response shapes for the
1335
+ * public Open VSX API at https://open-vsx.org/api.
1336
+ *
1337
+ * @see https://github.com/eclipse/openvsx/wiki/Using-the-Registry-API
1338
+ */
1339
+ /**
1340
+ * Target platform identifiers used by VS Code and Open VSX.
1341
+ *
1342
+ * Extensions can be published for specific platforms (e.g., native binaries)
1343
+ * or as `'universal'` (platform-independent).
1344
+ */
1345
+ type OpenVSXTargetPlatform = 'universal' | 'win32-x64' | 'win32-ia32' | 'win32-arm64' | 'linux-x64' | 'linux-arm64' | 'linux-armhf' | 'alpine-x64' | 'alpine-arm64' | 'darwin-x64' | 'darwin-arm64' | 'web';
1346
+ /**
1347
+ * Sort field for search results.
1348
+ */
1349
+ type OpenVSXSearchSortBy = 'relevance' | 'timestamp' | 'rating' | 'downloadCount';
1350
+ /**
1351
+ * Open VSX user / publisher information.
1352
+ */
1353
+ interface OpenVSXUser {
1354
+ /** Login name (e.g., `'ms-python'`). */
1355
+ loginName: string;
1356
+ /** Display name (may be absent). */
1357
+ fullName?: string;
1358
+ /** Avatar image URL. */
1359
+ avatarUrl: string;
1360
+ /** User homepage URL. */
1361
+ homepage: string;
1362
+ /** OAuth provider (e.g., `'github'`). */
1363
+ provider: string;
1364
+ }
1365
+ /**
1366
+ * Map of file type to download URL for an extension version.
1367
+ *
1368
+ * All values are URLs. Not all keys are present for every extension.
1369
+ */
1370
+ interface OpenVSXFileMap {
1371
+ /** VSIX package download URL. */
1372
+ download: string;
1373
+ /** Extension manifest (package.json) URL. */
1374
+ manifest?: string;
1375
+ /** README content URL. */
1376
+ readme?: string;
1377
+ /** LICENSE file URL. */
1378
+ license?: string;
1379
+ /** CHANGELOG URL. */
1380
+ changelog?: string;
1381
+ /** Extension icon image URL. */
1382
+ icon?: string;
1383
+ /** VS Code extension.vsixmanifest URL. */
1384
+ vsixmanifest?: string;
1385
+ /** SHA-256 checksum URL. */
1386
+ sha256?: string;
1387
+ /** Signature file (.sigzip) URL. */
1388
+ signature?: string;
1389
+ /** Public key URL for signature verification. */
1390
+ publicKey?: string;
1391
+ }
1392
+ /**
1393
+ * Request parameters for `GET /api/-/search`.
1394
+ */
1395
+ interface OpenVSXSearchParams {
1396
+ /** Free-text search term. */
1397
+ query?: string;
1398
+ /** Filter by extension category. */
1399
+ category?: string;
1400
+ /** Filter by target platform. */
1401
+ targetPlatform?: OpenVSXTargetPlatform;
1402
+ /** Number of results per page (default: 18). */
1403
+ size?: number;
1404
+ /** Zero-based page offset (default: 0). */
1405
+ offset?: number;
1406
+ /** Sort direction. */
1407
+ sortOrder?: 'asc' | 'desc';
1408
+ /** Sort field. */
1409
+ sortBy?: OpenVSXSearchSortBy;
1410
+ /** Include all versions in results (default: false). */
1411
+ includeAllVersions?: boolean;
1412
+ }
1413
+ /**
1414
+ * A single extension entry in search results.
1415
+ */
1416
+ interface OpenVSXSearchEntry {
1417
+ /** API URL for this extension. */
1418
+ url: string;
1419
+ /** File download URLs. */
1420
+ files: OpenVSXFileMap;
1421
+ /** Extension name (e.g., `'python'`). */
1422
+ name: string;
1423
+ /** Namespace / publisher (e.g., `'ms-python'`). */
1424
+ namespace: string;
1425
+ /** Latest version string. */
1426
+ version: string;
1427
+ /** ISO 8601 publication timestamp. */
1428
+ timestamp: string;
1429
+ /** Whether the publisher is verified. */
1430
+ verified: boolean;
1431
+ /** Average rating (0–5 scale), absent if no reviews. */
1432
+ averageRating?: number;
1433
+ /** Number of reviews. */
1434
+ reviewCount?: number;
1435
+ /** Total download count. */
1436
+ downloadCount: number;
1437
+ /** Display name for UI. */
1438
+ displayName: string;
1439
+ /** Short description. */
1440
+ description: string;
1441
+ /** Whether the extension is deprecated. */
1442
+ deprecated: boolean;
1443
+ }
1444
+ /**
1445
+ * Response from `GET /api/-/search`.
1446
+ */
1447
+ interface OpenVSXSearchResult {
1448
+ /** Echo of the requested offset. */
1449
+ offset: number;
1450
+ /** Total number of matching extensions. */
1451
+ totalSize: number;
1452
+ /** Extensions on this page. */
1453
+ extensions: OpenVSXSearchEntry[];
1454
+ }
1455
+ /**
1456
+ * Full extension metadata returned by `GET /api/{namespace}/{extension}`.
1457
+ */
1458
+ interface OpenVSXExtension {
1459
+ /** Namespace API URL. */
1460
+ namespaceUrl: string;
1461
+ /** Reviews API URL. */
1462
+ reviewsUrl: string;
1463
+ /** Extension API URL. */
1464
+ url?: string;
1465
+ /** All versions API URL. */
1466
+ allVersionsUrl: string;
1467
+ /** File download URLs for this version. */
1468
+ files: OpenVSXFileMap;
1469
+ /** Extension name. */
1470
+ name: string;
1471
+ /** Namespace / publisher. */
1472
+ namespace: string;
1473
+ /** Version string. */
1474
+ version: string;
1475
+ /** Target platform (e.g., `'universal'`). */
1476
+ targetPlatform: string;
1477
+ /** Publisher information. */
1478
+ publishedBy: OpenVSXUser;
1479
+ /** Whether the publisher is verified. */
1480
+ verified: boolean;
1481
+ /** Whether publisher is unrelated to namespace owner. */
1482
+ unrelatedPublisher: boolean;
1483
+ /** Namespace access level (e.g., `'restricted'`). */
1484
+ namespaceAccess: string;
1485
+ /** Map of version string → API URL. */
1486
+ allVersions: Record<string, string>;
1487
+ /** Total download count. */
1488
+ downloadCount: number;
1489
+ /** Number of reviews. */
1490
+ reviewCount: number;
1491
+ /** ISO 8601 publication timestamp. */
1492
+ timestamp: string;
1493
+ /** Version aliases (e.g., `['latest']`). */
1494
+ versionAlias: string[];
1495
+ /** Whether this is a pre-release version. */
1496
+ preRelease: boolean;
1497
+ /** Whether this is a preview extension. */
1498
+ preview: boolean;
1499
+ /** Whether this extension is deprecated. */
1500
+ deprecated: boolean;
1501
+ /** Whether this extension is downloadable. */
1502
+ downloadable: boolean;
1503
+ /** Display name for UI. */
1504
+ displayName: string;
1505
+ /** Namespace display name. */
1506
+ namespaceDisplayName: string;
1507
+ /** Short description. */
1508
+ description: string;
1509
+ /** Engine compatibility (e.g., `{ vscode: '^1.75.0' }`). */
1510
+ engines: Record<string, string>;
1511
+ /** Extension categories. */
1512
+ categories: string[];
1513
+ /** Extension tags / keywords. */
1514
+ tags: string[];
1515
+ /** Extension kind (e.g., `['ui', 'workspace']`). */
1516
+ extensionKind: string[];
1517
+ /** License identifier (e.g., `'MIT'`). May be absent. */
1518
+ license?: string;
1519
+ /** Homepage URL. May be absent. */
1520
+ homepage?: string;
1521
+ /** Repository URL. May be absent. */
1522
+ repository?: string;
1523
+ /** Bug tracker URL. May be absent. */
1524
+ bugs?: string;
1525
+ /** Sponsor link URL. May be absent. */
1526
+ sponsorLink?: string;
1527
+ /** Gallery banner color. May be absent. */
1528
+ galleryColor?: string;
1529
+ /** Gallery banner theme. May be absent. */
1530
+ galleryTheme?: string;
1531
+ /** Localized languages. */
1532
+ localizedLanguages: string[];
1533
+ /** Hard dependency extension IDs. */
1534
+ dependencies: string[];
1535
+ /** Bundled extension IDs. */
1536
+ bundledExtensions: string[];
1537
+ /** Platform-specific download URLs (platform → VSIX URL). */
1538
+ downloads: Record<string, string>;
1539
+ }
1540
+ /**
1541
+ * Request parameters for `GET /api/-/query`.
1542
+ */
1543
+ interface OpenVSXQueryParams {
1544
+ /** Filter by namespace name. */
1545
+ namespaceName?: string;
1546
+ /** Filter by extension name. */
1547
+ extensionName?: string;
1548
+ /** Filter by version string. */
1549
+ extensionVersion?: string;
1550
+ /** Filter by `namespace.name` extension ID. */
1551
+ extensionId?: string;
1552
+ /** Filter by extension UUID. */
1553
+ extensionUuid?: string;
1554
+ /** Filter by namespace UUID. */
1555
+ namespaceUuid?: string;
1556
+ /** Include all versions (default: false). */
1557
+ includeAllVersions?: boolean;
1558
+ /** Filter by target platform. */
1559
+ targetPlatform?: OpenVSXTargetPlatform;
1560
+ /** Number of results per page (default: 100). */
1561
+ size?: number;
1562
+ /** Zero-based page offset (default: 0). */
1563
+ offset?: number;
1564
+ }
1565
+ /**
1566
+ * Response from `GET /api/-/query`.
1567
+ */
1568
+ interface OpenVSXQueryResult {
1569
+ /** Echo of the requested offset. */
1570
+ offset: number;
1571
+ /** Total number of matching extensions. */
1572
+ totalSize: number;
1573
+ /** Full extension metadata objects. */
1574
+ extensions: OpenVSXExtension[];
1575
+ }
1576
+ /**
1577
+ * Namespace information from `GET /api/{namespace}`.
1578
+ */
1579
+ interface OpenVSXNamespace {
1580
+ /** Namespace name (e.g., `'ms-python'`). */
1581
+ name: string;
1582
+ /** Map of extension name → API URL. */
1583
+ extensions: Record<string, string>;
1584
+ /** Whether the namespace is verified. */
1585
+ verified: boolean;
1586
+ /** Access level (e.g., `'restricted'`). */
1587
+ access: string;
1588
+ }
1589
+ /**
1590
+ * Namespace details from `GET /api/{namespace}/details`.
1591
+ */
1592
+ interface OpenVSXNamespaceDetails {
1593
+ /** Namespace name. */
1594
+ name: string;
1595
+ /** Display name. */
1596
+ displayName: string;
1597
+ /** Whether the namespace is verified. */
1598
+ verified: boolean;
1599
+ /** Social media links. */
1600
+ socialLinks: {
1601
+ twitter?: string;
1602
+ linkedin?: string;
1603
+ github?: string;
1604
+ };
1605
+ /** Extensions in this namespace. */
1606
+ extensions: OpenVSXSearchEntry[];
1607
+ }
1608
+ /**
1609
+ * Response from `GET /api/{namespace}/{extension}/versions`.
1610
+ */
1611
+ interface OpenVSXVersionsResult {
1612
+ /** Echo of the requested offset. */
1613
+ offset: number;
1614
+ /** Total number of versions. */
1615
+ totalSize: number;
1616
+ /** Map of version string → API URL. */
1617
+ versions: Record<string, string>;
1618
+ }
1619
+ /**
1620
+ * A single version reference entry.
1621
+ */
1622
+ interface OpenVSXVersionReferenceEntry {
1623
+ /** API URL for this version. */
1624
+ url: string;
1625
+ /** Version string. */
1626
+ version: string;
1627
+ /** Target platform. */
1628
+ targetPlatform: string;
1629
+ /** Engine compatibility. */
1630
+ engines: Record<string, string>;
1631
+ /** File download URLs. */
1632
+ files: Pick<OpenVSXFileMap, 'download' | 'sha256' | 'signature' | 'publicKey'>;
1633
+ }
1634
+ /**
1635
+ * Response from `GET /api/{namespace}/{extension}/version-references`.
1636
+ */
1637
+ interface OpenVSXVersionReferencesResult {
1638
+ /** Echo of the requested offset. */
1639
+ offset: number;
1640
+ /** Total number of version references. */
1641
+ totalSize: number;
1642
+ /** Version reference entries. */
1643
+ versions: OpenVSXVersionReferenceEntry[];
1644
+ }
1645
+ /**
1646
+ * A single extension review.
1647
+ */
1648
+ interface OpenVSXReview {
1649
+ /** Review author. */
1650
+ user: OpenVSXUser;
1651
+ /** ISO 8601 timestamp. */
1652
+ timestamp: string;
1653
+ /** Review comment (may be empty). */
1654
+ comment: string;
1655
+ /** Rating (1–5 integer). */
1656
+ rating: number;
1657
+ }
1658
+ /**
1659
+ * Response from `GET /api/{namespace}/{extension}/reviews`.
1660
+ */
1661
+ interface OpenVSXReviewList {
1662
+ /** URL for posting a new review (requires auth). */
1663
+ postUrl: string;
1664
+ /** URL for deleting a review (requires auth). */
1665
+ deleteUrl: string;
1666
+ /** All reviews for this extension. */
1667
+ reviews: OpenVSXReview[];
1668
+ }
1669
+ /**
1670
+ * Successful API response wrapper.
1671
+ */
1672
+ interface OpenVSXApiSuccess<T> {
1673
+ ok: true;
1674
+ data: T;
1675
+ }
1676
+ /**
1677
+ * Failed API response wrapper.
1678
+ */
1679
+ interface OpenVSXApiError {
1680
+ ok: false;
1681
+ /** HTTP status code (0 for network errors). */
1682
+ statusCode: number;
1683
+ /** Error message. */
1684
+ error: string;
1685
+ }
1686
+ /**
1687
+ * Discriminated union for API responses.
1688
+ */
1689
+ type OpenVSXApiResult<T> = OpenVSXApiSuccess<T> | OpenVSXApiError;
1690
+
1691
+ /**
1692
+ * Typed client for the Open VSX Registry REST API.
1693
+ *
1694
+ * Provides typed methods for searching, querying, and fetching extension
1695
+ * metadata from Open VSX. Uses the global `fetch` API with an injectable
1696
+ * override for testing.
1697
+ *
1698
+ * @see https://open-vsx.org/api
1699
+ * @see https://github.com/eclipse/openvsx/wiki/Using-the-Registry-API
1700
+ */
1701
+
1702
+ /** Configuration options for the Open VSX client. */
1703
+ interface OpenVSXClientOptions {
1704
+ /** Base URL for the Open VSX API (default: `'https://open-vsx.org/api'`). */
1705
+ baseUrl?: string;
1706
+ /** Custom `fetch` implementation (default: `globalThis.fetch`). */
1707
+ fetch?: typeof globalThis.fetch;
1708
+ }
1709
+ /**
1710
+ * Typed client for the Open VSX Registry REST API.
1711
+ *
1712
+ * All methods return a discriminated union `OpenVSXApiResult<T>` — either
1713
+ * `{ ok: true, data: T }` on success or `{ ok: false, statusCode, error }`
1714
+ * on failure. No exceptions are thrown for API or network errors.
1715
+ *
1716
+ * @example
1717
+ * ```typescript
1718
+ * const client = new OpenVSXClient()
1719
+ * const result = await client.search({ query: 'python' })
1720
+ * if (result.ok) {
1721
+ * console.log(result.data.extensions)
1722
+ * }
1723
+ * ```
1724
+ */
1725
+ declare class OpenVSXClient {
1726
+ private readonly baseUrl;
1727
+ private readonly fetch;
1728
+ constructor(options?: OpenVSXClientOptions);
1729
+ /**
1730
+ * Search extensions by text query.
1731
+ *
1732
+ * @param params - Search parameters (query, category, sort, pagination)
1733
+ * @returns Paginated search results
1734
+ */
1735
+ search(params?: OpenVSXSearchParams): Promise<OpenVSXApiResult<OpenVSXSearchResult>>;
1736
+ /**
1737
+ * Query extensions with structured field matching.
1738
+ *
1739
+ * @param params - Query parameters (namespace, extension name, ID, UUID, etc.)
1740
+ * @returns Paginated query results with full extension metadata
1741
+ */
1742
+ query(params?: OpenVSXQueryParams): Promise<OpenVSXApiResult<OpenVSXQueryResult>>;
1743
+ /**
1744
+ * Get extension metadata (latest version or specific version).
1745
+ *
1746
+ * @param namespace - Publisher namespace (e.g., `'ms-python'`)
1747
+ * @param name - Extension name (e.g., `'python'`)
1748
+ * @param version - Specific version string (omit for latest)
1749
+ * @param targetPlatform - Target platform filter
1750
+ * @returns Full extension metadata
1751
+ */
1752
+ getExtension(namespace: string, name: string, version?: string, targetPlatform?: string): Promise<OpenVSXApiResult<OpenVSXExtension>>;
1753
+ /**
1754
+ * Get namespace information with extension listing.
1755
+ *
1756
+ * @param namespace - Namespace name (e.g., `'ms-python'`)
1757
+ * @returns Namespace with map of extension name → API URL
1758
+ */
1759
+ getNamespace(namespace: string): Promise<OpenVSXApiResult<OpenVSXNamespace>>;
1760
+ /**
1761
+ * Get namespace details including display name, social links, and extensions.
1762
+ *
1763
+ * @param namespace - Namespace name
1764
+ * @returns Namespace details with social links and extension summaries
1765
+ */
1766
+ getNamespaceDetails(namespace: string): Promise<OpenVSXApiResult<OpenVSXNamespaceDetails>>;
1767
+ /**
1768
+ * List extension versions with pagination.
1769
+ *
1770
+ * @param namespace - Publisher namespace
1771
+ * @param name - Extension name
1772
+ * @param params - Pagination and platform filter options
1773
+ * @returns Paginated version listing (version string → API URL)
1774
+ */
1775
+ getVersions(namespace: string, name: string, params?: {
1776
+ size?: number;
1777
+ offset?: number;
1778
+ targetPlatform?: string;
1779
+ }): Promise<OpenVSXApiResult<OpenVSXVersionsResult>>;
1780
+ /**
1781
+ * List version references with engine compatibility and file URLs.
1782
+ *
1783
+ * @param namespace - Publisher namespace
1784
+ * @param name - Extension name
1785
+ * @param params - Pagination and platform filter options
1786
+ * @returns Paginated version references
1787
+ */
1788
+ getVersionReferences(namespace: string, name: string, params?: {
1789
+ size?: number;
1790
+ offset?: number;
1791
+ targetPlatform?: string;
1792
+ }): Promise<OpenVSXApiResult<OpenVSXVersionReferencesResult>>;
1793
+ /**
1794
+ * Get all reviews for an extension.
1795
+ *
1796
+ * @param namespace - Publisher namespace
1797
+ * @param name - Extension name
1798
+ * @returns Review list with all reviews (not paginated)
1799
+ */
1800
+ getReviews(namespace: string, name: string): Promise<OpenVSXApiResult<OpenVSXReviewList>>;
1801
+ /**
1802
+ * Build a VSIX download URL for a specific extension version.
1803
+ *
1804
+ * This is a pure URL builder — no network request is made.
1805
+ *
1806
+ * @param namespace - Publisher namespace
1807
+ * @param name - Extension name
1808
+ * @param version - Version string
1809
+ * @param targetPlatform - Target platform (omit for universal)
1810
+ * @returns Full download URL
1811
+ */
1812
+ getDownloadUrl(namespace: string, name: string, version: string, targetPlatform?: string): string;
1813
+ /**
1814
+ * Build a URL for accessing an extension file (README, icon, etc.).
1815
+ *
1816
+ * This is a pure URL builder — no network request is made.
1817
+ *
1818
+ * @param namespace - Publisher namespace
1819
+ * @param name - Extension name
1820
+ * @param version - Version string
1821
+ * @param filePath - Relative file path within the extension
1822
+ * @param targetPlatform - Target platform (omit for universal)
1823
+ * @returns Full file URL
1824
+ */
1825
+ resolveFileUrl(namespace: string, name: string, version: string, filePath: string, targetPlatform?: string): string;
1826
+ /** Build a full URL with optional query parameters. */
1827
+ private _buildUrl;
1828
+ /** Execute a GET request and return a typed result. */
1829
+ private _get;
1830
+ }
1831
+
1832
+ /** Federation mode determining upstream behavior. */
1833
+ type FederationMode = 'proxy' | 'mirror' | 'standalone';
1834
+ /** Filter criteria applied to upstream extensions. */
1835
+ interface FederationFilter {
1836
+ /**
1837
+ * Only allow declarative extensions (no runtime code needed).
1838
+ *
1839
+ * **Note:** This filter requires `contributionPoints` to be supplied
1840
+ * externally (e.g., from VSIX scanning). When contribution points are
1841
+ * not available (as in `search()` and `getExtension()` which only have
1842
+ * API metadata), this filter is skipped for that extension.
1843
+ */
1844
+ declarativeOnly?: boolean;
1845
+ /** Whitelist of allowed categories (empty array = all allowed). */
1846
+ allowedCategories?: string[];
1847
+ /** Blacklist of publisher namespaces. */
1848
+ blockedPublishers?: string[];
1849
+ }
1850
+ /** Federation client configuration. */
1851
+ interface FederationConfig {
1852
+ /** Federation mode. */
1853
+ mode: FederationMode;
1854
+ /** Upstream registry URL (default: `'https://open-vsx.org/api'`). */
1855
+ upstream?: string;
1856
+ /** Filter configuration. */
1857
+ filter?: FederationFilter;
1858
+ /** Cache TTL hint in seconds for consumers (default: 3600). */
1859
+ cacheTtlSeconds?: number;
1860
+ }
1861
+ /** A deterministic cache key with suggested TTL. */
1862
+ interface FederationCacheKey {
1863
+ /** Deterministic cache key string. */
1864
+ key: string;
1865
+ /** Suggested TTL in seconds. */
1866
+ ttlSeconds: number;
1867
+ }
1868
+ /** Result of a federated search operation. */
1869
+ interface FederatedSearchResult {
1870
+ /** Extensions that passed all filters. */
1871
+ extensions: OpenVSXSearchEntry[];
1872
+ /** Total result count from upstream (before filtering). */
1873
+ totalSize: number;
1874
+ /** Count of extensions removed by filters. */
1875
+ filtered: number;
1876
+ /** Where the data came from. */
1877
+ source: 'upstream' | 'cache' | 'local';
1878
+ /** Cache key for this request. */
1879
+ cacheKey: FederationCacheKey;
1880
+ }
1881
+ /** Result of a federated extension lookup. */
1882
+ interface FederatedExtensionResult {
1883
+ /** The extension, or null if not found or filtered. */
1884
+ extension: OpenVSXExtension | null;
1885
+ /** Whether the extension was blocked by filters. */
1886
+ filtered: boolean;
1887
+ /** Reason the extension was filtered. */
1888
+ filterReason?: string;
1889
+ /** Where the data came from. */
1890
+ source: 'upstream' | 'cache' | 'local';
1891
+ /** Cache key for this request. */
1892
+ cacheKey: FederationCacheKey;
1893
+ }
1894
+ /**
1895
+ * Generate a deterministic cache key from an endpoint and sorted params.
1896
+ *
1897
+ * @param endpoint - API endpoint name (e.g., `'search'`, `'extension'`)
1898
+ * @param params - Key-value parameters to include in the key
1899
+ * @returns Deterministic cache key string
1900
+ */
1901
+ declare function generateCacheKey(endpoint: string, params?: Record<string, string>): string;
1902
+ /**
1903
+ * Check if an extension passes all filter criteria.
1904
+ *
1905
+ * @param extension - Extension metadata to check
1906
+ * @param filter - Filter criteria to apply
1907
+ * @param contributionPoints - Contribution point keys from the extension manifest
1908
+ * @returns Whether the extension is allowed and the reason if not
1909
+ */
1910
+ declare function matchesFilter(extension: {
1911
+ categories?: string[];
1912
+ namespace?: string;
1913
+ name?: string;
1914
+ }, filter: FederationFilter, contributionPoints?: string[]): {
1915
+ allowed: boolean;
1916
+ reason?: string;
1917
+ };
1918
+ /**
1919
+ * Check if an extension uses only declarative contribution points.
1920
+ *
1921
+ * @param contributionPoints - Contribution point keys from the extension manifest
1922
+ * @returns True if all contribution points are declarative
1923
+ */
1924
+ declare function isDeclarativeExtension(contributionPoints: string[]): boolean;
1925
+ /**
1926
+ * Federation protocol client that wraps `OpenVSXClient` with mode-based
1927
+ * behavior, filter application, and cache key generation.
1928
+ */
1929
+ declare class FederationClient {
1930
+ private readonly config;
1931
+ private readonly upstream;
1932
+ private readonly cacheTtl;
1933
+ /**
1934
+ * Create a new federation client.
1935
+ *
1936
+ * @param config - Federation configuration
1937
+ * @param upstreamClient - Optional pre-configured OpenVSXClient (created from config if not provided)
1938
+ */
1939
+ constructor(config: FederationConfig, upstreamClient?: OpenVSXClient);
1940
+ /**
1941
+ * Search extensions with filters applied.
1942
+ *
1943
+ * In standalone mode, returns empty results. In proxy/mirror mode,
1944
+ * delegates to upstream and applies filters.
1945
+ */
1946
+ search(params?: OpenVSXSearchParams): Promise<OpenVSXApiResult<FederatedSearchResult>>;
1947
+ /**
1948
+ * Get a single extension with filter check.
1949
+ *
1950
+ * In standalone mode, returns null. In proxy/mirror mode,
1951
+ * fetches from upstream and checks against filters.
1952
+ */
1953
+ getExtension(namespace: string, name: string, version?: string): Promise<OpenVSXApiResult<FederatedExtensionResult>>;
1954
+ /**
1955
+ * Get a VSIX download URL for a specific extension version.
1956
+ *
1957
+ * Returns null in standalone mode (no upstream available).
1958
+ */
1959
+ getDownloadUrl(namespace: string, name: string, version: string, targetPlatform?: string): string | null;
1960
+ /**
1961
+ * Build a cache key for a given endpoint and parameters.
1962
+ */
1963
+ getCacheKey(endpoint: string, params?: Record<string, string>): FederationCacheKey;
1964
+ /**
1965
+ * Get a readonly copy of the current federation configuration.
1966
+ */
1967
+ getConfig(): Readonly<FederationConfig>;
1968
+ /** Convert search params to a plain Record for cache key generation. */
1969
+ private _searchParamsToRecord;
1970
+ }
1971
+
1972
+ export { type AuthenticationContribution, type Badge, type BreakpointContribution, type BugsReference, type CodeActionContribution, type CodeActionKindEntry, type ColorContribution, type ColorDefaults, type CommandContribution, type CompatibilityLevel, type CompatibilityReport, type CompatibilityScore, type ConfigurationContribution, type ConfigurationPropertySchema, type ConfigurationScope, type ContributionPointScore, type CustomEditorContribution, type CustomEditorPriority, type CustomEditorSelector, DECLARATIVE_CONTRIBUTION_POINTS, type DebugConfigurationSnippet, type DebuggerContribution, type DependencyEdge, type DependencyGraph, type DependencyResolution, type DependencyResolutionError, type DependencyResolutionSuccess, type EditPresentation, type ExtensionCapabilities, type ExtensionCategory, type ExtensionKind, type ExtensionNode, type ExtensionRegistry, type ExtensionScope, type ExtensionSource, type FederatedExtensionResult, type FederatedSearchResult, type FederationCacheKey, FederationClient, type FederationConfig, type FederationFilter, type FederationMode, type FileLocationKind, type FlowStateManifest, type GrammarContribution, type IconContribution, type IconDefault, type IconDefinition, type IconReference, type IconThemeContribution, type InstalledExtension, type JsonSchemaType, type JsonValidationContribution, type KeybindingContribution, type LanguageContribution, type LanguageIcon, type LocalizationContribution, type LocalizationTranslation, type LocalizedString, type MenuContribution, type NotebookContribution, type NotebookRendererContribution, type NotebookRendererMessaging, type NotebookSelector, type OpenVSXApiError, type OpenVSXApiResult, type OpenVSXApiSuccess, OpenVSXClient, type OpenVSXClientOptions, type OpenVSXExtension, type OpenVSXFileMap, type OpenVSXNamespace, type OpenVSXNamespaceDetails, type OpenVSXQueryParams, type OpenVSXQueryResult, type OpenVSXReview, type OpenVSXReviewList, type OpenVSXSearchEntry, type OpenVSXSearchParams, type OpenVSXSearchResult, type OpenVSXSearchSortBy, type OpenVSXTargetPlatform, type OpenVSXUser, type OpenVSXVersionReferenceEntry, type OpenVSXVersionReferencesResult, type OpenVSXVersionsResult, PLATFORM_SUPPORT, type Platform, type ProblemApplyTo, type ProblemBackground, type ProblemMatcherContribution, type ProblemPatternContribution, type ProblemSeverity, type ProductIconThemeContribution, type RepositoryReference, type ResourceLabelFormatterContribution, SUPPORT_WEIGHTS, type SemanticTokenModifierContribution, type SemanticTokenScopeContribution, type SemanticTokenTypeContribution, type SnippetContribution, type StartEntryContribution, type SubmenuContribution, type SupportStatus, type TaskDefinitionContribution, type TerminalContribution, type TerminalProfile, type ThemeContribution, type TypescriptServerPluginContribution, type UITheme, type UntrustedWorkspaceCapability, type VSCodeContributes, type VSCodeExtensionManifest, type ViewContainerContribution, type ViewContribution, type ViewType, type ViewVisibility, type ViewWelcomeContribution, type VirtualWorkspaceCapability, VsixScanError, type VsixScanErrorCode, type VsixScanResult, type WalkthroughContribution, type WalkthroughStepContribution, type WalkthroughStepMedia, buildCompatibilityReport, buildDependencyGraph, classifyDeclarative, detectApiNamespaces, enumerateContributionPoints, extractDependencyNode, flowStateToVsCode, generateCacheKey, generateRecommendations, getPlatformSupport, isDeclarativeExtension, mapActivationEvents, mapCategory, mapExtensionKind, matchesFilter, normalizeExtensionId, resolveDependencies, reverseActivationEvents, reverseCategory, reverseExtensionKind, scanVsix, scoreExtension, vsCodeToFlowState };