spur-board 0.43.1 → 0.44.1
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 +4 -4
- package/dist/{client-CJwU6M5L.mjs → client-BODC7qTT.mjs} +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{config-Gl2ISKcx.mjs → config-M7jQfUT9.mjs} +2 -2
- package/dist/daemon.mjs +949 -323
- package/dist/mcp.mjs +3 -3
- package/dist/{src-DlZuREcB.mjs → src-HVASmsVd.mjs} +298 -3
- package/package.json +1 -1
- package/skills/spur-board/references/commands.md +1 -1
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as renderMcpError, u as OPERATIONS, z as ERRORS } from "./src-
|
|
2
|
-
import { a as CliError, r as requestOperation } from "./client-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-
|
|
1
|
+
import { m as renderMcpError, u as OPERATIONS, z as ERRORS } from "./src-HVASmsVd.mjs";
|
|
2
|
+
import { a as CliError, r as requestOperation } from "./client-BODC7qTT.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-M7jQfUT9.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -105,6 +105,37 @@ 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
|
+
/** The exit conditions of the column gates, as `board task --why` names them. */
|
|
109
|
+
const GATE_CONDITIONS = [
|
|
110
|
+
"pr_open",
|
|
111
|
+
"not_draft",
|
|
112
|
+
"checks_green",
|
|
113
|
+
"no_conflict",
|
|
114
|
+
"external_comments_handled",
|
|
115
|
+
"comment_history_read",
|
|
116
|
+
"submit_on_head",
|
|
117
|
+
"review_on_head",
|
|
118
|
+
"approved",
|
|
119
|
+
"merged"
|
|
120
|
+
];
|
|
121
|
+
/**
|
|
122
|
+
* The state of one gate condition: `waiting` fails only on a fact not known yet, `unchecked` was
|
|
123
|
+
* not evaluated because an earlier condition of the column failed first.
|
|
124
|
+
*/
|
|
125
|
+
const GATE_CONDITION_STATES = [
|
|
126
|
+
"met",
|
|
127
|
+
"failed",
|
|
128
|
+
"waiting",
|
|
129
|
+
"unchecked"
|
|
130
|
+
];
|
|
131
|
+
/** What holds the dispatcher from acting on a task. */
|
|
132
|
+
const TASK_HOLDS = [
|
|
133
|
+
"pr_snapshot_missing",
|
|
134
|
+
"github_blind",
|
|
135
|
+
"spur_blind",
|
|
136
|
+
"cycle_limit",
|
|
137
|
+
"work_not_started"
|
|
138
|
+
];
|
|
108
139
|
/** Who caused a journal event. */
|
|
109
140
|
const ACTORS = [
|
|
110
141
|
"operator",
|
|
@@ -648,6 +679,13 @@ const ERRORS = {
|
|
|
648
679
|
hint: "In Dev, ask with `board ask` instead.",
|
|
649
680
|
recovery: noRetry("In Dev, ask with a block instead of returning the task.")
|
|
650
681
|
}),
|
|
682
|
+
move_not_allowed: spec("move_not_allowed", {
|
|
683
|
+
status: 409,
|
|
684
|
+
exit: EXIT_CODES.refused,
|
|
685
|
+
message: "The task cannot be corrected to that column.",
|
|
686
|
+
hint: "Read why with `board task <KEY> --why`; pick an enabled column, and unlink a merged pull request with `board unlink` first.",
|
|
687
|
+
recovery: noRetry("Read why the task is where it is; pick an enabled column, and unlink a merged pull request first.")
|
|
688
|
+
}),
|
|
651
689
|
task_archived: spec("task_archived", {
|
|
652
690
|
status: 409,
|
|
653
691
|
exit: EXIT_CODES.refused,
|
|
@@ -1170,6 +1208,7 @@ const EVENT_KINDS = [
|
|
|
1170
1208
|
"task_submitted",
|
|
1171
1209
|
"task_moved",
|
|
1172
1210
|
"task_shadow_moved",
|
|
1211
|
+
"task_corrected",
|
|
1173
1212
|
"dispatcher_mode_changed",
|
|
1174
1213
|
"block_opened",
|
|
1175
1214
|
"block_escalated",
|
|
@@ -1323,6 +1362,12 @@ const eventPayloadSchemas = {
|
|
|
1323
1362
|
reason: z.enum(MOVE_REASONS),
|
|
1324
1363
|
gate: z.array(z.enum(GATE_REASONS)).optional()
|
|
1325
1364
|
}),
|
|
1365
|
+
task_corrected: z.looseObject({
|
|
1366
|
+
from: z.enum(COLUMN_IDS),
|
|
1367
|
+
to: z.enum(COLUMN_IDS),
|
|
1368
|
+
reason: S,
|
|
1369
|
+
shadow: z.boolean()
|
|
1370
|
+
}),
|
|
1326
1371
|
dispatcher_mode_changed: z.looseObject({
|
|
1327
1372
|
from: z.enum(DISPATCHER_MODES),
|
|
1328
1373
|
to: z.enum(DISPATCHER_MODES)
|
|
@@ -1783,6 +1828,46 @@ const turnViewSchema = z.strictObject({
|
|
|
1783
1828
|
at: z.iso.datetime().describe("When the turn was taken, ISO 8601 UTC.")
|
|
1784
1829
|
}).nullable().describe("Who took the turn and when; null until it is taken.")
|
|
1785
1830
|
}).describe("A turn: the executor of a column is asked to act on a task.");
|
|
1831
|
+
/** One column move from the journal: a dispatcher move, a return to Dev or a correction. */
|
|
1832
|
+
const moveViewSchema = z.strictObject({
|
|
1833
|
+
at: z.iso.datetime().describe("When the task moved, ISO 8601 UTC."),
|
|
1834
|
+
kind: z.enum([
|
|
1835
|
+
"task_moved",
|
|
1836
|
+
"task_shadow_moved",
|
|
1837
|
+
"task_corrected"
|
|
1838
|
+
]).describe("task_moved moves the column, task_shadow_moved only the shadow column, task_corrected is an operator correction."),
|
|
1839
|
+
actor: actorIdSchema,
|
|
1840
|
+
from: z.enum(COLUMN_IDS).describe("Column the task left."),
|
|
1841
|
+
to: z.enum(COLUMN_IDS).describe("Column the task entered."),
|
|
1842
|
+
reason: z.enum([
|
|
1843
|
+
...MOVE_REASONS,
|
|
1844
|
+
"returned",
|
|
1845
|
+
"corrected"
|
|
1846
|
+
]).describe("Why it moved: a dispatcher reason, returned (a column executor returned it to Dev) or corrected (the operator corrected the column)."),
|
|
1847
|
+
gate: z.array(z.enum(GATE_REASONS)).describe("The failing gate reasons of a gate_broken move; empty otherwise."),
|
|
1848
|
+
text: z.string().nullable().describe("The block a return opened, or the reason the operator gave for a correction; null otherwise.")
|
|
1849
|
+
}).describe("A column move of a task.");
|
|
1850
|
+
const gateConditionSchema = z.strictObject({
|
|
1851
|
+
condition: z.enum(GATE_CONDITIONS).describe("Exit condition of the column."),
|
|
1852
|
+
state: z.enum(GATE_CONDITION_STATES).describe("met; failed; waiting (fails on a fact not known yet); unchecked (an earlier condition failed first)."),
|
|
1853
|
+
reason: z.enum(GATE_REASONS).nullable().describe("The gate reason a failed or waiting condition reports; null otherwise.")
|
|
1854
|
+
}).describe("One exit condition of a column and its state.");
|
|
1855
|
+
/** Why a task is where it is, from the dispatcher's point of view. */
|
|
1856
|
+
const taskWhySchema = z.strictObject({
|
|
1857
|
+
column: z.enum(COLUMN_IDS).describe("Column the dispatcher works from: the shadow column in shadow mode."),
|
|
1858
|
+
dispatcher: z.enum(DISPATCHER_MODES).nullable().describe("The project's dispatcher mode; null when the project is not configured."),
|
|
1859
|
+
holds: z.array(z.enum(TASK_HOLDS)).describe("What holds the dispatcher from acting on the task; empty when nothing does."),
|
|
1860
|
+
gates: z.array(z.strictObject({
|
|
1861
|
+
column: z.enum(COLUMN_IDS).describe("Board column."),
|
|
1862
|
+
enabled: z.boolean().describe("Whether the column is enabled in the project."),
|
|
1863
|
+
ok: z.boolean().describe("Whether the column's own exit conditions pass."),
|
|
1864
|
+
blockedIn: z.enum(COLUMN_IDS).nullable().describe("Leftmost enabled column at or left of this one whose exit conditions fail; null when the cumulative gate passes."),
|
|
1865
|
+
conditions: z.array(gateConditionSchema).describe("The column's exit conditions, empty for a column without any.")
|
|
1866
|
+
}).describe("The gate of one column.")).describe("The gate of every column, To Do to Done; empty when the pull request facts are missing."),
|
|
1867
|
+
checksWaivedBy: z.literal("reposWithoutCi").nullable().describe("The config key that passed Dev's check condition for a repo without checks; null otherwise."),
|
|
1868
|
+
turn: turnViewSchema.nullable().describe("The open turn of the task; null when none is open."),
|
|
1869
|
+
moves: z.array(moveViewSchema).describe("The last 5 column moves, oldest first.")
|
|
1870
|
+
}).describe("Why the task is in its column and what the dispatcher waits for.");
|
|
1786
1871
|
const itemViewSchema = z.strictObject({
|
|
1787
1872
|
id: itemIdSchema,
|
|
1788
1873
|
task: taskKeySchema.nullable().describe("Task the item is about; null for a board-wide item."),
|
|
@@ -2000,6 +2085,93 @@ const item = {
|
|
|
2000
2085
|
at,
|
|
2001
2086
|
summary: "Deploy of PROJ-123 failed."
|
|
2002
2087
|
};
|
|
2088
|
+
const met = (condition) => ({
|
|
2089
|
+
condition,
|
|
2090
|
+
state: "met",
|
|
2091
|
+
reason: null
|
|
2092
|
+
});
|
|
2093
|
+
const failed = (condition, reason) => ({
|
|
2094
|
+
condition,
|
|
2095
|
+
state: "failed",
|
|
2096
|
+
reason
|
|
2097
|
+
});
|
|
2098
|
+
/**
|
|
2099
|
+
* The gates of a task in Review on a project with To Do, Dev, Review and Done enabled: Dev passes,
|
|
2100
|
+
* Review waits for its review on head.
|
|
2101
|
+
*/
|
|
2102
|
+
const reviewGates = [
|
|
2103
|
+
{
|
|
2104
|
+
column: "todo",
|
|
2105
|
+
enabled: true,
|
|
2106
|
+
ok: true,
|
|
2107
|
+
blockedIn: null,
|
|
2108
|
+
conditions: []
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
column: "ready-for-dev",
|
|
2112
|
+
enabled: false,
|
|
2113
|
+
ok: true,
|
|
2114
|
+
blockedIn: null,
|
|
2115
|
+
conditions: []
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
column: "dev",
|
|
2119
|
+
enabled: true,
|
|
2120
|
+
ok: true,
|
|
2121
|
+
blockedIn: null,
|
|
2122
|
+
conditions: [
|
|
2123
|
+
met("pr_open"),
|
|
2124
|
+
met("not_draft"),
|
|
2125
|
+
met("checks_green"),
|
|
2126
|
+
met("no_conflict"),
|
|
2127
|
+
met("external_comments_handled"),
|
|
2128
|
+
met("comment_history_read"),
|
|
2129
|
+
met("submit_on_head")
|
|
2130
|
+
]
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
column: "review",
|
|
2134
|
+
enabled: true,
|
|
2135
|
+
ok: false,
|
|
2136
|
+
blockedIn: "review",
|
|
2137
|
+
conditions: [failed("review_on_head", "no_review_on_head")]
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
column: "product-review",
|
|
2141
|
+
enabled: false,
|
|
2142
|
+
ok: false,
|
|
2143
|
+
blockedIn: "review",
|
|
2144
|
+
conditions: [failed("review_on_head", "no_review_on_head")]
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
column: "external-review",
|
|
2148
|
+
enabled: false,
|
|
2149
|
+
ok: false,
|
|
2150
|
+
blockedIn: "review",
|
|
2151
|
+
conditions: [failed("approved", "not_approved")]
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
column: "qa",
|
|
2155
|
+
enabled: false,
|
|
2156
|
+
ok: false,
|
|
2157
|
+
blockedIn: "review",
|
|
2158
|
+
conditions: [failed("submit_on_head", "no_submit_on_head")]
|
|
2159
|
+
},
|
|
2160
|
+
{
|
|
2161
|
+
column: "ready-to-merge",
|
|
2162
|
+
enabled: false,
|
|
2163
|
+
ok: false,
|
|
2164
|
+
blockedIn: "review",
|
|
2165
|
+
conditions: [failed("merged", "not_merged")]
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
column: "done",
|
|
2169
|
+
enabled: true,
|
|
2170
|
+
ok: true,
|
|
2171
|
+
blockedIn: "review",
|
|
2172
|
+
conditions: []
|
|
2173
|
+
}
|
|
2174
|
+
];
|
|
2003
2175
|
const taskOutput = z.strictObject({ task: taskViewSchema });
|
|
2004
2176
|
const blockOutput = z.strictObject({ block: blockViewSchema });
|
|
2005
2177
|
const itemOutput = z.strictObject({ item: itemViewSchema });
|
|
@@ -2118,12 +2290,16 @@ const OPERATIONS = [
|
|
|
2118
2290
|
whenToUse: "Inspect one task now.",
|
|
2119
2291
|
whenNotToUse: "Use task_history for past events."
|
|
2120
2292
|
},
|
|
2121
|
-
input: z.strictObject({
|
|
2293
|
+
input: z.strictObject({
|
|
2294
|
+
task: taskKeySchema,
|
|
2295
|
+
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.")
|
|
2296
|
+
}),
|
|
2122
2297
|
output: z.strictObject({
|
|
2123
2298
|
task: taskViewSchema,
|
|
2124
2299
|
links: z.array(linkViewSchema).describe("Effective pull request, session, and ticket links."),
|
|
2125
2300
|
blocks: z.array(blockViewSchema).describe("Blocks on the task, open and unblocked."),
|
|
2126
|
-
comments: z.array(commentSchema).describe("Comments on the task, oldest first.")
|
|
2301
|
+
comments: z.array(commentSchema).describe("Comments on the task, oldest first."),
|
|
2302
|
+
why: taskWhySchema.optional().describe("Present only with why.")
|
|
2127
2303
|
}),
|
|
2128
2304
|
grants: operatorOrProjectAgent,
|
|
2129
2305
|
errors: ["wrong_id_kind", "not_found"],
|
|
@@ -2133,7 +2309,7 @@ const OPERATIONS = [
|
|
|
2133
2309
|
},
|
|
2134
2310
|
slack: {
|
|
2135
2311
|
kind: "slash-command",
|
|
2136
|
-
usage: "/board task <KEY>"
|
|
2312
|
+
usage: "/board task <KEY> [why]"
|
|
2137
2313
|
},
|
|
2138
2314
|
examples: [{
|
|
2139
2315
|
summary: "Show one task",
|
|
@@ -2144,6 +2320,46 @@ const OPERATIONS = [
|
|
|
2144
2320
|
blocks: [question],
|
|
2145
2321
|
comments: [comment]
|
|
2146
2322
|
}
|
|
2323
|
+
}, {
|
|
2324
|
+
summary: "Explain why a task waits in Review",
|
|
2325
|
+
input: {
|
|
2326
|
+
task: "PROJ-123",
|
|
2327
|
+
why: true
|
|
2328
|
+
},
|
|
2329
|
+
output: {
|
|
2330
|
+
task: {
|
|
2331
|
+
...task,
|
|
2332
|
+
column: "review"
|
|
2333
|
+
},
|
|
2334
|
+
links: [],
|
|
2335
|
+
blocks: [],
|
|
2336
|
+
comments: [],
|
|
2337
|
+
why: {
|
|
2338
|
+
column: "review",
|
|
2339
|
+
dispatcher: "on",
|
|
2340
|
+
holds: [],
|
|
2341
|
+
gates: reviewGates,
|
|
2342
|
+
checksWaivedBy: null,
|
|
2343
|
+
turn: {
|
|
2344
|
+
...reviewTurn,
|
|
2345
|
+
handed: [],
|
|
2346
|
+
taken: {
|
|
2347
|
+
by: "agent:rev/rev-1",
|
|
2348
|
+
at
|
|
2349
|
+
}
|
|
2350
|
+
},
|
|
2351
|
+
moves: [{
|
|
2352
|
+
at,
|
|
2353
|
+
kind: "task_moved",
|
|
2354
|
+
actor: "system",
|
|
2355
|
+
from: "dev",
|
|
2356
|
+
to: "review",
|
|
2357
|
+
reason: "gate_passed",
|
|
2358
|
+
gate: [],
|
|
2359
|
+
text: null
|
|
2360
|
+
}]
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2147
2363
|
}]
|
|
2148
2364
|
}),
|
|
2149
2365
|
defineOperation({
|
|
@@ -3061,6 +3277,85 @@ const OPERATIONS = [
|
|
|
3061
3277
|
}
|
|
3062
3278
|
}
|
|
3063
3279
|
}]
|
|
3280
|
+
}),
|
|
3281
|
+
defineOperation({
|
|
3282
|
+
id: "task.move",
|
|
3283
|
+
kind: "mutation",
|
|
3284
|
+
description: "Correct the column of a task by hand; the gates then settle the task from that column at once.",
|
|
3285
|
+
mcp: {
|
|
3286
|
+
whenToUse: "Put a task the board moved wrongly into the right column, Done excluded; the reply names the column it settled in.",
|
|
3287
|
+
whenNotToUse: "Use task_get with why to read why the task is where it is."
|
|
3288
|
+
},
|
|
3289
|
+
input: z.discriminatedUnion("mode", [z.strictObject({
|
|
3290
|
+
mode: z.literal("correct").describe("Correct a wrong column by hand."),
|
|
3291
|
+
task: taskKeySchema,
|
|
3292
|
+
column: z.enum(COLUMN_IDS).exclude(["done"]).describe("Enabled column to put the task in; Done is reached only from the facts."),
|
|
3293
|
+
reason: text("Why the column is corrected, kept in the journal.")
|
|
3294
|
+
})]),
|
|
3295
|
+
output: z.strictObject({
|
|
3296
|
+
task: taskViewSchema,
|
|
3297
|
+
from: z.enum(COLUMN_IDS).describe("Column the dispatcher worked from before the correction."),
|
|
3298
|
+
to: z.enum(COLUMN_IDS).describe("Column the correction put the task in."),
|
|
3299
|
+
column: z.enum(COLUMN_IDS).describe("Column the gates settled the task in; the shadow column while the dispatcher is in shadow mode."),
|
|
3300
|
+
settled: z.array(moveViewSchema).describe("The dispatcher moves from the corrected column, oldest first.")
|
|
3301
|
+
}),
|
|
3302
|
+
grants: operatorOnly,
|
|
3303
|
+
errors: [
|
|
3304
|
+
"wrong_id_kind",
|
|
3305
|
+
"not_found",
|
|
3306
|
+
"task_archived",
|
|
3307
|
+
"move_not_allowed"
|
|
3308
|
+
],
|
|
3309
|
+
cli: {
|
|
3310
|
+
command: "move",
|
|
3311
|
+
args: ["task", "column"],
|
|
3312
|
+
modes: [{
|
|
3313
|
+
mode: "correct",
|
|
3314
|
+
flag: "--correct",
|
|
3315
|
+
value: null
|
|
3316
|
+
}]
|
|
3317
|
+
},
|
|
3318
|
+
slack: null,
|
|
3319
|
+
examples: [{
|
|
3320
|
+
summary: "Correct a task the board put in Done by mistake",
|
|
3321
|
+
input: {
|
|
3322
|
+
mode: "correct",
|
|
3323
|
+
task: "PROJ-123",
|
|
3324
|
+
column: "dev",
|
|
3325
|
+
reason: "The linked pull request belongs to another ticket."
|
|
3326
|
+
},
|
|
3327
|
+
output: {
|
|
3328
|
+
task,
|
|
3329
|
+
from: "done",
|
|
3330
|
+
to: "dev",
|
|
3331
|
+
column: "dev",
|
|
3332
|
+
settled: []
|
|
3333
|
+
}
|
|
3334
|
+
}, {
|
|
3335
|
+
summary: "Correct a task into Review while its Dev gate is broken",
|
|
3336
|
+
input: {
|
|
3337
|
+
mode: "correct",
|
|
3338
|
+
task: "PROJ-123",
|
|
3339
|
+
column: "review",
|
|
3340
|
+
reason: "The review was done outside the board."
|
|
3341
|
+
},
|
|
3342
|
+
output: {
|
|
3343
|
+
task,
|
|
3344
|
+
from: "dev",
|
|
3345
|
+
to: "review",
|
|
3346
|
+
column: "dev",
|
|
3347
|
+
settled: [{
|
|
3348
|
+
at,
|
|
3349
|
+
kind: "task_moved",
|
|
3350
|
+
actor: "system",
|
|
3351
|
+
from: "review",
|
|
3352
|
+
to: "dev",
|
|
3353
|
+
reason: "gate_broken",
|
|
3354
|
+
gate: ["external_comments"],
|
|
3355
|
+
text: null
|
|
3356
|
+
}]
|
|
3357
|
+
}
|
|
3358
|
+
}]
|
|
3064
3359
|
})
|
|
3065
3360
|
];
|
|
3066
3361
|
//#endregion
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ Other errors: `not_found`.
|
|
|
16
16
|
|
|
17
17
|
Purpose: Show a task with its links, blocks and comments.
|
|
18
18
|
Arguments: `<task>`.
|
|
19
|
-
Flags: `--json`.
|
|
19
|
+
Flags: `--why`, `--json`.
|
|
20
20
|
Use when: Inspect one task now.
|
|
21
21
|
Avoid when: Use `board task history <task>` for past events.
|
|
22
22
|
Example: `board task PROJ-123` — Show one task.
|