@kitman-sh/cli 0.7.3 → 0.7.5
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-80g9af03.js → chunk-0pre510a.js} +2 -2
- package/dist/{chunk-c5nwtn11.js → chunk-1f7qe00x.js} +4 -4
- package/dist/{chunk-1n61xbaq.js → chunk-4gc7b9qt.js} +2 -2
- package/dist/{chunk-nvf0begz.js → chunk-64cz9grx.js} +36 -42
- package/dist/{chunk-0296rete.js → chunk-a44szh8v.js} +12 -12
- package/dist/{chunk-yysejjz0.js → chunk-hpfcwnd9.js} +9 -9
- package/dist/{chunk-8g2twwm8.js → chunk-p2wk2v39.js} +512 -262
- package/dist/{chunk-x6j2j12j.js → chunk-sq2brwmh.js} +1 -1
- package/dist/{chunk-84t0s0s2.js → chunk-tk0gy9wq.js} +5 -5
- package/dist/{chunk-kt08et8q.js → chunk-vz3v0f4j.js} +718 -263
- package/dist/{chunk-zc0ebz8f.js → chunk-xnzxpert.js} +3 -3
- package/dist/index.js +133 -247
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
import {
|
|
4
|
-
pipeArguments,
|
|
5
4
|
identity,
|
|
6
5
|
isUndefined,
|
|
7
6
|
isNotUndefined,
|
|
@@ -20,12 +19,8 @@ import {
|
|
|
20
19
|
fromUndefinedOr,
|
|
21
20
|
getOrUndefined,
|
|
22
21
|
Service,
|
|
23
|
-
add,
|
|
24
|
-
get,
|
|
25
22
|
Reference,
|
|
26
23
|
of,
|
|
27
|
-
fromInputUnsafe,
|
|
28
|
-
isFinite,
|
|
29
24
|
toMillis,
|
|
30
25
|
TaggedError,
|
|
31
26
|
squash,
|
|
@@ -34,19 +29,12 @@ import {
|
|
|
34
29
|
UnknownError,
|
|
35
30
|
succeed2,
|
|
36
31
|
fail2,
|
|
37
|
-
void_,
|
|
38
|
-
isSuccess2,
|
|
39
|
-
isFailure2,
|
|
40
32
|
makeUnsafe,
|
|
41
33
|
_await,
|
|
42
34
|
isDone,
|
|
43
35
|
isDoneUnsafe,
|
|
44
36
|
doneUnsafe,
|
|
45
|
-
Scope,
|
|
46
|
-
makeUnsafe2,
|
|
47
|
-
addFinalizerExit,
|
|
48
37
|
addFinalizer,
|
|
49
|
-
close,
|
|
50
38
|
succeed4,
|
|
51
39
|
effect,
|
|
52
40
|
mergeAll,
|
|
@@ -66,8 +54,7 @@ import {
|
|
|
66
54
|
gen,
|
|
67
55
|
fail4,
|
|
68
56
|
try_,
|
|
69
|
-
|
|
70
|
-
flatMap,
|
|
57
|
+
flatMap2,
|
|
71
58
|
andThen,
|
|
72
59
|
tap,
|
|
73
60
|
map3,
|
|
@@ -86,31 +73,22 @@ import {
|
|
|
86
73
|
provide3,
|
|
87
74
|
provideContext,
|
|
88
75
|
provideService,
|
|
89
|
-
scope,
|
|
90
76
|
scoped,
|
|
91
77
|
acquireRelease,
|
|
92
78
|
addFinalizer2,
|
|
93
79
|
ensuring,
|
|
94
|
-
onExit,
|
|
95
|
-
interrupt2,
|
|
96
80
|
uninterruptible,
|
|
97
|
-
uninterruptibleMask,
|
|
98
81
|
forever,
|
|
99
82
|
forkScoped,
|
|
100
|
-
runForkWith,
|
|
101
83
|
fnUntraced,
|
|
102
84
|
logWarning,
|
|
103
85
|
logError,
|
|
104
86
|
runMain,
|
|
105
87
|
systemError,
|
|
106
88
|
badArgument,
|
|
107
|
-
join,
|
|
108
|
-
interrupt3,
|
|
109
|
-
getCurrent,
|
|
110
|
-
runIn,
|
|
111
89
|
makeUnsafe3,
|
|
112
|
-
make7,
|
|
113
90
|
make8,
|
|
91
|
+
make9,
|
|
114
92
|
offerUnsafe,
|
|
115
93
|
endUnsafe,
|
|
116
94
|
take,
|
|
@@ -120,6 +98,8 @@ import {
|
|
|
120
98
|
isSink,
|
|
121
99
|
fromChannel,
|
|
122
100
|
drain,
|
|
101
|
+
make10,
|
|
102
|
+
get2,
|
|
123
103
|
isStream,
|
|
124
104
|
fromChannel2,
|
|
125
105
|
empty2,
|
|
@@ -135,9 +115,9 @@ import {
|
|
|
135
115
|
ExitCode,
|
|
136
116
|
ProcessId,
|
|
137
117
|
makeHandle,
|
|
138
|
-
|
|
118
|
+
make12,
|
|
139
119
|
ChildProcessSpawner,
|
|
140
|
-
|
|
120
|
+
make13,
|
|
141
121
|
parseFdName,
|
|
142
122
|
fdName,
|
|
143
123
|
handleErrnoException,
|
|
@@ -163,7 +143,7 @@ import {
|
|
|
163
143
|
RepoBindingCredentialProviderTypes,
|
|
164
144
|
AgentHarnessIds,
|
|
165
145
|
redactDurableSurface,
|
|
166
|
-
|
|
146
|
+
RunDisplayStates,
|
|
167
147
|
KitmanAgentCapabilityNames,
|
|
168
148
|
DecisionStatuses,
|
|
169
149
|
FixFlowRecoveryActions,
|
|
@@ -172,6 +152,7 @@ import {
|
|
|
172
152
|
KitInstallationScopes,
|
|
173
153
|
KitCreate,
|
|
174
154
|
KitUpdate,
|
|
155
|
+
runDisplayLabels,
|
|
175
156
|
repositoryKey,
|
|
176
157
|
defaultRunnerCapabilities,
|
|
177
158
|
isSyncKitHashValid,
|
|
@@ -203,8 +184,8 @@ import {
|
|
|
203
184
|
agentCredentialForApi,
|
|
204
185
|
storeAgentCredential,
|
|
205
186
|
raw,
|
|
206
|
-
|
|
207
|
-
|
|
187
|
+
make14,
|
|
188
|
+
get3,
|
|
208
189
|
put,
|
|
209
190
|
execute,
|
|
210
191
|
Fetch,
|
|
@@ -227,146 +208,7 @@ import {
|
|
|
227
208
|
runCommand2,
|
|
228
209
|
detectHarnesses2,
|
|
229
210
|
herdrRunnerCapabilities2
|
|
230
|
-
} from "./chunk-
|
|
231
|
-
|
|
232
|
-
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/internal/rcRef.js
|
|
233
|
-
var TypeId = "~effect/RcRef";
|
|
234
|
-
var stateEmpty = {
|
|
235
|
-
_tag: "Empty"
|
|
236
|
-
};
|
|
237
|
-
var stateClosed = {
|
|
238
|
-
_tag: "Closed"
|
|
239
|
-
};
|
|
240
|
-
var variance = {
|
|
241
|
-
_A: identity,
|
|
242
|
-
_E: identity
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
class RcRefImpl {
|
|
246
|
-
[TypeId] = variance;
|
|
247
|
-
pipe() {
|
|
248
|
-
return pipeArguments(this, arguments);
|
|
249
|
-
}
|
|
250
|
-
state = stateEmpty;
|
|
251
|
-
acquire;
|
|
252
|
-
context;
|
|
253
|
-
scope;
|
|
254
|
-
idleTimeToLive;
|
|
255
|
-
constructor(acquire, context, scope, idleTimeToLive) {
|
|
256
|
-
this.acquire = acquire;
|
|
257
|
-
this.context = context;
|
|
258
|
-
this.scope = scope;
|
|
259
|
-
this.idleTimeToLive = idleTimeToLive;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
var make = (options) => withFiber((fiber) => {
|
|
263
|
-
const context = fiber.context;
|
|
264
|
-
const scope = get(context, Scope);
|
|
265
|
-
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
|
|
266
|
-
return as(addFinalizerExit(scope, () => {
|
|
267
|
-
const state = ref.state;
|
|
268
|
-
ref.state = stateClosed;
|
|
269
|
-
if (state._tag === "Acquired")
|
|
270
|
-
return close(state.scope, void_);
|
|
271
|
-
if (state._tag === "Acquiring")
|
|
272
|
-
return interrupt3(state.fiber);
|
|
273
|
-
return void_2;
|
|
274
|
-
}), ref);
|
|
275
|
-
});
|
|
276
|
-
var getState = (self, restore) => {
|
|
277
|
-
switch (self.state._tag) {
|
|
278
|
-
case "Closed": {
|
|
279
|
-
return interrupt2;
|
|
280
|
-
}
|
|
281
|
-
case "Acquired": {
|
|
282
|
-
const state = self.state;
|
|
283
|
-
state.refCount++;
|
|
284
|
-
return state.fiber ? as(interrupt3(state.fiber), state) : succeed5(state);
|
|
285
|
-
}
|
|
286
|
-
case "Acquiring": {
|
|
287
|
-
const state = self.state;
|
|
288
|
-
state.awaiters++;
|
|
289
|
-
return awaitAcquiring(self, state, restore);
|
|
290
|
-
}
|
|
291
|
-
case "Empty": {
|
|
292
|
-
const acquiring = {
|
|
293
|
-
_tag: "Acquiring",
|
|
294
|
-
fiber: undefined,
|
|
295
|
-
awaiters: 1,
|
|
296
|
-
acquired: undefined
|
|
297
|
-
};
|
|
298
|
-
self.state = acquiring;
|
|
299
|
-
const scope = makeUnsafe2();
|
|
300
|
-
const acquire = provideContext(self.acquire, add(self.context, Scope, scope)).pipe(flatMap((value) => {
|
|
301
|
-
if (self.state !== acquiring) {
|
|
302
|
-
return interrupt2;
|
|
303
|
-
}
|
|
304
|
-
const state = {
|
|
305
|
-
_tag: "Acquired",
|
|
306
|
-
value,
|
|
307
|
-
scope,
|
|
308
|
-
fiber: undefined,
|
|
309
|
-
refCount: acquiring.awaiters,
|
|
310
|
-
invalidated: false
|
|
311
|
-
};
|
|
312
|
-
self.state = state;
|
|
313
|
-
acquiring.acquired = state;
|
|
314
|
-
return succeed5(state);
|
|
315
|
-
}), onExit((exit) => {
|
|
316
|
-
if (isSuccess2(exit))
|
|
317
|
-
return void_2;
|
|
318
|
-
if (self.state === acquiring)
|
|
319
|
-
self.state = stateEmpty;
|
|
320
|
-
return close(scope, exit);
|
|
321
|
-
}));
|
|
322
|
-
acquiring.fiber = runForkWith(getCurrent().context)(acquire);
|
|
323
|
-
return awaitAcquiring(self, acquiring, restore);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join(acquiring.fiber)), (exit) => {
|
|
328
|
-
const acquired = acquiring.acquired;
|
|
329
|
-
if (acquired !== undefined) {
|
|
330
|
-
return isFailure2(exit) ? release(self, acquired) : void_2;
|
|
331
|
-
}
|
|
332
|
-
if (--acquiring.awaiters > 0 || self.state !== acquiring)
|
|
333
|
-
return void_2;
|
|
334
|
-
self.state = stateEmpty;
|
|
335
|
-
return interrupt3(acquiring.fiber);
|
|
336
|
-
});
|
|
337
|
-
var get3 = (self_) => {
|
|
338
|
-
const self = self_;
|
|
339
|
-
return uninterruptibleMask((restore) => flatMap(scope, (scope) => flatMap(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
|
|
340
|
-
};
|
|
341
|
-
var release = (self, state) => {
|
|
342
|
-
state.refCount--;
|
|
343
|
-
if (state.refCount > 0) {
|
|
344
|
-
return void_2;
|
|
345
|
-
}
|
|
346
|
-
const idleTimeToLive = self.idleTimeToLive;
|
|
347
|
-
if (idleTimeToLive === undefined || state.invalidated) {
|
|
348
|
-
if (self.state === state) {
|
|
349
|
-
self.state = stateEmpty;
|
|
350
|
-
}
|
|
351
|
-
return close(state.scope, void_);
|
|
352
|
-
} else if (!isFinite(idleTimeToLive)) {
|
|
353
|
-
return void_2;
|
|
354
|
-
}
|
|
355
|
-
state.fiber = uninterruptibleMask((restore) => flatMap(restore(sleep(idleTimeToLive)), () => {
|
|
356
|
-
if (self.state === state && state.refCount === 0) {
|
|
357
|
-
self.state = stateEmpty;
|
|
358
|
-
return close(state.scope, void_);
|
|
359
|
-
}
|
|
360
|
-
return void_2;
|
|
361
|
-
})).pipe(ensuring(sync(() => {
|
|
362
|
-
state.fiber = undefined;
|
|
363
|
-
})), runForkWith(self.context), runIn(self.scope));
|
|
364
|
-
return void_2;
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/RcRef.js
|
|
368
|
-
var make2 = make;
|
|
369
|
-
var get4 = get3;
|
|
211
|
+
} from "./chunk-p2wk2v39.js";
|
|
370
212
|
|
|
371
213
|
// node_modules/.bun/@effect+platform-node-shared@4.0.4+b8cbb99ebc524863/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
372
214
|
import * as NodeChildProcess from "child_process";
|
|
@@ -393,7 +235,7 @@ var fromWritableChannel = (options) => fromTransform((pull) => {
|
|
|
393
235
|
pull
|
|
394
236
|
}));
|
|
395
237
|
});
|
|
396
|
-
var pullIntoWritable = (options) => options.pull.pipe(
|
|
238
|
+
var pullIntoWritable = (options) => options.pull.pipe(flatMap2((chunk) => {
|
|
397
239
|
let i = 0;
|
|
398
240
|
return callback((resume) => {
|
|
399
241
|
let cancelled = false;
|
|
@@ -454,7 +296,7 @@ var fromReadableChannel = (options) => fromTransform((_, scope) => readableToPul
|
|
|
454
296
|
var readableToPullUnsafe = (options) => {
|
|
455
297
|
const readable = options.readable;
|
|
456
298
|
const closeOnDone = options.closeOnDone ?? true;
|
|
457
|
-
const exit = options.exit ??
|
|
299
|
+
const exit = options.exit ?? make8(undefined);
|
|
458
300
|
const latch = options.latch ?? makeUnsafe3(false);
|
|
459
301
|
function onReadable() {
|
|
460
302
|
latch.openUnsafe();
|
|
@@ -480,7 +322,7 @@ var readableToPullUnsafe = (options) => {
|
|
|
480
322
|
return fail4(Done());
|
|
481
323
|
}
|
|
482
324
|
latch.closeUnsafe();
|
|
483
|
-
return
|
|
325
|
+
return flatMap2(latch.await, loop);
|
|
484
326
|
}
|
|
485
327
|
const chunk = of(item);
|
|
486
328
|
while (true) {
|
|
@@ -544,7 +386,7 @@ var taskkill = (childProcess, onExit = () => {}) => {
|
|
|
544
386
|
windowsHide: true
|
|
545
387
|
}, onExit);
|
|
546
388
|
};
|
|
547
|
-
var
|
|
389
|
+
var make = /* @__PURE__ */ gen(function* () {
|
|
548
390
|
const fs = yield* FileSystem;
|
|
549
391
|
const path = yield* Path;
|
|
550
392
|
const resolveWorkingDirectory = fnUntraced(function* (options) {
|
|
@@ -910,7 +752,7 @@ var make3 = /* @__PURE__ */ gen(function* () {
|
|
|
910
752
|
getOutputFd
|
|
911
753
|
} = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);
|
|
912
754
|
const isRunning = map3(isDone(exitSignal), (done) => !done);
|
|
913
|
-
const exitCode =
|
|
755
|
+
const exitCode = flatMap2(_await(exitSignal), ([code, signal]) => {
|
|
914
756
|
if (isNotNull(code)) {
|
|
915
757
|
return succeed5(ExitCode(code));
|
|
916
758
|
}
|
|
@@ -946,7 +788,7 @@ var make3 = /* @__PURE__ */ gen(function* () {
|
|
|
946
788
|
const sourceStream = unwrap(succeed5(getSourceStream(handles[handles.length - 1], options.from)));
|
|
947
789
|
const toOption = options.to ?? "stdin";
|
|
948
790
|
if (toOption === "stdin") {
|
|
949
|
-
handles.push(yield* spawnCommand(
|
|
791
|
+
handles.push(yield* spawnCommand(make13(command.command, command.args, {
|
|
950
792
|
...command.options,
|
|
951
793
|
stdin: {
|
|
952
794
|
...stdinConfig,
|
|
@@ -958,7 +800,7 @@ var make3 = /* @__PURE__ */ gen(function* () {
|
|
|
958
800
|
if (isNotUndefined(fd)) {
|
|
959
801
|
const fdName2 = fdName(fd);
|
|
960
802
|
const existingFds = command.options.additionalFds ?? {};
|
|
961
|
-
handles.push(yield* spawnCommand(
|
|
803
|
+
handles.push(yield* spawnCommand(make13(command.command, command.args, {
|
|
962
804
|
...command.options,
|
|
963
805
|
additionalFds: {
|
|
964
806
|
...existingFds,
|
|
@@ -969,7 +811,7 @@ var make3 = /* @__PURE__ */ gen(function* () {
|
|
|
969
811
|
}
|
|
970
812
|
})));
|
|
971
813
|
} else {
|
|
972
|
-
handles.push(yield* spawnCommand(
|
|
814
|
+
handles.push(yield* spawnCommand(make13(command.command, command.args, {
|
|
973
815
|
...command.options,
|
|
974
816
|
stdin: {
|
|
975
817
|
...stdinConfig,
|
|
@@ -1008,9 +850,9 @@ var make3 = /* @__PURE__ */ gen(function* () {
|
|
|
1008
850
|
}
|
|
1009
851
|
}
|
|
1010
852
|
});
|
|
1011
|
-
return
|
|
853
|
+
return make12(spawnCommand);
|
|
1012
854
|
});
|
|
1013
|
-
var layer5 = /* @__PURE__ */ effect(ChildProcessSpawner,
|
|
855
|
+
var layer5 = /* @__PURE__ */ effect(ChildProcessSpawner, make);
|
|
1014
856
|
var flattenCommand = (command) => {
|
|
1015
857
|
const commands = [];
|
|
1016
858
|
const pipeOptions = [];
|
|
@@ -1041,10 +883,10 @@ var flattenCommand = (command) => {
|
|
|
1041
883
|
};
|
|
1042
884
|
|
|
1043
885
|
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Stdio.js
|
|
1044
|
-
var
|
|
1045
|
-
var Stdio = /* @__PURE__ */ Service(
|
|
1046
|
-
var
|
|
1047
|
-
[
|
|
886
|
+
var TypeId = "~effect/Stdio";
|
|
887
|
+
var Stdio = /* @__PURE__ */ Service(TypeId);
|
|
888
|
+
var make2 = (options) => ({
|
|
889
|
+
[TypeId]: TypeId,
|
|
1048
890
|
stdinIsTerminal: succeed5(false),
|
|
1049
891
|
stdoutIsTerminal: succeed5(false),
|
|
1050
892
|
stderrIsTerminal: succeed5(false),
|
|
@@ -1052,7 +894,7 @@ var make4 = (options) => ({
|
|
|
1052
894
|
});
|
|
1053
895
|
|
|
1054
896
|
// node_modules/.bun/@effect+platform-node-shared@4.0.4+b8cbb99ebc524863/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
|
|
1055
|
-
var layer6 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */
|
|
897
|
+
var layer6 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */ make2({
|
|
1056
898
|
args: /* @__PURE__ */ sync(() => process.argv.slice(2)),
|
|
1057
899
|
stdinIsTerminal: /* @__PURE__ */ sync(() => process.stdin.isTTY === true),
|
|
1058
900
|
stdoutIsTerminal: /* @__PURE__ */ sync(() => process.stdout.isTTY === true),
|
|
@@ -1093,7 +935,7 @@ var layer6 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */ make4({
|
|
|
1093
935
|
var layer7 = layer6;
|
|
1094
936
|
|
|
1095
937
|
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Terminal.js
|
|
1096
|
-
var
|
|
938
|
+
var TypeId2 = "~effect/Terminal";
|
|
1097
939
|
var QuitErrorTypeId = "~effect/Terminal/QuitError";
|
|
1098
940
|
|
|
1099
941
|
class QuitError extends (/* @__PURE__ */ Error2("QuitError")({
|
|
@@ -1102,17 +944,17 @@ class QuitError extends (/* @__PURE__ */ Error2("QuitError")({
|
|
|
1102
944
|
[QuitErrorTypeId] = QuitErrorTypeId;
|
|
1103
945
|
}
|
|
1104
946
|
var Terminal = /* @__PURE__ */ Service("effect/Terminal");
|
|
1105
|
-
var
|
|
947
|
+
var make3 = (impl) => Terminal.of({
|
|
1106
948
|
...impl,
|
|
1107
|
-
[
|
|
949
|
+
[TypeId2]: TypeId2
|
|
1108
950
|
});
|
|
1109
951
|
|
|
1110
952
|
// node_modules/.bun/@effect+platform-node-shared@4.0.4+b8cbb99ebc524863/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
|
|
1111
953
|
import * as readline from "readline";
|
|
1112
|
-
var
|
|
954
|
+
var make4 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
1113
955
|
const stdin = process.stdin;
|
|
1114
956
|
const stdout = process.stdout;
|
|
1115
|
-
const lines = yield*
|
|
957
|
+
const lines = yield* make9();
|
|
1116
958
|
let inputEnded = stdin.readableEnded;
|
|
1117
959
|
let readlineActive = false;
|
|
1118
960
|
const onStdinEnd = () => {
|
|
@@ -1123,7 +965,7 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
1123
965
|
};
|
|
1124
966
|
stdin.once("end", onStdinEnd);
|
|
1125
967
|
yield* addFinalizer2(() => sync(() => stdin.off("end", onStdinEnd)));
|
|
1126
|
-
const rlRef = yield*
|
|
968
|
+
const rlRef = yield* make10({
|
|
1127
969
|
acquire: acquireRelease(sync(() => {
|
|
1128
970
|
const rl = readline.createInterface({
|
|
1129
971
|
input: stdin,
|
|
@@ -1167,7 +1009,7 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
1167
1009
|
const columns = sync(() => stdout.columns ?? 0);
|
|
1168
1010
|
const rows = sync(() => stdout.rows ?? 0);
|
|
1169
1011
|
const readInput = gen(function* () {
|
|
1170
|
-
const queue = yield*
|
|
1012
|
+
const queue = yield* make9();
|
|
1171
1013
|
const handleKeypress = (s, k) => {
|
|
1172
1014
|
const userInput = {
|
|
1173
1015
|
input: fromUndefinedOr(s),
|
|
@@ -1197,13 +1039,13 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
1197
1039
|
if (inputEnded) {
|
|
1198
1040
|
handleEnd();
|
|
1199
1041
|
} else {
|
|
1200
|
-
yield*
|
|
1042
|
+
yield* get2(rlRef);
|
|
1201
1043
|
stdin.once("end", handleEnd);
|
|
1202
1044
|
}
|
|
1203
1045
|
return queue;
|
|
1204
1046
|
});
|
|
1205
|
-
const readLine = suspend(() => poll(lines).pipe(
|
|
1206
|
-
onNone: () => scoped(andThen(
|
|
1047
|
+
const readLine = suspend(() => poll(lines).pipe(flatMap2(match({
|
|
1048
|
+
onNone: () => scoped(andThen(get2(rlRef), take(lines))),
|
|
1207
1049
|
onSome: succeed5
|
|
1208
1050
|
})), mapError(() => new QuitError({}))));
|
|
1209
1051
|
const display = (prompt2) => uninterruptible(callback((resume) => {
|
|
@@ -1214,7 +1056,7 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
1214
1056
|
cause: err
|
|
1215
1057
|
}))));
|
|
1216
1058
|
}));
|
|
1217
|
-
return
|
|
1059
|
+
return make3({
|
|
1218
1060
|
columns,
|
|
1219
1061
|
rows,
|
|
1220
1062
|
readInput,
|
|
@@ -1222,7 +1064,7 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
1222
1064
|
display
|
|
1223
1065
|
});
|
|
1224
1066
|
});
|
|
1225
|
-
var layer8 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */
|
|
1067
|
+
var layer8 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make4(defaultShouldQuit));
|
|
1226
1068
|
function defaultShouldQuit(input) {
|
|
1227
1069
|
const key = input.key;
|
|
1228
1070
|
return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
|
|
@@ -1334,7 +1176,7 @@ function renderMaterializationPlan(plan) {
|
|
|
1334
1176
|
harness: plan.harness,
|
|
1335
1177
|
operations: plan.operations.map((operation) => ({
|
|
1336
1178
|
kind: operation.kind,
|
|
1337
|
-
skillName: operation
|
|
1179
|
+
skillName: auditOperationName(operation),
|
|
1338
1180
|
skillIdentityHash: hashIdentity(auditOperationIdentity(operation)),
|
|
1339
1181
|
target: operation.kind === "symlink_skill" ? operation.targetPath : operation.path
|
|
1340
1182
|
})),
|
|
@@ -1361,11 +1203,24 @@ function renderConfigPlan(plan) {
|
|
|
1361
1203
|
warnings: plan.warnings.map((warning) => warning.message)
|
|
1362
1204
|
};
|
|
1363
1205
|
}
|
|
1206
|
+
function auditOperationName(operation) {
|
|
1207
|
+
if (operation.kind === "fetch_git_plugin")
|
|
1208
|
+
return operation.pluginName;
|
|
1209
|
+
if (operation.kind === "write_codex_marketplace" || operation.kind === "unlink_stale_links")
|
|
1210
|
+
return "kitman";
|
|
1211
|
+
return operation.skillName;
|
|
1212
|
+
}
|
|
1364
1213
|
function auditOperationIdentity(operation) {
|
|
1365
1214
|
if (operation.kind === "write_skill")
|
|
1366
1215
|
return `write_skill:${operation.skillName}:content_sha256:${hashIdentity(operation.content)}:${operation.path}`;
|
|
1367
1216
|
if (operation.kind === "fetch_git_skill")
|
|
1368
1217
|
return `fetch_git_skill:${operation.skillName}:${operation.url}#${operation.ref}:${operation.repositoryPath ?? ""}:${operation.path}`;
|
|
1218
|
+
if (operation.kind === "fetch_git_plugin")
|
|
1219
|
+
return `fetch_git_plugin:${operation.pluginName}:${operation.url}#${operation.ref}:${operation.path}`;
|
|
1220
|
+
if (operation.kind === "write_codex_marketplace")
|
|
1221
|
+
return `write_codex_marketplace:content_sha256:${hashIdentity(operation.content)}:${operation.path}`;
|
|
1222
|
+
if (operation.kind === "unlink_stale_links")
|
|
1223
|
+
return `unlink_stale_links:${operation.sourceRoot}:${operation.keepPaths.join(",")}:${operation.path}`;
|
|
1369
1224
|
return `symlink_skill:${operation.skillName}:symlink:${operation.sourcePath}:${operation.targetPath}`;
|
|
1370
1225
|
}
|
|
1371
1226
|
function auditMaterializedSkillIdentity(skill) {
|
|
@@ -1472,7 +1327,7 @@ function createOperationalCliClient(client) {
|
|
|
1472
1327
|
};
|
|
1473
1328
|
}
|
|
1474
1329
|
function parseJsonInput(value, label) {
|
|
1475
|
-
return decodeJsonString(value).pipe(mapError(() => new CliError({ message: `${label} requires valid JSON` })),
|
|
1330
|
+
return decodeJsonString(value).pipe(mapError(() => new CliError({ message: `${label} requires valid JSON` })), flatMap2((json) => isJsonObject(json) ? succeed5(json) : fail4(new CliError({ message: `${label} requires a JSON object` }))));
|
|
1476
1331
|
}
|
|
1477
1332
|
function idempotencyKey(value, operation) {
|
|
1478
1333
|
const explicit = value?.trim();
|
|
@@ -1531,7 +1386,7 @@ import { hostname } from "os";
|
|
|
1531
1386
|
var Git = Reference("kitman/cli/Git", {
|
|
1532
1387
|
defaultValue: () => (args) => runCommand2("git", args).pipe(map3((stdout) => stdout.trim()))
|
|
1533
1388
|
});
|
|
1534
|
-
var repoBindingInputFromCurrentRepo =
|
|
1389
|
+
var repoBindingInputFromCurrentRepo = flatMap2(Git, repoBindingInput);
|
|
1535
1390
|
function repoBindingInput(git) {
|
|
1536
1391
|
return gen(function* () {
|
|
1537
1392
|
const remoteUrl = yield* git(["remote", "get-url", "origin"]);
|
|
@@ -1794,7 +1649,7 @@ var kitmanCommand = () => {
|
|
|
1794
1649
|
const [runtime, script] = process.argv;
|
|
1795
1650
|
return script === undefined || script.startsWith("/$bunfs/") ? [process.execPath] : [runtime ?? process.execPath, script];
|
|
1796
1651
|
};
|
|
1797
|
-
var readText = (path) =>
|
|
1652
|
+
var readText = (path) => flatMap2(FileSystem, (fs) => fs.readFileString(path)).pipe(orElseSucceed(() => {
|
|
1798
1653
|
return;
|
|
1799
1654
|
}));
|
|
1800
1655
|
var verificationStep = (client, projectId, binding, confirm, step) => gen(function* () {
|
|
@@ -1933,7 +1788,7 @@ var package_default = {
|
|
|
1933
1788
|
};
|
|
1934
1789
|
|
|
1935
1790
|
// apps/cli/src/scaffold.ts
|
|
1936
|
-
var cliVersion = "0.7.
|
|
1791
|
+
var cliVersion = "0.7.5";
|
|
1937
1792
|
var packageJson = (name, scaffold) => `${JSON.stringify({
|
|
1938
1793
|
name,
|
|
1939
1794
|
private: true,
|
|
@@ -2053,7 +1908,7 @@ var scaffoldPackage = (directory, scaffold = {}) => gen(function* () {
|
|
|
2053
1908
|
const path = yield* Path;
|
|
2054
1909
|
const root = path.resolve(directory);
|
|
2055
1910
|
if (scaffold.fork !== undefined) {
|
|
2056
|
-
const { shippedLoops } = yield* promise(() => import("./chunk-
|
|
1911
|
+
const { shippedLoops } = yield* promise(() => import("./chunk-0pre510a.js"));
|
|
2057
1912
|
if (!(scaffold.fork in shippedLoops))
|
|
2058
1913
|
return yield* new CliError({
|
|
2059
1914
|
message: `Kitman ships no Loop ${scaffold.fork}; fork one of ${Object.keys(shippedLoops).join(", ")}`
|
|
@@ -2096,7 +1951,7 @@ var Usage = [
|
|
|
2096
1951
|
" kitman run show <run>",
|
|
2097
1952
|
" kitman run intent <run> [--set-goal <text>] [--add-constraint <text>] [--remove-constraint <id>] [--corrections on|off]",
|
|
2098
1953
|
" kitman run drift <run> [--dismiss <constraint> --reason <text>]",
|
|
2099
|
-
" kitman run list [--
|
|
1954
|
+
" kitman run list [--project <id>] [--loop <loop>] [--state <state>[,<state>\u2026]] [--limit <n>]",
|
|
2100
1955
|
" kitman run wait <run> [--until attention|finished]",
|
|
2101
1956
|
' kitman run answer <run> "<option or words>" [--question <name>]',
|
|
2102
1957
|
' kitman run steer <run> "<note for the agent>"',
|
|
@@ -2147,7 +2002,7 @@ var Usage = [
|
|
|
2147
2002
|
`);
|
|
2148
2003
|
var KitCreateValidator = guard(KitCreate);
|
|
2149
2004
|
var KitUpdateValidator = guard(KitUpdate);
|
|
2150
|
-
var agentRuntime = promise(() => import("./chunk-
|
|
2005
|
+
var agentRuntime = promise(() => import("./chunk-vz3v0f4j.js"));
|
|
2151
2006
|
var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
|
|
2152
2007
|
defaultValue: () => gen(function* () {
|
|
2153
2008
|
const tui = yield* tryPromise({
|
|
@@ -2414,7 +2269,7 @@ function parseCommand(args) {
|
|
|
2414
2269
|
if (!value)
|
|
2415
2270
|
throw new Error("--capabilities requires a value");
|
|
2416
2271
|
flags.capabilities = validateAgentCapabilities(value);
|
|
2417
|
-
} else if (arg === "--name" || arg === "--title" || arg === "--description" || arg === "--summary" || arg === "--rationale" || arg === "--kind" || arg === "--content" || arg === "--source" || arg === "--content-type" || arg === "--filename" || arg === "--session" || arg === "--project" || arg === "--workspace" || arg === "--branch" || arg === "--team" || arg === "--type" || arg === "--status" || arg === "--reason" || arg === "--dismiss" || arg === "--action" || arg === "--step-key" || arg === "--risk" || arg === "--target-type" || arg === "--scope-type" || arg === "--scope-id" || arg === "--project-access" || arg === "--provider" || arg === "--task" || arg === "--input" || arg === "--idempotency-key" || arg === "--key" || arg === "--after" || arg === "--version" || arg === "--alias" || arg === "--profile" || arg === "--event" || arg === "--cascade" || arg === "--run" || arg === "--run-id" || arg === "--replica" || arg === "--work-unit-kind" || arg === "--host" || arg === "--owner" || arg === "--repository-url" || arg === "--default-branch" || arg === "--expected-branch" || arg === "--expected-commit-sha" || arg === "--credential") {
|
|
2272
|
+
} else if (arg === "--name" || arg === "--title" || arg === "--description" || arg === "--summary" || arg === "--rationale" || arg === "--kind" || arg === "--content" || arg === "--source" || arg === "--content-type" || arg === "--filename" || arg === "--session" || arg === "--project" || arg === "--workspace" || arg === "--branch" || arg === "--team" || arg === "--type" || arg === "--status" || arg === "--loop" || arg === "--state" || arg === "--reason" || arg === "--dismiss" || arg === "--action" || arg === "--step-key" || arg === "--risk" || arg === "--target-type" || arg === "--scope-type" || arg === "--scope-id" || arg === "--project-access" || arg === "--provider" || arg === "--task" || arg === "--input" || arg === "--idempotency-key" || arg === "--key" || arg === "--after" || arg === "--version" || arg === "--alias" || arg === "--profile" || arg === "--event" || arg === "--cascade" || arg === "--run" || arg === "--run-id" || arg === "--replica" || arg === "--work-unit-kind" || arg === "--host" || arg === "--owner" || arg === "--repository-url" || arg === "--default-branch" || arg === "--expected-branch" || arg === "--expected-commit-sha" || arg === "--credential") {
|
|
2418
2273
|
const value = args[++index];
|
|
2419
2274
|
if (!value)
|
|
2420
2275
|
throw new Error(`${arg} requires a value`);
|
|
@@ -2452,6 +2307,10 @@ function parseCommand(args) {
|
|
|
2452
2307
|
flags.taskType = value;
|
|
2453
2308
|
else if (arg === "--status")
|
|
2454
2309
|
flags.status = value;
|
|
2310
|
+
else if (arg === "--loop")
|
|
2311
|
+
flags.loop = value;
|
|
2312
|
+
else if (arg === "--state")
|
|
2313
|
+
flags.states = validateRunDisplayStates(value);
|
|
2455
2314
|
else if (arg === "--reason")
|
|
2456
2315
|
flags.reason = value;
|
|
2457
2316
|
else if (arg === "--dismiss")
|
|
@@ -2627,7 +2486,7 @@ function harnessSync(args) {
|
|
|
2627
2486
|
};
|
|
2628
2487
|
});
|
|
2629
2488
|
const projectRoot = command.flags.projectScope ? yield* resolveProjectWriteRoot : undefined;
|
|
2630
|
-
const targetPlans = yield* previewEnvironmentPlans(environments, command, projectRoot, config.mcpCredentialName, syncKits, (yield* readUserConfig())
|
|
2489
|
+
const targetPlans = yield* previewEnvironmentPlans(environments, command, projectRoot, config.mcpCredentialName, syncKits, (yield* readUserConfig()) ?? {});
|
|
2631
2490
|
const environmentPlan = composeAgentEnvironmentSyncPlan(targetPlans);
|
|
2632
2491
|
const materializationPlans = targetPlans.map((target) => target.skills);
|
|
2633
2492
|
const userConfigPlans = command.flags.projectScope ? [] : targetPlans.map((target) => target.harnessConfig);
|
|
@@ -2644,15 +2503,14 @@ function harnessSync(args) {
|
|
|
2644
2503
|
syncKits
|
|
2645
2504
|
});
|
|
2646
2505
|
const applied = !command.flags.preview;
|
|
2647
|
-
if (applied)
|
|
2506
|
+
if (applied)
|
|
2648
2507
|
yield* writeHarnessSyncPlan(outputPath, plan);
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2508
|
+
const resultPlan = applied ? yield* applyAgentEnvironmentPlans(environmentPlan) : environmentPlan;
|
|
2651
2509
|
return {
|
|
2652
2510
|
command,
|
|
2653
2511
|
plan,
|
|
2654
|
-
environmentPlan,
|
|
2655
|
-
materializationPlans,
|
|
2512
|
+
environmentPlan: resultPlan,
|
|
2513
|
+
materializationPlans: resultPlan.targets.map((target) => target.skills),
|
|
2656
2514
|
configPlans,
|
|
2657
2515
|
userConfigPlans,
|
|
2658
2516
|
projectConfigPlans,
|
|
@@ -2799,8 +2657,8 @@ function isInstallDefaultKit(kit) {
|
|
|
2799
2657
|
const rollout = isObject(marketplace) && marketplace !== null && "rollout" in marketplace ? marketplace.rollout : undefined;
|
|
2800
2658
|
return isObject(rollout) && rollout !== null && "installDefault" in rollout && rollout.installDefault === true;
|
|
2801
2659
|
}
|
|
2802
|
-
function previewEnvironmentPlans(environments, command, projectRoot, mcpCredentialName, syncKits = [],
|
|
2803
|
-
|
|
2660
|
+
function previewEnvironmentPlans(environments, command, projectRoot, mcpCredentialName, syncKits = [], userConfig = {}) {
|
|
2661
|
+
const previews = forEach(environments, (environment, index) => gen(function* () {
|
|
2804
2662
|
const rootDir = command.flags.projectScope ? projectRoot : getOrUndefined(yield* option2(String3("HOME")));
|
|
2805
2663
|
const { previewAgentEnvironmentPlan } = yield* agentRuntime;
|
|
2806
2664
|
return yield* previewAgentEnvironmentPlan({
|
|
@@ -2809,13 +2667,16 @@ function previewEnvironmentPlans(environments, command, projectRoot, mcpCredenti
|
|
|
2809
2667
|
scope: command.flags.projectScope ? "project" : "user",
|
|
2810
2668
|
...rootDir === undefined ? undefined : { rootDir },
|
|
2811
2669
|
...command.flags.noInstall === undefined ? undefined : { noInstall: command.flags.noInstall },
|
|
2812
|
-
...approvedSkillSources === undefined ? undefined : { approvedSkillSources },
|
|
2670
|
+
...userConfig.approvedSkillSources === undefined ? undefined : { approvedSkillSources: userConfig.approvedSkillSources },
|
|
2671
|
+
...userConfig.requireReviewedSources === undefined ? undefined : { requireReviewedSources: userConfig.requireReviewedSources },
|
|
2672
|
+
...userConfig.versions === undefined ? undefined : { versions: userConfig.versions },
|
|
2813
2673
|
...mcpCredentialName === undefined ? undefined : { mcpCredentialName }
|
|
2814
2674
|
});
|
|
2815
2675
|
}));
|
|
2676
|
+
return flatMap2(agentRuntime, ({ withSourceResolutionCache }) => withSourceResolutionCache(previews));
|
|
2816
2677
|
}
|
|
2817
2678
|
var confirmSyncAfterKitToggle = map3(promptLine("Sync enabled kits now? [Y/n] "), (answer) => ["", "y", "yes"].includes(answer.trim().toLowerCase()));
|
|
2818
|
-
var readStdin = Stdio.pipe(
|
|
2679
|
+
var readStdin = Stdio.pipe(flatMap2((stdio) => mkString(decodeText(stdio.stdin))), map3((text) => text.trim()));
|
|
2819
2680
|
function promptLine(prompt2) {
|
|
2820
2681
|
return gen(function* () {
|
|
2821
2682
|
const terminal = yield* Terminal;
|
|
@@ -2940,7 +2801,7 @@ function interactiveKitToggle(kits, harnesses, preferences) {
|
|
|
2940
2801
|
}
|
|
2941
2802
|
}
|
|
2942
2803
|
return { ...preferences, perHarnessKitActivations: [...updates.values()] };
|
|
2943
|
-
}).pipe(ensuring(ignore(Terminal.pipe(
|
|
2804
|
+
}).pipe(ensuring(ignore(Terminal.pipe(flatMap2((terminal) => terminal.display("\x1B[?25h"))))), scoped);
|
|
2944
2805
|
}
|
|
2945
2806
|
function mixedKitState(kit, harnesses, preferences) {
|
|
2946
2807
|
const states = harnesses.map((harness) => kitEnabledForHarness(preferences, harness, kit.id));
|
|
@@ -3046,7 +2907,7 @@ function browserSession(apiUrl) {
|
|
|
3046
2907
|
clientId: ClientId,
|
|
3047
2908
|
onUrl: (url) => andThen(log(`Open this URL to log in:
|
|
3048
2909
|
${url}`), openBrowser(url)),
|
|
3049
|
-
onTimeout: (state) => promptLine("Paste the full callback URL: ").pipe(mapError(() => new CliError({ message: "No callback URL provided" })),
|
|
2910
|
+
onTimeout: (state) => promptLine("Paste the full callback URL: ").pipe(mapError(() => new CliError({ message: "No callback URL provided" })), flatMap2((line) => parseCallbackUrl(line.trim(), state)))
|
|
3050
2911
|
});
|
|
3051
2912
|
const session = toStoredSession(token);
|
|
3052
2913
|
yield* storeSession(apiUrl, session);
|
|
@@ -3398,7 +3259,7 @@ function runnerCommand(args) {
|
|
|
3398
3259
|
});
|
|
3399
3260
|
}
|
|
3400
3261
|
var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
|
|
3401
|
-
defaultValue: () =>
|
|
3262
|
+
defaultValue: () => flatMap2(agentRuntime, (runtime) => runtime.commandHostProbe)
|
|
3402
3263
|
});
|
|
3403
3264
|
var runnerSettings = gen(function* () {
|
|
3404
3265
|
const optional = (name) => String3(name).pipe(option2, map3((value) => getOrUndefined(value)?.trim()));
|
|
@@ -3454,7 +3315,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3454
3315
|
superviseReplica,
|
|
3455
3316
|
verificationExecutor
|
|
3456
3317
|
} = yield* agentRuntime;
|
|
3457
|
-
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-
|
|
3318
|
+
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-xnzxpert.js"));
|
|
3458
3319
|
const settings = yield* runnerSettings;
|
|
3459
3320
|
const { concurrency, fullAccess, sshAgentAvailable } = settings;
|
|
3460
3321
|
const personal = input.runner.ownership.kind === "personal";
|
|
@@ -3466,6 +3327,15 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3466
3327
|
});
|
|
3467
3328
|
const repoBinding = input.projectId === undefined ? undefined : (yield* input.client.listRepoBindings(input.projectId)).items.find((binding) => binding.status === "active");
|
|
3468
3329
|
const harnesses = yield* detectHarnesses;
|
|
3330
|
+
if (harnesses.harnesses.length > 0)
|
|
3331
|
+
yield* harnessSync([
|
|
3332
|
+
"sync",
|
|
3333
|
+
...harnesses.harnesses.map((harness) => harness === "claude" ? "claude-code" : harness),
|
|
3334
|
+
"--workspace",
|
|
3335
|
+
input.workspaceId,
|
|
3336
|
+
"--api-url",
|
|
3337
|
+
input.apiUrl
|
|
3338
|
+
]).pipe(catch_((error2) => error(`Harness sync failed; the Runner starts on the previous one: ${error2.message}`)));
|
|
3469
3339
|
const advertisedCapabilities = repoBinding === undefined ? herdrRunnerCapabilities({ harnesses, fullAccess, sandbox: host, shared: !personal }) : herdrRunnerCapabilitiesForRepoBinding(repoBinding, {
|
|
3470
3340
|
harnesses,
|
|
3471
3341
|
fullAccess,
|
|
@@ -3607,7 +3477,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3607
3477
|
healthStatus: "healthy",
|
|
3608
3478
|
capabilities,
|
|
3609
3479
|
labels: input.runner.labels
|
|
3610
|
-
}).pipe(
|
|
3480
|
+
}).pipe(flatMap2(() => controlPlane.client.heartbeatRunnerReplica(input.runner.id, replica.id, {
|
|
3611
3481
|
healthStatus: "healthy",
|
|
3612
3482
|
drainState: "accepting",
|
|
3613
3483
|
capacity: { maxConcurrentRuns: concurrency },
|
|
@@ -3672,7 +3542,7 @@ function mcpCommand(args) {
|
|
|
3672
3542
|
if (command.action === "run") {
|
|
3673
3543
|
if (command.args.length > 0)
|
|
3674
3544
|
return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
|
|
3675
|
-
const { runMcpServerCommand } = yield* promise(() => import("./chunk-
|
|
3545
|
+
const { runMcpServerCommand } = yield* promise(() => import("./chunk-64cz9grx.js"));
|
|
3676
3546
|
return yield* runMcpServerCommand({ flags: command.flags });
|
|
3677
3547
|
}
|
|
3678
3548
|
if (command.action !== "setup")
|
|
@@ -4008,7 +3878,7 @@ function taskCommand(args) {
|
|
|
4008
3878
|
const sourcePath = command.args[1];
|
|
4009
3879
|
if (!sourcePath)
|
|
4010
3880
|
return yield* new CliError({ message: `${command.group} upload-asset requires file path` });
|
|
4011
|
-
const bytes = yield* FileSystem.pipe(
|
|
3881
|
+
const bytes = yield* FileSystem.pipe(flatMap2((fs) => fs.readFile(sourcePath)));
|
|
4012
3882
|
const input = {
|
|
4013
3883
|
filename: command.flags.filename ?? (yield* Path).basename(sourcePath),
|
|
4014
3884
|
contentType: command.flags.contentType ?? "application/octet-stream",
|
|
@@ -4283,7 +4153,7 @@ function loopCatalogCommand(args) {
|
|
|
4283
4153
|
return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
|
|
4284
4154
|
});
|
|
4285
4155
|
}
|
|
4286
|
-
var taskTypeNamed = (client, workspaceId, named) =>
|
|
4156
|
+
var taskTypeNamed = (client, workspaceId, named) => flatMap2(client.listTaskTypes(workspaceId), (types) => {
|
|
4287
4157
|
const found = types.items.find((type) => type.id === named || type.name.toLowerCase() === named.toLowerCase());
|
|
4288
4158
|
return found === undefined ? fail4(new CliError({
|
|
4289
4159
|
message: `No Task Type "${named}"; the Workspace has ${types.items.map((type) => type.name).join(", ")}`
|
|
@@ -4352,8 +4222,28 @@ var driftLines = (drift) => [
|
|
|
4352
4222
|
...drift.reports.length === 0 ? ["No Drift Reports", ...judgementLines(drift)] : shownDriftLines(drift),
|
|
4353
4223
|
...drift.boundaries.flatMap((boundary) => boundary.uncheckedReason === undefined ? [] : [`Unchecked at ${boundary.stepKey}: ${boundary.uncheckedReason}`])
|
|
4354
4224
|
];
|
|
4225
|
+
var graphNodeText = (node) => `${node.name} ${node.kind} ${runDisplayLabels[node.status]}${node.attempts.length > 1 ? `, ${node.attempts.length} attempts` : ""}`;
|
|
4226
|
+
var displayGlyphs = {
|
|
4227
|
+
queued: "\u25CB",
|
|
4228
|
+
running: "\u25D0",
|
|
4229
|
+
needs_you: "?",
|
|
4230
|
+
blocked: "\u25B2",
|
|
4231
|
+
failed: "\u2717",
|
|
4232
|
+
stopped: "\u25A0",
|
|
4233
|
+
succeeded: "\u2713",
|
|
4234
|
+
partial: "\u25D1"
|
|
4235
|
+
};
|
|
4236
|
+
var runListLine = (item) => [
|
|
4237
|
+
`${runDisplayLabels[item.display.state]}${item.display.retried ? " \xB7 Retried" : ""}`,
|
|
4238
|
+
item.miniGraph.map((state) => displayGlyphs[state]).join(""),
|
|
4239
|
+
item.task === undefined ? item.loop.title : `${item.task.key} ${item.task.title}`,
|
|
4240
|
+
item.display.summary ?? "",
|
|
4241
|
+
item.run.id
|
|
4242
|
+
].filter((part) => part !== "").join(" ");
|
|
4355
4243
|
var runShowLines = (shown) => [
|
|
4356
|
-
`Run ${shown.run.id}: ${shown.
|
|
4244
|
+
`Run ${shown.run.id}: ${runDisplayLabels[shown.display.state]}${shown.display.retried ? " \xB7 Retried" : ""}`,
|
|
4245
|
+
...shown.display.summary === undefined ? [] : [`Now: ${shown.display.summary}`],
|
|
4246
|
+
...shown.graph.columns.map((column, index) => `${index + 1}. ${column.map(graphNodeText).join(" \xB7 ")}`),
|
|
4357
4247
|
...shown.closures.map((closure, index) => index === 0 ? closureLine(closure) : `Earlier: ${closureLine(closure)}`),
|
|
4358
4248
|
...alignmentLines(shown.run.alignment),
|
|
4359
4249
|
...shown.run.loopDigest === undefined ? [] : [`Loop from the ${shown.run.loopLayer ?? "shipped"} layer, digest ${shown.run.loopDigest}`],
|
|
@@ -4386,7 +4276,7 @@ var myTeamsCardLine = (card) => {
|
|
|
4386
4276
|
...card.questions.map((question) => `asks: ${question.prompt}`),
|
|
4387
4277
|
...card.changeRequests.map((changeRequest) => `review ${changeRequest.url}`),
|
|
4388
4278
|
...card.proposals.map((proposal) => `decide: ${proposal.title}`),
|
|
4389
|
-
...
|
|
4279
|
+
...latest === undefined ? [] : [runDisplayLabels[latest.display.state]]
|
|
4390
4280
|
].join(" \xB7 ");
|
|
4391
4281
|
};
|
|
4392
4282
|
var inboxActionLabel = {
|
|
@@ -4506,19 +4396,14 @@ function runCommand(args) {
|
|
|
4506
4396
|
]);
|
|
4507
4397
|
}
|
|
4508
4398
|
if (command.action === "list") {
|
|
4509
|
-
const
|
|
4510
|
-
|
|
4511
|
-
...
|
|
4399
|
+
const { project, loop, states, limit } = command.flags;
|
|
4400
|
+
const listed = yield* client.listRuns(yield* activeWorkspaceId(command.flags), {
|
|
4401
|
+
...project === undefined ? undefined : { projectId: project },
|
|
4402
|
+
...loop === undefined ? undefined : { loop },
|
|
4403
|
+
...states === undefined ? undefined : { states },
|
|
4404
|
+
...limit === undefined ? undefined : { limit }
|
|
4512
4405
|
});
|
|
4513
|
-
return yield* print(listed, (value) => [
|
|
4514
|
-
table(value.items.map((item) => ({
|
|
4515
|
-
run: item.id,
|
|
4516
|
-
status: item.status,
|
|
4517
|
-
closed: item.closure?.kind,
|
|
4518
|
-
task: item.taskId,
|
|
4519
|
-
created: item.createdAt
|
|
4520
|
-
})))
|
|
4521
|
-
]);
|
|
4406
|
+
return yield* print(listed, (value) => value.items.length === 0 ? ["No Runs"] : value.items.map(runListLine));
|
|
4522
4407
|
}
|
|
4523
4408
|
const runId = requiredArg(command, "a Run");
|
|
4524
4409
|
switch (command.action) {
|
|
@@ -4658,7 +4543,7 @@ function verifyCommand(args) {
|
|
|
4658
4543
|
}
|
|
4659
4544
|
});
|
|
4660
4545
|
}
|
|
4661
|
-
var secretValueFromStdin = Stdio.pipe(
|
|
4546
|
+
var secretValueFromStdin = Stdio.pipe(flatMap2((stdio) => mkString(decodeText(stdio.stdin))), map3((text) => text.replace(/\r?\n$/, "")));
|
|
4662
4547
|
function secretCommand(args) {
|
|
4663
4548
|
return gen(function* () {
|
|
4664
4549
|
const command = parseCommand(args.length === 1 ? [...args, "list"] : args);
|
|
@@ -4692,7 +4577,7 @@ function secretCommand(args) {
|
|
|
4692
4577
|
});
|
|
4693
4578
|
}
|
|
4694
4579
|
var PackageBuilder = Reference("kitman/cli/PackageBuilder", {
|
|
4695
|
-
defaultValue: () => (directory) =>
|
|
4580
|
+
defaultValue: () => (directory) => flatMap2(promise(() => import("./chunk-hpfcwnd9.js")), (build) => build.buildPackage(directory))
|
|
4696
4581
|
});
|
|
4697
4582
|
var optionalEnv = (name) => String3(name).pipe(option2, map3(getOrUndefined));
|
|
4698
4583
|
var ciIdToken = (apiUrl) => gen(function* () {
|
|
@@ -4706,7 +4591,7 @@ var ciIdToken = (apiUrl) => gen(function* () {
|
|
|
4706
4591
|
const url = new URL(requestUrl);
|
|
4707
4592
|
const refused = (reason) => new CliError({ message: `GitHub Actions issued no ID token: ${reason}` });
|
|
4708
4593
|
url.searchParams.set("audience", apiUrl.replace(/\/+$/, ""));
|
|
4709
|
-
const response = yield* send(
|
|
4594
|
+
const response = yield* send(get3(url, { headers: { authorization: `Bearer ${requestToken}` } }), (cause) => refused(String(cause)));
|
|
4710
4595
|
if (response.status < 200 || response.status >= 300)
|
|
4711
4596
|
return yield* refused(`${response.status}; does the job have id-token: write?`);
|
|
4712
4597
|
const body = yield* response.text.pipe(mapError((error) => refused(error.message)));
|
|
@@ -5004,10 +4889,11 @@ function constraintCommand(args) {
|
|
|
5004
4889
|
}
|
|
5005
4890
|
});
|
|
5006
4891
|
}
|
|
5007
|
-
var
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
4892
|
+
var validateRunDisplayStates = (value) => {
|
|
4893
|
+
const states = value.split(",").flatMap((named) => RunDisplayStates.filter((known) => known === named));
|
|
4894
|
+
if (states.length !== value.split(",").length)
|
|
4895
|
+
throw new Error(`--state must be one or more of: ${RunDisplayStates.join(", ")}`);
|
|
4896
|
+
return states;
|
|
5011
4897
|
};
|
|
5012
4898
|
function triggerCommand(args) {
|
|
5013
4899
|
return gen(function* () {
|
|
@@ -5591,7 +5477,7 @@ function downloadPresignedAsset(download, outputPath) {
|
|
|
5591
5477
|
return gen(function* () {
|
|
5592
5478
|
const fs = yield* FileSystem;
|
|
5593
5479
|
const failed = (cause) => new CliError({ message: `Asset download failed: ${String(cause)}` });
|
|
5594
|
-
const response = yield* send(
|
|
5480
|
+
const response = yield* send(make14(download.method)(download.url), failed);
|
|
5595
5481
|
if (response.status < 200 || response.status >= 300)
|
|
5596
5482
|
return yield* new CliError({ message: `Asset download failed with ${response.status}` });
|
|
5597
5483
|
const body = yield* response.arrayBuffer.pipe(mapError((error) => failed(error.message)));
|
|
@@ -5777,7 +5663,7 @@ function kitCreateInput(command) {
|
|
|
5777
5663
|
return yield* new CliError({
|
|
5778
5664
|
message: "kit create --source cannot be combined with --name, --description, --kind, --content, or --stdin"
|
|
5779
5665
|
});
|
|
5780
|
-
const content = yield* FileSystem.pipe(
|
|
5666
|
+
const content = yield* FileSystem.pipe(flatMap2((fs) => fs.readFileString(command.flags.source ?? "")));
|
|
5781
5667
|
return yield* parseKitCreateSource(content);
|
|
5782
5668
|
}
|
|
5783
5669
|
const name = command.flags.name ?? prompt("Kit name: ");
|
|
@@ -5804,7 +5690,7 @@ function kitUpdateInput(command) {
|
|
|
5804
5690
|
return yield* new CliError({
|
|
5805
5691
|
message: "kit update --source cannot be combined with --name, --description, --kind, --content, or --stdin"
|
|
5806
5692
|
});
|
|
5807
|
-
const content = yield* FileSystem.pipe(
|
|
5693
|
+
const content = yield* FileSystem.pipe(flatMap2((fs) => fs.readFileString(command.flags.source ?? "")));
|
|
5808
5694
|
return yield* parseKitUpdateSource(content);
|
|
5809
5695
|
}
|
|
5810
5696
|
const input = {
|