@justanarthur/modo-ui-ai 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/LICENSE.fluid-functionalism +21 -0
- package/README.md +105 -2
- package/blocks/conversation/agent-prompt/examples.mdx +44 -0
- package/blocks/conversation/agent-prompt/index.tsx +114 -0
- package/blocks/conversation/composer/draft.css +25 -0
- package/blocks/conversation/composer/draft.tsx +589 -0
- package/blocks/conversation/composer/examples.mdx +114 -0
- package/blocks/conversation/composer/file-preview-tile.tsx +59 -0
- package/blocks/conversation/composer/file-thumbnail.tsx +146 -0
- package/blocks/conversation/composer/index.tsx +517 -0
- package/blocks/conversation/composer/queued-row.tsx +102 -0
- package/blocks/conversation/composer/shared.ts +38 -0
- package/blocks/conversation/composer/suggestion-row.tsx +64 -0
- package/blocks/conversation/composer/use-composer-files.ts +142 -0
- package/blocks/conversation/composer/use-history-nav.ts +60 -0
- package/blocks/conversation/composer/use-message-queue.ts +108 -0
- package/blocks/conversation/composer/use-region-height.ts +34 -0
- package/blocks/conversation/failure-states/examples.mdx +58 -0
- package/blocks/conversation/failure-states/index.tsx +274 -0
- package/blocks/conversation/transcript/examples.mdx +43 -0
- package/blocks/conversation/transcript/index.tsx +204 -0
- package/blocks/conversation/transcript-search/examples.mdx +50 -0
- package/blocks/conversation/transcript-search/index.tsx +469 -0
- package/blocks/dialogs/command-palette/examples.mdx +33 -0
- package/blocks/dialogs/command-palette/index.tsx +232 -0
- package/blocks/dialogs/hook-dialog/examples.mdx +44 -0
- package/blocks/dialogs/hook-dialog/index.tsx +286 -0
- package/blocks/dialogs/mcp-server-dialog/examples.mdx +57 -0
- package/blocks/dialogs/mcp-server-dialog/index.tsx +415 -0
- package/blocks/dialogs/shortcuts-sheet/examples.mdx +36 -0
- package/blocks/dialogs/shortcuts-sheet/index.tsx +186 -0
- package/blocks/panes/artifacts-pane/examples.mdx +23 -0
- package/blocks/panes/artifacts-pane/index.tsx +82 -0
- package/blocks/panes/changes-pane/examples.mdx +23 -0
- package/blocks/panes/changes-pane/index.tsx +248 -0
- package/blocks/panes/file-pane/examples.mdx +13 -0
- package/blocks/panes/file-pane/index.tsx +102 -0
- package/blocks/panes/pr-pane/examples.mdx +13 -0
- package/blocks/panes/pr-pane/index.tsx +191 -0
- package/blocks/panes/side-pane/examples.mdx +58 -0
- package/blocks/panes/side-pane/index.tsx +187 -0
- package/blocks/panes/tasks-pane/examples.mdx +23 -0
- package/blocks/panes/tasks-pane/index.tsx +127 -0
- package/blocks/panes/terminal-pane/examples.mdx +13 -0
- package/blocks/panes/terminal-pane/index.tsx +99 -0
- package/blocks/panes/usage-pane/examples.mdx +13 -0
- package/blocks/panes/usage-pane/index.tsx +75 -0
- package/blocks/profiles/profile-onboarding/examples.mdx +80 -0
- package/blocks/profiles/profile-onboarding/index.tsx +580 -0
- package/blocks/profiles/profile-switcher/examples.mdx +18 -0
- package/blocks/profiles/profile-switcher/index.tsx +197 -0
- package/blocks/profiles/profile-usage/examples.mdx +21 -0
- package/blocks/profiles/profile-usage/index.tsx +127 -0
- package/blocks/sessions/inbox/examples.mdx +35 -0
- package/blocks/sessions/inbox/index.tsx +372 -0
- package/blocks/sessions/session-board/examples.mdx +34 -0
- package/blocks/sessions/session-board/index.tsx +570 -0
- package/blocks/sessions/session-sidebar/examples.mdx +43 -0
- package/blocks/sessions/session-sidebar/index.tsx +442 -0
- package/blocks/settings/extensions/examples.mdx +10 -0
- package/blocks/settings/extensions/index.tsx +72 -0
- package/blocks/settings/hooks/examples.mdx +16 -0
- package/blocks/settings/hooks/index.tsx +127 -0
- package/blocks/settings/mcp-servers/examples.mdx +26 -0
- package/blocks/settings/mcp-servers/index.tsx +204 -0
- package/blocks/settings/memory/examples.mdx +22 -0
- package/blocks/settings/memory/index.tsx +113 -0
- package/blocks/settings/notifications/examples.mdx +8 -0
- package/blocks/settings/notifications/index.tsx +63 -0
- package/blocks/settings/permission-rules/examples.mdx +37 -0
- package/blocks/settings/permission-rules/index.tsx +317 -0
- package/blocks/settings/plugin-catalog/examples.mdx +52 -0
- package/blocks/settings/plugin-catalog/index.tsx +407 -0
- package/blocks/settings/plugins/examples.mdx +10 -0
- package/blocks/settings/plugins/index.tsx +72 -0
- package/blocks/settings/settings-window/examples.mdx +40 -0
- package/blocks/settings/settings-window/index.tsx +188 -0
- package/blocks/settings/worktrees/examples.mdx +17 -0
- package/blocks/settings/worktrees/index.tsx +145 -0
- package/components/conversation/agent-run/examples.mdx +30 -0
- package/components/conversation/agent-run/index.tsx +82 -0
- package/components/conversation/chapter-nav/examples.mdx +30 -0
- package/components/conversation/chapter-nav/index.tsx +123 -0
- package/components/conversation/message/examples.mdx +53 -0
- package/components/conversation/message/index.tsx +128 -0
- package/components/conversation/message/working.tsx +102 -0
- package/components/conversation/reasoning/examples.mdx +22 -0
- package/components/conversation/reasoning/index.tsx +54 -0
- package/components/conversation/recap/examples.mdx +21 -0
- package/components/conversation/recap/index.tsx +67 -0
- package/components/conversation/todo-list/examples.mdx +32 -0
- package/components/conversation/todo-list/index.tsx +106 -0
- package/components/conversation/tool-call/examples.mdx +48 -0
- package/components/conversation/tool-call/index.tsx +142 -0
- package/components/conversation/work-summary/examples.mdx +50 -0
- package/components/conversation/work-summary/index.tsx +87 -0
- package/components/prompts/permission-request/examples.mdx +32 -0
- package/components/prompts/permission-request/index.tsx +74 -0
- package/components/prompts/plan-approval/examples.mdx +37 -0
- package/components/prompts/plan-approval/index.tsx +76 -0
- package/components/prompts/prompt-card/examples.mdx +31 -0
- package/components/prompts/prompt-card/index.tsx +82 -0
- package/components/prompts/question-prompt/examples.mdx +46 -0
- package/components/prompts/question-prompt/index.tsx +118 -0
- package/dist/blocks/conversation/agent-prompt/index.d.ts +7 -0
- package/dist/blocks/conversation/agent-prompt/index.js +13 -0
- package/dist/blocks/conversation/composer/index.d.ts +4 -0
- package/dist/blocks/conversation/composer/index.js +15 -0
- package/dist/blocks/conversation/failure-states/index.d.ts +4 -0
- package/dist/blocks/conversation/failure-states/index.js +8 -0
- package/dist/blocks/conversation/transcript/index.d.ts +50 -0
- package/dist/blocks/conversation/transcript/index.js +17 -0
- package/dist/blocks/conversation/transcript-search/index.d.ts +4 -0
- package/dist/blocks/conversation/transcript-search/index.js +11 -0
- package/dist/blocks/dialogs/command-palette/index.d.ts +5 -0
- package/dist/blocks/dialogs/command-palette/index.js +20 -0
- package/dist/blocks/dialogs/hook-dialog/index.d.ts +3 -0
- package/dist/blocks/dialogs/hook-dialog/index.js +12 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.d.ts +5 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.js +12 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.d.ts +2 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.js +11 -0
- package/dist/blocks/panes/artifacts-pane/index.d.ts +3 -0
- package/dist/blocks/panes/artifacts-pane/index.js +9 -0
- package/dist/blocks/panes/changes-pane/index.d.ts +3 -0
- package/dist/blocks/panes/changes-pane/index.js +9 -0
- package/dist/blocks/panes/file-pane/index.d.ts +3 -0
- package/dist/blocks/panes/file-pane/index.js +9 -0
- package/dist/blocks/panes/pr-pane/index.d.ts +3 -0
- package/dist/blocks/panes/pr-pane/index.js +10 -0
- package/dist/blocks/panes/side-pane/index.d.ts +5 -0
- package/dist/blocks/panes/side-pane/index.js +21 -0
- package/dist/blocks/panes/tasks-pane/index.d.ts +3 -0
- package/dist/blocks/panes/tasks-pane/index.js +10 -0
- package/dist/blocks/panes/terminal-pane/index.d.ts +3 -0
- package/dist/blocks/panes/terminal-pane/index.js +9 -0
- package/dist/blocks/panes/usage-pane/index.d.ts +4 -0
- package/dist/blocks/panes/usage-pane/index.js +11 -0
- package/dist/blocks/profiles/profile-onboarding/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-onboarding/index.js +11 -0
- package/dist/blocks/profiles/profile-switcher/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-switcher/index.js +11 -0
- package/dist/blocks/profiles/profile-usage/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-usage/index.js +10 -0
- package/dist/blocks/sessions/inbox/index.d.ts +2 -0
- package/dist/blocks/sessions/inbox/index.js +11 -0
- package/dist/blocks/sessions/session-board/index.d.ts +4 -0
- package/dist/blocks/sessions/session-board/index.js +26 -0
- package/dist/blocks/sessions/session-sidebar/index.d.ts +5 -0
- package/dist/blocks/sessions/session-sidebar/index.js +15 -0
- package/dist/blocks/settings/extensions/index.d.ts +2 -0
- package/dist/blocks/settings/extensions/index.js +9 -0
- package/dist/blocks/settings/hooks/index.d.ts +4 -0
- package/dist/blocks/settings/hooks/index.js +9 -0
- package/dist/blocks/settings/mcp-servers/index.d.ts +4 -0
- package/dist/blocks/settings/mcp-servers/index.js +9 -0
- package/dist/blocks/settings/memory/index.d.ts +4 -0
- package/dist/blocks/settings/memory/index.js +8 -0
- package/dist/blocks/settings/notifications/index.d.ts +2 -0
- package/dist/blocks/settings/notifications/index.js +8 -0
- package/dist/blocks/settings/permission-rules/index.d.ts +3 -0
- package/dist/blocks/settings/permission-rules/index.js +10 -0
- package/dist/blocks/settings/plugin-catalog/index.d.ts +2 -0
- package/dist/blocks/settings/plugin-catalog/index.js +11 -0
- package/dist/blocks/settings/plugins/index.d.ts +4 -0
- package/dist/blocks/settings/plugins/index.js +9 -0
- package/dist/blocks/settings/settings-window/index.d.ts +4 -0
- package/dist/blocks/settings/settings-window/index.js +8 -0
- package/dist/blocks/settings/worktrees/index.d.ts +4 -0
- package/dist/blocks/settings/worktrees/index.js +9 -0
- package/dist/components/conversation/agent-run/index.d.ts +3 -0
- package/dist/components/conversation/agent-run/index.js +10 -0
- package/dist/components/conversation/chapter-nav/index.d.ts +2 -0
- package/dist/components/conversation/chapter-nav/index.js +11 -0
- package/dist/components/conversation/message/index.d.ts +2 -0
- package/dist/components/conversation/message/index.js +15 -0
- package/dist/components/conversation/reasoning/index.d.ts +2 -0
- package/dist/components/conversation/reasoning/index.js +8 -0
- package/dist/components/conversation/recap/index.d.ts +2 -0
- package/dist/components/conversation/recap/index.js +9 -0
- package/dist/components/conversation/todo-list/index.d.ts +2 -0
- package/dist/components/conversation/todo-list/index.js +9 -0
- package/dist/components/conversation/tool-call/index.d.ts +3 -0
- package/dist/components/conversation/tool-call/index.js +13 -0
- package/dist/components/conversation/work-summary/index.d.ts +2 -0
- package/dist/components/conversation/work-summary/index.js +10 -0
- package/dist/components/prompts/permission-request/index.d.ts +2 -0
- package/dist/components/prompts/permission-request/index.js +9 -0
- package/dist/components/prompts/plan-approval/index.d.ts +2 -0
- package/dist/components/prompts/plan-approval/index.js +9 -0
- package/dist/components/prompts/prompt-card/index.d.ts +3 -0
- package/dist/components/prompts/prompt-card/index.js +8 -0
- package/dist/components/prompts/question-prompt/index.d.ts +2 -0
- package/dist/components/prompts/question-prompt/index.js +9 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +231 -0
- package/dist/lib/config-parts.d.ts +2 -0
- package/dist/lib/config-parts.js +16 -0
- package/dist/lib/icons.d.ts +2 -0
- package/dist/lib/icons.js +10 -0
- package/dist/lib/pace-bar.d.ts +11 -0
- package/dist/lib/pace-bar.js +6 -0
- package/dist/lib/pace.d.ts +4 -0
- package/dist/lib/pace.js +12 -0
- package/dist/lib/pane-parts.d.ts +25 -0
- package/dist/lib/pane-parts.js +11 -0
- package/dist/lib/row-trigger.d.ts +5 -0
- package/dist/lib/row-trigger.js +7 -0
- package/dist/lib/settings-parts.d.ts +70 -0
- package/dist/lib/settings-parts.js +24 -0
- package/dist/lib/side-pane-types.d.ts +2 -0
- package/dist/lib/side-pane-types.js +1 -0
- package/dist/lib/status-glyph.d.ts +8 -0
- package/dist/lib/status-glyph.js +12 -0
- package/dist/lib/types.d.ts +3 -0
- package/dist/lib/types.js +1 -0
- package/dist/shared/chunk-04a497rr.js +21 -0
- package/dist/shared/chunk-13yf0mza.d.ts +70 -0
- package/dist/shared/chunk-1aq2xzv5.js +558 -0
- package/dist/shared/chunk-1f96cz69.js +45 -0
- package/dist/shared/chunk-1yt061np.d.ts +64 -0
- package/dist/shared/chunk-218qabm5.js +250 -0
- package/dist/shared/chunk-2fk5aq60.js +313 -0
- package/dist/shared/chunk-4248zvmh.js +177 -0
- package/dist/shared/chunk-45rqgey6.d.ts +25 -0
- package/dist/shared/chunk-4n0v64qx.js +179 -0
- package/dist/shared/chunk-4zvhpf2x.js +55 -0
- package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
- package/dist/shared/chunk-58qvny6a.d.ts +29 -0
- package/dist/shared/chunk-5fhkkn39.js +130 -0
- package/dist/shared/chunk-5hw0525a.d.ts +33 -0
- package/dist/shared/chunk-5k6xwqfj.d.ts +68 -0
- package/dist/shared/chunk-5meda998.js +238 -0
- package/dist/shared/chunk-5pqksw7z.js +91 -0
- package/dist/shared/chunk-6220dy5n.js +70 -0
- package/dist/shared/chunk-64bnh22t.d.ts +59 -0
- package/dist/shared/chunk-66sh633m.d.ts +60 -0
- package/dist/shared/chunk-6cmf27g3.d.ts +81 -0
- package/dist/shared/chunk-6g4970a6.d.ts +20 -0
- package/dist/shared/chunk-75zwypyr.d.ts +43 -0
- package/dist/shared/chunk-7rzjmcnh.d.ts +30 -0
- package/dist/shared/chunk-7zvb39cf.d.ts +26 -0
- package/dist/shared/chunk-8mecznyr.js +357 -0
- package/dist/shared/chunk-8pag6vmd.js +255 -0
- package/dist/shared/chunk-8xg5gwwy.js +38 -0
- package/dist/shared/chunk-9kw6m047.d.ts +32 -0
- package/dist/shared/chunk-a4s440b6.js +79 -0
- package/dist/shared/chunk-at0jje23.d.ts +110 -0
- package/dist/shared/chunk-awd573h9.js +34 -0
- package/dist/shared/chunk-b171wjge.d.ts +25 -0
- package/dist/shared/chunk-bh2b5d1z.js +98 -0
- package/dist/shared/chunk-bzs6amnv.js +187 -0
- package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
- package/dist/shared/chunk-c8wp058j.js +153 -0
- package/dist/shared/chunk-cd4f87as.d.ts +28 -0
- package/dist/shared/chunk-cmwby8f9.js +467 -0
- package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
- package/dist/shared/chunk-dh3qy5fj.js +49 -0
- package/dist/shared/chunk-e46apgve.d.ts +40 -0
- package/dist/shared/chunk-ejtknc0w.js +21 -0
- package/dist/shared/chunk-eqajdxn8.js +82 -0
- package/dist/shared/chunk-fbn0h7cr.js +123 -0
- package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
- package/dist/shared/chunk-g28hweee.d.ts +35 -0
- package/dist/shared/chunk-g88hweqh.d.ts +70 -0
- package/dist/shared/chunk-gewnsgza.js +61 -0
- package/dist/shared/chunk-gkyk663q.d.ts +53 -0
- package/dist/shared/chunk-hd4gtj5z.d.ts +23 -0
- package/dist/shared/chunk-hxjgey30.d.ts +36 -0
- package/dist/shared/chunk-jkkdq1mh.d.ts +213 -0
- package/dist/shared/chunk-jpq101w3.js +91 -0
- package/dist/shared/chunk-k3bv9k1v.d.ts +56 -0
- package/dist/shared/chunk-k5zegxje.d.ts +81 -0
- package/dist/shared/chunk-kreypnzp.d.ts +34 -0
- package/dist/shared/chunk-kw9npka5.js +224 -0
- package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
- package/dist/shared/chunk-n1qq2wp9.js +6 -0
- package/dist/shared/chunk-n4742y54.js +39 -0
- package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
- package/dist/shared/chunk-nk4578dr.js +73 -0
- package/dist/shared/chunk-paezqfg1.js +106 -0
- package/dist/shared/chunk-qemm9e3r.d.ts +21 -0
- package/dist/shared/chunk-qhxz1etk.js +96 -0
- package/dist/shared/chunk-qj5ev9ak.js +531 -0
- package/dist/shared/chunk-qnwggvjy.js +150 -0
- package/dist/shared/chunk-r5hz78pb.js +129 -0
- package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
- package/dist/shared/chunk-rjfwje37.d.ts +234 -0
- package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
- package/dist/shared/chunk-rzajcn44.d.ts +49 -0
- package/dist/shared/chunk-s3r759ec.js +80 -0
- package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
- package/dist/shared/chunk-sfqvyzcs.d.ts +68 -0
- package/dist/shared/chunk-skg3m9m0.js +56 -0
- package/dist/shared/chunk-szkvrqg1.d.ts +54 -0
- package/dist/shared/chunk-t21t9x7e.js +188 -0
- package/dist/shared/chunk-tc75ng2c.js +235 -0
- package/dist/shared/chunk-tkx1krwc.js +88 -0
- package/dist/shared/chunk-tprdqtb1.d.ts +30 -0
- package/dist/shared/chunk-tv9a1sek.js +137 -0
- package/dist/shared/chunk-tvbd27hg.d.ts +43 -0
- package/dist/shared/chunk-v6yevw62.d.ts +28 -0
- package/dist/shared/chunk-v9q38p0x.js +258 -0
- package/dist/shared/chunk-vd59gzzd.js +86 -0
- package/dist/shared/chunk-vgh4f3sv.js +118 -0
- package/dist/shared/chunk-vjht1zn1.js +391 -0
- package/dist/shared/chunk-vsrkb0sp.d.ts +21 -0
- package/dist/shared/chunk-w5z8qnf8.js +175 -0
- package/dist/shared/chunk-wgvzavx1.js +1488 -0
- package/dist/shared/chunk-whsx7yp9.d.ts +37 -0
- package/dist/shared/chunk-x7az5x1y.d.ts +57 -0
- package/dist/shared/chunk-x9jf26yb.js +318 -0
- package/dist/shared/chunk-xbrrt07s.d.ts +23 -0
- package/dist/shared/chunk-xkchhs2z.js +129 -0
- package/dist/shared/chunk-xzfrskd7.js +202 -0
- package/dist/shared/chunk-y4cj4y54.js +423 -0
- package/dist/shared/chunk-y934at6m.js +7 -0
- package/dist/shared/chunk-zbpwhpjy.d.ts +75 -0
- package/dist/shared/chunk-zfhmbb7n.js +63 -0
- package/dist/shared/chunk-zk0t4vq5.js +71 -0
- package/dist/shared/chunk-znp9gna7.d.ts +23 -0
- package/dist/styles.css +467 -0
- package/index.ts +49 -0
- package/lib/config-parts.tsx +97 -0
- package/lib/icons.tsx +149 -0
- package/lib/pace-bar.tsx +24 -0
- package/lib/pace.ts +74 -0
- package/lib/pane-parts.tsx +76 -0
- package/lib/row-trigger.tsx +44 -0
- package/lib/settings-parts.tsx +232 -0
- package/lib/side-pane-types.ts +75 -0
- package/lib/status-glyph.tsx +25 -0
- package/lib/types.ts +204 -0
- package/mock/demo-reply.tsx +33 -0
- package/mock/demo-session.tsx +150 -0
- package/mock/mock-config.ts +173 -0
- package/mock/mock-extras.ts +288 -0
- package/mock/mock-panes.ts +190 -0
- package/mock/mock-settings.ts +92 -0
- package/mock/mock.ts +548 -0
- package/mock/screen-frame.tsx +49 -0
- package/package.json +114 -4
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import SidePane from './index'
|
|
2
|
+
import { SIDE_PANE_DATA } from '../../../mock/mock-panes'
|
|
3
|
+
|
|
4
|
+
# Changes
|
|
5
|
+
|
|
6
|
+
Staged and unstaged files under a commit field; hover a row to stage, unstage or revert it. The picked file's diff wraps its long lines; the toggle above it scrolls them instead.
|
|
7
|
+
|
|
8
|
+
<div className="flex h-[640px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
9
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" />
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
# File
|
|
13
|
+
|
|
14
|
+
The open file under its path crumb, with copy and open in editor.
|
|
15
|
+
|
|
16
|
+
<div className="flex h-[420px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
17
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" defaultPane="file" />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
# Pull request
|
|
21
|
+
|
|
22
|
+
CI checks as they run; the failed one is open on the tail of its log with Ask Claude to fix, and the merge waits for it. Auto-fix lets the session watch CI and answer reviews.
|
|
23
|
+
|
|
24
|
+
<div className="flex h-[640px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
25
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" defaultPane="pr" />
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
# Terminal
|
|
29
|
+
|
|
30
|
+
The session's shell in its folder: type at the prompt and press Enter.
|
|
31
|
+
|
|
32
|
+
<div className="flex h-[420px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
33
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" defaultPane="terminal" />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
# Artifacts
|
|
37
|
+
|
|
38
|
+
What Claude made in this session, newest first; a press opens one.
|
|
39
|
+
|
|
40
|
+
<div className="flex h-[320px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
41
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" defaultPane="artifacts" />
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
# Tasks
|
|
45
|
+
|
|
46
|
+
Background agents, shells and child sessions: stop a running one, retry one that failed or stopped.
|
|
47
|
+
|
|
48
|
+
<div className="flex h-[360px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
49
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" defaultPane="tasks" />
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
# Extensions slot
|
|
53
|
+
|
|
54
|
+
The last tab is yours: a pane from your own MCP server or plugin, here every profile's limits as pace bars. The + menu adds optional plugin panes.
|
|
55
|
+
|
|
56
|
+
<div className="flex h-[640px] w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background">
|
|
57
|
+
<SidePane data={SIDE_PANE_DATA} className="flex-1" defaultPane="extension" />
|
|
58
|
+
</div>
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition: the AI app's side pane, beside the transcript. A
|
|
3
|
+
* strip of pill tabs (subtle Tabs, only the picked one spelled out) switches
|
|
4
|
+
* between the pane blocks (changes-pane, file-pane, …); a Dropdown beside the last tab adds
|
|
5
|
+
* optional panes from plugins; the close button hands the room back to the
|
|
6
|
+
* transcript. The whole pane is a compact region.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use client'
|
|
10
|
+
|
|
11
|
+
import Button from '@justanarthur/modo-ui/components/actions/button'
|
|
12
|
+
import Tabs from '@justanarthur/modo-ui/components/navigation/tabs'
|
|
13
|
+
import Dropdown from '@justanarthur/modo-ui/components/overlays/dropdown'
|
|
14
|
+
import Tooltip from '@justanarthur/modo-ui/components/overlays/tooltip'
|
|
15
|
+
import { useControllableState } from '@justanarthur/modo-ui/lib/use-controllable-state'
|
|
16
|
+
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
17
|
+
import ScrollArea from '@justanarthur/modo-ui/primitives/layout/scroll-area'
|
|
18
|
+
import { SizeProvider } from '@justanarthur/modo-ui/primitives/systems/sizes'
|
|
19
|
+
import { type IconName, useIcon, useIcons } from '../../../lib/icons'
|
|
20
|
+
import type {
|
|
21
|
+
PaneArtifact,
|
|
22
|
+
PaneChange,
|
|
23
|
+
PaneFile,
|
|
24
|
+
PanePullRequest,
|
|
25
|
+
PaneShell,
|
|
26
|
+
PaneTask,
|
|
27
|
+
} from '../../../lib/side-pane-types'
|
|
28
|
+
import type { PaneId, Profile } from '../../../lib/types'
|
|
29
|
+
import ArtifactsPane from '../artifacts-pane'
|
|
30
|
+
import ChangesPane from '../changes-pane'
|
|
31
|
+
import FilePane from '../file-pane'
|
|
32
|
+
import PullRequestPane from '../pr-pane'
|
|
33
|
+
import TasksPane from '../tasks-pane'
|
|
34
|
+
import TerminalPane from '../terminal-pane'
|
|
35
|
+
import UsagePane from '../usage-pane'
|
|
36
|
+
|
|
37
|
+
const PANES: { id: PaneId; label: string; icon: IconName }[] = [
|
|
38
|
+
{ id: 'changes', label: 'Changes', icon: 'file-diff' },
|
|
39
|
+
{ id: 'file', label: 'File', icon: 'file-text' },
|
|
40
|
+
{ id: 'terminal', label: 'Terminal', icon: 'terminal' },
|
|
41
|
+
{ id: 'pr', label: 'Pull request', icon: 'git-pull-request' },
|
|
42
|
+
{ id: 'artifacts', label: 'Artifacts', icon: 'layers' },
|
|
43
|
+
{ id: 'tasks', label: 'Tasks', icon: 'list-checks' },
|
|
44
|
+
{ id: 'extension', label: 'Usage', icon: 'puzzle' },
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
/** Every pane's data, handed to the pane blocks. */
|
|
48
|
+
interface SidePaneData {
|
|
49
|
+
changes: PaneChange[]
|
|
50
|
+
file: PaneFile
|
|
51
|
+
/** The session's file paths, for the File pane's tree. */
|
|
52
|
+
files?: string[]
|
|
53
|
+
shell: PaneShell
|
|
54
|
+
pr: PanePullRequest
|
|
55
|
+
artifacts: PaneArtifact[]
|
|
56
|
+
tasks: PaneTask[]
|
|
57
|
+
/** The profiles the extensions slot reads usage from. */
|
|
58
|
+
profiles: Profile[]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const CONTENT: Record<PaneId, (data: SidePaneData) => React.ReactNode> = {
|
|
62
|
+
changes: data => <ChangesPane changes={data.changes} />,
|
|
63
|
+
file: data => <FilePane file={data.file} files={data.files} />,
|
|
64
|
+
terminal: data => <TerminalPane shell={data.shell} />,
|
|
65
|
+
pr: data => <PullRequestPane pr={data.pr} />,
|
|
66
|
+
artifacts: data => <ArtifactsPane artifacts={data.artifacts} />,
|
|
67
|
+
tasks: data => <TasksPane tasks={data.tasks} />,
|
|
68
|
+
extension: data => <UsagePane profiles={data.profiles} />,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface SidePaneProps {
|
|
72
|
+
/** Every pane's data: changes, the open file, the shell, the pull request, artifacts, tasks and the profiles for usage. */
|
|
73
|
+
data: SidePaneData
|
|
74
|
+
/** Controlled open pane. Pair with `onPaneChange`. */
|
|
75
|
+
pane?: PaneId
|
|
76
|
+
/** Initial pane, for an uncontrolled side pane. Defaults to `'changes'`. */
|
|
77
|
+
defaultPane?: PaneId
|
|
78
|
+
/** Called with the pane picked in the strip. */
|
|
79
|
+
onPaneChange?: (pane: PaneId) => void
|
|
80
|
+
/** Called by the close button. */
|
|
81
|
+
onClose?: () => void
|
|
82
|
+
/** Classes for the root. */
|
|
83
|
+
className?: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The room beside the transcript for what the session touches: its
|
|
88
|
+
* changes, a file, a terminal, its pull request, artifacts and background
|
|
89
|
+
* tasks.
|
|
90
|
+
*
|
|
91
|
+
* Pill tabs at the top switch panes; only the picked tab spells out its
|
|
92
|
+
* name, so the strip fits a narrow pane, and the pill melts from tab to
|
|
93
|
+
* tab. The + beside the last tab adds optional panes from plugins (a
|
|
94
|
+
* browser, an iOS simulator); the close button sits at the far edge. The
|
|
95
|
+
* strip is as tall as the session's header, so the two share a line across
|
|
96
|
+
* the window.
|
|
97
|
+
*
|
|
98
|
+
* Every pane speaks one language: a section row with a title, its meta and
|
|
99
|
+
* icon actions, then rows on the control height whose text lines up with
|
|
100
|
+
* the title. Changes splits the files into staged and unstaged with a
|
|
101
|
+
* commit field on top; a row's stage, unstage and revert show on hover, and
|
|
102
|
+
* the picked file's diff wraps its long lines (toggle it to scroll). File
|
|
103
|
+
* shows a path crumb with copy and open. Terminal is a prompt you type at,
|
|
104
|
+
* not a form. The pull request lists its checks: a failed one opens to the
|
|
105
|
+
* tail of its log with Ask Claude to fix, and the merge waits while one
|
|
106
|
+
* fails. Artifacts open on press; tasks stop while they run and retry once
|
|
107
|
+
* they failed or stopped. The last tab is the extensions slot, a pane your
|
|
108
|
+
* own MCP server or plugin provides: here, every profile's limits as pace
|
|
109
|
+
* bars, read against the time until each resets. A pane with nothing in it
|
|
110
|
+
* says so and what lands there.
|
|
111
|
+
*
|
|
112
|
+
* @example {@include ./examples.mdx}
|
|
113
|
+
*/
|
|
114
|
+
export default function SidePane({
|
|
115
|
+
data,
|
|
116
|
+
pane,
|
|
117
|
+
defaultPane = 'changes',
|
|
118
|
+
onPaneChange,
|
|
119
|
+
onClose,
|
|
120
|
+
className,
|
|
121
|
+
}: SidePaneProps) {
|
|
122
|
+
const [current, setCurrent] = useControllableState(pane, defaultPane, onPaneChange)
|
|
123
|
+
const icons = useIcons()
|
|
124
|
+
const Close = useIcon('x')
|
|
125
|
+
const Plus = useIcon('plus')
|
|
126
|
+
const Globe = useIcon('globe')
|
|
127
|
+
const Phone = useIcon('monitor')
|
|
128
|
+
const shown = PANES.some(p => p.id === current) ? current : 'changes'
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<section aria-label="Side pane" className={cn('flex min-h-0 min-w-0 flex-col', className)}>
|
|
132
|
+
<SizeProvider size="compact">
|
|
133
|
+
<Tabs
|
|
134
|
+
variant="subtle"
|
|
135
|
+
activeLabel
|
|
136
|
+
value={shown}
|
|
137
|
+
onValueChange={value => setCurrent(value as PaneId)}
|
|
138
|
+
className="flex min-h-0 flex-1 flex-col"
|
|
139
|
+
>
|
|
140
|
+
{/* One height with the session's header, so the two rows share a baseline across the window. */}
|
|
141
|
+
<div className="flex h-12 shrink-0 items-center gap-1 px-2">
|
|
142
|
+
<Tabs.List className="min-w-0">
|
|
143
|
+
{PANES.map(p => (
|
|
144
|
+
<Tabs.Item key={p.id} value={p.id} icon={icons[p.icon]} label={p.label} />
|
|
145
|
+
))}
|
|
146
|
+
</Tabs.List>
|
|
147
|
+
<Dropdown.Menu>
|
|
148
|
+
<Dropdown.Trigger
|
|
149
|
+
render={
|
|
150
|
+
<Button variant="ghost" size="icon-compact" aria-label="Add a pane" className="shrink-0">
|
|
151
|
+
<Plus />
|
|
152
|
+
</Button>
|
|
153
|
+
}
|
|
154
|
+
/>
|
|
155
|
+
<Dropdown.Content align="start" className="w-60">
|
|
156
|
+
<Dropdown.Label>From plugins</Dropdown.Label>
|
|
157
|
+
<Dropdown.Item index={0} icon={Globe} label="Browser (install)" />
|
|
158
|
+
<Dropdown.Item index={1} icon={Phone} label="iOS simulator (install)" />
|
|
159
|
+
</Dropdown.Content>
|
|
160
|
+
</Dropdown.Menu>
|
|
161
|
+
{onClose && (
|
|
162
|
+
<Tooltip content="Close the pane" side="bottom">
|
|
163
|
+
<Button
|
|
164
|
+
variant="ghost"
|
|
165
|
+
size="icon-compact"
|
|
166
|
+
aria-label="Close the pane"
|
|
167
|
+
className="ml-auto shrink-0"
|
|
168
|
+
onClick={onClose}
|
|
169
|
+
>
|
|
170
|
+
<Close />
|
|
171
|
+
</Button>
|
|
172
|
+
</Tooltip>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
<ScrollArea className="min-h-0 flex-1" viewportClassName="scroll-fade">
|
|
176
|
+
<Tabs.Panel value={shown} className="px-2 pb-4 [contain:inline-size]">
|
|
177
|
+
{CONTENT[shown](data)}
|
|
178
|
+
</Tabs.Panel>
|
|
179
|
+
</ScrollArea>
|
|
180
|
+
</Tabs>
|
|
181
|
+
</SizeProvider>
|
|
182
|
+
</section>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type { SidePaneData, SidePaneProps }
|
|
187
|
+
export { PANES, SidePane }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SizeProvider } from '@justanarthur/modo-ui/primitives/systems/sizes'
|
|
2
|
+
import { PANE_TASKS } from '../../../mock/mock-panes'
|
|
3
|
+
import TasksPane from './index'
|
|
4
|
+
|
|
5
|
+
# Tasks
|
|
6
|
+
|
|
7
|
+
Background agents, shells and child sessions: stop a running one, retry one that failed or stopped.
|
|
8
|
+
|
|
9
|
+
<div className="w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background p-2">
|
|
10
|
+
<SizeProvider size="compact">
|
|
11
|
+
<TasksPane tasks={PANE_TASKS} />
|
|
12
|
+
</SizeProvider>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
# No tasks
|
|
16
|
+
|
|
17
|
+
With nothing running in the background, the pane says what runs there.
|
|
18
|
+
|
|
19
|
+
<div className="w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background p-2">
|
|
20
|
+
<SizeProvider size="compact">
|
|
21
|
+
<TasksPane tasks={[]} />
|
|
22
|
+
</SizeProvider>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition: the side pane's Tasks — the session's background agents,
|
|
3
|
+
* shells and child sessions, running ones first.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use client'
|
|
7
|
+
|
|
8
|
+
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
9
|
+
import { useState } from 'react'
|
|
10
|
+
import { useIcon } from '../../../lib/icons'
|
|
11
|
+
import { IconAction, PaneEmpty, PaneSection } from '../../../lib/pane-parts'
|
|
12
|
+
import type { PaneTask } from '../../../lib/side-pane-types'
|
|
13
|
+
import { RunningGlyph } from '../../../lib/status-glyph'
|
|
14
|
+
|
|
15
|
+
const TASK_KIND_ICON = { agent: 'bot', shell: 'terminal', session: 'split' } as const
|
|
16
|
+
|
|
17
|
+
function TaskRow({ task, onStop, onRetry }: { task: PaneTask; onStop: () => void; onRetry: () => void }) {
|
|
18
|
+
const Icon = useIcon(TASK_KIND_ICON[task.kind])
|
|
19
|
+
const Failed = useIcon('circle-x')
|
|
20
|
+
const Done = useIcon('circle-check')
|
|
21
|
+
const Stop = useIcon('square')
|
|
22
|
+
const Retry = useIcon('rotate-ccw')
|
|
23
|
+
const running = task.status === 'running'
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<li className="flex min-h-11 items-center gap-2 px-2 py-1">
|
|
27
|
+
<Icon size={16} strokeWidth={1.5} className="shrink-0 text-muted-foreground" />
|
|
28
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
29
|
+
<span className="truncate text-body text-foreground">{task.title}</span>
|
|
30
|
+
<span
|
|
31
|
+
className={cn(
|
|
32
|
+
'truncate text-caption',
|
|
33
|
+
task.status === 'failed' ? 'text-status-error' : 'text-muted-foreground',
|
|
34
|
+
)}
|
|
35
|
+
>
|
|
36
|
+
{task.status === 'stopped' ? `Stopped · ${task.detail}` : task.detail}
|
|
37
|
+
</span>
|
|
38
|
+
</span>
|
|
39
|
+
<span className="flex size-4 shrink-0 items-center justify-center">
|
|
40
|
+
{running && <RunningGlyph size={14} />}
|
|
41
|
+
{task.status === 'done' && <Done size={14} strokeWidth={1.5} className="text-muted-foreground" />}
|
|
42
|
+
{task.status === 'failed' && <Failed size={14} strokeWidth={1.5} className="text-status-error" />}
|
|
43
|
+
</span>
|
|
44
|
+
{/* One slot for the action, so the glyphs line up whether a row has one or not. */}
|
|
45
|
+
<span className="flex w-7 shrink-0 justify-center">
|
|
46
|
+
{running && <IconAction icon={Stop} label="Stop" onClick={onStop} />}
|
|
47
|
+
{(task.status === 'failed' || task.status === 'stopped') && (
|
|
48
|
+
<IconAction icon={Retry} label="Retry" onClick={onRetry} />
|
|
49
|
+
)}
|
|
50
|
+
</span>
|
|
51
|
+
</li>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface TasksPaneProps {
|
|
56
|
+
/** The session's background tasks. The pane keeps its own copy as you stop and retry. */
|
|
57
|
+
tasks: PaneTask[]
|
|
58
|
+
/** Called with the running task Stop ends. */
|
|
59
|
+
onStop?: (task: PaneTask) => void
|
|
60
|
+
/** Called with the failed or stopped task Retry starts again. */
|
|
61
|
+
onRetry?: (task: PaneTask) => void
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The session's background work: subagents, shells and child sessions,
|
|
66
|
+
* running ones first.
|
|
67
|
+
*
|
|
68
|
+
* Each row names the task with its kind as a glyph and a line on what it
|
|
69
|
+
* is doing or how it ended. A running task stops from its row; one that
|
|
70
|
+
* failed or stopped retries. With none, the pane says what runs there.
|
|
71
|
+
*
|
|
72
|
+
* @example {@include ./examples.mdx}
|
|
73
|
+
*/
|
|
74
|
+
export default function TasksPane({ tasks, onStop, onRetry }: TasksPaneProps) {
|
|
75
|
+
const [list, setList] = useState(tasks)
|
|
76
|
+
const setStatus = (id: string, status: PaneTask['status']) =>
|
|
77
|
+
setList(l => l.map(t => (t.id === id ? { ...t, status } : t)))
|
|
78
|
+
const running = list.filter(t => t.status === 'running')
|
|
79
|
+
const finished = list.filter(t => t.status !== 'running')
|
|
80
|
+
|
|
81
|
+
if (list.length === 0)
|
|
82
|
+
return (
|
|
83
|
+
<PaneEmpty
|
|
84
|
+
icon="list-checks"
|
|
85
|
+
title="No background tasks"
|
|
86
|
+
detail="Subagents, shells and child sessions run here."
|
|
87
|
+
/>
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const rows = (items: PaneTask[]) => (
|
|
91
|
+
<ul className="m-0 flex list-none flex-col p-0">
|
|
92
|
+
{items.map(task => (
|
|
93
|
+
<TaskRow
|
|
94
|
+
key={task.id}
|
|
95
|
+
task={task}
|
|
96
|
+
onStop={() => {
|
|
97
|
+
setStatus(task.id, 'stopped')
|
|
98
|
+
onStop?.(task)
|
|
99
|
+
}}
|
|
100
|
+
onRetry={() => {
|
|
101
|
+
setStatus(task.id, 'running')
|
|
102
|
+
onRetry?.(task)
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
))}
|
|
106
|
+
</ul>
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<div className="flex flex-col gap-2">
|
|
111
|
+
{running.length > 0 && (
|
|
112
|
+
<PaneSection title="Running" meta={running.length}>
|
|
113
|
+
{rows(running)}
|
|
114
|
+
</PaneSection>
|
|
115
|
+
)}
|
|
116
|
+
{finished.length > 0 && (
|
|
117
|
+
<PaneSection title="Finished" meta={finished.length}>
|
|
118
|
+
{rows(finished)}
|
|
119
|
+
</PaneSection>
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type { TasksPaneProps }
|
|
126
|
+
|
|
127
|
+
export { TasksPane }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SizeProvider } from '@justanarthur/modo-ui/primitives/systems/sizes'
|
|
2
|
+
import { SHELL } from '../../../mock/mock-panes'
|
|
3
|
+
import TerminalPane from './index'
|
|
4
|
+
|
|
5
|
+
# Terminal
|
|
6
|
+
|
|
7
|
+
The session's shell in its folder: type at the prompt and press Enter.
|
|
8
|
+
|
|
9
|
+
<div className="w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background p-2">
|
|
10
|
+
<SizeProvider size="compact">
|
|
11
|
+
<TerminalPane shell={SHELL} />
|
|
12
|
+
</SizeProvider>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition: the side pane's Terminal — the session's shell in its
|
|
3
|
+
* folder, a prompt you type at rather than a form.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use client'
|
|
7
|
+
|
|
8
|
+
import { useSurface } from '@justanarthur/modo-ui'
|
|
9
|
+
import LogView from '@justanarthur/modo-ui/components/data-display/log-view'
|
|
10
|
+
import { SURFACE_BG } from '@justanarthur/modo-ui/lib/surface-classes'
|
|
11
|
+
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
12
|
+
import { type ReactNode, useRef, useState } from 'react'
|
|
13
|
+
import { useIcon } from '../../../lib/icons'
|
|
14
|
+
import { IconAction, PaneSection } from '../../../lib/pane-parts'
|
|
15
|
+
import type { PaneShell, ShellEntry } from '../../../lib/side-pane-types'
|
|
16
|
+
|
|
17
|
+
function PromptLine({ prompt, children }: { prompt: string; children: ReactNode }) {
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex min-w-0 gap-2">
|
|
20
|
+
<span className="shrink-0 select-none text-muted-foreground">{prompt} $</span>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface TerminalPaneProps {
|
|
27
|
+
/** The shell: its name, folder, prompt and the history so far. The pane keeps its own copy as you run and clear. */
|
|
28
|
+
shell: PaneShell
|
|
29
|
+
/** Called with each command entered at the prompt. */
|
|
30
|
+
onRun?: (command: string) => void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The session's shell in its folder: its history, then a prompt you type at.
|
|
35
|
+
*
|
|
36
|
+
* The history is a LogView (ANSI colors, follows the latest line, smooth on
|
|
37
|
+
* long output). A press anywhere in the frame puts the caret on the prompt, as a terminal
|
|
38
|
+
* does; Enter runs the line and adds it to the history. A failed command
|
|
39
|
+
* ends on its exit code. Clear empties the history.
|
|
40
|
+
*
|
|
41
|
+
* @example {@include ./examples.mdx}
|
|
42
|
+
*/
|
|
43
|
+
export default function TerminalPane({ shell, onRun }: TerminalPaneProps) {
|
|
44
|
+
const [history, setHistory] = useState<ShellEntry[]>(shell.history)
|
|
45
|
+
const [command, setCommand] = useState('')
|
|
46
|
+
const inputRef = useRef<HTMLInputElement | null>(null)
|
|
47
|
+
const level = Math.min(useSurface() + 1, 8)
|
|
48
|
+
const Clear = useIcon('trash')
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<PaneSection
|
|
52
|
+
title={shell.name}
|
|
53
|
+
meta={shell.cwd}
|
|
54
|
+
actions={<IconAction icon={Clear} label="Clear" onClick={() => setHistory([])} />}
|
|
55
|
+
>
|
|
56
|
+
{/* biome-ignore lint/a11y/useKeyWithClickEvents lint/a11y/noStaticElementInteractions: a press anywhere in the frame puts the caret on the prompt, as a terminal does; the input stays the keyboard target */}
|
|
57
|
+
<div
|
|
58
|
+
onClick={() => inputRef.current?.focus()}
|
|
59
|
+
className={cn(
|
|
60
|
+
'flex cursor-text flex-col gap-1 rounded-xl p-3 font-mono text-caption text-foreground',
|
|
61
|
+
SURFACE_BG[level],
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
<LogView
|
|
65
|
+
label={`${shell.name} output`}
|
|
66
|
+
prompt="$ "
|
|
67
|
+
lines={history.flatMap(entry => [
|
|
68
|
+
`$ ${entry.command}`,
|
|
69
|
+
...entry.output,
|
|
70
|
+
// Red, as a shell prints a failure.
|
|
71
|
+
...(entry.exit ? [`\u001b[31mexit ${entry.exit}\u001b[0m`] : []),
|
|
72
|
+
])}
|
|
73
|
+
className="-m-3 mb-0 rounded-b-none bg-transparent"
|
|
74
|
+
/>
|
|
75
|
+
<PromptLine prompt={shell.prompt}>
|
|
76
|
+
<input
|
|
77
|
+
ref={inputRef}
|
|
78
|
+
aria-label="Command"
|
|
79
|
+
spellCheck={false}
|
|
80
|
+
autoComplete="off"
|
|
81
|
+
value={command}
|
|
82
|
+
onChange={e => setCommand(e.target.value)}
|
|
83
|
+
onKeyDown={e => {
|
|
84
|
+
if (e.key !== 'Enter' || !command.trim()) return
|
|
85
|
+
setHistory(h => [...h, { command, output: [] }])
|
|
86
|
+
setCommand('')
|
|
87
|
+
onRun?.(command)
|
|
88
|
+
}}
|
|
89
|
+
className="min-w-0 flex-1 border-0 bg-transparent p-0 font-mono text-caption text-foreground caret-foreground outline-none"
|
|
90
|
+
/>
|
|
91
|
+
</PromptLine>
|
|
92
|
+
</div>
|
|
93
|
+
</PaneSection>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type { TerminalPaneProps }
|
|
98
|
+
|
|
99
|
+
export { TerminalPane }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SizeProvider } from '@justanarthur/modo-ui/primitives/systems/sizes'
|
|
2
|
+
import { PROFILES } from '../../../mock/mock'
|
|
3
|
+
import UsagePane from './index'
|
|
4
|
+
|
|
5
|
+
# Usage
|
|
6
|
+
|
|
7
|
+
Every profile's limits as pace bars, each with its verdict; the tick is where an even spend would be by now.
|
|
8
|
+
|
|
9
|
+
<div className="w-full max-w-sm overflow-hidden rounded-xl border border-border bg-background p-2">
|
|
10
|
+
<SizeProvider size="compact">
|
|
11
|
+
<UsagePane profiles={PROFILES} />
|
|
12
|
+
</SizeProvider>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Local addition: the side pane's extensions slot, filled with usage —
|
|
3
|
+
* every profile's limits as pace bars, read against the time until each
|
|
4
|
+
* resets.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use client'
|
|
8
|
+
|
|
9
|
+
import Badge from '@justanarthur/modo-ui/components/data-display/badge'
|
|
10
|
+
import { useSize } from '@justanarthur/modo-ui/lib/size-context'
|
|
11
|
+
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
12
|
+
import { duration, paceOf, percent, VERDICT_TEXT } from '../../../lib/pace'
|
|
13
|
+
import { PaceBar } from '../../../lib/pace-bar'
|
|
14
|
+
import { PaneSection } from '../../../lib/pane-parts'
|
|
15
|
+
import type { Profile } from '../../../lib/types'
|
|
16
|
+
|
|
17
|
+
const VERDICT_WORD = { free: 'on pace', watch: 'only just', tight: 'too fast' } as const
|
|
18
|
+
|
|
19
|
+
interface UsagePaneProps {
|
|
20
|
+
/** The profiles to read, each with its limits. */
|
|
21
|
+
profiles: Profile[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The extensions slot, a pane your own MCP server or plugin provides: here,
|
|
26
|
+
* usage across every profile.
|
|
27
|
+
*
|
|
28
|
+
* Each profile is a section with its plan and a verdict on its tightest
|
|
29
|
+
* limit (on pace, only just, too fast); each limit is a pace bar whose tick
|
|
30
|
+
* is where an even spend would be by now, with its share and the time
|
|
31
|
+
* until it resets.
|
|
32
|
+
*
|
|
33
|
+
* @example {@include ./examples.mdx}
|
|
34
|
+
*/
|
|
35
|
+
export default function UsagePane({ profiles }: UsagePaneProps) {
|
|
36
|
+
const size = useSize()
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex flex-col gap-2">
|
|
39
|
+
<div className="flex items-center gap-2 px-2 pt-2">
|
|
40
|
+
<span className="min-w-0 flex-1 text-caption text-muted-foreground">
|
|
41
|
+
From your ai-app MCP server. The tick is where an even spend would be by now.
|
|
42
|
+
</span>
|
|
43
|
+
<Badge size="compact" color="violet" className="shrink-0">
|
|
44
|
+
Extension
|
|
45
|
+
</Badge>
|
|
46
|
+
</div>
|
|
47
|
+
{profiles.map(paceOf).map(({ profile, limits, binding }) => (
|
|
48
|
+
<PaneSection
|
|
49
|
+
key={profile.id}
|
|
50
|
+
title={profile.name}
|
|
51
|
+
meta={profile.plan}
|
|
52
|
+
actions={
|
|
53
|
+
<span className={cn('pr-1 text-caption', VERDICT_TEXT[binding.verdict])}>
|
|
54
|
+
{VERDICT_WORD[binding.verdict]}
|
|
55
|
+
</span>
|
|
56
|
+
}
|
|
57
|
+
>
|
|
58
|
+
{limits.map(pace => (
|
|
59
|
+
<div key={pace.limit.label} className={cn('flex items-center gap-2 px-2', size.control, size.text)}>
|
|
60
|
+
<span className="min-w-0 flex-1 truncate text-foreground">{pace.limit.label}</span>
|
|
61
|
+
<PaceBar pace={pace} className="w-16 shrink-0" />
|
|
62
|
+
<span className="w-24 shrink-0 whitespace-nowrap text-right text-caption tabular-nums text-muted-foreground">
|
|
63
|
+
{percent(pace.limit.value)} · {duration(pace.limit.resetsInHours)}
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
))}
|
|
67
|
+
</PaneSection>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type { UsagePaneProps }
|
|
74
|
+
|
|
75
|
+
export { UsagePane }
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import ProfileOnboarding from './index'
|
|
2
|
+
import Button from '@justanarthur/modo-ui/components/actions/button'
|
|
3
|
+
import { PROFILES } from '../../../mock/mock'
|
|
4
|
+
import { PROVIDER_TEST_SUCCESS, SIGN_IN_FAILED, SIGN_IN_SUCCESS, SIGN_IN_WAITING } from '../../../mock/mock-extras'
|
|
5
|
+
|
|
6
|
+
# Add a profile
|
|
7
|
+
|
|
8
|
+
Press the button: the dialog grows out of it. Pick a kind, name it, and Continue moves to the sign-in, which here stays waiting for the browser.
|
|
9
|
+
|
|
10
|
+
<ProfileOnboarding
|
|
11
|
+
trigger={<Button variant="secondary">Add profile</Button>}
|
|
12
|
+
taken={PROFILES.map(p => p.name)}
|
|
13
|
+
signIn={SIGN_IN_WAITING}
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
# Choose the kind
|
|
17
|
+
|
|
18
|
+
A Claude account in a config dir of its own, or a provider that speaks Anthropic's API.
|
|
19
|
+
|
|
20
|
+
<div className="w-full max-w-[540px] rounded-xl border border-border bg-background p-6">
|
|
21
|
+
<ProfileOnboarding.Panel />
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
# A compatible provider
|
|
25
|
+
|
|
26
|
+
The base URL, the env var that holds the key, and which model each Claude tier maps to.
|
|
27
|
+
|
|
28
|
+
<div className="w-full max-w-[540px] rounded-xl border border-border bg-background p-6">
|
|
29
|
+
<ProfileOnboarding.Panel
|
|
30
|
+
defaultStep="details"
|
|
31
|
+
defaultDraft={{ kind: 'compatible', name: 'glm', baseUrl: 'https://api.z.ai/api/anthropic', apiKeyEnv: 'ZAI_API_KEY', models: { opus: 'GLM-4.6', sonnet: 'GLM-4.6', haiku: 'GLM-4.5-Air' } }}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
# Waiting for the browser
|
|
36
|
+
|
|
37
|
+
`claude login` runs under the new config dir; its output scrolls in the log, with the link to open again or copy.
|
|
38
|
+
|
|
39
|
+
<div className="w-full max-w-[540px] rounded-xl border border-border bg-background p-6">
|
|
40
|
+
<ProfileOnboarding.Panel defaultStep="sign-in" defaultDraft={{ name: 'research' }} signIn={SIGN_IN_WAITING} />
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
# Signed in
|
|
44
|
+
|
|
45
|
+
Continue lights once the sign-in succeeds.
|
|
46
|
+
|
|
47
|
+
<div className="w-full max-w-[540px] rounded-xl border border-border bg-background p-6">
|
|
48
|
+
<ProfileOnboarding.Panel defaultStep="sign-in" defaultDraft={{ name: 'research' }} signIn={SIGN_IN_SUCCESS} />
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
# Sign-in failed
|
|
52
|
+
|
|
53
|
+
The error, the CLI's last words and a retry.
|
|
54
|
+
|
|
55
|
+
<div className="w-full max-w-[540px] rounded-xl border border-border bg-background p-6">
|
|
56
|
+
<ProfileOnboarding.Panel defaultStep="sign-in" defaultDraft={{ name: 'research' }} signIn={SIGN_IN_FAILED} />
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
# Done
|
|
60
|
+
|
|
61
|
+
What the profile will be, before it is added.
|
|
62
|
+
|
|
63
|
+
<div className="w-full max-w-[540px] rounded-xl border border-border bg-background p-6">
|
|
64
|
+
<ProfileOnboarding.Panel
|
|
65
|
+
defaultStep="done"
|
|
66
|
+
defaultDraft={{ kind: 'compatible', name: 'glm', baseUrl: 'https://api.z.ai/api/anthropic', apiKeyEnv: 'ZAI_API_KEY', models: { opus: 'GLM-4.6', sonnet: 'GLM-4.6', haiku: 'GLM-4.5-Air' } }}
|
|
67
|
+
signIn={PROVIDER_TEST_SUCCESS}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
# Light and dark
|
|
72
|
+
|
|
73
|
+
<div className="grid w-full gap-3 @3xl:grid-cols-2">
|
|
74
|
+
<div className="light rounded-xl border border-border bg-background p-6 text-foreground">
|
|
75
|
+
<ProfileOnboarding.Panel defaultStep="sign-in" defaultDraft={{ name: 'research' }} signIn={SIGN_IN_WAITING} />
|
|
76
|
+
</div>
|
|
77
|
+
<div className="dark rounded-xl border border-border bg-background p-6 text-foreground">
|
|
78
|
+
<ProfileOnboarding.Panel defaultStep="sign-in" defaultDraft={{ name: 'research' }} signIn={SIGN_IN_SUCCESS} />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|