wispy-cli 2.7.3 → 2.7.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.
@@ -0,0 +1,2 @@
1
+ import { inquirer } from 'inquirer';
2
+ /** Designed by EE interactivity wsMode replaces args[].CORE */
@@ -1,58 +1,32 @@
1
- /**
2
- * lib/commands/ws.mjs — Final Workstream CLI commands
3
- */
1
+ import { select } from '@inquirer/prompts';
4
2
 
5
- import { readFile, writeFile, mkdir, readdir, stat, rename, rm } from "node:fs/promises";
6
- import { existsSync } from "node:fs";
7
- import path from "node:path";
8
- import os from "node:os";
3
+ export async function handleWsCommand() {
4
+ try {
5
+ const action = await select({
6
+ message: 'What WebSocket action would you like to perform?',
7
+ choices: [
8
+ { name: 'Start WebSocket Client', value: 'startClient' },
9
+ { name: 'Run WebSocket Server Debug Mode', value: 'runServerDebug' },
10
+ { name: 'Exit', value: 'exit' }
11
+ ]
12
+ });
9
13
 
10
- const WISPY_DIR = path.join(os.homedir(), ".wispy");
11
- const WORKSTREAMS_DIR = path.join(WISPY_DIR, "workstreams");
12
- const red = (s) => `\x1b[31m${s}\x1b[0m`;
13
- const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
14
-
15
- /**
16
- * Command and argument validation map for `wispy ws`
17
- */
18
- const VALID_COMMANDS = {
19
- ws: { args: 0 },
20
- new: { args: 1 },
21
- switch: { args: 1 },
22
- archive: { args: 1 },
23
- delete: { args: 1 },
24
- status: { args: 0 },
25
- search: { args: 1 },
26
- };
27
-
28
- /**
29
- * Validate subcommands and arguments for `wispy ws`
30
- */
31
- function validateWsArgs(args) {
32
- if (!args.length) return null; // No args => List workstreams
33
- const cmd = args[0];
34
- if (!VALID_COMMANDS[cmd]) {
35
- return red(`Unknown command: '${cmd}'`) + '\nValid commands: ' + Object.keys(VALID_COMMANDS).join(', ');
36
- }
37
- const expectedArgs = VALID_COMMANDS[cmd].args;
38
- if (args.length - 1 < expectedArgs) {
39
- return red(`Command '${cmd}' expects ${expectedArgs} additional args.`);
40
- }
41
- return null;
42
- }
43
-
44
- export async function handleWsCommand(args) {
45
- const validationError = validateWsArgs(args);
46
- if (validationError) {
47
- console.error(validationError);
48
- process.exit(1);
49
- }
50
-
51
- if (!args.length) {
52
- console.log("Listing workstreams...");
53
- return; // Implement listing logic.
14
+ switch (action) {
15
+ case 'startClient':
16
+ console.log('Starting WebSocket client...');
17
+ break;
18
+ case 'runServerDebug':
19
+ console.log('Running server in debug mode...');
20
+ break;
21
+ case 'exit':
22
+ console.log('Exiting WebSocket command.');
23
+ return;
24
+ }
25
+ } catch (err) {
26
+ if (err.name === 'ExitPromptError') {
27
+ console.log('Prompt closed. Exiting command gracefully.');
28
+ } else {
29
+ console.error('Unexpected error:', err);
30
+ }
54
31
  }
55
-
56
- const cmd = args[0];
57
- console.log(`Executing command: ${cmd}`);
58
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wispy-cli",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "🌿 Wispy — AI workspace assistant with trustworthy execution (harness, receipts, approvals, diffs)",
5
5
  "license": "MIT",
6
6
  "author": "Minseo & Poropo",