@burdenoff/fe-libs 2026.929.1 → 2026.930.2
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/shared/assistant/api.d.ts +22 -0
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +112 -100
- package/dist/shared/assistant/i18nManifest.d.ts +1 -1
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +5 -1
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.js +104 -104
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +7 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +91 -87
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.js +3 -2
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +2 -2
- package/dist/shared/assistant/ui/useWriteProposals.d.ts +34 -2
- package/dist/shared/assistant/ui/useWriteProposals.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useWriteProposals.js +133 -115
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +26 -6
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts.map +1 -1
- package/dist/shared/assistant/ui/writeProposalPresentation.js +23 -16
- package/dist/shared/assistant/writeProposalDiscovery.d.ts +66 -2
- package/dist/shared/assistant/writeProposalDiscovery.d.ts.map +1 -1
- package/dist/shared/assistant/writeProposalDiscovery.js +121 -85
- package/dist/shared-assistant.js +155 -155
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePrefersReducedMotion as e } from "./usePrefersReducedMotion.js";
|
|
2
|
-
import { WRITE_PROPOSAL_MASK as t, formatWriteProposalValue as n, redactWriteProposalText as r, useWriteProposalRemainingMs as i, writeProposalArgumentValues as a, writeProposalConfirmState as o, writeProposalCountdownText as ee, writeProposalGatewayText as s, writeProposalKindText as te, writeProposalRootFieldName as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { ShieldAlert as
|
|
2
|
+
import { WRITE_PROPOSAL_MASK as t, formatWriteProposalValue as n, redactWriteProposalText as r, useWriteProposalRemainingMs as i, writeProposalArgumentValues as a, writeProposalConfirmState as o, writeProposalCountdownText as ee, writeProposalGatewayText as s, writeProposalKindText as te, writeProposalRootFieldName as ne, writeProposalSensitiveTexts as c, writeProposalVariableValues as l } from "./writeProposalPresentation.js";
|
|
3
|
+
import { useEffect as u, useId as re, useRef as d, useState as f } from "react";
|
|
4
|
+
import { ShieldAlert as p } from "lucide-react";
|
|
5
5
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
6
6
|
//#region src/shared/assistant/ui/AssistantWriteProposalCard.tsx
|
|
7
7
|
var g = new Set([
|
|
@@ -27,19 +27,23 @@ var v = 500, ie = [
|
|
|
27
27
|
.8,
|
|
28
28
|
.9,
|
|
29
29
|
1
|
|
30
|
-
]
|
|
30
|
+
], y = new Set([
|
|
31
|
+
"FORBIDDEN",
|
|
32
|
+
"PERMISSION_DENIED",
|
|
33
|
+
"HTTP_403"
|
|
34
|
+
]);
|
|
35
|
+
function b(e) {
|
|
36
|
+
return (e.result?.errors ?? []).some((e) => e.code !== void 0 && y.has(e.code));
|
|
37
|
+
}
|
|
31
38
|
function ae(e, t) {
|
|
32
39
|
switch (e.status) {
|
|
33
40
|
case "pending": return t("writeProposal.status.pending", "Waiting for you");
|
|
34
41
|
case "executing": return t("writeProposal.status.executing", "Working…");
|
|
35
42
|
case "succeeded": {
|
|
36
|
-
let n = r((e.result?.summary || e.description.readbackPast).trim(),
|
|
43
|
+
let n = r((e.result?.summary || e.description.readbackPast).trim(), c(e));
|
|
37
44
|
return n ? t("writeProposal.status.succeeded", "Done — {{summary}}", { summary: n }) : t("writeProposal.status.succeededNoDetail", "Done");
|
|
38
45
|
}
|
|
39
|
-
case "failed":
|
|
40
|
-
let n = r((e.result?.errors?.find((e) => e.message.trim())?.message ?? e.result?.summary ?? "").trim(), l(e));
|
|
41
|
-
return n ? t("writeProposal.status.failed", "Didn't go through: {{error}}", { error: n }) : t("writeProposal.status.failedNoDetail", "Didn't go through");
|
|
42
|
-
}
|
|
46
|
+
case "failed": return b(e) ? t("writeProposal.status.failedNotPermitted", "Didn't go through — you don't have permission") : t("writeProposal.status.failedNoDetail", "Didn't go through");
|
|
43
47
|
case "outcome_unknown": return t("writeProposal.status.outcomeUnknown", "Couldn't confirm — check before trying again");
|
|
44
48
|
case "declined": return t("writeProposal.status.declined", "Cancelled");
|
|
45
49
|
case "superseded": return t("writeProposal.status.superseded", "Replaced — the conversation moved on");
|
|
@@ -58,7 +62,7 @@ function oe(e) {
|
|
|
58
62
|
case "expired": return "border-border-subtle bg-bg-muted text-text-secondary";
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
|
-
function
|
|
65
|
+
function x(e, t) {
|
|
62
66
|
return [
|
|
63
67
|
{
|
|
64
68
|
key: "label",
|
|
@@ -76,11 +80,11 @@ function y(e, t) {
|
|
|
76
80
|
...t,
|
|
77
81
|
label: `${e.alias ?? e.field}.${t.label}`
|
|
78
82
|
}))),
|
|
79
|
-
...
|
|
83
|
+
...l(e)
|
|
80
84
|
];
|
|
81
85
|
}
|
|
82
86
|
function se(e, t, r) {
|
|
83
|
-
let i = new Map(
|
|
87
|
+
let i = new Map(x(e, r).map((e) => [e.key, e])), a = x(t, r), o = [];
|
|
84
88
|
for (let e of a) {
|
|
85
89
|
let t = i.get(e.key) ?? null;
|
|
86
90
|
i.delete(e.key), (!t || n(t.value) !== n(e.value)) && o.push({
|
|
@@ -98,45 +102,45 @@ function se(e, t, r) {
|
|
|
98
102
|
});
|
|
99
103
|
return o;
|
|
100
104
|
}
|
|
101
|
-
function
|
|
105
|
+
function S(e) {
|
|
102
106
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
103
107
|
}
|
|
104
|
-
var
|
|
105
|
-
let
|
|
108
|
+
var C = ({ view: g, serverNow: v, arrivedAt: y, capabilities: b, inert: x = !1, turnInFlight: C, tr: w, onApprove: ce, onDecline: le, onReview: ue, onPresented: T, previous: E }) => {
|
|
109
|
+
let D = e(), O = re(), k = d(null), A = g.status === "pending", j = i(g.expiresAt, v, y, A), M = j <= 0, [N, de] = f({
|
|
106
110
|
proposalId: g.proposalId,
|
|
107
111
|
keys: /* @__PURE__ */ new Set()
|
|
108
|
-
}), fe =
|
|
112
|
+
}), fe = N.proposalId === g.proposalId ? N.keys : /* @__PURE__ */ new Set(), P = (e) => de((t) => {
|
|
109
113
|
let n = new Set(t.proposalId === g.proposalId ? t.keys : []);
|
|
110
114
|
return n.has(e) ? n.delete(e) : n.add(e), {
|
|
111
115
|
proposalId: g.proposalId,
|
|
112
116
|
keys: n
|
|
113
117
|
};
|
|
114
|
-
}),
|
|
118
|
+
}), F = d(null), [I, L] = f(null), R = I?.proposalId === g.proposalId ? I.action : null, z = (e, t) => {
|
|
115
119
|
let n = g.proposalId;
|
|
116
|
-
if (
|
|
120
|
+
if (F.current?.proposalId === n) return;
|
|
117
121
|
let r = {
|
|
118
122
|
proposalId: n,
|
|
119
123
|
action: e
|
|
120
124
|
};
|
|
121
|
-
|
|
125
|
+
F.current = r, L(r);
|
|
122
126
|
let i = () => {
|
|
123
|
-
|
|
127
|
+
F.current === r && (F.current = null, L((e) => e === r ? null : e));
|
|
124
128
|
}, a;
|
|
125
129
|
try {
|
|
126
130
|
a = t();
|
|
127
131
|
} catch (e) {
|
|
128
132
|
throw i(), e;
|
|
129
133
|
}
|
|
130
|
-
|
|
131
|
-
}, { available:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
S(a) && a.then(i, i);
|
|
135
|
+
}, { available: B, fenced: pe, showControls: V, offerConfirm: H } = o(g, x ? null : b), U = d(T);
|
|
136
|
+
u(() => {
|
|
137
|
+
U.current = T;
|
|
134
138
|
});
|
|
135
|
-
let
|
|
136
|
-
|
|
139
|
+
let W = d(null);
|
|
140
|
+
u(() => {
|
|
137
141
|
let e = g.proposalId;
|
|
138
|
-
if (!
|
|
139
|
-
let t =
|
|
142
|
+
if (!A || !B || W.current === e) return;
|
|
143
|
+
let t = k.current;
|
|
140
144
|
if (!t || typeof IntersectionObserver > "u") return;
|
|
141
145
|
let n = null, r = () => {
|
|
142
146
|
n !== null && clearTimeout(n), n = null;
|
|
@@ -148,7 +152,7 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
148
152
|
return;
|
|
149
153
|
}
|
|
150
154
|
n === null && (n = setTimeout(() => {
|
|
151
|
-
n = null,
|
|
155
|
+
n = null, W.current !== e && (W.current = e, i.disconnect(), U.current("card"));
|
|
152
156
|
}, 500));
|
|
153
157
|
}
|
|
154
158
|
}, { threshold: ie });
|
|
@@ -157,19 +161,19 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
157
161
|
};
|
|
158
162
|
}, [
|
|
159
163
|
g.proposalId,
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
A,
|
|
165
|
+
B
|
|
162
166
|
]);
|
|
163
|
-
let
|
|
164
|
-
e.isTrusted && (!
|
|
165
|
-
}, me = () => {
|
|
166
|
-
!B || G || L("decline", le);
|
|
167
|
+
let G = _(g), K = C || R !== null, q = K || M, me = (e) => {
|
|
168
|
+
e.isTrusted && (!H || G || q || z("approve", ce));
|
|
167
169
|
}, he = () => {
|
|
168
|
-
!V ||
|
|
169
|
-
}, ge =
|
|
170
|
+
!V || K || z("decline", le);
|
|
171
|
+
}, ge = () => {
|
|
172
|
+
!H || !G || q || ue();
|
|
173
|
+
}, _e = ae(g, w), J = [...new Set(g.risk.kinds)].map((e) => ({
|
|
170
174
|
kind: e,
|
|
171
|
-
text: te(e,
|
|
172
|
-
})).filter((e) => !!e.text), Y =
|
|
175
|
+
text: te(e, w)
|
|
176
|
+
})).filter((e) => !!e.text), Y = l(g), X = g.revision > 1 && E && E.proposalId === g.supersedes ? se(E, g, w) : null, Z = (e, r) => {
|
|
173
177
|
let i = e.sensitive && !fe.has(e.key);
|
|
174
178
|
return /* @__PURE__ */ h("span", {
|
|
175
179
|
className: "inline-flex min-w-0 flex-wrap items-baseline gap-x-2",
|
|
@@ -181,25 +185,25 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
181
185
|
children: t
|
|
182
186
|
}), /* @__PURE__ */ m("span", {
|
|
183
187
|
className: "sr-only",
|
|
184
|
-
children:
|
|
188
|
+
children: w("writeProposal.hiddenValue", "Hidden value")
|
|
185
189
|
})]
|
|
186
190
|
}) : /* @__PURE__ */ m("span", {
|
|
187
191
|
className: "min-w-0 whitespace-pre-wrap break-words font-medium text-text-primary",
|
|
188
192
|
children: n(e.value)
|
|
189
193
|
}), e.sensitive && r ? /* @__PURE__ */ m("button", {
|
|
190
194
|
type: "button",
|
|
191
|
-
onClick: () =>
|
|
195
|
+
onClick: () => P(e.key),
|
|
192
196
|
"aria-pressed": !i,
|
|
193
197
|
"aria-describedby": r,
|
|
194
198
|
className: "rounded text-[11px] font-medium text-text-link underline focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
195
199
|
"data-testid": "assistant-write-proposal-reveal",
|
|
196
|
-
children: i ?
|
|
200
|
+
children: i ? w("writeProposal.showValue", "Show") : w("writeProposal.hideValue", "Hide")
|
|
197
201
|
}) : null]
|
|
198
202
|
});
|
|
199
203
|
}, Q = (e, t) => /* @__PURE__ */ m("dl", {
|
|
200
204
|
className: "mt-1 grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",
|
|
201
205
|
children: e.map((e, n) => {
|
|
202
|
-
let r = `${
|
|
206
|
+
let r = `${O}-${t}-${n}`;
|
|
203
207
|
return /* @__PURE__ */ h("div", {
|
|
204
208
|
className: "contents",
|
|
205
209
|
children: [/* @__PURE__ */ m("dt", {
|
|
@@ -212,12 +216,12 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
212
216
|
})]
|
|
213
217
|
}, `${n}:${e.key}`);
|
|
214
218
|
})
|
|
215
|
-
}),
|
|
219
|
+
}), ve = c(g), $ = g.description.consequences.map((e) => r(e, ve));
|
|
216
220
|
return /* @__PURE__ */ h("div", {
|
|
217
|
-
ref:
|
|
221
|
+
ref: k,
|
|
218
222
|
role: "group",
|
|
219
|
-
"aria-label":
|
|
220
|
-
className: `my-2 overflow-hidden rounded-xl border ${
|
|
223
|
+
"aria-label": w("writeProposal.aria", "Proposed change: {{label}}", { label: g.description.label }),
|
|
224
|
+
className: `my-2 overflow-hidden rounded-xl border ${A ? "border-status-warning bg-status-warning/10" : "border-border-subtle bg-bg-surface"}`,
|
|
221
225
|
"data-testid": "assistant-write-proposal",
|
|
222
226
|
"data-status": g.status,
|
|
223
227
|
children: [
|
|
@@ -225,7 +229,7 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
225
229
|
className: "flex items-start justify-between gap-2 border-b border-border-subtle px-3 py-2",
|
|
226
230
|
children: [/* @__PURE__ */ h("div", {
|
|
227
231
|
className: "flex min-w-0 items-start gap-2",
|
|
228
|
-
children: [/* @__PURE__ */ m(
|
|
232
|
+
children: [/* @__PURE__ */ m(p, {
|
|
229
233
|
className: "mt-0.5 size-4 flex-shrink-0 text-status-warning",
|
|
230
234
|
"aria-hidden": "true"
|
|
231
235
|
}), /* @__PURE__ */ h("div", {
|
|
@@ -238,11 +242,11 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
238
242
|
}),
|
|
239
243
|
/* @__PURE__ */ m("p", {
|
|
240
244
|
className: "text-[11px] text-text-muted",
|
|
241
|
-
children: s(g,
|
|
245
|
+
children: s(g, w)
|
|
242
246
|
}),
|
|
243
|
-
|
|
247
|
+
H ? /* @__PURE__ */ m("p", {
|
|
244
248
|
className: "text-[11px] text-text-secondary",
|
|
245
|
-
children:
|
|
249
|
+
children: w("writeProposal.title", "Review and approve this change.")
|
|
246
250
|
}) : null
|
|
247
251
|
]
|
|
248
252
|
})]
|
|
@@ -252,7 +256,7 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
252
256
|
"aria-atomic": "true",
|
|
253
257
|
className: `max-w-[50%] flex-shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium break-words ${oe(g)}`,
|
|
254
258
|
"data-testid": "assistant-write-proposal-status",
|
|
255
|
-
children:
|
|
259
|
+
children: _e
|
|
256
260
|
})]
|
|
257
261
|
}),
|
|
258
262
|
/* @__PURE__ */ h("div", {
|
|
@@ -272,7 +276,7 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
272
276
|
"data-testid": "assistant-write-proposal-field",
|
|
273
277
|
children: [/* @__PURE__ */ m("p", {
|
|
274
278
|
className: "break-words font-mono text-xs text-text-primary",
|
|
275
|
-
children:
|
|
279
|
+
children: ne(e)
|
|
276
280
|
}), n.length > 0 ? Q(n, `field${t}`) : null]
|
|
277
281
|
}, `${t}:${e.alias ?? e.field}`);
|
|
278
282
|
}),
|
|
@@ -280,21 +284,21 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
280
284
|
"data-testid": "assistant-write-proposal-variables",
|
|
281
285
|
children: [/* @__PURE__ */ m("p", {
|
|
282
286
|
className: "text-[11px] font-medium text-text-secondary",
|
|
283
|
-
children:
|
|
287
|
+
children: w("writeProposal.values", "Values")
|
|
284
288
|
}), Q(Y, "vars")]
|
|
285
289
|
}) : null,
|
|
286
290
|
g.description.variablesOmitted ? /* @__PURE__ */ m("p", {
|
|
287
291
|
className: "text-[11px] text-text-muted",
|
|
288
|
-
children:
|
|
292
|
+
children: w("writeProposal.variablesOmitted", "{{count}} more values not shown", { count: g.description.variablesOmitted })
|
|
289
293
|
}) : null,
|
|
290
294
|
g.description.targetCount > 0 ? /* @__PURE__ */ m("p", {
|
|
291
295
|
className: "text-xs text-text-secondary",
|
|
292
296
|
"data-testid": "assistant-write-proposal-target-count",
|
|
293
|
-
children:
|
|
297
|
+
children: w("writeProposal.targetCount", "Items affected: {{count}}", { count: g.description.targetCount })
|
|
294
298
|
}) : null,
|
|
295
299
|
$.length > 0 ? /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
296
300
|
className: "text-[11px] font-medium text-text-secondary",
|
|
297
|
-
children:
|
|
301
|
+
children: w("writeProposal.consequences", "What this will do")
|
|
298
302
|
}), /* @__PURE__ */ m("ul", {
|
|
299
303
|
className: "list-disc pl-4 text-xs text-text-primary",
|
|
300
304
|
"data-testid": "assistant-write-proposal-consequences",
|
|
@@ -302,18 +306,18 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
302
306
|
})] }) : null,
|
|
303
307
|
g.repeatOf ? /* @__PURE__ */ m("p", {
|
|
304
308
|
className: "text-xs text-status-warning-text",
|
|
305
|
-
children:
|
|
309
|
+
children: w("writeProposal.repeat", "You made this same change recently. Confirming makes it again.")
|
|
306
310
|
}) : null,
|
|
307
311
|
g.revision > 1 ? /* @__PURE__ */ h("div", {
|
|
308
312
|
"data-testid": "assistant-write-proposal-revision",
|
|
309
313
|
children: [
|
|
310
314
|
/* @__PURE__ */ m("p", {
|
|
311
315
|
className: "text-[11px] font-medium text-text-secondary",
|
|
312
|
-
children:
|
|
316
|
+
children: w("writeProposal.revision", "Revised — version {{revision}}", { revision: g.revision })
|
|
313
317
|
}),
|
|
314
318
|
X && X.length === 0 ? /* @__PURE__ */ m("p", {
|
|
315
319
|
className: "text-[11px] text-text-muted",
|
|
316
|
-
children:
|
|
320
|
+
children: w("writeProposal.diff.none", "No values changed")
|
|
317
321
|
}) : null,
|
|
318
322
|
X && X.length > 0 ? /* @__PURE__ */ h("table", {
|
|
319
323
|
className: "mt-1 w-full table-fixed text-xs",
|
|
@@ -326,18 +330,18 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
326
330
|
className: "w-1/3 font-medium",
|
|
327
331
|
children: /* @__PURE__ */ m("span", {
|
|
328
332
|
className: "sr-only",
|
|
329
|
-
children:
|
|
333
|
+
children: w("writeProposal.diff.value", "Value")
|
|
330
334
|
})
|
|
331
335
|
}),
|
|
332
336
|
/* @__PURE__ */ m("th", {
|
|
333
337
|
scope: "col",
|
|
334
338
|
className: "font-medium",
|
|
335
|
-
children:
|
|
339
|
+
children: w("writeProposal.diff.before", "Before")
|
|
336
340
|
}),
|
|
337
341
|
/* @__PURE__ */ m("th", {
|
|
338
342
|
scope: "col",
|
|
339
343
|
className: "font-medium",
|
|
340
|
-
children:
|
|
344
|
+
children: w("writeProposal.diff.after", "After")
|
|
341
345
|
})
|
|
342
346
|
]
|
|
343
347
|
}) }), /* @__PURE__ */ m("tbody", { children: X.map((e) => /* @__PURE__ */ h("tr", {
|
|
@@ -355,14 +359,14 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
355
359
|
sensitive: e.before.sensitive || !!e.after?.sensitive
|
|
356
360
|
}, null) : /* @__PURE__ */ m("span", {
|
|
357
361
|
className: "text-text-muted",
|
|
358
|
-
children:
|
|
362
|
+
children: w("writeProposal.diff.absent", "(not set)")
|
|
359
363
|
})
|
|
360
364
|
}),
|
|
361
365
|
/* @__PURE__ */ m("td", {
|
|
362
366
|
className: "break-words",
|
|
363
367
|
children: e.after ? Z(e.after, null) : /* @__PURE__ */ m("span", {
|
|
364
368
|
className: "text-text-muted",
|
|
365
|
-
children:
|
|
369
|
+
children: w("writeProposal.diff.absent", "(not set)")
|
|
366
370
|
})
|
|
367
371
|
})
|
|
368
372
|
]
|
|
@@ -372,63 +376,63 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
372
376
|
}) : null
|
|
373
377
|
]
|
|
374
378
|
}),
|
|
375
|
-
|
|
379
|
+
A ? /* @__PURE__ */ h("div", {
|
|
376
380
|
className: "space-y-1 border-t border-border-subtle px-3 py-2 text-[11px]",
|
|
377
381
|
children: [
|
|
378
382
|
/* @__PURE__ */ m("p", {
|
|
379
383
|
className: "text-text-secondary",
|
|
380
384
|
"data-testid": "assistant-write-proposal-countdown",
|
|
381
|
-
children:
|
|
385
|
+
children: M ? w("writeProposal.timeUp", "Time's up — this can no longer be confirmed") : ee(j, D, w)
|
|
382
386
|
}),
|
|
383
387
|
x ? /* @__PURE__ */ m("p", {
|
|
384
388
|
className: "text-text-secondary",
|
|
385
389
|
"data-testid": "assistant-write-proposal-inert",
|
|
386
|
-
children:
|
|
387
|
-
}) :
|
|
390
|
+
children: w("writeProposal.inert", "This change can no longer be confirmed here. Nothing was done; ask the assistant to prepare it again if you still want it.")
|
|
391
|
+
}) : B ? g.approvable ? pe ? /* @__PURE__ */ m("p", {
|
|
388
392
|
className: "text-text-secondary",
|
|
389
393
|
"data-testid": "assistant-write-proposal-fenced",
|
|
390
|
-
children:
|
|
394
|
+
children: w("writeProposal.executionFenced", "You can review or cancel this change. Running it from the assistant becomes available once secure confirmation is enabled.")
|
|
391
395
|
}) : null : /* @__PURE__ */ m("p", {
|
|
392
396
|
className: "text-text-secondary",
|
|
393
397
|
"data-testid": "assistant-write-proposal-not-approvable",
|
|
394
|
-
children:
|
|
398
|
+
children: w("writeProposal.notApprovable", "This change isn't ready to confirm. If it stays this way, ask the assistant to prepare it again.")
|
|
395
399
|
}) : /* @__PURE__ */ m("p", {
|
|
396
400
|
className: "text-text-secondary",
|
|
397
401
|
"data-testid": "assistant-write-proposal-not-available",
|
|
398
|
-
children:
|
|
402
|
+
children: w("writeProposal.notAvailableYet", "Confirming changes from the assistant isn't available in this session yet.")
|
|
399
403
|
}),
|
|
400
|
-
|
|
404
|
+
V && C ? /* @__PURE__ */ m("p", {
|
|
401
405
|
className: "text-text-muted",
|
|
402
|
-
children:
|
|
406
|
+
children: w("writeProposal.waitForTurn", "You can confirm once the assistant finishes replying.")
|
|
403
407
|
}) : null
|
|
404
408
|
]
|
|
405
409
|
}) : null,
|
|
406
|
-
|
|
410
|
+
V ? /* @__PURE__ */ h("div", {
|
|
407
411
|
className: "flex flex-wrap justify-end gap-2 border-t border-border-subtle px-3 py-2",
|
|
408
412
|
children: [
|
|
409
413
|
/* @__PURE__ */ m("button", {
|
|
410
414
|
type: "button",
|
|
411
|
-
onClick:
|
|
412
|
-
disabled:
|
|
415
|
+
onClick: he,
|
|
416
|
+
disabled: K,
|
|
413
417
|
className: "rounded-md border border-action-secondary-border bg-action-secondary-bg px-3 py-1.5 text-xs font-medium text-action-secondary-fg hover:bg-action-secondary-bg-hover disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
414
418
|
"data-testid": "assistant-write-proposal-cancel",
|
|
415
|
-
children:
|
|
419
|
+
children: w("writeProposal.cancel", "Cancel")
|
|
416
420
|
}),
|
|
417
|
-
|
|
421
|
+
H && G ? /* @__PURE__ */ m("button", {
|
|
418
422
|
type: "button",
|
|
419
|
-
onClick:
|
|
420
|
-
disabled:
|
|
423
|
+
onClick: ge,
|
|
424
|
+
disabled: q,
|
|
421
425
|
className: "rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-fg hover:bg-action-primary-bg-hover disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
422
426
|
"data-testid": "assistant-write-proposal-review",
|
|
423
|
-
children:
|
|
427
|
+
children: w("writeProposal.review", "Review & confirm…")
|
|
424
428
|
}) : null,
|
|
425
|
-
|
|
429
|
+
H && !G ? /* @__PURE__ */ m("button", {
|
|
426
430
|
type: "button",
|
|
427
|
-
onClick:
|
|
428
|
-
disabled:
|
|
431
|
+
onClick: me,
|
|
432
|
+
disabled: q,
|
|
429
433
|
className: "rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-fg hover:bg-action-primary-bg-hover disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
430
434
|
"data-testid": "assistant-write-proposal-confirm",
|
|
431
|
-
children:
|
|
435
|
+
children: R === "approve" ? w("writeProposal.confirming", "Confirming…") : g.description.confirmLabel.trim() || w("writeProposal.confirmFallback", "Confirm this change")
|
|
432
436
|
}) : null
|
|
433
437
|
]
|
|
434
438
|
}) : null
|
|
@@ -436,4 +440,4 @@ var x = ({ view: g, serverNow: v, capabilities: y, inert: x = !1, turnInFlight:
|
|
|
436
440
|
});
|
|
437
441
|
};
|
|
438
442
|
//#endregion
|
|
439
|
-
export {
|
|
443
|
+
export { C as AssistantWriteProposalCard, g as WRITE_PROPOSAL_DIALOG_KINDS, v as WRITE_PROPOSAL_PRESENTED_AFTER_MS, _ as writeProposalUsesDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantWriteProposalSlot.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantWriteProposalSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACzC,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,+DAA+D;IAC/D,cAAc,EAAE,CACd,SAAS,EAAE,MAAM,KACd,wBAAwB,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,uEAAuE;IACvE,YAAY,EAAE,OAAO,CAAC;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB,oDAAoD;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,0BAA0B,EAAE,EAAE,CACzC,+BAA+B,
|
|
1
|
+
{"version":3,"file":"AssistantWriteProposalSlot.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantWriteProposalSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACzC,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,+DAA+D;IAC/D,cAAc,EAAE,CACd,SAAS,EAAE,MAAM,KACd,wBAAwB,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,uEAAuE;IACvE,YAAY,EAAE,OAAO,CAAC;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB,oDAAoD;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,0BAA0B,EAAE,EAAE,CACzC,+BAA+B,CAqDhC,CAAC"}
|
|
@@ -15,10 +15,11 @@ var a = ({ refs: a, conversationId: o, panel: s, entries: c, capabilitiesOf: l,
|
|
|
15
15
|
]), /* @__PURE__ */ i(r, { children: a.map((t) => {
|
|
16
16
|
let n = c[t.proposalId];
|
|
17
17
|
if (!n) return null;
|
|
18
|
-
let { view: r, serverNow: a } = n,
|
|
18
|
+
let { view: r, serverNow: a, arrivedAt: o } = n, m = r.supersedes ? c[r.supersedes]?.view ?? null : null;
|
|
19
19
|
return /* @__PURE__ */ i(e, {
|
|
20
20
|
view: r,
|
|
21
21
|
serverNow: a,
|
|
22
|
+
arrivedAt: o,
|
|
22
23
|
capabilities: l(n.session.sandboxId),
|
|
23
24
|
inert: p?.has(n.session.sandboxId) ?? !1,
|
|
24
25
|
turnInFlight: u,
|
|
@@ -27,7 +28,7 @@ var a = ({ refs: a, conversationId: o, panel: s, entries: c, capabilitiesOf: l,
|
|
|
27
28
|
onDecline: () => s.decline(r, "user_declined", "card"),
|
|
28
29
|
onReview: () => f(r),
|
|
29
30
|
onPresented: (e) => void s.presented(r, e),
|
|
30
|
-
previous:
|
|
31
|
+
previous: m
|
|
31
32
|
}, t.proposalId);
|
|
32
33
|
}) });
|
|
33
34
|
};
|
|
@@ -20,8 +20,8 @@ import { AssistantWriteConfirmDialogProps } from './AssistantWriteConfirmDialog'
|
|
|
20
20
|
*
|
|
21
21
|
* const confirm = useWriteProposalConfirm(actions);
|
|
22
22
|
* <AssistantWriteProposalCard … onReview={() => confirm.review(view)} />
|
|
23
|
-
* <AssistantWriteConfirmDialog {...confirm.dialog} serverNow=…
|
|
24
|
-
* turnInFlight=… tr=… />
|
|
23
|
+
* <AssistantWriteConfirmDialog {...confirm.dialog} serverNow=… arrivedAt=…
|
|
24
|
+
* capabilities=… turnInFlight=… tr=… />
|
|
25
25
|
*
|
|
26
26
|
* Call `dismiss()` when the proposal can no longer be confirmed here (it was
|
|
27
27
|
* replaced, the conversation or mode changed): that closes the default dialog
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssistantTr } from '../i18n';
|
|
2
2
|
import { WriteProposalMessageRef, WriteProposalSession } from '../writeProposalDiscovery';
|
|
3
|
-
import { WriteProposalApproveSurface, WriteProposalDeclineReason, WriteProposalDecisionSurface, WriteProposalPresentationSurface, WriteProposalView } from '../writeProposals';
|
|
3
|
+
import { WriteApprovalMode, WriteProposalApproveSurface, WriteProposalDeclineReason, WriteProposalDecisionSurface, WriteProposalPresentationSurface, WriteProposalView } from '../writeProposals';
|
|
4
4
|
import { WriteReplyDeclineReason } from '../writeReplyBinder';
|
|
5
5
|
import { WriteReplyLiveState, WriteReplyPersonOrigin } from '../writeReplySend';
|
|
6
6
|
/**
|
|
@@ -22,6 +22,20 @@ import { WriteReplyLiveState, WriteReplyPersonOrigin } from '../writeReplySend';
|
|
|
22
22
|
* - every 2 s while one of the session's proposals is executing, stopping at
|
|
23
23
|
* the terminal state and when the panel unmounts.
|
|
24
24
|
*
|
|
25
|
+
* ★★ BOFF-8128, after a reload: `/health` answers are never persisted, so
|
|
26
|
+
* when a conversation reopens the sandbox that issued its proposals has not
|
|
27
|
+
* been read in this page, and nothing may be asked of it. The sessions that
|
|
28
|
+
* need it wait for its `/health`; the panel reads it ONCE (a single attempt,
|
|
29
|
+
* only under a `proposal-v1` product, only for a Take-action sandbox), and
|
|
30
|
+
* any `/health` of that sandbox that arrives — this read, a pre-warm, a turn —
|
|
31
|
+
* lists the waiting sessions ONCE. Their cards are then drawn from the
|
|
32
|
+
* records like any other: a finished change inert, a waiting one with its
|
|
33
|
+
* confirm while the record says it can still be confirmed. A read that fails
|
|
34
|
+
* shows nothing and is not retried until the next natural trigger (the
|
|
35
|
+
* conversation opened again, a turn, the panel mounted again) — never in a
|
|
36
|
+
* loop. Nothing is re-run, no reference is written for a finished change, and
|
|
37
|
+
* references never leave the device (`historyMapping`).
|
|
38
|
+
*
|
|
25
39
|
* ★ References, not records, go into the thread: a new live proposal's
|
|
26
40
|
* `{proposalId, sandboxId, sessionId}` is attached to the reply of the turn
|
|
27
41
|
* that raised it (or, found later, the newest reply of its session). The view
|
|
@@ -48,6 +62,12 @@ export interface WriteProposalEntry {
|
|
|
48
62
|
view: WriteProposalView;
|
|
49
63
|
/** That sandbox's clock at the read the view came from (`list().serverNow`). */
|
|
50
64
|
serverNow: number;
|
|
65
|
+
/**
|
|
66
|
+
* This device's clock when that read arrived: with `serverNow`, one sample
|
|
67
|
+
* of the sandbox's clock, which stays true however long after it a card is
|
|
68
|
+
* drawn (BOFF-8163).
|
|
69
|
+
*/
|
|
70
|
+
arrivedAt: number;
|
|
51
71
|
/** Where the proposal lives: its issuing sandbox, session and conversation. */
|
|
52
72
|
session: WriteProposalSession;
|
|
53
73
|
}
|
|
@@ -56,7 +76,11 @@ export type WriteProposalEntries = Readonly<Record<string, WriteProposalEntry>>;
|
|
|
56
76
|
export interface WriteProposalPanel {
|
|
57
77
|
/** A turn in `session` settled; new live proposals attach to its reply. */
|
|
58
78
|
afterTurn: (session: WriteProposalSession, turnMessageId: string) => void;
|
|
59
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* A conversation opened: read every session its cards belong to — at once
|
|
81
|
+
* where the issuing sandbox's `/health` was read in this page, and otherwise
|
|
82
|
+
* once it is (BOFF-8128).
|
|
83
|
+
*/
|
|
60
84
|
openConversation: (conversationId: string) => void;
|
|
61
85
|
/** A card mounted: read its session unless this panel already holds it. */
|
|
62
86
|
ensureKnown: (ref: WriteProposalMessageRef, conversationId: string) => void;
|
|
@@ -93,6 +117,14 @@ export interface WriteProposalPanel {
|
|
|
93
117
|
}
|
|
94
118
|
export declare function useWriteProposals(options: {
|
|
95
119
|
tr: AssistantTr;
|
|
120
|
+
/**
|
|
121
|
+
* The product's `writeApproval` flag (BOFF-8128). Only under `proposal-v1`
|
|
122
|
+
* does a reopened conversation read the `/health` of a sandbox that issued
|
|
123
|
+
* its proposals when this page has not read it (after a reload); anything
|
|
124
|
+
* else, or absent, asks nothing more than before. Never decides what a card
|
|
125
|
+
* offers: that follows the sandbox's own `/health`.
|
|
126
|
+
*/
|
|
127
|
+
productWriteApproval?: WriteApprovalMode;
|
|
96
128
|
}): {
|
|
97
129
|
panel: WriteProposalPanel;
|
|
98
130
|
entries: WriteProposalEntries;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWriteProposals.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useWriteProposals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useWriteProposals.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useWriteProposals.ts"],"names":[],"mappings":"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"}
|