ccdesk 0.2.6 → 0.2.7
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 +22 -6
- package/dist/ui/assets/MarkdownText-Cl-Pgndc.js +29 -0
- package/dist/ui/assets/index-BOJGsyhD.js +32 -0
- package/dist/ui/index.html +1 -1
- package/dist/view/settings.d.ts +1 -1
- package/dist/view/settings.js +14 -5
- package/package.json +1 -1
- package/dist/ui/assets/index-D3snAAMI.js +0 -60
package/dist/ui/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="color-scheme" content="light dark" />
|
|
7
7
|
<title>ccdesk</title>
|
|
8
8
|
<link rel="icon" href="/logo.png" type="image/png" />
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-BOJGsyhD.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DcIoz4qK.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/dist/view/settings.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export declare function fromDraft(kind: FieldKind, property: SettingSchema | und
|
|
|
70
70
|
} | {
|
|
71
71
|
error: string;
|
|
72
72
|
};
|
|
73
|
-
/** JSON typed into a form, or why it
|
|
73
|
+
/** JSON typed into a form, or why it cannot be saved, as a sentence to show. */
|
|
74
74
|
export declare function parseJson(text: string): {
|
|
75
75
|
value: unknown;
|
|
76
76
|
} | {
|
package/dist/view/settings.js
CHANGED
|
@@ -180,8 +180,9 @@ export function fromDraft(kind, property, draft, inObject = false) {
|
|
|
180
180
|
if (kind === "boolean")
|
|
181
181
|
return { value: draft === "true" };
|
|
182
182
|
if (kind === "number") {
|
|
183
|
+
// JSON has no Infinity, so a number too large would reach the review as null.
|
|
183
184
|
const n = Number(draft);
|
|
184
|
-
return draft.trim() === "" || Number.
|
|
185
|
+
return draft.trim() === "" || !Number.isFinite(n) ? { error: "Enter a number." } : { value: n };
|
|
185
186
|
}
|
|
186
187
|
if (kind === "lines")
|
|
187
188
|
return {
|
|
@@ -222,22 +223,30 @@ function jsonFromDraft(property, draft) {
|
|
|
222
223
|
const quote = property && text !== "" && takesText(property)
|
|
223
224
|
? `. Text goes in double quotes: ${JSON.stringify(text)}`
|
|
224
225
|
: "";
|
|
225
|
-
return { error:
|
|
226
|
+
return { error: `${parsed.error}${quote}` };
|
|
226
227
|
}
|
|
227
228
|
function takesText(schema) {
|
|
228
229
|
if (schema.anyOf)
|
|
229
230
|
return schema.anyOf.some(takesText);
|
|
230
231
|
return [schema.type ?? []].flat().includes("string");
|
|
231
232
|
}
|
|
232
|
-
/** JSON typed into a form, or why it
|
|
233
|
+
/** JSON typed into a form, or why it cannot be saved, as a sentence to show. */
|
|
233
234
|
export function parseJson(text) {
|
|
234
235
|
try {
|
|
235
|
-
return { value: JSON.parse(text) };
|
|
236
|
+
return { value: JSON.parse(text, finiteNumbers) };
|
|
236
237
|
}
|
|
237
238
|
catch (error) {
|
|
238
|
-
|
|
239
|
+
if (error instanceof RangeError)
|
|
240
|
+
return { error: error.message };
|
|
241
|
+
return { error: `Not valid JSON: ${error instanceof Error ? error.message : String(error)}` };
|
|
239
242
|
}
|
|
240
243
|
}
|
|
244
|
+
/** JSON.parse reads 1e400 as Infinity, which JSON.stringify writes as null. */
|
|
245
|
+
function finiteNumbers(_key, value) {
|
|
246
|
+
if (typeof value === "number" && !Number.isFinite(value))
|
|
247
|
+
throw new RangeError("A number is too large to save: JSON would write it as null.");
|
|
248
|
+
return value;
|
|
249
|
+
}
|
|
241
250
|
/**
|
|
242
251
|
* What a value must be, in JSON's terms: "true or false, or an object with commit, pr and
|
|
243
252
|
* sessionUrl". Shown beside a JSON field, so you know the shape before the review checks it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccdesk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "See and change everything Claude Code loads on your machine: instruction files, settings, permissions, hooks, MCP servers, subagents, skills, plugins and auto memory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|