@ancientpantheon/khronoton-core 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to `@ancientpantheon/khronoton-core`.
4
4
 
5
5
  The engine's pre-extraction history lives in the AncientHoldings hub, whose inline scheduler ("Cronoton") this package extracts and generalises.
6
6
 
7
+ ## 0.3.0 — 2026-07-13
8
+
9
+ Added the complete drop-in **codex-cronoton experience layer** — the UI, API handlers, and React data layer a consumer needs to reproduce the AncientHoldings Hub's cronoton UX end to end. The root `.` schedule engine and the `/server` automaton engine are **byte-unchanged** from 0.2.0 (verified by SHA-256 over the `dist/index.*` + `dist/server/**` outputs); this release is purely additive on new subpaths.
10
+
11
+ - **`/handlers` — framework-agnostic HTTP route handlers.** The full route surface over the `/server` store + executor — list / get / fires / signers / commit / edit / pause / resume / delete / simulate / execute-now / trigger / start-batch / get-batch / cancel-batch / recover — driven by a tiny `HandlerRequest`/`HandlerResponse` + `AuthSeam` contract so any router (Next.js route handlers, Express, …) mounts them without adaptation. Confirm-gated mutations raise a `NeedsConfirmError` the client layer re-prompts on.
12
+ - **`/provider` + `/hooks` — the React data layer.** `<KhronotonProvider adapter={…}>`, the 16-method `KhronotonAdapter` seam, two reference adapters (`createFetchAdapter` over HTTP, `createMemoryAdapter` over an in-process handler context), the shared `runGated` confirm→retry-once helper, and the data + action hooks (`useCronotons` / `useCronoton` / `useCronotonFires` [50/page + fires-while-running poller] / `useManualBatch` [batch poller] / `useCronotonActions` / the execute tier). Reference adapters keep their error contract via a shared status→seam map.
13
+ - **`/ui` + `/ui.css` — the React UI at full Hub parity.** Four screens: **List** (three access tiers, resolver pill, confirm-gated row actions), **Detail/Observe** (header actions with shared disable predicates, two-column metadata, the fire-history card with a 50/page pager, definition-drift flag, result tooltip, pluggable multi-tx renderer, and the wired recover affordance, plus the manual-batch and runtime-arg-trigger cards), **Builder** (two-pane Pact editor + Config/Payload/Gas Payer/Signatures/Execute tabs, create and edit, Simulate→AUTO-gas calibrate, commit gate), and a **Public** read-only transparency view. Styled entirely through `--khr-*` CSS variables scoped to `<KhronotonUiRoot>` — no Tailwind, no bundled assets.
14
+ - **Chain edge stays separate.** The `@stoachain/*` `ChainRuntime` implementation ships as the standalone `@ancientpantheon/khronoton-stoachain` adapter (peer-depending `@stoachain/*`), so `@ancientpantheon/khronoton-core` remains zero-runtime-dependency and chain-agnostic. `react` is an **optional peer** used only by the `/provider`, `/hooks`, and `/ui` subpaths.
15
+ - **Packaging.** All 6 JS subpaths carry dual `{ types, import, require }` conditions (dist-smoked under both `require` and `import`); `/ui.css` is a plain stylesheet export. `.tsx`/CSS entries build via tsup; `.`/`/server`/`/handlers` stay on plain `tsc` so the pre-existing outputs never move.
16
+
7
17
  ## 0.2.0 — 2026-07-12
8
18
 
9
19
  Added the **server/automaton engine** on a new `@ancientpantheon/khronoton-core/server` subpath — the stand-alone layer a consuming Automaton (e.g. Mnemosyne) needs to run scheduled, signed, on-chain firing. The root `.` schedule engine (7-mode math + `tickOnce`) is byte-unchanged; this is purely additive.
package/README.md CHANGED
@@ -6,7 +6,13 @@ Khronoton is the "When do I act?" Constructor of the Pantheon architecture — t
6
6
 
7
7
  ## Status
8
8
 
9
- **`0.2.0` on public npmjs** — the headless scheduler engine at the root `.` import (unchanged), plus a new **server/automaton engine** at the `@ancientpantheon/khronoton-core/server` subpath. The root schedule math (the 7-mode model, `computeNextFire`, `summariseSchedule`, the in-tree cron parser) and the injectable `tickOnce(now, deps)` engine are locked by contract suites; the `/server` surface adds the full stand-alone automaton behind six injection seams — the store + atomic claim-before-fire (exactly-once), the headless single-transaction executor, the server tick + `startKhronotonLoop`, the server-resolver registry, and `installSchema` — so a consuming Automaton (e.g. Mnemosyne) can run scheduled on-chain firing by injecting only its host adapters. Both import conditions (ESM `import` + CJS `require`) resolve on both the root and the subpath.
9
+ **`0.3.0` on public npmjs** — the complete drop-in codex-cronoton experience, matching the AncientHoldings Hub. On top of the byte-unchanged root `.` schedule engine and `/server` automaton engine (both from 0.2.0), 0.3.0 adds the whole experience layer as new subpaths so a consumer wires the Hub's cronoton UX end to end without re-implementing it:
10
+
11
+ - **`/handlers`** — framework-agnostic HTTP route handlers over the `/server` store + executor (list/get/fires/signers/commit/edit/pause/resume/delete/simulate/execute-now/trigger/batch/recover), driven by a tiny `HandlerRequest`/`HandlerResponse` seam so any router (Next.js, Express, …) can mount them.
12
+ - **`/provider` + `/hooks`** — the React data layer: `<KhronotonProvider adapter={…}>`, the 16-method `KhronotonAdapter` seam with two reference adapters (`createFetchAdapter` over HTTP, `createMemoryAdapter` over in-process handlers), the shared `runGated` confirm-retry, and the data + action hooks (`useCronotons`/`useCronoton`/`useCronotonFires`/`useManualBatch` + the lifecycle/execute action hooks).
13
+ - **`/ui` + `/ui.css`** — the React UI at full Hub parity: the four screens **List**, **Detail/Observe** (fire history with 50/page pager, definition-drift flag, result tooltip, pluggable multi-tx renderer, wired recover), **Builder** (two-pane create + edit, Config/Payload/Gas Payer/Signatures/Execute tabs, Simulate→AUTO-gas calibrate), and a **Public** read-only transparency view — themed entirely through `--khr-*` CSS variables inside `<KhronotonUiRoot>`.
14
+
15
+ Chain specifics stay out of core: the `@stoachain/*` `ChainRuntime` wrap ships as the separate **`@ancientpantheon/khronoton-stoachain`** adapter, so core remains zero-runtime-dependency and chain-agnostic. Every JS subpath resolves under both import conditions (ESM `import` + CJS `require`); React is an optional peer for the `/provider`, `/hooks`, and `/ui` subpaths only. The root `.` and `/server` outputs are byte-identical to 0.2.0.
10
16
 
11
17
  ## Schedule engine
12
18
 
@@ -218,6 +224,8 @@ npm install @ancientpantheon/khronoton-core
218
224
 
219
225
  ## Version history
220
226
 
227
+ **v0.3.0** — Added the complete drop-in **experience layer** on new subpaths, byte-preserving the root `.` and `/server` outputs from 0.2.0: `/handlers` (framework-agnostic HTTP route handlers over the store + executor, behind a tiny request/response seam), `/provider` + `/hooks` (the React data layer — `<KhronotonProvider>`, the 16-method `KhronotonAdapter` seam with `createFetchAdapter`/`createMemoryAdapter` reference adapters, the shared `runGated` confirm-retry, and the data + action hooks), and `/ui` + `/ui.css` (the React UI at full Hub parity — the four screens List, Detail/Observe with the 50/page fire-history pager + definition-drift + result tooltip + pluggable multi-tx renderer + wired recover, the two-pane create/edit Builder with Simulate→AUTO-gas calibrate, and a Public read-only view — themed via `--khr-*` inside `<KhronotonUiRoot>`). Chain specifics stay out of core as the separate `@ancientpantheon/khronoton-stoachain` `ChainRuntime` adapter; core stays zero-runtime-dependency with React an optional peer for the three React subpaths. Every JS subpath resolves under both ESM `import` and CJS `require`.
228
+
221
229
  **v0.2.0** — Added the server/automaton engine on the new `@ancientpantheon/khronoton-core/server` subpath (dual ESM `import` + CJS `require`), behind six injection seams (`KeyResolver`, `ChainRuntime`, `Database`, `onAudit`, `resolveFireMode`, `Config`): the store + atomic claim-before-fire (exactly-once, proven end-to-end), the headless single-transaction executor (never-throws-on-fire, dirty-read pre-flight, AUTO-gas calibrate, 504/derived-key recovery), the server tick + `startKhronotonLoop`, the server-resolver registry/dispatcher, and `installSchema` for the three tables — lifted faithfully from the AncientHoldings hub's inline `codex-cronoton` system and generalised. The root `.` schedule engine is unchanged.
222
230
 
223
231
  **v0.1.1** — Packaging fix: added a `require` condition to the exports map so the package is a drop-in for CommonJS consumers (e.g. the hub's tsx/CJS worker) as well as ESM. No API or behaviour change from v0.1.0.
@@ -0,0 +1,64 @@
1
+ import CodeMirror from '@uiw/react-codemirror';
2
+ import { EditorView } from '@codemirror/view';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/ui/PactCodeMirror.tsx
6
+ var GUTTER_BG = "#0d1117";
7
+ var ACTIVE_LINE_BG = "#161616";
8
+ var khronotonEditorTheme = EditorView.theme(
9
+ {
10
+ "&": {
11
+ backgroundColor: "var(--khr-panel, #0a0a0a)",
12
+ color: "var(--khr-mono, #d2d3d4)",
13
+ fontSize: "12px"
14
+ },
15
+ ".cm-content": {
16
+ fontFamily: "var(--khr-mono-font, ui-monospace, monospace)",
17
+ caretColor: "var(--khr-accent, #f0a500)"
18
+ },
19
+ ".cm-cursor, .cm-dropCursor": {
20
+ borderLeftColor: "var(--khr-accent, #f0a500)"
21
+ },
22
+ "&.cm-focused": {
23
+ outline: "none"
24
+ },
25
+ "&.cm-editor.cm-focused": {
26
+ outline: "1px solid var(--khr-accent, #f0a500)"
27
+ },
28
+ "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": {
29
+ backgroundColor: "var(--khr-accent-tint, #1a1500)"
30
+ },
31
+ ".cm-gutters": {
32
+ backgroundColor: GUTTER_BG,
33
+ color: "var(--khr-text-dim, #8a8f98)",
34
+ border: "none"
35
+ },
36
+ ".cm-activeLine": { backgroundColor: ACTIVE_LINE_BG },
37
+ ".cm-activeLineGutter": { backgroundColor: ACTIVE_LINE_BG }
38
+ },
39
+ { dark: true }
40
+ );
41
+ function PactCodeMirror({
42
+ value,
43
+ onChange,
44
+ height
45
+ }) {
46
+ return /* @__PURE__ */ jsx(
47
+ CodeMirror,
48
+ {
49
+ value,
50
+ height: `${height}px`,
51
+ theme: khronotonEditorTheme,
52
+ basicSetup: {
53
+ lineNumbers: true,
54
+ foldGutter: false,
55
+ closeBrackets: false,
56
+ autocompletion: false,
57
+ highlightActiveLine: true
58
+ },
59
+ onChange
60
+ }
61
+ );
62
+ }
63
+
64
+ export { PactCodeMirror as default };
@@ -0,0 +1,379 @@
1
+ import { useKhronotonAdapter, useKhronotonConfig, runGated } from './chunk-U3F5HEHO.js';
2
+ import { useState, useRef, useEffect, useCallback } from 'react';
3
+
4
+ function useCronotons(query) {
5
+ const adapter = useKhronotonAdapter();
6
+ const [cronotons, setCronotons] = useState([]);
7
+ const [loading, setLoading] = useState(true);
8
+ const [error, setError] = useState(null);
9
+ const mountedRef = useRef(true);
10
+ useEffect(() => {
11
+ mountedRef.current = true;
12
+ return () => {
13
+ mountedRef.current = false;
14
+ };
15
+ }, []);
16
+ const queryKey = JSON.stringify(query ?? null);
17
+ const load = useCallback(
18
+ async (isActive = () => mountedRef.current) => {
19
+ setLoading(true);
20
+ setError(null);
21
+ try {
22
+ const view = await adapter.list(query);
23
+ if (!isActive()) return;
24
+ setCronotons(view.codexCronotons);
25
+ } catch (err) {
26
+ if (!isActive()) return;
27
+ setError(err instanceof Error ? err : new Error(String(err)));
28
+ } finally {
29
+ if (isActive()) setLoading(false);
30
+ }
31
+ },
32
+ [adapter, queryKey]
33
+ );
34
+ useEffect(() => {
35
+ let active = true;
36
+ void load(() => active);
37
+ return () => {
38
+ active = false;
39
+ };
40
+ }, [load]);
41
+ return { cronotons, loading, error, refetch: () => load() };
42
+ }
43
+ function useCronoton(id) {
44
+ const adapter = useKhronotonAdapter();
45
+ const [cronoton, setCronoton] = useState(null);
46
+ const [loading, setLoading] = useState(true);
47
+ const [error, setError] = useState(null);
48
+ const mountedRef = useRef(true);
49
+ useEffect(() => {
50
+ mountedRef.current = true;
51
+ return () => {
52
+ mountedRef.current = false;
53
+ };
54
+ }, []);
55
+ const load = useCallback(
56
+ async (isActive = () => mountedRef.current) => {
57
+ setLoading(true);
58
+ setError(null);
59
+ try {
60
+ const view = await adapter.get(id);
61
+ if (!isActive()) return;
62
+ setCronoton(view.codexCronoton);
63
+ } catch (err) {
64
+ if (!isActive()) return;
65
+ setCronoton(null);
66
+ setError(err instanceof Error ? err : new Error(String(err)));
67
+ } finally {
68
+ if (isActive()) setLoading(false);
69
+ }
70
+ },
71
+ [adapter, id]
72
+ );
73
+ useEffect(() => {
74
+ let active = true;
75
+ void load(() => active);
76
+ return () => {
77
+ active = false;
78
+ };
79
+ }, [load]);
80
+ return { cronoton, loading, error, refetch: () => load() };
81
+ }
82
+ function useCronotonFires(id, opts = {}) {
83
+ const adapter = useKhronotonAdapter();
84
+ const config = useKhronotonConfig();
85
+ const pageSize = opts.pageSize ?? config.pageSize;
86
+ const cadence = config.pollCadenceMs;
87
+ const [fires, setFires] = useState([]);
88
+ const [total, setTotal] = useState(0);
89
+ const [page, setPageState] = useState(0);
90
+ const [loading, setLoading] = useState(false);
91
+ const [error, setError] = useState(null);
92
+ const pageCount = Math.max(1, Math.ceil(total / pageSize));
93
+ const offset = page * pageSize;
94
+ const totalRef = useRef(0);
95
+ totalRef.current = total;
96
+ const setPage = useCallback(
97
+ (next) => {
98
+ const maxPage = Math.max(0, Math.ceil(totalRef.current / pageSize) - 1);
99
+ setPageState(Math.min(Math.max(0, Math.floor(next)), maxPage));
100
+ },
101
+ [pageSize]
102
+ );
103
+ const mountedRef = useRef(true);
104
+ useEffect(() => {
105
+ mountedRef.current = true;
106
+ return () => {
107
+ mountedRef.current = false;
108
+ };
109
+ }, []);
110
+ const load = useCallback(
111
+ async (isActive = () => mountedRef.current) => {
112
+ setLoading(true);
113
+ setError(null);
114
+ try {
115
+ const res = await adapter.fires({ id, limit: pageSize, offset });
116
+ if (!isActive()) return;
117
+ setFires(res.fires);
118
+ setTotal(res.total);
119
+ } catch (err) {
120
+ if (!isActive()) return;
121
+ setError(err instanceof Error ? err : new Error(String(err)));
122
+ } finally {
123
+ if (isActive()) setLoading(false);
124
+ }
125
+ },
126
+ [adapter, id, pageSize, offset]
127
+ );
128
+ useEffect(() => {
129
+ if (typeof window === "undefined") return;
130
+ let active = true;
131
+ void load(() => active);
132
+ return () => {
133
+ active = false;
134
+ };
135
+ }, [load]);
136
+ const anyRunning = fires.some((f) => f.status === "running");
137
+ useEffect(() => {
138
+ if (typeof window === "undefined") return;
139
+ if (!anyRunning) return;
140
+ const timer = setInterval(() => {
141
+ adapter.fires({ id, limit: pageSize, offset }).then((res) => {
142
+ if (!mountedRef.current) return;
143
+ setFires(res.fires);
144
+ setTotal(res.total);
145
+ }).catch(() => {
146
+ });
147
+ }, cadence);
148
+ return () => clearInterval(timer);
149
+ }, [anyRunning, adapter, id, pageSize, offset, cadence]);
150
+ return { fires, total, page, pageCount, loading, error, setPage, refetch: () => void load() };
151
+ }
152
+ function toError(cause) {
153
+ return cause instanceof Error ? cause : new Error(String(cause));
154
+ }
155
+ function useManualBatch(id) {
156
+ const adapter = useKhronotonAdapter();
157
+ const config = useKhronotonConfig();
158
+ const [batch, setBatch] = useState(null);
159
+ const [loading, setLoading] = useState(true);
160
+ const [error, setError] = useState(null);
161
+ const mountedRef = useRef(true);
162
+ useEffect(() => {
163
+ mountedRef.current = true;
164
+ return () => {
165
+ mountedRef.current = false;
166
+ };
167
+ }, []);
168
+ const read = useCallback(
169
+ async (isActive = () => mountedRef.current) => {
170
+ setLoading(true);
171
+ try {
172
+ const res = await adapter.getBatch(id);
173
+ if (!isActive()) return;
174
+ setBatch(res.batch);
175
+ setError(null);
176
+ } catch (cause) {
177
+ if (!isActive()) return;
178
+ setError(toError(cause));
179
+ } finally {
180
+ if (isActive()) setLoading(false);
181
+ }
182
+ },
183
+ [adapter, id]
184
+ );
185
+ const refetch = useCallback(() => read(), [read]);
186
+ useEffect(() => {
187
+ let active2 = true;
188
+ void read(() => active2);
189
+ return () => {
190
+ active2 = false;
191
+ };
192
+ }, [read]);
193
+ const active = batch?.status === "active";
194
+ useEffect(() => {
195
+ if (!active) return;
196
+ const interval = setInterval(() => {
197
+ void adapter.getBatch(id).then((res) => {
198
+ if (mountedRef.current) setBatch(res.batch);
199
+ }).catch(() => {
200
+ });
201
+ }, config.pollCadenceMs);
202
+ return () => clearInterval(interval);
203
+ }, [active, adapter, id, config.pollCadenceMs]);
204
+ return { batch, active, loading, error, refetch };
205
+ }
206
+ function useGatedAction(makeCall, onNeedConfirm, onSuccess) {
207
+ const [pending, setPending] = useState(false);
208
+ const [error, setError] = useState(null);
209
+ const [result, setResult] = useState(null);
210
+ const mounted = useRef(true);
211
+ useEffect(() => {
212
+ mounted.current = true;
213
+ return () => {
214
+ mounted.current = false;
215
+ };
216
+ }, []);
217
+ const run = useCallback(
218
+ async (...args) => {
219
+ setPending(true);
220
+ setError(null);
221
+ try {
222
+ const body = await runGated(makeCall(...args), { onNeedConfirm });
223
+ if (mounted.current) {
224
+ setResult(body);
225
+ setPending(false);
226
+ }
227
+ onSuccess?.();
228
+ return { ok: true, result: body };
229
+ } catch (err) {
230
+ const surfaced = err instanceof Error ? err : new Error(String(err));
231
+ if (mounted.current) {
232
+ setError(surfaced);
233
+ setPending(false);
234
+ }
235
+ return { ok: false, error: surfaced };
236
+ }
237
+ },
238
+ [makeCall, onNeedConfirm, onSuccess]
239
+ );
240
+ return { run, pending, error, result };
241
+ }
242
+ function requireId(id, action) {
243
+ if (id == null) {
244
+ throw new Error(`useCronotonActions: an id is required to ${action} a cronoton`);
245
+ }
246
+ return id;
247
+ }
248
+ function useCronotonActions(id, options = {}) {
249
+ const adapter = useKhronotonAdapter();
250
+ const config = useKhronotonConfig();
251
+ const { onNeedConfirm } = config;
252
+ const { onSuccess } = options;
253
+ const create = useGatedAction(
254
+ useCallback((body) => (opts) => adapter.commit(body, opts), [adapter]),
255
+ onNeedConfirm,
256
+ onSuccess
257
+ );
258
+ const edit = useGatedAction(
259
+ useCallback(
260
+ (patch) => {
261
+ const target = requireId(id, "edit");
262
+ return (opts) => adapter.edit(target, patch, opts);
263
+ },
264
+ [adapter, id]
265
+ ),
266
+ onNeedConfirm,
267
+ onSuccess
268
+ );
269
+ const pause = useGatedAction(
270
+ useCallback(() => {
271
+ const target = requireId(id, "pause");
272
+ return (opts) => adapter.pause(target, opts);
273
+ }, [adapter, id]),
274
+ onNeedConfirm,
275
+ onSuccess
276
+ );
277
+ const resume = useGatedAction(
278
+ useCallback(() => {
279
+ const target = requireId(id, "resume");
280
+ return (opts) => adapter.resume(target, opts);
281
+ }, [adapter, id]),
282
+ onNeedConfirm,
283
+ onSuccess
284
+ );
285
+ const remove = useGatedAction(
286
+ useCallback(() => {
287
+ const target = requireId(id, "delete");
288
+ return (opts) => adapter.delete(target, opts);
289
+ }, [adapter, id]),
290
+ onNeedConfirm,
291
+ onSuccess
292
+ );
293
+ return { create, edit, pause, resume, remove };
294
+ }
295
+ var IDLE = { pending: false, error: null };
296
+ function useExecuteAction(invoke) {
297
+ const adapter = useKhronotonAdapter();
298
+ const [state, setState] = useState(IDLE);
299
+ const mounted = useRef(true);
300
+ useEffect(() => {
301
+ mounted.current = true;
302
+ return () => {
303
+ mounted.current = false;
304
+ };
305
+ }, []);
306
+ const run = useCallback(
307
+ async (...args) => {
308
+ setState({ pending: true, error: null });
309
+ try {
310
+ const result = await invoke(adapter, ...args);
311
+ if (mounted.current) setState({ pending: false, error: null, result });
312
+ return result;
313
+ } catch (err) {
314
+ if (mounted.current) {
315
+ setState({ pending: false, error: err });
316
+ }
317
+ return void 0;
318
+ }
319
+ },
320
+ // `invoke` is a stable module-level function per hook; the adapter identity is
321
+ // stable per mount — so `run` only re-creates if the mounted adapter changes.
322
+ [adapter, invoke]
323
+ );
324
+ return { run, pending: state.pending, error: state.error, result: state.result };
325
+ }
326
+ function useExecuteNow() {
327
+ const { onNeedConfirm } = useKhronotonConfig();
328
+ return useExecuteAction(
329
+ useCallback(
330
+ (adapter, id) => runGated((opts) => adapter.executeNow(id, opts), { onNeedConfirm }),
331
+ [onNeedConfirm]
332
+ )
333
+ );
334
+ }
335
+ function useTrigger() {
336
+ const { onNeedConfirm } = useKhronotonConfig();
337
+ return useExecuteAction(
338
+ useCallback(
339
+ (adapter, id, args) => runGated((opts) => adapter.trigger(id, args, opts), { onNeedConfirm }),
340
+ [onNeedConfirm]
341
+ )
342
+ );
343
+ }
344
+ function useSimulate() {
345
+ const { onNeedConfirm } = useKhronotonConfig();
346
+ return useExecuteAction(
347
+ useCallback(
348
+ (adapter, envelope) => runGated((opts) => adapter.simulate(envelope, opts), { onNeedConfirm }),
349
+ [onNeedConfirm]
350
+ )
351
+ );
352
+ }
353
+ function useStartBatch() {
354
+ const { onNeedConfirm } = useKhronotonConfig();
355
+ return useExecuteAction(
356
+ useCallback(
357
+ (adapter, id, count) => runGated((opts) => adapter.startBatch(id, count, opts), { onNeedConfirm }),
358
+ [onNeedConfirm]
359
+ )
360
+ );
361
+ }
362
+ function useCancelBatch() {
363
+ return useExecuteAction(
364
+ useCallback((adapter, id) => adapter.cancelBatch(id), [])
365
+ );
366
+ }
367
+ function useRecoverFire() {
368
+ const { onNeedConfirm } = useKhronotonConfig();
369
+ return useExecuteAction(
370
+ useCallback(
371
+ (adapter, id, fireId, requestKey) => runGated((opts) => adapter.recover(id, fireId, requestKey, opts), {
372
+ onNeedConfirm
373
+ }),
374
+ [onNeedConfirm]
375
+ )
376
+ );
377
+ }
378
+
379
+ export { useCancelBatch, useCronoton, useCronotonActions, useCronotonFires, useCronotons, useExecuteNow, useManualBatch, useRecoverFire, useSimulate, useStartBatch, useTrigger };