@intutic/cli 2.0.0 → 2.2.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/cli.js +131 -130
- package/dist/cli.js.map +1 -1
- package/dist/commands/attenuate.d.ts.map +1 -1
- package/dist/commands/attenuate.js +4 -2
- package/dist/commands/attenuate.js.map +1 -1
- package/dist/commands/budget.d.ts.map +1 -1
- package/dist/commands/budget.js +2 -2
- package/dist/commands/budget.js.map +1 -1
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +138 -49
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/disconnect.d.ts +25 -0
- package/dist/commands/disconnect.d.ts.map +1 -0
- package/dist/commands/disconnect.js +252 -0
- package/dist/commands/disconnect.js.map +1 -0
- package/dist/commands/doctor.d.ts +19 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +33 -41
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/enforce.d.ts +10 -0
- package/dist/commands/enforce.d.ts.map +1 -1
- package/dist/commands/enforce.js +36 -0
- package/dist/commands/enforce.js.map +1 -1
- package/dist/commands/env.d.ts +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +2 -7
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/exec.d.ts +7 -8
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +59 -60
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/gateway.d.ts +2 -0
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +16 -3
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/guardrails.d.ts.map +1 -1
- package/dist/commands/guardrails.js +18 -1
- package/dist/commands/guardrails.js.map +1 -1
- package/dist/commands/init.d.ts +5 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +38 -22
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install-daemon.d.ts +1 -1
- package/dist/commands/install-daemon.d.ts.map +1 -1
- package/dist/commands/install-daemon.js +5 -3
- package/dist/commands/install-daemon.js.map +1 -1
- package/dist/commands/integrity.d.ts +31 -2
- package/dist/commands/integrity.d.ts.map +1 -1
- package/dist/commands/integrity.js +116 -3
- package/dist/commands/integrity.js.map +1 -1
- package/dist/commands/judge.d.ts +8 -4
- package/dist/commands/judge.d.ts.map +1 -1
- package/dist/commands/judge.js +41 -21
- package/dist/commands/judge.js.map +1 -1
- package/dist/commands/login.d.ts +1 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +16 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/predict-cost.d.ts +1 -2
- package/dist/commands/predict-cost.d.ts.map +1 -1
- package/dist/commands/predict-cost.js +1 -4
- package/dist/commands/predict-cost.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -2
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +11 -68
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skill.d.ts +1 -0
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +17 -3
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +5 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/syncContext.d.ts.map +1 -1
- package/dist/commands/syncContext.js +15 -5
- package/dist/commands/syncContext.js.map +1 -1
- package/dist/config/paths.d.ts +25 -3
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +47 -7
- package/dist/config/paths.js.map +1 -1
- package/dist/harness/agentFramework.d.ts +25 -0
- package/dist/harness/agentFramework.d.ts.map +1 -0
- package/dist/harness/agentFramework.js +37 -0
- package/dist/harness/agentFramework.js.map +1 -0
- package/dist/harness/agentcore.d.ts +6 -3
- package/dist/harness/agentcore.d.ts.map +1 -1
- package/dist/harness/agentcore.js +7 -4
- package/dist/harness/agentcore.js.map +1 -1
- package/dist/harness/agenticOrchestrator.d.ts +3 -5
- package/dist/harness/agenticOrchestrator.d.ts.map +1 -1
- package/dist/harness/agenticOrchestrator.js +3 -5
- package/dist/harness/agenticOrchestrator.js.map +1 -1
- package/dist/harness/aiSdkHarness.d.ts +1 -1
- package/dist/harness/aiSdkHarness.js +1 -1
- package/dist/harness/aiSdkWorkflow.d.ts +1 -1
- package/dist/harness/aiSdkWorkflow.d.ts.map +1 -1
- package/dist/harness/aiSdkWorkflow.js +5 -3
- package/dist/harness/aiSdkWorkflow.js.map +1 -1
- package/dist/harness/aider.d.ts +4 -3
- package/dist/harness/aider.d.ts.map +1 -1
- package/dist/harness/aider.js +7 -6
- package/dist/harness/aider.js.map +1 -1
- package/dist/harness/antigravity.d.ts +4 -2
- package/dist/harness/antigravity.d.ts.map +1 -1
- package/dist/harness/antigravity.js +15 -12
- package/dist/harness/antigravity.js.map +1 -1
- package/dist/harness/base.d.ts +5 -1
- package/dist/harness/base.d.ts.map +1 -1
- package/dist/harness/base.js +9 -8
- package/dist/harness/base.js.map +1 -1
- package/dist/harness/cline.d.ts +10 -4
- package/dist/harness/cline.d.ts.map +1 -1
- package/dist/harness/cline.js +40 -32
- package/dist/harness/cline.js.map +1 -1
- package/dist/harness/codex.d.ts +10 -4
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +30 -32
- package/dist/harness/codex.js.map +1 -1
- package/dist/harness/continue.d.ts +8 -5
- package/dist/harness/continue.d.ts.map +1 -1
- package/dist/harness/continue.js +27 -63
- package/dist/harness/continue.js.map +1 -1
- package/dist/harness/cursor.d.ts.map +1 -1
- package/dist/harness/cursor.js +2 -6
- package/dist/harness/cursor.js.map +1 -1
- package/dist/harness/detector.d.ts +1 -1
- package/dist/harness/detector.d.ts.map +1 -1
- package/dist/harness/detector.js +3 -1
- package/dist/harness/detector.js.map +1 -1
- package/dist/harness/dsh.d.ts +2 -2
- package/dist/harness/dsh.js +3 -3
- package/dist/harness/dsh.js.map +1 -1
- package/dist/harness/eve.d.ts +1 -1
- package/dist/harness/eve.js +1 -1
- package/dist/harness/githubCopilot.d.ts +4 -2
- package/dist/harness/githubCopilot.d.ts.map +1 -1
- package/dist/harness/githubCopilot.js +13 -8
- package/dist/harness/githubCopilot.js.map +1 -1
- package/dist/harness/grok.d.ts.map +1 -1
- package/dist/harness/grok.js +4 -6
- package/dist/harness/grok.js.map +1 -1
- package/dist/harness/jsSdkGatedAdapter.d.ts.map +1 -1
- package/dist/harness/jsSdkGatedAdapter.js +8 -9
- package/dist/harness/jsSdkGatedAdapter.js.map +1 -1
- package/dist/harness/langgraph.d.ts.map +1 -1
- package/dist/harness/langgraph.js +8 -10
- package/dist/harness/langgraph.js.map +1 -1
- package/dist/harness/muse.d.ts.map +1 -1
- package/dist/harness/muse.js +4 -6
- package/dist/harness/muse.js.map +1 -1
- package/dist/harness/n8n.d.ts +12 -2
- package/dist/harness/n8n.d.ts.map +1 -1
- package/dist/harness/n8n.js +66 -3
- package/dist/harness/n8n.js.map +1 -1
- package/dist/harness/openWebUI.d.ts +7 -2
- package/dist/harness/openWebUI.d.ts.map +1 -1
- package/dist/harness/openWebUI.js +15 -4
- package/dist/harness/openWebUI.js.map +1 -1
- package/dist/harness/openaiAgents.d.ts.map +1 -1
- package/dist/harness/openaiAgents.js +4 -1
- package/dist/harness/openaiAgents.js.map +1 -1
- package/dist/harness/opencode.d.ts +3 -2
- package/dist/harness/opencode.d.ts.map +1 -1
- package/dist/harness/opencode.js +7 -8
- package/dist/harness/opencode.js.map +1 -1
- package/dist/harness/openhands.d.ts +3 -2
- package/dist/harness/openhands.d.ts.map +1 -1
- package/dist/harness/openhands.js +40 -27
- package/dist/harness/openhands.js.map +1 -1
- package/dist/harness/rooCode.d.ts +6 -5
- package/dist/harness/rooCode.d.ts.map +1 -1
- package/dist/harness/rooCode.js +13 -18
- package/dist/harness/rooCode.js.map +1 -1
- package/dist/harness/sdkGatedAdapter.d.ts.map +1 -1
- package/dist/harness/sdkGatedAdapter.js +8 -9
- package/dist/harness/sdkGatedAdapter.js.map +1 -1
- package/dist/harness/trueforge.js +2 -2
- package/dist/harness/trueforge.js.map +1 -1
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js +4 -1
- package/dist/harness/types.js.map +1 -1
- package/dist/harness/windsurf.d.ts +4 -2
- package/dist/harness/windsurf.d.ts.map +1 -1
- package/dist/harness/windsurf.js +14 -11
- package/dist/harness/windsurf.js.map +1 -1
- package/dist/harness/xirp.d.ts +5 -7
- package/dist/harness/xirp.d.ts.map +1 -1
- package/dist/harness/xirp.js +5 -7
- package/dist/harness/xirp.js.map +1 -1
- package/dist/lib/envInjector.d.ts +16 -6
- package/dist/lib/envInjector.d.ts.map +1 -1
- package/dist/lib/envInjector.js +99 -88
- package/dist/lib/envInjector.js.map +1 -1
- package/dist/lib/localProxy.d.ts +19 -0
- package/dist/lib/localProxy.d.ts.map +1 -0
- package/dist/lib/localProxy.js +33 -0
- package/dist/lib/localProxy.js.map +1 -0
- package/dist/lib/onboarding.d.ts +1 -1
- package/dist/lib/onboarding.d.ts.map +1 -1
- package/dist/lib/onboarding.js +21 -27
- package/dist/lib/onboarding.js.map +1 -1
- package/dist/lib/otelPropagation.d.ts +1 -1
- package/dist/lib/otelPropagation.js +1 -1
- package/dist/lib/policySnapshot.d.ts +2 -1
- package/dist/lib/policySnapshot.d.ts.map +1 -1
- package/dist/lib/policySnapshot.js +11 -4
- package/dist/lib/policySnapshot.js.map +1 -1
- package/dist/lib/sandbox/image.d.ts +27 -0
- package/dist/lib/sandbox/image.d.ts.map +1 -0
- package/dist/lib/sandbox/image.js +54 -0
- package/dist/lib/sandbox/image.js.map +1 -0
- package/dist/lib/sandbox/oci.d.ts +1 -0
- package/dist/lib/sandbox/oci.d.ts.map +1 -1
- package/dist/lib/sandbox/oci.js +4 -0
- package/dist/lib/sandbox/oci.js.map +1 -1
- package/dist/lib/sandbox/types.d.ts +5 -0
- package/dist/lib/sandbox/types.d.ts.map +1 -1
- package/package.json +6 -5
- package/resources/sandbox/Dockerfile +30 -0
- package/resources/sandbox/entrypoint.sh +108 -0
- package/resources/sandbox/firecracker-launch.sh +120 -0
- package/dist/harness/vscodeSettingsWriter.d.ts +0 -40
- package/dist/harness/vscodeSettingsWriter.d.ts.map +0 -1
- package/dist/harness/vscodeSettingsWriter.js +0 -116
- package/dist/harness/vscodeSettingsWriter.js.map +0 -1
package/dist/lib/envInjector.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Environment Variable Injector
|
|
2
|
+
* Environment Variable Injector
|
|
3
3
|
*
|
|
4
4
|
* Injects ANTHROPIC_BASE_URL and OPENAI_BASE_URL as persistent
|
|
5
|
-
*
|
|
5
|
+
* environment variables that new terminals and applications pick up, and
|
|
6
|
+
* removes them again.
|
|
6
7
|
*
|
|
7
8
|
* Platform support:
|
|
8
|
-
* macOS: launchctl setenv <KEY> <VALUE>
|
|
9
|
-
* Linux:
|
|
9
|
+
* macOS: launchctl setenv <KEY> <VALUE> (until logout)
|
|
10
|
+
* Linux: /etc/environment when writable (root), else ~/.bashrc
|
|
10
11
|
* Windows: setx <KEY> <VALUE> (user-level, no /M)
|
|
11
12
|
*
|
|
12
|
-
* LLD #30: Multi-Region Preparation, WS-5MR (TD-041)
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
15
|
import { execSync } from 'node:child_process';
|
|
@@ -19,80 +19,87 @@ import os from 'node:os';
|
|
|
19
19
|
import { createLogger } from '@intutic/logger';
|
|
20
20
|
const logger = createLogger('envInjector');
|
|
21
21
|
const ENV_VARS = ['ANTHROPIC_BASE_URL', 'OPENAI_BASE_URL'];
|
|
22
|
+
function resolveTarget(t = {}) {
|
|
23
|
+
return {
|
|
24
|
+
platform: t.platform ?? os.platform(),
|
|
25
|
+
bashrc: t.bashrc ?? path.join(os.homedir(), '.bashrc'),
|
|
26
|
+
etcEnvironment: t.etcEnvironment ?? '/etc/environment',
|
|
27
|
+
exec: t.exec ?? ((command) => { execSync(command, { stdio: 'pipe' }); }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
22
30
|
export class PlatformNotSupportedError extends Error {
|
|
23
31
|
constructor(platform) {
|
|
24
32
|
super(`Platform not supported for env injection: ${platform}`);
|
|
25
33
|
this.name = 'PlatformNotSupportedError';
|
|
26
34
|
}
|
|
27
35
|
}
|
|
28
|
-
export class ElevationRequiredError extends Error {
|
|
29
|
-
constructor(path) {
|
|
30
|
-
super(`System-level write requires root access to ${path}. Falling back to user-level.`);
|
|
31
|
-
this.name = 'ElevationRequiredError';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
36
|
function sanitizeShellValue(val) {
|
|
35
37
|
return val.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/`/g, '\\`').replace(/\$/g, '\\$');
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
+
function bashrcMarker(key) {
|
|
40
|
+
return `# intutic-env-${key}`;
|
|
41
|
+
}
|
|
42
|
+
/** `text` without the lines `drop` matches, and otherwise byte for byte. */
|
|
43
|
+
function withoutLines(text, drop) {
|
|
44
|
+
return text.split('\n').filter((l) => !drop(l)).join('\n');
|
|
39
45
|
}
|
|
40
|
-
function
|
|
46
|
+
function isWritable(file) {
|
|
41
47
|
try {
|
|
42
|
-
|
|
48
|
+
fs.accessSync(file, fs.constants.W_OK);
|
|
49
|
+
return true;
|
|
43
50
|
}
|
|
44
51
|
catch {
|
|
45
|
-
|
|
46
|
-
// the key was never set (or the user session has no launchd domain, e.g. over
|
|
47
|
-
// ssh). Both mean "already absent", which is the state the caller asked for.
|
|
52
|
+
return false;
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
function linuxInjectUser(
|
|
51
|
-
const rcFile = path.join(os.homedir(), '.bashrc');
|
|
52
|
-
const marker = `# intutic-env-${key}`;
|
|
53
|
-
const line = `export ${key}="${sanitizeShellValue(value)}" ${marker}`;
|
|
55
|
+
function linuxInjectUser(bashrc, value) {
|
|
54
56
|
let content = '';
|
|
55
57
|
try {
|
|
56
|
-
content = fs.readFileSync(
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
// A missing ~/.bashrc is the normal first-run case
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
content = fs.readFileSync(bashrc, 'utf8');
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
// A missing ~/.bashrc is the normal first-run case; the write below
|
|
62
|
+
// creates it. Any other read failure must not end in the file being
|
|
63
|
+
// replaced by our two lines.
|
|
64
|
+
if (err.code !== 'ENOENT')
|
|
65
|
+
throw err;
|
|
66
|
+
}
|
|
67
|
+
let next = withoutLines(content, (l) => ENV_VARS.some((key) => l.includes(bashrcMarker(key))));
|
|
68
|
+
if (next !== '' && !next.endsWith('\n'))
|
|
69
|
+
next += '\n';
|
|
70
|
+
for (const key of ENV_VARS)
|
|
71
|
+
next += `export ${key}="${sanitizeShellValue(value)}" ${bashrcMarker(key)}\n`;
|
|
72
|
+
fs.writeFileSync(bashrc, next, { mode: 0o644 });
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
/** Removes exactly the marked lines `linuxInjectUser` added. */
|
|
75
|
+
function linuxRemoveUser(bashrc) {
|
|
76
|
+
let content;
|
|
74
77
|
try {
|
|
75
|
-
|
|
76
|
-
const filtered = content.split('\n').filter(l => !l.includes(marker)).join('\n');
|
|
77
|
-
fs.writeFileSync(rcFile, filtered + '\n', { mode: 0o644 });
|
|
78
|
+
content = fs.readFileSync(bashrc, 'utf8');
|
|
78
79
|
}
|
|
79
80
|
catch {
|
|
80
|
-
// Nothing to remove
|
|
81
|
-
// not fail an uninstall: the marker line is inert shell state, so leaving it in
|
|
82
|
-
// place is strictly better than aborting the rest of the removal sequence.
|
|
81
|
+
return; // Nothing to remove.
|
|
83
82
|
}
|
|
83
|
+
const next = withoutLines(content, (l) => ENV_VARS.some((key) => l.includes(bashrcMarker(key))));
|
|
84
|
+
if (next !== content)
|
|
85
|
+
fs.writeFileSync(bashrc, next);
|
|
84
86
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
/**
|
|
88
|
+
* pam_env reads /etc/environment and has no trailing comments, so these
|
|
89
|
+
* lines carry no marker: `KEY=` lines for the two variables are ours to
|
|
90
|
+
* replace and to remove, the same as on the way in.
|
|
91
|
+
*/
|
|
92
|
+
function linuxSetSystem(etcEnvironment, value) {
|
|
93
|
+
const content = fs.readFileSync(etcEnvironment, 'utf8');
|
|
94
|
+
let next = withoutLines(content, (l) => ENV_VARS.some((key) => l.startsWith(`${key}=`)));
|
|
95
|
+
if (value !== null) {
|
|
96
|
+
if (next !== '' && !next.endsWith('\n'))
|
|
97
|
+
next += '\n';
|
|
98
|
+
for (const key of ENV_VARS)
|
|
99
|
+
next += `${key}="${sanitizeShellValue(value)}"\n`;
|
|
95
100
|
}
|
|
101
|
+
if (next !== content)
|
|
102
|
+
fs.writeFileSync(etcEnvironment, next);
|
|
96
103
|
}
|
|
97
104
|
/**
|
|
98
105
|
* Injects ANTHROPIC_BASE_URL and OPENAI_BASE_URL as persistent env vars.
|
|
@@ -100,66 +107,70 @@ function windowsRemove(key) {
|
|
|
100
107
|
* @param proxyUrl - The Intutic proxy URL (e.g. https://proxy.acme.intutic.ai)
|
|
101
108
|
* @returns InjectionResult describing what was done
|
|
102
109
|
*/
|
|
103
|
-
export async function injectBaseUrlEnvVars(proxyUrl) {
|
|
104
|
-
const
|
|
110
|
+
export async function injectBaseUrlEnvVars(proxyUrl, target) {
|
|
111
|
+
const t = resolveTarget(target);
|
|
112
|
+
const platform = t.platform;
|
|
105
113
|
logger.info({ platform, proxyUrl }, 'envInjector.inject_start');
|
|
106
114
|
if (platform === 'darwin') {
|
|
107
115
|
for (const key of ENV_VARS)
|
|
108
|
-
|
|
116
|
+
t.exec(`launchctl setenv ${key} "${sanitizeShellValue(proxyUrl)}"`);
|
|
109
117
|
logger.info({ platform, vars: ENV_VARS }, 'envInjector.macos_launchctl_set');
|
|
110
118
|
return { platform, scope: 'system', vars: [...ENV_VARS], method: 'launchctl setenv' };
|
|
111
119
|
}
|
|
112
120
|
if (platform === 'linux') {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
try {
|
|
116
|
-
const etcEnv = '/etc/environment';
|
|
117
|
-
// Only attempt if writable (i.e., running as root)
|
|
118
|
-
fs.accessSync(etcEnv, fs.constants.W_OK);
|
|
119
|
-
for (const key of ENV_VARS) {
|
|
120
|
-
let content = fs.readFileSync(etcEnv, 'utf8');
|
|
121
|
-
content = content.split('\n').filter(l => !l.startsWith(`${key}=`)).join('\n');
|
|
122
|
-
content += `\n${key}="${sanitizeShellValue(proxyUrl)}"`;
|
|
123
|
-
fs.writeFileSync(etcEnv, content.trim() + '\n', { mode: 0o644 });
|
|
124
|
-
}
|
|
125
|
-
scope = 'system';
|
|
121
|
+
if (isWritable(t.etcEnvironment)) {
|
|
122
|
+
linuxSetSystem(t.etcEnvironment, proxyUrl);
|
|
126
123
|
logger.info({ platform, vars: ENV_VARS }, 'envInjector.linux_etc_environment_set');
|
|
124
|
+
return { platform, scope: 'system', vars: [...ENV_VARS], method: '/etc/environment' };
|
|
127
125
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
linuxInjectUser(key, proxyUrl);
|
|
132
|
-
logger.info({ platform, vars: ENV_VARS }, 'envInjector.linux_bashrc_set');
|
|
133
|
-
}
|
|
134
|
-
return { platform, scope, vars: [...ENV_VARS], method: scope === 'system' ? '/etc/environment' : '~/.bashrc' };
|
|
126
|
+
linuxInjectUser(t.bashrc, proxyUrl);
|
|
127
|
+
logger.info({ platform, vars: ENV_VARS }, 'envInjector.linux_bashrc_set');
|
|
128
|
+
return { platform, scope: 'user', vars: [...ENV_VARS], method: '~/.bashrc' };
|
|
135
129
|
}
|
|
136
130
|
if (platform === 'win32') {
|
|
137
131
|
for (const key of ENV_VARS)
|
|
138
|
-
|
|
132
|
+
t.exec(`setx ${key} "${sanitizeShellValue(proxyUrl)}"`);
|
|
139
133
|
logger.info({ platform, vars: ENV_VARS }, 'envInjector.windows_setx_set');
|
|
140
134
|
return { platform, scope: 'user', vars: [...ENV_VARS], method: 'setx' };
|
|
141
135
|
}
|
|
142
136
|
throw new PlatformNotSupportedError(platform);
|
|
143
137
|
}
|
|
144
138
|
/**
|
|
145
|
-
* Removes the injected base URL env vars
|
|
139
|
+
* Removes the injected base URL env vars: from wherever `injectBaseUrlEnvVars`
|
|
140
|
+
* can have put them, so a removal is idempotent and complete.
|
|
146
141
|
*/
|
|
147
|
-
export async function removeBaseUrlEnvVars() {
|
|
148
|
-
const
|
|
142
|
+
export async function removeBaseUrlEnvVars(target) {
|
|
143
|
+
const t = resolveTarget(target);
|
|
144
|
+
const platform = t.platform;
|
|
149
145
|
logger.info({ platform }, 'envInjector.remove_start');
|
|
150
146
|
if (platform === 'darwin') {
|
|
151
|
-
for (const key of ENV_VARS)
|
|
152
|
-
|
|
147
|
+
for (const key of ENV_VARS) {
|
|
148
|
+
try {
|
|
149
|
+
t.exec(`launchctl unsetenv ${key}`);
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
// `launchctl unsetenv` exits non-zero when the key was never set (or the
|
|
153
|
+
// session has no launchd domain, e.g. over ssh): already absent.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
153
156
|
return;
|
|
154
157
|
}
|
|
155
158
|
if (platform === 'linux') {
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
linuxRemoveUser(t.bashrc);
|
|
160
|
+
// Persist wrote here instead when it ran as root.
|
|
161
|
+
if (isWritable(t.etcEnvironment))
|
|
162
|
+
linuxSetSystem(t.etcEnvironment, null);
|
|
158
163
|
return;
|
|
159
164
|
}
|
|
160
165
|
if (platform === 'win32') {
|
|
161
|
-
for (const key of ENV_VARS)
|
|
162
|
-
|
|
166
|
+
for (const key of ENV_VARS) {
|
|
167
|
+
try {
|
|
168
|
+
t.exec(`reg delete HKCU\\Environment /v ${key} /f`);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// `reg delete` exits 1 when the value is already gone: absence is success.
|
|
172
|
+
}
|
|
173
|
+
}
|
|
163
174
|
return;
|
|
164
175
|
}
|
|
165
176
|
throw new PlatformNotSupportedError(platform);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envInjector.js","sourceRoot":"","sources":["../../src/lib/envInjector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAQ,SAAS,CAAA;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAQ,SAAS,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;AAE1C,MAAM,QAAQ,GAAG,CAAC,oBAAoB,EAAE,iBAAiB,CAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"envInjector.js","sourceRoot":"","sources":["../../src/lib/envInjector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAQ,SAAS,CAAA;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAQ,SAAS,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;AAE1C,MAAM,QAAQ,GAAG,CAA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CAAC,CAAC,CAAC,cAAc,CAAC;YAAE,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;QACxE,OAAM;IACR,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,CAAC,CAAC,IAAI,CAAC,mCAAmC,GAAG,KAAK,CAAC,CAAA;YACrD,CAAC;YAAC,MAAM,CAAC;gBACP,2EAA2E;YAC7E,CAAC;QACH,CAAC;QACD,OAAM;IACR,CAAC;IACD,MAAM,IAAI,yBAAyB,CAAC,QAAQ,CAAC,CAAA;AAC/C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the local proxy listens, for every command that talks to it.
|
|
3
|
+
*
|
|
4
|
+
* One source: `INTUTIC_PROXY_URL` (default `http://localhost:4000`), the
|
|
5
|
+
* variable `intutic exec` already points agents at. `connect` used to take its
|
|
6
|
+
* port from `PORT` while `budget` and `doctor` hardcoded 4000, so moving the
|
|
7
|
+
* proxy left them probing a port nothing listened on. `PORT` is not read: in a
|
|
8
|
+
* developer's shell it usually belongs to some other server.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/** The local proxy's port, from `INTUTIC_PROXY_URL` (an empty value means unset). */
|
|
13
|
+
export declare function localProxyPort(): number;
|
|
14
|
+
/**
|
|
15
|
+
* `http://127.0.0.1:<port>`: the loopback address, not `localhost`, so a probe
|
|
16
|
+
* cannot resolve to `::1` while the proxy listens on IPv4 only.
|
|
17
|
+
*/
|
|
18
|
+
export declare function localProxyProbeBase(): string;
|
|
19
|
+
//# sourceMappingURL=localProxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localProxy.d.ts","sourceRoot":"","sources":["../../src/lib/localProxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,qFAAqF;AACrF,wBAAgB,cAAc,IAAI,MAAM,CASvC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the local proxy listens, for every command that talks to it.
|
|
3
|
+
*
|
|
4
|
+
* One source: `INTUTIC_PROXY_URL` (default `http://localhost:4000`), the
|
|
5
|
+
* variable `intutic exec` already points agents at. `connect` used to take its
|
|
6
|
+
* port from `PORT` while `budget` and `doctor` hardcoded 4000, so moving the
|
|
7
|
+
* proxy left them probing a port nothing listened on. `PORT` is not read: in a
|
|
8
|
+
* developer's shell it usually belongs to some other server.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
const DEFAULT_PROXY_PORT = 4000;
|
|
13
|
+
/** The local proxy's port, from `INTUTIC_PROXY_URL` (an empty value means unset). */
|
|
14
|
+
export function localProxyPort() {
|
|
15
|
+
const raw = process.env.INTUTIC_PROXY_URL;
|
|
16
|
+
if (!raw)
|
|
17
|
+
return DEFAULT_PROXY_PORT;
|
|
18
|
+
try {
|
|
19
|
+
const port = Number(new URL(raw).port);
|
|
20
|
+
return port > 0 ? port : DEFAULT_PROXY_PORT;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return DEFAULT_PROXY_PORT;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `http://127.0.0.1:<port>`: the loopback address, not `localhost`, so a probe
|
|
28
|
+
* cannot resolve to `::1` while the proxy listens on IPv4 only.
|
|
29
|
+
*/
|
|
30
|
+
export function localProxyProbeBase() {
|
|
31
|
+
return `http://127.0.0.1:${localProxyPort()}`;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=localProxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localProxy.js","sourceRoot":"","sources":["../../src/lib/localProxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,kBAAkB,GAAG,IAAI,CAAA;AAE/B,qFAAqF;AACrF,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;IACzC,IAAI,CAAC,GAAG;QAAE,OAAO,kBAAkB,CAAA;IACnC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;QACtC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAA;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,CAAA;IAC3B,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,oBAAoB,cAAc,EAAE,EAAE,CAAA;AAC/C,CAAC"}
|
package/dist/lib/onboarding.d.ts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* LLD #8 — Sync Daemon / CLI
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
export declare function printOnboardingGuide(harnesses: string[], userAuthToken?: string
|
|
9
|
+
export declare function printOnboardingGuide(harnesses: string[], userAuthToken?: string): void;
|
|
10
10
|
//# sourceMappingURL=onboarding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/lib/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/lib/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA6BH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAgOtF"}
|
package/dist/lib/onboarding.js
CHANGED
|
@@ -8,30 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import pc from 'picocolors';
|
|
10
10
|
import { log } from './logger.js';
|
|
11
|
+
import { anthropicBaseUrl, openaiBaseUrl } from '@intutic/shared-types';
|
|
11
12
|
/**
|
|
12
13
|
* Print tailored setup instructions for a list of harnesses.
|
|
13
14
|
*
|
|
14
15
|
* @param harnesses - List of harness types (e.g. ['cursor', 'aider'])
|
|
15
16
|
* @param apiKey - Optional API key to display in the instructions
|
|
16
|
-
* @param devMode - retained for call-site compatibility; the proxy is always local
|
|
17
17
|
*/
|
|
18
18
|
function maskUserToken(tokenVal) {
|
|
19
19
|
if (!tokenVal)
|
|
20
|
-
return '<
|
|
20
|
+
return '<YOUR_PROVIDER_API_KEY>';
|
|
21
21
|
return `${tokenVal.substring(0, 4)}...${tokenVal.substring(tokenVal.length - 4)}`;
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Trims trailing `/` characters without a regex — see the identical helper
|
|
25
|
-
* in `commands/exec.ts` for why: `/\/+$/` is flagged by static analysis as a
|
|
26
|
-
* polynomial-time pattern on external input, and a loop sidesteps the whole
|
|
27
|
-
* category rather than needing an exemption.
|
|
28
|
-
*/
|
|
29
|
-
function trimTrailingSlashes(s) {
|
|
30
|
-
let end = s.length;
|
|
31
|
-
while (end > 0 && s.charCodeAt(end - 1) === 47 /* '/' */)
|
|
32
|
-
end--;
|
|
33
|
-
return s.slice(0, end);
|
|
34
|
-
}
|
|
35
23
|
function writeCliOutput(line) {
|
|
36
24
|
process.stdout.write(line + '\n');
|
|
37
25
|
}
|
|
@@ -41,15 +29,14 @@ function printEnvVar(envName, envVal) {
|
|
|
41
29
|
function printYamlKey(keyName, keyVal, spaces = 5) {
|
|
42
30
|
writeCliOutput(`${' '.repeat(spaces)}${keyName}: ${keyVal}`);
|
|
43
31
|
}
|
|
44
|
-
export function printOnboardingGuide(harnesses, userAuthToken
|
|
32
|
+
export function printOnboardingGuide(harnesses, userAuthToken) {
|
|
45
33
|
const safeDisplayValue = maskUserToken(userAuthToken);
|
|
46
34
|
// Always the local proxy. This used to branch to a remote host when devMode
|
|
47
35
|
// was false, which meant the onboarding instructions we print told people to
|
|
48
36
|
// send their agent traffic somewhere other than the proxy they had just
|
|
49
37
|
// started. Set INTUTIC_PROXY_URL to override.
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const proxyUrl = `${proxyHost}/v1`;
|
|
38
|
+
const proxyHost = anthropicBaseUrl(process.env.INTUTIC_PROXY_URL);
|
|
39
|
+
const proxyUrl = openaiBaseUrl(process.env.INTUTIC_PROXY_URL);
|
|
53
40
|
writeCliOutput('');
|
|
54
41
|
log.header('Intutic — Setup & Integration Instructions');
|
|
55
42
|
writeCliOutput(`To route your agent traffic through the Intutic proxy, follow the setup below.`);
|
|
@@ -57,10 +44,15 @@ export function printOnboardingGuide(harnesses, userAuthToken, devMode = false)
|
|
|
57
44
|
if (userAuthToken) {
|
|
58
45
|
writeCliOutput(`Your Intutic API Key is: ${pc.green(safeDisplayValue)}`);
|
|
59
46
|
}
|
|
47
|
+
else {
|
|
48
|
+
// Standalone, the proxy forwards the agent's own provider key upstream;
|
|
49
|
+
// there is no Intutic key to hand out.
|
|
50
|
+
writeCliOutput('Not logged in: wherever a key is asked for below, use your own provider API key.');
|
|
51
|
+
}
|
|
60
52
|
if (harnesses.length === 0) {
|
|
61
53
|
writeCliOutput('');
|
|
62
54
|
log.info('No harnesses were automatically detected in this workspace.');
|
|
63
|
-
writeCliOutput(`
|
|
55
|
+
writeCliOutput(`See the integration guides at: ${pc.bold('https://docs.intutic.ai/integrations/')}`);
|
|
64
56
|
writeCliOutput('Or use the general subprocess wrapper to launch any CLI agent:');
|
|
65
57
|
writeCliOutput(` ${pc.bold(`intutic exec -- <your-agent-command>`)}`);
|
|
66
58
|
return;
|
|
@@ -71,7 +63,7 @@ export function printOnboardingGuide(harnesses, userAuthToken, devMode = false)
|
|
|
71
63
|
case 'cursor':
|
|
72
64
|
writeCliOutput(` 1. Open Cursor Settings (Cmd+, or Ctrl+,).`);
|
|
73
65
|
writeCliOutput(` 2. Navigate to the ${pc.bold('Models')} tab.`);
|
|
74
|
-
writeCliOutput(` 3. Under ${pc.bold('OpenAI API Key')}, enter your
|
|
66
|
+
writeCliOutput(` 3. Under ${pc.bold('OpenAI API Key')}, enter your API key:`);
|
|
75
67
|
writeCliOutput(` ${pc.green(safeDisplayValue)}`);
|
|
76
68
|
writeCliOutput(` 4. Enable the ${pc.bold('"Override OpenAI Base URL"')} toggle.`);
|
|
77
69
|
writeCliOutput(` 5. Set the override URL to:`);
|
|
@@ -113,7 +105,7 @@ export function printOnboardingGuide(harnesses, userAuthToken, devMode = false)
|
|
|
113
105
|
writeCliOutput(` 2. Click the settings gear icon (⚙️).`);
|
|
114
106
|
writeCliOutput(` 3. Set ${pc.bold('API Provider')} to: OpenAI Compatible`);
|
|
115
107
|
writeCliOutput(` 4. Set ${pc.bold('Base URL')} to: ${pc.cyan(proxyUrl)}`);
|
|
116
|
-
writeCliOutput(` 5. Set ${pc.bold('API Key')} to your
|
|
108
|
+
writeCliOutput(` 5. Set ${pc.bold('API Key')} to your API key:`);
|
|
117
109
|
writeCliOutput(` ${pc.green(safeDisplayValue)}`);
|
|
118
110
|
writeCliOutput(` 6. Enter the target Model ID (e.g. gpt-4o) and save.`);
|
|
119
111
|
break;
|
|
@@ -176,19 +168,21 @@ export function printOnboardingGuide(harnesses, userAuthToken, devMode = false)
|
|
|
176
168
|
writeCliOutput(` In your OpenAI Chat Model node inside n8n:`);
|
|
177
169
|
writeCliOutput(` 1. Expand "Parameters" and set ${pc.bold('Base URL')} to:`);
|
|
178
170
|
writeCliOutput(` ${pc.cyan(proxyUrl)}`);
|
|
179
|
-
writeCliOutput(` 2. Select/Create a custom credential set and use your
|
|
171
|
+
writeCliOutput(` 2. Select/Create a custom credential set and use your API key.`);
|
|
180
172
|
break;
|
|
181
173
|
case 'windsurf':
|
|
182
|
-
writeCliOutput(`
|
|
174
|
+
writeCliOutput(` Windsurf has no base-URL setting. intutic connect routes Cascade through the`);
|
|
175
|
+
writeCliOutput(` proxy's TLS interception (http.proxy in Windsurf's user settings.json).`);
|
|
183
176
|
break;
|
|
184
177
|
case 'dsh':
|
|
185
178
|
writeCliOutput(` Every sync registers the Intutic gate into each EXISTING dsh profile`);
|
|
186
179
|
writeCliOutput(` (${pc.bold('cordis.patch.yml')} + the ${pc.bold('@intutic/gate')} package.json dependency) and`);
|
|
187
|
-
writeCliOutput(`
|
|
188
|
-
writeCliOutput(`
|
|
180
|
+
writeCliOutput(` points dsh's default LLM route (the ${pc.bold('llm-deepseek')} entry, in that same`);
|
|
181
|
+
writeCliOutput(` ${pc.bold('cordis.patch.yml')}) at the Intutic proxy — no manual config edit.`);
|
|
189
182
|
writeCliOutput(` `);
|
|
190
|
-
writeCliOutput(` One manual step remains, PER PROFILE
|
|
191
|
-
writeCliOutput(`
|
|
183
|
+
writeCliOutput(` One manual step remains, PER PROFILE — until it runs, dsh only warns and`);
|
|
184
|
+
writeCliOutput(` runs UNGOVERNED. This daemon cannot run a package manager in a directory`);
|
|
185
|
+
writeCliOutput(` it does not own, so finish activation with:`);
|
|
192
186
|
writeCliOutput(` ${pc.bold('dsh plugin --profile <name> add @intutic/gate')}`);
|
|
193
187
|
writeCliOutput(` See ${pc.cyan('$DSH_HOME/INSTALL.md')} (auto-generated, lists your current profiles).`);
|
|
194
188
|
writeCliOutput(` `);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/lib/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/lib/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;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,CAAC,gCAAgC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;IACtE,cAAc,CAAC,EAAE,CAAC,CAAA;AACpB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* OpenTelemetry trace-context propagation for outbound CLI HTTP calls.
|
|
3
3
|
*
|
|
4
4
|
* Deliberately lighter than the NodeSDK instrumentation used by
|
|
5
|
-
* control-plane/
|
|
5
|
+
* control-plane/mcp-daemon: `intutic connect` is a daemon
|
|
6
6
|
* every open-core user installs, and the auto-instrumentations-node
|
|
7
7
|
* meta-package is heavy (dozens of instrumented libraries the CLI doesn't
|
|
8
8
|
* use) for a benefit only the minority who run a collector would see.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* OpenTelemetry trace-context propagation for outbound CLI HTTP calls.
|
|
3
3
|
*
|
|
4
4
|
* Deliberately lighter than the NodeSDK instrumentation used by
|
|
5
|
-
* control-plane/
|
|
5
|
+
* control-plane/mcp-daemon: `intutic connect` is a daemon
|
|
6
6
|
* every open-core user installs, and the auto-instrumentations-node
|
|
7
7
|
* meta-package is heavy (dozens of instrumented libraries the CLI doesn't
|
|
8
8
|
* use) for a benefit only the minority who run a collector would see.
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* wait" would be a supported way to disarm governance.
|
|
19
19
|
* empty — parsed, but no rules. The writer always ships the destructive
|
|
20
20
|
* tier, so zero rules means the compile produced nothing.
|
|
21
|
-
* invalid — digest or workspace mismatch. The gates drop the dynamic tier
|
|
21
|
+
* invalid — digest or workspace mismatch. The gates drop the dynamic tier,
|
|
22
|
+
* keeping only its SSO-group refusals.
|
|
22
23
|
* absent — no file. The compiled floor still applies; nothing else does.
|
|
23
24
|
*
|
|
24
25
|
* Kept deliberately faithful rather than improved: a reader that disagrees with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policySnapshot.d.ts","sourceRoot":"","sources":["../../src/lib/policySnapshot.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"policySnapshot.d.ts","sourceRoot":"","sources":["../../src/lib/policySnapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAOH;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAA;AAE1C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,0BAA0B,CAAA;AAE1D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAE3E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,aAAa,CAAA;IACpB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAA;IACjB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAIjD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACrE,oBAAoB,CAsFtB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,GAAE;IAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAO,GACtD,oBAAoB,CAkBtB"}
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* wait" would be a supported way to disarm governance.
|
|
19
19
|
* empty — parsed, but no rules. The writer always ships the destructive
|
|
20
20
|
* tier, so zero rules means the compile produced nothing.
|
|
21
|
-
* invalid — digest or workspace mismatch. The gates drop the dynamic tier
|
|
21
|
+
* invalid — digest or workspace mismatch. The gates drop the dynamic tier,
|
|
22
|
+
* keeping only its SSO-group refusals.
|
|
22
23
|
* absent — no file. The compiled floor still applies; nothing else does.
|
|
23
24
|
*
|
|
24
25
|
* Kept deliberately faithful rather than improved: a reader that disagrees with
|
|
@@ -75,6 +76,9 @@ export function parsePolicySnapshot(text, opts = {}) {
|
|
|
75
76
|
droppedRules: 0,
|
|
76
77
|
path: opts.path ?? resolveSnapshotRulesPath(),
|
|
77
78
|
};
|
|
79
|
+
// The SSO-group refusals the gates keep when they drop the rest of an
|
|
80
|
+
// invalid snapshot's dynamic tier.
|
|
81
|
+
let ssoGroupRefusals = 0;
|
|
78
82
|
const lines = text.split('\n');
|
|
79
83
|
for (const line of lines) {
|
|
80
84
|
if (line.startsWith('#digest ')) {
|
|
@@ -109,6 +113,8 @@ export function parsePolicySnapshot(text, opts = {}) {
|
|
|
109
113
|
continue;
|
|
110
114
|
}
|
|
111
115
|
out.ruleCount += 1;
|
|
116
|
+
if (f[0].startsWith('sso_group.') && f[1] === 'block')
|
|
117
|
+
ssoGroupRefusals += 1;
|
|
112
118
|
}
|
|
113
119
|
// Integrity, cheapest failure first. A digest nobody recomputes is a comment;
|
|
114
120
|
// a workspace id nobody compares means workspace A's rules get enforced on B's
|
|
@@ -126,10 +132,11 @@ export function parsePolicySnapshot(text, opts = {}) {
|
|
|
126
132
|
if (out.state === 'ok' && out.ruleCount === 0)
|
|
127
133
|
out.state = 'empty';
|
|
128
134
|
// The dynamic tier is additive, so dropping it returns to yesterday's
|
|
129
|
-
// behaviour rather than opening a hole
|
|
130
|
-
//
|
|
135
|
+
// behaviour rather than opening a hole — except the SSO-group refusals,
|
|
136
|
+
// which the gates keep because they only ever refuse. Reported as what the
|
|
137
|
+
// gates will have.
|
|
131
138
|
if (out.state === 'invalid')
|
|
132
|
-
out.ruleCount =
|
|
139
|
+
out.ruleCount = ssoGroupRefusals;
|
|
133
140
|
if (out.state === 'ok' && out.generatedAt) {
|
|
134
141
|
const t = Date.parse(out.generatedAt);
|
|
135
142
|
if (!Number.isNaN(t)) {
|