spur-board 0.75.0 → 0.77.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 { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-CvY4Vfxu.mjs";
1
+ import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-tFE-9H7j.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -1,5 +1,5 @@
1
- import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-CvY4Vfxu.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-bhSEp4Rg.mjs";
1
+ import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-tFE-9H7j.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-BPJsPCN1.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";
@@ -171,6 +171,29 @@ const TASK_HOLDS = [
171
171
  "cycle_limit",
172
172
  "work_not_started"
173
173
  ];
174
+ /** Every operator item kind; core's `ITEM_POLICY` gives each one a policy. */
175
+ const ITEM_KINDS = [
176
+ "token_request",
177
+ "post_blocked",
178
+ "post_failed",
179
+ "transport_health",
180
+ "answer_undelivered",
181
+ "worker_not_reading",
182
+ "answer_author_unavailable",
183
+ "inbound_failure",
184
+ "inbound_gap",
185
+ "board_observation",
186
+ "worker_ended",
187
+ "turn",
188
+ "anomaly",
189
+ "cycle_limit",
190
+ "course_check",
191
+ "conversation_waiting"
192
+ ];
193
+ /** What an `inbox.operator` entry is: a block addressed to the operator, else an item kind. */
194
+ const INBOX_KINDS = ["block", ...ITEM_KINDS];
195
+ /** `failure`: something the board or a connection broke; `attention`: a decision or answer. */
196
+ const INBOX_SEVERITIES = ["attention", "failure"];
174
197
  /** Who caused a journal event. */
175
198
  const ACTORS = [
176
199
  "operator",
@@ -664,7 +687,7 @@ const configObject = z.strictObject({
664
687
  }).prefault({}),
665
688
  http: z.strictObject({ port: z.int().min(0).max(65535).default(DEFAULT_HTTP_PORT).describe("Local HTTP API port (0 assigns a free port). The default 4777 is above 4310-4399, a margin kept for Spur's server port 4310 and the ports from 4311 upward that its MCP port takes, and avoids Spur's ports 5555 and 8730-8799 and the Linux ephemeral range 32768-60999.") }).prefault({}),
666
689
  web: z.strictObject({
667
- port: z.int().min(0).max(65535).optional().describe("Optional web listener port (0 assigns a free port); omitted means off. Set together with publicOrigin. Must differ from http.port, including when both are 0. This config does not start a listener."),
690
+ port: z.int().min(0).max(65535).optional().describe("Optional web listener port (0 assigns a free port); omitted means off. Set together with publicOrigin. Must differ from http.port, including when both are 0."),
668
691
  publicOrigin: z.string().optional().describe("Bare public HTTP/HTTPS origin for the web API; HTTP requires loopback. Set together with port. Every {port} is replaced with the listener port, including in hostnames. No trailing slash. The resolved origin must remain valid and HTTP loopback-only after actual-port substitution; the resolver returns no origin for an invalid actual port or resulting origin."),
669
692
  spurUiOrigin: concreteOrigin.optional().describe("Optional concrete bare origin for the Spur UI, independently of the web API. HTTP requires loopback; no placeholders or trailing slash. Omitted means no configured UI origin.")
670
693
  }).prefault({}),
@@ -2484,6 +2507,7 @@ function defineOperation(spec) {
2484
2507
  ])].sort((a, b) => order.indexOf(a) - order.indexOf(b));
2485
2508
  return {
2486
2509
  ...spec,
2510
+ web: spec.web ?? null,
2487
2511
  preconditions: spec.preconditions ?? null,
2488
2512
  errors,
2489
2513
  cli: {
@@ -2589,6 +2613,8 @@ const blockViewSchema = z.strictObject({
2589
2613
  unblockedBy: actorIdSchema.nullable().describe("Actor that unblocked the block; null while open."),
2590
2614
  unblockedAt: z.iso.datetime().nullable().describe("When the block was unblocked; null while open.")
2591
2615
  }).describe("A block on a task.");
2616
+ /** A block as `task.get` lists it: with the channel its closing answer arrived through. */
2617
+ const taskBlockViewSchema = blockViewSchema.extend({ answeredVia: z.enum(VIAS).nullable().describe("Channel the closing write arrived through: web or slack; null while open or when it came through the CLI, MCP or the board itself.") }).describe("A block on a task, with the channel that closed it.");
2592
2618
  /** One column move from the journal: a dispatcher move, a return to Dev or a correction. */
2593
2619
  const moveViewSchema = z.strictObject({
2594
2620
  at: z.iso.datetime().describe("When the task moved, ISO 8601 UTC."),
@@ -2824,6 +2850,26 @@ const configViewSchema = z.strictObject({ projects: z.array(z.strictObject({
2824
2850
  })).describe("Effective Spur project bindings.")
2825
2851
  })).describe("Effective projects visible to this caller.") }).describe("Allowlisted effective configuration without credentials or adapter settings.");
2826
2852
  //#endregion
2853
+ //#region ../contracts/src/ops/inbox-schemas.ts
2854
+ /** One entry of the operator inbox: an operator item, a block addressed to the operator or a turn. */
2855
+ const inboxEntrySchema = z.strictObject({
2856
+ id: z.union([
2857
+ itemIdSchema,
2858
+ blockIdSchema,
2859
+ turnIdSchema
2860
+ ]).describe("Item (I), block (B) or turn (T) ID; stable while the entry exists."),
2861
+ project: z.string().min(1).describe("Board project the entry belongs to; _board for a board-wide one."),
2862
+ kind: z.enum(INBOX_KINDS).describe("block for a block addressed to the operator, turn for a turn, else the item kind."),
2863
+ severity: z.enum(INBOX_SEVERITIES).describe("failure: something broke and the text says what to check; attention: a decision or answer is wanted."),
2864
+ text: z.string().describe("What needs the operator, in one line."),
2865
+ at: z.iso.datetime().describe("When the entry was raised or opened, ISO 8601 UTC."),
2866
+ task: taskKeySchema.nullable().describe("Task the entry is about; null when it has none."),
2867
+ column: z.enum(COLUMN_IDS).optional().describe("Column of a turn; absent on other entries."),
2868
+ answeredVia: z.enum(VIAS).nullable().optional().describe("On a block: web or slack when the closing write arrived that way, else null; absent on other entries.")
2869
+ }).describe("One entry of the operator inbox.");
2870
+ /** An operator inbox entry cleared, answered or closed in the last 24 hours. */
2871
+ const inboxHandledSchema = inboxEntrySchema.extend({ handledAt: z.iso.datetime().describe("When it was cleared, answered or closed, ISO 8601 UTC.") }).describe("An operator inbox entry handled in the last 24 hours.");
2872
+ //#endregion
2827
2873
  //#region ../contracts/src/ops/catalog.ts
2828
2874
  /** Longest free text an input takes: comments, questions, answers and reasons. */
2829
2875
  const TEXT_MAX = 2e4;
@@ -3084,6 +3130,7 @@ const tokenName = z.string().min(1).describe("Unique name of the operator token.
3084
3130
  const OPERATIONS = [
3085
3131
  defineOperation({
3086
3132
  id: "status.get",
3133
+ web: true,
3087
3134
  kind: "query",
3088
3135
  description: "List items, freshness and tasks with turns, PR summaries and navigation; detail adds full facts.",
3089
3136
  mcp: {
@@ -3223,6 +3270,7 @@ const OPERATIONS = [
3223
3270
  }),
3224
3271
  defineOperation({
3225
3272
  id: "task.get",
3273
+ web: true,
3226
3274
  kind: "query",
3227
3275
  description: "Show a task; refresh reads GitHub PRs.",
3228
3276
  mcp: {
@@ -3241,7 +3289,7 @@ const OPERATIONS = [
3241
3289
  turns: z.array(taskTurnSchema).optional().describe("Present only with detail: the last 5 closed turns, newest first."),
3242
3290
  links: z.array(linkViewSchema).describe("Effective pull request, session, and ticket links."),
3243
3291
  sessions: z.array(statusSessionFactsSchema).optional().describe("Current facts of effective linked sessions."),
3244
- blocks: z.array(blockViewSchema).describe("Blocks on the task, open and unblocked."),
3292
+ blocks: z.array(taskBlockViewSchema).describe("Blocks on the task, open and unblocked."),
3245
3293
  comments: z.array(commentSchema).describe("Comments on the task, oldest first."),
3246
3294
  why: taskWhySchema.optional().describe("Present only with why.")
3247
3295
  }),
@@ -3271,7 +3319,13 @@ const OPERATIONS = [
3271
3319
  returned: returnFromReview
3272
3320
  },
3273
3321
  links: [],
3274
- blocks: [question, codeBlock],
3322
+ blocks: [{
3323
+ ...question,
3324
+ answeredVia: null
3325
+ }, {
3326
+ ...codeBlock,
3327
+ answeredVia: null
3328
+ }],
3275
3329
  comments: [comment]
3276
3330
  }
3277
3331
  },
@@ -3363,6 +3417,7 @@ const OPERATIONS = [
3363
3417
  }),
3364
3418
  defineOperation({
3365
3419
  id: "task.history",
3420
+ web: true,
3366
3421
  kind: "query",
3367
3422
  description: "List what happened to a task, oldest first.",
3368
3423
  mcp: {
@@ -3464,6 +3519,7 @@ const OPERATIONS = [
3464
3519
  }),
3465
3520
  defineOperation({
3466
3521
  id: "inbox.get",
3522
+ web: true,
3467
3523
  kind: "query",
3468
3524
  description: "List the comments, blocks and turns addressed to the caller and not yet handled.",
3469
3525
  mcp: {
@@ -3496,6 +3552,76 @@ const OPERATIONS = [
3496
3552
  }
3497
3553
  }]
3498
3554
  }),
3555
+ defineOperation({
3556
+ id: "inbox.operator",
3557
+ web: true,
3558
+ kind: "query",
3559
+ description: "List what waits for the operator and what was handled in the last 24 hours; a project's own operator session sees only its operator projects, and _board entries only when no board-wide operator is configured.",
3560
+ mcp: {
3561
+ whenToUse: "As the operator, review every open operator item, block and turn across projects in one list.",
3562
+ whenNotToUse: "Use inbox_get for the comments, blocks and turns addressed to an agent."
3563
+ },
3564
+ input: z.strictObject({}),
3565
+ output: z.strictObject({
3566
+ items: z.array(inboxEntrySchema).describe("Open operator items, blocks addressed to the operator and operator turns, newest first; a block or turn is listed once, not with its items."),
3567
+ handled: z.array(inboxHandledSchema).describe("At most 20 entries handled in the last 24 hours, newest first.")
3568
+ }),
3569
+ grants: operatorOnly,
3570
+ errors: [],
3571
+ cli: {
3572
+ command: "inbox operator",
3573
+ args: []
3574
+ },
3575
+ slack: null,
3576
+ examples: [{
3577
+ summary: "Read the operator inbox",
3578
+ input: {},
3579
+ output: {
3580
+ items: [
3581
+ {
3582
+ id: "B12",
3583
+ project: "web",
3584
+ kind: "block",
3585
+ severity: "attention",
3586
+ text: question.reason,
3587
+ at: later,
3588
+ task: "PROJ-123",
3589
+ answeredVia: null
3590
+ },
3591
+ {
3592
+ id: "I9",
3593
+ project: "_board",
3594
+ kind: "transport_health",
3595
+ severity: "failure",
3596
+ text: `slack delivery down since ${at} (connection lost): check the Slack app tokens`,
3597
+ at,
3598
+ task: null
3599
+ },
3600
+ {
3601
+ id: "T5",
3602
+ project: "web",
3603
+ kind: "turn",
3604
+ severity: "attention",
3605
+ text: "Your turn T5: The pull request is ready to merge.",
3606
+ at,
3607
+ task: "PROJ-124",
3608
+ column: "ready-to-merge"
3609
+ }
3610
+ ],
3611
+ handled: [{
3612
+ id: "B11",
3613
+ project: "web",
3614
+ kind: "block",
3615
+ severity: "attention",
3616
+ text: "May the client drop v1?",
3617
+ at,
3618
+ task: "PROJ-123",
3619
+ answeredVia: "slack",
3620
+ handledAt: later
3621
+ }]
3622
+ }
3623
+ }]
3624
+ }),
3499
3625
  defineOperation({
3500
3626
  id: "inbox.ack",
3501
3627
  kind: "mutation",
@@ -3903,6 +4029,7 @@ const OPERATIONS = [
3903
4029
  }),
3904
4030
  defineOperation({
3905
4031
  id: "comment.add",
4032
+ web: true,
3906
4033
  kind: "mutation",
3907
4034
  description: "Comment on a task.",
3908
4035
  mcp: {
@@ -4064,6 +4191,7 @@ const OPERATIONS = [
4064
4191
  }),
4065
4192
  defineOperation({
4066
4193
  id: "block.answer",
4194
+ web: true,
4067
4195
  kind: "mutation",
4068
4196
  description: "Answer a question; the block closes unless it is an operator conversation.",
4069
4197
  mcp: {
@@ -4467,6 +4595,7 @@ const OPERATIONS = [
4467
4595
  }),
4468
4596
  defineOperation({
4469
4597
  id: "config.get",
4598
+ web: true,
4470
4599
  kind: "query",
4471
4600
  description: "Show effective project columns, executors and Spur bindings.",
4472
4601
  mcp: {
@@ -4556,6 +4685,7 @@ function catalogSnapshotBody(operations) {
4556
4685
  cli: op.cli,
4557
4686
  mcp: op.mcp,
4558
4687
  slack: op.slack,
4688
+ web: op.web,
4559
4689
  examples: op.examples,
4560
4690
  input: z.toJSONSchema(op.input, { io: "input" }),
4561
4691
  output: z.toJSONSchema(op.output, { io: "output" })
@@ -4668,4 +4798,4 @@ function assertNever(value) {
4668
4798
  throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
4669
4799
  }
4670
4800
  //#endregion
4671
- export { err as $, prSourceId as A, prFactsSchema as B, userIdSchema as C, AdapterError as D, eventPayloadSchemas as E, REVIEW_STATES as F, JIRA_PROJECT_KEY as G, ringMarker as H, SESSION_HEALTH_STATES as I, encodeActorId as J, REF_NUMBER as K, SESSION_STATUSES as L, sourceCursorSchema as M, trackerSourceId as N, batchSchema as O, PR_STATES as P, ERRORS as Q, isExternalAuthor as R, messageRefSchema as S, GATE_REASONS as T, sessionFactsSchema as U, prRefSchema as V, ticketFactsSchema as W, parseActorId as X, errorCodeOf as Y, parseRef as Z, renderMcpError as _, COLUMN_IDS as _t, requestHashOf as a, DEFAULT_LINK as at, inboundEventSchema as b, TASK_HOLDS as bt, tokenRequestStatusSchema as c, DEFAULT_STAND_PORT_RANGE as ct, buildCatalogSnapshot as d, configBindings as dt, errorContextSchema as et, roleCanUseOperation as f, configSchema as ft, renderJsonError as g, resolveWebOrigin as gt, renderHttpProblem as h, requiredSecretKeys as ht, TOKEN_REQUEST_LIMITS as i, DEFAULT_HTTP_PORT as it, sessionTransitionSchema as j, entityRefSchema as k, BOARD_TICK_MS as l, RESERVED_PROJECT as lt, turnHandedSchema as m, plainHttpAllowed as mt, doctorReportSchema as n, ok as nt, tokenRequestResultSchema as o, DEFAULT_SLACK_APP_NAME as ot, OPERATIONS as p, defaultAddressee as pt, actorIdSchema as q, remoteDoctorReportSchema as r, successEnvelopeSchema as rt, tokenRequestSchema as s, DEFAULT_SLACK_COMMAND as st, assertNever as t, errorEnvelopeSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, boardWideSpurProject as ut, SPACE_IDS as v, DISPATCHER_MODES as vt, EVENT_KINDS as w, interactionRefSchema as x, VIAS as xt, conversationRefSchema as y, SLACK_BOT_SCOPES as yt, parseRingMarker as z };
4801
+ export { err as $, prSourceId as A, prFactsSchema as B, userIdSchema as C, AdapterError as D, eventPayloadSchemas as E, REVIEW_STATES as F, JIRA_PROJECT_KEY as G, ringMarker as H, SESSION_HEALTH_STATES as I, encodeActorId as J, REF_NUMBER as K, SESSION_STATUSES as L, sourceCursorSchema as M, trackerSourceId as N, batchSchema as O, PR_STATES as P, ERRORS as Q, isExternalAuthor as R, messageRefSchema as S, VIAS as St, GATE_REASONS as T, sessionFactsSchema as U, prRefSchema as V, ticketFactsSchema as W, parseActorId as X, errorCodeOf as Y, parseRef as Z, renderMcpError as _, COLUMN_IDS as _t, requestHashOf as a, DEFAULT_LINK as at, inboundEventSchema as b, SLACK_BOT_SCOPES as bt, tokenRequestStatusSchema as c, DEFAULT_STAND_PORT_RANGE as ct, buildCatalogSnapshot as d, configBindings as dt, errorContextSchema as et, roleCanUseOperation as f, configSchema as ft, renderJsonError as g, resolveWebOrigin as gt, renderHttpProblem as h, requiredSecretKeys as ht, TOKEN_REQUEST_LIMITS as i, DEFAULT_HTTP_PORT as it, sessionTransitionSchema as j, entityRefSchema as k, BOARD_TICK_MS as l, RESERVED_PROJECT as lt, turnHandedSchema as m, plainHttpAllowed as mt, doctorReportSchema as n, ok as nt, tokenRequestResultSchema as o, DEFAULT_SLACK_APP_NAME as ot, OPERATIONS as p, defaultAddressee as pt, actorIdSchema as q, remoteDoctorReportSchema as r, successEnvelopeSchema as rt, tokenRequestSchema as s, DEFAULT_SLACK_COMMAND as st, assertNever as t, errorEnvelopeSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, boardWideSpurProject as ut, SPACE_IDS as v, DISPATCHER_MODES as vt, EVENT_KINDS as w, interactionRefSchema as x, TASK_HOLDS as xt, conversationRefSchema as y, ITEM_KINDS as yt, parseRingMarker as z };
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { Q as ERRORS, a as requestHashOf, ct as DEFAULT_STAND_PORT_RANGE, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, ht as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as SLACK_BOT_SCOPES } from "./chunk-CvY4Vfxu.mjs";
1
+ import { Q as ERRORS, a as requestHashOf, bt as SLACK_BOT_SCOPES, ct as DEFAULT_STAND_PORT_RANGE, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, ht as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-tFE-9H7j.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-DAMwWWmT.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-bhSEp4Rg.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-BwY4L2UH.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-BPJsPCN1.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-DvV0WXrb.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,2 +1,2 @@
1
- import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-bhSEp4Rg.mjs";
1
+ import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-BPJsPCN1.mjs";
2
2
  export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };