poly-weaver 0.5.0 → 0.6.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/dist/agents/implementors/handler.d.ts.map +1 -1
- package/dist/agents/implementors/handler.js +2 -1
- package/dist/agents/implementors/handler.js.map +1 -1
- package/dist/agents/planners/handler.d.ts.map +1 -1
- package/dist/agents/planners/handler.js +2 -1
- package/dist/agents/planners/handler.js.map +1 -1
- package/dist/agents/reviewers/handler.d.ts.map +1 -1
- package/dist/agents/reviewers/handler.js +9 -2
- package/dist/agents/reviewers/handler.js.map +1 -1
- package/dist/agents/runner.d.ts +40 -1
- package/dist/agents/runner.d.ts.map +1 -1
- package/dist/agents/runner.js +213 -14
- package/dist/agents/runner.js.map +1 -1
- package/dist/agents/simplifiers/handler.d.ts.map +1 -1
- package/dist/agents/simplifiers/handler.js +2 -1
- package/dist/agents/simplifiers/handler.js.map +1 -1
- package/dist/ansi.d.ts +26 -0
- package/dist/ansi.d.ts.map +1 -1
- package/dist/ansi.js +26 -0
- package/dist/ansi.js.map +1 -1
- package/dist/cli.js +46 -16
- package/dist/cli.js.map +1 -1
- package/dist/flow/built-in/default.js +1 -1
- package/dist/flow/built-in/default.js.map +1 -1
- package/dist/flow/built-in/default.ts +1 -1
- package/dist/flow/built-in/why-so-serious.js +1 -1
- package/dist/flow/built-in/why-so-serious.js.map +1 -1
- package/dist/flow/executor.d.ts.map +1 -1
- package/dist/flow/executor.js +7 -2
- package/dist/flow/executor.js.map +1 -1
- package/dist/flow/types.d.ts +5 -0
- package/dist/flow/types.d.ts.map +1 -1
- package/dist/flow/types.js.map +1 -1
- package/dist/orchestrator.d.ts +10 -4
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +34 -14
- package/dist/orchestrator.js.map +1 -1
- package/dist/providers/claude/session.d.ts +3 -1
- package/dist/providers/claude/session.d.ts.map +1 -1
- package/dist/providers/claude/session.js +10 -2
- package/dist/providers/claude/session.js.map +1 -1
- package/dist/providers/codex/session.d.ts +6 -3
- package/dist/providers/codex/session.d.ts.map +1 -1
- package/dist/providers/codex/session.js +24 -4
- package/dist/providers/codex/session.js.map +1 -1
- package/dist/providers/copilot/session.d.ts +3 -1
- package/dist/providers/copilot/session.d.ts.map +1 -1
- package/dist/providers/copilot/session.js +15 -2
- package/dist/providers/copilot/session.js.map +1 -1
- package/dist/providers/types.d.ts +14 -2
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js.map +1 -1
- package/dist/pty/exit.d.ts +13 -5
- package/dist/pty/exit.d.ts.map +1 -1
- package/dist/pty/exit.js +19 -19
- package/dist/pty/exit.js.map +1 -1
- package/dist/pty/spawn.d.ts +12 -6
- package/dist/pty/spawn.d.ts.map +1 -1
- package/dist/pty/spawn.js +22 -70
- package/dist/pty/spawn.js.map +1 -1
- package/dist/pty/types.d.ts +12 -3
- package/dist/pty/types.d.ts.map +1 -1
- package/dist/session/locator.d.ts +23 -2
- package/dist/session/locator.d.ts.map +1 -1
- package/dist/session/locator.js +67 -4
- package/dist/session/locator.js.map +1 -1
- package/dist/status-bar.d.ts +21 -1
- package/dist/status-bar.d.ts.map +1 -1
- package/dist/status-bar.js +109 -34
- package/dist/status-bar.js.map +1 -1
- package/dist/terminal/cleanup.d.ts +21 -0
- package/dist/terminal/cleanup.d.ts.map +1 -0
- package/dist/terminal/cleanup.js +22 -0
- package/dist/terminal/cleanup.js.map +1 -0
- package/dist/terminal/host.d.ts +244 -0
- package/dist/terminal/host.d.ts.map +1 -0
- package/dist/terminal/host.js +642 -0
- package/dist/terminal/host.js.map +1 -0
- package/dist/terminal/input-router.d.ts +146 -0
- package/dist/terminal/input-router.d.ts.map +1 -0
- package/dist/terminal/input-router.js +426 -0
- package/dist/terminal/input-router.js.map +1 -0
- package/dist/terminal/layout.d.ts +55 -0
- package/dist/terminal/layout.d.ts.map +1 -0
- package/dist/terminal/layout.js +51 -0
- package/dist/terminal/layout.js.map +1 -0
- package/dist/terminal/output.d.ts +83 -0
- package/dist/terminal/output.d.ts.map +1 -0
- package/dist/terminal/output.js +107 -0
- package/dist/terminal/output.js.map +1 -0
- package/dist/terminal/render.d.ts +36 -0
- package/dist/terminal/render.d.ts.map +1 -0
- package/dist/terminal/render.js +233 -0
- package/dist/terminal/render.js.map +1 -0
- package/dist/terminal/virtual-terminal.d.ts +54 -0
- package/dist/terminal/virtual-terminal.d.ts.map +1 -0
- package/dist/terminal/virtual-terminal.js +110 -0
- package/dist/terminal/virtual-terminal.js.map +1 -0
- package/dist/terminal-input.d.ts +10 -0
- package/dist/terminal-input.d.ts.map +1 -1
- package/dist/terminal-input.js +46 -0
- package/dist/terminal-input.js.map +1 -1
- package/dist/user/auto-curate-prompt.d.ts +17 -0
- package/dist/user/auto-curate-prompt.d.ts.map +1 -0
- package/dist/user/auto-curate-prompt.js +22 -0
- package/dist/user/auto-curate-prompt.js.map +1 -0
- package/dist/user/curate-handler.d.ts.map +1 -1
- package/dist/user/curate-handler.js +10 -2
- package/dist/user/curate-handler.js.map +1 -1
- package/dist/user/curate-prompt.d.ts +9 -7
- package/dist/user/curate-prompt.d.ts.map +1 -1
- package/dist/user/curate-prompt.js +2 -341
- package/dist/user/curate-prompt.js.map +1 -1
- package/dist/user/handler.d.ts +13 -1
- package/dist/user/handler.d.ts.map +1 -1
- package/dist/user/handler.js +27 -15
- package/dist/user/handler.js.map +1 -1
- package/dist/user/hard-wrap.d.ts +11 -0
- package/dist/user/hard-wrap.d.ts.map +1 -0
- package/dist/user/hard-wrap.js +44 -0
- package/dist/user/hard-wrap.js.map +1 -0
- package/dist/user/host-curate-prompt.d.ts +34 -0
- package/dist/user/host-curate-prompt.d.ts.map +1 -0
- package/dist/user/host-curate-prompt.js +453 -0
- package/dist/user/host-curate-prompt.js.map +1 -0
- package/dist/user/host-prompt.d.ts +21 -0
- package/dist/user/host-prompt.d.ts.map +1 -0
- package/dist/user/host-prompt.js +337 -0
- package/dist/user/host-prompt.js.map +1 -0
- package/dist/user/index.d.ts +3 -3
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +2 -2
- package/dist/user/index.js.map +1 -1
- package/dist/user/plan-pane.d.ts +18 -0
- package/dist/user/plan-pane.d.ts.map +1 -0
- package/dist/user/plan-pane.js +33 -0
- package/dist/user/plan-pane.js.map +1 -0
- package/dist/user/prompt.d.ts +25 -42
- package/dist/user/prompt.d.ts.map +1 -1
- package/dist/user/prompt.js +16 -278
- package/dist/user/prompt.js.map +1 -1
- package/dist/user/split-surface.d.ts +32 -0
- package/dist/user/split-surface.d.ts.map +1 -0
- package/dist/user/split-surface.js +66 -0
- package/dist/user/split-surface.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure layout computation for the orchestration terminal host.
|
|
3
|
+
*
|
|
4
|
+
* The host owns the real terminal during orchestration. The single
|
|
5
|
+
* source of truth for "how big is the child viewport", "where does the
|
|
6
|
+
* warning strip go", and "where does the status row go" is
|
|
7
|
+
* `computeTerminalLayout()`. PTY spawn, virtual-terminal sizing, child
|
|
8
|
+
* rendering, warning rendering, and status-bar rendering all read from
|
|
9
|
+
* the same layout object.
|
|
10
|
+
*
|
|
11
|
+
* Policy:
|
|
12
|
+
* - When status is enabled and rows >= 2, reserve exactly 1 status row.
|
|
13
|
+
* - When rows === 1, reserve 0 status rows; the child gets the only row.
|
|
14
|
+
* - When status is disabled (non-host or non-TTY), reserve 0 status rows.
|
|
15
|
+
* - `warningRows` is the host-owned warning strip immediately above the
|
|
16
|
+
* status row. It is clamped to 0..3 and capped further so the child
|
|
17
|
+
* viewport always keeps at least 1 row.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Compute the host layout. Pure: no side effects.
|
|
21
|
+
*
|
|
22
|
+
* - `columns` and `rows` are clamped to >= 1 even if the input is 0/negative.
|
|
23
|
+
* - `statusRows` is 1 only when `statusEnabled` AND `rows >= 2`.
|
|
24
|
+
* - `warningRows` is clamped to 0..3, then capped so `childRows >= 1`.
|
|
25
|
+
* - `childRows` is always >= 1.
|
|
26
|
+
* - `warningStartRow` is the first warning row (1-based) when `warningRows > 0`, else undefined.
|
|
27
|
+
* - `statusRow` is the 1-based bottom row when reserved, otherwise undefined.
|
|
28
|
+
*/
|
|
29
|
+
export function computeTerminalLayout(input) {
|
|
30
|
+
const columns = Math.max(1, Math.floor(input.columns));
|
|
31
|
+
const rows = Math.max(1, Math.floor(input.rows));
|
|
32
|
+
const statusRows = input.statusEnabled && rows >= 2 ? 1 : 0;
|
|
33
|
+
const requestedWarning = Math.max(0, Math.min(3, Math.floor(input.warningRows ?? 0)));
|
|
34
|
+
const availableForWarning = Math.max(0, rows - statusRows - 1);
|
|
35
|
+
const warningRows = Math.min(requestedWarning, availableForWarning);
|
|
36
|
+
const childCols = columns;
|
|
37
|
+
const childRows = Math.max(1, rows - statusRows - warningRows);
|
|
38
|
+
const warningStartRow = warningRows > 0 ? childRows + 1 : undefined;
|
|
39
|
+
const statusRow = statusRows === 1 ? rows : undefined;
|
|
40
|
+
return {
|
|
41
|
+
columns,
|
|
42
|
+
rows,
|
|
43
|
+
statusRows,
|
|
44
|
+
warningRows,
|
|
45
|
+
childCols,
|
|
46
|
+
childRows,
|
|
47
|
+
warningStartRow,
|
|
48
|
+
statusRow,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/terminal/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA6BH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAkB;IACtD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,MAAM,UAAU,GAAU,KAAK,CAAC,aAAa,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtF,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,UAAU,GAAG,WAAW,CAAC,CAAC;IAC/D,MAAM,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,MAAM,SAAS,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,OAAO;QACL,OAAO;QACP,IAAI;QACJ,UAAU;QACV,WAAW;QACX,SAAS;QACT,SAAS;QACT,eAAe;QACf,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent-owned orchestration output sink.
|
|
3
|
+
*
|
|
4
|
+
* While the orchestration host owns the alternate screen, code must not
|
|
5
|
+
* call `console.*`, `process.stdout.write`, or `process.stderr.write`
|
|
6
|
+
* for orchestration logs — direct writes shift the child viewport and
|
|
7
|
+
* overwrite the status row. Use this sink instead.
|
|
8
|
+
*
|
|
9
|
+
* Two implementations:
|
|
10
|
+
* - `ConsoleOrchestrationOutput` for non-host paths (non-TTY, programmatic
|
|
11
|
+
* callers, pre-orchestration CLI failures).
|
|
12
|
+
* - `BufferOrchestrationOutput` for host-backed orchestration. The host
|
|
13
|
+
* reads the buffer when it composes a frame and renders messages in
|
|
14
|
+
* the parent-owned region above the status bar.
|
|
15
|
+
*/
|
|
16
|
+
export type OrchestrationMessageKind = "phase" | "warn" | "error" | "append";
|
|
17
|
+
export interface OrchestrationMessage {
|
|
18
|
+
kind: OrchestrationMessageKind;
|
|
19
|
+
/** Phase label when kind === "phase". */
|
|
20
|
+
phase?: string;
|
|
21
|
+
/** Body text. May contain ANSI styling. */
|
|
22
|
+
text: string;
|
|
23
|
+
/** Monotonic timestamp for de-duplication and ordering. */
|
|
24
|
+
ts: number;
|
|
25
|
+
}
|
|
26
|
+
export interface OrchestrationOutput {
|
|
27
|
+
phase(phase: string, message: string): void;
|
|
28
|
+
warn(message: string): void;
|
|
29
|
+
error(message: string): void;
|
|
30
|
+
append(message: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Drop all buffered messages. The host-backed sink shrinks its warning
|
|
33
|
+
* strip on the next repaint; the console-backed sink is a no-op.
|
|
34
|
+
* Used by the executor to clear stale retry warnings on step boundaries.
|
|
35
|
+
*/
|
|
36
|
+
clear(): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Console-backed sink used outside the orchestration host (non-TTY,
|
|
40
|
+
* programmatic callers). Mirrors the legacy `logPhase()` formatting.
|
|
41
|
+
*/
|
|
42
|
+
export declare class ConsoleOrchestrationOutput implements OrchestrationOutput {
|
|
43
|
+
phase(phase: string, message: string): void;
|
|
44
|
+
warn(message: string): void;
|
|
45
|
+
error(message: string): void;
|
|
46
|
+
append(message: string): void;
|
|
47
|
+
clear(): void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Host-backed sink. Stores messages in memory and notifies the host so it
|
|
51
|
+
* can repaint. The host is responsible for clipping to its message area
|
|
52
|
+
* and dropping older messages when it runs out of room.
|
|
53
|
+
*/
|
|
54
|
+
export declare class BufferOrchestrationOutput implements OrchestrationOutput {
|
|
55
|
+
private readonly messages;
|
|
56
|
+
private readonly maxMessages;
|
|
57
|
+
private onChange?;
|
|
58
|
+
constructor(opts?: {
|
|
59
|
+
maxMessages?: number;
|
|
60
|
+
onChange?: () => void;
|
|
61
|
+
});
|
|
62
|
+
/** Set or replace the change-notification callback. */
|
|
63
|
+
setOnChange(cb: (() => void) | undefined): void;
|
|
64
|
+
phase(phase: string, message: string): void;
|
|
65
|
+
warn(message: string): void;
|
|
66
|
+
error(message: string): void;
|
|
67
|
+
append(message: string): void;
|
|
68
|
+
/** Snapshot of buffered messages, oldest first. */
|
|
69
|
+
snapshot(): readonly OrchestrationMessage[];
|
|
70
|
+
/**
|
|
71
|
+
* Drop all buffered messages. Fires `onChange` only when messages were
|
|
72
|
+
* actually removed, so the host can shrink its warning strip without
|
|
73
|
+
* paying a repaint when the buffer was already empty.
|
|
74
|
+
*/
|
|
75
|
+
clear(): void;
|
|
76
|
+
private push;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Format a single message for one-row rendering. Styling matches the legacy
|
|
80
|
+
* `logPhase()` output where possible.
|
|
81
|
+
*/
|
|
82
|
+
export declare function formatOrchestrationMessage(msg: OrchestrationMessage): string;
|
|
83
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/terminal/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,wBAAwB,CAAC;IA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AAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI7B,mDAAmD;IACnD,QAAQ,IAAI,SAAS,oBAAoB,EAAE;IAI3C;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAMb,OAAO,CAAC,IAAI;CAOb;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,oBAAoB,GAAG,MAAM,CAY5E"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent-owned orchestration output sink.
|
|
3
|
+
*
|
|
4
|
+
* While the orchestration host owns the alternate screen, code must not
|
|
5
|
+
* call `console.*`, `process.stdout.write`, or `process.stderr.write`
|
|
6
|
+
* for orchestration logs — direct writes shift the child viewport and
|
|
7
|
+
* overwrite the status row. Use this sink instead.
|
|
8
|
+
*
|
|
9
|
+
* Two implementations:
|
|
10
|
+
* - `ConsoleOrchestrationOutput` for non-host paths (non-TTY, programmatic
|
|
11
|
+
* callers, pre-orchestration CLI failures).
|
|
12
|
+
* - `BufferOrchestrationOutput` for host-backed orchestration. The host
|
|
13
|
+
* reads the buffer when it composes a frame and renders messages in
|
|
14
|
+
* the parent-owned region above the status bar.
|
|
15
|
+
*/
|
|
16
|
+
import { dim, reset, cyan, yellow, red } from "../ansi.js";
|
|
17
|
+
/**
|
|
18
|
+
* Console-backed sink used outside the orchestration host (non-TTY,
|
|
19
|
+
* programmatic callers). Mirrors the legacy `logPhase()` formatting.
|
|
20
|
+
*/
|
|
21
|
+
export class ConsoleOrchestrationOutput {
|
|
22
|
+
phase(phase, message) {
|
|
23
|
+
console.log(`\n${dim}[poly-weaver]${reset} ${cyan}${phase}${reset}: ${message}\n`);
|
|
24
|
+
}
|
|
25
|
+
warn(message) {
|
|
26
|
+
console.warn(`${yellow}[poly-weaver]${reset} ${message}`);
|
|
27
|
+
}
|
|
28
|
+
error(message) {
|
|
29
|
+
console.error(`${red}[poly-weaver]${reset} ${message}`);
|
|
30
|
+
}
|
|
31
|
+
append(message) {
|
|
32
|
+
console.log(message);
|
|
33
|
+
}
|
|
34
|
+
clear() {
|
|
35
|
+
// No-op for the console sink — there is no buffer to drop.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Host-backed sink. Stores messages in memory and notifies the host so it
|
|
40
|
+
* can repaint. The host is responsible for clipping to its message area
|
|
41
|
+
* and dropping older messages when it runs out of room.
|
|
42
|
+
*/
|
|
43
|
+
export class BufferOrchestrationOutput {
|
|
44
|
+
messages = [];
|
|
45
|
+
maxMessages;
|
|
46
|
+
onChange;
|
|
47
|
+
constructor(opts) {
|
|
48
|
+
this.maxMessages = opts?.maxMessages ?? 200;
|
|
49
|
+
this.onChange = opts?.onChange;
|
|
50
|
+
}
|
|
51
|
+
/** Set or replace the change-notification callback. */
|
|
52
|
+
setOnChange(cb) {
|
|
53
|
+
this.onChange = cb;
|
|
54
|
+
}
|
|
55
|
+
phase(phase, message) {
|
|
56
|
+
this.push({ kind: "phase", phase, text: message, ts: Date.now() });
|
|
57
|
+
}
|
|
58
|
+
warn(message) {
|
|
59
|
+
this.push({ kind: "warn", text: message, ts: Date.now() });
|
|
60
|
+
}
|
|
61
|
+
error(message) {
|
|
62
|
+
this.push({ kind: "error", text: message, ts: Date.now() });
|
|
63
|
+
}
|
|
64
|
+
append(message) {
|
|
65
|
+
this.push({ kind: "append", text: message, ts: Date.now() });
|
|
66
|
+
}
|
|
67
|
+
/** Snapshot of buffered messages, oldest first. */
|
|
68
|
+
snapshot() {
|
|
69
|
+
return this.messages;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Drop all buffered messages. Fires `onChange` only when messages were
|
|
73
|
+
* actually removed, so the host can shrink its warning strip without
|
|
74
|
+
* paying a repaint when the buffer was already empty.
|
|
75
|
+
*/
|
|
76
|
+
clear() {
|
|
77
|
+
if (this.messages.length === 0)
|
|
78
|
+
return;
|
|
79
|
+
this.messages.length = 0;
|
|
80
|
+
this.onChange?.();
|
|
81
|
+
}
|
|
82
|
+
push(msg) {
|
|
83
|
+
this.messages.push(msg);
|
|
84
|
+
if (this.messages.length > this.maxMessages) {
|
|
85
|
+
this.messages.splice(0, this.messages.length - this.maxMessages);
|
|
86
|
+
}
|
|
87
|
+
this.onChange?.();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Format a single message for one-row rendering. Styling matches the legacy
|
|
92
|
+
* `logPhase()` output where possible.
|
|
93
|
+
*/
|
|
94
|
+
export function formatOrchestrationMessage(msg) {
|
|
95
|
+
const tag = `${dim}[poly-weaver]${reset}`;
|
|
96
|
+
switch (msg.kind) {
|
|
97
|
+
case "phase":
|
|
98
|
+
return `${tag} ${cyan}${msg.phase ?? ""}${reset}: ${msg.text}`;
|
|
99
|
+
case "warn":
|
|
100
|
+
return `${tag} ${yellow}${msg.text}${reset}`;
|
|
101
|
+
case "error":
|
|
102
|
+
return `${tag} ${red}${msg.text}${reset}`;
|
|
103
|
+
case "append":
|
|
104
|
+
return msg.text;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/terminal/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA2BH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,0BAA0B;IACrC,KAAK,CAAC,KAAa,EAAE,OAAe;QAClC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,gBAAgB,KAAK,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK,KAAK,OAAO,IAAI,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,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,EAAE,CAAC;QAC/C,KAAK,OAAO;YACV,OAAO,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;QAC5C,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC,IAAI,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IBufferCell, IBufferLine } from "@xterm/headless";
|
|
2
|
+
import type { VirtualTerminal } from "./virtual-terminal.js";
|
|
3
|
+
import type { TerminalLayout } from "./layout.js";
|
|
4
|
+
/**
|
|
5
|
+
* Render a single child buffer line as ANSI, using `\x1b[K` to clear
|
|
6
|
+
* stale cells to the right.
|
|
7
|
+
*
|
|
8
|
+
* The returned string assumes the cursor is at column 1 of the target
|
|
9
|
+
* row when written to stdout.
|
|
10
|
+
*/
|
|
11
|
+
declare function renderLine(line: IBufferLine, cols: number, scratch: IBufferCell): string;
|
|
12
|
+
/**
|
|
13
|
+
* Render the child viewport into a single ANSI string.
|
|
14
|
+
*
|
|
15
|
+
* The string positions the cursor at home, paints `childRows` lines from
|
|
16
|
+
* the active buffer, and clears any rows below it that lie inside the
|
|
17
|
+
* non-status region. The status row (when reserved by the layout) is
|
|
18
|
+
* **not** touched here — the host paints it last, on top of this output.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderChildViewport(vt: VirtualTerminal, layout: TerminalLayout): string;
|
|
21
|
+
/**
|
|
22
|
+
* Render an in-band ANSI fragment that paints the status string at
|
|
23
|
+
* `layout.statusRow` with inverse video, padded/truncated to `columns`.
|
|
24
|
+
*
|
|
25
|
+
* Returns `""` if the layout does not reserve a status row.
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderStatusLine(layout: TerminalLayout, text: string): string;
|
|
28
|
+
declare function visibleLength(s: string): number;
|
|
29
|
+
declare function padOrClip(text: string, width: number): string;
|
|
30
|
+
export declare const __test: {
|
|
31
|
+
padOrClip: typeof padOrClip;
|
|
32
|
+
visibleLength: typeof visibleLength;
|
|
33
|
+
renderLine: typeof renderLine;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/terminal/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA6IlD;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAmCjF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,eAAe,EACnB,MAAM,EAAE,cAAc,GACrB,MAAM,CAkBR;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM,GACX,MAAM,CAYR;AAED,iBAAS,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxC;AAED,iBAAS,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBtD;AAED,eAAO,MAAM,MAAM;;;;CAA2C,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
const RESET = "\x1b[0m";
|
|
2
|
+
const CLEAR_LINE_RIGHT = "\x1b[K";
|
|
3
|
+
function defaultState() {
|
|
4
|
+
return {
|
|
5
|
+
bold: false,
|
|
6
|
+
dim: false,
|
|
7
|
+
italic: false,
|
|
8
|
+
underline: false,
|
|
9
|
+
blink: false,
|
|
10
|
+
inverse: false,
|
|
11
|
+
invisible: false,
|
|
12
|
+
strikethrough: false,
|
|
13
|
+
fgMode: "default",
|
|
14
|
+
fgValue: 0,
|
|
15
|
+
bgMode: "default",
|
|
16
|
+
bgValue: 0,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function readCellState(cell) {
|
|
20
|
+
const fgMode = cell.isFgRGB() ? "rgb" : cell.isFgPalette() ? "palette" : "default";
|
|
21
|
+
const bgMode = cell.isBgRGB() ? "rgb" : cell.isBgPalette() ? "palette" : "default";
|
|
22
|
+
return {
|
|
23
|
+
bold: cell.isBold() !== 0,
|
|
24
|
+
dim: cell.isDim() !== 0,
|
|
25
|
+
italic: cell.isItalic() !== 0,
|
|
26
|
+
underline: cell.isUnderline() !== 0,
|
|
27
|
+
blink: cell.isBlink() !== 0,
|
|
28
|
+
inverse: cell.isInverse() !== 0,
|
|
29
|
+
invisible: cell.isInvisible() !== 0,
|
|
30
|
+
strikethrough: cell.isStrikethrough() !== 0,
|
|
31
|
+
fgMode,
|
|
32
|
+
fgValue: cell.getFgColor(),
|
|
33
|
+
bgMode,
|
|
34
|
+
bgValue: cell.getBgColor(),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function sgrCodes(prev, next) {
|
|
38
|
+
// Cheap path: identical state — emit nothing.
|
|
39
|
+
if (prev.bold === next.bold &&
|
|
40
|
+
prev.dim === next.dim &&
|
|
41
|
+
prev.italic === next.italic &&
|
|
42
|
+
prev.underline === next.underline &&
|
|
43
|
+
prev.blink === next.blink &&
|
|
44
|
+
prev.inverse === next.inverse &&
|
|
45
|
+
prev.invisible === next.invisible &&
|
|
46
|
+
prev.strikethrough === next.strikethrough &&
|
|
47
|
+
prev.fgMode === next.fgMode &&
|
|
48
|
+
prev.fgValue === next.fgValue &&
|
|
49
|
+
prev.bgMode === next.bgMode &&
|
|
50
|
+
prev.bgValue === next.bgValue) {
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
// Any attribute that flipped from on to off forces a full reset, since
|
|
54
|
+
// there's no per-attribute "off" code that's universally portable
|
|
55
|
+
// (e.g. CSI 22 covers both bold and dim). Keep it correct over clever.
|
|
56
|
+
const turnedOff = (prev.bold && !next.bold) ||
|
|
57
|
+
(prev.dim && !next.dim) ||
|
|
58
|
+
(prev.italic && !next.italic) ||
|
|
59
|
+
(prev.underline && !next.underline) ||
|
|
60
|
+
(prev.blink && !next.blink) ||
|
|
61
|
+
(prev.inverse && !next.inverse) ||
|
|
62
|
+
(prev.invisible && !next.invisible) ||
|
|
63
|
+
(prev.strikethrough && !next.strikethrough) ||
|
|
64
|
+
(prev.fgMode !== "default" && next.fgMode === "default") ||
|
|
65
|
+
(prev.bgMode !== "default" && next.bgMode === "default");
|
|
66
|
+
const codes = [];
|
|
67
|
+
if (turnedOff) {
|
|
68
|
+
codes.push(0);
|
|
69
|
+
}
|
|
70
|
+
const baseline = turnedOff ? defaultState() : prev;
|
|
71
|
+
if (next.bold && !baseline.bold)
|
|
72
|
+
codes.push(1);
|
|
73
|
+
if (next.dim && !baseline.dim)
|
|
74
|
+
codes.push(2);
|
|
75
|
+
if (next.italic && !baseline.italic)
|
|
76
|
+
codes.push(3);
|
|
77
|
+
if (next.underline && !baseline.underline)
|
|
78
|
+
codes.push(4);
|
|
79
|
+
if (next.blink && !baseline.blink)
|
|
80
|
+
codes.push(5);
|
|
81
|
+
if (next.inverse && !baseline.inverse)
|
|
82
|
+
codes.push(7);
|
|
83
|
+
if (next.invisible && !baseline.invisible)
|
|
84
|
+
codes.push(8);
|
|
85
|
+
if (next.strikethrough && !baseline.strikethrough)
|
|
86
|
+
codes.push(9);
|
|
87
|
+
let out = "";
|
|
88
|
+
if (codes.length > 0) {
|
|
89
|
+
out += `\x1b[${codes.join(";")}m`;
|
|
90
|
+
}
|
|
91
|
+
if (next.fgMode !== baseline.fgMode ||
|
|
92
|
+
(next.fgMode !== "default" && next.fgValue !== baseline.fgValue)) {
|
|
93
|
+
if (next.fgMode === "palette") {
|
|
94
|
+
out += `\x1b[38;5;${next.fgValue}m`;
|
|
95
|
+
}
|
|
96
|
+
else if (next.fgMode === "rgb") {
|
|
97
|
+
const r = (next.fgValue >> 16) & 0xff;
|
|
98
|
+
const g = (next.fgValue >> 8) & 0xff;
|
|
99
|
+
const b = next.fgValue & 0xff;
|
|
100
|
+
out += `\x1b[38;2;${r};${g};${b}m`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (next.bgMode !== baseline.bgMode ||
|
|
104
|
+
(next.bgMode !== "default" && next.bgValue !== baseline.bgValue)) {
|
|
105
|
+
if (next.bgMode === "palette") {
|
|
106
|
+
out += `\x1b[48;5;${next.bgValue}m`;
|
|
107
|
+
}
|
|
108
|
+
else if (next.bgMode === "rgb") {
|
|
109
|
+
const r = (next.bgValue >> 16) & 0xff;
|
|
110
|
+
const g = (next.bgValue >> 8) & 0xff;
|
|
111
|
+
const b = next.bgValue & 0xff;
|
|
112
|
+
out += `\x1b[48;2;${r};${g};${b}m`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Render a single child buffer line as ANSI, using `\x1b[K` to clear
|
|
119
|
+
* stale cells to the right.
|
|
120
|
+
*
|
|
121
|
+
* The returned string assumes the cursor is at column 1 of the target
|
|
122
|
+
* row when written to stdout.
|
|
123
|
+
*/
|
|
124
|
+
function renderLine(line, cols, scratch) {
|
|
125
|
+
let out = "";
|
|
126
|
+
let state = defaultState();
|
|
127
|
+
let col = 0;
|
|
128
|
+
while (col < cols) {
|
|
129
|
+
const cell = line.getCell(col, scratch);
|
|
130
|
+
if (!cell) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
const width = cell.getWidth();
|
|
134
|
+
if (width === 0) {
|
|
135
|
+
// Trailing half of a wide character — skip; the cell with width 2
|
|
136
|
+
// already wrote the glyph that occupies this column.
|
|
137
|
+
col += 1;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const next = readCellState(cell);
|
|
141
|
+
const transition = sgrCodes(state, next);
|
|
142
|
+
if (transition) {
|
|
143
|
+
out += transition;
|
|
144
|
+
state = next;
|
|
145
|
+
}
|
|
146
|
+
const chars = cell.getChars() || " ";
|
|
147
|
+
out += chars;
|
|
148
|
+
col += width;
|
|
149
|
+
}
|
|
150
|
+
if (state.fgMode !== "default" || state.bgMode !== "default" ||
|
|
151
|
+
state.bold || state.dim || state.italic || state.underline ||
|
|
152
|
+
state.blink || state.inverse || state.invisible || state.strikethrough) {
|
|
153
|
+
out += RESET;
|
|
154
|
+
}
|
|
155
|
+
out += CLEAR_LINE_RIGHT;
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Render the child viewport into a single ANSI string.
|
|
160
|
+
*
|
|
161
|
+
* The string positions the cursor at home, paints `childRows` lines from
|
|
162
|
+
* the active buffer, and clears any rows below it that lie inside the
|
|
163
|
+
* non-status region. The status row (when reserved by the layout) is
|
|
164
|
+
* **not** touched here — the host paints it last, on top of this output.
|
|
165
|
+
*/
|
|
166
|
+
export function renderChildViewport(vt, layout) {
|
|
167
|
+
const buffer = vt.buffer;
|
|
168
|
+
const scratch = vt.newCell();
|
|
169
|
+
const top = buffer.viewportY;
|
|
170
|
+
const childRows = layout.childRows;
|
|
171
|
+
const cols = layout.childCols;
|
|
172
|
+
let out = "\x1b[H"; // home (row 1, col 1)
|
|
173
|
+
for (let row = 0; row < childRows; row++) {
|
|
174
|
+
const line = buffer.getLine(top + row);
|
|
175
|
+
out += `\x1b[${row + 1};1H`;
|
|
176
|
+
if (line) {
|
|
177
|
+
out += renderLine(line, cols, scratch);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
out += CLEAR_LINE_RIGHT;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return out;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Render an in-band ANSI fragment that paints the status string at
|
|
187
|
+
* `layout.statusRow` with inverse video, padded/truncated to `columns`.
|
|
188
|
+
*
|
|
189
|
+
* Returns `""` if the layout does not reserve a status row.
|
|
190
|
+
*/
|
|
191
|
+
export function renderStatusLine(layout, text) {
|
|
192
|
+
if (layout.statusRow === undefined) {
|
|
193
|
+
return "";
|
|
194
|
+
}
|
|
195
|
+
const padded = padOrClip(text, layout.columns);
|
|
196
|
+
return (`\x1b[${layout.statusRow};1H` +
|
|
197
|
+
`\x1b[2K` +
|
|
198
|
+
`\x1b[0m\x1b[7m` +
|
|
199
|
+
padded +
|
|
200
|
+
`\x1b[27m\x1b[0m`);
|
|
201
|
+
}
|
|
202
|
+
function visibleLength(s) {
|
|
203
|
+
// eslint-disable-next-line no-control-regex
|
|
204
|
+
return s.replace(/\x1b\[[0-9;]*m/g, "").length;
|
|
205
|
+
}
|
|
206
|
+
function padOrClip(text, width) {
|
|
207
|
+
const vis = visibleLength(text);
|
|
208
|
+
if (vis === width)
|
|
209
|
+
return text;
|
|
210
|
+
if (vis < width)
|
|
211
|
+
return text + " ".repeat(width - vis);
|
|
212
|
+
// Width exceeded: hard-clip on visible characters. Strips any trailing SGR
|
|
213
|
+
// truncation; the caller controls styling explicitly via render wrapping.
|
|
214
|
+
let out = "";
|
|
215
|
+
let count = 0;
|
|
216
|
+
let i = 0;
|
|
217
|
+
while (i < text.length && count < width) {
|
|
218
|
+
if (text[i] === "\x1b" && text[i + 1] === "[") {
|
|
219
|
+
const m = text.slice(i).match(/^\x1b\[[0-9;]*m/);
|
|
220
|
+
if (m) {
|
|
221
|
+
out += m[0];
|
|
222
|
+
i += m[0].length;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
out += text[i];
|
|
227
|
+
count += 1;
|
|
228
|
+
i += 1;
|
|
229
|
+
}
|
|
230
|
+
return out;
|
|
231
|
+
}
|
|
232
|
+
export const __test = { padOrClip, visibleLength, renderLine };
|
|
233
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/ter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,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjD,IAAI,CAAC,EAAE,CAAC;gBACN,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBACZ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBACjB,SAAS;YACX,CAAC;QACH,CAAC;QACD,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QACf,KAAK,IAAI,CAAC,CAAC;QACX,CAAC,IAAI,CAAC,CAAC;IACT,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { IBuffer, IBufferCell } from "@xterm/headless";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps `@xterm/headless` so the rest of the host doesn't need to
|
|
4
|
+
* know xterm-specific details. Owns:
|
|
5
|
+
*
|
|
6
|
+
* - Construction and disposal of the headless terminal.
|
|
7
|
+
* - Feeding raw PTY bytes into the parser via `write()`.
|
|
8
|
+
* - Resizing the terminal in lockstep with the host layout.
|
|
9
|
+
* - Buffer access for the renderer.
|
|
10
|
+
* - Host-managed scrollback viewport (the real terminal is in the host's
|
|
11
|
+
* alternate screen and no longer owns native scrollback).
|
|
12
|
+
*
|
|
13
|
+
* The wrapper keeps the API minimal — alternate-screen sequences
|
|
14
|
+
* are interpreted internally by xterm and never leak out.
|
|
15
|
+
*
|
|
16
|
+
* Scroll APIs use directional names (`scrollBack`, `scrollForward`) so
|
|
17
|
+
* callers do not depend on xterm's signed `scrollLines()` convention.
|
|
18
|
+
*/
|
|
19
|
+
export declare class VirtualTerminal {
|
|
20
|
+
private readonly term;
|
|
21
|
+
constructor(cols: number, rows: number);
|
|
22
|
+
write(data: string | Uint8Array, callback?: () => void): void;
|
|
23
|
+
resize(cols: number, rows: number): void;
|
|
24
|
+
get cols(): number;
|
|
25
|
+
get rows(): number;
|
|
26
|
+
/** Active buffer (normal or alternate, transparently). */
|
|
27
|
+
get buffer(): IBuffer;
|
|
28
|
+
/** Cursor X within the viewport (0-based). */
|
|
29
|
+
get cursorX(): number;
|
|
30
|
+
/** Cursor Y within the viewport (0-based). */
|
|
31
|
+
get cursorY(): number;
|
|
32
|
+
/** True when the alternate buffer is active. */
|
|
33
|
+
get isAlternate(): boolean;
|
|
34
|
+
/** Viewport top row index in scrollback coordinates. */
|
|
35
|
+
get viewportY(): number;
|
|
36
|
+
/** Buffer base Y — the row where the live tail begins. */
|
|
37
|
+
get baseY(): number;
|
|
38
|
+
/** True when the viewport is showing scrollback (older lines), not the tail. */
|
|
39
|
+
get isScrolledBack(): boolean;
|
|
40
|
+
/** Scroll the viewport back by `lines` (older content). */
|
|
41
|
+
scrollBack(lines: number): void;
|
|
42
|
+
/** Scroll the viewport forward by `lines` (newer content). */
|
|
43
|
+
scrollForward(lines: number): void;
|
|
44
|
+
/** Scroll by N pages. Positive = forward (newer), negative = back (older). */
|
|
45
|
+
scrollPages(pageCount: number): void;
|
|
46
|
+
/** Jump the viewport to the very top of scrollback. */
|
|
47
|
+
scrollToTop(): void;
|
|
48
|
+
/** Jump the viewport to the live tail (bottom). */
|
|
49
|
+
scrollToBottom(): void;
|
|
50
|
+
/** Reusable cell scratch object — avoids per-cell allocation in render hot path. */
|
|
51
|
+
newCell(): IBufferCell;
|
|
52
|
+
dispose(): void;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=virtual-terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-terminal.d.ts","sourceRoot":"","sources":["../../src/terminal/virtual-terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAA6B,MAAM,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