spur-board 0.149.0 → 0.150.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.
@@ -2407,12 +2407,18 @@ const prChange = {
2407
2407
  from,
2408
2408
  to: S
2409
2409
  };
2410
+ const checkRuns = z.array(prFactsSchema.shape.checks.element.pick({
2411
+ name: true,
2412
+ completedAt: true
2413
+ })).optional();
2410
2414
  const eventPayloadSchemas = {
2411
2415
  head_moved: z.looseObject(prChange),
2412
2416
  pr_facts_changed: z.looseObject({ facts: prFactsSchema }),
2413
2417
  checks_changed: z.looseObject({
2414
2418
  ...prChange,
2415
- sha: S
2419
+ sha: S,
2420
+ waiting: checkRuns,
2421
+ confirmed: checkRuns
2416
2422
  }),
2417
2423
  review_submitted: z.looseObject({
2418
2424
  repo: S,
@@ -4842,9 +4848,9 @@ const OPERATIONS = [
4842
4848
  id: "item.close",
4843
4849
  web: true,
4844
4850
  kind: "mutation",
4845
- description: "Close a \"from you\" item without acting on it.",
4851
+ description: "Close a \"from you\" item without retrying; some block items close their block.",
4846
4852
  mcp: {
4847
- whenToUse: "Dismiss an item without retrying.",
4853
+ whenToUse: "Dismiss an item without retrying. An anomaly, cycle_limit or course_check item also closes its block; an operator-block: item closes its block when you may unblock it.",
4848
4854
  whenNotToUse: "Use item_retry to try again."
4849
4855
  },
4850
4856
  input: itemInputSchema,
@@ -5982,4 +5988,4 @@ const remoteDoctorReportSchema = z.object({
5982
5988
  function assertNever(value) {
5983
5989
  throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
5984
5990
  }
5985
- export { ringMarker as $, eventPayloadSchemas as A, requiredSecretKeys as At, sourceCursorSchema as B, VIAS as Bt, messageRefSchema as C, columnTurnTimings as Ct, sortSkillFiles as D, externalQuietAfterMs as Dt, skillReloadFilesSchema as E, defaultAddressee as Et, defaultBranchFactSchema as F, DISPATCHER_MODES as Ft, SESSION_HEALTH_STATES as G, PR_STATES as H, entityRefSchema as I, ITEM_KINDS as It, parseRingMarker as J, SESSION_STATUSES as K, mirrorSourceId as L, SLACK_BOT_SCOPES as Lt, MIRROR_FAILURES as M, COLUMNS as Mt, MIRROR_FAILURE_CODES as N, COLUMN_GROUPS as Nt, EVENT_KINDS as O, plainHttpAllowed as Ot, batchSchema as P, COLUMN_IDS as Pt, prReviewRuleSchema as Q, prSourceId as R, TASK_HOLDS as Rt, interactionRefSchema as S, boardWideSpurProject as St, skillReloadFileSchema as T, configSchema as Tt, REVIEW_DECISIONS as U, trackerSourceId as V, isTodoGroupColumn as Vt, REVIEW_STATES as W, prFactsSchema as X, prApprovalPairSchema as Y, prRefSchema as Z, renderJsonError as _, DEFAULT_SLACK_APP_NAME as _t, requestHashOf as a, encodeActorId as at, conversationRefSchema as b, RESERVED_PROJECT as bt, tokenRequestStatusSchema as c, parseRef as ct, buildCatalogSnapshot as d, errorContextSchema as dt, sessionFactsSchema as et, roleCanUseOperation as f, errorEnvelopeSchema as ft, renderHttpProblem as g, DEFAULT_LINK as gt, turnHandedSchema as h, DEFAULT_HTTP_PORT as ht, TOKEN_REQUEST_LIMITS as i, actorIdSchema as it, AdapterError as j, resolveWebOrigin as jt, GATE_REASONS as k, readyMirrorOf as kt, BOARD_TICK_MS as l, ERRORS as lt, defaultBranchViewSchema as m, successEnvelopeSchema as mt, doctorReportSchema as n, JIRA_PROJECT_KEY as nt, tokenRequestResultSchema as o, errorCodeOf as ot, OPERATIONS as p, ok as pt, isExternalAuthor as q, remoteDoctorReportSchema as r, REF_NUMBER as rt, tokenRequestSchema as s, parseActorId as st, assertNever as t, ticketFactsSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, err as ut, renderMcpError as v, DEFAULT_SLACK_COMMAND as vt, userIdSchema as w, configBindings as wt, inboundEventSchema as x, approvalRuleOf as xt, SPACE_IDS as y, DEFAULT_STAND_PORT_RANGE as yt, sessionTransitionSchema as z, TODO_GROUP_COLUMN_IDS as zt };
5991
+ export { ringMarker as $, eventPayloadSchemas as A, requiredSecretKeys as At, sourceCursorSchema as B, TODO_GROUP_COLUMN_IDS as Bt, messageRefSchema as C, columnTurnTimings as Ct, sortSkillFiles as D, externalQuietAfterMs as Dt, skillReloadFilesSchema as E, defaultAddressee as Et, defaultBranchFactSchema as F, COLUMN_IDS as Ft, SESSION_HEALTH_STATES as G, PR_STATES as H, isTodoGroupColumn as Ht, entityRefSchema as I, DISPATCHER_MODES as It, parseRingMarker as J, SESSION_STATUSES as K, mirrorSourceId as L, ITEM_KINDS as Lt, MIRROR_FAILURES as M, BLOCK_TYPES as Mt, MIRROR_FAILURE_CODES as N, COLUMNS as Nt, EVENT_KINDS as O, plainHttpAllowed as Ot, batchSchema as P, COLUMN_GROUPS as Pt, prReviewRuleSchema as Q, prSourceId as R, SLACK_BOT_SCOPES as Rt, interactionRefSchema as S, boardWideSpurProject as St, skillReloadFileSchema as T, configSchema as Tt, REVIEW_DECISIONS as U, trackerSourceId as V, VIAS as Vt, REVIEW_STATES as W, prFactsSchema as X, prApprovalPairSchema as Y, prRefSchema as Z, renderJsonError as _, DEFAULT_SLACK_APP_NAME as _t, requestHashOf as a, encodeActorId as at, conversationRefSchema as b, RESERVED_PROJECT as bt, tokenRequestStatusSchema as c, parseRef as ct, buildCatalogSnapshot as d, errorContextSchema as dt, sessionFactsSchema as et, roleCanUseOperation as f, errorEnvelopeSchema as ft, renderHttpProblem as g, DEFAULT_LINK as gt, turnHandedSchema as h, DEFAULT_HTTP_PORT as ht, TOKEN_REQUEST_LIMITS as i, actorIdSchema as it, AdapterError as j, resolveWebOrigin as jt, GATE_REASONS as k, readyMirrorOf as kt, BOARD_TICK_MS as l, ERRORS as lt, defaultBranchViewSchema as m, successEnvelopeSchema as mt, doctorReportSchema as n, JIRA_PROJECT_KEY as nt, tokenRequestResultSchema as o, errorCodeOf as ot, OPERATIONS as p, ok as pt, isExternalAuthor as q, remoteDoctorReportSchema as r, REF_NUMBER as rt, tokenRequestSchema as s, parseActorId as st, assertNever as t, ticketFactsSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, err as ut, renderMcpError as v, DEFAULT_SLACK_COMMAND as vt, userIdSchema as w, configBindings as wt, inboundEventSchema as x, approvalRuleOf as xt, SPACE_IDS as y, DEFAULT_STAND_PORT_RANGE as yt, sessionTransitionSchema as z, TASK_HOLDS as zt };
@@ -1,4 +1,4 @@
1
- import { _ as renderJsonError, c as tokenRequestStatusSchema, dt as errorContextSchema, ft as errorEnvelopeSchema, lt as ERRORS, mt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-B49czSp7.mjs";
1
+ import { _ as renderJsonError, c as tokenRequestStatusSchema, dt as errorContextSchema, ft as errorEnvelopeSchema, lt as ERRORS, mt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-6hZvXPE0.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -1,5 +1,5 @@
1
- import { Ot as plainHttpAllowed, Tt as configSchema, d as buildCatalogSnapshot, p as OPERATIONS } from "./chunk-B49czSp7.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-BqpntwKX.mjs";
1
+ import { Ot as plainHttpAllowed, Tt as configSchema, d as buildCatalogSnapshot, p as OPERATIONS } from "./chunk-6hZvXPE0.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-D8IOOBWp.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/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { At as requiredSecretKeys, D as sortSkillFiles, Lt as SLACK_BOT_SCOPES, T as skillReloadFileSchema, Tt as configSchema, a as requestHashOf, f as roleCanUseOperation, it as actorIdSchema, jt as resolveWebOrigin, lt as ERRORS, mt as successEnvelopeSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as DEFAULT_STAND_PORT_RANGE } from "./chunk-B49czSp7.mjs";
1
+ import { At as requiredSecretKeys, D as sortSkillFiles, Rt as SLACK_BOT_SCOPES, T as skillReloadFileSchema, Tt as configSchema, a as requestHashOf, f as roleCanUseOperation, it as actorIdSchema, jt as resolveWebOrigin, lt as ERRORS, mt as successEnvelopeSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as DEFAULT_STAND_PORT_RANGE } from "./chunk-6hZvXPE0.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
- import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-BqpntwKX.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-CwyzJDIl.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-D8IOOBWp.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-DM0fcX7h.mjs";
5
5
  import { createHash, randomBytes, randomUUID } from "node:crypto";
6
6
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
7
7
  import { homedir, hostname, tmpdir, userInfo } from "node:os";
package/dist/client.mjs CHANGED
@@ -1 +1 @@
1
- export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-BqpntwKX.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-D8IOOBWp.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ringMarker, A as eventPayloadSchemas, At as requiredSecretKeys, B as sourceCursorSchema, Bt as VIAS, C as messageRefSchema, Ct as columnTurnTimings, D as sortSkillFiles, Dt as externalQuietAfterMs, E as skillReloadFilesSchema, Et as defaultAddressee, F as defaultBranchFactSchema, Ft as DISPATCHER_MODES, G as SESSION_HEALTH_STATES, H as PR_STATES, I as entityRefSchema, It as ITEM_KINDS, J as parseRingMarker, K as SESSION_STATUSES, L as mirrorSourceId, Lt as SLACK_BOT_SCOPES, M as MIRROR_FAILURES, Mt as COLUMNS, N as MIRROR_FAILURE_CODES, Nt as COLUMN_GROUPS, O as EVENT_KINDS, Ot as plainHttpAllowed, P as batchSchema, Pt as COLUMN_IDS, Q as prReviewRuleSchema, R as prSourceId, Rt as TASK_HOLDS, S as interactionRefSchema, St as boardWideSpurProject, Tt as configSchema, U as REVIEW_DECISIONS, V as trackerSourceId, Vt as isTodoGroupColumn, W as REVIEW_STATES, X as prFactsSchema, Y as prApprovalPairSchema, Z as prRefSchema, a as requestHashOf, at as encodeActorId, b as conversationRefSchema, bt as RESERVED_PROJECT, c as tokenRequestStatusSchema, ct as parseRef$1, d as buildCatalogSnapshot, et as sessionFactsSchema, f as roleCanUseOperation, g as renderHttpProblem, gt as DEFAULT_LINK, h as turnHandedSchema, i as TOKEN_REQUEST_LIMITS, it as actorIdSchema, j as AdapterError, jt as resolveWebOrigin, k as GATE_REASONS, kt as readyMirrorOf, l as BOARD_TICK_MS, lt as ERRORS, m as defaultBranchViewSchema, mt as successEnvelopeSchema, n as doctorReportSchema, nt as JIRA_PROJECT_KEY, o as tokenRequestResultSchema, ot as errorCodeOf, p as OPERATIONS, pt as ok, q as isExternalAuthor, rt as REF_NUMBER, s as tokenRequestSchema, st as parseActorId, t as assertNever, tt as ticketFactsSchema, ut as err, vt as DEFAULT_SLACK_COMMAND, w as userIdSchema, wt as configBindings, x as inboundEventSchema, xt as approvalRuleOf, y as SPACE_IDS, z as sessionTransitionSchema, zt as TODO_GROUP_COLUMN_IDS } from "./chunk-B49czSp7.mjs";
1
+ import { $ as ringMarker, A as eventPayloadSchemas, At as requiredSecretKeys, B as sourceCursorSchema, Bt as TODO_GROUP_COLUMN_IDS, C as messageRefSchema, Ct as columnTurnTimings, D as sortSkillFiles, Dt as externalQuietAfterMs, E as skillReloadFilesSchema, Et as defaultAddressee, F as defaultBranchFactSchema, Ft as COLUMN_IDS, G as SESSION_HEALTH_STATES, H as PR_STATES, Ht as isTodoGroupColumn, I as entityRefSchema, It as DISPATCHER_MODES, J as parseRingMarker, K as SESSION_STATUSES, L as mirrorSourceId, Lt as ITEM_KINDS, M as MIRROR_FAILURES, Mt as BLOCK_TYPES, N as MIRROR_FAILURE_CODES, Nt as COLUMNS, O as EVENT_KINDS, Ot as plainHttpAllowed, P as batchSchema, Pt as COLUMN_GROUPS, Q as prReviewRuleSchema, R as prSourceId, Rt as SLACK_BOT_SCOPES, S as interactionRefSchema, St as boardWideSpurProject, Tt as configSchema, U as REVIEW_DECISIONS, V as trackerSourceId, Vt as VIAS, W as REVIEW_STATES, X as prFactsSchema, Y as prApprovalPairSchema, Z as prRefSchema, a as requestHashOf, at as encodeActorId, b as conversationRefSchema, bt as RESERVED_PROJECT, c as tokenRequestStatusSchema, ct as parseRef$1, d as buildCatalogSnapshot, et as sessionFactsSchema, f as roleCanUseOperation, g as renderHttpProblem, gt as DEFAULT_LINK, h as turnHandedSchema, i as TOKEN_REQUEST_LIMITS, it as actorIdSchema, j as AdapterError, jt as resolveWebOrigin, k as GATE_REASONS, kt as readyMirrorOf, l as BOARD_TICK_MS, lt as ERRORS, m as defaultBranchViewSchema, mt as successEnvelopeSchema, n as doctorReportSchema, nt as JIRA_PROJECT_KEY, o as tokenRequestResultSchema, ot as errorCodeOf, p as OPERATIONS, pt as ok, q as isExternalAuthor, rt as REF_NUMBER, s as tokenRequestSchema, st as parseActorId, t as assertNever, tt as ticketFactsSchema, ut as err, vt as DEFAULT_SLACK_COMMAND, w as userIdSchema, wt as configBindings, x as inboundEventSchema, xt as approvalRuleOf, y as SPACE_IDS, z as sessionTransitionSchema, zt as TASK_HOLDS } from "./chunk-6hZvXPE0.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -9076,13 +9076,24 @@ const segment = z.discriminatedUnion("kind", [z.strictObject({
9076
9076
  kind: z.literal("code"),
9077
9077
  text: z.string().regex(/^[^\n]+$/)
9078
9078
  })]);
9079
+ /**
9080
+ * A field of an outbox row's payload, or null when the payload is not JSON: `json_extract` throws
9081
+ * on one, and one unreadable row must not fail a lookup made for another row.
9082
+ */
9083
+ function payloadField(path) {
9084
+ return sql`case when json_valid(payload) then json_extract(payload, ${path}) end`;
9085
+ }
9079
9086
  /** The plain summary of `segments`: what is scanned, stored on the item and struck. */
9080
9087
  function feedText(segments) {
9081
9088
  return segments.map((part) => part.text).join("");
9082
9089
  }
9083
- /** `segments`, when set, is the line's rich form of `text`; a mismatch is never sent. */
9090
+ /**
9091
+ * `segments`, when set, is the line's rich form of `text`; a mismatch is never sent. `blockType`
9092
+ * is the type of the operator block the line stands for; lines queued before it existed lack it.
9093
+ */
9084
9094
  const feedLineWithLinkPayload = feedLinePayload.extend({
9085
9095
  itemId: id.optional(),
9096
+ blockType: z.enum(BLOCK_TYPES).optional(),
9086
9097
  url: z.url().optional(),
9087
9098
  actions: z.array(actionPayload).optional(),
9088
9099
  exchange: exchange.optional(),
@@ -9275,8 +9286,11 @@ async function enqueueSkillReload(trx, input) {
9275
9286
  if (row.id === null) throw new Error("Doorbell cannot be blocked by gateway scan");
9276
9287
  return row.inserted;
9277
9288
  }
9278
- /** The key includes the item raise, so a restart cannot add a second line. */
9279
- async function enqueueFeedLine(trx, input) {
9289
+ /**
9290
+ * The key includes the item raise, so a restart cannot add a second line. A line with a `parent`
9291
+ * waits for that row's delivery and dies with it.
9292
+ */
9293
+ async function enqueueFeedLine(trx, input, parent = null) {
9280
9294
  return (await insertOutbox(trx, {
9281
9295
  kind: "feed.line",
9282
9296
  dedupeKey: `feed.line:${input.itemKey}:${String(input.raise)}`,
@@ -9293,9 +9307,10 @@ async function enqueueFeedLine(trx, input) {
9293
9307
  taskId: input.taskId ?? void 0,
9294
9308
  ...input.url === "" ? {} : { url: input.url },
9295
9309
  actions: input.actions,
9296
- ...input.segments === void 0 ? {} : { segments: input.segments }
9310
+ ...input.segments === void 0 ? {} : { segments: input.segments },
9311
+ ...input.blockType === void 0 ? {} : { blockType: input.blockType }
9297
9312
  },
9298
- parent: null,
9313
+ parent,
9299
9314
  at: input.at
9300
9315
  })).id;
9301
9316
  }
@@ -9577,6 +9592,17 @@ async function enqueueConversationOpen(trx, input) {
9577
9592
  if (row.inserted && input.commentId !== null) await markCommentPending(trx, input.commentId);
9578
9593
  return row.id;
9579
9594
  }
9595
+ /**
9596
+ * A block's type and the live `conversation.open` row of its operator thread, null when it has no
9597
+ * such row; null when the block does not exist.
9598
+ */
9599
+ async function blockThread(trx, blockId) {
9600
+ const row = await trx.selectFrom("block").leftJoin("outbox", (join) => join.on("outbox.dedupe_key", "=", `conversation.open:block:${String(blockId)}`).on("outbox.state", "!=", "dead")).select(["outbox.id", "block.type"]).where("block.id", "=", blockId).executeTakeFirst();
9601
+ return row === void 0 ? null : {
9602
+ parent: row.id,
9603
+ blockType: row.type
9604
+ };
9605
+ }
9580
9606
  /** The thread an operator conversation was started in; undefined for every other block. */
9581
9607
  async function operatorThread(trx, blockId) {
9582
9608
  const row = await trx.selectFrom("conversation").innerJoin("block", "block.id", "conversation.block_id").select("conversation.ref").where("conversation.block_id", "=", blockId).where("block.addressee_spur_project", "is not", null).orderBy("conversation.created_at").executeTakeFirst();
@@ -9602,7 +9628,7 @@ async function enqueueConversationReply(trx, input) {
9602
9628
  "conversation.open",
9603
9629
  "conversation.reply",
9604
9630
  "conversation.close"
9605
- ]).where(sql`json_extract(payload, '$.blockId')`, "=", blockId).orderBy("id", "desc").limit(1).executeTakeFirst();
9631
+ ]).where(payloadField("$.blockId"), "=", blockId).orderBy("id", "desc").limit(1).executeTakeFirst();
9606
9632
  const started = await operatorThread(trx, blockId);
9607
9633
  if (tail === void 0 && started === void 0 || tail?.state === "dead") return null;
9608
9634
  const payload = {
@@ -9631,8 +9657,8 @@ async function enqueueConversationClose(trx, input) {
9631
9657
  "task_id",
9632
9658
  "project"
9633
9659
  ]).where("id", "=", input.blockId).executeTakeFirstOrThrow();
9634
- const tail = await trx.selectFrom("outbox").select(["id", "state"]).where("kind", "in", ["conversation.open", "conversation.reply"]).where(sql`json_extract(payload, '$.blockId')`, "=", input.blockId).orderBy("id", "desc").executeTakeFirst();
9635
- const open = await trx.selectFrom("outbox").select(["id", "state"]).where("kind", "=", "conversation.open").where(sql`json_extract(payload, '$.blockId')`, "=", input.blockId).executeTakeFirst();
9660
+ const tail = await trx.selectFrom("outbox").select(["id", "state"]).where("kind", "in", ["conversation.open", "conversation.reply"]).where(payloadField("$.blockId"), "=", input.blockId).orderBy("id", "desc").executeTakeFirst();
9661
+ const open = await trx.selectFrom("outbox").select(["id", "state"]).where("kind", "=", "conversation.open").where(payloadField("$.blockId"), "=", input.blockId).executeTakeFirst();
9636
9662
  const parent = tail?.state === "dead" ? null : tail?.id ?? null;
9637
9663
  const conversations = await trx.selectFrom("conversation").select("ref").where("block_id", "=", input.blockId).execute();
9638
9664
  const payload = {
@@ -9767,9 +9793,15 @@ function capPoints(text, max) {
9767
9793
  const points = Array.from(text);
9768
9794
  return points.length <= max ? text : `${points.slice(0, max - 1).join("")}…`;
9769
9795
  }
9770
- /** Raise one item generation. A repeated raise of an active key is idempotent. */
9771
- async function raiseItem(trx, input) {
9772
- return raiseItemWith(trx, input, enqueueFeedLine);
9796
+ /**
9797
+ * Raise one item generation. A repeated raise of an active key is idempotent. An operator block's
9798
+ * line carries the block's type, and its `thread.parent` row holds the line until it is delivered.
9799
+ */
9800
+ async function raiseItem(trx, input, thread = null) {
9801
+ return raiseItemWith(trx, input, (t, line) => thread === null ? enqueueFeedLine(t, line) : enqueueFeedLine(t, {
9802
+ ...line,
9803
+ blockType: thread.blockType
9804
+ }, thread.parent));
9773
9805
  }
9774
9806
  /**
9775
9807
  * Whether the course check `item` forwarded a note: a worker `answer` notification on its block.
@@ -9880,11 +9912,15 @@ function resolvedLine(by, at, config) {
9880
9912
  ];
9881
9913
  }
9882
9914
  /**
9883
- * A feed line: its key, linked when it has a url, then its segments, or its text, as a quote.
9915
+ * A feed line: its key, linked when it has a url, then its segments, or its text, as a quote. An
9916
+ * operator block's line says what Close does right under the key, so a long reason cannot push the
9917
+ * warning off the message with the Close button. Under its delivered `thread` it links the
9918
+ * thread, and for a question says that a reply there answers it; a reply to any other block type
9919
+ * is refused. A line queued before the block type was stored names no type.
9884
9920
  */
9885
- function feedLineBody(payload) {
9886
- const { key, url, text, segments } = payload;
9887
- return [{
9921
+ function feedLineBody(payload, thread) {
9922
+ const { key, url, text, segments, itemKey, blockType } = payload;
9923
+ const body = [{
9888
9924
  kind: "paragraph",
9889
9925
  children: [url === void 0 ? {
9890
9926
  kind: "text",
@@ -9894,13 +9930,51 @@ function feedLineBody(payload) {
9894
9930
  url,
9895
9931
  text: key
9896
9932
  }]
9897
- }, {
9933
+ }];
9934
+ if (itemKey?.startsWith("operator-block:") === true) {
9935
+ const block = `B${itemKey.slice(15)}`;
9936
+ const close = blockType === "needs_input" ? `Close closes ${block} without an answer.` : blockType === void 0 ? `Close unblocks ${block} without an answer.` : `Close unblocks ${block}.`;
9937
+ const link = thread == null ? null : {
9938
+ kind: "link",
9939
+ url: thread.permalink,
9940
+ text: `the ${block} thread`
9941
+ };
9942
+ body.push({
9943
+ kind: "paragraph",
9944
+ children: link === null ? [{
9945
+ kind: "text",
9946
+ text: close
9947
+ }] : blockType === "needs_input" ? [
9948
+ {
9949
+ kind: "text",
9950
+ text: "Reply in "
9951
+ },
9952
+ link,
9953
+ {
9954
+ kind: "text",
9955
+ text: ` to answer it. ${close}`
9956
+ }
9957
+ ] : [
9958
+ {
9959
+ kind: "text",
9960
+ text: "See "
9961
+ },
9962
+ link,
9963
+ {
9964
+ kind: "text",
9965
+ text: `. ${close}`
9966
+ }
9967
+ ]
9968
+ });
9969
+ }
9970
+ body.push({
9898
9971
  kind: "quote",
9899
9972
  children: segments ?? [{
9900
9973
  kind: "text",
9901
9974
  text
9902
9975
  }]
9903
- }];
9976
+ });
9977
+ return body;
9904
9978
  }
9905
9979
  /** A cleared line: its key line, the struck summary and who resolved it when; no actions. */
9906
9980
  function resolvedFeedBody(payload, config) {
@@ -11610,13 +11684,19 @@ function noCiWaives(pr, project) {
11610
11684
  return project.reposWithoutCi.some((listed) => listed.toLowerCase() === repo);
11611
11685
  }
11612
11686
  /**
11613
- * The verdict over the required checks on head, or, when none is required, over every check on
11614
- * head except skipped ones. No check gives pending, and red wins over pending. `waived` (from
11615
- * `noCiWaives`, so the head has no checks) gives green.
11687
+ * The checks the gate and History count: the required checks on head, or, when none is required,
11688
+ * every check on head except skipped ones.
11689
+ */
11690
+ function countedChecks(pr) {
11691
+ return pr.requiredChecks.length > 0 ? pr.requiredChecks : pr.checks.filter((check) => check.state !== "skipped");
11692
+ }
11693
+ /**
11694
+ * The verdict over the counted checks (`countedChecks`). No check gives pending, and red wins over
11695
+ * pending. `waived` (from `noCiWaives`, so the head has no checks) gives green.
11616
11696
  */
11617
11697
  function checksVerdict(pr, waived) {
11618
11698
  if (waived) return "green";
11619
- const verdicts = (pr.requiredChecks.length > 0 ? pr.requiredChecks : pr.checks.filter((check) => check.state !== "skipped")).map((check) => VERDICT[check.state]);
11699
+ const verdicts = countedChecks(pr).map((check) => VERDICT[check.state]);
11620
11700
  if (verdicts.includes("red")) return "red";
11621
11701
  if (verdicts.length === 0 || verdicts.includes("pending")) return "pending";
11622
11702
  return "green";
@@ -14562,21 +14642,26 @@ function cancelledOnHead(fact) {
14562
14642
  });
14563
14643
  }
14564
14644
  const sameRun = (left, right) => left.name === right.name && left.completedAt === right.completedAt;
14645
+ const NO_CANCELS = {
14646
+ waiting: [],
14647
+ confirmed: []
14648
+ };
14565
14649
  /**
14566
14650
  * Counts the polls since each cancelled check on the PR head was first seen: a new entry starts at
14567
14651
  * 0, a scheduled complete poll adds 1, and a head change starts over. It deletes the row of a PR
14568
- * that is not open or has no cancelled check. Returns true when this poll confirms a cancel.
14652
+ * that is not open or has no cancelled check. Returns the runs still waiting after this poll and
14653
+ * the runs this poll confirms as red, each once by name and completion time, in check order.
14569
14654
  */
14570
14655
  async function countCancelledChecks(trx, source, fact, scheduled) {
14571
14656
  const key = cancelledChecksKey(source, fact);
14572
14657
  const cancelled = fact.state === "open" ? cancelledOnHead(fact) : [];
14573
14658
  if (cancelled.length === 0) {
14574
14659
  await trx.deleteFrom("meta").where("key", "=", key).execute();
14575
- return false;
14660
+ return NO_CANCELS;
14576
14661
  }
14577
14662
  const head = fact.headSha.toLowerCase();
14578
14663
  const previous = await countsOnHead(trx, key, head);
14579
- let confirmed = false;
14664
+ const confirmed = [];
14580
14665
  const next = cancelled.map((check) => {
14581
14666
  const before = previous.find((entry) => sameRun(entry, check));
14582
14667
  if (before === void 0) return {
@@ -14584,7 +14669,7 @@ async function countCancelledChecks(trx, source, fact, scheduled) {
14584
14669
  polls: 0
14585
14670
  };
14586
14671
  if (!scheduled || before.polls >= CANCEL_CONFIRM_POLLS) return before;
14587
- if (before.polls + 1 === CANCEL_CONFIRM_POLLS) confirmed = true;
14672
+ if (before.polls + 1 === CANCEL_CONFIRM_POLLS) confirmed.push(check);
14588
14673
  return {
14589
14674
  ...before,
14590
14675
  polls: before.polls + 1
@@ -14598,7 +14683,13 @@ async function countCancelledChecks(trx, source, fact, scheduled) {
14598
14683
  key,
14599
14684
  value
14600
14685
  }).onConflict((oc) => oc.column("key").doUpdateSet({ value })).execute();
14601
- return confirmed;
14686
+ return {
14687
+ waiting: next.filter((entry) => entry.polls < CANCEL_CONFIRM_POLLS).map(({ name, completedAt }) => ({
14688
+ name,
14689
+ completedAt
14690
+ })),
14691
+ confirmed
14692
+ };
14602
14693
  }
14603
14694
  /**
14604
14695
  * The PR with each cancelled check on head that is not confirmed yet read as pending: no stored
@@ -15870,11 +15961,18 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
15870
15961
  priority: candidate.priority
15871
15962
  };
15872
15963
  if (ITEM_POLICY[candidate.kind].block && task !== null && task !== void 0) await raiseAnomaly(trx, config, task, input, stallExecutors.get(candidate.key));
15873
- else await raiseItem(trx, {
15874
- ...input,
15875
- taskId: candidate.taskId,
15876
- blockId: null
15877
- });
15964
+ else {
15965
+ const blockId = candidate.key.startsWith("operator-block:") ? itemBlockRef({
15966
+ item_key: candidate.key,
15967
+ block_id: null
15968
+ }) : void 0;
15969
+ const thread = blockId === void 0 ? null : await blockThread(trx, blockId);
15970
+ await raiseItem(trx, {
15971
+ ...input,
15972
+ taskId: candidate.taskId,
15973
+ blockId: null
15974
+ }, thread);
15975
+ }
15878
15976
  }
15879
15977
  }
15880
15978
  /**
@@ -17350,6 +17448,16 @@ function createSender(options) {
17350
17448
  }
17351
17449
  }
17352
17450
  /**
17451
+ * A feed line waits for its block's thread only to link it. When the thread post failed for good
17452
+ * or died while its block is still open (its failed post closed or blocked), the line goes on
17453
+ * without a parent, and so without the link. A thread that died because its block closed takes
17454
+ * its line with it. The block comes from the thread's dedupe key, not its payload, so a thread
17455
+ * whose payload is not JSON still releases its line and cannot stall a claim.
17456
+ */
17457
+ async function detachAbandonedThreads(trx) {
17458
+ await trx.updateTable("outbox").set({ parent_outbox_id: null }).where("kind", "=", "feed.line").where("state", "in", ["pending", "post_failed"]).where("parent_outbox_id", "in", (eb) => eb.selectFrom("outbox as parent").innerJoin("block", (join) => join.on("parent.dedupe_key", "=", sql`'conversation.open:block:' || block.id`)).select("parent.id").where("parent.kind", "=", "conversation.open").where("parent.state", "in", ["post_failed", "dead"]).where("block.state", "=", "open")).execute();
17459
+ }
17460
+ /**
17353
17461
  * Raising or refreshing health for `spaces` suspends the 30-min window of every waiting row
17354
17462
  * there, so a row that retried before the outage gets a full window once the space recovers.
17355
17463
  */
@@ -17385,6 +17493,7 @@ function createSender(options) {
17385
17493
  }
17386
17494
  }
17387
17495
  await kill(trx, stale, "superseded");
17496
+ await detachAbandonedThreads(trx);
17388
17497
  await cascade(trx);
17389
17498
  let ranThreshold = false;
17390
17499
  if (gateway !== void 0 && !downRecorded && downSince !== void 0 && at - downSince > DOWN_THRESHOLD_MS) {
@@ -17567,7 +17676,7 @@ function createSender(options) {
17567
17676
  }] : c.body.kind === "feed.line" && c.body.payload.exchange !== void 0 ? exchangeBody({
17568
17677
  ...c.body.payload,
17569
17678
  exchange: c.body.payload.exchange
17570
- }) : c.body.kind === "feed.line" ? feedLineBody(c.body.payload) : renderBody(c.body.payload.key, c.body.payload.text),
17679
+ }) : c.body.kind === "feed.line" ? feedLineBody(c.body.payload, c.parent) : renderBody(c.body.payload.key, c.body.payload.text),
17571
17680
  ...(body.kind === "feed.line" || body.kind === "feed.line.edit") && body.payload.actions !== void 0 ? { actions: body.payload.actions } : {}
17572
17681
  };
17573
17682
  return {
@@ -17646,10 +17755,10 @@ function createSender(options) {
17646
17755
  ...isBlock ? { blockId: body.payload.blockId } : { taskId: body.payload.taskId ?? null }
17647
17756
  });
17648
17757
  if (isBlock) {
17649
- if (await trx.selectFrom("outbox").select("id").where("kind", "=", "conversation.close").where(sql`json_extract(payload, '$.blockId')`, "=", body.payload.blockId).where(sql`json_extract(payload, '$.targetConversation')`, "=", conversation).executeTakeFirst() !== void 0) await trx.updateTable("outbox").set({
17758
+ if (await trx.selectFrom("outbox").select("id").where("kind", "=", "conversation.close").where(payloadField("$.blockId"), "=", body.payload.blockId).where(payloadField("$.targetConversation"), "=", conversation).executeTakeFirst() !== void 0) await trx.updateTable("outbox").set({
17650
17759
  state: "dead",
17651
17760
  last_error: "superseded"
17652
- }).where("parent_outbox_id", "=", c.id).where("kind", "=", "conversation.close").where(sql`json_extract(payload, '$.targetConversation')`, "is", null).where("state", "=", "pending").execute();
17761
+ }).where("parent_outbox_id", "=", c.id).where("kind", "=", "conversation.close").where(payloadField("$.targetConversation"), "is", null).where("state", "=", "pending").execute();
17653
17762
  }
17654
17763
  }
17655
17764
  if (body.kind === "conversation.close") await trx.updateTable("conversation").set({
@@ -17765,6 +17874,8 @@ function createSender(options) {
17765
17874
  };
17766
17875
  }
17767
17876
  // ../core/src/app/items.ts
17877
+ /** The reason an operator block closes with when the operator closes its feed line. */
17878
+ const FEED_CLOSE_REASON = "closed by the operator from the feed";
17768
17879
  async function loadItem(trx, id) {
17769
17880
  const item = await trx.selectFrom("operator_item").selectAll().where("id", "=", Number(id.slice(1))).executeTakeFirst();
17770
17881
  if (item === void 0) throw new CommandError("not_found", "Check the item ID.");
@@ -17987,6 +18098,39 @@ function notApplicable(hint) {
17987
18098
  */
17988
18099
  function createItemMutations(deps) {
17989
18100
  const resolveTargets = (trx, input) => itemTarget(trx, deps.config, input);
18101
+ const unblock = createBlockMutations(deps.config).unblock;
18102
+ const unblockGrants = OPERATIONS.find((op) => op.id === "block.unblock")?.grants ?? [];
18103
+ /**
18104
+ * Closes the open operator-addressed block an `operator-block:` item names, as the operator's
18105
+ * unblock. A closed block, an agent's block, an archived task or a caller `block.unblock` would
18106
+ * refuse (a session whose project no longer holds the block) leaves the block as it is.
18107
+ */
18108
+ async function closeOperatorBlock(trx, item, ctx) {
18109
+ const blockId = itemBlockRef(item);
18110
+ if (blockId === void 0) return;
18111
+ const block = await trx.selectFrom("block").select([
18112
+ "state",
18113
+ "addressee_role",
18114
+ "task_id"
18115
+ ]).where("id", "=", blockId).executeTakeFirst();
18116
+ if (block?.state !== "open" || block.addressee_role !== "operator") return;
18117
+ if (block.task_id !== null) {
18118
+ if ((await trx.selectFrom("task").select("membership").where("id", "=", block.task_id).executeTakeFirstOrThrow()).membership === "archived") return;
18119
+ }
18120
+ const input = {
18121
+ mode: "reason",
18122
+ block: `B${String(blockId)}`,
18123
+ reason: FEED_CLOSE_REASON
18124
+ };
18125
+ const [target = { kind: "missing" }] = await unblock.resolveTargets(trx, input, ctx.actor);
18126
+ const state = {
18127
+ config: deps.config,
18128
+ target,
18129
+ mode: input.mode
18130
+ };
18131
+ if (authorize(unblockGrants, ctx.actor, state).status !== "allowed") return;
18132
+ await unblock.run(trx, input, ctx);
18133
+ }
17990
18134
  /** Runs the retry behind the item's kind; false when the item must stay raised. */
17991
18135
  async function retryAction(trx, item, at) {
17992
18136
  const closeHint = `close it with \`board item close I${String(item.id)}\`.`;
@@ -18043,6 +18187,7 @@ function createItemMutations(deps) {
18043
18187
  const reason = `closed as item I${String(item.id)}`;
18044
18188
  await closeBlockIfOpen(trx, item.block_id, ctx, "reason", reason);
18045
18189
  }
18190
+ if (item.item_key.startsWith("operator-block:")) await closeOperatorBlock(trx, item, ctx);
18046
18191
  }
18047
18192
  return view(item, task);
18048
18193
  }
@@ -18803,19 +18948,32 @@ function factsSummary(entity, previous) {
18803
18948
  const texts = named.slice(0, NAMED_CHANGES).map((field) => changeText(field, previous[field], entity.facts[field]));
18804
18949
  return `${entity.prefix}: ${texts.join(", ")}${more(named.length)}`;
18805
18950
  }
18806
- /** `Checks on <ref>:` with the failed names, or the green and pending counts. */
18951
+ /**
18952
+ * `Checks on <ref>:` with the failed names, or the green and pending counts. A cancelled check
18953
+ * whose run (name and completion time) the row lists as `waiting` counts as pending; a clause names
18954
+ * the counted cancels whose run this poll confirmed, then the ones still waiting.
18955
+ */
18807
18956
  function checksSummary(payload) {
18808
18957
  const lists = checksSchema.safeParse(parsedJson(payload.to));
18809
18958
  if (!lists.success) return null;
18810
18959
  const [checks, requiredChecks] = lists.data;
18811
- const list = requiredChecks.length > 0 ? requiredChecks : checks.filter((check) => check.state !== "skipped");
18960
+ const list = countedChecks({
18961
+ checks,
18962
+ requiredChecks
18963
+ });
18812
18964
  const head = `Checks on ${ref$1(payload.repo, payload.pr)}`;
18813
18965
  if (list.length === 0) return `${head}: none`;
18814
- const failed = list.filter((check) => VERDICT[check.state] === "red").map(({ name }) => name);
18815
- if (failed.length > 0) return `${head}: ${String(failed.length)} failed: ${failed.slice(0, NAMED_CHANGES).join(", ")}${more(failed.length)}`;
18966
+ const listed = (check, runs) => check.state === "cancelled" && (runs ?? []).some((run) => sameRun(run, check));
18967
+ const clause = (runs, text) => {
18968
+ const counted = [...new Set(list.filter((check) => listed(check, runs)).map(({ name }) => name))];
18969
+ return counted.length === 0 ? "" : `; ${counted.slice(0, NAMED_CHANGES).join(", ")}${more(counted.length)} cancelled, ${text}`;
18970
+ };
18971
+ const clauses = clause(payload.confirmed, "now counts as red") + clause(payload.waiting, "waiting for a new run");
18972
+ const failed = list.filter((check) => VERDICT[check.state] === "red" && !listed(check, payload.waiting)).map(({ name }) => name);
18973
+ if (failed.length > 0) return `${head}: ${String(failed.length)} failed: ${failed.slice(0, NAMED_CHANGES).join(", ")}${more(failed.length)}${clauses}`;
18816
18974
  const green = list.filter((check) => VERDICT[check.state] === "green").length;
18817
18975
  const pending = list.length - green;
18818
- return `${head}: ${String(green)}/${String(list.length)} green${pending > 0 ? `, ${String(pending)} pending` : ""}`;
18976
+ return `${head}: ${String(green)}/${String(list.length)} green${pending > 0 ? `, ${String(pending)} pending` : ""}${clauses}`;
18819
18977
  }
18820
18978
  const gates = (gate) => gate === void 0 || gate.length === 0 ? "" : ` (${gate.join(", ")})`;
18821
18979
  const optional = (prefix, value) => value === void 0 ? "" : `${prefix}${value}`;
@@ -21102,7 +21260,10 @@ function comparableFacts(facts, timestamp) {
21102
21260
  * Applies one PR fact. `scheduled` is a complete scheduled poll, the only kind that advances the
21103
21261
  * cancelled-check count; `reviewRule` is the full read's review rule of a github-rules source.
21104
21262
  * Returns true when this poll confirmed a cancelled check as red, or changed the review rule with
21105
- * the facts unchanged: no fact event dispatches the PR's tasks then.
21263
+ * the facts unchanged: no fact event dispatches the PR's tasks then. A `checks_changed` row lists
21264
+ * the cancelled runs still in their grace window and the ones this poll confirms; a confirm of a
21265
+ * counted check's run (`countedChecks`, by name and completion time) with the checks unchanged
21266
+ * still writes one, with `from` equal to `to`.
21106
21267
  */
21107
21268
  async function pr(trx, config, fact, at, source, scheduled, reviewRule) {
21108
21269
  await trx.deleteFrom("source_miss").where("source", "=", source).where("ref_key", "=", refKey({
@@ -21150,7 +21311,9 @@ async function pr(trx, config, fact, at, source, scheduled, reviewRule) {
21150
21311
  });
21151
21312
  const project = projectForSource(config, source);
21152
21313
  if (project === void 0) return false;
21153
- const confirmed = project.checksGate !== "dev" && await countCancelledChecks(trx, source, fact, scheduled);
21314
+ const cancels = project.checksGate === "dev" ? NO_CANCELS : await countCancelledChecks(trx, source, fact, scheduled);
21315
+ const confirmed = cancels.confirmed.length > 0;
21316
+ const confirmRow = countedChecks(fact).some((check) => check.state === "cancelled" && cancels.confirmed.some((run) => sameRun(run, check)));
21154
21317
  const ruled = approvalRuleOf(project) === "github-rules" && await recordReviewRule(trx, source, fact, reviewRule, at, project.operatorGithubLogin);
21155
21318
  for (const key of fact.ticketKeys) {
21156
21319
  const task = await trx.selectFrom("task").selectAll().where("project", "=", project.id).where("key", "=", key).executeTakeFirst();
@@ -21184,7 +21347,7 @@ async function pr(trx, config, fact, at, source, scheduled, reviewRule) {
21184
21347
  else await trx.updateTable("link").set({ pr_open: 1 }).where("id", "=", link.id).execute();
21185
21348
  }
21186
21349
  await applyPendingReopen(trx, fact, at);
21187
- if (!changed) return confirmed || ruled;
21350
+ if (!changed && !confirmRow) return confirmed || ruled;
21188
21351
  const links = await trx.selectFrom("link").select(["task_id"]).where("entity", "=", "pr").where(sql`lower(repo) = ${fact.repo.toLowerCase()}`).where("number", "=", fact.number).execute();
21189
21352
  for (const link of links) {
21190
21353
  const task = await trx.selectFrom("task").selectAll().where("id", "=", link.task_id).executeTakeFirstOrThrow();
@@ -21194,12 +21357,15 @@ async function pr(trx, config, fact, at, source, scheduled, reviewRule) {
21194
21357
  from: previous.headSha,
21195
21358
  to: fact.headSha
21196
21359
  });
21197
- if (previous !== null && JSON.stringify([previous.checks, previous.requiredChecks]) !== JSON.stringify([fact.checks, fact.requiredChecks])) await emit(trx, "checks_changed", task.project, task.id, at, {
21360
+ const from = previous === null ? null : checksJson(previous);
21361
+ if (from !== null && from !== checksJson(fact) || confirmRow) await emit(trx, "checks_changed", task.project, task.id, at, {
21198
21362
  repo: fact.repo,
21199
21363
  pr: fact.number,
21200
- from: JSON.stringify([previous.checks, previous.requiredChecks]),
21201
- to: JSON.stringify([fact.checks, fact.requiredChecks]),
21202
- sha: fact.headSha
21364
+ from,
21365
+ to: checksJson(fact),
21366
+ sha: fact.headSha,
21367
+ ...cancels.waiting.length > 0 && { waiting: cancels.waiting },
21368
+ ...confirmed && { confirmed: cancels.confirmed }
21203
21369
  });
21204
21370
  if (previous !== null && previous.mergeable !== fact.mergeable) await emit(trx, "mergeable_changed", task.project, task.id, at, {
21205
21371
  repo: fact.repo,
@@ -21222,11 +21388,13 @@ async function pr(trx, config, fact, at, source, scheduled, reviewRule) {
21222
21388
  state: review.state
21223
21389
  });
21224
21390
  }
21391
+ if (!changed) continue;
21225
21392
  await emit(trx, "pr_facts_changed", task.project, task.id, at, { facts: fact });
21226
21393
  await markTaskChanged(trx, task.id, at);
21227
21394
  }
21228
21395
  return confirmed;
21229
21396
  }
21397
+ const checksJson = (facts) => JSON.stringify([facts.checks, facts.requiredChecks]);
21230
21398
  function branchHasKey(branch, key) {
21231
21399
  const text = branch.toLowerCase();
21232
21400
  const needle = key.toLowerCase();
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { lt as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-B49czSp7.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-BqpntwKX.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CwyzJDIl.mjs";
1
+ import { lt as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-6hZvXPE0.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-D8IOOBWp.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-DM0fcX7h.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";