@draht/agent-core 2026.3.2-7 → 2026.3.2-8
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 +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @draht/agent-core
|
|
2
2
|
|
|
3
|
-
Stateful agent with tool execution and event streaming. Built on `@
|
|
3
|
+
Stateful agent with tool execution and event streaming. Built on `@draht/ai`.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
bun add @draht/agent-core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Agent } from "@
|
|
15
|
-
import { getModel } from "@
|
|
14
|
+
import { Agent } from "@draht/agent-core";
|
|
15
|
+
import { getModel } from "@draht/ai";
|
|
16
16
|
|
|
17
17
|
const agent = new Agent({
|
|
18
18
|
initialState: {
|
|
@@ -293,7 +293,7 @@ Follow-up messages are checked only when there are no more tool calls and no ste
|
|
|
293
293
|
Extend `AgentMessage` via declaration merging:
|
|
294
294
|
|
|
295
295
|
```typescript
|
|
296
|
-
declare module "@
|
|
296
|
+
declare module "@draht/agent-core" {
|
|
297
297
|
interface CustomAgentMessages {
|
|
298
298
|
notification: { role: "notification"; text: string; timestamp: number };
|
|
299
299
|
}
|
|
@@ -365,7 +365,7 @@ Thrown errors are caught by the agent and reported to the LLM as tool errors wit
|
|
|
365
365
|
For browser apps that proxy through a backend:
|
|
366
366
|
|
|
367
367
|
```typescript
|
|
368
|
-
import { Agent, streamProxy } from "@
|
|
368
|
+
import { Agent, streamProxy } from "@draht/agent-core";
|
|
369
369
|
|
|
370
370
|
const agent = new Agent({
|
|
371
371
|
streamFn: (model, context, options) =>
|
|
@@ -382,7 +382,7 @@ const agent = new Agent({
|
|
|
382
382
|
For direct control without the Agent class:
|
|
383
383
|
|
|
384
384
|
```typescript
|
|
385
|
-
import { agentLoop, agentLoopContinue } from "@
|
|
385
|
+
import { agentLoop, agentLoopContinue } from "@draht/agent-core";
|
|
386
386
|
|
|
387
387
|
const context: AgentContext = {
|
|
388
388
|
systemPrompt: "You are helpful.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draht/agent-core",
|
|
3
|
-
"version": "2026.3.2-
|
|
3
|
+
"version": "2026.3.2-8",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prepublishOnly": "bun run clean && bun run build"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@draht/ai": "2026.3.2-
|
|
20
|
+
"@draht/ai": "2026.3.2-8"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"ai",
|