@deslop/deploy 0.1.1287 → 0.1.1290
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/client/assets/(home)-D8Ip7y_e.js +2 -0
- package/dist/client/assets/-expose-Cbka45GL.js +1 -0
- package/dist/client/assets/dropdown-menu-CCASTzIQ.js +1 -0
- package/dist/client/assets/effect-r9fOwH_L.js +16 -0
- package/dist/client/assets/index-CsO110bI.js +2 -0
- package/dist/client/assets/{react-CYMlNKV3.js → react-CUZAqdXP.js} +1 -1
- package/dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/client/assets/route--6-9s7vL.js +1 -0
- package/dist/client/assets/schema-BkrFEFT3.js +2 -0
- package/dist/client/assets/utils-USd0nOYy.js +1 -0
- package/dist/client/index.html +6 -5
- package/dist/server.js +31 -66
- package/package.json +2 -2
- package/dist/client/assets/(home)-BxmlHAs8.js +0 -1
- package/dist/client/assets/-expose-ODex7NFi.js +0 -1
- package/dist/client/assets/effect-DXeB0GGA.js +0 -16
- package/dist/client/assets/index-D6ww27u7.js +0 -2
- package/dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
- package/dist/client/assets/route-BhweZcVF.js +0 -1
- package/dist/client/assets/schema-BejVpmMO.js +0 -2
package/dist/server.js
CHANGED
|
@@ -92650,6 +92650,7 @@ const ListJob = Struct({
|
|
|
92650
92650
|
});
|
|
92651
92651
|
const ListExposure = Struct({
|
|
92652
92652
|
access: Literals(["tailnet", "public"]),
|
|
92653
|
+
name: String$6,
|
|
92653
92654
|
port: optionalKey(Int$1),
|
|
92654
92655
|
url: String$6
|
|
92655
92656
|
});
|
|
@@ -92724,10 +92725,6 @@ const Counters = Struct({
|
|
|
92724
92725
|
}))),
|
|
92725
92726
|
cpuIdle: Finite,
|
|
92726
92727
|
cpuTotal: Finite,
|
|
92727
|
-
diskRead: Finite,
|
|
92728
|
-
diskWrite: Finite,
|
|
92729
|
-
networkReceive: Finite,
|
|
92730
|
-
networkSend: Finite,
|
|
92731
92728
|
time: Finite,
|
|
92732
92729
|
uptime: Finite
|
|
92733
92730
|
});
|
|
@@ -92742,25 +92739,16 @@ const Sample = Struct({
|
|
|
92742
92739
|
usage: optionalKey(Finite)
|
|
92743
92740
|
}))),
|
|
92744
92741
|
cpu: optionalKey(Finite),
|
|
92745
|
-
diskRead: optionalKey(Finite),
|
|
92746
|
-
diskWrite: optionalKey(Finite),
|
|
92747
92742
|
disks: ArraySchema(Struct({
|
|
92748
92743
|
mount: String$6,
|
|
92749
92744
|
total: Finite,
|
|
92750
92745
|
used: Finite
|
|
92751
92746
|
})),
|
|
92752
92747
|
load: optionalKey(ArraySchema(Finite)),
|
|
92753
|
-
memoryAvailable: optionalKey(Finite),
|
|
92754
|
-
memoryBuffers: optionalKey(Finite),
|
|
92755
|
-
memoryCached: optionalKey(Finite),
|
|
92756
92748
|
memoryTotal: Finite,
|
|
92757
92749
|
memoryUsed: Finite,
|
|
92758
|
-
networkReceive: optionalKey(Finite),
|
|
92759
|
-
networkSend: optionalKey(Finite),
|
|
92760
92750
|
since: optionalKey(Finite),
|
|
92761
92751
|
storageUsed: optionalKey(Finite),
|
|
92762
|
-
swapTotal: Finite,
|
|
92763
|
-
swapUsed: Finite,
|
|
92764
92752
|
time: Finite,
|
|
92765
92753
|
uptime: optionalKey(Finite)
|
|
92766
92754
|
});
|
|
@@ -93849,10 +93837,8 @@ const TIERS = [
|
|
|
93849
93837
|
function cpuFields(fields) {
|
|
93850
93838
|
return decodeSync(ArraySchema(FiniteFromString).check(isMinLength(5)))(take$3(drop$1(fields, 1), 8));
|
|
93851
93839
|
}
|
|
93852
|
-
function counters(stat,
|
|
93840
|
+
function counters(stat, uptime, time) {
|
|
93853
93841
|
const values = cpuFields(pipe(stat, split$2("\n"), head, getOrElse(() => ""), trim, split$2(/\s+/u)));
|
|
93854
|
-
const interfaces = pipe(network, split$2("\n"), filter$3((line) => isSome(match$3(/^\s*(?:eth|en|wl)[^:]*:/u)(line))), map$8((line) => split$2(trim(line), /\s+/u)));
|
|
93855
|
-
const devices = pipe(disk, split$2("\n"), map$8((line) => split$2(trim(line), /\s+/u)), filter$3((fields) => isSome(match$3(/^(?:[svh]d[a-z]+|nvme[0-9]+n[0-9]+)$/u)(fields[2] ?? ""))));
|
|
93856
93842
|
return {
|
|
93857
93843
|
cores: pipe(stat, split$2("\n"), filter$3((line) => isSome(match$3(/^cpu[0-9]+\s/u)(line))), map$8((line) => {
|
|
93858
93844
|
const fields = split$2(trim(line), /\s+/u);
|
|
@@ -93865,18 +93851,10 @@ function counters(stat, network, disk, uptime, time) {
|
|
|
93865
93851
|
})),
|
|
93866
93852
|
cpuIdle: (values[3] ?? 0) + (values[4] ?? 0),
|
|
93867
93853
|
cpuTotal: sumAll(values),
|
|
93868
|
-
diskRead: reduce(devices, 0, (total, fields) => total + decodeSync(FiniteFromString)(fields[5] ?? "") * 512),
|
|
93869
|
-
diskWrite: reduce(devices, 0, (total, fields) => total + decodeSync(FiniteFromString)(fields[9] ?? "") * 512),
|
|
93870
|
-
networkReceive: reduce(interfaces, 0, (total, fields) => total + decodeSync(FiniteFromString)(fields[1] ?? "")),
|
|
93871
|
-
networkSend: reduce(interfaces, 0, (total, fields) => total + decodeSync(FiniteFromString)(fields[9] ?? "")),
|
|
93872
93854
|
time,
|
|
93873
93855
|
uptime: decodeSync(FiniteFromString)(split$2(uptime, " ")[0])
|
|
93874
93856
|
};
|
|
93875
93857
|
}
|
|
93876
|
-
function rate(current, seconds, previous) {
|
|
93877
|
-
if (previous === void 0 || current < previous || seconds <= 0 || seconds > 90) return none();
|
|
93878
|
-
return some$1((current - previous) / seconds);
|
|
93879
|
-
}
|
|
93880
93858
|
function cpuUsage(current, seconds, previous) {
|
|
93881
93859
|
if (previous === void 0 || current.total <= previous.total || current.idle < previous.idle || seconds <= 0 || seconds > 90) return none();
|
|
93882
93860
|
return some$1(clamp((1 - (current.idle - previous.idle) / (current.total - previous.total)) * 100, {
|
|
@@ -93907,31 +93885,19 @@ function sample(current, memory, disk, previous, load) {
|
|
|
93907
93885
|
const used = reduce(disks, 0, (sum, entry) => sum + entry.used);
|
|
93908
93886
|
const seconds = (current.time - (previous?.time ?? current.time)) / 1e3;
|
|
93909
93887
|
const baseline = filter$5(fromUndefinedOr(previous), (old) => old.uptime < current.uptime);
|
|
93910
|
-
const old = getOrUndefined$1(baseline);
|
|
93911
93888
|
const reading = {
|
|
93912
|
-
cores: coreUsages(current, seconds,
|
|
93913
|
-
...getSomes$1({
|
|
93914
|
-
|
|
93915
|
-
|
|
93916
|
-
|
|
93917
|
-
|
|
93918
|
-
|
|
93919
|
-
|
|
93920
|
-
})))),
|
|
93921
|
-
diskRead: rate(current.diskRead, seconds, old?.diskRead),
|
|
93922
|
-
diskWrite: rate(current.diskWrite, seconds, old?.diskWrite),
|
|
93923
|
-
networkReceive: rate(current.networkReceive, seconds, old?.networkReceive),
|
|
93924
|
-
networkSend: rate(current.networkSend, seconds, old?.networkSend)
|
|
93925
|
-
}),
|
|
93889
|
+
cores: coreUsages(current, seconds, getOrUndefined$1(baseline)),
|
|
93890
|
+
...getSomes$1({ cpu: cpuUsage({
|
|
93891
|
+
idle: current.cpuIdle,
|
|
93892
|
+
total: current.cpuTotal
|
|
93893
|
+
}, seconds, getOrUndefined$1(map$11(baseline, (value) => ({
|
|
93894
|
+
idle: value.cpuIdle,
|
|
93895
|
+
total: value.cpuTotal
|
|
93896
|
+
})))) }),
|
|
93926
93897
|
disks,
|
|
93927
93898
|
load: decodeSync(ArraySchema(FiniteFromString))(take$3(filter$3(split$2(trim(load ?? ""), /\s+/u), isNonEmpty$1), 3)),
|
|
93928
|
-
memoryAvailable: values["MemAvailable:"] ?? 0,
|
|
93929
|
-
memoryBuffers: values["Buffers:"] ?? 0,
|
|
93930
|
-
memoryCached: (values["Cached:"] ?? 0) + (values["SReclaimable:"] ?? 0),
|
|
93931
93899
|
memoryTotal: values["MemTotal:"] ?? 0,
|
|
93932
93900
|
memoryUsed: (values["MemTotal:"] ?? 0) - (values["MemAvailable:"] ?? 0),
|
|
93933
|
-
swapTotal: values["SwapTotal:"] ?? 0,
|
|
93934
|
-
swapUsed: (values["SwapTotal:"] ?? 0) - (values["SwapFree:"] ?? 0),
|
|
93935
93901
|
time: current.time,
|
|
93936
93902
|
uptime: current.uptime
|
|
93937
93903
|
};
|
|
@@ -93954,31 +93920,32 @@ function chartWindow(minutes, now) {
|
|
|
93954
93920
|
};
|
|
93955
93921
|
}
|
|
93956
93922
|
function mean(bucket, read) {
|
|
93957
|
-
const known = getSomes(map$8(bucket, (point) => map$11(liftPredicate(read(point), isNumber), (value) => ({
|
|
93923
|
+
const known = getSomes(map$8(bucket, (point, index) => map$11(liftPredicate(read(point, index), isNumber), (value) => ({
|
|
93958
93924
|
value,
|
|
93959
93925
|
weight: point.time - (point.since ?? point.time) + 1e3
|
|
93960
93926
|
}))));
|
|
93961
93927
|
if (isReadonlyArrayEmpty(known)) return none();
|
|
93962
93928
|
return some$1(reduce(known, 0, (sum, entry) => sum + entry.value * entry.weight) / reduce(known, 0, (sum, entry) => sum + entry.weight));
|
|
93963
93929
|
}
|
|
93964
|
-
function appEntry(point, id) {
|
|
93965
|
-
return findFirst(point.apps ?? [], (app) => app.id === id);
|
|
93966
|
-
}
|
|
93967
93930
|
function merge(bucket) {
|
|
93968
93931
|
if (bucket.length === 1) return bucket[0];
|
|
93969
93932
|
const reported = filter$3(bucket, (value) => value.apps !== void 0);
|
|
93933
|
+
const appsById = map$8(reported, (point) => fromEntries(map$8(point.apps ?? [], (app) => [app.id, app])));
|
|
93934
|
+
function appAt(index, id) {
|
|
93935
|
+
return fromUndefinedOr(appsById[index]?.[id]);
|
|
93936
|
+
}
|
|
93970
93937
|
const last = lastNonEmpty(bucket);
|
|
93971
93938
|
return {
|
|
93972
93939
|
...last,
|
|
93973
93940
|
...match$6(reported, {
|
|
93974
93941
|
onEmpty: () => ({}),
|
|
93975
93942
|
onNonEmpty: () => ({ apps: map$8(dedupe(flatMap$5(reported, (value) => map$8(value.apps ?? [], (app) => app.id))), (id) => ({
|
|
93976
|
-
...getSomes$1({ cpu: mean(reported, (
|
|
93943
|
+
...getSomes$1({ cpu: mean(reported, (_point, index) => match$8(appAt(index, id), {
|
|
93977
93944
|
onNone: () => 0,
|
|
93978
93945
|
onSome: (app) => app.cpu
|
|
93979
93946
|
})) }),
|
|
93980
93947
|
id,
|
|
93981
|
-
memory: round(getOrElse(mean(reported, (
|
|
93948
|
+
memory: round(getOrElse(mean(reported, (_point, index) => match$8(appAt(index, id), {
|
|
93982
93949
|
onNone: () => 0,
|
|
93983
93950
|
onSome: (app) => app.memory
|
|
93984
93951
|
})), () => 0), 0)
|
|
@@ -93988,13 +93955,7 @@ function merge(bucket) {
|
|
|
93988
93955
|
id: core.id,
|
|
93989
93956
|
...getSomes$1({ usage: mean(bucket, (point) => getOrUndefined$1(findFirst(point.cores ?? [], (entry) => entry.id === core.id))?.usage) })
|
|
93990
93957
|
})),
|
|
93991
|
-
...getSomes$1({
|
|
93992
|
-
cpu: mean(bucket, (point) => point.cpu),
|
|
93993
|
-
diskRead: mean(bucket, (point) => point.diskRead),
|
|
93994
|
-
diskWrite: mean(bucket, (point) => point.diskWrite),
|
|
93995
|
-
networkReceive: mean(bucket, (point) => point.networkReceive),
|
|
93996
|
-
networkSend: mean(bucket, (point) => point.networkSend)
|
|
93997
|
-
}),
|
|
93958
|
+
...getSomes$1({ cpu: mean(bucket, (point) => point.cpu) }),
|
|
93998
93959
|
memoryUsed: getOrElse(mean(bucket, (point) => point.memoryUsed), () => last.memoryUsed),
|
|
93999
93960
|
...getSomes$1({ storageUsed: mean(bucket, (point) => point.storageUsed) }),
|
|
94000
93961
|
since: bucket[0].since ?? bucket[0].time
|
|
@@ -94139,10 +94100,8 @@ var Metrics = class Metrics extends Service$1()("@deslop/deploy/services/metrics
|
|
|
94139
94100
|
const collect = pipe(gen(function* () {
|
|
94140
94101
|
const time = yield* currentTimeMillis;
|
|
94141
94102
|
const files = yield* all$1({
|
|
94142
|
-
disk: fs.readFileString("/proc/diskstats"),
|
|
94143
94103
|
load: fs.readFileString("/proc/loadavg"),
|
|
94144
94104
|
memory: fs.readFileString("/proc/meminfo"),
|
|
94145
|
-
network: fs.readFileString("/proc/net/dev"),
|
|
94146
94105
|
stat: fs.readFileString("/proc/stat"),
|
|
94147
94106
|
uptime: fs.readFileString("/proc/uptime")
|
|
94148
94107
|
}, { concurrency: "unbounded" });
|
|
@@ -94151,7 +94110,7 @@ var Metrics = class Metrics extends Service$1()("@deslop/deploy/services/metrics
|
|
|
94151
94110
|
cause,
|
|
94152
94111
|
message: "The machine counters are unreadable."
|
|
94153
94112
|
}),
|
|
94154
|
-
try: () => counters(files.stat, files.
|
|
94113
|
+
try: () => counters(files.stat, files.uptime, time)
|
|
94155
94114
|
}), flatMap$2(decodeEffect(Counters)));
|
|
94156
94115
|
const old = getOrUndefined$1(yield* get$1(previous));
|
|
94157
94116
|
const shares = yield* pipe(apps, timeout$1("1 second"), flatMap$2((usage) => modify$1(lastApps, (last) => {
|
|
@@ -94368,7 +94327,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
94368
94327
|
})),
|
|
94369
94328
|
sources: [{
|
|
94370
94329
|
error: cause.message,
|
|
94371
|
-
name: worker.name
|
|
94330
|
+
name: `${worker.name} · Snapshot`
|
|
94372
94331
|
}],
|
|
94373
94332
|
time: 0
|
|
94374
94333
|
})),
|
|
@@ -94434,7 +94393,7 @@ const Tools = make$37(make$38("list_apps", {
|
|
|
94434
94393
|
parameters: ExposeRequest,
|
|
94435
94394
|
success: Struct({ url: String$6 })
|
|
94436
94395
|
}).annotate(Destructive, true), make$38("hide_exposure", {
|
|
94437
|
-
description: "Use to remove an HTTPS URL Deploy owns, stopping only the URL, not the backend. target names another configured worker; externally changed Tailscale mappings are refused.",
|
|
94396
|
+
description: "Use to remove an HTTPS URL Deploy owns, by the name list_apps shows, stopping only the URL, not the backend. target names another configured worker; externally changed Tailscale mappings are refused.",
|
|
94438
94397
|
failure: DeployError,
|
|
94439
94398
|
parameters: HideRequest
|
|
94440
94399
|
}).annotate(Destructive, true), make$38("run_job", {
|
|
@@ -94443,12 +94402,16 @@ const Tools = make$37(make$38("list_apps", {
|
|
|
94443
94402
|
parameters: RunJobInput,
|
|
94444
94403
|
success: Struct({ started: Literal(true) })
|
|
94445
94404
|
}));
|
|
94405
|
+
// src/services/inventory/lib/page.ts
|
|
94406
|
+
function sourceBelongsToWorker(source, worker) {
|
|
94407
|
+
return source.name === worker || startsWith(`${worker} · `)(source.name);
|
|
94408
|
+
}
|
|
94446
94409
|
// src/services/inventory/lib/tools.ts
|
|
94447
94410
|
function workerNames(snapshot) {
|
|
94448
94411
|
return dedupe([...snapshot.workers ?? [], ...map$8(snapshot.items, (item) => item.worker)]);
|
|
94449
94412
|
}
|
|
94450
94413
|
function sourceWorker(source, workers, local) {
|
|
94451
|
-
return getOrElse(findFirst(workers, (worker) =>
|
|
94414
|
+
return getOrElse(findFirst(workers, (worker) => sourceBelongsToWorker(source, worker)), () => local);
|
|
94452
94415
|
}
|
|
94453
94416
|
function errorsOf(sources, workers, worker) {
|
|
94454
94417
|
const local = match$8(head(workers), {
|
|
@@ -94522,6 +94485,7 @@ function exposureOf(item) {
|
|
|
94522
94485
|
onFalse: () => "tailnet",
|
|
94523
94486
|
onTrue: () => "public"
|
|
94524
94487
|
}),
|
|
94488
|
+
name: item.name,
|
|
94525
94489
|
...getSomes$1({ port: fromUndefinedOr(item.port) }),
|
|
94526
94490
|
url: item.url
|
|
94527
94491
|
};
|
|
@@ -94570,7 +94534,8 @@ function listApps(snapshot, input) {
|
|
|
94570
94534
|
}));
|
|
94571
94535
|
}
|
|
94572
94536
|
function ownerNames(snapshot) {
|
|
94573
|
-
|
|
94537
|
+
const byWorker = groupBy(snapshot.items, (item) => item.worker);
|
|
94538
|
+
return fromEntries(map$8(workerNames(snapshot), (worker) => [worker, fromEntries(flatMap$5(filter$3(byWorker[worker] ?? [], (item) => item.kind === "service" || item.kind === "container"), (item) => [[itemOwner(item), workloadName(item)]]))]));
|
|
94574
94539
|
}
|
|
94575
94540
|
const jobRequest = fnUntraced(function* (snapshot, input) {
|
|
94576
94541
|
const matching = filter$3(workloads(snapshot.items), (row) => row.item.scheduled === true && (input.worker === void 0 || row.item.worker === input.worker) && (workloadName(row.item) === input.job || row.item.name === input.job));
|
|
@@ -94593,11 +94558,11 @@ function rounded(value) {
|
|
|
94593
94558
|
function diskUsed(sample) {
|
|
94594
94559
|
const recorded = fromUndefinedOr(sample.storageUsed);
|
|
94595
94560
|
if (isSome(recorded)) return recorded;
|
|
94596
|
-
if (isReadonlyArrayNonEmpty(sample.disks)) return some$1(
|
|
94561
|
+
if (isReadonlyArrayNonEmpty(sample.disks)) return some$1(sumAll(map$8(sample.disks, (disk) => disk.used)));
|
|
94597
94562
|
return none();
|
|
94598
94563
|
}
|
|
94599
94564
|
function diskTotal(machine) {
|
|
94600
|
-
return map$11(findLast(machine.samples, (sample) => isReadonlyArrayNonEmpty(sample.disks)), (sample) =>
|
|
94565
|
+
return map$11(findLast(machine.samples, (sample) => isReadonlyArrayNonEmpty(sample.disks)), (sample) => sumAll(map$8(sample.disks, (disk) => disk.total)));
|
|
94601
94566
|
}
|
|
94602
94567
|
function series(machine, minutes, read) {
|
|
94603
94568
|
const start = chartWindow(minutes, machine.time).start;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/deploy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1290",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/MP281X/deslop.git",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=26"
|
|
40
40
|
},
|
|
41
|
-
"fingerprint": "
|
|
41
|
+
"fingerprint": "324c0ca94aeb497048fd859dabc4a7e116981e45bba8c91e89bca8e90d540f79"
|
|
42
42
|
}
|