@burdenoff/fe-libs 2026.930.5 → 2026.1001.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connections/api.d.ts.map +1 -1
- package/dist/connections/api.js +4 -3
- package/dist/connections/oauthPopup.d.ts.map +1 -1
- package/dist/connections/oauthPopup.js +8 -9
- package/dist/shared/assistant/conversation.d.ts +5 -1
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyApi.d.ts +25 -9
- package/dist/shared/assistant/history/historyApi.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyApi.js +220 -75
- package/dist/shared/assistant/history/historyControls.d.ts +86 -0
- package/dist/shared/assistant/history/historyControls.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyControls.js +80 -0
- package/dist/shared/assistant/history/historyEngine.d.ts +23 -3
- package/dist/shared/assistant/history/historyEngine.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyEngine.js +578 -369
- package/dist/shared/assistant/history/historyErrors.d.ts +25 -5
- package/dist/shared/assistant/history/historyErrors.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyErrors.js +39 -30
- package/dist/shared/assistant/history/historyList.d.ts +33 -7
- package/dist/shared/assistant/history/historyList.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyList.js +72 -51
- package/dist/shared/assistant/history/historyOperations.d.ts +36 -7
- package/dist/shared/assistant/history/historyOperations.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyOperations.js +100 -25
- package/dist/shared/assistant/history/historyStatus.d.ts +27 -1
- package/dist/shared/assistant/history/historyStatus.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyStatus.js +6 -2
- package/dist/shared/assistant/history/historyStore.d.ts +29 -7
- package/dist/shared/assistant/history/historyStore.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyStore.js +172 -103
- package/dist/shared/assistant/history/historyTransportErrors.d.ts +28 -0
- package/dist/shared/assistant/history/historyTransportErrors.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyTransportErrors.js +16 -0
- package/dist/shared/assistant/history/historyTypes.d.ts +80 -1
- package/dist/shared/assistant/history/historyTypes.d.ts.map +1 -1
- package/dist/shared/assistant/history/stampRegistry.d.ts +19 -1
- package/dist/shared/assistant/history/stampRegistry.d.ts.map +1 -1
- package/dist/shared/assistant/history/stampRegistry.js +13 -1
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/store.d.ts +8 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +50 -46
- package/dist/shared-assistant.js +164 -162
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/connections/api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAO,KAAK,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAG3E,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACb,MAAM,SAAS,CAAC;AAwKjB,4CAA4C;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,C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C,YAAY,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAoCD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAGlE;AAOD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAgBhE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAqB5D;AA4BD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,qBAA0B,GAClC,cAAc,CA0IhB"}
|
package/dist/connections/api.js
CHANGED
|
@@ -174,10 +174,11 @@ function E(e) {
|
|
|
174
174
|
return e.data ?? null;
|
|
175
175
|
}
|
|
176
176
|
function D(e, t = {}) {
|
|
177
|
-
let n = async (t, n) => E(await e.query({
|
|
177
|
+
let n = async (t, n, r = {}) => E(await e.query({
|
|
178
178
|
query: t,
|
|
179
179
|
variables: n,
|
|
180
|
-
fetchPolicy: "network-only"
|
|
180
|
+
fetchPolicy: "network-only",
|
|
181
|
+
...r.fresh ? { context: { queryDeduplication: !1 } } : {}
|
|
181
182
|
})), s = async (t, n) => E(await e.mutate({
|
|
182
183
|
mutation: t,
|
|
183
184
|
variables: n
|
|
@@ -212,7 +213,7 @@ function D(e, t = {}) {
|
|
|
212
213
|
return T((await s(d, { input: e }))?.authenticateWithServiceAccount);
|
|
213
214
|
},
|
|
214
215
|
async getConnection(e) {
|
|
215
|
-
return T((await n(f, { id: e }))?.getConnection);
|
|
216
|
+
return T((await n(f, { id: e }, { fresh: !0 }))?.getConnection);
|
|
216
217
|
},
|
|
217
218
|
async listVaults() {
|
|
218
219
|
return ((await n(p, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauthPopup.d.ts","sourceRoot":"","sources":["../../src/connections/oauthPopup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,qBAAqB,EAAE,EACtE,YAAY,EACZ,KAAK,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,SAAS,EACT,cAAqB,EACrB,SAAmB,EACnB,WAA2D,GAC5D,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAsGrC"}
|
|
@@ -29,20 +29,19 @@ function i({ connectionId: t, popup: i, fetchConnection: a, onSuccess: o, onErro
|
|
|
29
29
|
}
|
|
30
30
|
}, v = (e) => {
|
|
31
31
|
e ? e.status === "ACTIVE" ? o(e) : s(e.errorMessage || "OAuth authorization failed") : s("Connection not found. It may have been deleted.");
|
|
32
|
-
}, y = async (
|
|
33
|
-
if (f ||
|
|
34
|
-
if (!
|
|
35
|
-
_(() => s(
|
|
32
|
+
}, y = async (n) => {
|
|
33
|
+
if (f || n.connectionId && n.connectionId !== t) return;
|
|
34
|
+
if (!n.success) {
|
|
35
|
+
_(() => s(n.error || "OAuth authorization failed"));
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
let
|
|
38
|
+
let r;
|
|
39
39
|
try {
|
|
40
|
-
|
|
41
|
-
} catch
|
|
42
|
-
_(() => s(e instanceof Error ? e.message : "OAuth authorization failed"));
|
|
40
|
+
r = await a();
|
|
41
|
+
} catch {
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
|
-
_(() => v(
|
|
44
|
+
r && (!r.status || r.status === e) || _(() => v(r));
|
|
46
45
|
};
|
|
47
46
|
function b(e) {
|
|
48
47
|
let t = e.data;
|
|
@@ -302,7 +302,11 @@ export interface ConversationSyncStamp {
|
|
|
302
302
|
hasOlder?: true;
|
|
303
303
|
/** Where "Show earlier messages" continues from. */
|
|
304
304
|
olderCursor?: string;
|
|
305
|
-
/**
|
|
305
|
+
/**
|
|
306
|
+
* Renamed on this device only — before renames were synced, or while server
|
|
307
|
+
* history could not address it — so the server's title never overwrites it
|
|
308
|
+
* here. A rename that IS synced (BOFF-8159) lifts it.
|
|
309
|
+
*/
|
|
306
310
|
titleLocked?: true;
|
|
307
311
|
/** Why the latest turns are not being saved. */
|
|
308
312
|
blocked?: "quota" | "invalid" | "scope";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,cAAc,GACd,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,GAC/E;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,YAAY,EAAE,MAAM,EA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AqB,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,CAAC,EAAE,CAAC,CAAC;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,uGAAuG;IACvG,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACxC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,cAAc,GACd,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,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;;;;;;;;;;;;;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,2FAA2F;IAC3F,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,25 +1,39 @@
|
|
|
1
|
-
import { AssistantHistoryChangePage, AssistantHistoryConvRef, AssistantHistoryDeletePayload, AssistantHistoryEntryPage, AssistantHistoryEntryPaging, AssistantHistoryHeaderPage, AssistantHistorySaveInput, AssistantHistorySavePayload, AssistantHistoryScope } from './historyTypes';
|
|
1
|
+
import { AssistantHistoryChangePage, AssistantHistoryConvRef, AssistantHistoryConversationFilter, AssistantHistoryDeletePayload, AssistantHistoryEntryPage, AssistantHistoryEntryPaging, AssistantHistoryHeaderPage, AssistantHistorySaveInput, AssistantHistorySavePayload, AssistantHistoryScope, AssistantHistoryUpdatePatch, AssistantHistoryUpdatePayload } from './historyTypes';
|
|
2
2
|
export interface AssistantHistoryTransport {
|
|
3
3
|
changes(scope: AssistantHistoryScope, page: {
|
|
4
4
|
first: number;
|
|
5
5
|
after: string | null;
|
|
6
6
|
}): Promise<AssistantHistoryChangePage>;
|
|
7
|
+
/**
|
|
8
|
+
* The live list. With a `filter` it needs the history controls: without
|
|
9
|
+
* them it is refused (`AssistantHistoryControlsUnavailableError`) rather
|
|
10
|
+
* than answered unfiltered.
|
|
11
|
+
*/
|
|
7
12
|
conversations(scope: AssistantHistoryScope, page: {
|
|
8
13
|
first: number;
|
|
9
14
|
after: string | null;
|
|
15
|
+
filter?: AssistantHistoryConversationFilter;
|
|
10
16
|
}): Promise<AssistantHistoryHeaderPage>;
|
|
11
17
|
entries(scope: AssistantHistoryScope, ref: AssistantHistoryConvRef, page: AssistantHistoryEntryPaging): Promise<AssistantHistoryEntryPage>;
|
|
12
18
|
save(scope: AssistantHistoryScope, input: AssistantHistorySaveInput): Promise<AssistantHistorySavePayload>;
|
|
13
19
|
remove(scope: AssistantHistoryScope, ref: AssistantHistoryConvRef): Promise<AssistantHistoryDeletePayload>;
|
|
20
|
+
/** A control change (BOFF-8159). Refused, unsent, while the controls are unavailable. */
|
|
21
|
+
update(scope: AssistantHistoryScope, ref: AssistantHistoryConvRef, patch: AssistantHistoryUpdatePatch): Promise<AssistantHistoryUpdatePayload>;
|
|
22
|
+
/** Whether the server has the history controls, as far as the last answer showed (true until one says not). */
|
|
23
|
+
controlsAvailable(): boolean;
|
|
24
|
+
/** Hear every change of {@link controlsAvailable}. Returns the unsubscribe. */
|
|
25
|
+
onControlsChange(listener: (available: boolean) => void): () => void;
|
|
26
|
+
/** The next feed read tries the controls again, without waiting for the ten-minute recheck. */
|
|
27
|
+
recheckControls(): void;
|
|
14
28
|
}
|
|
15
|
-
/**
|
|
16
|
-
export declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
/** While the controls are unavailable: how often the feed tries the FULL documents again. */
|
|
30
|
+
export declare const ASSISTANT_HISTORY_CONTROLS_RECHECK_MS: number;
|
|
31
|
+
/**
|
|
32
|
+
* Consecutive masked failures of FULL documents ("Unexpected error." from a
|
|
33
|
+
* gateway that hides validation errors) after which a BASE retry that
|
|
34
|
+
* succeeds is read as drift.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ASSISTANT_HISTORY_MASKED_DRIFT_STREAK = 2;
|
|
23
37
|
/** One GraphQL call, as `executeAssistantGraphQLOnce` makes it. Injected in tests. */
|
|
24
38
|
export type AssistantHistoryExecutor = <TData>(params: {
|
|
25
39
|
query: string;
|
|
@@ -33,6 +47,8 @@ export interface GatewayHistoryTransportOptions {
|
|
|
33
47
|
activeWorkspaceId?: () => string;
|
|
34
48
|
/** The signed-in account right now (default: the access token's subject). */
|
|
35
49
|
activeActorId?: () => string | null;
|
|
50
|
+
/** Epoch ms now, for the controls recheck (default: `Date.now`). */
|
|
51
|
+
now?: () => number;
|
|
36
52
|
}
|
|
37
53
|
export declare function createGatewayHistoryTransport(options?: GatewayHistoryTransportOptions): AssistantHistoryTransport;
|
|
38
54
|
//# sourceMappingURL=historyApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historyApi.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historyApi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"historyApi.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historyApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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IAC/E,gBAAgB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrE,+FAA+F;IAC/F,eAAe,IAAI,IAAI,CAAC;CACzB;AAED,6FAA6F;AAC7F,eAAO,MAAM,qCAAqC,QAAc,CAAC;AACjE;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,IAAI,CAAC;AAEvD,sFAAsF;AACtF,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;AAErB,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,MAAM,CAAC;IACjC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpC,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAuBD,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,8BAAmC,GAC3C,yBAAyB,CA6Q3B"}
|
|
@@ -1,116 +1,243 @@
|
|
|
1
1
|
import { executeAssistantGraphQLOnce as e } from "../gatewayClient.js";
|
|
2
2
|
import { getActorId as t, getWorkspaceId as n } from "../context.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { AssistantHistoryControlsUnavailableError as r, AssistantHistoryResponseError as i, AssistantHistoryScopeInactiveError as a } from "./historyTransportErrors.js";
|
|
4
|
+
import { classifyAssistantHistoryError as o, isAssistantHistoryControlsDrift as s } from "./historyErrors.js";
|
|
5
|
+
import { ASSISTANT_HISTORY_CHANGES_OPERATION as c, ASSISTANT_HISTORY_CHANGES_QUERY as l, ASSISTANT_HISTORY_CHANGES_QUERY_BASE as u, ASSISTANT_HISTORY_CONVERSATIONS_OPERATION as d, ASSISTANT_HISTORY_CONVERSATIONS_QUERY as f, ASSISTANT_HISTORY_CONVERSATIONS_QUERY_BASE as p, ASSISTANT_HISTORY_DELETE_MUTATION as m, ASSISTANT_HISTORY_DELETE_MUTATION_BASE as h, ASSISTANT_HISTORY_DELETE_OPERATION as g, ASSISTANT_HISTORY_ENTRIES_OPERATION as _, ASSISTANT_HISTORY_ENTRIES_QUERY as v, ASSISTANT_HISTORY_ENTRIES_QUERY_BASE as y, ASSISTANT_HISTORY_SAVE_MUTATION as b, ASSISTANT_HISTORY_SAVE_MUTATION_BASE as x, ASSISTANT_HISTORY_SAVE_OPERATION as S, ASSISTANT_HISTORY_UPDATE_MUTATION as C, ASSISTANT_HISTORY_UPDATE_OPERATION as w, buildHistoryDeleteVariables as T, buildHistoryEntriesVariables as E, buildHistoryListVariables as D, buildHistoryPageVariables as O, buildHistorySaveVariables as k, buildHistoryUpdateVariables as A } from "./historyOperations.js";
|
|
6
|
+
import { historyTimestampToIso as j } from "./historyTimestamps.js";
|
|
5
7
|
//#region src/shared/assistant/history/historyApi.ts
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
super("Assistant history: the request's workspace or account is not the active one"), this.name = "AssistantHistoryScopeInactiveError";
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function b(e) {
|
|
8
|
+
var M = 10 * 6e4, N = 2;
|
|
9
|
+
function P(e) {
|
|
10
|
+
let t = o(e);
|
|
11
|
+
return t.class === "transient" && t.code !== "RATE_LIMIT_EXCEEDED";
|
|
12
|
+
}
|
|
13
|
+
function F(e) {
|
|
16
14
|
try {
|
|
17
15
|
return e();
|
|
18
16
|
} catch {
|
|
19
17
|
return null;
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
function
|
|
23
|
-
let
|
|
24
|
-
if (
|
|
25
|
-
|
|
20
|
+
function I(o = {}) {
|
|
21
|
+
let j = o.execute ?? ((t) => e(t)), N = o.activeWorkspaceId ?? n, I = o.activeActorId ?? t, B = o.now ?? Date.now, V = !0, H = 0, K = !1, Y = 0, X = /* @__PURE__ */ new Set(), Z = (e) => {
|
|
22
|
+
if (e || (H = B() + M), e !== V) {
|
|
23
|
+
V = e;
|
|
24
|
+
for (let t of [...X]) try {
|
|
25
|
+
t(e);
|
|
26
|
+
} catch {}
|
|
27
|
+
}
|
|
28
|
+
}, Q = async (e, t, n, r) => {
|
|
29
|
+
if (!e.workspaceId || !e.actorId || F(N) !== e.workspaceId || F(I) !== e.actorId) throw new a();
|
|
30
|
+
let o = await j({
|
|
26
31
|
query: n,
|
|
27
32
|
operationName: t,
|
|
28
33
|
variables: r,
|
|
29
34
|
workspaceId: e.workspaceId
|
|
30
35
|
});
|
|
31
|
-
if (!
|
|
32
|
-
return
|
|
36
|
+
if (!U(o)) throw new i(t, "no data");
|
|
37
|
+
return o;
|
|
38
|
+
}, $ = async (e, t, n, i, o = {}) => {
|
|
39
|
+
let { full: c, base: l } = n, u = async () => {
|
|
40
|
+
if (!l) throw new r(t);
|
|
41
|
+
return i(await Q(e, t, l.query, l.variables), !1);
|
|
42
|
+
};
|
|
43
|
+
if (!V) {
|
|
44
|
+
if (!(o.probe === !0 && (K || B() >= H))) return u();
|
|
45
|
+
K = !1, H = B() + M;
|
|
46
|
+
}
|
|
47
|
+
let d;
|
|
48
|
+
try {
|
|
49
|
+
d = await Q(e, t, c.query, c.variables);
|
|
50
|
+
} catch (n) {
|
|
51
|
+
if (n instanceof a) throw n;
|
|
52
|
+
if (s(n)) return Y = 0, Z(!1), u();
|
|
53
|
+
if (l && P(n) && (Y += 1, Y >= 2)) {
|
|
54
|
+
Y = 0;
|
|
55
|
+
let r;
|
|
56
|
+
try {
|
|
57
|
+
r = await Q(e, t, l.query, l.variables);
|
|
58
|
+
} catch {
|
|
59
|
+
throw n;
|
|
60
|
+
}
|
|
61
|
+
return Z(!1), i(r, !1);
|
|
62
|
+
}
|
|
63
|
+
throw n;
|
|
64
|
+
}
|
|
65
|
+
Y = 0;
|
|
66
|
+
let f = i(d, !0);
|
|
67
|
+
return Z(!0), f;
|
|
33
68
|
};
|
|
34
69
|
return {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
|
|
39
|
-
pageInfo: O(a, o.pageInfo),
|
|
40
|
-
resetRequired: a.bool(o.resetRequired, "resetRequired")
|
|
70
|
+
controlsAvailable: () => V,
|
|
71
|
+
onControlsChange(e) {
|
|
72
|
+
return X.add(e), () => {
|
|
73
|
+
X.delete(e);
|
|
41
74
|
};
|
|
42
75
|
},
|
|
76
|
+
recheckControls() {
|
|
77
|
+
V || (K = !0);
|
|
78
|
+
},
|
|
79
|
+
async changes(e, t) {
|
|
80
|
+
let n = O(e, t);
|
|
81
|
+
return $(e, c, {
|
|
82
|
+
full: {
|
|
83
|
+
query: l,
|
|
84
|
+
variables: n
|
|
85
|
+
},
|
|
86
|
+
base: {
|
|
87
|
+
query: u,
|
|
88
|
+
variables: n
|
|
89
|
+
}
|
|
90
|
+
}, (e, t) => {
|
|
91
|
+
let n = W(c), r = n.record(e.myAssistantHistoryChanges, "myAssistantHistoryChanges");
|
|
92
|
+
return {
|
|
93
|
+
nodes: n.list(r.nodes, "nodes").map((e) => q(n, e, t)),
|
|
94
|
+
pageInfo: G(n, r.pageInfo),
|
|
95
|
+
resetRequired: n.bool(r.resetRequired, "resetRequired")
|
|
96
|
+
};
|
|
97
|
+
}, { probe: !0 });
|
|
98
|
+
},
|
|
43
99
|
async conversations(e, t) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
100
|
+
return $(e, d, {
|
|
101
|
+
full: {
|
|
102
|
+
query: f,
|
|
103
|
+
variables: D(e, t)
|
|
104
|
+
},
|
|
105
|
+
base: t.filter ? null : {
|
|
106
|
+
query: p,
|
|
107
|
+
variables: O(e, t)
|
|
108
|
+
}
|
|
109
|
+
}, (e, t) => {
|
|
110
|
+
let n = W(d), r = n.record(e.myAssistantConversations, "myAssistantConversations");
|
|
111
|
+
return {
|
|
112
|
+
nodes: n.list(r.nodes, "nodes").map((e) => q(n, e, t)),
|
|
113
|
+
pageInfo: G(n, r.pageInfo)
|
|
114
|
+
};
|
|
115
|
+
});
|
|
49
116
|
},
|
|
50
117
|
async entries(e, t, n) {
|
|
51
|
-
let r =
|
|
52
|
-
return {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
118
|
+
let r = E(e, t, n);
|
|
119
|
+
return $(e, _, {
|
|
120
|
+
full: {
|
|
121
|
+
query: v,
|
|
122
|
+
variables: r
|
|
123
|
+
},
|
|
124
|
+
base: {
|
|
125
|
+
query: y,
|
|
126
|
+
variables: r
|
|
127
|
+
}
|
|
128
|
+
}, (e, t) => {
|
|
129
|
+
let n = W(_), r = n.record(e.myAssistantConversationEntries, "myAssistantConversationEntries");
|
|
130
|
+
return {
|
|
131
|
+
conversation: q(n, r.conversation, t),
|
|
132
|
+
nodes: n.list(r.nodes, "nodes").map((e) => J(n, e)),
|
|
133
|
+
pageInfo: G(n, r.pageInfo)
|
|
134
|
+
};
|
|
135
|
+
});
|
|
57
136
|
},
|
|
58
137
|
async save(e, t) {
|
|
59
|
-
let n =
|
|
60
|
-
return {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
138
|
+
let n = k(e, t);
|
|
139
|
+
return $(e, S, {
|
|
140
|
+
full: {
|
|
141
|
+
query: b,
|
|
142
|
+
variables: n
|
|
143
|
+
},
|
|
144
|
+
base: {
|
|
145
|
+
query: x,
|
|
146
|
+
variables: n
|
|
147
|
+
}
|
|
148
|
+
}, (e, t) => {
|
|
149
|
+
let n = W(S), r = n.record(e.saveMyAssistantHistoryEntries, "saveMyAssistantHistoryEntries");
|
|
150
|
+
return {
|
|
151
|
+
outcome: n.oneOf(r.outcome, L, "outcome"),
|
|
152
|
+
conversation: q(n, r.conversation, t),
|
|
153
|
+
entries: n.list(r.entries, "entries").map((e) => J(n, e)),
|
|
154
|
+
droppedMetadataKeys: n.list(r.droppedMetadataKeys, "droppedMetadataKeys").map((e) => n.string(e, "droppedMetadataKeys[]"))
|
|
155
|
+
};
|
|
156
|
+
});
|
|
66
157
|
},
|
|
67
158
|
async remove(e, t) {
|
|
68
|
-
let n =
|
|
69
|
-
return {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
159
|
+
let n = T(e, t);
|
|
160
|
+
return $(e, g, {
|
|
161
|
+
full: {
|
|
162
|
+
query: m,
|
|
163
|
+
variables: n
|
|
164
|
+
},
|
|
165
|
+
base: {
|
|
166
|
+
query: h,
|
|
167
|
+
variables: n
|
|
168
|
+
}
|
|
169
|
+
}, (e, t) => {
|
|
170
|
+
let n = W(g), r = n.record(e.deleteMyAssistantConversation, "deleteMyAssistantConversation");
|
|
171
|
+
return {
|
|
172
|
+
outcome: n.oneOf(r.outcome, R, "outcome"),
|
|
173
|
+
conversation: r.conversation == null ? null : q(n, r.conversation, t)
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
async update(e, t, n) {
|
|
178
|
+
return $(e, w, {
|
|
179
|
+
full: {
|
|
180
|
+
query: C,
|
|
181
|
+
variables: A(e, t, n)
|
|
182
|
+
},
|
|
183
|
+
base: null
|
|
184
|
+
}, (e) => {
|
|
185
|
+
let t = W(w), n = t.record(e.updateMyAssistantConversation, "updateMyAssistantConversation");
|
|
186
|
+
return {
|
|
187
|
+
outcome: t.oneOf(n.outcome, z, "outcome"),
|
|
188
|
+
conversation: q(t, n.conversation, !0)
|
|
189
|
+
};
|
|
190
|
+
});
|
|
73
191
|
}
|
|
74
192
|
};
|
|
75
193
|
}
|
|
76
|
-
var
|
|
194
|
+
var L = [
|
|
77
195
|
"APPLIED",
|
|
78
196
|
"ALREADY_APPLIED",
|
|
79
197
|
"CONVERSATION_DELETED"
|
|
80
|
-
],
|
|
198
|
+
], R = [
|
|
81
199
|
"DELETED",
|
|
82
200
|
"ALREADY_DELETED",
|
|
83
201
|
"TOMBSTONED_UNSEEN",
|
|
84
202
|
"NOT_PRESENT"
|
|
85
|
-
],
|
|
203
|
+
], z = [
|
|
204
|
+
"APPLIED",
|
|
205
|
+
"ALREADY_APPLIED",
|
|
206
|
+
"CONVERSATION_DELETED",
|
|
207
|
+
"PIN_LIMIT_REACHED"
|
|
208
|
+
], B = [
|
|
209
|
+
"CHAT",
|
|
210
|
+
"VOICE",
|
|
211
|
+
"MIXED"
|
|
212
|
+
], V = [
|
|
86
213
|
"USER",
|
|
87
214
|
"ASSISTANT",
|
|
88
215
|
"NOTE"
|
|
89
|
-
],
|
|
216
|
+
], H = [
|
|
90
217
|
"TURN",
|
|
91
218
|
"LOCAL_COMMAND",
|
|
92
219
|
"NOTE"
|
|
93
220
|
];
|
|
94
|
-
function
|
|
221
|
+
function U(e) {
|
|
95
222
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
96
223
|
}
|
|
97
|
-
function
|
|
224
|
+
function W(e) {
|
|
98
225
|
let t = (t) => {
|
|
99
|
-
throw new
|
|
226
|
+
throw new i(e, t);
|
|
100
227
|
};
|
|
101
228
|
return {
|
|
102
|
-
record: (e, n) =>
|
|
229
|
+
record: (e, n) => U(e) ? e : t(n),
|
|
103
230
|
list: (e, n) => Array.isArray(e) ? e : t(n),
|
|
104
231
|
string: (e, n) => typeof e == "string" ? e : t(n),
|
|
105
232
|
optionalString: (e, n) => e == null ? null : typeof e == "string" ? e : t(n),
|
|
106
233
|
int: (e, n) => typeof e == "number" && Number.isSafeInteger(e) ? e : t(n),
|
|
107
234
|
optionalInt: (e, n) => e == null ? null : typeof e == "number" && Number.isSafeInteger(e) ? e : t(n),
|
|
108
235
|
bool: (e, n) => typeof e == "boolean" ? e : t(n),
|
|
109
|
-
time: (e, n) =>
|
|
236
|
+
time: (e, n) => j(e) ?? t(n),
|
|
110
237
|
oneOf: (e, n, r) => n.find((t) => t === e) ?? t(r)
|
|
111
238
|
};
|
|
112
239
|
}
|
|
113
|
-
function
|
|
240
|
+
function G(e, t) {
|
|
114
241
|
let n = e.record(t, "pageInfo");
|
|
115
242
|
return {
|
|
116
243
|
hasNextPage: e.bool(n.hasNextPage, "pageInfo.hasNextPage"),
|
|
@@ -119,35 +246,53 @@ function O(e, t) {
|
|
|
119
246
|
endCursor: e.optionalString(n.endCursor, "pageInfo.endCursor")
|
|
120
247
|
};
|
|
121
248
|
}
|
|
122
|
-
function
|
|
123
|
-
let
|
|
249
|
+
function K(e) {
|
|
250
|
+
let t = {};
|
|
251
|
+
for (let n of ["pinnedAt", "archivedAt"]) {
|
|
252
|
+
let r = e[n];
|
|
253
|
+
if (r === null) t[n] = null;
|
|
254
|
+
else {
|
|
255
|
+
let e = j(r);
|
|
256
|
+
e !== null && (t[n] = e);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (e.channel === null) t.channel = null;
|
|
260
|
+
else {
|
|
261
|
+
let n = B.find((t) => t === e.channel);
|
|
262
|
+
n && (t.channel = n);
|
|
263
|
+
}
|
|
264
|
+
return t;
|
|
265
|
+
}
|
|
266
|
+
function q(e, t, n) {
|
|
267
|
+
let r = e.record(t, "conversation");
|
|
124
268
|
return {
|
|
125
|
-
id: e.string(
|
|
126
|
-
clientConversationId: e.optionalString(
|
|
127
|
-
productId: e.string(
|
|
128
|
-
title: e.optionalString(
|
|
129
|
-
legacy: e.bool(
|
|
130
|
-
revision: e.int(
|
|
131
|
-
lastMessageSeq: e.int(
|
|
132
|
-
deleted: e.bool(
|
|
133
|
-
deletedAt:
|
|
134
|
-
createdAt: e.time(
|
|
135
|
-
updatedAt: e.time(
|
|
269
|
+
id: e.string(r.id, "conversation.id"),
|
|
270
|
+
clientConversationId: e.optionalString(r.clientConversationId, "conversation.clientConversationId"),
|
|
271
|
+
productId: e.string(r.productId, "conversation.productId"),
|
|
272
|
+
title: e.optionalString(r.title, "conversation.title"),
|
|
273
|
+
legacy: e.bool(r.legacy, "conversation.legacy"),
|
|
274
|
+
revision: e.int(r.revision, "conversation.revision"),
|
|
275
|
+
lastMessageSeq: e.int(r.lastMessageSeq, "conversation.lastMessageSeq"),
|
|
276
|
+
deleted: e.bool(r.deleted, "conversation.deleted"),
|
|
277
|
+
deletedAt: r.deletedAt == null ? null : e.time(r.deletedAt, "conversation.deletedAt"),
|
|
278
|
+
createdAt: e.time(r.createdAt, "conversation.createdAt"),
|
|
279
|
+
updatedAt: e.time(r.updatedAt, "conversation.updatedAt"),
|
|
280
|
+
...n ? K(r) : {}
|
|
136
281
|
};
|
|
137
282
|
}
|
|
138
|
-
function
|
|
283
|
+
function J(e, t) {
|
|
139
284
|
let n = e.record(t, "entry");
|
|
140
285
|
return {
|
|
141
286
|
id: e.string(n.id, "entry.id"),
|
|
142
287
|
clientMessageId: e.optionalString(n.clientMessageId, "entry.clientMessageId"),
|
|
143
|
-
kind:
|
|
144
|
-
role: e.oneOf(n.role,
|
|
288
|
+
kind: H.find((e) => e === n.kind) ?? null,
|
|
289
|
+
role: e.oneOf(n.role, V, "entry.role"),
|
|
145
290
|
content: e.string(n.content, "entry.content"),
|
|
146
291
|
seq: e.optionalInt(n.seq, "entry.seq"),
|
|
147
292
|
createdAt: e.time(n.createdAt, "entry.createdAt"),
|
|
148
293
|
clientCreatedAt: e.optionalString(n.clientCreatedAt, "entry.clientCreatedAt"),
|
|
149
|
-
metadata:
|
|
294
|
+
metadata: U(n.metadata) ? n.metadata : null
|
|
150
295
|
};
|
|
151
296
|
}
|
|
152
297
|
//#endregion
|
|
153
|
-
export {
|
|
298
|
+
export { M as ASSISTANT_HISTORY_CONTROLS_RECHECK_MS, N as ASSISTANT_HISTORY_MASKED_DRIFT_STREAK, I as createGatewayHistoryTransport };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Conversation } from '../conversation';
|
|
2
|
+
import { AssistantHistoryChannel, AssistantHistoryConvKey, AssistantHistoryConversationFilter, AssistantHistoryHeader, AssistantHistoryOutboxItem, AssistantHistoryScopeKey, AssistantHistoryUpdatePatch } from './historyTypes';
|
|
3
|
+
/**
|
|
4
|
+
* The server's cap on pinned conversations per person, workspace and product
|
|
5
|
+
* (wspace-conversations `MAX_PINNED_PER_SCOPE`). The server enforces it
|
|
6
|
+
* (`PIN_LIMIT_REACHED`); here it is only the number the notice names, and the
|
|
7
|
+
* bound on the pinned fetch.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_PINNED = 50;
|
|
10
|
+
/** A title's length on the server, in code points (not UTF-16 units). */
|
|
11
|
+
export declare const HISTORY_TITLE_MAX_CODE_POINTS = 80;
|
|
12
|
+
/** `text` cut to at most `max` code points (never splitting a surrogate pair). */
|
|
13
|
+
export declare function clampToCodePoints(text: string, max: number): string;
|
|
14
|
+
/** How many code points `text` holds. */
|
|
15
|
+
export declare function codePointLength(text: string): number;
|
|
16
|
+
/**
|
|
17
|
+
* A title exactly as the server will store it: what cannot be stored becomes
|
|
18
|
+
* U+FFFD, every run of whitespace one space, trimmed, then at most 80 code
|
|
19
|
+
* points (and trimmed again, so a cut never leaves a trailing space the server
|
|
20
|
+
* would remove). Empty means "no title": the server refuses one.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normaliseHistoryTitle(text: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* One patch from two queued ones, the newer winning field by field — and the
|
|
25
|
+
* pair rule kept: a newer archive drops an older pin, a newer pin drops an
|
|
26
|
+
* older archive (the server refuses both at once, and would apply them in
|
|
27
|
+
* that order anyway).
|
|
28
|
+
*/
|
|
29
|
+
export declare function coalesceUpdatePatch(older: AssistantHistoryUpdatePatch, newer: AssistantHistoryUpdatePatch): AssistantHistoryUpdatePatch;
|
|
30
|
+
/** A patch the server accepts: at least one field, and never pin and archive together. */
|
|
31
|
+
export declare function isValidUpdatePatch(patch: AssistantHistoryUpdatePatch): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Which kinds of person turns this device holds for a conversation, from the
|
|
34
|
+
* voice marker on its USER messages (notes and replies do not count; a local
|
|
35
|
+
* command counts as the person's turn, as on the server). Null with none.
|
|
36
|
+
*/
|
|
37
|
+
export declare function localChannelOf(conversation: Pick<Conversation, "messages">): AssistantHistoryChannel | null;
|
|
38
|
+
/** A queued control change, as the row reads it. */
|
|
39
|
+
export interface AssistantHistoryPendingUpdate {
|
|
40
|
+
patch: AssistantHistoryUpdatePatch;
|
|
41
|
+
/** Epoch ms the person made it. */
|
|
42
|
+
at: number;
|
|
43
|
+
}
|
|
44
|
+
/** The queued control changes of one scope, per conversation, oldest first. */
|
|
45
|
+
export declare function pendingUpdatesByConversation(outbox: readonly AssistantHistoryOutboxItem[], scopeKey: AssistantHistoryScopeKey | null): Record<AssistantHistoryConvKey, AssistantHistoryPendingUpdate[]>;
|
|
46
|
+
/** What one row shows for the controls. */
|
|
47
|
+
export interface AssistantHistoryRowControls {
|
|
48
|
+
/** A queued rename's title; null when none is queued (the row keeps its own). */
|
|
49
|
+
pendingTitle: string | null;
|
|
50
|
+
pinnedAt: string | null;
|
|
51
|
+
archivedAt: string | null;
|
|
52
|
+
channel: AssistantHistoryChannel | null;
|
|
53
|
+
/** The server's control state is known here (a header with the controls, or a queued change). */
|
|
54
|
+
known: boolean;
|
|
55
|
+
/** A control change is queued and not answered yet. */
|
|
56
|
+
pending: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A row's controls. Precedence: the queued changes (oldest to newest), then
|
|
60
|
+
* the header, then this device's conversation.
|
|
61
|
+
*
|
|
62
|
+
* - Pin and archive come from the header (this device keeps no pin or archive
|
|
63
|
+
* of its own); a queued change overrides them, dated by when it was made.
|
|
64
|
+
* - The channel is the UNION of the header's and this device's: the header
|
|
65
|
+
* counts every stored turn, this device may hold a spoken turn the server
|
|
66
|
+
* has not stored yet, or only a window of the older ones.
|
|
67
|
+
* - The title: a queued rename; otherwise the row's own (the engine keeps a
|
|
68
|
+
* held conversation's title in step with the server, and a title renamed on
|
|
69
|
+
* this device before renames were synced — `titleLocked` — stays here).
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveRowControls(conversation: Pick<Conversation, "messages"> | null, header: AssistantHistoryHeader | null, pending?: readonly AssistantHistoryPendingUpdate[]): AssistantHistoryRowControls;
|
|
72
|
+
/** The list's default: every conversation that is not archived. */
|
|
73
|
+
export declare const DEFAULT_HISTORY_LIST_FILTER: Readonly<AssistantHistoryConversationFilter>;
|
|
74
|
+
/**
|
|
75
|
+
* Does a row pass the filter — the server's rule, applied here to what the
|
|
76
|
+
* device holds: CHAT means it holds a typed person turn, VOICE a spoken one,
|
|
77
|
+
* and a MIXED row matches both. A row whose channel is unknown matches only
|
|
78
|
+
* ANY. Archived rows are left out unless asked for.
|
|
79
|
+
*/
|
|
80
|
+
export declare function matchesHistoryFilter(row: Pick<AssistantHistoryRowControls, "pinnedAt" | "archivedAt" | "channel">, filter?: Readonly<AssistantHistoryConversationFilter>): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* A filter as a stable key ("" for none): the list's "Show older" listing is
|
|
83
|
+
* paged per filter, and its `hasMore` answers for one key only.
|
|
84
|
+
*/
|
|
85
|
+
export declare function historyFilterKey(filter: Readonly<AssistantHistoryConversationFilter> | undefined): string;
|
|
86
|
+
//# sourceMappingURL=historyControls.d.ts.map
|