@kitman-sh/cli 0.14.8 → 0.15.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.
Files changed (30) hide show
  1. package/dist/{chunk-y0y2gg8d.js → chunk-0ws25xvg.js} +2 -2
  2. package/dist/{chunk-b009hdm0.js → chunk-39ykbhq8.js} +5 -5
  3. package/dist/{chunk-eytzmdna.js → chunk-3n99j4z0.js} +471 -234
  4. package/dist/{chunk-bbf0jzsc.js → chunk-3ns4sbfb.js} +1 -1
  5. package/dist/{chunk-q0x3c0dh.js → chunk-4x7a1qkj.js} +7 -7
  6. package/dist/{chunk-ya4z1n5p.js → chunk-4zc1g45m.js} +7 -7
  7. package/dist/{chunk-6dj39qtt.js → chunk-58hehm8d.js} +1133 -115
  8. package/dist/{chunk-9avbsbvk.js → chunk-5hkdgzh4.js} +1 -1
  9. package/dist/{chunk-xfs1nf75.js → chunk-8393zths.js} +1626 -388
  10. package/dist/{chunk-bpx2zjh7.js → chunk-8wpg3rph.js} +2 -2
  11. package/dist/{chunk-6x43ntsx.js → chunk-b16qxawc.js} +1 -1
  12. package/dist/chunk-cf1hxp43.js +3080 -0
  13. package/dist/chunk-csxxwscf.js +39 -0
  14. package/dist/{chunk-dq21ab8w.js → chunk-djp6t2g6.js} +21 -21
  15. package/dist/{chunk-zpp4jg4a.js → chunk-dx792s4w.js} +1455 -100
  16. package/dist/{chunk-5wrhj4cj.js → chunk-fv2zpgh0.js} +7 -7
  17. package/dist/{chunk-ctpgfdzf.js → chunk-fzaecdgv.js} +3 -3
  18. package/dist/{chunk-79g5zh2p.js → chunk-k2wd9r6t.js} +4 -4
  19. package/dist/chunk-mrkrt2hg.js +4345 -0
  20. package/dist/{chunk-721qyd1a.js → chunk-qkt77rtj.js} +6 -6
  21. package/dist/{chunk-drp4zdwq.js → chunk-rt0qfdtg.js} +15 -7
  22. package/dist/{chunk-cf723a2y.js → chunk-snwjv2sd.js} +678 -40
  23. package/dist/{chunk-bdd62njv.js → chunk-vg78dz3w.js} +259 -57
  24. package/dist/{chunk-wszvkzg8.js → chunk-vq7caqt2.js} +1828 -130
  25. package/dist/{chunk-63m3r0k4.js → chunk-wfz64h9p.js} +4 -4
  26. package/dist/{chunk-hz4t408c.js → chunk-xx711t5r.js} +4 -4
  27. package/dist/index.js +4 -4
  28. package/package.json +2 -1
  29. package/dist/chunk-1rwaetnm.js +0 -526
  30. package/dist/chunk-hrtr5wfq.js +0 -1166
@@ -0,0 +1,39 @@
1
+ // @bun
2
+ import {
3
+ isString2
4
+ } from "./chunk-dx792s4w.js";
5
+
6
+ // packages/core/src/question-recommendation.ts
7
+ var optionValue = (option) => isString2(option) ? option : option.value;
8
+ var splitQuestionOptions = (options) => {
9
+ const descriptions = Object.fromEntries(options.flatMap((option) => isString2(option) || option.description === undefined || option.description.trim() === "" ? [] : [[option.value, option.description]]));
10
+ return {
11
+ options: options.map(optionValue),
12
+ ...Object.keys(descriptions).length === 0 ? undefined : { optionDescriptions: descriptions }
13
+ };
14
+ };
15
+ var recommendationProblem = (question) => {
16
+ const options = question.options?.map(optionValue);
17
+ const reason = question.recommendationReason?.trim() ?? "";
18
+ const recommended = question.recommended?.trim() ?? "";
19
+ if (question.informationOnly === true) {
20
+ if (options !== undefined)
21
+ return "A Question with options always has one to recommend: set `recommended` to one of them, and drop `informationOnly`.";
22
+ if (recommended !== "")
23
+ return "A Question that recommends an answer is not `informationOnly`: drop `informationOnly`.";
24
+ return reason === "" ? "Say in `recommendationReason` why you cannot suggest an answer, such as that only the person knows the secret\u2019s name." : undefined;
25
+ }
26
+ if (recommended === "")
27
+ return `Add \`recommended\`: the answer you would pick${options === undefined ? ", as a suggested free-text answer" : `, one of: ${options.join(", ")}`}. Add \`recommendationReason\` too, in one or two sentences. Only a Question that purely asks for information you cannot guess, such as a secret's name, may set \`informationOnly\` instead and say why in \`recommendationReason\`.`;
28
+ if (options !== undefined && !options.includes(question.recommended ?? ""))
29
+ return `The recommended answer "${question.recommended}" is not one of the options: ${options.join(", ")}.`;
30
+ return reason === "" ? "Add `recommendationReason`: why you recommend that answer, in one or two sentences." : undefined;
31
+ };
32
+ var questionAdvice = (question) => ({
33
+ ...question.optionDescriptions === undefined ? undefined : { optionDescriptions: question.optionDescriptions },
34
+ ...question.recommended === undefined ? undefined : { recommended: question.recommended },
35
+ ...question.recommendationReason === undefined ? undefined : { recommendationReason: question.recommendationReason },
36
+ ...question.informationOnly === true ? { informationOnly: true } : undefined
37
+ });
38
+
39
+ export { splitQuestionOptions, recommendationProblem, questionAdvice };
@@ -12,7 +12,7 @@ import {
12
12
  add,
13
13
  getOrUndefinedUnsafe,
14
14
  getUnsafe,
15
- get3,
15
+ get4,
16
16
  Reference,
17
17
  toMillis,
18
18
  isSuccess,
@@ -51,7 +51,7 @@ import {
51
51
  withFiber2,
52
52
  flatMap3,
53
53
  andThen2,
54
- map8,
54
+ map9,
55
55
  catchCause2,
56
56
  catchCauseIf,
57
57
  orDie,
@@ -96,8 +96,21 @@ import {
96
96
  Defect,
97
97
  Exit,
98
98
  toCodecJson
99
- } from "./chunk-zpp4jg4a.js";
99
+ } from "./chunk-dx792s4w.js";
100
100
  import {
101
+ interrupt,
102
+ getCurrent,
103
+ makeUnsafe2,
104
+ bounded,
105
+ offerAll,
106
+ failCause,
107
+ end,
108
+ shutdownUnsafe,
109
+ fromQueue,
110
+ unwrap
111
+ } from "./chunk-vg78dz3w.js";
112
+ import {
113
+ Clock,
101
114
  empty,
102
115
  fromInput,
103
116
  merge,
@@ -110,20 +123,7 @@ import {
110
123
  ParseOptions,
111
124
  RpcClientDefect,
112
125
  RpcClientError
113
- } from "./chunk-xfs1nf75.js";
114
- import {
115
- Clock,
116
- interrupt,
117
- getCurrent,
118
- makeUnsafe2,
119
- bounded,
120
- offerAll,
121
- failCause,
122
- end,
123
- shutdownUnsafe,
124
- fromQueue,
125
- unwrap
126
- } from "./chunk-bdd62njv.js";
126
+ } from "./chunk-8393zths.js";
127
127
 
128
128
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
129
129
  class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
@@ -200,7 +200,7 @@ var withRunClient = (f) => suspend3(() => {
200
200
  buffer.push([data, context]);
201
201
  return void_3;
202
202
  });
203
- return map8(f((clientId, data) => {
203
+ return map9(f((clientId, data) => {
204
204
  const clientWrite = clientWrites.get(clientId);
205
205
  if (clientWrite) {
206
206
  return clientWrite(data);
@@ -237,7 +237,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
237
237
  const disableTracing = options?.disableTracing ?? false;
238
238
  const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
239
239
  const services = yield* context();
240
- const scope = get3(services, Scope);
240
+ const scope = get4(services, Scope);
241
241
  const entries = new Map;
242
242
  let isShutdown = false;
243
243
  yield* addFinalizer(scope, withFiber2((parent) => {
@@ -271,7 +271,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
271
271
  const queue = onStreamRequest(rpc, middleware, rpc.payloadSchema.make(payload), headers, opts?.streamBufferSize ?? 16, context);
272
272
  if (opts?.asQueue)
273
273
  return queue;
274
- return unwrap(map8(queue, fromQueue));
274
+ return unwrap(map9(queue, fromQueue));
275
275
  };
276
276
  };
277
277
  const onEffectRequest = (rpc, middleware, span, payload, headers, context, discard) => withFiber2((parentFiber) => {
@@ -643,7 +643,7 @@ var makeRpcSchemas = (codecFor) => {
643
643
  return entry;
644
644
  }
645
645
  const streamSchemas = getStreamSchemas(rpc.successSchema);
646
- const parseOptions = get3(rpc.annotations, ParseOptions);
646
+ const parseOptions = get4(rpc.annotations, ParseOptions);
647
647
  const exitSchema2 = exitSchema(rpc);
648
648
  let decodeDiscardExit;
649
649
  entry = {