framework-agents 0.0.0-stage → 0.1.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/README.md +92 -2
- package/dist/agent-25ZNQBEB.js +6 -0
- package/dist/agent-ZWGIDKF6.js +7 -0
- package/dist/agent-ZWGIDKF6.js.map +1 -0
- package/dist/chunk-77OZE2QD.js +1811 -0
- package/dist/chunk-77OZE2QD.js.map +1 -0
- package/dist/chunk-LUGUQQLR.js +1033 -0
- package/dist/cli.js +1209 -0
- package/dist/index.d.ts +2842 -0
- package/dist/index.js +3951 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -4
package/README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# framework-agents (TypeScript)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core of the agentic platform. See `/docs` in the monorepo root for vision, architecture, and roadmap.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
├── index.ts <- public API (only import from here)
|
|
10
|
+
├── types/ <- shared branded types, result/error envelopes
|
|
11
|
+
├── agent/ <- Agent loop, state, history, sessions, snapshots
|
|
12
|
+
├── state/ <- AgentState (KV) + ToolContext + InvocationState
|
|
13
|
+
├── conversation/ <- Null/SlidingWindow/Summarizing managers
|
|
14
|
+
├── sessions/ <- Storage backends + SessionManager + snapshots
|
|
15
|
+
├── swarm/ <- autonomous handoffs + shared context + safety
|
|
16
|
+
├── a2a/ <- A2A client/server interop
|
|
17
|
+
├── tools/ <- Tool interface + registry + zod validation
|
|
18
|
+
├── memory/ <- Memory interface + in-memory store + compaction.ts
|
|
19
|
+
├── models/ <- ModelProvider + OpenAI-compatible + Anthropic + Ollama + initChatModel
|
|
20
|
+
├── checkpoint/ <- FileCheckpointer + withFileLock (local-first durability)
|
|
21
|
+
├── skills/ <- SKILL.md parse/registry + discover + match
|
|
22
|
+
├── mcp/ <- MCP clients (HTTP/stdio) + tools bridge
|
|
23
|
+
├── prompts/ <- versioned prompt templates + render
|
|
24
|
+
├── structured/ <- responseFormat (tool/provider strategies)
|
|
25
|
+
├── streaming/ <- StreamEvent + collectStream
|
|
26
|
+
├── middleware/ <- hooks + 15 prebuilt (retry/fallback/limits/HITL/PII/summary/todos/fs/subagents…)
|
|
27
|
+
├── semantic/ <- GraphStore + InMemoryGraphStore (entailment in P0-sem/P1-sem)
|
|
28
|
+
├── orchestration/ <- sequential / parallel / router multi-agent
|
|
29
|
+
├── runtime/ <- run with timeout / cancellation / budgets
|
|
30
|
+
├── workflows/ <- DAG workflows (topo levels, retry)
|
|
31
|
+
├── observability/ <- event emitter + logger hooks
|
|
32
|
+
└── utils/ <- abort, retry, tokens helpers
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Scripts
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pnpm build
|
|
39
|
+
pnpm test
|
|
40
|
+
pnpm lint
|
|
41
|
+
pnpm typecheck
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Serve (`framework.json` + CLI)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm build
|
|
48
|
+
./dist/cli.js validate -c ../../framework.json
|
|
49
|
+
./dist/cli.js dev -c ../../framework.json --port 8484
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"server": { "host": "127.0.0.1", "basePort": 8484 },
|
|
55
|
+
"envFile": "./.env",
|
|
56
|
+
"env": { "FRAMEWORK_ENV": "production" },
|
|
57
|
+
"checkpointer": { "dir": "./checkpoints" },
|
|
58
|
+
"http": { "corsOrigins": ["http://localhost:3000"] },
|
|
59
|
+
"agents": [
|
|
60
|
+
{ "name": "helper", "model": "together:Qwen/Qwen3.5-9B", "skills": ["./skills"] },
|
|
61
|
+
{ "file": "./agents/local.json", "port": 8485 }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Agent entries are inline or `{ "file": "./agents/x.json" }` (+ inline overrides).
|
|
67
|
+
Relative paths in agent files resolve against their own dir; overrides against
|
|
68
|
+
`framework.json`. Env precedence: process < framework `envFile` < `env{}` <
|
|
69
|
+
per-agent `envFile`. Served agents get durable HITL threads (`threadId` =
|
|
70
|
+
context id), health (`/ok`), CORS, and per-context isolation.
|
|
71
|
+
|
|
72
|
+
## Minimal usage
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { Agent, InMemoryMemory, MockModelProvider, defineTool } from "framework-agents";
|
|
76
|
+
import { z } from "zod";
|
|
77
|
+
|
|
78
|
+
const getTime = defineTool({
|
|
79
|
+
name: "get_time",
|
|
80
|
+
description: "Returns current ISO time",
|
|
81
|
+
schema: z.object({}),
|
|
82
|
+
execute: async () => ({ time: new Date().toISOString() }),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const agent = new Agent({
|
|
86
|
+
model: new MockModelProvider(),
|
|
87
|
+
tools: [getTime],
|
|
88
|
+
memory: new InMemoryMemory(),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const result = await agent.run("What time is it?");
|
|
92
|
+
console.log(result.text);
|
|
93
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|