@punica/editor 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.bundle.esm.js +1 -1
- package/dist/index.bundle.esm.js.map +1 -1
- package/dist/index.bundle.umd.js +1 -1
- package/dist/index.bundle.umd.js.map +1 -1
- package/package.json +28 -3
- package/types/index.d.ts +120 -11
- package/types/punica.module.bootstrap.d.ts +45 -0
- package/types/punica.module.capability.d.ts +359 -0
- package/types/punica.module.extensions.api.d.ts +740 -0
- package/types/punica.module.extensions.settings.d.ts +106 -0
- package/types/punica.module.flow.agent.d.ts +75 -0
- package/types/punica.module.flow.api.d.ts +128 -0
- package/types/punica.module.flow.d.ts +490 -0
- package/types/punica.module.flow.engine.d.ts +228 -0
- package/types/punica.module.flow.mcp.d.ts +26 -0
- package/types/punica.module.flow.notebook.d.ts +210 -0
- package/types/punica.module.flow.primitives.d.ts +700 -0
- package/types/punica.module.flow.shell.d.ts +374 -0
- package/types/punica.module.kernel.ai.d.ts +462 -0
- package/types/punica.module.kernel.commands.d.ts +49 -0
- package/types/punica.module.kernel.events.d.ts +274 -0
- package/types/punica.module.kernel.history.d.ts +20 -0
- package/types/punica.module.kernel.llm.d.ts +343 -0
- package/types/punica.module.kernel.notifications.d.ts +64 -0
- package/types/punica.module.kernel.policy.d.ts +273 -0
- package/types/punica.module.kernel.tasks.d.ts +107 -0
- package/types/punica.module.kernel.timeServer.d.ts +16 -0
- package/types/punica.module.runtime.api.d.ts +214 -0
- package/types/punica.module.runtime.capabilities.d.ts +175 -0
- package/types/punica.module.runtime.compute.d.ts +339 -0
- package/types/punica.module.runtime.datasets.d.ts +234 -0
- package/types/punica.module.runtime.fs.d.ts +385 -0
- package/types/punica.module.runtime.harness.d.ts +246 -0
- package/types/punica.module.runtime.host.d.ts +272 -0
- package/types/punica.module.runtime.inference.d.ts +164 -0
- package/types/punica.module.runtime.lifecycle.d.ts +15 -0
- package/types/punica.module.runtime.llm.d.ts +470 -0
- package/types/punica.module.runtime.mcp.d.ts +139 -0
- package/types/punica.module.runtime.modelRuntimes.d.ts +90 -0
- package/types/punica.module.runtime.models.d.ts +254 -0
- package/types/punica.module.runtime.search.d.ts +59 -0
- package/types/punica.module.runtime.secrets.d.ts +26 -0
- package/types/punica.module.runtime.tasks.d.ts +27 -0
- package/types/punica.module.runtime.vcs.d.ts +67 -0
- package/types/punica.module.runtime.vectors.d.ts +74 -0
- package/types/punica.module.runtime.workspace.d.ts +134 -0
- package/types/punica.module.shell.activityBar.d.ts +42 -0
- package/types/punica.module.shell.components.d.ts +87 -0
- package/types/punica.module.shell.contentTabs.d.ts +33 -0
- package/types/punica.module.shell.dragDrop.d.ts +25 -0
- package/types/punica.module.shell.keyboardShortcuts.d.ts +38 -0
- package/types/punica.module.shell.layout.d.ts +106 -0
- package/types/punica.module.shell.markdown.d.ts +36 -0
- package/types/punica.module.shell.panelTabs.d.ts +48 -0
- package/types/punica.module.shell.profile.d.ts +278 -0
- package/types/punica.module.shell.statusbar.d.ts +26 -0
- package/types/punica.module.shell.view.d.ts +455 -0
- package/types/punica.module.shell.views.d.ts +150 -0
- package/types/punica.module.test.d.ts +562 -0
- package/types/punica.module.activityBar.d.ts +0 -21
- package/types/punica.module.commands.d.ts +0 -21
- package/types/punica.module.dragDrop.d.ts +0 -23
- package/types/punica.module.extensions.d.ts +0 -157
- package/types/punica.module.history.d.ts +0 -18
- package/types/punica.module.keyboardShortcuts.d.ts +0 -29
- package/types/punica.module.layout.d.ts +0 -23
- package/types/punica.module.statusbar.d.ts +0 -21
- package/types/punica.module.timeServer.d.ts +0 -14
- package/types/punica.module.view.d.ts +0 -8
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
declare module 'punica' {
|
|
2
|
+
export namespace shell {
|
|
3
|
+
export namespace View {
|
|
4
|
+
const showInformationMessage: <T extends string>(
|
|
5
|
+
message: string,
|
|
6
|
+
...items: T[]
|
|
7
|
+
) => Promise<T | undefined>;
|
|
8
|
+
|
|
9
|
+
const showWarningMessage: <T extends string>(
|
|
10
|
+
message: string,
|
|
11
|
+
...items: T[]
|
|
12
|
+
) => Promise<T | undefined>;
|
|
13
|
+
|
|
14
|
+
const showErrorMessage: <T extends string>(
|
|
15
|
+
message: string,
|
|
16
|
+
...items: T[]
|
|
17
|
+
) => Promise<T | undefined>;
|
|
18
|
+
|
|
19
|
+
interface DialogOptions {
|
|
20
|
+
title: string;
|
|
21
|
+
message?: string;
|
|
22
|
+
html?: string;
|
|
23
|
+
buttons?: DialogButton[];
|
|
24
|
+
footerHtml?: string;
|
|
25
|
+
modal?: boolean;
|
|
26
|
+
width?: string;
|
|
27
|
+
height?: string;
|
|
28
|
+
onMount?: (dialog: HTMLElement) => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface DialogButton {
|
|
32
|
+
label: string;
|
|
33
|
+
variant?: 'filled' | 'outlined' | 'text';
|
|
34
|
+
color?: 'primary' | 'secondary' | 'error';
|
|
35
|
+
action?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const showDialog: (options: DialogOptions) => Promise<string | undefined>;
|
|
39
|
+
|
|
40
|
+
interface ConfirmOptions {
|
|
41
|
+
title?: string;
|
|
42
|
+
message: string;
|
|
43
|
+
confirmLabel?: string;
|
|
44
|
+
cancelLabel?: string;
|
|
45
|
+
variant?: 'info' | 'warning' | 'error';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const showConfirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
49
|
+
|
|
50
|
+
interface AlertOptions {
|
|
51
|
+
title?: string;
|
|
52
|
+
message: string;
|
|
53
|
+
variant?: 'info' | 'warning' | 'error' | 'success';
|
|
54
|
+
buttonLabel?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const showAlert: (options: AlertOptions) => Promise<void>;
|
|
58
|
+
|
|
59
|
+
interface PromptOptions {
|
|
60
|
+
title?: string;
|
|
61
|
+
message: string;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
defaultValue?: string;
|
|
64
|
+
confirmLabel?: string;
|
|
65
|
+
cancelLabel?: string;
|
|
66
|
+
type?: 'text' | 'password' | 'number';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const showPrompt: (options: PromptOptions) => Promise<string | undefined>;
|
|
70
|
+
|
|
71
|
+
interface ToastOptions {
|
|
72
|
+
title?: string;
|
|
73
|
+
message?: string;
|
|
74
|
+
duration?: number;
|
|
75
|
+
dismissible?: boolean;
|
|
76
|
+
variant?: 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
77
|
+
placement?:
|
|
78
|
+
| 'top-left'
|
|
79
|
+
| 'top-center'
|
|
80
|
+
| 'top-right'
|
|
81
|
+
| 'bottom-left'
|
|
82
|
+
| 'bottom-center'
|
|
83
|
+
| 'bottom-right';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const showToast: (options: ToastOptions) => HTMLElement;
|
|
87
|
+
|
|
88
|
+
interface ChangesPreviewOptions {
|
|
89
|
+
title: string;
|
|
90
|
+
summary?: string;
|
|
91
|
+
files: Array<{
|
|
92
|
+
path: string;
|
|
93
|
+
action: 'create' | 'update' | 'delete';
|
|
94
|
+
content?: string;
|
|
95
|
+
}>;
|
|
96
|
+
onConfirm: () => Promise<void>;
|
|
97
|
+
onCancel?: () => void;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const showChangesPreview: (
|
|
101
|
+
options: ChangesPreviewOptions
|
|
102
|
+
) => Promise<'confirm' | 'cancel' | undefined>;
|
|
103
|
+
|
|
104
|
+
namespace Helpers {
|
|
105
|
+
interface CreateElementOptions {
|
|
106
|
+
attrs?: Record<string, string>;
|
|
107
|
+
text?: string;
|
|
108
|
+
children?: HTMLElement[];
|
|
109
|
+
style?: Record<string, string> | string;
|
|
110
|
+
className?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface ButtonOptions {
|
|
114
|
+
variant?: 'filled' | 'outlined' | 'text';
|
|
115
|
+
color?: 'primary' | 'secondary' | 'error';
|
|
116
|
+
size?: 'small' | 'medium' | 'large';
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
rounded?: boolean;
|
|
119
|
+
icon?: string;
|
|
120
|
+
fullwidth?: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface IconButtonOptions {
|
|
124
|
+
title?: string;
|
|
125
|
+
size?: 'x-small' | 'small' | 'medium';
|
|
126
|
+
variant?: 'text' | 'outlined' | 'filled';
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
attrs?: Record<string, string>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface TypographyOptions {
|
|
132
|
+
variant?:
|
|
133
|
+
| 'h1'
|
|
134
|
+
| 'h2'
|
|
135
|
+
| 'h3'
|
|
136
|
+
| 'h4'
|
|
137
|
+
| 'h5'
|
|
138
|
+
| 'h6'
|
|
139
|
+
| 'body'
|
|
140
|
+
| 'caption';
|
|
141
|
+
color?: 'primary' | 'secondary' | 'error';
|
|
142
|
+
fontWeight?: 'normal' | 'bold';
|
|
143
|
+
style?: Record<string, string> | string;
|
|
144
|
+
className?: string;
|
|
145
|
+
attrs?: Record<string, string>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface ChipOptions {
|
|
149
|
+
variant?: 'filled' | 'outlined';
|
|
150
|
+
color?: 'primary' | 'secondary' | 'error' | 'success' | 'warning';
|
|
151
|
+
size?: 'small' | 'medium';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface BoxOptions {
|
|
155
|
+
attrs?: Record<string, string>;
|
|
156
|
+
children?: HTMLElement[];
|
|
157
|
+
style?: Record<string, string> | string;
|
|
158
|
+
className?: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
interface RowOptions {
|
|
162
|
+
spacing?: string;
|
|
163
|
+
alignItems?: string;
|
|
164
|
+
wrap?: string;
|
|
165
|
+
attrs?: Record<string, string>;
|
|
166
|
+
children?: HTMLElement[];
|
|
167
|
+
style?: Record<string, string> | string;
|
|
168
|
+
className?: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
interface ColOptions {
|
|
172
|
+
xs?: string | number;
|
|
173
|
+
sm?: string | number;
|
|
174
|
+
md?: string | number;
|
|
175
|
+
lg?: string | number;
|
|
176
|
+
xl?: string | number;
|
|
177
|
+
attrs?: Record<string, string>;
|
|
178
|
+
children?: HTMLElement[];
|
|
179
|
+
style?: Record<string, string> | string;
|
|
180
|
+
className?: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface InputOptions {
|
|
184
|
+
value?: string;
|
|
185
|
+
placeholder?: string;
|
|
186
|
+
type?: 'text' | 'password' | 'number' | 'email' | 'url';
|
|
187
|
+
size?: 'small' | 'medium' | 'large';
|
|
188
|
+
fullwidth?: boolean;
|
|
189
|
+
rounded?: boolean;
|
|
190
|
+
disabled?: boolean;
|
|
191
|
+
id?: string;
|
|
192
|
+
min?: string | number;
|
|
193
|
+
max?: string | number;
|
|
194
|
+
step?: string | number;
|
|
195
|
+
attrs?: Record<string, string>;
|
|
196
|
+
style?: Record<string, string> | string;
|
|
197
|
+
className?: string;
|
|
198
|
+
onInput?: (value: string) => void;
|
|
199
|
+
onChange?: (value: string) => void;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface SelectOptions {
|
|
203
|
+
value?: string;
|
|
204
|
+
size?: 'small' | 'medium' | 'large';
|
|
205
|
+
fullwidth?: boolean;
|
|
206
|
+
rounded?: boolean;
|
|
207
|
+
disabled?: boolean;
|
|
208
|
+
minimumTargetWidth?: boolean;
|
|
209
|
+
id?: string;
|
|
210
|
+
attrs?: Record<string, string>;
|
|
211
|
+
style?: Record<string, string> | string;
|
|
212
|
+
className?: string;
|
|
213
|
+
onChange?: (value: string) => void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface SelectItemOptions {
|
|
217
|
+
value: string;
|
|
218
|
+
text?: string;
|
|
219
|
+
attrs?: Record<string, string>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface CheckboxOptions {
|
|
223
|
+
checked?: boolean;
|
|
224
|
+
label?: string;
|
|
225
|
+
disabled?: boolean;
|
|
226
|
+
id?: string;
|
|
227
|
+
attrs?: Record<string, string>;
|
|
228
|
+
style?: Record<string, string> | string;
|
|
229
|
+
className?: string;
|
|
230
|
+
onChange?: (checked: boolean) => void;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface IconOptions {
|
|
234
|
+
iconClass?: string;
|
|
235
|
+
innerHTML?: string;
|
|
236
|
+
slot?: string;
|
|
237
|
+
attrs?: Record<string, string>;
|
|
238
|
+
style?: Record<string, string> | string;
|
|
239
|
+
className?: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface TextareaOptions {
|
|
243
|
+
value?: string;
|
|
244
|
+
placeholder?: string;
|
|
245
|
+
rows?: number;
|
|
246
|
+
cols?: number;
|
|
247
|
+
size?: 'small' | 'medium' | 'large';
|
|
248
|
+
fullwidth?: boolean;
|
|
249
|
+
rounded?: boolean;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
id?: string;
|
|
252
|
+
attrs?: Record<string, string>;
|
|
253
|
+
style?: Record<string, string> | string;
|
|
254
|
+
className?: string;
|
|
255
|
+
onInput?: (value: string) => void;
|
|
256
|
+
onChange?: (value: string) => void;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface DividerOptions {
|
|
260
|
+
orientation?: 'horizontal' | 'vertical';
|
|
261
|
+
attrs?: Record<string, string>;
|
|
262
|
+
style?: Record<string, string> | string;
|
|
263
|
+
className?: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
interface ListViewOptions {
|
|
267
|
+
enableDivider?: boolean;
|
|
268
|
+
spacing?: string;
|
|
269
|
+
attrs?: Record<string, string>;
|
|
270
|
+
children?: HTMLElement[];
|
|
271
|
+
style?: Record<string, string> | string;
|
|
272
|
+
className?: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
interface ListViewItemOptions {
|
|
276
|
+
label?: string | HTMLElement;
|
|
277
|
+
content?: string | HTMLElement;
|
|
278
|
+
endAdornment?: HTMLElement;
|
|
279
|
+
attrs?: Record<string, string>;
|
|
280
|
+
children?: HTMLElement[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface PaperOptions {
|
|
284
|
+
elevation?: number;
|
|
285
|
+
attrs?: Record<string, string>;
|
|
286
|
+
children?: HTMLElement[];
|
|
287
|
+
style?: Record<string, string> | string;
|
|
288
|
+
className?: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
interface TabOptions {
|
|
292
|
+
value?: string;
|
|
293
|
+
orientation?: 'horizontal' | 'vertical';
|
|
294
|
+
attrs?: Record<string, string>;
|
|
295
|
+
children?: HTMLElement[];
|
|
296
|
+
onChange?: (value: string) => void;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface TabItemOptions {
|
|
300
|
+
value: string;
|
|
301
|
+
text?: string;
|
|
302
|
+
attrs?: Record<string, string>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface TabPanelOptions {
|
|
306
|
+
value: string;
|
|
307
|
+
selectedValue?: string;
|
|
308
|
+
attrs?: Record<string, string>;
|
|
309
|
+
children?: HTMLElement[];
|
|
310
|
+
style?: Record<string, string> | string;
|
|
311
|
+
className?: string;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
interface BadgeOptions {
|
|
315
|
+
text?: string;
|
|
316
|
+
variant?: 'filled' | 'outlined';
|
|
317
|
+
color?: 'primary' | 'secondary' | 'error' | 'success' | 'warning';
|
|
318
|
+
size?: 'small' | 'medium';
|
|
319
|
+
title?: string;
|
|
320
|
+
attrs?: Record<string, string>;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface MenuOptions {
|
|
324
|
+
attrs?: Record<string, string>;
|
|
325
|
+
children?: HTMLElement[];
|
|
326
|
+
style?: Record<string, string> | string;
|
|
327
|
+
className?: string;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
interface MenuItemOptions {
|
|
331
|
+
text?: string;
|
|
332
|
+
attrs?: Record<string, string>;
|
|
333
|
+
onClick?: (e: Event) => void;
|
|
334
|
+
style?: Record<string, string> | string;
|
|
335
|
+
className?: string;
|
|
336
|
+
children?: HTMLElement[];
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
interface LinkOptions {
|
|
340
|
+
href: string;
|
|
341
|
+
text?: string;
|
|
342
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
343
|
+
rel?: string;
|
|
344
|
+
download?: string;
|
|
345
|
+
attrs?: Record<string, string>;
|
|
346
|
+
style?: Record<string, string> | string;
|
|
347
|
+
className?: string;
|
|
348
|
+
children?: HTMLElement[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
interface ToolbarOptions {
|
|
352
|
+
variant?: 'dense' | 'regular';
|
|
353
|
+
disableGutters?: boolean;
|
|
354
|
+
attrs?: Record<string, string>;
|
|
355
|
+
children?: HTMLElement[];
|
|
356
|
+
style?: Record<string, string> | string;
|
|
357
|
+
className?: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function createElement<K extends keyof HTMLElementTagNameMap>(
|
|
361
|
+
tag: K,
|
|
362
|
+
options?: CreateElementOptions
|
|
363
|
+
): HTMLElementTagNameMap[K];
|
|
364
|
+
function createElement(
|
|
365
|
+
tag: shell.Components.Element | string,
|
|
366
|
+
options?: CreateElementOptions
|
|
367
|
+
): HTMLElement;
|
|
368
|
+
|
|
369
|
+
function createButton(
|
|
370
|
+
label: string,
|
|
371
|
+
onClick: () => void,
|
|
372
|
+
options?: ButtonOptions
|
|
373
|
+
): HTMLElement;
|
|
374
|
+
|
|
375
|
+
function createIconButton(
|
|
376
|
+
iconClass: string,
|
|
377
|
+
onClick: () => void,
|
|
378
|
+
options?: IconButtonOptions
|
|
379
|
+
): HTMLElement;
|
|
380
|
+
|
|
381
|
+
function createTypography(
|
|
382
|
+
text: string,
|
|
383
|
+
options?: TypographyOptions
|
|
384
|
+
): HTMLElement;
|
|
385
|
+
|
|
386
|
+
function createChip(label: string, options?: ChipOptions): HTMLElement;
|
|
387
|
+
|
|
388
|
+
function createBox(options?: BoxOptions): HTMLElement;
|
|
389
|
+
|
|
390
|
+
function createRow(options?: RowOptions): HTMLElement;
|
|
391
|
+
|
|
392
|
+
function createCol(options?: ColOptions): HTMLElement;
|
|
393
|
+
|
|
394
|
+
function createInput(options?: InputOptions): HTMLElement;
|
|
395
|
+
|
|
396
|
+
function createSelect(options?: SelectOptions): HTMLElement;
|
|
397
|
+
|
|
398
|
+
function createSelectItem(options: SelectItemOptions): HTMLElement;
|
|
399
|
+
|
|
400
|
+
function createCheckbox(options?: CheckboxOptions): HTMLElement;
|
|
401
|
+
|
|
402
|
+
function createIcon(options?: IconOptions): HTMLElement;
|
|
403
|
+
|
|
404
|
+
function createTextarea(options?: TextareaOptions): HTMLElement;
|
|
405
|
+
|
|
406
|
+
function createDivider(options?: DividerOptions): HTMLElement;
|
|
407
|
+
|
|
408
|
+
function createListView(options?: ListViewOptions): HTMLElement;
|
|
409
|
+
|
|
410
|
+
function createListViewItem(options?: ListViewItemOptions): HTMLElement;
|
|
411
|
+
|
|
412
|
+
function createPaper(options?: PaperOptions): HTMLElement;
|
|
413
|
+
|
|
414
|
+
function createTab(options?: TabOptions): HTMLElement;
|
|
415
|
+
|
|
416
|
+
function createTabItem(options: TabItemOptions): HTMLElement;
|
|
417
|
+
|
|
418
|
+
function createTabPanel(options: TabPanelOptions): HTMLElement;
|
|
419
|
+
|
|
420
|
+
function createBadge(options?: BadgeOptions): HTMLElement;
|
|
421
|
+
|
|
422
|
+
function createMenu(options?: MenuOptions): HTMLElement;
|
|
423
|
+
|
|
424
|
+
function createMenuItem(options?: MenuItemOptions): HTMLElement;
|
|
425
|
+
|
|
426
|
+
function createLink(text: string, options: LinkOptions): HTMLElement;
|
|
427
|
+
|
|
428
|
+
function createToolbar(options?: ToolbarOptions): HTMLElement;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
namespace Theme {
|
|
432
|
+
interface ThemeProfile {
|
|
433
|
+
id: string;
|
|
434
|
+
name: string;
|
|
435
|
+
variables: Record<string, string>;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
interface ThemeManager {
|
|
439
|
+
loadProfile(profileId: string): Promise<void>;
|
|
440
|
+
getCurrentProfile(): string | null;
|
|
441
|
+
getProfiles(): Record<string, ThemeProfile>;
|
|
442
|
+
getProfile(profileId: string): ThemeProfile | undefined;
|
|
443
|
+
registerProfile(profile: ThemeProfile): void;
|
|
444
|
+
onDidChangeProfile(callback: (profileId: string) => void): () => void;
|
|
445
|
+
initialize(): Promise<void>;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const manager: ThemeManager;
|
|
449
|
+
const profiles: Record<string, ThemeProfile>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const Theme: Theme;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
declare module 'punica' {
|
|
2
|
+
export namespace shell {
|
|
3
|
+
/**
|
|
4
|
+
* ViewRegistry — the substrate's single visibility authority
|
|
5
|
+
* (`punica.shell.Views.manager`).
|
|
6
|
+
*
|
|
7
|
+
* Extension lifecycle model, dimension B: view presentation state is
|
|
8
|
+
* tracked per VIEW and is orthogonal to the extension's runtime
|
|
9
|
+
* state. Activation never shows UI; the only visibility mutators are
|
|
10
|
+
* `reveal`/`hide`, publicly surfaced as the `shell.revealView` /
|
|
11
|
+
* `shell.hideView` core capabilities (user gestures, extensions,
|
|
12
|
+
* agents and MCP clients all converge on them).
|
|
13
|
+
*/
|
|
14
|
+
export namespace Views {
|
|
15
|
+
export type ViewSlotId =
|
|
16
|
+
| 'primarySidebar'
|
|
17
|
+
| 'secondarySidebar'
|
|
18
|
+
| 'contentSidebar'
|
|
19
|
+
| 'content'
|
|
20
|
+
| 'panel';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* - `registered`: placement known from the manifest, no DOM.
|
|
24
|
+
* - `materialized`: host DOM exists and the provider rendered; hidden.
|
|
25
|
+
* - `visible`: shown in its slot.
|
|
26
|
+
*/
|
|
27
|
+
export type ViewPresentationState =
|
|
28
|
+
| 'registered'
|
|
29
|
+
| 'materialized'
|
|
30
|
+
| 'visible';
|
|
31
|
+
|
|
32
|
+
export interface ViewPlacement {
|
|
33
|
+
viewId: string;
|
|
34
|
+
slot: ViewSlotId;
|
|
35
|
+
extensionName: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
icon?: string;
|
|
38
|
+
order?: number;
|
|
39
|
+
/**
|
|
40
|
+
* TRANSITIONAL — command executed on reveal when the owning
|
|
41
|
+
* extension has not registered a ViewProvider yet. Removed once
|
|
42
|
+
* the fleet migrates to view providers.
|
|
43
|
+
*/
|
|
44
|
+
fallbackCommand?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ViewProviderDisposable {
|
|
48
|
+
dispose(): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Render contract for a declared view. Registered by extension
|
|
53
|
+
* code during activation via `context.ui.registerViewProvider`;
|
|
54
|
+
* the SHELL decides when to materialize (first reveal) — never the
|
|
55
|
+
* extension.
|
|
56
|
+
*/
|
|
57
|
+
export interface ViewProvider {
|
|
58
|
+
render(
|
|
59
|
+
host: HTMLElement
|
|
60
|
+
):
|
|
61
|
+
| void
|
|
62
|
+
| ViewProviderDisposable
|
|
63
|
+
| Promise<void | ViewProviderDisposable>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Who asked for a reveal/hide — recorded in shell.view.* events. */
|
|
67
|
+
export interface RevealSource {
|
|
68
|
+
kind:
|
|
69
|
+
| 'user-gesture'
|
|
70
|
+
| 'capability'
|
|
71
|
+
| 'extension'
|
|
72
|
+
| 'session-restore'
|
|
73
|
+
| 'host';
|
|
74
|
+
id?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface RevealOptions {
|
|
78
|
+
focus?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface ViewInfo {
|
|
82
|
+
viewId: string;
|
|
83
|
+
slot: ViewSlotId;
|
|
84
|
+
extensionName: string;
|
|
85
|
+
title?: string;
|
|
86
|
+
state: ViewPresentationState;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface IViewRegistryManager {
|
|
90
|
+
/** Manifest-level placement registration (analysis phase). */
|
|
91
|
+
registerPlacement(placement: ViewPlacement): void;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Register a render provider for a declared view. Registration
|
|
95
|
+
* alone never shows anything.
|
|
96
|
+
*/
|
|
97
|
+
registerProvider(
|
|
98
|
+
viewId: string,
|
|
99
|
+
provider: ViewProvider,
|
|
100
|
+
extensionName?: string
|
|
101
|
+
): ViewProviderDisposable;
|
|
102
|
+
|
|
103
|
+
getPlacement(viewId: string): ViewPlacement | undefined;
|
|
104
|
+
hasProvider(viewId: string): boolean;
|
|
105
|
+
getState(viewId: string): ViewPresentationState | undefined;
|
|
106
|
+
getVisibleView(slot: ViewSlotId): string | undefined;
|
|
107
|
+
listViews(): ViewInfo[];
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Reveal a view — the single visibility mutator. Activates the
|
|
111
|
+
* owning extension when needed (reason `view`), materializes the
|
|
112
|
+
* host, renders the provider once (transient contentSidebar
|
|
113
|
+
* views: on every reveal), shows the slot and emits
|
|
114
|
+
* `shell.view.revealed` with the source. Prefer calling the
|
|
115
|
+
* `shell.revealView` capability so the reveal is audited and
|
|
116
|
+
* policy-gated.
|
|
117
|
+
*/
|
|
118
|
+
reveal(
|
|
119
|
+
viewId: string,
|
|
120
|
+
source: RevealSource,
|
|
121
|
+
options?: RevealOptions
|
|
122
|
+
): Promise<void>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Hide a view. Emits `shell.view.hidden`. For the transient
|
|
126
|
+
* contentSidebar drawer this unmounts the slot's hosts (the
|
|
127
|
+
* overlay collapses via the host CSS `:empty` rule); providers
|
|
128
|
+
* re-render on the next reveal.
|
|
129
|
+
*/
|
|
130
|
+
hide(viewId: string, source: RevealSource): void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Sync bookkeeping after the Layout manager wiped a slot's
|
|
134
|
+
* hosts wholesale (primary sidebar switch resets the contextual
|
|
135
|
+
* contentSidebar drawer): dispose provider results, forget
|
|
136
|
+
* materialization, emit `shell.view.hidden`.
|
|
137
|
+
*/
|
|
138
|
+
notifySlotReset(slot: ViewSlotId): void;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Dispose providers and remove rendered hosts owned by an
|
|
142
|
+
* extension (deactivation). Manifest placements stay.
|
|
143
|
+
*/
|
|
144
|
+
unmountByExtension(extensionName: string): void;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const manager: IViewRegistryManager;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|