@cardstack/boxel-cli 0.11.0-unstable.1 → 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-QAuw0l8v.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/choreo-BEHW-NOc.js +2 -0
- package/bundled-test-harness/assets/{choreo-CJfBb_EY.js → choreo-C2cpCfhA.js} +164 -13
- package/bundled-test-harness/assets/{choreo-feature-reel-test-D2OrygZv.js → choreo-feature-reel-test-CPI_6nkT.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-w07xqtO-.js → choreo-gallery-BxA9cyzF.js} +3 -3
- package/bundled-test-harness/assets/{choreo-gallery-build-order-test-yQg4JER6.js → choreo-gallery-build-order-test-CLVoseAJ.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-compositor-test-C2THCXJN.js → choreo-gallery-compositor-test-BpT5Ia6B.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-cover-test-D4T_Tk4s.js → choreo-gallery-cover-test-DL_fdSsh.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-crossing-stage-test-tHUPJ-Hy.js → choreo-gallery-crossing-stage-test-BcKHhpOK.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-demos-alive-test-BOtBOnEZ.js → choreo-gallery-demos-alive-test-KufLhXG8.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-drift-test-D_6U1Z2c.js → choreo-gallery-drift-test-Cx58rYIA.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-escort-test-DDBU0n4C.js → choreo-gallery-escort-test-Wz-emmID.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-films-test-CgW1NSdr.js → choreo-gallery-films-test-BFrVs5WW.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-filter-test-DUIsNwdO.js → choreo-gallery-filter-test-DCKQkhwe.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-fold-test-Chzlxvdr.js → choreo-gallery-fold-test-UtpDgpG9.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-guide-pages-test-DOWnqALT.js → choreo-gallery-guide-pages-test-rXDU9JLM.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-guides-test-Dra2J4LJ.js → choreo-gallery-guides-test-DfVFdIuU.js} +3 -3
- package/bundled-test-harness/assets/{choreo-gallery-hang-test-zzn1eiB-.js → choreo-gallery-hang-test-Cj7MbkFf.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-highlight-test-CW99hncQ.js → choreo-gallery-highlight-test-D6CF3IYZ.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-inline-edit-test-CYFm1kUz.js → choreo-gallery-inline-edit-test-LfHWsbqc.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-interruption-test-CYIBrKV9.js → choreo-gallery-interruption-test-CvQQAgTp.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-lone-stack-test-DL8R3SG7.js → choreo-gallery-lone-stack-test-D7Zci7fm.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-navigation-test-Dcv04kDx.js → choreo-gallery-navigation-test-DB1EnBEW.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-playhead-transport-test-Cfz7GsXl.js → choreo-gallery-playhead-transport-test-CtBlc6AJ.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-poplayout-subtree-test-CwoklBkW.js → choreo-gallery-poplayout-subtree-test-BQbmjsvI.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-presence-modes-test-BDCIZzJ0.js → choreo-gallery-presence-modes-test-CIdXVG1K.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-presentation-test-DlyiHwFf.js → choreo-gallery-presentation-test-C_rPFp29.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-reduced-motion-test-DVz5SKNR.js → choreo-gallery-reduced-motion-test-CH5w8Lw-.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-sheet-standalone-test-CpD_-BvS.js → choreo-gallery-sheet-standalone-test-CDgI4mGX.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-sheet-test-BjvAKHDL.js → choreo-gallery-sheet-test-5lsFX7Rk.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-site-test-oq_7y_PN.js → choreo-gallery-site-test-DbMa2xeC.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-stage-Bzr4_8Xd.js → choreo-gallery-stage-b3Sk86hp.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-stage-keyboard-test-a83d2euJ.js → choreo-gallery-stage-keyboard-test-ds6fT5Eg.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-stages-test-C9Sl1kH6.js → choreo-gallery-stages-test-ahioKCct.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-subdivision-test-BVVnkOwk.js → choreo-gallery-subdivision-test-g7anTDhT.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-table-plan-test-B0YdYEA0.js → choreo-gallery-table-plan-test-Bozc4uUf.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-theater-test-BLA147xw.js → choreo-gallery-theater-test-kE535d-b.js} +3 -3
- package/bundled-test-harness/assets/{choreo-gallery-tuning-test-DSXiNzCh.js → choreo-gallery-tuning-test-6rHkQBnZ.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-widget-room-test-BI574PdO.js → choreo-gallery-widget-room-test-0Vq-uTo1.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-wires-test-B6Mz2WZl.js → choreo-gallery-wires-test-CdtnAWYO.js} +1 -1
- package/bundled-test-harness/assets/clip-BLfuHi8g.js +2 -0
- package/bundled-test-harness/assets/{clip-C_pXjVvY.js → clip-q1QE5f73.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-6ZWftYIb.js → externals-BWjhmCD4.js} +12 -12
- 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/film-B68PjRlr.js +2 -0
- package/bundled-test-harness/assets/{film-D7vtJO5q.js → film-CeUpnHN_.js} +6 -6
- package/bundled-test-harness/assets/{film-DN0A8JHx.js → film-DBZqyqW4.js} +6 -6
- package/bundled-test-harness/assets/{general-test-CX-TFDuX.js → general-test-BewzrpoB.js} +1 -1
- package/bundled-test-harness/assets/{glimmer-motion-and-choreo-in-cards-test-BHte2t9G.js → glimmer-motion-and-choreo-in-cards-test-HA-INN3d.js} +14 -14
- package/bundled-test-harness/assets/{glimmer-motion-and-choreo-test-BPNVeIio.js → glimmer-motion-and-choreo-test-BZ0ZuuAw.js} +3 -3
- package/bundled-test-harness/assets/{index-query-engine-test-Dz7Q4Xmk.js → index-query-engine-test-BtI8Y2LR.js} +1 -1
- package/bundled-test-harness/assets/{instance-filter-matcher-test-BoLU3bVg.js → instance-filter-matcher-test-BHXHGHjE.js} +1 -1
- package/bundled-test-harness/assets/{main-Dlgp8c7v.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-B0KpI1xu.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/{overlays-BnOM360u.js → overlays-BOzLbVDK.js} +1 -1
- package/bundled-test-harness/assets/{overlays-kBVfa4i8.js → overlays-C_PuGDGh.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/{plate-CFvCDv2t.js → plate-BL7UtyKE.js} +1 -1
- package/bundled-test-harness/assets/plate-CqG3igCJ.js +2 -0
- package/bundled-test-harness/assets/player-BJfsgdSI.js +2 -0
- package/bundled-test-harness/assets/{player-DzuYjrTU.js → player-Da_CIsp_.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-BMyvn_UL.js → run-D4n4LPcK.js} +96 -6
- 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-BBr5BPow.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/{src-Df148w_b.js → src-B_DEhPze.js} +4 -4
- package/bundled-test-harness/assets/{src-Cf2wv-Le.js → src-BoTgwqUA.js} +2 -2
- package/bundled-test-harness/assets/{store-test-QvvHimzH.js → store-test-CEW7xQjZ.js} +1 -1
- package/bundled-test-harness/assets/{test-support-rNHuieEc.js → test-support-FXDPpIl3.js} +1 -1
- package/bundled-test-harness/assets/{test-support-C6N_2X-l.js → test-support-VX6ukQNR.js} +1 -1
- package/bundled-test-harness/assets/{tests-CmsQ-Z_3.js → tests-QYqqa6nv.js} +84 -84
- package/bundled-test-harness/assets/{text-input-validator-test-CYYH2N0L.js → text-input-validator-test-D8iNOWep.js} +1 -1
- package/bundled-test-harness/assets/{titles-B1pTaIfP.js → titles-DFJj5O0E.js} +1 -1
- package/bundled-test-harness/assets/titles-xGlgu7ys.js +2 -0
- 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/choreo/beacons.ts +16 -4
- package/bundled-types/choreo/changeset.ts +25 -5
- package/bundled-types/choreo/choreo.gts +245 -3
- package/bundled-types/choreo/far.ts +39 -0
- package/bundled-types/choreo/index.ts +2 -0
- package/bundled-types/choreo/run.ts +104 -1
- 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
- package/bundled-test-harness/assets/choreo-B3Z9QhDH.js +0 -2
- package/bundled-test-harness/assets/clip-BjcXuTwN.js +0 -2
- package/bundled-test-harness/assets/film-DMDPP7ma.js +0 -2
- package/bundled-test-harness/assets/plate-66qnQ-M9.js +0 -2
- package/bundled-test-harness/assets/player-pygg1PwA.js +0 -2
- package/bundled-test-harness/assets/titles-Ccpcl-jq.js +0 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Pretui — toolIcon: the icon a tool call is drawn with, from boxel-icons, by the tool's name or verb.
|
|
2
|
+
import type { ComponentLike } from '@glint/template';
|
|
3
|
+
import BookOpen from '@cardstack/boxel-icons/book-open';
|
|
4
|
+
import Brain from '@cardstack/boxel-icons/brain';
|
|
5
|
+
import Code from '@cardstack/boxel-icons/code';
|
|
6
|
+
import Copy from '@cardstack/boxel-icons/copy';
|
|
7
|
+
import Database from '@cardstack/boxel-icons/database';
|
|
8
|
+
import Download from '@cardstack/boxel-icons/download';
|
|
9
|
+
import FileText from '@cardstack/boxel-icons/file-text';
|
|
10
|
+
import Globe from '@cardstack/boxel-icons/globe';
|
|
11
|
+
import HelpCircle from '@cardstack/boxel-icons/help-circle';
|
|
12
|
+
import ListChecks from '@cardstack/boxel-icons/list-checks';
|
|
13
|
+
import Pencil from '@cardstack/boxel-icons/pencil';
|
|
14
|
+
import Photo from '@cardstack/boxel-icons/photo';
|
|
15
|
+
import Search from '@cardstack/boxel-icons/search';
|
|
16
|
+
import ShieldCheck from '@cardstack/boxel-icons/shield-check';
|
|
17
|
+
import Sparkles from '@cardstack/boxel-icons/sparkles';
|
|
18
|
+
import Telescope from '@cardstack/boxel-icons/telescope';
|
|
19
|
+
import Terminal from '@cardstack/boxel-icons/terminal';
|
|
20
|
+
import Trash from '@cardstack/boxel-icons/trash-2';
|
|
21
|
+
import Upload from '@cardstack/boxel-icons/upload';
|
|
22
|
+
import Wrench from '@cardstack/boxel-icons/wrench';
|
|
23
|
+
|
|
24
|
+
export type ToolIcon = ComponentLike<{ Element: SVGSVGElement }>;
|
|
25
|
+
|
|
26
|
+
// Words in a tool's name or verb, first match wins: the more particular
|
|
27
|
+
// kinds before the general ones ('web-search' is a search, 'readUrl' a web
|
|
28
|
+
// read, 'read' a file)
|
|
29
|
+
const KINDS: [RegExp, ToolIcon][] = [
|
|
30
|
+
[new RegExp('research|investigat', 'i'), Telescope as ToolIcon],
|
|
31
|
+
[new RegExp('url|web|fetch|browse|http', 'i'), Globe as ToolIcon],
|
|
32
|
+
[new RegExp('search|find|query|grep|glob|lookup', 'i'), Search as ToolIcon],
|
|
33
|
+
[new RegExp('check|lint|test|verify|correct|validat', 'i'), ShieldCheck as ToolIcon],
|
|
34
|
+
[new RegExp('delete|remove|trash|drop', 'i'), Trash as ToolIcon],
|
|
35
|
+
[new RegExp('copy|duplicat|clone', 'i'), Copy as ToolIcon],
|
|
36
|
+
[new RegExp('edit|write|patch|update|replace|mark|set|rename', 'i'), Pencil as ToolIcon],
|
|
37
|
+
[new RegExp('script|run-realm-code|code|eval|exec', 'i'), Code as ToolIcon],
|
|
38
|
+
[new RegExp('shell|bash|terminal|command', 'i'), Terminal as ToolIcon],
|
|
39
|
+
[new RegExp('skill|read-realm|doc|guide|learn', 'i'), BookOpen as ToolIcon],
|
|
40
|
+
[new RegExp('read|open|view|load|file', 'i'), FileText as ToolIcon],
|
|
41
|
+
[new RegExp('upload|attach|send|publish|ship', 'i'), Upload as ToolIcon],
|
|
42
|
+
[new RegExp('download|export|save', 'i'), Download as ToolIcon],
|
|
43
|
+
[new RegExp('image|photo|picture|draw', 'i'), Photo as ToolIcon],
|
|
44
|
+
[new RegExp('generat|create|make|compose|draft', 'i'), Sparkles as ToolIcon],
|
|
45
|
+
[new RegExp('index|database|table|record', 'i'), Database as ToolIcon],
|
|
46
|
+
[new RegExp('plan|todo|task|step', 'i'), ListChecks as ToolIcon],
|
|
47
|
+
[new RegExp('ask|question|choose|pick', 'i'), HelpCircle as ToolIcon],
|
|
48
|
+
[new RegExp('think|reason|reflect', 'i'), Brain as ToolIcon],
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/** the icon for a tool, by its name first, then its verb; a wrench for a
|
|
52
|
+
* tool nothing names */
|
|
53
|
+
export function toolIcon(name?: string, verb?: string): ToolIcon {
|
|
54
|
+
for (let word of [name, verb]) {
|
|
55
|
+
if (!word) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
let hit = KINDS.find(([re]) => re.test(word));
|
|
59
|
+
if (hit) {
|
|
60
|
+
return hit[1];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return Wrench as ToolIcon;
|
|
64
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Pretui — ToolMeta: the call's particulars (tool · profile · elapsed · cost), quiet until asked for.
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
|
|
4
|
+
export interface ToolMetaSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** the particulars, in reading order: 'run-realm-code', 'ctse',
|
|
7
|
+
* '1m 32s', '18 credits'. Empty entries are dropped */
|
|
8
|
+
items: (string | undefined)[];
|
|
9
|
+
/** 'hover' (default): shown while the pointer or focus is in the row
|
|
10
|
+
* that holds it, and always on a touch screen; 'always': shown */
|
|
11
|
+
reveal?: 'hover' | 'always';
|
|
12
|
+
};
|
|
13
|
+
Element: HTMLDivElement;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A sans caption line of particulars for the reader who wants them. It stays in
|
|
18
|
+
* the accessibility tree while hidden (it fades, it is not removed), so a
|
|
19
|
+
* screen reader reads it with the row.
|
|
20
|
+
*
|
|
21
|
+
* ```hbs
|
|
22
|
+
* <ToolRow …><:rows>…<ToolMeta @items={{array 'run-realm-code' 'ctse' '42s' '6 credits'}} /></:rows></ToolRow>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class ToolMeta extends Component<ToolMetaSignature> {
|
|
26
|
+
get items(): string[] {
|
|
27
|
+
return this.args.items.filter((item): item is string => Boolean(item));
|
|
28
|
+
}
|
|
29
|
+
<template>
|
|
30
|
+
<div
|
|
31
|
+
class='pretui-toolmeta'
|
|
32
|
+
data-reveal={{if @reveal @reveal 'hover'}}
|
|
33
|
+
data-test-pretui-tool-meta
|
|
34
|
+
...attributes
|
|
35
|
+
>
|
|
36
|
+
{{#each this.items as |item index|}}{{#if index}}<span
|
|
37
|
+
class='pretui-toolmeta-sep'
|
|
38
|
+
aria-hidden='true'
|
|
39
|
+
> · </span>{{/if}}<span>{{item}}</span>{{/each}}
|
|
40
|
+
</div>
|
|
41
|
+
<style scoped>
|
|
42
|
+
@layer PretComponent {
|
|
43
|
+
.pretui-toolmeta {
|
|
44
|
+
padding-inline-start: calc(
|
|
45
|
+
var(--pretui-toolrow-disc, var(--boxel-sp)) +
|
|
46
|
+
var(--pretui-toolrow-gap, var(--boxel-sp-xs))
|
|
47
|
+
);
|
|
48
|
+
font-size: var(--boxel-caption-font-size);
|
|
49
|
+
line-height: var(--boxel-caption-line-height);
|
|
50
|
+
color: var(--subtle-foreground);
|
|
51
|
+
font-variant-numeric: tabular-nums;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
transition: opacity 160ms
|
|
56
|
+
var(--pretui-ease-enter, cubic-bezier(0.22, 0.61, 0.25, 1));
|
|
57
|
+
}
|
|
58
|
+
@media (hover: hover) {
|
|
59
|
+
.pretui-toolmeta[data-reveal='hover'] {
|
|
60
|
+
opacity: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
.pretui-toolmeta {
|
|
65
|
+
transition: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/* revealed by the row that holds it: a rule about another
|
|
70
|
+
component's element, so the whole selector is global, and every
|
|
71
|
+
part of it is a Pret UI name */
|
|
72
|
+
@layer PretComponent {
|
|
73
|
+
:global(.pretui-toolrow:hover .pretui-toolmeta[data-reveal='hover']),
|
|
74
|
+
:global(
|
|
75
|
+
.pretui-toolrow:focus-within .pretui-toolmeta[data-reveal='hover']
|
|
76
|
+
) {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
81
|
+
</template>
|
|
82
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// Pretui — ToolPlan: a run's plan as a checklist that ticks, on ToolRow's grid.
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { PlanMark } from './plan-mark';
|
|
4
|
+
|
|
5
|
+
export type ToolPlanStepState =
|
|
6
|
+
| 'done'
|
|
7
|
+
| 'current'
|
|
8
|
+
| 'next'
|
|
9
|
+
| 'failed'
|
|
10
|
+
| 'skipped';
|
|
11
|
+
|
|
12
|
+
export interface ToolPlanStep {
|
|
13
|
+
label: string;
|
|
14
|
+
state: ToolPlanStepState;
|
|
15
|
+
/** a quieter note after the label: "3 of 5", "kept 4" */
|
|
16
|
+
note?: string;
|
|
17
|
+
/** what the step did, one small line each under its label: "3 results
|
|
18
|
+
* for running clubs Manhattan" */
|
|
19
|
+
details?: string[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ToolPlanSignature {
|
|
23
|
+
Args: {
|
|
24
|
+
steps: ToolPlanStep[];
|
|
25
|
+
/** the list's accessible name. Default 'Plan' */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** 'compact' (default) sits in a ToolRow's disc column;
|
|
28
|
+
* 'comfortable' is a checklist read on its own, as TaskChecklist shows it */
|
|
29
|
+
density?: 'compact' | 'comfortable';
|
|
30
|
+
};
|
|
31
|
+
Element: HTMLOListElement;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const SPOKEN: Record<ToolPlanStepState, string> = {
|
|
35
|
+
done: 'done',
|
|
36
|
+
current: 'in progress',
|
|
37
|
+
next: 'not started',
|
|
38
|
+
failed: 'failed',
|
|
39
|
+
skipped: 'skipped',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The steps a run means to take, shown before it takes them, so the reader
|
|
44
|
+
* sees how far it is and what comes next:
|
|
45
|
+
*
|
|
46
|
+
* ```hbs
|
|
47
|
+
* <ToolRow @name='research' @state='running' @framed={{true}}>
|
|
48
|
+
* <:rows><ToolPlan @steps={{this.steps}} /></:rows>
|
|
49
|
+
* </ToolRow>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export class ToolPlan extends Component<ToolPlanSignature> {
|
|
53
|
+
spoken = (state: ToolPlanStepState) => SPOKEN[state];
|
|
54
|
+
get markSize(): number {
|
|
55
|
+
return this.args.density === 'comfortable' ? 16 : 14;
|
|
56
|
+
}
|
|
57
|
+
isCurrent = (state: ToolPlanStepState) =>
|
|
58
|
+
state === 'current' ? 'step' : undefined;
|
|
59
|
+
<template>
|
|
60
|
+
<ol
|
|
61
|
+
class='pretui-toolplan'
|
|
62
|
+
data-density={{if @density @density 'compact'}}
|
|
63
|
+
aria-label={{if @label @label 'Plan'}}
|
|
64
|
+
data-test-pretui-tool-plan
|
|
65
|
+
...attributes
|
|
66
|
+
>
|
|
67
|
+
{{! keyed by label: a caller that rebuilds its steps (a clock, a
|
|
68
|
+
poll) keeps each row, so a running ring keeps turning }}
|
|
69
|
+
{{#each @steps key='label' as |step|}}
|
|
70
|
+
<li
|
|
71
|
+
class='pretui-toolplan-step'
|
|
72
|
+
data-scroll-anchor
|
|
73
|
+
data-state={{step.state}}
|
|
74
|
+
aria-current={{this.isCurrent step.state}}
|
|
75
|
+
data-test-pretui-tool-plan-step={{step.state}}
|
|
76
|
+
>
|
|
77
|
+
<PlanMark
|
|
78
|
+
class='pretui-toolplan-glyph'
|
|
79
|
+
@state={{step.state}}
|
|
80
|
+
@size={{this.markSize}}
|
|
81
|
+
/>
|
|
82
|
+
<span class='pretui-toolplan-label'>
|
|
83
|
+
{{step.label}}
|
|
84
|
+
<span class='pretui-toolplan-spoken'>,
|
|
85
|
+
{{this.spoken step.state}}</span>
|
|
86
|
+
{{#if step.note}}<span
|
|
87
|
+
class='pretui-toolplan-note'
|
|
88
|
+
>{{step.note}}</span>{{/if}}
|
|
89
|
+
</span>
|
|
90
|
+
{{#if step.details.length}}
|
|
91
|
+
<ul class='pretui-toolplan-details'>
|
|
92
|
+
{{#each step.details as |detail|}}
|
|
93
|
+
<li class='pretui-toolplan-detail'>{{detail}}</li>
|
|
94
|
+
{{/each}}
|
|
95
|
+
</ul>
|
|
96
|
+
{{/if}}
|
|
97
|
+
</li>
|
|
98
|
+
{{/each}}
|
|
99
|
+
</ol>
|
|
100
|
+
<style scoped>
|
|
101
|
+
@layer PretComponent {
|
|
102
|
+
.pretui-toolplan {
|
|
103
|
+
display: grid;
|
|
104
|
+
gap: 1px;
|
|
105
|
+
margin: 0;
|
|
106
|
+
padding: 0;
|
|
107
|
+
list-style: none;
|
|
108
|
+
}
|
|
109
|
+
/* ToolLine's grid: the glyph in the disc column, the words on the
|
|
110
|
+
row's text edge */
|
|
111
|
+
.pretui-toolplan-step {
|
|
112
|
+
display: grid;
|
|
113
|
+
grid-template-columns: var(--pretui-toolrow-disc, var(--boxel-sp)) minmax(
|
|
114
|
+
0,
|
|
115
|
+
1fr
|
|
116
|
+
);
|
|
117
|
+
column-gap: var(--pretui-toolrow-gap, var(--boxel-sp-xs));
|
|
118
|
+
align-items: center;
|
|
119
|
+
font-size: var(--boxel-ui-label-font-size);
|
|
120
|
+
line-height: var(--boxel-ui-label-line-height);
|
|
121
|
+
color: var(--pretui-toolrow-settled-ink, var(--foreground));
|
|
122
|
+
}
|
|
123
|
+
.pretui-toolplan-glyph {
|
|
124
|
+
justify-self: center;
|
|
125
|
+
align-self: center;
|
|
126
|
+
}
|
|
127
|
+
/* done steps step back; the step under way and what is left keep
|
|
128
|
+
the ink, so the eye lands on the work still to do */
|
|
129
|
+
.pretui-toolplan-step[data-state='done'] {
|
|
130
|
+
color: var(--muted-foreground);
|
|
131
|
+
}
|
|
132
|
+
.pretui-toolplan-step[data-state='current'] {
|
|
133
|
+
color: var(--foreground);
|
|
134
|
+
}
|
|
135
|
+
.pretui-toolplan-step[data-state='next'] {
|
|
136
|
+
color: var(--foreground);
|
|
137
|
+
}
|
|
138
|
+
.pretui-toolplan-step[data-state='skipped'] {
|
|
139
|
+
color: var(--subtle-foreground);
|
|
140
|
+
}
|
|
141
|
+
.pretui-toolplan-step[data-state='skipped'] .pretui-toolplan-label {
|
|
142
|
+
text-decoration: line-through;
|
|
143
|
+
}
|
|
144
|
+
/* a failed step keeps ink-1: its mark carries the state */
|
|
145
|
+
.pretui-toolplan-step[data-state='failed'] {
|
|
146
|
+
color: var(--foreground);
|
|
147
|
+
}
|
|
148
|
+
.pretui-toolplan[data-density='comfortable'] {
|
|
149
|
+
gap: var(--boxel-sp-xs);
|
|
150
|
+
}
|
|
151
|
+
.pretui-toolplan[data-density='comfortable'] .pretui-toolplan-step {
|
|
152
|
+
grid-template-columns: var(--boxel-sp) minmax(0, 1fr);
|
|
153
|
+
column-gap: var(--boxel-sp-xs);
|
|
154
|
+
align-items: center;
|
|
155
|
+
}
|
|
156
|
+
.pretui-toolplan-label {
|
|
157
|
+
min-width: 0;
|
|
158
|
+
overflow-wrap: anywhere;
|
|
159
|
+
}
|
|
160
|
+
.pretui-toolplan-note {
|
|
161
|
+
margin-inline-start: var(--boxel-sp-xs);
|
|
162
|
+
font-size: var(--boxel-caption-font-size);
|
|
163
|
+
line-height: var(--boxel-caption-line-height);
|
|
164
|
+
font-weight: 400;
|
|
165
|
+
font-variant-numeric: tabular-nums;
|
|
166
|
+
color: var(--subtle-foreground);
|
|
167
|
+
}
|
|
168
|
+
/* what a step did sits under its words, smaller and quieter: it
|
|
169
|
+
belongs to the step, it is not a step of its own */
|
|
170
|
+
.pretui-toolplan-details {
|
|
171
|
+
grid-column: 2;
|
|
172
|
+
display: grid;
|
|
173
|
+
gap: var(--boxel-sp-6xs);
|
|
174
|
+
margin: var(--boxel-sp-6xs) 0 var(--boxel-sp-4xs);
|
|
175
|
+
padding: 0;
|
|
176
|
+
list-style: none;
|
|
177
|
+
font-size: var(--boxel-caption-font-size);
|
|
178
|
+
line-height: var(--boxel-caption-line-height);
|
|
179
|
+
color: var(--subtle-foreground);
|
|
180
|
+
}
|
|
181
|
+
.pretui-toolplan-detail {
|
|
182
|
+
min-width: 0;
|
|
183
|
+
overflow-wrap: anywhere;
|
|
184
|
+
}
|
|
185
|
+
/* the state in words, for a reader who does not see the glyph */
|
|
186
|
+
.pretui-toolplan-spoken {
|
|
187
|
+
position: absolute;
|
|
188
|
+
width: 1px;
|
|
189
|
+
height: 1px;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
clip-path: inset(50%);
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
</style>
|
|
196
|
+
</template>
|
|
197
|
+
}
|