@silicaclaw/cli 1.0.0-beta.25 → 1.0.0-beta.26
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 +7 -0
- package/package.json +1 -1
- package/scripts/silicaclaw-cli.mjs +27 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## v1.0 beta - 2026-03-18
|
|
4
4
|
|
|
5
|
+
### Beta 26
|
|
6
|
+
|
|
7
|
+
- install command resilience:
|
|
8
|
+
- `silicaclaw install` no longer fails hard when shell startup files are not writable
|
|
9
|
+
- install still creates the command shim and `~/.silicaclaw/env.sh`
|
|
10
|
+
- users now get a manual one-line fallback when rc file updates are blocked by permissions
|
|
11
|
+
|
|
5
12
|
### Beta 25
|
|
6
13
|
|
|
7
14
|
- relay load reduction:
|
package/package.json
CHANGED
|
@@ -89,14 +89,18 @@ function userEnvFile() {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function ensureLineInFile(filePath, block) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
try {
|
|
93
|
+
const current = existsSync(filePath) ? readFileSync(filePath, "utf8") : "";
|
|
94
|
+
if (current.includes(block.trim())) {
|
|
95
|
+
return { changed: false, error: null };
|
|
96
|
+
}
|
|
97
|
+
const next = `${current.replace(/\s*$/, "")}\n\n${block}\n`;
|
|
98
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
99
|
+
writeFileSync(filePath, next, "utf8");
|
|
100
|
+
return { changed: true, error: null };
|
|
101
|
+
} catch (error) {
|
|
102
|
+
return { changed: false, error: error instanceof Error ? error.message : String(error) };
|
|
95
103
|
}
|
|
96
|
-
const next = `${current.replace(/\s*$/, "")}\n\n${block}\n`;
|
|
97
|
-
mkdirSync(dirname(filePath), { recursive: true });
|
|
98
|
-
writeFileSync(filePath, next, "utf8");
|
|
99
|
-
return true;
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
function shellInitTargets() {
|
|
@@ -159,10 +163,15 @@ function installPersistentCommand() {
|
|
|
159
163
|
);
|
|
160
164
|
const rcFiles = shellInitTargets();
|
|
161
165
|
const updatedFiles = [];
|
|
166
|
+
const failedFiles = [];
|
|
162
167
|
for (const filePath of rcFiles) {
|
|
163
|
-
|
|
168
|
+
const result = ensureLineInFile(filePath, rcBlock);
|
|
169
|
+
if (result.changed) {
|
|
164
170
|
updatedFiles.push(filePath);
|
|
165
171
|
}
|
|
172
|
+
if (result.error) {
|
|
173
|
+
failedFiles.push({ filePath, error: result.error });
|
|
174
|
+
}
|
|
166
175
|
}
|
|
167
176
|
|
|
168
177
|
console.log("Installed persistent `silicaclaw` command.");
|
|
@@ -175,6 +184,16 @@ function installPersistentCommand() {
|
|
|
175
184
|
if (updatedFiles.length === 0) {
|
|
176
185
|
console.log("Shell startup files were already configured.");
|
|
177
186
|
}
|
|
187
|
+
if (failedFiles.length > 0) {
|
|
188
|
+
console.log("");
|
|
189
|
+
console.log("Some shell startup files could not be updated automatically:");
|
|
190
|
+
for (const item of failedFiles) {
|
|
191
|
+
console.log(`- ${item.filePath}: ${item.error}`);
|
|
192
|
+
}
|
|
193
|
+
console.log("");
|
|
194
|
+
console.log("You can add this line manually to one shell startup file:");
|
|
195
|
+
console.log('[ -f "$HOME/.silicaclaw/env.sh" ] && . "$HOME/.silicaclaw/env.sh"');
|
|
196
|
+
}
|
|
178
197
|
}
|
|
179
198
|
|
|
180
199
|
function isNpxRun() {
|