@cardstack/boxel-cli 0.11.0-unstable.2 → 0.11.0-unstable.3

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 (106) hide show
  1. package/bundled-realms/pretui/components/agent-mark.gts +98 -0
  2. package/bundled-realms/pretui/components/agent-question.gts +340 -37
  3. package/bundled-realms/pretui/components/answer-footer.gts +249 -0
  4. package/bundled-realms/pretui/components/card-embed.gts +523 -0
  5. package/bundled-realms/pretui/components/card-pills.gts +725 -0
  6. package/bundled-realms/pretui/components/code-block.gts +87 -45
  7. package/bundled-realms/pretui/components/collapsed-turn.gts +133 -12
  8. package/bundled-realms/pretui/components/compaction-chip.gts +81 -67
  9. package/bundled-realms/pretui/components/composer-cap.gts +516 -0
  10. package/bundled-realms/pretui/components/context-ring.gts +108 -0
  11. package/bundled-realms/pretui/components/diff-block.gts +1002 -31
  12. package/bundled-realms/pretui/components/diff-stat.gts +102 -0
  13. package/bundled-realms/pretui/components/jump-chip.gts +86 -53
  14. package/bundled-realms/pretui/components/markdown-stream.gts +799 -0
  15. package/bundled-realms/pretui/components/markdown-surface.gts +71 -0
  16. package/bundled-realms/pretui/components/plan-mark.gts +147 -0
  17. package/bundled-realms/pretui/components/prose.gts +185 -8
  18. package/bundled-realms/pretui/components/prose.md +6 -8
  19. package/bundled-realms/pretui/components/quick-look.gts +377 -0
  20. package/bundled-realms/pretui/components/reactions.gts +136 -0
  21. package/bundled-realms/pretui/components/recommendation.gts +67 -36
  22. package/bundled-realms/pretui/components/result-card.gts +58 -22
  23. package/bundled-realms/pretui/components/segmented-control.gts +13 -8
  24. package/bundled-realms/pretui/components/session-prep.gts +12 -11
  25. package/bundled-realms/pretui/components/sliding-highlight.gts +8 -3
  26. package/bundled-realms/pretui/components/speaker-label.gts +132 -0
  27. package/bundled-realms/pretui/components/state-glyph.gts +121 -0
  28. package/bundled-realms/pretui/components/step-list.gts +62 -60
  29. package/bundled-realms/pretui/components/stick-to-bottom.gts +1150 -0
  30. package/bundled-realms/pretui/components/system-line.gts +143 -0
  31. package/bundled-realms/pretui/components/task-checklist.gts +184 -0
  32. package/bundled-realms/pretui/components/thinking.gts +63 -94
  33. package/bundled-realms/pretui/components/tool-change-table.gts +285 -0
  34. package/bundled-realms/pretui/components/tool-gate.gts +462 -0
  35. package/bundled-realms/pretui/components/tool-group.gts +920 -0
  36. package/bundled-realms/pretui/components/tool-icon.ts +64 -0
  37. package/bundled-realms/pretui/components/tool-meta.gts +82 -0
  38. package/bundled-realms/pretui/components/tool-plan.gts +197 -0
  39. package/bundled-realms/pretui/components/tool-row.gts +2087 -0
  40. package/bundled-realms/pretui/components/turn-changes.gts +227 -0
  41. package/bundled-realms/pretui/components/user-bubble.gts +575 -0
  42. package/bundled-realms/pretui/components/work-item.gts +185 -48
  43. package/bundled-realms/pretui/docs/scroll-anchoring-protocol.md +136 -0
  44. package/bundled-realms/pretui/internal/markdown-projection.ts +438 -0
  45. package/bundled-realms/pretui/internal/mount-queue.ts +79 -0
  46. package/bundled-realms/pretui/internal/tool-phrases.ts +168 -0
  47. package/bundled-realms/pretui/package.json +2 -1
  48. package/bundled-test-harness/assets/{ai-module-creation-test-beRNwH-e.js → ai-module-creation-test-B6FQKqIl.js} +1 -1
  49. package/bundled-test-harness/assets/{app-CtezUCip.js → app-KpPqdyX3.js} +4 -4
  50. package/bundled-test-harness/assets/{binary-upload-dedupe-test-bI8T0QLl.js → binary-upload-dedupe-test-DN00y1tM.js} +1 -1
  51. package/bundled-test-harness/assets/{can-invoke-test-DVaU_yRT.js → can-invoke-test-Bl-EUFM3.js} +1 -1
  52. package/bundled-test-harness/assets/{card-chooser-paging-test-DnxMnXKR.js → card-chooser-paging-test-BNuZRHX3.js} +1 -1
  53. package/bundled-test-harness/assets/{card-chooser-test-DUSnLr-u.js → card-chooser-test-wKfPOOT4.js} +1 -1
  54. package/bundled-test-harness/assets/{card-def-field-def-relationships-test-GBUr3tFK.js → card-def-field-def-relationships-test-CduQ6zan.js} +1 -1
  55. package/bundled-test-harness/assets/{card-delete-test-CQveO1VC.js → card-delete-test-DKxolj5o.js} +1 -1
  56. package/bundled-test-harness/assets/{check-correctness-test-D2M2p66N.js → check-correctness-test-B-kgHztp.js} +1 -1
  57. package/bundled-test-harness/assets/{codeblocks-test-AdolhdCA.js → codeblocks-test-BDD7qK_V.js} +1 -1
  58. package/bundled-test-harness/assets/{compaction-test-DvyAQq56.js → compaction-test-BweolkhG.js} +1 -1
  59. package/bundled-test-harness/assets/{container-DIF_9lZ9.css → container-B5B6u-xm.css} +29 -22
  60. package/bundled-test-harness/assets/{container-DvvqmNpg.js → container-BnJjIM6J.js} +9 -6
  61. package/bundled-test-harness/assets/{create-listing-modal-test-D95JfQab.js → create-listing-modal-test-FvcAKpIa.js} +1 -1
  62. package/bundled-test-harness/assets/{debug-message-test-BcNtj7Wr.js → debug-message-test-CJ18Evt7.js} +1 -1
  63. package/bundled-test-harness/assets/{externals-DCnB4XSS.js → externals-BWjhmCD4.js} +1 -1
  64. package/bundled-test-harness/assets/{fallback-banner-live-delete-test-5lnN1pv2.js → fallback-banner-live-delete-test-C2H3BrT-.js} +1 -1
  65. package/bundled-test-harness/assets/{fallback-banner-test-DFb_m_Kq.js → fallback-banner-test-C10aYjkj.js} +1 -1
  66. package/bundled-test-harness/assets/{fallback-models-test-p3YIwj1L.js → fallback-models-test-BxoPiaGF.js} +1 -1
  67. package/bundled-test-harness/assets/{file-attachment-test-CmyjNWRR.js → file-attachment-test-DeKyzYaz.js} +1 -1
  68. package/bundled-test-harness/assets/{general-test-CX-TFDuX.js → general-test-BewzrpoB.js} +1 -1
  69. package/bundled-test-harness/assets/{index-query-engine-test-CY2tAkot.js → index-query-engine-test-BtI8Y2LR.js} +1 -1
  70. package/bundled-test-harness/assets/{instance-filter-matcher-test-CMBTh8xn.js → instance-filter-matcher-test-BHXHGHjE.js} +1 -1
  71. package/bundled-test-harness/assets/{main-BOZbZVem.js → main-CqAHZ2kK.js} +1 -1
  72. package/bundled-test-harness/assets/{message-tool-test-CfjRSJvt.js → message-tool-test-NMaPJFsd.js} +1 -1
  73. package/bundled-test-harness/assets/{model-cost-tier-test-mZG84Uso.js → model-cost-tier-test-BgbfN2LH.js} +1 -1
  74. package/bundled-test-harness/assets/{operation-lowering-test-CHnjKSJb.js → operation-lowering-test-C4IaOjsA.js} +1 -1
  75. package/bundled-test-harness/assets/{operator-mode-card-chooser-test-KWS8lq16.js → operator-mode-card-chooser-test-Bwe47Rn7.js} +1 -1
  76. package/bundled-test-harness/assets/{operator-mode-links-test-CViFt0Ws.js → operator-mode-links-test-BU4jkC-B.js} +1 -1
  77. package/bundled-test-harness/assets/{operator-mode-test-D0gZM2yw.js → operator-mode-test-Bh0rGM9z.js} +1 -1
  78. package/bundled-test-harness/assets/{operator-mode-ui-test-CEvHJ9DS.js → operator-mode-ui-test-whgUw0ju.js} +1 -1
  79. package/bundled-test-harness/assets/{overlay-menu-items-test-Pw80RXsr.js → overlay-menu-items-test-Cwn1vr8q.js} +1 -1
  80. package/bundled-test-harness/assets/{past-sessions-test-CW0-Bjav.js → past-sessions-test-Bh24N-Kz.js} +1 -1
  81. package/bundled-test-harness/assets/{permission-checking-realm-test-D5uXQypS.js → permission-checking-realm-test-DKnnAy0f.js} +1 -1
  82. package/bundled-test-harness/assets/{realm-config-policy-standing-test-Btatheni.js → realm-config-policy-standing-test-DngdYypq.js} +1 -1
  83. package/bundled-test-harness/assets/{realm-config-routing-rule-edit-test-Dh5zW13o.js → realm-config-routing-rule-edit-test-_rkFU8SN.js} +1 -1
  84. package/bundled-test-harness/assets/{realm-config-settings-test-BJa8gv_C.js → realm-config-settings-test-CR9NH0Zn.js} +1 -1
  85. package/bundled-test-harness/assets/{reasoning-test-2Zp37cQB.js → reasoning-test-0lH10kRl.js} +1 -1
  86. package/bundled-test-harness/assets/{room-message-test-BsrON13e.js → room-message-test-C-PddE4Y.js} +1 -1
  87. package/bundled-test-harness/assets/{run-realm-code-BxktQf6R.js → run-realm-code-C8N7DtN-.js} +1 -1
  88. package/bundled-test-harness/assets/{run-realm-code-test-7grpTos-.js → run-realm-code-test-DBdp147q.js} +1 -1
  89. package/bundled-test-harness/assets/{schema-generation-test-CM9ggQji.js → schema-generation-test-CB1Hb7GQ.js} +1 -1
  90. package/bundled-test-harness/assets/{scrolling-test-BER00htB.js → scrolling-test-3PhVin8h.js} +1 -1
  91. package/bundled-test-harness/assets/{searchable-option-test-Ctf8r3HZ.js → searchable-option-test-BAdOiL4U.js} +1 -1
  92. package/bundled-test-harness/assets/{sending-test-BJGobs2E.js → sending-test-KSmu1tSJ.js} +1 -1
  93. package/bundled-test-harness/assets/{skills-test-GPOsHRN6.js → skills-test-D-dlcFpd.js} +1 -1
  94. package/bundled-test-harness/assets/{store-test-QvvHimzH.js → store-test-CEW7xQjZ.js} +1 -1
  95. package/bundled-test-harness/assets/{tests-DoTEpvcF.js → tests-QYqqa6nv.js} +47 -47
  96. package/bundled-test-harness/assets/{text-input-validator-test-CYYH2N0L.js → text-input-validator-test-D8iNOWep.js} +1 -1
  97. package/bundled-test-harness/assets/{to-device-streaming-test-Ctqa0bVp.js → to-device-streaming-test-trCX-505.js} +1 -1
  98. package/bundled-test-harness/assets/{token-usage-test-BQVbK3X0.js → token-usage-test-C6sULooH.js} +1 -1
  99. package/bundled-test-harness/assets/{tools-DU8Rc15s.js → tools-UJfD-_al.js} +1 -1
  100. package/bundled-test-harness/assets/{tools-test-B13yvEKE.js → tools-test-Brav31AV.js} +1 -1
  101. package/bundled-test-harness/assets/{worker-DHBEBihX.js → worker-9ph9_Lpv.js} +31 -26
  102. package/bundled-test-harness/index.html +8 -8
  103. package/bundled-test-harness/tests/index.html +8 -8
  104. package/bundled-types/host-app/lib/realm-runner/worker.ts +8 -51
  105. package/bundled-types/runtime-common/realm-runner-script.d.ts +3 -0
  106. package/package.json +1 -1
@@ -0,0 +1,285 @@
1
+ // Pretui — ToolChangeTable: a bulk write's changes, one line per card, folded after a few.
2
+ import Component from '@glimmer/component';
3
+ import { tracked } from '@glimmer/tracking';
4
+ import { on } from '@ember/modifier';
5
+ import { fn } from '@ember/helper';
6
+ import { modifier } from 'ember-modifier';
7
+ import ArrowRight from '@cardstack/boxel-icons/arrow-right';
8
+
9
+ export interface ToolChangeRow {
10
+ /** the card the change is on: 'Lena Ruiz' */
11
+ card: string;
12
+ /** what the change was, as the card says it: 'Became a Regular'. A
13
+ * change from one value to another gives `from` and `to` instead, and
14
+ * the table draws the arrow between them */
15
+ change?: string;
16
+ /** the value before: 'Member' */
17
+ from?: string;
18
+ /** the value after: 'Regular' */
19
+ to?: string;
20
+ /** a change that did not land: 'changed since the preview' */
21
+ skipped?: string;
22
+ }
23
+
24
+ export interface ToolChangeTableSignature {
25
+ Args: {
26
+ rows: ToolChangeRow[];
27
+ /** the change column's heading. Default 'Change' */
28
+ changeLabel?: string;
29
+ /** how many rows show before "Show N more". Default 4 */
30
+ limit?: number;
31
+ /** the table's caption, for a screen reader. Default 'Changes' */
32
+ caption?: string;
33
+ /** each row gets a checkbox: the reader keeps some of a bulk write */
34
+ selectable?: boolean;
35
+ /** the cards chosen, by name; controlled */
36
+ selected?: string[];
37
+ onSelectionChange?: (cards: string[]) => void;
38
+ };
39
+ Element: HTMLDivElement;
40
+ }
41
+
42
+ /**
43
+ * What a write did to each card, for a write across many: Lena Ruiz ·
44
+ * Member to Regular, then "Show 36 more". One ToolChange says one field's
45
+ * change; this says one change across forty cards.
46
+ */
47
+ export class ToolChangeTable extends Component<ToolChangeTableSignature> {
48
+ @tracked showAll = false;
49
+ get limit() {
50
+ return this.args.limit ?? 4;
51
+ }
52
+ get shown(): ToolChangeRow[] {
53
+ return this.showAll ? this.args.rows : this.args.rows.slice(0, this.limit);
54
+ }
55
+ get more(): number {
56
+ return this.args.rows.length - this.shown.length;
57
+ }
58
+ /** set by "Show N more": the first row it reveals takes focus, since
59
+ * the button the reader pressed leaves the page */
60
+ private focusFrom: number | undefined;
61
+ expand = () => {
62
+ this.focusFrom = this.limit;
63
+ this.showAll = true;
64
+ };
65
+ focusIfFirstShown = modifier(
66
+ (element: HTMLElement, [index]: [number]) => {
67
+ if (index === this.focusFrom) {
68
+ this.focusFrom = undefined;
69
+ element.setAttribute('tabindex', '-1');
70
+ element.focus();
71
+ }
72
+ },
73
+ );
74
+ isSelected = (row: ToolChangeRow) =>
75
+ (this.args.selected ?? []).includes(row.card);
76
+ get allSelected(): boolean {
77
+ let chosen = this.args.selected ?? [];
78
+ return this.args.rows.every((r) => r.skipped || chosen.includes(r.card));
79
+ }
80
+ toggleRow = (row: ToolChangeRow, event: Event) => {
81
+ let on = (event.target as HTMLInputElement).checked;
82
+ let chosen = new Set(this.args.selected ?? []);
83
+ if (on) {
84
+ chosen.add(row.card);
85
+ } else {
86
+ chosen.delete(row.card);
87
+ }
88
+ this.args.onSelectionChange?.(
89
+ this.args.rows.map((r) => r.card).filter((c) => chosen.has(c)),
90
+ );
91
+ };
92
+ toggleAll = (event: Event) => {
93
+ let on = (event.target as HTMLInputElement).checked;
94
+ this.args.onSelectionChange?.(
95
+ on ? this.args.rows.filter((r) => !r.skipped).map((r) => r.card) : [],
96
+ );
97
+ };
98
+ <template>
99
+ <div
100
+ class='pretui-changetable'
101
+ data-test-pretui-tool-change-table
102
+ ...attributes
103
+ >
104
+ <table>
105
+ <caption class='pretui-changetable-caption'>{{if
106
+ @caption
107
+ @caption
108
+ 'Changes'
109
+ }}</caption>
110
+ <thead>
111
+ <tr>
112
+ {{#if @selectable}}<th
113
+ scope='col'
114
+ class='pretui-changetable-pick'
115
+ ><input
116
+ type='checkbox'
117
+ aria-label='Keep every change'
118
+ checked={{this.allSelected}}
119
+ {{on 'change' this.toggleAll}}
120
+ data-test-pretui-tool-change-table-all
121
+ /></th>{{/if}}
122
+ <th scope='col'>Card</th>
123
+ <th scope='col'>{{if @changeLabel @changeLabel 'Change'}}</th>
124
+ </tr>
125
+ </thead>
126
+ <tbody>
127
+ {{#each this.shown as |row index|}}
128
+ <tr
129
+ data-skipped={{if row.skipped 'true'}}
130
+ {{this.focusIfFirstShown index}}
131
+ data-test-pretui-tool-change-row={{row.card}}
132
+ >
133
+ {{#if @selectable}}<td class='pretui-changetable-pick'><input
134
+ type='checkbox'
135
+ aria-label='Keep the change to {{row.card}}'
136
+ checked={{this.isSelected row}}
137
+ disabled={{if row.skipped true}}
138
+ {{on 'change' (fn this.toggleRow row)}}
139
+ data-test-pretui-tool-change-pick={{row.card}}
140
+ /></td>{{/if}}
141
+ <th scope='row'>{{row.card}}</th>
142
+ <td>
143
+ {{#if row.to}}{{#if row.from}}<span
144
+ class='pretui-changetable-from'
145
+ >{{row.from}}</span><ArrowRight
146
+ class='pretui-changetable-arrow'
147
+ width='12'
148
+ height='12'
149
+ role='img'
150
+ aria-label='changed to'
151
+ />{{/if}}{{row.to}}{{else}}{{row.change}}{{/if}}
152
+ {{#if row.skipped}}<span
153
+ class='pretui-changetable-skipped'
154
+ >{{row.skipped}}</span>{{/if}}
155
+ </td>
156
+ </tr>
157
+ {{/each}}
158
+ </tbody>
159
+ </table>
160
+ {{#if this.more}}
161
+ <button
162
+ type='button'
163
+ class='pretui-changetable-more'
164
+ {{on 'click' this.expand}}
165
+ data-test-pretui-tool-change-table-more
166
+ >Show {{this.more}} more</button>
167
+ {{/if}}
168
+ </div>
169
+ <style scoped>
170
+ @layer PretComponent {
171
+ .pretui-changetable-from {
172
+ color: var(--subtle-foreground);
173
+ }
174
+ .pretui-changetable-arrow {
175
+ margin-inline: var(--boxel-sp-4xs);
176
+ vertical-align: -0.1em;
177
+ color: var(--subtle-foreground);
178
+ }
179
+ }
180
+ @layer PretComponent {
181
+ .pretui-changetable {
182
+ display: grid;
183
+ justify-items: start;
184
+ gap: var(--boxel-sp-4xs);
185
+ padding-inline-start: calc(
186
+ var(--pretui-toolrow-disc, var(--boxel-sp)) +
187
+ var(--pretui-toolrow-gap, var(--boxel-sp-xs))
188
+ );
189
+ }
190
+ table {
191
+ width: 100%;
192
+ border-collapse: collapse;
193
+ font-size: var(--boxel-ui-label-font-size);
194
+ line-height: var(--boxel-ui-label-line-height);
195
+ font-variant-numeric: tabular-nums;
196
+ }
197
+ .pretui-changetable-caption {
198
+ position: absolute;
199
+ width: 1px;
200
+ height: 1px;
201
+ overflow: hidden;
202
+ clip-path: inset(50%);
203
+ white-space: nowrap;
204
+ }
205
+ /* table headers are the one place tracked caps stay: sans, caption
206
+ size, 0.04em */
207
+ thead th {
208
+ padding: 0 var(--boxel-sp-xs) var(--boxel-sp-4xs) 0;
209
+ font-size: var(--boxel-caption-font-size);
210
+ line-height: var(--boxel-caption-line-height);
211
+ font-weight: 600;
212
+ letter-spacing: 0.04em;
213
+ text-align: start;
214
+ text-transform: uppercase;
215
+ color: var(--subtle-foreground);
216
+ box-shadow: inset 0 -1px 0 var(--border);
217
+ }
218
+ tbody th,
219
+ tbody td {
220
+ padding: var(--boxel-sp-4xs) var(--boxel-sp-xs) var(--boxel-sp-4xs) 0;
221
+ text-align: start;
222
+ vertical-align: baseline;
223
+ box-shadow: inset 0 -1px 0 var(--border);
224
+ }
225
+ .pretui-changetable-pick {
226
+ width: 1.25rem;
227
+ padding-inline-end: var(--boxel-sp-xs);
228
+ }
229
+ .pretui-changetable-pick input {
230
+ accent-color: var(--primary);
231
+ }
232
+ tbody th {
233
+ font-weight: 600;
234
+ color: var(--foreground);
235
+ white-space: nowrap;
236
+ }
237
+ tbody td {
238
+ color: var(--pretui-toolrow-settled-ink, var(--foreground));
239
+ }
240
+ tbody tr:last-child th,
241
+ tbody tr:last-child td {
242
+ box-shadow: none;
243
+ }
244
+ tbody tr:focus-visible {
245
+ outline: 2px solid var(--ring);
246
+ outline-offset: -2px;
247
+ }
248
+ tr[data-skipped] th,
249
+ tr[data-skipped] td {
250
+ color: var(--muted-foreground);
251
+ }
252
+ tr[data-skipped] td {
253
+ text-decoration: line-through;
254
+ }
255
+ .pretui-changetable-skipped {
256
+ display: block;
257
+ font-size: var(--boxel-caption-font-size);
258
+ line-height: var(--boxel-caption-line-height);
259
+ text-decoration: none;
260
+ color: var(--attention-ink);
261
+ }
262
+ /* 1.5rem tall, the smallest target a pointer is asked to hit */
263
+ .pretui-changetable-more {
264
+ min-height: 1.5rem;
265
+ padding: 0;
266
+ border: 0;
267
+ background-color: transparent;
268
+ font-family: inherit;
269
+ font-size: var(--boxel-caption-font-size);
270
+ line-height: var(--boxel-caption-line-height);
271
+ font-variant-numeric: tabular-nums;
272
+ color: var(--muted-foreground);
273
+ cursor: pointer;
274
+ }
275
+ .pretui-changetable-more:hover {
276
+ color: var(--primary-ink);
277
+ }
278
+ .pretui-changetable-more:focus-visible {
279
+ outline: 2px solid var(--ring);
280
+ outline-offset: 1px;
281
+ }
282
+ }
283
+ </style>
284
+ </template>
285
+ }