@react-grab/claude-code 0.0.78 → 0.0.80
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/cli.cjs +498 -4
- package/dist/cli.js +498 -4
- package/dist/client.cjs +36 -14
- package/dist/client.d.cts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.global.js +4 -4
- package/dist/client.js +36 -14
- package/dist/server.cjs +99 -32
- package/dist/server.js +99 -31
- package/package.json +6 -2
package/dist/cli.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var child_process = require('child_process');
|
|
5
4
|
var url = require('url');
|
|
6
5
|
var path = require('path');
|
|
7
6
|
|
|
@@ -12,7 +11,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
12
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
12
|
var __getProtoOf = Object.getPrototypeOf;
|
|
14
13
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
-
var
|
|
14
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
15
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
16
|
+
}) : x)(function(x) {
|
|
17
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
18
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
19
|
+
});
|
|
20
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
16
21
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
22
|
};
|
|
18
23
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -32,6 +37,494 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
37
|
mod
|
|
33
38
|
));
|
|
34
39
|
|
|
40
|
+
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
|
|
41
|
+
var require_windows = __commonJS({
|
|
42
|
+
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
|
|
43
|
+
module.exports = isexe;
|
|
44
|
+
isexe.sync = sync;
|
|
45
|
+
var fs = __require("fs");
|
|
46
|
+
function checkPathExt(path, options) {
|
|
47
|
+
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
48
|
+
if (!pathext) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
pathext = pathext.split(";");
|
|
52
|
+
if (pathext.indexOf("") !== -1) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
for (var i = 0; i < pathext.length; i++) {
|
|
56
|
+
var p = pathext[i].toLowerCase();
|
|
57
|
+
if (p && path.substr(-p.length).toLowerCase() === p) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
function checkStat(stat, path, options) {
|
|
64
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return checkPathExt(path, options);
|
|
68
|
+
}
|
|
69
|
+
function isexe(path, options, cb) {
|
|
70
|
+
fs.stat(path, function(er, stat) {
|
|
71
|
+
cb(er, er ? false : checkStat(stat, path, options));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function sync(path, options) {
|
|
75
|
+
return checkStat(fs.statSync(path), path, options);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
|
|
81
|
+
var require_mode = __commonJS({
|
|
82
|
+
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
|
|
83
|
+
module.exports = isexe;
|
|
84
|
+
isexe.sync = sync;
|
|
85
|
+
var fs = __require("fs");
|
|
86
|
+
function isexe(path, options, cb) {
|
|
87
|
+
fs.stat(path, function(er, stat) {
|
|
88
|
+
cb(er, er ? false : checkStat(stat, options));
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function sync(path, options) {
|
|
92
|
+
return checkStat(fs.statSync(path), options);
|
|
93
|
+
}
|
|
94
|
+
function checkStat(stat, options) {
|
|
95
|
+
return stat.isFile() && checkMode(stat, options);
|
|
96
|
+
}
|
|
97
|
+
function checkMode(stat, options) {
|
|
98
|
+
var mod = stat.mode;
|
|
99
|
+
var uid = stat.uid;
|
|
100
|
+
var gid = stat.gid;
|
|
101
|
+
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
102
|
+
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
103
|
+
var u = parseInt("100", 8);
|
|
104
|
+
var g = parseInt("010", 8);
|
|
105
|
+
var o = parseInt("001", 8);
|
|
106
|
+
var ug = u | g;
|
|
107
|
+
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
108
|
+
return ret;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
114
|
+
var require_isexe = __commonJS({
|
|
115
|
+
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
116
|
+
__require("fs");
|
|
117
|
+
var core;
|
|
118
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
119
|
+
core = require_windows();
|
|
120
|
+
} else {
|
|
121
|
+
core = require_mode();
|
|
122
|
+
}
|
|
123
|
+
module.exports = isexe;
|
|
124
|
+
isexe.sync = sync;
|
|
125
|
+
function isexe(path, options, cb) {
|
|
126
|
+
if (typeof options === "function") {
|
|
127
|
+
cb = options;
|
|
128
|
+
options = {};
|
|
129
|
+
}
|
|
130
|
+
if (!cb) {
|
|
131
|
+
if (typeof Promise !== "function") {
|
|
132
|
+
throw new TypeError("callback not provided");
|
|
133
|
+
}
|
|
134
|
+
return new Promise(function(resolve, reject) {
|
|
135
|
+
isexe(path, options || {}, function(er, is) {
|
|
136
|
+
if (er) {
|
|
137
|
+
reject(er);
|
|
138
|
+
} else {
|
|
139
|
+
resolve(is);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
core(path, options || {}, function(er, is) {
|
|
145
|
+
if (er) {
|
|
146
|
+
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
147
|
+
er = null;
|
|
148
|
+
is = false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
cb(er, is);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function sync(path, options) {
|
|
155
|
+
try {
|
|
156
|
+
return core.sync(path, options || {});
|
|
157
|
+
} catch (er) {
|
|
158
|
+
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
159
|
+
return false;
|
|
160
|
+
} else {
|
|
161
|
+
throw er;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
169
|
+
var require_which = __commonJS({
|
|
170
|
+
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
|
|
171
|
+
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
172
|
+
var path = __require("path");
|
|
173
|
+
var COLON = isWindows ? ";" : ":";
|
|
174
|
+
var isexe = require_isexe();
|
|
175
|
+
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
176
|
+
var getPathInfo = (cmd, opt) => {
|
|
177
|
+
const colon = opt.colon || COLON;
|
|
178
|
+
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
179
|
+
// windows always checks the cwd first
|
|
180
|
+
...isWindows ? [process.cwd()] : [],
|
|
181
|
+
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
182
|
+
"").split(colon)
|
|
183
|
+
];
|
|
184
|
+
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
185
|
+
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
186
|
+
if (isWindows) {
|
|
187
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
188
|
+
pathExt.unshift("");
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
pathEnv,
|
|
192
|
+
pathExt,
|
|
193
|
+
pathExtExe
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
var which = (cmd, opt, cb) => {
|
|
197
|
+
if (typeof opt === "function") {
|
|
198
|
+
cb = opt;
|
|
199
|
+
opt = {};
|
|
200
|
+
}
|
|
201
|
+
if (!opt)
|
|
202
|
+
opt = {};
|
|
203
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
204
|
+
const found = [];
|
|
205
|
+
const step = (i) => new Promise((resolve, reject) => {
|
|
206
|
+
if (i === pathEnv.length)
|
|
207
|
+
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
208
|
+
const ppRaw = pathEnv[i];
|
|
209
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
210
|
+
const pCmd = path.join(pathPart, cmd);
|
|
211
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
212
|
+
resolve(subStep(p, i, 0));
|
|
213
|
+
});
|
|
214
|
+
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
215
|
+
if (ii === pathExt.length)
|
|
216
|
+
return resolve(step(i + 1));
|
|
217
|
+
const ext = pathExt[ii];
|
|
218
|
+
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
219
|
+
if (!er && is) {
|
|
220
|
+
if (opt.all)
|
|
221
|
+
found.push(p + ext);
|
|
222
|
+
else
|
|
223
|
+
return resolve(p + ext);
|
|
224
|
+
}
|
|
225
|
+
return resolve(subStep(p, i, ii + 1));
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
229
|
+
};
|
|
230
|
+
var whichSync = (cmd, opt) => {
|
|
231
|
+
opt = opt || {};
|
|
232
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
233
|
+
const found = [];
|
|
234
|
+
for (let i = 0; i < pathEnv.length; i++) {
|
|
235
|
+
const ppRaw = pathEnv[i];
|
|
236
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
237
|
+
const pCmd = path.join(pathPart, cmd);
|
|
238
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
239
|
+
for (let j = 0; j < pathExt.length; j++) {
|
|
240
|
+
const cur = p + pathExt[j];
|
|
241
|
+
try {
|
|
242
|
+
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
243
|
+
if (is) {
|
|
244
|
+
if (opt.all)
|
|
245
|
+
found.push(cur);
|
|
246
|
+
else
|
|
247
|
+
return cur;
|
|
248
|
+
}
|
|
249
|
+
} catch (ex) {
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (opt.all && found.length)
|
|
254
|
+
return found;
|
|
255
|
+
if (opt.nothrow)
|
|
256
|
+
return null;
|
|
257
|
+
throw getNotFoundError(cmd);
|
|
258
|
+
};
|
|
259
|
+
module.exports = which;
|
|
260
|
+
which.sync = whichSync;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
|
|
265
|
+
var require_path_key = __commonJS({
|
|
266
|
+
"../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module) {
|
|
267
|
+
var pathKey = (options = {}) => {
|
|
268
|
+
const environment = options.env || process.env;
|
|
269
|
+
const platform = options.platform || process.platform;
|
|
270
|
+
if (platform !== "win32") {
|
|
271
|
+
return "PATH";
|
|
272
|
+
}
|
|
273
|
+
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
274
|
+
};
|
|
275
|
+
module.exports = pathKey;
|
|
276
|
+
module.exports.default = pathKey;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
281
|
+
var require_resolveCommand = __commonJS({
|
|
282
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
283
|
+
var path = __require("path");
|
|
284
|
+
var which = require_which();
|
|
285
|
+
var getPathKey = require_path_key();
|
|
286
|
+
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
287
|
+
const env = parsed.options.env || process.env;
|
|
288
|
+
const cwd = process.cwd();
|
|
289
|
+
const hasCustomCwd = parsed.options.cwd != null;
|
|
290
|
+
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
291
|
+
if (shouldSwitchCwd) {
|
|
292
|
+
try {
|
|
293
|
+
process.chdir(parsed.options.cwd);
|
|
294
|
+
} catch (err) {
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
let resolved;
|
|
298
|
+
try {
|
|
299
|
+
resolved = which.sync(parsed.command, {
|
|
300
|
+
path: env[getPathKey({ env })],
|
|
301
|
+
pathExt: withoutPathExt ? path.delimiter : void 0
|
|
302
|
+
});
|
|
303
|
+
} catch (e) {
|
|
304
|
+
} finally {
|
|
305
|
+
if (shouldSwitchCwd) {
|
|
306
|
+
process.chdir(cwd);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (resolved) {
|
|
310
|
+
resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
311
|
+
}
|
|
312
|
+
return resolved;
|
|
313
|
+
}
|
|
314
|
+
function resolveCommand(parsed) {
|
|
315
|
+
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
316
|
+
}
|
|
317
|
+
module.exports = resolveCommand;
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
|
|
322
|
+
var require_escape = __commonJS({
|
|
323
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
324
|
+
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
325
|
+
function escapeCommand(arg) {
|
|
326
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
327
|
+
return arg;
|
|
328
|
+
}
|
|
329
|
+
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
330
|
+
arg = `${arg}`;
|
|
331
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
332
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
333
|
+
arg = `"${arg}"`;
|
|
334
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
335
|
+
if (doubleEscapeMetaChars) {
|
|
336
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
337
|
+
}
|
|
338
|
+
return arg;
|
|
339
|
+
}
|
|
340
|
+
module.exports.command = escapeCommand;
|
|
341
|
+
module.exports.argument = escapeArgument;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
|
|
346
|
+
var require_shebang_regex = __commonJS({
|
|
347
|
+
"../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module) {
|
|
348
|
+
module.exports = /^#!(.*)/;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
|
|
353
|
+
var require_shebang_command = __commonJS({
|
|
354
|
+
"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module) {
|
|
355
|
+
var shebangRegex = require_shebang_regex();
|
|
356
|
+
module.exports = (string = "") => {
|
|
357
|
+
const match = string.match(shebangRegex);
|
|
358
|
+
if (!match) {
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
362
|
+
const binary = path.split("/").pop();
|
|
363
|
+
if (binary === "env") {
|
|
364
|
+
return argument;
|
|
365
|
+
}
|
|
366
|
+
return argument ? `${binary} ${argument}` : binary;
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
372
|
+
var require_readShebang = __commonJS({
|
|
373
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
374
|
+
var fs = __require("fs");
|
|
375
|
+
var shebangCommand = require_shebang_command();
|
|
376
|
+
function readShebang(command) {
|
|
377
|
+
const size = 150;
|
|
378
|
+
const buffer = Buffer.alloc(size);
|
|
379
|
+
let fd;
|
|
380
|
+
try {
|
|
381
|
+
fd = fs.openSync(command, "r");
|
|
382
|
+
fs.readSync(fd, buffer, 0, size, 0);
|
|
383
|
+
fs.closeSync(fd);
|
|
384
|
+
} catch (e) {
|
|
385
|
+
}
|
|
386
|
+
return shebangCommand(buffer.toString());
|
|
387
|
+
}
|
|
388
|
+
module.exports = readShebang;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
393
|
+
var require_parse = __commonJS({
|
|
394
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
395
|
+
var path = __require("path");
|
|
396
|
+
var resolveCommand = require_resolveCommand();
|
|
397
|
+
var escape = require_escape();
|
|
398
|
+
var readShebang = require_readShebang();
|
|
399
|
+
var isWin = process.platform === "win32";
|
|
400
|
+
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
401
|
+
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
402
|
+
function detectShebang(parsed) {
|
|
403
|
+
parsed.file = resolveCommand(parsed);
|
|
404
|
+
const shebang = parsed.file && readShebang(parsed.file);
|
|
405
|
+
if (shebang) {
|
|
406
|
+
parsed.args.unshift(parsed.file);
|
|
407
|
+
parsed.command = shebang;
|
|
408
|
+
return resolveCommand(parsed);
|
|
409
|
+
}
|
|
410
|
+
return parsed.file;
|
|
411
|
+
}
|
|
412
|
+
function parseNonShell(parsed) {
|
|
413
|
+
if (!isWin) {
|
|
414
|
+
return parsed;
|
|
415
|
+
}
|
|
416
|
+
const commandFile = detectShebang(parsed);
|
|
417
|
+
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
418
|
+
if (parsed.options.forceShell || needsShell) {
|
|
419
|
+
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
420
|
+
parsed.command = path.normalize(parsed.command);
|
|
421
|
+
parsed.command = escape.command(parsed.command);
|
|
422
|
+
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
423
|
+
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
424
|
+
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
425
|
+
parsed.command = process.env.comspec || "cmd.exe";
|
|
426
|
+
parsed.options.windowsVerbatimArguments = true;
|
|
427
|
+
}
|
|
428
|
+
return parsed;
|
|
429
|
+
}
|
|
430
|
+
function parse(command, args, options) {
|
|
431
|
+
if (args && !Array.isArray(args)) {
|
|
432
|
+
options = args;
|
|
433
|
+
args = null;
|
|
434
|
+
}
|
|
435
|
+
args = args ? args.slice(0) : [];
|
|
436
|
+
options = Object.assign({}, options);
|
|
437
|
+
const parsed = {
|
|
438
|
+
command,
|
|
439
|
+
args,
|
|
440
|
+
options,
|
|
441
|
+
file: void 0,
|
|
442
|
+
original: {
|
|
443
|
+
command,
|
|
444
|
+
args
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
return options.shell ? parsed : parseNonShell(parsed);
|
|
448
|
+
}
|
|
449
|
+
module.exports = parse;
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
|
|
454
|
+
var require_enoent = __commonJS({
|
|
455
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
456
|
+
var isWin = process.platform === "win32";
|
|
457
|
+
function notFoundError(original, syscall) {
|
|
458
|
+
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
459
|
+
code: "ENOENT",
|
|
460
|
+
errno: "ENOENT",
|
|
461
|
+
syscall: `${syscall} ${original.command}`,
|
|
462
|
+
path: original.command,
|
|
463
|
+
spawnargs: original.args
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
function hookChildProcess(cp, parsed) {
|
|
467
|
+
if (!isWin) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const originalEmit = cp.emit;
|
|
471
|
+
cp.emit = function(name, arg1) {
|
|
472
|
+
if (name === "exit") {
|
|
473
|
+
const err = verifyENOENT(arg1, parsed);
|
|
474
|
+
if (err) {
|
|
475
|
+
return originalEmit.call(cp, "error", err);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return originalEmit.apply(cp, arguments);
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
function verifyENOENT(status, parsed) {
|
|
482
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
483
|
+
return notFoundError(parsed.original, "spawn");
|
|
484
|
+
}
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
function verifyENOENTSync(status, parsed) {
|
|
488
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
489
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
490
|
+
}
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
module.exports = {
|
|
494
|
+
hookChildProcess,
|
|
495
|
+
verifyENOENT,
|
|
496
|
+
verifyENOENTSync,
|
|
497
|
+
notFoundError
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
|
503
|
+
var require_cross_spawn = __commonJS({
|
|
504
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
|
|
505
|
+
var cp = __require("child_process");
|
|
506
|
+
var parse = require_parse();
|
|
507
|
+
var enoent = require_enoent();
|
|
508
|
+
function spawn2(command, args, options) {
|
|
509
|
+
const parsed = parse(command, args, options);
|
|
510
|
+
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
511
|
+
enoent.hookChildProcess(spawned, parsed);
|
|
512
|
+
return spawned;
|
|
513
|
+
}
|
|
514
|
+
function spawnSync(command, args, options) {
|
|
515
|
+
const parsed = parse(command, args, options);
|
|
516
|
+
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
517
|
+
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
520
|
+
module.exports = spawn2;
|
|
521
|
+
module.exports.spawn = spawn2;
|
|
522
|
+
module.exports.sync = spawnSync;
|
|
523
|
+
module.exports._parse = parse;
|
|
524
|
+
module.exports._enoent = enoent;
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
35
528
|
// ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
36
529
|
var require_picocolors = __commonJS({
|
|
37
530
|
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
@@ -105,17 +598,18 @@ var require_picocolors = __commonJS({
|
|
|
105
598
|
});
|
|
106
599
|
|
|
107
600
|
// src/cli.ts
|
|
601
|
+
var import_cross_spawn = __toESM(require_cross_spawn());
|
|
108
602
|
var import_picocolors = __toESM(require_picocolors());
|
|
109
603
|
|
|
110
604
|
// src/constants.ts
|
|
111
605
|
var DEFAULT_PORT = 4567;
|
|
112
606
|
|
|
113
607
|
// src/cli.ts
|
|
114
|
-
var VERSION = "0.0.
|
|
608
|
+
var VERSION = "0.0.80";
|
|
115
609
|
var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)));
|
|
116
610
|
var __dirname$1 = path.dirname(__filename$1);
|
|
117
611
|
var serverPath = path.join(__dirname$1, "server.js");
|
|
118
|
-
|
|
612
|
+
(0, import_cross_spawn.default)(process.execPath, [serverPath], {
|
|
119
613
|
detached: true,
|
|
120
614
|
stdio: "ignore"
|
|
121
615
|
}).unref();
|