@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.
- package/bundled-realms/pretui/components/agent-mark.gts +98 -0
- package/bundled-realms/pretui/components/agent-question.gts +340 -37
- package/bundled-realms/pretui/components/answer-footer.gts +249 -0
- package/bundled-realms/pretui/components/card-embed.gts +523 -0
- package/bundled-realms/pretui/components/card-pills.gts +725 -0
- package/bundled-realms/pretui/components/code-block.gts +87 -45
- package/bundled-realms/pretui/components/collapsed-turn.gts +133 -12
- package/bundled-realms/pretui/components/compaction-chip.gts +81 -67
- package/bundled-realms/pretui/components/composer-cap.gts +516 -0
- package/bundled-realms/pretui/components/context-ring.gts +108 -0
- package/bundled-realms/pretui/components/diff-block.gts +1002 -31
- package/bundled-realms/pretui/components/diff-stat.gts +102 -0
- package/bundled-realms/pretui/components/jump-chip.gts +86 -53
- package/bundled-realms/pretui/components/markdown-stream.gts +799 -0
- package/bundled-realms/pretui/components/markdown-surface.gts +71 -0
- package/bundled-realms/pretui/components/plan-mark.gts +147 -0
- package/bundled-realms/pretui/components/prose.gts +185 -8
- package/bundled-realms/pretui/components/prose.md +6 -8
- package/bundled-realms/pretui/components/quick-look.gts +377 -0
- package/bundled-realms/pretui/components/reactions.gts +136 -0
- package/bundled-realms/pretui/components/recommendation.gts +67 -36
- package/bundled-realms/pretui/components/result-card.gts +58 -22
- package/bundled-realms/pretui/components/segmented-control.gts +13 -8
- package/bundled-realms/pretui/components/session-prep.gts +12 -11
- package/bundled-realms/pretui/components/sliding-highlight.gts +8 -3
- package/bundled-realms/pretui/components/speaker-label.gts +132 -0
- package/bundled-realms/pretui/components/state-glyph.gts +121 -0
- package/bundled-realms/pretui/components/step-list.gts +62 -60
- package/bundled-realms/pretui/components/stick-to-bottom.gts +1150 -0
- package/bundled-realms/pretui/components/system-line.gts +143 -0
- package/bundled-realms/pretui/components/task-checklist.gts +184 -0
- package/bundled-realms/pretui/components/thinking.gts +63 -94
- package/bundled-realms/pretui/components/tool-change-table.gts +285 -0
- package/bundled-realms/pretui/components/tool-gate.gts +462 -0
- package/bundled-realms/pretui/components/tool-group.gts +920 -0
- package/bundled-realms/pretui/components/tool-icon.ts +64 -0
- package/bundled-realms/pretui/components/tool-meta.gts +82 -0
- package/bundled-realms/pretui/components/tool-plan.gts +197 -0
- package/bundled-realms/pretui/components/tool-row.gts +2087 -0
- package/bundled-realms/pretui/components/turn-changes.gts +227 -0
- package/bundled-realms/pretui/components/user-bubble.gts +575 -0
- package/bundled-realms/pretui/components/work-item.gts +185 -48
- package/bundled-realms/pretui/docs/scroll-anchoring-protocol.md +136 -0
- package/bundled-realms/pretui/internal/markdown-projection.ts +438 -0
- package/bundled-realms/pretui/internal/mount-queue.ts +79 -0
- package/bundled-realms/pretui/internal/tool-phrases.ts +168 -0
- package/bundled-realms/pretui/package.json +2 -1
- package/bundled-test-harness/assets/{ai-module-creation-test-beRNwH-e.js → ai-module-creation-test-B6FQKqIl.js} +1 -1
- package/bundled-test-harness/assets/{app-CtezUCip.js → app-KpPqdyX3.js} +4 -4
- package/bundled-test-harness/assets/{binary-upload-dedupe-test-bI8T0QLl.js → binary-upload-dedupe-test-DN00y1tM.js} +1 -1
- package/bundled-test-harness/assets/{can-invoke-test-DVaU_yRT.js → can-invoke-test-Bl-EUFM3.js} +1 -1
- package/bundled-test-harness/assets/{card-chooser-paging-test-DnxMnXKR.js → card-chooser-paging-test-BNuZRHX3.js} +1 -1
- package/bundled-test-harness/assets/{card-chooser-test-DUSnLr-u.js → card-chooser-test-wKfPOOT4.js} +1 -1
- package/bundled-test-harness/assets/{card-def-field-def-relationships-test-GBUr3tFK.js → card-def-field-def-relationships-test-CduQ6zan.js} +1 -1
- package/bundled-test-harness/assets/{card-delete-test-CQveO1VC.js → card-delete-test-DKxolj5o.js} +1 -1
- package/bundled-test-harness/assets/{check-correctness-test-D2M2p66N.js → check-correctness-test-B-kgHztp.js} +1 -1
- package/bundled-test-harness/assets/{codeblocks-test-AdolhdCA.js → codeblocks-test-BDD7qK_V.js} +1 -1
- package/bundled-test-harness/assets/{compaction-test-DvyAQq56.js → compaction-test-BweolkhG.js} +1 -1
- package/bundled-test-harness/assets/{container-DIF_9lZ9.css → container-B5B6u-xm.css} +29 -22
- package/bundled-test-harness/assets/{container-DvvqmNpg.js → container-BnJjIM6J.js} +9 -6
- package/bundled-test-harness/assets/{create-listing-modal-test-D95JfQab.js → create-listing-modal-test-FvcAKpIa.js} +1 -1
- package/bundled-test-harness/assets/{debug-message-test-BcNtj7Wr.js → debug-message-test-CJ18Evt7.js} +1 -1
- package/bundled-test-harness/assets/{externals-DCnB4XSS.js → externals-BWjhmCD4.js} +1 -1
- package/bundled-test-harness/assets/{fallback-banner-live-delete-test-5lnN1pv2.js → fallback-banner-live-delete-test-C2H3BrT-.js} +1 -1
- package/bundled-test-harness/assets/{fallback-banner-test-DFb_m_Kq.js → fallback-banner-test-C10aYjkj.js} +1 -1
- package/bundled-test-harness/assets/{fallback-models-test-p3YIwj1L.js → fallback-models-test-BxoPiaGF.js} +1 -1
- package/bundled-test-harness/assets/{file-attachment-test-CmyjNWRR.js → file-attachment-test-DeKyzYaz.js} +1 -1
- package/bundled-test-harness/assets/{general-test-CX-TFDuX.js → general-test-BewzrpoB.js} +1 -1
- package/bundled-test-harness/assets/{index-query-engine-test-CY2tAkot.js → index-query-engine-test-BtI8Y2LR.js} +1 -1
- package/bundled-test-harness/assets/{instance-filter-matcher-test-CMBTh8xn.js → instance-filter-matcher-test-BHXHGHjE.js} +1 -1
- package/bundled-test-harness/assets/{main-BOZbZVem.js → main-CqAHZ2kK.js} +1 -1
- package/bundled-test-harness/assets/{message-tool-test-CfjRSJvt.js → message-tool-test-NMaPJFsd.js} +1 -1
- package/bundled-test-harness/assets/{model-cost-tier-test-mZG84Uso.js → model-cost-tier-test-BgbfN2LH.js} +1 -1
- package/bundled-test-harness/assets/{operation-lowering-test-CHnjKSJb.js → operation-lowering-test-C4IaOjsA.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-card-chooser-test-KWS8lq16.js → operator-mode-card-chooser-test-Bwe47Rn7.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-links-test-CViFt0Ws.js → operator-mode-links-test-BU4jkC-B.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-test-D0gZM2yw.js → operator-mode-test-Bh0rGM9z.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-ui-test-CEvHJ9DS.js → operator-mode-ui-test-whgUw0ju.js} +1 -1
- package/bundled-test-harness/assets/{overlay-menu-items-test-Pw80RXsr.js → overlay-menu-items-test-Cwn1vr8q.js} +1 -1
- package/bundled-test-harness/assets/{past-sessions-test-CW0-Bjav.js → past-sessions-test-Bh24N-Kz.js} +1 -1
- package/bundled-test-harness/assets/{permission-checking-realm-test-D5uXQypS.js → permission-checking-realm-test-DKnnAy0f.js} +1 -1
- package/bundled-test-harness/assets/{realm-config-policy-standing-test-Btatheni.js → realm-config-policy-standing-test-DngdYypq.js} +1 -1
- package/bundled-test-harness/assets/{realm-config-routing-rule-edit-test-Dh5zW13o.js → realm-config-routing-rule-edit-test-_rkFU8SN.js} +1 -1
- package/bundled-test-harness/assets/{realm-config-settings-test-BJa8gv_C.js → realm-config-settings-test-CR9NH0Zn.js} +1 -1
- package/bundled-test-harness/assets/{reasoning-test-2Zp37cQB.js → reasoning-test-0lH10kRl.js} +1 -1
- package/bundled-test-harness/assets/{room-message-test-BsrON13e.js → room-message-test-C-PddE4Y.js} +1 -1
- package/bundled-test-harness/assets/{run-realm-code-BxktQf6R.js → run-realm-code-C8N7DtN-.js} +1 -1
- package/bundled-test-harness/assets/{run-realm-code-test-7grpTos-.js → run-realm-code-test-DBdp147q.js} +1 -1
- package/bundled-test-harness/assets/{schema-generation-test-CM9ggQji.js → schema-generation-test-CB1Hb7GQ.js} +1 -1
- package/bundled-test-harness/assets/{scrolling-test-BER00htB.js → scrolling-test-3PhVin8h.js} +1 -1
- package/bundled-test-harness/assets/{searchable-option-test-Ctf8r3HZ.js → searchable-option-test-BAdOiL4U.js} +1 -1
- package/bundled-test-harness/assets/{sending-test-BJGobs2E.js → sending-test-KSmu1tSJ.js} +1 -1
- package/bundled-test-harness/assets/{skills-test-GPOsHRN6.js → skills-test-D-dlcFpd.js} +1 -1
- package/bundled-test-harness/assets/{store-test-QvvHimzH.js → store-test-CEW7xQjZ.js} +1 -1
- package/bundled-test-harness/assets/{tests-DoTEpvcF.js → tests-QYqqa6nv.js} +47 -47
- package/bundled-test-harness/assets/{text-input-validator-test-CYYH2N0L.js → text-input-validator-test-D8iNOWep.js} +1 -1
- package/bundled-test-harness/assets/{to-device-streaming-test-Ctqa0bVp.js → to-device-streaming-test-trCX-505.js} +1 -1
- package/bundled-test-harness/assets/{token-usage-test-BQVbK3X0.js → token-usage-test-C6sULooH.js} +1 -1
- package/bundled-test-harness/assets/{tools-DU8Rc15s.js → tools-UJfD-_al.js} +1 -1
- package/bundled-test-harness/assets/{tools-test-B13yvEKE.js → tools-test-Brav31AV.js} +1 -1
- package/bundled-test-harness/assets/{worker-DHBEBihX.js → worker-9ph9_Lpv.js} +31 -26
- package/bundled-test-harness/index.html +8 -8
- package/bundled-test-harness/tests/index.html +8 -8
- package/bundled-types/host-app/lib/realm-runner/worker.ts +8 -51
- package/bundled-types/runtime-common/realm-runner-script.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// Pretui — TurnChanges: the files a turn changed, each with its size, and Review.
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import CheckIcon from '@cardstack/boxel-icons/check';
|
|
4
|
+
import { on } from '@ember/modifier';
|
|
5
|
+
import { fn } from '@ember/helper';
|
|
6
|
+
import { DiffStat } from './diff-stat';
|
|
7
|
+
import { VisuallyHidden } from './visually-hidden';
|
|
8
|
+
|
|
9
|
+
export interface ChangedFile {
|
|
10
|
+
path: string;
|
|
11
|
+
added: number;
|
|
12
|
+
removed: number;
|
|
13
|
+
/** 'modified' (default), 'added', 'deleted', 'renamed' */
|
|
14
|
+
status?: 'modified' | 'added' | 'deleted' | 'renamed';
|
|
15
|
+
/** the review's verdict on the file, once there is one */
|
|
16
|
+
state?: 'kept' | 'reverted';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TurnChangesSignature {
|
|
20
|
+
Args: {
|
|
21
|
+
files: ChangedFile[];
|
|
22
|
+
/** open one file's diff */
|
|
23
|
+
onOpen?: (file: ChangedFile) => void;
|
|
24
|
+
/** open the review of them all */
|
|
25
|
+
onReview?: () => void;
|
|
26
|
+
/** the file shown in a review, highlighted */
|
|
27
|
+
selected?: string;
|
|
28
|
+
};
|
|
29
|
+
Element: HTMLDivElement;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const STATUS: Record<string, { letter: string; word: string }> = {
|
|
33
|
+
added: { letter: 'A', word: 'Added' },
|
|
34
|
+
deleted: { letter: 'D', word: 'Deleted' },
|
|
35
|
+
renamed: { letter: 'R', word: 'Renamed' },
|
|
36
|
+
modified: { letter: 'M', word: 'Modified' },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* "3 files changed +24 −7 · Review" over the files a turn touched, each a
|
|
41
|
+
* row with its status letter, path and DiffStat. The letter is for the eye;
|
|
42
|
+
* a screen reader hears the status as a word. A row opens its file; the
|
|
43
|
+
* header opens the review of all of them.
|
|
44
|
+
*/
|
|
45
|
+
export class TurnChanges extends Component<TurnChangesSignature> {
|
|
46
|
+
get added() {
|
|
47
|
+
return this.args.files.reduce((n, f) => n + f.added, 0);
|
|
48
|
+
}
|
|
49
|
+
get removed() {
|
|
50
|
+
return this.args.files.reduce((n, f) => n + f.removed, 0);
|
|
51
|
+
}
|
|
52
|
+
get summary(): string {
|
|
53
|
+
let n = this.args.files.length;
|
|
54
|
+
return `${n} ${n === 1 ? 'file' : 'files'} changed`;
|
|
55
|
+
}
|
|
56
|
+
letter = (file: ChangedFile) => STATUS[file.status ?? 'modified']?.letter;
|
|
57
|
+
statusWord = (file: ChangedFile) => STATUS[file.status ?? 'modified']?.word;
|
|
58
|
+
isSelected = (file: ChangedFile) => file.path === this.args.selected;
|
|
59
|
+
open = (file: ChangedFile) => this.args.onOpen?.(file);
|
|
60
|
+
review = () => this.args.onReview?.();
|
|
61
|
+
isKept = (file: ChangedFile) => file.state === 'kept';
|
|
62
|
+
<template>
|
|
63
|
+
<div class='pretui-turnchanges' data-test-pretui-turn-changes ...attributes>
|
|
64
|
+
<div class='pretui-turnchanges-head'>
|
|
65
|
+
<span class='pretui-turnchanges-summary'>{{this.summary}}</span>
|
|
66
|
+
<DiffStat
|
|
67
|
+
@added={{this.added}}
|
|
68
|
+
@removed={{this.removed}}
|
|
69
|
+
@blocks={{0}}
|
|
70
|
+
/>
|
|
71
|
+
{{#if @onReview}}<button
|
|
72
|
+
type='button'
|
|
73
|
+
class='pretui-turnchanges-review'
|
|
74
|
+
{{on 'click' this.review}}
|
|
75
|
+
data-test-pretui-turn-changes-review
|
|
76
|
+
>Review</button>{{/if}}
|
|
77
|
+
</div>
|
|
78
|
+
<ul class='pretui-turnchanges-list' aria-label='Changed files'>
|
|
79
|
+
{{#each @files as |file|}}
|
|
80
|
+
<li>
|
|
81
|
+
<button
|
|
82
|
+
type='button'
|
|
83
|
+
class='pretui-turnchanges-file'
|
|
84
|
+
aria-current={{if (this.isSelected file) 'true'}}
|
|
85
|
+
data-status={{if file.status file.status 'modified'}}
|
|
86
|
+
data-state={{file.state}}
|
|
87
|
+
{{on 'click' (fn this.open file)}}
|
|
88
|
+
data-test-pretui-turn-changes-file={{file.path}}
|
|
89
|
+
>
|
|
90
|
+
<span
|
|
91
|
+
class='pretui-turnchanges-letter'
|
|
92
|
+
aria-hidden='true'
|
|
93
|
+
>{{this.letter file}}</span>
|
|
94
|
+
<VisuallyHidden
|
|
95
|
+
data-test-pretui-turn-changes-status
|
|
96
|
+
>{{this.statusWord file}}</VisuallyHidden>
|
|
97
|
+
<span class='pretui-turnchanges-path'>{{file.path}}</span>
|
|
98
|
+
{{#if file.state}}<span class='pretui-turnchanges-state'>{{#if
|
|
99
|
+
(this.isKept file)
|
|
100
|
+
}}<CheckIcon
|
|
101
|
+
width='11'
|
|
102
|
+
height='11'
|
|
103
|
+
aria-hidden='true'
|
|
104
|
+
/>{{/if}}{{file.state}}</span>{{/if}}
|
|
105
|
+
<DiffStat @added={{file.added}} @removed={{file.removed}} />
|
|
106
|
+
</button>
|
|
107
|
+
</li>
|
|
108
|
+
{{/each}}
|
|
109
|
+
</ul>
|
|
110
|
+
</div>
|
|
111
|
+
<style scoped>
|
|
112
|
+
@layer PretComponent {
|
|
113
|
+
.pretui-turnchanges {
|
|
114
|
+
display: grid;
|
|
115
|
+
gap: var(--boxel-sp-6xs);
|
|
116
|
+
font-size: var(--boxel-ui-label-font-size);
|
|
117
|
+
line-height: var(--boxel-ui-label-line-height);
|
|
118
|
+
}
|
|
119
|
+
.pretui-turnchanges-head {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: var(--boxel-sp-xs);
|
|
123
|
+
min-height: 1.75rem;
|
|
124
|
+
}
|
|
125
|
+
.pretui-turnchanges-summary {
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
color: var(--foreground);
|
|
128
|
+
}
|
|
129
|
+
.pretui-turnchanges-review {
|
|
130
|
+
margin-inline-start: auto;
|
|
131
|
+
height: 1.75rem;
|
|
132
|
+
padding: 0 var(--boxel-sp-sm);
|
|
133
|
+
border: 0;
|
|
134
|
+
border-radius: var(--boxel-border-radius-sm);
|
|
135
|
+
background-color: transparent;
|
|
136
|
+
box-shadow: inset 0 0 0 1px var(--border-strong);
|
|
137
|
+
font-family: inherit;
|
|
138
|
+
font-size: inherit;
|
|
139
|
+
line-height: inherit;
|
|
140
|
+
font-weight: 400;
|
|
141
|
+
color: var(--foreground);
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
}
|
|
144
|
+
.pretui-turnchanges-review:hover {
|
|
145
|
+
color: var(--primary-ink);
|
|
146
|
+
}
|
|
147
|
+
.pretui-turnchanges-list {
|
|
148
|
+
display: grid;
|
|
149
|
+
margin: 0;
|
|
150
|
+
padding: 0;
|
|
151
|
+
list-style: none;
|
|
152
|
+
}
|
|
153
|
+
.pretui-turnchanges-file {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: var(--boxel-sp-xs);
|
|
157
|
+
width: 100%;
|
|
158
|
+
min-height: 1.75rem;
|
|
159
|
+
padding: 0 var(--boxel-sp-xs);
|
|
160
|
+
border: 0;
|
|
161
|
+
border-radius: var(--boxel-border-radius-sm);
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
font-family: inherit;
|
|
164
|
+
font-size: inherit;
|
|
165
|
+
line-height: inherit;
|
|
166
|
+
text-align: start;
|
|
167
|
+
color: var(--pretui-toolrow-settled-ink, var(--foreground));
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
}
|
|
170
|
+
.pretui-turnchanges-file:hover,
|
|
171
|
+
.pretui-turnchanges-file[aria-current='true'] {
|
|
172
|
+
background-color: var(--hover);
|
|
173
|
+
color: var(--foreground);
|
|
174
|
+
}
|
|
175
|
+
.pretui-turnchanges-file:focus-visible,
|
|
176
|
+
.pretui-turnchanges-review:focus-visible {
|
|
177
|
+
outline: 2px solid var(--ring);
|
|
178
|
+
outline-offset: 1px;
|
|
179
|
+
}
|
|
180
|
+
/* the status letter is the row's mark, not a string to paste: sans */
|
|
181
|
+
.pretui-turnchanges-letter {
|
|
182
|
+
width: 0.75rem;
|
|
183
|
+
font-size: var(--boxel-caption-font-size);
|
|
184
|
+
line-height: var(--boxel-caption-line-height);
|
|
185
|
+
font-weight: 600;
|
|
186
|
+
color: var(--muted-foreground);
|
|
187
|
+
}
|
|
188
|
+
.pretui-turnchanges-file[data-status='added']
|
|
189
|
+
.pretui-turnchanges-letter {
|
|
190
|
+
color: var(--success-ink);
|
|
191
|
+
}
|
|
192
|
+
.pretui-turnchanges-file[data-status='deleted']
|
|
193
|
+
.pretui-turnchanges-letter {
|
|
194
|
+
color: var(--destructive-ink);
|
|
195
|
+
}
|
|
196
|
+
.pretui-turnchanges-path {
|
|
197
|
+
flex: 1 1 auto;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
text-overflow: ellipsis;
|
|
201
|
+
white-space: nowrap;
|
|
202
|
+
/* a path is a pasteable string: mono at the data size */
|
|
203
|
+
font-family: var(--font-mono);
|
|
204
|
+
font-size: var(--boxel-font-size-xs);
|
|
205
|
+
line-height: var(--boxel-line-height-xs);
|
|
206
|
+
}
|
|
207
|
+
.pretui-turnchanges-file[data-state='reverted']
|
|
208
|
+
.pretui-turnchanges-path {
|
|
209
|
+
text-decoration: line-through;
|
|
210
|
+
color: var(--muted-foreground);
|
|
211
|
+
}
|
|
212
|
+
.pretui-turnchanges-state {
|
|
213
|
+
font-size: var(--boxel-caption-font-size);
|
|
214
|
+
line-height: var(--boxel-caption-line-height);
|
|
215
|
+
color: var(--muted-foreground);
|
|
216
|
+
}
|
|
217
|
+
/* kept is done: ink with a check, not green */
|
|
218
|
+
.pretui-turnchanges-file[data-state='kept'] .pretui-turnchanges-state {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: var(--boxel-sp-4xs);
|
|
222
|
+
color: var(--foreground);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
</style>
|
|
226
|
+
</template>
|
|
227
|
+
}
|