spur-board 0.16.0 → 0.16.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.
Files changed (2) hide show
  1. package/dist/daemon.mjs +8 -1
  2. package/package.json +1 -1
package/dist/daemon.mjs CHANGED
@@ -10587,6 +10587,10 @@ async function snapshot(trx, repo, number) {
10587
10587
  const row = await trx.selectFrom("pr_snapshot").select("detail").where(sql`lower(repo) = ${repo.toLowerCase()}`).where("number", "=", number).executeTakeFirst();
10588
10588
  return row === void 0 ? null : parseJson(prFactsSchema, row.detail);
10589
10589
  }
10590
+ async function sessionSnapshot(trx, id) {
10591
+ const row = await trx.selectFrom("session_snapshot").select("detail").where("id", "=", id).executeTakeFirst();
10592
+ return row === void 0 ? null : parseJson(sessionFactsSchema, row.detail);
10593
+ }
10590
10594
  async function existingLink(trx, taskId, input, ticket) {
10591
10595
  let query = trx.selectFrom("link").selectAll().where("task_id", "=", taskId);
10592
10596
  if (input.mode === "pr") {
@@ -10670,6 +10674,7 @@ async function run(trx, input, ctx, config, remove) {
10670
10674
  target
10671
10675
  };
10672
10676
  const role = input.mode === "session" ? current?.role ?? await sessionRole(trx, task.id) : null;
10677
+ const session = input.mode === "session" ? await sessionSnapshot(trx, input.session) : null;
10673
10678
  if (current === void 0) await trx.insertInto("link").values({
10674
10679
  task_id: task.id,
10675
10680
  entity: input.mode,
@@ -10698,12 +10703,14 @@ async function run(trx, input, ctx, config, remove) {
10698
10703
  pr: pr?.number ?? 0,
10699
10704
  state: "active",
10700
10705
  source: "manual",
10706
+ ...facts === null ? {} : { facts },
10701
10707
  reason: input.reason
10702
10708
  } : input.mode === "session" ? {
10703
10709
  entity: "session",
10704
10710
  session: input.session,
10705
10711
  role: role ?? "other",
10706
10712
  source: "manual",
10713
+ ...session === null ? {} : { facts: session },
10707
10714
  reason: input.reason
10708
10715
  } : {
10709
10716
  entity: "ticket",
@@ -11595,7 +11602,7 @@ async function updateTerminal(trx, config, taskId, at, completeSince, blind) {
11595
11602
  const complete = completeSince.get(source);
11596
11603
  return !blind.has(source) && complete !== void 0 && complete > (task.last_change_at ?? task.created_at);
11597
11604
  });
11598
- const terminal = merged || doneTicket && !hasOpen && githubComplete;
11605
+ const terminal = !hasOpen && (merged || doneTicket && githubComplete);
11599
11606
  await trx.updateTable("task").set({ terminal_at: terminal ? task.terminal_at ?? (merged ? at : task.last_change_at ?? at) : null }).where("id", "=", taskId).execute();
11600
11607
  }
11601
11608
  async function sourceState(trx, source, state, observedAt, cursor) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"