@kitman-sh/cli 0.13.9 → 0.13.11
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-aezq3fyy.js → chunk-0h49y8gf.js} +214 -74
- package/dist/{chunk-a44ebqzx.js → chunk-3rkhx6gq.js} +6 -6
- package/dist/{chunk-qkjfx2ts.js → chunk-5an78wy8.js} +14 -14
- package/dist/{chunk-ezv4p0zr.js → chunk-5zhh41gb.js} +4 -4
- package/dist/{chunk-53qp6kcp.js → chunk-5zth85pj.js} +2 -2
- package/dist/{chunk-v190zzc5.js → chunk-7rpd6a98.js} +1 -1
- package/dist/{chunk-69fcvx7d.js → chunk-acneym1p.js} +65 -45
- package/dist/{chunk-tspf987k.js → chunk-cbpb2rww.js} +8 -8
- package/dist/{chunk-9gg1w4aa.js → chunk-dtkejy3r.js} +377 -283
- package/dist/{chunk-rz18qefg.js → chunk-fcb6skhx.js} +10 -10
- package/dist/{chunk-cw61zyh5.js → chunk-gq7y5v3e.js} +1 -1
- package/dist/{chunk-fh58za51.js → chunk-gy9rf14f.js} +3 -3
- package/dist/{chunk-ksgt1tdc.js → chunk-h7mnz0w3.js} +4 -4
- package/dist/{chunk-pj3mer60.js → chunk-j48k8j8y.js} +4 -4
- package/dist/{chunk-s63fjc69.js → chunk-jyq4790r.js} +25 -25
- package/dist/{chunk-0wj65j5e.js → chunk-krqb80g6.js} +12 -12
- package/dist/{chunk-kq88aaa3.js → chunk-mtkstrh3.js} +4 -4
- package/dist/{chunk-x8sewxzm.js → chunk-mx3zt8v8.js} +145 -145
- package/dist/{chunk-wzr1n3zy.js → chunk-p0vqjc0n.js} +26 -6
- package/dist/{chunk-hezxa6q5.js → chunk-p8fhxfa0.js} +7 -7
- package/dist/{chunk-0tjg9eya.js → chunk-q5w3v4k1.js} +1 -1
- package/dist/{chunk-6jtjcvnc.js → chunk-rh9g6sef.js} +44 -44
- package/dist/{chunk-1ht6jwzm.js → chunk-xzfj61cp.js} +11 -11
- package/dist/{chunk-z5f7g1w1.js → chunk-y1krmnbv.js} +2 -2
- package/dist/{chunk-qjqa338f.js → chunk-zw3gf6r5.js} +94 -333
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -594,7 +594,7 @@ kitman run drift <run> --dismiss <constraint> --reason "fixtures, not released m
|
|
|
594
594
|
path: "loop-operations#tokens",
|
|
595
595
|
level: 2,
|
|
596
596
|
link: "https://kitman.sh/knowledge/docs/loop-operations#tokens",
|
|
597
|
-
text: "## Tokens\n\nEach attempt of an agent Step records the input, output and cached tokens its Harness reported in its session: Claude Code, Codex and Pi do. Input counts tokens read fresh or written to the cache; cached counts tokens read from it. Claude Code's subagents write their own session files, and their tokens count with the attempt that ran them. An attempt parked on a Question and resumed adds both parts, and one that ran past its time budget or whose Run was stopped still records what its Harness spent. An attempt whose Harness wrote no usage records that it reported none. `runs.show` and `kitman run show` give the Run's total and each Step's. A Child Run shows its own."
|
|
597
|
+
text: "## Tokens\n\nEach attempt of an agent Step records the input, output and cached tokens its Harness reported in its session: Claude Code, Codex and Pi do. Input counts tokens read fresh or written to the cache; cached counts tokens read from it. Claude Code's subagents write their own session files, and their tokens count with the attempt that ran them. An attempt parked on a Question and resumed adds both parts, and one that ran past its time budget or whose Run was stopped still records what its Harness spent. An attempt whose Harness wrote no usage records that it reported none. `runs.show` and `kitman run show` give the Run's total and each Step's. `runs.show` also gives the Harness each started attempt launched on and the model its launch named; an attempt left to its Harness's default model gives no model. A Child Run shows its own."
|
|
598
598
|
},
|
|
599
599
|
{
|
|
600
600
|
title: "Loop Operations Guide \u203A Automatic starts",
|
|
@@ -847,7 +847,7 @@ Write no code and no line numbers: both are out of date before the Task is built
|
|
|
847
847
|
link: "https://kitman.sh/knowledge/docs/scope-tasks#two-or-more-related-tasks",
|
|
848
848
|
text: `## Two or more related Tasks
|
|
849
849
|
|
|
850
|
-
Start the **File Tasks** Loop instead of creating related Tasks one by one. It makes a Task of each ticket and relates their blockers, so none is picked up before the Tasks it needs. In Code Mode:
|
|
850
|
+
Start the **File Tasks** Loop instead of creating related Tasks one by one. It checks the tickets with a plan review, then makes a Task of each ticket and relates their blockers, so none is picked up before the Tasks it needs. In Code Mode:
|
|
851
851
|
|
|
852
852
|
\`\`\`js
|
|
853
853
|
await kitman.runs.start({
|
|
@@ -856,14 +856,34 @@ await kitman.runs.start({
|
|
|
856
856
|
loop: 'file-tasks',
|
|
857
857
|
input: {
|
|
858
858
|
tickets: [
|
|
859
|
-
{
|
|
860
|
-
|
|
859
|
+
{
|
|
860
|
+
key: 'first',
|
|
861
|
+
title: '\u2026',
|
|
862
|
+
body: '\u2026',
|
|
863
|
+
promise: '\u2026',
|
|
864
|
+
outOfScope: ['\u2026'],
|
|
865
|
+
acceptanceCriteria: ['\u2026'],
|
|
866
|
+
blockedBy: []
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
key: 'wider',
|
|
870
|
+
title: '\u2026',
|
|
871
|
+
body: '\u2026',
|
|
872
|
+
promise: '\u2026',
|
|
873
|
+
outOfScope: ['\u2026'],
|
|
874
|
+
acceptanceCriteria: ['\u2026'],
|
|
875
|
+
blockedBy: ['first']
|
|
876
|
+
}
|
|
861
877
|
]
|
|
862
878
|
}
|
|
863
879
|
})
|
|
864
880
|
\`\`\`
|
|
865
881
|
|
|
866
|
-
From a terminal, pass the same Input to \`kitman run start file-tasks --input '<json>'\`. Add \`projectId\` to the Input to file them in a Project
|
|
882
|
+
From a terminal, pass the same Input to \`kitman run start file-tasks --input '<json>'\`. Add \`projectId\` to the Input to file them in a Project, and \`repoBindingId\` when they change another repository than the Team's default: the review reads it, and each Task is filed for it. A ticket that changes another repository than that names its own \`repoBindingId\`. Each ticket needs a \`promise\` and an \`outOfScope\` list, which may be empty.
|
|
883
|
+
|
|
884
|
+
When the plan review has concerns, File Tasks files none of the tickets. The Run completes with an Output whose \`concerns\` each name a \`ticket\` and what is wrong with it. Revise the tickets and start File Tasks again with all of them. With no concerns, \`concerns\` is empty and \`tasks\` gives each ticket's Task.
|
|
885
|
+
|
|
886
|
+
In a Plan Run, write the tickets in the plan: Plan files them.`
|
|
867
887
|
},
|
|
868
888
|
{
|
|
869
889
|
title: "Tasks Guide",
|
|
@@ -1535,7 +1555,7 @@ var pathOfLink = (link) => {
|
|
|
1535
1555
|
return page === null ? link : page[1] || "index";
|
|
1536
1556
|
};
|
|
1537
1557
|
var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
|
|
1538
|
-
var pinnedLink2 = (link, version = "0.13.
|
|
1558
|
+
var pinnedLink2 = (link, version = "0.13.11") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
|
|
1539
1559
|
var pageOf = (path) => path.split("#")[0];
|
|
1540
1560
|
var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
|
|
1541
1561
|
function excerpt(text, queryTerms) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
gen,
|
|
13
13
|
fail7,
|
|
14
14
|
flatMap3,
|
|
15
|
-
|
|
15
|
+
map8,
|
|
16
16
|
mapError2,
|
|
17
17
|
orDie,
|
|
18
18
|
provide3,
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
Record,
|
|
25
25
|
Int,
|
|
26
26
|
fromJsonString
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-zw3gf6r5.js";
|
|
28
28
|
import {
|
|
29
29
|
withDefault,
|
|
30
30
|
String2
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-0h49y8gf.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-dtkejy3r.js";
|
|
43
43
|
|
|
44
44
|
// packages/core/src/npm-registry.ts
|
|
45
45
|
var KitManifest = Struct({
|
|
@@ -73,7 +73,7 @@ var PackageJson = Struct({ kitman: optionalKey(Unknown) });
|
|
|
73
73
|
var decodePackageJson = decodeUnknownOption(fromJsonString(PackageJson));
|
|
74
74
|
var decodeManifest = decodeUnknownOption(KitManifest);
|
|
75
75
|
var decodeJson = decodeUnknownOption(fromJsonString(Unknown));
|
|
76
|
-
var gunzip = (bytes) => tryPromise(() => new Response(new Blob([new Uint8Array(bytes)]).stream().pipeThrough(new DecompressionStream("gzip"))).arrayBuffer()).pipe(
|
|
76
|
+
var gunzip = (bytes) => tryPromise(() => new Response(new Blob([new Uint8Array(bytes)]).stream().pipeThrough(new DecompressionStream("gzip"))).arrayBuffer()).pipe(map8((buffer) => new Uint8Array(buffer)));
|
|
77
77
|
var text = (bytes) => new TextDecoder().decode(bytes).replace(/\0.*$/su, "");
|
|
78
78
|
var untar = (tar) => {
|
|
79
79
|
const files = new Map;
|
|
@@ -103,7 +103,7 @@ var untar = (tar) => {
|
|
|
103
103
|
var registryUrl = String2("NPM_CONFIG_REGISTRY").pipe(withDefault("https://registry.npmjs.org"));
|
|
104
104
|
var newerOf = (latest, next) => latest === undefined || next !== undefined && newerKitmanVersion(next, latest) ? next : latest;
|
|
105
105
|
var npmRegistryAt = (url = registryUrl) => {
|
|
106
|
-
const base = (isString(url) ? succeed6(url) : orDie(url)).pipe(
|
|
106
|
+
const base = (isString(url) ? succeed6(url) : orDie(url)).pipe(map8((value) => value.replace(/\/+$/u, "")));
|
|
107
107
|
const unreachable = (name, version) => (error) => new NpmRegistryError({
|
|
108
108
|
kind: "unreachable",
|
|
109
109
|
message: `npm did not answer for ${name}@${version}: ${error.message}; try again`
|
|
@@ -131,7 +131,7 @@ var npmRegistryAt = (url = registryUrl) => {
|
|
|
131
131
|
const dist = found.versions[version]?.dist;
|
|
132
132
|
if (dist === undefined)
|
|
133
133
|
return yield* new NpmRegistryError({ kind: "not_found", message: `npm has no ${name}@${wanted}` });
|
|
134
|
-
const tarball = yield* get2(dist.tarball).pipe(flatMap3(filterStatusOk), flatMap3((response) => response.arrayBuffer),
|
|
134
|
+
const tarball = yield* get2(dist.tarball).pipe(flatMap3(filterStatusOk), flatMap3((response) => response.arrayBuffer), map8((buffer) => new Uint8Array(buffer)), mapError2(unreachable(name, version)), provide3(layer4));
|
|
135
135
|
if (!tarballMatches(tarball, dist))
|
|
136
136
|
return yield* new NpmRegistryError({
|
|
137
137
|
kind: "integrity",
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isMinLength,
|
|
19
19
|
isMaxLength,
|
|
20
20
|
FiniteFromString
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-zw3gf6r5.js";
|
|
22
22
|
|
|
23
23
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/JsonSchema.js
|
|
24
24
|
var PRE_2020_TO_2020_COLLISIONS = ["$anchor", "$defs", "$dynamicAnchor", "$dynamicRef", "$vocabulary", "contentSchema", "dependentRequired", "dependentSchemas", "maxContains", "minContains", "prefixItems", "unevaluatedItems", "unevaluatedProperties"];
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
succeed,
|
|
13
13
|
isSuccess,
|
|
14
14
|
TaggedError,
|
|
15
|
-
|
|
15
|
+
make16,
|
|
16
16
|
_await,
|
|
17
17
|
fail5,
|
|
18
18
|
succeed5,
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
provideMerge,
|
|
21
21
|
squash,
|
|
22
22
|
pretty,
|
|
23
|
-
currentTimeMillis,
|
|
24
23
|
max2,
|
|
25
24
|
during,
|
|
26
25
|
min2,
|
|
@@ -43,7 +42,7 @@ import {
|
|
|
43
42
|
andThen2,
|
|
44
43
|
tap2,
|
|
45
44
|
result,
|
|
46
|
-
|
|
45
|
+
map8,
|
|
47
46
|
as,
|
|
48
47
|
asSome2,
|
|
49
48
|
asVoid,
|
|
@@ -105,7 +104,7 @@ import {
|
|
|
105
104
|
decodeJsonString,
|
|
106
105
|
encodeJsonStringSync,
|
|
107
106
|
encodePrettyJsonString
|
|
108
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-zw3gf6r5.js";
|
|
109
108
|
import {
|
|
110
109
|
tap,
|
|
111
110
|
mapError,
|
|
@@ -117,8 +116,9 @@ import {
|
|
|
117
116
|
withDefault,
|
|
118
117
|
option,
|
|
119
118
|
String2
|
|
120
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-0h49y8gf.js";
|
|
121
120
|
import {
|
|
121
|
+
currentTimeMillis,
|
|
122
122
|
SecureRandom,
|
|
123
123
|
layerWebCrypto,
|
|
124
124
|
runMain,
|
|
@@ -230,14 +230,14 @@ import {
|
|
|
230
230
|
harnessNames,
|
|
231
231
|
herdrRunnerCapabilities2,
|
|
232
232
|
declaredChecks
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-dtkejy3r.js";
|
|
234
234
|
import {
|
|
235
235
|
Id
|
|
236
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-q5w3v4k1.js";
|
|
237
237
|
import {
|
|
238
238
|
ChildProcessSpawner,
|
|
239
239
|
make3
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-mtkstrh3.js";
|
|
241
241
|
|
|
242
242
|
// apps/cli/src/cli-error.ts
|
|
243
243
|
function cliErrorCode(error, status) {
|
|
@@ -868,7 +868,7 @@ function herdrRunnerCredentialName(runnerId) {
|
|
|
868
868
|
return `herdr-runner:${runnerId}`;
|
|
869
869
|
}
|
|
870
870
|
function storedHerdrRunnerCredential(apiUrl, runnerId) {
|
|
871
|
-
return
|
|
871
|
+
return map8(readAuthStore(), (auth) => agentCredentialForApi(auth, apiUrl, herdrRunnerCredentialName(runnerId)));
|
|
872
872
|
}
|
|
873
873
|
function writeRunnerCredentialFile(path, file) {
|
|
874
874
|
return gen(function* () {
|
|
@@ -993,10 +993,10 @@ var sandboxMissing = (sandbox, missing) => ({
|
|
|
993
993
|
var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
|
|
994
994
|
var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
|
|
995
995
|
var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
|
|
996
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
996
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-j48k8j8y.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
|
|
997
997
|
});
|
|
998
998
|
var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
|
|
999
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
999
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-j48k8j8y.js")), (module) => module.updateHerdrCore(options))
|
|
1000
1000
|
});
|
|
1001
1001
|
var herdrCoreMissing = (error) => {
|
|
1002
1002
|
if (isTagged(error, "HerdrCoreMissing"))
|
|
@@ -1188,7 +1188,7 @@ var managedKitmanPath = gen(function* () {
|
|
|
1188
1188
|
var installedKitmanVersion = gen(function* () {
|
|
1189
1189
|
const fs = yield* FileSystem;
|
|
1190
1190
|
const path = yield* Path;
|
|
1191
|
-
return yield* fs.readLink(yield* managedKitmanPath).pipe(
|
|
1191
|
+
return yield* fs.readLink(yield* managedKitmanPath).pipe(map8((target) => path.basename(path.dirname(target))), orElseSucceed(() => {
|
|
1192
1192
|
return;
|
|
1193
1193
|
}));
|
|
1194
1194
|
});
|
|
@@ -1233,7 +1233,7 @@ var downloadManagedKitman = (apiUrl, platform) => gen(function* () {
|
|
|
1233
1233
|
const binary = yield* fetchFrom(release.url).pipe(filterOrFail((downloaded) => downloaded.ok, (downloaded) => new CliError({ message: `Downloading kitman ${manifest.version} answered ${downloaded.status}` })), flatMap3((downloaded) => tryPromise({
|
|
1234
1234
|
try: () => downloaded.arrayBuffer(),
|
|
1235
1235
|
catch: (error) => new CliError({ message: `Downloading kitman ${manifest.version} failed: ${String(error)}` })
|
|
1236
|
-
})),
|
|
1236
|
+
})), map8((bytes) => new Uint8Array(bytes)));
|
|
1237
1237
|
if (digestSha256(binary, "hex") !== release.sha256)
|
|
1238
1238
|
return yield* new CliError({
|
|
1239
1239
|
message: `The downloaded kitman ${manifest.version} for ${os}/${architecture} does not match its sha256; nothing was installed`
|
|
@@ -1422,12 +1422,12 @@ var syncTargets = (harness) => gen(function* () {
|
|
|
1422
1422
|
});
|
|
1423
1423
|
var syncKits = (input) => gen(function* () {
|
|
1424
1424
|
const fs = yield* FileSystem;
|
|
1425
|
-
const { syncKitSetup } = yield* promise(() => import("./chunk-
|
|
1425
|
+
const { syncKitSetup } = yield* promise(() => import("./chunk-fcb6skhx.js"));
|
|
1426
1426
|
const harnesses = yield* syncTargets(input.harness);
|
|
1427
1427
|
const chain = yield* input.client.getKitChain(input.workspaceId);
|
|
1428
1428
|
for (const { name, problem } of chain.skipped)
|
|
1429
1429
|
yield* log(`Warning: skipped Kit ${name}: ${problem}`);
|
|
1430
|
-
const kits = yield* forEach(chain.kits, (kit) =>
|
|
1430
|
+
const kits = yield* forEach(chain.kits, (kit) => map8(flatMap3(setupArchive(input.client, input.workspaceId, kit.setupDigest), decodeArchive), (archive) => ({ name: kit.name, version: kit.version, archive })));
|
|
1431
1431
|
const manifest = yield* userHarnessSyncPath;
|
|
1432
1432
|
const previous = yield* fs.readFileString(manifest).pipe(flatMap3(decodeEffect(SyncedHarnesses)), orElseSucceed(() => ({})));
|
|
1433
1433
|
const kitman = (yield* runningManagedInstall(process.platform)) ? yield* managedKitmanPath : "kitman";
|
|
@@ -1568,7 +1568,7 @@ function idempotencyKey(value, operation) {
|
|
|
1568
1568
|
const explicit = value?.trim();
|
|
1569
1569
|
if (explicit)
|
|
1570
1570
|
return succeed6(explicit);
|
|
1571
|
-
return SecureRandom.pipe(flatMap3((random) => random.uuidV4()),
|
|
1571
|
+
return SecureRandom.pipe(flatMap3((random) => random.uuidV4()), map8((id) => `kitman-cli:${operation}:${id}`), provide3(layerWebCrypto));
|
|
1572
1572
|
}
|
|
1573
1573
|
function segment(value) {
|
|
1574
1574
|
return encodeURIComponent(value);
|
|
@@ -1686,7 +1686,7 @@ var machineRunnerServices = gen(function* () {
|
|
|
1686
1686
|
return yield* forEach(files.flatMap((file) => {
|
|
1687
1687
|
const runnerId = pattern.exec(file)?.[1];
|
|
1688
1688
|
return runnerId === undefined ? [] : [{ runnerId, file: path.join(directory, file) }];
|
|
1689
|
-
}), ({ runnerId, file }) =>
|
|
1689
|
+
}), ({ runnerId, file }) => map8(fs.readFileString(file), (definition) => ({
|
|
1690
1690
|
runnerId,
|
|
1691
1691
|
command: serviceCommand(platform, definition)
|
|
1692
1692
|
})));
|
|
@@ -1701,7 +1701,7 @@ var ownersRunners = (apiUrl) => gen(function* () {
|
|
|
1701
1701
|
return;
|
|
1702
1702
|
const client = yield* clientFor(apiUrl, session);
|
|
1703
1703
|
const workspaces = (yield* client.listWorkspaces()).items;
|
|
1704
|
-
const lists = yield* forEach(workspaces, (workspace) =>
|
|
1704
|
+
const lists = yield* forEach(workspaces, (workspace) => map8(client.listRunners(workspace.id), (list) => list.items));
|
|
1705
1705
|
return new Map(lists.flat().map((runner) => [runner.id, runner]));
|
|
1706
1706
|
}).pipe(orElseSucceed(() => {
|
|
1707
1707
|
return;
|
|
@@ -1824,7 +1824,7 @@ var machineRunnerCommand = (action, apiUrl, options) => gen(function* () {
|
|
|
1824
1824
|
|
|
1825
1825
|
// apps/cli/src/repo-binding-setup.ts
|
|
1826
1826
|
var Git = Reference("kitman/cli/Git", {
|
|
1827
|
-
defaultValue: () => (args) => runCommand2("git", args).pipe(
|
|
1827
|
+
defaultValue: () => (args) => runCommand2("git", args).pipe(map8((stdout) => stdout.trim()))
|
|
1828
1828
|
});
|
|
1829
1829
|
var repoBindingInputFromCurrentRepo = flatMap3(Git, repoBindingInput);
|
|
1830
1830
|
function repoBindingInput(git) {
|
|
@@ -1961,8 +1961,8 @@ function initCommand(args) {
|
|
|
1961
1961
|
const apiUrl = yield* resolveApiUrl(flags.apiUrl);
|
|
1962
1962
|
const steps = [];
|
|
1963
1963
|
const step = (name, outcome, detail) => andThen2(sync2(() => steps.push({ name, outcome, detail })), log(`${name}: ${outcomeLabel[outcome]} (${detail})`));
|
|
1964
|
-
const ask = (prompt, fallback) => flags.yes ? succeed6(fallback) : promptLine(fallback === "" ? `${prompt}: ` : `${prompt} [${fallback}]: `).pipe(
|
|
1965
|
-
const confirm = (prompt, fallback) =>
|
|
1964
|
+
const ask = (prompt, fallback) => flags.yes ? succeed6(fallback) : promptLine(fallback === "" ? `${prompt}: ` : `${prompt} [${fallback}]: `).pipe(map8((answer) => answer.trim() || fallback));
|
|
1965
|
+
const confirm = (prompt, fallback) => map8(ask(`${prompt} (y/n)`, fallback ? "y" : "n"), (answer) => /^y(es)?$/i.test(answer));
|
|
1966
1966
|
const existingSession = yield* sessionForApiWithRefresh(apiUrl);
|
|
1967
1967
|
const session = existingSession ?? (yield* (yield* Login)(apiUrl));
|
|
1968
1968
|
yield* step("Login", existingSession === undefined ? "set_up" : "already", apiUrl);
|
|
@@ -2147,7 +2147,7 @@ var runnerServiceStep = (apiUrl, runnerId, change, step) => gen(function* () {
|
|
|
2147
2147
|
yield* step("Runner service", change.fresh ? "set_up" : "repaired", "started");
|
|
2148
2148
|
});
|
|
2149
2149
|
var credentialNote = { missing: ", credential restored", refused: ", credential re-keyed", accepted: "" };
|
|
2150
|
-
var machineName =
|
|
2150
|
+
var machineName = map8(option(String2("KITMAN_RUNNER_NAME")), (name) => getOrElse(name, () => hostname()));
|
|
2151
2151
|
var managedRunnerService = (runnerId, apiUrl) => gen(function* () {
|
|
2152
2152
|
const kitman = yield* managedKitmanPath;
|
|
2153
2153
|
const bin = (yield* Path).dirname(kitman);
|
|
@@ -2268,9 +2268,9 @@ function runnerServiceState(name) {
|
|
|
2268
2268
|
return gen(function* () {
|
|
2269
2269
|
const manager = yield* ServiceManager;
|
|
2270
2270
|
if (manager.platform === "linux")
|
|
2271
|
-
return yield* manager.run("systemctl", ["--user", "is-active", `${name}.service`]).pipe(
|
|
2271
|
+
return yield* manager.run("systemctl", ["--user", "is-active", `${name}.service`]).pipe(map8((state) => `systemd: ${state.trim()}`), orElseSucceed(() => "systemd: not running"));
|
|
2272
2272
|
if (manager.platform === "darwin")
|
|
2273
|
-
return yield* manager.run("launchctl", ["print", `${yield* launchdDomain}/${launchdLabel(name)}`]).pipe(
|
|
2273
|
+
return yield* manager.run("launchctl", ["print", `${yield* launchdDomain}/${launchdLabel(name)}`]).pipe(map8((printed) => `launchd: ${/^\s*state = (\S+)/mu.exec(printed)?.[1] ?? "loaded"}`), orElseSucceed(() => "launchd: not installed"));
|
|
2274
2274
|
return;
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
@@ -2341,7 +2341,7 @@ var package_default = {
|
|
|
2341
2341
|
};
|
|
2342
2342
|
|
|
2343
2343
|
// apps/cli/src/scaffold.ts
|
|
2344
|
-
var cliVersion = "0.13.
|
|
2344
|
+
var cliVersion = "0.13.11";
|
|
2345
2345
|
var packageJson = (name, scaffold) => `${JSON.stringify({
|
|
2346
2346
|
name,
|
|
2347
2347
|
private: true,
|
|
@@ -2493,7 +2493,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
|
|
|
2493
2493
|
|
|
2494
2494
|
// apps/cli/src/commands.ts
|
|
2495
2495
|
var ClientId = "kitman-cli";
|
|
2496
|
-
var agentRuntime = promise(() => import("./chunk-
|
|
2496
|
+
var agentRuntime = promise(() => import("./chunk-mx3zt8v8.js"));
|
|
2497
2497
|
var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
|
|
2498
2498
|
defaultValue: () => gen(function* () {
|
|
2499
2499
|
const tui = yield* tryPromise({
|
|
@@ -2925,7 +2925,7 @@ function harnessSync(args) {
|
|
|
2925
2925
|
});
|
|
2926
2926
|
});
|
|
2927
2927
|
}
|
|
2928
|
-
var readStdin = Stdio.pipe(flatMap3((stdio) => mkString(decodeText(stdio.stdin))),
|
|
2928
|
+
var readStdin = Stdio.pipe(flatMap3((stdio) => mkString(decodeText(stdio.stdin))), map8((text) => text.trim()));
|
|
2929
2929
|
function promptLine(prompt) {
|
|
2930
2930
|
return gen(function* () {
|
|
2931
2931
|
const terminal = yield* Terminal;
|
|
@@ -3529,7 +3529,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
|
|
|
3529
3529
|
});
|
|
3530
3530
|
var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
|
|
3531
3531
|
defaultValue: () => (options) => gen(function* () {
|
|
3532
|
-
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-
|
|
3532
|
+
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-3rkhx6gq.js"));
|
|
3533
3533
|
return yield* makeRunnerRpcClient({
|
|
3534
3534
|
runnerId: options.runnerId,
|
|
3535
3535
|
bearer: options.bearer,
|
|
@@ -3544,7 +3544,7 @@ var runnerHostSettings = gen(function* () {
|
|
|
3544
3544
|
"KITMAN_RUNNER_FULL_ACCESS",
|
|
3545
3545
|
"SSH_AUTH_SOCK"
|
|
3546
3546
|
];
|
|
3547
|
-
const environment = Object.fromEntries(yield* forEach(names, (name) => String2(name).pipe(option,
|
|
3547
|
+
const environment = Object.fromEntries(yield* forEach(names, (name) => String2(name).pipe(option, map8((value) => [name, getOrUndefined(value)?.trim()]))));
|
|
3548
3548
|
return {
|
|
3549
3549
|
fullAccess: environment["KITMAN_RUNNER_FULL_ACCESS"] === "1",
|
|
3550
3550
|
sshAgentAvailable: environment["SSH_AUTH_SOCK"] !== undefined,
|
|
@@ -3828,13 +3828,13 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3828
3828
|
}).pipe(tap2((opened) => opened.settledRuns([])))));
|
|
3829
3829
|
const signals = yield* makeReplicaSignals;
|
|
3830
3830
|
const bundles = yield* kitmanBundles({
|
|
3831
|
-
fetch: (digest) => rpc.bundle(digest).pipe(
|
|
3831
|
+
fetch: (digest) => rpc.bundle(digest).pipe(map8((found) => found.bundle)),
|
|
3832
3832
|
cacheDir: bundleCache
|
|
3833
3833
|
});
|
|
3834
3834
|
const checkouts = runCheckouts(path.join(runnerRootDir, ".kitman"), rpc.gitCredential);
|
|
3835
|
-
yield* controlPlane.client.listRepoBindings(runner.workspaceId).pipe(flatMap3(({ items }) => forEach(items.filter((binding) => binding.status === "active" && (teamId === undefined || binding.teamId === teamId)), (repoBinding) =>
|
|
3835
|
+
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);
|
|
3836
3836
|
const platform = yield* context();
|
|
3837
|
-
const updated = yield*
|
|
3837
|
+
const updated = yield* make16();
|
|
3838
3838
|
const scope = yield* scope2;
|
|
3839
3839
|
const startUpdate = (update) => update.pipe(catch_((error) => andThen2(restartOntoUpdate(input.runnerId), fail5(updated, error))), provideContext2(platform), forkIn(scope), asVoid);
|
|
3840
3840
|
const refusedForProtocol = container ? updater.stopWhenDrained(new RunnerStopped({ problem: updateRequired })).pipe(catch_((stopped) => fail5(updated, stopped)), forkIn(scope), asVoid) : startUpdate(updater.updateRequired);
|
|
@@ -3942,18 +3942,18 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3942
3942
|
...work.secretDestinations === undefined ? undefined : { secretDestinations: work.secretDestinations }
|
|
3943
3943
|
},
|
|
3944
3944
|
recordRefusal: refused,
|
|
3945
|
-
revokedSecrets: heartbeatOf(work).pipe(
|
|
3945
|
+
revokedSecrets: heartbeatOf(work).pipe(map8((state) => state.revokedSecrets ?? [])),
|
|
3946
3946
|
sandbox: {
|
|
3947
3947
|
backend: work.sandbox ?? sandboxOf(work),
|
|
3948
3948
|
policy: agentStepSandboxPolicy(work, input.apiUrl, runnerState)
|
|
3949
3949
|
},
|
|
3950
|
-
settled: heartbeatOf(work).pipe(
|
|
3950
|
+
settled: heartbeatOf(work).pipe(map8((state) => state.settled || state.outputSubmitted === true)),
|
|
3951
3951
|
...agentStepExecutionLimit(work, now),
|
|
3952
3952
|
steering: {
|
|
3953
3953
|
...signals.steers(work.id),
|
|
3954
3954
|
report: (note, delivered) => andThen2(delivered ? steered(note) : void_3, rpc.reportSteer({ workUnitId: work.id, messageId: note.messageId, delivered }).pipe(catch_((error) => logWarning("runner_steer_report_failed", error.message))))
|
|
3955
3955
|
}
|
|
3956
|
-
}).pipe(
|
|
3956
|
+
}).pipe(map8((outcome) => agentStepRunOutcome(outcome, {
|
|
3957
3957
|
sandbox: work.sandbox ?? sandboxOf(work),
|
|
3958
3958
|
lacksLoginSecret: lacksLoginSecret(work.brief.harness, work.secrets)
|
|
3959
3959
|
})), catch_((refusal) => succeed6({ status: "failed", summary: refusal.summary }))))
|
|
@@ -4086,7 +4086,7 @@ function mcpCommand(args) {
|
|
|
4086
4086
|
if (command.action === "run") {
|
|
4087
4087
|
if (command.args.length > 0)
|
|
4088
4088
|
return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
|
|
4089
|
-
const { runMcpServerCommand } = yield* promise(() => import("./chunk-
|
|
4089
|
+
const { runMcpServerCommand } = yield* promise(() => import("./chunk-acneym1p.js"));
|
|
4090
4090
|
return yield* runMcpServerCommand({ flags: command.flags });
|
|
4091
4091
|
}
|
|
4092
4092
|
if (command.action !== "setup")
|
|
@@ -4574,7 +4574,7 @@ function programLoopCommand(command) {
|
|
|
4574
4574
|
return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
|
|
4575
4575
|
});
|
|
4576
4576
|
}
|
|
4577
|
-
var docsModule = promise(() => import("./chunk-
|
|
4577
|
+
var docsModule = promise(() => import("./chunk-7rpd6a98.js"));
|
|
4578
4578
|
function docsCommand(args) {
|
|
4579
4579
|
return gen(function* () {
|
|
4580
4580
|
const command = parseCommand(args);
|
|
@@ -4994,7 +4994,7 @@ function transcriptCommand(args) {
|
|
|
4994
4994
|
return yield* new CliError({
|
|
4995
4995
|
message: `Run ${runId} has no ${stepKey === undefined ? "Step attempts" : `attempt of ${stepKey}`}${attempt === undefined ? "" : ` numbered ${attempt}`}`
|
|
4996
4996
|
});
|
|
4997
|
-
const items = yield* forEach(asked, (found) =>
|
|
4997
|
+
const items = yield* forEach(asked, (found) => map8(transcriptAfter(client, runId, found.id, 0), (entries) => ({
|
|
4998
4998
|
stepKey: found.stepKey,
|
|
4999
4999
|
attempt: found.attempt,
|
|
5000
5000
|
stepAttemptId: found.id,
|
|
@@ -5274,7 +5274,7 @@ function verifyCommand(args) {
|
|
|
5274
5274
|
}
|
|
5275
5275
|
});
|
|
5276
5276
|
}
|
|
5277
|
-
var secretValueFromStdin = Stdio.pipe(flatMap3((stdio) => mkString(decodeText(stdio.stdin))),
|
|
5277
|
+
var secretValueFromStdin = Stdio.pipe(flatMap3((stdio) => mkString(decodeText(stdio.stdin))), map8((text) => text.replace(/\r?\n$/, "")));
|
|
5278
5278
|
function secretCommand(args) {
|
|
5279
5279
|
return gen(function* () {
|
|
5280
5280
|
const command = parseCommand(args.length === 1 ? [...args, "list"] : args);
|
|
@@ -5408,9 +5408,9 @@ function changeRequestCommand(args) {
|
|
|
5408
5408
|
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
5409
|
});
|
|
5410
5410
|
}
|
|
5411
|
-
var KitWriter =
|
|
5411
|
+
var KitWriter = map8(promise(() => import("./chunk-jyq4790r.js")), (build) => build.writeKit);
|
|
5412
5412
|
var KitBuilder = Reference("kitman/cli/KitBuilder", {
|
|
5413
|
-
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-
|
|
5413
|
+
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-jyq4790r.js")), (build) => build.buildKit(directory))
|
|
5414
5414
|
});
|
|
5415
5415
|
var uploadKit = (client, workspaceId, built) => gen(function* () {
|
|
5416
5416
|
yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
|
|
@@ -5427,7 +5427,7 @@ var buildKitInto = (command) => gen(function* () {
|
|
|
5427
5427
|
yield* (yield* KitWriter)(directory, built, out).pipe(mapError2(() => new CliError({ message: `${path.join(directory, "package.json")} is not a JSON object` })));
|
|
5428
5428
|
yield* log(`Built ${built.name} ${built.version} into ${out}`);
|
|
5429
5429
|
});
|
|
5430
|
-
var optionalEnv = (name) => String2(name).pipe(option,
|
|
5430
|
+
var optionalEnv = (name) => String2(name).pipe(option, map8(getOrUndefined));
|
|
5431
5431
|
var ciIdToken = (apiUrl) => gen(function* () {
|
|
5432
5432
|
const gitlab = yield* optionalEnv("KITMAN_ID_TOKEN");
|
|
5433
5433
|
if (gitlab !== undefined)
|
|
@@ -6104,9 +6104,9 @@ var runnerDelivery = (client, runner, askedTeamId) => {
|
|
|
6104
6104
|
providerActions: postures === undefined ? "" : Object.entries(postures).map(([action, posture]) => `${action}=${posture}`).join(",")
|
|
6105
6105
|
};
|
|
6106
6106
|
};
|
|
6107
|
-
return teamId === undefined ? succeed6(row("per_team")) : client.getTeamDeliverySettings(teamId).pipe(
|
|
6107
|
+
return teamId === undefined ? succeed6(row("per_team")) : client.getTeamDeliverySettings(teamId).pipe(map8((settings) => row(settings.delivery)), catchTag("KitmanClientError", (error) => succeed6(row("unknown", error.message))));
|
|
6108
6108
|
};
|
|
6109
|
-
var runnerDoctorRowOnThisMachine = (runner) =>
|
|
6109
|
+
var runnerDoctorRowOnThisMachine = (runner) => map8(runnerServiceState(runnerServiceName(runner.id)), (service) => ({
|
|
6110
6110
|
...runnerDoctorRow(runner),
|
|
6111
6111
|
...service === undefined ? undefined : { service }
|
|
6112
6112
|
}));
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
isSuccess2,
|
|
14
14
|
addFinalizerExit,
|
|
15
15
|
effectDiscard,
|
|
16
|
-
currentTimeMillis,
|
|
17
16
|
forEach,
|
|
18
17
|
promise,
|
|
19
18
|
tryPromise,
|
|
@@ -25,7 +24,7 @@ import {
|
|
|
25
24
|
flatMap3,
|
|
26
25
|
andThen2,
|
|
27
26
|
tap2,
|
|
28
|
-
|
|
27
|
+
map8,
|
|
29
28
|
orDie,
|
|
30
29
|
context,
|
|
31
30
|
contextWith,
|
|
@@ -76,15 +75,12 @@ import {
|
|
|
76
75
|
toEquivalence,
|
|
77
76
|
toCodecJson,
|
|
78
77
|
Json
|
|
79
|
-
} from "./chunk-
|
|
80
|
-
import {
|
|
81
|
-
runForEach,
|
|
82
|
-
FileSystem
|
|
83
|
-
} from "./chunk-aezq3fyy.js";
|
|
78
|
+
} from "./chunk-zw3gf6r5.js";
|
|
84
79
|
import {
|
|
85
80
|
guard
|
|
86
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-q5w3v4k1.js";
|
|
87
82
|
import {
|
|
83
|
+
currentTimeMillis,
|
|
88
84
|
WebCrypto,
|
|
89
85
|
SafeJson,
|
|
90
86
|
AgentSandboxNetwork,
|
|
@@ -109,7 +105,11 @@ import {
|
|
|
109
105
|
KitDigest,
|
|
110
106
|
KitSetup,
|
|
111
107
|
RunnerRpcError
|
|
112
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-dtkejy3r.js";
|
|
109
|
+
import {
|
|
110
|
+
runForEach,
|
|
111
|
+
FileSystem
|
|
112
|
+
} from "./chunk-0h49y8gf.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");
|
|
@@ -350,7 +350,7 @@ class ManifestInvalid extends TaggedError2()("ManifestInvalid", {
|
|
|
350
350
|
var JsonObjectSchema = Record(String4, Json);
|
|
351
351
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workflow/internal/crypto.js
|
|
352
352
|
var encoder = /* @__PURE__ */ new TextEncoder;
|
|
353
|
-
var makeHashDigest = (original) => WebCrypto.use((crypto) =>
|
|
353
|
+
var makeHashDigest = (original) => WebCrypto.use((crypto) => map8(webCryptoDigest(crypto, sha256, encoder.encode(original)), (bytes) => encode(bytes).slice(0, 32)));
|
|
354
354
|
|
|
355
355
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workflow/Workflow.js
|
|
356
356
|
var TypeId = "~effect/workflow/Workflow";
|
|
@@ -1124,7 +1124,7 @@ var programLease = (work) => ({
|
|
|
1124
1124
|
});
|
|
1125
1125
|
var rpcRunFiles = (rpc, lease) => ({
|
|
1126
1126
|
createRunFile: (file) => rpc.createRunFile({ lease, ...file }),
|
|
1127
|
-
runFileParts: (request) =>
|
|
1127
|
+
runFileParts: (request) => map8(rpc.runFileParts({ lease, ...request, partNumbers: [...request.partNumbers] }), ({ parts }) => parts),
|
|
1128
1128
|
completeRunFile: ({ parts, ...request }) => rpc.completeRunFile({ lease, ...request, ...parts === undefined ? undefined : { parts: [...parts] } })
|
|
1129
1129
|
});
|
|
1130
1130
|
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
ArraySchema,
|
|
14
14
|
decodeJsonStringOption,
|
|
15
15
|
encodeUnknownJsonStringSync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-zw3gf6r5.js";
|
|
17
17
|
import {
|
|
18
18
|
replaceSecretReferences,
|
|
19
19
|
secretReferencesIn
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-q5w3v4k1.js";
|
|
21
21
|
|
|
22
22
|
// packages/agent-runtime/src/srt-step.ts
|
|
23
23
|
import { SandboxRuntimeConfigSchema } from "@anthropic-ai/sandbox-runtime";
|