@andpipes/cli 0.0.2 → 0.1.1
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 +201 -1
- package/README.md +61 -0
- package/dist/bin.cjs +8904 -0
- package/dist/bin.d.cts +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +20 -0
- package/dist/chunk-7LSHSW4Q.js +758 -0
- package/dist/chunk-QPRR3KCS.js +8493 -0
- package/dist/dev-supervisor.cjs +249 -0
- package/dist/dev-supervisor.d.cts +2 -0
- package/dist/dev-supervisor.d.ts +2 -0
- package/dist/dev-supervisor.js +104 -0
- package/dist/index.cjs +9144 -0
- package/dist/index.d.cts +1265 -0
- package/dist/index.d.ts +1265 -0
- package/dist/index.js +199 -0
- package/package.json +53 -6
- package/bin/andpipe.js +0 -2
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
// src/lib/dev-artifact.ts
|
|
2
|
+
import {
|
|
3
|
+
chmodSync,
|
|
4
|
+
closeSync as closeSync2,
|
|
5
|
+
constants as fsConstants2,
|
|
6
|
+
fsyncSync as fsyncSync2,
|
|
7
|
+
lstatSync as lstatSync2,
|
|
8
|
+
mkdtempSync,
|
|
9
|
+
openSync as openSync2,
|
|
10
|
+
rmdirSync,
|
|
11
|
+
unlinkSync as unlinkSync2,
|
|
12
|
+
writeSync as writeSync2
|
|
13
|
+
} from "fs";
|
|
14
|
+
import { tmpdir } from "os";
|
|
15
|
+
import { join } from "path";
|
|
16
|
+
|
|
17
|
+
// src/lib/local-files.ts
|
|
18
|
+
import { createHash, randomUUID } from "crypto";
|
|
19
|
+
import {
|
|
20
|
+
closeSync,
|
|
21
|
+
fchmodSync,
|
|
22
|
+
constants as fsConstants,
|
|
23
|
+
fstatSync,
|
|
24
|
+
fsyncSync,
|
|
25
|
+
linkSync,
|
|
26
|
+
lstatSync,
|
|
27
|
+
openSync,
|
|
28
|
+
readSync,
|
|
29
|
+
realpathSync,
|
|
30
|
+
unlinkSync,
|
|
31
|
+
writeSync
|
|
32
|
+
} from "fs";
|
|
33
|
+
import { basename, dirname, isAbsolute, relative, resolve } from "path";
|
|
34
|
+
var SECURITY_MODE_MASK = 4095;
|
|
35
|
+
var LocalFilePolicyError = class extends Error {
|
|
36
|
+
constructor(reason, message) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.reason = reason;
|
|
39
|
+
this.name = "LocalFilePolicyError";
|
|
40
|
+
}
|
|
41
|
+
reason;
|
|
42
|
+
code = "AP_POLICY_DENIED";
|
|
43
|
+
};
|
|
44
|
+
function isSafeIdentity(stat) {
|
|
45
|
+
return Number.isSafeInteger(stat.dev) && Number.isSafeInteger(stat.ino) && stat.ino !== 0 && Number.isSafeInteger(stat.nlink) && stat.nlink === 1;
|
|
46
|
+
}
|
|
47
|
+
function sameIdentity(left, right) {
|
|
48
|
+
return left.dev === right.dev && left.ino === right.ino;
|
|
49
|
+
}
|
|
50
|
+
function sameReadIdentity(left, right) {
|
|
51
|
+
return sameIdentity(left, right) && left.nlink === right.nlink && left.size === right.size && left.uid === right.uid && (left.mode & SECURITY_MODE_MASK) === (right.mode & SECURITY_MODE_MASK);
|
|
52
|
+
}
|
|
53
|
+
function assertBoundedRegular(stat, maxBytes, phase) {
|
|
54
|
+
if (stat.isSymbolicLink() || !stat.isFile() || !isSafeIdentity(stat)) {
|
|
55
|
+
throw new LocalFilePolicyError(
|
|
56
|
+
"local_file_invalid",
|
|
57
|
+
`${phase}: symlink / hard link / special file \u306F\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (!Number.isSafeInteger(stat.size) || stat.size < 0 || stat.size > maxBytes) {
|
|
61
|
+
throw new LocalFilePolicyError(
|
|
62
|
+
"local_file_too_large",
|
|
63
|
+
`${phase}: local file \u304C ${maxBytes} bytes \u306E\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function assertWithinRoot(path, opened, options) {
|
|
68
|
+
if (!options.root) return;
|
|
69
|
+
const root = realpathSync(options.root);
|
|
70
|
+
const actual = realpathSync(path);
|
|
71
|
+
const rel = relative(root, actual);
|
|
72
|
+
if (rel === "" || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
73
|
+
throw new LocalFilePolicyError(
|
|
74
|
+
"local_file_invalid",
|
|
75
|
+
"local file \u306E\u5B9F\u4F53\u304C project root \u5916\u306B\u3042\u308A\u307E\u3059"
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
if (options.directChildOnly && dirname(actual) !== root) {
|
|
79
|
+
throw new LocalFilePolicyError(
|
|
80
|
+
"local_file_invalid",
|
|
81
|
+
"local file \u306F project root \u76F4\u4E0B\u306B\u5FC5\u8981\u3067\u3059"
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const actualStat = lstatSync(actual);
|
|
85
|
+
assertBoundedRegular(actualStat, options.maxBytes, "realpath after");
|
|
86
|
+
if (!sameReadIdentity(opened, actualStat)) {
|
|
87
|
+
throw new LocalFilePolicyError(
|
|
88
|
+
"local_file_changed",
|
|
89
|
+
"local file \u306E\u5B9F\u4F53\u304C\u8AAD\u307F\u8FBC\u307F\u4E2D\u306B\u5909\u66F4\u3055\u308C\u307E\u3057\u305F"
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function readBoundedLocalFileSnapshot(path, options) {
|
|
94
|
+
if (!Number.isSafeInteger(options.maxBytes) || options.maxBytes <= 0) {
|
|
95
|
+
throw new TypeError("maxBytes must be a positive safe integer");
|
|
96
|
+
}
|
|
97
|
+
const noFollow = fsConstants.O_NOFOLLOW;
|
|
98
|
+
const nonBlock = fsConstants.O_NONBLOCK;
|
|
99
|
+
if (typeof noFollow !== "number" || noFollow <= 0 || typeof nonBlock !== "number" || nonBlock <= 0) {
|
|
100
|
+
throw new LocalFilePolicyError(
|
|
101
|
+
"local_filesystem_unsafe",
|
|
102
|
+
"local filesystem \u304C safe open \u3092\u63D0\u4F9B\u3057\u3066\u3044\u307E\u305B\u3093"
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
let before;
|
|
106
|
+
try {
|
|
107
|
+
before = lstatSync(path);
|
|
108
|
+
} catch {
|
|
109
|
+
throw new LocalFilePolicyError("local_file_invalid", "local file \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093");
|
|
110
|
+
}
|
|
111
|
+
assertBoundedRegular(before, options.maxBytes, "open before");
|
|
112
|
+
let fd;
|
|
113
|
+
try {
|
|
114
|
+
fd = openSync(path, fsConstants.O_RDONLY | noFollow | nonBlock);
|
|
115
|
+
const opened = fstatSync(fd);
|
|
116
|
+
assertBoundedRegular(opened, options.maxBytes, "open after");
|
|
117
|
+
if (!sameReadIdentity(before, opened)) {
|
|
118
|
+
throw new LocalFilePolicyError(
|
|
119
|
+
"local_file_changed",
|
|
120
|
+
"local file \u304Copen\u4E2D\u306B\u5DEE\u3057\u66FF\u3048\u3089\u308C\u307E\u3057\u305F"
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
assertWithinRoot(path, opened, options);
|
|
124
|
+
const bytes = Buffer.allocUnsafe(options.maxBytes + 1);
|
|
125
|
+
let total = 0;
|
|
126
|
+
while (total < bytes.byteLength) {
|
|
127
|
+
const count = readSync(fd, bytes, total, bytes.byteLength - total, null);
|
|
128
|
+
if (count === 0) break;
|
|
129
|
+
total += count;
|
|
130
|
+
}
|
|
131
|
+
if (total > options.maxBytes) {
|
|
132
|
+
throw new LocalFilePolicyError(
|
|
133
|
+
"local_file_too_large",
|
|
134
|
+
`local file \u304C ${options.maxBytes} bytes \u306E\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059`
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
const after = lstatSync(path);
|
|
138
|
+
assertBoundedRegular(after, options.maxBytes, "read after");
|
|
139
|
+
if (!sameReadIdentity(opened, after)) {
|
|
140
|
+
throw new LocalFilePolicyError(
|
|
141
|
+
"local_file_changed",
|
|
142
|
+
"local file \u304C\u8AAD\u307F\u8FBC\u307F\u4E2D\u306B\u5909\u66F4\u3055\u308C\u307E\u3057\u305F"
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
assertWithinRoot(path, opened, options);
|
|
146
|
+
const content = bytes.subarray(0, total);
|
|
147
|
+
try {
|
|
148
|
+
return {
|
|
149
|
+
text: new TextDecoder("utf-8", { fatal: true }).decode(content),
|
|
150
|
+
identity: {
|
|
151
|
+
dev: opened.dev,
|
|
152
|
+
ino: opened.ino,
|
|
153
|
+
nlink: opened.nlink,
|
|
154
|
+
size: opened.size,
|
|
155
|
+
uid: opened.uid,
|
|
156
|
+
mode: opened.mode & SECURITY_MODE_MASK
|
|
157
|
+
},
|
|
158
|
+
sha256: createHash("sha256").update(content).digest("hex")
|
|
159
|
+
};
|
|
160
|
+
} catch {
|
|
161
|
+
throw new LocalFilePolicyError(
|
|
162
|
+
"local_file_invalid",
|
|
163
|
+
"local file \u306Fvalid UTF-8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (error instanceof LocalFilePolicyError) throw error;
|
|
168
|
+
throw new LocalFilePolicyError("local_file_invalid", "local file \u3092\u5B89\u5168\u306B\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093");
|
|
169
|
+
} finally {
|
|
170
|
+
if (fd !== void 0) closeSync(fd);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function readBoundedLocalFile(path, options) {
|
|
174
|
+
return readBoundedLocalFileSnapshot(path, options).text;
|
|
175
|
+
}
|
|
176
|
+
function assertOpenFileBytesExact(fd, expected, phase) {
|
|
177
|
+
const observed = Buffer.allocUnsafe(expected.byteLength + 1);
|
|
178
|
+
let total = 0;
|
|
179
|
+
while (total < observed.byteLength) {
|
|
180
|
+
const count = readSync(fd, observed, total, observed.byteLength - total, total);
|
|
181
|
+
if (count === 0) break;
|
|
182
|
+
total += count;
|
|
183
|
+
}
|
|
184
|
+
if (total !== expected.byteLength || !observed.subarray(0, total).equals(Buffer.from(expected))) {
|
|
185
|
+
throw new LocalFilePolicyError(
|
|
186
|
+
"local_file_changed",
|
|
187
|
+
`local file bytes\u304C\u5909\u5316\u3057\u307E\u3057\u305F (${phase})`
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function resolveDirectChild(root, relativePath) {
|
|
192
|
+
const rootPath = realpathSync(root);
|
|
193
|
+
const absolute = resolve(rootPath, relativePath);
|
|
194
|
+
if (dirname(absolute) !== rootPath) {
|
|
195
|
+
throw new LocalFilePolicyError(
|
|
196
|
+
"local_file_invalid",
|
|
197
|
+
"local file path \u306F project root \u76F4\u4E0B\u306B\u5FC5\u8981\u3067\u3059"
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
return absolute;
|
|
201
|
+
}
|
|
202
|
+
function writePrivateFileNoReplace(path, root, text, maxBytes, options = {}) {
|
|
203
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1) {
|
|
204
|
+
throw new TypeError("maxBytes must be a positive safe integer");
|
|
205
|
+
}
|
|
206
|
+
const bytes = Buffer.from(text, "utf8");
|
|
207
|
+
if (bytes.byteLength > maxBytes) {
|
|
208
|
+
throw new LocalFilePolicyError(
|
|
209
|
+
"local_file_too_large",
|
|
210
|
+
`export file \u304C ${maxBytes} bytes \u306E\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059`
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
let rootPath;
|
|
214
|
+
let initialRoot;
|
|
215
|
+
try {
|
|
216
|
+
rootPath = realpathSync(root);
|
|
217
|
+
initialRoot = lstatSync(rootPath);
|
|
218
|
+
} catch {
|
|
219
|
+
throw new LocalFilePolicyError("local_file_invalid", "export\u5148root\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093");
|
|
220
|
+
}
|
|
221
|
+
if (initialRoot.isSymbolicLink() || !initialRoot.isDirectory() || !Number.isSafeInteger(initialRoot.dev) || !Number.isSafeInteger(initialRoot.ino) || initialRoot.ino === 0 || !Number.isSafeInteger(initialRoot.nlink) || initialRoot.nlink < 1 || !Number.isSafeInteger(initialRoot.uid) || typeof process.geteuid !== "function" || initialRoot.uid !== process.geteuid() || (initialRoot.mode & 18) !== 0) {
|
|
222
|
+
throw new LocalFilePolicyError(
|
|
223
|
+
"local_filesystem_unsafe",
|
|
224
|
+
"export\u5148root\u306Fcurrent user\u6240\u6709\u304B\u3064group/world\u975Ewritable\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
const rootIdentity = {
|
|
228
|
+
dev: initialRoot.dev,
|
|
229
|
+
ino: initialRoot.ino,
|
|
230
|
+
nlink: initialRoot.nlink,
|
|
231
|
+
uid: initialRoot.uid,
|
|
232
|
+
mode: initialRoot.mode & SECURITY_MODE_MASK
|
|
233
|
+
};
|
|
234
|
+
if (options.expectedRootIdentity && (options.expectedRootIdentity.dev !== rootIdentity.dev || options.expectedRootIdentity.ino !== rootIdentity.ino || options.expectedRootIdentity.nlink !== rootIdentity.nlink || options.expectedRootIdentity.uid !== rootIdentity.uid || options.expectedRootIdentity.mode !== rootIdentity.mode)) {
|
|
235
|
+
throw new LocalFilePolicyError("local_file_changed", "export\u5148root\u304C\u958B\u59CB\u6642\u304B\u3089\u5909\u5316\u3057\u307E\u3057\u305F");
|
|
236
|
+
}
|
|
237
|
+
const target = isAbsolute(path) ? resolve(realpathSync(dirname(path)), basename(path)) : resolve(rootPath, path);
|
|
238
|
+
if (dirname(target) !== rootPath || basename(target) === "." || basename(target) === "..") {
|
|
239
|
+
throw new LocalFilePolicyError(
|
|
240
|
+
"local_file_invalid",
|
|
241
|
+
"export file path \u306F project root \u76F4\u4E0B\u306B\u5FC5\u8981\u3067\u3059"
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
const noFollow = fsConstants.O_NOFOLLOW;
|
|
245
|
+
if (typeof noFollow !== "number" || noFollow <= 0) {
|
|
246
|
+
throw new LocalFilePolicyError(
|
|
247
|
+
"local_filesystem_unsafe",
|
|
248
|
+
"local filesystem \u304C safe open \u3092\u63D0\u4F9B\u3057\u3066\u3044\u307E\u305B\u3093"
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
const targetName = basename(target);
|
|
252
|
+
const temporaryName = `.andpipe-export-${randomUUID()}.tmp`;
|
|
253
|
+
const previousCwd = process.cwd();
|
|
254
|
+
const previousCwdIdentity = lstatSync(previousCwd);
|
|
255
|
+
let fd;
|
|
256
|
+
let linked = false;
|
|
257
|
+
let complete = false;
|
|
258
|
+
let writtenIdentity;
|
|
259
|
+
let failure;
|
|
260
|
+
let rootEntryNlinkDelta;
|
|
261
|
+
let didChdir = false;
|
|
262
|
+
let cwdRestoreFailed = false;
|
|
263
|
+
const assertRoot = (phase, includePath) => {
|
|
264
|
+
const current = lstatSync(".");
|
|
265
|
+
if (!current.isDirectory() || current.dev !== rootIdentity.dev || current.ino !== rootIdentity.ino || current.uid !== rootIdentity.uid || (current.mode & SECURITY_MODE_MASK) !== rootIdentity.mode) {
|
|
266
|
+
throw new LocalFilePolicyError("local_file_changed", `export\u5148root\u304C\u5909\u5316\u3057\u307E\u3057\u305F (${phase})`);
|
|
267
|
+
}
|
|
268
|
+
if (includePath) {
|
|
269
|
+
const claimed = lstatSync(rootPath);
|
|
270
|
+
if (!claimed.isDirectory() || claimed.dev !== rootIdentity.dev || claimed.ino !== rootIdentity.ino || claimed.uid !== rootIdentity.uid || (claimed.mode & SECURITY_MODE_MASK) !== rootIdentity.mode) {
|
|
271
|
+
throw new LocalFilePolicyError(
|
|
272
|
+
"local_file_changed",
|
|
273
|
+
`export\u5148root path\u304C\u5909\u5316\u3057\u307E\u3057\u305F (${phase})`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
const assertOwnedPath = (name, expectedNlink, phase) => {
|
|
279
|
+
if (!writtenIdentity) {
|
|
280
|
+
throw new LocalFilePolicyError("local_file_changed", `export file identity\u4E0D\u660E (${phase})`);
|
|
281
|
+
}
|
|
282
|
+
const current = lstatSync(name);
|
|
283
|
+
if (current.isSymbolicLink() || !current.isFile() || current.dev !== writtenIdentity.dev || current.ino !== writtenIdentity.ino || current.nlink !== expectedNlink || current.uid !== rootIdentity.uid || current.size !== bytes.byteLength || (current.mode & SECURITY_MODE_MASK) !== 384) {
|
|
284
|
+
throw new LocalFilePolicyError("local_file_changed", `export file\u304C\u5909\u5316\u3057\u307E\u3057\u305F (${phase})`);
|
|
285
|
+
}
|
|
286
|
+
return current;
|
|
287
|
+
};
|
|
288
|
+
const fsyncDirectory = () => {
|
|
289
|
+
const directoryFd = openSync(
|
|
290
|
+
".",
|
|
291
|
+
fsConstants.O_RDONLY | (typeof fsConstants.O_DIRECTORY === "number" ? fsConstants.O_DIRECTORY : 0)
|
|
292
|
+
);
|
|
293
|
+
try {
|
|
294
|
+
fsyncSync(directoryFd);
|
|
295
|
+
} finally {
|
|
296
|
+
closeSync(directoryFd);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
try {
|
|
300
|
+
if (lstatSync(".").dev !== rootIdentity.dev || lstatSync(".").ino !== rootIdentity.ino) {
|
|
301
|
+
process.chdir(rootPath);
|
|
302
|
+
didChdir = true;
|
|
303
|
+
}
|
|
304
|
+
assertRoot("anchor", true);
|
|
305
|
+
fd = openSync(
|
|
306
|
+
temporaryName,
|
|
307
|
+
fsConstants.O_RDWR | fsConstants.O_CREAT | fsConstants.O_EXCL | noFollow,
|
|
308
|
+
384
|
|
309
|
+
);
|
|
310
|
+
const opened = fstatSync(fd);
|
|
311
|
+
if (!opened.isFile() || opened.nlink !== 1 || opened.uid !== rootIdentity.uid || (opened.mode & 18) !== 0) {
|
|
312
|
+
throw new LocalFilePolicyError("local_file_changed", "export temp file identity\u304C\u4E0D\u6B63\u3067\u3059");
|
|
313
|
+
}
|
|
314
|
+
writtenIdentity = { dev: opened.dev, ino: opened.ino };
|
|
315
|
+
options.filesystemCheckpoint?.("private_temp_opened");
|
|
316
|
+
fchmodSync(fd, 384);
|
|
317
|
+
let offset = 0;
|
|
318
|
+
while (offset < bytes.byteLength) {
|
|
319
|
+
const count = writeSync(fd, bytes, offset, bytes.byteLength - offset, null);
|
|
320
|
+
if (count < 1) {
|
|
321
|
+
throw new LocalFilePolicyError("local_file_invalid", "export file\u3092\u66F8\u304D\u8FBC\u3081\u307E\u305B\u3093");
|
|
322
|
+
}
|
|
323
|
+
offset += count;
|
|
324
|
+
}
|
|
325
|
+
fsyncSync(fd);
|
|
326
|
+
const written = fstatSync(fd);
|
|
327
|
+
if (!written.isFile() || written.nlink !== 1 || written.size !== bytes.byteLength || written.uid !== rootIdentity.uid || (written.mode & SECURITY_MODE_MASK) !== 384) {
|
|
328
|
+
throw new LocalFilePolicyError("local_file_changed", "export file\u306Eidentity\u304C\u5909\u5316\u3057\u307E\u3057\u305F");
|
|
329
|
+
}
|
|
330
|
+
assertOwnedPath(temporaryName, 1, "temp fsync");
|
|
331
|
+
assertRoot("link before", true);
|
|
332
|
+
linkSync(temporaryName, targetName);
|
|
333
|
+
linked = true;
|
|
334
|
+
options.filesystemCheckpoint?.("private_linked");
|
|
335
|
+
assertOpenFileBytesExact(fd, bytes, "private link checkpoint");
|
|
336
|
+
const linkedFd = fstatSync(fd);
|
|
337
|
+
if (linkedFd.dev !== writtenIdentity.dev || linkedFd.ino !== writtenIdentity.ino || linkedFd.nlink !== 2) {
|
|
338
|
+
throw new LocalFilePolicyError("local_file_changed", "export file link identity\u304C\u4E0D\u6B63\u3067\u3059");
|
|
339
|
+
}
|
|
340
|
+
assertOwnedPath(temporaryName, 2, "temp after link");
|
|
341
|
+
assertOwnedPath(targetName, 2, "target after link");
|
|
342
|
+
assertRoot("link after", true);
|
|
343
|
+
fsyncDirectory();
|
|
344
|
+
assertOwnedPath(temporaryName, 2, "temp after directory fsync");
|
|
345
|
+
assertOwnedPath(targetName, 2, "target after directory fsync");
|
|
346
|
+
unlinkSync(temporaryName);
|
|
347
|
+
assertOwnedPath(targetName, 1, "target after temp unlink");
|
|
348
|
+
fsyncDirectory();
|
|
349
|
+
assertOwnedPath(targetName, 1, "target final");
|
|
350
|
+
fsyncSync(fd);
|
|
351
|
+
assertOpenFileBytesExact(fd, bytes, "private final");
|
|
352
|
+
assertRoot("complete", true);
|
|
353
|
+
const finalRoot = lstatSync(".");
|
|
354
|
+
const observedDelta = finalRoot.nlink - rootIdentity.nlink;
|
|
355
|
+
if (observedDelta !== 0 && observedDelta !== 1) {
|
|
356
|
+
throw new LocalFilePolicyError(
|
|
357
|
+
"local_file_changed",
|
|
358
|
+
"export\u5148root entry count\u304C\u4E88\u671F\u305B\u305A\u5909\u5316\u3057\u307E\u3057\u305F"
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
rootEntryNlinkDelta = observedDelta;
|
|
362
|
+
complete = true;
|
|
363
|
+
} catch (error) {
|
|
364
|
+
failure = error;
|
|
365
|
+
} finally {
|
|
366
|
+
let cleanupMutated = false;
|
|
367
|
+
if (!complete && writtenIdentity) {
|
|
368
|
+
if (linked) {
|
|
369
|
+
try {
|
|
370
|
+
const current = lstatSync(targetName);
|
|
371
|
+
if (current.dev === writtenIdentity.dev && current.ino === writtenIdentity.ino) {
|
|
372
|
+
unlinkSync(targetName);
|
|
373
|
+
cleanupMutated = true;
|
|
374
|
+
}
|
|
375
|
+
} catch (error) {
|
|
376
|
+
if (error.code !== "ENOENT") failure ??= error;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
try {
|
|
380
|
+
const current = lstatSync(temporaryName);
|
|
381
|
+
if (current.dev === writtenIdentity.dev && current.ino === writtenIdentity.ino) {
|
|
382
|
+
unlinkSync(temporaryName);
|
|
383
|
+
cleanupMutated = true;
|
|
384
|
+
}
|
|
385
|
+
} catch (error) {
|
|
386
|
+
if (error.code !== "ENOENT") failure ??= error;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (cleanupMutated) {
|
|
390
|
+
try {
|
|
391
|
+
fsyncDirectory();
|
|
392
|
+
} catch (error) {
|
|
393
|
+
failure ??= error;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (fd !== void 0) {
|
|
397
|
+
try {
|
|
398
|
+
closeSync(fd);
|
|
399
|
+
} catch (error) {
|
|
400
|
+
failure ??= error;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
if (didChdir) {
|
|
404
|
+
try {
|
|
405
|
+
process.chdir(previousCwd);
|
|
406
|
+
const restored = lstatSync(".");
|
|
407
|
+
if (restored.dev !== previousCwdIdentity.dev || restored.ino !== previousCwdIdentity.ino) {
|
|
408
|
+
cwdRestoreFailed = true;
|
|
409
|
+
}
|
|
410
|
+
} catch {
|
|
411
|
+
cwdRestoreFailed = true;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (cwdRestoreFailed) {
|
|
416
|
+
throw new LocalFilePolicyError(
|
|
417
|
+
"local_filesystem_unsafe",
|
|
418
|
+
"\u4F5C\u696Ddirectory\u3092\u5B89\u5168\u306B\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
if (failure !== void 0) {
|
|
422
|
+
if (failure instanceof LocalFilePolicyError) throw failure;
|
|
423
|
+
throw new LocalFilePolicyError(
|
|
424
|
+
"local_file_invalid",
|
|
425
|
+
"export\u5148\u304C\u65E2\u306B\u5B58\u5728\u3059\u308B\u304B\u3001\u5B89\u5168\u306B\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
if (rootEntryNlinkDelta === void 0) {
|
|
429
|
+
throw new LocalFilePolicyError("local_file_changed", "export\u5148root\u306E\u78BA\u5B9A\u72B6\u614B\u304C\u4E0D\u660E\u3067\u3059");
|
|
430
|
+
}
|
|
431
|
+
return rootEntryNlinkDelta;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// src/lib/dev-artifact.ts
|
|
435
|
+
function currentUid() {
|
|
436
|
+
return typeof process.getuid === "function" ? process.getuid() : void 0;
|
|
437
|
+
}
|
|
438
|
+
function assertOwnedMode(path, expectedMode, kind) {
|
|
439
|
+
const stat = lstatSync2(path);
|
|
440
|
+
const uid = currentUid();
|
|
441
|
+
if ((kind === "directory" ? !stat.isDirectory() : !stat.isFile()) || stat.isSymbolicLink() || uid !== void 0 && stat.uid !== uid || (stat.mode & 511) !== expectedMode) {
|
|
442
|
+
throw new LocalFilePolicyError(
|
|
443
|
+
"local_filesystem_unsafe",
|
|
444
|
+
`dev session ${kind} \u306Eowner/mode\u3092\u5B89\u5168\u306B\u78BA\u5B9A\u3067\u304D\u307E\u305B\u3093`
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
function prepareDevArtifact() {
|
|
449
|
+
const directory = mkdtempSync(join(tmpdir(), "andpipe-dev-"));
|
|
450
|
+
try {
|
|
451
|
+
chmodSync(directory, 448);
|
|
452
|
+
assertOwnedMode(directory, 448, "directory");
|
|
453
|
+
return { directory, path: join(directory, "session.json") };
|
|
454
|
+
} catch (error) {
|
|
455
|
+
try {
|
|
456
|
+
rmdirSync(directory);
|
|
457
|
+
} catch {
|
|
458
|
+
}
|
|
459
|
+
throw error;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function createDevArtifact(plan, value) {
|
|
463
|
+
const noFollow = fsConstants2.O_NOFOLLOW;
|
|
464
|
+
if (typeof noFollow !== "number" || noFollow <= 0) {
|
|
465
|
+
throw new LocalFilePolicyError(
|
|
466
|
+
"local_filesystem_unsafe",
|
|
467
|
+
"artifact filesystem \u304CO_NOFOLLOW\u3092\u63D0\u4F9B\u3057\u3066\u3044\u307E\u305B\u3093"
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
assertOwnedMode(plan.directory, 448, "directory");
|
|
471
|
+
const bytes = Buffer.from(JSON.stringify(value), "utf8");
|
|
472
|
+
let fd;
|
|
473
|
+
try {
|
|
474
|
+
fd = openSync2(
|
|
475
|
+
plan.path,
|
|
476
|
+
fsConstants2.O_WRONLY | fsConstants2.O_CREAT | fsConstants2.O_EXCL | noFollow,
|
|
477
|
+
384
|
|
478
|
+
);
|
|
479
|
+
let offset = 0;
|
|
480
|
+
while (offset < bytes.byteLength) {
|
|
481
|
+
offset += writeSync2(fd, bytes, offset, bytes.byteLength - offset);
|
|
482
|
+
}
|
|
483
|
+
fsyncSync2(fd);
|
|
484
|
+
} catch (error) {
|
|
485
|
+
if (error instanceof LocalFilePolicyError) throw error;
|
|
486
|
+
throw new LocalFilePolicyError(
|
|
487
|
+
"local_filesystem_unsafe",
|
|
488
|
+
"dev session artifact\u3092no-replace\u3067\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"
|
|
489
|
+
);
|
|
490
|
+
} finally {
|
|
491
|
+
if (fd !== void 0) closeSync2(fd);
|
|
492
|
+
}
|
|
493
|
+
try {
|
|
494
|
+
assertOwnedMode(plan.path, 384, "file");
|
|
495
|
+
} catch (error) {
|
|
496
|
+
removeDevArtifact(plan);
|
|
497
|
+
throw error;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function removeDevArtifact(plan) {
|
|
501
|
+
let failure;
|
|
502
|
+
try {
|
|
503
|
+
unlinkSync2(plan.path);
|
|
504
|
+
} catch (error) {
|
|
505
|
+
if (error.code !== "ENOENT") failure = error;
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
rmdirSync(plan.directory);
|
|
509
|
+
} catch (error) {
|
|
510
|
+
if (error.code !== "ENOENT" && failure === void 0)
|
|
511
|
+
failure = error;
|
|
512
|
+
}
|
|
513
|
+
if (failure !== void 0) throw failure;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// src/lib/dev-tunnel.ts
|
|
517
|
+
import { fork as nodeFork, spawn as nodeSpawn } from "child_process";
|
|
518
|
+
import { realpathSync as realpathSync2 } from "fs";
|
|
519
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
520
|
+
var QUICK_TUNNEL_PROVIDER = "cloudflare-quick";
|
|
521
|
+
var MAX_QUICK_TUNNEL_OUTPUT_BYTES = 64 * 1024;
|
|
522
|
+
var QUICK_TUNNEL_DISCOVERY_TIMEOUT_MS = 3e4;
|
|
523
|
+
var PROCESS_TERM_TIMEOUT_MS = 5e3;
|
|
524
|
+
var PROCESS_KILL_TIMEOUT_MS = 5e3;
|
|
525
|
+
var QUICK_TUNNEL_HOST = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.trycloudflare\.com$/u;
|
|
526
|
+
function parseQuickTunnelOrigin(output) {
|
|
527
|
+
const candidates = output.match(/https?:\/\/[^\s"'<>]+/giu) ?? [];
|
|
528
|
+
const relevant = candidates.filter(
|
|
529
|
+
(candidate) => candidate.toLowerCase().includes("trycloudflare")
|
|
530
|
+
);
|
|
531
|
+
const origins = /* @__PURE__ */ new Set();
|
|
532
|
+
for (const candidate of relevant) {
|
|
533
|
+
let url;
|
|
534
|
+
try {
|
|
535
|
+
url = new URL(candidate);
|
|
536
|
+
} catch {
|
|
537
|
+
throw new Error("Quick Tunnel URL\u304C\u4E0D\u6B63\u3067\u3059");
|
|
538
|
+
}
|
|
539
|
+
if (url.protocol !== "https:" || !QUICK_TUNNEL_HOST.test(url.hostname) || url.username !== "" || url.password !== "" || url.port !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "" || url.origin !== candidate) {
|
|
540
|
+
throw new Error("Quick Tunnel URL\u304Cexact origin\u3067\u306F\u3042\u308A\u307E\u305B\u3093");
|
|
541
|
+
}
|
|
542
|
+
origins.add(url.origin);
|
|
543
|
+
}
|
|
544
|
+
if (origins.size > 1) throw new Error("Quick Tunnel URL\u304C\u8907\u6570\u691C\u51FA\u3055\u308C\u307E\u3057\u305F");
|
|
545
|
+
return origins.values().next().value;
|
|
546
|
+
}
|
|
547
|
+
var defaultProcessGroupRuntime = {
|
|
548
|
+
killGroup(pgid, signal) {
|
|
549
|
+
process.kill(-pgid, signal);
|
|
550
|
+
},
|
|
551
|
+
groupExists(pgid) {
|
|
552
|
+
try {
|
|
553
|
+
process.kill(-pgid, 0);
|
|
554
|
+
return true;
|
|
555
|
+
} catch (error) {
|
|
556
|
+
return error.code === "EPERM";
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
sleep: (milliseconds) => new Promise((resolve2) => {
|
|
560
|
+
setTimeout(resolve2, milliseconds).unref();
|
|
561
|
+
})
|
|
562
|
+
};
|
|
563
|
+
async function terminateKnownProcessGroup(pgid, runtime = defaultProcessGroupRuntime) {
|
|
564
|
+
if (!Number.isSafeInteger(pgid) || pgid <= 1) throw new Error("invalid supervisor process group");
|
|
565
|
+
if (!runtime.groupExists(pgid)) return;
|
|
566
|
+
try {
|
|
567
|
+
runtime.killGroup(pgid, "SIGTERM");
|
|
568
|
+
} catch (error) {
|
|
569
|
+
if (error.code !== "ESRCH") throw error;
|
|
570
|
+
}
|
|
571
|
+
await runtime.sleep(PROCESS_TERM_TIMEOUT_MS);
|
|
572
|
+
if (!runtime.groupExists(pgid)) return;
|
|
573
|
+
try {
|
|
574
|
+
runtime.killGroup(pgid, "SIGKILL");
|
|
575
|
+
} catch (error) {
|
|
576
|
+
if (error.code !== "ESRCH") throw error;
|
|
577
|
+
}
|
|
578
|
+
await runtime.sleep(PROCESS_KILL_TIMEOUT_MS);
|
|
579
|
+
if (runtime.groupExists(pgid)) throw new Error("supervisor process group did not exit");
|
|
580
|
+
}
|
|
581
|
+
var defaultParentTunnelRuntime = {
|
|
582
|
+
...defaultProcessGroupRuntime,
|
|
583
|
+
forkSupervisor(modulePath, args, options) {
|
|
584
|
+
return nodeFork(modulePath, [...args], {
|
|
585
|
+
detached: options.detached,
|
|
586
|
+
execArgv: [...options.execArgv],
|
|
587
|
+
stdio: [...options.stdio]
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
function supervisorEntryPath() {
|
|
592
|
+
const mainModule = process.argv[1];
|
|
593
|
+
if (!mainModule) throw new Error("CLI main module path\u3092\u78BA\u5B9A\u3067\u304D\u307E\u305B\u3093");
|
|
594
|
+
return join2(dirname2(realpathSync2(mainModule)), "dev-supervisor.js");
|
|
595
|
+
}
|
|
596
|
+
async function startCloudflareQuickTunnel(input, runtime = defaultParentTunnelRuntime) {
|
|
597
|
+
const child = runtime.forkSupervisor(
|
|
598
|
+
supervisorEntryPath(),
|
|
599
|
+
[input.artifactPath, input.localOrigin, String(input.deadline)],
|
|
600
|
+
{
|
|
601
|
+
detached: true,
|
|
602
|
+
execArgv: [],
|
|
603
|
+
stdio: ["ignore", "ignore", "ignore", "ipc"]
|
|
604
|
+
}
|
|
605
|
+
);
|
|
606
|
+
const pgid = child.pid;
|
|
607
|
+
if (!Number.isSafeInteger(pgid) || pgid <= 1) {
|
|
608
|
+
throw new Error("supervisor PID\u3092\u78BA\u5B9A\u3067\u304D\u307E\u305B\u3093");
|
|
609
|
+
}
|
|
610
|
+
const exited = new Promise((resolve2) => {
|
|
611
|
+
child.once("exit", (code, signal) => resolve2({ code, signal }));
|
|
612
|
+
});
|
|
613
|
+
const ready = new Promise((resolve2, reject) => {
|
|
614
|
+
child.once("error", reject);
|
|
615
|
+
child.on("message", (message) => {
|
|
616
|
+
if (message !== null && typeof message === "object" && message.type === "ready" && typeof message.publicOrigin === "string") {
|
|
617
|
+
try {
|
|
618
|
+
const origin = parseQuickTunnelOrigin(
|
|
619
|
+
message.publicOrigin
|
|
620
|
+
);
|
|
621
|
+
if (!origin) throw new Error("Quick Tunnel URL\u304C\u3042\u308A\u307E\u305B\u3093");
|
|
622
|
+
resolve2(origin);
|
|
623
|
+
} catch (error) {
|
|
624
|
+
reject(error);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
void exited.then(
|
|
629
|
+
({ code, signal }) => reject(
|
|
630
|
+
new Error(`Quick Tunnel supervisor exited before ready (${code ?? signal ?? "unknown"})`)
|
|
631
|
+
)
|
|
632
|
+
);
|
|
633
|
+
});
|
|
634
|
+
let publicOrigin;
|
|
635
|
+
try {
|
|
636
|
+
publicOrigin = await Promise.race([
|
|
637
|
+
ready,
|
|
638
|
+
input.cancel.then(() => Promise.reject(new Error("Quick Tunnel startup cancelled"))),
|
|
639
|
+
runtime.sleep(QUICK_TUNNEL_DISCOVERY_TIMEOUT_MS + 1e3).then(() => Promise.reject(new Error("Quick Tunnel URL discovery timed out")))
|
|
640
|
+
]);
|
|
641
|
+
} catch (error) {
|
|
642
|
+
await terminateKnownProcessGroup(pgid, runtime);
|
|
643
|
+
throw error;
|
|
644
|
+
}
|
|
645
|
+
let stopping;
|
|
646
|
+
return {
|
|
647
|
+
publicOrigin,
|
|
648
|
+
publicEndpoint: `${publicOrigin}/mcp`,
|
|
649
|
+
pgid,
|
|
650
|
+
exited,
|
|
651
|
+
stop() {
|
|
652
|
+
stopping ??= (async () => {
|
|
653
|
+
try {
|
|
654
|
+
if (child.connected) child.send({ type: "stop" });
|
|
655
|
+
} catch (error) {
|
|
656
|
+
await terminateKnownProcessGroup(pgid, runtime);
|
|
657
|
+
throw error;
|
|
658
|
+
}
|
|
659
|
+
const result = await Promise.race([
|
|
660
|
+
exited.then((value) => ({ kind: "exit", value })),
|
|
661
|
+
runtime.sleep(PROCESS_TERM_TIMEOUT_MS + PROCESS_KILL_TIMEOUT_MS + 1e3).then(() => ({ kind: "timeout" }))
|
|
662
|
+
]);
|
|
663
|
+
if (result.kind === "timeout") {
|
|
664
|
+
await terminateKnownProcessGroup(pgid, runtime);
|
|
665
|
+
throw new Error("Quick Tunnel supervisor cleanup timed out");
|
|
666
|
+
}
|
|
667
|
+
if (result.value.code !== 0) {
|
|
668
|
+
await terminateKnownProcessGroup(pgid, runtime);
|
|
669
|
+
throw new Error("Quick Tunnel supervisor cleanup failed");
|
|
670
|
+
}
|
|
671
|
+
})();
|
|
672
|
+
return stopping;
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
var defaultSupervisorRuntime = {
|
|
677
|
+
spawn(file, args, options) {
|
|
678
|
+
return nodeSpawn(file, [...args], {
|
|
679
|
+
shell: options.shell,
|
|
680
|
+
detached: options.detached,
|
|
681
|
+
stdio: [...options.stdio]
|
|
682
|
+
});
|
|
683
|
+
},
|
|
684
|
+
sleep: defaultProcessGroupRuntime.sleep
|
|
685
|
+
};
|
|
686
|
+
function spawnCloudflared(localOrigin, runtime = defaultSupervisorRuntime) {
|
|
687
|
+
return runtime.spawn("cloudflared", ["tunnel", "--url", localOrigin], {
|
|
688
|
+
shell: false,
|
|
689
|
+
detached: false,
|
|
690
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
async function discoverQuickTunnelOrigin(child, runtime) {
|
|
694
|
+
let output = Buffer.alloc(0);
|
|
695
|
+
let settled = false;
|
|
696
|
+
return new Promise((resolve2, reject) => {
|
|
697
|
+
const finish = (error, origin) => {
|
|
698
|
+
if (settled) return;
|
|
699
|
+
settled = true;
|
|
700
|
+
error ? reject(error) : resolve2(origin);
|
|
701
|
+
};
|
|
702
|
+
const append = (chunk) => {
|
|
703
|
+
if (settled) return;
|
|
704
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk), "utf8");
|
|
705
|
+
if (output.byteLength + bytes.byteLength > MAX_QUICK_TUNNEL_OUTPUT_BYTES) {
|
|
706
|
+
finish(new Error("Quick Tunnel output limit exceeded"));
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
output = Buffer.concat([output, bytes]);
|
|
710
|
+
try {
|
|
711
|
+
const origin = parseQuickTunnelOrigin(output.toString("utf8"));
|
|
712
|
+
if (origin) finish(void 0, origin);
|
|
713
|
+
} catch (error) {
|
|
714
|
+
finish(error);
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
child.stdout?.on("data", append);
|
|
718
|
+
child.stderr?.on("data", append);
|
|
719
|
+
child.once("error", (error) => finish(error));
|
|
720
|
+
child.once(
|
|
721
|
+
"exit",
|
|
722
|
+
(code, signal) => finish(new Error(`cloudflared exited before ready (${code ?? signal ?? "unknown"})`))
|
|
723
|
+
);
|
|
724
|
+
void runtime.sleep(QUICK_TUNNEL_DISCOVERY_TIMEOUT_MS).then(() => finish(new Error("Quick Tunnel URL discovery timed out")));
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
async function stopTunnelChild(child, exited, runtime) {
|
|
728
|
+
child.kill("SIGTERM");
|
|
729
|
+
const term = await Promise.race([
|
|
730
|
+
exited.then(() => true),
|
|
731
|
+
runtime.sleep(PROCESS_TERM_TIMEOUT_MS).then(() => false)
|
|
732
|
+
]);
|
|
733
|
+
if (term) return;
|
|
734
|
+
child.kill("SIGKILL");
|
|
735
|
+
const killed = await Promise.race([
|
|
736
|
+
exited.then(() => true),
|
|
737
|
+
runtime.sleep(PROCESS_KILL_TIMEOUT_MS).then(() => false)
|
|
738
|
+
]);
|
|
739
|
+
if (!killed) throw new Error("cloudflared did not exit after SIGKILL");
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export {
|
|
743
|
+
LocalFilePolicyError,
|
|
744
|
+
readBoundedLocalFileSnapshot,
|
|
745
|
+
readBoundedLocalFile,
|
|
746
|
+
assertOpenFileBytesExact,
|
|
747
|
+
resolveDirectChild,
|
|
748
|
+
writePrivateFileNoReplace,
|
|
749
|
+
prepareDevArtifact,
|
|
750
|
+
createDevArtifact,
|
|
751
|
+
removeDevArtifact,
|
|
752
|
+
QUICK_TUNNEL_PROVIDER,
|
|
753
|
+
startCloudflareQuickTunnel,
|
|
754
|
+
defaultSupervisorRuntime,
|
|
755
|
+
spawnCloudflared,
|
|
756
|
+
discoverQuickTunnelOrigin,
|
|
757
|
+
stopTunnelChild
|
|
758
|
+
};
|