@justanarthur/modo-ui-ai 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSE.fluid-functionalism +21 -0
- package/README.md +105 -2
- package/blocks/conversation/agent-prompt/examples.mdx +44 -0
- package/blocks/conversation/agent-prompt/index.tsx +114 -0
- package/blocks/conversation/composer/draft.css +25 -0
- package/blocks/conversation/composer/draft.tsx +589 -0
- package/blocks/conversation/composer/examples.mdx +114 -0
- package/blocks/conversation/composer/file-preview-tile.tsx +59 -0
- package/blocks/conversation/composer/file-thumbnail.tsx +146 -0
- package/blocks/conversation/composer/index.tsx +517 -0
- package/blocks/conversation/composer/queued-row.tsx +102 -0
- package/blocks/conversation/composer/shared.ts +38 -0
- package/blocks/conversation/composer/suggestion-row.tsx +64 -0
- package/blocks/conversation/composer/use-composer-files.ts +142 -0
- package/blocks/conversation/composer/use-history-nav.ts +60 -0
- package/blocks/conversation/composer/use-message-queue.ts +108 -0
- package/blocks/conversation/composer/use-region-height.ts +34 -0
- package/blocks/conversation/failure-states/examples.mdx +58 -0
- package/blocks/conversation/failure-states/index.tsx +274 -0
- package/blocks/conversation/transcript/examples.mdx +43 -0
- package/blocks/conversation/transcript/index.tsx +204 -0
- package/blocks/conversation/transcript-search/examples.mdx +50 -0
- package/blocks/conversation/transcript-search/index.tsx +469 -0
- package/blocks/dialogs/command-palette/examples.mdx +33 -0
- package/blocks/dialogs/command-palette/index.tsx +232 -0
- package/blocks/dialogs/hook-dialog/examples.mdx +44 -0
- package/blocks/dialogs/hook-dialog/index.tsx +286 -0
- package/blocks/dialogs/mcp-server-dialog/examples.mdx +57 -0
- package/blocks/dialogs/mcp-server-dialog/index.tsx +415 -0
- package/blocks/dialogs/shortcuts-sheet/examples.mdx +36 -0
- package/blocks/dialogs/shortcuts-sheet/index.tsx +186 -0
- package/blocks/panes/artifacts-pane/examples.mdx +23 -0
- package/blocks/panes/artifacts-pane/index.tsx +82 -0
- package/blocks/panes/changes-pane/examples.mdx +23 -0
- package/blocks/panes/changes-pane/index.tsx +248 -0
- package/blocks/panes/file-pane/examples.mdx +13 -0
- package/blocks/panes/file-pane/index.tsx +102 -0
- package/blocks/panes/pr-pane/examples.mdx +13 -0
- package/blocks/panes/pr-pane/index.tsx +191 -0
- package/blocks/panes/side-pane/examples.mdx +58 -0
- package/blocks/panes/side-pane/index.tsx +187 -0
- package/blocks/panes/tasks-pane/examples.mdx +23 -0
- package/blocks/panes/tasks-pane/index.tsx +127 -0
- package/blocks/panes/terminal-pane/examples.mdx +13 -0
- package/blocks/panes/terminal-pane/index.tsx +99 -0
- package/blocks/panes/usage-pane/examples.mdx +13 -0
- package/blocks/panes/usage-pane/index.tsx +75 -0
- package/blocks/profiles/profile-onboarding/examples.mdx +80 -0
- package/blocks/profiles/profile-onboarding/index.tsx +580 -0
- package/blocks/profiles/profile-switcher/examples.mdx +18 -0
- package/blocks/profiles/profile-switcher/index.tsx +197 -0
- package/blocks/profiles/profile-usage/examples.mdx +21 -0
- package/blocks/profiles/profile-usage/index.tsx +127 -0
- package/blocks/sessions/inbox/examples.mdx +35 -0
- package/blocks/sessions/inbox/index.tsx +372 -0
- package/blocks/sessions/session-board/examples.mdx +34 -0
- package/blocks/sessions/session-board/index.tsx +570 -0
- package/blocks/sessions/session-sidebar/examples.mdx +43 -0
- package/blocks/sessions/session-sidebar/index.tsx +442 -0
- package/blocks/settings/extensions/examples.mdx +10 -0
- package/blocks/settings/extensions/index.tsx +72 -0
- package/blocks/settings/hooks/examples.mdx +16 -0
- package/blocks/settings/hooks/index.tsx +127 -0
- package/blocks/settings/mcp-servers/examples.mdx +26 -0
- package/blocks/settings/mcp-servers/index.tsx +204 -0
- package/blocks/settings/memory/examples.mdx +22 -0
- package/blocks/settings/memory/index.tsx +113 -0
- package/blocks/settings/notifications/examples.mdx +8 -0
- package/blocks/settings/notifications/index.tsx +63 -0
- package/blocks/settings/permission-rules/examples.mdx +37 -0
- package/blocks/settings/permission-rules/index.tsx +317 -0
- package/blocks/settings/plugin-catalog/examples.mdx +52 -0
- package/blocks/settings/plugin-catalog/index.tsx +407 -0
- package/blocks/settings/plugins/examples.mdx +10 -0
- package/blocks/settings/plugins/index.tsx +72 -0
- package/blocks/settings/settings-window/examples.mdx +40 -0
- package/blocks/settings/settings-window/index.tsx +188 -0
- package/blocks/settings/worktrees/examples.mdx +17 -0
- package/blocks/settings/worktrees/index.tsx +145 -0
- package/components/conversation/agent-run/examples.mdx +30 -0
- package/components/conversation/agent-run/index.tsx +82 -0
- package/components/conversation/chapter-nav/examples.mdx +30 -0
- package/components/conversation/chapter-nav/index.tsx +123 -0
- package/components/conversation/message/examples.mdx +53 -0
- package/components/conversation/message/index.tsx +128 -0
- package/components/conversation/message/working.tsx +102 -0
- package/components/conversation/reasoning/examples.mdx +22 -0
- package/components/conversation/reasoning/index.tsx +54 -0
- package/components/conversation/recap/examples.mdx +21 -0
- package/components/conversation/recap/index.tsx +67 -0
- package/components/conversation/todo-list/examples.mdx +32 -0
- package/components/conversation/todo-list/index.tsx +106 -0
- package/components/conversation/tool-call/examples.mdx +48 -0
- package/components/conversation/tool-call/index.tsx +142 -0
- package/components/conversation/work-summary/examples.mdx +50 -0
- package/components/conversation/work-summary/index.tsx +87 -0
- package/components/prompts/permission-request/examples.mdx +32 -0
- package/components/prompts/permission-request/index.tsx +74 -0
- package/components/prompts/plan-approval/examples.mdx +37 -0
- package/components/prompts/plan-approval/index.tsx +76 -0
- package/components/prompts/prompt-card/examples.mdx +31 -0
- package/components/prompts/prompt-card/index.tsx +82 -0
- package/components/prompts/question-prompt/examples.mdx +46 -0
- package/components/prompts/question-prompt/index.tsx +118 -0
- package/dist/blocks/conversation/agent-prompt/index.d.ts +7 -0
- package/dist/blocks/conversation/agent-prompt/index.js +13 -0
- package/dist/blocks/conversation/composer/index.d.ts +4 -0
- package/dist/blocks/conversation/composer/index.js +15 -0
- package/dist/blocks/conversation/failure-states/index.d.ts +4 -0
- package/dist/blocks/conversation/failure-states/index.js +8 -0
- package/dist/blocks/conversation/transcript/index.d.ts +50 -0
- package/dist/blocks/conversation/transcript/index.js +17 -0
- package/dist/blocks/conversation/transcript-search/index.d.ts +4 -0
- package/dist/blocks/conversation/transcript-search/index.js +11 -0
- package/dist/blocks/dialogs/command-palette/index.d.ts +5 -0
- package/dist/blocks/dialogs/command-palette/index.js +20 -0
- package/dist/blocks/dialogs/hook-dialog/index.d.ts +3 -0
- package/dist/blocks/dialogs/hook-dialog/index.js +12 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.d.ts +5 -0
- package/dist/blocks/dialogs/mcp-server-dialog/index.js +12 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.d.ts +2 -0
- package/dist/blocks/dialogs/shortcuts-sheet/index.js +11 -0
- package/dist/blocks/panes/artifacts-pane/index.d.ts +3 -0
- package/dist/blocks/panes/artifacts-pane/index.js +9 -0
- package/dist/blocks/panes/changes-pane/index.d.ts +3 -0
- package/dist/blocks/panes/changes-pane/index.js +9 -0
- package/dist/blocks/panes/file-pane/index.d.ts +3 -0
- package/dist/blocks/panes/file-pane/index.js +9 -0
- package/dist/blocks/panes/pr-pane/index.d.ts +3 -0
- package/dist/blocks/panes/pr-pane/index.js +10 -0
- package/dist/blocks/panes/side-pane/index.d.ts +5 -0
- package/dist/blocks/panes/side-pane/index.js +21 -0
- package/dist/blocks/panes/tasks-pane/index.d.ts +3 -0
- package/dist/blocks/panes/tasks-pane/index.js +10 -0
- package/dist/blocks/panes/terminal-pane/index.d.ts +3 -0
- package/dist/blocks/panes/terminal-pane/index.js +9 -0
- package/dist/blocks/panes/usage-pane/index.d.ts +4 -0
- package/dist/blocks/panes/usage-pane/index.js +11 -0
- package/dist/blocks/profiles/profile-onboarding/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-onboarding/index.js +11 -0
- package/dist/blocks/profiles/profile-switcher/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-switcher/index.js +11 -0
- package/dist/blocks/profiles/profile-usage/index.d.ts +4 -0
- package/dist/blocks/profiles/profile-usage/index.js +10 -0
- package/dist/blocks/sessions/inbox/index.d.ts +2 -0
- package/dist/blocks/sessions/inbox/index.js +11 -0
- package/dist/blocks/sessions/session-board/index.d.ts +4 -0
- package/dist/blocks/sessions/session-board/index.js +26 -0
- package/dist/blocks/sessions/session-sidebar/index.d.ts +5 -0
- package/dist/blocks/sessions/session-sidebar/index.js +15 -0
- package/dist/blocks/settings/extensions/index.d.ts +2 -0
- package/dist/blocks/settings/extensions/index.js +9 -0
- package/dist/blocks/settings/hooks/index.d.ts +4 -0
- package/dist/blocks/settings/hooks/index.js +9 -0
- package/dist/blocks/settings/mcp-servers/index.d.ts +4 -0
- package/dist/blocks/settings/mcp-servers/index.js +9 -0
- package/dist/blocks/settings/memory/index.d.ts +4 -0
- package/dist/blocks/settings/memory/index.js +8 -0
- package/dist/blocks/settings/notifications/index.d.ts +2 -0
- package/dist/blocks/settings/notifications/index.js +8 -0
- package/dist/blocks/settings/permission-rules/index.d.ts +3 -0
- package/dist/blocks/settings/permission-rules/index.js +10 -0
- package/dist/blocks/settings/plugin-catalog/index.d.ts +2 -0
- package/dist/blocks/settings/plugin-catalog/index.js +11 -0
- package/dist/blocks/settings/plugins/index.d.ts +4 -0
- package/dist/blocks/settings/plugins/index.js +9 -0
- package/dist/blocks/settings/settings-window/index.d.ts +4 -0
- package/dist/blocks/settings/settings-window/index.js +8 -0
- package/dist/blocks/settings/worktrees/index.d.ts +4 -0
- package/dist/blocks/settings/worktrees/index.js +9 -0
- package/dist/components/conversation/agent-run/index.d.ts +3 -0
- package/dist/components/conversation/agent-run/index.js +10 -0
- package/dist/components/conversation/chapter-nav/index.d.ts +2 -0
- package/dist/components/conversation/chapter-nav/index.js +11 -0
- package/dist/components/conversation/message/index.d.ts +2 -0
- package/dist/components/conversation/message/index.js +15 -0
- package/dist/components/conversation/reasoning/index.d.ts +2 -0
- package/dist/components/conversation/reasoning/index.js +8 -0
- package/dist/components/conversation/recap/index.d.ts +2 -0
- package/dist/components/conversation/recap/index.js +9 -0
- package/dist/components/conversation/todo-list/index.d.ts +2 -0
- package/dist/components/conversation/todo-list/index.js +9 -0
- package/dist/components/conversation/tool-call/index.d.ts +3 -0
- package/dist/components/conversation/tool-call/index.js +13 -0
- package/dist/components/conversation/work-summary/index.d.ts +2 -0
- package/dist/components/conversation/work-summary/index.js +10 -0
- package/dist/components/prompts/permission-request/index.d.ts +2 -0
- package/dist/components/prompts/permission-request/index.js +9 -0
- package/dist/components/prompts/plan-approval/index.d.ts +2 -0
- package/dist/components/prompts/plan-approval/index.js +9 -0
- package/dist/components/prompts/prompt-card/index.d.ts +3 -0
- package/dist/components/prompts/prompt-card/index.js +8 -0
- package/dist/components/prompts/question-prompt/index.d.ts +2 -0
- package/dist/components/prompts/question-prompt/index.js +9 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +231 -0
- package/dist/lib/config-parts.d.ts +2 -0
- package/dist/lib/config-parts.js +16 -0
- package/dist/lib/icons.d.ts +2 -0
- package/dist/lib/icons.js +10 -0
- package/dist/lib/pace-bar.d.ts +11 -0
- package/dist/lib/pace-bar.js +6 -0
- package/dist/lib/pace.d.ts +4 -0
- package/dist/lib/pace.js +12 -0
- package/dist/lib/pane-parts.d.ts +25 -0
- package/dist/lib/pane-parts.js +11 -0
- package/dist/lib/row-trigger.d.ts +5 -0
- package/dist/lib/row-trigger.js +7 -0
- package/dist/lib/settings-parts.d.ts +70 -0
- package/dist/lib/settings-parts.js +24 -0
- package/dist/lib/side-pane-types.d.ts +2 -0
- package/dist/lib/side-pane-types.js +1 -0
- package/dist/lib/status-glyph.d.ts +8 -0
- package/dist/lib/status-glyph.js +12 -0
- package/dist/lib/types.d.ts +3 -0
- package/dist/lib/types.js +1 -0
- package/dist/shared/chunk-04a497rr.js +21 -0
- package/dist/shared/chunk-13yf0mza.d.ts +70 -0
- package/dist/shared/chunk-1aq2xzv5.js +558 -0
- package/dist/shared/chunk-1f96cz69.js +45 -0
- package/dist/shared/chunk-1yt061np.d.ts +64 -0
- package/dist/shared/chunk-218qabm5.js +250 -0
- package/dist/shared/chunk-2fk5aq60.js +313 -0
- package/dist/shared/chunk-4248zvmh.js +177 -0
- package/dist/shared/chunk-45rqgey6.d.ts +25 -0
- package/dist/shared/chunk-4n0v64qx.js +179 -0
- package/dist/shared/chunk-4zvhpf2x.js +55 -0
- package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
- package/dist/shared/chunk-58qvny6a.d.ts +29 -0
- package/dist/shared/chunk-5fhkkn39.js +130 -0
- package/dist/shared/chunk-5hw0525a.d.ts +33 -0
- package/dist/shared/chunk-5k6xwqfj.d.ts +68 -0
- package/dist/shared/chunk-5meda998.js +238 -0
- package/dist/shared/chunk-5pqksw7z.js +91 -0
- package/dist/shared/chunk-6220dy5n.js +70 -0
- package/dist/shared/chunk-64bnh22t.d.ts +59 -0
- package/dist/shared/chunk-66sh633m.d.ts +60 -0
- package/dist/shared/chunk-6cmf27g3.d.ts +81 -0
- package/dist/shared/chunk-6g4970a6.d.ts +20 -0
- package/dist/shared/chunk-75zwypyr.d.ts +43 -0
- package/dist/shared/chunk-7rzjmcnh.d.ts +30 -0
- package/dist/shared/chunk-7zvb39cf.d.ts +26 -0
- package/dist/shared/chunk-8mecznyr.js +357 -0
- package/dist/shared/chunk-8pag6vmd.js +255 -0
- package/dist/shared/chunk-8xg5gwwy.js +38 -0
- package/dist/shared/chunk-9kw6m047.d.ts +32 -0
- package/dist/shared/chunk-a4s440b6.js +79 -0
- package/dist/shared/chunk-at0jje23.d.ts +110 -0
- package/dist/shared/chunk-awd573h9.js +34 -0
- package/dist/shared/chunk-b171wjge.d.ts +25 -0
- package/dist/shared/chunk-bh2b5d1z.js +98 -0
- package/dist/shared/chunk-bzs6amnv.js +187 -0
- package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
- package/dist/shared/chunk-c8wp058j.js +153 -0
- package/dist/shared/chunk-cd4f87as.d.ts +28 -0
- package/dist/shared/chunk-cmwby8f9.js +467 -0
- package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
- package/dist/shared/chunk-dh3qy5fj.js +49 -0
- package/dist/shared/chunk-e46apgve.d.ts +40 -0
- package/dist/shared/chunk-ejtknc0w.js +21 -0
- package/dist/shared/chunk-eqajdxn8.js +82 -0
- package/dist/shared/chunk-fbn0h7cr.js +123 -0
- package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
- package/dist/shared/chunk-g28hweee.d.ts +35 -0
- package/dist/shared/chunk-g88hweqh.d.ts +70 -0
- package/dist/shared/chunk-gewnsgza.js +61 -0
- package/dist/shared/chunk-gkyk663q.d.ts +53 -0
- package/dist/shared/chunk-hd4gtj5z.d.ts +23 -0
- package/dist/shared/chunk-hxjgey30.d.ts +36 -0
- package/dist/shared/chunk-jkkdq1mh.d.ts +213 -0
- package/dist/shared/chunk-jpq101w3.js +91 -0
- package/dist/shared/chunk-k3bv9k1v.d.ts +56 -0
- package/dist/shared/chunk-k5zegxje.d.ts +81 -0
- package/dist/shared/chunk-kreypnzp.d.ts +34 -0
- package/dist/shared/chunk-kw9npka5.js +224 -0
- package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
- package/dist/shared/chunk-n1qq2wp9.js +6 -0
- package/dist/shared/chunk-n4742y54.js +39 -0
- package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
- package/dist/shared/chunk-nk4578dr.js +73 -0
- package/dist/shared/chunk-paezqfg1.js +106 -0
- package/dist/shared/chunk-qemm9e3r.d.ts +21 -0
- package/dist/shared/chunk-qhxz1etk.js +96 -0
- package/dist/shared/chunk-qj5ev9ak.js +531 -0
- package/dist/shared/chunk-qnwggvjy.js +150 -0
- package/dist/shared/chunk-r5hz78pb.js +129 -0
- package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
- package/dist/shared/chunk-rjfwje37.d.ts +234 -0
- package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
- package/dist/shared/chunk-rzajcn44.d.ts +49 -0
- package/dist/shared/chunk-s3r759ec.js +80 -0
- package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
- package/dist/shared/chunk-sfqvyzcs.d.ts +68 -0
- package/dist/shared/chunk-skg3m9m0.js +56 -0
- package/dist/shared/chunk-szkvrqg1.d.ts +54 -0
- package/dist/shared/chunk-t21t9x7e.js +188 -0
- package/dist/shared/chunk-tc75ng2c.js +235 -0
- package/dist/shared/chunk-tkx1krwc.js +88 -0
- package/dist/shared/chunk-tprdqtb1.d.ts +30 -0
- package/dist/shared/chunk-tv9a1sek.js +137 -0
- package/dist/shared/chunk-tvbd27hg.d.ts +43 -0
- package/dist/shared/chunk-v6yevw62.d.ts +28 -0
- package/dist/shared/chunk-v9q38p0x.js +258 -0
- package/dist/shared/chunk-vd59gzzd.js +86 -0
- package/dist/shared/chunk-vgh4f3sv.js +118 -0
- package/dist/shared/chunk-vjht1zn1.js +391 -0
- package/dist/shared/chunk-vsrkb0sp.d.ts +21 -0
- package/dist/shared/chunk-w5z8qnf8.js +175 -0
- package/dist/shared/chunk-wgvzavx1.js +1488 -0
- package/dist/shared/chunk-whsx7yp9.d.ts +37 -0
- package/dist/shared/chunk-x7az5x1y.d.ts +57 -0
- package/dist/shared/chunk-x9jf26yb.js +318 -0
- package/dist/shared/chunk-xbrrt07s.d.ts +23 -0
- package/dist/shared/chunk-xkchhs2z.js +129 -0
- package/dist/shared/chunk-xzfrskd7.js +202 -0
- package/dist/shared/chunk-y4cj4y54.js +423 -0
- package/dist/shared/chunk-y934at6m.js +7 -0
- package/dist/shared/chunk-zbpwhpjy.d.ts +75 -0
- package/dist/shared/chunk-zfhmbb7n.js +63 -0
- package/dist/shared/chunk-zk0t4vq5.js +71 -0
- package/dist/shared/chunk-znp9gna7.d.ts +23 -0
- package/dist/styles.css +467 -0
- package/index.ts +49 -0
- package/lib/config-parts.tsx +97 -0
- package/lib/icons.tsx +149 -0
- package/lib/pace-bar.tsx +24 -0
- package/lib/pace.ts +74 -0
- package/lib/pane-parts.tsx +76 -0
- package/lib/row-trigger.tsx +44 -0
- package/lib/settings-parts.tsx +232 -0
- package/lib/side-pane-types.ts +75 -0
- package/lib/status-glyph.tsx +25 -0
- package/lib/types.ts +204 -0
- package/mock/demo-reply.tsx +33 -0
- package/mock/demo-session.tsx +150 -0
- package/mock/mock-config.ts +173 -0
- package/mock/mock-extras.ts +288 -0
- package/mock/mock-panes.ts +190 -0
- package/mock/mock-settings.ts +92 -0
- package/mock/mock.ts +548 -0
- package/mock/screen-frame.tsx +49 -0
- package/package.json +114 -4
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SCOPES2,
|
|
5
|
+
SCOPE_NOTE2,
|
|
6
|
+
settingsFile2,
|
|
7
|
+
Field2,
|
|
8
|
+
Fieldset2,
|
|
9
|
+
Segmented2
|
|
10
|
+
} from "./chunk-5pqksw7z.js";
|
|
11
|
+
import {
|
|
12
|
+
useIcon2
|
|
13
|
+
} from "./chunk-xkchhs2z.js";
|
|
14
|
+
|
|
15
|
+
// blocks/dialogs/hook-dialog/index.tsx
|
|
16
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
17
|
+
import Input from "@justanarthur/modo-ui/components/inputs/input";
|
|
18
|
+
import Select from "@justanarthur/modo-ui/components/inputs/select";
|
|
19
|
+
import Textarea from "@justanarthur/modo-ui/components/inputs/textarea";
|
|
20
|
+
import Dialog from "@justanarthur/modo-ui/components/overlays/dialog";
|
|
21
|
+
import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
|
|
22
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
23
|
+
import Code from "@justanarthur/modo-ui/primitives/content/code";
|
|
24
|
+
import { useState } from "react";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
/*!
|
|
27
|
+
* Local addition: the AI app's "Add hook" form. A Dialog over the event, the
|
|
28
|
+
* matcher, the command, the timeout and the scope, with the settings.json
|
|
29
|
+
* snippet it writes shown as you type.
|
|
30
|
+
*/
|
|
31
|
+
var EVENTS = {
|
|
32
|
+
PreToolUse: {
|
|
33
|
+
note: "Before a tool runs; exit 2 blocks the call and tells Claude why.",
|
|
34
|
+
matcher: {
|
|
35
|
+
hint: "Tool names or a regex: Bash, Edit|Write, mcp__github__.*. Empty matches every tool.",
|
|
36
|
+
placeholder: "Bash"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
PostToolUse: {
|
|
40
|
+
note: "After a tool succeeds, with its input and response.",
|
|
41
|
+
matcher: { hint: "Tool names or a regex: Edit|Write. Empty matches every tool.", placeholder: "Edit|Write" }
|
|
42
|
+
},
|
|
43
|
+
UserPromptSubmit: { note: "When you send a prompt, before Claude sees it; its output joins the context." },
|
|
44
|
+
Notification: { note: "When Claude needs your permission or has been idle waiting for input." },
|
|
45
|
+
Stop: { note: "When the main agent finishes its turn; exit 2 makes it keep going." },
|
|
46
|
+
SubagentStop: { note: "When a subagent finishes." },
|
|
47
|
+
PreCompact: {
|
|
48
|
+
note: "Before the context is compacted.",
|
|
49
|
+
matcher: { hint: "manual (from /compact) or auto. Empty matches both.", placeholder: "auto" }
|
|
50
|
+
},
|
|
51
|
+
SessionStart: {
|
|
52
|
+
note: "When a session starts or resumes; its output joins the context.",
|
|
53
|
+
matcher: { hint: "startup, resume, clear or compact. Empty matches every start.", placeholder: "startup" }
|
|
54
|
+
},
|
|
55
|
+
SessionEnd: { note: "When a session ends." }
|
|
56
|
+
};
|
|
57
|
+
var EVENT_NAMES = Object.keys(EVENTS);
|
|
58
|
+
var EMPTY = { event: "PreToolUse", matcher: "", command: "", timeout: 60, scope: "user" };
|
|
59
|
+
function snippet(hook) {
|
|
60
|
+
const hooks = [{ type: "command", command: hook.command || "…", timeout: hook.timeout }];
|
|
61
|
+
const entry = EVENTS[hook.event].matcher ? { matcher: hook.matcher, hooks } : { hooks };
|
|
62
|
+
return JSON.stringify({ hooks: { [hook.event]: [entry] } }, null, 2);
|
|
63
|
+
}
|
|
64
|
+
function HookDialogPanel2({
|
|
65
|
+
defaultHook,
|
|
66
|
+
configDir = "~/.claude",
|
|
67
|
+
editing = false,
|
|
68
|
+
onSave,
|
|
69
|
+
onCancel,
|
|
70
|
+
className
|
|
71
|
+
}) {
|
|
72
|
+
const [hook, setHook] = useState({ ...EMPTY, ...defaultHook });
|
|
73
|
+
const [timeout, setTimeoutText] = useState(String(hook.timeout));
|
|
74
|
+
const Webhook = useIcon2("webhook");
|
|
75
|
+
const set = (patch) => setHook({ ...hook, ...patch });
|
|
76
|
+
const event = EVENTS[hook.event];
|
|
77
|
+
const timeoutError = /^[1-9]\d*$/.test(timeout) ? undefined : "Whole seconds, at least 1.";
|
|
78
|
+
const valid = Boolean(hook.command.trim()) && !timeoutError;
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: cn("flex flex-col gap-[var(--space-5)]", className),
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "flex flex-col gap-[var(--space-1)] pr-[var(--space-6)]",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("h2", {
|
|
86
|
+
className: "m-0 text-title text-foreground",
|
|
87
|
+
children: editing ? "Edit hook" : "Add a hook"
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx("p", {
|
|
90
|
+
className: "m-0 text-body text-muted-foreground",
|
|
91
|
+
children: "A shell command the harness runs on a session event, with the event as JSON on stdin."
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: "grid grid-cols-1 gap-[var(--space-4)] @md:grid-cols-2",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Field2, {
|
|
99
|
+
label: "Event",
|
|
100
|
+
hint: event.note,
|
|
101
|
+
children: (id) => /* @__PURE__ */ jsxs(Select, {
|
|
102
|
+
value: hook.event,
|
|
103
|
+
onValueChange: (value) => {
|
|
104
|
+
const next = EVENT_NAMES.find((e) => e === value) ?? hook.event;
|
|
105
|
+
set({ event: next, matcher: EVENTS[next].matcher ? hook.matcher : "" });
|
|
106
|
+
},
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx(Select.Trigger, {
|
|
109
|
+
id,
|
|
110
|
+
icon: Webhook
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsx(Select.Content, {
|
|
113
|
+
children: EVENT_NAMES.map((name, i) => /* @__PURE__ */ jsx(Select.Item, {
|
|
114
|
+
index: i,
|
|
115
|
+
value: name,
|
|
116
|
+
children: name
|
|
117
|
+
}, name))
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsx(Field2, {
|
|
123
|
+
label: "Matcher",
|
|
124
|
+
hint: event.matcher?.hint ?? `${hook.event} takes no matcher: it runs every time.`,
|
|
125
|
+
children: (id) => /* @__PURE__ */ jsx(Input, {
|
|
126
|
+
id,
|
|
127
|
+
variant: "bordered",
|
|
128
|
+
className: "font-mono",
|
|
129
|
+
value: hook.matcher,
|
|
130
|
+
placeholder: event.matcher?.placeholder,
|
|
131
|
+
disabled: !event.matcher,
|
|
132
|
+
onValueChange: (matcher) => set({ matcher })
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ jsx(Field2, {
|
|
138
|
+
label: "Command",
|
|
139
|
+
hint: "Exit 0 passes; exit 2 blocks or feeds stderr back to Claude, by event; other codes warn.",
|
|
140
|
+
children: (id) => /* @__PURE__ */ jsx(Textarea, {
|
|
141
|
+
id,
|
|
142
|
+
variant: "bordered",
|
|
143
|
+
className: "font-mono",
|
|
144
|
+
minRows: 2,
|
|
145
|
+
maxRows: 6,
|
|
146
|
+
value: hook.command,
|
|
147
|
+
placeholder: "bun run lint --fix",
|
|
148
|
+
onValueChange: (command) => set({ command })
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsxs("div", {
|
|
152
|
+
className: "grid grid-cols-1 gap-[var(--space-4)] @md:grid-cols-[8rem_minmax(0,1fr)]",
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsx(Field2, {
|
|
155
|
+
label: "Timeout (s)",
|
|
156
|
+
error: timeoutError,
|
|
157
|
+
children: (id) => /* @__PURE__ */ jsx(Input, {
|
|
158
|
+
id,
|
|
159
|
+
variant: "bordered",
|
|
160
|
+
inputMode: "numeric",
|
|
161
|
+
className: "tabular-nums",
|
|
162
|
+
value: timeout,
|
|
163
|
+
invalid: Boolean(timeoutError),
|
|
164
|
+
onValueChange: (text) => {
|
|
165
|
+
setTimeoutText(text);
|
|
166
|
+
if (/^[1-9]\d*$/.test(text))
|
|
167
|
+
set({ timeout: Number(text) });
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ jsx(Fieldset2, {
|
|
172
|
+
legend: "Scope",
|
|
173
|
+
hint: SCOPE_NOTE2[hook.scope],
|
|
174
|
+
children: /* @__PURE__ */ jsx(Segmented2, {
|
|
175
|
+
label: "Scope",
|
|
176
|
+
options: SCOPES2,
|
|
177
|
+
value: hook.scope,
|
|
178
|
+
onValueChange: (scope) => set({ scope })
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ jsx(Fieldset2, {
|
|
184
|
+
legend: `Written to ${settingsFile2(hook.scope, configDir)}`,
|
|
185
|
+
children: /* @__PURE__ */ jsx(Code, {
|
|
186
|
+
language: "json",
|
|
187
|
+
children: snippet(hook)
|
|
188
|
+
})
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ jsxs("div", {
|
|
191
|
+
className: "flex justify-end gap-[var(--space-2)]",
|
|
192
|
+
children: [
|
|
193
|
+
onCancel && /* @__PURE__ */ jsx(Button, {
|
|
194
|
+
variant: "ghost",
|
|
195
|
+
onClick: onCancel,
|
|
196
|
+
children: "Cancel"
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsx(Button, {
|
|
199
|
+
disabled: !valid,
|
|
200
|
+
onClick: () => onSave?.(hook),
|
|
201
|
+
children: editing ? "Save" : "Add hook"
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
var HookDialog2 = Object.assign(function HookDialog({ trigger, open, defaultOpen = false, onOpenChange, onSave, ...panel }) {
|
|
209
|
+
const [isOpen, setOpen] = useControllableState(open, defaultOpen, onOpenChange);
|
|
210
|
+
return /* @__PURE__ */ jsxs(Dialog, {
|
|
211
|
+
open: isOpen,
|
|
212
|
+
onOpenChange: setOpen,
|
|
213
|
+
children: [
|
|
214
|
+
trigger && /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
215
|
+
render: trigger
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ jsx(Dialog.Content, {
|
|
218
|
+
width: "lg",
|
|
219
|
+
"aria-label": "Hook",
|
|
220
|
+
className: "@container",
|
|
221
|
+
children: /* @__PURE__ */ jsx(HookDialogPanel2, {
|
|
222
|
+
...panel,
|
|
223
|
+
onCancel: () => setOpen(false),
|
|
224
|
+
onSave: (hook) => {
|
|
225
|
+
onSave?.(hook);
|
|
226
|
+
setOpen(false);
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
});
|
|
232
|
+
}, { Panel: HookDialogPanel2 });
|
|
233
|
+
var hook_dialog_default = HookDialog2;
|
|
234
|
+
|
|
235
|
+
export { HookDialogPanel2, HookDialog2, hook_dialog_default };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
import {
|
|
7
|
+
PaneSection2,
|
|
8
|
+
IconAction2
|
|
9
|
+
} from "./chunk-eqajdxn8.js";
|
|
10
|
+
|
|
11
|
+
// blocks/panes/terminal-pane/index.tsx
|
|
12
|
+
import { useSurface } from "@justanarthur/modo-ui";
|
|
13
|
+
import LogView from "@justanarthur/modo-ui/components/data-display/log-view";
|
|
14
|
+
import { SURFACE_BG } from "@justanarthur/modo-ui/lib/surface-classes";
|
|
15
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
16
|
+
import { useRef, useState } from "react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
/*!
|
|
19
|
+
* Local addition: the side pane's Terminal — the session's shell in its
|
|
20
|
+
* folder, a prompt you type at rather than a form.
|
|
21
|
+
*/
|
|
22
|
+
function PromptLine({ prompt, children }) {
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: "flex min-w-0 gap-2",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("span", {
|
|
27
|
+
className: "shrink-0 select-none text-muted-foreground",
|
|
28
|
+
children: [
|
|
29
|
+
prompt,
|
|
30
|
+
" $"
|
|
31
|
+
]
|
|
32
|
+
}),
|
|
33
|
+
children
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function TerminalPane2({ shell, onRun }) {
|
|
38
|
+
const [history, setHistory] = useState(shell.history);
|
|
39
|
+
const [command, setCommand] = useState("");
|
|
40
|
+
const inputRef = useRef(null);
|
|
41
|
+
const level = Math.min(useSurface() + 1, 8);
|
|
42
|
+
const Clear = useIcon2("trash");
|
|
43
|
+
return /* @__PURE__ */ jsx(PaneSection2, {
|
|
44
|
+
title: shell.name,
|
|
45
|
+
meta: shell.cwd,
|
|
46
|
+
actions: /* @__PURE__ */ jsx(IconAction2, {
|
|
47
|
+
icon: Clear,
|
|
48
|
+
label: "Clear",
|
|
49
|
+
onClick: () => setHistory([])
|
|
50
|
+
}),
|
|
51
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
52
|
+
onClick: () => inputRef.current?.focus(),
|
|
53
|
+
className: cn("flex cursor-text flex-col gap-1 rounded-xl p-3 font-mono text-caption text-foreground", SURFACE_BG[level]),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx(LogView, {
|
|
56
|
+
label: `${shell.name} output`,
|
|
57
|
+
prompt: "$ ",
|
|
58
|
+
lines: history.flatMap((entry) => [
|
|
59
|
+
`$ ${entry.command}`,
|
|
60
|
+
...entry.output,
|
|
61
|
+
...entry.exit ? [`\x1B[31mexit ${entry.exit}\x1B[0m`] : []
|
|
62
|
+
]),
|
|
63
|
+
className: "-m-3 mb-0 rounded-b-none bg-transparent"
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsx(PromptLine, {
|
|
66
|
+
prompt: shell.prompt,
|
|
67
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
68
|
+
ref: inputRef,
|
|
69
|
+
"aria-label": "Command",
|
|
70
|
+
spellCheck: false,
|
|
71
|
+
autoComplete: "off",
|
|
72
|
+
value: command,
|
|
73
|
+
onChange: (e) => setCommand(e.target.value),
|
|
74
|
+
onKeyDown: (e) => {
|
|
75
|
+
if (e.key !== "Enter" || !command.trim())
|
|
76
|
+
return;
|
|
77
|
+
setHistory((h) => [...h, { command, output: [] }]);
|
|
78
|
+
setCommand("");
|
|
79
|
+
onRun?.(command);
|
|
80
|
+
},
|
|
81
|
+
className: "min-w-0 flex-1 border-0 bg-transparent p-0 font-mono text-caption text-foreground caret-foreground outline-none"
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { TerminalPane2 };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSX as JSX_1kxb } from "react";
|
|
2
|
+
type TodoStatus2 = "pending" | "in_progress" | "completed";
|
|
3
|
+
interface TodoItem2 {
|
|
4
|
+
/** The step, in a few words. */
|
|
5
|
+
content: string;
|
|
6
|
+
/** Where it stands. */
|
|
7
|
+
status: TodoStatus2;
|
|
8
|
+
}
|
|
9
|
+
interface TodoListProps2 {
|
|
10
|
+
/** The plan, in order. */
|
|
11
|
+
items: TodoItem2[];
|
|
12
|
+
/** The header's label. Defaults to `'Tasks'`. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Start with every step showing; folded, the header names the step in progress. Defaults to `true`. */
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
18
|
+
/**
|
|
19
|
+
* An AI's plan, pinned where you can see it: every step, done, in progress
|
|
20
|
+
* or still to come.
|
|
21
|
+
*
|
|
22
|
+
* Done steps take a check and the muted color, the step in progress the
|
|
23
|
+
* Spinner and medium weight, the steps to come an empty ring. The header
|
|
24
|
+
* counts the done steps; its chevron folds the list to that one row, which
|
|
25
|
+
* then names the step in progress.
|
|
26
|
+
*
|
|
27
|
+
* @example {@include ./examples.mdx}
|
|
28
|
+
*/
|
|
29
|
+
declare function TodoList2({ items, title, defaultOpen }: TodoListProps2): Element_12xgc;
|
|
30
|
+
export { TodoStatus2, TodoItem2, TodoListProps2, TodoList2 };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
import {
|
|
7
|
+
Section2,
|
|
8
|
+
Group2,
|
|
9
|
+
Details2,
|
|
10
|
+
Row2,
|
|
11
|
+
Facts2,
|
|
12
|
+
CardCode2,
|
|
13
|
+
Mono2,
|
|
14
|
+
Footer2
|
|
15
|
+
} from "./chunk-5meda998.js";
|
|
16
|
+
|
|
17
|
+
// blocks/settings/hooks/index.tsx
|
|
18
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
19
|
+
import Badge from "@justanarthur/modo-ui/components/data-display/badge";
|
|
20
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
21
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
22
|
+
/*!
|
|
23
|
+
* Local addition: the settings screen's hooks section — each hook's event
|
|
24
|
+
* and matcher, opening into its command, timeout and last run.
|
|
25
|
+
*/
|
|
26
|
+
var key = (hook) => `${hook.event}-${hook.command}`;
|
|
27
|
+
function HookCard({
|
|
28
|
+
hook,
|
|
29
|
+
configDir,
|
|
30
|
+
onRun,
|
|
31
|
+
onEdit
|
|
32
|
+
}) {
|
|
33
|
+
const Play = useIcon2("play");
|
|
34
|
+
const facts = [
|
|
35
|
+
["Event", hook.event],
|
|
36
|
+
["Matcher", /* @__PURE__ */ jsx(Mono2, {
|
|
37
|
+
children: hook.matcher
|
|
38
|
+
}, "m")],
|
|
39
|
+
["Timeout", `${hook.timeout ?? 60} s`]
|
|
40
|
+
];
|
|
41
|
+
if (hook.lastRun) {
|
|
42
|
+
facts.push([
|
|
43
|
+
"Last run",
|
|
44
|
+
/* @__PURE__ */ jsxs("span", {
|
|
45
|
+
className: cn(hook.lastRun.exit !== 0 && "text-destructive"),
|
|
46
|
+
children: [
|
|
47
|
+
hook.lastRun.when,
|
|
48
|
+
" · exit ",
|
|
49
|
+
hook.lastRun.exit
|
|
50
|
+
]
|
|
51
|
+
}, "r")
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(CardCode2, {
|
|
57
|
+
language: "bash",
|
|
58
|
+
children: hook.command
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsx(Facts2, {
|
|
61
|
+
items: facts
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsxs(Footer2, {
|
|
64
|
+
source: hook.scope === "project" ? ".claude/settings.json" : `${configDir}/settings.json`,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Button, {
|
|
67
|
+
size: "compact",
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
leadingIcon: Play,
|
|
70
|
+
onClick: onRun,
|
|
71
|
+
children: "Run now"
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ jsx(Button, {
|
|
74
|
+
size: "compact",
|
|
75
|
+
variant: "ghost",
|
|
76
|
+
onClick: onEdit,
|
|
77
|
+
children: "Edit"
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function Hooks2({ hooks, configDir, defaultOpen, onAdd, onRun, onEdit }) {
|
|
85
|
+
const Plus = useIcon2("plus");
|
|
86
|
+
return /* @__PURE__ */ jsx(Section2, {
|
|
87
|
+
title: "Hooks",
|
|
88
|
+
lead: "Commands the harness runs on session events, before and after tools. Project hooks come from the repo's .claude/settings.json.",
|
|
89
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
90
|
+
size: "compact",
|
|
91
|
+
leadingIcon: Plus,
|
|
92
|
+
onClick: onAdd,
|
|
93
|
+
children: "Add hook"
|
|
94
|
+
}),
|
|
95
|
+
children: /* @__PURE__ */ jsx(Group2, {
|
|
96
|
+
title: "Hooks",
|
|
97
|
+
aside: /* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: "tabular-nums",
|
|
99
|
+
children: hooks.length
|
|
100
|
+
}),
|
|
101
|
+
children: /* @__PURE__ */ jsx(Details2, {
|
|
102
|
+
label: "Hooks",
|
|
103
|
+
defaultOpen,
|
|
104
|
+
children: hooks.map((hook, i) => /* @__PURE__ */ jsx(Row2, {
|
|
105
|
+
value: key(hook),
|
|
106
|
+
index: i,
|
|
107
|
+
label: `${hook.event} · ${hook.matcher}`,
|
|
108
|
+
caption: /* @__PURE__ */ jsx("span", {
|
|
109
|
+
className: "font-mono",
|
|
110
|
+
children: hook.command
|
|
111
|
+
}),
|
|
112
|
+
meta: /* @__PURE__ */ jsxs(Fragment, {
|
|
113
|
+
children: [
|
|
114
|
+
hook.lastRun && hook.lastRun.exit !== 0 && /* @__PURE__ */ jsx(Badge, {
|
|
115
|
+
size: "compact",
|
|
116
|
+
variant: "dot",
|
|
117
|
+
color: "red",
|
|
118
|
+
children: "Failed"
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ jsx("span", {
|
|
121
|
+
className: "text-caption",
|
|
122
|
+
children: hook.scope
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}),
|
|
126
|
+
children: /* @__PURE__ */ jsx(HookCard, {
|
|
127
|
+
hook,
|
|
128
|
+
configDir,
|
|
129
|
+
onRun: () => onRun?.(hook),
|
|
130
|
+
onEdit: () => onEdit?.(hook)
|
|
131
|
+
})
|
|
132
|
+
}, key(hook)))
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
export { Hooks2 };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JSX as JSX_1kxb } from "react";
|
|
2
|
+
interface ChapterNavItem2 {
|
|
3
|
+
/** The id of its `ChapterNav.Break`. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The chapter's title. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** A short line under the title: when it started, how many turns. */
|
|
8
|
+
detail?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ChapterBreakProps2 {
|
|
11
|
+
/** The chapter's title, also its entry in the chapter list. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** The anchor id the chapter list jumps to. */
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
17
|
+
/** A chapter break: a hairline with the chapter's title. */
|
|
18
|
+
declare function ChapterBreak2({ title, id }: ChapterBreakProps2): Element_12xgc;
|
|
19
|
+
interface ChapterNavProps2 {
|
|
20
|
+
/** The chapters, in order. */
|
|
21
|
+
chapters: ChapterNavItem2[];
|
|
22
|
+
/** The current chapter's id. Defaults to the last chapter. */
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/** Called with a chapter id when one is picked. */
|
|
25
|
+
onValueChange?: (id: string) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The chapters of a long conversation, one press away.
|
|
29
|
+
*
|
|
30
|
+
* A ghost icon button opens a Popover listing the chapters, numbered, each
|
|
31
|
+
* with a short line under its title; the current one is checked. Picking a
|
|
32
|
+
* chapter scrolls its `ChapterNav.Break` (a hairline with the title, placed
|
|
33
|
+
* in the conversation) to the top of the view.
|
|
34
|
+
*
|
|
35
|
+
* Statics:
|
|
36
|
+
* - `ChapterNav.Break` — the titled hairline a chapter starts with: `title`, `id`.
|
|
37
|
+
*
|
|
38
|
+
* @example {@include ./examples.mdx}
|
|
39
|
+
*/
|
|
40
|
+
declare const ChapterNav2: (({ chapters, defaultValue, onValueChange }: ChapterNavProps2) => Element_12xgc) & {
|
|
41
|
+
Break: typeof ChapterBreak2;
|
|
42
|
+
};
|
|
43
|
+
export { ChapterNavItem2, ChapterBreakProps2, ChapterBreak2, ChapterNavProps2, ChapterNav2 };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
type PlanDecision2 = "auto" | "review" | "keep-planning";
|
|
4
|
+
interface PlanApprovalProps2 {
|
|
5
|
+
/** The plan, as rendered markdown. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** What is asked, in one line. Defaults to `'Ready to code? Here is the plan.'`. */
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/** A chip after the title. Defaults to `'Plan mode'`. */
|
|
10
|
+
tag?: string;
|
|
11
|
+
/** The feedback field's placeholder. Defaults to `'Tell the agent what to change'`. */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Called with the decision and any feedback. */
|
|
14
|
+
onDecide?: (decision: PlanDecision2, feedback: string) => void;
|
|
15
|
+
}
|
|
16
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
17
|
+
/**
|
|
18
|
+
* A plan the agent wrote, waiting for your go-ahead.
|
|
19
|
+
*
|
|
20
|
+
* The plan reads as Prose in a scrolling frame that fades at its edges,
|
|
21
|
+
* with a feedback field under it. The decisions sit on the bottom row:
|
|
22
|
+
* keep planning with the feedback, approve and review each edit, or approve
|
|
23
|
+
* with edits accepted.
|
|
24
|
+
*
|
|
25
|
+
* @example {@include ./examples.mdx}
|
|
26
|
+
*/
|
|
27
|
+
declare function PlanApproval2({ children, title, tag, placeholder, onDecide }: PlanApprovalProps2): Element_12xgc;
|
|
28
|
+
export { PlanDecision2, PlanApprovalProps2, PlanApproval2 };
|