spur-board 0.44.3 → 0.45.0

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-HVASmsVd.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-BODC7qTT.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-M7jQfUT9.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-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";
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-HVASmsVd.mjs";
1
+ import { H as errorEnvelopeSchema, V as errorContextSchema, W as successEnvelopeSchema, p as renderJsonError, z as ERRORS } from "./src-CL9PYpaV.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-BODC7qTT.mjs";
1
+ import { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-CYAzUkSd.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-HVASmsVd.mjs";
2
- import { a as CliError, t as fetchCatalogVersion } from "./client-BODC7qTT.mjs";
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";
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-HVASmsVd.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-CL9PYpaV.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";
@@ -10083,7 +10083,7 @@ async function reconcileDoorbells(trx, at, config) {
10083
10083
  }).where("id", "=", n.id).execute();
10084
10084
  continue;
10085
10085
  }
10086
- if (session.state === "working") continue;
10086
+ if (recipientBusy(session) && !await spurBlind$1(trx)) continue;
10087
10087
  let rings = n.rings;
10088
10088
  let lastOutbox = n.last_outbox_id;
10089
10089
  if (session.id !== n.recipient_session) {
@@ -10150,19 +10150,30 @@ function ringPauses(config) {
10150
10150
  config.doorbells.unansweredAfterMs
10151
10151
  ];
10152
10152
  }
10153
- /**
10154
- * Whether the session's facts list a ring of this series, up to `rings`, still in its Spur queue.
10155
- * A detail that does not parse, or one without a queue, holds nothing.
10156
- */
10157
- function earlierRingQueued(session, notificationId, rings) {
10153
+ /** The session's last observed Spur facts, or null when its detail does not parse. */
10154
+ function observedFacts(session) {
10158
10155
  let detail;
10159
10156
  try {
10160
10157
  detail = JSON.parse(session.detail);
10161
10158
  } catch {
10162
- return false;
10159
+ return null;
10163
10160
  }
10164
10161
  const fact = sessionFactsSchema.safeParse(detail);
10165
- return fact.success && (fact.data.queuedRings ?? []).some((queued) => queued.notification === notificationId && queued.ring <= rings);
10162
+ return fact.success ? fact.data : null;
10163
+ }
10164
+ /**
10165
+ * Whether the session was last observed mid-turn. Only an observed `working` health counts: any
10166
+ * other health, or a detail that does not parse, is rung.
10167
+ */
10168
+ function recipientBusy(session) {
10169
+ return observedFacts(session)?.health === "working";
10170
+ }
10171
+ /**
10172
+ * Whether the session's facts list a ring of this series, up to `rings`, still in its Spur queue.
10173
+ * A detail that does not parse, or one without a queue, holds nothing.
10174
+ */
10175
+ function earlierRingQueued(session, notificationId, rings) {
10176
+ return (observedFacts(session)?.queuedRings ?? []).some((queued) => queued.notification === notificationId && queued.ring <= rings);
10166
10177
  }
10167
10178
  /** Count one confirmed Spur send, regardless of transport attempts for its outbox row. */
10168
10179
  async function recordRingDelivery(trx, notificationId, ring, session, at, config) {
@@ -10191,7 +10202,7 @@ async function ringStillCurrent(trx, notificationId, sessionId, config) {
10191
10202
  if (n === void 0 || n.acked_at !== null || n.exhausted_at !== null || n.recipient_session !== sessionId) return "dead";
10192
10203
  const session = await selectNotificationRecipient(trx, n, config);
10193
10204
  if (session?.id !== sessionId) return "dead";
10194
- return session.state === "working" ? "defer" : "send";
10205
+ return recipientBusy(session) && !await spurBlind$1(trx) ? "defer" : "send";
10195
10206
  }
10196
10207
  /**
10197
10208
  * The task of a ring: through its notification, or for an inbound author ring (no notification)
@@ -12249,7 +12260,8 @@ async function getStatus(deps, options = {}) {
12249
12260
  if (snapshot !== void 0) sessions.push(parseJson(sessionFactsSchema, snapshot.detail));
12250
12261
  }
12251
12262
  const ticketFacts = ticket === void 0 ? null : parseJson(ticketFactsSchema, ticket.detail);
12252
- const trackerRepo = issuesRepo(config.projects.find((entry) => entry.id === task.project));
12263
+ const project = config.projects.find((entry) => entry.id === task.project);
12264
+ const trackerRepo = issuesRepo(project);
12253
12265
  const linkHints = [];
12254
12266
  for (const session of sessions) {
12255
12267
  const pr = session.pr;
@@ -12265,6 +12277,10 @@ async function getStatus(deps, options = {}) {
12265
12277
  project: task.project,
12266
12278
  column: task.column,
12267
12279
  membership: task.membership,
12280
+ ...project?.dispatcher.mode === "shadow" ? {
12281
+ shadowColumn: task.shadow_column ?? task.column,
12282
+ shadowDiffers: (task.shadow_column ?? task.column) !== task.column
12283
+ } : {},
12268
12284
  state: taskState(ticketFacts, prs, sessions),
12269
12285
  prCount: links.filter((link) => link.entity === "pr").length,
12270
12286
  sessionCount: links.filter((link) => link.entity === "session").length,
@@ -15441,7 +15457,7 @@ function commandReply(id, value, input) {
15441
15457
  body: [
15442
15458
  line(`Board status: ${String(status.tasks.length)} tasks, ${String(status.items.length)} items needing attention.`),
15443
15459
  ...status.items.map((item) => line(`${item.key}: ${item.summary}`)),
15444
- ...status.tasks.map((task) => line(`${task.key}: ${task.column} (${task.membership})`)),
15460
+ ...status.tasks.map((task) => line(`${task.key}: ${task.column}${task.shadowDiffers === true ? `, shadow ${String(task.shadowColumn)}` : ""} (${task.membership})`)),
15445
15461
  line(`Unlinked: ${String(status.unlinkedPrs.length)} pull requests, ${String(status.unlinkedSessions.length)} sessions${status.hiddenUnlinkedPrs + status.hiddenUnlinkedSessions === 0 ? "" : `; ${String(status.hiddenUnlinkedPrs)} pull requests and ${String(status.hiddenUnlinkedSessions)} sessions finished over 7 days ago are hidden`}.`),
15446
15462
  ...status.sources.map((source) => line(`${source.source}: ${source.blindReason !== null ? `blind (${source.blindReason})` : source.warmingUp ? "warming up" : source.stale ? "stale" : "current"}`)),
15447
15463
  ...status.warmingUp ? [line("Sources are warming up.")] : [],
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { m as renderMcpError, u as OPERATIONS, z as ERRORS } from "./src-HVASmsVd.mjs";
2
- import { a as CliError, r as requestOperation } from "./client-BODC7qTT.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-M7jQfUT9.mjs";
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";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";
@@ -1897,6 +1897,8 @@ const linkViewSchema = z.strictObject({
1897
1897
  const detailOnly = "Present only with detail.";
1898
1898
  const count = (what) => z.int().min(0).describe(what);
1899
1899
  const statusTaskSchema = taskViewSchema.extend({
1900
+ shadowColumn: z.enum(COLUMN_IDS).optional().describe("Column the dispatcher works from in shadow mode: where the board would have the task. Present only while the project dispatcher is in shadow mode."),
1901
+ shadowDiffers: z.boolean().optional().describe("Whether shadowColumn differs from column. Present only while the project dispatcher is in shadow mode."),
1900
1902
  state: z.string().min(1).describe("One line: ticket status, pull request states and session health counts, joined by \"; \"."),
1901
1903
  prCount: count("Number of effective pull request links."),
1902
1904
  sessionCount: count("Number of effective session links."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.44.3",
3
+ "version": "0.45.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"