@kitman-sh/cli 0.7.5 → 0.8.0

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.
@@ -1,6 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  isString,
4
+ hasProperty,
4
5
  isTagged,
5
6
  all,
6
7
  forEach,
@@ -21,7 +22,7 @@ import {
21
22
  FileSystem,
22
23
  Path,
23
24
  ChildProcessSpawner,
24
- make13,
25
+ make8,
25
26
  decodeUnknownEffect,
26
27
  decodeEffect,
27
28
  optionalKey,
@@ -36,19 +37,20 @@ import {
36
37
  TaggedError2,
37
38
  toCodecJson,
38
39
  digestSha256,
40
+ RunnerRpcProtocolVersion
41
+ } from "./chunk-fpyy4rpd.js";
42
+ import"./chunk-fbb0fdnj.js";
43
+ import {
39
44
  AgentDeclaration,
40
45
  KitInstallationDeclaration,
41
46
  KitAssignmentDeclaration,
42
- PackageDeclarations,
43
- RunnerRpcProtocolVersion
44
- } from "./chunk-p2wk2v39.js";
45
- import"./chunk-tk0gy9wq.js";
46
- import"./chunk-1f7qe00x.js";
47
- import"./chunk-a44szh8v.js";
47
+ PackageDeclarations
48
+ } from "./chunk-2npvts4c.js";
48
49
  import {
49
50
  describeFlag,
50
51
  Described
51
- } from "./chunk-4gc7b9qt.js";
52
+ } from "./chunk-ad124cbc.js";
53
+ import"./chunk-8m4wzjt8.js";
52
54
 
53
55
  // packages/sdk/src/build/index.ts
54
56
  class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
@@ -96,7 +98,7 @@ var ConfigKits = Record(String2, Union([
96
98
  ]));
97
99
  var run = (command, args, cwd) => gen(function* () {
98
100
  const spawner = yield* ChildProcessSpawner;
99
- const handle = yield* spawner.spawn(make13(command, args, { cwd, stdin: "ignore" }));
101
+ const handle = yield* spawner.spawn(make8(command, args, { cwd, stdin: "ignore" }));
100
102
  const [stdout, stderr, exitCode] = yield* all([
101
103
  mkString(decodeText(handle.stdout)),
102
104
  mkString(decodeText(handle.stderr)),
@@ -180,6 +182,10 @@ var packageName = (root) => gen(function* () {
180
182
  const path = yield* Path;
181
183
  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
184
  });
185
+ var renamedKey = (declarations, what, from, to) => {
186
+ const key = Object.keys(declarations ?? {}).find((key) => hasProperty(declarations?.[key], from));
187
+ return key === undefined ? undefined : new DeclarationsInvalid({ reason: `${what} "${key}" names \`${from}\`, which is now \`${to}\`` });
188
+ };
183
189
  var duplicateLoopId = (loops) => loops.map((loop) => loop.id).find((id, index, ids) => ids.indexOf(id) !== index);
184
190
  var buildPackage = (directory) => gen(function* () {
185
191
  const fs = yield* FileSystem;
@@ -210,6 +216,9 @@ runPackage(config)
210
216
  const duplicate = duplicateLoopId(result.loops);
211
217
  if (duplicate !== undefined)
212
218
  return yield* new DeclarationsInvalid({ reason: `Loop "${duplicate}" is declared twice` });
219
+ const renamed = renamedKey(result.schedules, "Schedule", "project", "team") ?? renamedKey(result.schedules, "Schedule", "codebase", "team") ?? renamedKey(result.kits, "Kit", "projects", "teams") ?? renamedKey(result.kits, "Kit", "codebases", "teams");
220
+ if (renamed !== undefined)
221
+ return yield* renamed;
213
222
  const agents = yield* decodeUnknownEffect(ConfigAgents)(result.agents).pipe(mapError((error) => new DeclarationsInvalid({ reason: error.message })));
214
223
  const kits = result.kits === undefined ? undefined : yield* decodeUnknownEffect(ConfigKits)(result.kits).pipe(mapError((error) => new DeclarationsInvalid({ reason: error.message })));
215
224
  const declarations = yield* decodeUnknownEffect(PackageDeclarations)({
@@ -7,19 +7,19 @@ import {
7
7
  flatMap2,
8
8
  provideContext,
9
9
  runForEach,
10
+ WebSocketConstructor,
11
+ layerWebSocketConstructorGlobal,
12
+ layerWebSocket,
10
13
  RunnerHeaders,
11
14
  RunnerRpcProtocolVersion,
12
15
  RunnerRpcs
13
- } from "./chunk-p2wk2v39.js";
16
+ } from "./chunk-fpyy4rpd.js";
14
17
  import {
15
- WebSocketConstructor,
16
- layerWebSocketConstructorGlobal,
17
- layerWebSocket,
18
18
  layerJson,
19
- make5,
19
+ make4,
20
20
  withHeaders,
21
21
  layerProtocolSocket
22
- } from "./chunk-tk0gy9wq.js";
22
+ } from "./chunk-8m4wzjt8.js";
23
23
 
24
24
  // packages/live/src/rpc/runner-client.ts
25
25
  var proxiedWebSocket = (proxy) => succeed4(WebSocketConstructor)((target) => {
@@ -34,7 +34,7 @@ function runnerRpcUrl2(apiUrl) {
34
34
  }
35
35
  var makeRunnerRpcClient2 = (options) => gen(function* () {
36
36
  const protocol = yield* build2(options.protocol);
37
- const client = yield* make5(RunnerRpcs).pipe(provideContext(protocol));
37
+ const client = yield* make4(RunnerRpcs).pipe(provideContext(protocol));
38
38
  const authorized = (call) => flatMap2(options.bearer, (token) => withHeaders(call, {
39
39
  authorization: `Bearer ${token}`,
40
40
  [RunnerHeaders.runnerId]: options.runnerId,
@@ -58,15 +58,26 @@ var makeRunnerRpcClient2 = (options) => gen(function* () {
58
58
  awaitEvent: (input) => authorized(client.AwaitEvent(input)),
59
59
  admitChild: (input) => authorized(client.AdmitChild(input)),
60
60
  storeArtifact: (input) => authorized(client.StoreArtifact(input)),
61
+ createRunFile: (input) => authorized(client.CreateRunFile(input)),
62
+ runFileParts: (input) => authorized(client.RunFileParts(input)),
63
+ completeRunFile: (input) => authorized(client.CompleteRunFile(input)),
61
64
  recordNote: (input) => authorized(client.RecordNote(input)),
62
65
  performHostEffect: (input) => authorized(client.PerformHostEffect(input)),
63
66
  createPlanTasks: (input) => authorized(client.CreatePlanTasks(input)),
67
+ readTranscripts: (input) => authorized(client.ReadTranscripts(input)),
68
+ propose: (input) => authorized(client.Propose(input)),
69
+ readProject: (input) => authorized(client.ReadProject(input)),
70
+ draftUpdate: (input) => authorized(client.DraftUpdate(input)),
64
71
  integrationBranch: (input) => authorized(client.IntegrationBranch(input)),
65
72
  mergeChangeRequest: (input) => authorized(client.MergeChangeRequest(input)),
66
73
  publishRelease: (input) => authorized(client.PublishRelease(input)),
67
74
  bundle: (digest) => authorized(client.Bundle({ digest })),
68
75
  settledRuns: (runIds) => authorized(client.SettledRuns({ runIds })),
69
76
  reportSteer: (input) => authorized(client.ReportSteer(input)),
77
+ appendTranscript: (input) => authorized(client.AppendTranscript(input)),
78
+ createCheckpointFile: (input) => authorized(client.CreateCheckpointFile(input)),
79
+ checkpointFileParts: (input) => authorized(client.CheckpointFileParts(input)),
80
+ completeCheckpointFile: (input) => authorized(client.CompleteCheckpointFile(input)),
70
81
  saveCheckpoint: (input) => authorized(client.SaveCheckpoint(input)),
71
82
  resumeCheckpoint: (input) => authorized(client.ResumeCheckpoint(input)),
72
83
  settledCheckpoints: authorized(client.SettledCheckpoints()),