vibegroup 0.1.4 → 0.1.5

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.js CHANGED
@@ -70,7 +70,7 @@ var package_default;
70
70
  var init_package = __esm(() => {
71
71
  package_default = {
72
72
  name: "vibegroup",
73
- version: "0.1.4",
73
+ version: "0.1.5",
74
74
  description: "Talk to your teammates' Claude Code agents — agent-to-agent collaboration for Claude Code over a shared channel.",
75
75
  type: "module",
76
76
  bin: {
@@ -230,6 +230,32 @@ var init_install = __esm(() => {
230
230
  init_pluginInstall();
231
231
  });
232
232
 
233
+ // src/lib/channel.ts
234
+ import { spawnSync as spawnSync2 } from "node:child_process";
235
+ import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
236
+ import { dirname as dirname3 } from "node:path";
237
+ function readManagedSettings() {
238
+ try {
239
+ const p = managedSettingsPath();
240
+ if (existsSync3(p))
241
+ return JSON.parse(readFileSync3(p, "utf8"));
242
+ } catch {}
243
+ return null;
244
+ }
245
+ function channelAllowlisted() {
246
+ return isAllowlisted(readManagedSettings());
247
+ }
248
+ function enableChannelWithSudo() {
249
+ const path = managedSettingsPath();
250
+ const json = JSON.stringify(mergeManagedSettings(readManagedSettings()), null, 2);
251
+ const script = `mkdir -p "${dirname3(path)}" && cat > "${path}"`;
252
+ const r = spawnSync2("sudo", ["sh", "-c", script], { input: json, stdio: ["pipe", "inherit", "inherit"] });
253
+ return r.status === 0;
254
+ }
255
+ var init_channel = __esm(() => {
256
+ init_allowlist();
257
+ });
258
+
233
259
  // src/ui/runner.ts
234
260
  import { render } from "ink";
235
261
  function runInk(make) {
@@ -466,24 +492,6 @@ var exports_init = {};
466
492
  __export(exports_init, {
467
493
  initCommand: () => initCommand
468
494
  });
469
- import { spawnSync as spawnSync2 } from "node:child_process";
470
- import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
471
- import { dirname as dirname3 } from "node:path";
472
- function readManagedSettings() {
473
- try {
474
- const p = managedSettingsPath();
475
- if (existsSync3(p))
476
- return JSON.parse(readFileSync3(p, "utf8"));
477
- } catch {}
478
- return null;
479
- }
480
- function writeAllowlistWithSudo() {
481
- const path = managedSettingsPath();
482
- const json = JSON.stringify(mergeManagedSettings(readManagedSettings()), null, 2);
483
- const script = `mkdir -p "${dirname3(path)}" && cat > "${path}"`;
484
- const r = spawnSync2("sudo", ["sh", "-c", script], { input: json, stdio: ["pipe", "inherit", "inherit"] });
485
- return r.status === 0;
486
- }
487
495
  async function initCommand(rest, flags = {}, env = process.env) {
488
496
  const dev = flags.dev === true;
489
497
  console.log(`vibegroup setup
@@ -505,13 +513,13 @@ async function initCommand(rest, flags = {}, env = process.env) {
505
513
  }
506
514
  if (dev) {
507
515
  console.log("• Dev mode: skipping the channel allowlist (launch with `vibegroup claude --dev`).");
508
- } else if (isAllowlisted(readManagedSettings())) {
516
+ } else if (channelAllowlisted()) {
509
517
  console.log("✓ Channel already enabled.");
510
518
  } else {
511
519
  console.log(`
512
520
  • Enabling the vibegroup channel needs admin once (Claude Code gates channel plugins).`);
513
- console.log(` Writing ${managedSettingsPath()} — enter your password if prompted.`);
514
- if (!writeAllowlistWithSudo()) {
521
+ console.log(" Enter your password if prompted.");
522
+ if (!enableChannelWithSudo()) {
515
523
  console.error(" Could not write managed settings. Retry, or run `vibegroup init --dev` to skip it and use `vibegroup claude --dev`.");
516
524
  return 1;
517
525
  }
@@ -534,7 +542,7 @@ async function initCommand(rest, flags = {}, env = process.env) {
534
542
  }
535
543
  var init_init = __esm(() => {
536
544
  init_auth();
537
- init_allowlist();
545
+ init_channel();
538
546
  init_pluginInstall();
539
547
  init_login();
540
548
  });
@@ -699,7 +707,7 @@ function extractFlag(args, name) {
699
707
  }
700
708
  return { value, rest };
701
709
  }
702
- function claudeCommand(args, env = process.env, launcher) {
710
+ function claudeCommand(args, env = process.env, launcher, channel = realChannelGate) {
703
711
  if (!isLoggedIn(readAuth(env))) {
704
712
  console.error("Not logged in — run `vibegroup login` first.");
705
713
  return 1;
@@ -711,6 +719,13 @@ function claudeCommand(args, env = process.env, launcher) {
711
719
  console.error("No team selected — pass `--team <slug>` (the team whose room you want to join).");
712
720
  return 1;
713
721
  }
722
+ if (!dangerously && !channel.allowlisted()) {
723
+ console.log("Enabling the vibegroup channel — one-time, needs admin. Enter your password if prompted.");
724
+ if (!channel.enable()) {
725
+ console.error("Could not enable the channel. Retry, or launch with `vibegroup claude --dev` (no admin needed).");
726
+ return 1;
727
+ }
728
+ }
714
729
  const vg = {
715
730
  VIBEGROUP_TEAM: team,
716
731
  VIBEGROUP_ROOM: room && room.length > 0 ? room : "general",
@@ -718,10 +733,12 @@ function claudeCommand(args, env = process.env, launcher) {
718
733
  };
719
734
  return launchClaude({ extraArgs: extra, dangerously, env: vg }, launcher);
720
735
  }
721
- var DEFAULT_API_BASE = "https://api.vibegroup.sh";
736
+ var DEFAULT_API_BASE = "https://api.vibegroup.sh", realChannelGate;
722
737
  var init_claudeCmd = __esm(() => {
723
738
  init_claudeLaunch();
724
739
  init_auth();
740
+ init_channel();
741
+ realChannelGate = { allowlisted: channelAllowlisted, enable: enableChannelWithSudo };
725
742
  });
726
743
 
727
744
  // src/cli.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibegroup",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Talk to your teammates' Claude Code agents — agent-to-agent collaboration for Claude Code over a shared channel.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,10 +37,11 @@ The session is cached now, so the `vibegroup` CLI works. AskUserQuestion: **"Cre
37
37
 
38
38
  ## Phase 3 — Launch a channel session
39
39
 
40
- If the vibegroup channel isn't set up on this machine yet, tell the user to run `vibegroup init` once in their terminal (it installs the plugin and enables the channel needs their password once). Then:
40
+ The vibegroup channel is admin-gated (it lives in root-owned managed settings), so **you can't enable it from here** it's a terminal action, like login. Tell the user to run, in their terminal:
41
41
  ```bash
42
42
  vibegroup claude --team <slug>
43
43
  ```
44
+ The **first run enables the channel** (one `sudo` password prompt), then launches Claude Code in the room. Every later run just launches. If they'd rather not use admin, `vibegroup claude --team <slug> --dev` skips it via the development-channel flag (no password).
44
45
 
45
46
  ## Done
46
47