spur-board 0.145.0 → 0.146.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.
@@ -206,6 +206,17 @@ const TURN_OUTCOMES = [
206
206
  "mode_changed",
207
207
  "archived"
208
208
  ];
209
+ /**
210
+ * How a turn wait ended: `woken` when its time ran out, `submitted` by the holder's submit,
211
+ * `closed` by any other turn close, a take or the holder's end, `limit` when it ran out and the
212
+ * turn's waits reached their count or total time.
213
+ */
214
+ const TURN_WAIT_OUTCOMES = [
215
+ "woken",
216
+ "submitted",
217
+ "closed",
218
+ "limit"
219
+ ];
209
220
  /** The exit conditions of the column gates, as `board task --why` names them. */
210
221
  const GATE_CONDITIONS = [
211
222
  "pr_open",
@@ -877,6 +888,10 @@ const configObject = z.strictObject({
877
888
  sessions: z.int().min(1).default(3).describe("Sessions entering error within the window that start an episode."),
878
889
  windowMs: durationMs(6e4, "Window in which that many sessions entering error start a host-load episode"),
879
890
  maxEpisodeMs: durationMs(3e5, "Longest a host-load episode lasts before error flags resume")
891
+ }).prefault({}),
892
+ turnWait: z.strictObject({
893
+ maxWaits: z.int().min(1).default(8).describe("Waits a turn may start, counted over its whole life."),
894
+ maxTotalMs: durationMs(72e5, "Total time the waits of one turn may last")
880
895
  }).prefault({})
881
896
  }).prefault({})
882
897
  });
@@ -1334,6 +1349,13 @@ const ERRORS = {
1334
1349
  hint: "Take the turn with `board inbox ack` first; only the session that took it can submit or return it.",
1335
1350
  recovery: noRetry("Take the turn first; only the session that took it can submit or return it.")
1336
1351
  }),
1352
+ turn_wait_limit: spec("turn_wait_limit", {
1353
+ status: 409,
1354
+ exit: EXIT_CODES.refused,
1355
+ message: "The turn has used its waits: the count or the total wait time reached the limit.",
1356
+ hint: "Submit or return the turn; the operator gets an inbox item once the wait ends.",
1357
+ recovery: noRetry("Submit or return the turn instead of waiting again.")
1358
+ }),
1337
1359
  submit_basis_invalid: spec("submit_basis_invalid", {
1338
1360
  status: 409,
1339
1361
  exit: EXIT_CODES.refused,
@@ -2301,6 +2323,8 @@ const EVENT_KINDS = [
2301
2323
  "turn_opened",
2302
2324
  "turn_taken",
2303
2325
  "turn_closed",
2326
+ "turn_wait_started",
2327
+ "turn_wait_ended",
2304
2328
  "block_opened",
2305
2329
  "block_escalated",
2306
2330
  "block_unblocked",
@@ -2523,6 +2547,19 @@ const eventPayloadSchemas = {
2523
2547
  turn: S,
2524
2548
  outcome: z.enum(TURN_OUTCOMES)
2525
2549
  }),
2550
+ /** `until` is when the board wakes the holder; `waits` counts the turn's waits so far. */
2551
+ turn_wait_started: z.looseObject({
2552
+ turn: S,
2553
+ reason: S,
2554
+ until: S,
2555
+ waits: N
2556
+ }),
2557
+ turn_wait_ended: z.looseObject({
2558
+ turn: S,
2559
+ outcome: z.enum(TURN_WAIT_OUTCOMES),
2560
+ waitedMs: z.int().min(0),
2561
+ waits: N
2562
+ }),
2526
2563
  block_opened: z.looseObject({
2527
2564
  block: S,
2528
2565
  type: z.enum(BLOCK_TYPES),
@@ -2958,6 +2995,12 @@ const turnReturnSchema = z.strictObject({
2958
2995
  block: blockIdSchema.describe("The code block the return opened."),
2959
2996
  reason: z.string().describe("Reason of the return, verbatim from its code block.")
2960
2997
  }).describe("The return that sent the task back to Dev and opened this visit.");
2998
+ /** The active wait of a taken turn, started by its holder with `task.wait`. */
2999
+ const turnWaitSchema = z.strictObject({
3000
+ reason: z.string().min(1).describe("What the holder waits for, as it gave it."),
3001
+ since: z.iso.datetime().describe("When the wait started, ISO 8601 UTC."),
3002
+ wakesAt: z.iso.datetime().describe("When the board ends the wait and rings the holder, ISO 8601 UTC.")
3003
+ }).describe("The active wait of the turn.");
2961
3004
  const turnViewSchema = z.strictObject({
2962
3005
  id: turnIdSchema,
2963
3006
  task: taskKeySchema,
@@ -2972,6 +3015,7 @@ const turnViewSchema = z.strictObject({
2972
3015
  by: actorIdSchema,
2973
3016
  at: z.iso.datetime().describe("When the turn was taken, ISO 8601 UTC.")
2974
3017
  }).nullable().describe("Who took the turn and when; null until it is taken."),
3018
+ wait: turnWaitSchema.optional().describe("The active wait the holder started with task.wait: its reason, start and wake time. Absent when the turn is not waiting."),
2975
3019
  threads: z.array(z.strictObject({
2976
3020
  id: z.string().min(1).describe("Node ID of the review thread."),
2977
3021
  url: z.url({ protocol: /^https?$/ }).describe("Web URL of the thread's first comment."),
@@ -2985,6 +3029,7 @@ const taskTurnSchema = turnViewSchema.pick({
2985
3029
  addressee: true,
2986
3030
  at: true,
2987
3031
  taken: true,
3032
+ wait: true,
2988
3033
  handed: true,
2989
3034
  returned: true
2990
3035
  }).extend({ closed: z.strictObject({
@@ -3367,6 +3412,16 @@ const taskReturnOutputSchema = z.strictObject({
3367
3412
  task: taskViewSchema,
3368
3413
  block: blockViewSchema
3369
3414
  });
3415
+ const taskWaitInputSchema = z.strictObject({
3416
+ turn: turnIdSchema.describe("Turn ID you took (T4)."),
3417
+ for: z.int().min(1).max(120).describe("Whole minutes to wait, 1 to 120; the turn total cap may shorten it."),
3418
+ reason: z.string().min(1).max(200).regex(/\S/).describe("What you wait for, up to 200 characters; the wake ring repeats it.")
3419
+ });
3420
+ const taskWaitOutputSchema = z.strictObject({
3421
+ turn: turnIdSchema.describe("The waiting turn."),
3422
+ wait: turnWaitSchema,
3423
+ waits: z.int().min(1).describe("Waits the turn has started, this one included.")
3424
+ });
3370
3425
  /**
3371
3426
  * The three writes as `browserOperations` entries (`../browser.ts`), kept beside their schemas: the
3372
3427
  * web Turn section calls them, and the catalog shares the same schema objects.
@@ -5408,6 +5463,52 @@ const OPERATIONS = [
5408
5463
  }
5409
5464
  }]
5410
5465
  }),
5466
+ defineOperation({
5467
+ id: "task.wait",
5468
+ kind: "mutation",
5469
+ description: "Wait on a turn the caller took for an outside condition; the Board stays quiet, then rings the holder when the wait ends.",
5470
+ mcp: {
5471
+ whenToUse: "You hold a turn and must re-check an outside condition later, such as a busy test stand: wait for whole minutes with the reason instead of sitting quiet. The Board rings you with the reason when the wait ends; submit, return or a close ends it earlier. Waits per turn are capped by count and total time.",
5472
+ whenNotToUse: "Use task_submit to hand in finished work, or task_return to send the task back to Dev."
5473
+ },
5474
+ input: taskWaitInputSchema,
5475
+ output: taskWaitOutputSchema,
5476
+ grants: [
5477
+ { grant: "task-worker" },
5478
+ { grant: "column-orchestrator" },
5479
+ { grant: "operator" }
5480
+ ],
5481
+ errors: [
5482
+ "wrong_id_kind",
5483
+ "not_found",
5484
+ "task_archived",
5485
+ "turn_closed",
5486
+ "not_turn_taker",
5487
+ "turn_wait_limit"
5488
+ ],
5489
+ cli: {
5490
+ command: "wait",
5491
+ args: ["turn"]
5492
+ },
5493
+ slack: null,
5494
+ examples: [{
5495
+ summary: "Wait 30 minutes for a free test stand",
5496
+ input: {
5497
+ turn: "T4",
5498
+ for: 30,
5499
+ reason: "waiting for a free test stand"
5500
+ },
5501
+ output: {
5502
+ turn: "T4",
5503
+ wait: {
5504
+ reason: "waiting for a free test stand",
5505
+ since: at,
5506
+ wakesAt: "2026-01-05T10:00:00.000Z"
5507
+ },
5508
+ waits: 1
5509
+ }
5510
+ }]
5511
+ }),
5411
5512
  defineOperation({
5412
5513
  id: "task.move",
5413
5514
  kind: "mutation",
@@ -1,5 +1,5 @@
1
- import { Dt as plainHttpAllowed, Tt as configSchema, d as buildCatalogSnapshot, p as OPERATIONS } from "./chunk-CVVzwHUN.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-BbRoZyZW.mjs";
1
+ import { Dt as plainHttpAllowed, Tt as configSchema, d as buildCatalogSnapshot, p as OPERATIONS } from "./chunk-BS5xzBWL.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-DEbPRDF0.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";
@@ -1,4 +1,4 @@
1
- import { _ as renderJsonError, c as tokenRequestStatusSchema, dt as errorContextSchema, ft as errorEnvelopeSchema, lt as ERRORS, mt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-CVVzwHUN.mjs";
1
+ import { _ as renderJsonError, c as tokenRequestStatusSchema, dt as errorContextSchema, ft as errorEnvelopeSchema, lt as ERRORS, mt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-BS5xzBWL.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { At as resolveWebOrigin, D as sortSkillFiles, It as SLACK_BOT_SCOPES, T as skillReloadFileSchema, Tt as configSchema, a as requestHashOf, f as roleCanUseOperation, it as actorIdSchema, kt as requiredSecretKeys, lt as ERRORS, mt as successEnvelopeSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as DEFAULT_STAND_PORT_RANGE } from "./chunk-CVVzwHUN.mjs";
1
+ import { At as resolveWebOrigin, D as sortSkillFiles, It as SLACK_BOT_SCOPES, T as skillReloadFileSchema, Tt as configSchema, a as requestHashOf, f as roleCanUseOperation, it as actorIdSchema, kt as requiredSecretKeys, lt as ERRORS, mt as successEnvelopeSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as DEFAULT_STAND_PORT_RANGE } from "./chunk-BS5xzBWL.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-BbRoZyZW.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-7gaKVc6L.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-DEbPRDF0.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-CTCKroE3.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-BbRoZyZW.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-DEbPRDF0.mjs";