@yaks/memory 0.0.0-stage → 0.2.36

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 (63) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +309 -2
  3. package/_dist/comp.d.ts +9 -0
  4. package/_dist/comp.d.ts.map +1 -0
  5. package/_dist/earlier.d.ts +108 -0
  6. package/_dist/earlier.d.ts.map +1 -0
  7. package/_dist/graph.d.ts +13 -0
  8. package/_dist/graph.d.ts.map +1 -0
  9. package/_dist/inspect.d.ts +28 -0
  10. package/_dist/inspect.d.ts.map +1 -0
  11. package/_dist/mod.d.ts +54 -0
  12. package/_dist/mod.d.ts.map +1 -0
  13. package/_dist/passage.d.ts +19 -0
  14. package/_dist/passage.d.ts.map +1 -0
  15. package/_dist/recall.d.ts +67 -0
  16. package/_dist/recall.d.ts.map +1 -0
  17. package/_dist/save.d.ts +45 -0
  18. package/_dist/save.d.ts.map +1 -0
  19. package/_dist/tools.d.ts +12 -0
  20. package/_dist/tools.d.ts.map +1 -0
  21. package/_dist/views.d.ts +17 -0
  22. package/_dist/views.d.ts.map +1 -0
  23. package/_dist/vocab.d.ts +7 -0
  24. package/_dist/vocab.d.ts.map +1 -0
  25. package/around.js +141 -0
  26. package/around.js.map +1 -0
  27. package/around.ts +152 -0
  28. package/comp.js +42 -0
  29. package/comp.js.map +1 -0
  30. package/comp.ts +45 -0
  31. package/deno.json +1 -0
  32. package/earlier.js +386 -0
  33. package/earlier.js.map +1 -0
  34. package/earlier.ts +494 -0
  35. package/graph.js +138 -0
  36. package/graph.js.map +1 -0
  37. package/graph.ts +133 -0
  38. package/inspect.js +168 -0
  39. package/inspect.js.map +1 -0
  40. package/inspect.ts +169 -0
  41. package/mod.js +54 -0
  42. package/mod.js.map +1 -0
  43. package/mod.ts +55 -0
  44. package/package.json +51 -4
  45. package/passage.js +67 -0
  46. package/passage.js.map +1 -0
  47. package/passage.ts +75 -0
  48. package/recall.js +145 -0
  49. package/recall.js.map +1 -0
  50. package/recall.ts +180 -0
  51. package/save.js +93 -0
  52. package/save.js.map +1 -0
  53. package/save.ts +113 -0
  54. package/tools.js +246 -0
  55. package/tools.js.map +1 -0
  56. package/tools.ts +250 -0
  57. package/views.js +18 -0
  58. package/views.js.map +1 -0
  59. package/views.ts +23 -0
  60. package/vocab.js +14 -0
  61. package/vocab.js.map +1 -0
  62. package/vocab.json +456 -0
  63. package/vocab.ts +16 -0
package/vocab.js ADDED
@@ -0,0 +1,14 @@
1
+ // The memory components, and only those: the `@yaks/memory/vocab` entry point.
2
+ // It imports no storage, no SQL and no runtime, so a browser tab that loads
3
+ // this vocabulary loads nothing else.
4
+ import { memoryDoc } from "./comp.js";
5
+ import manifest from './package.json' with {
6
+ type: 'json'
7
+ };
8
+ export { memoryDoc };
9
+ /** What this package is: its manifest's description, the one place it is
10
+ * written, which a host stamps on each document here. */ export let description = manifest.description;
11
+ /** Every document this plugin declares. */ export let docs = [
12
+ memoryDoc
13
+ ];
14
+ //# sourceMappingURL=vocab.js.map
package/vocab.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocab.js","sources":["./vocab.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,4EAA4E;AAC5E,sCAAsC;AAGtC,SAAS,SAAS,oBAAmB;AACrC,OAAO,cAAc,sBAAsB;EAAE,MAAM;AAAO,EAAC;AAE3D,SAAS,SAAS,GAAE;AAEpB;uDACuD,GACvD,OAAO,IAAI,cAAsB,SAAS,WAAW,CAAA;AAErD,yCAAyC,GACzC,OAAO,IAAI,OAAmB;EAAC;CAAU,CAAA"}
package/vocab.json ADDED
@@ -0,0 +1,456 @@
1
+ {
2
+ "$id": "urn:uuid:aa721a7a-c4e7-4d01-b855-daa8dce36db8",
3
+ "$vocabulary": {
4
+ "https://yak.sh/vocab/core": true,
5
+ "https://yak.sh/vocab/id": true,
6
+ "https://yak.sh/vocab/kernel": true
7
+ },
8
+ "title": "memory",
9
+ "$defs": {
10
+ "feedback": {
11
+ "$id": "urn:uuid:9c87c041-380a-464c-9e87-b3688cfcd5da",
12
+ "component": true,
13
+ "type": "object",
14
+ "properties": {
15
+ "by": {
16
+ "$id": "urn:uuid:5ea0b6c4-c358-4e13-8d54-67c1ed4ff7f2",
17
+ "type": "string",
18
+ "ref": "entity",
19
+ "death": "keep"
20
+ }
21
+ },
22
+ "description": "this memory records a correction somebody gave, and who gave it"
23
+ },
24
+ "miss": {
25
+ "$id": "urn:uuid:122cbb47-e092-4126-8ca8-37745e5382be",
26
+ "component": true,
27
+ "type": "object",
28
+ "description": "worn beside feedback{by} on the entity that records a correction: what the corrected agent had wrong, and where the fact it lacked was. A miss is a case a way of assembling context can be scored on (@yaks/trial)",
29
+ "properties": {
30
+ "entry": {
31
+ "$id": "urn:uuid:4ebdb78c-bcdb-4d3e-9cd4-81b09a6bb477",
32
+ "type": "string",
33
+ "ref": "entry",
34
+ "death": "keep",
35
+ "description": "the agent's entry that erred; everything before it in its session is what the agent had"
36
+ },
37
+ "needed": {
38
+ "$id": "urn:uuid:591506c4-067e-47fc-a23b-d728b03c4231",
39
+ "type": "string",
40
+ "ref": "entity",
41
+ "death": "keep",
42
+ "description": "the entity that held the fact; absent when the graph did not hold it"
43
+ },
44
+ "across": {
45
+ "$id": "urn:uuid:1c138fdb-0134-4940-b123-fc7a5e0e9f57",
46
+ "type": "string",
47
+ "enum": ["compaction", "clear", "fork", "spawn"],
48
+ "description": "what stood between the fact and the agent, when something did"
49
+ },
50
+ "told": {
51
+ "$id": "urn:uuid:f4c9d26b-7742-4d93-be1f-c387929217de",
52
+ "type": "string",
53
+ "enum": ["restated", "pointed"],
54
+ "description": "restated when the person said the fact again, pointed when they said it is in the graph; absent when an agent found the miss"
55
+ },
56
+ "kind": {
57
+ "$id": "urn:uuid:180b9246-d2b4-492d-8a44-6dec8f1e99de",
58
+ "type": "string",
59
+ "enum": ["reserve", "offer", "directive"],
60
+ "description": "which known error it was: reserve when the agent kept back budget the person said to spend, offer when it ended on \"Want me to…?\" instead of doing it, directive when it posted the person's remark as a directive; absent when it was none of them"
61
+ }
62
+ }
63
+ },
64
+ "memory": {
65
+ "$id": "urn:uuid:ab0cd4b6-b02b-4f16-98b5-0727f8aef461",
66
+ "component": true,
67
+ "type": "object",
68
+ "description": "a mark on the entity holding one thing a person said about how they want something built or handled, in their own words: a session entry, a comment, a doc. The words are that entity's own text (a doc's body, an entry's content) and are never edited; memory_save makes a doc to hold them only where the graph does not hold them yet. These properties record where the words belong and what is needed to read them, and at, by and via who marked them and when. Who said them, and when, is the entity's created{at, by}",
69
+ "properties": {
70
+ "scope": {
71
+ "$id": "urn:uuid:80296218-c1f8-41ab-a8eb-79b985d61f61",
72
+ "type": "string",
73
+ "ref": "project",
74
+ "death": "keep"
75
+ },
76
+ "last_confirmed_at": {
77
+ "$id": "urn:uuid:1cc9d9cc-b1f5-4392-81e5-7c49a22ac7db",
78
+ "type": "string",
79
+ "format": "date-time",
80
+ "stamped": true
81
+ },
82
+ "space": {
83
+ "$id": "urn:uuid:63ce0dd5-37e7-4761-8919-f3994248e8c1",
84
+ "type": "string",
85
+ "ref": "entity",
86
+ "death": "cascade",
87
+ "description": "whose space they were said in — every member of that space can read them, and they are deleted with it"
88
+ },
89
+ "about": {
90
+ "$id": "urn:uuid:706e9a01-c1c5-4de6-b089-2a953397c6e8",
91
+ "type": "string",
92
+ "description": "the app they were said about, by slug, when they were about one"
93
+ },
94
+ "context": {
95
+ "$id": "urn:uuid:cbe951e2-157a-45a9-9626-67e26623a4ba",
96
+ "type": "string",
97
+ "description": "the line or two needed to understand the words — what was being talked about, never a restatement of what was said"
98
+ },
99
+ "at": {
100
+ "$id": "urn:uuid:d00a4a24-b733-434b-a6b8-d72bcdbee077",
101
+ "type": "string",
102
+ "format": "date-time",
103
+ "stamped": true,
104
+ "description": "when the words were marked"
105
+ },
106
+ "by": {
107
+ "$id": "urn:uuid:9a197ad8-2690-438a-bd79-396c7515cad4",
108
+ "type": "string",
109
+ "ref": "entity",
110
+ "death": "keep",
111
+ "stamped": true,
112
+ "description": "who marked them"
113
+ },
114
+ "via": {
115
+ "$id": "urn:uuid:67b1505c-7d32-4ab5-899c-02e250d8b7f0",
116
+ "type": "string",
117
+ "ref": "entity",
118
+ "death": "keep",
119
+ "stamped": true,
120
+ "description": "what they were marked through: a session, a client"
121
+ }
122
+ }
123
+ },
124
+ "belief": {
125
+ "$id": "urn:uuid:ed55d493-2678-4f83-82fd-fb7ba610199e",
126
+ "component": true,
127
+ "type": "object",
128
+ "description": "what a builder concluded from memories: one point a person made, or everything they said about one subject. Its doc says it; its built names the build that made it, and its cites edges what it was built from. Never edited by hand: a wrong belief is fixed in the builder that made it",
129
+ "properties": {
130
+ "scope": {
131
+ "$id": "urn:uuid:9fd03769-fcaa-4415-89ac-a828ae90992d",
132
+ "type": "string",
133
+ "ref": "project",
134
+ "death": "keep",
135
+ "description": "the project it holds for; absent for a principle that holds everywhere"
136
+ },
137
+ "about": {
138
+ "$id": "urn:uuid:80638005-5aca-416f-a77e-00f940bc930d",
139
+ "type": "string",
140
+ "ref": "entity",
141
+ "death": "keep",
142
+ "description": "its subject: a topic, a project, a package, a component (_comp) or a design"
143
+ }
144
+ }
145
+ },
146
+ "memory_save": {
147
+ "tool": true,
148
+ "destructive": false,
149
+ "noun": "memory",
150
+ "verb": "save",
151
+ "title": "Save a memory",
152
+ "step": {
153
+ "doing": "Remembering this…",
154
+ "done": "Remembered this"
155
+ },
156
+ "description": "Save verbatim words or mark their entity with on. said+feedback marks that person's earliest matching words; otherwise creates a doc for absent words. id patches; omitted fields stay. Replacing standalone words requires memory_recall's $was.doc.body as was; marked comments/entries retain text. feedback names the correcting person. Returns applied bundles.",
157
+ "input": {
158
+ "said": {
159
+ "type": "string",
160
+ "description": "Verbatim words."
161
+ },
162
+ "on": {
163
+ "type": "string",
164
+ "ref": "entity",
165
+ "description": "Entity holding the words: entry, comment or doc. If supplied, said must occur in its text."
166
+ },
167
+ "title": {
168
+ "type": "string",
169
+ "description": "Recall index line for a new memory; marking preserves existing text."
170
+ },
171
+ "context": {
172
+ "type": "string",
173
+ "description": "Discussion context in two lines; do not restate said.",
174
+ "short": "c"
175
+ },
176
+ "scope": {
177
+ "type": "string",
178
+ "ref": "project",
179
+ "description": "Project id/name. Omit to create a global memory or preserve existing scope.",
180
+ "short": "s"
181
+ },
182
+ "feedback": {
183
+ "type": "string",
184
+ "ref": "person",
185
+ "description": "Correcting person id/name; empty string means unknown. Either marks feedback."
186
+ },
187
+ "about": {
188
+ "type": "string",
189
+ "description": "App slug the words concern."
190
+ },
191
+ "id": {
192
+ "type": "string",
193
+ "ref": "memory",
194
+ "description": "Memory id/name to patch; omit to create."
195
+ },
196
+ "was": {
197
+ "type": "string",
198
+ "description": "memory_recall $was.doc.body token; required to replace existing words."
199
+ }
200
+ },
201
+ "positional": [
202
+ "said"
203
+ ]
204
+ },
205
+ "memory_recall": {
206
+ "tool": true,
207
+ "noun": "memory",
208
+ "verb": "recall",
209
+ "title": "Recall memories",
210
+ "step": {
211
+ "doing": "Recalling notes about “%{said}”…",
212
+ "done": "Recalled notes about “%{said}”",
213
+ "by": {
214
+ "said": {
215
+ "": {
216
+ "doing": "Recalling earlier notes…",
217
+ "done": "Recalled earlier notes"
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "description": "Read whole memories with context and $was.doc.body for memory_save.was. said ranks meaning with vectors, otherwise matches all words newest first. near ranks meaning; said then filters text. Without either, newest first. ids/scope/feedback filter.",
223
+ "input": {
224
+ "said": {
225
+ "type": "string",
226
+ "description": "Search words; vectors rank meaning, otherwise every word must match."
227
+ },
228
+ "near": {
229
+ "type": "string",
230
+ "ref": "entity",
231
+ "description": "Entity id/name to rank by meaning with vectors; said then filters text."
232
+ },
233
+ "ids": {
234
+ "type": "array",
235
+ "items": {
236
+ "type": "string",
237
+ "ref": "entity"
238
+ },
239
+ "description": "Memory ids."
240
+ },
241
+ "scope": {
242
+ "type": "string",
243
+ "ref": "project",
244
+ "description": "Only memories scoped to this project id/name, in a store that keeps projects; leave it out to recall from all.",
245
+ "short": "s"
246
+ },
247
+ "feedback": {
248
+ "type": "boolean",
249
+ "description": "Only corrections."
250
+ },
251
+ "limit": {
252
+ "type": "number",
253
+ "description": "Maximum results (default 8).",
254
+ "short": "n"
255
+ }
256
+ },
257
+ "readOnly": true,
258
+ "positional": [
259
+ "said"
260
+ ]
261
+ },
262
+ "memory_forget": {
263
+ "tool": true,
264
+ "destructive": true,
265
+ "noun": "memory",
266
+ "verb": "forget",
267
+ "title": "Forget a memory",
268
+ "step": {
269
+ "doing": "Forgetting a note…",
270
+ "done": "Forgot a note"
271
+ },
272
+ "description": "Forget one memory by id. A memory holding its own words goes to the trash whole; a mark on an entry, comment or doc is removed and the words stay where they were said. Either comes back from the trash. Returns the applied bundle.",
273
+ "input": {
274
+ "id": {
275
+ "type": "string",
276
+ "ref": "memory",
277
+ "description": "Memory id or name."
278
+ }
279
+ },
280
+ "required": [
281
+ "id"
282
+ ],
283
+ "positional": [
284
+ "id"
285
+ ]
286
+ },
287
+ "memory_source": {
288
+ "tool": true,
289
+ "noun": "memory",
290
+ "verb": "source",
291
+ "title": "Where somebody said these words",
292
+ "step": {
293
+ "doing": "Finding where this was said…",
294
+ "done": "Found where this was said"
295
+ },
296
+ "description": "Find the earliest entity the named person wrote containing these words verbatim. Other authors' quotes do not count. Returns whole bundles; refuses when no source exists. Use its id with memory_save.on.",
297
+ "input": {
298
+ "said": {
299
+ "type": "string",
300
+ "description": "Verbatim words; whitespace differences ignored."
301
+ },
302
+ "by": {
303
+ "type": "string",
304
+ "ref": "entity",
305
+ "description": "Speaker id or name."
306
+ }
307
+ },
308
+ "required": [
309
+ "said",
310
+ "by"
311
+ ],
312
+ "readOnly": true,
313
+ "positional": [
314
+ "said"
315
+ ]
316
+ },
317
+ "memory_around": {
318
+ "tool": true,
319
+ "noun": "memory",
320
+ "verb": "around",
321
+ "title": "Read the transcript around an entry",
322
+ "step": {
323
+ "doing": "Looking back over the conversation…",
324
+ "done": "Looked back over the conversation"
325
+ },
326
+ "description": "Return whole transcript entries around an entry, in order, including tool calls and results. before and after count entries. Refuses a non-entry id.",
327
+ "input": {
328
+ "id": {
329
+ "type": "string",
330
+ "ref": "entity",
331
+ "description": "Entry id or name."
332
+ },
333
+ "before": {
334
+ "type": "number",
335
+ "description": "Entries before (default 3).",
336
+ "short": "B"
337
+ },
338
+ "after": {
339
+ "type": "number",
340
+ "description": "Entries after (default 3).",
341
+ "short": "A"
342
+ }
343
+ },
344
+ "required": [
345
+ "id"
346
+ ],
347
+ "readOnly": true,
348
+ "positional": [
349
+ "id"
350
+ ]
351
+ },
352
+ "memory_target": {
353
+ "tool": true,
354
+ "noun": "memory",
355
+ "verb": "target",
356
+ "title": "What an entity is aimed at",
357
+ "step": {
358
+ "doing": "Looking up what this is about…",
359
+ "done": "Looked up what this is about"
360
+ },
361
+ "description": "Read whole entities named by its components' target fields; for a comment, what it comments on. Refuses an entity with no target.",
362
+ "input": {
363
+ "id": {
364
+ "type": "string",
365
+ "ref": "entity",
366
+ "description": "Entity id or name."
367
+ }
368
+ },
369
+ "required": [
370
+ "id"
371
+ ],
372
+ "readOnly": true,
373
+ "positional": [
374
+ "id"
375
+ ]
376
+ },
377
+ "memory_thread": {
378
+ "tool": true,
379
+ "noun": "memory",
380
+ "verb": "thread",
381
+ "title": "Read the discussion an entity is in",
382
+ "step": {
383
+ "doing": "Reading the discussion around this…",
384
+ "done": "Read the discussion around this"
385
+ },
386
+ "description": "Return the root target and all its comments and replies as whole bundles, oldest first. A target without comments answers alone.",
387
+ "input": {
388
+ "id": {
389
+ "type": "string",
390
+ "ref": "entity",
391
+ "description": "Entity id or name."
392
+ }
393
+ },
394
+ "required": [
395
+ "id"
396
+ ],
397
+ "readOnly": true,
398
+ "positional": [
399
+ "id"
400
+ ]
401
+ },
402
+ "memory_session": {
403
+ "tool": true,
404
+ "noun": "memory",
405
+ "verb": "session",
406
+ "title": "Where something happened",
407
+ "step": {
408
+ "doing": "Finding where this happened…",
409
+ "done": "Found where this happened"
410
+ },
411
+ "description": "Return the session that wrote an entity, then its worked-on or claimed tasks, as whole bundles. Refuses an entity with no session.",
412
+ "input": {
413
+ "id": {
414
+ "type": "string",
415
+ "ref": "entity",
416
+ "description": "Entity id or name."
417
+ }
418
+ },
419
+ "required": [
420
+ "id"
421
+ ],
422
+ "readOnly": true,
423
+ "positional": [
424
+ "id"
425
+ ]
426
+ }
427
+ },
428
+ "kinds": {
429
+ "memory": {
430
+ "$id": "urn:uuid:ab0cd4b6-b02b-4f16-98b5-0727f8aef461",
431
+ "description": "a mark on the entity holding one thing a person said about how they want something built or handled, in their own words: a session entry, a comment, a doc. The words are that entity's own text (a doc's body, an entry's content) and are never edited; memory_save makes a doc to hold them only where the graph does not hold them yet. These properties record where the words belong and what is needed to read them, and at, by and via who marked them and when. Who said them, and when, is the entity's created{at, by}",
432
+ "with": {
433
+ "doc": true
434
+ },
435
+ "prefix": "M",
436
+ "examples": [
437
+ {
438
+ "memory": {},
439
+ "doc": {
440
+ "title": "Tests run in seconds",
441
+ "body": "tests should take seconds"
442
+ }
443
+ }
444
+ ]
445
+ },
446
+ "belief": {
447
+ "$id": "urn:uuid:ed55d493-2678-4f83-82fd-fb7ba610199e",
448
+ "description": "what a builder concluded from memories: one point a person made, or everything they said about one subject. Its doc says it; its built names the build that made it, and its cites edges what it was built from. Never edited by hand: a wrong belief is fixed in the builder that made it",
449
+ "with": {
450
+ "doc": true,
451
+ "built": true
452
+ },
453
+ "prefix": "I"
454
+ }
455
+ }
456
+ }
package/vocab.ts ADDED
@@ -0,0 +1,16 @@
1
+ // The memory components, and only those: the `@yaks/memory/vocab` entry point.
2
+ // It imports no storage, no SQL and no runtime, so a browser tab that loads
3
+ // this vocabulary loads nothing else.
4
+
5
+ import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
6
+ import { memoryDoc } from './comp.js'
7
+ import manifest from './package.json' with { type: 'json' }
8
+
9
+ export { memoryDoc }
10
+
11
+ /** What this package is: its manifest's description, the one place it is
12
+ * written, which a host stamps on each document here. */
13
+ export let description: string = manifest.description
14
+
15
+ /** Every document this plugin declares. */
16
+ export let docs: VocabDoc[] = [memoryDoc]