@deslop/deploy 0.1.1326 → 0.1.1328
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 +1 -1
- package/dist/server.js +108 -63
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,6 +8,6 @@ deploy service install --domain mp281x.xyz --workers desktop,macbook-pro
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
- **`--workers`** lists Tailscale machine names. Deploy derives each HTTPS URL from the tailnet's MagicDNS suffix and its package port. Auth identifies peers by their tailnet owner; local commands require an admin.
|
|
11
|
-
- **Platforms.** Linux x64 and macOS arm64. Public exposure runs the bundled Caddy, a Linux x64 build, so a Mac exposes ports to the tailnet only
|
|
11
|
+
- **Platforms.** Linux x64 and macOS arm64. Public exposure runs the bundled Caddy, a Linux x64 build, so a Mac exposes ports to the tailnet only. Its apps are running regular (Dock) GUI applications and running user launch agents other than `com.apple.*` and Deslop `-update` agents, with process trees and listeners but no per-app history.
|
|
12
12
|
|
|
13
13
|
Common flags and service commands: [Deslop app runtime](https://github.com/MP281X/deslop/blob/main/packages/runtime/README.md).
|
package/dist/server.js
CHANGED
|
@@ -109349,19 +109349,42 @@ function unitFailures(text) {
|
|
|
109349
109349
|
}));
|
|
109350
109350
|
}
|
|
109351
109351
|
// src/services/inventory/lib/launchd.ts
|
|
109352
|
-
|
|
109353
|
-
return
|
|
109354
|
-
const [pid, status, label] = split$1(line, " ");
|
|
109355
|
-
|
|
109356
|
-
|
|
109357
|
-
|
|
109358
|
-
|
|
109359
|
-
|
|
109360
|
-
|
|
109361
|
-
|
|
109362
|
-
|
|
109363
|
-
|
|
109364
|
-
});
|
|
109352
|
+
function launchAgents(text) {
|
|
109353
|
+
return getSomes(pipe(text, split$1("\n"), map$10((line) => {
|
|
109354
|
+
const [pid, status = "", label = ""] = split$1(trim(line), " ");
|
|
109355
|
+
if (!isNonEmpty$1(label) || startsWith("com.apple.")(label) || startsWith("application.")(label) || startsWith("deslop-")(label) && endsWith("-update")(label)) return none();
|
|
109356
|
+
const processId = filter$7(decodeOption(ProcessIdFromString)(pid), (value) => value > 0);
|
|
109357
|
+
if (isNone(processId) && pid !== "-") return none();
|
|
109358
|
+
return some$1({
|
|
109359
|
+
detail: "user · launch agent",
|
|
109360
|
+
label: UnitId.make(label),
|
|
109361
|
+
pid: processId,
|
|
109362
|
+
status: parse$2(status)
|
|
109363
|
+
});
|
|
109364
|
+
})));
|
|
109365
|
+
}
|
|
109366
|
+
function dockApplications(text) {
|
|
109367
|
+
return getSomes(pipe(text, split$1(/\n(?=\s*[0-9]+\))/u), map$10((block) => {
|
|
109368
|
+
const name = pipe(match$2(/^\s*[0-9]+\) "(.+)" ASN:/u)(block), map$13((match) => match[1] ?? ""), filter$7(isNonEmpty$1));
|
|
109369
|
+
const pid = pipe(match$2(/^\s+pid = ([0-9]+) .*\btype="Foreground"(?:\s|$)/mu)(block), flatMap$8((match) => decodeOption(ProcessIdFromString)(match[1] ?? "")), filter$7((value) => value > 0));
|
|
109370
|
+
return map$13(all$4({
|
|
109371
|
+
name,
|
|
109372
|
+
pid
|
|
109373
|
+
}), (app) => ({
|
|
109374
|
+
detail: "user · application",
|
|
109375
|
+
label: UnitId.make(app.name),
|
|
109376
|
+
pid: app.pid
|
|
109377
|
+
}));
|
|
109378
|
+
})));
|
|
109379
|
+
}
|
|
109380
|
+
function macApplications(agents, applications) {
|
|
109381
|
+
const running = getSomes(map$10(agents, (agent) => map$13(agent.pid, (pid) => ({
|
|
109382
|
+
detail: agent.detail,
|
|
109383
|
+
label: agent.label,
|
|
109384
|
+
pid
|
|
109385
|
+
}))));
|
|
109386
|
+
return dedupeWith([...applications, ...running], (left, right) => left.pid === right.pid);
|
|
109387
|
+
}
|
|
109365
109388
|
// src/services/inventory/lib/command.ts
|
|
109366
109389
|
const WRAPPERS = [
|
|
109367
109390
|
"env",
|
|
@@ -109994,8 +110017,10 @@ function launchdProcesses(text, agents) {
|
|
|
109994
110017
|
start: match[5] ?? ""
|
|
109995
110018
|
}))))));
|
|
109996
110019
|
const parents = fromIterable$5(map$10(rows, (row) => [row.pid, row.parent]));
|
|
109997
|
-
function agent(pid) {
|
|
109998
|
-
|
|
110020
|
+
function agent(pid, visited = empty$5()) {
|
|
110021
|
+
if (has(visited, pid)) return none();
|
|
110022
|
+
add$1(visited, pid);
|
|
110023
|
+
return pipe(agents, get$8(pid), orElse$3(() => pipe(parents, get$8(pid), flatMap$8((parent) => agent(parent, visited)))));
|
|
109999
110024
|
}
|
|
110000
110025
|
return getSomes(map$10(rows, (row) => flatMap$8(agent(row.pid), (unit) => map$13(all$4({
|
|
110001
110026
|
start: make$76(row.start),
|
|
@@ -110357,7 +110382,8 @@ var Inventory = class extends Service$1()("@deslop/deploy/services/inventory/ser
|
|
|
110357
110382
|
});
|
|
110358
110383
|
const darwin = gen(function* () {
|
|
110359
110384
|
const launchd = yield* all$1({
|
|
110360
|
-
agents: result$1(
|
|
110385
|
+
agents: result$1(map$7(command("launchctl", ["list"]), launchAgents)),
|
|
110386
|
+
applications: result$1(map$7(command("/usr/bin/lsappinfo", ["list"]), dockApplications)),
|
|
110361
110387
|
table: result$1(command("env", [
|
|
110362
110388
|
"LC_ALL=C",
|
|
110363
110389
|
"ps",
|
|
@@ -110368,8 +110394,23 @@ var Inventory = class extends Service$1()("@deslop/deploy/services/inventory/ser
|
|
|
110368
110394
|
}, { concurrency: "unbounded" });
|
|
110369
110395
|
const time = yield* now;
|
|
110370
110396
|
const total = millis(sumAll(flatMap$6(cpus(), (cpu) => values(cpu.times))));
|
|
110397
|
+
const apps = macApplications(getOrElse(launchd.agents, () => []), getOrElse(launchd.applications, () => []));
|
|
110398
|
+
function appItems(found) {
|
|
110399
|
+
return map$10(found, (app) => InventoryItem.make({
|
|
110400
|
+
active: true,
|
|
110401
|
+
detail: app.detail,
|
|
110402
|
+
id: ItemId.make(`${worker}:user:${app.label}`),
|
|
110403
|
+
kind: "service",
|
|
110404
|
+
name: app.label,
|
|
110405
|
+
running: true,
|
|
110406
|
+
scope: some$1("user"),
|
|
110407
|
+
state: "running",
|
|
110408
|
+
url: none(),
|
|
110409
|
+
worker
|
|
110410
|
+
}));
|
|
110411
|
+
}
|
|
110371
110412
|
const records = map$12(launchd.table, (text) => {
|
|
110372
|
-
const agents = fromIterable$5(
|
|
110413
|
+
const agents = fromIterable$5(map$10(apps, (app) => [app.pid, app.label]));
|
|
110373
110414
|
return filter$5(launchdProcesses(text, agents), (record) => record.process.pid === selfProcess || !pipe(agents, get$8(selfProcess), contains$2(record.unit)));
|
|
110374
110415
|
});
|
|
110375
110416
|
const owned = getOrElse(records, empty$15);
|
|
@@ -110379,53 +110420,57 @@ var Inventory = class extends Service$1()("@deslop/deploy/services/inventory/ser
|
|
|
110379
110420
|
time,
|
|
110380
110421
|
total
|
|
110381
110422
|
})),
|
|
110382
|
-
sources: [
|
|
110383
|
-
|
|
110384
|
-
|
|
110385
|
-
|
|
110386
|
-
|
|
110387
|
-
|
|
110388
|
-
|
|
110389
|
-
|
|
110390
|
-
|
|
110391
|
-
|
|
110392
|
-
|
|
110393
|
-
|
|
110394
|
-
|
|
110395
|
-
|
|
110396
|
-
running: isSome(agent.pid),
|
|
110397
|
-
scope: some$1("user"),
|
|
110398
|
-
state: match$8(agent.pid, {
|
|
110399
|
-
onNone: () => match(agent.status === 0, {
|
|
110400
|
-
onFalse: constant("failed · failed"),
|
|
110401
|
-
onTrue: constant("inactive · dead")
|
|
110423
|
+
sources: [
|
|
110424
|
+
collect("Launch agents", map$7(fromResult(launchd.agents), (agents) => pipe(agents, filter$5((agent) => match$8(agent.pid, {
|
|
110425
|
+
onNone: () => exists(agent.status, (status) => status !== 0),
|
|
110426
|
+
onSome: (id) => some(apps, (app) => app.pid === id && app.label === agent.label)
|
|
110427
|
+
})), map$10((agent) => InventoryItem.make({
|
|
110428
|
+
active: isSome(agent.pid),
|
|
110429
|
+
detail: agent.detail,
|
|
110430
|
+
failure: pipe(agent.status, filter$7((status) => isNone(agent.pid) && status !== 0), map$13((status) => ({
|
|
110431
|
+
at: none(),
|
|
110432
|
+
reason: exitFailure(status)
|
|
110433
|
+
}))),
|
|
110434
|
+
health: match(isNone(agent.pid), {
|
|
110435
|
+
onFalse: constant("quiet"),
|
|
110436
|
+
onTrue: constant("error")
|
|
110402
110437
|
}),
|
|
110403
|
-
|
|
110404
|
-
|
|
110405
|
-
|
|
110406
|
-
|
|
110407
|
-
|
|
110408
|
-
|
|
110409
|
-
|
|
110410
|
-
|
|
110411
|
-
|
|
110412
|
-
|
|
110413
|
-
|
|
110414
|
-
|
|
110415
|
-
|
|
110416
|
-
|
|
110417
|
-
|
|
110418
|
-
|
|
110419
|
-
|
|
110420
|
-
|
|
110421
|
-
|
|
110422
|
-
|
|
110423
|
-
|
|
110424
|
-
|
|
110425
|
-
|
|
110426
|
-
|
|
110427
|
-
|
|
110428
|
-
|
|
110438
|
+
id: ItemId.make(`${worker}:user:${agent.label}`),
|
|
110439
|
+
kind: "service",
|
|
110440
|
+
name: agent.label,
|
|
110441
|
+
running: isSome(agent.pid),
|
|
110442
|
+
scope: some$1("user"),
|
|
110443
|
+
state: match$8(agent.pid, {
|
|
110444
|
+
onNone: constant("failed · failed"),
|
|
110445
|
+
onSome: constant("running")
|
|
110446
|
+
}),
|
|
110447
|
+
url: none(),
|
|
110448
|
+
worker
|
|
110449
|
+
}))))),
|
|
110450
|
+
collect("Applications", map$7(fromResult(launchd.applications), appItems)),
|
|
110451
|
+
collect("Listening ports", flatMap$3(command("lsof", [
|
|
110452
|
+
"-nP",
|
|
110453
|
+
"+c0",
|
|
110454
|
+
"-iTCP",
|
|
110455
|
+
"-sTCP:LISTEN",
|
|
110456
|
+
"-iUDP",
|
|
110457
|
+
"-F",
|
|
110458
|
+
"pctPnT"
|
|
110459
|
+
]), (text) => portItems(lsofSockets(text), worker, http, {
|
|
110460
|
+
cwd: fnUntraced(function* (processId) {
|
|
110461
|
+
return pipe(yield* option$1(command("lsof", [
|
|
110462
|
+
"-nP",
|
|
110463
|
+
"-a",
|
|
110464
|
+
"-p",
|
|
110465
|
+
`${processId}`,
|
|
110466
|
+
"-d",
|
|
110467
|
+
"cwd",
|
|
110468
|
+
"-Fn"
|
|
110469
|
+
])), getOrElse$1(constant("")), split$1("\n"), findFirst(startsWith("n")), map$13(slice(1)));
|
|
110470
|
+
}),
|
|
110471
|
+
unit: (processId) => succeed$5(pipe(owned, findFirst((record) => record.process.pid === processId), map$13((record) => record.unit)))
|
|
110472
|
+
})))
|
|
110473
|
+
]
|
|
110429
110474
|
};
|
|
110430
110475
|
});
|
|
110431
110476
|
const start = fnUntraced(function* (input) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/deploy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1328",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/MP281X/deslop.git",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=26"
|
|
42
42
|
},
|
|
43
|
-
"fingerprint": "
|
|
43
|
+
"fingerprint": "3beb663bbbd5c2028d97ef47ee5abf674ed851c26fc098ae4286a90d9400f35b"
|
|
44
44
|
}
|