@staff0rd/assist 0.1112.3 → 0.1112.5
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/dist/built-version +1 -1
- package/dist/commands/sessions/web/bundle.js +349 -348
- package/dist/index.js +32 -4
- package/package.json +1 -1
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.1112.
|
|
9
|
+
version: "0.1112.5",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -28423,7 +28423,8 @@ function watchCodexAppServer(child, fail15) {
|
|
|
28423
28423
|
stderr += chunk2;
|
|
28424
28424
|
});
|
|
28425
28425
|
child.on("error", fail15);
|
|
28426
|
-
child.stdin.on("error",
|
|
28426
|
+
child.stdin.on("error", () => {
|
|
28427
|
+
});
|
|
28427
28428
|
child.on(
|
|
28428
28429
|
"exit",
|
|
28429
28430
|
(code) => fail15(
|
|
@@ -28462,12 +28463,17 @@ async function openCodexAppServer(homeDir) {
|
|
|
28462
28463
|
});
|
|
28463
28464
|
} catch (error) {
|
|
28464
28465
|
server.close();
|
|
28465
|
-
throw error;
|
|
28466
|
+
throw startupError(error);
|
|
28466
28467
|
}
|
|
28467
28468
|
child.stdin.write(`${JSON.stringify({ method: "initialized" })}
|
|
28468
28469
|
`);
|
|
28469
28470
|
return server;
|
|
28470
28471
|
}
|
|
28472
|
+
function startupError(error) {
|
|
28473
|
+
if (error instanceof CodexRpcError) return error;
|
|
28474
|
+
if (!(error instanceof Error) || "code" in error) return error;
|
|
28475
|
+
return new CodexRpcError("initialize", -1, error.message);
|
|
28476
|
+
}
|
|
28471
28477
|
|
|
28472
28478
|
// src/commands/sync/selectAssistCodexHooks.ts
|
|
28473
28479
|
import * as fs23 from "fs";
|
|
@@ -56880,6 +56886,25 @@ function startSessionTitleGeneration(session, notify2) {
|
|
|
56880
56886
|
// src/commands/sessions/daemon/createScreenMirror.ts
|
|
56881
56887
|
import serialize from "@xterm/addon-serialize";
|
|
56882
56888
|
import headless from "@xterm/headless";
|
|
56889
|
+
|
|
56890
|
+
// src/commands/sessions/daemon/trackSgrMouseMode.ts
|
|
56891
|
+
var SGR_MOUSE_MODE = 1006;
|
|
56892
|
+
function trackSgrMouseMode(term) {
|
|
56893
|
+
let sgr = false;
|
|
56894
|
+
const watch4 = (final, on2) => term.parser.registerCsiHandler({ prefix: "?", final }, (params) => {
|
|
56895
|
+
if (params.includes(SGR_MOUSE_MODE)) sgr = on2;
|
|
56896
|
+
return false;
|
|
56897
|
+
});
|
|
56898
|
+
watch4("h", true);
|
|
56899
|
+
watch4("l", false);
|
|
56900
|
+
term.parser.registerEscHandler({ final: "c" }, () => {
|
|
56901
|
+
sgr = false;
|
|
56902
|
+
return false;
|
|
56903
|
+
});
|
|
56904
|
+
return () => sgr;
|
|
56905
|
+
}
|
|
56906
|
+
|
|
56907
|
+
// src/commands/sessions/daemon/createScreenMirror.ts
|
|
56883
56908
|
var { SerializeAddon } = serialize;
|
|
56884
56909
|
var { Terminal } = headless;
|
|
56885
56910
|
var SCROLLBACK_LINES = 5e3;
|
|
@@ -56892,6 +56917,7 @@ function createScreenMirror(cols, rows) {
|
|
|
56892
56917
|
});
|
|
56893
56918
|
const serializer = new SerializeAddon();
|
|
56894
56919
|
term.loadAddon(serializer);
|
|
56920
|
+
const sgrMouse = trackSgrMouseMode(term);
|
|
56895
56921
|
let notYetParsed = "";
|
|
56896
56922
|
return {
|
|
56897
56923
|
write: (data) => {
|
|
@@ -56903,7 +56929,9 @@ function createScreenMirror(cols, rows) {
|
|
|
56903
56929
|
resize: (c, r) => {
|
|
56904
56930
|
if (c > 0 && r > 0) term.resize(c, r);
|
|
56905
56931
|
},
|
|
56906
|
-
|
|
56932
|
+
/* why: the serializer restores the mouse tracking mode but not its encoding,
|
|
56933
|
+
so a replayed terminal would report the wheel in X10 to an app expecting SGR. */
|
|
56934
|
+
snapshot: () => serializer.serialize({ scrollback: SCROLLBACK_LINES }) + (sgrMouse() ? "\x1B[?1006h" : "") + notYetParsed
|
|
56907
56935
|
};
|
|
56908
56936
|
}
|
|
56909
56937
|
|