@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,249 @@
1
+ // Pretui — AnswerFooter: the quiet actions under an assistant's final reply.
2
+ import Component from '@glimmer/component';
3
+ import XIcon from '@cardstack/boxel-icons/x';
4
+ import { tracked } from '@glimmer/tracking';
5
+ import { on } from '@ember/modifier';
6
+ import { CopyButton } from './copy-button';
7
+ import { VisuallyHidden } from './visually-hidden';
8
+
9
+ export interface AnswerFooterDiff {
10
+ files: number;
11
+ added: number;
12
+ removed: number;
13
+ }
14
+
15
+ export interface AnswerFooterSignature {
16
+ Args: {
17
+ /** the reply as markdown, for Copy */
18
+ text: string;
19
+ /** keep the reply as a card; resolves to the saved card's name, which
20
+ * the same button then shows, and opens with `@onOpenSaved` */
21
+ onSave?: () => Promise<string | void>;
22
+ /** open what was saved */
23
+ onOpenSaved?: () => void;
24
+ /** what the turn changed, summed; its button opens the review */
25
+ diff?: AnswerFooterDiff;
26
+ onReview?: (from: HTMLElement) => void;
27
+ /** ask again */
28
+ onRetry?: () => void;
29
+ /** what the turn cost, as the caller words it: '18 credits' */
30
+ cost?: string;
31
+ /** a later answer took over: the footer keeps its space but steps out
32
+ * of sight until the pointer or focus comes to it (or to whatever the
33
+ * host lets set `--pretui-answerfooter-reveal: 1`) */
34
+ superseded?: boolean;
35
+ };
36
+ Element: HTMLDivElement;
37
+ }
38
+
39
+ /**
40
+ * Copy · Save as card · 1 file +3 −1 · Review · Retry ··· 18 credits.
41
+ * Always there, in the muted ink, so it takes its line without competing
42
+ * with the answer above it; each action takes the foreground under the
43
+ * pointer or focus.
44
+ */
45
+ export class AnswerFooter extends Component<AnswerFooterSignature> {
46
+ @tracked saving = false;
47
+ @tracked savedName: string | undefined;
48
+ @tracked saveError: string | undefined;
49
+
50
+ get files(): string {
51
+ let n = this.args.diff?.files ?? 0;
52
+ return `${n} ${n === 1 ? 'file' : 'files'}`;
53
+ }
54
+
55
+ save = async () => {
56
+ if (!this.args.onSave || this.saving || this.savedName) {
57
+ return;
58
+ }
59
+ this.saving = true;
60
+ this.saveError = undefined;
61
+ try {
62
+ this.savedName = (await this.args.onSave()) || 'card';
63
+ } catch (e) {
64
+ this.saveError = e instanceof Error ? e.message : String(e);
65
+ } finally {
66
+ if (!this.isDestroying && !this.isDestroyed) {
67
+ this.saving = false;
68
+ }
69
+ }
70
+ };
71
+ openSaved = () => this.args.onOpenSaved?.();
72
+ /** one button saves, waits and then opens what was saved, so focus stays
73
+ * on it through each step */
74
+ pressSave = () => (this.savedName ? this.openSaved() : this.save());
75
+ get saveText(): string {
76
+ if (this.savedName) {
77
+ return `Saved · ${this.savedName}`;
78
+ }
79
+ return this.saving ? 'Saving…' : 'Save as card';
80
+ }
81
+ /** what the status region says: the outcome of a save, once */
82
+ get saveAnnouncement(): string {
83
+ if (this.savedName) {
84
+ return `Saved as ${this.savedName}`;
85
+ }
86
+ return this.saveError ? `Couldn’t save: ${this.saveError}` : '';
87
+ }
88
+ review = (event: Event) =>
89
+ this.args.onReview?.(event.currentTarget as HTMLElement);
90
+ retry = () => this.args.onRetry?.();
91
+
92
+ <template>
93
+ <div
94
+ class='pretui-answerfooter'
95
+ data-superseded={{if @superseded 'true'}}
96
+ data-test-pretui-answer-footer
97
+ ...attributes
98
+ >
99
+ <CopyButton
100
+ class='pretui-answerfooter-copy'
101
+ @text={{@text}}
102
+ @label='Copy answer'
103
+ @appearance='plain'
104
+ @size='s'
105
+ data-test-pretui-answer-copy
106
+ />
107
+ {{#if @onSave}}
108
+ {{! aria-disabled, not disabled, while saving: a disabled button
109
+ drops focus to the page }}
110
+ <button
111
+ type='button'
112
+ class='pretui-answerfooter-action'
113
+ aria-disabled={{if this.saving 'true'}}
114
+ aria-busy={{if this.saving 'true'}}
115
+ data-saved={{if this.savedName 'true'}}
116
+ {{on 'click' this.pressSave}}
117
+ data-test-pretui-answer-save
118
+ >{{this.saveText}}</button>
119
+ <VisuallyHidden
120
+ role='status'
121
+ aria-atomic='true'
122
+ data-test-pretui-answer-save-status
123
+ >{{this.saveAnnouncement}}</VisuallyHidden>
124
+ {{/if}}
125
+ {{#if @diff}}
126
+ <button
127
+ type='button'
128
+ class='pretui-answerfooter-action'
129
+ data-diff='true'
130
+ {{on 'click' this.review}}
131
+ data-test-pretui-answer-diff
132
+ >{{this.files}}
133
+ <span
134
+ class='pretui-answerfooter-count'
135
+ data-op='add'
136
+ >+{{@diff.added}}</span>
137
+ <span
138
+ class='pretui-answerfooter-count'
139
+ data-op='del'
140
+ >−{{@diff.removed}}</span>
141
+ · Review</button>
142
+ {{/if}}
143
+ {{#if @onRetry}}
144
+ <button
145
+ type='button'
146
+ class='pretui-answerfooter-action'
147
+ {{on 'click' this.retry}}
148
+ data-test-pretui-answer-retry
149
+ >Retry</button>
150
+ {{/if}}
151
+ {{#if this.saveError}}
152
+ <span
153
+ class='pretui-answerfooter-error'
154
+ data-test-pretui-answer-save-error
155
+ ><XIcon
156
+ class='pretui-answerfooter-error-mark'
157
+ width='11'
158
+ height='11'
159
+ aria-hidden='true'
160
+ />{{this.saveError}}</span>
161
+ {{/if}}
162
+ {{#if @cost}}
163
+ <span
164
+ class='pretui-answerfooter-cost'
165
+ data-test-pretui-answer-cost
166
+ >{{@cost}}</span>
167
+ {{/if}}
168
+ </div>
169
+ <style scoped>
170
+ @layer PretComponent {
171
+ .pretui-answerfooter[data-superseded] {
172
+ opacity: var(--pretui-answerfooter-reveal, 0);
173
+ transition: opacity var(--pretui-dur-snap, 130ms) ease-out;
174
+ }
175
+ .pretui-answerfooter[data-superseded]:is(:hover, :focus-within) {
176
+ opacity: 1;
177
+ }
178
+ .pretui-answerfooter {
179
+ display: flex;
180
+ flex-wrap: wrap;
181
+ align-items: center;
182
+ gap: var(--boxel-sp-6xs);
183
+ min-height: 1.75rem;
184
+ /* plain-row hang: the first action's text stays on the edge */
185
+ margin-inline-start: calc(-1 * var(--boxel-sp-xs));
186
+ font-size: var(--boxel-ui-label-font-size);
187
+ line-height: var(--boxel-ui-label-line-height);
188
+ color: var(--subtle-foreground);
189
+ }
190
+ .pretui-answerfooter-copy {
191
+ color: inherit;
192
+ }
193
+ .pretui-answerfooter-action {
194
+ height: 1.75rem;
195
+ padding: 0 var(--boxel-sp-xs);
196
+ border: 0;
197
+ border-radius: var(--boxel-border-radius-sm);
198
+ background-color: transparent;
199
+ font-family: inherit;
200
+ font-size: var(--boxel-ui-label-font-size);
201
+ line-height: var(--boxel-ui-label-line-height);
202
+ font-weight: 400;
203
+ color: inherit;
204
+ cursor: pointer;
205
+ white-space: nowrap;
206
+ }
207
+ .pretui-answerfooter-action:hover:not([aria-disabled='true']) {
208
+ background-color: var(--hover);
209
+ color: var(--primary-ink);
210
+ }
211
+ .pretui-answerfooter-action:focus-visible {
212
+ outline: 2px solid var(--ring);
213
+ outline-offset: -2px;
214
+ }
215
+ .pretui-answerfooter-action[aria-disabled='true'] {
216
+ cursor: default;
217
+ }
218
+ .pretui-answerfooter-action[data-diff] {
219
+ font-variant-numeric: tabular-nums;
220
+ }
221
+ .pretui-answerfooter-count[data-op='add'] {
222
+ color: var(--success-ink);
223
+ }
224
+ .pretui-answerfooter-count[data-op='del'] {
225
+ color: var(--destructive-ink);
226
+ }
227
+ /* a failure colours its mark, not its words */
228
+ .pretui-answerfooter-error {
229
+ font-size: var(--boxel-caption-font-size);
230
+ line-height: var(--boxel-caption-line-height);
231
+ color: var(--foreground);
232
+ }
233
+ .pretui-answerfooter-error-mark {
234
+ margin-inline-end: var(--boxel-sp-4xs);
235
+ vertical-align: -0.0625rem;
236
+ color: var(--destructive-ink);
237
+ }
238
+ /* a receipt, not a string to paste: sans with tabular figures */
239
+ .pretui-answerfooter-cost {
240
+ margin-inline-start: auto;
241
+ padding-inline-end: var(--boxel-sp-6xs);
242
+ font-size: var(--boxel-caption-font-size);
243
+ line-height: var(--boxel-caption-line-height);
244
+ font-variant-numeric: tabular-nums;
245
+ }
246
+ }
247
+ </style>
248
+ </template>
249
+ }