MCPcopy Create free account
hub / github.com/arctic-cli/interface / loadMode

Function loadMode

packages/arctic/src/config/config.ts:256–282  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

254
255 const MODE_GLOB = new Bun.Glob("mode/*.md")
256 async function loadMode(dir: string) {
257 const result: Record<string, Agent> = {}
258 for await (const item of MODE_GLOB.scan({
259 absolute: true,
260 followSymlinks: true,
261 dot: true,
262 cwd: dir,
263 })) {
264 const md = await ConfigMarkdown.parse(item)
265 if (!md.data) continue
266
267 const config = {
268 name: path.basename(item, ".md"),
269 ...md.data,
270 prompt: md.content.trim(),
271 }
272 const parsed = Agent.safeParse(config)
273 if (parsed.success) {
274 result[config.name] = {
275 ...parsed.data,
276 mode: "primary" as const,
277 }
278 continue
279 }
280 }
281 return result
282 }
283
284 const PLUGIN_GLOB = new Bun.Glob("{plugin,plugins}/*.{ts,js}")
285 async function loadPlugin(dir: string) {

Callers 1

config.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected