@mcp-b/react-components 0.43.0 → 0.44.1

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 (116) hide show
  1. package/dist/{CodeBlock-BjELA-_s.js → CodeBlock-Dl7a3Wqo.js} +1 -1
  2. package/dist/{FileTree-DMYRdT6R.js → FileTree-Uu3ZnW1u.js} +1 -1
  3. package/dist/{SetupChecklist-H1JRCIIe.js → SetupChecklist-DOp-zqjh.js} +1 -1
  4. package/dist/{Workspace-F3raHdYV.d.ts → Workspace-jdVZ9S0a.d.ts} +1 -1
  5. package/dist/{WorkspaceFile-BLaFmMrt.d.ts → WorkspaceFile-Dq-GC0_T.d.ts} +3 -1
  6. package/dist/{WorkspaceFileView-DWMKxX_u.js → WorkspaceFileView-BublZXky.js} +2 -2
  7. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  8. package/dist/components/agents-sdk/AgentChat.js +10 -10
  9. package/dist/components/agents-sdk/BrowserLiveScreen.js +4 -1
  10. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  11. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  12. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  13. package/dist/components/agents-sdk/ManagerOffice.js +4 -4
  14. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  15. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  16. package/dist/components/agents-sdk/McpPluginCatalog.js +2 -2
  17. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  18. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  19. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  20. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  21. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  22. package/dist/components/agents-sdk/ThinkChatActivity.js +3 -3
  23. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
  24. package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
  25. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  26. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  27. package/dist/components/agents-sdk/ThinkFullApp.d.ts +2 -2
  28. package/dist/components/agents-sdk/ThinkFullApp.js +1 -1
  29. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +3 -2
  30. package/dist/components/agents-sdk/ThinkRoutine.d.ts +1 -7
  31. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
  32. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +34 -18
  33. package/dist/components/agents-sdk/ThinkRoutineForm.js +395 -110
  34. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +1 -1
  35. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +3 -3
  36. package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
  37. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +4 -4
  38. package/dist/components/agents-sdk/ThinkSidepanel.js +71 -16
  39. package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
  40. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  41. package/dist/components/agents-sdk/Workspace.js +13 -3
  42. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  43. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  44. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
  45. package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
  46. package/dist/components/agents-sdk/WorkspaceFile.d.ts +2 -2
  47. package/dist/components/agents-sdk/WorkspaceFile.js +18 -1
  48. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  49. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  50. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  51. package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
  52. package/dist/components/ai-sdk/Activity.js +1 -1
  53. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  54. package/dist/components/ai-sdk/Approval.js +2 -2
  55. package/dist/components/ai-sdk/Artifact.js +1 -1
  56. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  57. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  58. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  59. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  60. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +106 -0
  61. package/dist/components/ai-sdk/ConnectedAppCards.js +416 -0
  62. package/dist/components/ai-sdk/Conversation.js +1 -1
  63. package/dist/components/ai-sdk/Goal.js +1 -1
  64. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  65. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  66. package/dist/components/ai-sdk/Message.js +1 -1
  67. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  68. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  69. package/dist/components/ai-sdk/Plan.js +1 -1
  70. package/dist/components/ai-sdk/PromptInput.js +3 -3
  71. package/dist/components/ai-sdk/Queue.js +2 -2
  72. package/dist/components/ai-sdk/Reasoning.js +2 -2
  73. package/dist/components/ai-sdk/Sources.js +1 -1
  74. package/dist/components/ai-sdk/Task.js +1 -1
  75. package/dist/components/ai-sdk/ToolInvocation.js +1 -1
  76. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -3
  77. package/dist/components/extension/ChatGptSignInScreen.js +7 -20
  78. package/dist/components/extension/CodexModelSelector.js +2 -2
  79. package/dist/components/extension/ConversationTabPicker.js +2 -2
  80. package/dist/components/foundations/Checkbox.js +1 -1
  81. package/dist/components/foundations/Collapsible.js +1 -1
  82. package/dist/components/foundations/ContextMenu.js +1 -1
  83. package/dist/components/foundations/DescriptionList.d.ts +3 -0
  84. package/dist/components/foundations/DescriptionList.js +2 -1
  85. package/dist/components/foundations/Menubar.js +1 -1
  86. package/dist/components/foundations/SearchField.js +1 -1
  87. package/dist/components/foundations/Select.js +1 -1
  88. package/dist/components/foundations/Stepper.js +1 -1
  89. package/dist/components/foundations/Toast.js +1 -1
  90. package/dist/components/foundations/icons.d.ts +2 -2
  91. package/dist/components/foundations/icons.js +2 -2
  92. package/dist/components/general-purpose/Commit.js +2 -2
  93. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  94. package/dist/components/general-purpose/FileTree.js +1 -1
  95. package/dist/components/general-purpose/PricingPlanCard.js +1 -1
  96. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  97. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  98. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  99. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  100. package/dist/components/general-purpose/Terminal.js +2 -2
  101. package/dist/components/general-purpose/TestResults.js +1 -1
  102. package/dist/components/general-purpose/ThemeModeControl.js +1 -1
  103. package/dist/components/general-purpose/WebPreview.js +2 -2
  104. package/dist/components/nanites/AgentConnection.js +2 -2
  105. package/dist/components/nanites/AgentToolDetail.js +1 -1
  106. package/dist/{copy-button-lys9N_aI.js → copy-button-DHhf-J1d.js} +1 -1
  107. package/dist/{icons-0corjfxR.d.ts → icons-6ZnyZJiR.d.ts} +6 -1
  108. package/dist/{icons-CVFSeTJn.js → icons-Dw-im7lg.js} +4 -3
  109. package/dist/styles/browser-live-screen.css +3 -0
  110. package/dist/styles/button.css +1 -5
  111. package/dist/styles/chatgpt-sign-in-screen.css +87 -43
  112. package/dist/styles/connected-app-card.css +54 -0
  113. package/dist/styles/description-list.css +25 -0
  114. package/dist/styles/index.css +1 -0
  115. package/dist/styles/think-routine-library.css +28 -0
  116. package/package.json +2 -2
@@ -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
@@ -54,7 +54,7 @@ interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine>
54
54
  * authoring routes, and the association between schedules and native runs.
55
55
  * The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
56
56
  * and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
57
- * route and may also use these surfaces independently.
57
+ * and edit routes and may also use these surfaces independently.
58
58
  */
59
59
  declare function ThinkRoutineLibrary<TRoutine extends ThinkRoutine = ThinkRoutine>({
60
60
  bar,
@@ -1,9 +1,9 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { K as SpinnerIcon, Q as TrashIcon, R as PencilIcon, 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
4
  import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
5
- import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
6
5
  import { EmptyState } from "../foundations/EmptyState.js";
6
+ import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
7
7
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
8
8
  import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
9
9
  import { AlertDialog } from "../foundations/AlertDialog.js";
@@ -67,7 +67,7 @@ function RoutineTopBarActions({ appBarActions, busy, onDelete, editLink, onRun,
67
67
  * authoring routes, and the association between schedules and native runs.
68
68
  * The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
69
69
  * and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
70
- * route and may also use these surfaces independently.
70
+ * and edit routes and may also use these surfaces independently.
71
71
  */
72
72
  function ThinkRoutineLibrary({ bar, className, createRoutineLink, error: catalogError, onDeleteRoutine, onRoutineEnabledChange, onRunRoutine, renderEditRoutineLink, renderRoutineLink, renderRoutineDetail, renderRunLink, ref, routines, selectedRoutineId, showOwner = true, ...props }) {
73
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";
@@ -100,7 +100,7 @@ interface ThinkSidepanelIdentity {
100
100
  onBind?: () => void | Promise<void>;
101
101
  onUnbind?: () => void | Promise<void>;
102
102
  }
103
- interface ThinkSidepanelProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
103
+ interface ThinkSidepanelProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage, TRoutine extends ThinkRoutine = ThinkRoutine> extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
104
104
  sourceKey: string;
105
105
  view: ThinkSidepanelView;
106
106
  thread?: {
@@ -130,7 +130,7 @@ interface ThinkSidepanelProps<AgentT extends ThinkFullAppAgent<State>, State = u
130
130
  connectingLabel?: string;
131
131
  modelSetup?: ThinkSidepanelModelSetup;
132
132
  start?: ThinkSidepanelStart;
133
- schedules?: ThinkSidepanelSchedules;
133
+ schedules?: ThinkSidepanelSchedules<TRoutine>;
134
134
  agentRun?: ThinkSidepanelAgentRun;
135
135
  /** Host-owned live view. The side panel only frames it. */
136
136
  live?: React.ReactNode;
@@ -140,7 +140,7 @@ interface ThinkSidepanelProps<AgentT extends ThinkFullAppAgent<State>, State = u
140
140
  * conversation plus workbench. Hosts hydrate conversation, workspace,
141
141
  * plugins, and callables. Storybook is the place to iterate the chrome.
142
142
  */
143
- declare function ThinkSidepanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage>({
143
+ declare function ThinkSidepanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage, TRoutine extends ThinkRoutine = ThinkRoutine>({
144
144
  agentRun,
145
145
  appBarLeading,
146
146
  brand,
@@ -168,6 +168,6 @@ declare function ThinkSidepanel<AgentT extends ThinkFullAppAgent<State>, State =
168
168
  view,
169
169
  workspace,
170
170
  ...props
171
- }: ThinkSidepanelProps<AgentT, State, MessageT>): React.JSX.Element;
171
+ }: ThinkSidepanelProps<AgentT, State, MessageT, TRoutine>): React.JSX.Element;
172
172
  //#endregion
173
173
  export { ThinkSidepanel, ThinkSidepanelAgentRun, ThinkSidepanelCompanion, ThinkSidepanelConnection, ThinkSidepanelDestination, ThinkSidepanelFollow, ThinkSidepanelIdentity, ThinkSidepanelModelSetup, ThinkSidepanelPasskeyVault, ThinkSidepanelProps, ThinkSidepanelSchedules, ThinkSidepanelStart, ThinkSidepanelStatus, ThinkSidepanelView };