@newbase-clawchat/openclaw-clawchat 2026.5.4 → 2026.5.12-13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +64 -0
- package/README.md +121 -19
- package/dist/index.js +10 -19
- package/dist/setup-entry.js +3 -0
- package/dist/src/api-client.js +78 -10
- package/dist/src/api-types.test-d.js +10 -0
- package/dist/src/channel.js +25 -156
- package/dist/src/channel.setup.js +120 -0
- package/dist/src/client.js +37 -41
- package/dist/src/config.js +75 -17
- package/dist/src/inbound.js +79 -61
- package/dist/src/login.runtime.js +84 -19
- package/dist/src/media-runtime.js +8 -8
- package/dist/src/message-mapper.js +1 -1
- package/dist/src/mock-transport.js +31 -0
- package/dist/src/outbound.js +410 -26
- package/dist/src/protocol-types.js +63 -0
- package/dist/src/protocol-types.typecheck.js +1 -0
- package/dist/src/protocol.js +2 -7
- package/dist/src/reply-dispatcher.js +157 -54
- package/dist/src/runtime.js +795 -119
- package/dist/src/storage.js +689 -0
- package/dist/src/tools-schema.js +98 -16
- package/dist/src/tools.js +422 -135
- package/dist/src/ws-alignment.js +178 -0
- package/dist/src/ws-client.js +588 -0
- package/dist/src/ws-log.js +19 -0
- package/index.ts +10 -22
- package/openclaw.plugin.json +37 -2
- package/package.json +17 -4
- package/setup-entry.ts +4 -0
- package/skills/clawchat/SKILL.md +88 -0
- package/src/api-client.test.ts +274 -14
- package/src/api-client.ts +138 -23
- package/src/api-types.test-d.ts +12 -0
- package/src/api-types.ts +90 -4
- package/src/buffered-stream.test.ts +14 -12
- package/src/buffered-stream.ts +1 -1
- package/src/channel.outbound.test.ts +269 -60
- package/src/channel.setup.ts +146 -0
- package/src/channel.test.ts +130 -24
- package/src/channel.ts +30 -186
- package/src/client.test.ts +197 -11
- package/src/client.ts +50 -57
- package/src/config.test.ts +108 -6
- package/src/config.ts +95 -24
- package/src/inbound.test.ts +288 -37
- package/src/inbound.ts +96 -84
- package/src/login.runtime.test.ts +347 -13
- package/src/login.runtime.ts +105 -23
- package/src/manifest.test.ts +146 -74
- package/src/media-runtime.test.ts +57 -2
- package/src/media-runtime.ts +26 -17
- package/src/message-mapper.test.ts +2 -2
- package/src/message-mapper.ts +2 -2
- package/src/mock-transport.test.ts +35 -0
- package/src/mock-transport.ts +38 -0
- package/src/outbound.test.ts +694 -73
- package/src/outbound.ts +484 -31
- package/src/plugin-entry.test.ts +1 -0
- package/src/protocol-types.test.ts +69 -0
- package/src/protocol-types.ts +296 -0
- package/src/protocol-types.typecheck.ts +89 -0
- package/src/protocol.test.ts +1 -6
- package/src/protocol.ts +2 -7
- package/src/reply-dispatcher.test.ts +819 -119
- package/src/reply-dispatcher.ts +202 -60
- package/src/runtime.test.ts +2120 -41
- package/src/runtime.ts +935 -142
- package/src/scripts.test.ts +85 -0
- package/src/storage.test.ts +793 -0
- package/src/storage.ts +1095 -0
- package/src/streaming.test.ts +9 -8
- package/src/streaming.ts +1 -1
- package/src/tools-schema.ts +148 -20
- package/src/tools.test.ts +377 -50
- package/src/tools.ts +574 -154
- package/src/ws-alignment.test.ts +103 -0
- package/src/ws-alignment.ts +275 -0
- package/src/ws-client.test.ts +1218 -0
- package/src/ws-client.ts +662 -0
- package/src/ws-log.test.ts +32 -0
- package/src/ws-log.ts +31 -0
- package/skills/clawchat-account-tools/SKILL.md +0 -26
- package/skills/clawchat-activate/SKILL.md +0 -47
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
const root = new URL("../", import.meta.url);
|
|
5
|
+
|
|
6
|
+
function readRootFile(name: string): string {
|
|
7
|
+
return fs.readFileSync(new URL(name, root), "utf8");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
describe("OpenClaw packaging scripts", () => {
|
|
11
|
+
it("packages the npm tarball and uploads it to the R2 openclaw prefix", () => {
|
|
12
|
+
const script = readRootFile("scripts/package_openclaw_plugin.sh");
|
|
13
|
+
|
|
14
|
+
expect(script).toMatch(/npm pack --silent --pack-destination "\$SCRIPT_DIR"/);
|
|
15
|
+
expect(script).toContain('REPO_ROOT="$(cd -- "$SCRIPT_DIR/.." && pwd)"');
|
|
16
|
+
expect(script).toContain('R2_ENV_FILE="${R2_ENV_FILE:-$SCRIPT_DIR/.env.r2}"');
|
|
17
|
+
expect(script).toContain('set -a; source "$R2_ENV_FILE"; set +a');
|
|
18
|
+
expect(script).toContain(': "${AWS_ACCESS_KEY_ID:?missing in $R2_ENV_FILE}"');
|
|
19
|
+
expect(script).toContain(': "${AWS_SECRET_ACCESS_KEY:?missing in $R2_ENV_FILE}"');
|
|
20
|
+
expect(script).toContain(': "${R2_ENDPOINT:?missing in $R2_ENV_FILE}"');
|
|
21
|
+
expect(script).toContain(': "${R2_BUCKET:?missing in $R2_ENV_FILE}"');
|
|
22
|
+
expect(script).not.toContain("f8eeaffb6f81ffd82b59c24d4ff797c9");
|
|
23
|
+
expect(script).not.toContain("587f8d4aa485a70f6e984a9efa7e609a86e4ef02d56a6682d9d7a9509913b8cb");
|
|
24
|
+
expect(script).toContain("OBJECT_KEY=\"openclaw/${TARGET_NAME}\"");
|
|
25
|
+
expect(script).toContain("LATEST_OBJECT_KEY=\"openclaw/newbase-clawchat-openclaw-clawchat-latest.tgz\"");
|
|
26
|
+
expect(script).toContain("https://plugin.clawling.chat/${OBJECT_KEY}");
|
|
27
|
+
expect(script).toContain("https://plugin.clawling.chat/${LATEST_OBJECT_KEY}");
|
|
28
|
+
expect(script).toMatch(/aws s3 cp[\s\S]*--content-type application\/gzip/);
|
|
29
|
+
expect(script).toMatch(/aws s3 cp[\s\S]*"s3:\/\/\$\{R2_BUCKET\}\/\$\{LATEST_OBJECT_KEY\}"/);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("keeps the local R2 env file out of git", () => {
|
|
33
|
+
const gitignore = readRootFile(".gitignore");
|
|
34
|
+
|
|
35
|
+
expect(gitignore).toMatch(/^\.env\.r2$/m);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("keeps generated npm package tarballs out of git", () => {
|
|
39
|
+
const gitignore = readRootFile(".gitignore");
|
|
40
|
+
|
|
41
|
+
expect(gitignore).toMatch(/^\*\.tgz$/m);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("publishes a local R2 env example without real credentials", () => {
|
|
45
|
+
const example = readRootFile("scripts/.env.r2.example");
|
|
46
|
+
|
|
47
|
+
expect(example).toContain("AWS_ACCESS_KEY_ID=replace-me");
|
|
48
|
+
expect(example).toContain("AWS_SECRET_ACCESS_KEY=replace-me");
|
|
49
|
+
expect(example).toContain("AWS_DEFAULT_REGION=auto");
|
|
50
|
+
expect(example).toContain("R2_ENDPOINT=https://a47044dea9e3fc23ed4a68da66ab005a.r2.cloudflarestorage.com");
|
|
51
|
+
expect(example).toContain("R2_BUCKET=clawchat-test");
|
|
52
|
+
expect(example).not.toContain("f8eeaffb6f81ffd82b59c24d4ff797c9");
|
|
53
|
+
expect(example).not.toContain("587f8d4aa485a70f6e984a9efa7e609a86e4ef02d56a6682d9d7a9509913b8cb");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("downloads the R2 tarball and installs it through openclaw", () => {
|
|
57
|
+
const script = readRootFile("scripts/install_openclaw.sh");
|
|
58
|
+
|
|
59
|
+
expect(script).toContain("PUBLIC_BASE_URL=\"https://plugin.clawling.chat\"");
|
|
60
|
+
expect(script).toContain("PACKAGE_BASENAME=\"newbase-clawchat-openclaw-clawchat\"");
|
|
61
|
+
expect(script).toContain("DEFAULT_TGZ=\"${PACKAGE_BASENAME}-latest.tgz\"");
|
|
62
|
+
expect(script).toContain("CLAWCHAT_PLUGIN_REF=\"${1:-latest}\"");
|
|
63
|
+
expect(script).toContain('case "$CLAWCHAT_PLUGIN_REF" in');
|
|
64
|
+
expect(script).toContain("CLAWCHAT_PLUGIN_URL=\"${PUBLIC_BASE_URL}/openclaw/${PACKAGE_BASENAME}-${CLAWCHAT_PLUGIN_REF}.tgz\"");
|
|
65
|
+
expect(script).not.toContain("require(\"./package.json\")");
|
|
66
|
+
expect(script).not.toContain("command -v node");
|
|
67
|
+
expect(script).toContain("curl -fL \"$CLAWCHAT_PLUGIN_URL\" -o \"$CLAWCHAT_PLUGIN_TGZ\"");
|
|
68
|
+
expect(script).toContain('cleanup_plugin_tgz()');
|
|
69
|
+
expect(script).toContain('trap cleanup_plugin_tgz EXIT');
|
|
70
|
+
expect(script).toContain('rm -f "$CLAWCHAT_PLUGIN_TGZ"');
|
|
71
|
+
expect(script).toContain("openclaw plugins install \"$CLAWCHAT_PLUGIN_TGZ\" --force");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("publishes a version-pinned OpenClaw installer script", () => {
|
|
75
|
+
const script = readRootFile("scripts/install_openclaw-2026.5.4-3.sh");
|
|
76
|
+
|
|
77
|
+
expect(script).toContain("PUBLIC_BASE_URL=\"https://plugin.clawling.chat\"");
|
|
78
|
+
expect(script).toContain('CLAWCHAT_PLUGIN_REF="2026.5.4-3"');
|
|
79
|
+
expect(script).toContain("newbase-clawchat-openclaw-clawchat-2026.5.4-3.tgz");
|
|
80
|
+
expect(script).not.toContain('CLAWCHAT_PLUGIN_REF="${1:-latest}"');
|
|
81
|
+
expect(script).toContain("curl -fL \"$CLAWCHAT_PLUGIN_URL\" -o \"$CLAWCHAT_PLUGIN_TGZ\"");
|
|
82
|
+
expect(script).toContain('trap cleanup_plugin_tgz EXIT');
|
|
83
|
+
expect(script).toContain("openclaw plugins install \"$CLAWCHAT_PLUGIN_TGZ\" --force");
|
|
84
|
+
});
|
|
85
|
+
});
|