@punica/editor 1.8.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -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;