spur-board 0.171.0 → 0.171.2

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.
@@ -1,4 +1,4 @@
1
- import { d as tokenRequestStatusSchema, gt as errorEnvelopeSchema, ht as errorContextSchema, l as tokenRequestResultSchema, pt as ERRORS, vt as successEnvelopeSchema, x as renderJsonError } from "./chunk-CqjDrIzS.mjs";
1
+ import { _t as errorEnvelopeSchema, d as tokenRequestStatusSchema, gt as errorContextSchema, l as tokenRequestResultSchema, mt as ERRORS, x as renderJsonError, yt as successEnvelopeSchema } from "./chunk-DD_jEQTA.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -2353,12 +2353,15 @@ const MIRROR_FAILURES = {
2353
2353
  fix: "Usually transient: the board retries on its next poll. If it persists, check the daemon log for the GitHub error."
2354
2354
  }
2355
2355
  };
2356
+ const SPUR_REQUEST_TIMEOUT = "spur_request_timeout";
2356
2357
  /** A whole-poll failure (A6). `retryAt` is when the source allows the next attempt. */
2357
2358
  var AdapterError = class extends Error {
2358
2359
  kind;
2359
2360
  retryAt;
2360
2361
  /** The mirror failure code a github-project source reports with this failure. */
2361
2362
  code;
2363
+ /** Operator-facing detail for a timed-out Spur request. */
2364
+ sourceFailure;
2362
2365
  usage;
2363
2366
  constructor(kind, message, options = {}) {
2364
2367
  super(message, "cause" in options ? { cause: options.cause } : void 0);
@@ -2366,6 +2369,7 @@ var AdapterError = class extends Error {
2366
2369
  this.kind = kind;
2367
2370
  this.retryAt = options.retryAt;
2368
2371
  this.code = options.code;
2372
+ this.sourceFailure = options.sourceFailure;
2369
2373
  }
2370
2374
  };
2371
2375
  // ../contracts/src/events.ts
@@ -6253,4 +6257,4 @@ const remoteDoctorReportSchema = z.object({
6253
6257
  function assertNever(value) {
6254
6258
  throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
6255
6259
  }
6256
- export { prApprovalPairSchema as $, skillReloadFilesSchema as A, defaultAddressee as At, entityRefSchema as B, COLUMN_IDS as Bt, SPACE_IDS as C, DEFAULT_STAND_PORT_RANGE as Ct, messageRefSchema as D, columnTurnTimings as Dt, interactionRefSchema as E, boardWideSpurProject as Et, AdapterError as F, resolveWebOrigin as Ft, trackerSourceId as G, TODO_GROUP_COLUMN_IDS as Gt, prSourceId as H, ITEM_KINDS as Ht, MIRROR_FAILURES as I, slackConfigured as It, REVIEW_STATES as J, PR_STATES as K, VIAS as Kt, MIRROR_FAILURE_CODES as L, BLOCK_TYPES as Lt, EVENT_KINDS as M, plainHttpAllowed as Mt, GATE_REASONS as N, readyMirrorOf as Nt, userIdSchema as O, configBindings as Ot, eventPayloadSchemas as P, requiredSecretKeys as Pt, parseRingMarker as Q, batchSchema as R, COLUMNS as Rt, renderMcpError as S, DEFAULT_SLACK_COMMAND as St, inboundEventSchema as T, approvalRuleOf as Tt, sessionTransitionSchema as U, SLACK_BOT_SCOPES as Ut, mirrorSourceId as V, DISPATCHER_MODES as Vt, sourceCursorSchema as W, TASK_HOLDS as Wt, SESSION_STATUSES as X, SESSION_HEALTH_STATES as Y, isExternalAuthor as Z, defaultBranchViewSchema as _, ok as _t, doctorReportSchema as a, ticketFactsSchema as at, renderHttpProblem as b, DEFAULT_LINK as bt, requestHashOf as c, actorIdSchema as ct, tokenRequestStatusSchema as d, parseActorId as dt, prFactsSchema as et, BOARD_TICK_MS as f, parseRef as ft, OPERATIONS as g, errorEnvelopeSchema as gt, roleCanUseOperation as h, errorContextSchema as ht, SPUR_MIN_VERSION as i, sessionFactsSchema as it, sortSkillFiles as j, externalQuietAfterMs as jt, skillReloadFileSchema as k, configSchema as kt, tokenRequestResultSchema as l, encodeActorId as lt, buildCatalogSnapshot as m, err as mt, SLACK_OFF_FIX as n, prReviewRuleSchema as nt, remoteDoctorReportSchema as o, JIRA_PROJECT_KEY as ot, SYSTEMD_SERVICE_SETTINGS as p, ERRORS as pt, REVIEW_DECISIONS as q, isTodoGroupColumn as qt, SLACK_PARTLY_FIX as r, ringMarker as rt, TOKEN_REQUEST_LIMITS as s, REF_NUMBER as st, assertNever as t, prRefSchema as tt, tokenRequestSchema as u, errorCodeOf as ut, inboxNoSessionSchema as v, successEnvelopeSchema as vt, conversationRefSchema as w, RESERVED_PROJECT as wt, renderJsonError as x, DEFAULT_SLACK_APP_NAME as xt, turnHandedSchema as y, DEFAULT_HTTP_PORT as yt, defaultBranchFactSchema as z, COLUMN_GROUPS as zt };
6260
+ export { parseRingMarker as $, skillReloadFilesSchema as A, configSchema as At, defaultBranchFactSchema as B, COLUMN_GROUPS as Bt, SPACE_IDS as C, DEFAULT_SLACK_COMMAND as Ct, messageRefSchema as D, boardWideSpurProject as Dt, interactionRefSchema as E, approvalRuleOf as Et, AdapterError as F, requiredSecretKeys as Ft, sourceCursorSchema as G, TASK_HOLDS as Gt, mirrorSourceId as H, DISPATCHER_MODES as Ht, MIRROR_FAILURES as I, resolveWebOrigin as It, REVIEW_DECISIONS as J, isTodoGroupColumn as Jt, trackerSourceId as K, TODO_GROUP_COLUMN_IDS as Kt, MIRROR_FAILURE_CODES as L, slackConfigured as Lt, EVENT_KINDS as M, externalQuietAfterMs as Mt, GATE_REASONS as N, plainHttpAllowed as Nt, userIdSchema as O, columnTurnTimings as Ot, eventPayloadSchemas as P, readyMirrorOf as Pt, isExternalAuthor as Q, SPUR_REQUEST_TIMEOUT as R, BLOCK_TYPES as Rt, renderMcpError as S, DEFAULT_SLACK_APP_NAME as St, inboundEventSchema as T, RESERVED_PROJECT as Tt, prSourceId as U, ITEM_KINDS as Ut, entityRefSchema as V, COLUMN_IDS as Vt, sessionTransitionSchema as W, SLACK_BOT_SCOPES as Wt, SESSION_HEALTH_STATES as X, REVIEW_STATES as Y, SESSION_STATUSES as Z, defaultBranchViewSchema as _, errorEnvelopeSchema as _t, doctorReportSchema as a, sessionFactsSchema as at, renderHttpProblem as b, DEFAULT_HTTP_PORT as bt, requestHashOf as c, REF_NUMBER as ct, tokenRequestStatusSchema as d, errorCodeOf as dt, prApprovalPairSchema as et, BOARD_TICK_MS as f, parseActorId as ft, OPERATIONS as g, errorContextSchema as gt, roleCanUseOperation as h, err as ht, SPUR_MIN_VERSION as i, ringMarker as it, sortSkillFiles as j, defaultAddressee as jt, skillReloadFileSchema as k, configBindings as kt, tokenRequestResultSchema as l, actorIdSchema as lt, buildCatalogSnapshot as m, ERRORS as mt, SLACK_OFF_FIX as n, prRefSchema as nt, remoteDoctorReportSchema as o, ticketFactsSchema as ot, SYSTEMD_SERVICE_SETTINGS as p, parseRef as pt, PR_STATES as q, VIAS as qt, SLACK_PARTLY_FIX as r, prReviewRuleSchema as rt, TOKEN_REQUEST_LIMITS as s, JIRA_PROJECT_KEY as st, assertNever as t, prFactsSchema as tt, tokenRequestSchema as u, encodeActorId as ut, inboxNoSessionSchema as v, ok as vt, conversationRefSchema as w, DEFAULT_STAND_PORT_RANGE as wt, renderJsonError as x, DEFAULT_LINK as xt, turnHandedSchema as y, successEnvelopeSchema as yt, batchSchema as z, COLUMNS as zt };
@@ -1,5 +1,5 @@
1
- import { It as slackConfigured, Mt as plainHttpAllowed, g as OPERATIONS, kt as configSchema, m as buildCatalogSnapshot } from "./chunk-CqjDrIzS.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-BRiD3EcI.mjs";
1
+ import { At as configSchema, Lt as slackConfigured, Nt as plainHttpAllowed, g as OPERATIONS, m as buildCatalogSnapshot } from "./chunk-DD_jEQTA.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-BYzkU1Kt.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/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { Ct as DEFAULT_STAND_PORT_RANGE, Ft as resolveWebOrigin, It as slackConfigured, Pt as requiredSecretKeys, Ut as SLACK_BOT_SCOPES, c as requestHashOf, ct as actorIdSchema, g as OPERATIONS, h as roleCanUseOperation, j as sortSkillFiles, k as skillReloadFileSchema, kt as configSchema, n as SLACK_OFF_FIX, o as remoteDoctorReportSchema, p as SYSTEMD_SERVICE_SETTINGS, pt as ERRORS, r as SLACK_PARTLY_FIX, vt as successEnvelopeSchema } from "./chunk-CqjDrIzS.mjs";
1
+ import { At as configSchema, Ft as requiredSecretKeys, It as resolveWebOrigin, Lt as slackConfigured, Wt as SLACK_BOT_SCOPES, c as requestHashOf, g as OPERATIONS, h as roleCanUseOperation, j as sortSkillFiles, k as skillReloadFileSchema, lt as actorIdSchema, mt as ERRORS, n as SLACK_OFF_FIX, o as remoteDoctorReportSchema, p as SYSTEMD_SERVICE_SETTINGS, r as SLACK_PARTLY_FIX, wt as DEFAULT_STAND_PORT_RANGE, yt as successEnvelopeSchema } from "./chunk-DD_jEQTA.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
- import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-BRiD3EcI.mjs";
4
- import { a as memoryVerdictCache, c as dataDirectory, d as readConfiguredPort, f as resolveDaemonAddress, i as fileVerdictCache, l as loadClientConfig, n as cliPackageVersion, o as boardSlackState, p as tokenInFolder, s as configFile, t as checkCatalog, u as loadEnrollmentConfig } from "./chunk-CqtrnYE5.mjs";
3
+ import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-BYzkU1Kt.mjs";
4
+ import { a as memoryVerdictCache, c as dataDirectory, d as readConfiguredPort, f as resolveDaemonAddress, i as fileVerdictCache, l as loadClientConfig, n as cliPackageVersion, o as boardSlackState, p as tokenInFolder, s as configFile, t as checkCatalog, u as loadEnrollmentConfig } from "./chunk-d9D_ohWO.mjs";
5
5
  import { createHash, randomBytes, randomUUID } from "node:crypto";
6
6
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
7
7
  import { homedir, hostname, tmpdir, userInfo } from "node:os";
package/dist/client.mjs CHANGED
@@ -1 +1 @@
1
- export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-BRiD3EcI.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-BYzkU1Kt.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as prApprovalPairSchema, A as skillReloadFilesSchema, At as defaultAddressee, B as entityRefSchema, Bt as COLUMN_IDS, C as SPACE_IDS, D as messageRefSchema, Dt as columnTurnTimings, E as interactionRefSchema, Et as boardWideSpurProject, F as AdapterError, Ft as resolveWebOrigin, G as trackerSourceId, Gt as TODO_GROUP_COLUMN_IDS, H as prSourceId, Ht as ITEM_KINDS, I as MIRROR_FAILURES, It as slackConfigured, J as REVIEW_STATES, K as PR_STATES, Kt as VIAS, L as MIRROR_FAILURE_CODES, Lt as BLOCK_TYPES, M as EVENT_KINDS, Mt as plainHttpAllowed, N as GATE_REASONS, Nt as readyMirrorOf, O as userIdSchema, Ot as configBindings, P as eventPayloadSchemas, Pt as requiredSecretKeys, Q as parseRingMarker, R as batchSchema, Rt as COLUMNS, St as DEFAULT_SLACK_COMMAND, T as inboundEventSchema, Tt as approvalRuleOf, U as sessionTransitionSchema, Ut as SLACK_BOT_SCOPES, V as mirrorSourceId, Vt as DISPATCHER_MODES, W as sourceCursorSchema, Wt as TASK_HOLDS, X as SESSION_STATUSES, Y as SESSION_HEALTH_STATES, Z as isExternalAuthor, _ as defaultBranchViewSchema, _t as ok, a as doctorReportSchema, at as ticketFactsSchema, b as renderHttpProblem, bt as DEFAULT_LINK, c as requestHashOf, ct as actorIdSchema, d as tokenRequestStatusSchema, dt as parseActorId, et as prFactsSchema, f as BOARD_TICK_MS, ft as parseRef$1, g as OPERATIONS, h as roleCanUseOperation, i as SPUR_MIN_VERSION, it as sessionFactsSchema, j as sortSkillFiles, jt as externalQuietAfterMs, kt as configSchema, l as tokenRequestResultSchema, lt as encodeActorId, m as buildCatalogSnapshot, mt as err, n as SLACK_OFF_FIX, nt as prReviewRuleSchema, ot as JIRA_PROJECT_KEY, pt as ERRORS, q as REVIEW_DECISIONS, qt as isTodoGroupColumn, r as SLACK_PARTLY_FIX, rt as ringMarker, s as TOKEN_REQUEST_LIMITS, st as REF_NUMBER, t as assertNever, tt as prRefSchema, u as tokenRequestSchema, ut as errorCodeOf, v as inboxNoSessionSchema, vt as successEnvelopeSchema, w as conversationRefSchema, wt as RESERVED_PROJECT, y as turnHandedSchema, z as defaultBranchFactSchema, zt as COLUMN_GROUPS } from "./chunk-CqjDrIzS.mjs";
1
+ import { $ as parseRingMarker, A as skillReloadFilesSchema, At as configSchema, B as defaultBranchFactSchema, Bt as COLUMN_GROUPS, C as SPACE_IDS, Ct as DEFAULT_SLACK_COMMAND, D as messageRefSchema, Dt as boardWideSpurProject, E as interactionRefSchema, Et as approvalRuleOf, F as AdapterError, Ft as requiredSecretKeys, G as sourceCursorSchema, Gt as TASK_HOLDS, H as mirrorSourceId, Ht as DISPATCHER_MODES, I as MIRROR_FAILURES, It as resolveWebOrigin, J as REVIEW_DECISIONS, Jt as isTodoGroupColumn, K as trackerSourceId, Kt as TODO_GROUP_COLUMN_IDS, L as MIRROR_FAILURE_CODES, Lt as slackConfigured, M as EVENT_KINDS, Mt as externalQuietAfterMs, N as GATE_REASONS, Nt as plainHttpAllowed, O as userIdSchema, Ot as columnTurnTimings, P as eventPayloadSchemas, Pt as readyMirrorOf, Q as isExternalAuthor, R as SPUR_REQUEST_TIMEOUT, Rt as BLOCK_TYPES, T as inboundEventSchema, Tt as RESERVED_PROJECT, U as prSourceId, Ut as ITEM_KINDS, V as entityRefSchema, Vt as COLUMN_IDS, W as sessionTransitionSchema, Wt as SLACK_BOT_SCOPES, X as SESSION_HEALTH_STATES, Y as REVIEW_STATES, Z as SESSION_STATUSES, _ as defaultBranchViewSchema, a as doctorReportSchema, at as sessionFactsSchema, b as renderHttpProblem, c as requestHashOf, ct as REF_NUMBER, d as tokenRequestStatusSchema, dt as errorCodeOf, et as prApprovalPairSchema, f as BOARD_TICK_MS, ft as parseActorId, g as OPERATIONS, h as roleCanUseOperation, ht as err, i as SPUR_MIN_VERSION, it as ringMarker, j as sortSkillFiles, jt as defaultAddressee, kt as configBindings, l as tokenRequestResultSchema, lt as actorIdSchema, m as buildCatalogSnapshot, mt as ERRORS, n as SLACK_OFF_FIX, nt as prRefSchema, ot as ticketFactsSchema, pt as parseRef$1, q as PR_STATES, qt as VIAS, r as SLACK_PARTLY_FIX, rt as prReviewRuleSchema, s as TOKEN_REQUEST_LIMITS, st as JIRA_PROJECT_KEY, t as assertNever, tt as prFactsSchema, u as tokenRequestSchema, ut as encodeActorId, v as inboxNoSessionSchema, vt as ok, w as conversationRefSchema, xt as DEFAULT_LINK, y as turnHandedSchema, yt as successEnvelopeSchema, z as batchSchema, zt as COLUMNS } from "./chunk-DD_jEQTA.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -19159,6 +19159,7 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
19159
19159
  kind: "board_observation",
19160
19160
  taskId: null,
19161
19161
  summary: `${source.source}: ${source.blind_message ?? source.blind_reason}`,
19162
+ ...source.source === "spur" && source.blind_reason === "stale" && source.failure_code === "spur_request_timeout" && { hashedSummary: "spur_request_timeout" },
19162
19163
  factAt: source.observed_at,
19163
19164
  source: source.source,
19164
19165
  priority: source.blind_reason === "auth" || source.blind_reason === "config" ? 2 : 4
@@ -24347,8 +24348,9 @@ function sourceText(item, state) {
24347
24348
  const reason = state?.blind_reason ?? null;
24348
24349
  const service = serviceOf(source);
24349
24350
  if (item.cleared_at !== null || reason === null || service === void 0) return stored;
24350
- const problem = PROBLEMS[reason];
24351
- const thing = reason === "auth" ? `the ${service} token` : reason === "config" ? `the ${source} settings in the board config` : reason === "stale" && source === "spur" ? "the Spur daemon" : void 0;
24351
+ const spurTimedOut = reason === "stale" && source === "spur" && state?.failure_code === "spur_request_timeout";
24352
+ const problem = spurTimedOut ? "answered slower than the timeout" : PROBLEMS[reason];
24353
+ const thing = reason === "auth" ? `the ${service} token` : reason === "config" ? `the ${source} settings in the board config` : reason === "stale" && source === "spur" ? spurTimedOut ? "tracked session count and host load" : "the Spur daemon" : void 0;
24352
24354
  if (problem === void 0 || thing === void 0) return stored;
24353
24355
  const message = state?.blind_message ?? null;
24354
24356
  return {
@@ -24434,7 +24436,8 @@ function createOperatorInbox(deps) {
24434
24436
  sourceIds.length === 0 ? Promise.resolve([]) : trx.selectFrom("source_state").select([
24435
24437
  "source",
24436
24438
  "blind_reason",
24437
- "blind_message"
24439
+ "blind_message",
24440
+ "failure_code"
24438
24441
  ]).where("source", "in", sourceIds).execute(),
24439
24442
  deliveryUrls(trx, items),
24440
24443
  waitingTurns(trx, openItems),
@@ -31223,21 +31226,31 @@ function runSource(entry, options, runnerStartMs, budgetWaits) {
31223
31226
  let lastReported;
31224
31227
  function state() {
31225
31228
  const deadline = staleDeadline(lastCompleteMs, runnerStartMs, staleMultiplier, intervalMs);
31226
- const blind = errorBlind ?? (now() > deadline ? staleBlind : void 0);
31229
+ let blind = errorBlind ?? (now() > deadline ? staleBlind : void 0);
31230
+ let failure = errorFailure;
31231
+ if (failure?.code === "spur_request_timeout") {
31232
+ if (blind?.reason === "stale") blind = {
31233
+ reason: "stale",
31234
+ message: failure.message
31235
+ };
31236
+ else failure = void 0;
31237
+ }
31227
31238
  return {
31228
31239
  ...lastCompleteMs === void 0 ? {} : { lastCompleteAt: iso$1(lastCompleteMs) },
31229
31240
  ...blind === void 0 ? {} : { blind },
31230
- ...errorFailure === void 0 ? {} : { failure: errorFailure },
31241
+ ...failure === void 0 ? {} : { failure },
31231
31242
  gone
31232
31243
  };
31233
31244
  }
31234
- /** The failure a failed poll reports: the error's code or the entry's default, else none. */
31245
+ /** The diagnostic a failed poll can report: a Spur timeout or a mirror failure. */
31235
31246
  function failureOf(error, step) {
31236
- const code = (error instanceof AdapterError ? error.code : void 0) ?? entry.defaultFailureCode;
31247
+ const adapterError = error instanceof AdapterError ? error : void 0;
31248
+ if (source === "spur" && step === "poll" && adapterError?.sourceFailure !== void 0) return adapterError.sourceFailure;
31249
+ const code = adapterError?.code ?? entry.defaultFailureCode;
31237
31250
  if (code === void 0) return void 0;
31238
31251
  return {
31239
31252
  code,
31240
- message: error instanceof AdapterError ? error.message : `The ${step} step failed`
31253
+ message: adapterError?.message ?? `The ${step} step failed`
31241
31254
  };
31242
31255
  }
31243
31256
  /** Appends the current state to the serial report chain; resolves when its step is done. */
@@ -31693,10 +31706,7 @@ const REQUEST_TIMEOUT_MS = 5e3;
31693
31706
  const TRANSITIONS_TIMEOUT_MS = 15e3;
31694
31707
  /** The longest wait between two failed Spur polls, so Spur load episodes blind the board briefly. */
31695
31708
  const SPUR_MAX_BACKOFF_MS = 6e4;
31696
- /**
31697
- * A failed Spur request with its place. It never carries `code`: the runner would report it as a
31698
- * source failure.
31699
- */
31709
+ /** A failed Spur request with its place for logging. */
31700
31710
  var SpurRequestError = class extends AdapterError {
31701
31711
  path;
31702
31712
  durationMs;
@@ -31710,6 +31720,11 @@ var SpurRequestError = class extends AdapterError {
31710
31720
  function describePlace(place) {
31711
31721
  return place.page === void 0 ? place.path : `${place.path} page ${String(place.page)}`;
31712
31722
  }
31723
+ const linksWire = z.array(z.object({
31724
+ label: z.string().min(1),
31725
+ url: z.string()
31726
+ }));
31727
+ const sessionLinkUrl = sessionFactsSchema.shape.links.valueType;
31713
31728
  const sessionWire = z.object({
31714
31729
  id: z.string().min(1),
31715
31730
  project: z.string().min(1),
@@ -31718,10 +31733,7 @@ const sessionWire = z.object({
31718
31733
  state: z.string().min(1),
31719
31734
  rateLimitResetAt: z.iso.datetime().optional(),
31720
31735
  lastActivityAt: z.iso.datetime().nullable().optional(),
31721
- slots: z.object({ links: z.array(z.object({
31722
- label: z.string().min(1),
31723
- url: z.url()
31724
- })).optional() }).optional(),
31736
+ slots: z.object({ links: linksWire.optional() }).optional(),
31725
31737
  queuedMessages: z.object({ messages: z.array(z.string()) }).optional()
31726
31738
  });
31727
31739
  const transitionWire = z.object({
@@ -31729,10 +31741,7 @@ const transitionWire = z.object({
31729
31741
  sessionId: z.string().min(1),
31730
31742
  project: z.string().min(1),
31731
31743
  at: z.iso.datetime(),
31732
- links: z.array(z.object({
31733
- label: z.string().min(1),
31734
- url: z.url()
31735
- })),
31744
+ links: linksWire,
31736
31745
  kind: z.enum(["status", "state"]),
31737
31746
  from: z.string().min(1).nullable(),
31738
31747
  to: z.string().min(1),
@@ -31761,6 +31770,7 @@ function createSpurAdapter(options) {
31761
31770
  let instanceId;
31762
31771
  const unknownHealthValues = /* @__PURE__ */ new Set();
31763
31772
  const unknownStatusValues = /* @__PURE__ */ new Set();
31773
+ const warnedLinks = /* @__PURE__ */ new Set();
31764
31774
  const isKnownHealth = (value) => SESSION_HEALTH_STATES.some((state) => state === value);
31765
31775
  const isKnownStatus = (value) => SESSION_STATUSES.some((status) => status === value);
31766
31776
  /** The HTTP-status failure of a finished request, with its place. */
@@ -31817,7 +31827,20 @@ function createSpurAdapter(options) {
31817
31827
  };
31818
31828
  } catch (error) {
31819
31829
  if (callerAborted()) throw new Error("Spur poll aborted", { cause: error });
31820
- if (didTimeOut()) throw new SpurRequestError("transient", "Spur request timed out", place(), { cause: error });
31830
+ if (didTimeOut()) {
31831
+ const timedOutAt = place();
31832
+ const route = describePlace({
31833
+ path: page !== void 0 ? "sessions/transitions" : path === "sessions" ? path : "sessions/<id>",
31834
+ page
31835
+ });
31836
+ throw new SpurRequestError("transient", "Spur request timed out", timedOutAt, {
31837
+ cause: error,
31838
+ sourceFailure: {
31839
+ code: SPUR_REQUEST_TIMEOUT,
31840
+ message: `${route} timed out after ${String(timedOutAt.durationMs)} ms (timeout ${String(timeoutMs)} ms)`
31841
+ }
31842
+ });
31843
+ }
31821
31844
  if (error instanceof AdapterError) throw error;
31822
31845
  throw new SpurRequestError("transient", "Spur request failed", place(), { cause: error });
31823
31846
  } finally {
@@ -31851,8 +31874,24 @@ function createSpurAdapter(options) {
31851
31874
  candidate
31852
31875
  };
31853
31876
  }
31877
+ function webLinks(sessionId, links) {
31878
+ const kept = [];
31879
+ for (const { label, url } of links) {
31880
+ const parsed = sessionLinkUrl.safeParse(url);
31881
+ if (parsed.success) {
31882
+ kept.push([label, parsed.data]);
31883
+ continue;
31884
+ }
31885
+ if (options.warn === void 0) continue;
31886
+ const key = JSON.stringify([sessionId, label]);
31887
+ if (warnedLinks.has(key)) continue;
31888
+ warnedLinks.add(key);
31889
+ options.warn(`Discarded invalid Spur web link ${JSON.stringify(label)} for session ${JSON.stringify(sessionId)}`);
31890
+ }
31891
+ return Object.fromEntries(kept);
31892
+ }
31854
31893
  function facts(wire, observedAt, state, endReason) {
31855
- const links = Object.fromEntries((wire.slots?.links ?? []).map(({ label, url }) => [label, url]));
31894
+ const links = webLinks(wire.id, wire.slots?.links ?? []);
31856
31895
  const prUrl = links["pr"];
31857
31896
  let pr = null;
31858
31897
  if (prUrl !== void 0) {
@@ -31918,7 +31957,7 @@ function createSpurAdapter(options) {
31918
31957
  session: entry.sessionId,
31919
31958
  spurProject: entry.project,
31920
31959
  at: entry.at,
31921
- links: Object.fromEntries(entry.links.map(({ label, url }) => [label, url])),
31960
+ links: webLinks(entry.sessionId, entry.links),
31922
31961
  dimension: entry.kind === "status" ? "lifecycle" : "health",
31923
31962
  from: entry.from,
31924
31963
  to: entry.to,
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { S as renderMcpError, g as OPERATIONS, pt as ERRORS } from "./chunk-CqjDrIzS.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-BRiD3EcI.mjs";
3
- import { a as memoryVerdictCache, l as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CqtrnYE5.mjs";
1
+ import { S as renderMcpError, g as OPERATIONS, mt as ERRORS } from "./chunk-DD_jEQTA.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-BYzkU1Kt.mjs";
3
+ import { a as memoryVerdictCache, l as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-d9D_ohWO.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.171.0",
3
+ "version": "0.171.2",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -17,8 +17,8 @@ Kinds of [operator inbox](how-board-works-blocks.md#operator-inbox) entries: wha
17
17
  | `inbound_failure` | a chat message could not be applied | check the daemon log, then retry the item | failure | a retry applies it or you close the item | stored target |
18
18
  | `inbound_gap` | chat messages may be missing | check the conversation for missed messages | failure | you close the item | stored target |
19
19
  | `board_observation` | any other key | check the task, then close the item | attention | the condition ends or you close the item | stored target |
20
- | `board_observation` `source:` | a source is blind | check the token, settings, daemon or source it names | failure | the source reads again | official GitHub REST troubleshooting or Jira REST docs; absent for Spur or unknown sources |
21
- | `board_observation` `default-branch:` | the latest check run of a push-triggered workflow on a linked repo's default-branch head failed, was cancelled or timed out, or a commit status there failed; other runs (scheduled, manual) and non-workflow check runs never count, and branch protection is not read. The text names the repo, first red commit, check and run; each red re-read moves its fact time, not the text; `status.get` shows `sources[].defaultBranch` | open the failing run; fix or revert | failure | a later default-branch head is green | stored failing run or status target, retained after handling |
20
+ | `board_observation` `source:` | a source is blind. Stale Spur shows path, elapsed time and limit if its latest poll timed out | for a Spur timeout, check tracked session count and host load. Otherwise follow the item's guidance | failure | reads resume. Dismissed timeouts stay closed across recovery | GitHub or Jira REST docs if applicable |
21
+ | `board_observation` `default-branch:` | on a linked repo's default-branch head, a commit status failed or any check's latest run from a push-triggered workflow failed, was cancelled or timed out. Other runs, non-workflow checks and branch protection are ignored. Shows repo, first red commit, check and run. Red reads refresh fact time only. See `sources[].defaultBranch` in `status.get`. | open the run, then fix or revert | failure | a later head is green | run or status target, kept after handling |
22
22
  | `board_observation` `pr-outcome:` | a linked PR closed unmerged or vanished | check the PR, then close the item or archive the task | attention | the PR is seen again or you close the item; unlinking does not clear it | stored target |
23
23
  | `board_observation` `lookup:` | the ticket lookup failed | check the tracker ticket, then close the item or archive the task | attention | a lookup succeeds or you close the item | stored target |
24
24
  | `board_observation` `operator-block:` | a block waits for you | not listed: shown as its block | attention | the block closes, also via Close on its feed line | stored target |
@@ -64,6 +64,11 @@ Opened from the bar or by `?open=services`, the left panel shows boxes from `sta
64
64
  and adds `Failure <code> · <message>` and a note that `ready-for-dev` is frozen. It has no
65
65
  status bar button.
66
66
 
67
+ When Spur is stale and its latest poll timed out, the Blind row and terminal `board status`
68
+ show the request path, any transitions page number, and the elapsed time and timeout in
69
+ milliseconds. The detail path appears as `sessions/<id>`. If the next poll gets a refusal or
70
+ an invalid response, the generic stale message returns. A complete poll clears the diagnostic.
71
+
67
72
  A box name adds `· <repo>` only when its group has two sources of that kind. A service button
68
73
  scrolls the panel to its service's failing box, else its degraded box, else its first box; among
69
74
  boxes in the same state it takes the one whose word the button shows, the source the daemon