@henryqw/pi-add-dir 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,7 @@ export interface AddedDir {
|
|
|
11
11
|
export interface DirContext {
|
|
12
12
|
agentsMd: string | null;
|
|
13
13
|
claudeMd: string | null;
|
|
14
|
-
skills:
|
|
14
|
+
skills: string[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const CONTEXT_FILES = ["AGENTS.md", "CLAUDE.md"] as const;
|
|
@@ -95,7 +95,7 @@ export function scanDirContext(dir: string): DirContext {
|
|
|
95
95
|
return {
|
|
96
96
|
agentsMd: readContextFile(dir, "AGENTS.md"),
|
|
97
97
|
claudeMd: readContextFile(dir, "CLAUDE.md"),
|
|
98
|
-
skills:
|
|
98
|
+
skills: skillFiles(dir).map(({ name }) => name),
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
|
package/extensions/add-dir.ts
CHANGED
|
@@ -147,20 +147,11 @@ function overlaps(a: string, b: string): boolean {
|
|
|
147
147
|
return isWithinDir(a, b) || isWithinDir(b, a);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
function contextDetails(dirCtx: DirContext, absolutePath: string): AddDirectoryDetails {
|
|
151
|
-
return {
|
|
152
|
-
directory: absolutePath,
|
|
153
|
-
hasAgentsMd: dirCtx.agentsMd !== null,
|
|
154
|
-
hasClaudeMd: dirCtx.claudeMd !== null,
|
|
155
|
-
skillNames: [...dirCtx.skills],
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
150
|
function contextSummary(dirCtx: DirContext): string {
|
|
160
151
|
const found: string[] = [];
|
|
161
152
|
if (dirCtx.agentsMd !== null) found.push("AGENTS.md");
|
|
162
153
|
if (dirCtx.claudeMd !== null) found.push("CLAUDE.md");
|
|
163
|
-
if (dirCtx.skills.
|
|
154
|
+
if (dirCtx.skills.length > 0) found.push(`${dirCtx.skills.length} skill(s)`);
|
|
164
155
|
return found.length > 0 ? ` Found: ${found.join(", ")}.` : " No context files found.";
|
|
165
156
|
}
|
|
166
157
|
|
|
@@ -613,15 +604,20 @@ export default function addDirExtension(pi: ExtensionAPI, options: ExtensionOpti
|
|
|
613
604
|
if (context.claudeMd !== null) {
|
|
614
605
|
response.push(`\nCLAUDE.md instructions from ${absolutePath}:\n${context.claudeMd}`);
|
|
615
606
|
}
|
|
616
|
-
if (context.skills.
|
|
617
|
-
response.push(`\nDiscovered skills: ${
|
|
607
|
+
if (context.skills.length > 0) {
|
|
608
|
+
response.push(`\nDiscovered skills: ${context.skills.join(", ")}`);
|
|
618
609
|
}
|
|
619
610
|
if (result.resourcesChanged) response.push("Run /reload to update external skills.");
|
|
620
611
|
response.push(`\nYou can now access files at: ${absolutePath}`);
|
|
621
612
|
|
|
622
613
|
return {
|
|
623
614
|
content: [{ type: "text", text: response.join("\n") }],
|
|
624
|
-
details:
|
|
615
|
+
details: {
|
|
616
|
+
directory: absolutePath,
|
|
617
|
+
hasAgentsMd: context.agentsMd !== null,
|
|
618
|
+
hasClaudeMd: context.claudeMd !== null,
|
|
619
|
+
skillNames: context.skills,
|
|
620
|
+
} satisfies AddDirectoryDetails,
|
|
625
621
|
};
|
|
626
622
|
},
|
|
627
623
|
|