@tsplc/agent 0.2.21 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.js +367 -152
- package/dist/cli.js.map +16 -15
- package/dist/client.js +121 -20
- package/dist/client.js.map +6 -5
- package/dist/index.js +352 -144
- package/dist/index.js.map +14 -13
- package/package.json +16 -6
- package/src/agent.ts +94 -54
- package/src/cli.ts +12 -5
- package/src/client.ts +114 -23
- package/src/codesys.ts +23 -24
- package/src/debugging.ts +8 -2
- package/src/deploy.ts +141 -125
- package/src/index.ts +4 -4
- package/src/login.ts +8 -5
- package/src/operations.ts +11 -6
- package/src/protocol.ts +91 -4
- package/src/releases.ts +219 -11
- package/src/secrets.ts +3 -2
- package/src/server-process.ts +1 -1
- package/src/transfer.ts +94 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { timingSafeEqual } from "node:crypto";
|
|
3
3
|
import { join as join7 } from "node:path";
|
|
4
4
|
import { loginCommandSchema } from "@tsplc/build";
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z3 } from "zod";
|
|
6
6
|
|
|
7
7
|
// packages/agent/src/debugging.ts
|
|
8
8
|
import { existsSync as existsSync3 } from "node:fs";
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
loadManifest,
|
|
15
15
|
timelineEntries
|
|
16
16
|
} from "@tsplc/debug";
|
|
17
|
+
import { debugManifestFile } from "@tsplc/debug/manifest";
|
|
17
18
|
|
|
18
19
|
// packages/agent/src/errors.ts
|
|
19
20
|
class AgentError extends Error {
|
|
@@ -65,9 +66,15 @@ var readJsonl = async (file, schema, limit) => {
|
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
// packages/agent/src/protocol.ts
|
|
69
|
+
import { rollbackSchema } from "@tsplc/build";
|
|
68
70
|
import { tsplcConfigSchema } from "@tsplc/config";
|
|
69
|
-
import { tcpPort } from "@tsplc/config/build";
|
|
71
|
+
import { releaseConfigSchema, tcpPort } from "@tsplc/config/build";
|
|
70
72
|
import { z } from "zod";
|
|
73
|
+
// packages/agent/package.json
|
|
74
|
+
var version = "0.4.0";
|
|
75
|
+
|
|
76
|
+
// packages/agent/src/protocol.ts
|
|
77
|
+
var tsplcVersion = version;
|
|
71
78
|
var targetSchema = z.strictObject({
|
|
72
79
|
host: z.string().nonempty(),
|
|
73
80
|
port: tcpPort
|
|
@@ -92,7 +99,15 @@ var variableSchema = z.strictObject({
|
|
|
92
99
|
type: z.string()
|
|
93
100
|
});
|
|
94
101
|
var releaseManifestSchema = z.strictObject({
|
|
95
|
-
config: z.record(z.string(), z.unknown()),
|
|
102
|
+
config: z.record(z.string(), z.unknown()).superRefine((config, context) => {
|
|
103
|
+
const release = releaseConfigSchema.safeParse(config);
|
|
104
|
+
if (!release.success) {
|
|
105
|
+
context.addIssue({
|
|
106
|
+
code: "custom",
|
|
107
|
+
message: `Invalid release config: ${z.prettifyError(release.error)}`
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}),
|
|
96
111
|
variables: z.array(variableSchema),
|
|
97
112
|
server: z.string().nonempty().optional(),
|
|
98
113
|
debug: tsplcConfigSchema.shape.debug,
|
|
@@ -105,13 +120,34 @@ var deployOptionsSchema = z.strictObject({
|
|
|
105
120
|
download: z.boolean(),
|
|
106
121
|
initializeUser: z.boolean()
|
|
107
122
|
}).refine((options) => options.credentials || !options.initializeUser, "Initializing the controller's user needs the user's credentials.");
|
|
123
|
+
var releaseBuckets = 256;
|
|
124
|
+
var shortHex = z.string().regex(/^[a-f0-9]{16}$/);
|
|
125
|
+
var compareRequestSchema = z.strictObject({
|
|
126
|
+
buckets: z.array(shortHex).length(releaseBuckets)
|
|
127
|
+
});
|
|
128
|
+
var comparisonSchema = z.strictObject({
|
|
129
|
+
base: shortHex.nullable(),
|
|
130
|
+
changed: z.array(z.strictObject({
|
|
131
|
+
bucket: z.number().int().min(0).max(releaseBuckets - 1),
|
|
132
|
+
files: z.record(z.string(), shortHex)
|
|
133
|
+
}))
|
|
134
|
+
});
|
|
135
|
+
var releaseUploadType = "application/vnd.tsplc.release+zstd";
|
|
136
|
+
var releaseUploadSchema = z.strictObject({
|
|
137
|
+
manifest: releaseManifestSchema,
|
|
138
|
+
options: deployOptionsSchema,
|
|
139
|
+
base: shortHex.nullable(),
|
|
140
|
+
buckets: compareRequestSchema.shape.buckets,
|
|
141
|
+
remove: z.array(z.string())
|
|
142
|
+
});
|
|
108
143
|
var eventSchema = z.discriminatedUnion("kind", [
|
|
109
144
|
z.strictObject({ kind: z.literal("progress"), message: z.string() }),
|
|
110
145
|
z.strictObject({ kind: z.literal("done"), result: z.unknown() }),
|
|
111
146
|
z.strictObject({
|
|
112
147
|
kind: z.literal("error"),
|
|
113
148
|
message: z.string(),
|
|
114
|
-
downloadRequired: z.boolean()
|
|
149
|
+
downloadRequired: z.boolean(),
|
|
150
|
+
rollback: rollbackSchema.optional()
|
|
115
151
|
})
|
|
116
152
|
]);
|
|
117
153
|
var errorSchema = z.object({ error: z.string() });
|
|
@@ -136,12 +172,20 @@ var statusSchema = z.strictObject({
|
|
|
136
172
|
var logoutSchema = z.strictObject({ failure: z.string().optional() });
|
|
137
173
|
var clientHeaders = {
|
|
138
174
|
user: "x-tsplc-user",
|
|
139
|
-
host: "x-tsplc-host"
|
|
175
|
+
host: "x-tsplc-host",
|
|
176
|
+
version: "x-tsplc-version",
|
|
177
|
+
scripts: "x-tsplc-scripts"
|
|
140
178
|
};
|
|
179
|
+
var agentVersionHeader = "x-tsplc-agent-version";
|
|
180
|
+
var versionMismatch = (versions) => `The plant agent runs ${versions.agent ? `tsPLC ${versions.agent}` : "a tsPLC older than 0.3.0"}, but this deployment comes from tsPLC ${versions.client}. A release is compiled by the agent's own CODESYS scripts, so the two must match: update the plant agent to ${versions.client} and run tsplc-agent setup there${versions.agent ? `, or deploy with tsPLC ${versions.agent}` : ""}`;
|
|
141
181
|
var clientIdentity = (request) => {
|
|
142
182
|
const header = (name) => request.headers.get(name)?.slice(0, 200) || undefined;
|
|
143
183
|
return { user: header(clientHeaders.user), host: header(clientHeaders.host) };
|
|
144
184
|
};
|
|
185
|
+
var clientRelease = (request) => ({
|
|
186
|
+
version: request.headers.get(clientHeaders.version)?.slice(0, 50) || undefined,
|
|
187
|
+
scripts: request.headers.get(clientHeaders.scripts)?.slice(0, 100) || undefined
|
|
188
|
+
});
|
|
145
189
|
var deploymentSchema = z.strictObject({
|
|
146
190
|
at: z.iso.datetime(),
|
|
147
191
|
release: z.string(),
|
|
@@ -163,44 +207,112 @@ var auditSchema = z.strictObject({
|
|
|
163
207
|
});
|
|
164
208
|
|
|
165
209
|
// packages/agent/src/releases.ts
|
|
166
|
-
import { createHash } from "node:crypto";
|
|
210
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
167
211
|
import { existsSync as existsSync2 } from "node:fs";
|
|
168
212
|
import {
|
|
169
213
|
mkdir,
|
|
170
214
|
mkdtemp,
|
|
215
|
+
readdir,
|
|
171
216
|
readFile as readFile2,
|
|
172
217
|
rename as rename2,
|
|
173
218
|
rm,
|
|
219
|
+
stat as stat2,
|
|
174
220
|
writeFile
|
|
175
221
|
} from "node:fs/promises";
|
|
176
|
-
import { dirname, join, posix } from "node:path";
|
|
222
|
+
import { dirname, join, posix, sep } from "node:path";
|
|
177
223
|
import { z as z2 } from "zod";
|
|
224
|
+
|
|
225
|
+
// packages/agent/src/transfer.ts
|
|
226
|
+
import { createHash } from "node:crypto";
|
|
227
|
+
var shortDigest = (data) => createHash("sha256").update(data).digest("hex").slice(0, 16);
|
|
228
|
+
var fileBucket = (path) => createHash("sha256").update(path).digest().readUInt8(0) % releaseBuckets;
|
|
229
|
+
var bucketDigests = (files) => {
|
|
230
|
+
const buckets = Array.from({ length: releaseBuckets }, () => []);
|
|
231
|
+
for (const { path, digest } of files) {
|
|
232
|
+
buckets[fileBucket(path)]?.push(`${path}\x00${digest}`);
|
|
233
|
+
}
|
|
234
|
+
return buckets.map((entries) => shortDigest(entries.sort().join(`
|
|
235
|
+
`)));
|
|
236
|
+
};
|
|
237
|
+
var lengthBytes = 4;
|
|
238
|
+
var decodeUpload = async (compressed) => {
|
|
239
|
+
const body = new Uint8Array(await Bun.zstdDecompress(compressed));
|
|
240
|
+
const view = new DataView(body.buffer, body.byteOffset, body.byteLength);
|
|
241
|
+
const frames = [];
|
|
242
|
+
let offset = 0;
|
|
243
|
+
while (offset < body.length) {
|
|
244
|
+
if (offset + lengthBytes > body.length) {
|
|
245
|
+
throw new Error("The release upload ends inside a frame");
|
|
246
|
+
}
|
|
247
|
+
const end = offset + lengthBytes + view.getUint32(offset);
|
|
248
|
+
if (end > body.length) {
|
|
249
|
+
throw new Error("The release upload ends inside a frame");
|
|
250
|
+
}
|
|
251
|
+
frames.push(body.subarray(offset + lengthBytes, end));
|
|
252
|
+
offset = end;
|
|
253
|
+
}
|
|
254
|
+
const [header, ...rest] = frames;
|
|
255
|
+
if (!header || rest.length % 2 !== 0) {
|
|
256
|
+
throw new Error("The release upload has no header or a file without content");
|
|
257
|
+
}
|
|
258
|
+
const decoder = new TextDecoder;
|
|
259
|
+
const files = Array.from({ length: rest.length / 2 }, (_, index) => ({
|
|
260
|
+
path: decoder.decode(rest[2 * index]),
|
|
261
|
+
content: rest[2 * index + 1] ?? new Uint8Array
|
|
262
|
+
}));
|
|
263
|
+
return { header: JSON.parse(decoder.decode(header)), files };
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// packages/agent/src/releases.ts
|
|
178
267
|
var filePrefix = "files/";
|
|
179
268
|
var releasePath = (name) => {
|
|
180
|
-
const path = posix.normalize(name
|
|
269
|
+
const path = posix.normalize(name);
|
|
181
270
|
if (posix.isAbsolute(path) || path.startsWith("..") || path.includes("\\")) {
|
|
182
271
|
throw new Error(`Invalid release file name: ${name}`);
|
|
183
272
|
}
|
|
184
273
|
return path;
|
|
185
274
|
};
|
|
275
|
+
var checkServer = ({ manifest, files }) => {
|
|
276
|
+
if (manifest.server && !files.some((file) => file.path === manifest.server)) {
|
|
277
|
+
throw new Error(`The release names a server ${manifest.server} it doesn't contain`);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
186
280
|
var readUpload = async (form) => {
|
|
187
281
|
if (form.get("encoding") !== uploadEncoding) {
|
|
188
282
|
throw new Error("This deployment came from an older tsplc: update tsplc where you deploy from.");
|
|
189
283
|
}
|
|
190
284
|
const manifest = releaseManifestSchema.parse(JSON.parse(z2.string().parse(form.get("manifest"))));
|
|
191
285
|
const files = await Promise.all([...form.entries()].filter(([name]) => name.startsWith(filePrefix)).map(async ([name, value]) => ({
|
|
192
|
-
path: releasePath(name),
|
|
286
|
+
path: releasePath(name.slice(filePrefix.length)),
|
|
193
287
|
content: Bun.gunzipSync(await z2.instanceof(File).parse(value).bytes())
|
|
194
288
|
})));
|
|
195
|
-
|
|
196
|
-
|
|
289
|
+
const upload = { manifest, files };
|
|
290
|
+
checkServer(upload);
|
|
291
|
+
return upload;
|
|
292
|
+
};
|
|
293
|
+
var readDeployRequest = async (releases, request) => {
|
|
294
|
+
const type = request.headers.get("content-type") ?? "";
|
|
295
|
+
if (type.split(";")[0]?.trim() === releaseUploadType) {
|
|
296
|
+
const { header, files } = await decodeUpload(await request.bytes());
|
|
297
|
+
const upload = releaseUploadSchema.parse(header);
|
|
298
|
+
return {
|
|
299
|
+
settings: upload.options,
|
|
300
|
+
upload: await releases.assemble(upload, files)
|
|
301
|
+
};
|
|
197
302
|
}
|
|
198
|
-
|
|
303
|
+
if (type.startsWith("multipart/form-data")) {
|
|
304
|
+
const form = await request.formData();
|
|
305
|
+
return {
|
|
306
|
+
settings: deployOptionsSchema.parse(JSON.parse(z2.string().parse(form.get("options")))),
|
|
307
|
+
upload: await readUpload(form)
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
throw new AgentError(`Unsupported deployment content type ${type}`, 415);
|
|
199
311
|
};
|
|
200
312
|
var saveRelease = async (releases, { manifest, files }) => {
|
|
201
|
-
const hash =
|
|
313
|
+
const hash = createHash2("sha256").update(JSON.stringify(manifest));
|
|
202
314
|
for (const file of [...files].sort((a, b) => a.path.localeCompare(b.path))) {
|
|
203
|
-
hash.update(file.path).update(
|
|
315
|
+
hash.update(file.path).update(createHash2("sha256").update(file.content).digest("hex"));
|
|
204
316
|
}
|
|
205
317
|
const id = hash.digest("hex").slice(0, 16);
|
|
206
318
|
const directory = join(releases, id);
|
|
@@ -228,6 +340,100 @@ var loadRelease = async (releases, id) => {
|
|
|
228
340
|
const manifest = releaseManifestSchema.parse(JSON.parse(await readFile2(join(directory, "manifest.json"), "utf8")));
|
|
229
341
|
return { id, directory, manifest };
|
|
230
342
|
};
|
|
343
|
+
var createReleaseStore = (releases) => {
|
|
344
|
+
const indexes = new Map;
|
|
345
|
+
const readIndex = async (id) => {
|
|
346
|
+
const directory = join(releases, id);
|
|
347
|
+
const files = new Map;
|
|
348
|
+
for await (const found of new Bun.Glob("**/*").scan({
|
|
349
|
+
cwd: directory,
|
|
350
|
+
dot: true
|
|
351
|
+
})) {
|
|
352
|
+
const path = found.split(sep).join("/");
|
|
353
|
+
if (path !== "manifest.json") {
|
|
354
|
+
files.set(path, shortDigest(await readFile2(join(directory, found))));
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const digests = [...files].map(([path, digest]) => ({ path, digest }));
|
|
358
|
+
return { files, buckets: bucketDigests(digests) };
|
|
359
|
+
};
|
|
360
|
+
const index = (id) => {
|
|
361
|
+
const known = indexes.get(id);
|
|
362
|
+
if (known) {
|
|
363
|
+
return known;
|
|
364
|
+
}
|
|
365
|
+
const reading = readIndex(id);
|
|
366
|
+
indexes.set(id, reading);
|
|
367
|
+
reading.catch(() => indexes.delete(id));
|
|
368
|
+
return reading;
|
|
369
|
+
};
|
|
370
|
+
const newest = async () => {
|
|
371
|
+
if (!existsSync2(releases)) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
const stored = await Promise.all((await readdir(releases, { withFileTypes: true })).filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map(async ({ name }) => ({
|
|
375
|
+
name,
|
|
376
|
+
created: (await stat2(join(releases, name))).mtimeMs
|
|
377
|
+
})));
|
|
378
|
+
return stored.sort((left, right) => right.created - left.created)[0]?.name;
|
|
379
|
+
};
|
|
380
|
+
return {
|
|
381
|
+
compare: async (buckets, deployed) => {
|
|
382
|
+
const candidates = [
|
|
383
|
+
...new Set([deployed, await newest()].filter((id) => id != null))
|
|
384
|
+
].filter((id) => existsSync2(join(releases, id, "manifest.json")));
|
|
385
|
+
const compared = await Promise.all(candidates.map(async (id) => {
|
|
386
|
+
const { files, buckets: stored } = await index(id);
|
|
387
|
+
const changed = buckets.flatMap((digest, bucket) => stored[bucket] === digest ? [] : [bucket]);
|
|
388
|
+
return { id, files, changed };
|
|
389
|
+
}));
|
|
390
|
+
const [best] = compared.sort((left, right) => left.changed.length - right.changed.length);
|
|
391
|
+
if (!best) {
|
|
392
|
+
return { base: null, changed: [] };
|
|
393
|
+
}
|
|
394
|
+
const changed = new Map(best.changed.map((bucket) => [bucket, {}]));
|
|
395
|
+
for (const [path, digest] of best.files) {
|
|
396
|
+
const held = changed.get(fileBucket(path));
|
|
397
|
+
if (held) {
|
|
398
|
+
held[path] = digest;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return {
|
|
402
|
+
base: best.id,
|
|
403
|
+
changed: [...changed].map(([bucket, files]) => ({ bucket, files }))
|
|
404
|
+
};
|
|
405
|
+
},
|
|
406
|
+
assemble: async ({ manifest, base, buckets, remove }, uploaded) => {
|
|
407
|
+
const files = new Map(uploaded.map(({ path, content }) => [releasePath(path), content]));
|
|
408
|
+
if (files.size !== uploaded.length) {
|
|
409
|
+
throw new AgentError("The release upload sends a file twice", 400);
|
|
410
|
+
}
|
|
411
|
+
if (base !== null) {
|
|
412
|
+
if (!existsSync2(join(releases, base, "manifest.json"))) {
|
|
413
|
+
throw new AgentError(`The release ${base} this upload builds on is gone; deploy again`, 409);
|
|
414
|
+
}
|
|
415
|
+
const removed = new Set(remove);
|
|
416
|
+
const reused = [...(await index(base)).files.keys()].filter((path) => !removed.has(path) && !files.has(path));
|
|
417
|
+
for (const path of reused) {
|
|
418
|
+
files.set(path, new Uint8Array(await readFile2(join(releases, base, path))));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const assembled = bucketDigests([...files].map(([path, content]) => ({
|
|
422
|
+
path,
|
|
423
|
+
digest: shortDigest(content)
|
|
424
|
+
})));
|
|
425
|
+
if (assembled.some((digest, bucket) => digest !== buckets[bucket])) {
|
|
426
|
+
throw new AgentError("The release upload doesn't match the release it describes; deploy again", 400);
|
|
427
|
+
}
|
|
428
|
+
const upload = {
|
|
429
|
+
manifest,
|
|
430
|
+
files: [...files].map(([path, content]) => ({ path, content }))
|
|
431
|
+
};
|
|
432
|
+
checkServer(upload);
|
|
433
|
+
return upload;
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
};
|
|
231
437
|
|
|
232
438
|
// packages/agent/src/secrets.ts
|
|
233
439
|
import { mkdir as mkdir2, readFile as readFile3, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
|
|
@@ -282,7 +488,7 @@ var readSecrets = async (secrets) => {
|
|
|
282
488
|
}
|
|
283
489
|
return values;
|
|
284
490
|
};
|
|
285
|
-
var releaseVariable = async (manifest, name) => manifest.secrets?.names.includes(name) ? Bun.secrets.get({ service: manifest.secrets.service, name }) :
|
|
491
|
+
var releaseVariable = async (manifest, name, environment) => manifest.secrets?.names.includes(name) ? Bun.secrets.get({ service: manifest.secrets.service, name }) : environment[name];
|
|
286
492
|
var fillSecrets = (st, secrets) => [...secrets].reduce((text, [name, value]) => text.replaceAll(secretPlaceholder(name), () => escapeString(value, "'")), st);
|
|
287
493
|
var withSecrets = async (config, secrets, directory) => {
|
|
288
494
|
await rm2(directory, { recursive: true, force: true });
|
|
@@ -311,12 +517,12 @@ var createDebugging = (context) => {
|
|
|
311
517
|
return null;
|
|
312
518
|
}
|
|
313
519
|
const { directory, manifest: releaseManifest } = await loadRelease(state.paths.releases, release.id);
|
|
314
|
-
const manifestFile = join3(directory,
|
|
520
|
+
const manifestFile = join3(directory, debugManifestFile);
|
|
315
521
|
if (!existsSync3(manifestFile)) {
|
|
316
522
|
return null;
|
|
317
523
|
}
|
|
318
524
|
const manifest = await loadManifest(manifestFile);
|
|
319
|
-
const serverToken = releaseManifest.serverTokenEnv && await releaseVariable(releaseManifest, releaseManifest.serverTokenEnv);
|
|
525
|
+
const serverToken = releaseManifest.serverTokenEnv && await releaseVariable(releaseManifest, releaseManifest.serverTokenEnv, context.environment);
|
|
320
526
|
const debug = await createDebugger({
|
|
321
527
|
manifest,
|
|
322
528
|
adapter: createLoginAdapter({
|
|
@@ -377,22 +583,21 @@ var createDebugging = (context) => {
|
|
|
377
583
|
|
|
378
584
|
// packages/agent/src/deploy.ts
|
|
379
585
|
import { existsSync as existsSync4 } from "node:fs";
|
|
380
|
-
import { readdir, readFile as readFile4, stat as stat2 } from "node:fs/promises";
|
|
381
586
|
import { join as join5 } from "node:path";
|
|
382
|
-
import { setTimeout as delay } from "node:timers/promises";
|
|
383
587
|
import {
|
|
588
|
+
controllerBaseline,
|
|
384
589
|
findControllerLogin,
|
|
385
590
|
startWarmController,
|
|
386
|
-
updateWarmController
|
|
591
|
+
updateWarmController,
|
|
592
|
+
workerScriptsDigest
|
|
387
593
|
} from "@tsplc/build";
|
|
388
594
|
import { loadManifest as loadManifest2 } from "@tsplc/debug";
|
|
389
|
-
import {
|
|
595
|
+
import { debugManifestFile as debugManifestFile2 } from "@tsplc/debug/manifest";
|
|
390
596
|
|
|
391
597
|
// packages/agent/src/codesys.ts
|
|
392
|
-
import { execFile } from "node:child_process";
|
|
393
598
|
import { join as join4 } from "node:path";
|
|
394
|
-
import {
|
|
395
|
-
import {
|
|
599
|
+
import { captureDocker, gatewayImage } from "@tsplc/build";
|
|
600
|
+
import { resolveConfig } from "@tsplc/config/build";
|
|
396
601
|
var network = "tsplc-agent";
|
|
397
602
|
var codesysNetwork = "tsplc-agent-codesys";
|
|
398
603
|
var gateway = { host: "tsplc-agent-gateway", port: 1217 };
|
|
@@ -402,10 +607,8 @@ var credentialNames = {
|
|
|
402
607
|
usernameEnv: "TSPLC_DEVICE_USERNAME",
|
|
403
608
|
passwordEnv: "TSPLC_DEVICE_PASSWORD"
|
|
404
609
|
};
|
|
405
|
-
var
|
|
406
|
-
|
|
407
|
-
return stdout.trim();
|
|
408
|
-
};
|
|
610
|
+
var dockerTimeout = 60000;
|
|
611
|
+
var docker = async (...args) => (await captureDocker(args, dockerTimeout)).stdout.trim();
|
|
409
612
|
var ensureNetwork = async (name, ...options) => {
|
|
410
613
|
if (!await docker("network", "ls", "--quiet", "--filter", `name=^${name}$`)) {
|
|
411
614
|
await docker("network", "create", ...options, name);
|
|
@@ -423,19 +626,14 @@ var ensureGateway = async () => {
|
|
|
423
626
|
await docker("network", "connect", codesysNetwork, gateway.host);
|
|
424
627
|
}
|
|
425
628
|
};
|
|
426
|
-
var
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
} finally {
|
|
432
|
-
delete process.env[credentialNames.usernameEnv];
|
|
433
|
-
delete process.env[credentialNames.passwordEnv];
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
var controllerConfig = (release, target, controllerDirectory) => ({
|
|
629
|
+
var credentialEnvironment = (credentials) => ({
|
|
630
|
+
[credentialNames.usernameEnv]: credentials.username,
|
|
631
|
+
[credentialNames.passwordEnv]: credentials.password
|
|
632
|
+
});
|
|
633
|
+
var controllerConfig = (release, target, controllerDirectory, settings) => ({
|
|
437
634
|
...resolveConfig({
|
|
438
635
|
...release.manifest.config,
|
|
636
|
+
...settings.bulkImport && { bulkImport: true },
|
|
439
637
|
online: {
|
|
440
638
|
network: codesysNetwork,
|
|
441
639
|
gateway,
|
|
@@ -447,39 +645,6 @@ var controllerConfig = (release, target, controllerDirectory) => ({
|
|
|
447
645
|
});
|
|
448
646
|
|
|
449
647
|
// packages/agent/src/deploy.ts
|
|
450
|
-
var followProgress = (controller, emit) => {
|
|
451
|
-
const jobs = join5(controller, ".codesys/controller/jobs");
|
|
452
|
-
const since = Date.now();
|
|
453
|
-
let following = true;
|
|
454
|
-
const done = (async () => {
|
|
455
|
-
let log;
|
|
456
|
-
let offset = 0;
|
|
457
|
-
while (following) {
|
|
458
|
-
await delay(2000);
|
|
459
|
-
if (!log && existsSync4(jobs)) {
|
|
460
|
-
for (const job of await readdir(jobs)) {
|
|
461
|
-
const path = join5(jobs, job, ".codesys/controller/progress.log");
|
|
462
|
-
if (existsSync4(path) && (await stat2(path)).mtimeMs >= since) {
|
|
463
|
-
log = path;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
if (!log) {
|
|
468
|
-
continue;
|
|
469
|
-
}
|
|
470
|
-
const text = await readFile4(log, "utf8");
|
|
471
|
-
for (const line of text.slice(offset).split(`
|
|
472
|
-
`).filter(Boolean)) {
|
|
473
|
-
emit({ kind: "progress", message: line.replace(/^\S+Z /, "") });
|
|
474
|
-
}
|
|
475
|
-
offset = text.length;
|
|
476
|
-
}
|
|
477
|
-
})();
|
|
478
|
-
return async () => {
|
|
479
|
-
following = false;
|
|
480
|
-
await done;
|
|
481
|
-
};
|
|
482
|
-
};
|
|
483
648
|
var createDeployments = (context) => {
|
|
484
649
|
const { state, server } = context;
|
|
485
650
|
const warming = (async () => {
|
|
@@ -490,56 +655,67 @@ var createDeployments = (context) => {
|
|
|
490
655
|
}
|
|
491
656
|
await ensureGateway();
|
|
492
657
|
const release = await loadRelease(state.paths.releases, deployed.id);
|
|
493
|
-
await startWarmController(controllerConfig(release, target, state.paths.controller), deployContainer);
|
|
658
|
+
await startWarmController(controllerConfig(release, target, state.paths.controller, context.codesys), deployContainer);
|
|
494
659
|
})().catch((error) => {
|
|
495
660
|
context.log(`Starting CODESYS failed: ${errorMessage(error)}`);
|
|
496
661
|
});
|
|
497
662
|
return {
|
|
498
|
-
deploy: async (
|
|
499
|
-
|
|
500
|
-
|
|
663
|
+
deploy: async (readRequest, client, clientTsplc) => {
|
|
664
|
+
if (clientTsplc.version !== undefined && clientTsplc.version !== tsplcVersion) {
|
|
665
|
+
throw new AgentError(versionMismatch({ agent: tsplcVersion, client: clientTsplc.version }), 409);
|
|
666
|
+
}
|
|
667
|
+
const { settings, upload } = await readRequest();
|
|
501
668
|
const target = await state.requireTarget();
|
|
502
669
|
if (await findControllerLogin(loginContainer)) {
|
|
503
670
|
throw new AgentError("A login is open; log out before deploying: tsplc logout", 409);
|
|
504
671
|
}
|
|
505
672
|
const credentials = await controllerCredentials(settings.credentials);
|
|
506
673
|
const secrets = await readSecrets(upload.manifest.secrets);
|
|
674
|
+
const scripts = await workerScriptsDigest();
|
|
507
675
|
return context.operations.stream("a deployment", async (emit) => {
|
|
676
|
+
if (clientTsplc.version === undefined) {
|
|
677
|
+
emit({
|
|
678
|
+
kind: "progress",
|
|
679
|
+
message: `Warning: the deploying tsPLC predates version checks, while this plant agent runs tsPLC ${tsplcVersion}; update the client to ${tsplcVersion}`
|
|
680
|
+
});
|
|
681
|
+
} else if (clientTsplc.scripts !== undefined && clientTsplc.scripts !== scripts) {
|
|
682
|
+
emit({
|
|
683
|
+
kind: "progress",
|
|
684
|
+
message: `Warning: the plant agent's CODESYS scripts differ from the deploying tsPLC's, though both are ${tsplcVersion}, so one is a local build. The deployment runs the agent's scripts: update the plant agent to run the client's`
|
|
685
|
+
});
|
|
686
|
+
}
|
|
508
687
|
const release = await saveRelease(state.paths.releases, upload);
|
|
509
|
-
|
|
510
|
-
|
|
688
|
+
const baseline = settings.download ? "valid" : await controllerBaseline(state.paths.controller);
|
|
689
|
+
if (baseline !== "valid") {
|
|
690
|
+
throw new AgentError(baseline === "missing" ? "The controller has no application downloaded by this agent; only a full download can deploy" : "This agent's record of the controller's download can't be read; only a full download can deploy", 409, { downloadRequired: true });
|
|
511
691
|
}
|
|
512
|
-
const config = await withSecrets(controllerConfig(release, target, state.paths.controller), secrets, state.paths.sources);
|
|
692
|
+
const config = await withSecrets(controllerConfig(release, target, state.paths.controller, context.codesys), secrets, state.paths.sources);
|
|
513
693
|
const previous = await state.release();
|
|
514
|
-
const serverPath = release.manifest.server && `${release.id}/${release.manifest.server}`;
|
|
515
|
-
if (serverPath) {
|
|
516
|
-
emit({ kind: "progress", message: "Starting the new server" });
|
|
517
|
-
await server.replace(join5(state.paths.releases, serverPath));
|
|
518
|
-
}
|
|
519
694
|
const kind = settings.download ? "download" : "online-change";
|
|
520
695
|
emit({ kind: "progress", message: `Starting the ${kind}` });
|
|
521
696
|
await ensureGateway();
|
|
522
697
|
await warming;
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
698
|
+
const receipt = await updateWarmController(config, deployContainer, kind, {
|
|
699
|
+
initializeUser: settings.initializeUser,
|
|
700
|
+
credentials,
|
|
701
|
+
onProgress: (message) => emit({ kind: "progress", message })
|
|
702
|
+
});
|
|
703
|
+
const serverPath = release.manifest.server && `${release.id}/${release.manifest.server}`;
|
|
704
|
+
if (serverPath) {
|
|
705
|
+
emit({ kind: "progress", message: "Starting the new server" });
|
|
706
|
+
}
|
|
707
|
+
const serverFailure = serverPath ? await server.replace(join5(state.paths.releases, serverPath)).then(() => {
|
|
708
|
+
return;
|
|
709
|
+
}, (error) => errorMessage(error)) : undefined;
|
|
534
710
|
const deployed = {
|
|
535
711
|
id: release.id,
|
|
536
712
|
deployedAt: new Date().toISOString(),
|
|
537
713
|
operation: kind,
|
|
538
714
|
controllerIds: receipt.controllerIds,
|
|
539
|
-
server: serverPath ?? previous?.server
|
|
715
|
+
server: serverFailure === undefined ? serverPath ?? previous?.server : previous?.server
|
|
540
716
|
};
|
|
541
717
|
await state.setRelease(deployed);
|
|
542
|
-
const debugManifest = join5(release.directory,
|
|
718
|
+
const debugManifest = join5(release.directory, debugManifestFile2);
|
|
543
719
|
const deployment = {
|
|
544
720
|
at: deployed.deployedAt,
|
|
545
721
|
release: release.id,
|
|
@@ -552,8 +728,11 @@ var createDeployments = (context) => {
|
|
|
552
728
|
};
|
|
553
729
|
await appendJsonl(state.paths.deployments, deployment);
|
|
554
730
|
context.debugging.restart();
|
|
731
|
+
if (serverFailure !== undefined) {
|
|
732
|
+
throw new Error(`The controller runs release ${release.id}. ${serverFailure}`);
|
|
733
|
+
}
|
|
555
734
|
return deployed;
|
|
556
|
-
});
|
|
735
|
+
}, { reportsRollback: clientTsplc.version !== undefined });
|
|
557
736
|
}
|
|
558
737
|
};
|
|
559
738
|
};
|
|
@@ -611,7 +790,7 @@ var discoverControllers = async (network, port = runtimePort) => {
|
|
|
611
790
|
};
|
|
612
791
|
|
|
613
792
|
// packages/agent/src/login.ts
|
|
614
|
-
import { setTimeout as
|
|
793
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
615
794
|
import {
|
|
616
795
|
failureReason,
|
|
617
796
|
findControllerLogin as findControllerLogin2,
|
|
@@ -701,7 +880,7 @@ var createLogin = (context) => {
|
|
|
701
880
|
open: async (sent) => {
|
|
702
881
|
const credentials = await controllerCredentials(sent);
|
|
703
882
|
context.log(`Opening a login with the ${sent ? "provided" : "stored"} controller user`);
|
|
704
|
-
const config = controllerConfig(await state.requireRelease(), await state.requireTarget(), state.paths.controller);
|
|
883
|
+
const config = controllerConfig(await state.requireRelease(), await state.requireTarget(), state.paths.controller, context.codesys);
|
|
705
884
|
return operations.stream("a login", async (emit) => {
|
|
706
885
|
if (await findControllerLogin2(loginContainer)) {
|
|
707
886
|
throw new AgentError("A login is already open", 409);
|
|
@@ -711,7 +890,9 @@ var createLogin = (context) => {
|
|
|
711
890
|
message: "Logging in; CODESYS takes minutes to start"
|
|
712
891
|
});
|
|
713
892
|
await ensureGateway();
|
|
714
|
-
const login = await
|
|
893
|
+
const login = await openControllerLogin(config, loginContainer, {
|
|
894
|
+
environment: credentialEnvironment(credentials)
|
|
895
|
+
});
|
|
715
896
|
return send(login, { command: "state" });
|
|
716
897
|
});
|
|
717
898
|
},
|
|
@@ -759,7 +940,7 @@ var createLogin = (context) => {
|
|
|
759
940
|
try {
|
|
760
941
|
const loginState = await Promise.race([
|
|
761
942
|
send(login, { command: "state" }),
|
|
762
|
-
|
|
943
|
+
delay(loginStateTimeout, null)
|
|
763
944
|
]);
|
|
764
945
|
if (!loginState) {
|
|
765
946
|
return stoppedAnswering;
|
|
@@ -785,7 +966,7 @@ var createLogin = (context) => {
|
|
|
785
966
|
};
|
|
786
967
|
|
|
787
968
|
// packages/agent/src/operations.ts
|
|
788
|
-
import {
|
|
969
|
+
import { requiresDownload, transferRollback } from "@tsplc/build";
|
|
789
970
|
var createOperations = (log) => {
|
|
790
971
|
let busy;
|
|
791
972
|
const requireIdle = () => {
|
|
@@ -805,7 +986,7 @@ var createOperations = (log) => {
|
|
|
805
986
|
busy = undefined;
|
|
806
987
|
}
|
|
807
988
|
},
|
|
808
|
-
stream: (operation, run) => {
|
|
989
|
+
stream: (operation, run, { reportsRollback = false } = {}) => {
|
|
809
990
|
requireIdle();
|
|
810
991
|
busy = operation;
|
|
811
992
|
const encoder = new TextEncoder;
|
|
@@ -825,10 +1006,12 @@ var createOperations = (log) => {
|
|
|
825
1006
|
emit({ kind: "done", result: await run(emit) });
|
|
826
1007
|
} catch (error) {
|
|
827
1008
|
log(`${operation} failed: ${error instanceof Error ? error.stack : String(error)}`);
|
|
1009
|
+
const rollback = reportsRollback ? transferRollback(error) : undefined;
|
|
828
1010
|
emit({
|
|
829
1011
|
kind: "error",
|
|
830
1012
|
message: errorMessage(error),
|
|
831
|
-
downloadRequired: error
|
|
1013
|
+
downloadRequired: requiresDownload(error),
|
|
1014
|
+
...rollback && { rollback }
|
|
832
1015
|
});
|
|
833
1016
|
} finally {
|
|
834
1017
|
clearInterval(heartbeat);
|
|
@@ -848,7 +1031,7 @@ var createOperations = (log) => {
|
|
|
848
1031
|
|
|
849
1032
|
// packages/agent/src/server-process.ts
|
|
850
1033
|
import { dirname as dirname3 } from "node:path";
|
|
851
|
-
import { setTimeout as
|
|
1034
|
+
import { setTimeout as delay2 } from "node:timers/promises";
|
|
852
1035
|
var healthyWithinMs = 60000;
|
|
853
1036
|
var settleMs = 5000;
|
|
854
1037
|
var restartDelayMs = 2000;
|
|
@@ -864,7 +1047,7 @@ var createServerSupervisor = (options) => {
|
|
|
864
1047
|
return;
|
|
865
1048
|
}
|
|
866
1049
|
options.log(`Server exited (${code}); restarting it in ${restartDelayMs / 1000} s`);
|
|
867
|
-
|
|
1050
|
+
delay2(restartDelayMs).then(() => {
|
|
868
1051
|
if (current?.process === child) {
|
|
869
1052
|
current = { executable, process: spawn(executable) };
|
|
870
1053
|
}
|
|
@@ -888,7 +1071,7 @@ var createServerSupervisor = (options) => {
|
|
|
888
1071
|
};
|
|
889
1072
|
const healthy = async (child) => {
|
|
890
1073
|
if (!options.healthUrl) {
|
|
891
|
-
await
|
|
1074
|
+
await delay2(settleMs);
|
|
892
1075
|
return child.exitCode === null;
|
|
893
1076
|
}
|
|
894
1077
|
const deadline = Date.now() + healthyWithinMs;
|
|
@@ -896,7 +1079,7 @@ var createServerSupervisor = (options) => {
|
|
|
896
1079
|
if (await fetch(options.healthUrl).then((response) => response.ok, () => false)) {
|
|
897
1080
|
return true;
|
|
898
1081
|
}
|
|
899
|
-
await
|
|
1082
|
+
await delay2(1000);
|
|
900
1083
|
}
|
|
901
1084
|
return false;
|
|
902
1085
|
};
|
|
@@ -930,9 +1113,9 @@ var createServerSupervisor = (options) => {
|
|
|
930
1113
|
|
|
931
1114
|
// packages/agent/src/state.ts
|
|
932
1115
|
import { existsSync as existsSync5 } from "node:fs";
|
|
933
|
-
import { mkdir as mkdir3, readFile as
|
|
1116
|
+
import { mkdir as mkdir3, readFile as readFile4, writeFile as writeFile3 } from "node:fs/promises";
|
|
934
1117
|
import { join as join6 } from "node:path";
|
|
935
|
-
var readJsonFile = async (path, schema) => existsSync5(path) ? schema.parse(JSON.parse(await
|
|
1118
|
+
var readJsonFile = async (path, schema) => existsSync5(path) ? schema.parse(JSON.parse(await readFile4(path, "utf8"))) : null;
|
|
936
1119
|
var writeJsonFile = (path, value) => writeFile3(path, JSON.stringify(value, null, 2));
|
|
937
1120
|
var openState = async (directory) => {
|
|
938
1121
|
const paths = {
|
|
@@ -989,9 +1172,12 @@ var createAgent = async (options) => {
|
|
|
989
1172
|
server.start(join7(state.paths.releases, deployed.server));
|
|
990
1173
|
}
|
|
991
1174
|
const operations = createOperations(log);
|
|
1175
|
+
const codesys = { bulkImport: options.bulkImport ?? false };
|
|
1176
|
+
const releases = createReleaseStore(state.paths.releases);
|
|
992
1177
|
const login = createLogin({
|
|
993
1178
|
state,
|
|
994
1179
|
operations,
|
|
1180
|
+
codesys,
|
|
995
1181
|
onAudit: (entry) => debugging.record(entry),
|
|
996
1182
|
log
|
|
997
1183
|
});
|
|
@@ -999,11 +1185,13 @@ var createAgent = async (options) => {
|
|
|
999
1185
|
state,
|
|
1000
1186
|
readLogin: login.read,
|
|
1001
1187
|
serverHealthUrl: options.serverHealthUrl,
|
|
1188
|
+
environment: options.environment ?? { ...process.env },
|
|
1002
1189
|
log
|
|
1003
1190
|
});
|
|
1004
1191
|
const deployments = createDeployments({
|
|
1005
1192
|
state,
|
|
1006
1193
|
operations,
|
|
1194
|
+
codesys,
|
|
1007
1195
|
server,
|
|
1008
1196
|
debugging,
|
|
1009
1197
|
log
|
|
@@ -1039,8 +1227,18 @@ var createAgent = async (options) => {
|
|
|
1039
1227
|
}
|
|
1040
1228
|
case "GET /variables":
|
|
1041
1229
|
return Response.json((await state.requireRelease()).manifest.variables);
|
|
1230
|
+
case "POST /releases/compare": {
|
|
1231
|
+
const { buckets } = compareRequestSchema.parse(await request.json());
|
|
1232
|
+
const comparison = await releases.compare(buckets, (await state.release())?.id ?? null);
|
|
1233
|
+
return new Response(Bun.gzipSync(JSON.stringify(comparison)), {
|
|
1234
|
+
headers: {
|
|
1235
|
+
"Content-Type": "application/json",
|
|
1236
|
+
"Content-Encoding": "gzip"
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1042
1240
|
case "POST /deploy":
|
|
1043
|
-
return deployments.deploy(
|
|
1241
|
+
return deployments.deploy(() => readDeployRequest(releases, request), clientIdentity(request), clientRelease(request));
|
|
1044
1242
|
case "POST /login":
|
|
1045
1243
|
return login.open(credentialsSchema.nullable().parse(await request.json()));
|
|
1046
1244
|
case "POST /login/command":
|
|
@@ -1051,40 +1249,50 @@ var createAgent = async (options) => {
|
|
|
1051
1249
|
return Response.json({ error: `No route ${key}` }, { status: 404 });
|
|
1052
1250
|
}
|
|
1053
1251
|
};
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1252
|
+
const respond = async (request) => {
|
|
1253
|
+
const { pathname, search, searchParams } = new URL(request.url);
|
|
1254
|
+
const debugPath = pathname.startsWith("/debug/");
|
|
1255
|
+
if (pathname === "/debug") {
|
|
1256
|
+
return new Response(null, {
|
|
1257
|
+
status: 308,
|
|
1258
|
+
headers: { Location: `/debug/${search}` }
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
if (request.method === "GET" && (pathname === "/debug/" || pathname === "/debug/ui.js")) {
|
|
1262
|
+
return debugging.handle(request, pathname.slice("/debug".length));
|
|
1263
|
+
}
|
|
1264
|
+
const presented = /^Bearer (.+)$/.exec(request.headers.get("authorization") ?? "")?.[1] ?? (debugPath ? searchParams.get("token") : null) ?? "";
|
|
1265
|
+
const full = matches(presented, options.token);
|
|
1266
|
+
const read = options.readToken !== undefined && matches(presented, options.readToken) && (debugPath || request.method === "GET" && pathname === "/status");
|
|
1267
|
+
if (!full && !read) {
|
|
1268
|
+
return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
1269
|
+
}
|
|
1270
|
+
try {
|
|
1271
|
+
if (debugPath) {
|
|
1272
|
+
return await debugging.handle(request, pathname.slice("/debug".length));
|
|
1066
1273
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
1274
|
+
return await route(request);
|
|
1275
|
+
} catch (error) {
|
|
1276
|
+
if (error instanceof AgentError) {
|
|
1277
|
+
return Response.json({ error: error.message }, { status: error.status });
|
|
1072
1278
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
return await debugging.handle(request, pathname.slice("/debug".length));
|
|
1076
|
-
}
|
|
1077
|
-
return await route(request);
|
|
1078
|
-
} catch (error) {
|
|
1079
|
-
if (error instanceof AgentError) {
|
|
1080
|
-
return Response.json({ error: error.message }, { status: error.status });
|
|
1081
|
-
}
|
|
1082
|
-
if (error instanceof z4.ZodError) {
|
|
1083
|
-
return Response.json({ error: z4.prettifyError(error) }, { status: 400 });
|
|
1084
|
-
}
|
|
1085
|
-
log(`${request.method} ${request.url} failed: ${error instanceof Error ? error.stack : String(error)}`);
|
|
1086
|
-
return Response.json({ error: errorMessage(error) }, { status: 500 });
|
|
1279
|
+
if (error instanceof z3.ZodError) {
|
|
1280
|
+
return Response.json({ error: z3.prettifyError(error) }, { status: 400 });
|
|
1087
1281
|
}
|
|
1282
|
+
log(`${request.method} ${request.url} failed: ${error instanceof Error ? error.stack : String(error)}`);
|
|
1283
|
+
return Response.json({ error: errorMessage(error) }, { status: 500 });
|
|
1284
|
+
}
|
|
1285
|
+
};
|
|
1286
|
+
return {
|
|
1287
|
+
fetch: async (request) => {
|
|
1288
|
+
const response = await respond(request);
|
|
1289
|
+
const headers = new Headers(response.headers);
|
|
1290
|
+
headers.set(agentVersionHeader, tsplcVersion);
|
|
1291
|
+
return new Response(response.body, {
|
|
1292
|
+
status: response.status,
|
|
1293
|
+
statusText: response.statusText,
|
|
1294
|
+
headers
|
|
1295
|
+
});
|
|
1088
1296
|
},
|
|
1089
1297
|
stop: async () => {
|
|
1090
1298
|
await debugging.close();
|
|
@@ -1166,5 +1374,5 @@ export {
|
|
|
1166
1374
|
variableSchema
|
|
1167
1375
|
};
|
|
1168
1376
|
|
|
1169
|
-
//# debugId=
|
|
1377
|
+
//# debugId=3923230ADB5F8E8464756E2164756E21
|
|
1170
1378
|
//# sourceMappingURL=index.js.map
|