From 4964d828660c6603c009e55b41e06c56b49c4bcf Mon Sep 17 00:00:00 2001 From: clover caruso Date: Wed, 21 Oct 2026 02:08:14 -0700 Subject: [PATCH] Expose indexer status without a machine-name prefix Serve stats and activity beside the existing scan endpoint. Assisted-by: gpt-6.1-sol --- src/file-viewer/indexer/{studio.ts => status.ts} | 0 src/source-of-truth.ts | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/file-viewer/indexer/{studio.ts => status.ts} (100%) diff --git a/src/file-viewer/indexer/studio.ts b/src/file-viewer/indexer/status.ts similarity index 100% rename from src/file-viewer/indexer/studio.ts rename to src/file-viewer/indexer/status.ts diff --git a/src/source-of-truth.ts b/src/source-of-truth.ts index 90754af552d387345b8427731f0c14b55bb30b2b..306852315ecf6d7765f89043f8e0737f38f9dc0d 100644 --- a/src/source-of-truth.ts +++ b/src/source-of-truth.ts @@ -189,14 +189,14 @@ app.get("/progress", (c) => { return c.body(progress.encodeByteStream(indexer.root) as ReadableStream); }); -app.get("/studio/stats", (c) => { +app.get("/stats", (c) => { if (c.req.header("Authorization") !== token) return c.json({ error: "invalid authorization header" }, 401); - return c.json(studio.stats(service)); + return c.json(status.stats(service)); }); -app.get("/studio/activity", (c) => { +app.get("/activity", (c) => { if (c.req.header("Authorization") !== token) return c.json({ error: "invalid authorization header" }, 401); - return c.json(studio.activity(indexer.root)); + return c.json(status.activity(indexer.root)); }); // download a consistent snapshot of cache.sqlite. web nodes call this with @@ -287,7 +287,7 @@ import * as fs from "#sitegen/fs"; import { Path } from "#sitegen/path"; import { hashFile } from "#src/file-viewer/indexer/scan.ts"; import * as indexer from "#src/file-viewer/indexer/service.ts"; -import * as studio from "#src/file-viewer/indexer/studio.ts"; +import * as status from "#src/file-viewer/indexer/status.ts"; import { FilePermissions } from "#src/file-viewer/models/FilePermissions.ts"; import { MediaFile, MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; import { ASSERT, UNWRAP } from "@clo/lib/assert"; -- 2.54.1