@staff0rd/assist 0.326.1 → 0.327.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/README.md +1 -0
- package/dist/index.js +56 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -277,6 +277,7 @@ From WSL, the selector can also surface and drive Windows-host repos (requires `
|
|
|
277
277
|
|
|
278
278
|
- `sessions.windowsProjectsRoot` — the Windows `.claude/projects` directory as seen from WSL (e.g. `/mnt/c/Users/<user>/.claude/projects`); enables discovery of Windows-host repos, tagged with a `Windows` badge. Selecting one launches a native assist daemon on Windows and runs an interactive session there.
|
|
279
279
|
- `sessions.windowsDaemonHost` / `sessions.windowsDaemonPort` — where the WSL daemon reaches the native Windows daemon (defaults `127.0.0.1` / `51764`; set the host to the Windows IP on WSL2 NAT-mode networking).
|
|
280
|
+
- `sessions.windowsVersionCheck` — how the WSL↔Windows daemon handshake reacts to a protocol-version mismatch: `block` (default) refuses creates and auto-heals the host, `warn` logs and proceeds anyway, `off` skips the check. Use `warn`/`off` to keep working across an unfixable version gap.
|
|
280
281
|
|
|
281
282
|
When iterating on assist itself: web server changes only need the `assist sessions` process restarted — sessions survive. Daemon/session-core changes need `assist daemon restart` to load the new code; this kills the PTYs, then claude sessions — including assist sessions that wrap claude, like `assist draft` — are auto-respawned via `claude --resume` with scrollback starting fresh, while run sessions (and assist sessions whose claude sessionId was never discovered) reappear as not-restored tiles that can be retried.
|
|
282
283
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.327.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -285,7 +285,8 @@ var assistConfigSchema = z2.strictObject({
|
|
|
285
285
|
// why: host the WSL daemon dials to reach the native Windows daemon over TCP (WSL can't use the Windows named pipe); defaults to 127.0.0.1 (WSL2 mirrored networking). NAT-mode users set the Windows host IP.
|
|
286
286
|
windowsDaemonHost: z2.string().optional(),
|
|
287
287
|
// why: TCP port the native Windows daemon listens on for the WSL bridge; defaults to 51764
|
|
288
|
-
windowsDaemonPort: z2.number().optional()
|
|
288
|
+
windowsDaemonPort: z2.number().optional(),
|
|
289
|
+
windowsVersionCheck: z2.enum(["block", "warn", "off"]).default("block")
|
|
289
290
|
}).optional(),
|
|
290
291
|
database: z2.strictObject({
|
|
291
292
|
url: z2.string().optional()
|
|
@@ -21342,18 +21343,6 @@ function stripOutboundSessionId(data) {
|
|
|
21342
21343
|
return { ...data, sessionId: stripWindowsSessionId(data.sessionId) };
|
|
21343
21344
|
}
|
|
21344
21345
|
|
|
21345
|
-
// src/commands/sessions/daemon/buildHello.ts
|
|
21346
|
-
var ASSIST_VERSION = package_default.version;
|
|
21347
|
-
function buildHello() {
|
|
21348
|
-
return { type: "hello", version: ASSIST_VERSION };
|
|
21349
|
-
}
|
|
21350
|
-
function isHello(msg) {
|
|
21351
|
-
return msg.type === "hello" && typeof msg.version === "string";
|
|
21352
|
-
}
|
|
21353
|
-
function versionsMatch(a, b) {
|
|
21354
|
-
return a === b;
|
|
21355
|
-
}
|
|
21356
|
-
|
|
21357
21346
|
// src/commands/sessions/daemon/WindowsProxyState.ts
|
|
21358
21347
|
var MAX_SCROLLBACK2 = 256 * 1024;
|
|
21359
21348
|
var DEFAULT_CREATE_TIMEOUT_MS = 5e3;
|
|
@@ -21399,6 +21388,59 @@ function appendScrollback2(state, sessionId, data) {
|
|
|
21399
21388
|
);
|
|
21400
21389
|
}
|
|
21401
21390
|
|
|
21391
|
+
// src/commands/sessions/daemon/handleSessions.ts
|
|
21392
|
+
function handleSessions(state, msg) {
|
|
21393
|
+
state.windowsSessions = msg.sessions.map((s) => ({
|
|
21394
|
+
...s,
|
|
21395
|
+
id: toWindowsSessionId(s.id)
|
|
21396
|
+
}));
|
|
21397
|
+
const live = new Set(state.windowsSessions.map((s) => s.id));
|
|
21398
|
+
for (const id2 of state.scrollback.keys())
|
|
21399
|
+
if (!live.has(id2)) state.scrollback.delete(id2);
|
|
21400
|
+
state.onSessionsChanged();
|
|
21401
|
+
}
|
|
21402
|
+
|
|
21403
|
+
// src/commands/sessions/daemon/buildHello.ts
|
|
21404
|
+
var ASSIST_VERSION = package_default.version;
|
|
21405
|
+
var PROTOCOL_VERSION = 1;
|
|
21406
|
+
function buildHello() {
|
|
21407
|
+
return { type: "hello", version: ASSIST_VERSION, protocol: PROTOCOL_VERSION };
|
|
21408
|
+
}
|
|
21409
|
+
function isHello(msg) {
|
|
21410
|
+
return msg.type === "hello" && typeof msg.version === "string" && (msg.protocol === void 0 || typeof msg.protocol === "number");
|
|
21411
|
+
}
|
|
21412
|
+
function helloCompatible(msg) {
|
|
21413
|
+
if (typeof msg.protocol === "number")
|
|
21414
|
+
return msg.protocol === PROTOCOL_VERSION;
|
|
21415
|
+
return msg.version === ASSIST_VERSION;
|
|
21416
|
+
}
|
|
21417
|
+
|
|
21418
|
+
// src/commands/sessions/daemon/windowsVersionCheck.ts
|
|
21419
|
+
function windowsVersionCheck() {
|
|
21420
|
+
return loadConfig().sessions?.windowsVersionCheck ?? "block";
|
|
21421
|
+
}
|
|
21422
|
+
|
|
21423
|
+
// src/commands/sessions/daemon/handleHello.ts
|
|
21424
|
+
function handleHello(state, msg) {
|
|
21425
|
+
if (!isHello(msg) || helloCompatible(msg)) return;
|
|
21426
|
+
const mode = windowsVersionCheck();
|
|
21427
|
+
const detail = `protocol ${msg.protocol ?? "legacy"} version ${msg.version} (wsl protocol ${PROTOCOL_VERSION} version ${ASSIST_VERSION})`;
|
|
21428
|
+
if (mode === "off") {
|
|
21429
|
+
daemonLog(
|
|
21430
|
+
`windows daemon protocol mismatch: ${detail}; check disabled (sessions.windowsVersionCheck=off), proceeding`
|
|
21431
|
+
);
|
|
21432
|
+
return;
|
|
21433
|
+
}
|
|
21434
|
+
if (mode === "warn") {
|
|
21435
|
+
daemonLog(
|
|
21436
|
+
`windows daemon protocol mismatch: ${detail}; proceeding with warning (sessions.windowsVersionCheck=warn)`
|
|
21437
|
+
);
|
|
21438
|
+
return;
|
|
21439
|
+
}
|
|
21440
|
+
daemonLog(`windows daemon protocol mismatch: ${detail}`);
|
|
21441
|
+
state.onVersionMismatch(msg.version);
|
|
21442
|
+
}
|
|
21443
|
+
|
|
21402
21444
|
// src/commands/sessions/daemon/handleInbound.ts
|
|
21403
21445
|
function handleInbound(state, line) {
|
|
21404
21446
|
let msg;
|
|
@@ -21424,14 +21466,6 @@ var inbound = {
|
|
|
21424
21466
|
state.broadcast(msg);
|
|
21425
21467
|
}
|
|
21426
21468
|
};
|
|
21427
|
-
function handleHello(state, msg) {
|
|
21428
|
-
if (isHello(msg) && !versionsMatch(msg.version, ASSIST_VERSION)) {
|
|
21429
|
-
daemonLog(
|
|
21430
|
-
`windows daemon version mismatch: ${msg.version} (wsl ${ASSIST_VERSION})`
|
|
21431
|
-
);
|
|
21432
|
-
state.onVersionMismatch(msg.version);
|
|
21433
|
-
}
|
|
21434
|
-
}
|
|
21435
21469
|
function handleCreated(state, msg) {
|
|
21436
21470
|
daemonLog(`windows daemon: created session ${nsId(msg)}`);
|
|
21437
21471
|
const client = takePendingCreator(state);
|
|
@@ -21443,16 +21477,6 @@ function handleCreated(state, msg) {
|
|
|
21443
21477
|
});
|
|
21444
21478
|
else daemonLog("windows daemon: created with no pending creator (dropped)");
|
|
21445
21479
|
}
|
|
21446
|
-
function handleSessions(state, msg) {
|
|
21447
|
-
state.windowsSessions = msg.sessions.map((s) => ({
|
|
21448
|
-
...s,
|
|
21449
|
-
id: toWindowsSessionId(s.id)
|
|
21450
|
-
}));
|
|
21451
|
-
const live = new Set(state.windowsSessions.map((s) => s.id));
|
|
21452
|
-
for (const id2 of state.scrollback.keys())
|
|
21453
|
-
if (!live.has(id2)) state.scrollback.delete(id2);
|
|
21454
|
-
state.onSessionsChanged();
|
|
21455
|
-
}
|
|
21456
21480
|
function handleOutput(state, msg) {
|
|
21457
21481
|
const sessionId = nsId(msg);
|
|
21458
21482
|
const data = msg.data;
|