@mistralys/persona-builder 2.4.1 → 2.5.1
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 +7 -4
- package/dist/cli.cjs +19 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +19 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +20 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ See the [CLI docs](docs/cli.md) for config file format and all flags.
|
|
|
73
73
|
| [Getting Started](docs/getting-started.md) | Step-by-step tutorial — build your first persona from scratch |
|
|
74
74
|
| [Directory Convention](docs/directory-convention.md) | Expected source layout (`meta/`, `content/`, `partials/`) |
|
|
75
75
|
| [Template Syntax](docs/template-syntax.md) | Variables, partials, conditionals, and built-in context variables |
|
|
76
|
+
| [Target Differences](docs/target-differences.md) | VS Code vs Claude Code — tool notation, frontmatter, filename conventions, and common mistakes |
|
|
76
77
|
| [Custom Variables & Dynamic Partials](docs/dynamic-partials.md) | Inject build-time variables and partial content at global, suite, or per-persona level |
|
|
77
78
|
| [Plugins](docs/plugins.md) | `PersonaBuildPlugin` interface and examples |
|
|
78
79
|
|
|
@@ -107,7 +108,9 @@ MIT
|
|
|
107
108
|
## Release Workflow
|
|
108
109
|
|
|
109
110
|
1. Add changelog entries (do not change package.json version)
|
|
110
|
-
2.
|
|
111
|
-
3. `npm
|
|
112
|
-
4. `
|
|
113
|
-
5.
|
|
111
|
+
2. Commit all changes.
|
|
112
|
+
3. `npm run build`.
|
|
113
|
+
4. `npm version 0.0.0` - Updates package and lock versions + commit
|
|
114
|
+
5. `npm publish` - Publish version on NPM
|
|
115
|
+
6. `git push origin 0.0.0` - Add the tag in GIT
|
|
116
|
+
7. Add the release on Github
|
package/dist/cli.cjs
CHANGED
|
@@ -73,7 +73,10 @@ function resolveConditionals(text, context) {
|
|
|
73
73
|
|
|
74
74
|
// src/engine/variables.ts
|
|
75
75
|
function resolveVariables(text, context, filename) {
|
|
76
|
-
return text.replace(
|
|
76
|
+
return text.replace(/(\\?)\{\{(\w+)\}\}/g, (match, escape, varName) => {
|
|
77
|
+
if (escape === "\\") {
|
|
78
|
+
return `{{${varName}}}`;
|
|
79
|
+
}
|
|
77
80
|
if (varName in context && context[varName] !== void 0) {
|
|
78
81
|
return String(context[varName]);
|
|
79
82
|
}
|
|
@@ -103,6 +106,10 @@ function serializeTools(tools) {
|
|
|
103
106
|
function serializeToolsList(tools) {
|
|
104
107
|
return tools.map((t) => `'${t}'`).join(", ");
|
|
105
108
|
}
|
|
109
|
+
function serializeToolsBlock(tools) {
|
|
110
|
+
if (tools.length === 0) return " []";
|
|
111
|
+
return "\n" + tools.map((t) => ` - ${t}`).join("\n");
|
|
112
|
+
}
|
|
106
113
|
async function loadPartials(dir) {
|
|
107
114
|
const entries = await promises.readdir(dir, { withFileTypes: true });
|
|
108
115
|
const mdFiles = entries.filter(
|
|
@@ -185,10 +192,10 @@ tools: [{{tools_list}}]
|
|
|
185
192
|
---`;
|
|
186
193
|
var DEFAULT_FRONTMATTER_CLAUDE_CODE = `---
|
|
187
194
|
name: {{cc_file_name_stem}}
|
|
188
|
-
|
|
195
|
+
description: {{description}}
|
|
189
196
|
model: {{cc_model}}
|
|
190
197
|
memory: {{cc_memory}}
|
|
191
|
-
|
|
198
|
+
tools:{{cc_tools_block}}
|
|
192
199
|
---`;
|
|
193
200
|
var DEFAULT_FRONTMATTER_DEEP_AGENTS = `---
|
|
194
201
|
name: {{name}}
|
|
@@ -417,6 +424,12 @@ function buildContext(options) {
|
|
|
417
424
|
if (!("cc_tools_json" in merged)) {
|
|
418
425
|
merged["cc_tools_json"] = serializeTools(ccTools);
|
|
419
426
|
}
|
|
427
|
+
if (!("tools_block" in merged)) {
|
|
428
|
+
merged["tools_block"] = serializeToolsBlock(tools);
|
|
429
|
+
}
|
|
430
|
+
if (!("cc_tools_block" in merged)) {
|
|
431
|
+
merged["cc_tools_block"] = serializeToolsBlock(ccTools);
|
|
432
|
+
}
|
|
420
433
|
if (!("cc_file_name_stem" in merged) && typeof merged["cc_file_name"] === "string") {
|
|
421
434
|
const ccFileName = merged["cc_file_name"];
|
|
422
435
|
merged["cc_file_name_stem"] = ccFileName.replace(/\.md$/, "");
|
|
@@ -433,6 +446,9 @@ function buildContext(options) {
|
|
|
433
446
|
if (!("da_tools_json" in merged)) {
|
|
434
447
|
merged["da_tools_json"] = serializeTools(daTools);
|
|
435
448
|
}
|
|
449
|
+
if (!("da_tools_block" in merged)) {
|
|
450
|
+
merged["da_tools_block"] = serializeToolsBlock(daTools);
|
|
451
|
+
}
|
|
436
452
|
}
|
|
437
453
|
for (const [key, value] of Object.entries(agentMap)) {
|
|
438
454
|
if (!(key in merged)) {
|