spur-board 0.104.3 → 0.105.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.
@@ -1,4 +1,4 @@
1
- import { _ as renderJsonError, at as successEnvelopeSchema, c as tokenRequestStatusSchema, et as ERRORS, nt as errorContextSchema, o as tokenRequestResultSchema, rt as errorEnvelopeSchema } from "./chunk-DGsDK61k.mjs";
1
+ import { _ as renderJsonError, at as successEnvelopeSchema, c as tokenRequestStatusSchema, et as ERRORS, nt as errorContextSchema, o as tokenRequestResultSchema, rt as errorEnvelopeSchema } from "./chunk-IDeN7dOW.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -2921,6 +2921,7 @@ const inboxEntrySchema = z.strictObject({
2921
2921
  kind: z.enum(INBOX_KINDS).describe("block for a block addressed to the operator, turn for a turn, else the item kind."),
2922
2922
  severity: z.enum(INBOX_SEVERITIES).describe("failure: the board or a connection broke; attention: a decision, answer or other operator action is wanted."),
2923
2923
  text: z.string().describe("What needs the operator, in one line."),
2924
+ url: z.url({ protocol: /^https?$/ }).and(z.string().regex(/^[hH][tT][tT][pP][sS]?:\/\//)).optional().describe("Meaningful external destination for this entry, when known; HTTP(S) only. Task navigation takes precedence in the web inbox."),
2924
2925
  action: z.string().min(1).optional().describe("What the operator does about an item entry; the text ends with it. Absent on block and turn entries."),
2925
2926
  at: z.iso.datetime().describe("When the entry was raised or opened, ISO 8601 UTC."),
2926
2927
  task: taskKeySchema.nullable().describe("Task the entry is about; null when it has none."),
@@ -3753,10 +3754,11 @@ const OPERATIONS = [
3753
3754
  {
3754
3755
  id: "I9",
3755
3756
  project: "_board",
3756
- kind: "transport_health",
3757
+ kind: "board_observation",
3757
3758
  severity: "failure",
3758
- text: `slack delivery down since ${at} (connection lost): check the Slack app tokens`,
3759
- action: "check the Slack app tokens",
3759
+ text: "example/web: main is red (build): open the failing run; fix or revert",
3760
+ action: "open the failing run; fix or revert",
3761
+ url: "https://github.com/example/web/actions/runs/42",
3760
3762
  at,
3761
3763
  task: null
3762
3764
  },
@@ -1,5 +1,5 @@
1
- import { d as buildCatalogSnapshot, gt as plainHttpAllowed, mt as configSchema, p as OPERATIONS } from "./chunk-DGsDK61k.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-2UOGIWN_.mjs";
1
+ import { d as buildCatalogSnapshot, gt as plainHttpAllowed, mt as configSchema, p as OPERATIONS } from "./chunk-IDeN7dOW.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-D-1P5oeK.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 { St as SLACK_BOT_SCOPES, Y as actorIdSchema, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, et as ERRORS, f as roleCanUseOperation, mt as configSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as DEFAULT_STAND_PORT_RANGE, vt as resolveWebOrigin } from "./chunk-DGsDK61k.mjs";
1
+ import { St as SLACK_BOT_SCOPES, Y as actorIdSchema, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, et as ERRORS, f as roleCanUseOperation, mt as configSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as DEFAULT_STAND_PORT_RANGE, vt as resolveWebOrigin } from "./chunk-IDeN7dOW.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-2UOGIWN_.mjs";
4
- 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 "./chunk-BTkdnlO3.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-D-1P5oeK.mjs";
4
+ 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 "./chunk-gi-XmApc.mjs";
5
5
  import { createHash, randomBytes, randomUUID } from "node:crypto";
6
6
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
7
7
  import { homedir, hostname, 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-2UOGIWN_.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-D-1P5oeK.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as parseRef$1, A as defaultBranchFactSchema, B as isExternalAuthor, C as messageRefSchema, Ct as TASK_HOLDS, D as eventPayloadSchemas, E as GATE_REASONS, F as trackerSourceId, G as sessionFactsSchema, H as prFactsSchema, I as PR_STATES, J as REF_NUMBER, K as ticketFactsSchema, L as REVIEW_STATES, M as prSourceId, N as sessionTransitionSchema, O as AdapterError, P as sourceCursorSchema, Q as parseActorId, R as SESSION_HEALTH_STATES, S as interactionRefSchema, St as SLACK_BOT_SCOPES, T as EVENT_KINDS, U as prRefSchema, V as parseRingMarker, W as ringMarker, X as encodeActorId, Y as actorIdSchema, Z as errorCodeOf, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, b as conversationRefSchema, bt as DISPATCHER_MODES, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as RESERVED_PROJECT, et as ERRORS, f as roleCanUseOperation, ft as boardWideSpurProject, g as renderHttpProblem, gt as plainHttpAllowed, h as turnHandedSchema, ht as defaultAddressee, i as TOKEN_REQUEST_LIMITS, it as ok, j as entityRefSchema, k as batchSchema, l as BOARD_TICK_MS, lt as DEFAULT_SLACK_COMMAND, m as defaultBranchViewSchema, mt as configSchema, n as doctorReportSchema, o as tokenRequestResultSchema, p as OPERATIONS, pt as configBindings, q as JIRA_PROJECT_KEY, s as tokenRequestSchema, st as DEFAULT_LINK, t as assertNever, tt as err, vt as resolveWebOrigin, w as userIdSchema, wt as VIAS, x as inboundEventSchema, xt as ITEM_KINDS, y as SPACE_IDS, yt as COLUMN_IDS, z as SESSION_STATUSES } from "./chunk-DGsDK61k.mjs";
1
+ import { $ as parseRef$1, A as defaultBranchFactSchema, B as isExternalAuthor, C as messageRefSchema, Ct as TASK_HOLDS, D as eventPayloadSchemas, E as GATE_REASONS, F as trackerSourceId, G as sessionFactsSchema, H as prFactsSchema, I as PR_STATES, J as REF_NUMBER, K as ticketFactsSchema, L as REVIEW_STATES, M as prSourceId, N as sessionTransitionSchema, O as AdapterError, P as sourceCursorSchema, Q as parseActorId, R as SESSION_HEALTH_STATES, S as interactionRefSchema, St as SLACK_BOT_SCOPES, T as EVENT_KINDS, U as prRefSchema, V as parseRingMarker, W as ringMarker, X as encodeActorId, Y as actorIdSchema, Z as errorCodeOf, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, b as conversationRefSchema, bt as DISPATCHER_MODES, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as RESERVED_PROJECT, et as ERRORS, f as roleCanUseOperation, ft as boardWideSpurProject, g as renderHttpProblem, gt as plainHttpAllowed, h as turnHandedSchema, ht as defaultAddressee, i as TOKEN_REQUEST_LIMITS, it as ok, j as entityRefSchema, k as batchSchema, l as BOARD_TICK_MS, lt as DEFAULT_SLACK_COMMAND, m as defaultBranchViewSchema, mt as configSchema, n as doctorReportSchema, o as tokenRequestResultSchema, p as OPERATIONS, pt as configBindings, q as JIRA_PROJECT_KEY, s as tokenRequestSchema, st as DEFAULT_LINK, t as assertNever, tt as err, vt as resolveWebOrigin, w as userIdSchema, wt as VIAS, x as inboundEventSchema, xt as ITEM_KINDS, y as SPACE_IDS, yt as COLUMN_IDS, z as SESSION_STATUSES } from "./chunk-IDeN7dOW.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";
@@ -13634,7 +13634,7 @@ const deliveryPayloadSchema = z.object({
13634
13634
  notificationId: z.unknown().optional()
13635
13635
  });
13636
13636
  /** The outbox row of a `delivery:<outbox id>` item; the item itself has no task. */
13637
- function deliveryId(item) {
13637
+ function deliveryId$1(item) {
13638
13638
  return item.kind === "post_failed" && item.task_id === null ? Number(item.item_key.slice(9)) : void 0;
13639
13639
  }
13640
13640
  /**
@@ -13643,7 +13643,7 @@ function deliveryId(item) {
13643
13643
  */
13644
13644
  async function deliveryOwners(trx, items) {
13645
13645
  const owners = /* @__PURE__ */ new Map();
13646
- const outboxIds = items.flatMap((item) => deliveryId(item) ?? []);
13646
+ const outboxIds = items.flatMap((item) => deliveryId$1(item) ?? []);
13647
13647
  if (outboxIds.length === 0) return owners;
13648
13648
  const rows = await trx.selectFrom("outbox").select([
13649
13649
  "id",
@@ -13680,7 +13680,7 @@ async function deliveryOwners(trx, items) {
13680
13680
  const tasks = await trx.selectFrom("task").selectAll().where("id", "in", [...new Set(taskIds.values())]).execute();
13681
13681
  const taskById = new Map(tasks.map((task) => [task.id, task]));
13682
13682
  for (const item of items) {
13683
- const outboxId = deliveryId(item);
13683
+ const outboxId = deliveryId$1(item);
13684
13684
  const taskId = outboxId === void 0 ? void 0 : taskIds.get(outboxId);
13685
13685
  const task = taskId === void 0 ? void 0 : taskById.get(taskId);
13686
13686
  if (task !== void 0) owners.set(item.id, task);
@@ -14098,6 +14098,52 @@ function serviceOf(source) {
14098
14098
  if (source.startsWith("github:") || source.startsWith("github-issues:")) return "GitHub";
14099
14099
  return source.startsWith("jira:") ? "Jira" : void 0;
14100
14100
  }
14101
+ const externalUrlSchema = z.url({ protocol: /^https?$/ });
14102
+ /** Only structured destinations count; the task-less feed placeholder is never navigation. */
14103
+ function meaningfulUrl(value) {
14104
+ if (!externalUrlSchema.safeParse(value).success) return void 0;
14105
+ const url = new URL(value);
14106
+ if (url.origin === "https://github.com" && url.pathname === "/") return void 0;
14107
+ return url.href;
14108
+ }
14109
+ function deliveredUrl(value) {
14110
+ if (value === null) return void 0;
14111
+ let decoded;
14112
+ try {
14113
+ decoded = JSON.parse(value);
14114
+ } catch (error) {
14115
+ if (!(error instanceof SyntaxError)) throw error;
14116
+ return;
14117
+ }
14118
+ const ref = deliveredRefSchema.safeParse(decoded);
14119
+ return ref.success ? meaningfulUrl(ref.data.permalink) : void 0;
14120
+ }
14121
+ function deliveryId(item) {
14122
+ if (item.kind !== "post_failed" || !/^delivery:[1-9]\d*$/.test(item.item_key)) return void 0;
14123
+ const id = Number(item.item_key.slice(9));
14124
+ return Number.isSafeInteger(id) ? id : void 0;
14125
+ }
14126
+ /** One batched join, including only the immediate parent of each failed delivery. */
14127
+ async function deliveryUrls(trx, items) {
14128
+ const ids = items.flatMap((item) => deliveryId(item) ?? []);
14129
+ if (ids.length === 0) return /* @__PURE__ */ new Map();
14130
+ const rows = await trx.selectFrom("outbox").leftJoin("outbox as parent", "parent.id", "outbox.parent_outbox_id").select([
14131
+ "outbox.id",
14132
+ "outbox.external_ref",
14133
+ "parent.external_ref as parent_ref"
14134
+ ]).where("outbox.id", "in", ids).execute();
14135
+ return new Map(rows.map((row) => [row.id, deliveredUrl(row.external_ref) ?? deliveredUrl(row.parent_ref)]));
14136
+ }
14137
+ function itemUrl(item, deliveries) {
14138
+ if (item.item_key.startsWith("source:")) {
14139
+ const service = serviceOf(item.item_key.slice(7));
14140
+ if (service === "GitHub") return "https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api";
14141
+ if (service === "Jira") return "https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro";
14142
+ return;
14143
+ }
14144
+ const id = deliveryId(item);
14145
+ return id === void 0 ? meaningfulUrl(item.url) : deliveries.get(id);
14146
+ }
14101
14147
  /**
14102
14148
  * The text of a source item: built from the source's state while it is open and blind; a cleared
14103
14149
  * or unknown one keeps its stored text, which names the failure it had.
@@ -14176,7 +14222,7 @@ function createOperatorInbox(deps) {
14176
14222
  const items = [...openItems, ...lastCleared.values()];
14177
14223
  const blockIds = [...new Set(items.flatMap((item) => itemBlockRef(item) ?? []))];
14178
14224
  const sourceIds = items.flatMap((item) => item.item_key.startsWith("source:") ? [item.item_key.slice(7)] : []);
14179
- const [referenced, owners, sources] = await Promise.all([
14225
+ const [referenced, owners, sources, deliveries] = await Promise.all([
14180
14226
  blockIds.length === 0 ? Promise.resolve([]) : trx.selectFrom("block").leftJoin("task", "task.id", "block.task_id").select([
14181
14227
  "block.id",
14182
14228
  "block.addressee_role",
@@ -14189,7 +14235,8 @@ function createOperatorInbox(deps) {
14189
14235
  "source",
14190
14236
  "blind_reason",
14191
14237
  "blind_message"
14192
- ]).where("source", "in", sourceIds).execute()
14238
+ ]).where("source", "in", sourceIds).execute(),
14239
+ deliveryUrls(trx, items)
14193
14240
  ]);
14194
14241
  const blockById = new Map(referenced.map((block) => [block.id, block]));
14195
14242
  const sourceById = new Map(sources.map((state) => [state.source, state]));
@@ -14208,6 +14255,7 @@ function createOperatorInbox(deps) {
14208
14255
  task
14209
14256
  })
14210
14257
  };
14258
+ const url = itemUrl(item, deliveries);
14211
14259
  return {
14212
14260
  id: `I${String(item.id)}`,
14213
14261
  project: task?.project ?? (block === void 0 ? "_board" : blockProject(block.project)),
@@ -14217,6 +14265,7 @@ function createOperatorInbox(deps) {
14217
14265
  action,
14218
14266
  at: item.raised_at,
14219
14267
  task: task?.key ?? null,
14268
+ ...url === void 0 ? {} : { url },
14220
14269
  ...item.cleared_at === null ? {} : { handledAt: item.cleared_at }
14221
14270
  };
14222
14271
  };
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { et as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-DGsDK61k.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-2UOGIWN_.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-BTkdnlO3.mjs";
1
+ import { et as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-IDeN7dOW.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-D-1P5oeK.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-gi-XmApc.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";