@kitman-sh/cli 0.9.0 → 0.10.53
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-11p4wf6n.js +3551 -0
- package/dist/chunk-1mc9vgcr.js +39 -0
- package/dist/chunk-30397r95.js +30 -0
- package/dist/chunk-3bj7sc3v.js +389 -0
- package/dist/chunk-6vns3ej0.js +23 -0
- package/dist/chunk-7thnf14y.js +936 -0
- package/dist/chunk-arvwar2c.js +141 -0
- package/dist/chunk-b6thzgc9.js +32 -0
- package/dist/{chunk-8bvf4fh4.js → chunk-ctasxxz5.js} +26 -11
- package/dist/{chunk-5gjpv3ax.js → chunk-dzh9e6n2.js} +824 -651
- package/dist/{chunk-snn0e1qb.js → chunk-eg8f5ncv.js} +7 -3
- package/dist/chunk-g5bs3f6z.js +173 -0
- package/dist/chunk-jafetf7z.js +109 -0
- package/dist/chunk-jagzz148.js +527 -0
- package/dist/{chunk-1d4316hp.js → chunk-jfvq7s24.js} +38 -25
- package/dist/chunk-mbctzx7e.js +11436 -0
- package/dist/chunk-mej2bx5n.js +100 -0
- package/dist/chunk-p6spvbwq.js +6305 -0
- package/dist/chunk-pp1p3g6e.js +133 -0
- package/dist/chunk-r8p3nxcp.js +231 -0
- package/dist/chunk-txwt6r25.js +1731 -0
- package/dist/chunk-v290mf51.js +5242 -0
- package/dist/chunk-vjmz23rs.js +13 -0
- package/dist/chunk-vyv0p5eq.js +3183 -0
- package/dist/chunk-wh1pa2aa.js +15322 -0
- package/dist/chunk-x0b92bjb.js +222 -0
- package/dist/{chunk-8z5b6fpd.js → chunk-x9dhxfts.js} +216 -152
- package/dist/chunk-z821b2gp.js +164 -0
- package/dist/index.js +13 -5738
- package/dist/opencode-reader.main.ts +4 -0
- package/package.json +6 -5
- package/dist/chunk-3gxahgnq.js +0 -28495
- package/dist/chunk-ehzbtavj.js +0 -247
- package/dist/chunk-f5z8tgss.js +0 -1214
- package/dist/chunk-kdb1cbnx.js +0 -1273
- package/dist/chunk-ke1w0hx7.js +0 -5771
- package/dist/chunk-z6hc4ew9.js +0 -13
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
isString
|
|
4
|
+
} from "./chunk-arvwar2c.js";
|
|
5
|
+
|
|
6
|
+
// packages/core/src/question-recommendation.ts
|
|
7
|
+
var optionValue = (option) => isString(option) ? option : option.value;
|
|
8
|
+
var splitQuestionOptions = (options) => {
|
|
9
|
+
const descriptions = Object.fromEntries(options.flatMap((option) => isString(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 };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
HERDR_CORE_GENERATION2,
|
|
4
|
+
HERDR_CORE_INSTALL_COMMAND2,
|
|
5
|
+
HerdrCoreMissing2,
|
|
6
|
+
HerdrCoreIncompatible2,
|
|
7
|
+
HerdrCoreConnectionLost2,
|
|
8
|
+
HerdrCoreRpcError2,
|
|
9
|
+
HerdrCoreUpdateFailed2,
|
|
10
|
+
HerdrCore2,
|
|
11
|
+
herdrCoreLayer2,
|
|
12
|
+
herdrCoreTransportLayer2,
|
|
13
|
+
updateHerdrCore2
|
|
14
|
+
} from "./chunk-wh1pa2aa.js";
|
|
15
|
+
import"./chunk-3bj7sc3v.js";
|
|
16
|
+
import"./chunk-11p4wf6n.js";
|
|
17
|
+
import"./chunk-mbctzx7e.js";
|
|
18
|
+
export {
|
|
19
|
+
HERDR_CORE_GENERATION2 as HERDR_CORE_GENERATION,
|
|
20
|
+
HERDR_CORE_INSTALL_COMMAND2 as HERDR_CORE_INSTALL_COMMAND,
|
|
21
|
+
HerdrCore2 as HerdrCore,
|
|
22
|
+
HerdrCoreConnectionLost2 as HerdrCoreConnectionLost,
|
|
23
|
+
HerdrCoreIncompatible2 as HerdrCoreIncompatible,
|
|
24
|
+
HerdrCoreMissing2 as HerdrCoreMissing,
|
|
25
|
+
HerdrCoreRpcError2 as HerdrCoreRpcError,
|
|
26
|
+
HerdrCoreUpdateFailed2 as HerdrCoreUpdateFailed,
|
|
27
|
+
herdrCoreLayer2 as herdrCoreLayer,
|
|
28
|
+
herdrCoreTransportLayer2 as herdrCoreTransportLayer,
|
|
29
|
+
updateHerdrCore2 as updateHerdrCore
|
|
30
|
+
};
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
isString2,
|
|
4
|
+
hasProperty,
|
|
5
|
+
symbol,
|
|
6
|
+
hash,
|
|
7
|
+
symbol2,
|
|
8
|
+
equals,
|
|
9
|
+
BaseProto,
|
|
10
|
+
PipeInspectableProto,
|
|
11
|
+
Prototype,
|
|
12
|
+
some,
|
|
13
|
+
Service2,
|
|
14
|
+
getUnsafe,
|
|
15
|
+
succeed,
|
|
16
|
+
fail3,
|
|
17
|
+
getOrThrow,
|
|
18
|
+
TaggedError,
|
|
19
|
+
never,
|
|
20
|
+
flatMap3,
|
|
21
|
+
andThen2,
|
|
22
|
+
map8,
|
|
23
|
+
raceFirst,
|
|
24
|
+
scoped
|
|
25
|
+
} from "./chunk-mbctzx7e.js";
|
|
26
|
+
import {
|
|
27
|
+
unwrap,
|
|
28
|
+
drainFork,
|
|
29
|
+
decodeText,
|
|
30
|
+
splitLines,
|
|
31
|
+
runCollect,
|
|
32
|
+
runDrain,
|
|
33
|
+
mkString
|
|
34
|
+
} from "./chunk-11p4wf6n.js";
|
|
35
|
+
|
|
36
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
|
|
37
|
+
var redactedRegistry = /* @__PURE__ */ new WeakMap;
|
|
38
|
+
var value2 = (self) => {
|
|
39
|
+
if (redactedRegistry.has(self)) {
|
|
40
|
+
return redactedRegistry.get(self);
|
|
41
|
+
} else {
|
|
42
|
+
throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Redacted.js
|
|
47
|
+
var TypeId = "~effect/Redacted";
|
|
48
|
+
var isRedacted = (u) => hasProperty(u, TypeId);
|
|
49
|
+
var make5 = (value, options) => {
|
|
50
|
+
const self = Object.create(Proto);
|
|
51
|
+
if (options?.label) {
|
|
52
|
+
self.label = options.label;
|
|
53
|
+
}
|
|
54
|
+
redactedRegistry.set(self, value);
|
|
55
|
+
return self;
|
|
56
|
+
};
|
|
57
|
+
var Proto = {
|
|
58
|
+
[TypeId]: {
|
|
59
|
+
_A: (_) => _
|
|
60
|
+
},
|
|
61
|
+
label: undefined,
|
|
62
|
+
...PipeInspectableProto,
|
|
63
|
+
toJSON() {
|
|
64
|
+
return this.toString();
|
|
65
|
+
},
|
|
66
|
+
toString() {
|
|
67
|
+
return `<redacted${isString2(this.label) ? ":" + this.label : ""}>`;
|
|
68
|
+
},
|
|
69
|
+
[symbol]() {
|
|
70
|
+
return hash(redactedRegistry.get(this));
|
|
71
|
+
},
|
|
72
|
+
[symbol2](that) {
|
|
73
|
+
return isRedacted(that) && equals(redactedRegistry.get(this), redactedRegistry.get(that));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
var value = value2;
|
|
77
|
+
|
|
78
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Brand.js
|
|
79
|
+
function nominal() {
|
|
80
|
+
return Object.assign((input) => input, {
|
|
81
|
+
option: (input) => some(input),
|
|
82
|
+
result: (input) => succeed(input),
|
|
83
|
+
is: (_) => true
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/process/ChildProcessSpawner.js
|
|
88
|
+
var ExitCode = /* @__PURE__ */ nominal();
|
|
89
|
+
var ProcessId = /* @__PURE__ */ nominal();
|
|
90
|
+
var HandleTypeId = "~effect/process/ChildProcessSpawner/ChildProcessHandle";
|
|
91
|
+
var HandleProto = {
|
|
92
|
+
[HandleTypeId]: HandleTypeId,
|
|
93
|
+
...BaseProto,
|
|
94
|
+
toJSON() {
|
|
95
|
+
return {
|
|
96
|
+
_id: "ChildProcessHandle",
|
|
97
|
+
pid: this.pid
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var makeHandle = (params) => Object.setPrototypeOf({
|
|
102
|
+
...params
|
|
103
|
+
}, HandleProto);
|
|
104
|
+
var make6 = (spawn) => {
|
|
105
|
+
const streamString = (command, options) => spawn(command).pipe(map8((handle) => decodeText(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap);
|
|
106
|
+
const streamLines = (command, options) => splitLines(streamString(command, options));
|
|
107
|
+
return ChildProcessSpawner.of({
|
|
108
|
+
spawn,
|
|
109
|
+
exitCode: (command) => scoped(flatMap3(spawn(command), (handle) => raceFirst(handle.exitCode, andThen2(runDrain(handle.all), never)))),
|
|
110
|
+
streamString,
|
|
111
|
+
streamLines,
|
|
112
|
+
lines: (command, options) => runCollect(streamLines(command, options)),
|
|
113
|
+
string: (command, options) => mkString(streamString(command, options))
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
class ChildProcessSpawner extends (/* @__PURE__ */ Service2()("effect/process/ChildProcessSpawner")) {
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/process/CommandLine.js
|
|
121
|
+
class CommandLineError extends (/* @__PURE__ */ TaggedError("CommandLineError")) {
|
|
122
|
+
}
|
|
123
|
+
var display = (words, options) => {
|
|
124
|
+
if (words.length === 0)
|
|
125
|
+
return "";
|
|
126
|
+
const format = options?.format ?? "posix";
|
|
127
|
+
return joinWords(format, words.map((word, i) => isRedacted(word) ? "<redacted>" : escapeControlCharacters(quoteWord(format, word, i === 0))));
|
|
128
|
+
};
|
|
129
|
+
var template = (strings, ...expressions) => {
|
|
130
|
+
const index = strings.findIndex((text) => text === undefined);
|
|
131
|
+
if (index !== -1) {
|
|
132
|
+
return fail3(new CommandLineError({
|
|
133
|
+
reason: "InvalidEscape",
|
|
134
|
+
message: `Template part ${index} contains an invalid escape sequence`
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
return parseTemplate(strings, expressions);
|
|
138
|
+
};
|
|
139
|
+
var unwrap2 = (item) => isRedacted(item) ? value(item) : String(item);
|
|
140
|
+
var toWord = (item) => isRedacted(item) ? item : String(item);
|
|
141
|
+
var reservedWords = /* @__PURE__ */ new Set(["!", "{", "}", "and", "begin", "case", "coproc", "do", "done", "elif", "else", "end", "esac", "fi", "for", "foreach", "function", "if", "in", "nocorrect", "not", "or", "repeat", "select", "switch", "then", "time", "until", "while"]);
|
|
142
|
+
var quoteWord = (format, value, program) => {
|
|
143
|
+
switch (format) {
|
|
144
|
+
case "posix":
|
|
145
|
+
return program && reservedWords.has(value) ? `'${value}'` : quotePosix(value);
|
|
146
|
+
case "powershell":
|
|
147
|
+
return quotePowerShell(value);
|
|
148
|
+
case "windows":
|
|
149
|
+
return program && !value.includes('"') ? quoteWindowsProgram(value) : quoteWindowsArgument(value);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var joinWords = (format, quoted) => format === "powershell" ? `& ${quoted.join(" ")}` : quoted.join(" ");
|
|
153
|
+
var posixSafe = /^[A-Za-z0-9_@+:,./-]+$/;
|
|
154
|
+
var quotePosix = (value) => posixSafe.test(value) ? value : `'${value.replace(/['\\]/g, (char) => `'\\${char}'`)}'`;
|
|
155
|
+
var quotePowerShell = (value) => `'${value.replace(/['\u2018\u2019\u201A\u201B]/g, "$&$&")}'`;
|
|
156
|
+
var windowsNeedsQuotes = /[ \t\n\v"]/;
|
|
157
|
+
var quoteWindowsArgument = (value) => {
|
|
158
|
+
if (value.length > 0 && !windowsNeedsQuotes.test(value))
|
|
159
|
+
return value;
|
|
160
|
+
let out = '"';
|
|
161
|
+
let backslashes = 0;
|
|
162
|
+
for (const char of value) {
|
|
163
|
+
if (char === "\\") {
|
|
164
|
+
backslashes++;
|
|
165
|
+
} else if (char === '"') {
|
|
166
|
+
out += "\\".repeat(backslashes * 2 + 1) + '"';
|
|
167
|
+
backslashes = 0;
|
|
168
|
+
} else {
|
|
169
|
+
out += "\\".repeat(backslashes) + char;
|
|
170
|
+
backslashes = 0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return out + "\\".repeat(backslashes * 2) + '"';
|
|
174
|
+
};
|
|
175
|
+
var quoteWindowsProgram = (value) => value.length > 0 && !/[ \t]/.test(value) ? value : `"${value}"`;
|
|
176
|
+
var controlCharacters = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g;
|
|
177
|
+
var controlEscapes = {
|
|
178
|
+
"\n": "\\n",
|
|
179
|
+
"\r": "\\r",
|
|
180
|
+
"\t": "\\t"
|
|
181
|
+
};
|
|
182
|
+
var escapeControlCharacters = (value) => value.replace(controlCharacters, (char) => controlEscapes[char] ?? `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
183
|
+
var operators = "|&;<>()";
|
|
184
|
+
var globs = "*?[";
|
|
185
|
+
var expansionStart = /[A-Za-z_0-9{(@*#?$!'"-]/;
|
|
186
|
+
var quotedExpansionStart = /[A-Za-z_0-9{(@*#?$!-]/;
|
|
187
|
+
var assignmentName = /^[A-Za-z_][A-Za-z0-9_]*\+?$/;
|
|
188
|
+
var isBlank = (char) => char === " " || char === "\t" || char === `
|
|
189
|
+
`;
|
|
190
|
+
var unsupportedSyntax = (char, next, wordStart) => {
|
|
191
|
+
if (operators.includes(char))
|
|
192
|
+
return `The operator "${char}" needs a shell`;
|
|
193
|
+
if (char === "`")
|
|
194
|
+
return "Command substitution needs a shell";
|
|
195
|
+
if (char === "$" && next !== undefined && expansionStart.test(next))
|
|
196
|
+
return `The expansion "$${next}" needs a shell`;
|
|
197
|
+
if (globs.includes(char))
|
|
198
|
+
return `The glob character "${char}" needs a shell`;
|
|
199
|
+
if (!wordStart)
|
|
200
|
+
return;
|
|
201
|
+
if (char === "#")
|
|
202
|
+
return "A comment needs a shell";
|
|
203
|
+
if (char === "~")
|
|
204
|
+
return "Tilde expansion needs a shell";
|
|
205
|
+
if (char === "=" && next !== undefined && !isBlank(next))
|
|
206
|
+
return 'A leading "=" is expanded by zsh';
|
|
207
|
+
return;
|
|
208
|
+
};
|
|
209
|
+
var parseTemplate = (texts, values) => {
|
|
210
|
+
const words = [];
|
|
211
|
+
let word = [];
|
|
212
|
+
let plain = true;
|
|
213
|
+
let braceDepth = 0;
|
|
214
|
+
let quote = undefined;
|
|
215
|
+
let quotePart = 0;
|
|
216
|
+
let part = 0;
|
|
217
|
+
const error = (reason, message, at = part) => fail3(new CommandLineError({
|
|
218
|
+
reason,
|
|
219
|
+
message: `${message} in template part ${at}`
|
|
220
|
+
}));
|
|
221
|
+
const endWord = () => {
|
|
222
|
+
if (word.length === 0)
|
|
223
|
+
return;
|
|
224
|
+
const value = word.map(unwrap2).join("");
|
|
225
|
+
words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make5(value) : value);
|
|
226
|
+
word = [];
|
|
227
|
+
plain = true;
|
|
228
|
+
braceDepth = 0;
|
|
229
|
+
};
|
|
230
|
+
const scan = (text) => {
|
|
231
|
+
for (let i = 0;i < text.length; i++) {
|
|
232
|
+
const char = text[i];
|
|
233
|
+
const next = text[i + 1];
|
|
234
|
+
if (quote === "'") {
|
|
235
|
+
if (char === "'")
|
|
236
|
+
quote = undefined;
|
|
237
|
+
else
|
|
238
|
+
word.push(char);
|
|
239
|
+
} else if (quote === '"') {
|
|
240
|
+
if (char === '"') {
|
|
241
|
+
quote = undefined;
|
|
242
|
+
} else if (char === "\\" && next !== undefined && '$`"\\\n'.includes(next)) {
|
|
243
|
+
if (next !== `
|
|
244
|
+
`)
|
|
245
|
+
word.push(next);
|
|
246
|
+
i++;
|
|
247
|
+
} else if (char === "`") {
|
|
248
|
+
return error("UnsupportedSyntax", "Command substitution needs a shell");
|
|
249
|
+
} else if (char === "$" && next !== undefined && quotedExpansionStart.test(next)) {
|
|
250
|
+
return error("UnsupportedSyntax", `The expansion "$${next}" needs a shell`);
|
|
251
|
+
} else {
|
|
252
|
+
word.push(char);
|
|
253
|
+
}
|
|
254
|
+
} else if (isBlank(char)) {
|
|
255
|
+
endWord();
|
|
256
|
+
} else if (char === "\\") {
|
|
257
|
+
if (next === undefined)
|
|
258
|
+
return error("InvalidEscape", "A trailing backslash escapes nothing");
|
|
259
|
+
if (next !== `
|
|
260
|
+
`) {
|
|
261
|
+
word.push(next);
|
|
262
|
+
plain = false;
|
|
263
|
+
}
|
|
264
|
+
i++;
|
|
265
|
+
} else if (char === "'" || char === '"') {
|
|
266
|
+
quote = char;
|
|
267
|
+
quotePart = part;
|
|
268
|
+
word.push("");
|
|
269
|
+
plain = false;
|
|
270
|
+
} else {
|
|
271
|
+
const unsupported = unsupportedSyntax(char, next, word.length === 0);
|
|
272
|
+
if (unsupported !== undefined)
|
|
273
|
+
return error("UnsupportedSyntax", unsupported);
|
|
274
|
+
if (char === "{") {
|
|
275
|
+
braceDepth++;
|
|
276
|
+
} else if (char === "}") {
|
|
277
|
+
if (braceDepth > 0)
|
|
278
|
+
braceDepth--;
|
|
279
|
+
} else if (braceDepth > 0 && (char === "," || char === "." && next === ".")) {
|
|
280
|
+
return error("UnsupportedSyntax", "Brace expansion needs a shell");
|
|
281
|
+
} else if (char === "=" && words.length === 0 && plain && assignmentName.test(word.join(""))) {
|
|
282
|
+
return error("UnsupportedSyntax", "A variable assignment needs a shell");
|
|
283
|
+
}
|
|
284
|
+
word.push(char);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return;
|
|
288
|
+
};
|
|
289
|
+
for (;part < texts.length; part++) {
|
|
290
|
+
const failure = scan(texts[part]);
|
|
291
|
+
if (failure !== undefined)
|
|
292
|
+
return failure;
|
|
293
|
+
if (part === values.length)
|
|
294
|
+
break;
|
|
295
|
+
const expression = values[part];
|
|
296
|
+
if (Array.isArray(expression)) {
|
|
297
|
+
const after = texts[part + 1][0];
|
|
298
|
+
if (word.length > 0 || (after === undefined ? part + 1 < values.length : !isBlank(after))) {
|
|
299
|
+
return error("UnsupportedSyntax", "An interpolated array must be a separate argument");
|
|
300
|
+
}
|
|
301
|
+
for (const item of expression)
|
|
302
|
+
words.push(toWord(item));
|
|
303
|
+
} else {
|
|
304
|
+
word.push(toWord(expression));
|
|
305
|
+
plain = false;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (quote !== undefined)
|
|
309
|
+
return error("UnterminatedQuote", "The quote is not closed", quotePart);
|
|
310
|
+
endWord();
|
|
311
|
+
return succeed(words);
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/process/ChildProcess.js
|
|
315
|
+
var TypeId2 = "~effect/process/ChildProcess";
|
|
316
|
+
var Proto2 = {
|
|
317
|
+
.../* @__PURE__ */ Prototype({
|
|
318
|
+
label: "Command",
|
|
319
|
+
evaluate(fiber) {
|
|
320
|
+
return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
|
|
321
|
+
}
|
|
322
|
+
}),
|
|
323
|
+
[TypeId2]: TypeId2
|
|
324
|
+
};
|
|
325
|
+
var makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto2), {
|
|
326
|
+
_tag: "StandardCommand",
|
|
327
|
+
command,
|
|
328
|
+
args,
|
|
329
|
+
options
|
|
330
|
+
});
|
|
331
|
+
var make7 = function make(...args) {
|
|
332
|
+
if (isTemplateString(args[0])) {
|
|
333
|
+
const [templates, ...expressions] = args;
|
|
334
|
+
const [command, cmdArgs] = parseTemplate2(templates, expressions);
|
|
335
|
+
return makeStandardCommand(command, cmdArgs, {});
|
|
336
|
+
}
|
|
337
|
+
if (typeof args[0] === "object" && !Array.isArray(args[0]) && !isTemplateString(args[0])) {
|
|
338
|
+
const options = args[0];
|
|
339
|
+
return function(templates, ...expressions) {
|
|
340
|
+
if (options.shell !== undefined && options.shell !== false) {
|
|
341
|
+
return makeStandardCommand(shellScript(templates, expressions), [], options);
|
|
342
|
+
}
|
|
343
|
+
const [command, cmdArgs] = parseTemplate2(templates, expressions);
|
|
344
|
+
return makeStandardCommand(command, cmdArgs, options);
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
if (typeof args[0] === "string" && !Array.isArray(args[1])) {
|
|
348
|
+
const [command, options = {}] = args;
|
|
349
|
+
return makeStandardCommand(command, [], options);
|
|
350
|
+
}
|
|
351
|
+
const [command, cmdArgs = [], options = {}] = args;
|
|
352
|
+
return makeStandardCommand(command, cmdArgs, options);
|
|
353
|
+
};
|
|
354
|
+
var isTemplateString = (u) => Array.isArray(u) && ("raw" in u) && Array.isArray(u.raw);
|
|
355
|
+
var parseFdName = (name) => {
|
|
356
|
+
const match = /^fd(\d+)$/.exec(name);
|
|
357
|
+
if (match === null)
|
|
358
|
+
return;
|
|
359
|
+
const fd = parseInt(match[1], 10);
|
|
360
|
+
return fd >= 3 ? fd : undefined;
|
|
361
|
+
};
|
|
362
|
+
var fdName = (fd) => `fd${fd}`;
|
|
363
|
+
var parseTemplate2 = (templates, expressions) => {
|
|
364
|
+
const [program = "", ...args] = getOrThrow(template(templates, ...expressions));
|
|
365
|
+
if (typeof program !== "string") {
|
|
366
|
+
throw new CommandLineError({
|
|
367
|
+
reason: "InvalidArgument",
|
|
368
|
+
message: "The program name of a command cannot be Redacted"
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return [program, args];
|
|
372
|
+
};
|
|
373
|
+
var shellScript = (templates, expressions) => {
|
|
374
|
+
if (expressions.length > 0) {
|
|
375
|
+
throw new CommandLineError({
|
|
376
|
+
reason: "UnsupportedSyntax",
|
|
377
|
+
message: "A shell template cannot interpolate values; build the script with CommandLine.quote"
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
const script = templates[0];
|
|
381
|
+
if (script === undefined) {
|
|
382
|
+
throw new CommandLineError({
|
|
383
|
+
reason: "InvalidEscape",
|
|
384
|
+
message: "Template part 0 contains an invalid escape sequence"
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
return script;
|
|
388
|
+
};
|
|
389
|
+
export { isRedacted, make5, value, ExitCode, ProcessId, makeHandle, make6, ChildProcessSpawner, display, make7, parseFdName, fdName };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
sliceBytes2,
|
|
4
|
+
maxLineBytes2,
|
|
5
|
+
linesPerTurn2,
|
|
6
|
+
decodedOption2,
|
|
7
|
+
decoded2,
|
|
8
|
+
readOpencode2,
|
|
9
|
+
runOpencodeReader2
|
|
10
|
+
} from "./chunk-x0b92bjb.js";
|
|
11
|
+
import"./chunk-3bj7sc3v.js";
|
|
12
|
+
import"./chunk-11p4wf6n.js";
|
|
13
|
+
import"./chunk-arvwar2c.js";
|
|
14
|
+
import"./chunk-mbctzx7e.js";
|
|
15
|
+
export {
|
|
16
|
+
decoded2 as decoded,
|
|
17
|
+
decodedOption2 as decodedOption,
|
|
18
|
+
linesPerTurn2 as linesPerTurn,
|
|
19
|
+
maxLineBytes2 as maxLineBytes,
|
|
20
|
+
readOpencode2 as readOpencode,
|
|
21
|
+
runOpencodeReader2 as runOpencodeReader,
|
|
22
|
+
sliceBytes2 as sliceBytes
|
|
23
|
+
};
|