pi2dsh 0.8.0 → 0.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.
@@ -17,18 +17,26 @@ declare function normalizeToolSchema(schema: unknown): {
17
17
  schema: UnknownRecord;
18
18
  warnings: string[];
19
19
  };
20
+ /** Companion configuration: default (auto), `false` (off), or an explicit narrow map. */
21
+ type VisionCompanionsConfig = false | Record<string, readonly string[]> | undefined;
20
22
  /**
21
- * Image-admission companion routes, configured on the DSH side (the
22
- * engine's or a bundle's cordis config): `{ <existingRoute>: [modelIds] }`
23
- * registers a `<route>-vision` route that admits images at the host's
23
+ * Image-admission companion routes: for every text-only route in the DSH
24
+ * llm directory, a `<route>-vision` route that admits images at the host's
24
25
  * admission checks, replaces image blocks with explicit path-carrying
25
- * notices, and forwards text-only to the original route. The companion is
26
- * an ordinary directory entry (single-directory contract); Pi's ctx.model
27
- * reports the original route for it (companionRoutes). Idempotent per
28
- * host: repeated calls (several packages, engine + bundle) keep one live
29
- * adapter and one mapping.
26
+ * notices, and forwards text-only to the original route. What happens to
27
+ * an admitted image is decided at run time by whatever is mounted — a
28
+ * vision extension analyzes it through the turn's entering messages, and
29
+ * without one the notice's file path lets any image-capable tool read it —
30
+ * so companions need no knowledge of any particular plugin and are
31
+ * registered AUTOMATICALLY (zero configuration). `visionCompanions: false`
32
+ * turns them off; an explicit `{ <route>: [modelIds] }` map narrows them.
33
+ * The directory is live: adapters-updated re-sweeps, adding companions for
34
+ * new text-only routes and disposing companions whose original vanished.
35
+ * The companion is an ordinary directory entry (single-directory
36
+ * contract); Pi's ctx.model reports the original route for it
37
+ * (companionRoutes). Idempotent per host.
30
38
  */
31
- declare function registerVisionCompanions(ctx: Context, companions: Record<string, readonly string[]> | undefined): void;
39
+ declare function registerVisionCompanions(ctx: Context, config: VisionCompanionsConfig): void;
32
40
  declare function splitArguments(input: string): string[];
33
41
  declare function expandPrompt(text: string, rawInput: string): string;
34
42
  declare function applyPiPackage(ctx: Context, options: RuntimeOptions): Promise<void>;
@@ -39,5 +47,5 @@ declare const runtimeInternals: {
39
47
  textBlocks: typeof textBlocks;
40
48
  };
41
49
  //#endregion
42
- export { applyPiPackage, normalizeToolSchema, registerVisionCompanions, runtimeInternals };
50
+ export { VisionCompanionsConfig, applyPiPackage, normalizeToolSchema, registerVisionCompanions, runtimeInternals };
43
51
  //# sourceMappingURL=runtime.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/runtime.ts"],"mappings":";;;;KAiCK,gBAAgB;UAGX;EACR,SAAS;EACT,UAAU;EACV,SAAS;;iBAsJF,WAAW,mBAAmB;EAAQ;EAAc;;iBAcpD,oBAAoB,kBAAkB;iBAuH/B,oBAAoB;EAAoB,QAAQ;EAAe;;;;;;;;;;;;;iBAm9B/D,yBACd,KAAK,SACL,YAAY;iBA8lBL,eAAe;iBA+Bf,aAAa,cAAc;iBAuHd,eAAe,KAAK,SAAS,SAAS,iBAAiB;cA0HhE"}
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/runtime.ts"],"mappings":";;;;KAiCK,gBAAgB;UAGX;EACR,SAAS;EACT,UAAU;EACV,SAAS;;iBAsJF,WAAW,mBAAmB;EAAQ;EAAc;;iBAcpD,oBAAoB,kBAAkB;iBAuH/B,oBAAoB;EAAoB,QAAQ;EAAe;;;KA08BnE,iCAAiC;;;;;;;;;;;;;;;;;;iBAmB7B,yBAAyB,KAAK,SAAS,QAAQ;iBAopBtD,eAAe;iBA+Bf,aAAa,cAAc;iBAuHd,eAAe,KAAK,SAAS,SAAS,iBAAiB;cA0HhE"}
package/dist/runtime.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
 
2
- import { i as runtimeInternals, n as normalizeToolSchema, r as registerVisionCompanions, t as applyPiPackage } from "./runtime-B-Mun-jX.mjs";
2
+ import { i as runtimeInternals, n as normalizeToolSchema, r as registerVisionCompanions, t as applyPiPackage } from "./runtime-DMEJknhK.mjs";
3
3
  export { applyPiPackage, normalizeToolSchema, registerVisionCompanions, runtimeInternals };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi2dsh",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Bridge the Pi and DeepSeek Harness ecosystems: a general Pi Host ABI that runs unmodified Pi extensions as native DSH plugins, plus per-package conversion and MCP config translation.",
5
5
  "type": "module",
6
6
  "bin": {