JSDoc
Types
ReadResult
typetype ReadResult = { kind?: "found"; path?: string; content?: string; versionToken?: string; } | { kind?: "missing"; path?: string; }DocEntry
typetype DocEntry = { path?: string; type?: "doc" | "dir"; versionToken?: string; }IfMatch
typetype IfMatch = { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }JsonPatchOp
typetype JsonPatchOp = { value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; }FrontmatterBody
typetype FrontmatterBody = { kind?: "preserve"; } | { kind?: "replace"; value?: string; }IfMissing
typetype IfMissing = "create-empty" | "fail"
Mutation
typetype Mutation = { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }ConflictPolicy
typetype ConflictPolicy = { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }Transaction
typetype Transaction = { message?: string; mutations?: ({ kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; })[]; onConflict?: { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }; }TransactionResult
typetype TransactionResult = { kind?: "committed"; commitId?: string; } | { kind?: "conflict"; conflictingPaths?: string[]; } | { kind?: "auth-error"; reason?: string; } | { kind?: "not-found"; reason?: string; } | { kind?: "network-error"; reason?: string; retriable?: boolean; } | { kind?: "validation-error"; errors?: string[]; } | { kind?: "if-match-failed"; path?: string; expected?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }WatchEvent
typetype WatchEvent = { kind?: "changed"; commitId?: string; paths?: string[]; } | { kind?: "resync"; reason?: string; }SyncInResult
typetype SyncInResult = { kind?: "up-to-date"; } | { kind?: "applied"; commitId?: string; paths?: string[]; } | { kind?: "diverged"; reason?: string; } | { kind?: "auth-error"; reason?: string; } | { kind?: "not-found"; reason?: string; } | { kind?: "network-error"; reason?: string; retriable?: boolean; }Interfaces
DocStore
interfaceinterface DocStore
Members
read
propertyRead a single document. Returns missing if absent — never throws.
read: (path: string) => Promise<ReadResult>
list
propertyRecursive list of `prefix` (empty string lists root). Returns empty array if prefix doesn't exist — never throws.
list: (prefix: string) => Promise<ReadonlyArray<DocEntry>>
runTransaction
propertyRun a transaction. All mutations apply or none do (atomic). Result is a discriminated union; caller branches with ts-pattern.
runTransaction: (tx: Transaction) => Promise<TransactionResult>
watch
propertySubscribe to remote-driven changes under `prefix`. Returns the unsubscribe fn. The callback fires when a sync-in applies commits that touch matching paths. Local writes do NOT echo through watch.
watch: (prefix: string, cb: (event: WatchEvent) => void) => () => void
syncIn
propertyForce a pull-then-emit-watches cycle. UI "refresh" affordance.
syncIn: () => Promise<SyncInResult>
drain
propertyWait for any internal queueing to settle. Tests call this after a series of fire-and-forget runTransaction() to await completion.
drain: () => Promise<void>
Constants
ReadResultSchema
constconst ReadResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"found">; path: z.ZodString; content: z.ZodString; versionToken: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "found"; path?: string; content?: string; versionToken?: string; }, { kind?: "found"; path?: string; content?: string; versionToken?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"missing">; path: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "missing"; path?: string; }, { kind?: "missing"; path?: string; }>]>DocEntrySchema
constconst DocEntrySchema: z.ZodObject<{ path: z.ZodString; type: z.ZodEnum<["doc", "dir"]>; versionToken: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; type?: "doc" | "dir"; versionToken?: string; }, { path?: string; type?: "doc" | "dir"; versionToken?: string; }>IfMatchSchema
constconst IfMatchSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>JsonPatchOpSchema
constconst JsonPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{ op: z.ZodLiteral<"add">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "add"; }, { value?: JsonValue; path?: string; op?: "add"; }>, z.ZodObject<{ op: z.ZodLiteral<"remove">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; op?: "remove"; }, { path?: string; op?: "remove"; }>, z.ZodObject<{ op: z.ZodLiteral<"replace">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "replace"; }, { value?: JsonValue; path?: string; op?: "replace"; }>, z.ZodObject<{ op: z.ZodLiteral<"test">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "test"; }, { value?: JsonValue; path?: string; op?: "test"; }>]>FrontmatterBodySchema
constconst FrontmatterBodySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"preserve">; }, "strip", z.ZodTypeAny, { kind?: "preserve"; }, { kind?: "preserve"; }>, z.ZodObject<{ kind: z.ZodLiteral<"replace">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "replace"; value?: string; }, { kind?: "replace"; value?: string; }>]>IfMissingSchema
constconst IfMissingSchema: z.ZodEnum<["create-empty", "fail"]>
MutationSchema
constconst MutationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"put">; path: z.ZodString; content: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"delete">; path: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"json-patch">; path: z.ZodString; ops: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{ op: z.ZodLiteral<"add">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "add"; }, { value?: JsonValue; path?: string; op?: "add"; }>, z.ZodObject<{ op: z.ZodLiteral<"remove">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; op?: "remove"; }, { path?: string; op?: "remove"; }>, z.ZodObject<{ op: z.ZodLiteral<"replace">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "replace"; }, { value?: JsonValue; path?: string; op?: "replace"; }>, z.ZodObject<{ op: z.ZodLiteral<"test">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "test"; }, { value?: JsonValue; path?: string; op?: "test"; }>]>, "many">; ifMissing: z.ZodEnum<["create-empty", "fail"]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"upsert-frontmatter">; path: z.ZodString; set: z.ZodRecord<z.ZodString, z.ZodUnknown>; body: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"preserve">; }, "strip", z.ZodTypeAny, { kind?: "preserve"; }, { kind?: "preserve"; }>, z.ZodObject<{ kind: z.ZodLiteral<"replace">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "replace"; value?: string; }, { kind?: "replace"; value?: string; }>]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }>]>ConflictPolicySchema
constconst ConflictPolicySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"fail">; }, "strip", z.ZodTypeAny, { kind?: "fail"; }, { kind?: "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"retry-after-pull">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "retry-after-pull"; maxAttempts?: number; }, { kind?: "retry-after-pull"; maxAttempts?: number; }>, z.ZodObject<{ kind: z.ZodLiteral<"rebase-mutations">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "rebase-mutations"; maxAttempts?: number; }, { kind?: "rebase-mutations"; maxAttempts?: number; }>]>TransactionSchema
constconst TransactionSchema: z.ZodObject<{ mutations: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"put">; path: z.ZodString; content: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"delete">; path: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"json-patch">; path: z.ZodString; ops: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{ op: z.ZodLiteral<"add">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "add"; }, { value?: JsonValue; path?: string; op?: "add"; }>, z.ZodObject<{ op: z.ZodLiteral<"remove">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; op?: "remove"; }, { path?: string; op?: "remove"; }>, z.ZodObject<{ op: z.ZodLiteral<"replace">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "replace"; }, { value?: JsonValue; path?: string; op?: "replace"; }>, z.ZodObject<{ op: z.ZodLiteral<"test">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "test"; }, { value?: JsonValue; path?: string; op?: "test"; }>]>, "many">; ifMissing: z.ZodEnum<["create-empty", "fail"]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"upsert-frontmatter">; path: z.ZodString; set: z.ZodRecord<z.ZodString, z.ZodUnknown>; body: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"preserve">; }, "strip", z.ZodTypeAny, { kind?: "preserve"; }, { kind?: "preserve"; }>, z.ZodObject<{ kind: z.ZodLiteral<"replace">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "replace"; value?: string; }, { kind?: "replace"; value?: string; }>]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }>]>, "many">; message: z.ZodString; onConflict: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"fail">; }, "strip", z.ZodTypeAny, { kind?: "fail"; }, { kind?: "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"retry-after-pull">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "retry-after-pull"; maxAttempts?: number; }, { kind?: "retry-after-pull"; maxAttempts?: number; }>, z.ZodObject<{ kind: z.ZodLiteral<"rebase-mutations">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "rebase-mutations"; maxAttempts?: number; }, { kind?: "rebase-mutations"; maxAttempts?: number; }>]>; }, "strip", z.ZodTypeAny, { message?: string; mutations?: ({ kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; })[]; onConflict?: { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }; }, { message?: string; mutations?: ({ kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; })[]; onConflict?: { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }; }>TransactionResultSchema
constconst TransactionResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"committed">; commitId: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "committed"; commitId?: string; }, { kind?: "committed"; commitId?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"conflict">; conflictingPaths: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind?: "conflict"; conflictingPaths?: string[]; }, { kind?: "conflict"; conflictingPaths?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"auth-error">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "auth-error"; reason?: string; }, { kind?: "auth-error"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"not-found">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "not-found"; reason?: string; }, { kind?: "not-found"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"network-error">; retriable: z.ZodBoolean; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "network-error"; reason?: string; retriable?: boolean; }, { kind?: "network-error"; reason?: string; retriable?: boolean; }>, z.ZodObject<{ kind: z.ZodLiteral<"validation-error">; errors: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind?: "validation-error"; errors?: string[]; }, { kind?: "validation-error"; errors?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"if-match-failed">; path: z.ZodString; expected: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "if-match-failed"; path?: string; expected?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "if-match-failed"; path?: string; expected?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>]>WatchEventSchema
constconst WatchEventSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"changed">; paths: z.ZodArray<z.ZodString, "many">; commitId: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "changed"; commitId?: string; paths?: string[]; }, { kind?: "changed"; commitId?: string; paths?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"resync">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "resync"; reason?: string; }, { kind?: "resync"; reason?: string; }>]>SyncInResultSchema
constconst SyncInResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"up-to-date">; }, "strip", z.ZodTypeAny, { kind?: "up-to-date"; }, { kind?: "up-to-date"; }>, z.ZodObject<{ kind: z.ZodLiteral<"applied">; paths: z.ZodArray<z.ZodString, "many">; commitId: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "applied"; commitId?: string; paths?: string[]; }, { kind?: "applied"; commitId?: string; paths?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"diverged">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "diverged"; reason?: string; }, { kind?: "diverged"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"auth-error">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "auth-error"; reason?: string; }, { kind?: "auth-error"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"not-found">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "not-found"; reason?: string; }, { kind?: "not-found"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"network-error">; retriable: z.ZodBoolean; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "network-error"; reason?: string; retriable?: boolean; }, { kind?: "network-error"; reason?: string; retriable?: boolean; }>]>