@agent-assembly/sdk 0.0.1-alpha.8 → 0.0.1-alpha.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/dist/cjs/index.js +5 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -134,14 +134,51 @@ call is checked against policy before it runs.
|
|
|
134
134
|
| ------ | ------- |
|
|
135
135
|
| `initAssembly(config)` | Set up governance and auto-wire detected frameworks. The main entrypoint. |
|
|
136
136
|
| `withAssembly(tools, options)` | Lower-level wrapper to govern a tool map when you manage the gateway client yourself. |
|
|
137
|
+
| `createNoopGatewayClient(mode)` | Build an allow-all `GatewayClient` for offline demos and tests, or as a base to wrap. |
|
|
138
|
+
| `PolicyViolationError` | Thrown by a governed tool when the gateway client denies the call. |
|
|
137
139
|
| `currentAgentId()`, `runWithAgentId()` | Read and set the active agent id in the async-context lineage store. |
|
|
138
140
|
| `encodeAuditEvent()` / `decodeAuditEvent()` (and the call-stack codecs) | Encode and decode audit events to and from their wire shape. |
|
|
139
141
|
| `findAasmBinary()`, `INSTALL_HINT` | Locate the bundled `aasm` runtime binary and the install hint shown when it is missing. |
|
|
140
142
|
| `ENFORCEMENT_MODES` | The allowed `enforcementMode` values. |
|
|
141
143
|
|
|
142
144
|
Type-only exports (`AssemblyConfig`, `AssemblyContext`, `AssemblyMode`, `EnforcementMode`,
|
|
143
|
-
`ToolMap`, and friends) are documented in
|
|
144
|
-
[API reference](https://ai-agent-assembly.github.io/node-sdk/api-reference).
|
|
145
|
+
`ToolMap`, `GatewayClient`, the `Gateway*` governance types, and friends) are documented in
|
|
146
|
+
the [API reference](https://ai-agent-assembly.github.io/node-sdk/api-reference).
|
|
147
|
+
|
|
148
|
+
## Governing tools offline
|
|
149
|
+
|
|
150
|
+
`withAssembly(tools, options)` needs a `GatewayClient`. For offline demos, tests, or custom
|
|
151
|
+
in-process policies you can build one yourself — no running gateway required:
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
import {
|
|
155
|
+
createNoopGatewayClient,
|
|
156
|
+
withAssembly,
|
|
157
|
+
type GatewayClient
|
|
158
|
+
} from "@agent-assembly/sdk";
|
|
159
|
+
|
|
160
|
+
// Allow-all client — handy for offline smoke tests:
|
|
161
|
+
withAssembly(
|
|
162
|
+
{ search: { description: "Search", execute: async (q: string) => `result:${q}` } },
|
|
163
|
+
{ gatewayClient: createNoopGatewayClient("sdk-only") }
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
// Or enforce your own in-process policy by implementing the GatewayClient interface:
|
|
167
|
+
const policyClient: GatewayClient = {
|
|
168
|
+
mode: "sdk-only",
|
|
169
|
+
start: async () => undefined,
|
|
170
|
+
close: async () => undefined,
|
|
171
|
+
check: async (request) =>
|
|
172
|
+
request.toolName === "delete_file"
|
|
173
|
+
? { denied: true, reason: "blocked by local policy" }
|
|
174
|
+
: { denied: false },
|
|
175
|
+
waitForApproval: async () => ({ denied: false }),
|
|
176
|
+
record: async () => undefined,
|
|
177
|
+
recordResult: async () => undefined,
|
|
178
|
+
scanPrompts: async () => undefined
|
|
179
|
+
};
|
|
180
|
+
// A governed tool throws `PolicyViolationError` when `check` denies it.
|
|
181
|
+
```
|
|
145
182
|
|
|
146
183
|
## How LangChain tools are blocked
|
|
147
184
|
|
|
@@ -248,6 +285,7 @@ across all SDKs.
|
|
|
248
285
|
| [Documentation site](https://ai-agent-assembly.github.io/agent-assembly-docs/) | Canonical, cross-repo documentation for the whole platform. |
|
|
249
286
|
| [python-sdk](https://github.com/ai-agent-assembly/python-sdk) | Sibling SDK for Python. |
|
|
250
287
|
| [go-sdk](https://github.com/ai-agent-assembly/go-sdk) | Sibling SDK for Go. |
|
|
288
|
+
| [agent-assembly-examples](https://github.com/ai-agent-assembly/agent-assembly-examples) | Runnable examples — learn by running small, framework-specific Node.js/TypeScript (and Python/Go) samples for policy enforcement, approvals, audit, trace, and runtime workflows. |
|
|
251
289
|
| [Release notes](https://github.com/ai-agent-assembly/node-sdk/releases) | Per-version changelog for this package. |
|
|
252
290
|
| [Organization profile](https://github.com/ai-agent-assembly) | Index of every Agent Assembly repository and its status. |
|
|
253
291
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findAasmBinary = exports.INSTALL_HINT = exports.runWithAgentId = exports.currentAgentId = exports.encodeCallStackNode = exports.encodeAuditEvent = exports.decodeCallStackNode = exports.decodeAuditEvent = exports.ENFORCEMENT_MODES = exports.withAssembly = exports.initAssembly = void 0;
|
|
3
|
+
exports.PolicyViolationError = exports.createNoopGatewayClient = exports.findAasmBinary = exports.INSTALL_HINT = exports.runWithAgentId = exports.currentAgentId = exports.encodeCallStackNode = exports.encodeAuditEvent = exports.decodeCallStackNode = exports.decodeAuditEvent = exports.ENFORCEMENT_MODES = exports.withAssembly = exports.initAssembly = void 0;
|
|
4
4
|
var init_assembly_js_1 = require("./core/init-assembly.js");
|
|
5
5
|
Object.defineProperty(exports, "initAssembly", { enumerable: true, get: function () { return init_assembly_js_1.initAssembly; } });
|
|
6
6
|
var index_js_1 = require("./wrappers/index.js");
|
|
@@ -23,3 +23,7 @@ Object.defineProperty(exports, "runWithAgentId", { enumerable: true, get: functi
|
|
|
23
23
|
var runtime_js_1 = require("./runtime.js");
|
|
24
24
|
Object.defineProperty(exports, "INSTALL_HINT", { enumerable: true, get: function () { return runtime_js_1.INSTALL_HINT; } });
|
|
25
25
|
Object.defineProperty(exports, "findAasmBinary", { enumerable: true, get: function () { return runtime_js_1.findAasmBinary; } });
|
|
26
|
+
var index_js_5 = require("./gateway/index.js");
|
|
27
|
+
Object.defineProperty(exports, "createNoopGatewayClient", { enumerable: true, get: function () { return index_js_5.createNoopGatewayClient; } });
|
|
28
|
+
var index_js_6 = require("./errors/index.js");
|
|
29
|
+
Object.defineProperty(exports, "PolicyViolationError", { enumerable: true, get: function () { return index_js_6.PolicyViolationError; } });
|
package/dist/esm/index.js
CHANGED
|
@@ -9,4 +9,6 @@ export { currentAgentId, runWithAgentId } from "./lineage/index.js";
|
|
|
9
9
|
// `@agent-assembly/sdk/runtime` subpath export to avoid colliding with
|
|
10
10
|
// the gateway-based `initAssembly` re-exported above.
|
|
11
11
|
export { INSTALL_HINT, findAasmBinary } from "./runtime.js";
|
|
12
|
+
export { createNoopGatewayClient } from "./gateway/index.js";
|
|
13
|
+
export { PolicyViolationError } from "./errors/index.js";
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAYnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpE,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,uEAAuE;AACvE,sDAAsD;AACtD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAYnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpE,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,uEAAuE;AACvE,sDAAsD;AACtD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,4 +7,8 @@ export { decodeAuditEvent, decodeCallStackNode, encodeAuditEvent, encodeCallStac
|
|
|
7
7
|
export type { WireAuditEvent, WireCallStackNode } from "./audit/index.js";
|
|
8
8
|
export { currentAgentId, runWithAgentId } from "./lineage/index.js";
|
|
9
9
|
export { INSTALL_HINT, findAasmBinary } from "./runtime.js";
|
|
10
|
+
export type { GatewayClient } from "./gateway/index.js";
|
|
11
|
+
export type { GatewayApprovalResult, GatewayCheckRequest, GatewayDecision, GatewayPromptScan, GatewayRecordEvent, GatewayResultRecord } from "./types/index.js";
|
|
12
|
+
export { createNoopGatewayClient } from "./gateway/index.js";
|
|
13
|
+
export { PolicyViolationError } from "./errors/index.js";
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,YAAY,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACV,aAAa,E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