spur-board 0.43.0 → 0.43.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 +3 -3
- package/dist/{client-C0DEiR41.mjs → client-CJwU6M5L.mjs} +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{config-i3T5pqbh.mjs → config-Gl2ISKcx.mjs} +2 -2
- package/dist/daemon.mjs +57 -10
- package/dist/mcp.mjs +3 -3
- package/dist/{src-Dk-_gP9r.mjs → src-DlZuREcB.mjs} +48 -29
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as CliError, c as escapeTerminalControls, i as requestTokenEnrollment, n as fetchTokenStatus, o as errorExitCode, r as requestOperation, s as renderCliError } 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 { Q as requiredSecretKeys, X as configSchema, l as roleCanUseOperation, r as SYSTEMD_SERVICE_SETTINGS, tt as SLACK_BOT_SCOPES, u as OPERATIONS, z as ERRORS } from "./src-DlZuREcB.mjs";
|
|
2
|
+
import { a as CliError, c as escapeTerminalControls, i as requestTokenEnrollment, n as fetchTokenStatus, o as errorExitCode, r as requestOperation, s as renderCliError } from "./client-CJwU6M5L.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-Gl2ISKcx.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 {
|
|
1
|
+
import { H as errorEnvelopeSchema, V as errorContextSchema, W as successEnvelopeSchema, p as renderJsonError, z as ERRORS } from "./src-DlZuREcB.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 { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { i as requestTokenEnrollment, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./client-CJwU6M5L.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestTokenEnrollment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as CliError, t as fetchCatalogVersion } from "./client-
|
|
1
|
+
import { X as configSchema, Z as plainHttpAllowed, c as buildCatalogSnapshot, u as OPERATIONS } from "./src-DlZuREcB.mjs";
|
|
2
|
+
import { a as CliError, t as fetchCatalogVersion } from "./client-CJwU6M5L.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
|
|
1
|
+
import { $ as COLUMN_IDS, A as ringMarker, B as err, C as REVIEW_STATES, D as parseRingMarker, E as isExternalAuthor, F as errorCodeOf, I as parseActorId, J as DEFAULT_SLACK_COMMAND, K as DEFAULT_LINK, L as parseRef$1, M as ticketFactsSchema, N as actorIdSchema, O as prFactsSchema, P as encodeActorId, Q as requiredSecretKeys, R as taskKeySchema, S as eventPayloadSchemas, T as SESSION_STATUSES, U as ok, W as successEnvelopeSchema, X as configSchema, Y as RESERVED_PROJECT, Z as plainHttpAllowed, _ as inboundEventSchema, a as batchSchema, b as userIdSchema, c as buildCatalogSnapshot, d as turnHandedSchema, et as DISPATCHER_MODES, f as renderHttpProblem, g as conversationRefSchema, h as SPACE_IDS, i as AdapterError, j as sessionFactsSchema, k as prRefSchema, l as roleCanUseOperation, n as BOARD_TICK_MS, o as entityRefSchema, s as sourceCursorSchema, t as assertNever, tt as SLACK_BOT_SCOPES, u as OPERATIONS, v as interactionRefSchema, w as SESSION_HEALTH_STATES, x as EVENT_KINDS, y as messageRefSchema, z as ERRORS } from "./src-DlZuREcB.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";
|
|
@@ -9960,7 +9960,7 @@ function noRecipientEnd(n) {
|
|
|
9960
9960
|
}
|
|
9961
9961
|
/** A ring never carries comment or reason text: only where to look. */
|
|
9962
9962
|
async function ringText(trx, n, task, ring) {
|
|
9963
|
-
const suffix =
|
|
9963
|
+
const suffix = ringMarker(n.id, ring);
|
|
9964
9964
|
if (n.kind === "turn") return `${task.key} turn T${String(n.turn_id)}: check board inbox ${suffix}`;
|
|
9965
9965
|
if (n.kind === "turn_reminder") return `${task.key} turn T${String(n.turn_id)} is still open: check board inbox ${suffix}`;
|
|
9966
9966
|
const blockId = noticeBlockId(n);
|
|
@@ -9974,7 +9974,8 @@ function dueNotifications(db, at) {
|
|
|
9974
9974
|
}
|
|
9975
9975
|
/**
|
|
9976
9976
|
* Reconciles due notifications in their own transaction. With none due it opens no transaction;
|
|
9977
|
-
* a due notification waiting on a working recipient
|
|
9977
|
+
* a due notification waiting on a working recipient, an unsent ring or a ring still in the
|
|
9978
|
+
* recipient's Spur queue still opens one.
|
|
9978
9979
|
*/
|
|
9979
9980
|
async function reconcileDueDoorbells(store, config, at) {
|
|
9980
9981
|
if (await dueNotifications(store.db, at).select("notification.id").executeTakeFirst() === void 0) return;
|
|
@@ -10031,6 +10032,17 @@ async function reconcileDoorbells(trx, at, config) {
|
|
|
10031
10032
|
});
|
|
10032
10033
|
continue;
|
|
10033
10034
|
}
|
|
10035
|
+
if (rings > 0 && earlierRingQueued(session, n.id, rings) && !await spurBlind$1(trx)) {
|
|
10036
|
+
const pauses = ringPauses(config);
|
|
10037
|
+
const deadline = Date.parse(n.next_at) + pauses.slice(rings).reduce((sum, pause) => sum + pause, 0);
|
|
10038
|
+
if (at.getTime() >= deadline) await endNotification(trx, n, task, {
|
|
10039
|
+
session: session.id,
|
|
10040
|
+
reason: UNANSWERED,
|
|
10041
|
+
at,
|
|
10042
|
+
config
|
|
10043
|
+
});
|
|
10044
|
+
continue;
|
|
10045
|
+
}
|
|
10034
10046
|
const raised = await trx.selectFrom("operator_item").select((eb) => eb.fn.max("raise_no").as("series")).where("item_key", "=", exhaustedItemKey(n)).executeTakeFirst();
|
|
10035
10047
|
const archived = await trx.selectFrom("event").select((eb) => eb.fn.countAll().as("count")).where("task_id", "=", n.task_id).where("kind", "=", "task_archived").executeTakeFirst();
|
|
10036
10048
|
const killed = keepsRings ? await trx.selectFrom("outbox").select((eb) => eb.fn.countAll().as("count")).where("kind", "=", "doorbell").where("state", "=", "dead").where(sql`json_extract(payload, '$.notificationId')`, "=", n.id).executeTakeFirst() : void 0;
|
|
@@ -10049,15 +10061,33 @@ async function reconcileDoorbells(trx, at, config) {
|
|
|
10049
10061
|
await trx.updateTable("notification").set({ last_outbox_id: outboxId }).where("id", "=", n.id).execute();
|
|
10050
10062
|
}
|
|
10051
10063
|
}
|
|
10052
|
-
/**
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
if (n === void 0 || n.acked_at !== null && n.kind !== "turn_reminder" || n.recipient_session !== session || n.rings >= ring) return;
|
|
10056
|
-
const pauses = [
|
|
10064
|
+
/** The pause after each delivered ring of a series: before ring 2, before ring 3, then the end. */
|
|
10065
|
+
function ringPauses(config) {
|
|
10066
|
+
return [
|
|
10057
10067
|
config.doorbells.firstRetryMs,
|
|
10058
10068
|
config.doorbells.secondRetryMs,
|
|
10059
10069
|
config.doorbells.unansweredAfterMs
|
|
10060
10070
|
];
|
|
10071
|
+
}
|
|
10072
|
+
/**
|
|
10073
|
+
* Whether the session's facts list a ring of this series, up to `rings`, still in its Spur queue.
|
|
10074
|
+
* A detail that does not parse, or one without a queue, holds nothing.
|
|
10075
|
+
*/
|
|
10076
|
+
function earlierRingQueued(session, notificationId, rings) {
|
|
10077
|
+
let detail;
|
|
10078
|
+
try {
|
|
10079
|
+
detail = JSON.parse(session.detail);
|
|
10080
|
+
} catch {
|
|
10081
|
+
return false;
|
|
10082
|
+
}
|
|
10083
|
+
const fact = sessionFactsSchema.safeParse(detail);
|
|
10084
|
+
return fact.success && (fact.data.queuedRings ?? []).some((queued) => queued.notification === notificationId && queued.ring <= rings);
|
|
10085
|
+
}
|
|
10086
|
+
/** Count one confirmed Spur send, regardless of transport attempts for its outbox row. */
|
|
10087
|
+
async function recordRingDelivery(trx, notificationId, ring, session, at, config) {
|
|
10088
|
+
const n = await trx.selectFrom("notification").selectAll().where("id", "=", notificationId).executeTakeFirst();
|
|
10089
|
+
if (n === void 0 || n.acked_at !== null && n.kind !== "turn_reminder" || n.recipient_session !== session || n.rings >= ring) return;
|
|
10090
|
+
const pauses = ringPauses(config);
|
|
10061
10091
|
await trx.updateTable("notification").set({
|
|
10062
10092
|
rings: ring,
|
|
10063
10093
|
next_at: new Date(at.getTime() + (pauses[ring - 1] ?? 0)).toISOString(),
|
|
@@ -10069,6 +10099,11 @@ async function recordRingDelivery(trx, notificationId, ring, session, at, config
|
|
|
10069
10099
|
attempt: ring
|
|
10070
10100
|
}, at);
|
|
10071
10101
|
}
|
|
10102
|
+
/** True while the Spur source is blind: its stored session facts may no longer hold. */
|
|
10103
|
+
async function spurBlind$1(trx) {
|
|
10104
|
+
const state = await trx.selectFrom("source_state").select("blind_reason").where("source", "=", "spur").executeTakeFirst();
|
|
10105
|
+
return state !== void 0 && state.blind_reason !== null;
|
|
10106
|
+
}
|
|
10072
10107
|
/** Confirm that a queued ring still belongs to a live, idle, unread recipient. */
|
|
10073
10108
|
async function ringStillCurrent(trx, notificationId, sessionId, config) {
|
|
10074
10109
|
const n = await trx.selectFrom("notification").selectAll().where("id", "=", notificationId).executeTakeFirst();
|
|
@@ -18107,8 +18142,18 @@ const sessionWire = z.object({
|
|
|
18107
18142
|
slots: z.object({ links: z.array(z.object({
|
|
18108
18143
|
label: z.string().min(1),
|
|
18109
18144
|
url: z.url()
|
|
18110
|
-
})).optional() }).optional()
|
|
18145
|
+
})).optional() }).optional(),
|
|
18146
|
+
queuedMessages: z.object({ messages: z.array(z.string()) }).optional()
|
|
18111
18147
|
});
|
|
18148
|
+
/** The board rings a session's queue still holds, sorted and deduped; other queued text is dropped. */
|
|
18149
|
+
function queuedBoardRings(wire) {
|
|
18150
|
+
const rings = /* @__PURE__ */ new Map();
|
|
18151
|
+
for (const message of wire.queuedMessages?.messages ?? []) {
|
|
18152
|
+
const parsed = parseRingMarker(message);
|
|
18153
|
+
if (parsed) rings.set(`${String(parsed.notification)}-${String(parsed.ring)}`, parsed);
|
|
18154
|
+
}
|
|
18155
|
+
return [...rings.values()].sort((a, b) => a.notification - b.notification || a.ring - b.ring);
|
|
18156
|
+
}
|
|
18112
18157
|
/** A single Spur source. State is scoped to this adapter instance, never shared across daemons. */
|
|
18113
18158
|
function createSpurAdapter(options) {
|
|
18114
18159
|
const base = new URL(`${options.baseUrl.replace(/\/$/, "")}/`);
|
|
@@ -18196,6 +18241,7 @@ function createSpurAdapter(options) {
|
|
|
18196
18241
|
if (parsed.success) pr = parsed.data;
|
|
18197
18242
|
}
|
|
18198
18243
|
}
|
|
18244
|
+
const queuedRings = queuedBoardRings(wire);
|
|
18199
18245
|
return sessionFactsSchema.parse({
|
|
18200
18246
|
id: wire.id,
|
|
18201
18247
|
spurProject: wire.project,
|
|
@@ -18207,7 +18253,8 @@ function createSpurAdapter(options) {
|
|
|
18207
18253
|
healthSince: state.since,
|
|
18208
18254
|
lastActivityAt: wire.lastActivityAt ?? null,
|
|
18209
18255
|
endedAt: endReason === null ? null : observedAt,
|
|
18210
|
-
endReason
|
|
18256
|
+
endReason,
|
|
18257
|
+
...queuedRings.length > 0 ? { queuedRings } : {}
|
|
18211
18258
|
});
|
|
18212
18259
|
}
|
|
18213
18260
|
return {
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
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-DlZuREcB.mjs";
|
|
2
|
+
import { a as CliError, r as requestOperation } from "./client-CJwU6M5L.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./config-Gl2ISKcx.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -174,7 +174,7 @@ function plainHttpAllowed(url) {
|
|
|
174
174
|
return host === "localhost" || host === "[::1]" || LOOPBACK_IPV4.test(host);
|
|
175
175
|
}
|
|
176
176
|
const jiraTracker = z.strictObject({
|
|
177
|
-
type: z.literal("jira"),
|
|
177
|
+
type: z.literal("jira").describe("jira: tasks come from the Jira issues jql returns, read with JIRA_EMAIL and JIRA_API_TOKEN from secrets.env."),
|
|
178
178
|
baseUrl: z.url({ protocol: /^https?$/ }).refine((value) => {
|
|
179
179
|
try {
|
|
180
180
|
return plainHttpAllowed(new URL(value));
|
|
@@ -182,10 +182,10 @@ const jiraTracker = z.strictObject({
|
|
|
182
182
|
return true;
|
|
183
183
|
}
|
|
184
184
|
}, { error: "Use https: for the Jira URL; http: is allowed only on a loopback host (localhost, 127.0.0.0/8, ::1) because it receives your Jira credentials" }).describe("Jira site URL. https:, or http: only on a loopback host."),
|
|
185
|
-
jql: nonEmpty,
|
|
186
|
-
doneStatuses: z.array(nonEmpty).min(1),
|
|
187
|
-
readyStatuses: z.array(nonEmpty).min(1),
|
|
188
|
-
projectKeys: z.array(z.string().regex(/^[A-Z][A-Z0-9_]*$/, "Expected a Jira project key like PROJ")).default([])
|
|
185
|
+
jql: nonEmpty.describe("Jira search whose issues become tasks in To Do. A task whose issue leaves the result is flagged out of filter while it has an open PR or a live session, and is archived otherwise, once Spur, the tracker and every repo have a complete poll since its last change and none of them is blind; a task added or removed by hand is left alone."),
|
|
186
|
+
doneStatuses: z.array(nonEmpty.describe("A Jira status name, spelled exactly as in Jira.")).min(1).describe("Jira statuses that mean done. A task whose issue is in one of them and that has no open PR is archived on the next archive.doneWeekday, once every repo has a complete poll since its last change. Each name must exist in every projectKeys project, or the Jira poll fails with a config error."),
|
|
187
|
+
readyStatuses: z.array(nonEmpty.describe("A Jira status name, spelled exactly as in Jira.")).min(1).describe("Jira statuses that mean ready for development. The board checks only that each name exists in every projectKeys project; the Jira poll fails with a config error otherwise."),
|
|
188
|
+
projectKeys: z.array(z.string().regex(/^[A-Z][A-Z0-9_]*$/, "Expected a Jira project key like PROJ").describe("A Jira project key in capitals, such as PROJ.")).default([]).describe("Keys of this board project's Jira projects, such as PROJ. A PR names its task by one of these keys, and doneStatuses and readyStatuses are checked in each of these projects. A task key such as PROJ-12 belongs to the one board project whose list holds its prefix; an empty list takes every Jira key, and a key that several projects take belongs to none. The Jira poll fails with a config error while the list is empty.")
|
|
189
189
|
});
|
|
190
190
|
/** Capture groups of a pattern that compiles without flags, or `undefined` when it does not. */
|
|
191
191
|
function captureGroups(pattern) {
|
|
@@ -221,8 +221,8 @@ function linkPattern(fallback, description) {
|
|
|
221
221
|
}).default(fallback).describe(description);
|
|
222
222
|
}
|
|
223
223
|
const githubIssuesTracker = z.strictObject({
|
|
224
|
-
type: z.literal("github-issues"),
|
|
225
|
-
repo: repoSlugSchema,
|
|
224
|
+
type: z.literal("github-issues").describe("github-issues: tasks come from the open issues of tracker.repo, narrowed by label or milestone when set, read with GITHUB_TOKEN."),
|
|
225
|
+
repo: repoSlugSchema.describe("Repository as owner/name whose open issues become tasks. PRs link to its issues only in this repository, so list it in repos too."),
|
|
226
226
|
label: nonEmpty.describe("Only open issues with this label become tasks. Set at most one of label and milestone; with neither, every open issue of tracker.repo becomes a task.").optional(),
|
|
227
227
|
milestone: nonEmpty.describe("Only open issues in the milestone with this title become tasks. Set at most one of label and milestone; with neither, every open issue of tracker.repo becomes a task.").optional()
|
|
228
228
|
}).superRefine((tracker, ctx) => {
|
|
@@ -242,9 +242,9 @@ const spurProject = z.strictObject({
|
|
|
242
242
|
});
|
|
243
243
|
const DEFAULT_CYCLE_LIMIT = 10;
|
|
244
244
|
const columnConfig = z.strictObject({
|
|
245
|
-
id: z.enum(COLUMN_IDS, { error: (issue) => typeof issue.input === "string" ? `Unknown column ${JSON.stringify(issue.input)}: custom columns arrive with custom matchers and are not supported yet. Built-in columns: ${COLUMN_IDS.join(", ")}` : void 0 }),
|
|
246
|
-
enabled: z.boolean().default(true),
|
|
247
|
-
orchestrator: nonEmpty.default("none"),
|
|
245
|
+
id: z.enum(COLUMN_IDS, { error: (issue) => typeof issue.input === "string" ? `Unknown column ${JSON.stringify(issue.input)}: custom columns arrive with custom matchers and are not supported yet. Built-in columns: ${COLUMN_IDS.join(", ")}` : void 0 }).describe("The built-in column this entry configures."),
|
|
246
|
+
enabled: z.boolean().default(true).describe("false skips the column: tasks move past it and its exit condition is not checked. todo, dev and done cannot be disabled."),
|
|
247
|
+
orchestrator: nonEmpty.default("none").describe("Who takes the column's turns. none: the task's live worker session, else the operator. operator: the operator, who also gets the questions asked in the column. Otherwise the name of a spurProjects entry whose sessions orchestrate the column and get the questions others ask in it."),
|
|
248
248
|
cycleLimit: z.int().min(1).default(DEFAULT_CYCLE_LIMIT).describe("How many times a task may return to Dev from this column before the board stops it for the operator. Returns by the column executor, changes requested and external comments count; a conflict, red CI and a draft do not.")
|
|
249
249
|
});
|
|
250
250
|
/** The board rules: required columns present and enabled, built-ins in canonical order. */
|
|
@@ -278,12 +278,12 @@ const projectSchema = z.strictObject({
|
|
|
278
278
|
id: z.string().refine((id) => id !== RESERVED_PROJECT, {
|
|
279
279
|
message: `"${RESERVED_PROJECT}" is reserved for board-wide journal events; choose another project id`,
|
|
280
280
|
abort: true
|
|
281
|
-
}).regex(/^[a-z][a-z0-9-]*$/, "Expected lowercase letters, digits and dashes"),
|
|
281
|
+
}).regex(/^[a-z][a-z0-9-]*$/, "Expected lowercase letters, digits and dashes").describe("Board project id: lowercase letters, digits and dashes, unique, not _board. It names the project on its tasks, in the journal and in its source ids such as jira:<id> and github:<id>:<repo>."),
|
|
282
282
|
tracker: z.discriminatedUnion("type", [jiraTracker, githubIssuesTracker]),
|
|
283
|
-
repos: z.array(repoSlugSchema).min(1),
|
|
284
|
-
reposWithoutCi: z.array(repoSlugSchema).default([]).describe("Repos from repos that run no CI checks, in any letter case. In a listed repo, a PR whose check list on head is empty passes the Dev gate check condition instead of waiting in Dev. A list of only skipped checks still waits, and red or pending checks still count. A listed repo whose branch protection requires checks that have not reported yet also passes, so list only repos that run no checks. Without this key, a PR with no checks waits in Dev."),
|
|
283
|
+
repos: z.array(repoSlugSchema.describe("A repository as owner/name.")).min(1).describe("GitHub repositories as owner/name whose PRs the board polls for this project, one source each. A done task is archived only after every listed repository has a complete poll since its last change."),
|
|
284
|
+
reposWithoutCi: z.array(repoSlugSchema.describe("A repository from repos as owner/name, in any letter case.")).default([]).describe("Repos from repos that run no CI checks, in any letter case. In a listed repo, a PR whose check list on head is empty passes the Dev gate check condition instead of waiting in Dev. A list of only skipped checks still waits, and red or pending checks still count. A listed repo whose branch protection requires checks that have not reported yet also passes, so list only repos that run no checks. Without this key, a PR with no checks waits in Dev."),
|
|
285
285
|
link: z.strictObject({
|
|
286
|
-
sources: z.array(z.enum(LINK_SOURCES)).min(1).superRefine((sources, ctx) => {
|
|
286
|
+
sources: z.array(z.enum(LINK_SOURCES).describe("One place a PR can name its task: closing, branch or title.")).min(1).superRefine((sources, ctx) => {
|
|
287
287
|
sources.forEach((source, i) => {
|
|
288
288
|
if (sources.indexOf(source) !== i) ctx.addIssue({
|
|
289
289
|
code: "custom",
|
|
@@ -308,13 +308,13 @@ const projectSchema = z.strictObject({
|
|
|
308
308
|
});
|
|
309
309
|
curator ??= item.name;
|
|
310
310
|
});
|
|
311
|
-
}).default([]),
|
|
311
|
+
}).default([]).describe("Spur projects whose sessions work on this board project, each with a role; at most one curator. Board commands from a session whose Spur project is in no spurProjects list are refused."),
|
|
312
312
|
columns: z.array(columnConfig).superRefine(checkBoard).default(() => COLUMN_IDS.map((id) => ({
|
|
313
313
|
id,
|
|
314
314
|
enabled: true,
|
|
315
315
|
orchestrator: "none",
|
|
316
316
|
cycleLimit: DEFAULT_CYCLE_LIMIT
|
|
317
|
-
}))),
|
|
317
|
+
}))).describe("The project's board columns in canonical order. todo, dev and done must be present and enabled. A column left out or disabled is skipped. Without this key, all nine columns are enabled with orchestrator none."),
|
|
318
318
|
dispatcher: z.strictObject({ mode: z.enum(DISPATCHER_MODES).default("shadow").describe("shadow: the board evaluates the column gates and records where each task would go in its shadow column, and opens no turn, doorbell or block; the column executor submits with the task key. on: the board moves the task between columns, hands the column executor a turn and raises the cycle-limit block.") }).prefault({}).describe("How the board moves tasks between columns. The board records the mode it last ran with. The daemon reads the mode at start, so a change takes effect after a restart; a switch from shadow to on copies the shadow column of each task into its column, and a switch back to shadow closes the open turns and starts the shadow column from the column again.")
|
|
319
319
|
}).superRefine((project, ctx) => {
|
|
320
320
|
const repos = new Set(project.repos.map((repo) => repo.toLowerCase()));
|
|
@@ -390,24 +390,24 @@ const configSchema = z.strictObject({
|
|
|
390
390
|
projects: z.array(projectSchema).min(1).superRefine((items, ctx) => {
|
|
391
391
|
rejectDuplicates(items, "id", "project id", ctx);
|
|
392
392
|
rejectSharedSpurProjects(items, ctx);
|
|
393
|
-
}),
|
|
394
|
-
operator: z.strictObject({ slack: nonEmpty }),
|
|
393
|
+
}).describe("Board projects, at least one. Each reads tasks from one tracker and PRs from its repos. A Spur project can be listed under only one board project."),
|
|
394
|
+
operator: z.strictObject({ slack: nonEmpty.describe("Slack user ID of the operator, such as U0123456789. Slack commands, button presses and messages from anyone else are denied. A feed line the operator resolves names this user.") }),
|
|
395
395
|
slack: z.strictObject({
|
|
396
|
-
appName: z.string().trim().min(1).default(DEFAULT_SLACK_APP_NAME),
|
|
397
|
-
command: z.string().regex(/^\/[a-z0-9_-]+$/, "Expected a slash command such as /board").default(DEFAULT_SLACK_COMMAND),
|
|
398
|
-
appId: z.string().regex(/^A[A-Z0-9]+$/, "Expected a Slack app ID").optional(),
|
|
396
|
+
appName: z.string().trim().min(1).default(DEFAULT_SLACK_APP_NAME).describe("Slack app and bot display name that board slack manifest writes when --app-name is not given."),
|
|
397
|
+
command: z.string().regex(/^\/[a-z0-9_-]+$/, "Expected a slash command such as /board").default(DEFAULT_SLACK_COMMAND).describe("Slash command with its leading slash. The board acts only on this command, and board slack manifest writes it when --command is not given. When slack.channels is set and SLACK_APP_CONFIG_TOKEN and slack.appId are present, board doctor compares it with the installed app."),
|
|
398
|
+
appId: z.string().regex(/^A[A-Z0-9]+$/, "Expected a Slack app ID").optional().describe("Slack app ID, such as A0123456789. When slack.channels is set and SLACK_APP_CONFIG_TOKEN is present, board doctor reads this app's manifest to check the installed slash command against slack.command."),
|
|
399
399
|
channels: z.strictObject({
|
|
400
|
-
orchestrators: nonEmpty.optional(),
|
|
401
|
-
feed: nonEmpty.optional()
|
|
400
|
+
orchestrators: nonEmpty.optional().describe("Slack channel ID, such as C0123456789, where the board opens a thread for each block addressed to the operator by someone else. Once either channel is set, the daemon does not start without the other channel and SLACK_BOT_TOKEN, and without SLACK_APP_TOKEN it reads nothing from Slack."),
|
|
401
|
+
feed: nonEmpty.optional().describe("Slack channel ID where the board posts a line for each curator answer, each newly installed version and each operator item, with the buttons the operator presses. Operator items about failed Slack posts, transport health, undelivered answers and ended workers, and those shown as operator blocks, get no feed line. A line whose item clears before it is first sent, such as an expired token request, is dropped. Set it together with orchestrators.")
|
|
402
402
|
}).prefault({})
|
|
403
403
|
}).prefault({}),
|
|
404
404
|
thresholds: z.strictObject({
|
|
405
|
-
staleMultiplier: z.number().min(1).default(3),
|
|
405
|
+
staleMultiplier: z.number().min(1).default(3).describe("A source with no complete poll for this many of its poll intervals turns blind stale. board status marks that source, and an operator item whose fact is older than that, as stale."),
|
|
406
406
|
blockOpenMs: durationMs(864e5, "How long a block may stay open before an item is raised")
|
|
407
407
|
}).prefault({}),
|
|
408
|
-
archive: z.strictObject({ doneWeekday: z.enum(WEEKDAYS).default("saturday") }).prefault({}),
|
|
409
|
-
digest: z.strictObject({ tz: z.string().refine(isTimeZone, "Unknown IANA time zone") }),
|
|
410
|
-
commands: z.strictObject({ retentionDays: z.int().min(1).default(7) }).prefault({}),
|
|
408
|
+
archive: z.strictObject({ doneWeekday: z.enum(WEEKDAYS).default("saturday").describe("Weekday whose local midnight, in digest.tz, is the weekly archive slot: tasks done before it are archived then, once their repos have a complete poll since their last change. A slot missed while the daemon was down is applied on the next tick.") }).prefault({}),
|
|
409
|
+
digest: z.strictObject({ tz: z.string().refine(isTimeZone, "Unknown IANA time zone").describe("IANA time zone, such as Europe/Berlin, for the archive.doneWeekday slot and the times shown in resolved feed lines.") }),
|
|
410
|
+
commands: z.strictObject({ retentionDays: z.int().min(1).default(7).describe("Days the board keeps each caller's mutation --key with its input and result. In that time the same caller and key with the same input returns the stored result, and with a different input the call is refused. A daily job deletes older keys.") }).prefault({}),
|
|
411
411
|
doorbells: z.strictObject({
|
|
412
412
|
firstRetryMs: durationMs(12e4, "Wait after the first unanswered doorbell"),
|
|
413
413
|
secondRetryMs: durationMs(3e5, "Wait after the second unanswered doorbell"),
|
|
@@ -1106,6 +1106,24 @@ const unknownSessionHealthSchema = z.string().min(1).brand();
|
|
|
1106
1106
|
const unknownSessionStatusSchema = z.string().min(1).brand();
|
|
1107
1107
|
const knownHealth = z.enum(SESSION_HEALTH_STATES);
|
|
1108
1108
|
const knownStatus = z.enum(SESSION_STATUSES);
|
|
1109
|
+
const queuedRingSchema = z.strictObject({
|
|
1110
|
+
notification: z.int().positive().describe("Board notification the queued ring belongs to."),
|
|
1111
|
+
ring: z.int().positive().describe("Ring number within that notification series.")
|
|
1112
|
+
}).describe("One board ring waiting in the session queue.");
|
|
1113
|
+
/** The marker that ends a board ring text: `(N<notification>-<ring>)`. */
|
|
1114
|
+
function ringMarker(notification, ring) {
|
|
1115
|
+
return `(N${String(notification)}-${String(ring)})`;
|
|
1116
|
+
}
|
|
1117
|
+
/** The notification and ring a text ends with, or null when it ends with no valid marker. */
|
|
1118
|
+
function parseRingMarker(text) {
|
|
1119
|
+
const match = /\(N([1-9]\d*)-([1-9]\d*)\)$/.exec(text);
|
|
1120
|
+
if (!match) return null;
|
|
1121
|
+
const parsed = queuedRingSchema.safeParse({
|
|
1122
|
+
notification: Number(match[1]),
|
|
1123
|
+
ring: Number(match[2])
|
|
1124
|
+
});
|
|
1125
|
+
return parsed.success ? parsed.data : null;
|
|
1126
|
+
}
|
|
1109
1127
|
const sessionFactsSchema = z.strictObject({
|
|
1110
1128
|
id: actorPartSchema.describe("Spur session name."),
|
|
1111
1129
|
spurProject: actorPartSchema.describe("Spur project the session belongs to."),
|
|
@@ -1117,7 +1135,8 @@ const sessionFactsSchema = z.strictObject({
|
|
|
1117
1135
|
healthSince: at$2.describe("When the current health value began to hold, as the adapter observed it; health durations count from here."),
|
|
1118
1136
|
lastActivityAt: at$2.nullable().describe("When the session last showed activity, or null."),
|
|
1119
1137
|
endedAt: at$2.nullable().describe("When the session ended, or null while it is live. The adapter supplies it: Spur keeps no end time."),
|
|
1120
|
-
endReason: z.enum(SESSION_END_REASONS).nullable().describe("Why the session ended, or null while it is live. Set together with endedAt.")
|
|
1138
|
+
endReason: z.enum(SESSION_END_REASONS).nullable().describe("Why the session ended, or null while it is live. Set together with endedAt."),
|
|
1139
|
+
queuedRings: z.array(queuedRingSchema).min(1).optional().describe("Board rings still waiting in the session queue, undelivered. Only board rings are listed, never other queued text; absent when none.")
|
|
1121
1140
|
}).superRefine((session, ctx) => {
|
|
1122
1141
|
if (session.endedAt === null !== (session.endReason === null)) ctx.addIssue({
|
|
1123
1142
|
code: "custom",
|
|
@@ -3290,4 +3309,4 @@ function assertNever(value) {
|
|
|
3290
3309
|
throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
|
|
3291
3310
|
}
|
|
3292
3311
|
//#endregion
|
|
3293
|
-
export {
|
|
3312
|
+
export { COLUMN_IDS as $, ringMarker as A, err as B, REVIEW_STATES as C, parseRingMarker as D, isExternalAuthor as E, errorCodeOf as F, DEFAULT_HTTP_PORT as G, errorEnvelopeSchema as H, parseActorId as I, DEFAULT_SLACK_COMMAND as J, DEFAULT_LINK as K, parseRef as L, ticketFactsSchema as M, actorIdSchema as N, prFactsSchema as O, encodeActorId as P, requiredSecretKeys as Q, taskKeySchema as R, eventPayloadSchemas as S, SESSION_STATUSES as T, ok as U, errorContextSchema as V, successEnvelopeSchema as W, configSchema as X, RESERVED_PROJECT as Y, plainHttpAllowed as Z, inboundEventSchema as _, batchSchema as a, userIdSchema as b, buildCatalogSnapshot as c, turnHandedSchema as d, DISPATCHER_MODES as et, renderHttpProblem as f, conversationRefSchema as g, SPACE_IDS as h, AdapterError as i, sessionFactsSchema as j, prRefSchema as k, roleCanUseOperation as l, renderMcpError as m, BOARD_TICK_MS as n, entityRefSchema as o, renderJsonError as p, DEFAULT_SLACK_APP_NAME as q, SYSTEMD_SERVICE_SETTINGS as r, sourceCursorSchema as s, assertNever as t, SLACK_BOT_SCOPES as tt, OPERATIONS as u, interactionRefSchema as v, SESSION_HEALTH_STATES as w, EVENT_KINDS as x, messageRefSchema as y, ERRORS as z };
|