@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
|
@@ -13,12 +13,11 @@ import {
|
|
|
13
13
|
chapter_nav_default
|
|
14
14
|
} from "./chunk-bh2b5d1z.js";
|
|
15
15
|
import {
|
|
16
|
-
Working2,
|
|
17
16
|
message_default
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-94grzz9f.js";
|
|
19
18
|
import {
|
|
20
19
|
reasoning_default
|
|
21
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-b5ccp5de.js";
|
|
22
21
|
import {
|
|
23
22
|
recap_default
|
|
24
23
|
} from "./chunk-skg3m9m0.js";
|
|
@@ -44,13 +43,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
44
43
|
* ToolCall, AgentRun, WorkSummary, ChapterNav, TodoList, Recap), aliased as
|
|
45
44
|
* statics.
|
|
46
45
|
*/
|
|
47
|
-
function
|
|
46
|
+
function UserTurn(props) {
|
|
48
47
|
return /* @__PURE__ */ jsx(message_default, {
|
|
49
48
|
role: "user",
|
|
50
49
|
...props
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
|
-
function
|
|
52
|
+
function AssistantTurn({ children, streaming, ...props }) {
|
|
54
53
|
if (typeof children === "string")
|
|
55
54
|
return /* @__PURE__ */ jsxs("div", {
|
|
56
55
|
className: "flex flex-col gap-3",
|
|
@@ -59,7 +58,7 @@ function Assistant({ children, streaming, ...props }) {
|
|
|
59
58
|
streaming,
|
|
60
59
|
children
|
|
61
60
|
}),
|
|
62
|
-
streaming && /* @__PURE__ */ jsx(
|
|
61
|
+
streaming && /* @__PURE__ */ jsx(message_default.Working, {})
|
|
63
62
|
]
|
|
64
63
|
});
|
|
65
64
|
return /* @__PURE__ */ jsx(message_default, {
|
|
@@ -161,8 +160,8 @@ var Transcript2 = Object.assign(function Transcript({ children, chapters, defaul
|
|
|
161
160
|
]
|
|
162
161
|
});
|
|
163
162
|
}, {
|
|
164
|
-
User,
|
|
165
|
-
Assistant,
|
|
163
|
+
User: UserTurn,
|
|
164
|
+
Assistant: AssistantTurn,
|
|
166
165
|
Work: work_summary_default,
|
|
167
166
|
Thinking: reasoning_default,
|
|
168
167
|
Tools: tool_call_default.Group,
|
|
@@ -13,7 +13,7 @@ interface OfferProps2 {
|
|
|
13
13
|
onChoose?: (where: "new-session" | "here") => void;
|
|
14
14
|
}
|
|
15
15
|
type Element_12xgc = JSX_1kxb["Element"];
|
|
16
|
-
declare function
|
|
16
|
+
declare function OfferPrompt({ title, brief, onChoose }: OfferProps2): Element_12xgc;
|
|
17
17
|
interface TaskProps2 {
|
|
18
18
|
/** The proposed task. */
|
|
19
19
|
title: string;
|
|
@@ -24,7 +24,7 @@ interface TaskProps2 {
|
|
|
24
24
|
/** Called with the decision. */
|
|
25
25
|
onDecide?: (decision: "start" | "dismiss") => void;
|
|
26
26
|
}
|
|
27
|
-
declare function
|
|
27
|
+
declare function TaskPrompt({ title, brief, where, onDecide }: TaskProps2): Element_12xgc;
|
|
28
28
|
/**
|
|
29
29
|
* Everything the agent stops to ask you mid-turn, as one family of lifted
|
|
30
30
|
* cards under the transcript.
|
|
@@ -48,7 +48,7 @@ declare const AgentPrompt2: ((props: AgentPromptProps2) => Element_12xgc) & {
|
|
|
48
48
|
Permission: typeof PermissionRequest2;
|
|
49
49
|
Question: typeof QuestionPrompt2;
|
|
50
50
|
Plan: typeof PlanApproval2;
|
|
51
|
-
Offer: typeof
|
|
52
|
-
Task: typeof
|
|
51
|
+
Offer: typeof OfferPrompt;
|
|
52
|
+
Task: typeof TaskPrompt;
|
|
53
53
|
};
|
|
54
54
|
export { AgentPromptProps2, OfferProps2, TaskProps2, AgentPrompt2 };
|
|
@@ -23,7 +23,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
23
23
|
* block adds the session cards (an offer to split work off, an
|
|
24
24
|
* own-initiative task) and gathers them all as statics.
|
|
25
25
|
*/
|
|
26
|
-
function
|
|
26
|
+
function OfferPrompt({ title, brief, onChoose }) {
|
|
27
27
|
return /* @__PURE__ */ jsx(PromptCard2, {
|
|
28
28
|
icon: "split",
|
|
29
29
|
title,
|
|
@@ -49,7 +49,7 @@ function Offer({ title, brief, onChoose }) {
|
|
|
49
49
|
})
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function TaskPrompt({ title, brief, where, onDecide }) {
|
|
53
53
|
return /* @__PURE__ */ jsx(PromptCard2, {
|
|
54
54
|
icon: "git-fork",
|
|
55
55
|
title,
|
|
@@ -81,6 +81,6 @@ var AgentPrompt2 = Object.assign(function AgentPrompt(props) {
|
|
|
81
81
|
return /* @__PURE__ */ jsx(PromptCard2, {
|
|
82
82
|
...props
|
|
83
83
|
});
|
|
84
|
-
}, { Permission: PermissionRequest2, Question: QuestionPrompt2, Plan: PlanApproval2, Offer, Task });
|
|
84
|
+
}, { Permission: PermissionRequest2, Question: QuestionPrompt2, Plan: PlanApproval2, Offer: OfferPrompt, Task: TaskPrompt });
|
|
85
85
|
var agent_prompt_default = AgentPrompt2;
|
|
86
86
|
export { AgentPrompt2, agent_prompt_default };
|
package/lib/pace.ts
CHANGED
|
@@ -24,8 +24,8 @@ export interface LimitPace {
|
|
|
24
24
|
export interface ProfilePace {
|
|
25
25
|
profile: Profile
|
|
26
26
|
limits: LimitPace[]
|
|
27
|
-
/** The limit that runs out first, or lands highest at its reset. */
|
|
28
|
-
binding
|
|
27
|
+
/** 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). */
|
|
28
|
+
binding?: LimitPace
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/** Projected share from which a limit counts as only just lasting. */
|
|
@@ -44,9 +44,10 @@ function paceOfLimit(limit: UsageLimit): LimitPace {
|
|
|
44
44
|
return { limit, elapsed: elapsedHours / limit.windowHours, projected, runsOutInHours, verdict }
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/** Each limit's pace and the binding one. A profile with no limits yet gets `limits: []` and no `binding`. */
|
|
47
48
|
export function paceOf(profile: Profile): ProfilePace {
|
|
48
49
|
const limits = profile.limits.map(paceOfLimit)
|
|
49
|
-
const binding = [...limits].sort((a, b) => b.projected - a.projected)[0]
|
|
50
|
+
const binding = [...limits].sort((a, b) => b.projected - a.projected)[0]
|
|
50
51
|
return { profile, limits, binding }
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -62,6 +63,9 @@ export function duration(hours: number) {
|
|
|
62
63
|
return `${Math.round(hours / 24)}d`
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
/** What a profile with no limits yet shows in place of a share or a verdict. */
|
|
67
|
+
export const NO_USAGE = 'No usage yet'
|
|
68
|
+
|
|
65
69
|
export function percent(share: number) {
|
|
66
70
|
return `${Math.round(share * 100)}%`
|
|
67
71
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justanarthur/modo-ui-ai",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"description": "An AI agent app kit on modo-ui: messages, tool calls, prompts, a composer, a transcript, side panes, settings and full app screens. Documented with modo.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@justanarthur/modo": "1.
|
|
105
|
-
"@justanarthur/modo-ui": "2.
|
|
104
|
+
"@justanarthur/modo": "1.1.0",
|
|
105
|
+
"@justanarthur/modo-ui": "2.2.0",
|
|
106
106
|
"@types/react": "^18.3.0",
|
|
107
107
|
"@types/react-dom": "^18.3.0",
|
|
108
108
|
"bunup": "^0.16.0",
|