@overmap-ai/core 1.0.53-add-agent-conversations.22 → 1.0.53-add-agent-conversations.24

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.
@@ -1617,13 +1617,138 @@ var __publicField = (obj, key, value) => {
1617
1617
  }
1618
1618
  }
1619
1619
  const initialState$q = {
1620
+ componentTypes: {},
1621
+ hiddenComponentTypeIds: {},
1622
+ attachments: {}
1623
+ };
1624
+ const componentTypeSlice = toolkit.createSlice({
1625
+ name: "componentTypes",
1626
+ initialState: initialState$q,
1627
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1628
+ reducers: {
1629
+ addComponentType: (state, action) => {
1630
+ state.componentTypes[action.payload.offline_id] = action.payload;
1631
+ },
1632
+ setComponentTypes: (state, action) => {
1633
+ state.componentTypes = toOfflineIdRecord(action.payload);
1634
+ },
1635
+ toggleComponentTypeVisibility: (state, action) => {
1636
+ state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1637
+ },
1638
+ deleteComponentType: (state, action) => {
1639
+ delete state.componentTypes[action.payload];
1640
+ },
1641
+ // Attachments
1642
+ setComponentTypeAttachment: setAttachment,
1643
+ setComponentTypeAttachments: setAttachments,
1644
+ addComponentTypeAttachment: addAttachment,
1645
+ addComponentTypeAttachments: addAttachments,
1646
+ updateComponentTypeAttachment: updateAttachment,
1647
+ updateComponentTypeAttachments: updateAttachments,
1648
+ removeComponentTypeAttachment: removeAttachment,
1649
+ removeComponentTypeAttachments: removeAttachments
1650
+ }
1651
+ });
1652
+ const {
1653
+ addComponentType,
1654
+ setComponentTypes,
1655
+ toggleComponentTypeVisibility,
1656
+ deleteComponentType,
1657
+ // Attachmet
1658
+ setComponentTypeAttachment,
1659
+ setComponentTypeAttachments,
1660
+ addComponentTypeAttachment,
1661
+ addComponentTypeAttachments,
1662
+ updateComponentTypeAttachment,
1663
+ updateComponentTypeAttachments,
1664
+ removeComponentTypeAttachment,
1665
+ removeComponentTypeAttachments
1666
+ } = componentTypeSlice.actions;
1667
+ const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
1668
+ const selectComponentTypes = toolkit.createSelector(
1669
+ [selectComponentTypesMapping],
1670
+ (mapping) => Object.values(mapping)
1671
+ );
1672
+ const selectComponentType = restructureCreateSelectorWithArgs(
1673
+ toolkit.createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
1674
+ );
1675
+ const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1676
+ toolkit.createSelector(
1677
+ [
1678
+ selectComponentTypesMapping,
1679
+ (_state, args) => args
1680
+ ],
1681
+ (mapping, args) => {
1682
+ var _a2;
1683
+ const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
1684
+ return Object.values(mapping).filter(
1685
+ (componentType) => {
1686
+ var _a3;
1687
+ return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
1688
+ }
1689
+ ).length;
1690
+ }
1691
+ )
1692
+ );
1693
+ const selectComponentTypesByName = restructureCreateSelectorWithArgs(
1694
+ toolkit.createSelector(
1695
+ [selectComponentTypesMapping, (_state, name) => name],
1696
+ (mapping, name) => {
1697
+ name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1698
+ return Object.values(mapping).filter(
1699
+ (componentType) => {
1700
+ var _a2;
1701
+ return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1702
+ }
1703
+ );
1704
+ }
1705
+ )
1706
+ );
1707
+ const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
1708
+ const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
1709
+ const selectAllComponentTypeAttachments = toolkit.createSelector(
1710
+ [selectComponentTypeAttachmentMapping],
1711
+ (mapping) => Object.values(mapping)
1712
+ );
1713
+ const selectComponentTypeAttachment = (attachmentId) => (state) => {
1714
+ return state.componentTypeReducer.attachments[attachmentId];
1715
+ };
1716
+ const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
1717
+ toolkit.createSelector(
1718
+ [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1719
+ (attachments, componentTypeId) => {
1720
+ return attachments.filter(({ component_type }) => componentTypeId === component_type);
1721
+ }
1722
+ )
1723
+ );
1724
+ const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
1725
+ toolkit.createSelector(
1726
+ [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1727
+ (attachments, componentTypeId) => {
1728
+ const attachmentsOfComponent = attachments.filter(
1729
+ ({ component_type }) => component_type === componentTypeId
1730
+ );
1731
+ const fileAttachments = attachmentsOfComponent.filter(
1732
+ // this null check here is necessary, there are cases where file_type is null or undefined
1733
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
1734
+ );
1735
+ const imageAttachments = attachmentsOfComponent.filter(
1736
+ // this null check here is necessary, there are cases where file_type is null or undefined
1737
+ ({ file_type }) => file_type && file_type.startsWith("image/")
1738
+ );
1739
+ return { fileAttachments, imageAttachments };
1740
+ }
1741
+ )
1742
+ );
1743
+ const componentTypeReducer = componentTypeSlice.reducer;
1744
+ const initialState$p = {
1620
1745
  components: {},
1621
1746
  attachments: {}
1622
1747
  };
1623
1748
  const componentSlice = toolkit.createSlice({
1624
1749
  name: "components",
1625
- initialState: initialState$q,
1626
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1750
+ initialState: initialState$p,
1751
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1627
1752
  reducers: {
1628
1753
  addComponent: (state, action) => {
1629
1754
  state.components[action.payload.offline_id] = action.payload;
@@ -1698,36 +1823,41 @@ var __publicField = (obj, key, value) => {
1698
1823
  return prevComponents;
1699
1824
  };
1700
1825
  const selectComponentsMapping = (state) => state.componentReducer.components;
1701
- const selectComponentsFromComponentType = (componentTypeId) => (state) => {
1702
- if (!componentTypeId)
1703
- return [];
1704
- const components = selectComponents(state);
1705
- return components.filter((component) => component.component_type === componentTypeId);
1706
- };
1826
+ const selectComponentsFromComponentType = restructureCreateSelectorWithArgs(
1827
+ toolkit.createSelector(
1828
+ [selectComponents, (_state, componentTypeId) => componentTypeId],
1829
+ (components, componentTypeId) => {
1830
+ if (!componentTypeId)
1831
+ return [];
1832
+ return components.filter((component) => component.component_type === componentTypeId);
1833
+ }
1834
+ )
1835
+ );
1707
1836
  const selectComponent = (componentId) => (state) => {
1708
1837
  return state.componentReducer.components[componentId];
1709
1838
  };
1710
1839
  const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
1711
1840
  return state.componentTypeReducer.componentTypes[componentTypeId];
1712
1841
  };
1713
- const selectComponentTypeFromComponents = (state) => {
1714
- const ret = {};
1715
- const componentTypes = state.componentTypeReducer.componentTypes;
1716
- const components = state.componentReducer.components;
1717
- for (const [componentId, component] of Object.entries(components)) {
1718
- const componentType = componentTypes[component.component_type];
1719
- if (!componentType) {
1720
- console.error(
1721
- `Component type with ID ${component.component_type} not found.
1842
+ const selectComponentTypeFromComponents = toolkit.createSelector(
1843
+ [selectComponents, selectComponentTypesMapping],
1844
+ (components, componentTypeMapping) => {
1845
+ const ret = {};
1846
+ for (const component of components) {
1847
+ const componentType = componentTypeMapping[component.component_type];
1848
+ if (!componentType) {
1849
+ console.error(
1850
+ `Component type with ID ${component.component_type} not found.
1722
1851
  Expected all referenced component types to be populated.
1723
1852
  Returning empty object to avoid fatal errors.`
1724
- );
1725
- return {};
1853
+ );
1854
+ return {};
1855
+ }
1856
+ ret[component.offline_id] = componentType;
1726
1857
  }
1727
- ret[componentId] = componentType;
1858
+ return ret;
1728
1859
  }
1729
- return ret;
1730
- };
1860
+ );
1731
1861
  const selectComponentsByType = restructureCreateSelectorWithArgs(
1732
1862
  toolkit.createSelector(
1733
1863
  [selectComponents, (_state, componentTypeId) => componentTypeId],
@@ -1785,13 +1915,13 @@ var __publicField = (obj, key, value) => {
1785
1915
  )
1786
1916
  );
1787
1917
  const componentReducer = componentSlice.reducer;
1788
- const initialState$p = {
1918
+ const initialState$o = {
1789
1919
  completionsByComponentId: {}
1790
1920
  };
1791
1921
  const componentStageCompletionSlice = toolkit.createSlice({
1792
1922
  name: "componentStageCompletions",
1793
- initialState: initialState$p,
1794
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1923
+ initialState: initialState$o,
1924
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1795
1925
  reducers: {
1796
1926
  addStageCompletion: (state, action) => {
1797
1927
  let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
@@ -1842,13 +1972,13 @@ var __publicField = (obj, key, value) => {
1842
1972
  return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1843
1973
  };
1844
1974
  const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1845
- const initialState$o = {
1975
+ const initialState$n = {
1846
1976
  stages: {}
1847
1977
  };
1848
1978
  const componentStageSlice = toolkit.createSlice({
1849
1979
  name: "componentStages",
1850
- initialState: initialState$o,
1851
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1980
+ initialState: initialState$n,
1981
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1852
1982
  reducers: {
1853
1983
  addStages: (state, action) => {
1854
1984
  Object.assign(state.stages, toOfflineIdRecord(action.payload));
@@ -1958,131 +2088,6 @@ var __publicField = (obj, key, value) => {
1958
2088
  );
1959
2089
  const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
1960
2090
  const componentStageReducer = componentStageSlice.reducer;
1961
- const initialState$n = {
1962
- componentTypes: {},
1963
- hiddenComponentTypeIds: {},
1964
- attachments: {}
1965
- };
1966
- const componentTypeSlice = toolkit.createSlice({
1967
- name: "componentTypes",
1968
- initialState: initialState$n,
1969
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1970
- reducers: {
1971
- addComponentType: (state, action) => {
1972
- state.componentTypes[action.payload.offline_id] = action.payload;
1973
- },
1974
- setComponentTypes: (state, action) => {
1975
- state.componentTypes = toOfflineIdRecord(action.payload);
1976
- },
1977
- toggleComponentTypeVisibility: (state, action) => {
1978
- state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1979
- },
1980
- deleteComponentType: (state, action) => {
1981
- delete state.componentTypes[action.payload];
1982
- },
1983
- // Attachments
1984
- setComponentTypeAttachment: setAttachment,
1985
- setComponentTypeAttachments: setAttachments,
1986
- addComponentTypeAttachment: addAttachment,
1987
- addComponentTypeAttachments: addAttachments,
1988
- updateComponentTypeAttachment: updateAttachment,
1989
- updateComponentTypeAttachments: updateAttachments,
1990
- removeComponentTypeAttachment: removeAttachment,
1991
- removeComponentTypeAttachments: removeAttachments
1992
- }
1993
- });
1994
- const {
1995
- addComponentType,
1996
- setComponentTypes,
1997
- toggleComponentTypeVisibility,
1998
- deleteComponentType,
1999
- // Attachmet
2000
- setComponentTypeAttachment,
2001
- setComponentTypeAttachments,
2002
- addComponentTypeAttachment,
2003
- addComponentTypeAttachments,
2004
- updateComponentTypeAttachment,
2005
- updateComponentTypeAttachments,
2006
- removeComponentTypeAttachment,
2007
- removeComponentTypeAttachments
2008
- } = componentTypeSlice.actions;
2009
- const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
2010
- const selectComponentTypes = toolkit.createSelector(
2011
- [selectComponentTypesMapping],
2012
- (mapping) => Object.values(mapping)
2013
- );
2014
- const selectComponentType = restructureCreateSelectorWithArgs(
2015
- toolkit.createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
2016
- );
2017
- const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
2018
- toolkit.createSelector(
2019
- [
2020
- selectComponentTypesMapping,
2021
- (_state, args) => args
2022
- ],
2023
- (mapping, args) => {
2024
- var _a2;
2025
- const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
2026
- return Object.values(mapping).filter(
2027
- (componentType) => {
2028
- var _a3;
2029
- return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
2030
- }
2031
- ).length;
2032
- }
2033
- )
2034
- );
2035
- const selectComponentTypesByName = restructureCreateSelectorWithArgs(
2036
- toolkit.createSelector(
2037
- [selectComponentTypesMapping, (_state, name) => name],
2038
- (mapping, name) => {
2039
- name = (name == null ? void 0 : name.toLowerCase()) ?? null;
2040
- return Object.values(mapping).filter(
2041
- (componentType) => {
2042
- var _a2;
2043
- return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
2044
- }
2045
- );
2046
- }
2047
- )
2048
- );
2049
- const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
2050
- const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
2051
- const selectAllComponentTypeAttachments = toolkit.createSelector(
2052
- [selectComponentTypeAttachmentMapping],
2053
- (mapping) => Object.values(mapping)
2054
- );
2055
- const selectComponentTypeAttachment = (attachmentId) => (state) => {
2056
- return state.componentTypeReducer.attachments[attachmentId];
2057
- };
2058
- const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
2059
- toolkit.createSelector(
2060
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
2061
- (attachments, componentTypeId) => {
2062
- return attachments.filter(({ component_type }) => componentTypeId === component_type);
2063
- }
2064
- )
2065
- );
2066
- const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
2067
- toolkit.createSelector(
2068
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
2069
- (attachments, componentTypeId) => {
2070
- const attachmentsOfComponent = attachments.filter(
2071
- ({ component_type }) => component_type === componentTypeId
2072
- );
2073
- const fileAttachments = attachmentsOfComponent.filter(
2074
- // this null check here is necessary, there are cases where file_type is null or undefined
2075
- ({ file_type }) => !file_type || !file_type.startsWith("image/")
2076
- );
2077
- const imageAttachments = attachmentsOfComponent.filter(
2078
- // this null check here is necessary, there are cases where file_type is null or undefined
2079
- ({ file_type }) => file_type && file_type.startsWith("image/")
2080
- );
2081
- return { fileAttachments, imageAttachments };
2082
- }
2083
- )
2084
- );
2085
- const componentTypeReducer = componentTypeSlice.reducer;
2086
2091
  const initialState$m = {
2087
2092
  workspaces: {},
2088
2093
  activeWorkspaceId: null
@@ -6323,7 +6328,8 @@ var __publicField = (obj, key, value) => {
6323
6328
  if (error2 instanceof APIError) {
6324
6329
  (_a2 = blocks.unsafeShowToast) == null ? void 0 : _a2.call(blocks, {
6325
6330
  title: "Could not create issue",
6326
- description: "An unexpected error occurred while creating the issue."
6331
+ description: error2.message,
6332
+ severity: "danger"
6327
6333
  });
6328
6334
  }
6329
6335
  store.dispatch(removeIssue(issuePayload.offline_id));