@danypops/pi-papyrus 0.46.5 → 0.47.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.
@@ -1,4 +1,4 @@
1
- import type { Theme } from "@earendil-works/pi-coding-agent";
1
+ import { keyHint, type Theme } from "@earendil-works/pi-coding-agent";
2
2
  import { type Component, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
3
3
  import { buildDetailLines, type DetailField, type DetailSection, type DetailViewTheme, type TextMeasure } from "malevich-tui-components";
4
4
  import type { ArtifactToolDetails } from "./render-model.ts";
@@ -93,8 +93,11 @@ export function emptyState(noun: string): string {
93
93
  return `No ${noun}.`;
94
94
  }
95
95
 
96
+ /** Real, possibly user-remapped hotkey (defaults to ctrl+o, Pi's own "app.tools.expand"
97
+ * binding) -- matches every one of Pi's own built-in tools (read/write/bash/find/grep/ls),
98
+ * which all show their own truncation hint the same way instead of a hardcoded string. */
96
99
  export function expandHint(): string {
97
- return "expand for details";
100
+ return keyHint("app.tools.expand", "expand for details");
98
101
  }
99
102
 
100
103
  /** Reusable width-safe artifact card for native tool result rows. */
@@ -23,7 +23,7 @@
23
23
  * had died.
24
24
  */
25
25
 
26
- import { createReconnectingVehicleClient } from "@danypops/vehicle-client/daemon-client";
26
+ import { createReconnectingVehicleClient, daemonInstanceIdentity } from "@danypops/vehicle-client/daemon-client";
27
27
  import { RemoteVehicleClient } from "@danypops/vehicle-client/http";
28
28
  import { type RegisteredPiVehicle, registerVehicleToolsWhenReady, type VehicleReadyEvent } from "@danypops/vehicle-client-pi";
29
29
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
@@ -105,11 +105,24 @@ function notifyReadyEvent(event: VehicleReadyEvent): void {
105
105
  */
106
106
  export function registerNotesVehicle(pi: ExtensionAPI): Promise<RegisteredPiVehicle | undefined> {
107
107
  recordRenderDiagnostic({ event: "register-notes-vehicle-called" });
108
- const client = createReconnectingVehicleClient(async () => {
108
+ function resolveTarget() {
109
109
  const resolved = currentVehicleClientTarget();
110
110
  if (!resolved) throw new Error("Papyrus daemon is not running");
111
- return new RemoteVehicleClient({ baseUrl: resolved.baseUrl, token: resolved.token });
112
- });
111
+ return resolved;
112
+ }
113
+ const client = createReconnectingVehicleClient(
114
+ async () => {
115
+ const resolved = resolveTarget();
116
+ return new RemoteVehicleClient({ baseUrl: resolved.baseUrl, token: resolved.token });
117
+ },
118
+ {
119
+ // The random loopback port is process-instance identity for Papyrus: it changes on
120
+ // every restart while the bearer token intentionally survives. Re-read it before
121
+ // every dispatch so a long-lived Pi session never sends one sacrificial call to a
122
+ // cached dead port just to discover what the handle file already says.
123
+ resolveIdentity: () => daemonInstanceIdentity(resolveTarget().baseUrl),
124
+ },
125
+ );
113
126
  return registerVehicleToolsWhenReady(pi, () => Promise.resolve(currentVehicleClientTarget() ? client : undefined), {
114
127
  log: (event) => {
115
128
  // Correlates against onInvoked's own timestamps below -- the /reload investigation's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/pi-papyrus",
3
- "version": "0.46.5",
3
+ "version": "0.47.0",
4
4
  "description": "Pi host extension for Papyrus: native tools, TUI panels, and context injection over the daemon-backed graph store",
5
5
  "type": "module",
6
6
  "keywords": ["pi-package"],
@@ -19,8 +19,8 @@
19
19
  "dependencies": {
20
20
  "@danypops/jittor": "^0.14.0",
21
21
  "@danypops/papyrus": "^0.45.2",
22
- "@danypops/vehicle-client": "^0.5.0",
23
- "@danypops/vehicle-client-pi": "^0.18.4",
22
+ "@danypops/vehicle-client": "^0.7.0",
23
+ "@danypops/vehicle-client-pi": "^0.19.0",
24
24
  "@danypops/vehicle-core": "^0.12.3",
25
25
  "@danypops/vehicle-server": "^0.18.1",
26
26
  "beautiful-mermaid": "1.1.3",