@agentier/middleware 0.1.0 → 0.1.1
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 +29 -0
- package/package.json +12 -3
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @agentier/middleware
|
|
2
|
+
|
|
3
|
+
Built-in middleware for [agentier](https://github.com/itIsMaku/agentier) — log, retry, rate-limit, and cache.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @agentier/middleware @agentier/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createAgent } from '@agentier/core'
|
|
15
|
+
import { log, retry, rateLimit, cache } from '@agentier/middleware'
|
|
16
|
+
|
|
17
|
+
const agent = createAgent({
|
|
18
|
+
provider: myProvider,
|
|
19
|
+
middleware: [log(), retry({ maxRetries: 3 }), rateLimit({ maxRpm: 60 }), cache()],
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Documentation
|
|
24
|
+
|
|
25
|
+
Full docs and examples: [github.com/itIsMaku/agentier](https://github.com/itIsMaku/agentier)
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentier/middleware",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -10,8 +10,17 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
+
"description": "Built-in middleware for agentier — log, retry, rate-limit, cache",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/itIsMaku/agentier.git",
|
|
18
|
+
"directory": "packages/middleware"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/itIsMaku/agentier/tree/master/packages/middleware",
|
|
13
21
|
"files": [
|
|
14
|
-
"dist"
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md"
|
|
15
24
|
],
|
|
16
25
|
"scripts": {
|
|
17
26
|
"build": "bun build ./src/index.ts --outdir ./dist --target node",
|
|
@@ -19,7 +28,7 @@
|
|
|
19
28
|
"typecheck": "tsc --noEmit"
|
|
20
29
|
},
|
|
21
30
|
"peerDependencies": {
|
|
22
|
-
"@agentier/core": "^0.1.
|
|
31
|
+
"@agentier/core": "^0.1.1"
|
|
23
32
|
},
|
|
24
33
|
"devDependencies": {
|
|
25
34
|
"@agentier/core": "workspace:*",
|