@@ -17,23 +17,23 @@ export const DEFAULT_AGENT_SKILL_DISCOVERY_DIRS = [
1717
1818export type AgentSkillFileMap = Record < string , string > ;
1919
20- export type ParsedSkillBundle = {
20+ export interface ParsedSkillBundle {
2121 slug : string ;
2222 name : string ;
2323 description : string | null ;
2424 files : AgentSkillFileMap ;
2525 content : string ;
2626 tags : string [ ] ;
27- } ;
27+ }
2828
29- export type DiscoveredAgentSkillSummary = {
29+ export interface DiscoveredAgentSkillSummary {
3030 slug : string ;
3131 name : string ;
3232 description : string | null ;
3333 sourceRoot : string ;
3434 relativePath : string ;
3535 fileCount : number ;
36- } ;
36+ }
3737
3838function isRecord ( value : unknown ) : value is Record < string , unknown > {
3939 return typeof value === 'object' && value !== null && ! Array . isArray ( value ) ;
@@ -62,7 +62,10 @@ export function resolveAgentSkillsWorkspaceRoot(): string {
6262export function resolveAgentSkillDiscoveryDirs ( workspaceRoot ?: string ) : string [ ] {
6363 const configured = process . env . SENTRIS_AGENT_SKILLS_DISCOVERY_DIRS ?. trim ( ) ;
6464 const relativeDirs = configured
65- ? configured . split ( ',' ) . map ( ( dir ) => dir . trim ( ) ) . filter ( Boolean )
65+ ? configured
66+ . split ( ',' )
67+ . map ( ( dir ) => dir . trim ( ) )
68+ . filter ( Boolean )
6669 : [ ...DEFAULT_AGENT_SKILL_DISCOVERY_DIRS ] ;
6770
6871 const root = workspaceRoot ?? resolveAgentSkillsWorkspaceRoot ( ) ;
@@ -111,7 +114,10 @@ export function parseSkillMdFrontmatter(content: string): {
111114 const separator = line . indexOf ( ':' ) ;
112115 if ( separator <= 0 ) continue ;
113116 const key = line . slice ( 0 , separator ) . trim ( ) ;
114- const value = line . slice ( separator + 1 ) . trim ( ) . replace ( / ^ [ ' " ] | [ ' " ] $ / g, '' ) ;
117+ const value = line
118+ . slice ( separator + 1 )
119+ . trim ( )
120+ . replace ( / ^ [ ' " ] | [ ' " ] $ / g, '' ) ;
115121 if ( key === 'name' ) metadata . name = value ;
116122 if ( key === 'description' ) metadata . description = value ;
117123 if ( key === 'tags' ) {
@@ -181,7 +187,10 @@ export function normalizeSkillBundle(input: {
181187 } ;
182188}
183189
184- async function readTextFileIfAllowed ( filePath : string , relativePath : string ) : Promise < string | null > {
190+ async function readTextFileIfAllowed (
191+ filePath : string ,
192+ relativePath : string ,
193+ ) : Promise < string | null > {
185194 validateSkillRelativePath ( relativePath ) ;
186195 const fileStat = await stat ( filePath ) ;
187196 if ( ! fileStat . isFile ( ) || fileStat . size > AGENT_SKILL_FILE_MAX_BYTES ) {
@@ -293,7 +302,7 @@ export async function readDiscoveredSkillBundle(
293302}
294303
295304export function parseSkillBundlesFromZipEntries (
296- entries : Array < { entryName : string ; getData : ( ) => Buffer } > ,
305+ entries : { entryName : string ; getData : ( ) => Buffer } [ ] ,
297306) : ParsedSkillBundle [ ] {
298307 const filesBySkill = new Map < string , AgentSkillFileMap > ( ) ;
299308
@@ -361,9 +370,10 @@ function slugifyFromSkillMd(files: AgentSkillFileMap): string {
361370 . slice ( 0 , 128 ) ;
362371}
363372
364- export function mergeSkillFilesForResponse (
365- record : { content : string ; files ?: AgentSkillFileMap | null } ,
366- ) : AgentSkillFileMap {
373+ export function mergeSkillFilesForResponse ( record : {
374+ content : string ;
375+ files ?: AgentSkillFileMap | null ;
376+ } ) : AgentSkillFileMap {
367377 if ( isRecord ( record . files ) && Object . keys ( record . files ) . length > 0 ) {
368378 return record . files ;
369379 }
0 commit comments