@intutic/cli 2.0.0 → 2.1.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 +120 -128
- 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 +20 -9
- package/dist/commands/connect.js.map +1 -1
- 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/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.map +1 -1
- package/dist/commands/gateway.js +3 -1
- 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 +36 -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 +109 -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/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/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 +14 -12
- package/dist/harness/antigravity.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 +39 -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 +28 -26
- 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/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 +10 -2
- package/dist/harness/githubCopilot.js.map +1 -1
- package/dist/harness/jsSdkGatedAdapter.d.ts.map +1 -1
- package/dist/harness/jsSdkGatedAdapter.js +4 -3
- package/dist/harness/jsSdkGatedAdapter.js.map +1 -1
- package/dist/harness/langgraph.js +4 -4
- package/dist/harness/langgraph.js.map +1 -1
- package/dist/harness/n8n.d.ts +5 -2
- package/dist/harness/n8n.d.ts.map +1 -1
- package/dist/harness/n8n.js +12 -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/opencode.d.ts +3 -2
- package/dist/harness/opencode.d.ts.map +1 -1
- package/dist/harness/opencode.js +3 -2
- 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 +27 -26
- 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 +9 -12
- package/dist/harness/rooCode.js.map +1 -1
- package/dist/harness/sdkGatedAdapter.d.ts.map +1 -1
- package/dist/harness/sdkGatedAdapter.js +4 -3
- 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 +3 -0
- 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 +12 -5
- package/dist/harness/windsurf.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/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
|
@@ -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;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAEvE;;;;;GAKG;AACH,SAAS,aAAa,CAAC,QAAiB;IACtC,IAAI,CAAC,QAAQ;QAAE,OAAO,yBAAyB,CAAA;IAC/C,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAA;AACnF,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;AACnC,CAAC;AAED,SAAS,WAAW,CAAC,OAAe,EAAE,MAAc;IAClD,cAAc,CAAC,eAAe,OAAO,KAAK,MAAM,GAAG,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,YAAY,CAAC,OAAe,EAAE,MAAc,EAAE,MAAM,GAAG,CAAC;IAC/D,cAAc,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,KAAK,MAAM,EAAE,CAAC,CAAA;AAC9D,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E,CAAC,CAAA;gBAC1F,cAAc,CAAC,8DAA8D,CAAC,CAAA;gBAC9E,cAAc,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,gDAAgD,CAAC,EAAE,CAAC,CAAA;gBACrF,MAAK;YAEP;gBACE,cAAc,CAAC,qDAAqD,CAAC,CAAA;gBACrE,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAA;gBACzE,cAAc,CAAC,4CAA4C,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;gBAChF,MAAK;QACT,CAAC;IACH,CAAC;IAED,cAAc,CAAC,EAAE,CAAC,CAAA;IAClB,GAAG,CAAC,IAAI,CAAC,gCAAgC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;IACtE,cAAc,CAAC,EAAE,CAAC,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default sandbox image, built locally from the Dockerfile the CLI ships.
|
|
3
|
+
*
|
|
4
|
+
* There is no registry copy to pull: the default used to be
|
|
5
|
+
* `intutic/sandbox:latest`, a name nothing publishes, so `intutic exec
|
|
6
|
+
* --sandbox` failed on the pull for everyone who did not pass
|
|
7
|
+
* `--sandbox-image`. The image is small and built from `resources/sandbox`,
|
|
8
|
+
* which is in the npm package, so the first sandboxed run builds it and tags it
|
|
9
|
+
* with the CLI version; later runs, and upgrades to the same version, reuse it.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/** The image `--sandbox-image` defaults to: built locally, tagged with this CLI's version. */
|
|
14
|
+
export declare const DEFAULT_SANDBOX_IMAGE: string;
|
|
15
|
+
/** Directory holding the shipped Dockerfile and entrypoint. */
|
|
16
|
+
export declare function sandboxBuildContext(): string;
|
|
17
|
+
/** Runs a container-runtime command; resolves with its exit code. */
|
|
18
|
+
export type RuntimeRunner = (runtime: string, args: string[], inheritOutput: boolean) => Promise<number>;
|
|
19
|
+
/**
|
|
20
|
+
* Make sure `image` can be run. Only the default image is built here; any
|
|
21
|
+
* other name is the user's own and the runtime pulls it as usual.
|
|
22
|
+
*
|
|
23
|
+
* Throws with a message for the user when the default image is missing and
|
|
24
|
+
* cannot be built.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ensureSandboxImage(runtime: string, image: string, run?: RuntimeRunner, context?: string): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,8FAA8F;AAC9F,eAAO,MAAM,qBAAqB,QAA+B,CAAA;AAEjE,+DAA+D;AAC/D,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED,qEAAqE;AACrE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AASxG;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,aAA4B,EACjC,OAAO,GAAE,MAA8B,GACtC,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default sandbox image, built locally from the Dockerfile the CLI ships.
|
|
3
|
+
*
|
|
4
|
+
* There is no registry copy to pull: the default used to be
|
|
5
|
+
* `intutic/sandbox:latest`, a name nothing publishes, so `intutic exec
|
|
6
|
+
* --sandbox` failed on the pull for everyone who did not pass
|
|
7
|
+
* `--sandbox-image`. The image is small and built from `resources/sandbox`,
|
|
8
|
+
* which is in the npm package, so the first sandboxed run builds it and tags it
|
|
9
|
+
* with the CLI version; later runs, and upgrades to the same version, reuse it.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { spawn } from 'node:child_process';
|
|
14
|
+
import { existsSync } from 'node:fs';
|
|
15
|
+
import { createRequire } from 'node:module';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { log } from '../logger.js';
|
|
19
|
+
const { version } = createRequire(import.meta.url)('../../../package.json');
|
|
20
|
+
/** The image `--sandbox-image` defaults to: built locally, tagged with this CLI's version. */
|
|
21
|
+
export const DEFAULT_SANDBOX_IMAGE = `intutic/sandbox:${version}`;
|
|
22
|
+
/** Directory holding the shipped Dockerfile and entrypoint. */
|
|
23
|
+
export function sandboxBuildContext() {
|
|
24
|
+
// src/lib/sandbox/image.ts and dist/lib/sandbox/image.js are the same depth.
|
|
25
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
return path.resolve(here, '../../../resources/sandbox');
|
|
27
|
+
}
|
|
28
|
+
const spawnRuntime = (runtime, args, inheritOutput) => new Promise((resolve) => {
|
|
29
|
+
const child = spawn(runtime, args, { stdio: inheritOutput ? 'inherit' : 'ignore' });
|
|
30
|
+
child.on('error', () => resolve(127));
|
|
31
|
+
child.on('exit', (code) => resolve(code ?? 1));
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Make sure `image` can be run. Only the default image is built here; any
|
|
35
|
+
* other name is the user's own and the runtime pulls it as usual.
|
|
36
|
+
*
|
|
37
|
+
* Throws with a message for the user when the default image is missing and
|
|
38
|
+
* cannot be built.
|
|
39
|
+
*/
|
|
40
|
+
export async function ensureSandboxImage(runtime, image, run = spawnRuntime, context = sandboxBuildContext()) {
|
|
41
|
+
if (image !== DEFAULT_SANDBOX_IMAGE)
|
|
42
|
+
return;
|
|
43
|
+
if ((await run(runtime, ['image', 'inspect', image], false)) === 0)
|
|
44
|
+
return;
|
|
45
|
+
if (!existsSync(path.join(context, 'Dockerfile'))) {
|
|
46
|
+
throw new Error(`the sandbox Dockerfile is not part of this installation (${context}). ` +
|
|
47
|
+
'Install the CLI from npm, or pass --sandbox-image with your own image.');
|
|
48
|
+
}
|
|
49
|
+
log.info(`Building the sandbox image ${image} (first sandboxed run with this CLI version)…`);
|
|
50
|
+
if ((await run(runtime, ['build', '-t', image, context], true)) !== 0) {
|
|
51
|
+
throw new Error(`${runtime} build of ${image} failed; see the output above`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/lib/sandbox/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAElC,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,uBAAuB,CAAwB,CAAA;AAElG,8FAA8F;AAC9F,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,OAAO,EAAE,CAAA;AAEjE,+DAA+D;AAC/D,MAAM,UAAU,mBAAmB;IACjC,6EAA6E;IAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAA;AACzD,CAAC;AAKD,MAAM,YAAY,GAAkB,CAAC,OAAO,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Aa,KAAK,+BAA+B,CAAC,CAAA;IAC9E,CAAC;AACH,CAAC"}
|
|
@@ -33,6 +33,7 @@ export declare class OciBackend implements SandboxBackend {
|
|
|
33
33
|
private readonly env;
|
|
34
34
|
constructor(runtime: OciRuntime, env: Record<string, string>);
|
|
35
35
|
health(): Promise<SandboxHealth>;
|
|
36
|
+
prepare(image: string): Promise<void>;
|
|
36
37
|
run(spec: SandboxSpec): Promise<number>;
|
|
37
38
|
}
|
|
38
39
|
//# sourceMappingURL=oci.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oci.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/oci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"oci.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/oci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE5E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE5C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAoC7E;AAED,qBAAa,UAAW,YAAW,cAAc;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;gBAEhC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMtD,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;IAgBhC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrC,GAAG,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;CAuB9C"}
|
package/dist/lib/sandbox/oci.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { spawn } from 'node:child_process';
|
|
22
22
|
import { log } from '../logger.js';
|
|
23
|
+
import { ensureSandboxImage } from './image.js';
|
|
23
24
|
/**
|
|
24
25
|
* Build the container runtime argv for a spec. Pure and exported so the
|
|
25
26
|
* envelope can be asserted without launching anything — the isolation flags are
|
|
@@ -78,6 +79,9 @@ export class OciBackend {
|
|
|
78
79
|
: resolve({ available: false, detail: `${this.runtime} daemon not reachable` }));
|
|
79
80
|
});
|
|
80
81
|
}
|
|
82
|
+
async prepare(image) {
|
|
83
|
+
await ensureSandboxImage(this.runtime, image);
|
|
84
|
+
}
|
|
81
85
|
async run(spec) {
|
|
82
86
|
const args = buildOciArgs(this.runtime, spec);
|
|
83
87
|
log.dim(`sandbox: ${this.runtime} ${args.slice(0, 12).join(' ')} …`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oci.js","sourceRoot":"","sources":["../../../src/lib/sandbox/oci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"oci.js","sourceRoot":"","sources":["../../../src/lib/sandbox/oci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAK/C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAmB,EAAE,IAAiB;IACjE,MAAM,IAAI,GAAa,CAAC,KA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A;;oBACnB,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;YACzB,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -42,6 +42,11 @@ export interface SandboxBackend {
|
|
|
42
42
|
readonly name: string;
|
|
43
43
|
/** Whether this backend can run here (e.g. docker reachable, KVM present). */
|
|
44
44
|
health(): Promise<SandboxHealth>;
|
|
45
|
+
/**
|
|
46
|
+
* Get `image` ready to run, before `run` (the OCI backend builds the
|
|
47
|
+
* default image here). Throws with a message for the user when it cannot.
|
|
48
|
+
*/
|
|
49
|
+
prepare?(image: string): Promise<void>;
|
|
45
50
|
/** Launch the spec; resolves with the process exit code. */
|
|
46
51
|
run(spec: SandboxSpec): Promise<number>;
|
|
47
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,8EAA8E;IAC9E,cAAc,EAAE,MAAM,CAAA;IACtB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,GAAG,EAAE,OAAO,CAAA;CACb;AAED,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;I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@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intutic/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Intutic CLI — sync daemon, harness detection, and workspace management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist/",
|
|
14
|
+
"resources/sandbox/",
|
|
14
15
|
"README.md"
|
|
15
16
|
],
|
|
16
17
|
"repository": {
|
|
@@ -37,10 +38,10 @@
|
|
|
37
38
|
"commander": "^13",
|
|
38
39
|
"ioredis": "^5.11.1",
|
|
39
40
|
"picocolors": "^1",
|
|
40
|
-
"@intutic/
|
|
41
|
-
"@intutic/
|
|
42
|
-
"@intutic/
|
|
43
|
-
"@intutic/sync-daemon": "2.
|
|
41
|
+
"@intutic/shared-types": "2.1.0",
|
|
42
|
+
"@intutic/logger": "2.1.0",
|
|
43
|
+
"@intutic/id": "2.1.0",
|
|
44
|
+
"@intutic/sync-daemon": "2.1.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"typescript": "^5.5",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Intutic sandbox base image (LLD #63 §6).
|
|
2
|
+
#
|
|
3
|
+
# A minimal, genuinely-isolating runtime for `intutic exec --sandbox`. It ships
|
|
4
|
+
# only what the entrypoint needs to install the egress firewall and drop
|
|
5
|
+
# privilege: nftables, libcap (capsh), and a resolver. `intutic exec --sandbox`
|
|
6
|
+
# builds it from this directory on first use, tagged intutic/sandbox:<CLI
|
|
7
|
+
# version>. Bring your agent by extending that tag (`FROM intutic/sandbox:<ver>`)
|
|
8
|
+
# and installing your harness, or pass `--sandbox-image` with your own image
|
|
9
|
+
# that includes nftables + capsh.
|
|
10
|
+
#
|
|
11
|
+
# The image is intentionally not a place to run the agent as root: the
|
|
12
|
+
# entrypoint switches to the unprivileged `sandbox` user after applying the
|
|
13
|
+
# firewall.
|
|
14
|
+
FROM alpine:3.20
|
|
15
|
+
|
|
16
|
+
# nftables: the egress firewall. libcap: capsh, to drop NET_ADMIN. iproute2 +
|
|
17
|
+
# bash: entrypoint plumbing. curl + ca-certificates: so a sandboxed agent (and
|
|
18
|
+
# our own verification) can actually make governed calls through the proxy.
|
|
19
|
+
RUN apk add --no-cache nftables libcap iproute2 bash ca-certificates curl
|
|
20
|
+
|
|
21
|
+
# Unprivileged user the agent actually runs as.
|
|
22
|
+
RUN adduser -D -h /home/sandbox -s /bin/bash sandbox
|
|
23
|
+
|
|
24
|
+
COPY entrypoint.sh /usr/local/bin/intutic-sandbox-entrypoint
|
|
25
|
+
RUN chmod 0555 /usr/local/bin/intutic-sandbox-entrypoint
|
|
26
|
+
|
|
27
|
+
# The working directory the launcher bind-mounts the project into.
|
|
28
|
+
WORKDIR /work
|
|
29
|
+
|
|
30
|
+
ENTRYPOINT ["/usr/local/bin/intutic-sandbox-entrypoint"]
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Intutic sandbox entrypoint (LLD #63 §6).
|
|
3
|
+
#
|
|
4
|
+
# The container starts as root with NET_ADMIN so this script can install a
|
|
5
|
+
# firewall; the agent must NOT keep that power. So, in order:
|
|
6
|
+
# 1. Resolve the governing proxy's address (written into /etc/hosts by the
|
|
7
|
+
# launcher via --add-host).
|
|
8
|
+
# 2. Apply a default-DROP egress firewall permitting outbound only to the
|
|
9
|
+
# proxy, DNS, loopback, and established return traffic — the same shape as
|
|
10
|
+
# the host-level L2 rules, scoped to this container's network namespace.
|
|
11
|
+
# 3. Drop NET_ADMIN/NET_RAW and switch to the unprivileged `sandbox` user, so
|
|
12
|
+
# the agent cannot alter or remove the firewall it now runs behind.
|
|
13
|
+
# 4. exec the agent command.
|
|
14
|
+
#
|
|
15
|
+
# Honesty rule (LLD #63 §6): if the firewall cannot be applied, we refuse to run
|
|
16
|
+
# rather than run ungoverned. A sandbox that silently fails open is worse than
|
|
17
|
+
# no sandbox, because the caller believes it is protected.
|
|
18
|
+
set -eu
|
|
19
|
+
|
|
20
|
+
PROXY_HOST="${INTUTIC_SANDBOX_PROXY_HOST:-host.docker.internal}"
|
|
21
|
+
|
|
22
|
+
# Resolve the proxy host. --add-host writes it to /etc/hosts, which is the most
|
|
23
|
+
# reliable source inside a minimal image (busybox has no getent).
|
|
24
|
+
PROXY_IP="$(awk -v h="$PROXY_HOST" '$2==h || $3==h {print $1; exit}' /etc/hosts 2>/dev/null || true)"
|
|
25
|
+
if [ -z "$PROXY_IP" ]; then
|
|
26
|
+
PROXY_IP="$(getent hosts "$PROXY_HOST" 2>/dev/null | awk '{print $1; exit}' || true)"
|
|
27
|
+
fi
|
|
28
|
+
if [ -z "$PROXY_IP" ]; then
|
|
29
|
+
echo "intutic-sandbox: cannot resolve proxy host '$PROXY_HOST' — refusing to run ungoverned" >&2
|
|
30
|
+
exit 91
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Extra operator-allowed destinations (comma-separated CIDRs), e.g. a package
|
|
34
|
+
# registry the build step needs. Rendered as additional accept rules.
|
|
35
|
+
EXTRA_RULES=""
|
|
36
|
+
if [ -n "${INTUTIC_SANDBOX_ALLOW:-}" ]; then
|
|
37
|
+
OLDIFS="$IFS"; IFS=','
|
|
38
|
+
for cidr in $INTUTIC_SANDBOX_ALLOW; do
|
|
39
|
+
[ -z "$cidr" ] && continue
|
|
40
|
+
case "$cidr" in
|
|
41
|
+
*:*) EXTRA_RULES="$EXTRA_RULES
|
|
42
|
+
ip6 daddr $cidr accept" ;;
|
|
43
|
+
*) EXTRA_RULES="$EXTRA_RULES
|
|
44
|
+
ip daddr $cidr accept" ;;
|
|
45
|
+
esac
|
|
46
|
+
done
|
|
47
|
+
IFS="$OLDIFS"
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
if ! nft -f - <<EOF
|
|
51
|
+
table inet intutic_egress {
|
|
52
|
+
chain output {
|
|
53
|
+
type filter hook output priority 0; policy drop;
|
|
54
|
+
oif "lo" accept
|
|
55
|
+
ct state established,related accept
|
|
56
|
+
meta l4proto { tcp, udp } th dport 53 accept
|
|
57
|
+
ip daddr $PROXY_IP accept$EXTRA_RULES
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
EOF
|
|
61
|
+
then
|
|
62
|
+
echo "intutic-sandbox: FAILED to apply egress firewall — refusing to run ungoverned" >&2
|
|
63
|
+
exit 90
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# Strip the `--` separator the launcher inserts before the command.
|
|
67
|
+
if [ "${1:-}" = "--" ]; then shift; fi
|
|
68
|
+
if [ "$#" -eq 0 ]; then
|
|
69
|
+
echo "intutic-sandbox: no command given" >&2
|
|
70
|
+
exit 2
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# Drop every capability we needed as root — the network-admin caps used for the
|
|
74
|
+
# firewall, and the setpcap/setuid/setgid caps used for this very transition —
|
|
75
|
+
# from the bounding set, then run as the unprivileged sandbox user. capsh still
|
|
76
|
+
# holds these in its permitted set long enough to perform the user switch; the
|
|
77
|
+
# bounding-set drop only stops them being *re-acquired*, so the agent process
|
|
78
|
+
# ends up with an empty capability set and no path back to any of them. The
|
|
79
|
+
# firewall above is therefore immutable from inside the sandbox.
|
|
80
|
+
#
|
|
81
|
+
# Attest, then exec — in that order, inside the SAME post-drop shell, so the
|
|
82
|
+
# attestation call itself only has the locked-down firewall to route through
|
|
83
|
+
# (LLD #63 §6, TD-333). Before this, `executionMode: 'SANDBOX'` on a session
|
|
84
|
+
# was set entirely by the host-side `intutic exec` CLI, before this container
|
|
85
|
+
# even started — a claim with nothing behind it. This callback can only
|
|
86
|
+
# succeed from a process that got this far: firewall installed, capabilities
|
|
87
|
+
# dropped. It does NOT prove entrypoint.sh itself ran unmodified — a
|
|
88
|
+
# `--sandbox-image` deliberately built to skip the firewall/capsh steps above
|
|
89
|
+
# but still make this call would still attest; closing that needs
|
|
90
|
+
# measured/attested boot, which nothing here has. Best-effort like
|
|
91
|
+
# openSandboxSession/closeSandboxSession on the host side: a failed call is
|
|
92
|
+
# logged and the agent runs anyway — attestation adds visibility, it is not
|
|
93
|
+
# itself a new gate (that's what sandboxRequirement='require' is for,
|
|
94
|
+
# enforced client-side before this container is even launched).
|
|
95
|
+
export PROXY_IP
|
|
96
|
+
exec capsh \
|
|
97
|
+
--drop=cap_net_admin,cap_net_raw,cap_setpcap,cap_setuid,cap_setgid \
|
|
98
|
+
--user=sandbox -- -c '
|
|
99
|
+
if [ -n "${INTUTIC_SESSION_ID:-}" ] && [ -n "${INTUTIC_API_KEY:-}" ]; then
|
|
100
|
+
curl -sf -m 3 -X POST "http://'"$PROXY_IP"':${INTUTIC_SANDBOX_PROXY_PORT:-4000}/intutic/attest-sandbox" \
|
|
101
|
+
-H "Authorization: Bearer ${INTUTIC_API_KEY}" \
|
|
102
|
+
-H "Content-Type: application/json" \
|
|
103
|
+
-d "{\"sessionId\":\"${INTUTIC_SESSION_ID}\"}" \
|
|
104
|
+
>/dev/null 2>&1 \
|
|
105
|
+
|| echo "intutic-sandbox: attestation call failed (non-fatal, session stays unattested)" >&2
|
|
106
|
+
fi
|
|
107
|
+
exec "$@"
|
|
108
|
+
' intutic-sandbox "$@"
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Firecracker microVM launch (LLD #63 §6, Increment 4).
|
|
3
|
+
#
|
|
4
|
+
# This is the boot sequence validated on a real KVM host (GCE nested-virt,
|
|
5
|
+
# Intel): it sets up the tap link, installs a host-side default-deny egress
|
|
6
|
+
# firewall scoped to the guest so the microVM's only route out is the proxy,
|
|
7
|
+
# boots the microVM via the Firecracker API, runs the agent command inside the
|
|
8
|
+
# guest, and tears everything down.
|
|
9
|
+
#
|
|
10
|
+
# Verification status: PROVEN end-to-end on a GCE nested-virt Intel host — the
|
|
11
|
+
# microVM boots to userspace, an agent runs inside it over ssh, and the
|
|
12
|
+
# host-side firewall below blocks its egress to everything except the proxy
|
|
13
|
+
# (reached the proxy stand-in = 200; external 1.1.1.1 = blocked).
|
|
14
|
+
#
|
|
15
|
+
# The kernel+rootfs are operator-supplied (the rootfs must contain the agent and
|
|
16
|
+
# an sshd), but a matched pair matters: the Firecracker CI `vmlinux-6.1.102`
|
|
17
|
+
# does NOT enumerate the virtio-blk root device under Firecracker (the guest
|
|
18
|
+
# panics "Cannot open root device vda" despite CONFIG_VIRTIO_BLK=y — an
|
|
19
|
+
# ACPI/MMIO discovery quirk), while `vmlinux-5.10.223` + `ubuntu-22.04.ext4`
|
|
20
|
+
# from the same CI bucket boot cleanly. Defaulted below; override with
|
|
21
|
+
# --kernel/--rootfs.
|
|
22
|
+
#
|
|
23
|
+
# kernel: https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/x86_64/vmlinux-5.10.223
|
|
24
|
+
# rootfs: https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/x86_64/ubuntu-22.04.ext4
|
|
25
|
+
#
|
|
26
|
+
# Privileged: tap + nft + firecracker need root.
|
|
27
|
+
set -uo pipefail
|
|
28
|
+
|
|
29
|
+
KERNEL="" ROOTFS="" TAP="tap-intutic" GUEST_IP="172.16.0.2" HOST_IP="172.16.0.1"
|
|
30
|
+
PREFIX="30" VCPUS="1" MEM="512" ALLOW="" GUEST_KEY="${INTUTIC_FC_GUEST_KEY:-}"
|
|
31
|
+
CMD=()
|
|
32
|
+
while [ "$#" -gt 0 ]; do
|
|
33
|
+
case "$1" in
|
|
34
|
+
--kernel) KERNEL="$2"; shift 2;;
|
|
35
|
+
--rootfs) ROOTFS="$2"; shift 2;;
|
|
36
|
+
--tap) TAP="$2"; shift 2;;
|
|
37
|
+
--guest-ip) GUEST_IP="$2"; shift 2;;
|
|
38
|
+
--host-ip) HOST_IP="$2"; shift 2;;
|
|
39
|
+
--prefix) PREFIX="$2"; shift 2;;
|
|
40
|
+
--vcpus) VCPUS="$2"; shift 2;;
|
|
41
|
+
--mem) MEM="$2"; shift 2;;
|
|
42
|
+
--allow) ALLOW="$2"; shift 2;;
|
|
43
|
+
--) shift; CMD=("$@"); break;;
|
|
44
|
+
*) echo "firecracker-launch: unknown arg '$1'" >&2; exit 2;;
|
|
45
|
+
esac
|
|
46
|
+
done
|
|
47
|
+
[ -n "$KERNEL" ] && [ -n "$ROOTFS" ] || { echo "firecracker-launch: --kernel and --rootfs are required" >&2; exit 2; }
|
|
48
|
+
|
|
49
|
+
NFT="$(command -v nft || echo /usr/sbin/nft)"
|
|
50
|
+
SOCK="$(mktemp -u /tmp/intutic-fc-XXXX.sock)"
|
|
51
|
+
CONSOLE="$(mktemp /tmp/intutic-fc-console-XXXX.log)"
|
|
52
|
+
FCPID=""
|
|
53
|
+
|
|
54
|
+
cleanup() {
|
|
55
|
+
[ -n "$FCPID" ] && sudo kill "$FCPID" 2>/dev/null
|
|
56
|
+
sudo ip link del "$TAP" 2>/dev/null || true
|
|
57
|
+
sudo "$NFT" delete table inet intutic_vm_egress 2>/dev/null || true
|
|
58
|
+
rm -f "$SOCK"
|
|
59
|
+
}
|
|
60
|
+
trap cleanup EXIT
|
|
61
|
+
|
|
62
|
+
echo "firecracker-launch: tap $TAP ($HOST_IP/$PREFIX) + host-side default-deny egress for guest $GUEST_IP"
|
|
63
|
+
sudo ip link del "$TAP" 2>/dev/null || true
|
|
64
|
+
sudo ip tuntap add "$TAP" mode tap
|
|
65
|
+
sudo ip addr add "${HOST_IP}/${PREFIX}" dev "$TAP"
|
|
66
|
+
sudo ip link set "$TAP" up
|
|
67
|
+
sudo sysctl -w net.ipv4.ip_forward=1 >/dev/null
|
|
68
|
+
|
|
69
|
+
# Host-side default-deny egress for the guest: allow the proxy (host) + DNS +
|
|
70
|
+
# operator --allow CIDRs and established return traffic; drop the rest. The
|
|
71
|
+
# agent inside the guest cannot alter this — it lives on the host.
|
|
72
|
+
EXTRA=""
|
|
73
|
+
if [ -n "$ALLOW" ]; then
|
|
74
|
+
OLDIFS="$IFS"; IFS=','
|
|
75
|
+
for c in $ALLOW; do [ -n "$c" ] && EXTRA="$EXTRA
|
|
76
|
+
ip saddr ${GUEST_IP} ip daddr ${c} accept"; done
|
|
77
|
+
IFS="$OLDIFS"
|
|
78
|
+
fi
|
|
79
|
+
sudo "$NFT" -f - <<EOF
|
|
80
|
+
table inet intutic_vm_egress {
|
|
81
|
+
chain forward {
|
|
82
|
+
type filter hook forward priority 0; policy accept;
|
|
83
|
+
ip saddr ${GUEST_IP} ct state established,related accept
|
|
84
|
+
ip saddr ${GUEST_IP} ip daddr ${HOST_IP} accept
|
|
85
|
+
ip saddr ${GUEST_IP} udp dport 53 accept
|
|
86
|
+
ip saddr ${GUEST_IP} tcp dport 53 accept$EXTRA
|
|
87
|
+
ip saddr ${GUEST_IP} drop
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
EOF
|
|
91
|
+
|
|
92
|
+
NETMASK="$(python3 -c "import ipaddress;print(ipaddress.IPv4Network('0.0.0.0/${PREFIX}').netmask)" 2>/dev/null || echo 255.255.255.252)"
|
|
93
|
+
BOOT_ARGS="console=ttyS0 reboot=k panic=1 pci=off root=/dev/vda rw ip=${GUEST_IP}::${HOST_IP}:${NETMASK}::eth0:off"
|
|
94
|
+
|
|
95
|
+
echo "firecracker-launch: booting microVM (${VCPUS} vcpu, ${MEM} MiB)"
|
|
96
|
+
sudo firecracker --api-sock "$SOCK" >"$CONSOLE" 2>&1 &
|
|
97
|
+
FCPID=$!
|
|
98
|
+
sleep 1
|
|
99
|
+
api() { sudo curl -s --unix-socket "$SOCK" -X PUT "http://localhost/$1" -H 'Content-Type: application/json' -d "$2" >/dev/null; }
|
|
100
|
+
api "boot-source" "{\"kernel_image_path\":\"${KERNEL}\",\"boot_args\":\"${BOOT_ARGS}\"}"
|
|
101
|
+
api "drives/rootfs" "{\"drive_id\":\"rootfs\",\"path_on_host\":\"${ROOTFS}\",\"is_root_device\":true,\"is_read_only\":false}"
|
|
102
|
+
api "network-interfaces/eth0" "{\"iface_id\":\"eth0\",\"host_dev_name\":\"${TAP}\"}"
|
|
103
|
+
api "machine-config" "{\"vcpu_count\":${VCPUS},\"mem_size_mib\":${MEM}}"
|
|
104
|
+
api "actions" '{"action_type":"InstanceStart"}'
|
|
105
|
+
|
|
106
|
+
# Wait for the guest to reach sshd, then run the agent command inside it. This
|
|
107
|
+
# requires an sshd-enabled rootfs and INTUTIC_FC_GUEST_KEY (the guest ssh key).
|
|
108
|
+
if [ -z "$GUEST_KEY" ]; then
|
|
109
|
+
echo "firecracker-launch: microVM booted. Set INTUTIC_FC_GUEST_KEY to run the agent in-guest over ssh." >&2
|
|
110
|
+
echo " guest console: $CONSOLE" >&2
|
|
111
|
+
sleep 3
|
|
112
|
+
exit 0
|
|
113
|
+
fi
|
|
114
|
+
SSH="ssh -i ${GUEST_KEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=8"
|
|
115
|
+
for _ in $(seq 1 20); do
|
|
116
|
+
if $SSH "root@${GUEST_IP}" true 2>/dev/null; then break; fi
|
|
117
|
+
sleep 1
|
|
118
|
+
done
|
|
119
|
+
$SSH "root@${GUEST_IP}" -- "${CMD[@]}"
|
|
120
|
+
exit $?
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vscodeSettingsWriter.ts — VS Code settings.json proxy injection.
|
|
3
|
-
*
|
|
4
|
-
* Shared by the Cline and Roo Code adapters. Merges Intutic proxy
|
|
5
|
-
* API base URL keys into:
|
|
6
|
-
* - macOS: ~/Library/Application Support/Code/User/settings.json
|
|
7
|
-
* - Linux: ~/.config/Code/User/settings.json
|
|
8
|
-
* - Workspace: <workspaceRoot>/.vscode/settings.json
|
|
9
|
-
*
|
|
10
|
-
* Also writes ~/.intutic/.env.intutic with exported env vars for
|
|
11
|
-
* shells that source it before launching VS Code.
|
|
12
|
-
*
|
|
13
|
-
* LLD #14 — Phase 3 cross-harness defence
|
|
14
|
-
* HLD §3.14 — Three-Tier Defense Cascade
|
|
15
|
-
*
|
|
16
|
-
* @module
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Settings keys injected for each harness.
|
|
20
|
-
* These are checked during drift detection and restored on tamper.
|
|
21
|
-
*/
|
|
22
|
-
export declare const CLINE_PROXY_KEYS: readonly ["cline.apiBase", "cline.openAiBaseUrl"];
|
|
23
|
-
export declare const ROO_CODE_PROXY_KEYS: readonly ["roo-cline.openAiBaseUrl", "roo-cline.apiBase"];
|
|
24
|
-
/**
|
|
25
|
-
* Merge Intutic proxy URL into VS Code user + workspace settings.json
|
|
26
|
-
* for the Cline extension.
|
|
27
|
-
*/
|
|
28
|
-
export declare function injectClineProxySettings(workspaceRoot: string, proxyUrl: string): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Merge Intutic proxy URL into VS Code user + workspace settings.json
|
|
31
|
-
* for the Roo Code extension.
|
|
32
|
-
*/
|
|
33
|
-
export declare function injectRooCodeProxySettings(workspaceRoot: string, proxyUrl: string): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Write (or update) ~/.intutic/.env.intutic with proxy env vars.
|
|
36
|
-
* Users/CI pipelines can `source ~/.intutic/.env.intutic` to get proxy routing
|
|
37
|
-
* for any harness that respects OPENAI_BASE_URL / ANTHROPIC_BASE_URL.
|
|
38
|
-
*/
|
|
39
|
-
export declare function writeEnvSidecar(proxyUrl: string): Promise<void>;
|
|
40
|
-
//# sourceMappingURL=vscodeSettingsWriter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vscodeSettingsWriter.d.ts","sourceRoot":"","sources":["../../src/harness/vscodeSettingsWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsBH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,mDAAoD,CAAA;AACjF,eAAO,MAAM,mBAAmB,2DAA4D,CAAA;AAE5F;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBrE"}
|