spur-board 0.45.0 → 0.45.1

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/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { Q as requiredSecretKeys, X as configSchema, l as roleCanUseOperation, r as SYSTEMD_SERVICE_SETTINGS, tt as SLACK_BOT_SCOPES, u as OPERATIONS, z as ERRORS } from "./src-CL9PYpaV.mjs";
2
- import { a as CliError, c as escapeTerminalControls, i as requestTokenEnrollment, n as fetchTokenStatus, o as errorExitCode, r as requestOperation, s as renderCliError } from "./client-CYAzUkSd.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./config-DSySN2QA.mjs";
1
+ import { Q as requiredSecretKeys, X as configSchema, l as roleCanUseOperation, r as SYSTEMD_SERVICE_SETTINGS, tt as SLACK_BOT_SCOPES, u as OPERATIONS, z as ERRORS } from "./src-CfmtTvPO.mjs";
2
+ import { a as CliError, c as escapeTerminalControls, i as requestTokenEnrollment, n as fetchTokenStatus, o as errorExitCode, r as requestOperation, s as renderCliError } from "./client-DXseLMUK.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./config-DEL1XWGj.mjs";
4
4
  import { createHash, randomBytes, randomUUID } from "node:crypto";
5
5
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
6
6
  import { homedir, hostname, userInfo } from "node:os";
@@ -1,4 +1,4 @@
1
- import { H as errorEnvelopeSchema, V as errorContextSchema, W as successEnvelopeSchema, p as renderJsonError, z as ERRORS } from "./src-CL9PYpaV.mjs";
1
+ import { H as errorEnvelopeSchema, V as errorContextSchema, W as successEnvelopeSchema, p as renderJsonError, z as ERRORS } from "./src-CfmtTvPO.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
package/dist/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-CYAzUkSd.mjs";
1
+ import { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-DXseLMUK.mjs";
2
2
  export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestTokenEnrollment };
@@ -1,5 +1,5 @@
1
- import { X as configSchema, Z as plainHttpAllowed, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-CL9PYpaV.mjs";
2
- import { a as CliError, t as fetchCatalogVersion } from "./client-CYAzUkSd.mjs";
1
+ import { X as configSchema, Z as plainHttpAllowed, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-CfmtTvPO.mjs";
2
+ import { a as CliError, t as fetchCatalogVersion } from "./client-DXseLMUK.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { closeSync, constants, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
5
5
  import { homedir } from "node:os";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as COLUMN_IDS, A as ringMarker, B as err, C as REVIEW_STATES, D as parseRingMarker, E as isExternalAuthor, F as errorCodeOf, I as parseActorId, J as DEFAULT_SLACK_COMMAND, K as DEFAULT_LINK, L as parseRef$1, M as ticketFactsSchema, N as actorIdSchema, O as prFactsSchema, P as encodeActorId, Q as requiredSecretKeys, R as taskKeySchema, S as eventPayloadSchemas, T as SESSION_STATUSES, U as ok, W as successEnvelopeSchema, X as configSchema, Y as RESERVED_PROJECT, Z as plainHttpAllowed, _ as inboundEventSchema, a as batchSchema, b as userIdSchema, c as buildCatalogSnapshot, d as turnHandedSchema, et as DISPATCHER_MODES, f as renderHttpProblem, g as conversationRefSchema, h as SPACE_IDS, i as AdapterError, j as sessionFactsSchema, k as prRefSchema, l as roleCanUseOperation, n as BOARD_TICK_MS, o as entityRefSchema, s as sourceCursorSchema, t as assertNever, tt as SLACK_BOT_SCOPES, u as OPERATIONS, v as interactionRefSchema, w as SESSION_HEALTH_STATES, x as EVENT_KINDS, y as messageRefSchema, z as ERRORS } from "./src-CL9PYpaV.mjs";
1
+ import { $ as COLUMN_IDS, A as ringMarker, B as err, C as REVIEW_STATES, D as parseRingMarker, E as isExternalAuthor, F as errorCodeOf, I as parseActorId, J as DEFAULT_SLACK_COMMAND, K as DEFAULT_LINK, L as parseRef$1, M as ticketFactsSchema, N as actorIdSchema, O as prFactsSchema, P as encodeActorId, Q as requiredSecretKeys, R as taskKeySchema, S as eventPayloadSchemas, T as SESSION_STATUSES, U as ok, W as successEnvelopeSchema, X as configSchema, Y as RESERVED_PROJECT, Z as plainHttpAllowed, _ as inboundEventSchema, a as batchSchema, b as userIdSchema, c as buildCatalogSnapshot, d as turnHandedSchema, et as DISPATCHER_MODES, f as renderHttpProblem, g as conversationRefSchema, h as SPACE_IDS, i as AdapterError, j as sessionFactsSchema, k as prRefSchema, l as roleCanUseOperation, n as BOARD_TICK_MS, o as entityRefSchema, s as sourceCursorSchema, t as assertNever, tt as SLACK_BOT_SCOPES, u as OPERATIONS, v as interactionRefSchema, w as SESSION_HEALTH_STATES, x as EVENT_KINDS, y as messageRefSchema, z as ERRORS } from "./src-CfmtTvPO.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import { chmodSync, closeSync, existsSync, fchmodSync, fstatSync, fsyncSync, ftruncateSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeSync } from "node:fs";
@@ -9459,6 +9459,7 @@ async function createApiServer(options) {
9459
9459
  let doctorInFlight = null;
9460
9460
  let doctorCached = null;
9461
9461
  let doctorNextProbeAt = 0;
9462
+ const notReady = () => options.stopping?.() === true ? new CommandError("stopping", "Wait until the daemon is running again.") : new CommandError("starting", "Wait until the daemon is ready.");
9462
9463
  app.addHook("onRequest", async (request, reply) => {
9463
9464
  reply.header("x-request-id", request.id);
9464
9465
  reply.header("x-board-instance", instance);
@@ -9508,11 +9509,11 @@ async function createApiServer(options) {
9508
9509
  throw new CommandError("not_found", "This API route is not available.");
9509
9510
  });
9510
9511
  app.get("/v1/schema", async (_request, reply) => {
9511
- if (!options.ready()) throw new CommandError("starting", "Wait until the daemon is ready.");
9512
+ if (!options.ready()) throw notReady();
9512
9513
  return reply.send(snapshot);
9513
9514
  });
9514
9515
  app.get("/v1/doctor", async (_request, reply) => {
9515
- if (!options.ready()) throw new CommandError("starting", "Wait until the daemon is ready.");
9516
+ if (!options.ready()) throw notReady();
9516
9517
  if (options.doctor === void 0) throw new CommandError("not_found", "Doctor is unavailable.");
9517
9518
  if (doctorInFlight !== null) return reply.send(await doctorInFlight);
9518
9519
  if (options.clock.now() < doctorNextProbeAt) {
@@ -9529,12 +9530,12 @@ async function createApiServer(options) {
9529
9530
  }
9530
9531
  });
9531
9532
  app.get("/v1/health", async (_request, reply) => {
9532
- if (!options.ready()) throw new CommandError("starting", "Wait until the daemon is ready.");
9533
+ if (!options.ready()) throw notReady();
9533
9534
  if (options.firstPollDone === void 0) throw new CommandError("not_found", "Health is unavailable.");
9534
9535
  return reply.send({ firstPollDone: await options.firstPollDone() });
9535
9536
  });
9536
9537
  app.post("/v1/tokens/requests", async (request, reply) => {
9537
- if (!options.ready()) throw new CommandError("starting", "Wait until the daemon is ready.");
9538
+ if (!options.ready()) throw notReady();
9538
9539
  const parsed = tokenRequestSchema.safeParse(request.body);
9539
9540
  if (!parsed.success) throw new CommandError("usage", "Provide a name, folder, host and token hash.");
9540
9541
  const result = await requestToken(options.store, options.config, parsed.data, new Date(options.clock.now()));
@@ -9546,7 +9547,7 @@ async function createApiServer(options) {
9546
9547
  });
9547
9548
  /** The hash travels in the body because request logs record the URL. */
9548
9549
  app.post("/v1/tokens/status", async (request, reply) => {
9549
- if (!options.ready()) throw new CommandError("starting", "Wait until the daemon is ready.");
9550
+ if (!options.ready()) throw notReady();
9550
9551
  const parsed = tokenStatusSchema.safeParse(request.body);
9551
9552
  if (!parsed.success) throw new CommandError("usage", "Provide a SHA-256 token hash.");
9552
9553
  const status = await tokenStatusByHash(options.store, parsed.data.hash, new Date(options.clock.now()));
@@ -9557,7 +9558,7 @@ async function createApiServer(options) {
9557
9558
  }));
9558
9559
  });
9559
9560
  app.post("/v1/ops/:id", { onRequest: async (request) => {
9560
- if (!options.ready()) throw new CommandError("starting", "Wait until the daemon is ready.");
9561
+ if (!options.ready()) throw notReady();
9561
9562
  const sessionHeader = request.headers["x-board-session"];
9562
9563
  if (Array.isArray(sessionHeader)) throw new CommandError("forbidden", "Use one session identity header.");
9563
9564
  callers.set(request, await identifyCaller(options, {
@@ -20776,6 +20777,7 @@ function createHttpModule(ctx, options = {}) {
20776
20777
  config: ctx.config,
20777
20778
  port: ctx.config.http.port,
20778
20779
  ready: () => ctx.state() === "ready",
20780
+ stopping: () => ctx.state() === "stopping",
20779
20781
  clock: ctx.clock,
20780
20782
  lookupSession: (id) => ctx.logCall("spur.session.lookup", () => lookupLiveSession(ctx.config.adapters.spur.baseUrl, id, options.fetcher)),
20781
20783
  verifyToken: (token) => verifyOperatorToken(ctx.store, token),
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { m as renderMcpError, u as OPERATIONS, z as ERRORS } from "./src-CL9PYpaV.mjs";
2
- import { a as CliError, r as requestOperation } from "./client-CYAzUkSd.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-DSySN2QA.mjs";
1
+ import { m as renderMcpError, u as OPERATIONS, z as ERRORS } from "./src-CfmtTvPO.mjs";
2
+ import { a as CliError, r as requestOperation } from "./client-DXseLMUK.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-DEL1XWGj.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";
@@ -728,6 +728,13 @@ const ERRORS = {
728
728
  hint: "Wait until the daemon is ready, then retry the command with its existing idempotency key if it has one.",
729
729
  recovery: retry("Wait until the daemon is ready, then retry the command with its existing idempotency key if it has one.", "After the daemon is ready; wait briefly between retries.")
730
730
  }),
731
+ stopping: spec("stopping", {
732
+ status: 503,
733
+ exit: EXIT_CODES.notApplied,
734
+ message: "The daemon is stopping; nothing was applied.",
735
+ hint: "Wait until the daemon is running again, then retry the command with its existing idempotency key if it has one; if it stays stopped, ask in your own session.",
736
+ recovery: retry("Wait until the daemon is running again, then retry the command with its existing idempotency key if it has one; if it stays stopped, ask in your own session.", "After the daemon is running again; wait briefly between retries.")
737
+ }),
731
738
  github_unavailable: spec("github_unavailable", {
732
739
  status: 503,
733
740
  exit: EXIT_CODES.notApplied,
@@ -1736,6 +1743,7 @@ const COMMON_ERRORS = [
1736
1743
  "forbidden",
1737
1744
  "identity_unavailable",
1738
1745
  "starting",
1746
+ "stopping",
1739
1747
  "not_implemented"
1740
1748
  ];
1741
1749
  const MUTATION_ERRORS = ["idempotency_key_mismatch"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.45.0",
3
+ "version": "0.45.1",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -7,6 +7,7 @@
7
7
  - `not_implemented`: Ask the operator to update the daemon to a build with this operation.
8
8
  - `identity_unavailable`: Ask in your own session, then retry the same command later with its existing idempotency key if it has one.
9
9
  - `starting`: Wait until the daemon is ready, then retry the command with its existing idempotency key if it has one.
10
+ - `stopping`: Wait until the daemon is running again, then retry the command with its existing idempotency key if it has one; if it stays stopped, ask in your own session.
10
11
 
11
12
  ## Other error hints
12
13