@viberaven/cli 1.6.10 → 1.6.11

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.
Files changed (3) hide show
  1. package/README.md +8 -8
  2. package/dist/cli.js +30 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,10 +10,10 @@ Requires Node.js 20 or newer. Run from the app's project root:
10
10
 
11
11
  ```bash
12
12
  # Open the local Studio
13
- npx -y viberaven@1.6.10
13
+ npx -y viberaven@1.6.11
14
14
 
15
15
  # Fresh terminal check
16
- npx -y viberaven@1.6.10 check
16
+ npx -y viberaven@1.6.11 check
17
17
  ```
18
18
 
19
19
  The `viberaven` package launches this CLI. Studio combines findings, provider context and git comparisons. For chat, select an installed/authenticated Codex CLI, Claude Code or Gemini CLI and use **Test connection**. Access modes: `ask`, `approve`, `full`. Stop Studio with Ctrl+C.
@@ -27,10 +27,10 @@ Checks include migration tables without RLS, unrestricted policy conditions such
27
27
  `check --json` prints a findings summary and artifact paths. `--json` without `check` runs a fresh scan and prints the full gate object.
28
28
 
29
29
  ```bash
30
- npx -y viberaven@1.6.10 check --json
31
- npx -y viberaven@1.6.10 audit --vercel-supabase --json
32
- npx -y viberaven@1.6.10 fix --gap <gapId> --dry-run
33
- npx -y viberaven@1.6.10 init --agents all --dry-run
30
+ npx -y viberaven@1.6.11 check --json
31
+ npx -y viberaven@1.6.11 audit --vercel-supabase --json
32
+ npx -y viberaven@1.6.11 fix --gap <gapId> --dry-run
33
+ npx -y viberaven@1.6.11 init --agents all --dry-run
34
34
  ```
35
35
 
36
36
  Read tasks and source before targeted edits. Preview fixes first. The `rls_disabled` recipe adds an RLS migration without policies: agree before applying, because browser roles lose row access until policies exist. Apply/test through your database workflow; recheck after a batch. Provider actions require provider evidence.
@@ -41,9 +41,9 @@ Read tasks and source before targeted edits. Preview fixes first. The `rls_disab
41
41
 
42
42
  ```bash
43
43
  # Fail on blockers
44
- npx -y viberaven@1.6.10 --strict --json
44
+ npx -y viberaven@1.6.11 --strict --json
45
45
  # Also fail on warnings
46
- npx -y viberaven@1.6.10 --strict=warning --json
46
+ npx -y viberaven@1.6.11 --strict=warning --json
47
47
  ```
48
48
 
49
49
  Default `--strict` returns 0 for `clear`/`warning`, 1 for `not_clear`, 2 for `error`, 3 for `unknown` or unavailable results. `--strict=warning` also returns 1 for warnings.
package/dist/cli.js CHANGED
@@ -15051,7 +15051,7 @@ var VERSION;
15051
15051
  var init_version = __esm({
15052
15052
  "src/version.ts"() {
15053
15053
  "use strict";
15054
- VERSION = "1.6.10";
15054
+ VERSION = "1.6.11";
15055
15055
  }
15056
15056
  });
15057
15057
 
@@ -21880,7 +21880,7 @@ async function detectPreviewCommand(cwd) {
21880
21880
  const packageManager = await exists2("pnpm-lock.yaml") ? "pnpm" : await exists2("yarn.lock") ? "yarn" : await exists2("bun.lockb") || await exists2("bun.lock") ? "bun" : "npm";
21881
21881
  const deps = { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
21882
21882
  const framework = FRAMEWORKS.find(([dep]) => dep in deps)?.[1] ?? null;
21883
- return { packageManager, script, framework, display: `${packageManager} run ${script}` };
21883
+ return { packageManager, script, framework, display: `${packageManager} run ${script}`, reloadsItself: RELOADS_ITSELF.test(scripts[script]) };
21884
21884
  }
21885
21885
  function answers(host, port) {
21886
21886
  return new Promise((resolveAnswer) => {
@@ -21924,7 +21924,7 @@ function previewFailureReason(log) {
21924
21924
  if (/Missing script/i.test(log)) return "The script VibeRaven picked is not in package.json.";
21925
21925
  return void 0;
21926
21926
  }
21927
- var import_node_child_process10, import_promises34, import_node_net, import_node_path43, URL_PATTERN, READY_TIMEOUT_MS, LOG_LIMIT, FRAMEWORKS, PreviewManager;
21927
+ var import_node_child_process10, import_promises34, import_node_net, import_node_path43, URL_PATTERN, READY_TIMEOUT_MS, LOG_LIMIT, FRAMEWORKS, RELOADS_ITSELF, PreviewManager;
21928
21928
  var init_preview2 = __esm({
21929
21929
  "src/local-ui/preview.ts"() {
21930
21930
  "use strict";
@@ -21937,6 +21937,7 @@ var init_preview2 = __esm({
21937
21937
  READY_TIMEOUT_MS = 12e4;
21938
21938
  LOG_LIMIT = 6e3;
21939
21939
  FRAMEWORKS = [["next", "Next.js"], ["vite", "Vite"], ["@remix-run/dev", "Remix"], ["astro", "Astro"], ["@sveltejs/kit", "SvelteKit"], ["nuxt", "Nuxt"], ["react-scripts", "Create React App"]];
21940
+ RELOADS_ITSELF = /\b(?:next\s+dev|vite\b(?!\s+(?:build|preview))|astro\s+dev|nuxi?\s+dev|remix\s+(?:vite:)?dev|react-scripts\s+start|webpack(?:-dev-server|\s+serve)|nodemon|tsx\s+watch|ts-node-dev|svelte-kit\s+dev|ng\s+serve|parcel\b(?!\s+build))|--watch\b/i;
21940
21941
  PreviewManager = class {
21941
21942
  constructor(cwd, home, preferredPort = 3e3) {
21942
21943
  this.cwd = cwd;
@@ -21990,7 +21991,7 @@ var init_preview2 = __esm({
21990
21991
  return this.snapshot();
21991
21992
  }
21992
21993
  this.assignedPort = port;
21993
- this.status = { state: "starting", command: command.display, framework: command.framework, startedAt: (/* @__PURE__ */ new Date()).toISOString(), log: "", revision: this.status.revision };
21994
+ this.status = { state: "starting", command: command.display, framework: command.framework, reloadsItself: command.reloadsItself, startedAt: (/* @__PURE__ */ new Date()).toISOString(), log: "", revision: this.status.revision };
21994
21995
  const child = (0, import_node_child_process10.spawn)(`${command.packageManager} run ${command.script}`, {
21995
21996
  cwd: this.cwd,
21996
21997
  shell: true,
@@ -22078,6 +22079,25 @@ var init_preview2 = __esm({
22078
22079
  if (this.status.state !== "starting") return Promise.resolve(this.snapshot());
22079
22080
  return new Promise((resolveWait) => this.readyWaiters.push(() => resolveWait(this.snapshot())));
22080
22081
  }
22082
+ /**
22083
+ * The app's code changed. A dev server that reloads by itself only needs the frame reloaded; any other one is
22084
+ * restarted, so the preview never keeps serving the code from before the change.
22085
+ */
22086
+ async reload() {
22087
+ if (!this.isRunning()) return this.snapshot();
22088
+ if (this.status.reloadsItself) {
22089
+ this.bumpRevision();
22090
+ return this.snapshot();
22091
+ }
22092
+ const port = this.assignedPort;
22093
+ this.stop();
22094
+ for (let tries = 0; tries < 50 && port && await portTaken(port); tries += 1) {
22095
+ await new Promise((resolveDelay) => setTimeout(resolveDelay, 200));
22096
+ }
22097
+ await this.start();
22098
+ this.bumpRevision();
22099
+ return this.waitForReady();
22100
+ }
22081
22101
  /** Marks that the app's code changed, so the Studio reloads the frame exactly once. */
22082
22102
  bumpRevision() {
22083
22103
  this.status = { ...this.status, revision: this.status.revision + 1 };
@@ -22433,7 +22453,7 @@ var init_engine = __esm({
22433
22453
  const outcome = await revertChanges(baseline, paths.map((path) => ({ path, kind: "modified", additions: 0, deletions: 0 })), keep);
22434
22454
  this.deps.store.update(runId, { reverted: { at: (/* @__PURE__ */ new Date()).toISOString(), ...outcome } });
22435
22455
  this.deps.store.emit(runId, "run.reverted", { restored: outcome.restored.length, skipped: outcome.skipped.length });
22436
- if (outcome.restored.length && this.deps.preview.isRunning()) this.deps.preview.bumpRevision();
22456
+ if (outcome.restored.length && this.deps.preview.isRunning()) await this.deps.preview.reload();
22437
22457
  return outcome;
22438
22458
  }
22439
22459
  /**
@@ -22452,7 +22472,7 @@ var init_engine = __esm({
22452
22472
  if ("error" in outcome) return outcome;
22453
22473
  this.deps.store.update(runId, { restoredFiles: [.../* @__PURE__ */ new Set([...run.restoredFiles ?? [], path])] });
22454
22474
  this.deps.store.emit(runId, "file.restored", { path });
22455
- if (this.deps.preview.isRunning()) this.deps.preview.bumpRevision();
22475
+ if (this.deps.preview.isRunning()) await this.deps.preview.reload();
22456
22476
  return outcome;
22457
22477
  }
22458
22478
  stopped(runId) {
@@ -22607,7 +22627,8 @@ var init_engine = __esm({
22607
22627
  const cancelledNow = () => this.stopped(runId);
22608
22628
  if (!checkSpecs.length) unknowns.push("No typecheck or test script, so the code was not checked.");
22609
22629
  if (this.deps.preview.isRunning()) {
22610
- this.deps.preview.bumpRevision();
22630
+ if (changes.length) await this.deps.preview.reload();
22631
+ else this.deps.preview.bumpRevision();
22611
22632
  const ready = await this.deps.preview.waitForReady();
22612
22633
  if (cancelledNow()) return this.finishCancelled(runId, changes, notProven);
22613
22634
  const answerHttp = ready.url ? await this.deps.preview.fetchStatus(ready.url, 6e4) : null;
@@ -25704,7 +25725,8 @@ async function runConnect(options, deps) {
25704
25725
  const reply = await call(deps, "POST", `/v1/runner/jobs/${encodeURIComponent(job.id)}/result`, result, runnerAccessToken);
25705
25726
  if (unauthorized(reply.status)) break;
25706
25727
  if (reply.status >= 200 && reply.status < 300) {
25707
- log(result.status === "succeeded" ? ` \u2713 ${result.outputSummary[0]} (sent to the site)` : ` \u2717 ${result.outputSummary[0] ?? "Could not finish."} (sent to the site)`);
25728
+ const sign = { succeeded: "\u2713", needs_user: "\u2022", cancelled: "\u25A0", failed: "\u2717" }[result.status] ?? "\u2717";
25729
+ log(` ${sign} ${result.outputSummary[0] ?? "Could not finish."} (sent to the site)`);
25708
25730
  return;
25709
25731
  }
25710
25732
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viberaven/cli",
3
- "version": "1.6.10",
3
+ "version": "1.6.11",
4
4
  "description": "VibeRaven CLI and local Studio: Supabase RLS and security check for AI-built Vercel + Supabase apps, with an agent task list and fix prompts.",
5
5
  "license": "MIT",
6
6
  "author": "VibeRaven",