@bismawy/pi-arnative 0.1.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.
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
3
+ "name": "arnative",
4
+ "vars": {
5
+ "cyan": "#00d7ff",
6
+ "blue": "#5f87ff",
7
+ "green": "#b5bd68",
8
+ "red": "#d07272",
9
+ "yellow": "#ffff00",
10
+ "text": "#d4d4d4",
11
+ "gray": "#8d8d8d",
12
+ "dimGray": "#666666",
13
+ "darkGray": "#505050",
14
+ "accent": "#00d7ff",
15
+ "softCyan": "#7db9cd",
16
+ "searchBg": "#386168",
17
+ "selectedBg": "#3a3a4a",
18
+ "userMsgBg": "#25262f",
19
+ "toolPendingBg": "#1e1e26",
20
+ "toolSuccessBg": "#202828",
21
+ "toolErrorBg": "#342222",
22
+ "customMsgBg": "#201d28"
23
+ },
24
+ "colors": {
25
+ "accent": "accent",
26
+ "tint": "softCyan",
27
+ "border": "blue",
28
+ "borderAccent": "cyan",
29
+ "borderMuted": "darkGray",
30
+ "success": "green",
31
+ "error": "red",
32
+ "warning": "yellow",
33
+ "muted": "gray",
34
+ "dim": "dimGray",
35
+ "text": "text",
36
+ "thinkingText": "gray",
37
+
38
+ "selectedBg": "selectedBg",
39
+ "scrollbarTrack": "darkGray",
40
+ "scrollbarThumb": "softCyan",
41
+ "searchMatchBg": "searchBg",
42
+ "searchMatchText": "text",
43
+ "userMessageBg": "userMsgBg",
44
+ "userMessageText": "text",
45
+ "customMessageBg": "customMsgBg",
46
+ "customMessageText": "text",
47
+ "customMessageLabel": "#9575cd",
48
+ "toolPendingBg": "toolPendingBg",
49
+ "toolSuccessBg": "toolSuccessBg",
50
+ "toolErrorBg": "toolErrorBg",
51
+ "toolTitle": "text",
52
+ "toolOutput": "gray",
53
+
54
+ "mdHeading": "#f0c674",
55
+ "mdLink": "#81a2be",
56
+ "mdLinkUrl": "dimGray",
57
+ "mdCode": "accent",
58
+ "mdCodeBlock": "green",
59
+ "mdCodeBlockBorder": "gray",
60
+ "mdQuote": "gray",
61
+ "mdQuoteBorder": "gray",
62
+ "mdHr": "gray",
63
+ "mdListBullet": "accent",
64
+
65
+ "toolDiffAdded": "green",
66
+ "toolDiffRemoved": "red",
67
+ "toolDiffContext": "gray",
68
+
69
+ "syntaxComment": "#6A9955",
70
+ "syntaxKeyword": "#569CD6",
71
+ "syntaxFunction": "#DCDCAA",
72
+ "syntaxVariable": "#9CDCFE",
73
+ "syntaxString": "#CE9178",
74
+ "syntaxNumber": "#B5CEA8",
75
+ "syntaxType": "#4EC9B0",
76
+ "syntaxOperator": "#D4D4D4",
77
+ "syntaxPunctuation": "#D4D4D4",
78
+
79
+ "thinkingOff": "darkGray",
80
+ "thinkingMinimal": "#33535d",
81
+ "thinkingLow": "#3d7383",
82
+ "thinkingMedium": "#5198ad",
83
+ "thinkingHigh": "#42bce2",
84
+ "thinkingXhigh": "#20caee",
85
+ "thinkingMax": "accent",
86
+
87
+ "bashMode": "green"
88
+ },
89
+ "export": {
90
+ "pageBg": "#18181e",
91
+ "cardBg": "#1e1e24",
92
+ "infoBg": "#3c3728"
93
+ }
94
+ }
@@ -0,0 +1,272 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Generates the arnative theme variants.
4
+ *
5
+ * Structure source of truth = `themes/arnative.json` (also the default theme,
6
+ * never rewritten here). Palette source of truth = the PALET table below.
7
+ * Variants are text substitutions on the base, so its original formatting
8
+ * (tabs + grouping blank lines) is preserved.
9
+ *
10
+ * node themes/gen-themes.mjs rewrite all variants
11
+ * node themes/gen-themes.mjs --check fail when a file differs from the generated output
12
+ *
13
+ * Color validation (contrast, required keys) lives in the self-check in
14
+ * `extensions/ui-render-tweaks.ts` to keep one source of rules.
15
+ */
16
+ import { readFileSync, writeFileSync } from "node:fs";
17
+
18
+ const baseUrl = new URL("arnative.json", import.meta.url);
19
+ const baseText = readFileSync(baseUrl, "utf8");
20
+ const base = JSON.parse(baseText);
21
+
22
+ // Every theme must set ALL of these, so no color silently inherits the base.
23
+ const KUNCI_VARS = [
24
+ "accent", "cyan", "blue", "green", "red", "yellow", "text", "gray", "dimGray", "darkGray",
25
+ "softCyan", "searchBg", "selectedBg", "userMsgBg", "toolPendingBg", "toolSuccessBg", "toolErrorBg", "customMsgBg",
26
+ ];
27
+ const KUNCI_COLORS = [
28
+ "customMessageLabel", "mdHeading", "mdLink",
29
+ "syntaxComment", "syntaxKeyword", "syntaxFunction", "syntaxVariable", "syntaxString",
30
+ "syntaxNumber", "syntaxType", "syntaxOperator", "syntaxPunctuation",
31
+ "thinkingMinimal", "thinkingLow", "thinkingMedium", "thinkingHigh", "thinkingXhigh",
32
+ ];
33
+ const KUNCI_EXPORT = ["pageBg", "cardBg", "infoBg"];
34
+
35
+ /** Per-theme palette. `vars.cyan`/`vars.blue` = borderAccent/border, `vars.softCyan` = tint, `vars.green/red/yellow` = success/error/warning + diff. */
36
+ const PALET = {
37
+ // --- base hue variants -------------------------------------------------
38
+ "arnative-sun": {
39
+ vars: {
40
+ accent: "#ffb454", cyan: "#ffd166", blue: "#da9b2f", green: "#b5bd68", red: "#d07272",
41
+ yellow: "#ffff00", text: "#d4d4d4", gray: "#8d8d8d", dimGray: "#666666", darkGray: "#505050",
42
+ searchBg: "#634f35", softCyan: "#ceb07e", selectedBg: "#484032", userMsgBg: "#312d25", toolPendingBg: "#29251f",
43
+ toolSuccessBg: "#202828", toolErrorBg: "#342222", customMsgBg: "#2e281f",
44
+ },
45
+ colors: {
46
+ customMessageLabel: "#9575cd", mdHeading: "#f0c674", mdLink: "#81a2be",
47
+ syntaxComment: "#6A9955", syntaxKeyword: "#569CD6", syntaxFunction: "#DCDCAA",
48
+ syntaxVariable: "#9CDCFE", syntaxString: "#CE9178", syntaxNumber: "#B5CEA8",
49
+ syntaxType: "#4EC9B0", syntaxOperator: "#D4D4D4", syntaxPunctuation: "#D4D4D4",
50
+ thinkingMinimal: "#5f4e30", thinkingLow: "#80673c", thinkingMedium: "#aa8950",
51
+ thinkingHigh: "#e1a741", thinkingXhigh: "#f2b54a",
52
+ },
53
+ export: { pageBg: "#18181e", cardBg: "#1e1e24", infoBg: "#3c3728" },
54
+ },
55
+ "arnative-zinc": {
56
+ vars: {
57
+ accent: "#a1a1aa", cyan: "#c4c4cc", blue: "#6b6b75", green: "#b5bd68", red: "#d07272",
58
+ yellow: "#ffff00", text: "#d4d4d4", gray: "#8d8d8d", dimGray: "#666666", darkGray: "#505050",
59
+ searchBg: "#4a4a4f", softCyan: "#a2a0ab", selectedBg: "#3b3a40", userMsgBg: "#2a292e", toolPendingBg: "#232225",
60
+ toolSuccessBg: "#202828", toolErrorBg: "#342222", customMsgBg: "#23222a",
61
+ },
62
+ colors: {
63
+ customMessageLabel: "#9575cd", mdHeading: "#f0c674", mdLink: "#81a2be",
64
+ syntaxComment: "#6A9955", syntaxKeyword: "#569CD6", syntaxFunction: "#DCDCAA",
65
+ syntaxVariable: "#9CDCFE", syntaxString: "#CE9178", syntaxNumber: "#B5CEA8",
66
+ syntaxType: "#4EC9B0", syntaxOperator: "#D4D4D4", syntaxPunctuation: "#D4D4D4",
67
+ thinkingMinimal: "#3d3d44", thinkingLow: "#595962", thinkingMedium: "#6e6e78",
68
+ thinkingHigh: "#96969f", thinkingXhigh: "#b8b8c2",
69
+ },
70
+ export: { pageBg: "#18181e", cardBg: "#1e1e24", infoBg: "#3c3728" },
71
+ },
72
+ "arnative-violet": {
73
+ vars: {
74
+ accent: "#a78bfa", cyan: "#c4b5fd", blue: "#8b6ef5", green: "#b5bd68", red: "#d07272",
75
+ yellow: "#ffff00", text: "#d4d4d4", gray: "#8d8d8d", dimGray: "#666666", darkGray: "#505050",
76
+ searchBg: "#413563", softCyan: "#a99ad6", selectedBg: "#393248", userMsgBg: "#292531", toolPendingBg: "#221f29",
77
+ toolSuccessBg: "#202828", toolErrorBg: "#342222", customMsgBg: "#292240",
78
+ },
79
+ colors: {
80
+ customMessageLabel: "#9575cd", mdHeading: "#f0c674", mdLink: "#81a2be",
81
+ syntaxComment: "#6A9955", syntaxKeyword: "#569CD6", syntaxFunction: "#DCDCAA",
82
+ syntaxVariable: "#9CDCFE", syntaxString: "#CE9178", syntaxNumber: "#B5CEA8",
83
+ syntaxType: "#4EC9B0", syntaxOperator: "#D4D4D4", syntaxPunctuation: "#D4D4D4",
84
+ thinkingMinimal: "#413364", thinkingLow: "#614899", thinkingMedium: "#765cb2",
85
+ thinkingHigh: "#8f6ef0", thinkingXhigh: "#a98bfa",
86
+ },
87
+ export: { pageBg: "#18181e", cardBg: "#1e1e24", infoBg: "#3c3728" },
88
+ },
89
+ "arnative-emerald": {
90
+ vars: {
91
+ accent: "#6ee7b7", cyan: "#a7f3d0", blue: "#34b98a", green: "#b5bd68", red: "#d07272",
92
+ yellow: "#ffff00", text: "#d4d4d4", gray: "#8d8d8d", dimGray: "#666666", darkGray: "#505050",
93
+ searchBg: "#356351", softCyan: "#7eceaf", selectedBg: "#324840", userMsgBg: "#25312d", toolPendingBg: "#1f2925",
94
+ toolSuccessBg: "#202828", toolErrorBg: "#342222", customMsgBg: "#1f3028",
95
+ },
96
+ colors: {
97
+ customMessageLabel: "#9575cd", mdHeading: "#f0c674", mdLink: "#81a2be",
98
+ syntaxComment: "#6A9955", syntaxKeyword: "#569CD6", syntaxFunction: "#DCDCAA",
99
+ syntaxVariable: "#9CDCFE", syntaxString: "#CE9178", syntaxNumber: "#B5CEA8",
100
+ syntaxType: "#4EC9B0", syntaxOperator: "#D4D4D4", syntaxPunctuation: "#D4D4D4",
101
+ thinkingMinimal: "#305f4d", thinkingLow: "#3c8066", thinkingMedium: "#50aa87",
102
+ thinkingHigh: "#41e1a4", thinkingXhigh: "#4af2b2",
103
+ },
104
+ export: { pageBg: "#18181e", cardBg: "#1e1e24", infoBg: "#3c3728" },
105
+ },
106
+
107
+ // --- strongly themed ----------------------------------------------------
108
+ // Monochrome phosphor green on a near-black canvas.
109
+ "arnative-matrix": {
110
+ vars: {
111
+ accent: "#00ff41", cyan: "#8dffab", blue: "#1f8f4f", green: "#47ff7a", red: "#ff5555",
112
+ yellow: "#ffe066", text: "#ccffd8", gray: "#6f9f7f", dimGray: "#4f7f5f", darkGray: "#2f4f3a",
113
+ searchBg: "#284b31", softCyan: "#58e07a", selectedBg: "#10452a", userMsgBg: "#0a1410", toolPendingBg: "#060f0b",
114
+ toolSuccessBg: "#0b2413", toolErrorBg: "#3b1212", customMsgBg: "#08160f",
115
+ },
116
+ colors: {
117
+ customMessageLabel: "#8dffab", mdHeading: "#00ff41", mdLink: "#8dffab",
118
+ syntaxComment: "#4f8f5f", syntaxKeyword: "#00ff41", syntaxFunction: "#9dffb4",
119
+ syntaxVariable: "#d6ffdf", syntaxString: "#2fbf5f", syntaxNumber: "#7dffa0",
120
+ syntaxType: "#3fe07a", syntaxOperator: "#b6ffc4", syntaxPunctuation: "#9dffb4",
121
+ thinkingMinimal: "#1f4a2c", thinkingLow: "#2c7a45", thinkingMedium: "#3fae63",
122
+ thinkingHigh: "#59d97f", thinkingXhigh: "#00ff41",
123
+ },
124
+ export: { pageBg: "#050a06", cardBg: "#0a1410", infoBg: "#123018" },
125
+ },
126
+ // Neon magenta/cyan/yellow on a deep indigo canvas.
127
+ "arnative-cyberpunk": {
128
+ vars: {
129
+ accent: "#ff2e97", cyan: "#00f0ff", blue: "#2a7fd4", green: "#00ff9f", red: "#ff4d6d",
130
+ yellow: "#ffe600", text: "#eaeaf5", gray: "#8b88a8", dimGray: "#6f6a9a", darkGray: "#4a4763",
131
+ searchBg: "#5f3349", softCyan: "#7fd8f0", selectedBg: "#2b2350", userMsgBg: "#16131f", toolPendingBg: "#0d0b16",
132
+ toolSuccessBg: "#0d2430", toolErrorBg: "#3a1524", customMsgBg: "#1a1329",
133
+ },
134
+ colors: {
135
+ customMessageLabel: "#00f0ff", mdHeading: "#ffe600", mdLink: "#00f0ff",
136
+ syntaxComment: "#6f6a9a", syntaxKeyword: "#00f0ff", syntaxFunction: "#ffe600",
137
+ syntaxVariable: "#ffd9f2", syntaxString: "#ff2e97", syntaxNumber: "#ff9a3c",
138
+ syntaxType: "#00ff9f", syntaxOperator: "#c8c8e8", syntaxPunctuation: "#9a96c0",
139
+ thinkingMinimal: "#33285c", thinkingLow: "#4d3a94", thinkingMedium: "#7a4fd6",
140
+ thinkingHigh: "#b84fe8", thinkingXhigh: "#ff4fc3",
141
+ },
142
+ export: { pageBg: "#0d0b16", cardBg: "#16131f", infoBg: "#3a2a10" },
143
+ },
144
+ // 80s retro: deep purple, neon pink, cyan.
145
+ "arnative-synthwave": {
146
+ vars: {
147
+ accent: "#ff7edb", cyan: "#36f9f6", blue: "#7a5fd6", green: "#72f1b8", red: "#ff5f7e",
148
+ yellow: "#fede5d", text: "#f2eafb", gray: "#9b8fb8", dimGray: "#848bbd", darkGray: "#55496e",
149
+ searchBg: "#7a426a", softCyan: "#c3b1f0", selectedBg: "#443a63", userMsgBg: "#2a2138", toolPendingBg: "#1f1830",
150
+ toolSuccessBg: "#1f2e29", toolErrorBg: "#402134", customMsgBg: "#2e1f3d",
151
+ },
152
+ colors: {
153
+ customMessageLabel: "#36f9f6", mdHeading: "#fede5d", mdLink: "#36f9f6",
154
+ syntaxComment: "#848bbd", syntaxKeyword: "#fede5d", syntaxFunction: "#36f9f6",
155
+ syntaxVariable: "#f2eafb", syntaxString: "#ff8b39", syntaxNumber: "#f97e72",
156
+ syntaxType: "#ff7edb", syntaxOperator: "#f2eafb", syntaxPunctuation: "#b8a6e8",
157
+ thinkingMinimal: "#4a3a6b", thinkingLow: "#6b4f9e", thinkingMedium: "#9166d6",
158
+ thinkingHigh: "#d47ee8", thinkingXhigh: "#ff7edb",
159
+ },
160
+ export: { pageBg: "#1f1830", cardBg: "#2a2138", infoBg: "#443a63" },
161
+ },
162
+ // Warm retro: brownish grey canvas, gold + aqua + brick.
163
+ "arnative-gruvbox": {
164
+ vars: {
165
+ accent: "#fabd2f", cyan: "#8ec07c", blue: "#83a598", green: "#b8bb26", red: "#fc6654",
166
+ yellow: "#fabd2f", text: "#ebdbb2", gray: "#a89984", dimGray: "#928374", darkGray: "#665c54",
167
+ searchBg: "#6c5d3a", softCyan: "#d5c4a1", selectedBg: "#504945", userMsgBg: "#32302f", toolPendingBg: "#1d2021",
168
+ toolSuccessBg: "#2a3225", toolErrorBg: "#3c2c27", customMsgBg: "#3c3836",
169
+ },
170
+ colors: {
171
+ customMessageLabel: "#d3869b", mdHeading: "#fabd2f", mdLink: "#83a598",
172
+ syntaxComment: "#928374", syntaxKeyword: "#fb4934", syntaxFunction: "#b8bb26",
173
+ syntaxVariable: "#83a598", syntaxString: "#b8bb26", syntaxNumber: "#d3869b",
174
+ syntaxType: "#fabd2f", syntaxOperator: "#ebdbb2", syntaxPunctuation: "#d5c4a1",
175
+ thinkingMinimal: "#665c54", thinkingLow: "#a89984", thinkingMedium: "#d5c4a1",
176
+ thinkingHigh: "#fabd2f", thinkingXhigh: "#fe8019",
177
+ },
178
+ export: { pageBg: "#1d2021", cardBg: "#282828", infoBg: "#3c3836" },
179
+ },
180
+ // Cool and calm Nord: frost blue + aurora.
181
+ "arnative-nord": {
182
+ vars: {
183
+ accent: "#88c0d0", cyan: "#8fbcbb", blue: "#5e81ac", green: "#a3be8c", red: "#d4979d",
184
+ yellow: "#ebcb8b", text: "#eceff4", gray: "#9da8b7", dimGray: "#7b869b", darkGray: "#4c566a",
185
+ searchBg: "#476e79", softCyan: "#bcd3e0", selectedBg: "#434c5e", userMsgBg: "#3b4252", toolPendingBg: "#2e3440",
186
+ toolSuccessBg: "#333f38", toolErrorBg: "#4a383c", customMsgBg: "#38404f",
187
+ },
188
+ colors: {
189
+ customMessageLabel: "#b48ead", mdHeading: "#ebcb8b", mdLink: "#88c0d0",
190
+ syntaxComment: "#64728c", syntaxKeyword: "#81a1c1", syntaxFunction: "#88c0d0",
191
+ syntaxVariable: "#d8dee9", syntaxString: "#a3be8c", syntaxNumber: "#b48ead",
192
+ syntaxType: "#8fbcbb", syntaxOperator: "#81a1c1", syntaxPunctuation: "#eceff4",
193
+ thinkingMinimal: "#4c566a", thinkingLow: "#5e81ac", thinkingMedium: "#81a1c1",
194
+ thinkingHigh: "#88c0d0", thinkingXhigh: "#8fbcbb",
195
+ },
196
+ export: { pageBg: "#272c36", cardBg: "#2e3440", infoBg: "#3b4252" },
197
+ },
198
+ // Classic dark purple: pink + cyan + mint.
199
+ "arnative-dracula": {
200
+ vars: {
201
+ accent: "#bd93f9", cyan: "#8be9fd", blue: "#6272a4", green: "#50fa7b", red: "#ff6363",
202
+ yellow: "#f1fa8c", text: "#f8f8f2", gray: "#8e96ba", dimGray: "#6272a4", darkGray: "#4a4e63",
203
+ searchBg: "#59427b", softCyan: "#c9b8f2", selectedBg: "#44475a", userMsgBg: "#343746", toolPendingBg: "#21222c",
204
+ toolSuccessBg: "#26332e", toolErrorBg: "#412936", customMsgBg: "#383a52",
205
+ },
206
+ colors: {
207
+ customMessageLabel: "#ff79c6", mdHeading: "#f1fa8c", mdLink: "#8be9fd",
208
+ syntaxComment: "#6272a4", syntaxKeyword: "#ff79c6", syntaxFunction: "#50fa7b",
209
+ syntaxVariable: "#8be9fd", syntaxString: "#f1fa8c", syntaxNumber: "#bd93f9",
210
+ syntaxType: "#8be9fd", syntaxOperator: "#ff79c6", syntaxPunctuation: "#f8f8f2",
211
+ thinkingMinimal: "#464a5d", thinkingLow: "#6272a4", thinkingMedium: "#7a6fd0",
212
+ thinkingHigh: "#bd93f9", thinkingXhigh: "#ff79c6",
213
+ },
214
+ export: { pageBg: "#21222c", cardBg: "#282a36", infoBg: "#44475a" },
215
+ },
216
+ };
217
+
218
+ /** Text substitution on the base; each target must appear exactly once. */
219
+ function render(nama, palet) {
220
+ let out = baseText;
221
+ const tukar = (oldS, newS, apa) => {
222
+ const n = out.split(oldS).length - 1;
223
+ if (n !== 1) throw new Error(`${nama}: ${apa} "${oldS}" muncul ${n}x (harus 1)`);
224
+ out = out.replace(oldS, newS);
225
+ };
226
+
227
+ tukar(`"name": ${JSON.stringify(base.name)}`, `"name": ${JSON.stringify(nama)}`, "name");
228
+ for (const [bagian, kunci, wajib] of [
229
+ ["vars", palet.vars, KUNCI_VARS],
230
+ ["colors", palet.colors, KUNCI_COLORS],
231
+ ["export", palet.export, KUNCI_EXPORT],
232
+ ]) {
233
+ const kurang = wajib.filter((k) => !(k in kunci));
234
+ const lebih = Object.keys(kunci).filter((k) => !wajib.includes(k));
235
+ if (kurang.length || lebih.length) {
236
+ throw new Error(`${nama}/${bagian}: kurang [${kurang}] lebih [${lebih}]`);
237
+ }
238
+ for (const k of wajib) {
239
+ const lama = base[bagian][k];
240
+ if (lama === undefined) throw new Error(`${nama}: base.${bagian}.${k} tidak ada`);
241
+ tukar(`"${k}": ${JSON.stringify(lama)}`, `"${k}": ${JSON.stringify(kunci[k])}`, `${bagian}.${k}`);
242
+ }
243
+ }
244
+ return out;
245
+ }
246
+
247
+ const cek = process.argv.includes("--check");
248
+ let gagal = 0;
249
+ for (const nama of Object.keys(PALET)) {
250
+ const isi = render(nama, PALET[nama]);
251
+ const berkas = new URL(`${nama}.json`, import.meta.url);
252
+ if (cek) {
253
+ let lama = null;
254
+ try {
255
+ lama = readFileSync(berkas, "utf8");
256
+ } catch {}
257
+ if (lama !== isi) {
258
+ console.error(`BEDA: themes/${nama}.json`);
259
+ gagal++;
260
+ }
261
+ } else {
262
+ writeFileSync(berkas, isi);
263
+ console.log(`tulis themes/${nama}.json`);
264
+ }
265
+ }
266
+ if (cek) {
267
+ if (gagal) {
268
+ console.error(`${gagal} tema tidak sinkron dengan generator (jalankan: node themes/gen-themes.mjs)`);
269
+ process.exit(1);
270
+ }
271
+ console.log(`OK: ${Object.keys(PALET).length} tema sinkron dengan generator`);
272
+ }