MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / readAdditionalSkillPaths

Function readAdditionalSkillPaths

src/runtime/agent.ts:145–190  ·  view source on GitHub ↗
(
  env: NodeJS.ProcessEnv = process.env,
)

Source from the content-addressed store, hash-verified

143 const content = env[FREVANA_SYSTEM_PROMPTS_ENV]?.trim();
144 return content ? content : undefined;
145}
146
147export function readAdditionalSkillPaths(
148 env: NodeJS.ProcessEnv = process.env,
149): string[] {
150 const rawValue = env[SKILLPACK_ADDITIONAL_SKILL_PATHS_ENV];
151 if (!rawValue) {
152 return [];
153 }
154
155 const paths: string[] = [];
156 const seen = new Set<string>();
157
158 for (const entry of rawValue.split(path.delimiter)) {
159 const trimmed = entry.trim();
160 if (!trimmed) {
161 continue;
162 }
163
164 const resolvedPath = path.resolve(trimmed);
165 if (seen.has(resolvedPath)) {
166 continue;
167 }
168
169 try {
170 if (
171 !fs.existsSync(resolvedPath) ||
172 !fs.statSync(resolvedPath).isDirectory()
173 ) {
174 console.warn(
175 `[PackAgent] Warning: Ignoring missing additional skill path: ${resolvedPath}`,
176 );
177 continue;
178 }
179 } catch (error) {
180 console.warn(
181 `[PackAgent] Warning: Could not inspect additional skill path ${resolvedPath}:`,
182 error,
183 );
184 continue;
185 }
186
187 seen.add(resolvedPath);
188 paths.push(resolvedPath);
189 }
190
191 return paths;
192}
193

Callers 2

getOrCreateSessionMethod · 0.85
agent.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected