@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,531 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
|
|
7
|
+
// blocks/profiles/profile-onboarding/index.tsx
|
|
8
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
9
|
+
import Copy from "@justanarthur/modo-ui/components/actions/copy";
|
|
10
|
+
import List from "@justanarthur/modo-ui/components/data-display/list";
|
|
11
|
+
import LogView from "@justanarthur/modo-ui/components/data-display/log-view";
|
|
12
|
+
import { Spinner } from "@justanarthur/modo-ui/components/feedback/progress";
|
|
13
|
+
import ChoiceList from "@justanarthur/modo-ui/components/inputs/choice-list";
|
|
14
|
+
import Input, { Label } from "@justanarthur/modo-ui/components/inputs/input";
|
|
15
|
+
import Dialog from "@justanarthur/modo-ui/components/overlays/dialog";
|
|
16
|
+
import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
|
|
17
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
18
|
+
import { useId, useState } from "react";
|
|
19
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
20
|
+
/*!
|
|
21
|
+
* Local addition: the AI app's "Add profile" flow. A Dialog stepper: pick a
|
|
22
|
+
* kind (a Claude account in its own config dir, or an Anthropic-compatible
|
|
23
|
+
* provider), name it, sign in (the `claude login` output in a LogView, or a
|
|
24
|
+
* test request against the provider), done. The sign-in itself runs outside;
|
|
25
|
+
* its state comes in through `signIn`.
|
|
26
|
+
*/
|
|
27
|
+
var STEPS = [
|
|
28
|
+
{ id: "kind", label: "Kind" },
|
|
29
|
+
{ id: "details", label: "Details" },
|
|
30
|
+
{ id: "sign-in", label: "Sign in" },
|
|
31
|
+
{ id: "done", label: "Done" }
|
|
32
|
+
];
|
|
33
|
+
var EMPTY_DRAFT = {
|
|
34
|
+
kind: "anthropic",
|
|
35
|
+
name: "",
|
|
36
|
+
configDir: "",
|
|
37
|
+
baseUrl: "",
|
|
38
|
+
apiKeyEnv: "",
|
|
39
|
+
models: { opus: "", sonnet: "", haiku: "" }
|
|
40
|
+
};
|
|
41
|
+
var IDLE = { state: "idle", log: [] };
|
|
42
|
+
function configDirFor(draft) {
|
|
43
|
+
return draft.configDir || (draft.name ? `~/.claude-${draft.name}` : "");
|
|
44
|
+
}
|
|
45
|
+
function ready(draft) {
|
|
46
|
+
if (!draft.name)
|
|
47
|
+
return false;
|
|
48
|
+
if (draft.kind === "anthropic")
|
|
49
|
+
return true;
|
|
50
|
+
return Boolean(draft.baseUrl && draft.apiKeyEnv);
|
|
51
|
+
}
|
|
52
|
+
function toProfile(draft, signIn) {
|
|
53
|
+
const compatible = draft.kind === "compatible";
|
|
54
|
+
return {
|
|
55
|
+
id: draft.name,
|
|
56
|
+
name: draft.name,
|
|
57
|
+
configDir: configDirFor(draft),
|
|
58
|
+
provider: draft.kind,
|
|
59
|
+
baseUrl: compatible ? draft.baseUrl : undefined,
|
|
60
|
+
plan: signIn.plan ?? (compatible ? "API key" : ""),
|
|
61
|
+
account: signIn.account ?? (compatible ? draft.baseUrl : ""),
|
|
62
|
+
defaultModel: compatible ? draft.models.sonnet || draft.models.opus : signIn.plan ?? "",
|
|
63
|
+
limits: [],
|
|
64
|
+
running: 0
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function Stepper({ step }) {
|
|
68
|
+
const Check = useIcon2("check");
|
|
69
|
+
const at = STEPS.findIndex((s) => s.id === step);
|
|
70
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
71
|
+
"aria-label": "Steps",
|
|
72
|
+
className: "m-0 flex list-none items-center gap-[var(--space-2)] p-0",
|
|
73
|
+
children: STEPS.map((s, i) => /* @__PURE__ */ jsxs("li", {
|
|
74
|
+
"aria-current": i === at ? "step" : undefined,
|
|
75
|
+
className: cn("flex items-center gap-[var(--space-1)] text-caption transition-[color] duration-fast", i <= at ? "text-foreground" : "text-muted-foreground"),
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
className: cn("flex size-4 items-center justify-center rounded-full text-micro tabular-nums transition-[background-color,color] duration-fast", i < at && "bg-foreground text-background", i === at && "bg-brand text-background", i > at && "border border-border"),
|
|
79
|
+
children: i < at ? /* @__PURE__ */ jsx(Check, {
|
|
80
|
+
size: 10,
|
|
81
|
+
strokeWidth: 2.5
|
|
82
|
+
}) : i + 1
|
|
83
|
+
}),
|
|
84
|
+
s.label,
|
|
85
|
+
i < STEPS.length - 1 && /* @__PURE__ */ jsx("span", {
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: "ml-[var(--space-1)] h-px w-4 bg-border"
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}, s.id))
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function KindOption({ icon, title, note }) {
|
|
94
|
+
const Icon = useIcon2(icon);
|
|
95
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
96
|
+
className: "flex min-w-0 flex-1 items-start gap-[var(--space-3)]",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
99
|
+
size: 16,
|
|
100
|
+
strokeWidth: 1.5,
|
|
101
|
+
className: "mt-0.5 shrink-0 text-muted-foreground"
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ jsxs("span", {
|
|
104
|
+
className: "flex min-w-0 flex-col",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx("span", {
|
|
107
|
+
className: "text-body text-foreground",
|
|
108
|
+
children: title
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx("span", {
|
|
111
|
+
className: "text-caption text-muted-foreground",
|
|
112
|
+
children: note
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function Field({
|
|
120
|
+
label,
|
|
121
|
+
hint,
|
|
122
|
+
value,
|
|
123
|
+
placeholder,
|
|
124
|
+
invalid,
|
|
125
|
+
onChange
|
|
126
|
+
}) {
|
|
127
|
+
const id = useId();
|
|
128
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
129
|
+
className: "flex flex-col gap-[var(--space-1)]",
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ jsx(Label, {
|
|
132
|
+
htmlFor: id,
|
|
133
|
+
invalid,
|
|
134
|
+
children: label
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsx(Input, {
|
|
137
|
+
id,
|
|
138
|
+
variant: "bordered",
|
|
139
|
+
value,
|
|
140
|
+
placeholder,
|
|
141
|
+
invalid,
|
|
142
|
+
onValueChange: onChange
|
|
143
|
+
}),
|
|
144
|
+
hint && /* @__PURE__ */ jsx("span", {
|
|
145
|
+
className: "text-caption text-muted-foreground",
|
|
146
|
+
children: hint
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function Details({
|
|
152
|
+
draft,
|
|
153
|
+
taken,
|
|
154
|
+
onChange
|
|
155
|
+
}) {
|
|
156
|
+
const set = (patch) => onChange({ ...draft, ...patch });
|
|
157
|
+
const clash = taken.includes(draft.name);
|
|
158
|
+
const name = /* @__PURE__ */ jsx(Field, {
|
|
159
|
+
label: "Name",
|
|
160
|
+
value: draft.name,
|
|
161
|
+
placeholder: draft.kind === "anthropic" ? "work" : "zcode",
|
|
162
|
+
invalid: clash,
|
|
163
|
+
hint: clash ? "A profile with this name exists." : "Shown in the sidebar and the profile switcher.",
|
|
164
|
+
onChange: (value) => set({ name: value.trim() })
|
|
165
|
+
});
|
|
166
|
+
if (draft.kind === "anthropic")
|
|
167
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
168
|
+
className: "flex flex-col gap-[var(--space-4)]",
|
|
169
|
+
children: [
|
|
170
|
+
name,
|
|
171
|
+
/* @__PURE__ */ jsx(Field, {
|
|
172
|
+
label: "Config dir",
|
|
173
|
+
value: draft.configDir,
|
|
174
|
+
placeholder: configDirFor(draft) || "~/.claude-work",
|
|
175
|
+
hint: /* @__PURE__ */ jsxs(Fragment, {
|
|
176
|
+
children: [
|
|
177
|
+
"Its own sign-in, settings, memory and limits. The app runs",
|
|
178
|
+
" ",
|
|
179
|
+
/* @__PURE__ */ jsxs("code", {
|
|
180
|
+
className: "font-mono",
|
|
181
|
+
children: [
|
|
182
|
+
"CLAUDE_CONFIG_DIR=",
|
|
183
|
+
configDirFor(draft) || "…",
|
|
184
|
+
" claude"
|
|
185
|
+
]
|
|
186
|
+
}),
|
|
187
|
+
"."
|
|
188
|
+
]
|
|
189
|
+
}),
|
|
190
|
+
onChange: (value) => set({ configDir: value })
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
const tier = (key, label, placeholder) => /* @__PURE__ */ jsx(List.Row, {
|
|
195
|
+
label,
|
|
196
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
197
|
+
"aria-label": `${label} model`,
|
|
198
|
+
variant: "bordered",
|
|
199
|
+
size: "compact",
|
|
200
|
+
className: "w-48",
|
|
201
|
+
value: draft.models[key],
|
|
202
|
+
placeholder,
|
|
203
|
+
onValueChange: (value) => set({ models: { ...draft.models, [key]: value } })
|
|
204
|
+
})
|
|
205
|
+
}, key);
|
|
206
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
207
|
+
className: "flex flex-col gap-[var(--space-4)]",
|
|
208
|
+
children: [
|
|
209
|
+
name,
|
|
210
|
+
/* @__PURE__ */ jsx(Field, {
|
|
211
|
+
label: "Base URL",
|
|
212
|
+
value: draft.baseUrl,
|
|
213
|
+
placeholder: "https://api.z.ai/api/anthropic",
|
|
214
|
+
hint: "Set as ANTHROPIC_BASE_URL for this profile's sessions.",
|
|
215
|
+
onChange: (value) => set({ baseUrl: value.trim() })
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ jsx(Field, {
|
|
218
|
+
label: "API key env var",
|
|
219
|
+
value: draft.apiKeyEnv,
|
|
220
|
+
placeholder: "ZAI_API_KEY",
|
|
221
|
+
hint: "Read from your shell and passed as ANTHROPIC_AUTH_TOKEN; the key never enters the app.",
|
|
222
|
+
onChange: (value) => set({ apiKeyEnv: value.trim() })
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsxs(List.Section, {
|
|
225
|
+
title: "Model mapping",
|
|
226
|
+
aside: "What each Claude tier asks for",
|
|
227
|
+
children: [
|
|
228
|
+
tier("opus", "Opus", "GLM-4.6"),
|
|
229
|
+
tier("sonnet", "Sonnet", "GLM-4.6"),
|
|
230
|
+
tier("haiku", "Haiku", "GLM-4.5-Air")
|
|
231
|
+
]
|
|
232
|
+
})
|
|
233
|
+
]
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function SignIn({ draft, status, onRetry }) {
|
|
237
|
+
const CircleCheck = useIcon2("circle-check");
|
|
238
|
+
const CircleX = useIcon2("circle-x");
|
|
239
|
+
const External = useIcon2("external-link");
|
|
240
|
+
const Retry = useIcon2("rotate-ccw");
|
|
241
|
+
const compatible = draft.kind === "compatible";
|
|
242
|
+
const head = {
|
|
243
|
+
idle: {
|
|
244
|
+
icon: /* @__PURE__ */ jsx(Spinner, {
|
|
245
|
+
className: "size-4"
|
|
246
|
+
}),
|
|
247
|
+
title: compatible ? "Starting the test request…" : "Starting claude login…",
|
|
248
|
+
detail: compatible ? draft.baseUrl : configDirFor(draft)
|
|
249
|
+
},
|
|
250
|
+
waiting: {
|
|
251
|
+
icon: /* @__PURE__ */ jsx(Spinner, {
|
|
252
|
+
className: "size-4"
|
|
253
|
+
}),
|
|
254
|
+
title: compatible ? `Testing ${draft.baseUrl}…` : "Waiting for the browser…",
|
|
255
|
+
detail: compatible ? `One short request with the key from $${draft.apiKeyEnv}.` : "Finish signing in on the page that opened; this step moves on by itself."
|
|
256
|
+
},
|
|
257
|
+
success: {
|
|
258
|
+
icon: /* @__PURE__ */ jsx(CircleCheck, {
|
|
259
|
+
size: 16,
|
|
260
|
+
strokeWidth: 1.5,
|
|
261
|
+
className: "text-status-success"
|
|
262
|
+
}),
|
|
263
|
+
title: compatible ? "The provider answered" : `Signed in as ${status.account ?? "your account"}`,
|
|
264
|
+
detail: status.plan ?? (compatible ? draft.models.sonnet : undefined)
|
|
265
|
+
},
|
|
266
|
+
failed: {
|
|
267
|
+
icon: /* @__PURE__ */ jsx(CircleX, {
|
|
268
|
+
size: 16,
|
|
269
|
+
strokeWidth: 1.5,
|
|
270
|
+
className: "text-status-error"
|
|
271
|
+
}),
|
|
272
|
+
title: compatible ? "The provider refused the request" : "Sign-in did not finish",
|
|
273
|
+
detail: status.error
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
const { icon, title, detail } = head[status.state];
|
|
277
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
278
|
+
className: "flex flex-col gap-[var(--space-3)]",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsxs("div", {
|
|
281
|
+
className: "flex items-start gap-[var(--space-3)]",
|
|
282
|
+
children: [
|
|
283
|
+
/* @__PURE__ */ jsx("span", {
|
|
284
|
+
className: "mt-0.5 flex shrink-0",
|
|
285
|
+
children: icon
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ jsxs("div", {
|
|
288
|
+
"aria-live": "polite",
|
|
289
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ jsx("span", {
|
|
292
|
+
className: "text-body weight-medium text-foreground",
|
|
293
|
+
children: title
|
|
294
|
+
}),
|
|
295
|
+
detail && /* @__PURE__ */ jsx("span", {
|
|
296
|
+
className: "text-caption text-muted-foreground",
|
|
297
|
+
children: detail
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
}),
|
|
301
|
+
status.state === "failed" && onRetry && /* @__PURE__ */ jsx(Button, {
|
|
302
|
+
variant: "secondary",
|
|
303
|
+
size: "compact",
|
|
304
|
+
leadingIcon: Retry,
|
|
305
|
+
onClick: onRetry,
|
|
306
|
+
children: "Try again"
|
|
307
|
+
}),
|
|
308
|
+
status.state === "waiting" && status.url && /* @__PURE__ */ jsx(Button, {
|
|
309
|
+
variant: "ghost",
|
|
310
|
+
size: "compact",
|
|
311
|
+
leadingIcon: External,
|
|
312
|
+
asChild: true,
|
|
313
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
314
|
+
href: status.url,
|
|
315
|
+
target: "_blank",
|
|
316
|
+
rel: "noreferrer",
|
|
317
|
+
children: "Open again"
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
}),
|
|
322
|
+
status.state === "waiting" && status.url && /* @__PURE__ */ jsx(Copy, {
|
|
323
|
+
value: status.url,
|
|
324
|
+
label: "Sign-in link",
|
|
325
|
+
size: "compact"
|
|
326
|
+
}),
|
|
327
|
+
/* @__PURE__ */ jsx(LogView, {
|
|
328
|
+
label: compatible ? "Test request" : "claude login",
|
|
329
|
+
lines: status.log,
|
|
330
|
+
maxHeight: 180,
|
|
331
|
+
wrap: true
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function Summary({ draft, status }) {
|
|
337
|
+
const compatible = draft.kind === "compatible";
|
|
338
|
+
return /* @__PURE__ */ jsx(List, {
|
|
339
|
+
children: /* @__PURE__ */ jsxs(List.Section, {
|
|
340
|
+
title: draft.name,
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ jsx(List.Row, {
|
|
343
|
+
label: "Kind",
|
|
344
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
345
|
+
className: "pr-[var(--space-3)] text-muted-foreground",
|
|
346
|
+
children: compatible ? "Compatible provider" : "Claude account"
|
|
347
|
+
})
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ jsx(List.Row, {
|
|
350
|
+
label: compatible ? "Base URL" : "Config dir",
|
|
351
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
352
|
+
className: "min-w-0 truncate pr-[var(--space-3)] font-mono text-muted-foreground",
|
|
353
|
+
children: compatible ? draft.baseUrl : configDirFor(draft)
|
|
354
|
+
})
|
|
355
|
+
}),
|
|
356
|
+
compatible ? /* @__PURE__ */ jsx(List.Row, {
|
|
357
|
+
label: "Models",
|
|
358
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
359
|
+
className: "min-w-0 truncate pr-[var(--space-3)] text-muted-foreground",
|
|
360
|
+
children: [draft.models.opus, draft.models.sonnet, draft.models.haiku].filter(Boolean).join(" · ") || "Provider default"
|
|
361
|
+
})
|
|
362
|
+
}) : /* @__PURE__ */ jsx(List.Row, {
|
|
363
|
+
label: "Account",
|
|
364
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
365
|
+
className: "min-w-0 truncate pr-[var(--space-3)] text-muted-foreground",
|
|
366
|
+
children: [status.account, status.plan].filter(Boolean).join(" · ")
|
|
367
|
+
})
|
|
368
|
+
})
|
|
369
|
+
]
|
|
370
|
+
})
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
function ProfileOnboardingPanel2({
|
|
374
|
+
step,
|
|
375
|
+
defaultStep = "kind",
|
|
376
|
+
onStepChange,
|
|
377
|
+
defaultDraft,
|
|
378
|
+
taken = [],
|
|
379
|
+
signIn = IDLE,
|
|
380
|
+
onSignIn,
|
|
381
|
+
onComplete,
|
|
382
|
+
onCancel,
|
|
383
|
+
className
|
|
384
|
+
}) {
|
|
385
|
+
const [current, setCurrent] = useControllableState(step, defaultStep, onStepChange);
|
|
386
|
+
const [draft, setDraft] = useState({
|
|
387
|
+
...EMPTY_DRAFT,
|
|
388
|
+
...defaultDraft,
|
|
389
|
+
models: { ...EMPTY_DRAFT.models, ...defaultDraft?.models }
|
|
390
|
+
});
|
|
391
|
+
const at = STEPS.findIndex((s) => s.id === current);
|
|
392
|
+
const compatible = draft.kind === "compatible";
|
|
393
|
+
const go = (next) => {
|
|
394
|
+
if (next === "sign-in")
|
|
395
|
+
onSignIn?.(draft);
|
|
396
|
+
setCurrent(next);
|
|
397
|
+
};
|
|
398
|
+
const back = STEPS[at - 1]?.id;
|
|
399
|
+
const canContinue = current === "kind" || current === "details" && ready(draft) && !taken.includes(draft.name) || current === "sign-in" && signIn.state === "success";
|
|
400
|
+
const titles = {
|
|
401
|
+
kind: {
|
|
402
|
+
title: "Add a profile",
|
|
403
|
+
description: "Each profile is its own claude process, with its own sign-in and limits."
|
|
404
|
+
},
|
|
405
|
+
details: compatible ? {
|
|
406
|
+
title: "Point it at the provider",
|
|
407
|
+
description: "Sessions under this profile talk to the base URL instead of Anthropic."
|
|
408
|
+
} : {
|
|
409
|
+
title: "Name it and give it a home",
|
|
410
|
+
description: "A new config dir keeps this account apart from your others."
|
|
411
|
+
},
|
|
412
|
+
"sign-in": compatible ? { title: "Test the connection", description: "One request checks the URL, the key and the model mapping." } : { title: "Sign in", description: "claude login opens your browser for the account this profile uses." },
|
|
413
|
+
done: { title: "Ready", description: "New sessions can run under it from the profile switcher." }
|
|
414
|
+
};
|
|
415
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
416
|
+
className: cn("flex flex-col gap-[var(--space-5)]", className),
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ jsx(Stepper, {
|
|
419
|
+
step: current
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ jsxs("div", {
|
|
422
|
+
className: "flex flex-col gap-[var(--space-1)]",
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ jsx("h2", {
|
|
425
|
+
className: "m-0 text-title text-foreground",
|
|
426
|
+
children: titles[current].title
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ jsx("p", {
|
|
429
|
+
className: "m-0 text-body text-muted-foreground",
|
|
430
|
+
children: titles[current].description
|
|
431
|
+
})
|
|
432
|
+
]
|
|
433
|
+
}),
|
|
434
|
+
current === "kind" && /* @__PURE__ */ jsx(ChoiceList, {
|
|
435
|
+
label: "Kind",
|
|
436
|
+
value: draft.kind,
|
|
437
|
+
onValueChange: (kind) => setDraft({ ...draft, kind: kind === "compatible" ? "compatible" : "anthropic" }),
|
|
438
|
+
options: [
|
|
439
|
+
{
|
|
440
|
+
value: "anthropic",
|
|
441
|
+
label: "Claude account",
|
|
442
|
+
content: /* @__PURE__ */ jsx(KindOption, {
|
|
443
|
+
icon: "user",
|
|
444
|
+
title: "Claude account",
|
|
445
|
+
note: "Sign in to claude.ai in a new config dir: another plan, another org."
|
|
446
|
+
})
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
value: "compatible",
|
|
450
|
+
label: "Anthropic-compatible provider",
|
|
451
|
+
content: /* @__PURE__ */ jsx(KindOption, {
|
|
452
|
+
icon: "server",
|
|
453
|
+
title: "Anthropic-compatible provider",
|
|
454
|
+
note: "A base URL and an API key, such as Z.ai's GLM coding plan."
|
|
455
|
+
})
|
|
456
|
+
}
|
|
457
|
+
]
|
|
458
|
+
}),
|
|
459
|
+
current === "details" && /* @__PURE__ */ jsx(Details, {
|
|
460
|
+
draft,
|
|
461
|
+
taken,
|
|
462
|
+
onChange: setDraft
|
|
463
|
+
}),
|
|
464
|
+
current === "sign-in" && /* @__PURE__ */ jsx(SignIn, {
|
|
465
|
+
draft,
|
|
466
|
+
status: signIn,
|
|
467
|
+
onRetry: () => onSignIn?.(draft)
|
|
468
|
+
}),
|
|
469
|
+
current === "done" && /* @__PURE__ */ jsx(Summary, {
|
|
470
|
+
draft,
|
|
471
|
+
status: signIn
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ jsxs("div", {
|
|
474
|
+
className: "flex items-center justify-end gap-[var(--space-2)]",
|
|
475
|
+
children: [
|
|
476
|
+
back ? /* @__PURE__ */ jsx(Button, {
|
|
477
|
+
variant: "ghost",
|
|
478
|
+
onClick: () => setCurrent(back),
|
|
479
|
+
children: "Back"
|
|
480
|
+
}) : onCancel && /* @__PURE__ */ jsx(Button, {
|
|
481
|
+
variant: "ghost",
|
|
482
|
+
onClick: onCancel,
|
|
483
|
+
children: "Cancel"
|
|
484
|
+
}),
|
|
485
|
+
current === "done" ? /* @__PURE__ */ jsx(Button, {
|
|
486
|
+
onClick: () => onComplete?.(toProfile(draft, signIn)),
|
|
487
|
+
children: "Add profile"
|
|
488
|
+
}) : /* @__PURE__ */ jsx(Button, {
|
|
489
|
+
disabled: !canContinue,
|
|
490
|
+
onClick: () => go(STEPS[at + 1]?.id ?? "done"),
|
|
491
|
+
children: current === "details" ? compatible ? "Test connection" : "Sign in" : "Continue"
|
|
492
|
+
})
|
|
493
|
+
]
|
|
494
|
+
})
|
|
495
|
+
]
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
var ProfileOnboarding2 = Object.assign(function ProfileOnboarding({
|
|
499
|
+
trigger,
|
|
500
|
+
open,
|
|
501
|
+
defaultOpen = false,
|
|
502
|
+
onOpenChange,
|
|
503
|
+
onComplete,
|
|
504
|
+
...panel
|
|
505
|
+
}) {
|
|
506
|
+
const [isOpen, setOpen] = useControllableState(open, defaultOpen, onOpenChange);
|
|
507
|
+
return /* @__PURE__ */ jsxs(Dialog, {
|
|
508
|
+
open: isOpen,
|
|
509
|
+
onOpenChange: setOpen,
|
|
510
|
+
children: [
|
|
511
|
+
trigger && /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
512
|
+
render: trigger
|
|
513
|
+
}),
|
|
514
|
+
/* @__PURE__ */ jsx(Dialog.Content, {
|
|
515
|
+
width: "lg",
|
|
516
|
+
"aria-label": "Add a profile",
|
|
517
|
+
children: /* @__PURE__ */ jsx(ProfileOnboardingPanel2, {
|
|
518
|
+
...panel,
|
|
519
|
+
onCancel: () => setOpen(false),
|
|
520
|
+
onComplete: (profile) => {
|
|
521
|
+
onComplete?.(profile);
|
|
522
|
+
setOpen(false);
|
|
523
|
+
}
|
|
524
|
+
})
|
|
525
|
+
})
|
|
526
|
+
]
|
|
527
|
+
});
|
|
528
|
+
}, { Panel: ProfileOnboardingPanel2 });
|
|
529
|
+
var profile_onboarding_default = ProfileOnboarding2;
|
|
530
|
+
|
|
531
|
+
export { ProfileOnboardingPanel2, ProfileOnboarding2, profile_onboarding_default };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useIcon2
|
|
5
|
+
} from "./chunk-xkchhs2z.js";
|
|
6
|
+
import {
|
|
7
|
+
Section2,
|
|
8
|
+
Group2,
|
|
9
|
+
Details2,
|
|
10
|
+
ON_HOVER2,
|
|
11
|
+
Row2,
|
|
12
|
+
Facts2,
|
|
13
|
+
Mono2
|
|
14
|
+
} from "./chunk-5meda998.js";
|
|
15
|
+
|
|
16
|
+
// blocks/settings/worktrees/index.tsx
|
|
17
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
18
|
+
import Badge from "@justanarthur/modo-ui/components/data-display/badge";
|
|
19
|
+
import Tooltip from "@justanarthur/modo-ui/components/overlays/tooltip";
|
|
20
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
21
|
+
/*!
|
|
22
|
+
* Local addition: the settings screen's worktrees section — each session's
|
|
23
|
+
* checkout with its state and size, removable on hover once merged or stale.
|
|
24
|
+
*/
|
|
25
|
+
var BADGE = {
|
|
26
|
+
active: { color: "green", label: "Active" },
|
|
27
|
+
merged: { color: "gray", label: "Merged" },
|
|
28
|
+
stale: { color: "amber", label: "Stale" }
|
|
29
|
+
};
|
|
30
|
+
var NOTE = {
|
|
31
|
+
active: "Its session is still running in it.",
|
|
32
|
+
merged: "Its branch is merged into main; nothing here is lost when it goes.",
|
|
33
|
+
stale: "No commits for 3 weeks and its session is archived. Uncommitted changes go with it."
|
|
34
|
+
};
|
|
35
|
+
function Worktrees2({
|
|
36
|
+
worktrees,
|
|
37
|
+
onDisk,
|
|
38
|
+
defaultOpen,
|
|
39
|
+
onCleanUp,
|
|
40
|
+
onOpenTerminal,
|
|
41
|
+
onRemove
|
|
42
|
+
}) {
|
|
43
|
+
const Trash = useIcon2("trash");
|
|
44
|
+
const Terminal = useIcon2("terminal");
|
|
45
|
+
const removable = worktrees.filter((w) => w.state !== "active");
|
|
46
|
+
return /* @__PURE__ */ jsx(Section2, {
|
|
47
|
+
title: "Worktrees",
|
|
48
|
+
lead: `Sessions that work in their own checkout. ${onDisk} on disk; merged and stale ones can go.`,
|
|
49
|
+
actions: /* @__PURE__ */ jsxs(Button, {
|
|
50
|
+
size: "compact",
|
|
51
|
+
variant: "tertiary",
|
|
52
|
+
leadingIcon: Trash,
|
|
53
|
+
onClick: onCleanUp,
|
|
54
|
+
children: [
|
|
55
|
+
"Clean up ",
|
|
56
|
+
removable.length
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
children: /* @__PURE__ */ jsx(Group2, {
|
|
60
|
+
title: "Checkouts",
|
|
61
|
+
aside: /* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: "tabular-nums",
|
|
63
|
+
children: worktrees.length
|
|
64
|
+
}),
|
|
65
|
+
children: /* @__PURE__ */ jsx(Details2, {
|
|
66
|
+
label: "Worktrees",
|
|
67
|
+
actions: "icon",
|
|
68
|
+
defaultOpen,
|
|
69
|
+
children: worktrees.map((worktree, i) => /* @__PURE__ */ jsxs(Row2, {
|
|
70
|
+
value: worktree.path,
|
|
71
|
+
index: i,
|
|
72
|
+
label: worktree.session,
|
|
73
|
+
caption: /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: "font-mono",
|
|
75
|
+
children: worktree.branch
|
|
76
|
+
}),
|
|
77
|
+
meta: /* @__PURE__ */ jsxs(Fragment, {
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
80
|
+
size: "compact",
|
|
81
|
+
variant: "dot",
|
|
82
|
+
color: BADGE[worktree.state].color,
|
|
83
|
+
children: BADGE[worktree.state].label
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: "hidden w-14 text-right text-caption tabular-nums @md:inline",
|
|
87
|
+
children: worktree.size
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
action: worktree.state !== "active" && /* @__PURE__ */ jsx(Tooltip, {
|
|
92
|
+
content: "Remove worktree",
|
|
93
|
+
side: "top",
|
|
94
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
95
|
+
size: "icon-compact",
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
"aria-label": `Remove ${worktree.path}`,
|
|
98
|
+
className: ON_HOVER2,
|
|
99
|
+
onClick: () => onRemove?.(worktree),
|
|
100
|
+
children: /* @__PURE__ */ jsx(Trash, {})
|
|
101
|
+
})
|
|
102
|
+
}),
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx("p", {
|
|
105
|
+
className: "m-0 text-body text-foreground",
|
|
106
|
+
children: NOTE[worktree.state]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ jsx(Facts2, {
|
|
109
|
+
items: [
|
|
110
|
+
["Path", /* @__PURE__ */ jsx(Mono2, {
|
|
111
|
+
children: worktree.path
|
|
112
|
+
}, "p")],
|
|
113
|
+
["Branch", /* @__PURE__ */ jsx(Mono2, {
|
|
114
|
+
children: worktree.branch
|
|
115
|
+
}, "b")],
|
|
116
|
+
[
|
|
117
|
+
"On disk",
|
|
118
|
+
/* @__PURE__ */ jsx("span", {
|
|
119
|
+
className: "tabular-nums",
|
|
120
|
+
children: worktree.size
|
|
121
|
+
}, "s")
|
|
122
|
+
]
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsxs("div", {
|
|
126
|
+
className: "flex justify-end gap-[var(--space-1)]",
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsx(Button, {
|
|
129
|
+
size: "compact",
|
|
130
|
+
variant: "ghost",
|
|
131
|
+
leadingIcon: Terminal,
|
|
132
|
+
onClick: () => onOpenTerminal?.(worktree),
|
|
133
|
+
children: "Open in terminal"
|
|
134
|
+
}),
|
|
135
|
+
worktree.state !== "active" && /* @__PURE__ */ jsx(Button, {
|
|
136
|
+
size: "compact",
|
|
137
|
+
variant: "ghost",
|
|
138
|
+
leadingIcon: Trash,
|
|
139
|
+
onClick: () => onRemove?.(worktree),
|
|
140
|
+
children: "Remove"
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
}, worktree.path))
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
export { Worktrees2 };
|