@assistkick/create 1.12.0 → 1.13.0
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/package.json
CHANGED
|
@@ -8,14 +8,12 @@ import express from 'express';
|
|
|
8
8
|
import type { Server } from 'node:http';
|
|
9
9
|
|
|
10
10
|
/** Create a test app with skill routes mounted at /api/projects/:id/skills */
|
|
11
|
-
const createTestApp = (
|
|
12
|
-
const
|
|
13
|
-
getWorkspacePath: (_projectId: string) => workspacePath,
|
|
14
|
-
} as any;
|
|
11
|
+
const createTestApp = (skillsBasePath: string) => {
|
|
12
|
+
const skillsDir = join(skillsBasePath, '.claude', 'skills');
|
|
15
13
|
const log = mock.fn();
|
|
16
14
|
const app = express();
|
|
17
15
|
app.use(express.json());
|
|
18
|
-
const skillRoutes = createSkillRoutes({
|
|
16
|
+
const skillRoutes = createSkillRoutes({ skillsDir, log });
|
|
19
17
|
app.use('/api/projects/:id/skills', skillRoutes);
|
|
20
18
|
return { app, log };
|
|
21
19
|
};
|
|
@@ -7,10 +7,9 @@ import { Router } from 'express';
|
|
|
7
7
|
import { join } from 'node:path';
|
|
8
8
|
import { readdir, readFile } from 'node:fs/promises';
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
10
|
-
import type { ProjectWorkspaceService } from '../services/project_workspace_service.js';
|
|
11
10
|
|
|
12
11
|
interface SkillRoutesDeps {
|
|
13
|
-
|
|
12
|
+
skillsDir: string;
|
|
14
13
|
log: (tag: string, ...args: unknown[]) => void;
|
|
15
14
|
}
|
|
16
15
|
|
|
@@ -43,7 +42,7 @@ export const parseSkillMd = (content: string): { name: string; description: stri
|
|
|
43
42
|
return { name, description };
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
export const createSkillRoutes = ({
|
|
45
|
+
export const createSkillRoutes = ({ skillsDir, log }: SkillRoutesDeps): Router => {
|
|
47
46
|
const router: Router = Router({ mergeParams: true });
|
|
48
47
|
|
|
49
48
|
router.get('/', async (req, res) => {
|
|
@@ -51,8 +50,6 @@ export const createSkillRoutes = ({ workspaceService, log }: SkillRoutesDeps): R
|
|
|
51
50
|
log('SKILLS', `GET /api/projects/${id}/skills`);
|
|
52
51
|
|
|
53
52
|
try {
|
|
54
|
-
const wsPath = workspaceService.getWorkspacePath(id);
|
|
55
|
-
const skillsDir = join(wsPath, '.claude', 'skills');
|
|
56
53
|
|
|
57
54
|
if (!existsSync(skillsDir)) {
|
|
58
55
|
res.json({ skills: [] });
|
|
@@ -133,7 +133,7 @@ const fileRoutes = createFileRoutes({ workspaceService, log });
|
|
|
133
133
|
app.use('/api/projects/:id/files', authMiddleware.requireAuth, fileRoutes);
|
|
134
134
|
|
|
135
135
|
// Skills routes (nested under /api/projects/:id/skills)
|
|
136
|
-
const skillRoutes = createSkillRoutes({
|
|
136
|
+
const skillRoutes = createSkillRoutes({ skillsDir: paths.skillsDir, log });
|
|
137
137
|
app.use('/api/projects/:id/skills', authMiddleware.requireAuth, skillRoutes);
|
|
138
138
|
|
|
139
139
|
// Agent management routes (authenticated)
|