@agent-assembly/sdk 0.0.1-alpha.5 → 0.0.1-alpha.7
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 +161 -79
- package/dist/cjs/core/gateway-resolver.js +5 -1
- package/dist/cjs/hooks/mastra.js +6 -2
- package/dist/cjs/native/client.js +7 -5
- package/dist/esm/core/gateway-resolver.js +5 -1
- package/dist/esm/core/gateway-resolver.js.map +1 -1
- package/dist/esm/hooks/mastra.js +6 -2
- package/dist/esm/hooks/mastra.js.map +1 -1
- package/dist/esm/native/client.js +7 -5
- package/dist/esm/native/client.js.map +1 -1
- package/dist/types/core/gateway-resolver.d.ts.map +1 -1
- package/dist/types/hooks/mastra.d.ts.map +1 -1
- package/dist/types/native/client.d.ts.map +1 -1
- package/native/aa-ffi-node/index.d.ts +28 -12
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
# @agent-assembly/sdk
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ai-agent-assembly/node-sdk/actions/workflows/test-matrix.yml)
|
|
4
|
+
[](https://github.com/ai-agent-assembly/node-sdk/actions/workflows/publish-docs.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@agent-assembly/sdk/v/alpha)
|
|
6
|
+
[](https://codecov.io/gh/ai-agent-assembly/node-sdk)
|
|
7
|
+
[](https://sonarcloud.io/summary/new_code?id=AI-agent-assembly_node-sdk)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
[](https://github.com/ai-agent-assembly/node-sdk/blob/master/package.json)
|
|
10
|
+
[](https://github.com/ai-agent-assembly/node-sdk/blob/master/eslint.config.mjs)
|
|
8
11
|
|
|
9
12
|
TypeScript/Node.js SDK for Agent Assembly, licensed under Apache 2.0.
|
|
10
13
|
|
|
14
|
+
## Project status
|
|
15
|
+
|
|
16
|
+
> **Pre-1.0 / alpha.** The current release line is `0.0.1-alpha.x`, published to npm under
|
|
17
|
+
> the `alpha` dist-tag. The public surface (`initAssembly`, `withAssembly`) is stabilizing
|
|
18
|
+
> but **may change between alpha releases**, and per-platform native packaging is still
|
|
19
|
+
> being hardened. Pin an exact version for reproducible installs and review the
|
|
20
|
+
> [release notes](https://github.com/ai-agent-assembly/node-sdk/releases) before upgrading.
|
|
21
|
+
> Production deployments should track the first `0.1.0` release.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add @agent-assembly/sdk@alpha # latest alpha
|
|
25
|
+
pnpm add @agent-assembly/sdk@0.0.1-alpha.3 # pin exact
|
|
26
|
+
```
|
|
27
|
+
|
|
11
28
|
## Prerequisites
|
|
12
29
|
|
|
13
30
|
Before installing or contributing, ensure your environment has:
|
|
@@ -32,33 +49,57 @@ during `postinstall`. No additional build step is required for typical consumers
|
|
|
32
49
|
|
|
33
50
|
## Quickstart
|
|
34
51
|
|
|
52
|
+
Pass your LangChain-style tools (`{ name, invoke }`) to `initAssembly` under
|
|
53
|
+
`langchain.tools`. Each tool is wrapped **in place** so every `invoke()` is checked
|
|
54
|
+
against gateway policy before it runs.
|
|
55
|
+
|
|
35
56
|
### ESM (`import`)
|
|
36
57
|
|
|
37
58
|
```ts
|
|
38
|
-
import { initAssembly
|
|
39
|
-
|
|
59
|
+
import { initAssembly } from "@agent-assembly/sdk";
|
|
60
|
+
|
|
61
|
+
const searchWeb = {
|
|
62
|
+
name: "search_web",
|
|
63
|
+
invoke: async (input: { q: string }) => `results for ${input.q}`
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const ctx = await initAssembly({
|
|
67
|
+
gatewayUrl: "http://localhost:7391",
|
|
68
|
+
agentId: "demo",
|
|
69
|
+
langchain: { tools: { searchWeb } }
|
|
70
|
+
});
|
|
40
71
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const model = new ChatOpenAI({ model: "gpt-4o-mini" }).bindTools(governedTools);
|
|
72
|
+
await searchWeb.invoke({ q: "agent assembly" }); // governed; throws on policy deny
|
|
73
|
+
await ctx.shutdown();
|
|
44
74
|
```
|
|
45
75
|
|
|
46
76
|
### CJS (`require`)
|
|
47
77
|
|
|
48
78
|
```js
|
|
49
|
-
const { initAssembly
|
|
50
|
-
const { ChatOpenAI } = require("@langchain/openai");
|
|
79
|
+
const { initAssembly } = require("@agent-assembly/sdk");
|
|
51
80
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
81
|
+
const searchWeb = {
|
|
82
|
+
name: "search_web",
|
|
83
|
+
invoke: async (input) => `results for ${input.q}`
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const ctx = await initAssembly({
|
|
87
|
+
gatewayUrl: "http://localhost:7391",
|
|
88
|
+
agentId: "demo",
|
|
89
|
+
langchain: { tools: { searchWeb } }
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
await searchWeb.invoke({ q: "agent assembly" });
|
|
93
|
+
await ctx.shutdown();
|
|
55
94
|
```
|
|
56
95
|
|
|
57
96
|
Both entrypoints resolve to the same governance pipeline; the package's `exports` field
|
|
58
97
|
selects ESM or CJS automatically based on how the consumer imports it.
|
|
59
98
|
|
|
60
|
-
`initAssembly()` registers the LangChain callback handler and the
|
|
61
|
-
|
|
99
|
+
`initAssembly()` registers the LangChain callback handler and auto-wraps the configured
|
|
100
|
+
tools, so each is checked against gateway policy before invocation. For more frameworks
|
|
101
|
+
and the lower-level `withAssembly()` wrapper, see the **Examples** guide on the
|
|
102
|
+
[documentation site](https://ai-agent-assembly.github.io/node-sdk/).
|
|
62
103
|
|
|
63
104
|
## Supported Node.js versions
|
|
64
105
|
|
|
@@ -75,102 +116,116 @@ system. The matrix is enforced by `.github/workflows/test-matrix.yml`:
|
|
|
75
116
|
Older Node.js lines (≤ 16) are unsupported because the napi-rs ABI used by the native
|
|
76
117
|
binding requires Node 18.18 or newer.
|
|
77
118
|
|
|
78
|
-
##
|
|
119
|
+
## How it works
|
|
79
120
|
|
|
80
|
-
|
|
121
|
+
The SDK is a thin TypeScript wrapper around the Agent Assembly Rust runtime. It reaches
|
|
122
|
+
the runtime over one of two transports:
|
|
81
123
|
|
|
82
|
-
- gRPC sidecar client
|
|
83
|
-
- native in-process binding
|
|
124
|
+
- a **gRPC sidecar** client that talks to a separate gateway process, or
|
|
125
|
+
- a **native in-process** binding built with napi-rs.
|
|
84
126
|
|
|
85
|
-
|
|
86
|
-
|
|
127
|
+
`initAssembly()` is the primary entrypoint. It resolves the gateway, registers the agent,
|
|
128
|
+
and installs governance hooks for whichever supported framework it detects, so every tool
|
|
129
|
+
call is checked against policy before it runs.
|
|
87
130
|
|
|
88
|
-
##
|
|
131
|
+
## What the package exports
|
|
89
132
|
|
|
90
|
-
|
|
91
|
-
|
|
133
|
+
| Export | Purpose |
|
|
134
|
+
| ------ | ------- |
|
|
135
|
+
| `initAssembly(config)` | Set up governance and auto-wire detected frameworks. The main entrypoint. |
|
|
136
|
+
| `withAssembly(tools, options)` | Lower-level wrapper to govern a tool map when you manage the gateway client yourself. |
|
|
137
|
+
| `currentAgentId()`, `runWithAgentId()` | Read and set the active agent id in the async-context lineage store. |
|
|
138
|
+
| `encodeAuditEvent()` / `decodeAuditEvent()` (and the call-stack codecs) | Encode and decode audit events to and from their wire shape. |
|
|
139
|
+
| `findAasmBinary()`, `INSTALL_HINT` | Locate the bundled `aasm` runtime binary and the install hint shown when it is missing. |
|
|
140
|
+
| `ENFORCEMENT_MODES` | The allowed `enforcementMode` values. |
|
|
92
141
|
|
|
93
|
-
|
|
142
|
+
Type-only exports (`AssemblyConfig`, `AssemblyContext`, `AssemblyMode`, `EnforcementMode`,
|
|
143
|
+
`ToolMap`, and friends) are documented in the
|
|
144
|
+
[API reference](https://ai-agent-assembly.github.io/node-sdk/api-reference).
|
|
94
145
|
|
|
95
|
-
|
|
96
|
-
by tool description content (or tool map key in wrapper context), not by strict
|
|
97
|
-
framework-level tool name.
|
|
146
|
+
## How LangChain tools are blocked
|
|
98
147
|
|
|
99
|
-
|
|
148
|
+
LangChain's `handleToolStart` callback cannot stop a tool from running by its return
|
|
149
|
+
value, so the SDK governs LangChain tools with two cooperating layers:
|
|
100
150
|
|
|
101
|
-
|
|
102
|
-
|
|
151
|
+
- **Callback layer** (`AssemblyCallbackHandler`) — tracks deferred denials and redacts
|
|
152
|
+
output at `handleToolEnd`.
|
|
153
|
+
- **Wrapper layer** (`wrapToolWithAssembly`) — enforces the real pre-execution
|
|
154
|
+
allow / deny / pending check.
|
|
103
155
|
|
|
104
|
-
|
|
105
|
-
|
|
156
|
+
`initAssembly()` registers the callback handler and wraps your configured LangChain tools
|
|
157
|
+
for you, so you do not wire either layer by hand.
|
|
106
158
|
|
|
107
|
-
|
|
108
|
-
LangChain tools.
|
|
159
|
+
## Matching policies to tools
|
|
109
160
|
|
|
110
|
-
|
|
161
|
+
Most frameworks expose a tool `name` that policies match on. **Vercel AI SDK tools do
|
|
162
|
+
not** — they have no `.name` field — so for that framework, write policies that match on
|
|
163
|
+
the tool's description content (or, in `withAssembly`, the tool-map key) instead of a
|
|
164
|
+
framework-level tool name.
|
|
165
|
+
|
|
166
|
+
## Source layout
|
|
111
167
|
|
|
112
168
|
```text
|
|
113
169
|
src/
|
|
114
|
-
index.ts
|
|
115
|
-
core/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
policy-violation-error.ts
|
|
129
|
-
types/
|
|
130
|
-
assembly-mode.ts
|
|
131
|
-
assembly-config.ts
|
|
132
|
-
assembly-context.ts
|
|
133
|
-
gateway-governance.ts
|
|
134
|
-
langchain-adapter.ts
|
|
135
|
-
tool-map.ts
|
|
136
|
-
tests/
|
|
137
|
-
architecture/
|
|
138
|
-
.github/workflows/
|
|
170
|
+
index.ts # public entrypoint — re-exports the supported surface
|
|
171
|
+
core/ # init-assembly flow + gateway/API-key resolution
|
|
172
|
+
adapters/ # Adapter interface + AdapterRegistry, LangChain adapter
|
|
173
|
+
hooks/ # auto-detection patches (Vercel AI, OpenAI Agents, LangGraph, Mastra)
|
|
174
|
+
gateway/ # gateway client (gRPC sidecar transport)
|
|
175
|
+
native/ # loader for the napi-rs in-process binding
|
|
176
|
+
wrappers/ # low-level withAssembly() tool wrapper
|
|
177
|
+
lineage/ # async-context store for parent/child agent lineage
|
|
178
|
+
audit/ # audit-event wire encode/decode helpers
|
|
179
|
+
errors/ # ConfigurationError, GatewayError, PolicyViolationError, …
|
|
180
|
+
types/ # AssemblyConfig, AssemblyContext, AssemblyMode, EnforcementMode, …
|
|
181
|
+
proto/generated/ # generated protobuf types
|
|
182
|
+
native/aa-ffi-node/ # the Rust napi-rs crate (built into a per-platform .node binary)
|
|
183
|
+
tests/ # unit + architecture tests
|
|
139
184
|
```
|
|
140
185
|
|
|
141
|
-
|
|
186
|
+
For how these layers fit together, see the
|
|
187
|
+
[Architecture guide](https://ai-agent-assembly.github.io/node-sdk/core-concepts/architecture).
|
|
188
|
+
|
|
189
|
+
## Building the native binding
|
|
142
190
|
|
|
143
|
-
|
|
191
|
+
Most consumers never build the native binding — a prebuilt binary is installed for their
|
|
192
|
+
platform. You only need this when working on the `aa-ffi-node` Rust crate (at
|
|
193
|
+
`native/aa-ffi-node`) or running on a platform with no prebuild.
|
|
144
194
|
|
|
145
195
|
Build commands:
|
|
146
196
|
|
|
147
|
-
- `pnpm native:build`
|
|
148
|
-
- `pnpm native:build:release`
|
|
149
|
-
- `pnpm native:check-types`
|
|
197
|
+
- `pnpm native:build` — debug build, for local development.
|
|
198
|
+
- `pnpm native:build:release` — release build that produces the per-platform artifact.
|
|
199
|
+
- `pnpm native:check-types` — strict type-check of the generated napi `index.d.ts`.
|
|
150
200
|
|
|
151
|
-
|
|
201
|
+
Run the native integration acceptance test (skipped unless the binding is built):
|
|
152
202
|
|
|
153
203
|
- `AA_NATIVE_TEST=1 pnpm vitest run tests/native-napi-integration.test.ts`
|
|
154
204
|
|
|
155
|
-
The `build-addon` GitHub workflow
|
|
156
|
-
|
|
205
|
+
The `build-addon` GitHub workflow compiles the native addon (Node 20 and 22): an
|
|
206
|
+
ubuntu-only debug build on pull requests, and ubuntu + macOS builds on `master` and release
|
|
207
|
+
tags. The addon embeds a Unix-domain-socket transport and **does not build on Windows**;
|
|
208
|
+
Windows consumers use `grpc-sidecar` mode.
|
|
157
209
|
|
|
158
|
-
## Packaging
|
|
210
|
+
## Packaging layout
|
|
159
211
|
|
|
160
|
-
The package
|
|
212
|
+
The package publishes dual module outputs behind conditional `exports`:
|
|
161
213
|
|
|
162
214
|
- ESM entry: `./dist/esm/index.js`
|
|
163
215
|
- CJS entry: `./dist/cjs/index.js`
|
|
164
216
|
- Type declarations: `./dist/types/index.d.ts`
|
|
165
217
|
|
|
166
|
-
|
|
167
|
-
|
|
218
|
+
The four `@agent-assembly/runtime-*` packages (`runtime-linux-x64`, `runtime-linux-arm64`,
|
|
219
|
+
`runtime-darwin-x64`, `runtime-darwin-arm64`) are declared as `optionalDependencies` and
|
|
220
|
+
constrained by `os`/`cpu`, so only the one matching your platform is installed. Each
|
|
221
|
+
carries the `aasm` runtime binary; there is no Windows runtime package. The napi-rs `.node`
|
|
222
|
+
addon is loaded at runtime by `native/aa-ffi-node/index.cjs`.
|
|
168
223
|
|
|
169
|
-
|
|
224
|
+
CI verifies the published shape with:
|
|
170
225
|
|
|
171
|
-
- ESM and CJS entry smoke tests
|
|
172
|
-
-
|
|
173
|
-
- `npm pack` content and package
|
|
226
|
+
- ESM and CJS entry smoke tests,
|
|
227
|
+
- an `exports` `types` mapping assertion, and
|
|
228
|
+
- `npm pack` content and package-size guard tests.
|
|
174
229
|
|
|
175
230
|
## Documentation
|
|
176
231
|
|
|
@@ -180,3 +235,30 @@ Full guides, architecture deep-dives, and the complete API reference are publish
|
|
|
180
235
|
|
|
181
236
|
The site is built from the `docs/` (content) and `website/` (Docusaurus app) directories
|
|
182
237
|
and is re-published on every push to `master` via the `publish-docs.yml` workflow.
|
|
238
|
+
|
|
239
|
+
## Related projects
|
|
240
|
+
|
|
241
|
+
`@agent-assembly/sdk` is one client of the Agent Assembly platform. The governance
|
|
242
|
+
decisions it enforces are made by the core Rust runtime; the protocol it speaks is shared
|
|
243
|
+
across all SDKs.
|
|
244
|
+
|
|
245
|
+
| Project | What it is |
|
|
246
|
+
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
247
|
+
| [agent-assembly](https://github.com/ai-agent-assembly/agent-assembly) | Core Rust runtime — gateway, policy engine, proxy, eBPF, CLI (`aasm`). The protocol specification lives here. |
|
|
248
|
+
| [Documentation site](https://ai-agent-assembly.github.io/agent-assembly-docs/) | Canonical, cross-repo documentation for the whole platform. |
|
|
249
|
+
| [python-sdk](https://github.com/ai-agent-assembly/python-sdk) | Sibling SDK for Python. |
|
|
250
|
+
| [go-sdk](https://github.com/ai-agent-assembly/go-sdk) | Sibling SDK for Go. |
|
|
251
|
+
| [Release notes](https://github.com/ai-agent-assembly/node-sdk/releases) | Per-version changelog for this package. |
|
|
252
|
+
| [Organization profile](https://github.com/ai-agent-assembly) | Index of every Agent Assembly repository and its status. |
|
|
253
|
+
|
|
254
|
+
## Support & security
|
|
255
|
+
|
|
256
|
+
- **Questions and bug reports** — open an issue on the
|
|
257
|
+
[node-sdk issue tracker](https://github.com/ai-agent-assembly/node-sdk/issues). Include
|
|
258
|
+
your Node.js version, OS/arch, and the SDK version (`pnpm why @agent-assembly/sdk`).
|
|
259
|
+
- **Security vulnerabilities** — please do **not** file a public issue. Report privately
|
|
260
|
+
via the repository's
|
|
261
|
+
[security advisories](https://github.com/ai-agent-assembly/node-sdk/security/advisories)
|
|
262
|
+
page so a fix can be coordinated before disclosure.
|
|
263
|
+
- **Contributing** — see [CONTRIBUTING.md](./CONTRIBUTING.md) for environment setup, the
|
|
264
|
+
adapter-authoring guide, and the test/commit conventions.
|
|
@@ -77,7 +77,11 @@ exports.AASM_AUTO_START_ARGV = ["start", "--mode", "local", "--foreground"];
|
|
|
77
77
|
* fatal.
|
|
78
78
|
*/
|
|
79
79
|
async function probeHealthz(baseUrl, timeoutMs = exports.DEFAULT_PROBE_TIMEOUT_MS) {
|
|
80
|
-
|
|
80
|
+
let trimmedBase = baseUrl;
|
|
81
|
+
while (trimmedBase.endsWith("/")) {
|
|
82
|
+
trimmedBase = trimmedBase.slice(0, -1);
|
|
83
|
+
}
|
|
84
|
+
const url = trimmedBase + exports.DEFAULT_HEALTHZ_PATH;
|
|
81
85
|
const controller = new AbortController();
|
|
82
86
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
83
87
|
try {
|
package/dist/cjs/hooks/mastra.js
CHANGED
|
@@ -75,13 +75,15 @@ async function patchMastra(options) {
|
|
|
75
75
|
exports.mastraPatchState.originalGenerate = originalGenerate;
|
|
76
76
|
exports.mastraPatchState.patchedAgentClass = module.Agent;
|
|
77
77
|
module.Agent.prototype.generate = function patchedGenerate(...args) {
|
|
78
|
+
let result;
|
|
78
79
|
try {
|
|
79
|
-
|
|
80
|
+
result = (0, agent_context_store_js_1.runWithAgentId)(agentId, () => originalGenerate.apply(this, args));
|
|
80
81
|
}
|
|
81
82
|
catch (e) {
|
|
82
83
|
console.warn("[assembly] Mastra lineage patch error on generate; falling back:", e);
|
|
83
84
|
return originalGenerate.apply(this, args);
|
|
84
85
|
}
|
|
86
|
+
return result;
|
|
85
87
|
};
|
|
86
88
|
// Wrap Workflow.prototype.execute if present
|
|
87
89
|
if (module.Workflow?.prototype?.execute) {
|
|
@@ -89,13 +91,15 @@ async function patchMastra(options) {
|
|
|
89
91
|
exports.mastraPatchState.originalExecute = originalExecute;
|
|
90
92
|
exports.mastraPatchState.patchedWorkflowClass = module.Workflow;
|
|
91
93
|
module.Workflow.prototype.execute = function patchedExecute(...args) {
|
|
94
|
+
let result;
|
|
92
95
|
try {
|
|
93
|
-
|
|
96
|
+
result = (0, agent_context_store_js_1.runWithAgentId)(agentId, () => originalExecute.apply(this, args));
|
|
94
97
|
}
|
|
95
98
|
catch (e) {
|
|
96
99
|
console.warn("[assembly] Mastra lineage patch error on execute; falling back:", e);
|
|
97
100
|
return originalExecute.apply(this, args);
|
|
98
101
|
}
|
|
102
|
+
return result;
|
|
99
103
|
};
|
|
100
104
|
}
|
|
101
105
|
exports.mastraPatchState.isPatched = true;
|
|
@@ -145,16 +145,18 @@ function createNativeClient(options) {
|
|
|
145
145
|
pendingSendError = mapNativeError(error);
|
|
146
146
|
});
|
|
147
147
|
},
|
|
148
|
-
queryPolicy: async (
|
|
148
|
+
queryPolicy: async () => {
|
|
149
149
|
if (pendingSendError) {
|
|
150
150
|
const error = pendingSendError;
|
|
151
151
|
pendingSendError = undefined;
|
|
152
152
|
throw error;
|
|
153
153
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
// The SDK is not a policy authority. Ensure the session is connected
|
|
155
|
+
// (surfacing any connect error), then defer: authoritative policy and
|
|
156
|
+
// approval are enforced server-side (gateway / runtime). The native shim
|
|
157
|
+
// no longer synthesizes a decision, so this always resolves neutral.
|
|
158
|
+
await getHandle();
|
|
159
|
+
return { denied: false, pending: false };
|
|
158
160
|
}
|
|
159
161
|
};
|
|
160
162
|
}
|
|
@@ -35,7 +35,11 @@ export const AASM_AUTO_START_ARGV = ["start", "--mode", "local", "--foreground"]
|
|
|
35
35
|
* fatal.
|
|
36
36
|
*/
|
|
37
37
|
export async function probeHealthz(baseUrl, timeoutMs = DEFAULT_PROBE_TIMEOUT_MS) {
|
|
38
|
-
|
|
38
|
+
let trimmedBase = baseUrl;
|
|
39
|
+
while (trimmedBase.endsWith("/")) {
|
|
40
|
+
trimmedBase = trimmedBase.slice(0, -1);
|
|
41
|
+
}
|
|
42
|
+
const url = trimmedBase + DEFAULT_HEALTHZ_PATH;
|
|
39
43
|
const controller = new AbortController();
|
|
40
44
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
41
45
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-resolver.js","sourceRoot":"","sources":["../../../src/core/gateway-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAU,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAe,EACf,YAAoB,wBAAwB;IAE5C,
|
|
1
|
+
{"version":3,"file":"gateway-resolver.js","sourceRoot":"","sources":["../../../src/core/gateway-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,I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,CAAC;YAAE,OAAO,MAAM,CAAC;IACrE,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/esm/hooks/mastra.js
CHANGED
|
@@ -37,13 +37,15 @@ export async function patchMastra(options) {
|
|
|
37
37
|
mastraPatchState.originalGenerate = originalGenerate;
|
|
38
38
|
mastraPatchState.patchedAgentClass = module.Agent;
|
|
39
39
|
module.Agent.prototype.generate = function patchedGenerate(...args) {
|
|
40
|
+
let result;
|
|
40
41
|
try {
|
|
41
|
-
|
|
42
|
+
result = runWithAgentId(agentId, () => originalGenerate.apply(this, args));
|
|
42
43
|
}
|
|
43
44
|
catch (e) {
|
|
44
45
|
console.warn("[assembly] Mastra lineage patch error on generate; falling back:", e);
|
|
45
46
|
return originalGenerate.apply(this, args);
|
|
46
47
|
}
|
|
48
|
+
return result;
|
|
47
49
|
};
|
|
48
50
|
// Wrap Workflow.prototype.execute if present
|
|
49
51
|
if (module.Workflow?.prototype?.execute) {
|
|
@@ -51,13 +53,15 @@ export async function patchMastra(options) {
|
|
|
51
53
|
mastraPatchState.originalExecute = originalExecute;
|
|
52
54
|
mastraPatchState.patchedWorkflowClass = module.Workflow;
|
|
53
55
|
module.Workflow.prototype.execute = function patchedExecute(...args) {
|
|
56
|
+
let result;
|
|
54
57
|
try {
|
|
55
|
-
|
|
58
|
+
result = runWithAgentId(agentId, () => originalExecute.apply(this, args));
|
|
56
59
|
}
|
|
57
60
|
catch (e) {
|
|
58
61
|
console.warn("[assembly] Mastra lineage patch error on execute; falling back:", e);
|
|
59
62
|
return originalExecute.apply(this, args);
|
|
60
63
|
}
|
|
64
|
+
return result;
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
mastraPatchState.isPatched = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastra.js","sourceRoot":"","sources":["../../../src/hooks/mastra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AA2BnE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AM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,gBAAgB,CAAC,iBAAiB,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,CAAC;QAC5E,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,CAAC,QAAQ,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;IAC5F,CAAC;IACD,IAAI,gBAAgB,CAAC,oBAAoB,IAAI,gBAAgB,CAAC,eAAe,EAAE,CAAC;QAC9E,gBAAgB,CAAC,oBAAoB,CAAC,SAAS,CAAC,OAAO,GAAG,gBAAgB,CAAC,eAAe,CAAC;IAC7F,CAAC;IAED,gBAAgB,CAAC,SAAS,GAAG,KAAK,CAAC;IACnC,gBAAgB,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAC9C,gBAAgB,CAAC,eAAe,GAAG,SAAS,CAAC;IAC7C,gBAAgB,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAC/C,gBAAgB,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -134,16 +134,18 @@ export function createNativeClient(options) {
|
|
|
134
134
|
pendingSendError = mapNativeError(error);
|
|
135
135
|
});
|
|
136
136
|
},
|
|
137
|
-
queryPolicy: async (
|
|
137
|
+
queryPolicy: async () => {
|
|
138
138
|
if (pendingSendError) {
|
|
139
139
|
const error = pendingSendError;
|
|
140
140
|
pendingSendError = undefined;
|
|
141
141
|
throw error;
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
// The SDK is not a policy authority. Ensure the session is connected
|
|
144
|
+
// (surfacing any connect error), then defer: authoritative policy and
|
|
145
|
+
// approval are enforced server-side (gateway / runtime). The native shim
|
|
146
|
+
// no longer synthesizes a decision, so this always resolves neutral.
|
|
147
|
+
await getHandle();
|
|
148
|
+
return { denied: false, pending: false };
|
|
147
149
|
}
|
|
148
150
|
};
|
|
149
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/native/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/native/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAe7B,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAC7C,oCAAoC,CACrC,CAAC;AAMF,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AACjD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,GAAG,aAAa,CAAC;CAC/B;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,IAAI,GAAG,gBAAgB,CAAC;CAClC;AAED,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IACtC,IAAI,GAAG,kBAAkB,CAAC;CACpC;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,IAAI,GAAG,gBAAgB,CAAC;CAClC;AASD,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAClC,CAAC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KAAc,EAAE,EAAE;gBACxB,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;QACP,CAAC;QACD,WAAW,EAAE,KAAK,IAAI,EAAE;YACtB,IAAI,gBAAgB,EAAE,CAAC;gBACrB,MAAM,KAAK,GAAG,gBAAgB,CAAC;gBAC/B,gBAAgB,GAAG,SAAS,CAAC;gBAC7B,MAAM,KAAK,CAAC;YACd,CAAC;YAED,qEAAqE;YACrE,sEAAsE;YACtE,yEAAyE;YACzE,qEAAqE;YACrE,MAAM,SAAS,EAAE,CAAC;YAClB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-resolver.d.ts","sourceRoot":"","sources":["../../../src/core/gateway-resolver.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAC3D,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAClD,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,uDAAwD,CAAC;AAE1F;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAiC,GAC3C,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"gateway-resolver.d.ts","sourceRoot":"","sources":["../../../src/core/gateway-resolver.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAC3D,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file":"mastra.d.ts","sourceRoot":"","sources":["../../../src/hooks/mastra.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE;QACT,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;KACrD,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE;QACT,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;KACpD,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IACzE,eAAe,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IACxE,iBAAiB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAChD,oBAAoB,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACvD;AAED,eAAO,MAAM,gBAAgB,EAAE,gBAM9B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CACtD;AAYD,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"mastra.d.ts","sourceRoot":"","sources":["../../../src/hooks/mastra.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBA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,oBAAoB,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/native/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqBD,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,oBAAiB;CAC/B;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,uBAAoB;CAClC;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,yBAAsB;CACpC;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,uBAAoB;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAAC;IACjD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACzD;AAgED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAyF7E"}
|
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Handle to an active Agent Assembly session, wrapping the shared
|
|
5
|
+
* [`AssemblyClient`]. The inner `Arc` keeps napi calls cheap and lets the
|
|
6
|
+
* async `disconnect` move a clone onto a blocking task.
|
|
7
|
+
*/
|
|
3
8
|
export declare class ClientHandle {
|
|
4
9
|
|
|
5
10
|
}
|
|
6
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Connect to the `aa-runtime` Unix-domain socket and open a session.
|
|
14
|
+
*
|
|
15
|
+
* Socket resolution, the background IPC thread, and the wire codec are all
|
|
16
|
+
* delegated to `aa-sdk-client`; this shim only validates the argument and
|
|
17
|
+
* wraps the resulting client.
|
|
18
|
+
*/
|
|
7
19
|
export declare function connect(socketPath: string): Promise<ClientHandle>
|
|
8
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Shut down the session and join the background IPC thread.
|
|
23
|
+
*
|
|
24
|
+
* Idempotent — delegates to [`AssemblyClient::shutdown`], which blocks on the
|
|
25
|
+
* background-thread join, so it runs on a blocking task to keep the napi async
|
|
26
|
+
* runtime free.
|
|
27
|
+
*/
|
|
9
28
|
export declare function disconnect(handle: ClientHandle): Promise<void>
|
|
10
29
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Ship a captured event to the runtime.
|
|
32
|
+
*
|
|
33
|
+
* The JS event object is translated to the shared client's
|
|
34
|
+
* `(event_type, details)` shape and forwarded via
|
|
35
|
+
* [`AssemblyClient::report_event`]. Advisory preflight (inside the shared
|
|
36
|
+
* client) may redact locally; the runtime re-scans the event authoritatively
|
|
37
|
+
* regardless.
|
|
38
|
+
*/
|
|
19
39
|
export declare function sendEvent(handle: ClientHandle, event: any): void
|
|
20
|
-
|
|
21
|
-
export declare function setEventListener(handle: ClientHandle, callback: (arg: string) => void): void
|
|
22
|
-
|
|
23
|
-
export declare function socketPath(handle: ClientHandle): string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-assembly/sdk",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.7",
|
|
4
4
|
"description": "TypeScript SDK for Agent Assembly",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@eslint/js": "^10.0.1",
|
|
40
|
-
"@napi-rs/cli": "3.7.
|
|
40
|
+
"@napi-rs/cli": "3.7.1",
|
|
41
41
|
"@types/js-yaml": "^4.0.9",
|
|
42
42
|
"@types/node": "^25.9.1",
|
|
43
43
|
"@vitest/coverage-v8": "^2.1.8",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"nodejs"
|
|
60
60
|
],
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"@agent-assembly/runtime-darwin-arm64": "0.0.1-alpha.
|
|
63
|
-
"@agent-assembly/runtime-darwin-x64": "0.0.1-alpha.
|
|
64
|
-
"@agent-assembly/runtime-linux-arm64": "0.0.1-alpha.
|
|
65
|
-
"@agent-assembly/runtime-linux-x64": "0.0.1-alpha.
|
|
62
|
+
"@agent-assembly/runtime-darwin-arm64": "0.0.1-alpha.7",
|
|
63
|
+
"@agent-assembly/runtime-darwin-x64": "0.0.1-alpha.7",
|
|
64
|
+
"@agent-assembly/runtime-linux-arm64": "0.0.1-alpha.7",
|
|
65
|
+
"@agent-assembly/runtime-linux-x64": "0.0.1-alpha.7"
|
|
66
66
|
},
|
|
67
67
|
"files": [
|
|
68
68
|
"dist/",
|