agentfootprint 7.22.0 → 7.23.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/ai-instructions/claude-code/SKILL.md +2 -1
- package/dist/adapters/hosting/agentcore.js +68 -8
- package/dist/adapters/hosting/agentcore.js.map +1 -1
- package/dist/adapters/memory/agentcore.js +116 -11
- package/dist/adapters/memory/agentcore.js.map +1 -1
- package/dist/core/agent/middleware/runChain.js +4 -0
- package/dist/core/agent/middleware/runChain.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +9 -1
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/tools.js.map +1 -1
- package/dist/esm/adapters/hosting/agentcore.d.ts +34 -4
- package/dist/esm/adapters/hosting/agentcore.js +68 -8
- package/dist/esm/adapters/hosting/agentcore.js.map +1 -1
- package/dist/esm/adapters/memory/agentcore.d.ts +59 -1
- package/dist/esm/adapters/memory/agentcore.js +114 -10
- package/dist/esm/adapters/memory/agentcore.js.map +1 -1
- package/dist/esm/core/agent/middleware/runChain.d.ts +2 -0
- package/dist/esm/core/agent/middleware/runChain.js +4 -0
- package/dist/esm/core/agent/middleware/runChain.js.map +1 -1
- package/dist/esm/core/agent/middleware/types.d.ts +12 -0
- package/dist/esm/core/agent/stages/toolCalls.js +9 -1
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/tools.d.ts +18 -0
- package/dist/esm/core/tools.js.map +1 -1
- package/dist/esm/hosting/envelope.d.ts +31 -2
- package/dist/esm/hosting/envelope.js +42 -7
- package/dist/esm/hosting/envelope.js.map +1 -1
- package/dist/esm/hosting/errors.d.ts +44 -1
- package/dist/esm/hosting/errors.js +81 -1
- package/dist/esm/hosting/errors.js.map +1 -1
- package/dist/esm/hosting/index.d.ts +5 -1
- package/dist/esm/hosting/index.js +5 -1
- package/dist/esm/hosting/index.js.map +1 -1
- package/dist/esm/hosting/standingAgent.d.ts +9 -0
- package/dist/esm/hosting/standingAgent.js +30 -9
- package/dist/esm/hosting/standingAgent.js.map +1 -1
- package/dist/esm/lib/mcp/index.d.ts +1 -1
- package/dist/esm/lib/mcp/mcpClient.js +104 -11
- package/dist/esm/lib/mcp/mcpClient.js.map +1 -1
- package/dist/esm/lib/mcp/mcpServe.js +6 -0
- package/dist/esm/lib/mcp/mcpServe.js.map +1 -1
- package/dist/esm/lib/mcp/mockMcpClient.js +4 -0
- package/dist/esm/lib/mcp/mockMcpClient.js.map +1 -1
- package/dist/esm/lib/mcp/types.d.ts +71 -7
- package/dist/esm/lib/storedPreview.d.ts +58 -0
- package/dist/esm/lib/storedPreview.js +97 -0
- package/dist/esm/lib/storedPreview.js.map +1 -0
- package/dist/esm/memory-providers.d.ts +1 -1
- package/dist/esm/memory-providers.js +1 -1
- package/dist/esm/memory-providers.js.map +1 -1
- package/dist/esm/tool-providers/index.d.ts +1 -1
- package/dist/hosting/envelope.js +42 -7
- package/dist/hosting/envelope.js.map +1 -1
- package/dist/hosting/errors.js +83 -2
- package/dist/hosting/errors.js.map +1 -1
- package/dist/hosting/index.js +6 -1
- package/dist/hosting/index.js.map +1 -1
- package/dist/hosting/standingAgent.js +29 -8
- package/dist/hosting/standingAgent.js.map +1 -1
- package/dist/lib/mcp/mcpClient.js +104 -11
- package/dist/lib/mcp/mcpClient.js.map +1 -1
- package/dist/lib/mcp/mcpServe.js +6 -0
- package/dist/lib/mcp/mcpServe.js.map +1 -1
- package/dist/lib/mcp/mockMcpClient.js +4 -0
- package/dist/lib/mcp/mockMcpClient.js.map +1 -1
- package/dist/lib/storedPreview.js +102 -0
- package/dist/lib/storedPreview.js.map +1 -0
- package/dist/memory-providers.js +2 -1
- package/dist/memory-providers.js.map +1 -1
- package/dist/types/adapters/hosting/agentcore.d.ts +34 -4
- package/dist/types/adapters/hosting/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/memory/agentcore.d.ts +59 -1
- package/dist/types/adapters/memory/agentcore.d.ts.map +1 -1
- package/dist/types/core/agent/middleware/runChain.d.ts +2 -0
- package/dist/types/core/agent/middleware/runChain.d.ts.map +1 -1
- package/dist/types/core/agent/middleware/types.d.ts +12 -0
- package/dist/types/core/agent/middleware/types.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/tools.d.ts +18 -0
- package/dist/types/core/tools.d.ts.map +1 -1
- package/dist/types/hosting/envelope.d.ts +31 -2
- package/dist/types/hosting/envelope.d.ts.map +1 -1
- package/dist/types/hosting/errors.d.ts +44 -1
- package/dist/types/hosting/errors.d.ts.map +1 -1
- package/dist/types/hosting/index.d.ts +5 -1
- package/dist/types/hosting/index.d.ts.map +1 -1
- package/dist/types/hosting/standingAgent.d.ts +9 -0
- package/dist/types/hosting/standingAgent.d.ts.map +1 -1
- package/dist/types/lib/mcp/index.d.ts +1 -1
- package/dist/types/lib/mcp/index.d.ts.map +1 -1
- package/dist/types/lib/mcp/mcpClient.d.ts.map +1 -1
- package/dist/types/lib/mcp/mcpServe.d.ts.map +1 -1
- package/dist/types/lib/mcp/types.d.ts +71 -7
- package/dist/types/lib/mcp/types.d.ts.map +1 -1
- package/dist/types/lib/storedPreview.d.ts +59 -0
- package/dist/types/lib/storedPreview.d.ts.map +1 -0
- package/dist/types/memory-providers.d.ts +1 -1
- package/dist/types/memory-providers.d.ts.map +1 -1
- package/dist/types/tool-providers/index.d.ts +1 -1
- package/dist/types/tool-providers/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* lib/storedPreview — how much of somebody's stored data an error may quote.
|
|
4
|
+
*
|
|
5
|
+
* A refusal about unreadable bytes has to show enough of them to be diagnosable
|
|
6
|
+
* ("ah, that is our envelope stringified by something that was not JSON") and no
|
|
7
|
+
* more, because the rest of those bytes are a conversation, a memory, or
|
|
8
|
+
* whatever else a user said. Error messages travel: they land in logs, in
|
|
9
|
+
* dashboards, in bug reports pasted into chat windows. So the quote is capped,
|
|
10
|
+
* and the cap lives HERE rather than being re-decided by each adapter that needs
|
|
11
|
+
* one — two copies of a redaction rule is one copy that will drift.
|
|
12
|
+
*
|
|
13
|
+
* Structured values are SUMMARISED rather than serialized: an array reports its
|
|
14
|
+
* length and an object its keys, because `String(anObject)` and
|
|
15
|
+
* `JSON.stringify(anArray)` are both ways of accidentally printing the payload
|
|
16
|
+
* this file exists to keep out of the message.
|
|
17
|
+
*
|
|
18
|
+
* Two functions, because a cap is only safe when the first bytes are structure.
|
|
19
|
+
* {@link previewStored} quotes a capped prefix — right for a value whose opening
|
|
20
|
+
* fields are metadata. {@link describeStoredShape} quotes nothing at all — right
|
|
21
|
+
* for a value whose content starts immediately. Choosing between them is the
|
|
22
|
+
* caller's job because only the caller knows what its bytes begin with.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.describeStoredShape = exports.previewStored = exports.STORED_PREVIEW_LIMIT = void 0;
|
|
26
|
+
/**
|
|
27
|
+
* How much of a stored value a refusal may quote. Enough to recognise a mangled
|
|
28
|
+
* encoding at a glance; not enough to leak what was being said.
|
|
29
|
+
*/
|
|
30
|
+
exports.STORED_PREVIEW_LIMIT = 64;
|
|
31
|
+
/**
|
|
32
|
+
* Describe what a store handed back WITHOUT quoting the whole thing.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* previewStored('{format=conversation-v1, data={version=1, …}}')
|
|
36
|
+
* // → '"{format=conversation-v1, data={version=1, …" (96 chars)'
|
|
37
|
+
* previewStored({ id: 'm-1', value: 'her address is …' })
|
|
38
|
+
* // → 'an object with keys: id, value'
|
|
39
|
+
*/
|
|
40
|
+
function previewStored(value) {
|
|
41
|
+
if (typeof value === 'string') {
|
|
42
|
+
return value.length <= exports.STORED_PREVIEW_LIMIT
|
|
43
|
+
? `"${value}"`
|
|
44
|
+
: `"${value.slice(0, exports.STORED_PREVIEW_LIMIT)}…" (${value.length} chars)`;
|
|
45
|
+
}
|
|
46
|
+
return describeStoredShape(value);
|
|
47
|
+
}
|
|
48
|
+
exports.previewStored = previewStored;
|
|
49
|
+
/**
|
|
50
|
+
* Describe a stored value **without quoting any of it** — its type, its size and
|
|
51
|
+
* its shape, and nothing that came from a person.
|
|
52
|
+
*
|
|
53
|
+
* Use this instead of {@link previewStored} wherever the stored bytes carry
|
|
54
|
+
* user content from their first characters, so that even a capped prefix would
|
|
55
|
+
* leak. A `CheckpointEnvelope` opens with `format`, `data`, `savedAt` and can
|
|
56
|
+
* afford to be quoted; a `MemoryEntry` opens with `id` and then `value`, so its
|
|
57
|
+
* second field IS the thing somebody asked an agent to remember. The cap is a
|
|
58
|
+
* policy about how MUCH may be shown; this is the answer when the honest amount
|
|
59
|
+
* is none.
|
|
60
|
+
*
|
|
61
|
+
* It stays diagnosable, which is the whole job of the quote it replaces: a
|
|
62
|
+
* length, whether it is JSON at all, and its opening character are enough to
|
|
63
|
+
* recognise "an object stringified by something that was not JSON".
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* describeStoredShape('{id=a, value={text=her address is …}}')
|
|
67
|
+
* // → "a 37-character string that is not JSON, starting '{'"
|
|
68
|
+
*/
|
|
69
|
+
function describeStoredShape(value) {
|
|
70
|
+
if (typeof value === 'string') {
|
|
71
|
+
let parsedShape = 'is not JSON';
|
|
72
|
+
try {
|
|
73
|
+
const parsed = JSON.parse(value);
|
|
74
|
+
parsedShape =
|
|
75
|
+
parsed !== null && typeof parsed === 'object'
|
|
76
|
+
? 'parses as JSON'
|
|
77
|
+
: `parses as JSON but is a bare ${parsed === null ? 'null' : typeof parsed}`;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* not JSON — the interesting case, and already the default */
|
|
81
|
+
}
|
|
82
|
+
// The opening character only: '{' or '[' is what says "something
|
|
83
|
+
// stringified an object", and one structural character is not content.
|
|
84
|
+
const opener = value.length > 0 ? `, starting ${JSON.stringify(value[0])}` : '';
|
|
85
|
+
return `a ${value.length}-character string that ${parsedShape}${opener}`;
|
|
86
|
+
}
|
|
87
|
+
if (Array.isArray(value))
|
|
88
|
+
return `an array of ${value.length} item(s)`;
|
|
89
|
+
if (value === null)
|
|
90
|
+
return 'null';
|
|
91
|
+
if (value === undefined)
|
|
92
|
+
return 'undefined';
|
|
93
|
+
if (typeof value === 'object') {
|
|
94
|
+
const keys = Object.keys(value);
|
|
95
|
+
return keys.length > 0
|
|
96
|
+
? `an object with keys: ${keys.slice(0, 8).join(', ')}`
|
|
97
|
+
: 'an object with no keys';
|
|
98
|
+
}
|
|
99
|
+
return `${typeof value} ${String(value)}`;
|
|
100
|
+
}
|
|
101
|
+
exports.describeStoredShape = describeStoredShape;
|
|
102
|
+
//# sourceMappingURL=storedPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storedPreview.js","sourceRoot":"","sources":["../../src/lib/storedPreview.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH;;;GAGG;AACU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,IAAI,4BAAoB;YACzC,CAAC,CAAC,IAAI,KAAK,GAAG;YACd,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,4BAAoB,CAAC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;IAC3E,CAAC;IACD,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AAPD,sCAOC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,mBAAmB,CAAC,KAAc;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,WAAW,GAAG,aAAa,CAAC;QAChC,IAAI,CA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A2BC"}
|
package/dist/memory-providers.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* import { RedisStore, AgentCoreStore } from 'agentfootprint/memory-providers';
|
|
35
35
|
*/
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.BedrockAgentMemory = exports.AgentCoreStore = exports.RedisStore = void 0;
|
|
37
|
+
exports.BedrockAgentMemory = exports.UnreadableMemoryEntryError = exports.AgentCoreStore = exports.RedisStore = void 0;
|
|
38
38
|
// Lazy-required peer-dep stores. Both adapters defer their vendor SDK
|
|
39
39
|
// `require()` to constructor time; importing this barrel doesn't load
|
|
40
40
|
// `ioredis` or `@aws-sdk/client-bedrock-agent-runtime`.
|
|
@@ -42,6 +42,7 @@ var redis_js_1 = require("./adapters/memory/redis.js");
|
|
|
42
42
|
Object.defineProperty(exports, "RedisStore", { enumerable: true, get: function () { return redis_js_1.RedisStore; } });
|
|
43
43
|
var agentcore_js_1 = require("./adapters/memory/agentcore.js");
|
|
44
44
|
Object.defineProperty(exports, "AgentCoreStore", { enumerable: true, get: function () { return agentcore_js_1.AgentCoreStore; } });
|
|
45
|
+
Object.defineProperty(exports, "UnreadableMemoryEntryError", { enumerable: true, get: function () { return agentcore_js_1.UnreadableMemoryEntryError; } });
|
|
45
46
|
// Read-only reader for the legacy Bedrock Agents auto session-summary memory.
|
|
46
47
|
// NOT a MemoryStore (Bedrock owns the writes) — see the class docstring.
|
|
47
48
|
var bedrockAgentMemory_js_1 = require("./adapters/memory/bedrockAgentMemory.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../src/memory-providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,uDAKoC;AAJlC,sGAAA,UAAU,OAAA;AAMZ,+
|
|
1
|
+
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../src/memory-providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,uDAKoC;AAJlC,sGAAA,UAAU,OAAA;AAMZ,+DAOwC;AANtC,8GAAA,cAAc,OAAA;AACd,0HAAA,0BAA0B,OAAA;AAO5B,8EAA8E;AAC9E,yEAAyE;AACzE,iFAKiD;AAJ/C,2HAAA,kBAAkB,OAAA"}
|
|
@@ -38,7 +38,16 @@
|
|
|
38
38
|
* injection-tested**: its AgentCore Memory calls are exercised through the
|
|
39
39
|
* `_client` seam, never against AWS. Confirm the command and field names
|
|
40
40
|
* against your installed `@aws-sdk/client-bedrock-agentcore` before you rely
|
|
41
|
-
* on it
|
|
41
|
+
* on it.
|
|
42
|
+
*
|
|
43
|
+
* Both modes have now been exercised against the real service by a production
|
|
44
|
+
* integration, and the `'memory'` mode came back with a defect no injected fake
|
|
45
|
+
* could have shown: given an OBJECT as an event's blob, the service stores its
|
|
46
|
+
* own host language's `toString()` of it and returns a string that is not JSON
|
|
47
|
+
* and cannot be decoded. This shim writes JSON text for exactly that reason.
|
|
48
|
+
* Envelopes written by any build before 7.22.1 are unrecoverable — the mangling
|
|
49
|
+
* is lossy, so there is nothing to migrate, and the honest response is a loud
|
|
50
|
+
* refusal rather than a silent fresh start.
|
|
42
51
|
*
|
|
43
52
|
* Pattern: Adapter (GoF). Role: outer ring. The file-backed session store uses
|
|
44
53
|
* `node:fs` and nothing else; the event-backed one lazy-loads the AWS SDK, so
|
|
@@ -151,7 +160,18 @@ export interface AgentCoreFileSessionsOptions {
|
|
|
151
160
|
export interface AgentCoreSessionEvent {
|
|
152
161
|
/** Server-assigned event id. */
|
|
153
162
|
readonly eventId: string;
|
|
154
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* The envelope decoded from the event's blob payload.
|
|
165
|
+
*
|
|
166
|
+
* `null` means the event carried **no blob at all** — nothing here ever
|
|
167
|
+
* claimed to be a session, which is an absence and hydrates as "no
|
|
168
|
+
* conversation".
|
|
169
|
+
*
|
|
170
|
+
* A blob that IS present but could not be decoded travels here **as-is**, so
|
|
171
|
+
* the shared reading law refuses it by name rather than this adapter quietly
|
|
172
|
+
* calling a conversation that exists an absent one. Those are different facts
|
|
173
|
+
* and only one of them is safe to answer with a fresh start.
|
|
174
|
+
*/
|
|
155
175
|
readonly envelope: unknown;
|
|
156
176
|
}
|
|
157
177
|
/**
|
|
@@ -160,7 +180,14 @@ export interface AgentCoreSessionEvent {
|
|
|
160
180
|
* `_client` and never touch AWS.
|
|
161
181
|
*/
|
|
162
182
|
export interface AgentCoreSessionClientLike {
|
|
163
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Append one envelope as an event (the server assigns the event id).
|
|
185
|
+
*
|
|
186
|
+
* The envelope arrives as an OBJECT; how it reaches the wire is the
|
|
187
|
+
* implementation's business. The shipped shim writes it as JSON text, because
|
|
188
|
+
* this service returns an object blob back as its own host language's
|
|
189
|
+
* `toString()` of it — see `createSessionClient`.
|
|
190
|
+
*/
|
|
164
191
|
createEvent(input: {
|
|
165
192
|
memoryId: string;
|
|
166
193
|
actorId: string;
|
|
@@ -205,7 +232,10 @@ export type AgentCoreSessionsOptions = AgentCoreFileSessionsOptions | AgentCoreM
|
|
|
205
232
|
* Both modes store the SAME `CheckpointEnvelope` the port defines — a
|
|
206
233
|
* conversation or a paused run — and both refuse an unknown `format` by name
|
|
207
234
|
* through the shared `checkEnvelope`: a session written by a newer runtime is
|
|
208
|
-
* refused, never half-restored. That law is inherited, not re-implemented
|
|
235
|
+
* refused, never half-restored. That law is inherited, not re-implemented, and
|
|
236
|
+
* so is its other half: a stored session that is present but **unreadable** is
|
|
237
|
+
* refused by name too (`UnreadableEnvelopeError`), never answered with a fresh
|
|
238
|
+
* start. Only a session that was never written hydrates as `undefined`.
|
|
209
239
|
*
|
|
210
240
|
* @example Survive a stop/resume, no AWS SDK required
|
|
211
241
|
* agentCoreSessions({ store: 'session-storage' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/hosting/agentcore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/hosting/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAoB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAkBnF,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,WAAW,EAAE,MAAM,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,OAAO,GAAG,QAAQ,CA4CnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,2BAAgC,GAAG,QAAQ,CAmBxF;AAID;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAEjE,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,wCAAwC;AACxC,MAAM,WAAW,4BAA4B;IAC3C,QAA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QAAQ,CAAC,IAAI,CAAC,EAAE,gCAAgC,CAAC;CAClD;AAED,6CAA6C;AAC7C,MAAM,MAAM,wBAAwB,GAChC,4BAA4B,GAC5B,8BAA8B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,gBAAgB,CAErF;AAsID,0EAA0E;AAC1E,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,sBAAsB,CAAC,EAAE,KAAK,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK;QACrE,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC;IACF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAC9D"}
|
|
@@ -47,9 +47,67 @@ import type { MemoryIdentity } from '../../memory/identity/index.js';
|
|
|
47
47
|
export interface AgentCoreEvent {
|
|
48
48
|
/** AgentCore server-assigned event id (needed to delete it). */
|
|
49
49
|
readonly eventId: string;
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* The MemoryEntry decoded from the event's blob payload.
|
|
52
|
+
*
|
|
53
|
+
* `null` means the event carried **no blob at all** — nothing in it ever
|
|
54
|
+
* claimed to be one of this store's entries (AgentCore writes events of its
|
|
55
|
+
* own into the same log), so it is skipped as an absence.
|
|
56
|
+
*
|
|
57
|
+
* A blob that IS present and cannot be decoded never arrives here: it raises
|
|
58
|
+
* {@link UnreadableMemoryEntryError} at the decode step instead. An unreadable
|
|
59
|
+
* stored memory and an absent one are different facts, and only one of them is
|
|
60
|
+
* safe to answer with silence.
|
|
61
|
+
*/
|
|
51
62
|
readonly entry: MemoryEntry | null;
|
|
52
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Thrown when an event carries a blob that is **present but unreadable** where a
|
|
66
|
+
* `MemoryEntry` should be.
|
|
67
|
+
*
|
|
68
|
+
* The same law the session store inherits from `hosting/envelope`, applied to
|
|
69
|
+
* this port's own shape: an unreadable stored memory and an absent one are
|
|
70
|
+
* different facts, and only one of them is safe to answer with silence. A
|
|
71
|
+
* memory that exists and cannot be decoded, quietly skipped, is an agent that
|
|
72
|
+
* answers as if it were never told — indistinguishable from working, until
|
|
73
|
+
* somebody notices the assistant has forgotten a customer's address.
|
|
74
|
+
*
|
|
75
|
+
* ── Why the law lives HERE and not in a shared reader ────────────────────────
|
|
76
|
+
* `MemoryStore` has no envelope and no shared reading path — nothing on this
|
|
77
|
+
* port corresponds to `hosting`'s `readFormat`, the single choke point every
|
|
78
|
+
* session adapter reads through — so the refusal belongs at the one place raw
|
|
79
|
+
* bytes become an entry: this adapter's decode step. If a `MemoryStore` reading
|
|
80
|
+
* path ever grows such a choke point, the law moves there and this becomes a
|
|
81
|
+
* caller of it.
|
|
82
|
+
*
|
|
83
|
+
* ── Why this one QUOTES NOTHING, where the session refusal quotes a prefix ───
|
|
84
|
+
* Same discipline — "never the stored content" — and the same shared helper, but
|
|
85
|
+
* a different answer, because the two shapes differ in where content begins. A
|
|
86
|
+
* `CheckpointEnvelope` opens `{ format, data, savedAt }`, so a capped prefix is
|
|
87
|
+
* metadata. A `MemoryEntry` opens `{ id, value, … }`, so its SECOND field is the
|
|
88
|
+
* thing somebody asked the agent to remember, and even a short prefix would
|
|
89
|
+
* print it. `storedShape` therefore reports type, length, JSON-ness and the
|
|
90
|
+
* opening character and nothing else — still enough to recognise "an object
|
|
91
|
+
* stringified by something that was not JSON", which is the only diagnosis this
|
|
92
|
+
* message needs to support.
|
|
93
|
+
*/
|
|
94
|
+
export declare class UnreadableMemoryEntryError extends TypeError {
|
|
95
|
+
readonly code: "ERR_UNREADABLE_MEMORY_ENTRY";
|
|
96
|
+
/** AgentCore's id for the event those bytes came from. */
|
|
97
|
+
readonly eventId: string;
|
|
98
|
+
/** The AgentCore session (this store's conversation) it was stored under. */
|
|
99
|
+
readonly sessionId: string;
|
|
100
|
+
/**
|
|
101
|
+
* What came back, described by SHAPE — type, length, JSON-ness, opening
|
|
102
|
+
* character. Never a quote: on this port the stored bytes are the memory.
|
|
103
|
+
*/
|
|
104
|
+
readonly storedShape: string;
|
|
105
|
+
constructor(input: {
|
|
106
|
+
eventId: string;
|
|
107
|
+
sessionId: string;
|
|
108
|
+
stored: unknown;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
53
111
|
/**
|
|
54
112
|
* Minimal, entry-semantic surface the store uses. The real implementation
|
|
55
113
|
* (`createAgentCoreClient`) maps these onto `CreateEvent` / `ListEvents` /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,aAAa,EACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,aAAa,EACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MA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AAkB,GAC1B,OAAO,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAiE/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,OAAO,CAAC,UAAU;CAGnB;AAaD,yEAAyE;AACzE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,KAAK,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK;QACrE,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC;IACF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC7D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC9D,QAAQ,CAAC,4BAA4B,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACzE"}
|
|
@@ -63,6 +63,8 @@ export type ToolChainResult = {
|
|
|
63
63
|
};
|
|
64
64
|
export interface ToolChainInput {
|
|
65
65
|
readonly toolName: string;
|
|
66
|
+
/** `Tool.source` for the tool being dispatched, when it has one. */
|
|
67
|
+
readonly toolSource?: string;
|
|
66
68
|
readonly toolCallId: string;
|
|
67
69
|
readonly iteration: number;
|
|
68
70
|
readonly args: ToolArgs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runChain.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/middleware/runChain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAm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AAC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,EAAE,CAAA;CAAE,GAC9F;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,kBAAkB,EAAE,CAAC;CAC1C,CAAC;AAEN,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,+EAA+E;AAC/E,wBAAsB,eAAe,CACnC,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CAiD7B"}
|
|
@@ -88,6 +88,18 @@ export type MessageOutcome = AllowOutcome<string> | DenyOutcome;
|
|
|
88
88
|
/** The call a tool middleware is deciding about. */
|
|
89
89
|
export interface ToolMiddlewareContext {
|
|
90
90
|
readonly toolName: string;
|
|
91
|
+
/**
|
|
92
|
+
* Where the tool being called came from — `Tool.source`, which `mcpClient`
|
|
93
|
+
* fills with the server's name.
|
|
94
|
+
*
|
|
95
|
+
* **Absent means the agent's own tool.** A name alone is not an identity: two
|
|
96
|
+
* MCP servers may both serve a `call_aws`, and a policy matching the bare
|
|
97
|
+
* name governs whichever one answers — including the one it was never written
|
|
98
|
+
* about. With this, `call.toolSource === 'aws-prod'` is a rule that means what
|
|
99
|
+
* it says, and `call.toolSource === undefined` is the honest way to spell
|
|
100
|
+
* "something we wrote ourselves".
|
|
101
|
+
*/
|
|
102
|
+
readonly toolSource?: string;
|
|
91
103
|
/** Matches `stream.tool_start.toolCallId` for this dispatch. */
|
|
92
104
|
readonly toolCallId: string;
|
|
93
105
|
/** ReAct iteration this call belongs to. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/middleware/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAIxE;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;CAC9B;AAED,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACnB,YAAY,CAAC,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AAC;IACzC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;CACzD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,oBAAoB,GACzB,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAk2BzC"}
|
|
@@ -38,6 +38,24 @@ export interface Tool<TArgs = Record<string, unknown>, TResult = unknown> {
|
|
|
38
38
|
* exposes a predicate typed to the tool's args at the CALL site.
|
|
39
39
|
*/
|
|
40
40
|
readonly checkIn?: CheckInDemand;
|
|
41
|
+
/**
|
|
42
|
+
* Where this tool came from — the name of the MCP server that served it.
|
|
43
|
+
*
|
|
44
|
+
* **Absent means "this agent's own".** A tool you wrote with `defineTool`
|
|
45
|
+
* carries nothing here, and that absence is the fact: nobody else supplied
|
|
46
|
+
* it. A tool that arrived over MCP carries the client's `name`
|
|
47
|
+
* (`mcpClient({ name: 'aws-mcp' })`), because the same tool NAME can come
|
|
48
|
+
* from two servers and a policy that cannot tell them apart governs both.
|
|
49
|
+
*
|
|
50
|
+
* It travels to the decision point as `ToolMiddlewareContext.toolSource` —
|
|
51
|
+
* the tool-dispatch chain and `mcpServe`'s serving-side chain read the same
|
|
52
|
+
* field.
|
|
53
|
+
*
|
|
54
|
+
* Set by `mcpClient` / `mockMcpClient`. `defineTool` never sets it, so it
|
|
55
|
+
* cannot be spoofed by accident; a hand-built `Tool` may set it deliberately
|
|
56
|
+
* when it is genuinely relaying another source's tool.
|
|
57
|
+
*/
|
|
58
|
+
readonly source?: string;
|
|
41
59
|
execute(args: TArgs, ctx: ToolExecutionContext): Promise<TResult> | TResult;
|
|
42
60
|
}
|
|
43
61
|
/** Runtime context passed to tool.execute(). */
|
|
@@ -1 +1 @@
|
|
|
1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,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD;uEACmE;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC;8DAC0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAC7E;AA+BD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAkBzE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAQzD;AAED,wBAAgB,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,EAC3E,OAAO,EAAE,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,GACzC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CActB"}
|
|
@@ -19,6 +19,24 @@
|
|
|
19
19
|
* while a person is still waiting on a question nobody mentioned. That is a
|
|
20
20
|
* half-restore wearing a happy path, which is the exact failure the format field
|
|
21
21
|
* exists to prevent.
|
|
22
|
+
*
|
|
23
|
+
* ── The same rule one step earlier: unreadable ≠ absent ──────────────────────
|
|
24
|
+
* A format nobody knows is one way a store can hand back something unusable.
|
|
25
|
+
* The other is bytes that are not an envelope at all — a store that kept its own
|
|
26
|
+
* encoding and gave back its host language's `toString()` of the object rather
|
|
27
|
+
* than the object, say. **An unreadable stored conversation and an absent one
|
|
28
|
+
* are different facts, and only one of them is safe to answer with a fresh
|
|
29
|
+
* start.** Absent is ordinary. Unreadable means a conversation EXISTS and this
|
|
30
|
+
* runtime cannot see it, and answering that with a fresh start is invisible from
|
|
31
|
+
* the outside — it looks exactly like a new user — until a deployment boundary
|
|
32
|
+
* hands somebody a blank slate where their conversation was.
|
|
33
|
+
*
|
|
34
|
+
* So {@link readFormat} — the ONE place a stored value is inspected, and
|
|
35
|
+
* therefore the place every reader and every store adapter inherits from —
|
|
36
|
+
* raises {@link UnreadableEnvelopeError} by name, with the session and a short
|
|
37
|
+
* prefix of what it found. Decoding is an adapter's business (only the adapter
|
|
38
|
+
* knows its transport's encoding); "these bytes are nobody's readable session"
|
|
39
|
+
* is everybody's, so it is refused here, once.
|
|
22
40
|
*/
|
|
23
41
|
import { type AgentRunCheckpoint } from '../core/runCheckpoint.js';
|
|
24
42
|
import type { CheckpointEnvelope, ConversationEnvelope, PausedRun, PausedRunEnvelope } from './types.js';
|
|
@@ -58,6 +76,10 @@ export declare function toPausedEnvelope(paused: PausedRun): PausedRunEnvelope;
|
|
|
58
76
|
* else wrote, in a format this runtime may not know, and typing the parameter
|
|
59
77
|
* as the happy shape would be assuming the very thing that needs checking.
|
|
60
78
|
*
|
|
79
|
+
* @throws UnreadableEnvelopeError when what came back is present but is not an
|
|
80
|
+
* envelope at all — bytes a store kept in its own encoding, say. Never
|
|
81
|
+
* `undefined`: a conversation that exists and cannot be read is not the same
|
|
82
|
+
* fact as one that was never there.
|
|
61
83
|
* @throws TypeError naming the format when it is one this runtime cannot read;
|
|
62
84
|
* naming the missing field when the conversation inside is malformed; and
|
|
63
85
|
* pointing at {@link readPausedRun} when the envelope holds a paused run,
|
|
@@ -82,14 +104,21 @@ export declare function readPausedRun(envelope: unknown): PausedRun;
|
|
|
82
104
|
* produced them rather than whoever read them next; it has no business caring
|
|
83
105
|
* whether the session inside is mid-conversation or mid-question.
|
|
84
106
|
*
|
|
107
|
+
* Pass `sessionId` and the refusal names the conversation, which is what turns
|
|
108
|
+
* a log line into an incident somebody can act on. Pass it whenever you have it
|
|
109
|
+
* — a store always does.
|
|
110
|
+
*
|
|
111
|
+
* @throws UnreadableEnvelopeError when the stored value is present but is not an
|
|
112
|
+
* envelope at all. That is the case a store must NOT answer with `undefined`:
|
|
113
|
+
* see the module header.
|
|
85
114
|
* @throws TypeError naming the format when this runtime cannot read it, or the
|
|
86
115
|
* missing field when the payload is malformed.
|
|
87
116
|
*
|
|
88
117
|
* @example
|
|
89
118
|
* async hydrate(sessionId) {
|
|
90
119
|
* const stored = await myStore.get(sessionId);
|
|
91
|
-
* return stored === undefined ? undefined : checkEnvelope(stored);
|
|
120
|
+
* return stored === undefined ? undefined : checkEnvelope(stored, sessionId);
|
|
92
121
|
* }
|
|
93
122
|
*/
|
|
94
|
-
export declare function checkEnvelope(envelope: unknown): CheckpointEnvelope;
|
|
123
|
+
export declare function checkEnvelope(envelope: unknown, sessionId?: string): CheckpointEnvelope;
|
|
95
124
|
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/hosting/envelope.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/hosting/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAKpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,kBAAkB,GAAG,oBAAoB,CAE/E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,CAErE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,CAUlE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAQ1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAOvF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* same words.
|
|
4
4
|
*
|
|
5
5
|
* A refusal that varies by adapter is a refusal nobody can write a test or a
|
|
6
|
-
* runbook against. These
|
|
6
|
+
* runbook against. These six carry a stable `code`, name WHO refused, and say
|
|
7
7
|
* what the caller should do instead. Adapters map the codes onto whatever their
|
|
8
8
|
* transport uses to say "no" — that mapping is the adapter's business and lives
|
|
9
9
|
* in the adapter, never here.
|
|
@@ -110,6 +110,49 @@ export declare class NoPendingAskError extends Error {
|
|
|
110
110
|
readonly sessionId: string;
|
|
111
111
|
constructor(sessionId: string);
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Thrown when a store hands back something that is **present but unreadable**
|
|
115
|
+
* where a `CheckpointEnvelope` should be.
|
|
116
|
+
*
|
|
117
|
+
* The law, in the words of the field report that bought it:
|
|
118
|
+
*
|
|
119
|
+
* > *An unreadable stored conversation and an absent one are different facts,
|
|
120
|
+
* > and only one of them is safe to answer with a fresh start.*
|
|
121
|
+
*
|
|
122
|
+
* Absent is ordinary — a new session has no conversation, and answering it
|
|
123
|
+
* fresh is exactly right. Unreadable is not ordinary: a conversation EXISTS,
|
|
124
|
+
* somebody is in the middle of it, and starting fresh over the top of it looks
|
|
125
|
+
* identical to the happy path from the outside. Nobody finds that until a
|
|
126
|
+
* deployment boundary hands a user a stranger's blank slate. So this refuses,
|
|
127
|
+
* loudly, naming the session — the one thing a silent `undefined` could never
|
|
128
|
+
* do.
|
|
129
|
+
*
|
|
130
|
+
* It extends `TypeError` because that is what it always was: the refusal gained
|
|
131
|
+
* a name, a `code` and the session it is about, but a caller who was already
|
|
132
|
+
* catching a `TypeError` from a reader keeps working.
|
|
133
|
+
*
|
|
134
|
+
* `storedPreview` quotes at most 64 characters (`STORED_PREVIEW_LIMIT`, in
|
|
135
|
+
* `lib/storedPreview` — one cap, shared by every adapter that has to describe
|
|
136
|
+
* bytes it could not read) — enough to recognise a mangled encoding at a
|
|
137
|
+
* glance, never the conversation itself.
|
|
138
|
+
*/
|
|
139
|
+
export declare class UnreadableEnvelopeError extends TypeError {
|
|
140
|
+
readonly code: "ERR_UNREADABLE_ENVELOPE";
|
|
141
|
+
/** The session those bytes were stored under, when the refuser knows it. */
|
|
142
|
+
readonly sessionId?: string;
|
|
143
|
+
/** A short, deliberately truncated rendering of what the store handed back. */
|
|
144
|
+
readonly storedPreview: string;
|
|
145
|
+
constructor(stored: unknown, sessionId?: string);
|
|
146
|
+
/**
|
|
147
|
+
* The same refusal, naming the session — for a reader that knew the bytes
|
|
148
|
+
* were unreadable but not whose conversation they were.
|
|
149
|
+
*
|
|
150
|
+
* Returns a copy rather than mutating: an error already thrown past somebody
|
|
151
|
+
* is a fact about a moment, and editing it under them is how two stack traces
|
|
152
|
+
* end up disagreeing about what happened.
|
|
153
|
+
*/
|
|
154
|
+
withSession(sessionId: string): UnreadableEnvelopeError;
|
|
155
|
+
}
|
|
113
156
|
/**
|
|
114
157
|
* Assert that a host can do something, and throw a corrective error naming the
|
|
115
158
|
* adapter when it cannot.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/hosting/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/hosting/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,I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;;;;;;;;;GAyBG;AACH,qBAAa,uBAAwB,SAAQ,SAAS;IACpD,QAAQ,CAAC,IAAI,4BAAsC;IACnD,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM;IAsB/C;;;;;;;OAOG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,uBAAuB;CAMxD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,GAAG,IAAI,CASnF"}
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
* • `toPausedEnvelope` / `readPausedRun` — the same for a run that stopped to
|
|
42
42
|
* ask a person something (`'flowchart-v1'`). `checkEnvelope` validates
|
|
43
43
|
* either without committing to which half you wanted — what a STORE wants.
|
|
44
|
+
* • `UnreadableEnvelopeError` — the refusal every reader and every store
|
|
45
|
+
* adapter inherits when a stored session is PRESENT but cannot be read. An
|
|
46
|
+
* unreadable stored conversation and an absent one are different facts, and
|
|
47
|
+
* only one of them is safe to answer with a fresh start.
|
|
44
48
|
* • `requireCapability` — feature-detection with teeth.
|
|
45
49
|
*
|
|
46
50
|
* @example An agent that stays up and remembers
|
|
@@ -61,6 +65,6 @@ export type { HttpHost, HttpHostHandle, HttpHostOptions, HttpRequestFacts, HttpW
|
|
|
61
65
|
export { memorySessions } from './memorySessions.js';
|
|
62
66
|
export { toEnvelope, toPausedEnvelope, readEnvelope, readPausedRun, checkEnvelope, } from './envelope.js';
|
|
63
67
|
export { standingAgent } from './standingAgent.js';
|
|
64
|
-
export { requireCapability, HostClosedError, ConcurrentRunError, PauseNotCarriedError, AwaitingDecisionError, NoPendingAskError, } from './errors.js';
|
|
68
|
+
export { requireCapability, HostClosedError, ConcurrentRunError, PauseNotCarriedError, AwaitingDecisionError, NoPendingAskError, UnreadableEnvelopeError, } from './errors.js';
|
|
65
69
|
export type { AgentHost, CheckpointEnvelope, ConcurrentInvokePolicy, ConversationEnvelope, DurabilityMode, HostCapability, HostHandle, HostHandler, HostReply, HostRequest, PausedRun, PausedRunEnvelope, PendingAsk, SessionLifecycle, StandingAgentOptions, WakeReason, } from './types.js';
|
|
66
70
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hosting/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hosting/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,QAAQ,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,UAAU,EACV,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,GACX,MAAM,YAAY,CAAC"}
|
|
@@ -21,6 +21,15 @@
|
|
|
21
21
|
* tells every dashboard downstream something untrue. A later request for that
|
|
22
22
|
* session carrying `decision` continues the run from exactly where it stopped.
|
|
23
23
|
*
|
|
24
|
+
* ── "Start a fresh one" is an answer it must EARN ───────────────────────────
|
|
25
|
+
* A session with nothing stored is answered fresh, and that is right. A session
|
|
26
|
+
* whose stored conversation cannot be READ is not: an unreadable stored
|
|
27
|
+
* conversation and an absent one are different facts, and only one of them is
|
|
28
|
+
* safe to answer with a fresh start. So an `UnreadableEnvelopeError` out of the
|
|
29
|
+
* store fails THIS REQUEST, naming the session, and the fresh-start path is
|
|
30
|
+
* never reached. The alternative is a reply that looks perfect to everyone
|
|
31
|
+
* involved while a user's conversation quietly stops existing.
|
|
32
|
+
*
|
|
24
33
|
* ── Resuming a CONVERSATION is a REPLAY, and that has a cost ─────────────────
|
|
25
34
|
* A stored conversation is restored through `agent.resumeOnError(...)`, and this
|
|
26
35
|
* is its caveat, stated here in the words the Agent states it in, because a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standingAgent.d.ts","sourceRoot":"","sources":["../../../src/hosting/standingAgent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"standingAgent.d.ts","sourceRoot":"","sources":["../../../src/hosting/standingAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAaH,OAAO,KAAK,EACV,UAAU,EAKV,oBAAoB,EAErB,MAAM,YAAY,CAAC;AAGpB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,EAAE,SAAS,UAAU,EACvD,OAAO,EAAE,oBAAoB,CAAC,EAAE,CAAC,GAChC,OAAO,CAAC,EAAE,CAAC,CAkOb"}
|
|
@@ -8,5 +8,5 @@ export { mcpClient } from './mcpClient.js';
|
|
|
8
8
|
export { mcpServe } from './mcpServe.js';
|
|
9
9
|
export { mockMcpClient, type MockMcpClientOptions, type MockMcpTool } from './mockMcpClient.js';
|
|
10
10
|
export { gatewayTransport, GatewayAuthorizationRequiredError, type GatewayTransportOptions, } from './gatewayTransport.js';
|
|
11
|
-
export type { McpClient, McpClientOptions, McpGatewayTransport, McpHttpTransport, McpStdioTransport, McpTransport, McpSdkClient, McpServeOptions, McpServeHandle, McpServeTransport, McpHttpServeTransport, McpStdioServeTransport, McpSdkServer, } from './types.js';
|
|
11
|
+
export type { McpCallToolResult, McpClient, McpClientOptions, McpGatewayTransport, McpHttpTransport, McpStdioTransport, McpTransport, McpSdkClient, McpServeOptions, McpServeHandle, McpServeTransport, McpHttpServeTransport, McpStdioServeTransport, McpSdkServer, } from './types.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,iCAAiC,EACjC,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,iCAAiC,EACjC,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,GACb,MAAM,YAAY,CAAC"}
|