@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,313 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SCOPES2
|
|
5
|
+
} from "./chunk-5pqksw7z.js";
|
|
6
|
+
import {
|
|
7
|
+
useIcon2
|
|
8
|
+
} from "./chunk-xkchhs2z.js";
|
|
9
|
+
import {
|
|
10
|
+
Section2,
|
|
11
|
+
Group2,
|
|
12
|
+
ON_HOVER2
|
|
13
|
+
} from "./chunk-5meda998.js";
|
|
14
|
+
|
|
15
|
+
// blocks/settings/permission-rules/index.tsx
|
|
16
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
17
|
+
import Badge from "@justanarthur/modo-ui/components/data-display/badge";
|
|
18
|
+
import List from "@justanarthur/modo-ui/components/data-display/list";
|
|
19
|
+
import Input from "@justanarthur/modo-ui/components/inputs/input";
|
|
20
|
+
import Select from "@justanarthur/modo-ui/components/inputs/select";
|
|
21
|
+
import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
|
|
22
|
+
import { useState } from "react";
|
|
23
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
24
|
+
/*!
|
|
25
|
+
* Local addition: the AI app's permissions settings section — the default
|
|
26
|
+
* permission mode, allow / ask / deny rules with their scope, added inline
|
|
27
|
+
* and moved between groups, and the extra directories the sessions may
|
|
28
|
+
* touch.
|
|
29
|
+
*/
|
|
30
|
+
var BEHAVIORS = [
|
|
31
|
+
{ value: "allow", label: "Allow", note: "Runs without asking." },
|
|
32
|
+
{ value: "ask", label: "Ask", note: "Asks every time, even where an allow rule matches." },
|
|
33
|
+
{ value: "deny", label: "Deny", note: "Never runs; deny wins over every other rule." }
|
|
34
|
+
];
|
|
35
|
+
var MODES = [
|
|
36
|
+
{ value: "default", label: "Ask first", note: "Asks the first time each tool is used." },
|
|
37
|
+
{ value: "acceptEdits", label: "Accept edits", note: "File edits go through; commands still ask." },
|
|
38
|
+
{ value: "plan", label: "Plan", note: "Reads and plans; changes nothing until a plan is approved." },
|
|
39
|
+
{ value: "bypassPermissions", label: "Bypass", note: "Never asks. Only in a sandbox or a container." }
|
|
40
|
+
];
|
|
41
|
+
var SCOPE_BADGE = { user: "gray", project: "blue", local: "violet" };
|
|
42
|
+
var RULE = /^(?:[A-Z][A-Za-z]*|mcp__[\w-]+(?:__[\w-]+)?)(?:\([^()]+\))?$/;
|
|
43
|
+
var EMPTY = { mode: "default", rules: [], directories: [] };
|
|
44
|
+
function ruleError(rule, rules) {
|
|
45
|
+
if (!rule)
|
|
46
|
+
return;
|
|
47
|
+
if (!RULE.test(rule))
|
|
48
|
+
return "A tool name, optionally with a pattern: Bash(bun run *), Edit(ui/**), WebFetch(domain:github.com).";
|
|
49
|
+
const clash = rules.find((r) => r.rule === rule);
|
|
50
|
+
if (clash)
|
|
51
|
+
return `Already in ${BEHAVIORS.find((b) => b.value === clash.behavior)?.label}.`;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
function Picker({
|
|
55
|
+
label,
|
|
56
|
+
options,
|
|
57
|
+
value,
|
|
58
|
+
onValueChange,
|
|
59
|
+
className
|
|
60
|
+
}) {
|
|
61
|
+
return /* @__PURE__ */ jsxs(Select, {
|
|
62
|
+
size: "compact",
|
|
63
|
+
value,
|
|
64
|
+
onValueChange: (next) => onValueChange(options.find((o) => o.value === next)?.value ?? value),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Select.Trigger, {
|
|
67
|
+
variant: "borderless",
|
|
68
|
+
"aria-label": label,
|
|
69
|
+
className
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx(Select.Content, {
|
|
72
|
+
children: options.map((o, i) => /* @__PURE__ */ jsx(Select.Item, {
|
|
73
|
+
index: i,
|
|
74
|
+
value: o.value,
|
|
75
|
+
children: o.label
|
|
76
|
+
}, o.value))
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function Line({ children, actions }) {
|
|
82
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
83
|
+
className: "group/row flex h-9 min-w-0 items-center gap-[var(--space-2)] border-b border-border last:border-b-0",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: "flex min-w-0 flex-1 items-center gap-[var(--space-2)]",
|
|
87
|
+
children
|
|
88
|
+
}),
|
|
89
|
+
actions
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function Remove({ label, onPress }) {
|
|
94
|
+
const Trash = useIcon2("trash");
|
|
95
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
size: "icon-compact",
|
|
98
|
+
"aria-label": label,
|
|
99
|
+
className: ON_HOVER2,
|
|
100
|
+
onClick: onPress,
|
|
101
|
+
children: /* @__PURE__ */ jsx(Trash, {})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function AddRule({ rules, onAdd }) {
|
|
105
|
+
const [text, setRule] = useState("");
|
|
106
|
+
const rule = text.trim();
|
|
107
|
+
const [behavior, setBehavior] = useState("allow");
|
|
108
|
+
const [scope, setScope] = useState("project");
|
|
109
|
+
const Plus = useIcon2("plus");
|
|
110
|
+
const error = ruleError(rule, rules);
|
|
111
|
+
const add = () => {
|
|
112
|
+
if (!rule || error)
|
|
113
|
+
return;
|
|
114
|
+
onAdd({ rule, behavior, scope });
|
|
115
|
+
setRule("");
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
118
|
+
className: "flex flex-col gap-[var(--space-1)]",
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ jsxs("div", {
|
|
121
|
+
className: "flex flex-wrap items-center gap-[var(--space-2)]",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsx(Input, {
|
|
124
|
+
variant: "bordered",
|
|
125
|
+
size: "compact",
|
|
126
|
+
"aria-label": "New rule",
|
|
127
|
+
placeholder: "Bash(bun run *)",
|
|
128
|
+
className: "min-w-48 flex-1 font-mono",
|
|
129
|
+
value: text,
|
|
130
|
+
invalid: Boolean(error),
|
|
131
|
+
onValueChange: setRule,
|
|
132
|
+
onKeyDown: (e) => e.key === "Enter" && add()
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ jsx(Picker, {
|
|
135
|
+
label: "Rule behavior",
|
|
136
|
+
options: BEHAVIORS,
|
|
137
|
+
value: behavior,
|
|
138
|
+
onValueChange: setBehavior
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ jsx(Picker, {
|
|
141
|
+
label: "Rule scope",
|
|
142
|
+
options: SCOPES2,
|
|
143
|
+
value: scope,
|
|
144
|
+
onValueChange: setScope
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx(Button, {
|
|
147
|
+
size: "compact",
|
|
148
|
+
variant: "secondary",
|
|
149
|
+
leadingIcon: Plus,
|
|
150
|
+
disabled: !rule || Boolean(error),
|
|
151
|
+
onClick: add,
|
|
152
|
+
children: "Add rule"
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
}),
|
|
156
|
+
error && /* @__PURE__ */ jsx("span", {
|
|
157
|
+
className: "text-caption text-destructive",
|
|
158
|
+
children: error
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function AddDirectory({ directories, onAdd }) {
|
|
164
|
+
const [text, setPath] = useState("");
|
|
165
|
+
const path = text.trim();
|
|
166
|
+
const Plus = useIcon2("plus");
|
|
167
|
+
const taken = directories.includes(path);
|
|
168
|
+
const add = () => {
|
|
169
|
+
if (!path || taken)
|
|
170
|
+
return;
|
|
171
|
+
onAdd(path);
|
|
172
|
+
setPath("");
|
|
173
|
+
};
|
|
174
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
175
|
+
className: "flex flex-col gap-[var(--space-1)] pt-[var(--space-2)]",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsxs("div", {
|
|
178
|
+
className: "flex items-center gap-[var(--space-2)]",
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx(Input, {
|
|
181
|
+
variant: "bordered",
|
|
182
|
+
size: "compact",
|
|
183
|
+
"aria-label": "New directory",
|
|
184
|
+
placeholder: "../../shared-config",
|
|
185
|
+
className: "min-w-0 flex-1 font-mono",
|
|
186
|
+
value: text,
|
|
187
|
+
invalid: taken,
|
|
188
|
+
onValueChange: setPath,
|
|
189
|
+
onKeyDown: (e) => e.key === "Enter" && add()
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ jsx(Button, {
|
|
192
|
+
size: "compact",
|
|
193
|
+
variant: "secondary",
|
|
194
|
+
leadingIcon: Plus,
|
|
195
|
+
disabled: !path || taken,
|
|
196
|
+
onClick: add,
|
|
197
|
+
children: "Add directory"
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
}),
|
|
201
|
+
taken && /* @__PURE__ */ jsx("span", {
|
|
202
|
+
className: "text-caption text-destructive",
|
|
203
|
+
children: "Already listed."
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function PermissionRules2({ value, defaultValue = EMPTY, onChange }) {
|
|
209
|
+
const [settings, setSettings] = useControllableState(value, defaultValue, onChange);
|
|
210
|
+
const set = (patch) => setSettings({ ...settings, ...patch });
|
|
211
|
+
const setRules = (rules) => set({ rules });
|
|
212
|
+
const mode = MODES.find((m) => m.value === settings.mode);
|
|
213
|
+
return /* @__PURE__ */ jsxs(Section2, {
|
|
214
|
+
title: "Permissions",
|
|
215
|
+
lead: "What the sessions may do without asking. Project rules come from the repo's .claude/settings.json, local ones from its git-ignored settings.local.json.",
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ jsx(List, {
|
|
218
|
+
className: "-ml-[var(--space-2)]",
|
|
219
|
+
children: /* @__PURE__ */ jsx(List.Row, {
|
|
220
|
+
label: "Default mode",
|
|
221
|
+
description: mode?.note,
|
|
222
|
+
children: /* @__PURE__ */ jsx(Picker, {
|
|
223
|
+
label: "Default mode",
|
|
224
|
+
options: MODES,
|
|
225
|
+
value: settings.mode,
|
|
226
|
+
onValueChange: (next) => set({ mode: next })
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ jsx(AddRule, {
|
|
231
|
+
rules: settings.rules,
|
|
232
|
+
onAdd: (rule) => setRules([...settings.rules, rule])
|
|
233
|
+
}),
|
|
234
|
+
BEHAVIORS.map((behavior) => {
|
|
235
|
+
const rules = settings.rules.filter((r) => r.behavior === behavior.value);
|
|
236
|
+
return /* @__PURE__ */ jsx(Group2, {
|
|
237
|
+
title: `${behavior.label} · ${behavior.note}`,
|
|
238
|
+
aside: /* @__PURE__ */ jsx("span", {
|
|
239
|
+
className: "tabular-nums",
|
|
240
|
+
children: rules.length
|
|
241
|
+
}),
|
|
242
|
+
children: rules.length === 0 ? /* @__PURE__ */ jsxs("p", {
|
|
243
|
+
className: "m-0 py-[var(--space-2)] text-body text-muted-foreground",
|
|
244
|
+
children: [
|
|
245
|
+
"No ",
|
|
246
|
+
behavior.label.toLowerCase(),
|
|
247
|
+
" rules."
|
|
248
|
+
]
|
|
249
|
+
}) : /* @__PURE__ */ jsx("ul", {
|
|
250
|
+
"aria-label": behavior.label,
|
|
251
|
+
className: "m-0 flex list-none flex-col p-0",
|
|
252
|
+
children: rules.map((rule) => /* @__PURE__ */ jsxs(Line, {
|
|
253
|
+
actions: /* @__PURE__ */ jsxs(Fragment, {
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ jsx(Picker, {
|
|
256
|
+
label: `Move ${rule.rule}`,
|
|
257
|
+
options: BEHAVIORS,
|
|
258
|
+
value: rule.behavior,
|
|
259
|
+
className: ON_HOVER2,
|
|
260
|
+
onValueChange: (next) => setRules(settings.rules.map((r) => r === rule ? { ...r, behavior: next } : r))
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx(Remove, {
|
|
263
|
+
label: `Remove ${rule.rule}`,
|
|
264
|
+
onPress: () => setRules(settings.rules.filter((r) => r !== rule))
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
}),
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ jsx("span", {
|
|
270
|
+
className: "min-w-0 truncate font-mono text-caption text-foreground",
|
|
271
|
+
children: rule.rule
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
274
|
+
size: "compact",
|
|
275
|
+
color: SCOPE_BADGE[rule.scope],
|
|
276
|
+
children: rule.scope
|
|
277
|
+
})
|
|
278
|
+
]
|
|
279
|
+
}, rule.rule))
|
|
280
|
+
})
|
|
281
|
+
}, behavior.value);
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ jsxs(Group2, {
|
|
284
|
+
title: "Additional directories · read and edited like the repo",
|
|
285
|
+
aside: /* @__PURE__ */ jsx("span", {
|
|
286
|
+
className: "tabular-nums",
|
|
287
|
+
children: settings.directories.length
|
|
288
|
+
}),
|
|
289
|
+
children: [
|
|
290
|
+
settings.directories.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
291
|
+
"aria-label": "Additional directories",
|
|
292
|
+
className: "m-0 flex list-none flex-col p-0",
|
|
293
|
+
children: settings.directories.map((path) => /* @__PURE__ */ jsx(Line, {
|
|
294
|
+
actions: /* @__PURE__ */ jsx(Remove, {
|
|
295
|
+
label: `Remove ${path}`,
|
|
296
|
+
onPress: () => set({ directories: settings.directories.filter((d) => d !== path) })
|
|
297
|
+
}),
|
|
298
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
299
|
+
className: "min-w-0 truncate font-mono text-caption text-foreground",
|
|
300
|
+
children: path
|
|
301
|
+
})
|
|
302
|
+
}, path))
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ jsx(AddDirectory, {
|
|
305
|
+
directories: settings.directories,
|
|
306
|
+
onAdd: (path) => set({ directories: [...settings.directories, path] })
|
|
307
|
+
})
|
|
308
|
+
]
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
export { PermissionRules2 };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Profile2 } from "./chunk-jkkdq1mh.js";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
interface ProfileUsageProps2 {
|
|
4
|
+
/** The profiles to show. */
|
|
5
|
+
profiles: Profile2[];
|
|
6
|
+
/** Called by the popover's Profiles button. */
|
|
7
|
+
onManage?: () => void;
|
|
8
|
+
}
|
|
9
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
10
|
+
/**
|
|
11
|
+
* How much each profile has left, read against the time until each limit
|
|
12
|
+
* resets, in one sidebar row.
|
|
13
|
+
*
|
|
14
|
+
* A share alone raises the wrong alarm: 78% of a weekly limit that resets
|
|
15
|
+
* tomorrow is room to spend, while 42% of a session an hour in is not. So
|
|
16
|
+
* every bar is colored by whether its limit lasts until its reset at the
|
|
17
|
+
* current pace (grey when it does, amber when only just, red when it runs
|
|
18
|
+
* out first), and carries a tick where an even spend would be by now: a
|
|
19
|
+
* fill past the tick is spending faster than the window refills. The row
|
|
20
|
+
* lists every profile by name with its session limit over its tightest
|
|
21
|
+
* weekly one; press it for every limit with its share and time to reset.
|
|
22
|
+
* A profile with no limits yet (`limits: []`, as before its first turn
|
|
23
|
+
* reports usage) reads "No usage yet" instead of a bar.
|
|
24
|
+
*
|
|
25
|
+
* Put it in a Sidebar (the session sidebar puts it in its footer).
|
|
26
|
+
*
|
|
27
|
+
* @example {@include ./examples.mdx}
|
|
28
|
+
*/
|
|
29
|
+
declare function ProfileUsage2({ profiles, onManage }: ProfileUsageProps2): Element_12xgc;
|
|
30
|
+
export { ProfileUsageProps2, ProfileUsage2 };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UsageLimit2, Profile2 } from "./chunk-jkkdq1mh.js";
|
|
2
|
+
/** `free`: lasts past the reset at this pace; `watch`: only just; `tight`: runs out before it. */
|
|
3
|
+
type Verdict2 = "free" | "watch" | "tight";
|
|
4
|
+
interface LimitPace2 {
|
|
5
|
+
limit: UsageLimit2;
|
|
6
|
+
/** Share of the window already gone, 0–1: where an even spend would be now. */
|
|
7
|
+
elapsed: number;
|
|
8
|
+
/** Share used at the reset if spending goes on at the pace so far (may exceed 1). */
|
|
9
|
+
projected: number;
|
|
10
|
+
/** Hours until the limit is hit at that pace; Infinity when it lasts past the reset. */
|
|
11
|
+
runsOutInHours: number;
|
|
12
|
+
verdict: Verdict2;
|
|
13
|
+
}
|
|
14
|
+
interface ProfilePace2 {
|
|
15
|
+
profile: Profile2;
|
|
16
|
+
limits: LimitPace2[];
|
|
17
|
+
/** The limit that runs out first, or lands highest at its reset; undefined while the profile has no limits yet (none reported before its first turn). */
|
|
18
|
+
binding?: LimitPace2;
|
|
19
|
+
}
|
|
20
|
+
/** Each limit's pace and the binding one. A profile with no limits yet gets `limits: []` and no `binding`. */
|
|
21
|
+
declare function paceOf2(profile: Profile2): ProfilePace2;
|
|
22
|
+
/** A short duration: `17m`, `2h 20m`, `20h`, `4d`. */
|
|
23
|
+
declare function duration2(hours: number): string;
|
|
24
|
+
/** What a profile with no limits yet shows in place of a share or a verdict. */
|
|
25
|
+
declare const NO_USAGE2 = "No usage yet";
|
|
26
|
+
declare function percent2(share: number): string;
|
|
27
|
+
declare const VERDICT_TEXT2: Record<Verdict2, string>;
|
|
28
|
+
export { Verdict2, LimitPace2, ProfilePace2, paceOf2, duration2, NO_USAGE2, percent2, VERDICT_TEXT2 };
|
|
@@ -0,0 +1,55 @@
|
|
|
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/plugins/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 skills and plugins section — two
|
|
18
|
+
* runs of switches, skills and plugins, each with how many are on.
|
|
19
|
+
*/
|
|
20
|
+
var on = (list) => `${list.filter((p) => p.enabled).length} of ${list.length} on`;
|
|
21
|
+
function Plugins2({ plugins, onBrowse, onToggle }) {
|
|
22
|
+
const Search = useIcon2("search");
|
|
23
|
+
const runs = [
|
|
24
|
+
{ title: "Skills", items: plugins.filter((p) => p.kind === "skill") },
|
|
25
|
+
{ title: "Plugins", items: plugins.filter((p) => p.kind === "plugin") }
|
|
26
|
+
];
|
|
27
|
+
return /* @__PURE__ */ jsx(Section2, {
|
|
28
|
+
title: "Skills and plugins",
|
|
29
|
+
lead: "Skills load into a turn when a task calls for them; plugins bundle commands, skills, hooks and panes.",
|
|
30
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
31
|
+
size: "compact",
|
|
32
|
+
variant: "tertiary",
|
|
33
|
+
leadingIcon: Search,
|
|
34
|
+
onClick: onBrowse,
|
|
35
|
+
children: "Browse catalog"
|
|
36
|
+
}),
|
|
37
|
+
children: runs.map((run) => /* @__PURE__ */ jsx(Group2, {
|
|
38
|
+
title: run.title,
|
|
39
|
+
aside: /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "tabular-nums",
|
|
41
|
+
children: on(run.items)
|
|
42
|
+
}),
|
|
43
|
+
children: /* @__PURE__ */ jsx(Toggles2, {
|
|
44
|
+
label: run.title,
|
|
45
|
+
children: run.items.map((plugin) => /* @__PURE__ */ jsx(Switch, {
|
|
46
|
+
label: plugin.name,
|
|
47
|
+
description: plugin.description,
|
|
48
|
+
defaultChecked: plugin.enabled,
|
|
49
|
+
onCheckedChange: (enabled) => onToggle?.(plugin, enabled)
|
|
50
|
+
}, plugin.name))
|
|
51
|
+
})
|
|
52
|
+
}, run.title))
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export { Plugins2 };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IconName2 } from "./chunk-13yf0mza.js";
|
|
2
|
+
import { PaneChange2, PaneFile2, PaneShell2, PanePullRequest2, PaneArtifact2, PaneTask2 } from "./chunk-66sh633m.js";
|
|
3
|
+
import { PaneId2, Profile2 } from "./chunk-jkkdq1mh.js";
|
|
4
|
+
import { JSX as JSX_1kxb } from "react";
|
|
5
|
+
declare const PANES2: {
|
|
6
|
+
id: PaneId2;
|
|
7
|
+
label: string;
|
|
8
|
+
icon: IconName2;
|
|
9
|
+
}[];
|
|
10
|
+
/** Every pane's data, handed to the pane blocks. */
|
|
11
|
+
interface SidePaneData2 {
|
|
12
|
+
changes: PaneChange2[];
|
|
13
|
+
file: PaneFile2;
|
|
14
|
+
/** The session's file paths, for the File pane's tree. */
|
|
15
|
+
files?: string[];
|
|
16
|
+
shell: PaneShell2;
|
|
17
|
+
pr: PanePullRequest2;
|
|
18
|
+
artifacts: PaneArtifact2[];
|
|
19
|
+
tasks: PaneTask2[];
|
|
20
|
+
/** The profiles the extensions slot reads usage from. */
|
|
21
|
+
profiles: Profile2[];
|
|
22
|
+
}
|
|
23
|
+
interface SidePaneProps2 {
|
|
24
|
+
/** Every pane's data: changes, the open file, the shell, the pull request, artifacts, tasks and the profiles for usage. */
|
|
25
|
+
data: SidePaneData2;
|
|
26
|
+
/** Controlled open pane. Pair with `onPaneChange`. */
|
|
27
|
+
pane?: PaneId2;
|
|
28
|
+
/** Initial pane, for an uncontrolled side pane. Defaults to `'changes'`. */
|
|
29
|
+
defaultPane?: PaneId2;
|
|
30
|
+
/** Called with the pane picked in the strip. */
|
|
31
|
+
onPaneChange?: (pane: PaneId2) => void;
|
|
32
|
+
/** Called by the close button. */
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
/** Classes for the root. */
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
38
|
+
/**
|
|
39
|
+
* The room beside the transcript for what the session touches: its
|
|
40
|
+
* changes, a file, a terminal, its pull request, artifacts and background
|
|
41
|
+
* tasks.
|
|
42
|
+
*
|
|
43
|
+
* Pill tabs at the top switch panes; only the picked tab spells out its
|
|
44
|
+
* name, so the strip fits a narrow pane, and the pill melts from tab to
|
|
45
|
+
* tab. The + beside the last tab adds optional panes from plugins (a
|
|
46
|
+
* browser, an iOS simulator); the close button sits at the far edge. The
|
|
47
|
+
* strip is as tall as the session's header, so the two share a line across
|
|
48
|
+
* the window.
|
|
49
|
+
*
|
|
50
|
+
* Every pane speaks one language: a section row with a title, its meta and
|
|
51
|
+
* icon actions, then rows on the control height whose text lines up with
|
|
52
|
+
* the title. Changes splits the files into staged and unstaged with a
|
|
53
|
+
* commit field on top; a row's stage, unstage and revert show on hover, and
|
|
54
|
+
* the picked file's diff wraps its long lines (toggle it to scroll). File
|
|
55
|
+
* shows a path crumb with copy and open. Terminal is a prompt you type at,
|
|
56
|
+
* not a form. The pull request lists its checks: a failed one opens to the
|
|
57
|
+
* tail of its log with Ask Claude to fix, and the merge waits while one
|
|
58
|
+
* fails. Artifacts open on press; tasks stop while they run and retry once
|
|
59
|
+
* they failed or stopped. The last tab is the extensions slot, a pane your
|
|
60
|
+
* own MCP server or plugin provides: here, every profile's limits as pace
|
|
61
|
+
* bars, read against the time until each resets. A pane with nothing in it
|
|
62
|
+
* says so and what lands there.
|
|
63
|
+
*
|
|
64
|
+
* @example {@include ./examples.mdx}
|
|
65
|
+
*/
|
|
66
|
+
declare function SidePane2({ data, pane, defaultPane, onPaneChange, onClose, className }: SidePaneProps2): Element_12xgc;
|
|
67
|
+
export { PANES2, SidePaneData2, SidePaneProps2, SidePane2 };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// lib/pace.ts
|
|
2
|
+
/*!
|
|
3
|
+
* Local addition: the profile usage's model of a limit over time. A
|
|
4
|
+
* limit's share alone says little (78% used is fine when it resets in a few
|
|
5
|
+
* hours), so each limit is read against its window: the burn rate so far,
|
|
6
|
+
* where that rate lands at the reset, and whether it runs out first.
|
|
7
|
+
*/
|
|
8
|
+
var WATCH_AT = 0.95;
|
|
9
|
+
var MIN_ELAPSED = 0.1;
|
|
10
|
+
function paceOfLimit(limit) {
|
|
11
|
+
const elapsedHours = limit.windowHours - limit.resetsInHours;
|
|
12
|
+
const rate = limit.value / Math.max(elapsedHours, limit.windowHours * MIN_ELAPSED);
|
|
13
|
+
const projected = limit.value + rate * limit.resetsInHours;
|
|
14
|
+
const runsOut = rate > 0 ? (1 - limit.value) / rate : Number.POSITIVE_INFINITY;
|
|
15
|
+
const runsOutInHours = runsOut < limit.resetsInHours ? runsOut : Number.POSITIVE_INFINITY;
|
|
16
|
+
const verdict = runsOutInHours < Number.POSITIVE_INFINITY ? "tight" : projected >= WATCH_AT ? "watch" : "free";
|
|
17
|
+
return { limit, elapsed: elapsedHours / limit.windowHours, projected, runsOutInHours, verdict };
|
|
18
|
+
}
|
|
19
|
+
function paceOf2(profile) {
|
|
20
|
+
const limits = profile.limits.map(paceOfLimit);
|
|
21
|
+
const binding = [...limits].sort((a, b) => b.projected - a.projected)[0];
|
|
22
|
+
return { profile, limits, binding };
|
|
23
|
+
}
|
|
24
|
+
function duration2(hours) {
|
|
25
|
+
if (hours < 1)
|
|
26
|
+
return `${Math.max(Math.round(hours * 60), 1)}m`;
|
|
27
|
+
if (hours < 10) {
|
|
28
|
+
const h = Math.floor(hours);
|
|
29
|
+
const m = Math.round((hours - h) * 60);
|
|
30
|
+
return m === 0 ? `${h}h` : `${h}h ${m}m`;
|
|
31
|
+
}
|
|
32
|
+
if (hours < 48)
|
|
33
|
+
return `${Math.round(hours)}h`;
|
|
34
|
+
return `${Math.round(hours / 24)}d`;
|
|
35
|
+
}
|
|
36
|
+
var NO_USAGE2 = "No usage yet";
|
|
37
|
+
function percent2(share) {
|
|
38
|
+
return `${Math.round(share * 100)}%`;
|
|
39
|
+
}
|
|
40
|
+
var VERDICT_TEXT2 = {
|
|
41
|
+
free: "text-muted-foreground",
|
|
42
|
+
watch: "text-status-warning",
|
|
43
|
+
tight: "text-status-error"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { paceOf2, duration2, NO_USAGE2, percent2, VERDICT_TEXT2 };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JSX as JSX_1kxb } from "react";
|
|
2
|
+
interface NotificationSetting2 {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface NotificationGroup2 {
|
|
9
|
+
title: string;
|
|
10
|
+
settings: NotificationSetting2[];
|
|
11
|
+
}
|
|
12
|
+
interface NotificationsProps2 {
|
|
13
|
+
/** Captioned runs of settings, in order ("Notify me when", "Behavior"). */
|
|
14
|
+
groups: NotificationGroup2[];
|
|
15
|
+
/** Called when a setting's switch flips, with its id and new state. */
|
|
16
|
+
onChange?: (id: string, enabled: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
19
|
+
/**
|
|
20
|
+
* How the app gets your attention while sessions run in the background.
|
|
21
|
+
*
|
|
22
|
+
* Each run is a captioned list of switches with a description under each
|
|
23
|
+
* label: what to be told about (input needed, a turn finished, CI changed)
|
|
24
|
+
* and how (a sound, keeping the Mac awake).
|
|
25
|
+
*
|
|
26
|
+
* @example {@include ./examples.mdx}
|
|
27
|
+
*/
|
|
28
|
+
declare function Notifications2({ groups, onChange }: NotificationsProps2): Element_12xgc;
|
|
29
|
+
export { NotificationSetting2, NotificationGroup2, NotificationsProps2, Notifications2 };
|