@iblai/data-layer 1.12.3 → 1.12.4

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
@@ -45179,6 +45179,8 @@ useGetClawInstancesQuery, useLazyGetClawInstancesQuery, useGetClawInstanceQuery,
45179
45179
  useGetAgentConfigQuery, useLazyGetAgentConfigQuery, useUpdateAgentConfigMutation, } = clawApiSlice;
45180
45180
 
45181
45181
  const AGENT_SKILLS_REDUCER_PATH = 'agentSkillsApiSlice';
45182
+ /** Default page size for the chat `/` picker's lazy-loaded skills list. */
45183
+ const MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE = 20;
45182
45184
  const AGENT_SKILLS_TAG_TYPES = [
45183
45185
  'AgentSkills',
45184
45186
  'AgentSkillResources',
@@ -45265,6 +45267,8 @@ const agentSkillsApiSlice = react.createApi({
45265
45267
  tagTypes: [...AGENT_SKILLS_TAG_TYPES],
45266
45268
  endpoints: (builder) => ({
45267
45269
  // ── Agent Skills (platform-level) ─────────────────────────────────────
45270
+ // Returns the paginated envelope so list UIs can page on `count`;
45271
+ // bare-array responses are normalized into a single-page envelope.
45268
45272
  getAgentSkills: builder.query({
45269
45273
  query: (args) => ({
45270
45274
  url: AGENT_SKILLS_ENDPOINTS.GET_AGENT_SKILLS.path(args.org),
@@ -45276,7 +45280,9 @@ const agentSkillsApiSlice = react.createApi({
45276
45280
  ...(args.offset !== undefined && { offset: args.offset }),
45277
45281
  },
45278
45282
  }),
45279
- transformResponse: (response) => normalizeList(response),
45283
+ transformResponse: (response) => Array.isArray(response)
45284
+ ? { count: response.length, next: null, previous: null, results: response }
45285
+ : response,
45280
45286
  providesTags: ['AgentSkills'],
45281
45287
  }),
45282
45288
  getAgentSkill: builder.query({
@@ -45441,6 +45447,41 @@ const agentSkillsApiSlice = react.createApi({
45441
45447
  { type: 'MentorSkillAssignments', id: args.mentorUniqueId },
45442
45448
  ],
45443
45449
  }),
45450
+ // Same resource as getMentorSkillAssignments, but cached as ONE growing
45451
+ // entry per (org, mentor) for lazy loading (chat `/` picker): increasing
45452
+ // `offset` appends deduped rows; `offset: 0` (or an invalidation refetch)
45453
+ // replaces the list.
45454
+ getMentorSkillAssignmentsInfinite: builder.query({
45455
+ query: (args) => {
45456
+ var _a, _b;
45457
+ return ({
45458
+ url: AGENT_SKILLS_ENDPOINTS.GET_MENTOR_SKILL_ASSIGNMENTS.path(args.org, args.mentorUniqueId),
45459
+ service: AGENT_SKILLS_ENDPOINTS.GET_MENTOR_SKILL_ASSIGNMENTS.service,
45460
+ params: {
45461
+ ...(args.enabled !== undefined && { enabled: args.enabled }),
45462
+ limit: (_a = args.limit) !== null && _a !== void 0 ? _a : MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE,
45463
+ offset: (_b = args.offset) !== null && _b !== void 0 ? _b : 0,
45464
+ },
45465
+ });
45466
+ },
45467
+ transformResponse: (response) => Array.isArray(response)
45468
+ ? { count: response.length, next: null, previous: null, results: response }
45469
+ : response,
45470
+ serializeQueryArgs: ({ queryArgs, endpointName }) => `${endpointName}(${queryArgs.org}:${queryArgs.mentorUniqueId})`,
45471
+ merge: (currentCache, newData, { arg }) => {
45472
+ if (!arg.offset)
45473
+ return newData;
45474
+ const seen = new Set(currentCache.results.map((row) => row.id));
45475
+ currentCache.count = newData.count;
45476
+ currentCache.next = newData.next;
45477
+ currentCache.previous = newData.previous;
45478
+ currentCache.results.push(...newData.results.filter((row) => !seen.has(row.id)));
45479
+ },
45480
+ forceRefetch: ({ currentArg, previousArg }) => (currentArg === null || currentArg === void 0 ? void 0 : currentArg.offset) !== (previousArg === null || previousArg === void 0 ? void 0 : previousArg.offset) || (currentArg === null || currentArg === void 0 ? void 0 : currentArg.limit) !== (previousArg === null || previousArg === void 0 ? void 0 : previousArg.limit),
45481
+ providesTags: (_result, _error, args) => [
45482
+ { type: 'MentorSkillAssignments', id: args.mentorUniqueId },
45483
+ ],
45484
+ }),
45444
45485
  getMentorSkillAssignment: builder.query({
45445
45486
  query: (args) => ({
45446
45487
  url: AGENT_SKILLS_ENDPOINTS.GET_MENTOR_SKILL_ASSIGNMENT.path(args.org, args.mentorUniqueId, args.assignmentPk),
@@ -45495,7 +45536,7 @@ useGetAgentSkillsQuery, useLazyGetAgentSkillsQuery, useGetAgentSkillQuery, useCr
45495
45536
  // Agent Skill Resources
45496
45537
  useGetAgentSkillResourcesQuery, useLazyGetAgentSkillResourcesQuery, useGetAgentSkillResourceQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation,
45497
45538
  // Mentor Skill Assignments
45498
- useGetMentorSkillAssignmentsQuery, useLazyGetMentorSkillAssignmentsQuery, useGetMentorSkillAssignmentQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, } = agentSkillsApiSlice;
45539
+ useGetMentorSkillAssignmentsQuery, useLazyGetMentorSkillAssignmentsQuery, useGetMentorSkillAssignmentsInfiniteQuery, useLazyGetMentorSkillAssignmentsInfiniteQuery, useGetMentorSkillAssignmentQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, } = agentSkillsApiSlice;
45499
45540
 
45500
45541
  /**
45501
45542
  * Template slugs that resolve to the "base-agent" mentor type on the backend
@@ -47603,6 +47644,7 @@ exports.MENTORS_REDUCER_PATH = MENTORS_REDUCER_PATH;
47603
47644
  exports.MENTOR_CUSTOM_ENDPOINTS = MENTOR_CUSTOM_ENDPOINTS;
47604
47645
  exports.MENTOR_CUSTOM_REDUCER_PATH = MENTOR_CUSTOM_REDUCER_PATH;
47605
47646
  exports.MENTOR_ENDPOINTS = MENTOR_ENDPOINTS;
47647
+ exports.MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE = MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE;
47606
47648
  exports.NOTIFICATIONS_CUSTOM_ENDPOINTS = NOTIFICATIONS_CUSTOM_ENDPOINTS;
47607
47649
  exports.NOTIFICATIONS_CUSTOM_REDUCER_PATH = NOTIFICATIONS_CUSTOM_REDUCER_PATH;
47608
47650
  exports.NOTIFICATIONS_CUSTOM_TAGS = NOTIFICATIONS_CUSTOM_TAGS;
@@ -48002,6 +48044,7 @@ exports.useGetMentorMemoriesQuery = useGetMentorMemoriesQuery;
48002
48044
  exports.useGetMentorPublicSettingsQuery = useGetMentorPublicSettingsQuery;
48003
48045
  exports.useGetMentorSettingsQuery = useGetMentorSettingsQuery;
48004
48046
  exports.useGetMentorSkillAssignmentQuery = useGetMentorSkillAssignmentQuery;
48047
+ exports.useGetMentorSkillAssignmentsInfiniteQuery = useGetMentorSkillAssignmentsInfiniteQuery;
48005
48048
  exports.useGetMentorSkillAssignmentsQuery = useGetMentorSkillAssignmentsQuery;
48006
48049
  exports.useGetMentorSummariesQuery = useGetMentorSummariesQuery;
48007
48050
  exports.useGetMentorsQuery = useGetMentorsQuery;
@@ -48231,6 +48274,7 @@ exports.useLazyGetMentorMemoriesListQuery = useLazyGetMentorMemoriesListQuery;
48231
48274
  exports.useLazyGetMentorMemoriesQuery = useLazyGetMentorMemoriesQuery;
48232
48275
  exports.useLazyGetMentorPublicSettingsQuery = useLazyGetMentorPublicSettingsQuery;
48233
48276
  exports.useLazyGetMentorSettingsQuery = useLazyGetMentorSettingsQuery;
48277
+ exports.useLazyGetMentorSkillAssignmentsInfiniteQuery = useLazyGetMentorSkillAssignmentsInfiniteQuery;
48234
48278
  exports.useLazyGetMentorSkillAssignmentsQuery = useLazyGetMentorSkillAssignmentsQuery;
48235
48279
  exports.useLazyGetMentorSummariesQuery = useLazyGetMentorSummariesQuery;
48236
48280
  exports.useLazyGetMentorsQuery = useLazyGetMentorsQuery;