@poolzin/pool-bot 2026.3.11 → 2026.3.13
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/CHANGELOG.md +34 -0
- package/dist/.buildstamp +1 -1
- package/dist/build-info.json +3 -3
- package/docs/refactor/plugin-development-guide.md +281 -0
- package/extensions/hexstrike-bridge/package.json +1 -1
- package/extensions/hexstrike-bridge/poolbot.plugin.json +23 -0
- package/extensions/mcp-server/poolbot.plugin.json +10 -0
- package/extensions/template/README.md +101 -0
- package/extensions/template/index.ts +38 -0
- package/extensions/template/package.json +15 -0
- package/extensions/template/poolbot.plugin.json +10 -0
- package/package.json +1 -1
- package/extensions/mavalie/README.md +0 -97
- package/extensions/mavalie/package.json +0 -15
- package/extensions/mavalie/src/index.ts +0 -62
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
## v2026.3.13 (2026-03-13)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
- **Plugin Development Guide:** comprehensive documentation at `docs/refactor/plugin-development-guide.md`
|
|
5
|
+
- Quick start tutorial from template
|
|
6
|
+
- Extension types (tools, providers, channels, hooks)
|
|
7
|
+
- Configuration schema examples
|
|
8
|
+
- Troubleshooting common errors
|
|
9
|
+
|
|
10
|
+
### Fixes
|
|
11
|
+
- **Plugin Template:** renamed `mavalie` → `template` with proper structure
|
|
12
|
+
- Fixed entry point path (`./index.ts` instead of `./src/index.ts`)
|
|
13
|
+
- Added required `poolbot.plugin.json` manifest
|
|
14
|
+
- Updated all metadata (id, name, description)
|
|
15
|
+
- Added `label` property to tool examples (required field)
|
|
16
|
+
- **Missing Manifests:** added `poolbot.plugin.json` to `mcp-server` and `hexstrike-bridge`
|
|
17
|
+
- Fixes "plugin manifest not found" doctor errors
|
|
18
|
+
- Fixes "extension entry escapes package directory" errors
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## v2026.3.12 (2026-03-12)
|
|
23
|
+
|
|
24
|
+
### Fixes
|
|
25
|
+
- **Plugin Template:** renamed `mavalie` → `template` with proper structure
|
|
26
|
+
- Fixed entry point path (`./index.ts` instead of `./src/index.ts`)
|
|
27
|
+
- Added required `poolbot.plugin.json` manifest
|
|
28
|
+
- Updated all metadata (id, name, description)
|
|
29
|
+
- **Missing Manifests:** added `poolbot.plugin.json` to `mcp-server` and `hexstrike-bridge`
|
|
30
|
+
- Fixes "plugin manifest not found" doctor errors
|
|
31
|
+
- Fixes "extension entry escapes package directory" errors
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
1
35
|
## v2026.3.11 (2026-03-11)
|
|
2
36
|
|
|
3
37
|
### Features
|
package/dist/.buildstamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1773200810931
|
package/dist/build-info.json
CHANGED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Plugin Development Guide
|
|
2
|
+
|
|
3
|
+
Complete guide for creating PoolBot plugins using the template scaffold.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Create from Template
|
|
8
|
+
|
|
9
|
+
Copy the template to a new plugin directory:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cp -r extensions/template extensions/my-plugin
|
|
13
|
+
cd extensions/my-plugin
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. Update Package Info
|
|
17
|
+
|
|
18
|
+
Edit `package.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"name": "@poolzin/my-plugin",
|
|
23
|
+
"version": "2026.3.12",
|
|
24
|
+
"description": "My custom PoolBot plugin"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 3. Update Plugin Manifest
|
|
29
|
+
|
|
30
|
+
Edit `poolbot.plugin.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"id": "my-plugin",
|
|
35
|
+
"name": "My Plugin",
|
|
36
|
+
"description": "What my plugin does.",
|
|
37
|
+
"configSchema": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"apiKey": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "API key for external service"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 4. Implement Plugin
|
|
50
|
+
|
|
51
|
+
Edit `index.ts`:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import type { PoolBotPluginApi } from "../../src/plugins/types.js";
|
|
55
|
+
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
|
56
|
+
|
|
57
|
+
export default function register(api: PoolBotPluginApi) {
|
|
58
|
+
// Register tools, providers, channels, or hooks
|
|
59
|
+
api.registerTool({
|
|
60
|
+
label: "My Tool",
|
|
61
|
+
name: "my_tool",
|
|
62
|
+
description: "Does something useful",
|
|
63
|
+
parameters: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
input: { type: "string" }
|
|
67
|
+
},
|
|
68
|
+
required: ["input"]
|
|
69
|
+
},
|
|
70
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<unknown>> {
|
|
71
|
+
const { input } = params as { input: string };
|
|
72
|
+
return {
|
|
73
|
+
content: [{ type: "text", text: `Processed: ${input}` }],
|
|
74
|
+
details: { input }
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 5. Test Locally
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Build
|
|
85
|
+
pnpm build
|
|
86
|
+
|
|
87
|
+
# Lint
|
|
88
|
+
pnpm lint
|
|
89
|
+
|
|
90
|
+
# Run PoolBot with plugin
|
|
91
|
+
pnpm dev
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 6. Publish (Optional)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
cd extensions/my-plugin
|
|
98
|
+
npm publish --access public
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Plugin Structure
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
extensions/my-plugin/
|
|
105
|
+
├── package.json # npm manifest
|
|
106
|
+
├── poolbot.plugin.json # Plugin manifest (required)
|
|
107
|
+
├── index.ts # Entry point (root level)
|
|
108
|
+
└── README.md # Documentation
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Extension Types
|
|
112
|
+
|
|
113
|
+
### Tools
|
|
114
|
+
|
|
115
|
+
Add capabilities that agents can use:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
api.registerTool({
|
|
119
|
+
label: "Weather",
|
|
120
|
+
name: "weather_lookup",
|
|
121
|
+
description: "Get current weather for a location",
|
|
122
|
+
parameters: {
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
city: { type: "string" }
|
|
126
|
+
},
|
|
127
|
+
required: ["city"]
|
|
128
|
+
},
|
|
129
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<unknown>> {
|
|
130
|
+
const { city } = params as { city: string };
|
|
131
|
+
// Call weather API
|
|
132
|
+
return {
|
|
133
|
+
content: [{ type: "text", text: `Weather in ${city}: ...` }],
|
|
134
|
+
details: { city, temperature: 72 }
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Providers
|
|
141
|
+
|
|
142
|
+
Add custom LLM model providers:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
api.registerProvider({
|
|
146
|
+
id: "my-provider",
|
|
147
|
+
name: "My Provider",
|
|
148
|
+
// ... provider config
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Channels
|
|
153
|
+
|
|
154
|
+
Add messaging channel integrations:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
api.registerChannel({
|
|
158
|
+
id: "my-channel",
|
|
159
|
+
name: "My Channel",
|
|
160
|
+
// ... channel implementation
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Hooks
|
|
165
|
+
|
|
166
|
+
Intercept lifecycle events:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
api.on("before_model_resolve", async (ctx) => {
|
|
170
|
+
// Modify context before model selection
|
|
171
|
+
});
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Configuration Schema
|
|
175
|
+
|
|
176
|
+
The `configSchema` in `poolbot.plugin.json` defines user-configurable settings:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"configSchema": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"properties": {
|
|
183
|
+
"apiKey": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"description": "API authentication key"
|
|
186
|
+
},
|
|
187
|
+
"endpoint": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"default": "https://api.example.com",
|
|
190
|
+
"description": "API endpoint URL"
|
|
191
|
+
},
|
|
192
|
+
"timeout": {
|
|
193
|
+
"type": "number",
|
|
194
|
+
"default": 5000,
|
|
195
|
+
"description": "Request timeout in milliseconds"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"required": ["apiKey"]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Access config in your plugin:
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
export default function register(api: PoolBotPluginApi) {
|
|
207
|
+
const config = api.pluginConfig as { apiKey: string; endpoint?: string };
|
|
208
|
+
const endpoint = config.endpoint ?? "https://api.example.com";
|
|
209
|
+
// Use config.apiKey...
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Testing Your Plugin
|
|
214
|
+
|
|
215
|
+
### Local Testing
|
|
216
|
+
|
|
217
|
+
1. Place plugin in `extensions/my-plugin/`
|
|
218
|
+
2. Ensure `poolbot.extensions` in root `package.json` includes the path
|
|
219
|
+
3. Run `pnpm build` and `pnpm dev`
|
|
220
|
+
4. Test with `poolbot doctor` to verify loading
|
|
221
|
+
|
|
222
|
+
### Test Plugin Available
|
|
223
|
+
|
|
224
|
+
Use the published test plugin as a reference:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm install @poolzin/test-plugin
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
This plugin provides:
|
|
231
|
+
- `test_echo` - Echo tool for validation
|
|
232
|
+
- `test_validate` - Plugin status checker
|
|
233
|
+
|
|
234
|
+
## Troubleshooting
|
|
235
|
+
|
|
236
|
+
### "plugin manifest not found"
|
|
237
|
+
|
|
238
|
+
- Check if `poolbot.plugin.json` exists in plugin root
|
|
239
|
+
- Verify JSON is valid
|
|
240
|
+
|
|
241
|
+
### "extension entry escapes package directory"
|
|
242
|
+
|
|
243
|
+
- Entry point in `package.json` must use relative path: `"./index.ts"`
|
|
244
|
+
- File must be inside plugin directory
|
|
245
|
+
|
|
246
|
+
### TypeScript Errors
|
|
247
|
+
|
|
248
|
+
- Use `import type { PoolBotPluginApi } from "../../src/plugins/types.js"`
|
|
249
|
+
- Note the capital `B` in `PoolBotPluginApi`
|
|
250
|
+
- Tool `label` property is required
|
|
251
|
+
- Tool `execute` must return `Promise<AgentToolResult<unknown>>`
|
|
252
|
+
|
|
253
|
+
### Tool Not Appearing
|
|
254
|
+
|
|
255
|
+
- Verify tool has `label`, `name`, `description`, `parameters`, and `execute`
|
|
256
|
+
- Check that `parameters` follows JSON Schema format
|
|
257
|
+
- Ensure `execute` returns correct `AgentToolResult` structure
|
|
258
|
+
|
|
259
|
+
## Best Practices
|
|
260
|
+
|
|
261
|
+
1. **Use TypeScript** - Full type safety for better DX
|
|
262
|
+
2. **Add Labels** - Every tool needs a `label` for display
|
|
263
|
+
3. **Validate Input** - Check parameters before processing
|
|
264
|
+
4. **Return Proper Results** - Use `AgentToolResult` structure
|
|
265
|
+
5. **Document Config** - Describe all config options in schema
|
|
266
|
+
6. **Handle Errors** - Throw descriptive errors for invalid input
|
|
267
|
+
7. **Test Thoroughly** - Test with `poolbot doctor` before publishing
|
|
268
|
+
|
|
269
|
+
## Examples
|
|
270
|
+
|
|
271
|
+
See working examples in the repository:
|
|
272
|
+
|
|
273
|
+
- `extensions/template/` - Minimal starter template
|
|
274
|
+
- `extensions/test-plugin/` - Working example with tools
|
|
275
|
+
- `extensions/lobster/` - Complex plugin with multiple features
|
|
276
|
+
- `extensions/llm-task/` - Provider plugin example
|
|
277
|
+
|
|
278
|
+
## References
|
|
279
|
+
|
|
280
|
+
- [Plugin SDK Documentation](plugin-sdk.md)
|
|
281
|
+
- [Test Plugin on npm](https://www.npmjs.com/package/@poolzin/test-plugin)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "hexstrike-bridge",
|
|
3
|
+
"name": "HexStrike Security Bridge",
|
|
4
|
+
"description": "Integrates HexStrike AI security tools (150+ scanners).",
|
|
5
|
+
"configSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"baseUrl": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "http://localhost:8888"
|
|
12
|
+
},
|
|
13
|
+
"timeoutMs": {
|
|
14
|
+
"type": "number",
|
|
15
|
+
"default": 300000
|
|
16
|
+
},
|
|
17
|
+
"maxConcurrentScans": {
|
|
18
|
+
"type": "number",
|
|
19
|
+
"default": 3
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Template Plugin for PoolBot
|
|
2
|
+
|
|
3
|
+
Starter template for creating custom PoolBot plugins.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
extensions/template/
|
|
9
|
+
├── package.json # npm manifest
|
|
10
|
+
├── poolbot.plugin.json # Plugin manifest (required)
|
|
11
|
+
├── index.ts # Entry point (root level)
|
|
12
|
+
└── README.md # Documentation
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
The plugin loads automatically when:
|
|
18
|
+
- Directory is in `extensions/template/`
|
|
19
|
+
- `package.json` has `poolbot.extensions` configured
|
|
20
|
+
- `poolbot.plugin.json` exists in plugin root
|
|
21
|
+
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
The plugin uses an empty schema (`configSchema` with `additionalProperties: false`), meaning no initial configuration is required.
|
|
25
|
+
|
|
26
|
+
To add settings, update `poolbot.plugin.json`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"id": "template",
|
|
31
|
+
"name": "Template",
|
|
32
|
+
"description": "My custom PoolBot plugin.",
|
|
33
|
+
"configSchema": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"apiKey": { "type": "string" },
|
|
37
|
+
"endpoint": { "type": "string", "default": "https://api.example.com" }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Development
|
|
44
|
+
|
|
45
|
+
### Extension Types
|
|
46
|
+
|
|
47
|
+
PoolBot supports 4 extension types via `PoolBotPluginApi`:
|
|
48
|
+
|
|
49
|
+
1. **Tool** - Add agent tools (`api.registerTool()`)
|
|
50
|
+
2. **Provider** - Add custom LLM models (`api.registerProvider()`)
|
|
51
|
+
3. **Channel** - Add messaging channels (`api.registerChannel()`)
|
|
52
|
+
4. **Hook** - Intercept lifecycle events (`api.registerHook()`)
|
|
53
|
+
|
|
54
|
+
### Example: Registering a Tool
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import type { PoolBotPluginApi } from "../../src/plugins/types.js";
|
|
58
|
+
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
|
59
|
+
|
|
60
|
+
export default function register(api: PoolBotPluginApi) {
|
|
61
|
+
api.registerTool({
|
|
62
|
+
label: "My Search", // Display name for the tool
|
|
63
|
+
name: "my_search", // Tool identifier (snake_case)
|
|
64
|
+
description: "Search using custom API",
|
|
65
|
+
parameters: {
|
|
66
|
+
type: "object",
|
|
67
|
+
properties: {
|
|
68
|
+
query: { type: "string" }
|
|
69
|
+
},
|
|
70
|
+
required: ["query"]
|
|
71
|
+
},
|
|
72
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<unknown>> {
|
|
73
|
+
const { query } = params as { query: string };
|
|
74
|
+
// Implementation here
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text", text: JSON.stringify({ results: [] }) }],
|
|
77
|
+
details: { query }
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Troubleshooting
|
|
85
|
+
|
|
86
|
+
### "plugin manifest not found"
|
|
87
|
+
- Check if `poolbot.plugin.json` exists in plugin root
|
|
88
|
+
- Verify JSON is valid
|
|
89
|
+
|
|
90
|
+
### "extension entry escapes package directory"
|
|
91
|
+
- Entry point in `package.json` must use relative path: `"./index.ts"`
|
|
92
|
+
- File must be inside plugin directory
|
|
93
|
+
|
|
94
|
+
### TypeScript Errors
|
|
95
|
+
- Use `import type { PoolBotPluginApi } from "../../src/plugins/types.js"`
|
|
96
|
+
- Note the capital `B` in `PoolBotPluginApi`
|
|
97
|
+
|
|
98
|
+
## References
|
|
99
|
+
|
|
100
|
+
- [Plugin SDK Documentation](../../docs/refactor/plugin-sdk.md)
|
|
101
|
+
- [Example Plugins](../lobster/, ../llm-task/, etc.)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PoolBotPluginApi } from "../../src/plugins/types.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Template Plugin for PoolBot
|
|
5
|
+
*
|
|
6
|
+
* Starter template for creating custom PoolBot plugins.
|
|
7
|
+
* This plugin can be expanded with custom tools, providers, channels, or hooks.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export default function register(_api: PoolBotPluginApi) {
|
|
11
|
+
// Plugin registered successfully
|
|
12
|
+
// TODO: Add here:
|
|
13
|
+
// - Tools (agent tools)
|
|
14
|
+
// - Providers (custom LLM models)
|
|
15
|
+
// - Channels (messaging integrations)
|
|
16
|
+
// - Hooks (lifecycle events)
|
|
17
|
+
|
|
18
|
+
// Example: Register a simple tool
|
|
19
|
+
// api.registerTool({
|
|
20
|
+
// label: "My Tool", // Display name
|
|
21
|
+
// name: "my_tool", // Tool identifier (snake_case)
|
|
22
|
+
// description: "Does something",
|
|
23
|
+
// parameters: {
|
|
24
|
+
// type: "object",
|
|
25
|
+
// properties: {
|
|
26
|
+
// input: { type: "string" }
|
|
27
|
+
// },
|
|
28
|
+
// required: ["input"]
|
|
29
|
+
// },
|
|
30
|
+
// async execute(_toolCallId, params): Promise<AgentToolResult<unknown>> {
|
|
31
|
+
// const { input } = params as { input: string };
|
|
32
|
+
// return {
|
|
33
|
+
// content: [{ type: "text", text: `Result: ${input}` }],
|
|
34
|
+
// details: { input }
|
|
35
|
+
// };
|
|
36
|
+
// }
|
|
37
|
+
// });
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@poolbot/template",
|
|
3
|
+
"version": "2026.3.12",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Template plugin for PoolBot - starter template for custom integrations",
|
|
6
|
+
"poolbot": {
|
|
7
|
+
"extensions": [
|
|
8
|
+
"./index.ts"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"poolbot": "workspace:*"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# Mavalie Plugin for PoolBot
|
|
2
|
-
|
|
3
|
-
Plugin template válido para PoolBot.
|
|
4
|
-
|
|
5
|
-
## Estrutura
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
extensions/mavalie/
|
|
9
|
-
├── package.json # Manifest do plugin
|
|
10
|
-
├── src/
|
|
11
|
-
│ └── index.ts # Entry point
|
|
12
|
-
└── README.md # Esta documentação
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Instalação
|
|
16
|
-
|
|
17
|
-
1. **Build do plugin:**
|
|
18
|
-
```bash
|
|
19
|
-
cd extensions/mavalie
|
|
20
|
-
npm install
|
|
21
|
-
npm run build # ou pnpm build
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
2. **Ativação no PoolBot:**
|
|
25
|
-
O plugin é carregado automaticamente pelo PoolBot quando:
|
|
26
|
-
- O diretório está em `extensions/mavalie/`
|
|
27
|
-
- O `package.json` tem a seção `poolbot.extensions` configurada
|
|
28
|
-
- O entry point (`dist/index.js`) existe
|
|
29
|
-
|
|
30
|
-
## Configuração
|
|
31
|
-
|
|
32
|
-
O plugin usa `emptyPluginConfigSchema()`, ou seja, não requer configuração.
|
|
33
|
-
|
|
34
|
-
Para adicionar configurações, substitua por:
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import { z } from "zod";
|
|
38
|
-
|
|
39
|
-
const configSchema = z.object({
|
|
40
|
-
apiKey: z.string().optional(),
|
|
41
|
-
endpoint: z.string().url().default("https://api.mavalie.com"),
|
|
42
|
-
});
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Desenvolvimento
|
|
46
|
-
|
|
47
|
-
### Padrões de Plugin
|
|
48
|
-
|
|
49
|
-
O PoolBot suporta 4 tipos de extensões:
|
|
50
|
-
|
|
51
|
-
1. **Provider** - Adiciona novos modelos LLM
|
|
52
|
-
2. **Channel** - Adiciona canais de comunicação (Discord, Slack, etc)
|
|
53
|
-
3. **Tool** - Adiciona ferramentas para agentes
|
|
54
|
-
4. **Hook** - Intercepta eventos do ciclo de vida
|
|
55
|
-
|
|
56
|
-
### Exemplo: Registrando um Provider
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
api.registerProvider({
|
|
60
|
-
id: "mavalie",
|
|
61
|
-
label: "Mavalie AI",
|
|
62
|
-
auth: [{
|
|
63
|
-
id: "api-key",
|
|
64
|
-
kind: "apiKey",
|
|
65
|
-
run: async (ctx) => {
|
|
66
|
-
const key = await ctx.prompter.password({
|
|
67
|
-
message: "Mavalie API Key:"
|
|
68
|
-
});
|
|
69
|
-
return {
|
|
70
|
-
profiles: [{
|
|
71
|
-
profileId: "mavalie:default",
|
|
72
|
-
credential: { type: "apiKey", key: String(key) }
|
|
73
|
-
}]
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}]
|
|
77
|
-
});
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Troubleshooting
|
|
81
|
-
|
|
82
|
-
### "plugin manifest not found"
|
|
83
|
-
- Verifique se `package.json` existe e tem `poolbot.extensions`
|
|
84
|
-
- Verifique se o caminho em `extensions` aponta para o arquivo correto
|
|
85
|
-
|
|
86
|
-
### "extension entry escapes package directory"
|
|
87
|
-
- O entry point deve estar dentro do diretório do plugin
|
|
88
|
-
- Use `./dist/index.js` (não `./src/index.ts` para produção)
|
|
89
|
-
|
|
90
|
-
### Erros de TypeScript "Cannot find module 'poolbot/plugin-sdk'"
|
|
91
|
-
- Normal durante desenvolvimento - o alias só resolve após build
|
|
92
|
-
- O build do PoolBot principal resolve essas dependências
|
|
93
|
-
|
|
94
|
-
## Referências
|
|
95
|
-
|
|
96
|
-
- [Plugin SDK Documentation](../../docs/refactor/plugin-sdk.md)
|
|
97
|
-
- [Exemplos de Plugins](../discord/, ../slack/, etc.)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@poolbot/mavalie",
|
|
3
|
-
"version": "2026.3.11",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Mavalie plugin for PoolBot - custom integration",
|
|
6
|
-
"poolbot": {
|
|
7
|
-
"extensions": [
|
|
8
|
-
"./src/index.ts"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"poolbot": "workspace:*"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { emptyPluginConfigSchema } from "poolbot/plugin-sdk";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Mavalie Plugin for PoolBot
|
|
5
|
-
*
|
|
6
|
-
* Template mínimo válido de plugin para PoolBot.
|
|
7
|
-
* Este plugin registra um provider customizado que pode ser expandido
|
|
8
|
-
* conforme necessidades específicas.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const mavaliePlugin = {
|
|
12
|
-
id: "mavalie",
|
|
13
|
-
name: "Mavalie",
|
|
14
|
-
description: "Custom Mavalie integration for PoolBot",
|
|
15
|
-
configSchema: emptyPluginConfigSchema(),
|
|
16
|
-
|
|
17
|
-
register(api) {
|
|
18
|
-
// Log de registro do plugin
|
|
19
|
-
api.runtime?.log?.("Mavalie plugin registered");
|
|
20
|
-
|
|
21
|
-
// TODO: Adicione aqui o registro de:
|
|
22
|
-
// - Providers (modelos customizados)
|
|
23
|
-
// - Canais (integrações de mensageria)
|
|
24
|
-
// - Ferramentas (tools para agentes)
|
|
25
|
-
// - Hooks (eventos do ciclo de vida)
|
|
26
|
-
|
|
27
|
-
// Exemplo de registro de provider (descomente e adapte):
|
|
28
|
-
/*
|
|
29
|
-
api.registerProvider({
|
|
30
|
-
id: "mavalie",
|
|
31
|
-
label: "Mavalie Provider",
|
|
32
|
-
docsPath: "/providers/models",
|
|
33
|
-
auth: [
|
|
34
|
-
{
|
|
35
|
-
id: "api-key",
|
|
36
|
-
label: "API Key",
|
|
37
|
-
kind: "apiKey",
|
|
38
|
-
run: async (ctx) => {
|
|
39
|
-
const key = await ctx.prompter.password({
|
|
40
|
-
message: "Enter your Mavalie API key:",
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
profiles: [
|
|
44
|
-
{
|
|
45
|
-
profileId: "mavalie:default",
|
|
46
|
-
credential: {
|
|
47
|
-
type: "apiKey",
|
|
48
|
-
provider: "mavalie",
|
|
49
|
-
key: String(key),
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
*/
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default mavaliePlugin;
|