@burdenoff/fe-libs 2026.928.3 → 2026.930.1

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 (129) hide show
  1. package/dist/shared/assistant/adminModeSendGate.d.ts +6 -5
  2. package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
  3. package/dist/shared/assistant/adminModeSendGate.js +11 -11
  4. package/dist/shared/assistant/api.d.ts +313 -28
  5. package/dist/shared/assistant/api.d.ts.map +1 -1
  6. package/dist/shared/assistant/api.js +351 -135
  7. package/dist/shared/assistant/autoRouting.d.ts +11 -3
  8. package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
  9. package/dist/shared/assistant/autoRouting.js +7 -7
  10. package/dist/shared/assistant/capabilities.d.ts +28 -0
  11. package/dist/shared/assistant/capabilities.d.ts.map +1 -1
  12. package/dist/shared/assistant/capabilities.js +19 -10
  13. package/dist/shared/assistant/conversation.d.ts +24 -2
  14. package/dist/shared/assistant/conversation.d.ts.map +1 -1
  15. package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
  16. package/dist/shared/assistant/createSandboxAssistantTransport.js +67 -54
  17. package/dist/shared/assistant/history/historyList.js +1 -1
  18. package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
  19. package/dist/shared/assistant/history/historyMapping.js +5 -1
  20. package/dist/shared/assistant/history/historyResume.js +7 -7
  21. package/dist/shared/assistant/i18nManifest.d.ts +53 -0
  22. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  23. package/dist/shared/assistant/i18nManifest.js +75 -16
  24. package/dist/shared/assistant/index.d.ts +15 -0
  25. package/dist/shared/assistant/index.d.ts.map +1 -1
  26. package/dist/shared/assistant/modeCapabilities.js +1 -1
  27. package/dist/shared/assistant/operations.d.ts +22 -0
  28. package/dist/shared/assistant/operations.d.ts.map +1 -1
  29. package/dist/shared/assistant/operations.js +2 -2
  30. package/dist/shared/assistant/prewarm.d.ts +7 -0
  31. package/dist/shared/assistant/prewarm.d.ts.map +1 -1
  32. package/dist/shared/assistant/prewarm.js +1 -1
  33. package/dist/shared/assistant/product.d.ts +80 -2
  34. package/dist/shared/assistant/product.d.ts.map +1 -1
  35. package/dist/shared/assistant/product.js +10 -6
  36. package/dist/shared/assistant/proposalWriteRules.d.ts +40 -0
  37. package/dist/shared/assistant/proposalWriteRules.d.ts.map +1 -0
  38. package/dist/shared/assistant/proposalWriteRules.js +14 -0
  39. package/dist/shared/assistant/store.d.ts +17 -0
  40. package/dist/shared/assistant/store.d.ts.map +1 -1
  41. package/dist/shared/assistant/store.js +50 -43
  42. package/dist/shared/assistant/turnOutcome.d.ts +34 -2
  43. package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
  44. package/dist/shared/assistant/turnOutcome.js +28 -17
  45. package/dist/shared/assistant/turnOutcomeCopy.d.ts +29 -7
  46. package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
  47. package/dist/shared/assistant/turnOutcomeCopy.js +18 -6
  48. package/dist/shared/assistant/types.d.ts +5 -1
  49. package/dist/shared/assistant/types.d.ts.map +1 -1
  50. package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +4 -4
  51. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  52. package/dist/shared/assistant/ui/AssistantChatArea.js +992 -718
  53. package/dist/shared/assistant/ui/AssistantConversationList.js +6 -6
  54. package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
  55. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +8 -1
  56. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
  57. package/dist/shared/assistant/ui/AssistantMessageItem.js +77 -76
  58. package/dist/shared/assistant/ui/AssistantMessageList.d.ts +13 -1
  59. package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
  60. package/dist/shared/assistant/ui/AssistantMessageList.js +15 -13
  61. package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
  62. package/dist/shared/assistant/ui/AssistantSpeechProvider.js +209 -209
  63. package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +62 -0
  64. package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts.map +1 -0
  65. package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.js +253 -0
  66. package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +72 -0
  67. package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts.map +1 -0
  68. package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +439 -0
  69. package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts +40 -0
  70. package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts.map +1 -0
  71. package/dist/shared/assistant/ui/AssistantWriteProposalSlot.js +35 -0
  72. package/dist/shared/assistant/ui/composer/AssistantComposer.js +8 -8
  73. package/dist/shared/assistant/ui/useVoiceSession.d.ts +28 -0
  74. package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
  75. package/dist/shared/assistant/ui/useVoiceSession.js +159 -110
  76. package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +61 -0
  77. package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts.map +1 -0
  78. package/dist/shared/assistant/ui/useWriteProposalConfirm.js +109 -0
  79. package/dist/shared/assistant/ui/useWriteProposals.d.ts +128 -0
  80. package/dist/shared/assistant/ui/useWriteProposals.d.ts.map +1 -0
  81. package/dist/shared/assistant/ui/useWriteProposals.js +240 -0
  82. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +17 -1
  83. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
  84. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +141 -109
  85. package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +76 -0
  86. package/dist/shared/assistant/ui/writeProposalPresentation.d.ts.map +1 -0
  87. package/dist/shared/assistant/ui/writeProposalPresentation.js +110 -0
  88. package/dist/shared/assistant/usageReporting.d.ts +108 -0
  89. package/dist/shared/assistant/usageReporting.d.ts.map +1 -0
  90. package/dist/shared/assistant/usageReporting.js +155 -0
  91. package/dist/shared/assistant/useAssistantApiAccess.d.ts +49 -14
  92. package/dist/shared/assistant/useAssistantApiAccess.d.ts.map +1 -1
  93. package/dist/shared/assistant/useAssistantApiAccess.js +43 -25
  94. package/dist/shared/assistant/useAssistantHeartbeat.d.ts.map +1 -1
  95. package/dist/shared/assistant/useAssistantHeartbeat.js +5 -5
  96. package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts +5 -6
  97. package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts.map +1 -1
  98. package/dist/shared/assistant/voice/voiceSession.d.ts +46 -0
  99. package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
  100. package/dist/shared/assistant/voice/voiceSession.js +35 -2
  101. package/dist/shared/assistant/writeConfirmSeam.d.ts +32 -0
  102. package/dist/shared/assistant/writeConfirmSeam.d.ts.map +1 -0
  103. package/dist/shared/assistant/writeConfirmSeam.js +23 -0
  104. package/dist/shared/assistant/writeModeConsent.d.ts +16 -8
  105. package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -1
  106. package/dist/shared/assistant/writeModeConsent.js +2 -2
  107. package/dist/shared/assistant/writeProposalDiscovery.d.ts +187 -0
  108. package/dist/shared/assistant/writeProposalDiscovery.d.ts.map +1 -0
  109. package/dist/shared/assistant/writeProposalDiscovery.js +246 -0
  110. package/dist/shared/assistant/writeProposalErrorCopy.d.ts +135 -0
  111. package/dist/shared/assistant/writeProposalErrorCopy.d.ts.map +1 -0
  112. package/dist/shared/assistant/writeProposalErrorCopy.js +135 -0
  113. package/dist/shared/assistant/writeProposalVoice.d.ts +133 -0
  114. package/dist/shared/assistant/writeProposalVoice.d.ts.map +1 -0
  115. package/dist/shared/assistant/writeProposalVoice.js +66 -0
  116. package/dist/shared/assistant/writeProposals.d.ts +268 -0
  117. package/dist/shared/assistant/writeProposals.d.ts.map +1 -0
  118. package/dist/shared/assistant/writeProposals.js +445 -0
  119. package/dist/shared/assistant/writeReplyBinder.d.ts +166 -0
  120. package/dist/shared/assistant/writeReplyBinder.d.ts.map +1 -0
  121. package/dist/shared/assistant/writeReplyBinder.js +233 -0
  122. package/dist/shared/assistant/writeReplySend.d.ts +110 -0
  123. package/dist/shared/assistant/writeReplySend.d.ts.map +1 -0
  124. package/dist/shared/assistant/writeReplySend.js +93 -0
  125. package/dist/shared-assistant.js +168 -153
  126. package/dist/ui/modal-shell.d.ts +14 -1
  127. package/dist/ui/modal-shell.d.ts.map +1 -1
  128. package/dist/ui/modal-shell.js +8 -6
  129. package/package.json +1 -1
@@ -0,0 +1,253 @@
1
+ import { Button as e } from "../../../ui/button.js";
2
+ import { ModalShell as t } from "../../../ui/modal-shell.js";
3
+ import { usePrefersReducedMotion as n } from "./usePrefersReducedMotion.js";
4
+ import { WRITE_PROPOSAL_MASK as r, formatWriteProposalValue as i, redactWriteProposalText as a, useWriteProposalRemainingMs as o, writeProposalArgumentValues as ee, writeProposalConfirmState as te, writeProposalCountdownText as ne, writeProposalGatewayText as re, writeProposalKindText as ie, writeProposalRootFieldName as ae, writeProposalSensitiveTexts as s, writeProposalVariableValues as c } from "./writeProposalPresentation.js";
5
+ import { writeProposalUsesDialog as l } from "./AssistantWriteProposalCard.js";
6
+ import { useEffect as u, useId as oe, useRef as d, useState as f } from "react";
7
+ import { Fragment as se, jsx as p, jsxs as m } from "react/jsx-runtime";
8
+ //#region src/shared/assistant/ui/AssistantWriteConfirmDialog.tsx
9
+ var h = 600;
10
+ function ce(e) {
11
+ return e.includes("destructive") || e.includes("irreversible");
12
+ }
13
+ function le(e) {
14
+ return typeof e == "object" && !!e && typeof e.then == "function";
15
+ }
16
+ var g = ({ view: e, ...t }) => !e || !l(e) ? null : /* @__PURE__ */ p(_, {
17
+ view: e,
18
+ ...t
19
+ }, e.proposalId), _ = ({ open: l, view: h, serverNow: g, capabilities: _, turnInFlight: v, tr: y, onApprove: ue, onDecline: de, onPresented: b, onDismiss: x }) => {
20
+ let fe = n(), S = oe(), C = `${S}-exactly`, w = d(null), T = h.status === "pending", E = o(h.expiresAt, g, l && T), D = E <= 0, { available: O, fenced: pe, showControls: k, offerConfirm: A } = te(h, _), j = d(null), [M, N] = f(!1), [P, F] = f(0), [me, I] = f(/* @__PURE__ */ new Set());
21
+ u(() => {
22
+ if (!l) {
23
+ j.current = null, N(!1);
24
+ return;
25
+ }
26
+ j.current = Date.now(), N(!1), F((e) => e + 1), I(/* @__PURE__ */ new Set());
27
+ let e = setTimeout(() => N(!0), 600);
28
+ return () => clearTimeout(e);
29
+ }, [l]);
30
+ let L = d(b);
31
+ u(() => {
32
+ L.current = b;
33
+ });
34
+ let R = d(0);
35
+ u(() => {
36
+ !l || P === 0 || !T || !O || R.current !== P && (R.current = P, L.current("modal"));
37
+ }, [
38
+ l,
39
+ P,
40
+ T,
41
+ O
42
+ ]);
43
+ let z = d(null), [B, V] = f(null), H = (e, t) => {
44
+ if (z.current !== null) return;
45
+ z.current = e, V(e);
46
+ let n = () => {
47
+ z.current === e && (z.current = null, V(null));
48
+ }, r;
49
+ try {
50
+ r = t();
51
+ } catch (e) {
52
+ throw n(), e;
53
+ }
54
+ le(r) && r.then(n, n);
55
+ }, U = d(!1), W = (e) => {
56
+ e.key === "Enter" && (e.preventDefault(), U.current = !0);
57
+ }, G = (e) => {
58
+ e.key === "Enter" && (U.current = !1);
59
+ }, K = () => {
60
+ U.current = !1;
61
+ }, q = v || B !== null, J = q || D || !M, he = (e) => {
62
+ if (!e.isTrusted || U.current) return;
63
+ let t = j.current;
64
+ !M || t === null || Date.now() - t < 600 || !A || J || H("approve", () => ue("assistant_modal"));
65
+ }, ge = () => {
66
+ U.current || !k || q || H("decline", () => de("user_declined", "assistant_modal"));
67
+ }, _e = (e) => {
68
+ let t = w.current;
69
+ !t || t.disabled || (e.preventDefault(), t.focus());
70
+ }, Y = s(h), ve = a(h.description.readback.trim(), Y) || h.description.label, X = h.description.consequences.map((e) => a(e, Y)), Z = [...new Set(h.risk.kinds)].map((e) => ({
71
+ kind: e,
72
+ text: ie(e, y)
73
+ })).filter((e) => !!e.text), Q = c(h), ye = h.description.confirmLabel.trim() || y("writeProposal.confirmFallback", "Confirm this change"), be = (e) => I((t) => {
74
+ let n = new Set(t);
75
+ return n.has(e) ? n.delete(e) : n.add(e), n;
76
+ }), $ = (e, t) => /* @__PURE__ */ p("dl", {
77
+ className: "mt-1 grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",
78
+ children: e.map((e, n) => {
79
+ let a = `${S}-${t}-${n}`, o = e.sensitive && !me.has(e.key);
80
+ return /* @__PURE__ */ m("div", {
81
+ className: "contents",
82
+ children: [/* @__PURE__ */ p("dt", {
83
+ id: a,
84
+ className: "truncate text-text-muted",
85
+ children: e.label
86
+ }), /* @__PURE__ */ p("dd", {
87
+ className: "min-w-0",
88
+ children: /* @__PURE__ */ m("span", {
89
+ className: "inline-flex min-w-0 flex-wrap items-baseline gap-x-2",
90
+ children: [o ? /* @__PURE__ */ m("span", {
91
+ "data-testid": "assistant-write-confirm-masked",
92
+ children: [/* @__PURE__ */ p("span", {
93
+ "aria-hidden": "true",
94
+ className: "font-mono text-text-muted",
95
+ children: r
96
+ }), /* @__PURE__ */ p("span", {
97
+ className: "sr-only",
98
+ children: y("writeProposal.hiddenValue", "Hidden value")
99
+ })]
100
+ }) : /* @__PURE__ */ p("span", {
101
+ className: "min-w-0 whitespace-pre-wrap break-words font-medium text-text-primary",
102
+ children: i(e.value)
103
+ }), e.sensitive ? /* @__PURE__ */ p("button", {
104
+ type: "button",
105
+ onClick: () => be(e.key),
106
+ "aria-pressed": !o,
107
+ "aria-describedby": a,
108
+ className: "rounded text-[11px] font-medium text-text-link underline focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
109
+ "data-testid": "assistant-write-confirm-reveal",
110
+ children: o ? y("writeProposal.showValue", "Show") : y("writeProposal.hideValue", "Hide")
111
+ }) : null]
112
+ })
113
+ })]
114
+ }, `${n}:${e.key}`);
115
+ })
116
+ }), xe = k ? /* @__PURE__ */ m(se, { children: [/* @__PURE__ */ p(e, {
117
+ ref: w,
118
+ variant: "outline",
119
+ onClick: ge,
120
+ onKeyDown: W,
121
+ onKeyUp: G,
122
+ onBlur: K,
123
+ disabled: q,
124
+ "data-testid": "assistant-write-confirm-cancel",
125
+ children: y("writeProposal.cancel", "Cancel")
126
+ }), A ? /* @__PURE__ */ p(e, {
127
+ variant: ce(h.risk.kinds) ? "destructive" : "default",
128
+ onClick: he,
129
+ onKeyDown: W,
130
+ onKeyUp: G,
131
+ onBlur: K,
132
+ disabled: J,
133
+ "data-testid": "assistant-write-confirm-confirm",
134
+ children: B === "approve" ? y("writeProposal.confirming", "Confirming…") : ye
135
+ }) : null] }) : /* @__PURE__ */ p(e, {
136
+ ref: w,
137
+ variant: "outline",
138
+ onClick: x,
139
+ "data-testid": "assistant-write-confirm-close",
140
+ children: y("writeProposal.dialog.close", "Close")
141
+ });
142
+ return /* @__PURE__ */ p(t, {
143
+ open: l,
144
+ onClose: x,
145
+ role: "alertdialog",
146
+ onOpenAutoFocus: _e,
147
+ testId: "assistant-write-confirm-dialog",
148
+ size: "md",
149
+ title: y("writeProposal.dialog.title", "Confirm this change"),
150
+ description: ve,
151
+ footer: xe,
152
+ children: /* @__PURE__ */ m("div", {
153
+ className: "space-y-3 text-sm text-text-primary",
154
+ "data-testid": "assistant-write-confirm-body",
155
+ "data-status": h.status,
156
+ children: [
157
+ Z.length > 0 ? /* @__PURE__ */ p("ul", {
158
+ className: "flex flex-wrap gap-1",
159
+ "data-testid": "assistant-write-confirm-kinds",
160
+ children: Z.map(({ kind: e, text: t }) => /* @__PURE__ */ p("li", {
161
+ className: "rounded-full border border-status-error-border bg-status-error-bg px-2 py-0.5 text-[11px] font-medium text-status-error-text",
162
+ children: t
163
+ }, e))
164
+ }) : null,
165
+ /* @__PURE__ */ m("section", {
166
+ "aria-labelledby": C,
167
+ className: "space-y-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2",
168
+ "data-testid": "assistant-write-confirm-exactly",
169
+ children: [
170
+ /* @__PURE__ */ p("h3", {
171
+ id: C,
172
+ className: "text-xs font-semibold text-text-secondary",
173
+ children: y("writeProposal.dialog.exactly", "Exactly what will happen")
174
+ }),
175
+ /* @__PURE__ */ p("p", {
176
+ className: "text-xs text-text-secondary",
177
+ children: re(h, y)
178
+ }),
179
+ h.description.rootFields.map((e, t) => {
180
+ let n = ee(e);
181
+ return /* @__PURE__ */ m("div", {
182
+ "data-testid": "assistant-write-confirm-field",
183
+ children: [/* @__PURE__ */ p("p", {
184
+ className: "break-words font-mono text-xs text-text-primary",
185
+ children: ae(e)
186
+ }), n.length > 0 ? $(n, `field${t}`) : null]
187
+ }, `${t}:${e.alias ?? e.field}`);
188
+ }),
189
+ Q.length > 0 ? /* @__PURE__ */ m("div", {
190
+ "data-testid": "assistant-write-confirm-variables",
191
+ children: [/* @__PURE__ */ p("p", {
192
+ className: "text-[11px] font-medium text-text-secondary",
193
+ children: y("writeProposal.values", "Values")
194
+ }), $(Q, "vars")]
195
+ }) : null,
196
+ h.description.variablesOmitted ? /* @__PURE__ */ p("p", {
197
+ className: "text-[11px] text-text-muted",
198
+ children: y("writeProposal.variablesOmitted", "{{count}} more values not shown", { count: h.description.variablesOmitted })
199
+ }) : null,
200
+ /* @__PURE__ */ p("p", {
201
+ className: "text-xs text-text-secondary",
202
+ "data-testid": "assistant-write-confirm-target-count",
203
+ children: y("writeProposal.targetCount", "Items affected: {{count}}", { count: h.description.targetCount })
204
+ })
205
+ ]
206
+ }),
207
+ X.length > 0 ? /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
208
+ className: "text-[11px] font-medium text-text-secondary",
209
+ children: y("writeProposal.consequences", "What this will do")
210
+ }), /* @__PURE__ */ p("ul", {
211
+ className: "list-disc pl-4 text-xs text-text-primary",
212
+ "data-testid": "assistant-write-confirm-consequences",
213
+ children: X.map((e, t) => /* @__PURE__ */ p("li", { children: e }, t))
214
+ })] }) : null,
215
+ h.repeatOf ? /* @__PURE__ */ p("p", {
216
+ className: "text-xs text-status-warning-text",
217
+ children: y("writeProposal.repeat", "You made this same change recently. Confirming makes it again.")
218
+ }) : null,
219
+ /* @__PURE__ */ m("div", {
220
+ className: "space-y-1 text-[11px]",
221
+ children: [
222
+ T ? /* @__PURE__ */ p("p", {
223
+ className: "text-text-secondary",
224
+ "data-testid": "assistant-write-confirm-countdown",
225
+ children: D ? y("writeProposal.timeUp", "Time's up — this can no longer be confirmed") : ne(E, fe, y)
226
+ }) : /* @__PURE__ */ p("p", {
227
+ className: "text-text-secondary",
228
+ "data-testid": "assistant-write-confirm-no-longer-pending",
229
+ children: y("writeProposal.dialog.noLongerPending", "This change can no longer be confirmed here.")
230
+ }),
231
+ T && !O ? /* @__PURE__ */ p("p", {
232
+ className: "text-text-secondary",
233
+ children: y("writeProposal.notAvailableYet", "Confirming changes from the assistant isn't available in this session yet.")
234
+ }) : T && !h.approvable ? /* @__PURE__ */ p("p", {
235
+ className: "text-text-secondary",
236
+ children: y("writeProposal.notApprovable", "This change isn't ready to confirm. If it stays this way, ask the assistant to prepare it again.")
237
+ }) : T && pe ? /* @__PURE__ */ p("p", {
238
+ className: "text-text-secondary",
239
+ "data-testid": "assistant-write-confirm-fenced",
240
+ children: y("writeProposal.executionFenced", "You can review or cancel this change. Running it from the assistant becomes available once secure confirmation is enabled.")
241
+ }) : null,
242
+ k && v ? /* @__PURE__ */ p("p", {
243
+ className: "text-text-muted",
244
+ children: y("writeProposal.waitForTurn", "You can confirm once the assistant finishes replying.")
245
+ }) : null
246
+ ]
247
+ })
248
+ ]
249
+ })
250
+ });
251
+ };
252
+ //#endregion
253
+ export { g as AssistantWriteConfirmDialog, h as WRITE_CONFIRM_ARM_MS };
@@ -0,0 +1,72 @@
1
+ import { FC } from 'react';
2
+ import { AssistantTr } from '../i18n';
3
+ import { SandboxWriteCapabilities, WriteProposalPresentationSurface, WriteProposalRiskKind, WriteProposalView } from '../writeProposals';
4
+ /**
5
+ * One write proposal, as the ISSUING sandbox recorded it (BOFF-7803 5a, unit
6
+ * FE4). It replaces `AssistantPendingWriteCard` only in proposal mode.
7
+ *
8
+ * ★★ 5a is a safety floor, not the final security boundary. This card
9
+ * authorises nothing. Its confirm button hands a person's press to the parent,
10
+ * which asks the sandbox; the sandbox's store and wspace-sandbox-svc (route
11
+ * policy, live admin re-check, session relay) decide whether anything runs.
12
+ * The card only refuses to OFFER a press the record says cannot count.
13
+ *
14
+ * ★★ Presentational, with no store (the lesson of the two assistant UIs): it
15
+ * renders `view` and nothing else, so what a person approves is the record's
16
+ * payload, never the model's description of it. Every status, value and
17
+ * control state is derived from the props on every render.
18
+ *
19
+ * ★ Confirm counts only a trusted activation (`event.isTrusted`): a click a
20
+ * script dispatched is ignored. It latches on the first press, so a double
21
+ * click sends ONE approval, and releases only when the promise `onApprove`
22
+ * returns settles (the parent re-lists; the record decides what is shown).
23
+ * The sandbox's compare-and-set is what makes execution once-only; the latch
24
+ * keeps the card from asking twice.
25
+ *
26
+ * ★ The stronger dialog (OD-12) is used when the record asks for it OR when
27
+ * its risk kinds include one of the dialog kinds. The card may only make
28
+ * confirmation stronger than the record asks, never weaker.
29
+ */
30
+ /** The risk kinds that always confirm in the dialog (OD-12). */
31
+ export declare const WRITE_PROPOSAL_DIALOG_KINDS: ReadonlySet<WriteProposalRiskKind>;
32
+ /** Whether this proposal confirms in the dialog rather than on the card. */
33
+ export declare function writeProposalUsesDialog(view: WriteProposalView): boolean;
34
+ export interface AssistantWriteProposalCardProps {
35
+ view: WriteProposalView;
36
+ /**
37
+ * The issuing sandbox's clock when `view` was read (`list().serverNow`).
38
+ * The countdown corrects for the difference from this device's clock.
39
+ */
40
+ serverNow: number;
41
+ /** The ISSUING sandbox's `/health` write capabilities; absent = unknown. */
42
+ capabilities: SandboxWriteCapabilities | null | undefined;
43
+ /**
44
+ * ★ BOFF-7803 FE8: the issuing sandbox was replaced (a failover). The card
45
+ * is an inert record of what was proposed: no control, no presentation, and
46
+ * a line saying it can no longer be confirmed here.
47
+ */
48
+ inert?: boolean;
49
+ /** A turn is running in this conversation: every control is disabled. */
50
+ turnInFlight: boolean;
51
+ tr: AssistantTr;
52
+ /**
53
+ * The person pressed confirm on the card. Return the approve call's promise:
54
+ * the button stays disabled until it settles.
55
+ */
56
+ onApprove: () => void | Promise<unknown>;
57
+ /** The person pressed Cancel. Same latch as `onApprove`. */
58
+ onDecline: () => void | Promise<unknown>;
59
+ /** The person asked for the confirmation dialog (dialog kinds only). */
60
+ onReview: () => void;
61
+ /** The card was at least half visible for 500 ms. Called once per proposal. */
62
+ onPresented: (surface: WriteProposalPresentationSurface) => void;
63
+ /**
64
+ * The revision this one replaced (`view.supersedes`), when the parent has
65
+ * it. Without it a revised card says it was revised but shows no diff.
66
+ */
67
+ previous?: WriteProposalView | null;
68
+ }
69
+ /** How long the card must stay half visible before it counts as presented. */
70
+ export declare const WRITE_PROPOSAL_PRESENTED_AFTER_MS = 500;
71
+ export declare const AssistantWriteProposalCard: FC<AssistantWriteProposalCardProps>;
72
+ //# sourceMappingURL=AssistantWriteProposalCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantWriteProposalCard.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantWriteProposalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EACV,wBAAwB,EACxB,gCAAgC,EAChC,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAkB3B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,gEAAgE;AAChE,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,qBAAqB,CAQvE,CAAC;AAEL,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAKxE;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,iBAAiB,CAAC;IACxB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,EAAE,wBAAwB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,YAAY,EAAE,OAAO,CAAC;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,4DAA4D;IAC5D,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,wEAAwE;IACxE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,+EAA+E;IAC/E,WAAW,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,IAAI,CAAC;IACjE;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACrC;AAED,8EAA8E;AAC9E,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAiJrD,eAAO,MAAM,0BAA0B,EAAE,EAAE,CACzC,+BAA+B,CAoiBhC,CAAC"}