@burdenoff/fe-libs 2026.1001.6 → 2026.1002.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/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +79 -74
- package/dist/shared/assistant/gatewayClient.d.ts +6 -0
- package/dist/shared/assistant/gatewayClient.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayClient.js +1 -0
- package/dist/shared/assistant/history/historyApi.d.ts +12 -0
- package/dist/shared/assistant/history/historyApi.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyApi.js +62 -46
- package/dist/shared/assistant/history/historyControls.d.ts +7 -0
- package/dist/shared/assistant/history/historyControls.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyControls.js +19 -16
- package/dist/shared/assistant/history/historyEngine.d.ts +17 -1
- package/dist/shared/assistant/history/historyEngine.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyEngine.js +507 -467
- package/dist/shared/assistant/history/historyList.d.ts +15 -0
- package/dist/shared/assistant/history/historyList.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyList.js +37 -38
- package/dist/shared/assistant/history/historyOperations.d.ts +35 -3
- package/dist/shared/assistant/history/historyOperations.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyOperations.js +64 -27
- package/dist/shared/assistant/history/historySearch.d.ts +110 -0
- package/dist/shared/assistant/history/historySearch.d.ts.map +1 -0
- package/dist/shared/assistant/history/historySearch.js +226 -0
- package/dist/shared/assistant/history/historySearchQuery.d.ts +50 -0
- package/dist/shared/assistant/history/historySearchQuery.d.ts.map +1 -0
- package/dist/shared/assistant/history/historySearchQuery.js +23 -0
- package/dist/shared/assistant/history/historyTransportErrors.d.ts +17 -0
- package/dist/shared/assistant/history/historyTransportErrors.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyTransportErrors.js +9 -1
- package/dist/shared/assistant/history/historyTypes.d.ts +32 -0
- package/dist/shared/assistant/history/historyTypes.d.ts.map +1 -1
- package/dist/shared/assistant/history/useAssistantHistorySearch.d.ts +32 -0
- package/dist/shared/assistant/history/useAssistantHistorySearch.d.ts.map +1 -0
- package/dist/shared/assistant/history/useAssistantHistorySearch.js +34 -0
- package/dist/shared/assistant/i18nManifest.d.ts +21 -5
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +16 -7
- package/dist/shared/assistant/index.d.ts +4 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcome.js +3 -3
- package/dist/shared/assistant/turnOutcomeCopy.d.ts +3 -3
- package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcomeCopy.js +3 -3
- package/dist/shared/assistant/ui/AssistantConversationFilters.d.ts +5 -1
- package/dist/shared/assistant/ui/AssistantConversationFilters.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationFilters.js +81 -74
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts +9 -0
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +316 -242
- package/dist/shared/assistant/ui/AssistantHistorySearchBox.d.ts +12 -0
- package/dist/shared/assistant/ui/AssistantHistorySearchBox.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantHistorySearchBox.js +74 -0
- package/dist/shared-assistant.js +175 -171
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AssistantModeConfig, Conversation, ConversationSyncStamp } from '../conversation';
|
|
2
2
|
import { AssistantMode } from '../types';
|
|
3
|
+
import { AssistantHistoryPendingUpdate } from './historyControls';
|
|
3
4
|
import { AssistantHistoryChannel, AssistantHistoryConvKey, AssistantHistoryConversationFilter, AssistantHistoryHeader, AssistantHistoryOutboxItem, AssistantHistoryScope, AssistantHistoryScopeKey, AssistantHistoryServerConversation, AssistantHistoryTombstone } from './historyTypes';
|
|
4
5
|
/** The scope a stamped conversation belongs to. */
|
|
5
6
|
export declare function historyScopeKeyOfStamp(sync: ConversationSyncStamp): AssistantHistoryScopeKey;
|
|
@@ -104,6 +105,20 @@ export interface AssistantHistoryList {
|
|
|
104
105
|
workspace: AssistantHistoryListRow[];
|
|
105
106
|
device: Conversation[];
|
|
106
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* One row of "This workspace": a conversation held here (stamped for the
|
|
110
|
+
* active scope) with the server's header when one is known, or a header
|
|
111
|
+
* alone. Its controls are resolved in the one place (`resolveRowControls`:
|
|
112
|
+
* the queued changes, then the header, then this device). Shared by the list
|
|
113
|
+
* and by the search's matches (BOFF-8159 S9), so a row reads the same in both.
|
|
114
|
+
*/
|
|
115
|
+
export declare function historyListRowOf(row: {
|
|
116
|
+
key: AssistantHistoryConvKey;
|
|
117
|
+
conversation: Conversation | null;
|
|
118
|
+
header: AssistantHistoryHeader | null;
|
|
119
|
+
pending?: readonly AssistantHistoryPendingUpdate[];
|
|
120
|
+
loading: boolean;
|
|
121
|
+
}): AssistantHistoryListRow;
|
|
107
122
|
/**
|
|
108
123
|
* The two groups the list renders (see the module docblock), filtered by
|
|
109
124
|
* `filter` — by default every conversation that is not archived.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historyList.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historyList.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEZ,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"historyList.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historyList.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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AA0C,KAAK,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;IACvC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,WAAW,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,CAAC;CACtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAkB5E"}
|
|
@@ -71,7 +71,25 @@ function g(e, t, n, r) {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
var _ = (e, t) => e > t ? e : t, v = [];
|
|
74
|
-
function y(
|
|
74
|
+
function y(e) {
|
|
75
|
+
let { key: t, conversation: n, header: i } = e, a = r(n, i, e.pending ?? v), o = n?.sync, s = n ? i ? _(n.updatedAt, i.updatedAt) : n.updatedAt : i?.updatedAt ?? "";
|
|
76
|
+
return {
|
|
77
|
+
key: t,
|
|
78
|
+
title: a.pendingTitle ?? (n ? n.title : i?.title ?? ""),
|
|
79
|
+
updatedAt: s,
|
|
80
|
+
conversation: n,
|
|
81
|
+
header: i,
|
|
82
|
+
legacy: n ? o?.origin === "legacy" : i?.legacy === !0,
|
|
83
|
+
...o?.blocked ? { blocked: o.blocked } : {},
|
|
84
|
+
loading: e.loading,
|
|
85
|
+
pinnedAt: a.pinnedAt,
|
|
86
|
+
archivedAt: a.archivedAt,
|
|
87
|
+
channel: a.channel,
|
|
88
|
+
controlsKnown: a.known,
|
|
89
|
+
controlsPending: a.pending
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function b(i, a = e) {
|
|
75
93
|
let o = [], s = /* @__PURE__ */ new Map(), l = i.loadingIds ?? {}, u = n(i.outbox ?? [], i.scopeKey);
|
|
76
94
|
for (let e of i.conversations) {
|
|
77
95
|
let n = e.sync;
|
|
@@ -80,63 +98,44 @@ function y(i, a = e) {
|
|
|
80
98
|
continue;
|
|
81
99
|
}
|
|
82
100
|
if (i.scopeKey === null || c(n) !== i.scopeKey || e.id in i.tombstones) continue;
|
|
83
|
-
let d = i.headers[e.id] ?? i.olderHeaders?.[e.id] ?? null
|
|
84
|
-
s.set(e.id, {
|
|
101
|
+
let d = i.headers[e.id] ?? i.olderHeaders?.[e.id] ?? null;
|
|
102
|
+
s.set(e.id, y({
|
|
85
103
|
key: e.id,
|
|
86
|
-
title: f.pendingTitle ?? e.title,
|
|
87
|
-
updatedAt: d ? _(e.updatedAt, d.updatedAt) : e.updatedAt,
|
|
88
104
|
conversation: e,
|
|
89
105
|
header: d,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
pinnedAt: f.pinnedAt,
|
|
94
|
-
archivedAt: f.archivedAt,
|
|
95
|
-
channel: f.channel,
|
|
96
|
-
controlsKnown: f.known,
|
|
97
|
-
controlsPending: f.pending
|
|
98
|
-
});
|
|
106
|
+
pending: u[e.id],
|
|
107
|
+
loading: e.id in l
|
|
108
|
+
}));
|
|
99
109
|
}
|
|
100
110
|
if (i.scopeKey !== null) {
|
|
101
111
|
let e = [i.headers, i.olderHeaders ?? {}];
|
|
102
|
-
for (let t of e) for (let [e, n] of Object.entries(t)) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
conversation: null,
|
|
110
|
-
header: n,
|
|
111
|
-
legacy: n.legacy,
|
|
112
|
-
loading: e in l,
|
|
113
|
-
pinnedAt: t.pinnedAt,
|
|
114
|
-
archivedAt: t.archivedAt,
|
|
115
|
-
channel: t.channel,
|
|
116
|
-
controlsKnown: t.known,
|
|
117
|
-
controlsPending: t.pending
|
|
118
|
-
});
|
|
119
|
-
}
|
|
112
|
+
for (let t of e) for (let [e, n] of Object.entries(t)) s.has(e) || n.gone || e in i.tombstones || s.set(e, y({
|
|
113
|
+
key: e,
|
|
114
|
+
conversation: null,
|
|
115
|
+
header: n,
|
|
116
|
+
pending: u[e],
|
|
117
|
+
loading: e in l
|
|
118
|
+
}));
|
|
120
119
|
}
|
|
121
120
|
return {
|
|
122
|
-
workspace: [...s.values()].filter((e) => t(e, a)).sort(
|
|
121
|
+
workspace: [...s.values()].filter((e) => t(e, a)).sort(S),
|
|
123
122
|
device: o
|
|
124
123
|
};
|
|
125
124
|
}
|
|
126
|
-
function
|
|
125
|
+
function x(e, t, n) {
|
|
127
126
|
if (n === null) return !1;
|
|
128
127
|
let r = e.conversation?.sync?.serverId ?? e.header?.serverId;
|
|
129
128
|
return e.legacy ? !!r || o(e.key) : r || e.header !== null ? !0 : t.some((t) => t.type === "save" && t.convKey === e.key && t.scopeKey === n);
|
|
130
129
|
}
|
|
131
|
-
function
|
|
130
|
+
function S(e, t) {
|
|
132
131
|
return e.pinnedAt === null == (t.pinnedAt === null) ? e.pinnedAt !== null && t.pinnedAt !== null && e.pinnedAt !== t.pinnedAt ? e.pinnedAt < t.pinnedAt ? 1 : -1 : e.updatedAt === t.updatedAt ? e.key < t.key ? -1 : Number(e.key > t.key) : e.updatedAt < t.updatedAt ? 1 : -1 : e.pinnedAt === null ? 1 : -1;
|
|
133
132
|
}
|
|
134
|
-
var
|
|
135
|
-
function
|
|
133
|
+
var C = 25;
|
|
134
|
+
function w(e) {
|
|
136
135
|
let t = e.conversations.filter((e) => !!e.sync?.serverId), n = t.length - e.max;
|
|
137
136
|
if (n <= 0) return [];
|
|
138
137
|
let r = (e) => e.sync?.openedAt ?? e.updatedAt;
|
|
139
138
|
return t.filter((t) => t.id !== e.activeConversationId && !t.sync?.titleLocked && !t.sync?.blocked && !e.isProtected(t)).sort((e, t) => r(e) === r(t) ? e.id < t.id ? -1 : 1 : r(e) < r(t) ? -1 : 1).slice(0, n).map((e) => e.id);
|
|
140
139
|
}
|
|
141
140
|
//#endregion
|
|
142
|
-
export {
|
|
141
|
+
export { C as ASSISTANT_HISTORY_MAX_CACHED_CONVERSATIONS, d as conversationHasHistory, l as historyConvKeyOf, u as historyHeaderOf, y as historyListRowOf, x as historyRowAcceptsControls, c as historyScopeKeyOfStamp, p as isOtherScopeHistoryConversation, f as isReadOnlyHistoryConversation, m as isReusableHistoryDraft, g as materializeHistoryHeader, h as resolveHistoryReopenMode, b as selectAssistantHistoryList, w as selectHistoryEvictions };
|
|
@@ -6,6 +6,25 @@ export declare const ASSISTANT_HISTORY_CONVERSATIONS_OPERATION = "AssistantHisto
|
|
|
6
6
|
/** With the controls, the list takes a `filter` (omitted: every live conversation, archived included). */
|
|
7
7
|
export declare const ASSISTANT_HISTORY_CONVERSATIONS_QUERY = "\n query AssistantHistoryConversations(\n $productId: String!\n $first: Int\n $after: String\n $filter: AssistantHistoryConversationFilter\n ) {\n myAssistantConversations(productId: $productId, first: $first, after: $after, filter: $filter) {\n nodes {\n id\n clientConversationId\n productId\n title\n legacy\n revision\n lastMessageSeq\n deleted\n deletedAt\n createdAt\n updatedAt\n pinnedAt\n archivedAt\n channel\n}\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n}\n }\n }\n";
|
|
8
8
|
export declare const ASSISTANT_HISTORY_CONVERSATIONS_QUERY_BASE = "\n query AssistantHistoryConversations($productId: String!, $first: Int, $after: String) {\n myAssistantConversations(productId: $productId, first: $first, after: $after) {\n nodes {\n id\n clientConversationId\n productId\n title\n legacy\n revision\n lastMessageSeq\n deleted\n deletedAt\n createdAt\n updatedAt\n}\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n}\n }\n }\n";
|
|
9
|
+
/**
|
|
10
|
+
* Search (BOFF-8159 S9): my conversations whose title or any live entry holds
|
|
11
|
+
* the query — `myAssistantConversations` with `filter.query`, so the list's
|
|
12
|
+
* order and cursor, and the list's filter, at most 50 a page. FULL only: the
|
|
13
|
+
* filter exists only on a server with the controls.
|
|
14
|
+
*
|
|
15
|
+
* ★★ The query is its OWN variable, placed in a filter LITERAL — never inside
|
|
16
|
+
* a `$filter` variable. graphql-js quotes a variable's value when it cannot
|
|
17
|
+
* coerce it ("Variable "$filter" got invalid value { query: … }"), so with a
|
|
18
|
+
* whole-filter variable any wrong field would echo the person's search text
|
|
19
|
+
* into an error. A string is always a valid `String!`, and each other filter
|
|
20
|
+
* field rides in a variable of its own, so a refusal can only ever quote that
|
|
21
|
+
* field. Non-null: this document never runs as an unfiltered list.
|
|
22
|
+
*
|
|
23
|
+
* Its own operation name, so what watches traffic by name (network fences,
|
|
24
|
+
* logs) can tell a search from a listing — and never needs its variables to.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ASSISTANT_HISTORY_SEARCH_OPERATION = "AssistantHistorySearch";
|
|
27
|
+
export declare const ASSISTANT_HISTORY_SEARCH_QUERY = "\n query AssistantHistorySearch(\n $productId: String!\n $query: String!\n $first: Int\n $after: String\n $channel: AssistantHistoryChannelFilter\n $pinned: Boolean\n $archived: AssistantHistoryArchivedFilter\n ) {\n myAssistantConversations(\n productId: $productId\n first: $first\n after: $after\n filter: { query: $query, channel: $channel, pinned: $pinned, archived: $archived }\n ) {\n nodes {\n id\n clientConversationId\n productId\n title\n legacy\n revision\n lastMessageSeq\n deleted\n deletedAt\n createdAt\n updatedAt\n pinnedAt\n archivedAt\n channel\n}\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n}\n }\n }\n";
|
|
9
28
|
export declare const ASSISTANT_HISTORY_ENTRIES_OPERATION = "AssistantHistoryEntries";
|
|
10
29
|
export declare const ASSISTANT_HISTORY_ENTRIES_QUERY: string;
|
|
11
30
|
export declare const ASSISTANT_HISTORY_ENTRIES_QUERY_BASE: string;
|
|
@@ -20,13 +39,14 @@ export declare const ASSISTANT_HISTORY_UPDATE_OPERATION = "UpdateAssistantHistor
|
|
|
20
39
|
export declare const ASSISTANT_HISTORY_UPDATE_MUTATION = "\n mutation UpdateAssistantHistoryConversation($input: UpdateMyAssistantConversationInput!) {\n updateMyAssistantConversation(input: $input) {\n outcome\n conversation {\n id\n clientConversationId\n productId\n title\n legacy\n revision\n lastMessageSeq\n deleted\n deletedAt\n createdAt\n updatedAt\n pinnedAt\n archivedAt\n channel\n}\n }\n }\n";
|
|
21
40
|
/**
|
|
22
41
|
* Every document, for the contract test and for anything that audits what the
|
|
23
|
-
* client sends: the FULL set (six operations)
|
|
24
|
-
* before the controls), each validated against
|
|
42
|
+
* client sends: the FULL set (six operations), the BASE set (the five from
|
|
43
|
+
* before the controls) and the search (BOFF-8159 S9), each validated against
|
|
44
|
+
* the server's SDL.
|
|
25
45
|
*/
|
|
26
46
|
export declare const ASSISTANT_HISTORY_OPERATIONS: ReadonlyArray<{
|
|
27
47
|
operationName: string;
|
|
28
48
|
document: string;
|
|
29
|
-
set: "full" | "base";
|
|
49
|
+
set: "full" | "base" | "search";
|
|
30
50
|
}>;
|
|
31
51
|
export declare function buildHistoryPageVariables(scope: AssistantHistoryScope, page: {
|
|
32
52
|
first: number;
|
|
@@ -42,6 +62,18 @@ export declare function buildHistoryListVariables(scope: AssistantHistoryScope,
|
|
|
42
62
|
after: string | null;
|
|
43
63
|
filter?: AssistantHistoryConversationFilter;
|
|
44
64
|
}): Record<string, unknown>;
|
|
65
|
+
/**
|
|
66
|
+
* A search page's variables (BOFF-8159 S9): the query as its own variable, and
|
|
67
|
+
* each filter field only when it says something — absent, the server's
|
|
68
|
+
* default applies (channel ANY, archived EXCLUDE, pinned either), exactly as
|
|
69
|
+
* for an omitted field of the filter literal.
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildHistorySearchVariables(scope: AssistantHistoryScope, page: {
|
|
72
|
+
first: number;
|
|
73
|
+
after: string | null;
|
|
74
|
+
query: string;
|
|
75
|
+
filter?: AssistantHistoryConversationFilter;
|
|
76
|
+
}): Record<string, unknown>;
|
|
45
77
|
export declare function buildHistoryEntriesVariables(scope: AssistantHistoryScope, ref: AssistantHistoryConvRef, page: AssistantHistoryEntryPaging): Record<string, unknown>;
|
|
46
78
|
export declare function buildHistorySaveVariables(scope: AssistantHistoryScope, input: AssistantHistorySaveInput): Record<string, unknown>;
|
|
47
79
|
export declare function buildHistoryDeleteVariables(scope: AssistantHistoryScope, ref: AssistantHistoryConvRef): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historyOperations.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historyOperations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,kCAAkC,EAClC,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAyCxB,eAAO,MAAM,mCAAmC,4BAA4B,CAAC;AAU7E,eAAO,MAAM,+BAA+B,QAAoC,CAAC;AACjF,eAAO,MAAM,oCAAoC,QAAyC,CAAC;AAE3F,eAAO,MAAM,yCAAyC,kCACrB,CAAC;AAClC,0GAA0G;AAC1G,eAAO,MAAM,qCAAqC,+iBAYjD,CAAC;AACF,eAAO,MAAM,0CAA0C,sbAOtD,CAAC;AAEF,eAAO,MAAM,mCAAmC,4BAA4B,CAAC;AA4B7E,eAAO,MAAM,+BAA+B,QAAoC,CAAC;AACjF,eAAO,MAAM,oCAAoC,QAAyC,CAAC;AAE3F,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAW9E,eAAO,MAAM,+BAA+B,QAAoC,CAAC;AACjF,eAAO,MAAM,oCAAoC,QAAyC,CAAC;AAE3F,eAAO,MAAM,kCAAkC,uCAAuC,CAAC;AAiBvF,eAAO,MAAM,iCAAiC,QAAsC,CAAC;AACrF,eAAO,MAAM,sCAAsC,QAA2C,CAAC;AAE/F,qFAAqF;AACrF,eAAO,MAAM,kCAAkC,uCAAuC,CAAC;AACvF,eAAO,MAAM,iCAAiC,gYAO7C,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"historyOperations.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historyOperations.ts"],"names":[],"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,GACjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB"}
|
|
@@ -29,7 +29,27 @@ var e = "\n id\n clientConversationId\n productId\n title\n legacy\n revis
|
|
|
29
29
|
pageInfo {${r}}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`, d = "
|
|
32
|
+
`, d = "AssistantHistorySearch", f = `
|
|
33
|
+
query AssistantHistorySearch(
|
|
34
|
+
$productId: String!
|
|
35
|
+
$query: String!
|
|
36
|
+
$first: Int
|
|
37
|
+
$after: String
|
|
38
|
+
$channel: AssistantHistoryChannelFilter
|
|
39
|
+
$pinned: Boolean
|
|
40
|
+
$archived: AssistantHistoryArchivedFilter
|
|
41
|
+
) {
|
|
42
|
+
myAssistantConversations(
|
|
43
|
+
productId: $productId
|
|
44
|
+
first: $first
|
|
45
|
+
after: $after
|
|
46
|
+
filter: { query: $query, channel: $channel, pinned: $pinned, archived: $archived }
|
|
47
|
+
) {
|
|
48
|
+
nodes {${t}}
|
|
49
|
+
pageInfo {${r}}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`, p = "AssistantHistoryEntries", m = (e) => `
|
|
33
53
|
query AssistantHistoryEntries(
|
|
34
54
|
$productId: String!
|
|
35
55
|
$clientConversationId: ID
|
|
@@ -55,7 +75,7 @@ var e = "\n id\n clientConversationId\n productId\n title\n legacy\n revis
|
|
|
55
75
|
pageInfo {${r}}
|
|
56
76
|
}
|
|
57
77
|
}
|
|
58
|
-
`,
|
|
78
|
+
`, h = m(t), g = m(e), _ = "SaveAssistantHistoryEntries", v = (e) => `
|
|
59
79
|
mutation SaveAssistantHistoryEntries($input: SaveMyAssistantHistoryEntriesInput!) {
|
|
60
80
|
saveMyAssistantHistoryEntries(input: $input) {
|
|
61
81
|
outcome
|
|
@@ -64,7 +84,7 @@ var e = "\n id\n clientConversationId\n productId\n title\n legacy\n revis
|
|
|
64
84
|
droppedMetadataKeys
|
|
65
85
|
}
|
|
66
86
|
}
|
|
67
|
-
`,
|
|
87
|
+
`, y = v(t), b = v(e), x = "DeleteAssistantHistoryConversation", S = (e) => `
|
|
68
88
|
mutation DeleteAssistantHistoryConversation(
|
|
69
89
|
$productId: String!
|
|
70
90
|
$clientConversationId: ID
|
|
@@ -79,14 +99,14 @@ var e = "\n id\n clientConversationId\n productId\n title\n legacy\n revis
|
|
|
79
99
|
conversation {${e}}
|
|
80
100
|
}
|
|
81
101
|
}
|
|
82
|
-
`,
|
|
102
|
+
`, C = S(t), w = S(e), T = "UpdateAssistantHistoryConversation", E = `
|
|
83
103
|
mutation UpdateAssistantHistoryConversation($input: UpdateMyAssistantConversationInput!) {
|
|
84
104
|
updateMyAssistantConversation(input: $input) {
|
|
85
105
|
outcome
|
|
86
106
|
conversation {${t}}
|
|
87
107
|
}
|
|
88
108
|
}
|
|
89
|
-
`,
|
|
109
|
+
`, D = [
|
|
90
110
|
{
|
|
91
111
|
operationName: i,
|
|
92
112
|
document: o,
|
|
@@ -98,23 +118,23 @@ var e = "\n id\n clientConversationId\n productId\n title\n legacy\n revis
|
|
|
98
118
|
set: "full"
|
|
99
119
|
},
|
|
100
120
|
{
|
|
101
|
-
operationName:
|
|
102
|
-
document:
|
|
121
|
+
operationName: p,
|
|
122
|
+
document: h,
|
|
103
123
|
set: "full"
|
|
104
124
|
},
|
|
105
125
|
{
|
|
106
|
-
operationName:
|
|
107
|
-
document:
|
|
126
|
+
operationName: _,
|
|
127
|
+
document: y,
|
|
108
128
|
set: "full"
|
|
109
129
|
},
|
|
110
130
|
{
|
|
111
|
-
operationName:
|
|
112
|
-
document:
|
|
131
|
+
operationName: x,
|
|
132
|
+
document: C,
|
|
113
133
|
set: "full"
|
|
114
134
|
},
|
|
115
135
|
{
|
|
116
|
-
operationName:
|
|
117
|
-
document:
|
|
136
|
+
operationName: T,
|
|
137
|
+
document: E,
|
|
118
138
|
set: "full"
|
|
119
139
|
},
|
|
120
140
|
{
|
|
@@ -128,30 +148,35 @@ var e = "\n id\n clientConversationId\n productId\n title\n legacy\n revis
|
|
|
128
148
|
set: "base"
|
|
129
149
|
},
|
|
130
150
|
{
|
|
131
|
-
operationName:
|
|
132
|
-
document:
|
|
151
|
+
operationName: p,
|
|
152
|
+
document: g,
|
|
133
153
|
set: "base"
|
|
134
154
|
},
|
|
135
155
|
{
|
|
136
|
-
operationName:
|
|
137
|
-
document:
|
|
156
|
+
operationName: _,
|
|
157
|
+
document: b,
|
|
138
158
|
set: "base"
|
|
139
159
|
},
|
|
140
160
|
{
|
|
141
|
-
operationName:
|
|
142
|
-
document:
|
|
161
|
+
operationName: x,
|
|
162
|
+
document: w,
|
|
143
163
|
set: "base"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
operationName: d,
|
|
167
|
+
document: f,
|
|
168
|
+
set: "search"
|
|
144
169
|
}
|
|
145
170
|
];
|
|
146
|
-
function
|
|
171
|
+
function O(e, t) {
|
|
147
172
|
return {
|
|
148
173
|
productId: e.product,
|
|
149
174
|
first: t.first,
|
|
150
175
|
after: t.after
|
|
151
176
|
};
|
|
152
177
|
}
|
|
153
|
-
function
|
|
154
|
-
let n =
|
|
178
|
+
function k(e, t) {
|
|
179
|
+
let n = O(e, t);
|
|
155
180
|
if (!t.filter) return n;
|
|
156
181
|
let r = Object.fromEntries(Object.entries(t.filter).filter(([, e]) => e !== void 0));
|
|
157
182
|
return {
|
|
@@ -159,7 +184,19 @@ function D(e, t) {
|
|
|
159
184
|
filter: r
|
|
160
185
|
};
|
|
161
186
|
}
|
|
162
|
-
function
|
|
187
|
+
function A(e, t) {
|
|
188
|
+
let n = t.filter ?? {};
|
|
189
|
+
return {
|
|
190
|
+
productId: e.product,
|
|
191
|
+
query: t.query,
|
|
192
|
+
first: t.first,
|
|
193
|
+
after: t.after,
|
|
194
|
+
...n.channel === void 0 ? {} : { channel: n.channel },
|
|
195
|
+
...n.pinned !== void 0 && n.pinned !== null ? { pinned: n.pinned } : {},
|
|
196
|
+
...n.archived === void 0 ? {} : { archived: n.archived }
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function j(e, t, n) {
|
|
163
200
|
let r = Object.fromEntries(Object.entries(n).filter(([, e]) => e !== void 0));
|
|
164
201
|
return {
|
|
165
202
|
productId: e.product,
|
|
@@ -167,7 +204,7 @@ function O(e, t, n) {
|
|
|
167
204
|
...r
|
|
168
205
|
};
|
|
169
206
|
}
|
|
170
|
-
function
|
|
207
|
+
function M(e, t) {
|
|
171
208
|
return { input: {
|
|
172
209
|
productId: e.product,
|
|
173
210
|
clientConversationId: t.clientConversationId,
|
|
@@ -181,13 +218,13 @@ function k(e, t) {
|
|
|
181
218
|
}))
|
|
182
219
|
} };
|
|
183
220
|
}
|
|
184
|
-
function
|
|
221
|
+
function N(e, t) {
|
|
185
222
|
return {
|
|
186
223
|
productId: e.product,
|
|
187
224
|
...t
|
|
188
225
|
};
|
|
189
226
|
}
|
|
190
|
-
function
|
|
227
|
+
function P(e, t, n) {
|
|
191
228
|
return { input: {
|
|
192
229
|
productId: e.product,
|
|
193
230
|
...t,
|
|
@@ -197,4 +234,4 @@ function j(e, t, n) {
|
|
|
197
234
|
} };
|
|
198
235
|
}
|
|
199
236
|
//#endregion
|
|
200
|
-
export { i as ASSISTANT_HISTORY_CHANGES_OPERATION, o as ASSISTANT_HISTORY_CHANGES_QUERY, s as ASSISTANT_HISTORY_CHANGES_QUERY_BASE, c as ASSISTANT_HISTORY_CONVERSATIONS_OPERATION, l as ASSISTANT_HISTORY_CONVERSATIONS_QUERY, u as ASSISTANT_HISTORY_CONVERSATIONS_QUERY_BASE,
|
|
237
|
+
export { i as ASSISTANT_HISTORY_CHANGES_OPERATION, o as ASSISTANT_HISTORY_CHANGES_QUERY, s as ASSISTANT_HISTORY_CHANGES_QUERY_BASE, c as ASSISTANT_HISTORY_CONVERSATIONS_OPERATION, l as ASSISTANT_HISTORY_CONVERSATIONS_QUERY, u as ASSISTANT_HISTORY_CONVERSATIONS_QUERY_BASE, C as ASSISTANT_HISTORY_DELETE_MUTATION, w as ASSISTANT_HISTORY_DELETE_MUTATION_BASE, x as ASSISTANT_HISTORY_DELETE_OPERATION, p as ASSISTANT_HISTORY_ENTRIES_OPERATION, h as ASSISTANT_HISTORY_ENTRIES_QUERY, g as ASSISTANT_HISTORY_ENTRIES_QUERY_BASE, D as ASSISTANT_HISTORY_OPERATIONS, y as ASSISTANT_HISTORY_SAVE_MUTATION, b as ASSISTANT_HISTORY_SAVE_MUTATION_BASE, _ as ASSISTANT_HISTORY_SAVE_OPERATION, d as ASSISTANT_HISTORY_SEARCH_OPERATION, f as ASSISTANT_HISTORY_SEARCH_QUERY, E as ASSISTANT_HISTORY_UPDATE_MUTATION, T as ASSISTANT_HISTORY_UPDATE_OPERATION, N as buildHistoryDeleteVariables, j as buildHistoryEntriesVariables, k as buildHistoryListVariables, O as buildHistoryPageVariables, M as buildHistorySaveVariables, A as buildHistorySearchVariables, P as buildHistoryUpdateVariables };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Conversation } from '../conversation';
|
|
2
|
+
import { AssistantHistoryListInput, AssistantHistoryListRow } from './historyList';
|
|
3
|
+
import { AssistantHistoryConversationFilter, AssistantHistoryHeader, AssistantHistoryScopeKey, AssistantHistorySearchHit, AssistantHistorySearchPage, AssistantHistorySearchRequest } from './historyTypes';
|
|
4
|
+
export interface AssistantHistorySearchList {
|
|
5
|
+
/** "This workspace": the server's matches for this query, in its order. Empty until it answers. */
|
|
6
|
+
server: AssistantHistoryListRow[];
|
|
7
|
+
/** "On this device": this workspace's rows held or cached here that match, and the server did not list. */
|
|
8
|
+
local: AssistantHistoryListRow[];
|
|
9
|
+
/** "On this device": the conversations from before history was on that match. */
|
|
10
|
+
device: Conversation[];
|
|
11
|
+
}
|
|
12
|
+
/** The newest of the headers known for one conversation: the higher revision, the first given at a tie. */
|
|
13
|
+
export declare function newestHistoryHeader(...headers: ReadonlyArray<AssistantHistoryHeader | null | undefined>): AssistantHistoryHeader | null;
|
|
14
|
+
/**
|
|
15
|
+
* The search's two groups (see the module docblock) for `query` (the settled,
|
|
16
|
+
* normalised one) under `filter` — the list's own filter, applied to both.
|
|
17
|
+
*
|
|
18
|
+
* - `hits` are the server's matches, or null while it has not answered for
|
|
19
|
+
* this query (searching, too short, busy, failed). Each becomes a row the
|
|
20
|
+
* way the list builds one: held here or a header alone, its controls as
|
|
21
|
+
* queued, the newest header known for it — and is left out when it is
|
|
22
|
+
* deleted here (a tombstone), when a queued change takes it out of the
|
|
23
|
+
* filter, or when it belongs to another account or workspace: ★★ read for
|
|
24
|
+
* another scope than the list's (its `scopeKey`; a match only the server
|
|
25
|
+
* has as much as one held here), or held here as another scope's.
|
|
26
|
+
* - This device's matches: the list's own rows under the filter whose title,
|
|
27
|
+
* or the messages held for them, contain the query (ignoring case and how
|
|
28
|
+
* whitespace runs).
|
|
29
|
+
*/
|
|
30
|
+
export declare function selectHistorySearchList(input: AssistantHistoryListInput, filter: Readonly<AssistantHistoryConversationFilter>, query: string, hits: readonly AssistantHistorySearchHit[] | null): AssistantHistorySearchList;
|
|
31
|
+
/** One page of the server's search: the engine's `searchConversations`. */
|
|
32
|
+
export type AssistantHistorySearchFn = (request: AssistantHistorySearchRequest) => Promise<AssistantHistorySearchPage>;
|
|
33
|
+
/** Timers, injectable so the debounce and the retry are testable without real time. */
|
|
34
|
+
export interface AssistantHistorySearchTimers {
|
|
35
|
+
setTimeout(callback: () => void, ms: number): unknown;
|
|
36
|
+
clearTimeout(handle: unknown): void;
|
|
37
|
+
}
|
|
38
|
+
export interface AssistantHistorySearchInput {
|
|
39
|
+
/** What the search box holds, as typed. */
|
|
40
|
+
text: string;
|
|
41
|
+
/** The list's filter: the server applies it with the query, as the list does. */
|
|
42
|
+
filter: Readonly<AssistantHistoryConversationFilter>;
|
|
43
|
+
/** The server can be searched: history is on and it has the controls (search builds on them). */
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
/** The scope the list shows (the history status's `scopeKey`; null between scopes). */
|
|
46
|
+
scopeKey: AssistantHistoryScopeKey | null;
|
|
47
|
+
/** The history status's `epoch`: it advances on every scope change, a switch away and back included. */
|
|
48
|
+
epoch: number;
|
|
49
|
+
}
|
|
50
|
+
/** What the server part of a search is doing. */
|
|
51
|
+
export type AssistantHistorySearchServerState =
|
|
52
|
+
/** Nothing asked of it: no query, a query under 2 characters, or no server to ask. */
|
|
53
|
+
{
|
|
54
|
+
status: "idle";
|
|
55
|
+
}
|
|
56
|
+
/** The first page is on its way. */
|
|
57
|
+
| {
|
|
58
|
+
status: "searching";
|
|
59
|
+
} | {
|
|
60
|
+
status: "results";
|
|
61
|
+
hits: readonly AssistantHistorySearchHit[];
|
|
62
|
+
/** "Show more results". */
|
|
63
|
+
hasMore: boolean;
|
|
64
|
+
/** A further page is on its way (or waiting for its one retry). */
|
|
65
|
+
loadingMore: boolean;
|
|
66
|
+
/** The last "Show more results" failed; the matches so far stay, and it can be pressed again. */
|
|
67
|
+
moreFailed: boolean;
|
|
68
|
+
}
|
|
69
|
+
/** No server matches: this device's matches only, and a notice says why. */
|
|
70
|
+
| {
|
|
71
|
+
status: "fallback";
|
|
72
|
+
reason: "busy" | "failed";
|
|
73
|
+
};
|
|
74
|
+
export interface AssistantHistorySearchSnapshot {
|
|
75
|
+
/** The query every result answers: the box's text, normalised, once typing paused. "" = no search. */
|
|
76
|
+
query: string;
|
|
77
|
+
/** The query is under 2 characters: matched on this device only, never sent. */
|
|
78
|
+
tooShort: boolean;
|
|
79
|
+
server: AssistantHistorySearchServerState;
|
|
80
|
+
}
|
|
81
|
+
export interface AssistantHistorySearchControllerDeps {
|
|
82
|
+
search: AssistantHistorySearchFn;
|
|
83
|
+
timers: AssistantHistorySearchTimers;
|
|
84
|
+
/** The matches were dropped (box cleared, search off, controller disposed): the engine forgets them. */
|
|
85
|
+
forget?: () => void;
|
|
86
|
+
/** Default 300 ms. */
|
|
87
|
+
debounceMs?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface AssistantHistorySearchController {
|
|
90
|
+
/** The box's text, the list's filter, the server's availability or the scope may have changed. Idempotent. */
|
|
91
|
+
update(input: AssistantHistorySearchInput): void;
|
|
92
|
+
/** Enter: search what the box holds now, without waiting for typing to pause (or again, after a fallback). */
|
|
93
|
+
flush(): void;
|
|
94
|
+
/** "Show more results": the next page of the server's matches. */
|
|
95
|
+
loadMore(): void;
|
|
96
|
+
snapshot(): AssistantHistorySearchSnapshot;
|
|
97
|
+
subscribe(listener: () => void): () => void;
|
|
98
|
+
/** Cancel everything and forget the matches. The controller can be used again (React may remount). */
|
|
99
|
+
dispose(): void;
|
|
100
|
+
}
|
|
101
|
+
/** The longest `retryAfter` a refused search is retried after; past it the query has gone stale. */
|
|
102
|
+
export declare const ASSISTANT_HISTORY_SEARCH_MAX_RETRY_MS = 10000;
|
|
103
|
+
/**
|
|
104
|
+
* The server's own "too many searches at once" (`RATE_LIMIT_EXCEEDED`), and
|
|
105
|
+
* how long it asked to wait — or null for any other failure.
|
|
106
|
+
*/
|
|
107
|
+
export declare function historySearchBusyDelay(error: unknown): number | null;
|
|
108
|
+
/** See the module docblock. */
|
|
109
|
+
export declare function createHistorySearchController(deps: AssistantHistorySearchControllerDeps): AssistantHistorySearchController;
|
|
110
|
+
//# sourceMappingURL=historySearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historySearch.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/history/historySearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,iBAAiB,CAAC;AAO7D,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC7B,MAAM,eAAe,CAAC;AASvB,OAAO,KAAK,EAEV,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,0BAA0B;IACzC,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