@flowrail/init 0.0.7 → 0.0.8
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 +3 -3
- package/dist/init.js +15 -0
- package/dist/repo-scan-trigger.js +57 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,10 @@ What it writes:
|
|
|
18
18
|
|
|
19
19
|
The installer also probes `https://api.flowrail.ai/mcp` with the env-supplied bearer to confirm end-to-end auth before exiting. A 401 gets a tester-actionable message; transport failures get a different one.
|
|
20
20
|
|
|
21
|
-
**Full install guide**: <https://github.com/anshumanbh/flowstate/blob/main/docs/INSTALL.md>
|
|
21
|
+
**Full install guide**: <https://github.com/anshumanbh/flowstate/blob/main/docs/guides/INSTALL.md>
|
|
22
22
|
|
|
23
|
-
**Troubleshooting**: <https://github.com/anshumanbh/flowstate/blob/main/docs/TROUBLESHOOTING.md>
|
|
23
|
+
**Troubleshooting**: <https://github.com/anshumanbh/flowstate/blob/main/docs/guides/TROUBLESHOOTING.md>
|
|
24
24
|
|
|
25
|
-
**Honest limits**: <https://github.com/anshumanbh/flowstate/blob/main/docs/LIMITS.md>
|
|
25
|
+
**Honest limits**: <https://github.com/anshumanbh/flowstate/blob/main/docs/guides/LIMITS.md>
|
|
26
26
|
|
|
27
27
|
This is a POC — eval-only, not for production. Source: <https://github.com/anshumanbh/flowstate>.
|
package/dist/init.js
CHANGED
|
@@ -39,6 +39,7 @@ const hook_install_1 = require("./hook-install");
|
|
|
39
39
|
const mcp_config_1 = require("./mcp-config");
|
|
40
40
|
const npm_hooks_1 = require("./npm-hooks");
|
|
41
41
|
const preflight_1 = require("./preflight");
|
|
42
|
+
const repo_scan_trigger_1 = require("./repo-scan-trigger");
|
|
42
43
|
const skills_1 = require("./skills");
|
|
43
44
|
const verify_write_1 = require("./verify-write");
|
|
44
45
|
async function runInit(options = {}) {
|
|
@@ -47,6 +48,7 @@ async function runInit(options = {}) {
|
|
|
47
48
|
const env = options.env ?? process.env;
|
|
48
49
|
const log = options.log ?? ((line) => process.stdout.write(line + '\n'));
|
|
49
50
|
const gitChecker = options.gitChecker ?? git_check_1.isMcpJsonGitTracked;
|
|
51
|
+
const noScan = argv.includes('--no-scan') || argv.includes('--no-retro-scan');
|
|
50
52
|
(0, env_1.rejectKeyArgv)(argv);
|
|
51
53
|
const { apiKey } = (0, env_1.readApiKeyFromEnv)(env);
|
|
52
54
|
// ``FLOWRAIL_MCP_URL`` is the BASE URL — same shape @flowrail/hook
|
|
@@ -112,7 +114,20 @@ async function runInit(options = {}) {
|
|
|
112
114
|
fetcher: options.connectivityFetcher,
|
|
113
115
|
});
|
|
114
116
|
log('✓ connectivity check passed');
|
|
117
|
+
if (!noScan) {
|
|
118
|
+
log('→ scanning your existing dependencies for known CVEs…');
|
|
119
|
+
const scanner = options.repoScanner ?? repo_scan_trigger_1.defaultRepoScanner;
|
|
120
|
+
try {
|
|
121
|
+
await scanner({ projectRoot, mcpBaseUrl, apiKey, log });
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
log(`FlowRail: retroactive scan could not complete (${messageForError(err)}); skipping.`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
115
127
|
log('');
|
|
116
128
|
log('FlowRail is installed. Open this repo in Claude Code and start coding —');
|
|
117
129
|
log('design-review, verify, and dep-check skills are wired into the agent.');
|
|
118
130
|
}
|
|
131
|
+
function messageForError(err) {
|
|
132
|
+
return err instanceof Error ? err.message : String(err);
|
|
133
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defaultRepoScanner = defaultRepoScanner;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const verify_write_1 = require("./verify-write");
|
|
10
|
+
const SCAN_TIMEOUT_MS = 20000;
|
|
11
|
+
function defaultRepoScanner(ctx) {
|
|
12
|
+
try {
|
|
13
|
+
const hookBinPath = (0, verify_write_1.resolveInstalledHookBinPath)(ctx.projectRoot);
|
|
14
|
+
const scanBinPath = path_1.default.resolve(path_1.default.dirname(hookBinPath), 'scan-cli.js');
|
|
15
|
+
const result = (0, child_process_1.spawnSync)(process.execPath, [scanBinPath], {
|
|
16
|
+
cwd: ctx.projectRoot,
|
|
17
|
+
env: {
|
|
18
|
+
...process.env,
|
|
19
|
+
FLOWRAIL_MCP_URL: ctx.mcpBaseUrl,
|
|
20
|
+
FLOWRAIL_API_KEY: ctx.apiKey,
|
|
21
|
+
},
|
|
22
|
+
encoding: 'utf8',
|
|
23
|
+
timeout: SCAN_TIMEOUT_MS,
|
|
24
|
+
});
|
|
25
|
+
const stdout = result.stdout ?? '';
|
|
26
|
+
for (const line of nonEmptyLines(stdout)) {
|
|
27
|
+
ctx.log(line);
|
|
28
|
+
}
|
|
29
|
+
if (result.error) {
|
|
30
|
+
ctx.log(`FlowRail: retroactive scan could not complete (${result.error.message}); skipping.`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const stderr = (result.stderr ?? '').trim();
|
|
34
|
+
if (stderr.length > 0) {
|
|
35
|
+
ctx.log(firstLine(stderr));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (result.status !== 0) {
|
|
39
|
+
ctx.log(`FlowRail: retroactive scan could not complete (exit ${result.status}); skipping.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
ctx.log(`FlowRail: retroactive scan could not complete (${messageForError(err)}); skipping.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function nonEmptyLines(value) {
|
|
47
|
+
return value
|
|
48
|
+
.split(/\r\n|\n|\r/)
|
|
49
|
+
.map((line) => line.trim())
|
|
50
|
+
.filter((line) => line.length > 0);
|
|
51
|
+
}
|
|
52
|
+
function firstLine(value) {
|
|
53
|
+
return value.split(/\r\n|\n|\r/, 1)[0];
|
|
54
|
+
}
|
|
55
|
+
function messageForError(err) {
|
|
56
|
+
return err instanceof Error ? err.message : String(err);
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowrail/init",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "One-shot FlowRail installer for Claude Code. Wires PreToolUse hooks, MCP server config, and skill markdown into a tester's repo, then probes the FlowRail server with their bearer.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|