mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
fix: include skill path in /skill prompts (#711)
This commit is contained in:
parent
6bf073f130
commit
c85a5720f2
1 changed files with 4 additions and 1 deletions
|
|
@ -3357,7 +3357,10 @@ export class InteractiveMode {
|
|||
const content = fs.readFileSync(skillPath, "utf-8");
|
||||
// Strip YAML frontmatter if present
|
||||
const body = content.replace(/^---\n[\s\S]*?\n---\n/, "").trim();
|
||||
const message = args ? `${body}\n\n---\n\nUser: ${args}` : body;
|
||||
const skillDir = path.dirname(skillPath);
|
||||
const header = `Skill location: ${skillPath}\nReferences are relative to ${skillDir}.`;
|
||||
const skillMessage = `${header}\n\n${body}`;
|
||||
const message = args ? `${skillMessage}\n\n---\n\nUser: ${args}` : skillMessage;
|
||||
await this.session.prompt(message);
|
||||
} catch (err) {
|
||||
this.showError(`Failed to load skill: ${err instanceof Error ? err.message : String(err)}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue