@overmap-ai/core 1.0.48-fix-agent-errors.4 → 1.0.48-menu-improvements.0

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.
@@ -4242,10 +4242,20 @@ var __publicField = (obj, key, value) => {
4242
4242
  var _a2;
4243
4243
  return (_a2 = allMiddleware[0]) == null ? void 0 : _a2.run(action);
4244
4244
  }
4245
- const discardStatuses = [400, 409, 403, 404];
4245
+ const discardStatuses = [400, 409, 403, 404, 405, 500];
4246
4246
  const statusMessages = {
4247
4247
  403: { title: "Forbidden", description: "You are not authorized to perform this action.", severity: "danger" },
4248
- 404: { title: "Not found", description: "The requested resource was not found.", severity: "danger" }
4248
+ 404: { title: "Not found", description: "The requested resource was not found.", severity: "danger" },
4249
+ 405: {
4250
+ title: "Not supported",
4251
+ description: "It's not you. It's us. Sorry for the inconvenience.",
4252
+ severity: "danger"
4253
+ },
4254
+ 500: {
4255
+ title: "Server error",
4256
+ description: "Our server seems to be experiencing problems at the moment. We have been alerted and will fix the problem as soon as possible.",
4257
+ severity: "danger"
4258
+ }
4249
4259
  };
4250
4260
  function discard(reason, action, retries = 0) {
4251
4261
  var _a2;
@@ -7490,7 +7500,7 @@ var __publicField = (obj, key, value) => {
7490
7500
  * @param request The message to prompt the agent with.
7491
7501
  * @param conversationId If continuing an existing message, the UUID of that conversation.
7492
7502
  */
7493
- prompt(request2, conversationId) {
7503
+ async prompt(request2, conversationId) {
7494
7504
  const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
7495
7505
  return this.enqueueRequest({
7496
7506
  description: "Prompt agent",
@@ -7505,6 +7515,16 @@ var __publicField = (obj, key, value) => {
7505
7515
  queryParams: conversationId ? { conversation_id: conversationId } : {}
7506
7516
  });
7507
7517
  }
7518
+ async rate(responseId, rating) {
7519
+ return this.enqueueRequest({
7520
+ description: "Rate agent response",
7521
+ method: HttpMethod.PUT,
7522
+ url: `/agents/responses/${responseId}/rate/`,
7523
+ payload: { rating },
7524
+ blockers: ["rate"],
7525
+ blocks: ["rate"]
7526
+ });
7527
+ }
7508
7528
  }
7509
7529
  class OvermapSDK {
7510
7530
  constructor(apiUrl, store) {
@@ -12993,52 +13013,54 @@ var __publicField = (obj, key, value) => {
12993
13013
  Footer,
12994
13014
  Loading
12995
13015
  };
12996
- const ImageCard = React.memo((props) => {
12997
- const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
12998
- const fileCardRef = React.useRef(null);
12999
- const imageInsetRef = React.useRef(null);
13000
- const fileCardSize = blocks.useSize(fileCardRef);
13001
- React.useLayoutEffect(() => {
13002
- if (!imageInsetRef.current || !fileCardSize)
13003
- return;
13004
- imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13005
- }, [fileCardSize]);
13006
- const fileName2 = React.useMemo(() => {
13007
- if (!file)
13008
- return;
13009
- return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13010
- }, [file, truncateLength]);
13011
- return /* @__PURE__ */ jsxRuntime.jsxs(
13012
- Flex,
13013
- {
13014
- className: classNames$1(className, styles$4.ImageCard),
13015
- width: "100%",
13016
- direction: "column",
13017
- position: "relative",
13018
- height: "max-content",
13019
- gap: "0",
13020
- ...rest,
13021
- children: [
13022
- !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13023
- /* @__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 }) }),
13024
- /* @__PURE__ */ jsxRuntime.jsx(
13025
- blocks.OvermapItem,
13026
- {
13027
- className: classNames$1(styles$4.Footer, {
13028
- [styles$4.Loading]: !file
13029
- }),
13030
- size,
13031
- ref: fileCardRef,
13032
- leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13033
- rightSlot,
13034
- children: error2 ?? fileName2
13035
- }
13036
- )
13037
- ]
13038
- }
13039
- );
13040
- });
13041
- ImageCard.displayName = "ImageCard";
13016
+ const ImageCard = React.memo(
13017
+ React.forwardRef((props, forwardedRef) => {
13018
+ const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
13019
+ const fileCardRef = React.useRef(null);
13020
+ const imageInsetRef = React.useRef(null);
13021
+ const fileCardSize = blocks.useSize(fileCardRef);
13022
+ React.useLayoutEffect(() => {
13023
+ if (!imageInsetRef.current || !fileCardSize)
13024
+ return;
13025
+ imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13026
+ }, [fileCardSize]);
13027
+ const fileName2 = React.useMemo(() => {
13028
+ if (!file)
13029
+ return;
13030
+ return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13031
+ }, [file, truncateLength]);
13032
+ return /* @__PURE__ */ jsxRuntime.jsxs(
13033
+ Flex,
13034
+ {
13035
+ className: classNames$1(className, styles$4.ImageCard),
13036
+ width: "100%",
13037
+ direction: "column",
13038
+ position: "relative",
13039
+ height: "max-content",
13040
+ gap: "0",
13041
+ ref: forwardedRef,
13042
+ ...rest,
13043
+ children: [
13044
+ !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13045
+ /* @__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 }) }),
13046
+ /* @__PURE__ */ jsxRuntime.jsx(
13047
+ blocks.OvermapItem,
13048
+ {
13049
+ className: classNames$1(styles$4.Footer, {
13050
+ [styles$4.Loading]: !file
13051
+ }),
13052
+ size,
13053
+ ref: fileCardRef,
13054
+ leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13055
+ rightSlot,
13056
+ children: error2 ?? fileName2
13057
+ }
13058
+ )
13059
+ ]
13060
+ }
13061
+ );
13062
+ })
13063
+ );
13042
13064
  const UploadInput = React.memo((props) => {
13043
13065
  var _a2;
13044
13066
  const [{ inputId, labelId, size, severity, helpText, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);