@creator-notes/cli 0.5.1 → 0.6.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/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +12 -0
- package/LICENSE +21 -0
- package/SKILL.md +5 -2
- package/dist/commands/theme.d.ts.map +1 -1
- package/dist/commands/theme.js +16 -12
- package/dist/commands/theme.js.map +1 -1
- package/dist/lib/themes.d.ts +21 -3
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/themes.js +83 -5
- package/dist/lib/themes.js.map +1 -1
- package/package.json +20 -2
- package/skills/cn/SKILL.md +1 -1
package/.mcp.json
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CreatorNotes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/SKILL.md
CHANGED
|
@@ -185,10 +185,13 @@ cn theme list
|
|
|
185
185
|
cn theme get
|
|
186
186
|
|
|
187
187
|
# Switch to a built-in preset
|
|
188
|
-
cn theme set <id> # e.g. dracula,
|
|
188
|
+
cn theme set <id> # e.g. dracula, ember, catppuccin-mocha, sage, light, dark
|
|
189
189
|
|
|
190
190
|
# Override a single color (switches the theme to "custom" automatically)
|
|
191
|
-
|
|
191
|
+
# <color> can be HSL ("310 85% 67%"), HSL with alpha ("310 85% 67% / 0.5"),
|
|
192
|
+
# hex ("#ff00aa"), or the keyword "transparent". HSL is the canonical form
|
|
193
|
+
# — it round-trips losslessly and makes good-feeling combos easier to pick.
|
|
194
|
+
cn theme set-color <token> <color> # e.g. cn theme set-color primary "310 85% 67%"
|
|
192
195
|
|
|
193
196
|
# Drop all custom overrides and return to the base preset
|
|
194
197
|
cn theme reset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/commands/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/commands/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkN5D"}
|
package/dist/commands/theme.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ApiClient } from "../lib/api-client.js";
|
|
|
2
2
|
import { resolveBaseConfig } from "../lib/config.js";
|
|
3
3
|
import { AuthError, ValidationError, handleError } from "../lib/errors.js";
|
|
4
4
|
import { outputJson, outputTable } from "../lib/output.js";
|
|
5
|
-
import { PRESETS, PRESET_IDS, EDITABLE_TOKEN_NAMES, EDITABLE_TOKEN_NAME_SET, hslTripleToHex,
|
|
5
|
+
import { PRESETS, PRESET_IDS, EDITABLE_TOKEN_NAMES, EDITABLE_TOKEN_NAME_SET, hslTripleToHex, parseColorInput, } from "../lib/themes.js";
|
|
6
6
|
function requireAuthedConfig(program) {
|
|
7
7
|
const cfg = resolveBaseConfig(program.opts());
|
|
8
8
|
if (!cfg.token)
|
|
@@ -76,7 +76,9 @@ export function registerThemeCommands(program) {
|
|
|
76
76
|
const rows = overrides.map(([token, hsl]) => [
|
|
77
77
|
token,
|
|
78
78
|
hsl,
|
|
79
|
-
|
|
79
|
+
// Hex is a lossy preview, so omit it for alpha-bearing triples
|
|
80
|
+
// (including "transparent") where it would mislead.
|
|
81
|
+
hsl.includes("/") ? "—" : hslTripleToHex(hsl),
|
|
80
82
|
]);
|
|
81
83
|
outputTable(["TOKEN", "HSL", "HEX"], rows);
|
|
82
84
|
}
|
|
@@ -93,7 +95,7 @@ export function registerThemeCommands(program) {
|
|
|
93
95
|
const cfg = requireAuthedConfig(program);
|
|
94
96
|
const api = new ApiClient(cfg.serverUrl, cfg.token);
|
|
95
97
|
if (id === "custom") {
|
|
96
|
-
throw new ValidationError("`cn theme set custom` is not supported. Use `cn theme set-color <token> <
|
|
98
|
+
throw new ValidationError("`cn theme set custom` is not supported. Use `cn theme set-color <token> <color>` to enter custom mode (it seeds the base palette atomically).");
|
|
97
99
|
}
|
|
98
100
|
if (!PRESET_IDS.has(id)) {
|
|
99
101
|
throw new ValidationError(`Unknown theme id: ${id}. Run \`cn theme list\` to see available presets.`);
|
|
@@ -116,27 +118,27 @@ export function registerThemeCommands(program) {
|
|
|
116
118
|
.command("set-color")
|
|
117
119
|
.description("Override a single token color (switches theme to 'custom')")
|
|
118
120
|
.argument("<token>", "Editable token name (e.g. primary, background)")
|
|
119
|
-
.argument("<
|
|
120
|
-
.action(async (token,
|
|
121
|
+
.argument("<color>", 'HSL ("310 85% 67%"), HSL with alpha ("310 85% 67% / 0.5"), hex ("#ff00aa"), or "transparent"')
|
|
122
|
+
.action(async (token, color) => {
|
|
121
123
|
const cfg = requireAuthedConfig(program);
|
|
122
124
|
const api = new ApiClient(cfg.serverUrl, cfg.token);
|
|
123
125
|
if (!EDITABLE_TOKEN_NAME_SET.has(token)) {
|
|
124
126
|
throw new ValidationError(`Token "${token}" is not editable. Editable tokens: ${EDITABLE_TOKEN_NAMES.join(", ")}`);
|
|
125
127
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
const normalized = parseColorInput(color);
|
|
129
|
+
if (normalized === null) {
|
|
130
|
+
throw new ValidationError(`Invalid color: ${color}. Use HSL ("310 85% 67%"), hex ("#ff00aa"), or "transparent".`);
|
|
128
131
|
}
|
|
129
132
|
try {
|
|
130
133
|
// Use PATCH so the server merges this single token into the
|
|
131
|
-
// existing HSL palette without round-tripping unmodified tokens
|
|
132
|
-
// through hex (which would lose precision on each call).
|
|
134
|
+
// existing HSL palette without round-tripping unmodified tokens.
|
|
133
135
|
// We still need the current themeId to seed customBaseId on the
|
|
134
136
|
// first transition into custom — once we're already custom, the
|
|
135
137
|
// server preserves the existing base.
|
|
136
138
|
const current = await api.get("/api/theme");
|
|
137
139
|
const customBaseId = current.themeId === "custom" ? undefined : current.themeId;
|
|
138
140
|
const data = await api.patch("/api/theme/colors", {
|
|
139
|
-
customColors: { [token]:
|
|
141
|
+
customColors: { [token]: normalized },
|
|
140
142
|
...(customBaseId ? { customBaseId } : {}),
|
|
141
143
|
});
|
|
142
144
|
if (cfg.json) {
|
|
@@ -144,8 +146,10 @@ export function registerThemeCommands(program) {
|
|
|
144
146
|
}
|
|
145
147
|
else {
|
|
146
148
|
const storedHsl = data.customColors[token];
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
+
const display = storedHsl ?? normalized;
|
|
150
|
+
// Skip the hex hint when alpha is in play — hex can't represent it.
|
|
151
|
+
const hexHint = storedHsl && !storedHsl.includes("/") ? hslTripleToHex(storedHsl) : "";
|
|
152
|
+
console.log(`Set ${token} = ${display}${hexHint && hexHint !== display ? ` (${hexHint})` : ""}.`);
|
|
149
153
|
console.log(`Theme is now custom (based on ${data.customBaseId}).`);
|
|
150
154
|
console.log("Reload an open browser tab to see the change.");
|
|
151
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/commands/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,OAAO,EACP,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/commands/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,OAAO,EACP,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAS1B,SAAS,mBAAmB,CAAC,OAAgB;IAC3C,MAAM,GAAG,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,GAAG,CAAC,KAAK;QAAE,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AC/C,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/lib/themes.d.ts
CHANGED
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* The CLI publishes as a standalone package, so it can't import from
|
|
5
5
|
* the Next.js project's `lib/themes/`. Keep this in sync with:
|
|
6
6
|
* - lib/themes/presets.ts (PRESETS, EDITABLE_TOKEN_NAMES)
|
|
7
|
-
* - lib/themes/color.ts (parseHex, hslTripleToHex
|
|
7
|
+
* - lib/themes/color.ts (parseHex, hslTripleToHex,
|
|
8
|
+
* parseColorInput, TRANSPARENT_TRIPLE)
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* Parity with the canonical helpers is pinned by
|
|
11
|
+
* __tests__/cli-themes.test.ts — the test fails before users see a
|
|
12
|
+
* discrepancy. Server-side validation in /api/theme uses the canonical
|
|
13
|
+
* sources, so this file is for local UX only — the server is the contract.
|
|
11
14
|
*/
|
|
12
15
|
export interface PresetMeta {
|
|
13
16
|
id: string;
|
|
@@ -22,5 +25,20 @@ export declare const EDITABLE_TOKEN_NAME_SET: ReadonlySet<string>;
|
|
|
22
25
|
/** All known preset ids — kept in sync with lib/themes/presets.ts PRESET_IDS. */
|
|
23
26
|
export declare const PRESET_IDS: ReadonlySet<string>;
|
|
24
27
|
export declare function parseHex(hex: string): [number, number, number] | null;
|
|
28
|
+
export declare const TRANSPARENT_TRIPLE = "0 0% 0% / 0";
|
|
29
|
+
/**
|
|
30
|
+
* Pure HSL→hex conversion. Alpha is dropped — this is for hex preview only.
|
|
31
|
+
* Kept byte-identical to the canonical lib/themes/color.ts hslTripleToHex
|
|
32
|
+
* so the parity test in __tests__/cli-themes.test.ts stays green.
|
|
33
|
+
*/
|
|
25
34
|
export declare function hslTripleToHex(triple: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Coerce a color argument into a stored HSL triple. Accepts:
|
|
37
|
+
* - "transparent"
|
|
38
|
+
* - "H S% L%" or "H S% L% / A"
|
|
39
|
+
* - "#rrggbb" / "#rgb" (must be `#`-prefixed; bare "abc" is too easy
|
|
40
|
+
* to confuse with a typo'd HSL triple, so we don't accept it)
|
|
41
|
+
* Returns null when nothing matches.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseColorInput(value: string): string | null;
|
|
26
44
|
//# sourceMappingURL=themes.d.ts.map
|
package/dist/lib/themes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,UAAU,EAU/B,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAWxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAiC,CAAC;AAE1F,iFAAiF;AACjF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CAAqC,CAAC;AAKjF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAUrE;AAMD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAqDhD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyB5D"}
|
package/dist/lib/themes.js
CHANGED
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* The CLI publishes as a standalone package, so it can't import from
|
|
5
5
|
* the Next.js project's `lib/themes/`. Keep this in sync with:
|
|
6
6
|
* - lib/themes/presets.ts (PRESETS, EDITABLE_TOKEN_NAMES)
|
|
7
|
-
* - lib/themes/color.ts (parseHex, hslTripleToHex
|
|
7
|
+
* - lib/themes/color.ts (parseHex, hslTripleToHex,
|
|
8
|
+
* parseColorInput, TRANSPARENT_TRIPLE)
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* Parity with the canonical helpers is pinned by
|
|
11
|
+
* __tests__/cli-themes.test.ts — the test fails before users see a
|
|
12
|
+
* discrepancy. Server-side validation in /api/theme uses the canonical
|
|
13
|
+
* sources, so this file is for local UX only — the server is the contract.
|
|
11
14
|
*/
|
|
12
15
|
export const PRESETS = [
|
|
13
16
|
{ id: "dark", name: "Tia", isDark: true, description: "Default dark with magenta accent." },
|
|
@@ -17,7 +20,7 @@ export const PRESETS = [
|
|
|
17
20
|
{ id: "catppuccin-latte", name: "Catppuccin Latte", isDark: false, description: "Soothing pastel light from the Catppuccin family." },
|
|
18
21
|
{ id: "dracula", name: "Dracula", isDark: true, description: "Iconic high-contrast dark with purple accent." },
|
|
19
22
|
{ id: "solarized-dark", name: "Solarized Dark", isDark: true, description: "Ethan Schoonover's classic teal-on-navy palette." },
|
|
20
|
-
{ id: "
|
|
23
|
+
{ id: "ember", name: "Ember", isDark: true, description: "Roasted-coffee dark with glowing ember orange and a cool teal spark." },
|
|
21
24
|
{ id: "rose-pine", name: "Rosé Pine", isDark: true, description: "Soho-vibes for the pastel-loving developer." },
|
|
22
25
|
];
|
|
23
26
|
/** Tokens the visual editor / `cn theme set-color` is allowed to override. */
|
|
@@ -51,7 +54,9 @@ export function parseHex(hex) {
|
|
|
51
54
|
];
|
|
52
55
|
return null;
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
// Same shape as lib/themes/color.ts — accepts an optional `/ alpha` suffix.
|
|
58
|
+
const HSL_RE = /^\s*(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)%\s+(-?\d+(?:\.\d+)?)%(?:\s*\/\s*(\d+(?:\.\d+)?%?|\.\d+%?))?\s*$/;
|
|
59
|
+
export const TRANSPARENT_TRIPLE = "0 0% 0% / 0";
|
|
55
60
|
function hslToRgb(h, s, l) {
|
|
56
61
|
const sNorm = Math.max(0, Math.min(100, s)) / 100;
|
|
57
62
|
const lNorm = Math.max(0, Math.min(100, l)) / 100;
|
|
@@ -78,6 +83,44 @@ function hslToRgb(h, s, l) {
|
|
|
78
83
|
Math.round((b1 + m) * 255),
|
|
79
84
|
];
|
|
80
85
|
}
|
|
86
|
+
function rgbToHsl(r, g, b) {
|
|
87
|
+
const rN = r / 255, gN = g / 255, bN = b / 255;
|
|
88
|
+
const max = Math.max(rN, gN, bN);
|
|
89
|
+
const min = Math.min(rN, gN, bN);
|
|
90
|
+
const l = (max + min) / 2;
|
|
91
|
+
let h = 0, s = 0;
|
|
92
|
+
if (max !== min) {
|
|
93
|
+
const d = max - min;
|
|
94
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
95
|
+
switch (max) {
|
|
96
|
+
case rN:
|
|
97
|
+
h = ((gN - bN) / d + (gN < bN ? 6 : 0));
|
|
98
|
+
break;
|
|
99
|
+
case gN:
|
|
100
|
+
h = ((bN - rN) / d + 2);
|
|
101
|
+
break;
|
|
102
|
+
default: h = ((rN - gN) / d + 4);
|
|
103
|
+
}
|
|
104
|
+
h *= 60;
|
|
105
|
+
}
|
|
106
|
+
return { h, s: s * 100, l: l * 100 };
|
|
107
|
+
}
|
|
108
|
+
function parseAlpha(raw) {
|
|
109
|
+
if (raw === undefined)
|
|
110
|
+
return 1;
|
|
111
|
+
const trimmed = raw.trim();
|
|
112
|
+
if (trimmed.endsWith("%")) {
|
|
113
|
+
const n = Number(trimmed.slice(0, -1));
|
|
114
|
+
return Number.isFinite(n) ? Math.max(0, Math.min(1, n / 100)) : 1;
|
|
115
|
+
}
|
|
116
|
+
const n = Number(trimmed);
|
|
117
|
+
return Number.isFinite(n) ? Math.max(0, Math.min(1, n)) : 1;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Pure HSL→hex conversion. Alpha is dropped — this is for hex preview only.
|
|
121
|
+
* Kept byte-identical to the canonical lib/themes/color.ts hslTripleToHex
|
|
122
|
+
* so the parity test in __tests__/cli-themes.test.ts stays green.
|
|
123
|
+
*/
|
|
81
124
|
export function hslTripleToHex(triple) {
|
|
82
125
|
const m = HSL_RE.exec(triple);
|
|
83
126
|
if (!m)
|
|
@@ -86,4 +129,39 @@ export function hslTripleToHex(triple) {
|
|
|
86
129
|
const toHex = (n) => n.toString(16).padStart(2, "0");
|
|
87
130
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
88
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Coerce a color argument into a stored HSL triple. Accepts:
|
|
134
|
+
* - "transparent"
|
|
135
|
+
* - "H S% L%" or "H S% L% / A"
|
|
136
|
+
* - "#rrggbb" / "#rgb" (must be `#`-prefixed; bare "abc" is too easy
|
|
137
|
+
* to confuse with a typo'd HSL triple, so we don't accept it)
|
|
138
|
+
* Returns null when nothing matches.
|
|
139
|
+
*/
|
|
140
|
+
export function parseColorInput(value) {
|
|
141
|
+
const trimmed = value.trim();
|
|
142
|
+
if (trimmed === "")
|
|
143
|
+
return null;
|
|
144
|
+
if (trimmed.toLowerCase() === "transparent")
|
|
145
|
+
return TRANSPARENT_TRIPLE;
|
|
146
|
+
const m = HSL_RE.exec(trimmed);
|
|
147
|
+
if (m) {
|
|
148
|
+
const round = (n) => Math.round(n * 10) / 10;
|
|
149
|
+
const base = `${round(Number(m[1]))} ${round(Number(m[2]))}% ${round(Number(m[3]))}%`;
|
|
150
|
+
const a = parseAlpha(m[4]);
|
|
151
|
+
if (a >= 1)
|
|
152
|
+
return base;
|
|
153
|
+
if (a <= 0)
|
|
154
|
+
return TRANSPARENT_TRIPLE;
|
|
155
|
+
return `${base} / ${Math.round(a * 1000) / 1000}`;
|
|
156
|
+
}
|
|
157
|
+
if (trimmed.startsWith("#")) {
|
|
158
|
+
const rgb = parseHex(trimmed);
|
|
159
|
+
if (rgb) {
|
|
160
|
+
const { h, s, l } = rgbToHsl(rgb[0], rgb[1], rgb[2]);
|
|
161
|
+
const round = (n) => Math.round(n * 10) / 10;
|
|
162
|
+
return `${round(h)} ${round(s)}% ${round(l)}%`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
89
167
|
//# sourceMappingURL=themes.js.map
|
package/dist/lib/themes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,EAAE,EAAE,EAAE,MAAM,EAAc,IAAI,EAAE,KAAK,EAAe,MAAM,EAAE,IAAI,EAAG,WAAW,EAAE,mCAAmC,EAAE;IACrH,EAAE,EAAE,EAAE,MAAM,EAAc,IAAI,EAAE,MAAM,EAAc,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,wCAAwC,EAAE;IAC1H,EAAE,EAAE,EAAE,OAAO,EAAa,IAAI,EAAE,OAAO,EAAa,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE;IACxG,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator-notes/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "CLI for CreatorNotes — create notes, build canvases, search knowledge from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"dist",
|
|
13
13
|
"README.md",
|
|
14
14
|
"SKILL.md",
|
|
15
|
+
"LICENSE",
|
|
15
16
|
".claude-plugin",
|
|
17
|
+
".mcp.json",
|
|
16
18
|
"skills"
|
|
17
19
|
],
|
|
18
20
|
"scripts": {
|
|
@@ -21,10 +23,26 @@
|
|
|
21
23
|
"start": "node dist/cn.js",
|
|
22
24
|
"prepublishOnly": "npm run build"
|
|
23
25
|
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"cli",
|
|
28
|
+
"notes",
|
|
29
|
+
"canvas",
|
|
30
|
+
"knowledge-management",
|
|
31
|
+
"productivity",
|
|
32
|
+
"mcp",
|
|
33
|
+
"claude",
|
|
34
|
+
"ai",
|
|
35
|
+
"creatornotes"
|
|
36
|
+
],
|
|
37
|
+
"author": "CreatorNotes (https://creatornotes.app)",
|
|
24
38
|
"license": "MIT",
|
|
39
|
+
"homepage": "https://github.com/creatornotes/pm-notes/tree/main/cli#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/creatornotes/pm-notes/issues"
|
|
42
|
+
},
|
|
25
43
|
"repository": {
|
|
26
44
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/creatornotes/pm-notes",
|
|
45
|
+
"url": "git+https://github.com/creatornotes/pm-notes.git",
|
|
28
46
|
"directory": "cli"
|
|
29
47
|
},
|
|
30
48
|
"publishConfig": {
|
package/skills/cn/SKILL.md
CHANGED
|
@@ -220,7 +220,7 @@ cn theme list
|
|
|
220
220
|
cn theme get
|
|
221
221
|
|
|
222
222
|
# Switch to a built-in preset
|
|
223
|
-
cn theme set <id> # e.g. dracula,
|
|
223
|
+
cn theme set <id> # e.g. dracula, ember, catppuccin-mocha, sage, light, dark
|
|
224
224
|
|
|
225
225
|
# Override a single color (switches the theme to "custom" automatically)
|
|
226
226
|
cn theme set-color <token> <hex> # e.g. cn theme set-color primary "#ff00aa"
|