bunnyquery 1.4.6 → 1.5.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/bunnyquery.css +81 -0
- package/bunnyquery.js +60 -11
- package/dist/engine.cjs +9 -2
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.mts +2 -2
- package/dist/engine.d.ts +2 -2
- package/dist/engine.mjs +9 -2
- package/dist/engine.mjs.map +1 -1
- package/package.json +1 -1
- package/src/engine/budget.ts +1 -1
- package/src/engine/host.ts +2 -2
- package/src/engine/session.ts +6 -2
- package/src/widget.css +81 -0
package/dist/engine.d.mts
CHANGED
|
@@ -492,8 +492,8 @@ interface ChatHost {
|
|
|
492
492
|
/** Map a relative path to the consumer's db storage key (e.g. uid-prefixed). */
|
|
493
493
|
storagePathFor(relPath: string): string;
|
|
494
494
|
getMimeType(name: string): string | null;
|
|
495
|
-
/** Non-dismissible "file exists" prompt → keep+reindex
|
|
496
|
-
promptOverwrite(filename: string): Promise<'overwrite' | 'reindex'>;
|
|
495
|
+
/** Non-dismissible "file exists" prompt → skip, keep+reindex, or overwrite. */
|
|
496
|
+
promptOverwrite(filename: string): Promise<'overwrite' | 'reindex' | 'skip'>;
|
|
497
497
|
/** Clear the "apply to all" overwrite choice at the start of a batch. */
|
|
498
498
|
resetOverwriteBatch(): void;
|
|
499
499
|
/** Re-render the attachment chip row (progress / status). */
|
package/dist/engine.d.ts
CHANGED
|
@@ -492,8 +492,8 @@ interface ChatHost {
|
|
|
492
492
|
/** Map a relative path to the consumer's db storage key (e.g. uid-prefixed). */
|
|
493
493
|
storagePathFor(relPath: string): string;
|
|
494
494
|
getMimeType(name: string): string | null;
|
|
495
|
-
/** Non-dismissible "file exists" prompt → keep+reindex
|
|
496
|
-
promptOverwrite(filename: string): Promise<'overwrite' | 'reindex'>;
|
|
495
|
+
/** Non-dismissible "file exists" prompt → skip, keep+reindex, or overwrite. */
|
|
496
|
+
promptOverwrite(filename: string): Promise<'overwrite' | 'reindex' | 'skip'>;
|
|
497
497
|
/** Clear the "apply to all" overwrite choice at the start of a batch. */
|
|
498
498
|
resetOverwriteBatch(): void;
|
|
499
499
|
/** Re-render the attachment chip row (progress / status). */
|
package/dist/engine.mjs
CHANGED
|
@@ -478,7 +478,7 @@ function getContextWindow(platform, model) {
|
|
|
478
478
|
}
|
|
479
479
|
function stripFileBlocksFromHistory(content) {
|
|
480
480
|
if (!content) return content;
|
|
481
|
-
return content.replace(/```([
|
|
481
|
+
return content.replace(/```([^\n`]+?\.[^\s.`]+)\n[\s\S]*?```/g, "[file previously attached: $1]");
|
|
482
482
|
}
|
|
483
483
|
function buildBoundedChatMessages(options) {
|
|
484
484
|
var contextWindow = getContextWindow(options.platform, options.model);
|
|
@@ -1562,7 +1562,7 @@ var ChatSession = class {
|
|
|
1562
1562
|
var MIN_STEP = 1;
|
|
1563
1563
|
var MAX_FRAME_MS = 1e3;
|
|
1564
1564
|
var regions = [], m;
|
|
1565
|
-
var fenceRegex = /```[
|
|
1565
|
+
var fenceRegex = /```[^\n`]+?\.[^\s.`]+\n[\s\S]*?```/g;
|
|
1566
1566
|
while ((m = fenceRegex.exec(fullText)) !== null) regions.push({ start: m.index, end: m.index + m[0].length });
|
|
1567
1567
|
var linkRegex = createInlineLinkRegex();
|
|
1568
1568
|
while ((m = linkRegex.exec(fullText)) !== null) regions.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -2047,6 +2047,7 @@ var ChatSession = class {
|
|
|
2047
2047
|
members.forEach(function(member, idx) {
|
|
2048
2048
|
chain = chain.then(function() {
|
|
2049
2049
|
var hadExists = false;
|
|
2050
|
+
var skipped = false;
|
|
2050
2051
|
var onProg = function(p) {
|
|
2051
2052
|
if (p && p.total) {
|
|
2052
2053
|
att.progress = Math.floor((idx + p.loaded / p.total) / total * 100);
|
|
@@ -2071,11 +2072,17 @@ var ChatSession = class {
|
|
|
2071
2072
|
if (!isExists) throw err;
|
|
2072
2073
|
return self.host.promptOverwrite(member.file.name).then(function(choice) {
|
|
2073
2074
|
if (choice === "overwrite") return doMemberUpload(false);
|
|
2075
|
+
if (choice === "skip") {
|
|
2076
|
+
skipped = true;
|
|
2077
|
+
return;
|
|
2078
|
+
}
|
|
2074
2079
|
hadExists = true;
|
|
2075
2080
|
});
|
|
2076
2081
|
}).then(function() {
|
|
2082
|
+
if (skipped) return;
|
|
2077
2083
|
return self.host.getTemporaryUrl(member.storagePath);
|
|
2078
2084
|
}).then(function(url) {
|
|
2085
|
+
if (skipped) return;
|
|
2079
2086
|
urls.push({ name: member.relPath, url, storagePath: member.storagePath });
|
|
2080
2087
|
if (att.kind !== "folder") {
|
|
2081
2088
|
att.uploadedUrl = url;
|