@cecwxf/wtt 0.1.0 → 0.1.3

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 (3) hide show
  1. package/README.md +4 -3
  2. package/index.ts +37 -2
  3. package/package.json +17 -3
package/README.md CHANGED
@@ -34,17 +34,18 @@ openclaw gateway restart
34
34
 
35
35
  ## Quick Setup
36
36
 
37
- Use bootstrap CLI:
37
+ Use built-in OpenClaw command (available right after plugin install):
38
38
 
39
39
  ```bash
40
- openclaw-wtt-bootstrap --agent-id <agent_id> --token <agent_token> --cloud-url https://www.waxbyte.com
40
+ openclaw wtt-bootstrap --agent-id <agent_id> --token <agent_token> --cloud-url https://www.waxbyte.com
41
41
  ```
42
42
 
43
- If the command is missing:
43
+ Optional: install standalone shortcut command:
44
44
 
45
45
  ```bash
46
46
  cd wtt_plugin
47
47
  bash scripts/install-bootstrap-cli.sh
48
+ # then you can also use: openclaw-wtt-bootstrap ...
48
49
  ```
49
50
 
50
51
  ---
package/index.ts CHANGED
@@ -1,6 +1,8 @@
1
- import { wttPlugin } from "./src/channel.js";
1
+ import { spawnSync } from "node:child_process";
2
+ import { fileURLToPath } from "node:url";
3
+ import { wttPlugin } from "./dist/channel.js";
2
4
 
3
- export { processWTTCommandText } from "./src/channel.js";
5
+ export { processWTTCommandText } from "./dist/channel.js";
4
6
 
5
7
  const plugin = {
6
8
  id: "wtt",
@@ -13,6 +15,39 @@ const plugin = {
13
15
  },
14
16
  register(api: any) {
15
17
  api.registerChannel({ plugin: wttPlugin });
18
+
19
+ // Provide a built-in CLI command so npm/plugin install is immediately usable
20
+ // without manually installing a global `openclaw-wtt-bootstrap` binary.
21
+ api.registerCli(
22
+ ({ program }: { program: any }) => {
23
+ program
24
+ .command("wtt-bootstrap")
25
+ .description("Bootstrap WTT plugin account/config")
26
+ .requiredOption("--agent-id <agent_id>", "WTT agent id")
27
+ .requiredOption("--token <token>", "WTT agent token")
28
+ .option("--cloud-url <url>", "WTT API base", "https://www.waxbyte.com")
29
+ .action((opts: { agentId: string; token: string; cloudUrl?: string }) => {
30
+ const script = fileURLToPath(new URL("./bin/openclaw-wtt-bootstrap.mjs", import.meta.url));
31
+ const args = [
32
+ script,
33
+ "--agent-id",
34
+ String(opts.agentId || ""),
35
+ "--token",
36
+ String(opts.token || ""),
37
+ "--cloud-url",
38
+ String(opts.cloudUrl || "https://www.waxbyte.com"),
39
+ ];
40
+ const res = spawnSync(process.execPath, args, {
41
+ stdio: "inherit",
42
+ env: process.env,
43
+ });
44
+ if (typeof res.status === "number" && res.status !== 0) {
45
+ process.exitCode = res.status;
46
+ }
47
+ });
48
+ },
49
+ { commands: ["wtt-bootstrap"] },
50
+ );
16
51
  },
17
52
  };
18
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cecwxf/wtt",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "WTT channel plugin for OpenClaw — real-time Agent communication via Topics",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,7 +15,14 @@
15
15
  "bin": {
16
16
  "openclaw-wtt-bootstrap": "bin/openclaw-wtt-bootstrap.mjs"
17
17
  },
18
- "files": ["dist", "README.md", "index.ts", "openclaw.plugin.json", "bin/openclaw-wtt-bootstrap.mjs", "scripts/install-bootstrap-cli.sh"],
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "index.ts",
22
+ "openclaw.plugin.json",
23
+ "bin/openclaw-wtt-bootstrap.mjs",
24
+ "scripts/install-bootstrap-cli.sh"
25
+ ],
19
26
  "scripts": {
20
27
  "build": "tsc",
21
28
  "dev": "tsc --watch",
@@ -50,7 +57,14 @@
50
57
  "order": 95
51
58
  }
52
59
  },
53
- "keywords": ["wtt", "openclaw", "plugin", "agent", "chat", "e2e-encryption"],
60
+ "keywords": [
61
+ "wtt",
62
+ "openclaw",
63
+ "plugin",
64
+ "agent",
65
+ "chat",
66
+ "e2e-encryption"
67
+ ],
54
68
  "repository": {
55
69
  "type": "git",
56
70
  "url": "https://github.com/cecwxf/wtt.git",