@tangleai/context 0.21.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.
@@ -0,0 +1,515 @@
1
+ export namespace GOAL_SCHEMA {
2
+ export let $id: string;
3
+ export let type: string;
4
+ export namespace properties {
5
+ export namespace objective {
6
+ let type_1: string;
7
+ export { type_1 as type };
8
+ export let minLength: number;
9
+ }
10
+ export { AT as createdAt };
11
+ export namespace status {
12
+ let _enum: string[];
13
+ export { _enum as enum };
14
+ }
15
+ export namespace progress {
16
+ let type_2: string;
17
+ export { type_2 as type };
18
+ export namespace items {
19
+ let type_3: string;
20
+ export { type_3 as type };
21
+ export namespace properties_1 {
22
+ export { AT as at };
23
+ export { ID as id };
24
+ export namespace note {
25
+ let type_4: string;
26
+ export { type_4 as type };
27
+ let minLength_1: number;
28
+ export { minLength_1 as minLength };
29
+ }
30
+ export namespace evidence {
31
+ let type_5: string;
32
+ export { type_5 as type };
33
+ let minLength_2: number;
34
+ export { minLength_2 as minLength };
35
+ }
36
+ }
37
+ export { properties_1 as properties };
38
+ export let required: string[];
39
+ export let additionalProperties: boolean;
40
+ }
41
+ }
42
+ export namespace checkpoint {
43
+ let type_6: string;
44
+ export { type_6 as type };
45
+ export namespace properties_2 {
46
+ namespace version {
47
+ let _const: number;
48
+ export { _const as const };
49
+ }
50
+ namespace records {
51
+ let type_7: string;
52
+ export { type_7 as type };
53
+ export namespace items_1 {
54
+ let type_8: string;
55
+ export { type_8 as type };
56
+ export namespace properties_3 {
57
+ export { ID as note };
58
+ export { ID as evidence };
59
+ }
60
+ export { properties_3 as properties };
61
+ let required_1: string[];
62
+ export { required_1 as required };
63
+ let additionalProperties_1: boolean;
64
+ export { additionalProperties_1 as additionalProperties };
65
+ }
66
+ export { items_1 as items };
67
+ }
68
+ namespace sources {
69
+ let type_9: string;
70
+ export { type_9 as type };
71
+ export namespace items_2 {
72
+ let type_10: string;
73
+ export { type_10 as type };
74
+ export namespace properties_4 {
75
+ export { ID as id };
76
+ export { AT as at };
77
+ export namespace record {
78
+ let type_11: string;
79
+ export { type_11 as type };
80
+ export let minimum: number;
81
+ }
82
+ }
83
+ export { properties_4 as properties };
84
+ let required_2: string[];
85
+ export { required_2 as required };
86
+ let additionalProperties_2: boolean;
87
+ export { additionalProperties_2 as additionalProperties };
88
+ }
89
+ export { items_2 as items };
90
+ }
91
+ }
92
+ export { properties_2 as properties };
93
+ let required_3: string[];
94
+ export { required_3 as required };
95
+ let additionalProperties_3: boolean;
96
+ export { additionalProperties_3 as additionalProperties };
97
+ }
98
+ export namespace retention {
99
+ let type_12: string;
100
+ export { type_12 as type };
101
+ export namespace properties_5 {
102
+ export namespace version_1 {
103
+ let _const_1: number;
104
+ export { _const_1 as const };
105
+ }
106
+ export { version_1 as version };
107
+ export namespace reason {
108
+ let _const_2: string;
109
+ export { _const_2 as const };
110
+ }
111
+ export namespace retired {
112
+ let type_13: string;
113
+ export { type_13 as type };
114
+ export { ID as items };
115
+ export let uniqueItems: boolean;
116
+ }
117
+ }
118
+ export { properties_5 as properties };
119
+ let required_4: string[];
120
+ export { required_4 as required };
121
+ let additionalProperties_4: boolean;
122
+ export { additionalProperties_4 as additionalProperties };
123
+ }
124
+ }
125
+ let required_5: string[];
126
+ export { required_5 as required };
127
+ let additionalProperties_5: boolean;
128
+ export { additionalProperties_5 as additionalProperties };
129
+ }
130
+ export namespace MEMORY_SCHEMA {
131
+ let $id_1: string;
132
+ export { $id_1 as $id };
133
+ let type_14: string;
134
+ export { type_14 as type };
135
+ export namespace properties_6 {
136
+ export { ID as id };
137
+ export namespace text {
138
+ let type_15: string;
139
+ export { type_15 as type };
140
+ let minLength_3: number;
141
+ export { minLength_3 as minLength };
142
+ }
143
+ export namespace evidence_1 {
144
+ let anyOf: ({
145
+ type: "object";
146
+ properties: Record<string, object>;
147
+ required: string[];
148
+ additionalProperties: false;
149
+ } | {
150
+ type: string;
151
+ minLength: number;
152
+ })[];
153
+ }
154
+ export { evidence_1 as evidence };
155
+ export namespace tags {
156
+ let type_16: string;
157
+ export { type_16 as type };
158
+ export namespace items_3 {
159
+ let type_17: string;
160
+ export { type_17 as type };
161
+ let minLength_4: number;
162
+ export { minLength_4 as minLength };
163
+ }
164
+ export { items_3 as items };
165
+ }
166
+ export { AT as at };
167
+ export { EMBEDDING as embedding };
168
+ export { EMBEDDED_BY as embeddedBy };
169
+ }
170
+ export { properties_6 as properties };
171
+ let required_6: string[];
172
+ export { required_6 as required };
173
+ export { EMBEDDING_PAIR as dependencies };
174
+ let additionalProperties_6: boolean;
175
+ export { additionalProperties_6 as additionalProperties };
176
+ }
177
+ export namespace PROGRAM_SKILL_SCHEMA {
178
+ let type_18: string;
179
+ export { type_18 as type };
180
+ export namespace properties_7 {
181
+ export namespace version_2 {
182
+ let _const_3: number;
183
+ export { _const_3 as const };
184
+ }
185
+ export { version_2 as version };
186
+ export namespace question {
187
+ let type_19: string;
188
+ export { type_19 as type };
189
+ let minLength_5: number;
190
+ export { minLength_5 as minLength };
191
+ }
192
+ export namespace fingerprint {
193
+ let type_20: string;
194
+ export { type_20 as type };
195
+ export let pattern: string;
196
+ }
197
+ export namespace environmentId {
198
+ let type_21: string;
199
+ export { type_21 as type };
200
+ let minLength_6: number;
201
+ export { minLength_6 as minLength };
202
+ }
203
+ export namespace schemaVersion {
204
+ let type_22: string;
205
+ export { type_22 as type };
206
+ let minLength_7: number;
207
+ export { minLength_7 as minLength };
208
+ }
209
+ export namespace document {
210
+ let type_23: string;
211
+ export { type_23 as type };
212
+ }
213
+ export namespace evidence_2 {
214
+ let type_24: string;
215
+ export { type_24 as type };
216
+ let minLength_8: number;
217
+ export { minLength_8 as minLength };
218
+ }
219
+ export { evidence_2 as evidence };
220
+ export namespace checked {
221
+ let _const_4: boolean;
222
+ export { _const_4 as const };
223
+ }
224
+ }
225
+ export { properties_7 as properties };
226
+ let required_7: string[];
227
+ export { required_7 as required };
228
+ let additionalProperties_7: boolean;
229
+ export { additionalProperties_7 as additionalProperties };
230
+ }
231
+ export namespace SKILL_SCHEMA {
232
+ let $id_2: string;
233
+ export { $id_2 as $id };
234
+ let type_25: string;
235
+ export { type_25 as type };
236
+ export namespace properties_8 {
237
+ export { ID as id };
238
+ export namespace name {
239
+ let type_26: string;
240
+ export { type_26 as type };
241
+ let minLength_9: number;
242
+ export { minLength_9 as minLength };
243
+ }
244
+ export namespace when {
245
+ let type_27: string;
246
+ export { type_27 as type };
247
+ let minLength_10: number;
248
+ export { minLength_10 as minLength };
249
+ }
250
+ export namespace instructions {
251
+ let type_28: string;
252
+ export { type_28 as type };
253
+ let minLength_11: number;
254
+ export { minLength_11 as minLength };
255
+ }
256
+ export { PROGRAM_SKILL_SCHEMA as program };
257
+ export namespace tools {
258
+ let type_29: string;
259
+ export { type_29 as type };
260
+ export namespace items_4 {
261
+ let type_30: string;
262
+ export { type_30 as type };
263
+ let minLength_12: number;
264
+ export { minLength_12 as minLength };
265
+ }
266
+ export { items_4 as items };
267
+ }
268
+ export { AT as at };
269
+ export { EMBEDDING as embedding };
270
+ export { EMBEDDED_BY as embeddedBy };
271
+ }
272
+ export { properties_8 as properties };
273
+ let required_8: string[];
274
+ export { required_8 as required };
275
+ export { EMBEDDING_PAIR as dependencies };
276
+ let additionalProperties_8: boolean;
277
+ export { additionalProperties_8 as additionalProperties };
278
+ }
279
+ export namespace SLOT_SCHEMA {
280
+ let $id_3: string;
281
+ export { $id_3 as $id };
282
+ let type_31: string;
283
+ export { type_31 as type };
284
+ export namespace properties_9 {
285
+ export { ID as name };
286
+ export namespace kind {
287
+ let type_32: string;
288
+ export { type_32 as type };
289
+ let minLength_13: number;
290
+ export { minLength_13 as minLength };
291
+ }
292
+ export namespace size {
293
+ let type_33: string;
294
+ export { type_33 as type };
295
+ let minimum_1: number;
296
+ export { minimum_1 as minimum };
297
+ }
298
+ export namespace excerpt {
299
+ let type_34: string;
300
+ export { type_34 as type };
301
+ }
302
+ export { AT as at };
303
+ export namespace count {
304
+ let type_35: string;
305
+ export { type_35 as type };
306
+ let minimum_2: number;
307
+ export { minimum_2 as minimum };
308
+ }
309
+ export namespace pinned {
310
+ let type_36: string;
311
+ export { type_36 as type };
312
+ }
313
+ }
314
+ export { properties_9 as properties };
315
+ let required_9: string[];
316
+ export { required_9 as required };
317
+ let additionalProperties_9: boolean;
318
+ export { additionalProperties_9 as additionalProperties };
319
+ }
320
+ export namespace LEDGER_SCHEMAS {
321
+ export { GOAL_SCHEMA as goal };
322
+ export { MEMORY_SCHEMA as memory };
323
+ export { SKILL_SCHEMA as skill };
324
+ export { SLOT_SCHEMA as slot };
325
+ }
326
+ /**
327
+ * One evidenced progress entry on the active goal.
328
+ */
329
+ export type LedgerProgressEntry = {
330
+ id?: string;
331
+ /**
332
+ * RFC 3339
333
+ */
334
+ at: string;
335
+ note: string;
336
+ evidence: string;
337
+ };
338
+ /**
339
+ * The active (or archived) objective — see {@link GOAL_SCHEMA}.
340
+ */
341
+ export type LedgerGoal = {
342
+ objective: string;
343
+ /**
344
+ * RFC 3339
345
+ */
346
+ createdAt: string;
347
+ status: "active" | "done" | "abandoned" | "superseded";
348
+ progress: LedgerProgressEntry[];
349
+ checkpoint?: {
350
+ version: 1;
351
+ records: {
352
+ note: string;
353
+ evidence: string;
354
+ }[];
355
+ sources: {
356
+ id: string;
357
+ at: string;
358
+ record: number;
359
+ }[];
360
+ };
361
+ retention?: {
362
+ version: 1;
363
+ reason: "goal-budget";
364
+ retired: string[];
365
+ };
366
+ };
367
+ /**
368
+ * A vector's identity — see {@link EMBEDDED_BY}. What `recall({ near })`
369
+ * compares against the query embedder's `{ model, dims }` before any
370
+ * arithmetic happens.
371
+ */
372
+ export type LedgerEmbeddedBy = {
373
+ model: string;
374
+ dims: number;
375
+ };
376
+ /**
377
+ * The vector pair, both-or-neither — the schemas' `dependencies` rule
378
+ * (see {@link EMBEDDING_PAIR}) stated in the type: a record either
379
+ * carries `embedding` AND `embeddedBy`, or neither. `embedding` is the
380
+ * vector `recall({ near })` ranks by — plain numbers, never a typed
381
+ * array — and `embeddedBy` its identity. Narrow on either member and
382
+ * the other follows: `if (record.embedding) record.embeddedBy.dims`.
383
+ * An orphan vector does not type, just as the ledger refuses it.
384
+ */
385
+ export type LedgerEmbeddingPair = {
386
+ embedding?: undefined;
387
+ embeddedBy?: undefined;
388
+ } | {
389
+ embedding: number[];
390
+ embeddedBy: LedgerEmbeddedBy;
391
+ };
392
+ /**
393
+ * A stored memory's own members — see {@link MEMORY_SCHEMA}; the
394
+ * record is these plus {@link LedgerEmbeddingPair}.
395
+ */
396
+ export type LedgerMemoryFields = {
397
+ id: string;
398
+ text: string;
399
+ evidence: string | import("./evidence.js").ClaimEvidenceEnvelope;
400
+ tags: string[];
401
+ /**
402
+ * RFC 3339
403
+ */
404
+ at: string;
405
+ };
406
+ /**
407
+ * A stored memory — see {@link MEMORY_SCHEMA}.
408
+ */
409
+ export type LedgerMemory = LedgerMemoryFields & LedgerEmbeddingPair;
410
+ /**
411
+ * A stored skill's own members — see {@link SKILL_SCHEMA}; the record
412
+ * is these plus {@link LedgerEmbeddingPair}.
413
+ */
414
+ export type LedgerSkillFields = {
415
+ id: string;
416
+ name: string;
417
+ when: string;
418
+ instructions: string;
419
+ tools: string[];
420
+ /**
421
+ * RFC 3339
422
+ */
423
+ at: string;
424
+ program?: {
425
+ version: 1;
426
+ question: string;
427
+ fingerprint: string;
428
+ environmentId: string;
429
+ schemaVersion: string;
430
+ document: any;
431
+ evidence: string;
432
+ checked: true;
433
+ };
434
+ };
435
+ /**
436
+ * A stored skill — see {@link SKILL_SCHEMA}.
437
+ */
438
+ export type LedgerSkill = LedgerSkillFields & LedgerEmbeddingPair;
439
+ /**
440
+ * A slot's metadata — see {@link SLOT_SCHEMA}. Never the content.
441
+ */
442
+ export type LedgerSlot = {
443
+ name: string;
444
+ kind: string;
445
+ size: number;
446
+ excerpt: string;
447
+ /**
448
+ * RFC 3339
449
+ */
450
+ at: string;
451
+ count?: number;
452
+ pinned?: boolean;
453
+ };
454
+ /**
455
+ * The one rejection shape every schema-guarded write answers with —
456
+ * produced by `invalidInput` in `check.js`, named here because this is
457
+ * where a consumer of the ledger's API goes looking for "what comes
458
+ * back when a write is refused".
459
+ */
460
+ export type LedgerRejection = {
461
+ error: string;
462
+ errors: any[];
463
+ inputSchema: any;
464
+ };
465
+ declare namespace AT {
466
+ let type_37: string;
467
+ export { type_37 as type };
468
+ export let format: string;
469
+ let pattern_1: string;
470
+ export { pattern_1 as pattern };
471
+ }
472
+ declare namespace ID {
473
+ let type_38: string;
474
+ export { type_38 as type };
475
+ let minLength_14: number;
476
+ export { minLength_14 as minLength };
477
+ }
478
+ declare namespace EMBEDDING {
479
+ let type_39: string;
480
+ export { type_39 as type };
481
+ export namespace items_5 {
482
+ let type_40: string;
483
+ export { type_40 as type };
484
+ }
485
+ export { items_5 as items };
486
+ export let minItems: number;
487
+ }
488
+ declare namespace EMBEDDED_BY {
489
+ let type_41: string;
490
+ export { type_41 as type };
491
+ export namespace properties_10 {
492
+ namespace model {
493
+ let type_42: string;
494
+ export { type_42 as type };
495
+ let minLength_15: number;
496
+ export { minLength_15 as minLength };
497
+ }
498
+ namespace dims {
499
+ let type_43: string;
500
+ export { type_43 as type };
501
+ let minimum_3: number;
502
+ export { minimum_3 as minimum };
503
+ }
504
+ }
505
+ export { properties_10 as properties };
506
+ let required_10: string[];
507
+ export { required_10 as required };
508
+ let additionalProperties_10: boolean;
509
+ export { additionalProperties_10 as additionalProperties };
510
+ }
511
+ declare namespace EMBEDDING_PAIR {
512
+ let embedding: string[];
513
+ let embeddedBy: string[];
514
+ }
515
+ export {};