@vclawhub/vclaw 0.2.1 → 0.2.4
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/README.md +68 -15
- package/dist/cli.js +14 -93
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ Detects your OS/arch, downloads NATS server, pi.dev CLI, vclaw binary, and the `
|
|
|
157
157
|
### Option B: From source
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
|
-
git clone https://github.com/
|
|
160
|
+
git clone https://github.com/chatek/vclaw-agent.git
|
|
161
161
|
cd vclaw-agent
|
|
162
162
|
./install.sh
|
|
163
163
|
```
|
|
@@ -217,9 +217,25 @@ vclaw-agent/
|
|
|
217
217
|
│ └── nats-leaf.conf # Canonical NATS leaf-node config
|
|
218
218
|
├── scripts/
|
|
219
219
|
│ └── vchat-onboard.sh # vchat.email network join
|
|
220
|
-
├──
|
|
221
|
-
│ └──
|
|
220
|
+
├── deploy/ # OS provisioning roles
|
|
221
|
+
│ └── roles/
|
|
222
|
+
│ ├── 01-nats-leaf.sh # NATS leaf node setup
|
|
223
|
+
│ ├── 02-pi-agent.sh # Pi Agent + skills
|
|
224
|
+
│ ├── 03-pi-web.sh # PI WEB + session daemon
|
|
225
|
+
│ └── 07-vclawos-agent.sh # @vclawos/agent build & link
|
|
226
|
+
├── vendors/
|
|
227
|
+
│ ├── pi/ # pi-mono monorepo (vendored submodule)
|
|
228
|
+
│ ├── pi-web/ # PI WEB (vendored submodule)
|
|
229
|
+
│ ├── nats-s3/ # NATS S3 storage plugin
|
|
230
|
+
│ └── synadia-nats-pi-channel/ # @synadia-ai/nats-pi-channel (vendored tarball)
|
|
231
|
+
├── vclaw-pkg/ # @vclawos/* npm packages
|
|
232
|
+
│ └── packages/
|
|
233
|
+
│ ├── agent/ # @vclawos/agent runtime
|
|
234
|
+
│ ├── pi-mono/ # @vclawos/pi-mono wrapper
|
|
235
|
+
│ └── pi-web/ # @vclawos/pi-web wrapper
|
|
222
236
|
├── .pi/agent/skills/ # 9 agent skill packages
|
|
237
|
+
├── .github/workflows/
|
|
238
|
+
│ └── publish.yml # CI/CD — Bun + pnpm parallel publish
|
|
223
239
|
└── docs/
|
|
224
240
|
├── NODES_members.md # Node inventory & deployment profiles
|
|
225
241
|
├── archive/ # Archived reference docs
|
|
@@ -234,33 +250,64 @@ vclaw-agent/
|
|
|
234
250
|
|
|
235
251
|
## Publishing to npm
|
|
236
252
|
|
|
237
|
-
|
|
253
|
+
Two groups of packages publish to the npm registry:
|
|
254
|
+
|
|
255
|
+
| Package | Build Tool | How to Install |
|
|
256
|
+
|---------|-----------|----------------|
|
|
257
|
+
| **`@vclawhub/vclaw`** (root — wrapper CLI) | **Bun** `bun build --target=bun` | `bunx @vclawhub/vclaw install` |
|
|
258
|
+
| **`@vclawos/agent`**, `pi-mono`, `pi-web` (vclaw-pkg/) | **pnpm** (TypeScript → tsc) | `npm install @vclawos/agent` |
|
|
259
|
+
|
|
260
|
+
A publish token is stored in `.env.d/vclawhub.env` under `VCLAW_NPM_TOKEN`.
|
|
261
|
+
|
|
262
|
+
### Local publish: wrapper CLI (Bun)
|
|
238
263
|
|
|
239
264
|
```bash
|
|
265
|
+
# Build and publish the root wrapper package
|
|
240
266
|
source .env.d/vclawhub.env
|
|
241
267
|
export NPM_TOKEN="${VCLAW_NPM_TOKEN}"
|
|
242
|
-
bun run build
|
|
268
|
+
bun run build # bun build ./src/cli.ts → dist/cli.js
|
|
243
269
|
bun publish --access public
|
|
244
270
|
```
|
|
245
271
|
|
|
246
|
-
|
|
272
|
+
Users can then install and run it in one step:
|
|
247
273
|
|
|
248
274
|
```bash
|
|
275
|
+
# Global install
|
|
276
|
+
bun install -g @vclawhub/vclaw
|
|
277
|
+
vclaw-agent up
|
|
278
|
+
|
|
279
|
+
# Or direct execution (no install)
|
|
249
280
|
bunx @vclawhub/vclaw install
|
|
250
|
-
bunx @vclawhub/vclaw up
|
|
251
281
|
bunx @vclawhub/vclaw up --onboard you@email.com
|
|
252
282
|
```
|
|
253
283
|
|
|
284
|
+
### Local publish: vclaw-pkg packages (pnpm)
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
cd vclaw-pkg
|
|
288
|
+
source ../.env.d/vclawhub.env
|
|
289
|
+
export NPM_TOKEN="${VCLAW_NPM_TOKEN}"
|
|
290
|
+
pnpm publish:all
|
|
291
|
+
```
|
|
292
|
+
|
|
254
293
|
### CI/CD — GitHub Actions
|
|
255
294
|
|
|
256
|
-
The workflow at `.github/workflows/publish.yml` runs automatically when a `v*` tag is pushed:
|
|
295
|
+
The workflow at `.github/workflows/publish.yml` runs automatically when a `v*` tag is pushed. It publishes **both** groups in parallel:
|
|
257
296
|
|
|
258
297
|
```mermaid
|
|
259
298
|
graph LR
|
|
260
299
|
A[git tag v0.1.0] --> B[Workflow triggers]
|
|
261
|
-
B --> C[
|
|
262
|
-
|
|
263
|
-
|
|
300
|
+
B --> C[publish-root job]
|
|
301
|
+
B --> D[publish-packages job]
|
|
302
|
+
C --> E[Bun build src/cli.ts]
|
|
303
|
+
C --> F[publish @vclawhub/vclaw]
|
|
304
|
+
D --> G[pnpm build all]
|
|
305
|
+
D --> H[pnpm test]
|
|
306
|
+
D --> I[publish @vclawos/*]
|
|
307
|
+
E --> J[create-release job]
|
|
308
|
+
F --> J
|
|
309
|
+
I --> J
|
|
310
|
+
J --> K[GitHub Release with changelog]
|
|
264
311
|
```
|
|
265
312
|
|
|
266
313
|
#### Step-by-step: Add the secret to GitHub
|
|
@@ -271,20 +318,24 @@ graph LR
|
|
|
271
318
|
4. **Value:** the automation token from `.env.d/vclawhub.env`
|
|
272
319
|
5. Click **Add secret**.
|
|
273
320
|
|
|
321
|
+
That's it — the workflow reads it automatically.
|
|
322
|
+
|
|
274
323
|
#### To trigger a publish
|
|
275
324
|
|
|
276
325
|
```bash
|
|
326
|
+
# Tag the current commit and push
|
|
277
327
|
git tag v0.1.0
|
|
278
328
|
git push origin v0.1.0
|
|
279
329
|
```
|
|
280
330
|
|
|
281
331
|
The workflow then:
|
|
282
|
-
1. Bun-bundles `src/cli.ts` → `dist/cli.js`, publishes `@vclawhub/vclaw`
|
|
283
|
-
2.
|
|
332
|
+
1. **publish-root** — Bun-bundles `src/cli.ts` → `dist/cli.js`, publishes `@vclawhub/vclaw`
|
|
333
|
+
2. **publish-packages** — pnpm installs, builds, tests, and publishes all `@vclawos/*` packages
|
|
334
|
+
3. **create-release** — creates a GitHub Release with auto-generated notes (runs after both succeed)
|
|
284
335
|
|
|
285
336
|
#### Manual trigger
|
|
286
337
|
|
|
287
|
-
|
|
338
|
+
You can also run the workflow manually from the GitHub Actions UI by selecting **Run workflow** and entering a version tag.
|
|
288
339
|
|
|
289
340
|
### Skill: bun-registry-publish
|
|
290
341
|
|
|
@@ -301,7 +352,9 @@ Pi Agent has a built-in skill (`~/.pi/agent/skills/bun-registry-publish/SKILL.md
|
|
|
301
352
|
| NATS Server | [https://nats.io](https://nats.io) |
|
|
302
353
|
| vchat.email | [https://vchat.email](https://vchat.email) |
|
|
303
354
|
| @vchatemail/agent (npm) | [https://www.npmjs.com/package/@vchatemail/agent](https://www.npmjs.com/package/@vchatemail/agent) |
|
|
304
|
-
| @
|
|
355
|
+
| @vclawos/agent (npm) | [https://www.npmjs.com/package/@vclawos/agent](https://www.npmjs.com/package/@vclawos/agent) |
|
|
356
|
+
| @synadia-ai/nats-pi-channel (pi.dev) | [https://pi.dev/packages/@synadia-ai/nats-pi-channel](https://pi.dev/packages/@synadia-ai/nats-pi-channel) |
|
|
357
|
+
| @synadia-ai/nats-pi-channel (GitHub) | [https://github.com/synadia-ai/nats-pi-channel](https://github.com/synadia-ai/nats-pi-channel) |
|
|
305
358
|
| VClaw Hub Install | `https://vclawhub.com/install` (serves `install.sh`) |
|
|
306
359
|
|
|
307
360
|
---
|
package/dist/cli.js
CHANGED
|
@@ -1,95 +1,16 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
//
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// vclaw — VClaw Hub CLI wrapper
|
|
3
|
+
// Detects Bun at runtime, spawns the real CLI.
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var HELP = `
|
|
8
|
-
VClaw Agent \u2014 Local Agentic Mesh Wrapper
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
const bunPath = join(__dirname, "cli.bun.ts");
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
bunx @vclawhub/vclaw onboard <email> Join the vchat.email network
|
|
16
|
-
bunx @vclawhub/vclaw help Show this message
|
|
17
|
-
|
|
18
|
-
Examples:
|
|
19
|
-
bunx @vclawhub/vclaw install
|
|
20
|
-
bunx @vclawhub/vclaw up
|
|
21
|
-
bunx @vclawhub/vclaw up --onboard alice@example.com
|
|
22
|
-
`;
|
|
23
|
-
var cmd = process.argv[2]?.toLowerCase();
|
|
24
|
-
switch (cmd) {
|
|
25
|
-
case "install": {
|
|
26
|
-
const localScript = `${PROJECT_ROOT}/install.sh`;
|
|
27
|
-
const { exitCode } = await $`test -f ${localScript}`.quiet();
|
|
28
|
-
if (exitCode === 0) {
|
|
29
|
-
console.log("\uD83D\uDCE6 Running local install.sh...");
|
|
30
|
-
await $`bash ${localScript}`;
|
|
31
|
-
} else {
|
|
32
|
-
console.log("\uD83D\uDCE6 Fetching installer from vclawhub.com...");
|
|
33
|
-
await $`curl -fsSL https://vclawhub.com/install | sh`;
|
|
34
|
-
}
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
case "up": {
|
|
38
|
-
const onboardFlag = process.argv.indexOf("--onboard");
|
|
39
|
-
let email = "";
|
|
40
|
-
if (onboardFlag !== -1 && process.argv[onboardFlag + 1]) {
|
|
41
|
-
email = process.argv[onboardFlag + 1];
|
|
42
|
-
}
|
|
43
|
-
const localScript = `${PROJECT_ROOT}/vclaw-up`;
|
|
44
|
-
const uninstallFlag = process.argv.indexOf("--uninstall");
|
|
45
|
-
const { exitCode } = await $`test -f ${localScript}`.quiet();
|
|
46
|
-
if (exitCode === 0 && uninstallFlag !== -1) {
|
|
47
|
-
console.log("\uD83E\uDDF9 Uninstalling VClaw Hub...");
|
|
48
|
-
await $`bash ${localScript} --uninstall`;
|
|
49
|
-
process.exit(0);
|
|
50
|
-
} else if (exitCode === 0 && email) {
|
|
51
|
-
console.log("\uD83D\uDE80 Launching stack and joining vchat.email network...");
|
|
52
|
-
await $`bash ${localScript} --onboard ${email}`;
|
|
53
|
-
} else if (exitCode === 0) {
|
|
54
|
-
console.log("\uD83D\uDE80 Launching local agentic mesh...");
|
|
55
|
-
await $`bash ${localScript}`;
|
|
56
|
-
} else if (email) {
|
|
57
|
-
console.log("\uD83D\uDE80 Starting NATS server...");
|
|
58
|
-
const natsServer = Bun.which("nats-server");
|
|
59
|
-
if (!natsServer) {
|
|
60
|
-
console.error("\u274C nats-server not found. Run 'vclaw-agent install' first.");
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
const dataDir = `${process.env.HOME}/.local/share/vclaw`;
|
|
64
|
-
await $`mkdir -p ${dataDir}/nats-data`;
|
|
65
|
-
await $`nats-server --port 4222 --jetstream --store_dir ${dataDir}/nats-data > ${dataDir}/nats-server.log 2>&1 &`.quiet();
|
|
66
|
-
console.log(" \u2714 NATS server started on 127.0.0.1:4222");
|
|
67
|
-
const piUrl = "https://pi-web.dev/?connect=127.0.0.1:4222";
|
|
68
|
-
await $`bunx open ${piUrl}`.quiet().catch(() => {});
|
|
69
|
-
console.log(` \u2714 Browser opened to ${piUrl}`);
|
|
70
|
-
console.log(`
|
|
71
|
-
\uD83D\uDCE1 Onboarding to vchat.email...`);
|
|
72
|
-
await $`bunx @vchatemail/agent ensoul --email ${email}`;
|
|
73
|
-
} else {
|
|
74
|
-
console.error("\u274C vclaw-up not found. Run 'vclaw-agent install' first.");
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
case "onboard": {
|
|
80
|
-
const email = process.argv[3];
|
|
81
|
-
if (!email) {
|
|
82
|
-
console.error("\u274C Usage: bunx @vclawhub/vclaw onboard <email>");
|
|
83
|
-
process.exit(1);
|
|
84
|
-
}
|
|
85
|
-
console.log(`\uD83D\uDCE1 Joining vchat.email network as ${email}...`);
|
|
86
|
-
await $`bunx @vchatemail/agent ensoul --email ${email}`;
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
case "help":
|
|
90
|
-
case "--help":
|
|
91
|
-
case "-h":
|
|
92
|
-
default:
|
|
93
|
-
console.log(HELP);
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
12
|
+
// Try bun first, then bunx
|
|
13
|
+
const { status } = spawnSync("bun", [bunPath, ...args], {
|
|
14
|
+
stdio: "inherit",
|
|
15
|
+
});
|
|
16
|
+
process.exit(status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vclawhub/vclaw",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "VClaw
|
|
6
|
+
"description": "VClaw Agent — one-command setup for pi.dev + pi-web.dev + NATS leaf node + vchat.email network",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"pi-agent",
|
|
9
9
|
"pi-web",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/
|
|
20
|
+
"url": "git+https://github.com/chatek/vclaw-agent.git"
|
|
21
21
|
},
|
|
22
22
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/
|
|
23
|
+
"url": "https://github.com/chatek/vclaw-agent/issues"
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://vclawhub.com",
|
|
26
26
|
"bin": {
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"scripts/"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "bun build ./src/cli.ts --target=bun --
|
|
38
|
-
"compile:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 ./src/cli.ts --outfile=dist/vclaw-darwin-arm64",
|
|
39
|
-
"compile:darwin-x64": "bun build --compile --target=bun-darwin-x64 ./src/cli.ts --outfile=dist/vclaw-darwin-x64",
|
|
40
|
-
"compile:linux-x64": "bun build --compile --target=bun-linux-x64 ./src/cli.ts --outfile=dist/vclaw-linux-x64",
|
|
41
|
-
"compile:linux-arm64": "bun build --compile --target=bun-linux-arm64 ./src/cli.ts --outfile=dist/vclaw-linux-arm64",
|
|
37
|
+
"build": "bun build ./src/cli.bun.ts --target=bun --outfile=dist/cli.bun.js && cp src/cli.ts dist/cli.js",
|
|
38
|
+
"compile:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 ./src/cli.bun.ts --outfile=dist/vclaw-darwin-arm64",
|
|
39
|
+
"compile:darwin-x64": "bun build --compile --target=bun-darwin-x64 ./src/cli.bun.ts --outfile=dist/vclaw-darwin-x64",
|
|
40
|
+
"compile:linux-x64": "bun build --compile --target=bun-linux-x64 ./src/cli.bun.ts --outfile=dist/vclaw-linux-x64",
|
|
41
|
+
"compile:linux-arm64": "bun build --compile --target=bun-linux-arm64 ./src/cli.bun.ts --outfile=dist/vclaw-linux-arm64",
|
|
42
42
|
"compile:all": "bun run compile:darwin-arm64 && bun run compile:darwin-x64 && bun run compile:linux-x64 && bun run compile:linux-arm64",
|
|
43
|
-
"dev": "bun --watch ./src/cli.ts",
|
|
43
|
+
"dev": "bun --watch ./src/cli.bun.ts",
|
|
44
44
|
"prepublishOnly": "bun run build",
|
|
45
|
-
"start": "bun run ./src/cli.ts"
|
|
45
|
+
"start": "bun run ./src/cli.bun.ts"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"bun": ">=1.2"
|