@falai/agent 0.6.5 → 0.6.6
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 +2 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CONTRIBUTING.md +3 -3
- package/docs/DOCS.md +4 -4
- package/docs/EXAMPLES.md +21 -22
- package/docs/PUBLISHING.md +15 -3
- package/examples/travel-agent.ts +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -351,8 +351,8 @@ MIT © 2025
|
|
|
351
351
|
|
|
352
352
|
**Made with ❤️ for the community**
|
|
353
353
|
|
|
354
|
-
[Report Bug](https://github.com/
|
|
354
|
+
[Report Bug](https://github.com/falai-dev/agent/issues) • [Request Feature](https://github.com/falai-dev/agent/issues) • [Contribute](https://github.com/falai-dev/agent/pulls)
|
|
355
355
|
|
|
356
|
-
⭐ Star us on [GitHub](https://github.com/
|
|
356
|
+
⭐ Star us on [GitHub](https://github.com/falai-dev/agent) if this helped you build amazing agents!
|
|
357
357
|
|
|
358
358
|
</div>
|
package/docs/ARCHITECTURE.md
CHANGED
package/docs/CONTRIBUTING.md
CHANGED
|
@@ -128,7 +128,7 @@ git clone https://github.com/YOUR_USERNAME/falai.git
|
|
|
128
128
|
cd falai
|
|
129
129
|
|
|
130
130
|
# Add upstream remote
|
|
131
|
-
git remote add upstream https://github.com/
|
|
131
|
+
git remote add upstream https://github.com/falai-dev/agent.git
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
### Install Dependencies
|
|
@@ -460,8 +460,8 @@ Closes #(issue number)
|
|
|
460
460
|
|
|
461
461
|
## Questions?
|
|
462
462
|
|
|
463
|
-
- 💬 Open a [Discussion](https://github.com/
|
|
464
|
-
- 🐛 Report an [Issue](https://github.com/
|
|
463
|
+
- 💬 Open a [Discussion](https://github.com/falai-dev/agent/discussions)
|
|
464
|
+
- 🐛 Report an [Issue](https://github.com/falai-dev/agent/issues)
|
|
465
465
|
- 📧 Email: (if you want to add your email)
|
|
466
466
|
|
|
467
467
|
---
|
package/docs/DOCS.md
CHANGED
|
@@ -245,9 +245,9 @@ All code examples are TypeScript and can be copy-pasted directly.
|
|
|
245
245
|
## 📱 External Resources
|
|
246
246
|
|
|
247
247
|
- **Main Website:** [falai.dev](https://falai.dev)
|
|
248
|
-
- **GitHub Repository:** [github.com/
|
|
248
|
+
- **GitHub Repository:** [github.com/falai-dev/agent](https://github.com/falai-dev/agent)
|
|
249
249
|
- **npm Package:** [@falai/agent](https://www.npmjs.com/package/@falai/agent)
|
|
250
|
-
- **Issue Tracker:** [GitHub Issues](https://github.com/
|
|
250
|
+
- **Issue Tracker:** [GitHub Issues](https://github.com/falai-dev/agent/issues)
|
|
251
251
|
|
|
252
252
|
---
|
|
253
253
|
|
|
@@ -255,8 +255,8 @@ All code examples are TypeScript and can be copy-pasted directly.
|
|
|
255
255
|
|
|
256
256
|
1. **Check the [main README](../README.md)** for an overview
|
|
257
257
|
2. **Browse [all examples](../examples/)** for code patterns
|
|
258
|
-
3. **Search [closed issues](https://github.com/
|
|
259
|
-
4. **Open a [new issue](https://github.com/
|
|
258
|
+
3. **Search [closed issues](https://github.com/falai-dev/agent/issues?q=is%3Aissue+is%3Aclosed)** for similar questions
|
|
259
|
+
4. **Open a [new issue](https://github.com/falai-dev/agent/issues/new)** with your question
|
|
260
260
|
|
|
261
261
|
---
|
|
262
262
|
|
package/docs/EXAMPLES.md
CHANGED
|
@@ -305,18 +305,15 @@ Tools that validate and enrich extracted data:
|
|
|
305
305
|
**Key concepts:** Data validation, enrichment, extractedUpdate, flags
|
|
306
306
|
|
|
307
307
|
```typescript
|
|
308
|
-
const validateEmail = defineTool(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
);
|
|
308
|
+
const validateEmail = defineTool("validate_email", async ({ extracted }) => {
|
|
309
|
+
const isValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(extracted.email);
|
|
310
|
+
return {
|
|
311
|
+
data: isValid,
|
|
312
|
+
extractedUpdate: {
|
|
313
|
+
emailValid: isValid, // Enrich extracted data
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
});
|
|
320
317
|
```
|
|
321
318
|
|
|
322
319
|
---
|
|
@@ -389,31 +386,33 @@ bun examples/travel-agent.ts
|
|
|
389
386
|
|
|
390
387
|
### Quick Reference
|
|
391
388
|
|
|
392
|
-
| Example
|
|
393
|
-
|
|
394
|
-
| Declarative Agent
|
|
395
|
-
| Travel Agent
|
|
396
|
-
| Business Onboarding | Complex flows
|
|
397
|
-
| Healthcare Agent
|
|
398
|
-
| Streaming Agent
|
|
399
|
-
| Domain Scoping
|
|
400
|
-
| Prisma Persistence
|
|
389
|
+
| Example | Best For | Key Features |
|
|
390
|
+
| ------------------- | --------------- | --------------------------- |
|
|
391
|
+
| Declarative Agent | Learning basics | Full API coverage |
|
|
392
|
+
| Travel Agent | Session state | Multi-turn conversations |
|
|
393
|
+
| Business Onboarding | Complex flows | Branching, lifecycle hooks |
|
|
394
|
+
| Healthcare Agent | Security | Data validation, compliance |
|
|
395
|
+
| Streaming Agent | Real-time UX | Streaming responses |
|
|
396
|
+
| Domain Scoping | Security | Tool isolation |
|
|
397
|
+
| Prisma Persistence | Production | Database integration |
|
|
401
398
|
|
|
402
399
|
---
|
|
403
400
|
|
|
404
401
|
## 💡 Tips
|
|
405
402
|
|
|
406
403
|
**For Production:**
|
|
404
|
+
|
|
407
405
|
- Use [Prisma Persistence](../examples/prisma-persistence.ts) for relational data
|
|
408
406
|
- Use [Redis Persistence](../examples/redis-persistence.ts) for high-throughput
|
|
409
407
|
- Implement [Domain Scoping](../examples/domain-scoping.ts) for security
|
|
410
408
|
- Add [Rules & Prohibitions](../examples/rules-prohibitions.ts) for brand consistency
|
|
411
409
|
|
|
412
410
|
**For Development:**
|
|
411
|
+
|
|
413
412
|
- Start with [Declarative Agent](../examples/declarative-agent.ts)
|
|
414
413
|
- Use [Streaming Agent](../examples/streaming-agent.ts) for better UX
|
|
415
414
|
- Check [Custom Database Integration](../examples/custom-database-persistence.ts) for existing schemas
|
|
416
415
|
|
|
417
416
|
---
|
|
418
417
|
|
|
419
|
-
**Need help?** Check the [full documentation](./README.md) or [open an issue](https://github.com/
|
|
418
|
+
**Need help?** Check the [full documentation](./README.md) or [open an issue](https://github.com/falai-dev/agent/issues).
|
package/docs/PUBLISHING.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Pre-publish Checklist
|
|
4
4
|
|
|
5
5
|
### 1. Build and Test
|
|
6
|
+
|
|
6
7
|
```bash
|
|
7
8
|
# Clean previous builds
|
|
8
9
|
rm -rf dist/
|
|
@@ -22,13 +23,15 @@ npm pack
|
|
|
22
23
|
### 2. Version Management
|
|
23
24
|
|
|
24
25
|
Update version in `package.json`:
|
|
26
|
+
|
|
25
27
|
```json
|
|
26
28
|
{
|
|
27
|
-
"version": "0.1.0"
|
|
29
|
+
"version": "0.1.0" // Follow semver: major.minor.patch
|
|
28
30
|
}
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
**Semver Guidelines:**
|
|
34
|
+
|
|
32
35
|
- **Patch** (0.1.X): Bug fixes, documentation updates
|
|
33
36
|
- **Minor** (0.X.0): New features, backwards compatible
|
|
34
37
|
- **Major** (X.0.0): Breaking changes
|
|
@@ -44,6 +47,7 @@ npm pack --dry-run
|
|
|
44
47
|
```
|
|
45
48
|
|
|
46
49
|
Should include:
|
|
50
|
+
|
|
47
51
|
- ✅ `dist/` - Compiled JavaScript + type definitions
|
|
48
52
|
- ✅ `docs/` - Documentation
|
|
49
53
|
- ✅ `examples/` - Example files
|
|
@@ -51,6 +55,7 @@ Should include:
|
|
|
51
55
|
- ✅ `LICENSE` - MIT license
|
|
52
56
|
|
|
53
57
|
Should NOT include:
|
|
58
|
+
|
|
54
59
|
- ❌ `src/*.ts` source files (only .d.ts)
|
|
55
60
|
- ❌ `node_modules/`
|
|
56
61
|
- ❌ Development configs
|
|
@@ -99,11 +104,13 @@ npm view @falai/agent
|
|
|
99
104
|
## Post-Publish
|
|
100
105
|
|
|
101
106
|
1. **Update GitHub Release**
|
|
102
|
-
|
|
107
|
+
|
|
108
|
+
- Go to https://github.com/falai-dev/agent/releases
|
|
103
109
|
- Create a new release for the tag
|
|
104
110
|
- Add release notes
|
|
105
111
|
|
|
106
112
|
2. **Verify Installation**
|
|
113
|
+
|
|
107
114
|
```bash
|
|
108
115
|
# In a new project
|
|
109
116
|
npm install @falai/agent
|
|
@@ -112,12 +119,13 @@ npm view @falai/agent
|
|
|
112
119
|
```
|
|
113
120
|
|
|
114
121
|
3. **Test the Published Package**
|
|
122
|
+
|
|
115
123
|
```bash
|
|
116
124
|
# Create test project
|
|
117
125
|
mkdir test-agent && cd test-agent
|
|
118
126
|
bun init -y
|
|
119
127
|
bun add @falai/agent
|
|
120
|
-
|
|
128
|
+
|
|
121
129
|
# Try importing
|
|
122
130
|
echo 'import { Agent } from "@falai/agent"; console.log(Agent);' > test.ts
|
|
123
131
|
bun run test.ts
|
|
@@ -126,20 +134,24 @@ npm view @falai/agent
|
|
|
126
134
|
## Troubleshooting
|
|
127
135
|
|
|
128
136
|
### "You do not have permission to publish"
|
|
137
|
+
|
|
129
138
|
- Make sure you're logged in: `npm whoami`
|
|
130
139
|
- Verify you have access to the `@falai` scope
|
|
131
140
|
- Contact scope owner if needed
|
|
132
141
|
|
|
133
142
|
### "Package already exists"
|
|
143
|
+
|
|
134
144
|
- You can't republish the same version
|
|
135
145
|
- Bump version in `package.json` and try again
|
|
136
146
|
|
|
137
147
|
### "Missing required files"
|
|
148
|
+
|
|
138
149
|
- Check `package.json` `files` field
|
|
139
150
|
- Ensure `dist/` exists after build
|
|
140
151
|
- Run `npm pack --dry-run` to preview
|
|
141
152
|
|
|
142
153
|
### Types not working
|
|
154
|
+
|
|
143
155
|
- Verify `types` field in `package.json`
|
|
144
156
|
- Ensure `.d.ts` files are in `dist/`
|
|
145
157
|
- Check `tsconfig.json` has `"declaration": true`
|
package/examples/travel-agent.ts
CHANGED
|
@@ -182,7 +182,7 @@ async function createTravelAgent() {
|
|
|
182
182
|
apiKey: process.env.OPENROUTER_API_KEY || "test-key",
|
|
183
183
|
model: "google/gemini-2.0-flash-exp",
|
|
184
184
|
backupModels: ["anthropic/claude-sonnet-4-5", "openai/gpt-5"],
|
|
185
|
-
siteUrl: "https://github.com/
|
|
185
|
+
siteUrl: "https://github.com/falai-dev/agent",
|
|
186
186
|
siteName: "Falai Travel Agent Example",
|
|
187
187
|
retryConfig: {
|
|
188
188
|
timeout: 60000,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@falai/agent",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Standalone, strongly-typed AI Agent framework with route DSL and AI provider strategy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "https://github.com/
|
|
34
|
+
"url": "https://github.com/falai-dev/agent.git"
|
|
35
35
|
},
|
|
36
36
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/
|
|
37
|
+
"url": "https://github.com/falai-dev/agent/issues"
|
|
38
38
|
},
|
|
39
|
-
"homepage": "https://github.com/
|
|
39
|
+
"homepage": "https://github.com/falai-dev/agent#readme",
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "npm run build:esm && npm run build:cjs && npm run fix:cjs",
|
|
42
42
|
"build:esm": "tsc",
|