Further Agent updates
This commit is contained in:
@@ -102,6 +102,22 @@ async function bareAgentDiscoverSkills(ctx, paths) {
|
||||
}
|
||||
await scanRoot(paths.workspaceSkills, 'workspace')
|
||||
await scanRoot(paths.skillsGlobal, 'global')
|
||||
let extras = Array.isArray(paths.extraSkillRoots) ? paths.extraSkillRoots : []
|
||||
if (!extras.length && typeof bareAgentDiscoverProjectSkillRoots === 'function') {
|
||||
const env =
|
||||
ctx.env && typeof ctx.env === 'object'
|
||||
? /** @type {Record<string, string>} */ (ctx.env)
|
||||
: {}
|
||||
const start = String(env.PWD || env.CWD || env.HOME || '').trim()
|
||||
if (start) extras = await bareAgentDiscoverProjectSkillRoots(ctx, start)
|
||||
}
|
||||
for (let i = 0; i < extras.length; i++) {
|
||||
const item = extras[i]
|
||||
const root = typeof item === 'string' ? item : String((item && item.path) || '')
|
||||
const source =
|
||||
typeof item === 'object' && item && item.source ? String(item.source) : 'project'
|
||||
if (root) await scanRoot(root, source)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -117,7 +133,7 @@ async function bareAgentSkillsCompactPrompt(ctx, paths, maxChars) {
|
||||
let block =
|
||||
'## Available skills (compact index)\n' +
|
||||
'Each skill is a directory with **SKILL.md** (optional YAML frontmatter: `name`, `description`, …).\n' +
|
||||
'**Workspace skills** (`~/.agent/workspace/skills/`) override **global** (`~/.agent/skills/`) when names match.\n' +
|
||||
'**Workspace skills** (`~/.agent/workspace/skills/`) override **global** (`~/.agent/skills/`) and walk-up `.grok/skills` / `.agents/skills` when names match.\n' +
|
||||
'To run one: call the **read_skill** tool with the skill id or frontmatter `name` before following its instructions.\n\n'
|
||||
if (!skills.length) {
|
||||
block += '(No skills discovered yet — add folders under `workspace/skills/<id>/SKILL.md`.)\n'
|
||||
|
||||
Reference in New Issue
Block a user