@autocode-cli/autocode 0.1.33 → 0.1.35

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 (32) hide show
  1. package/dist/server/dashboard/pages/index.d.ts +3 -0
  2. package/dist/server/dashboard/pages/index.d.ts.map +1 -1
  3. package/dist/server/dashboard/pages/index.js +3 -0
  4. package/dist/server/dashboard/pages/index.js.map +1 -1
  5. package/dist/server/dashboard/pages/issue-comments.d.ts +8 -0
  6. package/dist/server/dashboard/pages/issue-comments.d.ts.map +1 -0
  7. package/dist/server/dashboard/pages/issue-comments.js +283 -0
  8. package/dist/server/dashboard/pages/issue-comments.js.map +1 -0
  9. package/dist/server/dashboard/pages/issue-history.d.ts +8 -0
  10. package/dist/server/dashboard/pages/issue-history.d.ts.map +1 -0
  11. package/dist/server/dashboard/pages/issue-history.js +149 -0
  12. package/dist/server/dashboard/pages/issue-history.js.map +1 -0
  13. package/dist/server/dashboard/pages/issue-shared.d.ts +27 -0
  14. package/dist/server/dashboard/pages/issue-shared.d.ts.map +1 -0
  15. package/dist/server/dashboard/pages/issue-shared.js +365 -0
  16. package/dist/server/dashboard/pages/issue-shared.js.map +1 -0
  17. package/dist/server/dashboard/pages/issue-terminal.d.ts +8 -0
  18. package/dist/server/dashboard/pages/issue-terminal.d.ts.map +1 -0
  19. package/dist/server/dashboard/pages/issue-terminal.js +363 -0
  20. package/dist/server/dashboard/pages/issue-terminal.js.map +1 -0
  21. package/dist/server/dashboard/pages/issue-view.d.ts +2 -2
  22. package/dist/server/dashboard/pages/issue-view.d.ts.map +1 -1
  23. package/dist/server/dashboard/pages/issue-view.js +49 -1027
  24. package/dist/server/dashboard/pages/issue-view.js.map +1 -1
  25. package/dist/server/dashboard.d.ts +1 -1
  26. package/dist/server/dashboard.d.ts.map +1 -1
  27. package/dist/server/dashboard.js +1 -1
  28. package/dist/server/dashboard.js.map +1 -1
  29. package/dist/server/index.d.ts.map +1 -1
  30. package/dist/server/index.js +35 -5
  31. package/dist/server/index.js.map +1 -1
  32. package/package.json +4 -1
@@ -0,0 +1,365 @@
1
+ /**
2
+ * Shared components for issue pages
3
+ */
4
+ import { escapeHtml } from '../utils.js';
5
+ /**
6
+ * Generate the base CSS styles shared across all issue pages
7
+ */
8
+ export function generateIssueBaseStyles() {
9
+ return `
10
+ :root {
11
+ --bg: #0a0a0f;
12
+ --bg-secondary: #12121a;
13
+ --bg-tertiary: #1a1a24;
14
+ --text: #f1f5f9;
15
+ --muted: #94a3b8;
16
+ --border: #2a2a3a;
17
+ --accent: #6366f1;
18
+ --blue: #4dabf7;
19
+ --green: #4ade80;
20
+ --yellow: #facc15;
21
+ --orange: #fb923c;
22
+ --red: #f87171;
23
+ --purple: #a78bfa;
24
+ }
25
+ * { margin: 0; padding: 0; box-sizing: border-box; }
26
+ body {
27
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
28
+ background: var(--bg);
29
+ color: var(--text);
30
+ min-height: 100vh;
31
+ }
32
+ .header {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 24px;
36
+ padding: 16px 24px;
37
+ background: var(--bg-secondary);
38
+ border-bottom: 1px solid var(--border);
39
+ position: sticky;
40
+ top: 0;
41
+ z-index: 100;
42
+ }
43
+ .back-btn {
44
+ color: var(--muted);
45
+ text-decoration: none;
46
+ font-size: 14px;
47
+ display: flex;
48
+ align-items: center;
49
+ gap: 8px;
50
+ }
51
+ .back-btn:hover { color: var(--text); }
52
+ .issue-header-info {
53
+ flex: 1;
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 16px;
57
+ }
58
+ .issue-key {
59
+ font-family: 'SF Mono', Monaco, monospace;
60
+ font-size: 12px;
61
+ color: var(--accent);
62
+ background: rgba(99, 102, 241, 0.15);
63
+ padding: 4px 10px;
64
+ border-radius: 4px;
65
+ font-weight: 600;
66
+ }
67
+ .issue-title {
68
+ font-size: 18px;
69
+ font-weight: 600;
70
+ color: var(--text);
71
+ overflow: hidden;
72
+ text-overflow: ellipsis;
73
+ white-space: nowrap;
74
+ }
75
+ .lang-selector {
76
+ display: flex;
77
+ gap: 4px;
78
+ }
79
+ .lang-btn {
80
+ background: transparent;
81
+ border: 1px solid var(--border);
82
+ color: var(--muted);
83
+ padding: 6px 12px;
84
+ border-radius: 4px;
85
+ cursor: pointer;
86
+ font-size: 12px;
87
+ font-weight: 500;
88
+ }
89
+ .lang-btn:hover { border-color: var(--accent); color: var(--text); }
90
+ .lang-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
91
+
92
+ /* Tabs navigation */
93
+ .tabs-nav {
94
+ display: flex;
95
+ gap: 0;
96
+ padding: 0 24px;
97
+ background: var(--bg-secondary);
98
+ border-bottom: 1px solid var(--border);
99
+ }
100
+ .tab-link {
101
+ padding: 12px 20px;
102
+ color: var(--muted);
103
+ text-decoration: none;
104
+ font-size: 14px;
105
+ font-weight: 500;
106
+ border-bottom: 2px solid transparent;
107
+ transition: all 0.2s;
108
+ display: flex;
109
+ align-items: center;
110
+ gap: 8px;
111
+ }
112
+ .tab-link:hover {
113
+ color: var(--text);
114
+ background: var(--bg-tertiary);
115
+ }
116
+ .tab-link.active {
117
+ color: var(--accent);
118
+ border-bottom-color: var(--accent);
119
+ }
120
+ .tab-badge {
121
+ font-size: 11px;
122
+ padding: 2px 8px;
123
+ border-radius: 10px;
124
+ background: var(--bg-tertiary);
125
+ color: var(--muted);
126
+ }
127
+ .tab-link.active .tab-badge {
128
+ background: rgba(99, 102, 241, 0.2);
129
+ color: var(--accent);
130
+ }
131
+
132
+ .main-content {
133
+ padding: 24px 48px;
134
+ }
135
+ .section {
136
+ background: var(--bg-secondary);
137
+ border: 1px solid var(--border);
138
+ border-radius: 12px;
139
+ padding: 20px;
140
+ }
141
+ .section-title {
142
+ font-size: 12px;
143
+ font-weight: 600;
144
+ text-transform: uppercase;
145
+ letter-spacing: 0.5px;
146
+ color: var(--muted);
147
+ margin-bottom: 16px;
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: space-between;
151
+ }
152
+ .notification {
153
+ position: fixed;
154
+ bottom: 24px;
155
+ right: 24px;
156
+ padding: 12px 20px;
157
+ background: var(--green);
158
+ color: #000;
159
+ border-radius: 8px;
160
+ font-weight: 500;
161
+ transform: translateY(100px);
162
+ opacity: 0;
163
+ transition: all 0.3s ease;
164
+ z-index: 1000;
165
+ }
166
+ .notification.show { transform: translateY(0); opacity: 1; }
167
+ .notification.error { background: var(--red); color: white; }
168
+ `;
169
+ }
170
+ /**
171
+ * Generate the tabs navigation HTML
172
+ */
173
+ export function generateTabsNav(issueKey, activeTab, data) {
174
+ const tabs = [
175
+ { id: 'details', path: `/issue/${issueKey}`, labelKey: 'tabs.details' },
176
+ { id: 'comments', path: `/issue/${issueKey}/comments`, labelKey: 'tabs.comments', badge: data.commentsCount },
177
+ { id: 'history', path: `/issue/${issueKey}/history`, labelKey: 'tabs.history', badge: data.historyCount },
178
+ { id: 'terminal', path: `/issue/${issueKey}/terminal`, labelKey: 'tabs.terminal' },
179
+ ];
180
+ return `
181
+ <nav class="tabs-nav">
182
+ ${tabs.map(tab => {
183
+ const isActive = tab.id === activeTab;
184
+ const badgeHtml = tab.badge !== undefined ? `<span class="tab-badge">${tab.badge}</span>` : '';
185
+ return `<a href="${tab.path}" class="tab-link${isActive ? ' active' : ''}" data-i18n="${tab.labelKey}">${badgeHtml}</a>`;
186
+ }).join('')}
187
+ </nav>
188
+ `;
189
+ }
190
+ /**
191
+ * Generate the header HTML
192
+ */
193
+ export function generateIssueHeader(issueKey, title) {
194
+ return `
195
+ <header class="header">
196
+ <a href="/" class="back-btn">← Dashboard</a>
197
+ <div class="issue-header-info">
198
+ <span class="issue-key">${escapeHtml(issueKey)}</span>
199
+ <span class="issue-title">${escapeHtml(title)}</span>
200
+ </div>
201
+ <div class="lang-selector" id="lang-selector">
202
+ <button class="lang-btn" data-lang="en">EN</button>
203
+ <button class="lang-btn" data-lang="fr">FR</button>
204
+ </div>
205
+ </header>
206
+ `;
207
+ }
208
+ /**
209
+ * Generate the shared JavaScript for i18n and notifications
210
+ */
211
+ export function generateIssueBaseScript(issueKey) {
212
+ return `
213
+ const ISSUE_KEY = '${issueKey}';
214
+ const STORAGE_KEY = 'autocode-lang';
215
+ let currentLang = localStorage.getItem(STORAGE_KEY) || 'fr';
216
+
217
+ const translations = {
218
+ en: {
219
+ 'tabs.details': 'Details',
220
+ 'tabs.comments': 'Comments',
221
+ 'tabs.history': 'History',
222
+ 'tabs.terminal': 'Terminal',
223
+ 'issueView.meta': 'Meta',
224
+ 'issueView.labels': 'Labels',
225
+ 'issueView.description': 'Description',
226
+ 'issueView.criteria': 'Acceptance Criteria',
227
+ 'issueView.history': 'History',
228
+ 'issueView.actions': 'Actions',
229
+ 'issueView.save': 'Save',
230
+ 'issueView.moveNext': 'Move to next column',
231
+ 'issueView.archive': 'Archive',
232
+ 'issueView.confirmMove': 'Move this issue to the next column?',
233
+ 'issueView.confirmArchive': 'Archive this issue?',
234
+ 'issueView.comments': 'Comments',
235
+ 'issueView.addComment': 'Add a comment...',
236
+ 'issueView.noComments': 'No comments yet',
237
+ 'issueView.claudeTerminal': 'Claude Terminal',
238
+ 'issueView.noDescription': 'No description',
239
+ 'issueView.noLog': 'No log yet. Waiting for Claude processing...',
240
+ 'issueView.loadingPrompt': 'Loading prompt...',
241
+ 'issueView.promptError': 'Error',
242
+ 'btn.add': 'Add',
243
+ 'btn.sending': 'Sending...',
244
+ 'btn.saving': 'Saving...',
245
+ 'status.waiting': 'Waiting',
246
+ 'status.processing': 'Processing...',
247
+ 'status.completed': 'Completed',
248
+ 'status.failed': 'Failed',
249
+ 'notify.commentAdded': 'Comment added',
250
+ 'notify.issueAdvanced': 'Issue advanced',
251
+ 'notify.issueArchived': 'Issue archived',
252
+ 'notify.issueSaved': 'Issue saved',
253
+ 'notify.error': 'Error'
254
+ },
255
+ fr: {
256
+ 'tabs.details': 'Détails',
257
+ 'tabs.comments': 'Commentaires',
258
+ 'tabs.history': 'Historique',
259
+ 'tabs.terminal': 'Terminal',
260
+ 'issueView.meta': 'Méta',
261
+ 'issueView.labels': 'Labels',
262
+ 'issueView.description': 'Description',
263
+ 'issueView.criteria': 'Critères d\\'acceptation',
264
+ 'issueView.history': 'Historique',
265
+ 'issueView.actions': 'Actions',
266
+ 'issueView.save': 'Sauvegarder',
267
+ 'issueView.moveNext': 'Déplacer vers la colonne suivante',
268
+ 'issueView.archive': 'Archiver',
269
+ 'issueView.confirmMove': 'Déplacer ce ticket vers la colonne suivante ?',
270
+ 'issueView.confirmArchive': 'Archiver ce ticket ?',
271
+ 'issueView.comments': 'Commentaires',
272
+ 'issueView.addComment': 'Ajouter un commentaire...',
273
+ 'issueView.noComments': 'Aucun commentaire',
274
+ 'issueView.claudeTerminal': 'Terminal Claude',
275
+ 'issueView.noDescription': 'Aucune description',
276
+ 'issueView.noLog': 'Aucun log. En attente du traitement Claude...',
277
+ 'issueView.loadingPrompt': 'Chargement du prompt...',
278
+ 'issueView.promptError': 'Erreur',
279
+ 'btn.add': 'Ajouter',
280
+ 'btn.sending': 'Envoi...',
281
+ 'btn.saving': 'Sauvegarde...',
282
+ 'status.waiting': 'En attente',
283
+ 'status.processing': 'En cours...',
284
+ 'status.completed': 'Terminé',
285
+ 'status.failed': 'Échec',
286
+ 'notify.commentAdded': 'Commentaire ajouté',
287
+ 'notify.issueAdvanced': 'Ticket avancé',
288
+ 'notify.issueArchived': 'Ticket archivé',
289
+ 'notify.issueSaved': 'Ticket sauvegardé',
290
+ 'notify.error': 'Erreur'
291
+ }
292
+ };
293
+
294
+ function t(key) {
295
+ return translations[currentLang]?.[key] || translations['en'][key] || key;
296
+ }
297
+
298
+ function escapeHtml(text) {
299
+ if (!text) return '';
300
+ const div = document.createElement('div');
301
+ div.textContent = text;
302
+ return div.innerHTML;
303
+ }
304
+
305
+ function renderMarkdown(text) {
306
+ if (!text) return '';
307
+ let html = escapeHtml(text);
308
+ html = html.replace(/^### (.+)$/gm, '<h4>$1</h4>');
309
+ html = html.replace(/^## (.+)$/gm, '<h3>$1</h3>');
310
+ html = html.replace(/^# (.+)$/gm, '<h2>$1</h2>');
311
+ html = html.replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>');
312
+ html = html.replace(/\\*(.+?)\\*/g, '<em>$1</em>');
313
+ html = html.replace(/\`([^\`]+)\`/g, '<code>$1</code>');
314
+ html = html.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, '<a href="$2" target="_blank">$1</a>');
315
+ html = html.replace(/^- (.+)$/gm, '<li>$1</li>');
316
+ html = html.replace(/(<li>.*<\\/li>\\n?)+/g, '<ul>$&</ul>');
317
+ html = html.replace(/\\n/g, '<br>');
318
+ return html;
319
+ }
320
+
321
+ function updateLangUI() {
322
+ document.querySelectorAll('.lang-btn').forEach(btn => {
323
+ btn.classList.toggle('active', btn.dataset.lang === currentLang);
324
+ });
325
+ document.querySelectorAll('[data-i18n]').forEach(el => {
326
+ const key = el.dataset.i18n;
327
+ const translated = t(key);
328
+ // Keep badge if present
329
+ const badge = el.querySelector('.tab-badge');
330
+ if (badge) {
331
+ el.innerHTML = translated + ' ' + badge.outerHTML;
332
+ } else {
333
+ el.textContent = translated;
334
+ }
335
+ });
336
+ document.querySelectorAll('[data-i18n-placeholder]').forEach(el => {
337
+ el.placeholder = t(el.dataset.i18nPlaceholder);
338
+ });
339
+ }
340
+
341
+ function showNotification(msg, isError) {
342
+ const notification = document.getElementById('notification');
343
+ notification.textContent = msg;
344
+ notification.className = 'notification show' + (isError ? ' error' : '');
345
+ setTimeout(() => notification.className = 'notification', 3000);
346
+ }
347
+
348
+ // Language switcher
349
+ document.querySelectorAll('.lang-btn').forEach(btn => {
350
+ btn.addEventListener('click', () => {
351
+ const newLang = btn.dataset.lang;
352
+ if (newLang !== currentLang) {
353
+ currentLang = newLang;
354
+ localStorage.setItem(STORAGE_KEY, newLang);
355
+ updateLangUI();
356
+ if (typeof onLangChange === 'function') onLangChange();
357
+ }
358
+ });
359
+ });
360
+
361
+ // Init lang
362
+ updateLangUI();
363
+ `;
364
+ }
365
+ //# sourceMappingURL=issue-shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue-shared.js","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+JN,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,SAA0D,EAAE,IAAmB;IAC/H,MAAM,IAAI,GAAG;QACX,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,QAAQ,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE;QACvE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,QAAQ,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE;QAC7G,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,QAAQ,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE;QACzG,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,QAAQ,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE;KACnF,CAAC;IAEF,OAAO;;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACf,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC;QACtC,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/F,OAAO,YAAY,GAAG,CAAC,IAAI,oBAAoB,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC;IAC3H,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;;GAEd,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,KAAa;IACjE,OAAO;;;;gCAIuB,UAAU,CAAC,QAAQ,CAAC;kCAClB,UAAU,CAAC,KAAK,CAAC;;;;;;;GAOhD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO;yBACgB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsJ9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Issue terminal page generator
3
+ */
4
+ /**
5
+ * Generate the issue terminal page
6
+ */
7
+ export declare function generateIssueTerminalPage(issueKey: string, lang: string): string;
8
+ //# sourceMappingURL=issue-terminal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue-terminal.d.ts","sourceRoot":"","sources":["../../../../src/server/dashboard/pages/issue-terminal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAiWhF"}