agentfootprint 9.2.0 → 9.4.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.
- package/CLAUDE.md +3 -1
- package/dist/adapters/identity/agentcore.js +94 -26
- package/dist/adapters/identity/agentcore.js.map +1 -1
- package/dist/adapters/llm/BedrockProvider.js +34 -9
- package/dist/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/adapters/memory/pgVector.js +731 -0
- package/dist/adapters/memory/pgVector.js.map +1 -0
- package/dist/adapters/memory/s3Vectors.js +780 -0
- package/dist/adapters/memory/s3Vectors.js.map +1 -0
- package/dist/adapters/memory/sqliteVector.js +16 -79
- package/dist/adapters/memory/sqliteVector.js.map +1 -1
- package/dist/adapters/observability/cloudwatch.js +13 -8
- package/dist/adapters/observability/cloudwatch.js.map +1 -1
- package/dist/adapters/observability/xray.js +13 -8
- package/dist/adapters/observability/xray.js.map +1 -1
- package/dist/adapters/security/agentcore.js +0 -0
- package/dist/adapters/security/agentcore.js.map +1 -1
- package/dist/bridge/eventMeta.js +3 -0
- package/dist/bridge/eventMeta.js.map +1 -1
- package/dist/core/Agent.js +11 -0
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +80 -7
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/doors/security.js +3 -2
- package/dist/doors/security.js.map +1 -1
- package/dist/embedders/index.js +240 -76
- package/dist/embedders/index.js.map +1 -1
- package/dist/esm/adapters/identity/agentcore.d.ts +39 -9
- package/dist/esm/adapters/identity/agentcore.js +94 -26
- package/dist/esm/adapters/identity/agentcore.js.map +1 -1
- package/dist/esm/adapters/llm/BedrockProvider.d.ts +24 -0
- package/dist/esm/adapters/llm/BedrockProvider.js +34 -9
- package/dist/esm/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/esm/adapters/memory/pgVector.d.ts +243 -0
- package/dist/esm/adapters/memory/pgVector.js +726 -0
- package/dist/esm/adapters/memory/pgVector.js.map +1 -0
- package/dist/esm/adapters/memory/s3Vectors.d.ts +240 -0
- package/dist/esm/adapters/memory/s3Vectors.js +776 -0
- package/dist/esm/adapters/memory/s3Vectors.js.map +1 -0
- package/dist/esm/adapters/memory/sqliteVector.d.ts +5 -27
- package/dist/esm/adapters/memory/sqliteVector.js +10 -73
- package/dist/esm/adapters/memory/sqliteVector.js.map +1 -1
- package/dist/esm/adapters/observability/cloudwatch.d.ts +20 -0
- package/dist/esm/adapters/observability/cloudwatch.js +13 -8
- package/dist/esm/adapters/observability/cloudwatch.js.map +1 -1
- package/dist/esm/adapters/observability/xray.d.ts +18 -0
- package/dist/esm/adapters/observability/xray.js +13 -8
- package/dist/esm/adapters/observability/xray.js.map +1 -1
- package/dist/esm/adapters/security/agentcore.d.ts +81 -107
- package/dist/esm/adapters/security/agentcore.js +0 -0
- package/dist/esm/adapters/security/agentcore.js.map +1 -1
- package/dist/esm/bridge/eventMeta.d.ts +3 -0
- package/dist/esm/bridge/eventMeta.js +3 -0
- package/dist/esm/bridge/eventMeta.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +16 -0
- package/dist/esm/core/Agent.js +11 -0
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.js +80 -7
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/doors/security.d.ts +3 -2
- package/dist/esm/doors/security.js +3 -2
- package/dist/esm/doors/security.js.map +1 -1
- package/dist/esm/embedders/index.d.ts +99 -19
- package/dist/esm/embedders/index.js +240 -76
- package/dist/esm/embedders/index.js.map +1 -1
- package/dist/esm/events/dispatcher.d.ts +1 -1
- package/dist/esm/events/dispatcher.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +23 -1
- package/dist/esm/events/types.d.ts +17 -0
- package/dist/esm/hosting/standingAgent.js +14 -1
- package/dist/esm/hosting/standingAgent.js.map +1 -1
- package/dist/esm/lib/embedderMismatch.d.ts +67 -0
- package/dist/esm/lib/embedderMismatch.js +96 -0
- package/dist/esm/lib/embedderMismatch.js.map +1 -0
- package/dist/esm/lib/rag/defineRAG.d.ts +28 -6
- package/dist/esm/lib/rag/defineRAG.js +39 -5
- package/dist/esm/lib/rag/defineRAG.js.map +1 -1
- package/dist/esm/memory/define.js +31 -1
- package/dist/esm/memory/define.js.map +1 -1
- package/dist/esm/memory/define.types.d.ts +13 -2
- package/dist/esm/memory/define.types.js.map +1 -1
- package/dist/esm/memory/embedding/loadRelevant.d.ts +10 -2
- package/dist/esm/memory/embedding/loadRelevant.js +36 -18
- package/dist/esm/memory/embedding/loadRelevant.js.map +1 -1
- package/dist/esm/memory/pipeline/semantic.d.ts +13 -2
- package/dist/esm/memory/pipeline/semantic.js +11 -5
- package/dist/esm/memory/pipeline/semantic.js.map +1 -1
- package/dist/esm/memory/store/capability.d.ts +25 -6
- package/dist/esm/memory/store/capability.js +68 -3
- package/dist/esm/memory/store/capability.js.map +1 -1
- package/dist/esm/memory/store/index.d.ts +1 -0
- package/dist/esm/memory/store/index.js +4 -0
- package/dist/esm/memory/store/index.js.map +1 -1
- package/dist/esm/memory/store/types.d.ts +40 -0
- package/dist/esm/memory-providers.d.ts +7 -4
- package/dist/esm/memory-providers.js +18 -4
- package/dist/esm/memory-providers.js.map +1 -1
- package/dist/esm/recorders/core/CredentialRecorder.d.ts +30 -0
- package/dist/esm/recorders/core/CredentialRecorder.js +35 -0
- package/dist/esm/recorders/core/CredentialRecorder.js.map +1 -0
- package/dist/esm/security/index.d.ts +7 -3
- package/dist/esm/security/index.js +12 -7
- package/dist/esm/security/index.js.map +1 -1
- package/dist/events/dispatcher.js.map +1 -1
- package/dist/hosting/standingAgent.js +14 -1
- package/dist/hosting/standingAgent.js.map +1 -1
- package/dist/lib/embedderMismatch.js +103 -0
- package/dist/lib/embedderMismatch.js.map +1 -0
- package/dist/lib/rag/defineRAG.js +39 -5
- package/dist/lib/rag/defineRAG.js.map +1 -1
- package/dist/memory/define.js +31 -1
- package/dist/memory/define.js.map +1 -1
- package/dist/memory/define.types.js.map +1 -1
- package/dist/memory/embedding/loadRelevant.js +36 -18
- package/dist/memory/embedding/loadRelevant.js.map +1 -1
- package/dist/memory/pipeline/semantic.js +11 -5
- package/dist/memory/pipeline/semantic.js.map +1 -1
- package/dist/memory/store/capability.js +70 -4
- package/dist/memory/store/capability.js.map +1 -1
- package/dist/memory/store/index.js +7 -1
- package/dist/memory/store/index.js.map +1 -1
- package/dist/memory-providers.js +22 -5
- package/dist/memory-providers.js.map +1 -1
- package/dist/recorders/core/CredentialRecorder.js +39 -0
- package/dist/recorders/core/CredentialRecorder.js.map +1 -0
- package/dist/security/index.js +13 -7
- package/dist/security/index.js.map +1 -1
- package/dist/types/adapters/identity/agentcore.d.ts +39 -9
- package/dist/types/adapters/identity/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/llm/BedrockProvider.d.ts +24 -0
- package/dist/types/adapters/llm/BedrockProvider.d.ts.map +1 -1
- package/dist/types/adapters/memory/pgVector.d.ts +244 -0
- package/dist/types/adapters/memory/pgVector.d.ts.map +1 -0
- package/dist/types/adapters/memory/s3Vectors.d.ts +241 -0
- package/dist/types/adapters/memory/s3Vectors.d.ts.map +1 -0
- package/dist/types/adapters/memory/sqliteVector.d.ts +5 -27
- package/dist/types/adapters/memory/sqliteVector.d.ts.map +1 -1
- package/dist/types/adapters/observability/cloudwatch.d.ts +20 -0
- package/dist/types/adapters/observability/cloudwatch.d.ts.map +1 -1
- package/dist/types/adapters/observability/xray.d.ts +18 -0
- package/dist/types/adapters/observability/xray.d.ts.map +1 -1
- package/dist/types/adapters/security/agentcore.d.ts +81 -107
- package/dist/types/adapters/security/agentcore.d.ts.map +1 -1
- package/dist/types/bridge/eventMeta.d.ts +3 -0
- package/dist/types/bridge/eventMeta.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +16 -0
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/doors/security.d.ts +3 -2
- package/dist/types/doors/security.d.ts.map +1 -1
- package/dist/types/embedders/index.d.ts +99 -19
- package/dist/types/embedders/index.d.ts.map +1 -1
- package/dist/types/events/dispatcher.d.ts +1 -1
- package/dist/types/events/dispatcher.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +23 -1
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/types.d.ts +17 -0
- package/dist/types/events/types.d.ts.map +1 -1
- package/dist/types/hosting/standingAgent.d.ts.map +1 -1
- package/dist/types/lib/embedderMismatch.d.ts +68 -0
- package/dist/types/lib/embedderMismatch.d.ts.map +1 -0
- package/dist/types/lib/rag/defineRAG.d.ts +28 -6
- package/dist/types/lib/rag/defineRAG.d.ts.map +1 -1
- package/dist/types/memory/define.d.ts.map +1 -1
- package/dist/types/memory/define.types.d.ts +13 -2
- package/dist/types/memory/define.types.d.ts.map +1 -1
- package/dist/types/memory/embedding/loadRelevant.d.ts +10 -2
- package/dist/types/memory/embedding/loadRelevant.d.ts.map +1 -1
- package/dist/types/memory/pipeline/semantic.d.ts +13 -2
- package/dist/types/memory/pipeline/semantic.d.ts.map +1 -1
- package/dist/types/memory/store/capability.d.ts +25 -6
- package/dist/types/memory/store/capability.d.ts.map +1 -1
- package/dist/types/memory/store/index.d.ts +1 -0
- package/dist/types/memory/store/index.d.ts.map +1 -1
- package/dist/types/memory/store/types.d.ts +40 -0
- package/dist/types/memory/store/types.d.ts.map +1 -1
- package/dist/types/memory-providers.d.ts +7 -4
- package/dist/types/memory-providers.d.ts.map +1 -1
- package/dist/types/recorders/core/CredentialRecorder.d.ts +31 -0
- package/dist/types/recorders/core/CredentialRecorder.d.ts.map +1 -0
- package/dist/types/security/index.d.ts +7 -3
- package/dist/types/security/index.d.ts.map +1 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadRelevant.js","sourceRoot":"","sources":["../../../../src/memory/embedding/loadRelevant.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE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Config {
|
|
7
7
|
/** Vector-capable store. Must implement `search()`. */
|
|
8
8
|
readonly store: MemoryStore;
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Embedder used for both write-side indexing and read-side query.
|
|
11
|
+
*
|
|
12
|
+
* Optional since 9.3.0 for stores that declare `ranksBy: 'server-text'`:
|
|
13
|
+
* they take the query as words, so nothing here embeds. **Without one there
|
|
14
|
+
* is no WRITE half** — this library cannot embed a turn it has no embedder
|
|
15
|
+
* for, and a write subflow that stored vectorless entries into a backend
|
|
16
|
+
* that never reads them would be a no-op wearing a stage's name. The
|
|
17
|
+
* returned pipeline then carries `read` only (`defineMemory` refuses the
|
|
18
|
+
* combination unless the memory is `readOnly`, so the missing half is never
|
|
19
|
+
* a surprise).
|
|
20
|
+
*/
|
|
21
|
+
readonly embedder?: Embedder;
|
|
11
22
|
/**
|
|
12
23
|
* Stable id for the embedder — attached to written entries and used
|
|
13
24
|
* as a filter at read time so a later embedder swap doesn't produce
|
|
@@ -52,7 +52,7 @@ export function semanticPipeline(config) {
|
|
|
52
52
|
}
|
|
53
53
|
const loadConfig = {
|
|
54
54
|
store: config.store,
|
|
55
|
-
embedder: config.embedder,
|
|
55
|
+
...(config.embedder !== undefined && { embedder: config.embedder }),
|
|
56
56
|
...(config.embedderId !== undefined && { embedderId: config.embedderId }),
|
|
57
57
|
...(config.k !== undefined && { k: config.k }),
|
|
58
58
|
...(config.minScore !== undefined && { minScore: config.minScore }),
|
|
@@ -70,10 +70,6 @@ export function semanticPipeline(config) {
|
|
|
70
70
|
...(config.formatFooter !== undefined && { footer: config.formatFooter }),
|
|
71
71
|
...(config.flavor !== undefined && { flavor: config.flavor }),
|
|
72
72
|
};
|
|
73
|
-
const embedConfig = {
|
|
74
|
-
embedder: config.embedder,
|
|
75
|
-
...(config.embedderId !== undefined && { embedderId: config.embedderId }),
|
|
76
|
-
};
|
|
77
73
|
const writeConfig = {
|
|
78
74
|
store: config.store,
|
|
79
75
|
...(config.writeTier && { tier: config.writeTier }),
|
|
@@ -86,6 +82,16 @@ export function semanticPipeline(config) {
|
|
|
86
82
|
.addFunction('Format', formatDefault(formatConfig), 'format-default', 'Render selected entries as a system message')
|
|
87
83
|
.build();
|
|
88
84
|
// ── Write subflow: EmbedMessages → WriteMessages
|
|
85
|
+
//
|
|
86
|
+
// Built only when there is an embedder to build it around. Without one the
|
|
87
|
+
// pipeline is read-only by construction rather than by a flag — nothing to
|
|
88
|
+
// disable later by accident, and no stage in the chart that does nothing.
|
|
89
|
+
if (config.embedder === undefined)
|
|
90
|
+
return { read };
|
|
91
|
+
const embedConfig = {
|
|
92
|
+
embedder: config.embedder,
|
|
93
|
+
...(config.embedderId !== undefined && { embedderId: config.embedderId }),
|
|
94
|
+
};
|
|
89
95
|
const write = flowChart('EmbedMessages', embedMessages(embedConfig), 'embed-messages', { description: 'Embed newMessages into per-message vectors for vector search' })
|
|
90
96
|
.addFunction('WriteMessages', writeMessages(writeConfig), 'write-messages', 'Batch-persist messages with embeddings via store.putMany')
|
|
91
97
|
.build();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.js","sourceRoot":"","sources":["../../../../src/memory/pipeline/semantic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,YAAY,EAA2B,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,aAAa,GAGd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAA4B,MAAM,4BAA4B,CAAC;AAKrF,OAAO,EAAE,YAAY,EAA2B,MAAM,8BAA8B,CAAC;AACrF,OAAO,EACL,aAAa,GAGd,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"semantic.js","sourceRoot":"","sources":["../../../../src/memory/pipeline/semantic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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AC,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,WAAW;SACrB,WAAW,CACV,QAAQ,EACR,aAAa,CAAC,YAAY,CAAC,EAC3B,gBAAgB,EAChB,6CAA6C,CAC9C;SACA,KAAK,EAAE,CAAC;IAEX,kDAAkD;IAClD,EAAE;IACF,2EAA2E;IAC3E,2EAA2E;IAC3E,0EAA0E;IAC1E,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAEnD,MAAM,WAAW,GAAwB;QACvC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;KAC1E,CAAC;IACF,MAAM,KAAK,GAAG,SAAS,CACrB,eAAe,EACf,aAAa,CAAC,WAAW,CAAC,EAC1B,gBAAgB,EAChB,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAChF;SACE,WAAW,CACV,eAAe,EACf,aAAa,CAAC,WAAW,CAAC,EAC1B,gBAAgB,EAChB,0DAA0D,CAC3D;SACA,KAAK,EAAE,CAAC;IAEX,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Store capabilities — the two declared facts a store may state about its own
|
|
3
|
+
* `search()`, and the refusals they buy.
|
|
4
4
|
*
|
|
5
|
-
* Pattern: guard
|
|
6
|
-
* Role: memory/store layer, next to the port whose
|
|
5
|
+
* Pattern: guard clauses over declared port capabilities.
|
|
6
|
+
* Role: memory/store layer, next to the port whose bits they read.
|
|
7
7
|
* Emits: N/A.
|
|
8
8
|
*
|
|
9
9
|
* ── The failure this exists to end ──────────────────────────────────────────
|
|
@@ -24,13 +24,32 @@
|
|
|
24
24
|
* third-party adapter working unchanged.
|
|
25
25
|
*/
|
|
26
26
|
import type { MemoryStore } from './types.js';
|
|
27
|
+
/**
|
|
28
|
+
* The ranking mode a store DECLARES, with a contradiction refused by name.
|
|
29
|
+
*
|
|
30
|
+
* Two members answer two questions ({@link MemoryStore.supportsVectorSearch}
|
|
31
|
+
* "can you serve my vectors back?" and {@link MemoryStore.ranksBy} "what query
|
|
32
|
+
* form does your search take?"), and a store may state either, both, or
|
|
33
|
+
* neither. Both, disagreeing, is the one case that cannot be resolved: there is
|
|
34
|
+
* no reading of `{ supportsVectorSearch: true, ranksBy: 'server-text' }` that
|
|
35
|
+
* is not somebody's bug, and picking a winner would encode a guess about which
|
|
36
|
+
* line was the mistake. Refused — the same law that refuses `topK` beside
|
|
37
|
+
* `retrieval`.
|
|
38
|
+
*
|
|
39
|
+
* @returns `'vector'` | `'server-text'` | `undefined` (undeclared — the state
|
|
40
|
+
* every adapter written before 9.3.0 is in, and the one that must
|
|
41
|
+
* change nothing).
|
|
42
|
+
* @throws when the two declarations contradict each other.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveRankingMode(store: MemoryStore, caller: string): 'vector' | 'server-text' | undefined;
|
|
27
45
|
/**
|
|
28
46
|
* Refuse a store that has declared it cannot rank the vectors it is given.
|
|
29
47
|
*
|
|
30
48
|
* @param store the store the caller passed.
|
|
31
49
|
* @param caller the function name to put in the message — the call the
|
|
32
50
|
* reader actually wrote, not this helper.
|
|
33
|
-
* @throws when `store.supportsVectorSearch === false
|
|
34
|
-
*
|
|
51
|
+
* @throws when `store.supportsVectorSearch === false`, when it declares
|
|
52
|
+
* `ranksBy: 'server-text'`, or when the two declarations contradict.
|
|
53
|
+
* Never throws on a store that declares nothing.
|
|
35
54
|
*/
|
|
36
55
|
export declare function assertServesVectors(store: MemoryStore, caller: string): void;
|
|
@@ -1,15 +1,80 @@
|
|
|
1
1
|
/** The stores this library ships that DO rank the vectors they were given. */
|
|
2
|
-
const VECTOR_CAPABLE = 'InMemoryStore (dev/tests)
|
|
2
|
+
const VECTOR_CAPABLE = 'InMemoryStore (dev/tests), sqliteVectorStore (durable, one file), pgVectorStore ' +
|
|
3
|
+
'(Postgres + pgvector) or s3VectorsStore (Amazon S3 Vectors)';
|
|
4
|
+
/**
|
|
5
|
+
* The ranking mode a store DECLARES, with a contradiction refused by name.
|
|
6
|
+
*
|
|
7
|
+
* Two members answer two questions ({@link MemoryStore.supportsVectorSearch}
|
|
8
|
+
* "can you serve my vectors back?" and {@link MemoryStore.ranksBy} "what query
|
|
9
|
+
* form does your search take?"), and a store may state either, both, or
|
|
10
|
+
* neither. Both, disagreeing, is the one case that cannot be resolved: there is
|
|
11
|
+
* no reading of `{ supportsVectorSearch: true, ranksBy: 'server-text' }` that
|
|
12
|
+
* is not somebody's bug, and picking a winner would encode a guess about which
|
|
13
|
+
* line was the mistake. Refused — the same law that refuses `topK` beside
|
|
14
|
+
* `retrieval`.
|
|
15
|
+
*
|
|
16
|
+
* @returns `'vector'` | `'server-text'` | `undefined` (undeclared — the state
|
|
17
|
+
* every adapter written before 9.3.0 is in, and the one that must
|
|
18
|
+
* change nothing).
|
|
19
|
+
* @throws when the two declarations contradict each other.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveRankingMode(store, caller) {
|
|
22
|
+
const declared = store.ranksBy;
|
|
23
|
+
const servesVectors = store.supportsVectorSearch;
|
|
24
|
+
if (declared === undefined) {
|
|
25
|
+
// A bare `supportsVectorSearch: true` is a store saying it ranks the
|
|
26
|
+
// vectors it was given, which IS `'vector'` — read it as one, so a
|
|
27
|
+
// pre-9.3.0 adapter gets the new behaviour without a new line. A bare
|
|
28
|
+
// `false` says only that it cannot serve them back, not how it ranks, so
|
|
29
|
+
// it stays undeclared here.
|
|
30
|
+
return servesVectors === true ? 'vector' : undefined;
|
|
31
|
+
}
|
|
32
|
+
if (declared === 'vector' && servesVectors === false) {
|
|
33
|
+
throw new Error(contradiction(store, caller, 'vector', false));
|
|
34
|
+
}
|
|
35
|
+
if (declared === 'server-text' && servesVectors === true) {
|
|
36
|
+
throw new Error(contradiction(store, caller, 'server-text', true));
|
|
37
|
+
}
|
|
38
|
+
return declared;
|
|
39
|
+
}
|
|
40
|
+
function contradiction(store, caller, ranksBy, supportsVectorSearch) {
|
|
41
|
+
const name = storeName(store);
|
|
42
|
+
return (`${caller}: \`${name}\` declares \`ranksBy: '${ranksBy}'\` and ` +
|
|
43
|
+
`\`supportsVectorSearch: ${String(supportsVectorSearch)}\`, and those two cannot both be ` +
|
|
44
|
+
`true.\n` +
|
|
45
|
+
` \`ranksBy: 'vector'\` means search() ranks the embeddings you wrote, which is exactly ` +
|
|
46
|
+
`what \`supportsVectorSearch: true\` claims; \`'server-text'\` means the backend ranks ` +
|
|
47
|
+
`text on its own side, which is exactly what \`false\` admits.\n` +
|
|
48
|
+
` Fix: keep ONE of them. A local vector backend declares ` +
|
|
49
|
+
`\`ranksBy: 'vector'\` (or nothing but \`supportsVectorSearch: true\`); a managed ` +
|
|
50
|
+
`text-ranking backend declares \`ranksBy: 'server-text'\` and \`supportsVectorSearch: false\`.\n` +
|
|
51
|
+
` This refuses rather than picking a winner — either line could be the mistake, and ` +
|
|
52
|
+
`guessing which would silently decide whether your queries get embedded.`);
|
|
53
|
+
}
|
|
3
54
|
/**
|
|
4
55
|
* Refuse a store that has declared it cannot rank the vectors it is given.
|
|
5
56
|
*
|
|
6
57
|
* @param store the store the caller passed.
|
|
7
58
|
* @param caller the function name to put in the message — the call the
|
|
8
59
|
* reader actually wrote, not this helper.
|
|
9
|
-
* @throws when `store.supportsVectorSearch === false
|
|
10
|
-
*
|
|
60
|
+
* @throws when `store.supportsVectorSearch === false`, when it declares
|
|
61
|
+
* `ranksBy: 'server-text'`, or when the two declarations contradict.
|
|
62
|
+
* Never throws on a store that declares nothing.
|
|
11
63
|
*/
|
|
12
64
|
export function assertServesVectors(store, caller) {
|
|
65
|
+
// A contradiction is refused here too — a corpus builder is usually the
|
|
66
|
+
// FIRST call a new store meets, and it is the cheapest place to find out.
|
|
67
|
+
const mode = resolveRankingMode(store, caller);
|
|
68
|
+
if (mode === 'server-text') {
|
|
69
|
+
throw new Error(`${caller}: \`${storeName(store)}\` declares \`ranksBy: 'server-text'\`, so indexing a ` +
|
|
70
|
+
`corpus into it would report success and retrieve nothing.\n` +
|
|
71
|
+
` It embeds and ranks on the BACKEND's side, over a population the backend derived ` +
|
|
72
|
+
`itself — the vectors written here would be stored and never read.\n` +
|
|
73
|
+
` Fix: index into a vector-ranking store — ${VECTOR_CAPABLE}.\n` +
|
|
74
|
+
` Or: let the backend do its own ingestion (its console, its API), and point ` +
|
|
75
|
+
`\`defineRAG\` at it with NO embedder — a server-text store takes the question as ` +
|
|
76
|
+
`words, so there is nothing for this library to embed.`);
|
|
77
|
+
}
|
|
13
78
|
if (store.supportsVectorSearch !== false)
|
|
14
79
|
return;
|
|
15
80
|
const name = storeName(store);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../../../src/memory/store/capability.ts"],"names":[],"mappings":"AA2BA,8EAA8E;AAC9E,MAAM,cAAc,GAAG,
|
|
1
|
+
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../../../src/memory/store/capability.ts"],"names":[],"mappings":"AA2BA,8EAA8E;AAC9E,MAAM,cAAc,GAClB,kFAAkF;IAClF,6DAA6D,CAAC;AAEhE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAkB,EAClB,MAAc;IAEd,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,oBAAoB,CAAC;IACjD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,qEAAqE;QACrE,mEAAmE;QACnE,sEAAsE;QACtE,yEAAyE;QACzE,4BAA4B;QAC5B,OAAO,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC;IACD,I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,CAAC,oBAAoB,KAAK,KAAK;QAAE,OAAO;IACjD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,wEAAwE;IACxE,wEAAwE;IACxE,4DAA4D;IAC5D,MAAM,GAAG,GACP,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU;QAChC,CAAC,CAAC,iFAAiF;YACjF,oDAAoD;QACtD,CAAC,CAAC,6EAA6E;YAC7E,cAAc,CAAC;IACrB,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,OAAO,IAAI,mEAAmE;QACrF,wCAAwC;QACxC,kDAAkD,GAAG,gCAAgC;QACrF,mBAAmB;QACnB,+CAA+C,cAAc,wBAAwB;QACrF,oEAAoE;QACpE,YAAY,IAAI,yDAAyD;QACzE,gFAAgF,CACnF,CAAC;AACJ,CAAC;AAED,oFAAoF;AACpF,SAAS,SAAS,CAAC,KAAkB;IACnC,MAAM,IAAI,GAAI,KAA6C,CAAC,WAAW,CAAC;IACxE,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC;AAC9E,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { MemoryStore, ListOptions, ListResult, MemoryCursor, PutIfVersionResult, SearchOptions, ScoredEntry, } from './types.js';
|
|
2
2
|
export { InMemoryStore } from './InMemoryStore.js';
|
|
3
|
+
export { assertServesVectors, resolveRankingMode } from './capability.js';
|
|
3
4
|
export { staticVectorStore, assertCorpusBundle, bundleEntryToMemoryEntry, CORPUS_BUNDLE_FORMAT, type CorpusBundle, type CorpusBundleEntry, type EmbedderFingerprint, } from './staticVectorStore.js';
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { InMemoryStore } from './InMemoryStore.js';
|
|
2
|
+
// The declared-capability readers (9.3.0). `resolveRankingMode` is exported so
|
|
3
|
+
// an adapter author can check their own two declarations agree without waiting
|
|
4
|
+
// for a corpus builder to tell them.
|
|
5
|
+
export { assertServesVectors, resolveRankingMode } from './capability.js';
|
|
2
6
|
export { staticVectorStore, assertCorpusBundle, bundleEntryToMemoryEntry, CORPUS_BUNDLE_FORMAT, } from './staticVectorStore.js';
|
|
3
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/memory/store/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,GAIrB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/memory/store/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,+EAA+E;AAC/E,+EAA+E;AAC/E,qCAAqC;AACrC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,GAIrB,MAAM,wBAAwB,CAAC"}
|
|
@@ -144,6 +144,46 @@ export interface MemoryStore {
|
|
|
144
144
|
* absence can never mean `false`.
|
|
145
145
|
*/
|
|
146
146
|
readonly supportsVectorSearch?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* What does this store's `search()` rank — the vectors, or the text? (9.3.0)
|
|
149
|
+
*
|
|
150
|
+
* {@link supportsVectorSearch} answers "can you serve back the embeddings I
|
|
151
|
+
* wrote?", which is what a corpus BUILDER needs to know. This answers the
|
|
152
|
+
* next question down, which is what a corpus READER needs: **what query form
|
|
153
|
+
* does your search take?** They are different questions, so they are
|
|
154
|
+
* different members rather than one widened one — a boolean that grew a
|
|
155
|
+
* third value would slip past every `!== false` already written against it.
|
|
156
|
+
*
|
|
157
|
+
* - `'vector'` — vectors in, ranked vectors out. `search()` ranks the
|
|
158
|
+
* `embedding` it was handed. Every local backend:
|
|
159
|
+
* `InMemoryStore`, `sqliteVectorStore`,
|
|
160
|
+
* `staticVectorStore`, `pgVectorStore`,
|
|
161
|
+
* `s3VectorsStore`.
|
|
162
|
+
* - `'server-text'` — the backend embeds and ranks on ITS side and its
|
|
163
|
+
* retrieval API takes TEXT. `search()` reads
|
|
164
|
+
* {@link SearchOptions.text}; the vector argument is
|
|
165
|
+
* the one thing it cannot use. A managed knowledge-base
|
|
166
|
+
* service is the shape.
|
|
167
|
+
* - absent — undeclared. Treated exactly as before this existed:
|
|
168
|
+
* nothing refuses, nothing changes. Every adapter
|
|
169
|
+
* written against an earlier release is in this case,
|
|
170
|
+
* which is why absence can never mean either value.
|
|
171
|
+
*
|
|
172
|
+
* **What the declaration buys.** `defineRAG` requires an `Embedder` because
|
|
173
|
+
* somebody has to turn the question into a vector. A `'server-text'` store
|
|
174
|
+
* needs no such thing — it takes the question as words — so a retriever over
|
|
175
|
+
* one accepts NO embedder, and embedding the query anyway would be spend on
|
|
176
|
+
* a vector that is discarded on arrival. Declaring this is what lets the
|
|
177
|
+
* wiring layer know that before the first turn instead of after the bill.
|
|
178
|
+
*
|
|
179
|
+
* **The two members must agree.** `'vector'` says the same thing as
|
|
180
|
+
* `supportsVectorSearch: true`, and `'server-text'` is only ever compatible
|
|
181
|
+
* with `false` or absence. A store that declares both and contradicts itself
|
|
182
|
+
* is REFUSED by name (`resolveRankingMode`) rather than silently resolved —
|
|
183
|
+
* two spellings of one fact that could disagree is the same law `topK` and
|
|
184
|
+
* `retrieval` are refused under.
|
|
185
|
+
*/
|
|
186
|
+
readonly ranksBy?: 'vector' | 'server-text';
|
|
147
187
|
/**
|
|
148
188
|
* Fetch one entry by id within the given identity's namespace.
|
|
149
189
|
* Returns `null` when the entry doesn't exist OR has expired (TTL).
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* memory-providers — memory store adapters.
|
|
3
3
|
*
|
|
4
|
-
* RedisStore, AgentCoreStore,
|
|
5
|
-
* Pinecone, …) all live here — a new store adds an
|
|
6
|
-
* import path.
|
|
4
|
+
* RedisStore, AgentCoreStore, sqliteVectorStore, pgVectorStore, s3VectorsStore
|
|
5
|
+
* and future stores (DynamoDB, Pinecone, …) all live here — a new store adds an
|
|
6
|
+
* export, never a new import path.
|
|
7
7
|
*
|
|
8
8
|
* Pattern: Adapter (GoF) — each store translates the `MemoryStore`
|
|
9
9
|
* interface onto a specific backend (Redis, DynamoDB-style
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
*/
|
|
23
23
|
export { RedisStore, type RedisStoreOptions, type RedisLikeClient, type RedisLikePipeline, } from './adapters/memory/redis.js';
|
|
24
24
|
export { AgentCoreStore, UnreadableMemoryEntryError, type AgentCoreStoreOptions, type AgentCoreLikeClient, type AgentCoreEvent, type AgentCoreMemoryRecord, } from './adapters/memory/agentcore.js';
|
|
25
|
-
export { sqliteVectorStore, UnreadableIndexFileError,
|
|
25
|
+
export { sqliteVectorStore, UnreadableIndexFileError, type SqliteVectorStore, type SqliteVectorStoreOptions, type SqliteVectorDatabaseLike, type SqliteVectorStatementLike, type SqliteVectorModuleLike, } from './adapters/memory/sqliteVector.js';
|
|
26
26
|
export { SqliteUnavailableError } from './lib/sqliteUnavailable.js';
|
|
27
|
+
export { EmbedderMismatchError } from './lib/embedderMismatch.js';
|
|
28
|
+
export { pgVectorStore, PgVectorSchemaError, type PgVectorStore, type PgVectorStoreOptions, type PgVectorColumns, type PgLikeClient, type PgQueryResult, type PgSdkModule, } from './adapters/memory/pgVector.js';
|
|
29
|
+
export { s3VectorsStore, type S3VectorsStore, type S3VectorsStoreOptions, type S3VectorsLikeClient, type S3VectorsSdkModule, } from './adapters/memory/s3Vectors.js';
|
|
27
30
|
export { BedrockAgentMemory, type BedrockAgentMemoryOptions, type BedrockAgentMemoryLikeClient, type BedrockAgentSummary, } from './adapters/memory/bedrockAgentMemory.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* memory-providers — memory store adapters.
|
|
3
3
|
*
|
|
4
|
-
* RedisStore, AgentCoreStore,
|
|
5
|
-
* Pinecone, …) all live here — a new store adds an
|
|
6
|
-
* import path.
|
|
4
|
+
* RedisStore, AgentCoreStore, sqliteVectorStore, pgVectorStore, s3VectorsStore
|
|
5
|
+
* and future stores (DynamoDB, Pinecone, …) all live here — a new store adds an
|
|
6
|
+
* export, never a new import path.
|
|
7
7
|
*
|
|
8
8
|
* Pattern: Adapter (GoF) — each store translates the `MemoryStore`
|
|
9
9
|
* interface onto a specific backend (Redis, DynamoDB-style
|
|
@@ -29,10 +29,24 @@ export { AgentCoreStore, UnreadableMemoryEntryError, } from './adapters/memory/a
|
|
|
29
29
|
// inside Node), exact search, and the corpus embedded once rather than on every
|
|
30
30
|
// restart. Lazy-loads `node:sqlite` at construction, so importing this barrel
|
|
31
31
|
// costs nothing for consumers who never build one.
|
|
32
|
-
export { sqliteVectorStore, UnreadableIndexFileError,
|
|
32
|
+
export { sqliteVectorStore, UnreadableIndexFileError, } from './adapters/memory/sqliteVector.js';
|
|
33
33
|
// The SAME refusal `sqliteSessions` raises for the same missing module — one
|
|
34
34
|
// class, so catching it does not require knowing which store was being built.
|
|
35
35
|
export { SqliteUnavailableError } from './lib/sqliteUnavailable.js';
|
|
36
|
+
// ONE refusal for every store that can tell a vector met an index built by a
|
|
37
|
+
// different embedder (9.3.0). It lived in sqliteVector.ts from 8.9.0; when
|
|
38
|
+
// pgVectorStore and s3VectorsStore learned the same check it moved to lib/, so
|
|
39
|
+
// `catch (e) { if (e instanceof EmbedderMismatchError) }` cannot depend on
|
|
40
|
+
// which store threw. The old import path still works.
|
|
41
|
+
export { EmbedderMismatchError } from './lib/embedderMismatch.js';
|
|
42
|
+
// Postgres + pgvector: the corpus beside the application's own data, inheriting
|
|
43
|
+
// its backups, failover and access control. `pg` is lazy-required at the first
|
|
44
|
+
// call — pass `client` to reuse the pool your app already has.
|
|
45
|
+
export { pgVectorStore, PgVectorSchemaError, } from './adapters/memory/pgVector.js';
|
|
46
|
+
// Amazon S3 Vectors: a durable corpus with nothing to run, that can be added to
|
|
47
|
+
// from a cron job rather than at the next deploy. Lazy-requires
|
|
48
|
+
// `@aws-sdk/client-s3vectors` at the first call.
|
|
49
|
+
export { s3VectorsStore, } from './adapters/memory/s3Vectors.js';
|
|
36
50
|
// Read-only reader for the legacy Bedrock Agents auto session-summary memory.
|
|
37
51
|
// NOT a MemoryStore (Bedrock owns the writes) — see the class docstring.
|
|
38
52
|
export { BedrockAgentMemory, } from './adapters/memory/bedrockAgentMemory.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,OAAO,EACL,UAAU,GAIX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,0BAA0B,GAK3B,MAAM,gCAAgC,CAAC;AAExC,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,mDAAmD;AACnD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,OAAO,EACL,UAAU,GAIX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,0BAA0B,GAK3B,MAAM,gCAAgC,CAAC;AAExC,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,mDAAmD;AACnD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GAMzB,MAAM,mCAAmC,CAAC;AAE3C,6EAA6E;AAC7E,8EAA8E;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,2EAA2E;AAC3E,sDAAsD;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,gFAAgF;AAChF,+EAA+E;AAC/E,+DAA+D;AAC/D,OAAO,EACL,aAAa,EACb,mBAAmB,GAOpB,MAAM,+BAA+B,CAAC;AAEvC,gFAAgF;AAChF,gEAAgE;AAChE,iDAAiD;AACjD,OAAO,EACL,cAAc,GAKf,MAAM,gCAAgC,CAAC;AAExC,8EAA8E;AAC9E,yEAAyE;AACzE,OAAO,EACL,kBAAkB,GAInB,MAAM,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CredentialRecorder — forwards `agentfootprint.credential.*` emits to the
|
|
3
|
+
* dispatcher.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: Factory over EmitBridge.
|
|
6
|
+
* Role: Bridges the declare-and-push credential lifecycle — requested,
|
|
7
|
+
* acquired, authorization_required, failed — so consumers observe it
|
|
8
|
+
* via `agent.on('agentfootprint.credential.failed', …)` and
|
|
9
|
+
* `agent.on('agentfootprint.credential.*', …)`.
|
|
10
|
+
* Emits: agentfootprint.credential.{requested,acquired,authorization_required,failed}
|
|
11
|
+
*
|
|
12
|
+
* ── Why this did not exist until 9.4.0, and what it cost ────────────────────
|
|
13
|
+
* The credential domain has had payload types, registry entries and real
|
|
14
|
+
* `typedEmit` call sites since 6.11.0 — and NO BRIDGE. Every one of those
|
|
15
|
+
* events was raised onto footprintjs's emit channel and stopped there: a raw
|
|
16
|
+
* `agent.attach()` recorder saw them, and `agent.on(...)` never did. So the
|
|
17
|
+
* documented way to watch for credential failures observed nothing, and an AWS
|
|
18
|
+
* identity adapter that failed 100% of its calls for two minor versions did so
|
|
19
|
+
* in a silence that read exactly like health.
|
|
20
|
+
*
|
|
21
|
+
* This is the law CLAUDE.md states for a new event DOMAIN — payload + registry
|
|
22
|
+
* entry + `DomainWildcard` arm + a bridge attach — with the fourth part
|
|
23
|
+
* missing. Zero-cost when nothing fires: `EmitBridge` drops an event with no
|
|
24
|
+
* listener before building any meta.
|
|
25
|
+
*/
|
|
26
|
+
import { EmitBridge, type EmitBridgeOptions } from './EmitBridge.js';
|
|
27
|
+
export type CredentialRecorderOptions = Omit<EmitBridgeOptions, 'id' | 'prefix'> & {
|
|
28
|
+
readonly id?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function credentialRecorder(options: CredentialRecorderOptions): EmitBridge;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CredentialRecorder — forwards `agentfootprint.credential.*` emits to the
|
|
3
|
+
* dispatcher.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: Factory over EmitBridge.
|
|
6
|
+
* Role: Bridges the declare-and-push credential lifecycle — requested,
|
|
7
|
+
* acquired, authorization_required, failed — so consumers observe it
|
|
8
|
+
* via `agent.on('agentfootprint.credential.failed', …)` and
|
|
9
|
+
* `agent.on('agentfootprint.credential.*', …)`.
|
|
10
|
+
* Emits: agentfootprint.credential.{requested,acquired,authorization_required,failed}
|
|
11
|
+
*
|
|
12
|
+
* ── Why this did not exist until 9.4.0, and what it cost ────────────────────
|
|
13
|
+
* The credential domain has had payload types, registry entries and real
|
|
14
|
+
* `typedEmit` call sites since 6.11.0 — and NO BRIDGE. Every one of those
|
|
15
|
+
* events was raised onto footprintjs's emit channel and stopped there: a raw
|
|
16
|
+
* `agent.attach()` recorder saw them, and `agent.on(...)` never did. So the
|
|
17
|
+
* documented way to watch for credential failures observed nothing, and an AWS
|
|
18
|
+
* identity adapter that failed 100% of its calls for two minor versions did so
|
|
19
|
+
* in a silence that read exactly like health.
|
|
20
|
+
*
|
|
21
|
+
* This is the law CLAUDE.md states for a new event DOMAIN — payload + registry
|
|
22
|
+
* entry + `DomainWildcard` arm + a bridge attach — with the fourth part
|
|
23
|
+
* missing. Zero-cost when nothing fires: `EmitBridge` drops an event with no
|
|
24
|
+
* listener before building any meta.
|
|
25
|
+
*/
|
|
26
|
+
import { EmitBridge } from './EmitBridge.js';
|
|
27
|
+
export function credentialRecorder(options) {
|
|
28
|
+
return new EmitBridge({
|
|
29
|
+
id: options.id ?? 'agentfootprint.credential-recorder',
|
|
30
|
+
prefix: 'agentfootprint.credential.',
|
|
31
|
+
dispatcher: options.dispatcher,
|
|
32
|
+
getRunContext: options.getRunContext,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=CredentialRecorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialRecorder.js","sourceRoot":"","sources":["../../../../src/recorders/core/CredentialRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAMrE,MAAM,UAAU,kBAAkB,CAAC,OAAkC;IACnE,OAAO,IAAI,UAAU,CAAC;QACpB,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,oCAAoC;QACtD,MAAM,EAAE,4BAA4B;QACpC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;KACrC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
* Today's surface is small and data-driven on purpose: one role
|
|
11
11
|
* allowlist primitive that satisfies BOTH the v2.4 `PermissionChecker`
|
|
12
12
|
* interface AND a sync `isAllowed(toolId)` predicate for use with
|
|
13
|
-
* `gatedTools` from `agentfootprint/providers
|
|
14
|
-
*
|
|
13
|
+
* `gatedTools` from `agentfootprint/providers`.
|
|
14
|
+
*
|
|
15
|
+
* There is no shipped REMOTE policy engine. `agentCorePolicy()` was one
|
|
16
|
+
* through 9.3.0 and is retired in 9.4.0 — see the note beside its export
|
|
17
|
+
* below. The port stays open: a remote checker is an object with a
|
|
18
|
+
* `check()` method, and anybody can write one.
|
|
15
19
|
*
|
|
16
20
|
* A local allowlist and a remote policy engine differ in one way that
|
|
17
21
|
* matters here: the local one can answer synchronously, so it doubles
|
|
@@ -49,5 +53,5 @@ export type { PolicyHaltContext } from './PolicyHaltError.js';
|
|
|
49
53
|
export { extractSequence, SYNTHETIC_DENY_PREFIX } from './extractSequence.js';
|
|
50
54
|
export type { ExtractSequenceOptions } from './extractSequence.js';
|
|
51
55
|
export { redactThinkingBlocks, REDACTED_PLACEHOLDER } from './thinkingRedaction.js';
|
|
52
|
-
export { agentCorePolicy, type AgentCorePolicyOptions, type AgentCorePolicyClientLike, type AgentCorePolicyEvaluation, type AgentCorePolicyUnavailable, type BedrockAgentCorePolicySdkModule, } from '../adapters/security/agentcore.js';
|
|
56
|
+
export { agentCorePolicy, AgentCorePolicyRetiredError, type AgentCorePolicyOptions, type AgentCorePolicyClientLike, type AgentCorePolicyEvaluation, type AgentCorePolicyUnavailable, type BedrockAgentCorePolicySdkModule, } from '../adapters/security/agentcore.js';
|
|
53
57
|
export type { PermissionChecker, PermissionRequest, PermissionDecision, ToolCallEntry, ToolResultContent, } from '../adapters/types.js';
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
* Today's surface is small and data-driven on purpose: one role
|
|
11
11
|
* allowlist primitive that satisfies BOTH the v2.4 `PermissionChecker`
|
|
12
12
|
* interface AND a sync `isAllowed(toolId)` predicate for use with
|
|
13
|
-
* `gatedTools` from `agentfootprint/providers
|
|
14
|
-
*
|
|
13
|
+
* `gatedTools` from `agentfootprint/providers`.
|
|
14
|
+
*
|
|
15
|
+
* There is no shipped REMOTE policy engine. `agentCorePolicy()` was one
|
|
16
|
+
* through 9.3.0 and is retired in 9.4.0 — see the note beside its export
|
|
17
|
+
* below. The port stays open: a remote checker is an object with a
|
|
18
|
+
* `check()` method, and anybody can write one.
|
|
15
19
|
*
|
|
16
20
|
* A local allowlist and a remote policy engine differ in one way that
|
|
17
21
|
* matters here: the local one can answer synchronously, so it doubles
|
|
@@ -46,9 +50,10 @@ export { PermissionPolicy } from './PermissionPolicy.js';
|
|
|
46
50
|
export { PolicyHaltError } from './PolicyHaltError.js';
|
|
47
51
|
export { extractSequence, SYNTHETIC_DENY_PREFIX } from './extractSequence.js';
|
|
48
52
|
export { redactThinkingBlocks, REDACTED_PLACEHOLDER } from './thinkingRedaction.js';
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
|
|
53
|
+
// RETIRED in 9.4.0. `agentCorePolicy()` dispatched a command that does not
|
|
54
|
+
// exist in `@aws-sdk/client-bedrock-agentcore`, because AgentCore has no
|
|
55
|
+
// data-plane policy-evaluation operation — policy is enforced AT THE GATEWAY.
|
|
56
|
+
// The export stays and refuses at construction with the whole explanation; the
|
|
57
|
+
// alternatives are `PermissionPolicy.fromRoles` above and `.toolMiddleware()`.
|
|
58
|
+
export { agentCorePolicy, AgentCorePolicyRetiredError, } from '../adapters/security/agentcore.js';
|
|
54
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/security/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/security/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG9E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEpF,2EAA2E;AAC3E,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,OAAO,EACL,eAAe,EACf,2BAA2B,GAM5B,MAAM,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/events/dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6CAAwC;AA0BxC;2EAC2E;AAC3E,MAAM,eAAe,GAAgB,GAAG,EAAE,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/events/dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6CAAwC;AA0BxC;2EAC2E;AAC3E,MAAM,eAAe,GAAgB,GAAG,EAAE,CAAC,SAAS,CAAC;AA2DrD;;;GAGG;AACH,SAAS,WAAW,CAAC,MAA2B;IAC9C,KAAK,MAAM,MAAM,IAAI,MAAM;QAAE,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAED,wEAAwE;AAExE;;;;;GAKG;AACH,MAAa,eAAe;IACT,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAC;IAChD,eAAe,GAAG,IAAI,GAAG,EAA+B,CAAC;IACzD,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE1D,qEAAqE;IAErE;;;OAGG;IACH,eAAe,CAAC,IAA6B;QAC3C,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,I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AAY,CAAC;QAC1C,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;YAC7D,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,kCAAkC,IAAI,yBAAyB;gBAC7D,0EAA0E;gBAC1E,sEAAsE;gBACtE,+DAA+D,CAClE,CAAC;YACF,8DAA8D;YAC7D,MAA2B,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;gBAClD,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,0CAA0C,IAAI,aAAa,EAAE,GAAG,CAAC,CAAC;YAClF,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IAEF,YAAY,CAAC,GAAG,CAAC,OAA4B,EAAE,QAAQ,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -202,7 +202,20 @@ async function standingAgent(options) {
|
|
|
202
202
|
// The signal reaches tool execution, tool discovery and skill-entry
|
|
203
203
|
// scoring. It does NOT currently reach the LLM call, so a caller who
|
|
204
204
|
// hangs up mid-generation stops the tools, not the token stream.
|
|
205
|
-
|
|
205
|
+
//
|
|
206
|
+
// `sessionId` (9.4.0) rides the same bag onto every event this run
|
|
207
|
+
// emits, so a shipped telemetry stream can be asked "what happened in
|
|
208
|
+
// this conversation?" and not only "what happened in this run?". This is
|
|
209
|
+
// the only place that knows the answer — the agent is handed a message,
|
|
210
|
+
// not a session. An ANONYMOUS request has no session and gets no key:
|
|
211
|
+
// `sessionKey` above is a concurrency latch this host invented, and
|
|
212
|
+
// stamping it on telemetry would be publishing a fact nobody can join to.
|
|
213
|
+
const runOptions = request.signal !== undefined || sessionId !== undefined
|
|
214
|
+
? {
|
|
215
|
+
...(request.signal !== undefined && { env: { signal: request.signal } }),
|
|
216
|
+
...(sessionId !== undefined && { sessionId }),
|
|
217
|
+
}
|
|
218
|
+
: undefined;
|
|
206
219
|
// ── The one discriminant ─────────────────────────────────────────
|
|
207
220
|
// A request carrying `decision` answers a pending question; a request
|
|
208
221
|
// without one is a new message. Never inferred from the text: reading
|