@astrofoundry/pi-astro 0.40.77 → 0.40.79
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/package.json
CHANGED
package/skills/arcane/SKILL.md
CHANGED
|
@@ -83,11 +83,11 @@ The usual trigger is the owner's **Upgrade Arcane** button under the Arcane Dail
|
|
|
83
83
|
|
|
84
84
|
## Arcane VM operations
|
|
85
85
|
|
|
86
|
-
`["host", "<command>", ...]` runs fixed operations on VM 100 through the key of user `spc-arcane`. The checks print only allowlisted fields; raw logs and journal text never leave the guest. `["host", "--help"]` is the wrapper's help.
|
|
86
|
+
`["host", "<command>", ...]` runs fixed operations on VM 100 through the key of user `spc-arcane`. The checks print only allowlisted fields; raw logs and journal text never leave the guest, except `container-logs … text`, which masks credentials first. `["host", "--help"]` is the wrapper's help.
|
|
87
87
|
|
|
88
|
-
- `container-memory <name>`, `container-stats [name...]` (60 s sample), `container-logs <name> <since> <until> [docker|bazarr-file]` (sanitized event extracts, UTC like `2026-09-06T12:15:00Z`, at most one day), `container-oom <name> <since> <until>`, `kernel-oom <since> <until>`.
|
|
88
|
+
- `container-memory <name>`, `container-stats [name...]` (60 s sample), `container-logs <name> <since> <until> [docker|text|bazarr-file]` (sanitized event extracts, UTC like `2026-09-06T12:15:00Z`, at most one day; when the extracts say `withheld`, add `text` for the newest 300 lines with credentials masked, such as a startup error, and call them redacted log lines), `container-oom <name> <since> <until>`, `kernel-oom <since> <until>`.
|
|
89
89
|
- `host-audit` (installed host files and units, compared with `host/` in the repository), `host-capacity`, `host-storage [area]`, `docker-usage`.
|
|
90
|
-
- `service-check grimoire|mealie` (guest-local endpoints), `crawl4ai-info`, `recyclarr-naming`, `arcane-version`, `queue-callback`, `bazarr-providers`, `mealie-api`, `queue-job <uuid>`, `object-stat grimoire <path
|
|
90
|
+
- `service-check grimoire|mealie` (guest-local endpoints), `crawl4ai-info`, `recyclarr-naming`, `arcane-version`, `queue-callback`, `bazarr-providers`, `mealie-api`, `queue-job <uuid>`, `object-stat grimoire|media <path>` (kind, size, owner, mode, and age; `media` is the NAS media share mounted at `/media` in the media containers, so a container's missing-folder error can be checked there).
|
|
91
91
|
- `radarr-movie <tt…> [command-id]` and `radarr-interface` read Radarr's key from its host config; each needs an owner's approval.
|
|
92
92
|
- `db-list mealie|paperless`, `db-dump mealie|paperless` (gzip pg_dump into `/var/backups/spc-arcane/<stack>/<UTC>`, checked, with row counts), `db-restore <stack> <stamp>` (owner approval): fills an **empty** database from one of those dumps, the app container stopped meanwhile. It refuses a database that holds tables; emptying one is an operator decision. Dumps are never deleted by the tool; `db-list` names those beyond the last three in `over_keep`.
|
|
93
93
|
- `supabase-backup`: the backup `supabase/AGENTS.md` asks for before a Supabase change. It writes custom-format dumps of `postgres` and `_supabase`, `globals.sql`, and `db-config.tar.gz` (the pgsodium root key) into `/var/backups/supabase-upgrades/<UTC>`, checks each dump with pg_restore's listing and full decoding, and prints the manifest with the image's repo digests (record them as the rollback digest). It refuses when the disk has less free space than the databases. Restoring stays an operator step.
|
|
@@ -116,7 +116,7 @@ LOOPBACK_CHECKS = {
|
|
|
116
116
|
"mealie": "http://127.0.0.1:8083/api/recipes?page=1&perPage=1",
|
|
117
117
|
}
|
|
118
118
|
MEALIE_API = "http://127.0.0.1:8083/api/recipes?page=1&perPage=1"
|
|
119
|
-
OBJECT_ROOTS = {"grimoire": "/var/lib/grimoire/object-store"}
|
|
119
|
+
OBJECT_ROOTS = {"grimoire": "/var/lib/grimoire/object-store", "media": "/var/lib/docker/volumes/nas_media/_data"}
|
|
120
120
|
CAPACITY_PATHS = {"containerd": "/var/lib/containerd", "grimoire": "/var/lib/grimoire/object-store"}
|
|
121
121
|
STORAGE_AREAS = (
|
|
122
122
|
"root", "var", "var-lib", "logs", "docker", "volumes", "container-logs", "containerd", "grimoire",
|
|
@@ -229,13 +229,13 @@ def op_container_stats(args):
|
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
def op_container_logs(args):
|
|
232
|
-
usage = "container-logs <name> <since> <until> [docker|bazarr-file] (UTC like 2026-09-06T12:15:00Z)"
|
|
232
|
+
usage = "container-logs <name> <since> <until> [docker|text|bazarr-file] (UTC like 2026-09-06T12:15:00Z)"
|
|
233
233
|
arity(args, 3, 4, usage)
|
|
234
234
|
name = need(NAME, args[0], usage)
|
|
235
235
|
since, until = window_args(args[1:3], usage)
|
|
236
236
|
source = args[3] if len(args) == 4 else "docker"
|
|
237
|
-
if source not in ("docker", "bazarr-file") or (source == "bazarr-file" and name != "bazarr"):
|
|
238
|
-
raise Refused("
|
|
237
|
+
if source not in ("docker", "text", "bazarr-file") or (source == "bazarr-file" and name != "bazarr"):
|
|
238
|
+
raise Refused("source: docker, text, or bazarr-file (bazarr only)")
|
|
239
239
|
probe("incident_probe", {"kind": "container_logs", "name": name, "since": since, "until": until, "source": source})
|
|
240
240
|
|
|
241
241
|
|
|
@@ -319,7 +319,7 @@ def op_queue_job(args):
|
|
|
319
319
|
|
|
320
320
|
|
|
321
321
|
def op_object_stat(args):
|
|
322
|
-
usage = "object-stat grimoire <relative path>"
|
|
322
|
+
usage = "object-stat grimoire|media <relative path>"
|
|
323
323
|
arity(args, 2, 2, usage)
|
|
324
324
|
if args[0] not in OBJECT_ROOTS:
|
|
325
325
|
raise Refused(usage)
|
|
@@ -25,6 +25,10 @@ describe("Arcane host commands", () => {
|
|
|
25
25
|
expect(buildHostRemote(["container-logs", "bazarr", "2026-09-06T12:00:00Z", "2026-09-06T12:15:00Z", "bazarr-file"]).remote).toBe(
|
|
26
26
|
"container-logs bazarr 2026-09-06T12:00:00Z 2026-09-06T12:15:00Z bazarr-file",
|
|
27
27
|
);
|
|
28
|
+
expect(buildHostRemote(["container-logs", "slskd", "2026-09-06T12:00:00Z", "2026-09-06T12:15:00Z", "text"]).remote).toBe(
|
|
29
|
+
"container-logs slskd 2026-09-06T12:00:00Z 2026-09-06T12:15:00Z text",
|
|
30
|
+
);
|
|
31
|
+
expect(buildHostRemote(["object-stat", "media", "downloads/slsk"]).remote).toBe("object-stat media downloads/slsk");
|
|
28
32
|
expect(buildHostRemote(["db-restore", "mealie", "20261019T120000Z"]).name).toBe("db-restore");
|
|
29
33
|
expect(buildHostRemote(["mealie-api"]).spec.stdinSecret).toBe("MEALIE_API_KEY");
|
|
30
34
|
expect(buildHostRemote(["supabase-backup"]).remote).toBe("supabase-backup");
|
|
@@ -35,6 +39,7 @@ describe("Arcane host commands", () => {
|
|
|
35
39
|
["rm"],
|
|
36
40
|
["container-memory", "a b"],
|
|
37
41
|
["container-logs", "sonarr", "2026-09-06T12:00:00Z", "2026-09-06T12:15:00Z", "bazarr-file"],
|
|
42
|
+
["container-logs", "slskd", "2026-09-06T12:00:00Z", "2026-09-06T12:15:00Z", "raw"],
|
|
38
43
|
["kernel-oom", "yesterday", "today"],
|
|
39
44
|
["host-storage", "etc"],
|
|
40
45
|
["service-check", "supabase-studio"],
|
|
@@ -25,7 +25,7 @@ export interface HostCommand {
|
|
|
25
25
|
export const HOST_COMMANDS: Readonly<Record<string, HostCommand>> = {
|
|
26
26
|
"container-memory": { args: [1, 1], help: "container-memory <name> one memory sample and the configured limits", timeoutMs: MINUTE },
|
|
27
27
|
"container-stats": { args: [0, 8], help: "container-stats [name...] 60 s CPU and memory sample (default: the Grimoire workers)", timeoutMs: 2 * MINUTE },
|
|
28
|
-
"container-logs": { args: [3, 4], help: "container-logs <name> <since> <until> [docker|bazarr-file] sanitized event extracts, UTC window ≤ 1 day", timeoutMs: 2 * MINUTE },
|
|
28
|
+
"container-logs": { args: [3, 4], help: "container-logs <name> <since> <until> [docker|text|bazarr-file] sanitized event extracts, or with text the newest 300 lines with credentials masked; UTC window ≤ 1 day", timeoutMs: 2 * MINUTE },
|
|
29
29
|
"container-oom": { args: [3, 3], help: "container-oom <name> <since> <until> OOMKilled flag, limits, retained oom events", timeoutMs: 2 * MINUTE },
|
|
30
30
|
"kernel-oom": { args: [2, 2], help: "kernel-oom <since> <until> sanitized kernel OOM records from the journal", timeoutMs: MINUTE },
|
|
31
31
|
"host-audit": { args: [0, 0], help: "host-audit installed host files and units, compared with the repository's host/", timeoutMs: MINUTE },
|
|
@@ -42,7 +42,7 @@ export const HOST_COMMANDS: Readonly<Record<string, HostCommand>> = {
|
|
|
42
42
|
"radarr-interface": { args: [0, 0], help: "radarr-interface Radarr's queue actions from its interface bundle (host config key; owner approval)", timeoutMs: 2 * MINUTE },
|
|
43
43
|
"radarr-movie": { args: [1, 2], help: "radarr-movie <tt…> [command-id] naming, file, queue and import state of one movie (host config key; owner approval)", timeoutMs: 2 * MINUTE },
|
|
44
44
|
"queue-job": { args: [1, 1], help: "queue-job <uuid> Grimoire queue receipt, attempts, retry time, lock state", timeoutMs: MINUTE },
|
|
45
|
-
"object-stat": { args: [2, 2], help: "object-stat grimoire <path> one object's
|
|
45
|
+
"object-stat": { args: [2, 2], help: "object-stat grimoire|media <path> one object's kind, size, owner, mode, and age (media: the NAS media share)", timeoutMs: MINUTE },
|
|
46
46
|
"db-list": { args: [1, 1], help: "db-list mealie|paperless this tool's dumps, newest last, with checksums and row counts", timeoutMs: MINUTE },
|
|
47
47
|
"db-dump": { args: [1, 1], help: "db-dump mealie|paperless pg_dump into /var/backups/spc-arcane/<stack>/<UTC> (gzip, checked, sha256)", timeoutMs: 60 * MINUTE },
|
|
48
48
|
"db-restore": { args: [2, 2], help: "db-restore <stack> <stamp> fill an EMPTY database from one of these dumps, the app stopped meanwhile (owner approval)", timeoutMs: 60 * MINUTE },
|
|
@@ -96,7 +96,7 @@ export function buildHostRemote(args: string[], allowInternal = false): { remote
|
|
|
96
96
|
case "container-oom":
|
|
97
97
|
check(NAME.test(rest[0]), "container name: letters, digits, dot, dash, underscore");
|
|
98
98
|
check(UTC.test(rest[1]) && UTC.test(rest[2]), "since and until are UTC like 2026-09-06T12:15:00Z");
|
|
99
|
-
if (rest[3] !== undefined) check(rest[3] === "docker" || (rest[3] === "bazarr-file" && rest[0] === "bazarr"), "source: docker, or bazarr-file for bazarr");
|
|
99
|
+
if (rest[3] !== undefined) check(rest[3] === "docker" || rest[3] === "text" || (rest[3] === "bazarr-file" && rest[0] === "bazarr"), "source: docker, text, or bazarr-file for bazarr");
|
|
100
100
|
break;
|
|
101
101
|
case "kernel-oom":
|
|
102
102
|
check(UTC.test(rest[0]) && UTC.test(rest[1]), "since and until are UTC like 2026-09-06T12:15:00Z");
|
|
@@ -115,7 +115,7 @@ export function buildHostRemote(args: string[], allowInternal = false): { remote
|
|
|
115
115
|
check(UUID.test(rest[0]), "a lowercase job UUID");
|
|
116
116
|
break;
|
|
117
117
|
case "object-stat":
|
|
118
|
-
check(rest[0] === "grimoire", "object-stat grimoire <path>");
|
|
118
|
+
check(rest[0] === "grimoire" || rest[0] === "media", "object-stat grimoire|media <path>");
|
|
119
119
|
check(OBJECT_PATH.test(rest[1]) && !rest[1].split("/").some((p) => p === "" || p === "." || p === ".." || p.startsWith(".")), "a relative path without hidden parts or traversal");
|
|
120
120
|
break;
|
|
121
121
|
case "db-list":
|