feat(ql3): establish 3.0 incubation baseline

This commit is contained in:
whyour
2026-08-12 00:25:26 +08:00
parent 4bf92dcfeb
commit c699c32461
2817 changed files with 779642 additions and 653 deletions
@@ -0,0 +1,56 @@
require('ts-node/register/transpile-only');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const {
registerRunRepositoryContract,
} = require('../../../test/contracts/runRepositoryContract.cjs');
const {
DuplicateIdempotencyKeyError,
DuplicateRunAttemptError,
DuplicateRunEventError,
MAX_CANCELLATION_RECOVERY_PAGE_SIZE,
MAX_RUN_EVENT_PAGE_SIZE,
MAX_RUN_EVENT_PAYLOAD_BYTES,
RunEventPayloadTooLargeError,
} = require('@qinglong/runtime-core');
const {
migrateLocalSqlitePath,
openLocalSqliteRuntimeDatabase,
} = require('../dist');
registerRunRepositoryContract({
name: 'Node SQLite local Profile binding',
defaultExecutionOwner: 'runtime',
contract: {
DuplicateIdempotencyKeyError,
DuplicateRunAttemptError,
DuplicateRunEventError,
RunEventPayloadTooLargeError,
MAX_CANCELLATION_RECOVERY_PAGE_SIZE,
MAX_RUN_EVENT_PAGE_SIZE,
MAX_RUN_EVENT_PAYLOAD_BYTES,
},
async createRepository() {
const directory = fs.mkdtempSync(
path.join(os.tmpdir(), 'ql3-local-repository-contract-'),
);
const options = {
databasePath: path.join(directory, 'qinglong3.sqlite'),
profile: 'edge',
};
await migrateLocalSqlitePath(options);
const runtime = await openLocalSqliteRuntimeDatabase(options);
return {
repository: runtime.runRepository,
async close() {
try {
await runtime.close();
} finally {
fs.rmSync(directory, { recursive: true, force: true });
}
},
};
},
});