@kitman-sh/cli 0.7.1 → 0.7.3

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-5rp5hvc0.js";
6
+ } from "./chunk-8g2twwm8.js";
7
7
 
8
8
  // node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Random.js
9
9
  var Random2 = Random;
@@ -21,7 +21,7 @@ import {
21
21
  FileSystem,
22
22
  Path,
23
23
  ChildProcessSpawner,
24
- make12,
24
+ make11,
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-5rp5hvc0.js";
45
- import"./chunk-9bje6bm0.js";
46
- import"./chunk-23ch5vdv.js";
47
- import"./chunk-tkk2synn.js";
44
+ } from "./chunk-8g2twwm8.js";
45
+ import"./chunk-84t0s0s2.js";
46
+ import"./chunk-c5nwtn11.js";
47
+ import"./chunk-0296rete.js";
48
48
  import {
49
49
  describeFlag,
50
50
  Described
51
- } from "./chunk-2vcae278.js";
51
+ } from "./chunk-1n61xbaq.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(make12(command, args, { cwd, stdin: "ignore" }));
99
+ const handle = yield* spawner.spawn(make11(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)),
@@ -3,9 +3,9 @@ import {
3
3
  runnerWebSocketProtocol2,
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2
6
- } from "./chunk-23ch5vdv.js";
7
- import"./chunk-9bje6bm0.js";
8
- import"./chunk-5rp5hvc0.js";
6
+ } from "./chunk-c5nwtn11.js";
7
+ import"./chunk-84t0s0s2.js";
8
+ import"./chunk-8g2twwm8.js";
9
9
  export {
10
10
  makeRunnerRpcClient2 as makeRunnerRpcClient,
11
11
  runnerRpcUrl2 as runnerRpcUrl,
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
3
  import {
4
+ pipeArguments,
4
5
  identity,
5
6
  isUndefined,
6
7
  isNotUndefined,
@@ -19,8 +20,12 @@ import {
19
20
  fromUndefinedOr,
20
21
  getOrUndefined,
21
22
  Service,
23
+ add,
24
+ get,
22
25
  Reference,
23
26
  of,
27
+ fromInputUnsafe,
28
+ isFinite,
24
29
  toMillis,
25
30
  TaggedError,
26
31
  squash,
@@ -29,12 +34,19 @@ import {
29
34
  UnknownError,
30
35
  succeed2,
31
36
  fail2,
37
+ void_,
38
+ isSuccess2,
39
+ isFailure2,
32
40
  makeUnsafe,
33
41
  _await,
34
42
  isDone,
35
43
  isDoneUnsafe,
36
44
  doneUnsafe,
45
+ Scope,
46
+ makeUnsafe2,
47
+ addFinalizerExit,
37
48
  addFinalizer,
49
+ close,
38
50
  succeed4,
39
51
  effect,
40
52
  mergeAll,
@@ -54,6 +66,7 @@ import {
54
66
  gen,
55
67
  fail4,
56
68
  try_,
69
+ withFiber,
57
70
  flatMap,
58
71
  andThen,
59
72
  tap,
@@ -73,19 +86,28 @@ import {
73
86
  provide3,
74
87
  provideContext,
75
88
  provideService,
89
+ scope,
76
90
  scoped,
77
91
  acquireRelease,
78
92
  addFinalizer2,
79
93
  ensuring,
94
+ onExit,
95
+ interrupt2,
80
96
  uninterruptible,
97
+ uninterruptibleMask,
81
98
  forever,
82
99
  forkScoped,
100
+ runForkWith,
83
101
  fnUntraced,
84
102
  logWarning,
85
103
  logError,
86
104
  runMain,
87
105
  systemError,
88
106
  badArgument,
107
+ join,
108
+ interrupt3,
109
+ getCurrent,
110
+ runIn,
89
111
  makeUnsafe3,
90
112
  make7,
91
113
  make8,
@@ -98,8 +120,6 @@ import {
98
120
  isSink,
99
121
  fromChannel,
100
122
  drain,
101
- make9,
102
- get2,
103
123
  isStream,
104
124
  fromChannel2,
105
125
  empty2,
@@ -115,9 +135,9 @@ import {
115
135
  ExitCode,
116
136
  ProcessId,
117
137
  makeHandle,
118
- make11,
138
+ make10,
119
139
  ChildProcessSpawner,
120
- make12,
140
+ make11,
121
141
  parseFdName,
122
142
  fdName,
123
143
  handleErrnoException,
@@ -183,8 +203,8 @@ import {
183
203
  agentCredentialForApi,
184
204
  storeAgentCredential,
185
205
  raw,
186
- make13,
187
- get3,
206
+ make12,
207
+ get2,
188
208
  put,
189
209
  execute,
190
210
  Fetch,
@@ -207,7 +227,146 @@ import {
207
227
  runCommand2,
208
228
  detectHarnesses2,
209
229
  herdrRunnerCapabilities2
210
- } from "./chunk-5rp5hvc0.js";
230
+ } from "./chunk-8g2twwm8.js";
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
370
 
212
371
  // node_modules/.bun/@effect+platform-node-shared@4.0.4+b8cbb99ebc524863/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
213
372
  import * as NodeChildProcess from "child_process";
@@ -385,7 +544,7 @@ var taskkill = (childProcess, onExit = () => {}) => {
385
544
  windowsHide: true
386
545
  }, onExit);
387
546
  };
388
- var make = /* @__PURE__ */ gen(function* () {
547
+ var make3 = /* @__PURE__ */ gen(function* () {
389
548
  const fs = yield* FileSystem;
390
549
  const path = yield* Path;
391
550
  const resolveWorkingDirectory = fnUntraced(function* (options) {
@@ -787,7 +946,7 @@ var make = /* @__PURE__ */ gen(function* () {
787
946
  const sourceStream = unwrap(succeed5(getSourceStream(handles[handles.length - 1], options.from)));
788
947
  const toOption = options.to ?? "stdin";
789
948
  if (toOption === "stdin") {
790
- handles.push(yield* spawnCommand(make12(command.command, command.args, {
949
+ handles.push(yield* spawnCommand(make11(command.command, command.args, {
791
950
  ...command.options,
792
951
  stdin: {
793
952
  ...stdinConfig,
@@ -799,7 +958,7 @@ var make = /* @__PURE__ */ gen(function* () {
799
958
  if (isNotUndefined(fd)) {
800
959
  const fdName2 = fdName(fd);
801
960
  const existingFds = command.options.additionalFds ?? {};
802
- handles.push(yield* spawnCommand(make12(command.command, command.args, {
961
+ handles.push(yield* spawnCommand(make11(command.command, command.args, {
803
962
  ...command.options,
804
963
  additionalFds: {
805
964
  ...existingFds,
@@ -810,7 +969,7 @@ var make = /* @__PURE__ */ gen(function* () {
810
969
  }
811
970
  })));
812
971
  } else {
813
- handles.push(yield* spawnCommand(make12(command.command, command.args, {
972
+ handles.push(yield* spawnCommand(make11(command.command, command.args, {
814
973
  ...command.options,
815
974
  stdin: {
816
975
  ...stdinConfig,
@@ -849,9 +1008,9 @@ var make = /* @__PURE__ */ gen(function* () {
849
1008
  }
850
1009
  }
851
1010
  });
852
- return make11(spawnCommand);
1011
+ return make10(spawnCommand);
853
1012
  });
854
- var layer5 = /* @__PURE__ */ effect(ChildProcessSpawner, make);
1013
+ var layer5 = /* @__PURE__ */ effect(ChildProcessSpawner, make3);
855
1014
  var flattenCommand = (command) => {
856
1015
  const commands = [];
857
1016
  const pipeOptions = [];
@@ -882,10 +1041,10 @@ var flattenCommand = (command) => {
882
1041
  };
883
1042
 
884
1043
  // node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Stdio.js
885
- var TypeId = "~effect/Stdio";
886
- var Stdio = /* @__PURE__ */ Service(TypeId);
887
- var make2 = (options) => ({
888
- [TypeId]: TypeId,
1044
+ var TypeId2 = "~effect/Stdio";
1045
+ var Stdio = /* @__PURE__ */ Service(TypeId2);
1046
+ var make4 = (options) => ({
1047
+ [TypeId2]: TypeId2,
889
1048
  stdinIsTerminal: succeed5(false),
890
1049
  stdoutIsTerminal: succeed5(false),
891
1050
  stderrIsTerminal: succeed5(false),
@@ -893,7 +1052,7 @@ var make2 = (options) => ({
893
1052
  });
894
1053
 
895
1054
  // node_modules/.bun/@effect+platform-node-shared@4.0.4+b8cbb99ebc524863/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
896
- var layer6 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */ make2({
1055
+ var layer6 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */ make4({
897
1056
  args: /* @__PURE__ */ sync(() => process.argv.slice(2)),
898
1057
  stdinIsTerminal: /* @__PURE__ */ sync(() => process.stdin.isTTY === true),
899
1058
  stdoutIsTerminal: /* @__PURE__ */ sync(() => process.stdout.isTTY === true),
@@ -934,7 +1093,7 @@ var layer6 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */ make2({
934
1093
  var layer7 = layer6;
935
1094
 
936
1095
  // node_modules/.bun/effect@4.0.4/node_modules/effect/dist/Terminal.js
937
- var TypeId2 = "~effect/Terminal";
1096
+ var TypeId3 = "~effect/Terminal";
938
1097
  var QuitErrorTypeId = "~effect/Terminal/QuitError";
939
1098
 
940
1099
  class QuitError extends (/* @__PURE__ */ Error2("QuitError")({
@@ -943,14 +1102,14 @@ class QuitError extends (/* @__PURE__ */ Error2("QuitError")({
943
1102
  [QuitErrorTypeId] = QuitErrorTypeId;
944
1103
  }
945
1104
  var Terminal = /* @__PURE__ */ Service("effect/Terminal");
946
- var make3 = (impl) => Terminal.of({
1105
+ var make5 = (impl) => Terminal.of({
947
1106
  ...impl,
948
- [TypeId2]: TypeId2
1107
+ [TypeId3]: TypeId3
949
1108
  });
950
1109
 
951
1110
  // node_modules/.bun/@effect+platform-node-shared@4.0.4+b8cbb99ebc524863/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
952
1111
  import * as readline from "readline";
953
- var make4 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1112
+ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
954
1113
  const stdin = process.stdin;
955
1114
  const stdout = process.stdout;
956
1115
  const lines = yield* make8();
@@ -964,7 +1123,7 @@ var make4 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
964
1123
  };
965
1124
  stdin.once("end", onStdinEnd);
966
1125
  yield* addFinalizer2(() => sync(() => stdin.off("end", onStdinEnd)));
967
- const rlRef = yield* make9({
1126
+ const rlRef = yield* make2({
968
1127
  acquire: acquireRelease(sync(() => {
969
1128
  const rl = readline.createInterface({
970
1129
  input: stdin,
@@ -1038,13 +1197,13 @@ var make4 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
1038
1197
  if (inputEnded) {
1039
1198
  handleEnd();
1040
1199
  } else {
1041
- yield* get2(rlRef);
1200
+ yield* get4(rlRef);
1042
1201
  stdin.once("end", handleEnd);
1043
1202
  }
1044
1203
  return queue;
1045
1204
  });
1046
1205
  const readLine = suspend(() => poll(lines).pipe(flatMap(match({
1047
- onNone: () => scoped(andThen(get2(rlRef), take(lines))),
1206
+ onNone: () => scoped(andThen(get4(rlRef), take(lines))),
1048
1207
  onSome: succeed5
1049
1208
  })), mapError(() => new QuitError({}))));
1050
1209
  const display = (prompt2) => uninterruptible(callback((resume) => {
@@ -1055,7 +1214,7 @@ var make4 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
1055
1214
  cause: err
1056
1215
  }))));
1057
1216
  }));
1058
- return make3({
1217
+ return make5({
1059
1218
  columns,
1060
1219
  rows,
1061
1220
  readInput,
@@ -1063,7 +1222,7 @@ var make4 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
1063
1222
  display
1064
1223
  });
1065
1224
  });
1066
- var layer8 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make4(defaultShouldQuit));
1225
+ var layer8 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make6(defaultShouldQuit));
1067
1226
  function defaultShouldQuit(input) {
1068
1227
  const key = input.key;
1069
1228
  return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
@@ -1177,7 +1336,7 @@ function renderMaterializationPlan(plan) {
1177
1336
  kind: operation.kind,
1178
1337
  skillName: operation.skillName,
1179
1338
  skillIdentityHash: hashIdentity(auditOperationIdentity(operation)),
1180
- target: operation.kind === "write_skill" ? operation.path : operation.targetPath
1339
+ target: operation.kind === "symlink_skill" ? operation.targetPath : operation.path
1181
1340
  })),
1182
1341
  materializedSkills: plan.materializedSkills.map((skill) => ({
1183
1342
  name: skill.name,
@@ -1203,7 +1362,11 @@ function renderConfigPlan(plan) {
1203
1362
  };
1204
1363
  }
1205
1364
  function auditOperationIdentity(operation) {
1206
- return operation.kind === "write_skill" ? `write_skill:${operation.skillName}:content_sha256:${hashIdentity(operation.content)}:${operation.path}` : `symlink_skill:${operation.skillName}:symlink:${operation.sourcePath}:${operation.targetPath}`;
1365
+ if (operation.kind === "write_skill")
1366
+ return `write_skill:${operation.skillName}:content_sha256:${hashIdentity(operation.content)}:${operation.path}`;
1367
+ if (operation.kind === "fetch_git_skill")
1368
+ return `fetch_git_skill:${operation.skillName}:${operation.url}#${operation.ref}:${operation.repositoryPath ?? ""}:${operation.path}`;
1369
+ return `symlink_skill:${operation.skillName}:symlink:${operation.sourcePath}:${operation.targetPath}`;
1207
1370
  }
1208
1371
  function auditMaterializedSkillIdentity(skill) {
1209
1372
  return `${skill.harness}:${skill.name}:${skill.source.kind}:${skill.skillPath ?? ""}:${skill.managed}`;
@@ -1770,7 +1933,7 @@ var package_default = {
1770
1933
  };
1771
1934
 
1772
1935
  // apps/cli/src/scaffold.ts
1773
- var cliVersion = "0.7.1";
1936
+ var cliVersion = "0.7.3";
1774
1937
  var packageJson = (name, scaffold) => `${JSON.stringify({
1775
1938
  name,
1776
1939
  private: true,
@@ -1890,7 +2053,7 @@ var scaffoldPackage = (directory, scaffold = {}) => gen(function* () {
1890
2053
  const path = yield* Path;
1891
2054
  const root = path.resolve(directory);
1892
2055
  if (scaffold.fork !== undefined) {
1893
- const { shippedLoops } = yield* promise(() => import("./chunk-gj8pz39x.js"));
2056
+ const { shippedLoops } = yield* promise(() => import("./chunk-80g9af03.js"));
1894
2057
  if (!(scaffold.fork in shippedLoops))
1895
2058
  return yield* new CliError({
1896
2059
  message: `Kitman ships no Loop ${scaffold.fork}; fork one of ${Object.keys(shippedLoops).join(", ")}`
@@ -1984,7 +2147,7 @@ var Usage = [
1984
2147
  `);
1985
2148
  var KitCreateValidator = guard(KitCreate);
1986
2149
  var KitUpdateValidator = guard(KitUpdate);
1987
- var agentRuntime = promise(() => import("./chunk-f1f60hgt.js"));
2150
+ var agentRuntime = promise(() => import("./chunk-kt08et8q.js"));
1988
2151
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
1989
2152
  defaultValue: () => gen(function* () {
1990
2153
  const tui = yield* tryPromise({
@@ -2464,7 +2627,7 @@ function harnessSync(args) {
2464
2627
  };
2465
2628
  });
2466
2629
  const projectRoot = command.flags.projectScope ? yield* resolveProjectWriteRoot : undefined;
2467
- const targetPlans = yield* previewEnvironmentPlans(environments, command, projectRoot, config.mcpCredentialName, syncKits);
2630
+ const targetPlans = yield* previewEnvironmentPlans(environments, command, projectRoot, config.mcpCredentialName, syncKits, (yield* readUserConfig())?.approvedSkillSources);
2468
2631
  const environmentPlan = composeAgentEnvironmentSyncPlan(targetPlans);
2469
2632
  const materializationPlans = targetPlans.map((target) => target.skills);
2470
2633
  const userConfigPlans = command.flags.projectScope ? [] : targetPlans.map((target) => target.harnessConfig);
@@ -2636,7 +2799,7 @@ function isInstallDefaultKit(kit) {
2636
2799
  const rollout = isObject(marketplace) && marketplace !== null && "rollout" in marketplace ? marketplace.rollout : undefined;
2637
2800
  return isObject(rollout) && rollout !== null && "installDefault" in rollout && rollout.installDefault === true;
2638
2801
  }
2639
- function previewEnvironmentPlans(environments, command, projectRoot, mcpCredentialName, syncKits = []) {
2802
+ function previewEnvironmentPlans(environments, command, projectRoot, mcpCredentialName, syncKits = [], approvedSkillSources) {
2640
2803
  return forEach(environments, (environment, index) => gen(function* () {
2641
2804
  const rootDir = command.flags.projectScope ? projectRoot : getOrUndefined(yield* option2(String3("HOME")));
2642
2805
  const { previewAgentEnvironmentPlan } = yield* agentRuntime;
@@ -2646,6 +2809,7 @@ function previewEnvironmentPlans(environments, command, projectRoot, mcpCredenti
2646
2809
  scope: command.flags.projectScope ? "project" : "user",
2647
2810
  ...rootDir === undefined ? undefined : { rootDir },
2648
2811
  ...command.flags.noInstall === undefined ? undefined : { noInstall: command.flags.noInstall },
2812
+ ...approvedSkillSources === undefined ? undefined : { approvedSkillSources },
2649
2813
  ...mcpCredentialName === undefined ? undefined : { mcpCredentialName }
2650
2814
  });
2651
2815
  }));
@@ -3290,7 +3454,7 @@ function startCanonicalHerdrRunnerCommand(input) {
3290
3454
  superviseReplica,
3291
3455
  verificationExecutor
3292
3456
  } = yield* agentRuntime;
3293
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-mx1x1b6a.js"));
3457
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-zc0ebz8f.js"));
3294
3458
  const settings = yield* runnerSettings;
3295
3459
  const { concurrency, fullAccess, sshAgentAvailable } = settings;
3296
3460
  const personal = input.runner.ownership.kind === "personal";
@@ -3508,7 +3672,7 @@ function mcpCommand(args) {
3508
3672
  if (command.action === "run") {
3509
3673
  if (command.args.length > 0)
3510
3674
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
3511
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-eynqc0vm.js"));
3675
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-nvf0begz.js"));
3512
3676
  return yield* runMcpServerCommand({ flags: command.flags });
3513
3677
  }
3514
3678
  if (command.action !== "setup")
@@ -4528,7 +4692,7 @@ function secretCommand(args) {
4528
4692
  });
4529
4693
  }
4530
4694
  var PackageBuilder = Reference("kitman/cli/PackageBuilder", {
4531
- defaultValue: () => (directory) => flatMap(promise(() => import("./chunk-50w9z6we.js")), (build) => build.buildPackage(directory))
4695
+ defaultValue: () => (directory) => flatMap(promise(() => import("./chunk-yysejjz0.js")), (build) => build.buildPackage(directory))
4532
4696
  });
4533
4697
  var optionalEnv = (name) => String3(name).pipe(option2, map3(getOrUndefined));
4534
4698
  var ciIdToken = (apiUrl) => gen(function* () {
@@ -4542,7 +4706,7 @@ var ciIdToken = (apiUrl) => gen(function* () {
4542
4706
  const url = new URL(requestUrl);
4543
4707
  const refused = (reason) => new CliError({ message: `GitHub Actions issued no ID token: ${reason}` });
4544
4708
  url.searchParams.set("audience", apiUrl.replace(/\/+$/, ""));
4545
- const response = yield* send(get3(url, { headers: { authorization: `Bearer ${requestToken}` } }), (cause) => refused(String(cause)));
4709
+ const response = yield* send(get2(url, { headers: { authorization: `Bearer ${requestToken}` } }), (cause) => refused(String(cause)));
4546
4710
  if (response.status < 200 || response.status >= 300)
4547
4711
  return yield* refused(`${response.status}; does the job have id-token: write?`);
4548
4712
  const body = yield* response.text.pipe(mapError((error) => refused(error.message)));
@@ -5033,9 +5197,7 @@ function runnerOwnershipFromCommand(command, required) {
5033
5197
  const ownerUserId = command.flags.scopeId;
5034
5198
  if (!ownerUserId)
5035
5199
  throw new Error("personal runner scope requires --scope-id <owner-user-id>");
5036
- if (command.flags.projectAccess !== undefined)
5037
- throw new Error("personal runner scope does not accept --project-access");
5038
- return { kind: "personal", ownerUserId };
5200
+ return { kind: "personal", ownerUserId, projectAccess: command.flags.projectAccess ?? "all" };
5039
5201
  }
5040
5202
  throw new Error("--scope-type must be workspace, project, or personal");
5041
5203
  }
@@ -5291,12 +5453,12 @@ function repoBindingCredentialRefLabel(ref) {
5291
5453
  function runnerRow(runner) {
5292
5454
  const ownership = runner.ownership;
5293
5455
  let effectiveProjectAccess;
5294
- if (ownership.kind === "workspace")
5295
- effectiveProjectAccess = ownership.projectAccess === "all" ? "workspace_all" : runner.projectGrantIds.join(",") || "selected_none";
5296
- else if (ownership.kind === "project")
5456
+ if (ownership.kind === "project")
5297
5457
  effectiveProjectAccess = `project:${ownership.projectId}`;
5458
+ else if (ownership.projectAccess === "selected")
5459
+ effectiveProjectAccess = runner.projectGrantIds.join(",") || "selected_none";
5298
5460
  else
5299
- effectiveProjectAccess = `personal:${ownership.ownerUserId}`;
5461
+ effectiveProjectAccess = ownership.kind === "workspace" ? "workspace_all" : `personal:${ownership.ownerUserId}`;
5300
5462
  return {
5301
5463
  id: runner.id,
5302
5464
  name: runner.name,
@@ -5310,7 +5472,7 @@ function runnerRow(runner) {
5310
5472
  sandboxes: runner.capabilities.sandboxBackends.join(","),
5311
5473
  labels: runner.labels.join(","),
5312
5474
  ownership: ownership.kind,
5313
- projectAccess: ownership.kind === "workspace" ? ownership.projectAccess : undefined,
5475
+ projectAccess: ownership.kind === "project" ? undefined : ownership.projectAccess,
5314
5476
  ownerUserId: ownership.kind === "personal" ? ownership.ownerUserId : undefined,
5315
5477
  scopedProjectId: ownership.kind === "project" ? ownership.projectId : undefined,
5316
5478
  effectiveProjectAccess,
@@ -5429,7 +5591,7 @@ function downloadPresignedAsset(download, outputPath) {
5429
5591
  return gen(function* () {
5430
5592
  const fs = yield* FileSystem;
5431
5593
  const failed = (cause) => new CliError({ message: `Asset download failed: ${String(cause)}` });
5432
- const response = yield* send(make13(download.method)(download.url), failed);
5594
+ const response = yield* send(make12(download.method)(download.url), failed);
5433
5595
  if (response.status < 200 || response.status >= 300)
5434
5596
  return yield* new CliError({ message: `Asset download failed with ${response.status}` });
5435
5597
  const body = yield* response.arrayBuffer.pipe(mapError((error) => failed(error.message)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {