@danypops/pi-papyrus 0.46.6 → 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.
|
@@ -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
|
-
|
|
108
|
+
function resolveTarget() {
|
|
109
109
|
const resolved = currentVehicleClientTarget();
|
|
110
110
|
if (!resolved) throw new Error("Papyrus daemon is not running");
|
|
111
|
-
return
|
|
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.
|
|
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.
|
|
23
|
-
"@danypops/vehicle-client-pi": "^0.
|
|
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",
|