@whykusanagi/corrupted-theme 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,502 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Corrupted Theme - Complete Component Showcase</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
8
+ <link rel="stylesheet" href="../src/css/theme.css">
9
+ <style>
10
+ body {
11
+ background: var(--bg);
12
+ color: var(--text);
13
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
14
+ line-height: 1.6;
15
+ padding: 0;
16
+ margin: 0;
17
+ }
18
+
19
+ .showcase {
20
+ max-width: 1400px;
21
+ margin: 0 auto;
22
+ padding: var(--spacing-xl);
23
+ }
24
+
25
+ .showcase-section {
26
+ margin-bottom: var(--spacing-2xl);
27
+ }
28
+
29
+ .showcase-section h2 {
30
+ color: var(--accent);
31
+ margin-bottom: var(--spacing-lg);
32
+ padding-bottom: var(--spacing-md);
33
+ border-bottom: 2px solid var(--border);
34
+ font-size: 2rem;
35
+ }
36
+
37
+ .showcase-section h3 {
38
+ color: var(--text);
39
+ margin-top: var(--spacing-lg);
40
+ margin-bottom: var(--spacing-md);
41
+ font-size: 1.25rem;
42
+ }
43
+
44
+ .showcase-grid {
45
+ display: grid;
46
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
47
+ gap: var(--spacing-lg);
48
+ margin-bottom: var(--spacing-lg);
49
+ }
50
+
51
+ .code-example {
52
+ background: var(--glass-darker);
53
+ border: 1px solid var(--border);
54
+ border-radius: var(--radius-lg);
55
+ padding: var(--spacing-md);
56
+ margin-top: var(--spacing-md);
57
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
58
+ font-size: 0.875rem;
59
+ overflow-x: auto;
60
+ color: var(--text-secondary);
61
+ }
62
+
63
+ .demo-container {
64
+ background: var(--glass);
65
+ border: 1px solid var(--border);
66
+ border-radius: var(--radius-lg);
67
+ padding: var(--spacing-lg);
68
+ display: flex;
69
+ flex-wrap: wrap;
70
+ gap: var(--spacing-md);
71
+ align-items: center;
72
+ justify-content: center;
73
+ margin-bottom: var(--spacing-md);
74
+ }
75
+
76
+ .hero {
77
+ background: var(--gradient-accent);
78
+ color: white;
79
+ padding: var(--spacing-2xl) var(--spacing-lg);
80
+ border-radius: var(--radius-xl);
81
+ text-align: center;
82
+ margin-bottom: var(--spacing-2xl);
83
+ }
84
+
85
+ .hero h1 {
86
+ font-size: 3rem;
87
+ margin-bottom: var(--spacing-md);
88
+ color: white;
89
+ }
90
+
91
+ .hero p {
92
+ font-size: 1.2rem;
93
+ margin-bottom: var(--spacing-md);
94
+ opacity: 0.95;
95
+ }
96
+
97
+ .form-demo {
98
+ max-width: 600px;
99
+ margin: 0 auto;
100
+ }
101
+
102
+ .form-demo label {
103
+ display: block;
104
+ margin-bottom: var(--spacing-sm);
105
+ color: var(--text);
106
+ font-weight: 500;
107
+ margin-top: var(--spacing-md);
108
+ }
109
+
110
+ .form-demo label:first-child {
111
+ margin-top: 0;
112
+ }
113
+
114
+ .comparison-grid {
115
+ display: grid;
116
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
117
+ gap: var(--spacing-lg);
118
+ margin-bottom: var(--spacing-lg);
119
+ }
120
+
121
+ .comparison-item {
122
+ padding: var(--spacing-md);
123
+ }
124
+
125
+ .comparison-item h4 {
126
+ margin-bottom: var(--spacing-md);
127
+ color: var(--accent);
128
+ }
129
+ </style>
130
+ </head>
131
+ <body>
132
+ <!-- Navigation -->
133
+ <nav class="navbar">
134
+ <div class="navbar-content">
135
+ <a href="#" class="navbar-logo"><i class="fas fa-palette"></i> Corrupted Theme</a>
136
+ <ul class="navbar-links">
137
+ <li><a href="#glass-components" class="active">Glass Components</a></li>
138
+ <li><a href="#standard-components">Standard Components</a></li>
139
+ <li><a href="#forms">Forms</a></li>
140
+ <li><a href="#badges">Badges</a></li>
141
+ <li><a href="#utilities">Utilities</a></li>
142
+ </ul>
143
+ </div>
144
+ </nav>
145
+
146
+ <div class="showcase">
147
+ <!-- Hero Section -->
148
+ <section class="hero">
149
+ <h1>Corrupted Theme</h1>
150
+ <p>Complete Component Showcase</p>
151
+ <p style="font-size: 1rem; opacity: 0.9;">
152
+ A comprehensive dark design system with glassmorphism effects, ready for any application
153
+ </p>
154
+ </section>
155
+
156
+ <!-- Glass Components Section -->
157
+ <section class="showcase-section" id="glass-components">
158
+ <h2><i class="fas fa-cube"></i> Glass Components</h2>
159
+ <p style="color: var(--text-secondary); margin-bottom: var(--spacing-lg);">
160
+ Reusable glass components perfect for API documentation, dashboards, and modern web applications.
161
+ </p>
162
+
163
+ <h3>Glass Card</h3>
164
+ <div class="showcase-grid">
165
+ <div class="glass-card" style="padding: var(--spacing-lg);">
166
+ <h4 style="margin-bottom: var(--spacing-md); color: var(--accent);">Glass Card</h4>
167
+ <p>This is a glass-card component with backdrop blur and hover effects. Perfect for containers and panels.</p>
168
+ </div>
169
+ <div class="glass-card" style="padding: var(--spacing-lg);">
170
+ <h4 style="margin-bottom: var(--spacing-md); color: var(--accent);">Hover Me</h4>
171
+ <p>Hover over this card to see the enhanced shadow and border effects.</p>
172
+ </div>
173
+ </div>
174
+ <div class="code-example">
175
+ &lt;div class="glass-card" style="padding: 1.5rem;"&gt;
176
+ &lt;h4&gt;Card Title&lt;/h4&gt;
177
+ &lt;p&gt;Card content goes here&lt;/p&gt;
178
+ &lt;/div&gt;
179
+ </div>
180
+
181
+ <h3>Glass Input</h3>
182
+ <div class="form-demo">
183
+ <label for="glass-name">Name</label>
184
+ <input type="text" id="glass-name" class="glass-input" placeholder="Enter your name">
185
+
186
+ <label for="glass-email">Email</label>
187
+ <input type="email" id="glass-email" class="glass-input" placeholder="your@email.com">
188
+
189
+ <label for="glass-message">Message</label>
190
+ <textarea id="glass-message" class="glass-input" rows="4" placeholder="Your message here..."></textarea>
191
+
192
+ <label for="glass-select">Category</label>
193
+ <select id="glass-select" class="glass-input">
194
+ <option>Select a category</option>
195
+ <option>Feature Request</option>
196
+ <option>Bug Report</option>
197
+ <option>Feedback</option>
198
+ </select>
199
+ </div>
200
+ <div class="code-example">
201
+ &lt;input type="text" class="glass-input" placeholder="Enter text..."&gt;
202
+ &lt;textarea class="glass-input"&gt;&lt;/textarea&gt;
203
+ &lt;select class="glass-input"&gt;
204
+ &lt;option&gt;Option 1&lt;/option&gt;
205
+ &lt;/select&gt;
206
+ </div>
207
+
208
+ <h3>Glass Button</h3>
209
+ <div class="demo-container">
210
+ <button class="glass-button"><i class="fas fa-rocket"></i> Glass Button</button>
211
+ <a href="#" class="glass-button"><i class="fas fa-link"></i> Link Button</a>
212
+ <button class="glass-button" disabled>Disabled</button>
213
+ </div>
214
+ <div class="code-example">
215
+ &lt;button class="glass-button"&gt;Click Me&lt;/button&gt;
216
+ &lt;a href="#" class="glass-button"&gt;Link Button&lt;/a&gt;
217
+ &lt;button class="glass-button" disabled&gt;Disabled&lt;/button&gt;
218
+ </div>
219
+
220
+ <h3>Glass Code</h3>
221
+ <div style="margin-bottom: var(--spacing-md);">
222
+ <pre class="glass-code">const example = "Hello, World!";
223
+ const theme = {
224
+ accent: "#d94f90",
225
+ glass: "rgba(20, 12, 40, 0.7)"
226
+ };</pre>
227
+ </div>
228
+ <div class="code-example">
229
+ &lt;pre class="glass-code"&gt;const example = "Hello, World!";&lt;/pre&gt;
230
+ &lt;code class="glass-code"&gt;inline code&lt;/code&gt;
231
+ </div>
232
+ </section>
233
+
234
+ <!-- Standard Components Section -->
235
+ <section class="showcase-section" id="standard-components">
236
+ <h2><i class="fas fa-shapes"></i> Standard Components</h2>
237
+
238
+ <h3>Cards</h3>
239
+ <div class="showcase-grid">
240
+ <div class="card">
241
+ <h4 style="margin-bottom: var(--spacing-md); color: var(--accent);">Standard Card</h4>
242
+ <p>This is a standard card component with glass effect.</p>
243
+ <button class="btn btn-sm" style="margin-top: var(--spacing-md);">Action</button>
244
+ </div>
245
+ <div class="card sm">
246
+ <h4 style="margin-bottom: var(--spacing-md); color: var(--accent);">Small Card</h4>
247
+ <p>Card with reduced padding.</p>
248
+ </div>
249
+ <div class="card lg">
250
+ <h4 style="margin-bottom: var(--spacing-md); color: var(--accent);">Large Card</h4>
251
+ <p>Card with increased padding for more content.</p>
252
+ </div>
253
+ <div class="frosted-card">
254
+ <h4 style="margin-bottom: var(--spacing-md); color: var(--accent);">Frosted Card</h4>
255
+ <p>Enhanced glass effect with stronger blur.</p>
256
+ </div>
257
+ </div>
258
+
259
+ <h3>Buttons</h3>
260
+ <div class="demo-container">
261
+ <button class="btn"><i class="fas fa-mouse"></i> Primary</button>
262
+ <button class="btn btn-secondary"><i class="fas fa-star"></i> Secondary</button>
263
+ <button class="btn btn-ghost"><i class="fas fa-ghost"></i> Ghost</button>
264
+ <button class="btn btn-sm">Small</button>
265
+ <button class="btn btn-lg">Large</button>
266
+ <button class="btn" disabled>Disabled</button>
267
+ </div>
268
+
269
+ <h3>Alerts</h3>
270
+ <div style="display: grid; gap: var(--spacing-md); max-width: 800px;">
271
+ <div class="alert alert-success">
272
+ <i class="fas fa-check-circle"></i> Success! Operation completed successfully.
273
+ </div>
274
+ <div class="alert alert-info">
275
+ <i class="fas fa-info-circle"></i> Info: Here's some helpful information.
276
+ </div>
277
+ <div class="alert alert-warning">
278
+ <i class="fas fa-exclamation-triangle"></i> Warning: Please review this carefully.
279
+ </div>
280
+ <div class="alert alert-error">
281
+ <i class="fas fa-times-circle"></i> Error: Something went wrong.
282
+ </div>
283
+ </div>
284
+ </section>
285
+
286
+ <!-- Badges Section -->
287
+ <section class="showcase-section" id="badges">
288
+ <h2><i class="fas fa-tag"></i> Badges & Tags</h2>
289
+
290
+ <h3>Standard Badges</h3>
291
+ <div class="demo-container">
292
+ <span class="badge">Default</span>
293
+ <span class="badge badge-primary">Primary</span>
294
+ <span class="badge badge-secondary">Secondary</span>
295
+ <span class="badge badge-success">Success</span>
296
+ <span class="badge badge-warning">Warning</span>
297
+ <span class="badge badge-error">Error</span>
298
+ </div>
299
+
300
+ <h3>API Method Badges</h3>
301
+ <div class="demo-container">
302
+ <span class="badge badge-method">API</span>
303
+ <span class="badge badge-get">GET</span>
304
+ <span class="badge badge-post">POST</span>
305
+ <span class="badge badge-method">PUT</span>
306
+ <span class="badge badge-method">DELETE</span>
307
+ </div>
308
+ <div class="code-example">
309
+ &lt;span class="badge badge-method"&gt;API&lt;/span&gt;
310
+ &lt;span class="badge badge-get"&gt;GET&lt;/span&gt;
311
+ &lt;span class="badge badge-post"&gt;POST&lt;/span&gt;
312
+ </div>
313
+
314
+ <h3>Tags</h3>
315
+ <div class="demo-container">
316
+ <span class="tag">React</span>
317
+ <span class="tag">Vue</span>
318
+ <span class="tag">Angular</span>
319
+ <span class="tag">Svelte</span>
320
+ </div>
321
+ </section>
322
+
323
+ <!-- Forms Section -->
324
+ <section class="showcase-section" id="forms">
325
+ <h2><i class="fas fa-edit"></i> Forms</h2>
326
+
327
+ <h3>Standard Form Inputs</h3>
328
+ <div class="form-demo">
329
+ <label for="name">Name *</label>
330
+ <input type="text" id="name" placeholder="Enter your name" required>
331
+
332
+ <label for="email">Email *</label>
333
+ <input type="email" id="email" placeholder="your@email.com" required>
334
+
335
+ <label for="category">Category</label>
336
+ <select id="category">
337
+ <option>Select a category</option>
338
+ <option>Feature</option>
339
+ <option>Bug Report</option>
340
+ <option>Feedback</option>
341
+ </select>
342
+
343
+ <label for="message">Message</label>
344
+ <textarea id="message" rows="4" placeholder="Your message here..."></textarea>
345
+
346
+ <label style="display: flex; align-items: center; margin-top: var(--spacing-md);">
347
+ <input type="checkbox" style="width: auto; margin-right: var(--spacing-sm);">
348
+ <span>I agree to the terms and conditions</span>
349
+ </label>
350
+
351
+ <button class="btn" style="width: 100%; margin-top: var(--spacing-lg);">Submit Form</button>
352
+ </div>
353
+
354
+ <h3>Component Comparison</h3>
355
+ <div class="comparison-grid">
356
+ <div class="comparison-item">
357
+ <h4>Standard Input</h4>
358
+ <input type="text" placeholder="Standard input style" style="width: 100%; margin-bottom: var(--spacing-md);">
359
+ <p style="font-size: 0.875rem; color: var(--text-secondary);">
360
+ Uses default form styling with glass background.
361
+ </p>
362
+ </div>
363
+ <div class="comparison-item">
364
+ <h4>Glass Input</h4>
365
+ <input type="text" class="glass-input" placeholder="Glass input style" style="width: 100%; margin-bottom: var(--spacing-md);">
366
+ <p style="font-size: 0.875rem; color: var(--text-secondary);">
367
+ Enhanced glass effect with lighter background and better focus states.
368
+ </p>
369
+ </div>
370
+ </div>
371
+ </section>
372
+
373
+ <!-- Utilities Section -->
374
+ <section class="showcase-section" id="utilities">
375
+ <h2><i class="fas fa-tools"></i> Utilities & Layout</h2>
376
+
377
+ <h3>Grid System</h3>
378
+ <div class="grid grid-3">
379
+ <div class="card">
380
+ <h4 style="color: var(--accent);">Grid Item 1</h4>
381
+ <p>Responsive grid layout</p>
382
+ </div>
383
+ <div class="card">
384
+ <h4 style="color: var(--accent);">Grid Item 2</h4>
385
+ <p>Auto-fit columns</p>
386
+ </div>
387
+ <div class="card">
388
+ <h4 style="color: var(--accent);">Grid Item 3</h4>
389
+ <p>Mobile responsive</p>
390
+ </div>
391
+ </div>
392
+
393
+ <h3>Code Blocks</h3>
394
+ <div class="code-block" style="margin-bottom: var(--spacing-md);">
395
+ <pre style="margin: 0; color: var(--text-secondary);">// Standard code block
396
+ const theme = {
397
+ accent: "#d94f90",
398
+ glass: "rgba(20, 12, 40, 0.7)"
399
+ };</pre>
400
+ </div>
401
+ <pre class="glass-code" style="margin-bottom: var(--spacing-md);">// Glass code block
402
+ const theme = {
403
+ accent: "#d94f90",
404
+ glass: "rgba(20, 12, 40, 0.7)"
405
+ };</pre>
406
+
407
+ <h3>Dividers</h3>
408
+ <div style="max-width: 600px;">
409
+ <p>Content above divider</p>
410
+ <div class="divider"></div>
411
+ <p>Content below divider</p>
412
+ <div class="divider sm"></div>
413
+ <p>Small divider</p>
414
+ <div class="divider lg"></div>
415
+ <p>Large divider</p>
416
+ </div>
417
+ </section>
418
+
419
+ <!-- Color Palette Section -->
420
+ <section class="showcase-section">
421
+ <h2><i class="fas fa-palette"></i> Color Palette</h2>
422
+ <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--spacing-lg);">
423
+ <div style="background: var(--accent); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center; color: white;">
424
+ <strong>Accent</strong><br>#d94f90
425
+ </div>
426
+ <div style="background: var(--accent-light); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center; color: white;">
427
+ <strong>Accent Light</strong><br>#e86ca8
428
+ </div>
429
+ <div style="background: var(--accent-dark); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center; color: white;">
430
+ <strong>Accent Dark</strong><br>#b61b70
431
+ </div>
432
+ <div style="background: var(--bg); border: 2px solid var(--border); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center;">
433
+ <strong>Background</strong><br>#0a0a0a
434
+ </div>
435
+ <div style="background: var(--text); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center; color: var(--bg);">
436
+ <strong>Text</strong><br>#f5f1f8
437
+ </div>
438
+ <div style="background: var(--glass); border: 1px solid var(--border); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center;">
439
+ <strong>Glass</strong><br>rgba(20, 12, 40, 0.7)
440
+ </div>
441
+ <div style="background: var(--glass-light); border: 1px solid var(--border); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center;">
442
+ <strong>Glass Light</strong><br>rgba(28, 18, 48, 0.5)
443
+ </div>
444
+ <div style="background: var(--glass-darker); border: 1px solid var(--border); padding: var(--spacing-lg); border-radius: var(--radius-lg); text-align: center;">
445
+ <strong>Glass Darker</strong><br>rgba(10, 5, 20, 0.6)
446
+ </div>
447
+ </div>
448
+ </section>
449
+
450
+ <!-- Footer -->
451
+ <footer style="text-align: center; padding: var(--spacing-2xl) var(--spacing-lg); margin-top: var(--spacing-2xl); border-top: 1px solid var(--border); color: var(--text-secondary);">
452
+ <p><strong>Corrupted Theme</strong> v0.1.0 • Built with <i class="fas fa-heart" style="color: var(--accent);"></i> by whykusanagi</p>
453
+ <p style="font-size: 0.875rem; margin-top: var(--spacing-md);">
454
+ <a href="../README.md" class="link">Documentation</a> •
455
+ <a href="../docs/CUSTOMIZATION.md" class="link">Customization</a> •
456
+ <a href="https://github.com/whykusanagi/corrupted-theme" class="link">GitHub</a>
457
+ </p>
458
+ </footer>
459
+ </div>
460
+
461
+ <script>
462
+ // Smooth scroll for navigation links
463
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
464
+ anchor.addEventListener('click', function(e) {
465
+ e.preventDefault();
466
+ const target = document.querySelector(this.getAttribute('href'));
467
+ if (target) {
468
+ target.scrollIntoView({ behavior: 'smooth', block: 'start' });
469
+ // Update active state
470
+ document.querySelectorAll('.navbar-links a').forEach(link => {
471
+ link.classList.remove('active');
472
+ });
473
+ this.classList.add('active');
474
+ }
475
+ });
476
+ });
477
+
478
+ // Update active nav on scroll
479
+ const sections = document.querySelectorAll('.showcase-section');
480
+ const navLinks = document.querySelectorAll('.navbar-links a');
481
+
482
+ window.addEventListener('scroll', () => {
483
+ let current = '';
484
+ sections.forEach(section => {
485
+ const sectionTop = section.offsetTop;
486
+ const sectionHeight = section.clientHeight;
487
+ if (window.pageYOffset >= sectionTop - 200) {
488
+ current = section.getAttribute('id');
489
+ }
490
+ });
491
+
492
+ navLinks.forEach(link => {
493
+ link.classList.remove('active');
494
+ if (link.getAttribute('href') === `#${current}`) {
495
+ link.classList.add('active');
496
+ }
497
+ });
498
+ });
499
+ </script>
500
+ </body>
501
+ </html>
502
+
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@whykusanagi/corrupted-theme",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "A dark, glassmorphic design system with pink/purple accents. Perfect for creating modern, visually striking web applications.",
6
+ "main": "src/css/theme.css",
7
+ "style": "src/css/theme.css",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./src/css/theme.css",
11
+ "require": "./src/css/theme.css"
12
+ },
13
+ "./variables": "./src/css/variables.css",
14
+ "./typography": "./src/css/typography.css",
15
+ "./glassmorphism": "./src/css/glassmorphism.css",
16
+ "./animations": "./src/css/animations.css",
17
+ "./components": "./src/css/components.css",
18
+ "./utilities": "./src/css/utilities.css",
19
+ "./nikke-utilities": "./src/css/nikke-utilities.css"
20
+ },
21
+ "files": [
22
+ "src",
23
+ "scripts",
24
+ "docs",
25
+ "examples",
26
+ "Dockerfile",
27
+ "docker-entrypoint.sh",
28
+ "README.md",
29
+ "CHANGELOG.md",
30
+ "LICENSE"
31
+ ],
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/whykusanagi/corrupted-theme.git"
35
+ },
36
+ "keywords": [
37
+ "css",
38
+ "theme",
39
+ "design-system",
40
+ "glassmorphism",
41
+ "dark-mode",
42
+ "ui-framework",
43
+ "styling",
44
+ "css-variables",
45
+ "celeste-widget",
46
+ "chat-widget",
47
+ "ai-chat"
48
+ ],
49
+ "author": "whykusanagi <contact@whykusanagi.xyz>",
50
+ "license": "MIT",
51
+ "engines": {
52
+ "node": ">=14.0.0"
53
+ },
54
+ "devDependencies": {
55
+ "cssnano": "^6.0.0",
56
+ "postcss": "^8.4.0",
57
+ "postcss-cli": "^10.0.0"
58
+ },
59
+ "scripts": {
60
+ "build": "postcss src/css/theme.css -o dist/theme.min.css",
61
+ "watch": "postcss --watch src/css/theme.css -o dist/theme.min.css",
62
+ "dev:proxy": "node scripts/celeste-proxy-server.js",
63
+ "dev:static": "node scripts/static-server.js",
64
+ "start": "npm run dev:static"
65
+ },
66
+ "homepage": "https://github.com/whykusanagi/corrupted-theme#readme",
67
+ "bugs": {
68
+ "url": "https://github.com/whykusanagi/corrupted-theme/issues"
69
+ }
70
+ }
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Local Celeste Proxy Server for Testing
4
+ * Runs the same proxy logic locally before deploying to Cloudflare Workers
5
+ */
6
+
7
+ import http from 'http';
8
+ import { handleProxyRequest } from '../src/lib/celeste-proxy.js';
9
+
10
+ const PORT = process.env.PROXY_PORT || 5000;
11
+ const HOST = process.env.HOST || '0.0.0.0';
12
+
13
+ // Load environment variables
14
+ const env = {
15
+ CELESTE_AGENT_KEY: process.env.CELESTE_AGENT_KEY,
16
+ CELESTE_AGENT_ID: process.env.CELESTE_AGENT_ID,
17
+ CELESTE_AGENT_BASE_URL: process.env.CELESTE_AGENT_BASE_URL
18
+ };
19
+
20
+ // Validate environment
21
+ if (!env.CELESTE_AGENT_KEY || !env.CELESTE_AGENT_ID || !env.CELESTE_AGENT_BASE_URL) {
22
+ console.error('❌ Missing required environment variables:');
23
+ console.error(' CELESTE_AGENT_KEY');
24
+ console.error(' CELESTE_AGENT_ID');
25
+ console.error(' CELESTE_AGENT_BASE_URL');
26
+ process.exit(1);
27
+ }
28
+
29
+ console.log('✅ Configuration validated');
30
+ console.log(` Agent ID: ${env.CELESTE_AGENT_ID.substring(0, 8)}...`);
31
+ console.log(` Base URL: ${env.CELESTE_AGENT_BASE_URL}`);
32
+
33
+ // Create server
34
+ const server = http.createServer(async (req, res) => {
35
+ const url = new URL(req.url, `http://${req.headers.host}`);
36
+
37
+ // Handle health check directly
38
+ if (url.pathname === '/api/health' && req.method === 'GET') {
39
+ res.writeHead(200, {
40
+ 'Content-Type': 'application/json',
41
+ 'Access-Control-Allow-Origin': '*'
42
+ });
43
+ res.end(JSON.stringify({
44
+ status: 'ok',
45
+ service: 'Celeste Widget API Proxy',
46
+ timestamp: Date.now() / 1000,
47
+ agent_id: env.CELESTE_AGENT_ID ? env.CELESTE_AGENT_ID.substring(0, 8) + '...' : 'not configured'
48
+ }));
49
+ return;
50
+ }
51
+
52
+ // Convert Node.js request to Fetch API Request
53
+ const fullUrl = `http://${req.headers.host}${req.url}`;
54
+
55
+ // Read request body
56
+ let body = '';
57
+ req.on('data', chunk => {
58
+ body += chunk.toString();
59
+ });
60
+
61
+ req.on('end', async () => {
62
+ try {
63
+ // Create Fetch API Request object
64
+ const request = new Request(fullUrl, {
65
+ method: req.method,
66
+ headers: req.headers,
67
+ body: body || undefined
68
+ });
69
+
70
+ // Handle proxy request
71
+ const response = await handleProxyRequest(request, env);
72
+
73
+ // Send response
74
+ res.statusCode = response.status;
75
+
76
+ // Copy headers
77
+ response.headers.forEach((value, key) => {
78
+ res.setHeader(key, value);
79
+ });
80
+
81
+ // Send body
82
+ const responseBody = await response.text();
83
+ res.end(responseBody);
84
+ } catch (error) {
85
+ console.error('Server error:', error);
86
+ res.statusCode = 500;
87
+ res.setHeader('Content-Type', 'application/json');
88
+ res.end(JSON.stringify({ error: 'Internal server error' }));
89
+ }
90
+ });
91
+ });
92
+
93
+ server.listen(PORT, HOST, () => {
94
+ console.log(`🚀 Celeste Proxy Server running on http://${HOST}:${PORT}`);
95
+ console.log(' Endpoints:');
96
+ console.log(' - POST /api/chat (widget requests)');
97
+ console.log(' - GET /api/health (health check)');
98
+ });
99
+