devchain-cli 0.8.5 → 0.9.1
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/drizzle/0038_soft_texas_twister.sql +51 -0
- package/dist/drizzle/0039_early_the_spike.sql +1 -0
- package/dist/drizzle/0040_typical_mole_man.sql +3 -0
- package/dist/drizzle/0041_community_skill_sources.sql +12 -0
- package/dist/drizzle/meta/0037_snapshot.json +3670 -0
- package/dist/drizzle/meta/0038_snapshot.json +4019 -0
- package/dist/drizzle/meta/0039_snapshot.json +4026 -0
- package/dist/drizzle/meta/0040_snapshot.json +4028 -0
- package/dist/drizzle/meta/0041_snapshot.json +4102 -0
- package/dist/drizzle/meta/_journal.json +28 -0
- package/dist/server/app.module.js +2 -0
- package/dist/server/app.module.js.map +1 -1
- package/dist/server/modules/epics/controllers/epics.controller.js +4 -0
- package/dist/server/modules/epics/controllers/epics.controller.js.map +1 -1
- package/dist/server/modules/mcp/dtos/mcp.dto.d.ts +74 -0
- package/dist/server/modules/mcp/dtos/mcp.dto.js +18 -1
- package/dist/server/modules/mcp/dtos/mcp.dto.js.map +1 -1
- package/dist/server/modules/mcp/dtos/schema-registry.js +2 -0
- package/dist/server/modules/mcp/dtos/schema-registry.js.map +1 -1
- package/dist/server/modules/mcp/mcp.module.js +2 -0
- package/dist/server/modules/mcp/mcp.module.js.map +1 -1
- package/dist/server/modules/mcp/services/mcp.service.d.ts +7 -1
- package/dist/server/modules/mcp/services/mcp.service.js +126 -2
- package/dist/server/modules/mcp/services/mcp.service.js.map +1 -1
- package/dist/server/modules/mcp/tool-definitions.d.ts +177 -0
- package/dist/server/modules/mcp/tool-definitions.js +48 -0
- package/dist/server/modules/mcp/tool-definitions.js.map +1 -1
- package/dist/server/modules/projects/dtos/export.dto.d.ts +15 -15
- package/dist/server/modules/seeders/seeders/0002_seed_replace_permission_mode_plan.d.ts +3 -0
- package/dist/server/modules/seeders/seeders/0002_seed_replace_permission_mode_plan.js +45 -0
- package/dist/server/modules/seeders/seeders/0002_seed_replace_permission_mode_plan.js.map +1 -0
- package/dist/server/modules/seeders/seeders/0003_seed_preseed_jeffallan_claude_skills.d.ts +3 -0
- package/dist/server/modules/seeders/seeders/0003_seed_preseed_jeffallan_claude_skills.js +41 -0
- package/dist/server/modules/seeders/seeders/0003_seed_preseed_jeffallan_claude_skills.js.map +1 -0
- package/dist/server/modules/seeders/seeders/0004_seed_disable_microsoft_source_default.d.ts +3 -0
- package/dist/server/modules/seeders/seeders/0004_seed_disable_microsoft_source_default.js +48 -0
- package/dist/server/modules/seeders/seeders/0004_seed_disable_microsoft_source_default.js.map +1 -0
- package/dist/server/modules/seeders/services/data-seeder.service.js +9 -1
- package/dist/server/modules/seeders/services/data-seeder.service.js.map +1 -1
- package/dist/server/modules/settings/dtos/settings.dto.d.ts +18 -0
- package/dist/server/modules/settings/dtos/settings.dto.js +5 -0
- package/dist/server/modules/settings/dtos/settings.dto.js.map +1 -1
- package/dist/server/modules/settings/services/settings.service.d.ts +5 -0
- package/dist/server/modules/settings/services/settings.service.js +80 -1
- package/dist/server/modules/settings/services/settings.service.js.map +1 -1
- package/dist/server/modules/skills/adapters/anthropic-skill-source.adapter.d.ts +9 -0
- package/dist/server/modules/skills/adapters/anthropic-skill-source.adapter.js +169 -0
- package/dist/server/modules/skills/adapters/anthropic-skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/adapters/community-skill-source.adapter.d.ts +11 -0
- package/dist/server/modules/skills/adapters/community-skill-source.adapter.js +181 -0
- package/dist/server/modules/skills/adapters/community-skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/adapters/github-skill-source.base.d.ts +48 -0
- package/dist/server/modules/skills/adapters/github-skill-source.base.js +382 -0
- package/dist/server/modules/skills/adapters/github-skill-source.base.js.map +1 -0
- package/dist/server/modules/skills/adapters/microsoft-skill-source.adapter.d.ts +11 -0
- package/dist/server/modules/skills/adapters/microsoft-skill-source.adapter.js +227 -0
- package/dist/server/modules/skills/adapters/microsoft-skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/adapters/openai-skill-source.adapter.d.ts +13 -0
- package/dist/server/modules/skills/adapters/openai-skill-source.adapter.js +260 -0
- package/dist/server/modules/skills/adapters/openai-skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/adapters/skill-source.adapter.d.ts +26 -0
- package/dist/server/modules/skills/adapters/skill-source.adapter.js +5 -0
- package/dist/server/modules/skills/adapters/skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/adapters/trailofbits-skill-source.adapter.d.ts +14 -0
- package/dist/server/modules/skills/adapters/trailofbits-skill-source.adapter.js +253 -0
- package/dist/server/modules/skills/adapters/trailofbits-skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/adapters/vercel-skill-source.adapter.d.ts +15 -0
- package/dist/server/modules/skills/adapters/vercel-skill-source.adapter.js +292 -0
- package/dist/server/modules/skills/adapters/vercel-skill-source.adapter.js.map +1 -0
- package/dist/server/modules/skills/controllers/community-sources.controller.d.ts +12 -0
- package/dist/server/modules/skills/controllers/community-sources.controller.js +71 -0
- package/dist/server/modules/skills/controllers/community-sources.controller.js.map +1 -0
- package/dist/server/modules/skills/controllers/skills.controller.d.ts +42 -0
- package/dist/server/modules/skills/controllers/skills.controller.js +257 -0
- package/dist/server/modules/skills/controllers/skills.controller.js.map +1 -0
- package/dist/server/modules/skills/dtos/community-sources.dto.d.ts +100 -0
- package/dist/server/modules/skills/dtos/community-sources.dto.js +138 -0
- package/dist/server/modules/skills/dtos/community-sources.dto.js.map +1 -0
- package/dist/server/modules/skills/dtos/skill.dto.d.ts +169 -0
- package/dist/server/modules/skills/dtos/skill.dto.js +116 -0
- package/dist/server/modules/skills/dtos/skill.dto.js.map +1 -0
- package/dist/server/modules/skills/services/community-sources.service.d.ts +11 -0
- package/dist/server/modules/skills/services/community-sources.service.js +99 -0
- package/dist/server/modules/skills/services/community-sources.service.js.map +1 -0
- package/dist/server/modules/skills/services/skill-category.service.d.ts +5 -0
- package/dist/server/modules/skills/services/skill-category.service.js +155 -0
- package/dist/server/modules/skills/services/skill-category.service.js.map +1 -0
- package/dist/server/modules/skills/services/skill-source-registry.service.d.ts +9 -0
- package/dist/server/modules/skills/services/skill-source-registry.service.js +46 -0
- package/dist/server/modules/skills/services/skill-source-registry.service.js.map +1 -0
- package/dist/server/modules/skills/services/skill-sync.service.d.ts +38 -0
- package/dist/server/modules/skills/services/skill-sync.service.js +281 -0
- package/dist/server/modules/skills/services/skill-sync.service.js.map +1 -0
- package/dist/server/modules/skills/services/skills.service.d.ts +119 -0
- package/dist/server/modules/skills/services/skills.service.js +734 -0
- package/dist/server/modules/skills/services/skills.service.js.map +1 -0
- package/dist/server/modules/skills/skills.module.d.ts +2 -0
- package/dist/server/modules/skills/skills.module.js +76 -0
- package/dist/server/modules/skills/skills.module.js.map +1 -0
- package/dist/server/modules/storage/db/schema.d.ts +769 -0
- package/dist/server/modules/storage/db/schema.js +67 -1
- package/dist/server/modules/storage/db/schema.js.map +1 -1
- package/dist/server/modules/storage/interfaces/storage.interface.d.ts +7 -1
- package/dist/server/modules/storage/interfaces/storage.interface.js.map +1 -1
- package/dist/server/modules/storage/local/local-storage.service.d.ts +13 -1
- package/dist/server/modules/storage/local/local-storage.service.js +209 -7
- package/dist/server/modules/storage/local/local-storage.service.js.map +1 -1
- package/dist/server/modules/storage/models/domain.models.d.ts +59 -1
- package/dist/server/templates/dev-loop.json +85 -78
- package/dist/server/tsconfig.tsbuildinfo +1 -1
- package/dist/server/ui/assets/{ReviewDetailPage-DNZbiwkx.js → ReviewDetailPage-D13dH7Wh.js} +1 -1
- package/dist/server/ui/assets/{ReviewsPage-Dow8B8sr.js → ReviewsPage-C98ST0lf.js} +1 -1
- package/dist/server/ui/assets/index-C8Dc1yQf.js +945 -0
- package/dist/server/ui/assets/index-DZkJ40z9.css +32 -0
- package/dist/server/ui/assets/useReviewSubscription-CmLuF45Z.js +77 -0
- package/dist/server/ui/index.html +2 -2
- package/dist/templates/dev-loop.json +85 -78
- package/package.json +17 -1
- package/dist/server/ui/assets/index--HtPKe24.js +0 -914
- package/dist/server/ui/assets/index-BkiWahA0.css +0 -32
- package/dist/server/ui/assets/useReviewSubscription-CNhZ4Xwh.js +0 -83
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SkillSlugSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
3
|
+
export declare const SkillsRequiredInputSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">, string[], string[]>;
|
|
4
|
+
export declare const SkillSyncRequestSchema: z.ZodDefault<z.ZodObject<{
|
|
5
|
+
sourceName: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
sourceName?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
sourceName?: string | undefined;
|
|
10
|
+
}>>;
|
|
11
|
+
export declare const SkillDisableParamsSchema: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, {
|
|
16
|
+
id: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const SkillDisableBodySchema: z.ZodObject<{
|
|
19
|
+
projectId: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
projectId: string;
|
|
22
|
+
}, {
|
|
23
|
+
projectId: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const SkillEnableParamsSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
id: string;
|
|
29
|
+
}, {
|
|
30
|
+
id: string;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const SkillEnableBodySchema: z.ZodObject<{
|
|
33
|
+
projectId: z.ZodString;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
projectId: string;
|
|
36
|
+
}, {
|
|
37
|
+
projectId: string;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const SkillDisabledQuerySchema: z.ZodObject<{
|
|
40
|
+
projectId: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
projectId: string;
|
|
43
|
+
}, {
|
|
44
|
+
projectId: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const SkillBulkActionSchema: z.ZodObject<{
|
|
47
|
+
projectId: z.ZodString;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
projectId: string;
|
|
50
|
+
}, {
|
|
51
|
+
projectId: string;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const SkillSourceParamsSchema: z.ZodObject<{
|
|
54
|
+
name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
name: string;
|
|
57
|
+
}, {
|
|
58
|
+
name: string;
|
|
59
|
+
}>;
|
|
60
|
+
export declare const SkillsListQuerySchema: z.ZodObject<{
|
|
61
|
+
q: z.ZodOptional<z.ZodString>;
|
|
62
|
+
source: z.ZodOptional<z.ZodString>;
|
|
63
|
+
category: z.ZodOptional<z.ZodString>;
|
|
64
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
projectId?: string | undefined;
|
|
67
|
+
source?: string | undefined;
|
|
68
|
+
category?: string | undefined;
|
|
69
|
+
q?: string | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
projectId?: string | undefined;
|
|
72
|
+
source?: string | undefined;
|
|
73
|
+
category?: string | undefined;
|
|
74
|
+
q?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export declare const SkillUsageStatsQuerySchema: z.ZodObject<{
|
|
77
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
from: z.ZodOptional<z.ZodString>;
|
|
79
|
+
to: z.ZodOptional<z.ZodString>;
|
|
80
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
projectId?: string | undefined;
|
|
84
|
+
limit?: number | undefined;
|
|
85
|
+
offset?: number | undefined;
|
|
86
|
+
from?: string | undefined;
|
|
87
|
+
to?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
projectId?: string | undefined;
|
|
90
|
+
limit?: number | undefined;
|
|
91
|
+
offset?: number | undefined;
|
|
92
|
+
from?: string | undefined;
|
|
93
|
+
to?: string | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const SkillUsageLogQuerySchema: z.ZodObject<{
|
|
96
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
from: z.ZodOptional<z.ZodString>;
|
|
98
|
+
to: z.ZodOptional<z.ZodString>;
|
|
99
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
} & {
|
|
102
|
+
skillId: z.ZodOptional<z.ZodString>;
|
|
103
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
projectId?: string | undefined;
|
|
106
|
+
agentId?: string | undefined;
|
|
107
|
+
skillId?: string | undefined;
|
|
108
|
+
limit?: number | undefined;
|
|
109
|
+
offset?: number | undefined;
|
|
110
|
+
from?: string | undefined;
|
|
111
|
+
to?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
projectId?: string | undefined;
|
|
114
|
+
agentId?: string | undefined;
|
|
115
|
+
skillId?: string | undefined;
|
|
116
|
+
limit?: number | undefined;
|
|
117
|
+
offset?: number | undefined;
|
|
118
|
+
from?: string | undefined;
|
|
119
|
+
to?: string | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const SkillBySlugParamsSchema: z.ZodObject<{
|
|
122
|
+
source: z.ZodString;
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
name: string;
|
|
126
|
+
source: string;
|
|
127
|
+
}, {
|
|
128
|
+
name: string;
|
|
129
|
+
source: string;
|
|
130
|
+
}>;
|
|
131
|
+
export declare const SkillResolveSlugsBodySchema: z.ZodObject<{
|
|
132
|
+
slugs: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">, string[], string[]>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
slugs: string[];
|
|
135
|
+
}, {
|
|
136
|
+
slugs: string[];
|
|
137
|
+
}>;
|
|
138
|
+
export declare const SkillByIdParamsSchema: z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
id: string;
|
|
142
|
+
}, {
|
|
143
|
+
id: string;
|
|
144
|
+
}>;
|
|
145
|
+
export interface ResolvedSkillSummary {
|
|
146
|
+
id: string;
|
|
147
|
+
slug: string;
|
|
148
|
+
name: string;
|
|
149
|
+
displayName: string;
|
|
150
|
+
source: string;
|
|
151
|
+
category: string | null;
|
|
152
|
+
shortDescription: string | null;
|
|
153
|
+
description: string | null;
|
|
154
|
+
}
|
|
155
|
+
export type SkillSyncRequestDto = z.infer<typeof SkillSyncRequestSchema>;
|
|
156
|
+
export type SkillDisableParamsDto = z.infer<typeof SkillDisableParamsSchema>;
|
|
157
|
+
export type SkillDisableBodyDto = z.infer<typeof SkillDisableBodySchema>;
|
|
158
|
+
export type SkillEnableParamsDto = z.infer<typeof SkillEnableParamsSchema>;
|
|
159
|
+
export type SkillEnableBodyDto = z.infer<typeof SkillEnableBodySchema>;
|
|
160
|
+
export type SkillDisabledQueryDto = z.infer<typeof SkillDisabledQuerySchema>;
|
|
161
|
+
export type SkillBulkActionDto = z.infer<typeof SkillBulkActionSchema>;
|
|
162
|
+
export type SkillSourceParamsDto = z.infer<typeof SkillSourceParamsSchema>;
|
|
163
|
+
export type SkillsListQueryDto = z.infer<typeof SkillsListQuerySchema>;
|
|
164
|
+
export type SkillUsageStatsQueryDto = z.infer<typeof SkillUsageStatsQuerySchema>;
|
|
165
|
+
export type SkillUsageLogQueryDto = z.infer<typeof SkillUsageLogQuerySchema>;
|
|
166
|
+
export type SkillBySlugParamsDto = z.infer<typeof SkillBySlugParamsSchema>;
|
|
167
|
+
export type SkillResolveSlugsBodyDto = z.infer<typeof SkillResolveSlugsBodySchema>;
|
|
168
|
+
export type SkillByIdParamsDto = z.infer<typeof SkillByIdParamsSchema>;
|
|
169
|
+
export type SkillSlugDto = z.infer<typeof SkillSlugSchema>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkillByIdParamsSchema = exports.SkillResolveSlugsBodySchema = exports.SkillBySlugParamsSchema = exports.SkillUsageLogQuerySchema = exports.SkillUsageStatsQuerySchema = exports.SkillsListQuerySchema = exports.SkillSourceParamsSchema = exports.SkillBulkActionSchema = exports.SkillDisabledQuerySchema = exports.SkillEnableBodySchema = exports.SkillEnableParamsSchema = exports.SkillDisableBodySchema = exports.SkillDisableParamsSchema = exports.SkillSyncRequestSchema = exports.SkillsRequiredInputSchema = exports.SkillSlugSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const SKILL_SLUG_SEGMENT_REGEX = /^[a-z0-9_-]+$/i;
|
|
6
|
+
const SKILL_SLUG_SEGMENT_MAX_LENGTH = 64;
|
|
7
|
+
const SKILL_SLUG_MAX_LENGTH = SKILL_SLUG_SEGMENT_MAX_LENGTH * 2 + 1;
|
|
8
|
+
const SOURCE_NAME_REGEX = /^[a-z0-9_-]+$/i;
|
|
9
|
+
exports.SkillSlugSchema = zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.trim()
|
|
12
|
+
.min(3)
|
|
13
|
+
.max(SKILL_SLUG_MAX_LENGTH)
|
|
14
|
+
.transform((value) => value.toLowerCase())
|
|
15
|
+
.superRefine((value, context) => {
|
|
16
|
+
const segments = value.split('/');
|
|
17
|
+
if (segments.length !== 2) {
|
|
18
|
+
context.addIssue({
|
|
19
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
20
|
+
message: 'Skill slug must use source/name format.',
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
for (const segment of segments) {
|
|
25
|
+
if (segment.length === 0) {
|
|
26
|
+
context.addIssue({
|
|
27
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
28
|
+
message: 'Skill slug segments cannot be empty.',
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (segment.length > SKILL_SLUG_SEGMENT_MAX_LENGTH) {
|
|
33
|
+
context.addIssue({
|
|
34
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
35
|
+
message: `Skill slug segments must be at most ${SKILL_SLUG_SEGMENT_MAX_LENGTH} characters.`,
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!SKILL_SLUG_SEGMENT_REGEX.test(segment)) {
|
|
40
|
+
context.addIssue({
|
|
41
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
42
|
+
message: 'Skill slug segments may only contain alphanumeric characters, hyphens, and underscores.',
|
|
43
|
+
});
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
exports.SkillsRequiredInputSchema = zod_1.z
|
|
49
|
+
.array(exports.SkillSlugSchema)
|
|
50
|
+
.transform((slugs) => Array.from(new Set(slugs)));
|
|
51
|
+
exports.SkillSyncRequestSchema = zod_1.z
|
|
52
|
+
.object({
|
|
53
|
+
sourceName: zod_1.z.string().trim().min(1).optional(),
|
|
54
|
+
})
|
|
55
|
+
.default({});
|
|
56
|
+
exports.SkillDisableParamsSchema = zod_1.z.object({
|
|
57
|
+
id: zod_1.z.string().uuid(),
|
|
58
|
+
});
|
|
59
|
+
exports.SkillDisableBodySchema = zod_1.z.object({
|
|
60
|
+
projectId: zod_1.z.string().uuid(),
|
|
61
|
+
});
|
|
62
|
+
exports.SkillEnableParamsSchema = zod_1.z.object({
|
|
63
|
+
id: zod_1.z.string().uuid(),
|
|
64
|
+
});
|
|
65
|
+
exports.SkillEnableBodySchema = zod_1.z.object({
|
|
66
|
+
projectId: zod_1.z.string().uuid(),
|
|
67
|
+
});
|
|
68
|
+
exports.SkillDisabledQuerySchema = zod_1.z.object({
|
|
69
|
+
projectId: zod_1.z.string().uuid(),
|
|
70
|
+
});
|
|
71
|
+
exports.SkillBulkActionSchema = zod_1.z.object({
|
|
72
|
+
projectId: zod_1.z.string().uuid(),
|
|
73
|
+
});
|
|
74
|
+
exports.SkillSourceParamsSchema = zod_1.z.object({
|
|
75
|
+
name: zod_1.z
|
|
76
|
+
.string()
|
|
77
|
+
.trim()
|
|
78
|
+
.min(1)
|
|
79
|
+
.max(SKILL_SLUG_SEGMENT_MAX_LENGTH)
|
|
80
|
+
.transform((value) => value.toLowerCase())
|
|
81
|
+
.refine((value) => SOURCE_NAME_REGEX.test(value), {
|
|
82
|
+
message: 'Source name may only contain alphanumeric characters, hyphens, and underscores.',
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
exports.SkillsListQuerySchema = zod_1.z.object({
|
|
86
|
+
q: zod_1.z.string().trim().min(1).optional(),
|
|
87
|
+
source: zod_1.z.string().trim().min(1).optional(),
|
|
88
|
+
category: zod_1.z.string().trim().min(1).optional(),
|
|
89
|
+
projectId: zod_1.z.string().uuid().optional(),
|
|
90
|
+
});
|
|
91
|
+
exports.SkillUsageStatsQuerySchema = zod_1.z.object({
|
|
92
|
+
projectId: zod_1.z.string().uuid().optional(),
|
|
93
|
+
from: zod_1.z.string().datetime().optional(),
|
|
94
|
+
to: zod_1.z.string().datetime().optional(),
|
|
95
|
+
limit: zod_1.z.coerce.number().int().positive().max(1000).optional(),
|
|
96
|
+
offset: zod_1.z.coerce.number().int().min(0).optional(),
|
|
97
|
+
});
|
|
98
|
+
exports.SkillUsageLogQuerySchema = exports.SkillUsageStatsQuerySchema.extend({
|
|
99
|
+
skillId: zod_1.z.string().uuid().optional(),
|
|
100
|
+
agentId: zod_1.z.string().uuid().optional(),
|
|
101
|
+
});
|
|
102
|
+
exports.SkillBySlugParamsSchema = zod_1.z.object({
|
|
103
|
+
source: zod_1.z.string().trim().min(1),
|
|
104
|
+
name: zod_1.z.string().trim().min(1),
|
|
105
|
+
});
|
|
106
|
+
exports.SkillResolveSlugsBodySchema = zod_1.z.object({
|
|
107
|
+
slugs: zod_1.z
|
|
108
|
+
.array(exports.SkillSlugSchema)
|
|
109
|
+
.min(1)
|
|
110
|
+
.max(50)
|
|
111
|
+
.transform((slugs) => Array.from(new Set(slugs))),
|
|
112
|
+
});
|
|
113
|
+
exports.SkillByIdParamsSchema = zod_1.z.object({
|
|
114
|
+
id: zod_1.z.string().uuid(),
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=skill.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.dto.js","sourceRoot":"","sources":["../../../../src/modules/skills/dtos/skill.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAClD,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,qBAAqB,GAAG,6BAA6B,GAAG,CAAC,GAAG,CAAC,CAAC;AACpE,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE9B,QAAA,eAAe,GAAG,OAAC;KAC7B,MAAM,EAAE;KACR,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,qBAAqB,CAAC;KAC1B,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;KACzC,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CAA0B,CAAC,MAAM,CAAC;IACxE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,OAAC;SACL,KAAK,CAAC,uBAAe,CAAC;SACtB,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommunitySkillSource } from '../../storage/models/domain.models';
|
|
2
|
+
import { type StorageService } from '../../storage/interfaces/storage.interface';
|
|
3
|
+
import type { CreateCommunitySourceDto } from '../dtos/community-sources.dto';
|
|
4
|
+
export declare class CommunitySourcesService {
|
|
5
|
+
private readonly storage;
|
|
6
|
+
constructor(storage: StorageService);
|
|
7
|
+
listCommunitySources(): Promise<CommunitySkillSource[]>;
|
|
8
|
+
createCommunitySource(data: CreateCommunitySourceDto): Promise<CommunitySkillSource>;
|
|
9
|
+
deleteCommunitySource(id: string): Promise<void>;
|
|
10
|
+
private deleteSourceSkillsDirectory;
|
|
11
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.CommunitySourcesService = void 0;
|
|
49
|
+
const common_1 = require("@nestjs/common");
|
|
50
|
+
const node_os_1 = require("node:os");
|
|
51
|
+
const node_path_1 = require("node:path");
|
|
52
|
+
const fs = __importStar(require("node:fs/promises"));
|
|
53
|
+
const error_types_1 = require("../../../common/errors/error-types");
|
|
54
|
+
const logger_1 = require("../../../common/logging/logger");
|
|
55
|
+
const storage_interface_1 = require("../../storage/interfaces/storage.interface");
|
|
56
|
+
const logger = (0, logger_1.createLogger)('CommunitySourcesService');
|
|
57
|
+
let CommunitySourcesService = class CommunitySourcesService {
|
|
58
|
+
constructor(storage) {
|
|
59
|
+
this.storage = storage;
|
|
60
|
+
}
|
|
61
|
+
async listCommunitySources() {
|
|
62
|
+
return this.storage.listCommunitySkillSources();
|
|
63
|
+
}
|
|
64
|
+
async createCommunitySource(data) {
|
|
65
|
+
return this.storage.createCommunitySkillSource({
|
|
66
|
+
name: data.name,
|
|
67
|
+
repoOwner: data.repoOwner,
|
|
68
|
+
repoName: data.repoName,
|
|
69
|
+
branch: data.branch,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async deleteCommunitySource(id) {
|
|
73
|
+
const source = await this.storage.getCommunitySkillSource(id);
|
|
74
|
+
await this.storage.deleteCommunitySkillSource(id);
|
|
75
|
+
await this.deleteSourceSkillsDirectory(source.name);
|
|
76
|
+
}
|
|
77
|
+
async deleteSourceSkillsDirectory(sourceName) {
|
|
78
|
+
const normalizedSourceName = sourceName.trim().toLowerCase();
|
|
79
|
+
const sourcePath = (0, node_path_1.join)((0, node_os_1.homedir)(), '.devchain', 'skills', normalizedSourceName);
|
|
80
|
+
try {
|
|
81
|
+
await fs.rm(sourcePath, { recursive: true, force: true });
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw new error_types_1.StorageError('Failed to delete community source local skills directory.', {
|
|
85
|
+
sourceName: normalizedSourceName,
|
|
86
|
+
sourcePath,
|
|
87
|
+
cause: error instanceof Error ? error.message : String(error),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
logger.info({ sourceName: normalizedSourceName, sourcePath }, 'Deleted local skills directory for community source');
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.CommunitySourcesService = CommunitySourcesService;
|
|
94
|
+
exports.CommunitySourcesService = CommunitySourcesService = __decorate([
|
|
95
|
+
(0, common_1.Injectable)(),
|
|
96
|
+
__param(0, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
|
|
97
|
+
__metadata("design:paramtypes", [Object])
|
|
98
|
+
], CommunitySourcesService);
|
|
99
|
+
//# sourceMappingURL=community-sources.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"community-sources.service.js","sourceRoot":"","sources":["../../../../src/modules/skills/services/community-sources.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,qCAAkC;AAClC,yCAAiC;AACjC,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CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,0BAAY,CAAC,2DAA2D,EAAE;gBAClF,UAAU,EAAE,oBAAoB;gBAChC,UAAU;gBACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,IAAI,CACT,EAAE,UAAU,EAAE,oBAAoB,EAAE,UAAU,EAAE,EAChD,qDAAqD,CACtD,CAAC;IACJ,CAAC;CACF,CAAA;AAzCY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;;GADzB,uBAAuB,CAyCnC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type SkillCategory = 'security' | 'testing' | 'deployment' | 'documents' | 'design' | 'integration' | 'creative' | 'communication' | 'development';
|
|
2
|
+
export declare class SkillCategoryService {
|
|
3
|
+
deriveCategory(name?: string | null, description?: string | null, compatibility?: string | null): SkillCategory;
|
|
4
|
+
private buildSearchText;
|
|
5
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SkillCategoryService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const CATEGORY_RULES = [
|
|
12
|
+
{
|
|
13
|
+
category: 'security',
|
|
14
|
+
patterns: [
|
|
15
|
+
/\bsecurity\b/,
|
|
16
|
+
/\bsecure\b/,
|
|
17
|
+
/\bowasp\b/,
|
|
18
|
+
/\bvulnerab(?:ility|ilities)\b/,
|
|
19
|
+
/\bauth(?:entication|orization)?\b/,
|
|
20
|
+
/\bencrypt(?:ion|ed)?\b/,
|
|
21
|
+
/\bthreat\b/,
|
|
22
|
+
/\bcve\b/,
|
|
23
|
+
/\bcsrf\b/,
|
|
24
|
+
/\bxss\b/,
|
|
25
|
+
/\bcompliance\b/,
|
|
26
|
+
/\bsecret(?:s)?\b/,
|
|
27
|
+
/\b(?:pen(?:etration)?|pentest)\b/,
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
category: 'testing',
|
|
32
|
+
patterns: [
|
|
33
|
+
/\btest(?:ing|s)?\b/,
|
|
34
|
+
/\bspec(?:s)?\b/,
|
|
35
|
+
/\bcoverage\b/,
|
|
36
|
+
/\bmock(?:ing|s)?\b/,
|
|
37
|
+
/\bfixture(?:s)?\b/,
|
|
38
|
+
/\bqa\b/,
|
|
39
|
+
/\bassert(?:ion|ions)?\b/,
|
|
40
|
+
/\be2e\b/,
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
category: 'deployment',
|
|
45
|
+
patterns: [
|
|
46
|
+
/\bdeploy(?:ment|ing)?\b/,
|
|
47
|
+
/\brelease\b/,
|
|
48
|
+
/\brollout\b/,
|
|
49
|
+
/\bkubernetes\b/,
|
|
50
|
+
/\bk8s\b/,
|
|
51
|
+
/\bdocker\b/,
|
|
52
|
+
/\bterraform\b/,
|
|
53
|
+
/\bci\/cd\b/,
|
|
54
|
+
/\bpipeline(?:s)?\b/,
|
|
55
|
+
/\bhosting\b/,
|
|
56
|
+
/\bcloudflare\b/,
|
|
57
|
+
/\bvercel\b/,
|
|
58
|
+
/\bnetlify\b/,
|
|
59
|
+
/\brender\b/,
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
category: 'documents',
|
|
64
|
+
patterns: [
|
|
65
|
+
/\bdocs?\b/,
|
|
66
|
+
/\bdocument(?:ation|s)?\b/,
|
|
67
|
+
/\breadme\b/,
|
|
68
|
+
/\bknowledge\b/,
|
|
69
|
+
/\bnotion\b/,
|
|
70
|
+
/\bconfluence\b/,
|
|
71
|
+
/\bpdf\b/,
|
|
72
|
+
/\bspreadsheet(?:s)?\b/,
|
|
73
|
+
/\breport(?:s)?\b/,
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
category: 'design',
|
|
78
|
+
patterns: [
|
|
79
|
+
/\bdesign\b/,
|
|
80
|
+
/\bfigma\b/,
|
|
81
|
+
/\bprototype(?:s)?\b/,
|
|
82
|
+
/\bwireframe(?:s)?\b/,
|
|
83
|
+
/\bui\b/,
|
|
84
|
+
/\bux\b/,
|
|
85
|
+
/\bstyle\s*guide\b/,
|
|
86
|
+
/\bvisual\b/,
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
category: 'integration',
|
|
91
|
+
patterns: [
|
|
92
|
+
/\bintegration(?:s)?\b/,
|
|
93
|
+
/\bapi(?:s)?\b/,
|
|
94
|
+
/\bwebhook(?:s)?\b/,
|
|
95
|
+
/\bconnector(?:s)?\b/,
|
|
96
|
+
/\bmcp\b/,
|
|
97
|
+
/\bsdk(?:s)?\b/,
|
|
98
|
+
/\bplugin(?:s)?\b/,
|
|
99
|
+
/\bthird[- ]party\b/,
|
|
100
|
+
/\bsync\b/,
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
category: 'creative',
|
|
105
|
+
patterns: [
|
|
106
|
+
/\bcreative\b/,
|
|
107
|
+
/\bimage(?:gen)?\b/,
|
|
108
|
+
/\bvideo\b/,
|
|
109
|
+
/\baudio\b/,
|
|
110
|
+
/\bmusic\b/,
|
|
111
|
+
/\bstory\b/,
|
|
112
|
+
/\billustration\b/,
|
|
113
|
+
/\bart\b/,
|
|
114
|
+
/\bsora\b/,
|
|
115
|
+
/\bspeech\b/,
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
category: 'communication',
|
|
120
|
+
patterns: [
|
|
121
|
+
/\bcommunicat(?:e|ion)\b/,
|
|
122
|
+
/\bemail\b/,
|
|
123
|
+
/\bmessage(?:s)?\b/,
|
|
124
|
+
/\bchat\b/,
|
|
125
|
+
/\bslack\b/,
|
|
126
|
+
/\bteams\b/,
|
|
127
|
+
/\bmeeting(?:s)?\b/,
|
|
128
|
+
/\bpresentation(?:s)?\b/,
|
|
129
|
+
/\btranscribe\b/,
|
|
130
|
+
/\bsummar(?:ize|y)\b/,
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
let SkillCategoryService = class SkillCategoryService {
|
|
135
|
+
deriveCategory(name, description, compatibility) {
|
|
136
|
+
const haystack = this.buildSearchText(name, description, compatibility);
|
|
137
|
+
for (const rule of CATEGORY_RULES) {
|
|
138
|
+
if (rule.patterns.some((pattern) => pattern.test(haystack))) {
|
|
139
|
+
return rule.category;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return 'development';
|
|
143
|
+
}
|
|
144
|
+
buildSearchText(name, description, compatibility) {
|
|
145
|
+
return [name, description, compatibility]
|
|
146
|
+
.map((value) => (typeof value === 'string' ? value.trim().toLowerCase() : ''))
|
|
147
|
+
.filter((value) => value.length > 0)
|
|
148
|
+
.join(' ');
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
exports.SkillCategoryService = SkillCategoryService;
|
|
152
|
+
exports.SkillCategoryService = SkillCategoryService = __decorate([
|
|
153
|
+
(0, common_1.Injectable)()
|
|
154
|
+
], SkillCategoryService);
|
|
155
|
+
//# sourceMappingURL=skill-category.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-category.service.js","sourceRoot":"","sources":["../../../../src/modules/skills/services/skill-category.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAkB5C,MAAM,cAAc,GAA4B;IAC9C;QACE,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE;YACR,cAAc;YACd,YAAY;YACZ,WAAW;YACX,+BAA+B;YAC/B,mCAAmC;YACnC,wBAAwB;YACxB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,SAAS;YACT,gBAAgB;YAChB,kBAAkB;YAClB,kCAAkC;SACnC;KACF;IACD;QACE,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE;YACR,oBAAoB;YACpB,gBAAgB;YAChB,cAAc;YACd,oBAAoB;YACpB,mBAAmB;YACnB,QAAQ;YACR,yBAAyB;YACzB,SAAS;SACV;KACF;IACD;QACE,QAAQ,EAAE,YAAY;QACtB,QAAQ,EAAE;YACR,yBAAyB;YACzB,aAAa;YACb,aAAa;YACb,gBAAgB;YAChB,SAAS;YACT,YAAY;YACZ,eAAe;YACf,YAAY;YACZ,oBAAoB;YACpB,aAAa;YACb,gBAAgB;YAChB,YAAY;YACZ,aAAa;YACb,YAAY;SACb;KACF;IACD;QACE,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE;YACR,WAAW;YACX,0BAA0B;YAC1B,YAAY;YACZ,eAAe;YACf,YAAY;YACZ,gBAAgB;YAChB,SAAS;YACT,uBAAuB;YACvB,kBAAkB;SACnB;KACF;IACD;QACE,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE;YACR,YAAY;YACZ,WAAW;YACX,qBAAqB;YACrB,qBAAqB;YACrB,QAAQ;YACR,QAAQ;YACR,mBAAmB;YACnB,YAAY;SACb;KACF;IACD;QACE,QAAQ,EAAE,aAAa;QACvB,QAAQ,EAAE;YACR,uBAAuB;YACvB,eAAe;YACf,mBAAmB;Y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AAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;aACnC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AA3BY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CA2BhC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SkillSourceAdapter } from '../adapters/skill-source.adapter';
|
|
2
|
+
import { type StorageService } from '../../storage/interfaces/storage.interface';
|
|
3
|
+
export declare class SkillSourceRegistryService {
|
|
4
|
+
private readonly builtInAdapters;
|
|
5
|
+
private readonly storage;
|
|
6
|
+
constructor(builtInAdapters: SkillSourceAdapter[], storage: StorageService);
|
|
7
|
+
getAdapters(): Promise<SkillSourceAdapter[]>;
|
|
8
|
+
getAdapterBySourceName(name: string): Promise<SkillSourceAdapter | null>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SkillSourceRegistryService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const community_skill_source_adapter_1 = require("../adapters/community-skill-source.adapter");
|
|
18
|
+
const skill_source_adapter_1 = require("../adapters/skill-source.adapter");
|
|
19
|
+
const storage_interface_1 = require("../../storage/interfaces/storage.interface");
|
|
20
|
+
let SkillSourceRegistryService = class SkillSourceRegistryService {
|
|
21
|
+
constructor(builtInAdapters, storage) {
|
|
22
|
+
this.builtInAdapters = builtInAdapters;
|
|
23
|
+
this.storage = storage;
|
|
24
|
+
}
|
|
25
|
+
async getAdapters() {
|
|
26
|
+
const communitySources = await this.storage.listCommunitySkillSources();
|
|
27
|
+
const communityAdapters = communitySources.map((source) => new community_skill_source_adapter_1.CommunitySkillSourceAdapter(source));
|
|
28
|
+
return [...this.builtInAdapters, ...communityAdapters];
|
|
29
|
+
}
|
|
30
|
+
async getAdapterBySourceName(name) {
|
|
31
|
+
const normalizedName = name.trim().toLowerCase();
|
|
32
|
+
if (!normalizedName) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const adapters = await this.getAdapters();
|
|
36
|
+
return (adapters.find((adapter) => adapter.sourceName.trim().toLowerCase() === normalizedName) ?? null);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.SkillSourceRegistryService = SkillSourceRegistryService;
|
|
40
|
+
exports.SkillSourceRegistryService = SkillSourceRegistryService = __decorate([
|
|
41
|
+
(0, common_1.Injectable)(),
|
|
42
|
+
__param(0, (0, common_1.Inject)(skill_source_adapter_1.SKILL_SOURCE_ADAPTERS)),
|
|
43
|
+
__param(1, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
|
|
44
|
+
__metadata("design:paramtypes", [Array, Object])
|
|
45
|
+
], SkillSourceRegistryService);
|
|
46
|
+
//# sourceMappingURL=skill-source-registry.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-source-registry.service.js","sourceRoot":"","sources":["../../../../src/modules/skills/services/skill-source-registry.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+FAAyF;AACzF,2EAAkG;AAClG,kFAAkG;AAG3F,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACkD,eAAqC,EAC3C,OAAuB;QADjB,oBAAe,GAAf,eAAe,CAAsB;QAC3C,YAAO,GAAP,OAAO,CAAgB;IAChE,CAAC;IAEJ,KAAK,CAAC,WAAW;QACf,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,CAAC;QACxE,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,GAAG,CAC5C,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,4DAA2B,CAAC,MAAM,CAAC,CACpD,CAAC;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,iBAAiB,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,IAAY;QACvC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACjD,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,OAAO,CACL,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,IAAI,IAAI,CAC/F,CAAC;IACJ,CAAC;CACF,CAAA;AAzBY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,4CAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;;GAHf,0BAA0B,CA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