@burdenoff/fe-libs 2026.926.3 → 2026.926.4
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/autoRouting.d.ts +1 -0
- package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
- package/dist/shared/assistant/autoRouting.js +1 -1
- package/dist/shared/assistant/conversation.d.ts +29 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/guardedStorage.d.ts +32 -0
- package/dist/shared/assistant/guardedStorage.d.ts.map +1 -0
- package/dist/shared/assistant/guardedStorage.js +36 -0
- package/dist/shared/assistant/i18nManifest.d.ts +7 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +7 -0
- package/dist/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/liveTurns.d.ts +145 -0
- package/dist/shared/assistant/liveTurns.d.ts.map +1 -0
- package/dist/shared/assistant/liveTurns.js +99 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +11 -10
- package/dist/shared/assistant/turnState.d.ts +12 -0
- package/dist/shared/assistant/turnState.d.ts.map +1 -1
- package/dist/shared/assistant/turnState.js +4 -1
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +704 -568
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +19 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +92 -88
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts +22 -2
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +37 -36
- package/dist/shared/assistant/ui/AssistantPendingWriteCard.d.ts +34 -0
- package/dist/shared/assistant/ui/AssistantPendingWriteCard.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantPendingWriteCard.js +31 -28
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +1 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +119 -117
- package/dist/shared/assistant/voice/voiceReopen.d.ts +117 -0
- package/dist/shared/assistant/voice/voiceReopen.d.ts.map +1 -0
- package/dist/shared/assistant/voice/voiceReopen.js +49 -0
- package/dist/shared-assistant.js +101 -98
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoRouting.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/autoRouting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,SAAS,CAAC;AAEnE,gFAAgF;AAChF,eAAO,MAAM,cAAc,cAA6C,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,cAA6C,CAAC;AAE1E,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,GAChD,OAAO,CAKT;AAslBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAmBrE;AA+BD,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;GASG;A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;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,iBAAiB,EAAE,SAAS,MAAM,EAAE,EACpC,OAAO,EAAE,MAAM,GACd,MAAM,CA2BR;AAED,uDAAuD;AACvD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,QAAQ,EAAE,SAAS;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE;YAAE,WAAW,CAAC,EAAE,OAAO,CAAC;YAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;KAClE,EAAE,CAAC;CACL;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,yBAAyB,GAAG,SAAS,EACnD,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,OAAO,GACpB,MAAM,CAmBR;AAMD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,SAAI,GACR,cAAc,EAAE,CAalB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAyB9D"}
|
|
@@ -828,7 +828,7 @@ function X(e, t) {
|
|
|
828
828
|
].join("\n");
|
|
829
829
|
}
|
|
830
830
|
function Z(e, t, n) {
|
|
831
|
-
return !e || e.routedBy !== "auto" || !n ? "" : X(e.messages.filter((e) => e.role === "user" && !e.metadata?.localAction).map((e) => e.content), t);
|
|
831
|
+
return !e || e.routedBy !== "auto" || !n ? "" : X(e.messages.filter((e) => e.role === "user" && !e.metadata?.localAction && !e.metadata?.approvalFollowUp).map((e) => e.content), t);
|
|
832
832
|
}
|
|
833
833
|
function Q(e, t, n = 4) {
|
|
834
834
|
let r = [], i = /* @__PURE__ */ new Set(), a = (e, t) => {
|
|
@@ -120,6 +120,35 @@ export interface AssistantMessageMetadata {
|
|
|
120
120
|
* what was done; nothing re-runs it when the conversation is reopened.
|
|
121
121
|
*/
|
|
122
122
|
localAction?: AssistantLocalAction;
|
|
123
|
+
/**
|
|
124
|
+
* ★ BOFF-7335: this user message is the "I approved that change — go ahead."
|
|
125
|
+
* the panel sent after the Approve button landed — not something the person
|
|
126
|
+
* typed. Retry and Auto's carry-over never replay it, so a reopened
|
|
127
|
+
* conversation can never resend an approval; the approval itself lives in the
|
|
128
|
+
* sandbox and is single-use.
|
|
129
|
+
*/
|
|
130
|
+
approvalFollowUp?: true;
|
|
131
|
+
/**
|
|
132
|
+
* ★ BOFF-7335: on that "go ahead", the id of the reply whose change was
|
|
133
|
+
* approved — so its card can say the assistant was asked to go ahead with
|
|
134
|
+
* it, from the go-ahead itself rather than from where it happens to sit in
|
|
135
|
+
* the thread.
|
|
136
|
+
*/
|
|
137
|
+
approvedReplyId?: string;
|
|
138
|
+
/**
|
|
139
|
+
* ★ BOFF-7335: when the person's Approve for this reply's `pendingWrite`
|
|
140
|
+
* LANDED (ISO time). The card reads as approved from then on — never as
|
|
141
|
+
* expired, which would tell someone whose change was carried out that nothing
|
|
142
|
+
* changed and invite them to ask for it again. A record: no button comes back
|
|
143
|
+
* for it.
|
|
144
|
+
*/
|
|
145
|
+
pendingWriteApprovedAt?: string;
|
|
146
|
+
/**
|
|
147
|
+
* ★ BOFF-7335: the client stopped waiting before the model finished — the
|
|
148
|
+
* reply holds what had arrived, plus the note that says so. A record, not an
|
|
149
|
+
* error: the turn still closed as a normal answer.
|
|
150
|
+
*/
|
|
151
|
+
incomplete?: true;
|
|
123
152
|
[key: string]: unknown;
|
|
124
153
|
}
|
|
125
154
|
export interface Message {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","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,CAAC;IAClB,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAC1B,oBAAoB,GACpB,uBAAuB,GACvB,qBAAqB,GACrB,kBAAkB,GAClB,YAAY,GACZ,UAAU,CAAC;AAEf,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,aAAa,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;;OAeG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EA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+1,32 @@
|
|
|
1
|
+
import { PersistStorage } from 'zustand/middleware';
|
|
2
|
+
/**
|
|
3
|
+
* Persist storage that can refuse a write without failing the action behind it
|
|
4
|
+
* (BOFF-7335).
|
|
5
|
+
*
|
|
6
|
+
* ★★ WHY. The persist middleware writes after EVERY set — `set(...); return
|
|
7
|
+
* setItem();` — and calls storage synchronously, so a `setItem` that throws
|
|
8
|
+
* throws out of the store action itself. The profile-scoped adapter has no
|
|
9
|
+
* guard around `localStorage.setItem`, and a full origin quota
|
|
10
|
+
* (`QuotaExceededError`), or storage the browser has blocked, therefore threw
|
|
11
|
+
* out of `addMessage` in the middle of a turn: the question was on screen, the
|
|
12
|
+
* turn never started, and nothing said why. Conversations are the one thing
|
|
13
|
+
* here that grows without bound.
|
|
14
|
+
*
|
|
15
|
+
* The state is already in memory when the write is attempted — the middleware
|
|
16
|
+
* sets first — so dropping the write loses nothing this page shows. It is not
|
|
17
|
+
* saved for the next load; the next write that fits saves everything, since
|
|
18
|
+
* each write is the whole persisted state.
|
|
19
|
+
*
|
|
20
|
+
* ★ Logged once per failure streak, not per write: a turn writes on every poll,
|
|
21
|
+
* and one line per poll would bury the console.
|
|
22
|
+
*
|
|
23
|
+
* `onWriteError` is told about each refused write — the place to free space,
|
|
24
|
+
* whose own write then persists the smaller state. It is never re-entered: a
|
|
25
|
+
* write that fails while it runs is dropped without calling it again, so a
|
|
26
|
+
* callback that writes cannot recurse.
|
|
27
|
+
*
|
|
28
|
+
* Reads are not wrapped: the middleware already catches a read that throws and
|
|
29
|
+
* hydrates nothing.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createGuardedAssistantStorage<S>(storage: PersistStorage<S> | undefined, onWriteError?: (error: unknown, name: string) => void): PersistStorage<S> | undefined;
|
|
32
|
+
//# sourceMappingURL=guardedStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardedStorage.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/guardedStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,EACtC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GACpD,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CA8C/B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/shared/assistant/guardedStorage.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (!e) return;
|
|
4
|
+
let n = !1, r = !1, i = (e, i) => {
|
|
5
|
+
if (n || (n = !0, console.warn(`[assistant] could not save "${i}"; this page keeps working, but the change is not saved until a later save fits`, e)), !(!t || r)) {
|
|
6
|
+
r = !0;
|
|
7
|
+
try {
|
|
8
|
+
t(e, i);
|
|
9
|
+
} catch {} finally {
|
|
10
|
+
r = !1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
getItem: (t) => e.getItem(t),
|
|
16
|
+
setItem: (t, r) => {
|
|
17
|
+
try {
|
|
18
|
+
let i = e.setItem(t, r);
|
|
19
|
+
return n = !1, i;
|
|
20
|
+
} catch (e) {
|
|
21
|
+
i(e, t);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
removeItem: (t) => {
|
|
26
|
+
try {
|
|
27
|
+
return e.removeItem(t);
|
|
28
|
+
} catch (e) {
|
|
29
|
+
i(e, t);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { e as createGuardedAssistantStorage };
|
|
@@ -222,9 +222,16 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
222
222
|
readonly "overlay.launcherTitle": "AI Assistant ({{shortcut}})";
|
|
223
223
|
readonly "panel.ariaLabel": "AI Assistant";
|
|
224
224
|
readonly "pendingWrite.approve": "Approve this change";
|
|
225
|
+
readonly "pendingWrite.approved": "The assistant's next reply says whether it was carried out.";
|
|
226
|
+
readonly "pendingWrite.approvedAria": "Approved change request";
|
|
227
|
+
readonly "pendingWrite.approvedNotSent": "The assistant was not told to go ahead with it. If you still want this change, ask for it again.";
|
|
225
228
|
readonly "pendingWrite.approvedPrompt": "I approved that change — go ahead.";
|
|
229
|
+
readonly "pendingWrite.approvedTitle": "You approved this change";
|
|
226
230
|
readonly "pendingWrite.approving": "Approving…";
|
|
227
231
|
readonly "pendingWrite.aria": "Change awaiting your approval";
|
|
232
|
+
readonly "pendingWrite.expired": "It stays here as a record of what was asked. If you still need the change, ask again.";
|
|
233
|
+
readonly "pendingWrite.expiredAria": "Expired change request";
|
|
234
|
+
readonly "pendingWrite.expiredTitle": "This request can no longer be approved";
|
|
228
235
|
readonly "pendingWrite.noValues": "No field values were included with this request.";
|
|
229
236
|
readonly "pendingWrite.subtitle": "The assistant asked to make this change and was stopped. Approve it, or say what to change.";
|
|
230
237
|
readonly "pendingWrite.subtitleReply": "The assistant asked to make this change and was stopped. Reply to approve or decline.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nManifest.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/i18nManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAU1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"i18nManifest.d.ts","sourceRoot":"","sources":["../../../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C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9C,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiCzB"}
|
|
@@ -117,9 +117,16 @@ var u = {
|
|
|
117
117
|
"overlay.launcherTitle": "AI Assistant ({{shortcut}})",
|
|
118
118
|
"panel.ariaLabel": "AI Assistant",
|
|
119
119
|
"pendingWrite.approve": "Approve this change",
|
|
120
|
+
"pendingWrite.approved": "The assistant's next reply says whether it was carried out.",
|
|
121
|
+
"pendingWrite.approvedAria": "Approved change request",
|
|
122
|
+
"pendingWrite.approvedNotSent": "The assistant was not told to go ahead with it. If you still want this change, ask for it again.",
|
|
120
123
|
"pendingWrite.approvedPrompt": "I approved that change — go ahead.",
|
|
124
|
+
"pendingWrite.approvedTitle": "You approved this change",
|
|
121
125
|
"pendingWrite.approving": "Approving…",
|
|
122
126
|
"pendingWrite.aria": "Change awaiting your approval",
|
|
127
|
+
"pendingWrite.expired": "It stays here as a record of what was asked. If you still need the change, ask again.",
|
|
128
|
+
"pendingWrite.expiredAria": "Expired change request",
|
|
129
|
+
"pendingWrite.expiredTitle": "This request can no longer be approved",
|
|
123
130
|
"pendingWrite.noValues": "No field values were included with this request.",
|
|
124
131
|
"pendingWrite.subtitle": "The assistant asked to make this change and was stopped. Approve it, or say what to change.",
|
|
125
132
|
"pendingWrite.subtitleReply": "The assistant asked to make this change and was stopped. Reply to approve or decline.",
|
|
@@ -58,7 +58,9 @@ export * from './voice/assistantPollSchedule';
|
|
|
58
58
|
export * from './voice/captionText';
|
|
59
59
|
export * from './voice/languagePair';
|
|
60
60
|
export * from './voice/languages';
|
|
61
|
+
export * from './voice/voiceReopen';
|
|
61
62
|
export * from './pendingWrite';
|
|
63
|
+
export * from './liveTurns';
|
|
62
64
|
export * from './images';
|
|
63
65
|
export * from './operations';
|
|
64
66
|
export * from './capabilities';
|
|
@@ -77,6 +79,7 @@ export * from './voice/speechPlayback';
|
|
|
77
79
|
export * from './conversation';
|
|
78
80
|
export * from './attachments';
|
|
79
81
|
export * from './store';
|
|
82
|
+
export * from './guardedStorage';
|
|
80
83
|
export * from './turnState';
|
|
81
84
|
export * from './stageCopy';
|
|
82
85
|
export * from './legacyFiller';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAGxB,cAAc,wBAAwB,CAAC;AAKvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAG9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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iCAAiC,CAAC;AAGhD,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Message } from './conversation';
|
|
2
|
+
/** Record that the reply `messageId` belongs to a turn this page load started. */
|
|
3
|
+
export declare function markLiveTurn(messageId: string): void;
|
|
4
|
+
/** Did this page load start the turn whose reply is `messageId`? */
|
|
5
|
+
export declare function isLiveTurn(messageId: string): boolean;
|
|
6
|
+
/** An approval the page is recording with the sandbox right now. */
|
|
7
|
+
export interface ApprovalInFlight {
|
|
8
|
+
/** The conversation whose card was approved. */
|
|
9
|
+
conversationId: string;
|
|
10
|
+
/** The pending write's reference, as the card holds it. */
|
|
11
|
+
reference: string;
|
|
12
|
+
}
|
|
13
|
+
/** The approval being recorded right now, or null. */
|
|
14
|
+
export declare function getApprovalInFlight(): ApprovalInFlight | null;
|
|
15
|
+
/** Be told when an approval is taken or let go — for `useSyncExternalStore`. */
|
|
16
|
+
export declare function subscribeApprovalInFlight(listener: () => void): () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Take the page's one approval slot. False when another approval holds it — a
|
|
19
|
+
* second press, from this panel or one opened since, is the same press.
|
|
20
|
+
*/
|
|
21
|
+
export declare function beginApprovalInFlight(approval: ApprovalInFlight): boolean;
|
|
22
|
+
/** Let the slot go — only by the approval that holds it. */
|
|
23
|
+
export declare function endApprovalInFlight(approval: ApprovalInFlight): void;
|
|
24
|
+
/**
|
|
25
|
+
* How long a pending write stays approvable.
|
|
26
|
+
*
|
|
27
|
+
* ★ Mirrors the sandbox's own confirmation lifetime (15 minutes,
|
|
28
|
+
* `CONFIRMATION_TTL_MS` in ai-assistant's `write-confirmation.ts`), which runs
|
|
29
|
+
* from the moment its entry was CREATED. The sandbox does not start a new entry
|
|
30
|
+
* when the same write is refused again while the first is still fresh: it
|
|
31
|
+
* re-uses that entry and keeps its creation time. So the window is measured
|
|
32
|
+
* from the reply that started the entry (`pendingWriteRaisedAtMs`), not from
|
|
33
|
+
* the newest reply carrying the reference — measured from the newest, a
|
|
34
|
+
* request asked again ten minutes later kept its button for up to ten minutes
|
|
35
|
+
* after the sandbox had begun refusing it.
|
|
36
|
+
*
|
|
37
|
+
* ★ An APPROVED entry ends there. The sandbox tries the person's approval
|
|
38
|
+
* first on every attempt at that write (`consumeWriteApproval`), and spends
|
|
39
|
+
* it: the entry is deleted and the write goes through. So the same write
|
|
40
|
+
* refused again after an approval was refused with NO entry left, and started
|
|
41
|
+
* a new one — counted from the approved card instead, a request asked again
|
|
42
|
+
* after its change was made lost its button up to fifteen minutes early.
|
|
43
|
+
*
|
|
44
|
+
* ★ Each reply's time is its placeholder's, taken BEFORE the sandbox records
|
|
45
|
+
* the refusal, so on this conversation's evidence the window closes first. What
|
|
46
|
+
* it cannot see is the same write refused earlier in ANOTHER conversation on
|
|
47
|
+
* the same sandbox, which the sandbox counts as the same entry; there the
|
|
48
|
+
* sandbox can refuse first. That fails closed: nothing is approved, and the
|
|
49
|
+
* thread says so with the sandbox's own refusal, which names the expiry.
|
|
50
|
+
*/
|
|
51
|
+
export declare const PENDING_WRITE_APPROVAL_WINDOW_MS: number;
|
|
52
|
+
/**
|
|
53
|
+
* The replies that answer the panel's own "go ahead" after an approval — turns
|
|
54
|
+
* that offer no Retry.
|
|
55
|
+
*
|
|
56
|
+
* ★★ There is nothing a Retry there could honestly re-run. Re-sending the "go
|
|
57
|
+
* ahead" would tell a new turn an approval was fresh that may already be spent;
|
|
58
|
+
* re-asking the person's original request — what Retry used to fall back to —
|
|
59
|
+
* asks for a change the approved turn may already have made, and without the
|
|
60
|
+
* files that request carried. If the change is still wanted, the person asks,
|
|
61
|
+
* and a new request gets a new card.
|
|
62
|
+
*/
|
|
63
|
+
export declare function approvalFollowUpReplyIds(messages: readonly Message[]): ReadonlySet<string>;
|
|
64
|
+
/**
|
|
65
|
+
* The replies whose pending write the person APPROVED.
|
|
66
|
+
*
|
|
67
|
+
* ★★ Their cards say so — never "expired", which would tell someone whose
|
|
68
|
+
* change was carried out that nothing had changed, and invite them to ask for
|
|
69
|
+
* the same change again.
|
|
70
|
+
*
|
|
71
|
+
* ★★ Only from the stamp written when the approval LANDED
|
|
72
|
+
* (`pendingWriteApprovedAt`) — never guessed from where a "go ahead" sits in
|
|
73
|
+
* the thread. That guess read the card just before a go-ahead as the approved
|
|
74
|
+
* one, and when another request had come between the click and the go-ahead,
|
|
75
|
+
* a card the person never approved read "You approved this change", on every
|
|
76
|
+
* reopen.
|
|
77
|
+
*/
|
|
78
|
+
export declare function approvedPendingWriteIds(messages: readonly Message[]): ReadonlySet<string>;
|
|
79
|
+
/**
|
|
80
|
+
* The approved replies whose "go ahead" the panel actually SENT — named by the
|
|
81
|
+
* go-ahead itself (`approvedReplyId`), never inferred from its position.
|
|
82
|
+
*
|
|
83
|
+
* ★ An approval can land and its go-ahead not be sent: the person opened
|
|
84
|
+
* another conversation, or the mode, session or sandbox changed while the call
|
|
85
|
+
* was out. Such a card must not promise that "the assistant's next reply says
|
|
86
|
+
* whether it was carried out" — nothing asked it to.
|
|
87
|
+
*/
|
|
88
|
+
export declare function goAheadSentReplyIds(messages: readonly Message[]): ReadonlySet<string>;
|
|
89
|
+
/**
|
|
90
|
+
* The id of the newest reply the MODEL wrote, or null — what a go-ahead must
|
|
91
|
+
* still be answering when it is sent (see `handleApprovePendingWrite`).
|
|
92
|
+
*/
|
|
93
|
+
export declare function newestModelReplyId(messages: readonly Message[]): string | null;
|
|
94
|
+
/**
|
|
95
|
+
* The reply whose turn Retry may re-run, or null.
|
|
96
|
+
*
|
|
97
|
+
* The newest model reply — a turn can settle with an apology (a gateway 403 the
|
|
98
|
+
* model reports as text) without ever failing, and the person still needs a
|
|
99
|
+
* one-click re-run — but only while its turn ran in this page load. A reply
|
|
100
|
+
* reopened from history offers no Retry: re-sending would put an old prompt to
|
|
101
|
+
* a new session, in whatever state the data is in now. Nor does the answer to
|
|
102
|
+
* an approval's "go ahead" (`approvalFollowUpReplyIds`).
|
|
103
|
+
*
|
|
104
|
+
* `messages` is the TYPED thread; Retry is a chat-panel affordance.
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolveRetryableMessageId(messages: readonly Message[], isLive?: (messageId: string) => boolean): string | null;
|
|
107
|
+
/** The one pending write that may be approved right now. */
|
|
108
|
+
export interface ApprovablePendingWrite {
|
|
109
|
+
messageId: string;
|
|
110
|
+
reference: string;
|
|
111
|
+
/** When it stops being approvable — so a caller can re-render on time. */
|
|
112
|
+
expiresAtMs: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The single pending write whose Approve button may be live, or null.
|
|
116
|
+
*
|
|
117
|
+
* ★★ Every condition is necessary, and each closes a way an old card could
|
|
118
|
+
* still authorise a change:
|
|
119
|
+
*
|
|
120
|
+
* - The NEWEST model reply only. Once the conversation has moved past a
|
|
121
|
+
* request, approving it would hand the model an approval for something it is
|
|
122
|
+
* no longer talking about.
|
|
123
|
+
* - Not approved already: an approval is given once (`pendingWriteApprovedAt`).
|
|
124
|
+
* - Its turn ran in this page load (`isLive`) — see `markLiveTurn`.
|
|
125
|
+
* - The same backend SESSION the conversation holds now, and the same SANDBOX
|
|
126
|
+
* the active mode holds now. The reference lives in that sandbox and is spent
|
|
127
|
+
* in that session; after either was replaced it names nothing, or names
|
|
128
|
+
* something the person never saw.
|
|
129
|
+
* - Inside `PENDING_WRITE_APPROVAL_WINDOW_MS` of the sandbox entry it names.
|
|
130
|
+
*
|
|
131
|
+
* A reply without a reference (an older sandbox image) is never approvable;
|
|
132
|
+
* its card has never had a button.
|
|
133
|
+
*
|
|
134
|
+
* `messages` is the TYPED thread: spoken turns never carry a pending write,
|
|
135
|
+
* because voice is offered only in modes known not to write.
|
|
136
|
+
*/
|
|
137
|
+
export declare function resolveApprovablePendingWrite(messages: readonly Message[], live: {
|
|
138
|
+
/** The active conversation's backend session. */
|
|
139
|
+
sessionId: string | null | undefined;
|
|
140
|
+
/** The sandbox the active mode holds. */
|
|
141
|
+
sandboxId: string | null | undefined;
|
|
142
|
+
nowMs: number;
|
|
143
|
+
isLive?: (messageId: string) => boolean;
|
|
144
|
+
}): ApprovablePendingWrite | null;
|
|
145
|
+
//# sourceMappingURL=liveTurns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveTurns.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/liveTurns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA0B9C,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAwBD,sDAAsD;AACtD,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAE7D;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAK1E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAKzE;AAED,4DAA4D;AAC5D,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAIpE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,gCAAgC,QAAiB,CAAC;AAoB/D;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,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t) {
|
|
4
|
+
e.add(t);
|
|
5
|
+
}
|
|
6
|
+
function n(t) {
|
|
7
|
+
return e.has(t);
|
|
8
|
+
}
|
|
9
|
+
var r = null, i = /* @__PURE__ */ new Set();
|
|
10
|
+
function a() {
|
|
11
|
+
return r;
|
|
12
|
+
}
|
|
13
|
+
function o(e) {
|
|
14
|
+
return i.add(e), () => {
|
|
15
|
+
i.delete(e);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function s(e) {
|
|
19
|
+
if (r !== null) return !1;
|
|
20
|
+
r = e;
|
|
21
|
+
for (let e of i) e();
|
|
22
|
+
return !0;
|
|
23
|
+
}
|
|
24
|
+
function c(e) {
|
|
25
|
+
if (r === e) {
|
|
26
|
+
r = null;
|
|
27
|
+
for (let e of i) e();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
var l = 900 * 1e3;
|
|
31
|
+
function u(e) {
|
|
32
|
+
return e.role !== "system" && !e.metadata?.localAction;
|
|
33
|
+
}
|
|
34
|
+
function d(e) {
|
|
35
|
+
for (let t = e.length - 1; t >= 0; --t) {
|
|
36
|
+
let n = e[t];
|
|
37
|
+
if (n.role === "assistant" && !n.metadata?.localAction) return n;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function f(e) {
|
|
42
|
+
let t = /* @__PURE__ */ new Set(), n = null;
|
|
43
|
+
for (let r of e) u(r) && (r.role === "user" ? n = r : n?.metadata?.approvalFollowUp && t.add(r.id));
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
function p(e) {
|
|
47
|
+
let t = /* @__PURE__ */ new Set();
|
|
48
|
+
for (let n of e) n.role === "assistant" && n.metadata?.pendingWrite && n.metadata.pendingWriteApprovedAt && t.add(n.id);
|
|
49
|
+
return t;
|
|
50
|
+
}
|
|
51
|
+
function m(e) {
|
|
52
|
+
let t = /* @__PURE__ */ new Set();
|
|
53
|
+
for (let n of e) {
|
|
54
|
+
let e = n.metadata?.approvedReplyId;
|
|
55
|
+
n.role === "user" && n.metadata?.approvalFollowUp && typeof e == "string" && t.add(e);
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
59
|
+
function h(e) {
|
|
60
|
+
return d(e)?.id ?? null;
|
|
61
|
+
}
|
|
62
|
+
function g(e, t = n) {
|
|
63
|
+
let r = d(e);
|
|
64
|
+
return !r || !t(r.id) || f(e).has(r.id) ? null : r.id;
|
|
65
|
+
}
|
|
66
|
+
function _(e, t, n) {
|
|
67
|
+
let r = Date.parse(t.timestamp);
|
|
68
|
+
if (!Number.isFinite(r)) return NaN;
|
|
69
|
+
let i = t.metadata?.sandboxId, a = null;
|
|
70
|
+
for (let o of e) {
|
|
71
|
+
if (o.role !== "assistant" || o.metadata?.pendingWrite?.reference !== n) continue;
|
|
72
|
+
let e = o.metadata?.sandboxId;
|
|
73
|
+
if (e && e !== i) continue;
|
|
74
|
+
let s = Date.parse(o.timestamp);
|
|
75
|
+
if (!(!Number.isFinite(s) || s > r)) {
|
|
76
|
+
if ((a === null || s - a >= 9e5) && (a = s), o === t) break;
|
|
77
|
+
o.metadata?.pendingWriteApprovedAt && (a = null);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return a ?? r;
|
|
81
|
+
}
|
|
82
|
+
function v(e, t) {
|
|
83
|
+
let r = d(e), i = r?.metadata?.pendingWrite?.reference;
|
|
84
|
+
if (!r || !i || r.metadata?.pendingWriteApprovedAt || !(t.isLive ?? n)(r.id)) return null;
|
|
85
|
+
let a = r.metadata?.sessionId;
|
|
86
|
+
if (!a || a !== t.sessionId) return null;
|
|
87
|
+
let o = r.metadata?.sandboxId;
|
|
88
|
+
if (!o || o !== t.sandboxId) return null;
|
|
89
|
+
let s = _(e, r, i);
|
|
90
|
+
if (!Number.isFinite(s)) return null;
|
|
91
|
+
let c = s + l;
|
|
92
|
+
return t.nowMs >= c ? null : {
|
|
93
|
+
messageId: r.id,
|
|
94
|
+
reference: i,
|
|
95
|
+
expiresAtMs: c
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { l as PENDING_WRITE_APPROVAL_WINDOW_MS, f as approvalFollowUpReplyIds, p as approvedPendingWriteIds, s as beginApprovalInFlight, c as endApprovalInFlight, a as getApprovalInFlight, m as goAheadSentReplyIds, n as isLiveTurn, t as markLiveTurn, h as newestModelReplyId, v as resolveApprovablePendingWrite, g as resolveRetryableMessageId, o as subscribeApprovalInFlight };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,OAAO,EACR,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,OAAO,EACR,MAAM,gBAAgB,CAAC;AAKxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,UAAU,cAAc;IACtB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;;;;;OAUG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;IAC5E,oBAAoB,EAAE,OAAO,CAAC;IAC9B,+CAA+C;IAC/C,eAAe,E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ITE_CONSENT_KEY as t, restoreAcknowledgedWriteModes as n, withWriteModeAcknowledged as r } from "./writeModeConsent.js";
|
|
4
4
|
import { restoreAutoRouting as i } from "./autoRouting.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createGuardedAssistantStorage as a } from "./guardedStorage.js";
|
|
6
|
+
import { create as o } from "zustand";
|
|
7
|
+
import { persist as s } from "zustand/middleware";
|
|
7
8
|
//#region src/shared/assistant/store.ts
|
|
8
|
-
function
|
|
9
|
+
function c() {
|
|
9
10
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
+
function l(e) {
|
|
12
13
|
let t = e.sandboxesByMode[e.mode]?.sandboxId;
|
|
13
14
|
return t ? {
|
|
14
15
|
sandboxId: t,
|
|
15
16
|
mode: e.mode
|
|
16
17
|
} : null;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function u(e, r) {
|
|
19
20
|
let a = typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {};
|
|
20
21
|
return {
|
|
21
22
|
...r,
|
|
@@ -24,7 +25,7 @@ function l(e, r) {
|
|
|
24
25
|
autoRouting: i(e)
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
var
|
|
28
|
+
var d = o()(s((e, t) => ({
|
|
28
29
|
conversations: [],
|
|
29
30
|
activeConversationId: null,
|
|
30
31
|
mode: "assistant",
|
|
@@ -39,7 +40,7 @@ var u = a()(o((e, t) => ({
|
|
|
39
40
|
replyLanguage: null,
|
|
40
41
|
preferredVoices: {},
|
|
41
42
|
createConversation: (n, r, i) => {
|
|
42
|
-
let a =
|
|
43
|
+
let a = c(), o = (/* @__PURE__ */ new Date()).toISOString(), s = r === void 0 && t().autoRouting, l = i?.routedBy ?? (s ? "auto" : void 0), u = r ?? (s ? "assistant" : t().mode), d = {
|
|
43
44
|
id: a,
|
|
44
45
|
title: n || "New conversation",
|
|
45
46
|
mode: u,
|
|
@@ -243,7 +244,7 @@ var u = a()(o((e, t) => ({
|
|
|
243
244
|
})
|
|
244
245
|
}), {
|
|
245
246
|
name: "hb-ai-assistant",
|
|
246
|
-
storage: e(),
|
|
247
|
+
storage: a(e()),
|
|
247
248
|
partialize: (e) => ({
|
|
248
249
|
conversations: e.conversations.map(({ ...e }) => e),
|
|
249
250
|
activeConversationId: e.activeConversationId,
|
|
@@ -256,7 +257,7 @@ var u = a()(o((e, t) => ({
|
|
|
256
257
|
replyLanguage: e.replyLanguage,
|
|
257
258
|
preferredVoices: e.preferredVoices
|
|
258
259
|
}),
|
|
259
|
-
merge:
|
|
260
|
+
merge: u
|
|
260
261
|
}));
|
|
261
262
|
//#endregion
|
|
262
|
-
export {
|
|
263
|
+
export { u as mergePersistedAssistantState, l as resolveActiveModeSandbox, d as useAssistantStore };
|
|
@@ -47,6 +47,13 @@ export declare function isTurnInFlight(status: AssistantConversationStatus | und
|
|
|
47
47
|
* own — otherwise it would strand the very answer the user is now waiting for.
|
|
48
48
|
* When nothing replaced it, clearing is what stops the composer sitting
|
|
49
49
|
* disabled forever behind a turn that will never complete.
|
|
50
|
+
*
|
|
51
|
+
* ★★ A DELETED conversation abandons its turn too (BOFF-7335). Nothing else
|
|
52
|
+
* stopped the runtime: the poll loop ran on after the person deleted the
|
|
53
|
+
* conversation, its `'complete'` or error write landed on an id that no longer
|
|
54
|
+
* existed, and a correction parked behind it was replayed into whichever
|
|
55
|
+
* conversation had opened in its place. A conversation that is gone has no
|
|
56
|
+
* newer turn to protect, so the entry is always released.
|
|
50
57
|
*/
|
|
51
58
|
export declare function planAbandonedTurn(args: {
|
|
52
59
|
/** The message id this runtime is driving. */
|
|
@@ -55,6 +62,11 @@ export declare function planAbandonedTurn(args: {
|
|
|
55
62
|
abortRequested: boolean;
|
|
56
63
|
/** The turn the shared processing entry currently describes. */
|
|
57
64
|
activeTurnId: string | null | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The conversation this turn writes into is still in the store. Required,
|
|
67
|
+
* so no call site can leave the delete case out.
|
|
68
|
+
*/
|
|
69
|
+
conversationExists: boolean;
|
|
58
70
|
}): {
|
|
59
71
|
abandon: boolean;
|
|
60
72
|
clearProcessing: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turnState.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,2BAA2B,GAAG,SAAS,GAC9C,OAAO,CAMT;AAED
|
|
1
|
+
{"version":3,"file":"turnState.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,2BAA2B,GAAG,SAAS,GAC9C,OAAO,CAMT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,cAAc,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAIjD;AAED,kFAAkF;AAClF,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,iBAAiB,GACjB,YAAY,GACZ,mBAAmB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,iEAAiE;IACjE,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAkB7C"}
|
|
@@ -3,12 +3,15 @@ function e(e) {
|
|
|
3
3
|
return e === "provisioning" || e === "connecting" || e === "streaming";
|
|
4
4
|
}
|
|
5
5
|
function t(e) {
|
|
6
|
-
return e.abortRequested ? {
|
|
6
|
+
return e.conversationExists ? e.abortRequested ? {
|
|
7
7
|
abandon: !0,
|
|
8
8
|
clearProcessing: e.activeTurnId === e.turnId
|
|
9
9
|
} : {
|
|
10
10
|
abandon: !1,
|
|
11
11
|
clearProcessing: !1
|
|
12
|
+
} : {
|
|
13
|
+
abandon: !0,
|
|
14
|
+
clearProcessing: !0
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
17
|
function n(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AA4Jf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAkGvE;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAgqHxD,CAAC"}
|