engine7 7.1.63 → 7.1.64
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/cli.mjs +28 -13
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -19805,12 +19805,12 @@ function startStdinHandler() {
|
|
|
19805
19805
|
`);
|
|
19806
19806
|
return;
|
|
19807
19807
|
}
|
|
19808
|
-
if (msg2.type === "user") {
|
|
19808
|
+
if (msg2.type === "user" || msg2.type === void 0 && msg2.message?.content !== void 0) {
|
|
19809
19809
|
const content = msg2.message?.content;
|
|
19810
19810
|
let text = "";
|
|
19811
19811
|
if (typeof content === "string") text = content;
|
|
19812
19812
|
else if (Array.isArray(content)) {
|
|
19813
|
-
text = content.filter((b) => b?.type === "text").map((b) => b.text).join("\n");
|
|
19813
|
+
text = content.filter((b) => b?.type === "text" || typeof b?.text === "string").map((b) => b.text).join("\n");
|
|
19814
19814
|
}
|
|
19815
19815
|
if (text) {
|
|
19816
19816
|
userTexts.push(text);
|
|
@@ -20062,17 +20062,6 @@ async function doCcRun(argv) {
|
|
|
20062
20062
|
}
|
|
20063
20063
|
}
|
|
20064
20064
|
installStdoutGuard();
|
|
20065
|
-
if (args.inputFormat === "stream-json" && !process.stdin.isTTY) {
|
|
20066
|
-
const stdinPromise = startStdinHandler();
|
|
20067
|
-
if (!args.prompt) {
|
|
20068
|
-
const stdinPrompt = await stdinPromise;
|
|
20069
|
-
if (stdinPrompt) args.prompt = stdinPrompt;
|
|
20070
|
-
}
|
|
20071
|
-
}
|
|
20072
|
-
if (!args.prompt) {
|
|
20073
|
-
process.stderr.write("cc-run: \u6CA1\u6536\u5230 prompt\uFF08-p \u6216 stdin user message \u5747\u4E3A\u7A7A\uFF09\n");
|
|
20074
|
-
return 1;
|
|
20075
|
-
}
|
|
20076
20065
|
const sessionId = args.sessionId || randomUUID9();
|
|
20077
20066
|
args.sessionId = sessionId;
|
|
20078
20067
|
let model = "";
|
|
@@ -20099,6 +20088,17 @@ async function doCcRun(argv) {
|
|
|
20099
20088
|
}
|
|
20100
20089
|
emitInit(sessionId, model);
|
|
20101
20090
|
}
|
|
20091
|
+
if (args.inputFormat === "stream-json" && !process.stdin.isTTY) {
|
|
20092
|
+
const stdinPromise = startStdinHandler();
|
|
20093
|
+
if (!args.prompt) {
|
|
20094
|
+
const stdinPrompt = await stdinPromise;
|
|
20095
|
+
if (stdinPrompt) args.prompt = stdinPrompt;
|
|
20096
|
+
}
|
|
20097
|
+
}
|
|
20098
|
+
if (!args.prompt) {
|
|
20099
|
+
process.stderr.write("cc-run: \u6CA1\u6536\u5230 prompt\uFF08-p \u6216 stdin user message \u5747\u4E3A\u7A7A\uFF09\n");
|
|
20100
|
+
return 1;
|
|
20101
|
+
}
|
|
20102
20102
|
let result;
|
|
20103
20103
|
try {
|
|
20104
20104
|
result = await runQuery(args);
|
|
@@ -21487,6 +21487,21 @@ function execute(entries2) {
|
|
|
21487
21487
|
async function main() {
|
|
21488
21488
|
const args = process.argv.slice(2);
|
|
21489
21489
|
const subcommand = args[0];
|
|
21490
|
+
const CC_FLAGS = /* @__PURE__ */ new Set([
|
|
21491
|
+
"-p",
|
|
21492
|
+
"--print",
|
|
21493
|
+
"--output-format",
|
|
21494
|
+
"--input-format",
|
|
21495
|
+
"--permission-mode",
|
|
21496
|
+
"--disallowedTools",
|
|
21497
|
+
"--list-models",
|
|
21498
|
+
"--resume"
|
|
21499
|
+
]);
|
|
21500
|
+
if (subcommand !== void 0 && CC_FLAGS.has(subcommand)) {
|
|
21501
|
+
const { doCcRun: doCcRun2 } = await Promise.resolve().then(() => (init_cli_ccrun(), cli_ccrun_exports));
|
|
21502
|
+
const code = await doCcRun2(args);
|
|
21503
|
+
process.exit(code);
|
|
21504
|
+
}
|
|
21490
21505
|
if (!subcommand) {
|
|
21491
21506
|
printHelp();
|
|
21492
21507
|
process.exit(0);
|