@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
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
* Can this user's writes actually LAND in this workspace?
|
|
3
3
|
*
|
|
4
4
|
* ★ Separate from `useAssistantApiAccess`, and deliberately not a replacement
|
|
5
|
-
* for it. That hook asks
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* legitimate; this hook asks the second one.
|
|
5
|
+
* for it. That hook asks whether this person may USE an admin-only mode
|
|
6
|
+
* (`sandbox:admin` in this workspace). Whether a write LANDS is decided per
|
|
7
|
+
* mutation — so someone could enter Take-action mode, have the model plan a
|
|
8
|
+
* change, confirm it, and only then hit a permission error. The two questions
|
|
9
|
+
* have different answers and both are legitimate; this hook asks the second one.
|
|
11
10
|
*
|
|
12
11
|
* ★ What it can look like: measured 2026-09-02 against prod, `checkPermissions`
|
|
13
12
|
* answered cleanly (HTTP 200, no errors) with `allowed: false`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWorkspaceWriteAccess.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/useWorkspaceWriteAccess.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useWorkspaceWriteAccess.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/useWorkspaceWriteAccess.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAwBH,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,oBAAoB,CAkDtB"}
|
|
@@ -79,6 +79,14 @@ export type VoiceSessionEvent =
|
|
|
79
79
|
/** The user tapped to cut the assistant off. Explicit, not inferred. */
|
|
80
80
|
| {
|
|
81
81
|
type: 'interrupt';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The panel has a line of its own to say (BOFF-7803 FE9: the readback of a
|
|
85
|
+
* change waiting for its button). Only a QUIET `listening` moves: see
|
|
86
|
+
* `planVoiceAnnouncement`.
|
|
87
|
+
*/
|
|
88
|
+
| {
|
|
89
|
+
type: 'announce';
|
|
82
90
|
} | {
|
|
83
91
|
type: 'fail';
|
|
84
92
|
error: VoiceSessionError;
|
|
@@ -196,6 +204,44 @@ export declare const INITIAL_SESSION: Readonly<VoiceSessionSnapshot>;
|
|
|
196
204
|
* because it belongs to the speech engine, not to the session.
|
|
197
205
|
*/
|
|
198
206
|
export declare function voiceSessionReducer(snapshot: VoiceSessionSnapshot, event: VoiceSessionEvent, spokenText?: string | null): VoiceSessionSnapshot;
|
|
207
|
+
/**
|
|
208
|
+
* What to do with a line the panel wants to say (BOFF-7803 FE9), given where
|
|
209
|
+
* the conversation is.
|
|
210
|
+
*
|
|
211
|
+
* - `start`: listening and nothing heard — close the microphone and say it now
|
|
212
|
+
* (the `announce` event).
|
|
213
|
+
* - `queue`: the assistant is speaking, or a turn is in flight whose reply will
|
|
214
|
+
* be — say it right after that reply, before the microphone reopens.
|
|
215
|
+
* - `drop`: the person is talking (their words will move the conversation on),
|
|
216
|
+
* or there is no live session. A dropped line is not lost information: the
|
|
217
|
+
* voice view's chip still shows what waits.
|
|
218
|
+
*/
|
|
219
|
+
export declare function planVoiceAnnouncement(snapshot: VoiceSessionSnapshot): 'start' | 'queue' | 'drop';
|
|
220
|
+
/**
|
|
221
|
+
* Pausing listening while something else needs the person — the change
|
|
222
|
+
* confirmation dialog (BOFF-7803 FE9) — and taking it back afterwards.
|
|
223
|
+
*
|
|
224
|
+
* ★ Muting is how the session releases the microphone legitimately
|
|
225
|
+
* (`isCapturing` is false whenever muted, and nothing heard while muted is
|
|
226
|
+
* kept), so the pause reuses it rather than inventing a parallel state — the
|
|
227
|
+
* same move `AssistantVoiceSession` makes for an OS picker. And it only ever
|
|
228
|
+
* undoes a mute IT applied: a person who muted themselves before the dialog
|
|
229
|
+
* opened stays muted after it closes.
|
|
230
|
+
*
|
|
231
|
+
* Returns the mute to dispatch (or null) and whether the pause now holds the
|
|
232
|
+
* microphone.
|
|
233
|
+
*/
|
|
234
|
+
export declare function planListeningHold(input: {
|
|
235
|
+
/** Should listening be paused now? */
|
|
236
|
+
requested: boolean;
|
|
237
|
+
/** Does the pause currently hold a mute it applied? */
|
|
238
|
+
held: boolean;
|
|
239
|
+
/** Is the microphone muted right now (by the person, if not by the pause)? */
|
|
240
|
+
muted: boolean;
|
|
241
|
+
}): {
|
|
242
|
+
mute: boolean | null;
|
|
243
|
+
held: boolean;
|
|
244
|
+
};
|
|
199
245
|
/**
|
|
200
246
|
* Is the microphone capturing right now?
|
|
201
247
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voiceSession.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/voice/voiceSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAEzF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,iBAAiB,CAAC;IACzB,8DAA8D;IAC9D,KAAK,EAAE,OAAO,CAAC;IACf,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,YAAY,CAAC;AAExF,MAAM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|
|
107
107
|
interim: ""
|
|
108
108
|
} : e;
|
|
109
|
+
case "announce": return e.phase === "listening" && a(e) === "" ? {
|
|
110
|
+
...e,
|
|
111
|
+
phase: "speaking",
|
|
112
|
+
pending: "",
|
|
113
|
+
interim: ""
|
|
114
|
+
} : e;
|
|
109
115
|
default: return e;
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
function h(e) {
|
|
113
|
-
|
|
119
|
+
switch (e.phase) {
|
|
120
|
+
case "listening": return a(e) === "" ? "start" : "drop";
|
|
121
|
+
case "thinking":
|
|
122
|
+
case "speaking": return "queue";
|
|
123
|
+
default: return "drop";
|
|
124
|
+
}
|
|
114
125
|
}
|
|
115
126
|
function g(e) {
|
|
127
|
+
let { requested: t, held: n, muted: r } = e;
|
|
128
|
+
return t ? n ? {
|
|
129
|
+
mute: null,
|
|
130
|
+
held: !0
|
|
131
|
+
} : r ? {
|
|
132
|
+
mute: null,
|
|
133
|
+
held: !1
|
|
134
|
+
} : {
|
|
135
|
+
mute: !0,
|
|
136
|
+
held: !0
|
|
137
|
+
} : n ? {
|
|
138
|
+
mute: !1,
|
|
139
|
+
held: !1
|
|
140
|
+
} : {
|
|
141
|
+
mute: null,
|
|
142
|
+
held: !1
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function _(e) {
|
|
146
|
+
return e.muted ? !1 : e.phase === "listening";
|
|
147
|
+
}
|
|
148
|
+
function v(e) {
|
|
116
149
|
switch (e.phase) {
|
|
117
150
|
case "thinking": return "thinking";
|
|
118
151
|
case "speaking": return "speaking";
|
|
@@ -121,4 +154,4 @@ function g(e) {
|
|
|
121
154
|
}
|
|
122
155
|
}
|
|
123
156
|
//#endregion
|
|
124
|
-
export { t as ENDPOINT_GRACE_MS, p as INITIAL_SESSION, n as INTERRUPT_MAX_MS, r as INTERRUPT_MIN_MS, o as NOTHING_HEARD, e as SILENCE_SUBMIT_MS, c as advanceHeardClock,
|
|
157
|
+
export { t as ENDPOINT_GRACE_MS, p as INITIAL_SESSION, n as INTERRUPT_MAX_MS, r as INTERRUPT_MIN_MS, o as NOTHING_HEARD, e as SILENCE_SUBMIT_MS, c as advanceHeardClock, _ as isCapturing, d as isEcho, i as isSubmittable, v as orbMode, g as planListeningHold, f as planReplyConsumption, h as planVoiceAnnouncement, a as spokenSoFar, m as voiceSessionReducer };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AssistantConfirmWrite } from './product';
|
|
2
|
+
import { WriteProposalView } from './writeProposals';
|
|
3
|
+
/**
|
|
4
|
+
* Asking a product's own dialog to confirm a HIGH-risk write proposal
|
|
5
|
+
* (BOFF-7803 5a, unit FE5): the `confirmWrite` seam, run.
|
|
6
|
+
*
|
|
7
|
+
* ★★ 5a is a safety floor, not the final security boundary. The product's
|
|
8
|
+
* dialog only ASKS the person. It never receives the proposal client or an
|
|
9
|
+
* approve function, so it cannot approve anything itself: this returns what
|
|
10
|
+
* the person chose, and fe-libs makes the call. The issuing sandbox and
|
|
11
|
+
* wspace-sandbox-svc still decide whether anything runs.
|
|
12
|
+
*
|
|
13
|
+
* Kept free of runtime React and DOM imports so it can be tested alone.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* What fe-libs does next:
|
|
17
|
+
* - `approve`: the person confirmed in the product's dialog;
|
|
18
|
+
* - `decline`: the person cancelled there;
|
|
19
|
+
* - `default`: show fe-libs' own dialog (no seam, `'unhandled'`, a throw, or
|
|
20
|
+
* any answer that is not exactly `'confirmed'` or `'cancelled'`);
|
|
21
|
+
* - `aborted`: the question no longer stands; do nothing.
|
|
22
|
+
*/
|
|
23
|
+
export type WriteConfirmSeamDecision = "approve" | "decline" | "default" | "aborted";
|
|
24
|
+
/**
|
|
25
|
+
* Ask the product's `confirmWrite`, if it has one, about `view`.
|
|
26
|
+
*
|
|
27
|
+
* ★ Only an exact `'confirmed'` approves. Everything uncertain falls back to
|
|
28
|
+
* the default dialog, which asks again; nothing uncertain approves. An answer
|
|
29
|
+
* that arrives after `signal` aborted is dropped, whatever it is.
|
|
30
|
+
*/
|
|
31
|
+
export declare function askProductToConfirmWrite(confirmWrite: AssistantConfirmWrite | undefined, view: WriteProposalView, signal: AbortSignal): Promise<WriteConfirmSeamDecision>;
|
|
32
|
+
//# sourceMappingURL=writeConfirmSeam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeConfirmSeam.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/writeConfirmSeam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;;;;;;;GAWG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAChC,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAed;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,qBAAqB,GAAG,SAAS,EAC/C,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,wBAAwB,CAAC,CAgBnC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/shared/assistant/writeConfirmSeam.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
try {
|
|
4
|
+
return structuredClone(e);
|
|
5
|
+
} catch {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
async function t(t, n, r) {
|
|
10
|
+
if (r.aborted) return "aborted";
|
|
11
|
+
if (!t) return "default";
|
|
12
|
+
let i = e(n);
|
|
13
|
+
if (!i) return "default";
|
|
14
|
+
let a;
|
|
15
|
+
try {
|
|
16
|
+
a = await t(i, { signal: r });
|
|
17
|
+
} catch {
|
|
18
|
+
return r.aborted ? "aborted" : "default";
|
|
19
|
+
}
|
|
20
|
+
return r.aborted ? "aborted" : a === "confirmed" ? "approve" : a === "cancelled" ? "decline" : "default";
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { t as askProductToConfirmWrite };
|
|
@@ -25,23 +25,31 @@ export declare const LEGACY_WRITE_CONSENT_KEY = "apiCallsAcknowledged";
|
|
|
25
25
|
export declare function restoreAcknowledgedWriteModes(persisted: unknown): AssistantMode[];
|
|
26
26
|
/** Has this profile accepted the write consent for `mode`? */
|
|
27
27
|
export declare function isWriteModeAcknowledged(acknowledged: readonly AssistantMode[], mode: AssistantMode): boolean;
|
|
28
|
+
/** What the send-time check needs to know about the turn. */
|
|
29
|
+
export interface WriteModeSendCheck {
|
|
30
|
+
dictated: boolean;
|
|
31
|
+
confirmsWrites: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* ★★ BOFF-7803 5a (FE9): every change this turn could make is held as a
|
|
34
|
+
* PROPOSAL that only an on-screen button confirms: the issuing sandbox's own
|
|
35
|
+
* `/health` said `proposal-v1` AND the product's flag is `proposal-v1`
|
|
36
|
+
* (`isVoiceProposalBound`). Only then may a spoken turn go into a mode that
|
|
37
|
+
* writes. Nothing spoken can run a change there, and the voice may prepare,
|
|
38
|
+
* revise and cancel. Absent or false keeps the voice ban exactly as before.
|
|
39
|
+
*/
|
|
40
|
+
proposalBound?: boolean;
|
|
41
|
+
}
|
|
28
42
|
/**
|
|
29
43
|
* Send-time consent and voice checks against the validated post-wait mode: why
|
|
30
44
|
* the send must not go ahead, or null.
|
|
31
45
|
*/
|
|
32
|
-
export declare function writeModeSendRefusalReason(mode: AssistantMode, config: Pick<AssistantModeConfig, "writeCapable"> | undefined, acknowledged: readonly AssistantMode[], { dictated, confirmsWrites }:
|
|
33
|
-
dictated: boolean;
|
|
34
|
-
confirmsWrites: boolean;
|
|
35
|
-
}): Extract<SendRefusalReason, "confirm-write-mode" | "voice-in-write-mode"> | null;
|
|
46
|
+
export declare function writeModeSendRefusalReason(mode: AssistantMode, config: Pick<AssistantModeConfig, "writeCapable"> | undefined, acknowledged: readonly AssistantMode[], { dictated, confirmsWrites, proposalBound }: WriteModeSendCheck): Extract<SendRefusalReason, "confirm-write-mode" | "voice-in-write-mode"> | null;
|
|
36
47
|
/**
|
|
37
48
|
* The same check, as the English a person reads. Kept for callers that want
|
|
38
49
|
* the words; the panel throws `AssistantSendRefusal` with the reason and
|
|
39
50
|
* translates it (`TURN_OUTCOME_COPY`).
|
|
40
51
|
*/
|
|
41
|
-
export declare function writeModeSendRefusal(mode: AssistantMode, config: Pick<AssistantModeConfig, "writeCapable"> | undefined, acknowledged: readonly AssistantMode[], options:
|
|
42
|
-
dictated: boolean;
|
|
43
|
-
confirmsWrites: boolean;
|
|
44
|
-
}): string | null;
|
|
52
|
+
export declare function writeModeSendRefusal(mode: AssistantMode, config: Pick<AssistantModeConfig, "writeCapable"> | undefined, acknowledged: readonly AssistantMode[], options: WriteModeSendCheck): string | null;
|
|
45
53
|
/** `acknowledged` plus `mode`, unchanged (same array) if it is already there. */
|
|
46
54
|
export declare function withWriteModeAcknowledged(acknowledged: readonly AssistantMode[], mode: AssistantMode): readonly AssistantMode[];
|
|
47
55
|
/** A mode as the dialog needs it: the product's config, or just an id. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeModeConsent.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/writeModeConsent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAM1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAc/D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,OAAO,GAAG,aAAa,EAAE,CAiBjF;AAED,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EAA+E;IAC/E,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,OAAO,CAAC;CACzB,GACA,oBAAoB,CA+DtB"}
|
|
@@ -16,8 +16,8 @@ function o(e) {
|
|
|
16
16
|
function s(e, t) {
|
|
17
17
|
return e.includes(t);
|
|
18
18
|
}
|
|
19
|
-
function c(e, t, n, { dictated: r, confirmsWrites: i }) {
|
|
20
|
-
return t?.writeCapable && !s(n, e) ? "confirm-write-mode" : r && (t?.writeCapable || i) ? "voice-in-write-mode" : null;
|
|
19
|
+
function c(e, t, n, { dictated: r, confirmsWrites: i, proposalBound: a = !1 }) {
|
|
20
|
+
return t?.writeCapable && !s(n, e) ? "confirm-write-mode" : r && a !== !0 && (t?.writeCapable || i) ? "voice-in-write-mode" : null;
|
|
21
21
|
}
|
|
22
22
|
function l(e, t, n, i) {
|
|
23
23
|
let a = c(e, t, n, i);
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { WriteProposalError, SandboxWriteCapabilities, WriteProposalApproveSurface, WriteProposalClient, WriteProposalDeclineMethod, WriteProposalDeclineReason, WriteProposalDecisionSurface, WriteProposalList, WriteProposalPresentationSurface, WriteProposalView } from './writeProposals';
|
|
2
|
+
/**
|
|
3
|
+
* What a message's metadata holds about the proposals its turn raised
|
|
4
|
+
* (`writeProposalRefs`): references only, never a view or a payload. The card
|
|
5
|
+
* is always drawn from what the issuing sandbox answers now.
|
|
6
|
+
*/
|
|
7
|
+
export interface WriteProposalMessageRef {
|
|
8
|
+
proposalId: string;
|
|
9
|
+
sandboxId: string;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The well-formed references a message holds, each proposal once. Anything
|
|
14
|
+
* else — a stored value from an older build, a hand-edited one — is dropped,
|
|
15
|
+
* so no call is ever addressed from it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function readWriteProposalRefs(metadata: {
|
|
18
|
+
readonly writeProposalRefs?: unknown;
|
|
19
|
+
} | null | undefined): WriteProposalMessageRef[];
|
|
20
|
+
/** One sandbox session, and the panel conversation it belongs to. */
|
|
21
|
+
export interface WriteProposalSession {
|
|
22
|
+
sandboxId: string;
|
|
23
|
+
sessionId: string;
|
|
24
|
+
conversationId: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Whether a listed record may be drawn for `session` (BOFF-8128).
|
|
28
|
+
*
|
|
29
|
+
* The sandbox answers a session's list with the records bound to that session
|
|
30
|
+
* and to the actor asking, plus the ones its helper printed there that it
|
|
31
|
+
* could not bind yet. This is the panel's own check on the answer: a record
|
|
32
|
+
* bound to ANOTHER session or ANOTHER conversation is never this one's, so it
|
|
33
|
+
* is not drawn here and nothing is decided on it from here. A record not bound
|
|
34
|
+
* yet (`null`) is kept: its view says `approvable: false`, so its card offers
|
|
35
|
+
* no confirm.
|
|
36
|
+
*/
|
|
37
|
+
export declare function writeProposalBelongsTo(view: Pick<WriteProposalView, "sessionId" | "conversationId">, session: Pick<WriteProposalSession, "sessionId" | "conversationId">): boolean;
|
|
38
|
+
/** A session a reopened conversation may hold proposals in. */
|
|
39
|
+
export interface WriteProposalReopenTarget {
|
|
40
|
+
session: WriteProposalSession;
|
|
41
|
+
/**
|
|
42
|
+
* The session ran in a Take-action sandbox, the only kind that issues
|
|
43
|
+
* proposals (`WRITE_PROPOSAL_SANDBOX_MODE`): a reference names it, or the
|
|
44
|
+
* reply that ran there says so. Only such a sandbox's `/health` is read
|
|
45
|
+
* when this page has not read it yet (after a reload).
|
|
46
|
+
*/
|
|
47
|
+
issuing: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** What `writeProposalSessionsToReopen` reads of a message. */
|
|
50
|
+
interface ReopenMessage {
|
|
51
|
+
metadata?: {
|
|
52
|
+
readonly sandboxId?: unknown;
|
|
53
|
+
readonly sessionId?: unknown;
|
|
54
|
+
readonly mode?: unknown;
|
|
55
|
+
readonly writeProposalRefs?: unknown;
|
|
56
|
+
} | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The sessions to read when a conversation is opened, each once:
|
|
60
|
+
* - every session its replies' references name (this device's own record of
|
|
61
|
+
* the proposals the thread showed);
|
|
62
|
+
* - the session the conversation is in now (`backendSessionId`), in the
|
|
63
|
+
* sandbox its newest reply there ran in: a proposal whose turn could not be
|
|
64
|
+
* read at the time is found here.
|
|
65
|
+
*
|
|
66
|
+
* ★ Nothing else. A conversation read back from server history has no
|
|
67
|
+
* references (they never leave the device) and no current session, so it has
|
|
68
|
+
* nothing to read: a proposal lives in the sandbox that issued it, and only
|
|
69
|
+
* this device's own thread points at it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function writeProposalSessionsToReopen(conversation: {
|
|
72
|
+
id: string;
|
|
73
|
+
backendSessionId?: string | null;
|
|
74
|
+
messages: readonly ReopenMessage[];
|
|
75
|
+
}): WriteProposalReopenTarget[];
|
|
76
|
+
/**
|
|
77
|
+
* Why the panel asked:
|
|
78
|
+
* - `turn`: a turn in this session just settled;
|
|
79
|
+
* - `open`: a conversation was opened, or (BOFF-8128) the `/health` of a
|
|
80
|
+
* sandbox it was waiting on arrived — after a reload, nothing may be asked
|
|
81
|
+
* before it;
|
|
82
|
+
* - `mount`: a card mounted whose record this panel does not hold;
|
|
83
|
+
* - `poll`: a proposal of the session is executing;
|
|
84
|
+
* - `refresh`: after a press, so the card shows the record.
|
|
85
|
+
*/
|
|
86
|
+
export type WriteProposalDiscoveryReason = "turn" | "open" | "mount" | "poll" | "refresh";
|
|
87
|
+
/** What the person (or the panel) was doing when a call failed. */
|
|
88
|
+
export type WriteProposalFailedAction = "approve" | "decline" | "list";
|
|
89
|
+
export interface WriteProposalListContext {
|
|
90
|
+
reason: WriteProposalDiscoveryReason;
|
|
91
|
+
/** The reply of the turn that just settled (`turn` only). */
|
|
92
|
+
turnMessageId: string | null;
|
|
93
|
+
}
|
|
94
|
+
export interface WriteProposalTimers {
|
|
95
|
+
set: (run: () => void, ms: number) => unknown;
|
|
96
|
+
clear: (handle: unknown) => void;
|
|
97
|
+
}
|
|
98
|
+
export interface WriteProposalDiscoveryDeps {
|
|
99
|
+
client: WriteProposalClient;
|
|
100
|
+
/** The ISSUING sandbox's `/health` write capabilities, read live. */
|
|
101
|
+
capabilitiesOf: (sandboxId: string) => SandboxWriteCapabilities | null | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* A list arrived for `session`: only the records that belong to it
|
|
104
|
+
* (`writeProposalBelongsTo`).
|
|
105
|
+
*/
|
|
106
|
+
onList: (session: WriteProposalSession, list: WriteProposalList, context: WriteProposalListContext) => void;
|
|
107
|
+
/** One proposal as the sandbox now reports it. */
|
|
108
|
+
onView: (session: WriteProposalSession, view: WriteProposalView) => void;
|
|
109
|
+
/** A refusal or failure the person should be told about. */
|
|
110
|
+
onError: (session: WriteProposalSession, error: WriteProposalError, action: WriteProposalFailedAction) => void;
|
|
111
|
+
timers?: WriteProposalTimers;
|
|
112
|
+
/** How often an executing proposal is re-read. */
|
|
113
|
+
pollMs?: number;
|
|
114
|
+
/** Consecutive failed reads after which polling stops (and says so). */
|
|
115
|
+
maxPollFailures?: number;
|
|
116
|
+
/** A `clientRequestId` for each call. */
|
|
117
|
+
requestId?: () => string;
|
|
118
|
+
/**
|
|
119
|
+
* Who is signed in now (BOFF-8128). Read when a list is asked for and again
|
|
120
|
+
* when it answers: an answer read for a person who is no longer the one
|
|
121
|
+
* signed in (someone else, or no one) is dropped, unseen. Absent, or no one
|
|
122
|
+
* known when it was asked: the answer is kept — the gateway identified the
|
|
123
|
+
* caller from the credentials the request carried.
|
|
124
|
+
*/
|
|
125
|
+
actorOf?: () => string | null | undefined;
|
|
126
|
+
}
|
|
127
|
+
export interface WriteProposalDiscovery {
|
|
128
|
+
/** Ask the issuing sandbox what the session holds. */
|
|
129
|
+
discover: (session: WriteProposalSession, reason: WriteProposalDiscoveryReason, options?: {
|
|
130
|
+
turnMessageId?: string | null;
|
|
131
|
+
}) => Promise<void>;
|
|
132
|
+
/** A person pressed confirm (the card's button, or a dialog's). */
|
|
133
|
+
approve: (session: WriteProposalSession, view: WriteProposalView, surface: WriteProposalApproveSurface) => Promise<void>;
|
|
134
|
+
/** A person pressed Cancel (or the panel withdrew it). */
|
|
135
|
+
decline: (session: WriteProposalSession, view: WriteProposalView, reason: WriteProposalDeclineReason, method: WriteProposalDeclineMethod, surface?: WriteProposalDecisionSurface) => Promise<void>;
|
|
136
|
+
/** The proposal was shown (card half-visible for 500 ms, or a dialog). */
|
|
137
|
+
presented: (session: WriteProposalSession, view: WriteProposalView, surface: WriteProposalPresentationSurface) => Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Decline every PENDING proposal of the session in its conversation
|
|
140
|
+
* (`POST /sessions/:sid/write-proposals/decline`), then re-read it so the
|
|
141
|
+
* cards show the records. Resolves `true` when the sandbox answered, `false`
|
|
142
|
+
* when it refused or could not be reached; never rejects. A failure is
|
|
143
|
+
* reported only when `report` is set (a person's reply), never for the
|
|
144
|
+
* panel's own lifecycle declines, which are best-effort.
|
|
145
|
+
*/
|
|
146
|
+
declineAll: (session: WriteProposalSession, reason: WriteProposalDeclineReason, method: WriteProposalDeclineMethod, options?: {
|
|
147
|
+
report?: boolean;
|
|
148
|
+
refresh?: boolean;
|
|
149
|
+
}) => Promise<boolean>;
|
|
150
|
+
/**
|
|
151
|
+
* The sandbox was replaced (failover): from now on no approve, decline or
|
|
152
|
+
* presentation is sent to it — its cards are inert. Reads still are, so a
|
|
153
|
+
* change it was already running can still be followed to its outcome.
|
|
154
|
+
*/
|
|
155
|
+
retire: (sandboxId: string) => void;
|
|
156
|
+
/** Was the sandbox replaced? */
|
|
157
|
+
isRetired: (sandboxId: string) => boolean;
|
|
158
|
+
/** Is the session being re-read because a proposal is executing? */
|
|
159
|
+
isPolling: (session: WriteProposalSession) => boolean;
|
|
160
|
+
/** Stop every poll and drop every answer still on its way. */
|
|
161
|
+
dispose: () => void;
|
|
162
|
+
}
|
|
163
|
+
/** How often an executing proposal is re-read (design §5.6: "poll every 2 s"). */
|
|
164
|
+
export declare const WRITE_PROPOSAL_POLL_MS = 2000;
|
|
165
|
+
/**
|
|
166
|
+
* Consecutive failed reads after which polling stops. The sandbox itself
|
|
167
|
+
* turns a stale `executing` record into `outcome_unknown` after 120 s, so a
|
|
168
|
+
* panel that lost the sandbox for 10 s has nothing to gain by asking forever.
|
|
169
|
+
*/
|
|
170
|
+
export declare const WRITE_PROPOSAL_MAX_POLL_FAILURES = 5;
|
|
171
|
+
/**
|
|
172
|
+
* Whether the panel may ask this sandbox about proposals at all: its OWN
|
|
173
|
+
* `/health` said `proposal-v1` AND reported the v1 proposal protocol
|
|
174
|
+
* (`writeProposals: "v1"`). Either one alone, or unknown (never read), is
|
|
175
|
+
* legacy. ★ The same pair the card (`writeProposalConfirmState`) and the voice
|
|
176
|
+
* ban require: the mode alone would suppress the legacy approval card while
|
|
177
|
+
* the proposal card, without the protocol, offers nothing — a pending write
|
|
178
|
+
* with no way to approve it.
|
|
179
|
+
*/
|
|
180
|
+
export declare function writeProposalsEnabledFor(capabilities: SandboxWriteCapabilities | null | undefined): boolean;
|
|
181
|
+
/** A `clientRequestId` the sandbox accepts (`/^[A-Za-z0-9_.:-]{1,128}$/`). */
|
|
182
|
+
export declare function newWriteProposalRequestId(): string;
|
|
183
|
+
/** Any thrown value, as a proposal error (a plain `Error` is `UNKNOWN`). */
|
|
184
|
+
export declare function asWriteProposalError(error: unknown): WriteProposalError;
|
|
185
|
+
export declare function createWriteProposalDiscovery(deps: WriteProposalDiscoveryDeps): WriteProposalDiscovery;
|
|
186
|
+
export {};
|
|
187
|
+
//# sourceMappingURL=writeProposalDiscovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeProposalDiscovery.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/writeProposalDiscovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAEL,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