sensorium-mcp 3.1.2-board.1 → 3.1.3

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 (103) hide show
  1. package/dist/dashboard/routes/threads-read.d.ts +7 -3
  2. package/dist/dashboard/routes/threads-read.d.ts.map +1 -1
  3. package/dist/dashboard/routes/threads-read.js +19 -4
  4. package/dist/dashboard/routes/threads-read.js.map +1 -1
  5. package/dist/dashboard/routes/types.d.ts +0 -6
  6. package/dist/dashboard/routes/types.d.ts.map +1 -1
  7. package/dist/dashboard/routes/types.js.map +1 -1
  8. package/dist/dashboard/routes.d.ts.map +1 -1
  9. package/dist/dashboard/routes.js +0 -32
  10. package/dist/dashboard/routes.js.map +1 -1
  11. package/dist/dashboard/spa.html +12 -12
  12. package/dist/data/memory/migration-runner.d.ts.map +1 -1
  13. package/dist/data/memory/migration-runner.js +0 -4
  14. package/dist/data/memory/migration-runner.js.map +1 -1
  15. package/dist/data/memory/schema.d.ts.map +1 -1
  16. package/dist/data/memory/schema.js +0 -4
  17. package/dist/data/memory/schema.js.map +1 -1
  18. package/dist/index.js +2 -39
  19. package/dist/index.js.map +1 -1
  20. package/dist/integrations/openai/speech.d.ts.map +1 -1
  21. package/dist/integrations/openai/speech.js +52 -19
  22. package/dist/integrations/openai/speech.js.map +1 -1
  23. package/dist/lib/utils.d.ts +10 -0
  24. package/dist/lib/utils.d.ts.map +1 -1
  25. package/dist/lib/utils.js +22 -0
  26. package/dist/lib/utils.js.map +1 -1
  27. package/dist/server/http-server.d.ts +1 -3
  28. package/dist/server/http-server.d.ts.map +1 -1
  29. package/dist/server/http-server.js +1 -3
  30. package/dist/server/http-server.js.map +1 -1
  31. package/dist/services/spawn-common.d.ts.map +1 -1
  32. package/dist/services/spawn-common.js +1 -3
  33. package/dist/services/spawn-common.js.map +1 -1
  34. package/dist/services/worker-cleanup.service.d.ts +1 -6
  35. package/dist/services/worker-cleanup.service.d.ts.map +1 -1
  36. package/dist/services/worker-cleanup.service.js +10 -123
  37. package/dist/services/worker-cleanup.service.js.map +1 -1
  38. package/dist/tools/delegate-tool.d.ts.map +1 -1
  39. package/dist/tools/delegate-tool.js +0 -32
  40. package/dist/tools/delegate-tool.js.map +1 -1
  41. package/dist/tools/utility-tools.d.ts.map +1 -1
  42. package/dist/tools/utility-tools.js +7 -3
  43. package/dist/tools/utility-tools.js.map +1 -1
  44. package/dist/tools/wait/message-delivery.d.ts.map +1 -1
  45. package/dist/tools/wait/message-delivery.js +0 -13
  46. package/dist/tools/wait/message-delivery.js.map +1 -1
  47. package/package.json +1 -1
  48. package/dist/dashboard/routes/board.d.ts +0 -67
  49. package/dist/dashboard/routes/board.d.ts.map +0 -1
  50. package/dist/dashboard/routes/board.js +0 -612
  51. package/dist/dashboard/routes/board.js.map +0 -1
  52. package/dist/data/board/board-schema.d.ts +0 -22
  53. package/dist/data/board/board-schema.d.ts.map +0 -1
  54. package/dist/data/board/board-schema.js +0 -103
  55. package/dist/data/board/board-schema.js.map +0 -1
  56. package/dist/data/board/board-types.d.ts +0 -117
  57. package/dist/data/board/board-types.d.ts.map +0 -1
  58. package/dist/data/board/board-types.js +0 -9
  59. package/dist/data/board/board-types.js.map +0 -1
  60. package/dist/data/board/card.repository.d.ts +0 -64
  61. package/dist/data/board/card.repository.d.ts.map +0 -1
  62. package/dist/data/board/card.repository.js +0 -272
  63. package/dist/data/board/card.repository.js.map +0 -1
  64. package/dist/data/board/comment.repository.d.ts +0 -12
  65. package/dist/data/board/comment.repository.d.ts.map +0 -1
  66. package/dist/data/board/comment.repository.js +0 -31
  67. package/dist/data/board/comment.repository.js.map +0 -1
  68. package/dist/data/board/lane.repository.d.ts +0 -18
  69. package/dist/data/board/lane.repository.d.ts.map +0 -1
  70. package/dist/data/board/lane.repository.js +0 -44
  71. package/dist/data/board/lane.repository.js.map +0 -1
  72. package/dist/data/board/profile-defaults.d.ts +0 -19
  73. package/dist/data/board/profile-defaults.d.ts.map +0 -1
  74. package/dist/data/board/profile-defaults.js +0 -118
  75. package/dist/data/board/profile-defaults.js.map +0 -1
  76. package/dist/services/board/board-signals.d.ts +0 -25
  77. package/dist/services/board/board-signals.d.ts.map +0 -1
  78. package/dist/services/board/board-signals.js +0 -83
  79. package/dist/services/board/board-signals.js.map +0 -1
  80. package/dist/services/board/card-briefing.d.ts +0 -17
  81. package/dist/services/board/card-briefing.d.ts.map +0 -1
  82. package/dist/services/board/card-briefing.js +0 -86
  83. package/dist/services/board/card-briefing.js.map +0 -1
  84. package/dist/services/board/orchestrator.service.d.ts +0 -55
  85. package/dist/services/board/orchestrator.service.d.ts.map +0 -1
  86. package/dist/services/board/orchestrator.service.js +0 -198
  87. package/dist/services/board/orchestrator.service.js.map +0 -1
  88. package/dist/services/board/release-worker.d.ts +0 -32
  89. package/dist/services/board/release-worker.d.ts.map +0 -1
  90. package/dist/services/board/release-worker.js +0 -49
  91. package/dist/services/board/release-worker.js.map +0 -1
  92. package/dist/services/board/report-capture.d.ts +0 -48
  93. package/dist/services/board/report-capture.d.ts.map +0 -1
  94. package/dist/services/board/report-capture.js +0 -172
  95. package/dist/services/board/report-capture.js.map +0 -1
  96. package/dist/services/board/worker-spawn.d.ts +0 -30
  97. package/dist/services/board/worker-spawn.d.ts.map +0 -1
  98. package/dist/services/board/worker-spawn.js +0 -90
  99. package/dist/services/board/worker-spawn.js.map +0 -1
  100. package/dist/services/passive-notice.service.d.ts +0 -39
  101. package/dist/services/passive-notice.service.d.ts.map +0 -1
  102. package/dist/services/passive-notice.service.js +0 -274
  103. package/dist/services/passive-notice.service.js.map +0 -1
@@ -1,31 +0,0 @@
1
- /**
2
- * Agent Task Board — card comments.
3
- *
4
- * All task chatter lives on the card (design §2): operator guidance, worker
5
- * reports (written by the orchestrator from intercepted replies), and board
6
- * lifecycle events. Comments are append-only.
7
- */
8
- import { nowISO } from "../memory/utils.js";
9
- function mapRow(row) {
10
- return {
11
- id: row.id,
12
- cardId: row.card_id,
13
- author: row.author,
14
- content: row.content,
15
- createdAt: row.created_at,
16
- };
17
- }
18
- export function addComment(db, cardId, author, content) {
19
- const now = nowISO();
20
- const result = db
21
- .prepare(`INSERT INTO board_comments (card_id, author, content, created_at) VALUES (?, ?, ?, ?)`)
22
- .run(cardId, author, content, now);
23
- return { id: Number(result.lastInsertRowid), cardId, author, content, createdAt: now };
24
- }
25
- export function listComments(db, cardId) {
26
- const rows = db
27
- .prepare(`SELECT * FROM board_comments WHERE card_id = ? ORDER BY created_at ASC, id ASC`)
28
- .all(cardId);
29
- return rows.map(mapRow);
30
- }
31
- //# sourceMappingURL=comment.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"comment.repository.js","sourceRoot":"","sources":["../../../src/data/board/comment.repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAW5C,SAAS,MAAM,CAAC,GAAe;IAC7B,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,EAAY,EACZ,MAAc,EACd,MAAqB,EACrB,OAAe;IAEf,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,MAAM,GAAG,EAAE;SACd,OAAO,CACN,uFAAuF,CACxF;SACA,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAY,EAAE,MAAc;IACvD,MAAM,IAAI,GAAG,EAAE;SACZ,OAAO,CAAC,gFAAgF,CAAC;SACzF,GAAG,CAAC,MAAM,CAAiB,CAAC;IAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Agent Task Board — lanes (threads connected to the board).
3
- *
4
- * A lane is a thread the operator has connected; only connected lanes are
5
- * dispatched, and a lane's cards are drained by workers branched from that
6
- * thread (design §3). Connecting is idempotent.
7
- */
8
- import type { Database } from "../memory/db-types.js";
9
- import type { BoardLane } from "./board-types.js";
10
- export declare function upsertLane(db: Database, threadId: number, opts?: {
11
- connected?: boolean;
12
- maxConcurrent?: number;
13
- }): BoardLane;
14
- export declare function listLanes(db: Database): BoardLane[];
15
- export declare function listConnectedLanes(db: Database): BoardLane[];
16
- export declare function getLane(db: Database, threadId: number): BoardLane | undefined;
17
- export declare function removeLane(db: Database, threadId: number): boolean;
18
- //# sourceMappingURL=lane.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lane.repository.d.ts","sourceRoot":"","sources":["../../../src/data/board/lane.repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkBlD,wBAAgB,UAAU,CACxB,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACzD,SAAS,CAiBX;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,QAAQ,GAAG,SAAS,EAAE,CAGnD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,SAAS,EAAE,CAK5D;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAI7E;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGlE"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Agent Task Board — lanes (threads connected to the board).
3
- *
4
- * A lane is a thread the operator has connected; only connected lanes are
5
- * dispatched, and a lane's cards are drained by workers branched from that
6
- * thread (design §3). Connecting is idempotent.
7
- */
8
- import { nowISO } from "../memory/utils.js";
9
- function mapRow(row) {
10
- return {
11
- threadId: row.thread_id,
12
- connected: row.connected === 1,
13
- maxConcurrent: row.max_concurrent,
14
- createdAt: row.created_at,
15
- };
16
- }
17
- export function upsertLane(db, threadId, opts = {}) {
18
- db.prepare(`INSERT INTO board_lanes (thread_id, connected, max_concurrent, created_at)
19
- VALUES (?, ?, ?, ?)
20
- ON CONFLICT(thread_id) DO UPDATE SET
21
- connected = COALESCE(?, board_lanes.connected),
22
- max_concurrent = COALESCE(?, board_lanes.max_concurrent)`).run(threadId, opts.connected === false ? 0 : 1, opts.maxConcurrent ?? 1, nowISO(), opts.connected === undefined ? null : opts.connected ? 1 : 0, opts.maxConcurrent ?? null);
23
- const row = db.prepare(`SELECT * FROM board_lanes WHERE thread_id = ?`).get(threadId);
24
- return mapRow(row);
25
- }
26
- export function listLanes(db) {
27
- const rows = db.prepare(`SELECT * FROM board_lanes ORDER BY created_at ASC`).all();
28
- return rows.map(mapRow);
29
- }
30
- export function listConnectedLanes(db) {
31
- const rows = db
32
- .prepare(`SELECT * FROM board_lanes WHERE connected = 1 ORDER BY created_at ASC`)
33
- .all();
34
- return rows.map(mapRow);
35
- }
36
- export function getLane(db, threadId) {
37
- const row = db.prepare(`SELECT * FROM board_lanes WHERE thread_id = ?`).get(threadId);
38
- return row ? mapRow(row) : undefined;
39
- }
40
- export function removeLane(db, threadId) {
41
- const result = db.prepare(`DELETE FROM board_lanes WHERE thread_id = ?`).run(threadId);
42
- return result.changes > 0;
43
- }
44
- //# sourceMappingURL=lane.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lane.repository.js","sourceRoot":"","sources":["../../../src/data/board/lane.repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAU5C,SAAS,MAAM,CAAC,GAAY;IAC1B,OAAO;QACL,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,SAAS,EAAE,GAAG,CAAC,SAAS,KAAK,CAAC;QAC9B,aAAa,EAAE,GAAG,CAAC,cAAc;QACjC,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,EAAY,EACZ,QAAgB,EAChB,OAAwD,EAAE;IAE1D,EAAE,CAAC,OAAO,CACR;;;;gEAI4D,CAC7D,CAAC,GAAG,CACH,QAAQ,EACR,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAChC,IAAI,CAAC,aAAa,IAAI,CAAC,EACvB,MAAM,EAAE,EACR,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC5D,IAAI,CAAC,aAAa,IAAI,IAAI,CAC3B,CAAC;IACF,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAY,CAAC;IACjG,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAY;IACpC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,mDAAmD,CAAC,CAAC,GAAG,EAAe,CAAC;IAChG,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAY;IAC7C,MAAM,IAAI,GAAG,EAAE;SACZ,OAAO,CAAC,uEAAuE,CAAC;SAChF,GAAG,EAAe,CAAC;IACtB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EAAY,EAAE,QAAgB;IACpD,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAC,GAAG,CAAC,QAAQ,CAC/D,CAAC;IACtB,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAY,EAAE,QAAgB;IACvD,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,6CAA6C,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvF,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;AAC5B,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Agent Task Board — execution-profile templates.
3
- *
4
- * The card's type seeds its execution profile so a routine card is one click,
5
- * not twelve toggles (spec §4 "Type", design §2). Built-in defaults below;
6
- * the operator can override per-type via ~/.remote-copilot-mcp/board-profiles.json
7
- * (same shape: { "<type>": { ...ExecutionProfile } }), edited from the dashboard.
8
- */
9
- import type { CardType, ExecutionProfile } from "./board-types.js";
10
- /** Built-in per-type defaults. `bug` is the full-rigor path; `chore` the light
11
- * one. Keyed by CardType so a new built-in type cannot silently miss a profile. */
12
- export declare const BUILTIN_PROFILE_DEFAULTS: Record<CardType, ExecutionProfile>;
13
- /** Effective per-type profile templates: built-ins shallow-merged with operator overrides. */
14
- export declare function getProfileTemplates(): Record<string, ExecutionProfile>;
15
- /** Default profile for a card type (empty profile for unknown types). */
16
- export declare function getProfileForType(type: string): ExecutionProfile;
17
- /** Persist operator overrides (dashboard PUT /api/board/profiles). Write-then-rename. */
18
- export declare function saveProfileOverrides(overrides: Record<string, ExecutionProfile>): void;
19
- //# sourceMappingURL=profile-defaults.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile-defaults.d.ts","sourceRoot":"","sources":["../../../src/data/board/profile-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAInE;oFACoF;AACpF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAwDvE,CAAC;AA2BF,8FAA8F;AAC9F,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAQtE;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAEhE;AAED,yFAAyF;AACzF,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,IAAI,CAItF"}
@@ -1,118 +0,0 @@
1
- /**
2
- * Agent Task Board — execution-profile templates.
3
- *
4
- * The card's type seeds its execution profile so a routine card is one click,
5
- * not twelve toggles (spec §4 "Type", design §2). Built-in defaults below;
6
- * the operator can override per-type via ~/.remote-copilot-mcp/board-profiles.json
7
- * (same shape: { "<type>": { ...ExecutionProfile } }), edited from the dashboard.
8
- */
9
- import { existsSync, readFileSync, statSync, writeFileSync, renameSync } from "node:fs";
10
- import { homedir } from "node:os";
11
- import { join } from "node:path";
12
- import { log } from "../../lib/logger.js";
13
- import { errorMessage } from "../../lib/utils.js";
14
- const OVERRIDES_PATH = join(homedir(), ".remote-copilot-mcp", "board-profiles.json");
15
- /** Built-in per-type defaults. `bug` is the full-rigor path; `chore` the light
16
- * one. Keyed by CardType so a new built-in type cannot silently miss a profile. */
17
- export const BUILTIN_PROFILE_DEFAULTS = {
18
- bug: {
19
- createBranch: true,
20
- runTests: true,
21
- openPr: true,
22
- expertReview: true,
23
- push: true,
24
- ciCheck: "github",
25
- workerSplit: "single",
26
- },
27
- feature: {
28
- createBranch: true,
29
- runTests: true,
30
- build: true,
31
- openPr: true,
32
- expertReview: true,
33
- push: true,
34
- ciCheck: "github",
35
- workerSplit: "single",
36
- },
37
- "tech-debt": {
38
- createBranch: true,
39
- runTests: true,
40
- openPr: true,
41
- expertReview: false,
42
- push: true,
43
- ciCheck: "github",
44
- workerSplit: "single",
45
- },
46
- chore: {
47
- createBranch: false,
48
- runTests: false,
49
- openPr: false,
50
- expertReview: false,
51
- push: false,
52
- ciCheck: "none",
53
- workerSplit: "single",
54
- },
55
- research: {
56
- createBranch: false,
57
- runTests: false,
58
- openPr: false,
59
- expertReview: false,
60
- push: false,
61
- ciCheck: "none",
62
- workerSplit: "single",
63
- },
64
- "recurring-ops": {
65
- createBranch: false,
66
- runTests: false,
67
- openPr: false,
68
- expertReview: false,
69
- push: false,
70
- ciCheck: "none",
71
- workerSplit: "single",
72
- },
73
- };
74
- // mtime-keyed cache: overrides are read on EVERY card create/validate, and the
75
- // file changes only when the operator saves from the dashboard.
76
- let overridesCache = null;
77
- function loadOverrides() {
78
- if (!existsSync(OVERRIDES_PATH)) {
79
- overridesCache = null;
80
- return {};
81
- }
82
- try {
83
- const mtimeMs = statSync(OVERRIDES_PATH).mtimeMs;
84
- if (overridesCache && overridesCache.mtimeMs === mtimeMs)
85
- return overridesCache.data;
86
- const parsed = JSON.parse(readFileSync(OVERRIDES_PATH, "utf-8"));
87
- const data = typeof parsed === "object" && parsed !== null
88
- ? parsed
89
- : {};
90
- overridesCache = { mtimeMs, data };
91
- return data;
92
- }
93
- catch (err) {
94
- log.warn(`[board] Malformed board-profiles.json — ignoring overrides: ${errorMessage(err)}`);
95
- return {};
96
- }
97
- }
98
- /** Effective per-type profile templates: built-ins shallow-merged with operator overrides. */
99
- export function getProfileTemplates() {
100
- const overrides = loadOverrides();
101
- const builtins = BUILTIN_PROFILE_DEFAULTS;
102
- const merged = {};
103
- for (const type of new Set([...Object.keys(builtins), ...Object.keys(overrides)])) {
104
- merged[type] = { ...builtins[type], ...overrides[type] };
105
- }
106
- return merged;
107
- }
108
- /** Default profile for a card type (empty profile for unknown types). */
109
- export function getProfileForType(type) {
110
- return getProfileTemplates()[type] ?? {};
111
- }
112
- /** Persist operator overrides (dashboard PUT /api/board/profiles). Write-then-rename. */
113
- export function saveProfileOverrides(overrides) {
114
- const tmp = `${OVERRIDES_PATH}.tmp`;
115
- writeFileSync(tmp, JSON.stringify(overrides, null, 2), "utf-8");
116
- renameSync(tmp, OVERRIDES_PATH);
117
- }
118
- //# sourceMappingURL=profile-defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile-defaults.js","sourceRoot":"","sources":["../../../src/data/board/profile-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;AAErF;oFACoF;AACpF,MAAM,CAAC,MAAM,wBAAwB,GAAuC;IAC1E,GAAG,EAAE;QACH,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;QAClB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,QAAQ;QACjB,WAAW,EAAE,QAAQ;KACtB;IACD,OAAO,EAAE;QACP,YAA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UAAU,oBAAoB,CAAC,SAA2C;IAC9E,MAAM,GAAG,GAAG,GAAG,cAAc,MAAM,CAAC;IACpC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAChE,UAAU,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AAClC,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Board awareness signals — exactly three kinds, one line each, no description
3
- * (invariant #4). STARTED / DONE / BLOCKED go to the card's LANE thread.
4
- *
5
- * Delivery mode is deliberately isolated in this one function while decision
6
- * #2 is with the operator (thread 1327, 2026-08-01):
7
- * - "passive" (default, orchestrator's lean): rides the passive-notice
8
- * channel — seen on the lane's next delivered turn, never acted on.
9
- * - "mailbox": appended to the lane's pending-task mailbox (spec §3 wording)
10
- * — wakes the lane agent with an FYI-framed line.
11
- * Flip via BOARD_SIGNAL_DELIVERY=mailbox; no other code changes.
12
- */
13
- import type { BoardCard } from "../../data/board/board-types.js";
14
- export type BoardSignalKind = "STARTED" | "DONE" | "BLOCKED";
15
- /** One-line, FYI-framed state transition. `detail` is used ONLY for BLOCKED
16
- * (a one-line reason is what makes the ping actionable for the operator). */
17
- export declare function sendBoardSignal(card: BoardCard, kind: BoardSignalKind, detail?: string): void;
18
- /**
19
- * Selective escalation (invariant #4): a card the operator hand-flagged
20
- * "important to me" mirrors its notable updates (worker reports, block
21
- * reasons) into the main thread as passive notices — aware, not commanded.
22
- * Deterministic: no agent judges importance; the flag decides, always.
23
- */
24
- export declare function mirrorEscalatedUpdate(card: BoardCard, text: string): void;
25
- //# sourceMappingURL=board-signals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"board-signals.d.ts","sourceRoot":"","sources":["../../../src/services/board/board-signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAsB7D;8EAC8E;AAC9E,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAsB7F;AAQD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAczE"}
@@ -1,83 +0,0 @@
1
- /**
2
- * Board awareness signals — exactly three kinds, one line each, no description
3
- * (invariant #4). STARTED / DONE / BLOCKED go to the card's LANE thread.
4
- *
5
- * Delivery mode is deliberately isolated in this one function while decision
6
- * #2 is with the operator (thread 1327, 2026-08-01):
7
- * - "passive" (default, orchestrator's lean): rides the passive-notice
8
- * channel — seen on the lane's next delivered turn, never acted on.
9
- * - "mailbox": appended to the lane's pending-task mailbox (spec §3 wording)
10
- * — wakes the lane agent with an FYI-framed line.
11
- * Flip via BOARD_SIGNAL_DELIVERY=mailbox; no other code changes.
12
- */
13
- import { appendFileSync } from "node:fs";
14
- import { join } from "node:path";
15
- import { log } from "../../lib/logger.js";
16
- import { errorMessage } from "../../lib/utils.js";
17
- import { ensureDirs, PENDING_TASKS_DIR } from "../process.service.js";
18
- import { pushPassiveNotice } from "../passive-notice.service.js";
19
- /** Worker-authored text entering another thread's context block is an
20
- * instruction-injection surface: strip control chars (no fake newline-framed
21
- * "directives"), drop backticks, and cap length so the excerpt reads as an
22
- * inert quoted fragment, never as markup or a fresh instruction line. */
23
- function sanitizeExcerpt(text, maxLen) {
24
- return (text
25
- // eslint-disable-next-line no-control-regex -- stripping control chars is the point
26
- .replace(/[\x00-\x1f\x7f]+/g, " ")
27
- .replace(/`/g, "'")
28
- .replace(/\s+/g, " ")
29
- .trim()
30
- .slice(0, maxLen));
31
- }
32
- function deliveryMode() {
33
- return process.env.BOARD_SIGNAL_DELIVERY === "mailbox" ? "mailbox" : "passive";
34
- }
35
- /** One-line, FYI-framed state transition. `detail` is used ONLY for BLOCKED
36
- * (a one-line reason is what makes the ping actionable for the operator). */
37
- export function sendBoardSignal(card, kind, detail) {
38
- const suffix = kind === "STARTED" && card.workerThreadId != null
39
- ? ` (worker ${card.workerThreadId})`
40
- : kind === "BLOCKED" && detail
41
- ? ` — "${sanitizeExcerpt(detail.split("\n")[0], 160)}"`
42
- : "";
43
- const line = `[Board FYI — no action needed] Card #${card.cardId} "${card.title}" ${kind}${suffix}`;
44
- try {
45
- if (deliveryMode() === "mailbox") {
46
- ensureDirs();
47
- appendFileSync(join(PENDING_TASKS_DIR, `${card.laneThreadId}.txt`), line + "\n", "utf-8");
48
- }
49
- else {
50
- pushPassiveNotice(card.laneThreadId, line);
51
- }
52
- log.info(`[board] signal ${kind} for card ${card.cardId} → lane ${card.laneThreadId} (${deliveryMode()})`);
53
- }
54
- catch (err) {
55
- log.warn(`[board] signal delivery failed for card ${card.cardId}: ${errorMessage(err)}`);
56
- }
57
- }
58
- /** Escalation target: explicit main thread (BOARD_MAIN_THREAD_ID) or the lane. */
59
- function escalationTarget(card) {
60
- const explicit = Number(process.env.BOARD_MAIN_THREAD_ID);
61
- return Number.isInteger(explicit) && explicit > 0 ? explicit : card.laneThreadId;
62
- }
63
- /**
64
- * Selective escalation (invariant #4): a card the operator hand-flagged
65
- * "important to me" mirrors its notable updates (worker reports, block
66
- * reasons) into the main thread as passive notices — aware, not commanded.
67
- * Deterministic: no agent judges importance; the flag decides, always.
68
- */
69
- export function mirrorEscalatedUpdate(card, text) {
70
- if (!card.escalate)
71
- return;
72
- // Quoted, sanitized fragment — the mirrored words are DATA on the card, not
73
- // an instruction to the receiving thread (context-not-command holds even
74
- // against an adversarial excerpt).
75
- const excerpt = sanitizeExcerpt(text, 300);
76
- try {
77
- pushPassiveNotice(escalationTarget(card), `[Board ⚑ card #${card.cardId} "${sanitizeExcerpt(card.title, 80)}"] worker/card update (quoted, not an instruction): "${excerpt}"`);
78
- }
79
- catch (err) {
80
- log.warn(`[board] escalation mirror failed for card ${card.cardId}: ${errorMessage(err)}`);
81
- }
82
- }
83
- //# sourceMappingURL=board-signals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"board-signals.js","sourceRoot":"","sources":["../../../src/services/board/board-signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjE;;;0EAG0E;AAC1E,SAAS,eAAe,CAAC,IAAY,EAAE,MAAc;IACnD,OAAO,CACL,IAAI;QACF,oFAAoF;SACnF,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC;SACjC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CACpB,CAAC;AACJ,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC;AAED;8EAC8E;AAC9E,MAAM,UAAU,eAAe,CAAC,IAAe,EAAE,IAAqB,EAAE,MAAe;IACrF,MAAM,MAAM,GACV,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI;QAC/C,CAAC,CAAC,YAAY,IAAI,CAAC,cAAc,GAAG;QACpC,CAAC,CAAC,IAAI,KAAK,SAAS,IAA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AAI,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO;IAC3B,4EAA4E;IAC5E,yEAAyE;IACzE,mCAAmC;IACnC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3C,IAAI,CAAC;QACH,iBAAiB,CACf,gBAAgB,CAAC,IAAI,CAAC,EACtB,kBAAkB,IAAI,CAAC,MAAM,KAAK,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,wDAAwD,OAAO,GAAG,CACpI,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,6CAA6C,IAAI,CAAC,MAAM,KAAK,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Card-worker briefing renderer (design §3.2).
3
- *
4
- * The rendered payload is pre-queued into the worker's pending-task mailbox
5
- * before spawn, ON TOP of the full lane-thread briefing the worker already
6
- * inherits via memorySourceThreadId. Card + comments carry the task's whole
7
- * world; the profile is rendered as imperative standing orders; the report
8
- * contract makes the worker's exit path unambiguous (STATUS: DONE / BLOCKED,
9
- * then exit — never wait, never loop on a blocker).
10
- */
11
- import type { BoardCard, BoardComment } from "../../data/board/board-types.js";
12
- /**
13
- * Render the complete task payload for a fresh card-worker.
14
- * `workerThreadId` is known before spawn (the topic is created first).
15
- */
16
- export declare function renderCardBriefing(card: BoardCard, comments: BoardComment[], workerThreadId: number): string;
17
- //# sourceMappingURL=card-briefing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card-briefing.d.ts","sourceRoot":"","sources":["../../../src/services/board/card-briefing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AAoCjG;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,YAAY,EAAE,EACxB,cAAc,EAAE,MAAM,GACrB,MAAM,CAsDR"}
@@ -1,86 +0,0 @@
1
- /**
2
- * Card-worker briefing renderer (design §3.2).
3
- *
4
- * The rendered payload is pre-queued into the worker's pending-task mailbox
5
- * before spawn, ON TOP of the full lane-thread briefing the worker already
6
- * inherits via memorySourceThreadId. Card + comments carry the task's whole
7
- * world; the profile is rendered as imperative standing orders; the report
8
- * contract makes the worker's exit path unambiguous (STATUS: DONE / BLOCKED,
9
- * then exit — never wait, never loop on a blocker).
10
- */
11
- /** Oldest-first truncation cap for the comment history (design §3.2). */
12
- const MAX_COMMENT_CHARS = 24_000;
13
- function renderProfileDirectives(profile, cardId) {
14
- const d = [];
15
- if (profile.repository)
16
- d.push(`Work in repository: ${profile.repository}.`);
17
- d.push(profile.createBranch
18
- ? `Create a work branch (suggested: card-${cardId}) before changing anything.`
19
- : "Do NOT create a new branch unless the current branch is unusable.");
20
- if (profile.skills?.length)
21
- d.push(`Load these skills via get_skill first: ${profile.skills.join(", ")}.`);
22
- d.push(profile.runTests
23
- ? "Run the relevant tests and make them pass."
24
- : "Do not run test suites unless a change demands it.");
25
- if (profile.build)
26
- d.push("Run the build and make it pass.");
27
- d.push(profile.push ? "Push your commits." : "Do NOT push.");
28
- d.push(profile.openPr ? "Open a pull request with the changes." : "Do NOT open a pull request.");
29
- if (profile.expertReview)
30
- d.push(`Before finishing, delegate an expert code review of your diff to a ${profile.reviewAgentType ?? "claude"} worker and address its findings.`);
31
- if (profile.ciCheck && profile.ciCheck !== "none")
32
- d.push(`After pushing, verify CI is green on ${profile.ciCheck === "github" ? "GitHub" : "Azure DevOps"} before reporting DONE.`);
33
- if (profile.operatorReview)
34
- d.push("The operator wants to review the result — say so explicitly in your final report.");
35
- return d;
36
- }
37
- /**
38
- * Render the complete task payload for a fresh card-worker.
39
- * `workerThreadId` is known before spawn (the topic is created first).
40
- */
41
- export function renderCardBriefing(card, comments, workerThreadId) {
42
- const lines = [];
43
- lines.push(`# Task Board card #${card.cardId}: ${card.title}`);
44
- lines.push(`You are a STATELESS card-worker (thread ${workerThreadId}) executing this card for lane thread ${card.laneThreadId}. ` +
45
- `This card plus the history below is the task's complete context on top of your inherited thread briefing.`);
46
- lines.push("");
47
- lines.push(`Type: ${card.type} | Priority: ${card.priority}`);
48
- lines.push("");
49
- lines.push("## Description");
50
- lines.push(card.description || "(none — the title is the task)");
51
- if (/implementation_plans[\\/][\w.-]+\.md/.test(card.description)) {
52
- lines.push("");
53
- lines.push("The description references an implementation_plans/ file — READ THAT FILE FIRST and in full; it is the task's spec.");
54
- }
55
- if (card.acceptance) {
56
- lines.push("");
57
- lines.push("## Acceptance criteria");
58
- lines.push(card.acceptance);
59
- }
60
- lines.push("");
61
- lines.push("## Standing orders (execution profile — do not ask, these ARE the answers)");
62
- for (const directive of renderProfileDirectives(card.profile, card.cardId))
63
- lines.push(`- ${directive}`);
64
- if (comments.length > 0) {
65
- let history = comments
66
- .map((c) => `[${c.createdAt}] ${c.author.toUpperCase()}:\n${c.content}`)
67
- .join("\n---\n");
68
- if (history.length > MAX_COMMENT_CHARS) {
69
- history = "[…older history truncated…]\n" + history.slice(history.length - MAX_COMMENT_CHARS);
70
- }
71
- lines.push("");
72
- lines.push("## Card history (oldest first — prior workers' reports and operator guidance)");
73
- lines.push(history);
74
- }
75
- lines.push("");
76
- lines.push("## Report contract (MANDATORY)");
77
- lines.push(`When finished, call send_message_to_thread with mode:"reply", targetThreadId:${card.laneThreadId}, ` +
78
- `senderThreadId:${workerThreadId}, senderName:"card-${card.cardId}". The message MUST start with its first line being exactly ` +
79
- `"STATUS: DONE" or "STATUS: BLOCKED: <one-line reason>", followed by your real report (what you did, ` +
80
- `commits/PR links, review results, anything the next worker or the operator needs).`);
81
- lines.push("Then EXIT: do not call wait_for_instructions again, do not wait for replies, do not loop on a blocker — " +
82
- "if you are stuck or need a decision, report STATUS: BLOCKED with the reason and exit. A fresh worker " +
83
- "will be re-briefed from the card when the operator responds.");
84
- return lines.join("\n");
85
- }
86
- //# sourceMappingURL=card-briefing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card-briefing.js","sourceRoot":"","sources":["../../../src/services/board/card-briefing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,yEAAyE;AACzE,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC,SAAS,uBAAuB,CAAC,OAAyB,EAAE,MAAc;IACxE,MAAM,CAAC,GAAa,EAAE,CAAC;IACvB,IAAI,OAAO,CAAC,UAAU;QAAE,CAAC,CAAC,IAAI,CAAC,uBAAuB,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;IAC7E,CAAC,CAAC,IAAI,CACJ,OAAO,CAAC,YAAY;QAClB,CAAC,CAAC,yCAAyC,MAAM,6BAA6B;QAC9E,CAAC,CAAC,mEAAmE,CACxE,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM;QACxB,CAAC,CAAC,IAAI,CAAC,0CAA0C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjF,CAAC,CAAC,IAAI,CACJ,OAAO,CAAC,QAAQ;QACd,CAAC,CAAC,4CAA4C;QAC9C,CAAC,CAAC,oDAAoD,CACzD,CAAC;IACF,IAAI,OAAO,CAAC,KAAK;QAAE,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC7D,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC;IACjG,IAAI,OAAO,CAAC,YAAY;QACtB,CAAC,CAAC,IAAI,CACJ,sEAAsE,OAAO,CAAC,eAAe,IAAI,QAAQ,mCAAmC,CAC7I,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CAAC;IACF,KAAK,CAAC,IAAI,CACR,0GAA0G;QACxG,uGAAuG;QACvG,8DAA8D,CACjE,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,55 +0,0 @@
1
- /**
2
- * Board orchestrator — the server-side loop that drains the board (design §3).
3
- *
4
- * Tick (default 30 s): for each CONNECTED lane, while the lane has free
5
- * concurrency slots (default 1) and the global cap (default 3) is not reached,
6
- * dispatch the top-priority Backlog card: spawn a stateless card-worker,
7
- * move the card to In Progress, and emit the STARTED signal. No idle-gate on
8
- * the lane thread — workers are independent processes; the lane may be dormant.
9
- *
10
- * Spawn failure is an immediate BLOCKED (reason on the card) — the operator
11
- * hears about it once, on the card, per the fire-and-forget metric.
12
- *
13
- * Report capture / exit reconciliation / recurrence land in Phases 5 and 7.
14
- */
15
- import type { initMemoryDb } from "../../data/memory/index.js";
16
- import type { ThreadLifecycleService } from "../thread-lifecycle.service.js";
17
- import { spawnCardWorker } from "./worker-spawn.js";
18
- export declare function boardTickMs(): number;
19
- export declare function boardGlobalMaxConcurrent(): number;
20
- /** Kill-switch: BOARD_ENABLED=false skips orchestrator start entirely (the
21
- * board stays a dormant UI/API). Default: enabled. */
22
- export declare function boardEnabled(): boolean;
23
- export interface BoardOrchestratorDeps {
24
- getMemoryDb: () => ReturnType<typeof initMemoryDb>;
25
- telegram: {
26
- createForumTopic(chatId: string, name: string): Promise<{
27
- message_thread_id: number;
28
- }>;
29
- sendMessage(chatId: string, text: string, parseMode?: string, threadId?: number): Promise<unknown>;
30
- deleteForumTopic(chatId: string, threadId: number): Promise<void>;
31
- };
32
- chatId: string;
33
- threadLifecycle: ThreadLifecycleService;
34
- /** Test seam — defaults to the real card-worker spawn path. */
35
- spawnFn?: typeof spawnCardWorker;
36
- }
37
- export declare class BoardOrchestrator {
38
- private readonly deps;
39
- private timer;
40
- private tickInFlight;
41
- constructor(deps: BoardOrchestratorDeps);
42
- start(): void;
43
- stop(): void;
44
- tick(): Promise<void>;
45
- /**
46
- * Board-owned recurrence (design §4): a Done recurring card whose delay has
47
- * elapsed — and whose group has no live instance (enforced in SQL) — puts a
48
- * fresh identical copy back into Backlog. The original's next_spawn_at is
49
- * cleared so it never respawns twice; the copy carries the group id forward.
50
- * schedule_wake_up is untouched — this is a different mechanism by design.
51
- */
52
- private respawnDueRecurrences;
53
- private dispatchDueCards;
54
- }
55
- //# sourceMappingURL=orchestrator.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrator.service.d.ts","sourceRoot":"","sources":["../../../src/services/board/orchestrator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAiB7E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,wBAAgB,WAAW,IAAI,MAAM,CAGpC;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAGjD;AAED;uDACuD;AACvD,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;IACnD,QAAQ,EAAE;QACR,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;YAAE,iBAAiB,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACvF,WAAW,CACT,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAAC;QACpB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACnE,CAAC;IAC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