@iblai/data-layer 1.29.0 → 1.29.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/dist/index.js CHANGED
@@ -45286,6 +45286,7 @@ const MEMORY_QUERY_KEYS = {
45286
45286
  MEMSEARCH_MEMORY_CATEGORIES: () => ['MEMSEARCH_MEMORY_CATEGORIES'],
45287
45287
  MEMSEARCH_PLATFORM_CONFIG: () => ['MEMSEARCH_PLATFORM_CONFIG'],
45288
45288
  MEMSEARCH_STATUS: () => ['MEMSEARCH_STATUS'],
45289
+ MEMSEARCH_SHARED_MEMORIES: () => ['MEMSEARCH_SHARED_MEMORIES'],
45289
45290
  };
45290
45291
  const MEMSEARCH_ENDPOINTS = {
45291
45292
  // User Memory Settings
@@ -45371,6 +45372,23 @@ const MEMSEARCH_ENDPOINTS = {
45371
45372
  service: exports.SERVICES.AXD,
45372
45373
  path: (org, userId) => `/api/ai-mentor/orgs/${org}/users/${userId}/memsearch-status/`,
45373
45374
  },
45375
+ // Shared Memories are the backend's "agent memories", hence the /agent-memories/ path
45376
+ GET_SHARED_MEMORIES: {
45377
+ service: exports.SERVICES.AXD,
45378
+ path: (org, mentorId) => `/api/ai-mentor/orgs/${org}/mentors/${mentorId}/agent-memories/`,
45379
+ },
45380
+ CREATE_SHARED_MEMORY: {
45381
+ service: exports.SERVICES.AXD,
45382
+ path: (org, mentorId) => `/api/ai-mentor/orgs/${org}/mentors/${mentorId}/agent-memories/`,
45383
+ },
45384
+ UPDATE_SHARED_MEMORY: {
45385
+ service: exports.SERVICES.AXD,
45386
+ path: (org, mentorId, memoryId) => `/api/ai-mentor/orgs/${org}/mentors/${mentorId}/agent-memories/${memoryId}/`,
45387
+ },
45388
+ DELETE_SHARED_MEMORY: {
45389
+ service: exports.SERVICES.AXD,
45390
+ path: (org, mentorId, memoryId) => `/api/ai-mentor/orgs/${org}/mentors/${mentorId}/agent-memories/${memoryId}/`,
45391
+ },
45374
45392
  };
45375
45393
 
45376
45394
  const memoryApiSlice = react.createApi({
@@ -45382,8 +45400,12 @@ const memoryApiSlice = react.createApi({
45382
45400
  ...MEMORY_QUERY_KEYS.MEMSEARCH_MEMORY_CATEGORIES(),
45383
45401
  ...MEMORY_QUERY_KEYS.MEMSEARCH_PLATFORM_CONFIG(),
45384
45402
  ...MEMORY_QUERY_KEYS.MEMSEARCH_STATUS(),
45403
+ ...MEMORY_QUERY_KEYS.MEMSEARCH_SHARED_MEMORIES(),
45385
45404
  ],
45386
- baseQuery: iblFetchBaseQuery,
45405
+ // Callers read the failure itself: the shared-memory UI tells a 409 (duplicate)
45406
+ // from a 400 (too short) from a 403 by status and body. `iblFetchBaseQuery`
45407
+ // throws its errors, which reach `.unwrap()` and the hooks as `{}`.
45408
+ baseQuery: withReturnedErrors(iblFetchBaseQuery),
45387
45409
  endpoints: (builder) => ({
45388
45410
  // User Memory Settings
45389
45411
  getUserMemorySettings: builder.query({
@@ -45547,9 +45569,50 @@ const memoryApiSlice = react.createApi({
45547
45569
  }),
45548
45570
  providesTags: MEMORY_QUERY_KEYS.MEMSEARCH_STATUS(),
45549
45571
  }),
45572
+ // Shared Memories (the backend's "agent memories")
45573
+ getSharedMemories: builder.query({
45574
+ query: (args) => ({
45575
+ url: MEMSEARCH_ENDPOINTS.GET_SHARED_MEMORIES.path(args.org, args.mentorId),
45576
+ service: MEMSEARCH_ENDPOINTS.GET_SHARED_MEMORIES.service,
45577
+ params: args.params,
45578
+ }),
45579
+ providesTags: MEMORY_QUERY_KEYS.MEMSEARCH_SHARED_MEMORIES(),
45580
+ }),
45581
+ createSharedMemory: builder.mutation({
45582
+ query: (args) => ({
45583
+ url: MEMSEARCH_ENDPOINTS.CREATE_SHARED_MEMORY.path(args.org, args.mentorId),
45584
+ service: MEMSEARCH_ENDPOINTS.CREATE_SHARED_MEMORY.service,
45585
+ method: 'POST',
45586
+ body: { content: args.content },
45587
+ }),
45588
+ // A 409 (duplicate) is a definitive answer, not a transient failure to retry.
45589
+ extraOptions: { maxRetries: 0 },
45590
+ invalidatesTags: MEMORY_QUERY_KEYS.MEMSEARCH_SHARED_MEMORIES(),
45591
+ }),
45592
+ updateSharedMemory: builder.mutation({
45593
+ query: (args) => ({
45594
+ url: MEMSEARCH_ENDPOINTS.UPDATE_SHARED_MEMORY.path(args.org, args.mentorId, args.memoryId),
45595
+ service: MEMSEARCH_ENDPOINTS.UPDATE_SHARED_MEMORY.service,
45596
+ method: 'PATCH',
45597
+ body: { content: args.content },
45598
+ }),
45599
+ // A 409 (duplicate) is a definitive answer, not a transient failure to retry.
45600
+ extraOptions: { maxRetries: 0 },
45601
+ invalidatesTags: MEMORY_QUERY_KEYS.MEMSEARCH_SHARED_MEMORIES(),
45602
+ }),
45603
+ deleteSharedMemory: builder.mutation({
45604
+ query: (args) => ({
45605
+ url: MEMSEARCH_ENDPOINTS.DELETE_SHARED_MEMORY.path(args.org, args.mentorId, args.memoryId),
45606
+ service: MEMSEARCH_ENDPOINTS.DELETE_SHARED_MEMORY.service,
45607
+ method: 'DELETE',
45608
+ }),
45609
+ // A 404 (already gone) or 403 is a definitive answer, not a transient failure to retry.
45610
+ extraOptions: { maxRetries: 0 },
45611
+ invalidatesTags: MEMORY_QUERY_KEYS.MEMSEARCH_SHARED_MEMORIES(),
45612
+ }),
45550
45613
  }),
45551
45614
  });
45552
- const { useGetUserMemorySettingsQuery, useLazyGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useLazyGetGlobalMemoriesQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useDeleteGlobalMemoryMutation, useGetMentorMemoriesQuery, useLazyGetMentorMemoriesQuery, useGetMentorMemoriesListQuery, useLazyGetMentorMemoriesListQuery, useGetAllMentorMemoriesQuery, useLazyGetAllMentorMemoriesQuery, useCreateMentorMemoryMutation, useUpdateMentorMemoryMutation, useDeleteMentorMemoryMutation, useGetMemoryCategoriesAdminQuery, useLazyGetMemoryCategoriesAdminQuery, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetMemsearchConfigQuery, useLazyGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetMemsearchStatusQuery, useLazyGetMemsearchStatusQuery, } = memoryApiSlice;
45615
+ const { useGetUserMemorySettingsQuery, useLazyGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useLazyGetGlobalMemoriesQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useDeleteGlobalMemoryMutation, useGetMentorMemoriesQuery, useLazyGetMentorMemoriesQuery, useGetMentorMemoriesListQuery, useLazyGetMentorMemoriesListQuery, useGetAllMentorMemoriesQuery, useLazyGetAllMentorMemoriesQuery, useCreateMentorMemoryMutation, useUpdateMentorMemoryMutation, useDeleteMentorMemoryMutation, useGetMemoryCategoriesAdminQuery, useLazyGetMemoryCategoriesAdminQuery, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetMemsearchConfigQuery, useLazyGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetMemsearchStatusQuery, useLazyGetMemsearchStatusQuery, useGetSharedMemoriesQuery, useLazyGetSharedMemoriesQuery, useCreateSharedMemoryMutation, useUpdateSharedMemoryMutation, useDeleteSharedMemoryMutation, } = memoryApiSlice;
45553
45616
 
45554
45617
  const MCP_REDUCER_PATH = 'mcpApiSlice';
45555
45618
  const MCP_ENDPOINTS = {
@@ -46572,7 +46635,7 @@ const CUSTOM_DOMAIN_REDUCER_PATH = 'customDomainApiSlice';
46572
46635
  const CUSTOM_DOMAIN_ENDPOINTS = {
46573
46636
  GET_CUSTOM_DOMAINS: {
46574
46637
  service: exports.SERVICES.DM,
46575
- path: () => `/api/custom-domains`,
46638
+ path: () => `/api/custom-domains/`,
46576
46639
  },
46577
46640
  CREATE_CUSTOM_DOMAIN: {
46578
46641
  service: exports.SERVICES.DM,
@@ -50119,6 +50182,7 @@ exports.useCreateRedirectTokenMutation = useCreateRedirectTokenMutation;
50119
50182
  exports.useCreateReportMutation = useCreateReportMutation;
50120
50183
  exports.useCreateSessionIdMutation = useCreateSessionIdMutation;
50121
50184
  exports.useCreateShareableLinkMutation = useCreateShareableLinkMutation;
50185
+ exports.useCreateSharedMemoryMutation = useCreateSharedMemoryMutation;
50122
50186
  exports.useCreateStripeCheckoutSessionMutation = useCreateStripeCheckoutSessionMutation;
50123
50187
  exports.useCreateStripeCustomerPortalMutation = useCreateStripeCustomerPortalMutation;
50124
50188
  exports.useCreateStudioCourseMutation = useCreateStudioCourseMutation;
@@ -50184,6 +50248,7 @@ exports.useDeleteRbacGroupMutation = useDeleteRbacGroupMutation;
50184
50248
  exports.useDeleteRbacPolicyMutation = useDeleteRbacPolicyMutation;
50185
50249
  exports.useDeleteRbacRoleMutation = useDeleteRbacRoleMutation;
50186
50250
  exports.useDeleteRecommendedPromptMutation = useDeleteRecommendedPromptMutation;
50251
+ exports.useDeleteSharedMemoryMutation = useDeleteSharedMemoryMutation;
50187
50252
  exports.useDeleteStudioCourseMutation = useDeleteStudioCourseMutation;
50188
50253
  exports.useDeleteSupportTicketMessageMutation = useDeleteSupportTicketMessageMutation;
50189
50254
  exports.useDeleteSupportTicketMutation = useDeleteSupportTicketMutation;
@@ -50407,6 +50472,7 @@ exports.useGetSessionIdQuery = useGetSessionIdQuery;
50407
50472
  exports.useGetSessionStatsQuery = useGetSessionStatsQuery;
50408
50473
  exports.useGetShareableLinkPublicQuery = useGetShareableLinkPublicQuery;
50409
50474
  exports.useGetShareableLinkQuery = useGetShareableLinkQuery;
50475
+ exports.useGetSharedMemoriesQuery = useGetSharedMemoriesQuery;
50410
50476
  exports.useGetSharedSessionIdQuery = useGetSharedSessionIdQuery;
50411
50477
  exports.useGetSkillsPointsPercentileQuery = useGetSkillsPointsPercentileQuery;
50412
50478
  exports.useGetSpendCapStatusQuery = useGetSpendCapStatusQuery;
@@ -50641,6 +50707,7 @@ exports.useLazyGetSearchGlobalQuery = useLazyGetSearchGlobalQuery;
50641
50707
  exports.useLazyGetSessionIdQuery = useLazyGetSessionIdQuery;
50642
50708
  exports.useLazyGetShareableLinkPublicQuery = useLazyGetShareableLinkPublicQuery;
50643
50709
  exports.useLazyGetShareableLinkQuery = useLazyGetShareableLinkQuery;
50710
+ exports.useLazyGetSharedMemoriesQuery = useLazyGetSharedMemoriesQuery;
50644
50711
  exports.useLazyGetSharedSessionIdQuery = useLazyGetSharedSessionIdQuery;
50645
50712
  exports.useLazyGetSkillsPointsPercentileQuery = useLazyGetSkillsPointsPercentileQuery;
50646
50713
  exports.useLazyGetSpendCapStatusQuery = useLazyGetSpendCapStatusQuery;
@@ -50846,6 +50913,7 @@ exports.useUpdateRbacRoleMutation = useUpdateRbacRoleMutation;
50846
50913
  exports.useUpdateRecommendedPromptMutation = useUpdateRecommendedPromptMutation;
50847
50914
  exports.useUpdateSessionDisableChathistoryMutation = useUpdateSessionDisableChathistoryMutation;
50848
50915
  exports.useUpdateShareableLinkMutation = useUpdateShareableLinkMutation;
50916
+ exports.useUpdateSharedMemoryMutation = useUpdateSharedMemoryMutation;
50849
50917
  exports.useUpdateStudioCourseSettingsMutation = useUpdateStudioCourseSettingsMutation;
50850
50918
  exports.useUpdateStudioXblockMutation = useUpdateStudioXblockMutation;
50851
50919
  exports.useUpdateSupportTicketMessageMutation = useUpdateSupportTicketMessageMutation;