@punica/editor 1.0.6 → 1.0.8

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 (69) hide show
  1. package/dist/index.bundle.esm.js +2 -1
  2. package/dist/index.bundle.esm.js.map +1 -1
  3. package/dist/index.bundle.umd.js +2 -1
  4. package/dist/index.bundle.umd.js.map +1 -1
  5. package/package.json +28 -3
  6. package/types/index.d.ts +120 -11
  7. package/types/punica.module.bootstrap.d.ts +45 -0
  8. package/types/punica.module.capability.d.ts +359 -0
  9. package/types/punica.module.extensions.api.d.ts +766 -0
  10. package/types/punica.module.extensions.settings.d.ts +106 -0
  11. package/types/punica.module.flow.agent.d.ts +75 -0
  12. package/types/punica.module.flow.api.d.ts +128 -0
  13. package/types/punica.module.flow.d.ts +490 -0
  14. package/types/punica.module.flow.engine.d.ts +228 -0
  15. package/types/punica.module.flow.mcp.d.ts +26 -0
  16. package/types/punica.module.flow.notebook.d.ts +210 -0
  17. package/types/punica.module.flow.primitives.d.ts +700 -0
  18. package/types/punica.module.flow.shell.d.ts +374 -0
  19. package/types/punica.module.kernel.ai.d.ts +462 -0
  20. package/types/punica.module.kernel.commands.d.ts +49 -0
  21. package/types/punica.module.kernel.events.d.ts +274 -0
  22. package/types/punica.module.kernel.history.d.ts +20 -0
  23. package/types/punica.module.kernel.llm.d.ts +343 -0
  24. package/types/punica.module.kernel.notifications.d.ts +64 -0
  25. package/types/punica.module.kernel.policy.d.ts +273 -0
  26. package/types/punica.module.kernel.tasks.d.ts +107 -0
  27. package/types/punica.module.kernel.timeServer.d.ts +16 -0
  28. package/types/punica.module.runtime.api.d.ts +214 -0
  29. package/types/punica.module.runtime.capabilities.d.ts +175 -0
  30. package/types/punica.module.runtime.compute.d.ts +339 -0
  31. package/types/punica.module.runtime.datasets.d.ts +234 -0
  32. package/types/punica.module.runtime.fs.d.ts +385 -0
  33. package/types/punica.module.runtime.harness.d.ts +246 -0
  34. package/types/punica.module.runtime.host.d.ts +272 -0
  35. package/types/punica.module.runtime.inference.d.ts +164 -0
  36. package/types/punica.module.runtime.lifecycle.d.ts +15 -0
  37. package/types/punica.module.runtime.llm.d.ts +470 -0
  38. package/types/punica.module.runtime.mcp.d.ts +139 -0
  39. package/types/punica.module.runtime.modelRuntimes.d.ts +90 -0
  40. package/types/punica.module.runtime.models.d.ts +254 -0
  41. package/types/punica.module.runtime.search.d.ts +59 -0
  42. package/types/punica.module.runtime.secrets.d.ts +26 -0
  43. package/types/punica.module.runtime.tasks.d.ts +27 -0
  44. package/types/punica.module.runtime.vcs.d.ts +67 -0
  45. package/types/punica.module.runtime.vectors.d.ts +74 -0
  46. package/types/punica.module.runtime.workspace.d.ts +134 -0
  47. package/types/punica.module.shell.activityBar.d.ts +42 -0
  48. package/types/punica.module.shell.components.d.ts +87 -0
  49. package/types/punica.module.shell.contentTabs.d.ts +33 -0
  50. package/types/punica.module.shell.dragDrop.d.ts +25 -0
  51. package/types/punica.module.shell.keyboardShortcuts.d.ts +38 -0
  52. package/types/punica.module.shell.layout.d.ts +106 -0
  53. package/types/punica.module.shell.markdown.d.ts +36 -0
  54. package/types/punica.module.shell.panelTabs.d.ts +71 -0
  55. package/types/punica.module.shell.profile.d.ts +278 -0
  56. package/types/punica.module.shell.statusbar.d.ts +26 -0
  57. package/types/punica.module.shell.view.d.ts +455 -0
  58. package/types/punica.module.shell.views.d.ts +150 -0
  59. package/types/punica.module.test.d.ts +562 -0
  60. package/types/punica.module.activityBar.d.ts +0 -21
  61. package/types/punica.module.commands.d.ts +0 -21
  62. package/types/punica.module.dragDrop.d.ts +0 -23
  63. package/types/punica.module.extensions.d.ts +0 -157
  64. package/types/punica.module.history.d.ts +0 -18
  65. package/types/punica.module.keyboardShortcuts.d.ts +0 -29
  66. package/types/punica.module.layout.d.ts +0 -22
  67. package/types/punica.module.statusbar.d.ts +0 -21
  68. package/types/punica.module.timeServer.d.ts +0 -14
  69. package/types/punica.module.view.d.ts +0 -8
@@ -0,0 +1,766 @@
1
+ declare module 'punica' {
2
+ export namespace Extensions {
3
+ interface BaseView {
4
+ id: string;
5
+ name: string;
6
+ title?: string;
7
+ label?: string;
8
+ icon?: string;
9
+ alignment?: 'primary' | 'secondary';
10
+ content?: HTMLElement;
11
+ /**
12
+ * Capability id to execute when the view is activated.
13
+ * For activity bar items this will be invoked when the icon is clicked.
14
+ */
15
+ capability?: string;
16
+ }
17
+
18
+ /**
19
+ * A single icon-button action shown in the panel tab bar's toolbar
20
+ * area while the owning view is the active panel view. Clicking the
21
+ * button dispatches `command` through the kernel command manager
22
+ * (the single command choke point — lazy-activates the owning
23
+ * extension when needed).
24
+ */
25
+ interface PanelToolbarAction {
26
+ /** Unique within the owning view. */
27
+ id: string;
28
+ /** Tooltip / aria-label. */
29
+ title: string;
30
+ /** Raw HTML icon markup, e.g. '<i class="fa-solid fa-plus"></i>'. */
31
+ icon?: string;
32
+ /** Command id dispatched on click. */
33
+ command: string;
34
+ }
35
+
36
+ interface Views {
37
+ primarySidebar?: BaseView;
38
+ secondarySidebar?: BaseView;
39
+ /**
40
+ * Contextual detail drawer (overlay). TRANSIENT: its content is
41
+ * parameterized per open, so the shell re-renders the view's
42
+ * provider on every reveal, and hiding unmounts the drawer.
43
+ */
44
+ contentSidebar?: BaseView;
45
+ content?: BaseView;
46
+ /**
47
+ * Declarative bottom-panel tab. The tab appears in the panel tab
48
+ * strip at load time (like activity bar items); content renders
49
+ * only on reveal — via the extension's ViewProvider, or, for
50
+ * pre-migration extensions, via the bound `capability` command.
51
+ */
52
+ panel?: BaseView & {
53
+ order?: number;
54
+ /**
55
+ * Toolbar actions rendered in the panel tab bar's right-side
56
+ * toolbar area, visible only while this view is the active
57
+ * panel view. Ignored by older cores.
58
+ */
59
+ toolbar?: PanelToolbarAction[];
60
+ };
61
+ activityBar?: Pick<BaseView, 'id' | 'name'> &
62
+ Required<Pick<BaseView, 'title' | 'icon' | 'alignment'>>;
63
+ statusBar?: Pick<BaseView, 'id' | 'name'> &
64
+ Required<Pick<BaseView, 'title' | 'label' | 'icon' | 'alignment'>>;
65
+ }
66
+
67
+ interface Command {
68
+ command: string;
69
+ title: string;
70
+ }
71
+
72
+ interface Keybinding {
73
+ /**
74
+ * Capability id to execute when the keybinding is triggered.
75
+ */
76
+ capability?: string;
77
+ key: string;
78
+ when: string;
79
+ }
80
+
81
+ interface MenuItem {
82
+ /**
83
+ * Capability id to execute when the menu item is selected.
84
+ */
85
+ capability?: string;
86
+ when: string;
87
+ group: string;
88
+ }
89
+
90
+ interface Menu {
91
+ commandPalette: MenuItem;
92
+ context: MenuItem;
93
+ }
94
+
95
+ interface BooleanProperty {
96
+ type: 'boolean';
97
+ default: boolean;
98
+ description: string;
99
+ }
100
+
101
+ interface StringProperty {
102
+ type: 'string';
103
+ default: string;
104
+ description: string;
105
+ enum?: string[];
106
+ }
107
+
108
+ interface NumberProperty {
109
+ type: 'number';
110
+ default: number;
111
+ description: string;
112
+ }
113
+
114
+ interface ArrayProperty {
115
+ type: 'array';
116
+ default: any[];
117
+ description: string;
118
+ items: any;
119
+ }
120
+
121
+ interface ObjectProperty {
122
+ type: 'object';
123
+ default: { [key: string]: any };
124
+ description: string;
125
+ properties: { [key: string]: Property };
126
+ }
127
+
128
+ type Property =
129
+ | BooleanProperty
130
+ | StringProperty
131
+ | NumberProperty
132
+ | ArrayProperty
133
+ | ObjectProperty;
134
+
135
+ interface Configuration {
136
+ title: string;
137
+ properties: {
138
+ [key: string]: Property;
139
+ };
140
+ }
141
+
142
+ interface MarketplaceScreenshot {
143
+ path: string;
144
+ label?: string;
145
+ }
146
+
147
+ interface MarketplacePermissions {
148
+ fs?: 'none' | 'read-only' | 'read-write';
149
+ network?: 'none' | 'limited' | 'full';
150
+ kernels?: string[];
151
+ }
152
+
153
+ interface MarketplaceMeta {
154
+ /**
155
+ * Relative path to the primary icon for this extension (used in
156
+ * marketplace listings and, when appropriate, activity bar).
157
+ */
158
+ icon?: string;
159
+ /**
160
+ * Optional banner / hero image shown on the extension detail page.
161
+ */
162
+ banner?: string;
163
+ /**
164
+ * Relative path to the README file that describes this extension in
165
+ * more detail. Typically "README.md" at the extension root.
166
+ */
167
+ readmePath?: string;
168
+ /**
169
+ * Optional path to a changelog file.
170
+ */
171
+ changelogPath?: string;
172
+ /**
173
+ * Publisher / owner identifier for this extension (e.g. "ivyx").
174
+ */
175
+ publisher?: string;
176
+ /**
177
+ * Homepage or marketing site for this extension.
178
+ */
179
+ homepage?: string;
180
+ /**
181
+ * Repository URL for the extension source code.
182
+ */
183
+ repository?: string;
184
+ /**
185
+ * Optional screenshots shown on the detail page.
186
+ */
187
+ screenshots?: MarketplaceScreenshot[];
188
+ /**
189
+ * High-level capabilities / tags used for discovery and filtering
190
+ * in the marketplace (e.g. "flow", "ai-assistant", "notebook").
191
+ */
192
+ capabilities?: string[];
193
+ /**
194
+ * Declared permissions for this extension. This is advisory metadata
195
+ * that helps users understand what the extension might access.
196
+ */
197
+ permissions?: MarketplacePermissions;
198
+ /**
199
+ * Target platforms / hosts supported by this extension, such as
200
+ * "browser", "electron", or "server".
201
+ */
202
+ platforms?: string[];
203
+ /**
204
+ * Optional base URL for this extension module on a marketplace or
205
+ * extension gallery. When provided, hosts or managers can call
206
+ * Extensions.manager.load(moduleURL) to install/activate it.
207
+ */
208
+ moduleURL?: string;
209
+ }
210
+
211
+ interface FileOpenerIntegration {
212
+ /**
213
+ * Capability id to execute when a matching file is opened.
214
+ */
215
+ capability?: string;
216
+ priority?: number;
217
+ matches?: Runtime.FileMatch[];
218
+ id?: string;
219
+ }
220
+
221
+ /**
222
+ * Extension capability definition — same unified shape as module-level
223
+ * {@link CapabilityDefinition}. Alias (not `extends CapabilityDefinition`
224
+ * inside this namespace) avoids a self-referential empty interface.
225
+ *
226
+ * Extensions declare these in `.punica/capabilities.yaml` using JSON Schema
227
+ * for inputs/outputs.
228
+ */
229
+ type CapabilityDefinition = import('punica').CapabilityDefinition;
230
+
231
+ /**
232
+ * Extension activation lifecycle events.
233
+ *
234
+ * - `onStartup` / `onStartup:begin`:
235
+ * For extensions that should run early during editor startup,
236
+ * after the core systems and layout/render have been initialized.
237
+ * - `onStartup:finish`:
238
+ * For heavy or background work that should start only after
239
+ * the UI + workspace are fully ready / idle (deferred startup).
240
+ * - `onCommand:<commandId>`:
241
+ * Activates the extension the first time the given command is executed.
242
+ * - `onExtension:<extensionName>`:
243
+ * Triggers when another extension is activated.
244
+ * - `onView:<viewId>`:
245
+ * Activates the extension when a specific view (e.g. sidebar/content)
246
+ * is shown for the first time.
247
+ *
248
+ * Other custom activation events are supported as generic strings,
249
+ * but the ones above define the official, documented lifecycle flow.
250
+ */
251
+ type ActivationEvent =
252
+ | 'onStartup'
253
+ | 'onStartup:begin'
254
+ | 'onStartup:finish'
255
+ | `onCommand:${string}`
256
+ | `onExtension:${string}`
257
+ | `onView:${string}`
258
+ | (string & {});
259
+
260
+ interface Integrations {
261
+ keybindings?: Keybinding[];
262
+ menus?: Menu;
263
+ views?: Views;
264
+ configuration?: Configuration;
265
+ fileOpeners?: FileOpenerIntegration[];
266
+ }
267
+
268
+ interface Extension {
269
+ module: Extensions.IExtension;
270
+ moduleURL: string;
271
+ name: string;
272
+ displayName: string;
273
+ description: string;
274
+ version: string;
275
+ main: string;
276
+ categories?: string[];
277
+ tags?: string[];
278
+ activationEvents?: ActivationEvent[];
279
+ dependOns?: string[];
280
+ integrations: Integrations;
281
+ /**
282
+ * When true, the Reader loads `.punica/capabilities.yaml` and populates
283
+ * `capabilities`. Absent/false ⇒ the file is never fetched, so extensions
284
+ * that expose no gateway capabilities don't trigger a speculative 404.
285
+ */
286
+ hasCapabilities?: boolean;
287
+ /**
288
+ * Optional capabilities registry loaded from `.punica/capabilities.yaml`.
289
+ * Keys are capability ids. Populated by the Reader only when
290
+ * `hasCapabilities` is declared in config.yaml.
291
+ */
292
+ capabilities?: Record<string, CapabilityDefinition>;
293
+ /**
294
+ * Instruction classes loaded from `.punica/instruction-classes/*.ic.yaml`.
295
+ * Populated by the Reader during analysis phase; auto-registered into
296
+ * the kernel instructionClassRegistry by the extension manager.
297
+ */
298
+ instructionClasses?: kernel.llm.InstructionClass[];
299
+ engines: {
300
+ punica: string;
301
+ };
302
+ marketplace?: MarketplaceMeta;
303
+ }
304
+
305
+ interface ExtensionDecorator {
306
+ execute(): Promise<Extension>;
307
+ }
308
+
309
+ /**
310
+ * Extension runtime state — dimension A of the lifecycle model.
311
+ * Contains NO UI/visibility state: whether an extension runs as a
312
+ * service and whether its views are shown are orthogonal. View
313
+ * presentation state lives in `punica.shell.Views.manager`, per view.
314
+ */
315
+ type ExtensionRuntimeState =
316
+ | 'loaded'
317
+ | 'activating'
318
+ | 'active'
319
+ | 'deactivating'
320
+ | 'failed';
321
+
322
+ /** Why an activation was requested. */
323
+ type ActivationReason =
324
+ | 'startup:begin'
325
+ | 'startup:finish'
326
+ | 'command'
327
+ | 'view'
328
+ | 'capability'
329
+ | 'extension'
330
+ | 'host';
331
+
332
+ interface ActivationOptions {
333
+ reason?: ActivationReason;
334
+ /** What triggered it: command id, capability id, viewId, extension name. */
335
+ trigger?: string;
336
+ /**
337
+ * 'headless': activation must not change focus-stealing UI state
338
+ * (derived for capability invocations). 'interactive': a
339
+ * user-visible flow. Derived from `reason` when omitted.
340
+ */
341
+ presentation?: 'interactive' | 'headless';
342
+ }
343
+
344
+ interface IExtensionContext {
345
+ /**
346
+ * Why this extension is being activated. `presentation:
347
+ * 'headless'` means a service caller (agent, MCP client, flow)
348
+ * triggered the activation — do not attempt to show UI; defer
349
+ * UI-adjacent warmup until a view is revealed.
350
+ */
351
+ activation: Readonly<{
352
+ reason: ActivationReason;
353
+ trigger?: string;
354
+ presentation: 'interactive' | 'headless';
355
+ }>;
356
+
357
+ /**
358
+ * Disposal bag: everything pushed here is disposed by
359
+ * `punica.extensions.manager.deactivate(name)`.
360
+ */
361
+ subscriptions: Array<{ dispose(): void }>;
362
+
363
+ /**
364
+ * Capability API available during extension activation.
365
+ *
366
+ * Call `registerHandler` for each capability declared in
367
+ * `.punica/capabilities.yaml` that you want to make
368
+ * gateway-invocable. The gateway will invoke the handler after
369
+ * the full 13-stage middleware pipeline runs (policy, audit, etc.).
370
+ *
371
+ * Example:
372
+ * ```ts
373
+ * async activate(context) {
374
+ * context.capabilities.registerHandler('myext.doThing', async (input, ctx) => {
375
+ * return { result: 'ok' };
376
+ * });
377
+ * }
378
+ * ```
379
+ */
380
+ capabilities: {
381
+ /** Register an execution handler for a capability declared by this extension. */
382
+ registerHandler(
383
+ capabilityId: string,
384
+ handler: (input: unknown, ctx: unknown) => Promise<unknown>
385
+ ): void;
386
+ };
387
+
388
+ /**
389
+ * Declarative UI contribution API. Activation NEVER shows UI —
390
+ * register a provider and the shell materializes/renders it
391
+ * lazily on first reveal (user gesture or `shell.revealView`).
392
+ */
393
+ ui: {
394
+ /**
395
+ * Register the render provider for a view declared in this
396
+ * extension's `integrations.views`. Registration alone never
397
+ * shows anything.
398
+ */
399
+ registerViewProvider(
400
+ viewId: string,
401
+ provider: shell.Views.ViewProvider
402
+ ): { dispose(): void };
403
+
404
+ /**
405
+ * Deliberate, audited reveal — a thin shortcut over the
406
+ * `shell.revealView` core capability (the substrate's single
407
+ * visibility mutator). Use sparingly: showing UI should almost
408
+ * always be the user's or the host's decision.
409
+ */
410
+ reveal(viewId: string, options?: { focus?: boolean }): Promise<void>;
411
+
412
+ /**
413
+ * Deliberate, audited hide — a thin shortcut over the
414
+ * `shell.hideView` core capability. The close affordance of
415
+ * transient views (the contentSidebar drawer's close button /
416
+ * Escape) goes through here, never through direct DOM removal.
417
+ */
418
+ hide(viewId: string): Promise<void>;
419
+ };
420
+ }
421
+
422
+ interface StyleHandle {
423
+ id: string;
424
+ dispose(): void;
425
+ }
426
+
427
+ interface StyleOptions {
428
+ /**
429
+ * Target element to append the <style> tag into. Defaults to document.head.
430
+ */
431
+ target?: HTMLElement;
432
+ /**
433
+ * When true, an existing style with the same id will be updated with the
434
+ * new CSS instead of being left untouched.
435
+ */
436
+ overwrite?: boolean;
437
+ /**
438
+ * Optional attributes applied to the created <style> element. Useful for
439
+ * debugging (e.g. data-extension="ivy-nodes").
440
+ */
441
+ attrs?: Record<string, string>;
442
+ }
443
+
444
+ /**
445
+ * Helper API for managing extension-scoped <style> tags.
446
+ *
447
+ * This is a lightweight utility; extensions remain free to manage styles
448
+ * however they like. Using this helper simply standardizes the common
449
+ * pattern of injecting CSS on activate() and cleaning it up on deactivate().
450
+ */
451
+ const Styles: {
452
+ /**
453
+ * Inject a CSS string as a <style> tag. Returns a handle that can be
454
+ * disposed to remove the style.
455
+ */
456
+ register(id: string, css: string, options?: StyleOptions): StyleHandle;
457
+
458
+ /**
459
+ * Remove a previously registered style by id. Safe to call multiple times.
460
+ */
461
+ unregister(id: string): void;
462
+
463
+ /**
464
+ * Check whether a style with the given id is currently registered.
465
+ */
466
+ has(id: string): boolean;
467
+ };
468
+
469
+ interface IExtension {
470
+ activate: (context: IExtensionContext) => Promise<void>;
471
+ deactivate: () => void;
472
+ }
473
+
474
+ interface IExtensionManager {
475
+ /**
476
+ * Load one or more extensions from URL or file path.
477
+ */
478
+ load(extensionPath: string, ...args: string[]): Promise<void>;
479
+
480
+ /**
481
+ * Activate a specific extension by name — start it as a running
482
+ * service. Activation never shows UI; visibility flows through
483
+ * the `shell.revealView` capability.
484
+ *
485
+ * Concurrent calls coalesce (single-flight). A failed activation
486
+ * records `failed` state and rethrows; a later call retries.
487
+ */
488
+ activate(
489
+ extensionName: string,
490
+ options?: ActivationOptions
491
+ ): Promise<void>;
492
+
493
+ /**
494
+ * Deactivate an extension: `active → deactivating → loaded`.
495
+ * Shell unmounts its rendered views (manifest placements stay),
496
+ * `module.deactivate()` runs, `context.subscriptions` are
497
+ * disposed and its capability handlers are removed. A later
498
+ * capability call re-activates headlessly.
499
+ */
500
+ deactivate(extensionName: string): Promise<void>;
501
+
502
+ /**
503
+ * Current runtime state of an extension, or undefined when not
504
+ * loaded.
505
+ */
506
+ getRuntimeState(extensionName: string): ExtensionRuntimeState | undefined;
507
+
508
+ /**
509
+ * Trigger activation of all extensions that declare `onStartup:begin`
510
+ * in their activationEvents.
511
+ */
512
+ startupBegin(): Promise<void>;
513
+
514
+ /**
515
+ * Trigger activation of all extensions that declare `onStartup:finish`
516
+ * in their activationEvents.
517
+ */
518
+ startupFinish(): Promise<void>;
519
+
520
+ /**
521
+ * Get loaded extension metadata by name.
522
+ */
523
+ getExtension(extensionName: string): Extension | undefined;
524
+
525
+ /**
526
+ * Return all loaded extensions metadata as an array. This is primarily
527
+ * used by the Extension Manager UI to list installed extensions.
528
+ */
529
+ getAllExtensions(): Extension[];
530
+
531
+ /**
532
+ * Return the list of extensions that declared `onCommand:<commandId>`
533
+ * activation events.
534
+ */
535
+ getExtensionsForCommand(commandId: string): string[];
536
+
537
+ /**
538
+ * Resolve a capability definition by id across all loaded extensions.
539
+ */
540
+ getCapability(capabilityId: string): CapabilityDefinition | undefined;
541
+
542
+ /**
543
+ * List all capabilities known to the extension manager.
544
+ */
545
+ listCapabilities(): Array<{
546
+ id: string;
547
+ extensionName: string;
548
+ definition: CapabilityDefinition;
549
+ }>;
550
+
551
+ /**
552
+ * Validate a capability input against its declared inputs schema.
553
+ * Early iterations may implement only minimal checks.
554
+ */
555
+ validateCapabilityInput(
556
+ capabilityId: string,
557
+ input: unknown
558
+ ): { ok: boolean; errors?: string[] };
559
+
560
+ /**
561
+ * Register a JS handler for an extension capability.
562
+ *
563
+ * Typically called internally via `context.capabilities.registerHandler`
564
+ * during extension activation. Exposed here for host/test access.
565
+ */
566
+ registerCapabilityHandler(
567
+ id: string,
568
+ handler: (input: unknown, ctx: unknown) => Promise<unknown>
569
+ ): void;
570
+
571
+ /**
572
+ * Execute an extension capability by id, routing through the
573
+ * registered handler. Called by the gateway's extension provider
574
+ * after the middleware pipeline.
575
+ *
576
+ * Lazily activates the owning extension if not yet active.
577
+ * Throws `CAPABILITY_HANDLER_MISSING` when the extension did not
578
+ * register a handler during activation.
579
+ */
580
+ executeCapability(
581
+ id: string,
582
+ input: unknown,
583
+ ctx: unknown
584
+ ): Promise<unknown>;
585
+
586
+ /**
587
+ * Register built-in capabilities that ship with the editor (virtual extension).
588
+ *
589
+ * This is intended for core capabilities like workspace/vcs/tasks that are
590
+ * always present without loading an external extension.
591
+ */
592
+ registerBuiltinCapabilities(
593
+ entries: Array<{
594
+ id: string;
595
+ extensionName: string;
596
+ definition: CapabilityDefinition;
597
+ }>
598
+ ): void;
599
+ }
600
+
601
+ const manager: IExtensionManager;
602
+
603
+ /**
604
+ * Readonly Extension Metadata API
605
+ */
606
+ namespace metadata {
607
+ export interface ReadonlyExtension {
608
+ readonly name: string;
609
+ readonly displayName?: string;
610
+ readonly description?: string;
611
+ readonly version: string;
612
+ readonly configuration?: Readonly<{
613
+ title: string;
614
+ properties: Readonly<
615
+ Record<string, ReadonlyExtensionSettingProperty>
616
+ >;
617
+ }>;
618
+ readonly capabilities?: Readonly<
619
+ Record<string, ReadonlyCapabilityDefinition>
620
+ >;
621
+ }
622
+
623
+ export interface ReadonlyExtensionSettingProperty {
624
+ readonly type: 'boolean' | 'string' | 'number';
625
+ readonly default?: unknown;
626
+ readonly description?: string;
627
+ readonly enum?: readonly string[];
628
+ }
629
+
630
+ export interface ReadonlyCapabilityDefinition {
631
+ readonly title?: string;
632
+ readonly description?: string;
633
+ readonly inputs?: Readonly<unknown>;
634
+ readonly outputs?: Readonly<unknown>;
635
+ readonly policy?: Readonly<unknown>;
636
+ }
637
+
638
+ export interface ExtensionMetadataApi {
639
+ /**
640
+ * Get readonly extension metadata by name
641
+ */
642
+ getExtension(extensionName: string): ReadonlyExtension | undefined;
643
+
644
+ /**
645
+ * Get all extensions as readonly array
646
+ */
647
+ getAllExtensions(): readonly ReadonlyExtension[];
648
+
649
+ /**
650
+ * Get readonly capabilities for an extension
651
+ */
652
+ getExtensionCapabilities(
653
+ extensionName: string
654
+ ): Readonly<Record<string, ReadonlyCapabilityDefinition>> | undefined;
655
+ }
656
+
657
+ /**
658
+ * Extension metadata manager façade surfaced via `punica.extensions.metadata.manager`.
659
+ */
660
+ export const manager: ExtensionMetadataApi;
661
+ }
662
+
663
+ /**
664
+ * Settings API for managing extension and system settings
665
+ */
666
+ namespace settings {
667
+ /**
668
+ * Settings manager façade surfaced via `punica.extensions.settings.manager`.
669
+ */
670
+ export const manager: extensions.settings.SettingsApi;
671
+ }
672
+ }
673
+
674
+ /**
675
+ * extensions: top-level extension system façade exposed as `punica.extensions`.
676
+ * This is a convenience alias around the existing Extensions namespace.
677
+ */
678
+ export namespace extensions {
679
+ export import Extension = Extensions.Extension;
680
+ export import ExtensionDecorator = Extensions.ExtensionDecorator;
681
+ export import IExtension = Extensions.IExtension;
682
+ export import IExtensionManager = Extensions.IExtensionManager;
683
+ export import IExtensionContext = Extensions.IExtensionContext;
684
+ export import Styles = Extensions.Styles;
685
+ /**
686
+ * Extension manager façade surfaced via `punica.extensions.manager`.
687
+ */
688
+ export const manager: Extensions.IExtensionManager;
689
+ export import MarketplaceMeta = Extensions.MarketplaceMeta;
690
+ export import ActivationEvent = Extensions.ActivationEvent;
691
+ export import ActivationOptions = Extensions.ActivationOptions;
692
+ export import ActivationReason = Extensions.ActivationReason;
693
+ export import ExtensionRuntimeState = Extensions.ExtensionRuntimeState;
694
+
695
+ /**
696
+ * Readonly Extension Metadata API
697
+ */
698
+ export namespace metadata {
699
+ export interface ReadonlyExtension {
700
+ readonly name: string;
701
+ readonly displayName?: string;
702
+ readonly description?: string;
703
+ readonly version: string;
704
+ readonly configuration?: Readonly<{
705
+ title: string;
706
+ properties: Readonly<
707
+ Record<string, ReadonlyExtensionSettingProperty>
708
+ >;
709
+ }>;
710
+ readonly capabilities?: Readonly<
711
+ Record<string, ReadonlyCapabilityDefinition>
712
+ >;
713
+ }
714
+
715
+ export interface ReadonlyExtensionSettingProperty {
716
+ readonly type: 'boolean' | 'string' | 'number';
717
+ readonly default?: unknown;
718
+ readonly description?: string;
719
+ readonly enum?: readonly string[];
720
+ }
721
+
722
+ export interface ReadonlyCapabilityDefinition {
723
+ readonly title?: string;
724
+ readonly description?: string;
725
+ readonly inputs?: Readonly<unknown>;
726
+ readonly outputs?: Readonly<unknown>;
727
+ readonly policy?: Readonly<unknown>;
728
+ }
729
+
730
+ export interface ExtensionMetadataApi {
731
+ /**
732
+ * Get readonly extension metadata by name
733
+ */
734
+ getExtension(extensionName: string): ReadonlyExtension | undefined;
735
+
736
+ /**
737
+ * Get all extensions as readonly array
738
+ */
739
+ getAllExtensions(): readonly ReadonlyExtension[];
740
+
741
+ /**
742
+ * Get readonly capabilities for an extension
743
+ */
744
+ getExtensionCapabilities(
745
+ extensionName: string
746
+ ): Readonly<Record<string, ReadonlyCapabilityDefinition>> | undefined;
747
+ }
748
+
749
+ /**
750
+ * Extension metadata manager façade surfaced via `punica.extensions.metadata.manager`.
751
+ */
752
+ export const manager: ExtensionMetadataApi;
753
+ }
754
+
755
+ /**
756
+ * Settings API for managing extension and system settings
757
+ */
758
+ export namespace settings {
759
+ export import SettingsApi = extensions.settings.SettingsApi;
760
+ /**
761
+ * Settings manager façade surfaced via `punica.extensions.settings.manager`.
762
+ */
763
+ export const manager: SettingsApi;
764
+ }
765
+ }
766
+ }