vibeshare-live 0.1.1 → 0.2.1

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/dist/cli.d.ts CHANGED
@@ -1,42 +1,40 @@
1
1
  #!/usr/bin/env node
2
- import { A as AccessMode, E as ExpirySpec } from './share-t_zYXkQB.js';
3
- import 'vibelive';
4
- import '@pooriaarab/vibe-core';
5
-
6
- type ParsedCommand = {
7
- readonly cmd: 'help';
8
- } | {
9
- readonly cmd: 'version';
10
- } | {
11
- readonly cmd: 'mcp';
2
+ interface StartOptions {
3
+ access: 'spectate' | 'invite';
4
+ expiry: string;
5
+ passphrase?: string;
6
+ port: number;
7
+ host: string;
8
+ name?: string;
9
+ yes: boolean;
10
+ command: string[];
11
+ }
12
+ type CliCommand = {
13
+ cmd: 'start';
14
+ options: StartOptions;
12
15
  } | {
13
- readonly cmd: 'stop';
16
+ cmd: 'stop';
17
+ share?: string;
14
18
  } | {
15
- readonly cmd: 'viewers';
19
+ cmd: 'viewers';
20
+ share?: string;
21
+ approve?: string;
22
+ deny?: string;
23
+ kick?: string;
24
+ json: boolean;
16
25
  } | {
17
- readonly cmd: 'host';
18
- readonly command: readonly string[];
19
- readonly access: AccessMode;
20
- readonly expire?: ExpirySpec;
21
- readonly pass?: string;
22
- readonly name?: string;
26
+ cmd: 'help';
23
27
  } | {
24
- readonly cmd: 'error';
25
- readonly message: string;
28
+ cmd: 'version';
26
29
  };
27
- /**
28
- * Parse vibeshare argv (`process.argv.slice(2)`). Pure — no IO.
29
- *
30
- * Everything after a bare `--` is the opaque wrapped command and is never scanned
31
- * for vibeshare flags, so `vibeshare -- claude --help` wraps `claude --help`
32
- * rather than printing vibeshare's own help. Both `vibeshare -- <cmd>` and the
33
- * explicit `vibeshare host -- <cmd>` forms are accepted.
34
- */
35
- declare function parseArgs(argv: readonly string[]): ParsedCommand;
36
- declare function printHelp(stream?: {
37
- write(s: string): boolean;
38
- }): void;
39
- /** CLI entrypoint. Returns the desired exit code (does not call exit itself). */
40
- declare function main(argv?: readonly string[]): Promise<number>;
30
+ declare class CliUsageError extends Error {
31
+ constructor(message: string);
32
+ }
33
+ declare function parseArgv(argv: string[]): CliCommand;
34
+ interface IO {
35
+ out(text: string): void;
36
+ err(text: string): void;
37
+ }
38
+ declare function run(argv: string[], io?: IO): Promise<number>;
41
39
 
42
- export { main, parseArgs, printHelp };
40
+ export { type CliCommand, CliUsageError, type StartOptions, parseArgv, run };