arashi 1.27.0 → 1.29.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.
package/README.md CHANGED
@@ -174,6 +174,10 @@ arashi switch --ignore-configured-launcher # bypass configured sesh/Herdr mode
174
174
  arashi switch --launch --ignore-configured-launcher # force generic automatic launch
175
175
  ```
176
176
 
177
+ ### Add from a linked parent worktree
178
+
179
+ When `arashi add` runs from an active linked parent worktree, Arashi creates one canonical clone in the parent main checkout and leaves it on the child default branch. It then creates the active child as a linked worktree on the coordinated branch and updates only the active parent configuration. Direct-main and configured-bare adds keep their existing single-placement behavior. See the [add command guide](https://arashi.haphazard.dev/commands/add/) for branch, managed-ignore, JSON, and rollback details.
180
+
177
181
  Explicit `--tmux` is a per-invocation launcher override for `create` and `switch`; it is not a persisted configuration mode. It requires an active tmux context whose `TMUX` value is non-empty after trimming, uses the selected worktree path as one argv-safe `tmux new-window -c` argument, and does not fall back to another launcher when the prerequisite or launch fails. On `create`, it implies both launch and switch, while validation failures occur before worktree mutation.
178
182
 
179
183
  `--tab` is a CLI-only launch disposition for `create` and `switch`; it is never persisted. It requests a true terminal tab or documented managed-context equivalent, implies launch (and selection for `create`), overrides automatic parent-shell `cd`, and never degrades to a window or another launcher. For switch, it bypasses configured `sesh` or `herdr` launch defaults; for create, it bypasses configured generic or editor-scoped launch defaults. An explicit launcher selector remains authoritative. Unsupported adapters fail with `TAB_DISPOSITION_UNSUPPORTED`; launch/preflight failures use `LAUNCH_FAILED`. Human-only tab launch is incompatible with `--json`.
package/bin/arashi CHANGED
@@ -53,13 +53,9 @@ fi
53
53
 
54
54
  # Close stdin only when piping list output (fzf compatibility)
55
55
  command=""
56
- force_remove="false"
57
56
  for arg in "$@"; do
58
57
  case "$arg" in
59
58
  -*)
60
- case "$arg" in
61
- -f|--force) force_remove="true" ;;
62
- esac
63
59
  continue
64
60
  ;;
65
61
  *)
@@ -71,7 +67,7 @@ for arg in "$@"; do
71
67
  done
72
68
 
73
69
  if [ ! -t 1 ]; then
74
- if [ "$command" = "list" ] || { [ "$command" = "remove" ] && [ "$force_remove" = "true" ]; }; then
70
+ if [ "$command" = "list" ]; then
75
71
  exec "$BINARY" "$@" 0<&-
76
72
  fi
77
73
  fi
@@ -1,5 +1,6 @@
1
1
  const WINDOWS_BATCH_FILE = /\.(?:cmd|bat)$/i;
2
2
  const CMD_ARGUMENT_VARIABLE_PREFIX = "ARASHI_CMD_ARGUMENT_";
3
+ const CMD_LITERAL_PERCENT_VARIABLE = "ARASHI_CMD_LITERAL_PERCENT";
3
4
 
4
5
  // Quote according to CommandLineToArgvW's rules. The result is stored in an
5
6
  // environment variable and introduced with ordinary expansion. Cmd expands each
@@ -13,6 +14,7 @@ export function prepareSpawnCommand(
13
14
  platform = process.platform,
14
15
  env = process.env,
15
16
  forceWindowsShell = false,
17
+ callBatchFile = false,
16
18
  ) {
17
19
  const executable = command[0];
18
20
  if (
@@ -22,21 +24,34 @@ export function prepareSpawnCommand(
22
24
  return { args: command.slice(1), command: executable, windowsVerbatimArguments: false };
23
25
  }
24
26
 
25
- const values = command.map((argument) => quoteWindowsArgument(argument));
27
+ const values = command.map((argument) => {
28
+ const quoted = quoteWindowsArgument(argument);
29
+ return callBatchFile
30
+ ? quoted.replaceAll("%", `%${CMD_LITERAL_PERCENT_VARIABLE}%`)
31
+ : quoted;
32
+ });
26
33
  const variableNames = values.map((_value, index) => `${CMD_ARGUMENT_VARIABLE_PREFIX}${index}`);
27
34
 
28
35
  const commandInterpreter =
29
36
  Object.entries(env).find(([key]) => key.toLowerCase() === "comspec")?.[1] ?? "cmd.exe";
30
37
 
38
+ const invocation = variableNames.map((name) => `%${name}%`).join(" ");
39
+ const args = ["/d"];
40
+ if (callBatchFile) args.push("/e:on");
41
+ args.push("/v:off", "/s", "/c", `"${callBatchFile ? "call " : ""}${invocation}"`);
42
+
31
43
  return {
32
- args: ["/d", "/v:off", "/s", "/c", `"${variableNames.map((name) => `%${name}%`).join(" ")}"`],
44
+ args,
33
45
  command: commandInterpreter,
34
46
  env: {
35
47
  ...Object.fromEntries(
36
48
  Object.entries(env).filter(
37
- ([name]) => !name.toUpperCase().startsWith(CMD_ARGUMENT_VARIABLE_PREFIX),
49
+ ([name]) =>
50
+ !name.toUpperCase().startsWith(CMD_ARGUMENT_VARIABLE_PREFIX) &&
51
+ name.toUpperCase() !== CMD_LITERAL_PERCENT_VARIABLE,
38
52
  ),
39
53
  ),
54
+ ...(callBatchFile ? { [CMD_LITERAL_PERCENT_VARIABLE]: "%" } : {}),
40
55
  ...Object.fromEntries(variableNames.map((name, index) => [name, values[index]])),
41
56
  },
42
57
  windowsVerbatimArguments: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arashi",
3
- "version": "1.27.0",
3
+ "version": "1.29.0",
4
4
  "description": "Git worktree manager for meta-repositories - The eye of the storm for your development workflow",
5
5
  "keywords": [
6
6
  "cli",
@@ -86,8 +86,9 @@
86
86
  "commander": "12.1.0",
87
87
  "conventional-changelog-conventionalcommits": "8.0.0",
88
88
  "husky": "9.1.7",
89
- "js-yaml": "4.3.0",
89
+ "js-yaml": "4.3.1",
90
90
  "lint-staged": "16.2.7",
91
+ "node-pty": "1.1.0",
91
92
  "ora": "8.2.0",
92
93
  "oxfmt": "0.28.0",
93
94
  "oxlint": "1.43.0",