@poolzin/pool-bot 2026.3.7 → 2026.3.10

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 (150) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +147 -69
  3. package/dist/.buildstamp +1 -1
  4. package/dist/agents/error-classifier.js +251 -0
  5. package/dist/agents/skills/security.js +211 -0
  6. package/dist/build-info.json +3 -3
  7. package/dist/cli/cron-cli/register.cron-dashboard.js +339 -0
  8. package/dist/cli/cron-cli/register.js +2 -0
  9. package/dist/cli/errors.js +187 -0
  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 +26 -0
  13. package/dist/cli/program/register.maintenance.js +21 -0
  14. package/dist/cli/program/register.skills.js +4 -0
  15. package/dist/cli/program/register.subclis.js +9 -0
  16. package/dist/cli/swarm-cli/register.js +8 -0
  17. package/dist/cli/swarm-cli/register.swarm-status.js +488 -0
  18. package/dist/cli/telemetry-cli/register.js +10 -0
  19. package/dist/cli/telemetry-cli/register.telemetry-alerts.js +176 -0
  20. package/dist/cli/telemetry-cli/register.telemetry-metrics.js +323 -0
  21. package/dist/cli/telemetry-cli/register.telemetry-status.js +179 -0
  22. package/dist/commands/doctor-checks.js +498 -0
  23. package/dist/config/config.js +1 -0
  24. package/dist/config/secrets-integration.js +88 -0
  25. package/dist/context-engine/index.js +33 -0
  26. package/dist/context-engine/legacy.js +179 -0
  27. package/dist/context-engine/registry.js +86 -0
  28. package/dist/context-engine/summarizing.js +290 -0
  29. package/dist/context-engine/types.js +7 -0
  30. package/dist/cron/service/timer.js +18 -0
  31. package/dist/gateway/protocol/index.js +5 -2
  32. package/dist/gateway/protocol/schema/error-codes.js +1 -0
  33. package/dist/gateway/protocol/schema/swarm.js +80 -0
  34. package/dist/gateway/protocol/schema.js +1 -0
  35. package/dist/gateway/server-close.js +4 -0
  36. package/dist/gateway/server-constants.js +1 -0
  37. package/dist/gateway/server-cron.js +29 -0
  38. package/dist/gateway/server-maintenance.js +35 -2
  39. package/dist/gateway/server-methods/swarm.js +58 -0
  40. package/dist/gateway/server-methods/telemetry.js +71 -0
  41. package/dist/gateway/server-methods-list.js +8 -0
  42. package/dist/gateway/server-methods.js +9 -2
  43. package/dist/gateway/server.impl.js +33 -16
  44. package/dist/infra/abort-pattern.js +106 -0
  45. package/dist/infra/retry.js +96 -0
  46. package/dist/secrets/index.js +28 -0
  47. package/dist/secrets/resolver.js +185 -0
  48. package/dist/secrets/runtime.js +142 -0
  49. package/dist/secrets/types.js +11 -0
  50. package/dist/security/dangerous-tools.js +80 -0
  51. package/dist/security/types.js +12 -0
  52. package/dist/skills/commands.js +333 -0
  53. package/dist/skills/index.js +164 -0
  54. package/dist/skills/loader.js +282 -0
  55. package/dist/skills/parser.js +446 -0
  56. package/dist/skills/registry.js +394 -0
  57. package/dist/skills/security.js +312 -0
  58. package/dist/skills/types.js +21 -0
  59. package/dist/swarm/service.js +247 -0
  60. package/dist/telemetry/alert-engine.js +258 -0
  61. package/dist/telemetry/cron-instrumentation.js +49 -0
  62. package/dist/telemetry/gateway-instrumentation.js +80 -0
  63. package/dist/telemetry/instrumentation.js +66 -0
  64. package/dist/telemetry/service.js +345 -0
  65. package/dist/test-utils/index.js +219 -0
  66. package/dist/tui/components/assistant-message.js +6 -2
  67. package/dist/tui/components/hyperlink-markdown.js +32 -0
  68. package/dist/tui/components/searchable-select-list.js +12 -1
  69. package/dist/tui/components/user-message.js +6 -2
  70. package/dist/tui/index.js +611 -0
  71. package/dist/tui/theme/theme-detection.js +226 -0
  72. package/dist/tui/tui-command-handlers.js +20 -0
  73. package/dist/tui/tui-formatters.js +4 -3
  74. package/dist/tui/utils/ctrl-c-handler.js +67 -0
  75. package/dist/tui/utils/osc8-hyperlinks.js +208 -0
  76. package/dist/tui/utils/safe-stop.js +180 -0
  77. package/dist/tui/utils/session-key-utils.js +81 -0
  78. package/dist/tui/utils/text-sanitization.js +284 -0
  79. package/dist/utils/lru-cache.js +116 -0
  80. package/dist/utils/performance.js +199 -0
  81. package/dist/utils/retry.js +240 -0
  82. package/docs/INTEGRATION_PLAN.md +475 -0
  83. package/docs/INTEGRATION_SUMMARY.md +215 -0
  84. package/docs/MELHORIAS_IMPLEMENTADAS.md +228 -0
  85. package/docs/MELHORIAS_PROFISSIONAIS.md +282 -0
  86. package/docs/PLANO_ACAO_TUI.md +357 -0
  87. package/docs/PROGRESSO_TUI.md +66 -0
  88. package/docs/RELATORIO_FINAL.md +217 -0
  89. package/docs/diagnostico-shell-completion.md +265 -0
  90. package/docs/features/advanced-memory.md +585 -0
  91. package/docs/features/discord-components-v2.md +277 -0
  92. package/docs/features/swarm.md +100 -0
  93. package/docs/features/telemetry.md +284 -0
  94. package/docs/integrations/HEXSTRIKE_PLAN.md +796 -0
  95. package/docs/integrations/INTEGRATION_PLAN.md +744 -0
  96. package/docs/integrations/PAGE_AGENT_PLAN.md +370 -0
  97. package/docs/integrations/XYOPS_PLAN.md +978 -0
  98. package/docs/models/provider-infrastructure.md +400 -0
  99. package/docs/security/exec-approvals.md +294 -0
  100. package/docs/skills/IMPLEMENTATION_SUMMARY.md +145 -0
  101. package/docs/skills/SKILL.md +524 -0
  102. package/docs/skills.md +405 -0
  103. package/extensions/bluebubbles/package.json +1 -1
  104. package/extensions/copilot-proxy/package.json +1 -1
  105. package/extensions/diagnostics-otel/package.json +1 -1
  106. package/extensions/discord/package.json +1 -1
  107. package/extensions/feishu/package.json +1 -1
  108. package/extensions/google-antigravity-auth/package.json +1 -1
  109. package/extensions/google-gemini-cli-auth/package.json +1 -1
  110. package/extensions/googlechat/package.json +1 -1
  111. package/extensions/hexstrike-bridge/README.md +119 -0
  112. package/extensions/hexstrike-bridge/index.test.ts +247 -0
  113. package/extensions/hexstrike-bridge/index.ts +487 -0
  114. package/extensions/hexstrike-bridge/package.json +17 -0
  115. package/extensions/imessage/package.json +1 -1
  116. package/extensions/irc/package.json +1 -1
  117. package/extensions/line/package.json +1 -1
  118. package/extensions/llm-task/package.json +1 -1
  119. package/extensions/lobster/package.json +1 -1
  120. package/extensions/matrix/CHANGELOG.md +5 -0
  121. package/extensions/matrix/package.json +1 -1
  122. package/extensions/mattermost/package.json +1 -1
  123. package/extensions/mcp-server/index.ts +14 -0
  124. package/extensions/mcp-server/package.json +11 -0
  125. package/extensions/mcp-server/src/service.ts +540 -0
  126. package/extensions/memory-core/package.json +1 -1
  127. package/extensions/memory-lancedb/package.json +1 -1
  128. package/extensions/minimax-portal-auth/package.json +1 -1
  129. package/extensions/msteams/CHANGELOG.md +5 -0
  130. package/extensions/msteams/package.json +1 -1
  131. package/extensions/nextcloud-talk/package.json +1 -1
  132. package/extensions/nostr/CHANGELOG.md +5 -0
  133. package/extensions/nostr/package.json +1 -1
  134. package/extensions/open-prose/package.json +1 -1
  135. package/extensions/openai-codex-auth/package.json +1 -1
  136. package/extensions/signal/package.json +1 -1
  137. package/extensions/slack/package.json +1 -1
  138. package/extensions/telegram/package.json +1 -1
  139. package/extensions/tlon/package.json +1 -1
  140. package/extensions/twitch/CHANGELOG.md +5 -0
  141. package/extensions/twitch/package.json +1 -1
  142. package/extensions/voice-call/CHANGELOG.md +5 -0
  143. package/extensions/voice-call/package.json +1 -1
  144. package/extensions/whatsapp/package.json +1 -1
  145. package/extensions/zalo/CHANGELOG.md +5 -0
  146. package/extensions/zalo/package.json +1 -1
  147. package/extensions/zalouser/CHANGELOG.md +5 -0
  148. package/extensions/zalouser/package.json +1 -1
  149. package/package.json +8 -1
  150. package/skills/example-skill/SKILL.md +195 -0
@@ -0,0 +1,744 @@
1
+ # PoolBot Integration Plan: Page Agent, HexStrike AI, and xyOps
2
+
3
+ ## Executive Summary
4
+
5
+ This document outlines a professional integration strategy for three external projects into PoolBot to create a **complete and independent** AI-powered automation platform. The integration follows PoolBot's existing plugin architecture, maintains backward compatibility, and adds significant new capabilities.
6
+
7
+ ## Projects Overview
8
+
9
+ ### 1. Page Agent (Alibaba Research)
10
+ - **Type**: Browser automation agent
11
+ - **Language**: TypeScript/JavaScript
12
+ - **Key Features**: Text-based DOM manipulation, multi-page workflows, Chrome extension
13
+ - **Integration Value**: Enhanced browser automation beyond current Playwright-based system
14
+
15
+ ### 2. HexStrike AI
16
+ - **Type**: Cybersecurity platform
17
+ - **Language**: Python (FastMCP server)
18
+ - **Key Features**: 150+ security tools, 12+ AI agents, autonomous pentesting
19
+ - **Integration Value**: Security scanning, penetration testing, vulnerability assessment
20
+
21
+ ### 3. xyOps
22
+ - **Type**: Workflow automation & monitoring
23
+ - **Language**: Node.js
24
+ - **Key Features**: Visual workflow editor, job scheduling, alerting, incident response
25
+ - **Integration Value**: Infrastructure automation, monitoring, incident management
26
+
27
+ ## PoolBot Architecture Analysis
28
+
29
+ ### Existing Systems
30
+
31
+ | Component | Current Implementation | Integration Point |
32
+ |-----------|----------------------|-------------------|
33
+ | **Browser** | Playwright-based (`src/browser/`) | Page Agent as alternative driver |
34
+ | **Plugins** | Full plugin system (`src/plugins/`) | All 3 projects as plugins |
35
+ | **ACP** | Agent Communication Protocol (`src/acp/`) | Extend for external tool servers |
36
+ | **MCP** | Partial via mcporter (`src/memory/qmd-manager.ts`) | Full MCP client support |
37
+ | **Skills** | New skill system (`src/skills/`) | Project-specific skills |
38
+ | **Gateway** | WebSocket gateway (`src/gateway/`) | Route external requests |
39
+ | **CLI** | Comprehensive CLI (`src/cli/`) | New commands for integrations |
40
+
41
+ ### Key Architectural Decisions
42
+
43
+ 1. **Plugin-First Approach**: All integrations implemented as PoolBot plugins
44
+ 2. **MCP Bridge**: HexStrike AI exposed via MCP protocol
45
+ 3. **Skill Wrappers**: Each project wrapped in PoolBot skill format
46
+ 4. **No Core Changes**: Additive only - no modifications to existing code
47
+
48
+ ## Integration Architecture
49
+
50
+ ```
51
+ ┌─────────────────────────────────────────────────────────────────────────────┐
52
+ │ PoolBot Core │
53
+ ├─────────────────────────────────────────────────────────────────────────────┤
54
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
55
+ │ │ Skills │ │ Plugins │ │ ACP │ │ Gateway │ │
56
+ │ │ System │ │ System │ │ Protocol │ │ Server │ │
57
+ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
58
+ │ │ │ │ │ │
59
+ │ └────────────────┴────────────────┴────────────────────┘ │
60
+ │ │ │
61
+ │ Integration Layer │
62
+ │ ┌───────────────┼───────────────┐ │
63
+ │ ▼ ▼ ▼ │
64
+ │ ┌─────────────────┐ ┌──────────┐ ┌─────────────────┐ │
65
+ │ │ Page Agent │ │ HexStrike│ │ xyOps │ │
66
+ │ │ Plugin │ │ AI Plugin│ │ Plugin │ │
67
+ │ │ │ │ │ │ │ │
68
+ │ │ • Browser driver│ │• MCP │ │• Workflow │ │
69
+ │ │ • DOM agent │ │ client │ │ scheduler │ │
70
+ │ │ • Multi-page │ │• Security│ │• Monitoring │ │
71
+ │ │ workflows │ │ tools │ │• Alerting │ │
72
+ │ └────────┬────────┘ └────┬─────┘ └────────┬────────┘ │
73
+ │ │ │ │ │
74
+ │ ▼ ▼ ▼ │
75
+ │ ┌─────────────────┐ ┌──────────┐ ┌─────────────────┐ │
76
+ │ │ Page Agent Core │ │HexStrike │ │ xyOps Core │ │
77
+ │ │ (npm package) │ │Server │ │ (Node.js) │ │
78
+ │ └─────────────────┘ └──────────┘ └─────────────────┘ │
79
+ └─────────────────────────────────────────────────────────────────────────────┘
80
+ ```
81
+
82
+ ## Detailed Integration Plans
83
+
84
+ ---
85
+
86
+ ## 1. Page Agent Integration
87
+
88
+ ### Overview
89
+ Page Agent provides text-based browser automation with natural language understanding. Unlike PoolBot's current Playwright-based browser which requires precise selectors, Page Agent uses AI to understand and interact with web pages semantically.
90
+
91
+ ### Integration Strategy
92
+
93
+ #### Option A: Browser Driver Plugin (Recommended)
94
+ Implement Page Agent as an alternative browser driver alongside Playwright.
95
+
96
+ **Files to Create:**
97
+ ```
98
+ extensions/page-agent/
99
+ ├── package.json
100
+ ├── poolbot.plugin.json
101
+ ├── src/
102
+ │ ├── index.ts # Plugin entry point
103
+ │ ├── driver.ts # Page Agent driver implementation
104
+ │ ├── tools.ts # Agent tools for browser control
105
+ │ ├── skills/
106
+ │ │ ├── browser-control.md
107
+ │ │ ├── form-filling.md
108
+ │ │ └── data-extraction.md
109
+ │ └── types.ts
110
+ ├── README.md
111
+ └── tsconfig.json
112
+ ```
113
+
114
+ **Key Components:**
115
+
116
+ 1. **Driver Implementation** (`driver.ts`)
117
+ ```typescript
118
+ // Wraps @page-agent/core for PoolBot integration
119
+ export class PageAgentDriver implements BrowserDriver {
120
+ private agent: PageAgentCore;
121
+
122
+ async navigate(url: string): Promise<void>;
123
+ async act(instruction: string): Promise<ActionResult>;
124
+ async extract(query: string): Promise<ExtractResult>;
125
+ async observe(): Promise<PageObservation>;
126
+ }
127
+ ```
128
+
129
+ 2. **Agent Tools** (`tools.ts`)
130
+ ```typescript
131
+ // Tools registered with PoolBot agent system
132
+ export const pageAgentTools: AnyAgentTool[] = [
133
+ {
134
+ name: "browser_navigate",
135
+ description: "Navigate to a URL using natural language understanding",
136
+ parameters: z.object({ url: z.string(), goal: z.string().optional() }),
137
+ execute: async ({ url, goal }) => { /* ... */ }
138
+ },
139
+ {
140
+ name: "browser_act",
141
+ description: "Perform an action on the current page (click, type, scroll)",
142
+ parameters: z.object({ instruction: z.string() }),
143
+ execute: async ({ instruction }) => { /* ... */ }
144
+ },
145
+ {
146
+ name: "browser_extract",
147
+ description: "Extract data from the page using natural language query",
148
+ parameters: z.object({ query: z.string() }),
149
+ execute: async ({ query }) => { /* ... */ }
150
+ }
151
+ ];
152
+ ```
153
+
154
+ 3. **Skills** (in `skills/`)
155
+ - `browser-control.md`: Core browser navigation and control
156
+ - `form-filling.md`: Intelligent form detection and filling
157
+ - `data-extraction.md`: Structured data extraction from web pages
158
+
159
+ #### Option B: Standalone Service
160
+ Run Page Agent as a separate service that PoolBot communicates with via HTTP.
161
+
162
+ **Pros:**
163
+ - Isolated from PoolBot process
164
+ - Can use different Node.js version if needed
165
+ - Easier to update independently
166
+
167
+ **Cons:**
168
+ - Additional service management overhead
169
+ - Network latency
170
+ - More complex deployment
171
+
172
+ ### Implementation Phases
173
+
174
+ #### Phase 1: Basic Integration (Week 1-2)
175
+ - [ ] Create plugin structure
176
+ - [ ] Implement basic driver wrapper
177
+ - [ ] Add 3 core tools (navigate, act, extract)
178
+ - [ ] Create 1 skill (browser-control)
179
+ - [ ] Write tests
180
+
181
+ #### Phase 2: Advanced Features (Week 3-4)
182
+ - [ ] Multi-page workflow support
183
+ - [ ] Chrome extension integration
184
+ - [ ] Session persistence
185
+ - [ ] Additional skills (form-filling, data-extraction)
186
+ - [ ] Documentation
187
+
188
+ #### Phase 3: Optimization (Week 5-6)
189
+ - [ ] Performance tuning
190
+ - [ ] Error recovery
191
+ - [ ] Integration with existing PoolBot browser profiles
192
+ - [ ] CLI commands for Page Agent management
193
+
194
+ ### Dependencies
195
+ ```json
196
+ {
197
+ "dependencies": {
198
+ "@page-agent/core": "^1.x",
199
+ "@page-agent/page-controller": "^1.x",
200
+ "poolbot": "workspace:*"
201
+ }
202
+ }
203
+ ```
204
+
205
+ ---
206
+
207
+ ## 2. HexStrike AI Integration
208
+
209
+ ### Overview
210
+ HexStrike AI is a Python-based cybersecurity platform with 150+ tools and 12+ AI agents. It uses FastMCP protocol for AI agent communication, making it ideal for integration via PoolBot's MCP support.
211
+
212
+ ### Integration Strategy
213
+
214
+ #### MCP Client Bridge (Recommended)
215
+ Expose HexStrike AI as an MCP server that PoolBot can communicate with.
216
+
217
+ **Architecture:**
218
+ ```
219
+ PoolBot → MCP Client → HexStrike AI Server → Security Tools
220
+ ```
221
+
222
+ **Files to Create:**
223
+ ```
224
+ extensions/hexstrike-ai/
225
+ ├── package.json
226
+ ├── poolbot.plugin.json
227
+ ├── src/
228
+ │ ├── index.ts # Plugin entry point
229
+ │ ├── mcp-client.ts # MCP client implementation
230
+ │ ├── tools.ts # Security tool wrappers
231
+ │ ├── skills/
232
+ │ │ ├── reconnaissance.md
233
+ │ │ ├── vulnerability-scanning.md
234
+ │ │ ├── penetration-testing.md
235
+ │ │ └── ctf-solving.md
236
+ │ └── types.ts
237
+ ├── python-bridge/ # Optional: Python bridge for direct integration
238
+ │ ├── bridge.py
239
+ │ └── requirements.txt
240
+ ├── README.md
241
+ └── tsconfig.json
242
+ ```
243
+
244
+ **Key Components:**
245
+
246
+ 1. **MCP Client** (`mcp-client.ts`)
247
+ ```typescript
248
+ // Communicates with HexStrike AI FastMCP server
249
+ export class HexStrikeMcpClient {
250
+ private serverUrl: string;
251
+ private tools: Map<string, McpTool>;
252
+
253
+ async connect(): Promise<void>;
254
+ async listTools(): Promise<McpTool[]>;
255
+ async callTool(name: string, params: unknown): Promise<ToolResult>;
256
+ async scanTarget(target: string, scanType: ScanType): Promise<ScanResult>;
257
+ }
258
+ ```
259
+
260
+ 2. **Security Tools** (`tools.ts`)
261
+ ```typescript
262
+ // High-level security tools for PoolBot agents
263
+ export const hexstrikeTools: AnyAgentTool[] = [
264
+ {
265
+ name: "security_scan",
266
+ description: "Perform security scan on a target",
267
+ parameters: z.object({
268
+ target: z.string(),
269
+ scanType: z.enum(["port", "vulnerability", "web", "full"])
270
+ }),
271
+ execute: async ({ target, scanType }) => { /* ... */ }
272
+ },
273
+ {
274
+ name: "pentest_agent",
275
+ description: "Deploy AI pentesting agent for autonomous security testing",
276
+ parameters: z.object({
277
+ target: z.string(),
278
+ scope: z.string(),
279
+ duration: z.number().optional()
280
+ }),
281
+ execute: async ({ target, scope, duration }) => { /* ... */ }
282
+ },
283
+ {
284
+ name: "cve_lookup",
285
+ description: "Look up CVE information and available exploits",
286
+ parameters: z.object({ cveId: z.string() }),
287
+ execute: async ({ cveId }) => { /* ... */ }
288
+ },
289
+ {
290
+ name: "exploit_generate",
291
+ description: "Generate exploit code for a vulnerability",
292
+ parameters: z.object({
293
+ vulnerability: z.string(),
294
+ target: z.string()
295
+ }),
296
+ execute: async ({ vulnerability, target }) => { /* ... */ }
297
+ }
298
+ ];
299
+ ```
300
+
301
+ 3. **Skills** (in `skills/`)
302
+ - `reconnaissance.md`: Network and target reconnaissance
303
+ - `vulnerability-scanning.md`: Automated vulnerability assessment
304
+ - `penetration-testing.md`: Ethical hacking and pentesting workflows
305
+ - `ctf-solving.md`: Capture The Flag automation
306
+
307
+ #### Alternative: Direct Python Bridge
308
+ For deeper integration, create a Python bridge that runs HexStrike AI tools directly.
309
+
310
+ **Pros:**
311
+ - No separate server needed
312
+ - Lower latency
313
+ - Direct access to all tools
314
+
315
+ **Cons:**
316
+ - Python dependency management
317
+ - Process isolation concerns
318
+ - More complex error handling
319
+
320
+ ### Implementation Phases
321
+
322
+ #### Phase 1: MCP Integration (Week 1-2)
323
+ - [ ] Create MCP client for HexStrike AI
324
+ - [ ] Implement tool discovery
325
+ - [ ] Add 4 core security tools
326
+ - [ ] Create 2 skills (reconnaissance, vulnerability-scanning)
327
+ - [ ] Configuration management
328
+
329
+ #### Phase 2: Advanced Features (Week 3-4)
330
+ - [ ] Autonomous pentesting agent integration
331
+ - [ ] CTF solver integration
332
+ - [ ] Report generation
333
+ - [ ] Additional skills (pentesting, ctf-solving)
334
+ - [ ] Security-focused CLI commands
335
+
336
+ #### Phase 3: Hardening (Week 5-6)
337
+ - [ ] Security scanning of integration itself
338
+ - [ ] Permission system for security tools
339
+ - [ ] Audit logging
340
+ - [ ] Documentation and usage guidelines
341
+
342
+ ### Dependencies
343
+ ```json
344
+ {
345
+ "dependencies": {
346
+ "@anthropic-ai/mcp": "^1.x",
347
+ "poolbot": "workspace:*"
348
+ },
349
+ "optionalDependencies": {
350
+ "python-bridge": "^1.x" // For direct Python integration
351
+ }
352
+ }
353
+ ```
354
+
355
+ ### Security Considerations
356
+ - All security tools require explicit user authorization
357
+ - Audit logging for all security operations
358
+ - Scope limitations to prevent unauthorized scanning
359
+ - Safe defaults (dry-run mode for destructive operations)
360
+
361
+ ---
362
+
363
+ ## 3. xyOps Integration
364
+
365
+ ### Overview
366
+ xyOps is a Node.js-based workflow automation, job scheduling, and monitoring platform. It provides visual workflow editing, alerting, and incident response capabilities.
367
+
368
+ ### Integration Strategy
369
+
370
+ #### Plugin + Service Integration (Recommended)
371
+ Implement xyOps as a PoolBot plugin that can optionally integrate with a running xyOps instance.
372
+
373
+ **Files to Create:**
374
+ ```
375
+ extensions/xyops/
376
+ ├── package.json
377
+ ├── poolbot.plugin.json
378
+ ├── src/
379
+ │ ├── index.ts # Plugin entry
380
+ │ ├── client.ts # xyOps API client
381
+ │ ├── scheduler.ts # Job scheduling integration
382
+ │ ├── workflows.ts # Workflow management
383
+ │ ├── monitoring.ts # Monitoring integration
384
+ │ ├── tools.ts # Agent tools
385
+ │ ├── skills/
386
+ │ │ ├── workflow-automation.md
387
+ │ │ ├── job-scheduling.md
388
+ │ │ ├── monitoring.md
389
+ │ │ └── incident-response.md
390
+ │ └── types.ts
391
+ ├── embedded-server/ # Optional: embedded xyOps server
392
+ │ └── index.ts
393
+ ├── README.md
394
+ └── tsconfig.json
395
+ ```
396
+
397
+ **Key Components:**
398
+
399
+ 1. **API Client** (`client.ts`)
400
+ ```typescript
401
+ // Client for xyOps REST API
402
+ export class XyOpsClient {
403
+ private baseUrl: string;
404
+ private apiKey: string;
405
+
406
+ async createWorkflow(definition: WorkflowDefinition): Promise<Workflow>;
407
+ async scheduleJob(job: JobDefinition): Promise<ScheduledJob>;
408
+ async getMetrics(): Promise<SystemMetrics>;
409
+ async createAlert(rule: AlertRule): Promise<Alert>;
410
+ async createTicket(incident: Incident): Promise<Ticket>;
411
+ }
412
+ ```
413
+
414
+ 2. **Scheduler Integration** (`scheduler.ts`)
415
+ ```typescript
416
+ // Integrates with PoolBot's cron system
417
+ export class XyOpsScheduler {
418
+ async scheduleAgentTask(
419
+ task: string,
420
+ schedule: CronExpression,
421
+ params: unknown
422
+ ): Promise<ScheduledTask>;
423
+
424
+ async listScheduledTasks(): Promise<ScheduledTask[]>;
425
+ async cancelTask(taskId: string): Promise<void>;
426
+ }
427
+ ```
428
+
429
+ 3. **Agent Tools** (`tools.ts`)
430
+ ```typescript
431
+ // Workflow and automation tools
432
+ export const xyopsTools: AnyAgentTool[] = [
433
+ {
434
+ name: "workflow_create",
435
+ description: "Create a new automated workflow",
436
+ parameters: z.object({
437
+ name: z.string(),
438
+ steps: z.array(z.object({
439
+ action: z.string(),
440
+ params: z.record(z.unknown())
441
+ })),
442
+ triggers: z.array(z.string()).optional()
443
+ }),
444
+ execute: async ({ name, steps, triggers }) => { /* ... */ }
445
+ },
446
+ {
447
+ name: "job_schedule",
448
+ description: "Schedule a recurring job",
449
+ parameters: z.object({
450
+ name: z.string(),
451
+ schedule: z.string(), // Cron expression
452
+ task: z.string(),
453
+ params: z.record(z.unknown()).optional()
454
+ }),
455
+ execute: async ({ name, schedule, task, params }) => { /* ... */ }
456
+ },
457
+ {
458
+ name: "monitor_setup",
459
+ description: "Set up monitoring for a service or metric",
460
+ parameters: z.object({
461
+ target: z.string(),
462
+ metric: z.string(),
463
+ threshold: z.number(),
464
+ alertChannel: z.string()
465
+ }),
466
+ execute: async ({ target, metric, threshold, alertChannel }) => { /* ... */ }
467
+ },
468
+ {
469
+ name: "incident_create",
470
+ description: "Create an incident ticket",
471
+ parameters: z.object({
472
+ title: z.string(),
473
+ description: z.string(),
474
+ severity: z.enum(["low", "medium", "high", "critical"]),
475
+ assignee: z.string().optional()
476
+ }),
477
+ execute: async ({ title, description, severity, assignee }) => { /* ... */ }
478
+ }
479
+ ];
480
+ ```
481
+
482
+ 4. **Skills** (in `skills/`)
483
+ - `workflow-automation.md`: Creating and managing automated workflows
484
+ - `job-scheduling.md`: Cron jobs and scheduled tasks
485
+ - `monitoring.md`: System and service monitoring
486
+ - `incident-response.md`: Incident management and ticketing
487
+
488
+ #### Embedded Server Option
489
+ xyOps can also be embedded as a service within PoolBot:
490
+
491
+ ```typescript
492
+ // In embedded-server/index.ts
493
+ export function startEmbeddedXyOps(config: XyOpsConfig): Promise<XyOpsServer>;
494
+ ```
495
+
496
+ ### Implementation Phases
497
+
498
+ #### Phase 1: API Integration (Week 1-2)
499
+ - [ ] Create xyOps API client
500
+ - [ ] Implement workflow CRUD operations
501
+ - [ ] Add 4 core tools (workflow_create, job_schedule, monitor_setup, incident_create)
502
+ - [ ] Create 2 skills (workflow-automation, job-scheduling)
503
+ - [ ] Configuration management
504
+
505
+ #### Phase 2: Embedded Features (Week 3-4)
506
+ - [ ] Optional embedded xyOps server
507
+ - [ ] Integration with PoolBot's cron system
508
+ - [ ] Monitoring dashboard
509
+ - [ ] Additional skills (monitoring, incident-response)
510
+ - [ ] CLI commands for workflow management
511
+
512
+ #### Phase 3: Advanced Automation (Week 5-6)
513
+ - [ ] Visual workflow editor integration
514
+ - [ ] AI-generated workflows
515
+ - [ ] Cross-system automation (trigger actions in other integrations)
516
+ - [ ] Advanced monitoring and alerting
517
+
518
+ ### Dependencies
519
+ ```json
520
+ {
521
+ "dependencies": {
522
+ "xyops": "^1.x", // If published to npm
523
+ "node-cron": "^3.x",
524
+ "poolbot": "workspace:*"
525
+ }
526
+ }
527
+ ```
528
+
529
+ ---
530
+
531
+ ## Cross-Cutting Concerns
532
+
533
+ ### 1. Unified CLI Experience
534
+
535
+ New CLI commands for managing integrations:
536
+
537
+ ```bash
538
+ # Page Agent
539
+ poolbot browser agent <url> "find the login button and click it"
540
+ poolbot browser extract <url> "get all product prices"
541
+
542
+ # HexStrike AI
543
+ poolbot security scan <target> --type=full
544
+ poolbot security pentest <target> --scope=web
545
+ poolbot security cve CVE-2024-XXXX
546
+
547
+ # xyOps
548
+ poolbot workflow create --name="Daily Backup" --from-file=backup.yaml
549
+ poolbot workflow run <workflow-id>
550
+ poolbot schedule create --cron="0 2 * * *" --task="backup"
551
+ poolbot monitor status
552
+ ```
553
+
554
+ ### 2. Shared Configuration
555
+
556
+ All integrations use PoolBot's config system:
557
+
558
+ ```json
559
+ {
560
+ "integrations": {
561
+ "pageAgent": {
562
+ "enabled": true,
563
+ "driver": "page-agent",
564
+ "config": {
565
+ "model": "gpt-4",
566
+ "maxActions": 50
567
+ }
568
+ },
569
+ "hexstrike": {
570
+ "enabled": true,
571
+ "serverUrl": "http://localhost:8888",
572
+ "apiKey": "${HEXSTRIKE_API_KEY}",
573
+ "allowedTargets": ["*.internal.company.com"]
574
+ },
575
+ "xyops": {
576
+ "enabled": true,
577
+ "serverUrl": "http://localhost:3000",
578
+ "embedded": false,
579
+ "webhookSecret": "${XYOPS_WEBHOOK_SECRET}"
580
+ }
581
+ }
582
+ }
583
+ ```
584
+
585
+ ### 3. Event Integration
586
+
587
+ Integrations can emit and listen to events:
588
+
589
+ ```typescript
590
+ // Example: xyOps workflow triggers Page Agent action
591
+ plugin.on("workflow:step:execute", async (event) => {
592
+ if (event.step.type === "browser_action") {
593
+ const result = await pageAgent.execute(event.step.instruction);
594
+ return { result };
595
+ }
596
+ });
597
+
598
+ // Example: HexStrike finding triggers xyOps incident
599
+ plugin.on("security:finding:critical", async (event) => {
600
+ await xyops.createIncident({
601
+ title: `Critical vulnerability found: ${event.cve}`,
602
+ severity: "critical",
603
+ description: event.details
604
+ });
605
+ });
606
+ ```
607
+
608
+ ### 4. Shared Skills
609
+
610
+ Cross-project skills that combine capabilities:
611
+
612
+ ```markdown
613
+ ---
614
+ id: automated-security-audit
615
+ name: Automated Security Audit
616
+ version: 1.0.0
617
+ capabilities:
618
+ - browser
619
+ - security
620
+ - workflow
621
+ ---
622
+
623
+ # Automated Security Audit
624
+
625
+ Perform comprehensive security audits combining browser automation,
626
+ vulnerability scanning, and automated reporting.
627
+
628
+ ## Workflow
629
+
630
+ 1. Use Page Agent to navigate and map the target application
631
+ 2. Use HexStrike AI to scan for vulnerabilities
632
+ 3. Use xyOps to schedule recurring scans
633
+ 4. Generate and deliver audit reports
634
+ ```
635
+
636
+ ---
637
+
638
+ ## Implementation Timeline
639
+
640
+ ### Phase 1: Foundation (Weeks 1-2)
641
+ - [ ] Set up plugin development infrastructure
642
+ - [ ] Implement MCP client improvements for HexStrike
643
+ - [ ] Create shared integration utilities
644
+ - [ ] Begin Page Agent basic integration
645
+
646
+ ### Phase 2: Core Integrations (Weeks 3-6)
647
+ - [ ] Complete Page Agent integration
648
+ - [ ] Complete HexStrike AI integration
649
+ - [ ] Begin xyOps integration
650
+ - [ ] Write comprehensive tests
651
+
652
+ ### Phase 3: Advanced Features (Weeks 7-10)
653
+ - [ ] Complete xyOps integration
654
+ - [ ] Implement cross-integration features
655
+ - [ ] Add CLI commands
656
+ - [ ] Create documentation
657
+
658
+ ### Phase 4: Polish & Release (Weeks 11-12)
659
+ - [ ] Performance optimization
660
+ - [ ] Security audit
661
+ - [ ] User documentation
662
+ - [ ] Release candidate
663
+
664
+ ---
665
+
666
+ ## Success Metrics
667
+
668
+ | Metric | Target |
669
+ |--------|--------|
670
+ | Page Agent tool coverage | 90% of core features |
671
+ | HexStrike AI tool coverage | 80% of security tools |
672
+ | xyOps API coverage | 100% of core APIs |
673
+ | Test coverage | >70% for each integration |
674
+ | Documentation completeness | 100% of public APIs |
675
+ | CLI command coverage | All major features |
676
+
677
+ ---
678
+
679
+ ## Risk Assessment
680
+
681
+ | Risk | Likelihood | Impact | Mitigation |
682
+ |------|------------|--------|------------|
683
+ | Page Agent API changes | Medium | Medium | Version pinning, abstraction layer |
684
+ | HexStrike Python deps | Medium | High | Containerization, optional integration |
685
+ | xyOps breaking changes | Low | Medium | API versioning, client abstraction |
686
+ | Security tool misuse | Low | High | Permission system, audit logging |
687
+ | Performance degradation | Medium | Medium | Lazy loading, caching, profiling |
688
+
689
+ ---
690
+
691
+ ## Conclusion
692
+
693
+ This integration plan provides a roadmap for making PoolBot a complete and independent AI automation platform. By leveraging the existing plugin architecture and following PoolBot's design principles, these integrations will:
694
+
695
+ 1. **Enhance capabilities** without breaking existing functionality
696
+ 2. **Maintain independence** through optional, modular integrations
697
+ 3. **Follow best practices** for security, testing, and documentation
698
+ 4. **Enable new use cases** across browser automation, security, and infrastructure
699
+
700
+ The phased approach allows for incremental delivery and user feedback, ensuring each integration meets production quality standards before moving to the next phase.
701
+
702
+ ---
703
+
704
+ ## Appendix: File Locations
705
+
706
+ ### New Files
707
+ ```
708
+ extensions/page-agent/
709
+ (see structure above)
710
+
711
+ extensions/hexstrike-ai/
712
+ (see structure above)
713
+
714
+ extensions/xyops/
715
+ (see structure above)
716
+
717
+ src/skills/integrations/
718
+ ├── page-agent/
719
+ │ └── *.md
720
+ ├── hexstrike/
721
+ │ └── *.md
722
+ └── xyops/
723
+ └── *.md
724
+ ```
725
+
726
+ ### Modified Files (minimal)
727
+ ```
728
+ src/plugins/manifest.ts
729
+ - Add integration metadata fields
730
+
731
+ src/config/schema.ts
732
+ - Add integration config sections
733
+
734
+ src/cli/index.ts
735
+ - Register new CLI commands
736
+ ```
737
+
738
+ ### No Changes Required
739
+ - Core agent system
740
+ - Gateway server
741
+ - ACP protocol
742
+ - Existing plugin system
743
+ - Memory/embeddings system
744
+ - Browser system (Playwright driver)