pi2dsh 0.12.0 → 0.12.1

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/host.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as registerVisionCompanions, t as applyPiPackage } from "./runtime-Bh5k4Kjt.mjs";
2
+ import { r as registerVisionCompanions, t as applyPiPackage } from "./runtime-Xy8yU8wO.mjs";
3
3
  import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { cp, mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as registerVisionCompanions } from "./runtime-Bh5k4Kjt.mjs";
2
+ import { r as registerVisionCompanions } from "./runtime-Xy8yU8wO.mjs";
3
3
  import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
4
4
  import { applyPiHost, generateHostBundle, manifestForInstalled } from "./host.mjs";
5
5
  import { a as CONTEXT_RULES, c as PI_AI_PACKAGES, d as UI_CONTEXT_RULES, f as ruleForApi, g as ruleForUiContextProperty, h as ruleForHostImport, i as API_RULES, l as PI_CODING_AGENT_PACKAGES, m as ruleForEvent, n as convertPiMcpConfig, o as EVENT_RULES, p as ruleForContextProperty, r as renderMcpPatch, s as HOST_IMPORT_RULES, t as collectPiMcpServers, u as PI_TUI_PACKAGES } from "./mcp-config-Cn5gWemZ.mjs";
@@ -1280,6 +1280,19 @@ const PI_CARRIED_FIELDS = [
1280
1280
  "headers"
1281
1281
  ];
1282
1282
  /**
1283
+ * Model capabilities DSH asks about by its own names. Shared by the catalog
1284
+ * listing and the exact-route resolve deliberately: a capability present in
1285
+ * one and absent from the other is how a model silently loses an ability —
1286
+ * the host consults the resolve before a request, so a modality declared only
1287
+ * in the listing reads as "text only" at the moment it matters.
1288
+ * @param model - the Pi model descriptor as its package declared it.
1289
+ */
1290
+ function capabilityProjection(model) {
1291
+ if (!Array.isArray(model.input)) return {};
1292
+ const modalities = model.input.filter((entry) => entry === "text" || entry === "image");
1293
+ return modalities.length === 0 ? {} : { inputModalities: modalities };
1294
+ }
1295
+ /**
1283
1296
  * Pi's reasoning capability, in DSH's shape.
1284
1297
  *
1285
1298
  * The two sides say the same thing differently: Pi carries a `reasoning`
@@ -1324,15 +1337,16 @@ function piProviderDshAdapter(providerId, provider, host) {
1324
1337
  providerRetryPolicy: () => void 0,
1325
1338
  listModels: async (id) => providerModels(provider).map((model) => ({
1326
1339
  ...piCarriedFields(model),
1340
+ ...capabilityProjection(model),
1327
1341
  provider: id,
1328
1342
  id: String(model.id ?? ""),
1329
- name: String(model.name ?? model.id ?? ""),
1330
- ...Array.isArray(model.input) ? { inputModalities: model.input.filter((m) => m === "text" || m === "image") } : {}
1343
+ name: String(model.name ?? model.id ?? "")
1331
1344
  })),
1332
1345
  resolveModel: async (id, modelId) => {
1333
1346
  const known = providerModels(provider).find((model) => model.id === modelId);
1334
1347
  return {
1335
1348
  ...known === void 0 ? {} : piCarriedFields(known),
1349
+ ...known === void 0 ? {} : capabilityProjection(known),
1336
1350
  ...known === void 0 ? {} : reasoningProjection(known),
1337
1351
  provider: id,
1338
1352
  id: modelId,
@@ -3564,4 +3578,4 @@ const runtimeInternals = {
3564
3578
  //#endregion
3565
3579
  export { runtimeInternals as i, normalizeToolSchema as n, registerVisionCompanions as r, applyPiPackage as t };
3566
3580
 
3567
- //# sourceMappingURL=runtime-Bh5k4Kjt.mjs.map
3581
+ //# sourceMappingURL=runtime-Xy8yU8wO.mjs.map