@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,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
|
|
7
|
+
// blocks/dialogs/shortcuts-sheet/index.tsx
|
|
8
|
+
import Kbd from "@justanarthur/modo-ui/components/data-display/kbd";
|
|
9
|
+
import Input from "@justanarthur/modo-ui/components/inputs/input";
|
|
10
|
+
import Dialog from "@justanarthur/modo-ui/components/overlays/dialog";
|
|
11
|
+
import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
|
|
12
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
13
|
+
import ScrollArea from "@justanarthur/modo-ui/primitives/layout/scroll-area";
|
|
14
|
+
import { useEffect } from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
/*!
|
|
17
|
+
* Local addition: the AI app's keyboard shortcuts reference. A Dialog with
|
|
18
|
+
* the shortcuts in groups (sessions, navigation, composer, panes), each a
|
|
19
|
+
* label and its keys as Kbd chips, and a field that filters them by what
|
|
20
|
+
* they do or by their keys.
|
|
21
|
+
*/
|
|
22
|
+
function matches(shortcut, query) {
|
|
23
|
+
const q = query.trim().toLowerCase();
|
|
24
|
+
if (!q)
|
|
25
|
+
return true;
|
|
26
|
+
return [shortcut.label, shortcut.keys.join(" "), ...shortcut.keywords ?? []].some((text) => text.toLowerCase().includes(q));
|
|
27
|
+
}
|
|
28
|
+
function ShortcutsSheetPanel2({ groups, query, defaultQuery = "", onQueryChange, className }) {
|
|
29
|
+
const [q, setQ] = useControllableState(query, defaultQuery, onQueryChange);
|
|
30
|
+
const SearchIcon = useIcon2("search");
|
|
31
|
+
const shown = groups.map((group) => ({ ...group, shortcuts: group.shortcuts.filter((s) => matches(s, q)) })).filter((group) => group.shortcuts.length > 0);
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: cn("@container flex min-h-0 flex-col gap-[var(--space-4)]", className),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "flex items-center gap-[var(--space-3)] pr-[var(--space-6)]",
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx("h2", {
|
|
39
|
+
className: "m-0 text-title text-foreground",
|
|
40
|
+
children: "Keyboard shortcuts"
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(Input, {
|
|
43
|
+
autoFocus: true,
|
|
44
|
+
variant: "bordered",
|
|
45
|
+
size: "compact",
|
|
46
|
+
icon: SearchIcon,
|
|
47
|
+
"aria-label": "Filter shortcuts",
|
|
48
|
+
placeholder: "Filter…",
|
|
49
|
+
className: "ml-auto w-56",
|
|
50
|
+
value: q,
|
|
51
|
+
onValueChange: setQ
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsx(ScrollArea, {
|
|
56
|
+
className: "min-h-0 flex-1",
|
|
57
|
+
viewportClassName: "scroll-fade",
|
|
58
|
+
children: shown.length === 0 ? /* @__PURE__ */ jsxs("p", {
|
|
59
|
+
className: "m-0 py-[var(--space-6)] text-center text-body text-muted-foreground",
|
|
60
|
+
children: [
|
|
61
|
+
"No shortcut matches “",
|
|
62
|
+
q.trim(),
|
|
63
|
+
"”."
|
|
64
|
+
]
|
|
65
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
66
|
+
className: "grid grid-cols-1 gap-x-[var(--space-6)] gap-y-[var(--space-5)] @lg:grid-cols-2",
|
|
67
|
+
children: shown.map((group) => /* @__PURE__ */ jsxs("section", {
|
|
68
|
+
"aria-label": group.label,
|
|
69
|
+
className: "flex flex-col",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "pb-[var(--space-1)] text-caption text-muted-foreground",
|
|
73
|
+
children: group.label
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsx("dl", {
|
|
76
|
+
className: "m-0 flex flex-col",
|
|
77
|
+
children: group.shortcuts.map((shortcut) => /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
className: "flex h-8 items-center gap-[var(--space-3)] border-b border-border last:border-b-0",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx("dt", {
|
|
81
|
+
className: "min-w-0 flex-1 truncate text-body text-foreground",
|
|
82
|
+
children: shortcut.label
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx("dd", {
|
|
85
|
+
className: "m-0 flex shrink-0 items-center gap-[var(--space-1)]",
|
|
86
|
+
children: shortcut.keys.map((key, i) => /* @__PURE__ */ jsxs("span", {
|
|
87
|
+
className: "flex items-center gap-[var(--space-1)]",
|
|
88
|
+
children: [
|
|
89
|
+
i > 0 && /* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: "text-caption text-muted-foreground",
|
|
91
|
+
children: "then"
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ jsx(Kbd, {
|
|
94
|
+
children: key
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}, `${i}-${key}`))
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
}, shortcut.label))
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
}, group.label))
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
var ShortcutsSheet2 = Object.assign(function ShortcutsSheet({
|
|
110
|
+
groups,
|
|
111
|
+
trigger,
|
|
112
|
+
open,
|
|
113
|
+
defaultOpen = false,
|
|
114
|
+
onOpenChange,
|
|
115
|
+
hotkey = "/",
|
|
116
|
+
defaultQuery
|
|
117
|
+
}) {
|
|
118
|
+
const [isOpen, setOpen] = useControllableState(open, defaultOpen, onOpenChange);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!hotkey)
|
|
121
|
+
return;
|
|
122
|
+
const onKey = (event) => {
|
|
123
|
+
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === hotkey) {
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
setOpen(!isOpen);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
window.addEventListener("keydown", onKey);
|
|
129
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
130
|
+
}, [hotkey, isOpen, setOpen]);
|
|
131
|
+
return /* @__PURE__ */ jsxs(Dialog, {
|
|
132
|
+
open: isOpen,
|
|
133
|
+
onOpenChange: setOpen,
|
|
134
|
+
children: [
|
|
135
|
+
trigger && /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
136
|
+
render: trigger
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx(Dialog.Content, {
|
|
139
|
+
width: "xl",
|
|
140
|
+
"aria-label": "Keyboard shortcuts",
|
|
141
|
+
className: "flex h-[min(600px,80dvh)] flex-col",
|
|
142
|
+
children: /* @__PURE__ */ jsx(ShortcutsSheetPanel2, {
|
|
143
|
+
groups,
|
|
144
|
+
defaultQuery,
|
|
145
|
+
className: "flex-1"
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
}, { Panel: ShortcutsSheetPanel2 });
|
|
151
|
+
var shortcuts_sheet_default = ShortcutsSheet2;
|
|
152
|
+
|
|
153
|
+
export { ShortcutsSheetPanel2, ShortcutsSheet2, shortcuts_sheet_default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSX as JSX_1kxb } from "react";
|
|
2
|
+
interface QuestionOption2 {
|
|
3
|
+
/** The answer, also what `onSubmit` reports. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** One line under the label. */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Shown beside the list while this option is picked: a mockup, a snippet. */
|
|
8
|
+
preview?: string;
|
|
9
|
+
}
|
|
10
|
+
interface QuestionPromptProps2 {
|
|
11
|
+
/** The question. */
|
|
12
|
+
question: string;
|
|
13
|
+
/** Its topic, as a chip: `Layout`, `Auth`. */
|
|
14
|
+
tag?: string;
|
|
15
|
+
/** Two to four options; labels are unique. */
|
|
16
|
+
options: QuestionOption2[];
|
|
17
|
+
/** Pick several. Defaults to `false`. */
|
|
18
|
+
multiSelect?: boolean;
|
|
19
|
+
/** Called with the picked labels and any "Other" text. */
|
|
20
|
+
onSubmit?: (labels: string[], other: string) => void;
|
|
21
|
+
}
|
|
22
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
23
|
+
/**
|
|
24
|
+
* A question the agent asks with a few answers to pick from.
|
|
25
|
+
*
|
|
26
|
+
* One answer sits on a Choice list: the pick's background melts between
|
|
27
|
+
* options and the arrow keys move it. With `multiSelect` the options are
|
|
28
|
+
* checkboxes and neighbouring picks melt into one run. Options with a
|
|
29
|
+
* `preview` show the picked one beside the list, dropping below it on a
|
|
30
|
+
* narrow card. An "Other" field takes an answer of your own.
|
|
31
|
+
*
|
|
32
|
+
* @example {@include ./examples.mdx}
|
|
33
|
+
*/
|
|
34
|
+
declare function QuestionPrompt2({ question, tag, options, multiSelect, onSubmit }: QuestionPromptProps2): Element_12xgc;
|
|
35
|
+
export { QuestionOption2, QuestionPromptProps2, QuestionPrompt2 };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
import {
|
|
7
|
+
Section2,
|
|
8
|
+
Group2,
|
|
9
|
+
Toggles2
|
|
10
|
+
} from "./chunk-5meda998.js";
|
|
11
|
+
|
|
12
|
+
// blocks/settings/extensions/index.tsx
|
|
13
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
14
|
+
import Switch from "@justanarthur/modo-ui/components/inputs/switch";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
/*!
|
|
17
|
+
* Local addition: the settings screen's extensions section — your own
|
|
18
|
+
* panes, commands, actions and hooks, each a switch.
|
|
19
|
+
*/
|
|
20
|
+
function Extensions2({ extensions, onNew, onToggle }) {
|
|
21
|
+
const Plus = useIcon2("plus");
|
|
22
|
+
return /* @__PURE__ */ jsx(Section2, {
|
|
23
|
+
title: "Extensions",
|
|
24
|
+
lead: "Your own features: panes, commands, actions and hooks, built as MCP servers, plugins, skills and hooks, so they work in the CLI too.",
|
|
25
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
26
|
+
size: "compact",
|
|
27
|
+
leadingIcon: Plus,
|
|
28
|
+
onClick: onNew,
|
|
29
|
+
children: "New extension"
|
|
30
|
+
}),
|
|
31
|
+
children: /* @__PURE__ */ jsx(Group2, {
|
|
32
|
+
title: "Installed",
|
|
33
|
+
aside: /* @__PURE__ */ jsx("span", {
|
|
34
|
+
className: "tabular-nums",
|
|
35
|
+
children: extensions.length
|
|
36
|
+
}),
|
|
37
|
+
children: /* @__PURE__ */ jsx(Toggles2, {
|
|
38
|
+
label: "Extensions",
|
|
39
|
+
children: extensions.map((extension) => /* @__PURE__ */ jsx(Switch, {
|
|
40
|
+
label: extension.name,
|
|
41
|
+
description: `${extension.kind} · ${extension.description} · from ${extension.source}`,
|
|
42
|
+
defaultChecked: extension.enabled,
|
|
43
|
+
onCheckedChange: (enabled) => onToggle?.(extension, enabled)
|
|
44
|
+
}, extension.name))
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { Extensions2 };
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Profile2, Project2, Model2, PermissionMode2, Command2 } from "./chunk-jkkdq1mh.js";
|
|
2
|
+
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
3
|
+
import { HTMLAttributes, TextareaHTMLAttributes } from "react";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
type DraftStatus2 = "idle" | "streaming";
|
|
6
|
+
interface DraftSlotContext2 {
|
|
7
|
+
/** Opens the native file picker. Pass `acceptOverride` (e.g. `"image/*"`) to narrow the accepted types for this one invocation. */
|
|
8
|
+
openFilePicker: (acceptOverride?: string) => void;
|
|
9
|
+
/** Currently-attached files. */
|
|
10
|
+
files: File[];
|
|
11
|
+
}
|
|
12
|
+
type DraftSlot = ReactNode | ((ctx: DraftSlotContext2) => ReactNode);
|
|
13
|
+
/** A message held in the queue while the assistant is responding: the trimmed text and the files attached when it was queued, so editing restores both. `id` is minted on enqueue. */
|
|
14
|
+
interface QueuedMessage2 {
|
|
15
|
+
id: string;
|
|
16
|
+
text: string;
|
|
17
|
+
files: File[];
|
|
18
|
+
}
|
|
19
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_tcubfn } from "react";
|
|
20
|
+
import { RefAttributes as RefAttributes_miuf56 } from "react";
|
|
21
|
+
interface ComposerDraftProps2 extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
22
|
+
/** Step on the size ladder (see Sizes). Wins over the surrounding SizeProvider and propagates to the composer's rows, buttons and queued messages. */
|
|
23
|
+
size?: SizeVariant;
|
|
24
|
+
/** Controlled textarea value. Pair with `onValueChange`; omit both for an uncontrolled composer. */
|
|
25
|
+
value?: string;
|
|
26
|
+
/** Initial textarea value for an uncontrolled composer. Defaults to `""`. */
|
|
27
|
+
defaultValue?: string;
|
|
28
|
+
/** Called with the new value on every textarea change. */
|
|
29
|
+
onValueChange?: (value: string) => void;
|
|
30
|
+
/** Fires on Enter (without Shift) or send-button click, and when a queued message auto-dispatches. Receives the trimmed value, the attached files, and — for auto-dispatched queue items — `meta.queuedId`. Skipped when the value is empty and no files are attached. */
|
|
31
|
+
onSend?: (value: string, files: File[], meta?: {
|
|
32
|
+
queuedId?: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
/** Placeholder shown when the value is empty. While a file is dragged over the component (and attachments are enabled) it swaps to "Drop files here to add to chat". Defaults to `"Ask me anything…"`. */
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
/** Content rendered in the bottom-left action area. May be a render-fn that receives `{ openFilePicker, files }` — `openFilePicker(acceptOverride?)` opens the native file picker. */
|
|
37
|
+
leftSlot?: DraftSlot;
|
|
38
|
+
/** Content rendered in the bottom-right action area, before the built-in send button. Same render-fn shape as `leftSlot`. */
|
|
39
|
+
rightSlot?: DraftSlot;
|
|
40
|
+
/** Disables the textarea, send button, and drag-and-drop. Defaults to `false`. */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Minimum visible rows before the textarea grows. Defaults to 1. */
|
|
43
|
+
minRows?: number;
|
|
44
|
+
/** Maximum visible rows before the textarea starts to scroll. Defaults to 8. */
|
|
45
|
+
maxRows?: number;
|
|
46
|
+
/** When true, clicking anywhere on the surrounding container (outside of buttons / links / inputs) focuses the textarea. Defaults to `true`. */
|
|
47
|
+
clickToFocus?: boolean;
|
|
48
|
+
/** Accessible label for the send button. Defaults to `"Send"`. */
|
|
49
|
+
sendLabel?: string;
|
|
50
|
+
/** Controlled list of attached files. Pair with `onFilesChange` to enable drag-and-drop and the file-picker slot helper. */
|
|
51
|
+
files?: File[];
|
|
52
|
+
/** Initial attachments for an uncontrolled composer. Providing it (even as `[]`) enables attachment behavior on its own. */
|
|
53
|
+
defaultFiles?: File[];
|
|
54
|
+
/** Called when files are added (drag-drop or picker) or removed via the preview tile's × button. Duplicate drops of the same file (same name + size + lastModified) are silently de-duplicated. */
|
|
55
|
+
onFilesChange?: (files: File[]) => void;
|
|
56
|
+
/** Accepted MIME types as a comma-separated string. Used by both the file picker and the drag-and-drop filter. Defaults to `"image/png,image/jpeg,application/pdf"`. */
|
|
57
|
+
accept?: string;
|
|
58
|
+
/** Maximum number of attached files. Extra files beyond this limit are dropped. */
|
|
59
|
+
maxFiles?: number;
|
|
60
|
+
/** Side length (in pixels) of each preview tile. Images use object-cover; PDFs render the first page via pdfjs (an optional peer: without `pdfjs-dist` they show the file icon); other types fall back to a centered icon. Defaults to 80. */
|
|
61
|
+
filePreviewSize?: number;
|
|
62
|
+
/** Extra props forwarded to the underlying textarea (value, onChange, onKeyDown, disabled and placeholder are controlled by the component). */
|
|
63
|
+
textareaProps?: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onChange" | "onKeyDown" | "disabled" | "placeholder">;
|
|
64
|
+
/** Assistant response state. When `"streaming"`, the send button becomes a Stop control (empty draft) or a Queue action (non-empty draft). On the streaming→idle edge the next queued message auto-dispatches via `onSend`. Leave it and `defaultStatus` undefined for the send-immediately behavior. */
|
|
65
|
+
status?: DraftStatus2;
|
|
66
|
+
/** Initial status for an uncontrolled composer — the component then owns the streaming flag, and Stop flips it to `"idle"` itself. */
|
|
67
|
+
defaultStatus?: DraftStatus2;
|
|
68
|
+
/** Called whenever the status changes while it is uncontrolled (currently: the Stop control). */
|
|
69
|
+
onStatusChange?: (status: DraftStatus2) => void;
|
|
70
|
+
/** Fires when the Stop control is pressed (streaming + empty draft). Halt the current response and set status to `"idle"` — that edge immediately dispatches the next queued message. */
|
|
71
|
+
onStop?: () => void;
|
|
72
|
+
/** Controlled queue of pending messages, rendered as reorderable rows above the textarea. Double-click (or Enter/F2) edits a row back into the composer; the × (or Delete) removes it; drag — or Alt+↑/↓ — reorders. Requires a status. */
|
|
73
|
+
queue?: QueuedMessage2[];
|
|
74
|
+
/** Initial queue for an uncontrolled composer. Providing it (even as `[]`) enables the queue on its own, alongside `status` or `defaultStatus`. */
|
|
75
|
+
defaultQueue?: QueuedMessage2[];
|
|
76
|
+
/** Called whenever the queue changes — enqueue, edit, delete, reorder, or auto-dispatch. Each QueuedMessage is `{ id, text, files }`. */
|
|
77
|
+
onQueueChange?: (queue: QueuedMessage2[]) => void;
|
|
78
|
+
/** Render the built-in reorderable queue rows above the textarea. Set to false to suppress them and render the queue yourself — enqueue and auto-dispatch still run. Defaults to `true`. */
|
|
79
|
+
showQueue?: boolean;
|
|
80
|
+
/** Previously-sent messages, oldest first. With the textarea focused, ArrowUp (caret on the first line) recalls the previous message and walks backward; ArrowDown (caret on the last line) walks forward toward the in-progress draft. Editing or sending exits history mode. Defaults to `[]`. */
|
|
81
|
+
history?: string[];
|
|
82
|
+
/** Suggested prompt rendered as the placeholder (with a Tab keycap) while the draft is empty. Pressing Tab fills it into the composer — it doesn't send. Takes precedence over `placeholder`. */
|
|
83
|
+
placeholderSuggestion?: string;
|
|
84
|
+
/** Suggested prompts listed under the action bar while the draft is empty. ArrowDown moves a highlight into the list (focus stays in the textarea), ArrowUp walks back up and out, Enter or click fills the highlighted prompt. Escape drops the highlight; typing collapses the list. */
|
|
85
|
+
suggestions?: string[];
|
|
86
|
+
/** Extra classes for the composer surface. */
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The composer's draft on its own (Fluid Functionalism's InputMessage): the
|
|
91
|
+
* textarea, its attachments, queue, history and suggestions, and the send /
|
|
92
|
+
* queue / stop button, on a Surface-2 substrate. `Composer` documents it.
|
|
93
|
+
*/
|
|
94
|
+
declare const ComposerDraft2: ForwardRefExoticComponent_tcubfn<ComposerDraftProps2 & RefAttributes_miuf56<HTMLDivElement>>;
|
|
95
|
+
import { JSX as JSX_1kxb2 } from "react";
|
|
96
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_tcubfn2 } from "react";
|
|
97
|
+
import { RefAttributes as RefAttributes_miuf562 } from "react";
|
|
98
|
+
import { JSX as JSX_1kxb } from "react";
|
|
99
|
+
interface FileThumbnailProps {
|
|
100
|
+
file: File;
|
|
101
|
+
/** Side length of the square thumbnail in pixels. */
|
|
102
|
+
size: number;
|
|
103
|
+
className?: string;
|
|
104
|
+
}
|
|
105
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
106
|
+
/** A square preview of a File: images cover it, PDFs show their first page, anything else a document glyph. */
|
|
107
|
+
declare function FileThumbnail2({ file, size, className }: FileThumbnailProps): Element_12xgc;
|
|
108
|
+
interface ComposerProps2 {
|
|
109
|
+
/** The models the active profile offers, each with a note. */
|
|
110
|
+
models: Model2[];
|
|
111
|
+
/** The effort steps, lowest first. */
|
|
112
|
+
efforts: string[];
|
|
113
|
+
/** The permission modes, each with its icon and note. */
|
|
114
|
+
permissionModes: PermissionMode2[];
|
|
115
|
+
/** The output styles. */
|
|
116
|
+
outputStyles: string[];
|
|
117
|
+
/** The commands, skills and plugins the + palette runs. */
|
|
118
|
+
commands: Command2[];
|
|
119
|
+
/** Files the + palette can mention. */
|
|
120
|
+
files: string[];
|
|
121
|
+
/** The project folders a session can run in. */
|
|
122
|
+
projects: Project2[];
|
|
123
|
+
/** Branches a new worktree can start from. */
|
|
124
|
+
branches: string[];
|
|
125
|
+
/** The session's own branch, shown in the project menu. Omit before the session has one. */
|
|
126
|
+
branch?: string;
|
|
127
|
+
/** The project the session runs in, by `Project.path`, controlled. Pair with `onProjectChange`. A path not in `projects` shows, and stands for, the first project. */
|
|
128
|
+
project?: string;
|
|
129
|
+
/** The initial project, by `Project.path`, when uncontrolled. Defaults to the first project. */
|
|
130
|
+
defaultProject?: string;
|
|
131
|
+
/** Called with the picked project's `path`. Only a new session (`target`) can pick one. */
|
|
132
|
+
onProjectChange?: (path: string) => void;
|
|
133
|
+
/** Whether the session gets a new git worktree, controlled. Pair with `onWorktreeChange`. */
|
|
134
|
+
worktree?: boolean;
|
|
135
|
+
/** Start with a new worktree when uncontrolled. Defaults to `true`. */
|
|
136
|
+
defaultWorktree?: boolean;
|
|
137
|
+
/** Called when the new-worktree switch flips. Only a new session (`target`) can flip it. */
|
|
138
|
+
onWorktreeChange?: (worktree: boolean) => void;
|
|
139
|
+
/** The branch a new worktree starts from, controlled. Pair with `onBaseBranchChange`. A branch not in `branches` stands for the first one. */
|
|
140
|
+
baseBranch?: string;
|
|
141
|
+
/** The initial base branch when uncontrolled. Defaults to the first branch. */
|
|
142
|
+
defaultBaseBranch?: string;
|
|
143
|
+
/** Called with the base branch picked. Only a new session (`target`) can pick one. */
|
|
144
|
+
onBaseBranchChange?: (branch: string) => void;
|
|
145
|
+
/** The profiles a session can run under. */
|
|
146
|
+
profiles: Profile2[];
|
|
147
|
+
/** The model, by name, controlled. Pair with `onModelChange`. A name not in `models` (say, after a switch to another provider) stands for the first model. */
|
|
148
|
+
model?: string;
|
|
149
|
+
/** Initial model, by name, when uncontrolled. Defaults to the first model. */
|
|
150
|
+
defaultModel?: string;
|
|
151
|
+
/** Called with the model's name when another one is picked. */
|
|
152
|
+
onModelChange?: (model: string) => void;
|
|
153
|
+
/** The effort step, controlled. Pair with `onEffortChange`. A step not in `efforts` stands for the middle one. */
|
|
154
|
+
effort?: string;
|
|
155
|
+
/** Initial effort when uncontrolled. Defaults to the middle step. */
|
|
156
|
+
defaultEffort?: string;
|
|
157
|
+
/** Called with the effort step the slider lands on. */
|
|
158
|
+
onEffortChange?: (effort: string) => void;
|
|
159
|
+
/** The permission mode, by label, controlled. Pair with `onPermissionModeChange`. A label not in `permissionModes` stands for the first mode. */
|
|
160
|
+
permissionMode?: string;
|
|
161
|
+
/** Initial permission mode, by label, when uncontrolled. Defaults to the first mode. */
|
|
162
|
+
defaultPermissionMode?: string;
|
|
163
|
+
/** Called with the permission mode's label when another one is picked. */
|
|
164
|
+
onPermissionModeChange?: (mode: string) => void;
|
|
165
|
+
/** Whether fast mode is on, controlled. Pair with `onFastChange`. */
|
|
166
|
+
fast?: boolean;
|
|
167
|
+
/** Start with fast mode on when uncontrolled. Defaults to `false`. */
|
|
168
|
+
defaultFast?: boolean;
|
|
169
|
+
/** Called when the fast mode switch flips. */
|
|
170
|
+
onFastChange?: (fast: boolean) => void;
|
|
171
|
+
/** The output style, controlled. Pair with `onOutputStyleChange`. A style not in `outputStyles` stands for the first one. */
|
|
172
|
+
outputStyle?: string;
|
|
173
|
+
/** Initial output style when uncontrolled. Defaults to the first style. */
|
|
174
|
+
defaultOutputStyle?: string;
|
|
175
|
+
/** Called with the output style picked. */
|
|
176
|
+
onOutputStyleChange?: (style: string) => void;
|
|
177
|
+
/** Used share of the context window, 0–1. Defaults to `0.62`. */
|
|
178
|
+
context?: number;
|
|
179
|
+
/** The conversation is being compacted: the context meter says so. Defaults to `false`. */
|
|
180
|
+
compacting?: boolean;
|
|
181
|
+
/** Whether a reply is streaming. While it is, Enter queues the draft and the empty draft's button stops the reply; on the streaming→idle edge the head of the queue sends. Pair with `onStatusChange` / `onStop`, or set `defaultStatus`. */
|
|
182
|
+
status?: DraftStatus2;
|
|
183
|
+
/** The initial status when uncontrolled; Stop then flips it to `"idle"` itself. Defaults to `"idle"`. */
|
|
184
|
+
defaultStatus?: DraftStatus2;
|
|
185
|
+
/** Called with the status when the uncontrolled composer changes it (Stop). */
|
|
186
|
+
onStatusChange?: (status: DraftStatus2) => void;
|
|
187
|
+
/** Called when Stop is pressed. Halt the reply and set `status` to `"idle"`. */
|
|
188
|
+
onStop?: () => void;
|
|
189
|
+
/** The draft's text, controlled. Pair with `onValueChange`. */
|
|
190
|
+
value?: string;
|
|
191
|
+
/** The draft's initial text when uncontrolled. Defaults to `""`. */
|
|
192
|
+
defaultValue?: string;
|
|
193
|
+
/** Called with the draft's text on every change. */
|
|
194
|
+
onValueChange?: (value: string) => void;
|
|
195
|
+
/** The messages queued while a reply streams, controlled: `{ id, text, files }` each. Pair with `onQueueChange`. */
|
|
196
|
+
queue?: QueuedMessage2[];
|
|
197
|
+
/** The initial queue when uncontrolled. Defaults to `[]`. */
|
|
198
|
+
defaultQueue?: QueuedMessage2[];
|
|
199
|
+
/** Called when a message is queued, edited back, removed, reordered or sent from the queue. */
|
|
200
|
+
onQueueChange?: (queue: QueuedMessage2[]) => void;
|
|
201
|
+
/** Messages sent before, oldest first: ↑ on the draft's first line recalls them, ↓ on its last walks back to the draft. Defaults to `[]`. */
|
|
202
|
+
history?: string[];
|
|
203
|
+
/** Prompts listed under the draft while it is empty: ↓ / ↑ walk them without leaving the text, Enter or a click fills one in. */
|
|
204
|
+
suggestions?: string[];
|
|
205
|
+
/** A prompt shown as the placeholder with a Tab keycap: Tab fills it in. Wins over `placeholder`. */
|
|
206
|
+
placeholderSuggestion?: string;
|
|
207
|
+
/** The file types the palette's Attach and a drop take, as an `accept` string. Defaults to `"image/png,image/jpeg,application/pdf"`. */
|
|
208
|
+
accept?: string;
|
|
209
|
+
/** The most files a message takes; extra ones are dropped. */
|
|
210
|
+
maxFiles?: number;
|
|
211
|
+
/** A new session: the project and profile can still be picked. Otherwise they show where this session runs. Defaults to `false`. */
|
|
212
|
+
target?: boolean;
|
|
213
|
+
/** The profile the session runs under, by id, controlled. Pair with `onProfileChange`. An id not in `profiles` shows the first profile. */
|
|
214
|
+
profile?: string;
|
|
215
|
+
/** The profile the session runs under, by id, when uncontrolled. Defaults to the first profile. */
|
|
216
|
+
defaultProfile?: string;
|
|
217
|
+
/** Called with the profile picked, by id. */
|
|
218
|
+
onProfileChange?: (profile: string) => void;
|
|
219
|
+
/** The draft's placeholder. Defaults to `'Ask, or type / for commands'`. */
|
|
220
|
+
placeholder?: string;
|
|
221
|
+
/** Called with the trimmed text and the attached files when a message is sent, or sent from the queue. */
|
|
222
|
+
onSend?: (text: string, files: File[]) => void;
|
|
223
|
+
/** Classes for the root. */
|
|
224
|
+
className?: string;
|
|
225
|
+
}
|
|
226
|
+
type Element_12xgc2 = JSX_1kxb2["Element"];
|
|
227
|
+
/**
|
|
228
|
+
* Where you write to the session, with every per-session control behind
|
|
229
|
+
* four triggers, held in a ShellCard.
|
|
230
|
+
*
|
|
231
|
+
* The draft grows with its text, then scrolls; Enter sends and Shift+Enter
|
|
232
|
+
* breaks the line. Files dropped anywhere on it, or attached from the +
|
|
233
|
+
* palette, preview as tiles above the text (images as themselves, PDFs by
|
|
234
|
+
* their first page with the optional `pdfjs-dist`, the rest as an icon).
|
|
235
|
+
* While a reply streams (`status`) the button queues what you type: queued
|
|
236
|
+
* messages stack above the draft, reorder by drag or Alt+↑/↓, come back into
|
|
237
|
+
* the draft on a double-click, and the first one sends when the reply ends;
|
|
238
|
+
* with the draft empty the button stops the reply. ↑ on the first line
|
|
239
|
+
* recalls sent messages (`history`); `suggestions` list prompts under an
|
|
240
|
+
* empty draft and `placeholderSuggestion` offers one behind a Tab keycap.
|
|
241
|
+
* The + opens one searchable palette: attach, mention a file, run a
|
|
242
|
+
* command, skill or plugin.
|
|
243
|
+
*
|
|
244
|
+
* The row under it, on the shell, holds the rest. On the left, where the
|
|
245
|
+
* session runs: the project, whose popover also holds the worktree, the
|
|
246
|
+
* setup script and the base branch, and the profile, with two thin lines for
|
|
247
|
+
* its session and weekly limits (see the profile switcher). On the right,
|
|
248
|
+
* how it runs: one trigger showing the permission mode, the model, the
|
|
249
|
+
* effort and a small context ring opens the model (with a note on each), a
|
|
250
|
+
* tall effort slider, the permission mode, fast mode, the output style and
|
|
251
|
+
* the context with a compact button. All three popovers share one layout: a
|
|
252
|
+
* caption per section, then rows with the label on the left and the control
|
|
253
|
+
* on the right.
|
|
254
|
+
*
|
|
255
|
+
* Every draft prop has its uncontrolled twin (`defaultValue`,
|
|
256
|
+
* `defaultQueue`, `defaultStatus`), so a composer runs with no state in the
|
|
257
|
+
* caller. So does every choice on the row: the project (by its `path`), the
|
|
258
|
+
* worktree switch, the base branch, the profile, the model, the effort, the
|
|
259
|
+
* permission mode, fast mode and the output style each take a controlled
|
|
260
|
+
* prop, a `default…` and an `on…Change`, so an app can pass them on to the
|
|
261
|
+
* agent (`--model`, `--effort`, `--permission-mode`). A choice its list no
|
|
262
|
+
* longer holds (a model after a switch to another provider, a project that
|
|
263
|
+
* was removed) stands for the list's first entry (the middle one for effort)
|
|
264
|
+
* instead of lingering.
|
|
265
|
+
*
|
|
266
|
+
* Statics:
|
|
267
|
+
* - `Composer.Draft` — the draft alone, without the shell and its menus:
|
|
268
|
+
* the props above plus `leftSlot` / `rightSlot` (content, or a render
|
|
269
|
+
* function given `{ openFilePicker, files }`), `files` / `defaultFiles` /
|
|
270
|
+
* `onFilesChange` (attachments are on once either is set), `minRows` /
|
|
271
|
+
* `maxRows`, `size`, `disabled`, `showQueue` and `textareaProps`.
|
|
272
|
+
*
|
|
273
|
+
* Also exported: `FileThumbnail`, the square preview of an attachment, for
|
|
274
|
+
* the files a sent message carried.
|
|
275
|
+
*
|
|
276
|
+
* @example {@include ./examples.mdx}
|
|
277
|
+
* @source https://github.com/mickadesign/fluid-functionalism/blob/b3587bdbd83fc66c2a6aae3817ffb856cb09260b/registry/default/input-message.tsx Fluid Functionalism
|
|
278
|
+
* @license MIT © 2026 Micka Touillaud
|
|
279
|
+
*/
|
|
280
|
+
declare const Composer2: (({ models, efforts, permissionModes, outputStyles, commands, files, projects, branches, branch, project: projectProp, defaultProject, onProjectChange, worktree: worktreeProp, defaultWorktree, onWorktreeChange, baseBranch: baseBranchProp, defaultBaseBranch, onBaseBranchChange, profiles, model: modelProp, defaultModel, onModelChange, effort: effortProp, defaultEffort, onEffortChange, permissionMode: permissionModeProp, defaultPermissionMode, onPermissionModeChange, fast: fastProp, defaultFast, onFastChange, outputStyle: outputStyleProp, defaultOutputStyle, onOutputStyleChange, context, compacting, defaultStatus, target, profile, defaultProfile, onProfileChange, placeholder, className,...draft }: ComposerProps2) => Element_12xgc2) & {
|
|
281
|
+
Draft: ForwardRefExoticComponent_tcubfn2<ComposerDraftProps2 & RefAttributes_miuf562<HTMLDivElement>>;
|
|
282
|
+
};
|
|
283
|
+
export { DraftStatus2, DraftSlotContext2, QueuedMessage2, ComposerDraftProps2, ComposerDraft2, FileThumbnail2, ComposerProps2, Composer2 };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
interface WorkSummaryProviderProps2 {
|
|
4
|
+
/** Unfold every `WorkSummary` inside; switching it re-folds or re-opens them all. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** The conversation. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
10
|
+
/** Opens or folds every WorkSummary inside at once: a "show work" toggle. */
|
|
11
|
+
declare function WorkSummaryProvider2({ open, children }: WorkSummaryProviderProps2): Element_12xgc;
|
|
12
|
+
interface WorkSummaryProps2 {
|
|
13
|
+
/** How long the turn worked: `"Worked for 52s"`, `"Working…"`. */
|
|
14
|
+
summary: string;
|
|
15
|
+
/** What it did, in a few words: `"4 tool calls · 1 agent"`. */
|
|
16
|
+
detail?: string;
|
|
17
|
+
/** Still working: the Spinner turns in the row. Defaults to `false`. */
|
|
18
|
+
running?: boolean;
|
|
19
|
+
/** The reasoning, tool calls and agent runs. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* What an AI did on the way to a reply, folded to one row: "Worked for 52s ·
|
|
24
|
+
* 4 tool calls".
|
|
25
|
+
*
|
|
26
|
+
* The reasoning, tool calls and agent runs of a turn go inside, so the
|
|
27
|
+
* conversation reads as what was asked and what came out. Press the row and
|
|
28
|
+
* the work morphs out of it behind a hairline; while the turn runs, the
|
|
29
|
+
* Spinner turns in the row. Wrap the conversation in a `WorkSummary.Provider`
|
|
30
|
+
* to open or fold every turn's work at once, a "show work" toggle.
|
|
31
|
+
*
|
|
32
|
+
* Statics:
|
|
33
|
+
* - `WorkSummary.Provider` — opens every fold inside: `open`.
|
|
34
|
+
*
|
|
35
|
+
* @example {@include ./examples.mdx}
|
|
36
|
+
*/
|
|
37
|
+
declare const WorkSummary2: (({ summary, detail, running, children }: WorkSummaryProps2) => Element_12xgc) & {
|
|
38
|
+
Provider: typeof WorkSummaryProvider2;
|
|
39
|
+
};
|
|
40
|
+
export { WorkSummaryProviderProps2, WorkSummaryProvider2, WorkSummaryProps2, WorkSummary2 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// lib/status-glyph.tsx
|
|
2
|
+
import { statusGlyph } from "@justanarthur/modo-ui/components/feedback/status-dot";
|
|
3
|
+
/*!
|
|
4
|
+
* Local addition: the AI app's session states on the design system's status
|
|
5
|
+
* glyphs (see StatusDot): running turns, waiting is the warning dot, unread
|
|
6
|
+
* and idle use the Sidebar's own dots, so only those two map here.
|
|
7
|
+
*/
|
|
8
|
+
var RunningGlyph2 = statusGlyph("running");
|
|
9
|
+
var WaitingGlyph2 = statusGlyph("waiting");
|
|
10
|
+
var STATUS_GLYPH2 = {
|
|
11
|
+
running: RunningGlyph2,
|
|
12
|
+
waiting: WaitingGlyph2
|
|
13
|
+
};
|
|
14
|
+
var STATUS_LABEL2 = {
|
|
15
|
+
running: "Running",
|
|
16
|
+
waiting: "Needs your input",
|
|
17
|
+
unread: "Unread",
|
|
18
|
+
idle: "Idle"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { RunningGlyph2, WaitingGlyph2, STATUS_GLYPH2, STATUS_LABEL2 };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
|
|
7
|
+
// lib/pane-parts.tsx
|
|
8
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
9
|
+
import EmptyState from "@justanarthur/modo-ui/components/feedback/empty-state";
|
|
10
|
+
import Tooltip from "@justanarthur/modo-ui/components/overlays/tooltip";
|
|
11
|
+
import { useId } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
/*!
|
|
14
|
+
* Local addition: the side pane's shared language. PaneSection is a
|
|
15
|
+
* caption-sized title, its meta and icon actions on one row, the rows under
|
|
16
|
+
* it on the control height with their own 8px inset; IconAction is an
|
|
17
|
+
* icon-only ghost button with its label as a tooltip; PaneEmpty is what a
|
|
18
|
+
* pane shows with nothing in it.
|
|
19
|
+
*/
|
|
20
|
+
function PaneSection2({
|
|
21
|
+
title,
|
|
22
|
+
meta,
|
|
23
|
+
actions,
|
|
24
|
+
children
|
|
25
|
+
}) {
|
|
26
|
+
const id = useId();
|
|
27
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
28
|
+
"aria-labelledby": id,
|
|
29
|
+
className: "flex flex-col",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: "flex h-9 items-center gap-2 px-2 text-caption text-muted-foreground",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx("span", {
|
|
35
|
+
id,
|
|
36
|
+
className: "min-w-0 truncate weight-medium text-foreground",
|
|
37
|
+
children: title
|
|
38
|
+
}),
|
|
39
|
+
meta && /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "min-w-0 truncate tabular-nums",
|
|
41
|
+
children: meta
|
|
42
|
+
}),
|
|
43
|
+
actions && /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: "-mr-1 ml-auto flex shrink-0 items-center gap-0.5",
|
|
45
|
+
children: actions
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
}),
|
|
49
|
+
children
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function IconAction2({
|
|
54
|
+
icon: Icon,
|
|
55
|
+
label,
|
|
56
|
+
pressed,
|
|
57
|
+
onClick
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
60
|
+
content: label,
|
|
61
|
+
side: "bottom",
|
|
62
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
63
|
+
variant: "ghost",
|
|
64
|
+
size: "icon-compact",
|
|
65
|
+
"aria-label": label,
|
|
66
|
+
"aria-pressed": pressed,
|
|
67
|
+
active: pressed,
|
|
68
|
+
onClick,
|
|
69
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function PaneEmpty2({ icon, title, detail }) {
|
|
74
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
75
|
+
size: "compact",
|
|
76
|
+
icon: useIcon2(icon),
|
|
77
|
+
title,
|
|
78
|
+
description: detail
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { PaneSection2, IconAction2, PaneEmpty2 };
|