camox 0.56.0 → 0.57.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/features/canvas/CanvasPageHeader.js +1 -1
- package/dist/features/canvas/canvasFrameDocument.js +13 -6
- package/dist/features/preview/components/Frame.js +1 -18
- package/dist/features/preview/components/SidebarStack.js +193 -106
- package/dist/features/preview/components/previewStyles.js +25 -1
- package/dist/features/renderer/RendererApp.js +55 -37
- package/dist/features/studio/components/AgentSidebar.js +4 -4
- package/dist/features/studio/components/ChatWidget.js +62 -80
- package/dist/features/studio/components/Patrol.js +676 -0
- package/dist/features/studio/components/Squareling.js +169 -84
- package/dist/features/studio/components/ThreadMessages.js +155 -58
- package/dist/features/studio/localeOptions.js +7 -3
- package/dist/features/studio/reportSentence.js +75 -0
- package/dist/features/studio/routes.js +2 -1
- package/dist/features/studio/showInCanvas.js +9 -2
- package/dist/features/studio/workingSentence.js +55 -0
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +5 -0
- package/dist/lib/use-thread.js +156 -190
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/studio/components/WorkersWidget.js +0 -52
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AuthContext } from "../../../lib/auth.js";
|
|
2
2
|
import { useCurrentDraftId, useDraftScope } from "../../../lib/draft-scope.js";
|
|
3
|
+
import { useNavigate } from "../../navigation/navigation.js";
|
|
3
4
|
import { reads, useReadQuery } from "../../../lib/studio-reads.js";
|
|
4
5
|
import { cn } from "../../../lib/utils.js";
|
|
5
6
|
import { BOTTOM_CARD_EDGES, CARD_BODY_EDGES } from "../../preview/components/SidebarStack.js";
|
|
@@ -17,7 +18,8 @@ import { EMPTY_THREAD_VIEW } from "@camox/api-contract/threads";
|
|
|
17
18
|
* The Agent Sidebar's Chat widget, where an editor works with Camox's agent in a thread. Elsewhere in the
|
|
18
19
|
* studio it is only hidden: the studio keeps following the editor's runs there. It follows
|
|
19
20
|
* where the studio is: the editor's own Live thread on Live, and the draft's thread in a draft.
|
|
20
|
-
* When the Live
|
|
21
|
+
* When the agent on Live hands the editor's request off to a draft, the studio that asked enters
|
|
22
|
+
* it, if it still shows Live; the card the Live turn ends on opens it too.
|
|
21
23
|
*/
|
|
22
24
|
function ChatWidget(t0) {
|
|
23
25
|
const $ = c(6);
|
|
@@ -62,7 +64,7 @@ function ChatWidget(t0) {
|
|
|
62
64
|
return t4;
|
|
63
65
|
}
|
|
64
66
|
function CurrentThread() {
|
|
65
|
-
const $ = c(
|
|
67
|
+
const $ = c(14);
|
|
66
68
|
const { apiUrl, projectUuid } = React.useContext(AuthContext);
|
|
67
69
|
let t0;
|
|
68
70
|
if ($[0] !== projectUuid) {
|
|
@@ -73,125 +75,105 @@ function CurrentThread() {
|
|
|
73
75
|
const { data: project } = useReadQuery(t0);
|
|
74
76
|
const draftId = useCurrentDraftId();
|
|
75
77
|
const draftScope = useDraftScope();
|
|
76
|
-
const
|
|
78
|
+
const navigate = useNavigate();
|
|
77
79
|
let t1;
|
|
78
80
|
if ($[2] !== draftScope) {
|
|
79
|
-
t1 = (started
|
|
80
|
-
if (draftScope.current() !== null) return;
|
|
81
|
-
const { startedDraft: _, continuedIn: __, ...state } = thread.state;
|
|
82
|
-
setCarried({
|
|
83
|
-
draftId: started,
|
|
84
|
-
thread: {
|
|
85
|
-
...thread,
|
|
86
|
-
state
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
draftScope.enterStarted(started);
|
|
90
|
-
};
|
|
81
|
+
t1 = (started) => draftScope.enterStarted(started);
|
|
91
82
|
$[2] = draftScope;
|
|
92
83
|
$[3] = t1;
|
|
93
84
|
} else t1 = $[3];
|
|
94
85
|
const enterDraft = t1;
|
|
95
86
|
let t2;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (move !== "started") setCarried(void 0);
|
|
87
|
+
if ($[4] !== navigate) {
|
|
88
|
+
t2 = (next) => void navigate({
|
|
89
|
+
to: window.location.href,
|
|
90
|
+
draft: next
|
|
101
91
|
});
|
|
102
|
-
|
|
103
|
-
$[4] = draftScope;
|
|
92
|
+
$[4] = navigate;
|
|
104
93
|
$[5] = t2;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
t2 = $[5];
|
|
108
|
-
t3 = $[6];
|
|
109
|
-
}
|
|
110
|
-
React.useEffect(t2, t3);
|
|
94
|
+
} else t2 = $[5];
|
|
95
|
+
const openDraft = t2;
|
|
111
96
|
if (!project) {
|
|
112
|
-
let
|
|
113
|
-
if ($[
|
|
114
|
-
|
|
115
|
-
$[
|
|
116
|
-
} else
|
|
117
|
-
return
|
|
97
|
+
let t3;
|
|
98
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
99
|
+
t3 = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ThreadMessages, { view: EMPTY_THREAD_VIEW }), /* @__PURE__ */ jsx(ThreadComposer, { disabled: true })] });
|
|
100
|
+
$[6] = t3;
|
|
101
|
+
} else t3 = $[6];
|
|
102
|
+
return t3;
|
|
118
103
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
t6 = /* @__PURE__ */ jsx(Thread, {
|
|
104
|
+
const t3 = `${project.id}:${draftId ?? "live"}`;
|
|
105
|
+
let t4;
|
|
106
|
+
if ($[7] !== apiUrl || $[8] !== draftId || $[9] !== enterDraft || $[10] !== openDraft || $[11] !== project.id || $[12] !== t3) {
|
|
107
|
+
t4 = /* @__PURE__ */ jsx(Thread, {
|
|
124
108
|
apiUrl,
|
|
125
109
|
projectId: project.id,
|
|
126
110
|
draftId,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
111
|
+
onEnterDraft: enterDraft,
|
|
112
|
+
onOpenDraft: openDraft
|
|
113
|
+
}, t3);
|
|
114
|
+
$[7] = apiUrl;
|
|
115
|
+
$[8] = draftId;
|
|
116
|
+
$[9] = enterDraft;
|
|
117
|
+
$[10] = openDraft;
|
|
133
118
|
$[11] = project.id;
|
|
134
|
-
$[12] =
|
|
135
|
-
$[13] =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return t6;
|
|
119
|
+
$[12] = t3;
|
|
120
|
+
$[13] = t4;
|
|
121
|
+
} else t4 = $[13];
|
|
122
|
+
return t4;
|
|
139
123
|
}
|
|
140
124
|
function Thread(t0) {
|
|
141
125
|
const $ = c(26);
|
|
142
|
-
const { apiUrl, projectId, draftId,
|
|
126
|
+
const { apiUrl, projectId, draftId, onEnterDraft, onOpenDraft } = t0;
|
|
143
127
|
let t1;
|
|
144
|
-
if ($[0] !==
|
|
145
|
-
t1 = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
$[0] = carried;
|
|
150
|
-
$[1] = onEnterDraft;
|
|
151
|
-
$[2] = t1;
|
|
152
|
-
} else t1 = $[2];
|
|
128
|
+
if ($[0] !== onEnterDraft) {
|
|
129
|
+
t1 = { onEnterDraft };
|
|
130
|
+
$[0] = onEnterDraft;
|
|
131
|
+
$[1] = t1;
|
|
132
|
+
} else t1 = $[1];
|
|
153
133
|
const { view, sending, send, stop, error, touched } = useThread(apiUrl, projectId, draftId, t1);
|
|
154
134
|
const follow = React.use(FollowAgentContext);
|
|
155
135
|
let t2;
|
|
156
|
-
if ($[
|
|
136
|
+
if ($[2] !== follow) {
|
|
157
137
|
t2 = (batch) => follow?.receive(batch);
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else t2 = $[
|
|
138
|
+
$[2] = follow;
|
|
139
|
+
$[3] = t2;
|
|
140
|
+
} else t2 = $[3];
|
|
161
141
|
const followTouched = React.useEffectEvent(t2);
|
|
162
142
|
let t3;
|
|
163
|
-
if ($[
|
|
143
|
+
if ($[4] !== followTouched || $[5] !== touched) {
|
|
164
144
|
t3 = () => {
|
|
165
145
|
if (touched) followTouched(touched.batch);
|
|
166
146
|
};
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
} else t3 = $[
|
|
147
|
+
$[4] = followTouched;
|
|
148
|
+
$[5] = touched;
|
|
149
|
+
$[6] = t3;
|
|
150
|
+
} else t3 = $[6];
|
|
171
151
|
let t4;
|
|
172
|
-
if ($[
|
|
152
|
+
if ($[7] !== touched) {
|
|
173
153
|
t4 = [touched];
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
} else t4 = $[
|
|
154
|
+
$[7] = touched;
|
|
155
|
+
$[8] = t4;
|
|
156
|
+
} else t4 = $[8];
|
|
177
157
|
React.useEffect(t3, t4);
|
|
178
158
|
let t5;
|
|
179
|
-
if ($[
|
|
159
|
+
if ($[9] !== follow || $[10] !== send) {
|
|
180
160
|
t5 = (text) => {
|
|
181
161
|
follow?.resume();
|
|
182
162
|
send(text);
|
|
183
163
|
};
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else t5 = $[
|
|
164
|
+
$[9] = follow;
|
|
165
|
+
$[10] = send;
|
|
166
|
+
$[11] = t5;
|
|
167
|
+
} else t5 = $[11];
|
|
188
168
|
const sendFollowing = t5;
|
|
189
169
|
let t6;
|
|
190
|
-
if ($[13] !== sending || $[14] !== view) {
|
|
170
|
+
if ($[12] !== onOpenDraft || $[13] !== sending || $[14] !== view) {
|
|
191
171
|
t6 = /* @__PURE__ */ jsx(ThreadMessages, {
|
|
192
172
|
view,
|
|
193
|
-
sending
|
|
173
|
+
sending,
|
|
174
|
+
onOpenDraft
|
|
194
175
|
});
|
|
176
|
+
$[12] = onOpenDraft;
|
|
195
177
|
$[13] = sending;
|
|
196
178
|
$[14] = view;
|
|
197
179
|
$[15] = t6;
|