@jvittechs/jai1-cli 0.1.95 → 0.1.97

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.
Files changed (135) hide show
  1. package/dist/cli.js +684 -122
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web-chat/README.md +418 -0
  4. package/dist/web-chat/app.js +1527 -0
  5. package/dist/web-chat/index.html +324 -0
  6. package/dist/web-chat/node_modules/.bin/0ecdsa-generate-keypair +15 -0
  7. package/dist/web-chat/node_modules/.bin/0gentesthtml +89 -0
  8. package/dist/web-chat/node_modules/.bin/0serve +97 -0
  9. package/dist/web-chat/node_modules/.bin/acorn +4 -0
  10. package/dist/web-chat/node_modules/.bin/autoprefixer +22 -0
  11. package/dist/web-chat/node_modules/.bin/baseline-browser-mapping +2 -0
  12. package/dist/web-chat/node_modules/.bin/browserslist +156 -0
  13. package/dist/web-chat/node_modules/.bin/esbuild +0 -0
  14. package/dist/web-chat/node_modules/.bin/jiti +34 -0
  15. package/dist/web-chat/node_modules/.bin/js-yaml +126 -0
  16. package/dist/web-chat/node_modules/.bin/jsesc +148 -0
  17. package/dist/web-chat/node_modules/.bin/json5 +152 -0
  18. package/dist/web-chat/node_modules/.bin/katex +112 -0
  19. package/dist/web-chat/node_modules/.bin/loose-envify +16 -0
  20. package/dist/web-chat/node_modules/.bin/lz-string +13 -0
  21. package/dist/web-chat/node_modules/.bin/nanoid +55 -0
  22. package/dist/web-chat/node_modules/.bin/parser +15 -0
  23. package/dist/web-chat/node_modules/.bin/prebuild-install +78 -0
  24. package/dist/web-chat/node_modules/.bin/rc +4 -0
  25. package/dist/web-chat/node_modules/.bin/rollup +1912 -0
  26. package/dist/web-chat/node_modules/.bin/semver +174 -0
  27. package/dist/web-chat/node_modules/.bin/tsc +2 -0
  28. package/dist/web-chat/node_modules/.bin/tsserver +2 -0
  29. package/dist/web-chat/node_modules/.bin/update-browserslist-db +42 -0
  30. package/dist/web-chat/node_modules/.bin/uuid +2 -0
  31. package/dist/web-chat/node_modules/.bin/uvu +35 -0
  32. package/dist/web-chat/node_modules/.bin/vite +61 -0
  33. package/dist/web-chat/node_modules/.package-lock.json +15371 -0
  34. package/dist/web-chat/node_modules/.vite/deps/_metadata.json +67 -0
  35. package/dist/web-chat/node_modules/.vite/deps/chunk-DC5AMYBS.js +39 -0
  36. package/dist/web-chat/node_modules/.vite/deps/chunk-DC5AMYBS.js.map +7 -0
  37. package/dist/web-chat/node_modules/.vite/deps/chunk-NUMECXU6.js +21628 -0
  38. package/dist/web-chat/node_modules/.vite/deps/chunk-NUMECXU6.js.map +7 -0
  39. package/dist/web-chat/node_modules/.vite/deps/chunk-RLJ2RCJQ.js +1906 -0
  40. package/dist/web-chat/node_modules/.vite/deps/chunk-RLJ2RCJQ.js.map +7 -0
  41. package/dist/web-chat/node_modules/.vite/deps/chunk-S725DACQ.js +928 -0
  42. package/dist/web-chat/node_modules/.vite/deps/chunk-S725DACQ.js.map +7 -0
  43. package/dist/web-chat/node_modules/.vite/deps/chunk-XJVUMEYI.js +8578 -0
  44. package/dist/web-chat/node_modules/.vite/deps/chunk-XJVUMEYI.js.map +7 -0
  45. package/dist/web-chat/node_modules/.vite/deps/package.json +3 -0
  46. package/dist/web-chat/node_modules/.vite/deps/react-dom.js +7 -0
  47. package/dist/web-chat/node_modules/.vite/deps/react-dom.js.map +7 -0
  48. package/dist/web-chat/node_modules/.vite/deps/react-dom_client.js +39 -0
  49. package/dist/web-chat/node_modules/.vite/deps/react-dom_client.js.map +7 -0
  50. package/dist/web-chat/node_modules/.vite/deps/react-markdown.js +8931 -0
  51. package/dist/web-chat/node_modules/.vite/deps/react-markdown.js.map +7 -0
  52. package/dist/web-chat/node_modules/.vite/deps/react.js +6 -0
  53. package/dist/web-chat/node_modules/.vite/deps/react.js.map +7 -0
  54. package/dist/web-chat/node_modules/.vite/deps/react_jsx-dev-runtime.js +913 -0
  55. package/dist/web-chat/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
  56. package/dist/web-chat/node_modules/.vite/deps/react_jsx-runtime.js +7 -0
  57. package/dist/web-chat/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
  58. package/dist/web-chat/node_modules/.vite/deps/remark-gfm.js +7403 -0
  59. package/dist/web-chat/node_modules/.vite/deps/remark-gfm.js.map +7 -0
  60. package/dist/web-chat/node_modules/@codemirror/autocomplete/.github/workflows/dispatch.yml +16 -0
  61. package/dist/web-chat/node_modules/@codemirror/commands/.github/workflows/dispatch.yml +16 -0
  62. package/dist/web-chat/node_modules/@codemirror/lang-cpp/.github/workflows/dispatch.yml +16 -0
  63. package/dist/web-chat/node_modules/@codemirror/lang-css/.github/workflows/dispatch.yml +16 -0
  64. package/dist/web-chat/node_modules/@codemirror/lang-go/.github/workflows/dispatch.yml +16 -0
  65. package/dist/web-chat/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml +16 -0
  66. package/dist/web-chat/node_modules/@codemirror/lang-java/.github/workflows/dispatch.yml +16 -0
  67. package/dist/web-chat/node_modules/@codemirror/lang-javascript/.github/workflows/dispatch.yml +16 -0
  68. package/dist/web-chat/node_modules/@codemirror/lang-json/.github/workflows/dispatch.yml +16 -0
  69. package/dist/web-chat/node_modules/@codemirror/lang-less/.github/workflows/dispatch.yml +16 -0
  70. package/dist/web-chat/node_modules/@codemirror/lang-markdown/.github/workflows/dispatch.yml +16 -0
  71. package/dist/web-chat/node_modules/@codemirror/lang-python/.github/workflows/dispatch.yml +16 -0
  72. package/dist/web-chat/node_modules/@codemirror/lang-rust/.github/workflows/dispatch.yml +16 -0
  73. package/dist/web-chat/node_modules/@codemirror/lang-sass/.github/workflows/dispatch.yml +16 -0
  74. package/dist/web-chat/node_modules/@codemirror/lang-sql/.github/workflows/dispatch.yml +16 -0
  75. package/dist/web-chat/node_modules/@codemirror/lang-wast/.github/workflows/dispatch.yml +16 -0
  76. package/dist/web-chat/node_modules/@codemirror/lang-xml/.github/workflows/dispatch.yml +16 -0
  77. package/dist/web-chat/node_modules/@codemirror/lang-yaml/.github/workflows/dispatch.yml +16 -0
  78. package/dist/web-chat/node_modules/@codemirror/language/.github/workflows/dispatch.yml +16 -0
  79. package/dist/web-chat/node_modules/@codemirror/language-data/.github/workflows/dispatch.yml +16 -0
  80. package/dist/web-chat/node_modules/@codemirror/legacy-modes/.github/workflows/dispatch.yml +16 -0
  81. package/dist/web-chat/node_modules/@codemirror/lint/.github/workflows/dispatch.yml +16 -0
  82. package/dist/web-chat/node_modules/@codemirror/search/.github/workflows/dispatch.yml +16 -0
  83. package/dist/web-chat/node_modules/@codemirror/state/.github/workflows/dispatch.yml +16 -0
  84. package/dist/web-chat/node_modules/@codemirror/theme-one-dark/.github/workflows/dispatch.yml +16 -0
  85. package/dist/web-chat/node_modules/@codemirror/view/.github/workflows/dispatch.yml +16 -0
  86. package/dist/web-chat/node_modules/@lezer/html/src/.tern-port +1 -0
  87. package/dist/web-chat/node_modules/@lezer/php/.tern-port +1 -0
  88. package/dist/web-chat/node_modules/@lezer/php/test/.tern-port +1 -0
  89. package/dist/web-chat/node_modules/@lezer/sass/src/.tern-port +1 -0
  90. package/dist/web-chat/node_modules/@lezer/yaml/.tern-port +1 -0
  91. package/dist/web-chat/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml +31 -0
  92. package/dist/web-chat/node_modules/bl/.travis.yml +17 -0
  93. package/dist/web-chat/node_modules/clean-set/.prettierrc +4 -0
  94. package/dist/web-chat/node_modules/clean-set/.travis.yml +7 -0
  95. package/dist/web-chat/node_modules/codemirror/.github/workflows/dispatch.yml +16 -0
  96. package/dist/web-chat/node_modules/entities/src/generated/.eslintrc.json +10 -0
  97. package/dist/web-chat/node_modules/es5-ext/promise/.eslintrc.json +1 -0
  98. package/dist/web-chat/node_modules/es6-iterator/.editorconfig +14 -0
  99. package/dist/web-chat/node_modules/es6-iterator/test/.eslintrc.json +5 -0
  100. package/dist/web-chat/node_modules/es6-symbol/.testignore +1 -0
  101. package/dist/web-chat/node_modules/escape-carriage/.github/workflows/node.js.yml +19 -0
  102. package/dist/web-chat/node_modules/esniff/.prettierignore +2 -0
  103. package/dist/web-chat/node_modules/esniff/.testignore +3 -0
  104. package/dist/web-chat/node_modules/event-emitter/.lint +15 -0
  105. package/dist/web-chat/node_modules/event-emitter/.testignore +1 -0
  106. package/dist/web-chat/node_modules/event-emitter/.travis.yml +16 -0
  107. package/dist/web-chat/node_modules/expand-template/.travis.yml +6 -0
  108. package/dist/web-chat/node_modules/extend/.editorconfig +20 -0
  109. package/dist/web-chat/node_modules/extend/.eslintrc +17 -0
  110. package/dist/web-chat/node_modules/extend/.jscs.json +175 -0
  111. package/dist/web-chat/node_modules/extend/.travis.yml +230 -0
  112. package/dist/web-chat/node_modules/gensync/test/.babelrc +5 -0
  113. package/dist/web-chat/node_modules/github-from-package/.travis.yml +4 -0
  114. package/dist/web-chat/node_modules/intersection-observer/.eslintrc +45 -0
  115. package/dist/web-chat/node_modules/lib0/.github/workflows/node.js.yml +24 -0
  116. package/dist/web-chat/node_modules/lib0/.jsdoc.json +18 -0
  117. package/dist/web-chat/node_modules/lib0/.vscode/launch.json +17 -0
  118. package/dist/web-chat/node_modules/minimist/.eslintrc +29 -0
  119. package/dist/web-chat/node_modules/minimist/.github/FUNDING.yml +12 -0
  120. package/dist/web-chat/node_modules/minimist/.nycrc +14 -0
  121. package/dist/web-chat/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +31 -0
  122. package/dist/web-chat/node_modules/next-tick/.editorconfig +16 -0
  123. package/dist/web-chat/node_modules/next-tick/.github/FUNDING.yml +1 -0
  124. package/dist/web-chat/node_modules/next-tick/.lint +16 -0
  125. package/dist/web-chat/node_modules/node-abi/node_modules/.bin/semver +191 -0
  126. package/dist/web-chat/node_modules/pump/.github/FUNDING.yml +2 -0
  127. package/dist/web-chat/node_modules/pump/.travis.yml +5 -0
  128. package/dist/web-chat/node_modules/simple-concat/.travis.yml +3 -0
  129. package/dist/web-chat/node_modules/simple-get/.github/dependabot.yml +15 -0
  130. package/dist/web-chat/node_modules/simple-get/.github/workflows/ci.yml +23 -0
  131. package/dist/web-chat/node_modules/tar-fs/.travis.yml +6 -0
  132. package/dist/web-chat/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
  133. package/dist/web-chat/node_modules/w3c-keyname/.tern-port +1 -0
  134. package/dist/web-chat/style.css +1882 -0
  135. package/package.json +4 -2
@@ -0,0 +1,324 @@
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>Jai1 • Web Chat</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>⚡</text></svg>">
9
+ <!-- Prevent flash of wrong theme -->
10
+ <script>
11
+ (function() {
12
+ try {
13
+ const saved = localStorage.getItem('wc_theme');
14
+ const theme = saved ? JSON.parse(saved) : null;
15
+ if (theme) {
16
+ document.documentElement.setAttribute('data-theme', theme);
17
+ } else if (window.matchMedia('(prefers-color-scheme: light)').matches) {
18
+ document.documentElement.setAttribute('data-theme', 'light');
19
+ }
20
+ } catch (e) {}
21
+ })();
22
+ </script>
23
+ <!-- Typography: JetBrains Mono for code, Inter for readability -->
24
+ <link rel="preconnect" href="https://fonts.googleapis.com">
25
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
26
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
27
+ <!-- zero-md for markdown rendering -->
28
+ <script type="module" src="https://cdn.jsdelivr.net/npm/zero-md@3?register"></script>
29
+ </head>
30
+ <body>
31
+ <!-- Grain overlay for texture -->
32
+ <div class="grain-overlay" aria-hidden="true"></div>
33
+
34
+ <!-- Ambient background effects -->
35
+ <div class="ambient-bg" aria-hidden="true">
36
+ <div class="ambient-orb ambient-orb-1"></div>
37
+ <div class="ambient-orb ambient-orb-2"></div>
38
+ </div>
39
+
40
+ <div id="app">
41
+ <!-- Header -->
42
+ <header class="header">
43
+ <div class="header-left">
44
+ <div class="logo-container">
45
+ <span class="logo-icon">⚡</span>
46
+ <div class="logo-text">
47
+ <span class="logo-brand">JAI1</span>
48
+ <span class="logo-divider">/</span>
49
+ <span class="logo-product">chat</span>
50
+ </div>
51
+ </div>
52
+ <div class="connection-status" id="connection-status">
53
+ <span class="status-dot"></span>
54
+ <span class="status-text">connected</span>
55
+ </div>
56
+ </div>
57
+ <div class="header-right">
58
+ <button class="btn-theme-toggle" id="theme-toggle-btn" title="Toggle theme">
59
+ <svg class="icon-sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
60
+ <circle cx="12" cy="12" r="5"></circle>
61
+ <line x1="12" y1="1" x2="12" y2="3"></line>
62
+ <line x1="12" y1="21" x2="12" y2="23"></line>
63
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
64
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
65
+ <line x1="1" y1="12" x2="3" y2="12"></line>
66
+ <line x1="21" y1="12" x2="23" y2="12"></line>
67
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
68
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
69
+ </svg>
70
+ <svg class="icon-moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
71
+ <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
72
+ </svg>
73
+ </button>
74
+ <button class="btn-icon" id="toggle-right-sidebar-btn" title="Toggle Stats Panel">
75
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
76
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
77
+ <line x1="15" y1="3" x2="15" y2="21"></line>
78
+ </svg>
79
+ </button>
80
+
81
+ </div>
82
+ </header>
83
+
84
+ <!-- Main Content -->
85
+ <main class="main">
86
+ <!-- Left Sidebar - Threads -->
87
+ <aside class="sidebar sidebar-left" id="sidebar">
88
+ <div class="sidebar-header">
89
+ <button id="new-chat-btn" class="btn btn-new-chat">
90
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
91
+ <line x1="12" y1="5" x2="12" y2="19"></line>
92
+ <line x1="5" y1="12" x2="19" y2="12"></line>
93
+ </svg>
94
+ <span>New Thread</span>
95
+ <kbd class="shortcut">⌘N</kbd>
96
+ </button>
97
+ </div>
98
+ <div class="sidebar-section">
99
+ <div class="sidebar-section-title">
100
+ <span class="section-icon">◈</span>
101
+ <span>Threads</span>
102
+ </div>
103
+ <div class="conversations-list" id="conversations-list">
104
+ <!-- Conversations will be rendered here -->
105
+ </div>
106
+ </div>
107
+ <div class="sidebar-footer">
108
+ <div class="session-info">
109
+ <span class="session-icon">◉</span>
110
+ <span class="session-text">Session active</span>
111
+ </div>
112
+ </div>
113
+ </aside>
114
+
115
+ <!-- Chat Area -->
116
+ <section class="chat-area">
117
+ <div class="messages-container">
118
+ <div class="messages" id="messages">
119
+ <!-- Welcome message -->
120
+ <div class="welcome-message" id="welcome-message">
121
+ <div class="welcome-content">
122
+ <div class="welcome-glyph">
123
+ <span class="glyph-main">⚡</span>
124
+ <div class="glyph-ring"></div>
125
+ </div>
126
+ <h1 class="welcome-title">
127
+ <span class="title-prefix">~/</span>jai1 chat
128
+ </h1>
129
+ <p class="welcome-subtitle">Your AI-powered development companion</p>
130
+
131
+ <div class="welcome-features">
132
+ <div class="feature-card">
133
+ <div class="feature-icon">→</div>
134
+ <div class="feature-content">
135
+ <div class="feature-title">Code Generation</div>
136
+ <div class="feature-desc">Generate, refactor, and explain code</div>
137
+ </div>
138
+ </div>
139
+ <div class="feature-card">
140
+ <div class="feature-icon">→</div>
141
+ <div class="feature-content">
142
+ <div class="feature-title">Multi-Model</div>
143
+ <div class="feature-desc">Switch between Claude, GPT, Gemini</div>
144
+ </div>
145
+ </div>
146
+ <div class="feature-card">
147
+ <div class="feature-icon">→</div>
148
+ <div class="feature-content">
149
+ <div class="feature-title">Local Storage</div>
150
+ <div class="feature-desc">Conversations persist in your browser</div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+ <div class="welcome-hints">
156
+ <div class="hint">
157
+ <kbd>Enter</kbd>
158
+ <span>Send message</span>
159
+ </div>
160
+ <div class="hint">
161
+ <kbd>Shift + Enter</kbd>
162
+ <span>New line</span>
163
+ </div>
164
+ <div class="hint">
165
+ <kbd>⌘ + N</kbd>
166
+ <span>New thread</span>
167
+ </div>
168
+ </div>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ </div>
173
+
174
+ <!-- Input Area -->
175
+ <div class="input-area">
176
+ <!-- Model & Agent Selectors -->
177
+ <div class="input-selectors">
178
+ <div class="selector-group">
179
+ <label for="agent-select" class="selector-label">
180
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
181
+ <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
182
+ <circle cx="12" cy="7" r="4"></circle>
183
+ </svg>
184
+ <span>Agent:</span>
185
+ </label>
186
+ <select id="agent-select" class="selector-select">
187
+ <option value="default">⚡ General Assistant</option>
188
+ </select>
189
+ </div>
190
+ <div class="selector-divider"></div>
191
+ <div class="selector-group">
192
+ <label for="model-select" class="selector-label">
193
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
194
+ <circle cx="12" cy="12" r="10"></circle>
195
+ <path d="M12 6v6l4 2"></path>
196
+ </svg>
197
+ <span>Model:</span>
198
+ </label>
199
+ <select id="model-select" class="selector-select">
200
+ <option value="">loading...</option>
201
+ </select>
202
+ </div>
203
+ </div>
204
+ <div class="input-container">
205
+ <div class="input-prefix">
206
+ <span class="prefix-symbol">❯</span>
207
+ </div>
208
+ <textarea
209
+ id="message-input"
210
+ placeholder="Ask anything..."
211
+ rows="1"
212
+ autofocus
213
+ ></textarea>
214
+ <div class="input-actions">
215
+ <span id="char-count" class="char-count"></span>
216
+ <button id="send-btn" class="btn-send" disabled title="Send message">
217
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
218
+ <line x1="5" y1="12" x2="19" y2="12"></line>
219
+ <polyline points="12 5 19 12 12 19"></polyline>
220
+ </svg>
221
+ </button>
222
+ </div>
223
+ </div>
224
+ <div class="input-footer">
225
+ <span class="footer-hint">Jai1 can make mistakes. Verify important information.</span>
226
+ </div>
227
+ </div>
228
+ </section>
229
+
230
+ <!-- Right Sidebar - Stats & Utilities -->
231
+ <aside class="sidebar sidebar-right" id="sidebar-right">
232
+ <div class="sidebar-section">
233
+ <div class="sidebar-section-title">
234
+ <span class="section-icon">📊</span>
235
+ <span>Model Usage</span>
236
+ <button id="refresh-stats-btn" class="btn-icon-small" title="Refresh stats">
237
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
238
+ <path d="M23 4v6h-6"></path>
239
+ <path d="M1 20v-6h6"></path>
240
+ <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>
241
+ </svg>
242
+ </button>
243
+ </div>
244
+ <div class="stats-date" id="stats-date">Today</div>
245
+ <div class="stats-list" id="stats-list">
246
+ <div class="stats-loading">
247
+ <span class="stats-loading-icon">◌</span>
248
+ <span>Loading stats...</span>
249
+ </div>
250
+ </div>
251
+ </div>
252
+
253
+ <div class="sidebar-section">
254
+ <div class="sidebar-section-title">
255
+ <span class="section-icon">📝</span>
256
+ <span>Quick Prompts</span>
257
+ </div>
258
+ <div class="prompts-list" id="prompts-list">
259
+ <button class="prompt-item" data-prompt="Explain this code:">
260
+ <span class="prompt-icon">→</span>
261
+ <span>Explain code</span>
262
+ </button>
263
+ <button class="prompt-item" data-prompt="Refactor this to be more efficient:">
264
+ <span class="prompt-icon">→</span>
265
+ <span>Refactor code</span>
266
+ </button>
267
+ <button class="prompt-item" data-prompt="Write tests for this:">
268
+ <span class="prompt-icon">→</span>
269
+ <span>Write tests</span>
270
+ </button>
271
+ <button class="prompt-item" data-prompt="Fix the bug in this code:">
272
+ <span class="prompt-icon">→</span>
273
+ <span>Fix bug</span>
274
+ </button>
275
+ <button class="prompt-item" data-prompt="Add comments to explain:">
276
+ <span class="prompt-icon">→</span>
277
+ <span>Add comments</span>
278
+ </button>
279
+ </div>
280
+ </div>
281
+
282
+ <div class="sidebar-footer">
283
+ <div class="stats-info">
284
+ <span class="stats-info-text">Stats update on chat success</span>
285
+ </div>
286
+ </div>
287
+ </aside>
288
+ </main>
289
+
290
+ <!-- Error Modal -->
291
+ <div id="error-modal" class="modal hidden">
292
+ <div class="modal-backdrop"></div>
293
+ <div class="modal-content">
294
+ <div class="modal-icon">
295
+ <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
296
+ <circle cx="12" cy="12" r="10"></circle>
297
+ <line x1="12" y1="8" x2="12" y2="12"></line>
298
+ <line x1="12" y1="16" x2="12.01" y2="16"></line>
299
+ </svg>
300
+ </div>
301
+ <h3 id="error-title" class="modal-title">Session Expired</h3>
302
+ <p id="error-message" class="modal-message">Please run 'jai1 chat --web' again to start a new session.</p>
303
+ <div class="modal-actions">
304
+ <button id="error-close-btn" class="btn btn-primary">Understood</button>
305
+ </div>
306
+ </div>
307
+ </div>
308
+
309
+ <!-- Loading Overlay -->
310
+ <div id="loading-overlay" class="loading-overlay">
311
+ <div class="loading-content">
312
+ <div class="loading-spinner">
313
+ <div class="spinner-ring"></div>
314
+ <div class="spinner-core">⚡</div>
315
+ </div>
316
+ <p class="loading-text">Initializing<span class="loading-dots"></span></p>
317
+ </div>
318
+ </div>
319
+ </div>
320
+
321
+
322
+ <script src="app.js"></script>
323
+ </body>
324
+ </html>
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import * as ecdsa from 'lib0/crypto/ecdsa'
3
+ import * as json from 'lib0/json'
4
+ import * as env from 'lib0/environment'
5
+
6
+ const prefix = env.getConf('name')
7
+
8
+ const keypair = await ecdsa.generateKeyPair({ extractable: true })
9
+ const privateJwk = json.stringify(await ecdsa.exportKeyJwk(keypair.privateKey))
10
+ const publicJwk = json.stringify(await ecdsa.exportKeyJwk(keypair.publicKey))
11
+
12
+ console.log(`
13
+ ${prefix ? prefix.toUpperCase() + '_' : ''}PUBLIC_KEY=${publicJwk}
14
+ ${prefix ? prefix.toUpperCase() + '_' : ''}PRIVATE_KEY=${privateJwk}
15
+ `)
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ import * as fs from 'fs'
3
+ import * as object from '../object.js'
4
+ import * as env from '../environment.js'
5
+
6
+ const script = env.getParam('--script', './test.js')
7
+ const includeDeps = env.getParam('--include-dependencies', '').split(',').filter(d => d.length)
8
+ const customImportsPath = env.getParam('--custom-imports', '')
9
+
10
+ /**
11
+ * @type {Object<string,string>}
12
+ */
13
+ const exports = {}
14
+ /**
15
+ * @type {Object<string,Object<string,string>>}
16
+ */
17
+ const scopes = {}
18
+
19
+ /**
20
+ * @param {any} v
21
+ * @param {string} k
22
+ * @param {string} pkgName
23
+ * @param {string} pathPrefix
24
+ * @param {Object<string,string>} importMap
25
+ */
26
+ const extractModMap = (v, k, pkgName, pathPrefix, importMap) => {
27
+ if (k[0] !== '.') return
28
+ if (typeof v === 'object') {
29
+ extractModMap(v.browser || v.import || v.module || v.default, k, pkgName, pathPrefix, importMap)
30
+ } else if (v && v[0] === '.') {
31
+ importMap[pkgName + k.slice(1)] = pathPrefix + v.slice(1)
32
+ }
33
+ }
34
+
35
+ /**
36
+ * @param {string} s
37
+ */
38
+ const _maybeAddRelPrefix = s => (s[0] !== '.' ? './' : '') + s
39
+
40
+ /**
41
+ * @param {any} pkgJson
42
+ * @param {string} pathPrefix
43
+ * @param {Object<string,string>} importMap
44
+ */
45
+ const readPkg = (pkgJson, pathPrefix, importMap) => {
46
+ if (pkgJson.exports == null && pkgJson.main != null) {
47
+ importMap[pkgJson.name] = pathPrefix + _maybeAddRelPrefix(pkgJson.main).slice(1)
48
+ }
49
+ object.forEach(pkgJson.exports, (v, k) => extractModMap(v, k, pkgJson.name, pathPrefix, importMap))
50
+ object.forEach(pkgJson.dependencies, (_v, depName) => {
51
+ const nextImportMap = pathPrefix === '.' ? exports : (scopes[pathPrefix + '/'] || (scopes[pathPrefix + '/'] = {}))
52
+ const prefix = `./node_modules/${depName}`
53
+ const depPkgJson = JSON.parse(fs.readFileSync(prefix + '/package.json', { encoding: 'utf8' }))
54
+ readPkg(depPkgJson, prefix, nextImportMap)
55
+ })
56
+ }
57
+
58
+ const rootPkgJson = JSON.parse(fs.readFileSync('./package.json', { encoding: 'utf8' }))
59
+ readPkg(rootPkgJson, '.', exports)
60
+ includeDeps.forEach(depName => {
61
+ const prefix = `./node_modules/${depName}`
62
+ const depPkgJson = JSON.parse(fs.readFileSync(`${prefix}/package.json`, { encoding: 'utf8' }))
63
+ readPkg(depPkgJson, prefix, exports)
64
+ })
65
+
66
+ const customImports = {}
67
+ if (customImportsPath !== '') {
68
+ object.assign(customImports, JSON.parse(fs.readFileSync(customImportsPath, { encoding: 'utf8' })))
69
+ }
70
+
71
+ const testHtml = `
72
+ <!DOCTYPE html>
73
+ <html>
74
+ <head>
75
+ <title>Testing ${rootPkgJson.name}</title>
76
+ <script type="importmap">
77
+ {
78
+ "imports": ${JSON.stringify(object.assign({}, exports, customImports), null, 2)},
79
+ "scopes": ${JSON.stringify(scopes, null, 2)}
80
+ }
81
+ </script>
82
+ </head>
83
+ <body>
84
+ <script type="module" src="${script}"></script>
85
+ </body>
86
+ </html>
87
+ `
88
+
89
+ console.log(testHtml)
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Simple http server implementation.
5
+ * Optionally, you may set `DEBUG_BROWSER` environment variable to use a different browser to debug
6
+ * web apps.
7
+ */
8
+
9
+ import * as http from 'http'
10
+ import * as path from 'path'
11
+ import * as fs from 'fs'
12
+ import * as env from '../environment.js'
13
+ import * as number from '../number.js'
14
+ import * as logging from 'lib0/logging'
15
+
16
+ const host = env.getParam('--host', 'localhost')
17
+ const port = number.parseInt(env.getParam('--port', '8000'))
18
+ const paramOpenFile = env.getParam('-o', '')
19
+ const debugBrowser = env.getConf('DEBUG_BROWSER')
20
+
21
+ /**
22
+ * @type {Object<string,string>}
23
+ */
24
+ const types = {
25
+ html: 'text/html',
26
+ css: 'text/css',
27
+ js: 'application/javascript',
28
+ mjs: 'application/javascript',
29
+ png: 'image/png',
30
+ jpg: 'image/jpeg',
31
+ jpeg: 'image/jpeg',
32
+ gif: 'image/gif',
33
+ json: 'application/json',
34
+ xml: 'application/xml',
35
+ wasm: 'application/wasm'
36
+ }
37
+
38
+ const root = path.normalize(path.resolve('./'))
39
+
40
+ const server = http.createServer((req, res) => {
41
+ const url = (req.url || '/index.html').split('?')[0]
42
+ logging.print(logging.ORANGE, logging.BOLD, req.method || '', ' ', logging.GREY, logging.UNBOLD, url)
43
+ const extension = path.extname(url).slice(1)
44
+ /**
45
+ * @type {string}
46
+ */
47
+ const type = (extension && types[extension]) || types.html
48
+ const supportedExtension = Boolean(type)
49
+ if (!supportedExtension) {
50
+ res.writeHead(404, { 'Content-Type': 'text/html' })
51
+ res.end('404: File not found')
52
+ return
53
+ }
54
+ let fileName = url
55
+ if (url === '/') fileName = 'index.html'
56
+ else if (!extension) {
57
+ try {
58
+ fs.accessSync(path.join(root, url + '.html'), fs.constants.F_OK)
59
+ fileName = url + '.html'
60
+ } catch (e) {
61
+ fileName = path.join(url, 'index.html')
62
+ }
63
+ }
64
+
65
+ const filePath = path.join(root, fileName)
66
+ const isPathUnderRoot = path
67
+ .normalize(path.resolve(filePath))
68
+ .startsWith(root)
69
+
70
+ if (!isPathUnderRoot) {
71
+ res.writeHead(404, { 'Content-Type': 'text/html' })
72
+ res.end('404: File not found')
73
+ logging.print(logging.RED, logging.BOLD, 'Not Found: ', logging.GREY, logging.UNBOLD, url)
74
+ return
75
+ }
76
+
77
+ fs.readFile(filePath, (err, data) => {
78
+ if (err) {
79
+ logging.print(logging.RED, logging.BOLD, 'Cannot read file: ', logging.GREY, logging.UNBOLD, url)
80
+ res.writeHead(404, { 'Content-Type': 'text/html' })
81
+ res.end('404: File not found')
82
+ } else {
83
+ res.writeHead(200, { 'Content-Type': type })
84
+ res.end(data)
85
+ }
86
+ })
87
+ })
88
+
89
+ server.listen(port, host, () => {
90
+ logging.print(logging.BOLD, logging.ORANGE, `Server is running on http://${host}:${port}`)
91
+ if (paramOpenFile) {
92
+ const start = debugBrowser || (process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open')
93
+ import('child_process').then(cp => {
94
+ cp.exec(`${start} http://${host}:${port}/${paramOpenFile}`)
95
+ })
96
+ }
97
+ })
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ "use strict"
3
+
4
+ require("../dist/bin.js")
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ let mode = process.argv[2]
4
+ if (mode === '--info') {
5
+ process.stdout.write(require('../')().info() + '\n')
6
+ } else if (mode === '--version') {
7
+ process.stdout.write(
8
+ 'autoprefixer ' + require('../package.json').version + '\n'
9
+ )
10
+ } else {
11
+ process.stdout.write(
12
+ 'autoprefix\n' +
13
+ '\n' +
14
+ 'Options:\n' +
15
+ ' --info Show target browsers and used prefixes\n' +
16
+ ' --version Show version number\n' +
17
+ ' --help Show help\n' +
18
+ '\n' +
19
+ 'Usage:\n' +
20
+ ' autoprefixer --info\n'
21
+ )
22
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{parseArgs as e}from"node:util";import{exit as s}from"node:process";import{getCompatibleVersions as a}from"./index.js";const r=process.argv.slice(2),{values:n}=e({args:r,options:{"target-year":{type:"string"},"widely-available-on-date":{type:"string"},"include-downstream-browsers":{type:"boolean"},"list-all-compatible-versions":{type:"boolean"},"include-kaios":{type:"boolean"},"suppress-warnings":{type:"boolean"},"override-last-updated":{type:"string"},help:{type:"boolean",short:"h"}},strict:!0});n.help&&(console.log("\nGet Baseline Widely available browser versions or Baseline year browser versions.\n\nUsage: baseline-browser-mapping [options]\n\nOptions:\n --target-year Pass a year between 2015 and the current year to get browser versions compatible \n with all Newly Available features as of the end of the year specified.\n --widely-available-on-date Pass a date in the format 'YYYY-MM-DD' to get versions compatible with Widely \n available on the specified date.\n --include-downstream-browsers Whether to include browsers that use the same engines as a core Baseline browser.\n --include-kaios Whether to include KaiOS in downstream browsers. Requires --include-downstream-browsers.\n --list-all-compatible-versions Whether to include only the minimum compatible browser versions or all compatible versions.\n --suppress-warnings Supress potential warnings about data staleness when using a very recent feature cut off date.\n --override-last-updated Override the last updated date for the baseline data for debugging purposes.\n -h, --help Show help\n\nExamples:\n npx baseline-browser-mapping --target-year 2020\n npx baseline-browser-mapping --widely-available-on-date 2023-04-05\n npx baseline-browser-mapping --include-downstream-browsers\n npx baseline-browser-mapping --list-all-compatible-versions\n".trim()),s(0)),console.log(a({targetYear:n["target-year"]?Number.parseInt(n["target-year"]):void 0,widelyAvailableOnDate:n["widely-available-on-date"],includeDownstreamBrowsers:n["include-downstream-browsers"],listAllCompatibleVersions:n["list-all-compatible-versions"],includeKaiOS:n["include-kaios"],suppressWarnings:n["suppress-warnings"],overrideLastUpdated:n["override-last-updated"]?Number.parseInt(n["override-last-updated"]):void 0}));