@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.
Files changed (55) hide show
  1. package/PURPOSE.md +25 -24
  2. package/README.md +19 -46
  3. package/dist/agents.d.ts +4 -26
  4. package/dist/agents.js +4 -87
  5. package/dist/bin/mcp.js +1 -1
  6. package/dist/cli/help.d.ts +1 -1
  7. package/dist/cli/help.js +2 -13
  8. package/dist/cli/open.d.ts +1 -1
  9. package/dist/cli/open.js +1 -5
  10. package/dist/cli/run.js +3 -8
  11. package/dist/errors.d.ts +1 -1
  12. package/dist/errors.js +0 -2
  13. package/dist/http/server.js +1 -7
  14. package/dist/index.d.ts +0 -2
  15. package/dist/index.js +0 -2
  16. package/dist/mcp/agent-tools.js +1 -1
  17. package/dist/mcp/tools.js +1 -2
  18. package/dist/rows.d.ts +1 -4
  19. package/dist/rows.js +0 -39
  20. package/dist/schema.js +53 -101
  21. package/dist/types.d.ts +0 -106
  22. package/docs/ARCHITECTURE.md +21 -33
  23. package/docs/CLI.md +3 -43
  24. package/docs/DATA_MODEL.md +7 -46
  25. package/docs/DEFINITIONS.md +4 -4
  26. package/docs/ENGINE_INTEGRATION.md +22 -67
  27. package/docs/MCP.md +3 -19
  28. package/docs/REST.md +14 -97
  29. package/docs/SDK.md +12 -61
  30. package/docs/SECURITY.md +6 -35
  31. package/examples/basic.ts +8 -22
  32. package/package.json +2 -2
  33. package/skills/amalgm-agents/SKILL.md +3 -12
  34. package/skills/amalgm-agents/agents/openai.yaml +2 -2
  35. package/dist/cli/session-commands.d.ts +0 -4
  36. package/dist/cli/session-commands.js +0 -54
  37. package/dist/drivers.d.ts +0 -4
  38. package/dist/drivers.js +0 -25
  39. package/dist/event-store.d.ts +0 -13
  40. package/dist/event-store.js +0 -50
  41. package/dist/http/session-routes.d.ts +0 -2
  42. package/dist/http/session-routes.js +0 -67
  43. package/dist/http/stream.d.ts +0 -3
  44. package/dist/http/stream.js +0 -30
  45. package/dist/mcp/session-tools.d.ts +0 -3
  46. package/dist/mcp/session-tools.js +0 -81
  47. package/dist/messages.d.ts +0 -3
  48. package/dist/messages.js +0 -56
  49. package/dist/runtime.d.ts +0 -29
  50. package/dist/runtime.js +0 -176
  51. package/dist/session-store.d.ts +0 -15
  52. package/dist/session-store.js +0 -83
  53. package/dist/turn-store.d.ts +0 -31
  54. package/dist/turn-store.js +0 -164
  55. 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.