@mcp-b/react-components 0.42.0 → 0.44.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.
Files changed (134) hide show
  1. package/dist/{AgentChat-DVr2giwD.d.ts → AgentChat-Bibfj7u1.d.ts} +1 -1
  2. package/dist/{AgentChatStartScreen-CO49yepa.d.ts → AgentChatStartScreen-Bkv7Avni.d.ts} +6 -0
  3. package/dist/{CodeBlock-BjELA-_s.js → CodeBlock-Dl7a3Wqo.js} +1 -1
  4. package/dist/{FileTree-DMYRdT6R.js → FileTree-Uu3ZnW1u.js} +1 -1
  5. package/dist/McpPluginCatalog-mbGw8FTu.d.ts +92 -0
  6. package/dist/ResponsiveSidebarShell-DOXd5T-d.d.ts +111 -0
  7. package/dist/SetupChecklist-DOp-zqjh.js +77 -0
  8. package/dist/{ThinkChatActivity-CsDql-ER.d.ts → ThinkChatActivity-CgvmTXXB.d.ts} +1 -1
  9. package/dist/Workspace-F3raHdYV.d.ts +140 -0
  10. package/dist/{WorkspaceFileView-DwdXiKku.js → WorkspaceFileView-BublZXky.js} +2 -3
  11. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  12. package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
  13. package/dist/components/agents-sdk/AgentChat.js +10 -10
  14. package/dist/components/agents-sdk/BrowserLiveScreen.js +4 -1
  15. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  16. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  17. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  18. package/dist/components/agents-sdk/ManagerOffice.js +4 -4
  19. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  20. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  21. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -91
  22. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -3
  23. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  24. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  25. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  26. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  27. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  28. package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
  29. package/dist/components/agents-sdk/ThinkChat.d.ts +2 -2
  30. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  31. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  32. package/dist/components/agents-sdk/ThinkChatActivity.js +3 -3
  33. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
  34. package/dist/components/agents-sdk/ThinkExecutionDetail.js +3 -3
  35. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  36. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  37. package/dist/components/agents-sdk/ThinkFullApp.d.ts +20 -6
  38. package/dist/components/agents-sdk/ThinkFullApp.js +7 -6
  39. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
  40. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +3 -2
  41. package/dist/components/agents-sdk/ThinkRoutine.d.ts +1 -7
  42. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
  43. package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
  44. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +34 -18
  45. package/dist/components/agents-sdk/ThinkRoutineForm.js +395 -110
  46. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +5 -4
  47. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +19 -33
  48. package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
  49. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +173 -0
  50. package/dist/components/agents-sdk/ThinkSidepanel.js +711 -0
  51. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +4 -5
  52. package/dist/components/agents-sdk/ThinkThreadPicker.js +9 -9
  53. package/dist/components/agents-sdk/Workspace.d.ts +1 -139
  54. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  55. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  56. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
  57. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
  58. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  59. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  60. package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
  61. package/dist/components/ai-sdk/Activity.js +1 -1
  62. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +1 -1
  63. package/dist/components/ai-sdk/AgentChatStartScreen.js +6 -3
  64. package/dist/components/ai-sdk/Approval.js +2 -2
  65. package/dist/components/ai-sdk/Artifact.js +1 -1
  66. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  67. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  68. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  69. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  70. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +106 -0
  71. package/dist/components/ai-sdk/ConnectedAppCards.js +416 -0
  72. package/dist/components/ai-sdk/Conversation.js +1 -1
  73. package/dist/components/ai-sdk/Goal.js +1 -1
  74. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  75. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  76. package/dist/components/ai-sdk/Message.js +1 -1
  77. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  78. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  79. package/dist/components/ai-sdk/Plan.js +1 -1
  80. package/dist/components/ai-sdk/PromptInput.js +3 -3
  81. package/dist/components/ai-sdk/Queue.js +2 -2
  82. package/dist/components/ai-sdk/Reasoning.js +2 -2
  83. package/dist/components/ai-sdk/Sources.js +1 -1
  84. package/dist/components/ai-sdk/Task.js +1 -1
  85. package/dist/components/ai-sdk/ToolInvocation.js +1 -1
  86. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -3
  87. package/dist/components/extension/ChatGptSignInScreen.js +7 -20
  88. package/dist/components/extension/CodexModelSelector.js +2 -2
  89. package/dist/components/extension/ConversationTabPicker.js +2 -2
  90. package/dist/components/foundations/Checkbox.js +1 -1
  91. package/dist/components/foundations/Collapsible.js +1 -1
  92. package/dist/components/foundations/ContextMenu.js +1 -1
  93. package/dist/components/foundations/DescriptionList.d.ts +3 -0
  94. package/dist/components/foundations/DescriptionList.js +2 -1
  95. package/dist/components/foundations/Menubar.js +1 -1
  96. package/dist/components/foundations/SearchField.js +1 -1
  97. package/dist/components/foundations/Select.js +1 -1
  98. package/dist/components/foundations/Stepper.js +1 -1
  99. package/dist/components/foundations/Toast.js +1 -1
  100. package/dist/components/foundations/ToggleGroup.d.ts +1 -1
  101. package/dist/components/foundations/ToggleGroup.js +1 -1
  102. package/dist/components/foundations/icons.d.ts +2 -2
  103. package/dist/components/foundations/icons.js +2 -2
  104. package/dist/components/general-purpose/Commit.js +2 -2
  105. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  106. package/dist/components/general-purpose/FileTree.js +1 -1
  107. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  108. package/dist/components/general-purpose/PricingPlanCard.js +1 -1
  109. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  110. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -104
  111. package/dist/components/general-purpose/ResponsiveSidebarShell.js +3 -3
  112. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  113. package/dist/components/general-purpose/SetupChecklist.js +1 -76
  114. package/dist/components/general-purpose/Terminal.js +2 -2
  115. package/dist/components/general-purpose/TestResults.js +1 -1
  116. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  117. package/dist/components/general-purpose/WebPreview.js +2 -2
  118. package/dist/components/nanites/AgentConnection.js +2 -2
  119. package/dist/components/nanites/AgentToolDetail.js +4 -4
  120. package/dist/{copy-button-lys9N_aI.js → copy-button-DHhf-J1d.js} +1 -1
  121. package/dist/{icons-0corjfxR.d.ts → icons-6ZnyZJiR.d.ts} +6 -1
  122. package/dist/{icons-CVFSeTJn.js → icons-Dw-im7lg.js} +4 -3
  123. package/dist/styles/agent-chat.css +20 -15
  124. package/dist/styles/browser-live-screen.css +3 -0
  125. package/dist/styles/button.css +1 -5
  126. package/dist/styles/chatgpt-sign-in-screen.css +87 -43
  127. package/dist/styles/connected-app-card.css +54 -0
  128. package/dist/styles/description-list.css +25 -0
  129. package/dist/styles/index.css +2 -0
  130. package/dist/styles/responsive-sidebar-shell.css +12 -9
  131. package/dist/styles/think-routine-library.css +28 -0
  132. package/dist/styles/think-sidepanel.css +74 -0
  133. package/package.json +2 -2
  134. package/dist/{ThinkChat-DkA4Wr71.js → ThinkChat-BES_3Mb-.js} +1 -1
@@ -1,14 +1,104 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { K as SpinnerIcon } from "../../icons-CVFSeTJn.js";
3
- import { Button, buttonVariants } from "../foundations/Button.js";
2
+ import { d as CheckIcon, et as WarningIcon, f as ChevronDownIcon, q as SpinnerIcon, r as ArrowLeftIcon } from "../../icons-Dw-im7lg.js";
3
+ import { Button } from "../foundations/Button.js";
4
+ import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
4
5
  import { Field } from "../foundations/Field.js";
5
6
  import { Form } from "../foundations/Form.js";
6
7
  import { Textarea } from "../foundations/Textarea.js";
7
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
8
+ import { AppTopBar } from "../general-purpose/AppTopBar.js";
9
+ import { Fieldset } from "../foundations/Fieldset.js";
8
10
  import { Select } from "../foundations/Select.js";
11
+ import { Checkbox } from "../foundations/Checkbox.js";
12
+ import { CheckboxGroup } from "../foundations/CheckboxGroup.js";
13
+ import { Combobox } from "../foundations/Combobox.js";
14
+ import { NumberField } from "../foundations/NumberField.js";
9
15
  import * as React from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
17
  //#region src/components/agents-sdk/ThinkRoutineForm.tsx
18
+ const SCHEDULE_KIND_OPTIONS = [
19
+ {
20
+ label: "At an interval",
21
+ value: "interval"
22
+ },
23
+ {
24
+ label: "Every day",
25
+ value: "daily"
26
+ },
27
+ {
28
+ label: "Every weekday",
29
+ value: "weekdays"
30
+ },
31
+ {
32
+ label: "Every week",
33
+ value: "weekly"
34
+ }
35
+ ];
36
+ const INTERVAL_UNIT_OPTIONS = [{
37
+ label: "Minutes",
38
+ value: "minute"
39
+ }, {
40
+ label: "Hours",
41
+ value: "hour"
42
+ }];
43
+ const BROWSER_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
44
+ const WEEKDAYS = [
45
+ {
46
+ token: "mon",
47
+ dayNumber: 1,
48
+ label: "Monday"
49
+ },
50
+ {
51
+ token: "tue",
52
+ dayNumber: 2,
53
+ label: "Tuesday"
54
+ },
55
+ {
56
+ token: "wed",
57
+ dayNumber: 3,
58
+ label: "Wednesday"
59
+ },
60
+ {
61
+ token: "thu",
62
+ dayNumber: 4,
63
+ label: "Thursday"
64
+ },
65
+ {
66
+ token: "fri",
67
+ dayNumber: 5,
68
+ label: "Friday"
69
+ },
70
+ {
71
+ token: "sat",
72
+ dayNumber: 6,
73
+ label: "Saturday"
74
+ },
75
+ {
76
+ token: "sun",
77
+ dayNumber: 0,
78
+ label: "Sunday"
79
+ }
80
+ ];
81
+ function scheduleKindOf(schedule) {
82
+ if (schedule.kind === "interval") return "interval";
83
+ if (schedule.days === "daily") return "daily";
84
+ if (schedule.days === "weekday") return "weekdays";
85
+ return "weekly";
86
+ }
87
+ function wallClockTime(schedule) {
88
+ const pad = (value) => String(value).padStart(2, "0");
89
+ return `${pad(schedule.hour)}:${pad(schedule.minute)}`;
90
+ }
91
+ function timezoneOptions() {
92
+ return [.../* @__PURE__ */ new Set([
93
+ BROWSER_TIMEZONE,
94
+ "UTC",
95
+ ...Intl.supportedValuesOf("timeZone")
96
+ ])].sort((left, right) => left.localeCompare(right)).map((value) => ({
97
+ label: value,
98
+ value
99
+ }));
100
+ }
101
+ const TIMEZONE_OPTIONS = timezoneOptions();
12
102
  function RoutineSelect({ label, onValueChange, options, value }) {
13
103
  return /* @__PURE__ */ jsx("div", {
14
104
  className: "think-routine-library__select-field",
@@ -32,120 +122,315 @@ function RoutineSelect({ label, onValueChange, options, value }) {
32
122
  })
33
123
  });
34
124
  }
35
- /** Authoring surface for a serializable, prompt-based Think scheduled task. */
36
- function ThinkRoutineForm({ busy = false, cancelLink, className, owners, onCreate, schedules, ref, ...props }) {
37
- const [name, setName] = React.useState("");
38
- const [ownerId, setOwnerId] = React.useState(owners[0]?.id ?? "");
39
- const [prompt, setPrompt] = React.useState("");
40
- const [schedule, setSchedule] = React.useState(schedules[0] ?? null);
125
+ /** Complete create/edit surface for a prompt-based Think scheduled task. */
126
+ function ThinkRoutineForm({ cancelLink, className, routine, onSubmit, ref, ...props }) {
127
+ const initialSchedule = routine?.parsedSchedule;
128
+ const editing = routine !== void 0;
129
+ const [name, setName] = React.useState(routine?.name ?? "");
130
+ const [prompt, setPrompt] = React.useState(routine?.task.prompt ?? "");
131
+ const [scheduleKind, setScheduleKind] = React.useState(initialSchedule ? scheduleKindOf(initialSchedule) : "daily");
132
+ const [intervalEvery, setIntervalEvery] = React.useState(initialSchedule?.kind === "interval" ? initialSchedule.intervalMs % 36e5 === 0 ? initialSchedule.intervalMs / 36e5 : initialSchedule.intervalMs / 6e4 : 1);
133
+ const [intervalUnit, setIntervalUnit] = React.useState(initialSchedule?.kind === "interval" && initialSchedule.intervalMs % 36e5 !== 0 ? "minute" : "hour");
134
+ const [time, setTime] = React.useState(initialSchedule?.kind === "wall-clock" ? wallClockTime(initialSchedule) : "09:00");
135
+ const [timezone, setTimezone] = React.useState(initialSchedule?.kind === "wall-clock" ? initialSchedule.timezone : BROWSER_TIMEZONE);
136
+ const [timezoneInput, setTimezoneInput] = React.useState(initialSchedule?.kind === "wall-clock" ? initialSchedule.timezone : BROWSER_TIMEZONE);
137
+ const [days, setDays] = React.useState(initialSchedule?.kind === "wall-clock" && Array.isArray(initialSchedule.days) ? WEEKDAYS.filter((day) => initialSchedule.days.includes(day.dayNumber)).map((day) => day.token) : ["mon"]);
138
+ const [daysError, setDaysError] = React.useState(false);
139
+ const [timezoneError, setTimezoneError] = React.useState(false);
140
+ const [busy, setBusy] = React.useState(false);
141
+ const [error, setError] = React.useState(null);
41
142
  const titleId = React.useId();
42
- return /* @__PURE__ */ jsxs("main", {
143
+ const timezoneLabelId = React.useId();
144
+ const timezoneDescriptionId = React.useId();
145
+ const timezoneErrorId = React.useId();
146
+ const intervalLabelId = React.useId();
147
+ const daysDescriptionId = React.useId();
148
+ const daysErrorId = React.useId();
149
+ const firstDayRef = React.useRef(null);
150
+ const timezoneInputRef = React.useRef(null);
151
+ const availableTimezoneOptions = React.useMemo(() => TIMEZONE_OPTIONS.some((option) => option.value === timezone) ? TIMEZONE_OPTIONS : [...TIMEZONE_OPTIONS, {
152
+ label: timezone,
153
+ value: timezone
154
+ }].sort((left, right) => left.value.localeCompare(right.value)), [timezone]);
155
+ const selectedTimezone = React.useMemo(() => availableTimezoneOptions.find((option) => option.value === timezone) ?? {
156
+ label: timezone,
157
+ value: timezone
158
+ }, [availableTimezoneOptions, timezone]);
159
+ function value() {
160
+ if (!name.trim() || !prompt.trim()) return null;
161
+ let schedule;
162
+ if (scheduleKind === "interval") {
163
+ if (!Number.isSafeInteger(intervalEvery) || (intervalEvery ?? 0) < 1) return null;
164
+ const every = intervalEvery;
165
+ schedule = `every ${every} ${intervalUnit}${every === 1 ? "" : "s"}`;
166
+ } else if (timezoneInput !== selectedTimezone.label) {
167
+ setTimezoneError(true);
168
+ queueMicrotask(() => timezoneInputRef.current?.focus());
169
+ return null;
170
+ } else if (scheduleKind === "weekly") {
171
+ if (days.length === 0) {
172
+ setDaysError(true);
173
+ queueMicrotask(() => firstDayRef.current?.focus());
174
+ return null;
175
+ }
176
+ schedule = `every week on ${WEEKDAYS.filter((day) => days.includes(day.token)).map((day) => day.token).join(",")} at ${time} in ${timezone}`;
177
+ } else if (scheduleKind === "weekdays") schedule = `every weekday at ${time} in ${timezone}`;
178
+ else schedule = `every day at ${time} in ${timezone}`;
179
+ return {
180
+ name: name.trim(),
181
+ prompt: prompt.trim(),
182
+ schedule
183
+ };
184
+ }
185
+ async function submit(event) {
186
+ event.preventDefault();
187
+ const nextValue = value();
188
+ if (!nextValue) return;
189
+ setBusy(true);
190
+ setError(null);
191
+ try {
192
+ await onSubmit(nextValue);
193
+ } catch (nextError) {
194
+ setError(formatErrorMessage(nextError));
195
+ } finally {
196
+ setBusy(false);
197
+ }
198
+ }
199
+ return /* @__PURE__ */ jsxs("div", {
43
200
  ref,
44
- className: cx("think-routine-form", "think-routine-library__create", className),
45
- "aria-labelledby": titleId,
201
+ className: cx("think-routine-library", "think-routine-library__editor", className),
46
202
  ...props,
47
- children: [/* @__PURE__ */ jsx("header", {
48
- className: "think-routine-library__create-header",
49
- children: /* @__PURE__ */ jsxs("div", { children: [
50
- /* @__PURE__ */ jsx("p", {
51
- className: "think-routine-library__eyebrow",
52
- children: "New schedule"
53
- }),
54
- /* @__PURE__ */ jsx("h1", {
55
- id: titleId,
56
- children: "What should run automatically?"
57
- }),
58
- /* @__PURE__ */ jsx("p", { children: "Give an agent clear instructions, then choose when Think should submit them." })
59
- ] })
60
- }), /* @__PURE__ */ jsxs(Form, {
61
- className: "think-routine-library__form",
62
- onSubmit: (event) => {
63
- event.preventDefault();
64
- if (!name.trim() || !prompt.trim() || !ownerId || !schedule) return;
65
- const task = {
66
- schedule,
67
- prompt: prompt.trim()
68
- };
69
- onCreate({
70
- name: name.trim(),
71
- ownerId,
72
- task
73
- });
74
- },
75
- children: [/* @__PURE__ */ jsxs(Field.Group, { children: [
76
- /* @__PURE__ */ jsxs(Field.Root, {
77
- name: "name",
78
- children: [
79
- /* @__PURE__ */ jsx(Field.Label, { children: "Name" }),
80
- /* @__PURE__ */ jsx(Field.Control, {
203
+ children: [
204
+ /* @__PURE__ */ jsxs(AppTopBar.Root, {
205
+ "aria-label": "Schedule editor controls",
206
+ children: [cancelLink ? /* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Link, {
207
+ label: "Back to schedules",
208
+ render: cancelLink,
209
+ children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
210
+ }) }) : null, /* @__PURE__ */ jsx(AppTopBar.Title, { children: editing ? "Edit schedule" : "New schedule" })]
211
+ }),
212
+ error ? /* @__PURE__ */ jsxs("div", {
213
+ className: "think-routine-library__editor-error",
214
+ role: "alert",
215
+ children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
216
+ }) : null,
217
+ /* @__PURE__ */ jsxs("main", {
218
+ className: "think-routine-form think-routine-library__create",
219
+ "aria-labelledby": titleId,
220
+ children: [/* @__PURE__ */ jsx("header", {
221
+ className: "think-routine-library__create-header",
222
+ children: /* @__PURE__ */ jsxs("div", { children: [
223
+ /* @__PURE__ */ jsx("p", {
224
+ className: "think-routine-library__eyebrow",
225
+ children: editing ? "Edit schedule" : "New schedule"
226
+ }),
227
+ /* @__PURE__ */ jsx("h1", {
228
+ id: titleId,
229
+ children: "What should run automatically?"
230
+ }),
231
+ /* @__PURE__ */ jsx("p", { children: "Each run starts a new conversation with these instructions." })
232
+ ] })
233
+ }), /* @__PURE__ */ jsxs(Form, {
234
+ className: "think-routine-library__form",
235
+ validationMode: "onBlur",
236
+ onSubmit: submit,
237
+ children: [/* @__PURE__ */ jsxs(Field.Group, { children: [
238
+ /* @__PURE__ */ jsxs(Field.Root, {
81
239
  name: "name",
82
- value: name,
83
- required: true,
84
- autoComplete: "off",
85
- placeholder: "Weekly project review",
86
- onChange: (event) => setName(event.currentTarget.value)
240
+ children: [
241
+ /* @__PURE__ */ jsx(Field.Label, { children: "Name" }),
242
+ /* @__PURE__ */ jsx(Field.Control, {
243
+ name: "name",
244
+ value: name,
245
+ required: true,
246
+ autoComplete: "off",
247
+ placeholder: "Weekly project review",
248
+ onChange: (event) => setName(event.currentTarget.value)
249
+ }),
250
+ /* @__PURE__ */ jsx(Field.Error, {
251
+ match: "valueMissing",
252
+ children: "Name is required"
253
+ })
254
+ ]
87
255
  }),
88
- /* @__PURE__ */ jsx(Field.Error, {
89
- match: "valueMissing",
90
- children: "Name is required"
91
- })
92
- ]
93
- }),
94
- /* @__PURE__ */ jsxs(Field.Root, {
95
- name: "prompt",
96
- children: [
97
- /* @__PURE__ */ jsx(Field.Label, { children: "Instructions" }),
98
- /* @__PURE__ */ jsx(Field.Description, { children: "Describe the outcome, sources, and what to do when blocked." }),
99
- /* @__PURE__ */ jsx(Field.Control, {
100
- render: /* @__PURE__ */ jsx(Textarea, { rows: 8 }),
256
+ /* @__PURE__ */ jsxs(Field.Root, {
101
257
  name: "prompt",
102
- value: prompt,
103
- required: true,
104
- placeholder: "Review open pull requests, summarize blockers, and draft a concise project update.",
105
- onChange: (event) => setPrompt(event.currentTarget.value)
258
+ children: [
259
+ /* @__PURE__ */ jsx(Field.Label, { children: "Instructions" }),
260
+ /* @__PURE__ */ jsx(Field.Description, { children: "Describe the outcome, sources, and what to do when blocked." }),
261
+ /* @__PURE__ */ jsx(Field.Control, {
262
+ render: /* @__PURE__ */ jsx(Textarea, { rows: 8 }),
263
+ name: "prompt",
264
+ value: prompt,
265
+ required: true,
266
+ placeholder: "Review open pull requests, summarize blockers, and draft a concise project update.",
267
+ onChange: (event) => setPrompt(event.currentTarget.value)
268
+ }),
269
+ /* @__PURE__ */ jsx(Field.Error, {
270
+ match: "valueMissing",
271
+ children: "Instructions are required"
272
+ })
273
+ ]
106
274
  }),
107
- /* @__PURE__ */ jsx(Field.Error, {
108
- match: "valueMissing",
109
- children: "Instructions are required"
110
- })
111
- ]
112
- }),
113
- /* @__PURE__ */ jsxs("div", {
114
- className: "think-routine-library__form-row",
115
- children: [/* @__PURE__ */ jsx(RoutineSelect, {
116
- label: "Agent",
117
- value: ownerId,
118
- options: owners.map((owner) => ({
119
- label: owner.name,
120
- value: owner.id
121
- })),
122
- onValueChange: setOwnerId
123
- }), schedule ? /* @__PURE__ */ jsx(RoutineSelect, {
124
- label: "Repeats",
125
- value: schedule,
126
- options: schedules.map((value) => ({
127
- label: value,
128
- value
129
- })),
130
- onValueChange: setSchedule
131
- }) : /* @__PURE__ */ jsx("p", { children: "No schedules are available." })]
132
- })
133
- ] }), /* @__PURE__ */ jsxs("footer", {
134
- className: "think-routine-library__form-actions",
135
- children: [cancelLink ? /* @__PURE__ */ jsx(NavigationLink, {
136
- render: cancelLink,
137
- className: buttonVariants({
138
- variant: "ghost",
139
- color: "neutral"
140
- }),
141
- children: "Cancel"
142
- }) : null, /* @__PURE__ */ jsxs(Button, {
143
- type: "submit",
144
- disabled: busy || owners.length === 0 || !schedule,
145
- children: [busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : null, " Create schedule"]
275
+ /* @__PURE__ */ jsx(RoutineSelect, {
276
+ label: "Repeats",
277
+ value: scheduleKind,
278
+ options: SCHEDULE_KIND_OPTIONS,
279
+ onValueChange: setScheduleKind
280
+ }),
281
+ scheduleKind === "interval" ? /* @__PURE__ */ jsxs("div", {
282
+ className: "think-routine-library__form-row",
283
+ children: [/* @__PURE__ */ jsxs(Field.Root, {
284
+ name: "interval",
285
+ children: [/* @__PURE__ */ jsx(Field.Label, {
286
+ id: intervalLabelId,
287
+ children: "Every"
288
+ }), /* @__PURE__ */ jsx(NumberField.Root, {
289
+ value: intervalEvery,
290
+ min: 1,
291
+ step: 1,
292
+ onValueChange: setIntervalEvery,
293
+ children: /* @__PURE__ */ jsxs(NumberField.Group, { children: [
294
+ /* @__PURE__ */ jsx(NumberField.Decrement, {
295
+ "aria-label": "Decrease interval",
296
+ children: "−"
297
+ }),
298
+ /* @__PURE__ */ jsx(NumberField.Input, {
299
+ name: "interval",
300
+ required: true,
301
+ "aria-labelledby": intervalLabelId
302
+ }),
303
+ /* @__PURE__ */ jsx(NumberField.Increment, {
304
+ "aria-label": "Increase interval",
305
+ children: "+"
306
+ })
307
+ ] })
308
+ })]
309
+ }), /* @__PURE__ */ jsx(RoutineSelect, {
310
+ label: "Unit",
311
+ value: intervalUnit,
312
+ options: INTERVAL_UNIT_OPTIONS,
313
+ onValueChange: setIntervalUnit
314
+ })]
315
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [scheduleKind === "weekly" ? /* @__PURE__ */ jsxs(Fieldset.Root, {
316
+ variant: "plain",
317
+ children: [
318
+ /* @__PURE__ */ jsx(Fieldset.Legend, { children: "Days" }),
319
+ /* @__PURE__ */ jsx(Fieldset.Description, {
320
+ id: daysDescriptionId,
321
+ children: "Select at least one day."
322
+ }),
323
+ /* @__PURE__ */ jsx(CheckboxGroup, {
324
+ layout: "grid",
325
+ value: days,
326
+ "aria-describedby": `${daysDescriptionId}${daysError ? ` ${daysErrorId}` : ""}`,
327
+ "aria-invalid": daysError || void 0,
328
+ onValueChange: (nextDays) => {
329
+ setDays(nextDays);
330
+ if (nextDays.length > 0) setDaysError(false);
331
+ },
332
+ children: WEEKDAYS.map((day) => /* @__PURE__ */ jsxs(CheckboxGroup.Item, { children: [/* @__PURE__ */ jsx(CheckboxGroup.Icon, { children: /* @__PURE__ */ jsx(Checkbox.Root, {
333
+ ref: day.token === "mon" ? firstDayRef : void 0,
334
+ value: day.token,
335
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
336
+ }) }), /* @__PURE__ */ jsx(CheckboxGroup.Content, { children: /* @__PURE__ */ jsx(CheckboxGroup.Title, { children: day.label }) })] }, day.token))
337
+ }),
338
+ daysError ? /* @__PURE__ */ jsx(Field.Errors, {
339
+ id: daysErrorId,
340
+ errors: ["Select at least one day."]
341
+ }) : null
342
+ ]
343
+ }) : null, /* @__PURE__ */ jsxs("div", {
344
+ className: "think-routine-library__form-row",
345
+ children: [/* @__PURE__ */ jsxs(Field.Root, {
346
+ name: "time",
347
+ children: [
348
+ /* @__PURE__ */ jsx(Field.Label, { children: "Time" }),
349
+ /* @__PURE__ */ jsx(Field.Control, {
350
+ name: "time",
351
+ type: "time",
352
+ value: time,
353
+ required: true,
354
+ onChange: (event) => setTime(event.currentTarget.value)
355
+ }),
356
+ /* @__PURE__ */ jsx(Field.Error, {
357
+ match: "valueMissing",
358
+ children: "Time is required"
359
+ })
360
+ ]
361
+ }), /* @__PURE__ */ jsxs(Field.Root, {
362
+ name: "timezone",
363
+ invalid: timezoneError,
364
+ children: [
365
+ /* @__PURE__ */ jsx(Field.Label, {
366
+ id: timezoneLabelId,
367
+ children: "Time zone"
368
+ }),
369
+ /* @__PURE__ */ jsx(Field.Description, {
370
+ id: timezoneDescriptionId,
371
+ children: "Search IANA zones, such as America/Chicago."
372
+ }),
373
+ /* @__PURE__ */ jsxs(Combobox.Root, {
374
+ items: availableTimezoneOptions,
375
+ value: selectedTimezone,
376
+ inputValue: timezoneInput,
377
+ onInputValueChange: (nextInput) => {
378
+ setTimezoneInput(nextInput);
379
+ if (nextInput === selectedTimezone.label) setTimezoneError(false);
380
+ },
381
+ onValueChange: (option) => {
382
+ if (!option) return;
383
+ setTimezone(option.value);
384
+ setTimezoneInput(option.label);
385
+ setTimezoneError(false);
386
+ },
387
+ children: [/* @__PURE__ */ jsxs(Combobox.InputGroup, { children: [/* @__PURE__ */ jsx(Combobox.Input, {
388
+ ref: timezoneInputRef,
389
+ name: "timezone",
390
+ required: true,
391
+ "aria-invalid": timezoneError || void 0,
392
+ "aria-labelledby": timezoneLabelId,
393
+ "aria-describedby": `${timezoneDescriptionId}${timezoneError ? ` ${timezoneErrorId}` : ""}`
394
+ }), /* @__PURE__ */ jsx(Combobox.Trigger, {
395
+ "aria-label": "Open time zone list",
396
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
397
+ })] }), /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
398
+ sideOffset: 4,
399
+ children: /* @__PURE__ */ jsxs(Combobox.Popup, { children: [/* @__PURE__ */ jsx(Combobox.List, { children: (option) => /* @__PURE__ */ jsxs(Combobox.Item, {
400
+ value: option,
401
+ children: [/* @__PURE__ */ jsx(Combobox.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) }), option.label]
402
+ }, option.value) }), /* @__PURE__ */ jsx(Combobox.Empty, { children: "No matching time zones." })] })
403
+ }) })]
404
+ }),
405
+ timezoneError ? /* @__PURE__ */ jsx(Field.Errors, {
406
+ id: timezoneErrorId,
407
+ errors: ["Select a valid time zone from the list."]
408
+ }) : null
409
+ ]
410
+ })]
411
+ })] })
412
+ ] }), /* @__PURE__ */ jsxs("footer", {
413
+ className: "think-routine-library__form-actions",
414
+ children: [cancelLink ? /* @__PURE__ */ jsx(Button, {
415
+ variant: "ghost",
416
+ color: "neutral",
417
+ disabled: busy,
418
+ nativeButton: false,
419
+ render: cancelLink,
420
+ children: "Cancel"
421
+ }) : null, /* @__PURE__ */ jsxs(Button, {
422
+ type: "submit",
423
+ disabled: busy,
424
+ children: [
425
+ busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : null,
426
+ " ",
427
+ editing ? "Save changes" : "Create schedule"
428
+ ]
429
+ })]
430
+ })]
146
431
  })]
147
- })]
148
- })]
432
+ })
433
+ ]
149
434
  });
150
435
  }
151
436
  //#endregion
@@ -1,4 +1,4 @@
1
- import { AppBarSlots } from "../general-purpose/ResponsiveSidebarShell.js";
1
+ import { t as AppBarSlots } from "../../ResponsiveSidebarShell-DOXd5T-d.js";
2
2
  import { ThinkRoutine, ThinkRoutineRunOf } from "./ThinkRoutine.js";
3
3
  import * as React from "react";
4
4
 
@@ -31,8 +31,9 @@ interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine>
31
31
  /** Host-owned catalog error shown above the library without replacing loaded routines. */
32
32
  error?: React.ReactNode;
33
33
  /**
34
- * Application bar slots. `title` defaults to the selected schedule's name;
35
- * `actions` render before the built-in schedule actions.
34
+ * Application bar slots. `title` defaults to the selected schedule's name.
35
+ * `actions` render before Run / Edit / Delete. `primary` stays last — the
36
+ * host's identity chrome belongs there, not in a second overflow.
36
37
  */
37
38
  bar?: AppBarSlots;
38
39
  /** Starts the selected routine immediately. */
@@ -53,7 +54,7 @@ interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine>
53
54
  * authoring routes, and the association between schedules and native runs.
54
55
  * The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
55
56
  * and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
56
- * route and may also use these surfaces independently.
57
+ * and edit routes and may also use these surfaces independently.
57
58
  */
58
59
  declare function ThinkRoutineLibrary<TRoutine extends ThinkRoutine = ThinkRoutine>({
59
60
  bar,
@@ -1,13 +1,12 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { K as SpinnerIcon, y as EllipsisIcon, z as PlayIcon } from "../../icons-CVFSeTJn.js";
2
+ import { $ as TrashIcon, B as PlayIcon, q as SpinnerIcon, z as PencilIcon } from "../../icons-Dw-im7lg.js";
3
3
  import { buttonVariants } from "../foundations/Button.js";
4
- import { Menu } from "../foundations/Menu.js";
5
4
  import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
6
- import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
7
- import { AlertDialog } from "../foundations/AlertDialog.js";
8
5
  import { EmptyState } from "../foundations/EmptyState.js";
6
+ import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
9
7
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
10
8
  import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
9
+ import { AlertDialog } from "../foundations/AlertDialog.js";
11
10
  import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
12
11
  import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
13
12
  import * as React from "react";
@@ -15,45 +14,32 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
14
  //#region src/components/agents-sdk/ThinkRoutineLibrary.tsx
16
15
  function RoutineTopBarActions({ appBarActions, busy, onDelete, editLink, onRun, routineName }) {
17
16
  const [deleteOpen, setDeleteOpen] = React.useState(false);
18
- const moreActionsRef = React.useRef(null);
19
- const hasMenu = Boolean(editLink || onDelete);
20
- if (!appBarActions && !onRun && !hasMenu) return null;
17
+ const deleteButtonRef = React.useRef(null);
18
+ if (!appBarActions && !onRun && !editLink && !onDelete) return null;
21
19
  return /* @__PURE__ */ jsxs(Fragment, { children: [
22
20
  appBarActions,
23
21
  onRun ? /* @__PURE__ */ jsx(AppTopBar.Button, {
24
22
  label: "Run schedule",
25
- tooltip: "Run now",
26
23
  disabled: busy,
27
24
  onClick: onRun,
28
25
  children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
29
26
  }) : null,
30
- hasMenu ? /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
31
- label: "More schedule actions",
32
- tooltip: "More actions",
27
+ editLink ? /* @__PURE__ */ jsx(AppTopBar.Link, {
28
+ label: "Edit schedule",
29
+ render: editLink,
30
+ children: /* @__PURE__ */ jsx(PencilIcon, {})
31
+ }) : null,
32
+ onDelete ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
33
+ ref: deleteButtonRef,
34
+ label: "Delete schedule",
33
35
  disabled: busy,
34
- render: /* @__PURE__ */ jsx(Menu.Trigger, {
35
- ref: moreActionsRef,
36
- unstyled: true
37
- }),
38
- children: /* @__PURE__ */ jsx(EllipsisIcon, {})
39
- }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
40
- align: "end",
41
- sideOffset: 4,
42
- children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [editLink ? /* @__PURE__ */ jsx(Menu.Item, {
43
- render: editLink,
44
- children: "Edit schedule"
45
- }) : null, onDelete ? /* @__PURE__ */ jsx(Menu.Item, {
46
- variant: "destructive",
47
- disabled: busy,
48
- onClick: () => setDeleteOpen(true),
49
- children: "Delete schedule"
50
- }) : null] })
51
- }) })] }) : null,
52
- onDelete ? /* @__PURE__ */ jsx(AlertDialog.Root, {
36
+ onClick: () => setDeleteOpen(true),
37
+ children: /* @__PURE__ */ jsx(TrashIcon, {})
38
+ }), /* @__PURE__ */ jsx(AlertDialog.Root, {
53
39
  open: deleteOpen,
54
40
  onOpenChange: setDeleteOpen,
55
41
  children: /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog.Backdrop, {}), /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
56
- finalFocus: moreActionsRef,
42
+ finalFocus: deleteButtonRef,
57
43
  children: [
58
44
  /* @__PURE__ */ jsxs(AlertDialog.Title, { children: [
59
45
  "Delete ",
@@ -72,7 +58,7 @@ function RoutineTopBarActions({ appBarActions, busy, onDelete, editLink, onRun,
72
58
  })] })
73
59
  ]
74
60
  }) })] })
75
- }) : null
61
+ })] }) : null
76
62
  ] });
77
63
  }
78
64
  /**
@@ -81,7 +67,7 @@ function RoutineTopBarActions({ appBarActions, busy, onDelete, editLink, onRun,
81
67
  * authoring routes, and the association between schedules and native runs.
82
68
  * The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
83
69
  * and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
84
- * route and may also use these surfaces independently.
70
+ * and edit routes and may also use these surfaces independently.
85
71
  */
86
72
  function ThinkRoutineLibrary({ bar, className, createRoutineLink, error: catalogError, onDeleteRoutine, onRoutineEnabledChange, onRunRoutine, renderEditRoutineLink, renderRoutineLink, renderRoutineDetail, renderRunLink, ref, routines, selectedRoutineId, showOwner = true, ...props }) {
87
73
  const [busy, setBusy] = React.useState(false);
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { buttonVariants } from "../foundations/Button.js";
3
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
4
3
  import { EmptyState } from "../foundations/EmptyState.js";
4
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
5
5
  import { getThinkExecutionRunAccessibleName, getThinkExecutionRunId, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
6
6
  import { ThinkExecutionRunSummary } from "./ThinkExecutionStatus.js";
7
7
  import * as React from "react";