@crewlethq/ui 0.172.3 → 0.174.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 (185) hide show
  1. package/README.md +19 -2
  2. package/dist/AgentHandoffPanel/index.js +9 -9
  3. package/dist/AgentIdentity/AgentIdentity.d.ts +99 -0
  4. package/dist/AgentIdentity/AgentIdentitySheet.d.ts +126 -0
  5. package/dist/AgentIdentity/index.d.ts +6 -0
  6. package/dist/AgentIdentity/index.js +37 -0
  7. package/dist/AgentIdentity-KQWGKBNT.css +71 -0
  8. package/dist/AgentIdentitySheet-D2T7ELGN.css +35 -0
  9. package/dist/AppShell/index.js +1 -1
  10. package/dist/ArrangeFrame/index.js +2 -2
  11. package/dist/ArrangeList/index.js +6 -6
  12. package/dist/ArtifactBar/index.js +6 -6
  13. package/dist/ArtifactCard/index.js +6 -6
  14. package/dist/AuthLayout/index.js +1 -1
  15. package/dist/AvatarPicker/index.js +7 -7
  16. package/dist/BriefCard/index.js +3 -3
  17. package/dist/CheckGrid/index.js +4 -4
  18. package/dist/Checkbox/index.js +3 -3
  19. package/dist/ChipField/index.js +2 -2
  20. package/dist/ColorField/index.js +3 -3
  21. package/dist/ColorSwatch/index.js +2 -2
  22. package/dist/Combobox/index.js +4 -4
  23. package/dist/CommandPalette/index.js +6 -6
  24. package/dist/CommentThread/index.js +7 -7
  25. package/dist/Composer/index.js +6 -6
  26. package/dist/ConfirmField/index.js +3 -3
  27. package/dist/ContrastHelp/index.js +1 -1
  28. package/dist/DataGrid/index.js +7 -7
  29. package/dist/DataTable/index.js +7 -7
  30. package/dist/DataView/index.js +9 -9
  31. package/dist/DatasetSource/index.js +3 -3
  32. package/dist/DeepWorkCard/index.js +4 -4
  33. package/dist/DocTabsEditor/index.js +5 -5
  34. package/dist/DurationField/index.js +10 -10
  35. package/dist/{Editor-654ZX3FX.js → Editor-5CCI3MTW.js} +2 -2
  36. package/dist/EmojiPicker/index.js +3 -3
  37. package/dist/EntityList/index.js +3 -3
  38. package/dist/GraphCanvas/index.js +1 -1
  39. package/dist/HuePicker/index.js +5 -5
  40. package/dist/InboxList/index.js +2 -2
  41. package/dist/InlineEditor/index.js +1 -1
  42. package/dist/Input/index.js +2 -2
  43. package/dist/KeyValueRows/index.js +3 -3
  44. package/dist/Link/index.js +1 -1
  45. package/dist/ListInput/index.js +6 -6
  46. package/dist/LogoSlot/index.js +2 -2
  47. package/dist/MarkdownEditor/index.js +5 -5
  48. package/dist/MemberPicker/index.js +4 -4
  49. package/dist/MergeConflicts/index.js +5 -5
  50. package/dist/MessageActions/index.js +4 -4
  51. package/dist/MoneyField/index.js +3 -3
  52. package/dist/NumberField/index.js +8 -8
  53. package/dist/ObjectHeader/index.js +2 -2
  54. package/dist/OpenInAppCard/index.js +3 -3
  55. package/dist/OrgTable/index.js +9 -9
  56. package/dist/PeekRail/index.js +1 -1
  57. package/dist/PresetChips/index.js +5 -5
  58. package/dist/PrincipalPicker/index.js +5 -5
  59. package/dist/PropertyList/index.js +3 -3
  60. package/dist/ProposalCard/index.js +11 -11
  61. package/dist/RailList/index.js +5 -5
  62. package/dist/ReactionBar/index.js +4 -4
  63. package/dist/RefusalCard/index.js +3 -3
  64. package/dist/ResultTableCard/index.js +4 -4
  65. package/dist/RichEditor/index.js +2 -2
  66. package/dist/SandboxedFrame/index.js +2 -2
  67. package/dist/ScopeList/ScopeList.d.ts +53 -0
  68. package/dist/ScopeList/index.d.ts +3 -0
  69. package/dist/ScopeList/index.js +23 -0
  70. package/dist/ScopeList-564YHC7Z.css +72 -0
  71. package/dist/SectionFrame/index.js +3 -3
  72. package/dist/SegmentedControl/index.js +4 -4
  73. package/dist/Select/index.js +2 -2
  74. package/dist/SelectionBar/index.js +2 -2
  75. package/dist/SettingForm/index.js +3 -3
  76. package/dist/SetupWizard/index.js +3 -3
  77. package/dist/ShareDialog/index.js +9 -9
  78. package/dist/SheetColumnEditor/index.js +11 -11
  79. package/dist/SheetGrid/index.js +4 -4
  80. package/dist/SidebarNav/index.js +2 -2
  81. package/dist/SlideFilmstrip/index.js +1 -1
  82. package/dist/StatusCard/index.js +2 -2
  83. package/dist/Switcher/index.js +6 -6
  84. package/dist/TableCells/index.js +5 -5
  85. package/dist/Tabs/index.js +3 -3
  86. package/dist/TagsInput/index.js +2 -2
  87. package/dist/ThemeGallery/index.js +2 -2
  88. package/dist/ThemeSwitcher/index.js +5 -5
  89. package/dist/ThreadSummary/index.js +3 -3
  90. package/dist/TimeRangePicker/index.js +9 -9
  91. package/dist/TimeWindowPicker/index.js +5 -5
  92. package/dist/ToolCallLog/index.js +5 -5
  93. package/dist/TreeGrid/index.js +8 -8
  94. package/dist/ValueField/index.js +6 -6
  95. package/dist/VendorText/VendorText.d.ts +57 -0
  96. package/dist/VendorText/index.d.ts +3 -0
  97. package/dist/VendorText/index.js +4 -0
  98. package/dist/VendorText-ET5DJY5Y.css +29 -0
  99. package/dist/VersionCompare/index.js +6 -6
  100. package/dist/{chunk-A3C7WRXS.js → chunk-2CMCAUMU.js} +1 -1
  101. package/dist/{chunk-ULH34BBV.js → chunk-34TT4WFW.js} +3 -3
  102. package/dist/{chunk-ERZ6RXM5.js → chunk-3EVWDE6G.js} +2 -2
  103. package/dist/{chunk-VQ6BPJIE.js → chunk-3JKNHTOD.js} +1 -1
  104. package/dist/{chunk-LETBMYJG.js → chunk-3K6AANRY.js} +2 -2
  105. package/dist/{chunk-KZS4BOXC.js → chunk-3SJMAV7X.js} +1 -1
  106. package/dist/{chunk-6D2GT6FR.js → chunk-46MPHLOO.js} +1 -1
  107. package/dist/{chunk-MYA4J3CW.js → chunk-4Q2YPSTX.js} +1 -1
  108. package/dist/{chunk-SQX5NRIC.js → chunk-4UBZQ6N6.js} +1 -1
  109. package/dist/{chunk-4NIIN32I.js → chunk-5CRBQDDG.js} +2 -2
  110. package/dist/{chunk-EAOB4QGU.js → chunk-5EGST7S2.js} +1 -1
  111. package/dist/{chunk-LM5JYFDV.js → chunk-5VC7R3FU.js} +3 -3
  112. package/dist/{chunk-L5NEDJC2.js → chunk-6LVS24FG.js} +1 -1
  113. package/dist/{chunk-N46I6MJG.js → chunk-6MMONW2C.js} +1 -1
  114. package/dist/{chunk-UTWH3INB.js → chunk-7D237RNS.js} +1 -1
  115. package/dist/{chunk-FXWRSFCQ.js → chunk-7ICNNHQ2.js} +1 -1
  116. package/dist/{chunk-426IGR6U.js → chunk-AWSJWWR4.js} +3 -3
  117. package/dist/chunk-B3UALXOX.js +45 -0
  118. package/dist/{chunk-L4O3X33G.js → chunk-CZLKGR6J.js} +2 -2
  119. package/dist/{chunk-52DWLGLR.js → chunk-DBA62TC4.js} +1 -1
  120. package/dist/{chunk-7HZIH6Q2.js → chunk-DPWURYRT.js} +1 -1
  121. package/dist/{chunk-N6DX2HMU.js → chunk-EL5O66EH.js} +1 -1
  122. package/dist/{chunk-S7PWRGW3.js → chunk-EQFT236C.js} +1 -1
  123. package/dist/{chunk-D547BNT6.js → chunk-ETTNLZ4W.js} +1 -1
  124. package/dist/{chunk-YDCH6B75.js → chunk-FN4YNFB3.js} +2 -2
  125. package/dist/{chunk-N2DCSSYC.js → chunk-FPQHRX6W.js} +2 -2
  126. package/dist/{chunk-P5DKWJMS.js → chunk-G7VWWNT5.js} +1 -1
  127. package/dist/{chunk-5QFS54ET.js → chunk-GEISX6VZ.js} +3 -3
  128. package/dist/{chunk-AYVISS4N.js → chunk-GPYBH5E3.js} +1 -1
  129. package/dist/{chunk-3WRXDEO6.js → chunk-I3MHYEWJ.js} +1 -1
  130. package/dist/chunk-JE2D3ZHY.js +392 -0
  131. package/dist/{chunk-WPFK5F4Q.js → chunk-JWS6ZNKP.js} +3 -3
  132. package/dist/{chunk-UTKI2SAM.js → chunk-MGJAOLZC.js} +1 -1
  133. package/dist/{chunk-CZILK3UO.js → chunk-MRYVNY4C.js} +1 -1
  134. package/dist/{chunk-NDRLHXSQ.js → chunk-MTOZXIDK.js} +2 -2
  135. package/dist/{chunk-MGNH3R7L.js → chunk-MUAHR6ZE.js} +4 -4
  136. package/dist/{chunk-BO44T7YG.js → chunk-MUP5RPVW.js} +1 -1
  137. package/dist/{chunk-XGEA4WD6.js → chunk-NVQERXLE.js} +1 -1
  138. package/dist/{chunk-5CHGZYR4.js → chunk-O6LCIFB6.js} +2 -2
  139. package/dist/{chunk-IZ3RMACF.js → chunk-P4RDLHFP.js} +4 -4
  140. package/dist/{chunk-Y74VJ4MO.js → chunk-QMR6QF26.js} +2 -2
  141. package/dist/{chunk-Q3VLXNY4.js → chunk-QPW7CNEH.js} +2 -2
  142. package/dist/{chunk-V4FYSUBJ.js → chunk-QXXF5JHD.js} +1 -1
  143. package/dist/{chunk-7ZCIV3FC.js → chunk-RFGE3ML2.js} +1 -1
  144. package/dist/{chunk-I76M3NYU.js → chunk-S2JCOH6O.js} +1 -1
  145. package/dist/{chunk-KAU5SCUQ.js → chunk-S3ZQIFKY.js} +1 -1
  146. package/dist/{chunk-E7L4N2PY.js → chunk-SOIB6MTQ.js} +1 -1
  147. package/dist/{chunk-OGLVYWQ7.js → chunk-SUGJVKJB.js} +2 -2
  148. package/dist/{chunk-YNW3MRJB.js → chunk-T5JTMBMR.js} +2 -2
  149. package/dist/{chunk-ZBA26C6D.js → chunk-T7VM6LZD.js} +1 -1
  150. package/dist/{chunk-55HBOEXP.js → chunk-TQQSOCLB.js} +1 -1
  151. package/dist/{chunk-WZI243SV.js → chunk-TWLDN72S.js} +2 -2
  152. package/dist/{chunk-NRDXN56K.js → chunk-U5CKHHMM.js} +2 -2
  153. package/dist/chunk-U5DR6CPW.js +92 -0
  154. package/dist/{chunk-JBJPBJQC.js → chunk-UBUEXOYL.js} +2 -2
  155. package/dist/{chunk-FIMLIPFC.js → chunk-UR6LTDKJ.js} +1 -1
  156. package/dist/{chunk-JO3IBN3U.js → chunk-VZUWSL6X.js} +3 -3
  157. package/dist/{chunk-FUQT447B.js → chunk-WDJP4UFS.js} +4 -4
  158. package/dist/{chunk-634JKVMX.js → chunk-XP7Q37EM.js} +1 -1
  159. package/dist/{chunk-W443OSWT.js → chunk-XVT4KMM4.js} +1 -1
  160. package/dist/generated/index.d.ts +3 -0
  161. package/dist/generated/index.js +122 -119
  162. package/dist/index.js +122 -119
  163. package/dist/styles.css +219 -0
  164. package/dist/utils/index.js +1 -1
  165. package/package.json +3 -3
  166. package/dist/{chunk-S4FECSRN.js → chunk-3GD5T5WY.js} +1 -1
  167. package/dist/{chunk-ZFU3NPMI.js → chunk-5S6RR33T.js} +1 -1
  168. package/dist/{chunk-OYTJ4AWU.js → chunk-5XW77HAT.js} +1 -1
  169. package/dist/{chunk-FXAV22EB.js → chunk-B7JCU45M.js} +1 -1
  170. package/dist/{chunk-BPR6WAZV.js → chunk-BI23HYLK.js} +0 -0
  171. package/dist/{chunk-657WR3MX.js → chunk-D5UVJL4I.js} +1 -1
  172. package/dist/{chunk-R2R7IKQ6.js → chunk-F7BTJM55.js} +1 -1
  173. package/dist/{chunk-KZ67NXBY.js → chunk-JBDTBWP3.js} +1 -1
  174. package/dist/{chunk-Z226JFUB.js → chunk-JBIIOFJE.js} +1 -1
  175. package/dist/{chunk-AJFSN642.js → chunk-JR4D3ROS.js} +2 -2
  176. package/dist/{chunk-ITFAH735.js → chunk-L4BKQVXX.js} +1 -1
  177. package/dist/{chunk-Z534PYDT.js → chunk-MENY4GKL.js} +1 -1
  178. package/dist/{chunk-3ZBYTHLJ.js → chunk-RS2XGKHL.js} +1 -1
  179. package/dist/{chunk-HM3HM3OF.js → chunk-U7PELDBC.js} +1 -1
  180. package/dist/{chunk-XJEAJ6KD.js → chunk-UMZIPJ54.js} +1 -1
  181. package/dist/{chunk-DWDL5ZAJ.js → chunk-UZ7JIUAL.js} +1 -1
  182. package/dist/{chunk-GXX6B5XM.js → chunk-WDYEM22W.js} +2 -2
  183. package/dist/{chunk-W3PSFOH2.js → chunk-XZOPCQUI.js} +1 -1
  184. package/dist/{chunk-NFGDQQPN.js → chunk-YDUXCCW7.js} +1 -1
  185. package/dist/{chunk-ZQE2BHQA.js → chunk-YLZHTTHW.js} +1 -1
@@ -0,0 +1,392 @@
1
+ import { List, ListItem } from './chunk-GAQU5V5R.js';
2
+ import { FileDrop, FilePickButton } from './chunk-C7YE4L5Y.js';
3
+ import { StepList, Stepper } from './chunk-2MN3RNRM.js';
4
+ import { Modal } from './chunk-HHV5WHTT.js';
5
+ import { Copyable } from './chunk-S5W7EIVC.js';
6
+ import { Callout } from './chunk-I4NRQIRF.js';
7
+ import { Tag } from './chunk-HOIZJFYS.js';
8
+ import { Text } from './chunk-475DOAWF.js';
9
+ import { Disclosure } from './chunk-RUROK3EU.js';
10
+ import { FormField, Input } from './chunk-UZ7JIUAL.js';
11
+ import { Button, ButtonLink } from './chunk-34K3XN47.js';
12
+ import { cx } from './chunk-ODEQTPFM.js';
13
+ import './AgentIdentity-KQWGKBNT.css';
14
+ import './AgentIdentitySheet-D2T7ELGN.css';
15
+ import { useId, useState, useRef, useEffect } from 'react';
16
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
17
+
18
+ var AGENT_IDENTITY_STATES = [
19
+ "company",
20
+ "none",
21
+ "checking",
22
+ "ready",
23
+ "wrong_role",
24
+ "wrong_team",
25
+ "refused",
26
+ "replacing"
27
+ ];
28
+ var AGENT_IDENTITY_CHIPS = {
29
+ company: { label: "Company's", tone: "neutral" },
30
+ none: { label: "Not set up", tone: "warning" },
31
+ checking: { label: "Checking", tone: "info" },
32
+ ready: { label: "Ready", tone: "success" },
33
+ wrong_role: { label: "Wrong role", tone: "warning" },
34
+ wrong_team: { label: "Wrong team", tone: "danger" },
35
+ refused: { label: "Refused", tone: "danger" },
36
+ replacing: { label: "Replacing", tone: "warning" }
37
+ };
38
+ var AGENT_IDENTITY_WORDS = {
39
+ setUp: "Set up identity",
40
+ replace: "Replace identity",
41
+ useCompany: "Use the company's for now",
42
+ makeForMe: "Make it for me"
43
+ };
44
+ var AGENT_IDENTITY_NEEDS_YOU = { label: "Needs you", tone: "warning" };
45
+ function agentIdentityNeedsSetUp(state) {
46
+ return state === "company" || state === "none" || state === "wrong_role" || state === "wrong_team" || state === "refused";
47
+ }
48
+ function agentIdentityNeedsYou(state, perAgent) {
49
+ return perAgent && state !== "ready";
50
+ }
51
+ function AgentIdentity({
52
+ vendor,
53
+ agent,
54
+ state,
55
+ perAgent = true,
56
+ summary,
57
+ problem,
58
+ onSetUp,
59
+ onUseCompany,
60
+ disabledReason,
61
+ className,
62
+ ...rest
63
+ }) {
64
+ const titleId = useId();
65
+ const chip = AGENT_IDENTITY_CHIPS[state];
66
+ const setUp = perAgent && agentIdentityNeedsSetUp(state);
67
+ const replace = perAgent && state === "ready";
68
+ const primary = onSetUp && (setUp || replace) ? setUp ? AGENT_IDENTITY_WORDS.setUp : AGENT_IDENTITY_WORDS.replace : null;
69
+ const company = perAgent && onUseCompany && state === "refused";
70
+ return /* @__PURE__ */ jsxs(
71
+ "section",
72
+ {
73
+ ...rest,
74
+ className: cx("crewlet-agent-identity", className),
75
+ "aria-labelledby": titleId,
76
+ "data-state": state,
77
+ children: [
78
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-agent-identity__head", children: [
79
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-agent-identity__title", children: [
80
+ /* @__PURE__ */ jsxs(Text, { id: titleId, variant: "label", children: [
81
+ "Identity at ",
82
+ vendor
83
+ ] }),
84
+ /* @__PURE__ */ jsx(Tag, { size: "sm", variant: chip.tone, children: chip.label })
85
+ ] }),
86
+ primary || company ? /* @__PURE__ */ jsxs("span", { className: "crewlet-agent-identity__actions", children: [
87
+ company ? /* @__PURE__ */ jsx(
88
+ Button,
89
+ {
90
+ size: "small",
91
+ variant: "ghost",
92
+ onClick: onUseCompany,
93
+ disabledReason,
94
+ "aria-label": `${AGENT_IDENTITY_WORDS.useCompany}: ${agent}`,
95
+ children: AGENT_IDENTITY_WORDS.useCompany
96
+ }
97
+ ) : null,
98
+ primary ? /* @__PURE__ */ jsx(
99
+ Button,
100
+ {
101
+ size: "small",
102
+ variant: setUp ? "primary" : "secondary",
103
+ onClick: onSetUp,
104
+ disabledReason,
105
+ "aria-label": `${primary}: ${agent}`,
106
+ children: primary
107
+ }
108
+ ) : null
109
+ ] }) : null
110
+ ] }),
111
+ /* @__PURE__ */ jsx(Text, { as: "p", variant: "caption", tone: "secondary", className: "crewlet-agent-identity__summary", children: summary }),
112
+ problem ? /* @__PURE__ */ jsx(Callout, { variant: chip.tone === "danger" ? "danger" : "warning", title: problem.title, action: problem.action, children: problem.body }) : null
113
+ ]
114
+ }
115
+ );
116
+ }
117
+ function AgentIdentitySheet(props) {
118
+ return props.open ? /* @__PURE__ */ jsx(Walk, { ...props }) : null;
119
+ }
120
+ var STEPS = ["vendor", "back", "check"];
121
+ function accepted(name, accept) {
122
+ const extensions = accept.split(",").map((e) => e.trim().toLowerCase()).filter((e) => e.startsWith("."));
123
+ return extensions.length === 0 || extensions.some((e) => name.toLowerCase().endsWith(e));
124
+ }
125
+ function messageOf(error) {
126
+ if (error instanceof Error && error.message) return error.message;
127
+ if (typeof error === "string" && error) return error;
128
+ return null;
129
+ }
130
+ function Walk({
131
+ onClose,
132
+ agent,
133
+ vendor,
134
+ why,
135
+ replacing,
136
+ steps,
137
+ link,
138
+ note,
139
+ caution,
140
+ make,
141
+ handIn,
142
+ reads,
143
+ onCheck,
144
+ startAt = "vendor",
145
+ modal: Dialog = Modal
146
+ }) {
147
+ const [step, setStep] = useState(startAt);
148
+ const [reached, setReached] = useState(startAt);
149
+ const [file, setFile] = useState(null);
150
+ const [fileError, setFileError] = useState(null);
151
+ const [field, setField] = useState("");
152
+ const [token, setToken] = useState("");
153
+ const [made, setMade] = useState(false);
154
+ const [running, setRunning] = useState(false);
155
+ const [verdict, setVerdict] = useState(null);
156
+ const [unfinished, setUnfinished] = useState(false);
157
+ const run = useRef(0);
158
+ useEffect(
159
+ () => () => {
160
+ run.current += 1;
161
+ },
162
+ []
163
+ );
164
+ const region = useRef(null);
165
+ const shown = useRef(step);
166
+ useEffect(() => {
167
+ if (shown.current === step) return;
168
+ shown.current = step;
169
+ region.current?.focus({ preventScroll: true });
170
+ }, [step]);
171
+ const makeable = make !== void 0 && !make.disabledReason;
172
+ const go = (id) => {
173
+ setStep(id);
174
+ if (STEPS.indexOf(id) > STEPS.indexOf(reached)) setReached(id);
175
+ };
176
+ const check = (byMaking) => {
177
+ if (running) return;
178
+ const mine = ++run.current;
179
+ setMade(byMaking);
180
+ setVerdict(null);
181
+ setUnfinished(false);
182
+ setRunning(true);
183
+ go("check");
184
+ const brought = byMaking ? { made: true } : {
185
+ made: false,
186
+ ...handIn.kind === "file" && file ? { file: file.file } : {},
187
+ ...handIn.kind === "file" && handIn.field && field.trim() ? { field: field.trim() } : {},
188
+ ...handIn.kind === "token" && token.trim() ? { token: token.trim() } : {}
189
+ };
190
+ const settle = (answer2, threw = false) => {
191
+ if (run.current !== mine) return;
192
+ setVerdict(answer2);
193
+ setUnfinished(threw);
194
+ setRunning(false);
195
+ if (answer2.ok) setToken("");
196
+ };
197
+ let answer;
198
+ try {
199
+ answer = onCheck(brought);
200
+ } catch (error) {
201
+ answer = Promise.reject(error);
202
+ }
203
+ answer.then(
204
+ (verdict2) => settle(verdict2),
205
+ (error) => settle(
206
+ {
207
+ ok: false,
208
+ view: /* @__PURE__ */ jsx(Callout, { variant: "danger", title: "The check did not finish", children: messageOf(error) ?? "Crewlet kept nothing. Try again." })
209
+ },
210
+ true
211
+ )
212
+ );
213
+ };
214
+ const again = () => {
215
+ run.current += 1;
216
+ setVerdict(null);
217
+ setUnfinished(false);
218
+ setRunning(false);
219
+ setFile(null);
220
+ setFileError(null);
221
+ setField("");
222
+ setToken("");
223
+ const back = made || handIn.kind === "nothing" ? "vendor" : "back";
224
+ setMade(false);
225
+ setStep(back);
226
+ setReached(back);
227
+ };
228
+ const pick = (files) => {
229
+ const picked = files[0];
230
+ if (!picked || handIn.kind !== "file") return;
231
+ if (!accepted(picked.file.name, handIn.accept)) {
232
+ setFileError(`Choose the ${handIn.accept} file ${vendor} gave you.`);
233
+ setFile(null);
234
+ setField("");
235
+ return;
236
+ }
237
+ setFileError(null);
238
+ setFile(picked);
239
+ setField(handIn.field?.fromName?.exec(picked.file.name)?.[1] ?? "");
240
+ };
241
+ const listed = made ? [...make?.reads ?? [], ...reads] : reads;
242
+ const failed = verdict !== null && !verdict.ok;
243
+ const failedIndex = failed ? (() => {
244
+ const at = listed.findIndex((r) => r.id === verdict.failedAt);
245
+ return at >= 0 ? at : listed.length - 1;
246
+ })() : -1;
247
+ const readSteps = listed.map((r, i) => {
248
+ let state;
249
+ if (running) state = i === 0 ? "running" : "pending";
250
+ else if (!verdict) state = "pending";
251
+ else if (unfinished) state = "stopped";
252
+ else if (verdict.ok) state = "done";
253
+ else state = i < failedIndex ? "done" : i === failedIndex ? "failed" : "pending";
254
+ return { id: r.id, label: r.label, state };
255
+ });
256
+ const vendorSteps = /* @__PURE__ */ jsx(VendorSteps, { steps, link });
257
+ const content = {
258
+ vendor: /* @__PURE__ */ jsxs(Fragment, { children: [
259
+ caution,
260
+ make ? /* @__PURE__ */ jsx(
261
+ Callout,
262
+ {
263
+ variant: "info",
264
+ title: make.title,
265
+ action: /* @__PURE__ */ jsx(Button, { size: "small", variant: "primary", disabledReason: make.disabledReason, onClick: () => check(true), children: AGENT_IDENTITY_WORDS.makeForMe }),
266
+ children: make.body
267
+ }
268
+ ) : null,
269
+ makeable ? /* @__PURE__ */ jsx(Disclosure, { title: `Or make it by hand at ${vendor}`, size: "compact", children: vendorSteps }) : vendorSteps,
270
+ note ? /* @__PURE__ */ jsx(Text, { as: "p", variant: "caption", tone: "secondary", className: "crewlet-agent-identity-sheet__note", children: note }) : null
271
+ ] }),
272
+ back: handIn.kind === "file" ? /* @__PURE__ */ jsxs(Fragment, { children: [
273
+ /* @__PURE__ */ jsx(FormField, { label: "The file", hideLabel: true, error: fileError ?? void 0, children: /* @__PURE__ */ jsx(
274
+ FileDrop,
275
+ {
276
+ title: file ? file.file.name : "Drop the file here",
277
+ hint: file ? "Chosen. Crewlet reads it once, then seals it." : handIn.hint,
278
+ onFiles: pick,
279
+ actions: /* @__PURE__ */ jsx(FilePickButton, { size: "small", variant: "secondary", accept: handIn.accept, multiple: false, onFiles: pick, children: file ? "Choose another file" : "Choose file" })
280
+ }
281
+ ) }),
282
+ handIn.field ? /* @__PURE__ */ jsx(FormField, { label: handIn.field.label, helper: handIn.field.fromName ? "Read from the file's name." : void 0, children: ({ id, describedBy }) => /* @__PURE__ */ jsx(
283
+ Input,
284
+ {
285
+ id,
286
+ value: field,
287
+ "aria-describedby": describedBy,
288
+ autoComplete: "off",
289
+ spellCheck: false,
290
+ onChange: (e) => setField(e.target.value)
291
+ }
292
+ ) }) : null
293
+ ] }) : handIn.kind === "token" ? /* @__PURE__ */ jsx(FormField, { label: handIn.label, helper: handIn.hint, children: ({ id, describedBy }) => /* @__PURE__ */ jsx(
294
+ Input,
295
+ {
296
+ id,
297
+ type: "password",
298
+ value: token,
299
+ "aria-describedby": describedBy,
300
+ autoComplete: "off",
301
+ spellCheck: false,
302
+ onChange: (e) => setToken(e.target.value)
303
+ }
304
+ ) }) : /* @__PURE__ */ jsx(Text, { as: "p", children: handIn.text }),
305
+ check: /* @__PURE__ */ jsxs(Fragment, { children: [
306
+ /* @__PURE__ */ jsx(StepList, { label: `Checking ${agent}'s identity at ${vendor}`, steps: readSteps }),
307
+ /* @__PURE__ */ jsx("div", { className: "crewlet-agent-identity-sheet__verdict", "aria-live": "polite", children: verdict?.view })
308
+ ] })
309
+ };
310
+ const labels = {
311
+ vendor: { label: `At ${vendor}`, description: makeable ? "Crewlet can make it" : "Make it there" },
312
+ back: {
313
+ label: "Back here",
314
+ description: made || handIn.kind === "nothing" ? "Nothing to bring" : handIn.kind === "file" ? "Choose the file" : "Paste it"
315
+ },
316
+ check: { label: "Check", description: "Crewlet reads it and keeps it" }
317
+ };
318
+ const ready = handIn.kind === "file" ? file !== null && (!handIn.field || field.trim() !== "") : handIn.kind === "token" ? token.trim() !== "" : true;
319
+ const notReady = handIn.kind === "file" ? file === null ? "Choose the file first." : `Fill in the ${handIn.field?.label ?? "value"} first.` : "Paste it first.";
320
+ const index = STEPS.indexOf(step);
321
+ const done = verdict?.ok === true;
322
+ const footer = /* @__PURE__ */ jsxs(Fragment, { children: [
323
+ !done && (failed || step === "vendor") ? /* @__PURE__ */ jsx(Button, { size: "small", variant: "ghost", onClick: onClose, children: "Close" }) : null,
324
+ !done && index > 0 && !running && !failed ? /* @__PURE__ */ jsx(Button, { size: "small", variant: "ghost", onClick: () => setStep(STEPS[index - 1]), children: "Back" }) : null,
325
+ done ? /* @__PURE__ */ jsx(Button, { size: "small", variant: "primary", onClick: onClose, children: "Done" }) : failed ? /* @__PURE__ */ jsx(Button, { size: "small", variant: "primary", onClick: again, children: "Try again" }) : step === "vendor" ? (
326
+ // ONE PRIMARY PER VIEW: beside Make it for me, going by hand is the quiet choice.
327
+ /* @__PURE__ */ jsx(Button, { size: "small", variant: makeable ? "secondary" : "primary", onClick: () => go("back"), children: makeable ? "I made it by hand" : "Next" })
328
+ ) : step === "back" ? /* @__PURE__ */ jsx(
329
+ Button,
330
+ {
331
+ size: "small",
332
+ variant: "primary",
333
+ disabledReason: ready ? void 0 : notReady,
334
+ onClick: () => check(false),
335
+ children: "Check"
336
+ }
337
+ ) : /* @__PURE__ */ jsx(Button, { size: "small", variant: "primary", loading: true, children: "Check" })
338
+ ] });
339
+ return /* @__PURE__ */ jsxs(
340
+ Dialog,
341
+ {
342
+ open: true,
343
+ variant: "sheet",
344
+ size: "md",
345
+ stackBody: true,
346
+ onClose,
347
+ title: `${replacing ? AGENT_IDENTITY_WORDS.replace : AGENT_IDENTITY_WORDS.setUp}: ${agent}`,
348
+ subtitle: why,
349
+ footer,
350
+ className: "crewlet-agent-identity-sheet",
351
+ children: [
352
+ /* @__PURE__ */ jsx(
353
+ Stepper,
354
+ {
355
+ orientation: "vertical",
356
+ label: `Setting up ${agent}'s identity at ${vendor}`,
357
+ steps: STEPS.map((id) => ({ id, ...labels[id] })),
358
+ current: done ? null : step,
359
+ tone: failed ? "danger" : "info",
360
+ reached,
361
+ onSelect: running || verdict ? void 0 : (id) => setStep(id)
362
+ }
363
+ ),
364
+ /* @__PURE__ */ jsx(
365
+ "section",
366
+ {
367
+ ref: region,
368
+ tabIndex: -1,
369
+ className: "crewlet-agent-identity-sheet__step",
370
+ "aria-label": labels[step].label,
371
+ children: content[step]
372
+ }
373
+ )
374
+ ]
375
+ }
376
+ );
377
+ }
378
+ function VendorSteps({
379
+ steps,
380
+ link
381
+ }) {
382
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
383
+ /* @__PURE__ */ jsx(List, { variant: "numbered", className: "crewlet-agent-identity-sheet__steps", children: steps.map((s, i) => /* @__PURE__ */ jsx(ListItem, { children: s.copy ? /* @__PURE__ */ jsxs("span", { className: "crewlet-agent-identity-sheet__copy", children: [
384
+ /* @__PURE__ */ jsx("span", { children: s.text }),
385
+ /* @__PURE__ */ jsx(Copyable, { variant: "block", monospace: true, value: s.copy.value, ariaLabel: `Copy the ${s.copy.label}` }),
386
+ s.copy.rule ? /* @__PURE__ */ jsx(Text, { variant: "caption", tone: "secondary", children: s.copy.rule }) : null
387
+ ] }) : s.text }, i)) }),
388
+ link ? /* @__PURE__ */ jsx("span", { className: "crewlet-agent-identity-sheet__link", children: /* @__PURE__ */ jsx(ButtonLink, { size: "small", variant: "secondary", href: link.href, external: true, children: link.label }) }) : null
389
+ ] });
390
+ }
391
+
392
+ export { AGENT_IDENTITY_CHIPS, AGENT_IDENTITY_NEEDS_YOU, AGENT_IDENTITY_STATES, AGENT_IDENTITY_WORDS, AgentIdentity, AgentIdentitySheet, agentIdentityNeedsSetUp, agentIdentityNeedsYou };
@@ -1,9 +1,9 @@
1
- import { Select } from './chunk-657WR3MX.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
+ import { PrincipalAvatar } from './chunk-265IX4YA.js';
3
+ import { useMediaMatch } from './chunk-COS6LJ4K.js';
2
4
  import { Modal } from './chunk-HHV5WHTT.js';
3
5
  import { CopyButton } from './chunk-HUIAYSOC.js';
4
6
  import { Callout } from './chunk-I4NRQIRF.js';
5
- import { PrincipalAvatar } from './chunk-265IX4YA.js';
6
- import { useMediaMatch } from './chunk-COS6LJ4K.js';
7
7
  import { Button } from './chunk-34K3XN47.js';
8
8
  import { IconButton } from './chunk-XHTQ4X4P.js';
9
9
  import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
@@ -31,7 +31,7 @@ var Link = forwardRef(function Link2({
31
31
  " ",
32
32
  /* @__PURE__ */ jsx(VisuallyHidden, { children: newTabLabel })
33
33
  ] }) : null;
34
- const externalAttributes = external ? { target: "_blank", rel: "noreferrer" } : { target: rest.target, rel: rest.rel };
34
+ const externalAttributes = external ? { target: "_blank", rel: "noopener noreferrer" } : { target: rest.target, rel: rest.rel };
35
35
  if (asChild) {
36
36
  const child = Children.only(children);
37
37
  if (!isValidElement(child)) {
@@ -1,5 +1,5 @@
1
1
  import { minorUnits, parseMoney } from './chunk-G6DKKJN6.js';
2
- import { Input } from './chunk-DWDL5ZAJ.js';
2
+ import { Input } from './chunk-UZ7JIUAL.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './MoneyField-4PHZWHJL.css';
5
5
  import { forwardRef, useId } from 'react';
@@ -1,7 +1,7 @@
1
- import { FormField, Label, Input } from './chunk-DWDL5ZAJ.js';
1
+ import { FormField, Label, Input } from './chunk-UZ7JIUAL.js';
2
+ import { announce } from './chunk-WGMKERCR.js';
2
3
  import { Button } from './chunk-34K3XN47.js';
3
4
  import { IconButton } from './chunk-XHTQ4X4P.js';
4
- import { announce } from './chunk-WGMKERCR.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './KeyValueRows-US5KW7JK.css';
7
7
  import { useId, useRef, useEffect } from 'react';
@@ -1,11 +1,11 @@
1
- import { Select } from './chunk-657WR3MX.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
2
  import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
3
- import { HueSwatch } from './chunk-I76M3NYU.js';
3
+ import { HueSwatch } from './chunk-S2JCOH6O.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
5
- import { Checkbox } from './chunk-XGEA4WD6.js';
5
+ import { Checkbox } from './chunk-NVQERXLE.js';
6
6
  import { Menu } from './chunk-EUET4PNC.js';
7
- import { FormField, Input } from './chunk-DWDL5ZAJ.js';
8
7
  import { Kbd } from './chunk-VBBLHS2Y.js';
8
+ import { FormField, Input } from './chunk-UZ7JIUAL.js';
9
9
  import { Button } from './chunk-34K3XN47.js';
10
10
  import { IconButton } from './chunk-XHTQ4X4P.js';
11
11
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,5 +1,5 @@
1
1
  import { InlineCode } from './chunk-W4UJWFCZ.js';
2
- import { FormField, Input } from './chunk-DWDL5ZAJ.js';
2
+ import { FormField, Input } from './chunk-UZ7JIUAL.js';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
 
5
5
  function confirmMatches(typed, phrase) {
@@ -1,4 +1,4 @@
1
- import { FormField } from './chunk-DWDL5ZAJ.js';
1
+ import { FormField } from './chunk-UZ7JIUAL.js';
2
2
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './Checkbox-GAMV2XD7.css';
@@ -1,14 +1,14 @@
1
1
  import { PageHeader } from './chunk-FPDIHEM4.js';
2
2
  import { FilterPill } from './chunk-UL7X5F5W.js';
3
- import { DataTable } from './chunk-5QFS54ET.js';
3
+ import { DataTable } from './chunk-GEISX6VZ.js';
4
4
  import { DateTimePicker } from './chunk-5TQRAZQG.js';
5
5
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
6
6
  import { Toolbar } from './chunk-NPEI2QAN.js';
7
7
  import { Popover } from './chunk-AJFA2XDQ.js';
8
8
  import { RelativeTime } from './chunk-GBKBME7Q.js';
9
9
  import { Menu } from './chunk-EUET4PNC.js';
10
- import { Input } from './chunk-DWDL5ZAJ.js';
11
10
  import { Kbd } from './chunk-VBBLHS2Y.js';
11
+ import { Input } from './chunk-UZ7JIUAL.js';
12
12
  import { Button } from './chunk-34K3XN47.js';
13
13
  import { IconButton } from './chunk-XHTQ4X4P.js';
14
14
  import { Count } from './chunk-6YKTRAWI.js';
@@ -1,14 +1,14 @@
1
- import { Modal } from './chunk-HHV5WHTT.js';
2
1
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
3
2
  import { KeyChip, highlightMatch } from './chunk-HBDA76EZ.js';
4
3
  import { Popover } from './chunk-AJFA2XDQ.js';
5
4
  import { Skeleton } from './chunk-WFAJYBLX.js';
6
- import { Text } from './chunk-475DOAWF.js';
7
- import { Input } from './chunk-DWDL5ZAJ.js';
8
5
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
6
+ import { Modal } from './chunk-HHV5WHTT.js';
7
+ import { Text } from './chunk-475DOAWF.js';
8
+ import { Input } from './chunk-UZ7JIUAL.js';
9
+ import { announce } from './chunk-WGMKERCR.js';
9
10
  import { focusables, isComposing } from './chunk-EDPMHSLZ.js';
10
11
  import { returnFocus } from './chunk-4ITETIGZ.js';
11
- import { announce } from './chunk-WGMKERCR.js';
12
12
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
13
13
  import { cx } from './chunk-ODEQTPFM.js';
14
14
  import './Switcher-MWHFBIWS.css';
@@ -1,7 +1,7 @@
1
+ import { SegmentedControl } from './chunk-I3MHYEWJ.js';
1
2
  import { Modal } from './chunk-HHV5WHTT.js';
2
3
  import { Callout } from './chunk-I4NRQIRF.js';
3
- import { SegmentedControl } from './chunk-3WRXDEO6.js';
4
- import { FormField, Input } from './chunk-DWDL5ZAJ.js';
4
+ import { FormField, Input } from './chunk-UZ7JIUAL.js';
5
5
  import { Button } from './chunk-34K3XN47.js';
6
6
  import { useState } from 'react';
7
7
  import { ClockGlyph } from '@crewlethq/icons/glyphs';
@@ -1,8 +1,8 @@
1
1
  import { Timeline } from './chunk-XDUXAQIS.js';
2
2
  import { Section } from './chunk-WFCWPXJN.js';
3
- import { Composer } from './chunk-N6DX2HMU.js';
4
- import { Disclosure } from './chunk-RUROK3EU.js';
3
+ import { Composer } from './chunk-EL5O66EH.js';
5
4
  import { ArtifactPanel } from './chunk-W4EWRZU4.js';
5
+ import { Disclosure } from './chunk-RUROK3EU.js';
6
6
  import { Button } from './chunk-34K3XN47.js';
7
7
  import { cx } from './chunk-ODEQTPFM.js';
8
8
  import './AgentHandoffPanel-AIU7YWWB.css';
@@ -1,4 +1,4 @@
1
- import { HuePicker } from './chunk-I76M3NYU.js';
1
+ import { HuePicker } from './chunk-S2JCOH6O.js';
2
2
  import { Popover } from './chunk-AJFA2XDQ.js';
3
3
  import { CharacterPicker } from './chunk-CBUAKPF7.js';
4
4
  import { NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
@@ -1,4 +1,4 @@
1
- import { Checkbox } from './chunk-XGEA4WD6.js';
1
+ import { Checkbox } from './chunk-NVQERXLE.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './CheckGrid-B3SRTHOJ.css';
4
4
  import { useId } from 'react';
@@ -1,5 +1,5 @@
1
1
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
2
- import { SegmentedControl } from './chunk-3WRXDEO6.js';
2
+ import { SegmentedControl } from './chunk-I3MHYEWJ.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { useReorder } from './chunk-JMBPMSNI.js';
2
2
  import { Menu } from './chunk-EUET4PNC.js';
3
- import { Input } from './chunk-DWDL5ZAJ.js';
3
+ import { Input } from './chunk-UZ7JIUAL.js';
4
4
  import { IconButton } from './chunk-XHTQ4X4P.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,4 +1,4 @@
1
- import { FormField } from './chunk-DWDL5ZAJ.js';
1
+ import { FormField } from './chunk-UZ7JIUAL.js';
2
2
  import { Button } from './chunk-34K3XN47.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './SettingForm-ODVZZ7JZ.css';
@@ -1,6 +1,6 @@
1
1
  import { Toolbar } from './chunk-NPEI2QAN.js';
2
- import { SegmentedControl } from './chunk-3WRXDEO6.js';
3
- import { tabId } from './chunk-AJFSN642.js';
2
+ import { SegmentedControl } from './chunk-I3MHYEWJ.js';
3
+ import { tabId } from './chunk-JR4D3ROS.js';
4
4
  import { IconButton } from './chunk-XHTQ4X4P.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './MarkdownEditor-BLCJRGDC.css';
@@ -1,5 +1,5 @@
1
- import { SidebarNav, NavItem } from './chunk-R2R7IKQ6.js';
2
- import { Select } from './chunk-657WR3MX.js';
1
+ import { SidebarNav, NavItem } from './chunk-F7BTJM55.js';
2
+ import { Select } from './chunk-D5UVJL4I.js';
3
3
  import { Card } from './chunk-5Y76EWDZ.js';
4
4
  import { Text } from './chunk-475DOAWF.js';
5
5
  import './RailList-PXWNLVOJ.css';
@@ -1,4 +1,4 @@
1
- import { SegmentedControl } from './chunk-3WRXDEO6.js';
1
+ import { SegmentedControl } from './chunk-I3MHYEWJ.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -3,7 +3,7 @@ import { PrincipalAvatar } from './chunk-265IX4YA.js';
3
3
  import { RelativeTime } from './chunk-GBKBME7Q.js';
4
4
  import { Card } from './chunk-5Y76EWDZ.js';
5
5
  import { ArtifactKindGround } from './chunk-W3A6NBUM.js';
6
- import { Checkbox } from './chunk-XGEA4WD6.js';
6
+ import { Checkbox } from './chunk-NVQERXLE.js';
7
7
  import { ArtifactAccessGlyph } from './chunk-DOY3KC6I.js';
8
8
  import { ArtifactKindGlyph } from './chunk-RSKW25Y5.js';
9
9
  import { AvatarStack } from './chunk-JWHXDVN5.js';
@@ -1,6 +1,6 @@
1
1
  import { richEditorLabels } from './chunk-DGXHQMNP.js';
2
- import { Callout } from './chunk-I4NRQIRF.js';
3
2
  import { Skeleton } from './chunk-WFAJYBLX.js';
3
+ import { Callout } from './chunk-I4NRQIRF.js';
4
4
  import { Button } from './chunk-34K3XN47.js';
5
5
  import './RichEditor-5CF3QV3J.css';
6
6
  import { forwardRef, useState, useEffect } from 'react';
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
9
9
  var engine = null;
10
10
  var loading = null;
11
11
  function loadEngine() {
12
- loading ??= import('./Editor-654ZX3FX.js').then(
12
+ loading ??= import('./Editor-5CCI3MTW.js').then(
13
13
  (module) => {
14
14
  engine = module.Editor;
15
15
  return engine;
@@ -1,5 +1,5 @@
1
- import { PresetChips } from './chunk-ZBA26C6D.js';
2
- import { Input } from './chunk-DWDL5ZAJ.js';
1
+ import { PresetChips } from './chunk-T7VM6LZD.js';
2
+ import { Input } from './chunk-UZ7JIUAL.js';
3
3
  import { useFieldError } from './chunk-JLKO7PSK.js';
4
4
  import { IconButton } from './chunk-XHTQ4X4P.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';