bunnyquery 1.21.7 → 1.21.13

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/engine.cjs CHANGED
@@ -80,6 +80,14 @@ function normalizeSkipDuplicateFiles(value) {
80
80
  function skipDuplicateFilesFrom(data) {
81
81
  return data ? normalizeSkipDuplicateFiles(data.skip_duplicate_files) : DEFAULT_SKIP_DUPLICATE_FILES;
82
82
  }
83
+ var SHARE_IDENTICAL_FILES_KEY = "share_identical_files";
84
+ var DEFAULT_SHARE_IDENTICAL_FILES = true;
85
+ function normalizeShareIdenticalFiles(value) {
86
+ return value !== false;
87
+ }
88
+ function shareIdenticalFilesFrom(data) {
89
+ return data ? normalizeShareIdenticalFiles(data.share_identical_files) : DEFAULT_SHARE_IDENTICAL_FILES;
90
+ }
83
91
  var ANSWER_MODES = ["standard", "fast", "thorough"];
84
92
  var DEFAULT_ANSWER_MODE = "standard";
85
93
  var ANSWER_MODE_SETTING_LABEL = "Answer mode";
@@ -193,6 +201,9 @@ function projectWebAccess(service) {
193
201
  function projectSkipDuplicateFiles(service) {
194
202
  return skipDuplicateFilesFrom(cachedProjectSettings(service));
195
203
  }
204
+ function projectShareIdenticalFiles(service) {
205
+ return shareIdenticalFilesFrom(cachedProjectSettings(service));
206
+ }
196
207
  function projectAnswerMode(service) {
197
208
  return answerModeFrom(cachedProjectSettings(service));
198
209
  }
@@ -1065,8 +1076,9 @@ function buildChatSystemPrompt(params) {
1065
1076
  const indexGroupLiteral = typeof g === "number" ? String(g) : g === "public" || g === "private" || g === "authorized" || g === "admin" ? `"${g}"` : '"authorized"';
1066
1077
  const reindexHint = canUpload === false ? `asking the project's owner to re-index that file` : client === "console" ? `re-indexing that file (select it on the Files page and choose Reindex)` : `re-indexing that file (attach the same file again and choose to reindex it)`;
1067
1078
  const groundingRules = `ANSWER ONLY FROM THE DATA. Every fact you state about this project's data - a name, a number, a date, a status, what a document says, whether something exists - must come from one of four places: a tool result returned in THIS conversation, a file or image attached to it (including one you read through its attachment link), the project description at the end of this prompt, or what the user told you themselves in this chat. Your general knowledge, the open internet and a plausible guess are NOT sources. Never use them to answer a question about the user's data, to fill a gap in it, or to complete a record that came back partial. A value that is not in what you retrieved is unknown: say it is not in the data instead of supplying a likely one.
1068
- WHEN THE DATA DOES NOT HAVE IT, SAY SO. Once you have searched the way these rules require and nothing answers the question, tell the user plainly, in their language, that this project's data does not contain it, and say what you searched (the tables, files or terms) so they can tell missing data from a missed search. Do not answer from memory instead, and do not turn a missing answer into a general explanation of the topic. Offer what would let you answer it: ${canUpload === false ? `another name or file to look under, or asking the project's owner to add it` : `the document to upload, or another name or file to look under`}.
1069
- A CODE, NUMBER OR PHRASE THAT searchText DID NOT FIND: when it answers search_complete with no hit, and what its message says was NOT searched has been checked as it says (the skipped_without_page_text files, the records when the value could be in a table), keep the answer short: say plainly that it was not found, name what was searched (the file, and its pages when you searched only some of them, or files_searched files and total_pages_searched pages), and when a recently uploaded file or a photo should hold it, suggest ${reindexHint}, since small or handwritten characters can be misread at indexing. Never present a different file as the match, and never guess the value.
1079
+ FILES IN ANOTHER LANGUAGE. The files may be written in another language than the question (a Russian or English manual asked about in Korean). When searches in the question's language find nothing, or searchText reports query_language_mismatch, search again with the question's key terms translated into the language the files are written in (their names, titles and earlier hits show it): one or two short queries of the main terms (e.g. "oil leak", "gearbox"), before concluding anything.
1080
+ WHEN THE DATA DOES NOT HAVE IT, SAY SO. Once you have searched the way these rules require (in the files' language too) and nothing answers the question, tell the user plainly, in their language, that this project's data does not contain it, and say what you searched (the tables, files or terms) so they can tell missing data from a missed search. Do not answer from memory instead, and do not turn a missing answer into a general explanation of the topic. Offer what would let you answer it: ${canUpload === false ? `another name or file to look under, or asking the project's owner to add it` : `the document to upload, or another name or file to look under`}.
1081
+ A CODE, NUMBER OR EXACT QUOTE THAT searchText DID NOT FIND (an identifier or a quote, not a topic or how-to question, which follows FILES IN ANOTHER LANGUAGE first): when it answers search_complete with no hit, and what its message says was NOT searched has been checked as it says (the skipped_without_page_text files; the records ONLY when the value could be a spreadsheet cell or a row, and then with ONE filtered getRecords on that value, never by paging through a whole table), keep the answer short. The text read from photos, scans and other images IS in the page text searchText covered, so a code, serial or phrase asked about a photo needs no records read: say plainly that it was not found, name what was searched (the file, and its pages when you searched only some of them, or files_searched files and total_pages_searched pages), and when a recently uploaded file or a photo should hold it, suggest ${reindexHint}, since small or handwritten characters can be misread at indexing. Never present a different file as the match, and never guess the value.
1070
1082
  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.
1071
1083
  These 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.`;
1072
1084
  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.`;
@@ -1085,6 +1097,7 @@ NUMBERS FROM A SPREADSHEET are computed from the ROWS, never from one page and n
1085
1097
  ${documentRules}
1086
1098
  ${accessGroupRule}
1087
1099
  COMPLETE ANSWERS: ONE file is routinely SPLIT ACROSS SEVERAL TABLES (a summary row in one, its page or row content in another, its extracted pictures in "__MEDIA__"), so for anything not scoped to a single file run the query in EVERY table that could hold the answer and combine the results. For any request that counts, sums, totals, lists every match, compares across records, finds which one, or asks whether something is present or ABSENT (for example "how many", "total spent", "which card", "is there any", "\uC5C6\uC5B4?", "\uD558\uB098\uB3C4 \uC5C6\uB098?"), read the COMPLETE matching set across every such table and file before answering. Never assert absence ("there is no X", "none", "not found", "\uC544\uB2C8\uC694, \uC5C6\uC2B5\uB2C8\uB2E4") until a complete scan has come back empty: a confident "no" that later turns out wrong is worse than telling the user you are still checking. If you answered from one table and then find another holds more, re-run the sweep and give the complete answer instead of only apologising.
1100
+ LINKED COPIES: files with the same content are indexed once. A file a tool reports as a linked copy (linked_copy, or listed in a hit's also_at) has no rows or pages of its own: its content is the original's, stored and tagged under the original's name. Cite the original file and say that the copy is the same file; never count the two as two documents.
1088
1101
  Embedded values: a search term is often stored inside a larger string (a merchant "BAKSA" as "DNH*BAKSA#4070277042", a card as "5860****5173"), which no index or tag filter matches. When the value may be embedded, fetch the full set with fetch_all and match the substring yourself.
1089
1102
  File attachments: an "Attached files:" section with markdown links in a user message points at short-lived signed URLs in this project's storage. Image files (.jpg, .jpeg, .png, .gif, .webp) are ALREADY in the message as image blocks: look at them directly. Every other attached file (office documents such as .docx/.xlsx/.pptx/.hwp/.hwpx/.ods, PDFs, email (.eml), text/data/code files such as .csv/.tsv/.json/.xml/.txt/.md) is ALREADY INDEXED: it was read end to end when it was uploaded, before this message reached you, so answer from its records (reference "src::<the storage path from the attachment link>"), and for its exact wording use searchText or readFileContent on that same path (see DOCUMENTS). Some turns instead carry the file text between "BEGIN FILE CONTENT" / "END FILE CONTENT" markers: read that block directly; a "[skapi: ...]" note inside it means that file could not be extracted. ${webAccess ? `Never web_fetch an attachment link (the picture is already in the message, everything else is in the database); a file the user gives as an outside web address may be fetched under the web rule above.` : `This chat has no web tool: never try to download or fetch an attachment link.`}
1090
1103
  Stored files: a file already in this project's storage was read end to end at upload time, so its records come first. For its exact wording find the page with searchText (DOCUMENTS); readFileContent re-reads the raw file (an older file without page text, a data file), and you read it to the end before concluding anything is absent there. If its pictures do not reach you, say so plainly and fall back to the indexed records; never call a file unreadable when its content is in the database.
@@ -2895,12 +2908,14 @@ async function notifyAgentSaveAttachment(info) {
2895
2908
  const singlePass = !visionFile && !windowedRead && !pagedRead && !continuing;
2896
2909
  const imageFile = singlePass && !parsedContent && !serverExtract ? indexingImageFile(attachment) : void 0;
2897
2910
  const fileUrlDetail = imageFile && platform === "openai" ? getOpenAIImageDetail(info.model || DEFAULT_OPENAI_MODEL) : void 0;
2911
+ const shareIdentical = !continuing && info.shareIdentical !== false && (info.shareIdentical === true || projectShareIdenticalFiles(service));
2898
2912
  const skapiFileUrls = attachment.url && attachment.storagePath ? {
2899
2913
  _skapi_file_urls: [{
2900
2914
  path: attachment.storagePath,
2901
2915
  url: attachment.url,
2902
2916
  ...singlePass ? { index_end: true } : {},
2903
- ...fileUrlDetail ? { detail: fileUrlDetail } : {}
2917
+ ...fileUrlDetail ? { detail: fileUrlDetail } : {},
2918
+ ...shareIdentical ? { share_identical: true } : {}
2904
2919
  }]
2905
2920
  } : {};
2906
2921
  const userMessage = visionFile && renderPlaceholder ? buildIndexingRenderMessage(attachment, renderPlaceholder, renderFrom) : windowedRead && windowPlaceholder ? buildIndexingWindowMessage(attachment, windowPlaceholder, false) : continuing ? buildIndexingContinueMessage(attachment) : buildIndexingUserMessage(
@@ -3027,13 +3042,26 @@ async function notifyAgentSaveAttachment(info) {
3027
3042
  }
3028
3043
  }));
3029
3044
  }
3045
+ function providerDocument(response) {
3046
+ if (typeof response !== "string") return response;
3047
+ var t = response.trim();
3048
+ if (t.charAt(0) !== "{" || t.charAt(t.length - 1) !== "}") return response;
3049
+ try {
3050
+ var doc = JSON.parse(t);
3051
+ return doc && typeof doc === "object" && !Array.isArray(doc) ? doc : response;
3052
+ } catch (e) {
3053
+ return response;
3054
+ }
3055
+ }
3030
3056
  function extractClaudeText(response) {
3057
+ response = providerDocument(response);
3031
3058
  if (!Array.isArray(response?.content)) {
3032
3059
  return "";
3033
3060
  }
3034
3061
  return response.content.filter((block) => block?.type === "text").map((block) => block.text).join("\n");
3035
3062
  }
3036
3063
  function extractOpenAIText(response) {
3064
+ response = providerDocument(response);
3037
3065
  if (typeof response?.output_text === "string" && response.output_text.length) {
3038
3066
  return response.output_text;
3039
3067
  }
@@ -3235,6 +3263,311 @@ function messageTimeMs(m) {
3235
3263
  return typeof m._ts === "number" && m._ts > 0 ? m._ts : 0;
3236
3264
  }
3237
3265
 
3266
+ // src/engine/identical.ts
3267
+ var LINKED_COPY_TAG = "bq_linked";
3268
+ var CONTENT_CLAIM_PREFIX = "cas::";
3269
+ function linkedMarkerOf(data) {
3270
+ if (!data || typeof data !== "object" || data.linked !== true) return null;
3271
+ var original = typeof data.alias_of === "string" ? data.alias_of : "";
3272
+ if (!original) return null;
3273
+ var at = Number(data.completed_at || data.finished || data.linked_at);
3274
+ return {
3275
+ original,
3276
+ claim: typeof data.alias_claim === "string" && data.alias_claim ? data.alias_claim : void 0,
3277
+ linkedAt: isFinite(at) && at > 0 ? at : void 0,
3278
+ group: data.copy_group !== void 0 ? data.copy_group : void 0,
3279
+ owner: typeof data.copy_owner === "string" ? data.copy_owner : void 0,
3280
+ contentKey: typeof data.content_key === "string" && data.content_key ? data.content_key : void 0
3281
+ };
3282
+ }
3283
+ function fileNameOf(path) {
3284
+ var s = String(path || "");
3285
+ var at = s.lastIndexOf("/");
3286
+ return at === -1 ? s : s.slice(at + 1);
3287
+ }
3288
+ function copyStatusOf(marker, original, liveClaims) {
3289
+ var name = fileNameOf(marker.original);
3290
+ var mk = function(kind, label, title, broken) {
3291
+ return { kind, original: marker.original, label, title, broken };
3292
+ };
3293
+ var o = original || {};
3294
+ var claimGone = !!(liveClaims && marker.claim && !liveClaims.has(marker.claim));
3295
+ if (o.done && o.contentKey && marker.contentKey && o.contentKey !== marker.contentKey && o.run !== "working") {
3296
+ return mk(
3297
+ "original_removed",
3298
+ "Original removed or failed",
3299
+ 'Linked to "' + name + '", which now holds other content. Reindex this file to index it on its own.',
3300
+ true
3301
+ );
3302
+ }
3303
+ if (claimGone && !(o.run === "working")) {
3304
+ return mk(
3305
+ "original_removed",
3306
+ "Original removed or failed",
3307
+ 'Linked to "' + name + '", which is no longer indexed. Reindex this file to index it on its own.',
3308
+ true
3309
+ );
3310
+ }
3311
+ if (o.run === "error" || o.run === "cancelled") {
3312
+ return mk(
3313
+ "original_failed",
3314
+ "Original removed or failed",
3315
+ 'Linked to "' + name + '", whose indexing did not finish. Reindex this file to index it on its own.',
3316
+ true
3317
+ );
3318
+ }
3319
+ if (o.run === "working" && !o.done) {
3320
+ return mk(
3321
+ "waiting",
3322
+ "Waiting for " + name,
3323
+ 'Same content as "' + name + '", which is still being indexed. This file shares its index when it finishes.',
3324
+ false
3325
+ );
3326
+ }
3327
+ if (!o.done && o.run !== "done" && liveClaims && !marker.claim) {
3328
+ return mk(
3329
+ "original_removed",
3330
+ "Original removed or failed",
3331
+ 'Linked to "' + name + '", which is no longer indexed. Reindex this file to index it on its own.',
3332
+ true
3333
+ );
3334
+ }
3335
+ return mk(
3336
+ "linked",
3337
+ "Indexed via " + name,
3338
+ 'Same content as "' + name + '"; search and totals count it once.',
3339
+ false
3340
+ );
3341
+ }
3342
+ function copyCountLabel(n) {
3343
+ return n === 1 ? "1 copy" : n + " copies";
3344
+ }
3345
+ function copyCountTitle(copies) {
3346
+ var list = copies.slice(0, 10).map(function(p) {
3347
+ return "/" + p;
3348
+ }).join("\n");
3349
+ var more = copies.length > 10 ? "\n...and " + (copies.length - 10) + " more" : "";
3350
+ return "The same content is also stored as:\n" + list + more + "\nThey share this file's index; search and totals count it once.";
3351
+ }
3352
+ function copiesByOriginal(linked) {
3353
+ var entries = linked instanceof Map ? Array.from(linked.entries()) : Object.keys(linked).map(function(k) {
3354
+ return [k, linked[k]];
3355
+ });
3356
+ entries.sort(function(a, b) {
3357
+ return (a[1].linkedAt || 0) - (b[1].linkedAt || 0) || (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0);
3358
+ });
3359
+ var out = /* @__PURE__ */ new Map();
3360
+ for (var i = 0; i < entries.length; i++) {
3361
+ var o = entries[i][1].original;
3362
+ if (!out.has(o)) out.set(o, []);
3363
+ out.get(o).push(entries[i][0]);
3364
+ }
3365
+ return out;
3366
+ }
3367
+ function formatLinkDuration(ms) {
3368
+ if (typeof ms !== "number" || !isFinite(ms) || ms < 0) return "";
3369
+ if (ms < 1e4) return (Math.max(ms, 100) / 1e3).toFixed(1) + " s";
3370
+ return formatIndexDuration(ms);
3371
+ }
3372
+ function linkedRowLabel(original, ms) {
3373
+ var took = formatLinkDuration(ms);
3374
+ return "Same content as " + fileNameOf(original) + ": linked" + (took ? " in " + took : "") + ", no AI used";
3375
+ }
3376
+ function parseLinkedReply(text) {
3377
+ if (typeof text !== "string" || text.indexOf('[skapi] Same content as "') === -1) return null;
3378
+ var m = /\[skapi\] Same content as "([^"]+)": linked to its index(?: in ([0-9]+(?:\.[0-9]+)?) s)?/.exec(text);
3379
+ if (!m) return null;
3380
+ var secs = m[2] !== void 0 ? Number(m[2]) : NaN;
3381
+ return { original: m[1], ms: isFinite(secs) ? Math.round(secs * 1e3) : void 0 };
3382
+ }
3383
+ function promotableCopies(linked, actor) {
3384
+ var entries = linked instanceof Map ? Array.from(linked.entries()) : Object.keys(linked).map(function(k) {
3385
+ return [k, linked[k]];
3386
+ });
3387
+ var out = /* @__PURE__ */ new Map();
3388
+ for (var i = 0; i < entries.length; i++) {
3389
+ var m = entries[i][1];
3390
+ if (actor.isProjectOwner || !!actor.userId && !!m && m.owner === actor.userId) out.set(entries[i][0], m);
3391
+ }
3392
+ return out;
3393
+ }
3394
+ function copiesToPromote(linked, removed, removedFolders, actor) {
3395
+ if (actor) linked = promotableCopies(linked, actor);
3396
+ var gone = new Set(removed || []);
3397
+ var folders = (removedFolders || []).filter(Boolean).map(function(f) {
3398
+ return f.replace(/\/+$/, "") + "/";
3399
+ });
3400
+ var isGone = function(p) {
3401
+ if (gone.has(p)) return true;
3402
+ for (var i = 0; i < folders.length; i++) if (p.indexOf(folders[i]) === 0) return true;
3403
+ return false;
3404
+ };
3405
+ var out = [];
3406
+ copiesByOriginal(linked).forEach(function(copies, original) {
3407
+ if (!isGone(original)) return;
3408
+ var keep = copies.filter(function(c) {
3409
+ return !isGone(c);
3410
+ });
3411
+ if (keep.length) out.push({ original, copies: keep });
3412
+ });
3413
+ return out;
3414
+ }
3415
+ function listOf(res) {
3416
+ return res && Array.isArray(res.list) ? res.list : [];
3417
+ }
3418
+ async function listContentClaims(skapi, service, maxPages = 5) {
3419
+ if (!skapi || typeof skapi.getUniqueId !== "function" || !service) return null;
3420
+ try {
3421
+ var out = /* @__PURE__ */ new Set();
3422
+ var fetchMore = false;
3423
+ for (var page = 0; page < maxPages; page++) {
3424
+ var res = await skapi.getUniqueId(
3425
+ { service, unique_id: CONTENT_CLAIM_PREFIX, condition: "gte" },
3426
+ { limit: 1e3, fetchMore }
3427
+ );
3428
+ var list = listOf(res);
3429
+ for (var i = 0; i < list.length; i++) {
3430
+ var id = typeof list[i] === "string" ? list[i] : list[i] && list[i].unique_id;
3431
+ if (typeof id === "string" && id.indexOf(CONTENT_CLAIM_PREFIX) === 0) out.add(id);
3432
+ }
3433
+ if (!res || res.endOfList !== false) return out;
3434
+ fetchMore = true;
3435
+ }
3436
+ return null;
3437
+ } catch (err) {
3438
+ var msg = String(err && (err.code || err.message) || err || "");
3439
+ if (/NOT_EXISTS|not exist/i.test(msg)) return /* @__PURE__ */ new Set();
3440
+ return null;
3441
+ }
3442
+ }
3443
+ async function listLinkedCopies(skapi, service, maxPages = 10) {
3444
+ if (!skapi || typeof skapi.getRecords !== "function" || !service) return null;
3445
+ var out = /* @__PURE__ */ new Map();
3446
+ try {
3447
+ var fetchMore = false;
3448
+ for (var page = 0; page < maxPages; page++) {
3449
+ var res = await skapi.getRecords(
3450
+ { service, table: { name: "__INDEXING__", access_group: "authorized" }, tag: LINKED_COPY_TAG },
3451
+ { limit: 1e3, fetchMore }
3452
+ );
3453
+ var list = listOf(res);
3454
+ for (var i = 0; i < list.length; i++) {
3455
+ var r = list[i] || {};
3456
+ var uid = String(r.unique_id || "");
3457
+ if (uid.indexOf("done::") !== 0) continue;
3458
+ var mk = linkedMarkerOf(r.data);
3459
+ if (mk) out.set(uid.slice(6), mk);
3460
+ }
3461
+ if (!res || res.endOfList !== false) return out;
3462
+ fetchMore = true;
3463
+ }
3464
+ return out;
3465
+ } catch (err) {
3466
+ var msg = String(err && (err.code || err.message) || err || "");
3467
+ if (/NOT_EXISTS|not exist/i.test(msg)) return out;
3468
+ return null;
3469
+ }
3470
+ }
3471
+ function bodyOf(res) {
3472
+ if (typeof res === "string") {
3473
+ try {
3474
+ return JSON.parse(res);
3475
+ } catch (_) {
3476
+ return res;
3477
+ }
3478
+ }
3479
+ return res;
3480
+ }
3481
+ function errorText(err) {
3482
+ var b = err && (err.body || err.data || err.response);
3483
+ var bb = bodyOf(b);
3484
+ if (bb && typeof bb === "object") {
3485
+ if (typeof bb.reason === "string") return bb.reason;
3486
+ if (typeof bb.message === "string") return bb.message;
3487
+ }
3488
+ if (typeof bb === "string" && bb) return bb;
3489
+ return String(err && err.message || err || "The request failed.");
3490
+ }
3491
+ async function callMcpRoute(route, args, data) {
3492
+ var base = String(chatEngineConfig().mcpBaseUrl || "").replace(/\/+$/, "");
3493
+ if (!base) throw new Error("No BunnyQuery server is configured.");
3494
+ var res = await resolveForwardRequest()({
3495
+ service: args.service,
3496
+ ...args.owner ? { owner: args.owner } : {},
3497
+ url: base + route,
3498
+ method: "POST",
3499
+ headers: { "content-type": "application/json", Authorization: "Bearer $ACCESS_TOKEN" },
3500
+ data: Object.assign({ project_id: args.service }, data)
3501
+ });
3502
+ return bodyOf(res);
3503
+ }
3504
+ async function findIdenticalFiles(args) {
3505
+ var calls = Math.max(1, args.maxCalls || 12);
3506
+ var last = null;
3507
+ for (var i = 0; i < calls; i++) {
3508
+ var body;
3509
+ try {
3510
+ body = await callMcpRoute("/internal/identical-files", args, { budget_s: args.budgetS || 8 });
3511
+ } catch (err) {
3512
+ var msg = errorText(err);
3513
+ if (/timed? ?out|timeout|504/i.test(msg) && i < calls - 1) continue;
3514
+ throw new Error(msg);
3515
+ }
3516
+ if (!body || typeof body !== "object" || !Array.isArray(body.groups)) {
3517
+ throw new Error(typeof body === "string" && body ? body : "The server did not answer the scan.");
3518
+ }
3519
+ last = { complete: !!body.complete, scanned: Number(body.scanned) || 0, total: Number(body.total) || 0, groups: body.groups, skipped: body.skipped };
3520
+ if (args.onProgress) args.onProgress(last);
3521
+ if (last.complete) return last;
3522
+ }
3523
+ return last;
3524
+ }
3525
+ async function linkIdenticalFile(args) {
3526
+ var last = "";
3527
+ for (var attempt = 0; attempt < 4; attempt++) {
3528
+ try {
3529
+ var body = await callMcpRoute("/internal/identical-link", args, { copy: args.copy, original: args.original });
3530
+ if (body && typeof body === "object" && typeof body.linked === "boolean") return body;
3531
+ return { linked: false, reason: typeof body === "string" && body ? body : "unexpected answer" };
3532
+ } catch (err) {
3533
+ last = errorText(err);
3534
+ if (!/timed? ?out|timeout|504/i.test(last)) return { linked: false, reason: last };
3535
+ await new Promise(function(r) {
3536
+ setTimeout(r, 8e3);
3537
+ });
3538
+ }
3539
+ }
3540
+ return { linked: false, reason: last || "timed out" };
3541
+ }
3542
+ function identicalLinkReasonText(reason) {
3543
+ switch (reason) {
3544
+ case "not_identical":
3545
+ return "the two files no longer have the same content";
3546
+ case "original_not_indexed":
3547
+ return "the original is not indexed";
3548
+ case "original_is_a_copy":
3549
+ return "the original is itself a linked copy";
3550
+ case "less_open_original":
3551
+ return "the original can be read by fewer people than the copy";
3552
+ case "private_original":
3553
+ return "the original is private";
3554
+ case "private_copy":
3555
+ return "the copy is another user's private file: it shares the index once that user indexes it again";
3556
+ case "content_claimed_by_another_file":
3557
+ return "another file already holds this content's index";
3558
+ case "not_readable":
3559
+ return "one of the files could not be read from storage";
3560
+ case "different_kind":
3561
+ return "the files are of different kinds";
3562
+ case "no_file_record":
3563
+ return "one of the files has no index record";
3564
+ case "unshared_access_group":
3565
+ return "the file's access group cannot share an index";
3566
+ default:
3567
+ return reason || "refused";
3568
+ }
3569
+ }
3570
+
3238
3571
  // src/engine/indexing_groups.ts
3239
3572
  function canonIndexKey(s) {
3240
3573
  return typeof s === "string" && s ? s.trim() : "";
@@ -3353,6 +3686,10 @@ function indexGroupDurationLabel(group) {
3353
3686
  if (!group || group.status !== "done" || !group.finished || group.resolving || group.queued) return "";
3354
3687
  return formatIndexDuration(group.durationMs);
3355
3688
  }
3689
+ function indexGroupLinkedLabel(group) {
3690
+ if (!group || !group.linked || group.status !== "done") return "";
3691
+ return linkedRowLabel(group.linked.original, group.linked.ms);
3692
+ }
3356
3693
  function buildChatDisplayList(messages, opts) {
3357
3694
  var list = Array.isArray(messages) ? messages : [];
3358
3695
  var liveIndexKeys = opts && opts.liveIndexKeys || {};
@@ -3548,6 +3885,14 @@ function buildChatDisplayList(messages, opts) {
3548
3885
  var vm = grp.members[vi];
3549
3886
  if (vm.msg._indexComplete) sawComplete = true;
3550
3887
  if (!isHiddenPass(vm.msg)) grp.visibleMembers.push(vm);
3888
+ if (vm.msg.role === "assistant" && !vm.msg.isError && !grp.linked) {
3889
+ var linkedReply = parseLinkedReply(vm.msg.content);
3890
+ if (linkedReply) grp.linked = linkedReply;
3891
+ }
3892
+ }
3893
+ if (grp.linked && grp.status !== "active" && grp.status !== "cancelled") {
3894
+ grp.status = "done";
3895
+ sawComplete = true;
3551
3896
  }
3552
3897
  grp.driver = !isPagedReadFile(grp.name, grp.mime) ? "single" : isImageVisionFile(grp.name, grp.mime) ? "worker" : windowedIndexing ? "worker" : "client";
3553
3898
  if (grp.status === "active") {
@@ -3559,7 +3904,7 @@ function buildChatDisplayList(messages, opts) {
3559
3904
  } else if (grp.driver === "client") {
3560
3905
  grp.finished = sawComplete || grp.status === "error" || grp.passCount >= MAX_INDEXING_RESUME_PASSES;
3561
3906
  } else {
3562
- grp.finished = !newestRunOfKey[order[oi]] || !!doneKeys[grp.key] && !liveIndexKeys[grp.key] || liveIndexChecked && !liveIndexKeys[grp.key];
3907
+ grp.finished = !newestRunOfKey[order[oi]] || !!grp.linked || !!doneKeys[grp.key] && !liveIndexKeys[grp.key] || liveIndexChecked && !liveIndexKeys[grp.key];
3563
3908
  }
3564
3909
  if (grp.status !== "done") {
3565
3910
  grp.resolving = false;
@@ -3710,7 +4055,8 @@ function buildChatDisplayList(messages, opts) {
3710
4055
  queued: waitingStub || live && !!runningKeys && !runningKeys[sp] && !runningKeys[canonIndexKey(sp)] && !runningKeys[fname] ? true : void 0,
3711
4056
  stubError: rec.error || (st === "error" && !rec.error ? "Indexing did not finish." : void 0),
3712
4057
  // The stub IS the record, so a 'done' record's span is this run's.
3713
- durationMs: st === "done" ? runRecordDurationMs(rec) : void 0
4058
+ durationMs: st === "done" ? runRecordDurationMs(rec) : void 0,
4059
+ linked: st === "done" && rec.linked && rec.alias_of ? { original: rec.alias_of, ms: typeof rec.link_ms === "number" ? rec.link_ms : void 0 } : void 0
3714
4060
  };
3715
4061
  stubList.push({ started: typeof rec.started === "number" ? rec.started : Infinity, group: sg });
3716
4062
  }
@@ -3730,6 +4076,9 @@ function buildChatDisplayList(messages, opts) {
3730
4076
  stubList.push({ started: trec.started, group: tg });
3731
4077
  overlayRunRecordVerdict(tg, trec, liveIndexKeys);
3732
4078
  tg.durationMs = runRecordGroupDurationMs(tg, trec);
4079
+ if (trec.linked && trec.alias_of && trec.status === "done") {
4080
+ tg.linked = { original: trec.alias_of, ms: tg.linked && tg.linked.ms !== void 0 ? tg.linked.ms : typeof trec.link_ms === "number" ? trec.link_ms : void 0 };
4081
+ }
3733
4082
  }
3734
4083
  }
3735
4084
  stubList.sort(function(a, b) {
@@ -3771,7 +4120,7 @@ function isDuplicateCandidateId(uniqueId, name) {
3771
4120
  const tail = "/" + name;
3772
4121
  return uniqueId.length > SRC_PREFIX2.length + tail.length && uniqueId.slice(-tail.length) === tail;
3773
4122
  }
3774
- function listOf(res) {
4123
+ function listOf2(res) {
3775
4124
  if (!res) return [];
3776
4125
  if (Array.isArray(res)) return res;
3777
4126
  return Array.isArray(res.list) ? res.list : [];
@@ -3788,14 +4137,14 @@ function nfc(text) {
3788
4137
  async function storedCopyIndexing(skapi, storagePath, service) {
3789
4138
  const doneId = "done::" + storagePath;
3790
4139
  try {
3791
- const done = listOf(await skapi.getUniqueId(Object.assign({ unique_id: doneId }, service), { fetchMore: false, limit: 1 }));
4140
+ const done = listOf2(await skapi.getUniqueId(Object.assign({ unique_id: doneId }, service), { fetchMore: false, limit: 1 }));
3792
4141
  if (done.some(function(it) {
3793
4142
  return (it && typeof it === "object" ? it.unique_id : it) === doneId;
3794
4143
  })) return "done";
3795
4144
  } catch {
3796
4145
  }
3797
4146
  try {
3798
- const run = listOf(await skapi.getRecords(Object.assign({ unique_id: "run::" + storagePath }, service)))[0];
4147
+ const run = listOf2(await skapi.getRecords(Object.assign({ unique_id: "run::" + storagePath }, service)))[0];
3799
4148
  const data = run && run.data && typeof run.data === "object" ? run.data : null;
3800
4149
  if (data && data.status === "working" && typeof data.started === "number" && Date.now() - data.started < RUN_RECORD_WORKING_STALE_MS) return "running";
3801
4150
  } catch {
@@ -3824,7 +4173,7 @@ async function lookupDuplicate(skapi, file, userId, opts) {
3824
4173
  const size = file && typeof file.size === "number" ? file.size : NaN;
3825
4174
  if (!name || !(size >= 0) || !userId) return null;
3826
4175
  const service = opts && opts.service ? { service: opts.service } : {};
3827
- const found = listOf(await skapi.getUniqueId(
4176
+ const found = listOf2(await skapi.getUniqueId(
3828
4177
  Object.assign({ unique_id: name, condition: "<=" }, service),
3829
4178
  { fetchMore: false, limit: DUPLICATE_LOOKUP_LIMIT }
3830
4179
  ));
@@ -3837,7 +4186,7 @@ async function lookupDuplicate(skapi, file, userId, opts) {
3837
4186
  for (const uniqueId of ids) {
3838
4187
  let record = null;
3839
4188
  try {
3840
- record = listOf(await skapi.getRecords(Object.assign({ unique_id: uniqueId }, service)))[0] || null;
4189
+ record = listOf2(await skapi.getRecords(Object.assign({ unique_id: uniqueId }, service)))[0] || null;
3841
4190
  } catch {
3842
4191
  continue;
3843
4192
  }
@@ -6358,6 +6707,43 @@ var _ChatSession = class _ChatSession {
6358
6707
  return queued;
6359
6708
  });
6360
6709
  }
6710
+ /**
6711
+ * ONE SHARED INDEX FOR IDENTICAL FILES: the linked copies that lose their original when
6712
+ * `removed` files (or every file under `folders`) go away, per original, oldest first
6713
+ * (identical.ts copiesToPromote). Read through host.findLinkedCopies, fresh, and it has
6714
+ * to be read BEFORE the delete or reset: those remove nothing from the copies' markers,
6715
+ * but a later sweep could no longer tell whose copies they were once a new original
6716
+ * exists. Never rejects; [] without the hook or on any failure.
6717
+ */
6718
+ collectLinkedCopies(removed, folders) {
6719
+ if (typeof this.host.findLinkedCopies !== "function") return Promise.resolve([]);
6720
+ var id = this.host.getIdentity();
6721
+ var actor = { userId: id && !id.anonymous ? id.userId : null, isProjectOwner: !!(id && !id.anonymous && id.owner && id.userId === id.owner) };
6722
+ return Promise.resolve(this.host.findLinkedCopies()).then(function(map) {
6723
+ return map ? copiesToPromote(map, removed || [], folders, actor) : [];
6724
+ }).catch(function() {
6725
+ return [];
6726
+ });
6727
+ }
6728
+ /**
6729
+ * Send the copies of a removed or overwritten original again (owner decision
6730
+ * 2026-11-26): each list's oldest copy first, so its first pass claims the content and
6731
+ * is indexed for real (one AI run), then the others, which link to it with no AI call.
6732
+ * The share flag rides on every first pass while the project's switch is on (requests.ts
6733
+ * notifyAgentSaveAttachment). Through reindexStoredFiles, so each copy keeps its access
6734
+ * group and shows as a "Reindexing" row. Resolves to the number of files queued.
6735
+ */
6736
+ promoteLinkedCopies(plan) {
6737
+ var list = [];
6738
+ (plan || []).forEach(function(g) {
6739
+ (g && g.copies || []).forEach(function(c) {
6740
+ if (c) list.push({ storagePath: c });
6741
+ });
6742
+ });
6743
+ if (!list.length) return Promise.resolve(0);
6744
+ console.log("[chat-engine] identical files: sending " + list.length + " linked cop" + (list.length === 1 ? "y" : "ies") + " again, their original is gone:", plan);
6745
+ return this.reindexStoredFiles(list);
6746
+ }
6361
6747
  /**
6362
6748
  * The same question, asked of the SERVER when this page cannot answer it.
6363
6749
  *
@@ -13150,6 +13536,7 @@ var _ChatSession = class _ChatSession {
13150
13536
  att._storedCount = 0;
13151
13537
  att._indexQueuedCount = 0;
13152
13538
  att._indexQueued = false;
13539
+ att._landedNew = [];
13153
13540
  var cancelError = function() {
13154
13541
  var e = new Error(UPLOAD_CANCELLED_MESSAGE);
13155
13542
  e.code = "CANCELLED";
@@ -13177,10 +13564,13 @@ var _ChatSession = class _ChatSession {
13177
13564
  checkCancel();
13178
13565
  var hadExists = false;
13179
13566
  var skipped = false;
13567
+ var promotion = null;
13180
13568
  var duplicateOf = null;
13181
13569
  var existedBefore = false;
13182
13570
  var madeRecord = false;
13571
+ var sentAll = false;
13183
13572
  var onProg = function(p) {
13573
+ if (p && p.total && p.loaded >= p.total) sentAll = true;
13184
13574
  if (p && p.total) {
13185
13575
  att.progress = Math.floor((idx + p.loaded / p.total) / total * 100);
13186
13576
  self.host.renderAttachmentChips();
@@ -13188,6 +13578,7 @@ var _ChatSession = class _ChatSession {
13188
13578
  };
13189
13579
  var doMemberUpload = function(checkExistence) {
13190
13580
  checkCancel();
13581
+ sentAll = false;
13191
13582
  return self.host.uploadFile({
13192
13583
  file: member.file,
13193
13584
  storagePath: member.storagePath,
@@ -13209,10 +13600,14 @@ var _ChatSession = class _ChatSession {
13209
13600
  }).then(function(r) {
13210
13601
  att._abort = null;
13211
13602
  att._storedCount = (att._storedCount || 0) + 1;
13603
+ if (checkExistence) att._landedNew.push(member.storagePath);
13212
13604
  return r;
13213
13605
  }, function(err) {
13214
13606
  att._abort = null;
13215
- if (att._cancelled) throw cancelError();
13607
+ if (att._cancelled) {
13608
+ if (checkExistence && sentAll) att._landedNew.push(member.storagePath);
13609
+ throw cancelError();
13610
+ }
13216
13611
  throw err;
13217
13612
  });
13218
13613
  };
@@ -13236,6 +13631,7 @@ var _ChatSession = class _ChatSession {
13236
13631
  return self.host.promptOverwrite(member.file.name).then(function(choice) {
13237
13632
  if (choice === "overwrite") {
13238
13633
  existedBefore = true;
13634
+ promotion = self.collectLinkedCopies([member.storagePath]);
13239
13635
  markImagePreviewStale(self.host.getIdentity().projectId || "default", member.storagePath);
13240
13636
  return doMemberUpload(false);
13241
13637
  }
@@ -13368,6 +13764,9 @@ var _ChatSession = class _ChatSession {
13368
13764
  if (alreadyIndexing) return;
13369
13765
  att._indexQueuedCount = (att._indexQueuedCount || 0) + 1;
13370
13766
  if (att.kind !== "folder") att._indexQueued = true;
13767
+ att._landedNew = (att._landedNew || []).filter(function(p) {
13768
+ return p !== member.storagePath;
13769
+ });
13371
13770
  self.host.renderAttachmentChips();
13372
13771
  return self.trackIndexDispatch(notifyAgentSaveAttachment({
13373
13772
  platform: id.platform,
@@ -13409,6 +13808,14 @@ var _ChatSession = class _ChatSession {
13409
13808
  });
13410
13809
  self.noteBgQueueChanged();
13411
13810
  self.drainBgTaskQueue();
13811
+ if (promotion) {
13812
+ var plan = promotion;
13813
+ promotion = null;
13814
+ plan.then(function(pl) {
13815
+ return self.promoteLinkedCopies(pl);
13816
+ }).catch(function() {
13817
+ });
13818
+ }
13412
13819
  }
13413
13820
  }, function(e) {
13414
13821
  console.error("[chat-engine] indexing request failed", e);
@@ -13489,6 +13896,12 @@ var _ChatSession = class _ChatSession {
13489
13896
  att.status = "cancelled";
13490
13897
  att._abort = null;
13491
13898
  self.host.renderAttachmentChips();
13899
+ if (typeof att._onCancelSettled === "function") {
13900
+ try {
13901
+ att._onCancelSettled((att._landedNew || []).slice());
13902
+ } catch (e) {
13903
+ }
13904
+ }
13492
13905
  return;
13493
13906
  }
13494
13907
  if (removed || aborted) return;
@@ -13536,6 +13949,7 @@ exports.BOM_EXTS = BOM_EXTS;
13536
13949
  exports.CHAT_GREETING_MAX_LENGTH = CHAT_GREETING_MAX_LENGTH;
13537
13950
  exports.CLAUDE_INPUT_CAP_RATIO = CLAUDE_INPUT_CAP_RATIO;
13538
13951
  exports.CLAUDE_PER_REQUEST_INPUT_CAP = CLAUDE_PER_REQUEST_INPUT_CAP;
13952
+ exports.CONTENT_CLAIM_PREFIX = CONTENT_CLAIM_PREFIX;
13539
13953
  exports.CONTEXT_WINDOW_BY_MODEL = CONTEXT_WINDOW_BY_MODEL;
13540
13954
  exports.CONTEXT_WINDOW_DEFAULT = CONTEXT_WINDOW_DEFAULT;
13541
13955
  exports.ChatSession = ChatSession;
@@ -13544,6 +13958,7 @@ exports.DEFAULT_ANSWER_MODE = DEFAULT_ANSWER_MODE;
13544
13958
  exports.DEFAULT_CLAUDE_MODEL = DEFAULT_CLAUDE_MODEL;
13545
13959
  exports.DEFAULT_CONTEXT_WINDOW = DEFAULT_CONTEXT_WINDOW;
13546
13960
  exports.DEFAULT_OPENAI_MODEL = DEFAULT_OPENAI_MODEL;
13961
+ exports.DEFAULT_SHARE_IDENTICAL_FILES = DEFAULT_SHARE_IDENTICAL_FILES;
13547
13962
  exports.DEFAULT_SKIP_DUPLICATE_FILES = DEFAULT_SKIP_DUPLICATE_FILES;
13548
13963
  exports.DEFAULT_UPLOAD_ACCESS_GROUP = DEFAULT_UPLOAD_ACCESS_GROUP;
13549
13964
  exports.DEFAULT_WEB_ACCESS = DEFAULT_WEB_ACCESS;
@@ -13567,6 +13982,7 @@ exports.INLINE_LINK_GLYPH = INLINE_LINK_GLYPH;
13567
13982
  exports.INLINE_LINK_UNAVAILABLE_GLYPH = INLINE_LINK_UNAVAILABLE_GLYPH;
13568
13983
  exports.INLINE_LINK_UNAVAILABLE_SUFFIX = INLINE_LINK_UNAVAILABLE_SUFFIX;
13569
13984
  exports.INPUT_CAP_RATIO = INPUT_CAP_RATIO;
13985
+ exports.LINKED_COPY_TAG = LINKED_COPY_TAG;
13570
13986
  exports.LINK_LABEL_MAX_DISPLAY_CHARS = LINK_LABEL_MAX_DISPLAY_CHARS;
13571
13987
  exports.LINK_REFRESH_WINDOW_MS = LINK_REFRESH_WINDOW_MS;
13572
13988
  exports.LOOK_DEADLINE_MS = LOOK_DEADLINE_MS;
@@ -13607,6 +14023,7 @@ exports.RETRIEVAL_NOTE_MAX_ITEMS = RETRIEVAL_NOTE_MAX_ITEMS;
13607
14023
  exports.RETRIEVAL_NOTE_PREFIX = RETRIEVAL_NOTE_PREFIX;
13608
14024
  exports.RTF_EXTS = RTF_EXTS;
13609
14025
  exports.RUN_RECORD_WORKING_STALE_MS = RUN_RECORD_WORKING_STALE_MS;
14026
+ exports.SHARE_IDENTICAL_FILES_KEY = SHARE_IDENTICAL_FILES_KEY;
13610
14027
  exports.STREAM_POLL_INTERVAL = STREAM_POLL_INTERVAL;
13611
14028
  exports.TOOL_AND_RESPONSE_BUFFER = TOOL_AND_RESPONSE_BUFFER;
13612
14029
  exports.UPLOAD_ACCESS_GROUPS = UPLOAD_ACCESS_GROUPS;
@@ -13659,6 +14076,11 @@ exports.composeUserMessage = composeUserMessage;
13659
14076
  exports.configureChatEngine = configureChatEngine;
13660
14077
  exports.configureProjectSettings = configureProjectSettings;
13661
14078
  exports.contentTypeForExt = contentTypeForExt;
14079
+ exports.copiesByOriginal = copiesByOriginal;
14080
+ exports.copiesToPromote = copiesToPromote;
14081
+ exports.copyCountLabel = copyCountLabel;
14082
+ exports.copyCountTitle = copyCountTitle;
14083
+ exports.copyStatusOf = copyStatusOf;
13662
14084
  exports.createHistoryFiller = createHistoryFiller;
13663
14085
  exports.createInlineLinkRegex = createInlineLinkRegex;
13664
14086
  exports.createScrollAnchor = createScrollAnchor;
@@ -13680,13 +14102,16 @@ exports.extractOpenAIText = extractOpenAIText;
13680
14102
  exports.extractRemotePathFromAttachmentHref = extractRemotePathFromAttachmentHref;
13681
14103
  exports.extractRetrievalNote = extractRetrievalNote;
13682
14104
  exports.fetchLiveIndexingKeys = fetchLiveIndexingKeys;
14105
+ exports.fileNameOf = fileNameOf;
13683
14106
  exports.fillHistoryViewport = fillHistoryViewport;
13684
14107
  exports.filterListByClearHorizon = filterListByClearHorizon;
13685
14108
  exports.findAttachmentParser = findAttachmentParser;
13686
14109
  exports.findDuplicateUpload = findDuplicateUpload;
14110
+ exports.findIdenticalFiles = findIdenticalFiles;
13687
14111
  exports.formatChatTimestamp = formatChatTimestamp;
13688
14112
  exports.formatDuration = formatDuration;
13689
14113
  exports.formatIndexDuration = formatIndexDuration;
14114
+ exports.formatLinkDuration = formatLinkDuration;
13690
14115
  exports.formatRetrievalNote = formatRetrievalNote;
13691
14116
  exports.getAttachmentParsers = getAttachmentParsers;
13692
14117
  exports.getChatHistory = getChatHistory;
@@ -13702,8 +14127,10 @@ exports.getVisionProfile = getVisionProfile;
13702
14127
  exports.groupAttachmentFailures = groupAttachmentFailures;
13703
14128
  exports.hasBom = hasBom;
13704
14129
  exports.hydrateImagePreviews = hydrateImagePreviews;
14130
+ exports.identicalLinkReasonText = identicalLinkReasonText;
13705
14131
  exports.indexDoneUniqueId = indexDoneUniqueId;
13706
14132
  exports.indexGroupDurationLabel = indexGroupDurationLabel;
14133
+ exports.indexGroupLinkedLabel = indexGroupLinkedLabel;
13707
14134
  exports.indexScopeKey = indexScopeKey;
13708
14135
  exports.indexingAccessGroup = indexingAccessGroup;
13709
14136
  exports.isAuthExpiredError = isAuthExpiredError;
@@ -13730,10 +14157,15 @@ exports.isServiceDbAttachmentHref = isServiceDbAttachmentHref;
13730
14157
  exports.isTransportFailure = isTransportFailure;
13731
14158
  exports.isUploadCancelledError = isUploadCancelledError;
13732
14159
  exports.isWindowedReadFile = isWindowedReadFile;
14160
+ exports.linkIdenticalFile = linkIdenticalFile;
13733
14161
  exports.linkUnavailableKeyForHref = linkUnavailableKeyForHref;
13734
14162
  exports.linkUnavailableKeyForPath = linkUnavailableKeyForPath;
13735
14163
  exports.linkUnavailableKeysForPath = linkUnavailableKeysForPath;
14164
+ exports.linkedMarkerOf = linkedMarkerOf;
14165
+ exports.linkedRowLabel = linkedRowLabel;
13736
14166
  exports.listClaudeModels = listClaudeModels;
14167
+ exports.listContentClaims = listContentClaims;
14168
+ exports.listLinkedCopies = listLinkedCopies;
13737
14169
  exports.listOpenAIModels = listOpenAIModels;
13738
14170
  exports.listedRequestText = listedRequestText;
13739
14171
  exports.liveSafePrefix = liveSafePrefix;
@@ -13752,6 +14184,7 @@ exports.normalizeAttachmentPathCandidate = normalizeAttachmentPathCandidate;
13752
14184
  exports.normalizeChatGreeting = normalizeChatGreeting;
13753
14185
  exports.normalizeExt = normalizeExt;
13754
14186
  exports.normalizeProjectAccessSetting = normalizeProjectAccessSetting;
14187
+ exports.normalizeShareIdenticalFiles = normalizeShareIdenticalFiles;
13755
14188
  exports.normalizeSkipDuplicateFiles = normalizeSkipDuplicateFiles;
13756
14189
  exports.normalizeStoredPathTarget = normalizeStoredPathTarget;
13757
14190
  exports.normalizeTextContent = normalizeTextContent;
@@ -13763,6 +14196,7 @@ exports.parseAiAgentValue = parseAiAgentValue;
13763
14196
  exports.parseAttachmentContent = parseAttachmentContent;
13764
14197
  exports.parseIndexingLabel = parseIndexingLabel;
13765
14198
  exports.parseIndexingRequestText = parseIndexingRequestText;
14199
+ exports.parseLinkedReply = parseLinkedReply;
13766
14200
  exports.patchProjectSettings = patchProjectSettings;
13767
14201
  exports.peekImagePreviewUrl = peekImagePreviewUrl;
13768
14202
  exports.prepareDownloadText = prepareDownloadText;
@@ -13777,10 +14211,13 @@ exports.projectAnswerMode = projectAnswerMode;
13777
14211
  exports.projectAsksUploadAccess = projectAsksUploadAccess;
13778
14212
  exports.projectChatGreeting = projectChatGreeting;
13779
14213
  exports.projectSettingsSettled = projectSettingsSettled;
14214
+ exports.projectShareIdenticalFiles = projectShareIdenticalFiles;
13780
14215
  exports.projectSkipDuplicateFiles = projectSkipDuplicateFiles;
13781
14216
  exports.projectUploadAccessGroup = projectUploadAccessGroup;
13782
14217
  exports.projectWebAccess = projectWebAccess;
14218
+ exports.promotableCopies = promotableCopies;
13783
14219
  exports.providerBodyWasRead = providerBodyWasRead;
14220
+ exports.providerDocument = providerDocument;
13784
14221
  exports.readExpiredAttachmentHref = readExpiredAttachmentHref;
13785
14222
  exports.readyProjectSettings = readyProjectSettings;
13786
14223
  exports.reconcilerReadsEnabled = reconcilerReadsEnabled;
@@ -13804,6 +14241,7 @@ exports.safeDecodeURIComponent = safeDecodeURIComponent;
13804
14241
  exports.sanitizeAttachmentLinksForHistory = sanitizeAttachmentLinksForHistory;
13805
14242
  exports.setProjectContextWindow = setProjectContextWindow;
13806
14243
  exports.setProjectSettings = setProjectSettings;
14244
+ exports.shareIdenticalFilesFrom = shareIdenticalFilesFrom;
13807
14245
  exports.shouldRescueInFlightMessage = shouldRescueInFlightMessage;
13808
14246
  exports.sideEffectDone = sideEffectDone;
13809
14247
  exports.skapiSupportsStreaming = skapiSupportsStreaming;