agentfootprint 9.3.0 → 9.5.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/AGENTS.md +2 -1
- 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/s3Vectors.js +158 -6
- package/dist/adapters/memory/s3Vectors.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/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/s3Vectors.d.ts +36 -4
- package/dist/esm/adapters/memory/s3Vectors.js +158 -6
- package/dist/esm/adapters/memory/s3Vectors.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/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/memory/define.d.ts +2 -1
- package/dist/esm/memory/define.js +45 -8
- package/dist/esm/memory/define.js.map +1 -1
- package/dist/esm/memory/define.types.d.ts +30 -4
- package/dist/esm/memory/define.types.js +6 -0
- package/dist/esm/memory/define.types.js.map +1 -1
- package/dist/esm/memory/index.d.ts +1 -0
- package/dist/esm/memory/index.js +3 -0
- package/dist/esm/memory/index.js.map +1 -1
- package/dist/esm/memory/pipeline/default.d.ts +16 -0
- package/dist/esm/memory/pipeline/default.js +8 -1
- package/dist/esm/memory/pipeline/default.js.map +1 -1
- package/dist/esm/memory/stages/filterByDecay.d.ts +67 -0
- package/dist/esm/memory/stages/filterByDecay.js +44 -0
- package/dist/esm/memory/stages/filterByDecay.js.map +1 -0
- package/dist/esm/memory/stages/index.d.ts +2 -0
- package/dist/esm/memory/stages/index.js +1 -0
- package/dist/esm/memory/stages/index.js.map +1 -1
- package/dist/esm/memory/strategies.d.ts +107 -0
- package/dist/esm/memory/strategies.js +232 -0
- package/dist/esm/memory/strategies.js.map +1 -0
- 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/memory/define.js +45 -8
- package/dist/memory/define.js.map +1 -1
- package/dist/memory/define.types.js +6 -0
- package/dist/memory/define.types.js.map +1 -1
- package/dist/memory/index.js +6 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/pipeline/default.js +8 -1
- package/dist/memory/pipeline/default.js.map +1 -1
- package/dist/memory/stages/filterByDecay.js +48 -0
- package/dist/memory/stages/filterByDecay.js.map +1 -0
- package/dist/memory/stages/index.js +4 -1
- package/dist/memory/stages/index.js.map +1 -1
- package/dist/memory/strategies.js +238 -0
- package/dist/memory/strategies.js.map +1 -0
- 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/s3Vectors.d.ts +36 -4
- package/dist/types/adapters/memory/s3Vectors.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/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/memory/define.d.ts +2 -1
- package/dist/types/memory/define.d.ts.map +1 -1
- package/dist/types/memory/define.types.d.ts +30 -4
- package/dist/types/memory/define.types.d.ts.map +1 -1
- package/dist/types/memory/index.d.ts +1 -0
- package/dist/types/memory/index.d.ts.map +1 -1
- package/dist/types/memory/pipeline/default.d.ts +16 -0
- package/dist/types/memory/pipeline/default.d.ts.map +1 -1
- package/dist/types/memory/stages/filterByDecay.d.ts +68 -0
- package/dist/types/memory/stages/filterByDecay.d.ts.map +1 -0
- package/dist/types/memory/stages/index.d.ts +2 -0
- package/dist/types/memory/stages/index.d.ts.map +1 -1
- package/dist/types/memory/strategies.d.ts +108 -0
- package/dist/types/memory/strategies.d.ts.map +1 -0
- 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 +1 -1
package/dist/security/index.js
CHANGED
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
* Today's surface is small and data-driven on purpose: one role
|
|
12
12
|
* allowlist primitive that satisfies BOTH the v2.4 `PermissionChecker`
|
|
13
13
|
* interface AND a sync `isAllowed(toolId)` predicate for use with
|
|
14
|
-
* `gatedTools` from `agentfootprint/providers
|
|
15
|
-
*
|
|
14
|
+
* `gatedTools` from `agentfootprint/providers`.
|
|
15
|
+
*
|
|
16
|
+
* There is no shipped REMOTE policy engine. `agentCorePolicy()` was one
|
|
17
|
+
* through 9.3.0 and is retired in 9.4.0 — see the note beside its export
|
|
18
|
+
* below. The port stays open: a remote checker is an object with a
|
|
19
|
+
* `check()` method, and anybody can write one.
|
|
16
20
|
*
|
|
17
21
|
* A local allowlist and a remote policy engine differ in one way that
|
|
18
22
|
* matters here: the local one can answer synchronously, so it doubles
|
|
@@ -44,7 +48,7 @@
|
|
|
44
48
|
* const agent = Agent.create({ provider, model, permissionChecker: policy }).build();
|
|
45
49
|
*/
|
|
46
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.agentCorePolicy = exports.REDACTED_PLACEHOLDER = exports.redactThinkingBlocks = exports.SYNTHETIC_DENY_PREFIX = exports.extractSequence = exports.PolicyHaltError = exports.PermissionPolicy = void 0;
|
|
51
|
+
exports.AgentCorePolicyRetiredError = exports.agentCorePolicy = exports.REDACTED_PLACEHOLDER = exports.redactThinkingBlocks = exports.SYNTHETIC_DENY_PREFIX = exports.extractSequence = exports.PolicyHaltError = exports.PermissionPolicy = void 0;
|
|
48
52
|
var PermissionPolicy_js_1 = require("./PermissionPolicy.js");
|
|
49
53
|
Object.defineProperty(exports, "PermissionPolicy", { enumerable: true, get: function () { return PermissionPolicy_js_1.PermissionPolicy; } });
|
|
50
54
|
var PolicyHaltError_js_1 = require("./PolicyHaltError.js");
|
|
@@ -55,10 +59,12 @@ Object.defineProperty(exports, "SYNTHETIC_DENY_PREFIX", { enumerable: true, get:
|
|
|
55
59
|
var thinkingRedaction_js_1 = require("./thinkingRedaction.js");
|
|
56
60
|
Object.defineProperty(exports, "redactThinkingBlocks", { enumerable: true, get: function () { return thinkingRedaction_js_1.redactThinkingBlocks; } });
|
|
57
61
|
Object.defineProperty(exports, "REDACTED_PLACEHOLDER", { enumerable: true, get: function () { return thinkingRedaction_js_1.REDACTED_PLACEHOLDER; } });
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
+
// RETIRED in 9.4.0. `agentCorePolicy()` dispatched a command that does not
|
|
63
|
+
// exist in `@aws-sdk/client-bedrock-agentcore`, because AgentCore has no
|
|
64
|
+
// data-plane policy-evaluation operation — policy is enforced AT THE GATEWAY.
|
|
65
|
+
// The export stays and refuses at construction with the whole explanation; the
|
|
66
|
+
// alternatives are `PermissionPolicy.fromRoles` above and `.toolMiddleware()`.
|
|
62
67
|
var agentcore_js_1 = require("../adapters/security/agentcore.js");
|
|
63
68
|
Object.defineProperty(exports, "agentCorePolicy", { enumerable: true, get: function () { return agentcore_js_1.agentCorePolicy; } });
|
|
69
|
+
Object.defineProperty(exports, "AgentCorePolicyRetiredError", { enumerable: true, get: function () { return agentcore_js_1.AgentCorePolicyRetiredError; } });
|
|
64
70
|
//# 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,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AAGzB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AAGxB,2DAA8E;AAArE,qHAAA,eAAe,OAAA;AAAE,2HAAA,qBAAqB,OAAA;AAG/C,+DAAoF;AAA3E,4HAAA,oBAAoB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AAEnD,2EAA2E;AAC3E,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,kEAQ2C;AAPzC,+GAAA,eAAe,OAAA;AACf,2HAAA,2BAA2B,OAAA"}
|
|
@@ -33,25 +33,41 @@
|
|
|
33
33
|
* tenant isolation derives from the workload identity itself (per-tenant
|
|
34
34
|
* workloads), or encode it via `userIdFor` (e.g. `${tenant}:${principal}`).
|
|
35
35
|
*
|
|
36
|
+
* ── How this talks to the SDK (9.4.0 — read this before editing) ────────────
|
|
37
|
+
* Through **`client.send(new SomeCommand(input))`**, never through a method on
|
|
38
|
+
* the client. A bare `@aws-sdk/client-*` **Client** is command-based: its
|
|
39
|
+
* prototype carries `send` and `destroy` and NOTHING ELSE. The per-operation
|
|
40
|
+
* shortcuts (`getResourceOauth2Token(...)`) live on the AGGREGATED client
|
|
41
|
+
* (`BedrockAgentCore`), which is a different class.
|
|
42
|
+
*
|
|
43
|
+
* Until 9.4.0 this adapter built a `BedrockAgentCoreClient` and then duck-typed
|
|
44
|
+
* `client.getResourceOauth2Token` — a method that is never there — so the
|
|
45
|
+
* documented path failed 100% of the time on the very first call, with a
|
|
46
|
+
* message blaming the SDK version. Every test injected `_client` and so never
|
|
47
|
+
* touched the shim. The sibling memory adapter in this same package had the
|
|
48
|
+
* command form right all along; this one now matches it, and
|
|
49
|
+
* `test/adapters/aws/aws-command-pin.test.ts` pins the command names for both.
|
|
50
|
+
*
|
|
36
51
|
* Pattern: Adapter (GoF) + lazy peer-dep load — the AWS SDK is required only when
|
|
37
|
-
* `getCredential` first runs (or never, if you inject `_client`).
|
|
38
|
-
* the SDK command/field names against your installed
|
|
39
|
-
* `@aws-sdk/client-bedrock-agentcore` version — this adapter targets the
|
|
40
|
-
* `GetResourceOauth2Token` shape and is structured so the request→result mapping
|
|
41
|
-
* is unit-tested via the `_client` seam independent of the SDK.
|
|
52
|
+
* `getCredential` first runs (or never, if you inject `_client` / `_sdk`).
|
|
42
53
|
*/
|
|
43
54
|
import type { CredentialProvider } from '../../identity/types.js';
|
|
44
55
|
/** Raw result shape we consume from the AgentCore identity client. */
|
|
45
56
|
export interface AgentCoreOauthResponse {
|
|
46
57
|
readonly accessToken?: string;
|
|
47
58
|
readonly authorizationUrl?: string;
|
|
59
|
+
/** Correlates a 3LO consent round-trip. The real service reports this as
|
|
60
|
+
* `sessionUri`; the SDK shim renames it here. */
|
|
48
61
|
readonly sessionId?: string;
|
|
49
|
-
/** Unix seconds.
|
|
62
|
+
/** Unix seconds. **AgentCore does not report one** —
|
|
63
|
+
* `GetResourceOauth2TokenResponse` has no expiry field, so this is only ever
|
|
64
|
+
* populated by an injected `_client` that knows one from elsewhere. */
|
|
50
65
|
readonly expiresAt?: number;
|
|
51
66
|
}
|
|
52
|
-
/** The minimal
|
|
67
|
+
/** The minimal, operation-semantic surface the adapter calls — `GetResourceOauth2Token`
|
|
53
68
|
* and (for per-user workload scoping) `GetWorkloadAccessTokenForUserId`.
|
|
54
|
-
*
|
|
69
|
+
* `createIdentityClient` maps the real SDK's `send(new Command(...))` onto this;
|
|
70
|
+
* tests and custom integrations inject a fake via `_client`. */
|
|
55
71
|
export interface AgentCoreIdentityClientLike {
|
|
56
72
|
getResourceOauth2Token(input: {
|
|
57
73
|
readonly resourceCredentialProviderName: string;
|
|
@@ -93,8 +109,22 @@ export interface AgentCoreIdentityOptions {
|
|
|
93
109
|
}) => string | undefined;
|
|
94
110
|
/** Stable provider id (default 'agentcore-identity'). */
|
|
95
111
|
readonly id?: string;
|
|
96
|
-
/** Test seam — inject a client implementing {@link AgentCoreIdentityClientLike}.
|
|
112
|
+
/** Test seam — inject a client implementing {@link AgentCoreIdentityClientLike}.
|
|
113
|
+
* Bypasses the SDK entirely; the field mapping below is then yours. */
|
|
97
114
|
readonly _client?: AgentCoreIdentityClientLike;
|
|
115
|
+
/** @internal Test injection — the AWS SDK module, to exercise the real shim
|
|
116
|
+
* (`send(new Command(...))`) with a fake SDK. */
|
|
117
|
+
readonly _sdk?: BedrockAgentCoreIdentitySdkModule;
|
|
118
|
+
}
|
|
119
|
+
/** The slice of `@aws-sdk/client-bedrock-agentcore` this shim touches. */
|
|
120
|
+
export interface BedrockAgentCoreIdentitySdkModule {
|
|
121
|
+
readonly BedrockAgentCoreClient?: new (config: {
|
|
122
|
+
region?: string;
|
|
123
|
+
}) => {
|
|
124
|
+
send(cmd: unknown): Promise<unknown>;
|
|
125
|
+
};
|
|
126
|
+
readonly GetResourceOauth2TokenCommand?: new (input: unknown) => unknown;
|
|
127
|
+
readonly GetWorkloadAccessTokenForUserIdCommand?: new (input: unknown) => unknown;
|
|
98
128
|
}
|
|
99
129
|
/** Build a {@link CredentialProvider} backed by AWS Bedrock AgentCore Identity. */
|
|
100
130
|
export declare function agentCoreIdentity(options?: AgentCoreIdentityOptions): CredentialProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/identity/agentcore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/identity/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAGnB,MAAM,yBAAyB,CAAC;AAGjC,sEAAsE;AACtE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;sDACkD;IAClD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;4EAEwE;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;iEAGiE;AACjE,MAAM,WAAW,2BAA2B;IAC1C,sBAAsB,CAAC,KAAK,EAAE;QAC5B,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;QACh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CAAC,EAAE,MAAM,CAAA;KAAE,KAAK;QACrE,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC;IACF,QAAQ,CAAC,6BAA6B,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACzE,QAAQ,CAAC,sCAAsC,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACnF;AA6GD,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,kBAAkB,CAyE5F"}
|
|
@@ -144,6 +144,30 @@ export interface BedrockProviderOptions {
|
|
|
144
144
|
readonly Converse: new (input: BedrockConverseCommand) => unknown;
|
|
145
145
|
readonly ConverseStream: new (input: BedrockConverseCommand) => unknown;
|
|
146
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* @internal Test injection (9.4.0) — the AWS SDK MODULE, keyed by the
|
|
149
|
+
* constructor names the package really exports.
|
|
150
|
+
*
|
|
151
|
+
* `_commands` above is keyed `Converse` / `ConverseStream`, which is
|
|
152
|
+
* convenient and hides the one fact worth pinning: which exported command
|
|
153
|
+
* this adapter reaches for. Two adapters in this package have shipped
|
|
154
|
+
* dispatching operations that do not exist, so the shared pin
|
|
155
|
+
* (test/adapters/aws/) drives every AWS adapter through an `_sdk` double and
|
|
156
|
+
* asserts the names. Takes precedence over `_commands` when both are given.
|
|
157
|
+
*/
|
|
158
|
+
readonly _sdk?: BedrockConverseSdkModule;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The slice of `@aws-sdk/client-bedrock-runtime` this provider touches, named
|
|
162
|
+
* as the package names it. (The embedder door declares its own slice for
|
|
163
|
+
* `InvokeModel` — same package, different operation.)
|
|
164
|
+
*/
|
|
165
|
+
export interface BedrockConverseSdkModule {
|
|
166
|
+
readonly BedrockRuntimeClient?: new (config: {
|
|
167
|
+
region?: string;
|
|
168
|
+
}) => BedrockClient;
|
|
169
|
+
readonly ConverseCommand?: new (input: BedrockConverseCommand) => unknown;
|
|
170
|
+
readonly ConverseStreamCommand?: new (input: BedrockConverseCommand) => unknown;
|
|
147
171
|
}
|
|
148
172
|
export declare function bedrock(options?: BedrockProviderOptions): LLMProvider;
|
|
149
173
|
export declare class BedrockProvider implements LLMProvider {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/BedrockProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEX,QAAQ,EACT,MAAM,aAAa,CAAC;AAKrB,UAAU,aAAa;IACrB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED,UAAU,sBAAsB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE;QACX,KAAK,EAAE,WAAW,EAAE,CAAC;QACrB;;mEAE2D;QAC3D,UAAU,CAAC,EAAE;YAAE,IAAI,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,CAAC;KACzC,CAAC;IACF,eAAe,CAAC,EAAE;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC;AAED,KAAK,mBAAmB,GACpB;I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E,KAAK,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,aAAa,CAAC;IACnF,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;IAC1E,QAAQ,CAAC,qBAAqB,CAAC,EAAE,KAAK,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;CACjF;AAaD,wBAAgB,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG,WAAW,CAkIzE;AAED,qBAAa,eAAgB,YAAW,WAAW;IACjD,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,iBAAiB,sBAAuB;IACjD,QAAQ,CAAC,uBAAuB,QAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,OAAO,GAAE,sBAA2B;IAKhD,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAIrE,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC;CAIvE"}
|
|
@@ -68,6 +68,29 @@
|
|
|
68
68
|
* Only `ns` (the identity namespace) and `tier` are ever filtered on, and both
|
|
69
69
|
* are short strings.
|
|
70
70
|
*
|
|
71
|
+
* ── The preflight: this store now READS the index before trusting it (9.4.0) ─
|
|
72
|
+
* One `GetIndex`, lazily on first use and memoized for the life of the store.
|
|
73
|
+
* It checks the three things this adapter used to assume — and that a
|
|
74
|
+
* production deployment got wrong in all three ways at once:
|
|
75
|
+
*
|
|
76
|
+
* 1. the distance metric really is cosine (a euclidean index scored a
|
|
77
|
+
* self-query at 0.999…, where a true cosine is exactly 1.0);
|
|
78
|
+
* 2. `af` really is non-filterable, checked BEFORE the first write, so a
|
|
79
|
+
* misconfigured index fails at document 1 rather than at document 400
|
|
80
|
+
* with an AWS "Filterable metadata must have at most 2048 bytes";
|
|
81
|
+
* 3. the index dimension matches the vectors being written or searched.
|
|
82
|
+
*
|
|
83
|
+
* This is the discipline every sibling store already had at open —
|
|
84
|
+
* `sqliteVectorStore`'s schema identity, `pgVectorStore`'s schema check,
|
|
85
|
+
* `staticVectorStore`'s load-time fingerprint. This store had nothing to open,
|
|
86
|
+
* so it opened nothing.
|
|
87
|
+
*
|
|
88
|
+
* **IAM:** the caller now needs `s3vectors:GetIndex` alongside `PutVectors` /
|
|
89
|
+
* `QueryVectors` / `GetVectors` / `ListVectors` / `DeleteVectors`. A GetIndex
|
|
90
|
+
* that fails is refused by name, never passed through — an index this store
|
|
91
|
+
* cannot read is an index whose metric, layout and dimension it would be
|
|
92
|
+
* guessing at.
|
|
93
|
+
*
|
|
71
94
|
* ── Cosine only, said out loud ──────────────────────────────────────────────
|
|
72
95
|
* The port's score is a cosine similarity, and every threshold in this library
|
|
73
96
|
* — starting with `defineRAG`'s 0.7 default — is calibrated on that range. A
|
|
@@ -93,10 +116,16 @@
|
|
|
93
116
|
* one is what survives a restart: the first query after an embedder swap
|
|
94
117
|
* sees documents stamped by the old embedder and refuses by name, instead
|
|
95
118
|
* of returning a confident ranking of two incompatible spaces.
|
|
96
|
-
* -
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
119
|
+
* - Since 9.4.0 the index's OWN dimension is checked too, at the preflight —
|
|
120
|
+
* so a wrong-size embedder is caught on the first write and the first
|
|
121
|
+
* search of a fresh process, which the per-process fingerprint could not do
|
|
122
|
+
* (it has nothing to disagree with at boot).
|
|
123
|
+
* - What is still NOT caught: the first write of a fresh process into a
|
|
124
|
+
* namespace built by a different embedder OF THE SAME SIZE. Only the model
|
|
125
|
+
* id separates those, and it lives in the vectors rather than on the index.
|
|
126
|
+
* There is no cheap read that would catch it, and a full index scan on
|
|
127
|
+
* every boot is not one either. It is caught at the next search, before a
|
|
128
|
+
* single wrong answer is returned.
|
|
100
129
|
*
|
|
101
130
|
* ── Lazy peer dependency ────────────────────────────────────────────────────
|
|
102
131
|
* `@aws-sdk/client-s3vectors` is an OPTIONAL peer dependency, required at
|
|
@@ -126,6 +155,9 @@ export interface S3VectorsSdkModule {
|
|
|
126
155
|
readonly S3VectorsClient?: new (config: {
|
|
127
156
|
region?: string;
|
|
128
157
|
}) => S3VectorsLikeClient;
|
|
158
|
+
/** The PREFLIGHT (9.4.0) — the one call that reads the index rather than its
|
|
159
|
+
* vectors. See `verifyIndex` for what it checks and why each one is fatal. */
|
|
160
|
+
readonly GetIndexCommand?: new (input: unknown) => unknown;
|
|
129
161
|
readonly PutVectorsCommand?: new (input: unknown) => unknown;
|
|
130
162
|
readonly QueryVectorsCommand?: new (input: unknown) => unknown;
|
|
131
163
|
readonly GetVectorsCommand?: new (input: unknown) => unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3Vectors.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/s3Vectors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"s3Vectors.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/s3Vectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsIG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAGV,WAAW,EAIZ,MAAM,6BAA6B,CAAC;AAIrC;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClF,4FAA4F;IAC5F,OAAO,CAAC,IAAI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;CACpC;AAED,yFAAyF;AACzF,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;IAC5D;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAiBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAsoB7E"}
|
|
@@ -90,6 +90,10 @@ export interface CloudwatchObservabilityOptions {
|
|
|
90
90
|
/** Test injection — bypasses SDK lazy-require entirely. When set,
|
|
91
91
|
* `region` / IAM are ignored. */
|
|
92
92
|
readonly _client?: CloudWatchLikeClient;
|
|
93
|
+
/** @internal Test injection (9.4.0) — the AWS SDK module, so the real shim
|
|
94
|
+
* (`send(new Command(...))`) runs against a fake SDK and the command names
|
|
95
|
+
* it dispatches can be asserted. Ignored when `_client` is set. */
|
|
96
|
+
readonly _sdk?: CloudWatchSdkModule;
|
|
93
97
|
}
|
|
94
98
|
export interface CloudWatchLikeClient {
|
|
95
99
|
putLogEvents(input: {
|
|
@@ -112,6 +116,22 @@ export interface CloudWatchLikeClient {
|
|
|
112
116
|
logStreamName: string;
|
|
113
117
|
}): Promise<unknown>;
|
|
114
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* The slice of `@aws-sdk/client-cloudwatch-logs` this shim touches.
|
|
121
|
+
*
|
|
122
|
+
* Exported since 9.4.0 so `opts._sdk` can name it — which is what lets the
|
|
123
|
+
* shared command-name pin (test/adapters/aws/) assert the OPERATIONS this
|
|
124
|
+
* adapter dispatches without an AWS account or the peer dep installed. A
|
|
125
|
+
* `_client` double proves the batching; only an `_sdk` double can prove the
|
|
126
|
+
* adapter reaches for `PutLogEvents` and not something that does not exist.
|
|
127
|
+
*/
|
|
128
|
+
export interface CloudWatchSdkModule {
|
|
129
|
+
readonly CloudWatchLogsClient?: new (config: {
|
|
130
|
+
region?: string;
|
|
131
|
+
}) => unknown;
|
|
132
|
+
readonly PutLogEventsCommand?: new (input: unknown) => unknown;
|
|
133
|
+
readonly CreateLogStreamCommand?: new (input: unknown) => unknown;
|
|
134
|
+
}
|
|
115
135
|
/**
|
|
116
136
|
* Internal: shared CloudWatch Logs base used by every adapter that
|
|
117
137
|
* ships to CWL. `cloudwatchObservability` is the public generic
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudwatch.d.ts","sourceRoot":"","sources":["../../../../src/adapters/observability/cloudwatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAMvE,MAAM,WAAW,8BAA8B;IAC7C,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;0DAOsD;IACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;;4BAKwB;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;oDAEgD;IAChD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;mEAC+D;IAC/D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvE;sCACkC;IAClC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SAAE,CAAC,CAAC;KAClE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5F;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,KAAK,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IAC7E,QAAQ,CAAC,mBAAmB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC/D,QAAQ,CAAC,sBAAsB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACnE;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,8BAA8B,EACpC,YAAY,EAAE,MAAM,GACnB,qBAAqB,CAsOvB;AA4BD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,8BAA8B,GACnC,qBAAqB,CAEvB"}
|
|
@@ -94,11 +94,29 @@ export interface XrayObservabilityOptions {
|
|
|
94
94
|
readonly onError?: (error: Error, event?: AgentfootprintEvent) => void;
|
|
95
95
|
/** Test injection — bypasses SDK lazy-require entirely. */
|
|
96
96
|
readonly _client?: XRayLikeClient;
|
|
97
|
+
/** @internal Test injection (9.4.0) — the AWS SDK module, so the real shim
|
|
98
|
+
* (`send(new Command(...))`) runs against a fake SDK and the command name it
|
|
99
|
+
* dispatches can be asserted. Ignored when `_client` is set. */
|
|
100
|
+
readonly _sdk?: XRaySdkModule;
|
|
97
101
|
}
|
|
98
102
|
export interface XRayLikeClient {
|
|
99
103
|
putTraceSegments(input: {
|
|
100
104
|
TraceSegmentDocuments: ReadonlyArray<string>;
|
|
101
105
|
}): Promise<unknown>;
|
|
102
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The slice of `@aws-sdk/client-xray` this shim touches.
|
|
109
|
+
*
|
|
110
|
+
* Exported since 9.4.0 so `opts._sdk` can name it — which is what lets the
|
|
111
|
+
* shared command-name pin (test/adapters/aws/) assert that this adapter
|
|
112
|
+
* dispatches `PutTraceSegments` and nothing invented, without an AWS account
|
|
113
|
+
* or the peer dep installed.
|
|
114
|
+
*/
|
|
115
|
+
export interface XRaySdkModule {
|
|
116
|
+
readonly XRayClient?: new (config: {
|
|
117
|
+
region?: string;
|
|
118
|
+
}) => unknown;
|
|
119
|
+
readonly PutTraceSegmentsCommand?: new (input: unknown) => unknown;
|
|
120
|
+
}
|
|
103
121
|
export declare function xrayObservability(opts: XrayObservabilityOptions): ObservabilityStrategy;
|
|
104
122
|
//# sourceMappingURL=xray.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xray.d.ts","sourceRoot":"","sources":["../../../../src/adapters/observability/xray.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAMvE,MAAM,WAAW,wBAAwB;IACvC,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;iCAC6B;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;oDAEgD;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;0CAEsC;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;yCACqC;IACrC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;;;;;;;;OAYG;IAC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C;CAC7F;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IACnE,QAAQ,CAAC,uBAAuB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACpE;AAwBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,wBAAwB,GAAG,qBAAqB,CA4ZvF"}
|
|
@@ -1,152 +1,106 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* agentCorePolicy —
|
|
3
|
-
*
|
|
2
|
+
* agentCorePolicy — **RETIRED in 9.4.0.** The factory still exists and still
|
|
3
|
+
* type-checks; calling it now refuses, by name, with the reason and the
|
|
4
|
+
* alternatives. Nothing was removed from the public surface.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
+
* ── What was wrong ──────────────────────────────────────────────────────────
|
|
7
|
+
* This adapter dispatched `EvaluatePolicyCommand` against
|
|
8
|
+
* `@aws-sdk/client-bedrock-agentcore`. **That command does not exist** — not in
|
|
9
|
+
* 3.1066.0, not in any version, not under any other name. The AgentCore
|
|
10
|
+
* data-plane client has no authorization-evaluation operation at all
|
|
11
|
+
* (`EvaluateCommand` is there, but it scores agent transcripts against an
|
|
12
|
+
* evaluator; it decides nothing about permissions). The policy surface is
|
|
13
|
+
* **control-plane only**: you author and attach policies, and **AgentCore
|
|
14
|
+
* enforces them AT THE GATEWAY**, in front of the tool, before any request
|
|
15
|
+
* reaches your process.
|
|
6
16
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* }).build();
|
|
17
|
+
* So every `check()` this adapter ever ran ended in the `catch` — and the
|
|
18
|
+
* default is fail-closed, which means it denied every tool call and said the
|
|
19
|
+
* policy engine was unreachable. It compiled, it passed its tests (all of which
|
|
20
|
+
* injected `_client` past the SDK), and it could never have worked.
|
|
12
21
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
22
|
+
* ── Why a refusal rather than a deletion ────────────────────────────────────
|
|
23
|
+
* Deleting an export breaks a build with a module-resolution error that
|
|
24
|
+
* explains nothing. A factory that refuses breaks the same build with a
|
|
25
|
+
* paragraph that names the mistake, the alternative, and where denials really
|
|
26
|
+
* come from. The removal decision belongs to the next major.
|
|
16
27
|
*
|
|
17
|
-
* ──
|
|
28
|
+
* ── What to use instead ─────────────────────────────────────────────────────
|
|
29
|
+
* • **Local, in-process rules** — `PermissionPolicy.fromRoles(...)` behind
|
|
30
|
+
* the same `permissionChecker` port. Synchronous, so it doubles as a
|
|
31
|
+
* `gatedTools` predicate.
|
|
32
|
+
* • **Anything richer** — the `.toolMiddleware()` chain: allow / deny / ask /
|
|
33
|
+
* transform per call, with the run's own history in hand.
|
|
34
|
+
* • **AgentCore Gateway policy** — already enforced, without this library's
|
|
35
|
+
* help. A denial arrives as an **MCP error** on the tool call made through
|
|
36
|
+
* `mcpClient(...)`, and lands in the loop as the tool's result, which the
|
|
37
|
+
* model reads and adapts to. The library's job there is to surface that
|
|
38
|
+
* denial honestly, not to pre-evaluate a copy of the rule.
|
|
18
39
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* human can act on. `onUnavailable: 'allow-with-warning'` is available for
|
|
23
|
-
* teams rolling policy out gradually, and it is deliberately awkward to type,
|
|
24
|
-
* because "we could not check, so we allowed it" is a sentence you should have
|
|
25
|
-
* to write down on purpose.
|
|
26
|
-
*
|
|
27
|
-
* **2. The reason rides to the model AS DATA.** A denied tool call comes back
|
|
28
|
-
* to the LLM as a `tellLLM` string, not as an exception. The model then
|
|
29
|
-
* re-decides with the refusal in front of it, which is the difference between
|
|
30
|
-
* an agent that says "I am not allowed to do that" and a run that dies.
|
|
31
|
-
* Telemetry (`reason`) stays out of `tellLLM` — the model does not get taught
|
|
32
|
-
* the shape of the rule space.
|
|
33
|
-
*
|
|
34
|
-
* **3. One evaluation per (tool, principal) per turn.** The ReAct loop can put
|
|
35
|
-
* the same tool in front of the gate several times in one iteration; paying for
|
|
36
|
-
* a round-trip each time buys nothing, because nothing between them could have
|
|
37
|
-
* changed the answer. The cache key is the tool, the principal AND the
|
|
38
|
-
* iteration, so the NEXT turn re-asks — a policy that changed mid-conversation
|
|
39
|
-
* is honoured on the next turn rather than at the end of the run.
|
|
40
|
-
*
|
|
41
|
-
* ── Verification status, stated plainly ──────────────────────────────────────
|
|
42
|
-
* **Contract-mapped and injection-tested.** Every AWS interaction is exercised
|
|
43
|
-
* through the `_client` seam; no test in this repo reaches AWS, and none
|
|
44
|
-
* pretends to. Confirm the command and field names against your installed
|
|
45
|
-
* `@aws-sdk/client-bedrock-agentcore` — this adapter targets an
|
|
46
|
-
* evaluate-a-request shape and is structured so the request → decision mapping
|
|
47
|
-
* is unit-tested independently of the SDK. Real-cloud verification lands with a
|
|
48
|
-
* field deployment.
|
|
49
|
-
*
|
|
50
|
-
* Pattern: Adapter (GoF) + lazy peer-dep load. Role: Layer-3 cross-cutting
|
|
51
|
-
* guard, exactly where `PermissionPolicy` sits — this one just asks somebody
|
|
52
|
-
* else.
|
|
40
|
+
* The `PermissionChecker` port itself is untouched, and so is every local
|
|
41
|
+
* policy built on it. A real AgentCore *data-plane* authorization API, if one
|
|
42
|
+
* ever ships, plugs in behind that same port.
|
|
53
43
|
*/
|
|
54
44
|
import type { PermissionChecker } from '../types.js';
|
|
55
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* What the policy engine answered.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated 9.4.0 — kept so existing imports still compile. See the module
|
|
49
|
+
* header: there is no AgentCore data-plane policy evaluation to answer.
|
|
50
|
+
*/
|
|
56
51
|
export interface AgentCorePolicyEvaluation {
|
|
57
|
-
/**
|
|
58
|
-
* The engine's verdict. Compared case-insensitively against `'allow'`;
|
|
59
|
-
* ANYTHING else is a denial, including a value this adapter has never seen.
|
|
60
|
-
* An unrecognised verdict is not a permission.
|
|
61
|
-
*/
|
|
62
52
|
readonly decision: string;
|
|
63
|
-
/** Why, when the engine explains itself. Surfaces to the model on a denial. */
|
|
64
53
|
readonly reason?: string;
|
|
65
|
-
/** Which policy decided, for the audit trail. */
|
|
66
54
|
readonly policyId?: string;
|
|
67
55
|
}
|
|
68
56
|
/**
|
|
69
|
-
* The minimal surface
|
|
70
|
-
*
|
|
57
|
+
* The minimal surface the retired adapter called.
|
|
58
|
+
*
|
|
59
|
+
* @deprecated 9.4.0 — kept so existing imports still compile.
|
|
71
60
|
*/
|
|
72
61
|
export interface AgentCorePolicyClientLike {
|
|
73
62
|
evaluate(input: {
|
|
74
63
|
readonly policyStoreId: string;
|
|
75
|
-
/** Who is acting — the end user when the run carries one, else the agent. */
|
|
76
64
|
readonly principal: string;
|
|
77
|
-
/** What they are trying to do — the tool name for a tool call. */
|
|
78
65
|
readonly action: string;
|
|
79
|
-
/** What they are trying to do it to — the capability being exercised. */
|
|
80
66
|
readonly resource: string;
|
|
81
|
-
/** Everything else the policy may want to read. */
|
|
82
67
|
readonly context?: Readonly<Record<string, unknown>>;
|
|
83
68
|
}): Promise<AgentCorePolicyEvaluation>;
|
|
84
69
|
}
|
|
85
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* What to do when the policy engine cannot be reached.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated 9.4.0 — kept so existing imports still compile.
|
|
74
|
+
*/
|
|
86
75
|
export type AgentCorePolicyUnavailable = 'deny' | 'allow-with-warning';
|
|
87
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Options for the retired {@link agentCorePolicy}.
|
|
78
|
+
*
|
|
79
|
+
* @deprecated 9.4.0 — kept so existing imports still compile.
|
|
80
|
+
*/
|
|
88
81
|
export interface AgentCorePolicyOptions {
|
|
89
|
-
/** The AgentCore policy store to evaluate against. Required. */
|
|
90
82
|
readonly policyStoreId: string;
|
|
91
|
-
/** AWS region, when the adapter constructs the SDK client itself. */
|
|
92
83
|
readonly region?: string;
|
|
93
|
-
/**
|
|
94
|
-
* What an evaluation FAILURE means. Default `'deny'` — fail closed.
|
|
95
|
-
*
|
|
96
|
-
* `'allow-with-warning'` allows the call and reports the failure through
|
|
97
|
-
* `onWarning`, for a rollout where the policy store is not yet the source of
|
|
98
|
-
* truth. It never applies to a successful evaluation that said no: an
|
|
99
|
-
* explicit denial is always a denial.
|
|
100
|
-
*/
|
|
101
84
|
readonly onUnavailable?: AgentCorePolicyUnavailable;
|
|
102
|
-
/**
|
|
103
|
-
* Called when `onUnavailable: 'allow-with-warning'` lets a call through.
|
|
104
|
-
* Default: `console.warn`. Give it your logger so the allow-on-failure is
|
|
105
|
-
* something an on-call engineer can find later.
|
|
106
|
-
*/
|
|
107
85
|
readonly onWarning?: (message: string, error: Error) => void;
|
|
108
|
-
/**
|
|
109
|
-
* Derive the policy principal from the run's identity. Default:
|
|
110
|
-
* `identity.principal`, else `identity.tenant`, else `'agent'`.
|
|
111
|
-
*
|
|
112
|
-
* The default is also the cache key, so a checker shared across users never
|
|
113
|
-
* hands one user's decision to another.
|
|
114
|
-
*/
|
|
115
86
|
readonly principalFor?: (identity: {
|
|
116
87
|
readonly principal?: string;
|
|
117
88
|
readonly tenant?: string;
|
|
118
89
|
} | undefined) => string;
|
|
119
|
-
/** Stable name, surfaced on permission events. Default `'agentCorePolicy'`. */
|
|
120
90
|
readonly name?: string;
|
|
121
|
-
/** Most decisions to keep cached at once. Default 500. Oldest are evicted first. */
|
|
122
91
|
readonly cacheSize?: number;
|
|
123
|
-
/** @internal
|
|
92
|
+
/** @internal */
|
|
124
93
|
readonly _client?: AgentCorePolicyClientLike;
|
|
125
|
-
/** @internal
|
|
94
|
+
/** @internal */
|
|
126
95
|
readonly _sdk?: BedrockAgentCorePolicySdkModule;
|
|
127
96
|
}
|
|
128
97
|
/**
|
|
129
|
-
*
|
|
98
|
+
* The slice of `@aws-sdk/client-bedrock-agentcore` the retired shim reached for.
|
|
99
|
+
* `EvaluatePolicyCommand` is listed here as the record of a command that never
|
|
100
|
+
* existed — see the module header.
|
|
130
101
|
*
|
|
131
|
-
*
|
|
132
|
-
* particular `gatedTools(...)` is a DIFFERENT layer and stays untouched: the
|
|
133
|
-
* gate decides what the model is shown, this decides what actually runs, and
|
|
134
|
-
* neither needs to be told the other exists. A tool hidden by a gate is never
|
|
135
|
-
* evaluated (the model cannot call what it cannot see); a tool the gate shows
|
|
136
|
-
* still has to get past the policy.
|
|
137
|
-
*
|
|
138
|
-
* @example Fail closed (the default)
|
|
139
|
-
* permissionChecker: agentCorePolicy({ policyStoreId, region: 'us-west-2' })
|
|
140
|
-
*
|
|
141
|
-
* @example Rolling policy out, with the allow-on-failure logged where you can find it
|
|
142
|
-
* agentCorePolicy({
|
|
143
|
-
* policyStoreId,
|
|
144
|
-
* onUnavailable: 'allow-with-warning',
|
|
145
|
-
* onWarning: (message, error) => logger.warn({ err: error }, message),
|
|
146
|
-
* });
|
|
102
|
+
* @deprecated 9.4.0 — kept so existing imports still compile.
|
|
147
103
|
*/
|
|
148
|
-
export declare function agentCorePolicy(options: AgentCorePolicyOptions): PermissionChecker;
|
|
149
|
-
/** The slice of `@aws-sdk/client-bedrock-agentcore` this shim touches. */
|
|
150
104
|
export interface BedrockAgentCorePolicySdkModule {
|
|
151
105
|
readonly BedrockAgentCoreClient?: new (config: {
|
|
152
106
|
region?: string;
|
|
@@ -155,4 +109,24 @@ export interface BedrockAgentCorePolicySdkModule {
|
|
|
155
109
|
};
|
|
156
110
|
readonly EvaluatePolicyCommand?: new (input: unknown) => unknown;
|
|
157
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Raised by {@link agentCorePolicy}. Carries the whole explanation in
|
|
114
|
+
* `message`; the class exists so a caller can catch this specific retirement
|
|
115
|
+
* rather than pattern-matching prose.
|
|
116
|
+
*/
|
|
117
|
+
export declare class AgentCorePolicyRetiredError extends Error {
|
|
118
|
+
readonly code: "ERR_AGENTCORE_POLICY_RETIRED";
|
|
119
|
+
constructor();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* **Retired (9.4.0).** Throws {@link AgentCorePolicyRetiredError} naming why,
|
|
123
|
+
* what to use for local rules, and where Gateway-enforced denials actually
|
|
124
|
+
* arrive. See the module header for the full story.
|
|
125
|
+
*
|
|
126
|
+
* @deprecated 9.4.0 — use `PermissionPolicy.fromRoles(...)` (local rules) or
|
|
127
|
+
* `.toolMiddleware()` (conditional rules); AgentCore Gateway policy is enforced
|
|
128
|
+
* at the Gateway and surfaces as an MCP error on the tool call.
|
|
129
|
+
* @throws {AgentCorePolicyRetiredError} always.
|
|
130
|
+
*/
|
|
131
|
+
export declare function agentCorePolicy(_options: AgentCorePolicyOptions): PermissionChecker;
|
|
158
132
|
//# sourceMappingURL=agentcore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/security/agentcore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/security/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,MAAM,EAA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,CAAC;IACF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAClE;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,IAAI,iCAA2C;;CA6BzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,sBAAsB,GAAG,iBAAiB,CAEnF"}
|
|
@@ -38,6 +38,9 @@ export interface RunContext {
|
|
|
38
38
|
/** Optional turn/iter indices from agent runtime. */
|
|
39
39
|
readonly turnIndex?: number;
|
|
40
40
|
readonly iterIndex?: number;
|
|
41
|
+
/** The hosting conversation this run belongs to, when it belongs to one
|
|
42
|
+
* (9.4.0). Absent for an unhosted or anonymous run — never fabricated. */
|
|
43
|
+
readonly sessionId?: string;
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
46
|
* Build an EventMeta from a stage origin + run-level context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventMeta.d.ts","sourceRoot":"","sources":["../../../src/bridge/eventMeta.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAMpD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,+EAA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