spur-board 0.53.3 → 0.54.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/{chunk-DSGruS1f.mjs → chunk-C7CHbmMl.mjs} +2 -2
- package/dist/{chunk-B81O9UQo.mjs → chunk-DgTcmpig.mjs} +1 -1
- package/dist/{chunk-DuSucVv4.mjs → chunk-DjHqB_QC.mjs} +124 -42
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +53 -11
- package/dist/mcp.mjs +3 -3
- package/package.json +1 -1
- package/skills/spur-board/references/commands.md +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as buildCatalogSnapshot, ct as plainHttpAllowed, st as configSchema, y as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { _ as buildCatalogSnapshot, ct as plainHttpAllowed, st as configSchema, y as OPERATIONS } from "./chunk-DjHqB_QC.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-DgTcmpig.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 errorEnvelopeSchema, Q as errorContextSchema, S as renderJsonError, X as ERRORS, c as tokenRequestStatusSchema, o as tokenRequestResultSchema, tt as successEnvelopeSchema } from "./chunk-
|
|
1
|
+
import { $ as errorEnvelopeSchema, Q as errorContextSchema, S as renderJsonError, X as ERRORS, c as tokenRequestStatusSchema, o as tokenRequestResultSchema, tt as successEnvelopeSchema } from "./chunk-DjHqB_QC.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { request } from "node:http";
|
|
@@ -105,6 +105,21 @@ const SESSION_END_REASONS = [
|
|
|
105
105
|
];
|
|
106
106
|
/** How a project's dispatcher runs: `shadow` records moves only, `on` moves tasks and opens turns. */
|
|
107
107
|
const DISPATCHER_MODES = ["shadow", "on"];
|
|
108
|
+
/**
|
|
109
|
+
* How a turn closed: `submitted` by the executor's submit, `returned` by `task.return`, `moved`
|
|
110
|
+
* when the task moved on (it also covers returns and mode switches recorded by older versions),
|
|
111
|
+
* `corrected` by the operator's column correction, `rerouted` to another executor,
|
|
112
|
+
* `mode_changed` by a dispatcher mode switch, `archived` with the task.
|
|
113
|
+
*/
|
|
114
|
+
const TURN_OUTCOMES = [
|
|
115
|
+
"submitted",
|
|
116
|
+
"returned",
|
|
117
|
+
"moved",
|
|
118
|
+
"corrected",
|
|
119
|
+
"rerouted",
|
|
120
|
+
"mode_changed",
|
|
121
|
+
"archived"
|
|
122
|
+
];
|
|
108
123
|
/** The exit conditions of the column gates, as `board task --why` names them. */
|
|
109
124
|
const GATE_CONDITIONS = [
|
|
110
125
|
"pr_open",
|
|
@@ -1883,6 +1898,17 @@ const turnViewSchema = z.strictObject({
|
|
|
1883
1898
|
at: z.iso.datetime().describe("When the turn was taken, ISO 8601 UTC.")
|
|
1884
1899
|
}).nullable().describe("Who took the turn and when; null until it is taken.")
|
|
1885
1900
|
}).describe("A turn: the executor of a column is asked to act on a task.");
|
|
1901
|
+
/** A turn as `task.get` shows it: who executes it, whether it was taken, and how it closed. */
|
|
1902
|
+
const taskTurnSchema = turnViewSchema.pick({
|
|
1903
|
+
id: true,
|
|
1904
|
+
column: true,
|
|
1905
|
+
addressee: true,
|
|
1906
|
+
at: true,
|
|
1907
|
+
taken: true
|
|
1908
|
+
}).extend({ closed: z.strictObject({
|
|
1909
|
+
at: z.iso.datetime().describe("When the turn closed, ISO 8601 UTC."),
|
|
1910
|
+
outcome: z.enum(TURN_OUTCOMES).describe("How the turn closed; turns closed by a return or a mode switch before those were recorded read moved.")
|
|
1911
|
+
}).nullable().describe("How and when the turn closed; null while it is open.") }).describe("A task's turn: the executor of a column is asked to act on it.");
|
|
1886
1912
|
/** One column move from the journal: a dispatcher move, a return to Dev or a correction. */
|
|
1887
1913
|
const moveViewSchema = z.strictObject({
|
|
1888
1914
|
at: z.iso.datetime().describe("When the task moved, ISO 8601 UTC."),
|
|
@@ -2138,6 +2164,15 @@ const reviewTurn = {
|
|
|
2138
2164
|
at,
|
|
2139
2165
|
taken: null
|
|
2140
2166
|
};
|
|
2167
|
+
const devTurn = {
|
|
2168
|
+
id: "T3",
|
|
2169
|
+
column: "dev",
|
|
2170
|
+
addressee: "worker",
|
|
2171
|
+
at,
|
|
2172
|
+
taken: null,
|
|
2173
|
+
closed: null
|
|
2174
|
+
};
|
|
2175
|
+
const later = "2026-01-05T10:15:00.000Z";
|
|
2141
2176
|
const handedReview = {
|
|
2142
2177
|
repo: "acme/web",
|
|
2143
2178
|
number: 42,
|
|
@@ -2346,17 +2381,20 @@ const OPERATIONS = [
|
|
|
2346
2381
|
defineOperation({
|
|
2347
2382
|
id: "task.get",
|
|
2348
2383
|
kind: "query",
|
|
2349
|
-
description: "Show a task with its links, blocks and comments.",
|
|
2384
|
+
description: "Show a task with its open turn, links, blocks and comments.",
|
|
2350
2385
|
mcp: {
|
|
2351
|
-
whenToUse: "Inspect one task now.",
|
|
2386
|
+
whenToUse: "Inspect one task now; pass detail for its last closed turns.",
|
|
2352
2387
|
whenNotToUse: "Use task_history for past events."
|
|
2353
2388
|
},
|
|
2354
2389
|
input: z.strictObject({
|
|
2355
2390
|
task: taskKeyInputSchema,
|
|
2391
|
+
detail: z.boolean().optional().describe("Also list the last 5 closed turns, newest first; absent means none."),
|
|
2356
2392
|
why: z.boolean().optional().describe("Explain why the task is in its column: gates, holds, the open turn and the last moves; absent means no explanation.")
|
|
2357
2393
|
}),
|
|
2358
2394
|
output: z.strictObject({
|
|
2359
2395
|
task: taskViewSchema,
|
|
2396
|
+
turn: taskTurnSchema.nullable().describe("The task's unclosed turn; null when none is open."),
|
|
2397
|
+
turns: z.array(taskTurnSchema).optional().describe("Present only with detail: the last 5 closed turns, newest first."),
|
|
2360
2398
|
links: z.array(linkViewSchema).describe("Effective pull request, session, and ticket links."),
|
|
2361
2399
|
blocks: z.array(blockViewSchema).describe("Blocks on the task, open and unblocked."),
|
|
2362
2400
|
comments: z.array(commentSchema).describe("Comments on the task, oldest first."),
|
|
@@ -2372,56 +2410,100 @@ const OPERATIONS = [
|
|
|
2372
2410
|
kind: "slash-command",
|
|
2373
2411
|
usage: "/board task <KEY> [why]"
|
|
2374
2412
|
},
|
|
2375
|
-
examples: [
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
input: {
|
|
2387
|
-
task: "PROJ-123",
|
|
2388
|
-
why: true
|
|
2413
|
+
examples: [
|
|
2414
|
+
{
|
|
2415
|
+
summary: "Show one task",
|
|
2416
|
+
input: { task: "PROJ-123" },
|
|
2417
|
+
output: {
|
|
2418
|
+
task,
|
|
2419
|
+
turn: devTurn,
|
|
2420
|
+
links: [],
|
|
2421
|
+
blocks: [question],
|
|
2422
|
+
comments: [comment]
|
|
2423
|
+
}
|
|
2389
2424
|
},
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2425
|
+
{
|
|
2426
|
+
summary: "Explain why a task waits in Review",
|
|
2427
|
+
input: {
|
|
2428
|
+
task: "PROJ-123",
|
|
2429
|
+
why: true
|
|
2394
2430
|
},
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
dispatcher: "on",
|
|
2401
|
-
holds: [],
|
|
2402
|
-
gates: reviewGates,
|
|
2403
|
-
checksWaivedBy: null,
|
|
2431
|
+
output: {
|
|
2432
|
+
task: {
|
|
2433
|
+
...task,
|
|
2434
|
+
column: "review"
|
|
2435
|
+
},
|
|
2404
2436
|
turn: {
|
|
2405
|
-
|
|
2406
|
-
|
|
2437
|
+
id: reviewTurn.id,
|
|
2438
|
+
column: reviewTurn.column,
|
|
2439
|
+
addressee: reviewTurn.addressee,
|
|
2440
|
+
at,
|
|
2407
2441
|
taken: {
|
|
2408
2442
|
by: "agent:rev/rev-1",
|
|
2409
2443
|
at
|
|
2444
|
+
},
|
|
2445
|
+
closed: null
|
|
2446
|
+
},
|
|
2447
|
+
links: [],
|
|
2448
|
+
blocks: [],
|
|
2449
|
+
comments: [],
|
|
2450
|
+
why: {
|
|
2451
|
+
column: "review",
|
|
2452
|
+
dispatcher: "on",
|
|
2453
|
+
holds: [],
|
|
2454
|
+
gates: reviewGates,
|
|
2455
|
+
checksWaivedBy: null,
|
|
2456
|
+
turn: {
|
|
2457
|
+
...reviewTurn,
|
|
2458
|
+
handed: [],
|
|
2459
|
+
taken: {
|
|
2460
|
+
by: "agent:rev/rev-1",
|
|
2461
|
+
at
|
|
2462
|
+
}
|
|
2463
|
+
},
|
|
2464
|
+
moves: [{
|
|
2465
|
+
at,
|
|
2466
|
+
kind: "task_moved",
|
|
2467
|
+
actor: "system",
|
|
2468
|
+
from: "dev",
|
|
2469
|
+
to: "review",
|
|
2470
|
+
reason: "gate_passed",
|
|
2471
|
+
gate: [],
|
|
2472
|
+
text: null
|
|
2473
|
+
}]
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
summary: "Show a task with its last closed turns",
|
|
2479
|
+
input: {
|
|
2480
|
+
task: "PROJ-123",
|
|
2481
|
+
detail: true
|
|
2482
|
+
},
|
|
2483
|
+
output: {
|
|
2484
|
+
task,
|
|
2485
|
+
turn: {
|
|
2486
|
+
...devTurn,
|
|
2487
|
+
id: "T4",
|
|
2488
|
+
at: later,
|
|
2489
|
+
taken: {
|
|
2490
|
+
by: "agent:web/web-7",
|
|
2491
|
+
at: later
|
|
2410
2492
|
}
|
|
2411
2493
|
},
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2494
|
+
turns: [{
|
|
2495
|
+
...devTurn,
|
|
2496
|
+
closed: {
|
|
2497
|
+
at: later,
|
|
2498
|
+
outcome: "submitted"
|
|
2499
|
+
}
|
|
2500
|
+
}],
|
|
2501
|
+
links: [],
|
|
2502
|
+
blocks: [],
|
|
2503
|
+
comments: []
|
|
2422
2504
|
}
|
|
2423
2505
|
}
|
|
2424
|
-
|
|
2506
|
+
]
|
|
2425
2507
|
}),
|
|
2426
2508
|
defineOperation({
|
|
2427
2509
|
id: "task.history",
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as actorIdSchema, X as ERRORS, a as requestHashOf, ft as SLACK_BOT_SCOPES, lt as requiredSecretKeys, r as remoteDoctorReportSchema, st as configSchema, tt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS, v as roleCanUseOperation, y as OPERATIONS } from "./chunk-
|
|
1
|
+
import { W as actorIdSchema, X as ERRORS, a as requestHashOf, ft as SLACK_BOT_SCOPES, lt as requiredSecretKeys, r as remoteDoctorReportSchema, st as configSchema, tt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS, v as roleCanUseOperation, y as OPERATIONS } from "./chunk-DjHqB_QC.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-
|
|
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-
|
|
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-DgTcmpig.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-C7CHbmMl.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-
|
|
1
|
+
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-DgTcmpig.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as EVENT_KINDS, B as sessionFactsSchema, D as interactionRefSchema, E as inboundEventSchema, F as isExternalAuthor, G as encodeActorId, H as JIRA_PROJECT_KEY, I as parseRingMarker, J as parseRef$1, K as errorCodeOf, L as prFactsSchema, M as REVIEW_STATES, N as SESSION_HEALTH_STATES, O as messageRefSchema, P as SESSION_STATUSES, R as prRefSchema, T as conversationRefSchema, U as REF_NUMBER, V as ticketFactsSchema, W as actorIdSchema, X as ERRORS, Y as taskKeySchema, Z as err, _ as buildCatalogSnapshot, a as requestHashOf, at as DEFAULT_SLACK_COMMAND, b as turnHandedSchema, c as tokenRequestStatusSchema, ct as plainHttpAllowed, d as AdapterError, dt as DISPATCHER_MODES, et as ok, f as batchSchema, ft as SLACK_BOT_SCOPES, g as trackerSourceId, h as sourceCursorSchema, i as TOKEN_REQUEST_LIMITS, j as eventPayloadSchemas, k as userIdSchema, l as BOARD_TICK_MS, lt as requiredSecretKeys, m as prSourceId, n as doctorReportSchema, o as tokenRequestResultSchema, ot as RESERVED_PROJECT, p as entityRefSchema, q as parseActorId, rt as DEFAULT_LINK, s as tokenRequestSchema, st as configSchema, t as assertNever, tt as successEnvelopeSchema, ut as COLUMN_IDS, v as roleCanUseOperation, w as SPACE_IDS, x as renderHttpProblem, y as OPERATIONS, z as ringMarker } from "./chunk-
|
|
1
|
+
import { A as EVENT_KINDS, B as sessionFactsSchema, D as interactionRefSchema, E as inboundEventSchema, F as isExternalAuthor, G as encodeActorId, H as JIRA_PROJECT_KEY, I as parseRingMarker, J as parseRef$1, K as errorCodeOf, L as prFactsSchema, M as REVIEW_STATES, N as SESSION_HEALTH_STATES, O as messageRefSchema, P as SESSION_STATUSES, R as prRefSchema, T as conversationRefSchema, U as REF_NUMBER, V as ticketFactsSchema, W as actorIdSchema, X as ERRORS, Y as taskKeySchema, Z as err, _ as buildCatalogSnapshot, a as requestHashOf, at as DEFAULT_SLACK_COMMAND, b as turnHandedSchema, c as tokenRequestStatusSchema, ct as plainHttpAllowed, d as AdapterError, dt as DISPATCHER_MODES, et as ok, f as batchSchema, ft as SLACK_BOT_SCOPES, g as trackerSourceId, h as sourceCursorSchema, i as TOKEN_REQUEST_LIMITS, j as eventPayloadSchemas, k as userIdSchema, l as BOARD_TICK_MS, lt as requiredSecretKeys, m as prSourceId, n as doctorReportSchema, o as tokenRequestResultSchema, ot as RESERVED_PROJECT, p as entityRefSchema, q as parseActorId, rt as DEFAULT_LINK, s as tokenRequestSchema, st as configSchema, t as assertNever, tt as successEnvelopeSchema, ut as COLUMN_IDS, v as roleCanUseOperation, w as SPACE_IDS, x as renderHttpProblem, y as OPERATIONS, z as ringMarker } from "./chunk-DjHqB_QC.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -14308,9 +14308,10 @@ async function voidSubmits(trx, taskId, to, at) {
|
|
|
14308
14308
|
}
|
|
14309
14309
|
/**
|
|
14310
14310
|
* Moves a task left to `to` as a new visit: bumps `column_epoch` and `left_moves`, voids the
|
|
14311
|
-
* submits of `to` and right of it, closes its turns
|
|
14312
|
-
*
|
|
14313
|
-
*
|
|
14311
|
+
* submits of `to` and right of it, closes its turns (`returned` for a `task.return` of `turn`,
|
|
14312
|
+
* else `moved`) and journals `task_moved`. In `on` mode a counted return that reaches the
|
|
14313
|
+
* column's cycle limit raises its cycle-limit block; otherwise one that reaches its course check
|
|
14314
|
+
* raises the course check. Either holds the task, and
|
|
14314
14315
|
* `limitReached` tells the dispatcher to stop the cascade.
|
|
14315
14316
|
*/
|
|
14316
14317
|
async function moveLeft(trx, input) {
|
|
@@ -14324,7 +14325,7 @@ async function moveLeft(trx, input) {
|
|
|
14324
14325
|
await voidSubmits(trx, task.id, to, at);
|
|
14325
14326
|
await closeTurns(trx, {
|
|
14326
14327
|
taskId: task.id,
|
|
14327
|
-
reason: "moved",
|
|
14328
|
+
reason: turn === void 0 ? "moved" : "returned",
|
|
14328
14329
|
at
|
|
14329
14330
|
});
|
|
14330
14331
|
await emit(trx, "task_moved", task.project, task.id, at.toISOString(), {
|
|
@@ -14375,8 +14376,9 @@ async function moveLeft(trx, input) {
|
|
|
14375
14376
|
/**
|
|
14376
14377
|
* Applies a changed dispatcher mode of each project, as stored in `meta`. A first run only stores
|
|
14377
14378
|
* the mode. A switch to `on` copies each task's shadow column into its column as a new visit; a
|
|
14378
|
-
* switch to `shadow` closes the project's unclosed turns.
|
|
14379
|
-
* column and journals
|
|
14379
|
+
* switch to `shadow` closes the project's unclosed turns. Turns either switch closes record
|
|
14380
|
+
* `mode_changed`. Either switch then clears the shadow column and journals
|
|
14381
|
+
* `dispatcher_mode_changed`.
|
|
14380
14382
|
*/
|
|
14381
14383
|
async function syncModes(trx, config, at) {
|
|
14382
14384
|
for (const project of config.projects) {
|
|
@@ -14400,7 +14402,7 @@ async function syncModes(trx, config, at) {
|
|
|
14400
14402
|
}).where("id", "=", task.id).execute();
|
|
14401
14403
|
await closeTurns(trx, {
|
|
14402
14404
|
taskId: task.id,
|
|
14403
|
-
reason: "
|
|
14405
|
+
reason: "mode_changed",
|
|
14404
14406
|
at
|
|
14405
14407
|
});
|
|
14406
14408
|
await emit(trx, "task_moved", task.project, task.id, at.toISOString(), {
|
|
@@ -14413,7 +14415,7 @@ async function syncModes(trx, config, at) {
|
|
|
14413
14415
|
const open = await trx.selectFrom("turn").innerJoin("task", "task.id", "turn.task_id").select("turn.task_id").distinct().where("task.project", "=", project.id).where("turn.closed_at", "is", null).orderBy("turn.task_id").execute();
|
|
14414
14416
|
for (const { task_id } of open) await closeTurns(trx, {
|
|
14415
14417
|
taskId: task_id,
|
|
14416
|
-
reason: "
|
|
14418
|
+
reason: "mode_changed",
|
|
14417
14419
|
at
|
|
14418
14420
|
});
|
|
14419
14421
|
}
|
|
@@ -14754,6 +14756,39 @@ async function dispatchSource(trx, source, ctx) {
|
|
|
14754
14756
|
await dispatchTasks(trx, (await trx.selectFrom("task").select("id").where("project", "in", projects).where("membership", "!=", "archived").execute()).map((task) => task.id), ctx);
|
|
14755
14757
|
}
|
|
14756
14758
|
//#endregion
|
|
14759
|
+
//#region ../core/src/app/task-turns.ts
|
|
14760
|
+
/** How many closed turns `task.get --detail` shows. */
|
|
14761
|
+
const DETAIL_TURNS = 5;
|
|
14762
|
+
function taskTurnView(turn) {
|
|
14763
|
+
return {
|
|
14764
|
+
id: `T${String(turn.id)}`,
|
|
14765
|
+
column: turn.column,
|
|
14766
|
+
addressee: turn.role,
|
|
14767
|
+
at: turn.created_at,
|
|
14768
|
+
taken: turn.acked_by === null || turn.acked_at === null ? null : {
|
|
14769
|
+
by: turn.acked_by,
|
|
14770
|
+
at: turn.acked_at
|
|
14771
|
+
},
|
|
14772
|
+
closed: turn.closed_at === null || turn.closed_reason === null ? null : {
|
|
14773
|
+
at: turn.closed_at,
|
|
14774
|
+
outcome: turn.closed_reason
|
|
14775
|
+
}
|
|
14776
|
+
};
|
|
14777
|
+
}
|
|
14778
|
+
/**
|
|
14779
|
+
* The turns `task.get` shows: the task's unclosed turn, and with `detail` its last closed turns,
|
|
14780
|
+
* newest first.
|
|
14781
|
+
*/
|
|
14782
|
+
async function taskTurns(trx, task, detail) {
|
|
14783
|
+
const open = await trx.selectFrom("turn").selectAll().where("task_id", "=", task.id).where("closed_at", "is", null).orderBy("id", "desc").executeTakeFirst();
|
|
14784
|
+
const turn = open === void 0 ? null : taskTurnView(open);
|
|
14785
|
+
if (!detail) return { turn };
|
|
14786
|
+
return {
|
|
14787
|
+
turn,
|
|
14788
|
+
turns: (await trx.selectFrom("turn").selectAll().where("task_id", "=", task.id).where("closed_at", "is not", null).orderBy("id", "desc").limit(DETAIL_TURNS).execute()).map(taskTurnView)
|
|
14789
|
+
};
|
|
14790
|
+
}
|
|
14791
|
+
//#endregion
|
|
14757
14792
|
//#region ../core/src/app/task-queries.ts
|
|
14758
14793
|
/** How many of the last moves `task.get --why` shows. */
|
|
14759
14794
|
const WHY_MOVES = 5;
|
|
@@ -14936,6 +14971,7 @@ function createTaskQueries(deps) {
|
|
|
14936
14971
|
]);
|
|
14937
14972
|
return {
|
|
14938
14973
|
task: taskView(task),
|
|
14974
|
+
...await taskTurns(trx, task, input.detail === true),
|
|
14939
14975
|
links: links.map(linkView),
|
|
14940
14976
|
blocks: blocks.map((block) => blockView(block, task)),
|
|
14941
14977
|
comments: comments.map((comment) => commentView(comment, task)),
|
|
@@ -16408,6 +16444,12 @@ function quote(text) {
|
|
|
16408
16444
|
}]
|
|
16409
16445
|
};
|
|
16410
16446
|
}
|
|
16447
|
+
/** The open turn: who executes it, when it opened and whether it was acked. */
|
|
16448
|
+
function turnLine(turn) {
|
|
16449
|
+
if (turn === null) return line("No open turn.");
|
|
16450
|
+
const ack = turn.taken === null ? "not acked" : `acked by ${turn.taken.by} at ${turn.taken.at}`;
|
|
16451
|
+
return line(`Turn ${turn.id} (${turn.column}, ${turn.addressee}), opened ${turn.at}: ${ack}.`);
|
|
16452
|
+
}
|
|
16411
16453
|
/** Failed and waiting conditions lead a column's line; unchecked and met follow. */
|
|
16412
16454
|
const STATE_ORDER = {
|
|
16413
16455
|
failed: 0,
|
|
@@ -16424,7 +16466,6 @@ function whyLines(key, why, blocks) {
|
|
|
16424
16466
|
const mode = why.dispatcher === null ? " (project not configured)" : why.dispatcher === "shadow" ? " (shadow)" : "";
|
|
16425
16467
|
const here = why.gates.find((gate) => gate.column === why.column);
|
|
16426
16468
|
const passing = why.gates.filter((gate) => gate.enabled && gate.ok).map((gate) => gate.column);
|
|
16427
|
-
const turn = why.turn;
|
|
16428
16469
|
return [
|
|
16429
16470
|
line(`Task ${key} is in ${why.column}${mode}.`),
|
|
16430
16471
|
...why.holds.length === 0 ? [] : [line(`Held: ${why.holds.join(", ")}.`)],
|
|
@@ -16432,7 +16473,7 @@ function whyLines(key, why, blocks) {
|
|
|
16432
16473
|
...passing.length === 0 ? [] : [line(`Gates passing: ${passing.join(", ")}.`)],
|
|
16433
16474
|
...here === void 0 ? [] : [line(here.blockedIn === null ? `The ${why.column} gate passes.` : `The ${why.column} gate is blocked at ${here.blockedIn}.`)],
|
|
16434
16475
|
...why.checksWaivedBy === null ? [] : [line(`Dev checks are waived by ${why.checksWaivedBy}.`)],
|
|
16435
|
-
|
|
16476
|
+
turnLine(why.turn),
|
|
16436
16477
|
...blocks.filter((block) => block.state === "open").flatMap((block) => [line(`Open block ${block.id} (${block.type}):`), quote(block.reason)]),
|
|
16437
16478
|
...why.moves.flatMap((move) => {
|
|
16438
16479
|
const gate = move.gate.length === 0 ? "" : `: ${move.gate.join(", ")}`;
|
|
@@ -16475,6 +16516,7 @@ function commandReply(id, value, input) {
|
|
|
16475
16516
|
cliHint: `board ${operation.cli.command} ${request.task}`,
|
|
16476
16517
|
body: [
|
|
16477
16518
|
line(`Task ${result.task.key}: ${result.task.column} (${result.task.membership})`),
|
|
16519
|
+
turnLine(result.turn),
|
|
16478
16520
|
...result.blocks.flatMap((block) => [line(`Block ${block.id} (${block.state}, ${block.type}):`), quote(block.reason)]),
|
|
16479
16521
|
...result.comments.flatMap((comment) => [line(`Comment ${comment.id} by ${comment.author}:`), quote(comment.text)])
|
|
16480
16522
|
]
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as renderMcpError, X as ERRORS, y as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, r as requestOperation } from "./chunk-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-
|
|
1
|
+
import { C as renderMcpError, X as ERRORS, y as OPERATIONS } from "./chunk-DjHqB_QC.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-DgTcmpig.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-C7CHbmMl.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
|
@@ -14,10 +14,10 @@ Other errors: `not_found`.
|
|
|
14
14
|
|
|
15
15
|
### `board task`
|
|
16
16
|
|
|
17
|
-
Purpose: Show a task with its links, blocks and comments.
|
|
17
|
+
Purpose: Show a task with its open turn, links, blocks and comments.
|
|
18
18
|
Arguments: `<task>`.
|
|
19
|
-
Flags: `--why`, `--json`.
|
|
20
|
-
Use when: Inspect one task now.
|
|
19
|
+
Flags: `--detail`, `--why`, `--json`.
|
|
20
|
+
Use when: Inspect one task now; pass detail for its last closed turns.
|
|
21
21
|
Avoid when: Use `board task history <task>` for past events.
|
|
22
22
|
Example: `board task PROJ-123` — Show one task.
|
|
23
23
|
Other errors: `wrong_id_kind`, `not_found`.
|