camox 0.72.0 → 0.75.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 (38) hide show
  1. package/dist/core/lib/artifactRuntime.js +4 -2
  2. package/dist/features/preview/components/PageInfo.js +121 -98
  3. package/dist/features/preview/components/SelectionEditor.js +1 -1
  4. package/dist/features/renderer/RendererFrames.js +47 -41
  5. package/dist/features/routes/pageRuntime.js +15 -4
  6. package/dist/features/runtime/ClaimCard.js +192 -0
  7. package/dist/features/runtime/pageApp.js +4 -3
  8. package/dist/features/runtime/runtime.js +26 -5
  9. package/dist/features/runtime/worker.js +2 -2
  10. package/dist/features/runtime/workerRequest.d.ts +6 -0
  11. package/dist/features/runtime/workerRequest.js +13 -1
  12. package/dist/features/runtime/workerRuntime.d.ts +2 -2
  13. package/dist/features/runtime/workerRuntime.js +2 -2
  14. package/dist/features/studio/components/AgentSidebar.js +7 -7
  15. package/dist/features/studio/components/ChatWidget.js +142 -106
  16. package/dist/features/studio/components/ContentFindings.js +127 -230
  17. package/dist/features/studio/components/DeleteDraftDialog.js +112 -0
  18. package/dist/features/studio/components/DraftBar.js +98 -53
  19. package/dist/features/studio/components/DraftsControl.js +203 -190
  20. package/dist/features/studio/components/ReviewDraftDialog.js +670 -0
  21. package/dist/features/studio/components/{Patrol.js → Specialists.js} +291 -330
  22. package/dist/features/studio/components/Squareling.js +5 -5
  23. package/dist/features/studio/components/ThreadComposer.js +106 -127
  24. package/dist/features/studio/components/ThreadMessages.js +246 -71
  25. package/dist/features/studio/findingSentence.js +14 -12
  26. package/dist/features/studio/fixMessage.js +23 -0
  27. package/dist/features/studio/reportSentence.js +1 -1
  28. package/dist/features/studio/{patrollerBio.js → specialistBio.js} +8 -5
  29. package/dist/features/studio/studioStore.js +29 -15
  30. package/dist/features/studio/workingSentence.js +1 -1
  31. package/dist/lib/api-client.js +5 -1
  32. package/dist/lib/queries.js +5 -5
  33. package/dist/lib/studio-reads.d.ts +1 -1
  34. package/dist/lib/studio-reads.js +5 -5
  35. package/dist/package.js +1 -1
  36. package/dist/studio.css +1 -1
  37. package/package.json +4 -4
  38. package/dist/features/studio/components/ReviewDraftSheet.js +0 -1587
@@ -5,7 +5,9 @@ import { useDrafts } from "./DraftsControl.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import * as React from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { useSelector } from "@xstate/store-react";
8
9
  import { Button } from "@camox/ui/button";
10
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
9
11
  import { FloatingToolbar } from "@camox/ui/floating-toolbar";
10
12
 
11
13
  //#region src/features/studio/components/DraftBar.tsx
@@ -14,88 +16,131 @@ import { FloatingToolbar } from "@camox/ui/floating-toolbar";
14
16
  */
15
17
  const SETTLE_MS = 1500;
16
18
  /**
17
- * Asks what to do with the draft being viewed, once its edits settle: delete it or publish it. `stacked` places it in the Preview toolbar's column, just above the toolbar;
19
+ * Asks what to do with the draft being viewed, once its edits settle: delete it or publish it.
20
+ * Publishing waits while Camox's agent is mid-turn in the draft, so half a change never goes live;
21
+ * nothing else Camox does holds it here. `stacked` places it in the Preview toolbar's column, just above the toolbar;
18
22
  * otherwise it floats at the bottom of the screen on its own.
19
23
  */
20
24
  function DraftBar(t0) {
21
- const $ = c(15);
25
+ const $ = c(26);
22
26
  const { stacked: t1 } = t0;
23
27
  const stacked = t1 === void 0 ? false : t1;
24
28
  const { projectId, current } = useDrafts();
25
29
  const settled = useSettled(current?.id ?? null, current?.lastChangedAt ?? null);
30
+ let t2;
31
+ if ($[0] !== current) {
32
+ t2 = (state) => !!current && state.context.agentWorkingIn === current.id;
33
+ $[0] = current;
34
+ $[1] = t2;
35
+ } else t2 = $[1];
36
+ const working = useSelector(studioStore, t2);
26
37
  if (!projectId || !current || !settled) return null;
27
38
  const empty = current.changeCount === 0;
28
- const t2 = stacked ? "pointer-events-auto relative left-auto translate-x-0" : "fixed bottom-2";
29
- let t3;
30
- if ($[0] !== t2) {
31
- t3 = cn("w-max gap-4", t2);
32
- $[0] = t2;
33
- $[1] = t3;
34
- } else t3 = $[1];
39
+ const t3 = stacked ? "pointer-events-auto relative left-auto translate-x-0" : "fixed bottom-2";
35
40
  let t4;
36
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
37
- t4 = /* @__PURE__ */ jsx("span", {
41
+ if ($[2] !== t3) {
42
+ t4 = cn("w-max gap-4", t3);
43
+ $[2] = t3;
44
+ $[3] = t4;
45
+ } else t4 = $[3];
46
+ let t5;
47
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
48
+ t5 = /* @__PURE__ */ jsx("span", {
38
49
  "aria-hidden": true,
39
50
  className: "size-2 shrink-0 rounded-full bg-blue-500"
40
51
  });
41
- $[2] = t4;
42
- } else t4 = $[2];
43
- let t5;
44
- if ($[3] !== current.changeCount || $[4] !== empty) {
45
- t5 = empty ? "No changes yet" : plural(current.changeCount, "pending change");
46
- $[3] = current.changeCount;
47
- $[4] = empty;
48
- $[5] = t5;
49
- } else t5 = $[5];
52
+ $[4] = t5;
53
+ } else t5 = $[4];
50
54
  let t6;
51
- if ($[6] !== t5) {
52
- t6 = /* @__PURE__ */ jsxs("span", {
53
- className: "flex items-center gap-2 px-2 text-sm",
54
- children: [t4, t5]
55
- });
56
- $[6] = t5;
55
+ if ($[5] !== current.changeCount || $[6] !== empty) {
56
+ t6 = empty ? "No changes yet" : plural(current.changeCount, "pending change");
57
+ $[5] = current.changeCount;
58
+ $[6] = empty;
57
59
  $[7] = t6;
58
60
  } else t6 = $[7];
59
61
  let t7;
60
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
61
- t7 = /* @__PURE__ */ jsx(Button, {
62
+ if ($[8] !== t6) {
63
+ t7 = /* @__PURE__ */ jsxs("span", {
64
+ className: "flex items-center gap-2 px-2 text-sm",
65
+ children: [t5, t6]
66
+ });
67
+ $[8] = t6;
68
+ $[9] = t7;
69
+ } else t7 = $[9];
70
+ let t8;
71
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
72
+ t8 = /* @__PURE__ */ jsx(Button, {
62
73
  type: "button",
63
74
  variant: "outline",
64
75
  onClick: _temp,
65
76
  children: "Delete"
66
77
  });
67
- $[8] = t7;
68
- } else t7 = $[8];
69
- let t8;
70
- if ($[9] !== empty) {
71
- t8 = /* @__PURE__ */ jsxs("div", {
78
+ $[10] = t8;
79
+ } else t8 = $[10];
80
+ const t9 = !working;
81
+ const t10 = working ? 0 : void 0;
82
+ let t11;
83
+ if ($[11] !== t10) {
84
+ t11 = /* @__PURE__ */ jsx("span", { tabIndex: t10 });
85
+ $[11] = t10;
86
+ $[12] = t11;
87
+ } else t11 = $[12];
88
+ const t12 = empty || working;
89
+ let t13;
90
+ if ($[13] !== t12) {
91
+ t13 = /* @__PURE__ */ jsx(Button, {
92
+ type: "button",
93
+ disabled: t12,
94
+ onClick: _temp2,
95
+ children: "Publish…"
96
+ });
97
+ $[13] = t12;
98
+ $[14] = t13;
99
+ } else t13 = $[14];
100
+ let t14;
101
+ if ($[15] !== t11 || $[16] !== t13) {
102
+ t14 = /* @__PURE__ */ jsx(TooltipTrigger, {
103
+ render: t11,
104
+ children: t13
105
+ });
106
+ $[15] = t11;
107
+ $[16] = t13;
108
+ $[17] = t14;
109
+ } else t14 = $[17];
110
+ let t15;
111
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
112
+ t15 = /* @__PURE__ */ jsx(TooltipContent, { children: "Camox's agent is working" });
113
+ $[18] = t15;
114
+ } else t15 = $[18];
115
+ let t16;
116
+ if ($[19] !== t14 || $[20] !== t9) {
117
+ t16 = /* @__PURE__ */ jsxs("div", {
72
118
  className: "flex items-center gap-2",
73
- children: [t7, /* @__PURE__ */ jsx(Button, {
74
- type: "button",
75
- disabled: empty,
76
- onClick: _temp2,
77
- children: "Publish…"
119
+ children: [t8, /* @__PURE__ */ jsxs(Tooltip, {
120
+ disabled: t9,
121
+ children: [t14, t15]
78
122
  })]
79
123
  });
80
- $[9] = empty;
81
- $[10] = t8;
82
- } else t8 = $[10];
83
- let t9;
84
- if ($[11] !== t3 || $[12] !== t6 || $[13] !== t8) {
85
- t9 = /* @__PURE__ */ jsxs(FloatingToolbar, {
124
+ $[19] = t14;
125
+ $[20] = t9;
126
+ $[21] = t16;
127
+ } else t16 = $[21];
128
+ let t17;
129
+ if ($[22] !== t16 || $[23] !== t4 || $[24] !== t7) {
130
+ t17 = /* @__PURE__ */ jsxs(FloatingToolbar, {
86
131
  "aria-label": "Draft",
87
- className: t3,
88
- children: [t6, t8]
132
+ className: t4,
133
+ children: [t7, t16]
89
134
  });
90
- $[11] = t3;
91
- $[12] = t6;
92
- $[13] = t8;
93
- $[14] = t9;
94
- } else t9 = $[14];
95
- return t9;
135
+ $[22] = t16;
136
+ $[23] = t4;
137
+ $[24] = t7;
138
+ $[25] = t17;
139
+ } else t17 = $[25];
140
+ return t17;
96
141
  }
97
142
  function _temp2() {
98
- return studioStore.send({ type: "openReviewDraftSheet" });
143
+ return studioStore.send({ type: "openReviewDraftDialog" });
99
144
  }
100
145
  function _temp() {
101
146
  return studioStore.send({ type: "openDeleteDraftDialog" });