@sema-agent/server 4.3.0 → 5.0.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.
Files changed (166) hide show
  1. package/USAGE.md +5 -3
  2. package/dist/approval-hmac.js +1 -1
  3. package/dist/approval.d.ts +5 -37
  4. package/dist/approval.js +12 -112
  5. package/dist/auth-bridge.d.ts +0 -1
  6. package/dist/auth-bridge.js +0 -1
  7. package/dist/auth-keys.d.ts +1 -1
  8. package/dist/auth-keys.js +1 -1
  9. package/dist/bench/s1/run-firm.js +1 -1
  10. package/dist/boot/config-center.d.ts +1 -1
  11. package/dist/boot/config-center.js +3 -2
  12. package/dist/boot/reapers.d.ts +1 -2
  13. package/dist/boot/reapers.js +4 -5
  14. package/dist/boot/resolve-spec.d.ts +1 -3
  15. package/dist/boot/resolve-spec.js +21 -35
  16. package/dist/boot/stores.js +1 -1
  17. package/dist/brain.js +3 -1
  18. package/dist/capabilities/center-prompts.d.ts +2 -3
  19. package/dist/capabilities/center-prompts.js +2 -3
  20. package/dist/capabilities/sandbox-file-send.d.ts +0 -2
  21. package/dist/capabilities/sandbox-file-send.js +2 -5
  22. package/dist/capabilities/scenarios.d.ts +0 -9
  23. package/dist/capabilities/scenarios.js +1 -20
  24. package/dist/capabilities/send-user-file-tool.js +3 -3
  25. package/dist/config-center/apply-effective.js +8 -8
  26. package/dist/config-center/types.d.ts +10 -3
  27. package/dist/config-provider.js +6 -11
  28. package/dist/config-types.d.ts +12 -26
  29. package/dist/config.js +95 -68
  30. package/dist/fleet/fleet-bus.js +25 -33
  31. package/dist/fleet-client.js +1 -1
  32. package/dist/http/active-run-conflict.d.ts +2 -0
  33. package/dist/http/active-run-conflict.js +1 -0
  34. package/dist/http/routes/approvals-assistant.d.ts +2 -1
  35. package/dist/http/routes/approvals-assistant.js +10 -96
  36. package/dist/http/routes/capabilities.js +6 -5
  37. package/dist/http/routes/fleet.js +4 -1
  38. package/dist/http/routes/images.js +10 -4
  39. package/dist/http/routes/runs.js +34 -49
  40. package/dist/http/routes/session-sync.d.ts +1 -1
  41. package/dist/http/routes/session-sync.js +2 -1
  42. package/dist/http/routes/tasks.js +7 -7
  43. package/dist/http/routes/trace-usage.js +1 -1
  44. package/dist/http/server.d.ts +1 -6
  45. package/dist/http/server.js +15 -10
  46. package/dist/http/verify-rounds.d.ts +2 -2
  47. package/dist/http/wire-types.d.ts +1 -1
  48. package/dist/images/bake-validate.d.ts +0 -22
  49. package/dist/images/bake-validate.js +0 -4
  50. package/dist/index.d.ts +4 -4
  51. package/dist/index.js +2 -5
  52. package/dist/main.js +5 -9
  53. package/dist/memory-scope.js +2 -2
  54. package/dist/orchestration/workflow-completion-inbox.d.ts +6 -4
  55. package/dist/orchestration/workflow-completion-inbox.js +6 -4
  56. package/dist/plugins/breaker-state-sql.d.ts +2 -3
  57. package/dist/plugins/image-index-sql.d.ts +0 -1
  58. package/dist/plugins/image-index-sql.js +0 -1
  59. package/dist/plugins/local-checkpoint-store.d.ts +1 -1
  60. package/dist/plugins/local-checkpoint-store.js +1 -1
  61. package/dist/plugins/memory-engine-pg.js +2 -1
  62. package/dist/plugins/memory-engine-tidb.js +1 -1
  63. package/dist/plugins/memory-engine-vector-util.d.ts +2 -3
  64. package/dist/plugins/memory-engine-vector-util.js +2 -3
  65. package/dist/plugins/memory-run-store.d.ts +1 -1
  66. package/dist/plugins/memory-session-policy-store.d.ts +1 -1
  67. package/dist/plugins/memory-session-policy-store.js +1 -1
  68. package/dist/plugins/memory-sync-store-pg.js +1 -1
  69. package/dist/plugins/pg-pool.js +8 -10
  70. package/dist/plugins/pg-rate-limiter.d.ts +1 -4
  71. package/dist/plugins/pg-rate-limiter.js +0 -1
  72. package/dist/plugins/roster-store-sql.d.ts +1 -3
  73. package/dist/plugins/roster-store-sql.js +3 -5
  74. package/dist/plugins/store-backend.d.ts +7 -17
  75. package/dist/plugins/store-backend.js +14 -30
  76. package/dist/plugins/tidb-pool.js +4 -28
  77. package/dist/plugins/workflow-journal-store-sql.d.ts +1 -1
  78. package/dist/plugins/workflow-journal-store-sql.js +1 -1
  79. package/dist/principal-jwt.js +2 -2
  80. package/dist/prompts-domain-validate.d.ts +4 -3
  81. package/dist/prompts-domain-validate.js +7 -8
  82. package/dist/router/route-orchestration.js +3 -3
  83. package/dist/run-local.js +5 -4
  84. package/dist/runs.js +8 -6
  85. package/dist/runtime-caps-resolver.d.ts +3 -2
  86. package/dist/runtime-caps-resolver.js +4 -4
  87. package/dist/runtime-governance.d.ts +4 -7
  88. package/dist/runtime-governance.js +12 -17
  89. package/dist/sealed-key.d.ts +1 -1
  90. package/dist/sealed-key.js +1 -1
  91. package/dist/security.d.ts +0 -5
  92. package/dist/security.js +8 -12
  93. package/dist/session-sync.d.ts +0 -2
  94. package/dist/session-sync.js +10 -17
  95. package/dist/spec-fields.js +6 -6
  96. package/dist/task-settings.js +7 -7
  97. package/dist/tool-approval.d.ts +3 -3
  98. package/dist/tool-approval.js +10 -10
  99. package/dist/trace/artifacts.d.ts +11 -0
  100. package/dist/trace/artifacts.js +8 -19
  101. package/dist/trace/ledger-sink.js +7 -1
  102. package/dist/trace/project.d.ts +17 -0
  103. package/dist/trace/project.js +55 -5
  104. package/package.json +2 -2
  105. package/dist/capabilities/oa-tools.d.ts +0 -15
  106. package/dist/capabilities/oa-tools.js +0 -54
  107. package/dist/plugins/approval-store-sql.d.ts +0 -116
  108. package/dist/plugins/approval-store-sql.js +0 -150
  109. package/dist/plugins/file-workflow-journal-store.d.ts +0 -12
  110. package/dist/plugins/file-workflow-journal-store.js +0 -12
  111. package/dist/plugins/pg-approval-store.d.ts +0 -9
  112. package/dist/plugins/pg-approval-store.js +0 -9
  113. package/dist/plugins/pg-breaker-state.d.ts +0 -8
  114. package/dist/plugins/pg-breaker-state.js +0 -8
  115. package/dist/plugins/pg-checkpoint-store.d.ts +0 -10
  116. package/dist/plugins/pg-checkpoint-store.js +0 -10
  117. package/dist/plugins/pg-file-snapshot-store.d.ts +0 -8
  118. package/dist/plugins/pg-file-snapshot-store.js +0 -8
  119. package/dist/plugins/pg-image-bake.d.ts +0 -12
  120. package/dist/plugins/pg-image-bake.js +0 -11
  121. package/dist/plugins/pg-image-index.d.ts +0 -12
  122. package/dist/plugins/pg-image-index.js +0 -11
  123. package/dist/plugins/pg-outcome-ledger.d.ts +0 -12
  124. package/dist/plugins/pg-outcome-ledger.js +0 -11
  125. package/dist/plugins/pg-resume-anchor-store.d.ts +0 -7
  126. package/dist/plugins/pg-resume-anchor-store.js +0 -7
  127. package/dist/plugins/pg-run-store.d.ts +0 -9
  128. package/dist/plugins/pg-run-store.js +0 -9
  129. package/dist/plugins/pg-session-policy-store.d.ts +0 -7
  130. package/dist/plugins/pg-session-policy-store.js +0 -7
  131. package/dist/plugins/pg-session-store.d.ts +0 -12
  132. package/dist/plugins/pg-session-store.js +0 -12
  133. package/dist/plugins/pg-tool-result-store.d.ts +0 -9
  134. package/dist/plugins/pg-tool-result-store.js +0 -9
  135. package/dist/plugins/pg-workflow-journal-store.d.ts +0 -9
  136. package/dist/plugins/pg-workflow-journal-store.js +0 -9
  137. package/dist/plugins/pg-workflow-run-store.d.ts +0 -9
  138. package/dist/plugins/pg-workflow-run-store.js +0 -9
  139. package/dist/plugins/tidb-approval-store.d.ts +0 -8
  140. package/dist/plugins/tidb-approval-store.js +0 -8
  141. package/dist/plugins/tidb-breaker-state.d.ts +0 -7
  142. package/dist/plugins/tidb-breaker-state.js +0 -7
  143. package/dist/plugins/tidb-checkpoint-store.d.ts +0 -9
  144. package/dist/plugins/tidb-checkpoint-store.js +0 -9
  145. package/dist/plugins/tidb-file-snapshot-store.d.ts +0 -8
  146. package/dist/plugins/tidb-file-snapshot-store.js +0 -8
  147. package/dist/plugins/tidb-image-bake.d.ts +0 -12
  148. package/dist/plugins/tidb-image-bake.js +0 -11
  149. package/dist/plugins/tidb-image-index.d.ts +0 -12
  150. package/dist/plugins/tidb-image-index.js +0 -11
  151. package/dist/plugins/tidb-outcome-ledger.d.ts +0 -12
  152. package/dist/plugins/tidb-outcome-ledger.js +0 -12
  153. package/dist/plugins/tidb-resume-anchor-store.d.ts +0 -7
  154. package/dist/plugins/tidb-resume-anchor-store.js +0 -7
  155. package/dist/plugins/tidb-run-store.d.ts +0 -10
  156. package/dist/plugins/tidb-run-store.js +0 -9
  157. package/dist/plugins/tidb-session-policy-store.d.ts +0 -7
  158. package/dist/plugins/tidb-session-policy-store.js +0 -7
  159. package/dist/plugins/tidb-tool-result-store.d.ts +0 -8
  160. package/dist/plugins/tidb-tool-result-store.js +0 -10
  161. package/dist/plugins/tidb-workflow-journal-store.d.ts +0 -9
  162. package/dist/plugins/tidb-workflow-journal-store.js +0 -9
  163. package/dist/plugins/tidb-workflow-run-store.d.ts +0 -10
  164. package/dist/plugins/tidb-workflow-run-store.js +0 -10
  165. package/dist/plugins/workflow-journal-limits.d.ts +0 -12
  166. package/dist/plugins/workflow-journal-limits.js +0 -12
@@ -1,116 +0,0 @@
1
- /**
2
- * Durable approval store for the human-in-the-loop write gate (F4) — SINGLE-FILE DUAL-DIALECT
3
- * (design/158 A12 定型半场). ONE implementation, TWO dialects; the historical `TiDBApprovalStore` /
4
- * `PgApprovalStore` class names survive as thin ctor subclasses so every consumer (store-backend.ts,
5
- * src/index.ts, the approval/audit/security-coverage suites) is untouched.
6
- *
7
- * When a gated tool call is about to run, a `pending` row is recorded here; the instance running the
8
- * task polls it for a decision. Because the row is durable and shared, an operator's approve/deny can
9
- * land on ANY instance — critical under async runs + a load balancer, where the deciding request and
10
- * the waiting run are usually on different instances.
11
- *
12
- * Unlike the run/checkpoint PG store (whose schema is owned centrally by pg-pool.ts), this file also
13
- * exports a self-contained PG schema (`PG_APPROVAL_SCHEMA` + `ensureSchema`) — the `approval` table is
14
- * DISJOINT from the other PG stores' tables, so a CREATE IF NOT EXISTS here shadows nothing. Central
15
- * aggregation into pg-pool.ts composes it alongside the others. Kept in lock-step with the TiDB store
16
- * by the shared real-DB integration suite (test/pg-approval-store-integration.test.ts).
17
- *
18
- * ── Dialect deltas, kept EXPLICIT ────────────────────────────────────────────────────────────────────
19
- * - `?` placeholders vs `$n`
20
- * - null-safe scope compare: `<=>` vs `IS NOT DISTINCT FROM` (a NULL scope row — legacy/untenanted
21
- * run — is matched by a NULL scope arg; one tenant's scope NEVER matches another's — the
22
- * single-DB fleet read guard, defense-in-depth)
23
- * - JSON binding: TiDB `JSON.stringify` verbatim vs PG `pgProtocolJsonStringify` (codex R4-H2: the
24
- * persisted approval `args` is the operator's REVIEW surface and must agree byte-for-byte with the
25
- * policy-executed args — a lossy/rewriting envelope would let an operator approve one payload while
26
- * a different one runs)
27
- * - affectedRows vs rowCount (via SqlDriver)
28
- * - schema ownership: TiDB DDL lives in tidb-pool.ts SCHEMA_STATEMENTS; PG DDL is this file's own
29
- * self-contained `PG_APPROVAL_SCHEMA` (see the PG twin's original header — unlike the other PG
30
- * stores, `approval` is NOT centrally owned by pg-pool.ts's DDL array, only aggregated into its
31
- * `ensureSchema` composition).
32
- * - `getStatus` result shape: `RowDataPacket[]` (mysql2 typed query) vs a plain-record `pg` query —
33
- * normalized to `SqlRow` by the shared driver, so both arms read the same field names.
34
- */
35
- import type { Pool as MySqlPool } from "mysql2/promise";
36
- import type { Pool as PgPool, PoolClient } from "pg";
37
- import { type SqlDriver } from "./sql-driver.js";
38
- export type ApprovalStatus = "pending" | "approved" | "denied" | "expired";
39
- export interface ApprovalRow {
40
- id: string;
41
- taskId: string | null;
42
- sessionId: string | null;
43
- owner: string | null;
44
- /** Single-DB fleet scope guard (defense-in-depth): the run's tenant identity, owner-sourced. Reads filter on it. */
45
- scope: string | null;
46
- toolName: string;
47
- args: unknown;
48
- status: ApprovalStatus;
49
- reason: string | null;
50
- decidedBy: string | null;
51
- createdAt: string;
52
- decidedAt: string | null;
53
- }
54
- /** PG translation of the `approval` DDL in tidb-pool.ts SCHEMA_STATEMENTS (JSON→JSONB, DATETIME(3)→TIMESTAMPTZ(3),
55
- * inline KEY→separate CREATE INDEX).
56
- *
57
- * SCHEMA POLICY: see the header of pg-pool.ts — the code is the single source of truth, schema changes are
58
- * drop-and-recreate, and NO new `ALTER TABLE` seams are added here; fold into the CREATE instead. */
59
- export declare const PG_APPROVAL_SCHEMA: string[];
60
- /** Idempotent self-contained schema apply (for the integration test; central aggregation is done separately). */
61
- export declare function ensureSchema(pool: PgPool | PoolClient): Promise<void>;
62
- /** Dual-dialect durable approval store. See the file header for the dialect-delta ledger. */
63
- export declare class SqlApprovalStore {
64
- protected readonly db: SqlDriver;
65
- constructor(db: SqlDriver);
66
- /** Pick the dialect's SQL text. Both statements stay written out at the call site ON PURPOSE. */
67
- private q;
68
- /** JSON column binding: TiDB stores the string verbatim; PG goes through the LOSSLESS protocol envelope
69
- * (codex R4-H2 — the approval `args` is the operator's review surface and must agree with the
70
- * policy-executed args at the NUL position). */
71
- private json;
72
- createPending(id: string, scope: string | null, ctx: {
73
- taskId?: string | null;
74
- sessionId?: string | null;
75
- owner?: string | null;
76
- toolName: string;
77
- args: unknown;
78
- }): Promise<void>;
79
- getStatus(id: string, scope: string | null): Promise<{
80
- status: ApprovalStatus;
81
- reason: string | null;
82
- decidedBy: string | null;
83
- } | undefined>;
84
- /** Apply a terminal decision, but only to a still-pending row (CAS). Returns whether it applied. The scope
85
- * guard (null-safe) is carried on the operator path too for consistency with the read paths. */
86
- decide(id: string, scope: string | null, decision: "approved" | "denied" | "expired", reason: string | null, decidedBy: string | null): Promise<boolean>;
87
- /** Pending approvals (operator queue), scoped to one tenant (single-DB fleet read guard, null-safe), optionally
88
- * further filtered to one owner. */
89
- listPending(scope: string | null, owner?: string): Promise<ApprovalRow[]>;
90
- get(id: string, scope: string | null): Promise<ApprovalRow | undefined>;
91
- /** Operator-only CROSS-tenant by-id read (no scope filter). The F4 operator queue serves/decides across
92
- * tenants by design; the HTTP layer gates this to an operator and then re-binds decide() to the row's OWN
93
- * scope. Tenants NEVER reach this — they use the scope-bound {@link get}. */
94
- getById(id: string): Promise<ApprovalRow | undefined>;
95
- /** Operator-only CROSS-tenant pending list (no scope filter) — the unfiltered operator queue across all
96
- * tenants. Tenants use the scope-bound {@link listPending}; this is HTTP-gated to an operator.
97
- * 🔴 identical SQL text on both dialects (no placeholders, nothing dialect-specific) — kept as ONE literal
98
- * rather than a `q()` pair so a reader isn't misled into looking for a divergence that isn't there. */
99
- listPendingAll(): Promise<ApprovalRow[]>;
100
- /** Expire pending approvals older than `olderThanMs` (a never-answered operator request). Deliberately GLOBAL
101
- * (NOT scope-filtered): staleness expiry is fleet-level maintenance that protects the worker regardless of
102
- * tenant — a stale row in any scope must be reaped. Scope isolation applies to the per-tenant READ paths, not
103
- * to this maintenance sweep. */
104
- expireStale(olderThanMs: number): Promise<number>;
105
- }
106
- /** approval row → {@link ApprovalRow} — shared by BOTH dialects. design/158 S8 归位 / A12 收编. */
107
- export declare function mapRow(r: Record<string, unknown>): ApprovalRow;
108
- /** MySQL-protocol (TiDB) binding — historical class name + ctor shape preserved. */
109
- export declare class TiDBApprovalStore extends SqlApprovalStore {
110
- constructor(pool: MySqlPool);
111
- }
112
- /** PostgreSQL binding — historical class name + ctor shape preserved. */
113
- export declare class PgApprovalStore extends SqlApprovalStore {
114
- constructor(pool: PgPool);
115
- }
116
- //# sourceMappingURL=approval-store-sql.d.ts.map
@@ -1,150 +0,0 @@
1
- import { parseJsonStrict as parseJson, toIsoOrNull as iso } from "./sql-row-helpers.js";
2
- import { mysqlDriver, pgDriver, dialectProtocolJsonEncoder } from "./sql-driver.js";
3
- /** PG translation of the `approval` DDL in tidb-pool.ts SCHEMA_STATEMENTS (JSON→JSONB, DATETIME(3)→TIMESTAMPTZ(3),
4
- * inline KEY→separate CREATE INDEX).
5
- *
6
- * SCHEMA POLICY: see the header of pg-pool.ts — the code is the single source of truth, schema changes are
7
- * drop-and-recreate, and NO new `ALTER TABLE` seams are added here; fold into the CREATE instead. */
8
- export const PG_APPROVAL_SCHEMA = [
9
- `CREATE TABLE IF NOT EXISTS approval (
10
- id VARCHAR(64) NOT NULL,
11
- task_id VARCHAR(64),
12
- session_id VARCHAR(64),
13
- owner VARCHAR(190),
14
- -- Single-DB fleet scope guard (tenant isolation). NULLABLE on purpose: a NULL-scope row is an untenanted
15
- -- run, and every read/decide path matches it with \`scope IS NOT DISTINCT FROM $n\` (the PG twin of TiDB
16
- -- \`<=>\`) so NULL matches only NULL and one tenant's scope NEVER matches another's.
17
- scope VARCHAR(190),
18
- tool_name VARCHAR(190) NOT NULL,
19
- args JSONB,
20
- status VARCHAR(16) NOT NULL,
21
- reason TEXT,
22
- decided_by VARCHAR(190),
23
- created_at TIMESTAMPTZ(3) NOT NULL,
24
- decided_at TIMESTAMPTZ(3),
25
- PRIMARY KEY (id)
26
- )`,
27
- `CREATE INDEX IF NOT EXISTS idx_approval_owner_status ON approval (owner, status)`,
28
- `CREATE INDEX IF NOT EXISTS idx_approval_status ON approval (status)`,
29
- `CREATE INDEX IF NOT EXISTS idx_approval_scope_status ON approval (scope, status)`,
30
- ];
31
- /** Idempotent self-contained schema apply (for the integration test; central aggregation is done separately). */
32
- export async function ensureSchema(pool) {
33
- for (const stmt of PG_APPROVAL_SCHEMA)
34
- await pool.query(stmt);
35
- }
36
- /** Dual-dialect durable approval store. See the file header for the dialect-delta ledger. */
37
- export class SqlApprovalStore {
38
- db;
39
- constructor(db) {
40
- this.db = db;
41
- }
42
- /** Pick the dialect's SQL text. Both statements stay written out at the call site ON PURPOSE. */
43
- q(tidb, pg) {
44
- return this.db.dialect === "tidb" ? tidb : pg;
45
- }
46
- /** JSON column binding: TiDB stores the string verbatim; PG goes through the LOSSLESS protocol envelope
47
- * (codex R4-H2 — the approval `args` is the operator's review surface and must agree with the
48
- * policy-executed args at the NUL position). */
49
- json(value, label) {
50
- return dialectProtocolJsonEncoder(this.db.dialect)(value, label);
51
- }
52
- async createPending(id, scope, ctx) {
53
- await this.db.query(this.q("INSERT INTO approval (id, task_id, session_id, owner, scope, tool_name, args, status, created_at) " +
54
- "VALUES (?,?,?,?,?,?,?,'pending',?)", "INSERT INTO approval (id, task_id, session_id, owner, scope, tool_name, args, status, created_at) " +
55
- "VALUES ($1,$2,$3,$4,$5,$6,$7::jsonb,'pending',$8)"), [
56
- id,
57
- ctx.taskId ?? null,
58
- ctx.sessionId ?? null,
59
- ctx.owner ?? null,
60
- scope,
61
- ctx.toolName,
62
- ctx.args == null ? null : this.json(ctx.args, "approval args"),
63
- new Date(),
64
- ]);
65
- }
66
- async getStatus(id, scope) {
67
- // null-safe scope match (`<=>` / `IS NOT DISTINCT FROM`): a NULL scope row (legacy / untenanted run) is
68
- // matched by a NULL scope arg, and a tenant's scope NEVER matches another tenant's — the single-DB fleet
69
- // read guard (defense-in-depth).
70
- const { rows } = await this.db.query(this.q("SELECT status, reason, decided_by FROM approval WHERE id = ? AND scope <=> ?", "SELECT status, reason, decided_by FROM approval WHERE id = $1 AND scope IS NOT DISTINCT FROM $2"), [id, scope]);
71
- const r = rows[0];
72
- if (!r)
73
- return undefined;
74
- return { status: r.status, reason: r.reason ?? null, decidedBy: r.decided_by ?? null };
75
- }
76
- /** Apply a terminal decision, but only to a still-pending row (CAS). Returns whether it applied. The scope
77
- * guard (null-safe) is carried on the operator path too for consistency with the read paths. */
78
- async decide(id, scope, decision, reason, decidedBy) {
79
- const res = await this.db.query(this.q("UPDATE approval SET status = ?, reason = ?, decided_by = ?, decided_at = ? WHERE id = ? AND scope <=> ? AND status = 'pending'", "UPDATE approval SET status = $1, reason = $2, decided_by = $3, decided_at = $4 WHERE id = $5 AND scope IS NOT DISTINCT FROM $6 AND status = 'pending'"), [decision, reason, decidedBy, new Date(), id, scope]);
80
- return res.affected === 1;
81
- }
82
- /** Pending approvals (operator queue), scoped to one tenant (single-DB fleet read guard, null-safe), optionally
83
- * further filtered to one owner. */
84
- async listPending(scope, owner) {
85
- const { rows } = owner
86
- ? await this.db.query(this.q("SELECT * FROM approval WHERE status = 'pending' AND scope <=> ? AND owner = ? ORDER BY created_at ASC", "SELECT * FROM approval WHERE status = 'pending' AND scope IS NOT DISTINCT FROM $1 AND owner = $2 ORDER BY created_at ASC"), [scope, owner])
87
- : await this.db.query(this.q("SELECT * FROM approval WHERE status = 'pending' AND scope <=> ? ORDER BY created_at ASC", "SELECT * FROM approval WHERE status = 'pending' AND scope IS NOT DISTINCT FROM $1 ORDER BY created_at ASC"), [scope]);
88
- return rows.map(mapRow);
89
- }
90
- async get(id, scope) {
91
- const { rows } = await this.db.query(this.q("SELECT * FROM approval WHERE id = ? AND scope <=> ?", "SELECT * FROM approval WHERE id = $1 AND scope IS NOT DISTINCT FROM $2"), [id, scope]);
92
- return rows[0] ? mapRow(rows[0]) : undefined;
93
- }
94
- /** Operator-only CROSS-tenant by-id read (no scope filter). The F4 operator queue serves/decides across
95
- * tenants by design; the HTTP layer gates this to an operator and then re-binds decide() to the row's OWN
96
- * scope. Tenants NEVER reach this — they use the scope-bound {@link get}. */
97
- async getById(id) {
98
- const { rows } = await this.db.query(this.q("SELECT * FROM approval WHERE id = ?", "SELECT * FROM approval WHERE id = $1"), [id]);
99
- return rows[0] ? mapRow(rows[0]) : undefined;
100
- }
101
- /** Operator-only CROSS-tenant pending list (no scope filter) — the unfiltered operator queue across all
102
- * tenants. Tenants use the scope-bound {@link listPending}; this is HTTP-gated to an operator.
103
- * 🔴 identical SQL text on both dialects (no placeholders, nothing dialect-specific) — kept as ONE literal
104
- * rather than a `q()` pair so a reader isn't misled into looking for a divergence that isn't there. */
105
- async listPendingAll() {
106
- const { rows } = await this.db.query("SELECT * FROM approval WHERE status = 'pending' ORDER BY created_at ASC");
107
- return rows.map(mapRow);
108
- }
109
- /** Expire pending approvals older than `olderThanMs` (a never-answered operator request). Deliberately GLOBAL
110
- * (NOT scope-filtered): staleness expiry is fleet-level maintenance that protects the worker regardless of
111
- * tenant — a stale row in any scope must be reaped. Scope isolation applies to the per-tenant READ paths, not
112
- * to this maintenance sweep. */
113
- async expireStale(olderThanMs) {
114
- const cutoff = new Date(Date.now() - olderThanMs);
115
- const res = await this.db.query(this.q("UPDATE approval SET status = 'expired', reason = 'timed out before decision', decided_at = ? " +
116
- "WHERE status = 'pending' AND created_at < ?", "UPDATE approval SET status = 'expired', reason = 'timed out before decision', decided_at = $1 " +
117
- "WHERE status = 'pending' AND created_at < $2"), [new Date(), cutoff]);
118
- return res.affected;
119
- }
120
- }
121
- /** approval row → {@link ApprovalRow} — shared by BOTH dialects. design/158 S8 归位 / A12 收编. */
122
- export function mapRow(r) {
123
- return {
124
- id: String(r.id),
125
- taskId: r.task_id ?? null,
126
- sessionId: r.session_id ?? null,
127
- owner: r.owner ?? null,
128
- scope: r.scope ?? null,
129
- toolName: String(r.tool_name),
130
- args: parseJson(r.args),
131
- status: r.status,
132
- reason: r.reason ?? null,
133
- decidedBy: r.decided_by ?? null,
134
- createdAt: iso(r.created_at),
135
- decidedAt: iso(r.decided_at),
136
- };
137
- }
138
- /** MySQL-protocol (TiDB) binding — historical class name + ctor shape preserved. */
139
- export class TiDBApprovalStore extends SqlApprovalStore {
140
- constructor(pool) {
141
- super(mysqlDriver(pool));
142
- }
143
- }
144
- /** PostgreSQL binding — historical class name + ctor shape preserved. */
145
- export class PgApprovalStore extends SqlApprovalStore {
146
- constructor(pool) {
147
- super(pgDriver(pool));
148
- }
149
- }
150
- //# sourceMappingURL=approval-store-sql.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * SVC-2 — FILE-backed durable WorkflowJournalStore for the LOCAL (TOC) backend.
3
- *
4
- * Now a RE-EXPORT of core's copy (the write-here-then-core-adopts 剧本): the implementation was written here for server
5
- * 1.89.0, then adopted verbatim by core (`@sema-agent/core` 1.223.0, file
6
- * `src/stores/file/workflow-journal-store.ts` — crash-safe per-run JSONL, scope-guarded [CORE-9],
7
- * idempotent-per-ordinal, oversize skip-journal, traversal-runId load degrade, 0o600/0o700). One source of
8
- * truth in core; the SQL twins (tidb/pg) stay service-side (dialect = deployment glue). The service test
9
- * suite (test/file-workflow-journal-store.test.ts) keeps pinning the contract through this re-export.
10
- */
11
- export { FileWorkflowJournalStore } from "@sema-agent/core";
12
- //# sourceMappingURL=file-workflow-journal-store.d.ts.map
@@ -1,12 +0,0 @@
1
- /**
2
- * SVC-2 — FILE-backed durable WorkflowJournalStore for the LOCAL (TOC) backend.
3
- *
4
- * Now a RE-EXPORT of core's copy (the write-here-then-core-adopts 剧本): the implementation was written here for server
5
- * 1.89.0, then adopted verbatim by core (`@sema-agent/core` 1.223.0, file
6
- * `src/stores/file/workflow-journal-store.ts` — crash-safe per-run JSONL, scope-guarded [CORE-9],
7
- * idempotent-per-ordinal, oversize skip-journal, traversal-runId load degrade, 0o600/0o700). One source of
8
- * truth in core; the SQL twins (tidb/pg) stay service-side (dialect = deployment glue). The service test
9
- * suite (test/file-workflow-journal-store.test.ts) keeps pinning the contract through this re-export.
10
- */
11
- export { FileWorkflowJournalStore } from "@sema-agent/core";
12
- //# sourceMappingURL=file-workflow-journal-store.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编 — see src/plugins/approval-store-sql.ts for the
3
- * implementation, now SINGLE-FILE DUAL-DIALECT alongside the TiDB twin). Class name, ctor arity,
4
- * and every exported type/const/helper stay EXACTLY as they were so no consumer (pg-pool.ts's
5
- * central schema composition, store-backend.ts, test/pg-approval-store-integration.test.ts) has
6
- * to move.
7
- */
8
- export { PgApprovalStore, PG_APPROVAL_SCHEMA, ensureSchema, type ApprovalRow, type ApprovalStatus, } from "./approval-store-sql.js";
9
- //# sourceMappingURL=pg-approval-store.d.ts.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编 — see src/plugins/approval-store-sql.ts for the
3
- * implementation, now SINGLE-FILE DUAL-DIALECT alongside the TiDB twin). Class name, ctor arity,
4
- * and every exported type/const/helper stay EXACTLY as they were so no consumer (pg-pool.ts's
5
- * central schema composition, store-backend.ts, test/pg-approval-store-integration.test.ts) has
6
- * to move.
7
- */
8
- export { PgApprovalStore, PG_APPROVAL_SCHEMA, ensureSchema, } from "./approval-store-sql.js";
9
- //# sourceMappingURL=pg-approval-store.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Re-export shim (design/158 A12 收编) — the real implementation moved to breaker-state-sql.ts
3
- * (single-file dual-dialect: `SqlBreakerState` + the `TiDBBreakerState`/`PgBreakerState` ctor subclasses).
4
- * Kept so every consumer's `from "./pg-breaker-state.js"` import (incl. pg-pool.ts's central ensureSchema
5
- * composition and the real dual-DB integration suite) keeps working unchanged.
6
- */
7
- export { PgBreakerState, PG_BREAKER_STATE_SCHEMA, ensureSchema } from "./breaker-state-sql.js";
8
- //# sourceMappingURL=pg-breaker-state.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Re-export shim (design/158 A12 收编) — the real implementation moved to breaker-state-sql.ts
3
- * (single-file dual-dialect: `SqlBreakerState` + the `TiDBBreakerState`/`PgBreakerState` ctor subclasses).
4
- * Kept so every consumer's `from "./pg-breaker-state.js"` import (incl. pg-pool.ts's central ensureSchema
5
- * composition and the real dual-DB integration suite) keeps working unchanged.
6
- */
7
- export { PgBreakerState, PG_BREAKER_STATE_SCHEMA, ensureSchema } from "./breaker-state-sql.js";
8
- //# sourceMappingURL=pg-breaker-state.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * PostgreSQL `CheckpointStore` — the implementation now lives in the single-file dual-dialect
3
- * `checkpoint-store-sql.ts` (design/158 A12 定型半场), alongside its TiDB twin so the dialect deltas
4
- * (placeholders, ON CONFLICT, `IS NOT DISTINCT FROM` + its placeholder-arity consequence, the lossless
5
- * JSON envelope) read side by side instead of drifting across two files.
6
- *
7
- * This file is the historical import path: class name and ctor shape unchanged.
8
- */
9
- export { PgCheckpointStore } from "./checkpoint-store-sql.js";
10
- //# sourceMappingURL=pg-checkpoint-store.d.ts.map
@@ -1,10 +0,0 @@
1
- /**
2
- * PostgreSQL `CheckpointStore` — the implementation now lives in the single-file dual-dialect
3
- * `checkpoint-store-sql.ts` (design/158 A12 定型半场), alongside its TiDB twin so the dialect deltas
4
- * (placeholders, ON CONFLICT, `IS NOT DISTINCT FROM` + its placeholder-arity consequence, the lossless
5
- * JSON envelope) read side by side instead of drifting across two files.
6
- *
7
- * This file is the historical import path: class name and ctor shape unchanged.
8
- */
9
- export { PgCheckpointStore } from "./checkpoint-store-sql.js";
10
- //# sourceMappingURL=pg-checkpoint-store.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 定型半场) — the real implementation collapsed into
3
- * `file-snapshot-store-sql.ts` (single file, dual dialect). Kept so every existing import path
4
- * (store-backend.ts, the migration script, the contract/integration/minio-equivalence suites) is
5
- * untouched: same class name, same ctor arity, same exported surface.
6
- */
7
- export { PgFileSnapshotStore } from "./file-snapshot-store-sql.js";
8
- //# sourceMappingURL=pg-file-snapshot-store.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 定型半场) — the real implementation collapsed into
3
- * `file-snapshot-store-sql.ts` (single file, dual dialect). Kept so every existing import path
4
- * (store-backend.ts, the migration script, the contract/integration/minio-equivalence suites) is
5
- * untouched: same class name, same ctor arity, same exported surface.
6
- */
7
- export { PgFileSnapshotStore } from "./file-snapshot-store-sql.js";
8
- //# sourceMappingURL=pg-file-snapshot-store.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * PostgreSQL BAKE store — the implementation now lives in the single-file dual-dialect
3
- * `image-bake-store-sql.ts` (design/158 A12 定型半场), alongside its TiDB twin so the dialect deltas
4
- * (placeholders, ON CONFLICT, jsonb casts, the admission-statement divergence, the PG-only
5
- * protocol-byte defenses) read side by side instead of drifting across two files.
6
- *
7
- * This file is the historical import path: class name, ctor shape, `PG_IMAGE_BAKE_SCHEMA` and
8
- * `ensureSchema` are unchanged, so pg-pool.ts / store-backend.ts / the integration suite are untouched.
9
- */
10
- export { PgImageBake, PG_IMAGE_BAKE_SCHEMA, ensurePgImageBakeSchema as ensureSchema } from "./image-bake-store-sql.js";
11
- export type { BakeStatus, BakeState, BakeErrorCode, BakeRecord, BakeEvent, CreateBakeInput, BakeTerminal, } from "./store-contracts.js";
12
- //# sourceMappingURL=pg-image-bake.d.ts.map
@@ -1,11 +0,0 @@
1
- /**
2
- * PostgreSQL BAKE store — the implementation now lives in the single-file dual-dialect
3
- * `image-bake-store-sql.ts` (design/158 A12 定型半场), alongside its TiDB twin so the dialect deltas
4
- * (placeholders, ON CONFLICT, jsonb casts, the admission-statement divergence, the PG-only
5
- * protocol-byte defenses) read side by side instead of drifting across two files.
6
- *
7
- * This file is the historical import path: class name, ctor shape, `PG_IMAGE_BAKE_SCHEMA` and
8
- * `ensureSchema` are unchanged, so pg-pool.ts / store-backend.ts / the integration suite are untouched.
9
- */
10
- export { PgImageBake, PG_IMAGE_BAKE_SCHEMA, ensurePgImageBakeSchema as ensureSchema } from "./image-bake-store-sql.js";
11
- //# sourceMappingURL=pg-image-bake.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * PostgreSQL-backed sandbox-image-pool INDEX store — the PG twin of {@link TiDBImageIndex}
3
- * (src/plugins/tidb-image-index.ts).
4
- *
5
- * Thin re-export shim (design/158 A12 定型半场): the real implementation is the single-file dual-dialect
6
- * `image-index-sql.ts` (`SqlImageIndex` + this file's `PgImageIndex` ctor subclass). Class name, ctor
7
- * arity, and the exported type/schema surface are UNCHANGED — every consumer (store-backend.ts, pg-pool.ts,
8
- * the real-DB integration suite) imports from here exactly as before.
9
- */
10
- export { PgImageIndex, PG_IMAGE_INDEX_SCHEMA, ensureSchema } from "./image-index-sql.js";
11
- export type { ImageNestedBuildMode, ImageCapabilities, ImagePodContract, ImageStatus, ImageVisibility, ImageIndexEntry, ImageIndexUpsert, ImageViewer, ImageListFilter, } from "./store-contracts.js";
12
- //# sourceMappingURL=pg-image-index.d.ts.map
@@ -1,11 +0,0 @@
1
- /**
2
- * PostgreSQL-backed sandbox-image-pool INDEX store — the PG twin of {@link TiDBImageIndex}
3
- * (src/plugins/tidb-image-index.ts).
4
- *
5
- * Thin re-export shim (design/158 A12 定型半场): the real implementation is the single-file dual-dialect
6
- * `image-index-sql.ts` (`SqlImageIndex` + this file's `PgImageIndex` ctor subclass). Class name, ctor
7
- * arity, and the exported type/schema surface are UNCHANGED — every consumer (store-backend.ts, pg-pool.ts,
8
- * the real-DB integration suite) imports from here exactly as before.
9
- */
10
- export { PgImageIndex, PG_IMAGE_INDEX_SCHEMA, ensureSchema } from "./image-index-sql.js";
11
- //# sourceMappingURL=pg-image-index.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * PostgreSQL outcome ledger — the implementation now lives in the single-file dual-dialect
3
- * `outcome-ledger-sql.ts` (design/158 A12 定型半场), alongside its TiDB twin so the dialect deltas
4
- * (placeholders, JSON encode, the AVG boolean-coercion divergence) read side by side instead of
5
- * drifting across two files.
6
- *
7
- * This file is the historical import path: class name, `PG_OUTCOME_LEDGER_SCHEMA` and `ensureSchema`
8
- * are unchanged, so pg-pool.ts / store-backend.ts / the integration suite are untouched.
9
- */
10
- export { PgOutcomeLedger, PG_OUTCOME_LEDGER_SCHEMA, ensurePgOutcomeLedgerSchema as ensureSchema, } from "./outcome-ledger-sql.js";
11
- export type { TaskOutcome, RunStatus } from "./outcome-ledger-sql.js";
12
- //# sourceMappingURL=pg-outcome-ledger.d.ts.map
@@ -1,11 +0,0 @@
1
- /**
2
- * PostgreSQL outcome ledger — the implementation now lives in the single-file dual-dialect
3
- * `outcome-ledger-sql.ts` (design/158 A12 定型半场), alongside its TiDB twin so the dialect deltas
4
- * (placeholders, JSON encode, the AVG boolean-coercion divergence) read side by side instead of
5
- * drifting across two files.
6
- *
7
- * This file is the historical import path: class name, `PG_OUTCOME_LEDGER_SCHEMA` and `ensureSchema`
8
- * are unchanged, so pg-pool.ts / store-backend.ts / the integration suite are untouched.
9
- */
10
- export { PgOutcomeLedger, PG_OUTCOME_LEDGER_SCHEMA, ensurePgOutcomeLedgerSchema as ensureSchema, } from "./outcome-ledger-sql.js";
11
- //# sourceMappingURL=pg-outcome-ledger.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编) — the real implementation moved to the single-file
3
- * dual-dialect `resume-anchor-store-sql.ts` (shared with the TiDB twin via `SqlDriver`). Kept so
4
- * consumers importing this path (store-backend.ts, the resume-anchor integration suite) don't move.
5
- */
6
- export { PgResumeAnchorStore } from "./resume-anchor-store-sql.js";
7
- //# sourceMappingURL=pg-resume-anchor-store.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编) — the real implementation moved to the single-file
3
- * dual-dialect `resume-anchor-store-sql.ts` (shared with the TiDB twin via `SqlDriver`). Kept so
4
- * consumers importing this path (store-backend.ts, the resume-anchor integration suite) don't move.
5
- */
6
- export { PgResumeAnchorStore } from "./resume-anchor-store-sql.js";
7
- //# sourceMappingURL=pg-resume-anchor-store.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 定型半场 collapse): the real implementation now lives in
3
- * `run-store-sql.ts` (single-file dual-dialect — TiDB + PG share one `SqlRunStore` body, dialect deltas
4
- * kept EXPLICIT per statement). `PgRunStore`'s class name/ctor arity is unchanged so every existing
5
- * consumer (store-backend.ts, the reaper/session integration suites) needs ZERO changes. New code
6
- * should import from `run-store-sql.ts` directly.
7
- */
8
- export { PgRunStore } from "./run-store-sql.js";
9
- //# sourceMappingURL=pg-run-store.d.ts.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 定型半场 collapse): the real implementation now lives in
3
- * `run-store-sql.ts` (single-file dual-dialect — TiDB + PG share one `SqlRunStore` body, dialect deltas
4
- * kept EXPLICIT per statement). `PgRunStore`'s class name/ctor arity is unchanged so every existing
5
- * consumer (store-backend.ts, the reaper/session integration suites) needs ZERO changes. New code
6
- * should import from `run-store-sql.ts` directly.
7
- */
8
- export { PgRunStore } from "./run-store-sql.js";
9
- //# sourceMappingURL=pg-run-store.js.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编) — the real implementation lives in the single-file
3
- * dual-dialect `session-policy-store-sql.ts` (`SqlSessionPolicyStore` + this file's historical
4
- * `PgSessionPolicyStore` ctor subclass). Kept so every consumer's import path is untouched.
5
- */
6
- export { PgSessionPolicyStore } from "./session-policy-store-sql.js";
7
- //# sourceMappingURL=pg-session-policy-store.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编) — the real implementation lives in the single-file
3
- * dual-dialect `session-policy-store-sql.ts` (`SqlSessionPolicyStore` + this file's historical
4
- * `PgSessionPolicyStore` ctor subclass). Kept so every consumer's import path is untouched.
5
- */
6
- export { PgSessionPolicyStore } from "./session-policy-store-sql.js";
7
- //# sourceMappingURL=pg-session-policy-store.js.map
@@ -1,12 +0,0 @@
1
- /**
2
- * Compatibility re-export shim — the PG Session event-log center (L1).
3
- *
4
- * 🔴 SINGLE SOURCE OF TRUTH: the real PG twin (PgSessionStorage + PgSessionStore + PG_SESSION_SCHEMA +
5
- * ensureSchema) lives in {@link ./pg-session-storage.ts}. This file previously carried a SECOND, byte-for-byte
6
- * copy of that same code — a dual source of truth that would silently drift (a fix to one copy leaving the
7
- * other stale, defeating the very twin/lock-step invariant the integration suite exists to protect). The
8
- * duplicate has been collapsed: everything is now re-exported from the one storage module so there is exactly
9
- * ONE PG implementation and the two integration suites both exercise it.
10
- */
11
- export { PgSessionStorage, PgSessionStore, PG_SESSION_SCHEMA, ensureSchema, } from "./pg-session-storage.js";
12
- //# sourceMappingURL=pg-session-store.d.ts.map
@@ -1,12 +0,0 @@
1
- /**
2
- * Compatibility re-export shim — the PG Session event-log center (L1).
3
- *
4
- * 🔴 SINGLE SOURCE OF TRUTH: the real PG twin (PgSessionStorage + PgSessionStore + PG_SESSION_SCHEMA +
5
- * ensureSchema) lives in {@link ./pg-session-storage.ts}. This file previously carried a SECOND, byte-for-byte
6
- * copy of that same code — a dual source of truth that would silently drift (a fix to one copy leaving the
7
- * other stale, defeating the very twin/lock-step invariant the integration suite exists to protect). The
8
- * duplicate has been collapsed: everything is now re-exported from the one storage module so there is exactly
9
- * ONE PG implementation and the two integration suites both exercise it.
10
- */
11
- export { PgSessionStorage, PgSessionStore, PG_SESSION_SCHEMA, ensureSchema, } from "./pg-session-storage.js";
12
- //# sourceMappingURL=pg-session-store.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * PostgreSQL `ToolResultStore` — the implementation now lives in the single-file dual-dialect
3
- * `tool-result-store-sql.ts` (design/158 A12 定型半场), the TiDB twin's sibling
4
- * (src/plugins/tidb-tool-result-store.ts). This file is the historical import path: the class name, ctor
5
- * shape, and the PG-only schema helpers (`PG_TOOL_RESULT_SCHEMA` / `ensureSchema`, consumed by pg-pool.ts's
6
- * central schema apply) are re-exported unchanged, so every consumer and suite is untouched.
7
- */
8
- export { PgToolResultStore, PG_TOOL_RESULT_SCHEMA, ensureSchema } from "./tool-result-store-sql.js";
9
- //# sourceMappingURL=pg-tool-result-store.d.ts.map
@@ -1,9 +0,0 @@
1
- /**
2
- * PostgreSQL `ToolResultStore` — the implementation now lives in the single-file dual-dialect
3
- * `tool-result-store-sql.ts` (design/158 A12 定型半场), the TiDB twin's sibling
4
- * (src/plugins/tidb-tool-result-store.ts). This file is the historical import path: the class name, ctor
5
- * shape, and the PG-only schema helpers (`PG_TOOL_RESULT_SCHEMA` / `ensureSchema`, consumed by pg-pool.ts's
6
- * central schema apply) are re-exported unchanged, so every consumer and suite is untouched.
7
- */
8
- export { PgToolResultStore, PG_TOOL_RESULT_SCHEMA, ensureSchema } from "./tool-result-store-sql.js";
9
- //# sourceMappingURL=pg-tool-result-store.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 collapse). The real implementation is the single-file dual-dialect
3
- * {@link import("./workflow-journal-store-sql.js").SqlWorkflowJournalStore} — see that file for the durable
4
- * {@link WorkflowJournalStore} contract, the schema, and the TiDB/PG dialect-delta ledger. This name (and ctor
5
- * arity: `(pool: PgPool)`) survives unchanged so every consumer (store-backend.ts, the extreme/integration/
6
- * resume-fork-probe suites) is untouched.
7
- */
8
- export { PgWorkflowJournalStore } from "./workflow-journal-store-sql.js";
9
- //# sourceMappingURL=pg-workflow-journal-store.d.ts.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 collapse). The real implementation is the single-file dual-dialect
3
- * {@link import("./workflow-journal-store-sql.js").SqlWorkflowJournalStore} — see that file for the durable
4
- * {@link WorkflowJournalStore} contract, the schema, and the TiDB/PG dialect-delta ledger. This name (and ctor
5
- * arity: `(pool: PgPool)`) survives unchanged so every consumer (store-backend.ts, the extreme/integration/
6
- * resume-fork-probe suites) is untouched.
7
- */
8
- export { PgWorkflowJournalStore } from "./workflow-journal-store-sql.js";
9
- //# sourceMappingURL=pg-workflow-journal-store.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 扇出): the PG `WorkflowRunStore`/`WorkflowCompletionInbox`/
3
- * `WorkflowNotifyJournalStore` twins now live collapsed with their TiDB dialect siblings in the
4
- * single-file dual-dialect `workflow-run-store-sql.ts` (design doc + dialect-delta ledger there).
5
- * Class names and ctor arity stay EXACTLY as they were — every consumer (store-backend.ts, the
6
- * DB-integration suite) imports from THIS path unchanged.
7
- */
8
- export { PgWorkflowRunStore, PgWorkflowCompletionInbox, PgWorkflowNotifyJournalStore } from "./workflow-run-store-sql.js";
9
- //# sourceMappingURL=pg-workflow-run-store.d.ts.map
@@ -1,9 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 扇出): the PG `WorkflowRunStore`/`WorkflowCompletionInbox`/
3
- * `WorkflowNotifyJournalStore` twins now live collapsed with their TiDB dialect siblings in the
4
- * single-file dual-dialect `workflow-run-store-sql.ts` (design doc + dialect-delta ledger there).
5
- * Class names and ctor arity stay EXACTLY as they were — every consumer (store-backend.ts, the
6
- * DB-integration suite) imports from THIS path unchanged.
7
- */
8
- export { PgWorkflowRunStore, PgWorkflowCompletionInbox, PgWorkflowNotifyJournalStore } from "./workflow-run-store-sql.js";
9
- //# sourceMappingURL=pg-workflow-run-store.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Thin re-export shim (design/158 A12 收编 — see src/plugins/approval-store-sql.ts for the
3
- * implementation, now SINGLE-FILE DUAL-DIALECT). Class name, ctor arity, and every exported
4
- * type/helper stay EXACTLY as they were so no consumer (store-backend.ts, src/index.ts, the
5
- * approval/audit/security-coverage suites) has to move.
6
- */
7
- export { TiDBApprovalStore, mapRow, type ApprovalRow, type ApprovalStatus, } from "./approval-store-sql.js";
8
- //# sourceMappingURL=tidb-approval-store.d.ts.map