@kitman-sh/cli 0.6.0 → 0.7.1
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-brp7cekg.js → chunk-1d2e4je3.js} +1 -1
- package/dist/chunk-23ch5vdv.js +78 -0
- package/dist/{chunk-fc0v325q.js → chunk-2vcae278.js} +9 -10
- package/dist/{chunk-h8ctzn91.js → chunk-50w9z6we.js} +9 -12
- package/dist/{chunk-txyq8r41.js → chunk-5rp5hvc0.js} +1177 -250
- package/dist/{chunk-hw7qkap1.js → chunk-9bje6bm0.js} +22 -361
- package/dist/{chunk-tfr74ays.js → chunk-eynqc0vm.js} +142 -33
- package/dist/{chunk-3j7sewn0.js → chunk-f1f60hgt.js} +782 -615
- package/dist/{chunk-dsefng1v.js → chunk-gj8pz39x.js} +5 -6
- package/dist/{chunk-6h8ghah0.js → chunk-mx1x1b6a.js} +3 -4
- package/dist/{chunk-n32jhswz.js → chunk-tkk2synn.js} +21 -23
- package/dist/index.js +165 -78
- package/package.json +1 -1
- package/dist/chunk-hrvcz0m4.js +0 -211
- package/dist/chunk-xdk488qp.js +0 -364
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
build2,
|
|
4
|
+
succeed4,
|
|
5
|
+
provide2,
|
|
6
|
+
gen,
|
|
7
|
+
flatMap,
|
|
8
|
+
provideContext,
|
|
9
|
+
runForEach,
|
|
10
|
+
RunnerHeaders,
|
|
11
|
+
RunnerRpcProtocolVersion,
|
|
12
|
+
RunnerRpcs
|
|
13
|
+
} from "./chunk-5rp5hvc0.js";
|
|
14
|
+
import {
|
|
15
|
+
WebSocketConstructor,
|
|
16
|
+
layerWebSocketConstructorGlobal,
|
|
17
|
+
layerWebSocket,
|
|
18
|
+
layerJson,
|
|
19
|
+
make5,
|
|
20
|
+
withHeaders,
|
|
21
|
+
layerProtocolSocket
|
|
22
|
+
} from "./chunk-9bje6bm0.js";
|
|
23
|
+
|
|
24
|
+
// packages/live/src/rpc/runner-client.ts
|
|
25
|
+
var proxiedWebSocket = (proxy) => succeed4(WebSocketConstructor)((target) => {
|
|
26
|
+
const options = { proxy };
|
|
27
|
+
return Reflect.construct(globalThis.WebSocket, [target, options]);
|
|
28
|
+
});
|
|
29
|
+
var runnerWebSocketProtocol2 = (url, options = {}) => layerProtocolSocket({ retryTransientErrors: true }).pipe(provide2(layerWebSocket(url)), provide2(options.proxy === undefined ? layerWebSocketConstructorGlobal : proxiedWebSocket(options.proxy)), provide2(layerJson));
|
|
30
|
+
function runnerRpcUrl2(apiUrl) {
|
|
31
|
+
const url = new URL("/v1/runners/rpc", apiUrl);
|
|
32
|
+
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
33
|
+
return url.toString();
|
|
34
|
+
}
|
|
35
|
+
var makeRunnerRpcClient2 = (options) => gen(function* () {
|
|
36
|
+
const protocol = yield* build2(options.protocol);
|
|
37
|
+
const client = yield* make5(RunnerRpcs).pipe(provideContext(protocol));
|
|
38
|
+
const authorized = (call) => flatMap(options.bearer, (token) => withHeaders(call, {
|
|
39
|
+
authorization: `Bearer ${token}`,
|
|
40
|
+
[RunnerHeaders.runnerId]: options.runnerId,
|
|
41
|
+
[RunnerHeaders.protocolVersion]: String(RunnerRpcProtocolVersion)
|
|
42
|
+
}));
|
|
43
|
+
return {
|
|
44
|
+
claim: (input) => authorized(client.Claim(input)),
|
|
45
|
+
heartbeat: (input) => authorized(client.Heartbeat(input)),
|
|
46
|
+
complete: (input) => authorized(client.Complete(input)),
|
|
47
|
+
release: (input) => authorized(client.Release(input)),
|
|
48
|
+
recordActivity: (input) => authorized(client.RecordActivity(input)),
|
|
49
|
+
deferredDone: (input) => authorized(client.DeferredDone(input)),
|
|
50
|
+
scheduleClock: (input) => authorized(client.ScheduleClock(input)),
|
|
51
|
+
putQuestion: (input) => authorized(client.PutQuestion(input)),
|
|
52
|
+
programSecrets: (input) => authorized(client.ProgramSecrets(input)),
|
|
53
|
+
suspend: (input) => authorized(client.Suspend(input)),
|
|
54
|
+
finishProgram: (input) => authorized(client.FinishProgram(input)),
|
|
55
|
+
startAgentStep: (input) => authorized(client.StartAgentStep(input)),
|
|
56
|
+
startVerification: (input) => authorized(client.StartVerification(input)),
|
|
57
|
+
knownEvidence: (input) => authorized(client.KnownEvidence(input)),
|
|
58
|
+
awaitEvent: (input) => authorized(client.AwaitEvent(input)),
|
|
59
|
+
admitChild: (input) => authorized(client.AdmitChild(input)),
|
|
60
|
+
storeArtifact: (input) => authorized(client.StoreArtifact(input)),
|
|
61
|
+
recordNote: (input) => authorized(client.RecordNote(input)),
|
|
62
|
+
performHostEffect: (input) => authorized(client.PerformHostEffect(input)),
|
|
63
|
+
createPlanTasks: (input) => authorized(client.CreatePlanTasks(input)),
|
|
64
|
+
integrationBranch: (input) => authorized(client.IntegrationBranch(input)),
|
|
65
|
+
mergeChangeRequest: (input) => authorized(client.MergeChangeRequest(input)),
|
|
66
|
+
publishRelease: (input) => authorized(client.PublishRelease(input)),
|
|
67
|
+
bundle: (digest) => authorized(client.Bundle({ digest })),
|
|
68
|
+
settledRuns: (runIds) => authorized(client.SettledRuns({ runIds })),
|
|
69
|
+
reportSteer: (input) => authorized(client.ReportSteer(input)),
|
|
70
|
+
saveCheckpoint: (input) => authorized(client.SaveCheckpoint(input)),
|
|
71
|
+
resumeCheckpoint: (input) => authorized(client.ResumeCheckpoint(input)),
|
|
72
|
+
settledCheckpoints: authorized(client.SettledCheckpoints()),
|
|
73
|
+
forgetCheckpoints: (stepAttemptIds) => authorized(client.ForgetCheckpoints({ stepAttemptIds })),
|
|
74
|
+
listen: (runnerReplicaId, onSignal) => authorized(runForEach(client.Signals({ runnerReplicaId }), onSignal))
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export { runnerWebSocketProtocol2, runnerRpcUrl2, makeRunnerRpcClient2 };
|
|
@@ -15,20 +15,16 @@ import {
|
|
|
15
15
|
toCodecJson,
|
|
16
16
|
Json,
|
|
17
17
|
guard,
|
|
18
|
-
ProgramWorkUnit
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from "./chunk-hrvcz0m4.js";
|
|
18
|
+
ProgramWorkUnit,
|
|
19
|
+
LoopManifest,
|
|
20
|
+
RunnerRpcError
|
|
21
|
+
} from "./chunk-5rp5hvc0.js";
|
|
23
22
|
import {
|
|
24
23
|
ManifestInvalid,
|
|
25
24
|
make,
|
|
26
25
|
Suspended,
|
|
27
26
|
LoopCheckError
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import {
|
|
30
|
-
RunnerRpcError
|
|
31
|
-
} from "./chunk-xdk488qp.js";
|
|
27
|
+
} from "./chunk-tkk2synn.js";
|
|
32
28
|
|
|
33
29
|
// packages/sdk/src/program/engine.ts
|
|
34
30
|
class JournalWriteFailed extends TaggedError("JournalWriteFailed") {
|
|
@@ -69,7 +65,10 @@ class ProgramRefused extends TaggedError2()("ProgramRefused", { reason: String2
|
|
|
69
65
|
return this.reason;
|
|
70
66
|
}
|
|
71
67
|
}
|
|
68
|
+
var programHostsEnv = "KITMAN_PROGRAM_HOSTS";
|
|
69
|
+
var undeclaredHostsEnv = "KITMAN_UNDECLARED_HOSTS";
|
|
70
|
+
var redirectStatuses = new Set([301, 302, 303, 307, 308]);
|
|
72
71
|
var readStdin = tryPromise(() => Bun.stdin.text());
|
|
73
72
|
var isWorkUnit = guard(ProgramWorkUnit);
|
|
74
73
|
|
|
75
|
-
export { programLease, describeFlag, Described };
|
|
74
|
+
export { programLease, describeFlag, Described, programHostsEnv, undeclaredHostsEnv };
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
FileSystem,
|
|
22
22
|
Path,
|
|
23
23
|
ChildProcessSpawner,
|
|
24
|
-
|
|
24
|
+
make12,
|
|
25
25
|
decodeUnknownEffect,
|
|
26
26
|
decodeEffect,
|
|
27
27
|
optionalKey,
|
|
@@ -35,23 +35,20 @@ import {
|
|
|
35
35
|
fromJsonString,
|
|
36
36
|
TaggedError2,
|
|
37
37
|
toCodecJson,
|
|
38
|
-
digestSha256
|
|
39
|
-
} from "./chunk-txyq8r41.js";
|
|
40
|
-
import {
|
|
38
|
+
digestSha256,
|
|
41
39
|
AgentDeclaration,
|
|
42
40
|
KitInstallationDeclaration,
|
|
43
41
|
KitAssignmentDeclaration,
|
|
44
|
-
PackageDeclarations
|
|
45
|
-
} from "./chunk-hrvcz0m4.js";
|
|
46
|
-
import"./chunk-hw7qkap1.js";
|
|
47
|
-
import {
|
|
42
|
+
PackageDeclarations,
|
|
48
43
|
RunnerRpcProtocolVersion
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import"./chunk-
|
|
44
|
+
} from "./chunk-5rp5hvc0.js";
|
|
45
|
+
import"./chunk-9bje6bm0.js";
|
|
46
|
+
import"./chunk-23ch5vdv.js";
|
|
47
|
+
import"./chunk-tkk2synn.js";
|
|
51
48
|
import {
|
|
52
49
|
describeFlag,
|
|
53
50
|
Described
|
|
54
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-2vcae278.js";
|
|
55
52
|
|
|
56
53
|
// packages/sdk/src/build/index.ts
|
|
57
54
|
class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
|
|
@@ -99,7 +96,7 @@ var ConfigKits = Record(String2, Union([
|
|
|
99
96
|
]));
|
|
100
97
|
var run = (command, args, cwd) => gen(function* () {
|
|
101
98
|
const spawner = yield* ChildProcessSpawner;
|
|
102
|
-
const handle = yield* spawner.spawn(
|
|
99
|
+
const handle = yield* spawner.spawn(make12(command, args, { cwd, stdin: "ignore" }));
|
|
103
100
|
const [stdout, stderr, exitCode] = yield* all([
|
|
104
101
|
mkString(decodeText(handle.stdout)),
|
|
105
102
|
mkString(decodeText(handle.stderr)),
|