agentfootprint 7.22.0 → 7.22.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.
Files changed (57) hide show
  1. package/dist/adapters/hosting/agentcore.js +68 -8
  2. package/dist/adapters/hosting/agentcore.js.map +1 -1
  3. package/dist/adapters/memory/agentcore.js +116 -11
  4. package/dist/adapters/memory/agentcore.js.map +1 -1
  5. package/dist/esm/adapters/hosting/agentcore.d.ts +34 -4
  6. package/dist/esm/adapters/hosting/agentcore.js +68 -8
  7. package/dist/esm/adapters/hosting/agentcore.js.map +1 -1
  8. package/dist/esm/adapters/memory/agentcore.d.ts +59 -1
  9. package/dist/esm/adapters/memory/agentcore.js +114 -10
  10. package/dist/esm/adapters/memory/agentcore.js.map +1 -1
  11. package/dist/esm/hosting/envelope.d.ts +31 -2
  12. package/dist/esm/hosting/envelope.js +42 -7
  13. package/dist/esm/hosting/envelope.js.map +1 -1
  14. package/dist/esm/hosting/errors.d.ts +44 -1
  15. package/dist/esm/hosting/errors.js +81 -1
  16. package/dist/esm/hosting/errors.js.map +1 -1
  17. package/dist/esm/hosting/index.d.ts +5 -1
  18. package/dist/esm/hosting/index.js +5 -1
  19. package/dist/esm/hosting/index.js.map +1 -1
  20. package/dist/esm/hosting/standingAgent.d.ts +9 -0
  21. package/dist/esm/hosting/standingAgent.js +30 -9
  22. package/dist/esm/hosting/standingAgent.js.map +1 -1
  23. package/dist/esm/lib/storedPreview.d.ts +58 -0
  24. package/dist/esm/lib/storedPreview.js +97 -0
  25. package/dist/esm/lib/storedPreview.js.map +1 -0
  26. package/dist/esm/memory-providers.d.ts +1 -1
  27. package/dist/esm/memory-providers.js +1 -1
  28. package/dist/esm/memory-providers.js.map +1 -1
  29. package/dist/hosting/envelope.js +42 -7
  30. package/dist/hosting/envelope.js.map +1 -1
  31. package/dist/hosting/errors.js +83 -2
  32. package/dist/hosting/errors.js.map +1 -1
  33. package/dist/hosting/index.js +6 -1
  34. package/dist/hosting/index.js.map +1 -1
  35. package/dist/hosting/standingAgent.js +29 -8
  36. package/dist/hosting/standingAgent.js.map +1 -1
  37. package/dist/lib/storedPreview.js +102 -0
  38. package/dist/lib/storedPreview.js.map +1 -0
  39. package/dist/memory-providers.js +2 -1
  40. package/dist/memory-providers.js.map +1 -1
  41. package/dist/types/adapters/hosting/agentcore.d.ts +34 -4
  42. package/dist/types/adapters/hosting/agentcore.d.ts.map +1 -1
  43. package/dist/types/adapters/memory/agentcore.d.ts +59 -1
  44. package/dist/types/adapters/memory/agentcore.d.ts.map +1 -1
  45. package/dist/types/hosting/envelope.d.ts +31 -2
  46. package/dist/types/hosting/envelope.d.ts.map +1 -1
  47. package/dist/types/hosting/errors.d.ts +44 -1
  48. package/dist/types/hosting/errors.d.ts.map +1 -1
  49. package/dist/types/hosting/index.d.ts +5 -1
  50. package/dist/types/hosting/index.d.ts.map +1 -1
  51. package/dist/types/hosting/standingAgent.d.ts +9 -0
  52. package/dist/types/hosting/standingAgent.d.ts.map +1 -1
  53. package/dist/types/lib/storedPreview.d.ts +59 -0
  54. package/dist/types/lib/storedPreview.d.ts.map +1 -0
  55. package/dist/types/memory-providers.d.ts +1 -1
  56. package/dist/types/memory-providers.d.ts.map +1 -1
  57. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ /**
2
+ * lib/storedPreview — how much of somebody's stored data an error may quote.
3
+ *
4
+ * A refusal about unreadable bytes has to show enough of them to be diagnosable
5
+ * ("ah, that is our envelope stringified by something that was not JSON") and no
6
+ * more, because the rest of those bytes are a conversation, a memory, or
7
+ * whatever else a user said. Error messages travel: they land in logs, in
8
+ * dashboards, in bug reports pasted into chat windows. So the quote is capped,
9
+ * and the cap lives HERE rather than being re-decided by each adapter that needs
10
+ * one — two copies of a redaction rule is one copy that will drift.
11
+ *
12
+ * Structured values are SUMMARISED rather than serialized: an array reports its
13
+ * length and an object its keys, because `String(anObject)` and
14
+ * `JSON.stringify(anArray)` are both ways of accidentally printing the payload
15
+ * this file exists to keep out of the message.
16
+ *
17
+ * Two functions, because a cap is only safe when the first bytes are structure.
18
+ * {@link previewStored} quotes a capped prefix — right for a value whose opening
19
+ * fields are metadata. {@link describeStoredShape} quotes nothing at all — right
20
+ * for a value whose content starts immediately. Choosing between them is the
21
+ * caller's job because only the caller knows what its bytes begin with.
22
+ */
23
+ /**
24
+ * How much of a stored value a refusal may quote. Enough to recognise a mangled
25
+ * encoding at a glance; not enough to leak what was being said.
26
+ */
27
+ export declare const STORED_PREVIEW_LIMIT = 64;
28
+ /**
29
+ * Describe what a store handed back WITHOUT quoting the whole thing.
30
+ *
31
+ * @example
32
+ * previewStored('{format=conversation-v1, data={version=1, …}}')
33
+ * // → '"{format=conversation-v1, data={version=1, …" (96 chars)'
34
+ * previewStored({ id: 'm-1', value: 'her address is …' })
35
+ * // → 'an object with keys: id, value'
36
+ */
37
+ export declare function previewStored(value: unknown): string;
38
+ /**
39
+ * Describe a stored value **without quoting any of it** — its type, its size and
40
+ * its shape, and nothing that came from a person.
41
+ *
42
+ * Use this instead of {@link previewStored} wherever the stored bytes carry
43
+ * user content from their first characters, so that even a capped prefix would
44
+ * leak. A `CheckpointEnvelope` opens with `format`, `data`, `savedAt` and can
45
+ * afford to be quoted; a `MemoryEntry` opens with `id` and then `value`, so its
46
+ * second field IS the thing somebody asked an agent to remember. The cap is a
47
+ * policy about how MUCH may be shown; this is the answer when the honest amount
48
+ * is none.
49
+ *
50
+ * It stays diagnosable, which is the whole job of the quote it replaces: a
51
+ * length, whether it is JSON at all, and its opening character are enough to
52
+ * recognise "an object stringified by something that was not JSON".
53
+ *
54
+ * @example
55
+ * describeStoredShape('{id=a, value={text=her address is …}}')
56
+ * // → "a 37-character string that is not JSON, starting '{'"
57
+ */
58
+ export declare function describeStoredShape(value: unknown): string;
59
+ //# sourceMappingURL=storedPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storedPreview.d.ts","sourceRoot":"","sources":["../../../src/lib/storedPreview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOpD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA2B1D"}
@@ -33,6 +33,6 @@
33
33
  * import { RedisStore, AgentCoreStore } from 'agentfootprint/memory-providers';
34
34
  */
35
35
  export { RedisStore, type RedisStoreOptions, type RedisLikeClient, type RedisLikePipeline, } from './adapters/memory/redis.js';
36
- export { AgentCoreStore, type AgentCoreStoreOptions, type AgentCoreLikeClient, type AgentCoreEvent, type AgentCoreMemoryRecord, } from './adapters/memory/agentcore.js';
36
+ export { AgentCoreStore, UnreadableMemoryEntryError, type AgentCoreStoreOptions, type AgentCoreLikeClient, type AgentCoreEvent, type AgentCoreMemoryRecord, } from './adapters/memory/agentcore.js';
37
37
  export { BedrockAgentMemory, type BedrockAgentMemoryOptions, type BedrockAgentMemoryLikeClient, type BedrockAgentSummary, } from './adapters/memory/bedrockAgentMemory.js';
38
38
  //# sourceMappingURL=memory-providers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory-providers.d.ts","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,GACzB,MAAM,yCAAyC,CAAC"}
1
+ {"version":3,"file":"memory-providers.d.ts","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,GACzB,MAAM,yCAAyC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentfootprint",
3
- "version": "7.22.0",
3
+ "version": "7.22.1",
4
4
  "description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
5
5
  "license": "MIT",
6
6
  "author": "Sanjay Krishna Anbalagan",