@punica/editor 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.bundle.esm.js +2 -2
- package/dist/index.bundle.esm.js.map +1 -1
- package/dist/index.bundle.umd.js +2 -2
- package/dist/index.bundle.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/punica.module.extensions.api.d.ts +18 -2
- package/types/punica.module.kernel.llm.d.ts +39 -0
- package/types/punica.module.runtime.llm.d.ts +13 -0
- package/types/punica.module.shell.activityBar.d.ts +22 -0
package/package.json
CHANGED
|
@@ -76,8 +76,24 @@ declare module 'punica' {
|
|
|
76
76
|
*/
|
|
77
77
|
showOnStartup?: boolean;
|
|
78
78
|
};
|
|
79
|
-
activityBar?: Pick<BaseView, 'id' | 'name'> &
|
|
80
|
-
Required<Pick<BaseView, 'title' | 'icon' | 'alignment'
|
|
79
|
+
activityBar?: Pick<BaseView, 'id' | 'name' | 'capability'> &
|
|
80
|
+
Required<Pick<BaseView, 'title' | 'icon' | 'alignment'>> & {
|
|
81
|
+
/**
|
|
82
|
+
* Draw this item together with every other item declaring the same
|
|
83
|
+
* `group.id`: one icon, and a flyout listing the members once there
|
|
84
|
+
* is more than one. Lets a family of extensions (marketplaces,
|
|
85
|
+
* database providers, …) grow without taking a bar slot each.
|
|
86
|
+
* The group's identity lives here, in the manifests — the substrate
|
|
87
|
+
* knows only "same id, same icon". Ignored by older shells.
|
|
88
|
+
*/
|
|
89
|
+
group?: {
|
|
90
|
+
id: string;
|
|
91
|
+
/** Tooltip of the group icon. First member to declare it wins. */
|
|
92
|
+
title?: string;
|
|
93
|
+
/** Group icon (raw HTML). First member to declare it wins. */
|
|
94
|
+
icon?: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
81
97
|
statusBar?: Pick<BaseView, 'id' | 'name'> &
|
|
82
98
|
Required<Pick<BaseView, 'title' | 'label' | 'icon' | 'alignment'>>;
|
|
83
99
|
}
|
|
@@ -38,6 +38,27 @@ declare module 'punica' {
|
|
|
38
38
|
* When provided, auto-selection can use or extend this list.
|
|
39
39
|
*/
|
|
40
40
|
expertModelIds?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Ordered provider chain for this instruction class: the first entry
|
|
43
|
+
* is the primary target, the rest are fallbacks tried in order when an
|
|
44
|
+
* attempt fails.
|
|
45
|
+
*
|
|
46
|
+
* This is what lets a cheap local core answer a routine class while an
|
|
47
|
+
* expensive remote one stands behind it. Distinct from
|
|
48
|
+
* `expertModelId`/`expertModelIds`, which pick MULTIPLE experts to
|
|
49
|
+
* answer the SAME high-risk call concurrently — that is redundancy for
|
|
50
|
+
* quality, this is substitution on failure.
|
|
51
|
+
*
|
|
52
|
+
* Absent = fall back to the host-registered default chain
|
|
53
|
+
* (`setDefaultProviderChainResolver`), and absent that, to the
|
|
54
|
+
* substrate's existing single-model routing.
|
|
55
|
+
*/
|
|
56
|
+
providerChain?: runtime.ProviderSpec[];
|
|
57
|
+
/**
|
|
58
|
+
* How failure signals advance `providerChain`. Absent = the substrate
|
|
59
|
+
* defaults (`error`/`timeout` stop, `rateLimit` advances).
|
|
60
|
+
*/
|
|
61
|
+
fallbackPolicy?: runtime.FallbackPolicy;
|
|
41
62
|
/**
|
|
42
63
|
* Unified capability definition for LLM consumption.
|
|
43
64
|
* If not provided, can be auto-generated from InstructionClass fields.
|
|
@@ -247,6 +268,24 @@ declare module 'punica' {
|
|
|
247
268
|
filterActiveOnly?: boolean
|
|
248
269
|
): InstructionClassSummary[];
|
|
249
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Inject the default provider chain — the one used by instruction
|
|
273
|
+
* classes that carry no `providerChain` of their own.
|
|
274
|
+
*
|
|
275
|
+
* The kernel must not know what an "AI core" is, where the user's
|
|
276
|
+
* models are configured, or which of them is active: all of that is
|
|
277
|
+
* product/host territory. So the chain is resolved through an injected
|
|
278
|
+
* function, exactly as `registerProductOriginResolver` handles the
|
|
279
|
+
* product → origin mapping. No resolver registered = no default chain,
|
|
280
|
+
* and routing behaves as it did before chains existed.
|
|
281
|
+
*
|
|
282
|
+
* The resolver is consulted per invocation (not cached), so activating
|
|
283
|
+
* a different core takes effect on the next call.
|
|
284
|
+
*/
|
|
285
|
+
setDefaultProviderChainResolver(
|
|
286
|
+
resolver: (() => runtime.ProviderSpec[] | undefined) | undefined
|
|
287
|
+
): void;
|
|
288
|
+
|
|
250
289
|
/**
|
|
251
290
|
* Invoke LLM using an instruction class.
|
|
252
291
|
*
|
|
@@ -451,6 +451,19 @@ declare module 'punica' {
|
|
|
451
451
|
sourcePath: string;
|
|
452
452
|
fileName?: string;
|
|
453
453
|
}): Promise<void>;
|
|
454
|
+
/**
|
|
455
|
+
* Record an existing model file WITHOUT copying it.
|
|
456
|
+
*
|
|
457
|
+
* `importModelFile` copies the weights into host-owned storage, which
|
|
458
|
+
* duplicates a multi-gigabyte file the user may already have on disk.
|
|
459
|
+
* This registers the path in place. Optional: hosts that cannot
|
|
460
|
+
* reference files outside their own storage simply omit it, and callers
|
|
461
|
+
* feature-detect before offering the choice.
|
|
462
|
+
*/
|
|
463
|
+
registerModelFile?(opts: {
|
|
464
|
+
modelId: string;
|
|
465
|
+
filePath: string;
|
|
466
|
+
}): Promise<void>;
|
|
454
467
|
localServerStatus(): Promise<LocalLlmServerStatus>;
|
|
455
468
|
startLocalServer(opts?: {
|
|
456
469
|
host?: string;
|
|
@@ -4,6 +4,20 @@ declare module 'punica' {
|
|
|
4
4
|
type Alignment = 'primary' | 'secondary';
|
|
5
5
|
type ItemType = 'normal' | 'menu';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Groups several activity items behind one icon. Declared per member —
|
|
9
|
+
* the substrate has no group table of its own, so what a group means
|
|
10
|
+
* (marketplaces, databases, …) stays in the manifests that opt in.
|
|
11
|
+
*/
|
|
12
|
+
interface IItemGroup {
|
|
13
|
+
/** Members sharing this id are drawn as a single icon. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Tooltip of the group icon. First member to declare it wins; defaults to `id`. */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** Group icon (raw HTML). First member to declare it wins; defaults to the first member's icon. */
|
|
18
|
+
icon?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
interface IItem {
|
|
8
22
|
id: string;
|
|
9
23
|
name: string;
|
|
@@ -31,6 +45,14 @@ declare module 'punica' {
|
|
|
31
45
|
* and the Capability Catalog. See `IActivityBarManager.syncContentTool`.
|
|
32
46
|
*/
|
|
33
47
|
contentViewType?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Collect this item into a group. While the group has one member the
|
|
50
|
+
* shell draws that member's own icon and click behaviour; when a
|
|
51
|
+
* second member joins, the icon becomes the group's and clicking it
|
|
52
|
+
* opens a flyout listing the members. Shells that predate grouping
|
|
53
|
+
* ignore the field and draw the item on its own, as before.
|
|
54
|
+
*/
|
|
55
|
+
group?: IItemGroup;
|
|
34
56
|
}
|
|
35
57
|
|
|
36
58
|
interface IActivityBarManager {
|