@capybara-hq/plugin-memory 0.0.0-stage → 0.1.0-rc.1

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,701 @@
1
+ @layer extensions {
2
+ /*
3
+ * The memory page (the org.page component "memory-page"). The packer wraps this file in
4
+ * @layer extensions. Every rule hangs off the plugin's own cx-memory-* classes, and every colour,
5
+ * size and font is a theme token (--cb-*), so the page follows the theme. The canvas reads the
6
+ * --cx-memory-type-* colours below at draw time: a theme may restyle them.
7
+ */
8
+
9
+ .cx-memory-page {
10
+ --cx-memory-type-user: var(--cb-accent);
11
+ --cx-memory-type-feedback: var(--cb-warn);
12
+ --cx-memory-type-project: var(--cb-ok);
13
+ --cx-memory-type-reference: var(--cb-ink);
14
+ --cx-memory-agent: var(--cb-accent);
15
+ --cx-memory-panel-width: 380px;
16
+
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: var(--cb-space-3);
20
+ height: clamp(520px, calc(100dvh - 180px), 1400px);
21
+ min-height: 0;
22
+ font-family: var(--cb-font-prose);
23
+ color: var(--cb-ink);
24
+ }
25
+
26
+ /* No memories: the page is as tall as what it shows, not a viewport-high empty box. */
27
+ .cx-memory-page[data-empty="true"] {
28
+ height: auto;
29
+ }
30
+
31
+ /* 全屏: the page element is the fullscreen element and fills the screen. */
32
+ .cx-memory-page[data-fullscreen="true"] {
33
+ height: 100dvh;
34
+ padding: var(--cb-space-4);
35
+ background: var(--cb-bg);
36
+ }
37
+
38
+ /* ---------- Top bar ---------- */
39
+
40
+ .cx-memory-toolbar {
41
+ display: flex;
42
+ flex-wrap: wrap;
43
+ align-items: center;
44
+ gap: var(--cb-space-3);
45
+ }
46
+
47
+ .cx-memory-field {
48
+ display: inline-flex;
49
+ align-items: center;
50
+ gap: var(--cb-space-2);
51
+ min-width: 0;
52
+ }
53
+
54
+ .cx-memory-field[data-block="true"] {
55
+ display: flex;
56
+ flex-direction: column;
57
+ align-items: stretch;
58
+ gap: var(--cb-space-1);
59
+ }
60
+
61
+ .cx-memory-field-label {
62
+ font-size: var(--cb-type-small-size);
63
+ line-height: var(--cb-type-small-line);
64
+ color: var(--cb-muted);
65
+ }
66
+
67
+ .cx-memory-field-note {
68
+ align-self: end;
69
+ font-family: var(--cb-font);
70
+ font-size: var(--cb-type-micro-size);
71
+ color: var(--cb-faint);
72
+ }
73
+
74
+ .cx-memory-field-note[data-over="true"] {
75
+ color: var(--cb-fail);
76
+ }
77
+
78
+ .cx-memory-select,
79
+ .cx-memory-input,
80
+ .cx-memory-textarea {
81
+ box-sizing: border-box;
82
+ min-width: 0;
83
+ height: var(--cb-field-height, 32px);
84
+ padding: 0 var(--cb-space-2);
85
+ border: 1px solid var(--cb-line);
86
+ border-radius: var(--cb-radius-sm);
87
+ background: var(--cb-panel);
88
+ color: var(--cb-ink);
89
+ font: inherit;
90
+ font-size: var(--cb-type-body-size);
91
+ transition: border-color var(--cb-motion) ease;
92
+ }
93
+
94
+ .cx-memory-select {
95
+ max-width: 220px;
96
+ }
97
+
98
+ .cx-memory-textarea {
99
+ height: auto;
100
+ min-height: 200px;
101
+ padding: var(--cb-space-2);
102
+ resize: vertical;
103
+ font-family: var(--cb-font);
104
+ font-size: var(--cb-type-small-size);
105
+ line-height: 1.6;
106
+ }
107
+
108
+ .cx-memory-select:hover,
109
+ .cx-memory-input:hover,
110
+ .cx-memory-textarea:hover {
111
+ border-color: var(--cb-line-strong);
112
+ }
113
+
114
+ .cx-memory-select:focus-visible,
115
+ .cx-memory-input:focus-visible,
116
+ .cx-memory-textarea:focus-visible,
117
+ .cx-memory-canvas:focus-visible,
118
+ .cx-memory-row:focus-visible,
119
+ .cx-memory-hit:focus-visible,
120
+ .cx-memory-link:focus-visible,
121
+ .cx-memory-toggle-item:focus-visible {
122
+ outline: none;
123
+ border-color: var(--cb-accent);
124
+ box-shadow: 0 0 0 3px var(--cb-focus-ring);
125
+ }
126
+
127
+ .cx-memory-select:disabled,
128
+ .cx-memory-input:disabled {
129
+ opacity: 0.55;
130
+ }
131
+
132
+ /* The search is one field: the icon and the input share the border, so the focus ring goes round
133
+ the whole field (a ring on the input alone was clipped by the field's edge). */
134
+ .cx-memory-search {
135
+ box-sizing: border-box;
136
+ display: flex;
137
+ flex: 1 1 220px;
138
+ align-items: center;
139
+ gap: var(--cb-space-2);
140
+ max-width: 420px;
141
+ height: var(--cb-field-height, 32px);
142
+ padding: 0 var(--cb-space-2);
143
+ border: 1px solid var(--cb-line);
144
+ border-radius: var(--cb-radius-sm);
145
+ background: var(--cb-panel);
146
+ color: var(--cb-muted);
147
+ transition: border-color var(--cb-motion) ease;
148
+ }
149
+
150
+ .cx-memory-search:hover {
151
+ border-color: var(--cb-line-strong);
152
+ }
153
+
154
+ .cx-memory-search:focus-within {
155
+ border-color: var(--cb-accent);
156
+ box-shadow: 0 0 0 3px var(--cb-focus-ring);
157
+ }
158
+
159
+ .cx-memory-search .cx-memory-input {
160
+ flex: 1;
161
+ height: 100%;
162
+ padding: 0;
163
+ border: 0;
164
+ background: transparent;
165
+ }
166
+
167
+ .cx-memory-search .cx-memory-input:hover,
168
+ .cx-memory-search .cx-memory-input:focus-visible {
169
+ border: 0;
170
+ box-shadow: none;
171
+ }
172
+
173
+ .cx-memory-toolbar-end {
174
+ display: flex;
175
+ align-items: center;
176
+ gap: var(--cb-space-3);
177
+ margin-left: auto;
178
+ }
179
+
180
+ .cx-memory-toggle {
181
+ display: inline-flex;
182
+ padding: 2px;
183
+ border: 1px solid var(--cb-line);
184
+ border-radius: var(--cb-radius-sm);
185
+ background: var(--cb-panel-2);
186
+ }
187
+
188
+ .cx-memory-toggle-item {
189
+ padding: 2px var(--cb-space-2);
190
+ border: 1px solid transparent;
191
+ border-radius: calc(var(--cb-radius-sm) - 1px);
192
+ background: none;
193
+ color: var(--cb-muted);
194
+ font: inherit;
195
+ font-size: var(--cb-type-small-size);
196
+ cursor: pointer;
197
+ }
198
+
199
+ .cx-memory-toggle-item[aria-pressed="true"] {
200
+ background: var(--cb-selected);
201
+ color: var(--cb-ink);
202
+ }
203
+
204
+ /* ---------- Banners and states ---------- */
205
+
206
+ .cx-memory-banner {
207
+ display: flex;
208
+ align-items: center;
209
+ gap: var(--cb-space-2);
210
+ padding: var(--cb-space-2) var(--cb-space-3);
211
+ border: 1px solid var(--cb-line-soft);
212
+ border-left: 2px solid var(--cb-warn);
213
+ border-radius: var(--cb-radius-sm);
214
+ background: var(--cb-panel-2);
215
+ color: var(--cb-muted);
216
+ }
217
+
218
+ .cx-memory-banner[data-tone="fail"] {
219
+ border-left-color: var(--cb-fail);
220
+ }
221
+
222
+ .cx-memory-state {
223
+ display: flex;
224
+ flex: 1;
225
+ flex-direction: column;
226
+ align-items: center;
227
+ justify-content: center;
228
+ gap: var(--cb-space-2);
229
+ min-height: 320px;
230
+ padding: var(--cb-space-6);
231
+ text-align: center;
232
+ }
233
+
234
+ /* No memories: a compact empty state, not a viewport-high blank panel. */
235
+ .cx-memory-page[data-empty="true"] .cx-memory-state {
236
+ min-height: 220px;
237
+ }
238
+
239
+ .cx-memory-state-icon {
240
+ display: inline-flex;
241
+ align-items: center;
242
+ justify-content: center;
243
+ width: 40px;
244
+ height: 40px;
245
+ margin-bottom: var(--cb-space-2);
246
+ border: 1px solid var(--cb-line);
247
+ border-radius: 50%;
248
+ color: var(--cb-muted);
249
+ }
250
+
251
+ /* ---------- Body: the stage (or list) and the side panel ---------- */
252
+
253
+ .cx-memory-body {
254
+ display: flex;
255
+ flex: 1;
256
+ gap: var(--cb-space-3);
257
+ min-height: 0;
258
+ }
259
+
260
+ .cx-memory-main {
261
+ position: relative;
262
+ display: flex;
263
+ flex: 1;
264
+ flex-direction: column;
265
+ min-width: 0;
266
+ min-height: 0;
267
+ overflow: hidden;
268
+ border: 1px solid var(--cb-line-soft);
269
+ border-radius: var(--cb-radius-md);
270
+ background:
271
+ radial-gradient(
272
+ ellipse at 50% 45%,
273
+ color-mix(in srgb, var(--cx-memory-agent) 7%, transparent),
274
+ transparent 60%
275
+ ),
276
+ var(--cb-panel-2);
277
+ }
278
+
279
+ .cx-memory-stage {
280
+ position: relative;
281
+ flex: 1;
282
+ min-height: 0;
283
+ }
284
+
285
+ .cx-memory-canvas {
286
+ display: block;
287
+ position: absolute;
288
+ inset: 0;
289
+ width: 100%;
290
+ height: 100%;
291
+ border-radius: var(--cb-radius-md);
292
+ cursor: grab;
293
+ touch-action: none;
294
+ }
295
+
296
+ .cx-memory-canvas:active {
297
+ cursor: grabbing;
298
+ }
299
+
300
+ .cx-memory-sr {
301
+ position: absolute;
302
+ width: 1px;
303
+ height: 1px;
304
+ overflow: hidden;
305
+ clip-path: inset(50%);
306
+ white-space: nowrap;
307
+ }
308
+
309
+ .cx-memory-tip {
310
+ position: absolute;
311
+ z-index: 2;
312
+ display: flex;
313
+ flex-direction: column;
314
+ gap: 2px;
315
+ max-width: 320px;
316
+ padding: var(--cb-space-2) var(--cb-space-3);
317
+ border: 1px solid var(--cb-line);
318
+ border-radius: var(--cb-radius-sm);
319
+ background: var(--cb-raised);
320
+ box-shadow: var(--cb-shadow-float);
321
+ pointer-events: none;
322
+ }
323
+
324
+ .cx-memory-tip-path {
325
+ display: inline-flex;
326
+ align-items: center;
327
+ gap: 6px;
328
+ font-family: var(--cb-font);
329
+ font-size: var(--cb-type-small-size);
330
+ color: var(--cb-ink);
331
+ }
332
+
333
+ .cx-memory-tip-desc {
334
+ font-size: var(--cb-type-small-size);
335
+ color: var(--cb-ink);
336
+ }
337
+
338
+ .cx-memory-tip-meta {
339
+ font-size: var(--cb-type-micro-size);
340
+ color: var(--cb-muted);
341
+ }
342
+
343
+ .cx-memory-legend {
344
+ position: absolute;
345
+ left: var(--cb-space-3);
346
+ bottom: var(--cb-space-3);
347
+ display: flex;
348
+ flex-direction: column;
349
+ gap: 4px;
350
+ padding: var(--cb-space-2) var(--cb-space-3);
351
+ border: 1px solid var(--cb-line-soft);
352
+ border-radius: var(--cb-radius-sm);
353
+ background: color-mix(in srgb, var(--cb-panel) 82%, transparent);
354
+ backdrop-filter: blur(6px);
355
+ pointer-events: none;
356
+ }
357
+
358
+ .cx-memory-legend-row {
359
+ display: flex;
360
+ flex-wrap: wrap;
361
+ gap: var(--cb-space-3);
362
+ }
363
+
364
+ .cx-memory-legend-item {
365
+ display: inline-flex;
366
+ align-items: center;
367
+ gap: 6px;
368
+ font-size: var(--cb-type-micro-size);
369
+ color: var(--cb-muted);
370
+ }
371
+
372
+ .cx-memory-legend-line {
373
+ display: inline-block;
374
+ width: 18px;
375
+ border-top: 1px solid var(--cb-ink);
376
+ }
377
+
378
+ .cx-memory-legend-line[data-kind="semantic"] {
379
+ border-top: 1px dashed var(--cb-muted);
380
+ }
381
+
382
+ .cx-memory-hint {
383
+ position: absolute;
384
+ right: var(--cb-space-3);
385
+ bottom: var(--cb-space-3);
386
+ font-size: var(--cb-type-micro-size);
387
+ color: var(--cb-faint);
388
+ pointer-events: none;
389
+ }
390
+
391
+ .cx-memory-dot {
392
+ display: inline-block;
393
+ flex: none;
394
+ width: 8px;
395
+ height: 8px;
396
+ border-radius: 50%;
397
+ background: var(--cb-muted);
398
+ }
399
+
400
+ .cx-memory-dot[data-type="user"] {
401
+ background: var(--cx-memory-type-user);
402
+ box-shadow: 0 0 6px var(--cx-memory-type-user);
403
+ }
404
+
405
+ .cx-memory-dot[data-type="feedback"] {
406
+ background: var(--cx-memory-type-feedback);
407
+ box-shadow: 0 0 6px var(--cx-memory-type-feedback);
408
+ }
409
+
410
+ .cx-memory-dot[data-type="project"] {
411
+ background: var(--cx-memory-type-project);
412
+ box-shadow: 0 0 6px var(--cx-memory-type-project);
413
+ }
414
+
415
+ .cx-memory-dot[data-type="reference"] {
416
+ background: var(--cx-memory-type-reference);
417
+ box-shadow: 0 0 6px var(--cx-memory-type-reference);
418
+ }
419
+
420
+ /* ---------- Search results (over the stage) ---------- */
421
+
422
+ .cx-memory-hits {
423
+ position: absolute;
424
+ top: var(--cb-space-3);
425
+ right: var(--cb-space-3);
426
+ z-index: 3;
427
+ display: flex;
428
+ flex-direction: column;
429
+ width: min(360px, calc(100% - 2 * var(--cb-space-3)));
430
+ max-height: calc(100% - 2 * var(--cb-space-3));
431
+ overflow: auto;
432
+ border: 1px solid var(--cb-line);
433
+ border-radius: var(--cb-radius-sm);
434
+ background: var(--cb-raised);
435
+ box-shadow: var(--cb-shadow-float);
436
+ }
437
+
438
+ .cx-memory-hits-head {
439
+ display: flex;
440
+ align-items: center;
441
+ justify-content: space-between;
442
+ padding: var(--cb-space-1) var(--cb-space-1) var(--cb-space-1) var(--cb-space-3);
443
+ border-bottom: 1px solid var(--cb-line-soft);
444
+ }
445
+
446
+ .cx-memory-hit {
447
+ display: flex;
448
+ flex-direction: column;
449
+ gap: 2px;
450
+ padding: var(--cb-space-2) var(--cb-space-3);
451
+ border: none;
452
+ border-bottom: 1px solid var(--cb-line-soft);
453
+ background: none;
454
+ color: var(--cb-ink);
455
+ font: inherit;
456
+ text-align: left;
457
+ cursor: pointer;
458
+ }
459
+
460
+ .cx-memory-hit:hover {
461
+ background: var(--cb-hover);
462
+ }
463
+
464
+ .cx-memory-hit-path {
465
+ font-family: var(--cb-font);
466
+ font-size: var(--cb-type-small-size);
467
+ }
468
+
469
+ .cx-memory-hit-desc {
470
+ font-size: var(--cb-type-small-size);
471
+ color: var(--cb-muted);
472
+ }
473
+
474
+ .cx-memory-hit-snippet {
475
+ font-size: var(--cb-type-micro-size);
476
+ color: var(--cb-faint);
477
+ }
478
+
479
+ /* ---------- List view ---------- */
480
+
481
+ .cx-memory-list {
482
+ flex: 1;
483
+ overflow: auto;
484
+ }
485
+
486
+ .cx-memory-list-head,
487
+ .cx-memory-row {
488
+ display: grid;
489
+ grid-template-columns: minmax(180px, 2fr) minmax(160px, 3fr) 8ch 14ch;
490
+ gap: var(--cb-space-3);
491
+ align-items: center;
492
+ padding: var(--cb-space-2) var(--cb-space-3);
493
+ }
494
+
495
+ .cx-memory-list-head {
496
+ position: sticky;
497
+ top: 0;
498
+ z-index: 1;
499
+ border-bottom: 1px solid var(--cb-line);
500
+ background: var(--cb-panel-2);
501
+ font-size: var(--cb-type-micro-size);
502
+ color: var(--cb-muted);
503
+ }
504
+
505
+ .cx-memory-row {
506
+ width: 100%;
507
+ border: none;
508
+ border-bottom: 1px solid var(--cb-line-soft);
509
+ background: none;
510
+ color: var(--cb-ink);
511
+ font: inherit;
512
+ text-align: left;
513
+ cursor: pointer;
514
+ }
515
+
516
+ .cx-memory-row:hover {
517
+ background: var(--cb-hover);
518
+ }
519
+
520
+ .cx-memory-row[aria-current="true"] {
521
+ background: var(--cb-selected);
522
+ }
523
+
524
+ .cx-memory-row-path {
525
+ display: inline-flex;
526
+ align-items: center;
527
+ gap: var(--cb-space-2);
528
+ min-width: 0;
529
+ overflow: hidden;
530
+ font-family: var(--cb-font);
531
+ font-size: var(--cb-type-small-size);
532
+ white-space: nowrap;
533
+ text-overflow: ellipsis;
534
+ }
535
+
536
+ .cx-memory-row-desc {
537
+ min-width: 0;
538
+ overflow: hidden;
539
+ font-size: var(--cb-type-small-size);
540
+ color: var(--cb-muted);
541
+ white-space: nowrap;
542
+ text-overflow: ellipsis;
543
+ }
544
+
545
+ .cx-memory-row-num {
546
+ font-family: var(--cb-font);
547
+ font-size: var(--cb-type-small-size);
548
+ color: var(--cb-muted);
549
+ text-align: right;
550
+ }
551
+
552
+ /* ---------- Side panel ---------- */
553
+
554
+ .cx-memory-panel {
555
+ display: flex;
556
+ flex: none;
557
+ flex-direction: column;
558
+ width: var(--cx-memory-panel-width);
559
+ max-width: 45%;
560
+ min-height: 0;
561
+ border: 1px solid var(--cb-line-soft);
562
+ border-radius: var(--cb-radius-md);
563
+ background: var(--cb-panel);
564
+ animation: cx-memory-slide var(--cb-motion-expand, 160ms) ease-out;
565
+ }
566
+
567
+ .cx-memory-panel-head {
568
+ display: flex;
569
+ align-items: center;
570
+ gap: var(--cb-space-2);
571
+ min-height: 40px;
572
+ padding: var(--cb-space-1) var(--cb-space-1) var(--cb-space-1) var(--cb-space-3);
573
+ border-bottom: 1px solid var(--cb-line-soft);
574
+ }
575
+
576
+ .cx-memory-panel-path {
577
+ min-width: 0;
578
+ overflow: hidden;
579
+ font-family: var(--cb-font);
580
+ font-size: var(--cb-type-small-size);
581
+ white-space: nowrap;
582
+ text-overflow: ellipsis;
583
+ }
584
+
585
+ .cx-memory-grow {
586
+ flex: 1;
587
+ }
588
+
589
+ .cx-memory-panel-body {
590
+ display: flex;
591
+ flex-direction: column;
592
+ gap: var(--cb-space-3);
593
+ padding: var(--cb-space-3);
594
+ overflow: auto;
595
+ }
596
+
597
+ .cx-memory-markdown {
598
+ padding: var(--cb-space-3);
599
+ border: 1px solid var(--cb-line-soft);
600
+ border-radius: var(--cb-radius-sm);
601
+ background: var(--cb-panel-2);
602
+ font-family: var(--cb-font);
603
+ font-size: var(--cb-type-small-size);
604
+ line-height: 1.65;
605
+ white-space: pre-wrap;
606
+ overflow-wrap: anywhere;
607
+ }
608
+
609
+ .cx-memory-links {
610
+ display: flex;
611
+ flex-wrap: wrap;
612
+ align-items: center;
613
+ gap: var(--cb-space-1) var(--cb-space-2);
614
+ }
615
+
616
+ .cx-memory-link {
617
+ padding: 0;
618
+ border: none;
619
+ background: none;
620
+ color: var(--cb-accent);
621
+ font-family: var(--cb-font);
622
+ font-size: var(--cb-type-small-size);
623
+ cursor: pointer;
624
+ }
625
+
626
+ .cx-memory-link:hover {
627
+ text-decoration: underline;
628
+ }
629
+
630
+ .cx-memory-link[data-dangling="true"] {
631
+ color: var(--cb-faint);
632
+ cursor: default;
633
+ }
634
+
635
+ .cx-memory-anchor {
636
+ color: var(--cb-accent);
637
+ }
638
+
639
+ .cx-memory-edit {
640
+ display: flex;
641
+ flex-direction: column;
642
+ gap: var(--cb-space-3);
643
+ }
644
+
645
+ .cx-memory-confirm {
646
+ display: flex;
647
+ flex-direction: column;
648
+ gap: var(--cb-space-2);
649
+ padding: var(--cb-space-3);
650
+ border: 1px solid color-mix(in srgb, var(--cb-fail) 45%, transparent);
651
+ border-radius: var(--cb-radius-sm);
652
+ background: color-mix(in srgb, var(--cb-fail) 6%, transparent);
653
+ }
654
+
655
+ @keyframes cx-memory-slide {
656
+ from {
657
+ opacity: 0;
658
+ transform: translateX(12px);
659
+ }
660
+ to {
661
+ opacity: 1;
662
+ transform: none;
663
+ }
664
+ }
665
+
666
+ /* Narrow screens: the panel goes under the stage. */
667
+ @media (max-width: 900px) {
668
+ .cx-memory-body {
669
+ flex-direction: column;
670
+ }
671
+ .cx-memory-panel {
672
+ width: auto;
673
+ max-width: none;
674
+ max-height: 50%;
675
+ }
676
+ .cx-memory-hint {
677
+ display: none;
678
+ }
679
+ }
680
+
681
+ @media (prefers-reduced-motion: reduce) {
682
+ .cx-memory-panel {
683
+ animation: none;
684
+ }
685
+ }
686
+
687
+ [data-cap-state~="motion=reduced"] .cx-memory-panel {
688
+ animation: none;
689
+ }
690
+
691
+ .cx-memory-toggle {
692
+ margin: 0;
693
+ min-width: 0;
694
+ }
695
+
696
+ .cx-memory-rows {
697
+ margin: 0;
698
+ padding: 0;
699
+ list-style: none;
700
+ }
701
+ }