dsh-connect-workbuddy 3.0.2 → 3.3.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.
- package/CHANGELOG.md +190 -0
- package/README.en.md +49 -20
- package/README.md +49 -22
- package/THIRD_PARTY_NOTICES.md +4 -2
- package/docs/WINDOWS.md +1 -0
- package/docs/assets/account-pool-demo.html +207 -262
- package/lib/bin.js +23 -3
- package/lib/client.js +377 -755
- package/lib/{host-heartbeat-Dwmfxuyw.js → host-heartbeat-t93cLCoW.js} +238 -4
- package/lib/index.d.ts +140 -32
- package/lib/index.js +1409 -265
- package/package.json +1 -1
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { E as legacyWorkbuddyOwnAuthPath, H as WORKBUDDY_APP_EXECUTABLE_ENV, N as WorkBuddyUpstreamClient, S as defaultDesktopAuthDirs, _ as WORKBUDDY_AUTH_FILE_ENV, a as readHostHeartbeat, c as WORKBUDDY_CONNECT_VERSION, d as FALLBACK_WORKBUDDY_MODELS_GLOBAL, k as workbuddyOwnAuthPath, l as piAiRuntimeInfo, o as workbuddyHostHeartbeatPath, q as findWorkbuddyAppExecutable, r as isHeartbeatProcessAlive, u as FALLBACK_WORKBUDDY_MODELS, v as WorkBuddyCredentialStore, x as defaultDesktopAuthCandidates } from "./host-heartbeat-t93cLCoW.js";
|
|
3
3
|
import { realpathSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
//#region src/bin.ts
|
|
@@ -19,7 +19,7 @@ import { fileURLToPath } from "node:url";
|
|
|
19
19
|
*
|
|
20
20
|
* @module dsh-connect-workbuddy/bin
|
|
21
21
|
*/
|
|
22
|
-
const JSON_SCHEMA_VERSION =
|
|
22
|
+
const JSON_SCHEMA_VERSION = 3;
|
|
23
23
|
/** Both regions, in reporting order. */
|
|
24
24
|
const REGIONS = ["cn", "global"];
|
|
25
25
|
/** Region labels for human output. */
|
|
@@ -69,11 +69,29 @@ async function doctor(jsonOutput) {
|
|
|
69
69
|
accounts: await makeStore(region).accounts()
|
|
70
70
|
})));
|
|
71
71
|
const anySignedIn = regionLists.some(({ accounts }) => accounts.length > 0);
|
|
72
|
+
/**
|
|
73
|
+
* Which pi-ai copy the PROVIDER resolves, and hence which context shape its
|
|
74
|
+
* api consumes. This is the #24/#26 gate made visible: a legacy (0.85)
|
|
75
|
+
* resolution while the DSH host normalizes with 0.87 is exactly the mixed
|
|
76
|
+
* generation the adapter has to bridge, and the only way to SEE it is to
|
|
77
|
+
* report it. `resolvedLocally: false` is the normal state of a market
|
|
78
|
+
* install probed outside the host — inside DSH the host supplies pi-ai
|
|
79
|
+
* (0.2.0+ ships 0.87.1, i.e. the pass-through branch). Nothing here reads
|
|
80
|
+
* or reports key material.
|
|
81
|
+
*/
|
|
82
|
+
const piAi = piAiRuntimeInfo();
|
|
72
83
|
const report = {
|
|
73
84
|
schemaVersion: JSON_SCHEMA_VERSION,
|
|
74
85
|
package: "dsh-connect-workbuddy",
|
|
75
86
|
version: WORKBUDDY_CONNECT_VERSION,
|
|
76
87
|
node: process.version,
|
|
88
|
+
piAiRuntime: {
|
|
89
|
+
generation: piAi.generation,
|
|
90
|
+
version: piAi.version ?? (piAi.resolvedLocally ? "(unreadable)" : "(host-provided)"),
|
|
91
|
+
resolvedFrom: piAi.resolvedFrom ?? "(host-provided; not resolvable outside DSH)",
|
|
92
|
+
resolvedLocally: piAi.resolvedLocally,
|
|
93
|
+
adapterBehaviour: piAi.generation === "legacy" ? "folds 0.87 transcripts (system text + tool state) into the 0.85 context shape" : piAi.resolvedLocally ? "passes provider contexts through unchanged" : "passes provider contexts through unchanged (pi-ai comes from the DSH host; 0.2.0+ ships 0.87.1)"
|
|
94
|
+
},
|
|
77
95
|
desktopAuthFile: {
|
|
78
96
|
path: anyStore.desktopAuthPath() ?? "(no platform default; set WORKBUDDY_AUTH_FILE)",
|
|
79
97
|
dir: defaultDesktopAuthDirs()[0] ?? "(no platform default)",
|
|
@@ -120,12 +138,14 @@ async function doctor(jsonOutput) {
|
|
|
120
138
|
...anySignedIn ? [] : ["Sign in once in the WorkBuddy desktop app (either region), then run status again."],
|
|
121
139
|
...desktopPresent ? [] : [`No WorkBuddy desktop auth file at the expected path; set ${WORKBUDDY_AUTH_FILE_ENV} if it lives elsewhere.`],
|
|
122
140
|
...appExecutable === void 0 ? [`The WorkBuddy desktop app was not found, so encrypted credential fields cannot be opened; set ${WORKBUDDY_APP_EXECUTABLE_ENV} to its executable if it is installed elsewhere.`] : [],
|
|
123
|
-
...hostAlive ? [] : ["Host bundle not running in this DSH profile (or the process exited). The browser card and providers are unavailable until DSH starts the plugin."]
|
|
141
|
+
...hostAlive ? [] : ["Host bundle not running in this DSH profile (or the process exited). The browser card and providers are unavailable until DSH starts the plugin."],
|
|
142
|
+
...piAi.generation === "legacy" && piAi.resolvedLocally ? [`This plugin resolves pi-ai ${piAi.version ?? "(unreadable version)"} (the 0.85 context shape) while DSH 0.2.0+ hosts normalize with 0.87; the adapter bridges that gap, but if tools still misbehave, remove any nested pi-ai copy so the plugin resolves the host's.`] : []
|
|
124
143
|
]
|
|
125
144
|
};
|
|
126
145
|
if (jsonOutput) printJson(report);
|
|
127
146
|
else process.stdout.write([
|
|
128
147
|
`WorkBuddy Connect ${WORKBUDDY_CONNECT_VERSION} on ${process.version}`,
|
|
148
|
+
...piAi.resolvedLocally ? [`pi-ai runtime: ${piAi.generation}${piAi.version === void 0 ? "" : ` ${piAi.version}`} (${piAi.resolvedFrom}) — ${report.piAiRuntime.adapterBehaviour}`] : [`pi-ai runtime: ${piAi.generation}, host-provided (no local copy; DSH 0.2.0+ ships 0.87.1) — passes provider contexts through unchanged`],
|
|
129
149
|
`Desktop auth file: ${report.desktopAuthFile.present ? "present" : "missing"} (${report.desktopAuthFile.path})`,
|
|
130
150
|
`Encrypted-credential support: ${report.atRestDecryption.available ? "available" : "unavailable"} (${report.atRestDecryption.appExecutable})`,
|
|
131
151
|
`Host bundle: ${hostAlive ? `running (pid ${heartbeat.pid})` : heartbeat !== void 0 ? "stale heartbeat (process exited)" : "not started"}`,
|