replicas-cli 0.2.766 → 0.2.767
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/index.cjs +28 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23182,7 +23182,7 @@ var WRAPPER_VALUE_OPTIONS = {
|
|
|
23182
23182
|
};
|
|
23183
23183
|
var ANSI_C_ESCAPES = { n: "\n", t: " ", r: "\r", a: "\x07", b: "\b", e: "\x1B", E: "\x1B", f: "\f", v: "\v" };
|
|
23184
23184
|
function parseShellScript(script, cwd) {
|
|
23185
|
-
const scope = { src: script, vars: /* @__PURE__ */ new Map(), dir: cwd, commands: [], depth: 0 };
|
|
23185
|
+
const scope = { src: script, vars: /* @__PURE__ */ new Map(), dir: cwd, commands: [], depth: 0, subshell: false };
|
|
23186
23186
|
parseUntil(scope, 0, false);
|
|
23187
23187
|
return scope.commands;
|
|
23188
23188
|
}
|
|
@@ -23282,16 +23282,18 @@ function emit(scope, raw) {
|
|
|
23282
23282
|
stdin,
|
|
23283
23283
|
afterAnd: raw.afterAnd,
|
|
23284
23284
|
stdinFile: stdinFile ? resolveShellPath(scope.dir, stdinFile.target) : null,
|
|
23285
|
-
writes: raw.redirects.flatMap(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target) ? [{ path: resolveShellPath(scope.dir, target), content: output, append: op.endsWith(">>") }] : []),
|
|
23285
|
+
writes: raw.redirects.flatMap(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target) ? [{ path: resolveShellPath(scope.dir, target), target, content: output, append: op.endsWith(">>") }] : []),
|
|
23286
23286
|
wrapper: script !== void 0,
|
|
23287
|
-
truncated
|
|
23287
|
+
truncated,
|
|
23288
|
+
piped: raw.pipeFrom !== void 0,
|
|
23289
|
+
subshell: scope.subshell || raw.subshell
|
|
23288
23290
|
});
|
|
23289
23291
|
if (name === "cd" || name === "pushd" || name === "popd") {
|
|
23290
23292
|
scope.dir = name !== "popd" && argv[1] && argv[1] !== "-" ? resolveShellPath(scope.dir, argv[1]) : null;
|
|
23291
23293
|
} else if (["export", "declare", "local", "readonly"].includes(name)) {
|
|
23292
23294
|
assign(scope, argv.slice(1).filter((arg) => /^[A-Za-z_]\w*=/.test(arg)));
|
|
23293
23295
|
}
|
|
23294
|
-
if (script && !truncated) parseUntil({ src: script, vars: name === "eval" ? scope.vars : /* @__PURE__ */ new Map(), dir: scope.dir, commands: scope.commands, depth: scope.depth + 1 }, 0, false);
|
|
23296
|
+
if (script && !truncated) parseUntil({ src: script, vars: name === "eval" ? scope.vars : /* @__PURE__ */ new Map(), dir: scope.dir, commands: scope.commands, depth: scope.depth + 1, subshell: scope.subshell || raw.subshell }, 0, false);
|
|
23295
23297
|
}
|
|
23296
23298
|
function readHeredocBodies(scope, heredocs, start) {
|
|
23297
23299
|
const { src } = scope;
|
|
@@ -23339,7 +23341,7 @@ function readDoubleQuoted(scope, start, terminator) {
|
|
|
23339
23341
|
return { value, end: i };
|
|
23340
23342
|
}
|
|
23341
23343
|
function substitute(scope, src, start, closeParen) {
|
|
23342
|
-
const child = { src, vars: new Map(scope.vars), dir: scope.dir, commands: [], depth: scope.depth + 1 };
|
|
23344
|
+
const child = { src, vars: new Map(scope.vars), dir: scope.dir, commands: [], depth: scope.depth + 1, subshell: true };
|
|
23343
23345
|
const end = parseUntil(child, start, closeParen);
|
|
23344
23346
|
scope.commands.push(...child.commands);
|
|
23345
23347
|
const [only] = child.commands;
|
|
@@ -23384,7 +23386,7 @@ function parseUntil(scope, start, closeParen) {
|
|
|
23384
23386
|
const { src } = scope;
|
|
23385
23387
|
let i = start;
|
|
23386
23388
|
let line = [];
|
|
23387
|
-
let current = { words: [], redirects: [], heredocs: [], afterAnd: false };
|
|
23389
|
+
let current = { words: [], redirects: [], heredocs: [], afterAnd: false, subshell: false };
|
|
23388
23390
|
let pendingHeredocs = [];
|
|
23389
23391
|
let word = null;
|
|
23390
23392
|
let quoted = false;
|
|
@@ -23412,7 +23414,8 @@ function parseUntil(scope, start, closeParen) {
|
|
|
23412
23414
|
const endCommand = (op) => {
|
|
23413
23415
|
endWord();
|
|
23414
23416
|
const done = current;
|
|
23415
|
-
|
|
23417
|
+
if (op === "&") done.subshell = true;
|
|
23418
|
+
current = { words: [], redirects: [], heredocs: [], pipeFrom: op === "|" || op === "|&" ? done : void 0, afterAnd: op === "&&", subshell: parens > 0 };
|
|
23416
23419
|
if (done.words.length > 0 || done.redirects.length > 0 || done.heredocs.length > 0) line.push(done);
|
|
23417
23420
|
};
|
|
23418
23421
|
const flush = () => {
|
|
@@ -23589,16 +23592,25 @@ function insertDisplayMessageByTimestamp(messages, message) {
|
|
|
23589
23592
|
}
|
|
23590
23593
|
|
|
23591
23594
|
// ../shared/src/display-message/format.ts
|
|
23592
|
-
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
return
|
|
23595
|
+
var SCRIPT_ROOT = "/";
|
|
23596
|
+
var commandName = (argv) => argv[0].split("/").pop() ?? argv[0];
|
|
23597
|
+
var fileWrites = ({ writes }) => writes.filter(({ path: path7 }) => path7 !== "/dev/null");
|
|
23598
|
+
function shellCommands(command) {
|
|
23599
|
+
return parseShellScript(command, SCRIPT_ROOT).filter(({ wrapper }) => !wrapper);
|
|
23600
|
+
}
|
|
23601
|
+
function simpleCommands(command) {
|
|
23602
|
+
const commands = shellCommands(command);
|
|
23603
|
+
const hasRedirectOrSubshell = commands.some((shellCommand) => shellCommand.subshell || shellCommand.stdinFile !== null || !shellCommand.piped && shellCommand.stdin !== void 0 || fileWrites(shellCommand).length > 0);
|
|
23604
|
+
if (commands.length === 0 || hasRedirectOrSubshell) return null;
|
|
23605
|
+
return commands.map((shellCommand) => {
|
|
23606
|
+
const argv = shellCommand.argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026"));
|
|
23607
|
+
return { ...shellCommand, argv, name: commandName(argv) };
|
|
23608
|
+
});
|
|
23597
23609
|
}
|
|
23598
23610
|
function skillNamesFromCommand(command) {
|
|
23599
|
-
const
|
|
23600
|
-
if (!
|
|
23601
|
-
return Array.from(new Set(
|
|
23611
|
+
const commands = simpleCommands(command);
|
|
23612
|
+
if (!commands) return [];
|
|
23613
|
+
return Array.from(new Set(commands.flatMap(({ argv }) => argv).flatMap((word) => {
|
|
23602
23614
|
const skillName = skillNameFromSkillRootPath(word);
|
|
23603
23615
|
return skillName ? [skillName] : [];
|
|
23604
23616
|
})));
|
|
@@ -27936,7 +27948,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
27936
27948
|
});
|
|
27937
27949
|
|
|
27938
27950
|
// ../shared/src/cli-version.ts
|
|
27939
|
-
var CLI_VERSION = "0.2.
|
|
27951
|
+
var CLI_VERSION = "0.2.767";
|
|
27940
27952
|
|
|
27941
27953
|
// ../shared/src/version.ts
|
|
27942
27954
|
function compareVersions(v1, v2) {
|