@locusgraph/loop 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/agent/pulse/gradient-label.js +12 -62
  2. package/dist/agent/pulse/marks/bars-mark.js +15 -37
  3. package/dist/agent/pulse/marks/glyph-mark.js +15 -54
  4. package/dist/agent/pulse/marks/locus-mark.js +12 -36
  5. package/dist/agent/pulse/marks/orb-mark.js +9 -19
  6. package/dist/agent/pulse/marks/spinner-mark.js +20 -29
  7. package/dist/agent/pulse/pulse.js +36 -123
  8. package/dist/agent/pulse/use-loop-animation.js +12 -33
  9. package/dist/agent/steps/step-icon.js +26 -96
  10. package/dist/agent/steps/steps.js +47 -210
  11. package/dist/agent/thinking/thinking.js +2 -2
  12. package/dist/agent/tool/json-block.js +11 -31
  13. package/dist/agent/tool/tool-status.js +12 -35
  14. package/dist/approval/inbox/inbox-row.js +76 -301
  15. package/dist/approval/inbox/inbox.js +39 -190
  16. package/dist/approval/inbox/virtual-inbox-list.js +26 -102
  17. package/dist/approval/memory/memory-review.js +36 -170
  18. package/dist/approval/memory/memory-row.js +50 -185
  19. package/dist/approval/plan/plan-review.js +73 -223
  20. package/dist/approval/plan/plan-step-row.js +76 -180
  21. package/dist/approval/plan/question-choices.js +44 -130
  22. package/dist/approval/plan/question.js +38 -154
  23. package/dist/approval/run/run-bar.js +39 -123
  24. package/dist/approval/shared/risk-badge.js +9 -24
  25. package/dist/approval/shared/use-focus-on-mount.js +5 -21
  26. package/dist/approval/spend/raise-cap-form.js +48 -221
  27. package/dist/approval/spend/spend-gate.js +40 -155
  28. package/dist/approval/spend/spend-meter.js +86 -313
  29. package/dist/approval/tool/approval.js +35 -194
  30. package/dist/approval/tool/args/args-editor.js +46 -204
  31. package/dist/approval/tool/args/args-field.js +55 -238
  32. package/dist/approval/tool/deny-form.js +36 -123
  33. package/dist/approval/tool/tool-inputs.js +24 -89
  34. package/dist/chat/chat/use-stick-to-bottom.js +60 -113
  35. package/dist/chat/chat/virtual-chat-items.js +34 -127
  36. package/dist/chat/composer/composer-actions.js +46 -129
  37. package/dist/chat/composer/use-auto-grow.js +8 -23
  38. package/dist/chat/files/files.js +66 -291
  39. package/dist/chat/reply/fenced-code.js +10 -32
  40. package/dist/chat/reply/markdown-components.js +2 -2
  41. package/dist/chat/reply/reply.js +24 -99
  42. package/dist/chat/turn/turn.js +46 -197
  43. package/dist/cost/context.js +65 -282
  44. package/dist/cost/cost-steps.js +42 -195
  45. package/dist/cost/cost.js +108 -497
  46. package/dist/cost/model-picker.js +42 -172
  47. package/dist/cost/shared/context-breakdown.js +65 -281
  48. package/dist/cost/shared/meter-marks.js +34 -92
  49. package/dist/cost/shared/model-option-row.js +35 -158
  50. package/dist/cost/shared/step-cost-row.js +37 -222
  51. package/dist/memory/cite.js +58 -179
  52. package/dist/memory/memorized.js +43 -195
  53. package/dist/memory/recall.js +68 -263
  54. package/dist/memory/shared/disclosure.d.ts +2 -2
  55. package/dist/memory/shared/disclosure.js +1 -1
  56. package/dist/memory/shared/source-mark.js +10 -38
  57. package/dist/memory/sources.js +52 -230
  58. package/dist/shared/decision-summary.js +35 -117
  59. package/dist/shared/panel-empty.js +15 -73
  60. package/dist/shared/panel.js +65 -239
  61. package/dist/shared/status-dot.js +10 -32
  62. package/dist/thread/actions/action-button.js +10 -53
  63. package/dist/thread/actions/branch-switcher.js +21 -95
  64. package/dist/thread/canvas/canvas.js +1 -1
  65. package/dist/thread/canvas/version-switcher.js +31 -126
  66. package/dist/thread/code/code.js +2 -2
  67. package/dist/thread/code/copy-code-button.js +24 -56
  68. package/dist/thread/history/history.js +1 -1
  69. package/dist/thread/history/row/history-row.js +18 -97
  70. package/dist/thread/history/row/thread-item-menu.js +19 -72
  71. package/dist/thread/history/row/thread-title-editor.js +29 -72
  72. package/dist/thread/history/virtual-history-list.js +46 -82
  73. package/dist/thread/starters/starters.js +27 -87
  74. package/dist/thread/use-copied.js +10 -38
  75. package/package.json +3 -3
@@ -1,268 +1,85 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { Checkbox, Input, Label, NativeSelect, NativeSelectOption } from "@locusgraph/components";
3
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
3
  function describedBy(id, field, error) {
5
4
  const ids = [field.description && `${id}-hint`, error && `${id}-error`].filter(Boolean);
6
5
  return ids.length > 0 ? ids.join(" ") : undefined;
7
6
  }
8
- function FieldControl(t0) {
9
- const $ = _c(38);
10
- const {
7
+ function FieldControl({
8
+ id,
9
+ field,
10
+ draft,
11
+ error,
12
+ onChange
13
+ }) {
14
+ const shared = {
11
15
  id,
12
- field,
13
- draft,
14
- error,
15
- onChange
16
- } = t0;
17
- const t1 = field.name;
18
- const t2 = error ? true : undefined;
19
- let t3;
20
- if ($[0] !== error || $[1] !== field || $[2] !== id) {
21
- t3 = describedBy(id, field, error);
22
- $[0] = error;
23
- $[1] = field;
24
- $[2] = id;
25
- $[3] = t3;
26
- } else {
27
- t3 = $[3];
28
- }
29
- const t4 = field.required || undefined;
30
- let t5;
31
- if ($[4] !== field.name || $[5] !== id || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
32
- t5 = {
33
- id,
34
- name: t1,
35
- "aria-invalid": t2,
36
- "aria-describedby": t3,
37
- "aria-required": t4
38
- };
39
- $[4] = field.name;
40
- $[5] = id;
41
- $[6] = t2;
42
- $[7] = t3;
43
- $[8] = t4;
44
- $[9] = t5;
45
- } else {
46
- t5 = $[9];
47
- }
48
- const shared = t5;
16
+ name: field.name,
17
+ "aria-invalid": error ? true : undefined,
18
+ "aria-describedby": describedBy(id, field, error),
19
+ "aria-required": field.required || undefined
20
+ };
49
21
  if (field.type === "boolean") {
50
- const t6 = draft === true;
51
- let t7;
52
- if ($[10] !== onChange) {
53
- t7 = checked => onChange(checked === true);
54
- $[10] = onChange;
55
- $[11] = t7;
56
- } else {
57
- t7 = $[11];
58
- }
59
- let t8;
60
- if ($[12] !== shared || $[13] !== t6 || $[14] !== t7) {
61
- t8 = /*#__PURE__*/_jsx(Checkbox, {
62
- ...shared,
63
- checked: t6,
64
- onCheckedChange: t7
65
- });
66
- $[12] = shared;
67
- $[13] = t6;
68
- $[14] = t7;
69
- $[15] = t8;
70
- } else {
71
- t8 = $[15];
72
- }
73
- return t8;
22
+ return /*#__PURE__*/_jsx(Checkbox, {
23
+ ...shared,
24
+ checked: draft === true,
25
+ onCheckedChange: checked => onChange(checked === true)
26
+ });
74
27
  }
75
28
  const text = typeof draft === "string" ? draft : "";
76
29
  if (field.type === "select") {
77
- let t6;
78
- if ($[16] !== onChange) {
79
- t6 = event => onChange(event.target.value);
80
- $[16] = onChange;
81
- $[17] = t6;
82
- } else {
83
- t6 = $[17];
84
- }
85
- let t7;
86
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
87
- t7 = /*#__PURE__*/_jsx(NativeSelectOption, {
88
- value: "",
89
- children: "Choose\u2026"
90
- });
91
- $[18] = t7;
92
- } else {
93
- t7 = $[18];
94
- }
95
- let t8;
96
- if ($[19] !== field.options) {
97
- t8 = field.options ?? [];
98
- $[19] = field.options;
99
- $[20] = t8;
100
- } else {
101
- t8 = $[20];
102
- }
103
- let t9;
104
- if ($[21] !== t8) {
105
- t9 = t8.map(_temp);
106
- $[21] = t8;
107
- $[22] = t9;
108
- } else {
109
- t9 = $[22];
110
- }
111
- let t10;
112
- if ($[23] !== shared || $[24] !== t6 || $[25] !== t9 || $[26] !== text) {
113
- t10 = /*#__PURE__*/_jsxs(NativeSelect, {
114
- ...shared,
115
- value: text,
116
- onChange: t6,
117
- children: [t7, t9]
118
- });
119
- $[23] = shared;
120
- $[24] = t6;
121
- $[25] = t9;
122
- $[26] = text;
123
- $[27] = t10;
124
- } else {
125
- t10 = $[27];
126
- }
127
- return t10;
128
- }
129
- const t6 = field.type === "number" ? "number" : "text";
130
- const t7 = field.type === "number" ? "decimal" : undefined;
131
- let t8;
132
- if ($[28] !== onChange) {
133
- t8 = event_0 => onChange(event_0.target.value);
134
- $[28] = onChange;
135
- $[29] = t8;
136
- } else {
137
- t8 = $[29];
138
- }
139
- let t9;
140
- if ($[30] !== field.max || $[31] !== field.min || $[32] !== shared || $[33] !== t6 || $[34] !== t7 || $[35] !== t8 || $[36] !== text) {
141
- t9 = /*#__PURE__*/_jsx(Input, {
30
+ return /*#__PURE__*/_jsxs(NativeSelect, {
142
31
  ...shared,
143
- type: t6,
144
- inputMode: t7,
145
- min: field.min,
146
- max: field.max,
147
32
  value: text,
148
- onChange: t8
33
+ onChange: event => onChange(event.target.value),
34
+ children: [/*#__PURE__*/_jsx(NativeSelectOption, {
35
+ value: "",
36
+ children: "Choose\u2026"
37
+ }), (field.options ?? []).map(option => /*#__PURE__*/_jsx(NativeSelectOption, {
38
+ value: option.value,
39
+ children: option.label
40
+ }, option.value))]
149
41
  });
150
- $[30] = field.max;
151
- $[31] = field.min;
152
- $[32] = shared;
153
- $[33] = t6;
154
- $[34] = t7;
155
- $[35] = t8;
156
- $[36] = text;
157
- $[37] = t9;
158
- } else {
159
- t9 = $[37];
160
42
  }
161
- return t9;
162
- }
163
- function _temp(option) {
164
- return /*#__PURE__*/_jsx(NativeSelectOption, {
165
- value: option.value,
166
- children: option.label
167
- }, option.value);
43
+ return /*#__PURE__*/_jsx(Input, {
44
+ ...shared,
45
+ type: field.type === "number" ? "number" : "text",
46
+ inputMode: field.type === "number" ? "decimal" : undefined,
47
+ min: field.min,
48
+ max: field.max,
49
+ value: text,
50
+ onChange: event => onChange(event.target.value)
51
+ });
168
52
  }
169
53
  export function ArgsField(props) {
170
- const $ = _c(23);
171
54
  const {
172
55
  id,
173
56
  field,
174
57
  error
175
58
  } = props;
176
59
  const inline = field.type === "boolean";
177
- const t0 = inline ? "flex flex-row-reverse items-center justify-end gap-2" : "contents";
178
- let t1;
179
- if ($[0] !== field.required) {
180
- t1 = field.required && /*#__PURE__*/_jsx("span", {
181
- className: "text-xs font-normal text-muted-foreground",
182
- children: "required"
183
- });
184
- $[0] = field.required;
185
- $[1] = t1;
186
- } else {
187
- t1 = $[1];
188
- }
189
- let t2;
190
- if ($[2] !== field.label || $[3] !== id || $[4] !== t1) {
191
- t2 = /*#__PURE__*/_jsxs(Label, {
192
- htmlFor: id,
193
- children: [field.label, t1]
194
- });
195
- $[2] = field.label;
196
- $[3] = id;
197
- $[4] = t1;
198
- $[5] = t2;
199
- } else {
200
- t2 = $[5];
201
- }
202
- let t3;
203
- if ($[6] !== props) {
204
- t3 = /*#__PURE__*/_jsx(FieldControl, {
205
- ...props
206
- });
207
- $[6] = props;
208
- $[7] = t3;
209
- } else {
210
- t3 = $[7];
211
- }
212
- let t4;
213
- if ($[8] !== t0 || $[9] !== t2 || $[10] !== t3) {
214
- t4 = /*#__PURE__*/_jsxs("div", {
215
- className: t0,
216
- children: [t2, t3]
217
- });
218
- $[8] = t0;
219
- $[9] = t2;
220
- $[10] = t3;
221
- $[11] = t4;
222
- } else {
223
- t4 = $[11];
224
- }
225
- let t5;
226
- if ($[12] !== field.description || $[13] !== id) {
227
- t5 = field.description && /*#__PURE__*/_jsx("p", {
60
+ return /*#__PURE__*/_jsxs("div", {
61
+ "data-slot": "args-field",
62
+ "data-type": field.type,
63
+ className: "flex flex-col gap-1.5 [&_[data-slot=native-select-wrapper]]:w-full",
64
+ children: [/*#__PURE__*/_jsxs("div", {
65
+ className: inline ? "flex flex-row-reverse items-center justify-end gap-2" : "contents",
66
+ children: [/*#__PURE__*/_jsxs(Label, {
67
+ htmlFor: id,
68
+ children: [field.label, field.required && /*#__PURE__*/_jsx("span", {
69
+ className: "text-xs font-normal text-muted-foreground",
70
+ children: "required"
71
+ })]
72
+ }), /*#__PURE__*/_jsx(FieldControl, {
73
+ ...props
74
+ })]
75
+ }), field.description && /*#__PURE__*/_jsx("p", {
228
76
  id: `${id}-hint`,
229
77
  className: "text-xs text-muted-foreground",
230
78
  children: field.description
231
- });
232
- $[12] = field.description;
233
- $[13] = id;
234
- $[14] = t5;
235
- } else {
236
- t5 = $[14];
237
- }
238
- let t6;
239
- if ($[15] !== error || $[16] !== id) {
240
- t6 = error && /*#__PURE__*/_jsx("p", {
79
+ }), error && /*#__PURE__*/_jsx("p", {
241
80
  id: `${id}-error`,
242
81
  className: "text-xs text-destructive",
243
82
  children: error
244
- });
245
- $[15] = error;
246
- $[16] = id;
247
- $[17] = t6;
248
- } else {
249
- t6 = $[17];
250
- }
251
- let t7;
252
- if ($[18] !== field.type || $[19] !== t4 || $[20] !== t5 || $[21] !== t6) {
253
- t7 = /*#__PURE__*/_jsxs("div", {
254
- "data-slot": "args-field",
255
- "data-type": field.type,
256
- className: "flex flex-col gap-1.5 [&_[data-slot=native-select-wrapper]]:w-full",
257
- children: [t4, t5, t6]
258
- });
259
- $[18] = field.type;
260
- $[19] = t4;
261
- $[20] = t5;
262
- $[21] = t6;
263
- $[22] = t7;
264
- } else {
265
- t7 = $[22];
266
- }
267
- return t7;
83
+ })]
84
+ });
268
85
  }
@@ -1,135 +1,48 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { Button, Label, Textarea } from "@locusgraph/components";
3
2
  import { useId, useState } from "react";
4
3
  import { PanelBody, PanelFooter } from "../../shared/panel.js";
5
4
  import { useFocusOnMount } from "../shared/use-focus-on-mount.js";
6
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- export function DenyForm(t0) {
8
- const $ = _c(24);
9
- const {
10
- onDeny,
11
- onBack
12
- } = t0;
6
+ export function DenyForm({
7
+ onDeny,
8
+ onBack
9
+ }) {
13
10
  const [reason, setReason] = useState("");
14
11
  const reasonId = useId();
15
12
  const reasonRef = useFocusOnMount(true);
16
- let t1;
17
- if ($[0] !== reason) {
18
- t1 = reason.trim();
19
- $[0] = reason;
20
- $[1] = t1;
21
- } else {
22
- t1 = $[1];
23
- }
24
- const trimmed = t1;
25
- let t2;
26
- if ($[2] !== onDeny || $[3] !== trimmed) {
27
- t2 = event => {
13
+ const trimmed = reason.trim();
14
+ return /*#__PURE__*/_jsxs("form", {
15
+ "data-slot": "deny-form",
16
+ onSubmit: event => {
28
17
  event.preventDefault();
29
18
  onDeny(trimmed === "" ? undefined : trimmed);
30
- };
31
- $[2] = onDeny;
32
- $[3] = trimmed;
33
- $[4] = t2;
34
- } else {
35
- t2 = $[4];
36
- }
37
- let t3;
38
- if ($[5] !== reasonId) {
39
- t3 = /*#__PURE__*/_jsx(Label, {
40
- htmlFor: reasonId,
41
- className: "text-xs font-normal text-muted-foreground",
42
- children: "Reason for the agent (optional)"
43
- });
44
- $[5] = reasonId;
45
- $[6] = t3;
46
- } else {
47
- t3 = $[6];
48
- }
49
- let t4;
50
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
51
- t4 = event_0 => setReason(event_0.target.value);
52
- $[7] = t4;
53
- } else {
54
- t4 = $[7];
55
- }
56
- let t5;
57
- if ($[8] !== reason || $[9] !== reasonId || $[10] !== reasonRef) {
58
- t5 = /*#__PURE__*/_jsx(Textarea, {
59
- id: reasonId,
60
- ref: reasonRef,
61
- value: reason,
62
- placeholder: "Tell the agent what to do instead",
63
- onChange: t4
64
- });
65
- $[8] = reason;
66
- $[9] = reasonId;
67
- $[10] = reasonRef;
68
- $[11] = t5;
69
- } else {
70
- t5 = $[11];
71
- }
72
- let t6;
73
- if ($[12] !== t3 || $[13] !== t5) {
74
- t6 = /*#__PURE__*/_jsxs(PanelBody, {
19
+ },
20
+ children: [/*#__PURE__*/_jsxs(PanelBody, {
75
21
  className: "gap-2 pt-0",
76
- children: [t3, t5]
77
- });
78
- $[12] = t3;
79
- $[13] = t5;
80
- $[14] = t6;
81
- } else {
82
- t6 = $[14];
83
- }
84
- let t7;
85
- if ($[15] !== onBack) {
86
- t7 = /*#__PURE__*/_jsx(Button, {
87
- type: "button",
88
- variant: "ghost",
89
- size: "sm",
90
- onClick: onBack,
91
- children: "Back"
92
- });
93
- $[15] = onBack;
94
- $[16] = t7;
95
- } else {
96
- t7 = $[16];
97
- }
98
- let t8;
99
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
100
- t8 = /*#__PURE__*/_jsx(Button, {
101
- type: "submit",
102
- variant: "destructive",
103
- size: "sm",
104
- children: "Send denial"
105
- });
106
- $[17] = t8;
107
- } else {
108
- t8 = $[17];
109
- }
110
- let t9;
111
- if ($[18] !== t7) {
112
- t9 = /*#__PURE__*/_jsxs(PanelFooter, {
113
- children: [t7, t8]
114
- });
115
- $[18] = t7;
116
- $[19] = t9;
117
- } else {
118
- t9 = $[19];
119
- }
120
- let t10;
121
- if ($[20] !== t2 || $[21] !== t6 || $[22] !== t9) {
122
- t10 = /*#__PURE__*/_jsxs("form", {
123
- "data-slot": "deny-form",
124
- onSubmit: t2,
125
- children: [t6, t9]
126
- });
127
- $[20] = t2;
128
- $[21] = t6;
129
- $[22] = t9;
130
- $[23] = t10;
131
- } else {
132
- t10 = $[23];
133
- }
134
- return t10;
22
+ children: [/*#__PURE__*/_jsx(Label, {
23
+ htmlFor: reasonId,
24
+ className: "text-xs font-normal text-muted-foreground",
25
+ children: "Reason for the agent (optional)"
26
+ }), /*#__PURE__*/_jsx(Textarea, {
27
+ id: reasonId,
28
+ ref: reasonRef,
29
+ value: reason,
30
+ placeholder: "Tell the agent what to do instead",
31
+ onChange: event => setReason(event.target.value)
32
+ })]
33
+ }), /*#__PURE__*/_jsxs(PanelFooter, {
34
+ children: [/*#__PURE__*/_jsx(Button, {
35
+ type: "button",
36
+ variant: "ghost",
37
+ size: "sm",
38
+ onClick: onBack,
39
+ children: "Back"
40
+ }), /*#__PURE__*/_jsx(Button, {
41
+ type: "submit",
42
+ variant: "destructive",
43
+ size: "sm",
44
+ children: "Send denial"
45
+ })]
46
+ })]
47
+ });
135
48
  }
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "@locusgraph/components";
3
2
  import { useId, useState } from "react";
4
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -37,106 +36,42 @@ export function humanizeKey(key) {
37
36
  function rawJson(input) {
38
37
  return JSON.stringify(input, null, 2) ?? "undefined";
39
38
  }
40
- export function ToolInputs(t0) {
41
- const $ = _c(22);
42
- const {
43
- input,
44
- muted: t1
45
- } = t0;
46
- const muted = t1 === undefined ? false : t1;
39
+ export function ToolInputs({
40
+ input,
41
+ muted = false
42
+ }) {
47
43
  const [showRaw, setShowRaw] = useState(false);
48
44
  const rawId = useId();
49
- let entries;
50
- let t2;
51
- let t3;
52
- let t4;
53
- if ($[0] !== input || $[1] !== muted || $[2] !== showRaw) {
54
- entries = isPlainRecord(input) ? Object.entries(input) : null;
55
- t2 = "tool-inputs";
56
- t3 = "flex flex-col gap-2";
57
- t4 = entries && !showRaw && /*#__PURE__*/_jsxs("dl", {
45
+ const entries = isPlainRecord(input) ? Object.entries(input) : null;
46
+ return /*#__PURE__*/_jsxs("div", {
47
+ "data-slot": "tool-inputs",
48
+ className: "flex flex-col gap-2",
49
+ children: [entries && !showRaw && /*#__PURE__*/_jsxs("dl", {
58
50
  className: cn("-mx-5 flex flex-col divide-y border-y text-sm", muted && "text-muted-foreground"),
59
- children: [entries.map(_temp), entries.length === 0 && /*#__PURE__*/_jsx("div", {
51
+ children: [entries.map(([key, value]) => /*#__PURE__*/_jsxs("div", {
52
+ className: "grid grid-cols-[minmax(0,8.5rem)_minmax(0,1fr)] items-baseline gap-3 px-5 py-2.5",
53
+ children: [/*#__PURE__*/_jsx("dt", {
54
+ className: "text-xs text-muted-foreground",
55
+ children: humanizeKey(key)
56
+ }), /*#__PURE__*/_jsx("dd", {
57
+ className: "font-mono text-sm break-words",
58
+ children: readableValue(value)
59
+ })]
60
+ }, key)), entries.length === 0 && /*#__PURE__*/_jsx("div", {
60
61
  className: "px-5 py-2.5 text-xs text-muted-foreground",
61
62
  children: "No inputs."
62
63
  })]
63
- });
64
- $[0] = input;
65
- $[1] = muted;
66
- $[2] = showRaw;
67
- $[3] = entries;
68
- $[4] = t2;
69
- $[5] = t3;
70
- $[6] = t4;
71
- } else {
72
- entries = $[3];
73
- t2 = $[4];
74
- t3 = $[5];
75
- t4 = $[6];
76
- }
77
- let t5;
78
- if ($[7] !== entries || $[8] !== input || $[9] !== rawId || $[10] !== showRaw) {
79
- t5 = (showRaw || !entries) && /*#__PURE__*/_jsx("pre", {
64
+ }), (showRaw || !entries) && /*#__PURE__*/_jsx("pre", {
80
65
  id: rawId,
81
66
  className: "overflow-x-auto bg-muted/40 p-3 font-mono text-xs",
82
67
  children: rawJson(input)
83
- });
84
- $[7] = entries;
85
- $[8] = input;
86
- $[9] = rawId;
87
- $[10] = showRaw;
88
- $[11] = t5;
89
- } else {
90
- t5 = $[11];
91
- }
92
- let t6;
93
- if ($[12] !== entries || $[13] !== rawId || $[14] !== showRaw) {
94
- t6 = entries && /*#__PURE__*/_jsx("button", {
68
+ }), entries && /*#__PURE__*/_jsx("button", {
95
69
  type: "button",
96
- className: "eyebrow self-start outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-safe:transition-colors",
70
+ className: "locus-eyebrow self-start outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-safe:transition-colors",
97
71
  "aria-expanded": showRaw,
98
72
  "aria-controls": showRaw ? rawId : undefined,
99
- onClick: () => setShowRaw(_temp2),
73
+ onClick: () => setShowRaw(current => !current),
100
74
  children: showRaw ? "Show fields" : "Show raw"
101
- });
102
- $[12] = entries;
103
- $[13] = rawId;
104
- $[14] = showRaw;
105
- $[15] = t6;
106
- } else {
107
- t6 = $[15];
108
- }
109
- let t7;
110
- if ($[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== t6) {
111
- t7 = /*#__PURE__*/_jsxs("div", {
112
- "data-slot": t2,
113
- className: t3,
114
- children: [t4, t5, t6]
115
- });
116
- $[16] = t2;
117
- $[17] = t3;
118
- $[18] = t4;
119
- $[19] = t5;
120
- $[20] = t6;
121
- $[21] = t7;
122
- } else {
123
- t7 = $[21];
124
- }
125
- return t7;
126
- }
127
- function _temp2(current) {
128
- return !current;
129
- }
130
- function _temp(t0) {
131
- const [key, value] = t0;
132
- return /*#__PURE__*/_jsxs("div", {
133
- className: "grid grid-cols-[minmax(0,8.5rem)_minmax(0,1fr)] items-baseline gap-3 px-5 py-2.5",
134
- children: [/*#__PURE__*/_jsx("dt", {
135
- className: "text-xs text-muted-foreground",
136
- children: humanizeKey(key)
137
- }), /*#__PURE__*/_jsx("dd", {
138
- className: "font-mono text-sm break-words",
139
- children: readableValue(value)
140
75
  })]
141
- }, key);
76
+ });
142
77
  }