tycono 0.1.16 → 0.1.18
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 +1 -1
- package/src/api/src/create-server.ts +2 -0
- package/src/api/src/routes/skills.ts +29 -28
- package/src/web/dist/assets/{index-fwQJALjZ.js → index-DTPm_7VX.js} +42 -42
- package/src/web/dist/assets/{preview-app-Bi90FWsr.js → preview-app-CLBsMBhE.js} +1 -1
- package/src/web/dist/index.html +1 -1
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ import { speechRouter } from './routes/speech.js';
|
|
|
28
28
|
import { costRouter } from './routes/cost.js';
|
|
29
29
|
import { syncRouter } from './routes/sync.js';
|
|
30
30
|
import { gitRouter } from './routes/git.js';
|
|
31
|
+
import { skillsRouter } from './routes/skills.js';
|
|
31
32
|
import { importKnowledge } from './services/knowledge-importer.js';
|
|
32
33
|
import { AnthropicProvider, type LLMProvider } from './engine/llm-adapter.js';
|
|
33
34
|
import { readConfig } from './services/company-config.js';
|
|
@@ -186,6 +187,7 @@ export function createExpressApp(): express.Application {
|
|
|
186
187
|
app.use('/api/cost', costRouter);
|
|
187
188
|
app.use('/api/sync', syncRouter);
|
|
188
189
|
app.use('/api/git', gitRouter);
|
|
190
|
+
app.use('/api/skills', skillsRouter);
|
|
189
191
|
|
|
190
192
|
app.get('/api/health', (_req, res) => {
|
|
191
193
|
res.json({ status: 'ok', companyRoot: COMPANY_ROOT });
|
|
@@ -127,37 +127,10 @@ skillsRouter.post('/registry/install', async (req: Request, res: Response, next:
|
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
// GET /api/skills/:id — Skill detail
|
|
131
|
-
skillsRouter.get('/:id', (req: Request, res: Response, next: NextFunction) => {
|
|
132
|
-
try {
|
|
133
|
-
const id = req.params.id as string;
|
|
134
|
-
|
|
135
|
-
// Check installed first
|
|
136
|
-
const installedPath = path.join(COMPANY_ROOT, '.claude', 'skills', '_shared', id, 'SKILL.md');
|
|
137
|
-
if (fs.existsSync(installedPath)) {
|
|
138
|
-
const content = fs.readFileSync(installedPath, 'utf-8');
|
|
139
|
-
const meta = extractSkillMeta(content, id);
|
|
140
|
-
res.json({ ...meta, installed: true, content });
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Check template
|
|
145
|
-
const templateSkills = getAvailableSkills();
|
|
146
|
-
const templateSkill = templateSkills.find(s => s.id === id);
|
|
147
|
-
if (templateSkill) {
|
|
148
|
-
res.json({ ...templateSkill, installed: false });
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
res.status(404).json({ error: `Skill not found: ${id}` });
|
|
153
|
-
} catch (err) {
|
|
154
|
-
next(err);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
130
|
/* ─── Skill Export (for Store publish) ──── */
|
|
159
131
|
|
|
160
132
|
// GET /api/skills/export/:roleId — Export full SKILL.md content for publishing
|
|
133
|
+
// NOTE: Must be registered BEFORE /:id to avoid "export" matching as an id
|
|
161
134
|
skillsRouter.get('/export/:roleId', (req: Request, res: Response, next: NextFunction) => {
|
|
162
135
|
try {
|
|
163
136
|
const roleId = req.params.roleId as string;
|
|
@@ -189,6 +162,34 @@ skillsRouter.get('/export/:roleId', (req: Request, res: Response, next: NextFunc
|
|
|
189
162
|
}
|
|
190
163
|
});
|
|
191
164
|
|
|
165
|
+
// GET /api/skills/:id — Skill detail (wildcard — must be LAST among GET routes)
|
|
166
|
+
skillsRouter.get('/:id', (req: Request, res: Response, next: NextFunction) => {
|
|
167
|
+
try {
|
|
168
|
+
const id = req.params.id as string;
|
|
169
|
+
|
|
170
|
+
// Check installed first
|
|
171
|
+
const installedPath = path.join(COMPANY_ROOT, '.claude', 'skills', '_shared', id, 'SKILL.md');
|
|
172
|
+
if (fs.existsSync(installedPath)) {
|
|
173
|
+
const content = fs.readFileSync(installedPath, 'utf-8');
|
|
174
|
+
const meta = extractSkillMeta(content, id);
|
|
175
|
+
res.json({ ...meta, installed: true, content });
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Check template
|
|
180
|
+
const templateSkills = getAvailableSkills();
|
|
181
|
+
const templateSkill = templateSkills.find(s => s.id === id);
|
|
182
|
+
if (templateSkill) {
|
|
183
|
+
res.json({ ...templateSkill, installed: false });
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
res.status(404).json({ error: `Skill not found: ${id}` });
|
|
188
|
+
} catch (err) {
|
|
189
|
+
next(err);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
|
|
192
193
|
/* ─── Role-Skill Management ─────────────── */
|
|
193
194
|
|
|
194
195
|
// GET /api/roles/:id/skills — Skills equipped to a role
|