@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,558 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
import {
|
|
7
|
+
STATUS_GLYPH2,
|
|
8
|
+
STATUS_LABEL2
|
|
9
|
+
} from "./chunk-ejtknc0w.js";
|
|
10
|
+
import {
|
|
11
|
+
agent_prompt_default
|
|
12
|
+
} from "./chunk-vd59gzzd.js";
|
|
13
|
+
import {
|
|
14
|
+
ProfileTile2
|
|
15
|
+
} from "./chunk-kw9npka5.js";
|
|
16
|
+
import {
|
|
17
|
+
composer_default
|
|
18
|
+
} from "./chunk-wgvzavx1.js";
|
|
19
|
+
import {
|
|
20
|
+
transcript_default
|
|
21
|
+
} from "./chunk-4n0v64qx.js";
|
|
22
|
+
|
|
23
|
+
// blocks/sessions/session-board/index.tsx
|
|
24
|
+
import { SurfaceProvider, useSurface } from "@justanarthur/modo-ui";
|
|
25
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
26
|
+
import Accordion from "@justanarthur/modo-ui/components/containers/accordion";
|
|
27
|
+
import Meter from "@justanarthur/modo-ui/components/feedback/meter";
|
|
28
|
+
import Tabs from "@justanarthur/modo-ui/components/navigation/tabs";
|
|
29
|
+
import Tooltip from "@justanarthur/modo-ui/components/overlays/tooltip";
|
|
30
|
+
import { useShape } from "@justanarthur/modo-ui/lib/shape-context";
|
|
31
|
+
import { useSize } from "@justanarthur/modo-ui/lib/size-context";
|
|
32
|
+
import { spring } from "@justanarthur/modo-ui/lib/springs";
|
|
33
|
+
import { SURFACE_BG, SURFACE_SHADOW } from "@justanarthur/modo-ui/lib/surface-classes";
|
|
34
|
+
import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
|
|
35
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
36
|
+
import { SizeProvider } from "@justanarthur/modo-ui/primitives/systems/sizes";
|
|
37
|
+
import { motion } from "motion/react";
|
|
38
|
+
import { useState } from "react";
|
|
39
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
40
|
+
/*!
|
|
41
|
+
* Local addition: the AI app's sessions board — the sessions sidebar,
|
|
42
|
+
* widened. The same groups in the same order (pinned, each project, the
|
|
43
|
+
* user's sections, the archive folded) or the same sessions by what they
|
|
44
|
+
* need from you, as one Accordion.Group: a row says what its session is
|
|
45
|
+
* doing and answers or stops it in place; open it and it is a small live
|
|
46
|
+
* session (the latest work and reply, the pending prompt, a reply box),
|
|
47
|
+
* lifted into a card of its own. A filter narrows it to one state, project
|
|
48
|
+
* or profile (the overview's sidebar picks it).
|
|
49
|
+
*/
|
|
50
|
+
var STATES = [
|
|
51
|
+
{ status: "waiting", label: "Needs you" },
|
|
52
|
+
{ status: "running", label: "Running" },
|
|
53
|
+
{ status: "unread", label: "To review" },
|
|
54
|
+
{ status: "idle", label: "Idle" }
|
|
55
|
+
];
|
|
56
|
+
var ROW_GRID = "grid min-w-0 items-center gap-3 grid-cols-[minmax(0,1fr)_auto] @xl:grid-cols-[minmax(0,1.3fr)_minmax(0,0.7fr)_auto] @3xl:grid-cols-[minmax(0,1.2fr)_minmax(0,0.6fr)_minmax(0,1.6fr)_auto]";
|
|
57
|
+
var ACTION_SLOT = "w-15 @lg:w-28";
|
|
58
|
+
var ACTION_ROOM = "pr-19 @lg:pr-32";
|
|
59
|
+
function withChildren(sessions, projectLabel) {
|
|
60
|
+
return sessions.flatMap((s) => [
|
|
61
|
+
{ ...s, projectLabel: projectLabel(s) },
|
|
62
|
+
...(s.children ?? []).map((c) => ({ ...c, projectLabel: projectLabel(s), child: true }))
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
function byProject(pinned, groups, archived) {
|
|
66
|
+
return [
|
|
67
|
+
{ label: "Pinned", sessions: withChildren(pinned, (s) => s.project ?? "Pinned") },
|
|
68
|
+
...groups.map((g) => ({ label: g.label, sessions: withChildren(g.sessions, (s) => s.project ?? g.label) })),
|
|
69
|
+
{ label: "Archived", sessions: withChildren(archived, (s) => s.project ?? "Archived"), folded: true }
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
function byState(pinned, groups) {
|
|
73
|
+
const all = byProject(pinned, groups, []).flatMap((section) => section.sessions).map((s) => ({ ...s, child: false }));
|
|
74
|
+
return STATES.map(({ status, label }) => ({ label, sessions: all.filter((s) => s.status === status) }));
|
|
75
|
+
}
|
|
76
|
+
function matches(session, filter) {
|
|
77
|
+
const [kind, value] = filter.split(":");
|
|
78
|
+
if (kind === "state")
|
|
79
|
+
return session.status === value;
|
|
80
|
+
if (kind === "project")
|
|
81
|
+
return session.projectLabel === value;
|
|
82
|
+
if (kind === "profile")
|
|
83
|
+
return session.profile === value;
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
function filterLabel(filter) {
|
|
87
|
+
const [kind, value] = filter.split(":");
|
|
88
|
+
if (kind === "state")
|
|
89
|
+
return STATES.find((s) => s.status === value)?.label ?? value;
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
function StatusDot({ status }) {
|
|
93
|
+
const Glyph = STATUS_GLYPH2[status];
|
|
94
|
+
if (Glyph)
|
|
95
|
+
return /* @__PURE__ */ jsx(Glyph, {
|
|
96
|
+
size: 14
|
|
97
|
+
});
|
|
98
|
+
return /* @__PURE__ */ jsx("span", {
|
|
99
|
+
className: "flex size-3.5 shrink-0 items-center justify-center",
|
|
100
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
101
|
+
className: cn("size-2 rounded-full", status === "unread" ? "bg-foreground" : "border border-muted-foreground")
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function RowDetail({ session }) {
|
|
106
|
+
if (session.status === "waiting")
|
|
107
|
+
return /* @__PURE__ */ jsx("span", {
|
|
108
|
+
className: "min-w-0 truncate text-foreground",
|
|
109
|
+
children: session.waitingOn
|
|
110
|
+
});
|
|
111
|
+
if (session.status === "running" && session.tasks) {
|
|
112
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
113
|
+
className: "flex min-w-0 items-center gap-2",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsx(Meter, {
|
|
116
|
+
variant: "line",
|
|
117
|
+
className: "w-12 shrink-0",
|
|
118
|
+
label: "Tasks done",
|
|
119
|
+
value: session.tasks.done,
|
|
120
|
+
max: session.tasks.total,
|
|
121
|
+
warnAt: 2,
|
|
122
|
+
errorAt: 2
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: "min-w-0 truncate",
|
|
126
|
+
children: session.lastLine
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return /* @__PURE__ */ jsx("span", {
|
|
132
|
+
className: "min-w-0 truncate",
|
|
133
|
+
children: session.lastLine
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
var ALLOWED = { status: "running", prompt: undefined, waitingOn: undefined, lastLine: "Allowed · resuming" };
|
|
137
|
+
var DENIED = { status: "running", prompt: undefined, waitingOn: undefined, lastLine: "Denied · rethinking" };
|
|
138
|
+
function RowActions({ session, onPatch }) {
|
|
139
|
+
const Stop = useIcon2("square");
|
|
140
|
+
const Check = useIcon2("check");
|
|
141
|
+
const X = useIcon2("x");
|
|
142
|
+
if (session.prompt?.kind === "permission") {
|
|
143
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsxs("span", {
|
|
146
|
+
className: "hidden gap-1 @lg:flex",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsx(Button, {
|
|
149
|
+
variant: "ghost",
|
|
150
|
+
size: "compact",
|
|
151
|
+
onClick: () => onPatch(DENIED),
|
|
152
|
+
children: "Deny"
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ jsx(Button, {
|
|
155
|
+
size: "compact",
|
|
156
|
+
onClick: () => onPatch(ALLOWED),
|
|
157
|
+
children: "Allow"
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsxs("span", {
|
|
162
|
+
className: "flex gap-1 @lg:hidden",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsx(Button, {
|
|
165
|
+
variant: "ghost",
|
|
166
|
+
size: "icon-compact",
|
|
167
|
+
"aria-label": "Deny",
|
|
168
|
+
onClick: () => onPatch(DENIED),
|
|
169
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ jsx(Button, {
|
|
172
|
+
size: "icon-compact",
|
|
173
|
+
"aria-label": "Allow",
|
|
174
|
+
onClick: () => onPatch(ALLOWED),
|
|
175
|
+
children: /* @__PURE__ */ jsx(Check, {})
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
if (session.status === "running") {
|
|
183
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
184
|
+
content: "Stop",
|
|
185
|
+
side: "top",
|
|
186
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
187
|
+
variant: "ghost",
|
|
188
|
+
size: "icon-compact",
|
|
189
|
+
"aria-label": `Stop ${session.title}`,
|
|
190
|
+
onClick: () => onPatch({ status: "idle", lastLine: "Stopped by you" }),
|
|
191
|
+
children: /* @__PURE__ */ jsx(Stop, {})
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (session.status === "unread") {
|
|
196
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
197
|
+
content: "Mark as read",
|
|
198
|
+
side: "top",
|
|
199
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
200
|
+
variant: "ghost",
|
|
201
|
+
size: "icon-compact",
|
|
202
|
+
"aria-label": `Mark ${session.title} as read`,
|
|
203
|
+
onClick: () => onPatch({ status: "idle" }),
|
|
204
|
+
children: /* @__PURE__ */ jsx(Check, {})
|
|
205
|
+
})
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
function PendingPrompt({ prompt, onPatch }) {
|
|
211
|
+
if (prompt.kind === "permission") {
|
|
212
|
+
return /* @__PURE__ */ jsx(agent_prompt_default.Permission, {
|
|
213
|
+
tool: prompt.tool,
|
|
214
|
+
command: prompt.command,
|
|
215
|
+
rule: prompt.rule,
|
|
216
|
+
onAnswer: (answer) => onPatch(answer === "deny" ? DENIED : ALLOWED)
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
return /* @__PURE__ */ jsx(agent_prompt_default.Question, {
|
|
220
|
+
question: prompt.question,
|
|
221
|
+
tag: prompt.tag,
|
|
222
|
+
options: prompt.options,
|
|
223
|
+
onSubmit: (labels, other) => onPatch({ status: "running", prompt: undefined, waitingOn: undefined, lastLine: other || labels.join(", ") })
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function SessionPeek({
|
|
227
|
+
session,
|
|
228
|
+
onPatch,
|
|
229
|
+
onOpen
|
|
230
|
+
}) {
|
|
231
|
+
const Open = useIcon2("arrow-up-right");
|
|
232
|
+
const running = session.status === "running";
|
|
233
|
+
const tools = session.work?.tools ?? [];
|
|
234
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
235
|
+
className: "flex max-w-3xl flex-col gap-3 pl-5.5 pt-1",
|
|
236
|
+
children: [
|
|
237
|
+
session.work && /* @__PURE__ */ jsx(transcript_default.Work, {
|
|
238
|
+
summary: session.work.summary,
|
|
239
|
+
detail: session.work.detail,
|
|
240
|
+
running,
|
|
241
|
+
children: /* @__PURE__ */ jsx(transcript_default.Tools, {
|
|
242
|
+
children: tools.map((t, i) => /* @__PURE__ */ jsx(transcript_default.Tool, {
|
|
243
|
+
index: i,
|
|
244
|
+
value: t.summary,
|
|
245
|
+
tool: t.tool,
|
|
246
|
+
summary: t.summary,
|
|
247
|
+
meta: t.meta,
|
|
248
|
+
status: running && i === tools.length - 1 ? "running" : "done"
|
|
249
|
+
}, t.summary))
|
|
250
|
+
})
|
|
251
|
+
}),
|
|
252
|
+
session.reply && /* @__PURE__ */ jsx(transcript_default.Assistant, {
|
|
253
|
+
streaming: running,
|
|
254
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
255
|
+
className: "m-0",
|
|
256
|
+
children: session.reply
|
|
257
|
+
})
|
|
258
|
+
}),
|
|
259
|
+
running && session.tasks && /* @__PURE__ */ jsx(Meter, {
|
|
260
|
+
variant: "line",
|
|
261
|
+
label: "Tasks",
|
|
262
|
+
value: session.tasks.done,
|
|
263
|
+
max: session.tasks.total,
|
|
264
|
+
detail: `${session.tasks.done} of ${session.tasks.total} · ${session.lastLine}`,
|
|
265
|
+
warnAt: 2,
|
|
266
|
+
errorAt: 2
|
|
267
|
+
}),
|
|
268
|
+
session.prompt && /* @__PURE__ */ jsx(PendingPrompt, {
|
|
269
|
+
prompt: session.prompt,
|
|
270
|
+
onPatch
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ jsx(composer_default.Draft, {
|
|
273
|
+
size: "compact",
|
|
274
|
+
minRows: 1,
|
|
275
|
+
maxRows: 4,
|
|
276
|
+
defaultStatus: running ? "streaming" : "idle",
|
|
277
|
+
placeholder: session.prompt ? "Or tell Claude what to do instead" : `Reply to ${session.title}`
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ jsxs("div", {
|
|
280
|
+
className: "flex min-w-0 items-center gap-2",
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ jsx("span", {
|
|
283
|
+
className: "min-w-0 flex-1 truncate text-caption text-muted-foreground",
|
|
284
|
+
children: [STATUS_LABEL2[session.status], session.profile, session.branch].filter(Boolean).join(" · ")
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ jsx(Button, {
|
|
287
|
+
variant: "ghost",
|
|
288
|
+
size: "compact",
|
|
289
|
+
trailingIcon: Open,
|
|
290
|
+
onClick: () => onOpen?.(session.id),
|
|
291
|
+
children: "Open session"
|
|
292
|
+
})
|
|
293
|
+
]
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function SessionItem({
|
|
299
|
+
session,
|
|
300
|
+
profile,
|
|
301
|
+
index,
|
|
302
|
+
open,
|
|
303
|
+
onPatch,
|
|
304
|
+
onOpen
|
|
305
|
+
}) {
|
|
306
|
+
const size = useSize();
|
|
307
|
+
const shape = useShape();
|
|
308
|
+
const substrate = useSurface();
|
|
309
|
+
const level = Math.min(substrate + 2, 8);
|
|
310
|
+
const patch = (p) => onPatch(session.id, p);
|
|
311
|
+
return /* @__PURE__ */ jsx(Accordion.Item, {
|
|
312
|
+
value: session.id,
|
|
313
|
+
index,
|
|
314
|
+
className: cn("transition-[margin,padding,background-color,box-shadow] duration-moderate", open && ["-mx-1 my-3 p-1", SURFACE_BG[level], SURFACE_SHADOW[3], shape.container]),
|
|
315
|
+
children: /* @__PURE__ */ jsxs(SurfaceProvider, {
|
|
316
|
+
value: open ? level : substrate,
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ jsxs("div", {
|
|
319
|
+
className: "relative",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ jsx(Accordion.Trigger, {
|
|
322
|
+
className: cn("[&>span:first-child]:min-w-0", ACTION_ROOM),
|
|
323
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
324
|
+
className: ROW_GRID,
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ jsxs("span", {
|
|
327
|
+
className: cn("flex min-w-0 items-center gap-2", session.child && "pl-5.5"),
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ jsx(StatusDot, {
|
|
330
|
+
status: session.status
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ jsx("span", {
|
|
333
|
+
className: "min-w-0 truncate",
|
|
334
|
+
children: session.title
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsxs("span", {
|
|
339
|
+
className: "hidden min-w-0 items-center gap-1.5 weight-normal text-muted-foreground @xl:flex",
|
|
340
|
+
children: [
|
|
341
|
+
profile && /* @__PURE__ */ jsx(ProfileTile2, {
|
|
342
|
+
profile,
|
|
343
|
+
size: "sm"
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ jsx("span", {
|
|
346
|
+
className: "min-w-0 truncate",
|
|
347
|
+
children: session.projectLabel
|
|
348
|
+
})
|
|
349
|
+
]
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ jsx("span", {
|
|
352
|
+
className: "hidden min-w-0 weight-normal text-muted-foreground @3xl:flex",
|
|
353
|
+
children: /* @__PURE__ */ jsx(RowDetail, {
|
|
354
|
+
session
|
|
355
|
+
})
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ jsx("span", {
|
|
358
|
+
className: "w-8 text-right text-caption weight-normal tabular-nums text-muted-foreground",
|
|
359
|
+
children: session.updated
|
|
360
|
+
})
|
|
361
|
+
]
|
|
362
|
+
})
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ jsx("div", {
|
|
365
|
+
className: cn("absolute right-1 top-0 z-20 flex items-center justify-end", size.control, ACTION_SLOT),
|
|
366
|
+
children: /* @__PURE__ */ jsx(RowActions, {
|
|
367
|
+
session,
|
|
368
|
+
onPatch: patch
|
|
369
|
+
})
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ jsx(Accordion.Content, {
|
|
374
|
+
children: /* @__PURE__ */ jsx(SessionPeek, {
|
|
375
|
+
session,
|
|
376
|
+
onPatch: patch,
|
|
377
|
+
onOpen
|
|
378
|
+
})
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
})
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function SectionHeading({ section, open, onToggle }) {
|
|
385
|
+
const Chevron = useIcon2("chevron-right");
|
|
386
|
+
const label = /* @__PURE__ */ jsxs(Fragment, {
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ jsx("span", {
|
|
389
|
+
className: "weight-medium text-foreground",
|
|
390
|
+
children: section.label
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ jsx("span", {
|
|
393
|
+
className: "tabular-nums",
|
|
394
|
+
children: section.sessions.length
|
|
395
|
+
})
|
|
396
|
+
]
|
|
397
|
+
});
|
|
398
|
+
return /* @__PURE__ */ jsx("div", {
|
|
399
|
+
className: "flex h-9 items-end gap-2 px-3 pb-1.5 text-caption text-muted-foreground",
|
|
400
|
+
children: section.folded ? /* @__PURE__ */ jsxs("button", {
|
|
401
|
+
type: "button",
|
|
402
|
+
"aria-expanded": open,
|
|
403
|
+
onClick: onToggle,
|
|
404
|
+
className: "flex cursor-pointer items-center gap-2 rounded-glyph outline-none focus-visible:ring-1 focus-visible:ring-focus-ring",
|
|
405
|
+
children: [
|
|
406
|
+
label,
|
|
407
|
+
/* @__PURE__ */ jsx(motion.span, {
|
|
408
|
+
className: "inline-flex",
|
|
409
|
+
animate: { rotate: open ? 90 : 0 },
|
|
410
|
+
transition: spring.fast,
|
|
411
|
+
children: /* @__PURE__ */ jsx(Chevron, {
|
|
412
|
+
size: 12,
|
|
413
|
+
strokeWidth: 1.5
|
|
414
|
+
})
|
|
415
|
+
})
|
|
416
|
+
]
|
|
417
|
+
}) : label
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function SessionBoard2({
|
|
421
|
+
pinned,
|
|
422
|
+
groups,
|
|
423
|
+
archived,
|
|
424
|
+
profiles,
|
|
425
|
+
view,
|
|
426
|
+
defaultView = "project",
|
|
427
|
+
onViewChange,
|
|
428
|
+
filter,
|
|
429
|
+
defaultFilter = "all",
|
|
430
|
+
onFilterChange,
|
|
431
|
+
open,
|
|
432
|
+
defaultOpen = [],
|
|
433
|
+
onOpenChange,
|
|
434
|
+
onOpen,
|
|
435
|
+
onPatch,
|
|
436
|
+
className
|
|
437
|
+
}) {
|
|
438
|
+
const [current, setCurrent] = useControllableState(view, defaultView, onViewChange);
|
|
439
|
+
const [shown, setShown] = useControllableState(filter, defaultFilter, onFilterChange);
|
|
440
|
+
const [openRows, setOpenRows] = useControllableState(open, defaultOpen, onOpenChange);
|
|
441
|
+
const [patches, setPatches] = useState({});
|
|
442
|
+
const [archiveOpen, setArchiveOpen] = useState(false);
|
|
443
|
+
const Folder = useIcon2("folder");
|
|
444
|
+
const Kanban = useIcon2("square-kanban");
|
|
445
|
+
const live = (s) => ({ ...s, ...patches[s.id] });
|
|
446
|
+
const sections = (current === "project" ? byProject(pinned, groups, archived) : byState(pinned, groups)).map((section) => ({
|
|
447
|
+
...section,
|
|
448
|
+
sessions: section.sessions.map(live).filter((s) => matches(s, shown)).map((s) => ({ ...s, child: s.child && shown === "all" }))
|
|
449
|
+
})).filter((section) => section.sessions.length > 0);
|
|
450
|
+
const all = byState(pinned, groups).flatMap((section) => section.sessions.map(live));
|
|
451
|
+
const waiting = all.filter((s) => s.status === "waiting").length;
|
|
452
|
+
const running = all.filter((s) => s.status === "running").length;
|
|
453
|
+
const count = sections.reduce((n, section) => n + section.sessions.length, 0);
|
|
454
|
+
const patch = (id, p) => {
|
|
455
|
+
setPatches((prev) => ({ ...prev, [id]: { ...prev[id], ...p } }));
|
|
456
|
+
onPatch?.(id, p);
|
|
457
|
+
};
|
|
458
|
+
let index = 0;
|
|
459
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
460
|
+
className: cn("@container flex min-w-0 flex-col gap-2", className),
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ jsxs("div", {
|
|
463
|
+
className: "flex flex-wrap items-center gap-3 px-3",
|
|
464
|
+
children: [
|
|
465
|
+
shown === "all" ? /* @__PURE__ */ jsxs("p", {
|
|
466
|
+
className: "m-0 min-w-0 flex-1 text-body text-muted-foreground",
|
|
467
|
+
children: [
|
|
468
|
+
waiting,
|
|
469
|
+
" need you · ",
|
|
470
|
+
running,
|
|
471
|
+
" running · ",
|
|
472
|
+
all.length,
|
|
473
|
+
" sessions"
|
|
474
|
+
]
|
|
475
|
+
}) : /* @__PURE__ */ jsxs("p", {
|
|
476
|
+
className: "m-0 flex min-w-0 flex-1 items-center gap-2 text-body text-muted-foreground",
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ jsxs("span", {
|
|
479
|
+
className: "min-w-0 truncate",
|
|
480
|
+
children: [
|
|
481
|
+
/* @__PURE__ */ jsx("span", {
|
|
482
|
+
className: "weight-medium text-foreground",
|
|
483
|
+
children: filterLabel(shown)
|
|
484
|
+
}),
|
|
485
|
+
" · ",
|
|
486
|
+
count,
|
|
487
|
+
" of ",
|
|
488
|
+
all.length,
|
|
489
|
+
" ",
|
|
490
|
+
"sessions"
|
|
491
|
+
]
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ jsx(Button, {
|
|
494
|
+
variant: "ghost",
|
|
495
|
+
size: "compact",
|
|
496
|
+
onClick: () => setShown("all"),
|
|
497
|
+
children: "Show all"
|
|
498
|
+
})
|
|
499
|
+
]
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ jsx(SizeProvider, {
|
|
502
|
+
size: "compact",
|
|
503
|
+
children: /* @__PURE__ */ jsx(Tabs, {
|
|
504
|
+
variant: "subtle",
|
|
505
|
+
value: current,
|
|
506
|
+
onValueChange: (value) => setCurrent(value),
|
|
507
|
+
children: /* @__PURE__ */ jsxs(Tabs.List, {
|
|
508
|
+
"aria-label": "Group sessions",
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ jsx(Tabs.Item, {
|
|
511
|
+
value: "project",
|
|
512
|
+
icon: Folder,
|
|
513
|
+
label: "By project"
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ jsx(Tabs.Item, {
|
|
516
|
+
value: "state",
|
|
517
|
+
icon: Kanban,
|
|
518
|
+
label: "By state"
|
|
519
|
+
})
|
|
520
|
+
]
|
|
521
|
+
})
|
|
522
|
+
})
|
|
523
|
+
})
|
|
524
|
+
]
|
|
525
|
+
}),
|
|
526
|
+
/* @__PURE__ */ jsx(Accordion.Group, {
|
|
527
|
+
type: "multiple",
|
|
528
|
+
value: openRows,
|
|
529
|
+
onValueChange: setOpenRows,
|
|
530
|
+
highlight: "trigger",
|
|
531
|
+
className: "w-full max-w-none",
|
|
532
|
+
children: sections.map((section) => {
|
|
533
|
+
const unfolded = !section.folded || archiveOpen;
|
|
534
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
535
|
+
"aria-label": section.label,
|
|
536
|
+
className: "flex flex-col",
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ jsx(SectionHeading, {
|
|
539
|
+
section,
|
|
540
|
+
open: unfolded,
|
|
541
|
+
onToggle: () => setArchiveOpen(!archiveOpen)
|
|
542
|
+
}),
|
|
543
|
+
unfolded && section.sessions.map((session) => /* @__PURE__ */ jsx(SessionItem, {
|
|
544
|
+
session,
|
|
545
|
+
profile: profiles.find((p) => p.id === session.profile),
|
|
546
|
+
index: index++,
|
|
547
|
+
open: openRows.includes(session.id),
|
|
548
|
+
onPatch: patch,
|
|
549
|
+
onOpen
|
|
550
|
+
}, session.id))
|
|
551
|
+
]
|
|
552
|
+
}, section.label);
|
|
553
|
+
})
|
|
554
|
+
})
|
|
555
|
+
]
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
export { SessionBoard2 };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// lib/pace.ts
|
|
2
|
+
/*!
|
|
3
|
+
* Local addition: the profile usage's model of a limit over time. A
|
|
4
|
+
* limit's share alone says little (78% used is fine when it resets in a few
|
|
5
|
+
* hours), so each limit is read against its window: the burn rate so far,
|
|
6
|
+
* where that rate lands at the reset, and whether it runs out first.
|
|
7
|
+
*/
|
|
8
|
+
var WATCH_AT = 0.95;
|
|
9
|
+
var MIN_ELAPSED = 0.1;
|
|
10
|
+
function paceOfLimit(limit) {
|
|
11
|
+
const elapsedHours = limit.windowHours - limit.resetsInHours;
|
|
12
|
+
const rate = limit.value / Math.max(elapsedHours, limit.windowHours * MIN_ELAPSED);
|
|
13
|
+
const projected = limit.value + rate * limit.resetsInHours;
|
|
14
|
+
const runsOut = rate > 0 ? (1 - limit.value) / rate : Number.POSITIVE_INFINITY;
|
|
15
|
+
const runsOutInHours = runsOut < limit.resetsInHours ? runsOut : Number.POSITIVE_INFINITY;
|
|
16
|
+
const verdict = runsOutInHours < Number.POSITIVE_INFINITY ? "tight" : projected >= WATCH_AT ? "watch" : "free";
|
|
17
|
+
return { limit, elapsed: elapsedHours / limit.windowHours, projected, runsOutInHours, verdict };
|
|
18
|
+
}
|
|
19
|
+
function paceOf2(profile) {
|
|
20
|
+
const limits = profile.limits.map(paceOfLimit);
|
|
21
|
+
const binding = [...limits].sort((a, b) => b.projected - a.projected)[0] ?? paceOfLimit(profile.limits[0]);
|
|
22
|
+
return { profile, limits, binding };
|
|
23
|
+
}
|
|
24
|
+
function duration2(hours) {
|
|
25
|
+
if (hours < 1)
|
|
26
|
+
return `${Math.max(Math.round(hours * 60), 1)}m`;
|
|
27
|
+
if (hours < 10) {
|
|
28
|
+
const h = Math.floor(hours);
|
|
29
|
+
const m = Math.round((hours - h) * 60);
|
|
30
|
+
return m === 0 ? `${h}h` : `${h}h ${m}m`;
|
|
31
|
+
}
|
|
32
|
+
if (hours < 48)
|
|
33
|
+
return `${Math.round(hours)}h`;
|
|
34
|
+
return `${Math.round(hours / 24)}d`;
|
|
35
|
+
}
|
|
36
|
+
function percent2(share) {
|
|
37
|
+
return `${Math.round(share * 100)}%`;
|
|
38
|
+
}
|
|
39
|
+
var VERDICT_TEXT2 = {
|
|
40
|
+
free: "text-muted-foreground",
|
|
41
|
+
watch: "text-status-warning",
|
|
42
|
+
tight: "text-status-error"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { paceOf2, duration2, percent2, VERDICT_TEXT2 };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
interface Shortcut2 {
|
|
4
|
+
/** What it does. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The keys: one string per chord, several for a sequence (`['G', 'S']`). */
|
|
7
|
+
keys: string[];
|
|
8
|
+
/** More words the filter matches. */
|
|
9
|
+
keywords?: string[];
|
|
10
|
+
}
|
|
11
|
+
interface ShortcutGroup2 {
|
|
12
|
+
label: string;
|
|
13
|
+
shortcuts: Shortcut2[];
|
|
14
|
+
}
|
|
15
|
+
interface ShortcutsSheetPanelProps2 {
|
|
16
|
+
/** The shortcuts, in groups. */
|
|
17
|
+
groups: ShortcutGroup2[];
|
|
18
|
+
/** Controlled filter. Pair with `onQueryChange`. */
|
|
19
|
+
query?: string;
|
|
20
|
+
/** The filter it starts with. Defaults to `''`. */
|
|
21
|
+
defaultQuery?: string;
|
|
22
|
+
/** Called as the filter changes. */
|
|
23
|
+
onQueryChange?: (query: string) => void;
|
|
24
|
+
/** Classes for the root. */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
28
|
+
/** The shortcuts on their own, without the Dialog: the filter and the groups. */
|
|
29
|
+
declare function ShortcutsSheetPanel2({ groups, query, defaultQuery, onQueryChange, className }: ShortcutsSheetPanelProps2): Element_12xgc;
|
|
30
|
+
interface ShortcutsSheetProps2 {
|
|
31
|
+
/** The shortcuts, in groups. */
|
|
32
|
+
groups: ShortcutGroup2[];
|
|
33
|
+
/** The control that opens it. */
|
|
34
|
+
trigger?: ReactElement;
|
|
35
|
+
/** Controlled open state. */
|
|
36
|
+
open?: boolean;
|
|
37
|
+
/** Initial open state, for an uncontrolled dialog. Defaults to `false`. */
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
/** Called when the dialog opens or closes. */
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
/** The key that toggles it with ⌘ (Ctrl elsewhere); `false` leaves the keyboard alone. Defaults to `'/'`. */
|
|
42
|
+
hotkey?: string | false;
|
|
43
|
+
/** The filter it starts with. Defaults to `''`. */
|
|
44
|
+
defaultQuery?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every keyboard shortcut in the app, in one place: sessions, navigation,
|
|
48
|
+
* the composer and the panes.
|
|
49
|
+
*
|
|
50
|
+
* Each row is what the shortcut does and its keys, a chord as one keycap and
|
|
51
|
+
* a sequence as several. Type to filter by what a shortcut does or by its
|
|
52
|
+
* keys ("⌘", "pane", "send"); groups with nothing left hide. ⌘/ (Ctrl+/
|
|
53
|
+
* elsewhere) opens it from anywhere; the dialog grows out of its trigger.
|
|
54
|
+
* `ShortcutsSheet.Panel` is the same list without the dialog.
|
|
55
|
+
*
|
|
56
|
+
* Statics:
|
|
57
|
+
* - `ShortcutsSheet.Panel` — the list on its own: `groups`, `query`, `defaultQuery`.
|
|
58
|
+
*
|
|
59
|
+
* @example {@include ./examples.mdx}
|
|
60
|
+
*/
|
|
61
|
+
declare const ShortcutsSheet2: (({ groups, trigger, open, defaultOpen, onOpenChange, hotkey, defaultQuery }: ShortcutsSheetProps2) => Element_12xgc) & {
|
|
62
|
+
Panel: typeof ShortcutsSheetPanel2;
|
|
63
|
+
};
|
|
64
|
+
export { Shortcut2, ShortcutGroup2, ShortcutsSheetPanelProps2, ShortcutsSheetPanel2, ShortcutsSheetProps2, ShortcutsSheet2 };
|