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/package.json
CHANGED
package/src/engine/budget.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function getContextWindow(platform: string, model?: string): number {
|
|
|
33
33
|
|
|
34
34
|
export function stripFileBlocksFromHistory(content: string): string {
|
|
35
35
|
if (!content) return content;
|
|
36
|
-
return content.replace(/```([
|
|
36
|
+
return content.replace(/```([^\n`]+?\.[^\s.`]+)\n[\s\S]*?```/g, '[file previously attached: $1]');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export type BoundedChatOptions = {
|
package/src/engine/host.ts
CHANGED
|
@@ -99,8 +99,8 @@ export interface ChatHost {
|
|
|
99
99
|
/** Map a relative path to the consumer's db storage key (e.g. uid-prefixed). */
|
|
100
100
|
storagePathFor(relPath: string): string;
|
|
101
101
|
getMimeType(name: string): string | null;
|
|
102
|
-
/** Non-dismissible "file exists" prompt → keep+reindex
|
|
103
|
-
promptOverwrite(filename: string): Promise<'overwrite' | 'reindex'>;
|
|
102
|
+
/** Non-dismissible "file exists" prompt → skip, keep+reindex, or overwrite. */
|
|
103
|
+
promptOverwrite(filename: string): Promise<'overwrite' | 'reindex' | 'skip'>;
|
|
104
104
|
/** Clear the "apply to all" overwrite choice at the start of a batch. */
|
|
105
105
|
resetOverwriteBatch(): void;
|
|
106
106
|
/** Re-render the attachment chip row (progress / status). */
|
package/src/engine/session.ts
CHANGED
|
@@ -550,7 +550,7 @@ export class ChatSession {
|
|
|
550
550
|
// (a partial link is broken markdown). If a frame's reveal boundary lands
|
|
551
551
|
// inside one, snap it to the region end so the chip/link appears whole.
|
|
552
552
|
var regions: Array<{ start: number; end: number }> = [], m;
|
|
553
|
-
var fenceRegex = /```[
|
|
553
|
+
var fenceRegex = /```[^\n`]+?\.[^\s.`]+\n[\s\S]*?```/g;
|
|
554
554
|
while ((m = fenceRegex.exec(fullText)) !== null) regions.push({ start: m.index, end: m.index + m[0].length });
|
|
555
555
|
var linkRegex = createInlineLinkRegex();
|
|
556
556
|
while ((m = linkRegex.exec(fullText)) !== null) regions.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -1013,6 +1013,7 @@ export class ChatSession {
|
|
|
1013
1013
|
members.forEach(function (member: any, idx: number) {
|
|
1014
1014
|
chain = chain.then(function () {
|
|
1015
1015
|
var hadExists = false;
|
|
1016
|
+
var skipped = false;
|
|
1016
1017
|
var onProg = function (p: any) {
|
|
1017
1018
|
if (p && p.total) {
|
|
1018
1019
|
att.progress = Math.floor(((idx + p.loaded / p.total) / total) * 100);
|
|
@@ -1032,11 +1033,14 @@ export class ChatSession {
|
|
|
1032
1033
|
if (!isExists) throw err; // a member upload failed → whole attachment fails (red)
|
|
1033
1034
|
return self.host.promptOverwrite(member.file.name).then(function (choice) {
|
|
1034
1035
|
if (choice === 'overwrite') return doMemberUpload(false); // replace the existing file
|
|
1035
|
-
|
|
1036
|
+
if (choice === 'skip') { skipped = true; return; } // leave it untouched; no upload/index
|
|
1037
|
+
hadExists = true; // keep it; Reindex
|
|
1036
1038
|
});
|
|
1037
1039
|
}).then(function () {
|
|
1040
|
+
if (skipped) return; // user skipped this member — no url, no index request
|
|
1038
1041
|
return self.host.getTemporaryUrl(member.storagePath);
|
|
1039
1042
|
}).then(function (url: string) {
|
|
1043
|
+
if (skipped) return; // guard the indexing branch for a skipped member
|
|
1040
1044
|
urls.push({ name: member.relPath, url: url, storagePath: member.storagePath });
|
|
1041
1045
|
if (att.kind !== 'folder') { att.uploadedUrl = url; att.storagePath = member.storagePath; }
|
|
1042
1046
|
var mime = member.file.type || self.host.getMimeType(member.file.name);
|
package/src/widget.css
CHANGED
|
@@ -157,6 +157,87 @@
|
|
|
157
157
|
to { transform: rotate(360deg); }
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
/* jumping ASCII bunny — full-area "loading/fetching" indicator (page/gate loads,
|
|
161
|
+
initial history fetch, settings panel). Ported from www.bunnyquery.com
|
|
162
|
+
bunnyLoader.vue. Two <pre> frames toggle + hop across the track and flip. */
|
|
163
|
+
.bq-bunny-loader {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
gap: 0.75rem;
|
|
169
|
+
}
|
|
170
|
+
.bq-bunny-loader--overlay {
|
|
171
|
+
position: absolute;
|
|
172
|
+
inset: 0;
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
z-index: 4;
|
|
175
|
+
}
|
|
176
|
+
.bq-bunny-stage {
|
|
177
|
+
display: inline-block;
|
|
178
|
+
position: relative;
|
|
179
|
+
text-align: left;
|
|
180
|
+
}
|
|
181
|
+
.bq-bunny-track {
|
|
182
|
+
position: relative;
|
|
183
|
+
height: 3.6rem;
|
|
184
|
+
width: 100%;
|
|
185
|
+
animation: bq-bunny-move 9s steps(12) infinite;
|
|
186
|
+
}
|
|
187
|
+
.bq-bunny-dir {
|
|
188
|
+
display: inline-block;
|
|
189
|
+
position: absolute;
|
|
190
|
+
bottom: 0;
|
|
191
|
+
left: 0;
|
|
192
|
+
animation: bq-bunny-flip 9s steps(1) infinite;
|
|
193
|
+
}
|
|
194
|
+
.bq-frame {
|
|
195
|
+
margin: 0;
|
|
196
|
+
/* Pin a Latin monospace font. Without it the <pre> falls back to the UA
|
|
197
|
+
`monospace` keyword, which on Korean/Japanese systems can resolve to a
|
|
198
|
+
CJK font that renders U+005C (backslash) as ₩ / ¥ — wrecking the art. */
|
|
199
|
+
font-family: var(--bq-mono);
|
|
200
|
+
font-size: 1rem;
|
|
201
|
+
line-height: 1.2;
|
|
202
|
+
white-space: pre;
|
|
203
|
+
color: var(--bq-ink);
|
|
204
|
+
}
|
|
205
|
+
.bq-frame-a {
|
|
206
|
+
animation: bq-bunny-toggle-a 1s steps(1) infinite;
|
|
207
|
+
}
|
|
208
|
+
.bq-frame-b {
|
|
209
|
+
animation: bq-bunny-toggle-b 1s steps(1) infinite;
|
|
210
|
+
opacity: 0;
|
|
211
|
+
}
|
|
212
|
+
.bq-bunny-loader__label {
|
|
213
|
+
color: var(--bq-ink);
|
|
214
|
+
font-family: var(--bq-mono);
|
|
215
|
+
font-size: 0.83rem;
|
|
216
|
+
}
|
|
217
|
+
@keyframes bq-bunny-move {
|
|
218
|
+
0% { transform: translateX(-11ch); }
|
|
219
|
+
25% { transform: translateX(4ch); }
|
|
220
|
+
37.5% { transform: translateX(4ch); }
|
|
221
|
+
50% { transform: translateX(4ch); }
|
|
222
|
+
75% { transform: translateX(-11ch); }
|
|
223
|
+
87.5% { transform: translateX(-11ch); }
|
|
224
|
+
100% { transform: translateX(-11ch); }
|
|
225
|
+
}
|
|
226
|
+
@keyframes bq-bunny-flip {
|
|
227
|
+
0% { transform: scaleX(1); }
|
|
228
|
+
50% { transform: scaleX(-1); }
|
|
229
|
+
}
|
|
230
|
+
@keyframes bq-bunny-toggle-a {
|
|
231
|
+
0% { opacity: 1; }
|
|
232
|
+
25% { opacity: 0; }
|
|
233
|
+
100% { opacity: 1; }
|
|
234
|
+
}
|
|
235
|
+
@keyframes bq-bunny-toggle-b {
|
|
236
|
+
0% { opacity: 0; }
|
|
237
|
+
25% { opacity: 1; }
|
|
238
|
+
100% { opacity: 0; }
|
|
239
|
+
}
|
|
240
|
+
|
|
160
241
|
/* ============================================================================
|
|
161
242
|
* AUTH VIEWS (login / signup / forgot / verify / settings)
|
|
162
243
|
* ==========================================================================*/
|