@mistralys/persona-builder 2.4.1 → 2.5.0
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/README.md +1 -0
- package/dist/cli.cjs +15 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +15 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +16 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,6 +103,10 @@ function serializeTools(tools) {
|
|
|
103
103
|
function serializeToolsList(tools) {
|
|
104
104
|
return tools.map((t) => `'${t}'`).join(", ");
|
|
105
105
|
}
|
|
106
|
+
function serializeToolsBlock(tools) {
|
|
107
|
+
if (tools.length === 0) return " []";
|
|
108
|
+
return "\n" + tools.map((t) => ` - ${t}`).join("\n");
|
|
109
|
+
}
|
|
106
110
|
async function loadPartials(dir) {
|
|
107
111
|
const entries = await promises.readdir(dir, { withFileTypes: true });
|
|
108
112
|
const mdFiles = entries.filter(
|
|
@@ -211,10 +215,10 @@ tools: [{{tools_list}}]
|
|
|
211
215
|
---`;
|
|
212
216
|
var DEFAULT_FRONTMATTER_CLAUDE_CODE = `---
|
|
213
217
|
name: {{cc_file_name_stem}}
|
|
214
|
-
|
|
218
|
+
description: {{description}}
|
|
215
219
|
model: {{cc_model}}
|
|
216
220
|
memory: {{cc_memory}}
|
|
217
|
-
|
|
221
|
+
tools:{{cc_tools_block}}
|
|
218
222
|
---`;
|
|
219
223
|
var DEFAULT_FRONTMATTER_DEEP_AGENTS = `---
|
|
220
224
|
name: {{name}}
|
|
@@ -443,6 +447,12 @@ function buildContext(options) {
|
|
|
443
447
|
if (!("cc_tools_json" in merged)) {
|
|
444
448
|
merged["cc_tools_json"] = serializeTools(ccTools);
|
|
445
449
|
}
|
|
450
|
+
if (!("tools_block" in merged)) {
|
|
451
|
+
merged["tools_block"] = serializeToolsBlock(tools);
|
|
452
|
+
}
|
|
453
|
+
if (!("cc_tools_block" in merged)) {
|
|
454
|
+
merged["cc_tools_block"] = serializeToolsBlock(ccTools);
|
|
455
|
+
}
|
|
446
456
|
if (!("cc_file_name_stem" in merged) && typeof merged["cc_file_name"] === "string") {
|
|
447
457
|
const ccFileName = merged["cc_file_name"];
|
|
448
458
|
merged["cc_file_name_stem"] = ccFileName.replace(/\.md$/, "");
|
|
@@ -459,6 +469,9 @@ function buildContext(options) {
|
|
|
459
469
|
if (!("da_tools_json" in merged)) {
|
|
460
470
|
merged["da_tools_json"] = serializeTools(daTools);
|
|
461
471
|
}
|
|
472
|
+
if (!("da_tools_block" in merged)) {
|
|
473
|
+
merged["da_tools_block"] = serializeToolsBlock(daTools);
|
|
474
|
+
}
|
|
462
475
|
}
|
|
463
476
|
for (const [key, value] of Object.entries(agentMap)) {
|
|
464
477
|
if (!(key in merged)) {
|
|
@@ -718,6 +731,7 @@ exports.runPostRender = runPostRender;
|
|
|
718
731
|
exports.runSuiteInit = runSuiteInit;
|
|
719
732
|
exports.runValidate = runValidate;
|
|
720
733
|
exports.serializeTools = serializeTools;
|
|
734
|
+
exports.serializeToolsBlock = serializeToolsBlock;
|
|
721
735
|
exports.serializeToolsList = serializeToolsList;
|
|
722
736
|
exports.validateFileName = validateFileName;
|
|
723
737
|
exports.validateStrictMarkers = validateStrictMarkers;
|