@aithos/sdk 0.1.0-alpha.6 → 0.1.0-alpha.60

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 (105) hide show
  1. package/README.md +202 -7
  2. package/dist/src/agent-dispatch.d.ts +18 -0
  3. package/dist/src/agent-dispatch.js +178 -0
  4. package/dist/src/agent-loop.d.ts +94 -0
  5. package/dist/src/agent-loop.js +95 -0
  6. package/dist/src/agent-tools.d.ts +24 -0
  7. package/dist/src/agent-tools.js +147 -0
  8. package/dist/src/apps.d.ts +224 -0
  9. package/dist/src/apps.js +432 -0
  10. package/dist/src/assets.d.ts +225 -0
  11. package/dist/src/assets.js +534 -0
  12. package/dist/src/auth-api.d.ts +219 -0
  13. package/dist/src/auth-api.js +248 -0
  14. package/dist/src/auth.d.ts +591 -0
  15. package/dist/src/auth.js +947 -31
  16. package/dist/src/compute.d.ts +674 -6
  17. package/dist/src/compute.js +968 -20
  18. package/dist/src/data-schema-contacts-v1.d.ts +14 -0
  19. package/dist/src/data-schema-contacts-v1.js +28 -0
  20. package/dist/src/data.d.ts +368 -0
  21. package/dist/src/data.js +1124 -0
  22. package/dist/src/endpoints.d.ts +43 -0
  23. package/dist/src/endpoints.js +23 -0
  24. package/dist/src/ethos.d.ts +85 -0
  25. package/dist/src/ethos.js +463 -7
  26. package/dist/src/index.d.ts +22 -4
  27. package/dist/src/index.js +47 -2
  28. package/dist/src/internal/cmk-wrap.d.ts +41 -0
  29. package/dist/src/internal/cmk-wrap.js +132 -0
  30. package/dist/src/internal/delegate-bundle.js +7 -2
  31. package/dist/src/internal/envelope.d.ts +93 -0
  32. package/dist/src/internal/envelope.js +59 -0
  33. package/dist/src/internal/owner-signers.d.ts +5 -2
  34. package/dist/src/internal/owner-signers.js +22 -1
  35. package/dist/src/internal/recovery-file.d.ts +2 -0
  36. package/dist/src/internal/recovery-file.js +7 -0
  37. package/dist/src/key-store.d.ts +10 -0
  38. package/dist/src/key-store.js +6 -0
  39. package/dist/src/mandates.d.ts +58 -1
  40. package/dist/src/mandates.js +46 -3
  41. package/dist/src/migrate.d.ts +105 -0
  42. package/dist/src/migrate.js +367 -0
  43. package/dist/src/react/AithosAsset.d.ts +66 -0
  44. package/dist/src/react/AithosAsset.js +67 -0
  45. package/dist/src/react/context.d.ts +29 -0
  46. package/dist/src/react/context.js +31 -0
  47. package/dist/src/react/index.d.ts +29 -0
  48. package/dist/src/react/index.js +31 -0
  49. package/dist/src/react/use-aithos-asset.d.ts +39 -0
  50. package/dist/src/react/use-aithos-asset.js +118 -0
  51. package/dist/src/react/use-transcribe-pending.d.ts +21 -0
  52. package/dist/src/react/use-transcribe-pending.js +47 -0
  53. package/dist/src/rotate.d.ts +94 -0
  54. package/dist/src/rotate.js +298 -0
  55. package/dist/src/sdk.d.ts +36 -2
  56. package/dist/src/sdk.js +72 -1
  57. package/dist/src/transcribe-resilience.d.ts +57 -0
  58. package/dist/src/transcribe-resilience.js +203 -0
  59. package/dist/src/web.d.ts +279 -0
  60. package/dist/src/web.js +186 -0
  61. package/dist/test/agent-dispatch.test.d.ts +2 -0
  62. package/dist/test/agent-dispatch.test.js +222 -0
  63. package/dist/test/agent-loop.test.d.ts +2 -0
  64. package/dist/test/agent-loop.test.js +117 -0
  65. package/dist/test/agent-tools.test.d.ts +2 -0
  66. package/dist/test/agent-tools.test.js +50 -0
  67. package/dist/test/auth-j3.test.js +32 -1
  68. package/dist/test/canonical-conformance.test.d.ts +2 -0
  69. package/dist/test/canonical-conformance.test.js +86 -0
  70. package/dist/test/compute-delegate-path.test.d.ts +2 -0
  71. package/dist/test/compute-delegate-path.test.js +183 -0
  72. package/dist/test/compute.test.js +4 -0
  73. package/dist/test/converse.test.d.ts +2 -0
  74. package/dist/test/converse.test.js +162 -0
  75. package/dist/test/data-sphere.test.d.ts +2 -0
  76. package/dist/test/data-sphere.test.js +57 -0
  77. package/dist/test/endpoints.test.js +40 -1
  78. package/dist/test/envelope-core-conformance.test.d.ts +2 -0
  79. package/dist/test/envelope-core-conformance.test.js +75 -0
  80. package/dist/test/envelope.test.d.ts +2 -0
  81. package/dist/test/envelope.test.js +318 -0
  82. package/dist/test/ethos-first-edition.test.d.ts +2 -0
  83. package/dist/test/ethos-first-edition.test.js +371 -0
  84. package/dist/test/invoke-turn-sdk.test.d.ts +2 -0
  85. package/dist/test/invoke-turn-sdk.test.js +177 -0
  86. package/dist/test/migrate.test.d.ts +2 -0
  87. package/dist/test/migrate.test.js +340 -0
  88. package/dist/test/owner-data-client.test.d.ts +2 -0
  89. package/dist/test/owner-data-client.test.js +88 -0
  90. package/dist/test/rotate-ethos.test.d.ts +2 -0
  91. package/dist/test/rotate-ethos.test.js +151 -0
  92. package/dist/test/rotate.test.d.ts +2 -0
  93. package/dist/test/rotate.test.js +63 -0
  94. package/dist/test/schema-autoresolve.test.d.ts +2 -0
  95. package/dist/test/schema-autoresolve.test.js +146 -0
  96. package/dist/test/sdk.test.js +11 -2
  97. package/dist/test/signup-bootstrap.test.d.ts +2 -0
  98. package/dist/test/signup-bootstrap.test.js +311 -0
  99. package/dist/test/transcribe-invoke.test.d.ts +2 -0
  100. package/dist/test/transcribe-invoke.test.js +204 -0
  101. package/dist/test/transcribe.test.d.ts +2 -0
  102. package/dist/test/transcribe.test.js +186 -0
  103. package/dist/test/web.test.d.ts +2 -0
  104. package/dist/test/web.test.js +270 -0
  105. package/package.json +20 -3
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Bundled copy of the `aithos.contacts.v1` schema.
3
+ *
4
+ * Mirrors `spec/data/schemas/aithos.contacts.v1.json` of the
5
+ * Aithos-protocol repo. The SDK uses this to split a record into its
6
+ * indexable (metadata) and encrypted (payload) parts on insert and to
7
+ * recombine them on read.
8
+ *
9
+ * In a later iteration the SDK will fetch / resolve schemas dynamically
10
+ * from a registry; for v0.1 we bundle the core schemas.
11
+ */
12
+ import type { AithosSchemaLite } from "./data.js";
13
+ export declare const contactsV1: AithosSchemaLite;
14
+ //# sourceMappingURL=data-schema-contacts-v1.d.ts.map
@@ -0,0 +1,28 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright 2026 Mathieu Colla
3
+ export const contactsV1 = {
4
+ schema: "aithos.contacts.v1",
5
+ indexable: new Set([
6
+ "name",
7
+ "email",
8
+ "phone_hash",
9
+ "status",
10
+ "tags",
11
+ "source",
12
+ "created_at",
13
+ "modified_at",
14
+ "last_contacted_at",
15
+ ]),
16
+ encrypted: new Set([
17
+ "phone",
18
+ "notes",
19
+ "conversation_log",
20
+ "form_responses",
21
+ "custom_fields",
22
+ ]),
23
+ auto: new Set(["created_at", "modified_at"]),
24
+ defaults: {
25
+ status: "lead",
26
+ },
27
+ };
28
+ //# sourceMappingURL=data-schema-contacts-v1.js.map
@@ -0,0 +1,368 @@
1
+ import { type SignedMandate } from "@aithos/protocol-client";
2
+ export interface AithosSchemaLite {
3
+ readonly schema: string;
4
+ readonly indexable: ReadonlySet<string>;
5
+ readonly encrypted: ReadonlySet<string>;
6
+ readonly auto: ReadonlySet<string>;
7
+ readonly defaults: Readonly<Record<string, unknown>>;
8
+ }
9
+ export interface CreateDataClientArgs {
10
+ /**
11
+ * PDS base URL. Defaults to `https://pds.aithos.be` (the production vanity
12
+ * domain, CloudFront-fronted) when omitted. Override for self-hosting or
13
+ * staging (e.g. a raw `execute-api` URL).
14
+ */
15
+ readonly pdsUrl?: string;
16
+ /**
17
+ * Subject DID that owns the data. The canonical owner is a `did:aithos:…`
18
+ * account signing under its dedicated `#data` sphere (see below). A
19
+ * `did:key:…` is a throwaway identity for quick demos/tests only — it has no
20
+ * sphere separation (every sphere collapses to the single embedded key).
21
+ */
22
+ readonly did: string;
23
+ /**
24
+ * Ed25519 sphere seed (32 bytes) that signs every PDS envelope. For a
25
+ * `did:aithos` account this MUST be the subject's dedicated **`#data`** sphere
26
+ * seed — never the root key nor an Ethos sphere — so the root stays cold and
27
+ * data operations are isolated to their own key. For a `did:key` it is the
28
+ * single key embedded in the DID.
29
+ */
30
+ readonly sphereSeed: Uint8Array;
31
+ /**
32
+ * The verification method URL within the DID document used to sign PDS
33
+ * envelopes. For a `did:aithos` account this is **`<did>#data`**. For a
34
+ * `did:key` it is `<did>#<multibase>`.
35
+ */
36
+ readonly verificationMethod: string;
37
+ /** Optional fetch implementation. Defaults to globalThis.fetch. */
38
+ readonly fetch?: typeof fetch;
39
+ /**
40
+ * Optional list of app-defined schema definitions, in addition to
41
+ * the SDK-bundled core schemas (currently `aithos.contacts.v1`).
42
+ *
43
+ * Apps in the vendor namespace (`aithos.x.<vendor>.<name>.v<N>`) or
44
+ * non-`aithos.*` namespaces MUST supply their schemas here so the
45
+ * SDK can split records into indexable metadata vs encrypted payload.
46
+ *
47
+ * When the same schema id appears in both the bundled core registry
48
+ * and this list, the app-supplied definition wins (intentional —
49
+ * allows local overrides for testing, though immutability per spec
50
+ * §3.5 means a published schema id should never change shape).
51
+ *
52
+ * Schemas are scoped to the {@link DataClient} instance — they don't
53
+ * leak to other clients in the same process.
54
+ */
55
+ readonly schemas?: readonly AithosSchemaLite[];
56
+ }
57
+ export interface DataClient {
58
+ /** Get / create a collection handle. */
59
+ collection(name: string): DataCollection;
60
+ /** Initialize a new collection with an explicit schema. Throws
61
+ * `-32073 AITHOS_DATA_COLLECTION_EXISTS` if it already exists. */
62
+ createCollection(args: {
63
+ name: string;
64
+ schema: string;
65
+ forwardSecrecy?: "best_effort" | "strict";
66
+ }): Promise<void>;
67
+ /**
68
+ * Get-or-create: create the collection if it doesn't exist, otherwise
69
+ * succeed silently. Idempotent — safe to call on every app boot before
70
+ * writing. Absorbs the `-32073 AITHOS_DATA_COLLECTION_EXISTS` conflict
71
+ * (and the concurrent-create race) so callers don't have to special-case
72
+ * "already there". Avoids the friction where `collection(name).insert(…)`
73
+ * on a never-created collection fails with `-32020`.
74
+ */
75
+ ensureCollection(args: {
76
+ name: string;
77
+ schema: string;
78
+ forwardSecrecy?: "best_effort" | "strict";
79
+ }): Promise<void>;
80
+ /** List collections owned by this subject. */
81
+ listCollections(): Promise<readonly {
82
+ name: string;
83
+ schema: string;
84
+ record_count: number;
85
+ }[]>;
86
+ /** List gamma audit entries. */
87
+ listGammaEntries(opts?: {
88
+ limit?: number;
89
+ opPrefix?: string;
90
+ verify?: boolean;
91
+ }): Promise<unknown>;
92
+ /**
93
+ * Idempotently publish a vendor (`aithos.x.<vendor>.<name>.v<N>`)
94
+ * JSON Schema document to this subject's PDS. Once published, the
95
+ * PDS validates record writes against the schema doc server-side,
96
+ * closing the gap A2a left open (cf. Aithos-protocol/PLAN-A2b-…).
97
+ *
98
+ * Safe to call on every app boot — re-registering the same document
99
+ * (same canonical hash) resolves to `{ created: false }`. A different
100
+ * document for the same `aithos:schema` id is REJECTED with code
101
+ * -32082 `AITHOS_DATA_SCHEMA_IMMUTABLE` ; the caller must bump the
102
+ * version segment in `aithos:schema` and retry.
103
+ *
104
+ * Core schemas (`aithos.<name>.v<N>` without `.x.`) cannot be
105
+ * registered via this RPC ; they're bundled by the platform per spec
106
+ * §3.7.2.
107
+ *
108
+ * @param schemaDoc Full JSON Schema 2020-12 document. MUST carry
109
+ * `aithos:schema` and `aithos:version` top-level fields.
110
+ */
111
+ registerSchema(schemaDoc: object): Promise<{
112
+ schemaId: string;
113
+ docHash: string;
114
+ created: boolean;
115
+ createdAt?: string;
116
+ }>;
117
+ /**
118
+ * Fetch a published schema document from the PDS.
119
+ *
120
+ * For core schemas (`aithos.<name>.v<N>`) the lookup is global ;
121
+ * `subjectDid` is ignored. For vendor schemas (`aithos.x.*`) the
122
+ * `subjectDid` arg selects whose published registry to query and
123
+ * defaults to this client's own DID.
124
+ *
125
+ * Returns null when the lookup misses (rather than throwing) so
126
+ * call sites can branch on the result.
127
+ */
128
+ getSchema(schemaId: string, opts?: {
129
+ subjectDid?: string;
130
+ }): Promise<object | null>;
131
+ /**
132
+ * Grant a mandate-holding delegate read access to one of this owner's
133
+ * collections, by re-wrapping the collection's CMK to the grantee's
134
+ * key and posting `aithos.data.authorize_app`.
135
+ *
136
+ * Owner-only. The CMK is unwrapped locally (the owner holds it), then
137
+ * re-wrapped X25519-HKDF-AEAD to the grantee's X25519 key (derived
138
+ * from `mandate.grantee.pubkey`). The platform never sees the CMK in
139
+ * clear — it only appends the wrap to the collection's envelope after
140
+ * verifying the mandate (data spec §4.5).
141
+ *
142
+ * Idempotent at the server: re-authorizing the same grantee on the
143
+ * same collection is a no-op. One wrap per grantee covers every record
144
+ * in the collection (O(1) authorization — the CMK is stable).
145
+ *
146
+ * The mandate must carry a `data.<collectionName>.{read|write|admin}`
147
+ * or `data.*.*` scope and a `grantee.pubkey`.
148
+ */
149
+ authorizeDelegate(args: {
150
+ collectionName: string;
151
+ mandate: SignedMandate;
152
+ }): Promise<void>;
153
+ /**
154
+ * Revoke a delegate's access to a collection (`aithos.data.revoke_app`).
155
+ * Owner-only, forward-only: after revocation the PDS refuses the
156
+ * delegate's reads (the mandate is marked revoked), and the delegate's
157
+ * wrap is dropped from the collection's authorization index. Already-read
158
+ * / cached plaintext on the delegate side is out of scope (a known limit
159
+ * of any key-sharing scheme — revocation blocks FUTURE access).
160
+ */
161
+ revokeDelegate(args: {
162
+ collectionName: string;
163
+ mandateId: string;
164
+ reason?: string;
165
+ }): Promise<void>;
166
+ /** Drop in-memory cache (CMK, collection metadata, …). */
167
+ reset(): void;
168
+ }
169
+ /**
170
+ * Read-only view over a subject's data collections, driven by a mandate
171
+ * the subject granted to a delegate (`data.<collection>.read`). Built by
172
+ * {@link createDelegateDataClient}.
173
+ *
174
+ * Mirror of {@link DataClient} minus every mutating verb: a delegate
175
+ * holding a read mandate can `get`/`list` and enumerate collections, but
176
+ * cannot insert, update, delete, create collections, register schemas, or
177
+ * re-delegate. Those throw `-32042` client-side (and the PDS rejects them
178
+ * server-side regardless).
179
+ */
180
+ export interface ReadonlyDataClient {
181
+ /** Get a read-only collection handle. */
182
+ collection(name: string): ReadonlyDataCollection;
183
+ /** List collections the delegate's mandate scopes can reach. */
184
+ listCollections(): Promise<readonly {
185
+ name: string;
186
+ schema: string;
187
+ record_count: number;
188
+ }[]>;
189
+ /** List gamma audit entries (read). */
190
+ listGammaEntries(opts?: {
191
+ limit?: number;
192
+ opPrefix?: string;
193
+ verify?: boolean;
194
+ }): Promise<unknown>;
195
+ /** Drop in-memory cache (CMK, collection metadata, …). */
196
+ reset(): void;
197
+ }
198
+ export interface ReadonlyDataCollection {
199
+ readonly name: string;
200
+ /** Fetch one record by id (decrypted client-side via the re-wrapped CMK). */
201
+ get(recordId: string): Promise<Record<string, unknown> | null>;
202
+ /** List records, decrypted. Pagination via opaque cursor. */
203
+ list(opts?: ListOpts): Promise<{
204
+ items: Record<string, unknown>[];
205
+ nextCursor?: string;
206
+ }>;
207
+ }
208
+ export interface DataCollection {
209
+ readonly name: string;
210
+ /**
211
+ * Insert a record. The object MAY contain both indexable and
212
+ * encrypted fields per the schema; the SDK splits them.
213
+ */
214
+ insert(record: Record<string, unknown>): Promise<string>;
215
+ /** Fetch one record by id (decrypted client-side). */
216
+ get(recordId: string): Promise<Record<string, unknown> | null>;
217
+ /** List records, decrypted. Pagination via opaque cursor. */
218
+ list(opts?: ListOpts): Promise<{
219
+ items: Record<string, unknown>[];
220
+ nextCursor?: string;
221
+ }>;
222
+ /**
223
+ * Replace a record. Same shape as insert; the SDK splits indexable
224
+ * vs encrypted again per the schema.
225
+ */
226
+ update(recordId: string, record: Record<string, unknown>): Promise<void>;
227
+ /** Soft-delete a record. */
228
+ delete(recordId: string): Promise<void>;
229
+ }
230
+ export interface ListOpts {
231
+ readonly filter?: {
232
+ readonly equals?: {
233
+ field: string;
234
+ value: unknown;
235
+ };
236
+ readonly contains?: {
237
+ field: string;
238
+ value: string;
239
+ };
240
+ readonly tagsAny?: readonly string[];
241
+ readonly tagsAll?: readonly string[];
242
+ readonly range?: {
243
+ field: string;
244
+ gte?: string;
245
+ lte?: string;
246
+ };
247
+ };
248
+ readonly order?: "newest" | "oldest";
249
+ readonly limit?: number;
250
+ readonly cursor?: string;
251
+ }
252
+ export declare function createDataClient(args: CreateDataClientArgs): DataClient;
253
+ export interface CreateDelegateDataClientArgs {
254
+ /** PDS base URL (same endpoint the owner writes to). Defaults to
255
+ * `https://pds.aithos.be` when omitted. */
256
+ readonly pdsUrl?: string;
257
+ /** DID of the SUBJECT whose data is being read (the mandate issuer). */
258
+ readonly subjectDid: string;
259
+ /**
260
+ * The full signed mandate the subject granted to this delegate. Must
261
+ * carry a `data.<collection>.read` (or wider) scope and a
262
+ * `grantee.pubkey` matching `delegateSeed`.
263
+ */
264
+ readonly mandate: SignedMandate;
265
+ /** The delegate's Ed25519 seed (32 bytes) — the grantee key the mandate
266
+ * is bound to. Used to sign envelopes AND to derive the X25519 key that
267
+ * unwraps the re-wrapped CMK. */
268
+ readonly delegateSeed: Uint8Array;
269
+ /**
270
+ * The delegate's Ed25519 public key, multibase-encoded. Defaults to
271
+ * `mandate.grantee.pubkey`. This is the bare verificationMethod the PDS
272
+ * binds the delegate envelope to.
273
+ */
274
+ readonly granteePubkeyMultibase?: string;
275
+ /** App-defined (vendor) schemas, as for {@link createDataClient}. */
276
+ readonly schemas?: readonly AithosSchemaLite[];
277
+ /** `fetch` override (tests). */
278
+ readonly fetch?: typeof fetch;
279
+ }
280
+ /**
281
+ * Build a data client that operates on a subject's collections under a
282
+ * mandate (delegate path). It signs every request as the delegate
283
+ * (bare-multibase verificationMethod + the mandate attached to the
284
+ * envelope) and decrypts/encrypts records using the CMK the owner
285
+ * re-wrapped for this delegate via {@link DataClient.authorizeDelegate}.
286
+ *
287
+ * Record CRUD is bounded by the mandate scope: reads need
288
+ * `data.<col>.read`, writes need `data.<col>.write` (or `.admin` /
289
+ * wildcard) — enforced client-side and by the PDS. Owner-only operations
290
+ * (createCollection, authorizeDelegate, revokeDelegate, registerSchema)
291
+ * always throw `-32042`: the owner holds the CMK and controls access.
292
+ *
293
+ * @internal Prefer the session accessor `auth.data` (owner) / the delegate
294
+ * session over hand-constructing this with a raw seed.
295
+ */
296
+ export declare function createDelegateDataClient(args: CreateDelegateDataClientArgs): DataClient;
297
+ /** An append-only handle on one collection: `insert` and nothing else. */
298
+ export interface AppendOnlyDataCollection {
299
+ readonly name: string;
300
+ /**
301
+ * Deposit a record. The DEK is sealed to the owner's public key, so the
302
+ * depositor cannot read this (or any) record back. Returns the record id.
303
+ */
304
+ insert(record: Record<string, unknown>): Promise<string>;
305
+ }
306
+ /** A client holding a `data.<collection>.append` mandate. Insert-only. */
307
+ export interface AppendOnlyDataClient {
308
+ /** Get an append-only handle on a collection (schema supplied at
309
+ * construction — append clients cannot read collection metadata). */
310
+ collection(name: string): AppendOnlyDataCollection;
311
+ /** Drop in-memory cache. */
312
+ reset(): void;
313
+ }
314
+ export interface CreateAppendDataClientArgs {
315
+ /** PDS base URL (same endpoint the owner writes to). Defaults to
316
+ * `https://pds.aithos.be` when omitted. */
317
+ readonly pdsUrl?: string;
318
+ /** DID of the SUBJECT who owns the target collection (the mandate issuer). */
319
+ readonly subjectDid: string;
320
+ /**
321
+ * The owner's `#data` Ed25519 public key (multibase z…). The depositor
322
+ * derives the owner's X25519 wrap target from it and seals each DEK to it.
323
+ * Source: the append mandate / invitation, or the owner's DID document.
324
+ */
325
+ readonly ownerDataPubkeyMultibase: string;
326
+ /** The signed mandate carrying `data.<collection>.append`. */
327
+ readonly mandate: SignedMandate;
328
+ /** The depositor's Ed25519 seed (32 bytes) — the grantee key the mandate is
329
+ * bound to. Signs each insert envelope. NEVER used to read. */
330
+ readonly delegateSeed: Uint8Array;
331
+ /** Defaults to `mandate.grantee.pubkey`. */
332
+ readonly granteePubkeyMultibase?: string;
333
+ /**
334
+ * Schema of the target collection(s). The append client builds records
335
+ * locally (it cannot fetch collection metadata), so the caller MUST supply
336
+ * the schema(s) used by the collection it deposits into. The first entry is
337
+ * used as the default; multiple may be passed for multi-collection clients.
338
+ */
339
+ readonly schema: AithosSchemaLite;
340
+ /** Additional schemas (looked up by id alongside `schema`). */
341
+ readonly schemas?: readonly AithosSchemaLite[];
342
+ /** `fetch` override (tests). */
343
+ readonly fetch?: typeof fetch;
344
+ }
345
+ /**
346
+ * Build an **append-only** data client from a `data.<collection>.append`
347
+ * mandate. The returned {@link AppendOnlyDataClient} can ONLY `insert`: it
348
+ * seals each record's DEK to the owner's public key (never the CMK), so it
349
+ * holds no read capability — it cannot decrypt anything in the collection,
350
+ * not even its own deposit. The PDS additionally enforces the append scope
351
+ * (insert allowed; get/list/update/delete refused).
352
+ */
353
+ export declare function createAppendDataClient(args: CreateAppendDataClientArgs): AppendOnlyDataClient;
354
+ /**
355
+ * Derive an {@link AithosSchemaLite} from a PUBLISHED JSON Schema document (the
356
+ * shape `aithos.data.get_schema` / `registerSchema` round-trip). The field
357
+ * split is read from the per-property annotations:
358
+ * - `aithos:indexable: true` → indexable (server-visible, filter/sort)
359
+ * - `aithos:auto: …` → auto (server-populated, e.g. created_at)
360
+ * - anything else → encrypted (AEAD'd client-side)
361
+ *
362
+ * These annotations are authoritative — by convention they mirror the writer's
363
+ * own lite — so a reader that never bundled the schema can still split records
364
+ * correctly. `defaults` is left empty (it only matters for inserts; the writer
365
+ * supplies its own).
366
+ */
367
+ export declare function liteFromPublishedSchema(doc: object): AithosSchemaLite;
368
+ //# sourceMappingURL=data.d.ts.map