@sema-agent/server 7.2.0 → 7.4.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/README.md +2 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +26 -1
- package/dist/approval-ask-machine.d.ts +39 -0
- package/dist/approval-ask-machine.js +101 -0
- package/dist/approval-card.d.ts +244 -0
- package/dist/approval-card.js +237 -0
- package/dist/approval-deny-reasons.d.ts +56 -0
- package/dist/approval-deny-reasons.js +54 -0
- package/dist/approval-reconciler.d.ts +174 -0
- package/dist/approval-reconciler.js +307 -0
- package/dist/boot/coordinators.d.ts +1 -0
- package/dist/boot/coordinators.js +39 -4
- package/dist/boot/deferred-sandbox-path-env.d.ts +99 -0
- package/dist/boot/deferred-sandbox-path-env.js +279 -0
- package/dist/boot/execution-env.js +11 -1
- package/dist/boot/lexical-path-env.d.ts +10 -0
- package/dist/boot/lexical-path-env.js +88 -0
- package/dist/boot/reapers.d.ts +34 -0
- package/dist/boot/reapers.js +198 -23
- package/dist/boot/resolve-spec.js +97 -33
- package/dist/capabilities/center-prompts.js +4 -1
- package/dist/capabilities/oa-tools.d.ts +15 -0
- package/dist/capabilities/oa-tools.js +54 -0
- package/dist/config-types.d.ts +68 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +138 -2
- package/dist/elicitation.d.ts +4 -0
- package/dist/elicitation.js +7 -3
- package/dist/finance/cost-taxonomy.d.ts +34 -0
- package/dist/finance/cost-taxonomy.js +26 -0
- package/dist/hooks/hook-runner.js +32 -0
- package/dist/http/routes/capabilities.js +14 -0
- package/dist/http/routes/diagnostics.d.ts +84 -0
- package/dist/http/routes/diagnostics.js +140 -0
- package/dist/http/routes/runs.d.ts +1 -0
- package/dist/http/routes/runs.js +548 -16
- package/dist/http/routes/tasks.js +175 -12
- package/dist/http/server.d.ts +6 -1
- package/dist/http/server.js +120 -4
- package/dist/http/sse-log.d.ts +51 -0
- package/dist/http/sse-log.js +64 -0
- package/dist/http/wire-types.d.ts +20 -5
- package/dist/main.js +35 -4
- package/dist/observability/fail-open.d.ts +98 -0
- package/dist/observability/fail-open.js +216 -0
- package/dist/observability/prompt-manifest.d.ts +13 -0
- package/dist/observability/prompt-manifest.js +8 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +38 -0
- package/dist/plugins/approval-ask-store-memory.js +299 -0
- package/dist/plugins/approval-ask-store-sql.d.ts +341 -0
- package/dist/plugins/approval-ask-store-sql.js +705 -0
- package/dist/plugins/approval-store-sql.d.ts +116 -0
- package/dist/plugins/approval-store-sql.js +151 -0
- package/dist/plugins/background-agent-store-sql.js +20 -1
- package/dist/plugins/checkpoint-store-sql.d.ts +84 -9
- package/dist/plugins/checkpoint-store-sql.js +297 -16
- package/dist/plugins/file-workflow-journal-store.d.ts +12 -0
- package/dist/plugins/file-workflow-journal-store.js +12 -0
- package/dist/plugins/local-checkpoint-store.d.ts +6 -5
- package/dist/plugins/local-checkpoint-store.js +4 -0
- package/dist/plugins/pg-approval-store.d.ts +9 -0
- package/dist/plugins/pg-approval-store.js +9 -0
- package/dist/plugins/pg-breaker-state.d.ts +8 -0
- package/dist/plugins/pg-breaker-state.js +8 -0
- package/dist/plugins/pg-checkpoint-store.d.ts +10 -0
- package/dist/plugins/pg-checkpoint-store.js +10 -0
- package/dist/plugins/pg-file-snapshot-store.d.ts +8 -0
- package/dist/plugins/pg-file-snapshot-store.js +8 -0
- package/dist/plugins/pg-image-bake.d.ts +12 -0
- package/dist/plugins/pg-image-bake.js +11 -0
- package/dist/plugins/pg-image-index.d.ts +12 -0
- package/dist/plugins/pg-image-index.js +11 -0
- package/dist/plugins/pg-outcome-ledger.d.ts +12 -0
- package/dist/plugins/pg-outcome-ledger.js +11 -0
- package/dist/plugins/pg-pool.js +11 -0
- package/dist/plugins/pg-resume-anchor-store.d.ts +7 -0
- package/dist/plugins/pg-resume-anchor-store.js +7 -0
- package/dist/plugins/pg-run-store.d.ts +9 -0
- package/dist/plugins/pg-run-store.js +9 -0
- package/dist/plugins/pg-session-policy-store.d.ts +7 -0
- package/dist/plugins/pg-session-policy-store.js +7 -0
- package/dist/plugins/pg-session-store.d.ts +12 -0
- package/dist/plugins/pg-session-store.js +12 -0
- package/dist/plugins/pg-tool-result-store.d.ts +9 -0
- package/dist/plugins/pg-tool-result-store.js +9 -0
- package/dist/plugins/pg-workflow-journal-store.d.ts +9 -0
- package/dist/plugins/pg-workflow-journal-store.js +9 -0
- package/dist/plugins/pg-workflow-run-store.d.ts +9 -0
- package/dist/plugins/pg-workflow-run-store.js +9 -0
- package/dist/plugins/store-backend.d.ts +18 -0
- package/dist/plugins/store-backend.js +10 -0
- package/dist/plugins/tidb-approval-store.d.ts +8 -0
- package/dist/plugins/tidb-approval-store.js +8 -0
- package/dist/plugins/tidb-breaker-state.d.ts +7 -0
- package/dist/plugins/tidb-breaker-state.js +7 -0
- package/dist/plugins/tidb-checkpoint-store.d.ts +9 -0
- package/dist/plugins/tidb-checkpoint-store.js +9 -0
- package/dist/plugins/tidb-file-snapshot-store.d.ts +8 -0
- package/dist/plugins/tidb-file-snapshot-store.js +8 -0
- package/dist/plugins/tidb-image-bake.d.ts +12 -0
- package/dist/plugins/tidb-image-bake.js +11 -0
- package/dist/plugins/tidb-image-index.d.ts +12 -0
- package/dist/plugins/tidb-image-index.js +11 -0
- package/dist/plugins/tidb-outcome-ledger.d.ts +12 -0
- package/dist/plugins/tidb-outcome-ledger.js +12 -0
- package/dist/plugins/tidb-pool.js +27 -4
- package/dist/plugins/tidb-resume-anchor-store.d.ts +7 -0
- package/dist/plugins/tidb-resume-anchor-store.js +7 -0
- package/dist/plugins/tidb-run-store.d.ts +10 -0
- package/dist/plugins/tidb-run-store.js +9 -0
- package/dist/plugins/tidb-session-policy-store.d.ts +7 -0
- package/dist/plugins/tidb-session-policy-store.js +7 -0
- package/dist/plugins/tidb-tool-result-store.d.ts +8 -0
- package/dist/plugins/tidb-tool-result-store.js +10 -0
- package/dist/plugins/tidb-workflow-journal-store.d.ts +9 -0
- package/dist/plugins/tidb-workflow-journal-store.js +9 -0
- package/dist/plugins/tidb-workflow-run-store.d.ts +10 -0
- package/dist/plugins/tidb-workflow-run-store.js +10 -0
- package/dist/plugins/workflow-journal-limits.d.ts +12 -0
- package/dist/plugins/workflow-journal-limits.js +12 -0
- package/dist/question.d.ts +21 -14
- package/dist/question.js +83 -34
- package/dist/runs.d.ts +16 -1
- package/dist/runs.js +61 -3
- package/dist/runtime-caps-resolver.d.ts +7 -1
- package/dist/runtime-caps-resolver.js +65 -3
- package/dist/sema-registry.d.ts +41 -0
- package/dist/sema-registry.js +40 -0
- package/dist/spec-fields.d.ts +4 -0
- package/dist/spec-fields.js +6 -0
- package/dist/task-settings.d.ts +36 -15
- package/dist/task-settings.js +19 -5
- package/dist/tool-approval.d.ts +296 -3
- package/dist/tool-approval.js +1074 -50
- package/dist/trace/core-keyset-guard.d.ts +2 -2
- package/dist/trace/ledger-sink.js +14 -1
- package/dist/trace/project.d.ts +90 -0
- package/dist/trace/project.js +188 -0
- package/package.json +5 -4
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -8,6 +8,7 @@ import { FileRunStore } from "./file-run-store.js";
|
|
|
8
8
|
import { LocalCheckpointStore } from "./local-checkpoint-store.js";
|
|
9
9
|
import { FileResumeAnchorStore } from "./file-resume-anchor-store.js";
|
|
10
10
|
import { type ApprovalExemptionStore } from "./approval-exemption-store.js";
|
|
11
|
+
import { type ApprovalAskStore as ApprovalAskStoreType } from "./approval-ask-store-sql.js";
|
|
11
12
|
import { type SendFileLedger } from "./send-file-ledger.js";
|
|
12
13
|
import { TiDBResumeAnchorStore, PgResumeAnchorStore } from "./resume-anchor-store-sql.js";
|
|
13
14
|
import type { ServiceConfig } from "../config-types.js";
|
|
@@ -27,6 +28,9 @@ export type RunStore = TiDBRunStore | PgRunStore | FileRunStore;
|
|
|
27
28
|
* FileResumeAnchorStore is the FILE-backed local twin (P0.5 variant-1; survives restart). */
|
|
28
29
|
export type ResumeAnchorStore = TiDBResumeAnchorStore | PgResumeAnchorStore | FileResumeAnchorStore;
|
|
29
30
|
export type { ApprovalExemptionStore } from "./approval-exemption-store.js";
|
|
31
|
+
/** #151(design/172 v3.1 §3.0-§3.2 流内审批协议持久层):`ApprovalAskStore` 接口 + 行/补丁类型。
|
|
32
|
+
* 车3 刀 3a 起 `StoreBackend.approvalAsk()` 已在(见接口体的那条注)。 */
|
|
33
|
+
export type { ApprovalAskStore, AskRow, NewAskRow, AskTransitionPatch, DecideAskInput, DecideResult, ExpireResult, BindGateInput, BatchRow, AskDecision } from "./approval-ask-store-sql.js";
|
|
30
34
|
/** E6 SessionPolicyStore — core's interface PLUS the service `deleteBySession` (E21 purge; only the durable twins carry
|
|
31
35
|
* it, core's InMemory omits it → optional). tidb/pg = durable twins; local = core's InMemorySessionPolicyStore (works
|
|
32
36
|
* local — rules need no cloud-only infra). The shared env-gated equivalence suite keeps the twins byte-matched to InMemory. */
|
|
@@ -107,6 +111,20 @@ export interface StoreBackend {
|
|
|
107
111
|
/** Per-session per-toolName approval exemption ("本会话不再询问") — an approval MEMORY the F4
|
|
108
112
|
* ask-gate consults after deny/neverAuto. REQUIRED on all backends (works local, like resumeAnchor). */
|
|
109
113
|
approvalExemption(): ApprovalExemptionStore;
|
|
114
|
+
/** #151(design/172 §3.0-§3.2)流内审批协议持久层:每个流内工具调用一行的 ask 状态机 + 批行。
|
|
115
|
+
* REQUIRED on all backends — tidb/pg = SQL 双方言 twin;local = {@link InMemoryApprovalAskStore}。
|
|
116
|
+
*
|
|
117
|
+
* 🔴 local 形的代价必须在这里说清楚(而不是留给读者自己发现):InMemory 的 STREAM_PENDING/DECIDED/
|
|
118
|
+
* PARKING 全在两个进程内 Map 里 ⇒ **重启同时丢重放基准、丢已接受的决议、丢审计**——「一次真实的人类
|
|
119
|
+
* 批准凭空消失」和「对账便利丢失」不是一个量级。因此协议在 local 车道**默认不上场**:能力面
|
|
120
|
+
* (`streamApproval`)的判据带一条「ask 账必须是持久的」合取项,local 不报 true(诚实缺席,同
|
|
121
|
+
* `park 设施缺席 ⇒ 协议不上场` 的姿势)。要在 local 真上协议,先落 File 形(现成模子 =
|
|
122
|
+
* {@link FileApprovalExemptionStore}:core `AppendLog`/`readJsonlRecords`,内存索引 + 追加日志即可
|
|
123
|
+
* 满足单实例 boot-lock 下的 CAS),那时这里换成 File twin、能力面自然翻真。
|
|
124
|
+
*
|
|
125
|
+
* 无 backend 的 env-only worker 压根没有 `StoreBackend` ⇒ 协调器拿到 undefined askStore ⇒ 车2 的
|
|
126
|
+
* D1 逐字现行为(store 缺席 = 现行 `tool_approval` 活卡腿一字不变)。 */
|
|
127
|
+
approvalAsk(): ApprovalAskStoreType;
|
|
110
128
|
/** SendUserFile scope↔object ledger (multi-tenant list/revoke handle; the hashed key segment hides the
|
|
111
129
|
* mapping from URLs). REQUIRED on all backends (works local — one JSONL, like approvalExemption). */
|
|
112
130
|
sendFileLedger(): SendFileLedger;
|
|
@@ -18,6 +18,8 @@ import { LocalSessionStore } from "./local-session-store.js";
|
|
|
18
18
|
import { LocalCheckpointStore } from "./local-checkpoint-store.js";
|
|
19
19
|
import { FileResumeAnchorStore } from "./file-resume-anchor-store.js";
|
|
20
20
|
import { TiDBApprovalExemptionStore, PgApprovalExemptionStore, FileApprovalExemptionStore } from "./approval-exemption-store.js";
|
|
21
|
+
import { TiDBApprovalAskStore, PgApprovalAskStore } from "./approval-ask-store-sql.js";
|
|
22
|
+
import { InMemoryApprovalAskStore } from "./approval-ask-store-memory.js";
|
|
21
23
|
import { TiDBSendFileLedger, PgSendFileLedger, FileSendFileLedger } from "./send-file-ledger.js";
|
|
22
24
|
import { TiDBResumeAnchorStore, PgResumeAnchorStore } from "./resume-anchor-store-sql.js";
|
|
23
25
|
import { TiDBSessionPolicyStore, PgSessionPolicyStore } from "./session-policy-store-sql.js";
|
|
@@ -94,6 +96,7 @@ class TiDBBackend {
|
|
|
94
96
|
run() { return new TiDBRunStore(this.pool); }
|
|
95
97
|
resumeAnchor() { return new TiDBResumeAnchorStore(this.pool); }
|
|
96
98
|
approvalExemption() { return new TiDBApprovalExemptionStore(this.pool); }
|
|
99
|
+
approvalAsk() { return new TiDBApprovalAskStore(this.pool); } // #151 流内审批协议持久层(无状态 store,每次新建同兄弟)
|
|
97
100
|
sendFileLedger() { return new TiDBSendFileLedger(this.pool); }
|
|
98
101
|
sessionPolicy() { return new TiDBSessionPolicyStore(this.pool); }
|
|
99
102
|
fileSnapshot() { return new TiDBFileSnapshotStore(this.pool, snapshotBlobBackend(this.config, "tidb", this.pool), snapshotBoundsFromConfig(this.config)); }
|
|
@@ -127,6 +130,7 @@ class PgBackend {
|
|
|
127
130
|
run() { return new PgRunStore(this.pool); }
|
|
128
131
|
resumeAnchor() { return new PgResumeAnchorStore(this.pool); }
|
|
129
132
|
approvalExemption() { return new PgApprovalExemptionStore(this.pool); }
|
|
133
|
+
approvalAsk() { return new PgApprovalAskStore(this.pool); } // #151 流内审批协议持久层(SQL twin)
|
|
130
134
|
sendFileLedger() { return new PgSendFileLedger(this.pool); }
|
|
131
135
|
sessionPolicy() { return new PgSessionPolicyStore(this.pool); }
|
|
132
136
|
fileSnapshot() { return new PgFileSnapshotStore(this.pool, snapshotBlobBackend(this.config, "pg", this.pool), snapshotBoundsFromConfig(this.config)); }
|
|
@@ -178,6 +182,8 @@ class LocalBackend {
|
|
|
178
182
|
sessionStore;
|
|
179
183
|
resumeAnchorStore;
|
|
180
184
|
approvalExemptionStore;
|
|
185
|
+
/** #151 —— 进程内易失(见 approvalAsk() 的注);File 形落地前它就是 local 车道的占位。 */
|
|
186
|
+
approvalAskStore = new InMemoryApprovalAskStore();
|
|
181
187
|
sendFileLedgerStore;
|
|
182
188
|
// SVC-2: FILE-backed durable journal (was core's InMemory — a TOC restart silently resolved
|
|
183
189
|
// resumeFromRunId to an empty journal → full live re-run). Now restart-durable on one box; crash-safe JSONL,
|
|
@@ -223,6 +229,10 @@ class LocalBackend {
|
|
|
223
229
|
run() { return this.runStore; }
|
|
224
230
|
resumeAnchor() { return this.resumeAnchorStore; } // singleton — state lives in the instance (mirrors run()/session())
|
|
225
231
|
approvalExemption() { return this.approvalExemptionStore; } // singleton — same posture
|
|
232
|
+
/** #151 流内审批协议持久层的 local 形。**必须**是 singleton:状态全在实例的两个 Map 里,每次
|
|
233
|
+
* new 一个就等于每个消费者各拿一份互不可见的账(而 SQL twin 天然共享一张表)。易失代价 +
|
|
234
|
+
* 「local 车道默认不上协议」的裁定见 StoreBackend.approvalAsk() 的接口注。 */
|
|
235
|
+
approvalAsk() { return this.approvalAskStore; }
|
|
226
236
|
sendFileLedger() { return this.sendFileLedgerStore; } // singleton — append fd lives in the instance
|
|
227
237
|
/** Durable HITL / plan-review parking on the LOCAL lane. Lazy singleton (the inner core store holds
|
|
228
238
|
* an append fd). taskId join ← FileRunStore; E21 owner guard ← LocalSessionStore.ownerOf (same root). */
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1,8 @@
|
|
|
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, } from "./approval-store-sql.js";
|
|
8
|
+
//# sourceMappingURL=tidb-approval-store.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 "./tidb-breaker-state.js"` import keeps working unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBBreakerState } from "./breaker-state-sql.js";
|
|
7
|
+
//# sourceMappingURL=tidb-breaker-state.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 "./tidb-breaker-state.js"` import keeps working unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBBreakerState } from "./breaker-state-sql.js";
|
|
7
|
+
//# sourceMappingURL=tidb-breaker-state.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) `CheckpointStore` — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `checkpoint-store-sql.ts` (design/158 A12 定型半场). This file is the historical import path: the class
|
|
4
|
+
* name, ctor shape and the backend-NEUTRAL helpers the LOCAL twin shares (TERMINAL_BACKSTOP_MS /
|
|
5
|
+
* TERMINAL_GRACE_MS / tokenFingerprint / boundedToolInput / PendingCheckpoint) are re-exported unchanged,
|
|
6
|
+
* so local-checkpoint-store.ts, store-backend.ts, the dogfood script and every suite are untouched.
|
|
7
|
+
*/
|
|
8
|
+
export { TiDBCheckpointStore, SqlCheckpointStore, TERMINAL_BACKSTOP_MS, TERMINAL_GRACE_MS, tokenFingerprint, boundedToolInput, type PendingCheckpoint, } from "./checkpoint-store-sql.js";
|
|
9
|
+
//# sourceMappingURL=tidb-checkpoint-store.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) `CheckpointStore` — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `checkpoint-store-sql.ts` (design/158 A12 定型半场). This file is the historical import path: the class
|
|
4
|
+
* name, ctor shape and the backend-NEUTRAL helpers the LOCAL twin shares (TERMINAL_BACKSTOP_MS /
|
|
5
|
+
* TERMINAL_GRACE_MS / tokenFingerprint / boundedToolInput / PendingCheckpoint) are re-exported unchanged,
|
|
6
|
+
* so local-checkpoint-store.ts, store-backend.ts, the dogfood script and every suite are untouched.
|
|
7
|
+
*/
|
|
8
|
+
export { TiDBCheckpointStore, SqlCheckpointStore, TERMINAL_BACKSTOP_MS, TERMINAL_GRACE_MS, tokenFingerprint, boundedToolInput, } from "./checkpoint-store-sql.js";
|
|
9
|
+
//# sourceMappingURL=tidb-checkpoint-store.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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 { TiDBFileSnapshotStore } from "./file-snapshot-store-sql.js";
|
|
8
|
+
//# sourceMappingURL=tidb-file-snapshot-store.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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 { TiDBFileSnapshotStore } from "./file-snapshot-store-sql.js";
|
|
8
|
+
//# sourceMappingURL=tidb-file-snapshot-store.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) BAKE store — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `image-bake-store-sql.ts` (design/158 A12 定型半场). This file is the historical import path: the
|
|
4
|
+
* class name, ctor shape and every re-exported contract are unchanged, so no consumer moved.
|
|
5
|
+
*
|
|
6
|
+
* New code should import from `./image-bake-store-sql.js` (both dialects) and take its CONTRACTS from
|
|
7
|
+
* `./store-contracts.js` (backend-neutral, design/158 A3 沉底).
|
|
8
|
+
*/
|
|
9
|
+
export { TiDBImageBake, SqlImageBake } from "./image-bake-store-sql.js";
|
|
10
|
+
export type { BakeStatus, BakeState, BakeErrorCode, BakeRecord, BakeEvent, CreateBakeInput, BakeTerminal, BakeRow, } from "./store-contracts.js";
|
|
11
|
+
export { mapBakeRow as mapRow, BAKE_SELECT_COLS as SELECT_COLS } from "./store-contracts.js";
|
|
12
|
+
//# sourceMappingURL=tidb-image-bake.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) BAKE store — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `image-bake-store-sql.ts` (design/158 A12 定型半场). This file is the historical import path: the
|
|
4
|
+
* class name, ctor shape and every re-exported contract are unchanged, so no consumer moved.
|
|
5
|
+
*
|
|
6
|
+
* New code should import from `./image-bake-store-sql.js` (both dialects) and take its CONTRACTS from
|
|
7
|
+
* `./store-contracts.js` (backend-neutral, design/158 A3 沉底).
|
|
8
|
+
*/
|
|
9
|
+
export { TiDBImageBake, SqlImageBake } from "./image-bake-store-sql.js";
|
|
10
|
+
export { mapBakeRow as mapRow, BAKE_SELECT_COLS as SELECT_COLS } from "./store-contracts.js";
|
|
11
|
+
//# sourceMappingURL=tidb-image-bake.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-image-pool INDEX store (IMAGE-API-DESIGN.md §1, pool design §8).
|
|
3
|
+
*
|
|
4
|
+
* Thin re-export shim (design/158 A12 定型半场): the real implementation is the single-file dual-dialect
|
|
5
|
+
* `image-index-sql.ts` (`SqlImageIndex` + this file's `TiDBImageIndex` ctor subclass). Class name, ctor
|
|
6
|
+
* arity, and the exported type/helper surface are UNCHANGED — every consumer (store-backend.ts, the unit +
|
|
7
|
+
* real-DB integration suites) imports from here exactly as before.
|
|
8
|
+
*/
|
|
9
|
+
export { TiDBImageIndex } from "./image-index-sql.js";
|
|
10
|
+
export type { ImageNestedBuildMode, ImageCapabilities, ImagePodContract, ImageStatus, ImageVisibility, ImageIndexEntry, ImageIndexUpsert, ImageViewer, ImageListFilter, ImageRow, } from "./store-contracts.js";
|
|
11
|
+
export { mapImageRow as mapRow } from "./store-contracts.js";
|
|
12
|
+
//# sourceMappingURL=tidb-image-index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-image-pool INDEX store (IMAGE-API-DESIGN.md §1, pool design §8).
|
|
3
|
+
*
|
|
4
|
+
* Thin re-export shim (design/158 A12 定型半场): the real implementation is the single-file dual-dialect
|
|
5
|
+
* `image-index-sql.ts` (`SqlImageIndex` + this file's `TiDBImageIndex` ctor subclass). Class name, ctor
|
|
6
|
+
* arity, and the exported type/helper surface are UNCHANGED — every consumer (store-backend.ts, the unit +
|
|
7
|
+
* real-DB integration suites) imports from here exactly as before.
|
|
8
|
+
*/
|
|
9
|
+
export { TiDBImageIndex } from "./image-index-sql.js";
|
|
10
|
+
export { mapImageRow as mapRow } from "./store-contracts.js";
|
|
11
|
+
//# sourceMappingURL=tidb-image-index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) outcome ledger — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `outcome-ledger-sql.ts` (design/158 A12 定型半场), alongside its PG 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, ctor shape, the shared types and the pure
|
|
8
|
+
* helpers (`taskSignature` / `deriveOutcome` / `coreOutcomeToLedgerRow`) are unchanged, so
|
|
9
|
+
* store-backend.ts, the pg twin, and every suite are untouched.
|
|
10
|
+
*/
|
|
11
|
+
export { TiDBOutcomeLedger, taskSignature, deriveOutcome, coreOutcomeToLedgerRow, type MechanicalOutcome, type LlmAssistedOutcome, type SignatureInputs, type RunStatus, type TaskOutcome, } from "./outcome-ledger-sql.js";
|
|
12
|
+
//# sourceMappingURL=tidb-outcome-ledger.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) outcome ledger — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `outcome-ledger-sql.ts` (design/158 A12 定型半场), alongside its PG 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, ctor shape, the shared types and the pure
|
|
8
|
+
* helpers (`taskSignature` / `deriveOutcome` / `coreOutcomeToLedgerRow`) are unchanged, so
|
|
9
|
+
* store-backend.ts, the pg twin, and every suite are untouched.
|
|
10
|
+
*/
|
|
11
|
+
export { TiDBOutcomeLedger, taskSignature, deriveOutcome, coreOutcomeToLedgerRow, } from "./outcome-ledger-sql.js";
|
|
12
|
+
//# sourceMappingURL=tidb-outcome-ledger.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import mysql from "mysql2/promise";
|
|
2
|
+
import { TIDB_APPROVAL_ASK_STATEMENTS } from "./approval-ask-store-sql.js";
|
|
2
3
|
/**
|
|
3
4
|
* Shared TiDB (MySQL wire-compatible) connection pool for the durable Session center (L1).
|
|
4
5
|
* Owned by `main.ts`; closed on shutdown.
|
|
@@ -244,11 +245,28 @@ export const SCHEMA_STATEMENTS = [
|
|
|
244
245
|
-- D-1 TOCTOU binding guard is UNREACHABLE by the portal without it — it can then only do the unbound legacy
|
|
245
246
|
-- fallback). NULL on PRE-D-1 rows ⇒ that unbound fallback.
|
|
246
247
|
bound_input_hash VARCHAR(190) NULL,
|
|
247
|
-
-- pending_steer (design/80 D-A, durable steering)
|
|
248
|
-
--
|
|
249
|
-
--
|
|
250
|
-
-- Never touches status/resolve (design/80 inv #4).
|
|
248
|
+
-- pending_steer (design/80 D-A, durable steering):**队列化之前**的单座列,存 {text,trusted}。
|
|
249
|
+
-- core 5.14.0(#147 BREAKING)之后本服务**只读不写**它:存量行的那一座由 core readPendingSteerQueue
|
|
250
|
+
-- 折成 member 0,零迁移。NULL = 没有旧座。Never touches status/resolve (design/80 inv #4)。
|
|
251
251
|
pending_steer TEXT NULL,
|
|
252
|
+
-- pending_steer_queue:core 5.14.0(#147)的**有界有序队列**(PendingSteerEntry[] 的 JSON)。
|
|
253
|
+
-- 为什么队列另起一列、而不是把信封写回 pending_steer(codex 复审 2026-08-06 F3,采纳):滚动升级/
|
|
254
|
+
-- 回滚窗里旧副本仍在跑,它对 pending_steer 是**无条件覆盖**写 —— 队列若躺在同一列,旧副本接的下一条
|
|
255
|
+
-- steer 会把 5.14 排好的整队悄悄抹掉,正是 #147 要消灭的那种静默丢失换了个位置复发。分列之后:
|
|
256
|
+
-- 旧副本写它的单座 ⇒ 落 pending_steer,新读侧把它折成 member 0,**两边都活着**;旧副本读不到队列
|
|
257
|
+
-- 是 core 自己已披露的回滚代价(CHANGELOG:rolling back across the queue event loses steers),
|
|
258
|
+
-- 那半无法在店面消除,但**写侧互相清零**这半可以,且代价只是一个可空列。
|
|
259
|
+
-- 容量:core 的 PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES = 48000 字节是对 {pendingSteer,queue} 整信封的
|
|
260
|
+
-- 硬上界(越界 fail-loud steering.queue_full,绝不驱逐)⇒ 本列恒小于它,MySQL TEXT 的 65535 字节
|
|
261
|
+
-- 够用,**不升 LONGTEXT**(core 常量注里点名「under a MySQL TEXT column with UTF-8 headroom」)。
|
|
262
|
+
pending_steer_queue TEXT NULL,
|
|
263
|
+
-- pending_steer_rev:pending_steer_queue 列**自己**的乐观锁计数(与 resolve/reopen 的 rev 是两个轴,
|
|
264
|
+
-- 刻意不复用)。队列化之后 setPendingSteer 从「一条无条件 UPDATE」变成「读-改-写」,中间那道窗必须
|
|
265
|
+
-- 有 CAS 守着,否则两个并发 steer 各读到同一份队列、后写者把前者的条目整个盖掉。
|
|
266
|
+
-- 🔴 为什么不拿队列列的旧值当守卫:本表没有显式 COLLATE,库默认多为 *_ci —— 字符串 <=> 在大小写
|
|
267
|
+
-- 不敏感的排序规则下会把两份只差字母大小写的 JSON 判等,CAS 假命中 = 丢一条指令。整数列没有这个面。
|
|
268
|
+
-- **绝不**用它做 resolve 的 OCC:bump 它不影响 core 的 rev 语义。
|
|
269
|
+
pending_steer_rev BIGINT NOT NULL DEFAULT 0,
|
|
252
270
|
-- risk_descriptor (design/80 riskDescriptor inbox): core's INERT CheckpointGate.riskDescriptor ({severity
|
|
253
271
|
-- 1-5, axes, toolName, redacted summary, touchedPaths}), stamped at put() so listPending can surface it +
|
|
254
272
|
-- triage-sort the supervisor inbox by severity DESC — WITHOUT parsing the checkpoint blob per row.
|
|
@@ -602,6 +620,11 @@ export const SCHEMA_STATEMENTS = [
|
|
|
602
620
|
pool VARCHAR(32) NOT NULL,
|
|
603
621
|
PRIMARY KEY (pool)
|
|
604
622
|
)`,
|
|
623
|
+
// #151(design/172)流内审批协议持久层的两张表。真源 = approval-ask-store-sql.ts 的
|
|
624
|
+
// `TIDB_APPROVAL_ASK_STATEMENTS`(那里与 PG twin 并排,方言差异一眼可对);展开进这个数组是为了让它们
|
|
625
|
+
// 跟着中央 `ensureSchema` 在 **named-lock 的那条 conn** 上建 —— 把 pool 级 ensure 函数塞进执行循环
|
|
626
|
+
// 会绕开 DDL 串行化。挂进来同时也是「这张表算生产 schema」的声明(基线导出按定义只收录被执行的语句)。
|
|
627
|
+
...TIDB_APPROVAL_ASK_STATEMENTS,
|
|
605
628
|
];
|
|
606
629
|
/** Named MySQL/TiDB advisory lock that serializes the whole `ensureSchema` DDL run (see below). */
|
|
607
630
|
export const ENSURE_SCHEMA_LOCK = "sema_ensure_schema";
|
|
@@ -0,0 +1,7 @@
|
|
|
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 PG twin via `SqlDriver`). Kept so
|
|
4
|
+
* consumers importing this path (store-backend.ts, the resume-anchor integration suite) don't move.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBResumeAnchorStore } from "./resume-anchor-store-sql.js";
|
|
7
|
+
//# sourceMappingURL=tidb-resume-anchor-store.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 PG twin via `SqlDriver`). Kept so
|
|
4
|
+
* consumers importing this path (store-backend.ts, the resume-anchor integration suite) don't move.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBResumeAnchorStore } from "./resume-anchor-store-sql.js";
|
|
7
|
+
//# sourceMappingURL=tidb-resume-anchor-store.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
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). `TiDBRunStore`'s class name/ctor arity/exported types are unchanged so
|
|
5
|
+
* every existing consumer (store-backend.ts, src/index.ts, the run/reaper/session/usage suites) needs
|
|
6
|
+
* ZERO changes. New code should import from `run-store-sql.ts` directly.
|
|
7
|
+
*/
|
|
8
|
+
export { TiDBRunStore } from "./run-store-sql.js";
|
|
9
|
+
export type { RunRecord, SessionSummary, RunEvent } from "./store-contracts.js";
|
|
10
|
+
//# sourceMappingURL=tidb-run-store.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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). `TiDBRunStore`'s class name/ctor arity/exported types are unchanged so
|
|
5
|
+
* every existing consumer (store-backend.ts, src/index.ts, the run/reaper/session/usage suites) needs
|
|
6
|
+
* ZERO changes. New code should import from `run-store-sql.ts` directly.
|
|
7
|
+
*/
|
|
8
|
+
export { TiDBRunStore } from "./run-store-sql.js";
|
|
9
|
+
//# sourceMappingURL=tidb-run-store.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
* `TiDBSessionPolicyStore` ctor subclass). Kept so every consumer's import path is untouched.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBSessionPolicyStore } from "./session-policy-store-sql.js";
|
|
7
|
+
//# sourceMappingURL=tidb-session-policy-store.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
* `TiDBSessionPolicyStore` ctor subclass). Kept so every consumer's import path is untouched.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBSessionPolicyStore } from "./session-policy-store-sql.js";
|
|
7
|
+
//# sourceMappingURL=tidb-session-policy-store.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) `ToolResultStore` — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `tool-result-store-sql.ts` (design/158 A12 定型半场). This file is the historical import path: the class
|
|
4
|
+
* name and ctor shape are re-exported unchanged, so store-backend.ts and every suite are untouched.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBToolResultStore, SqlToolResultStore } from "./tool-result-store-sql.js";
|
|
7
|
+
export { escapeLike } from "./sql-escape.js";
|
|
8
|
+
//# sourceMappingURL=tidb-tool-result-store.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MySQL-protocol (TiDB) `ToolResultStore` — the implementation now lives in the single-file dual-dialect
|
|
3
|
+
* `tool-result-store-sql.ts` (design/158 A12 定型半场). This file is the historical import path: the class
|
|
4
|
+
* name and ctor shape are re-exported unchanged, so store-backend.ts and every suite are untouched.
|
|
5
|
+
*/
|
|
6
|
+
export { TiDBToolResultStore, SqlToolResultStore } from "./tool-result-store-sql.js";
|
|
7
|
+
// Back-compat re-export: escapeLike LIVES in sql-escape.ts (design/158 A3, backend-neutral leaf);
|
|
8
|
+
// import from there in new code.
|
|
9
|
+
export { escapeLike } from "./sql-escape.js";
|
|
10
|
+
//# sourceMappingURL=tidb-tool-result-store.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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: MySqlPool)`) survives unchanged so every consumer (store-backend.ts, the extreme/integration/
|
|
6
|
+
* resume-fork-probe suites) is untouched.
|
|
7
|
+
*/
|
|
8
|
+
export { TiDBWorkflowJournalStore } from "./workflow-journal-store-sql.js";
|
|
9
|
+
//# sourceMappingURL=tidb-workflow-journal-store.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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: MySqlPool)`) survives unchanged so every consumer (store-backend.ts, the extreme/integration/
|
|
6
|
+
* resume-fork-probe suites) is untouched.
|
|
7
|
+
*/
|
|
8
|
+
export { TiDBWorkflowJournalStore } from "./workflow-journal-store-sql.js";
|
|
9
|
+
//# sourceMappingURL=tidb-workflow-journal-store.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin re-export shim (design/158 A12 扇出): the TiDB `WorkflowRunStore`/`WorkflowCompletionInbox`/
|
|
3
|
+
* `WorkflowNotifyJournalStore` twins now live collapsed with their PG dialect siblings in the
|
|
4
|
+
* single-file dual-dialect `workflow-run-store-sql.ts`. Class names, ctor arity, and the exported
|
|
5
|
+
* `MAX_RUN_BLOB_BYTES` / `slimOversizeRun` / `InboxWarn` surface stay EXACTLY as they were — every
|
|
6
|
+
* consumer (store-backend.ts, the DB-integration + slim-oversize-run suites) imports from THIS path
|
|
7
|
+
* unchanged.
|
|
8
|
+
*/
|
|
9
|
+
export { MAX_RUN_BLOB_BYTES, slimOversizeRun, type InboxWarn, TiDBWorkflowRunStore, TiDBWorkflowCompletionInbox, TiDBWorkflowNotifyJournalStore, } from "./workflow-run-store-sql.js";
|
|
10
|
+
//# sourceMappingURL=tidb-workflow-run-store.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin re-export shim (design/158 A12 扇出): the TiDB `WorkflowRunStore`/`WorkflowCompletionInbox`/
|
|
3
|
+
* `WorkflowNotifyJournalStore` twins now live collapsed with their PG dialect siblings in the
|
|
4
|
+
* single-file dual-dialect `workflow-run-store-sql.ts`. Class names, ctor arity, and the exported
|
|
5
|
+
* `MAX_RUN_BLOB_BYTES` / `slimOversizeRun` / `InboxWarn` surface stay EXACTLY as they were — every
|
|
6
|
+
* consumer (store-backend.ts, the DB-integration + slim-oversize-run suites) imports from THIS path
|
|
7
|
+
* unchanged.
|
|
8
|
+
*/
|
|
9
|
+
export { MAX_RUN_BLOB_BYTES, slimOversizeRun, TiDBWorkflowRunStore, TiDBWorkflowCompletionInbox, TiDBWorkflowNotifyJournalStore, } from "./workflow-run-store-sql.js";
|
|
10
|
+
//# sourceMappingURL=tidb-workflow-run-store.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVC-2 — the shared size bound for a journaled workflow-agent result, so all THREE backends (tidb/pg SQL
|
|
3
|
+
* twins here + core's FileWorkflowJournalStore) DEGRADE IDENTICALLY on an oversize TaskResult: skip-journal
|
|
4
|
+
* (a no-op, never insert/throw) — the agent's ordinal is simply not cached and a resume re-runs that one
|
|
5
|
+
* agent live. Rationale (TiDB ~6 MiB txn-entry-size-limit vs PG/file no such limit) documented at the source.
|
|
6
|
+
*
|
|
7
|
+
* Now a RE-EXPORT of core's copy: the constant + helper moved to core with the FileWorkflowJournalStore
|
|
8
|
+
* adoption (core 1.223.0 — core inlined them into its store file and exports both).
|
|
9
|
+
* The SQL twins import from here unchanged; one source of truth for the byte-match contract.
|
|
10
|
+
*/
|
|
11
|
+
export { MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult } from "@sema-agent/core";
|
|
12
|
+
//# sourceMappingURL=workflow-journal-limits.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVC-2 — the shared size bound for a journaled workflow-agent result, so all THREE backends (tidb/pg SQL
|
|
3
|
+
* twins here + core's FileWorkflowJournalStore) DEGRADE IDENTICALLY on an oversize TaskResult: skip-journal
|
|
4
|
+
* (a no-op, never insert/throw) — the agent's ordinal is simply not cached and a resume re-runs that one
|
|
5
|
+
* agent live. Rationale (TiDB ~6 MiB txn-entry-size-limit vs PG/file no such limit) documented at the source.
|
|
6
|
+
*
|
|
7
|
+
* Now a RE-EXPORT of core's copy: the constant + helper moved to core with the FileWorkflowJournalStore
|
|
8
|
+
* adoption (core 1.223.0 — core inlined them into its store file and exports both).
|
|
9
|
+
* The SQL twins import from here unchanged; one source of truth for the byte-match contract.
|
|
10
|
+
*/
|
|
11
|
+
export { MAX_JOURNAL_RESULT_BYTES, oversizeJournalResult } from "@sema-agent/core";
|
|
12
|
+
//# sourceMappingURL=workflow-journal-limits.js.map
|