@agentdocumentformat/cli 0.7.2
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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/adf.mjs +162 -0
- package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
- package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
- package/dist/chunks/App-L5L37JI5.mjs +16747 -0
- package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
- package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
- package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
- package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
- package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
- package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
- package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
- package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
- package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
- package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
- package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
- package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
- package/dist/chunks/build-QF5W473T.mjs +60 -0
- package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
- package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
- package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
- package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
- package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
- package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
- package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
- package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
- package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
- package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
- package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
- package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
- package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
- package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
- package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
- package/dist/chunks/chunk-776TSXEP.mjs +43 -0
- package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
- package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
- package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
- package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
- package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
- package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
- package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
- package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
- package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
- package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
- package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
- package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
- package/dist/chunks/chunk-G426FACA.mjs +49 -0
- package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
- package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
- package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
- package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
- package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
- package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
- package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
- package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
- package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
- package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
- package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
- package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
- package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
- package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
- package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
- package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
- package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
- package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
- package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
- package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
- package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
- package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
- package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
- package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
- package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
- package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
- package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
- package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
- package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
- package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
- package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
- package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
- package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
- package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
- package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
- package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
- package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
- package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
- package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
- package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
- package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
- package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
- package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
- package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
- package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
- package/dist/chunks/environment-NX277MQG.mjs +15 -0
- package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
- package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
- package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
- package/dist/chunks/open-OTQDGDH5.mjs +36 -0
- package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
- package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
- package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
- package/dist/chunks/screen-54BUTYCW.mjs +27 -0
- package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
- package/dist/chunks/store-WR7TZJZS.mjs +32 -0
- package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
- package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
- package/dist/chunks/theme-NORU4J74.mjs +20 -0
- package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
- package/dist/chunks/token-6G3HCMNX.mjs +54 -0
- package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
- package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
- package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
- package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
- package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
- package/package.json +53 -0
- package/resources/wasm/coreutils.LICENSE +18 -0
- package/resources/wasm/coreutils.wasm +0 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
APEv2Parser
|
|
9
|
+
} from "./chunk-NBTUWMGP.mjs";
|
|
10
|
+
import {
|
|
11
|
+
trimRightNull
|
|
12
|
+
} from "./chunk-XX7OSWTO.mjs";
|
|
13
|
+
import {
|
|
14
|
+
BasicParser,
|
|
15
|
+
StringType,
|
|
16
|
+
UINT8,
|
|
17
|
+
textDecode
|
|
18
|
+
} from "./chunk-I2HJYHFT.mjs";
|
|
19
|
+
import {
|
|
20
|
+
require_src
|
|
21
|
+
} from "./chunk-AUYKRQPJ.mjs";
|
|
22
|
+
import {
|
|
23
|
+
__toESM
|
|
24
|
+
} from "./chunk-M2RX3S2T.mjs";
|
|
25
|
+
|
|
26
|
+
// node_modules/music-metadata/lib/id3v1/ID3v1Parser.js
|
|
27
|
+
var import_debug = __toESM(require_src(), 1);
|
|
28
|
+
var debug = (0, import_debug.default)("music-metadata:parser:ID3v1"), Genres = [
|
|
29
|
+
"Blues",
|
|
30
|
+
"Classic Rock",
|
|
31
|
+
"Country",
|
|
32
|
+
"Dance",
|
|
33
|
+
"Disco",
|
|
34
|
+
"Funk",
|
|
35
|
+
"Grunge",
|
|
36
|
+
"Hip-Hop",
|
|
37
|
+
"Jazz",
|
|
38
|
+
"Metal",
|
|
39
|
+
"New Age",
|
|
40
|
+
"Oldies",
|
|
41
|
+
"Other",
|
|
42
|
+
"Pop",
|
|
43
|
+
"R&B",
|
|
44
|
+
"Rap",
|
|
45
|
+
"Reggae",
|
|
46
|
+
"Rock",
|
|
47
|
+
"Techno",
|
|
48
|
+
"Industrial",
|
|
49
|
+
"Alternative",
|
|
50
|
+
"Ska",
|
|
51
|
+
"Death Metal",
|
|
52
|
+
"Pranks",
|
|
53
|
+
"Soundtrack",
|
|
54
|
+
"Euro-Techno",
|
|
55
|
+
"Ambient",
|
|
56
|
+
"Trip-Hop",
|
|
57
|
+
"Vocal",
|
|
58
|
+
"Jazz+Funk",
|
|
59
|
+
"Fusion",
|
|
60
|
+
"Trance",
|
|
61
|
+
"Classical",
|
|
62
|
+
"Instrumental",
|
|
63
|
+
"Acid",
|
|
64
|
+
"House",
|
|
65
|
+
"Game",
|
|
66
|
+
"Sound Clip",
|
|
67
|
+
"Gospel",
|
|
68
|
+
"Noise",
|
|
69
|
+
"Alt. Rock",
|
|
70
|
+
"Bass",
|
|
71
|
+
"Soul",
|
|
72
|
+
"Punk",
|
|
73
|
+
"Space",
|
|
74
|
+
"Meditative",
|
|
75
|
+
"Instrumental Pop",
|
|
76
|
+
"Instrumental Rock",
|
|
77
|
+
"Ethnic",
|
|
78
|
+
"Gothic",
|
|
79
|
+
"Darkwave",
|
|
80
|
+
"Techno-Industrial",
|
|
81
|
+
"Electronic",
|
|
82
|
+
"Pop-Folk",
|
|
83
|
+
"Eurodance",
|
|
84
|
+
"Dream",
|
|
85
|
+
"Southern Rock",
|
|
86
|
+
"Comedy",
|
|
87
|
+
"Cult",
|
|
88
|
+
"Gangsta Rap",
|
|
89
|
+
"Top 40",
|
|
90
|
+
"Christian Rap",
|
|
91
|
+
"Pop/Funk",
|
|
92
|
+
"Jungle",
|
|
93
|
+
"Native American",
|
|
94
|
+
"Cabaret",
|
|
95
|
+
"New Wave",
|
|
96
|
+
"Psychedelic",
|
|
97
|
+
"Rave",
|
|
98
|
+
"Showtunes",
|
|
99
|
+
"Trailer",
|
|
100
|
+
"Lo-Fi",
|
|
101
|
+
"Tribal",
|
|
102
|
+
"Acid Punk",
|
|
103
|
+
"Acid Jazz",
|
|
104
|
+
"Polka",
|
|
105
|
+
"Retro",
|
|
106
|
+
"Musical",
|
|
107
|
+
"Rock & Roll",
|
|
108
|
+
"Hard Rock",
|
|
109
|
+
"Folk",
|
|
110
|
+
"Folk/Rock",
|
|
111
|
+
"National Folk",
|
|
112
|
+
"Swing",
|
|
113
|
+
"Fast-Fusion",
|
|
114
|
+
"Bebob",
|
|
115
|
+
"Latin",
|
|
116
|
+
"Revival",
|
|
117
|
+
"Celtic",
|
|
118
|
+
"Bluegrass",
|
|
119
|
+
"Avantgarde",
|
|
120
|
+
"Gothic Rock",
|
|
121
|
+
"Progressive Rock",
|
|
122
|
+
"Psychedelic Rock",
|
|
123
|
+
"Symphonic Rock",
|
|
124
|
+
"Slow Rock",
|
|
125
|
+
"Big Band",
|
|
126
|
+
"Chorus",
|
|
127
|
+
"Easy Listening",
|
|
128
|
+
"Acoustic",
|
|
129
|
+
"Humour",
|
|
130
|
+
"Speech",
|
|
131
|
+
"Chanson",
|
|
132
|
+
"Opera",
|
|
133
|
+
"Chamber Music",
|
|
134
|
+
"Sonata",
|
|
135
|
+
"Symphony",
|
|
136
|
+
"Booty Bass",
|
|
137
|
+
"Primus",
|
|
138
|
+
"Porn Groove",
|
|
139
|
+
"Satire",
|
|
140
|
+
"Slow Jam",
|
|
141
|
+
"Club",
|
|
142
|
+
"Tango",
|
|
143
|
+
"Samba",
|
|
144
|
+
"Folklore",
|
|
145
|
+
"Ballad",
|
|
146
|
+
"Power Ballad",
|
|
147
|
+
"Rhythmic Soul",
|
|
148
|
+
"Freestyle",
|
|
149
|
+
"Duet",
|
|
150
|
+
"Punk Rock",
|
|
151
|
+
"Drum Solo",
|
|
152
|
+
"A Cappella",
|
|
153
|
+
"Euro-House",
|
|
154
|
+
"Dance Hall",
|
|
155
|
+
"Goa",
|
|
156
|
+
"Drum & Bass",
|
|
157
|
+
"Club-House",
|
|
158
|
+
"Hardcore",
|
|
159
|
+
"Terror",
|
|
160
|
+
"Indie",
|
|
161
|
+
"BritPop",
|
|
162
|
+
"Negerpunk",
|
|
163
|
+
"Polsk Punk",
|
|
164
|
+
"Beat",
|
|
165
|
+
"Christian Gangsta Rap",
|
|
166
|
+
"Heavy Metal",
|
|
167
|
+
"Black Metal",
|
|
168
|
+
"Crossover",
|
|
169
|
+
"Contemporary Christian",
|
|
170
|
+
"Christian Rock",
|
|
171
|
+
"Merengue",
|
|
172
|
+
"Salsa",
|
|
173
|
+
"Thrash Metal",
|
|
174
|
+
"Anime",
|
|
175
|
+
"JPop",
|
|
176
|
+
"Synthpop",
|
|
177
|
+
"Abstract",
|
|
178
|
+
"Art Rock",
|
|
179
|
+
"Baroque",
|
|
180
|
+
"Bhangra",
|
|
181
|
+
"Big Beat",
|
|
182
|
+
"Breakbeat",
|
|
183
|
+
"Chillout",
|
|
184
|
+
"Downtempo",
|
|
185
|
+
"Dub",
|
|
186
|
+
"EBM",
|
|
187
|
+
"Eclectic",
|
|
188
|
+
"Electro",
|
|
189
|
+
"Electroclash",
|
|
190
|
+
"Emo",
|
|
191
|
+
"Experimental",
|
|
192
|
+
"Garage",
|
|
193
|
+
"Global",
|
|
194
|
+
"IDM",
|
|
195
|
+
"Illbient",
|
|
196
|
+
"Industro-Goth",
|
|
197
|
+
"Jam Band",
|
|
198
|
+
"Krautrock",
|
|
199
|
+
"Leftfield",
|
|
200
|
+
"Lounge",
|
|
201
|
+
"Math Rock",
|
|
202
|
+
"New Romantic",
|
|
203
|
+
"Nu-Breakz",
|
|
204
|
+
"Post-Punk",
|
|
205
|
+
"Post-Rock",
|
|
206
|
+
"Psytrance",
|
|
207
|
+
"Shoegaze",
|
|
208
|
+
"Space Rock",
|
|
209
|
+
"Trop Rock",
|
|
210
|
+
"World Music",
|
|
211
|
+
"Neoclassical",
|
|
212
|
+
"Audiobook",
|
|
213
|
+
"Audio Theatre",
|
|
214
|
+
"Neue Deutsche Welle",
|
|
215
|
+
"Podcast",
|
|
216
|
+
"Indie Rock",
|
|
217
|
+
"G-Funk",
|
|
218
|
+
"Dubstep",
|
|
219
|
+
"Garage Rock",
|
|
220
|
+
"Psybient"
|
|
221
|
+
], Iid3v1Token = {
|
|
222
|
+
len: 128,
|
|
223
|
+
/**
|
|
224
|
+
* @param buf Buffer possibly holding the 128 bytes ID3v1.1 metadata header
|
|
225
|
+
* @param off Offset in buffer in bytes
|
|
226
|
+
* @returns ID3v1.1 header if first 3 bytes equals 'TAG', otherwise null is returned
|
|
227
|
+
*/
|
|
228
|
+
get: (buf, off) => {
|
|
229
|
+
let header = new Id3v1StringType(3).get(buf, off);
|
|
230
|
+
return header === "TAG" ? {
|
|
231
|
+
header,
|
|
232
|
+
title: new Id3v1StringType(30).get(buf, off + 3),
|
|
233
|
+
artist: new Id3v1StringType(30).get(buf, off + 33),
|
|
234
|
+
album: new Id3v1StringType(30).get(buf, off + 63),
|
|
235
|
+
year: new Id3v1StringType(4).get(buf, off + 93),
|
|
236
|
+
comment: new Id3v1StringType(28).get(buf, off + 97),
|
|
237
|
+
// ID3v1.1 separator for track
|
|
238
|
+
zeroByte: UINT8.get(buf, off + 127),
|
|
239
|
+
// track: ID3v1.1 field added by Michael Mutschler
|
|
240
|
+
track: UINT8.get(buf, off + 126),
|
|
241
|
+
genre: UINT8.get(buf, off + 127)
|
|
242
|
+
} : null;
|
|
243
|
+
}
|
|
244
|
+
}, Id3v1StringType = class {
|
|
245
|
+
constructor(len) {
|
|
246
|
+
this.len = len, this.stringType = new StringType(len, "latin1");
|
|
247
|
+
}
|
|
248
|
+
get(buf, off) {
|
|
249
|
+
let value = this.stringType.get(buf, off);
|
|
250
|
+
return value = trimRightNull(value), value = value.trim(), value.length > 0 ? value : void 0;
|
|
251
|
+
}
|
|
252
|
+
}, ID3v1Parser = class _ID3v1Parser extends BasicParser {
|
|
253
|
+
constructor(metadata, tokenizer, options) {
|
|
254
|
+
super(metadata, tokenizer, options), this.apeHeader = options.apeHeader;
|
|
255
|
+
}
|
|
256
|
+
static getGenre(genreIndex) {
|
|
257
|
+
if (genreIndex < Genres.length)
|
|
258
|
+
return Genres[genreIndex];
|
|
259
|
+
}
|
|
260
|
+
async parse() {
|
|
261
|
+
if (!this.tokenizer.fileInfo.size) {
|
|
262
|
+
debug("Skip checking for ID3v1 because the file-size is unknown");
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.apeHeader && this.tokenizer.supportsRandomAccess() && (this.tokenizer.setPosition(this.apeHeader.offset), await new APEv2Parser(this.metadata, this.tokenizer, this.options).parseTags(this.apeHeader.footer));
|
|
266
|
+
let offset = this.tokenizer.fileInfo.size - Iid3v1Token.len;
|
|
267
|
+
if (this.tokenizer.position > offset) {
|
|
268
|
+
debug("Already consumed the last 128 bytes");
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
let header = await this.tokenizer.readToken(Iid3v1Token, offset);
|
|
272
|
+
if (header) {
|
|
273
|
+
debug("ID3v1 header found at: pos=%s", this.tokenizer.fileInfo.size - Iid3v1Token.len);
|
|
274
|
+
let props = ["title", "artist", "album", "comment", "track", "year"];
|
|
275
|
+
for (let id of props)
|
|
276
|
+
header[id] && header[id] !== "" && await this.addTag(id, header[id]);
|
|
277
|
+
let genre = _ID3v1Parser.getGenre(header.genre);
|
|
278
|
+
genre && await this.addTag("genre", genre);
|
|
279
|
+
} else
|
|
280
|
+
debug("ID3v1 header not found at: pos=%s", this.tokenizer.fileInfo.size - Iid3v1Token.len);
|
|
281
|
+
}
|
|
282
|
+
async addTag(id, value) {
|
|
283
|
+
await this.metadata.addTag("ID3v1", id, value);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
async function hasID3v1Header(tokenizer) {
|
|
287
|
+
if (tokenizer.fileInfo.size >= 128) {
|
|
288
|
+
let tag = new Uint8Array(3), position = tokenizer.position;
|
|
289
|
+
return await tokenizer.readBuffer(tag, { position: tokenizer.fileInfo.size - 128 }), tokenizer.setPosition(position), textDecode(tag, "latin1") === "TAG";
|
|
290
|
+
}
|
|
291
|
+
return !1;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export {
|
|
295
|
+
Genres,
|
|
296
|
+
ID3v1Parser,
|
|
297
|
+
hasID3v1Header
|
|
298
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
__export
|
|
9
|
+
} from "./chunk-M2RX3S2T.mjs";
|
|
10
|
+
|
|
11
|
+
// src/shared/utils/mcp-config.ts
|
|
12
|
+
var mcp_config_exports = {};
|
|
13
|
+
__export(mcp_config_exports, {
|
|
14
|
+
MCP_EXECUTABLE_IDENTITY_FIELDS: () => MCP_EXECUTABLE_IDENTITY_FIELDS,
|
|
15
|
+
buildEnvSchemaFromKeys: () => buildEnvSchemaFromKeys,
|
|
16
|
+
buildHeaderEnvSchemaFromEntries: () => buildHeaderEnvSchemaFromEntries,
|
|
17
|
+
buildMcpServerConfigFromRegistration: () => buildMcpServerConfigFromRegistration,
|
|
18
|
+
deriveRegistrationTestPlan: () => deriveRegistrationTestPlan,
|
|
19
|
+
getMcpRegistrationEnvKeys: () => getMcpRegistrationEnvKeys,
|
|
20
|
+
isRegistrationAgentVisible: () => isRegistrationAgentVisible,
|
|
21
|
+
isSensitiveMcpHeader: () => isSensitiveMcpHeader,
|
|
22
|
+
mcpCredentialNamespace: () => mcpCredentialNamespace,
|
|
23
|
+
mcpCredentialRef: () => mcpCredentialRef,
|
|
24
|
+
pinServerConfigToRegistration: () => pinServerConfigToRegistration,
|
|
25
|
+
reconcileHostApprovedRegistrations: () => reconcileHostApprovedRegistrations,
|
|
26
|
+
registrationSourceIdentity: () => registrationSourceIdentity,
|
|
27
|
+
sameExecutableIdentity: () => sameExecutableIdentity,
|
|
28
|
+
suggestedAgentVisible: () => suggestedAgentVisible
|
|
29
|
+
});
|
|
30
|
+
function sourcePackage(source) {
|
|
31
|
+
let s = source;
|
|
32
|
+
return s.npm_package ?? s.npmPackage ?? s.pypi_package ?? s.pypiPackage;
|
|
33
|
+
}
|
|
34
|
+
function mcpCredentialNamespace(source) {
|
|
35
|
+
return sourcePackage(source) ?? source.name;
|
|
36
|
+
}
|
|
37
|
+
function mcpCredentialRef(source, key) {
|
|
38
|
+
return `mcp:${mcpCredentialNamespace(source)}:${key}`;
|
|
39
|
+
}
|
|
40
|
+
function isSensitiveMcpHeader(header) {
|
|
41
|
+
let normalized = header.trim().toLowerCase();
|
|
42
|
+
return normalized === "authorization" || normalized === "proxy-authorization" || normalized === "x-api-key" || normalized === "api-key" || normalized === "apikey" || normalized === "x-auth-token" || normalized === "x-access-token" || normalized.includes("token") || normalized.includes("secret") || normalized.includes("credential");
|
|
43
|
+
}
|
|
44
|
+
function buildEnvSchemaFromKeys(source, keys, scope, requiredKeys = keys) {
|
|
45
|
+
let required = new Set(requiredKeys);
|
|
46
|
+
return [...new Set(keys.filter(Boolean))].map((key) => ({
|
|
47
|
+
key,
|
|
48
|
+
scope,
|
|
49
|
+
required: required.has(key) || void 0,
|
|
50
|
+
credential_ref: scope === "app" ? mcpCredentialRef(source, key) : void 0
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
function buildHeaderEnvSchemaFromEntries(source, entries, appScoped = !0) {
|
|
54
|
+
return entries.filter((entry) => entry.header && entry.env).map((entry) => ({
|
|
55
|
+
header: entry.header,
|
|
56
|
+
env: entry.env,
|
|
57
|
+
required: !0,
|
|
58
|
+
credential_ref: appScoped ? mcpCredentialRef(source, entry.env) : void 0
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
function getMcpRegistrationEnvKeys(registration) {
|
|
62
|
+
return [.../* @__PURE__ */ new Set([
|
|
63
|
+
...(registration.env ?? []).map((entry) => entry.key).filter(Boolean),
|
|
64
|
+
...registration.bearerTokenEnvVar ? [registration.bearerTokenEnvVar] : [],
|
|
65
|
+
...(registration.headerEnv ?? []).map((entry) => entry.value).filter(Boolean)
|
|
66
|
+
])];
|
|
67
|
+
}
|
|
68
|
+
function buildMcpServerConfigFromRegistration(registration) {
|
|
69
|
+
let isHttp = registration.type === "http" || !!registration.url, serverCfg = {
|
|
70
|
+
name: registration.name,
|
|
71
|
+
transport: isHttp ? "http" : "stdio"
|
|
72
|
+
};
|
|
73
|
+
if (isHttp) {
|
|
74
|
+
serverCfg.url = registration.url, serverCfg.source = registration.url ? `http:${registration.url}` : "http";
|
|
75
|
+
let staticHeaders = {};
|
|
76
|
+
for (let { key, value } of registration.headers ?? [])
|
|
77
|
+
key && value && !isSensitiveMcpHeader(key) && (staticHeaders[key] = value);
|
|
78
|
+
Object.keys(staticHeaders).length && (serverCfg.headers = staticHeaders), registration.headerEnv?.length && (serverCfg.header_env = buildHeaderEnvSchemaFromEntries(
|
|
79
|
+
registration,
|
|
80
|
+
registration.headerEnv.map(({ key, value }) => ({ header: key, env: value })),
|
|
81
|
+
(registration.credentialStorage ?? "app") !== "agent"
|
|
82
|
+
)), registration.oauth ? serverCfg.oauth = !0 : registration.bearerTokenEnvVar && (serverCfg.bearer_token_env_var = registration.bearerTokenEnvVar);
|
|
83
|
+
} else registration.npmPackage ? (serverCfg.source = `npm:${registration.npmPackage}`, serverCfg.npm_package = registration.npmPackage) : registration.pypiPackage ? (serverCfg.source = `uvx:${registration.pypiPackage}`, serverCfg.pypi_package = registration.pypiPackage) : (serverCfg.source = "custom", serverCfg.command = registration.command, serverCfg.args = registration.args);
|
|
84
|
+
isHttp || (registration.command && (serverCfg.command = registration.command), registration.args?.length && (serverCfg.args = registration.args));
|
|
85
|
+
let envKeys = getMcpRegistrationEnvKeys(registration);
|
|
86
|
+
if (envKeys.length) {
|
|
87
|
+
let scope = (registration.credentialStorage ?? "app") === "agent" ? "agent" : "app";
|
|
88
|
+
scope === "agent" && (serverCfg.env_keys = envKeys), serverCfg.env_schema = buildEnvSchemaFromKeys(registration, envKeys, scope);
|
|
89
|
+
}
|
|
90
|
+
return registration.toolCallTimeout && (serverCfg.tool_call_timeout_ms = registration.toolCallTimeout * 1e3), !isHttp && registration.runLocation && (serverCfg.run_location = registration.runLocation), registration.credentialFiles?.length && (serverCfg.credential_files = registration.credentialFiles.map((f) => ({
|
|
91
|
+
path: f.path,
|
|
92
|
+
...f.required !== void 0 ? { required: f.required } : {},
|
|
93
|
+
...f.writeBack !== void 0 ? { write_back: f.writeBack } : {}
|
|
94
|
+
}))), serverCfg;
|
|
95
|
+
}
|
|
96
|
+
function pinServerConfigToRegistration(connCfg, registration) {
|
|
97
|
+
let canonical = buildMcpServerConfigFromRegistration(registration), agentEnvSchema = (connCfg.env_schema ?? []).filter((e) => e.scope === "agent"), mergedEnvSchema = [
|
|
98
|
+
...canonical.env_schema ?? [],
|
|
99
|
+
...agentEnvSchema.filter(
|
|
100
|
+
(a) => !(canonical.env_schema ?? []).some((c) => c.key === a.key && c.scope === a.scope)
|
|
101
|
+
)
|
|
102
|
+
];
|
|
103
|
+
return {
|
|
104
|
+
...canonical,
|
|
105
|
+
// Agent-owned state kept from the .adf copy:
|
|
106
|
+
env: connCfg.env,
|
|
107
|
+
env_keys: connCfg.env_keys,
|
|
108
|
+
available_tools: connCfg.available_tools,
|
|
109
|
+
restricted: connCfg.restricted,
|
|
110
|
+
...mergedEnvSchema.length ? { env_schema: mergedEnvSchema } : {}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function suggestedAgentVisible(reg) {
|
|
114
|
+
return reg.type === "http" || !!reg.url ? !0 : reg.runLocation !== "host";
|
|
115
|
+
}
|
|
116
|
+
function isRegistrationAgentVisible(reg) {
|
|
117
|
+
return reg.agentVisible ?? suggestedAgentVisible(reg);
|
|
118
|
+
}
|
|
119
|
+
var MCP_EXECUTABLE_IDENTITY_FIELDS = ["type", "url", "command", "args", "npmPackage", "pypiPackage"];
|
|
120
|
+
function sameExecutableIdentity(a, b) {
|
|
121
|
+
let argsA = a.args ?? [], argsB = b.args ?? [];
|
|
122
|
+
return a.type === b.type && a.url === b.url && a.command === b.command && a.npmPackage === b.npmPackage && a.pypiPackage === b.pypiPackage && argsA.length === argsB.length && argsA.every((arg, i) => arg === argsB[i]);
|
|
123
|
+
}
|
|
124
|
+
function deriveRegistrationTestPlan(reg, opts) {
|
|
125
|
+
if (reg.type === "http" || !!reg.url) {
|
|
126
|
+
let notes2 = reg.oauth ? ["Interactive OAuth sign-in runs in a browser during this test."] : [];
|
|
127
|
+
return { location: "remote http", authMode: reg.oauth ? "run" : "none", materializeFiles: !1, notes: notes2 };
|
|
128
|
+
}
|
|
129
|
+
if (reg.runLocation === "host") {
|
|
130
|
+
if (!opts?.hostAccessEnabled) {
|
|
131
|
+
let notes2 = ["Host access is disabled app-wide \u2014 this test ran in the shared container. Enable host access in Settings \u2192 Compute to test on the host."];
|
|
132
|
+
return reg.auth && notes2.push("Authorization for containerized servers happens per-agent when an agent attaches this server."), { location: "shared container", authMode: reg.auth ? "skip" : "none", materializeFiles: !1, notes: notes2 };
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
location: "host",
|
|
136
|
+
authMode: reg.auth ? "run" : "none",
|
|
137
|
+
materializeFiles: !0,
|
|
138
|
+
notes: []
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
let notes = [];
|
|
142
|
+
return reg.auth && notes.push("Authorization for containerized servers happens per-agent when an agent attaches this server."), reg.credentialFiles?.length && notes.push("Credential files for containerized servers are captured per-agent at attach; this test verifies the package launches and lists tools."), { location: "shared container", authMode: reg.auth ? "skip" : "none", materializeFiles: !1, notes };
|
|
143
|
+
}
|
|
144
|
+
function registrationSourceIdentity(reg) {
|
|
145
|
+
return reg.type === "http" || reg.url ? reg.url ? `http:${reg.url}` : "http" : reg.npmPackage ? `npm:${reg.npmPackage}` : reg.pypiPackage ? `uvx:${reg.pypiPackage}` : "custom";
|
|
146
|
+
}
|
|
147
|
+
function reconcileHostApprovedRegistrations(prev, next, approved, approvedSources) {
|
|
148
|
+
let result = [...approved], sources = { ...approvedSources ?? {} }, prevByName = new Map(prev.filter((r) => r.name).map((r) => [r.name, r])), nextByName = new Map(next.filter((r) => r.name).map((r) => [r.name, r])), add = (name, reg) => {
|
|
149
|
+
result.includes(name) || result.push(name), sources[name] = registrationSourceIdentity(reg);
|
|
150
|
+
}, remove = (name) => {
|
|
151
|
+
let i = result.indexOf(name);
|
|
152
|
+
i >= 0 && result.splice(i, 1), delete sources[name];
|
|
153
|
+
};
|
|
154
|
+
for (let [name, reg] of nextByName) {
|
|
155
|
+
let wasHost = prevByName.get(name)?.runLocation === "host", isHost = reg.runLocation === "host" && reg.type !== "http";
|
|
156
|
+
isHost && !wasHost ? add(name, reg) : !isHost && wasHost ? remove(name) : isHost && wasHost && result.includes(name) && (sources[name] = registrationSourceIdentity(reg));
|
|
157
|
+
}
|
|
158
|
+
for (let [name, reg] of prevByName)
|
|
159
|
+
!nextByName.has(name) && reg.runLocation === "host" && remove(name);
|
|
160
|
+
return { approved: result, sources };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
mcpCredentialRef,
|
|
165
|
+
isSensitiveMcpHeader,
|
|
166
|
+
buildEnvSchemaFromKeys,
|
|
167
|
+
buildHeaderEnvSchemaFromEntries,
|
|
168
|
+
buildMcpServerConfigFromRegistration,
|
|
169
|
+
pinServerConfigToRegistration,
|
|
170
|
+
isRegistrationAgentVisible,
|
|
171
|
+
mcp_config_exports
|
|
172
|
+
};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
setWriteTap,
|
|
9
|
+
writeTerminal
|
|
10
|
+
} from "./chunk-7XYNI52E.mjs";
|
|
11
|
+
|
|
12
|
+
// src/main/tui/app/selection.ts
|
|
13
|
+
function clamp(value, min, max) {
|
|
14
|
+
return Math.max(min, Math.min(max, value));
|
|
15
|
+
}
|
|
16
|
+
function clampCell(cell, b) {
|
|
17
|
+
return { x: clamp(cell.x, b.x0, b.x1 - 1), y: clamp(cell.y, b.y0, b.y1 - 1) };
|
|
18
|
+
}
|
|
19
|
+
function before(a, b) {
|
|
20
|
+
return a.y < b.y || a.y === b.y && a.x <= b.x;
|
|
21
|
+
}
|
|
22
|
+
function selectionRows(sel) {
|
|
23
|
+
let a = clampCell(sel.anchor, sel.bounds), f = clampCell(sel.focus, sel.bounds), [start, end] = before(a, f) ? [a, f] : [f, a], rows = [];
|
|
24
|
+
for (let y = start.y; y <= end.y; y++)
|
|
25
|
+
rows.push({ y, x0: y === start.y ? start.x : sel.bounds.x0, x1: y === end.y ? end.x + 1 : sel.bounds.x1 });
|
|
26
|
+
return rows;
|
|
27
|
+
}
|
|
28
|
+
function rowText(screen2, y, x0, x1) {
|
|
29
|
+
let out = "";
|
|
30
|
+
for (let x = Math.max(0, x0); x < Math.min(screen2.cols, x1); x++) out += screen2.cell(x, y);
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
function selectionText(sel, screen2) {
|
|
34
|
+
let lines = selectionRows(sel).map((r) => rowText(screen2, r.y, r.x0, r.x1).replace(/\s+$/, ""));
|
|
35
|
+
for (; lines.length > 0 && lines[0] === ""; ) lines.shift();
|
|
36
|
+
for (; lines.length > 0 && lines[lines.length - 1] === ""; ) lines.pop();
|
|
37
|
+
let indents = lines.filter((l) => l.trim()).map((l) => l.length - l.trimStart().length), common = indents.length > 0 ? Math.min(...indents) : 0;
|
|
38
|
+
return lines.map((l) => l.slice(common)).join(`
|
|
39
|
+
`);
|
|
40
|
+
}
|
|
41
|
+
var WORD = /[\p{L}\p{N}_\-./\\:@~+%#?=&]/u;
|
|
42
|
+
function wordAt(screen2, at, b) {
|
|
43
|
+
let isWord = (x) => {
|
|
44
|
+
let ch = screen2.cell(x, at.y);
|
|
45
|
+
return ch === "" || WORD.test(ch);
|
|
46
|
+
}, here = screen2.cell(at.x, at.y);
|
|
47
|
+
if (!WORD.test(here) && here !== "") return { anchor: at, focus: at, bounds: b };
|
|
48
|
+
let x0 = at.x, x1 = at.x;
|
|
49
|
+
for (; x0 > b.x0 && isWord(x0 - 1); ) x0--;
|
|
50
|
+
for (; x1 < b.x1 - 1 && isWord(x1 + 1); ) x1++;
|
|
51
|
+
for (; x1 > x0 && /[.:,?]/.test(screen2.cell(x1, at.y)); ) x1--;
|
|
52
|
+
return { anchor: { x: x0, y: at.y }, focus: { x: x1, y: at.y }, bounds: b };
|
|
53
|
+
}
|
|
54
|
+
function lineAt(at, b) {
|
|
55
|
+
return { anchor: { x: b.x0, y: at.y }, focus: { x: b.x1 - 1, y: at.y }, bounds: b };
|
|
56
|
+
}
|
|
57
|
+
var MULTI_CLICK_MS = 450;
|
|
58
|
+
function createMouseController(deps) {
|
|
59
|
+
let press = null, last = null, current = null, show = (sel) => {
|
|
60
|
+
!sel && !current || (current = sel, deps.highlight(sel));
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
selection: () => current,
|
|
64
|
+
clear: () => show(null),
|
|
65
|
+
handle(event) {
|
|
66
|
+
if (event.kind === "press" && event.button === 2) {
|
|
67
|
+
show(null), deps.rightClick(event);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (event.kind === "press" && event.button === 0) {
|
|
71
|
+
if (show(null), press = null, deps.pressHandled(event)) {
|
|
72
|
+
last = null;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let now = deps.now(), count = last && last.x === event.x && last.y === event.y && now - last.at <= MULTI_CLICK_MS ? Math.min(3, last.count + 1) : 1;
|
|
76
|
+
last = { x: event.x, y: event.y, at: now, count };
|
|
77
|
+
let bounds = deps.paneAt(event.x, event.y);
|
|
78
|
+
press = { event, bounds, count, dragging: !1 };
|
|
79
|
+
let screen2 = deps.screen();
|
|
80
|
+
count === 2 && screen2 ? show(wordAt(screen2, event, bounds)) : count === 3 && show(lineAt(event, bounds));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (press) {
|
|
84
|
+
if (event.kind === "drag") {
|
|
85
|
+
let focus = clampCell(event, press.bounds);
|
|
86
|
+
if (!press.dragging && focus.x === press.event.x && focus.y === press.event.y) return;
|
|
87
|
+
press.dragging = !0, last = null, show({ anchor: clampCell(press.event, press.bounds), focus, bounds: press.bounds });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (event.kind === "release") {
|
|
91
|
+
let done = press;
|
|
92
|
+
if (press = null, done.dragging || done.count > 1) {
|
|
93
|
+
let screen2 = deps.screen(), text = current && screen2 ? selectionText(current, screen2) : "";
|
|
94
|
+
text && deps.copy(text);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
deps.click(done.event);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/main/tui/app/screen.ts
|
|
105
|
+
var screen = null, highlight = null, repaint = null, painted = !1, paintQueued = !1;
|
|
106
|
+
function getScreenText() {
|
|
107
|
+
return screen;
|
|
108
|
+
}
|
|
109
|
+
function setScreenText(next) {
|
|
110
|
+
screen = next;
|
|
111
|
+
}
|
|
112
|
+
function setRepaint(fn) {
|
|
113
|
+
repaint = fn;
|
|
114
|
+
}
|
|
115
|
+
function currentHighlight() {
|
|
116
|
+
return highlight;
|
|
117
|
+
}
|
|
118
|
+
var SAVE = "\x1B7", RESTORE = "\x1B8";
|
|
119
|
+
function highlightSequence(sel, text) {
|
|
120
|
+
let seq = "";
|
|
121
|
+
for (let row of selectionRows(sel)) {
|
|
122
|
+
let cells = "";
|
|
123
|
+
for (let x = row.x0; x < row.x1 && x < text.cols; x++) cells += text.cell(x, row.y);
|
|
124
|
+
cells && (seq += `\x1B[${row.y + 1};${row.x0 + 1}H\x1B[7m${cells}\x1B[27m`);
|
|
125
|
+
}
|
|
126
|
+
return seq ? `${SAVE}${seq}\x1B[0m${RESTORE}` : "";
|
|
127
|
+
}
|
|
128
|
+
function cellsUnder(sel, text) {
|
|
129
|
+
return selectionRows(sel).map((row) => {
|
|
130
|
+
let cells = "";
|
|
131
|
+
for (let x = row.x0; x < row.x1 && x < text.cols; x++) cells += text.cell(x, row.y);
|
|
132
|
+
return cells;
|
|
133
|
+
}).join(`
|
|
134
|
+
`);
|
|
135
|
+
}
|
|
136
|
+
var snapshot = "";
|
|
137
|
+
function paint() {
|
|
138
|
+
if (paintQueued = !1, !highlight || !screen) return;
|
|
139
|
+
if (cellsUnder(highlight, screen) !== snapshot) {
|
|
140
|
+
setHighlight(null);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
let seq = highlightSequence(highlight, screen);
|
|
144
|
+
seq && writeTerminal(seq) && (painted = !0);
|
|
145
|
+
}
|
|
146
|
+
function setHighlight(sel) {
|
|
147
|
+
if (highlight = sel, sel) {
|
|
148
|
+
snapshot = screen ? cellsUnder(sel, screen) : "", paint();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
painted && (painted = !1, repaint?.());
|
|
152
|
+
}
|
|
153
|
+
function queuePaint() {
|
|
154
|
+
!highlight || paintQueued || (paintQueued = !0, setImmediate(paint));
|
|
155
|
+
}
|
|
156
|
+
var MirrorScreen = class {
|
|
157
|
+
constructor(term) {
|
|
158
|
+
this.term = term;
|
|
159
|
+
}
|
|
160
|
+
term;
|
|
161
|
+
get cols() {
|
|
162
|
+
return this.term.cols;
|
|
163
|
+
}
|
|
164
|
+
get rows() {
|
|
165
|
+
return this.term.rows;
|
|
166
|
+
}
|
|
167
|
+
cell(x, y) {
|
|
168
|
+
let buffer = this.term.buffer.active, cell = buffer.getLine(buffer.viewportY + y)?.getCell(x);
|
|
169
|
+
return cell ? cell.getWidth() === 0 ? "" : cell.getChars() || " " : " ";
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
async function installScreenMirror(stdout) {
|
|
173
|
+
let mod = await import("./xterm-headless-YF53XWXE.mjs"), Terminal = mod.Terminal ?? mod.default?.Terminal;
|
|
174
|
+
if (!Terminal) return () => {
|
|
175
|
+
};
|
|
176
|
+
let term = new Terminal({ cols: stdout.columns || 80, rows: stdout.rows || 24, scrollback: 0, allowProposedApi: !0, logLevel: "off" });
|
|
177
|
+
screen = new MirrorScreen(term);
|
|
178
|
+
let onResize = () => {
|
|
179
|
+
try {
|
|
180
|
+
term.resize(stdout.columns || 80, stdout.rows || 24);
|
|
181
|
+
} catch {
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
return stdout.on("resize", onResize), setWriteTap((data) => {
|
|
185
|
+
term.write(data, queuePaint);
|
|
186
|
+
}), () => {
|
|
187
|
+
setWriteTap(null), stdout.off("resize", onResize), screen = null, highlight = null, painted = !1, term.dispose();
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
createMouseController,
|
|
193
|
+
getScreenText,
|
|
194
|
+
setScreenText,
|
|
195
|
+
setRepaint,
|
|
196
|
+
currentHighlight,
|
|
197
|
+
highlightSequence,
|
|
198
|
+
setHighlight,
|
|
199
|
+
installScreenMirror
|
|
200
|
+
};
|