open-agents-ai 0.101.5 → 0.101.6
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/dist/index.js +49 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5952,35 +5952,35 @@ function discoverSkills(repoRoot) {
|
|
|
5952
5952
|
if (pkgRoot) {
|
|
5953
5953
|
const pkgFrameworks = join14(pkgRoot, "agentic", "code", "frameworks");
|
|
5954
5954
|
if (existsSync11(pkgFrameworks)) {
|
|
5955
|
-
for (const fw of safeReaddir(pkgFrameworks)) {
|
|
5955
|
+
for (const fw of safeReaddir(pkgFrameworks, true)) {
|
|
5956
5956
|
loadComponent(join14(pkgFrameworks, fw), `framework:${fw}`);
|
|
5957
5957
|
}
|
|
5958
5958
|
}
|
|
5959
5959
|
const pkgAddons = join14(pkgRoot, "agentic", "code", "addons");
|
|
5960
5960
|
if (existsSync11(pkgAddons)) {
|
|
5961
|
-
for (const addon of safeReaddir(pkgAddons)) {
|
|
5961
|
+
for (const addon of safeReaddir(pkgAddons, true)) {
|
|
5962
5962
|
loadComponent(join14(pkgAddons, addon), `addon:${addon}`);
|
|
5963
5963
|
}
|
|
5964
5964
|
}
|
|
5965
5965
|
const pkgPlugins = join14(pkgRoot, "plugins");
|
|
5966
5966
|
if (existsSync11(pkgPlugins)) {
|
|
5967
|
-
for (const plugin of safeReaddir(pkgPlugins)) {
|
|
5967
|
+
for (const plugin of safeReaddir(pkgPlugins, true)) {
|
|
5968
5968
|
loadComponent(join14(pkgPlugins, plugin), `plugin:${plugin}`);
|
|
5969
5969
|
}
|
|
5970
5970
|
}
|
|
5971
5971
|
}
|
|
5972
5972
|
if (existsSync11(frameworksDir)) {
|
|
5973
|
-
for (const framework of safeReaddir(frameworksDir)) {
|
|
5973
|
+
for (const framework of safeReaddir(frameworksDir, true)) {
|
|
5974
5974
|
loadComponent(join14(frameworksDir, framework), `framework:${framework}`);
|
|
5975
5975
|
}
|
|
5976
5976
|
}
|
|
5977
5977
|
if (existsSync11(addonsDir)) {
|
|
5978
|
-
for (const addon of safeReaddir(addonsDir)) {
|
|
5978
|
+
for (const addon of safeReaddir(addonsDir, true)) {
|
|
5979
5979
|
loadComponent(join14(addonsDir, addon), `addon:${addon}`);
|
|
5980
5980
|
}
|
|
5981
5981
|
}
|
|
5982
5982
|
if (existsSync11(pluginsDir)) {
|
|
5983
|
-
for (const plugin of safeReaddir(pluginsDir)) {
|
|
5983
|
+
for (const plugin of safeReaddir(pluginsDir, true)) {
|
|
5984
5984
|
loadComponent(join14(pluginsDir, plugin), `plugin:${plugin}`);
|
|
5985
5985
|
}
|
|
5986
5986
|
}
|
|
@@ -6025,9 +6025,10 @@ function buildSkillsSummary(skills) {
|
|
|
6025
6025
|
lines.push("Use `skill_execute` with a skill name to load its full instructions when a task matches a trigger pattern.");
|
|
6026
6026
|
return lines.join("\n");
|
|
6027
6027
|
}
|
|
6028
|
-
function safeReaddir(dir) {
|
|
6028
|
+
function safeReaddir(dir, dirsOnly = false) {
|
|
6029
6029
|
try {
|
|
6030
|
-
|
|
6030
|
+
const entries = readdirSync5(dir, { withFileTypes: true });
|
|
6031
|
+
return dirsOnly ? entries.filter((d) => d.isDirectory()).map((d) => d.name) : entries.map((d) => d.name);
|
|
6031
6032
|
} catch {
|
|
6032
6033
|
return [];
|
|
6033
6034
|
}
|
|
@@ -6039,18 +6040,34 @@ function loadSkillsFromDir(dir, source, out) {
|
|
|
6039
6040
|
const entries = safeReaddir(dir);
|
|
6040
6041
|
for (const entry of entries) {
|
|
6041
6042
|
const skillMd = join14(dir, entry, "SKILL.md");
|
|
6042
|
-
if (
|
|
6043
|
+
if (existsSync11(skillMd)) {
|
|
6044
|
+
const manifestEntry = manifest.get(entry);
|
|
6045
|
+
const info = {
|
|
6046
|
+
name: entry,
|
|
6047
|
+
description: manifestEntry?.description ?? parseDescription(skillMd),
|
|
6048
|
+
triggers: manifestEntry?.triggers ?? parseTriggers(skillMd),
|
|
6049
|
+
source,
|
|
6050
|
+
filePath: skillMd,
|
|
6051
|
+
compactionStrategy: parseCompactionStrategy(skillMd)
|
|
6052
|
+
};
|
|
6053
|
+
out.set(entry, info);
|
|
6043
6054
|
continue;
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6055
|
+
}
|
|
6056
|
+
if (entry.endsWith(".md") && entry !== "manifest.json") {
|
|
6057
|
+
const flatPath = join14(dir, entry);
|
|
6058
|
+
const name = entry.replace(/\.md$/, "");
|
|
6059
|
+
if (out.has(name))
|
|
6060
|
+
continue;
|
|
6061
|
+
const info = {
|
|
6062
|
+
name,
|
|
6063
|
+
description: parseDescription(flatPath),
|
|
6064
|
+
triggers: parseTriggers(flatPath),
|
|
6065
|
+
source,
|
|
6066
|
+
filePath: flatPath,
|
|
6067
|
+
compactionStrategy: parseCompactionStrategy(flatPath)
|
|
6068
|
+
};
|
|
6069
|
+
out.set(name, info);
|
|
6070
|
+
}
|
|
6054
6071
|
}
|
|
6055
6072
|
}
|
|
6056
6073
|
function loadCommandsFromDir(dir, source, out) {
|
|
@@ -17626,10 +17643,19 @@ Take a DIFFERENT action now.`
|
|
|
17626
17643
|
});
|
|
17627
17644
|
break;
|
|
17628
17645
|
}
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17646
|
+
const narratedToolPattern = /(?:```(?:bash|json)?\s*\n?)?\b(file_read|file_write|file_edit|shell|skill_execute|skill_list|skill_build|grep_search|find_files|web_search|web_fetch|task_complete|memory_read|memory_write)\b[(\s]/;
|
|
17647
|
+
const narratedMatch = content.match(narratedToolPattern);
|
|
17648
|
+
if (narratedMatch) {
|
|
17649
|
+
messages.push({
|
|
17650
|
+
role: "user",
|
|
17651
|
+
content: `You wrote "${narratedMatch[1]}" as text but did NOT actually call the tool. Do NOT write tool names as text or code blocks. Instead, invoke the tool directly through the function calling interface. Try again \u2014 call ${narratedMatch[1]}() as an actual tool call.`
|
|
17652
|
+
});
|
|
17653
|
+
} else {
|
|
17654
|
+
messages.push({
|
|
17655
|
+
role: "user",
|
|
17656
|
+
content: "Continue working. Use tools to read files, make changes, and run validation. Call task_complete when done."
|
|
17657
|
+
});
|
|
17658
|
+
}
|
|
17633
17659
|
}
|
|
17634
17660
|
}
|
|
17635
17661
|
let prevCycleToolCalls = toolCallCount;
|
package/package.json
CHANGED