@kitman-sh/cli 0.13.11 → 0.13.13
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-mx3zt8v8.js → chunk-3z0wep73.js} +25 -16
- package/dist/{chunk-xzfj61cp.js → chunk-4yzdyte6.js} +3 -2
- package/dist/{chunk-5zhh41gb.js → chunk-6kz6qa2h.js} +3 -3
- package/dist/{chunk-jyq4790r.js → chunk-7hf2d50x.js} +7 -7
- package/dist/{chunk-5an78wy8.js → chunk-7jege23c.js} +2 -2
- package/dist/{chunk-mtkstrh3.js → chunk-82w8rmkc.js} +1 -1
- package/dist/{chunk-7rpd6a98.js → chunk-9rez0yze.js} +1 -1
- package/dist/{chunk-acneym1p.js → chunk-b5abe9c7.js} +140 -50
- package/dist/{chunk-3rkhx6gq.js → chunk-cxc8d0r3.js} +4 -4
- package/dist/{chunk-5zth85pj.js → chunk-fc2bhh5v.js} +1 -1
- package/dist/{chunk-cbpb2rww.js → chunk-ga76znz9.js} +2 -2
- package/dist/{chunk-j48k8j8y.js → chunk-j2aw5bss.js} +3 -3
- package/dist/{chunk-p0vqjc0n.js → chunk-jwr0rr2p.js} +2 -2
- package/dist/{chunk-0h49y8gf.js → chunk-nf9gdnsf.js} +23 -5
- package/dist/{chunk-p8fhxfa0.js → chunk-nve4pjqm.js} +2 -2
- package/dist/{chunk-rh9g6sef.js → chunk-ptn9g4wd.js} +48 -15
- package/dist/{chunk-dtkejy3r.js → chunk-pvza175a.js} +129 -12
- package/dist/{chunk-h7mnz0w3.js → chunk-s364dren.js} +3 -3
- package/dist/{chunk-fcb6skhx.js → chunk-vbygjtdw.js} +5 -5
- package/dist/{chunk-krqb80g6.js → chunk-wh6eeetn.js} +4 -4
- package/dist/index.js +3 -3
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
runnerRpcUrl2,
|
|
5
5
|
makeRunnerRpcClient2,
|
|
6
6
|
makeProgramRpcClient2
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import"./chunk-
|
|
9
|
-
import"./chunk-
|
|
7
|
+
} from "./chunk-s364dren.js";
|
|
8
|
+
import"./chunk-7jege23c.js";
|
|
9
|
+
import"./chunk-pvza175a.js";
|
|
10
10
|
import"./chunk-q5w3v4k1.js";
|
|
11
|
-
import"./chunk-
|
|
11
|
+
import"./chunk-nf9gdnsf.js";
|
|
12
12
|
import"./chunk-zw3gf6r5.js";
|
|
13
13
|
export {
|
|
14
14
|
makeProgramRpcClient2 as makeProgramRpcClient,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
make11,
|
|
31
31
|
runForEach,
|
|
32
32
|
compiled2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-nf9gdnsf.js";
|
|
34
34
|
import {
|
|
35
35
|
ChildProcessSpawner,
|
|
36
36
|
make3
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-82w8rmkc.js";
|
|
38
38
|
|
|
39
39
|
// packages/agent-runtime/src/opencode-store.ts
|
|
40
40
|
import { lstatSync, readFileSync, realpathSync } from "fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-82w8rmkc.js";
|
|
3
3
|
import {
|
|
4
4
|
HERDR_CORE_GENERATION2,
|
|
5
5
|
HERDR_CORE_INSTALL_COMMAND2,
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
herdrCoreLayer2,
|
|
13
13
|
herdrCoreTransportLayer2,
|
|
14
14
|
updateHerdrCore2
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import"./chunk-
|
|
15
|
+
} from "./chunk-pvza175a.js";
|
|
16
|
+
import"./chunk-nf9gdnsf.js";
|
|
17
17
|
import"./chunk-zw3gf6r5.js";
|
|
18
18
|
export {
|
|
19
19
|
HERDR_CORE_GENERATION2 as HERDR_CORE_GENERATION,
|
|
@@ -709,7 +709,7 @@ Runners execute StepAttempts in user-controlled environments. A runner advertise
|
|
|
709
709
|
path: "runner-operations#runner-settings",
|
|
710
710
|
level: 3,
|
|
711
711
|
link: "https://kitman.sh/knowledge/docs/runner-operations#runner-settings",
|
|
712
|
-
text: "### Runner settings\n\nKitman keeps how your Runner behaves, so you change it on the Runner's page in the **Runners** tab, or with `kitman runner settings <runner>`, without touching its service. Its owner, or a Workspace admin, may change it; each change is in its History with who made it, when, and the old and new value (`kitman runner settings history <runner>`).\n\n- **Concurrency**: how many Work Units it runs at once, 1 to 4. It applies a change within about 10 seconds, and work in flight finishes first.\n- **Sandbox**: `srt` (the default), `docker` or `host`. New Steps and checks use a change; a running Step keeps its own.\n- **Docker image**: the image `docker` runs agents in, pinned by digest. It applies when the Runner restarts.\n- **Check hosts**: hosts every check this Runner runs, for any Team, may also reach.\n- **Checks' Docker image** and **checks' registry image**: for a pipeline check's own Docker daemon (below), each pinned by digest. They apply when the Runner restarts.\n\n```sh\nkitman runner settings <runner> --concurrency 2 --check-hosts github.com\n```\n\nThe Runner's page shows where what the Runner applies differs from its settings, and why.\n\nA few things stay on your machine, because they start the Runner or protect it: the Runner's id, the API URL and its credential, `KITMAN_RUNNER_FULL_ACCESS`, and your consent to run agents with no sandbox, `KITMAN_RUNNER_ALLOW_FULL_ACCESS=1`. Kitman cannot give that consent, so nobody who can change the Runner's settings, nor a compromised control plane, can turn off your machine's sandbox: a Runner set to `host` on a machine without it runs its agents in `srt` and shows the `full_access_refused` Runner Problem.\n\nBefore Kitman kept these, they were the environment variables `KITMAN_RUNNER_CONCURRENCY`, `KITMAN_RUNNER_SANDBOX`, `KITMAN_RUNNER_DOCKER_IMAGE`, `KITMAN_RUNNER_CHECK_HOSTS`, `KITMAN_RUNNER_CHECK_DOCKER_IMAGE` and `KITMAN_RUNNER_CHECK_REGISTRY_IMAGE`. The first time a Runner starts on a version with settings, Kitman adopts the values they give, once, for each setting nobody has set yet (a shared Runner's sandbox excepted); after that the Runner ignores them and warns at each start that each one still set is deprecated. Remove them from its service when its settings look right. While `KITMAN_RUNNER_SANDBOX=host` stays set, it counts as your consent to run agents on the host."
|
|
712
|
+
text: "### Runner settings\n\nKitman keeps how your Runner behaves, so you change it on the Runner's page in the **Runners** tab, or with `kitman runner settings <runner>`, without touching its service. Its owner, or a Workspace admin, may change it; each change is in its History with who made it, when, and the old and new value (`kitman runner settings history <runner>`).\n\n- **Concurrency**: how many Work Units it runs at once, 1 to 4. It applies a change within about 10 seconds, and work in flight finishes first.\n- **Sandbox**: `srt` (the default), `docker` or `host`. New Steps and checks use a change; a running Step keeps its own.\n- **Docker image**: the image `docker` runs agents in, pinned by digest. It applies when the Runner restarts.\n- **Check hosts**: hosts every check this Runner runs, for any Team, may also reach.\n- **Checks' Docker image** and **checks' registry image**: for a pipeline check's own Docker daemon (below), each pinned by digest. They apply when the Runner restarts.\n\n```sh\nkitman runner settings <runner> --concurrency 2 --check-hosts github.com\n```\n\nThe Runner's page shows where what the Runner applies differs from its settings, and why.\n\nA few things stay on your machine, because they start the Runner or protect it: the Runner's id, the API URL and its credential, `KITMAN_RUNNER_FULL_ACCESS`, and your consent to run agents with no sandbox, `KITMAN_RUNNER_ALLOW_FULL_ACCESS=1`. Kitman cannot give that consent, so nobody who can change the Runner's settings, nor a compromised control plane, can turn off your machine's sandbox: a Runner set to `host` on a machine without it runs its agents in `srt` and shows the `full_access_refused` Runner Problem. A Runner set to `host` on a machine with it runs agents that use your own `kitman` login. When Kitman refuses that login, the Runner shows the `cli_session_expired` Runner Problem: run `kitman login` on the machine.\n\nBefore Kitman kept these, they were the environment variables `KITMAN_RUNNER_CONCURRENCY`, `KITMAN_RUNNER_SANDBOX`, `KITMAN_RUNNER_DOCKER_IMAGE`, `KITMAN_RUNNER_CHECK_HOSTS`, `KITMAN_RUNNER_CHECK_DOCKER_IMAGE` and `KITMAN_RUNNER_CHECK_REGISTRY_IMAGE`. The first time a Runner starts on a version with settings, Kitman adopts the values they give, once, for each setting nobody has set yet (a shared Runner's sandbox excepted); after that the Runner ignores them and warns at each start that each one still set is deprecated. Remove them from its service when its settings look right. While `KITMAN_RUNNER_SANDBOX=host` stays set, it counts as your consent to run agents on the host."
|
|
713
713
|
},
|
|
714
714
|
{
|
|
715
715
|
title: "Runner Operations Guide \u203A The sandbox",
|
|
@@ -1555,7 +1555,7 @@ var pathOfLink = (link) => {
|
|
|
1555
1555
|
return page === null ? link : page[1] || "index";
|
|
1556
1556
|
};
|
|
1557
1557
|
var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
|
|
1558
|
-
var pinnedLink2 = (link, version = "0.13.
|
|
1558
|
+
var pinnedLink2 = (link, version = "0.13.13") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
|
|
1559
1559
|
var pageOf = (path) => path.split("#")[0];
|
|
1560
1560
|
var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
|
|
1561
1561
|
function excerpt(text, queryTerms) {
|
|
@@ -1242,7 +1242,7 @@ var takeN = (self, n) => {
|
|
|
1242
1242
|
return array;
|
|
1243
1243
|
};
|
|
1244
1244
|
var takeAll = (self) => takeN(self, self.length);
|
|
1245
|
-
var
|
|
1245
|
+
var take3 = (self) => {
|
|
1246
1246
|
if (!self.head)
|
|
1247
1247
|
return Empty;
|
|
1248
1248
|
const message = self.head.array[self.head.offset];
|
|
@@ -1626,7 +1626,7 @@ class DroppingStrategy {
|
|
|
1626
1626
|
var strategyCompletePollersUnsafe = (strategy, pubsub, subscribers, subscription, pollers) => {
|
|
1627
1627
|
let keepPolling = true;
|
|
1628
1628
|
while (keepPolling && !subscription.isEmpty()) {
|
|
1629
|
-
const poller =
|
|
1629
|
+
const poller = take3(pollers);
|
|
1630
1630
|
if (poller === Empty) {
|
|
1631
1631
|
removeSubscribers(subscribers, subscription, pollers);
|
|
1632
1632
|
if (pollers.length === 0) {
|
|
@@ -1831,7 +1831,7 @@ var offerUnsafe = (self, message) => {
|
|
|
1831
1831
|
return false;
|
|
1832
1832
|
} else if (self.messages.length >= self.capacity) {
|
|
1833
1833
|
if (self.strategy === "sliding") {
|
|
1834
|
-
|
|
1834
|
+
take3(self.messages);
|
|
1835
1835
|
append(self.messages, message);
|
|
1836
1836
|
return true;
|
|
1837
1837
|
} else if (self.capacity <= 0 && self.state.takers.size > 0) {
|
|
@@ -1942,7 +1942,7 @@ var takeUnsafe = (self) => {
|
|
|
1942
1942
|
return self.state.exit;
|
|
1943
1943
|
}
|
|
1944
1944
|
if (self.messages.length > 0) {
|
|
1945
|
-
const message =
|
|
1945
|
+
const message = take3(self.messages);
|
|
1946
1946
|
releaseCapacity(self);
|
|
1947
1947
|
return exitSucceed(message);
|
|
1948
1948
|
} else if (self.capacity <= 0 && self.state.offers.size > 0) {
|
|
@@ -2972,6 +2972,24 @@ var filter = /* @__PURE__ */ dual(2, (self, predicate) => fromChannel2(filterArr
|
|
|
2972
2972
|
var catchCause = /* @__PURE__ */ dual(2, (self, f) => self.channel.pipe(catchCause3((cause) => f(cause).channel), fromChannel2));
|
|
2973
2973
|
var tapError = /* @__PURE__ */ dual(2, (self, f) => self.channel.pipe(tapError3(f), fromChannel2));
|
|
2974
2974
|
var mapError = /* @__PURE__ */ dual(2, (self, f) => fromChannel2(mapError3(self.channel, f)));
|
|
2975
|
+
var take2 = /* @__PURE__ */ dual(2, (self, n) => {
|
|
2976
|
+
const count = normalize(n);
|
|
2977
|
+
return count === 0 ? empty2 : takeUntil(self, (_, i) => i === count - 1);
|
|
2978
|
+
});
|
|
2979
|
+
var takeUntil = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, predicate, options) => transformPull2(self, (pull, _scope) => sync2(() => {
|
|
2980
|
+
let i = 0;
|
|
2981
|
+
let done2 = false;
|
|
2982
|
+
const pump = flatMap3(suspend3(() => done2 ? done() : pull), (chunk) => {
|
|
2983
|
+
const index = chunk.findIndex((a) => predicate(a, i++));
|
|
2984
|
+
if (index >= 0) {
|
|
2985
|
+
done2 = true;
|
|
2986
|
+
const arr = chunk.slice(0, options?.excludeLast ? index : index + 1);
|
|
2987
|
+
return isReadonlyArrayNonEmpty(arr) ? succeed6(arr) : done();
|
|
2988
|
+
}
|
|
2989
|
+
return succeed6(chunk);
|
|
2990
|
+
});
|
|
2991
|
+
return pump;
|
|
2992
|
+
})));
|
|
2975
2993
|
var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (upstream, scope) => sync2(() => {
|
|
2976
2994
|
let done2;
|
|
2977
2995
|
let leftover;
|
|
@@ -3557,4 +3575,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
|
|
|
3557
3575
|
...argv
|
|
3558
3576
|
];
|
|
3559
3577
|
|
|
3560
|
-
export { map, makeEquivalence, bytes, join, interrupt, getCurrent, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, make10, get3, isStream, fromChannel2, callback, empty2, make11, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make12, FileTypeId, WatchBackend, Path, make13, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, tempDirectoryScoped, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
|
|
3578
|
+
export { map, makeEquivalence, bytes, join, interrupt, getCurrent, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, make10, get3, isStream, fromChannel2, callback, empty2, make11, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, take2, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make12, FileTypeId, WatchBackend, Path, make13, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, tempDirectoryScoped, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
withDefault,
|
|
30
30
|
String2
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-nf9gdnsf.js";
|
|
32
32
|
import {
|
|
33
33
|
newerKitmanVersion,
|
|
34
34
|
digestSha256,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
get2,
|
|
40
40
|
layer4,
|
|
41
41
|
KitDigest
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-pvza175a.js";
|
|
43
43
|
|
|
44
44
|
// packages/core/src/npm-registry.ts
|
|
45
45
|
var KitManifest = Struct({
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
withDefault,
|
|
117
117
|
option,
|
|
118
118
|
String2
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-nf9gdnsf.js";
|
|
120
120
|
import {
|
|
121
121
|
currentTimeMillis,
|
|
122
122
|
SecureRandom,
|
|
@@ -230,14 +230,14 @@ import {
|
|
|
230
230
|
harnessNames,
|
|
231
231
|
herdrRunnerCapabilities2,
|
|
232
232
|
declaredChecks
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-pvza175a.js";
|
|
234
234
|
import {
|
|
235
235
|
Id
|
|
236
236
|
} from "./chunk-q5w3v4k1.js";
|
|
237
237
|
import {
|
|
238
238
|
ChildProcessSpawner,
|
|
239
239
|
make3
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-82w8rmkc.js";
|
|
241
241
|
|
|
242
242
|
// apps/cli/src/cli-error.ts
|
|
243
243
|
function cliErrorCode(error, status) {
|
|
@@ -403,6 +403,31 @@ var notListTypes = new Set([
|
|
|
403
403
|
]);
|
|
404
404
|
var unbindable = new Set("arguments await break case catch class config const continue debugger default defineKit delete do else enum eval export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof undefined var void while with yield".split(" "));
|
|
405
405
|
|
|
406
|
+
// apps/cli/src/cli-session.ts
|
|
407
|
+
var cliSessionExpired = {
|
|
408
|
+
code: "cli_session_expired",
|
|
409
|
+
message: "The kitman login on this machine has expired. This Runner runs agents on the host, where the kitman commands they run now get 401.",
|
|
410
|
+
fix: "Run `kitman login` on this machine."
|
|
411
|
+
};
|
|
412
|
+
var checkTimeout = "10 seconds";
|
|
413
|
+
var cliSessionChecker = (apiUrl) => {
|
|
414
|
+
let refused;
|
|
415
|
+
const check = gen(function* () {
|
|
416
|
+
const session = sessionForApi(yield* readAuthStore(), apiUrl);
|
|
417
|
+
if (session === undefined || session.accessToken !== refused) {
|
|
418
|
+
refused = undefined;
|
|
419
|
+
if (session === undefined)
|
|
420
|
+
return;
|
|
421
|
+
const client = yield* createSdkClient({ apiUrl, session });
|
|
422
|
+
yield* client.whoami().pipe(catchIf((error) => error.status === 401, () => sync2(() => refused = session.accessToken)));
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
return {
|
|
426
|
+
check: check.pipe(timeout(checkTimeout), catch_((error) => logWarning("runner_cli_session_unchecked", error.message))),
|
|
427
|
+
expired: () => refused !== undefined
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
|
|
406
431
|
// apps/cli/src/command-help.ts
|
|
407
432
|
var Usage = [
|
|
408
433
|
"Usage: kitman <init|pair|docs|run|inbox|loop|agent|deploy|verify|secret|claim|team|repo|constraint|mcp|sync|whoami|config|kit|task|memory|proposal|decision|context|schedule|delivery|reconcile|lifecycle|logout> [options]",
|
|
@@ -993,10 +1018,10 @@ var sandboxMissing = (sandbox, missing) => ({
|
|
|
993
1018
|
var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
|
|
994
1019
|
var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
|
|
995
1020
|
var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
|
|
996
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
1021
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-j2aw5bss.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
|
|
997
1022
|
});
|
|
998
1023
|
var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
|
|
999
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
1024
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-j2aw5bss.js")), (module) => module.updateHerdrCore(options))
|
|
1000
1025
|
});
|
|
1001
1026
|
var herdrCoreMissing = (error) => {
|
|
1002
1027
|
if (isTagged(error, "HerdrCoreMissing"))
|
|
@@ -1422,7 +1447,7 @@ var syncTargets = (harness) => gen(function* () {
|
|
|
1422
1447
|
});
|
|
1423
1448
|
var syncKits = (input) => gen(function* () {
|
|
1424
1449
|
const fs = yield* FileSystem;
|
|
1425
|
-
const { syncKitSetup } = yield* promise(() => import("./chunk-
|
|
1450
|
+
const { syncKitSetup } = yield* promise(() => import("./chunk-vbygjtdw.js"));
|
|
1426
1451
|
const harnesses = yield* syncTargets(input.harness);
|
|
1427
1452
|
const chain = yield* input.client.getKitChain(input.workspaceId);
|
|
1428
1453
|
for (const { name, problem } of chain.skipped)
|
|
@@ -2341,7 +2366,7 @@ var package_default = {
|
|
|
2341
2366
|
};
|
|
2342
2367
|
|
|
2343
2368
|
// apps/cli/src/scaffold.ts
|
|
2344
|
-
var cliVersion = "0.13.
|
|
2369
|
+
var cliVersion = "0.13.13";
|
|
2345
2370
|
var packageJson = (name, scaffold) => `${JSON.stringify({
|
|
2346
2371
|
name,
|
|
2347
2372
|
private: true,
|
|
@@ -2493,7 +2518,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
|
|
|
2493
2518
|
|
|
2494
2519
|
// apps/cli/src/commands.ts
|
|
2495
2520
|
var ClientId = "kitman-cli";
|
|
2496
|
-
var agentRuntime = promise(() => import("./chunk-
|
|
2521
|
+
var agentRuntime = promise(() => import("./chunk-3z0wep73.js"));
|
|
2497
2522
|
var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
|
|
2498
2523
|
defaultValue: () => gen(function* () {
|
|
2499
2524
|
const tui = yield* tryPromise({
|
|
@@ -3529,7 +3554,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
|
|
|
3529
3554
|
});
|
|
3530
3555
|
var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
|
|
3531
3556
|
defaultValue: () => (options) => gen(function* () {
|
|
3532
|
-
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-
|
|
3557
|
+
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-cxc8d0r3.js"));
|
|
3533
3558
|
return yield* makeRunnerRpcClient({
|
|
3534
3559
|
runnerId: options.runnerId,
|
|
3535
3560
|
bearer: options.bearer,
|
|
@@ -3736,6 +3761,8 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3736
3761
|
let reached = [];
|
|
3737
3762
|
const repositoryProbeInterval = "5 minutes";
|
|
3738
3763
|
const repositoryRetryInterval = "30 seconds";
|
|
3764
|
+
const ownerLoginInterval = "5 minutes";
|
|
3765
|
+
const ownerLoginRetryInterval = "30 seconds";
|
|
3739
3766
|
const capabilitiesNow = () => {
|
|
3740
3767
|
const harnesses = live.sandbox === "srt" && live.inSrt !== undefined ? live.inSrt.detection : detected;
|
|
3741
3768
|
const profile = {
|
|
@@ -3752,12 +3779,16 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3752
3779
|
resourceLimits: { ...advertised.resourceLimits, maxConcurrentRuns: live.settings.concurrency }
|
|
3753
3780
|
};
|
|
3754
3781
|
};
|
|
3782
|
+
const ownerLogin = cliSessionChecker(input.apiUrl);
|
|
3783
|
+
const checkOwnerLogin = suspend3(() => input.credential === undefined && live.sandbox === "host" ? ownerLogin.check : void_3);
|
|
3784
|
+
yield* checkOwnerLogin;
|
|
3755
3785
|
const problemsNow = () => {
|
|
3756
3786
|
const uncontained = stepProcessesUncontained({ sandbox: live.sandbox, scoped: stepProcesses.scoped });
|
|
3757
3787
|
return [
|
|
3758
3788
|
...coreProblems,
|
|
3759
3789
|
...uncontained === undefined ? [] : [uncontained],
|
|
3760
|
-
...live.sandboxProblem === undefined ? [] : [live.sandboxProblem]
|
|
3790
|
+
...live.sandboxProblem === undefined ? [] : [live.sandboxProblem],
|
|
3791
|
+
...live.sandbox === "host" && ownerLogin.expired() ? [cliSessionExpired] : []
|
|
3761
3792
|
];
|
|
3762
3793
|
};
|
|
3763
3794
|
assertHerdrRunnerCapability(capabilitiesNow());
|
|
@@ -3833,6 +3864,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3833
3864
|
});
|
|
3834
3865
|
const checkouts = runCheckouts(path.join(runnerRootDir, ".kitman"), rpc.gitCredential);
|
|
3835
3866
|
yield* controlPlane.client.listRepoBindings(runner.workspaceId).pipe(flatMap3(({ items }) => forEach(items.filter((binding) => binding.status === "active" && (teamId === undefined || binding.teamId === teamId)), (repoBinding) => map8(checkouts.reaches(repoBinding), (reachable) => ({ repoBinding, reachable })), { concurrency: 4 })), tap2((probed) => sync2(() => reached = probed)), catch_((error) => logWarning("runner_repository_probe_failed", error.message)), flatMap3(() => sleep(reached.some((probe) => !probe.reachable) ? repositoryRetryInterval : repositoryProbeInterval)), forever, forkScoped);
|
|
3867
|
+
yield* suspend3(() => sleep(ownerLogin.expired() ? ownerLoginRetryInterval : ownerLoginInterval)).pipe(andThen2(checkOwnerLogin), forever, forkScoped);
|
|
3836
3868
|
const platform = yield* context();
|
|
3837
3869
|
const updated = yield* make16();
|
|
3838
3870
|
const scope = yield* scope2;
|
|
@@ -4086,7 +4118,7 @@ function mcpCommand(args) {
|
|
|
4086
4118
|
if (command.action === "run") {
|
|
4087
4119
|
if (command.args.length > 0)
|
|
4088
4120
|
return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
|
|
4089
|
-
const { runMcpServerCommand } = yield* promise(() => import("./chunk-
|
|
4121
|
+
const { runMcpServerCommand } = yield* promise(() => import("./chunk-b5abe9c7.js"));
|
|
4090
4122
|
return yield* runMcpServerCommand({ flags: command.flags });
|
|
4091
4123
|
}
|
|
4092
4124
|
if (command.action !== "setup")
|
|
@@ -4574,7 +4606,7 @@ function programLoopCommand(command) {
|
|
|
4574
4606
|
return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
|
|
4575
4607
|
});
|
|
4576
4608
|
}
|
|
4577
|
-
var docsModule = promise(() => import("./chunk-
|
|
4609
|
+
var docsModule = promise(() => import("./chunk-9rez0yze.js"));
|
|
4578
4610
|
function docsCommand(args) {
|
|
4579
4611
|
return gen(function* () {
|
|
4580
4612
|
const command = parseCommand(args);
|
|
@@ -4743,6 +4775,7 @@ var evidenceLines = (evidence) => evidence.flatMap((entry) => {
|
|
|
4743
4775
|
];
|
|
4744
4776
|
return [
|
|
4745
4777
|
`Evidence ${entry.step} ${entry.name}: ${entry.status}${entry.preExisting ? " (pre-existing)" : ""}${neverRan.length === 0 ? "" : `, ${neverRan.length} test${neverRan.length === 1 ? "" : "s"} never ran`} at tree ${entry.tree} (${entry.revision}, ${entry.durationMs}ms)`,
|
|
4778
|
+
...(entry.failedTests ?? []).map((test) => ` Failed: ${test}`),
|
|
4746
4779
|
...neverRan
|
|
4747
4780
|
];
|
|
4748
4781
|
});
|
|
@@ -4836,7 +4869,7 @@ var runShowLines = (shown) => [
|
|
|
4836
4869
|
...questionLines2(shown.questions.filter((question) => question.status === "open")),
|
|
4837
4870
|
...shown.artifacts.flatMap((artifact) => [`Artifact ${artifact.kind}: ${artifact.title}`, artifact.text]),
|
|
4838
4871
|
...shown.children.map((child) => `Child ${child.name}: ${child.runId} ${child.status}`),
|
|
4839
|
-
...shown.waiting.map((waiting) => waiting.kind === "queue" ? `${waiting.unrunnable === undefined ? "Waiting for a Runner slot for" : "Waiting for a Runner that can run"} ${waiting.name}: ${queueWords(waiting)}` : `Waiting on ${waiting.kind} ${waiting.name}`)
|
|
4872
|
+
...shown.waiting.map((waiting) => waiting.kind === "queue" ? waiting.quotaUntil !== undefined ? `${waiting.name}: ${queueWords(waiting)}` : `${waiting.unrunnable === undefined ? "Waiting for a Runner slot for" : "Waiting for a Runner that can run"} ${waiting.name}: ${queueWords(waiting)}` : `Waiting on ${waiting.kind} ${waiting.name}`)
|
|
4840
4873
|
];
|
|
4841
4874
|
var myTeamsSections = [
|
|
4842
4875
|
["needsYou", "Needs you"],
|
|
@@ -5408,9 +5441,9 @@ function changeRequestCommand(args) {
|
|
|
5408
5441
|
yield* log(command.action === "approve" ? `Approved ${short} of ${changeRequest.title}. A Run waiting on approval of ${short} resumes; one waiting on another head does not.` : `Requested changes to ${short} of ${changeRequest.title}`);
|
|
5409
5442
|
});
|
|
5410
5443
|
}
|
|
5411
|
-
var KitWriter = map8(promise(() => import("./chunk-
|
|
5444
|
+
var KitWriter = map8(promise(() => import("./chunk-7hf2d50x.js")), (build) => build.writeKit);
|
|
5412
5445
|
var KitBuilder = Reference("kitman/cli/KitBuilder", {
|
|
5413
|
-
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-
|
|
5446
|
+
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-7hf2d50x.js")), (build) => build.buildKit(directory))
|
|
5414
5447
|
});
|
|
5415
5448
|
var uploadKit = (client, workspaceId, built) => gen(function* () {
|
|
5416
5449
|
yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
|
|
@@ -328,7 +328,7 @@ import {
|
|
|
328
328
|
String2,
|
|
329
329
|
optionalEnv,
|
|
330
330
|
harnessesUnsupportedInSrt2
|
|
331
|
-
} from "./chunk-
|
|
331
|
+
} from "./chunk-nf9gdnsf.js";
|
|
332
332
|
import {
|
|
333
333
|
isDateTime,
|
|
334
334
|
Numeric,
|
|
@@ -355,7 +355,7 @@ import {
|
|
|
355
355
|
make3,
|
|
356
356
|
parseFdName,
|
|
357
357
|
fdName
|
|
358
|
-
} from "./chunk-
|
|
358
|
+
} from "./chunk-82w8rmkc.js";
|
|
359
359
|
|
|
360
360
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Tuple.js
|
|
361
361
|
var makeEquivalence3 = Tuple;
|
|
@@ -3212,7 +3212,17 @@ var waitingOnWords = ({ keys, hidden }) => {
|
|
|
3212
3212
|
|
|
3213
3213
|
// packages/core/src/run-queue.ts
|
|
3214
3214
|
var ClaimRanks = ["in_progress", "finishing", "new"];
|
|
3215
|
-
var
|
|
3215
|
+
var utcTime = (timestamp) => {
|
|
3216
|
+
const iso = toIso(Math.ceil(toDate(timestamp).getTime() / 1000) * 1000);
|
|
3217
|
+
return `${iso.slice(0, iso.endsWith(":00.000Z") ? 16 : 19).replace("T", " ")} UTC`;
|
|
3218
|
+
};
|
|
3219
|
+
var queueWords = (place) => {
|
|
3220
|
+
const held = [
|
|
3221
|
+
...place.quotaUntil === undefined ? [] : [`waiting on quota until ${utcTime(place.quotaUntil)}`],
|
|
3222
|
+
...place.unrunnable === undefined ? [] : [`no online Runner can run it: ${place.unrunnable}`]
|
|
3223
|
+
];
|
|
3224
|
+
return held.length === 0 ? `#${place.position} in the queue, ${place.reason}` : held.join("; ");
|
|
3225
|
+
};
|
|
3216
3226
|
// packages/core/src/redaction.ts
|
|
3217
3227
|
var DurableSurfaceContractVersion = "durable-redaction.v1";
|
|
3218
3228
|
var EvidenceRefContractVersion = "evidence-ref.v1";
|
|
@@ -6171,7 +6181,8 @@ var RunWaiting = Union([
|
|
|
6171
6181
|
position: Int.check(isGreaterThanOrEqualTo(1)),
|
|
6172
6182
|
reason: String4,
|
|
6173
6183
|
movesUpAt: optionalKey(String4),
|
|
6174
|
-
unrunnable: optionalKey(String4)
|
|
6184
|
+
unrunnable: optionalKey(String4),
|
|
6185
|
+
quotaUntil: optionalKey(Timestamp)
|
|
6175
6186
|
})
|
|
6176
6187
|
]);
|
|
6177
6188
|
var RunEvidence = Struct({
|
|
@@ -6186,6 +6197,7 @@ var RunEvidence = Struct({
|
|
|
6186
6197
|
durationMs: Int.check(isGreaterThanOrEqualTo(0)),
|
|
6187
6198
|
outputTail: String4,
|
|
6188
6199
|
fileIds: optionalKey(ArraySchema(String4)),
|
|
6200
|
+
failedTests: optionalKey(ArraySchema(String4)),
|
|
6189
6201
|
skippedSinceBaseline: optionalKey(ArraySchema(String4)),
|
|
6190
6202
|
newNotRun: optionalKey(ArraySchema(String4)),
|
|
6191
6203
|
recordedAt: Timestamp
|
|
@@ -6752,13 +6764,16 @@ var isTestReportName = (name) => /junit.*\.xml$/iu.test(name);
|
|
|
6752
6764
|
var maxSkippedTests = 1e4;
|
|
6753
6765
|
var maxRanDigests = 1e5;
|
|
6754
6766
|
var TestId = String4.check(isMinLength(1), isMaxLength(1000));
|
|
6767
|
+
var maxFailedTests = 50;
|
|
6768
|
+
var maxFailedTestLength = 300;
|
|
6755
6769
|
var CheckTests = Struct({
|
|
6756
6770
|
reports: Int.check(isGreaterThanOrEqualTo(0)),
|
|
6757
6771
|
passed: Int.check(isGreaterThanOrEqualTo(0)),
|
|
6758
6772
|
failed: Int.check(isGreaterThanOrEqualTo(0)),
|
|
6759
6773
|
skipped: Int.check(isGreaterThanOrEqualTo(0)),
|
|
6760
6774
|
skippedTests: ArraySchema(TestId).check(isMaxLength(maxSkippedTests)),
|
|
6761
|
-
ranDigests: ArraySchema(String4.check(isMaxLength(16))).check(isMaxLength(maxRanDigests))
|
|
6775
|
+
ranDigests: ArraySchema(String4.check(isMaxLength(16))).check(isMaxLength(maxRanDigests)),
|
|
6776
|
+
failedTests: optionalKey(ArraySchema(String4.check(isMinLength(1), isMaxLength(maxFailedTestLength))).check(isMaxLength(maxFailedTests)))
|
|
6762
6777
|
});
|
|
6763
6778
|
var entities = new Map([
|
|
6764
6779
|
["amp", "&"],
|
|
@@ -6795,7 +6810,98 @@ var fnv1a = (text, seed) => {
|
|
|
6795
6810
|
return hash.toString(16).padStart(8, "0");
|
|
6796
6811
|
};
|
|
6797
6812
|
var testDigest = (id) => `${fnv1a(id, 2166136261)}${fnv1a(id, 84696351)}`;
|
|
6798
|
-
var
|
|
6813
|
+
var scriptPrefix = /^(?:[^|]{1,300} \| |\S+ [\w:.-]+: )/u;
|
|
6814
|
+
var failedTestLines = [
|
|
6815
|
+
/^\(fail\) (.+?)(?: \[[\d.]+ ?m?s\])?$/su,
|
|
6816
|
+
/^\u25CF (?=.+? \u203A .)(.+)$/su,
|
|
6817
|
+
/^FAILED (\S+?::(?:[^[]+?(?:\[.*?\])?|.+?))(?: - .*)?$/su,
|
|
6818
|
+
/^--- FAIL: (\S+)/u,
|
|
6819
|
+
/^test (.+) \.\.\. FAILED$/su,
|
|
6820
|
+
/^not ok \d+ (?:- )?(?!.*# (?:TODO|SKIP)\b)(.+)$/isu
|
|
6821
|
+
];
|
|
6822
|
+
var failedFileStart = String.raw`FAIL +(?:\|[^|]+\| *)?(?! )(?!\S*:\/\/)`;
|
|
6823
|
+
var afterPath = String.raw` > | \[ `;
|
|
6824
|
+
var failedFilePaths = [
|
|
6825
|
+
String.raw`\S*\.[A-Za-z]\w*(?=[\s:]|$)`,
|
|
6826
|
+
String.raw`(?=\S*[A-Za-z])(?=\S*\/)\S+(?=${afterPath}|$)`,
|
|
6827
|
+
String.raw`(?:(?!${afterPath}).)*\.[A-Za-z]\w*(?=${afterPath})`,
|
|
6828
|
+
String.raw`(?=\S*\/)(?:(?!${afterPath}).)*\.[A-Za-z]\w*$`,
|
|
6829
|
+
String.raw`(?=.*(?:\.(?:test|spec)\.|\b__tests__\/))(?:(?!${afterPath}).)*\.[cm]?[jt]sx?$`
|
|
6830
|
+
];
|
|
6831
|
+
var failedFileLine = new RegExp(`^${failedFileStart}((?:${failedFilePaths.join("|")}).*)$`, "su");
|
|
6832
|
+
var jestFileStats = /^((?:(?! > ).)*) \((?:[\d.]+ m?s(?:, \d+ MB heap size)?|\d+ MB heap size)\)$/su;
|
|
6833
|
+
var isPathOf = (file, path) => `/${file}`.endsWith(`/${path.replace(/^(?:\.\.\/)+/u, "")}`);
|
|
6834
|
+
var withoutRepeatedPath = (name) => (name.endsWith(" ]") ? [...name.matchAll(/ \[ /gu)] : []).map(({ index }) => name.slice(0, index)).find((path) => isPathOf(name.slice(path.length + 3, -2), path)) ?? name;
|
|
6835
|
+
var paddedLabels = /^FAIL {2}(?:\|[^|]+\| )?(?: \S+(?: \S+)* {2})+/u;
|
|
6836
|
+
var failedFileTest = (text) => {
|
|
6837
|
+
const name = failedFileLine.exec(text.replace(paddedLabels, "FAIL ").replace(jestFileStats, "$1"))?.[1];
|
|
6838
|
+
return name === undefined ? undefined : withoutRepeatedPath(name);
|
|
6839
|
+
};
|
|
6840
|
+
var maxLineLength = 1000;
|
|
6841
|
+
var ansiColours = /\u001B\[[\d;]*m/gu;
|
|
6842
|
+
var failedTestOfLine = (line) => {
|
|
6843
|
+
const printed = line.slice(0, maxLineLength).replaceAll(ansiColours, "");
|
|
6844
|
+
const unprefixed = printed.replace(scriptPrefix, "");
|
|
6845
|
+
return [printed, unprefixed, unprefixed.replace(scriptPrefix, "")].map((text) => text.trim()).flatMap((text) => [failedFileTest(text), ...failedTestLines.map((pattern) => pattern.exec(text)?.[1]?.trim())]).find((name) => name !== undefined && name !== "");
|
|
6846
|
+
};
|
|
6847
|
+
var namedTest = (name) => {
|
|
6848
|
+
const at = name.indexOf(" > ");
|
|
6849
|
+
return at === -1 ? { name, file: name, path: "" } : { name, file: name.slice(0, at), path: name.slice(at + 3) };
|
|
6850
|
+
};
|
|
6851
|
+
var reportedTest = (name) => {
|
|
6852
|
+
const test = namedTest(name);
|
|
6853
|
+
return test.path !== "" && isPathOf(test.file, test.path) ? namedTest(test.file) : test;
|
|
6854
|
+
};
|
|
6855
|
+
var byPath = (tests) => {
|
|
6856
|
+
const grouped = new Map;
|
|
6857
|
+
for (const test of tests) {
|
|
6858
|
+
const found = grouped.get(test.path);
|
|
6859
|
+
if (found === undefined)
|
|
6860
|
+
grouped.set(test.path, [test]);
|
|
6861
|
+
else
|
|
6862
|
+
found.push(test);
|
|
6863
|
+
}
|
|
6864
|
+
return grouped;
|
|
6865
|
+
};
|
|
6866
|
+
var holds = (tests, test) => (tests.get(test.path) ?? []).some(({ file }) => isPathOf(file, test.file) || isPathOf(test.file, file));
|
|
6867
|
+
var attempt = String.raw`(?:\d+ times in )?(?:initial run|\d+[a-z]{2} (?:retry(?: of \d+[a-z]{2} repeat)?|repeat))`;
|
|
6868
|
+
var vitestAttempts = new RegExp(String.raw` \(${attempt}(?:, ${attempt})*\)$`, "u");
|
|
6869
|
+
var vitestTimes = / \(\d+ times\)$/u;
|
|
6870
|
+
var printedTest = (reports) => (name) => {
|
|
6871
|
+
const whole = namedTest(name);
|
|
6872
|
+
const attempted = /[./]/u.test(whole.file) ? namedTest(name.replace(vitestAttempts, "")) : whole;
|
|
6873
|
+
return [whole, attempted, namedTest(name.replace(vitestTimes, ""))].find((test) => holds(reports, test)) ?? attempted;
|
|
6874
|
+
};
|
|
6875
|
+
var namesWithoutFile = ({ path }) => {
|
|
6876
|
+
const parts = path.split(" > ");
|
|
6877
|
+
return [path, [...parts.slice(0, -1).reverse(), ...parts.slice(-1)].join(" > ")];
|
|
6878
|
+
};
|
|
6879
|
+
var spaced = (name) => name.replaceAll(/ [>\u203A] /gu, " ");
|
|
6880
|
+
var reportedForms = ({ name, path }) => [name, path].map((text) => [text, namedTest(text)]).map(([text, test]) => test.file === test.path ? test.file : text).flatMap((text) => [spaced(text), text.replace(" > ", ".")]);
|
|
6881
|
+
var printedForm = (name) => {
|
|
6882
|
+
if (name.includes(" \u203A "))
|
|
6883
|
+
return spaced(name);
|
|
6884
|
+
const [, file, names, rest] = /^(\S+?)\.py::([^[]*)(.*)$/su.exec(name) ?? [];
|
|
6885
|
+
return file === undefined || names === undefined ? undefined : `${file.replaceAll("/", ".")}.${names.replaceAll("::", ".")}${rest ?? ""}`;
|
|
6886
|
+
};
|
|
6887
|
+
var failedTestsOf = (reported, printed) => {
|
|
6888
|
+
const reports = [...new Set(reported)].map(reportedTest);
|
|
6889
|
+
const reportsByPath = byPath(reports);
|
|
6890
|
+
const prints = [...new Set(printed)].map(printedTest(reportsByPath));
|
|
6891
|
+
const printsByPath = byPath(prints);
|
|
6892
|
+
const unprinted = reports.filter((test) => !holds(printsByPath, test));
|
|
6893
|
+
const namedWithoutFile = new Set(unprinted.flatMap(namesWithoutFile));
|
|
6894
|
+
const namedInForm = new Set(unprinted.flatMap(reportedForms));
|
|
6895
|
+
const unreported = prints.filter((test) => !holds(reportsByPath, test) && !namedWithoutFile.has(test.name) && !namedInForm.has(printedForm(test.name)));
|
|
6896
|
+
const named = new Set;
|
|
6897
|
+
for (const { name } of [...reports, ...unreported]) {
|
|
6898
|
+
if (named.size === maxFailedTests)
|
|
6899
|
+
break;
|
|
6900
|
+
named.add(redactCredentials(name).slice(0, maxFailedTestLength));
|
|
6901
|
+
}
|
|
6902
|
+
return [...named];
|
|
6903
|
+
};
|
|
6904
|
+
var checkTests = (reports, printed = []) => {
|
|
6799
6905
|
const rank = { passed: 0, skipped: 1, failed: 2 };
|
|
6800
6906
|
const tests = new Map;
|
|
6801
6907
|
for (const found of reports.flatMap(junitTestCases)) {
|
|
@@ -6805,13 +6911,15 @@ var checkTests = (reports) => {
|
|
|
6805
6911
|
}
|
|
6806
6912
|
const of = (status) => [...tests].flatMap(([id, is]) => is === status ? [id] : []);
|
|
6807
6913
|
const skipped = of("skipped").sort();
|
|
6914
|
+
const failedTests = failedTestsOf(of("failed"), printed);
|
|
6808
6915
|
return {
|
|
6809
6916
|
reports: reports.length,
|
|
6810
6917
|
passed: of("passed").length,
|
|
6811
6918
|
failed: of("failed").length,
|
|
6812
6919
|
skipped: skipped.length,
|
|
6813
6920
|
skippedTests: skipped.slice(0, maxSkippedTests),
|
|
6814
|
-
ranDigests: [...of("passed"), ...of("failed")].map(testDigest).sort().slice(0, maxRanDigests)
|
|
6921
|
+
ranDigests: [...of("passed"), ...of("failed")].map(testDigest).sort().slice(0, maxRanDigests),
|
|
6922
|
+
...failedTests.length === 0 ? undefined : { failedTests }
|
|
6815
6923
|
};
|
|
6816
6924
|
};
|
|
6817
6925
|
|
|
@@ -7116,7 +7224,8 @@ var RunnerProblemCodes = [
|
|
|
7116
7224
|
"update_required",
|
|
7117
7225
|
"processes_unreaped",
|
|
7118
7226
|
"processes_uncontained",
|
|
7119
|
-
"full_access_refused"
|
|
7227
|
+
"full_access_refused",
|
|
7228
|
+
"cli_session_expired"
|
|
7120
7229
|
];
|
|
7121
7230
|
var RunnerProblemText = String4.check(isMinLength(1), isMaxLength(500));
|
|
7122
7231
|
var RunnerProblemReport = Struct({
|
|
@@ -15035,7 +15144,7 @@ function postForm(input) {
|
|
|
15035
15144
|
function tokenResponse(response, failure) {
|
|
15036
15145
|
return gen(function* () {
|
|
15037
15146
|
if (!response.ok)
|
|
15038
|
-
return yield* new CliError({ message: `${failure} with ${response.status}
|
|
15147
|
+
return yield* new CliError({ message: `${failure} with ${response.status}`, status: response.status });
|
|
15039
15148
|
const body = yield* tryPromise({
|
|
15040
15149
|
try: () => response.json(),
|
|
15041
15150
|
catch: () => new CliError({ message: `${failure}: invalid JSON` })
|
|
@@ -15071,7 +15180,7 @@ function createSdkClient(input) {
|
|
|
15071
15180
|
const fetchImpl = input.fetch ?? (yield* Fetch);
|
|
15072
15181
|
let session = input.session;
|
|
15073
15182
|
const refreshPermit = makeUnsafe3(1);
|
|
15074
|
-
const refreshFrom = (stale) => refreshPermit.withPermits(1)(suspend3(() => session === stale ? tap2(refreshSession({ ...input, fetch: fetchImpl, session: stale }), (next) => sync2(() => session = next)) : succeed6(session))).pipe(mapError2(
|
|
15183
|
+
const refreshFrom = (stale) => refreshPermit.withPermits(1)(suspend3(() => session === stale ? tap2(refreshSession({ ...input, fetch: fetchImpl, session: stale }), (next) => sync2(() => session = next)) : succeed6(session))).pipe(mapError2(refreshFailure));
|
|
15075
15184
|
const authorizedFetch = (resource, init) => runPromise(gen(function* () {
|
|
15076
15185
|
if (session.refreshToken && shouldRefresh(yield* currentDate, session.expiresAt))
|
|
15077
15186
|
yield* refreshFrom(session);
|
|
@@ -15089,6 +15198,14 @@ function createSdkClient(input) {
|
|
|
15089
15198
|
});
|
|
15090
15199
|
});
|
|
15091
15200
|
}
|
|
15201
|
+
var sessionExpired = "The kitman login on this machine has expired. Run `kitman login`.";
|
|
15202
|
+
var refusedRefresh = new Set([400, 401, 403]);
|
|
15203
|
+
var expiredIfRefused = (error) => error instanceof CliError && error.status !== undefined && refusedRefresh.has(error.status) ? new CliError({ message: sessionExpired, status: 401 }) : error;
|
|
15204
|
+
var refreshFailure = (error) => new KitmanClientError({
|
|
15205
|
+
operation: "refreshSession",
|
|
15206
|
+
message: error.message,
|
|
15207
|
+
status: (error instanceof CliError ? error.status : undefined) ?? 503
|
|
15208
|
+
});
|
|
15092
15209
|
function refreshSession(input) {
|
|
15093
15210
|
const storedSession = readAuthStore(input.authPath).pipe(map8((auth) => sessionForApi(auth, input.apiUrl)));
|
|
15094
15211
|
return withAuthLock(input.authPath, gen(function* () {
|
|
@@ -15106,7 +15223,7 @@ function refreshSession(input) {
|
|
|
15106
15223
|
refreshToken: spentToken,
|
|
15107
15224
|
...input.fetch ? { fetch: input.fetch } : undefined
|
|
15108
15225
|
}).pipe(map8((token) => toStoredSession(token, spentToken)));
|
|
15109
|
-
const session = yield* refreshing.pipe(catch_((error) => storedSession.pipe(filterOrFail((current) => current !== undefined && current.refreshToken !== spentToken, () => error))));
|
|
15226
|
+
const session = yield* refreshing.pipe(catch_((error) => storedSession.pipe(filterOrFail((current) => current !== undefined && current.refreshToken !== spentToken, () => error))), mapError2(expiredIfRefused));
|
|
15110
15227
|
const current = yield* storedSession;
|
|
15111
15228
|
if (current?.refreshToken !== spentToken)
|
|
15112
15229
|
return current ?? session;
|
|
@@ -16125,4 +16242,4 @@ function checkServices(declaration) {
|
|
|
16125
16242
|
return isSome(decoded) ? [...new Set(decoded.value.services)] : undefined;
|
|
16126
16243
|
}
|
|
16127
16244
|
|
|
16128
|
-
export { Clock, currentTimeMillis, WebCrypto, SecureRandom, layerWebCrypto, makeUnsafe, formatIso, empty, fromInput, merge, runMain, layer, layer2, Stdio, Terminal, layer3, error, log, toDate, parseDate, toIso, currentDate, wallClockMillis, waitingOnWords, queueWords, scanDurableSurface, redactResponseSurface, redactCredentials, redactedOutputTail, SafeJson, ReleaseChannels, DefaultReleaseChannel, newerKitmanVersion, releaseChannelOffers, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, NetworkHost, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, tokensSpent, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, RunWaitUntils, isTestReportName, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, RunnerExecutionBackend, MaxRunnerConcurrency, PinnedImage, RunnerSettingNames, RunnerSettingsUpdate, defaultRunnerSettings, shownRunnerSetting, defaultRunnerCapabilities, deliveryProviderActions, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, KitName, KitDigest, defaultKitName, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, runnerReleaseChannelPath, localConfigPath, readUserConfig, writeUserConfig, sessionForApi, readAuthStore, storeSession, removeSession, removeAllSessions, agentCredentialForApi, storeAgentCredential, removeAgentCredential, normalizeApiUrl, isStoredAgentCredential, isStreamSchema, getStreamSchemas, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
|
|
16245
|
+
export { Clock, currentTimeMillis, WebCrypto, SecureRandom, layerWebCrypto, makeUnsafe, formatIso, empty, fromInput, merge, runMain, layer, layer2, Stdio, Terminal, layer3, error, log, toDate, parseDate, toIso, currentDate, wallClockMillis, waitingOnWords, queueWords, scanDurableSurface, redactResponseSurface, redactCredentials, redactedOutputTail, SafeJson, ReleaseChannels, DefaultReleaseChannel, newerKitmanVersion, releaseChannelOffers, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, NetworkHost, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, tokensSpent, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, RunWaitUntils, isTestReportName, failedTestOfLine, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, RunnerExecutionBackend, MaxRunnerConcurrency, PinnedImage, RunnerSettingNames, RunnerSettingsUpdate, defaultRunnerSettings, shownRunnerSetting, defaultRunnerCapabilities, deliveryProviderActions, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, KitName, KitDigest, defaultKitName, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, runnerReleaseChannelPath, localConfigPath, readUserConfig, writeUserConfig, sessionForApi, readAuthStore, storeSession, removeSession, removeAllSessions, agentCredentialForApi, storeAgentCredential, removeAgentCredential, normalizeApiUrl, isStoredAgentCredential, isStreamSchema, getStreamSchemas, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-zw3gf6r5.js";
|
|
10
10
|
import {
|
|
11
11
|
runForEach
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-nf9gdnsf.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-pvza175a.js";
|
|
23
23
|
import {
|
|
24
24
|
layerJson,
|
|
25
25
|
make4,
|
|
26
26
|
withHeaders,
|
|
27
27
|
layerProtocolSocket
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7jege23c.js";
|
|
29
29
|
|
|
30
30
|
// packages/live/src/rpc/runner-client.ts
|
|
31
31
|
var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
|