@overmap-ai/core 1.0.48-activity-history.4 → 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
  };
@@ -7701,7 +7719,7 @@ var __publicField = (obj, key, value) => {
7701
7719
  * @param request The message to prompt the agent with.
7702
7720
  * @param conversationId If continuing an existing message, the UUID of that conversation.
7703
7721
  */
7704
- prompt(request2, conversationId) {
7722
+ async prompt(request2, conversationId) {
7705
7723
  const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
7706
7724
  return this.enqueueRequest({
7707
7725
  description: "Prompt agent",
@@ -7716,6 +7734,16 @@ var __publicField = (obj, key, value) => {
7716
7734
  queryParams: conversationId ? { conversation_id: conversationId } : {}
7717
7735
  });
7718
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
+ }
7719
7747
  }
7720
7748
  class OvermapSDK {
7721
7749
  constructor(apiUrl, store) {
@@ -13205,52 +13233,54 @@ var __publicField = (obj, key, value) => {
13205
13233
  Footer,
13206
13234
  Loading
13207
13235
  };
13208
- const ImageCard = React.memo((props) => {
13209
- const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
13210
- const fileCardRef = React.useRef(null);
13211
- const imageInsetRef = React.useRef(null);
13212
- const fileCardSize = blocks.useSize(fileCardRef);
13213
- React.useLayoutEffect(() => {
13214
- if (!imageInsetRef.current || !fileCardSize)
13215
- return;
13216
- imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13217
- }, [fileCardSize]);
13218
- const fileName2 = React.useMemo(() => {
13219
- if (!file)
13220
- return;
13221
- return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13222
- }, [file, truncateLength]);
13223
- return /* @__PURE__ */ jsxRuntime.jsxs(
13224
- Flex,
13225
- {
13226
- className: classNames$1(className, styles$4.ImageCard),
13227
- width: "100%",
13228
- direction: "column",
13229
- position: "relative",
13230
- height: "max-content",
13231
- gap: "0",
13232
- ...rest,
13233
- children: [
13234
- !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13235
- /* @__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 }) }),
13236
- /* @__PURE__ */ jsxRuntime.jsx(
13237
- blocks.OvermapItem,
13238
- {
13239
- className: classNames$1(styles$4.Footer, {
13240
- [styles$4.Loading]: !file
13241
- }),
13242
- size,
13243
- ref: fileCardRef,
13244
- leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13245
- rightSlot,
13246
- children: error2 ?? fileName2
13247
- }
13248
- )
13249
- ]
13250
- }
13251
- );
13252
- });
13253
- 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
+ );
13254
13284
  const UploadInput = React.memo((props) => {
13255
13285
  var _a2;
13256
13286
  const [{ inputId, labelId, size, severity, helpText, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
@@ -14387,17 +14417,15 @@ var __publicField = (obj, key, value) => {
14387
14417
  Action.key
14388
14418
  )) }),
14389
14419
  /* @__PURE__ */ jsxRuntime.jsx(Box, { display: forMobile(true, "block"), children: /* @__PURE__ */ jsxRuntime.jsx(
14390
- blocks.DropdownItemMenu,
14420
+ blocks.OvermapDropdownMenu,
14391
14421
  {
14392
14422
  trigger: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiMore2Line" }) }),
14393
14423
  items: actions.map((Action) => {
14394
14424
  var _a2;
14395
14425
  return {
14396
- content: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { gap: "2", align: "center", children: [
14397
- /* @__PURE__ */ jsxRuntime.jsx(Action.Icon, {}),
14398
- Action.text
14399
- ] }, Action.key),
14400
- 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
14401
14429
  };
14402
14430
  })
14403
14431
  }
@@ -14455,10 +14483,8 @@ var __publicField = (obj, key, value) => {
14455
14483
  const field = FieldTypeToClsMapping[identifier];
14456
14484
  const Icon = field.Icon;
14457
14485
  return {
14458
- content: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
14459
- /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
14460
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { children: field.fieldTypeName })
14461
- ] }, identifier),
14486
+ children: field.fieldTypeName,
14487
+ leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
14462
14488
  value: identifier,
14463
14489
  onSelect: () => {
14464
14490
  onSelect(identifier);
@@ -14662,7 +14688,7 @@ var __publicField = (obj, key, value) => {
14662
14688
  }
14663
14689
  ),
14664
14690
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "3", children: [
14665
- /* @__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 }),
14666
14692
  showPopoverInputs && /* @__PURE__ */ jsxRuntime.jsx(FieldSettingsPopover, { popoverInputs, hasError: popoverHasErrors })
14667
14693
  ] }),
14668
14694
  resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -15023,7 +15049,7 @@ var __publicField = (obj, key, value) => {
15023
15049
  )),
15024
15050
  droppableProvided.placeholder,
15025
15051
  /* @__PURE__ */ jsxRuntime.jsx(
15026
- blocks.DropdownItemMenu,
15052
+ blocks.OvermapDropdownMenu,
15027
15053
  {
15028
15054
  trigger: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", children: [
15029
15055
  /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiAddLine" }),