bunnyquery 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bunnyquery.css +7 -0
- package/bunnyquery.js +75 -3
- package/dist/engine.cjs +31 -0
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.mts +22 -1
- package/dist/engine.d.ts +22 -1
- package/dist/engine.mjs +31 -1
- package/dist/engine.mjs.map +1 -1
- package/package.json +1 -1
- package/src/engine/attachments.ts +0 -0
- package/src/engine/index.ts +5 -0
- package/src/engine/session.ts +9 -0
- package/src/widget.css +7 -0
package/package.json
CHANGED
|
Binary file
|
package/src/engine/index.ts
CHANGED
|
@@ -21,6 +21,11 @@ export {
|
|
|
21
21
|
type ComposedUserMessage,
|
|
22
22
|
} from './office';
|
|
23
23
|
|
|
24
|
+
export {
|
|
25
|
+
groupAttachmentFailures,
|
|
26
|
+
type AttachmentFailureGroup,
|
|
27
|
+
} from './attachments';
|
|
28
|
+
|
|
24
29
|
export * from './prompts';
|
|
25
30
|
|
|
26
31
|
// Pure helpers (Tier-1.5): error detection, token budgeting, link/path
|
package/src/engine/session.ts
CHANGED
|
@@ -783,6 +783,7 @@ export class ChatSession {
|
|
|
783
783
|
var self = this;
|
|
784
784
|
var id = this.host.getIdentity();
|
|
785
785
|
att.status = 'uploading'; att.progress = 0; att.errorMessage = '';
|
|
786
|
+
att.errorCode = ''; att.errorDetail = ''; // clear any prior failure (retry)
|
|
786
787
|
this.host.renderAttachmentChips();
|
|
787
788
|
var members = (att.kind === 'folder')
|
|
788
789
|
? (att.files || []).map(function (f: any) { return { file: f.file, relPath: f.path, storagePath: self.host.storagePathFor(f.path) }; })
|
|
@@ -851,6 +852,11 @@ export class ChatSession {
|
|
|
851
852
|
}, function (e: any) {
|
|
852
853
|
console.error('[chat-engine] indexing request failed', e);
|
|
853
854
|
anyIndexFailed = true; // uploaded but not indexed → yellow
|
|
855
|
+
// Record the first index error's code/message for the report dialog.
|
|
856
|
+
if (!att.errorCode && !att.errorDetail) {
|
|
857
|
+
att.errorCode = (e && (e.code || (e.body && e.body.code))) || '';
|
|
858
|
+
att.errorDetail = (e && (e.message || (e.body && e.body.message))) || (typeof e === 'string' ? e : '');
|
|
859
|
+
}
|
|
854
860
|
});
|
|
855
861
|
});
|
|
856
862
|
});
|
|
@@ -894,6 +900,9 @@ export class ChatSession {
|
|
|
894
900
|
if (removed || aborted) return;
|
|
895
901
|
att.status = 'error';
|
|
896
902
|
att.errorMessage = 'File upload has failed';
|
|
903
|
+
// Preserve the original error code/message for the report dialog.
|
|
904
|
+
att.errorCode = (err && (err.code || (err.body && err.body.code))) || '';
|
|
905
|
+
att.errorDetail = (err && (err.message || (err.body && err.body.message))) || (typeof err === 'string' ? err : '');
|
|
897
906
|
self.host.renderAttachmentChips();
|
|
898
907
|
});
|
|
899
908
|
});
|
package/src/widget.css
CHANGED
|
@@ -823,6 +823,13 @@
|
|
|
823
823
|
.bq-modal-desc { margin: 0 0 1.25rem; font-size: 0.85rem; color: var(--bq-muted); line-height: 1.6; }
|
|
824
824
|
.bq-modal-btns { display: flex; gap: 0.75rem; justify-content: flex-end; align-items: center; }
|
|
825
825
|
|
|
826
|
+
/* upload error report dialog (failed files grouped by error) */
|
|
827
|
+
.bq-upload-error-list { display: flex; flex-direction: column; gap: 0.85rem; margin: 0 0 1.25rem; max-height: 50vh; overflow-y: auto; }
|
|
828
|
+
.bq-upload-error-group { border-left: 3px solid var(--bq-danger); padding-left: 0.7rem; }
|
|
829
|
+
.bq-upload-error-heading { margin: 0 0 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--bq-danger); word-break: break-word; }
|
|
830
|
+
.bq-upload-error-files { margin: 0; padding-left: 1.1rem; font-size: 0.8rem; color: var(--bq-ink); }
|
|
831
|
+
.bq-upload-error-files li { margin: 0.1rem 0; word-break: break-word; }
|
|
832
|
+
|
|
826
833
|
/* delete/clear (danger) modal accents */
|
|
827
834
|
.bq-modal-delete-header {
|
|
828
835
|
display: flex;
|