@burdenoff/microfe-botmanor 2026.1127.4 → 2026.1127.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.
- package/dist/botlit/hooks/useSkills.d.ts +5 -1
- package/dist/botlit/hooks/useSkills.js +55 -37
- package/dist/botlit/hooks/useSkills.js.map +1 -1
- package/dist/botlit/pages/SkillsPage.js +171 -150
- package/dist/botlit/pages/SkillsPage.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +45 -0
- package/dist/generated/wspace-operations.js +44 -28
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ListBotmanorSkillsPageQuery } from '../../generated/wspace-operations';
|
|
1
2
|
import { CreateSkillInput, UpdateSkillInput } from '../../generated/wspace-types';
|
|
2
3
|
import { GraphQLInput } from './internal/mutationInput';
|
|
3
|
-
import { QueryResult } from './internal/workspaceGateway';
|
|
4
|
+
import { PaginatedQueryResult, QueryResult } from './internal/workspaceGateway';
|
|
4
5
|
export interface SkillRecord {
|
|
5
6
|
id: string;
|
|
6
7
|
name: string;
|
|
@@ -46,6 +47,8 @@ export declare const skillKeys: {
|
|
|
46
47
|
detail: (id: string) => readonly ["skills", "detail", string];
|
|
47
48
|
};
|
|
48
49
|
export declare function useSkills(filter?: SkillFilterVariables): QueryResult<SkillRecord[]>;
|
|
50
|
+
type SkillListItem = ListBotmanorSkillsPageQuery['listBotmanorSkillsPage']['items'][number];
|
|
51
|
+
export declare function useSkillsPage(search: string): PaginatedQueryResult<SkillListItem[]>;
|
|
49
52
|
export declare function useSkill(skillId: string | undefined): QueryResult<SkillRecord | null>;
|
|
50
53
|
export declare function useCreateSkill(): {
|
|
51
54
|
create: (input: CreateSkillVariables) => Promise<SkillRecord>;
|
|
@@ -62,3 +65,4 @@ export declare function useDeleteSkill(): {
|
|
|
62
65
|
loading: boolean;
|
|
63
66
|
error: Error | undefined;
|
|
64
67
|
};
|
|
68
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateSkillDocument as e, DeleteSkillDocument as t, GetSkillDocument as n,
|
|
2
|
-
import { buildMutationInput as
|
|
3
|
-
import { useWorkspaceId as
|
|
4
|
-
import { useCallback as
|
|
1
|
+
import { CreateSkillDocument as e, DeleteSkillDocument as t, GetSkillDocument as n, ListBotmanorSkillsPageDocument as r, ListSkillsDocument as i, UpdateSkillDocument as a } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { buildMutationInput as o, fieldsOf as s } from "./internal/mutationInput.js";
|
|
3
|
+
import { useWorkspaceId as c, useWorkspaceMutation as l, useWorkspacePaginatedQuery as u, useWorkspaceQuery as d } from "./internal/workspaceGateway.js";
|
|
4
|
+
import { useCallback as f, useMemo as p } from "react";
|
|
5
5
|
// src/botlit/hooks/useSkills.ts
|
|
6
|
-
var
|
|
6
|
+
var m = 100, h = 50, g = s({
|
|
7
7
|
bucketId: !0,
|
|
8
8
|
capabilityFlags: !0,
|
|
9
9
|
description: !0,
|
|
@@ -18,7 +18,7 @@ var f = 100, p = o({
|
|
|
18
18
|
toolPolicyId: !0,
|
|
19
19
|
visibility: !0,
|
|
20
20
|
workspaceId: !0
|
|
21
|
-
}),
|
|
21
|
+
}), _ = s({
|
|
22
22
|
bucketId: !0,
|
|
23
23
|
capabilityFlags: !0,
|
|
24
24
|
description: !0,
|
|
@@ -32,48 +32,66 @@ var f = 100, p = o({
|
|
|
32
32
|
toolPackDeps: !0,
|
|
33
33
|
toolPolicyId: !0,
|
|
34
34
|
visibility: !0
|
|
35
|
-
}),
|
|
36
|
-
function
|
|
37
|
-
return e?.listSkills ??
|
|
35
|
+
}), v = [];
|
|
36
|
+
function y(e) {
|
|
37
|
+
return e?.listSkills ?? v;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
let t =
|
|
39
|
+
function b(e) {
|
|
40
|
+
let t = c(), { search: n, status: r, visibility: a, bucketId: o, promptTemplateId: s, retrievalProfileId: l, toolPolicyId: u } = e ?? {}, f = p(() => ({
|
|
41
41
|
filters: {
|
|
42
42
|
workspaceId: t,
|
|
43
43
|
search: n || void 0,
|
|
44
|
-
status:
|
|
44
|
+
status: r,
|
|
45
45
|
visibility: a,
|
|
46
46
|
bucketId: o,
|
|
47
|
-
promptTemplateId:
|
|
48
|
-
retrievalProfileId:
|
|
49
|
-
toolPolicyId:
|
|
47
|
+
promptTemplateId: s,
|
|
48
|
+
retrievalProfileId: l,
|
|
49
|
+
toolPolicyId: u
|
|
50
50
|
},
|
|
51
51
|
pagination: {
|
|
52
|
-
limit:
|
|
52
|
+
limit: m,
|
|
53
53
|
offset: 0
|
|
54
54
|
}
|
|
55
55
|
}), [
|
|
56
56
|
t,
|
|
57
57
|
n,
|
|
58
|
-
|
|
58
|
+
r,
|
|
59
59
|
a,
|
|
60
60
|
o,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
s,
|
|
62
|
+
l,
|
|
63
|
+
u
|
|
64
64
|
]);
|
|
65
|
-
return
|
|
65
|
+
return d({
|
|
66
|
+
document: i,
|
|
67
|
+
variables: f,
|
|
68
|
+
select: y,
|
|
69
|
+
fallback: v,
|
|
70
|
+
enabled: !!t,
|
|
71
|
+
errorMessage: "Failed to load skills"
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
var x = [];
|
|
75
|
+
function S(e) {
|
|
76
|
+
let t = c(), n = p(() => ({ filters: {
|
|
77
|
+
workspaceId: t,
|
|
78
|
+
search: e || void 0
|
|
79
|
+
} }), [t, e]);
|
|
80
|
+
return u({
|
|
66
81
|
document: r,
|
|
67
|
-
variables:
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
variables: n,
|
|
83
|
+
pageSize: h,
|
|
84
|
+
extractRows: (e) => e?.listBotmanorSkillsPage.items,
|
|
85
|
+
extractNextOffset: (e) => e?.listBotmanorSkillsPage.nextOffset ?? null,
|
|
86
|
+
select: (e) => e,
|
|
87
|
+
fallback: x,
|
|
70
88
|
enabled: !!t,
|
|
71
89
|
errorMessage: "Failed to load skills"
|
|
72
90
|
});
|
|
73
91
|
}
|
|
74
|
-
function
|
|
75
|
-
let t =
|
|
76
|
-
return
|
|
92
|
+
function C(e) {
|
|
93
|
+
let t = p(() => ({ id: e ?? "" }), [e]);
|
|
94
|
+
return d({
|
|
77
95
|
document: n,
|
|
78
96
|
variables: t,
|
|
79
97
|
select: (e) => e?.getSkill ?? null,
|
|
@@ -82,11 +100,11 @@ function v(e) {
|
|
|
82
100
|
errorMessage: "Failed to load skill"
|
|
83
101
|
});
|
|
84
102
|
}
|
|
85
|
-
function
|
|
86
|
-
let t =
|
|
103
|
+
function w() {
|
|
104
|
+
let t = c(), n = f((e) => ({ input: o({
|
|
87
105
|
...e,
|
|
88
106
|
workspaceId: t
|
|
89
|
-
},
|
|
107
|
+
}, g) }), [t]), [r, i] = l({
|
|
90
108
|
document: e,
|
|
91
109
|
variables: n,
|
|
92
110
|
select: (e) => e?.createSkill,
|
|
@@ -98,12 +116,12 @@ function y() {
|
|
|
98
116
|
error: i.error
|
|
99
117
|
};
|
|
100
118
|
}
|
|
101
|
-
function
|
|
102
|
-
let [e, t] =
|
|
103
|
-
document:
|
|
119
|
+
function T() {
|
|
120
|
+
let [e, t] = l({
|
|
121
|
+
document: a,
|
|
104
122
|
variables: ({ skillId: e, input: t }) => ({
|
|
105
123
|
id: e,
|
|
106
|
-
input:
|
|
124
|
+
input: o(t, _)
|
|
107
125
|
}),
|
|
108
126
|
select: (e) => e?.updateSkill,
|
|
109
127
|
errorMessage: "Failed to update skill"
|
|
@@ -114,8 +132,8 @@ function b() {
|
|
|
114
132
|
error: t.error
|
|
115
133
|
};
|
|
116
134
|
}
|
|
117
|
-
function
|
|
118
|
-
let [e, n] =
|
|
135
|
+
function E() {
|
|
136
|
+
let [e, n] = l({
|
|
119
137
|
document: t,
|
|
120
138
|
variables: (e) => ({ id: e }),
|
|
121
139
|
select: (e) => e?.deleteSkill,
|
|
@@ -127,6 +145,6 @@ function x() {
|
|
|
127
145
|
error: n.error
|
|
128
146
|
};
|
|
129
147
|
}
|
|
130
|
-
export {
|
|
148
|
+
export { w as useCreateSkill, E as useDeleteSkill, C as useSkill, b as useSkills, S as useSkillsPage, T as useUpdateSkill };
|
|
131
149
|
|
|
132
150
|
//# sourceMappingURL=useSkills.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkills.js","names":["LIST_LIMIT","CREATE_SKILL_FIELDS","fieldsOf","UPDATE_SKILL_FIELDS","NO_SKILLS","selectSkills","data","useSkills","workspaceId","useWorkspaceId","filter","variables","useMemo","search","status","visibility","bucketId","promptTemplateId","retrievalProfileId","toolPolicyId","useWorkspaceQuery","ListSkillsDocument","useSkill","skillId","GetSkillDocument","useCreateSkill","useCallback","buildMutationInput","input","create","state","useWorkspaceMutation","CreateSkillDocument","useUpdateSkill","update","UpdateSkillDocument","useDeleteSkill","remove","DeleteSkillDocument"],"sources":["../../../src/botlit/hooks/useSkills.ts"],"sourcesContent":["/**\n * Skills Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listSkills` / `getSkill` operations and the\n * create/update/delete mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateSkillDocument,\n DeleteSkillDocument,\n GetSkillDocument,\n ListSkillsDocument,\n UpdateSkillDocument,\n type CreateSkillMutation,\n type DeleteSkillMutation,\n type GetSkillQuery,\n type ListSkillsQuery,\n type UpdateSkillMutation,\n} from '../../generated/wspace-operations';\nimport type { CreateSkillInput, UpdateSkillInput } from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface SkillRecord {\n id: string;\n name: string;\n status: string;\n visibility: string;\n description?: string | null;\n bucketId?: string | null;\n promptTemplateId?: string | null;\n retrievalProfileId?: string | null;\n toolPolicyId?: string | null;\n toolPackDeps: string[];\n recommendedPolicies: string[];\n capabilityFlags?: Record<string, unknown> | null;\n metadata?: Record<string, unknown> | null;\n revision: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface SkillFilterVariables {\n search?: string;\n status?: string;\n visibility?: string;\n bucketId?: string;\n promptTemplateId?: string;\n retrievalProfileId?: string;\n toolPolicyId?: string;\n}\n\n/** `CreateSkillInput` minus the `workspaceId` the hook supplies. */\nexport type CreateSkillVariables = Omit<GraphQLInput<CreateSkillInput>, 'workspaceId'>;\n\nexport interface UpdateSkillVariables {\n skillId: string;\n input: GraphQLInput<UpdateSkillInput>;\n}\n\nconst CREATE_SKILL_FIELDS = fieldsOf<CreateSkillInput>({\n bucketId: true,\n capabilityFlags: true,\n description: true,\n metadata: true,\n name: true,\n promptTemplateId: true,\n recommendedPolicies: true,\n retrievalProfileId: true,\n status: true,\n tags: true,\n toolPackDeps: true,\n toolPolicyId: true,\n visibility: true,\n workspaceId: true,\n});\n\nconst UPDATE_SKILL_FIELDS = fieldsOf<UpdateSkillInput>({\n bucketId: true,\n capabilityFlags: true,\n description: true,\n metadata: true,\n name: true,\n promptTemplateId: true,\n recommendedPolicies: true,\n retrievalProfileId: true,\n status: true,\n tags: true,\n toolPackDeps: true,\n toolPolicyId: true,\n visibility: true,\n});\n\nconst NO_SKILLS: SkillRecord[] = [];\n\nfunction selectSkills(data: ListSkillsQuery | undefined): SkillRecord[] {\n return data?.listSkills ?? NO_SKILLS;\n}\n\nexport const skillKeys = {\n all: ['skills'] as const,\n lists: () => [...skillKeys.all, 'list'] as const,\n list: (filter?: SkillFilterVariables) => [...skillKeys.lists(), filter] as const,\n details: () => [...skillKeys.all, 'detail'] as const,\n detail: (id: string) => [...skillKeys.details(), id] as const,\n};\n\nexport function useSkills(filter?: SkillFilterVariables): QueryResult<SkillRecord[]> {\n const workspaceId = useWorkspaceId();\n const {\n search,\n status,\n visibility,\n bucketId,\n promptTemplateId,\n retrievalProfileId,\n toolPolicyId,\n } = filter ?? {};\n\n const variables = useMemo(\n () => ({\n filters: {\n workspaceId,\n search: search || undefined,\n status,\n visibility,\n bucketId,\n promptTemplateId,\n retrievalProfileId,\n toolPolicyId,\n },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [\n workspaceId,\n search,\n status,\n visibility,\n bucketId,\n promptTemplateId,\n retrievalProfileId,\n toolPolicyId,\n ]\n );\n\n return useWorkspaceQuery<ListSkillsQuery, SkillRecord[]>({\n document: ListSkillsDocument,\n variables,\n select: selectSkills,\n fallback: NO_SKILLS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load skills',\n });\n}\n\nexport function useSkill(skillId: string | undefined): QueryResult<SkillRecord | null> {\n const variables = useMemo(() => ({ id: skillId ?? '' }), [skillId]);\n\n return useWorkspaceQuery<GetSkillQuery, SkillRecord | null>({\n document: GetSkillDocument,\n variables,\n select: (data) => data?.getSkill ?? null,\n fallback: null,\n enabled: Boolean(skillId),\n errorMessage: 'Failed to load skill',\n });\n}\n\nexport function useCreateSkill() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateSkillVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_SKILL_FIELDS),\n }),\n [workspaceId]\n );\n\n const [create, state] = useWorkspaceMutation<\n CreateSkillMutation,\n CreateSkillVariables,\n SkillRecord\n >({\n document: CreateSkillDocument,\n variables,\n select: (data) => data?.createSkill,\n errorMessage: 'Failed to create skill',\n });\n\n return { create, loading: state.loading, error: state.error };\n}\n\nexport function useUpdateSkill() {\n const [update, state] = useWorkspaceMutation<\n UpdateSkillMutation,\n UpdateSkillVariables,\n SkillRecord\n >({\n document: UpdateSkillDocument,\n variables: ({ skillId, input }) => ({\n id: skillId,\n input: buildMutationInput(input, UPDATE_SKILL_FIELDS),\n }),\n select: (data) => data?.updateSkill,\n errorMessage: 'Failed to update skill',\n });\n\n return { update, loading: state.loading, error: state.error };\n}\n\nexport function useDeleteSkill() {\n const [remove, state] = useWorkspaceMutation<DeleteSkillMutation, string, boolean>({\n document: DeleteSkillDocument,\n variables: (skillId) => ({ id: skillId }),\n select: (data) => data?.deleteSkill,\n errorMessage: 'Failed to delete skill',\n });\n\n return { remove, loading: state.loading, error: state.error };\n}\n"],"mappings":";;;;;AA8BA,IAAMA,IAAa,KA2CbC,IAAsBC,EAA2B;CACrD,UAAU;CACV,iBAAiB;CACjB,aAAa;CACb,UAAU;CACV,MAAM;CACN,kBAAkB;CAClB,qBAAqB;CACrB,oBAAoB;CACpB,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,YAAY;CACZ,aAAa;AACf,CAAC,GAEKC,IAAsBD,EAA2B;CACrD,UAAU;CACV,iBAAiB;CACjB,aAAa;CACb,UAAU;CACV,MAAM;CACN,kBAAkB;CAClB,qBAAqB;CACrB,oBAAoB;CACpB,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,YAAY;AACd,CAAC,GAEKE,IAA2B,CAAC;AAElC,SAASC,EAAa,GAAkD;CACtE,OAAOC,GAAM,cAAcF;AAC7B;AAUA,SAAgBG,EAAU,GAA2D;CACnF,IAAMC,IAAcC,EAAe,GAC7B,EACJ,WACA,WACA,eACA,aACA,qBACA,uBACA,oBACEC,KAAU,CAAC,GAETC,IAAYC,SACT;EACL,SAAS;GACP;GACA,QAAQC,KAAU,KAAA;GAClB;GACA;GACA;GACA;GACA;GACA;EACF;EACA,YAAY;GAAE,OAAOb;GAAY,QAAQ;EAAE;CAC7C,IACA;EACEQ;EACAK;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;CACF,CACF;CAEA,OAAOC,EAAkD;EACvD,UAAUC;EACV;EACA,QAAQhB;EACR,UAAUD;EACV,SAAS,EAAQI;EACjB,cAAc;CAChB,CAAC;AACH;AAEA,SAAgBc,EAAS,GAA8D;CACrF,IAAMX,IAAYC,SAAe,EAAE,IAAIW,KAAW,GAAG,IAAI,CAACA,CAAO,CAAC;CAElE,OAAOH,EAAqD;EAC1D,UAAUI;EACV;EACA,SAAS,MAASlB,GAAM,YAAY;EACpC,UAAU;EACV,SAAS,EAAQiB;EACjB,cAAc;CAChB,CAAC;AACH;AAEA,SAAgBE,IAAiB;CAC/B,IAAMjB,IAAcC,EAAe,GAE7BE,IAAYe,GACf,OAAiC,EAChC,OAAOC,EAAmB;EAAE,GAAGC;EAAO;CAAY,GAAG3B,CAAmB,EAC1E,IACA,CAACO,CAAW,CACd,GAEM,CAACqB,GAAQC,KAASC,EAItB;EACA,UAAUC;EACV;EACA,SAAS,MAAS1B,GAAM;EACxB,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAQ,SAASwB,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC9D;AAEA,SAAgBG,IAAiB;CAC/B,IAAM,CAACC,GAAQJ,KAASC,EAItB;EACA,UAAUI;EACV,YAAY,EAAE,YAAS,gBAAa;GAClC,IAAIZ;GACJ,OAAOI,EAAmBC,GAAOzB,CAAmB;EACtD;EACA,SAAS,MAASG,GAAM;EACxB,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAQ,SAASwB,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC9D;AAEA,SAAgBM,IAAiB;CAC/B,IAAM,CAACC,GAAQP,KAASC,EAA2D;EACjF,UAAUO;EACV,YAAY,OAAa,EAAE,IAAIf,EAAQ;EACvC,SAAS,MAASjB,GAAM;EACxB,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAQ,SAASwB,EAAM;EAAS,OAAOA,EAAM;CAAM;AAC9D"}
|
|
1
|
+
{"version":3,"file":"useSkills.js","names":["LIST_LIMIT","SKILLS_PAGE_SIZE","CREATE_SKILL_FIELDS","fieldsOf","UPDATE_SKILL_FIELDS","NO_SKILLS","selectSkills","data","useSkills","workspaceId","useWorkspaceId","filter","variables","useMemo","search","status","visibility","bucketId","promptTemplateId","retrievalProfileId","toolPolicyId","useWorkspaceQuery","ListSkillsDocument","NO_SKILL_LIST_ITEMS","useSkillsPage","useWorkspacePaginatedQuery","ListBotmanorSkillsPageDocument","rows","useSkill","skillId","GetSkillDocument","useCreateSkill","useCallback","buildMutationInput","input","create","state","useWorkspaceMutation","CreateSkillDocument","useUpdateSkill","update","UpdateSkillDocument","useDeleteSkill","remove","DeleteSkillDocument"],"sources":["../../../src/botlit/hooks/useSkills.ts"],"sourcesContent":["/**\n * Skills Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listSkills` / `getSkill` operations and the\n * create/update/delete mutations on wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateSkillDocument,\n DeleteSkillDocument,\n GetSkillDocument,\n ListBotmanorSkillsPageDocument,\n ListSkillsDocument,\n UpdateSkillDocument,\n type CreateSkillMutation,\n type DeleteSkillMutation,\n type GetSkillQuery,\n type ListBotmanorSkillsPageQuery,\n type ListBotmanorSkillsPageQueryVariables,\n type ListSkillsQuery,\n type UpdateSkillMutation,\n} from '../../generated/wspace-operations';\nimport type { CreateSkillInput, UpdateSkillInput } from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspacePaginatedQuery,\n useWorkspaceQuery,\n type PaginatedQueryResult,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\nconst SKILLS_PAGE_SIZE = 50;\n\nexport interface SkillRecord {\n id: string;\n name: string;\n status: string;\n visibility: string;\n description?: string | null;\n bucketId?: string | null;\n promptTemplateId?: string | null;\n retrievalProfileId?: string | null;\n toolPolicyId?: string | null;\n toolPackDeps: string[];\n recommendedPolicies: string[];\n capabilityFlags?: Record<string, unknown> | null;\n metadata?: Record<string, unknown> | null;\n revision: number;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface SkillFilterVariables {\n search?: string;\n status?: string;\n visibility?: string;\n bucketId?: string;\n promptTemplateId?: string;\n retrievalProfileId?: string;\n toolPolicyId?: string;\n}\n\n/** `CreateSkillInput` minus the `workspaceId` the hook supplies. */\nexport type CreateSkillVariables = Omit<GraphQLInput<CreateSkillInput>, 'workspaceId'>;\n\nexport interface UpdateSkillVariables {\n skillId: string;\n input: GraphQLInput<UpdateSkillInput>;\n}\n\nconst CREATE_SKILL_FIELDS = fieldsOf<CreateSkillInput>({\n bucketId: true,\n capabilityFlags: true,\n description: true,\n metadata: true,\n name: true,\n promptTemplateId: true,\n recommendedPolicies: true,\n retrievalProfileId: true,\n status: true,\n tags: true,\n toolPackDeps: true,\n toolPolicyId: true,\n visibility: true,\n workspaceId: true,\n});\n\nconst UPDATE_SKILL_FIELDS = fieldsOf<UpdateSkillInput>({\n bucketId: true,\n capabilityFlags: true,\n description: true,\n metadata: true,\n name: true,\n promptTemplateId: true,\n recommendedPolicies: true,\n retrievalProfileId: true,\n status: true,\n tags: true,\n toolPackDeps: true,\n toolPolicyId: true,\n visibility: true,\n});\n\nconst NO_SKILLS: SkillRecord[] = [];\n\nfunction selectSkills(data: ListSkillsQuery | undefined): SkillRecord[] {\n return data?.listSkills ?? NO_SKILLS;\n}\n\nexport const skillKeys = {\n all: ['skills'] as const,\n lists: () => [...skillKeys.all, 'list'] as const,\n list: (filter?: SkillFilterVariables) => [...skillKeys.lists(), filter] as const,\n details: () => [...skillKeys.all, 'detail'] as const,\n detail: (id: string) => [...skillKeys.details(), id] as const,\n};\n\nexport function useSkills(filter?: SkillFilterVariables): QueryResult<SkillRecord[]> {\n const workspaceId = useWorkspaceId();\n const {\n search,\n status,\n visibility,\n bucketId,\n promptTemplateId,\n retrievalProfileId,\n toolPolicyId,\n } = filter ?? {};\n\n const variables = useMemo(\n () => ({\n filters: {\n workspaceId,\n search: search || undefined,\n status,\n visibility,\n bucketId,\n promptTemplateId,\n retrievalProfileId,\n toolPolicyId,\n },\n pagination: { limit: LIST_LIMIT, offset: 0 },\n }),\n [\n workspaceId,\n search,\n status,\n visibility,\n bucketId,\n promptTemplateId,\n retrievalProfileId,\n toolPolicyId,\n ]\n );\n\n return useWorkspaceQuery<ListSkillsQuery, SkillRecord[]>({\n document: ListSkillsDocument,\n variables,\n select: selectSkills,\n fallback: NO_SKILLS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load skills',\n });\n}\n\ntype SkillListItem = ListBotmanorSkillsPageQuery['listBotmanorSkillsPage']['items'][number];\nconst NO_SKILL_LIST_ITEMS: SkillListItem[] = [];\n\nexport function useSkillsPage(search: string): PaginatedQueryResult<SkillListItem[]> {\n const workspaceId = useWorkspaceId();\n const variables = useMemo<ListBotmanorSkillsPageQueryVariables>(\n () => ({ filters: { workspaceId, search: search || undefined } }),\n [workspaceId, search]\n );\n\n return useWorkspacePaginatedQuery<ListBotmanorSkillsPageQuery, SkillListItem, SkillListItem[]>({\n document: ListBotmanorSkillsPageDocument,\n variables,\n pageSize: SKILLS_PAGE_SIZE,\n extractRows: (data) => data?.listBotmanorSkillsPage.items,\n extractNextOffset: (data) => data?.listBotmanorSkillsPage.nextOffset ?? null,\n select: (rows) => rows,\n fallback: NO_SKILL_LIST_ITEMS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load skills',\n });\n}\n\nexport function useSkill(skillId: string | undefined): QueryResult<SkillRecord | null> {\n const variables = useMemo(() => ({ id: skillId ?? '' }), [skillId]);\n\n return useWorkspaceQuery<GetSkillQuery, SkillRecord | null>({\n document: GetSkillDocument,\n variables,\n select: (data) => data?.getSkill ?? null,\n fallback: null,\n enabled: Boolean(skillId),\n errorMessage: 'Failed to load skill',\n });\n}\n\nexport function useCreateSkill() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateSkillVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_SKILL_FIELDS),\n }),\n [workspaceId]\n );\n\n const [create, state] = useWorkspaceMutation<\n CreateSkillMutation,\n CreateSkillVariables,\n SkillRecord\n >({\n document: CreateSkillDocument,\n variables,\n select: (data) => data?.createSkill,\n errorMessage: 'Failed to create skill',\n });\n\n return { create, loading: state.loading, error: state.error };\n}\n\nexport function useUpdateSkill() {\n const [update, state] = useWorkspaceMutation<\n UpdateSkillMutation,\n UpdateSkillVariables,\n SkillRecord\n >({\n document: UpdateSkillDocument,\n variables: ({ skillId, input }) => ({\n id: skillId,\n input: buildMutationInput(input, UPDATE_SKILL_FIELDS),\n }),\n select: (data) => data?.updateSkill,\n errorMessage: 'Failed to update skill',\n });\n\n return { update, loading: state.loading, error: state.error };\n}\n\nexport function useDeleteSkill() {\n const [remove, state] = useWorkspaceMutation<DeleteSkillMutation, string, boolean>({\n document: DeleteSkillDocument,\n variables: (skillId) => ({ id: skillId }),\n select: (data) => data?.deleteSkill,\n errorMessage: 'Failed to delete skill',\n });\n\n return { remove, loading: state.loading, error: state.error };\n}\n"],"mappings":"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"}
|
|
@@ -9,214 +9,133 @@ import { Input as d } from "../components/Input.js";
|
|
|
9
9
|
import { Badge as f, StatusBadge as p } from "../components/Badge.js";
|
|
10
10
|
import { EmptyState as m } from "../components/EmptyState.js";
|
|
11
11
|
import { ErrorState as h } from "../components/ErrorState.js";
|
|
12
|
-
import "../
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { LoadMore as g } from "../components/LoadMore.js";
|
|
13
|
+
import { useSkillsPage as _ } from "../hooks/useSkills.js";
|
|
14
|
+
import { formatRelativeTime as v } from "../utils/formatters.js";
|
|
15
15
|
import "../permissions/index.js";
|
|
16
|
-
import { useState as
|
|
17
|
-
import { GlassCard as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { Link as
|
|
20
|
-
import { Database as
|
|
16
|
+
import { useState as y } from "react";
|
|
17
|
+
import { GlassCard as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
19
|
+
import { Link as T } from "react-router";
|
|
20
|
+
import { Database as E, FileText as D, Filter as O, Package as k, Plus as A, Search as j, Sparkles as M, Wrench as N } from "lucide-react";
|
|
21
21
|
// src/botlit/pages/SkillsPage.tsx
|
|
22
|
-
var
|
|
23
|
-
let
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
title:
|
|
26
|
-
description:
|
|
27
|
-
actions: /* @__PURE__ */
|
|
22
|
+
var P = () => {
|
|
23
|
+
let a = t(), { getPath: o, workspaceId: s } = e(), [c, l] = y(""), f = c.trim();
|
|
24
|
+
return /* @__PURE__ */ C(n, {
|
|
25
|
+
title: a("botlit.skills.title", "Skills"),
|
|
26
|
+
description: a("botlit.skills.description", "Reusable skill bundles that combine prompts, tools, and knowledge"),
|
|
27
|
+
actions: /* @__PURE__ */ C(i, {
|
|
28
28
|
permission: r.SKILL_CREATE,
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
leftIcon: /* @__PURE__ */
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
to:
|
|
33
|
-
children:
|
|
29
|
+
children: /* @__PURE__ */ C(u, {
|
|
30
|
+
leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
|
|
31
|
+
children: /* @__PURE__ */ C(T, {
|
|
32
|
+
to: o("skills/new"),
|
|
33
|
+
children: a("botlit.skills.actions.createSkill", "Create Skill")
|
|
34
34
|
})
|
|
35
35
|
})
|
|
36
36
|
}),
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ w("div", {
|
|
38
38
|
className: "space-y-6",
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */ x
|
|
41
|
-
icon: /* @__PURE__ */
|
|
42
|
-
children:
|
|
40
|
+
/* @__PURE__ */ C(x, {
|
|
41
|
+
icon: /* @__PURE__ */ C(M, { size: 18 }),
|
|
42
|
+
children: a("botlit.skills.purpose", "A skill is a reusable bundle that packages a prompt template, a tool policy and a knowledge (retrieval) profile into one capability you can drop onto any agent. Build a skill once — say \"Customer Support\" or \"Code Review\" — and reuse it across agents instead of wiring the same prompt, tools and knowledge by hand each time.")
|
|
43
43
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ w("div", {
|
|
45
45
|
className: "flex items-center gap-4",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ w("div", {
|
|
47
47
|
className: "relative flex-1 max-w-md",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
49
|
-
placeholder:
|
|
50
|
-
value:
|
|
51
|
-
onChange: (e) =>
|
|
48
|
+
children: [/* @__PURE__ */ C(j, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ C(d, {
|
|
49
|
+
placeholder: a("botlit.skills.searchPlaceholder", "Search skills..."),
|
|
50
|
+
value: c,
|
|
51
|
+
onChange: (e) => l(e.target.value),
|
|
52
52
|
className: "pl-9"
|
|
53
53
|
})]
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ C(u, {
|
|
55
55
|
variant: "outline",
|
|
56
|
-
leftIcon: /* @__PURE__ */
|
|
57
|
-
children:
|
|
56
|
+
leftIcon: /* @__PURE__ */ C(O, { size: 16 }),
|
|
57
|
+
children: a("botlit.skills.actions.filters", "Filters")
|
|
58
58
|
})]
|
|
59
59
|
}),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
children: [
|
|
63
|
-
1,
|
|
64
|
-
2,
|
|
65
|
-
3,
|
|
66
|
-
4,
|
|
67
|
-
5,
|
|
68
|
-
6
|
|
69
|
-
].map((e) => /* @__PURE__ */ x("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
|
|
70
|
-
}) : R ? /* @__PURE__ */ x(h, {
|
|
71
|
-
resource: "skills",
|
|
72
|
-
error: R,
|
|
73
|
-
onRetry: () => void z()
|
|
74
|
-
}) : I.length > 0 ? /* @__PURE__ */ x("div", {
|
|
75
|
-
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
76
|
-
children: I.map((e) => /* @__PURE__ */ x(C, {
|
|
77
|
-
to: N(`skills/${e.id}`),
|
|
78
|
-
children: /* @__PURE__ */ S(a, {
|
|
79
|
-
className: "h-full hover:border-primary/50 transition-colors cursor-pointer",
|
|
80
|
-
children: [/* @__PURE__ */ x(c, { children: /* @__PURE__ */ S("div", {
|
|
81
|
-
className: "flex items-start justify-between",
|
|
82
|
-
children: [/* @__PURE__ */ S("div", {
|
|
83
|
-
className: "flex items-center gap-3",
|
|
84
|
-
children: [/* @__PURE__ */ x("div", {
|
|
85
|
-
className: "p-2 bg-gradient-to-br from-primary/20 to-primary/5 rounded-lg",
|
|
86
|
-
children: /* @__PURE__ */ x(A, { className: "h-5 w-5 text-primary" })
|
|
87
|
-
}), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x(l, {
|
|
88
|
-
className: "text-base",
|
|
89
|
-
children: e.name
|
|
90
|
-
}), /* @__PURE__ */ x(s, {
|
|
91
|
-
className: "text-xs line-clamp-1",
|
|
92
|
-
children: e.description
|
|
93
|
-
})] })]
|
|
94
|
-
}), /* @__PURE__ */ x(p, { status: e.status })]
|
|
95
|
-
}) }), /* @__PURE__ */ x(o, { children: /* @__PURE__ */ S("div", {
|
|
96
|
-
className: "space-y-3",
|
|
97
|
-
children: [/* @__PURE__ */ S("div", {
|
|
98
|
-
className: "flex flex-wrap gap-2",
|
|
99
|
-
children: [
|
|
100
|
-
e.promptTemplateId && /* @__PURE__ */ S(f, {
|
|
101
|
-
variant: "outline",
|
|
102
|
-
className: "text-xs flex items-center gap-1",
|
|
103
|
-
children: [/* @__PURE__ */ x(T, { size: 10 }), M("botlit.skills.badge.prompt", "Prompt")]
|
|
104
|
-
}),
|
|
105
|
-
e.toolPolicyId && /* @__PURE__ */ S(f, {
|
|
106
|
-
variant: "outline",
|
|
107
|
-
className: "text-xs flex items-center gap-1",
|
|
108
|
-
children: [/* @__PURE__ */ x(j, { size: 10 }), M("botlit.skills.badge.tools", "Tools")]
|
|
109
|
-
}),
|
|
110
|
-
e.retrievalProfileId && /* @__PURE__ */ S(f, {
|
|
111
|
-
variant: "outline",
|
|
112
|
-
className: "text-xs flex items-center gap-1",
|
|
113
|
-
children: [/* @__PURE__ */ x(w, { size: 10 }), M("botlit.skills.badge.knowledge", "Knowledge")]
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
}), /* @__PURE__ */ S("div", {
|
|
117
|
-
className: "pt-3 border-t border-border-subtle text-xs text-text-secondary",
|
|
118
|
-
children: [
|
|
119
|
-
M("botlit.botsList.createdLabel", "Created"),
|
|
120
|
-
" ",
|
|
121
|
-
g(e.createdAt)
|
|
122
|
-
]
|
|
123
|
-
})]
|
|
124
|
-
}) })]
|
|
125
|
-
})
|
|
126
|
-
}, e.id))
|
|
127
|
-
}) : /* @__PURE__ */ x(m, {
|
|
128
|
-
illustration: "empty-generic",
|
|
129
|
-
title: M("botlit.skills.empty.title", "No skills created"),
|
|
130
|
-
description: M("botlit.skills.empty.description", "Create reusable skill bundles to quickly configure agents with common capabilities."),
|
|
131
|
-
action: /* @__PURE__ */ x(i, {
|
|
132
|
-
permission: r.SKILL_CREATE,
|
|
133
|
-
children: /* @__PURE__ */ x(u, {
|
|
134
|
-
leftIcon: /* @__PURE__ */ x(O, { size: 16 }),
|
|
135
|
-
children: /* @__PURE__ */ x(C, {
|
|
136
|
-
to: N("skills/new"),
|
|
137
|
-
children: M("botlit.skills.actions.createSkill", "Create Skill")
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
})
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ S(y, {
|
|
60
|
+
/* @__PURE__ */ C(F, { search: f }, JSON.stringify([s, f])),
|
|
61
|
+
/* @__PURE__ */ w(b, {
|
|
143
62
|
treatment: "glass",
|
|
144
63
|
glow: !0,
|
|
145
64
|
className: "p-6",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ w("div", {
|
|
147
66
|
className: "mb-4",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
67
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
149
68
|
className: "flex items-center gap-2 text-lg font-semibold tracking-tight text-text-primary",
|
|
150
|
-
children: [/* @__PURE__ */
|
|
151
|
-
}), /* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ C(k, { size: 18 }), a("botlit.skills.overview.title", "What are Skills?")]
|
|
70
|
+
}), /* @__PURE__ */ C("p", {
|
|
152
71
|
className: "text-sm text-text-secondary",
|
|
153
|
-
children:
|
|
72
|
+
children: a("botlit.skills.overview.description", "Skills are composable bundles that encapsulate agent capabilities")
|
|
154
73
|
})]
|
|
155
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
|
|
156
75
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
157
76
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ w("div", {
|
|
159
78
|
className: "space-y-2",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ w("h4", {
|
|
161
80
|
className: "font-medium flex items-center gap-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ C(D, {
|
|
163
82
|
size: 16,
|
|
164
83
|
className: "text-primary"
|
|
165
|
-
}),
|
|
166
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), a("botlit.skills.overview.promptTitle", "Prompt Templates")]
|
|
85
|
+
}), /* @__PURE__ */ C("p", {
|
|
167
86
|
className: "text-sm text-text-secondary",
|
|
168
|
-
children:
|
|
87
|
+
children: a("botlit.skills.overview.promptDescription", "Pre-configured system prompts with variable support for consistent agent behavior.")
|
|
169
88
|
})]
|
|
170
89
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ w("div", {
|
|
172
91
|
className: "space-y-2",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ w("h4", {
|
|
174
93
|
className: "font-medium flex items-center gap-2",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ C(N, {
|
|
176
95
|
size: 16,
|
|
177
96
|
className: "text-primary"
|
|
178
|
-
}),
|
|
179
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), a("botlit.skills.overview.toolsTitle", "Tool Configurations")]
|
|
98
|
+
}), /* @__PURE__ */ C("p", {
|
|
180
99
|
className: "text-sm text-text-secondary",
|
|
181
|
-
children:
|
|
100
|
+
children: a("botlit.skills.overview.toolsDescription", "Bundled MCP tool packs with policies defining allowed operations and limits.")
|
|
182
101
|
})]
|
|
183
102
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ w("div", {
|
|
185
104
|
className: "space-y-2",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ w("h4", {
|
|
187
106
|
className: "font-medium flex items-center gap-2",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ C(E, {
|
|
189
108
|
size: 16,
|
|
190
109
|
className: "text-primary"
|
|
191
|
-
}),
|
|
192
|
-
}), /* @__PURE__ */
|
|
110
|
+
}), a("botlit.skills.overview.knowledgeTitle", "Knowledge Bindings")]
|
|
111
|
+
}), /* @__PURE__ */ C("p", {
|
|
193
112
|
className: "text-sm text-text-secondary",
|
|
194
|
-
children:
|
|
113
|
+
children: a("botlit.skills.overview.knowledgeDescription", "Pre-configured retrieval profiles for domain-specific knowledge access.")
|
|
195
114
|
})]
|
|
196
115
|
})
|
|
197
116
|
]
|
|
198
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ w("div", {
|
|
199
118
|
className: "mt-6 p-4 bg-bg-sunken rounded-lg",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ C("h4", {
|
|
201
120
|
className: "font-medium mb-2",
|
|
202
|
-
children:
|
|
203
|
-
}), /* @__PURE__ */
|
|
121
|
+
children: a("botlit.skills.overview.useCases.title", "Use Cases")
|
|
122
|
+
}), /* @__PURE__ */ w("ul", {
|
|
204
123
|
className: "text-sm text-text-secondary space-y-1",
|
|
205
124
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ w("li", { children: [
|
|
207
126
|
"•",
|
|
208
127
|
" ",
|
|
209
|
-
|
|
128
|
+
a("botlit.skills.overview.useCases.case1", "Create a \"Customer Support\" skill with FAQ knowledge and ticketing tools")
|
|
210
129
|
] }),
|
|
211
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ w("li", { children: [
|
|
212
131
|
"•",
|
|
213
132
|
" ",
|
|
214
|
-
|
|
133
|
+
a("botlit.skills.overview.useCases.case2", "Build a \"Code Review\" skill with GitHub tools and coding guidelines")
|
|
215
134
|
] }),
|
|
216
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ w("li", { children: [
|
|
217
136
|
"•",
|
|
218
137
|
" ",
|
|
219
|
-
|
|
138
|
+
a("botlit.skills.overview.useCases.case3", "Package a \"Sales Assistant\" skill with CRM tools and product catalog")
|
|
220
139
|
] })
|
|
221
140
|
]
|
|
222
141
|
})]
|
|
@@ -226,6 +145,108 @@ var M = () => {
|
|
|
226
145
|
})
|
|
227
146
|
});
|
|
228
147
|
};
|
|
229
|
-
|
|
148
|
+
function F({ search: n }) {
|
|
149
|
+
let d = t(), { getPath: y } = e(), { data: b, loading: x, error: O, refetch: k, hasMore: j, loadingMore: P, loadMore: F } = _(n), I = d("botlit.skills.resource", "skills");
|
|
150
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
151
|
+
x ? /* @__PURE__ */ C("div", {
|
|
152
|
+
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
153
|
+
children: [
|
|
154
|
+
1,
|
|
155
|
+
2,
|
|
156
|
+
3,
|
|
157
|
+
4,
|
|
158
|
+
5,
|
|
159
|
+
6
|
|
160
|
+
].map((e) => /* @__PURE__ */ C("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
|
|
161
|
+
}) : O && !j ? /* @__PURE__ */ C(h, {
|
|
162
|
+
resource: I,
|
|
163
|
+
error: O,
|
|
164
|
+
onRetry: () => void k()
|
|
165
|
+
}) : b.length > 0 ? /* @__PURE__ */ C("div", {
|
|
166
|
+
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
167
|
+
children: b.map((e) => /* @__PURE__ */ C(T, {
|
|
168
|
+
to: y(`skills/${e.id}`),
|
|
169
|
+
children: /* @__PURE__ */ w(a, {
|
|
170
|
+
className: "h-full hover:border-primary/50 transition-colors cursor-pointer",
|
|
171
|
+
children: [/* @__PURE__ */ C(c, { children: /* @__PURE__ */ w("div", {
|
|
172
|
+
className: "flex items-start justify-between",
|
|
173
|
+
children: [/* @__PURE__ */ w("div", {
|
|
174
|
+
className: "flex items-center gap-3",
|
|
175
|
+
children: [/* @__PURE__ */ C("div", {
|
|
176
|
+
className: "p-2 bg-gradient-to-br from-primary/20 to-primary/5 rounded-lg",
|
|
177
|
+
children: /* @__PURE__ */ C(M, { className: "h-5 w-5 text-primary" })
|
|
178
|
+
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(l, {
|
|
179
|
+
className: "text-base",
|
|
180
|
+
children: e.name
|
|
181
|
+
}), /* @__PURE__ */ C(s, {
|
|
182
|
+
className: "text-xs line-clamp-1",
|
|
183
|
+
children: e.description
|
|
184
|
+
})] })]
|
|
185
|
+
}), /* @__PURE__ */ C(p, { status: e.status })]
|
|
186
|
+
}) }), /* @__PURE__ */ C(o, { children: /* @__PURE__ */ w("div", {
|
|
187
|
+
className: "space-y-3",
|
|
188
|
+
children: [/* @__PURE__ */ w("div", {
|
|
189
|
+
className: "flex flex-wrap gap-2",
|
|
190
|
+
children: [
|
|
191
|
+
e.promptTemplateId && /* @__PURE__ */ w(f, {
|
|
192
|
+
variant: "outline",
|
|
193
|
+
className: "text-xs flex items-center gap-1",
|
|
194
|
+
children: [/* @__PURE__ */ C(D, { size: 10 }), d("botlit.skills.badge.prompt", "Prompt")]
|
|
195
|
+
}),
|
|
196
|
+
e.toolPolicyId && /* @__PURE__ */ w(f, {
|
|
197
|
+
variant: "outline",
|
|
198
|
+
className: "text-xs flex items-center gap-1",
|
|
199
|
+
children: [/* @__PURE__ */ C(N, { size: 10 }), d("botlit.skills.badge.tools", "Tools")]
|
|
200
|
+
}),
|
|
201
|
+
e.retrievalProfileId && /* @__PURE__ */ w(f, {
|
|
202
|
+
variant: "outline",
|
|
203
|
+
className: "text-xs flex items-center gap-1",
|
|
204
|
+
children: [/* @__PURE__ */ C(E, { size: 10 }), d("botlit.skills.badge.knowledge", "Knowledge")]
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}), /* @__PURE__ */ w("div", {
|
|
208
|
+
className: "pt-3 border-t border-border-subtle text-xs text-text-secondary",
|
|
209
|
+
children: [
|
|
210
|
+
d("botlit.botsList.createdLabel", "Created"),
|
|
211
|
+
" ",
|
|
212
|
+
v(e.createdAt)
|
|
213
|
+
]
|
|
214
|
+
})]
|
|
215
|
+
}) })]
|
|
216
|
+
})
|
|
217
|
+
}, e.id))
|
|
218
|
+
}) : n ? /* @__PURE__ */ C(m, {
|
|
219
|
+
illustration: "empty-generic",
|
|
220
|
+
title: d("botlit.skills.searchEmpty.title", "No matching skills"),
|
|
221
|
+
description: d("botlit.skills.searchEmpty.description", "Try a different search.")
|
|
222
|
+
}) : /* @__PURE__ */ C(m, {
|
|
223
|
+
illustration: "empty-generic",
|
|
224
|
+
title: d("botlit.skills.empty.title", "No skills created"),
|
|
225
|
+
description: d("botlit.skills.empty.description", "Create reusable skill bundles to quickly configure agents with common capabilities."),
|
|
226
|
+
action: /* @__PURE__ */ C(i, {
|
|
227
|
+
permission: r.SKILL_CREATE,
|
|
228
|
+
children: /* @__PURE__ */ C(u, {
|
|
229
|
+
leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
|
|
230
|
+
children: /* @__PURE__ */ C(T, {
|
|
231
|
+
to: y("skills/new"),
|
|
232
|
+
children: d("botlit.skills.actions.createSkill", "Create Skill")
|
|
233
|
+
})
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
}),
|
|
237
|
+
O && j && /* @__PURE__ */ C(h, {
|
|
238
|
+
resource: d("botlit.skills.moreResource", "more skills"),
|
|
239
|
+
error: O,
|
|
240
|
+
onRetry: () => void F()
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ C(g, {
|
|
243
|
+
hasMore: j && !O,
|
|
244
|
+
loadingMore: P,
|
|
245
|
+
onLoadMore: () => void F(),
|
|
246
|
+
loadedCount: b.length
|
|
247
|
+
})
|
|
248
|
+
] });
|
|
249
|
+
}
|
|
250
|
+
export { P as SkillsPage };
|
|
230
251
|
|
|
231
252
|
//# sourceMappingURL=SkillsPage.js.map
|