@caupulican/pi-adaptative 0.80.90 → 0.80.93
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.
- package/CHANGELOG.md +33 -0
- package/dist/core/agent-session.d.ts +18 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +134 -35
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +15 -5
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/context/brain-curator.d.ts +21 -0
- package/dist/core/context/brain-curator.d.ts.map +1 -1
- package/dist/core/context/brain-curator.js +66 -0
- package/dist/core/context/brain-curator.js.map +1 -1
- package/dist/core/context/context-composition.d.ts +2 -0
- package/dist/core/context/context-composition.d.ts.map +1 -1
- package/dist/core/context/context-composition.js +1 -1
- package/dist/core/context/context-composition.js.map +1 -1
- package/dist/core/profile-resource-selection.d.ts.map +1 -1
- package/dist/core/profile-resource-selection.js +19 -6
- package/dist/core/profile-resource-selection.js.map +1 -1
- package/dist/core/resource-loader.d.ts +22 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +54 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +8 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +25 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/interactive/components/profile-resource-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/profile-resource-editor.js +11 -4
- package/dist/modes/interactive/components/profile-resource-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +65 -14
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/12-full-control.ts +4 -0
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -5844,10 +5844,67 @@ export class InteractiveMode {
|
|
|
5844
5844
|
const loader = this.session.resourceLoader;
|
|
5845
5845
|
const base = (p) => p.split(/[\\/]/).pop() ?? p;
|
|
5846
5846
|
const allDiscoverableExtensions = await loader.getDiscoverableExtensionPaths();
|
|
5847
|
-
|
|
5848
|
-
|
|
5847
|
+
// The editor's universe must be profile-INDEPENDENT (discovery, not loading): the loaded
|
|
5848
|
+
// getters are narrowed by the active profile, so building the lists from them makes
|
|
5849
|
+
// currently-blocked skills/prompts/context files ungrantable — including expanding the
|
|
5850
|
+
// very profile you are running under. Union the loaded (rich metadata) sets with the
|
|
5851
|
+
// full pre-filter discovery paths.
|
|
5852
|
+
const loadedSkills = loader.getSkills().skills;
|
|
5853
|
+
const loadedSkillPaths = new Set(loadedSkills.map((skill) => skill.filePath));
|
|
5854
|
+
const skillIdFromPath = (skillPath) => {
|
|
5855
|
+
const parts = skillPath.split(/[\\/]/);
|
|
5856
|
+
const last = parts.pop() ?? skillPath;
|
|
5857
|
+
if (/^skill\.md$/i.test(last))
|
|
5858
|
+
return parts.pop() ?? last;
|
|
5859
|
+
return last.replace(/\.md$/i, "");
|
|
5860
|
+
};
|
|
5861
|
+
const skills = [
|
|
5862
|
+
...loadedSkills.map((skill) => ({ id: skill.name, path: skill.filePath, description: skill.description })),
|
|
5863
|
+
...loader
|
|
5864
|
+
.getDiscoverableSkillPaths()
|
|
5865
|
+
.filter((skillPath) => !loadedSkillPaths.has(skillPath))
|
|
5866
|
+
.map((skillPath) => ({
|
|
5867
|
+
id: skillIdFromPath(skillPath),
|
|
5868
|
+
path: skillPath,
|
|
5869
|
+
description: getFrontmatterDescription(skillPath),
|
|
5870
|
+
})),
|
|
5871
|
+
];
|
|
5872
|
+
const loadedPrompts = loader.getPrompts().prompts;
|
|
5873
|
+
const loadedPromptPaths = new Set(loadedPrompts.map((prompt) => prompt.filePath));
|
|
5874
|
+
const prompts = [
|
|
5875
|
+
...loadedPrompts.map((prompt) => ({
|
|
5876
|
+
id: prompt.name,
|
|
5877
|
+
path: prompt.filePath,
|
|
5878
|
+
description: prompt.description,
|
|
5879
|
+
})),
|
|
5880
|
+
...loader
|
|
5881
|
+
.getDiscoverablePromptPaths()
|
|
5882
|
+
.filter((promptPath) => !loadedPromptPaths.has(promptPath))
|
|
5883
|
+
.map((promptPath) => ({
|
|
5884
|
+
id: (promptPath.split(/[\\/]/).pop() ?? promptPath).replace(/\.md$/i, ""),
|
|
5885
|
+
path: promptPath,
|
|
5886
|
+
description: getFrontmatterDescription(promptPath),
|
|
5887
|
+
})),
|
|
5888
|
+
];
|
|
5849
5889
|
const themes = getAvailableThemesWithPaths();
|
|
5850
|
-
const
|
|
5890
|
+
const loadedAgentPaths = new Set(loader.getAgentsFiles().agentsFiles.map((file) => file.path));
|
|
5891
|
+
const agents = [
|
|
5892
|
+
...loader.getAgentsFiles().agentsFiles.map((file) => ({ path: file.path })),
|
|
5893
|
+
...loader
|
|
5894
|
+
.getDiscoverableAgentsFilePaths()
|
|
5895
|
+
.filter((agentPath) => !loadedAgentPaths.has(agentPath))
|
|
5896
|
+
.map((agentPath) => ({ path: agentPath })),
|
|
5897
|
+
];
|
|
5898
|
+
const getFrontmatterDescription = (filePath) => {
|
|
5899
|
+
try {
|
|
5900
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
5901
|
+
const { frontmatter } = parseFrontmatter(content);
|
|
5902
|
+
if (typeof frontmatter.description === "string")
|
|
5903
|
+
return frontmatter.description;
|
|
5904
|
+
}
|
|
5905
|
+
catch { }
|
|
5906
|
+
return undefined;
|
|
5907
|
+
};
|
|
5851
5908
|
const getAgentDescription = (filePath) => {
|
|
5852
5909
|
try {
|
|
5853
5910
|
const content = fs.readFileSync(filePath, "utf-8");
|
|
@@ -5880,16 +5937,14 @@ export class InteractiveMode {
|
|
|
5880
5937
|
{
|
|
5881
5938
|
kind: "tools",
|
|
5882
5939
|
label: "Tools",
|
|
5883
|
-
|
|
5940
|
+
// Built-ins plus every currently registered tool (extension tools included), so
|
|
5941
|
+
// an extension tool can be granted by name without hand-editing settings JSON.
|
|
5942
|
+
items: [...new Set([...allToolNames, ...this.session.getAllTools().map((tool) => tool.name)])].map((name) => ({ id: name })),
|
|
5884
5943
|
},
|
|
5885
5944
|
{
|
|
5886
5945
|
kind: "skills",
|
|
5887
5946
|
label: "Skills",
|
|
5888
|
-
items: skills
|
|
5889
|
-
id: s.name,
|
|
5890
|
-
path: s.filePath,
|
|
5891
|
-
description: s.description,
|
|
5892
|
-
})),
|
|
5947
|
+
items: skills,
|
|
5893
5948
|
},
|
|
5894
5949
|
{
|
|
5895
5950
|
kind: "extensions",
|
|
@@ -5912,11 +5967,7 @@ export class InteractiveMode {
|
|
|
5912
5967
|
{
|
|
5913
5968
|
kind: "prompts",
|
|
5914
5969
|
label: "Prompts",
|
|
5915
|
-
items: prompts
|
|
5916
|
-
id: p.name,
|
|
5917
|
-
path: p.filePath,
|
|
5918
|
-
description: p.description,
|
|
5919
|
-
})),
|
|
5970
|
+
items: prompts,
|
|
5920
5971
|
},
|
|
5921
5972
|
{
|
|
5922
5973
|
kind: "themes",
|