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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunnyquery",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Embeddable BunnyQuery AI chat widget + its framework-agnostic chat engine",
5
5
  "main": "bunnyquery.js",
6
6
  "exports": {
Binary file
@@ -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
@@ -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;