@overmap-ai/core 1.0.48-activity-history.3 → 1.0.48-activity-history.5

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.
@@ -4337,10 +4337,20 @@ var __publicField = (obj, key, value) => {
4337
4337
  var _a2;
4338
4338
  return (_a2 = allMiddleware[0]) == null ? void 0 : _a2.run(action);
4339
4339
  }
4340
- const discardStatuses = [400, 409, 403, 404];
4340
+ const discardStatuses = [400, 409, 403, 404, 405, 500];
4341
4341
  const statusMessages = {
4342
4342
  403: { title: "Forbidden", description: "You are not authorized to perform this action.", severity: "danger" },
4343
- 404: { title: "Not found", description: "The requested resource was not found.", severity: "danger" }
4343
+ 404: { title: "Not found", description: "The requested resource was not found.", severity: "danger" },
4344
+ 405: {
4345
+ title: "Not supported",
4346
+ description: "It's not you. It's us. Sorry for the inconvenience.",
4347
+ severity: "danger"
4348
+ },
4349
+ 500: {
4350
+ title: "Server error",
4351
+ description: "Our server seems to be experiencing problems at the moment. We have been alerted and will fix the problem as soon as possible.",
4352
+ severity: "danger"
4353
+ }
4344
4354
  };
4345
4355
  function discard(reason, action, retries = 0) {
4346
4356
  var _a2;
@@ -4521,7 +4531,8 @@ var __publicField = (obj, key, value) => {
4521
4531
  ...attachmentPayload,
4522
4532
  file: attachmentPayload.file.objectURL,
4523
4533
  file_name: attachmentPayload.file.name,
4524
- file_type: attachmentPayload.file.type
4534
+ file_type: attachmentPayload.file.type,
4535
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4525
4536
  };
4526
4537
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4527
4538
  this.client.store.dispatch(addIssueAttachment(offlineAttachment));
@@ -4555,7 +4566,8 @@ var __publicField = (obj, key, value) => {
4555
4566
  ...attachmentPayload,
4556
4567
  file: attachmentPayload.file.objectURL,
4557
4568
  file_name: attachmentPayload.file.name,
4558
- file_type: attachmentPayload.file.type
4569
+ file_type: attachmentPayload.file.type,
4570
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4559
4571
  };
4560
4572
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4561
4573
  this.client.store.dispatch(addComponentAttachment(offlineAttachment));
@@ -4589,7 +4601,8 @@ var __publicField = (obj, key, value) => {
4589
4601
  ...attachmentPayload,
4590
4602
  file: attachmentPayload.file.objectURL,
4591
4603
  file_name: attachmentPayload.file.name,
4592
- file_type: attachmentPayload.file.type
4604
+ file_type: attachmentPayload.file.type,
4605
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4593
4606
  };
4594
4607
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4595
4608
  this.client.store.dispatch(addComponentTypeAttachment(offlineAttachment));
@@ -4623,7 +4636,8 @@ var __publicField = (obj, key, value) => {
4623
4636
  ...attachmentPayload,
4624
4637
  file: attachmentPayload.file.objectURL,
4625
4638
  file_name: attachmentPayload.file.name,
4626
- file_type: attachmentPayload.file.type
4639
+ file_type: attachmentPayload.file.type,
4640
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4627
4641
  };
4628
4642
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4629
4643
  this.client.store.dispatch(addProjectAttachment(offlineAttachment));
@@ -4663,7 +4677,8 @@ var __publicField = (obj, key, value) => {
4663
4677
  file_name: file2.name,
4664
4678
  file_type: file2.type,
4665
4679
  issue: issueId,
4666
- file_sha1: hash
4680
+ file_sha1: hash,
4681
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4667
4682
  });
4668
4683
  return this.addIssueAttachment(attachment);
4669
4684
  };
@@ -4682,7 +4697,8 @@ var __publicField = (obj, key, value) => {
4682
4697
  file_name: file2.name,
4683
4698
  file_type: file2.type,
4684
4699
  component: componentId,
4685
- file_sha1: hash
4700
+ file_sha1: hash,
4701
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4686
4702
  });
4687
4703
  return this.addComponentAttachment(attachment);
4688
4704
  };
@@ -4701,7 +4717,8 @@ var __publicField = (obj, key, value) => {
4701
4717
  file_name: file2.name,
4702
4718
  file_type: file2.type,
4703
4719
  component_type: componentTypeId,
4704
- file_sha1: hash
4720
+ file_sha1: hash,
4721
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4705
4722
  });
4706
4723
  return this.addComponentTypeAttachment(attachment);
4707
4724
  };
@@ -4720,7 +4737,8 @@ var __publicField = (obj, key, value) => {
4720
4737
  file_name: file2.name,
4721
4738
  file_type: file2.type,
4722
4739
  project: projectId,
4723
- file_sha1: hash
4740
+ file_sha1: hash,
4741
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
4724
4742
  });
4725
4743
  return this.addProjectAttachment(attachment);
4726
4744
  };
@@ -5803,8 +5821,7 @@ var __publicField = (obj, key, value) => {
5803
5821
  const offlineComment = offline({
5804
5822
  ...comment,
5805
5823
  author: store.getState().userReducer.currentUser.id,
5806
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5807
- resolved: false
5824
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
5808
5825
  });
5809
5826
  store.dispatch(addIssueComment(offlineComment));
5810
5827
  const promise = this.enqueueRequest({
@@ -7702,7 +7719,7 @@ var __publicField = (obj, key, value) => {
7702
7719
  * @param request The message to prompt the agent with.
7703
7720
  * @param conversationId If continuing an existing message, the UUID of that conversation.
7704
7721
  */
7705
- prompt(request2, conversationId) {
7722
+ async prompt(request2, conversationId) {
7706
7723
  const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
7707
7724
  return this.enqueueRequest({
7708
7725
  description: "Prompt agent",
@@ -7717,6 +7734,16 @@ var __publicField = (obj, key, value) => {
7717
7734
  queryParams: conversationId ? { conversation_id: conversationId } : {}
7718
7735
  });
7719
7736
  }
7737
+ async rate(responseId, rating) {
7738
+ return this.enqueueRequest({
7739
+ description: "Rate agent response",
7740
+ method: HttpMethod.PUT,
7741
+ url: `/agents/responses/${responseId}/rate/`,
7742
+ payload: { rating },
7743
+ blockers: ["rate"],
7744
+ blocks: ["rate"]
7745
+ });
7746
+ }
7720
7747
  }
7721
7748
  class OvermapSDK {
7722
7749
  constructor(apiUrl, store) {
@@ -13206,52 +13233,54 @@ var __publicField = (obj, key, value) => {
13206
13233
  Footer,
13207
13234
  Loading
13208
13235
  };
13209
- const ImageCard = React.memo((props) => {
13210
- const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
13211
- const fileCardRef = React.useRef(null);
13212
- const imageInsetRef = React.useRef(null);
13213
- const fileCardSize = blocks.useSize(fileCardRef);
13214
- React.useLayoutEffect(() => {
13215
- if (!imageInsetRef.current || !fileCardSize)
13216
- return;
13217
- imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13218
- }, [fileCardSize]);
13219
- const fileName2 = React.useMemo(() => {
13220
- if (!file)
13221
- return;
13222
- return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13223
- }, [file, truncateLength]);
13224
- return /* @__PURE__ */ jsxRuntime.jsxs(
13225
- Flex,
13226
- {
13227
- className: classNames$1(className, styles$4.ImageCard),
13228
- width: "100%",
13229
- direction: "column",
13230
- position: "relative",
13231
- height: "max-content",
13232
- gap: "0",
13233
- ...rest,
13234
- children: [
13235
- !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13236
- /* @__PURE__ */ jsxRuntime.jsx(Inset, { className: styles$4.ImageInset, ref: imageInsetRef, clip: "padding-box", side: "y", pb: "0", children: file && !error2 && /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles$4.Image, src: URL.createObjectURL(file), alt: alt ?? file.name }) }),
13237
- /* @__PURE__ */ jsxRuntime.jsx(
13238
- blocks.OvermapItem,
13239
- {
13240
- className: classNames$1(styles$4.Footer, {
13241
- [styles$4.Loading]: !file
13242
- }),
13243
- size,
13244
- ref: fileCardRef,
13245
- leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13246
- rightSlot,
13247
- children: error2 ?? fileName2
13248
- }
13249
- )
13250
- ]
13251
- }
13252
- );
13253
- });
13254
- ImageCard.displayName = "ImageCard";
13236
+ const ImageCard = React.memo(
13237
+ React.forwardRef((props, forwardedRef) => {
13238
+ const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
13239
+ const fileCardRef = React.useRef(null);
13240
+ const imageInsetRef = React.useRef(null);
13241
+ const fileCardSize = blocks.useSize(fileCardRef);
13242
+ React.useLayoutEffect(() => {
13243
+ if (!imageInsetRef.current || !fileCardSize)
13244
+ return;
13245
+ imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13246
+ }, [fileCardSize]);
13247
+ const fileName2 = React.useMemo(() => {
13248
+ if (!file)
13249
+ return;
13250
+ return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13251
+ }, [file, truncateLength]);
13252
+ return /* @__PURE__ */ jsxRuntime.jsxs(
13253
+ Flex,
13254
+ {
13255
+ className: classNames$1(className, styles$4.ImageCard),
13256
+ width: "100%",
13257
+ direction: "column",
13258
+ position: "relative",
13259
+ height: "max-content",
13260
+ gap: "0",
13261
+ ref: forwardedRef,
13262
+ ...rest,
13263
+ children: [
13264
+ !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13265
+ /* @__PURE__ */ jsxRuntime.jsx(Inset, { className: styles$4.ImageInset, ref: imageInsetRef, clip: "padding-box", side: "y", pb: "0", children: file && !error2 && /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles$4.Image, src: URL.createObjectURL(file), alt: alt ?? file.name }) }),
13266
+ /* @__PURE__ */ jsxRuntime.jsx(
13267
+ blocks.OvermapItem,
13268
+ {
13269
+ className: classNames$1(styles$4.Footer, {
13270
+ [styles$4.Loading]: !file
13271
+ }),
13272
+ size,
13273
+ ref: fileCardRef,
13274
+ leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13275
+ rightSlot,
13276
+ children: error2 ?? fileName2
13277
+ }
13278
+ )
13279
+ ]
13280
+ }
13281
+ );
13282
+ })
13283
+ );
13255
13284
  const UploadInput = React.memo((props) => {
13256
13285
  var _a2;
13257
13286
  const [{ inputId, labelId, size, severity, helpText, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
@@ -14388,17 +14417,15 @@ var __publicField = (obj, key, value) => {
14388
14417
  Action.key
14389
14418
  )) }),
14390
14419
  /* @__PURE__ */ jsxRuntime.jsx(Box, { display: forMobile(true, "block"), children: /* @__PURE__ */ jsxRuntime.jsx(
14391
- blocks.DropdownItemMenu,
14420
+ blocks.OvermapDropdownMenu,
14392
14421
  {
14393
14422
  trigger: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiMore2Line" }) }),
14394
14423
  items: actions.map((Action) => {
14395
14424
  var _a2;
14396
14425
  return {
14397
- content: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { gap: "2", align: "center", children: [
14398
- /* @__PURE__ */ jsxRuntime.jsx(Action.Icon, {}),
14399
- Action.text
14400
- ] }, Action.key),
14401
- onSelect: (_a2 = Action.buttonProps) == null ? void 0 : _a2.onClick
14426
+ leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Action.Icon, {}),
14427
+ children: Action.text,
14428
+ onClick: (_a2 = Action.buttonProps) == null ? void 0 : _a2.onClick
14402
14429
  };
14403
14430
  })
14404
14431
  }
@@ -14456,10 +14483,8 @@ var __publicField = (obj, key, value) => {
14456
14483
  const field = FieldTypeToClsMapping[identifier];
14457
14484
  const Icon = field.Icon;
14458
14485
  return {
14459
- content: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
14460
- /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
14461
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { children: field.fieldTypeName })
14462
- ] }, identifier),
14486
+ children: field.fieldTypeName,
14487
+ leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
14463
14488
  value: identifier,
14464
14489
  onSelect: () => {
14465
14490
  onSelect(identifier);
@@ -14663,7 +14688,7 @@ var __publicField = (obj, key, value) => {
14663
14688
  }
14664
14689
  ),
14665
14690
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "3", children: [
14666
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Badge, { className: styles.typeBadge, children: (_f = fieldTypeItems.flat().find((item) => item.value === type)) == null ? void 0 : _f.content }),
14691
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Badge, { className: styles.typeBadge, children: (_f = fieldTypeItems.flat().find((item) => item.value === type)) == null ? void 0 : _f.children }),
14667
14692
  showPopoverInputs && /* @__PURE__ */ jsxRuntime.jsx(FieldSettingsPopover, { popoverInputs, hasError: popoverHasErrors })
14668
14693
  ] }),
14669
14694
  resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -15024,7 +15049,7 @@ var __publicField = (obj, key, value) => {
15024
15049
  )),
15025
15050
  droppableProvided.placeholder,
15026
15051
  /* @__PURE__ */ jsxRuntime.jsx(
15027
- blocks.DropdownItemMenu,
15052
+ blocks.OvermapDropdownMenu,
15028
15053
  {
15029
15054
  trigger: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", children: [
15030
15055
  /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiAddLine" }),