vibeshare-live 0.1.1 → 0.2.0

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 CHANGED
@@ -1,104 +1,90 @@
1
1
  # vibeshare
2
2
 
3
- Share your live agent coding session by URL — traces.com-style, open source, CLI-first. Spectate read-only or invite into the vibelive multiplayer engine.
3
+ Share your live agent coding session by URL — traces.com-style, open source, CLI-first. Spectators watch read-only; invite links let viewers request to join as collaborators (host approves, live).
4
4
 
5
- Part of the **Vibe Suite** — companion tools for agentic coding CLIs (Claude Code, Codex, Gemini, Grok/pi, Kimi). Ships as **CLI + npm package + MCP server**.
5
+ Part of the **Vibe Suite** — companion tools for agentic coding CLIs (Claude Code, Codex, Gemini, Grok/pi, Kimi). Ships as **CLI + npm package + MCP server**, built on [`@pooriaarab/vibe-core`](https://www.npmjs.com/package/@pooriaarab/vibe-core) (consent ledger, hooks bus, badges).
6
6
 
7
- **Local-first: runs on your own machine, no data out** (consent model in `@pooriaarab/vibe-core`).
7
+ **Local-first: the share runs on your machine.** The consent ledger gates every share (`share:session` scope), the stream is served straight from your host, and nothing is stored on a server.
8
8
 
9
- > Status: **v0** — the share/access layer over [`@pooriaarab/vibelive`](https://www.npmjs.com/package/@pooriaarab/vibelive) is implemented (CLI, library, MCP). Local/LAN, host-authoritative. E2e relay fan-out to ~1000 spectators is on the vibelive roadmap.
9
+ ## Install & build
10
10
 
11
- ## Install
12
-
13
- ```bash
14
- npm install -g vibeshare-live
15
- # or use it inline:
16
- npx vibeshare-live -- claude
11
+ ```sh
12
+ npm install
13
+ npm run build # tsup → dist/ (cli.js, index.js, mcp.js + types)
14
+ npm run typecheck # tsc --noEmit
15
+ npm test # vitest
17
16
  ```
18
17
 
19
- It pulls in `@pooriaarab/vibelive` (the multiplayer engine) and `@pooriaarab/vibe-core` (the consent ledger).
20
-
21
- ## Quick start
18
+ ## CLI
22
19
 
23
- Host your agent and hand someone a link:
20
+ ```sh
21
+ vibeshare # share your shell, spectate read-only
22
+ vibeshare --invite --expire 1h # viewers may request to join; auto-expires
23
+ vibeshare --pass hunter2 # passphrase second factor
24
+ vibeshare -- npm test # share a specific command
25
+ vibeshare --host 0.0.0.0 # share on your LAN (default: loopback only)
24
26
 
25
- ```bash
26
- vibeshare --invite -- claude
27
+ vibeshare viewers # who's watching, pending join requests
28
+ vibeshare viewers --approve <id> # promote a viewer to collaborator
29
+ vibeshare viewers --kick <id> # remove a viewer, live
30
+ vibeshare stop # end the share (works from another terminal)
27
31
  ```
28
32
 
29
- You'll get back something like:
33
+ Running `vibeshare` prints the link:
30
34
 
31
35
  ```
32
- vibeshare sharing claude
33
- share: https://vibeshare.stream/s/a5e3a635-0bb7-4689-973c-5fe2d7de6207
34
- access: invite · no expiry
35
- relay: ws://localhost:55410
36
- p2p · e2e · nothing stored on a server
36
+ local · no data out
37
+ sharing: npm test
38
+ url: http://127.0.0.1:50613/s/KKxzdjLpr_km
39
+ access: spectate (read-only)
40
+ expires: until you stop
41
+ manage: vibeshare viewers · vibeshare stop
37
42
  ```
38
43
 
39
- Send them the `share` URL. They spectate read-only; with `--invite` they can request to join and you `/approve <id>` to let them drive. Slash commands inside the host session: `/drive` `/release` `/viewers` `/approve <id>` `/stop`.
40
-
41
- | Flag | Meaning |
42
- | --- | --- |
43
- | `--spectate` | link holders get read-only access (default) |
44
- | `--invite` | link holders may request to join; you approve to let them drive |
45
- | `--expire 1h\|24h` | auto-revoke the share after this duration |
46
- | `--pass <p>` | require a passphrase on top of the share URL |
47
-
48
- `vibeshare --version` · `vibeshare --help` · `vibeshare mcp`
49
-
50
- ## Share links
51
-
52
- The share URL reads like `your-host/s/<id>`. The link is a capability URL: the id is the only thing that grants access (122 bits of entropy), so it's unguessable. Optional `--pass` adds a second factor.
53
-
54
- The actual live stream runs over the local/LAN WebSocket relay that vibelive starts on your machine. The `vibeshare.stream` URL is the identity layer; the bytes flow over a self-hostable relay.
44
+ Opening the URL shows a self-contained spectator page (no install for viewers) streaming the session live over SSE, with a "Request to join" button on invite links. First run asks for consent (`--yes` to skip); the grant is recorded locally in `~/.vibeshare/consent.json` and can be revoked any time.
55
45
 
56
- ## Peer-to-peer, end-to-end encrypted, nothing stored on a server
46
+ Read-only is real: there is no route that lets a viewer write — the host is the server of record, and promotion to collaborator goes only through a host-approved request (`ViewerRegistry.canWrite()` is the single gate).
57
47
 
58
- The session stream runs **peer-to-peer / via a dumb e2e-encrypted relay** that forwards opaque blobs. The relay cannot decrypt anything — nothing readable is ever stored on a server, and the relay is self-hostable. This is vibelive's transport (§1–2 of its tech spec); vibeshare is the URL/access layer on top. Fanning session output off your machine is gated behind the `share:session` consent scope.
59
-
60
- ## As a library
48
+ ## npm library
61
49
 
62
50
  ```ts
63
- import { createHost, createRelay } from '@pooriaarab/vibelive';
64
- import { createShare } from 'vibeshare-live';
65
-
66
- const host = createHost({ command: ['claude'] });
67
- const relay = await createRelay({ port: 0, hostHandle: host, initialDriver: 'host' });
51
+ import { createShare, grantConsent } from 'vibeshare';
68
52
 
69
- const share = createShare({
70
- session: relay,
71
- access: 'spectate', // 'spectate' (read-only) | 'invite' (can join to drive)
72
- expiry: '1h', // optional: '1h' | '24h' | number(ms)
73
- passphrase: 'sekret', // optional second factor
53
+ grantConsent('share from my tool'); // once; local ledger
54
+ const { url, feed, viewers, revoke } = await createShare({
55
+ session: 'npm test',
56
+ access: 'spectate', // or 'invite'
57
+ expiry: '1h', // or 'stop'
74
58
  });
75
59
 
76
- console.log(share.url); // https://vibeshare.stream/s/<id>
77
- const { viewers, pending } = share.viewers();
78
- await share.revoke(); // tear down (also fires on expiry)
60
+ feed.publish('tests starting…');
61
+ viewers.on('request', (v) => viewers.approve(v.id));
62
+ await revoke();
79
63
  ```
80
64
 
81
- Spectators are enforced read-only at the access gate: a spectator's control request never reaches vibelive's `WriteArbiter`, so they can never obtain the write token — the same "never two concurrent writers" invariant vibelive holds, extended to the share.
65
+ `createShare` throws `ConsentRequiredError` without a `share:session` grant. Bring your own plumbing with `ShareManager`, `LocalHttpTransport`, and `FileConsentStore`.
82
66
 
83
- ## As an MCP server
67
+ ## MCP server
84
68
 
85
- Wire it into an agent that speaks MCP and it can offer "share this session?":
86
-
87
- ```jsonc
88
- // .mcp.json or your client's MCP config
69
+ ```json
89
70
  {
90
71
  "mcpServers": {
91
- "vibeshare": { "command": "vibeshare", "args": ["mcp"] }
72
+ "vibeshare": { "command": "vibeshare-mcp" }
92
73
  }
93
74
  }
94
75
  ```
95
76
 
96
- Tools: `create_share` (host a command, mint a share URL) and `viewers` (list active shares + their audiences).
77
+ Tools: `vibeshare_create`, `vibeshare_viewers`, `vibeshare_stop` so an agent can offer "share this session?". Your MCP client's tool-approval prompt is the consent act (recorded with that note). Approving *join requests* stays human-only, via the CLI.
97
78
 
98
- ## Prototype
79
+ ## Architecture & the vibelive seam
99
80
 
100
- Interactive, self-contained UX prototype (no build, no network): open [`docs/prototype.html`](docs/prototype.html) in a browser.
81
+ vibeshare owns the **link + gate**; session content is an ordered feed served to spectators. The one deliberate seam is transport (`src/transport.ts`):
101
82
 
102
- ## License
83
+ - **`LocalHttpTransport`** (implemented, default): spectator page + SSE stream + loopback host-control API, served from your machine. Nothing stored on a server.
84
+ - **`RelayTransport`** (lands with vibelive): a dumb e2e relay / p2p mesh handing out public `vibeshare.io` URLs — same `ShareTransport` interface, swap-in only. Collaborator input routing is part of that seam and must pass `ViewerRegistry.canWrite()`.
85
+
86
+ Everything else — consent, access policy, passphrase gate, expiry teardown, viewer registry, revocation — is fully implemented and tested.
87
+
88
+ ## Prototype
103
89
 
104
- MIT.
90
+ The original UX prototype (no build, no network): open [`docs/prototype.html`](docs/prototype.html). Spec: [`docs/spec.md`](docs/spec.md).