@poolzin/pool-bot 2026.1.29 → 2026.1.30

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 (39) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.md +11 -0
  3. package/dist/agents/system-prompt.js +16 -16
  4. package/dist/agents/tools/memory-tool.js +2 -1
  5. package/dist/build-info.json +3 -3
  6. package/dist/cli/program/command-registry.js +5 -0
  7. package/dist/cli/program/register.completion.js +355 -0
  8. package/dist/gateway/hooks/index.js +53 -0
  9. package/dist/gateway/hooks/lifecycle-hooks-integration.js +256 -0
  10. package/dist/gateway/hooks/lifecycle-hooks.js +236 -0
  11. package/dist/gateway/hooks/progressive-disclosure-details.js +237 -0
  12. package/dist/gateway/hooks/progressive-disclosure-index.js +354 -0
  13. package/dist/gateway/hooks/progressive-disclosure-timeline.js +231 -0
  14. package/dist/gateway/hooks/progressive-disclosure-types.js +65 -0
  15. package/dist/gateway/hooks/progressive-disclosure.js +242 -0
  16. package/dist/gateway/hooks/tool-usage-capture.js +253 -0
  17. package/dist/gateway/hooks/tool-usage-storage.js +144 -0
  18. package/dist/gateway/server-methods/nodes.js +2 -0
  19. package/dist/gateway/server.impl.js +4 -0
  20. package/dist/imessage/monitor/monitor-provider.js +14 -1
  21. package/dist/media/store.js +37 -1
  22. package/dist/memory/index.js +5 -0
  23. package/dist/memory/manager.js +25 -2
  24. package/docs/WHATSAPP-HEARTBEAT-TROUBLESHOOTING.md +319 -0
  25. package/package.json +1 -1
  26. package/skills/webgpu-threejs-tsl/REFERENCE.md +283 -0
  27. package/skills/webgpu-threejs-tsl/SKILL.md +91 -0
  28. package/skills/webgpu-threejs-tsl/docs/compute-shaders.md +404 -0
  29. package/skills/webgpu-threejs-tsl/docs/core-concepts.md +453 -0
  30. package/skills/webgpu-threejs-tsl/docs/materials.md +353 -0
  31. package/skills/webgpu-threejs-tsl/docs/post-processing.md +434 -0
  32. package/skills/webgpu-threejs-tsl/docs/wgsl-integration.md +324 -0
  33. package/skills/webgpu-threejs-tsl/examples/basic-setup.js +87 -0
  34. package/skills/webgpu-threejs-tsl/examples/custom-material.js +170 -0
  35. package/skills/webgpu-threejs-tsl/examples/earth-shader.js +292 -0
  36. package/skills/webgpu-threejs-tsl/examples/particle-system.js +259 -0
  37. package/skills/webgpu-threejs-tsl/examples/post-processing.js +199 -0
  38. package/skills/webgpu-threejs-tsl/templates/compute-shader.js +305 -0
  39. package/skills/webgpu-threejs-tsl/templates/webgpu-project.js +276 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## v1.0.1 (2026-02-02)
2
+
3
+ ### WhatsApp Gateway Stability
4
+ - Add comprehensive WhatsApp heartbeat troubleshooting guide
5
+ - Document watchdog timeout and reconnection behavior
6
+ - Add configuration validation best practices
7
+ - Document professional incident response workflow
8
+
9
+ ### Configuration
10
+ - Document `web.heartbeatSeconds` override option
11
+ - Clarify `web.reconnect` schema and valid keys
12
+ - Add examples for timeout tuning (30min → 60min → 90min)
13
+ - Provide production-ready configuration templates
14
+
15
+ ### Documentation
16
+ - New: `docs/WHATSAPP-HEARTBEAT-TROUBLESHOOTING.md`
17
+ - Incident analysis: Gateway timeout recovery
18
+ - Lesson learned: Config validation before deployment
19
+ - Professional validation checklist included
20
+
21
+ ### Reliability
22
+ - Improved gateway recovery documentation
23
+ - Added monitoring and diagnostic commands
24
+ - Documented false-positive reduction strategies
25
+ - Best practices for different environments (prod/dev/test)
26
+
27
+ ---
28
+
1
29
  ## v1.0.0 (2026-01-28)
2
30
 
3
31
  ### Security Release
@@ -57,4 +85,4 @@
57
85
  - Migrated from Moltbot core
58
86
  - Implemented workspace-based development
59
87
  - Added dual model system configuration
60
- - Created persistent configuration system
88
+ - Created persistent configuration system
package/README.md CHANGED
@@ -59,6 +59,17 @@ Pool Bot supports an extensible skills system:
59
59
  - 🐦 **X/Twitter** - Social media engagement
60
60
  - And more...
61
61
 
62
+ See [skills directory](skills/) for the full list.
63
+
64
+ ## Companion Apps
65
+
66
+ Official companion apps for connecting devices to your Pool Bot gateway:
67
+
68
+ - **[Pool Apps](https://github.com/plcunha/pool-apps)** - Windows, Android, iOS nodes
69
+ - 🪟 **Windows Node v2** (Python) - Local LLM, STT/TTS, automation
70
+ - 📱 **Android** - Native mobile app
71
+ - 🍎 **iOS/macOS** - Apple ecosystem apps
72
+
62
73
  ## Configuration
63
74
 
64
75
  Pool Bot uses a profile-based configuration system:
@@ -59,7 +59,7 @@ function buildMessagingSection(params) {
59
59
  "## Messaging",
60
60
  "- Reply in current session → automatically routes to the source channel (Signal, Telegram, etc.)",
61
61
  "- Cross-session messaging → use sessions_send(sessionKey, message)",
62
- "- Never use exec/curl for provider messaging; Moltbot handles all routing internally.",
62
+ "- Never use exec/curl for provider messaging; Pool Bot handles all routing internally.",
63
63
  params.availableTools.has("message")
64
64
  ? [
65
65
  "",
@@ -95,12 +95,12 @@ function buildDocsSection(params) {
95
95
  return [];
96
96
  return [
97
97
  "## Documentation",
98
- `Moltbot docs: ${docsPath}`,
99
- "Mirror: https://docs.molt.bot",
100
- "Source: https://github.com/poolbot/poolbot",
98
+ `Pool Bot docs: ${docsPath}`,
99
+ "Mirror: https://docs.poolbot.dev",
100
+ "Source: https://github.com/poolzin/pool-bot",
101
101
  "Community: https://discord.com/discord.gg/poolbot",
102
- "Find new skills: https://clawdhub.com",
103
- "For Moltbot behavior, commands, config, or architecture: consult local docs first.",
102
+ "Find new skills: https://poolhub.com",
103
+ "For Pool Bot behavior, commands, config, or architecture: consult local docs first.",
104
104
  "When diagnosing issues, run `poolbot status` yourself when possible; only ask the user if you lack access (e.g., sandboxed).",
105
105
  "",
106
106
  ];
@@ -124,7 +124,7 @@ export function buildAgentSystemPrompt(params) {
124
124
  nodes: "List/describe/notify/camera/screen on paired nodes",
125
125
  cron: "Manage cron jobs and wake events (use for reminders; when scheduling a reminder, write the systemEvent text as something that will read like a reminder when it fires, and mention that it is a reminder depending on the time gap between setting and firing; include recent context in reminder text if appropriate)",
126
126
  message: "Send messages and channel actions",
127
- gateway: "Restart, apply config, or run updates on the running Moltbot process",
127
+ gateway: "Restart, apply config, or run updates on the running Pool Bot process",
128
128
  agents_list: "List agent ids allowed for sessions_spawn",
129
129
  sessions_list: "List other sessions (incl. sub-agents) with filters/last",
130
130
  sessions_history: "Fetch history for another session/sub-agent",
@@ -242,10 +242,10 @@ export function buildAgentSystemPrompt(params) {
242
242
  const workspaceNotes = (params.workspaceNotes ?? []).map((note) => note.trim()).filter(Boolean);
243
243
  // For "none" mode, return just the basic identity line
244
244
  if (promptMode === "none") {
245
- return "You are a personal assistant running inside Moltbot.";
245
+ return "You are a personal assistant running inside Pool Bot.";
246
246
  }
247
247
  const lines = [
248
- "You are a personal assistant running inside Moltbot.",
248
+ "You are a personal assistant running inside Pool Bot.",
249
249
  "",
250
250
  "## Tooling",
251
251
  "Tool availability (filtered by policy):",
@@ -260,7 +260,7 @@ export function buildAgentSystemPrompt(params) {
260
260
  "- apply_patch: apply multi-file patches",
261
261
  `- ${execToolName}: run shell commands (supports background via yieldMs/background)`,
262
262
  `- ${processToolName}: manage background exec sessions`,
263
- "- browser: control clawd's dedicated browser",
263
+ "- browser: control Pool Bot's dedicated browser",
264
264
  "- canvas: present/eval/snapshot the Canvas",
265
265
  "- nodes: list/describe/notify/camera/screen on paired nodes",
266
266
  "- cron: manage cron jobs and wake events (use for reminders; when scheduling a reminder, write the systemEvent text as something that will read like a reminder when it fires, and mention that it is a reminder depending on the time gap between setting and firing; include recent context in reminder text if appropriate)",
@@ -277,8 +277,8 @@ export function buildAgentSystemPrompt(params) {
277
277
  "Keep narration brief and value-dense; avoid repeating obvious steps.",
278
278
  "Use plain human language for narration unless in a technical context.",
279
279
  "",
280
- "## Moltbot CLI Quick Reference",
281
- "Moltbot is controlled via subcommands. Do not invent commands.",
280
+ "## Pool Bot CLI Quick Reference",
281
+ "Pool Bot is controlled via subcommands. Do not invent commands.",
282
282
  "To manage the Gateway daemon service (start/stop/restart):",
283
283
  "- poolbot gateway status",
284
284
  "- poolbot gateway start",
@@ -289,13 +289,13 @@ export function buildAgentSystemPrompt(params) {
289
289
  ...skillsSection,
290
290
  ...memorySection,
291
291
  // Skip self-update for subagent/none modes
292
- hasGateway && !isMinimal ? "## Moltbot Self-Update" : "",
292
+ hasGateway && !isMinimal ? "## Pool Bot Self-Update" : "",
293
293
  hasGateway && !isMinimal
294
294
  ? [
295
295
  "Get Updates (self-update) is ONLY allowed when the user explicitly asks for it.",
296
296
  "Do not run config.apply or update.run unless the user explicitly requests an update or config change; if it's not explicit, ask first.",
297
297
  "Actions: config.get, config.schema, config.apply (validate + write full config, then restart), update.run (update deps or git, then restart).",
298
- "After restart, Moltbot pings the last active session automatically.",
298
+ "After restart, Pool Bot pings the last active session automatically.",
299
299
  ].join("\n")
300
300
  : "",
301
301
  hasGateway && !isMinimal ? "" : "",
@@ -362,7 +362,7 @@ export function buildAgentSystemPrompt(params) {
362
362
  userTimezone,
363
363
  }),
364
364
  "## Workspace Files (injected)",
365
- "These user-editable files are loaded by Moltbot and included below in Project Context.",
365
+ "These user-editable files are loaded by Pool Bot and included below in Project Context.",
366
366
  "",
367
367
  ...buildReplyTagsSection(isMinimal),
368
368
  ...buildMessagingSection({
@@ -427,7 +427,7 @@ export function buildAgentSystemPrompt(params) {
427
427
  }
428
428
  // Skip heartbeats for subagent/none modes
429
429
  if (!isMinimal) {
430
- lines.push("## Heartbeats", heartbeatPromptLine, "If you receive a heartbeat poll (a user message matching the heartbeat prompt above), and there is nothing that needs attention, reply exactly:", "HEARTBEAT_OK", 'Moltbot treats a leading/trailing "HEARTBEAT_OK" as a heartbeat ack (and may discard it).', 'If something needs attention, do NOT include "HEARTBEAT_OK"; reply with the alert text instead.', "");
430
+ lines.push("## Heartbeats", heartbeatPromptLine, "If you receive a heartbeat poll (a user message matching the heartbeat prompt above), and there is nothing that needs attention, reply exactly:", "HEARTBEAT_OK", 'Pool Bot treats a leading/trailing "HEARTBEAT_OK" as a heartbeat ack (and may discard it).', 'If something needs attention, do NOT include "HEARTBEAT_OK"; reply with the alert text instead.', "");
431
431
  }
432
432
  lines.push("## Runtime", buildRuntimeLine(runtimeInfo, runtimeChannel, runtimeCapabilities, params.defaultThinkLevel), `Reasoning: ${reasoningLevel} (hidden unless on/stream). Toggle /reasoning; /status shows Reasoning when enabled.`);
433
433
  return lines.filter(Boolean).join("\n");
@@ -32,6 +32,7 @@ export function createMemorySearchTool(options) {
32
32
  const query = readStringParam(params, "query", { required: true });
33
33
  const maxResults = readNumberParam(params, "maxResults");
34
34
  const minScore = readNumberParam(params, "minScore");
35
+ // Legacy memory search system (PME removed 2026-02-03)
35
36
  const { manager, error } = await getMemorySearchManager({
36
37
  cfg,
37
38
  agentId,
@@ -55,7 +56,7 @@ export function createMemorySearchTool(options) {
55
56
  }
56
57
  catch (err) {
57
58
  const message = err instanceof Error ? err.message : String(err);
58
- return jsonResult({ results: [], disabled: true, error: message });
59
+ return jsonResult({ results: [], error: message });
59
60
  }
60
61
  },
61
62
  };
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.1.29",
3
- "commit": "af438fee8e9b7318099bc741e887ff95b612fbca",
4
- "builtAt": "2026-01-29T15:51:40.214Z"
2
+ "version": "2026.1.30",
3
+ "commit": "f991fb36d2821d852ed4bbeb0fe411140d236bd4",
4
+ "builtAt": "2026-02-04T14:14:13.069Z"
5
5
  }
@@ -8,6 +8,7 @@ import { registerBrowserCli } from "../browser-cli.js";
8
8
  import { registerConfigCli } from "../config-cli.js";
9
9
  import { registerMemoryCli, runMemoryStatus } from "../memory-cli.js";
10
10
  import { registerAgentCommands } from "./register.agent.js";
11
+ import { registerCompletionCommand } from "./register.completion.js";
11
12
  import { registerConfigureCommand } from "./register.configure.js";
12
13
  import { registerMaintenanceCommands } from "./register.maintenance.js";
13
14
  import { registerMessageCommands } from "./register.message.js";
@@ -94,6 +95,10 @@ export const commandRegistry = [
94
95
  id: "configure",
95
96
  register: ({ program }) => registerConfigureCommand(program),
96
97
  },
98
+ {
99
+ id: "completion",
100
+ register: ({ program }) => registerCompletionCommand(program),
101
+ },
97
102
  {
98
103
  id: "config",
99
104
  register: ({ program }) => registerConfigCli(program),
@@ -0,0 +1,355 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ function getBashTemplate(name) {
4
+ return [
5
+ "# Bash completion for " + name,
6
+ "# Installation: " + name + " completion --shell bash > /etc/bash_completion.d/" + name,
7
+ "# or source it in ~/.bashrc: source <(" + name + " completion --shell bash)",
8
+ "",
9
+ "_" + name + "_completion() {",
10
+ " local cur prev words cword",
11
+ " _init_completion || return",
12
+ ' local opts="--help --version --shell --output"',
13
+ ' local commands="setup configure status health sessions memory agents gateway node message browser channels pairing cron version completion"',
14
+ "",
15
+ " if [[ ${cur} == -* ]]; then",
16
+ ' COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )',
17
+ " return 0",
18
+ " fi",
19
+ "",
20
+ " if [[ ${cword} -eq 1 ]]; then",
21
+ ' COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )',
22
+ " return 0",
23
+ " fi",
24
+ "",
25
+ " # Command-specific completions",
26
+ ' local cmd="${words[1]}"',
27
+ ' case "${cmd}" in',
28
+ " status)",
29
+ ' COMPREPLY=( $(compgen -W "--json --deep --all --usage --timeout --verbose" -- "${cur}") )',
30
+ " ;;",
31
+ " sessions)",
32
+ ' COMPREPLY=( $(compgen -W "--json --store --active" -- "${cur}") )',
33
+ " ;;",
34
+ " agents)",
35
+ ' COMPREPLY=( $(compgen -W "list spawn send history status --json --bindings" -- "${cur}") )',
36
+ " ;;",
37
+ " memory)",
38
+ ' COMPREPLY=( $(compgen -W "status search --agent --json --deep --index --verbose" -- "${cur}") )',
39
+ " ;;",
40
+ " gateway)",
41
+ ' COMPREPLY=( $(compgen -W "status start restart stop config update --help" -- "${cur}") )',
42
+ " ;;",
43
+ " message)",
44
+ ' COMPREPLY=( $(compgen -W "send poll react --channel --to --help" -- "${cur}") )',
45
+ " ;;",
46
+ " channels)",
47
+ ' COMPREPLY=( $(compgen -W "add status list --help" -- "${cur}") )',
48
+ " ;;",
49
+ " cron)",
50
+ ' COMPREPLY=( $(compgen -W "status list add update remove run wake --help" -- "${cur}") )',
51
+ " ;;",
52
+ " *)",
53
+ " ;;",
54
+ " esac",
55
+ "}",
56
+ "",
57
+ "complete -F _" + name + "_completion " + name,
58
+ ].join("\n");
59
+ }
60
+ function getZshTemplate(name) {
61
+ return [
62
+ "#compdef " + name,
63
+ "# Zsh completion for " + name,
64
+ "# Installation: " +
65
+ name +
66
+ " completion --shell zsh > /usr/local/share/zsh/site-functions/_" +
67
+ name,
68
+ "# or ~/.zsh/completion/_" + name,
69
+ "# then add: autoload -U compinit && compinit",
70
+ "",
71
+ "_" + name + "() {",
72
+ " local -a commands",
73
+ " commands=(",
74
+ " 'setup:Run initial setup wizard'",
75
+ " 'configure:Configure settings'",
76
+ " 'status:Show system status'",
77
+ " 'health:Run health check'",
78
+ " 'sessions:Manage sessions'",
79
+ " 'memory:Manage memory and knowledge'",
80
+ " 'agents:Manage AI agents'",
81
+ " 'gateway:Control gateway daemon'",
82
+ " 'node:Manage paired nodes'",
83
+ " 'message:Send messages'",
84
+ " 'channels:Manage channels'",
85
+ " 'pairing:Manage pairing requests'",
86
+ " 'cron:Manage cron jobs'",
87
+ " 'browser:Control browser'",
88
+ " 'version:Show version'",
89
+ " 'completion:Generate shell completion'",
90
+ " )",
91
+ "",
92
+ " if [[ ${words[2]} == status ]]; then",
93
+ " _arguments -C \\",
94
+ " '--deep[Show detailed status]' \\",
95
+ " '--all[Show all information]' \\",
96
+ " '--usage[Show usage statistics]' \\",
97
+ " '--timeout[Timeout in milliseconds]' \\",
98
+ " '--help[Show help]' \\",
99
+ " '--verbose[Enable verbose output]' \\",
100
+ " '--json[Output JSON format]'",
101
+ " elif [[ ${words[2]} == sessions ]]; then",
102
+ " _arguments -C \\",
103
+ " '--store[Session store path]' \\",
104
+ " '--active[Show active sessions only]' \\",
105
+ " '--help[Show help]' \\",
106
+ " '--verbose[Enable verbose output]' \\",
107
+ " '--json[Output JSON format]'",
108
+ " elif [[ ${words[2]} == agents ]]; then",
109
+ " _alternative \\",
110
+ " 'commands::commands:(list spawn send history status)' \\",
111
+ " '--bindings[Show model bindings]' \\",
112
+ " '--help[Show help]' \\",
113
+ " '--verbose[Enable verbose output]' \\",
114
+ " '--json[Output JSON format]'",
115
+ " elif [[ ${words[2]} == memory ]]; then",
116
+ " _alternative \\",
117
+ " 'commands::commands:(status search)' \\",
118
+ " '--agent[Agent ID]' \\",
119
+ " '--deep[Deep scan]' \\",
120
+ " '--index[Rebuild index]' \\",
121
+ " '--help[Show help]' \\",
122
+ " '--verbose[Enable verbose output]' \\",
123
+ " '--json[Output JSON format]'",
124
+ " elif [[ ${words[2]} == gateway ]]; then",
125
+ " _alternative \\",
126
+ " 'commands::commands:(status start restart stop config update)' \\",
127
+ " '--help[Show help]'",
128
+ " elif [[ ${words[2]} == message ]]; then",
129
+ " _alternative \\",
130
+ " 'commands::commands:(send poll react)' \\",
131
+ " '--channel[Channel ID]' \\",
132
+ " '--to[Recipient]' \\",
133
+ " '--help[Show help]'",
134
+ " elif [[ ${words[2]} == channels ]]; then",
135
+ " _alternative \\",
136
+ " 'commands::commands:(add status list)' \\",
137
+ " '--help[Show help]'",
138
+ " elif [[ ${words[2]} == cron ]]; then",
139
+ " _alternative \\",
140
+ " 'commands::commands:(status list add update remove run wake)' \\",
141
+ " '--help[Show help]'",
142
+ " else",
143
+ " _describe -V commands commands",
144
+ " _arguments -C \\",
145
+ " '(-h --help)'{-h,--help}'[Show help]' \\",
146
+ " '(-v --verbose)'{-v,--verbose}'[Enable verbose output]' \\",
147
+ " '--json[Output JSON format]'",
148
+ " fi",
149
+ "}",
150
+ "",
151
+ "_" + name + ' "$@"',
152
+ ].join("\n");
153
+ }
154
+ function getFishTemplate(name) {
155
+ return [
156
+ "# Fish completion for " + name,
157
+ "# Installation: " +
158
+ name +
159
+ " completion --shell fish > ~/.config/fish/completions/" +
160
+ name +
161
+ ".fish",
162
+ "",
163
+ "complete -c " + name + " -f",
164
+ "",
165
+ "# Commands",
166
+ "complete -c " + name + " -n __fish_use_subcommand -a setup -d 'Run initial setup wizard'",
167
+ "complete -c " + name + " -n __fish_use_subcommand -a configure -d 'Configure settings'",
168
+ "complete -c " + name + " -n __fish_use_subcommand -a status -d 'Show system status'",
169
+ "complete -c " + name + " -n __fish_use_subcommand -a health -d 'Run health check'",
170
+ "complete -c " + name + " -n __fish_use_subcommand -a sessions -d 'Manage sessions'",
171
+ "complete -c " + name + " -n __fish_use_subcommand -a memory -d 'Manage memory and knowledge'",
172
+ "complete -c " + name + " -n __fish_use_subcommand -a agents -d 'Manage AI agents'",
173
+ "complete -c " + name + " -n __fish_use_subcommand -a gateway -d 'Control gateway daemon'",
174
+ "complete -c " + name + " -n __fish_use_subcommand -a node -d 'Manage paired nodes'",
175
+ "complete -c " + name + " -n __fish_use_subcommand -a message -d 'Send messages'",
176
+ "complete -c " + name + " -n __fish_use_subcommand -a channels -d 'Manage channels'",
177
+ "complete -c " + name + " -n __fish_use_subcommand -a pairing -d 'Manage pairing requests'",
178
+ "complete -c " + name + " -n __fish_use_subcommand -a cron -d 'Manage cron jobs'",
179
+ "complete -c " + name + " -n __fish_use_subcommand -a browser -d 'Control browser'",
180
+ "complete -c " + name + " -n __fish_use_subcommand -a version -d 'Show version'",
181
+ "complete -c " +
182
+ name +
183
+ " -n __fish_use_subcommand -a completion -d 'Generate shell completion'",
184
+ "",
185
+ "# Global options",
186
+ "complete -c " + name + " -s h -l help -d 'Show help'",
187
+ "complete -c " + name + " -s v -l verbose -d 'Enable verbose output'",
188
+ "complete -c " + name + " -l json -d 'Output JSON format'",
189
+ "",
190
+ "# Command: status",
191
+ "complete -c " +
192
+ name +
193
+ " -n '__fish_seen_subcommand_from status' -l deep -d 'Show detailed status'",
194
+ "complete -c " +
195
+ name +
196
+ " -n '__fish_seen_subcommand_from status' -l all -d 'Show all information'",
197
+ "complete -c " +
198
+ name +
199
+ " -n '__fish_seen_subcommand_from status' -l usage -d 'Show usage statistics'",
200
+ "complete -c " +
201
+ name +
202
+ " -n '__fish_seen_subcommand_from status' -l timeout -d 'Timeout in milliseconds'",
203
+ "",
204
+ "# Command: sessions",
205
+ "complete -c " +
206
+ name +
207
+ " -n '__fish_seen_subcommand_from sessions' -l store -d 'Session store path'",
208
+ "complete -c " +
209
+ name +
210
+ " -n '__fish_seen_subcommand_from sessions' -l active -d 'Show active sessions only'",
211
+ "",
212
+ "# Command: agents",
213
+ "complete -c " +
214
+ name +
215
+ " -n '__fish_seen_subcommand_from agents' -a list -d 'List available agents'",
216
+ "complete -c " +
217
+ name +
218
+ " -n '__fish_seen_subcommand_from agents' -a spawn -d 'Spawn a new agent'",
219
+ "complete -c " +
220
+ name +
221
+ " -n '__fish_seen_subcommand_from agents' -a send -d 'Send message to agent'",
222
+ "complete -c " +
223
+ name +
224
+ " -n '__fish_seen_subcommand_from agents' -a history -d 'Show agent history'",
225
+ "complete -c " +
226
+ name +
227
+ " -n '__fish_seen_subcommand_from agents' -a status -d 'Show agent status'",
228
+ "complete -c " +
229
+ name +
230
+ " -n '__fish_seen_subcommand_from agents' -l bindings -d 'Show model bindings'",
231
+ "",
232
+ "# Command: memory",
233
+ "complete -c " +
234
+ name +
235
+ " -n '__fish_seen_subcommand_from memory' -a status -d 'Show memory status'",
236
+ "complete -c " + name + " -n '__fish_seen_subcommand_from memory' -a search -d 'Search memory'",
237
+ "complete -c " + name + " -n '__fish_seen_subcommand_from memory' -l agent -d 'Agent ID'",
238
+ "complete -c " + name + " -n '__fish_seen_subcommand_from memory' -l deep -d 'Deep scan'",
239
+ "complete -c " + name + " -n '__fish_seen_subcommand_from memory' -l index -d 'Rebuild index'",
240
+ "",
241
+ "# Command: gateway",
242
+ "complete -c " +
243
+ name +
244
+ " -n '__fish_seen_subcommand_from gateway' -a status -d 'Show gateway status'",
245
+ "complete -c " + name + " -n '__fish_seen_subcommand_from gateway' -a start -d 'Start gateway'",
246
+ "complete -c " +
247
+ name +
248
+ " -n '__fish_seen_subcommand_from gateway' -a restart -d 'Restart gateway'",
249
+ "complete -c " + name + " -n '__fish_seen_subcommand_from gateway' -a stop -d 'Stop gateway'",
250
+ "complete -c " +
251
+ name +
252
+ " -n '__fish_seen_subcommand_from gateway' -a config -d 'Manage config'",
253
+ "complete -c " +
254
+ name +
255
+ " -n '__fish_seen_subcommand_from gateway' -a update -d 'Update gateway'",
256
+ "",
257
+ "# Command: message",
258
+ "complete -c " + name + " -n '__fish_seen_subcommand_from message' -a send -d 'Send message'",
259
+ "complete -c " + name + " -n '__fish_seen_subcommand_from message' -a poll -d 'Create poll'",
260
+ "complete -c " + name + " -n '__fish_seen_subcommand_from message' -a react -d 'Add reaction'",
261
+ "complete -c " + name + " -n '__fish_seen_subcommand_from message' -l channel -d 'Channel ID'",
262
+ "complete -c " + name + " -n '__fish_seen_subcommand_from message' -l to -d 'Recipient'",
263
+ "",
264
+ "# Command: channels",
265
+ "complete -c " + name + " -n '__fish_seen_subcommand_from channels' -a add -d 'Add channel'",
266
+ "complete -c " +
267
+ name +
268
+ " -n '__fish_seen_subcommand_from channels' -a status -d 'Show channel status'",
269
+ "complete -c " + name + " -n '__fish_seen_subcommand_from channels' -a list -d 'List channels'",
270
+ "",
271
+ "# Command: cron",
272
+ "complete -c " +
273
+ name +
274
+ " -n '__fish_seen_subcommand_from cron' -a status -d 'Show cron status'",
275
+ "complete -c " + name + " -n '__fish_seen_subcommand_from cron' -a list -d 'List cron jobs'",
276
+ "complete -c " + name + " -n '__fish_seen_subcommand_from cron' -a add -d 'Add cron job'",
277
+ "complete -c " + name + " -n '__fish_seen_subcommand_from cron' -a update -d 'Update cron job'",
278
+ "complete -c " + name + " -n '__fish_seen_subcommand_from cron' -a remove -d 'Remove cron job'",
279
+ "complete -c " + name + " -n '__fish_seen_subcommand_from cron' -a run -d 'Run cron job'",
280
+ "complete -c " + name + " -n '__fish_seen_subcommand_from cron' -a wake -d 'Send wake event'",
281
+ ].join("\n");
282
+ }
283
+ export function registerCompletionCommand(program) {
284
+ const binaryName = path.basename(process.argv[1] ?? "poolbot", ".js");
285
+ program
286
+ .command("completion")
287
+ .description("Generate shell completion script")
288
+ .option("--shell <type>", "Shell type (bash, zsh, fish)", "bash")
289
+ .option("--output <path>", "Write to file instead of stdout")
290
+ .action((options) => {
291
+ const { shell, output } = options;
292
+ let script;
293
+ if (shell === "bash") {
294
+ script = getBashTemplate(binaryName);
295
+ }
296
+ else if (shell === "zsh") {
297
+ script = getZshTemplate(binaryName);
298
+ }
299
+ else if (shell === "fish") {
300
+ script = getFishTemplate(binaryName);
301
+ }
302
+ else {
303
+ console.error("Unsupported shell: " + shell);
304
+ console.error("Supported shells: bash, zsh, fish");
305
+ process.exit(1);
306
+ }
307
+ if (output) {
308
+ try {
309
+ const outputPath = path.resolve(output);
310
+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });
311
+ fs.writeFileSync(outputPath, script, "utf-8");
312
+ console.log("✅ Completion script written to: " + outputPath);
313
+ console.log("\n📝 Installation instructions:");
314
+ printInstallInstructions(shell, outputPath, binaryName);
315
+ }
316
+ catch (err) {
317
+ console.error("❌ Failed to write completion script: " + err);
318
+ process.exit(1);
319
+ }
320
+ }
321
+ else {
322
+ console.log(script);
323
+ }
324
+ });
325
+ }
326
+ function printInstallInstructions(shell, outputPath, binaryName) {
327
+ const instructions = {
328
+ bash: [
329
+ "# Add to ~/.bashrc or run:",
330
+ "source " + outputPath,
331
+ "",
332
+ "# Or system-wide (requires root):",
333
+ "sudo cp " + outputPath + " /etc/bash_completion.d/" + binaryName,
334
+ ],
335
+ zsh: [
336
+ "# Add to ~/.zshrc:",
337
+ "fpath=(" + path.dirname(outputPath) + " $fpath)",
338
+ "autoload -U compinit && compinit",
339
+ "",
340
+ "# Or copy to system location:",
341
+ "sudo cp " + outputPath + " /usr/local/share/zsh/site-functions/_" + binaryName,
342
+ ],
343
+ fish: [
344
+ "# Fish will automatically load completions from:",
345
+ "# " + outputPath,
346
+ "",
347
+ "# Just restart your shell or run:",
348
+ "source " + outputPath,
349
+ ],
350
+ };
351
+ const lines = instructions[shell] || [];
352
+ if (lines.length > 0) {
353
+ console.log(lines.join("\n"));
354
+ }
355
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Gateway Hooks Module
3
+ *
4
+ * Exports all hook-related functionality for easy importing
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { registerHooks, triggerHook } from "./gateway/hooks/index.js";
9
+ * ```
10
+ */
11
+ // Core lifecycle hooks
12
+ export {
13
+ // Feature flags
14
+ LIFECYCLE_HOOKS_ENABLED, HOOK_DEBUG_MODE,
15
+ // Registration
16
+ registerHooks, unregisterHooks, getHooks, hasHooks, getRegisteredSessionKeys,
17
+ // Triggering
18
+ triggerHook,
19
+ // Stats
20
+ getRegistryStats,
21
+ // Default hooks
22
+ defaultOnSessionStart, defaultOnSessionEnd, registerDefaultHooks,
23
+ // Utilities
24
+ clearAllHooks, } from "./lifecycle-hooks.js";
25
+ // Integration with agent events
26
+ export { startLifecycleHooksIntegration, getIntegrationStats, isSessionTracked, getTrackedSessionInfo, clearTrackedSessions, removeTrackedSession, } from "./lifecycle-hooks-integration.js";
27
+ // Tool usage capture (Day 2 - to be implemented)
28
+ // export {
29
+ // toolUsageCaptureHook,
30
+ // loadSessionToolUsage,
31
+ // saveSessionToolUsage,
32
+ // } from "./tool-usage-capture.js";
33
+ // Progressive disclosure (Day 3 - PHASE 5 COMPLETE - FEATURE FLAGGED, OPT-IN)
34
+ // export {
35
+ // memory_search_v2,
36
+ // searchIndex,
37
+ // searchTimeline,
38
+ // searchDetails,
39
+ // clearProgressiveDisclosureCache,
40
+ // resetProgressiveDisclosure,
41
+ // getProgressiveDisclosureStats,
42
+ // PROGRESSIVE_DISCLOSURE_ENABLED,
43
+ // type MemorySearchResultV2,
44
+ // type SearchResult,
45
+ // type TimelineEntry,
46
+ // type MemoryDetail,
47
+ // type SearchMetadata,
48
+ // type SearchLayer,
49
+ // type MemorySearchOptions,
50
+ // type QueryFilter,
51
+ // type SearchResultOrError,
52
+ // type SearchError,
53
+ // } from "./progressive-disclosure.js";