spur-board 0.74.0 → 0.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BubGdelE.mjs → chunk-BwY4L2UH.mjs} +2 -2
- package/dist/{chunk-By6oaupX.mjs → chunk-CvY4Vfxu.mjs} +8 -1
- package/dist/{chunk-_sUjmlJS.mjs → chunk-bhSEp4Rg.mjs} +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +79 -57
- package/dist/mcp.mjs +3 -3
- package/dist/migrations/0024_event_via.sql +2 -0
- package/package.json +1 -1
- package/skills/spur-board/references/how-board-works-turns.md +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { d as buildCatalogSnapshot, ft as configSchema, mt as plainHttpAllowed, p as OPERATIONS } from "./chunk-CvY4Vfxu.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-bhSEp4Rg.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";
|
|
@@ -177,6 +177,12 @@ const ACTORS = [
|
|
|
177
177
|
"agent",
|
|
178
178
|
"system"
|
|
179
179
|
];
|
|
180
|
+
/**
|
|
181
|
+
* The channel a write arrived through, whoever the actor, journaled as `event.via`; a write
|
|
182
|
+
* outside both has none. Named `via` because core keeps platform terms such as "channel" out of
|
|
183
|
+
* its source.
|
|
184
|
+
*/
|
|
185
|
+
const VIAS = ["web", "slack"];
|
|
180
186
|
/** The stored state of an operator token. */
|
|
181
187
|
const TOKEN_STATUSES = [
|
|
182
188
|
"pending",
|
|
@@ -3370,6 +3376,7 @@ const OPERATIONS = [
|
|
|
3370
3376
|
at: z.iso.datetime().describe("When it happened, ISO 8601 UTC."),
|
|
3371
3377
|
kind: z.enum(EVENT_KINDS).describe("Journal event kind."),
|
|
3372
3378
|
actor: actorIdSchema,
|
|
3379
|
+
via: z.enum(VIAS).optional().describe("Channel the write arrived through, web or slack, whoever the actor; absent for CLI, MCP, agent and scheduled writes."),
|
|
3373
3380
|
summary: z.string().describe("What happened, in one line.")
|
|
3374
3381
|
}).describe("One journal event.")).describe("Journal events of the task, oldest first.")
|
|
3375
3382
|
}),
|
|
@@ -4661,4 +4668,4 @@ function assertNever(value) {
|
|
|
4661
4668
|
throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
|
|
4662
4669
|
}
|
|
4663
4670
|
//#endregion
|
|
4664
|
-
export { err as $, prSourceId as A, prFactsSchema as B, userIdSchema as C, AdapterError as D, eventPayloadSchemas as E, REVIEW_STATES as F, JIRA_PROJECT_KEY as G, ringMarker as H, SESSION_HEALTH_STATES as I, encodeActorId as J, REF_NUMBER as K, SESSION_STATUSES as L, sourceCursorSchema as M, trackerSourceId as N, batchSchema as O, PR_STATES as P, ERRORS as Q, isExternalAuthor as R, messageRefSchema as S, GATE_REASONS as T, sessionFactsSchema as U, prRefSchema as V, ticketFactsSchema as W, parseActorId as X, errorCodeOf as Y, parseRef as Z, renderMcpError as _, COLUMN_IDS as _t, requestHashOf as a, DEFAULT_LINK as at, inboundEventSchema as b, TASK_HOLDS as bt, tokenRequestStatusSchema as c, DEFAULT_STAND_PORT_RANGE as ct, buildCatalogSnapshot as d, configBindings as dt, errorContextSchema as et, roleCanUseOperation as f, configSchema as ft, renderJsonError as g, resolveWebOrigin as gt, renderHttpProblem as h, requiredSecretKeys as ht, TOKEN_REQUEST_LIMITS as i, DEFAULT_HTTP_PORT as it, sessionTransitionSchema as j, entityRefSchema as k, BOARD_TICK_MS as l, RESERVED_PROJECT as lt, turnHandedSchema as m, plainHttpAllowed as mt, doctorReportSchema as n, ok as nt, tokenRequestResultSchema as o, DEFAULT_SLACK_APP_NAME as ot, OPERATIONS as p, defaultAddressee as pt, actorIdSchema as q, remoteDoctorReportSchema as r, successEnvelopeSchema as rt, tokenRequestSchema as s, DEFAULT_SLACK_COMMAND as st, assertNever as t, errorEnvelopeSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, boardWideSpurProject as ut, SPACE_IDS as v, DISPATCHER_MODES as vt, EVENT_KINDS as w, interactionRefSchema as x, conversationRefSchema as y, SLACK_BOT_SCOPES as yt, parseRingMarker as z };
|
|
4671
|
+
export { err as $, prSourceId as A, prFactsSchema as B, userIdSchema as C, AdapterError as D, eventPayloadSchemas as E, REVIEW_STATES as F, JIRA_PROJECT_KEY as G, ringMarker as H, SESSION_HEALTH_STATES as I, encodeActorId as J, REF_NUMBER as K, SESSION_STATUSES as L, sourceCursorSchema as M, trackerSourceId as N, batchSchema as O, PR_STATES as P, ERRORS as Q, isExternalAuthor as R, messageRefSchema as S, GATE_REASONS as T, sessionFactsSchema as U, prRefSchema as V, ticketFactsSchema as W, parseActorId as X, errorCodeOf as Y, parseRef as Z, renderMcpError as _, COLUMN_IDS as _t, requestHashOf as a, DEFAULT_LINK as at, inboundEventSchema as b, TASK_HOLDS as bt, tokenRequestStatusSchema as c, DEFAULT_STAND_PORT_RANGE as ct, buildCatalogSnapshot as d, configBindings as dt, errorContextSchema as et, roleCanUseOperation as f, configSchema as ft, renderJsonError as g, resolveWebOrigin as gt, renderHttpProblem as h, requiredSecretKeys as ht, TOKEN_REQUEST_LIMITS as i, DEFAULT_HTTP_PORT as it, sessionTransitionSchema as j, entityRefSchema as k, BOARD_TICK_MS as l, RESERVED_PROJECT as lt, turnHandedSchema as m, plainHttpAllowed as mt, doctorReportSchema as n, ok as nt, tokenRequestResultSchema as o, DEFAULT_SLACK_APP_NAME as ot, OPERATIONS as p, defaultAddressee as pt, actorIdSchema as q, remoteDoctorReportSchema as r, successEnvelopeSchema as rt, tokenRequestSchema as s, DEFAULT_SLACK_COMMAND as st, assertNever as t, errorEnvelopeSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, boardWideSpurProject as ut, SPACE_IDS as v, DISPATCHER_MODES as vt, EVENT_KINDS as w, interactionRefSchema as x, VIAS as xt, conversationRefSchema as y, SLACK_BOT_SCOPES as yt, parseRingMarker as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-CvY4Vfxu.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { request } from "node:http";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Q as ERRORS, a as requestHashOf, ct as DEFAULT_STAND_PORT_RANGE, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, ht as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as SLACK_BOT_SCOPES } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, a as requestHashOf, ct as DEFAULT_STAND_PORT_RANGE, f as roleCanUseOperation, ft as configSchema, gt as resolveWebOrigin, ht as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as SLACK_BOT_SCOPES } from "./chunk-CvY4Vfxu.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
|
-
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-
|
|
4
|
-
import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-
|
|
3
|
+
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-bhSEp4Rg.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-BwY4L2UH.mjs";
|
|
5
5
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
6
6
|
import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
7
7
|
import { homedir, hostname, userInfo } from "node:os";
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-bhSEp4Rg.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as COLUMN_IDS, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, bt as TASK_HOLDS, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as configBindings, f as roleCanUseOperation, ft as configSchema, h as renderHttpProblem, ht as requiredSecretKeys, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as RESERVED_PROJECT, m as turnHandedSchema, mt as plainHttpAllowed, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as defaultAddressee, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as boardWideSpurProject, v as SPACE_IDS, vt as DISPATCHER_MODES, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, yt as SLACK_BOT_SCOPES, z as parseRingMarker } from "./chunk-
|
|
1
|
+
import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as COLUMN_IDS, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, bt as TASK_HOLDS, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as configBindings, f as roleCanUseOperation, ft as configSchema, h as renderHttpProblem, ht as requiredSecretKeys, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as RESERVED_PROJECT, m as turnHandedSchema, mt as plainHttpAllowed, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as defaultAddressee, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as boardWideSpurProject, v as SPACE_IDS, vt as DISPATCHER_MODES, w as EVENT_KINDS, x as interactionRefSchema, xt as VIAS, y as conversationRefSchema, yt as SLACK_BOT_SCOPES, z as parseRingMarker } from "./chunk-CvY4Vfxu.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -8134,7 +8134,20 @@ const commandKeys = new AsyncLocalStorage();
|
|
|
8134
8134
|
function withCommandKey(key, fn) {
|
|
8135
8135
|
return commandKeys.run(key, fn);
|
|
8136
8136
|
}
|
|
8137
|
-
|
|
8137
|
+
const vias = new AsyncLocalStorage();
|
|
8138
|
+
/**
|
|
8139
|
+
* Runs fn in the scope of one write path (`web` or `slack`): every event `emit` writes inside it
|
|
8140
|
+
* carries it in `via`. The innermost scope wins, and it nests independently of `withCommandKey`.
|
|
8141
|
+
* The same rule applies: run only request work inside it, never trigger a job or start detached
|
|
8142
|
+
* work (timers, unawaited promises), or later scheduled runs would carry this `via`.
|
|
8143
|
+
*/
|
|
8144
|
+
function withVia(via, fn) {
|
|
8145
|
+
return vias.run(via, fn);
|
|
8146
|
+
}
|
|
8147
|
+
/**
|
|
8148
|
+
* The only writer of the journal; `request_id` is the key of the enclosing command and `via` the
|
|
8149
|
+
* write path of the enclosing `withVia` scope, each null outside one.
|
|
8150
|
+
*/
|
|
8138
8151
|
async function emit(trx, kind, project, taskId, at, payload, actor = "system") {
|
|
8139
8152
|
const parsed = parseActorId(actor);
|
|
8140
8153
|
if (parsed === null) throw new Error("Invalid journal actor");
|
|
@@ -8147,7 +8160,8 @@ async function emit(trx, kind, project, taskId, at, payload, actor = "system") {
|
|
|
8147
8160
|
actor_ref: parsed.actor === "agent" ? JSON.stringify(parsed.actorRef) : null,
|
|
8148
8161
|
payload: toJson(eventPayloadSchemas[kind], payload),
|
|
8149
8162
|
v: 1,
|
|
8150
|
-
request_id: commandKeys.getStore() ?? null
|
|
8163
|
+
request_id: commandKeys.getStore() ?? null,
|
|
8164
|
+
via: vias.getStore() ?? null
|
|
8151
8165
|
}).execute();
|
|
8152
8166
|
}
|
|
8153
8167
|
const actorRefSchema = z.strictObject({
|
|
@@ -16674,10 +16688,12 @@ function createTaskQueries(deps) {
|
|
|
16674
16688
|
const events = (await trx.selectFrom("event").selectAll().where("task_id", "=", task.id).orderBy("id").execute()).flatMap((row) => {
|
|
16675
16689
|
const kind = EVENT_KINDS.find((candidate) => candidate === row.kind);
|
|
16676
16690
|
if (kind === void 0) return [];
|
|
16691
|
+
const via = VIAS.find((value) => value === row.via);
|
|
16677
16692
|
return [{
|
|
16678
16693
|
at: row.at,
|
|
16679
16694
|
kind,
|
|
16680
16695
|
actor: eventActor(row),
|
|
16696
|
+
...via === void 0 ? {} : { via },
|
|
16681
16697
|
summary: linkOrEscalationSummary(kind, row.payload) ?? shadowSummary(kind, row.payload) ?? submitSummary(kind, row.payload) ?? turnSummary(kind, row.payload) ?? EVENT_SUMMARIES[kind]
|
|
16682
16698
|
}];
|
|
16683
16699
|
});
|
|
@@ -18766,22 +18782,24 @@ function createInbound(input) {
|
|
|
18766
18782
|
return { status: "applied" };
|
|
18767
18783
|
}
|
|
18768
18784
|
async function reapply(trx, itemId, at) {
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
+
await withVia("slack", async () => {
|
|
18786
|
+
const item = await trx.selectFrom("operator_item").selectAll().where("id", "=", itemId).executeTakeFirst();
|
|
18787
|
+
if (item === void 0 || item.cleared_at !== null || item.inbound_event_json === null) throw new CommandError("retry_not_applicable", "This item has no stored event to retry.");
|
|
18788
|
+
const event = parseJson(inboundEventSchema, item.inbound_event_json);
|
|
18789
|
+
if (event.kind === "gap" || event.kind === "connection") throw new CommandError("retry_not_applicable", "This event cannot be retried.");
|
|
18790
|
+
if (event.kind === "command" || event.kind === "action") {
|
|
18791
|
+
await reapplyInteraction(trx, event, at);
|
|
18792
|
+
return;
|
|
18793
|
+
}
|
|
18794
|
+
await replayOperation(trx, {
|
|
18795
|
+
actor: event.kind === "message_deleted" || event.author === config.operator.slack ? "operator" : "system",
|
|
18796
|
+
key: event.dedupeKey,
|
|
18797
|
+
operation: operationId(event),
|
|
18798
|
+
fingerprintInput: event,
|
|
18799
|
+
output: resultSchema,
|
|
18800
|
+
at,
|
|
18801
|
+
run: () => runUser(trx, event, at)
|
|
18802
|
+
});
|
|
18785
18803
|
});
|
|
18786
18804
|
}
|
|
18787
18805
|
/**
|
|
@@ -19068,46 +19086,50 @@ function createInbound(input) {
|
|
|
19068
19086
|
} catch {}
|
|
19069
19087
|
}
|
|
19070
19088
|
async function applyUser(event) {
|
|
19071
|
-
|
|
19072
|
-
|
|
19073
|
-
|
|
19074
|
-
|
|
19075
|
-
|
|
19076
|
-
|
|
19077
|
-
|
|
19078
|
-
|
|
19079
|
-
|
|
19080
|
-
|
|
19081
|
-
|
|
19082
|
-
|
|
19083
|
-
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19087
|
-
|
|
19088
|
-
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
|
|
19092
|
-
|
|
19089
|
+
await withVia("slack", async () => {
|
|
19090
|
+
if ((event.kind === "command" || event.kind === "action") && event.author === config.operator.slack && (event.kind !== "command" || event.name === void 0 || event.name === config.slack.command) && (event.kind === "command" || event.sourceSpace !== null)) {
|
|
19091
|
+
await dispatchInteraction(event);
|
|
19092
|
+
return;
|
|
19093
|
+
}
|
|
19094
|
+
const at = new Date(clock.now()).toISOString();
|
|
19095
|
+
const actor = event.kind === "message_deleted" || event.author === config.operator.slack ? "operator" : "system";
|
|
19096
|
+
try {
|
|
19097
|
+
const result = await scanTransaction(store, config, (trx) => replayOperation(trx, {
|
|
19098
|
+
actor,
|
|
19099
|
+
key: event.dedupeKey,
|
|
19100
|
+
operation: operationId(event),
|
|
19101
|
+
fingerprintInput: event,
|
|
19102
|
+
output: resultSchema,
|
|
19103
|
+
at,
|
|
19104
|
+
run: () => runUser(trx, event, at)
|
|
19105
|
+
}));
|
|
19106
|
+
if (result?.response !== void 0 && "interaction" in event) try {
|
|
19107
|
+
await gateway.respond(event.interaction, plain$1(result.response), { private: true });
|
|
19108
|
+
} catch {}
|
|
19109
|
+
} catch (error) {
|
|
19110
|
+
await recordFailure(event, error, at);
|
|
19111
|
+
}
|
|
19112
|
+
});
|
|
19093
19113
|
}
|
|
19094
19114
|
async function applyGap(event) {
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
|
|
19115
|
+
await withVia("slack", async () => {
|
|
19116
|
+
const at = new Date(clock.now()).toISOString();
|
|
19117
|
+
await scanTransaction(store, config, async (trx) => {
|
|
19118
|
+
const context = await taskContext(trx, event, gateway.kind);
|
|
19119
|
+
const conversation = event.conversation === void 0 ? void 0 : await trx.selectFrom("conversation").select(["root_message_ref"]).where("gateway", "=", gateway.kind).where("ref", "=", event.conversation).executeTakeFirst();
|
|
19120
|
+
const opened = conversation === void 0 ? void 0 : await trx.selectFrom("outbox").select(["id", "external_ref"]).where("kind", "=", "conversation.open").where("state", "=", "done").where(sql`json_extract(external_ref, '$.message')`, "=", conversation.root_message_ref).orderBy("id", "desc").executeTakeFirst();
|
|
19121
|
+
const parsed = opened?.external_ref === null || opened?.external_ref === void 0 ? void 0 : deliveredRefSchema.safeParse(JSON.parse(opened.external_ref));
|
|
19122
|
+
if (opened !== void 0 && parsed?.success === false) warnSkipped("outbox", "external_ref", opened.id, parsed.error);
|
|
19123
|
+
const ref = parsed?.data;
|
|
19124
|
+
await raiseInboundItem(trx, {
|
|
19125
|
+
sourceKey: `inbound:gap:${createHash("sha256").update(JSON.stringify([gateway.kind, event.conversation ?? null])).digest("hex")}`,
|
|
19126
|
+
title: "repeat your answer",
|
|
19127
|
+
sourceUrl: ref?.permalink ?? null,
|
|
19128
|
+
event,
|
|
19129
|
+
taskId: context.taskId,
|
|
19130
|
+
at,
|
|
19131
|
+
retry: false
|
|
19132
|
+
});
|
|
19111
19133
|
});
|
|
19112
19134
|
});
|
|
19113
19135
|
}
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, r as requestOperation } from "./chunk-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-CvY4Vfxu.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-bhSEp4Rg.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-BwY4L2UH.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
package/package.json
CHANGED
|
@@ -23,6 +23,8 @@ a message already accepted by Spur cannot be retracted. Check `board inbox` and
|
|
|
23
23
|
act only on a current turn; reread after `turn_closed`.
|
|
24
24
|
Task history (`board task history <task>`) shows journal events `turn_opened`,
|
|
25
25
|
`turn_taken` and `turn_closed`: executor, taker, outcome.
|
|
26
|
+
Each event names who acted and, for a write that arrived through Slack, its
|
|
27
|
+
channel (`via`); CLI, MCP, agent and scheduled writes have none.
|
|
26
28
|
|
|
27
29
|
Open-turn executors in `needs_input`, `error`, `rate_limited` or `stopped` raise
|
|
28
30
|
one question after `health.turnStallAfterMs` (default 600000): curator unless self, else
|