@fungi.computer/agar 0.0.0-stage → 0.0.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.
Files changed (159) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +766 -2
  3. package/dist/agent-message-meta.d.ts +74 -0
  4. package/dist/agent-message-meta.js +63 -0
  5. package/dist/agents.d.ts +170 -0
  6. package/dist/agents.js +218 -0
  7. package/dist/app-build-contract.d.ts +43 -0
  8. package/dist/app-build-contract.js +24 -0
  9. package/dist/apps.d.ts +66 -0
  10. package/dist/apps.js +47 -0
  11. package/dist/backend-declaration.d.ts +6 -0
  12. package/dist/backend-declaration.js +65 -0
  13. package/dist/backend-definition.d.ts +88 -0
  14. package/dist/backend-definition.js +158 -0
  15. package/dist/backend-refusal.d.ts +10 -0
  16. package/dist/backend-refusal.js +10 -0
  17. package/dist/backend.d.ts +30 -0
  18. package/dist/backend.js +28 -0
  19. package/dist/capabilities.d.ts +30 -0
  20. package/dist/capabilities.js +50 -0
  21. package/dist/channels.d.ts +142 -0
  22. package/dist/channels.js +97 -0
  23. package/dist/commands.d.ts +33 -0
  24. package/dist/commands.js +46 -0
  25. package/dist/computer-contracts.d.ts +73 -0
  26. package/dist/computer-contracts.js +57 -0
  27. package/dist/computer.d.ts +294 -0
  28. package/dist/computer.js +319 -0
  29. package/dist/connect.d.ts +11 -0
  30. package/dist/connect.js +211 -0
  31. package/dist/errors.d.ts +34 -0
  32. package/dist/errors.js +106 -0
  33. package/dist/failure.d.ts +2 -0
  34. package/dist/failure.js +9 -0
  35. package/dist/files.d.ts +25 -0
  36. package/dist/files.js +84 -0
  37. package/dist/game-servers.d.ts +530 -0
  38. package/dist/game-servers.js +244 -0
  39. package/dist/gills.d.ts +43 -0
  40. package/dist/gills.js +174 -0
  41. package/dist/git-commit.d.ts +143 -0
  42. package/dist/git-commit.js +251 -0
  43. package/dist/git-rpc.d.ts +310 -0
  44. package/dist/git-rpc.js +166 -0
  45. package/dist/git-steps.d.ts +579 -0
  46. package/dist/git-steps.js +804 -0
  47. package/dist/git-wire.d.ts +33 -0
  48. package/dist/git-wire.js +240 -0
  49. package/dist/git.d.ts +322 -0
  50. package/dist/git.js +98 -0
  51. package/dist/host.d.ts +97 -0
  52. package/dist/host.js +732 -0
  53. package/dist/inbox.d.ts +99 -0
  54. package/dist/inbox.js +184 -0
  55. package/dist/index.d.ts +31 -0
  56. package/dist/index.js +15 -0
  57. package/dist/inference.d.ts +17 -0
  58. package/dist/inference.js +115 -0
  59. package/dist/internal/app-error.d.ts +8 -0
  60. package/dist/internal/app-error.js +36 -0
  61. package/dist/internal/app-session.d.ts +8 -0
  62. package/dist/internal/app-session.js +551 -0
  63. package/dist/internal/back-inputs.d.ts +22 -0
  64. package/dist/internal/back-inputs.js +93 -0
  65. package/dist/internal/browser-bridge.d.ts +30 -0
  66. package/dist/internal/browser-bridge.js +203 -0
  67. package/dist/internal/capabilities.d.ts +13 -0
  68. package/dist/internal/capabilities.js +138 -0
  69. package/dist/internal/commands.d.ts +9 -0
  70. package/dist/internal/commands.js +257 -0
  71. package/dist/internal/disconnect-host.d.ts +7 -0
  72. package/dist/internal/disconnect-host.js +19 -0
  73. package/dist/internal/git-edit-tree.d.ts +6 -0
  74. package/dist/internal/git-edit-tree.js +46 -0
  75. package/dist/internal/memory-fs.d.ts +39 -0
  76. package/dist/internal/memory-fs.js +154 -0
  77. package/dist/internal/protocol.d.ts +116 -0
  78. package/dist/internal/protocol.js +6 -0
  79. package/dist/internal/query-feed.d.ts +23 -0
  80. package/dist/internal/query-feed.js +111 -0
  81. package/dist/internal/result.d.ts +22 -0
  82. package/dist/internal/result.js +61 -0
  83. package/dist/internal/rpc-contract.d.ts +24 -0
  84. package/dist/internal/rpc-contract.js +78 -0
  85. package/dist/internal/schemas.d.ts +307 -0
  86. package/dist/internal/schemas.js +524 -0
  87. package/dist/internal/store.d.ts +8 -0
  88. package/dist/internal/store.js +30 -0
  89. package/dist/internal/terminal-gate.d.ts +17 -0
  90. package/dist/internal/terminal-gate.js +94 -0
  91. package/dist/lifecycle.d.ts +44 -0
  92. package/dist/lifecycle.js +1 -0
  93. package/dist/marketplace.d.ts +159 -0
  94. package/dist/marketplace.js +102 -0
  95. package/dist/media-json.d.ts +181 -0
  96. package/dist/media-json.js +204 -0
  97. package/dist/media-library.d.ts +11 -0
  98. package/dist/media-library.js +15 -0
  99. package/dist/media-request-id.d.ts +7 -0
  100. package/dist/media-request-id.js +16 -0
  101. package/dist/media.d.ts +354 -0
  102. package/dist/media.js +654 -0
  103. package/dist/method-refusal.d.ts +64 -0
  104. package/dist/method-refusal.js +48 -0
  105. package/dist/pending.d.ts +10 -0
  106. package/dist/pending.js +10 -0
  107. package/dist/query.d.ts +76 -0
  108. package/dist/query.js +195 -0
  109. package/dist/react-mount.d.ts +23 -0
  110. package/dist/react-mount.js +108 -0
  111. package/dist/react.d.ts +41 -0
  112. package/dist/react.js +111 -0
  113. package/dist/read-copy.d.ts +103 -0
  114. package/dist/read-copy.js +195 -0
  115. package/dist/roles/files.d.ts +295 -0
  116. package/dist/roles/files.js +184 -0
  117. package/dist/root.d.ts +21 -0
  118. package/dist/root.js +1 -0
  119. package/dist/rpc.d.ts +1 -0
  120. package/dist/rpc.js +1 -0
  121. package/dist/status.d.ts +17 -0
  122. package/dist/status.js +50 -0
  123. package/dist/storage-wire.d.ts +167 -0
  124. package/dist/storage-wire.js +115 -0
  125. package/dist/storage.d.ts +72 -0
  126. package/dist/storage.js +143 -0
  127. package/dist/store.d.ts +11 -0
  128. package/dist/store.js +1 -0
  129. package/dist/test-kit/git.d.ts +31 -0
  130. package/dist/test-kit/git.js +174 -0
  131. package/dist/ui.d.ts +169 -0
  132. package/dist/ui.js +10 -0
  133. package/dist/window.d.ts +41 -0
  134. package/dist/window.js +15 -0
  135. package/dist/world.d.ts +16 -0
  136. package/dist/world.js +17 -0
  137. package/docs/api/README.md +28 -0
  138. package/docs/api/app-build-contract.md +113 -0
  139. package/docs/api/backend-declaration.md +62 -0
  140. package/docs/api/backend-definition.md +215 -0
  141. package/docs/api/backend.md +269 -0
  142. package/docs/api/errors.md +169 -0
  143. package/docs/api/files.md +91 -0
  144. package/docs/api/gills.md +164 -0
  145. package/docs/api/git-commit.md +279 -0
  146. package/docs/api/git-rpc.md +243 -0
  147. package/docs/api/git-steps.md +1010 -0
  148. package/docs/api/git-wire.md +197 -0
  149. package/docs/api/git.md +579 -0
  150. package/docs/api/index.md +2880 -0
  151. package/docs/api/media-json.md +507 -0
  152. package/docs/api/media-request-id.md +32 -0
  153. package/docs/api/modules.md +32 -0
  154. package/docs/api/query.md +253 -0
  155. package/docs/api/react.md +216 -0
  156. package/docs/api/read-copy.md +204 -0
  157. package/docs/api/rpc.md +128 -0
  158. package/docs/api/storage.md +620 -0
  159. package/package.json +197 -3
@@ -0,0 +1,579 @@
1
+ import * as z from "zod";
2
+ import type { CommitFilesRequest, MergeBranchRequest, GitCommitStore, GitWriteOutcome, GitMergeOutcome } from "./git-commit.js";
3
+ /** Permanent continuation failure: background owners settle their lane instead of retrying it. */
4
+ export declare class GitStepMaterialError extends Error {
5
+ /** Invalid material, unavailable atomic support, or an exhausted unchanged-head push refusal. */
6
+ readonly code: "unavailable" | "conflict" | "digest_mismatch" | "atomic_unavailable" | "push_refused";
7
+ /** Construct the canonical permanent continuation error.
8
+ * @param code - Permanent continuation failure reason.
9
+ */
10
+ constructor(code: GitStepMaterialError["code"]);
11
+ }
12
+ /** Facet-owned immutable material, split into individually bounded rows. */
13
+ export type GitStepMaterial = Readonly<{
14
+ /** Retain one immutable row; an exact replay succeeds and conflicting bytes refuse. */
15
+ put(key: string, seq: number, bytes: Uint8Array): Promise<void>;
16
+ /** Restore ordered material from bounded rows, refusing missing rows. */
17
+ read(key: string): Promise<Uint8Array>;
18
+ /** Delete a literal owner prefix after durable terminal settlement, including orphaned rows. */
19
+ drop(prefix: string): Promise<void>;
20
+ }>;
21
+ /** Existing facet SQLite owner; no transaction or scheduler is introduced here. */
22
+ export type GitStepSql = Readonly<{
23
+ /** Execute a statement in the existing facet database; its owner controls transactions. */
24
+ exec(query: string, ...bindings: (string | number | ArrayBuffer)[]): {
25
+ /** Read the native SQLite cursor rows. */
26
+ toArray(): readonly Readonly<Record<string, string | number | ArrayBuffer | null>>[];
27
+ };
28
+ }>;
29
+ /** One-MiB material rows; exact replays are idempotent, conflicting material refuses. */
30
+ export declare function sqliteGitStepMaterial(sql: GitStepSql): GitStepMaterial;
31
+ /** Volatile foreground driver material; background callers use the facet owner. */
32
+ export declare function memoryGitStepMaterial(): GitStepMaterial;
33
+ /** Strict, JSON-only continuation grammar; material and authority are not stored in it. */
34
+ export declare const gitStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ phase: z.ZodLiteral<"fetch-base">;
36
+ base: z.ZodNullable<z.ZodString>;
37
+ key: z.ZodString;
38
+ timestamp: z.ZodNumber;
39
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
40
+ kind: z.ZodLiteral<"commit">;
41
+ request: z.ZodObject<{
42
+ repository: z.ZodString;
43
+ branch: z.ZodString;
44
+ expectedHead: z.ZodNullable<z.ZodString>;
45
+ startFrom: z.ZodOptional<z.ZodString>;
46
+ message: z.ZodString;
47
+ author: z.ZodObject<{
48
+ name: z.ZodString;
49
+ email: z.ZodString;
50
+ }, z.core.$strict>;
51
+ }, z.core.$strict>;
52
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
53
+ tags: z.ZodArray<z.ZodObject<{
54
+ ref: z.ZodString;
55
+ expected: z.ZodNullable<z.ZodString>;
56
+ }, z.core.$strict>>;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ kind: z.ZodLiteral<"merge">;
59
+ request: z.ZodObject<{
60
+ target: z.ZodString;
61
+ source: z.ZodString;
62
+ branch: z.ZodString;
63
+ sourceBranch: z.ZodString;
64
+ expectedSource: z.ZodString;
65
+ expectedTarget: z.ZodOptional<z.ZodString>;
66
+ behind: z.ZodOptional<z.ZodNumber>;
67
+ message: z.ZodString;
68
+ author: z.ZodObject<{
69
+ name: z.ZodString;
70
+ email: z.ZodString;
71
+ }, z.core.$strict>;
72
+ }, z.core.$strict>;
73
+ }, z.core.$strict>], "kind">;
74
+ }, z.core.$strict>, z.ZodObject<{
75
+ phase: z.ZodLiteral<"too-large">;
76
+ key: z.ZodString;
77
+ timestamp: z.ZodNumber;
78
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
79
+ kind: z.ZodLiteral<"commit">;
80
+ request: z.ZodObject<{
81
+ repository: z.ZodString;
82
+ branch: z.ZodString;
83
+ expectedHead: z.ZodNullable<z.ZodString>;
84
+ startFrom: z.ZodOptional<z.ZodString>;
85
+ message: z.ZodString;
86
+ author: z.ZodObject<{
87
+ name: z.ZodString;
88
+ email: z.ZodString;
89
+ }, z.core.$strict>;
90
+ }, z.core.$strict>;
91
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
92
+ tags: z.ZodArray<z.ZodObject<{
93
+ ref: z.ZodString;
94
+ expected: z.ZodNullable<z.ZodString>;
95
+ }, z.core.$strict>>;
96
+ }, z.core.$strict>, z.ZodObject<{
97
+ kind: z.ZodLiteral<"merge">;
98
+ request: z.ZodObject<{
99
+ target: z.ZodString;
100
+ source: z.ZodString;
101
+ branch: z.ZodString;
102
+ sourceBranch: z.ZodString;
103
+ expectedSource: z.ZodString;
104
+ expectedTarget: z.ZodOptional<z.ZodString>;
105
+ behind: z.ZodOptional<z.ZodNumber>;
106
+ message: z.ZodString;
107
+ author: z.ZodObject<{
108
+ name: z.ZodString;
109
+ email: z.ZodString;
110
+ }, z.core.$strict>;
111
+ }, z.core.$strict>;
112
+ }, z.core.$strict>], "kind">;
113
+ }, z.core.$strict>, z.ZodObject<{
114
+ phase: z.ZodLiteral<"inspect-base">;
115
+ key: z.ZodString;
116
+ timestamp: z.ZodNumber;
117
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
118
+ kind: z.ZodLiteral<"commit">;
119
+ request: z.ZodObject<{
120
+ repository: z.ZodString;
121
+ branch: z.ZodString;
122
+ expectedHead: z.ZodNullable<z.ZodString>;
123
+ startFrom: z.ZodOptional<z.ZodString>;
124
+ message: z.ZodString;
125
+ author: z.ZodObject<{
126
+ name: z.ZodString;
127
+ email: z.ZodString;
128
+ }, z.core.$strict>;
129
+ }, z.core.$strict>;
130
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
131
+ tags: z.ZodArray<z.ZodObject<{
132
+ ref: z.ZodString;
133
+ expected: z.ZodNullable<z.ZodString>;
134
+ }, z.core.$strict>>;
135
+ }, z.core.$strict>, z.ZodObject<{
136
+ kind: z.ZodLiteral<"merge">;
137
+ request: z.ZodObject<{
138
+ target: z.ZodString;
139
+ source: z.ZodString;
140
+ branch: z.ZodString;
141
+ sourceBranch: z.ZodString;
142
+ expectedSource: z.ZodString;
143
+ expectedTarget: z.ZodOptional<z.ZodString>;
144
+ behind: z.ZodOptional<z.ZodNumber>;
145
+ message: z.ZodString;
146
+ author: z.ZodObject<{
147
+ name: z.ZodString;
148
+ email: z.ZodString;
149
+ }, z.core.$strict>;
150
+ }, z.core.$strict>;
151
+ }, z.core.$strict>], "kind">;
152
+ }, z.core.$strict>, z.ZodObject<{
153
+ phase: z.ZodLiteral<"inspect-source">;
154
+ key: z.ZodString;
155
+ timestamp: z.ZodNumber;
156
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
157
+ kind: z.ZodLiteral<"commit">;
158
+ request: z.ZodObject<{
159
+ repository: z.ZodString;
160
+ branch: z.ZodString;
161
+ expectedHead: z.ZodNullable<z.ZodString>;
162
+ startFrom: z.ZodOptional<z.ZodString>;
163
+ message: z.ZodString;
164
+ author: z.ZodObject<{
165
+ name: z.ZodString;
166
+ email: z.ZodString;
167
+ }, z.core.$strict>;
168
+ }, z.core.$strict>;
169
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
170
+ tags: z.ZodArray<z.ZodObject<{
171
+ ref: z.ZodString;
172
+ expected: z.ZodNullable<z.ZodString>;
173
+ }, z.core.$strict>>;
174
+ }, z.core.$strict>, z.ZodObject<{
175
+ kind: z.ZodLiteral<"merge">;
176
+ request: z.ZodObject<{
177
+ target: z.ZodString;
178
+ source: z.ZodString;
179
+ branch: z.ZodString;
180
+ sourceBranch: z.ZodString;
181
+ expectedSource: z.ZodString;
182
+ expectedTarget: z.ZodOptional<z.ZodString>;
183
+ behind: z.ZodOptional<z.ZodNumber>;
184
+ message: z.ZodString;
185
+ author: z.ZodObject<{
186
+ name: z.ZodString;
187
+ email: z.ZodString;
188
+ }, z.core.$strict>;
189
+ }, z.core.$strict>;
190
+ }, z.core.$strict>], "kind">;
191
+ }, z.core.$strict>, z.ZodObject<{
192
+ phase: z.ZodLiteral<"fetch-source">;
193
+ target: z.ZodOptional<z.ZodString>;
194
+ key: z.ZodString;
195
+ timestamp: z.ZodNumber;
196
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
197
+ kind: z.ZodLiteral<"commit">;
198
+ request: z.ZodObject<{
199
+ repository: z.ZodString;
200
+ branch: z.ZodString;
201
+ expectedHead: z.ZodNullable<z.ZodString>;
202
+ startFrom: z.ZodOptional<z.ZodString>;
203
+ message: z.ZodString;
204
+ author: z.ZodObject<{
205
+ name: z.ZodString;
206
+ email: z.ZodString;
207
+ }, z.core.$strict>;
208
+ }, z.core.$strict>;
209
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
210
+ tags: z.ZodArray<z.ZodObject<{
211
+ ref: z.ZodString;
212
+ expected: z.ZodNullable<z.ZodString>;
213
+ }, z.core.$strict>>;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ kind: z.ZodLiteral<"merge">;
216
+ request: z.ZodObject<{
217
+ target: z.ZodString;
218
+ source: z.ZodString;
219
+ branch: z.ZodString;
220
+ sourceBranch: z.ZodString;
221
+ expectedSource: z.ZodString;
222
+ expectedTarget: z.ZodOptional<z.ZodString>;
223
+ behind: z.ZodOptional<z.ZodNumber>;
224
+ message: z.ZodString;
225
+ author: z.ZodObject<{
226
+ name: z.ZodString;
227
+ email: z.ZodString;
228
+ }, z.core.$strict>;
229
+ }, z.core.$strict>;
230
+ }, z.core.$strict>], "kind">;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ phase: z.ZodLiteral<"inspect-target">;
233
+ sourceDigest: z.ZodCustomStringFormat<"sha256_hex">;
234
+ key: z.ZodString;
235
+ timestamp: z.ZodNumber;
236
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
237
+ kind: z.ZodLiteral<"commit">;
238
+ request: z.ZodObject<{
239
+ repository: z.ZodString;
240
+ branch: z.ZodString;
241
+ expectedHead: z.ZodNullable<z.ZodString>;
242
+ startFrom: z.ZodOptional<z.ZodString>;
243
+ message: z.ZodString;
244
+ author: z.ZodObject<{
245
+ name: z.ZodString;
246
+ email: z.ZodString;
247
+ }, z.core.$strict>;
248
+ }, z.core.$strict>;
249
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
250
+ tags: z.ZodArray<z.ZodObject<{
251
+ ref: z.ZodString;
252
+ expected: z.ZodNullable<z.ZodString>;
253
+ }, z.core.$strict>>;
254
+ }, z.core.$strict>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"merge">;
256
+ request: z.ZodObject<{
257
+ target: z.ZodString;
258
+ source: z.ZodString;
259
+ branch: z.ZodString;
260
+ sourceBranch: z.ZodString;
261
+ expectedSource: z.ZodString;
262
+ expectedTarget: z.ZodOptional<z.ZodString>;
263
+ behind: z.ZodOptional<z.ZodNumber>;
264
+ message: z.ZodString;
265
+ author: z.ZodObject<{
266
+ name: z.ZodString;
267
+ email: z.ZodString;
268
+ }, z.core.$strict>;
269
+ }, z.core.$strict>;
270
+ }, z.core.$strict>], "kind">;
271
+ }, z.core.$strict>, z.ZodObject<{
272
+ phase: z.ZodLiteral<"fetch-target">;
273
+ sourceDigest: z.ZodCustomStringFormat<"sha256_hex">;
274
+ target: z.ZodString;
275
+ key: z.ZodString;
276
+ timestamp: z.ZodNumber;
277
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
278
+ kind: z.ZodLiteral<"commit">;
279
+ request: z.ZodObject<{
280
+ repository: z.ZodString;
281
+ branch: z.ZodString;
282
+ expectedHead: z.ZodNullable<z.ZodString>;
283
+ startFrom: z.ZodOptional<z.ZodString>;
284
+ message: z.ZodString;
285
+ author: z.ZodObject<{
286
+ name: z.ZodString;
287
+ email: z.ZodString;
288
+ }, z.core.$strict>;
289
+ }, z.core.$strict>;
290
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
291
+ tags: z.ZodArray<z.ZodObject<{
292
+ ref: z.ZodString;
293
+ expected: z.ZodNullable<z.ZodString>;
294
+ }, z.core.$strict>>;
295
+ }, z.core.$strict>, z.ZodObject<{
296
+ kind: z.ZodLiteral<"merge">;
297
+ request: z.ZodObject<{
298
+ target: z.ZodString;
299
+ source: z.ZodString;
300
+ branch: z.ZodString;
301
+ sourceBranch: z.ZodString;
302
+ expectedSource: z.ZodString;
303
+ expectedTarget: z.ZodOptional<z.ZodString>;
304
+ behind: z.ZodOptional<z.ZodNumber>;
305
+ message: z.ZodString;
306
+ author: z.ZodObject<{
307
+ name: z.ZodString;
308
+ email: z.ZodString;
309
+ }, z.core.$strict>;
310
+ }, z.core.$strict>;
311
+ }, z.core.$strict>], "kind">;
312
+ }, z.core.$strict>, z.ZodObject<{
313
+ phase: z.ZodLiteral<"inspect-merge-push">;
314
+ old: z.ZodNullable<z.ZodString>;
315
+ built: z.ZodString;
316
+ packDigest: z.ZodCustomStringFormat<"sha256_hex">;
317
+ attempt: z.ZodNumber;
318
+ pushBefore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
319
+ atomic: z.ZodOptional<z.ZodLiteral<true>>;
320
+ key: z.ZodString;
321
+ timestamp: z.ZodNumber;
322
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
323
+ kind: z.ZodLiteral<"commit">;
324
+ request: z.ZodObject<{
325
+ repository: z.ZodString;
326
+ branch: z.ZodString;
327
+ expectedHead: z.ZodNullable<z.ZodString>;
328
+ startFrom: z.ZodOptional<z.ZodString>;
329
+ message: z.ZodString;
330
+ author: z.ZodObject<{
331
+ name: z.ZodString;
332
+ email: z.ZodString;
333
+ }, z.core.$strict>;
334
+ }, z.core.$strict>;
335
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
336
+ tags: z.ZodArray<z.ZodObject<{
337
+ ref: z.ZodString;
338
+ expected: z.ZodNullable<z.ZodString>;
339
+ }, z.core.$strict>>;
340
+ }, z.core.$strict>, z.ZodObject<{
341
+ kind: z.ZodLiteral<"merge">;
342
+ request: z.ZodObject<{
343
+ target: z.ZodString;
344
+ source: z.ZodString;
345
+ branch: z.ZodString;
346
+ sourceBranch: z.ZodString;
347
+ expectedSource: z.ZodString;
348
+ expectedTarget: z.ZodOptional<z.ZodString>;
349
+ behind: z.ZodOptional<z.ZodNumber>;
350
+ message: z.ZodString;
351
+ author: z.ZodObject<{
352
+ name: z.ZodString;
353
+ email: z.ZodString;
354
+ }, z.core.$strict>;
355
+ }, z.core.$strict>;
356
+ }, z.core.$strict>], "kind">;
357
+ }, z.core.$strict>, z.ZodObject<{
358
+ phase: z.ZodLiteral<"inspect-atomic">;
359
+ old: z.ZodNullable<z.ZodString>;
360
+ built: z.ZodString;
361
+ packDigest: z.ZodCustomStringFormat<"sha256_hex">;
362
+ attempt: z.ZodNumber;
363
+ pushBefore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
364
+ atomic: z.ZodOptional<z.ZodLiteral<true>>;
365
+ key: z.ZodString;
366
+ timestamp: z.ZodNumber;
367
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
368
+ kind: z.ZodLiteral<"commit">;
369
+ request: z.ZodObject<{
370
+ repository: z.ZodString;
371
+ branch: z.ZodString;
372
+ expectedHead: z.ZodNullable<z.ZodString>;
373
+ startFrom: z.ZodOptional<z.ZodString>;
374
+ message: z.ZodString;
375
+ author: z.ZodObject<{
376
+ name: z.ZodString;
377
+ email: z.ZodString;
378
+ }, z.core.$strict>;
379
+ }, z.core.$strict>;
380
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
381
+ tags: z.ZodArray<z.ZodObject<{
382
+ ref: z.ZodString;
383
+ expected: z.ZodNullable<z.ZodString>;
384
+ }, z.core.$strict>>;
385
+ }, z.core.$strict>, z.ZodObject<{
386
+ kind: z.ZodLiteral<"merge">;
387
+ request: z.ZodObject<{
388
+ target: z.ZodString;
389
+ source: z.ZodString;
390
+ branch: z.ZodString;
391
+ sourceBranch: z.ZodString;
392
+ expectedSource: z.ZodString;
393
+ expectedTarget: z.ZodOptional<z.ZodString>;
394
+ behind: z.ZodOptional<z.ZodNumber>;
395
+ message: z.ZodString;
396
+ author: z.ZodObject<{
397
+ name: z.ZodString;
398
+ email: z.ZodString;
399
+ }, z.core.$strict>;
400
+ }, z.core.$strict>;
401
+ }, z.core.$strict>], "kind">;
402
+ }, z.core.$strict>, z.ZodObject<{
403
+ phase: z.ZodLiteral<"push">;
404
+ old: z.ZodNullable<z.ZodString>;
405
+ built: z.ZodString;
406
+ packDigest: z.ZodCustomStringFormat<"sha256_hex">;
407
+ attempt: z.ZodNumber;
408
+ pushBefore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
409
+ atomic: z.ZodOptional<z.ZodLiteral<true>>;
410
+ key: z.ZodString;
411
+ timestamp: z.ZodNumber;
412
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
413
+ kind: z.ZodLiteral<"commit">;
414
+ request: z.ZodObject<{
415
+ repository: z.ZodString;
416
+ branch: z.ZodString;
417
+ expectedHead: z.ZodNullable<z.ZodString>;
418
+ startFrom: z.ZodOptional<z.ZodString>;
419
+ message: z.ZodString;
420
+ author: z.ZodObject<{
421
+ name: z.ZodString;
422
+ email: z.ZodString;
423
+ }, z.core.$strict>;
424
+ }, z.core.$strict>;
425
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
426
+ tags: z.ZodArray<z.ZodObject<{
427
+ ref: z.ZodString;
428
+ expected: z.ZodNullable<z.ZodString>;
429
+ }, z.core.$strict>>;
430
+ }, z.core.$strict>, z.ZodObject<{
431
+ kind: z.ZodLiteral<"merge">;
432
+ request: z.ZodObject<{
433
+ target: z.ZodString;
434
+ source: z.ZodString;
435
+ branch: z.ZodString;
436
+ sourceBranch: z.ZodString;
437
+ expectedSource: z.ZodString;
438
+ expectedTarget: z.ZodOptional<z.ZodString>;
439
+ behind: z.ZodOptional<z.ZodNumber>;
440
+ message: z.ZodString;
441
+ author: z.ZodObject<{
442
+ name: z.ZodString;
443
+ email: z.ZodString;
444
+ }, z.core.$strict>;
445
+ }, z.core.$strict>;
446
+ }, z.core.$strict>], "kind">;
447
+ }, z.core.$strict>, z.ZodObject<{
448
+ phase: z.ZodLiteral<"confirm">;
449
+ old: z.ZodNullable<z.ZodString>;
450
+ built: z.ZodString;
451
+ packDigest: z.ZodCustomStringFormat<"sha256_hex">;
452
+ attempt: z.ZodNumber;
453
+ pushBefore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
454
+ atomic: z.ZodOptional<z.ZodLiteral<true>>;
455
+ key: z.ZodString;
456
+ timestamp: z.ZodNumber;
457
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
458
+ kind: z.ZodLiteral<"commit">;
459
+ request: z.ZodObject<{
460
+ repository: z.ZodString;
461
+ branch: z.ZodString;
462
+ expectedHead: z.ZodNullable<z.ZodString>;
463
+ startFrom: z.ZodOptional<z.ZodString>;
464
+ message: z.ZodString;
465
+ author: z.ZodObject<{
466
+ name: z.ZodString;
467
+ email: z.ZodString;
468
+ }, z.core.$strict>;
469
+ }, z.core.$strict>;
470
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
471
+ tags: z.ZodArray<z.ZodObject<{
472
+ ref: z.ZodString;
473
+ expected: z.ZodNullable<z.ZodString>;
474
+ }, z.core.$strict>>;
475
+ }, z.core.$strict>, z.ZodObject<{
476
+ kind: z.ZodLiteral<"merge">;
477
+ request: z.ZodObject<{
478
+ target: z.ZodString;
479
+ source: z.ZodString;
480
+ branch: z.ZodString;
481
+ sourceBranch: z.ZodString;
482
+ expectedSource: z.ZodString;
483
+ expectedTarget: z.ZodOptional<z.ZodString>;
484
+ behind: z.ZodOptional<z.ZodNumber>;
485
+ message: z.ZodString;
486
+ author: z.ZodObject<{
487
+ name: z.ZodString;
488
+ email: z.ZodString;
489
+ }, z.core.$strict>;
490
+ }, z.core.$strict>;
491
+ }, z.core.$strict>], "kind">;
492
+ }, z.core.$strict>, z.ZodObject<{
493
+ phase: z.ZodLiteral<"confirm-ancestry">;
494
+ head: z.ZodString;
495
+ old: z.ZodNullable<z.ZodString>;
496
+ built: z.ZodString;
497
+ packDigest: z.ZodCustomStringFormat<"sha256_hex">;
498
+ attempt: z.ZodNumber;
499
+ pushBefore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
500
+ atomic: z.ZodOptional<z.ZodLiteral<true>>;
501
+ key: z.ZodString;
502
+ timestamp: z.ZodNumber;
503
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
504
+ kind: z.ZodLiteral<"commit">;
505
+ request: z.ZodObject<{
506
+ repository: z.ZodString;
507
+ branch: z.ZodString;
508
+ expectedHead: z.ZodNullable<z.ZodString>;
509
+ startFrom: z.ZodOptional<z.ZodString>;
510
+ message: z.ZodString;
511
+ author: z.ZodObject<{
512
+ name: z.ZodString;
513
+ email: z.ZodString;
514
+ }, z.core.$strict>;
515
+ }, z.core.$strict>;
516
+ changesDigest: z.ZodCustomStringFormat<"sha256_hex">;
517
+ tags: z.ZodArray<z.ZodObject<{
518
+ ref: z.ZodString;
519
+ expected: z.ZodNullable<z.ZodString>;
520
+ }, z.core.$strict>>;
521
+ }, z.core.$strict>, z.ZodObject<{
522
+ kind: z.ZodLiteral<"merge">;
523
+ request: z.ZodObject<{
524
+ target: z.ZodString;
525
+ source: z.ZodString;
526
+ branch: z.ZodString;
527
+ sourceBranch: z.ZodString;
528
+ expectedSource: z.ZodString;
529
+ expectedTarget: z.ZodOptional<z.ZodString>;
530
+ behind: z.ZodOptional<z.ZodNumber>;
531
+ message: z.ZodString;
532
+ author: z.ZodObject<{
533
+ name: z.ZodString;
534
+ email: z.ZodString;
535
+ }, z.core.$strict>;
536
+ }, z.core.$strict>;
537
+ }, z.core.$strict>], "kind">;
538
+ }, z.core.$strict>], "phase">;
539
+ /** Durable checkpoint, suitable for a Watchdog payload and fresh-frame re-admission. */
540
+ export type GitStep = z.output<typeof gitStepSchema>;
541
+ /** Caller-owned operation; begin fixes the timestamp and stores file bytes outside the checkpoint. */
542
+ export type GitStepOperation = Readonly<{
543
+ kind: "commit";
544
+ requestKey: string;
545
+ request: CommitFilesRequest;
546
+ tags?: readonly Readonly<{
547
+ ref: string;
548
+ expected: string | null;
549
+ }>[];
550
+ timestamp?: number;
551
+ }> | Readonly<{
552
+ kind: "merge";
553
+ requestKey: string;
554
+ request: MergeBranchRequest;
555
+ timestamp?: number;
556
+ }>;
557
+ /** Final Git outcome; oversize material refuses before any receive-pack. */
558
+ export type GitStepOutcome = GitWriteOutcome | GitMergeOutcome | Readonly<{
559
+ kind: "too_large";
560
+ }>;
561
+ /** One step either checkpoints, settles, or yields before transport. */
562
+ export type GitStepResult = Readonly<{
563
+ next: GitStep;
564
+ }> | Readonly<{
565
+ done: GitStepOutcome;
566
+ }> | Readonly<{
567
+ yield: true;
568
+ }>;
569
+ /** Per-frame transport plus the existing facet's durable material owner. */
570
+ export type GitStepPorts = Readonly<{
571
+ git: GitCommitStore;
572
+ material: GitStepMaterial;
573
+ }>;
574
+ /** Prepare immutable request material before atomically enqueueing the first checkpoint. */
575
+ export declare function begin(input: GitStepOperation, material: GitStepMaterial): Promise<GitStep>;
576
+ /** Execute one fresh-admitted frame; the caller persists next and its successor job atomically. */
577
+ export declare function runStep(raw: GitStep, ports: GitStepPorts, signal: AbortSignal): Promise<GitStepResult>;
578
+ /** Drop material only after the owner has durably recorded the terminal outcome. */
579
+ export declare function dropMaterial(step: GitStep, material: GitStepMaterial): Promise<void>;