sapper-ai 0.8.0 → 0.9.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/dist/auth.d.ts +7 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +26 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -6
- package/dist/harden.d.ts.map +1 -1
- package/dist/harden.js +2 -6
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +15 -3
- package/dist/utils/interactive.d.ts +15 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/interactive.js +29 -0
- package/package.json +4 -4
package/dist/auth.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ export declare function loadOpenAiApiKey(options?: {
|
|
|
3
3
|
env?: NodeJS.ProcessEnv;
|
|
4
4
|
authPath?: string;
|
|
5
5
|
}): Promise<string | null>;
|
|
6
|
+
export declare function loadOpenAiOrgConfig(options?: {
|
|
7
|
+
env?: NodeJS.ProcessEnv;
|
|
8
|
+
authPath?: string;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
orgId: string | null;
|
|
11
|
+
projectId: string | null;
|
|
12
|
+
}>;
|
|
6
13
|
export declare function maskApiKey(apiKey: string): string;
|
|
7
14
|
export declare function promptAndSaveOpenAiApiKey(options?: {
|
|
8
15
|
authPath?: string;
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAoBA,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAsB,gBAAgB,CAAC,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkB3H;AAED,wBAAsB,mBAAmB,CACvC,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3D,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CA0B7D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAsB,yBAAyB,CAAC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2B1H"}
|
package/dist/auth.js
CHANGED
|
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAuthPath = getAuthPath;
|
|
40
40
|
exports.loadOpenAiApiKey = loadOpenAiApiKey;
|
|
41
|
+
exports.loadOpenAiOrgConfig = loadOpenAiOrgConfig;
|
|
41
42
|
exports.maskApiKey = maskApiKey;
|
|
42
43
|
exports.promptAndSaveOpenAiApiKey = promptAndSaveOpenAiApiKey;
|
|
43
44
|
const node_os_1 = require("node:os");
|
|
@@ -69,6 +70,31 @@ async function loadOpenAiApiKey(options = {}) {
|
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
73
|
+
async function loadOpenAiOrgConfig(options = {}) {
|
|
74
|
+
const env = options.env ?? process.env;
|
|
75
|
+
const orgIdFromEnv = env.OPENAI_ORG_ID;
|
|
76
|
+
const projectIdFromEnv = env.OPENAI_PROJECT_ID;
|
|
77
|
+
if (isNonEmptyString(orgIdFromEnv) || isNonEmptyString(projectIdFromEnv)) {
|
|
78
|
+
return {
|
|
79
|
+
orgId: isNonEmptyString(orgIdFromEnv) ? orgIdFromEnv.trim() : null,
|
|
80
|
+
projectId: isNonEmptyString(projectIdFromEnv) ? projectIdFromEnv.trim() : null,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const authPath = options.authPath ?? getAuthPath();
|
|
84
|
+
const raw = await (0, fs_1.readFileIfExists)(authPath);
|
|
85
|
+
if (raw === null)
|
|
86
|
+
return { orgId: null, projectId: null };
|
|
87
|
+
try {
|
|
88
|
+
const parsed = JSON.parse(raw);
|
|
89
|
+
return {
|
|
90
|
+
orgId: isNonEmptyString(parsed.openai?.orgId) ? parsed.openai.orgId.trim() : null,
|
|
91
|
+
projectId: isNonEmptyString(parsed.openai?.projectId) ? parsed.openai.projectId.trim() : null,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return { orgId: null, projectId: null };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
72
98
|
function maskApiKey(apiKey) {
|
|
73
99
|
const trimmed = apiKey.trim();
|
|
74
100
|
if (trimmed.length <= 3)
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAqBA,wBAAsB,MAAM,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAgIpF;AA4WD,KAAK,iBAAiB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AASjF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAErF"}
|
package/dist/cli.js
CHANGED
|
@@ -53,6 +53,7 @@ const scan_1 = require("./scan");
|
|
|
53
53
|
const detect_1 = require("./openclaw/detect");
|
|
54
54
|
const scanner_1 = require("./openclaw/scanner");
|
|
55
55
|
const env_1 = require("./utils/env");
|
|
56
|
+
const interactive_1 = require("./utils/interactive");
|
|
56
57
|
const setup_1 = require("./guard/setup");
|
|
57
58
|
async function runCli(argv = process.argv.slice(2)) {
|
|
58
59
|
if (argv[0] === '--help' || argv[0] === '-h') {
|
|
@@ -71,10 +72,11 @@ async function runCli(argv = process.argv.slice(2)) {
|
|
|
71
72
|
return 1;
|
|
72
73
|
}
|
|
73
74
|
const scanExitCode = await (0, scan_1.runScan)(scanOptions);
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
process.
|
|
77
|
-
|
|
75
|
+
const hardenPromptState = (0, interactive_1.getInteractivePromptState)({
|
|
76
|
+
noPrompt: parsed.noPrompt,
|
|
77
|
+
env: process.env,
|
|
78
|
+
});
|
|
79
|
+
const shouldOfferHarden = hardenPromptState.allowed &&
|
|
78
80
|
(parsed.harden === true || (await (0, harden_1.getHardenPlanSummary)({ includeSystem: true })).actions.length > 0);
|
|
79
81
|
if (shouldOfferHarden) {
|
|
80
82
|
const hardenExitCode = await (0, harden_1.runHarden)({
|
|
@@ -922,7 +924,12 @@ async function resolveScanOptions(args) {
|
|
|
922
924
|
if (args.deep) {
|
|
923
925
|
return { ...common, targets: [cwd], deep: true, ai: args.ai, scopeLabel: 'Current + subdirectories' };
|
|
924
926
|
}
|
|
925
|
-
|
|
927
|
+
const promptState = (0, interactive_1.getInteractivePromptState)({
|
|
928
|
+
noPrompt: args.noPrompt,
|
|
929
|
+
env: process.env,
|
|
930
|
+
checkCi: false,
|
|
931
|
+
});
|
|
932
|
+
if (!promptState.allowed) {
|
|
926
933
|
return { ...common, targets: [cwd], deep: true, ai: args.ai, scopeLabel: 'Current + subdirectories' };
|
|
927
934
|
}
|
|
928
935
|
const scope = await promptScanScope(cwd);
|
|
@@ -982,7 +989,8 @@ function isDirectExecution(argv) {
|
|
|
982
989
|
if (!entry) {
|
|
983
990
|
return false;
|
|
984
991
|
}
|
|
985
|
-
|
|
992
|
+
const base = entry.replace(/\\/g, '/').split('/').pop() ?? '';
|
|
993
|
+
return base === 'cli.js' || base === 'cli.ts' || base === 'sapper-ai';
|
|
986
994
|
}
|
|
987
995
|
if (isDirectExecution(process.argv)) {
|
|
988
996
|
runCli().then((exitCode) => {
|
package/dist/harden.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harden.d.ts","sourceRoot":"","sources":["../src/harden.ts"],"names":[],"mappings":"AAeA,KAAK,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAA;AAUvC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,WAAW,CAAA;QAClB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,CAAC,CAAA;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;
|
|
1
|
+
{"version":3,"file":"harden.d.ts","sourceRoot":"","sources":["../src/harden.ts"],"names":[],"mappings":"AAeA,KAAK,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAA;AAUvC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,WAAW,CAAA;QAClB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,CAAC,CAAA;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAkLD,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAOlG;AAED,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgG5E"}
|
package/dist/harden.js
CHANGED
|
@@ -44,17 +44,13 @@ const node_path_1 = require("node:path");
|
|
|
44
44
|
const readline = __importStar(require("node:readline"));
|
|
45
45
|
const package_json_1 = __importDefault(require("../package.json"));
|
|
46
46
|
const policyYaml_1 = require("./policyYaml");
|
|
47
|
-
const env_1 = require("./utils/env");
|
|
48
47
|
const fs_1 = require("./utils/fs");
|
|
48
|
+
const interactive_1 = require("./utils/interactive");
|
|
49
49
|
const repoRoot_1 = require("./utils/repoRoot");
|
|
50
50
|
const semver_1 = require("./utils/semver");
|
|
51
51
|
const wrapConfig_1 = require("./mcp/wrapConfig");
|
|
52
52
|
function isInteractivePromptAllowed(options) {
|
|
53
|
-
|
|
54
|
-
return false;
|
|
55
|
-
if ((0, env_1.isCiEnv)(options.env))
|
|
56
|
-
return false;
|
|
57
|
-
return process.stdout.isTTY === true && process.stdin.isTTY === true;
|
|
53
|
+
return (0, interactive_1.getInteractivePromptState)({ noPrompt: options.noPrompt, env: options.env }).allowed;
|
|
58
54
|
}
|
|
59
55
|
async function promptYesNo(question, defaultYes) {
|
|
60
56
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
package/dist/scan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAiBD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,OAAO,CAAA;IACX,OAAO,EAAE;QACP,cAAc,EAAE,OAAO,CAAA;KACxB,CAAA;IACD,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAA;QAClB,aAAa,EAAE,MAAM,CAAA;QACrB,YAAY,EAAE,MAAM,CAAA;QACpB,YAAY,EAAE,MAAM,CAAA;QACpB,kBAAkB,EAAE,MAAM,CAAA;QAC1B,wBAAwB,EAAE,MAAM,CAAA;QAChC,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,EAAE,KAAK,CAAC;QACd,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,UAAU,EAAE,MAAM,CAAA;QAClB,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,EAAE,CAAA;QAClB,OAAO,EAAE,MAAM,EAAE,CAAA;QACjB,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,WAAW,EAAE,KAAK,CAAC;YACjB,KAAK,EAAE,MAAM,CAAA;YACb,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;YAC3B,SAAS,EAAE,MAAM,CAAA;YACjB,OAAO,EAAE,MAAM,CAAA;SAChB,CAAC,CAAA;KACH,CAAC,CAAA;CACH;AA8XD,wBAAsB,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuSxE"}
|
package/dist/scan.js
CHANGED
|
@@ -40,6 +40,7 @@ const node_path_1 = require("node:path");
|
|
|
40
40
|
const core_1 = require("@sapper-ai/core");
|
|
41
41
|
const auth_1 = require("./auth");
|
|
42
42
|
const presets_1 = require("./presets");
|
|
43
|
+
const interactive_1 = require("./utils/interactive");
|
|
43
44
|
const progress_1 = require("./utils/progress");
|
|
44
45
|
const format_1 = require("./utils/format");
|
|
45
46
|
const repoRoot_1 = require("./utils/repoRoot");
|
|
@@ -351,9 +352,13 @@ async function runScan(options = {}) {
|
|
|
351
352
|
if (aiEnabled) {
|
|
352
353
|
let apiKey = await (0, auth_1.loadOpenAiApiKey)();
|
|
353
354
|
if (!apiKey) {
|
|
354
|
-
const
|
|
355
|
-
|
|
355
|
+
const promptState = (0, interactive_1.getInteractivePromptState)({
|
|
356
|
+
noPrompt: options.noPrompt,
|
|
357
|
+
checkCi: false,
|
|
358
|
+
});
|
|
359
|
+
if (!promptState.allowed) {
|
|
356
360
|
console.log(' Error: OPENAI_API_KEY environment variable is required for --ai mode.\n');
|
|
361
|
+
console.log(` Prompt unavailable: ${(0, interactive_1.formatInteractivePromptReasons)(promptState.reasons)}.\n`);
|
|
357
362
|
return 1;
|
|
358
363
|
}
|
|
359
364
|
console.log(' No OpenAI API key found.\n');
|
|
@@ -371,7 +376,14 @@ async function runScan(options = {}) {
|
|
|
371
376
|
console.log(`${colors.dim} Key saved to ${displayAuthPath}${colors.reset}`);
|
|
372
377
|
console.log();
|
|
373
378
|
}
|
|
374
|
-
|
|
379
|
+
const { orgId, projectId } = await (0, auth_1.loadOpenAiOrgConfig)();
|
|
380
|
+
llmConfig = {
|
|
381
|
+
provider: 'openai',
|
|
382
|
+
apiKey,
|
|
383
|
+
model: 'gpt-4.1-mini',
|
|
384
|
+
...(orgId ? { orgId } : {}),
|
|
385
|
+
...(projectId ? { projectId } : {}),
|
|
386
|
+
};
|
|
375
387
|
}
|
|
376
388
|
const deep = options.system ? true : options.deep !== false;
|
|
377
389
|
const targets = options.system === true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type InteractivePromptReason = 'no_prompt_flag' | 'ci_env' | 'stdout_not_tty' | 'stdin_not_tty';
|
|
2
|
+
export interface InteractivePromptCheckInput {
|
|
3
|
+
noPrompt?: boolean;
|
|
4
|
+
env?: NodeJS.ProcessEnv;
|
|
5
|
+
stdoutIsTTY?: boolean;
|
|
6
|
+
stdinIsTTY?: boolean;
|
|
7
|
+
checkCi?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface InteractivePromptCheckResult {
|
|
10
|
+
allowed: boolean;
|
|
11
|
+
reasons: InteractivePromptReason[];
|
|
12
|
+
}
|
|
13
|
+
export declare function getInteractivePromptState(input?: InteractivePromptCheckInput): InteractivePromptCheckResult;
|
|
14
|
+
export declare function formatInteractivePromptReasons(reasons: readonly InteractivePromptReason[]): string;
|
|
15
|
+
//# sourceMappingURL=interactive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../../src/utils/interactive.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,eAAe,CAAA;AAEtG,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,uBAAuB,EAAE,CAAA;CACnC;AAED,wBAAgB,yBAAyB,CAAC,KAAK,GAAE,2BAAgC,GAAG,4BAA4B,CAyB/G;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,GAAG,MAAM,CAElG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInteractivePromptState = getInteractivePromptState;
|
|
4
|
+
exports.formatInteractivePromptReasons = formatInteractivePromptReasons;
|
|
5
|
+
const env_1 = require("./env");
|
|
6
|
+
function getInteractivePromptState(input = {}) {
|
|
7
|
+
const reasons = [];
|
|
8
|
+
if (input.noPrompt === true) {
|
|
9
|
+
reasons.push('no_prompt_flag');
|
|
10
|
+
}
|
|
11
|
+
if ((input.checkCi ?? true) && (0, env_1.isCiEnv)(input.env ?? process.env)) {
|
|
12
|
+
reasons.push('ci_env');
|
|
13
|
+
}
|
|
14
|
+
const stdoutIsTTY = input.stdoutIsTTY ?? process.stdout.isTTY;
|
|
15
|
+
if (stdoutIsTTY !== true) {
|
|
16
|
+
reasons.push('stdout_not_tty');
|
|
17
|
+
}
|
|
18
|
+
const stdinIsTTY = input.stdinIsTTY ?? process.stdin.isTTY;
|
|
19
|
+
if (stdinIsTTY !== true) {
|
|
20
|
+
reasons.push('stdin_not_tty');
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
allowed: reasons.length === 0,
|
|
24
|
+
reasons,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function formatInteractivePromptReasons(reasons) {
|
|
28
|
+
return reasons.length > 0 ? reasons.join(', ') : 'unknown';
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sapper-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "AI security guardrails - single install, sensible defaults",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@inquirer/password": "^4.0.0",
|
|
47
47
|
"@inquirer/select": "^4.0.0",
|
|
48
|
-
"@sapper-ai/core": "0.
|
|
49
|
-
"@sapper-ai/mcp": "0.3.
|
|
50
|
-
"@sapper-ai/types": "0.
|
|
48
|
+
"@sapper-ai/core": "0.4.0",
|
|
49
|
+
"@sapper-ai/mcp": "0.3.3",
|
|
50
|
+
"@sapper-ai/types": "0.4.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^20.0.0",
|