@loonglab/loongcode-cli 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -77,6 +77,79 @@ All notable changes to LoongCode will be documented in this file.
77
77
  capabilities now live inside the `/session` manager; they are not retained
78
78
  as aliases.
79
79
 
80
+ ## [0.1.2] - 2026-10-12
81
+
82
+ A cross-platform compatibility release. Windows gets a real choice of shell —
83
+ Windows PowerShell by default, CMD on request — and the tool layer no longer
84
+ assumes a POSIX userland underneath: file search runs in-process instead of
85
+ shelling out to `grep`, command output is decoded by contract rather than
86
+ assumed to be UTF-8, cancelling a command always returns, and `@file`
87
+ references work with spaces and Windows paths.
88
+
89
+ Verification remains Linux: the automated suite runs there, the Windows paths
90
+ are covered by simulated tests, and native Windows and macOS runs are still
91
+ outstanding.
92
+
93
+ ### Added
94
+
95
+ - **Windows shell selection.** `settings.shell` chooses which shell commands
96
+ run in on Windows: `"powershell"` (Windows PowerShell, the default) or
97
+ `"cmd"` (CMD, taken from `%ComSpec%`). It is global with a per-project
98
+ override, and an explicit choice is never replaced by the default. It applies
99
+ to Windows only — other platforms always run commands in `/bin/sh`, with the
100
+ prompts and tool descriptions they have always had. Nothing switches shells
101
+ automatically: if the selected shell cannot start, the command fails with an
102
+ error naming it instead of running somewhere else, and PowerShell 7 (`pwsh`)
103
+ is never chosen for you. CMD and PowerShell are different languages, so the
104
+ system prompt and the tool description state which one is active.
105
+
106
+ ### Changed
107
+
108
+ - **Windows PowerShell is the default shell on Windows.** An installation that
109
+ never set `settings.shell` now runs commands in `powershell.exe` instead of
110
+ CMD; one that already chose `"cmd"` — globally or per project — keeps CMD.
111
+ The change is Windows only.
112
+ - **File search no longer needs an external `grep` binary.** The `grep` tool
113
+ searches in-process, so it works where no `grep` exists — on Windows it
114
+ previously failed with "Executable not found in $PATH", which the agent read
115
+ as "no results". The interface, the output format (matching lines with
116
+ `file:line` prefixes, the 100-match cap, `No matches found.`) and the search
117
+ scope (`.git` and `node_modules` are still searched) are unchanged. Regular
118
+ expressions are JavaScript's rather than POSIX ERE: `\d`, lookahead and
119
+ non-greedy quantifiers now work, while `[[:alpha:]]`, `\<` and `\>` are
120
+ rejected with an error naming the replacement instead of silently matching
121
+ something else. This is not full GNU grep compatibility — the dialect, the
122
+ `include` glob (now the same dialect as `find`, where `{a,b}` alternates) and
123
+ the handling of unreadable paths all differ as described here.
124
+ - **A search that cannot read part of the tree says so, and still returns what
125
+ it found.** Previously a single unreadable path failed the whole search and
126
+ discarded the matches; the result now carries them with a "(Search
127
+ incomplete: …)" note. Special files such as FIFOs and devices are skipped
128
+ rather than read, which removes a way for a search to block indefinitely.
129
+ - **Subprocess output is decoded as UTF-8 unless the whole stream proves
130
+ otherwise.** On Windows, output that is not valid UTF-8 — `cmd.exe`
131
+ built-ins and many native tools write the console code page — is decoded
132
+ with the console code page and the result says which one was used, instead
133
+ of arriving as mojibake. That fallback is a labelled best guess, not
134
+ detection of what a program intended: the console code page describes the
135
+ console, not the program, and a stream can be valid UTF-8 while having been
136
+ written in another encoding. When no code page can be determined, the output
137
+ says that instead of pretending. POSIX decoding is unchanged.
138
+
139
+ ### Fixed
140
+
141
+ - **Cancelling a command always returns.** Aborting a run (Esc) settles the
142
+ tool call within a bounded grace period even when the command refuses to
143
+ die; previously a Windows cancellation whose `taskkill` was missing or failed
144
+ could leave the call waiting forever, with no error and no diagnostic.
145
+ Termination is still best-effort — a process or descendant that escapes the
146
+ process tree can survive — and the result says explicitly when cleanup could
147
+ not be confirmed, rather than implying the tree is gone.
148
+ - **`@file` references now work with spaces and Windows paths.** `@"my
149
+ notes.md"` and `@C:\src\a.ts` (either slash) expand to the file's content
150
+ like any other reference; they used to be left as literal text. Unresolved
151
+ references still stay literal, so `@` in ordinary prose is never mangled.
152
+
80
153
  ## [0.1.1] - 2026-10-12
81
154
 
82
155
  Fixes Backspace in the terminal environments where the key arrives as a raw
package/README.md CHANGED
@@ -11,6 +11,10 @@ in an interactive terminal UI.
11
11
  LoongCode is a single platform-independent package: the same install works on
12
12
  Windows, macOS, and Linux, on both x64 and arm64.
13
13
 
14
+ Cross-platform compatibility improvements are implemented and automated
15
+ verification has been performed on Linux; native Windows and macOS verification
16
+ remains pending.
17
+
14
18
  ```sh
15
19
  npm install -g @loonglab/loongcode-cli
16
20
  cd my-project
@@ -44,4 +48,30 @@ Configuration and sessions live under your user config directory
44
48
  (`~/.loongcode/`) — never inside
45
49
  this package.
46
50
 
51
+ ## Windows shell
52
+
53
+ On Windows, commands run in Windows PowerShell (`powershell.exe`) by default.
54
+ To run them in CMD instead, add `shell` to `settings.json`:
55
+
56
+ ```json
57
+ {
58
+ "shell": "cmd"
59
+ }
60
+ ```
61
+
62
+ - `"powershell"` (default) — `powershell.exe`, started with `-NoLogo
63
+ -NoProfile -NonInteractive`; `"cmd"` — `cmd.exe`, taken from `%ComSpec%`.
64
+ - Global (`~/.loongcode/settings.json`) with a per-project override
65
+ (`.loongcode/settings.json`); the project value applies, so an explicit
66
+ choice is never replaced by the default.
67
+ - Windows only: other platforms always run commands in `/bin/sh`.
68
+ - CMD and PowerShell are different languages — their syntax, built-ins and
69
+ scripts are not interchangeable, and neither has POSIX commands (`ls`, `cat`,
70
+ `grep`, …).
71
+ - Nothing switches shells automatically: if the selected shell is unavailable
72
+ the command fails with an error naming it, including when PowerShell is the
73
+ default. `pwsh` (PowerShell 7) is not selected for you.
74
+ - Choose `cmd` for CMD syntax, batch built-ins, or tooling that expects
75
+ `%ComSpec%`.
76
+
47
77
  See the repository README for the full product documentation.