feat: add shadow LangGraph orchestrator runtime

This commit is contained in:
john
2026-07-24 21:25:40 +08:00
parent 46ea22b342
commit 24336d0178
29 changed files with 3247 additions and 25 deletions
+32
View File
@@ -0,0 +1,32 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import {
createOrchestratorCheckpoint,
orchestratorCheckpointInternals,
} from './checkpoint.mjs';
test('checkpoint defaults to durable PostgreSQL and fails closed without a URL', async () => {
await assert.rejects(
createOrchestratorCheckpoint({ mode: undefined, connectionString: '' }),
(error) => error.code === 'ORCHESTRATOR_DATABASE_URL_REQUIRED',
);
});
test('memory checkpoint is explicitly non-durable', async () => {
const checkpoint = await createOrchestratorCheckpoint({ mode: 'memory' });
assert.equal(checkpoint.kind, 'memory');
assert.equal(checkpoint.durable, false);
assert.equal(typeof checkpoint.checkpointer.getTuple, 'function');
await checkpoint.close();
});
test('checkpoint schema accepts identifiers and rejects SQL fragments', () => {
assert.equal(
orchestratorCheckpointInternals.normalizeSchema('memind_orchestrator_v2'),
'memind_orchestrator_v2',
);
assert.throws(
() => orchestratorCheckpointInternals.normalizeSchema('public; drop schema public'),
/Invalid orchestrator PostgreSQL schema/,
);
});