@cilow/sdk 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +109 -279
  3. package/dist/abstain.d.ts +43 -0
  4. package/dist/abstain.d.ts.map +1 -0
  5. package/dist/abstain.js +42 -0
  6. package/dist/abstain.js.map +1 -0
  7. package/dist/adapters/anthropic.d.ts +57 -0
  8. package/dist/adapters/anthropic.d.ts.map +1 -0
  9. package/dist/adapters/anthropic.js +57 -0
  10. package/dist/adapters/anthropic.js.map +1 -0
  11. package/dist/adapters/index.d.ts +16 -0
  12. package/dist/adapters/index.d.ts.map +1 -0
  13. package/dist/adapters/index.js +16 -0
  14. package/dist/adapters/index.js.map +1 -0
  15. package/dist/adapters/langchain.d.ts +62 -0
  16. package/dist/adapters/langchain.d.ts.map +1 -0
  17. package/dist/adapters/langchain.js +68 -0
  18. package/dist/adapters/langchain.js.map +1 -0
  19. package/dist/adapters/memory.d.ts +105 -0
  20. package/dist/adapters/memory.d.ts.map +1 -0
  21. package/dist/adapters/memory.js +105 -0
  22. package/dist/adapters/memory.js.map +1 -0
  23. package/dist/adapters/openai.d.ts +56 -0
  24. package/dist/adapters/openai.d.ts.map +1 -0
  25. package/dist/adapters/openai.js +64 -0
  26. package/dist/adapters/openai.js.map +1 -0
  27. package/dist/adapters/remaining.d.ts +52 -0
  28. package/dist/adapters/remaining.d.ts.map +1 -0
  29. package/dist/adapters/remaining.js +67 -0
  30. package/dist/adapters/remaining.js.map +1 -0
  31. package/dist/client.d.ts +563 -0
  32. package/dist/client.d.ts.map +1 -0
  33. package/dist/client.js +653 -0
  34. package/dist/client.js.map +1 -0
  35. package/dist/errors.d.ts +25 -0
  36. package/dist/errors.d.ts.map +1 -0
  37. package/dist/errors.js +28 -0
  38. package/dist/errors.js.map +1 -0
  39. package/dist/hash.d.ts +13 -0
  40. package/dist/hash.d.ts.map +1 -0
  41. package/dist/hash.js +92 -0
  42. package/dist/hash.js.map +1 -0
  43. package/dist/index.d.ts +17 -404
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +17 -482
  46. package/dist/index.js.map +1 -0
  47. package/dist/types.d.ts +817 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +19 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +32 -46
  52. package/dist/index.d.mts +0 -407
  53. package/dist/index.mjs +0 -449
@@ -0,0 +1,563 @@
1
+ import type { AnswerResponse, Branch, ConsolidateResponse, Fact, FeedbackResponse, ContextPackResponse, ExplainResponse, ForgetResponse, IngestResponse, BlobGetResponse, BlobMetaResponse, BlobListResponse, ForkResponse, IngestAudioResponse, IngestImageResponse, IngestPdfResponse, IngestAnyResponse, IngestStructuredResponse, Outcome, RecallResponse, RememberResponse, RememberTextResponse, Scope, Source, TimelineEntry, TrackEntityResponse, WorkspaceResponse, EvidenceResponse, InvestigateResponse, CompileContextResponse, TraceResponse, EpisodeResponse, MemoryResponse } from "./types.js";
2
+ /** Current wall clock as epoch MICROSECONDS — the unit every Cilow time field uses. */
3
+ export declare function nowMicros(): number;
4
+ /** The content forms `ingest` accepts — exactly one. `url` is sent as `text` (the wire's one text
5
+ * field is "raw text or a URL"; the server fetches + snapshots a bare URL). */
6
+ export type IngestContent = {
7
+ facts: Fact[];
8
+ } | {
9
+ text: string;
10
+ } | {
11
+ url: string;
12
+ } | {
13
+ contentBase64: string;
14
+ mime?: string;
15
+ };
16
+ /**
17
+ * The idempotency key `ingest` sends when you pass no `sourceId`: a sha256 CONTENT HASH.
18
+ * The wire requires `source_id` (`RememberRequest.source_id` / `IngestAnyRequest.source_id` are
19
+ * non-optional) and a timestamp would make every retry a fresh write; hashing the content makes a
20
+ * retry of the same payload an idempotent no-op (the engine dedups under the tenant on this key).
21
+ * Pre-image: `"<form>:<content>"`, facts as canonical JSON (sorted keys, compact). The Python SDK's
22
+ * `ingest_source_id` computes the identical key.
23
+ */
24
+ export declare function ingestSourceId(content: IngestContent): string;
25
+ /** Options for `new CilowClient(...)`. */
26
+ export interface CilowClientOptions {
27
+ /** Base URL of a running cilow-serve, e.g. `http://localhost:8080`. */
28
+ baseUrl: string;
29
+ /** Bearer token (the `CILOW_TOKENS` entry). Required for `/rpc`; the server stamps its scope. */
30
+ token: string;
31
+ /**
32
+ * Default scope sent with every call. Over HTTP this is ignored (the server stamps it
33
+ * from the token), but it is honored by the stdio MCP transport, so it is kept for parity.
34
+ */
35
+ scope?: Scope;
36
+ /** Optional `fetch` implementation (defaults to global `fetch`). */
37
+ fetch?: typeof fetch;
38
+ /** Per-request timeout in milliseconds (default 30000). */
39
+ timeoutMs?: number;
40
+ }
41
+ export interface RememberOptions {
42
+ scope?: Scope;
43
+ /** Provenance kind (default `operator`). */
44
+ source?: Source;
45
+ /** Idempotency / provenance id for this batch (dedup key). Defaults to a generated id. */
46
+ sourceId?: string;
47
+ /** Observation time in epoch µs — the claims' `valid_from` (default: now). */
48
+ observedAt?: number;
49
+ /**
50
+ * The RAW source text these facts were extracted from (recommended). Captured durably into the
51
+ * engine's verbatim lane and made searchable — the lossless backstop, so a detail the extractor
52
+ * dropped is still recallable from the raw text. Without it the engine stores only the lossy claims.
53
+ * Mirrors the engine's `RememberRequest.raw_context`.
54
+ */
55
+ rawContext?: string;
56
+ /** Track A1: the git-style branch NAME to write to (default `"main"` = trunk). A fork's writes are
57
+ * isolated from main and other branches. */
58
+ branch?: string;
59
+ }
60
+ export interface RecallOptions {
61
+ scope?: Scope;
62
+ /** The valid-time `T` to read as-of, in epoch µs (default: now). `< now` ⇒ a historical read. */
63
+ asOf?: number;
64
+ /** The present clock in epoch µs (default: now). */
65
+ now?: number;
66
+ /** Optional fast-path entity-surface hint, e.g. `"Maya"`. */
67
+ anchor?: string;
68
+ /** Optional fast-path predicate hint, e.g. `"employer"`. */
69
+ attribute?: string;
70
+ /** Track A1: the git-style branch NAME to read from (default `"main"` = trunk). An anchored read on a
71
+ * branch sees the branch's values, falling back to the base as-of the fork point for keys it never
72
+ * wrote. */
73
+ branch?: string;
74
+ }
75
+ export interface AnswerOptions {
76
+ scope?: Scope;
77
+ /** The present clock in epoch µs (default: now). */
78
+ now?: number;
79
+ anchor?: string;
80
+ attribute?: string;
81
+ /** Track A1: the git-style branch NAME to answer from (default `"main"` = trunk). */
82
+ branch?: string;
83
+ }
84
+ export interface ForkOptions {
85
+ scope?: Scope;
86
+ /** The base branch to fork from (default `"main"` = trunk). */
87
+ from?: string;
88
+ /** The fork instant in epoch µs — the valid-time cap the branch's read falls back under (default now). */
89
+ now?: number;
90
+ }
91
+ export interface TimelineOptions {
92
+ scope?: Scope;
93
+ /** The instant the `active` flag is computed against, in epoch µs (default: now). */
94
+ at?: number;
95
+ /** Optional window start (epoch µs). */
96
+ from?: number;
97
+ /** Optional window end (epoch µs). */
98
+ to?: number;
99
+ }
100
+ export interface TrackEntityOptions {
101
+ scope?: Scope;
102
+ /** The instant the alias class is resolved as-of, in epoch µs (default: now). */
103
+ at?: number;
104
+ }
105
+ export interface FeedbackOptions {
106
+ scope?: Scope;
107
+ }
108
+ export interface ConsolidateOptions {
109
+ scope?: Scope;
110
+ /** The present clock in epoch µs the decay/recency pass reads against (default: now). */
111
+ now?: number;
112
+ }
113
+ export interface RememberTextOptions {
114
+ scope?: Scope;
115
+ /** Idempotency / provenance id (default: generated). */
116
+ sourceId?: string;
117
+ /** Observation time in epoch µs — the claims' `valid_from` (default: now). */
118
+ observedAt?: number;
119
+ }
120
+ export interface IngestImageOptions {
121
+ scope?: Scope;
122
+ sourceId?: string;
123
+ observedAt?: number;
124
+ }
125
+ export interface IngestAudioOptions {
126
+ scope?: Scope;
127
+ sourceId?: string;
128
+ observedAt?: number;
129
+ }
130
+ export interface IngestPdfOptions {
131
+ scope?: Scope;
132
+ sourceId?: string;
133
+ observedAt?: number;
134
+ }
135
+ export interface IngestStructuredOptions {
136
+ scope?: Scope;
137
+ /** The column/key whose value names the entity (omit ⇒ subjectHint + row index). */
138
+ subjectField?: string;
139
+ sourceId?: string;
140
+ observedAt?: number;
141
+ }
142
+ export interface IngestAnyOptions {
143
+ scope?: Scope;
144
+ /** Optional mime HINT (the sniff verifies; bytes win a contradiction). */
145
+ mime?: string;
146
+ /** The subject derived facts anchor to when the content names none (defaults to the document). */
147
+ subjectHint?: string;
148
+ /** Free-form provenance pairs — each becomes a claim on the document entity. */
149
+ metadata?: Record<string, string>;
150
+ sourceId?: string;
151
+ observedAt?: number;
152
+ }
153
+ export interface ForgetOptions {
154
+ scope?: Scope;
155
+ /** Scope the forget to one attribute (omit to forget the whole entity). */
156
+ attribute?: string;
157
+ /** Forget exactly this value (requires `attribute`). */
158
+ value?: string;
159
+ /**
160
+ * When true, destroy the entity (OF1): truth + verbatim + span/claim ANN + known embed-cache
161
+ * keys. Attribute/value are ignored. Not complete Art.17 (query-cache residual).
162
+ */
163
+ erase?: boolean;
164
+ /** The instant the claims are retired as-of, in epoch µs (default: now). */
165
+ at?: number;
166
+ }
167
+ export interface IngestOptions {
168
+ scope?: Scope;
169
+ /** Idempotency / provenance key. Default: a content hash (see `ingestSourceId`) — retries dedup. */
170
+ sourceId?: string;
171
+ /** Observation time in epoch µs — the claims' `valid_from` (default: now). */
172
+ observedAt?: number;
173
+ /** Provenance kind (default `operator`). */
174
+ source?: Source;
175
+ /** The RAW source text the facts were extracted from — captured into the verbatim lane (lossless backstop). */
176
+ rawContext?: string;
177
+ /** Track A1: the git-style branch NAME to write to (default `"main"`). */
178
+ branch?: string;
179
+ /** The subject derived facts anchor to when the content names none (defaults to the document). */
180
+ subjectHint?: string;
181
+ /** Free-form provenance pairs — each becomes a claim on the document entity. */
182
+ metadata?: Record<string, string>;
183
+ }
184
+ export interface ContextPackOptions {
185
+ scope?: Scope;
186
+ /** Epoch µs — default now. */
187
+ now?: number;
188
+ /** Read truth as-of this instant (default: now). */
189
+ asOf?: number;
190
+ anchor?: string;
191
+ attribute?: string;
192
+ }
193
+ /** One claim minted by `memories.add`, with its opaque id. */
194
+ export interface AddedMemory {
195
+ id: string;
196
+ subject: string;
197
+ predicate: string;
198
+ object: string;
199
+ }
200
+ /** `memories.add` result — the episode echo handle + the per-claim memory ids. */
201
+ export interface MemoryAddResult {
202
+ id: string;
203
+ status: string;
204
+ count: number;
205
+ memories: AddedMemory[];
206
+ error?: string;
207
+ }
208
+ /** One search hit — `text` is a ready-to-inject line; the structured fields are kept alongside. */
209
+ export interface SearchHit {
210
+ id: string;
211
+ text: string;
212
+ entity: string;
213
+ subject?: string;
214
+ predicate?: string;
215
+ value: string;
216
+ score: number;
217
+ }
218
+ /** `memories.search` result — check `abstained` FIRST (when true, `results` is empty). */
219
+ export interface MemorySearchResult {
220
+ abstained: boolean;
221
+ trace_id: number;
222
+ results: SearchHit[];
223
+ reason?: string;
224
+ /** The MACHINE-readable abstain code (`below_threshold` | `no_candidates` | `provider_unavailable`). */
225
+ reason_code?: string;
226
+ /** The configured gate's confidence margin (q̂ − n). */
227
+ margin?: number;
228
+ /** Token-efficiency of the packed working set. */
229
+ packed_tokens?: number;
230
+ coverage_score?: number;
231
+ /** working_set: a ready-to-inject context block; answer: the synthesized prose answer. */
232
+ context_text?: string;
233
+ }
234
+ /** One memory as returned by `memories.get` / `memories.list`. */
235
+ export interface MemoryView {
236
+ id: string;
237
+ entity: string;
238
+ subject?: string;
239
+ predicate_id: number;
240
+ predicate?: string;
241
+ value: string;
242
+ confidence: number;
243
+ valid_from: number;
244
+ valid_until?: number;
245
+ active: boolean;
246
+ }
247
+ export interface MemoryListResult {
248
+ memories: MemoryView[];
249
+ total: number;
250
+ offset: number;
251
+ limit: number;
252
+ }
253
+ export interface MemoryUpdateResult {
254
+ ok: boolean;
255
+ id?: string;
256
+ previous_id?: string;
257
+ error?: string;
258
+ }
259
+ export interface MemoryDeleteResult {
260
+ ok: boolean;
261
+ deleted: number;
262
+ }
263
+ export interface AddMemoryOptions {
264
+ /** Base64 bytes of ANY type — routed through the never-reject ingest_any pipeline. */
265
+ contentBase64?: string;
266
+ /** Optional mime hint for `contentBase64` (the sniff verifies). */
267
+ mime?: string;
268
+ /** Default subject when the text names none (e.g. a user id). */
269
+ subjectHint?: string;
270
+ /** Dedup / idempotency key. */
271
+ customId?: string;
272
+ /** When the fact was observed, in epoch µs (default: server clock). */
273
+ observedAt?: number;
274
+ /** Reserved free-form metadata (accepted + echoed; not yet indexed). */
275
+ metadata?: Record<string, unknown>;
276
+ }
277
+ export interface SearchMemoryOptions {
278
+ /** Optional entity hint (exact fast-path lookup). */
279
+ anchor?: string;
280
+ /** Optional predicate hint (exact fast-path lookup). */
281
+ attribute?: string;
282
+ /** Result shape: "claims" (default) | "working_set" (adds a ready-to-inject context block) | "answer". */
283
+ mode?: "claims" | "working_set" | "answer";
284
+ }
285
+ export interface ListMemoryOptions {
286
+ offset?: number;
287
+ limit?: number;
288
+ /** When true, exclude retired/superseded history. */
289
+ activeOnly?: boolean;
290
+ }
291
+ /**
292
+ * The friendly id-based memories surface — the same six verbs as the HTTP API (`/v1/memories/*`) and
293
+ * the MCP tools. Reached via `client.memories`.
294
+ *
295
+ * ```ts
296
+ * const m = await cilow.memories.add("Maya is a senior engineer at Acme", { subjectHint: "Maya" });
297
+ * const r = await cilow.memories.search("where does Maya work", { anchor: "Maya", attribute: "employer" });
298
+ * if (!r.abstained) await cilow.memories.delete(r.results[0].id);
299
+ * ```
300
+ */
301
+ export interface MemoriesApi {
302
+ add(content: string, opts?: AddMemoryOptions): Promise<MemoryAddResult>;
303
+ search(query: string, opts?: SearchMemoryOptions): Promise<MemorySearchResult>;
304
+ /** Fetch one memory by id; resolves to `null` if it doesn't exist (or isn't this tenant's). */
305
+ get(id: string): Promise<MemoryView | null>;
306
+ list(opts?: ListMemoryOptions): Promise<MemoryListResult>;
307
+ update(id: string, value: string, opts?: {
308
+ observedAt?: number;
309
+ }): Promise<MemoryUpdateResult>;
310
+ delete(id: string, opts?: {
311
+ at?: number;
312
+ }): Promise<MemoryDeleteResult>;
313
+ batchAdd(items: Array<{
314
+ content: string;
315
+ } & AddMemoryOptions>): Promise<{
316
+ count: number;
317
+ results: MemoryAddResult[];
318
+ }>;
319
+ }
320
+ /**
321
+ * A thin, typed client for a running cilow-serve. One instance, five verbs:
322
+ *
323
+ * ```ts
324
+ * const cilow = new CilowClient({ baseUrl: "http://localhost:8080", token: "demo" });
325
+ * await cilow.remember([{ subject: "Maya", predicate: "employer", object: "Acme" }]);
326
+ * const r = await cilow.recall("where does Maya work", { anchor: "Maya", attribute: "employer" });
327
+ * if (r.abstained) console.log("engine doesn't know:", r.reason);
328
+ * else console.log(r.claims[0].value); // "Acme"
329
+ * ```
330
+ *
331
+ * Handles the JSON-RPC 2.0 envelope, bearer auth, and error mapping. The abstention
332
+ * contract is surfaced as a plain `abstained` boolean on `recall`/`answer` — never an
333
+ * exception. CilowError is thrown only for protocol / transport / auth failures.
334
+ */
335
+ export declare class CilowClient {
336
+ private readonly baseUrl;
337
+ private readonly token;
338
+ private readonly scope;
339
+ private readonly fetchImpl;
340
+ private readonly timeoutMs;
341
+ /** The friendly id-based memories surface: `client.memories.add(...)` etc. */
342
+ readonly memories: MemoriesApi;
343
+ constructor(opts: CilowClientOptions);
344
+ /** Liveness probe — `GET /health`, no auth. Returns true iff the server is up. */
345
+ health(): Promise<boolean>;
346
+ /** Ingest `(subject, predicate, object)` facts as bitemporal claims. Returns the write receipt. */
347
+ remember(facts: Fact[], opts?: RememberOptions): Promise<RememberResponse>;
348
+ /**
349
+ * Retrieve claims as-of a valid-time T, OR a calibrated abstain. Check `abstained`
350
+ * first. When true, `claims` is empty; use the caller's fallback or safe-deferral policy.
351
+ */
352
+ recall(query: string, opts?: RecallOptions): Promise<RecallResponse>;
353
+ /**
354
+ * Present-time synthesized answer with citations, OR a calibrated abstain. When
355
+ * `abstained` is true, `text` is the honored abstain message and `citations` is empty.
356
+ */
357
+ answer(query: string, opts?: AnswerOptions): Promise<AnswerResponse>;
358
+ /**
359
+ * Track A1 — create a git-style BRANCH of this tenant's memory (O(1), copies nothing). Write/
360
+ * supersede facts on the branch (`remember(facts, { branch: name })`) and they stay ISOLATED from
361
+ * `main` and other branches; an anchored `recall(q, { branch: name })` inherits main's value as of
362
+ * the fork for keys the branch never wrote. Check `ok`: false ⇒ rejected (see `error`).
363
+ */
364
+ fork(name: string, opts?: ForkOptions): Promise<ForkResponse>;
365
+ /** Track A1 — list this tenant's git-style branches (`main` first, then forks in name order). */
366
+ branchList(opts?: {
367
+ scope?: Scope;
368
+ }): Promise<Branch[]>;
369
+ /** The as-of-T bitemporal history of an entity's claims, ascending by `valid_from`. */
370
+ timeline(entity: string, opts?: TimelineOptions): Promise<TimelineEntry[]>;
371
+ /** Register / resolve an entity name to its canonical id + alias class as-of `at`. */
372
+ trackEntity(name: string, opts?: TrackEntityOptions): Promise<TrackEntityResponse>;
373
+ /**
374
+ * Report the outcome of a prior `recall` (by its `traceId`) so memory LEARNS — the
375
+ * outcome-feedback loop. A `"positive"` outcome reinforces the cited claims; `"negative"`
376
+ * down-weights them; either way the calibrated abstain gate's q̂ self-tunes. This is
377
+ * in-context learning at the memory layer — no model retraining.
378
+ *
379
+ * Check `.applied`: when FALSE the feedback was rejected (`.error` is `"unknown_trace"` or
380
+ * `"cross_tenant"`) and nothing was mutated. A cross-tenant attempt does NOT consume the
381
+ * owner's trace.
382
+ */
383
+ feedback(traceId: number, outcome: Outcome, opts?: FeedbackOptions): Promise<FeedbackResponse>;
384
+ /**
385
+ * Run the idle-time episodic→semantic pass for this tenant: promote corroborated claims,
386
+ * collapse supersession chains into queryable transitions, and decay stale never-recalled
387
+ * claims. Retire-not-delete — as-of-T history is preserved. Returns the counts.
388
+ */
389
+ consolidate(opts?: ConsolidateOptions): Promise<ConsolidateResponse>;
390
+ /**
391
+ * "Just add text": ingest free PROSE. A language model extracts (subject, predicate, object) facts,
392
+ * written as calibrated bitemporal claims — no hand-structuring. `subjectHint` is the default subject
393
+ * for a fact the text does not name. Check `.ok`: false ⇒ the text couldn't be read (`.error` says why).
394
+ */
395
+ rememberText(text: string, subjectHint: string, opts?: RememberTextOptions): Promise<RememberTextResponse>;
396
+ /**
397
+ * Make an image part of memory: a vision model reads it into a caption + facts, written as claims —
398
+ * so the image is recallable by an ordinary TEXT query. `imageBase64` is the raw base64 (no data: prefix).
399
+ * Check `.ok`: false ⇒ the image couldn't be read (`.error`).
400
+ */
401
+ ingestImage(imageBase64: string, mime: string, subjectHint: string, opts?: IngestImageOptions): Promise<IngestImageResponse>;
402
+ /**
403
+ * Make an audio clip part of memory: it's transcribed, then the transcript is written as a claim AND
404
+ * run through the same text→facts extraction prose uses — so the audio is recallable by an ordinary
405
+ * TEXT query. `audioBase64` is the raw base64 (no data: prefix). Check `.ok`: false ⇒ couldn't read (`.error`).
406
+ */
407
+ ingestAudio(audioBase64: string, mime: string, subjectHint: string, opts?: IngestAudioOptions): Promise<IngestAudioResponse>;
408
+ /**
409
+ * Make a PDF part of memory via the hybrid path: the text layer is extracted AND each page is rendered
410
+ * to an image read by a VLM, both written as claims — so a document (text-based or scanned) is
411
+ * recallable by an ordinary TEXT query. `pdfBase64` is the raw base64 (no data: prefix). Check `.ok`.
412
+ */
413
+ ingestPdf(pdfBase64: string, subjectHint: string, opts?: IngestPdfOptions): Promise<IngestPdfResponse>;
414
+ /**
415
+ * Ingest clean CSV or JSON DIRECTLY into claims — no LLM, no hallucination, no token cost. Each row is
416
+ * an entity, each column/key a predicate, each value an object. `format` is "csv" or "json";
417
+ * `subjectField` names the column/key that is the entity (omit ⇒ subjectHint + row index).
418
+ */
419
+ ingestStructured(data: string, format: "csv" | "json", subjectHint: string, opts?: IngestStructuredOptions): Promise<IngestStructuredResponse>;
420
+ /**
421
+ * Primary universal save API: hand Cilow literally any data. Pass exactly one of
422
+ * `contentBase64` (any bytes) or `text` (prose / CSV / JSON / a bare URL) in `content`. The data is
423
+ * sniffed, the ORIGINAL retained durably (`raw_id`/`blob_id`), a document entity + metadata claims
424
+ * written (so even unknown bytes are findable), and the matching typed reader runs when one exists.
425
+ * Reader/provider failures are surfaced in-band as `status: "degraded"` + `reader_error`, not as a
426
+ * calibrated "memory does not know" read abstain.
427
+ */
428
+ save(content: {
429
+ contentBase64: string;
430
+ } | {
431
+ text: string;
432
+ }, opts?: IngestAnyOptions): Promise<IngestAnyResponse>;
433
+ /**
434
+ * Legacy alias for `save`: the universal NEVER-REJECT ingest. Pass exactly one of
435
+ * `contentBase64` (any bytes) or `text` (prose / CSV / JSON / a bare URL) in `content`. The data is
436
+ * sniffed, the ORIGINAL retained durably (`blob_id`), a document entity + metadata claims written
437
+ * (so even unknown bytes are findable), and the matching typed reader runs when one exists (a URL
438
+ * is fetched + snapshotted; replay never re-fetches). `ok` is false only for malformed ARGUMENTS;
439
+ * unknown types and reader failures are `ok: true` with `routed` absent + `reader_error` set.
440
+ */
441
+ ingestAny(content: {
442
+ contentBase64: string;
443
+ } | {
444
+ text: string;
445
+ }, opts?: IngestAnyOptions): Promise<IngestAnyResponse>;
446
+ /**
447
+ * Retire memory (retire-not-delete), or destroy it when `erase: true` (OF1).
448
+ *
449
+ * Retire: omit `attribute` to forget the whole entity, set it to forget one attribute, add
450
+ * `value` to forget one value. As-of-T history before `at` is preserved.
451
+ *
452
+ * Erase: whole-entity destruction; counters on the receipt. Not complete Art.17.
453
+ */
454
+ forget(entity: string, opts?: ForgetOptions): Promise<ForgetResponse>;
455
+ /** Destructive right-to-be-forgotten path — `forget(entity, { erase: true })`. */
456
+ erase(entity: string, opts?: {
457
+ scope?: Scope;
458
+ at?: number;
459
+ }): Promise<ForgetResponse>;
460
+ /**
461
+ * Curated injectible pack + citations + trunk/suffix — no free-form synthesis (D2).
462
+ * When session trunk is on and `session != 0`, `trunk` is the stable multi-turn prefix.
463
+ */
464
+ contextPack(query: string, opts?: ContextPackOptions): Promise<ContextPackResponse>;
465
+ /**
466
+ * The ONE write door (core verb #1): store `{ facts }` | `{ text }` | `{ url }` | `{ contentBase64 }`.
467
+ *
468
+ * - `facts` — `[{ subject, predicate, object, multi? }]`. Rides the `remember` path. A new value for
469
+ * an exclusive attribute SUPERSEDES the old one (history stays queryable via `contextPack({ asOf })`);
470
+ * `multi: true` on a fact lets values coexist. `source` / `rawContext` / `branch` apply here.
471
+ * - `text` (prose / CSV / JSON), `url` (a bare URL — sent as `text`; the server fetches + snapshots
472
+ * it), `contentBase64` (+ `mime` hint) — ride the never-reject `ingest_any` path: the original is
473
+ * retained durably (`content.blob_id`), a document entity + `metadata` claims are written, and the
474
+ * matching typed reader runs when one exists. `subjectHint` / `metadata` apply here.
475
+ *
476
+ * `sourceId` defaults to a CONTENT HASH (`ingestSourceId`) so a retry of the same payload is an
477
+ * idempotent no-op; the key actually sent is echoed on `source_id`. Never throws for content —
478
+ * only for a transport / auth failure.
479
+ */
480
+ ingest(content: IngestContent, opts?: IngestOptions): Promise<IngestResponse>;
481
+ /**
482
+ * Why did a pack / recall surface what it surfaced? (core verb #4) Pass the `trace_id` from a
483
+ * `contextPack` / `recall` response. The report carries the cited claims (labels resolved, each with
484
+ * its inclusion probability), the read's `best_nonconformity` vs the tenant's grounding threshold
485
+ * `q_hat`, and whether the read was grounded (`isGrounded(r)`) or a gap. Read-only: explaining never
486
+ * consumes the feedback trace. `found: false` + `error` (`unknown_trace` / `cross_tenant`) is in-band.
487
+ */
488
+ explain(traceId: number, opts?: {
489
+ scope?: Scope;
490
+ }): Promise<ExplainResponse>;
491
+ /**
492
+ * Read a retained original back by its hex `blob_id` (from an ingest receipt or `blobList`).
493
+ * Full sha256-verified read by default; pass `offset`/`length` for a chunk-indexed RANGE read
494
+ * of a large blob (EOF-clamped; `total_len` in the response lets you paginate; `byte_len` is
495
+ * the returned window). `found:false` with no `error` is an ordinary miss; `error` in
496
+ * {invalid_id, invalid_range, storage, corrupt} means the range read FAILED — never treat it
497
+ * as absence. Bytes ride back in `data_base64`.
498
+ */
499
+ blobGet(blobId: string, opts?: {
500
+ offset?: number;
501
+ length?: number;
502
+ scope?: Scope;
503
+ }): Promise<BlobGetResponse>;
504
+ /**
505
+ * One retained blob's METADATA (mime, byte length, provenance, metadata pairs, chunk count) by
506
+ * hex `blob_id` — no bytes. `found:false` ⇒ this tenant retains no such blob.
507
+ */
508
+ blobMeta(blobId: string, scope?: Scope): Promise<BlobMetaResponse>;
509
+ /** Enumerate this tenant's retained original blobs with metadata (no bytes), deterministically ordered. */
510
+ blobList(scope?: Scope): Promise<BlobListResponse>;
511
+ createContextWorkspace(name: string, scope?: Scope): Promise<WorkspaceResponse>;
512
+ ingestEvidence(input: {
513
+ workspaceId: string;
514
+ sourceId: string;
515
+ sourceRevision: string;
516
+ text: string;
517
+ mime?: string;
518
+ metadata?: Record<string, string>;
519
+ coordinates?: Array<Record<string, unknown>>;
520
+ trust?: "untrusted" | "user_provided" | "tool_observed" | "operator_verified";
521
+ aclPrincipals?: string[];
522
+ scope?: Scope;
523
+ }): Promise<EvidenceResponse>;
524
+ investigate(workspaceId: string, query: string, opts?: {
525
+ tokenBudget?: number;
526
+ scope?: Scope;
527
+ }): Promise<InvestigateResponse>;
528
+ compileContext(workspaceId: string, query: string, opts: {
529
+ modelId: string;
530
+ tokenizerId: string;
531
+ modelContextTokenBudget?: number;
532
+ auditPayloadByteBudget?: number;
533
+ promptTemplateId?: string;
534
+ asOf?: number;
535
+ scope?: Scope;
536
+ }): Promise<CompileContextResponse>;
537
+ getCompiledContext(receiptId: string, scope?: Scope): Promise<CompileContextResponse>;
538
+ getContextTrace(traceId: string, scope?: Scope): Promise<TraceResponse>;
539
+ recordAgentEpisode(workspaceId: string, summary: string, evidenceIds: string[], scope?: Scope): Promise<EpisodeResponse>;
540
+ proposeMemory(input: {
541
+ workspaceId: string;
542
+ episodeId: string;
543
+ subject: string;
544
+ predicate: string;
545
+ value: string;
546
+ evidenceIds: string[];
547
+ scope?: Scope;
548
+ }): Promise<MemoryResponse>;
549
+ verifyMemory(proposalId: string, accept: boolean, reason: string, scope?: Scope): Promise<MemoryResponse>;
550
+ private mergeScope;
551
+ /**
552
+ * Issue one JSON-RPC `tools/call` and return the engine's `structuredContent`.
553
+ * Maps every failure mode (transport, HTTP, JSON-RPC error, malformed body) to a CilowError.
554
+ */
555
+ private call;
556
+ /**
557
+ * POST to `/v1/memories/<verb>` and return the parsed JSON body (plain REST, not JSON-RPC). With
558
+ * `allow404`, a 404 resolves to `null` (used by `memories.get`). Other 4xx/5xx throw a CilowError
559
+ * carrying the body's `error` string.
560
+ */
561
+ private callRest;
562
+ }
563
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,mBAAmB,EACnB,IAAI,EACJ,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,EACL,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,uFAAuF;AACvF,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;gFACgF;AAChF,MAAM,MAAM,aAAa,GACrB;IAAE,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GACf;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAU7D;AAED,0CAA0C;AAC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