agentlas 1.0.42 → 1.0.44

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 (70) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/engine/agentlas-workforce.cjs +1 -1
  3. package/engine/hephaestus/runtime.cjs +1 -1
  4. package/engine/storm/storm.cjs +1 -1
  5. package/engine/storm/swarm.cjs +1 -1
  6. package/engine/ui/palette.cjs +1 -0
  7. package/engine/ui/repl.cjs +34 -4
  8. package/engine/ui/shell.cjs +22 -3
  9. package/engine/vendor/mermaid/LICENSE +205 -0
  10. package/engine/vendor/mermaid/ansi.js +23 -0
  11. package/engine/vendor/mermaid/canvas.js +366 -0
  12. package/engine/vendor/mermaid/graph.js +91 -0
  13. package/engine/vendor/mermaid/index.js +100 -0
  14. package/engine/vendor/mermaid/labels.js +324 -0
  15. package/engine/vendor/mermaid/layout-seq.js +194 -0
  16. package/engine/vendor/mermaid/layout.js +881 -0
  17. package/engine/vendor/mermaid/package.json +1 -0
  18. package/engine/vendor/mermaid/parse.js +1108 -0
  19. package/engine/vendor/mermaid/source-box.js +78 -0
  20. package/engine/vendor/mermaid/types.js +1 -0
  21. package/engine/vendor/mermaid/width-data.js +994 -0
  22. package/engine/vendor/mermaid/width.js +76 -0
  23. package/engine/vendor/tui/LICENSE +20 -0
  24. package/engine/vendor/tui/autocomplete.js +632 -0
  25. package/engine/vendor/tui/components/alt-screen-flash.js +37 -0
  26. package/engine/vendor/tui/components/box.js +104 -0
  27. package/engine/vendor/tui/components/cancellable-loader.js +35 -0
  28. package/engine/vendor/tui/components/editor.js +1961 -0
  29. package/engine/vendor/tui/components/h-stack.js +43 -0
  30. package/engine/vendor/tui/components/image.js +90 -0
  31. package/engine/vendor/tui/components/input.js +378 -0
  32. package/engine/vendor/tui/components/loader.js +69 -0
  33. package/engine/vendor/tui/components/markdown.js +806 -0
  34. package/engine/vendor/tui/components/scroll-view.js +173 -0
  35. package/engine/vendor/tui/components/select-list.js +159 -0
  36. package/engine/vendor/tui/components/settings-list.js +182 -0
  37. package/engine/vendor/tui/components/spacer.js +23 -0
  38. package/engine/vendor/tui/components/stack.js +111 -0
  39. package/engine/vendor/tui/components/text.js +89 -0
  40. package/engine/vendor/tui/components/truncated-text.js +51 -0
  41. package/engine/vendor/tui/components/v-stack.js +26 -0
  42. package/engine/vendor/tui/deps/east-asian-width/LICENSE +9 -0
  43. package/engine/vendor/tui/deps/east-asian-width/index.js +30 -0
  44. package/engine/vendor/tui/deps/east-asian-width/lookup-data.js +21 -0
  45. package/engine/vendor/tui/deps/east-asian-width/lookup.js +138 -0
  46. package/engine/vendor/tui/deps/east-asian-width/utilities.js +24 -0
  47. package/engine/vendor/tui/deps/marked/LICENSE +44 -0
  48. package/engine/vendor/tui/deps/marked/index.js +77 -0
  49. package/engine/vendor/tui/editor-component.js +2 -0
  50. package/engine/vendor/tui/fuzzy.js +110 -0
  51. package/engine/vendor/tui/index.js +42 -0
  52. package/engine/vendor/tui/keybindings.js +209 -0
  53. package/engine/vendor/tui/keys.js +1174 -0
  54. package/engine/vendor/tui/kill-ring.js +44 -0
  55. package/engine/vendor/tui/latex.js +1264 -0
  56. package/engine/vendor/tui/layout-node.js +6 -0
  57. package/engine/vendor/tui/layout.js +314 -0
  58. package/engine/vendor/tui/native-modifiers.js +60 -0
  59. package/engine/vendor/tui/package.json +1 -0
  60. package/engine/vendor/tui/stdin-buffer.js +361 -0
  61. package/engine/vendor/tui/terminal-colors.js +59 -0
  62. package/engine/vendor/tui/terminal-image.js +518 -0
  63. package/engine/vendor/tui/terminal.js +436 -0
  64. package/engine/vendor/tui/tui-alt-screen.js +902 -0
  65. package/engine/vendor/tui/tui-main-screen.js +533 -0
  66. package/engine/vendor/tui/tui.js +937 -0
  67. package/engine/vendor/tui/undo-stack.js +25 -0
  68. package/engine/vendor/tui/utils.js +1191 -0
  69. package/engine/vendor/tui/word-navigation.js +96 -0
  70. package/package.json +2 -6
@@ -0,0 +1,436 @@
1
+ import * as fs from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import * as path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { setKittyProtocolActive } from "./keys.js";
6
+ import { isNativeModifierPressed } from "./native-modifiers.js";
7
+ import { StdinBuffer } from "./stdin-buffer.js";
8
+ const cjsRequire = createRequire(import.meta.url);
9
+ const TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;
10
+ const TERMINAL_PROGRESS_ACTIVE_SEQUENCE = "\x1b]9;4;3\x07";
11
+ const TERMINAL_PROGRESS_CLEAR_SEQUENCE = "\x1b]9;4;0\x07";
12
+ const NATIVE_SHIFT_ENTER_SEQUENCE = "\x1b[13;2u";
13
+ const DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;
14
+ const KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;
15
+ const KITTY_KEYBOARD_PROTOCOL_QUERY = `\x1b[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\x1b[?u\x1b[c`;
16
+ export function parseKeyboardProtocolNegotiationSequence(sequence) {
17
+ const kittyFlags = sequence.match(/^\x1b\[\?(\d+)u$/);
18
+ if (kittyFlags) {
19
+ return { type: "kitty-flags", flags: Number.parseInt(kittyFlags[1], 10) };
20
+ }
21
+ if (/^\x1b\[\?[\d;]*c$/.test(sequence)) {
22
+ return { type: "device-attributes" };
23
+ }
24
+ return undefined;
25
+ }
26
+ function isKeyboardProtocolNegotiationSequencePrefix(sequence) {
27
+ return sequence === "\x1b[" || /^\x1b\[\?[\d;]*$/.test(sequence);
28
+ }
29
+ export function isAppleTerminalSession() {
30
+ return process.platform === "darwin" && process.env.TERM_PROGRAM === "Apple_Terminal";
31
+ }
32
+ export function normalizeNativeShiftEnterInput(data, shouldDetectNativeShiftEnter, isShiftPressed) {
33
+ if (shouldDetectNativeShiftEnter && data === "\r" && isShiftPressed)
34
+ return NATIVE_SHIFT_ENTER_SEQUENCE;
35
+ return data;
36
+ }
37
+ export function normalizeAppleTerminalInput(data, isAppleTerminal, isShiftPressed) {
38
+ return normalizeNativeShiftEnterInput(data, isAppleTerminal, isShiftPressed);
39
+ }
40
+ /**
41
+ * Real terminal using process.stdin/stdout
42
+ */
43
+ export class ProcessTerminal {
44
+ wasRaw = false;
45
+ inputHandler;
46
+ resizeHandler;
47
+ _kittyProtocolActive = false;
48
+ _modifyOtherKeysActive = false;
49
+ keyboardProtocolPushed = false;
50
+ keyboardProtocolNegotiationBuffer = "";
51
+ keyboardProtocolBufferFlushTimer;
52
+ stdinBuffer;
53
+ stdinDataHandler;
54
+ progressInterval;
55
+ writeLogPath = (() => {
56
+ const env = process.env.PI_TUI_WRITE_LOG || "";
57
+ if (!env)
58
+ return "";
59
+ try {
60
+ if (fs.statSync(env).isDirectory()) {
61
+ const now = new Date();
62
+ const ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`;
63
+ return path.join(env, `tui-${ts}-${process.pid}.log`);
64
+ }
65
+ }
66
+ catch {
67
+ // Not an existing directory - use as-is (file path)
68
+ }
69
+ return env;
70
+ })();
71
+ get kittyProtocolActive() {
72
+ return this._kittyProtocolActive;
73
+ }
74
+ get modifyOtherKeysActive() {
75
+ return this._modifyOtherKeysActive;
76
+ }
77
+ start(onInput, onResize) {
78
+ this.inputHandler = onInput;
79
+ this.resizeHandler = onResize;
80
+ // Save previous state and enable raw mode
81
+ this.wasRaw = process.stdin.isRaw || false;
82
+ if (process.stdin.setRawMode) {
83
+ process.stdin.setRawMode(true);
84
+ }
85
+ process.stdin.setEncoding("utf8");
86
+ process.stdin.resume();
87
+ // Enable bracketed paste mode - terminal will wrap pastes in \x1b[200~ ... \x1b[201~
88
+ process.stdout.write("\x1b[?2004h");
89
+ // Set up resize handler immediately
90
+ process.stdout.on("resize", this.resizeHandler);
91
+ // Refresh terminal dimensions - they may be stale after suspend/resume
92
+ // (SIGWINCH is lost while process is stopped). Unix only.
93
+ if (process.platform !== "win32") {
94
+ process.kill(process.pid, "SIGWINCH");
95
+ }
96
+ // On Windows, enable ENABLE_VIRTUAL_TERMINAL_INPUT so the console sends
97
+ // VT escape sequences (e.g. \x1b[Z for Shift+Tab) instead of raw console
98
+ // events that lose modifier information. Must run AFTER setRawMode(true)
99
+ // since that resets console mode flags.
100
+ this.enableWindowsVTInput();
101
+ // Query Kitty keyboard protocol and fall back to modifyOtherKeys when DA confirms no Kitty response.
102
+ // See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
103
+ this.queryAndEnableKittyProtocol();
104
+ }
105
+ /**
106
+ * Set up StdinBuffer to split batched input into individual sequences.
107
+ * This ensures components receive single events, making matchesKey/isKeyRelease work correctly.
108
+ *
109
+ * Also watches for Kitty protocol response and enables it when detected.
110
+ * This is done here (after stdinBuffer parsing) rather than on raw stdin
111
+ * to handle the case where the response arrives split across multiple events.
112
+ */
113
+ setupStdinBuffer() {
114
+ this.stdinBuffer = new StdinBuffer({ timeout: 10 });
115
+ // Forward individual sequences to the input handler
116
+ this.stdinBuffer.on("data", (sequence) => {
117
+ const negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence);
118
+ if (negotiationSequence === "pending") {
119
+ this.scheduleKeyboardProtocolNegotiationBufferFlush();
120
+ return; // Wait briefly for the rest of a split Kitty response.
121
+ }
122
+ if (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {
123
+ return;
124
+ }
125
+ this.forwardInputSequence(sequence);
126
+ });
127
+ // Re-wrap paste content with bracketed paste markers for existing editor handling
128
+ this.stdinBuffer.on("paste", (content) => {
129
+ if (this.inputHandler) {
130
+ this.inputHandler(`\x1b[200~${content}\x1b[201~`);
131
+ }
132
+ });
133
+ // Handler that pipes stdin data through the buffer
134
+ this.stdinDataHandler = (data) => {
135
+ this.stdinBuffer.process(data);
136
+ };
137
+ }
138
+ /**
139
+ * Query terminal for Kitty keyboard protocol support and enable it if available.
140
+ *
141
+ * Kitty's progressive enhancement detection requires requesting the desired
142
+ * flags before querying them. The trailing DA query is a sentinel supported by
143
+ * terminals that do not know Kitty keyboard protocol; receiving DA before a
144
+ * Kitty response enables modifyOtherKeys fallback without a startup timeout.
145
+ *
146
+ * The requested flags are:
147
+ * - 1 = disambiguate escape codes
148
+ * - 2 = report event types (press/repeat/release)
149
+ * - 4 = report alternate keys (shifted key, base layout key)
150
+ */
151
+ queryAndEnableKittyProtocol() {
152
+ this.setupStdinBuffer();
153
+ process.stdin.on("data", this.stdinDataHandler);
154
+ this.keyboardProtocolPushed = true;
155
+ this.clearKeyboardProtocolNegotiationBuffer();
156
+ process.stdout.write(KITTY_KEYBOARD_PROTOCOL_QUERY);
157
+ }
158
+ handleKeyboardProtocolNegotiationSequence(negotiationSequence) {
159
+ if (!negotiationSequence)
160
+ return false;
161
+ this.clearKeyboardProtocolNegotiationBuffer();
162
+ if (negotiationSequence.type === "kitty-flags") {
163
+ if (negotiationSequence.flags !== 0) {
164
+ this.disableModifyOtherKeys();
165
+ if (!this._kittyProtocolActive) {
166
+ this._kittyProtocolActive = true;
167
+ setKittyProtocolActive(true);
168
+ }
169
+ }
170
+ else {
171
+ this.enableModifyOtherKeys();
172
+ }
173
+ return true;
174
+ }
175
+ if (!this._kittyProtocolActive) {
176
+ this.enableModifyOtherKeys();
177
+ }
178
+ return true;
179
+ }
180
+ readKeyboardProtocolNegotiationSequence(sequence) {
181
+ if (this.keyboardProtocolNegotiationBuffer) {
182
+ const bufferedSequence = this.keyboardProtocolNegotiationBuffer + sequence;
183
+ const negotiationSequence = parseKeyboardProtocolNegotiationSequence(bufferedSequence);
184
+ if (negotiationSequence) {
185
+ this.clearKeyboardProtocolNegotiationBuffer();
186
+ return negotiationSequence;
187
+ }
188
+ if (isKeyboardProtocolNegotiationSequencePrefix(bufferedSequence)) {
189
+ this.setKeyboardProtocolNegotiationBuffer(bufferedSequence);
190
+ return "pending";
191
+ }
192
+ this.flushKeyboardProtocolNegotiationBufferAsInput();
193
+ }
194
+ const negotiationSequence = parseKeyboardProtocolNegotiationSequence(sequence);
195
+ if (negotiationSequence)
196
+ return negotiationSequence;
197
+ if (isKeyboardProtocolNegotiationSequencePrefix(sequence)) {
198
+ this.setKeyboardProtocolNegotiationBuffer(sequence);
199
+ return "pending";
200
+ }
201
+ return undefined;
202
+ }
203
+ setKeyboardProtocolNegotiationBuffer(sequence) {
204
+ this.clearKeyboardProtocolNegotiationBufferFlushTimer();
205
+ this.keyboardProtocolNegotiationBuffer = sequence;
206
+ }
207
+ clearKeyboardProtocolNegotiationBuffer() {
208
+ this.clearKeyboardProtocolNegotiationBufferFlushTimer();
209
+ this.keyboardProtocolNegotiationBuffer = "";
210
+ }
211
+ flushKeyboardProtocolNegotiationBufferAsInput() {
212
+ if (!this.keyboardProtocolNegotiationBuffer)
213
+ return;
214
+ const sequence = this.keyboardProtocolNegotiationBuffer;
215
+ this.clearKeyboardProtocolNegotiationBuffer();
216
+ this.forwardInputSequence(sequence);
217
+ }
218
+ scheduleKeyboardProtocolNegotiationBufferFlush() {
219
+ if (!this.keyboardProtocolNegotiationBuffer || this.keyboardProtocolBufferFlushTimer)
220
+ return;
221
+ this.keyboardProtocolBufferFlushTimer = setTimeout(() => {
222
+ this.keyboardProtocolBufferFlushTimer = undefined;
223
+ this.flushKeyboardProtocolNegotiationBufferAsInput();
224
+ }, KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS);
225
+ }
226
+ clearKeyboardProtocolNegotiationBufferFlushTimer() {
227
+ if (!this.keyboardProtocolBufferFlushTimer)
228
+ return;
229
+ clearTimeout(this.keyboardProtocolBufferFlushTimer);
230
+ this.keyboardProtocolBufferFlushTimer = undefined;
231
+ }
232
+ forwardInputSequence(sequence) {
233
+ if (!this.inputHandler)
234
+ return;
235
+ const shouldDetectNativeShiftEnter = sequence === "\r" && (isAppleTerminalSession() || process.platform === "win32");
236
+ const input = normalizeNativeShiftEnterInput(sequence, shouldDetectNativeShiftEnter, shouldDetectNativeShiftEnter && isNativeModifierPressed("shift"));
237
+ this.inputHandler(input);
238
+ }
239
+ enableModifyOtherKeys() {
240
+ if (this._kittyProtocolActive || this._modifyOtherKeysActive)
241
+ return;
242
+ process.stdout.write("\x1b[>4;2m");
243
+ this._modifyOtherKeysActive = true;
244
+ }
245
+ disableModifyOtherKeys() {
246
+ if (!this._modifyOtherKeysActive)
247
+ return;
248
+ process.stdout.write("\x1b[>4;0m");
249
+ this._modifyOtherKeysActive = false;
250
+ }
251
+ /**
252
+ * On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin
253
+ * console handle so the terminal sends VT sequences for modified keys
254
+ * (e.g. \x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW
255
+ * discards modifier state and Shift+Tab arrives as plain \t.
256
+ */
257
+ enableWindowsVTInput() {
258
+ if (process.platform !== "win32")
259
+ return;
260
+ try {
261
+ const arch = process.arch;
262
+ if (arch !== "x64" && arch !== "arm64")
263
+ return;
264
+ // Dynamic require so non-Windows and bundled/browser paths never load the
265
+ // native helper. In the npm package native/ is next to dist/; in compiled
266
+ // binary archives native/ is copied next to the executable.
267
+ const moduleDir = path.dirname(fileURLToPath(import.meta.url));
268
+ const nativePath = path.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
269
+ const candidates = [
270
+ path.join(moduleDir, "..", nativePath),
271
+ path.join(moduleDir, nativePath),
272
+ path.join(path.dirname(process.execPath), nativePath),
273
+ ];
274
+ for (const modulePath of candidates) {
275
+ try {
276
+ const helper = cjsRequire(modulePath);
277
+ helper.enableVirtualTerminalInput?.();
278
+ return;
279
+ }
280
+ catch {
281
+ // Try the next possible packaging location.
282
+ }
283
+ }
284
+ }
285
+ catch {
286
+ // Native helper not available — Shift+Tab won't be distinguishable from Tab.
287
+ }
288
+ }
289
+ async drainInput(maxMs = 1000, idleMs = 50) {
290
+ const shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;
291
+ this.clearKeyboardProtocolNegotiationBuffer();
292
+ if (shouldDisableKittyProtocol) {
293
+ // Disable Kitty keyboard protocol first so any late key releases
294
+ // do not generate new Kitty escape sequences.
295
+ process.stdout.write("\x1b[<u");
296
+ this.keyboardProtocolPushed = false;
297
+ this._kittyProtocolActive = false;
298
+ setKittyProtocolActive(false);
299
+ }
300
+ this.disableModifyOtherKeys();
301
+ const previousHandler = this.inputHandler;
302
+ this.inputHandler = undefined;
303
+ let lastDataTime = Date.now();
304
+ const onData = () => {
305
+ lastDataTime = Date.now();
306
+ };
307
+ process.stdin.on("data", onData);
308
+ const endTime = Date.now() + maxMs;
309
+ try {
310
+ while (true) {
311
+ const now = Date.now();
312
+ const timeLeft = endTime - now;
313
+ if (timeLeft <= 0)
314
+ break;
315
+ if (now - lastDataTime >= idleMs)
316
+ break;
317
+ await new Promise((resolve) => setTimeout(resolve, Math.min(idleMs, timeLeft)));
318
+ }
319
+ }
320
+ finally {
321
+ process.stdin.removeListener("data", onData);
322
+ this.inputHandler = previousHandler;
323
+ }
324
+ }
325
+ stop() {
326
+ if (this.clearProgressInterval()) {
327
+ process.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);
328
+ }
329
+ // Disable bracketed paste mode
330
+ process.stdout.write("\x1b[?2004l");
331
+ const shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;
332
+ this.clearKeyboardProtocolNegotiationBuffer();
333
+ // Disable Kitty keyboard protocol if not already done by drainInput()
334
+ if (shouldDisableKittyProtocol) {
335
+ process.stdout.write("\x1b[<u");
336
+ this.keyboardProtocolPushed = false;
337
+ this._kittyProtocolActive = false;
338
+ setKittyProtocolActive(false);
339
+ }
340
+ this.disableModifyOtherKeys();
341
+ // Clean up StdinBuffer
342
+ if (this.stdinBuffer) {
343
+ this.stdinBuffer.destroy();
344
+ this.stdinBuffer = undefined;
345
+ }
346
+ // Remove event handlers
347
+ if (this.stdinDataHandler) {
348
+ process.stdin.removeListener("data", this.stdinDataHandler);
349
+ this.stdinDataHandler = undefined;
350
+ }
351
+ this.inputHandler = undefined;
352
+ if (this.resizeHandler) {
353
+ process.stdout.removeListener("resize", this.resizeHandler);
354
+ this.resizeHandler = undefined;
355
+ }
356
+ // Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being
357
+ // re-interpreted after raw mode is disabled. This fixes a race condition
358
+ // where Ctrl+D could close the parent shell over SSH.
359
+ process.stdin.pause();
360
+ // Restore raw mode state
361
+ if (process.stdin.setRawMode) {
362
+ process.stdin.setRawMode(this.wasRaw);
363
+ }
364
+ }
365
+ write(data) {
366
+ process.stdout.write(data);
367
+ if (this.writeLogPath) {
368
+ try {
369
+ fs.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
370
+ }
371
+ catch {
372
+ // Ignore logging errors
373
+ }
374
+ }
375
+ }
376
+ get columns() {
377
+ return process.stdout.columns || Number(process.env.COLUMNS) || 80;
378
+ }
379
+ get rows() {
380
+ return process.stdout.rows || Number(process.env.LINES) || 24;
381
+ }
382
+ moveBy(lines) {
383
+ if (lines > 0) {
384
+ // Move down
385
+ process.stdout.write(`\x1b[${lines}B`);
386
+ }
387
+ else if (lines < 0) {
388
+ // Move up
389
+ process.stdout.write(`\x1b[${-lines}A`);
390
+ }
391
+ // lines === 0: no movement
392
+ }
393
+ hideCursor() {
394
+ process.stdout.write("\x1b[?25l");
395
+ }
396
+ showCursor() {
397
+ process.stdout.write("\x1b[?25h");
398
+ }
399
+ clearLine() {
400
+ process.stdout.write("\x1b[K");
401
+ }
402
+ clearFromCursor() {
403
+ process.stdout.write("\x1b[J");
404
+ }
405
+ clearScreen() {
406
+ process.stdout.write("\x1b[2J\x1b[H"); // Clear screen and move to home (1,1)
407
+ }
408
+ setTitle(title) {
409
+ // OSC 0;title BEL - set terminal window title
410
+ process.stdout.write(`\x1b]0;${title}\x07`);
411
+ }
412
+ setProgress(active) {
413
+ if (active) {
414
+ // OSC 9;4;3 - indeterminate progress
415
+ process.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);
416
+ if (!this.progressInterval) {
417
+ this.progressInterval = setInterval(() => {
418
+ process.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);
419
+ }, TERMINAL_PROGRESS_KEEPALIVE_MS);
420
+ }
421
+ }
422
+ else {
423
+ this.clearProgressInterval();
424
+ // OSC 9;4;0 - clear progress
425
+ process.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);
426
+ }
427
+ }
428
+ clearProgressInterval() {
429
+ if (!this.progressInterval)
430
+ return false;
431
+ clearInterval(this.progressInterval);
432
+ this.progressInterval = undefined;
433
+ return true;
434
+ }
435
+ }
436
+ //# sourceMappingURL=terminal.js.map