INNER CODE UNIT · JavaScript

resolveSkillDirs

fengshao1227/ccg-workflow · dsh-ccg/src/index.js:234

export function resolveSkillDirs(config = {}, deps = {}) {
  const bundledDir = deps.bundledDir ?? BUNDLED_SKILL_DIR
  const exists = deps.exists ?? existsSync

  const dirs = []
  // A consumer importing only `src/` has no bundle beside it; publishing a root
  // that is not there would fail the provider instead of simply adding nothing.
  if (config.skills !== false && exists(bundledDir)) dirs.push(bundledDir)
  for (const dir of config.skillDirs ?? []) {
    if (typeof dir === 'string' && dir.trim() !== '') dirs.push(dir)
  }
  return dirs
}

/**
 * Render the routing convention shown to the main model. Generated from the
 * resolved matrix, so it can never advertise a model a role is not actually
 * pinned to.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…