zcode-acp-server 0.14.3 → 0.17.1

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.
Files changed (93) hide show
  1. package/README.md +109 -9
  2. package/README.zh-CN.md +91 -9
  3. package/dist/backend/index.d.ts +1 -0
  4. package/dist/backend/index.d.ts.map +1 -1
  5. package/dist/backend/index.js +1 -0
  6. package/dist/backend/index.js.map +1 -1
  7. package/dist/backend/sandbox.d.ts +92 -23
  8. package/dist/backend/sandbox.d.ts.map +1 -1
  9. package/dist/backend/sandbox.js +265 -70
  10. package/dist/backend/sandbox.js.map +1 -1
  11. package/dist/cli.d.ts +2 -0
  12. package/dist/cli.d.ts.map +1 -1
  13. package/dist/cli.js +10 -1
  14. package/dist/cli.js.map +1 -1
  15. package/dist/config/auto-compact.d.ts.map +1 -1
  16. package/dist/config/auto-compact.js +6 -4
  17. package/dist/config/auto-compact.js.map +1 -1
  18. package/dist/config/mcp-discovery.d.ts.map +1 -1
  19. package/dist/config/mcp-discovery.js +7 -5
  20. package/dist/config/mcp-discovery.js.map +1 -1
  21. package/dist/handlers/background-tasks.d.ts.map +1 -1
  22. package/dist/handlers/background-tasks.js +2 -2
  23. package/dist/handlers/background-tasks.js.map +1 -1
  24. package/dist/handlers/dispatch.d.ts.map +1 -1
  25. package/dist/handlers/dispatch.js +4 -4
  26. package/dist/handlers/dispatch.js.map +1 -1
  27. package/dist/handlers/replay.d.ts.map +1 -1
  28. package/dist/handlers/replay.js +11 -5
  29. package/dist/handlers/replay.js.map +1 -1
  30. package/dist/handlers/sandbox-allow.d.ts +71 -0
  31. package/dist/handlers/sandbox-allow.d.ts.map +1 -0
  32. package/dist/handlers/sandbox-allow.js +299 -0
  33. package/dist/handlers/sandbox-allow.js.map +1 -0
  34. package/dist/handlers/server-requests.d.ts.map +1 -1
  35. package/dist/handlers/server-requests.js +7 -5
  36. package/dist/handlers/server-requests.js.map +1 -1
  37. package/dist/handlers/session.d.ts +14 -1
  38. package/dist/handlers/session.d.ts.map +1 -1
  39. package/dist/handlers/session.js +193 -20
  40. package/dist/handlers/session.js.map +1 -1
  41. package/dist/handlers/slash.d.ts.map +1 -1
  42. package/dist/handlers/slash.js +15 -13
  43. package/dist/handlers/slash.js.map +1 -1
  44. package/dist/i18n.d.ts +111 -0
  45. package/dist/i18n.d.ts.map +1 -0
  46. package/dist/i18n.js +222 -0
  47. package/dist/i18n.js.map +1 -0
  48. package/dist/index.d.ts +18 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +114 -15
  51. package/dist/index.js.map +1 -1
  52. package/dist/interaction/adapter.d.ts.map +1 -1
  53. package/dist/interaction/adapter.js +10 -7
  54. package/dist/interaction/adapter.js.map +1 -1
  55. package/dist/remote/config.d.ts +7 -0
  56. package/dist/remote/config.d.ts.map +1 -1
  57. package/dist/remote/config.js +2 -0
  58. package/dist/remote/config.js.map +1 -1
  59. package/dist/remote/endpoint.d.ts.map +1 -1
  60. package/dist/remote/endpoint.js +66 -11
  61. package/dist/remote/endpoint.js.map +1 -1
  62. package/dist/remote/hub-server.d.ts +15 -0
  63. package/dist/remote/hub-server.d.ts.map +1 -1
  64. package/dist/remote/hub-server.js +205 -1
  65. package/dist/remote/hub-server.js.map +1 -1
  66. package/dist/repl/App.d.ts.map +1 -1
  67. package/dist/repl/App.js +3 -2
  68. package/dist/repl/App.js.map +1 -1
  69. package/dist/repl/model.d.ts +2 -0
  70. package/dist/repl/model.d.ts.map +1 -1
  71. package/dist/repl/model.js.map +1 -1
  72. package/dist/repl/run.d.ts.map +1 -1
  73. package/dist/repl/run.js +5 -0
  74. package/dist/repl/run.js.map +1 -1
  75. package/dist/server.d.ts +78 -1
  76. package/dist/server.d.ts.map +1 -1
  77. package/dist/server.js +114 -3
  78. package/dist/server.js.map +1 -1
  79. package/dist/tasks-index.d.ts +27 -0
  80. package/dist/tasks-index.d.ts.map +1 -1
  81. package/dist/tasks-index.js +72 -3
  82. package/dist/tasks-index.js.map +1 -1
  83. package/docs/REMOTE-CLIENTS.md +43 -0
  84. package/docs/TROUBLESHOOTING.md +9 -3
  85. package/package.json +13 -12
  86. package/dist/remote/session-liveness.d.ts +0 -19
  87. package/dist/remote/session-liveness.d.ts.map +0 -1
  88. package/dist/remote/session-liveness.js +0 -70
  89. package/dist/remote/session-liveness.js.map +0 -1
  90. package/dist/repl/mouse.d.ts +0 -49
  91. package/dist/repl/mouse.d.ts.map +0 -1
  92. package/dist/repl/mouse.js +0 -165
  93. package/dist/repl/mouse.js.map +0 -1
@@ -1,49 +0,0 @@
1
- /**
2
- * Mouse-wheel capture for the full-screen REPL (alternate-screen mode).
3
- *
4
- * Enabling xterm mouse reporting (?1000 press/release + ?1002 drag +
5
- * ?1006 SGR encoding) re-routes the terminal's wheel from its own scrollback
6
- * scroll to escape sequences delivered to us — `\x1b[<64;col;rowM` = wheel
7
- * up, `\x1b[<65;…M` = wheel down. The terminal stops scrolling entirely,
8
- * which is what prevents Warp from scrolling the alt-screen frame away
9
- * (warp#9838); vim/tmux/htop scroll correctly inside Warp via this exact
10
- * mechanism.
11
- *
12
- * Ink knows nothing about mouse sequences, so raw bytes must never reach it:
13
- * this module owns the REAL process.stdin as its sole consumer, strips
14
- * complete SGR mouse events out of the byte stream, forwards everything
15
- * else into a fake stdin handed to ink via `render({stdin})`, and reports
16
- * wheel notches through a callback.
17
- */
18
- /** DECSET sequences arming SGR mouse reporting on the terminal. */
19
- export declare const MOUSE_ENABLE = "\u001B[?1000h\u001B[?1002h\u001B[?1006h";
20
- /** Matching resets — idempotent, safe to write more than once. */
21
- export declare const MOUSE_DISABLE = "\u001B[?1000l\u001B[?1002l\u001B[?1006l";
22
- export type WheelDirection = "up" | "down";
23
- /**
24
- * Incremental splitter: feed() raw stdin chunks, get back display-safe text
25
- * with every mouse event removed, and receive wheel callbacks for events.
26
- * Holds an incomplete trailing sequence until the rest arrives in a later
27
- * chunk.
28
- */
29
- export declare class MouseSequenceFilter {
30
- private readonly onWheel;
31
- private pending;
32
- constructor(onWheel: (dir: WheelDirection) => void);
33
- /** Feed one raw chunk; returns the passthrough text (may be empty). */
34
- feed(chunk: string): string;
35
- }
36
- export interface FilteredStdin {
37
- /** Ink-facing stream — pass to render({stdin}). */
38
- stream: NodeJS.ReadStream;
39
- /** Stop capturing and tear down listeners on the real stdin. */
40
- dispose(): void;
41
- }
42
- /**
43
- * Take over process.stdin, strip mouse events, expose the cleaned stream for
44
- * ink. The fake stream forwards TTY identity and lifecycle calls (ink sets
45
- * raw mode, ref/unrefs it, and consumes via 'readable'+read()); keyboard data
46
- * flows through unchanged byte-for-byte.
47
- */
48
- export declare function createFilteredStdin(onWheel: (dir: WheelDirection) => void): FilteredStdin;
49
- //# sourceMappingURL=mouse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mouse.d.ts","sourceRoot":"","sources":["../../src/repl/mouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,mEAAmE;AACnE,eAAO,MAAM,YAAY,4CAAsC,CAAC;AAEhE,kEAAkE;AAClE,eAAO,MAAM,aAAa,4CAAsC,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,CAAC;AAM3C;;;;;GAKG;AACH,qBAAa,mBAAmB;IAGlB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,OAAO,CAAM;gBAEQ,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI;IAEnE,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CA+B5B;AA4CD,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAC1B,gEAAgE;IAChE,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,aAAa,CA0CzF"}
@@ -1,165 +0,0 @@
1
- /**
2
- * Mouse-wheel capture for the full-screen REPL (alternate-screen mode).
3
- *
4
- * Enabling xterm mouse reporting (?1000 press/release + ?1002 drag +
5
- * ?1006 SGR encoding) re-routes the terminal's wheel from its own scrollback
6
- * scroll to escape sequences delivered to us — `\x1b[<64;col;rowM` = wheel
7
- * up, `\x1b[<65;…M` = wheel down. The terminal stops scrolling entirely,
8
- * which is what prevents Warp from scrolling the alt-screen frame away
9
- * (warp#9838); vim/tmux/htop scroll correctly inside Warp via this exact
10
- * mechanism.
11
- *
12
- * Ink knows nothing about mouse sequences, so raw bytes must never reach it:
13
- * this module owns the REAL process.stdin as its sole consumer, strips
14
- * complete SGR mouse events out of the byte stream, forwards everything
15
- * else into a fake stdin handed to ink via `render({stdin})`, and reports
16
- * wheel notches through a callback.
17
- */
18
- import { PassThrough } from "node:stream";
19
- /** DECSET sequences arming SGR mouse reporting on the terminal. */
20
- export const MOUSE_ENABLE = "\x1b[?1000h\x1b[?1002h\x1b[?1006h";
21
- /** Matching resets — idempotent, safe to write more than once. */
22
- export const MOUSE_DISABLE = "\x1b[?1000l\x1b[?1002l\x1b[?1006l";
23
- /** Longest legitimate SGR mouse event is well under 32 bytes; beyond this a
24
- * dangling `\x1b[<` prefix is garbage and gets flushed verbatim. */
25
- const MAX_PENDING = 64;
26
- /**
27
- * Incremental splitter: feed() raw stdin chunks, get back display-safe text
28
- * with every mouse event removed, and receive wheel callbacks for events.
29
- * Holds an incomplete trailing sequence until the rest arrives in a later
30
- * chunk.
31
- */
32
- export class MouseSequenceFilter {
33
- onWheel;
34
- pending = "";
35
- constructor(onWheel) {
36
- this.onWheel = onWheel;
37
- }
38
- /** Feed one raw chunk; returns the passthrough text (may be empty). */
39
- feed(chunk) {
40
- let buf = this.pending + chunk;
41
- if (!buf.includes("\x1b"))
42
- return buf;
43
- let out = "";
44
- let i = 0;
45
- while (i < buf.length) {
46
- if (buf[i] !== "\x1b") {
47
- out += buf[i];
48
- i++;
49
- continue;
50
- }
51
- const match = scanMouseEvent(buf, i);
52
- if (match === null) {
53
- // Ran off the end mid-candidate: hold the tail for the next chunk.
54
- this.pending = buf.slice(i);
55
- if (this.pending.length > MAX_PENDING) {
56
- out += this.pending; // pathological — flush verbatim instead of eating input
57
- this.pending = "";
58
- }
59
- return out;
60
- }
61
- if (!match.passthrough) {
62
- if (match.dir !== null)
63
- this.onWheel(match.dir);
64
- }
65
- else {
66
- out += "\x1b"; // lone ESC / non-mouse CSI: byte-identical passthrough
67
- }
68
- i += match.consumed;
69
- }
70
- this.pending = "";
71
- return out;
72
- }
73
- }
74
- /**
75
- * Match one SGR mouse event at `start` (which must be ESC):
76
- * `\x1b[<button;column;row(M|m)` — M = press/drag, m = release. Returns null
77
- * when the buffer ends mid-candidate; `{passthrough: true}` when what follows
78
- * is not a mouse event (arrow keys, other CSI, plain text) — only the ESC
79
- * itself is "consumed", the caller re-emits it verbatim.
80
- */
81
- function scanMouseEvent(s, start) {
82
- let i = start + 1;
83
- if (i >= s.length)
84
- return null; // can't tell yet — maybe "[…" next chunk
85
- if (s.charCodeAt(i) !== 0x5b /* [ */)
86
- return passthroughEsc();
87
- i++;
88
- if (i >= s.length)
89
- return null; // "[<" possible
90
- if (s.charCodeAt(i) !== 0x3c /* < */)
91
- return passthroughEsc();
92
- const paramsStart = i + 1;
93
- let finalIdx = -1;
94
- for (let k = paramsStart; k < s.length; k++) {
95
- const ch = s[k];
96
- if ((ch >= "0" && ch <= "9") || ch === ";")
97
- continue;
98
- if (ch === "M" || ch === "m") {
99
- finalIdx = k;
100
- break;
101
- }
102
- return passthroughEsc(); // some other CSI-x sequence, not ours
103
- }
104
- if (finalIdx === -1)
105
- return null; // still valid-looking but incomplete
106
- const params = s.slice(paramsStart, finalIdx).split(";");
107
- // Wheel buttons per xterm ctlseqs: 64 = wheel up, 65 = wheel down. Drag /
108
- // motion / release codes arrive too once ?1002h is armed — drop silently.
109
- const button = Number.parseInt(params[0] ?? "", 10);
110
- const dir = button === 64 ? "up" : button === 65 ? "down" : null;
111
- return { passthrough: false, dir, consumed: finalIdx + 1 - start };
112
- }
113
- function passthroughEsc() {
114
- return { passthrough: true, consumed: 1 };
115
- }
116
- /**
117
- * Take over process.stdin, strip mouse events, expose the cleaned stream for
118
- * ink. The fake stream forwards TTY identity and lifecycle calls (ink sets
119
- * raw mode, ref/unrefs it, and consumes via 'readable'+read()); keyboard data
120
- * flows through unchanged byte-for-byte.
121
- */
122
- export function createFilteredStdin(onWheel) {
123
- const real = process.stdin;
124
- // Chunks are utf8 strings downstream of us; decoding here keeps CJK and
125
- // escape bytes aligned across chunk boundaries.
126
- real.setEncoding("utf8");
127
- const filter = new MouseSequenceFilter(onWheel);
128
- const fake = new PassThrough();
129
- Object.defineProperty(fake, "isTTY", { value: real.isTTY });
130
- const proxy = fake;
131
- proxy.setRawMode = (mode) => {
132
- try {
133
- real.setRawMode(mode);
134
- }
135
- catch {
136
- // non-TTY stdin (tests): ink skips raw mode via isTTY anyway
137
- }
138
- };
139
- proxy.ref = () => {
140
- real.ref();
141
- };
142
- proxy.unref = () => {
143
- real.unref();
144
- };
145
- const onData = (chunk) => {
146
- const clean = filter.feed(chunk);
147
- if (clean.length > 0 && !fake.destroyed)
148
- fake.write(clean);
149
- };
150
- const endFake = () => {
151
- if (!fake.destroyed)
152
- fake.end();
153
- };
154
- real.on("data", onData);
155
- real.once("end", endFake);
156
- return {
157
- stream: fake,
158
- dispose() {
159
- real.off("data", onData);
160
- real.off("end", endFake);
161
- endFake();
162
- },
163
- };
164
- }
165
- //# sourceMappingURL=mouse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mouse.js","sourceRoot":"","sources":["../../src/repl/mouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,mEAAmE;AACnE,MAAM,CAAC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AAEhE,kEAAkE;AA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