@falai/agent 0.3.24 → 0.3.25
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/docs/STRUCTURE.md +33 -7
- package/package.json +1 -1
package/docs/STRUCTURE.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
```
|
|
4
4
|
src/
|
|
5
5
|
├── types/ # Type definitions (interfaces, types, enums)
|
|
6
|
+
│ ├── agent.ts # Agent types and configuration
|
|
7
|
+
│ ├── ai.ts # AI provider interfaces
|
|
8
|
+
│ ├── history.ts # Event and message history types
|
|
9
|
+
│ ├── observation.ts # Observation and disambiguation types
|
|
10
|
+
│ ├── persistence.ts # Persistence adapter interfaces
|
|
11
|
+
│ ├── prompt.ts # Prompt building types
|
|
12
|
+
│ ├── route.ts # Route and state types
|
|
13
|
+
│ ├── tool.ts # Tool definition types
|
|
14
|
+
│ └── index.ts # Type exports
|
|
6
15
|
├── core/ # Core framework classes
|
|
7
16
|
│ ├── Agent.ts # Main agent class
|
|
8
17
|
│ ├── Route.ts # Route/Journey DSL
|
|
@@ -12,13 +21,28 @@ src/
|
|
|
12
21
|
│ ├── Tool.ts # Tool definitions
|
|
13
22
|
│ ├── PromptBuilder.ts # Prompt construction
|
|
14
23
|
│ ├── Events.ts # Event history
|
|
15
|
-
│
|
|
24
|
+
│ ├── DomainRegistry.ts # Domain organization
|
|
25
|
+
│ └── PersistenceManager.ts # Persistence lifecycle management
|
|
16
26
|
├── providers/ # AI provider implementations
|
|
17
|
-
│
|
|
27
|
+
│ ├── AnthropicProvider.ts # Claude (Anthropic)
|
|
28
|
+
│ ├── GeminiProvider.ts # Google Gemini
|
|
29
|
+
│ ├── OpenAIProvider.ts # OpenAI GPT
|
|
30
|
+
│ ├── OpenRouterProvider.ts # OpenRouter (200+ models)
|
|
31
|
+
│ └── index.ts # Provider exports
|
|
32
|
+
├── adapters/ # Database persistence adapters
|
|
33
|
+
│ ├── MemoryAdapter.ts # In-memory (testing/dev)
|
|
34
|
+
│ ├── PrismaAdapter.ts # Prisma ORM
|
|
35
|
+
│ ├── RedisAdapter.ts # Redis
|
|
36
|
+
│ ├── MongoAdapter.ts # MongoDB
|
|
37
|
+
│ ├── PostgreSQLAdapter.ts # PostgreSQL
|
|
38
|
+
│ ├── SQLiteAdapter.ts # SQLite
|
|
39
|
+
│ ├── OpenSearchAdapter.ts # OpenSearch/Elasticsearch
|
|
40
|
+
│ └── index.ts # Adapter exports
|
|
18
41
|
├── utils/ # Utility functions
|
|
19
|
-
│
|
|
42
|
+
│ ├── retry.ts # Retry/timeout logic
|
|
43
|
+
│ └── id.ts # Deterministic ID generation
|
|
20
44
|
├── constants/ # Constants and symbols
|
|
21
|
-
│ └── index.ts # END_ROUTE, etc.
|
|
45
|
+
│ └── index.ts # END_ROUTE, EventSource, etc.
|
|
22
46
|
└── index.ts # Public API exports
|
|
23
47
|
```
|
|
24
48
|
|
|
@@ -27,6 +51,8 @@ src/
|
|
|
27
51
|
1. **Flat, organized structure** - Clear separation by purpose
|
|
28
52
|
2. **Types-first** - All types in dedicated folder
|
|
29
53
|
3. **Core logic isolated** - Business logic in \`core/\`
|
|
30
|
-
4. **Provider pattern** - Pluggable AI backends
|
|
31
|
-
5. **
|
|
32
|
-
6. **
|
|
54
|
+
4. **Provider pattern** - Pluggable AI backends and database adapters
|
|
55
|
+
5. **Optional persistence** - Multiple database adapters following the same pattern
|
|
56
|
+
6. **Extensibility** - Easy to add new providers, adapters, and tools
|
|
57
|
+
7. **Path aliases** - Clean imports with \`@/types\`, \`@/core\`, etc.
|
|
58
|
+
8. **Fluent API** - Methods return \`this\` for chaining
|