@airterm/protocol 0.4.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.
@@ -0,0 +1,116 @@
1
+ /**
2
+ * The private shell-integration marker schema.
3
+ *
4
+ * Markers ride the PTY byte stream inside OSC 633, namespaced under `AirTerm`
5
+ * because OSC 633 is also emitted by other shell integrations (VS Code and
6
+ * others). Only markers carrying the namespace are considered ours, and only
7
+ * markers carrying the PTY's integration token are authoritative.
8
+ *
9
+ * The parse and encode helpers live here so the shell scripts emitted by the
10
+ * CLI and the browser-side scanner cannot drift apart.
11
+ *
12
+ * Wire format, as the body following `OSC 633 ;`:
13
+ *
14
+ * AirTerm ; <version> ; <type> ; <commandId> ; <token> [ ; <payload> ]
15
+ *
16
+ * `payload` is always the remainder of the sequence, so a payload containing a
17
+ * separator survives round-tripping. Text payloads are escaped with
18
+ * {@link escapeMarkerText}.
19
+ */
20
+ /** OSC identifier carrying shell-integration markers. */
21
+ export declare const SHELL_INTEGRATION_OSC = 633;
22
+ /** Namespace token; markers without it belong to another integration. */
23
+ export declare const SHELL_INTEGRATION_NAMESPACE = "AirTerm";
24
+ /** Schema version. Bump only for incompatible field changes. */
25
+ export declare const SHELL_INTEGRATION_VERSION = 1;
26
+ /** Session feature literal negotiated through `SessionDescription.features`. */
27
+ export declare const SHELL_INTEGRATION_FEATURE = "shell-integration-v1";
28
+ /**
29
+ * Command id reserved for `ready`, which announces that hooks are installed and
30
+ * that command numbering restarts at 1.
31
+ */
32
+ export declare const SHELL_INTEGRATION_READY_COMMAND_ID = 0;
33
+ /** Highest command id a shell may use before it must re-announce `ready`. */
34
+ export declare const SHELL_INTEGRATION_COMMAND_ID_MAX = 4294967295;
35
+ /** Bounds enforced by the shell scripts at emit time and again while parsing. */
36
+ export declare const SHELL_INTEGRATION_LIMITS: {
37
+ /** Maximum length of a marker body, excluding the introducer and terminator. */
38
+ readonly markerBytes: 8192;
39
+ /** Maximum characters retained from a captured command line. */
40
+ readonly commandTextChars: 4096;
41
+ /** Maximum characters retained from a working directory. */
42
+ readonly cwdChars: 4096;
43
+ /** Maximum bytes buffered while a sequence is split across chunks. */
44
+ readonly pendingBytes: 8192;
45
+ };
46
+ /** Bytes in an integration token. */
47
+ export declare const SHELL_INTEGRATION_TOKEN_BYTES = 32;
48
+ /** Characters in an integration token (hex encoded). */
49
+ export declare const SHELL_INTEGRATION_TOKEN_CHARS: number;
50
+ export declare const SHELL_INTEGRATION_EVENT_TYPES: readonly ["ready", "prompt", "command", "execute", "finish", "cwd"];
51
+ export type ShellIntegrationEventType = (typeof SHELL_INTEGRATION_EVENT_TYPES)[number];
52
+ /**
53
+ * How much the captured command text can be trusted.
54
+ *
55
+ * - `submitted`: the shell reported the line the user submitted (zsh `preexec`).
56
+ * - `shell-fragment`: derived from a bash `DEBUG` trap, which reports pipeline
57
+ * elements, function bodies or expanded commands rather than the typed line.
58
+ * - `missing`: no text was captured for this command.
59
+ */
60
+ export type CommandTextQuality = 'submitted' | 'shell-fragment' | 'missing';
61
+ export declare const COMMAND_TEXT_QUALITIES: readonly CommandTextQuality[];
62
+ export type ShellIntegrationEvent = {
63
+ type: 'ready';
64
+ commandId: 0;
65
+ token: string;
66
+ } | {
67
+ type: 'prompt';
68
+ commandId: number;
69
+ token: string;
70
+ } | {
71
+ type: 'execute';
72
+ commandId: number;
73
+ token: string;
74
+ } | {
75
+ type: 'finish';
76
+ commandId: number;
77
+ token: string;
78
+ exitCode: number;
79
+ } | {
80
+ type: 'cwd';
81
+ commandId: number;
82
+ token: string;
83
+ cwd: string;
84
+ } | {
85
+ type: 'command';
86
+ commandId: number;
87
+ token: string;
88
+ commandText: string;
89
+ quality: CommandTextQuality;
90
+ };
91
+ /** Create a fresh per-PTY integration token. */
92
+ export declare function createIntegrationToken(random?: (target: Uint8Array) => void): string;
93
+ export declare function isIntegrationToken(value: string): boolean;
94
+ /**
95
+ * Escape text for a marker payload.
96
+ *
97
+ * Mirrors the escaping implemented by the shell scripts: backslashes and the
98
+ * separator are escaped, as is any control character so a multi-line command
99
+ * survives a single-line wire format.
100
+ */
101
+ export declare function escapeMarkerText(value: string): string;
102
+ /** Reverse {@link escapeMarkerText}; returns undefined for a malformed escape. */
103
+ export declare function unescapeMarkerText(value: string): string | undefined;
104
+ /** Encode the marker body, i.e. everything after `633;`. */
105
+ export declare function encodeShellIntegrationMarker(event: ShellIntegrationEvent): string;
106
+ /** Encode a complete OSC sequence, as written to the terminal. */
107
+ export declare function encodeShellIntegrationOsc(event: ShellIntegrationEvent): string;
108
+ /**
109
+ * Parse a marker body, i.e. the data an OSC handler receives after `633;`.
110
+ *
111
+ * Returns undefined rather than throwing for anything malformed or foreign,
112
+ * because this runs on every byte of terminal output.
113
+ */
114
+ export declare function parseShellIntegrationMarker(data: string): ShellIntegrationEvent | undefined;
115
+ export declare function isCommandTextQuality(value: string): value is CommandTextQuality;
116
+ //# sourceMappingURL=shellIntegration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellIntegration.d.ts","sourceRoot":"","sources":["../src/shellIntegration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,yEAAyE;AACzE,eAAO,MAAM,2BAA2B,YAAY,CAAC;AAErD,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,gFAAgF;AAChF,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,kCAAkC,IAAI,CAAC;AAEpD,6EAA6E;AAC7E,eAAO,MAAM,gCAAgC,aAAa,CAAC;AAE3D,iFAAiF;AACjF,eAAO,MAAM,wBAAwB;IACjC,gFAAgF;;IAEhF,gEAAgE;;IAEhE,4DAA4D;;IAE5D,sEAAsE;;CAEhE,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,w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,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmBtD;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAsCpE;AAED,4DAA4D;AAC5D,wBAAgB,4BAA4B,CACxC,KAAK,EAAE,qBAAqB,GAC7B,MAAM,CAkBR;AAED,kEAAkE;AAClE,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,qBAAqB,GAC7B,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACvC,IAAI,EAAE,MAAM,GACb,qBAAqB,GAAG,SAAS,CAwGnC;AAED,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,MAAM,GACd,KAAK,IAAI,kBAAkB,CAE7B"}
@@ -0,0 +1,243 @@
1
+ /**
2
+ * The private shell-integration marker schema.
3
+ *
4
+ * Markers ride the PTY byte stream inside OSC 633, namespaced under `AirTerm`
5
+ * because OSC 633 is also emitted by other shell integrations (VS Code and
6
+ * others). Only markers carrying the namespace are considered ours, and only
7
+ * markers carrying the PTY's integration token are authoritative.
8
+ *
9
+ * The parse and encode helpers live here so the shell scripts emitted by the
10
+ * CLI and the browser-side scanner cannot drift apart.
11
+ *
12
+ * Wire format, as the body following `OSC 633 ;`:
13
+ *
14
+ * AirTerm ; <version> ; <type> ; <commandId> ; <token> [ ; <payload> ]
15
+ *
16
+ * `payload` is always the remainder of the sequence, so a payload containing a
17
+ * separator survives round-tripping. Text payloads are escaped with
18
+ * {@link escapeMarkerText}.
19
+ */
20
+ /** OSC identifier carrying shell-integration markers. */
21
+ export const SHELL_INTEGRATION_OSC = 633;
22
+ /** Namespace token; markers without it belong to another integration. */
23
+ export const SHELL_INTEGRATION_NAMESPACE = 'AirTerm';
24
+ /** Schema version. Bump only for incompatible field changes. */
25
+ export const SHELL_INTEGRATION_VERSION = 1;
26
+ /** Session feature literal negotiated through `SessionDescription.features`. */
27
+ export const SHELL_INTEGRATION_FEATURE = 'shell-integration-v1';
28
+ /**
29
+ * Command id reserved for `ready`, which announces that hooks are installed and
30
+ * that command numbering restarts at 1.
31
+ */
32
+ export const SHELL_INTEGRATION_READY_COMMAND_ID = 0;
33
+ /** Highest command id a shell may use before it must re-announce `ready`. */
34
+ export const SHELL_INTEGRATION_COMMAND_ID_MAX = 0xffffffff;
35
+ /** Bounds enforced by the shell scripts at emit time and again while parsing. */
36
+ export const SHELL_INTEGRATION_LIMITS = {
37
+ /** Maximum length of a marker body, excluding the introducer and terminator. */
38
+ markerBytes: 8192,
39
+ /** Maximum characters retained from a captured command line. */
40
+ commandTextChars: 4096,
41
+ /** Maximum characters retained from a working directory. */
42
+ cwdChars: 4096,
43
+ /** Maximum bytes buffered while a sequence is split across chunks. */
44
+ pendingBytes: 8192,
45
+ };
46
+ /** Bytes in an integration token. */
47
+ export const SHELL_INTEGRATION_TOKEN_BYTES = 32;
48
+ /** Characters in an integration token (hex encoded). */
49
+ export const SHELL_INTEGRATION_TOKEN_CHARS = SHELL_INTEGRATION_TOKEN_BYTES * 2;
50
+ export const SHELL_INTEGRATION_EVENT_TYPES = [
51
+ 'ready',
52
+ 'prompt',
53
+ 'command',
54
+ 'execute',
55
+ 'finish',
56
+ 'cwd',
57
+ ];
58
+ export const COMMAND_TEXT_QUALITIES = [
59
+ 'submitted',
60
+ 'shell-fragment',
61
+ 'missing',
62
+ ];
63
+ /** Create a fresh per-PTY integration token. */
64
+ export function createIntegrationToken(random = (target) => crypto.getRandomValues(target)) {
65
+ const bytes = new Uint8Array(SHELL_INTEGRATION_TOKEN_BYTES);
66
+ random(bytes);
67
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');
68
+ }
69
+ export function isIntegrationToken(value) {
70
+ return /^[0-9a-f]{64}$/.test(value);
71
+ }
72
+ /**
73
+ * Escape text for a marker payload.
74
+ *
75
+ * Mirrors the escaping implemented by the shell scripts: backslashes and the
76
+ * separator are escaped, as is any control character so a multi-line command
77
+ * survives a single-line wire format.
78
+ */
79
+ export function escapeMarkerText(value) {
80
+ let escaped = '';
81
+ for (const char of value) {
82
+ if (char === '\\') {
83
+ escaped += '\\\\';
84
+ }
85
+ else if (char === ';') {
86
+ escaped += '\\x3b';
87
+ }
88
+ else {
89
+ const code = char.codePointAt(0) ?? 0;
90
+ escaped +=
91
+ code < 0x20 || code === 0x7f
92
+ ? `\\x${code.toString(16).padStart(2, '0')}`
93
+ : char;
94
+ }
95
+ }
96
+ return escaped;
97
+ }
98
+ /** Reverse {@link escapeMarkerText}; returns undefined for a malformed escape. */
99
+ export function unescapeMarkerText(value) {
100
+ let text = '';
101
+ for (let index = 0; index < value.length; index += 1) {
102
+ const char = value[index];
103
+ if (char !== '\\') {
104
+ text += char;
105
+ continue;
106
+ }
107
+ const next = value[index + 1];
108
+ if (next === '\\') {
109
+ text += '\\';
110
+ index += 1;
111
+ continue;
112
+ }
113
+ if (next === 'x' || next === 'X') {
114
+ const hex = value.slice(index + 2, index + 4);
115
+ if (!/^[0-9a-fA-F]{2}$/.test(hex)) {
116
+ return undefined;
117
+ }
118
+ text += String.fromCharCode(Number.parseInt(hex, 16));
119
+ index += 3;
120
+ continue;
121
+ }
122
+ return undefined;
123
+ }
124
+ return text;
125
+ }
126
+ /** Encode the marker body, i.e. everything after `633;`. */
127
+ export function encodeShellIntegrationMarker(event) {
128
+ const fields = [
129
+ SHELL_INTEGRATION_NAMESPACE,
130
+ String(SHELL_INTEGRATION_VERSION),
131
+ event.type,
132
+ String(event.commandId),
133
+ event.token,
134
+ ];
135
+ if (event.type === 'finish') {
136
+ fields.push(String(event.exitCode));
137
+ }
138
+ else if (event.type === 'cwd') {
139
+ fields.push(escapeMarkerText(event.cwd));
140
+ }
141
+ else if (event.type === 'command') {
142
+ fields.push(`${event.quality};${escapeMarkerText(event.commandText)}`);
143
+ }
144
+ return fields.join(';');
145
+ }
146
+ /** Encode a complete OSC sequence, as written to the terminal. */
147
+ export function encodeShellIntegrationOsc(event) {
148
+ return `\x1b]${SHELL_INTEGRATION_OSC};${encodeShellIntegrationMarker(event)}\x07`;
149
+ }
150
+ /**
151
+ * Parse a marker body, i.e. the data an OSC handler receives after `633;`.
152
+ *
153
+ * Returns undefined rather than throwing for anything malformed or foreign,
154
+ * because this runs on every byte of terminal output.
155
+ */
156
+ export function parseShellIntegrationMarker(data) {
157
+ if (data.length > SHELL_INTEGRATION_LIMITS.markerBytes) {
158
+ return undefined;
159
+ }
160
+ const fields = data.split(';');
161
+ if (fields.length < 5) {
162
+ return undefined;
163
+ }
164
+ if (fields[0] !== SHELL_INTEGRATION_NAMESPACE) {
165
+ return undefined;
166
+ }
167
+ if (fields[1] !== String(SHELL_INTEGRATION_VERSION)) {
168
+ return undefined;
169
+ }
170
+ const type = fields[2];
171
+ const commandId = parseCommandId(fields[3]);
172
+ const token = fields[4];
173
+ if (type === undefined ||
174
+ commandId === undefined ||
175
+ token === undefined ||
176
+ !isIntegrationToken(token)) {
177
+ return undefined;
178
+ }
179
+ const payload = fields.length > 5 ? fields.slice(5).join(';') : undefined;
180
+ if (type === 'ready') {
181
+ return commandId === SHELL_INTEGRATION_READY_COMMAND_ID &&
182
+ payload === undefined
183
+ ? { type: 'ready', commandId, token }
184
+ : undefined;
185
+ }
186
+ // Only `ready` may use the reserved id; every other event describes a command.
187
+ if (commandId === SHELL_INTEGRATION_READY_COMMAND_ID) {
188
+ return undefined;
189
+ }
190
+ if (type === 'prompt' || type === 'execute') {
191
+ // These carry no payload; an unexpected one means a malformed or
192
+ // impersonated marker, so refuse it rather than ignoring the extra data.
193
+ return payload === undefined ? { type, commandId, token } : undefined;
194
+ }
195
+ if (payload === undefined) {
196
+ return undefined;
197
+ }
198
+ if (type === 'finish') {
199
+ if (!/^-?\d{1,5}$/.test(payload)) {
200
+ return undefined;
201
+ }
202
+ return { type: 'finish', commandId, token, exitCode: Number(payload) };
203
+ }
204
+ if (type === 'cwd') {
205
+ const cwd = unescapeMarkerText(payload);
206
+ if (cwd === undefined ||
207
+ cwd.length === 0 ||
208
+ cwd.length > SHELL_INTEGRATION_LIMITS.cwdChars) {
209
+ return undefined;
210
+ }
211
+ return { type: 'cwd', commandId, token, cwd };
212
+ }
213
+ if (type === 'command') {
214
+ const separator = payload.indexOf(';');
215
+ if (separator === -1) {
216
+ return undefined;
217
+ }
218
+ const quality = payload.slice(0, separator);
219
+ if (!isCommandTextQuality(quality)) {
220
+ return undefined;
221
+ }
222
+ const commandText = unescapeMarkerText(payload.slice(separator + 1));
223
+ if (commandText === undefined ||
224
+ commandText.length > SHELL_INTEGRATION_LIMITS.commandTextChars) {
225
+ return undefined;
226
+ }
227
+ return { type: 'command', commandId, token, commandText, quality };
228
+ }
229
+ return undefined;
230
+ }
231
+ export function isCommandTextQuality(value) {
232
+ return COMMAND_TEXT_QUALITIES.includes(value);
233
+ }
234
+ function parseCommandId(value) {
235
+ if (value === undefined || !/^(0|[1-9]\d{0,9})$/.test(value)) {
236
+ return undefined;
237
+ }
238
+ const id = Number(value);
239
+ return Number.isSafeInteger(id) && id <= SHELL_INTEGRATION_COMMAND_ID_MAX
240
+ ? id
241
+ : undefined;
242
+ }
243
+ //# sourceMappingURL=shellIntegration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellIntegration.js","sourceRoot":"","sources":["../src/shellIntegration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,yEAAyE;AACzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC;AAErD,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC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4
  "description": "Shared browser and Node.js protocol implementation for AirTerm",
5
5
  "keywords": [
6
6
  "terminal",