spur-board 0.32.0 → 0.33.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 { G as configSchema, K as requiredSecretKeys, P as ERRORS, l as roleCanUseOperation, q as SLACK_BOT_SCOPES, r as SYSTEMD_SERVICE_SETTINGS, u as OPERATIONS } from "./src-B63VaSzU.mjs";
2
- import { a as errorExitCode, i as CliError, n as requestOperation, o as renderCliError, r as requestTokenEnrollment, s as escapeTerminalControls } from "./client-DtDNMMO-.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./config-D3ltZ-MU.mjs";
1
+ import { G as configSchema, K as requiredSecretKeys, P as ERRORS, l as roleCanUseOperation, q as SLACK_BOT_SCOPES, r as SYSTEMD_SERVICE_SETTINGS, u as OPERATIONS } from "./src-8BDCEAvV.mjs";
2
+ import { a as errorExitCode, i as CliError, n as requestOperation, o as renderCliError, r as requestTokenEnrollment, s as escapeTerminalControls } from "./client-uUHdF1cr.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./config-wjhrCN29.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";
@@ -1940,7 +1940,7 @@ function positionalInput(op, field, value) {
1940
1940
  if (!revisionEntryArray(fieldSchema(op, field)) || !Array.isArray(value)) return value;
1941
1941
  return value.map((item) => {
1942
1942
  if (typeof item !== "string") return item;
1943
- if (/^B[1-9][0-9]*$/.test(item)) return { id: item };
1943
+ if (!item.includes("@")) return { id: item };
1944
1944
  const match = /^([^@]+)@([1-9][0-9]*)$/.exec(item);
1945
1945
  const id = match?.[1];
1946
1946
  const rawRevision = match?.[2];
@@ -1,4 +1,4 @@
1
- import { I as errorContextSchema, L as errorEnvelopeSchema, P as ERRORS, f as renderJsonError, z as successEnvelopeSchema } from "./src-B63VaSzU.mjs";
1
+ import { I as errorContextSchema, L as errorEnvelopeSchema, P as ERRORS, f as renderJsonError, z as successEnvelopeSchema } from "./src-8BDCEAvV.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 { n as requestOperation, r as requestTokenEnrollment, t as fetchCatalogVersion } from "./client-DtDNMMO-.mjs";
1
+ import { n as requestOperation, r as requestTokenEnrollment, t as fetchCatalogVersion } from "./client-uUHdF1cr.mjs";
2
2
  export { fetchCatalogVersion, requestOperation, requestTokenEnrollment };
@@ -1,5 +1,5 @@
1
- import { G as configSchema, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-B63VaSzU.mjs";
2
- import { i as CliError, t as fetchCatalogVersion } from "./client-DtDNMMO-.mjs";
1
+ import { G as configSchema, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-8BDCEAvV.mjs";
2
+ import { i as CliError, t as fetchCatalogVersion } from "./client-uUHdF1cr.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 { A as errorCodeOf, C as SESSION_STATUSES, D as ticketFactsSchema, E as sessionFactsSchema, F as err, G as configSchema, K as requiredSecretKeys, M as parseRef$1, N as taskKeySchema, O as actorIdSchema, P as ERRORS, R as ok, S as SESSION_HEALTH_STATES, T as prRefSchema, U as DEFAULT_SLACK_COMMAND, V as DEFAULT_LINK, W as RESERVED_PROJECT, _ as interactionRefSchema, a as batchSchema, b as EVENT_KINDS, c as buildCatalogSnapshot, d as renderHttpProblem, g as inboundEventSchema, h as conversationRefSchema, i as AdapterError, j as parseActorId, k as encodeActorId, l as roleCanUseOperation, m as SPACE_IDS, n as BOARD_TICK_MS, o as entityRefSchema, q as SLACK_BOT_SCOPES, s as sourceCursorSchema, t as assertNever, u as OPERATIONS, v as messageRefSchema, w as prFactsSchema, x as eventPayloadSchemas, y as userIdSchema, z as successEnvelopeSchema } from "./src-B63VaSzU.mjs";
1
+ import { A as errorCodeOf, C as SESSION_STATUSES, D as ticketFactsSchema, E as sessionFactsSchema, F as err, G as configSchema, K as requiredSecretKeys, M as parseRef$1, N as taskKeySchema, O as actorIdSchema, P as ERRORS, R as ok, S as SESSION_HEALTH_STATES, T as prRefSchema, U as DEFAULT_SLACK_COMMAND, V as DEFAULT_LINK, W as RESERVED_PROJECT, _ as interactionRefSchema, a as batchSchema, b as EVENT_KINDS, c as buildCatalogSnapshot, d as renderHttpProblem, g as inboundEventSchema, h as conversationRefSchema, i as AdapterError, j as parseActorId, k as encodeActorId, l as roleCanUseOperation, m as SPACE_IDS, n as BOARD_TICK_MS, o as entityRefSchema, q as SLACK_BOT_SCOPES, s as sourceCursorSchema, t as assertNever, u as OPERATIONS, v as messageRefSchema, w as prFactsSchema, x as eventPayloadSchemas, y as userIdSchema, z as successEnvelopeSchema } from "./src-8BDCEAvV.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import { closeSync, existsSync, fstatSync, fsyncSync, ftruncateSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeSync } from "node:fs";
@@ -7904,16 +7904,22 @@ function trackerSource(project) {
7904
7904
  function projectForSource(config, source) {
7905
7905
  return config.projects.find((project) => source === trackerSource(project) || project.repos.some((repo) => source === `github:${project.id}:${repo.toLowerCase()}`));
7906
7906
  }
7907
+ /** The one project whose tracker takes `key` by its form: Jira for `ABC-1`, GitHub for `#`. */
7907
7908
  function projectForKey(config, key) {
7909
+ const parsed = parseRef$1(key, "task");
7910
+ if (!parsed.ok || parsed.value.kind !== "task") return null;
7911
+ const { form } = parsed.value;
7908
7912
  const lowerKey = key.toLowerCase();
7909
7913
  const matched = config.projects.filter((project) => {
7910
7914
  const tracker = project.tracker;
7911
7915
  if (tracker.type === "github-issues") {
7912
- const prefix = `${tracker.repo.toLowerCase()}#`;
7913
- const short = tracker.repo.split("/")[1];
7914
- return lowerKey.startsWith(prefix) || short !== void 0 && lowerKey.startsWith(`${short.toLowerCase()}#`);
7916
+ const repo = lowerKey.split("#")[0];
7917
+ const full = tracker.repo.toLowerCase();
7918
+ if (form === "github") return repo === full;
7919
+ return form === "github-short" && repo === full.split("/")[1];
7915
7920
  }
7916
- const prefix = /^([A-Za-z][A-Za-z0-9_]*)-/.exec(key)?.[1]?.toUpperCase();
7921
+ if (form !== "jira") return false;
7922
+ const prefix = key.split("-")[0]?.toUpperCase();
7917
7923
  return prefix !== void 0 && (tracker.projectKeys.length === 0 || tracker.projectKeys.includes(prefix));
7918
7924
  });
7919
7925
  return matched.length === 1 ? matched[0] ?? null : null;
@@ -10295,6 +10301,10 @@ function createBlockMutations(config) {
10295
10301
  async resolveTargets(trx, input) {
10296
10302
  return Promise.all(input.entries.map(async ({ id }) => {
10297
10303
  if (id.startsWith("C")) return commentTarget(trx, id);
10304
+ if (id.startsWith("T")) return {
10305
+ kind: "missing",
10306
+ id
10307
+ };
10298
10308
  const target = (await blockTarget(trx, id))[0];
10299
10309
  return target === void 0 ? {
10300
10310
  kind: "missing",
@@ -11817,7 +11827,8 @@ function createTaskQueries(config) {
11817
11827
  }
11818
11828
  return {
11819
11829
  comments,
11820
- blocks
11830
+ blocks,
11831
+ turns: []
11821
11832
  };
11822
11833
  }
11823
11834
  }
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { P as ERRORS, p as renderMcpError, u as OPERATIONS } from "./src-B63VaSzU.mjs";
2
- import { i as CliError, n as requestOperation } from "./client-DtDNMMO-.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-D3ltZ-MU.mjs";
1
+ import { P as ERRORS, p as renderMcpError, u as OPERATIONS } from "./src-8BDCEAvV.mjs";
2
+ import { i as CliError, n as requestOperation } from "./client-uUHdF1cr.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-wjhrCN29.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";
@@ -263,6 +263,7 @@ const projectSchema = z.strictObject({
263
263
  }).regex(/^[a-z][a-z0-9-]*$/, "Expected lowercase letters, digits and dashes"),
264
264
  tracker: z.discriminatedUnion("type", [jiraTracker, githubIssuesTracker]),
265
265
  repos: z.array(repoSlugSchema).min(1),
266
+ reposWithoutCi: z.array(repoSlugSchema).default([]).describe("Repos from repos that run no CI checks, in any letter case. In a listed repo, a PR whose check list on head is empty passes the Dev gate check condition instead of waiting in Dev. A list of only skipped checks still waits, and red or pending checks still count. A listed repo whose branch protection requires checks that have not reported yet also passes, so list only repos that run no checks. Without this key, a PR with no checks waits in Dev."),
266
267
  link: z.strictObject({
267
268
  sources: z.array(z.enum(LINK_SOURCES)).min(1).superRefine((sources, ctx) => {
268
269
  sources.forEach((source, i) => {
@@ -297,6 +298,15 @@ const projectSchema = z.strictObject({
297
298
  cycleLimit: DEFAULT_CYCLE_LIMIT
298
299
  })))
299
300
  }).superRefine((project, ctx) => {
301
+ const repos = new Set(project.repos.map((repo) => repo.toLowerCase()));
302
+ project.reposWithoutCi.forEach((repo, j) => {
303
+ if (repos.has(repo.toLowerCase())) return;
304
+ ctx.addIssue({
305
+ code: "custom",
306
+ path: ["reposWithoutCi", j],
307
+ message: `Repository ${JSON.stringify(repo)} is not in repos`
308
+ });
309
+ });
300
310
  const spurNames = new Set(project.spurProjects.map((p) => p.name));
301
311
  project.columns.forEach(({ orchestrator }, j) => {
302
312
  if (orchestrator === "none" || orchestrator === "operator" || spurNames.has(orchestrator)) return;
@@ -769,12 +779,14 @@ const PATTERNS = {
769
779
  block: `^B${N$1}$`,
770
780
  comment: `^C${N$1}$`,
771
781
  item: `^I${N$1}$`,
782
+ turn: `^T${N$1}$`,
772
783
  task: `^(?:${TASK_FORMS.map((t) => t.source).join("|")})$`
773
784
  };
774
785
  const NUMBERED_KINDS = [
775
786
  "block",
776
787
  "comment",
777
- "item"
788
+ "item",
789
+ "turn"
778
790
  ];
779
791
  function matchRef(text) {
780
792
  for (const kind of NUMBERED_KINDS) if (new RegExp(PATTERNS[kind]).test(text)) return {
@@ -790,9 +802,9 @@ function matchRef(text) {
790
802
  return null;
791
803
  }
792
804
  /**
793
- * Parses a block, comment or item ID or a task key. Block, comment and item IDs are tried
794
- * first, so `B12` is a block and `B-12` a Jira key. A valid ID of another kind than `expected`
795
- * is `wrong_id_kind`; anything else that does not parse is `usage`.
805
+ * Parses a block, comment, item or turn ID or a task key. Numbered IDs are tried first, so
806
+ * `B12` is a block and `B-12` a Jira key. A valid ID of another kind than `expected` is
807
+ * `wrong_id_kind`; anything else that does not parse is `usage`.
796
808
  */
797
809
  function parseRef(text, expected) {
798
810
  const ref = matchRef(text);
@@ -804,6 +816,7 @@ const EXAMPLES = {
804
816
  block: "B12",
805
817
  comment: "C3",
806
818
  item: "I7",
819
+ turn: "T4",
807
820
  task: "PROJ-123, owner/repo#42 or repo#42"
808
821
  };
809
822
  function refSchema(kind, description) {
@@ -820,6 +833,7 @@ function refSchema(kind, description) {
820
833
  const blockIdSchema = refSchema("block", "Block ID: B followed by a number, e.g. B12.");
821
834
  const commentIdSchema = refSchema("comment", "Comment ID: C followed by a number, e.g. C3.");
822
835
  const itemIdSchema = refSchema("item", "Item ID: I followed by a number, e.g. I7.");
836
+ const turnIdSchema = refSchema("turn", "Turn ID: T followed by a number, e.g. T4.");
823
837
  const taskKeySchema = refSchema("task", "Task key: a Jira key (PROJ-123) or a GitHub issue (owner/repo#42, or repo#42).");
824
838
  /** The error code for a failed parse: `wrong_id_kind` when an ID of another kind was given. */
825
839
  function errorCodeOf(error) {
@@ -1608,6 +1622,26 @@ const blockViewSchema = z.strictObject({
1608
1622
  unblockedBy: actorIdSchema.nullable().describe("Actor that unblocked the block; null while open."),
1609
1623
  unblockedAt: z.iso.datetime().nullable().describe("When the block was unblocked; null while open.")
1610
1624
  }).describe("A block on a task.");
1625
+ /** One pull request comment or review a turn handed to its executor. */
1626
+ const turnHandedSchema = z.strictObject({
1627
+ ...prRefSchema.shape,
1628
+ kind: z.enum(FEEDBACK_KINDS).describe("Whether this is a comment or a submitted review."),
1629
+ id: z.string().min(1).describe("Stable id of the comment or review in the source."),
1630
+ postedAt: z.iso.datetime().describe("When the comment was posted or the review submitted, ISO 8601 UTC.")
1631
+ }).describe("Pull request feedback handed over with a turn.");
1632
+ const turnViewSchema = z.strictObject({
1633
+ id: turnIdSchema,
1634
+ task: taskKeySchema,
1635
+ column: z.enum(COLUMN_IDS).describe("Board column the turn belongs to."),
1636
+ addressee: z.enum(ADDRESSEE_ROLES).describe("Who executes the turn."),
1637
+ reason: z.string().describe("Why the turn was handed to the executor."),
1638
+ handed: z.array(turnHandedSchema).describe("Pull request feedback handed over with the turn."),
1639
+ at: z.iso.datetime().describe("When the turn was opened, ISO 8601 UTC."),
1640
+ taken: z.strictObject({
1641
+ by: actorIdSchema,
1642
+ at: z.iso.datetime().describe("When the turn was taken, ISO 8601 UTC.")
1643
+ }).nullable().describe("Who took the turn and when; null until it is taken.")
1644
+ }).describe("A turn: the executor of a column is asked to act on a task.");
1611
1645
  const itemViewSchema = z.strictObject({
1612
1646
  id: itemIdSchema,
1613
1647
  task: taskKeySchema.nullable().describe("Task the item is about; null for a board-wide item."),
@@ -1801,6 +1835,22 @@ const comment = {
1801
1835
  ackedRevision: null,
1802
1836
  untrusted: true
1803
1837
  };
1838
+ const reviewTurn = {
1839
+ id: "T4",
1840
+ task: "PROJ-123",
1841
+ column: "review",
1842
+ addressee: "orchestrator:review",
1843
+ reason: "The pull request is ready for review.",
1844
+ at,
1845
+ taken: null
1846
+ };
1847
+ const handedReview = {
1848
+ repo: "acme/web",
1849
+ number: 42,
1850
+ kind: "review",
1851
+ id: "PRR_kwDOA1",
1852
+ postedAt: at
1853
+ };
1804
1854
  const item = {
1805
1855
  id: "I7",
1806
1856
  task: "PROJ-123",
@@ -2056,7 +2106,7 @@ const OPERATIONS = [
2056
2106
  defineOperation({
2057
2107
  id: "inbox.get",
2058
2108
  kind: "query",
2059
- description: "List the comments and blocks addressed to the caller and not yet handled.",
2109
+ description: "List the comments, blocks and turns addressed to the caller and not yet handled.",
2060
2110
  mcp: {
2061
2111
  whenToUse: "Read items awaiting the caller.",
2062
2112
  whenNotToUse: "Use inbox_ack to mark them read."
@@ -2064,7 +2114,8 @@ const OPERATIONS = [
2064
2114
  input: z.strictObject({ project }),
2065
2115
  output: z.strictObject({
2066
2116
  comments: z.array(commentSchema).describe("Comments not yet acknowledged."),
2067
- blocks: z.array(blockViewSchema).describe("Open blocks addressed to the caller.")
2117
+ blocks: z.array(blockViewSchema).describe("Open blocks addressed to the caller."),
2118
+ turns: z.array(turnViewSchema).describe("Unclosed turns the caller may take or has taken; at most one per task.")
2068
2119
  }),
2069
2120
  grants: [{ grant: "project-agent" }, { grant: "operator" }],
2070
2121
  errors: ["not_found"],
@@ -2078,23 +2129,35 @@ const OPERATIONS = [
2078
2129
  input: {},
2079
2130
  output: {
2080
2131
  comments: [comment],
2081
- blocks: [codeBlock]
2132
+ blocks: [codeBlock],
2133
+ turns: [{
2134
+ ...reviewTurn,
2135
+ handed: [handedReview]
2136
+ }]
2082
2137
  }
2083
2138
  }]
2084
2139
  }),
2085
2140
  defineOperation({
2086
2141
  id: "inbox.ack",
2087
2142
  kind: "mutation",
2088
- description: "Mark comments or agent-addressed blocks as read in the inbox.",
2143
+ description: "Mark comments, agent-addressed blocks or turns as read; acking a turn makes the caller its taker.",
2089
2144
  mcp: {
2090
2145
  whenToUse: "Mark handled inbox items read.",
2091
2146
  whenNotToUse: "Use inbox_get to inspect them first."
2092
2147
  },
2093
- input: z.strictObject({ entries: z.array(z.union([z.strictObject({
2094
- id: commentIdSchema,
2095
- revision: z.int().positive().describe("Revision the caller read.")
2096
- }), z.strictObject({ id: blockIdSchema })])).min(1).describe("Comment revisions and blocks to acknowledge.") }),
2097
- output: z.strictObject({ acked: z.array(z.union([commentIdSchema, blockIdSchema])).describe("Entries now acknowledged.") }),
2148
+ input: z.strictObject({ entries: z.array(z.union([
2149
+ z.strictObject({
2150
+ id: commentIdSchema,
2151
+ revision: z.int().positive().describe("Revision the caller read.")
2152
+ }),
2153
+ z.strictObject({ id: blockIdSchema }),
2154
+ z.strictObject({ id: turnIdSchema })
2155
+ ])).min(1).describe("Comment revisions, blocks and turns to acknowledge.") }),
2156
+ output: z.strictObject({ acked: z.array(z.union([
2157
+ commentIdSchema,
2158
+ blockIdSchema,
2159
+ turnIdSchema
2160
+ ])).describe("Entries now acknowledged.") }),
2098
2161
  grants: [{ grant: "project-agent" }],
2099
2162
  errors: [
2100
2163
  "wrong_id_kind",
@@ -2106,18 +2169,26 @@ const OPERATIONS = [
2106
2169
  args: ["entries"]
2107
2170
  },
2108
2171
  slack: null,
2109
- examples: [{
2110
- summary: "Acknowledge a comment revision",
2111
- input: { entries: [{
2112
- id: "C3",
2113
- revision: 1
2114
- }] },
2115
- output: { acked: ["C3"] }
2116
- }, {
2117
- summary: "Acknowledge an agent-addressed block",
2118
- input: { entries: [{ id: "B13" }] },
2119
- output: { acked: ["B13"] }
2120
- }]
2172
+ examples: [
2173
+ {
2174
+ summary: "Acknowledge a comment revision",
2175
+ input: { entries: [{
2176
+ id: "C3",
2177
+ revision: 1
2178
+ }] },
2179
+ output: { acked: ["C3"] }
2180
+ },
2181
+ {
2182
+ summary: "Acknowledge an agent-addressed block",
2183
+ input: { entries: [{ id: "B13" }] },
2184
+ output: { acked: ["B13"] }
2185
+ },
2186
+ {
2187
+ summary: "Take a turn",
2188
+ input: { entries: [{ id: "T4" }] },
2189
+ output: { acked: ["T4"] }
2190
+ }
2191
+ ]
2121
2192
  }),
2122
2193
  defineOperation({
2123
2194
  id: "token.list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -63,7 +63,7 @@ Other errors: none.
63
63
 
64
64
  ### `board inbox`
65
65
 
66
- Purpose: List the comments and blocks addressed to the caller and not yet handled.
66
+ Purpose: List the comments, blocks and turns addressed to the caller and not yet handled.
67
67
  Arguments: none.
68
68
  Flags: `--project <value>`, `--json`.
69
69
  Use when: Read items awaiting the caller.
@@ -73,7 +73,7 @@ Other errors: `not_found`.
73
73
 
74
74
  ### `board inbox ack`
75
75
 
76
- Purpose: Mark comments or agent-addressed blocks as read in the inbox.
76
+ Purpose: Mark comments, agent-addressed blocks or turns as read; acking a turn makes the caller its taker.
77
77
  Arguments: `<entries>`.
78
78
  Flags: `--key <key>`, `--json`.
79
79
  Use when: Mark handled inbox items read.