mixdog 0.9.140 → 0.9.142

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 (42) hide show
  1. package/LICENSES/MIT.txt +4 -0
  2. package/NOTICE.md +12 -46
  3. package/package.json +1 -1
  4. package/scripts/manifest-cache-key.mjs +44 -0
  5. package/scripts/native-binary-arch.mjs +93 -0
  6. package/scripts/native-binary-arch.test.mjs +75 -0
  7. package/scripts/native-tool-download.mjs +118 -0
  8. package/src/runtime/agent/orchestrator/providers/gemini.mjs +1 -1
  9. package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +2 -2
  10. package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +2 -2
  11. package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +1 -1
  12. package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +1 -1
  13. package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +12 -12
  14. package/src/runtime/agent/orchestrator/session/compact/file-reattach.mjs +2 -2
  15. package/src/runtime/agent/orchestrator/session/compact/runner.mjs +1 -1
  16. package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +1 -1
  17. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +1 -1
  18. package/src/runtime/agent/orchestrator/tools/builtin/read-constants.mjs +2 -3
  19. package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +6 -7
  20. package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +2 -3
  21. package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +1 -1
  22. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +3 -3
  23. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +2 -2
  24. package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +2 -2
  25. package/src/runtime/agent/orchestrator/tools/shell-policy.mjs +1 -1
  26. package/src/runtime/channels/lib/parent-bridge.mjs +2 -2
  27. package/src/runtime/channels/lib/runtime-paths.mjs +1 -1
  28. package/src/standalone/agent-tool/shard-spread.mjs +5 -3
  29. package/src/standalone/agent-tool/shard-spread.test.mjs +16 -1
  30. package/src/tui/App.jsx +3 -3
  31. package/src/tui/app/transcript-window.mjs +4 -5
  32. package/src/tui/app/use-mouse-input.mjs +2 -2
  33. package/src/tui/app/use-transcript-scroll.mjs +37 -29
  34. package/src/tui/components/tool-output-format.mjs +2 -2
  35. package/src/tui/dist/index.mjs +21 -31
  36. package/src/tui/themes/teal.mjs +1 -1
  37. package/vendor/ink/build/ink.js +7 -85
  38. package/vendor/ink/build/output.js +7 -9
  39. package/vendor/ink/build/selection-rect.js +80 -0
  40. package/vendor/ink/build/termio-keypress.js +110 -79
  41. package/vendor/ink/build/_baseline-termio-keypress.js +0 -240
  42. package/vendor/ink/build/_baseline-termio-tokenize.js +0 -253
@@ -1,253 +0,0 @@
1
- /**
2
- * Input Tokenizer - Escape sequence boundary detection
3
- *
4
- * Terminal input tokenizer (+ ANSI / CSI
5
- * byte-range helpers) in plain ESM JS. Splits terminal input into tokens:
6
- * text chunks and raw escape sequences. Unlike a semantic parser this just
7
- * identifies boundaries for keyboard input parsing.
8
- *
9
- * Token shape: { type: 'text' | 'sequence', value: string }
10
- */
11
-
12
- // C0 control chars we care about.
13
- const C0 = { BEL: 0x07, ESC: 0x1b };
14
-
15
- // Byte after ESC selecting the sequence type.
16
- const ESC_TYPE = {
17
- CSI: 0x5b, // [
18
- OSC: 0x5d, // ]
19
- DCS: 0x50, // P
20
- APC: 0x5f, // _
21
- ST: 0x5c, // \
22
- };
23
-
24
- // ESC sequences have a wider final-byte range than CSI (0-9,:,;,<,=,>,?,@..~)
25
- const isEscFinal = (byte) => byte >= 0x30 && byte <= 0x7e;
26
- const isCSIParam = (byte) => byte >= 0x30 && byte <= 0x3f;
27
- const isCSIIntermediate = (byte) => byte >= 0x20 && byte <= 0x2f;
28
- const isCSIFinal = (byte) => byte >= 0x40 && byte <= 0x7e;
29
-
30
- /**
31
- * Create a streaming tokenizer for terminal input.
32
- *
33
- * options.x10Mouse: treat `CSI M` as an X10 mouse event prefix and consume 3
34
- * payload bytes. Only enable for stdin — `\x1b[M` is also CSI DL (Delete
35
- * Lines) in output streams. Default false.
36
- */
37
- export function createTokenizer(options) {
38
- let currentState = 'ground';
39
- let currentBuffer = '';
40
- const x10Mouse = options?.x10Mouse ?? false;
41
-
42
- return {
43
- feed(input) {
44
- const result = tokenize(input, currentState, currentBuffer, false, x10Mouse);
45
- currentState = result.state.state;
46
- currentBuffer = result.state.buffer;
47
- return result.tokens;
48
- },
49
- flush() {
50
- const result = tokenize('', currentState, currentBuffer, true, x10Mouse);
51
- currentState = result.state.state;
52
- currentBuffer = result.state.buffer;
53
- return result.tokens;
54
- },
55
- reset() {
56
- currentState = 'ground';
57
- currentBuffer = '';
58
- },
59
- buffer() {
60
- return currentBuffer;
61
- },
62
- };
63
- }
64
-
65
- function tokenize(input, initialState, initialBuffer, flush, x10Mouse) {
66
- const tokens = [];
67
- const result = { state: initialState, buffer: '' };
68
-
69
- const data = initialBuffer + input;
70
- let i = 0;
71
- let textStart = 0;
72
- let seqStart = 0;
73
-
74
- const flushText = () => {
75
- if (i > textStart) {
76
- const text = data.slice(textStart, i);
77
- if (text) tokens.push({ type: 'text', value: text });
78
- }
79
- textStart = i;
80
- };
81
-
82
- const emitSequence = (seq) => {
83
- if (seq) tokens.push({ type: 'sequence', value: seq });
84
- result.state = 'ground';
85
- textStart = i;
86
- };
87
-
88
- while (i < data.length) {
89
- const code = data.charCodeAt(i);
90
-
91
- switch (result.state) {
92
- case 'ground':
93
- if (code === C0.ESC) {
94
- flushText();
95
- seqStart = i;
96
- result.state = 'escape';
97
- i++;
98
- } else {
99
- i++;
100
- }
101
- break;
102
-
103
- case 'escape':
104
- if (code === ESC_TYPE.CSI) {
105
- result.state = 'csi';
106
- i++;
107
- } else if (code === ESC_TYPE.OSC) {
108
- result.state = 'osc';
109
- i++;
110
- } else if (code === ESC_TYPE.DCS) {
111
- result.state = 'dcs';
112
- i++;
113
- } else if (code === ESC_TYPE.APC) {
114
- result.state = 'apc';
115
- i++;
116
- } else if (code === 0x4f) {
117
- // 'O' - SS3
118
- result.state = 'ss3';
119
- i++;
120
- } else if (isCSIIntermediate(code)) {
121
- // Intermediate byte (e.g., ESC ( for charset) - continue buffering
122
- result.state = 'escapeIntermediate';
123
- i++;
124
- } else if (isEscFinal(code)) {
125
- // Two-character escape sequence
126
- i++;
127
- emitSequence(data.slice(seqStart, i));
128
- } else if (code === C0.ESC) {
129
- // Double escape - emit first, start new
130
- emitSequence(data.slice(seqStart, i));
131
- seqStart = i;
132
- result.state = 'escape';
133
- i++;
134
- } else {
135
- // Invalid - treat ESC as text
136
- result.state = 'ground';
137
- textStart = seqStart;
138
- }
139
- break;
140
-
141
- case 'escapeIntermediate':
142
- if (isCSIIntermediate(code)) {
143
- i++;
144
- } else if (isEscFinal(code)) {
145
- i++;
146
- emitSequence(data.slice(seqStart, i));
147
- } else {
148
- result.state = 'ground';
149
- textStart = seqStart;
150
- }
151
- break;
152
-
153
- case 'csi':
154
- // X10 mouse: CSI M + 3 raw payload bytes (Cb+32, Cx+32, Cy+32).
155
- // M immediately after [ (offset 2) means no params — SGR mouse
156
- // (CSI < … M) has a `<` param byte first and reaches M at offset > 2.
157
- // Terminals that ignore DECSET 1006 but honor 1000/1002 emit this
158
- // legacy encoding; without this branch the 3 payload bytes leak
159
- // through as text. Gated on x10Mouse — `\x1b[M` is also CSI DL and
160
- // blindly consuming 3 chars corrupts output. The >=0x20 check on each
161
- // payload slot is belt-and-suspenders: X10 guarantees Cb>=32, so a
162
- // control byte (ESC) in any slot means this is CSI DL / adjacent
163
- // PASTE_END, not a mouse event.
164
- if (
165
- x10Mouse &&
166
- code === 0x4d /* M */ &&
167
- i - seqStart === 2 &&
168
- (i + 1 >= data.length || data.charCodeAt(i + 1) >= 0x20) &&
169
- (i + 2 >= data.length || data.charCodeAt(i + 2) >= 0x20) &&
170
- (i + 3 >= data.length || data.charCodeAt(i + 3) >= 0x20)
171
- ) {
172
- if (i + 4 <= data.length) {
173
- i += 4;
174
- emitSequence(data.slice(seqStart, i));
175
- } else {
176
- // Incomplete — exit loop; end-of-input buffers from seqStart.
177
- i = data.length;
178
- }
179
- break;
180
- }
181
- if (isCSIFinal(code)) {
182
- i++;
183
- emitSequence(data.slice(seqStart, i));
184
- } else if (isCSIParam(code) || isCSIIntermediate(code)) {
185
- i++;
186
- } else {
187
- // Invalid CSI - abort, treat as text
188
- result.state = 'ground';
189
- textStart = seqStart;
190
- }
191
- break;
192
-
193
- case 'ss3':
194
- if (code >= 0x40 && code <= 0x7e) {
195
- i++;
196
- emitSequence(data.slice(seqStart, i));
197
- } else {
198
- result.state = 'ground';
199
- textStart = seqStart;
200
- }
201
- break;
202
-
203
- case 'osc':
204
- if (code === C0.BEL) {
205
- i++;
206
- emitSequence(data.slice(seqStart, i));
207
- } else if (
208
- code === C0.ESC &&
209
- i + 1 < data.length &&
210
- data.charCodeAt(i + 1) === ESC_TYPE.ST
211
- ) {
212
- i += 2;
213
- emitSequence(data.slice(seqStart, i));
214
- } else {
215
- i++;
216
- }
217
- break;
218
-
219
- case 'dcs':
220
- case 'apc':
221
- if (code === C0.BEL) {
222
- i++;
223
- emitSequence(data.slice(seqStart, i));
224
- } else if (
225
- code === C0.ESC &&
226
- i + 1 < data.length &&
227
- data.charCodeAt(i + 1) === ESC_TYPE.ST
228
- ) {
229
- i += 2;
230
- emitSequence(data.slice(seqStart, i));
231
- } else {
232
- i++;
233
- }
234
- break;
235
- }
236
- }
237
-
238
- if (result.state === 'ground') {
239
- flushText();
240
- } else if (flush) {
241
- const remaining = data.slice(seqStart);
242
- if (remaining) tokens.push({ type: 'sequence', value: remaining });
243
- result.state = 'ground';
244
- } else {
245
- result.buffer = data.slice(seqStart);
246
- }
247
-
248
- return { tokens, state: result };
249
- }
250
-
251
- // Bracketed paste markers (DEC mode 2004).
252
- export const PASTE_START = '\x1b[200~';
253
- export const PASTE_END = '\x1b[201~';