@lmzhen/dsh-evolution-plan-validator 0.1.0-rc.27 → 0.1.0-rc.29
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/lib/index.js +3 -1
- package/lib/types/index.d.ts +2 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -116,7 +116,9 @@ function validateSkillOp(op, context, index) {
|
|
|
116
116
|
if (!SKILL_ACTIONS.has(action)) return `skill op ${index}: unknown action ${action}`;
|
|
117
117
|
if ((action === "create" || action === "edit" || action === "update") && !(op.content ?? "").trim()) return `skill op ${index}: ${action} requires content`;
|
|
118
118
|
if (action === "patch" && !(op.old_string ?? "")) return `skill op ${index}: patch requires old_string`;
|
|
119
|
-
|
|
119
|
+
const writeContent = op.file_content ?? op.content ?? "";
|
|
120
|
+
if (action === "write_file" && !writeContent.trim()) return `skill op ${index}: write_file requires file_content`;
|
|
121
|
+
if (writeContent.length > (context.maxSkillContentChars ?? 1e5)) return `skill op ${index}: content exceeds skill budget`;
|
|
120
122
|
return null;
|
|
121
123
|
}
|
|
122
124
|
//#endregion
|
package/lib/types/index.d.ts
CHANGED
package/package.json
CHANGED