@kitman-sh/cli 0.7.3 → 0.7.4

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-8g2twwm8.js";
6
+ } from "./chunk-jd09xfx0.js";
7
7
 
8
8
  // node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Random.js
9
9
  var Random2 = Random;
@@ -3,9 +3,9 @@ import {
3
3
  runnerWebSocketProtocol2,
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2
6
- } from "./chunk-c5nwtn11.js";
7
- import"./chunk-84t0s0s2.js";
8
- import"./chunk-8g2twwm8.js";
6
+ } from "./chunk-j2psmzr4.js";
7
+ import"./chunk-q6hk9ceb.js";
8
+ import"./chunk-jd09xfx0.js";
9
9
  export {
10
10
  makeRunnerRpcClient2 as makeRunnerRpcClient,
11
11
  runnerRpcUrl2 as runnerRpcUrl,
@@ -18,13 +18,13 @@ import {
18
18
  ProgramWorkUnit,
19
19
  LoopManifest,
20
20
  RunnerRpcError
21
- } from "./chunk-8g2twwm8.js";
21
+ } from "./chunk-jd09xfx0.js";
22
22
  import {
23
23
  ManifestInvalid,
24
24
  make,
25
25
  Suspended,
26
26
  LoopCheckError
27
- } from "./chunk-0296rete.js";
27
+ } from "./chunk-h12rxyy9.js";
28
28
 
29
29
  // packages/sdk/src/program/engine.ts
30
30
  class JournalWriteFailed extends TaggedError("JournalWriteFailed") {
@@ -8,7 +8,7 @@ import {
8
8
  gen,
9
9
  fail4,
10
10
  try_,
11
- flatMap,
11
+ flatMap2,
12
12
  map3,
13
13
  catchTags,
14
14
  mapError,
@@ -21,7 +21,7 @@ import {
21
21
  FileSystem,
22
22
  Path,
23
23
  ChildProcessSpawner,
24
- make11,
24
+ make13,
25
25
  decodeUnknownEffect,
26
26
  decodeEffect,
27
27
  optionalKey,
@@ -41,14 +41,14 @@ import {
41
41
  KitAssignmentDeclaration,
42
42
  PackageDeclarations,
43
43
  RunnerRpcProtocolVersion
44
- } from "./chunk-8g2twwm8.js";
45
- import"./chunk-84t0s0s2.js";
46
- import"./chunk-c5nwtn11.js";
47
- import"./chunk-0296rete.js";
44
+ } from "./chunk-jd09xfx0.js";
45
+ import"./chunk-q6hk9ceb.js";
46
+ import"./chunk-j2psmzr4.js";
47
+ import"./chunk-h12rxyy9.js";
48
48
  import {
49
49
  describeFlag,
50
50
  Described
51
- } from "./chunk-1n61xbaq.js";
51
+ } from "./chunk-7f20xrc0.js";
52
52
 
53
53
  // packages/sdk/src/build/index.ts
54
54
  class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
@@ -96,7 +96,7 @@ var ConfigKits = Record(String2, Union([
96
96
  ]));
97
97
  var run = (command, args, cwd) => gen(function* () {
98
98
  const spawner = yield* ChildProcessSpawner;
99
- const handle = yield* spawner.spawn(make11(command, args, { cwd, stdin: "ignore" }));
99
+ const handle = yield* spawner.spawn(make13(command, args, { cwd, stdin: "ignore" }));
100
100
  const [stdout, stderr, exitCode] = yield* all([
101
101
  mkString(decodeText(handle.stdout)),
102
102
  mkString(decodeText(handle.stderr)),
@@ -178,7 +178,7 @@ var PackageJson = fromJsonString(Struct({ name: String2 }));
178
178
  var packageName = (root) => gen(function* () {
179
179
  const fs = yield* FileSystem;
180
180
  const path = yield* Path;
181
- return yield* fs.readFileString(path.join(root, "package.json")).pipe(flatMap(decodeEffect(PackageJson)), map3((manifest) => manifest.name), mapError(() => new DeclarationsInvalid({ reason: "package.json has no name" })));
181
+ return yield* fs.readFileString(path.join(root, "package.json")).pipe(flatMap2(decodeEffect(PackageJson)), map3((manifest) => manifest.name), mapError(() => new DeclarationsInvalid({ reason: "package.json has no name" })));
182
182
  });
183
183
  var duplicateLoopId = (loops) => loops.map((loop) => loop.id).find((id, index, ids) => ids.indexOf(id) !== index);
184
184
  var buildPackage = (directory) => gen(function* () {
@@ -38,7 +38,7 @@ import {
38
38
  die3,
39
39
  try_,
40
40
  yieldNow,
41
- flatMap,
41
+ flatMap2,
42
42
  andThen,
43
43
  tap,
44
44
  map3,
@@ -100,7 +100,7 @@ import {
100
100
  toCodecJson,
101
101
  Json,
102
102
  LoopCapabilities
103
- } from "./chunk-8g2twwm8.js";
103
+ } from "./chunk-jd09xfx0.js";
104
104
 
105
105
  // packages/sdk/src/loop/define.ts
106
106
  var LoopOutcome = Literals(["feature", "bug", "refactor", "investigation", "docs", "migration"]);
@@ -114,7 +114,7 @@ class ManifestInvalid extends TaggedError2()("ManifestInvalid", {
114
114
  var jsonSchemaOf = (loop, schema) => try_({
115
115
  try: () => toJsonSchemaDocument(schema),
116
116
  catch: (error) => new ManifestInvalid({ loop, message: `Schema has no JSON Schema: ${String(error)}` })
117
- }).pipe(flatMap((document) => decodeUnknownEffect(JsonObjectSchema)({ ...document.schema, $defs: document.definitions }).pipe(mapError((error) => new ManifestInvalid({ loop, message: error.message })))));
117
+ }).pipe(flatMap2((document) => decodeUnknownEffect(JsonObjectSchema)({ ...document.schema, $defs: document.definitions }).pipe(mapError((error) => new ManifestInvalid({ loop, message: error.message })))));
118
118
  var JsonObjectSchema = Record(String2, Json);
119
119
  // node_modules/.bun/effect@4.0.4/node_modules/effect/dist/workflow/internal/crypto.js
120
120
  var makeHashDigest = (original) => map3(promise(() => crypto.subtle.digest("SHA-256", new TextEncoder().encode(original))), (buffer) => {
@@ -158,7 +158,7 @@ var Proto = {
158
158
  execute(fields, opts) {
159
159
  return suspend(() => {
160
160
  const payload = this.payloadSchema.make(fields);
161
- const run = flatMap(EngineTag, (engine) => flatMap(makeExecutionIdFromPayload(this, payload), (executionId) => andThen(annotateCurrentSpan({
161
+ const run = flatMap2(EngineTag, (engine) => flatMap2(makeExecutionIdFromPayload(this, payload), (executionId) => andThen(annotateCurrentSpan({
162
162
  executionId
163
163
  }), engine.execute(this, {
164
164
  executionId,
@@ -172,7 +172,7 @@ var Proto = {
172
172
  }));
173
173
  },
174
174
  poll(executionId) {
175
- return flatMap(EngineTag, (engine) => engine.poll(this, executionId)).pipe(withSpan(`${this._tag}.poll`, {
175
+ return flatMap2(EngineTag, (engine) => engine.poll(this, executionId)).pipe(withSpan(`${this._tag}.poll`, {
176
176
  attributes: {
177
177
  executionId
178
178
  }
@@ -181,7 +181,7 @@ var Proto = {
181
181
  }));
182
182
  },
183
183
  interrupt(executionId) {
184
- return flatMap(EngineTag, (engine) => engine.interrupt(this, executionId)).pipe(withSpan(`${this._tag}.interrupt`, {
184
+ return flatMap2(EngineTag, (engine) => engine.interrupt(this, executionId)).pipe(withSpan(`${this._tag}.interrupt`, {
185
185
  attributes: {
186
186
  executionId
187
187
  }
@@ -190,7 +190,7 @@ var Proto = {
190
190
  }));
191
191
  },
192
192
  resume(executionId) {
193
- return flatMap(EngineTag, (engine) => engine.resume(this, executionId)).pipe(withSpan(`${this._tag}.resume`, {
193
+ return flatMap2(EngineTag, (engine) => engine.resume(this, executionId)).pipe(withSpan(`${this._tag}.resume`, {
194
194
  attributes: {
195
195
  executionId
196
196
  }
@@ -199,10 +199,10 @@ var Proto = {
199
199
  }));
200
200
  },
201
201
  toLayer(execute) {
202
- return effectDiscard(flatMap(EngineTag, (engine) => engine.register(this, execute)));
202
+ return effectDiscard(flatMap2(EngineTag, (engine) => engine.register(this, execute)));
203
203
  },
204
204
  executionId(payload) {
205
- return flatMap(orDie(this.payloadSchema.makeEffect(payload)), (payload) => makeExecutionIdFromPayload(this, payload));
205
+ return flatMap2(orDie(this.payloadSchema.makeEffect(payload)), (payload) => makeExecutionIdFromPayload(this, payload));
206
206
  },
207
207
  withCompensation: (...args) => withCompensation(...args)
208
208
  };
@@ -411,7 +411,7 @@ var make3 = (options) => {
411
411
  },
412
412
  execute: executeWithoutInterrupt,
413
413
  executeEncoded: matchEffect(executeWithoutInterrupt, {
414
- onFailure: (error) => flatMap(orDie(encodeEffect(errorSchemaJson)(error)), fail4),
414
+ onFailure: (error) => flatMap2(orDie(encodeEffect(errorSchemaJson)(error)), fail4),
415
415
  onSuccess: (value) => orDie(encodeEffect(successSchemaJson)(value))
416
416
  })
417
417
  };
@@ -419,7 +419,7 @@ var make3 = (options) => {
419
419
  return self;
420
420
  };
421
421
  var interruptRetryPolicy = /* @__PURE__ */ min([exponential(400, 1.5), spaced("10 seconds")]).pipe(/* @__PURE__ */ setInputType(), /* @__PURE__ */ while_((meta) => meta.attempt <= 10 && hasInterrupts(meta.input)));
422
- var retryOnInterrupt = (name, policy = interruptRetryPolicy) => (effect) => flatMap(InstanceTag3, (instance) => effect.pipe(sandbox, retry({
422
+ var retryOnInterrupt = (name, policy = interruptRetryPolicy) => (effect) => flatMap2(InstanceTag3, (instance) => effect.pipe(sandbox, retry({
423
423
  schedule: policy,
424
424
  while: () => !instance.suspended
425
425
  }), catch_((cause) => hasInterrupts(cause) && !instance.suspended ? die3(`Activity "${name}" interrupted and retry attempts exhausted`) : failCause2(cause))));
@@ -618,7 +618,7 @@ var launch = (deferred, start) => make3({
618
618
  return yield* start(yield* LoopHost, yield* token(deferred));
619
619
  })
620
620
  });
621
- var toJson = (step, schema, value) => encodeUnknownEffect(toCodecJson(schema))(value).pipe(flatMap(decodeUnknownEffect(Json)), mapError((error) => new StepFailed({ step, reason: error.message })));
621
+ var toJson = (step, schema, value) => encodeUnknownEffect(toCodecJson(schema))(value).pipe(flatMap2(decodeUnknownEffect(Json)), mapError((error) => new StepFailed({ step, reason: error.message })));
622
622
  var agentWork = (name, options) => takeStep(name, "agent_work", "agent_work", gen(function* () {
623
623
  const run = yield* LoopRun;
624
624
  const agent = run.agents[options.agent];
@@ -4,13 +4,13 @@ import {
4
4
  succeed4,
5
5
  provide2,
6
6
  gen,
7
- flatMap,
7
+ flatMap2,
8
8
  provideContext,
9
9
  runForEach,
10
10
  RunnerHeaders,
11
11
  RunnerRpcProtocolVersion,
12
12
  RunnerRpcs
13
- } from "./chunk-8g2twwm8.js";
13
+ } from "./chunk-jd09xfx0.js";
14
14
  import {
15
15
  WebSocketConstructor,
16
16
  layerWebSocketConstructorGlobal,
@@ -19,7 +19,7 @@ import {
19
19
  make5,
20
20
  withHeaders,
21
21
  layerProtocolSocket
22
- } from "./chunk-84t0s0s2.js";
22
+ } from "./chunk-q6hk9ceb.js";
23
23
 
24
24
  // packages/live/src/rpc/runner-client.ts
25
25
  var proxiedWebSocket = (proxy) => succeed4(WebSocketConstructor)((target) => {
@@ -35,7 +35,7 @@ function runnerRpcUrl2(apiUrl) {
35
35
  var makeRunnerRpcClient2 = (options) => gen(function* () {
36
36
  const protocol = yield* build2(options.protocol);
37
37
  const client = yield* make5(RunnerRpcs).pipe(provideContext(protocol));
38
- const authorized = (call) => flatMap(options.bearer, (token) => withHeaders(call, {
38
+ const authorized = (call) => flatMap2(options.bearer, (token) => withHeaders(call, {
39
39
  authorization: `Bearer ${token}`,
40
40
  [RunnerHeaders.runnerId]: options.runnerId,
41
41
  [RunnerHeaders.protocolVersion]: String(RunnerRpcProtocolVersion)