@kitman-sh/cli 0.10.70 → 0.10.72
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/{chunk-x7g0rzqj.js → chunk-030xsst1.js} +339 -113
- package/dist/{chunk-pq9bkyj6.js → chunk-290se4bt.js} +3 -3
- package/dist/{chunk-f8qqmcgy.js → chunk-2es1djpn.js} +8 -8
- package/dist/{chunk-dena9bpd.js → chunk-61by5f18.js} +27 -18
- package/dist/{chunk-dk0ftqwg.js → chunk-7672g0fj.js} +28 -177
- package/dist/{chunk-e5dq8dbz.js → chunk-7g4e5fsj.js} +189 -53
- package/dist/{chunk-csbf77zs.js → chunk-7sm45hhc.js} +6 -6
- package/dist/{chunk-1j1jh211.js → chunk-7wenq6ew.js} +7 -5
- package/dist/{chunk-q3c7vmby.js → chunk-b63rssdn.js} +1 -1
- package/dist/{chunk-h0sw8tks.js → chunk-cefprsjj.js} +4 -4
- package/dist/{chunk-fgecj3t0.js → chunk-cj3ef3pv.js} +6 -6
- package/dist/{chunk-8ttdzwa3.js → chunk-d2fxfv0j.js} +9 -9
- package/dist/{chunk-8w7d269h.js → chunk-g8b2z9jn.js} +4 -4
- package/dist/chunk-gngg8j56.js +202 -0
- package/dist/{chunk-2wkdq54x.js → chunk-hxm3bvpn.js} +5 -5
- package/dist/{chunk-v01c0k6j.js → chunk-nhd7dh79.js} +1 -1
- package/dist/{chunk-9hr71e7c.js → chunk-pnsqttt3.js} +7 -7
- package/dist/{chunk-1rry0tsn.js → chunk-pyt2zrwc.js} +2 -2
- package/dist/{chunk-rrnee9mk.js → chunk-se79jbha.js} +1 -1
- package/dist/{chunk-60333x3q.js → chunk-tv94e132.js} +5 -5
- package/dist/{chunk-7jh6atr0.js → chunk-vd8f9brg.js} +17 -17
- package/dist/{chunk-d3ksv8y1.js → chunk-vrt08dk9.js} +60 -60
- package/dist/{chunk-rm83dbpv.js → chunk-w6qjh6q5.js} +2 -2
- package/dist/chunk-wssfts9s.js +16 -0
- package/dist/egress-proxy.ts +51 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-1w81w56v.js +0 -109
- package/dist/chunk-wtpwkjws.js +0 -100
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isObject,
|
|
6
6
|
isJsonObject,
|
|
7
7
|
isString
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-nhd7dh79.js";
|
|
9
9
|
import {
|
|
10
10
|
pipeArguments,
|
|
11
11
|
dual,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
isFailure2,
|
|
43
43
|
hasInterrupts,
|
|
44
44
|
makeUnsafe5,
|
|
45
|
-
|
|
45
|
+
make15,
|
|
46
46
|
_await,
|
|
47
47
|
fail5,
|
|
48
48
|
isDoneUnsafe,
|
|
@@ -156,11 +156,11 @@ import {
|
|
|
156
156
|
encodePrettyJsonString,
|
|
157
157
|
decodeJsonStringSync,
|
|
158
158
|
encodeUnknownJsonStringSync
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-vrt08dk9.js";
|
|
160
160
|
import {
|
|
161
161
|
Id,
|
|
162
162
|
secretReference
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-se79jbha.js";
|
|
164
164
|
import {
|
|
165
165
|
currentTimeMillis,
|
|
166
166
|
SecureRandom,
|
|
@@ -182,6 +182,8 @@ import {
|
|
|
182
182
|
verificationNetworkAllowlist,
|
|
183
183
|
programNetworkHosts,
|
|
184
184
|
canonicalSha256,
|
|
185
|
+
isTestReportName,
|
|
186
|
+
checkTests,
|
|
185
187
|
MeasureSample,
|
|
186
188
|
catchUpPathLimit,
|
|
187
189
|
createId,
|
|
@@ -225,7 +227,7 @@ import {
|
|
|
225
227
|
installCommand,
|
|
226
228
|
checkServicesFile,
|
|
227
229
|
checkServices
|
|
228
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-030xsst1.js";
|
|
229
231
|
import {
|
|
230
232
|
join,
|
|
231
233
|
interrupt,
|
|
@@ -234,7 +236,7 @@ import {
|
|
|
234
236
|
unbounded2,
|
|
235
237
|
offer,
|
|
236
238
|
makeUnsafe3,
|
|
237
|
-
|
|
239
|
+
make10,
|
|
238
240
|
fromQueue,
|
|
239
241
|
fromPubSub,
|
|
240
242
|
map2,
|
|
@@ -265,7 +267,7 @@ import {
|
|
|
265
267
|
writeSrtSettings2,
|
|
266
268
|
srtStepArgv2,
|
|
267
269
|
srtArgv2
|
|
268
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-7672g0fj.js";
|
|
269
271
|
import {
|
|
270
272
|
writeAgentEnvironmentConfigFile2,
|
|
271
273
|
readManifestSkillPaths2,
|
|
@@ -281,8 +283,18 @@ import {
|
|
|
281
283
|
applyAgentEnvironmentMaterialization2,
|
|
282
284
|
isPathWithin2,
|
|
283
285
|
skillIdentity2
|
|
284
|
-
} from "./chunk-
|
|
285
|
-
import"./chunk-
|
|
286
|
+
} from "./chunk-hxm3bvpn.js";
|
|
287
|
+
import"./chunk-290se4bt.js";
|
|
288
|
+
import {
|
|
289
|
+
egressAllowed,
|
|
290
|
+
writeSecretRegistry,
|
|
291
|
+
secretRefusalLog,
|
|
292
|
+
appendSecretRefusals,
|
|
293
|
+
parseSecretRefusals,
|
|
294
|
+
secretFilter2,
|
|
295
|
+
opaqueTunnelRefusal2,
|
|
296
|
+
isOpaqueConnectReason2
|
|
297
|
+
} from "./chunk-gngg8j56.js";
|
|
286
298
|
import {
|
|
287
299
|
sliceBytes2,
|
|
288
300
|
maxLineBytes2,
|
|
@@ -290,28 +302,23 @@ import {
|
|
|
290
302
|
decodedOption2,
|
|
291
303
|
decoded2,
|
|
292
304
|
readOpencode2
|
|
293
|
-
} from "./chunk-
|
|
294
|
-
import {
|
|
295
|
-
writeSecretRegistry,
|
|
296
|
-
secretRefusalLog,
|
|
297
|
-
parseSecretRefusals
|
|
298
|
-
} from "./chunk-1w81w56v.js";
|
|
305
|
+
} from "./chunk-7sm45hhc.js";
|
|
299
306
|
import {
|
|
300
307
|
uploadRunFile,
|
|
301
308
|
programLease,
|
|
302
309
|
rpcRunFiles,
|
|
303
310
|
programHostsEnv,
|
|
304
311
|
undeclaredHostsEnv
|
|
305
|
-
} from "./chunk-
|
|
306
|
-
import"./chunk-
|
|
312
|
+
} from "./chunk-7wenq6ew.js";
|
|
313
|
+
import"./chunk-cefprsjj.js";
|
|
307
314
|
import {
|
|
308
315
|
nextInt
|
|
309
|
-
} from "./chunk-
|
|
316
|
+
} from "./chunk-b63rssdn.js";
|
|
310
317
|
import {
|
|
311
318
|
ChildProcessSpawner,
|
|
312
319
|
make3
|
|
313
|
-
} from "./chunk-
|
|
314
|
-
import"./chunk-
|
|
320
|
+
} from "./chunk-pyt2zrwc.js";
|
|
321
|
+
import"./chunk-cj3ef3pv.js";
|
|
315
322
|
|
|
316
323
|
// packages/core/src/sync-kit.ts
|
|
317
324
|
import { createHash } from "crypto";
|
|
@@ -2592,6 +2599,82 @@ var prepareDockerHome = (input) => gen(function* () {
|
|
|
2592
2599
|
}
|
|
2593
2600
|
});
|
|
2594
2601
|
|
|
2602
|
+
// packages/agent-runtime/src/docker-secret-proxy.ts
|
|
2603
|
+
import { createHttpProxyServer } from "@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js";
|
|
2604
|
+
import { isLoopbackName } from "@anthropic-ai/sandbox-runtime/dist/sandbox/address.js";
|
|
2605
|
+
import { createMitmCA, disposeMitmCA } from "@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js";
|
|
2606
|
+
import { canonicalizeHost } from "@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js";
|
|
2607
|
+
import {
|
|
2608
|
+
createResolvedAddressGuard
|
|
2609
|
+
} from "@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js";
|
|
2610
|
+
import { chmodSync } from "fs";
|
|
2611
|
+
import { isIP } from "net";
|
|
2612
|
+
import { networkInterfaces } from "os";
|
|
2613
|
+
class SecretProxyUnavailable extends TaggedError("SecretProxyUnavailable") {
|
|
2614
|
+
}
|
|
2615
|
+
var dockerSecretProxySocket = (registryDirectory) => `${registryDirectory}/proxy.sock`;
|
|
2616
|
+
var anyName = "kitman-target.invalid";
|
|
2617
|
+
var dockerBridge = (name) => name === "docker0" || name === "docker_gwbridge" || name.startsWith("br-");
|
|
2618
|
+
var dockerNetworkSubnets = (interfaces = networkInterfaces()) => Object.entries(interfaces).flatMap(([name, addresses]) => dockerBridge(name) ? (addresses ?? []).flatMap(({ cidr }) => cidr === null ? [] : [cidr]) : []);
|
|
2619
|
+
var runnerAddresses = (interfaces) => {
|
|
2620
|
+
let current;
|
|
2621
|
+
try {
|
|
2622
|
+
current = interfaces();
|
|
2623
|
+
} catch {
|
|
2624
|
+
return [];
|
|
2625
|
+
}
|
|
2626
|
+
const own = Object.values(current).flatMap((addresses) => (addresses ?? []).map(({ address }) => address));
|
|
2627
|
+
return [...own, ...dockerNetworkSubnets(current)];
|
|
2628
|
+
};
|
|
2629
|
+
var runnerAddressGuard = (options = {}, interfaces = networkInterfaces) => createResolvedAddressGuard({ ...options, localAddresses: () => runnerAddresses(interfaces) });
|
|
2630
|
+
var namesRunner = (guard, host, port) => {
|
|
2631
|
+
const canonical = canonicalizeHost(host) ?? host;
|
|
2632
|
+
if (isLoopbackName(canonical))
|
|
2633
|
+
return !guard.permits(anyName, "127.0.0.1", port);
|
|
2634
|
+
return isIP(canonical) !== 0 && !guard.permits(anyName, canonical, port);
|
|
2635
|
+
};
|
|
2636
|
+
var startDockerSecretProxy = (input) => gen(function* () {
|
|
2637
|
+
const ca = yield* acquireRelease(try_2({ try: () => createMitmCA({}), catch: (cause) => new SecretProxyUnavailable({ cause }) }), (ca) => ignore(tryPromise(() => disposeMitmCA(ca))));
|
|
2638
|
+
const { network, registryFile } = input;
|
|
2639
|
+
const guard = runnerAddressGuard(input.addressGuard);
|
|
2640
|
+
const server = createHttpProxyServer({
|
|
2641
|
+
filter: (port, host, _socket, _command, explain) => {
|
|
2642
|
+
if (namesRunner(guard, host, port)) {
|
|
2643
|
+
explain?.("the Runner's own address or one of its docker networks");
|
|
2644
|
+
return false;
|
|
2645
|
+
}
|
|
2646
|
+
if (network === "open" || egressAllowed(network.hosts, host, port))
|
|
2647
|
+
return true;
|
|
2648
|
+
explain?.("host not allowed");
|
|
2649
|
+
return false;
|
|
2650
|
+
},
|
|
2651
|
+
lookupFor: (port) => guard.lookupFor(port),
|
|
2652
|
+
mitmCA: ca,
|
|
2653
|
+
filterRequest: secretFilter2(registryFile),
|
|
2654
|
+
refuseOpaqueTunnels: true,
|
|
2655
|
+
onFilterRequestDenied: ({ method, url, reason }) => {
|
|
2656
|
+
if (method !== "CONNECT" || !isOpaqueConnectReason2(reason))
|
|
2657
|
+
return;
|
|
2658
|
+
try {
|
|
2659
|
+
appendSecretRefusals(registryFile, [{ host: url, reason: opaqueTunnelRefusal2 }]);
|
|
2660
|
+
} catch {}
|
|
2661
|
+
},
|
|
2662
|
+
...input.upstreamCA === undefined ? undefined : { tlsTerminateUpstreamCA: input.upstreamCA }
|
|
2663
|
+
});
|
|
2664
|
+
yield* acquireRelease(callback3((resume) => {
|
|
2665
|
+
server.once("error", (cause) => resume(fail7(new SecretProxyUnavailable({ cause }))));
|
|
2666
|
+
server.listen(input.socket, () => resume(void_3));
|
|
2667
|
+
}), () => sync2(() => server.close()));
|
|
2668
|
+
yield* try_2({
|
|
2669
|
+
try: () => chmodSync(input.socket, 438),
|
|
2670
|
+
catch: (cause) => new SecretProxyUnavailable({ cause })
|
|
2671
|
+
});
|
|
2672
|
+
return { socket: input.socket, trustBundle: ca.trustBundlePath };
|
|
2673
|
+
});
|
|
2674
|
+
|
|
2675
|
+
// packages/agent-runtime/src/docker-sandbox.ts
|
|
2676
|
+
import { CA_TRUST_VARS } from "@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js";
|
|
2677
|
+
|
|
2595
2678
|
// packages/agent-runtime/src/helper-scripts.ts
|
|
2596
2679
|
import { fileURLToPath } from "url";
|
|
2597
2680
|
var helperScriptPath = (name) => gen(function* () {
|
|
@@ -2609,9 +2692,14 @@ var RunnerLabel = "kitman.runner";
|
|
|
2609
2692
|
var StepAttemptLabel = "kitman.step-attempt";
|
|
2610
2693
|
var EgressProxyImage = "oven/bun@sha256:4cf82f5686b196504fe119db3fcd9185b191f82ece82c40680e597228ec6070a";
|
|
2611
2694
|
var egressProxyAddress = "http://kitman-egress:3128";
|
|
2695
|
+
var relayedSocket = "/kitman/proxy.sock";
|
|
2696
|
+
var trustBundle = "/kitman/trust.pem";
|
|
2612
2697
|
|
|
2613
2698
|
class ContainerError extends TaggedError("ContainerError") {
|
|
2614
2699
|
}
|
|
2700
|
+
|
|
2701
|
+
class SecretProxyUnreachable extends TaggedError("SecretProxyUnreachable") {
|
|
2702
|
+
}
|
|
2615
2703
|
var imagePull = { timeout: "30 minutes" };
|
|
2616
2704
|
var dockerContainerRunner = map8(ChildProcessSpawner, (spawner) => {
|
|
2617
2705
|
const docker = (args, options = {}) => runCommand2("docker", args, options).pipe(mapError2((error) => new ContainerError({ message: error.message })), provideService(ChildProcessSpawner, spawner));
|
|
@@ -2627,6 +2715,7 @@ var dockerContainerRunner = map8(ChildProcessSpawner, (spawner) => {
|
|
|
2627
2715
|
input.name,
|
|
2628
2716
|
...labelArgs(input.labels),
|
|
2629
2717
|
...input.network === undefined ? [] : ["--network", input.network],
|
|
2718
|
+
...input.alias === undefined ? [] : ["--network-alias", input.alias],
|
|
2630
2719
|
...input.user === undefined ? [] : ["--user", input.user],
|
|
2631
2720
|
...input.mounts.flatMap((mount) => [
|
|
2632
2721
|
"--volume",
|
|
@@ -2676,26 +2765,49 @@ var startDockerSandbox = (input) => gen(function* () {
|
|
|
2676
2765
|
[StepAttemptLabel, input.attemptId]
|
|
2677
2766
|
];
|
|
2678
2767
|
const agent = `kitman-agent-${id}`;
|
|
2679
|
-
const
|
|
2768
|
+
const { secretProxy } = input;
|
|
2769
|
+
const network = input.policy.network === "open" && secretProxy === undefined ? undefined : `kitman-agent-net-${id}`;
|
|
2680
2770
|
yield* acquireRelease(void_3, () => containers.removeLabelled([StepAttemptLabel, input.attemptId]));
|
|
2681
|
-
if (
|
|
2771
|
+
if (network !== undefined) {
|
|
2682
2772
|
const proxy = `kitman-egress-${id}`;
|
|
2773
|
+
const script = {
|
|
2774
|
+
source: yield* helperScriptPath("egress-proxy.ts"),
|
|
2775
|
+
target: "/kitman/egress-proxy.ts",
|
|
2776
|
+
readOnly: true
|
|
2777
|
+
};
|
|
2683
2778
|
yield* containers.createInternalNetwork({ name: network, labels });
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2779
|
+
const image = input.docker.proxyImage ?? EgressProxyImage;
|
|
2780
|
+
if (secretProxy === undefined) {
|
|
2781
|
+
yield* containers.run({
|
|
2782
|
+
name: proxy,
|
|
2783
|
+
image,
|
|
2784
|
+
labels,
|
|
2785
|
+
mounts: [script],
|
|
2786
|
+
env: {},
|
|
2787
|
+
command: ["bun", script.target, input.policy.network === "open" ? "" : input.policy.network.hosts.join(",")]
|
|
2788
|
+
});
|
|
2789
|
+
yield* containers.connect({ network, container: proxy, alias: "kitman-egress" });
|
|
2790
|
+
} else {
|
|
2791
|
+
yield* containers.run({
|
|
2792
|
+
name: proxy,
|
|
2793
|
+
image,
|
|
2794
|
+
labels,
|
|
2795
|
+
network,
|
|
2796
|
+
alias: "kitman-egress",
|
|
2797
|
+
mounts: [script, { source: secretProxy.socket, target: relayedSocket }],
|
|
2798
|
+
env: {},
|
|
2799
|
+
command: ["bun", script.target, "--relay", relayedSocket]
|
|
2800
|
+
});
|
|
2801
|
+
const probe = yield* containers.exec({
|
|
2802
|
+
container: proxy,
|
|
2803
|
+
workdir: "/",
|
|
2804
|
+
env: {},
|
|
2805
|
+
command: ["bun", script.target, "--probe", relayedSocket],
|
|
2806
|
+
timeout: "1 minute"
|
|
2807
|
+
});
|
|
2808
|
+
if (probe.exitCode !== 0)
|
|
2809
|
+
return yield* new SecretProxyUnreachable({ output: probe.output });
|
|
2810
|
+
}
|
|
2699
2811
|
for (const service of input.services ?? [])
|
|
2700
2812
|
yield* acquireRelease(containers.connect({ network, ...service }), () => containers.disconnect({ network, container: service.container }));
|
|
2701
2813
|
}
|
|
@@ -2707,7 +2819,8 @@ var startDockerSandbox = (input) => gen(function* () {
|
|
|
2707
2819
|
...input.docker.user === undefined ? undefined : { user: input.docker.user },
|
|
2708
2820
|
mounts: [
|
|
2709
2821
|
...input.policy.writablePaths.map((writable) => ({ source: writable, target: writable })),
|
|
2710
|
-
...(input.readOnlyPaths ?? []).map((readable) => ({ source: readable, target: readable, readOnly: true }))
|
|
2822
|
+
...(input.readOnlyPaths ?? []).map((readable) => ({ source: readable, target: readable, readOnly: true })),
|
|
2823
|
+
...secretProxy === undefined ? [] : [{ source: secretProxy.trustBundle, target: trustBundle, readOnly: true }]
|
|
2711
2824
|
],
|
|
2712
2825
|
workdir: input.workspace,
|
|
2713
2826
|
env: {
|
|
@@ -2720,7 +2833,8 @@ var startDockerSandbox = (input) => gen(function* () {
|
|
|
2720
2833
|
http_proxy: egressProxyAddress,
|
|
2721
2834
|
NO_PROXY: "localhost,127.0.0.1",
|
|
2722
2835
|
no_proxy: "localhost,127.0.0.1"
|
|
2723
|
-
}
|
|
2836
|
+
},
|
|
2837
|
+
...secretProxy === undefined ? undefined : Object.fromEntries(CA_TRUST_VARS.map((name) => [name, trustBundle]))
|
|
2724
2838
|
},
|
|
2725
2839
|
command: ["sleep", "infinity"]
|
|
2726
2840
|
});
|
|
@@ -3177,12 +3291,14 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
3177
3291
|
const { attempt } = request.attempt;
|
|
3178
3292
|
const workspace = request.workspace.path;
|
|
3179
3293
|
const secrets = request.launch.secrets ?? {};
|
|
3180
|
-
if (Object.keys(secrets).length > 0 && request.sandbox.backend === "docker")
|
|
3181
|
-
return failed("secrets_need_srt", "A docker Step cannot take Secrets yet: its egress proxy cannot swap their references for values, and Kitman puts no value in a sandbox. Run this Step in srt.");
|
|
3182
3294
|
const bound = yield* result(requireSecretHosts(request.launch.secrets, request.launch.secretDestinations));
|
|
3183
3295
|
if (isFailure(bound))
|
|
3184
3296
|
return failed(bound.failure.reason, bound.failure.summary);
|
|
3185
|
-
const referenced = request.sandbox.backend === "
|
|
3297
|
+
const referenced = request.sandbox.backend === "host" ? undefined : secretReferences(secrets, request.launch.secretDestinations ?? {});
|
|
3298
|
+
const holdSecrets = (initial) => stepSecretRegistry(stepSecretDirectory(options.home, attempt.id), initial, referenced?.references ?? {}).pipe(mapError2(() => new AgentStepFailure({
|
|
3299
|
+
reason: "secret_registry_unwritable",
|
|
3300
|
+
summary: "The Step's Secret references could not be written."
|
|
3301
|
+
})));
|
|
3186
3302
|
const agent = referenced === undefined || request.launch.secrets === undefined ? request.launch : { ...request.launch, secrets: referenced.references };
|
|
3187
3303
|
const prepared = yield* result(prepareHarness({
|
|
3188
3304
|
attempt: request.attempt,
|
|
@@ -3223,10 +3339,7 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
3223
3339
|
]))
|
|
3224
3340
|
};
|
|
3225
3341
|
const holdsLogin = holdsLoginByReference(launch);
|
|
3226
|
-
const registry = Object.keys(initial).length === 0 && !holdsLogin ? undefined : yield*
|
|
3227
|
-
reason: "secret_registry_unwritable",
|
|
3228
|
-
summary: "The Step's Secret references could not be written."
|
|
3229
|
-
})));
|
|
3342
|
+
const registry = Object.keys(initial).length === 0 && !holdsLogin ? undefined : yield* holdSecrets(initial);
|
|
3230
3343
|
const withSessions = sessions === undefined ? policy : {
|
|
3231
3344
|
...policy,
|
|
3232
3345
|
writablePaths: [...policy.writablePaths, sessions],
|
|
@@ -3252,14 +3365,27 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
3252
3365
|
case "docker": {
|
|
3253
3366
|
if (options.docker === undefined)
|
|
3254
3367
|
return yield* new AgentStepFailure({ reason: "sandbox_unavailable", summary: "`docker` is not available." });
|
|
3368
|
+
const registry = referenced === undefined || Object.keys(referenced.registry).length === 0 ? undefined : yield* holdSecrets(referenced.registry);
|
|
3369
|
+
const secretProxy = registry === undefined ? undefined : yield* startDockerSecretProxy({
|
|
3370
|
+
registryFile: registry.file,
|
|
3371
|
+
socket: dockerSecretProxySocket(registry.directory),
|
|
3372
|
+
network: policy.network
|
|
3373
|
+
}).pipe(tapError2((error) => logWarning("secret_proxy_unavailable", error.cause)), mapError2(() => new AgentStepFailure({
|
|
3374
|
+
reason: "secret_proxy_unavailable",
|
|
3375
|
+
summary: "The proxy that swaps the Step's Secret references could not be started."
|
|
3376
|
+
})));
|
|
3255
3377
|
const { container } = yield* startDockerSandbox({
|
|
3256
3378
|
docker: options.docker,
|
|
3257
3379
|
runnerId: request.runnerId,
|
|
3258
3380
|
attemptId: attempt.id,
|
|
3259
3381
|
policy,
|
|
3260
3382
|
workspace,
|
|
3261
|
-
configDir
|
|
3262
|
-
|
|
3383
|
+
configDir,
|
|
3384
|
+
...secretProxy === undefined ? undefined : { secretProxy }
|
|
3385
|
+
}).pipe(tapError2((error) => isTagged(error, "SecretProxyUnreachable") ? logWarning("secret_proxy_unavailable", error.output) : void_3), mapError2((error) => isTagged(error, "SecretProxyUnreachable") ? new AgentStepFailure({
|
|
3386
|
+
reason: "secret_proxy_unavailable",
|
|
3387
|
+
summary: "The egress container could not reach the proxy that swaps the Step's Secret references."
|
|
3388
|
+
}) : new AgentStepFailure({
|
|
3263
3389
|
reason: "sandbox_container_unavailable",
|
|
3264
3390
|
summary: "The attempt's container could not be started."
|
|
3265
3391
|
})));
|
|
@@ -3283,7 +3409,7 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
3283
3409
|
return {
|
|
3284
3410
|
argv: dockerExecArgv({ container, workspace, env: policy.environment, argv: harnessArgv }),
|
|
3285
3411
|
env: policy.environment,
|
|
3286
|
-
registry
|
|
3412
|
+
registry
|
|
3287
3413
|
};
|
|
3288
3414
|
}
|
|
3289
3415
|
default:
|
|
@@ -5859,7 +5985,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
|
|
|
5859
5985
|
return {
|
|
5860
5986
|
request: (method, params) => gen(function* () {
|
|
5861
5987
|
const id = ++lastId;
|
|
5862
|
-
const deferred = yield*
|
|
5988
|
+
const deferred = yield* make15();
|
|
5863
5989
|
pending.set(id, deferred);
|
|
5864
5990
|
yield* send({ id, method, params });
|
|
5865
5991
|
return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
|
|
@@ -6002,7 +6128,7 @@ var kitmanMcpPreflight = (mcp) => gen(function* () {
|
|
|
6002
6128
|
const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
|
|
6003
6129
|
extendEnv: true,
|
|
6004
6130
|
env: mcp.env,
|
|
6005
|
-
stdin: { stream:
|
|
6131
|
+
stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
|
|
6006
6132
|
stderr: "ignore"
|
|
6007
6133
|
}));
|
|
6008
6134
|
const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
|
|
@@ -6076,7 +6202,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
|
|
|
6076
6202
|
const exitCode = sandbox === undefined ? yield* gen(function* () {
|
|
6077
6203
|
const spawner = yield* ChildProcessSpawner;
|
|
6078
6204
|
const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
|
|
6079
|
-
stdin:
|
|
6205
|
+
stdin: make10(new TextEncoder().encode(stdin)),
|
|
6080
6206
|
stdout: "inherit",
|
|
6081
6207
|
stderr: "inherit",
|
|
6082
6208
|
extendEnv: false,
|
|
@@ -6363,6 +6489,13 @@ var checkFileKeeper = (work, runFiles, storage) => {
|
|
|
6363
6489
|
return kept.flat();
|
|
6364
6490
|
}).pipe(catch_((error) => as(logWarning("check_run_files_not_kept", `${input.check}: ${error.message}`), [])));
|
|
6365
6491
|
};
|
|
6492
|
+
var reportedTests = (filesDir) => gen(function* () {
|
|
6493
|
+
const fs = yield* FileSystem;
|
|
6494
|
+
const path = yield* Path;
|
|
6495
|
+
const names = (yield* regularFiles(filesDir)).filter(isTestReportName);
|
|
6496
|
+
const reports = yield* forEach(names, (name) => fs.readFileString(path.join(filesDir, name)).pipe(map8((text) => [text]), orElseSucceed(() => [])));
|
|
6497
|
+
return checkTests(reports.flat());
|
|
6498
|
+
}).pipe(orElseSucceed(() => checkTests([])));
|
|
6366
6499
|
|
|
6367
6500
|
class ServicesUnavailable extends TaggedError("ServicesUnavailable") {
|
|
6368
6501
|
get message() {
|
|
@@ -6577,6 +6710,7 @@ var runChecks = (worktree, checks, tree, known, run, keeper, services) => gen(fu
|
|
|
6577
6710
|
...sink === undefined ? undefined : { onOutput: (chunk) => sink.writeAll(chunk) }
|
|
6578
6711
|
});
|
|
6579
6712
|
const durationMs = (yield* currentTimeMillis) - startedAt;
|
|
6713
|
+
const tests = yield* reportedTests(filesDir);
|
|
6580
6714
|
const fileIds = keeper === undefined ? undefined : yield* keeper.keep({ check: check.name, prefix: keeper.prefix, output, filesDir });
|
|
6581
6715
|
return {
|
|
6582
6716
|
name: check.name,
|
|
@@ -6585,7 +6719,8 @@ var runChecks = (worktree, checks, tree, known, run, keeper, services) => gen(fu
|
|
|
6585
6719
|
...ran.exitCode === undefined ? undefined : { exitCode: ran.exitCode },
|
|
6586
6720
|
durationMs,
|
|
6587
6721
|
outputTail: redactedOutputTail(ran.output),
|
|
6588
|
-
...fileIds === undefined ? undefined : { fileIds }
|
|
6722
|
+
...fileIds === undefined ? undefined : { fileIds },
|
|
6723
|
+
tests
|
|
6589
6724
|
};
|
|
6590
6725
|
}).pipe(scoped));
|
|
6591
6726
|
});
|
|
@@ -6793,6 +6928,7 @@ export {
|
|
|
6793
6928
|
RepoMaterializationError,
|
|
6794
6929
|
RunnerLabel,
|
|
6795
6930
|
RunnerReplicaCancellation,
|
|
6931
|
+
SecretProxyUnreachable,
|
|
6796
6932
|
SkillMaterializationRefused2 as SkillMaterializationRefused,
|
|
6797
6933
|
StepAttemptLabel,
|
|
6798
6934
|
agentStepExecutionLimit,
|
|
@@ -22,21 +22,21 @@ import {
|
|
|
22
22
|
NullOr,
|
|
23
23
|
Finite,
|
|
24
24
|
encodeUnknownJsonStringSync
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-vrt08dk9.js";
|
|
26
26
|
import {
|
|
27
27
|
isNumber,
|
|
28
28
|
isJsonObject,
|
|
29
29
|
isString
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-nhd7dh79.js";
|
|
31
31
|
import {
|
|
32
|
-
|
|
32
|
+
make10,
|
|
33
33
|
runForEach,
|
|
34
34
|
compiled2
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-7672g0fj.js";
|
|
36
36
|
import {
|
|
37
37
|
ChildProcessSpawner,
|
|
38
38
|
make3
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-pyt2zrwc.js";
|
|
40
40
|
|
|
41
41
|
// packages/agent-runtime/src/opencode-store.ts
|
|
42
42
|
import { lstatSync, readFileSync, realpathSync } from "fs";
|
|
@@ -170,7 +170,7 @@ var isolatedRead = (store, name, input) => gen(function* () {
|
|
|
170
170
|
const spawner = yield* ChildProcessSpawner;
|
|
171
171
|
const [command, ...args] = opencodeReaderCommand();
|
|
172
172
|
const handle = yield* spawner.spawn(make3(command, args, {
|
|
173
|
-
stdin:
|
|
173
|
+
stdin: make10(new TextEncoder().encode(encodeUnknownJsonStringSync({ store, name, input }))),
|
|
174
174
|
stderr: "ignore",
|
|
175
175
|
extendEnv: false,
|
|
176
176
|
env: {},
|
|
@@ -75,10 +75,10 @@ import {
|
|
|
75
75
|
toEquivalence,
|
|
76
76
|
toCodecJson,
|
|
77
77
|
Json
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-vrt08dk9.js";
|
|
79
79
|
import {
|
|
80
80
|
guard
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-se79jbha.js";
|
|
82
82
|
import {
|
|
83
83
|
currentTimeMillis,
|
|
84
84
|
WebCrypto,
|
|
@@ -105,11 +105,11 @@ import {
|
|
|
105
105
|
KitDigest,
|
|
106
106
|
KitSetup,
|
|
107
107
|
RunnerRpcError
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-030xsst1.js";
|
|
109
109
|
import {
|
|
110
110
|
runForEach,
|
|
111
111
|
FileSystem
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-7672g0fj.js";
|
|
113
113
|
|
|
114
114
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/crypto/internal/webCrypto.js
|
|
115
115
|
var subtleUnavailable = () => new Error("crypto.subtle is unavailable; browsers expose it only in secure contexts");
|
|
@@ -493,7 +493,9 @@ var EvidenceCheck = Struct({
|
|
|
493
493
|
durationMs: Finite,
|
|
494
494
|
evidenceId: String4,
|
|
495
495
|
outputTail: optionalKey(String4),
|
|
496
|
-
suggested: optionalKey(Boolean2)
|
|
496
|
+
suggested: optionalKey(Boolean2),
|
|
497
|
+
skippedSinceBaseline: optionalKey(ArraySchema(String4)),
|
|
498
|
+
newNotRun: optionalKey(ArraySchema(String4))
|
|
497
499
|
});
|
|
498
500
|
var VerifyResult = Struct({
|
|
499
501
|
revision: String4,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
gen,
|
|
7
7
|
flatMap3,
|
|
8
8
|
provideContext2
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-vrt08dk9.js";
|
|
10
10
|
import {
|
|
11
11
|
runForEach
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7672g0fj.js";
|
|
13
13
|
import {
|
|
14
14
|
WebSocketConstructor,
|
|
15
15
|
layerWebSocketConstructorGlobal,
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
RunnerReplicaRpcs,
|
|
20
20
|
RunnerRunFileRpcs,
|
|
21
21
|
ProgramRpcs
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-030xsst1.js";
|
|
23
23
|
import {
|
|
24
24
|
layerJson,
|
|
25
25
|
make4,
|
|
26
26
|
withHeaders,
|
|
27
27
|
layerProtocolSocket
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-cj3ef3pv.js";
|
|
29
29
|
|
|
30
30
|
// packages/live/src/rpc/runner-client.ts
|
|
31
31
|
var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
add,
|
|
13
13
|
getOrUndefinedUnsafe,
|
|
14
14
|
getUnsafe,
|
|
15
|
-
|
|
15
|
+
get3,
|
|
16
16
|
Reference,
|
|
17
17
|
toMillis,
|
|
18
18
|
isSuccess,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
Defect,
|
|
97
97
|
Exit,
|
|
98
98
|
toCodecJson
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-vrt08dk9.js";
|
|
100
100
|
import {
|
|
101
101
|
interrupt,
|
|
102
102
|
getCurrent,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
shutdownUnsafe,
|
|
109
109
|
fromQueue,
|
|
110
110
|
unwrap
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-7672g0fj.js";
|
|
112
112
|
import {
|
|
113
113
|
Clock,
|
|
114
114
|
empty,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
ParseOptions,
|
|
124
124
|
RpcClientDefect,
|
|
125
125
|
RpcClientError
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-030xsst1.js";
|
|
127
127
|
|
|
128
128
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
|
|
129
129
|
class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
|
|
@@ -237,7 +237,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
|
|
|
237
237
|
const disableTracing = options?.disableTracing ?? false;
|
|
238
238
|
const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
|
|
239
239
|
const services = yield* context();
|
|
240
|
-
const scope =
|
|
240
|
+
const scope = get3(services, Scope);
|
|
241
241
|
const entries = new Map;
|
|
242
242
|
let isShutdown = false;
|
|
243
243
|
yield* addFinalizer(scope, withFiber2((parent) => {
|
|
@@ -643,7 +643,7 @@ var makeRpcSchemas = (codecFor) => {
|
|
|
643
643
|
return entry;
|
|
644
644
|
}
|
|
645
645
|
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
646
|
-
const parseOptions =
|
|
646
|
+
const parseOptions = get3(rpc.annotations, ParseOptions);
|
|
647
647
|
const exitSchema2 = exitSchema(rpc);
|
|
648
648
|
let decodeDiscardExit;
|
|
649
649
|
entry = {
|