@amaranthic/hernex 0.0.0-stage → 0.2.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.
Files changed (259) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +66 -2
  3. package/dist/ai.d.ts +11 -0
  4. package/dist/ai.d.ts.map +1 -0
  5. package/dist/ai.js +11 -0
  6. package/dist/ai.js.map +1 -0
  7. package/dist/checkpoints/FileCheckpointStore.d.ts +95 -0
  8. package/dist/checkpoints/FileCheckpointStore.d.ts.map +1 -0
  9. package/dist/checkpoints/FileCheckpointStore.js +412 -0
  10. package/dist/checkpoints/FileCheckpointStore.js.map +1 -0
  11. package/dist/checkpoints/index.d.ts +7 -0
  12. package/dist/checkpoints/index.d.ts.map +1 -0
  13. package/dist/checkpoints/index.js +7 -0
  14. package/dist/checkpoints/index.js.map +1 -0
  15. package/dist/checkpoints/types.d.ts +157 -0
  16. package/dist/checkpoints/types.d.ts.map +1 -0
  17. package/dist/checkpoints/types.js +6 -0
  18. package/dist/checkpoints/types.js.map +1 -0
  19. package/dist/engine/AgentEngine.d.ts +156 -0
  20. package/dist/engine/AgentEngine.d.ts.map +1 -0
  21. package/dist/engine/AgentEngine.js +288 -0
  22. package/dist/engine/AgentEngine.js.map +1 -0
  23. package/dist/engine/engineConfig.d.ts +138 -0
  24. package/dist/engine/engineConfig.d.ts.map +1 -0
  25. package/dist/engine/engineConfig.js +6 -0
  26. package/dist/engine/engineConfig.js.map +1 -0
  27. package/dist/engine/eventQueue.d.ts +42 -0
  28. package/dist/engine/eventQueue.d.ts.map +1 -0
  29. package/dist/engine/eventQueue.js +93 -0
  30. package/dist/engine/eventQueue.js.map +1 -0
  31. package/dist/engine/index.d.ts +7 -0
  32. package/dist/engine/index.d.ts.map +1 -0
  33. package/dist/engine/index.js +6 -0
  34. package/dist/engine/index.js.map +1 -0
  35. package/dist/engine/runTurn.d.ts +17 -0
  36. package/dist/engine/runTurn.d.ts.map +1 -0
  37. package/dist/engine/runTurn.js +684 -0
  38. package/dist/engine/runTurn.js.map +1 -0
  39. package/dist/errors.d.ts +142 -0
  40. package/dist/errors.d.ts.map +1 -0
  41. package/dist/errors.js +174 -0
  42. package/dist/errors.js.map +1 -0
  43. package/dist/events/checkpointEvents.d.ts +20 -0
  44. package/dist/events/checkpointEvents.d.ts.map +1 -0
  45. package/dist/events/checkpointEvents.js +6 -0
  46. package/dist/events/checkpointEvents.js.map +1 -0
  47. package/dist/events/errorEvents.d.ts +23 -0
  48. package/dist/events/errorEvents.d.ts.map +1 -0
  49. package/dist/events/errorEvents.js +6 -0
  50. package/dist/events/errorEvents.js.map +1 -0
  51. package/dist/events/index.d.ts +11 -0
  52. package/dist/events/index.d.ts.map +1 -0
  53. package/dist/events/index.js +6 -0
  54. package/dist/events/index.js.map +1 -0
  55. package/dist/events/stepEvents.d.ts +68 -0
  56. package/dist/events/stepEvents.d.ts.map +1 -0
  57. package/dist/events/stepEvents.js +6 -0
  58. package/dist/events/stepEvents.js.map +1 -0
  59. package/dist/events/streamEvents.d.ts +41 -0
  60. package/dist/events/streamEvents.d.ts.map +1 -0
  61. package/dist/events/streamEvents.js +6 -0
  62. package/dist/events/streamEvents.js.map +1 -0
  63. package/dist/events/toolEvents.d.ts +62 -0
  64. package/dist/events/toolEvents.d.ts.map +1 -0
  65. package/dist/events/toolEvents.js +6 -0
  66. package/dist/events/toolEvents.js.map +1 -0
  67. package/dist/events/types.d.ts +37 -0
  68. package/dist/events/types.d.ts.map +1 -0
  69. package/dist/events/types.js +6 -0
  70. package/dist/events/types.js.map +1 -0
  71. package/dist/hooks/composeAgentHooks.d.ts +14 -0
  72. package/dist/hooks/composeAgentHooks.d.ts.map +1 -0
  73. package/dist/hooks/composeAgentHooks.js +142 -0
  74. package/dist/hooks/composeAgentHooks.js.map +1 -0
  75. package/dist/hooks/index.d.ts +7 -0
  76. package/dist/hooks/index.d.ts.map +1 -0
  77. package/dist/hooks/index.js +6 -0
  78. package/dist/hooks/index.js.map +1 -0
  79. package/dist/hooks/types.d.ts +133 -0
  80. package/dist/hooks/types.d.ts.map +1 -0
  81. package/dist/hooks/types.js +6 -0
  82. package/dist/hooks/types.js.map +1 -0
  83. package/dist/index.d.ts +26 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +25 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/model/ProviderRegistry.d.ts +62 -0
  88. package/dist/model/ProviderRegistry.d.ts.map +1 -0
  89. package/dist/model/ProviderRegistry.js +114 -0
  90. package/dist/model/ProviderRegistry.js.map +1 -0
  91. package/dist/model/providers/alibaba.d.ts +11 -0
  92. package/dist/model/providers/alibaba.d.ts.map +1 -0
  93. package/dist/model/providers/alibaba.js +16 -0
  94. package/dist/model/providers/alibaba.js.map +1 -0
  95. package/dist/model/providers/anthropic.d.ts +11 -0
  96. package/dist/model/providers/anthropic.d.ts.map +1 -0
  97. package/dist/model/providers/anthropic.js +16 -0
  98. package/dist/model/providers/anthropic.js.map +1 -0
  99. package/dist/model/providers/cohere.d.ts +11 -0
  100. package/dist/model/providers/cohere.d.ts.map +1 -0
  101. package/dist/model/providers/cohere.js +16 -0
  102. package/dist/model/providers/cohere.js.map +1 -0
  103. package/dist/model/providers/compatible.d.ts +11 -0
  104. package/dist/model/providers/compatible.d.ts.map +1 -0
  105. package/dist/model/providers/compatible.js +17 -0
  106. package/dist/model/providers/compatible.js.map +1 -0
  107. package/dist/model/providers/deepseek.d.ts +11 -0
  108. package/dist/model/providers/deepseek.d.ts.map +1 -0
  109. package/dist/model/providers/deepseek.js +16 -0
  110. package/dist/model/providers/deepseek.js.map +1 -0
  111. package/dist/model/providers/google.d.ts +11 -0
  112. package/dist/model/providers/google.d.ts.map +1 -0
  113. package/dist/model/providers/google.js +16 -0
  114. package/dist/model/providers/google.js.map +1 -0
  115. package/dist/model/providers/groq.d.ts +11 -0
  116. package/dist/model/providers/groq.d.ts.map +1 -0
  117. package/dist/model/providers/groq.js +16 -0
  118. package/dist/model/providers/groq.js.map +1 -0
  119. package/dist/model/providers/mistral.d.ts +11 -0
  120. package/dist/model/providers/mistral.d.ts.map +1 -0
  121. package/dist/model/providers/mistral.js +16 -0
  122. package/dist/model/providers/mistral.js.map +1 -0
  123. package/dist/model/providers/openai.d.ts +11 -0
  124. package/dist/model/providers/openai.d.ts.map +1 -0
  125. package/dist/model/providers/openai.js +16 -0
  126. package/dist/model/providers/openai.js.map +1 -0
  127. package/dist/model/providers/openrouter.d.ts +14 -0
  128. package/dist/model/providers/openrouter.d.ts.map +1 -0
  129. package/dist/model/providers/openrouter.js +20 -0
  130. package/dist/model/providers/openrouter.js.map +1 -0
  131. package/dist/model/providers/togetherai.d.ts +11 -0
  132. package/dist/model/providers/togetherai.d.ts.map +1 -0
  133. package/dist/model/providers/togetherai.js +16 -0
  134. package/dist/model/providers/togetherai.js.map +1 -0
  135. package/dist/model/providers/vercelGateway.d.ts +14 -0
  136. package/dist/model/providers/vercelGateway.d.ts.map +1 -0
  137. package/dist/model/providers/vercelGateway.js +19 -0
  138. package/dist/model/providers/vercelGateway.js.map +1 -0
  139. package/dist/model/providers/xai.d.ts +11 -0
  140. package/dist/model/providers/xai.d.ts.map +1 -0
  141. package/dist/model/providers/xai.js +16 -0
  142. package/dist/model/providers/xai.js.map +1 -0
  143. package/dist/model/resolveModel.d.ts +45 -0
  144. package/dist/model/resolveModel.d.ts.map +1 -0
  145. package/dist/model/resolveModel.js +109 -0
  146. package/dist/model/resolveModel.js.map +1 -0
  147. package/dist/model/types.d.ts +98 -0
  148. package/dist/model/types.d.ts.map +1 -0
  149. package/dist/model/types.js +6 -0
  150. package/dist/model/types.js.map +1 -0
  151. package/dist/runtime.d.ts +74 -0
  152. package/dist/runtime.d.ts.map +1 -0
  153. package/dist/runtime.js +41 -0
  154. package/dist/runtime.js.map +1 -0
  155. package/dist/storage/atomicFile.d.ts +28 -0
  156. package/dist/storage/atomicFile.d.ts.map +1 -0
  157. package/dist/storage/atomicFile.js +56 -0
  158. package/dist/storage/atomicFile.js.map +1 -0
  159. package/dist/storage/homeDirectory.d.ts +21 -0
  160. package/dist/storage/homeDirectory.d.ts.map +1 -0
  161. package/dist/storage/homeDirectory.js +36 -0
  162. package/dist/storage/homeDirectory.js.map +1 -0
  163. package/dist/storage/index.d.ts +10 -0
  164. package/dist/storage/index.d.ts.map +1 -0
  165. package/dist/storage/index.js +10 -0
  166. package/dist/storage/index.js.map +1 -0
  167. package/dist/storage/jsonl.d.ts +46 -0
  168. package/dist/storage/jsonl.d.ts.map +1 -0
  169. package/dist/storage/jsonl.js +121 -0
  170. package/dist/storage/jsonl.js.map +1 -0
  171. package/dist/storage/lock.d.ts +47 -0
  172. package/dist/storage/lock.d.ts.map +1 -0
  173. package/dist/storage/lock.js +126 -0
  174. package/dist/storage/lock.js.map +1 -0
  175. package/dist/storage/valueCodec.d.ts +68 -0
  176. package/dist/storage/valueCodec.d.ts.map +1 -0
  177. package/dist/storage/valueCodec.js +140 -0
  178. package/dist/storage/valueCodec.js.map +1 -0
  179. package/dist/tasks/TaskManager.d.ts +155 -0
  180. package/dist/tasks/TaskManager.d.ts.map +1 -0
  181. package/dist/tasks/TaskManager.js +774 -0
  182. package/dist/tasks/TaskManager.js.map +1 -0
  183. package/dist/tasks/index.d.ts +7 -0
  184. package/dist/tasks/index.d.ts.map +1 -0
  185. package/dist/tasks/index.js +6 -0
  186. package/dist/tasks/index.js.map +1 -0
  187. package/dist/tasks/types.d.ts +160 -0
  188. package/dist/tasks/types.d.ts.map +1 -0
  189. package/dist/tasks/types.js +8 -0
  190. package/dist/tasks/types.js.map +1 -0
  191. package/dist/threads/FileThreadStore.d.ts +118 -0
  192. package/dist/threads/FileThreadStore.d.ts.map +1 -0
  193. package/dist/threads/FileThreadStore.js +320 -0
  194. package/dist/threads/FileThreadStore.js.map +1 -0
  195. package/dist/threads/index.d.ts +7 -0
  196. package/dist/threads/index.d.ts.map +1 -0
  197. package/dist/threads/index.js +7 -0
  198. package/dist/threads/index.js.map +1 -0
  199. package/dist/threads/types.d.ts +230 -0
  200. package/dist/threads/types.d.ts.map +1 -0
  201. package/dist/threads/types.js +6 -0
  202. package/dist/threads/types.js.map +1 -0
  203. package/dist/tools/AgentTool.d.ts +38 -0
  204. package/dist/tools/AgentTool.d.ts.map +1 -0
  205. package/dist/tools/AgentTool.js +6 -0
  206. package/dist/tools/AgentTool.js.map +1 -0
  207. package/dist/tools/BashTool.d.ts +61 -0
  208. package/dist/tools/BashTool.d.ts.map +1 -0
  209. package/dist/tools/BashTool.js +142 -0
  210. package/dist/tools/BashTool.js.map +1 -0
  211. package/dist/tools/EditFileTool.d.ts +49 -0
  212. package/dist/tools/EditFileTool.d.ts.map +1 -0
  213. package/dist/tools/EditFileTool.js +114 -0
  214. package/dist/tools/EditFileTool.js.map +1 -0
  215. package/dist/tools/GlobTool.d.ts +48 -0
  216. package/dist/tools/GlobTool.d.ts.map +1 -0
  217. package/dist/tools/GlobTool.js +117 -0
  218. package/dist/tools/GlobTool.js.map +1 -0
  219. package/dist/tools/GrepTool.d.ts +73 -0
  220. package/dist/tools/GrepTool.d.ts.map +1 -0
  221. package/dist/tools/GrepTool.js +250 -0
  222. package/dist/tools/GrepTool.js.map +1 -0
  223. package/dist/tools/ReadFileTool.d.ts +51 -0
  224. package/dist/tools/ReadFileTool.d.ts.map +1 -0
  225. package/dist/tools/ReadFileTool.js +153 -0
  226. package/dist/tools/ReadFileTool.js.map +1 -0
  227. package/dist/tools/TaskManagerTool.d.ts +102 -0
  228. package/dist/tools/TaskManagerTool.d.ts.map +1 -0
  229. package/dist/tools/TaskManagerTool.js +130 -0
  230. package/dist/tools/TaskManagerTool.js.map +1 -0
  231. package/dist/tools/ToolExecutionContext.d.ts +61 -0
  232. package/dist/tools/ToolExecutionContext.d.ts.map +1 -0
  233. package/dist/tools/ToolExecutionContext.js +8 -0
  234. package/dist/tools/ToolExecutionContext.js.map +1 -0
  235. package/dist/tools/ToolRegistry.d.ts +82 -0
  236. package/dist/tools/ToolRegistry.d.ts.map +1 -0
  237. package/dist/tools/ToolRegistry.js +116 -0
  238. package/dist/tools/ToolRegistry.js.map +1 -0
  239. package/dist/tools/WriteFileTool.d.ts +46 -0
  240. package/dist/tools/WriteFileTool.d.ts.map +1 -0
  241. package/dist/tools/WriteFileTool.js +87 -0
  242. package/dist/tools/WriteFileTool.js.map +1 -0
  243. package/dist/tools/index.d.ts +17 -0
  244. package/dist/tools/index.d.ts.map +1 -0
  245. package/dist/tools/index.js +17 -0
  246. package/dist/tools/index.js.map +1 -0
  247. package/dist/tools/internal/bashEnvironment.d.ts +20 -0
  248. package/dist/tools/internal/bashEnvironment.d.ts.map +1 -0
  249. package/dist/tools/internal/bashEnvironment.js +65 -0
  250. package/dist/tools/internal/bashEnvironment.js.map +1 -0
  251. package/dist/tools/internal/pathGuard.d.ts +27 -0
  252. package/dist/tools/internal/pathGuard.d.ts.map +1 -0
  253. package/dist/tools/internal/pathGuard.js +99 -0
  254. package/dist/tools/internal/pathGuard.js.map +1 -0
  255. package/dist/tools/prompts.d.ts +33 -0
  256. package/dist/tools/prompts.d.ts.map +1 -0
  257. package/dist/tools/prompts.js +48 -0
  258. package/dist/tools/prompts.js.map +1 -0
  259. package/package.json +64 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amaranthic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,67 @@
1
- # Temporary Holding Version
1
+ # @amaranthic/hernex
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/@amaranthic/hernex.svg?style=flat-square)](https://www.npmjs.com/package/@amaranthic/hernex)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
5
+ [![Node.js](https://img.shields.io/badge/Node-%3E%3D22-brightgreen.svg?style=flat-square)](https://nodejs.org)
6
+ [![Bun](https://img.shields.io/badge/Bun-%3E%3D1.2-black.svg?style=flat-square)](https://bun.sh)
7
+ [![Vercel AI SDK](https://img.shields.io/badge/AI%20SDK-v7-black.svg?style=flat-square)](https://ai-sdk.dev)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-blue.svg?style=flat-square)](https://www.typescriptlang.org)
9
+
10
+ Harnex is a focused agent execution harness and runtime bridge between application code and the Vercel AI SDK. It provides deterministic multi-step turn loops, fail-closed tool authorization, single-owner process execution, and content-addressed snapshot rollbacks while leaving agent personas, user experience, and high-level goal planning to product code.
11
+
12
+ ---
13
+
14
+ ## Quick Start
15
+
16
+ ```bash
17
+ bun add @amaranthic/hernex
18
+ ```
19
+
20
+ ```typescript
21
+ import { AgentEngine, ToolRegistry } from "@amaranthic/hernex";
22
+
23
+ const tools = new ToolRegistry({ includeDefaults: true });
24
+
25
+ const engine = new AgentEngine({
26
+ threadId: "session-001",
27
+ workingDirectory: process.cwd(),
28
+ model: "anthropic/claude-3-7-sonnet",
29
+ apiKey: process.env.ANTHROPIC_API_KEY!,
30
+ baseUrl: "https://api.anthropic.com/v1",
31
+ tools,
32
+ hooks: {
33
+ onAuthorizeTool: async () => ({ decision: "allow" }),
34
+ },
35
+ });
36
+
37
+ for await (const event of engine.runTurn("Check working directory status")) {
38
+ if (event.type === "tokenDelta") {
39
+ process.stdout.write(event.text);
40
+ }
41
+ }
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Key Invariants
47
+
48
+ 1. **Explicit Credentials**: All runtime calls require explicit, non-empty `apiKey` and `baseUrl`. There are no hidden ambient environment variable fallbacks.
49
+ 2. **First-Slash Model Parsing**: Models format as `provider/model_id` (e.g. `openrouter/openrouter/free`). Splitting occurs strictly on the first slash only.
50
+ 3. **Fail-Closed Authorization**: All tools require explicit authorization via `hooks.onAuthorizeTool`; omission denies execution.
51
+ 4. **Host Shell Capability**: `BashTool` runs with the host user's permissions with environment sanitization. It is an authorized host shell capability, not a filesystem sandbox.
52
+ 5. **Raw SDK Subpath**: Direct Vercel AI SDK functions and schemas remain accessible via `@amaranthic/hernex/ai`.
53
+
54
+ ---
55
+
56
+ ## Documentation
57
+
58
+ - [Agent Engine & Turn Lifecycle](docs/agent.md)
59
+ - [Outward Streaming Events](docs/events.md)
60
+ - [Inward Interception Hooks](docs/hooks.md)
61
+ - [Tool Registry & Process Tools](docs/tools.md)
62
+
63
+ ---
64
+
65
+ ## License
66
+
67
+ MIT © Amaranthic
package/dist/ai.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview Explicit raw Vercel AI SDK escape hatch for `@amaranthic/hernex/ai`.
3
+ *
4
+ * @remarks
5
+ * Invocations made through this subpath bypass Hernex's mandatory credential pairing
6
+ * and model string routing, executing with native AI SDK semantics.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ export * from "ai";
11
+ //# sourceMappingURL=ai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.ts","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,IAAI,CAAC"}
package/dist/ai.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview Explicit raw Vercel AI SDK escape hatch for `@amaranthic/hernex/ai`.
3
+ *
4
+ * @remarks
5
+ * Invocations made through this subpath bypass Hernex's mandatory credential pairing
6
+ * and model string routing, executing with native AI SDK semantics.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ export * from "ai";
11
+ //# sourceMappingURL=ai.js.map
package/dist/ai.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.js","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,IAAI,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * @fileoverview Filesystem-backed content-addressed CheckpointStore with delta snapshots and safe conflict detection.
3
+ * @packageDocumentation
4
+ */
5
+ import { type ResolveHomeDirectoryOptions } from "../storage/homeDirectory.js";
6
+ import type { CheckpointRecord, CheckpointStore, CreateCheckpointInput, RestorePlan, RestoreResult } from "./types.js";
7
+ /**
8
+ * FileCheckpointStore provides persistent content-addressed checkpointing
9
+ * and rollback verification across thread-scoped workspace files.
10
+ */
11
+ export declare class FileCheckpointStore implements CheckpointStore {
12
+ private readonly rootDir;
13
+ /**
14
+ * Initializes a new FileCheckpointStore instance.
15
+ *
16
+ * @param options - Storage options including custom home directory.
17
+ */
18
+ constructor(options?: ResolveHomeDirectoryOptions);
19
+ /**
20
+ * Validates safe identifier grammar for threads and checkpoints.
21
+ *
22
+ * @param id - Identifier string.
23
+ * @param label - Human-readable label for error reporting.
24
+ */
25
+ private validateId;
26
+ /**
27
+ * Validates SHA-256 hexadecimal hash strings.
28
+ *
29
+ * @param hash - Hash string to validate.
30
+ */
31
+ private validateSha256;
32
+ /**
33
+ * Resolves the manifest file path for a thread.
34
+ */
35
+ private getManifestPath;
36
+ /**
37
+ * Resolves the content-addressed blob storage path for a given SHA-256 digest.
38
+ */
39
+ private getBlobPath;
40
+ /**
41
+ * Resolves the external lock path for thread checkpoint operations.
42
+ */
43
+ private getLockPath;
44
+ /**
45
+ * Stores raw data in the content-addressed blob store with SHA-256 digest validation.
46
+ */
47
+ private storeBlob;
48
+ /**
49
+ * Reads a raw blob from the content-addressed store and verifies its integrity.
50
+ */
51
+ private readBlob;
52
+ /**
53
+ * Internal unlocked helper to read and validate the thread checkpoint manifest.
54
+ */
55
+ private readManifestUnlocked;
56
+ /**
57
+ * Internal unlocked helper to save checkpoint manifest under the version 2 envelope.
58
+ */
59
+ private writeManifestUnlocked;
60
+ /**
61
+ * Lists all recorded checkpoints for a thread ordered chronologically under lock.
62
+ */
63
+ listCheckpoints(threadId: string): Promise<readonly CheckpointRecord[]>;
64
+ /**
65
+ * Retrieves a checkpoint record by thread and checkpoint identifier under lock.
66
+ */
67
+ getCheckpoint(threadId: string, checkpointId: string): Promise<CheckpointRecord | undefined>;
68
+ /**
69
+ * Records a pre-mutation snapshot of the specified workspace files under lock.
70
+ */
71
+ createCheckpoint(threadId: string, input: CreateCheckpointInput): Promise<CheckpointRecord>;
72
+ /**
73
+ * Updates an existing checkpoint after mutation with the post-state file hashes.
74
+ */
75
+ updateCheckpoint(threadId: string, checkpointId: string, workingDirectory: string): Promise<CheckpointRecord>;
76
+ /**
77
+ * Deletes a checkpoint record from the thread manifest under lock.
78
+ */
79
+ deleteCheckpoint(threadId: string, checkpointId: string): Promise<boolean>;
80
+ /**
81
+ * Internal unlocked helper to compute the restore plan for a checkpoint.
82
+ */
83
+ private planRestoreUnlocked;
84
+ /**
85
+ * Preflights and plans the restoration of a checkpoint under lock.
86
+ */
87
+ planRestore(threadId: string, checkpointId: string, workingDirectory: string): Promise<RestorePlan>;
88
+ /**
89
+ * Restores workspace files to their recorded pre-mutation state under lock.
90
+ */
91
+ restoreCheckpoint(threadId: string, checkpointId: string, workingDirectory: string, options?: {
92
+ readonly force?: boolean;
93
+ } | undefined): Promise<RestoreResult>;
94
+ }
95
+ //# sourceMappingURL=FileCheckpointStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileCheckpointStore.d.ts","sources":["../../src/checkpoints/FileCheckpointStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAEV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EAErB,WAAW,EACX,aAAa,EACd,MAAM,YAAY,CAAC;AAgBpB;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;OAIG;IACH,YAAmB,OAAO,CAAC,EAAE,2BAA2B,EAEvD;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAMlB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAMtB;;OAEG;IACH,OAAO,CAAC,eAAe;IAWvB;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;YACW,SAAS;IAWvB;;OAEG;YACW,QAAQ;IAkBtB;;OAEG;YACW,oBAAoB;IAuClC;;OAEG;YACW,qBAAqB;IAYnC;;OAEG;IACU,eAAe,CAC1B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAOtC;IAED;;OAEG;IACU,aAAa,CACxB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CASvC;IAED;;OAEG;IACU,gBAAgB,CAC3B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CA2D3B;IAED;;OAEG;IACU,gBAAgB,CAC3B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAiD3B;IAED;;OAEG;IACU,gBAAgB,CAC3B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAclB;IAED;;OAEG;YACW,mBAAmB;IAmDjC;;OAEG;IACU,WAAW,CACtB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,WAAW,CAAC,CAatB;IAED;;OAEG;IACU,iBAAiB,CAC5B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,GACjD,OAAO,CAAC,aAAa,CAAC,CAiGxB;CACF"}
@@ -0,0 +1,412 @@
1
+ /**
2
+ * @fileoverview Filesystem-backed content-addressed CheckpointStore with delta snapshots and safe conflict detection.
3
+ * @packageDocumentation
4
+ */
5
+ import { createHash, randomUUID } from "node:crypto";
6
+ import { existsSync } from "node:fs";
7
+ import { readFile, unlink } from "node:fs/promises";
8
+ import path from "node:path";
9
+ import { HernexCheckpointConflictError, HernexStoreError, } from "../errors.js";
10
+ import { atomicWriteFile } from "../storage/atomicFile.js";
11
+ import { resolveHomeDirectory, } from "../storage/homeDirectory.js";
12
+ import { withFileLock } from "../storage/lock.js";
13
+ import { resolvePathWithinWorkspace } from "../tools/internal/pathGuard.js";
14
+ /** Identifier grammar validation regex. */
15
+ const SAFE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
16
+ /** SHA-256 hash validation regex. */
17
+ const SHA256_PATTERN = /^[a-f0-9]{64}$/;
18
+ /**
19
+ * FileCheckpointStore provides persistent content-addressed checkpointing
20
+ * and rollback verification across thread-scoped workspace files.
21
+ */
22
+ export class FileCheckpointStore {
23
+ rootDir;
24
+ /**
25
+ * Initializes a new FileCheckpointStore instance.
26
+ *
27
+ * @param options - Storage options including custom home directory.
28
+ */
29
+ constructor(options) {
30
+ this.rootDir = resolveHomeDirectory(options);
31
+ }
32
+ /**
33
+ * Validates safe identifier grammar for threads and checkpoints.
34
+ *
35
+ * @param id - Identifier string.
36
+ * @param label - Human-readable label for error reporting.
37
+ */
38
+ validateId(id, label) {
39
+ if (!id || typeof id !== "string" || !SAFE_ID_PATTERN.test(id)) {
40
+ throw new Error(`Invalid ${label} identifier: "${id}"`);
41
+ }
42
+ }
43
+ /**
44
+ * Validates SHA-256 hexadecimal hash strings.
45
+ *
46
+ * @param hash - Hash string to validate.
47
+ */
48
+ validateSha256(hash) {
49
+ if (!hash || typeof hash !== "string" || !SHA256_PATTERN.test(hash)) {
50
+ throw new Error(`Invalid SHA-256 hash: "${hash}"`);
51
+ }
52
+ }
53
+ /**
54
+ * Resolves the manifest file path for a thread.
55
+ */
56
+ getManifestPath(threadId) {
57
+ this.validateId(threadId, "thread");
58
+ return path.join(this.rootDir, "threads", threadId, "checkpoints", "manifest.json");
59
+ }
60
+ /**
61
+ * Resolves the content-addressed blob storage path for a given SHA-256 digest.
62
+ */
63
+ getBlobPath(sha256) {
64
+ this.validateSha256(sha256);
65
+ return path.join(this.rootDir, "blobs", "sha256", sha256);
66
+ }
67
+ /**
68
+ * Resolves the external lock path for thread checkpoint operations.
69
+ */
70
+ getLockPath(threadId) {
71
+ this.validateId(threadId, "thread");
72
+ return path.join(this.rootDir, "locks", "checkpoints", `${threadId}.lock`);
73
+ }
74
+ /**
75
+ * Stores raw data in the content-addressed blob store with SHA-256 digest validation.
76
+ */
77
+ async storeBlob(data) {
78
+ const hash = createHash("sha256").update(data).digest("hex");
79
+ this.validateSha256(hash);
80
+ const blobPath = this.getBlobPath(hash);
81
+ if (!existsSync(blobPath)) {
82
+ await atomicWriteFile(blobPath, data);
83
+ }
84
+ return hash;
85
+ }
86
+ /**
87
+ * Reads a raw blob from the content-addressed store and verifies its integrity.
88
+ */
89
+ async readBlob(sha256) {
90
+ this.validateSha256(sha256);
91
+ const blobPath = this.getBlobPath(sha256);
92
+ if (!existsSync(blobPath)) {
93
+ throw new Error(`Blob not found: "${sha256}"`);
94
+ }
95
+ const content = await readFile(blobPath);
96
+ const computedHash = createHash("sha256").update(content).digest("hex");
97
+ if (computedHash !== sha256) {
98
+ throw new Error(`Corrupt blob detected for "${sha256}": computed digest is "${computedHash}"`);
99
+ }
100
+ return content;
101
+ }
102
+ /**
103
+ * Internal unlocked helper to read and validate the thread checkpoint manifest.
104
+ */
105
+ async readManifestUnlocked(threadId) {
106
+ const manifestPath = this.getManifestPath(threadId);
107
+ if (!existsSync(manifestPath)) {
108
+ return [];
109
+ }
110
+ const raw = await readFile(manifestPath, "utf-8");
111
+ let parsed;
112
+ try {
113
+ parsed = JSON.parse(raw);
114
+ }
115
+ catch (parseError) {
116
+ throw new HernexStoreError(`Failed to parse checkpoint manifest at "${manifestPath}": ${String(parseError)}`);
117
+ }
118
+ if (typeof parsed !== "object" ||
119
+ parsed === null ||
120
+ !("version" in parsed) ||
121
+ parsed.version !== 2) {
122
+ throw new HernexStoreError(`Incompatible checkpoint manifest version at "${manifestPath}". Expected version 2 envelope. Legacy unverified records cannot be migrated.`);
123
+ }
124
+ const envelope = parsed;
125
+ if (!Array.isArray(envelope.checkpoints)) {
126
+ throw new HernexStoreError(`Malformed checkpoint manifest envelope at "${manifestPath}": checkpoints is not an array.`);
127
+ }
128
+ return envelope.checkpoints;
129
+ }
130
+ /**
131
+ * Internal unlocked helper to save checkpoint manifest under the version 2 envelope.
132
+ */
133
+ async writeManifestUnlocked(threadId, checkpoints) {
134
+ const manifestPath = this.getManifestPath(threadId);
135
+ const envelope = {
136
+ version: 2,
137
+ checkpoints,
138
+ };
139
+ await atomicWriteFile(manifestPath, JSON.stringify(envelope, null, 2));
140
+ }
141
+ /**
142
+ * Lists all recorded checkpoints for a thread ordered chronologically under lock.
143
+ */
144
+ async listCheckpoints(threadId) {
145
+ this.validateId(threadId, "thread");
146
+ const lockPath = this.getLockPath(threadId);
147
+ return await withFileLock(lockPath, async () => {
148
+ return this.readManifestUnlocked(threadId);
149
+ });
150
+ }
151
+ /**
152
+ * Retrieves a checkpoint record by thread and checkpoint identifier under lock.
153
+ */
154
+ async getCheckpoint(threadId, checkpointId) {
155
+ this.validateId(threadId, "thread");
156
+ this.validateId(checkpointId, "checkpoint");
157
+ const lockPath = this.getLockPath(threadId);
158
+ return await withFileLock(lockPath, async () => {
159
+ const list = await this.readManifestUnlocked(threadId);
160
+ return list.find((cp) => cp.id === checkpointId);
161
+ });
162
+ }
163
+ /**
164
+ * Records a pre-mutation snapshot of the specified workspace files under lock.
165
+ */
166
+ async createCheckpoint(threadId, input) {
167
+ this.validateId(threadId, "thread");
168
+ if (!input.files || input.files.length === 0) {
169
+ throw new Error("Checkpoint creation requires at least one relative file path.");
170
+ }
171
+ const lockPath = this.getLockPath(threadId);
172
+ return await withFileLock(lockPath, async () => {
173
+ const list = await this.readManifestUnlocked(threadId);
174
+ const sequence = list.length > 0 ? list[list.length - 1].sequence + 1 : 1;
175
+ const checkpointId = randomUUID();
176
+ const fileRecords = [];
177
+ for (const relPath of input.files) {
178
+ if (!relPath || typeof relPath !== "string") {
179
+ throw new Error("Invalid relative file path in checkpoint input.");
180
+ }
181
+ // Validate containment within workspace
182
+ const targetPath = resolvePathWithinWorkspace(relPath, input.workingDirectory);
183
+ if (existsSync(targetPath)) {
184
+ const content = await readFile(targetPath);
185
+ const hash = await this.storeBlob(content);
186
+ fileRecords.push({
187
+ relativePath: relPath,
188
+ beforeHash: hash,
189
+ afterHash: hash,
190
+ });
191
+ }
192
+ else {
193
+ fileRecords.push({
194
+ relativePath: relPath,
195
+ beforeHash: null,
196
+ afterHash: null,
197
+ });
198
+ }
199
+ }
200
+ const record = {
201
+ id: checkpointId,
202
+ sequence,
203
+ threadId,
204
+ turnIndex: input.turnIndex,
205
+ label: input.label,
206
+ source: input.source ?? "manual",
207
+ timestamp: Date.now(),
208
+ files: fileRecords,
209
+ };
210
+ const updatedList = [...list, record];
211
+ await this.writeManifestUnlocked(threadId, updatedList);
212
+ return record;
213
+ });
214
+ }
215
+ /**
216
+ * Updates an existing checkpoint after mutation with the post-state file hashes.
217
+ */
218
+ async updateCheckpoint(threadId, checkpointId, workingDirectory) {
219
+ this.validateId(threadId, "thread");
220
+ this.validateId(checkpointId, "checkpoint");
221
+ const lockPath = this.getLockPath(threadId);
222
+ return await withFileLock(lockPath, async () => {
223
+ const list = await this.readManifestUnlocked(threadId);
224
+ const index = list.findIndex((cp) => cp.id === checkpointId);
225
+ if (index === -1) {
226
+ throw new Error(`Checkpoint not found: "${checkpointId}"`);
227
+ }
228
+ const existing = list[index];
229
+ const updatedFiles = [];
230
+ for (const file of existing.files) {
231
+ const targetPath = resolvePathWithinWorkspace(file.relativePath, workingDirectory);
232
+ if (existsSync(targetPath)) {
233
+ const content = await readFile(targetPath);
234
+ const hash = await this.storeBlob(content);
235
+ updatedFiles.push({
236
+ relativePath: file.relativePath,
237
+ beforeHash: file.beforeHash,
238
+ afterHash: hash,
239
+ });
240
+ }
241
+ else {
242
+ updatedFiles.push({
243
+ relativePath: file.relativePath,
244
+ beforeHash: file.beforeHash,
245
+ afterHash: null,
246
+ });
247
+ }
248
+ }
249
+ const updatedRecord = {
250
+ ...existing,
251
+ files: updatedFiles,
252
+ };
253
+ const updatedList = [...list];
254
+ updatedList[index] = updatedRecord;
255
+ await this.writeManifestUnlocked(threadId, updatedList);
256
+ return updatedRecord;
257
+ });
258
+ }
259
+ /**
260
+ * Deletes a checkpoint record from the thread manifest under lock.
261
+ */
262
+ async deleteCheckpoint(threadId, checkpointId) {
263
+ this.validateId(threadId, "thread");
264
+ this.validateId(checkpointId, "checkpoint");
265
+ const lockPath = this.getLockPath(threadId);
266
+ return await withFileLock(lockPath, async () => {
267
+ const list = await this.readManifestUnlocked(threadId);
268
+ const filtered = list.filter((cp) => cp.id !== checkpointId);
269
+ if (filtered.length === list.length) {
270
+ return false;
271
+ }
272
+ await this.writeManifestUnlocked(threadId, filtered);
273
+ return true;
274
+ });
275
+ }
276
+ /**
277
+ * Internal unlocked helper to compute the restore plan for a checkpoint.
278
+ */
279
+ async planRestoreUnlocked(checkpoint, workingDirectory) {
280
+ const actions = [];
281
+ let hasConflicts = false;
282
+ for (const file of checkpoint.files) {
283
+ const targetPath = resolvePathWithinWorkspace(file.relativePath, workingDirectory);
284
+ let currentHash = null;
285
+ if (existsSync(targetPath)) {
286
+ const content = await readFile(targetPath);
287
+ currentHash = createHash("sha256").update(content).digest("hex");
288
+ }
289
+ const alreadyRestored = currentHash === file.beforeHash;
290
+ const isConflict = !alreadyRestored && currentHash !== file.afterHash;
291
+ if (isConflict) {
292
+ hasConflicts = true;
293
+ }
294
+ let action;
295
+ if (file.beforeHash === null) {
296
+ action = currentHash === null ? "unchanged" : "delete";
297
+ }
298
+ else if (currentHash === null) {
299
+ action = "create";
300
+ }
301
+ else if (currentHash === file.beforeHash) {
302
+ action = "unchanged";
303
+ }
304
+ else {
305
+ action = "modify";
306
+ }
307
+ actions.push({
308
+ relativePath: file.relativePath,
309
+ action,
310
+ isConflict,
311
+ });
312
+ }
313
+ return {
314
+ checkpointId: checkpoint.id,
315
+ actions,
316
+ hasConflicts,
317
+ };
318
+ }
319
+ /**
320
+ * Preflights and plans the restoration of a checkpoint under lock.
321
+ */
322
+ async planRestore(threadId, checkpointId, workingDirectory) {
323
+ this.validateId(threadId, "thread");
324
+ this.validateId(checkpointId, "checkpoint");
325
+ const lockPath = this.getLockPath(threadId);
326
+ return await withFileLock(lockPath, async () => {
327
+ const list = await this.readManifestUnlocked(threadId);
328
+ const cp = list.find((item) => item.id === checkpointId);
329
+ if (!cp) {
330
+ throw new Error(`Checkpoint not found: "${checkpointId}"`);
331
+ }
332
+ return this.planRestoreUnlocked(cp, workingDirectory);
333
+ });
334
+ }
335
+ /**
336
+ * Restores workspace files to their recorded pre-mutation state under lock.
337
+ */
338
+ async restoreCheckpoint(threadId, checkpointId, workingDirectory, options) {
339
+ this.validateId(threadId, "thread");
340
+ this.validateId(checkpointId, "checkpoint");
341
+ const lockPath = this.getLockPath(threadId);
342
+ return await withFileLock(lockPath, async () => {
343
+ const list = await this.readManifestUnlocked(threadId);
344
+ const cp = list.find((item) => item.id === checkpointId);
345
+ if (!cp) {
346
+ throw new Error(`Checkpoint not found: "${checkpointId}"`);
347
+ }
348
+ const plan = await this.planRestoreUnlocked(cp, workingDirectory);
349
+ if (plan.hasConflicts && !options?.force) {
350
+ throw new HernexCheckpointConflictError(`Restore conflicts detected in checkpoint "${checkpointId}". Pass { force: true } to overwrite uncommitted external changes.`);
351
+ }
352
+ // Preflight: Stage all required blobs and validate paths before mutating
353
+ const stagedBlobs = new Map();
354
+ for (const file of cp.files) {
355
+ // Path validation
356
+ resolvePathWithinWorkspace(file.relativePath, workingDirectory);
357
+ const actionItem = plan.actions.find((a) => a.relativePath === file.relativePath);
358
+ if (actionItem &&
359
+ (actionItem.action === "create" || actionItem.action === "modify")) {
360
+ if (!file.beforeHash) {
361
+ throw new Error(`Missing beforeHash for restore action "${actionItem.action}" on path "${file.relativePath}".`);
362
+ }
363
+ if (!stagedBlobs.has(file.beforeHash)) {
364
+ const blobBytes = await this.readBlob(file.beforeHash);
365
+ stagedBlobs.set(file.beforeHash, blobBytes);
366
+ }
367
+ }
368
+ }
369
+ // Execution: perform mutations and track progress
370
+ let filesRestored = 0;
371
+ let filesDeleted = 0;
372
+ let conflictsOverwritten = 0;
373
+ const committedPaths = [];
374
+ try {
375
+ for (const file of cp.files) {
376
+ const targetPath = resolvePathWithinWorkspace(file.relativePath, workingDirectory);
377
+ const actionItem = plan.actions.find((a) => a.relativePath === file.relativePath);
378
+ if (!actionItem) {
379
+ continue;
380
+ }
381
+ if (actionItem.isConflict) {
382
+ conflictsOverwritten++;
383
+ }
384
+ if (actionItem.action === "delete") {
385
+ if (existsSync(targetPath)) {
386
+ await unlink(targetPath);
387
+ filesDeleted++;
388
+ committedPaths.push(file.relativePath);
389
+ }
390
+ }
391
+ else if (actionItem.action === "create" ||
392
+ actionItem.action === "modify") {
393
+ const blobBytes = stagedBlobs.get(file.beforeHash);
394
+ await atomicWriteFile(targetPath, blobBytes);
395
+ filesRestored++;
396
+ committedPaths.push(file.relativePath);
397
+ }
398
+ }
399
+ }
400
+ catch (mutationError) {
401
+ throw new AggregateError([mutationError], `Restore failed during filesystem mutations. Committed paths: ${committedPaths.join(", ")}`);
402
+ }
403
+ return {
404
+ checkpointId,
405
+ filesRestored,
406
+ filesDeleted,
407
+ conflictsOverwritten,
408
+ };
409
+ });
410
+ }
411
+ }
412
+ //# sourceMappingURL=FileCheckpointStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileCheckpointStore.js","sources":["../../src/checkpoints/FileCheckpointStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAW5E,2CAA2C;AAC3C,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D,qCAAqC;AACrC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAUxC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACb,OAAO,CAAS;IAEjC;;;;OAIG;IACH,YAAmB,OAAqC;QACtD,IA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AC,UAAU,EAAE,CAAC;wBAC1B,oBAAoB,EAAE,CAAC;oBACzB,CAAC;oBAED,IAAI,UAAU,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;wBACnC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;4BAC3B,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;4BACzB,YAAY,EAAE,CAAC;4BACf,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;wBACzC,CAAC;oBACH,CAAC;yBAAM,IACL,UAAU,CAAC,MAAM,KAAK,QAAQ;wBAC9B,UAAU,CAAC,MAAM,KAAK,QAAQ,EAC9B,CAAC;wBACD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,UAAW,CAAE,CAAC;wBACrD,MAAM,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;wBAC7C,aAAa,EAAE,CAAC;wBAChB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;oBACzC,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,aAAa,EAAE,CAAC;gBACvB,MAAM,IAAI,cAAc,CACtB,CAAC,aAAa,CAAC,EACf,gEAAgE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC5F,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,YAAY;gBACZ,aAAa;gBACb,YAAY;gBACZ,oBAAoB;aACrB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Checkpoints subsystem exports.
3
+ * @packageDocumentation
4
+ */
5
+ export * from "./types.js";
6
+ export * from "./FileCheckpointStore.js";
7
+ //# sourceMappingURL=index.d.ts.map