@justanarthur/modo-ui-ai 0.2.0 → 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/blocks/conversation/agent-prompt/index.tsx +3 -3
- package/blocks/conversation/composer/examples.mdx +50 -0
- package/blocks/conversation/composer/index.tsx +182 -48
- package/blocks/conversation/transcript/index.tsx +8 -6
- package/blocks/dialogs/command-palette/examples.mdx +17 -0
- package/blocks/dialogs/command-palette/index.tsx +12 -5
- package/blocks/panes/usage-pane/examples.mdx +10 -0
- package/blocks/panes/usage-pane/index.tsx +8 -5
- package/blocks/profiles/profile-switcher/examples.mdx +11 -0
- package/blocks/profiles/profile-switcher/index.tsx +18 -3
- package/blocks/profiles/profile-usage/examples.mdx +20 -0
- package/blocks/profiles/profile-usage/index.tsx +22 -8
- package/blocks/sessions/session-sidebar/examples.mdx +53 -3
- package/blocks/sessions/session-sidebar/index.tsx +133 -78
- package/components/conversation/agent-run/examples.mdx +8 -0
- package/components/conversation/agent-run/index.tsx +4 -3
- package/components/conversation/message/index.tsx +8 -6
- package/components/conversation/reasoning/examples.mdx +10 -0
- package/components/conversation/reasoning/index.tsx +5 -4
- package/dist/blocks/conversation/agent-prompt/index.d.ts +1 -1
- package/dist/blocks/conversation/agent-prompt/index.js +1 -1
- package/dist/blocks/conversation/composer/index.d.ts +1 -1
- package/dist/blocks/conversation/composer/index.js +3 -2
- package/dist/blocks/conversation/transcript/index.d.ts +11 -11
- package/dist/blocks/conversation/transcript/index.js +3 -3
- package/dist/blocks/dialogs/command-palette/index.d.ts +1 -1
- package/dist/blocks/dialogs/command-palette/index.js +4 -4
- package/dist/blocks/panes/side-pane/index.js +3 -3
- package/dist/blocks/panes/usage-pane/index.d.ts +1 -1
- package/dist/blocks/panes/usage-pane/index.js +2 -2
- package/dist/blocks/profiles/profile-switcher/index.d.ts +1 -1
- package/dist/blocks/profiles/profile-switcher/index.js +2 -1
- package/dist/blocks/profiles/profile-usage/index.d.ts +1 -1
- package/dist/blocks/profiles/profile-usage/index.js +2 -2
- package/dist/blocks/sessions/session-board/index.js +8 -7
- package/dist/blocks/sessions/session-sidebar/index.d.ts +1 -1
- package/dist/blocks/sessions/session-sidebar/index.js +4 -4
- package/dist/components/conversation/agent-run/index.d.ts +1 -1
- package/dist/components/conversation/message/index.d.ts +2 -2
- package/dist/components/conversation/message/index.js +5 -5
- package/dist/components/conversation/reasoning/index.d.ts +1 -1
- package/dist/components/conversation/reasoning/index.js +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +17 -17
- package/dist/lib/pace-bar.d.ts +1 -1
- package/dist/lib/pace.d.ts +2 -2
- package/dist/lib/pace.js +3 -1
- package/dist/shared/{chunk-rzajcn44.d.ts → chunk-1hzrm8r5.d.ts} +3 -1
- package/dist/shared/{chunk-k5zegxje.d.ts → chunk-1qdwg7w5.d.ts} +10 -10
- package/dist/shared/{chunk-cd4f87as.d.ts → chunk-3ps5h55t.d.ts} +2 -0
- package/dist/shared/{chunk-45rqgey6.d.ts → chunk-3yaftgh0.d.ts} +6 -3
- package/dist/shared/{chunk-1f96cz69.js → chunk-58jh3mje.js} +3 -2
- package/dist/shared/{chunk-1aq2xzv5.js → chunk-6kwk9vag.js} +4 -4
- package/dist/shared/{chunk-4248zvmh.js → chunk-6rdwkymk.js} +1 -1
- package/dist/shared/{chunk-gkyk663q.d.ts → chunk-71j8qzvb.d.ts} +8 -4
- package/dist/shared/{chunk-6g4970a6.d.ts → chunk-74bvf3tw.d.ts} +3 -2
- package/dist/shared/{chunk-w5z8qnf8.js → chunk-7mfer3tp.js} +4 -3
- package/dist/shared/{chunk-bzs6amnv.js → chunk-94grzz9f.js} +4 -4
- package/dist/shared/{chunk-g28hweee.d.ts → chunk-b4dz15em.d.ts} +4 -3
- package/dist/shared/{chunk-8xg5gwwy.js → chunk-b5ccp5de.js} +2 -5
- package/dist/shared/{chunk-rjfwje37.d.ts → chunk-dxzrtvt9.d.ts} +58 -9
- package/dist/shared/{chunk-fbn0h7cr.js → chunk-fapc805j.js} +11 -4
- package/dist/shared/{chunk-sfqvyzcs.d.ts → chunk-fm1qyrae.d.ts} +6 -6
- package/dist/shared/{chunk-5k6xwqfj.d.ts → chunk-gb5ee5dw.d.ts} +27 -7
- package/dist/shared/{chunk-a4s440b6.js → chunk-mnzw0bav.js} +4 -3
- package/dist/shared/{chunk-wgvzavx1.js → chunk-n31qwnj2.js} +88 -32
- package/dist/shared/{chunk-kw9npka5.js → chunk-njf851p1.js} +44 -23
- package/dist/shared/{chunk-hd4gtj5z.d.ts → chunk-nkbgg7bw.d.ts} +4 -3
- package/dist/shared/{chunk-cmwby8f9.js → chunk-nvh33x9x.js} +112 -91
- package/dist/shared/{chunk-4n0v64qx.js → chunk-qt31n444.js} +7 -8
- package/dist/shared/{chunk-szkvrqg1.d.ts → chunk-ty2ccknv.d.ts} +4 -4
- package/dist/shared/{chunk-vd59gzzd.js → chunk-wq9h37gy.js} +3 -3
- package/lib/pace.ts +7 -3
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AgentRun2 } from "./chunk-
|
|
1
|
+
import { AgentRun2 } from "./chunk-b4dz15em.js";
|
|
2
2
|
import { ChapterNavItem2, ChapterBreak2 } from "./chunk-tvbd27hg.js";
|
|
3
|
-
import { Working2,
|
|
4
|
-
import { Reasoning2 } from "./chunk-
|
|
3
|
+
import { Working2, MentionChip, AttachmentChip, MessageProps2 } from "./chunk-fm1qyrae.js";
|
|
4
|
+
import { Reasoning2 } from "./chunk-nkbgg7bw.js";
|
|
5
5
|
import { Recap2 } from "./chunk-b171wjge.js";
|
|
6
6
|
import { TodoItem2, TodoList2 } from "./chunk-tprdqtb1.js";
|
|
7
7
|
import { ToolCallGroup2, ToolCallProps2 } from "./chunk-64bnh22t.js";
|
|
@@ -10,9 +10,9 @@ import { ReactNode } from "react";
|
|
|
10
10
|
import { JSX as JSX_1kxb } from "react";
|
|
11
11
|
type TurnProps = Omit<MessageProps2, "role">;
|
|
12
12
|
type Element_12xgc = JSX_1kxb["Element"];
|
|
13
|
-
declare function
|
|
13
|
+
declare function UserTurn(props: TurnProps): Element_12xgc;
|
|
14
14
|
/** The agent's turn. A string is markdown, rendered as it streams in; JSX (work, tool runs, prose) renders as is. */
|
|
15
|
-
declare function
|
|
15
|
+
declare function AssistantTurn({ children, streaming,...props }: TurnProps): Element_12xgc;
|
|
16
16
|
interface TranscriptProps2 {
|
|
17
17
|
/** The turns: `Transcript.User`, `Transcript.Assistant` and the parts below. */
|
|
18
18
|
children: ReactNode;
|
|
@@ -56,8 +56,8 @@ interface TranscriptProps2 {
|
|
|
56
56
|
* @example {@include ./examples.mdx}
|
|
57
57
|
*/
|
|
58
58
|
declare const Transcript2: (({ children, chapters, defaultShowWork, footer, className }: TranscriptProps2) => Element_12xgc) & {
|
|
59
|
-
User: typeof
|
|
60
|
-
Assistant: typeof
|
|
59
|
+
User: typeof UserTurn;
|
|
60
|
+
Assistant: typeof AssistantTurn;
|
|
61
61
|
Work: (({ summary, detail, running, children }: WorkSummaryProps2) => Element_12xgc) & {
|
|
62
62
|
Provider: typeof WorkSummaryProvider2;
|
|
63
63
|
};
|
|
@@ -68,9 +68,9 @@ declare const Transcript2: (({ children, chapters, defaultShowWork, footer, clas
|
|
|
68
68
|
};
|
|
69
69
|
Agent: typeof AgentRun2;
|
|
70
70
|
Chapter: typeof ChapterBreak2;
|
|
71
|
-
Mention: typeof
|
|
72
|
-
Attachment: typeof
|
|
73
|
-
|
|
71
|
+
Mention: typeof MentionChip;
|
|
72
|
+
Attachment: typeof AttachmentChip;
|
|
73
|
+
Working: typeof Working2;
|
|
74
74
|
TaskList: typeof TodoList2;
|
|
75
75
|
NextStep: typeof Recap2;
|
|
76
76
|
};
|
|
@@ -19,6 +19,8 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
19
19
|
* fill past the tick is spending faster than the window refills. The row
|
|
20
20
|
* lists every profile by name with its session limit over its tightest
|
|
21
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.
|
|
22
24
|
*
|
|
23
25
|
* Put it in a Sidebar (the session sidebar puts it in its footer).
|
|
24
26
|
*
|
|
@@ -14,12 +14,15 @@ interface LimitPace2 {
|
|
|
14
14
|
interface ProfilePace2 {
|
|
15
15
|
profile: Profile2;
|
|
16
16
|
limits: LimitPace2[];
|
|
17
|
-
/** The limit that runs out first, or lands highest at its reset. */
|
|
18
|
-
binding
|
|
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
19
|
}
|
|
20
|
+
/** Each limit's pace and the binding one. A profile with no limits yet gets `limits: []` and no `binding`. */
|
|
20
21
|
declare function paceOf2(profile: Profile2): ProfilePace2;
|
|
21
22
|
/** A short duration: `17m`, `2h 20m`, `20h`, `4d`. */
|
|
22
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";
|
|
23
26
|
declare function percent2(share: number): string;
|
|
24
27
|
declare const VERDICT_TEXT2: Record<Verdict2, string>;
|
|
25
|
-
export { Verdict2, LimitPace2, ProfilePace2, paceOf2, duration2, percent2, VERDICT_TEXT2 };
|
|
28
|
+
export { Verdict2, LimitPace2, ProfilePace2, paceOf2, duration2, NO_USAGE2, percent2, VERDICT_TEXT2 };
|
|
@@ -18,7 +18,7 @@ function paceOfLimit(limit) {
|
|
|
18
18
|
}
|
|
19
19
|
function paceOf2(profile) {
|
|
20
20
|
const limits = profile.limits.map(paceOfLimit);
|
|
21
|
-
const binding = [...limits].sort((a, b) => b.projected - a.projected)[0]
|
|
21
|
+
const binding = [...limits].sort((a, b) => b.projected - a.projected)[0];
|
|
22
22
|
return { profile, limits, binding };
|
|
23
23
|
}
|
|
24
24
|
function duration2(hours) {
|
|
@@ -33,6 +33,7 @@ function duration2(hours) {
|
|
|
33
33
|
return `${Math.round(hours)}h`;
|
|
34
34
|
return `${Math.round(hours / 24)}d`;
|
|
35
35
|
}
|
|
36
|
+
var NO_USAGE2 = "No usage yet";
|
|
36
37
|
function percent2(share) {
|
|
37
38
|
return `${Math.round(share * 100)}%`;
|
|
38
39
|
}
|
|
@@ -42,4 +43,4 @@ var VERDICT_TEXT2 = {
|
|
|
42
43
|
tight: "text-status-error"
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
export { paceOf2, duration2, percent2, VERDICT_TEXT2 };
|
|
46
|
+
export { paceOf2, duration2, NO_USAGE2, percent2, VERDICT_TEXT2 };
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
} from "./chunk-ejtknc0w.js";
|
|
10
10
|
import {
|
|
11
11
|
agent_prompt_default
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-wq9h37gy.js";
|
|
13
13
|
import {
|
|
14
14
|
ProfileTile2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-njf851p1.js";
|
|
16
16
|
import {
|
|
17
17
|
composer_default
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-n31qwnj2.js";
|
|
19
19
|
import {
|
|
20
20
|
transcript_default
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-qt31n444.js";
|
|
22
22
|
|
|
23
23
|
// blocks/sessions/session-board/index.tsx
|
|
24
24
|
import { SurfaceProvider, useSurface } from "@justanarthur/modo-ui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Profile2, Session2, Project2, Command2, PaletteItem2 } from "./chunk-jkkdq1mh.js";
|
|
1
|
+
import { PaneId2, Profile2, Session2, Project2, Command2, PaletteItem2 } from "./chunk-jkkdq1mh.js";
|
|
2
2
|
import { SettingsWindowSection2 } from "./chunk-k3bv9k1v.js";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
4
|
import { JSX as JSX_1kxb } from "react";
|
|
@@ -11,8 +11,10 @@ interface CommandPaletteProps2 {
|
|
|
11
11
|
profiles: Profile2[];
|
|
12
12
|
/** Slash commands, skills and plugins. */
|
|
13
13
|
commands: Command2[];
|
|
14
|
-
/** Settings sections to open;
|
|
14
|
+
/** Settings sections to open; omitted, one row opens the settings; `[]` drops the Settings group. */
|
|
15
15
|
settings?: SettingsWindowSection2[];
|
|
16
|
+
/** The side panes to offer, in the side pane's order; `false` (or `[]`) drops the Panes group. Defaults to every pane. */
|
|
17
|
+
panes?: PaneId2[] | false;
|
|
16
18
|
/** The active profile's id: new sessions start under it. Defaults to the first profile. */
|
|
17
19
|
profile?: string;
|
|
18
20
|
/** The current project's path: "New session as …" starts there. Defaults to the first project. */
|
|
@@ -45,9 +47,11 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
45
47
|
* on you). New sessions start in each project under the active profile, or
|
|
46
48
|
* under each other profile in the current project. Picking a row hands it to
|
|
47
49
|
* `onSelect` and closes the panel. The panel is Command's: it grows out of
|
|
48
|
-
* the trigger, and ⌘K (Ctrl+K elsewhere) toggles it from anywhere.
|
|
50
|
+
* the trigger, and ⌘K (Ctrl+K elsewhere) toggles it from anywhere. A group
|
|
51
|
+
* with no rows is left out: an app without side panes passes `panes={false}`,
|
|
52
|
+
* one without a settings window `settings={[]}`.
|
|
49
53
|
*
|
|
50
54
|
* @example {@include ./examples.mdx}
|
|
51
55
|
*/
|
|
52
|
-
declare function CommandPalette2({ sessions, projects, profiles, commands, settings, profile, project, onSelect, open, defaultOpen, onOpenChange, hotkey, trigger, label, className }: CommandPaletteProps2): Element_12xgc;
|
|
56
|
+
declare function CommandPalette2({ sessions, projects, profiles, commands, settings, panes, profile, project, onSelect, open, defaultOpen, onOpenChange, hotkey, trigger, label, className }: CommandPaletteProps2): Element_12xgc;
|
|
53
57
|
export { CommandPaletteProps2, CommandPalette2 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Profile2 } from "./chunk-jkkdq1mh.js";
|
|
2
2
|
import { JSX as JSX_1kxb } from "react";
|
|
3
3
|
interface UsagePaneProps2 {
|
|
4
|
-
/** The profiles to read, each with its limits. */
|
|
4
|
+
/** The profiles to read, each with its limits (empty until the profile reports usage). */
|
|
5
5
|
profiles: Profile2[];
|
|
6
6
|
}
|
|
7
7
|
type Element_12xgc = JSX_1kxb["Element"];
|
|
@@ -12,7 +12,8 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
12
12
|
* Each profile is a section with its plan and a verdict on its tightest
|
|
13
13
|
* limit (on pace, only just, too fast); each limit is a pace bar whose tick
|
|
14
14
|
* is where an even spend would be by now, with its share and the time
|
|
15
|
-
* until it resets.
|
|
15
|
+
* until it resets. A profile with no limits yet (`limits: []`, before its
|
|
16
|
+
* first turn reports usage) reads "No usage yet".
|
|
16
17
|
*
|
|
17
18
|
* @example {@include ./examples.mdx}
|
|
18
19
|
*/
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-ejtknc0w.js";
|
|
9
9
|
import {
|
|
10
10
|
PANES2
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6rdwkymk.js";
|
|
12
12
|
|
|
13
13
|
// blocks/dialogs/command-palette/index.tsx
|
|
14
14
|
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
@@ -26,6 +26,7 @@ function CommandPalette2({
|
|
|
26
26
|
profiles,
|
|
27
27
|
commands,
|
|
28
28
|
settings,
|
|
29
|
+
panes,
|
|
29
30
|
profile,
|
|
30
31
|
project,
|
|
31
32
|
onSelect,
|
|
@@ -104,7 +105,7 @@ function CommandPalette2({
|
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
107
|
label: "Panes",
|
|
107
|
-
items: PANES2.map((p) => ({
|
|
108
|
+
items: (panes === false ? [] : panes ? PANES2.filter((p) => panes.includes(p.id)) : PANES2).map((p) => ({
|
|
108
109
|
label: `Open ${p.label.toLowerCase()}`,
|
|
109
110
|
icon: icons[p.icon],
|
|
110
111
|
keywords: ["pane", "side"],
|
|
@@ -114,7 +115,7 @@ function CommandPalette2({
|
|
|
114
115
|
{
|
|
115
116
|
label: "Settings",
|
|
116
117
|
items: [
|
|
117
|
-
{ label: "Open settings", icon: icons.settings, shortcut: "⌘,", onSelect: pick({ kind: "settings" }) },
|
|
118
|
+
...settings?.length === 0 ? [] : [{ label: "Open settings", icon: icons.settings, shortcut: "⌘,", onSelect: pick({ kind: "settings" }) }],
|
|
118
119
|
...(settings ?? []).map((s) => ({
|
|
119
120
|
label: `Settings: ${s.label}`,
|
|
120
121
|
icon: icons[s.icon],
|
|
@@ -117,7 +117,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
117
117
|
* with the working dots while it streams (Fluid Functionalism's
|
|
118
118
|
* ThinkingIndicator, in ./working.tsx). Generalised from the AI app's transcript.
|
|
119
119
|
*/
|
|
120
|
-
function
|
|
120
|
+
function MentionChip({ path }) {
|
|
121
121
|
const At = useIcon2("at-sign");
|
|
122
122
|
return /* @__PURE__ */ jsxs2("span", {
|
|
123
123
|
className: "inline-flex translate-y-px items-center gap-0.5 rounded-glyph bg-active px-1 align-baseline font-mono text-caption text-foreground",
|
|
@@ -131,7 +131,7 @@ function Mention2({ path }) {
|
|
|
131
131
|
]
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function AttachmentChip({ name, detail, kind = "file" }) {
|
|
135
135
|
const shape = useShape();
|
|
136
136
|
const Icon = useIcon2(kind === "pasted" ? "clipboard" : kind === "image" ? "image" : "file-text");
|
|
137
137
|
return /* @__PURE__ */ jsxs2("span", {
|
|
@@ -181,7 +181,7 @@ var Message2 = Object.assign(function Message({ role, children, attachments, str
|
|
|
181
181
|
})
|
|
182
182
|
]
|
|
183
183
|
});
|
|
184
|
-
}, { Mention:
|
|
184
|
+
}, { Mention: MentionChip, Attachment: AttachmentChip, Working: Working2 });
|
|
185
185
|
var message_default = Message2;
|
|
186
186
|
|
|
187
|
-
export { Working2,
|
|
187
|
+
export { Working2, MentionChip, AttachmentChip, Message2, message_default };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IconName2 } from "./chunk-13yf0mza.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { JSX as JSX_1kxb } from "react";
|
|
4
|
-
type AgentRunStatus2 = "running" | "done" | "error";
|
|
4
|
+
type AgentRunStatus2 = "running" | "waiting" | "done" | "error";
|
|
5
5
|
interface AgentRunProps2 {
|
|
6
6
|
/** The agent's name or type: `Explore`, `researcher`, a custom agent. */
|
|
7
7
|
agent: string;
|
|
8
8
|
/** What it was asked to do, in a few words. */
|
|
9
9
|
description: string;
|
|
10
|
-
/** Where it stands. Defaults to `'done'`. */
|
|
10
|
+
/** Where it stands: `'waiting'` while it is held on you (a permission, a question). Defaults to `'done'`. */
|
|
11
11
|
status?: AgentRunStatus2;
|
|
12
12
|
/** Ran detached: the conversation went on without waiting. Defaults to `false`. */
|
|
13
13
|
background?: boolean;
|
|
@@ -24,7 +24,8 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
24
24
|
* its calls and its report.
|
|
25
25
|
*
|
|
26
26
|
* The header names the agent and its task, with the tally and the run's
|
|
27
|
-
* state on the right (the Spinner while it runs, the
|
|
27
|
+
* state on the right (the Spinner while it runs, the warning dot while it
|
|
28
|
+
* waits on you, the failed mark on error).
|
|
28
29
|
* A background run carries a badge: the conversation went on without
|
|
29
30
|
* waiting for it. Inside, a `ToolCall.Group` lists its calls and a line of
|
|
30
31
|
* text its report.
|
|
@@ -17,11 +17,8 @@ function Reasoning2({ duration, children, defaultOpen = false }) {
|
|
|
17
17
|
children: /* @__PURE__ */ jsxs(Accordion.Item, {
|
|
18
18
|
value: "reasoning",
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
children:
|
|
22
|
-
"Thought for ",
|
|
23
|
-
duration
|
|
24
|
-
]
|
|
20
|
+
/* @__PURE__ */ jsx(Accordion.Trigger, {
|
|
21
|
+
children: duration ? `Thought for ${duration}` : "Thought"
|
|
25
22
|
}),
|
|
26
23
|
/* @__PURE__ */ jsx(Accordion.Content, {
|
|
27
24
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -124,16 +124,56 @@ interface ComposerProps2 {
|
|
|
124
124
|
branches: string[];
|
|
125
125
|
/** The session's own branch, shown in the project menu. Omit before the session has one. */
|
|
126
126
|
branch?: string;
|
|
127
|
+
/** The project the session runs in, by `Project.path`, controlled. Pair with `onProjectChange`. A path not in `projects` shows, and stands for, the first project. */
|
|
128
|
+
project?: string;
|
|
129
|
+
/** The initial project, by `Project.path`, when uncontrolled. Defaults to the first project. */
|
|
130
|
+
defaultProject?: string;
|
|
131
|
+
/** Called with the picked project's `path`. Only a new session (`target`) can pick one. */
|
|
132
|
+
onProjectChange?: (path: string) => void;
|
|
133
|
+
/** Whether the session gets a new git worktree, controlled. Pair with `onWorktreeChange`. */
|
|
134
|
+
worktree?: boolean;
|
|
135
|
+
/** Start with a new worktree when uncontrolled. Defaults to `true`. */
|
|
136
|
+
defaultWorktree?: boolean;
|
|
137
|
+
/** Called when the new-worktree switch flips. Only a new session (`target`) can flip it. */
|
|
138
|
+
onWorktreeChange?: (worktree: boolean) => void;
|
|
139
|
+
/** The branch a new worktree starts from, controlled. Pair with `onBaseBranchChange`. A branch not in `branches` stands for the first one. */
|
|
140
|
+
baseBranch?: string;
|
|
141
|
+
/** The initial base branch when uncontrolled. Defaults to the first branch. */
|
|
142
|
+
defaultBaseBranch?: string;
|
|
143
|
+
/** Called with the base branch picked. Only a new session (`target`) can pick one. */
|
|
144
|
+
onBaseBranchChange?: (branch: string) => void;
|
|
127
145
|
/** The profiles a session can run under. */
|
|
128
146
|
profiles: Profile2[];
|
|
129
|
-
/**
|
|
147
|
+
/** The model, by name, controlled. Pair with `onModelChange`. A name not in `models` (say, after a switch to another provider) stands for the first model. */
|
|
148
|
+
model?: string;
|
|
149
|
+
/** Initial model, by name, when uncontrolled. Defaults to the first model. */
|
|
130
150
|
defaultModel?: string;
|
|
131
|
-
/**
|
|
132
|
-
|
|
133
|
-
/**
|
|
151
|
+
/** Called with the model's name when another one is picked. */
|
|
152
|
+
onModelChange?: (model: string) => void;
|
|
153
|
+
/** The effort step, controlled. Pair with `onEffortChange`. A step not in `efforts` stands for the middle one. */
|
|
154
|
+
effort?: string;
|
|
155
|
+
/** Initial effort when uncontrolled. Defaults to the middle step. */
|
|
134
156
|
defaultEffort?: string;
|
|
135
|
-
/**
|
|
157
|
+
/** Called with the effort step the slider lands on. */
|
|
158
|
+
onEffortChange?: (effort: string) => void;
|
|
159
|
+
/** The permission mode, by label, controlled. Pair with `onPermissionModeChange`. A label not in `permissionModes` stands for the first mode. */
|
|
160
|
+
permissionMode?: string;
|
|
161
|
+
/** Initial permission mode, by label, when uncontrolled. Defaults to the first mode. */
|
|
162
|
+
defaultPermissionMode?: string;
|
|
163
|
+
/** Called with the permission mode's label when another one is picked. */
|
|
164
|
+
onPermissionModeChange?: (mode: string) => void;
|
|
165
|
+
/** Whether fast mode is on, controlled. Pair with `onFastChange`. */
|
|
166
|
+
fast?: boolean;
|
|
167
|
+
/** Start with fast mode on when uncontrolled. Defaults to `false`. */
|
|
136
168
|
defaultFast?: boolean;
|
|
169
|
+
/** Called when the fast mode switch flips. */
|
|
170
|
+
onFastChange?: (fast: boolean) => void;
|
|
171
|
+
/** The output style, controlled. Pair with `onOutputStyleChange`. A style not in `outputStyles` stands for the first one. */
|
|
172
|
+
outputStyle?: string;
|
|
173
|
+
/** Initial output style when uncontrolled. Defaults to the first style. */
|
|
174
|
+
defaultOutputStyle?: string;
|
|
175
|
+
/** Called with the output style picked. */
|
|
176
|
+
onOutputStyleChange?: (style: string) => void;
|
|
137
177
|
/** Used share of the context window, 0–1. Defaults to `0.62`. */
|
|
138
178
|
context?: number;
|
|
139
179
|
/** The conversation is being compacted: the context meter says so. Defaults to `false`. */
|
|
@@ -170,9 +210,11 @@ interface ComposerProps2 {
|
|
|
170
210
|
maxFiles?: number;
|
|
171
211
|
/** A new session: the project and profile can still be picked. Otherwise they show where this session runs. Defaults to `false`. */
|
|
172
212
|
target?: boolean;
|
|
173
|
-
/** The profile the session runs under, by id.
|
|
213
|
+
/** The profile the session runs under, by id, controlled. Pair with `onProfileChange`. An id not in `profiles` shows the first profile. */
|
|
214
|
+
profile?: string;
|
|
215
|
+
/** The profile the session runs under, by id, when uncontrolled. Defaults to the first profile. */
|
|
174
216
|
defaultProfile?: string;
|
|
175
|
-
/** Called with the profile picked. */
|
|
217
|
+
/** Called with the profile picked, by id. */
|
|
176
218
|
onProfileChange?: (profile: string) => void;
|
|
177
219
|
/** The draft's placeholder. Defaults to `'Ask, or type / for commands'`. */
|
|
178
220
|
placeholder?: string;
|
|
@@ -212,7 +254,14 @@ type Element_12xgc2 = JSX_1kxb2["Element"];
|
|
|
212
254
|
*
|
|
213
255
|
* Every draft prop has its uncontrolled twin (`defaultValue`,
|
|
214
256
|
* `defaultQueue`, `defaultStatus`), so a composer runs with no state in the
|
|
215
|
-
* caller.
|
|
257
|
+
* caller. So does every choice on the row: the project (by its `path`), the
|
|
258
|
+
* worktree switch, the base branch, the profile, the model, the effort, the
|
|
259
|
+
* permission mode, fast mode and the output style each take a controlled
|
|
260
|
+
* prop, a `default…` and an `on…Change`, so an app can pass them on to the
|
|
261
|
+
* agent (`--model`, `--effort`, `--permission-mode`). A choice its list no
|
|
262
|
+
* longer holds (a model after a switch to another provider, a project that
|
|
263
|
+
* was removed) stands for the list's first entry (the middle one for effort)
|
|
264
|
+
* instead of lingering.
|
|
216
265
|
*
|
|
217
266
|
* Statics:
|
|
218
267
|
* - `Composer.Draft` — the draft alone, without the shell and its menus:
|
|
@@ -228,7 +277,7 @@ type Element_12xgc2 = JSX_1kxb2["Element"];
|
|
|
228
277
|
* @source https://github.com/mickadesign/fluid-functionalism/blob/b3587bdbd83fc66c2a6aae3817ffb856cb09260b/registry/default/input-message.tsx Fluid Functionalism
|
|
229
278
|
* @license MIT © 2026 Micka Touillaud
|
|
230
279
|
*/
|
|
231
|
-
declare const Composer2: (({ models, efforts, permissionModes, outputStyles, commands, files, projects, branches, branch, profiles, defaultModel,
|
|
280
|
+
declare const Composer2: (({ models, efforts, permissionModes, outputStyles, commands, files, projects, branches, branch, project: projectProp, defaultProject, onProjectChange, worktree: worktreeProp, defaultWorktree, onWorktreeChange, baseBranch: baseBranchProp, defaultBaseBranch, onBaseBranchChange, profiles, model: modelProp, defaultModel, onModelChange, effort: effortProp, defaultEffort, onEffortChange, permissionMode: permissionModeProp, defaultPermissionMode, onPermissionModeChange, fast: fastProp, defaultFast, onFastChange, outputStyle: outputStyleProp, defaultOutputStyle, onOutputStyleChange, context, compacting, defaultStatus, target, profile, defaultProfile, onProfileChange, placeholder, className,...draft }: ComposerProps2) => Element_12xgc2) & {
|
|
232
281
|
Draft: ForwardRefExoticComponent_tcubfn2<ComposerDraftProps2 & RefAttributes_miuf562<HTMLDivElement>>;
|
|
233
282
|
};
|
|
234
283
|
export { DraftStatus2, DraftSlotContext2, QueuedMessage2, ComposerDraftProps2, ComposerDraft2, FileThumbnail2, ComposerProps2, Composer2 };
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
paceOf2,
|
|
8
8
|
duration2,
|
|
9
|
+
NO_USAGE2,
|
|
9
10
|
percent2,
|
|
10
11
|
VERDICT_TEXT2
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-58jh3mje.js";
|
|
12
13
|
import {
|
|
13
14
|
PaceBar2
|
|
14
15
|
} from "./chunk-04a497rr.js";
|
|
@@ -52,14 +53,17 @@ function ProfileUsage2({ profiles, onManage }) {
|
|
|
52
53
|
className: "contents",
|
|
53
54
|
children: [
|
|
54
55
|
/* @__PURE__ */ jsx("span", {
|
|
55
|
-
className: cn("truncate text-caption", binding.verdict === "free" ? "text-foreground" : VERDICT_TEXT2[binding.verdict]),
|
|
56
|
+
className: cn("truncate text-caption", binding === undefined || binding.verdict === "free" ? "text-foreground" : VERDICT_TEXT2[binding.verdict]),
|
|
56
57
|
children: profile.name
|
|
57
58
|
}),
|
|
58
|
-
/* @__PURE__ */ jsx("span", {
|
|
59
|
+
binding ? /* @__PURE__ */ jsx("span", {
|
|
59
60
|
className: "flex flex-col gap-1",
|
|
60
61
|
children: glanceLimits(limits).map((pace) => /* @__PURE__ */ jsx(PaceBar2, {
|
|
61
62
|
pace
|
|
62
63
|
}, pace.limit.label))
|
|
64
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: "truncate text-caption text-muted-foreground",
|
|
66
|
+
children: NO_USAGE2
|
|
63
67
|
})
|
|
64
68
|
]
|
|
65
69
|
}, profile.id))
|
|
@@ -80,9 +84,12 @@ function ProfileUsage2({ profiles, onManage }) {
|
|
|
80
84
|
}),
|
|
81
85
|
paces.map(({ profile, limits, binding }) => /* @__PURE__ */ jsx(List.Section, {
|
|
82
86
|
title: `${profile.name} · ${profile.plan}`,
|
|
83
|
-
aside: /* @__PURE__ */ jsx("span", {
|
|
87
|
+
aside: binding ? /* @__PURE__ */ jsx("span", {
|
|
84
88
|
className: VERDICT_TEXT2[binding.verdict],
|
|
85
89
|
children: VERDICT_WORD[binding.verdict]
|
|
90
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: "text-muted-foreground",
|
|
92
|
+
children: NO_USAGE2
|
|
86
93
|
}),
|
|
87
94
|
children: limits.map((pace) => /* @__PURE__ */ jsxs(List.Row, {
|
|
88
95
|
label: pace.limit.label,
|
|
@@ -16,7 +16,7 @@ interface MentionProps2 {
|
|
|
16
16
|
}
|
|
17
17
|
type Element_12xgc2 = JSX_1kxb2["Element"];
|
|
18
18
|
/** An @-mention of a file inside a message. */
|
|
19
|
-
declare function
|
|
19
|
+
declare function MentionChip({ path }: MentionProps2): Element_12xgc2;
|
|
20
20
|
interface AttachmentProps2 {
|
|
21
21
|
/** The file name. */
|
|
22
22
|
name: string;
|
|
@@ -26,7 +26,7 @@ interface AttachmentProps2 {
|
|
|
26
26
|
kind?: AttachmentKind2;
|
|
27
27
|
}
|
|
28
28
|
/** A file, image or pasted text that came with a message. */
|
|
29
|
-
declare function
|
|
29
|
+
declare function AttachmentChip({ name, detail, kind }: AttachmentProps2): Element_12xgc2;
|
|
30
30
|
interface MessageProps2 {
|
|
31
31
|
/** Who speaks: `user` is a bubble on the right, `assistant` is text on the page. */
|
|
32
32
|
role: MessageRole2;
|
|
@@ -61,8 +61,8 @@ interface MessageProps2 {
|
|
|
61
61
|
* @example {@include ./examples.mdx}
|
|
62
62
|
*/
|
|
63
63
|
declare const Message2: (({ role, children, attachments, streaming, className }: MessageProps2) => Element_12xgc2) & {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
Mention: typeof MentionChip;
|
|
65
|
+
Attachment: typeof AttachmentChip;
|
|
66
|
+
Working: typeof Working2;
|
|
67
67
|
};
|
|
68
|
-
export { WorkingProps2, Working2, MessageRole2, AttachmentKind2, MentionProps2,
|
|
68
|
+
export { WorkingProps2, Working2, MessageRole2, AttachmentKind2, MentionProps2, MentionChip, AttachmentProps2, AttachmentChip, MessageProps2, Message2 };
|
|
@@ -18,17 +18,31 @@ interface SessionSidebarProps2 {
|
|
|
18
18
|
value?: string;
|
|
19
19
|
/** Initial selected session id, for an uncontrolled sidebar. */
|
|
20
20
|
defaultValue?: string;
|
|
21
|
-
/** Called with the session id when a row is picked
|
|
21
|
+
/** Called with the session id when a row is picked; the header's Overview row picks `'overview'` and its New session row `'new'`. */
|
|
22
22
|
onValueChange?: (value: string) => void;
|
|
23
|
-
/** Called when a row's menu asks to open its session in split view. */
|
|
23
|
+
/** Called when a row's menu asks to open its session in split view. Omit to leave the menu item out. */
|
|
24
24
|
onOpenSplit?: (id: string) => void;
|
|
25
|
+
/** Called by a row's pin action with the session id and whether it should now be pinned. Omit to leave the action out. */
|
|
26
|
+
onPin?: (id: string, pinned: boolean) => void;
|
|
27
|
+
/** Called by a row's archive action (in a pinned row's menu, Unarchive in the archive) with the session id and whether it should now be archived. Omit to leave the action out. */
|
|
28
|
+
onArchive?: (id: string, archived: boolean) => void;
|
|
29
|
+
/** Called by a row's Rename menu item with the session id: open your rename field (the title bar's, say). Omit to leave the item out. */
|
|
30
|
+
onRename?: (id: string) => void;
|
|
31
|
+
/** Called by a row's Mark as unread menu item, shown on rows not already unread. Omit to leave the item out. */
|
|
32
|
+
onMarkUnread?: (id: string) => void;
|
|
33
|
+
/** Called by a row's Fork into a new session menu item with the session id. Omit to leave the item out. */
|
|
34
|
+
onFork?: (id: string) => void;
|
|
35
|
+
/** Called by a project group's New session action with that group. Omit to leave the action out. */
|
|
36
|
+
onNewSessionIn?: (group: SessionGroup2) => void;
|
|
37
|
+
/** Called by a section's Filter action with that section. Omit to leave the action out. */
|
|
38
|
+
onFilterSection?: (group: SessionGroup2) => void;
|
|
25
39
|
/** What needs you across sessions: a header row opens them, with the unread count. Omit for no inbox row. */
|
|
26
40
|
inbox?: InboxItem2[];
|
|
27
41
|
/** Called when an inbox row is answered or opened. */
|
|
28
42
|
onInboxAction?: (item: InboxItem2, action: InboxAction2) => void;
|
|
29
43
|
/** Called when the search field is clicked or Enter is pressed in it: open your ⌘K palette. Omit to keep it a plain field. */
|
|
30
44
|
onSearch?: () => void;
|
|
31
|
-
/** Called by the footer's
|
|
45
|
+
/** Called by the footer's Settings row and the usage's manage action. Omit to leave the Settings row out. */
|
|
32
46
|
onOpenSettings?: () => void;
|
|
33
47
|
/** The sidebar's layout (see Sidebar). Defaults to `'inset'`. */
|
|
34
48
|
variant?: "sidebar" | "floating" | "inset";
|
|
@@ -50,9 +64,15 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
50
64
|
* A row's leading glyph is its state: an arc turning while it runs, an
|
|
51
65
|
* amber dot while it waits for you, a filled dot for an unread reply and a
|
|
52
66
|
* ring when idle; its badge is the last activity. Hover a row for pin,
|
|
53
|
-
* archive and a menu that opens the session in split view, renames it
|
|
54
|
-
* forks it.
|
|
55
|
-
*
|
|
67
|
+
* archive and a menu that opens the session in split view, renames it,
|
|
68
|
+
* marks it unread or forks it. Each of those actions, a group's New session
|
|
69
|
+
* or Filter action and the footer's Settings row shows only when you pass
|
|
70
|
+
* its callback (`onPin`, `onArchive`, `onOpenSplit`, `onRename`,
|
|
71
|
+
* `onMarkUnread`, `onFork`, `onNewSessionIn`, `onFilterSection`,
|
|
72
|
+
* `onOpenSettings`), so the sidebar offers only what your app does. The
|
|
73
|
+
* Overview and New session rows are picks like a session's: `onValueChange`
|
|
74
|
+
* gets `'overview'` or `'new'`. Sessions started from another one fold
|
|
75
|
+
* under it as linked children. Pick a row and the active background melts over to it.
|
|
56
76
|
*
|
|
57
77
|
* On the overview, whose board is the session list widened, `list="filters"`
|
|
58
78
|
* trades the list for filters: by state, project and profile, each with its
|
|
@@ -64,5 +84,5 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
64
84
|
*
|
|
65
85
|
* @example {@include ./examples.mdx}
|
|
66
86
|
*/
|
|
67
|
-
declare function SessionSidebar2({ pinned, groups, archived, profiles, onPinnedOrderChange, list, value, defaultValue, onValueChange, onOpenSplit, onOpenSettings, inbox, onInboxAction, onSearch, variant, className }: SessionSidebarProps2): Element_12xgc;
|
|
87
|
+
declare function SessionSidebar2({ pinned, groups, archived, profiles, onPinnedOrderChange, list, value, defaultValue, onValueChange, onOpenSplit, onPin, onArchive, onRename, onMarkUnread, onFork, onNewSessionIn, onFilterSection, onOpenSettings, inbox, onInboxAction, onSearch, variant, className }: SessionSidebarProps2): Element_12xgc;
|
|
68
88
|
export { SessionSidebarProps2, SessionSidebar2 };
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import {
|
|
4
4
|
paceOf2,
|
|
5
5
|
duration2,
|
|
6
|
+
NO_USAGE2,
|
|
6
7
|
percent2,
|
|
7
8
|
VERDICT_TEXT2
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-58jh3mje.js";
|
|
9
10
|
import {
|
|
10
11
|
PaceBar2
|
|
11
12
|
} from "./chunk-04a497rr.js";
|
|
@@ -48,8 +49,8 @@ function UsagePane2({ profiles }) {
|
|
|
48
49
|
title: profile.name,
|
|
49
50
|
meta: profile.plan,
|
|
50
51
|
actions: /* @__PURE__ */ jsx("span", {
|
|
51
|
-
className: cn("pr-1 text-caption", VERDICT_TEXT2[binding.verdict]),
|
|
52
|
-
children: VERDICT_WORD[binding.verdict]
|
|
52
|
+
className: cn("pr-1 text-caption", binding ? VERDICT_TEXT2[binding.verdict] : "text-muted-foreground"),
|
|
53
|
+
children: binding ? VERDICT_WORD[binding.verdict] : NO_USAGE2
|
|
53
54
|
}),
|
|
54
55
|
children: limits.map((pace) => /* @__PURE__ */ jsxs("div", {
|
|
55
56
|
className: cn("flex items-center gap-2 px-2", size.control, size.text),
|