fix(coding-agent): unify source provenance, closes #1734
This commit is contained in:
@@ -60,10 +60,10 @@ export default function commandsExtension(pi: ExtensionAPI) {
|
||||
if (selected && !selected.startsWith("---")) {
|
||||
const cmdName = selected.split(" - ")[0].slice(1); // Remove leading /
|
||||
const cmd = commands.find((c) => c.name === cmdName);
|
||||
if (cmd?.path) {
|
||||
const showPath = await ctx.ui.confirm(cmd.name, `View source path?\n${cmd.path}`);
|
||||
if (cmd?.sourceInfo.path) {
|
||||
const showPath = await ctx.ui.confirm(cmd.name, `View source path?\n${cmd.sourceInfo.path}`);
|
||||
if (showPath) {
|
||||
ctx.ui.notify(cmd.path, "info");
|
||||
ctx.ui.notify(cmd.sourceInfo.path, "info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,13 @@
|
||||
* Discover, filter, merge, or replace them.
|
||||
*/
|
||||
|
||||
import { createAgentSession, DefaultResourceLoader, SessionManager, type Skill } from "@mariozechner/pi-coding-agent";
|
||||
import {
|
||||
createAgentSession,
|
||||
createSyntheticSourceInfo,
|
||||
DefaultResourceLoader,
|
||||
SessionManager,
|
||||
type Skill,
|
||||
} from "@mariozechner/pi-coding-agent";
|
||||
|
||||
// Or define custom skills inline
|
||||
const customSkill: Skill = {
|
||||
@@ -13,7 +19,7 @@ const customSkill: Skill = {
|
||||
description: "Custom project instructions",
|
||||
filePath: "/virtual/SKILL.md",
|
||||
baseDir: "/virtual",
|
||||
source: "path",
|
||||
sourceInfo: createSyntheticSourceInfo("/virtual/SKILL.md", { source: "sdk" }),
|
||||
disableModelInvocation: false,
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
import {
|
||||
createAgentSession,
|
||||
createSyntheticSourceInfo,
|
||||
DefaultResourceLoader,
|
||||
type PromptTemplate,
|
||||
SessionManager,
|
||||
@@ -15,8 +16,8 @@ import {
|
||||
const deployTemplate: PromptTemplate = {
|
||||
name: "deploy",
|
||||
description: "Deploy the application",
|
||||
source: "path",
|
||||
filePath: "/virtual/prompts/deploy.md",
|
||||
sourceInfo: createSyntheticSourceInfo("/virtual/prompts/deploy.md", { source: "sdk" }),
|
||||
content: `# Deploy Instructions
|
||||
|
||||
1. Build: npm run build
|
||||
|
||||
Reference in New Issue
Block a user