clawsouls 0.2.9 → 0.3.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 +1 -1
- package/dist/bin/clawsouls.js +3 -3
- package/dist/bin/clawsouls.js.map +1 -1
- package/dist/commands/init.js +65 -97
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.js +19 -42
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/publish.d.ts +3 -1
- package/dist/commands/publish.js +52 -51
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/validate.d.ts +1 -3
- package/dist/commands/validate.js +58 -218
- package/dist/commands/validate.js.map +1 -1
- package/dist/storage/local.d.ts +1 -2
- package/dist/storage/local.js.map +1 -1
- package/dist/storage/manager.js.map +1 -1
- package/package.json +2 -4
- package/dist/registry/client.d.ts +0 -24
- package/dist/registry/client.js +0 -143
- package/dist/registry/client.js.map +0 -1
- package/dist/utils/validate.d.ts +0 -174
- package/dist/utils/validate.js +0 -71
- package/dist/utils/validate.js.map +0 -1
package/dist/utils/validate.d.ts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const ClawSoulSchemaV01: z.ZodObject<{
|
|
3
|
-
name: z.ZodString;
|
|
4
|
-
displayName: z.ZodString;
|
|
5
|
-
version: z.ZodString;
|
|
6
|
-
description: z.ZodString;
|
|
7
|
-
author: z.ZodObject<{
|
|
8
|
-
name: z.ZodString;
|
|
9
|
-
github: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
license: z.ZodString;
|
|
12
|
-
tags: z.ZodArray<z.ZodString>;
|
|
13
|
-
category: z.ZodString;
|
|
14
|
-
compatibility: z.ZodOptional<z.ZodObject<{
|
|
15
|
-
openclaw: z.ZodOptional<z.ZodString>;
|
|
16
|
-
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
-
}, z.core.$strip>>;
|
|
18
|
-
files: z.ZodObject<{
|
|
19
|
-
soul: z.ZodString;
|
|
20
|
-
identity: z.ZodOptional<z.ZodString>;
|
|
21
|
-
agents: z.ZodOptional<z.ZodString>;
|
|
22
|
-
heartbeat: z.ZodOptional<z.ZodString>;
|
|
23
|
-
userTemplate: z.ZodOptional<z.ZodString>;
|
|
24
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
repository: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
export declare const ClawSoulSchemaV02: z.ZodObject<{
|
|
29
|
-
name: z.ZodString;
|
|
30
|
-
displayName: z.ZodString;
|
|
31
|
-
version: z.ZodString;
|
|
32
|
-
description: z.ZodString;
|
|
33
|
-
author: z.ZodObject<{
|
|
34
|
-
name: z.ZodString;
|
|
35
|
-
github: z.ZodOptional<z.ZodString>;
|
|
36
|
-
}, z.core.$strip>;
|
|
37
|
-
license: z.ZodString;
|
|
38
|
-
tags: z.ZodArray<z.ZodString>;
|
|
39
|
-
category: z.ZodString;
|
|
40
|
-
compatibility: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
openclaw: z.ZodOptional<z.ZodString>;
|
|
42
|
-
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
repository: z.ZodOptional<z.ZodString>;
|
|
45
|
-
files: z.ZodObject<{
|
|
46
|
-
soul: z.ZodString;
|
|
47
|
-
identity: z.ZodOptional<z.ZodString>;
|
|
48
|
-
agents: z.ZodOptional<z.ZodString>;
|
|
49
|
-
heartbeat: z.ZodOptional<z.ZodString>;
|
|
50
|
-
style: z.ZodOptional<z.ZodString>;
|
|
51
|
-
userTemplate: z.ZodOptional<z.ZodString>;
|
|
52
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
examples: z.ZodOptional<z.ZodObject<{
|
|
55
|
-
good: z.ZodOptional<z.ZodString>;
|
|
56
|
-
bad: z.ZodOptional<z.ZodString>;
|
|
57
|
-
}, z.core.$strip>>;
|
|
58
|
-
modes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
-
interpolation: z.ZodOptional<z.ZodEnum<{
|
|
60
|
-
bold: "bold";
|
|
61
|
-
cautious: "cautious";
|
|
62
|
-
strict: "strict";
|
|
63
|
-
}>>;
|
|
64
|
-
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
-
}, z.core.$strip>;
|
|
66
|
-
export declare const SPEC_VERSIONS: {
|
|
67
|
-
readonly '0.1': z.ZodObject<{
|
|
68
|
-
name: z.ZodString;
|
|
69
|
-
displayName: z.ZodString;
|
|
70
|
-
version: z.ZodString;
|
|
71
|
-
description: z.ZodString;
|
|
72
|
-
author: z.ZodObject<{
|
|
73
|
-
name: z.ZodString;
|
|
74
|
-
github: z.ZodOptional<z.ZodString>;
|
|
75
|
-
}, z.core.$strip>;
|
|
76
|
-
license: z.ZodString;
|
|
77
|
-
tags: z.ZodArray<z.ZodString>;
|
|
78
|
-
category: z.ZodString;
|
|
79
|
-
compatibility: z.ZodOptional<z.ZodObject<{
|
|
80
|
-
openclaw: z.ZodOptional<z.ZodString>;
|
|
81
|
-
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
}, z.core.$strip>>;
|
|
83
|
-
files: z.ZodObject<{
|
|
84
|
-
soul: z.ZodString;
|
|
85
|
-
identity: z.ZodOptional<z.ZodString>;
|
|
86
|
-
agents: z.ZodOptional<z.ZodString>;
|
|
87
|
-
heartbeat: z.ZodOptional<z.ZodString>;
|
|
88
|
-
userTemplate: z.ZodOptional<z.ZodString>;
|
|
89
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
repository: z.ZodOptional<z.ZodString>;
|
|
92
|
-
}, z.core.$strip>;
|
|
93
|
-
readonly '0.2': z.ZodObject<{
|
|
94
|
-
name: z.ZodString;
|
|
95
|
-
displayName: z.ZodString;
|
|
96
|
-
version: z.ZodString;
|
|
97
|
-
description: z.ZodString;
|
|
98
|
-
author: z.ZodObject<{
|
|
99
|
-
name: z.ZodString;
|
|
100
|
-
github: z.ZodOptional<z.ZodString>;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
|
-
license: z.ZodString;
|
|
103
|
-
tags: z.ZodArray<z.ZodString>;
|
|
104
|
-
category: z.ZodString;
|
|
105
|
-
compatibility: z.ZodOptional<z.ZodObject<{
|
|
106
|
-
openclaw: z.ZodOptional<z.ZodString>;
|
|
107
|
-
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
108
|
-
}, z.core.$strip>>;
|
|
109
|
-
repository: z.ZodOptional<z.ZodString>;
|
|
110
|
-
files: z.ZodObject<{
|
|
111
|
-
soul: z.ZodString;
|
|
112
|
-
identity: z.ZodOptional<z.ZodString>;
|
|
113
|
-
agents: z.ZodOptional<z.ZodString>;
|
|
114
|
-
heartbeat: z.ZodOptional<z.ZodString>;
|
|
115
|
-
style: z.ZodOptional<z.ZodString>;
|
|
116
|
-
userTemplate: z.ZodOptional<z.ZodString>;
|
|
117
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
118
|
-
}, z.core.$strip>;
|
|
119
|
-
examples: z.ZodOptional<z.ZodObject<{
|
|
120
|
-
good: z.ZodOptional<z.ZodString>;
|
|
121
|
-
bad: z.ZodOptional<z.ZodString>;
|
|
122
|
-
}, z.core.$strip>>;
|
|
123
|
-
modes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
|
-
interpolation: z.ZodOptional<z.ZodEnum<{
|
|
125
|
-
bold: "bold";
|
|
126
|
-
cautious: "cautious";
|
|
127
|
-
strict: "strict";
|
|
128
|
-
}>>;
|
|
129
|
-
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
130
|
-
}, z.core.$strip>;
|
|
131
|
-
};
|
|
132
|
-
export type SpecVersion = keyof typeof SPEC_VERSIONS;
|
|
133
|
-
export declare const LATEST_SPEC: SpecVersion;
|
|
134
|
-
export declare const ClawSoulSchema: z.ZodObject<{
|
|
135
|
-
name: z.ZodString;
|
|
136
|
-
displayName: z.ZodString;
|
|
137
|
-
version: z.ZodString;
|
|
138
|
-
description: z.ZodString;
|
|
139
|
-
author: z.ZodObject<{
|
|
140
|
-
name: z.ZodString;
|
|
141
|
-
github: z.ZodOptional<z.ZodString>;
|
|
142
|
-
}, z.core.$strip>;
|
|
143
|
-
license: z.ZodString;
|
|
144
|
-
tags: z.ZodArray<z.ZodString>;
|
|
145
|
-
category: z.ZodString;
|
|
146
|
-
compatibility: z.ZodOptional<z.ZodObject<{
|
|
147
|
-
openclaw: z.ZodOptional<z.ZodString>;
|
|
148
|
-
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
-
}, z.core.$strip>>;
|
|
150
|
-
repository: z.ZodOptional<z.ZodString>;
|
|
151
|
-
files: z.ZodObject<{
|
|
152
|
-
soul: z.ZodString;
|
|
153
|
-
identity: z.ZodOptional<z.ZodString>;
|
|
154
|
-
agents: z.ZodOptional<z.ZodString>;
|
|
155
|
-
heartbeat: z.ZodOptional<z.ZodString>;
|
|
156
|
-
style: z.ZodOptional<z.ZodString>;
|
|
157
|
-
userTemplate: z.ZodOptional<z.ZodString>;
|
|
158
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
159
|
-
}, z.core.$strip>;
|
|
160
|
-
examples: z.ZodOptional<z.ZodObject<{
|
|
161
|
-
good: z.ZodOptional<z.ZodString>;
|
|
162
|
-
bad: z.ZodOptional<z.ZodString>;
|
|
163
|
-
}, z.core.$strip>>;
|
|
164
|
-
modes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
-
interpolation: z.ZodOptional<z.ZodEnum<{
|
|
166
|
-
bold: "bold";
|
|
167
|
-
cautious: "cautious";
|
|
168
|
-
strict: "strict";
|
|
169
|
-
}>>;
|
|
170
|
-
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
-
}, z.core.$strip>;
|
|
172
|
-
export type ClawSoul = z.infer<typeof ClawSoulSchemaV02>;
|
|
173
|
-
export declare function getSchema(version?: string): z.ZodType;
|
|
174
|
-
export declare function validateClawSoul(data: unknown, version?: string): ClawSoul;
|
package/dist/utils/validate.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
// ─── v0.1 Schema ───────────────────────────────────────────
|
|
3
|
-
export const ClawSoulSchemaV01 = z.object({
|
|
4
|
-
name: z.string().regex(/^[a-z0-9-]+$/, 'Must be kebab-case'),
|
|
5
|
-
displayName: z.string().min(1),
|
|
6
|
-
version: z.string().regex(/^\d+\.\d+\.\d+$/, 'Must be semver'),
|
|
7
|
-
description: z.string().max(160),
|
|
8
|
-
author: z.object({
|
|
9
|
-
name: z.string(),
|
|
10
|
-
github: z.string().optional(),
|
|
11
|
-
}),
|
|
12
|
-
license: z.string(),
|
|
13
|
-
tags: z.array(z.string()).max(10),
|
|
14
|
-
category: z.string(),
|
|
15
|
-
compatibility: z.object({
|
|
16
|
-
openclaw: z.string().optional(),
|
|
17
|
-
models: z.array(z.string()).optional(),
|
|
18
|
-
}).optional(),
|
|
19
|
-
files: z.object({
|
|
20
|
-
soul: z.string(),
|
|
21
|
-
identity: z.string().optional(),
|
|
22
|
-
agents: z.string().optional(),
|
|
23
|
-
heartbeat: z.string().optional(),
|
|
24
|
-
userTemplate: z.string().optional(),
|
|
25
|
-
avatar: z.string().optional(),
|
|
26
|
-
}),
|
|
27
|
-
repository: z.string().url().optional(),
|
|
28
|
-
});
|
|
29
|
-
// ─── v0.2 Schema (extends v0.1 with STYLE.md, modes, interpolation, examples, skills) ───
|
|
30
|
-
export const ClawSoulSchemaV02 = ClawSoulSchemaV01.extend({
|
|
31
|
-
files: z.object({
|
|
32
|
-
soul: z.string(),
|
|
33
|
-
identity: z.string().optional(),
|
|
34
|
-
agents: z.string().optional(),
|
|
35
|
-
heartbeat: z.string().optional(),
|
|
36
|
-
style: z.string().optional(),
|
|
37
|
-
userTemplate: z.string().optional(),
|
|
38
|
-
avatar: z.string().optional(),
|
|
39
|
-
}),
|
|
40
|
-
examples: z.object({
|
|
41
|
-
good: z.string().optional(),
|
|
42
|
-
bad: z.string().optional(),
|
|
43
|
-
}).optional(),
|
|
44
|
-
modes: z.array(z.string()).optional(),
|
|
45
|
-
interpolation: z.enum(['bold', 'cautious', 'strict']).optional(),
|
|
46
|
-
skills: z.array(z.string()).optional(),
|
|
47
|
-
});
|
|
48
|
-
// ─── Version Registry ──────────────────────────────────────
|
|
49
|
-
export const SPEC_VERSIONS = {
|
|
50
|
-
'0.1': ClawSoulSchemaV01,
|
|
51
|
-
'0.2': ClawSoulSchemaV02,
|
|
52
|
-
};
|
|
53
|
-
export const LATEST_SPEC = '0.2';
|
|
54
|
-
// Default export = latest
|
|
55
|
-
export const ClawSoulSchema = SPEC_VERSIONS[LATEST_SPEC];
|
|
56
|
-
export function getSchema(version) {
|
|
57
|
-
if (!version)
|
|
58
|
-
return ClawSoulSchema;
|
|
59
|
-
const v = version.replace(/^v/, '');
|
|
60
|
-
const schema = SPEC_VERSIONS[v];
|
|
61
|
-
if (!schema) {
|
|
62
|
-
const available = Object.keys(SPEC_VERSIONS).join(', ');
|
|
63
|
-
throw new Error(`Unknown spec version "${version}". Available: ${available}`);
|
|
64
|
-
}
|
|
65
|
-
return schema;
|
|
66
|
-
}
|
|
67
|
-
export function validateClawSoul(data, version) {
|
|
68
|
-
const schema = getSchema(version);
|
|
69
|
-
return schema.parse(data);
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/utils/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CA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