@skillctl/lockfile 0.4.0 → 0.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/LICENSE +21 -21
- package/dist/schema.d.ts +64 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +15 -1
- package/dist/schema.js.map +1 -1
- package/package.json +5 -4
- package/dist/test/lockfile-validation.test.d.ts +0 -3
- package/dist/test/lockfile-validation.test.d.ts.map +0 -1
- package/dist/test/lockfile-validation.test.js +0 -55
- package/dist/test/lockfile-validation.test.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 xFurti, Gabry848
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xFurti, Gabry848
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type
|
|
2
|
+
import { type SkillLockfile, type LockfileEntry, type Provenance } from '@skillctl/core';
|
|
3
3
|
export declare const ProvenanceSchema: z.ZodObject<{
|
|
4
4
|
type: z.ZodEnum<["github", "npm", "local", "skills.sh", "other"]>;
|
|
5
5
|
commit: z.ZodOptional<z.ZodString>;
|
|
6
|
+
requestedRef: z.ZodOptional<z.ZodString>;
|
|
7
|
+
version: z.ZodOptional<z.ZodString>;
|
|
6
8
|
tarballHash: z.ZodOptional<z.ZodString>;
|
|
9
|
+
tarballUrl: z.ZodOptional<z.ZodString>;
|
|
7
10
|
subpath: z.ZodOptional<z.ZodString>;
|
|
8
11
|
migratedFrom: z.ZodOptional<z.ZodEnum<["npx", "python-skillctl", "project-scan"]>>;
|
|
9
12
|
originalHash: z.ZodOptional<z.ZodString>;
|
|
@@ -14,7 +17,10 @@ export declare const ProvenanceSchema: z.ZodObject<{
|
|
|
14
17
|
}, "strip", z.ZodTypeAny, {
|
|
15
18
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
16
19
|
commit?: string | undefined;
|
|
20
|
+
requestedRef?: string | undefined;
|
|
21
|
+
version?: string | undefined;
|
|
17
22
|
tarballHash?: string | undefined;
|
|
23
|
+
tarballUrl?: string | undefined;
|
|
18
24
|
subpath?: string | undefined;
|
|
19
25
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
20
26
|
originalHash?: string | undefined;
|
|
@@ -25,7 +31,10 @@ export declare const ProvenanceSchema: z.ZodObject<{
|
|
|
25
31
|
}, {
|
|
26
32
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
27
33
|
commit?: string | undefined;
|
|
34
|
+
requestedRef?: string | undefined;
|
|
35
|
+
version?: string | undefined;
|
|
28
36
|
tarballHash?: string | undefined;
|
|
37
|
+
tarballUrl?: string | undefined;
|
|
29
38
|
subpath?: string | undefined;
|
|
30
39
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
31
40
|
originalHash?: string | undefined;
|
|
@@ -44,7 +53,10 @@ export declare const LockfileEntrySchema: z.ZodObject<{
|
|
|
44
53
|
provenance: z.ZodObject<{
|
|
45
54
|
type: z.ZodEnum<["github", "npm", "local", "skills.sh", "other"]>;
|
|
46
55
|
commit: z.ZodOptional<z.ZodString>;
|
|
56
|
+
requestedRef: z.ZodOptional<z.ZodString>;
|
|
57
|
+
version: z.ZodOptional<z.ZodString>;
|
|
47
58
|
tarballHash: z.ZodOptional<z.ZodString>;
|
|
59
|
+
tarballUrl: z.ZodOptional<z.ZodString>;
|
|
48
60
|
subpath: z.ZodOptional<z.ZodString>;
|
|
49
61
|
migratedFrom: z.ZodOptional<z.ZodEnum<["npx", "python-skillctl", "project-scan"]>>;
|
|
50
62
|
originalHash: z.ZodOptional<z.ZodString>;
|
|
@@ -55,7 +67,10 @@ export declare const LockfileEntrySchema: z.ZodObject<{
|
|
|
55
67
|
}, "strip", z.ZodTypeAny, {
|
|
56
68
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
57
69
|
commit?: string | undefined;
|
|
70
|
+
requestedRef?: string | undefined;
|
|
71
|
+
version?: string | undefined;
|
|
58
72
|
tarballHash?: string | undefined;
|
|
73
|
+
tarballUrl?: string | undefined;
|
|
59
74
|
subpath?: string | undefined;
|
|
60
75
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
61
76
|
originalHash?: string | undefined;
|
|
@@ -66,7 +81,10 @@ export declare const LockfileEntrySchema: z.ZodObject<{
|
|
|
66
81
|
}, {
|
|
67
82
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
68
83
|
commit?: string | undefined;
|
|
84
|
+
requestedRef?: string | undefined;
|
|
85
|
+
version?: string | undefined;
|
|
69
86
|
tarballHash?: string | undefined;
|
|
87
|
+
tarballUrl?: string | undefined;
|
|
70
88
|
subpath?: string | undefined;
|
|
71
89
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
72
90
|
originalHash?: string | undefined;
|
|
@@ -85,7 +103,10 @@ export declare const LockfileEntrySchema: z.ZodObject<{
|
|
|
85
103
|
provenance: {
|
|
86
104
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
87
105
|
commit?: string | undefined;
|
|
106
|
+
requestedRef?: string | undefined;
|
|
107
|
+
version?: string | undefined;
|
|
88
108
|
tarballHash?: string | undefined;
|
|
109
|
+
tarballUrl?: string | undefined;
|
|
89
110
|
subpath?: string | undefined;
|
|
90
111
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
91
112
|
originalHash?: string | undefined;
|
|
@@ -104,7 +125,10 @@ export declare const LockfileEntrySchema: z.ZodObject<{
|
|
|
104
125
|
provenance: {
|
|
105
126
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
106
127
|
commit?: string | undefined;
|
|
128
|
+
requestedRef?: string | undefined;
|
|
129
|
+
version?: string | undefined;
|
|
107
130
|
tarballHash?: string | undefined;
|
|
131
|
+
tarballUrl?: string | undefined;
|
|
108
132
|
subpath?: string | undefined;
|
|
109
133
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
110
134
|
originalHash?: string | undefined;
|
|
@@ -127,7 +151,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
127
151
|
provenance: z.ZodObject<{
|
|
128
152
|
type: z.ZodEnum<["github", "npm", "local", "skills.sh", "other"]>;
|
|
129
153
|
commit: z.ZodOptional<z.ZodString>;
|
|
154
|
+
requestedRef: z.ZodOptional<z.ZodString>;
|
|
155
|
+
version: z.ZodOptional<z.ZodString>;
|
|
130
156
|
tarballHash: z.ZodOptional<z.ZodString>;
|
|
157
|
+
tarballUrl: z.ZodOptional<z.ZodString>;
|
|
131
158
|
subpath: z.ZodOptional<z.ZodString>;
|
|
132
159
|
migratedFrom: z.ZodOptional<z.ZodEnum<["npx", "python-skillctl", "project-scan"]>>;
|
|
133
160
|
originalHash: z.ZodOptional<z.ZodString>;
|
|
@@ -138,7 +165,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
138
165
|
}, "strip", z.ZodTypeAny, {
|
|
139
166
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
140
167
|
commit?: string | undefined;
|
|
168
|
+
requestedRef?: string | undefined;
|
|
169
|
+
version?: string | undefined;
|
|
141
170
|
tarballHash?: string | undefined;
|
|
171
|
+
tarballUrl?: string | undefined;
|
|
142
172
|
subpath?: string | undefined;
|
|
143
173
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
144
174
|
originalHash?: string | undefined;
|
|
@@ -149,7 +179,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
149
179
|
}, {
|
|
150
180
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
151
181
|
commit?: string | undefined;
|
|
182
|
+
requestedRef?: string | undefined;
|
|
183
|
+
version?: string | undefined;
|
|
152
184
|
tarballHash?: string | undefined;
|
|
185
|
+
tarballUrl?: string | undefined;
|
|
153
186
|
subpath?: string | undefined;
|
|
154
187
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
155
188
|
originalHash?: string | undefined;
|
|
@@ -168,7 +201,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
168
201
|
provenance: {
|
|
169
202
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
170
203
|
commit?: string | undefined;
|
|
204
|
+
requestedRef?: string | undefined;
|
|
205
|
+
version?: string | undefined;
|
|
171
206
|
tarballHash?: string | undefined;
|
|
207
|
+
tarballUrl?: string | undefined;
|
|
172
208
|
subpath?: string | undefined;
|
|
173
209
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
174
210
|
originalHash?: string | undefined;
|
|
@@ -187,7 +223,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
187
223
|
provenance: {
|
|
188
224
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
189
225
|
commit?: string | undefined;
|
|
226
|
+
requestedRef?: string | undefined;
|
|
227
|
+
version?: string | undefined;
|
|
190
228
|
tarballHash?: string | undefined;
|
|
229
|
+
tarballUrl?: string | undefined;
|
|
191
230
|
subpath?: string | undefined;
|
|
192
231
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
193
232
|
originalHash?: string | undefined;
|
|
@@ -197,6 +236,16 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
197
236
|
signature?: string | undefined;
|
|
198
237
|
};
|
|
199
238
|
}>>;
|
|
239
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
migratedAt: z.ZodOptional<z.ZodString>;
|
|
241
|
+
toolVersion: z.ZodOptional<z.ZodString>;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
migratedAt?: string | undefined;
|
|
244
|
+
toolVersion?: string | undefined;
|
|
245
|
+
}, {
|
|
246
|
+
migratedAt?: string | undefined;
|
|
247
|
+
toolVersion?: string | undefined;
|
|
248
|
+
}>>;
|
|
200
249
|
}, "strip", z.ZodTypeAny, {
|
|
201
250
|
lockfileVersion: "1.0";
|
|
202
251
|
skills: Record<string, {
|
|
@@ -209,7 +258,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
209
258
|
provenance: {
|
|
210
259
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
211
260
|
commit?: string | undefined;
|
|
261
|
+
requestedRef?: string | undefined;
|
|
262
|
+
version?: string | undefined;
|
|
212
263
|
tarballHash?: string | undefined;
|
|
264
|
+
tarballUrl?: string | undefined;
|
|
213
265
|
subpath?: string | undefined;
|
|
214
266
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
215
267
|
originalHash?: string | undefined;
|
|
@@ -220,6 +272,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
220
272
|
};
|
|
221
273
|
}>;
|
|
222
274
|
agents?: string[] | undefined;
|
|
275
|
+
metadata?: {
|
|
276
|
+
migratedAt?: string | undefined;
|
|
277
|
+
toolVersion?: string | undefined;
|
|
278
|
+
} | undefined;
|
|
223
279
|
}, {
|
|
224
280
|
lockfileVersion: "1.0";
|
|
225
281
|
skills: Record<string, {
|
|
@@ -232,7 +288,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
232
288
|
provenance: {
|
|
233
289
|
type: "github" | "npm" | "local" | "skills.sh" | "other";
|
|
234
290
|
commit?: string | undefined;
|
|
291
|
+
requestedRef?: string | undefined;
|
|
292
|
+
version?: string | undefined;
|
|
235
293
|
tarballHash?: string | undefined;
|
|
294
|
+
tarballUrl?: string | undefined;
|
|
236
295
|
subpath?: string | undefined;
|
|
237
296
|
migratedFrom?: "npx" | "python-skillctl" | "project-scan" | undefined;
|
|
238
297
|
originalHash?: string | undefined;
|
|
@@ -243,6 +302,10 @@ export declare const SkillLockfileSchema: z.ZodObject<{
|
|
|
243
302
|
};
|
|
244
303
|
}>;
|
|
245
304
|
agents?: string[] | undefined;
|
|
305
|
+
metadata?: {
|
|
306
|
+
migratedAt?: string | undefined;
|
|
307
|
+
toolVersion?: string | undefined;
|
|
308
|
+
} | undefined;
|
|
246
309
|
}>;
|
|
247
310
|
export type { LockfileEntry, SkillLockfile, Provenance };
|
|
248
311
|
export declare function validateLockfile(input: unknown): SkillLockfile;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3G,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ9B,CAAC;AAEH,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;AAEzD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAQ9D"}
|
package/dist/schema.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { canonicalizeName } from '@skillctl/core';
|
|
2
3
|
export const ProvenanceSchema = z.object({
|
|
3
4
|
type: z.enum(['github', 'npm', 'local', 'skills.sh', 'other']),
|
|
4
5
|
commit: z.string().optional(),
|
|
6
|
+
requestedRef: z.string().optional(),
|
|
7
|
+
version: z.string().optional(),
|
|
5
8
|
tarballHash: z.string().optional(),
|
|
9
|
+
tarballUrl: z.string().url().optional(),
|
|
6
10
|
subpath: z.string().optional(),
|
|
7
11
|
migratedFrom: z.enum(['npx', 'python-skillctl', 'project-scan']).optional(),
|
|
8
12
|
originalHash: z.string().optional(),
|
|
@@ -24,8 +28,18 @@ export const SkillLockfileSchema = z.object({
|
|
|
24
28
|
lockfileVersion: z.literal('1.0'),
|
|
25
29
|
agents: z.array(z.string()).optional(),
|
|
26
30
|
skills: z.record(z.string(), LockfileEntrySchema),
|
|
31
|
+
metadata: z.object({
|
|
32
|
+
migratedAt: z.string().optional(),
|
|
33
|
+
toolVersion: z.string().optional(),
|
|
34
|
+
}).optional(),
|
|
27
35
|
});
|
|
28
36
|
export function validateLockfile(input) {
|
|
29
|
-
|
|
37
|
+
const lock = SkillLockfileSchema.parse(input);
|
|
38
|
+
for (const [key, entry] of Object.entries(lock.skills)) {
|
|
39
|
+
if (canonicalizeName(key) !== key || entry.name !== key) {
|
|
40
|
+
throw new Error(`Lockfile skill key/name mismatch or non-canonical name: ${key}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return lock;
|
|
30
44
|
}
|
|
31
45
|
//# sourceMappingURL=schema.js.map
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAA2D,MAAM,gBAAgB,CAAC;AAE3G,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3E,YAAY,EAAE,C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,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC;AAIH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,MAAM,IAAI,GAAG,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAkB,CAAC;IAC/D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACvD,IAAI,gBAAgB,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,2DAA2D,GAAG,EAAE,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillctl/lockfile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "agent-skills.lock YAML parser/generator with lockfileVersion and provenance for skillctl",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "xFurti & Gabry848",
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"!dist/test"
|
|
12
13
|
],
|
|
13
14
|
"dependencies": {
|
|
14
15
|
"js-yaml": "^4.1.0",
|
|
15
16
|
"zod": "^3.23.8",
|
|
16
|
-
"@skillctl/core": "0.
|
|
17
|
+
"@skillctl/core": "0.5.0"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -40,6 +41,6 @@
|
|
|
40
41
|
"dev": "tsc -b --watch",
|
|
41
42
|
"clean": "rimraf dist",
|
|
42
43
|
"lint": "tsc --noEmit",
|
|
43
|
-
"test": "node --test ./dist/test/*.test.js
|
|
44
|
+
"test": "node --test ./dist/test/*.test.js"
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile-validation.test.d.ts","sourceRoot":"","sources":["../../src/test/lockfile-validation.test.ts"],"names":[],"mappings":"AAkBA,iBAAe,QAAQ,kBAgDtB;AAMD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validation tests + fixtures for lockfile (YAML + detailed provenance).
|
|
3
|
-
*/
|
|
4
|
-
import assert from 'node:assert/strict';
|
|
5
|
-
import { readFileSync } from 'node:fs';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { dirname, join } from 'node:path';
|
|
8
|
-
import yaml from 'js-yaml';
|
|
9
|
-
import { validateLockfile } from '../schema.js';
|
|
10
|
-
import { loadLockfile, saveLockfile, createEmptyLockfile, addOrUpdateEntry, makeLockEntry } from '../lockfile.js';
|
|
11
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
const fixturesDir = join(__dirname, '..', '..', 'fixtures');
|
|
13
|
-
function loadFixtureText(name) {
|
|
14
|
-
return readFileSync(join(fixturesDir, name), 'utf8');
|
|
15
|
-
}
|
|
16
|
-
async function runTests() {
|
|
17
|
-
console.log('Running lockfile validation tests...');
|
|
18
|
-
const validYaml = loadFixtureText('example-agent-skills.lock');
|
|
19
|
-
const parsedValid = yaml.load(validYaml);
|
|
20
|
-
const lock = validateLockfile(parsedValid);
|
|
21
|
-
assert.equal(lock.lockfileVersion, '1.0');
|
|
22
|
-
assert.ok(lock.skills['web-design-guidelines']);
|
|
23
|
-
assert.equal(lock.skills['web-design-guidelines'].provenance.type, 'github');
|
|
24
|
-
console.log('✓ valid lock + provenance (github + skills.sh)');
|
|
25
|
-
// empty
|
|
26
|
-
const empty = createEmptyLockfile(['claude-code']);
|
|
27
|
-
assert.equal(empty.lockfileVersion, '1.0');
|
|
28
|
-
assert.deepEqual(empty.skills, {});
|
|
29
|
-
console.log('✓ createEmptyLockfile');
|
|
30
|
-
// add entry
|
|
31
|
-
const entry = makeLockEntry('foo-skill', 'github:acme/foo', 'github:acme/foo@deadbeef', 'sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '/tmp/canonical/foo-skill', { type: 'github', commit: 'deadbeef' });
|
|
32
|
-
const updated = addOrUpdateEntry(empty, 'foo-skill', entry);
|
|
33
|
-
assert.ok(updated.skills['foo-skill']);
|
|
34
|
-
console.log('✓ addOrUpdateEntry + mixed source provenance');
|
|
35
|
-
// load from fixture disk
|
|
36
|
-
const loaded = await loadLockfile(join(fixturesDir, '..'), 'fixtures/example-agent-skills.lock');
|
|
37
|
-
assert.ok(loaded && loaded.skills['playwright']);
|
|
38
|
-
console.log('✓ loadLockfile YAML');
|
|
39
|
-
// invalid integrity
|
|
40
|
-
const badYaml = loadFixtureText('invalid-integrity.lock');
|
|
41
|
-
const badParsed = yaml.load(badYaml);
|
|
42
|
-
assert.throws(() => validateLockfile(badParsed), /integrity must be sha256/);
|
|
43
|
-
console.log('✓ rejects bad integrity hash');
|
|
44
|
-
// save roundtrip
|
|
45
|
-
const tmp = join(__dirname, 'tmp-lock-' + Date.now());
|
|
46
|
-
const p = await saveLockfile(updated, tmp, 'agent-skills.test.lock');
|
|
47
|
-
assert.ok(p.endsWith('.lock'));
|
|
48
|
-
console.log('✓ saveLockfile (YAML pnpm-style)');
|
|
49
|
-
console.log('All lockfile validation tests passed.');
|
|
50
|
-
}
|
|
51
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
52
|
-
runTests().catch((e) => { console.error(e); process.exit(1); });
|
|
53
|
-
}
|
|
54
|
-
export { runTests };
|
|
55
|
-
//# sourceMappingURL=lockfile-validation.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile-validation.test.js","sourceRoot":"","sources":["../../src/test/lockfile-validation.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAElH,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;AAE5D,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,KAAK,UAAU,QAAQ;IACrB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IAEpD,MAAM,SAAS,GAAG,eAAe,CAAC,2BAA2B,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,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