@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.
- package/dist/shared/assistant/adminModeSendGate.d.ts +6 -5
- package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
- package/dist/shared/assistant/adminModeSendGate.js +11 -11
- package/dist/shared/assistant/api.d.ts +313 -28
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +351 -135
- package/dist/shared/assistant/autoRouting.d.ts +11 -3
- package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
- package/dist/shared/assistant/autoRouting.js +7 -7
- package/dist/shared/assistant/capabilities.d.ts +28 -0
- package/dist/shared/assistant/capabilities.d.ts.map +1 -1
- package/dist/shared/assistant/capabilities.js +19 -10
- package/dist/shared/assistant/conversation.d.ts +24 -2
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +67 -54
- package/dist/shared/assistant/history/historyList.js +1 -1
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.js +5 -1
- package/dist/shared/assistant/history/historyResume.js +7 -7
- package/dist/shared/assistant/i18nManifest.d.ts +53 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +75 -16
- package/dist/shared/assistant/index.d.ts +15 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.js +1 -1
- package/dist/shared/assistant/operations.d.ts +22 -0
- package/dist/shared/assistant/operations.d.ts.map +1 -1
- package/dist/shared/assistant/operations.js +2 -2
- package/dist/shared/assistant/prewarm.d.ts +7 -0
- package/dist/shared/assistant/prewarm.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.js +1 -1
- package/dist/shared/assistant/product.d.ts +80 -2
- package/dist/shared/assistant/product.d.ts.map +1 -1
- package/dist/shared/assistant/product.js +10 -6
- package/dist/shared/assistant/proposalWriteRules.d.ts +40 -0
- package/dist/shared/assistant/proposalWriteRules.d.ts.map +1 -0
- package/dist/shared/assistant/proposalWriteRules.js +14 -0
- package/dist/shared/assistant/store.d.ts +17 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +50 -43
- package/dist/shared/assistant/turnOutcome.d.ts +34 -2
- package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcome.js +28 -17
- package/dist/shared/assistant/turnOutcomeCopy.d.ts +29 -7
- package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcomeCopy.js +18 -6
- package/dist/shared/assistant/types.d.ts +5 -1
- package/dist/shared/assistant/types.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +4 -4
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +992 -718
- package/dist/shared/assistant/ui/AssistantConversationList.js +6 -6
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +8 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +77 -76
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts +13 -1
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +15 -13
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +209 -209
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +62 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.js +253 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +72 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +439 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts +40 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.js +35 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +8 -8
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +28 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +159 -110
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +61 -0
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useWriteProposalConfirm.js +109 -0
- package/dist/shared/assistant/ui/useWriteProposals.d.ts +128 -0
- package/dist/shared/assistant/ui/useWriteProposals.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useWriteProposals.js +240 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +17 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +141 -109
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +76 -0
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts.map +1 -0
- package/dist/shared/assistant/ui/writeProposalPresentation.js +110 -0
- package/dist/shared/assistant/usageReporting.d.ts +108 -0
- package/dist/shared/assistant/usageReporting.d.ts.map +1 -0
- package/dist/shared/assistant/usageReporting.js +155 -0
- package/dist/shared/assistant/useAssistantApiAccess.d.ts +49 -14
- package/dist/shared/assistant/useAssistantApiAccess.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantApiAccess.js +43 -25
- package/dist/shared/assistant/useAssistantHeartbeat.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantHeartbeat.js +5 -5
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts +5 -6
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.d.ts +46 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +35 -2
- package/dist/shared/assistant/writeConfirmSeam.d.ts +32 -0
- package/dist/shared/assistant/writeConfirmSeam.d.ts.map +1 -0
- package/dist/shared/assistant/writeConfirmSeam.js +23 -0
- package/dist/shared/assistant/writeModeConsent.d.ts +16 -8
- package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -1
- package/dist/shared/assistant/writeModeConsent.js +2 -2
- package/dist/shared/assistant/writeProposalDiscovery.d.ts +187 -0
- package/dist/shared/assistant/writeProposalDiscovery.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalDiscovery.js +246 -0
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts +135 -0
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalErrorCopy.js +135 -0
- package/dist/shared/assistant/writeProposalVoice.d.ts +133 -0
- package/dist/shared/assistant/writeProposalVoice.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalVoice.js +66 -0
- package/dist/shared/assistant/writeProposals.d.ts +268 -0
- package/dist/shared/assistant/writeProposals.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposals.js +445 -0
- package/dist/shared/assistant/writeReplyBinder.d.ts +166 -0
- package/dist/shared/assistant/writeReplyBinder.d.ts.map +1 -0
- package/dist/shared/assistant/writeReplyBinder.js +233 -0
- package/dist/shared/assistant/writeReplySend.d.ts +110 -0
- package/dist/shared/assistant/writeReplySend.d.ts.map +1 -0
- package/dist/shared/assistant/writeReplySend.js +93 -0
- package/dist/shared-assistant.js +168 -153
- package/dist/ui/modal-shell.d.ts +14 -1
- package/dist/ui/modal-shell.d.ts.map +1 -1
- package/dist/ui/modal-shell.js +8 -6
- package/package.json +1 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { WriteProposalError as e, isWriteProposalError as t } from "./writeProposals.js";
|
|
2
|
+
//#region src/shared/assistant/writeProposalDiscovery.ts
|
|
3
|
+
var n = /^wp_[0-9a-f]{32}$/;
|
|
4
|
+
function r(e) {
|
|
5
|
+
let t = e?.writeProposalRefs;
|
|
6
|
+
if (!Array.isArray(t)) return [];
|
|
7
|
+
let r = [], i = /* @__PURE__ */ new Set();
|
|
8
|
+
for (let e of t) {
|
|
9
|
+
if (typeof e != "object" || !e) continue;
|
|
10
|
+
let { proposalId: t, sandboxId: a, sessionId: o } = e;
|
|
11
|
+
typeof t != "string" || !n.test(t) || i.has(t) || typeof a != "string" || !a || typeof o != "string" || !o || (i.add(t), r.push({
|
|
12
|
+
proposalId: t,
|
|
13
|
+
sandboxId: a,
|
|
14
|
+
sessionId: o
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
return r;
|
|
18
|
+
}
|
|
19
|
+
function i(e, t) {
|
|
20
|
+
return (e.sessionId === null || e.sessionId === t.sessionId) && (e.conversationId === null || e.conversationId === t.conversationId);
|
|
21
|
+
}
|
|
22
|
+
function a(e) {
|
|
23
|
+
let t = /* @__PURE__ */ new Map();
|
|
24
|
+
for (let n of e.messages) for (let i of r(n.metadata)) t.set(f(i), {
|
|
25
|
+
session: {
|
|
26
|
+
sandboxId: i.sandboxId,
|
|
27
|
+
sessionId: i.sessionId,
|
|
28
|
+
conversationId: e.id
|
|
29
|
+
},
|
|
30
|
+
issuing: !0
|
|
31
|
+
});
|
|
32
|
+
let n = e.backendSessionId;
|
|
33
|
+
if (n) for (let r = e.messages.length - 1; r >= 0; --r) {
|
|
34
|
+
let i = e.messages[r]?.metadata;
|
|
35
|
+
if (i?.sessionId !== n || typeof i.sandboxId != "string" || !i.sandboxId) continue;
|
|
36
|
+
let a = f({
|
|
37
|
+
sandboxId: i.sandboxId,
|
|
38
|
+
sessionId: n
|
|
39
|
+
}), o = t.get(a);
|
|
40
|
+
t.set(a, {
|
|
41
|
+
session: {
|
|
42
|
+
sandboxId: i.sandboxId,
|
|
43
|
+
sessionId: n,
|
|
44
|
+
conversationId: e.id
|
|
45
|
+
},
|
|
46
|
+
issuing: (o?.issuing ?? !1) || i.mode === "api-calls"
|
|
47
|
+
});
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return [...t.values()];
|
|
51
|
+
}
|
|
52
|
+
var o = 2e3, s = 5;
|
|
53
|
+
function c(e) {
|
|
54
|
+
return e?.proposals === !0 && e.writeApprovalMode === "proposal-v1";
|
|
55
|
+
}
|
|
56
|
+
function l() {
|
|
57
|
+
let e = typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;
|
|
58
|
+
return `wpr-${Date.now().toString(36)}-${e}`;
|
|
59
|
+
}
|
|
60
|
+
function u(n) {
|
|
61
|
+
return t(n) ? n : new e({
|
|
62
|
+
status: 0,
|
|
63
|
+
code: "UNKNOWN",
|
|
64
|
+
message: n instanceof Error ? n.message : String(n)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
var d = {
|
|
68
|
+
set: (e, t) => setTimeout(e, t),
|
|
69
|
+
clear: (e) => clearTimeout(e)
|
|
70
|
+
}, f = (e) => `${e.sandboxId}\u0000${e.sessionId}`;
|
|
71
|
+
function p(e, t) {
|
|
72
|
+
return e ? {
|
|
73
|
+
reason: e.reason === "turn" ? "turn" : t.reason,
|
|
74
|
+
turnMessageId: t.turnMessageId ?? e.turnMessageId
|
|
75
|
+
} : t;
|
|
76
|
+
}
|
|
77
|
+
function m(e) {
|
|
78
|
+
let t = e.timers ?? d, n = e.pollMs ?? 2e3, r = e.maxPollFailures ?? 5, a = e.requestId ?? l, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), m = !1, h = (t) => !m && c(e.capabilitiesOf(t.sandboxId)), g = (e) => h(e) && !s.has(e.sandboxId);
|
|
79
|
+
function _(e) {
|
|
80
|
+
let t = f(e), n = o.get(t);
|
|
81
|
+
return n ? n.session = e : (n = {
|
|
82
|
+
session: e,
|
|
83
|
+
since: null,
|
|
84
|
+
running: null,
|
|
85
|
+
queuedRun: null,
|
|
86
|
+
queued: null,
|
|
87
|
+
timer: null,
|
|
88
|
+
hasTimer: !1,
|
|
89
|
+
failures: 0,
|
|
90
|
+
failureReported: !1,
|
|
91
|
+
executing: /* @__PURE__ */ new Set()
|
|
92
|
+
}, o.set(t, n)), n;
|
|
93
|
+
}
|
|
94
|
+
function v(e) {
|
|
95
|
+
e.hasTimer &&= (t.clear(e.timer), e.timer = null, !1);
|
|
96
|
+
}
|
|
97
|
+
function y(e, t) {
|
|
98
|
+
t.status === "executing" ? e.executing.add(t.proposalId) : e.executing.delete(t.proposalId);
|
|
99
|
+
}
|
|
100
|
+
function b(e) {
|
|
101
|
+
m || e.hasTimer || e.running || e.queuedRun || e.executing.size === 0 || e.failures >= r || (e.hasTimer = !0, e.timer = t.set(() => {
|
|
102
|
+
e.timer = null, e.hasTimer = !1, C(e.session, "poll");
|
|
103
|
+
}, n));
|
|
104
|
+
}
|
|
105
|
+
function x(t, n) {
|
|
106
|
+
m || (y(t, n), e.onView(t.session, n), b(t));
|
|
107
|
+
}
|
|
108
|
+
async function S(t, n) {
|
|
109
|
+
if (v(t), !h(t.session)) return;
|
|
110
|
+
let a = e.actorOf?.() ?? null, o = (async () => {
|
|
111
|
+
let o;
|
|
112
|
+
try {
|
|
113
|
+
o = await e.client.list(t.session, {
|
|
114
|
+
status: "all",
|
|
115
|
+
...t.since === null ? {} : { since: t.since }
|
|
116
|
+
});
|
|
117
|
+
} catch (i) {
|
|
118
|
+
if (m) return;
|
|
119
|
+
t.failures += 1, (n.reason === "turn" || n.reason === "poll" && t.failures >= r) && !t.failureReported && (t.failureReported = !0, e.onError(t.session, u(i), "list"));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (m || a !== null && (e.actorOf?.() ?? null) !== a) return;
|
|
123
|
+
t.since = o.serverNow, t.failures = 0, t.failureReported = !1;
|
|
124
|
+
let s = o.proposals.filter((e) => i(e, t.session));
|
|
125
|
+
for (let e of s) y(t, e);
|
|
126
|
+
e.onList(t.session, s.length === o.proposals.length ? o : {
|
|
127
|
+
...o,
|
|
128
|
+
proposals: s
|
|
129
|
+
}, n);
|
|
130
|
+
})();
|
|
131
|
+
t.running = o;
|
|
132
|
+
try {
|
|
133
|
+
await o;
|
|
134
|
+
} finally {
|
|
135
|
+
t.running === o && (t.running = null), b(t);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function C(e, t, n = {}) {
|
|
139
|
+
if (!h(e)) return Promise.resolve();
|
|
140
|
+
let r = _(e), i = {
|
|
141
|
+
reason: t,
|
|
142
|
+
turnMessageId: n.turnMessageId ?? null
|
|
143
|
+
};
|
|
144
|
+
if (r.queuedRun) return r.queued = p(r.queued, i), r.queuedRun;
|
|
145
|
+
if (r.running) {
|
|
146
|
+
r.queued = i;
|
|
147
|
+
let e = r.running.then(() => {
|
|
148
|
+
let e = r.queued ?? i;
|
|
149
|
+
return r.queued = null, r.queuedRun = null, S(r, e);
|
|
150
|
+
});
|
|
151
|
+
return r.queuedRun = e, e;
|
|
152
|
+
}
|
|
153
|
+
return S(r, i);
|
|
154
|
+
}
|
|
155
|
+
async function w(t, n, r) {
|
|
156
|
+
if (!g(t)) return;
|
|
157
|
+
let i = _(t), o = !0;
|
|
158
|
+
try {
|
|
159
|
+
let s = await e.client.approve({
|
|
160
|
+
...t,
|
|
161
|
+
proposalId: n.proposalId
|
|
162
|
+
}, {
|
|
163
|
+
payloadHash: n.payloadHash,
|
|
164
|
+
surface: r,
|
|
165
|
+
clientRequestId: a()
|
|
166
|
+
});
|
|
167
|
+
if (m) return;
|
|
168
|
+
s.kind === "settled" ? (x(i, s.proposal), o = !1) : s.proposal ? x(i, s.proposal) : i.executing.add(n.proposalId);
|
|
169
|
+
} catch (t) {
|
|
170
|
+
if (m) return;
|
|
171
|
+
let n = u(t);
|
|
172
|
+
n.current && x(i, n.current), e.onError(i.session, n, "approve");
|
|
173
|
+
}
|
|
174
|
+
o && await C(i.session, "refresh");
|
|
175
|
+
}
|
|
176
|
+
async function T(t, n, r, i, o) {
|
|
177
|
+
if (!g(t)) return;
|
|
178
|
+
let s = _(t);
|
|
179
|
+
try {
|
|
180
|
+
x(s, await e.client.decline({
|
|
181
|
+
...t,
|
|
182
|
+
proposalId: n.proposalId
|
|
183
|
+
}, {
|
|
184
|
+
reason: r,
|
|
185
|
+
method: i,
|
|
186
|
+
...o ? { surface: o } : {},
|
|
187
|
+
clientRequestId: a()
|
|
188
|
+
}));
|
|
189
|
+
} catch (t) {
|
|
190
|
+
if (m) return;
|
|
191
|
+
let n = u(t);
|
|
192
|
+
n.current && x(s, n.current), e.onError(s.session, n, "decline");
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async function E(t, n, r) {
|
|
196
|
+
if (!g(t) || n.status !== "pending") return;
|
|
197
|
+
let i = _(t);
|
|
198
|
+
try {
|
|
199
|
+
x(i, await e.client.presented({
|
|
200
|
+
...t,
|
|
201
|
+
proposalId: n.proposalId
|
|
202
|
+
}, {
|
|
203
|
+
payloadHash: n.payloadHash,
|
|
204
|
+
surface: r,
|
|
205
|
+
clientRequestId: a()
|
|
206
|
+
}));
|
|
207
|
+
} catch (e) {
|
|
208
|
+
if (m) return;
|
|
209
|
+
let t = u(e);
|
|
210
|
+
t.current && x(i, t.current);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
async function D(t, n, r, i = {}) {
|
|
214
|
+
if (!h(t)) return !1;
|
|
215
|
+
let o = _(t);
|
|
216
|
+
try {
|
|
217
|
+
await e.client.declineAll(t, {
|
|
218
|
+
reason: n,
|
|
219
|
+
method: r,
|
|
220
|
+
clientRequestId: a()
|
|
221
|
+
});
|
|
222
|
+
} catch (t) {
|
|
223
|
+
return m || i.report && e.onError(o.session, u(t), "decline"), !1;
|
|
224
|
+
}
|
|
225
|
+
return m || i.refresh !== !1 && await C(o.session, "refresh"), !0;
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
discover: C,
|
|
229
|
+
approve: w,
|
|
230
|
+
decline: T,
|
|
231
|
+
presented: E,
|
|
232
|
+
declineAll: D,
|
|
233
|
+
retire: (e) => {
|
|
234
|
+
s.add(e);
|
|
235
|
+
},
|
|
236
|
+
isRetired: (e) => s.has(e),
|
|
237
|
+
isPolling: (e) => !!o.get(f(e))?.hasTimer,
|
|
238
|
+
dispose: () => {
|
|
239
|
+
m = !0;
|
|
240
|
+
for (let e of o.values()) v(e);
|
|
241
|
+
o.clear();
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
export { s as WRITE_PROPOSAL_MAX_POLL_FAILURES, o as WRITE_PROPOSAL_POLL_MS, u as asWriteProposalError, m as createWriteProposalDiscovery, l as newWriteProposalRequestId, r as readWriteProposalRefs, i as writeProposalBelongsTo, a as writeProposalSessionsToReopen, c as writeProposalsEnabledFor };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { WriteProposalError } from './writeProposals';
|
|
2
|
+
/**
|
|
3
|
+
* What the panel says in the thread when a write-proposal call is refused or
|
|
4
|
+
* fails (BOFF-7803 5a, unit FE7). Rendered as a system message through
|
|
5
|
+
* `tr(line.key, line.fallback)`, and read into the i18n manifest from this
|
|
6
|
+
* table.
|
|
7
|
+
*
|
|
8
|
+
* ★★ 5a is a safety floor, not the final security boundary: these lines report
|
|
9
|
+
* what the issuing sandbox or wspace-sandbox-svc decided. None of them invites
|
|
10
|
+
* a person to get round a refusal, and none claims a change ran or did not run
|
|
11
|
+
* beyond what the answer says. An approve whose answer never arrived is
|
|
12
|
+
* `indeterminate`: it MAY have run, and the card's record decides.
|
|
13
|
+
*
|
|
14
|
+
* ★ `EXECUTION_NOT_ENABLED` has two readings, told apart by the answer's
|
|
15
|
+
* `reason`: `admin_required` (the live admin re-check refused) and `fenced`
|
|
16
|
+
* (the session may prepare but not run changes before 5b). An unknown reason
|
|
17
|
+
* reads as `fenced`, the one that promises nothing.
|
|
18
|
+
*
|
|
19
|
+
* Kept free of runtime imports: the manifest imports this table.
|
|
20
|
+
*/
|
|
21
|
+
export interface WriteProposalErrorLine {
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly fallback: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const WRITE_PROPOSAL_ERROR_COPY: Readonly<{
|
|
26
|
+
notFound: Readonly<{
|
|
27
|
+
key: "writeProposal.error.notFound";
|
|
28
|
+
fallback: "That change can't be found any more, so nothing was done. Ask the assistant to prepare it again.";
|
|
29
|
+
}>;
|
|
30
|
+
sessionMismatch: Readonly<{
|
|
31
|
+
key: "writeProposal.error.sessionMismatch";
|
|
32
|
+
fallback: "That change belongs to a different assistant session, so nothing was done.";
|
|
33
|
+
}>;
|
|
34
|
+
conversationMismatch: Readonly<{
|
|
35
|
+
key: "writeProposal.error.conversationMismatch";
|
|
36
|
+
fallback: "That change was prepared in a different conversation, so nothing was done.";
|
|
37
|
+
}>;
|
|
38
|
+
actorMismatch: Readonly<{
|
|
39
|
+
key: "writeProposal.error.actorMismatch";
|
|
40
|
+
fallback: "That change was prepared for someone else, so you can't confirm or cancel it.";
|
|
41
|
+
}>;
|
|
42
|
+
hashMismatch: Readonly<{
|
|
43
|
+
key: "writeProposal.error.hashMismatch";
|
|
44
|
+
fallback: "That change no longer matches what you were shown, so nothing was done. Ask the assistant to prepare it again.";
|
|
45
|
+
}>;
|
|
46
|
+
methodNotAllowed: Readonly<{
|
|
47
|
+
key: "writeProposal.error.methodNotAllowed";
|
|
48
|
+
fallback: "That change can only be confirmed with its button. Nothing was done.";
|
|
49
|
+
}>;
|
|
50
|
+
superseded: Readonly<{
|
|
51
|
+
key: "writeProposal.error.superseded";
|
|
52
|
+
fallback: "That change was replaced by a newer one, so nothing was done.";
|
|
53
|
+
}>;
|
|
54
|
+
declined: Readonly<{
|
|
55
|
+
key: "writeProposal.error.declined";
|
|
56
|
+
fallback: "That change was cancelled, so nothing was done.";
|
|
57
|
+
}>;
|
|
58
|
+
notPending: Readonly<{
|
|
59
|
+
key: "writeProposal.error.notPending";
|
|
60
|
+
fallback: "That change is no longer waiting for a decision.";
|
|
61
|
+
}>;
|
|
62
|
+
expired: Readonly<{
|
|
63
|
+
key: "writeProposal.error.expired";
|
|
64
|
+
fallback: "That change expired, so nothing was done. Ask the assistant to prepare it again.";
|
|
65
|
+
}>;
|
|
66
|
+
evicted: Readonly<{
|
|
67
|
+
key: "writeProposal.error.evicted";
|
|
68
|
+
fallback: "Too many changes were waiting, so this one was dropped. Nothing was done.";
|
|
69
|
+
}>;
|
|
70
|
+
executionFenced: Readonly<{
|
|
71
|
+
key: "writeProposal.error.executionFenced";
|
|
72
|
+
fallback: "Running changes from the assistant isn't available in this session yet, so nothing was done. You can still review or cancel the change.";
|
|
73
|
+
}>;
|
|
74
|
+
executionAdminRequired: Readonly<{
|
|
75
|
+
key: "writeProposal.error.executionAdminRequired";
|
|
76
|
+
fallback: "Only workspace admins can run changes from the assistant right now, so nothing was done.";
|
|
77
|
+
}>;
|
|
78
|
+
readOnly: Readonly<{
|
|
79
|
+
key: "writeProposal.error.readOnly";
|
|
80
|
+
fallback: "This assistant session can't make changes, so nothing was done.";
|
|
81
|
+
}>;
|
|
82
|
+
turnInProgress: Readonly<{
|
|
83
|
+
key: "writeProposal.error.turnInProgress";
|
|
84
|
+
fallback: "The assistant is still replying, so nothing was done. Confirm the change once it finishes.";
|
|
85
|
+
}>;
|
|
86
|
+
contextChanged: Readonly<{
|
|
87
|
+
key: "writeProposal.error.contextChanged";
|
|
88
|
+
fallback: "The workspace changed since this was prepared, so nothing was done. Ask the assistant to prepare it again.";
|
|
89
|
+
}>;
|
|
90
|
+
storeUnavailable: Readonly<{
|
|
91
|
+
key: "writeProposal.error.storeUnavailable";
|
|
92
|
+
fallback: "Prepared changes are unavailable right now. Nothing was confirmed. Try again shortly.";
|
|
93
|
+
}>;
|
|
94
|
+
approvalModeMismatch: Readonly<{
|
|
95
|
+
key: "writeProposal.error.approvalModeMismatch";
|
|
96
|
+
fallback: "This assistant session confirms changes a different way, so nothing was done. Start a new conversation and try again.";
|
|
97
|
+
}>;
|
|
98
|
+
panelUpgradeRequired: Readonly<{
|
|
99
|
+
key: "writeProposal.error.panelUpgradeRequired";
|
|
100
|
+
fallback: "Reload the page to confirm changes from the assistant. Nothing was done.";
|
|
101
|
+
}>;
|
|
102
|
+
notProposalOwner: Readonly<{
|
|
103
|
+
key: "writeProposal.error.notProposalOwner";
|
|
104
|
+
fallback: "Only the person who asked for this change can confirm or cancel it.";
|
|
105
|
+
}>;
|
|
106
|
+
invalidRequest: Readonly<{
|
|
107
|
+
key: "writeProposal.error.invalidRequest";
|
|
108
|
+
fallback: "That request couldn't be sent, so nothing was confirmed.";
|
|
109
|
+
}>;
|
|
110
|
+
malformedResponse: Readonly<{
|
|
111
|
+
key: "writeProposal.error.malformedResponse";
|
|
112
|
+
fallback: "The assistant's answer couldn't be read, so nothing was confirmed.";
|
|
113
|
+
}>;
|
|
114
|
+
unknown: Readonly<{
|
|
115
|
+
key: "writeProposal.error.unknown";
|
|
116
|
+
fallback: "That didn't go through, and nothing was confirmed. Try again.";
|
|
117
|
+
}>;
|
|
118
|
+
/** Approve only: no readable answer. It MAY have run. */
|
|
119
|
+
indeterminate: Readonly<{
|
|
120
|
+
key: "writeProposal.error.indeterminate";
|
|
121
|
+
fallback: "No answer came back, so this change may or may not have run. Check its card before trying again.";
|
|
122
|
+
}>;
|
|
123
|
+
/** A read of the prepared changes failed (not a decision). */
|
|
124
|
+
listFailed: Readonly<{
|
|
125
|
+
key: "writeProposal.error.listFailed";
|
|
126
|
+
fallback: "The change the assistant prepared couldn't be loaded. Nothing has been confirmed.";
|
|
127
|
+
}>;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* The line for a failed call. `action` is what was being done: an approve
|
|
131
|
+
* with no readable answer is `indeterminate`, whatever its code; a failed
|
|
132
|
+
* list says the prepared change could not be loaded.
|
|
133
|
+
*/
|
|
134
|
+
export declare function writeProposalErrorLine(error: Pick<WriteProposalError, "code" | "reason" | "indeterminate">, action: "approve" | "decline" | "list"): WriteProposalErrorLine;
|
|
135
|
+
//# sourceMappingURL=writeProposalErrorCopy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeProposalErrorCopy.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/writeProposalErrorCopy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8GpC,yDAAyD;;;;;IAMzD,8DAA8D;;;;;EAMH,CAAC;AAwC9D;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,EACpE,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GACrC,sBAAsB,CAaxB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
//#region src/shared/assistant/writeProposalErrorCopy.ts
|
|
2
|
+
var e = Object.freeze({
|
|
3
|
+
notFound: Object.freeze({
|
|
4
|
+
key: "writeProposal.error.notFound",
|
|
5
|
+
fallback: "That change can't be found any more, so nothing was done. Ask the assistant to prepare it again."
|
|
6
|
+
}),
|
|
7
|
+
sessionMismatch: Object.freeze({
|
|
8
|
+
key: "writeProposal.error.sessionMismatch",
|
|
9
|
+
fallback: "That change belongs to a different assistant session, so nothing was done."
|
|
10
|
+
}),
|
|
11
|
+
conversationMismatch: Object.freeze({
|
|
12
|
+
key: "writeProposal.error.conversationMismatch",
|
|
13
|
+
fallback: "That change was prepared in a different conversation, so nothing was done."
|
|
14
|
+
}),
|
|
15
|
+
actorMismatch: Object.freeze({
|
|
16
|
+
key: "writeProposal.error.actorMismatch",
|
|
17
|
+
fallback: "That change was prepared for someone else, so you can't confirm or cancel it."
|
|
18
|
+
}),
|
|
19
|
+
hashMismatch: Object.freeze({
|
|
20
|
+
key: "writeProposal.error.hashMismatch",
|
|
21
|
+
fallback: "That change no longer matches what you were shown, so nothing was done. Ask the assistant to prepare it again."
|
|
22
|
+
}),
|
|
23
|
+
methodNotAllowed: Object.freeze({
|
|
24
|
+
key: "writeProposal.error.methodNotAllowed",
|
|
25
|
+
fallback: "That change can only be confirmed with its button. Nothing was done."
|
|
26
|
+
}),
|
|
27
|
+
superseded: Object.freeze({
|
|
28
|
+
key: "writeProposal.error.superseded",
|
|
29
|
+
fallback: "That change was replaced by a newer one, so nothing was done."
|
|
30
|
+
}),
|
|
31
|
+
declined: Object.freeze({
|
|
32
|
+
key: "writeProposal.error.declined",
|
|
33
|
+
fallback: "That change was cancelled, so nothing was done."
|
|
34
|
+
}),
|
|
35
|
+
notPending: Object.freeze({
|
|
36
|
+
key: "writeProposal.error.notPending",
|
|
37
|
+
fallback: "That change is no longer waiting for a decision."
|
|
38
|
+
}),
|
|
39
|
+
expired: Object.freeze({
|
|
40
|
+
key: "writeProposal.error.expired",
|
|
41
|
+
fallback: "That change expired, so nothing was done. Ask the assistant to prepare it again."
|
|
42
|
+
}),
|
|
43
|
+
evicted: Object.freeze({
|
|
44
|
+
key: "writeProposal.error.evicted",
|
|
45
|
+
fallback: "Too many changes were waiting, so this one was dropped. Nothing was done."
|
|
46
|
+
}),
|
|
47
|
+
executionFenced: Object.freeze({
|
|
48
|
+
key: "writeProposal.error.executionFenced",
|
|
49
|
+
fallback: "Running changes from the assistant isn't available in this session yet, so nothing was done. You can still review or cancel the change."
|
|
50
|
+
}),
|
|
51
|
+
executionAdminRequired: Object.freeze({
|
|
52
|
+
key: "writeProposal.error.executionAdminRequired",
|
|
53
|
+
fallback: "Only workspace admins can run changes from the assistant right now, so nothing was done."
|
|
54
|
+
}),
|
|
55
|
+
readOnly: Object.freeze({
|
|
56
|
+
key: "writeProposal.error.readOnly",
|
|
57
|
+
fallback: "This assistant session can't make changes, so nothing was done."
|
|
58
|
+
}),
|
|
59
|
+
turnInProgress: Object.freeze({
|
|
60
|
+
key: "writeProposal.error.turnInProgress",
|
|
61
|
+
fallback: "The assistant is still replying, so nothing was done. Confirm the change once it finishes."
|
|
62
|
+
}),
|
|
63
|
+
contextChanged: Object.freeze({
|
|
64
|
+
key: "writeProposal.error.contextChanged",
|
|
65
|
+
fallback: "The workspace changed since this was prepared, so nothing was done. Ask the assistant to prepare it again."
|
|
66
|
+
}),
|
|
67
|
+
storeUnavailable: Object.freeze({
|
|
68
|
+
key: "writeProposal.error.storeUnavailable",
|
|
69
|
+
fallback: "Prepared changes are unavailable right now. Nothing was confirmed. Try again shortly."
|
|
70
|
+
}),
|
|
71
|
+
approvalModeMismatch: Object.freeze({
|
|
72
|
+
key: "writeProposal.error.approvalModeMismatch",
|
|
73
|
+
fallback: "This assistant session confirms changes a different way, so nothing was done. Start a new conversation and try again."
|
|
74
|
+
}),
|
|
75
|
+
panelUpgradeRequired: Object.freeze({
|
|
76
|
+
key: "writeProposal.error.panelUpgradeRequired",
|
|
77
|
+
fallback: "Reload the page to confirm changes from the assistant. Nothing was done."
|
|
78
|
+
}),
|
|
79
|
+
notProposalOwner: Object.freeze({
|
|
80
|
+
key: "writeProposal.error.notProposalOwner",
|
|
81
|
+
fallback: "Only the person who asked for this change can confirm or cancel it."
|
|
82
|
+
}),
|
|
83
|
+
invalidRequest: Object.freeze({
|
|
84
|
+
key: "writeProposal.error.invalidRequest",
|
|
85
|
+
fallback: "That request couldn't be sent, so nothing was confirmed."
|
|
86
|
+
}),
|
|
87
|
+
malformedResponse: Object.freeze({
|
|
88
|
+
key: "writeProposal.error.malformedResponse",
|
|
89
|
+
fallback: "The assistant's answer couldn't be read, so nothing was confirmed."
|
|
90
|
+
}),
|
|
91
|
+
unknown: Object.freeze({
|
|
92
|
+
key: "writeProposal.error.unknown",
|
|
93
|
+
fallback: "That didn't go through, and nothing was confirmed. Try again."
|
|
94
|
+
}),
|
|
95
|
+
indeterminate: Object.freeze({
|
|
96
|
+
key: "writeProposal.error.indeterminate",
|
|
97
|
+
fallback: "No answer came back, so this change may or may not have run. Check its card before trying again."
|
|
98
|
+
}),
|
|
99
|
+
listFailed: Object.freeze({
|
|
100
|
+
key: "writeProposal.error.listFailed",
|
|
101
|
+
fallback: "The change the assistant prepared couldn't be loaded. Nothing has been confirmed."
|
|
102
|
+
})
|
|
103
|
+
}), t = {
|
|
104
|
+
NOT_FOUND: e.notFound,
|
|
105
|
+
SESSION_MISMATCH: e.sessionMismatch,
|
|
106
|
+
CONVERSATION_MISMATCH: e.conversationMismatch,
|
|
107
|
+
ACTOR_MISMATCH: e.actorMismatch,
|
|
108
|
+
HASH_MISMATCH: e.hashMismatch,
|
|
109
|
+
METHOD_NOT_ALLOWED: e.methodNotAllowed,
|
|
110
|
+
SUPERSEDED: e.superseded,
|
|
111
|
+
DECLINED: e.declined,
|
|
112
|
+
NOT_PENDING: e.notPending,
|
|
113
|
+
EXPIRED: e.expired,
|
|
114
|
+
EVICTED: e.evicted,
|
|
115
|
+
READ_ONLY: e.readOnly,
|
|
116
|
+
TURN_IN_PROGRESS: e.turnInProgress,
|
|
117
|
+
CONTEXT_CHANGED: e.contextChanged,
|
|
118
|
+
STORE_UNAVAILABLE: e.storeUnavailable,
|
|
119
|
+
APPROVAL_MODE_MISMATCH: e.approvalModeMismatch,
|
|
120
|
+
PANEL_UPGRADE_REQUIRED: e.panelUpgradeRequired,
|
|
121
|
+
NOT_PROPOSAL_OWNER: e.notProposalOwner,
|
|
122
|
+
INVALID_REQUEST: e.invalidRequest,
|
|
123
|
+
MALFORMED_RESPONSE: e.malformedResponse,
|
|
124
|
+
UNKNOWN: e.unknown
|
|
125
|
+
}, n = new Set([
|
|
126
|
+
"UNKNOWN",
|
|
127
|
+
"MALFORMED_RESPONSE",
|
|
128
|
+
"STORE_UNAVAILABLE",
|
|
129
|
+
"INVALID_REQUEST"
|
|
130
|
+
]);
|
|
131
|
+
function r(r, i) {
|
|
132
|
+
return i === "approve" && r.indeterminate ? e.indeterminate : r.code === "EXECUTION_NOT_ENABLED" ? r.reason === "admin_required" ? e.executionAdminRequired : e.executionFenced : i === "list" && n.has(r.code) ? e.listFailed : t[r.code];
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { e as WRITE_PROPOSAL_ERROR_COPY, r as writeProposalErrorLine };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { AssistantTr } from './i18n';
|
|
2
|
+
import { AssistantMode } from './types';
|
|
3
|
+
import { SandboxWriteCapabilities, WriteApprovalMode, WriteProposalReadbackParts, WriteProposalView } from './writeProposals';
|
|
4
|
+
/**
|
|
5
|
+
* The mode whose sandbox holds changes as proposals — the value of
|
|
6
|
+
* `WRITE_PROPOSAL_SANDBOX_MODE`, written out so this module loads nothing at
|
|
7
|
+
* run time (`writeProposalVoice.test.ts` pins the two together).
|
|
8
|
+
*/
|
|
9
|
+
export declare const VOICE_PROPOSAL_MODE: AssistantMode;
|
|
10
|
+
export interface VoiceProposalBoundInput {
|
|
11
|
+
/** The mode the spoken turn goes into. */
|
|
12
|
+
mode: AssistantMode;
|
|
13
|
+
/** The product's flag (`AssistantProductCapabilities.writeApproval`). */
|
|
14
|
+
productWriteApproval: WriteApprovalMode;
|
|
15
|
+
/**
|
|
16
|
+
* What the sandbox that would take the turn said about writes in its own
|
|
17
|
+
* `/health`. Absent: not read in this page, which is never proposal-bound.
|
|
18
|
+
*/
|
|
19
|
+
capabilities: SandboxWriteCapabilities | null | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Does every change a spoken turn in `mode` could make wait for an on-screen
|
|
23
|
+
* button? Only then may voice be used there (FE9's layers, in contract §4.7
|
|
24
|
+
* order: the send refusal, the mic gate, force-end, the refusal's copy,
|
|
25
|
+
* prewarm, and auto-routing last).
|
|
26
|
+
*
|
|
27
|
+
* ★ Every condition must hold, and each doubt keeps the ban: only the
|
|
28
|
+
* proposal sandbox's mode (a build mode writes directly), only the exact flag
|
|
29
|
+
* value, and only a `/health` that reported proposals AND the proposal flow.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isVoiceProposalBound({ mode, productWriteApproval, capabilities, }: VoiceProposalBoundInput): boolean;
|
|
32
|
+
/** How a sensitive value reads: it is never shown or spoken. */
|
|
33
|
+
export declare const WRITE_PROPOSAL_READBACK_HIDDEN = "(hidden)";
|
|
34
|
+
/**
|
|
35
|
+
* The readback of a change, rendered from the server's `readbackParts` alone:
|
|
36
|
+
* `Create task: title "Water beds", due "Friday"`, `Delete 3 listings`.
|
|
37
|
+
*
|
|
38
|
+
* ★ The same words the sandbox builds its `description.readback` from — the
|
|
39
|
+
* verb, the count, the noun, then each field's label and value — so what is
|
|
40
|
+
* spoken is what the card shows. A sensitive field says `(hidden)`, never its
|
|
41
|
+
* value; fields past the server's cap are counted, not listed.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderWriteProposalReadback(parts: WriteProposalReadbackParts): string;
|
|
44
|
+
/** A line the voice says, through `tr()`. */
|
|
45
|
+
export interface WriteProposalVoiceLine {
|
|
46
|
+
readonly key: string;
|
|
47
|
+
readonly fallback: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Everything FE9 adds to what the panel says. Rendered through
|
|
51
|
+
* `tr(line.key, line.fallback, values)`, and read into the i18n manifest from
|
|
52
|
+
* this table.
|
|
53
|
+
*
|
|
54
|
+
* ★ The two closing lines never end on an affirmative word, so the last thing
|
|
55
|
+
* the readback says cannot be heard back as a "yes".
|
|
56
|
+
*/
|
|
57
|
+
export declare const WRITE_PROPOSAL_VOICE_COPY: Readonly<{
|
|
58
|
+
useButtonVoice: Readonly<{
|
|
59
|
+
key: "writeProposal.useButtonVoice";
|
|
60
|
+
fallback: "To make this change, press “{{label}}” on screen. You can ask me to change it, or say cancel to drop it.";
|
|
61
|
+
}>;
|
|
62
|
+
fencedVoice: Readonly<{
|
|
63
|
+
key: "writeProposal.fencedVoice";
|
|
64
|
+
fallback: "This change can't be run from this session yet; that becomes available once secure confirmation is enabled. You can ask me to change it, or say cancel to drop it.";
|
|
65
|
+
}>;
|
|
66
|
+
chipOne: Readonly<{
|
|
67
|
+
key: "writeProposal.voiceChip";
|
|
68
|
+
fallback: "Change waiting: {{label}}";
|
|
69
|
+
}>;
|
|
70
|
+
chipMany: Readonly<{
|
|
71
|
+
key: "writeProposal.voiceChipMany";
|
|
72
|
+
fallback: "{{count}} changes waiting";
|
|
73
|
+
}>;
|
|
74
|
+
trayClose: Readonly<{
|
|
75
|
+
key: "writeProposal.voiceTrayClose";
|
|
76
|
+
fallback: "Hide the change";
|
|
77
|
+
}>;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* A line of this table, translated. The one place FE9's copy reaches `tr`, so
|
|
81
|
+
* the i18n manifest's inventory has one call to account for.
|
|
82
|
+
*/
|
|
83
|
+
export declare function writeProposalVoiceLine(tr: AssistantTr, line: WriteProposalVoiceLine, values?: Record<string, string | number>): string;
|
|
84
|
+
export interface WriteProposalVoiceReadback {
|
|
85
|
+
/** What is said: the record's readback, then the closing line. */
|
|
86
|
+
text: string;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the closing line came back translated. The readback's own words
|
|
89
|
+
* are the server's, in English; the caller picks the voice from this.
|
|
90
|
+
*/
|
|
91
|
+
translated: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* What the voice says about a change waiting for its button: the readback
|
|
95
|
+
* from `readbackParts`, then "press … on screen" — or, where the card offers
|
|
96
|
+
* no confirm button (a fenced session), the fenced line, so the voice never
|
|
97
|
+
* points to a button that is not there.
|
|
98
|
+
*
|
|
99
|
+
* `offersConfirm` is the card's own rule for the same view and sandbox
|
|
100
|
+
* (`writeProposalConfirmState(view, capabilities).offerConfirm`).
|
|
101
|
+
*/
|
|
102
|
+
export declare function writeProposalVoiceReadback(view: WriteProposalView, offersConfirm: boolean, tr: AssistantTr): WriteProposalVoiceReadback;
|
|
103
|
+
/** One proposal the panel holds, as far as the voice view needs it. */
|
|
104
|
+
export interface VoiceProposalEntry {
|
|
105
|
+
view: WriteProposalView;
|
|
106
|
+
session: {
|
|
107
|
+
sandboxId: string;
|
|
108
|
+
conversationId: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The changes of `conversationId` still waiting for a person, oldest first. A
|
|
113
|
+
* change of a sandbox a failover replaced (`retired`) is an inert record and
|
|
114
|
+
* waits for nothing.
|
|
115
|
+
*/
|
|
116
|
+
export declare function voiceWaitingProposals<T extends VoiceProposalEntry>(entries: readonly T[], conversationId: string | null | undefined, retired?: ReadonlySet<string>): T[];
|
|
117
|
+
/** The voice view's chip: the newest waiting change, and how many wait. */
|
|
118
|
+
export declare function voiceProposalChip<T extends VoiceProposalEntry>(waiting: readonly T[]): {
|
|
119
|
+
entry: T;
|
|
120
|
+
count: number;
|
|
121
|
+
} | null;
|
|
122
|
+
/** The chip's words: the change's confirm label, or how many changes wait. */
|
|
123
|
+
export declare function voiceProposalChipText(chip: {
|
|
124
|
+
entry: VoiceProposalEntry;
|
|
125
|
+
count: number;
|
|
126
|
+
}, tr: AssistantTr): string;
|
|
127
|
+
/**
|
|
128
|
+
* The waiting changes to read out now: bound to their conversation
|
|
129
|
+
* (`approvable` — a card that is not ready says so, and so would the voice)
|
|
130
|
+
* and not read out before (`seen`). Oldest first.
|
|
131
|
+
*/
|
|
132
|
+
export declare function voiceReadbacksDue<T extends VoiceProposalEntry>(waiting: readonly T[], seen: ReadonlySet<string>): T[];
|
|
133
|
+
//# sourceMappingURL=writeProposalVoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeProposalVoice.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/writeProposalVoice.ts"],"names":[],"mappings":"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"}
|