@locusgraph/loop 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/pulse/gradient-label.js +70 -17
- package/dist/agent/pulse/marks/bars-mark.js +39 -15
- package/dist/agent/pulse/marks/glyph-mark.js +57 -16
- package/dist/agent/pulse/marks/locus-mark.js +39 -13
- package/dist/agent/pulse/marks/orb-mark.js +21 -9
- package/dist/agent/pulse/pulse.js +1 -1
- package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
- package/dist/agent/pulse/use-loop-animation.js +36 -15
- package/dist/agent/steps/step-icon.js +20 -13
- package/dist/agent/steps/steps.js +39 -37
- package/dist/agent/thinking/thinking.js +65 -62
- package/dist/agent/tool/json-block.js +10 -7
- package/dist/agent/tool/tool-status.d.ts +2 -0
- package/dist/agent/tool/tool-status.js +16 -13
- package/dist/agent/tool/tool.d.ts +8 -1
- package/dist/agent/tool/tool.js +238 -119
- package/dist/approval/inbox/inbox-row.d.ts +3 -3
- package/dist/approval/inbox/inbox-row.js +248 -86
- package/dist/approval/inbox/inbox.d.ts +3 -3
- package/dist/approval/inbox/inbox.js +251 -57
- package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
- package/dist/approval/inbox/virtual-inbox-list.js +107 -30
- package/dist/approval/memory/memory-review.js +228 -91
- package/dist/approval/memory/memory-row.js +192 -56
- package/dist/approval/plan/plan-review.js +241 -108
- package/dist/approval/plan/plan-step-row.js +184 -77
- package/dist/approval/plan/plan-steps.d.ts +1 -1
- package/dist/approval/plan/plan-steps.js +2 -2
- package/dist/approval/plan/question-choices.js +139 -48
- package/dist/approval/plan/question.js +189 -67
- package/dist/approval/run/run-bar.js +138 -49
- package/dist/approval/shared/approval-line.d.ts +27 -0
- package/dist/approval/shared/approval-line.js +85 -0
- package/dist/approval/shared/risk-badge.d.ts +3 -5
- package/dist/approval/shared/risk-badge.js +11 -19
- package/dist/approval/shared/time.d.ts +0 -1
- package/dist/approval/shared/time.js +0 -1
- package/dist/approval/shared/use-focus-on-mount.js +23 -5
- package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
- package/dist/approval/shared/use-focus-when-settled.js +18 -0
- package/dist/approval/spend/raise-cap-form.d.ts +2 -2
- package/dist/approval/spend/raise-cap-form.js +235 -52
- package/dist/approval/spend/spend-gate.js +200 -106
- package/dist/approval/spend/spend-math.d.ts +1 -0
- package/dist/approval/spend/spend-math.js +5 -2
- package/dist/approval/spend/spend-meter.js +5 -5
- package/dist/approval/tool/approval.js +157 -96
- package/dist/approval/tool/args/args-editor.js +232 -81
- package/dist/approval/tool/args/args-field.js +333 -60
- package/dist/approval/tool/deny-form.js +114 -32
- package/dist/approval/tool/tool-inputs.js +93 -33
- package/dist/chat/chat/chat.js +5 -4
- package/dist/chat/chat/use-stick-to-bottom.js +116 -63
- package/dist/chat/chat/virtual-chat-items.js +129 -34
- package/dist/chat/composer/composer-actions.d.ts +1 -2
- package/dist/chat/composer/composer-actions.js +136 -50
- package/dist/chat/composer/composer-status.d.ts +2 -0
- package/dist/chat/composer/composer-status.js +3 -0
- package/dist/chat/composer/composer.d.ts +1 -1
- package/dist/chat/composer/composer.js +6 -4
- package/dist/chat/composer/use-auto-grow.js +29 -8
- package/dist/chat/files/files.js +296 -67
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat/reply/fenced-code.js +1 -1
- package/dist/chat/reply/markdown-components.js +9 -116
- package/dist/chat/reply/reply.js +2 -2
- package/dist/chat/turn/group-parts.d.ts +1 -0
- package/dist/chat/turn/group-parts.js +6 -3
- package/dist/chat/turn/turn.js +13 -4
- package/dist/cost/context.js +3 -3
- package/dist/cost/cost-steps.js +31 -30
- package/dist/cost/cost.js +39 -39
- package/dist/cost/model-picker.js +176 -43
- package/dist/cost/shared/context-breakdown.js +10 -11
- package/dist/cost/shared/model-option-row.js +4 -3
- package/dist/cost/shared/step-cost-row.js +11 -12
- package/dist/cost/shared/usage-totals.d.ts +1 -0
- package/dist/cost/shared/usage-totals.js +19 -1
- package/dist/memory/cite.js +190 -59
- package/dist/memory/memorized.js +231 -62
- package/dist/memory/recall.js +272 -85
- package/dist/memory/shared/host-label.d.ts +1 -1
- package/dist/memory/shared/host-label.js +2 -2
- package/dist/memory/shared/source-mark.js +1 -1
- package/dist/memory/sources.d.ts +2 -1
- package/dist/memory/sources.js +277 -62
- package/dist/shared/decision-summary.js +2 -1
- package/dist/shared/line.d.ts +10 -0
- package/dist/shared/line.js +11 -0
- package/dist/shared/live-status.d.ts +3 -0
- package/dist/shared/live-status.js +11 -0
- package/dist/shared/reduced-motion.d.ts +1 -0
- package/dist/shared/reduced-motion.js +3 -0
- package/dist/shared/virtual/use-list-virtualizer.js +2 -0
- package/dist/thread/actions/action-button.js +1 -1
- package/dist/thread/actions/actions.d.ts +3 -1
- package/dist/thread/actions/actions.js +100 -81
- package/dist/thread/actions/branch-switcher.js +129 -23
- package/dist/thread/canvas/canvas-meta.d.ts +9 -0
- package/dist/thread/canvas/canvas-meta.js +35 -0
- package/dist/thread/canvas/canvas.d.ts +1 -1
- package/dist/thread/canvas/canvas.js +64 -74
- package/dist/thread/canvas/version-switcher.d.ts +1 -0
- package/dist/thread/canvas/version-switcher.js +161 -45
- package/dist/thread/code/code.js +4 -6
- package/dist/thread/code/copy-code-button.d.ts +2 -1
- package/dist/thread/code/copy-code-button.js +91 -26
- package/dist/thread/history/history.d.ts +1 -1
- package/dist/thread/history/history.js +104 -104
- package/dist/thread/history/row/history-row.js +106 -22
- package/dist/thread/history/row/thread-item-menu.js +84 -20
- package/dist/thread/history/row/thread-title-editor.js +74 -29
- package/dist/thread/history/virtual-history-list.js +83 -46
- package/dist/thread/index.d.ts +1 -0
- package/dist/thread/index.js +1 -0
- package/dist/thread/starters/starters.js +91 -28
- package/dist/thread/use-copied.js +40 -10
- package/package.json +6 -6
- package/dist/agent/shared/status-dot.d.ts +0 -1
- package/dist/agent/shared/status-dot.js +0 -1
- package/dist/approval/shared/decision-line.d.ts +0 -1
- package/dist/approval/shared/decision-line.js +0 -1
- package/dist/memory/shared/disclosure.d.ts +0 -6
- package/dist/memory/shared/disclosure.js +0 -6
- package/dist/shared/panel.d.ts +0 -19
- package/dist/shared/panel.js +0 -77
- package/dist/shared/status-dot.d.ts +0 -6
- package/dist/shared/status-dot.js +0 -20
|
@@ -9,7 +9,7 @@ export function applyStepAction(steps, stepId, action) {
|
|
|
9
9
|
if (moved) reordered.splice(target, 0, moved);
|
|
10
10
|
return reordered;
|
|
11
11
|
}
|
|
12
|
-
export function focusAfterAction(steps, stepId, action) {
|
|
12
|
+
export function focusAfterAction(steps, stepId, action, removedPosition = 0) {
|
|
13
13
|
if (action !== "remove") {
|
|
14
14
|
const index = steps.findIndex(step => step.id === stepId);
|
|
15
15
|
const atEdge = action === "up" ? index === 0 : index === steps.length - 1;
|
|
@@ -18,7 +18,7 @@ export function focusAfterAction(steps, stepId, action) {
|
|
|
18
18
|
control: atEdge ? "title" : action
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
const neighbor = steps[
|
|
21
|
+
const neighbor = steps[Math.min(removedPosition, steps.length - 1)];
|
|
22
22
|
return neighbor ? {
|
|
23
23
|
stepId: neighbor.id,
|
|
24
24
|
control: "title"
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { cn } from "@locusgraph/components";
|
|
2
5
|
import { useEffect, useRef } from "react";
|
|
3
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -13,68 +16,156 @@ function indexFromDigitKey(key, count) {
|
|
|
13
16
|
const digit = Number(key);
|
|
14
17
|
return Number.isInteger(digit) && digit >= 1 && digit <= count ? digit - 1 : undefined;
|
|
15
18
|
}
|
|
16
|
-
export function QuestionChoices({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const option = options[next];
|
|
33
|
-
if (!option) return;
|
|
34
|
-
onSelect(option.id);
|
|
35
|
-
buttons.current[next]?.focus();
|
|
19
|
+
export function QuestionChoices(t0) {
|
|
20
|
+
const $ = _c(25);
|
|
21
|
+
const {
|
|
22
|
+
label,
|
|
23
|
+
options,
|
|
24
|
+
selectedId,
|
|
25
|
+
onSelect,
|
|
26
|
+
autoFocus: t1
|
|
27
|
+
} = t0;
|
|
28
|
+
const autoFocus = t1 === undefined ? false : t1;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t2 = [];
|
|
32
|
+
$[0] = t2;
|
|
33
|
+
} else {
|
|
34
|
+
t2 = $[0];
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const buttons = useRef(t2);
|
|
37
|
+
let t3;
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[1] !== autoFocus) {
|
|
40
|
+
t3 = () => {
|
|
41
|
+
if (autoFocus) {
|
|
42
|
+
buttons.current[0]?.focus({
|
|
43
|
+
preventScroll: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
t4 = [autoFocus];
|
|
48
|
+
$[1] = autoFocus;
|
|
49
|
+
$[2] = t3;
|
|
50
|
+
$[3] = t4;
|
|
51
|
+
} else {
|
|
52
|
+
t3 = $[2];
|
|
53
|
+
t4 = $[3];
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
useEffect(t3, t4);
|
|
56
|
+
let t5;
|
|
57
|
+
if ($[4] !== options || $[5] !== selectedId) {
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[7] !== selectedId) {
|
|
60
|
+
t6 = option => option.id === selectedId;
|
|
61
|
+
$[7] = selectedId;
|
|
62
|
+
$[8] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[8];
|
|
65
|
+
}
|
|
66
|
+
t5 = options.findIndex(t6);
|
|
67
|
+
$[4] = options;
|
|
68
|
+
$[5] = selectedId;
|
|
69
|
+
$[6] = t5;
|
|
70
|
+
} else {
|
|
71
|
+
t5 = $[6];
|
|
72
|
+
}
|
|
73
|
+
const selectedIndex = t5;
|
|
74
|
+
const tabStop = selectedIndex === -1 ? 0 : selectedIndex;
|
|
75
|
+
let t10;
|
|
76
|
+
let t6;
|
|
77
|
+
let t7;
|
|
78
|
+
let t8;
|
|
79
|
+
let t9;
|
|
80
|
+
if ($[9] !== label || $[10] !== onSelect || $[11] !== options || $[12] !== selectedId || $[13] !== tabStop) {
|
|
81
|
+
const selectIndex = function selectIndex(next) {
|
|
82
|
+
const option_0 = options[next];
|
|
83
|
+
if (!option_0) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onSelect(option_0.id);
|
|
87
|
+
buttons.current[next]?.focus();
|
|
88
|
+
};
|
|
89
|
+
const handleKeyDown = function handleKeyDown(event, index) {
|
|
90
|
+
const byDigit = indexFromDigitKey(event.key, options.length);
|
|
91
|
+
const move = nextIndexByKey[event.key];
|
|
92
|
+
if (byDigit === undefined && !move) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
selectIndex(byDigit ?? move?.(index, options.length) ?? index);
|
|
97
|
+
};
|
|
98
|
+
t6 = "radiogroup";
|
|
99
|
+
t7 = label;
|
|
100
|
+
t8 = "question-choices";
|
|
101
|
+
t9 = "flex flex-col";
|
|
102
|
+
t10 = options.map((option_1, index_0) => {
|
|
103
|
+
const checked = option_1.id === selectedId;
|
|
51
104
|
return /*#__PURE__*/_jsxs("button", {
|
|
52
105
|
ref: element => {
|
|
53
|
-
buttons.current[
|
|
106
|
+
buttons.current[index_0] = element;
|
|
54
107
|
},
|
|
55
108
|
type: "button",
|
|
56
109
|
role: "radio",
|
|
57
110
|
"aria-checked": checked,
|
|
58
|
-
tabIndex:
|
|
111
|
+
tabIndex: index_0 === tabStop ? 0 : -1,
|
|
59
112
|
"data-state": checked ? "checked" : "unchecked",
|
|
60
|
-
onClick: () => onSelect(
|
|
61
|
-
onKeyDown:
|
|
62
|
-
className: cn("group relative flex items-
|
|
113
|
+
onClick: () => onSelect(option_1.id),
|
|
114
|
+
onKeyDown: event_0 => handleKeyDown(event_0, index_0),
|
|
115
|
+
className: cn("group relative -mx-2 flex items-start gap-3 px-2 py-1.5 text-left text-sm locus-focus-ring motion-safe:transition-colors", checked ? "bg-muted" : "hover:bg-muted/50"),
|
|
63
116
|
children: [/*#__PURE__*/_jsx("span", {
|
|
64
117
|
"aria-hidden": true,
|
|
65
|
-
className: cn("flex
|
|
66
|
-
children:
|
|
118
|
+
className: cn("flex h-5 w-4 shrink-0 items-center text-xs tabular-nums", checked ? "font-medium text-interactive" : "text-faint"),
|
|
119
|
+
children: index_0 + 1
|
|
67
120
|
}), /*#__PURE__*/_jsxs("span", {
|
|
68
121
|
className: "flex min-w-0 flex-1 flex-col",
|
|
69
122
|
children: [/*#__PURE__*/_jsx("span", {
|
|
70
|
-
className: "font-medium",
|
|
71
|
-
children:
|
|
72
|
-
}),
|
|
73
|
-
className: "text-xs text-
|
|
74
|
-
children:
|
|
123
|
+
className: "font-medium text-foreground",
|
|
124
|
+
children: option_1.label
|
|
125
|
+
}), option_1.description && /*#__PURE__*/_jsxs("span", {
|
|
126
|
+
className: "text-xs text-faint",
|
|
127
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
128
|
+
className: "sr-only",
|
|
129
|
+
children: ", "
|
|
130
|
+
}), option_1.description]
|
|
75
131
|
})]
|
|
76
132
|
})]
|
|
77
|
-
},
|
|
78
|
-
})
|
|
79
|
-
|
|
133
|
+
}, option_1.id);
|
|
134
|
+
});
|
|
135
|
+
$[9] = label;
|
|
136
|
+
$[10] = onSelect;
|
|
137
|
+
$[11] = options;
|
|
138
|
+
$[12] = selectedId;
|
|
139
|
+
$[13] = tabStop;
|
|
140
|
+
$[14] = t10;
|
|
141
|
+
$[15] = t6;
|
|
142
|
+
$[16] = t7;
|
|
143
|
+
$[17] = t8;
|
|
144
|
+
$[18] = t9;
|
|
145
|
+
} else {
|
|
146
|
+
t10 = $[14];
|
|
147
|
+
t6 = $[15];
|
|
148
|
+
t7 = $[16];
|
|
149
|
+
t8 = $[17];
|
|
150
|
+
t9 = $[18];
|
|
151
|
+
}
|
|
152
|
+
let t11;
|
|
153
|
+
if ($[19] !== t10 || $[20] !== t6 || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
|
|
154
|
+
t11 = /*#__PURE__*/_jsx("div", {
|
|
155
|
+
role: t6,
|
|
156
|
+
"aria-label": t7,
|
|
157
|
+
"data-slot": t8,
|
|
158
|
+
className: t9,
|
|
159
|
+
children: t10
|
|
160
|
+
});
|
|
161
|
+
$[19] = t10;
|
|
162
|
+
$[20] = t6;
|
|
163
|
+
$[21] = t7;
|
|
164
|
+
$[22] = t8;
|
|
165
|
+
$[23] = t9;
|
|
166
|
+
$[24] = t11;
|
|
167
|
+
} else {
|
|
168
|
+
t11 = $[24];
|
|
169
|
+
}
|
|
170
|
+
return t11;
|
|
80
171
|
}
|
|
@@ -1,57 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { Button, cn, Input, Textarea } from "@locusgraph/components";
|
|
5
|
+
import { ArrowRight as ArrowRightIcon, Question as MessageCircleQuestionIcon } from "@phosphor-icons/react/ssr";
|
|
3
6
|
import { useId, useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
7
|
+
import { DecisionSummary } from "../../shared/decision-summary.js";
|
|
8
|
+
import { lineObjectClass } from "../../shared/line.js";
|
|
9
|
+
import { LiveStatus } from "../../shared/live-status.js";
|
|
10
|
+
import { PendingLine, SettledLine } from "../shared/approval-line.js";
|
|
6
11
|
import { useFocusOnMount } from "../shared/use-focus-on-mount.js";
|
|
12
|
+
import { useFocusWhenSettled } from "../shared/use-focus-when-settled.js";
|
|
7
13
|
import { QuestionChoices } from "./question-choices.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
const filledFieldClass = "border-transparent bg-muted shadow-none placeholder:text-faint dark:bg-muted";
|
|
9
16
|
function answerText(answer, options) {
|
|
10
17
|
const option = options.find(item => item.id === answer.optionId);
|
|
11
18
|
return [option?.label, answer.text].filter(Boolean).join(" · ");
|
|
12
19
|
}
|
|
13
|
-
export function Question({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export function Question(t0) {
|
|
21
|
+
const $ = _c(39);
|
|
22
|
+
const {
|
|
23
|
+
question,
|
|
24
|
+
options: t1,
|
|
25
|
+
allowText: allowTextProp,
|
|
26
|
+
textLabel: textLabelProp,
|
|
27
|
+
textPlaceholder: textPlaceholderProp,
|
|
28
|
+
submitLabel: t2,
|
|
29
|
+
answer,
|
|
30
|
+
onAnswer,
|
|
31
|
+
autoFocus: t3,
|
|
32
|
+
className
|
|
33
|
+
} = t0;
|
|
34
|
+
let t4;
|
|
35
|
+
if ($[0] !== t1) {
|
|
36
|
+
t4 = t1 === undefined ? [] : t1;
|
|
37
|
+
$[0] = t1;
|
|
38
|
+
$[1] = t4;
|
|
39
|
+
} else {
|
|
40
|
+
t4 = $[1];
|
|
41
|
+
}
|
|
42
|
+
const options = t4;
|
|
43
|
+
const submitLabel = t2 === undefined ? "Send answer" : t2;
|
|
44
|
+
const autoFocus = t3 === undefined ? true : t3;
|
|
25
45
|
const hasOptions = options.length > 0;
|
|
26
46
|
const allowText = allowTextProp ?? !hasOptions;
|
|
27
47
|
const textLabel = textLabelProp ?? (hasOptions ? "Something else" : "Your answer");
|
|
28
|
-
const textPlaceholder = textPlaceholderProp ?? (hasOptions ? "Something else
|
|
48
|
+
const textPlaceholder = textPlaceholderProp ?? (hasOptions ? "Something else\u2026" : "Type an answer for the agent");
|
|
29
49
|
const textId = useId();
|
|
30
50
|
const [optionId, setOptionId] = useState();
|
|
31
51
|
const [text, setText] = useState("");
|
|
32
|
-
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[2] !== text) {
|
|
54
|
+
t5 = text.trim();
|
|
55
|
+
$[2] = text;
|
|
56
|
+
$[3] = t5;
|
|
57
|
+
} else {
|
|
58
|
+
t5 = $[3];
|
|
59
|
+
}
|
|
60
|
+
const trimmed = t5;
|
|
33
61
|
const canSubmit = optionId !== undefined || trimmed !== "";
|
|
34
62
|
const textOnly = options.length === 0;
|
|
35
63
|
const textRef = useFocusOnMount(autoFocus && !answer && textOnly);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
const settleRef = useFocusWhenSettled(!answer);
|
|
65
|
+
let t6;
|
|
66
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
67
|
+
t6 = value => {
|
|
68
|
+
setText(value);
|
|
69
|
+
if (value.trim() !== "") {
|
|
70
|
+
setOptionId(undefined);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
$[4] = t6;
|
|
74
|
+
} else {
|
|
75
|
+
t6 = $[4];
|
|
76
|
+
}
|
|
77
|
+
const changeText = t6;
|
|
78
|
+
let t7;
|
|
79
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
+
t7 = /*#__PURE__*/_jsx(MessageCircleQuestionIcon, {
|
|
81
|
+
weight: "bold",
|
|
82
|
+
"aria-hidden": true
|
|
83
|
+
});
|
|
84
|
+
$[5] = t7;
|
|
85
|
+
} else {
|
|
86
|
+
t7 = $[5];
|
|
87
|
+
}
|
|
88
|
+
const icon = t7;
|
|
89
|
+
const t8 = answer ? true : undefined;
|
|
90
|
+
const t9 = !answer && "gap-3";
|
|
91
|
+
let t10;
|
|
92
|
+
if ($[6] !== className || $[7] !== t9) {
|
|
93
|
+
t10 = cn("flex min-w-0 flex-col outline-none", t9, className);
|
|
94
|
+
$[6] = className;
|
|
95
|
+
$[7] = t9;
|
|
96
|
+
$[8] = t10;
|
|
97
|
+
} else {
|
|
98
|
+
t10 = $[8];
|
|
99
|
+
}
|
|
100
|
+
let t11;
|
|
101
|
+
if ($[9] !== allowText || $[10] !== answer || $[11] !== autoFocus || $[12] !== canSubmit || $[13] !== onAnswer || $[14] !== optionId || $[15] !== options || $[16] !== question || $[17] !== submitLabel || $[18] !== text || $[19] !== textId || $[20] !== textLabel || $[21] !== textOnly || $[22] !== textPlaceholder || $[23] !== textRef || $[24] !== trimmed) {
|
|
102
|
+
t11 = answer ? /*#__PURE__*/_jsx(SettledLine, {
|
|
103
|
+
name: question,
|
|
104
|
+
verb: "Asked",
|
|
105
|
+
icon: icon,
|
|
55
106
|
children: /*#__PURE__*/_jsx(DecisionSummary, {
|
|
56
107
|
decision: {
|
|
57
108
|
approved: true,
|
|
@@ -61,17 +112,26 @@ export function Question({
|
|
|
61
112
|
approvedVerb: "Answered",
|
|
62
113
|
result: answerText(answer, options) || "No answer"
|
|
63
114
|
})
|
|
64
|
-
}) : /*#__PURE__*/_jsxs(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
115
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
116
|
+
children: [/*#__PURE__*/_jsxs(PendingLine, {
|
|
117
|
+
icon: icon,
|
|
118
|
+
wrap: true,
|
|
119
|
+
children: ["for your answer: ", /*#__PURE__*/_jsx("span", {
|
|
120
|
+
className: lineObjectClass,
|
|
121
|
+
children: question
|
|
122
|
+
})]
|
|
123
|
+
}), /*#__PURE__*/_jsxs("form", {
|
|
124
|
+
className: "flex flex-col gap-3",
|
|
125
|
+
onSubmit: event => {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
if (!canSubmit) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
onAnswer({
|
|
131
|
+
optionId,
|
|
132
|
+
text: trimmed === "" ? undefined : trimmed
|
|
133
|
+
});
|
|
134
|
+
},
|
|
75
135
|
children: [!textOnly && /*#__PURE__*/_jsx(QuestionChoices, {
|
|
76
136
|
label: question,
|
|
77
137
|
options: options,
|
|
@@ -86,31 +146,93 @@ export function Question({
|
|
|
86
146
|
"aria-label": textLabel,
|
|
87
147
|
value: text,
|
|
88
148
|
placeholder: textPlaceholder,
|
|
89
|
-
|
|
149
|
+
className: filledFieldClass,
|
|
150
|
+
onChange: event_0 => changeText(event_0.target.value)
|
|
90
151
|
}), textOnly && /*#__PURE__*/_jsx(Textarea, {
|
|
91
152
|
id: textId,
|
|
92
153
|
ref: textRef,
|
|
93
154
|
"aria-label": textLabel,
|
|
94
155
|
value: text,
|
|
95
156
|
placeholder: textPlaceholder,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
157
|
+
className: filledFieldClass,
|
|
158
|
+
onChange: event_1 => changeText(event_1.target.value)
|
|
159
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
160
|
+
className: "flex flex-wrap items-center gap-3",
|
|
161
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
162
|
+
type: "submit",
|
|
163
|
+
size: "sm",
|
|
164
|
+
disabled: !canSubmit,
|
|
165
|
+
children: [submitLabel, /*#__PURE__*/_jsx(ArrowRightIcon, {
|
|
166
|
+
weight: "bold",
|
|
167
|
+
"aria-hidden": true
|
|
168
|
+
})]
|
|
169
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
170
|
+
className: "hidden text-xs text-faint sm:inline",
|
|
171
|
+
children: textOnly ? "The run is paused" : `Press 1–${options.length} to pick`
|
|
109
172
|
})]
|
|
110
173
|
})]
|
|
111
174
|
})]
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
175
|
+
});
|
|
176
|
+
$[9] = allowText;
|
|
177
|
+
$[10] = answer;
|
|
178
|
+
$[11] = autoFocus;
|
|
179
|
+
$[12] = canSubmit;
|
|
180
|
+
$[13] = onAnswer;
|
|
181
|
+
$[14] = optionId;
|
|
182
|
+
$[15] = options;
|
|
183
|
+
$[16] = question;
|
|
184
|
+
$[17] = submitLabel;
|
|
185
|
+
$[18] = text;
|
|
186
|
+
$[19] = textId;
|
|
187
|
+
$[20] = textLabel;
|
|
188
|
+
$[21] = textOnly;
|
|
189
|
+
$[22] = textPlaceholder;
|
|
190
|
+
$[23] = textRef;
|
|
191
|
+
$[24] = trimmed;
|
|
192
|
+
$[25] = t11;
|
|
193
|
+
} else {
|
|
194
|
+
t11 = $[25];
|
|
195
|
+
}
|
|
196
|
+
let t12;
|
|
197
|
+
if ($[26] !== answer || $[27] !== options || $[28] !== question) {
|
|
198
|
+
t12 = answer ? `Answered: ${answerText(answer, options)}` : `The agent asks: ${question}`;
|
|
199
|
+
$[26] = answer;
|
|
200
|
+
$[27] = options;
|
|
201
|
+
$[28] = question;
|
|
202
|
+
$[29] = t12;
|
|
203
|
+
} else {
|
|
204
|
+
t12 = $[29];
|
|
205
|
+
}
|
|
206
|
+
let t13;
|
|
207
|
+
if ($[30] !== t12) {
|
|
208
|
+
t13 = /*#__PURE__*/_jsx(LiveStatus, {
|
|
209
|
+
message: t12
|
|
210
|
+
});
|
|
211
|
+
$[30] = t12;
|
|
212
|
+
$[31] = t13;
|
|
213
|
+
} else {
|
|
214
|
+
t13 = $[31];
|
|
215
|
+
}
|
|
216
|
+
let t14;
|
|
217
|
+
if ($[32] !== question || $[33] !== settleRef || $[34] !== t10 || $[35] !== t11 || $[36] !== t13 || $[37] !== t8) {
|
|
218
|
+
t14 = /*#__PURE__*/_jsxs("section", {
|
|
219
|
+
ref: settleRef,
|
|
220
|
+
tabIndex: -1,
|
|
221
|
+
"data-slot": "question",
|
|
222
|
+
"aria-label": question,
|
|
223
|
+
"data-answered": t8,
|
|
224
|
+
className: t10,
|
|
225
|
+
children: [t11, t13]
|
|
226
|
+
});
|
|
227
|
+
$[32] = question;
|
|
228
|
+
$[33] = settleRef;
|
|
229
|
+
$[34] = t10;
|
|
230
|
+
$[35] = t11;
|
|
231
|
+
$[36] = t13;
|
|
232
|
+
$[37] = t8;
|
|
233
|
+
$[38] = t14;
|
|
234
|
+
} else {
|
|
235
|
+
t14 = $[38];
|
|
236
|
+
}
|
|
237
|
+
return t14;
|
|
116
238
|
}
|