bunnyquery 1.19.3 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -2
- package/bunnyquery.css +21 -0
- package/bunnyquery.js +303 -18
- package/dist/engine.cjs +274 -14
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.mts +102 -1
- package/dist/engine.d.ts +102 -1
- package/dist/engine.mjs +273 -15
- package/dist/engine.mjs.map +1 -1
- package/package.json +1 -1
- package/src/engine/config.ts +36 -0
- package/src/engine/index.ts +4 -0
- package/src/engine/prompts/chat_system_prompt.ts +10 -2
- package/src/engine/requests.ts +8 -2
- package/src/engine/session.ts +275 -10
- package/styles/chat.css +21 -0
package/dist/engine.mjs
CHANGED
|
@@ -255,6 +255,17 @@ function resolveForwardRequestStream() {
|
|
|
255
255
|
function windowedIndexingEnabled() {
|
|
256
256
|
return _config?.windowedIndexing === true;
|
|
257
257
|
}
|
|
258
|
+
function statusPushEnabled() {
|
|
259
|
+
return _config?.statusPush === true && typeof _config?.onRequestStatus === "function";
|
|
260
|
+
}
|
|
261
|
+
function statusPushLive() {
|
|
262
|
+
if (!statusPushEnabled() || typeof _config?.isRequestStatusLive !== "function") return false;
|
|
263
|
+
try {
|
|
264
|
+
return !!_config.isRequestStatusLive();
|
|
265
|
+
} catch (e) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
258
269
|
function liveStreamingSocketEnabled() {
|
|
259
270
|
return liveStreamingEnabled() && _config?.liveStreaming === true;
|
|
260
271
|
}
|
|
@@ -839,7 +850,8 @@ WHEN THE DATA DOES NOT HAVE IT, SAY SO. Once you have searched the way these rul
|
|
|
839
850
|
KEEP WHAT THE DATA SAYS APART FROM WHAT YOU WORKED OUT. A total you computed, a comparison, a trend, an interpretation or a recommendation is yours, not the data's: label it as such ("calculated from...", "this suggests...") and name the rows or files it was made from. Never present an estimate, an assumption or an inference as something the data states.
|
|
840
851
|
These three rules govern every claim about the project's data. They do not limit the About BunnyQuery section (answer product questions from it), a greeting, or text the user explicitly asks you to write.`;
|
|
841
852
|
const webRule = webAccess ? `WEB ACCESS IS ON for this project: when the user asks for something that is not in the project's data, you may search the web for it, but every such fact must be marked as coming from the web (name the site), kept apart from what the project's data says, and never used to fill in or complete a document's content or a record. This is the one exception to the four sources named above.` : `This chat has no web tool: the web is never a source here.`;
|
|
842
|
-
const documentRules = `DOCUMENTS (a contract, a report, a manual, a letter, any uploaded file the user asks about the content of): FIRST FIND THE FILE, with getFileOutline when you know its storage path, otherwise by its "src::" record (see WHERE INDEXED CONTENT LIVES) using the name the user used. THEN FIND THE PAGE with searchText: with the file's path when the user named a file, without a path when they did not ("find a file that contains X"), and follow its description's steps to the end, including asking the user once, after quick results, before it searches all files. QUOTE THE EXACT TEXT it returned and CITE THE FILE AND THE PAGE ("report.pdf, page 7"); never present a paraphrase as a quote. A file with no page text is read with readFileContent instead and cited by its file name
|
|
853
|
+
const documentRules = `DOCUMENTS (a contract, a report, a manual, a letter, any uploaded file the user asks about the content of): FIRST FIND THE FILE, with getFileOutline when you know its storage path, otherwise by its "src::" record (see WHERE INDEXED CONTENT LIVES) using the name the user used. THEN FIND THE PAGE with searchText: with the file's path when the user named a file, without a path when they did not ("find a file that contains X"), and follow its description's steps to the end, including asking the user once, after quick results, before it searches all files. QUOTE THE EXACT TEXT it returned and CITE THE FILE AND THE PAGE ("report.pdf, page 7"); never present a paraphrase as a quote. A file with no page text is read with readFileContent instead and cited by its file name. For a long file (a manual, a book), call getFileOutline first and search the chapter that fits with searchText page_from and page_to. When the user asks about the content of the documents, pass searchText "question": that question in the user's own words, without names or personal details that are not about the documents. Leave "question" out for anything else.
|
|
854
|
+
WRONG ANSWER: when the user says an answer is wrong (or sends "This answer seems wrong. Please check it again against the documents."), re-read the pages you cited and search again, passing searchText "question" = the user's ORIGINAL question that the disputed answer answered, never the complaint message itself. Then do exactly one of: correct the answer only; correct the answer and call correctSearchLink (when it is among your tools); or keep the answer and quote the text that supports it. Call correctSearchLink only with the page and an exact quote that prove it, and never change data on the user's word alone.`;
|
|
843
855
|
const groupIsPublic = indexGroupLiteral === '"public"' || indexGroupLiteral === "0";
|
|
844
856
|
const accessGroupRule = `THIS PROJECT INDEXES AT access_group ${indexGroupLiteral}: pass access_group ${indexGroupLiteral} EXPLICITLY on EVERY query that names a table_name, whether it filters by index, by tag or by nothing, and never rely on a default: a group left off is NOT "all groups", and any user but the project's owner is then answered from access_group 0 (public) alone${groupIsPublic ? "" : `, so a table indexed at ${indexGroupLiteral} would look empty with its records sitting right there`}. Files uploaded before the project's setting changed may sit at another group, so when a table query comes back empty, retry it in the other groups among 0, 1 and "private" before concluding there is nothing. Reference is the exception: reference ALONE spans EVERY table and EVERY access group, so getRecords with reference "src::<the file's storage path>" is the one call that returns a whole file's records wherever the indexer put them; adding table_name narrows it to that table, and access_group WITHOUT table_name fails.`;
|
|
845
857
|
let systemPrompt = `
|
|
@@ -848,7 +860,6 @@ Scope: Only answer questions about this project and its data. Do not answer ques
|
|
|
848
860
|
Knowledge lookup: before saying you don't know, or that something isn't in the chat history, ALWAYS search this project's data with the tools: the project's data lives in its database, not in the earlier messages of this chat.
|
|
849
861
|
${groundingRules}
|
|
850
862
|
${webRule}
|
|
851
|
-
SAVED FINDINGS FIRST: where an earlier search found an answer is saved in table "search_findings" (one record per file page; its tags are the key words of the question that led there and of the search terms, stored lowercase without spaces). Before any other search, call getRecords with table_name "search_findings", access_group ${indexGroupLiteral} and tags set to ONE specific key word of the question (a name or a term, in the user's words; when nothing comes back, try one more word, or the word in the documents' language). A finding gives data.path and data.page: read THAT page (searchText with that path and the question's words) and answer from the page itself, quoting and citing it as usual. A finding is only a pointer, never the answer: when its page does not answer the question, or nothing is found, search as below.
|
|
852
863
|
FINDING THE DATA: the database is the way in, for every kind of file. Follow the search path in getTables' description, with one exception for this project: when getTables' one page is the whole list (end_of_list true), skip its table-name search even when no name fits: you already see every table, and a table is never named after a company, a person or a single fact, so when no table fits, the answer is in a document's text: use searchText (DOCUMENTS below). Pick EVERY table that could hold the answer, not the first that fits. Read getIndexes and getTags one page each, never with fetch_all: name and tag lists can be millions of characters long and are never read whole, so when the name is not on that page, search for it with the user's words as their descriptions say. Never call getTags with neither table_name nor tag: that lists every tag of every table. Then getRecords in that table and group with the selector that matched (an index, one exact tag, or none for the whole table), always with fetch_all true. WHERE INDEXED CONTENT LIVES: a document's extracted content (PDF, Word, slides, scans) is in table "document_entries", one record per row / entry / section, with its page in "page"; spreadsheet rows are in "spreadsheet_rows". Files indexed before 2026-11-20 may still hold theirs in other tables, so a file's records are found wherever they are with getRecords reference "src::<path>" (see the access group rule below); every later mention of a file's records means this call. Every stored file has a record whose unique_id is "src::<its storage path>", so getUniqueId with unique_id "src::" and condition "gte" lists every file across every table (add the start of a path to narrow it; condition "lte" with a file name alone finds it in any folder).
|
|
853
864
|
NUMBERS FROM A SPREADSHEET are computed from the ROWS, never from one page and never from a guess. Each row of each sheet is one record in its table: reference "src::<path>", unique_id "row::<path>#<sheet>#R<n>", the cells by header name, plus "_sheet", "_row", "_grain" ("detail" or "summary") and, on a total or preamble row, "_row_type". Its tags carry the file name, the sheet, the grain and up to four key values of the row (a name, a code), so getRecords with one exact tag selects every row about that thing across all the files in the table. Workbooks state the same money more than once: a detail sheet, then per-song, per-album and per-artist sheets that re-total it, plus a summary. Use rows whose "_grain" is "detail" and whose "_row_type" is not "total", pick ONE sheet per file and say which, and never add a sheet to its summary. Fetch the COMPLETE matching set, keep only the rows whose column or tag names what was asked, then add them up carefully, in groups, and check that the group sums agree with the grand total. A FILE TOTAL IS NOT A ROW'S TOTAL: the biggest number on a summary sheet is the whole file, not the thing asked about, so check every figure is scoped to what the question named (filter by the column that identifies it). Quote the row count, the sheet(s) and the file(s) the figure was made from and label it as calculated.
|
|
854
865
|
${documentRules}
|
|
@@ -2638,6 +2649,9 @@ async function notifyAgentSaveAttachment(info) {
|
|
|
2638
2649
|
service,
|
|
2639
2650
|
owner,
|
|
2640
2651
|
...pollOpt(),
|
|
2652
|
+
// Status push for this pass and the continuations the worker queues from it
|
|
2653
|
+
// (see ChatEngineConfig.statusPush). Absent unless the host turned it on.
|
|
2654
|
+
...statusPushEnabled() ? { notify: true } : {},
|
|
2641
2655
|
url: OPENAI_RESPONSES_API_URL,
|
|
2642
2656
|
method: "POST",
|
|
2643
2657
|
headers: {
|
|
@@ -2682,6 +2696,9 @@ async function notifyAgentSaveAttachment(info) {
|
|
|
2682
2696
|
service,
|
|
2683
2697
|
owner,
|
|
2684
2698
|
...pollOpt(),
|
|
2699
|
+
// Status push for this pass and the continuations the worker queues from it
|
|
2700
|
+
// (see ChatEngineConfig.statusPush). Absent unless the host turned it on.
|
|
2701
|
+
...statusPushEnabled() ? { notify: true } : {},
|
|
2685
2702
|
url: ANTHROPIC_MESSAGES_API_URL,
|
|
2686
2703
|
method: "POST",
|
|
2687
2704
|
headers: {
|
|
@@ -5321,6 +5338,11 @@ var INDEX_DISPATCH_CLAIM_MS = 2 * 60 * 1e3;
|
|
|
5321
5338
|
var WORKER_PASS_ADOPT_ATTEMPTS = [0, 2e3, 6e3];
|
|
5322
5339
|
var RECENT_INDEX_PASS_EVIDENCE_MS = 10 * 60 * 1e3;
|
|
5323
5340
|
var ADOPT_TICK_MS = 10 * 1e3;
|
|
5341
|
+
var STATUS_PUSH_ADOPT_TICK_MS = 60 * 1e3;
|
|
5342
|
+
var CATCH_UP_MIN_GAP_MS = 2e3;
|
|
5343
|
+
var RETURN_WATCH_MS = 15 * 1e3;
|
|
5344
|
+
var RETURN_WATCH_SLEEP_GAP_MS = 45 * 1e3;
|
|
5345
|
+
var STATUS_NUDGE_MIN_GAP_MS = 2e3;
|
|
5324
5346
|
var EARLY_PROBE_SCHEDULE_MS = [400, 900, 1700];
|
|
5325
5347
|
var INDEXING_DRAIN_BUSY_POLL_MS = 8e3;
|
|
5326
5348
|
var INDEXING_DRAIN_CONFIRM_POLL_MS = 3e3;
|
|
@@ -5462,6 +5484,12 @@ function requestIdTimeMs(rid) {
|
|
|
5462
5484
|
}
|
|
5463
5485
|
return Math.floor(v / 2 / 1e6);
|
|
5464
5486
|
}
|
|
5487
|
+
var WRONG_ANSWER_MESSAGE = "This answer seems wrong. Please check it again against the documents.";
|
|
5488
|
+
var WRONG_ANSWER_LABEL = "Wrong answer?";
|
|
5489
|
+
function canReportWrongAnswer(msg) {
|
|
5490
|
+
var note = retrievalNoteOfAnswer(msg);
|
|
5491
|
+
return !!note && !answerUsedNoDataTool(note) && !msg.isCancelled;
|
|
5492
|
+
}
|
|
5465
5493
|
var _ChatSession = class _ChatSession {
|
|
5466
5494
|
constructor(host) {
|
|
5467
5495
|
// --- live streaming ----------------------------------------------------
|
|
@@ -5511,6 +5539,10 @@ var _ChatSession = class _ChatSession {
|
|
|
5511
5539
|
// bubble can never silently revert to its 200-char head.
|
|
5512
5540
|
this._hydratedBodies = {};
|
|
5513
5541
|
this._hydratingItems = {};
|
|
5542
|
+
/** The button's label and the message it sends, read off the session so the
|
|
5543
|
+
* clients need no extra import. */
|
|
5544
|
+
this.wrongAnswerLabel = WRONG_ANSWER_LABEL;
|
|
5545
|
+
this.wrongAnswerMessage = WRONG_ANSWER_MESSAGE;
|
|
5514
5546
|
this.typewriterQueue = Promise.resolve();
|
|
5515
5547
|
/**
|
|
5516
5548
|
* Pick up indexing passes the WORKER minted, which no client ever dispatched.
|
|
@@ -5547,6 +5579,27 @@ var _ChatSession = class _ChatSession {
|
|
|
5547
5579
|
* a reload starts without it and asks once, as before. */
|
|
5548
5580
|
this._idleVerdictAt = {};
|
|
5549
5581
|
this._adoptTickTimer = null;
|
|
5582
|
+
/** Start the ADOPT_TICK_MS follow-up if this page is tracking live indexing work and
|
|
5583
|
+
* is visible. Idempotent; each tick re-checks and stops when the work is gone, the tab
|
|
5584
|
+
* is hidden (resume restarts it through refreshLiveIndexState) or the view closed. */
|
|
5585
|
+
// ── RETURN CATCH-UP + REQUEST STATUS PUSH (owner, 2026-11-23) ──────────────
|
|
5586
|
+
// The rule: when the user comes back to the chat (the tab shown again, the computer
|
|
5587
|
+
// awake again, the network or the websocket back), the chat is re-read from the
|
|
5588
|
+
// server, so nothing that happened while they were away is missing. The re-read is
|
|
5589
|
+
// loadHistory's own first-page refresh, the one every mount runs: it keeps older pages
|
|
5590
|
+
// the user loaded, keeps a send still in flight, never lets an empty answer replace a
|
|
5591
|
+
// known one, re-attaches polls to whatever is still waiting, and reads back a streamed
|
|
5592
|
+
// answer nobody finalized. Status frames (statusPush) only make things faster; they
|
|
5593
|
+
// never decide anything on screen.
|
|
5594
|
+
this._catchUpAt = 0;
|
|
5595
|
+
this._catchUpTimer = null;
|
|
5596
|
+
this._returnWatchTimer = null;
|
|
5597
|
+
this._returnWatchAt = 0;
|
|
5598
|
+
this._returnListeners = false;
|
|
5599
|
+
this._statusUnsub = null;
|
|
5600
|
+
this._statusNudgeTimer = null;
|
|
5601
|
+
this._statusNudgeAt = 0;
|
|
5602
|
+
this._statusSeenConnect = false;
|
|
5550
5603
|
/** The last COMPLETE running+pending look at this user's bg queue: which pass ids were
|
|
5551
5604
|
* live. Complete means both lists came back shorter than their limit, so a tracked pass
|
|
5552
5605
|
* missing from it really has left the queue. */
|
|
@@ -5591,6 +5644,7 @@ var _ChatSession = class _ChatSession {
|
|
|
5591
5644
|
this.historyItemPolls = /* @__PURE__ */ new Map();
|
|
5592
5645
|
this._pauseReasons = /* @__PURE__ */ new Set();
|
|
5593
5646
|
this._resuming = false;
|
|
5647
|
+
this._wrongReported = {};
|
|
5594
5648
|
this._lidSeq = 0;
|
|
5595
5649
|
this._stageSeq = 0;
|
|
5596
5650
|
this._uploadBatches = 0;
|
|
@@ -6985,8 +7039,7 @@ var _ChatSession = class _ChatSession {
|
|
|
6985
7039
|
this._resuming = true;
|
|
6986
7040
|
return Promise.resolve().then(function() {
|
|
6987
7041
|
self.drainBgTaskQueue();
|
|
6988
|
-
|
|
6989
|
-
self.refreshLiveIndexState();
|
|
7042
|
+
return self.catchUpHistory();
|
|
6990
7043
|
}).catch(function(e) {
|
|
6991
7044
|
console.error("[chat-engine] resume polling failed", e);
|
|
6992
7045
|
}).then(function() {
|
|
@@ -8217,6 +8270,54 @@ var _ChatSession = class _ChatSession {
|
|
|
8217
8270
|
}
|
|
8218
8271
|
});
|
|
8219
8272
|
}
|
|
8273
|
+
/**
|
|
8274
|
+
* Does this bubble get the "Wrong answer?" button: the free function's gate,
|
|
8275
|
+
* and only on the latest answer, because the message it sends names no answer
|
|
8276
|
+
* and the model reads it right after the last one. An answer already reported
|
|
8277
|
+
* keeps its (disabled) button after the complaint turn lands below it.
|
|
8278
|
+
*/
|
|
8279
|
+
canReportWrongAnswer(msg) {
|
|
8280
|
+
if (!canReportWrongAnswer(msg)) return false;
|
|
8281
|
+
return this.wrongAnswerReported(msg) || this._isLatestAnswer(msg);
|
|
8282
|
+
}
|
|
8283
|
+
/** True when no chat turn follows `msg` in state.messages. Indexing rows and
|
|
8284
|
+
* cancelled turns do not count (neither reaches the model's history). Matched
|
|
8285
|
+
* by identity or by item id, since agent.vue hands in reactive proxies. */
|
|
8286
|
+
_isLatestAnswer(msg) {
|
|
8287
|
+
var list = this.state.messages || [];
|
|
8288
|
+
var sid = msg._serverItemId, lid = msg._localId;
|
|
8289
|
+
for (var i = list.length - 1; i >= 0; i--) {
|
|
8290
|
+
var m = list[i];
|
|
8291
|
+
if (!m) continue;
|
|
8292
|
+
if (m === msg || m.role === "assistant" && (sid && m._serverItemId === sid || lid && m._localId === lid)) return true;
|
|
8293
|
+
if (m.isBackgroundTask || m.isCancelled) continue;
|
|
8294
|
+
return false;
|
|
8295
|
+
}
|
|
8296
|
+
return false;
|
|
8297
|
+
}
|
|
8298
|
+
/** True once this answer's "Wrong answer?" was sent (one click per answer). */
|
|
8299
|
+
wrongAnswerReported(msg) {
|
|
8300
|
+
if (!msg) return false;
|
|
8301
|
+
if (msg._wrongReported) return true;
|
|
8302
|
+
var key = msg._serverItemId || msg._localId;
|
|
8303
|
+
return !!key && !!this._wrongReported[key];
|
|
8304
|
+
}
|
|
8305
|
+
/**
|
|
8306
|
+
* The "Wrong answer?" button: sends WRONG_ANSWER_MESSAGE as an ordinary visible
|
|
8307
|
+
* user turn through dispatchComposedMessage, so it reads the same after a reload
|
|
8308
|
+
* and both clients behave alike. The answer is marked first, so the button goes
|
|
8309
|
+
* disabled at once. False when the bubble does not qualify or was already used.
|
|
8310
|
+
* `pinned` is the caller's usual pinned identity and prompt (agent.vue pins them).
|
|
8311
|
+
*/
|
|
8312
|
+
reportWrongAnswer(msg, pinned) {
|
|
8313
|
+
if (this.wrongAnswerReported(msg) || !this.canReportWrongAnswer(msg)) return false;
|
|
8314
|
+
msg._wrongReported = true;
|
|
8315
|
+
var key = msg._serverItemId || msg._localId;
|
|
8316
|
+
if (key) this._wrongReported[key] = true;
|
|
8317
|
+
this.host.notify();
|
|
8318
|
+
this.dispatchComposedMessage(WRONG_ANSWER_MESSAGE, false, void 0, void 0, void 0, pinned);
|
|
8319
|
+
return true;
|
|
8320
|
+
}
|
|
8220
8321
|
/**
|
|
8221
8322
|
* Stop waiting for the reply to the chat turn that is running now, and move on.
|
|
8222
8323
|
*
|
|
@@ -9057,9 +9158,153 @@ var _ChatSession = class _ChatSession {
|
|
|
9057
9158
|
});
|
|
9058
9159
|
return found;
|
|
9059
9160
|
}
|
|
9060
|
-
/**
|
|
9061
|
-
*
|
|
9062
|
-
*
|
|
9161
|
+
/**
|
|
9162
|
+
* Re-read the chat from the server now (see the rule above). Safe to call from any
|
|
9163
|
+
* number of triggers at once: calls within CATCH_UP_MIN_GAP_MS of the last one run
|
|
9164
|
+
* once, at the end of the gap. Nothing happens while no chat view is mounted (the
|
|
9165
|
+
* mount loads the chat anyway) or while background polling is paused (the tab is
|
|
9166
|
+
* hidden: showing it calls this again).
|
|
9167
|
+
*/
|
|
9168
|
+
catchUpHistory() {
|
|
9169
|
+
var self = this;
|
|
9170
|
+
var id = this.host.getIdentity();
|
|
9171
|
+
if (!id.projectId || id.platform === "none") return Promise.resolve();
|
|
9172
|
+
if (!this.host.isViewMounted || !this.host.isViewMounted() || this.isPollingPaused()) return Promise.resolve();
|
|
9173
|
+
this._ensureReturnWatch();
|
|
9174
|
+
var wait = this._catchUpAt + CATCH_UP_MIN_GAP_MS - Date.now();
|
|
9175
|
+
if (wait > 0) {
|
|
9176
|
+
if (!this._catchUpTimer) {
|
|
9177
|
+
this._catchUpTimer = setTimeout(function() {
|
|
9178
|
+
self._catchUpTimer = null;
|
|
9179
|
+
self.catchUpHistory();
|
|
9180
|
+
}, wait);
|
|
9181
|
+
}
|
|
9182
|
+
return Promise.resolve();
|
|
9183
|
+
}
|
|
9184
|
+
this._catchUpAt = Date.now();
|
|
9185
|
+
return this.loadHistory(false, this.state.gateRefreshToken).catch(function(e) {
|
|
9186
|
+
console.error("[chat-engine] catch-up failed", e);
|
|
9187
|
+
});
|
|
9188
|
+
}
|
|
9189
|
+
/**
|
|
9190
|
+
* Watch for the moments the user comes back without the tab being hidden first: the
|
|
9191
|
+
* computer waking from sleep (the timer finds a gap far longer than its interval),
|
|
9192
|
+
* the network coming back, a page restored from the back-forward cache. Also starts
|
|
9193
|
+
* the status push listener. Runs while a chat view is mounted and stops itself when
|
|
9194
|
+
* none is.
|
|
9195
|
+
*/
|
|
9196
|
+
_ensureReturnWatch() {
|
|
9197
|
+
var self = this;
|
|
9198
|
+
if (typeof window === "undefined") return;
|
|
9199
|
+
if (!this._returnListeners) {
|
|
9200
|
+
this._returnListeners = true;
|
|
9201
|
+
var onBack = function() {
|
|
9202
|
+
if (typeof document !== "undefined" && document.visibilityState === "hidden") return;
|
|
9203
|
+
self.catchUpHistory();
|
|
9204
|
+
};
|
|
9205
|
+
window.addEventListener("online", onBack);
|
|
9206
|
+
window.addEventListener("pageshow", function(ev) {
|
|
9207
|
+
if (ev && ev.persisted) onBack();
|
|
9208
|
+
});
|
|
9209
|
+
}
|
|
9210
|
+
this._startStatusPush();
|
|
9211
|
+
if (this._returnWatchTimer) return;
|
|
9212
|
+
this._returnWatchAt = Date.now();
|
|
9213
|
+
var look = function() {
|
|
9214
|
+
self._returnWatchTimer = null;
|
|
9215
|
+
if (!self.host.isViewMounted || !self.host.isViewMounted()) {
|
|
9216
|
+
self._stopStatusPush();
|
|
9217
|
+
return;
|
|
9218
|
+
}
|
|
9219
|
+
var now = Date.now();
|
|
9220
|
+
var gap = now - self._returnWatchAt;
|
|
9221
|
+
self._returnWatchAt = now;
|
|
9222
|
+
if (gap > RETURN_WATCH_SLEEP_GAP_MS && (typeof document === "undefined" || document.visibilityState !== "hidden")) {
|
|
9223
|
+
self.catchUpHistory();
|
|
9224
|
+
}
|
|
9225
|
+
self._returnWatchTimer = setTimeout(look, RETURN_WATCH_MS);
|
|
9226
|
+
};
|
|
9227
|
+
this._returnWatchTimer = setTimeout(look, RETURN_WATCH_MS);
|
|
9228
|
+
}
|
|
9229
|
+
/** Listen to request status frames while a chat view is mounted (statusPush on). */
|
|
9230
|
+
_startStatusPush() {
|
|
9231
|
+
if (this._statusUnsub || !statusPushEnabled()) return;
|
|
9232
|
+
var self = this;
|
|
9233
|
+
this._statusSeenConnect = false;
|
|
9234
|
+
try {
|
|
9235
|
+
var unsub = chatEngineConfig().onRequestStatus(function(ev) {
|
|
9236
|
+
self._onRequestStatus(ev);
|
|
9237
|
+
});
|
|
9238
|
+
this._statusUnsub = typeof unsub === "function" ? unsub : function() {
|
|
9239
|
+
};
|
|
9240
|
+
} catch (e) {
|
|
9241
|
+
this._statusUnsub = null;
|
|
9242
|
+
}
|
|
9243
|
+
}
|
|
9244
|
+
_stopStatusPush() {
|
|
9245
|
+
var unsub = this._statusUnsub;
|
|
9246
|
+
this._statusUnsub = null;
|
|
9247
|
+
if (this._statusNudgeTimer) {
|
|
9248
|
+
clearTimeout(this._statusNudgeTimer);
|
|
9249
|
+
this._statusNudgeTimer = null;
|
|
9250
|
+
}
|
|
9251
|
+
if (unsub) {
|
|
9252
|
+
try {
|
|
9253
|
+
unsub();
|
|
9254
|
+
} catch (e) {
|
|
9255
|
+
}
|
|
9256
|
+
}
|
|
9257
|
+
}
|
|
9258
|
+
/**
|
|
9259
|
+
* One status frame event. 'connected' (first connection, and every reconnect after a
|
|
9260
|
+
* drop, a sleep or the planned renewal) catches up, because frames sent while the
|
|
9261
|
+
* socket was down are lost. A status change of an indexing pass this page does not
|
|
9262
|
+
* poll runs the queue check now instead of at its next heartbeat; a pass that IS polled
|
|
9263
|
+
* was already woken by skapi-js itself. Chat turns are left to their own polls.
|
|
9264
|
+
*/
|
|
9265
|
+
_onRequestStatus(ev) {
|
|
9266
|
+
if (!ev || !this.host.isViewMounted()) return;
|
|
9267
|
+
if (ev.type === "connected") {
|
|
9268
|
+
if (!this._statusSeenConnect) {
|
|
9269
|
+
this._statusSeenConnect = true;
|
|
9270
|
+
return;
|
|
9271
|
+
}
|
|
9272
|
+
if (typeof document !== "undefined" && document.visibilityState === "hidden") return;
|
|
9273
|
+
this.catchUpHistory();
|
|
9274
|
+
return;
|
|
9275
|
+
}
|
|
9276
|
+
if (ev.type !== "status" || typeof ev.id !== "string") return;
|
|
9277
|
+
if (!ev.queue || !isBgIndexingQueue(ev.queue)) return;
|
|
9278
|
+
if (this.historyItemPolls.has(ev.id)) return;
|
|
9279
|
+
var tracked = false;
|
|
9280
|
+
for (var i = 0; i < this.bgTaskQueue.length; i++) {
|
|
9281
|
+
var e = this.bgTaskQueue[i];
|
|
9282
|
+
if (e && e.id === ev.id) {
|
|
9283
|
+
tracked = !e.byListing;
|
|
9284
|
+
break;
|
|
9285
|
+
}
|
|
9286
|
+
}
|
|
9287
|
+
if (tracked) return;
|
|
9288
|
+
this._nudgeQueueCheck();
|
|
9289
|
+
}
|
|
9290
|
+
/** Run the queue check (adopt, settle by listing, page progress) now, at most once per
|
|
9291
|
+
* STATUS_NUDGE_MIN_GAP_MS, then let the heartbeat carry on. */
|
|
9292
|
+
_nudgeQueueCheck() {
|
|
9293
|
+
var self = this;
|
|
9294
|
+
if (this._statusNudgeTimer) return;
|
|
9295
|
+
var wait = Math.max(0, this._statusNudgeAt + STATUS_NUDGE_MIN_GAP_MS - Date.now());
|
|
9296
|
+
this._statusNudgeTimer = setTimeout(function() {
|
|
9297
|
+
self._statusNudgeTimer = null;
|
|
9298
|
+
self._statusNudgeAt = Date.now();
|
|
9299
|
+
var id = self.host.getIdentity();
|
|
9300
|
+
if (!id.projectId || id.platform !== "claude" && id.platform !== "openai") return;
|
|
9301
|
+
if (self.isPollingPaused() || !self.host.isViewMounted()) return;
|
|
9302
|
+
self._adoptWorkerIndexingPasses(0, false, true);
|
|
9303
|
+
self._settleByListing();
|
|
9304
|
+
self._refreshPageProgress();
|
|
9305
|
+
self._ensureAdoptTick();
|
|
9306
|
+
}, wait);
|
|
9307
|
+
}
|
|
9063
9308
|
_ensureAdoptTick() {
|
|
9064
9309
|
if (this._adoptTickTimer) return;
|
|
9065
9310
|
var self = this;
|
|
@@ -9080,7 +9325,7 @@ var _ChatSession = class _ChatSession {
|
|
|
9080
9325
|
self._settleByListing();
|
|
9081
9326
|
self._refreshPageProgress();
|
|
9082
9327
|
self._ensureAdoptTick();
|
|
9083
|
-
}, ADOPT_TICK_MS);
|
|
9328
|
+
}, statusPushLive() ? STATUS_PUSH_ADOPT_TICK_MS : ADOPT_TICK_MS);
|
|
9084
9329
|
}
|
|
9085
9330
|
/**
|
|
9086
9331
|
* Follow an indexing pass found in a loaded history page through the queue check
|
|
@@ -9162,12 +9407,8 @@ var _ChatSession = class _ChatSession {
|
|
|
9162
9407
|
this.state.messages.splice(idx + 1, 0, placeholder);
|
|
9163
9408
|
return true;
|
|
9164
9409
|
}
|
|
9165
|
-
/**
|
|
9166
|
-
* Save where a hard search found its answer (findings.ts), through the host's
|
|
9167
|
-
* saveSearchFinding hook. Never for an indexing pass, never twice for one turn, never
|
|
9168
|
-
* throws, never waited on.
|
|
9169
|
-
*/
|
|
9170
9410
|
_saveFindings(itemId, body, answer, note) {
|
|
9411
|
+
if (!_ChatSession.SAVE_SEARCH_FINDINGS) return;
|
|
9171
9412
|
try {
|
|
9172
9413
|
var save = chatEngineConfig().saveSearchFinding;
|
|
9173
9414
|
if (typeof save !== "function" || !note || !body) return;
|
|
@@ -9696,6 +9937,7 @@ var _ChatSession = class _ChatSession {
|
|
|
9696
9937
|
var id = this.host.getIdentity();
|
|
9697
9938
|
var svcId = id.projectId, plat = id.platform;
|
|
9698
9939
|
if (!svcId || plat === "none" || !this.host.isViewMounted()) return;
|
|
9940
|
+
this._ensureReturnWatch();
|
|
9699
9941
|
this._applyIndexCancellations();
|
|
9700
9942
|
this._sweepCancelledIndexing();
|
|
9701
9943
|
this._ensureAdoptTick();
|
|
@@ -9764,6 +10006,11 @@ var _ChatSession = class _ChatSession {
|
|
|
9764
10006
|
var executedAt;
|
|
9765
10007
|
var bp = entry2.poll({
|
|
9766
10008
|
latency: POLL_INTERVAL,
|
|
10009
|
+
// Status push (statusPushEnabled): a pass adopted from a listing is polled
|
|
10010
|
+
// slowly while frames arrive, like one this page dispatched. A dispatch
|
|
10011
|
+
// reply's poll decides that from the server's acknowledgement and
|
|
10012
|
+
// ignores this key.
|
|
10013
|
+
notify: statusPushEnabled(),
|
|
9767
10014
|
onResponse: function(_res, meta) {
|
|
9768
10015
|
if (meta && typeof meta.executed === "number" && meta.executed > 0) executedAt = meta.executed;
|
|
9769
10016
|
}
|
|
@@ -10412,7 +10659,7 @@ var _ChatSession = class _ChatSession {
|
|
|
10412
10659
|
}
|
|
10413
10660
|
}
|
|
10414
10661
|
};
|
|
10415
|
-
var pp = isBg ? item.poll(Object.assign({ latency: POLL_INTERVAL }, pollOpts)) : self._fgPollWithEarlyProbe(item, capturedId, pollOpts, {
|
|
10662
|
+
var pp = isBg ? item.poll(Object.assign({ latency: POLL_INTERVAL, notify: statusPushEnabled() }, pollOpts)) : self._fgPollWithEarlyProbe(item, capturedId, pollOpts, {
|
|
10416
10663
|
platform,
|
|
10417
10664
|
projectId,
|
|
10418
10665
|
owner,
|
|
@@ -10759,10 +11006,21 @@ var _ChatSession = class _ChatSession {
|
|
|
10759
11006
|
this.state.gateRefreshToken += 1;
|
|
10760
11007
|
}
|
|
10761
11008
|
};
|
|
11009
|
+
/**
|
|
11010
|
+
* Save where a hard search found its answer (findings.ts), through the host's
|
|
11011
|
+
* saveSearchFinding hook. Never for an indexing pass, never twice for one turn, never
|
|
11012
|
+
* throws, never waited on.
|
|
11013
|
+
*
|
|
11014
|
+
* OFF since 1.20.1 (owner, 2026-11-24): the MCP's searchText now learns which page answered
|
|
11015
|
+
* a question by itself (learned links, read first by every search), so the chat no longer
|
|
11016
|
+
* reads "search_findings" first (that read cost 7 to 8 s at the start of every turn in
|
|
11017
|
+
* production) and nothing is saved here. SAVE_SEARCH_FINDINGS turns it back on.
|
|
11018
|
+
*/
|
|
11019
|
+
_ChatSession.SAVE_SEARCH_FINDINGS = false;
|
|
10762
11020
|
/** How many passes one "Load more" brings into a file's row. */
|
|
10763
11021
|
_ChatSession.RUN_PASS_PAGE = 10;
|
|
10764
11022
|
var ChatSession = _ChatSession;
|
|
10765
11023
|
|
|
10766
|
-
export { ANSWER_MODES, ANSWER_MODE_HINTS, ANSWER_MODE_LABELS, ANSWER_MODE_OPTIONS, ANSWER_MODE_SETTING_LABEL, BG_INDEXING_QUEUE_SUFFIX, BOM, BOM_EXTS, CHAT_GREETING_MAX_LENGTH, CLAUDE_INPUT_CAP_RATIO, CLAUDE_PER_REQUEST_INPUT_CAP, CONTEXT_WINDOW_BY_MODEL, CONTEXT_WINDOW_DEFAULT, ChatSession, DATA_TOOL_NAMES, DEFAULT_ANSWER_MODE, DEFAULT_CLAUDE_MODEL, DEFAULT_CONTEXT_WINDOW, DEFAULT_OPENAI_MODEL, DEFAULT_SKIP_DUPLICATE_FILES, DEFAULT_UPLOAD_ACCESS_GROUP, DEFAULT_WEB_ACCESS, DUPLICATE_LOOKUP_LIMIT, DUPLICATE_LOOKUP_MAX_CANDIDATES, DUPLICATE_LOOKUP_TIMEOUT_MS, EMPTY_INDEXING_REPLY, EXPIRED_ATTACHMENT_URL_HOST, EXPIRED_ATTACHMENT_URL_ORIGIN, EXPIRED_LINK_REFRESH_EXPIRES_SECONDS, EXT_CONTENT_TYPES, FINDINGS_TABLE, FINDING_ID_PREFIX, HISTORY_BUDGET_RATIO, HISTORY_FILL_SLACK_PX, HISTORY_TOKEN_BUDGET, HTML_EXTS, HTML_HEAD_WINDOW, IMAGE_PREVIEWS_PER_MESSAGE, INDEXING_COMPLETE_MARKER, INDEXING_MAX_OUTPUT_TOKENS, INLINE_LINK_GLYPH, INLINE_LINK_UNAVAILABLE_GLYPH, INLINE_LINK_UNAVAILABLE_SUFFIX, INPUT_CAP_RATIO, LINK_LABEL_MAX_DISPLAY_CHARS, LINK_REFRESH_WINDOW_MS, MAX_CONCURRENT_BG_POLLS, MAX_HISTORY_FILL_PAGES, MAX_HISTORY_MESSAGES, MAX_OUTPUT_BY_MODEL, MAX_OUTPUT_TOKENS, MAX_PARSED_CONTENT_CHARS, MCP_NAME, MINT_CACHE_GENERATION, MIN_INPUT_TOKEN_BUDGET, MIN_PER_REQUEST_INPUT_CAP, NO_DATA_TOOL_MARK, OUTPUT_TOKEN_RESERVE, PAGE_TEXT_TABLE, POLL_INTERVAL, PRESIGN_SAFETY_MARGIN_MS, PREVIEWABLE_IMAGE_CONTENT_TYPES, PREVIEW_BROWSER_CACHE_SECONDS, PREVIEW_LAYOUT_BOX_SELECTOR, PREVIEW_URL_EXPIRES_SECONDS, PROJECT_SETTINGS_ACCESS_GROUP, PROJECT_SETTINGS_TABLE, PROJECT_SETTINGS_UNIQUE_ID, RENDER_FROM_TOKEN, RETRIEVAL_NOTES_MAX, RETRIEVAL_NOTES_TOKEN_BUDGET, RETRIEVAL_NOTE_MAX_CHARS, RETRIEVAL_NOTE_MAX_ITEMS, RETRIEVAL_NOTE_PREFIX, RTF_EXTS, RUN_RECORD_WORKING_STALE_MS, STREAM_POLL_INTERVAL, TOOL_AND_RESPONSE_BUFFER, UPLOAD_ACCESS_GROUPS, UPLOAD_ACCESS_HINTS, UPLOAD_ACCESS_LABELS, UPLOAD_ACCESS_OPTIONS, XML_EXTS, __resetSplitHistoryState, accessSettingFrom, adoptLocalAnswerIntoPage, answerModeFrom, answerUsedNoDataTool, applyEncodingDeclaration, applyRetrievalNotes, asksUploadAccessFrom, bgIndexingQueueName, buildAiAgentValue, buildBoundedChatMessages, buildChatDisplayList, buildChatGreeting, buildChatSystemPrompt, buildDisplayExpiredAttachmentHref, buildHistoryItemFullId, buildIndexingContinueMessage, buildIndexingRenderContinueTemplate, buildIndexingRenderMessage, buildIndexingSystemPrompt, buildIndexingUserMessage, buildIndexingWindowMessage, cachedProjectSettings, callClaudeWithMcp, callClaudeWithPublicMcp, callOpenAIWithPublicMcp, canonicalizePathForm, chatCacheKey, chatEffortFields, chatEngineConfig, chatGreetingFrom, chatStreamWiring, citationFileName, citationLinkPart, citationsFor, classifyInlineLink, clearAttachmentParsers, clearImagePreviewCache, clearProjectSettings, composeUserMessage, configureChatEngine, configureProjectSettings, contentTypeForExt, createHistoryFiller, createInlineLinkRegex, createScrollAnchor, createSseParser, csrEnvelopeError, encodePathSegments, encodingClassForExt, ensureHtmlCharset, ensureXmlEncoding, escapeInlineHtml, escapeRtfNonAscii, estimateMessageTokens, estimateTextTokens, extOf, extractClaudeText, extractLastUserTextFromRequest, extractOpenAIText, extractRemotePathFromAttachmentHref, extractRetrievalNote, fetchLiveIndexingKeys, fillHistoryViewport, filterListByClearHorizon, findAttachmentParser, findDuplicateUpload, keyWords as findingKeyWords, findingsForTurn, formatChatTimestamp, formatDuration, formatRetrievalNote, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isDataToolName, isDuplicateCandidateId, isErrorResponseBody, isHttpUrlLike, isImageVisionFile, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPagedReadFile, isPreviewableImagePath, isProviderApiKeyError, isRetriedFailure, isRetrievalNote, isServerExtractable, isServiceDbAttachmentHref, isWindowedReadFile, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAnswerMode, normalizeAttachmentPathCandidate, normalizeChatGreeting, normalizeExt, normalizeProjectAccessSetting, normalizeSkipDuplicateFiles, normalizeStoredPathTarget, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, normalizeWebAccess, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAnswerMode, projectAsksUploadAccess, projectChatGreeting, projectSettingsSettled, projectSkipDuplicateFiles, projectUploadAccessGroup, projectWebAccess, providerBodyWasRead, readExpiredAttachmentHref, readyProjectSettings, registerAttachmentParser, registerModelContextWindows, renderInlineLinkHtml, repairUrlEntities, repairUrlWhitespace, resetFileIndexOnServer, resolveAnswerMode, resolveImagePreviewUrl, resolveSkipDuplicateFiles, resolveWebAccess, retrievalNoteFromText, retrievalNoteOfAnswer, runIndexUniqueId, safeDecodeURIComponent, sanitizeAttachmentLinksForHistory, setProjectContextWindow, setProjectSettings, shouldRescueInFlightMessage, skapiSupportsStreaming, skipDuplicateFilesEnabled, skipDuplicateFilesFrom, streamRecoveryEnabled, streamRecoveryLabels, streamRecoveryPhase, stripFileBlocksFromHistory, transformContentWithImages, transformContentWithOpenAIImages, truncateLabelForDisplay, typewriterResumeIndex, uploadAccessGroupFrom, upsertIndexRunRecordSafe, wallClockNow, webAccessEnabled, webAccessFrom };
|
|
11024
|
+
export { ANSWER_MODES, ANSWER_MODE_HINTS, ANSWER_MODE_LABELS, ANSWER_MODE_OPTIONS, ANSWER_MODE_SETTING_LABEL, BG_INDEXING_QUEUE_SUFFIX, BOM, BOM_EXTS, CHAT_GREETING_MAX_LENGTH, CLAUDE_INPUT_CAP_RATIO, CLAUDE_PER_REQUEST_INPUT_CAP, CONTEXT_WINDOW_BY_MODEL, CONTEXT_WINDOW_DEFAULT, ChatSession, DATA_TOOL_NAMES, DEFAULT_ANSWER_MODE, DEFAULT_CLAUDE_MODEL, DEFAULT_CONTEXT_WINDOW, DEFAULT_OPENAI_MODEL, DEFAULT_SKIP_DUPLICATE_FILES, DEFAULT_UPLOAD_ACCESS_GROUP, DEFAULT_WEB_ACCESS, DUPLICATE_LOOKUP_LIMIT, DUPLICATE_LOOKUP_MAX_CANDIDATES, DUPLICATE_LOOKUP_TIMEOUT_MS, EMPTY_INDEXING_REPLY, EXPIRED_ATTACHMENT_URL_HOST, EXPIRED_ATTACHMENT_URL_ORIGIN, EXPIRED_LINK_REFRESH_EXPIRES_SECONDS, EXT_CONTENT_TYPES, FINDINGS_TABLE, FINDING_ID_PREFIX, HISTORY_BUDGET_RATIO, HISTORY_FILL_SLACK_PX, HISTORY_TOKEN_BUDGET, HTML_EXTS, HTML_HEAD_WINDOW, IMAGE_PREVIEWS_PER_MESSAGE, INDEXING_COMPLETE_MARKER, INDEXING_MAX_OUTPUT_TOKENS, INLINE_LINK_GLYPH, INLINE_LINK_UNAVAILABLE_GLYPH, INLINE_LINK_UNAVAILABLE_SUFFIX, INPUT_CAP_RATIO, LINK_LABEL_MAX_DISPLAY_CHARS, LINK_REFRESH_WINDOW_MS, MAX_CONCURRENT_BG_POLLS, MAX_HISTORY_FILL_PAGES, MAX_HISTORY_MESSAGES, MAX_OUTPUT_BY_MODEL, MAX_OUTPUT_TOKENS, MAX_PARSED_CONTENT_CHARS, MCP_NAME, MINT_CACHE_GENERATION, MIN_INPUT_TOKEN_BUDGET, MIN_PER_REQUEST_INPUT_CAP, NO_DATA_TOOL_MARK, OUTPUT_TOKEN_RESERVE, PAGE_TEXT_TABLE, POLL_INTERVAL, PRESIGN_SAFETY_MARGIN_MS, PREVIEWABLE_IMAGE_CONTENT_TYPES, PREVIEW_BROWSER_CACHE_SECONDS, PREVIEW_LAYOUT_BOX_SELECTOR, PREVIEW_URL_EXPIRES_SECONDS, PROJECT_SETTINGS_ACCESS_GROUP, PROJECT_SETTINGS_TABLE, PROJECT_SETTINGS_UNIQUE_ID, RENDER_FROM_TOKEN, RETRIEVAL_NOTES_MAX, RETRIEVAL_NOTES_TOKEN_BUDGET, RETRIEVAL_NOTE_MAX_CHARS, RETRIEVAL_NOTE_MAX_ITEMS, RETRIEVAL_NOTE_PREFIX, RTF_EXTS, RUN_RECORD_WORKING_STALE_MS, STREAM_POLL_INTERVAL, TOOL_AND_RESPONSE_BUFFER, UPLOAD_ACCESS_GROUPS, UPLOAD_ACCESS_HINTS, UPLOAD_ACCESS_LABELS, UPLOAD_ACCESS_OPTIONS, XML_EXTS, __resetSplitHistoryState, accessSettingFrom, adoptLocalAnswerIntoPage, answerModeFrom, answerUsedNoDataTool, applyEncodingDeclaration, applyRetrievalNotes, asksUploadAccessFrom, bgIndexingQueueName, buildAiAgentValue, buildBoundedChatMessages, buildChatDisplayList, buildChatGreeting, buildChatSystemPrompt, buildDisplayExpiredAttachmentHref, buildHistoryItemFullId, buildIndexingContinueMessage, buildIndexingRenderContinueTemplate, buildIndexingRenderMessage, buildIndexingSystemPrompt, buildIndexingUserMessage, buildIndexingWindowMessage, cachedProjectSettings, callClaudeWithMcp, callClaudeWithPublicMcp, callOpenAIWithPublicMcp, canonicalizePathForm, chatCacheKey, chatEffortFields, chatEngineConfig, chatGreetingFrom, chatStreamWiring, citationFileName, citationLinkPart, citationsFor, classifyInlineLink, clearAttachmentParsers, clearImagePreviewCache, clearProjectSettings, composeUserMessage, configureChatEngine, configureProjectSettings, contentTypeForExt, createHistoryFiller, createInlineLinkRegex, createScrollAnchor, createSseParser, csrEnvelopeError, encodePathSegments, encodingClassForExt, ensureHtmlCharset, ensureXmlEncoding, escapeInlineHtml, escapeRtfNonAscii, estimateMessageTokens, estimateTextTokens, extOf, extractClaudeText, extractLastUserTextFromRequest, extractOpenAIText, extractRemotePathFromAttachmentHref, extractRetrievalNote, fetchLiveIndexingKeys, fillHistoryViewport, filterListByClearHorizon, findAttachmentParser, findDuplicateUpload, keyWords as findingKeyWords, findingsForTurn, formatChatTimestamp, formatDuration, formatRetrievalNote, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isDataToolName, isDuplicateCandidateId, isErrorResponseBody, isHttpUrlLike, isImageVisionFile, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPagedReadFile, isPreviewableImagePath, isProviderApiKeyError, isRetriedFailure, isRetrievalNote, isServerExtractable, isServiceDbAttachmentHref, isWindowedReadFile, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAnswerMode, normalizeAttachmentPathCandidate, normalizeChatGreeting, normalizeExt, normalizeProjectAccessSetting, normalizeSkipDuplicateFiles, normalizeStoredPathTarget, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, normalizeWebAccess, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAnswerMode, projectAsksUploadAccess, projectChatGreeting, projectSettingsSettled, projectSkipDuplicateFiles, projectUploadAccessGroup, projectWebAccess, providerBodyWasRead, readExpiredAttachmentHref, readyProjectSettings, registerAttachmentParser, registerModelContextWindows, renderInlineLinkHtml, repairUrlEntities, repairUrlWhitespace, resetFileIndexOnServer, resolveAnswerMode, resolveImagePreviewUrl, resolveSkipDuplicateFiles, resolveWebAccess, retrievalNoteFromText, retrievalNoteOfAnswer, runIndexUniqueId, safeDecodeURIComponent, sanitizeAttachmentLinksForHistory, setProjectContextWindow, setProjectSettings, shouldRescueInFlightMessage, skapiSupportsStreaming, skipDuplicateFilesEnabled, skipDuplicateFilesFrom, statusPushEnabled, statusPushLive, streamRecoveryEnabled, streamRecoveryLabels, streamRecoveryPhase, stripFileBlocksFromHistory, transformContentWithImages, transformContentWithOpenAIImages, truncateLabelForDisplay, typewriterResumeIndex, uploadAccessGroupFrom, upsertIndexRunRecordSafe, wallClockNow, webAccessEnabled, webAccessFrom };
|
|
10767
11025
|
//# sourceMappingURL=engine.mjs.map
|
|
10768
11026
|
//# sourceMappingURL=engine.mjs.map
|