@moskala/oneagent-templates 0.2.4 → 0.2.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moskala/oneagent-templates",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Built-in templates for oneagent",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"typecheck": "tsc --noEmit"
|
|
17
17
|
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@moskala/oneagent-core": "0.2.5"
|
|
20
|
+
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"@types/bun": "latest",
|
|
20
23
|
"typescript": "^5"
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import fs from "fs/promises";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
|
+
import { type TemplatePlugin, type TemplateDefinition, parsePluginsFromYaml } from "@moskala/oneagent-core";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
export type { TemplatePlugin, TemplateDefinition };
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
skills: string[];
|
|
11
|
-
instructions: string;
|
|
12
|
-
rules: Array<{ name: string; content: string }>;
|
|
13
|
-
}
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
9
|
|
|
15
10
|
type BuiltinTemplateName = "default" | "react" | "react-native";
|
|
16
11
|
|
|
@@ -38,6 +33,8 @@ async function loadTemplate(name: BuiltinTemplateName): Promise<TemplateDefiniti
|
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
|
|
36
|
+
const plugins = parsePluginsFromYaml(yamlText);
|
|
37
|
+
|
|
41
38
|
const rulesDir = path.join(templateDir, "rules");
|
|
42
39
|
let rules: Array<{ name: string; content: string }> = [];
|
|
43
40
|
try {
|
|
@@ -54,7 +51,7 @@ async function loadTemplate(name: BuiltinTemplateName): Promise<TemplateDefiniti
|
|
|
54
51
|
// No rules directory — fine
|
|
55
52
|
}
|
|
56
53
|
|
|
57
|
-
return { name, description, skills, instructions, rules };
|
|
54
|
+
return { name, description, skills, plugins, instructions, rules };
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
export async function resolveBuiltinTemplate(name: string): Promise<TemplateDefinition | null> {
|