@hugobatist/smartcode 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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +292 -0
  3. package/dist/cli.js +4324 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/index.d.ts +374 -0
  6. package/dist/index.js +1167 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/static/annotations-panel.js +133 -0
  9. package/dist/static/annotations-svg.js +108 -0
  10. package/dist/static/annotations.css +367 -0
  11. package/dist/static/annotations.js +367 -0
  12. package/dist/static/app-init.js +497 -0
  13. package/dist/static/breakpoints.css +69 -0
  14. package/dist/static/breakpoints.js +197 -0
  15. package/dist/static/clipboard.js +94 -0
  16. package/dist/static/collapse-ui.js +325 -0
  17. package/dist/static/command-history.js +89 -0
  18. package/dist/static/context-menu.js +334 -0
  19. package/dist/static/custom-renderer.js +201 -0
  20. package/dist/static/dagre-layout.js +291 -0
  21. package/dist/static/diagram-dom.js +241 -0
  22. package/dist/static/diagram-editor.js +368 -0
  23. package/dist/static/editor-panel.js +107 -0
  24. package/dist/static/editor-popovers.js +187 -0
  25. package/dist/static/event-bus.js +57 -0
  26. package/dist/static/export.js +181 -0
  27. package/dist/static/file-tree.js +470 -0
  28. package/dist/static/ghost-paths.js +397 -0
  29. package/dist/static/heatmap.css +116 -0
  30. package/dist/static/heatmap.js +308 -0
  31. package/dist/static/icons.js +66 -0
  32. package/dist/static/inline-edit.js +294 -0
  33. package/dist/static/interaction-state.js +155 -0
  34. package/dist/static/interaction-tracker.js +93 -0
  35. package/dist/static/live.html +239 -0
  36. package/dist/static/main-layout.css +220 -0
  37. package/dist/static/main.css +334 -0
  38. package/dist/static/mcp-sessions.js +202 -0
  39. package/dist/static/modal.css +109 -0
  40. package/dist/static/modal.js +171 -0
  41. package/dist/static/node-drag.js +293 -0
  42. package/dist/static/pan-zoom.js +199 -0
  43. package/dist/static/renderer.js +280 -0
  44. package/dist/static/search.css +103 -0
  45. package/dist/static/search.js +304 -0
  46. package/dist/static/selection.js +353 -0
  47. package/dist/static/session-player.css +137 -0
  48. package/dist/static/session-player.js +411 -0
  49. package/dist/static/sidebar.css +248 -0
  50. package/dist/static/svg-renderer.js +313 -0
  51. package/dist/static/svg-shapes.js +218 -0
  52. package/dist/static/tokens.css +76 -0
  53. package/dist/static/vendor/dagre-bundle.js +43 -0
  54. package/dist/static/vendor/dagre.min.js +3 -0
  55. package/dist/static/vendor/graphlib.min.js +2 -0
  56. package/dist/static/viewport-transform.js +107 -0
  57. package/dist/static/workspace-switcher.js +202 -0
  58. package/dist/static/ws-client.js +71 -0
  59. package/dist/static/ws-handler.js +125 -0
  60. package/package.json +74 -0
@@ -0,0 +1,220 @@
1
+ /* main-layout.css -- Layout rules extracted from main.css */
2
+
3
+ /* -- Main layout -- */
4
+ .main {
5
+ display: flex;
6
+ height: calc(100vh - 52px);
7
+ }
8
+
9
+ /* -- File sidebar -- */
10
+ .sidebar {
11
+ width: 260px;
12
+ background: var(--surface-1);
13
+ border-right: 1px solid var(--border-subtle);
14
+ display: flex;
15
+ flex-direction: column;
16
+ overflow-y: auto;
17
+ transition: width 0.3s ease, opacity 0.3s ease;
18
+ }
19
+
20
+ .sidebar.hidden { display: none; }
21
+
22
+ .sidebar-header {
23
+ padding: 10px 12px 8px;
24
+ font-size: 10px;
25
+ font-weight: 700;
26
+ text-transform: uppercase;
27
+ letter-spacing: 1.5px;
28
+ color: var(--text-secondary);
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: space-between;
32
+ }
33
+ .sidebar-header .actions { display: flex; gap: 4px; }
34
+ .sidebar-header .actions button {
35
+ background: none; border: none; color: var(--text-secondary);
36
+ cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px;
37
+ }
38
+ .sidebar-header .actions button:hover { background: var(--surface-3); color: var(--text-primary); }
39
+
40
+ /* Tree items */
41
+ .tree-folder {
42
+ cursor: pointer;
43
+ user-select: none;
44
+ }
45
+ .tree-folder-header {
46
+ padding: 4px 8px;
47
+ font-size: 12px;
48
+ font-weight: 600;
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 4px;
52
+ color: var(--text-primary);
53
+ transition: background 0.1s;
54
+ }
55
+ .tree-folder-header:hover { background: var(--surface-2); }
56
+ .tree-chevron {
57
+ font-size: 10px;
58
+ width: 16px;
59
+ text-align: center;
60
+ color: var(--text-secondary);
61
+ transition: transform 0.15s;
62
+ flex-shrink: 0;
63
+ }
64
+ .tree-chevron.open { transform: rotate(90deg); }
65
+ .tree-folder-icon { font-size: 13px; flex-shrink: 0; }
66
+ .tree-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
67
+ .tree-folder-count {
68
+ font-size: 10px; color: var(--text-secondary); background: var(--surface-3);
69
+ padding: 1px 6px; border-radius: 8px; font-weight: 500;
70
+ }
71
+ .tree-children { overflow: hidden; }
72
+ .tree-children.collapsed { display: none; }
73
+
74
+ .tree-file {
75
+ padding: 3px 8px 3px 0;
76
+ font-size: 12px;
77
+ font-weight: 400;
78
+ cursor: pointer;
79
+ display: flex;
80
+ align-items: center;
81
+ gap: 4px;
82
+ transition: background 0.1s;
83
+ color: var(--text-secondary);
84
+ border-left: 2px solid transparent;
85
+ }
86
+ .tree-file:hover { background: var(--surface-2); color: var(--text-primary); }
87
+ .tree-file.active {
88
+ background: var(--accent-muted);
89
+ color: var(--accent);
90
+ border-left-color: var(--accent);
91
+ }
92
+ .tree-file-icon { font-size: 11px; flex-shrink: 0; opacity: 0.5; }
93
+ .tree-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
94
+ .tree-file-actions { opacity: 0; display: flex; gap: 2px; flex-shrink: 0; }
95
+ .tree-file:hover .tree-file-actions { opacity: 1; }
96
+ .tree-file-actions button {
97
+ background: none; border: none; cursor: pointer;
98
+ font-size: 10px; padding: 1px 3px; border-radius: 3px;
99
+ }
100
+ .tree-file-actions .rename-btn { color: var(--text-secondary); }
101
+ .tree-file-actions .delete-btn { color: var(--status-problem); }
102
+ .tree-file-actions button:hover { background: var(--surface-3); }
103
+
104
+ /* -- Content area -- */
105
+ .content {
106
+ flex: 1;
107
+ display: flex;
108
+ overflow: hidden;
109
+ }
110
+
111
+ /* -- Editor panel -- */
112
+ .editor-panel {
113
+ width: 40%;
114
+ min-width: 300px;
115
+ display: flex;
116
+ flex-direction: column;
117
+ border-right: 1px solid var(--border-subtle);
118
+ transition: width 0.3s ease;
119
+ }
120
+
121
+ .editor-panel.hidden { display: none; }
122
+ .editor-panel.hidden + .resize-handle { display: none; }
123
+
124
+ .panel-header {
125
+ height: 40px;
126
+ display: flex;
127
+ align-items: center;
128
+ padding: 0 14px;
129
+ font-size: 12px;
130
+ color: var(--text-secondary);
131
+ background: var(--surface-1);
132
+ border-bottom: 1px solid var(--border-subtle);
133
+ gap: 8px;
134
+ }
135
+
136
+ .panel-header .tab {
137
+ padding: 3px 10px;
138
+ border-radius: 6px;
139
+ cursor: pointer;
140
+ font-weight: 500;
141
+ }
142
+ .panel-header .tab.active { background: var(--surface-3); color: var(--text-primary); }
143
+
144
+ #editor {
145
+ flex: 1;
146
+ resize: none;
147
+ border: none;
148
+ outline: none;
149
+ background: var(--surface-0);
150
+ color: var(--text-primary);
151
+ font-family: 'JetBrains Mono', 'Fira Code', monospace;
152
+ font-size: 13px;
153
+ line-height: 1.7;
154
+ padding: 16px;
155
+ tab-size: 4;
156
+ overflow: auto;
157
+ }
158
+
159
+ /* -- Preview panel (LIGHT) -- */
160
+ .preview-panel {
161
+ flex: 1;
162
+ overflow: hidden;
163
+ display: flex;
164
+ align-items: center;
165
+ justify-content: center;
166
+ background: var(--preview-bg);
167
+ position: relative;
168
+ cursor: grab;
169
+ }
170
+ .preview-panel.grabbing { cursor: grabbing; }
171
+
172
+ #preview-container {
173
+ width: 100%;
174
+ height: 100%;
175
+ overflow: hidden;
176
+ position: relative;
177
+ }
178
+
179
+ #preview {
180
+ position: absolute;
181
+ top: 0;
182
+ left: 0;
183
+ transform-origin: 0 0;
184
+ padding: 40px;
185
+ min-width: 100%;
186
+ min-height: 100%;
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: center;
190
+ }
191
+
192
+ #preview svg {
193
+ max-width: none !important;
194
+ height: auto !important;
195
+ }
196
+
197
+ /* High-contrast mermaid overrides for light background.
198
+ * IMPORTANT: Do NOT override font-size or font-weight here -- Mermaid calculates
199
+ * node box sizes based on its own font metrics. CSS overrides applied after layout
200
+ * cause text to overflow the allocated space, producing overlap artifacts.
201
+ * Font configuration must be done in MERMAID_CONFIG (renderer.js themeVariables). */
202
+ #preview .node rect,
203
+ #preview .node circle,
204
+ #preview .node polygon,
205
+ #preview .node .label-container {
206
+ stroke-width: 2px !important;
207
+ }
208
+
209
+ /* -- Resize handle -- */
210
+ .resize-handle {
211
+ width: 5px;
212
+ cursor: col-resize;
213
+ background: transparent;
214
+ transition: background 0.2s;
215
+ position: relative;
216
+ z-index: 5;
217
+ }
218
+ .resize-handle:hover, .resize-handle.active {
219
+ background: var(--accent);
220
+ }
@@ -0,0 +1,334 @@
1
+ * { margin: 0; padding: 0; box-sizing: border-box; }
2
+
3
+ body {
4
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
5
+ background: var(--preview-bg);
6
+ color: var(--text-primary);
7
+ height: 100vh;
8
+ overflow: hidden;
9
+ }
10
+
11
+ /* -- Topbar -- */
12
+ .topbar {
13
+ height: 52px;
14
+ background: var(--surface-1);
15
+ border-bottom: 1px solid var(--border-subtle);
16
+ display: flex;
17
+ align-items: center;
18
+ padding: 0 12px;
19
+ gap: 6px;
20
+ z-index: 10;
21
+ position: relative;
22
+ }
23
+
24
+ .topbar .logo {
25
+ font-weight: 700;
26
+ font-size: 14px;
27
+ color: var(--text-primary);
28
+ }
29
+
30
+ /* -- Toolbar Groups -- */
31
+ .toolbar-group {
32
+ display: flex;
33
+ align-items: center;
34
+ gap: 4px;
35
+ }
36
+
37
+ .toolbar-separator {
38
+ width: 1px;
39
+ height: 20px;
40
+ background: var(--surface-4);
41
+ margin: 0 4px;
42
+ }
43
+
44
+ .toolbar-spacer {
45
+ flex: 1;
46
+ }
47
+
48
+ .toolbar-btn {
49
+ padding: 5px 10px;
50
+ border-radius: var(--radius-md);
51
+ border: 1px solid transparent;
52
+ background: transparent;
53
+ color: var(--text-secondary);
54
+ font-size: 12px;
55
+ font-weight: 500;
56
+ font-family: inherit;
57
+ cursor: pointer;
58
+ transition: all 0.15s ease;
59
+ white-space: nowrap;
60
+ display: inline-flex;
61
+ align-items: center;
62
+ gap: 4px;
63
+ }
64
+ .toolbar-btn:hover {
65
+ background: var(--surface-3);
66
+ color: var(--text-primary);
67
+ }
68
+ .toolbar-btn.active {
69
+ background: var(--accent);
70
+ color: var(--text-on-accent);
71
+ }
72
+
73
+ .toolbar-btn--primary {
74
+ color: var(--accent);
75
+ font-weight: 600;
76
+ }
77
+ .toolbar-btn--primary:hover {
78
+ background: var(--accent-muted);
79
+ color: var(--accent);
80
+ }
81
+
82
+ .toolbar-btn--ghost {
83
+ color: var(--text-tertiary);
84
+ font-weight: 400;
85
+ }
86
+
87
+ /* -- Toolbar icon spans -- */
88
+ .toolbar-icon {
89
+ display: inline-flex;
90
+ align-items: center;
91
+ flex-shrink: 0;
92
+ }
93
+ .toolbar-icon svg {
94
+ width: 14px;
95
+ height: 14px;
96
+ }
97
+
98
+ .toolbar-badge {
99
+ font-size: 10px;
100
+ font-weight: 600;
101
+ min-width: 16px;
102
+ height: 16px;
103
+ padding: 0 4px;
104
+ display: inline-flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+ border-radius: 8px;
108
+ background: var(--surface-4);
109
+ color: var(--text-secondary);
110
+ }
111
+ .toolbar-badge[data-count="0"] {
112
+ display: none;
113
+ }
114
+
115
+ .topbar .file-name {
116
+ font-size: 13px;
117
+ color: var(--text-secondary);
118
+ font-weight: 500;
119
+ }
120
+
121
+ .workspace-switcher {
122
+ display: flex;
123
+ align-items: center;
124
+ }
125
+
126
+ .workspace-label {
127
+ font-size: 12px;
128
+ color: var(--text-secondary);
129
+ font-weight: 500;
130
+ opacity: 0.7;
131
+ }
132
+
133
+ .workspace-select {
134
+ background: var(--surface-3);
135
+ border: 1px solid var(--surface-4);
136
+ border-radius: 6px;
137
+ color: var(--text-secondary);
138
+ font-size: 12px;
139
+ font-family: 'Inter', sans-serif;
140
+ font-weight: 500;
141
+ padding: 4px 24px 4px 8px;
142
+ cursor: pointer;
143
+ outline: none;
144
+ appearance: none;
145
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
146
+ background-repeat: no-repeat;
147
+ background-position: right 8px center;
148
+ min-width: 100px;
149
+ transition: border-color 0.15s;
150
+ }
151
+
152
+ .workspace-select:hover {
153
+ border-color: var(--text-tertiary);
154
+ }
155
+
156
+ .workspace-select:focus {
157
+ border-color: var(--accent);
158
+ }
159
+
160
+ .topbar .status {
161
+ font-size: 12px;
162
+ display: flex;
163
+ align-items: center;
164
+ gap: 8px;
165
+ font-weight: 500;
166
+ margin-left: 8px;
167
+ }
168
+
169
+ .status-dot {
170
+ width: 10px;
171
+ height: 10px;
172
+ border-radius: 50%;
173
+ background: var(--status-ok);
174
+ box-shadow: 0 0 8px rgba(34,197,94,0.6);
175
+ animation: pulse 2s infinite;
176
+ }
177
+
178
+ @keyframes pulse {
179
+ 0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34,197,94,0.6); }
180
+ 50% { opacity: 0.5; box-shadow: 0 0 4px rgba(34,197,94,0.3); }
181
+ }
182
+
183
+ .status-dot.paused {
184
+ background: var(--status-problem);
185
+ box-shadow: 0 0 8px rgba(239,68,68,0.5);
186
+ animation: none;
187
+ }
188
+
189
+ .btn {
190
+ padding: 6px 14px;
191
+ border-radius: 8px;
192
+ border: 1px solid var(--border-subtle);
193
+ background: var(--surface-3);
194
+ color: var(--text-primary);
195
+ font-size: 12px;
196
+ font-weight: 500;
197
+ font-family: inherit;
198
+ cursor: pointer;
199
+ transition: all 0.2s ease;
200
+ }
201
+ .btn:hover { background: var(--surface-4); }
202
+ .btn.active {
203
+ background: var(--accent);
204
+ color: var(--text-on-accent);
205
+ border-color: var(--accent);
206
+ }
207
+
208
+ /* -- Layout rules in main-layout.css -- */
209
+
210
+ /* -- Zoom controls -- */
211
+ .zoom-controls {
212
+ position: absolute;
213
+ bottom: 20px;
214
+ right: 20px;
215
+ display: flex;
216
+ gap: 2px;
217
+ background: var(--surface-2);
218
+ border: 1px solid var(--border-default);
219
+ border-radius: 12px;
220
+ padding: 4px;
221
+ box-shadow: 0 4px 24px rgba(0,0,0,0.15);
222
+ }
223
+
224
+ .zoom-btn {
225
+ width: 36px;
226
+ height: 36px;
227
+ display: flex;
228
+ align-items: center;
229
+ justify-content: center;
230
+ border: none;
231
+ background: none;
232
+ color: var(--text-primary);
233
+ cursor: pointer;
234
+ border-radius: 8px;
235
+ font-size: 16px;
236
+ font-family: inherit;
237
+ font-weight: 600;
238
+ transition: background 0.15s;
239
+ }
240
+ .zoom-btn:hover { background: var(--surface-4); }
241
+
242
+ .zoom-label {
243
+ display: flex;
244
+ align-items: center;
245
+ font-size: 12px;
246
+ color: var(--text-secondary);
247
+ padding: 0 8px;
248
+ min-width: 50px;
249
+ justify-content: center;
250
+ font-weight: 600;
251
+ }
252
+
253
+ /* -- Resize handle in main-layout.css -- */
254
+
255
+ /* -- Toast -- */
256
+ .toast {
257
+ position: fixed;
258
+ bottom: 24px;
259
+ left: 50%;
260
+ transform: translateX(-50%) translateY(80px);
261
+ background: var(--surface-2);
262
+ border: 1px solid var(--border-default);
263
+ padding: 10px 24px;
264
+ border-radius: 12px;
265
+ font-size: 13px;
266
+ font-weight: 500;
267
+ color: var(--text-primary);
268
+ transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
269
+ z-index: 100;
270
+ box-shadow: 0 4px 24px rgba(0,0,0,0.2);
271
+ }
272
+ .toast.show { transform: translateX(-50%) translateY(0); }
273
+
274
+ /* -- Kbd -- */
275
+ kbd {
276
+ background: var(--surface-3);
277
+ border: 1px solid var(--surface-4);
278
+ border-radius: 4px;
279
+ padding: 1px 6px;
280
+ font-size: 11px;
281
+ font-family: inherit;
282
+ }
283
+
284
+ /* -- Help overlay -- */
285
+ .help-overlay {
286
+ position: fixed;
287
+ inset: 0;
288
+ background: rgba(0,0,0,0.7);
289
+ display: none;
290
+ align-items: center;
291
+ justify-content: center;
292
+ z-index: 200;
293
+ }
294
+ .help-overlay.show { display: flex; }
295
+
296
+ .help-box {
297
+ background: var(--surface-1);
298
+ border: 1px solid var(--border-default);
299
+ border-radius: var(--radius-xl);
300
+ padding: 28px 36px;
301
+ max-width: 500px;
302
+ width: 90%;
303
+ box-shadow: 0 24px 48px rgba(0,0,0,0.3);
304
+ }
305
+
306
+ .help-box h2 { font-size: 16px; margin-bottom: 16px; font-weight: 700; }
307
+
308
+ .help-row {
309
+ display: flex;
310
+ justify-content: space-between;
311
+ padding: 7px 0;
312
+ font-size: 13px;
313
+ }
314
+ .help-row span:last-child { color: var(--text-secondary); }
315
+
316
+ /* -- Minimap hint -- */
317
+ .fit-hint {
318
+ position: absolute;
319
+ top: 16px;
320
+ right: 20px;
321
+ background: var(--surface-2);
322
+ border: 1px solid var(--border-subtle);
323
+ border-radius: 10px;
324
+ padding: 6px 14px;
325
+ font-size: 11px;
326
+ color: var(--text-secondary);
327
+ font-weight: 500;
328
+ pointer-events: none;
329
+ opacity: 0;
330
+ transition: opacity 0.5s;
331
+ }
332
+ .fit-hint.show { opacity: 1; pointer-events: auto; }
333
+
334
+ /* -- Breadcrumb, context menu, sidebar, MCP session styles in sidebar.css -- */