@quandev104/pi-style 0.2.6 → 0.2.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.9] - 2026-09-04
4
+
5
+ ### Bug Fixes
6
+
7
+ - *(compat)* Support Pi 0.85.0 runtime identities
8
+ - *(startup)* Show the current project path in the heading; simpler logo
9
+
10
+ ## [0.2.7] - 2026-08-25
11
+
12
+ ### Bug Fixes
13
+
14
+ - *(compat)* Support Pi 0.84.3 bundled runtime identities
15
+
3
16
  ## [0.2.5] - 2026-08-25
4
17
 
5
18
  ### Bug Fixes
package/README.md CHANGED
@@ -147,7 +147,7 @@ Ordinary mutations are session-only; persistence requires an explicit `global` o
147
147
  ## Compatibility
148
148
 
149
149
  - Public Pi APIs (widgets, editor, header, footer bridge) are preferred and enabled by default.
150
- - Tier C core patches (message prefixes, special blocks, tool selectors) are identity-certified per surface against recorded fingerprints (Pi `0.83.0`/`0.84.0` observed), isolated, reversible, and flag/config gated; any surface whose runtime identity is not recorded falls back natively on its own.
150
+ - Tier C core patches (message prefixes, special blocks, tool selectors) are identity-certified per surface against recorded fingerprints (Pi `0.83.0`–`0.85.0` observed; Pi ≥`0.84.3` loads the CLI from a minified bundled runtime, so every surface also records the bundled identities), isolated, reversible, and flag/config gated; any surface whose runtime identity is not recorded falls back natively on its own.
151
151
  - No render-time I/O: filesystem, Git, settings, and session data flow through cached providers into immutable snapshots.
152
152
  - Terminal-global background synchronization is unsupported/off for technical v1; explicit cell backgrounds and Pi theme APIs remain supported.
153
153
  - Terminal multiplexers gate kitty graphics: in herdr, previews (and Pi's own tool-result images) require `experimental.kitty_graphics = true` in `~/.config/herdr/config.toml` plus a server restart; tmux disables images upstream.
@@ -193,7 +193,7 @@ npm run check
193
193
 
194
194
  `npm run check` runs all required automated gates in order.
195
195
 
196
- Current test suite: 819 tests across 41 files.
196
+ Current test suite: 820 tests across 41 files.
197
197
 
198
198
  ---
199
199
 
@@ -441,6 +441,43 @@ function resetAnsi(value) {
441
441
  function fitAnsiWidth(value, width, ellipsis = "\u2026") {
442
442
  return visibleWidth(value) <= width ? value : truncateAnsi(value, width, ellipsis);
443
443
  }
444
+ function fitAnsiWidthTail(value, width, ellipsis = "\u2026") {
445
+ if (width <= 0) return "";
446
+ if (visibleWidth(value) <= width) return resetAnsi(value);
447
+ const ellipsisWidth = visibleWidth(ellipsis);
448
+ if (width <= ellipsisWidth) return resetAnsi(ellipsis);
449
+ const units = [];
450
+ let pending = "";
451
+ for (let i = 0; i < value.length; i++) {
452
+ const code = value.charCodeAt(i);
453
+ if (code === 27) {
454
+ const start = i;
455
+ i++;
456
+ while (i + 1 < value.length && !isFinal(value[i + 1] ?? "")) i++;
457
+ i++;
458
+ pending += value.slice(start, i + 1);
459
+ continue;
460
+ }
461
+ let char = value[i] ?? "";
462
+ if (code >= 55296 && code <= 56319 && i + 1 < value.length) char += value[++i];
463
+ units.push({ ansi: pending, char, charWidth: visibleWidth(char) || 1 });
464
+ pending = "";
465
+ }
466
+ let kept = 0;
467
+ let used = ellipsisWidth;
468
+ while (kept < units.length) {
469
+ const unit = units[units.length - 1 - kept];
470
+ if (!unit || used + unit.charWidth > width) break;
471
+ used += unit.charWidth;
472
+ kept++;
473
+ }
474
+ let output = ellipsis;
475
+ for (let index = units.length - kept; index < units.length; index++) {
476
+ const unit = units[index];
477
+ if (unit) output += unit.ansi + unit.char;
478
+ }
479
+ return resetAnsi(output);
480
+ }
444
481
  function truncateAnsi(value, width, ellipsis = "\u2026") {
445
482
  if (width <= 0) return "";
446
483
  if (visibleWidth(value) <= width) return resetAnsi(value);
@@ -9448,15 +9485,14 @@ function installEditor(options) {
9448
9485
 
9449
9486
  // extension-src/pi-style/features/startup/logo.ts
9450
9487
  var PI_LOGO_LINES = [
9451
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
9452
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551",
9453
- "\u2588\u2588\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2588\u2588\u2551",
9454
- "\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2551",
9455
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u256C\u2550\u2550\u2550\u2588\u2588\u2588\u2588\u2557",
9456
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2551 ",
9457
- "\u2588\u2588\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2588\u2588\u2551",
9458
- "\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2551",
9459
- "\u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u255D"
9488
+ "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
9489
+ "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
9490
+ "\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588",
9491
+ "\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588",
9492
+ "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588",
9493
+ "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588",
9494
+ "\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588",
9495
+ "\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588"
9460
9496
  ];
9461
9497
  var LOGO_PALETTE_STEPS = 24;
9462
9498
  var LOGO_MAX_DARKEN = 0.18;
@@ -9536,11 +9572,15 @@ function styledLogoLines(resolved) {
9536
9572
  logoGradientCacheKey = cacheKey2;
9537
9573
  return logoGradientCacheLines;
9538
9574
  }
9575
+ function logoDetailWidth(width) {
9576
+ const logoWidth = Math.max(...PI_LOGO_LINES.map((line) => visibleWidth(line)));
9577
+ return Math.max(0, width - logoWidth - visibleWidth(LOGO_GAP));
9578
+ }
9539
9579
  function compactLogoHeader(resolved, details, width) {
9540
9580
  const logoLines = styledLogoLines(resolved);
9541
- const logoWidth = Math.max(...PI_LOGO_LINES.map((line) => visibleWidth(line)));
9542
9581
  const safeWidth = Math.max(1, width);
9543
- const detailWidth = safeWidth - logoWidth - visibleWidth(LOGO_GAP);
9582
+ const logoWidth = Math.max(...PI_LOGO_LINES.map((line) => visibleWidth(line)));
9583
+ const detailWidth = logoDetailWidth(safeWidth);
9544
9584
  if (detailWidth >= LOGO_SIDE_DETAIL_MIN_WIDTH) {
9545
9585
  const detailStartRow = Math.max(0, Math.floor((PI_LOGO_LINES.length - details.length) / 2));
9546
9586
  return PI_LOGO_LINES.map((plainLine, index) => {
@@ -9554,7 +9594,7 @@ function compactLogoHeader(resolved, details, width) {
9554
9594
  if (safeWidth >= logoWidth) {
9555
9595
  return [...logoLines, ...details.map((detail) => fitAnsiWidth(detail, safeWidth))];
9556
9596
  }
9557
- return [details[0], details[2]].map((detail) => fitAnsiWidth(detail, safeWidth));
9597
+ return [details[0] ?? "", details[details.length - 1] ?? ""].map((detail) => fitAnsiWidth(detail, safeWidth));
9558
9598
  }
9559
9599
 
9560
9600
  // extension-src/pi-style/features/startup/index.ts
@@ -9752,6 +9792,10 @@ function renderToolsPanel(resolved, tools, minTotalWidth) {
9752
9792
  var STARTUP_INDENT = " ";
9753
9793
  var STARTUP_PADDING_TOP = 2;
9754
9794
  var STARTUP_PADDING_BOTTOM = 2;
9795
+ function startupProjectTitle(snapshot) {
9796
+ if (snapshot.cwd) return shortenPath(snapshot.cwd);
9797
+ return snapshot.project ?? "pi-style";
9798
+ }
9755
9799
  function styledLines(theme, config, snapshot, overlay, width) {
9756
9800
  if (width <= 0 || config.startup.mode === "off") return [];
9757
9801
  const resolved = resolveTheme(theme, config);
@@ -9760,13 +9804,19 @@ function styledLines(theme, config, snapshot, overlay, width) {
9760
9804
  const bodyWidth = Math.max(1, width - indentWidth);
9761
9805
  const indent = (content) => `${STARTUP_INDENT}${content}`;
9762
9806
  lines.push(...Array.from({ length: STARTUP_PADDING_TOP }, () => ""));
9763
- const logoTitle = resolved.mode === "ascii" ? "pi-style" : `${resolved.glyph("pi")} pi-style`;
9807
+ const asciiMode = resolved.mode === "ascii";
9808
+ const glyph = resolved.glyph("pi");
9809
+ const projectTitle = startupProjectTitle(snapshot);
9810
+ const titleBudget = Math.max(0, logoDetailWidth(bodyWidth) - (asciiMode ? 0 : visibleWidth(glyph) + 1));
9811
+ const fittedTitle = fitAnsiWidthTail(projectTitle, titleBudget, asciiMode ? "..." : "\u2026");
9812
+ const logoTitle = asciiMode ? fittedTitle : `${glyph} ${fittedTitle}`;
9764
9813
  lines.push(
9765
9814
  ...compactLogoHeader(
9766
9815
  resolved,
9767
9816
  [
9768
9817
  resolved.apply("accent", logoTitle),
9769
- resolved.apply("muted", "/ commands \xB7 ! bash"),
9818
+ resolved.apply("muted", "/ commands"),
9819
+ resolved.apply("muted", "! bash"),
9770
9820
  resolved.apply("success", "\u25CF ready")
9771
9821
  ],
9772
9822
  bodyWidth
@@ -11502,6 +11552,7 @@ function isTierCAuthorized(input) {
11502
11552
  import { readFileSync as readFileSync2 } from "fs";
11503
11553
  import { dirname as dirname4, join as join3 } from "path";
11504
11554
  import { fileURLToPath as fileURLToPath2 } from "url";
11555
+ import * as piCodingAgentPackage from "@earendil-works/pi-coding-agent";
11505
11556
  import {
11506
11557
  AssistantMessageComponent,
11507
11558
  BashExecutionComponent,
@@ -11886,8 +11937,13 @@ function decorateMessageRender(original, instance, args, snapshot = {
11886
11937
  function isSpacerChild(child) {
11887
11938
  return typeof child?.setLines === "function";
11888
11939
  }
11889
- function isBlankTextChild(child) {
11940
+ function unwrapMouseRegion(child) {
11890
11941
  const candidate = child;
11942
+ if (typeof candidate?.handleMouse !== "function" || candidate.child === void 0) return child;
11943
+ return candidate.child;
11944
+ }
11945
+ function isBlankTextChild(child) {
11946
+ const candidate = unwrapMouseRegion(child);
11891
11947
  if (typeof candidate?.setCustomBgFn !== "function" || typeof candidate.render !== "function") return false;
11892
11948
  if (typeof candidate.text === "string") return contentText(candidate.text).trim() === "";
11893
11949
  return contentText(candidate.render(0).join("\n")).trim() === "";
@@ -12138,15 +12194,29 @@ function installDelegatingPatch(options) {
12138
12194
  }
12139
12195
 
12140
12196
  // extension-src/pi-style/pi/compatibility-probe.ts
12141
- var SUPPORTED_VERSION_RANGE = ">=0.83.0 <0.85.0";
12142
- var SUPPORTED_PI_VERSIONS = Object.freeze(["0.83.0", "0.84.0"]);
12197
+ var SUPPORTED_VERSION_RANGE = ">=0.83.0 <0.86.0";
12198
+ var SUPPORTED_PI_VERSIONS = Object.freeze([
12199
+ "0.83.0",
12200
+ "0.84.0",
12201
+ "0.84.1",
12202
+ "0.84.2",
12203
+ "0.84.3",
12204
+ "0.84.4",
12205
+ "0.85.0"
12206
+ ]);
12143
12207
  var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12144
12208
  "native-assistant-message:render": Object.freeze([
12145
12209
  Object.freeze({
12146
12210
  name: "render",
12147
12211
  arity: 1,
12148
12212
  fingerprint: "2a39243f",
12149
- versions: Object.freeze(["0.83.0", "0.84.0"])
12213
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4", "0.85.0"])
12214
+ }),
12215
+ Object.freeze({
12216
+ name: "render",
12217
+ arity: 1,
12218
+ fingerprint: "a9be09a3",
12219
+ versions: Object.freeze(["0.84.3", "0.84.4", "0.85.0"])
12150
12220
  })
12151
12221
  ]),
12152
12222
  "native-assistant-message:updateContent": Object.freeze([
@@ -12163,7 +12233,32 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12163
12233
  name: "updateContent",
12164
12234
  arity: 1,
12165
12235
  fingerprint: "d2114491",
12166
- versions: Object.freeze(["0.84.0"])
12236
+ versions: Object.freeze(["0.84.0", "0.84.1", "0.84.2", "0.84.4"])
12237
+ }),
12238
+ // 0.84.3: the CLI loads a minified bundled runtime and extensions receive
12239
+ // the in-bundle class objects, so this method's toString() is the minified
12240
+ // text. See the registry docblock (artifact families) — the modular dist
12241
+ // build of 0.84.3 still carries the fingerprint above.
12242
+ Object.freeze({
12243
+ name: "updateContent",
12244
+ arity: 1,
12245
+ fingerprint: "356b7e83",
12246
+ versions: Object.freeze(["0.84.3", "0.84.4"])
12247
+ }),
12248
+ // 0.85.0 modular: adds per-run thinking visibility overrides and a
12249
+ // MouseRegion click toggle per thinking run (arity stays 1).
12250
+ Object.freeze({
12251
+ name: "updateContent",
12252
+ arity: 1,
12253
+ fingerprint: "80e338d2",
12254
+ versions: Object.freeze(["0.85.0"])
12255
+ }),
12256
+ // 0.85.0 bundled: same drift, minified.
12257
+ Object.freeze({
12258
+ name: "updateContent",
12259
+ arity: 1,
12260
+ fingerprint: "c3d72f2b",
12261
+ versions: Object.freeze(["0.85.0"])
12167
12262
  })
12168
12263
  ]),
12169
12264
  "native-compaction-message:updateDisplay": Object.freeze([
@@ -12171,7 +12266,13 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12171
12266
  name: "updateDisplay",
12172
12267
  arity: 0,
12173
12268
  fingerprint: "f8c44e78",
12174
- versions: Object.freeze(["0.83.0", "0.84.0"])
12269
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4", "0.85.0"])
12270
+ }),
12271
+ Object.freeze({
12272
+ name: "updateDisplay",
12273
+ arity: 0,
12274
+ fingerprint: "5118a51d",
12275
+ versions: Object.freeze(["0.84.3", "0.84.4", "0.85.0"])
12175
12276
  })
12176
12277
  ]),
12177
12278
  "native-branch-message:updateDisplay": Object.freeze([
@@ -12179,7 +12280,13 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12179
12280
  name: "updateDisplay",
12180
12281
  arity: 0,
12181
12282
  fingerprint: "415d57b7",
12182
- versions: Object.freeze(["0.83.0", "0.84.0"])
12283
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4", "0.85.0"])
12284
+ }),
12285
+ Object.freeze({
12286
+ name: "updateDisplay",
12287
+ arity: 0,
12288
+ fingerprint: "2185274e",
12289
+ versions: Object.freeze(["0.84.3", "0.84.4", "0.85.0"])
12183
12290
  })
12184
12291
  ]),
12185
12292
  "native-skill-message:updateDisplay": Object.freeze([
@@ -12187,7 +12294,13 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12187
12294
  name: "updateDisplay",
12188
12295
  arity: 0,
12189
12296
  fingerprint: "48099ea6",
12190
- versions: Object.freeze(["0.83.0", "0.84.0"])
12297
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4", "0.85.0"])
12298
+ }),
12299
+ Object.freeze({
12300
+ name: "updateDisplay",
12301
+ arity: 0,
12302
+ fingerprint: "4051fd65",
12303
+ versions: Object.freeze(["0.84.3", "0.84.4", "0.85.0"])
12191
12304
  })
12192
12305
  ]),
12193
12306
  "native-custom-message:rebuild": Object.freeze([
@@ -12195,7 +12308,13 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12195
12308
  name: "rebuild",
12196
12309
  arity: 0,
12197
12310
  fingerprint: "76ae2e3a",
12198
- versions: Object.freeze(["0.83.0", "0.84.0"])
12311
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4", "0.85.0"])
12312
+ }),
12313
+ Object.freeze({
12314
+ name: "rebuild",
12315
+ arity: 0,
12316
+ fingerprint: "b89987cc",
12317
+ versions: Object.freeze(["0.84.3", "0.84.4", "0.85.0"])
12199
12318
  })
12200
12319
  ]),
12201
12320
  "tool-call-renderer:getCallRenderer": Object.freeze([
@@ -12203,7 +12322,28 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12203
12322
  name: "getCallRenderer",
12204
12323
  arity: 0,
12205
12324
  fingerprint: "951ea0e0",
12206
- versions: Object.freeze(["0.83.0", "0.84.0"])
12325
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4"])
12326
+ }),
12327
+ Object.freeze({
12328
+ name: "getCallRenderer",
12329
+ arity: 0,
12330
+ fingerprint: "e50613b7",
12331
+ versions: Object.freeze(["0.84.3", "0.84.4"])
12332
+ }),
12333
+ // 0.85.0 modular: drops the `builtInToolDefinition` fallback branches
12334
+ // and returns `this.toolDefinition?.renderCall` directly.
12335
+ Object.freeze({
12336
+ name: "getCallRenderer",
12337
+ arity: 0,
12338
+ fingerprint: "e0a9ed86",
12339
+ versions: Object.freeze(["0.85.0"])
12340
+ }),
12341
+ // 0.85.0 bundled: same drift, minified.
12342
+ Object.freeze({
12343
+ name: "getCallRenderer",
12344
+ arity: 0,
12345
+ fingerprint: "73116365",
12346
+ versions: Object.freeze(["0.85.0"])
12207
12347
  })
12208
12348
  ]),
12209
12349
  "tool-result-renderer:getResultRenderer": Object.freeze([
@@ -12211,7 +12351,28 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12211
12351
  name: "getResultRenderer",
12212
12352
  arity: 0,
12213
12353
  fingerprint: "8a25cd71",
12214
- versions: Object.freeze(["0.83.0", "0.84.0"])
12354
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4"])
12355
+ }),
12356
+ Object.freeze({
12357
+ name: "getResultRenderer",
12358
+ arity: 0,
12359
+ fingerprint: "28c4dc22",
12360
+ versions: Object.freeze(["0.84.3", "0.84.4"])
12361
+ }),
12362
+ // 0.85.0 modular: drops the `builtInToolDefinition` fallback branches
12363
+ // and returns `this.toolDefinition?.renderResult` directly.
12364
+ Object.freeze({
12365
+ name: "getResultRenderer",
12366
+ arity: 0,
12367
+ fingerprint: "1567dcf4",
12368
+ versions: Object.freeze(["0.85.0"])
12369
+ }),
12370
+ // 0.85.0 bundled: same drift, minified.
12371
+ Object.freeze({
12372
+ name: "getResultRenderer",
12373
+ arity: 0,
12374
+ fingerprint: "d613a2a3",
12375
+ versions: Object.freeze(["0.85.0"])
12215
12376
  })
12216
12377
  ]),
12217
12378
  "native-bash-execution:render": Object.freeze([
@@ -12223,7 +12384,13 @@ var KNOWN_NATIVE_IDENTITIES = Object.freeze({
12223
12384
  name: "BashExecutionComponent",
12224
12385
  arity: 2,
12225
12386
  fingerprint: "a5b5abca",
12226
- versions: Object.freeze(["0.83.0", "0.84.0"])
12387
+ versions: Object.freeze(["0.83.0", "0.84.0", "0.84.1", "0.84.2", "0.84.4", "0.85.0"])
12388
+ }),
12389
+ Object.freeze({
12390
+ name: "BashExecutionComponent",
12391
+ arity: 2,
12392
+ fingerprint: "98d22d96",
12393
+ versions: Object.freeze(["0.84.3", "0.84.4", "0.85.0"])
12227
12394
  })
12228
12395
  ])
12229
12396
  });
@@ -12268,6 +12435,7 @@ function trustedNativeIdentity(spec) {
12268
12435
  }
12269
12436
  return Object.getOwnPropertyDescriptor(spec.target, spec.method)?.value;
12270
12437
  }
12438
+ var RUNTIME_PI_VERSION = piCodingAgentPackage.VERSION;
12271
12439
  function detectPiVersion(resolution = {}) {
12272
12440
  const resolvePackageEntry = resolution.resolvePackageEntry ?? ((name) => {
12273
12441
  try {
@@ -12279,6 +12447,7 @@ function detectPiVersion(resolution = {}) {
12279
12447
  }
12280
12448
  });
12281
12449
  const readFile4 = resolution.readFile ?? ((path) => readFileSync2(path, "utf8"));
12450
+ let walkDiagnostic;
12282
12451
  try {
12283
12452
  const entry = resolvePackageEntry("@earendil-works/pi-coding-agent");
12284
12453
  let directory = dirname4(entry);
@@ -12294,13 +12463,13 @@ function detectPiVersion(resolution = {}) {
12294
12463
  if (parent === directory) break;
12295
12464
  directory = parent;
12296
12465
  }
12297
- return { version: void 0, diagnostic: "Pi package version was not found" };
12466
+ walkDiagnostic = "Pi package version was not found";
12298
12467
  } catch (error) {
12299
- return {
12300
- version: void 0,
12301
- diagnostic: `Pi package version detection failed: ${error instanceof Error ? error.message : String(error)}`
12302
- };
12468
+ walkDiagnostic = `Pi package version detection failed: ${error instanceof Error ? error.message : String(error)}`;
12303
12469
  }
12470
+ const runtimeVersion = resolution.runtimeVersion !== void 0 ? resolution.runtimeVersion : RUNTIME_PI_VERSION;
12471
+ if (typeof runtimeVersion === "string" && runtimeVersion.trim() !== "") return { version: runtimeVersion };
12472
+ return { version: void 0, diagnostic: walkDiagnostic };
12304
12473
  }
12305
12474
  function descriptorSnapshot(descriptor) {
12306
12475
  if (!descriptor) return void 0;