@poolzin/pool-bot 2026.3.6 → 2026.3.9

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/agents/error-classifier.js +302 -0
  4. package/dist/agents/pi-tools.js +32 -2
  5. package/dist/agents/skills/security.js +217 -0
  6. package/dist/auto-reply/reply/get-reply.js +6 -0
  7. package/dist/auto-reply/reply/message-preprocess-hooks.js +17 -0
  8. package/dist/build-info.json +3 -3
  9. package/dist/cli/banner.js +20 -1
  10. package/dist/cli/lazy-commands.example.js +113 -0
  11. package/dist/cli/lazy-commands.js +329 -0
  12. package/dist/cli/program/command-registry.js +13 -0
  13. package/dist/cli/program/register.skills.js +4 -0
  14. package/dist/cli/security-cli.js +211 -2
  15. package/dist/cli/tagline.js +7 -0
  16. package/dist/config/config.js +1 -0
  17. package/dist/config/secrets-integration.js +88 -0
  18. package/dist/config/types.cli.js +1 -0
  19. package/dist/config/types.security.js +33 -0
  20. package/dist/config/zod-schema.js +15 -0
  21. package/dist/config/zod-schema.providers-core.js +1 -0
  22. package/dist/config/zod-schema.security.js +113 -0
  23. package/dist/context-engine/index.js +33 -0
  24. package/dist/context-engine/legacy.js +181 -0
  25. package/dist/context-engine/registry.js +86 -0
  26. package/dist/context-engine/summarizing.js +293 -0
  27. package/dist/context-engine/types.js +7 -0
  28. package/dist/discord/monitor/message-handler.preflight.js +11 -2
  29. package/dist/gateway/http-common.js +6 -1
  30. package/dist/hooks/fire-and-forget.js +6 -0
  31. package/dist/hooks/internal-hooks.js +64 -19
  32. package/dist/hooks/message-hook-mappers.js +179 -0
  33. package/dist/infra/abort-pattern.js +106 -0
  34. package/dist/infra/retry.js +94 -0
  35. package/dist/secrets/index.js +28 -0
  36. package/dist/secrets/resolver.js +185 -0
  37. package/dist/secrets/runtime.js +142 -0
  38. package/dist/secrets/types.js +11 -0
  39. package/dist/security/capability-guards.js +89 -0
  40. package/dist/security/capability-manager.js +76 -0
  41. package/dist/security/capability.js +147 -0
  42. package/dist/security/dangerous-tools.js +80 -0
  43. package/dist/security/index.js +7 -0
  44. package/dist/security/middleware.js +105 -0
  45. package/dist/security/types.js +12 -0
  46. package/dist/skills/commands.js +351 -0
  47. package/dist/skills/index.js +167 -0
  48. package/dist/skills/loader.js +282 -0
  49. package/dist/skills/parser.js +461 -0
  50. package/dist/skills/registry.js +397 -0
  51. package/dist/skills/security.js +318 -0
  52. package/dist/skills/types.js +21 -0
  53. package/dist/slack/monitor/context.js +1 -0
  54. package/dist/slack/monitor/message-handler/dispatch.js +14 -1
  55. package/dist/slack/monitor/provider.js +2 -0
  56. package/dist/test-utils/index.js +219 -0
  57. package/dist/tui/index.js +595 -0
  58. package/docs/INTEGRATION_PLAN.md +475 -0
  59. package/docs/INTEGRATION_SUMMARY.md +215 -0
  60. package/docs/integrations/HEXSTRIKE_PLAN.md +796 -0
  61. package/docs/integrations/INTEGRATION_PLAN.md +424 -0
  62. package/docs/integrations/PAGE_AGENT_PLAN.md +370 -0
  63. package/docs/integrations/XYOPS_PLAN.md +978 -0
  64. package/docs/skills/IMPLEMENTATION_SUMMARY.md +145 -0
  65. package/docs/skills/SKILL.md +524 -0
  66. package/docs/skills.md +405 -0
  67. package/package.json +1 -1
  68. package/skills/example-skill/SKILL.md +195 -0
@@ -0,0 +1,475 @@
1
+ # PoolBot Integration Plan: External Projects
2
+
3
+ **Status**: Draft
4
+ **Date**: 2025-01-09
5
+ **Goal**: Make PoolBot complete and independent by integrating capabilities from Page Agent, HexStrike AI, and xyOps
6
+
7
+ ---
8
+
9
+ ## Executive Summary
10
+
11
+ This plan outlines the integration of three external projects into PoolBot to create a comprehensive, self-sufficient automation platform:
12
+
13
+ 1. **Page Agent** → Enhanced browser automation with natural language control
14
+ 2. **HexStrike AI** → Security/penetration testing capabilities (150+ security tools)
15
+ 3. **xyOps** → Workflow automation, scheduling, and infrastructure monitoring
16
+
17
+ **Integration Strategy**: Gateway Node protocol for external processes + Plugin extensions for deep integration
18
+
19
+ ---
20
+
21
+ ## 1. Architecture Overview
22
+
23
+ ### Current PoolBot Extension Points
24
+
25
+ ```
26
+ ┌─────────────────────────────────────────────────────────────┐
27
+ │ PoolBot Core │
28
+ ├─────────────┬─────────────┬─────────────┬───────────────────┤
29
+ │ Agents │ Gateway │ ACP │ Plugins │
30
+ │ (skills) │ (WebSocket)│ (WebSocket)│ (lifecycle hooks)│
31
+ └──────┬──────┴──────┬──────┴──────┬──────┴─────────┬─────────┘
32
+ │ │ │ │
33
+ ▼ ▼ ▼ ▼
34
+ ┌──────────────┐ ┌─────────┐ ┌──────────┐ ┌──────────────────┐
35
+ │ Subagents │ │ Nodes │ │ IDE/CLI │ │ Extensions/ │
36
+ │ (isolated) │ │(external│ │ clients │ │ Skills │
37
+ │ │ │processes)│ │ │ │ │
38
+ └──────────────┘ └─────────┘ └──────────┘ └──────────────────┘
39
+ ```
40
+
41
+ ### Integration Approach by Project
42
+
43
+ | Project | Integration Method | Rationale |
44
+ |---------|-------------------|-----------|
45
+ | **Page Agent** | Gateway Node + Browser Extension | External Node.js process, needs browser control |
46
+ | **HexStrike AI** | Gateway Node (Python) | Python-based, 150+ tools, MCP protocol already used |
47
+ | **xyOps** | Plugin Extension + Gateway Node | Node.js-based, can be deeply integrated |
48
+
49
+ ---
50
+
51
+ ## 2. Page Agent Integration
52
+
53
+ ### 2.1 Overview
54
+ - **Source**: Alibaba's Page Agent (GUI agent for web automation)
55
+ - **Language**: TypeScript/JavaScript
56
+ - **Key Feature**: Natural language control of web pages via DOM manipulation
57
+ - **Current PoolBot Overlap**: `src/browser/`, `src/cli/browser-cli.ts`
58
+
59
+ ### 2.2 Integration Design
60
+
61
+ ```typescript
62
+ // Gateway Node registration
63
+ interface PageAgentNode {
64
+ capabilities: ['tools.browser.*', 'tools.page.*'];
65
+ tools: {
66
+ 'browser.navigate': { url: string };
67
+ 'browser.click': { selector: string };
68
+ 'browser.type': { selector: string, text: string };
69
+ 'browser.extract': { selector: string };
70
+ 'page.agent': { instruction: string }; // Natural language
71
+ };
72
+ }
73
+ ```
74
+
75
+ ### 2.3 Implementation Plan
76
+
77
+ **Phase 1: Gateway Node Wrapper** (Week 1)
78
+ ```
79
+ extensions/page-agent-gateway/
80
+ ├── src/
81
+ │ ├── node.ts # Gateway Node WebSocket client
82
+ │ ├── page-agent-bridge.ts # Adapts Page Agent to PoolBot tools
83
+ │ └── index.ts
84
+ ├── package.json
85
+ └── README.md
86
+ ```
87
+
88
+ **Phase 2: Browser Extension Integration** (Week 2)
89
+ - Extend existing `src/browser/` CDP proxy
90
+ - Add Page Agent's DOM-based interaction layer
91
+ - Support multi-page workflows via Chrome extension
92
+
93
+ **Phase 3: Natural Language Interface** (Week 3)
94
+ ```typescript
95
+ // New tool: page.agent
96
+ {
97
+ name: 'page.agent',
98
+ description: 'Control web pages using natural language',
99
+ parameters: {
100
+ instruction: 'string', // e.g., "Find the pricing page and extract all plans"
101
+ url: 'string?',
102
+ }
103
+ }
104
+ ```
105
+
106
+ ### 2.4 Value Add
107
+ - Natural language browser control (vs. manual DOM selectors)
108
+ - Multi-page workflow support
109
+ - No screenshot/OCR latency (text-based DOM)
110
+
111
+ ---
112
+
113
+ ## 3. HexStrike AI Integration
114
+
115
+ ### 3.1 Overview
116
+ - **Source**: HexStrike AI (Cybersecurity MCP platform)
117
+ - **Language**: Python
118
+ - **Key Features**: 150+ security tools, 12+ AI agents, autonomous pentesting
119
+ - **Protocol**: FastMCP (Model Context Protocol)
120
+
121
+ ### 3.2 Integration Design
122
+
123
+ ```python
124
+ # HexStrike as Gateway Node (Python)
125
+ class HexStrikeNode:
126
+ capabilities = ["tools.security.*", "tools.pentest.*"]
127
+
128
+ tools = {
129
+ "security.scan": {"target": "string", "tools": "string[]"},
130
+ "security.nmap": {"target": "string", "ports": "string?"},
131
+ "security.nuclei": {"target": "string", "templates": "string[]?"},
132
+ "pentest.ctf": {"challenge": "string", "hints": "boolean?"},
133
+ "pentest.bugbounty": {"target": "string", "scope": "string"},
134
+ }
135
+ ```
136
+
137
+ ### 3.3 Implementation Plan
138
+
139
+ **Phase 1: MCP-to-Gateway Bridge** (Week 1-2)
140
+ ```
141
+ extensions/hexstrike-gateway/
142
+ ├── python/
143
+ │ ├── hexstrike_node.py # FastMCP server + WebSocket client
144
+ │ ├── tool_adapter.py # Maps HexStrike tools to PoolBot
145
+ │ └── requirements.txt
146
+ ├── src/
147
+ │ └── index.ts # TypeScript type definitions
148
+ └── README.md
149
+ ```
150
+
151
+ **Phase 2: Security Agent** (Week 3)
152
+ ```typescript
153
+ // New agent type: security
154
+ {
155
+ type: 'security',
156
+ skills: ['hexstrike.pentest', 'hexstrike.scan'],
157
+ systemPrompt: 'You are a security analyst...',
158
+ }
159
+ ```
160
+
161
+ **Phase 3: Report Integration** (Week 4)
162
+ - Auto-generate security reports
163
+ - Integration with PoolBot's canvas/document system
164
+ - CVE intelligence dashboard
165
+
166
+ ### 3.4 Value Add
167
+ - 150+ security tools accessible via natural language
168
+ - Autonomous penetration testing
169
+ - CTF solver and bug bounty assistance
170
+ - Security reporting integrated with PoolBot workflows
171
+
172
+ ---
173
+
174
+ ## 4. xyOps Integration
175
+
176
+ ### 4.1 Overview
177
+ - **Source**: xyOps (Job scheduling and workflow automation)
178
+ - **Language**: Node.js/TypeScript
179
+ - **Key Features**: Visual workflow editor, monitoring, incident response
180
+ - **License**: BSD (permissive)
181
+
182
+ ### 4.2 Integration Design
183
+
184
+ ```typescript
185
+ // Dual integration: Plugin + Gateway Node
186
+
187
+ // As Plugin (deep integration)
188
+ interface XyOpsPlugin {
189
+ onLoad(): void;
190
+ registerWorkflowEngine(): void;
191
+ registerScheduler(): void;
192
+ }
193
+
194
+ // As Gateway Node (external process support)
195
+ interface XyOpsNode {
196
+ capabilities: ['tools.workflow.*', 'tools.schedule.*', 'tools.monitor.*'];
197
+ tools: {
198
+ 'workflow.create': { name: string, steps: Step[] };
199
+ 'workflow.run': { id: string, inputs: Record<string, any> };
200
+ 'schedule.cron': { expression: string, workflow: string };
201
+ 'monitor.check': { target: string, interval: number };
202
+ };
203
+ }
204
+ ```
205
+
206
+ ### 4.3 Implementation Plan
207
+
208
+ **Phase 1: Plugin Foundation** (Week 1-2)
209
+ ```
210
+ extensions/xyops/
211
+ ├── src/
212
+ │ ├── plugin.ts # PoolBot plugin lifecycle
213
+ │ ├── workflow/
214
+ │ │ ├── engine.ts # xyOps workflow engine
215
+ │ │ └── visual-editor.ts # React-based editor
216
+ │ ├── scheduler/
217
+ │ │ └── cron.ts # Job scheduling
218
+ │ └── monitoring/
219
+ │ └── health-check.ts # Service monitoring
220
+ ├── package.json
221
+ └── README.md
222
+ ```
223
+
224
+ **Phase 2: Gateway Node** (Week 3)
225
+ - Enable external xyOps instances to connect
226
+ - Distributed workflow execution
227
+ - Cross-instance job delegation
228
+
229
+ **Phase 3: PoolBot Native Integration** (Week 4)
230
+ ```typescript
231
+ // New CLI commands
232
+ poolbot workflow create --from-prompt "Every day at 9am, check website health"
233
+ poolbot workflow list
234
+ poolbot workflow run <id>
235
+ poolbot schedule add --workflow <id> --cron "0 9 * * *"
236
+
237
+ // Agent integration
238
+ {
239
+ type: 'workflow',
240
+ skills: ['xyops.create', 'xyops.schedule'],
241
+ }
242
+ ```
243
+
244
+ ### 4.4 Value Add
245
+ - Visual workflow builder for non-technical users
246
+ - Scheduled automation (cron-like)
247
+ - Infrastructure monitoring and alerting
248
+ - Incident response with ticketing
249
+
250
+ ---
251
+
252
+ ## 5. Unified Integration Architecture
253
+
254
+ ### 5.1 Common Gateway Node Protocol
255
+
256
+ All three projects connect via the same Gateway Node protocol:
257
+
258
+ ```typescript
259
+ // src/gateway/nodes/external-node.ts
260
+ interface ExternalNodeConfig {
261
+ id: string;
262
+ type: 'page-agent' | 'hexstrike' | 'xyops' | 'custom';
263
+ endpoint: string; // WebSocket URL
264
+ auth: { token: string };
265
+ capabilities: string[]; // e.g., ['tools.browser.*']
266
+ healthCheck: { interval: number };
267
+ }
268
+
269
+ // PoolBot manages node lifecycle
270
+ class NodeManager {
271
+ async registerNode(config: ExternalNodeConfig): Promise<Node>;
272
+ async proxyToolCall(nodeId: string, tool: string, params: any): Promise<any>;
273
+ async monitorHealth(nodeId: string): Promise<HealthStatus>;
274
+ }
275
+ ```
276
+
277
+ ### 5.2 Skill Registration
278
+
279
+ Each integration registers skills that agents can use:
280
+
281
+ ```typescript
282
+ // Skills are automatically registered from Gateway Nodes
283
+ interface NodeSkill {
284
+ name: string; // e.g., 'browser.agent'
285
+ nodeId: string; // Source node
286
+ description: string;
287
+ parameters: JSONSchema;
288
+ }
289
+
290
+ // Agents can use these skills transparently
291
+ agent.execute({
292
+ skill: 'browser.agent',
293
+ params: { instruction: 'Find pricing' }
294
+ });
295
+ ```
296
+
297
+ ### 5.3 Security Model
298
+
299
+ ```typescript
300
+ interface NodeSecurity {
301
+ // Sandboxed execution
302
+ sandbox: {
303
+ enabled: boolean;
304
+ allowedOperations: string[];
305
+ blockedOperations: string[];
306
+ };
307
+
308
+ // Capability-based access
309
+ capabilities: {
310
+ tools: string[]; // Which tools can be called
311
+ channels: string[]; // Which channels can access
312
+ rateLimit: number; // Calls per minute
313
+ };
314
+
315
+ // Audit logging
316
+ audit: {
317
+ logAllCalls: boolean;
318
+ retentionDays: number;
319
+ };
320
+ }
321
+ ```
322
+
323
+ ---
324
+
325
+ ## 6. Implementation Roadmap
326
+
327
+ ### Phase 1: Foundation (Weeks 1-2)
328
+ - [ ] Create `extensions/` structure for all three projects
329
+ - [ ] Implement common Gateway Node protocol improvements
330
+ - [ ] Set up build/test infrastructure for extensions
331
+ - [ ] Create Node.js Gateway Node SDK
332
+
333
+ ### Phase 2: Page Agent (Weeks 3-4)
334
+ - [ ] Gateway Node wrapper for Page Agent
335
+ - [ ] Browser extension integration
336
+ - [ ] Natural language tool registration
337
+ - [ ] Documentation and examples
338
+
339
+ ### Phase 3: HexStrike AI (Weeks 5-7)
340
+ - [ ] Python Gateway Node SDK
341
+ - [ ] MCP-to-Gateway adapter
342
+ - [ ] Security agent type
343
+ - [ ] Tool categorization (scan, pentest, ctf, etc.)
344
+
345
+ ### Phase 4: xyOps (Weeks 8-10)
346
+ - [ ] Plugin foundation
347
+ - [ ] Workflow engine integration
348
+ - [ ] Visual editor (React)
349
+ - [ ] Scheduler and monitoring
350
+
351
+ ### Phase 5: Unification (Weeks 11-12)
352
+ - [ ] Unified CLI (`poolbot mods` enhancements)
353
+ - [ ] Cross-project workflows
354
+ - [ ] Documentation and tutorials
355
+ - [ ] Performance optimization
356
+
357
+ ---
358
+
359
+ ## 7. Technical Specifications
360
+
361
+ ### 7.1 Gateway Node Protocol
362
+
363
+ ```typescript
364
+ // WebSocket message format
365
+ interface NodeMessage {
366
+ id: string;
367
+ type: 'register' | 'tool_call' | 'tool_result' | 'heartbeat' | 'error';
368
+ payload: unknown;
369
+ }
370
+
371
+ // Registration
372
+ interface RegisterPayload {
373
+ nodeId: string;
374
+ capabilities: string[];
375
+ tools: ToolDefinition[];
376
+ metadata: {
377
+ name: string;
378
+ version: string;
379
+ description: string;
380
+ };
381
+ }
382
+
383
+ // Tool call
384
+ interface ToolCallPayload {
385
+ callId: string;
386
+ tool: string;
387
+ parameters: Record<string, unknown>;
388
+ context: {
389
+ channelId?: string;
390
+ agentId?: string;
391
+ userId?: string;
392
+ };
393
+ }
394
+ ```
395
+
396
+ ### 7.2 File Structure
397
+
398
+ ```
399
+ extensions/
400
+ ├── page-agent-gateway/ # Page Agent integration
401
+ │ ├── src/
402
+ │ ├── package.json
403
+ │ └── README.md
404
+ ├── hexstrike-gateway/ # HexStrike AI integration
405
+ │ ├── python/
406
+ │ ├── src/
407
+ │ └── README.md
408
+ ├── xyops/ # xyOps integration
409
+ │ ├── src/
410
+ │ ├── package.json
411
+ │ └── README.md
412
+ └── node-sdk/ # Shared Node.js SDK
413
+ ├── src/
414
+ └── package.json
415
+ ```
416
+
417
+ ### 7.3 Configuration
418
+
419
+ ```yaml
420
+ # poolbot.yaml
421
+ mods:
422
+ page-agent:
423
+ enabled: true
424
+ endpoint: ws://localhost:3001
425
+ auth:
426
+ token: ${PAGE_AGENT_TOKEN}
427
+
428
+ hexstrike:
429
+ enabled: true
430
+ endpoint: ws://localhost:3002
431
+ auth:
432
+ token: ${HEXSTRIKE_TOKEN}
433
+
434
+ xyops:
435
+ enabled: true
436
+ mode: plugin # or 'gateway' for external instance
437
+ endpoint: ws://localhost:3003
438
+ ```
439
+
440
+ ---
441
+
442
+ ## 8. Risk Assessment
443
+
444
+ | Risk | Impact | Mitigation |
445
+ |------|--------|------------|
446
+ | Python dependency (HexStrike) | Medium | Containerize, optional dependency |
447
+ | Browser extension security | High | Sandboxed execution, CSP |
448
+ | Performance overhead | Medium | Lazy loading, caching |
449
+ | Maintenance burden | Medium | Clear ownership, automated tests |
450
+ | Breaking changes in upstream | Low | Pin versions, abstraction layer |
451
+
452
+ ---
453
+
454
+ ## 9. Success Metrics
455
+
456
+ - [ ] All 3 projects integrated as Gateway Nodes
457
+ - [ ] 150+ security tools accessible via natural language
458
+ - [ ] Visual workflow editor functional
459
+ - [ ] Browser automation with natural language
460
+ - [ ] Zero breaking changes to existing PoolBot
461
+ - [ ] Documentation complete
462
+ - [ ] Performance: <100ms tool call overhead
463
+
464
+ ---
465
+
466
+ ## 10. Next Steps
467
+
468
+ 1. **Review this plan** with stakeholders
469
+ 2. **Create GitHub issues** for each phase
470
+ 3. **Set up development branches** for each integration
471
+ 4. **Begin Phase 1** (Foundation) implementation
472
+
473
+ ---
474
+
475
+ **Questions?** See `docs/skills/SKILL.md` for the skills system that enables this integration.
@@ -0,0 +1,215 @@
1
+ # PoolBot Integration Summary
2
+
3
+ **Date**: 2025-01-09
4
+ **Status**: Planning Complete ✅
5
+ **Next Phase**: Implementation Ready
6
+
7
+ ---
8
+
9
+ ## What We've Accomplished
10
+
11
+ ### Phase 1: Core Skills System ✅
12
+
13
+ Built a complete modular skill management system in `src/skills/`:
14
+
15
+ | Component | Purpose | Status |
16
+ |-----------|---------|--------|
17
+ | `types.ts` | Type definitions (agentskills.io compatible) | ✅ Complete |
18
+ | `parser.ts` | SKILL.md parser with YAML frontmatter | ✅ Complete |
19
+ | `registry.ts` | Skills registry with EventEmitter | ✅ Complete |
20
+ | `loader.ts` | Progressive disclosure loader | ✅ Complete |
21
+ | `security.ts` | Security scanner | ✅ Complete |
22
+ | `commands.ts` | CLI commands (`poolbot mods`) | ✅ Complete |
23
+ | `index.ts` | Public API exports | ✅ Complete |
24
+ | `index.test.ts` | 52 comprehensive tests | ✅ All passing |
25
+
26
+ **Build Status**: ✅ Passes
27
+ **Test Status**: ✅ 52/52 passing
28
+
29
+ ---
30
+
31
+ ## External Project Analysis
32
+
33
+ ### 1. Page Agent (Alibaba)
34
+ - **Language**: TypeScript/JavaScript
35
+ - **Key Feature**: Natural language browser automation
36
+ - **Integration**: Gateway Node (WebSocket)
37
+ - **Duration**: 2 weeks
38
+ - **Plan**: `docs/integrations/PAGE_AGENT_PLAN.md`
39
+
40
+ ### 2. HexStrike AI
41
+ - **Language**: Python
42
+ - **Key Feature**: 150+ security tools, pentesting, CTF
43
+ - **Integration**: Gateway Node (Python SDK + WebSocket)
44
+ - **Duration**: 3 weeks
45
+ - **Plan**: `docs/integrations/HEXSTRIKE_PLAN.md`
46
+
47
+ ### 3. xyOps
48
+ - **Language**: Node.js/TypeScript
49
+ - **Key Feature**: Workflow automation, scheduling, monitoring
50
+ - **Integration**: Plugin Extension + Gateway Node
51
+ - **Duration**: 3 weeks
52
+ - **Plan**: `docs/integrations/XYOPS_PLAN.md`
53
+
54
+ ---
55
+
56
+ ## Integration Architecture
57
+
58
+ ```
59
+ ┌─────────────────────────────────────────────────────────────┐
60
+ │ PoolBot Core │
61
+ ├─────────────────────────────────────────────────────────────┤
62
+ │ Skills System (NEW) │
63
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
64
+ │ │ Parser │ │ Registry │ │ Loader │ │
65
+ │ └──────────────┘ └──────────────┘ └──────────────┘ │
66
+ ├─────────────────────────────────────────────────────────────┤
67
+ │ Gateway Server (WebSocket JSON-RPC) │
68
+ │ ┌─────────────────────────────────────────────────────┐ │
69
+ │ │ Node Manager │ │
70
+ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
71
+ │ │ │Page Agent│ │HexStrike │ │ xyOps │ │ │
72
+ │ │ │ Node │ │ Node │ │ Node │ │ │
73
+ │ │ └──────────┘ └──────────┘ └──────────┘ │ │
74
+ │ └─────────────────────────────────────────────────────┘ │
75
+ ├─────────────────────────────────────────────────────────────┤
76
+ │ Plugin Extensions │
77
+ │ ┌─────────────────────────────────────────────────────┐ │
78
+ │ │ xyOps Plugin (Workflow, Schedule, Monitor) │ │
79
+ │ └─────────────────────────────────────────────────────┘ │
80
+ └─────────────────────────────────────────────────────────────┘
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Key Design Decisions
86
+
87
+ ### 1. Gateway Node Protocol
88
+ All three projects connect via a unified WebSocket JSON-RPC protocol:
89
+ - **Registration**: Nodes register capabilities and tools
90
+ - **Tool Calls**: PoolBot proxies tool calls to nodes
91
+ - **Health Monitoring**: Automatic node health checks
92
+ - **Security**: Token-based auth, capability scoping
93
+
94
+ ### 2. Dual Integration Modes
95
+ - **Gateway Node**: For external processes (Python, separate instances)
96
+ - **Plugin Extension**: For deep PoolBot integration (Node.js)
97
+
98
+ ### 3. Skill Registration
99
+ Tools from Gateway Nodes automatically register as PoolBot skills:
100
+ ```typescript
101
+ // Agent can use external tools transparently
102
+ agent.execute({
103
+ skill: 'security.nmap', // From HexStrike
104
+ params: { target: '192.168.1.1' }
105
+ });
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Implementation Roadmap
111
+
112
+ ### Phase 1: Foundation (Weeks 1-2)
113
+ - [ ] Create `extensions/` structure
114
+ - [ ] Implement Node.js Gateway Node SDK
115
+ - [ ] Implement Python Gateway Node SDK
116
+ - [ ] Set up build/test infrastructure
117
+
118
+ ### Phase 2: Page Agent (Weeks 3-4)
119
+ - [ ] Gateway Node wrapper
120
+ - [ ] Browser extension integration
121
+ - [ ] Natural language tool registration
122
+ - [ ] Documentation
123
+
124
+ ### Phase 3: HexStrike AI (Weeks 5-7)
125
+ - [ ] Python Gateway Node SDK
126
+ - [ ] MCP-to-Gateway adapter
127
+ - [ ] Security agent type
128
+ - [ ] Tool categorization
129
+
130
+ ### Phase 4: xyOps (Weeks 8-10)
131
+ - [ ] Plugin foundation
132
+ - [ ] Workflow engine
133
+ - [ ] Visual editor
134
+ - [ ] Scheduler and monitoring
135
+
136
+ ### Phase 5: Unification (Weeks 11-12)
137
+ - [ ] Unified CLI
138
+ - [ ] Cross-project workflows
139
+ - [ ] Documentation
140
+ - [ ] Performance optimization
141
+
142
+ ---
143
+
144
+ ## Value Proposition
145
+
146
+ After integration, PoolBot will have:
147
+
148
+ | Capability | Source | Use Case |
149
+ |------------|--------|----------|
150
+ | **Natural Language Browser Control** | Page Agent | Web automation without selectors |
151
+ | **150+ Security Tools** | HexStrike AI | Pentesting, vulnerability scanning |
152
+ | **CTF Solver** | HexStrike AI | Capture The Flag challenges |
153
+ | **Bug Bounty Automation** | HexStrike AI | Automated security hunting |
154
+ | **Visual Workflow Builder** | xyOps | No-code automation |
155
+ | **Scheduled Jobs** | xyOps | Cron-like task scheduling |
156
+ | **Infrastructure Monitoring** | xyOps | Health checks, alerting |
157
+
158
+ ---
159
+
160
+ ## Success Metrics
161
+
162
+ - [ ] All 3 projects integrated as Gateway Nodes
163
+ - [ ] 150+ security tools accessible via natural language
164
+ - [ ] Visual workflow editor functional
165
+ - [ ] Browser automation with natural language
166
+ - [ ] Zero breaking changes to existing PoolBot
167
+ - [ ] <100ms tool call overhead
168
+ - [ ] Documentation complete
169
+
170
+ ---
171
+
172
+ ## Next Steps
173
+
174
+ 1. **Review Plans**: Review the detailed plans in `docs/integrations/`
175
+ 2. **Create GitHub Issues**: Break down into trackable issues
176
+ 3. **Start Phase 1**: Begin with Foundation (Node SDKs)
177
+ 4. **Set up Branches**: `feat/page-agent`, `feat/hexstrike`, `feat/xyops`
178
+
179
+ ---
180
+
181
+ ## Documents Created
182
+
183
+ | Document | Purpose |
184
+ |----------|---------|
185
+ | `docs/INTEGRATION_PLAN.md` | Overall integration strategy |
186
+ | `docs/integrations/PAGE_AGENT_PLAN.md` | Page Agent implementation |
187
+ | `docs/integrations/HEXSTRIKE_PLAN.md` | HexStrike AI implementation |
188
+ | `docs/integrations/XYOPS_PLAN.md` | xyOps implementation |
189
+ | `docs/skills/SKILL.md` | Skills system documentation |
190
+
191
+ ---
192
+
193
+ ## Limitations Identified
194
+
195
+ 1. **Python Dependency**: HexStrike requires Python runtime
196
+ - **Mitigation**: Docker containerization, optional dependency
197
+
198
+ 2. **Browser Extension Security**: Page Agent needs browser access
199
+ - **Mitigation**: Sandboxed execution, URL allowlists
200
+
201
+ 3. **Performance**: External process communication adds latency
202
+ - **Mitigation**: Connection pooling, caching, local mode for plugins
203
+
204
+ ---
205
+
206
+ ## Questions for Stakeholders
207
+
208
+ 1. **Priority**: Which integration should we start with?
209
+ 2. **Resources**: Do we need additional developers for Python SDK?
210
+ 3. **Scope**: Should we implement all 3 or start with 1-2?
211
+ 4. **Timeline**: Is the 12-week timeline acceptable?
212
+
213
+ ---
214
+
215
+ **Ready to proceed with implementation! 🚀**