camox 0.56.0 → 0.58.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/core/createApp.d.ts +2 -2
- package/dist/core/createBlock.js +6 -2
- package/dist/core/createLayout.d.ts +1 -1
- package/dist/core/editing/createEditableBlock.d.ts +1 -1
- package/dist/core/lib/artifact.d.ts +14 -4
- package/dist/core/lib/artifact.js +57 -16
- package/dist/core/lib/artifactRuntime.js +4 -2
- 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/runtime/artifactDocuments.js +58 -0
- package/dist/features/runtime/artifactSources.js +36 -2
- package/dist/features/runtime/runtime.js +30 -12
- package/dist/features/runtime/runtimeRoutes.d.ts +6 -5
- package/dist/features/runtime/runtimeRoutes.js +12 -5
- package/dist/features/studio/components/AgentSidebar.js +4 -4
- package/dist/features/studio/components/ChatWidget.js +62 -80
- package/dist/features/studio/components/DraftsControl.js +60 -134
- package/dist/features/studio/components/Patrol.js +676 -0
- package/dist/features/studio/components/ReviewDraftSheet.js +52 -4
- 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/RenameDraftDialog.js +0 -206
- package/dist/features/studio/components/WorkersWidget.js +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "camox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"camox": "./bin/camox.mjs"
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
"takumi-js": "^2.18.1",
|
|
136
136
|
"unhead": "^3.4.3",
|
|
137
137
|
"zod": "^4.6.7",
|
|
138
|
-
"@camox/api-contract": "0.
|
|
139
|
-
"@camox/cli": "0.
|
|
140
|
-
"@camox/ui": "0.
|
|
138
|
+
"@camox/api-contract": "0.58.0",
|
|
139
|
+
"@camox/cli": "0.58.0",
|
|
140
|
+
"@camox/ui": "0.58.0"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@earendil-works/pi-ai": "1.3.0",
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { getDraftReadClient } from "../../../lib/api-client.js";
|
|
2
|
-
import { reads, useStudioCache } from "../../../lib/studio-reads.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { useMutation } from "@tanstack/react-query";
|
|
7
|
-
import { Button } from "@camox/ui/button";
|
|
8
|
-
import { Input } from "@camox/ui/input";
|
|
9
|
-
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
10
|
-
import { toast } from "@camox/ui/toaster";
|
|
11
|
-
import { Spinner } from "@camox/ui/spinner";
|
|
12
|
-
|
|
13
|
-
//#region src/features/studio/components/RenameDraftDialog.tsx
|
|
14
|
-
/**
|
|
15
|
-
* Renames a regular draft, whichever draft the studio views: the request names the draft it
|
|
16
|
-
* renames. A blank name clears it, so the draft shows its computed label again.
|
|
17
|
-
*/
|
|
18
|
-
function useRenameDraft(projectId) {
|
|
19
|
-
const $ = c(8);
|
|
20
|
-
const studioCache = useStudioCache();
|
|
21
|
-
let t0;
|
|
22
|
-
if ($[0] !== projectId) {
|
|
23
|
-
t0 = (t1) => {
|
|
24
|
-
const { draftId, name } = t1;
|
|
25
|
-
return getDraftReadClient(draftId).drafts.rename({
|
|
26
|
-
projectId,
|
|
27
|
-
name
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
$[0] = projectId;
|
|
31
|
-
$[1] = t0;
|
|
32
|
-
} else t0 = $[1];
|
|
33
|
-
let t1;
|
|
34
|
-
if ($[2] !== projectId || $[3] !== studioCache) {
|
|
35
|
-
t1 = (renamed) => {
|
|
36
|
-
studioCache.set(reads.draft({
|
|
37
|
-
projectId,
|
|
38
|
-
draftId: renamed.id
|
|
39
|
-
}), renamed);
|
|
40
|
-
studioCache.invalidate(reads.draftList({ projectId }));
|
|
41
|
-
};
|
|
42
|
-
$[2] = projectId;
|
|
43
|
-
$[3] = studioCache;
|
|
44
|
-
$[4] = t1;
|
|
45
|
-
} else t1 = $[4];
|
|
46
|
-
let t2;
|
|
47
|
-
if ($[5] !== t0 || $[6] !== t1) {
|
|
48
|
-
t2 = {
|
|
49
|
-
mutationFn: t0,
|
|
50
|
-
onSuccess: t1,
|
|
51
|
-
onError: _temp
|
|
52
|
-
};
|
|
53
|
-
$[5] = t0;
|
|
54
|
-
$[6] = t1;
|
|
55
|
-
$[7] = t2;
|
|
56
|
-
} else t2 = $[7];
|
|
57
|
-
return useMutation(t2);
|
|
58
|
-
}
|
|
59
|
-
function _temp(error) {
|
|
60
|
-
return toast.error(error.message || "Could not rename the draft");
|
|
61
|
-
}
|
|
62
|
-
/** Asks for a draft's new name, starting from its current name, selected to type over. */
|
|
63
|
-
function RenameDraftDialog(t0) {
|
|
64
|
-
const $ = c(8);
|
|
65
|
-
const { projectId, draft, onOpenChange } = t0;
|
|
66
|
-
const t1 = !!draft;
|
|
67
|
-
let t2;
|
|
68
|
-
if ($[0] !== draft || $[1] !== onOpenChange || $[2] !== projectId) {
|
|
69
|
-
t2 = draft && /* @__PURE__ */ jsx(RenameDraftForm, {
|
|
70
|
-
projectId,
|
|
71
|
-
draft,
|
|
72
|
-
onDone: () => onOpenChange(false)
|
|
73
|
-
}, draft.id);
|
|
74
|
-
$[0] = draft;
|
|
75
|
-
$[1] = onOpenChange;
|
|
76
|
-
$[2] = projectId;
|
|
77
|
-
$[3] = t2;
|
|
78
|
-
} else t2 = $[3];
|
|
79
|
-
let t3;
|
|
80
|
-
if ($[4] !== onOpenChange || $[5] !== t1 || $[6] !== t2) {
|
|
81
|
-
t3 = /* @__PURE__ */ jsx(Dialog, {
|
|
82
|
-
open: t1,
|
|
83
|
-
onOpenChange,
|
|
84
|
-
children: t2
|
|
85
|
-
});
|
|
86
|
-
$[4] = onOpenChange;
|
|
87
|
-
$[5] = t1;
|
|
88
|
-
$[6] = t2;
|
|
89
|
-
$[7] = t3;
|
|
90
|
-
} else t3 = $[7];
|
|
91
|
-
return t3;
|
|
92
|
-
}
|
|
93
|
-
function RenameDraftForm(t0) {
|
|
94
|
-
const $ = c(26);
|
|
95
|
-
const { projectId, draft, onDone } = t0;
|
|
96
|
-
const [value, setValue] = React.useState(draft.name ?? "");
|
|
97
|
-
const input = React.useRef(null);
|
|
98
|
-
const rename = useRenameDraft(projectId);
|
|
99
|
-
let t1;
|
|
100
|
-
if ($[0] !== draft.id || $[1] !== draft.name || $[2] !== onDone || $[3] !== rename || $[4] !== value) {
|
|
101
|
-
t1 = () => {
|
|
102
|
-
if ((value.trim() || null) === draft.name) return onDone();
|
|
103
|
-
rename.mutate({
|
|
104
|
-
draftId: draft.id,
|
|
105
|
-
name: value
|
|
106
|
-
}, { onSuccess: onDone });
|
|
107
|
-
};
|
|
108
|
-
$[0] = draft.id;
|
|
109
|
-
$[1] = draft.name;
|
|
110
|
-
$[2] = onDone;
|
|
111
|
-
$[3] = rename;
|
|
112
|
-
$[4] = value;
|
|
113
|
-
$[5] = t1;
|
|
114
|
-
} else t1 = $[5];
|
|
115
|
-
const submit = t1;
|
|
116
|
-
let t2;
|
|
117
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
-
t2 = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Rename draft" }) });
|
|
119
|
-
$[6] = t2;
|
|
120
|
-
} else t2 = $[6];
|
|
121
|
-
let t3;
|
|
122
|
-
if ($[7] !== submit) {
|
|
123
|
-
t3 = (event) => {
|
|
124
|
-
event.preventDefault();
|
|
125
|
-
submit();
|
|
126
|
-
};
|
|
127
|
-
$[7] = submit;
|
|
128
|
-
$[8] = t3;
|
|
129
|
-
} else t3 = $[8];
|
|
130
|
-
let t4;
|
|
131
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
132
|
-
t4 = (event_1) => setValue(event_1.target.value);
|
|
133
|
-
$[9] = t4;
|
|
134
|
-
} else t4 = $[9];
|
|
135
|
-
let t5;
|
|
136
|
-
if ($[10] !== value) {
|
|
137
|
-
t5 = /* @__PURE__ */ jsx(Input, {
|
|
138
|
-
ref: input,
|
|
139
|
-
"aria-label": "Draft name",
|
|
140
|
-
value,
|
|
141
|
-
placeholder: "Name this draft (optional)",
|
|
142
|
-
maxLength: 200,
|
|
143
|
-
onFocus: _temp2,
|
|
144
|
-
onChange: t4
|
|
145
|
-
});
|
|
146
|
-
$[10] = value;
|
|
147
|
-
$[11] = t5;
|
|
148
|
-
} else t5 = $[11];
|
|
149
|
-
let t6;
|
|
150
|
-
if ($[12] !== onDone) {
|
|
151
|
-
t6 = /* @__PURE__ */ jsx(Button, {
|
|
152
|
-
type: "button",
|
|
153
|
-
variant: "outline",
|
|
154
|
-
onClick: onDone,
|
|
155
|
-
children: "Cancel"
|
|
156
|
-
});
|
|
157
|
-
$[12] = onDone;
|
|
158
|
-
$[13] = t6;
|
|
159
|
-
} else t6 = $[13];
|
|
160
|
-
let t7;
|
|
161
|
-
if ($[14] !== rename.isPending) {
|
|
162
|
-
t7 = rename.isPending && /* @__PURE__ */ jsx(Spinner, {});
|
|
163
|
-
$[14] = rename.isPending;
|
|
164
|
-
$[15] = t7;
|
|
165
|
-
} else t7 = $[15];
|
|
166
|
-
let t8;
|
|
167
|
-
if ($[16] !== rename.isPending || $[17] !== t7) {
|
|
168
|
-
t8 = /* @__PURE__ */ jsxs(Button, {
|
|
169
|
-
type: "submit",
|
|
170
|
-
disabled: rename.isPending,
|
|
171
|
-
children: [t7, "Rename"]
|
|
172
|
-
});
|
|
173
|
-
$[16] = rename.isPending;
|
|
174
|
-
$[17] = t7;
|
|
175
|
-
$[18] = t8;
|
|
176
|
-
} else t8 = $[18];
|
|
177
|
-
let t9;
|
|
178
|
-
if ($[19] !== t6 || $[20] !== t8) {
|
|
179
|
-
t9 = /* @__PURE__ */ jsxs(DialogFooter, { children: [t6, t8] });
|
|
180
|
-
$[19] = t6;
|
|
181
|
-
$[20] = t8;
|
|
182
|
-
$[21] = t9;
|
|
183
|
-
} else t9 = $[21];
|
|
184
|
-
let t10;
|
|
185
|
-
if ($[22] !== t3 || $[23] !== t5 || $[24] !== t9) {
|
|
186
|
-
t10 = /* @__PURE__ */ jsxs(DialogContent, {
|
|
187
|
-
initialFocus: input,
|
|
188
|
-
children: [t2, /* @__PURE__ */ jsxs("form", {
|
|
189
|
-
className: "grid gap-6",
|
|
190
|
-
onSubmit: t3,
|
|
191
|
-
children: [t5, t9]
|
|
192
|
-
})]
|
|
193
|
-
});
|
|
194
|
-
$[22] = t3;
|
|
195
|
-
$[23] = t5;
|
|
196
|
-
$[24] = t9;
|
|
197
|
-
$[25] = t10;
|
|
198
|
-
} else t10 = $[25];
|
|
199
|
-
return t10;
|
|
200
|
-
}
|
|
201
|
-
function _temp2(event_0) {
|
|
202
|
-
return event_0.currentTarget.select();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
//#endregion
|
|
206
|
-
export { RenameDraftDialog, useRenameDraft };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
|
-
import { BOTTOM_CARD_EDGES, CARD_BODY_EDGES } from "../../preview/components/SidebarStack.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region src/features/studio/components/WorkersWidget.tsx
|
|
7
|
-
/** The Agent Sidebar's Workers widget, over the Chat widget. A placeholder for now. */
|
|
8
|
-
function WorkersWidget(t0) {
|
|
9
|
-
const $ = c(6);
|
|
10
|
-
const { className } = t0;
|
|
11
|
-
let t1;
|
|
12
|
-
if ($[0] !== className) {
|
|
13
|
-
t1 = cn("flex flex-col", className);
|
|
14
|
-
$[0] = className;
|
|
15
|
-
$[1] = t1;
|
|
16
|
-
} else t1 = $[1];
|
|
17
|
-
let t2;
|
|
18
|
-
let t3;
|
|
19
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20
|
-
t2 = /* @__PURE__ */ jsx("header", {
|
|
21
|
-
className: cn("bg-background flex h-11 min-w-0 shrink-0 items-center justify-center px-3", BOTTOM_CARD_EDGES),
|
|
22
|
-
children: /* @__PURE__ */ jsx("h2", {
|
|
23
|
-
className: "truncate text-sm font-medium",
|
|
24
|
-
children: "Workers"
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
t3 = /* @__PURE__ */ jsx("div", {
|
|
28
|
-
className: cn("bg-background text-muted-foreground flex min-h-0 flex-1 items-center justify-center p-4 text-sm", CARD_BODY_EDGES),
|
|
29
|
-
children: "No workers yet"
|
|
30
|
-
});
|
|
31
|
-
$[2] = t2;
|
|
32
|
-
$[3] = t3;
|
|
33
|
-
} else {
|
|
34
|
-
t2 = $[2];
|
|
35
|
-
t3 = $[3];
|
|
36
|
-
}
|
|
37
|
-
let t4;
|
|
38
|
-
if ($[4] !== t1) {
|
|
39
|
-
t4 = /* @__PURE__ */ jsxs("section", {
|
|
40
|
-
"aria-label": "Workers",
|
|
41
|
-
"data-workers-widget": true,
|
|
42
|
-
className: t1,
|
|
43
|
-
children: [t2, t3]
|
|
44
|
-
});
|
|
45
|
-
$[4] = t1;
|
|
46
|
-
$[5] = t4;
|
|
47
|
-
} else t4 = $[5];
|
|
48
|
-
return t4;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { WorkersWidget };
|