replicas-cli 0.3.230 → 0.3.232

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 (2) hide show
  1. package/dist/index.cjs +29 -29
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -16850,7 +16850,8 @@ var init_v1 = __esm({
16850
16850
  senderAvatarUrl: external_exports.string().optional(),
16851
16851
  errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
16852
16852
  errorNotificationTargets: external_exports.array(integrationErrorNotificationTargetSchema).optional(),
16853
- replacesMessageId: external_exports.string().min(1).max(256).optional()
16853
+ replacesMessageId: external_exports.string().min(1).max(256).optional(),
16854
+ steer: external_exports.union([external_exports.boolean(), external_exports.literal("alone")]).optional()
16854
16855
  }).passthrough();
16855
16856
  CODEX_ITEM_FIELD_CHECKS = {
16856
16857
  userMessage: (item) => typeof item.content === "string",
@@ -16869,7 +16870,8 @@ var init_v1 = __esm({
16869
16870
  messageId: external_exports.string(),
16870
16871
  queued: external_exports.boolean(),
16871
16872
  position: external_exports.number(),
16872
- chatId: external_exports.string().optional()
16873
+ chatId: external_exports.string().optional(),
16874
+ steered: external_exports.boolean().optional()
16873
16875
  });
16874
16876
  }
16875
16877
  });
@@ -20967,15 +20969,15 @@ function skillNamesFromCommand(command) {
20967
20969
  });
20968
20970
  })));
20969
20971
  }
20970
- function pathArgs(words, extraValueFlags) {
20972
+ function pathArgs(command, words) {
20971
20973
  const paths = [];
20972
20974
  for (let i = 0; i < words.length; i++) {
20973
20975
  const word = words[i];
20974
- if (OPTION_VALUE_FLAGS.has(word) || extraValueFlags?.has(word)) {
20976
+ const valueAt = /^-[A-Za-z]{2,}$/.test(word) ? [...word.slice(1)].findIndex((letter) => VALUE_FLAGS[command]?.has(`-${letter}`)) : -1;
20977
+ if (VALUE_FLAGS[command]?.has(word) || valueAt >= 0 && valueAt === word.length - 2) {
20975
20978
  i++;
20976
20979
  continue;
20977
20980
  }
20978
- if (word.startsWith("--glob=") || word.startsWith("--regexp=")) continue;
20979
20981
  if (word.startsWith("-")) continue;
20980
20982
  paths.push(word);
20981
20983
  }
@@ -20983,8 +20985,13 @@ function pathArgs(words, extraValueFlags) {
20983
20985
  }
20984
20986
  function readCommandPaths(command, words) {
20985
20987
  if (SEARCH_COMMANDS.has(command)) {
20986
- const args = pathArgs(words.slice(1));
20987
- return args.slice(1);
20988
+ const args = pathArgs(command, words.slice(1));
20989
+ return words.some((word) => PATTERN_FLAGS.has(word) || /^-[A-Za-z]+[ef]$/.test(word) || /^--(file|regexp)=/.test(word)) ? args : args.slice(1);
20990
+ }
20991
+ if (command === "find") {
20992
+ const paths = words.slice(1).filter((word) => !/^(-[HLP]|-O\d|--)$/.test(word));
20993
+ const expression = paths.findIndex((word) => word.startsWith("-") || word === "(" || word === "!");
20994
+ return expression === -1 ? paths : paths.slice(0, expression);
20988
20995
  }
20989
20996
  if (command === "sed") {
20990
20997
  const paths = [];
@@ -21010,13 +21017,13 @@ function readCommandPaths(command, words) {
21010
21017
  }
21011
21018
  return Array.from(new Set(paths));
21012
21019
  }
21013
- return pathArgs(words.slice(1), command === "head" || command === "tail" ? LINE_COUNT_VALUE_FLAGS : void 0);
21020
+ return pathArgs(command, words.slice(1));
21014
21021
  }
21015
21022
  function writesFiles(name, argv) {
21016
21023
  if (name === "sed") return argv.some((word) => /^(-[a-zA-Z]*i|--in-place)/.test(word));
21017
21024
  return name === "find" && argv.some((word) => /^-(exec|ok|delete|fprint|fls)/.test(word));
21018
21025
  }
21019
- var SEARCH_COMMANDS, OPTION_VALUE_FLAGS, LINE_COUNT_VALUE_FLAGS, SCRIPT_ROOT, commandName, fileWrites, SKILL_READ_COMMANDS;
21026
+ var SEARCH_COMMANDS, LINE_COUNT_VALUE_FLAGS, SEARCH_VALUE_FLAGS, VALUE_FLAGS, PATTERN_FLAGS, SCRIPT_ROOT, commandName, fileWrites, SKILL_READ_COMMANDS;
21020
21027
  var init_format2 = __esm({
21021
21028
  "../shared/src/display-message/format.ts"() {
21022
21029
  "use strict";
@@ -21026,25 +21033,18 @@ var init_format2 = __esm({
21026
21033
  init_shell_commands();
21027
21034
  init_utils();
21028
21035
  SEARCH_COMMANDS = /* @__PURE__ */ new Set(["grep", "rg"]);
21029
- OPTION_VALUE_FLAGS = /* @__PURE__ */ new Set([
21030
- "-A",
21031
- "-B",
21032
- "-C",
21033
- "-e",
21034
- "-f",
21035
- "-m",
21036
- "--after-context",
21037
- "--before-context",
21038
- "--context",
21039
- "--glob",
21040
- "--max-count",
21041
- "--regexp"
21042
- ]);
21043
- LINE_COUNT_VALUE_FLAGS = /* @__PURE__ */ new Set([
21044
- "-c",
21045
- "-n",
21046
- "--lines"
21047
- ]);
21036
+ LINE_COUNT_VALUE_FLAGS = /* @__PURE__ */ new Set(["-c", "-n", "--bytes", "--lines"]);
21037
+ SEARCH_VALUE_FLAGS = ["-A", "-B", "-C", "-d", "-e", "-f", "-m", "--after-context", "--before-context", "--context", "--file", "--max-count", "--regexp"];
21038
+ VALUE_FLAGS = {
21039
+ grep: /* @__PURE__ */ new Set([...SEARCH_VALUE_FLAGS, "-D", "--devices", "--directories", "--exclude", "--exclude-dir", "--include"]),
21040
+ rg: /* @__PURE__ */ new Set([...SEARCH_VALUE_FLAGS, "-E", "-M", "-T", "-g", "-j", "-t", "--encoding", "--glob", "--iglob", "--max-columns", "--max-depth", "--sort", "--sortr", "--threads", "--type", "--type-add", "--type-not"]),
21041
+ head: LINE_COUNT_VALUE_FLAGS,
21042
+ tail: LINE_COUNT_VALUE_FLAGS,
21043
+ ls: /* @__PURE__ */ new Set(["-I", "-T", "-w", "--hide", "--ignore", "--tabsize", "--width"]),
21044
+ nl: /* @__PURE__ */ new Set(["-b", "-d", "-f", "-h", "-i", "-l", "-n", "-s", "-v", "-w"]),
21045
+ tree: /* @__PURE__ */ new Set(["-I", "-L", "-P", "--filelimit"])
21046
+ };
21047
+ PATTERN_FLAGS = /* @__PURE__ */ new Set(["-e", "-f", "--file", "--regexp"]);
21048
21048
  SCRIPT_ROOT = "/";
21049
21049
  commandName = (argv) => argv[0].split("/").pop() ?? argv[0];
21050
21050
  fileWrites = ({ writes }) => writes.filter(({ path: path10 }) => path10 !== "/dev/null");
@@ -31408,7 +31408,7 @@ var CLI_VERSION;
31408
31408
  var init_cli_version = __esm({
31409
31409
  "../shared/src/cli-version.ts"() {
31410
31410
  "use strict";
31411
- CLI_VERSION = "0.3.230";
31411
+ CLI_VERSION = "0.3.232";
31412
31412
  }
31413
31413
  });
31414
31414
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.230",
3
+ "version": "0.3.232",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {