claudeup 4.6.0 → 4.6.1
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/package.json
CHANGED
|
@@ -209,24 +209,51 @@ export async function removeLocalInstalledPluginVersion(pluginId, projectPath) {
|
|
|
209
209
|
await removeFromInstalledPluginsRegistry(pluginId, "local", projectPath ? path.resolve(projectPath) : undefined);
|
|
210
210
|
}
|
|
211
211
|
// Status line management
|
|
212
|
+
// Claude Code expects statusLine as an object: { type: "template", template: "..." }
|
|
213
|
+
// or { type: "command", command: "..." }. Writing a bare string causes a validation error
|
|
214
|
+
// that skips the entire settings file.
|
|
215
|
+
function wrapStatusLine(template) {
|
|
216
|
+
if (!template)
|
|
217
|
+
return undefined;
|
|
218
|
+
return { type: "template", template };
|
|
219
|
+
}
|
|
220
|
+
function unwrapStatusLine(value) {
|
|
221
|
+
if (!value)
|
|
222
|
+
return undefined;
|
|
223
|
+
if (typeof value === "string")
|
|
224
|
+
return value; // legacy format
|
|
225
|
+
return value.template ?? value.command;
|
|
226
|
+
}
|
|
212
227
|
export async function setStatusLine(template, projectPath) {
|
|
213
228
|
const settings = await readSettings(projectPath);
|
|
214
|
-
|
|
229
|
+
const wrapped = wrapStatusLine(template);
|
|
230
|
+
if (wrapped) {
|
|
231
|
+
settings.statusLine = wrapped;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
delete settings.statusLine;
|
|
235
|
+
}
|
|
215
236
|
await writeSettings(settings, projectPath);
|
|
216
237
|
}
|
|
217
238
|
export async function getStatusLine(projectPath) {
|
|
218
239
|
const settings = await readSettings(projectPath);
|
|
219
|
-
return settings.statusLine;
|
|
240
|
+
return unwrapStatusLine(settings.statusLine);
|
|
220
241
|
}
|
|
221
242
|
// Global status line management
|
|
222
243
|
export async function setGlobalStatusLine(template) {
|
|
223
244
|
const settings = await readGlobalSettings();
|
|
224
|
-
|
|
245
|
+
const wrapped = wrapStatusLine(template);
|
|
246
|
+
if (wrapped) {
|
|
247
|
+
settings.statusLine = wrapped;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
delete settings.statusLine;
|
|
251
|
+
}
|
|
225
252
|
await writeGlobalSettings(settings);
|
|
226
253
|
}
|
|
227
254
|
export async function getGlobalStatusLine() {
|
|
228
255
|
const settings = await readGlobalSettings();
|
|
229
|
-
return settings.statusLine;
|
|
256
|
+
return unwrapStatusLine(settings.statusLine);
|
|
230
257
|
}
|
|
231
258
|
// Get effective status line (project overrides global)
|
|
232
259
|
export async function getEffectiveStatusLine(projectPath) {
|
|
@@ -311,12 +311,34 @@ export async function removeLocalInstalledPluginVersion(
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
// Status line management
|
|
314
|
+
// Claude Code expects statusLine as an object: { type: "template", template: "..." }
|
|
315
|
+
// or { type: "command", command: "..." }. Writing a bare string causes a validation error
|
|
316
|
+
// that skips the entire settings file.
|
|
317
|
+
|
|
318
|
+
function wrapStatusLine(template: string): { type: string; template: string } | undefined {
|
|
319
|
+
if (!template) return undefined;
|
|
320
|
+
return { type: "template", template };
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function unwrapStatusLine(
|
|
324
|
+
value: string | { type: string; template?: string; command?: string } | undefined,
|
|
325
|
+
): string | undefined {
|
|
326
|
+
if (!value) return undefined;
|
|
327
|
+
if (typeof value === "string") return value; // legacy format
|
|
328
|
+
return value.template ?? value.command;
|
|
329
|
+
}
|
|
330
|
+
|
|
314
331
|
export async function setStatusLine(
|
|
315
332
|
template: string,
|
|
316
333
|
projectPath?: string,
|
|
317
334
|
): Promise<void> {
|
|
318
335
|
const settings = await readSettings(projectPath);
|
|
319
|
-
|
|
336
|
+
const wrapped = wrapStatusLine(template);
|
|
337
|
+
if (wrapped) {
|
|
338
|
+
settings.statusLine = wrapped;
|
|
339
|
+
} else {
|
|
340
|
+
delete settings.statusLine;
|
|
341
|
+
}
|
|
320
342
|
await writeSettings(settings, projectPath);
|
|
321
343
|
}
|
|
322
344
|
|
|
@@ -324,19 +346,24 @@ export async function getStatusLine(
|
|
|
324
346
|
projectPath?: string,
|
|
325
347
|
): Promise<string | undefined> {
|
|
326
348
|
const settings = await readSettings(projectPath);
|
|
327
|
-
return settings.statusLine;
|
|
349
|
+
return unwrapStatusLine(settings.statusLine);
|
|
328
350
|
}
|
|
329
351
|
|
|
330
352
|
// Global status line management
|
|
331
353
|
export async function setGlobalStatusLine(template: string): Promise<void> {
|
|
332
354
|
const settings = await readGlobalSettings();
|
|
333
|
-
|
|
355
|
+
const wrapped = wrapStatusLine(template);
|
|
356
|
+
if (wrapped) {
|
|
357
|
+
settings.statusLine = wrapped;
|
|
358
|
+
} else {
|
|
359
|
+
delete settings.statusLine;
|
|
360
|
+
}
|
|
334
361
|
await writeGlobalSettings(settings);
|
|
335
362
|
}
|
|
336
363
|
|
|
337
364
|
export async function getGlobalStatusLine(): Promise<string | undefined> {
|
|
338
365
|
const settings = await readGlobalSettings();
|
|
339
|
-
return settings.statusLine;
|
|
366
|
+
return unwrapStatusLine(settings.statusLine);
|
|
340
367
|
}
|
|
341
368
|
|
|
342
369
|
// Get effective status line (project overrides global)
|
package/src/types/index.ts
CHANGED
|
@@ -88,7 +88,7 @@ export interface ClaudeSettings {
|
|
|
88
88
|
enabledPlugins?: Record<string, boolean>;
|
|
89
89
|
extraKnownMarketplaces?: Record<string, MarketplaceSource>;
|
|
90
90
|
installedPluginVersions?: Record<string, string>;
|
|
91
|
-
statusLine?: string;
|
|
91
|
+
statusLine?: string | { type: string; template?: string; command?: string };
|
|
92
92
|
hooks?: Record<string, ClaudeHookGroup[]>;
|
|
93
93
|
}
|
|
94
94
|
|