@leitwerk-dev/server 0.3.0 → 0.3.1
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/dist/{app-WfwKzrVk.d.ts → app-BuJCdkvy.d.ts} +82 -2
- package/dist/app-MSJXFK33.js +8 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/{chunk-KIOQNNG6.js → chunk-HK6BLLHA.js} +738 -506
- package/dist/chunk-HK6BLLHA.js.map +1 -0
- package/dist/{chunk-LK3RO6C7.js → chunk-QCHS3X33.js} +486 -136
- package/dist/chunk-QCHS3X33.js.map +1 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/mapped-llm-run-repo.d.ts +56 -0
- package/dist/db/mapped-llm-run-repo.d.ts.map +1 -0
- package/dist/db/process-turn-record-repo.d.ts +3 -1
- package/dist/db/process-turn-record-repo.d.ts.map +1 -1
- package/dist/db/repo-helpers.d.ts +6 -0
- package/dist/db/repo-helpers.d.ts.map +1 -1
- package/dist/db/repositories.d.ts +4 -0
- package/dist/db/repositories.d.ts.map +1 -1
- package/dist/db/schema.d.ts +415 -0
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/turn-start-record-repo.d.ts.map +1 -1
- package/dist/domain-logic/outcome-tools.d.ts.map +1 -1
- package/dist/future-execution-presenter.d.ts +4 -14
- package/dist/future-execution-presenter.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/launch-coordinator-test-harness.d.ts.map +1 -1
- package/dist/main.js +3 -3
- package/dist/process-action-presenter.d.ts +16 -0
- package/dist/process-action-presenter.d.ts.map +1 -0
- package/dist/process-engine/mapped-turns.d.ts +45 -0
- package/dist/process-engine/mapped-turns.d.ts.map +1 -0
- package/dist/process-engine/operation.d.ts +1 -1
- package/dist/process-engine/operation.d.ts.map +1 -1
- package/dist/process-engine/ops/accept-worker-turn-start.d.ts +2 -0
- package/dist/process-engine/ops/accept-worker-turn-start.d.ts.map +1 -1
- package/dist/process-engine/ops/retry-startup.d.ts.map +1 -1
- package/dist/process-engine/ops/turn-outcome.d.ts.map +1 -1
- package/dist/process-engine/recorder.d.ts.map +1 -1
- package/dist/process-engine/types.d.ts +5 -0
- package/dist/process-engine/types.d.ts.map +1 -1
- package/dist/process-engine/writes/build-process-abort-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-recovery-start-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-turn-outcome-writes.d.ts +8 -1
- package/dist/process-engine/writes/build-turn-outcome-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/build-turn-selection-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/commit-writes.d.ts.map +1 -1
- package/dist/process-engine/writes/reserve-selected-turn-start.d.ts +5 -0
- package/dist/process-engine/writes/reserve-selected-turn-start.d.ts.map +1 -0
- package/dist/process-engine/writes/writes.d.ts +18 -0
- package/dist/process-engine/writes/writes.d.ts.map +1 -1
- package/dist/process-turn-navigation.d.ts +12 -2
- package/dist/process-turn-navigation.d.ts.map +1 -1
- package/dist/process-ui-snapshot-presenter.d.ts +2 -1
- package/dist/process-ui-snapshot-presenter.d.ts.map +1 -1
- package/dist/routes/process-actions.d.ts.map +1 -1
- package/dist/routes/process-diagnostics-assembler.d.ts +3 -1
- package/dist/routes/process-diagnostics-assembler.d.ts.map +1 -1
- package/dist/routes/process-primary-path-assembler.d.ts +4 -12
- package/dist/routes/process-primary-path-assembler.d.ts.map +1 -1
- package/dist/routes/process-route-helpers.d.ts +7 -32
- package/dist/routes/process-route-helpers.d.ts.map +1 -1
- package/dist/supervisor/ipc-handler.d.ts.map +1 -1
- package/dist/supervisor/worker-start-payload-builder.d.ts +2 -0
- package/dist/supervisor/worker-start-payload-builder.d.ts.map +1 -1
- package/dist/supervisor/worker-supervisor.d.ts +2 -0
- package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
- package/dist/supervisor/worker-turn-ipc-recorder.d.ts +2 -2
- package/dist/supervisor/worker-turn-ipc-recorder.d.ts.map +1 -1
- package/dist/test-helpers/accepted-turn-start.d.ts +18 -4
- package/dist/test-helpers/accepted-turn-start.d.ts.map +1 -1
- package/dist/test-helpers/owned-test-deps.d.ts +18 -0
- package/dist/test-helpers/owned-test-deps.d.ts.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +13 -10
- package/dist/testing.js.map +1 -1
- package/package.json +11 -11
- package/src/app.ts +2 -0
- package/src/db/database.ts +28 -0
- package/src/db/mapped-llm-run-repo.ts +177 -0
- package/src/db/process-turn-record-repo.ts +8 -1
- package/src/db/repo-helpers.ts +11 -1
- package/src/db/repositories.ts +5 -0
- package/src/db/schema.ts +70 -1
- package/src/db/turn-start-record-repo.ts +5 -1
- package/src/domain-logic/outcome-tools.ts +50 -6
- package/src/future-execution-presenter.ts +10 -17
- package/src/launch-coordinator-test-harness.ts +8 -4
- package/src/process-action-presenter.ts +133 -0
- package/src/process-engine/engine.ts +2 -2
- package/src/process-engine/mapped-turns.ts +330 -0
- package/src/process-engine/operation.ts +1 -1
- package/src/process-engine/ops/accept-worker-turn-start.ts +6 -0
- package/src/process-engine/ops/retry-startup.ts +1 -0
- package/src/process-engine/ops/turn-outcome.ts +7 -5
- package/src/process-engine/recorder.ts +12 -0
- package/src/process-engine/runner.ts +8 -8
- package/src/process-engine/types.ts +6 -0
- package/src/process-engine/writes/build-process-abort-writes.ts +1 -0
- package/src/process-engine/writes/build-recovery-start-writes.ts +1 -0
- package/src/process-engine/writes/build-turn-outcome-writes.ts +80 -20
- package/src/process-engine/writes/build-turn-selection-writes.ts +2 -31
- package/src/process-engine/writes/commit-writes.ts +5 -0
- package/src/process-engine/writes/reserve-selected-turn-start.ts +44 -0
- package/src/process-engine/writes/writes.ts +27 -0
- package/src/process-turn-navigation.ts +86 -8
- package/src/process-ui-snapshot-presenter.ts +40 -4
- package/src/routes/process-actions.ts +1 -1
- package/src/routes/process-diagnostics-assembler.ts +32 -6
- package/src/routes/process-primary-path-assembler.ts +17 -33
- package/src/routes/process-route-helpers.ts +8 -165
- package/src/supervisor/ipc-handler.ts +27 -18
- package/src/supervisor/worker-start-payload-builder.ts +25 -0
- package/src/supervisor/worker-supervisor.ts +2 -0
- package/src/supervisor/worker-turn-ipc-recorder.ts +13 -1
- package/src/test-helpers/accepted-turn-start.ts +51 -27
- package/src/test-helpers/owned-test-deps.ts +45 -0
- package/src/testing.ts +4 -1
- package/dist/app-4QSV4FUQ.js +0 -8
- package/dist/chunk-KIOQNNG6.js.map +0 -1
- package/dist/chunk-LK3RO6C7.js.map +0 -1
- /package/dist/{app-4QSV4FUQ.js.map → app-MSJXFK33.js.map} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import { onTestFinished } from "vitest";
|
|
3
|
+
import { closeDatabase, createDatabase, createInMemoryDatabase } from "../db/database.js";
|
|
4
|
+
import { createTestDeps } from "./unit-deps.js";
|
|
5
|
+
|
|
6
|
+
/** Creates repositories whose database is owned by the current test. @internal */
|
|
7
|
+
export function createOwnedTestDeps(...args: Parameters<typeof createTestDeps>) {
|
|
8
|
+
const deps = createTestDeps(...args);
|
|
9
|
+
onTestFinished(() => closeDatabase(deps.db));
|
|
10
|
+
return deps;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Creates an in-memory database owned by the current test. @internal */
|
|
14
|
+
export function createOwnedInMemoryDatabase(...args: Parameters<typeof createInMemoryDatabase>) {
|
|
15
|
+
const db = createInMemoryDatabase(...args);
|
|
16
|
+
onTestFinished(() => {
|
|
17
|
+
if (db.$client.isOpen) db.$client.close();
|
|
18
|
+
});
|
|
19
|
+
return db;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Tracks file handles so tests can close them before removing storage. @internal */
|
|
23
|
+
export function createOwnedDatabaseScope() {
|
|
24
|
+
const handles = new Set<DatabaseSync>();
|
|
25
|
+
function closeOwnedSqlite() {
|
|
26
|
+
for (const db of handles) if (db.isOpen) db.close();
|
|
27
|
+
handles.clear();
|
|
28
|
+
}
|
|
29
|
+
function own(sqlite: DatabaseSync) {
|
|
30
|
+
handles.add(sqlite);
|
|
31
|
+
onTestFinished(closeOwnedSqlite);
|
|
32
|
+
return sqlite;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
closeOwnedSqlite,
|
|
36
|
+
createDatabase(...args: Parameters<typeof createDatabase>) {
|
|
37
|
+
const db = createDatabase(...args);
|
|
38
|
+
own(db.$client);
|
|
39
|
+
return db;
|
|
40
|
+
},
|
|
41
|
+
openOwnedSqlite(...args: ConstructorParameters<typeof DatabaseSync>) {
|
|
42
|
+
return own(new DatabaseSync(...args));
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
package/src/testing.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export type { ReadonlyPiSessionTree } from "./pi-session-tree.js";
|
|
2
2
|
export { buildTurnTraceIndexFromSession } from "./process-turn-trace.js";
|
|
3
3
|
export { buildProcessUiSnapshotProjections } from "./process-ui-snapshot-presenter.js";
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
createAcceptedLlmTurn,
|
|
6
|
+
createAcceptedWorkerTurn,
|
|
7
|
+
} from "./test-helpers/accepted-turn-start.js";
|
|
5
8
|
export { prepareAcceptedFixtureStart } from "./test-helpers/prepared-fixture-start.js";
|
|
6
9
|
export { writeProcessSessionSnapshot } from "./test-helpers/session-snapshot-fixtures.js";
|
|
7
10
|
export { createTestDeps } from "./test-helpers/unit-deps.js";
|