@cybedefend/vibedefend 1.3.2 → 1.4.0
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/README.md +32 -5
- package/dist/api/projects.js +158 -0
- package/dist/api/projects.js.map +1 -0
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/custom-regions.js +5 -0
- package/dist/custom-regions.js.map +1 -1
- package/dist/endpoints.js +59 -0
- package/dist/endpoints.js.map +1 -0
- package/dist/git.js +103 -0
- package/dist/git.js.map +1 -0
- package/dist/hook-runner.js +548 -277
- package/dist/hooks/runtime/fetch-rules.js +5 -3
- package/dist/hooks/runtime/fetch-rules.js.map +1 -1
- package/dist/hooks/runtime/judge-injection.js +65 -0
- package/dist/hooks/runtime/judge-injection.js.map +1 -0
- package/dist/hooks/runtime/repo-link-cache.js +116 -0
- package/dist/hooks/runtime/repo-link-cache.js.map +1 -0
- package/dist/hooks/runtime/resolve.js +79 -0
- package/dist/hooks/runtime/resolve.js.map +1 -1
- package/dist/hooks/runtime/session-start.js +5 -3
- package/dist/hooks/runtime/session-start.js.map +1 -1
- package/dist/hooks/runtime/user-prompt-submit.js +10 -7
- package/dist/hooks/runtime/user-prompt-submit.js.map +1 -1
- package/dist/index.js +40 -2
- package/dist/index.js.map +1 -1
- package/dist/install.js +142 -88
- package/dist/install.js.map +1 -1
- package/dist/link.js +325 -0
- package/dist/link.js.map +1 -0
- package/dist/login.js +2 -23
- package/dist/login.js.map +1 -1
- package/dist/logout.js +87 -0
- package/dist/logout.js.map +1 -0
- package/dist/org-gate.js +110 -0
- package/dist/org-gate.js.map +1 -0
- package/dist/prompts.js +5 -7
- package/dist/prompts.js.map +1 -1
- package/package.json +1 -1
package/dist/install.js
CHANGED
|
@@ -1,32 +1,45 @@
|
|
|
1
|
+
import { confirm as confirmImpl } from '@inquirer/prompts';
|
|
1
2
|
import kleur from 'kleur';
|
|
2
3
|
import { adapterFor } from './clients/registry.js';
|
|
3
4
|
import { checkPlatformSupport } from './clients/claude-code.js';
|
|
5
|
+
import { deriveDashboardUrl, deriveLogtoEndpoint } from './endpoints.js';
|
|
4
6
|
import { installHookRuntime } from './hooks/install.js';
|
|
5
|
-
import { runLogin } from './login.js';
|
|
6
|
-
import { hasStoredAuth } from './auth/auth.js';
|
|
7
|
-
import {
|
|
7
|
+
import { runLogin as runLoginImpl } from './login.js';
|
|
8
|
+
import { hasStoredAuth as hasStoredAuthImpl } from './auth/auth.js';
|
|
9
|
+
import { ensureOrganization as ensureOrganizationImpl } from './org-gate.js';
|
|
10
|
+
import { askClientSelection as askClientSelectionImpl, askHookConfig as askHookConfigImpl, askRegion as askRegionImpl, } from './prompts.js';
|
|
8
11
|
import { stampInstalledVersion } from './self-update.js';
|
|
9
|
-
import { detectPlatform, home, log } from './utils.js';
|
|
12
|
+
import { detectPlatform, home, isUserCancellation, log } from './utils.js';
|
|
10
13
|
import { pkg } from './version.js';
|
|
11
14
|
/**
|
|
12
15
|
* Top-level installer.
|
|
13
16
|
*
|
|
14
|
-
* Flow:
|
|
17
|
+
* Flow (login-first, spec §2.3):
|
|
15
18
|
* 1. Banner + platform sanity check (Windows hooks unsupported)
|
|
16
19
|
* 2. Region pick (Production EU / US)
|
|
17
|
-
* 3.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* -
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* 7.
|
|
27
|
-
* 8.
|
|
20
|
+
* 3. LOGIN — immediately after the region: skip if credentials are already
|
|
21
|
+
* stored; else run the browser PKCE flow. On failure, offer exactly ONE
|
|
22
|
+
* retry, then abort with exit code 1 (everything after this point needs
|
|
23
|
+
* an authenticated user).
|
|
24
|
+
* 4. ORGANIZATION GATE — the account must belong to ≥1 organization to be
|
|
25
|
+
* useful. If it doesn't, open the dashboard on-boarding page and wait
|
|
26
|
+
* (poll). Ctrl-C / timeout skips with a warning; install continues.
|
|
27
|
+
* 5. Multi-select: which agents to wire hooks into?
|
|
28
|
+
* 6. Hook config (threshold, auto-propose)
|
|
29
|
+
* 7. For each selected adapter: registerMcp + writeSettings
|
|
30
|
+
* 8. Write the universal hook runner to ~/.cybedefend/
|
|
31
|
+
* 9. Stamp ~/.cybedefend/version (auto-update plumbing)
|
|
32
|
+
* 10. Print next-steps footer
|
|
28
33
|
*/
|
|
29
|
-
export async function runInstall() {
|
|
34
|
+
export async function runInstall(deps = {}, opts = {}) {
|
|
35
|
+
const askRegion = deps.askRegion ?? askRegionImpl;
|
|
36
|
+
const hasStoredAuth = deps.hasStoredAuth ?? hasStoredAuthImpl;
|
|
37
|
+
const runLogin = deps.runLogin ?? runLoginImpl;
|
|
38
|
+
const ensureOrganization = deps.ensureOrganization ?? ensureOrganizationImpl;
|
|
39
|
+
const askClientSelection = deps.askClientSelection ?? askClientSelectionImpl;
|
|
40
|
+
const askHookConfig = deps.askHookConfig ?? askHookConfigImpl;
|
|
41
|
+
const confirm = deps.confirm ?? confirmImpl;
|
|
42
|
+
const exit = deps.exit ?? ((code) => process.exit(code));
|
|
30
43
|
banner();
|
|
31
44
|
const p = detectPlatform();
|
|
32
45
|
const platformSupport = checkPlatformSupport();
|
|
@@ -34,22 +47,72 @@ export async function runInstall() {
|
|
|
34
47
|
if (!platformSupport.hooksSupported) {
|
|
35
48
|
log.warn(platformSupport.reason ?? 'Hooks unsupported on this platform.');
|
|
36
49
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
log.
|
|
40
|
-
log.hint(`
|
|
41
|
-
|
|
50
|
+
// ── ① Region ────────────────────────────────────────────────────────────────
|
|
51
|
+
const region = await askRegion();
|
|
52
|
+
log.step('Region selected: ' + kleur.bold(region.label));
|
|
53
|
+
log.hint(`MCP URL: ${region.mcpUrl}`);
|
|
54
|
+
log.hint(`API base: ${region.apiBase}`);
|
|
55
|
+
// ── ② Login (before anything else touches the gateway) ─────────────────────
|
|
56
|
+
//
|
|
57
|
+
// Why first? Everything downstream — the organization gate, project
|
|
58
|
+
// auto-resolution from the git origin, the hooks' very first rules fetch —
|
|
59
|
+
// needs a signed-in user. Failing login late (the pre-1.4 flow logged in
|
|
60
|
+
// AFTER wiring hooks) left half-installed setups behind.
|
|
61
|
+
//
|
|
62
|
+
// We check `hasStoredAuth` (which validates OUR specific bundle shape:
|
|
63
|
+
// accessToken + refreshToken + expiresAt + logtoEndpoint + cliAppId +
|
|
64
|
+
// logtoResource) rather than the legacy `resolveToken` resolver. The legacy
|
|
65
|
+
// resolver also matches Codex CLI's own MCP credential (stored under the
|
|
66
|
+
// same keychain service `Codex MCP Credentials` but with a different account
|
|
67
|
+
// shape), which would falsely tell us "already configured" even though our
|
|
68
|
+
// hook can't actually use Codex's MCP-scoped JWT to call the gateway.
|
|
69
|
+
const logtoEndpoint = region.logtoEndpoint ??
|
|
70
|
+
deriveLogtoEndpoint(region.apiBase);
|
|
71
|
+
if (hasStoredAuth(region.mcpName) && !opts.force) {
|
|
72
|
+
log.ok('VibeDefend credentials already present. Skipping login.');
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
log.step('Sign in to CybeDefend');
|
|
76
|
+
log.hint('Your browser will open for a one-time sign-in (instant if you already have a session).');
|
|
77
|
+
// Force the actual OAuth here. We only reach this branch when VibeDefend
|
|
78
|
+
// has NO stored bundle of its OWN (hasStoredAuth === false), or the user
|
|
79
|
+
// asked for it (--force). A token that merely belongs to a coding agent —
|
|
80
|
+
// which `runLogin`'s internal `resolveToken` check would match and use to
|
|
81
|
+
// short-circuit — must NOT skip the browser step: otherwise `logout` +
|
|
82
|
+
// `install` silently signs you back in whenever Claude Code / Codex still
|
|
83
|
+
// hold an MCP token, and the org-gate never gets a fresh VibeDefend token.
|
|
84
|
+
const loginOk = await loginWithOneRetry({
|
|
85
|
+
mcpName: region.mcpName,
|
|
86
|
+
apiBase: region.apiBase,
|
|
87
|
+
logtoEndpoint,
|
|
88
|
+
force: true,
|
|
89
|
+
}, runLogin, confirm);
|
|
90
|
+
if (!loginOk) {
|
|
91
|
+
log.err('VibeDefend needs a signed-in CybeDefend account to install. ' +
|
|
92
|
+
'Run `vibedefend install` again when you are ready to sign in.');
|
|
93
|
+
exit(1);
|
|
94
|
+
return; // In tests `exit` is a spy — never continue past an abort.
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// ── ③ Organization gate ─────────────────────────────────────────────────────
|
|
98
|
+
// An account without an organization can't hold projects, rules, or scans.
|
|
99
|
+
// The gate nudges the user through dashboard onboarding but NEVER blocks:
|
|
100
|
+
// Ctrl-C / timeout / gateway-unreachable all continue with a warning.
|
|
101
|
+
await ensureOrganization({
|
|
102
|
+
apiBase: region.apiBase,
|
|
103
|
+
dashboardUrl: deriveDashboardUrl(region),
|
|
104
|
+
mcpName: region.mcpName,
|
|
105
|
+
});
|
|
106
|
+
// ── ④ Agents + hook config ──────────────────────────────────────────────────
|
|
107
|
+
const selectedClients = await askClientSelection();
|
|
108
|
+
if (selectedClients.length === 0) {
|
|
42
109
|
log.info('No agents selected. The MCP URL is printed above — add it to your client manually if needed. ' +
|
|
43
110
|
'The doctrine arrives via Server.instructions on every supported client.');
|
|
44
111
|
stampInstalledVersion(home, pkg.version);
|
|
45
|
-
printDoneFooter([],
|
|
112
|
+
printDoneFooter([], region);
|
|
46
113
|
return;
|
|
47
114
|
}
|
|
48
|
-
|
|
49
|
-
// Shouldn't happen — prompts guarantees hooks when selection > 0.
|
|
50
|
-
log.err('Hook config missing despite selected agents — aborting.');
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
115
|
+
const hooks = await askHookConfig();
|
|
53
116
|
// Install the Node-based hook runner ONCE — one bundled file serves
|
|
54
117
|
// every adapter. The runner reads runtime-config.json at every
|
|
55
118
|
// invocation, so re-running `vibedefend update` propagates new
|
|
@@ -58,8 +121,8 @@ export async function runInstall() {
|
|
|
58
121
|
if (platformSupport.hooksSupported) {
|
|
59
122
|
log.step('Installing universal hook runner');
|
|
60
123
|
const { runnerPath, configPath } = installHookRuntime({
|
|
61
|
-
region
|
|
62
|
-
hooks
|
|
124
|
+
region,
|
|
125
|
+
hooks,
|
|
63
126
|
installedVersion: pkg.version,
|
|
64
127
|
});
|
|
65
128
|
log.ok(`Runner: ${runnerPath}`);
|
|
@@ -71,14 +134,14 @@ export async function runInstall() {
|
|
|
71
134
|
// Now wire each selected client's settings file. Adapters are
|
|
72
135
|
// responsible for their own idempotency + error handling.
|
|
73
136
|
const installedLabels = [];
|
|
74
|
-
for (const id of
|
|
137
|
+
for (const id of selectedClients) {
|
|
75
138
|
const adapter = adapterFor(id);
|
|
76
139
|
log.step(`Wiring ${adapter.label}`);
|
|
77
140
|
if (adapter.registerMcp) {
|
|
78
|
-
adapter.registerMcp({ region
|
|
141
|
+
adapter.registerMcp({ region });
|
|
79
142
|
}
|
|
80
143
|
if (adapter.postRegister) {
|
|
81
|
-
adapter.postRegister({ region
|
|
144
|
+
adapter.postRegister({ region });
|
|
82
145
|
}
|
|
83
146
|
if (platformSupport.hooksSupported) {
|
|
84
147
|
adapter.writeSettings({
|
|
@@ -86,70 +149,59 @@ export async function runInstall() {
|
|
|
86
149
|
// `~/.cybedefend/hook-runner.js`. Adapters compose `node <path>
|
|
87
150
|
// <subcommand>` via `hookCommand(...)` and ignore this field.
|
|
88
151
|
hookDir: home('.cybedefend'),
|
|
89
|
-
enableSessionReview:
|
|
90
|
-
region
|
|
91
|
-
hooks
|
|
152
|
+
enableSessionReview: hooks.enableSessionReview,
|
|
153
|
+
region,
|
|
154
|
+
hooks,
|
|
92
155
|
});
|
|
93
156
|
}
|
|
94
157
|
installedLabels.push(adapter.label);
|
|
95
158
|
}
|
|
96
|
-
if (
|
|
159
|
+
if (hooks.autoProposeMode) {
|
|
97
160
|
log.warn('Auto-propose mode is ON — the agent will call cybe_rules_report_missing ' +
|
|
98
161
|
'without asking you first. You will still review proposals at the next session ' +
|
|
99
162
|
'start (Accept/Reject picker), but they land without a chat-side prompt.');
|
|
100
163
|
}
|
|
101
164
|
stampInstalledVersion(home, pkg.version);
|
|
102
165
|
log.hint(`Version stamp: ~/.cybedefend/version (v${pkg.version})`);
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
// We check `hasStoredAuth` (which validates OUR specific bundle shape:
|
|
108
|
-
// accessToken + refreshToken + expiresAt + logtoEndpoint + cliAppId +
|
|
109
|
-
// logtoResource) rather than the legacy `resolveToken` resolver. The legacy
|
|
110
|
-
// resolver also matches Codex CLI's own MCP credential (stored under the
|
|
111
|
-
// same keychain service `Codex MCP Credentials` but with a different account
|
|
112
|
-
// shape), which would falsely tell us "already configured" even though our
|
|
113
|
-
// hook can't actually use Codex's MCP-scoped JWT to call the gateway.
|
|
114
|
-
//
|
|
115
|
-
// Note for users who already have Codex set up: yes, you'll see the login
|
|
116
|
-
// flow once. Codex's MCP-scoped token has `aud: cybedefend-mcp` and limited
|
|
117
|
-
// Permify rights; vibedefend's runtime hook needs a USER token (`aud:
|
|
118
|
-
// cybedefend-api`) to call /effective-rules and friends. They are NOT
|
|
119
|
-
// interchangeable. After one Logto SSO consent (instant if your browser
|
|
120
|
-
// already has a session) the refresh_token persists for 14 days.
|
|
121
|
-
if (hasStoredAuth(selection.region.mcpName)) {
|
|
122
|
-
log.ok('VibeDefend credentials already present. Skipping login.');
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
log.info('No VibeDefend credentials found. Running login flow...');
|
|
126
|
-
try {
|
|
127
|
-
await runLogin({
|
|
128
|
-
mcpName: selection.region.mcpName,
|
|
129
|
-
apiBase: selection.region.apiBase,
|
|
130
|
-
logtoEndpoint: selection.region.logtoEndpoint ??
|
|
131
|
-
deriveLogtoEndpoint(selection.region.apiBase),
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
catch (e) {
|
|
135
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
136
|
-
log.warn(`Login skipped (${msg}). Run \`vibedefend login\` to authenticate.`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
printDoneFooter(installedLabels, selection.region.mcpName);
|
|
166
|
+
// NOTE: the pre-1.4 end-of-install auto-login used to live here. Login now
|
|
167
|
+
// happens FIRST (step ② above) — by this point the user is guaranteed to be
|
|
168
|
+
// authenticated, so there is nothing left to do.
|
|
169
|
+
printDoneFooter(installedLabels, region);
|
|
140
170
|
}
|
|
141
171
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
172
|
+
* Run the login flow with exactly one confirm-gated retry.
|
|
173
|
+
* Returns true when a login attempt succeeded, false when the user declined
|
|
174
|
+
* the retry or the retry also failed. A Ctrl-C inside the confirm prompt
|
|
175
|
+
* propagates up (handled as a clean cancel by the CLI action wrapper).
|
|
144
176
|
*/
|
|
145
|
-
function
|
|
146
|
-
|
|
147
|
-
|
|
177
|
+
async function loginWithOneRetry(loginOpts, runLogin, confirm) {
|
|
178
|
+
try {
|
|
179
|
+
await runLogin(loginOpts);
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
if (isUserCancellation(e))
|
|
184
|
+
throw e;
|
|
185
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
186
|
+
log.warn(`Sign-in failed: ${msg}`);
|
|
187
|
+
}
|
|
188
|
+
const retry = await confirm({
|
|
189
|
+
message: 'Try signing in again?',
|
|
190
|
+
default: true,
|
|
191
|
+
});
|
|
192
|
+
if (!retry)
|
|
193
|
+
return false;
|
|
194
|
+
try {
|
|
195
|
+
await runLogin(loginOpts);
|
|
196
|
+
return true;
|
|
148
197
|
}
|
|
149
|
-
|
|
150
|
-
|
|
198
|
+
catch (e) {
|
|
199
|
+
if (isUserCancellation(e))
|
|
200
|
+
throw e;
|
|
201
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
202
|
+
log.warn(`Sign-in failed again: ${msg}`);
|
|
203
|
+
return false;
|
|
151
204
|
}
|
|
152
|
-
return apiBase;
|
|
153
205
|
}
|
|
154
206
|
function banner() {
|
|
155
207
|
console.log();
|
|
@@ -158,7 +210,7 @@ function banner() {
|
|
|
158
210
|
console.log(kleur.dim(' Sets up the MCP server, hooks, and project link.'));
|
|
159
211
|
console.log();
|
|
160
212
|
}
|
|
161
|
-
function printDoneFooter(installedLabels,
|
|
213
|
+
function printDoneFooter(installedLabels, region) {
|
|
162
214
|
console.log();
|
|
163
215
|
log.ok('Install complete.');
|
|
164
216
|
console.log();
|
|
@@ -168,11 +220,13 @@ function printDoneFooter(installedLabels, mcpName) {
|
|
|
168
220
|
console.log();
|
|
169
221
|
}
|
|
170
222
|
console.log(kleur.bold('Next steps:'));
|
|
171
|
-
console.log(` ${kleur.cyan('1.')} Open your IDE in your repo
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
console.log(kleur.
|
|
175
|
-
|
|
223
|
+
console.log(` ${kleur.cyan('1.')} Open your IDE in your repo — you are already signed in, so the MCP tools work right away.`);
|
|
224
|
+
console.log(` ${kleur.cyan('2.')} Repos imported from GitHub/GitLab are matched to their CybeDefend project ` +
|
|
225
|
+
`automatically via the git origin — nothing to do.`);
|
|
226
|
+
console.log(` ${kleur.cyan('3.')} For any other repo, link it once: ${kleur.dim('`vibedefend link`')} ` +
|
|
227
|
+
`(or ${kleur.dim('`npx -y @cybedefend/vibedefend@latest link`')}).`);
|
|
228
|
+
console.log(kleur.dim(' A `.cybedefend/config.json` with { "projectId": "<uuid>" } remains a supported override.'));
|
|
229
|
+
console.log(` ${kleur.cyan('4.')} Verify (Claude Code): ${kleur.dim('`claude mcp list`')} should show ${kleur.bold(region.mcpName)}.`);
|
|
176
230
|
console.log();
|
|
177
231
|
console.log(kleur.dim(' Tunables (set per-shell or per-project to override defaults):'));
|
|
178
232
|
console.log(kleur.dim(' CYBEDEFEND_REVIEW_THRESHOLD — edits before the Stop hook fires'));
|
package/dist/install.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],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