@amalgm/agents 0.1.3 → 0.2.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/PURPOSE.md +25 -24
- package/README.md +19 -46
- package/dist/agents.d.ts +4 -26
- package/dist/agents.js +4 -87
- package/dist/bin/mcp.js +1 -1
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +2 -13
- package/dist/cli/open.d.ts +1 -1
- package/dist/cli/open.js +1 -5
- package/dist/cli/run.js +3 -8
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +0 -2
- package/dist/http/server.js +1 -7
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/mcp/agent-tools.js +1 -1
- package/dist/mcp/tools.js +1 -2
- package/dist/rows.d.ts +1 -4
- package/dist/rows.js +0 -39
- package/dist/schema.js +53 -101
- package/dist/types.d.ts +0 -106
- package/docs/ARCHITECTURE.md +21 -33
- package/docs/CLI.md +3 -43
- package/docs/DATA_MODEL.md +7 -46
- package/docs/DEFINITIONS.md +4 -4
- package/docs/ENGINE_INTEGRATION.md +22 -67
- package/docs/MCP.md +3 -19
- package/docs/REST.md +14 -97
- package/docs/SDK.md +12 -61
- package/docs/SECURITY.md +6 -35
- package/examples/basic.ts +8 -22
- package/package.json +2 -2
- package/skills/amalgm-agents/SKILL.md +3 -12
- package/skills/amalgm-agents/agents/openai.yaml +2 -2
- package/dist/cli/session-commands.d.ts +0 -4
- package/dist/cli/session-commands.js +0 -54
- package/dist/drivers.d.ts +0 -4
- package/dist/drivers.js +0 -25
- package/dist/event-store.d.ts +0 -13
- package/dist/event-store.js +0 -50
- package/dist/http/session-routes.d.ts +0 -2
- package/dist/http/session-routes.js +0 -67
- package/dist/http/stream.d.ts +0 -3
- package/dist/http/stream.js +0 -30
- package/dist/mcp/session-tools.d.ts +0 -3
- package/dist/mcp/session-tools.js +0 -81
- package/dist/messages.d.ts +0 -3
- package/dist/messages.js +0 -56
- package/dist/runtime.d.ts +0 -29
- package/dist/runtime.js +0 -176
- package/dist/session-store.d.ts +0 -15
- package/dist/session-store.js +0 -83
- package/dist/turn-store.d.ts +0 -31
- package/dist/turn-store.js +0 -164
- package/docs/DRIVERS.md +0 -72
package/docs/DRIVERS.md
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# Agent drivers
|
|
2
|
-
|
|
3
|
-
Drivers connect durable Agents state to a native or hosted runtime. They are
|
|
4
|
-
registered by the embedding process and selected by `definition.driver.id`.
|
|
5
|
-
|
|
6
|
-
```ts
|
|
7
|
-
import { defineDriver } from '@amalgm/agents';
|
|
8
|
-
|
|
9
|
-
export default defineDriver({
|
|
10
|
-
id: 'my-runtime',
|
|
11
|
-
async run(request, context) {
|
|
12
|
-
context.signal.throwIfAborted();
|
|
13
|
-
context.emit({ type: 'text.delta', data: { text: 'Working…' } });
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
driverSessionId: request.driverSessionId ?? 'native-session-id',
|
|
17
|
-
message: {
|
|
18
|
-
role: 'assistant',
|
|
19
|
-
parts: [{ type: 'text', text: 'Done.' }],
|
|
20
|
-
},
|
|
21
|
-
metadata: { provider: 'example' },
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Request
|
|
28
|
-
|
|
29
|
-
`DriverRunRequest` includes:
|
|
30
|
-
|
|
31
|
-
- the immutable `AgentRevision`;
|
|
32
|
-
- the durable session and current turn;
|
|
33
|
-
- ordered completed history before this turn;
|
|
34
|
-
- the accepted input; and
|
|
35
|
-
- the opaque `driverSessionId` returned by an earlier turn.
|
|
36
|
-
|
|
37
|
-
Drivers do not receive a database handle. They resolve Toolbox actions,
|
|
38
|
-
credentials, skills, files, and native processes through dependencies supplied
|
|
39
|
-
by their host.
|
|
40
|
-
|
|
41
|
-
## Events and results
|
|
42
|
-
|
|
43
|
-
Call `context.emit` for streaming or structured observations. The event is
|
|
44
|
-
committed before the call returns. Use type `message` with an assistant
|
|
45
|
-
`AgentMessage` for a durable output message; other event names are driver-owned
|
|
46
|
-
and their data must be JSON.
|
|
47
|
-
|
|
48
|
-
A final returned `message` is appended once before turn completion. Returned
|
|
49
|
-
`driverSessionId` replaces the prior opaque value for future continuation.
|
|
50
|
-
|
|
51
|
-
## Cancellation and limits
|
|
52
|
-
|
|
53
|
-
Drivers must observe `context.signal` and stop their underlying process or
|
|
54
|
-
request. The service records cancellation intent before aborting the signal.
|
|
55
|
-
Input and event sizes are bounded. A driver that emits invalid or oversized
|
|
56
|
-
data fails the turn explicitly.
|
|
57
|
-
|
|
58
|
-
The in-process boundary cannot forcibly kill an uncooperative driver. Process
|
|
59
|
-
drivers should own their child process and terminate it when signalled.
|
|
60
|
-
|
|
61
|
-
## Loading drivers in CLIs
|
|
62
|
-
|
|
63
|
-
Compile driver modules to JavaScript and export either an `AgentDriver`, a
|
|
64
|
-
`driver` value, or a zero-argument factory:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
AMALGM_AGENT_DRIVERS=./dist/codex-driver.js amalgm-agents-rest
|
|
68
|
-
amalgm-agents --drivers ./dist/codex-driver.js talk reviewer "Review this"
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Multiple modules are comma-separated. Secret values belong in the host's
|
|
72
|
-
credential resolver, not in agent definitions or driver module arguments.
|