@poolzin/pool-bot 2026.3.22 → 2026.3.23
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 +54 -0
- package/dist/acp/bindings-store.js +209 -0
- package/dist/acp/control-plane/runtime-cache.js +54 -0
- package/dist/acp/control-plane/runtime-options.js +215 -0
- package/dist/acp/control-plane/session-actor-queue.js +36 -0
- package/dist/acp/runtime/errors.js +47 -0
- package/dist/acp/runtime/registry.js +86 -0
- package/dist/acp/runtime/types.js +1 -0
- package/dist/acp/translator.js +97 -0
- package/dist/agents/failover-error.js +145 -47
- package/dist/browser/browser-profile-manager.js +319 -0
- package/dist/browser/cdp-proxy-bypass.js +129 -0
- package/dist/browser/cdp-timeouts.js +41 -0
- package/dist/browser/chrome-extension-validator.js +406 -0
- package/dist/browser/chrome-mcp-snapshot.js +222 -0
- package/dist/browser/chrome-mcp.js +421 -0
- package/dist/browser/chrome-mcp.snapshot.js +133 -0
- package/dist/browser/errors.js +67 -0
- package/dist/browser/form-fields.js +22 -0
- package/dist/browser/output-atomic.js +44 -0
- package/dist/browser/profile-capabilities.js +47 -0
- package/dist/browser/safe-filename.js +25 -0
- package/dist/browser/snapshot-roles.js +60 -0
- package/dist/build-info.json +3 -3
- package/dist/commands/security-owner-only.js +86 -0
- package/dist/control-ui/assets/{index-Dvkl4Xlx.js → index-D7shnQwQ.js} +404 -388
- package/dist/control-ui/assets/index-D7shnQwQ.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/cron/cron-filters.js +150 -0
- package/dist/gateway/device-pairing-security.js +197 -0
- package/dist/gateway/event-deduplication.js +167 -0
- package/dist/gateway/run-tracker.js +253 -0
- package/dist/gateway/server-methods/nodes.js +14 -0
- package/dist/gateway/websocket-preauth-security.js +188 -0
- package/dist/infra/errors.js +53 -13
- package/dist/infra/exec-approvals-security.js +217 -0
- package/dist/infra/security/command-analyzer.js +257 -0
- package/dist/plugins/loader.js +16 -8
- package/dist/security/external-content.js +51 -1
- package/dist/sessions/session-costs.js +228 -0
- package/dist/shared/param-key.js +16 -0
- package/dist/shared/poll-params.js +58 -0
- package/dist/shared/polls.js +55 -0
- package/docs/DASHBOARD-GAP-ANALYSIS-AND-PLAN.md +430 -0
- package/docs/FEATURES.md +523 -0
- package/docs/FINAL-IMPLEMENTATION-REVIEW.md +274 -0
- package/docs/FINAL-IMPLEMENTATION-SUMMARY.md +356 -0
- package/docs/FINAL-PROFESSIONAL-EVALUATION.md +312 -0
- package/docs/IMPLEMENTATION-PRIORITY-EVALUATION.md +298 -0
- package/docs/IMPLEMENTATION-PROGRESS.md +237 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE1-2.md +381 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE4.md +389 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE5.md +420 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE6.md +422 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE7-FINAL.md +184 -0
- package/docs/MIKRODASH-ANALYSIS.md +412 -0
- package/docs/OPENCLAW-GAP-ANALYSIS-FINAL.md +431 -0
- package/docs/OPENCLAW-VS-POOLBOT-ANALYSIS.md +351 -0
- package/docs/PHASE-7-SUMMARY.md +144 -0
- package/docs/POOLBOT-OFFICE-PLAN.md +697 -0
- package/docs/PROJECT-FINAL-STATUS.md +237 -0
- package/docs/README.md +116 -0
- package/docs/REAL-IMPROVEMENTS-EVALUATION.md +477 -0
- package/docs/SECURITY-HARDENING-IMPLEMENTATION.md +161 -0
- package/docs/channels/googlechat.md +235 -206
- package/docs/channels/irc.md +332 -0
- package/docs/channels/nostr.md +255 -168
- package/docs/components/command-palette.md +166 -0
- package/docs/components/login-gate.md +219 -0
- package/docs/getting-started/installation.md +191 -0
- package/docs/getting-started/introduction.md +120 -0
- package/docs/improvements/USAGE-GUIDE.md +359 -0
- package/docs/plans/2026-03-15-openclaw-features-implementation.md +1632 -0
- package/docs/reference/deadcode-detection.md +72 -0
- package/extensions/acpx/node_modules/.bin/acpx +21 -0
- package/extensions/agency-agents/node_modules/.bin/vite +4 -4
- package/extensions/agency-agents/node_modules/.bin/vitest +2 -2
- package/extensions/googlechat/node_modules/.bin/tsc +21 -0
- package/extensions/googlechat/node_modules/.bin/tsserver +21 -0
- package/extensions/googlechat/node_modules/.bin/vitest +21 -0
- package/extensions/googlechat/package.json +11 -28
- package/extensions/googlechat/src/googlechat-channel.test.ts +60 -0
- package/extensions/googlechat/src/googlechat-channel.ts +120 -0
- package/extensions/googlechat/src/index.ts +14 -0
- package/extensions/irc/node_modules/.bin/tsc +21 -0
- package/extensions/irc/node_modules/.bin/tsserver +21 -0
- package/extensions/irc/node_modules/.bin/vitest +21 -0
- package/extensions/irc/package.json +16 -8
- package/extensions/irc/src/index.ts +14 -0
- package/extensions/irc/src/irc-channel.test.ts +43 -0
- package/extensions/irc/src/irc-channel.ts +191 -0
- package/extensions/keyed-async-queue/node_modules/.bin/tsc +21 -0
- package/extensions/keyed-async-queue/node_modules/.bin/tsserver +21 -0
- package/extensions/keyed-async-queue/node_modules/.bin/vitest +21 -0
- package/extensions/keyed-async-queue/package.json +20 -0
- package/extensions/keyed-async-queue/src/index.ts +14 -0
- package/extensions/keyed-async-queue/src/queue.test.ts +135 -0
- package/extensions/keyed-async-queue/src/queue.ts +200 -0
- package/extensions/memory-core/node_modules/.bin/tsc +21 -0
- package/extensions/memory-core/node_modules/.bin/tsserver +21 -0
- package/extensions/memory-core/node_modules/.bin/vitest +21 -0
- package/extensions/memory-core/package.json +11 -8
- package/extensions/memory-core/src/index.ts +14 -0
- package/extensions/memory-core/src/memory-manager.test.ts +124 -0
- package/extensions/memory-core/src/memory-manager.ts +186 -0
- package/extensions/nostr/node_modules/.bin/tsc +2 -2
- package/extensions/nostr/node_modules/.bin/tsserver +2 -2
- package/extensions/nostr/node_modules/.bin/vitest +21 -0
- package/extensions/nostr/package.json +15 -24
- package/extensions/nostr/src/index.ts +14 -0
- package/extensions/nostr/src/nostr-channel.test.ts +55 -0
- package/extensions/nostr/src/nostr-channel.ts +228 -0
- package/extensions/page-agent/node_modules/.bin/vitest +2 -2
- package/extensions/test-utils/node_modules/.bin/jiti +21 -0
- package/extensions/test-utils/node_modules/.bin/playwright +21 -0
- package/extensions/test-utils/node_modules/.bin/tsx +21 -0
- package/extensions/test-utils/node_modules/.bin/vite +21 -0
- package/extensions/test-utils/node_modules/.bin/vitest +21 -0
- package/extensions/test-utils/node_modules/.bin/yaml +21 -0
- package/extensions/xyops/node_modules/.bin/vitest +2 -2
- package/package.json +2 -1
- package/dist/control-ui/assets/index-Dvkl4Xlx.js.map +0 -1
- package/extensions/googlechat/node_modules/.bin/poolbot +0 -21
- package/extensions/memory-core/node_modules/.bin/poolbot +0 -21
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Deadcode Detection
|
|
2
|
+
|
|
3
|
+
Pool Bot uses multiple tools to detect unused code, exports, and dependencies.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
### 1. Knip
|
|
8
|
+
|
|
9
|
+
Detects unused files, dependencies, and exports in your TypeScript project.
|
|
10
|
+
|
|
11
|
+
**Usage:**
|
|
12
|
+
```bash
|
|
13
|
+
pnpm deadcode # Run detection
|
|
14
|
+
pnpm deadcode:fix # Auto-fix where possible
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Configuration:** `.knip.jsonc`
|
|
18
|
+
|
|
19
|
+
### 2. ts-prune
|
|
20
|
+
|
|
21
|
+
Finds unused exports in TypeScript projects.
|
|
22
|
+
|
|
23
|
+
**Usage:**
|
|
24
|
+
```bash
|
|
25
|
+
npx ts-prune
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 3. ts-unused-exports
|
|
29
|
+
|
|
30
|
+
Finds unused exports with more granular control.
|
|
31
|
+
|
|
32
|
+
**Usage:**
|
|
33
|
+
```bash
|
|
34
|
+
npx ts-unused-exports tsconfig.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## CI Integration
|
|
38
|
+
|
|
39
|
+
Deadcode detection runs in CI on every PR. Failures block merging.
|
|
40
|
+
|
|
41
|
+
## Best Practices
|
|
42
|
+
|
|
43
|
+
1. **Remove dead code promptly** - Don't let it accumulate
|
|
44
|
+
2. **Use `// knip:ignore` comments** - For intentional false positives
|
|
45
|
+
3. **Run locally before pushing** - Catch issues early
|
|
46
|
+
4. **Review warnings carefully** - Some may be intentional
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
See `.knip.jsonc` for entry points and ignore patterns.
|
|
51
|
+
|
|
52
|
+
## Troubleshooting
|
|
53
|
+
|
|
54
|
+
### False Positives
|
|
55
|
+
|
|
56
|
+
If knip reports code as unused but it's actually used:
|
|
57
|
+
|
|
58
|
+
1. Add to `ignore` in `.knip.jsonc`
|
|
59
|
+
2. Use `// knip:ignore` comment
|
|
60
|
+
3. Check if it's dynamically imported
|
|
61
|
+
|
|
62
|
+
### Missing Entry Points
|
|
63
|
+
|
|
64
|
+
Add entry points to `.knip.jsonc`:
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"entry": [
|
|
68
|
+
"src/index.ts",
|
|
69
|
+
"src/cli/index.ts"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/acpx@0.3.0_zod@4.3.6/node_modules/acpx/dist/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/acpx@0.3.0_zod@4.3.6/node_modules/acpx/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/acpx@0.3.0_zod@4.3.6/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/acpx@0.3.0_zod@4.3.6/node_modules/acpx/dist/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/acpx@0.3.0_zod@4.3.6/node_modules/acpx/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/acpx@0.3.0_zod@4.3.6/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../acpx/dist/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../acpx/dist/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -10,12 +10,12 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/vite.js" "$@"
|
|
19
19
|
else
|
|
20
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.
|
|
20
|
+
exec node "$basedir/../../../../node_modules/.pnpm/vite@7.3.1_@types+node@22.19.15_jiti@2.6.1_lightningcss@1.31.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/vite.js" "$@"
|
|
21
21
|
fi
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@3.2.4_@types+node@22.19.15_@vitest+browser@4.0.18_vite@7.3.
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.15_@vitest+browser@4.0.18_vite@7.3.1_a261f604c6bbd7c7044da940aa93c023/node_modules/vitest/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.15_@vitest+browser@4.0.18_vite@7.3.1_a261f604c6bbd7c7044da940aa93c023/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@3.2.4_@types+node@22.19.15_@vitest+browser@4.0.18_vite@7.3.
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.15_@vitest+browser@4.0.18_vite@7.3.1_a261f604c6bbd7c7044da940aa93c023/node_modules/vitest/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.15_@vitest+browser@4.0.18_vite@7.3.1_a261f604c6bbd7c7044da940aa93c023/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules/vitest/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules/vitest/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -1,39 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poolbot/googlechat",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Google Chat channel extension for Pool Bot",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
"channel": {
|
|
11
|
-
"id": "googlechat",
|
|
12
|
-
"label": "Google Chat",
|
|
13
|
-
"selectionLabel": "Google Chat (Chat API)",
|
|
14
|
-
"detailLabel": "Google Chat",
|
|
15
|
-
"docsPath": "/channels/googlechat",
|
|
16
|
-
"docsLabel": "googlechat",
|
|
17
|
-
"blurb": "Google Workspace Chat app via HTTP webhooks.",
|
|
18
|
-
"aliases": [
|
|
19
|
-
"gchat",
|
|
20
|
-
"google-chat"
|
|
21
|
-
],
|
|
22
|
-
"order": 55
|
|
23
|
-
},
|
|
24
|
-
"install": {
|
|
25
|
-
"npmSpec": "@poolbot/googlechat",
|
|
26
|
-
"localPath": "extensions/googlechat",
|
|
27
|
-
"defaultChoice": "npm"
|
|
28
|
-
}
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "vitest run",
|
|
9
|
+
"build": "tsc"
|
|
29
10
|
},
|
|
30
11
|
"dependencies": {
|
|
31
|
-
"
|
|
12
|
+
"googleapis": "^140.0.0"
|
|
32
13
|
},
|
|
33
14
|
"devDependencies": {
|
|
34
|
-
"@
|
|
15
|
+
"@types/node": "^20.0.0",
|
|
16
|
+
"typescript": "^5.0.0",
|
|
17
|
+
"vitest": "^1.0.0"
|
|
35
18
|
},
|
|
36
19
|
"peerDependencies": {
|
|
37
|
-
"
|
|
20
|
+
"poolbot": "workspace:*"
|
|
38
21
|
}
|
|
39
22
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { GoogleChatChannel, createGoogleChatChannel } from "./googlechat-channel";
|
|
3
|
+
|
|
4
|
+
describe("GoogleChatChannel", () => {
|
|
5
|
+
const mockConfig = {
|
|
6
|
+
credentials: {
|
|
7
|
+
client_email: "test@project.iam.gserviceaccount.com",
|
|
8
|
+
private_key: "-----BEGIN PRIVATE KEY-----\ntest\n-----END PRIVATE KEY-----",
|
|
9
|
+
},
|
|
10
|
+
spaceId: "test-space",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let channel: GoogleChatChannel;
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
channel = createGoogleChatChannel(mockConfig);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("creates channel with correct id", () => {
|
|
20
|
+
expect(channel.id).toBe("googlechat");
|
|
21
|
+
expect(channel.name).toBe("Google Chat");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("starts disconnected", () => {
|
|
25
|
+
expect(channel.getStatus()).toBe("disconnected");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("connects successfully", async () => {
|
|
29
|
+
// Mock the googleapis client
|
|
30
|
+
const mockGet = vi.fn().mockResolvedValue({ data: {} });
|
|
31
|
+
vi.mock("googleapis", () => ({
|
|
32
|
+
google: {
|
|
33
|
+
auth: { GoogleAuth: vi.fn() },
|
|
34
|
+
chat: vi.fn(() => ({
|
|
35
|
+
spaces: { get: mockGet },
|
|
36
|
+
})),
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
await channel.connect();
|
|
41
|
+
expect(channel.getStatus()).toBe("connected");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("disconnects", async () => {
|
|
45
|
+
await channel.connect();
|
|
46
|
+
await channel.disconnect();
|
|
47
|
+
expect(channel.getStatus()).toBe("disconnected");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("throws error when sending while disconnected", async () => {
|
|
51
|
+
await expect(
|
|
52
|
+
channel.sendMessage({ text: "test", id: "1" }),
|
|
53
|
+
).rejects.toThrow("not connected");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("returns empty presence list", async () => {
|
|
57
|
+
const presences = await channel.getPresences();
|
|
58
|
+
expect(presences).toEqual([]);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Chat Channel Implementation
|
|
3
|
+
* Supports sending/receiving messages, threads, and presence tracking
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { google } from "googleapis";
|
|
7
|
+
import type { Channel, ChannelMessage, ChannelPresence } from "../../../src/channels/types.js";
|
|
8
|
+
|
|
9
|
+
export type GoogleChatConfig = {
|
|
10
|
+
credentials: {
|
|
11
|
+
client_email: string;
|
|
12
|
+
private_key: string;
|
|
13
|
+
};
|
|
14
|
+
spaceId?: string;
|
|
15
|
+
threadKey?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export class GoogleChatChannel implements Channel {
|
|
19
|
+
public readonly id = "googlechat";
|
|
20
|
+
public readonly name = "Google Chat";
|
|
21
|
+
|
|
22
|
+
private config: GoogleChatConfig;
|
|
23
|
+
private auth: google.auth.GoogleAuth;
|
|
24
|
+
private chat: google.chat_v1.Chat;
|
|
25
|
+
private connected = false;
|
|
26
|
+
|
|
27
|
+
constructor(config: GoogleChatConfig) {
|
|
28
|
+
this.config = config;
|
|
29
|
+
this.auth = new google.auth.GoogleAuth({
|
|
30
|
+
credentials: config.credentials,
|
|
31
|
+
scopes: ["https://www.googleapis.com/auth/chat.bot"],
|
|
32
|
+
});
|
|
33
|
+
this.chat = google.chat({ version: "v1", auth: this.auth });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async connect(): Promise<void> {
|
|
37
|
+
try {
|
|
38
|
+
// Test connection by getting bot info
|
|
39
|
+
await this.chat.spaces.get({
|
|
40
|
+
name: `spaces/${this.config.spaceId}`,
|
|
41
|
+
});
|
|
42
|
+
this.connected = true;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
throw new Error(`Google Chat connection failed: ${(error as Error).message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async disconnect(): Promise<void> {
|
|
49
|
+
this.connected = false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async sendMessage(message: ChannelMessage): Promise<void> {
|
|
53
|
+
if (!this.connected) {
|
|
54
|
+
throw new Error("Google Chat channel not connected");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!this.config.spaceId) {
|
|
58
|
+
throw new Error("Google Chat spaceId not configured");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
await this.chat.spaces.messages.create({
|
|
63
|
+
parent: `spaces/${this.config.spaceId}`,
|
|
64
|
+
requestBody: {
|
|
65
|
+
text: message.text,
|
|
66
|
+
thread: message.threadId ? { name: `spaces/${this.config.spaceId}/threads/${message.threadId}` } : undefined,
|
|
67
|
+
},
|
|
68
|
+
...(this.config.threadKey ? { threadKey: this.config.threadKey } : {}),
|
|
69
|
+
});
|
|
70
|
+
} catch (error) {
|
|
71
|
+
throw new Error(`Failed to send Google Chat message: ${(error as Error).message}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async receiveMessages(callback: (message: ChannelMessage) => void): Promise<void> {
|
|
76
|
+
// Google Chat uses webhooks for receiving messages
|
|
77
|
+
// This would be implemented in the gateway webhook handler
|
|
78
|
+
console.log("[googlechat] Message receiving not implemented - use webhooks");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async getPresences(): Promise<ChannelPresence[]> {
|
|
82
|
+
// Google Chat doesn't have a direct presence API for bots
|
|
83
|
+
// Return empty array or cached data if available
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
getStatus(): "connected" | "disconnected" | "error" {
|
|
88
|
+
return this.connected ? "connected" : "disconnected";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async getThreadMessages(threadId: string): Promise<ChannelMessage[]> {
|
|
92
|
+
if (!this.config.spaceId) {
|
|
93
|
+
throw new Error("Google Chat spaceId not configured");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
const response = await this.chat.spaces.messages.list({
|
|
98
|
+
parent: `spaces/${this.config.spaceId}`,
|
|
99
|
+
filter: `thread.name = "spaces/${this.config.spaceId}/threads/${threadId}"`,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return (response.data.messages || []).map((msg) => ({
|
|
103
|
+
id: msg.name || "",
|
|
104
|
+
text: msg.text || "",
|
|
105
|
+
threadId: threadId,
|
|
106
|
+
from: msg.sender?.displayName || "Unknown",
|
|
107
|
+
timestamp: msg.createTime ? new Date(msg.createTime).getTime() : Date.now(),
|
|
108
|
+
}));
|
|
109
|
+
} catch (error) {
|
|
110
|
+
throw new Error(`Failed to get thread messages: ${(error as Error).message}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Create Google Chat channel from config
|
|
117
|
+
*/
|
|
118
|
+
export function createGoogleChatChannel(config: GoogleChatConfig): GoogleChatChannel {
|
|
119
|
+
return new GoogleChatChannel(config);
|
|
120
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Chat Channel Extension Entry Point
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { GoogleChatChannel, createGoogleChatChannel, type GoogleChatConfig } from "./googlechat-channel.js";
|
|
6
|
+
|
|
7
|
+
// Export channel metadata
|
|
8
|
+
export const channelInfo = {
|
|
9
|
+
id: "googlechat",
|
|
10
|
+
name: "Google Chat",
|
|
11
|
+
version: "1.0.0",
|
|
12
|
+
description: "Google Chat integration for Pool Bot",
|
|
13
|
+
author: "Pool Bot Team",
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules/vitest/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules/vitest/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.30_@vitest+browser@4.0.18_vite@7.3.1_@types+node@25.2.3__a102e25684722dd7e16c8e55a5848dc8/node_modules:/Users/pool/Documents/GitHub/pool-bot/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
2
|
+
"name": "@poolbot/irc",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "IRC channel extension for Pool Bot",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "vitest run",
|
|
9
|
+
"build": "tsc"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"irc-framework": "^4.14.0"
|
|
13
|
+
},
|
|
6
14
|
"devDependencies": {
|
|
7
|
-
"
|
|
15
|
+
"@types/node": "^20.0.0",
|
|
16
|
+
"typescript": "^5.0.0",
|
|
17
|
+
"vitest": "^1.0.0"
|
|
8
18
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"./index.ts"
|
|
12
|
-
]
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"poolbot": "workspace:*"
|
|
13
21
|
}
|
|
14
22
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IRC Channel Extension Entry Point
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { IRCChannel, createIRCChannel, type IRCConfig } from "./irc-channel.js";
|
|
6
|
+
|
|
7
|
+
// Export channel metadata
|
|
8
|
+
export const channelInfo = {
|
|
9
|
+
id: "irc",
|
|
10
|
+
name: "IRC",
|
|
11
|
+
version: "1.0.0",
|
|
12
|
+
description: "IRC integration for Pool Bot",
|
|
13
|
+
author: "Pool Bot Team",
|
|
14
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { IRCChannel, createIRCChannel } from "./irc-channel";
|
|
3
|
+
|
|
4
|
+
describe("IRCChannel", () => {
|
|
5
|
+
const mockConfig = {
|
|
6
|
+
host: "irc.example.com",
|
|
7
|
+
port: 6667,
|
|
8
|
+
nick: "poolbot",
|
|
9
|
+
channels: ["#test"],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let channel: IRCChannel;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
channel = createIRCChannel(mockConfig);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("creates channel with correct id", () => {
|
|
19
|
+
expect(channel.id).toBe("irc");
|
|
20
|
+
expect(channel.name).toBe("IRC");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("starts disconnected", () => {
|
|
24
|
+
expect(channel.getStatus()).toBe("disconnected");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("throws error when sending while disconnected", async () => {
|
|
28
|
+
await expect(
|
|
29
|
+
channel.sendMessage({ text: "test", id: "1" }),
|
|
30
|
+
).rejects.toThrow("not connected");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("sets up message callback", async () => {
|
|
34
|
+
const callback = vi.fn();
|
|
35
|
+
await channel.receiveMessages(callback);
|
|
36
|
+
expect(channel).toBeDefined();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("returns empty presence list when disconnected", async () => {
|
|
40
|
+
const presences = await channel.getPresences();
|
|
41
|
+
expect(presences).toEqual([]);
|
|
42
|
+
});
|
|
43
|
+
});
|