@justanarthur/modo-ui-ai 0.0.0-stage → 0.3.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 +164 -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 +651 -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 +206 -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 +50 -0
- package/blocks/dialogs/command-palette/index.tsx +239 -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 +23 -0
- package/blocks/panes/usage-pane/index.tsx +78 -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 +29 -0
- package/blocks/profiles/profile-switcher/index.tsx +212 -0
- package/blocks/profiles/profile-usage/examples.mdx +41 -0
- package/blocks/profiles/profile-usage/index.tsx +141 -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 +93 -0
- package/blocks/sessions/session-sidebar/index.tsx +497 -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 +38 -0
- package/components/conversation/agent-run/index.tsx +83 -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 +130 -0
- package/components/conversation/message/working.tsx +102 -0
- package/components/conversation/reasoning/examples.mdx +32 -0
- package/components/conversation/reasoning/index.tsx +55 -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 +16 -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 +12 -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 +27 -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 +14 -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-1hzrm8r5.d.ts +51 -0
- package/dist/shared/chunk-1qdwg7w5.d.ts +81 -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-3ps5h55t.d.ts +30 -0
- package/dist/shared/chunk-3yaftgh0.d.ts +28 -0
- package/dist/shared/chunk-4zvhpf2x.js +55 -0
- package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
- package/dist/shared/chunk-58jh3mje.js +46 -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-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-6kwk9vag.js +558 -0
- package/dist/shared/chunk-6rdwkymk.js +177 -0
- package/dist/shared/chunk-71j8qzvb.d.ts +57 -0
- package/dist/shared/chunk-74bvf3tw.d.ts +21 -0
- package/dist/shared/chunk-75zwypyr.d.ts +43 -0
- package/dist/shared/chunk-7mfer3tp.js +176 -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-94grzz9f.js +187 -0
- package/dist/shared/chunk-9kw6m047.d.ts +32 -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-b4dz15em.d.ts +36 -0
- package/dist/shared/chunk-b5ccp5de.js +35 -0
- package/dist/shared/chunk-bh2b5d1z.js +98 -0
- package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
- package/dist/shared/chunk-c8wp058j.js +153 -0
- package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
- package/dist/shared/chunk-dh3qy5fj.js +49 -0
- package/dist/shared/chunk-dxzrtvt9.d.ts +283 -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-fapc805j.js +130 -0
- package/dist/shared/chunk-fm1qyrae.d.ts +68 -0
- package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
- package/dist/shared/chunk-g88hweqh.d.ts +70 -0
- package/dist/shared/chunk-gb5ee5dw.d.ts +88 -0
- package/dist/shared/chunk-gewnsgza.js +61 -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-kreypnzp.d.ts +34 -0
- package/dist/shared/chunk-mnzw0bav.js +80 -0
- package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
- package/dist/shared/chunk-n1qq2wp9.js +6 -0
- package/dist/shared/chunk-n31qwnj2.js +1544 -0
- package/dist/shared/chunk-n4742y54.js +39 -0
- package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
- package/dist/shared/chunk-njf851p1.js +245 -0
- package/dist/shared/chunk-nk4578dr.js +73 -0
- package/dist/shared/chunk-nkbgg7bw.d.ts +24 -0
- package/dist/shared/chunk-nvh33x9x.js +488 -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-qt31n444.js +178 -0
- package/dist/shared/chunk-r5hz78pb.js +129 -0
- package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
- package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
- package/dist/shared/chunk-s3r759ec.js +80 -0
- package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
- package/dist/shared/chunk-skg3m9m0.js +56 -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-ty2ccknv.d.ts +54 -0
- package/dist/shared/chunk-v6yevw62.d.ts +28 -0
- package/dist/shared/chunk-v9q38p0x.js +258 -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-whsx7yp9.d.ts +37 -0
- package/dist/shared/chunk-wq9h37gy.js +86 -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 +78 -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,81 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
type InboxKind2 = "permission" | "question" | "plan" | "finished" | "ci-failed" | "rate-limit";
|
|
4
|
+
/** What a row's buttons do: answer a permission, open the session, or move to a profile with room. */
|
|
5
|
+
type InboxAction2 = "allow" | "deny" | "open" | "switch-profile";
|
|
6
|
+
interface InboxItem2 {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: InboxKind2;
|
|
9
|
+
/** What it is about: the command, the question, the PR's check. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** The session it came from. */
|
|
12
|
+
sessionId: string;
|
|
13
|
+
session: string;
|
|
14
|
+
project?: string;
|
|
15
|
+
/** The profile it ran under; for a rate limit, the one running out. */
|
|
16
|
+
profile?: string;
|
|
17
|
+
/** One more line: the tool, the reply's first line, the failing step. */
|
|
18
|
+
detail?: string;
|
|
19
|
+
/** Minutes since it arrived; groups the list and reads as "3m", "2h", "1d". */
|
|
20
|
+
ago: number;
|
|
21
|
+
read?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface InboxListProps2 {
|
|
24
|
+
/** Everything waiting on the user, newest first or in any order: rows sort by `ago`. */
|
|
25
|
+
items: InboxItem2[];
|
|
26
|
+
/** Called when a row is answered or opened: allow / deny a permission, open its session, switch profile on a limit. */
|
|
27
|
+
onAction?: (item: InboxItem2, action: InboxAction2) => void;
|
|
28
|
+
/** Called when Mark all read is pressed. */
|
|
29
|
+
onMarkAllRead?: () => void;
|
|
30
|
+
/** Show the header with the title and Mark all read; turn it off in a pane that has its own. Defaults to `true`. */
|
|
31
|
+
header?: boolean;
|
|
32
|
+
/** Classes for the root. */
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
36
|
+
/** The inbox's rows, grouped by recency, with the header's Mark all read. */
|
|
37
|
+
declare function InboxList2({ items, onAction, onMarkAllRead, header, className }: InboxListProps2): Element_12xgc;
|
|
38
|
+
interface InboxProps2 {
|
|
39
|
+
/** Everything waiting on the user. */
|
|
40
|
+
items: InboxItem2[];
|
|
41
|
+
/** Called when a row is answered or opened: allow / deny a permission, open its session, switch profile on a limit. */
|
|
42
|
+
onAction?: (item: InboxItem2, action: InboxAction2) => void;
|
|
43
|
+
/** Called when Mark all read is pressed. */
|
|
44
|
+
onMarkAllRead?: () => void;
|
|
45
|
+
/** Controlled open state. */
|
|
46
|
+
open?: boolean;
|
|
47
|
+
/** Initial open state. Defaults to `false`. */
|
|
48
|
+
defaultOpen?: boolean;
|
|
49
|
+
/** Called when the panel opens or closes. */
|
|
50
|
+
onOpenChange?: (open: boolean) => void;
|
|
51
|
+
/** Which side of the bell the panel opens on. Defaults to `'bottom'`. */
|
|
52
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
53
|
+
/** Where the panel lines up along that side. Defaults to `'end'`. */
|
|
54
|
+
align?: "start" | "center" | "end";
|
|
55
|
+
/** Replaces the bell (a sidebar row, say); it gets the unread count's label. */
|
|
56
|
+
trigger?: ReactElement;
|
|
57
|
+
/** Classes for the bell. */
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Everything across sessions that needs you, behind a bell: permissions,
|
|
62
|
+
* questions and plans waiting, finished turns, failed CI runs and limits
|
|
63
|
+
* running out.
|
|
64
|
+
*
|
|
65
|
+
* The bell carries the unread count. Its panel grows out of it and lists the
|
|
66
|
+
* items by recency (the last hour, today, earlier), each with where it came
|
|
67
|
+
* from (the session, its project and profile) and what to do about it, in
|
|
68
|
+
* place: allow or deny a permission, answer a question, review a plan, open
|
|
69
|
+
* a failed check, switch to a profile with room. A press anywhere else on a
|
|
70
|
+
* row opens its session. Mark all read clears the count. `InboxList` is the
|
|
71
|
+
* list without the bell, for a pane or a page.
|
|
72
|
+
*
|
|
73
|
+
* Statics:
|
|
74
|
+
* - `Inbox.List` — the list on its own: `items`, `onAction`, `onMarkAllRead`, `header`.
|
|
75
|
+
*
|
|
76
|
+
* @example {@include ./examples.mdx}
|
|
77
|
+
*/
|
|
78
|
+
declare const Inbox2: (({ items, onAction, onMarkAllRead, open, defaultOpen, onOpenChange, side, align, trigger, className }: InboxProps2) => Element_12xgc) & {
|
|
79
|
+
List: typeof InboxList2;
|
|
80
|
+
};
|
|
81
|
+
export { InboxKind2, InboxAction2, InboxItem2, InboxListProps2, InboxList2, InboxProps2, Inbox2 };
|
|
@@ -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-wq9h37gy.js";
|
|
13
|
+
import {
|
|
14
|
+
ProfileTile2
|
|
15
|
+
} from "./chunk-njf851p1.js";
|
|
16
|
+
import {
|
|
17
|
+
composer_default
|
|
18
|
+
} from "./chunk-n31qwnj2.js";
|
|
19
|
+
import {
|
|
20
|
+
transcript_default
|
|
21
|
+
} from "./chunk-qt31n444.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 };
|