@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.
@@ -3,7 +3,7 @@ import {
3
3
  Random,
4
4
  succeed5,
5
5
  withFiber
6
- } from "./chunk-txyq8r41.js";
6
+ } from "./chunk-5rp5hvc0.js";
7
7
 
8
8
  // node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Random.js
9
9
  var Random2 = Random;
@@ -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
- } from "./chunk-txyq8r41.js";
20
- import {
21
- LoopManifest
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-n32jhswz.js";
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
- make15,
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-xdk488qp.js";
50
- import"./chunk-n32jhswz.js";
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-fc0v325q.js";
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(make15(command, args, { cwd, stdin: "ignore" }));
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)),