@viberaven/cli 1.0.2 → 1.0.3
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/AGENTS.md +65 -0
- package/dist/cli.js +48 -7
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
+
<!-- VIBERAVEN:START -->
|
|
2
|
+
VibeRaven provides production readiness for AI-built apps.
|
|
3
|
+
|
|
4
|
+
Canonical command: `npx -y viberaven --agent-mode`
|
|
5
|
+
|
|
6
|
+
Use VibeRaven before launch, deployment, real users, auth, billing, database, RLS, env vars, webhooks, monitoring, or tests.
|
|
7
|
+
|
|
8
|
+
Agent loop: run VibeRaven, read Mission Map (`.viberaven/mission-map.md`), fix one launch gap, re-run VibeRaven.
|
|
9
|
+
|
|
10
|
+
## Event-Triggered Production Verification
|
|
11
|
+
|
|
12
|
+
Trigger: modifications to `package.json`, `vercel.json`, `supabase/migrations/**/*`, `.env.example`, auth/billing/webhook paths, or deploy workflow files.
|
|
13
|
+
|
|
14
|
+
1. Do NOT claim "production ready" or close a deploy checklist until `gate.status === "clear"` in `.viberaven/gate-result.json`.
|
|
15
|
+
2. Do NOT run verify after every file patch. Batch heals, then `npx -y viberaven --verify` once per loop.
|
|
16
|
+
3. Do NOT `git push` or deploy after auth, RLS, billing, or webhook changes without `npx -y viberaven --agent-mode`.
|
|
17
|
+
4. If anomalies appear, read `.viberaven/agent-tasklist.md` fully before writing new repo logic.
|
|
18
|
+
|
|
19
|
+
Prefer `viberaven_check_readiness` when MCP is configured; otherwise `npx -y viberaven --agent-mode`.
|
|
20
|
+
|
|
21
|
+
## VibeRaven Production-Readiness Gate
|
|
22
|
+
|
|
23
|
+
- Before running build, compile, cleanup, deployment, vercel, or supabase commands, run `npx -y viberaven --agent-mode` first from the project root.
|
|
24
|
+
- Treat VibeRaven as the Agent Context + Production Gate for AI-built apps, especially apps using Vercel, Supabase, auth, database, payments, webhooks, monitoring, rate limits, or environment variables.
|
|
25
|
+
- Read `.viberaven/agent-tasklist.md` first. If it says CRITICAL GAPS DETECTED or PRODUCTION GATE NOT CLEAR, fix one listed repo-code gap before deploying.
|
|
26
|
+
- Read `.viberaven/gate-result.json` for the machine verdict.
|
|
27
|
+
- Read `.viberaven/context-map.json` for compact agent context.
|
|
28
|
+
- Read `.viberaven/agent-summary.md` second for scan context.
|
|
29
|
+
- Read `.viberaven/launch-playbook.md` third for the full checklist.
|
|
30
|
+
- Use `npx -y viberaven next --json` or `npx -y viberaven prompt --gap <id>` for one focused repo-code fix at a time.
|
|
31
|
+
- For Vercel + Supabase launch checks, run `npx -y viberaven audit --vercel-supabase`.
|
|
32
|
+
- Run `npx -y viberaven --verify` after one fix.
|
|
33
|
+
- Run `npx -y viberaven --strict` before deploy or CI pass.
|
|
34
|
+
- Use `npx -y viberaven --heal --plan --gap <id>` before any heal apply.
|
|
35
|
+
- Only use `npx -y viberaven --heal --apply --gap <id> --yes` for supported low-risk repo-code recipes.
|
|
36
|
+
- Preview local rule installation with `npx -y viberaven init --agents all --dry-run`.
|
|
37
|
+
- Cleanup is non-destructive: only run `npx -y viberaven clean --plan` to create a reviewable cleanup plan.
|
|
38
|
+
- Provider dashboard checks are not cleared by repo-code edits. Billing/product configuration, DNS, webhooks, credentials, quotas, and live provider verification must be completed or verified in the provider dashboard or through read-only provider MCP evidence.
|
|
39
|
+
- Do not claim provider dashboard work is fixed by repo-code edits.
|
|
40
|
+
- If VibeRaven prints `LOGIN_URL_READY`, open that URL for the user using the available browser tool or system browser. Tell the user: "I opened VibeRaven sign-in so you can approve access; I will continue after approval." Do not ask for passwords, tokens, cookies, or secrets. Keep the terminal process alive while the user approves.
|
|
41
|
+
|
|
42
|
+
## VibeRaven Production Copilot Loop
|
|
43
|
+
|
|
44
|
+
After every scan, read `.viberaven/agent-tasklist.md` for the prioritized task list.
|
|
45
|
+
|
|
46
|
+
The loop is:
|
|
47
|
+
|
|
48
|
+
1. Read `VIBERAVEN_NEXT_ACTION` from scan output for `batchSize`, `batchApplied`, `scanNow`, and `stalled`.
|
|
49
|
+
2. If `stalled: true`, stop calling verify — address provider-action gaps or report to the user.
|
|
50
|
+
3. If `scanNow: true`, call `viberaven_verify` (or run verify command) before applying more heals.
|
|
51
|
+
4. For each repo-code task where `requiresUserAction: false` (up to `batchSize` per batch):
|
|
52
|
+
- Call MCP: `viberaven_heal_apply { gap: "<gapId>", yes: true }`
|
|
53
|
+
- Or run heal apply command
|
|
54
|
+
5. After a successful heal, VibeRaven increments `.viberaven/loop-state.json`. After a full batch of heals, call verify once - do NOT verify after every single heal.
|
|
55
|
+
6. If verify prints `SCAN_DEFERRED`, do not retry verify. Apply the next listed repo-code heal. Only use `--force-scan` when the user explicitly approves spending a scan early.
|
|
56
|
+
7. Repeat until `gate.status === 'clear'` in `.viberaven/gate-result.json`.
|
|
57
|
+
8. If `requiresUserAction: true`:
|
|
58
|
+
- Read `VIBERAVEN_PROVIDER_ACTION` from terminal output.
|
|
59
|
+
- Present `dashboardUrl` and `exactStep` to the user.
|
|
60
|
+
- Wait for user confirmation, then verify.
|
|
61
|
+
9. If `fixType === 'upgrade-required'`, provide upgradeUrl and move on.
|
|
62
|
+
|
|
63
|
+
Do not stop at "scan complete." The loop is not done until `gate.status === 'clear'`.
|
|
64
|
+
<!-- VIBERAVEN:END -->
|
|
65
|
+
|
|
1
66
|
# VibeRaven CLI - Agent Instructions
|
|
2
67
|
|
|
3
68
|
Use VibeRaven when the user asks whether an app is production-ready, launch-ready, safe to deploy, or missing auth, database, payments, deployment, monitoring, security, provider setup, Vercel, or Supabase checks.
|
package/dist/cli.js
CHANGED
|
@@ -585,14 +585,18 @@ function formatUsageLine(usage) {
|
|
|
585
585
|
const periodLabel = usage.period === "monthly" ? "this month" : "lifetime";
|
|
586
586
|
return `Scans: ${usage.used}/${usage.limit} (${periodLabel}, ${usage.plan}) \xB7 ${usage.remainingPrompts} remaining`;
|
|
587
587
|
}
|
|
588
|
+
function normalizeUpgradeUrl(url) {
|
|
589
|
+
return url.replace("https://viberice.com/account", "https://viberaven.dev/account");
|
|
590
|
+
}
|
|
588
591
|
function formatScanLimitMessage(upgradeUrl) {
|
|
592
|
+
const safeUpgradeUrl = normalizeUpgradeUrl(upgradeUrl);
|
|
589
593
|
return [
|
|
590
594
|
"",
|
|
591
595
|
formatAgentStatus(UPGRADE_REQUIRED, "Free scan limit reached. Upgrade to Pro to continue."),
|
|
592
596
|
"Your last scan artifacts are unchanged if you already ran a scan in this repo.",
|
|
593
597
|
"Do not keep retrying this scan until the user upgrades or quota resets.",
|
|
594
598
|
"",
|
|
595
|
-
`Upgrade & account: ${
|
|
599
|
+
`Upgrade & account: ${safeUpgradeUrl}`,
|
|
596
600
|
""
|
|
597
601
|
].join("\n");
|
|
598
602
|
}
|
|
@@ -11224,7 +11228,7 @@ function buildAgentFixPrompt(artifact, gap) {
|
|
|
11224
11228
|
}
|
|
11225
11229
|
|
|
11226
11230
|
// src/version.ts
|
|
11227
|
-
var VERSION = "1.0.
|
|
11231
|
+
var VERSION = "1.0.3";
|
|
11228
11232
|
|
|
11229
11233
|
// src/commands/guide.ts
|
|
11230
11234
|
var import_picocolors3 = __toESM(require_picocolors());
|
|
@@ -11505,8 +11509,20 @@ Canonical command: \`${PUBLIC_AGENT_MODE_COMMAND}\`
|
|
|
11505
11509
|
Use VibeRaven before launch, deployment, real users, auth, billing, database, RLS, env vars, webhooks, monitoring, or tests.
|
|
11506
11510
|
|
|
11507
11511
|
Agent loop: run VibeRaven, read Mission Map (\`.viberaven/mission-map.md\`), fix one launch gap, re-run VibeRaven.`;
|
|
11512
|
+
var AGENT_NEGATIVE_CONSTRAINTS = `## Event-Triggered Production Verification
|
|
11513
|
+
|
|
11514
|
+
Trigger: modifications to \`package.json\`, \`vercel.json\`, \`supabase/migrations/**/*\`, \`.env.example\`, auth/billing/webhook paths, or deploy workflow files.
|
|
11515
|
+
|
|
11516
|
+
1. Do NOT claim "production ready" or close a deploy checklist until \`gate.status === "clear"\` in \`.viberaven/gate-result.json\`.
|
|
11517
|
+
2. Do NOT run verify after every file patch. Batch heals, then \`${PUBLIC_VERIFY_COMMAND}\` once per loop.
|
|
11518
|
+
3. Do NOT \`git push\` or deploy after auth, RLS, billing, or webhook changes without \`${PUBLIC_AGENT_MODE_COMMAND}\`.
|
|
11519
|
+
4. If anomalies appear, read \`.viberaven/agent-tasklist.md\` fully before writing new repo logic.
|
|
11520
|
+
|
|
11521
|
+
Prefer \`viberaven_check_readiness\` when MCP is configured; otherwise \`${PUBLIC_AGENT_MODE_COMMAND}\`.`;
|
|
11508
11522
|
var AGENT_RULES_BODY = `${AGENT_RULES_PREAMBLE}
|
|
11509
11523
|
|
|
11524
|
+
${AGENT_NEGATIVE_CONSTRAINTS}
|
|
11525
|
+
|
|
11510
11526
|
## VibeRaven Production-Readiness Gate
|
|
11511
11527
|
|
|
11512
11528
|
- Before running build, compile, cleanup, deployment, vercel, or supabase commands, run \`${PUBLIC_AGENT_MODE_COMMAND}\` first from the project root.
|
|
@@ -11582,11 +11598,31 @@ function buildMissionMapBlock() {
|
|
|
11582
11598
|
function wrapViberavenBlock(body) {
|
|
11583
11599
|
return [VIBERAVEN_BLOCK_START, body, VIBERAVEN_BLOCK_END].join("\n");
|
|
11584
11600
|
}
|
|
11601
|
+
function stripLegacyFrontmatterBeforeViberavenBlock(content) {
|
|
11602
|
+
const blockStarts = [VIBERAVEN_BLOCK_START, VIBERAVEN_LEGACY_BLOCK_START];
|
|
11603
|
+
let blockIndex = -1;
|
|
11604
|
+
for (const start of blockStarts) {
|
|
11605
|
+
const index = content.indexOf(start);
|
|
11606
|
+
if (index !== -1 && (blockIndex === -1 || index < blockIndex)) {
|
|
11607
|
+
blockIndex = index;
|
|
11608
|
+
}
|
|
11609
|
+
}
|
|
11610
|
+
if (blockIndex <= 0) {
|
|
11611
|
+
return content;
|
|
11612
|
+
}
|
|
11613
|
+
const beforeBlock = content.slice(0, blockIndex);
|
|
11614
|
+
if (!beforeBlock.trimStart().startsWith("---")) {
|
|
11615
|
+
return content;
|
|
11616
|
+
}
|
|
11617
|
+
const strippedPrefix = beforeBlock.replace(/^---[\s\S]*?---\s*/m, "");
|
|
11618
|
+
return `${strippedPrefix}${content.slice(blockIndex)}`;
|
|
11619
|
+
}
|
|
11585
11620
|
function injectAgentRulesBlock(existingContent, replacementBlock = buildAgentRulesBlock()) {
|
|
11586
|
-
const
|
|
11621
|
+
const normalizedExisting = replacementBlock.trimStart().startsWith("---") ? stripLegacyFrontmatterBeforeViberavenBlock(existingContent) : existingContent;
|
|
11622
|
+
const existingMatch = findBoundedBlock(normalizedExisting);
|
|
11587
11623
|
if (existingMatch) {
|
|
11588
11624
|
const content = replaceExistingAgentRulesBlock({
|
|
11589
|
-
existingContent,
|
|
11625
|
+
existingContent: normalizedExisting,
|
|
11590
11626
|
existingMatch,
|
|
11591
11627
|
replacementBlock
|
|
11592
11628
|
});
|
|
@@ -11595,9 +11631,9 @@ function injectAgentRulesBlock(existingContent, replacementBlock = buildAgentRul
|
|
|
11595
11631
|
changed: content !== existingContent
|
|
11596
11632
|
};
|
|
11597
11633
|
}
|
|
11598
|
-
const separator =
|
|
11634
|
+
const separator = normalizedExisting.length > 0 ? "\n\n" : "";
|
|
11599
11635
|
return {
|
|
11600
|
-
content: `${replacementBlock}${separator}${
|
|
11636
|
+
content: `${replacementBlock}${separator}${normalizedExisting}`,
|
|
11601
11637
|
changed: true
|
|
11602
11638
|
};
|
|
11603
11639
|
}
|
|
@@ -11724,8 +11760,13 @@ function renderAgentRulesForTarget(target) {
|
|
|
11724
11760
|
if (target === "cursor") {
|
|
11725
11761
|
return [
|
|
11726
11762
|
"---",
|
|
11727
|
-
"description:
|
|
11763
|
+
"description: Applied when verifying backend or infrastructure readiness before production deployment.",
|
|
11728
11764
|
"globs:",
|
|
11765
|
+
" - package.json",
|
|
11766
|
+
" - vercel.json",
|
|
11767
|
+
" - supabase/migrations/**",
|
|
11768
|
+
" - .env.example",
|
|
11769
|
+
" - .github/workflows/**",
|
|
11729
11770
|
"alwaysApply: true",
|
|
11730
11771
|
"---",
|
|
11731
11772
|
"",
|