feat: mutate canonical drafts from workbench

This commit is contained in:
lda
2026-08-09 07:18:57 +07:00 Verified
parent 29cbcc66c5
commit 71f997f221
14 changed files with 1225 additions and 79 deletions
+10 -2
View File
@@ -1,5 +1,5 @@
import { useOutletContext } from "react-router-dom";
import type { ConnectionState, EvidenceRecord } from "../app/state.js";
import { initialState, type ConnectionState, type EvidenceRecord } from "../app/state.js";
import type { ConsoleReadExecutor } from "./domain/read-executor.js";
import type { ConsoleWriteExecutor } from "./domain/write-executor.js";
@@ -11,5 +11,13 @@ export type ConsoleWorkspaceContextValue = {
readonly writeExecutor: ConsoleWriteExecutor | null;
};
const STANDALONE_CONTEXT: ConsoleWorkspaceContextValue = {
connection: initialState(),
connectedTarget: null,
recordEvidence: () => undefined,
readExecutor: null,
writeExecutor: null,
};
export const useConsoleWorkspace = (): ConsoleWorkspaceContextValue =>
useOutletContext<ConsoleWorkspaceContextValue>();
useOutletContext<ConsoleWorkspaceContextValue>() ?? STANDALONE_CONTEXT;