spur-board 0.51.0 → 0.52.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 +3 -3
- package/dist/{client-rSOSGe04.mjs → client-BTgz-Fib.mjs} +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{config-CfWbR2yC.mjs → config-DbMBAXe3.mjs} +2 -2
- package/dist/daemon.mjs +134 -22
- package/dist/mcp.mjs +10 -6
- package/dist/{src-B5vMuqoD.mjs → src-Dy1XbpPP.mjs} +33 -3
- package/package.json +1 -1
- package/skills/spur-board/references/commands.md +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as configSchema, H as ERRORS, I as actorIdSchema, f as roleCanUseOperation, it as SLACK_BOT_SCOPES, o as SYSTEMD_SERVICE_SETTINGS, p as OPERATIONS, q as successEnvelopeSchema, r as requestHashOf, tt as requiredSecretKeys } from "./src-
|
|
2
|
-
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 "./client-
|
|
3
|
-
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 "./config-
|
|
1
|
+
import { $ as configSchema, H as ERRORS, I as actorIdSchema, f as roleCanUseOperation, it as SLACK_BOT_SCOPES, o as SYSTEMD_SERVICE_SETTINGS, p as OPERATIONS, q as successEnvelopeSchema, r as requestHashOf, tt as requiredSecretKeys } from "./src-Dy1XbpPP.mjs";
|
|
2
|
+
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 "./client-BTgz-Fib.mjs";
|
|
3
|
+
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 "./config-DbMBAXe3.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as errorEnvelopeSchema, H as ERRORS, W as errorContextSchema, g as renderJsonError, q as successEnvelopeSchema } from "./src-
|
|
1
|
+
import { G as errorEnvelopeSchema, H as ERRORS, W as errorContextSchema, g as renderJsonError, q as successEnvelopeSchema } from "./src-Dy1XbpPP.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 { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-BTgz-Fib.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as configSchema, d as buildCatalogSnapshot, et as plainHttpAllowed, p as OPERATIONS } from "./src-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { $ as configSchema, d as buildCatalogSnapshot, et as plainHttpAllowed, p as OPERATIONS } from "./src-Dy1XbpPP.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./client-BTgz-Fib.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 { $ as configSchema, A as parseRingMarker, B as parseRef$1, C as userIdSchema, D as SESSION_HEALTH_STATES, E as REVIEW_STATES, F as ticketFactsSchema, H as ERRORS, I as actorIdSchema, K as ok, L as encodeActorId, M as prRefSchema, N as ringMarker, O as SESSION_STATUSES, P as sessionFactsSchema, Q as RESERVED_PROJECT, R as errorCodeOf, S as messageRefSchema, T as eventPayloadSchemas, U as err, V as taskKeySchema, Y as DEFAULT_LINK, Z as DEFAULT_SLACK_COMMAND, a as BOARD_TICK_MS, b as inboundEventSchema, c as batchSchema, d as buildCatalogSnapshot, et as plainHttpAllowed, f as roleCanUseOperation, h as renderHttpProblem, i as tokenRequestSchema, it as SLACK_BOT_SCOPES, j as prFactsSchema, k as isExternalAuthor, l as entityRefSchema, m as turnHandedSchema, n as TOKEN_REQUEST_LIMITS, nt as COLUMN_IDS, p as OPERATIONS, q as successEnvelopeSchema, r as requestHashOf, rt as DISPATCHER_MODES, s as AdapterError, t as assertNever, tt as requiredSecretKeys, u as sourceCursorSchema, v as SPACE_IDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as parseActorId } from "./src-
|
|
1
|
+
import { $ as configSchema, A as parseRingMarker, B as parseRef$1, C as userIdSchema, D as SESSION_HEALTH_STATES, E as REVIEW_STATES, F as ticketFactsSchema, H as ERRORS, I as actorIdSchema, K as ok, L as encodeActorId, M as prRefSchema, N as ringMarker, O as SESSION_STATUSES, P as sessionFactsSchema, Q as RESERVED_PROJECT, R as errorCodeOf, S as messageRefSchema, T as eventPayloadSchemas, U as err, V as taskKeySchema, Y as DEFAULT_LINK, Z as DEFAULT_SLACK_COMMAND, a as BOARD_TICK_MS, b as inboundEventSchema, c as batchSchema, d as buildCatalogSnapshot, et as plainHttpAllowed, f as roleCanUseOperation, h as renderHttpProblem, i as tokenRequestSchema, it as SLACK_BOT_SCOPES, j as prFactsSchema, k as isExternalAuthor, l as entityRefSchema, m as turnHandedSchema, n as TOKEN_REQUEST_LIMITS, nt as COLUMN_IDS, p as OPERATIONS, q as successEnvelopeSchema, r as requestHashOf, rt as DISPATCHER_MODES, s as AdapterError, t as assertNever, tt as requiredSecretKeys, u as sourceCursorSchema, v as SPACE_IDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as parseActorId } from "./src-Dy1XbpPP.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { chmodSync, closeSync, existsSync, fchmodSync, fstatSync, fsyncSync, ftruncateSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeSync } from "node:fs";
|
|
@@ -8688,7 +8688,8 @@ const KIND_PRIORITY = {
|
|
|
8688
8688
|
};
|
|
8689
8689
|
const persona = z.strictObject({
|
|
8690
8690
|
name: z.string().min(1),
|
|
8691
|
-
role: z.enum(PERSONA_ROLES)
|
|
8691
|
+
role: z.enum(PERSONA_ROLES),
|
|
8692
|
+
icon: z.string().min(1).optional()
|
|
8692
8693
|
});
|
|
8693
8694
|
const id = z.int().positive();
|
|
8694
8695
|
const closePayload = z.strictObject({
|
|
@@ -8738,10 +8739,22 @@ const feedEditPayload = feedLineEditPayload.extend({
|
|
|
8738
8739
|
tokenCard: tokenCardPayload.optional(),
|
|
8739
8740
|
actions: z.array(actionPayload).optional()
|
|
8740
8741
|
});
|
|
8742
|
+
/** A curator answer's question and answer, shortened; a row without it renders `text`. */
|
|
8743
|
+
const exchange = z.strictObject({
|
|
8744
|
+
block: z.string().min(1),
|
|
8745
|
+
taskTitle: z.string().min(1).optional(),
|
|
8746
|
+
question: z.string(),
|
|
8747
|
+
answer: z.string(),
|
|
8748
|
+
note: z.string().min(1).optional(),
|
|
8749
|
+
askedBy: z.string().min(1),
|
|
8750
|
+
answeredBy: z.string().min(1),
|
|
8751
|
+
outcome: z.literal("unblocked")
|
|
8752
|
+
});
|
|
8741
8753
|
const feedLineWithLinkPayload = feedLinePayload.extend({
|
|
8742
8754
|
itemId: id.optional(),
|
|
8743
8755
|
url: z.url().optional(),
|
|
8744
|
-
actions: z.array(actionPayload).optional()
|
|
8756
|
+
actions: z.array(actionPayload).optional(),
|
|
8757
|
+
exchange: exchange.optional()
|
|
8745
8758
|
});
|
|
8746
8759
|
const doorbellPayload = z.strictObject({
|
|
8747
8760
|
session: z.string().min(1),
|
|
@@ -8801,6 +8814,63 @@ function renderBody(key, text) {
|
|
|
8801
8814
|
}];
|
|
8802
8815
|
}
|
|
8803
8816
|
/**
|
|
8817
|
+
* A curator answer line: the task link and title, the question, the answer, the note, then the
|
|
8818
|
+
* block, who asked, who answered and the outcome as muted details.
|
|
8819
|
+
*/
|
|
8820
|
+
function exchangeBody(payload) {
|
|
8821
|
+
const { exchange: line } = payload;
|
|
8822
|
+
return [
|
|
8823
|
+
{
|
|
8824
|
+
kind: "paragraph",
|
|
8825
|
+
children: [payload.url === void 0 ? {
|
|
8826
|
+
kind: "text",
|
|
8827
|
+
text: payload.key
|
|
8828
|
+
} : {
|
|
8829
|
+
kind: "link",
|
|
8830
|
+
url: payload.url,
|
|
8831
|
+
text: payload.key
|
|
8832
|
+
}, ...line.taskTitle === void 0 ? [] : [{
|
|
8833
|
+
kind: "text",
|
|
8834
|
+
text: ` ${line.taskTitle}`
|
|
8835
|
+
}]]
|
|
8836
|
+
},
|
|
8837
|
+
{
|
|
8838
|
+
kind: "paragraph",
|
|
8839
|
+
children: [{
|
|
8840
|
+
kind: "emphasis",
|
|
8841
|
+
text: "Question:"
|
|
8842
|
+
}, {
|
|
8843
|
+
kind: "text",
|
|
8844
|
+
text: ` ${line.question}`
|
|
8845
|
+
}]
|
|
8846
|
+
},
|
|
8847
|
+
{
|
|
8848
|
+
kind: "paragraph",
|
|
8849
|
+
children: [{
|
|
8850
|
+
kind: "emphasis",
|
|
8851
|
+
text: "Answer:"
|
|
8852
|
+
}, {
|
|
8853
|
+
kind: "text",
|
|
8854
|
+
text: ` ${line.answer}`
|
|
8855
|
+
}]
|
|
8856
|
+
},
|
|
8857
|
+
...line.note === void 0 ? [] : [{
|
|
8858
|
+
kind: "paragraph",
|
|
8859
|
+
children: [{
|
|
8860
|
+
kind: "italic",
|
|
8861
|
+
text: line.note
|
|
8862
|
+
}]
|
|
8863
|
+
}],
|
|
8864
|
+
{
|
|
8865
|
+
kind: "context",
|
|
8866
|
+
children: [{
|
|
8867
|
+
kind: "text",
|
|
8868
|
+
text: `${line.block} · asked by ${line.askedBy} · answered by ${line.answeredBy} · ${line.outcome}`
|
|
8869
|
+
}]
|
|
8870
|
+
}
|
|
8871
|
+
];
|
|
8872
|
+
}
|
|
8873
|
+
/**
|
|
8804
8874
|
* A distinct semantic ring. Transport retries reuse this row and its text. A restarted series
|
|
8805
8875
|
* (`series` > 0), a ring after the task was archived (`archives` > 0) and a ring after a move
|
|
8806
8876
|
* killed an earlier one (`moves` > 0) get their own keys, so a cancelled ring does not block its
|
|
@@ -8915,6 +8985,8 @@ async function enqueueBoardFeedLine(trx, input) {
|
|
|
8915
8985
|
}
|
|
8916
8986
|
const QUESTION_CHARS = 120;
|
|
8917
8987
|
const ANSWER_CHARS = 200;
|
|
8988
|
+
const NOTE_CHARS = 200;
|
|
8989
|
+
const TITLE_CHARS = 80;
|
|
8918
8990
|
/** Collapses whitespace and cuts by code points to `limit`, ending a cut text with `…`. */
|
|
8919
8991
|
function shorten(text, limit) {
|
|
8920
8992
|
const points = Array.from(text.replace(/\s+/g, " ").trim());
|
|
@@ -8924,20 +8996,31 @@ function shorten(text, limit) {
|
|
|
8924
8996
|
async function enqueueCuratorAnswerLine(trx, input) {
|
|
8925
8997
|
const block = `B${String(input.blockId)}`;
|
|
8926
8998
|
const itemKey = `curator-answer:comment:${String(input.commentId)}`;
|
|
8999
|
+
const note = input.note === void 0 ? "" : shorten(input.note, NOTE_CHARS);
|
|
9000
|
+
const taskTitle = input.taskTitle === void 0 ? "" : shorten(input.taskTitle, TITLE_CHARS);
|
|
9001
|
+
const question = shorten(input.question, QUESTION_CHARS);
|
|
9002
|
+
const answer = shorten(input.answer, ANSWER_CHARS);
|
|
8927
9003
|
await insertOutbox(trx, {
|
|
8928
9004
|
kind: "feed.line",
|
|
8929
9005
|
dedupeKey: `feed.line:${itemKey}`,
|
|
8930
9006
|
payload: {
|
|
8931
9007
|
key: input.key,
|
|
8932
|
-
text: `${block} · ${input.asker} asked: ${
|
|
9008
|
+
text: `${block} · ${input.asker} asked: ${question} → curator answered: ${answer}`,
|
|
8933
9009
|
title: `${input.key} ${block} answered by curator`,
|
|
8934
|
-
persona:
|
|
8935
|
-
name: input.curator,
|
|
8936
|
-
role: "curator"
|
|
8937
|
-
},
|
|
9010
|
+
persona: input.persona,
|
|
8938
9011
|
itemKey,
|
|
8939
9012
|
taskId: input.taskId,
|
|
8940
|
-
...input.url === "" ? {} : { url: input.url }
|
|
9013
|
+
...input.url === "" ? {} : { url: input.url },
|
|
9014
|
+
exchange: {
|
|
9015
|
+
block,
|
|
9016
|
+
...taskTitle === "" ? {} : { taskTitle },
|
|
9017
|
+
question,
|
|
9018
|
+
answer,
|
|
9019
|
+
...note === "" ? {} : { note },
|
|
9020
|
+
askedBy: input.asker,
|
|
9021
|
+
answeredBy: input.answeredBy,
|
|
9022
|
+
outcome: "unblocked"
|
|
9023
|
+
}
|
|
8941
9024
|
},
|
|
8942
9025
|
parent: null,
|
|
8943
9026
|
at: input.at
|
|
@@ -11299,15 +11382,16 @@ async function openSystemBlock(trx, input) {
|
|
|
11299
11382
|
}
|
|
11300
11383
|
/**
|
|
11301
11384
|
* Copies the answer to a course check to the task as a comment without a block, so the worker
|
|
11302
|
-
* reads it in its inbox: the close reason, else the closing actor's newest comment
|
|
11303
|
-
* A copied comment is named in the copy's `comment_added`, so its edits reach the
|
|
11385
|
+
* reads it in its inbox: the close reason, else `answer`, else the closing actor's newest comment
|
|
11386
|
+
* on the block. A copied comment is named in the copy's `comment_added`, so its edits reach the
|
|
11387
|
+
* copy.
|
|
11304
11388
|
*/
|
|
11305
|
-
async function forwardCourseNote(trx, task, block, ctx, reason) {
|
|
11389
|
+
async function forwardCourseNote(trx, task, block, ctx, reason, given) {
|
|
11306
11390
|
if (reason !== null) {
|
|
11307
11391
|
await insertComment(trx, task, null, reason, ctx, "worker");
|
|
11308
11392
|
return;
|
|
11309
11393
|
}
|
|
11310
|
-
const answer = await trx.selectFrom("comment").select(["id", "text"]).where("block_id", "=", block.id).where("author", "=", ctx.actor).orderBy("id", "desc").executeTakeFirst();
|
|
11394
|
+
const answer = given ?? await trx.selectFrom("comment").select(["id", "text"]).where("block_id", "=", block.id).where("author", "=", ctx.actor).orderBy("id", "desc").executeTakeFirst();
|
|
11311
11395
|
if (answer === void 0) return;
|
|
11312
11396
|
await insertComment(trx, task, null, answer.text, ctx, "worker", void 0, answer.id);
|
|
11313
11397
|
}
|
|
@@ -11341,9 +11425,10 @@ async function reviseComment(trx, task, comment, text, ctx) {
|
|
|
11341
11425
|
* Unblocks one block with its journal entry, thread close, doorbell close and item clears. An
|
|
11342
11426
|
* operator or agent close of a reconciled ledger block dismisses its item, so the condition
|
|
11343
11427
|
* raises again only once it changes; a `system` or archive close only clears it. An answer or a
|
|
11344
|
-
* close with a reason to a course check also goes to the worker as a task comment
|
|
11428
|
+
* close with a reason to a course check also goes to the worker as a task comment; `answer` names
|
|
11429
|
+
* the answer when the closing actor also left a note after it.
|
|
11345
11430
|
*/
|
|
11346
|
-
async function closeOpenBlock(trx, task, block, ctx, outcome, outcomeReason) {
|
|
11431
|
+
async function closeOpenBlock(trx, task, block, ctx, outcome, outcomeReason, answer) {
|
|
11347
11432
|
const updated = await trx.updateTable("block").set({
|
|
11348
11433
|
state: "unblocked",
|
|
11349
11434
|
outcome,
|
|
@@ -11364,7 +11449,7 @@ async function closeOpenBlock(trx, task, block, ctx, outcome, outcomeReason) {
|
|
|
11364
11449
|
});
|
|
11365
11450
|
await closeBlockNotification(trx, block.id, new Date(ctx.at), ctx.actor);
|
|
11366
11451
|
const items = await trx.selectFrom("operator_item").selectAll().where("kind", "in", ["post_blocked", ...BLOCK_ITEM_KINDS]).where("block_id", "=", block.id).where("cleared_at", "is", null).execute();
|
|
11367
|
-
if (ctx.actor !== "system" && (outcome === "done" || outcome === "reason") && items.some((item) => item.kind === "course_check")) await forwardCourseNote(trx, task, block, ctx, outcome === "reason" ? outcomeReason : null);
|
|
11452
|
+
if (ctx.actor !== "system" && (outcome === "done" || outcome === "reason") && items.some((item) => item.kind === "course_check")) await forwardCourseNote(trx, task, block, ctx, outcome === "reason" ? outcomeReason : null, answer);
|
|
11368
11453
|
for (const item of items) if (item.kind === "post_blocked") await clearItem(trx, item.id, new Date(ctx.at), ctx.actor);
|
|
11369
11454
|
else if (ctx.actor !== "system" && outcome !== "archived" && isItemKind(item.kind) && ITEM_POLICY[item.kind].reconciled) await dismissItem(trx, item, ctx.actor, new Date(ctx.at));
|
|
11370
11455
|
else await clearItem(trx, item.id, new Date(ctx.at), ctx.actor);
|
|
@@ -11427,14 +11512,29 @@ async function editInboundComment(trx, input) {
|
|
|
11427
11512
|
}
|
|
11428
11513
|
return updated;
|
|
11429
11514
|
}
|
|
11515
|
+
/** The task's tracker title, or undefined when no readable snapshot has one; never throws. */
|
|
11516
|
+
async function ticketTitle(trx, task) {
|
|
11517
|
+
const row = await trx.selectFrom("ticket_snapshot").select("detail").where("task_id", "=", task.id).executeTakeFirst();
|
|
11518
|
+
if (row === void 0) return void 0;
|
|
11519
|
+
let detail;
|
|
11520
|
+
try {
|
|
11521
|
+
detail = JSON.parse(row.detail);
|
|
11522
|
+
} catch {
|
|
11523
|
+
return;
|
|
11524
|
+
}
|
|
11525
|
+
const facts = ticketFactsSchema.safeParse(detail);
|
|
11526
|
+
return facts.success ? facts.data.title : void 0;
|
|
11527
|
+
}
|
|
11430
11528
|
/** Posts a curator's answer to the feed; an operator answer is already on the board. */
|
|
11431
|
-
async function queueCuratorAnswerLine(trx, task, block, answer, ctx, config) {
|
|
11529
|
+
async function queueCuratorAnswerLine(trx, task, block, answer, note, ctx, config) {
|
|
11432
11530
|
if (parseAddressee(block.addressee_role).kind !== "curator") return;
|
|
11433
11531
|
if (authorRole(config, task, ctx.actor) === "operator") return;
|
|
11434
11532
|
const curator = parseActorId(ctx.actor);
|
|
11435
11533
|
if (curator?.actor !== "agent") return;
|
|
11436
11534
|
const asker = parseActorId(block.author);
|
|
11437
11535
|
const question = await trx.selectFrom("comment").select("text").where("block_id", "=", block.id).where("id", "<", answer.id).orderBy("id").executeTakeFirst();
|
|
11536
|
+
const { project, session } = curator.actorRef;
|
|
11537
|
+
const entry = config.projects.find((p) => p.id === task.project)?.spurProjects.find((s) => s.role === "curator" && s.name === project);
|
|
11438
11538
|
await enqueueCuratorAnswerLine(trx, {
|
|
11439
11539
|
taskId: task.id,
|
|
11440
11540
|
key: task.key,
|
|
@@ -11444,7 +11544,14 @@ async function queueCuratorAnswerLine(trx, task, block, answer, ctx, config) {
|
|
|
11444
11544
|
asker: asker?.actor === "agent" ? `${asker.actorRef.project}/${asker.actorRef.session}` : block.author,
|
|
11445
11545
|
question: question?.text ?? block.reason,
|
|
11446
11546
|
answer: answer.text,
|
|
11447
|
-
|
|
11547
|
+
note,
|
|
11548
|
+
taskTitle: await ticketTitle(trx, task),
|
|
11549
|
+
persona: {
|
|
11550
|
+
name: entry?.displayName ?? project,
|
|
11551
|
+
role: "curator",
|
|
11552
|
+
...entry?.icon === void 0 ? {} : { icon: entry.icon }
|
|
11553
|
+
},
|
|
11554
|
+
answeredBy: `${project}/${session}`,
|
|
11448
11555
|
at: new Date(ctx.at)
|
|
11449
11556
|
});
|
|
11450
11557
|
}
|
|
@@ -11533,9 +11640,11 @@ function createBlockMutations(config) {
|
|
|
11533
11640
|
rule(() => {
|
|
11534
11641
|
answerBlock(current$1(block));
|
|
11535
11642
|
});
|
|
11536
|
-
const
|
|
11537
|
-
const
|
|
11538
|
-
await
|
|
11643
|
+
const role = authorRole(config, task, block.author);
|
|
11644
|
+
const comment = await addComment(trx, task, block, input.text, ctx, role, config);
|
|
11645
|
+
if (input.note !== void 0) await addComment(trx, task, block, input.note, ctx, role, config, { ringsAuthor: false });
|
|
11646
|
+
const updated = await closeOpenBlock(trx, task, block, ctx, "done", null, comment);
|
|
11647
|
+
await queueCuratorAnswerLine(trx, task, block, comment, input.note, ctx, config);
|
|
11539
11648
|
return {
|
|
11540
11649
|
block: blockView(updated, task),
|
|
11541
11650
|
comment: commentView(comment, task)
|
|
@@ -12321,7 +12430,10 @@ function createSender(options) {
|
|
|
12321
12430
|
body: body.kind === "feed.line.edit" && body.payload.tokenCard !== void 0 ? tokenCardBody(body.payload.tokenCard, options.config) : body.kind === "feed.line.edit" && body.payload.resolved !== void 0 ? resolvedFeedBody({
|
|
12322
12431
|
...body.payload,
|
|
12323
12432
|
resolved: body.payload.resolved
|
|
12324
|
-
}, options.config) : c.body.kind === "feed.line" && c.body.payload.
|
|
12433
|
+
}, options.config) : c.body.kind === "feed.line" && c.body.payload.exchange !== void 0 ? exchangeBody({
|
|
12434
|
+
...c.body.payload,
|
|
12435
|
+
exchange: c.body.payload.exchange
|
|
12436
|
+
}) : c.body.kind === "feed.line" && c.body.payload.url !== void 0 ? [{
|
|
12325
12437
|
kind: "paragraph",
|
|
12326
12438
|
children: [{
|
|
12327
12439
|
kind: "link",
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { H as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./src-
|
|
2
|
-
import { o 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 { H as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./src-Dy1XbpPP.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./client-BTgz-Fib.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-DbMBAXe3.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -56,14 +56,18 @@ function toolDescription(op) {
|
|
|
56
56
|
...op.kind === "mutation" ? ["Choose a unique idempotencyKey for each action; reuse it on retries."] : []
|
|
57
57
|
].join("\n");
|
|
58
58
|
}
|
|
59
|
+
const MISSING_KEY_HINT = "Send a non-blank idempotencyKey string with this action: one new key per action, reused on retries.";
|
|
60
|
+
const QUERY_KEY_HINT = "Remove idempotencyKey: queries take no idempotencyKey.";
|
|
61
|
+
const KEY_HINTS = /* @__PURE__ */ new Set([MISSING_KEY_HINT, QUERY_KEY_HINT]);
|
|
62
|
+
const keyError = (hint) => new CliError("usage", void 0, void 0, hint);
|
|
59
63
|
function parseArguments(op, argumentsValue, agent) {
|
|
60
64
|
if (!argumentsValue || typeof argumentsValue !== "object" || Array.isArray(argumentsValue)) throw new CliError("usage");
|
|
61
65
|
const { idempotencyKey, ...input } = argumentsValue;
|
|
62
66
|
let key;
|
|
63
67
|
if (op.kind === "mutation") if (idempotencyKey === void 0 && !agent) key = randomUUID();
|
|
64
68
|
else if (typeof idempotencyKey === "string" && idempotencyKey.trim()) key = idempotencyKey;
|
|
65
|
-
else throw
|
|
66
|
-
else if (idempotencyKey !== void 0) throw
|
|
69
|
+
else throw keyError(MISSING_KEY_HINT);
|
|
70
|
+
else if (idempotencyKey !== void 0) throw keyError(QUERY_KEY_HINT);
|
|
67
71
|
const parsed = op.input.safeParse(input);
|
|
68
72
|
if (!parsed.success) throw new CliError("usage");
|
|
69
73
|
return {
|
|
@@ -159,7 +163,7 @@ function createMcpServer(env = process.env, loadConfig = loadClientConfig) {
|
|
|
159
163
|
...error.context,
|
|
160
164
|
...key && ERRORS[error.code].exit === 5 ? { idempotencyKey: key } : {}
|
|
161
165
|
} } : {}
|
|
162
|
-
}, error.code === "forbidden" ? error.hint : void 0);
|
|
166
|
+
}, error.code === "forbidden" || error.hint && KEY_HINTS.has(error.hint) ? error.hint : void 0);
|
|
163
167
|
}
|
|
164
168
|
});
|
|
165
169
|
return server;
|
|
@@ -269,7 +269,9 @@ const spurProject = z.strictObject({
|
|
|
269
269
|
"worker",
|
|
270
270
|
"operator",
|
|
271
271
|
"curator"
|
|
272
|
-
]).describe("worker: sessions of this Spur project may link to this project's tasks through their PR or branch. operator: sessions act as the operator. curator: sessions answer the questions no column orchestrator takes and escalate the rest to the operator; a board project has at most one.")
|
|
272
|
+
]).describe("worker: sessions of this Spur project may link to this project's tasks through their PR or branch. operator: sessions act as the operator. curator: sessions answer the questions no column orchestrator takes and escalate the rest to the operator; a board project has at most one."),
|
|
273
|
+
displayName: nonEmpty.max(80).optional().describe("The name a curator's answer lines in the feed are posted under. Defaults to the Spur project name. Only for a curator."),
|
|
274
|
+
icon: z.string().regex(/^:[a-z0-9_+'-]+:$/, "Expected an emoji shortcode such as :owl:").optional().describe("The emoji shortcode, such as :owl:, shown on a curator's answer lines in the feed instead of the curator icon. Only for a curator.")
|
|
273
275
|
});
|
|
274
276
|
const DEFAULT_CYCLE_LIMIT = 10;
|
|
275
277
|
const DEFAULT_COURSE_CHECK = 3;
|
|
@@ -333,7 +335,17 @@ const projectSchema = z.strictObject({
|
|
|
333
335
|
rejectDuplicates(items, "name", "spur project name", ctx);
|
|
334
336
|
let curator;
|
|
335
337
|
items.forEach((item, i) => {
|
|
336
|
-
if (item.role !== "curator")
|
|
338
|
+
if (item.role !== "curator") {
|
|
339
|
+
for (const field of ["displayName", "icon"]) {
|
|
340
|
+
if (item[field] === void 0) continue;
|
|
341
|
+
ctx.addIssue({
|
|
342
|
+
code: "custom",
|
|
343
|
+
path: [i, field],
|
|
344
|
+
message: "displayName and icon apply only to a curator"
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
337
349
|
if (curator !== void 0) ctx.addIssue({
|
|
338
350
|
code: "custom",
|
|
339
351
|
path: [i, "role"],
|
|
@@ -3052,7 +3064,8 @@ const OPERATIONS = [
|
|
|
3052
3064
|
},
|
|
3053
3065
|
input: z.strictObject({
|
|
3054
3066
|
block: blockIdSchema,
|
|
3055
|
-
text: text("The answer.", TEXT_MAX)
|
|
3067
|
+
text: text("The answer.", TEXT_MAX),
|
|
3068
|
+
note: z.string().min(1).max(TEXT_MAX).optional().describe("Your own comment on the answer, kept apart from it: stored as a second comment and shown on the curator feed line.")
|
|
3056
3069
|
}),
|
|
3057
3070
|
output: z.strictObject({
|
|
3058
3071
|
block: blockViewSchema,
|
|
@@ -3088,6 +3101,23 @@ const OPERATIONS = [
|
|
|
3088
3101
|
},
|
|
3089
3102
|
comment
|
|
3090
3103
|
}
|
|
3104
|
+
}, {
|
|
3105
|
+
summary: "Answer a question with a note",
|
|
3106
|
+
input: {
|
|
3107
|
+
block: "B12",
|
|
3108
|
+
text: "Target v2.",
|
|
3109
|
+
note: "Checked the release plan."
|
|
3110
|
+
},
|
|
3111
|
+
output: {
|
|
3112
|
+
block: {
|
|
3113
|
+
...question,
|
|
3114
|
+
state: "unblocked",
|
|
3115
|
+
outcome: "done",
|
|
3116
|
+
unblockedBy: "operator",
|
|
3117
|
+
unblockedAt: at
|
|
3118
|
+
},
|
|
3119
|
+
comment
|
|
3120
|
+
}
|
|
3091
3121
|
}]
|
|
3092
3122
|
}),
|
|
3093
3123
|
defineOperation({
|
package/package.json
CHANGED
|
@@ -117,7 +117,7 @@ Other errors: `wrong_id_kind`, `not_found`, `block_not_open`, `task_archived`, `
|
|
|
117
117
|
|
|
118
118
|
Purpose: Answer a question block; the answer becomes a comment and the block closes.
|
|
119
119
|
Arguments: `<block>`, `<text>`.
|
|
120
|
-
Flags: `--key <key>`, `--json`.
|
|
120
|
+
Flags: `--note <value>`, `--key <key>`, `--json`.
|
|
121
121
|
Use when: Answer an open question.
|
|
122
122
|
Avoid when: Use `board unblock <block>` to close without an answer.
|
|
123
123
|
Example: `board answer B12 "Target v2." --key answer-PROJ-123-question-1432` — Answer a question.
|