@ai-primitives-hub/core 0.0.1-alpha.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.
Files changed (199) hide show
  1. package/README.md +18 -0
  2. package/dist/domain/bundle/id.d.ts +60 -0
  3. package/dist/domain/bundle/id.d.ts.map +1 -0
  4. package/dist/domain/bundle/id.js +75 -0
  5. package/dist/domain/bundle/id.js.map +1 -0
  6. package/dist/domain/bundle/identity-matcher.d.ts +48 -0
  7. package/dist/domain/bundle/identity-matcher.d.ts.map +1 -0
  8. package/dist/domain/bundle/identity-matcher.js +57 -0
  9. package/dist/domain/bundle/identity-matcher.js.map +1 -0
  10. package/dist/domain/bundle/types.d.ts +138 -0
  11. package/dist/domain/bundle/types.d.ts.map +1 -0
  12. package/dist/domain/bundle/types.js +17 -0
  13. package/dist/domain/bundle/types.js.map +1 -0
  14. package/dist/domain/bundle/version.d.ts +51 -0
  15. package/dist/domain/bundle/version.d.ts.map +1 -0
  16. package/dist/domain/bundle/version.js +176 -0
  17. package/dist/domain/bundle/version.js.map +1 -0
  18. package/dist/domain/collection/manifest-validator.d.ts +47 -0
  19. package/dist/domain/collection/manifest-validator.d.ts.map +1 -0
  20. package/dist/domain/collection/manifest-validator.js +83 -0
  21. package/dist/domain/collection/manifest-validator.js.map +1 -0
  22. package/dist/domain/collection/types.d.ts +201 -0
  23. package/dist/domain/collection/types.d.ts.map +1 -0
  24. package/dist/domain/collection/types.js +17 -0
  25. package/dist/domain/collection/types.js.map +1 -0
  26. package/dist/domain/collection/validate.d.ts +51 -0
  27. package/dist/domain/collection/validate.d.ts.map +1 -0
  28. package/dist/domain/collection/validate.js +263 -0
  29. package/dist/domain/collection/validate.js.map +1 -0
  30. package/dist/domain/discovery/types.d.ts +95 -0
  31. package/dist/domain/discovery/types.d.ts.map +1 -0
  32. package/dist/domain/discovery/types.js +13 -0
  33. package/dist/domain/discovery/types.js.map +1 -0
  34. package/dist/domain/errors.d.ts +23 -0
  35. package/dist/domain/errors.d.ts.map +1 -0
  36. package/dist/domain/errors.js +41 -0
  37. package/dist/domain/errors.js.map +1 -0
  38. package/dist/domain/hub/types.d.ts +254 -0
  39. package/dist/domain/hub/types.d.ts.map +1 -0
  40. package/dist/domain/hub/types.js +11 -0
  41. package/dist/domain/hub/types.js.map +1 -0
  42. package/dist/domain/hub/validate.d.ts +40 -0
  43. package/dist/domain/hub/validate.d.ts.map +1 -0
  44. package/dist/domain/hub/validate.js +89 -0
  45. package/dist/domain/hub/validate.js.map +1 -0
  46. package/dist/domain/index.d.ts +31 -0
  47. package/dist/domain/index.d.ts.map +1 -0
  48. package/dist/domain/index.js +47 -0
  49. package/dist/domain/index.js.map +1 -0
  50. package/dist/domain/install/copilot-file-type.d.ts +84 -0
  51. package/dist/domain/install/copilot-file-type.d.ts.map +1 -0
  52. package/dist/domain/install/copilot-file-type.js +190 -0
  53. package/dist/domain/install/copilot-file-type.js.map +1 -0
  54. package/dist/domain/install/installable.d.ts +58 -0
  55. package/dist/domain/install/installable.d.ts.map +1 -0
  56. package/dist/domain/install/installable.js +36 -0
  57. package/dist/domain/install/installable.js.map +1 -0
  58. package/dist/domain/install/layout.d.ts +84 -0
  59. package/dist/domain/install/layout.d.ts.map +1 -0
  60. package/dist/domain/install/layout.js +70 -0
  61. package/dist/domain/install/layout.js.map +1 -0
  62. package/dist/domain/install/target.d.ts +70 -0
  63. package/dist/domain/install/target.d.ts.map +1 -0
  64. package/dist/domain/install/target.js +43 -0
  65. package/dist/domain/install/target.js.map +1 -0
  66. package/dist/domain/install/transform.d.ts +47 -0
  67. package/dist/domain/install/transform.d.ts.map +1 -0
  68. package/dist/domain/install/transform.js +24 -0
  69. package/dist/domain/install/transform.js.map +1 -0
  70. package/dist/domain/install/types.d.ts +51 -0
  71. package/dist/domain/install/types.d.ts.map +1 -0
  72. package/dist/domain/install/types.js +3 -0
  73. package/dist/domain/install/types.js.map +1 -0
  74. package/dist/domain/primitive/types.d.ts +59 -0
  75. package/dist/domain/primitive/types.d.ts.map +1 -0
  76. package/dist/domain/primitive/types.js +22 -0
  77. package/dist/domain/primitive/types.js.map +1 -0
  78. package/dist/domain/registry/guards.d.ts +28 -0
  79. package/dist/domain/registry/guards.d.ts.map +1 -0
  80. package/dist/domain/registry/guards.js +33 -0
  81. package/dist/domain/registry/guards.js.map +1 -0
  82. package/dist/domain/registry/settings.d.ts +49 -0
  83. package/dist/domain/registry/settings.d.ts.map +1 -0
  84. package/dist/domain/registry/settings.js +3 -0
  85. package/dist/domain/registry/settings.js.map +1 -0
  86. package/dist/domain/registry/types.d.ts +91 -0
  87. package/dist/domain/registry/types.d.ts.map +1 -0
  88. package/dist/domain/registry/types.js +3 -0
  89. package/dist/domain/registry/types.js.map +1 -0
  90. package/dist/domain/registry-error.d.ts +69 -0
  91. package/dist/domain/registry-error.d.ts.map +1 -0
  92. package/dist/domain/registry-error.js +87 -0
  93. package/dist/domain/registry-error.js.map +1 -0
  94. package/dist/domain/scaffold/index.d.ts +9 -0
  95. package/dist/domain/scaffold/index.d.ts.map +1 -0
  96. package/dist/domain/scaffold/index.js +13 -0
  97. package/dist/domain/scaffold/index.js.map +1 -0
  98. package/dist/domain/scaffold/types.d.ts +135 -0
  99. package/dist/domain/scaffold/types.d.ts.map +1 -0
  100. package/dist/domain/scaffold/types.js +44 -0
  101. package/dist/domain/scaffold/types.js.map +1 -0
  102. package/dist/domain/skill/validate.d.ts +52 -0
  103. package/dist/domain/skill/validate.d.ts.map +1 -0
  104. package/dist/domain/skill/validate.js +108 -0
  105. package/dist/domain/skill/validate.js.map +1 -0
  106. package/dist/domain/source/types.d.ts +72 -0
  107. package/dist/domain/source/types.d.ts.map +1 -0
  108. package/dist/domain/source/types.js +14 -0
  109. package/dist/domain/source/types.js.map +1 -0
  110. package/dist/domain/source-id.d.ts +41 -0
  111. package/dist/domain/source-id.d.ts.map +1 -0
  112. package/dist/domain/source-id.js +90 -0
  113. package/dist/domain/source-id.js.map +1 -0
  114. package/dist/index.d.ts +21 -0
  115. package/dist/index.d.ts.map +1 -0
  116. package/dist/index.js +74 -0
  117. package/dist/index.js.map +1 -0
  118. package/dist/ports/app-storage.d.ts +65 -0
  119. package/dist/ports/app-storage.d.ts.map +1 -0
  120. package/dist/ports/app-storage.js +22 -0
  121. package/dist/ports/app-storage.js.map +1 -0
  122. package/dist/ports/bundle-downloader.d.ts +28 -0
  123. package/dist/ports/bundle-downloader.d.ts.map +1 -0
  124. package/dist/ports/bundle-downloader.js +3 -0
  125. package/dist/ports/bundle-downloader.js.map +1 -0
  126. package/dist/ports/bundle-extractor.d.ts +21 -0
  127. package/dist/ports/bundle-extractor.d.ts.map +1 -0
  128. package/dist/ports/bundle-extractor.js +8 -0
  129. package/dist/ports/bundle-extractor.js.map +1 -0
  130. package/dist/ports/clock.d.ts +29 -0
  131. package/dist/ports/clock.d.ts.map +1 -0
  132. package/dist/ports/clock.js +13 -0
  133. package/dist/ports/clock.js.map +1 -0
  134. package/dist/ports/copilot-sdk.d.ts +80 -0
  135. package/dist/ports/copilot-sdk.d.ts.map +1 -0
  136. package/dist/ports/copilot-sdk.js +16 -0
  137. package/dist/ports/copilot-sdk.js.map +1 -0
  138. package/dist/ports/filesystem.d.ts +53 -0
  139. package/dist/ports/filesystem.d.ts.map +1 -0
  140. package/dist/ports/filesystem.js +14 -0
  141. package/dist/ports/filesystem.js.map +1 -0
  142. package/dist/ports/github-api.d.ts +62 -0
  143. package/dist/ports/github-api.d.ts.map +1 -0
  144. package/dist/ports/github-api.js +19 -0
  145. package/dist/ports/github-api.js.map +1 -0
  146. package/dist/ports/http.d.ts +58 -0
  147. package/dist/ports/http.d.ts.map +1 -0
  148. package/dist/ports/http.js +12 -0
  149. package/dist/ports/http.js.map +1 -0
  150. package/dist/ports/index.d.ts +23 -0
  151. package/dist/ports/index.d.ts.map +1 -0
  152. package/dist/ports/index.js +39 -0
  153. package/dist/ports/index.js.map +1 -0
  154. package/dist/ports/layout-config-loader.d.ts +27 -0
  155. package/dist/ports/layout-config-loader.d.ts.map +1 -0
  156. package/dist/ports/layout-config-loader.js +3 -0
  157. package/dist/ports/layout-config-loader.js.map +1 -0
  158. package/dist/ports/process-runner.d.ts +31 -0
  159. package/dist/ports/process-runner.d.ts.map +1 -0
  160. package/dist/ports/process-runner.js +14 -0
  161. package/dist/ports/process-runner.js.map +1 -0
  162. package/dist/ports/registry-operations.d.ts +157 -0
  163. package/dist/ports/registry-operations.d.ts.map +1 -0
  164. package/dist/ports/registry-operations.js +3 -0
  165. package/dist/ports/registry-operations.js.map +1 -0
  166. package/dist/ports/resource-transformer.d.ts +28 -0
  167. package/dist/ports/resource-transformer.d.ts.map +1 -0
  168. package/dist/ports/resource-transformer.js +3 -0
  169. package/dist/ports/resource-transformer.js.map +1 -0
  170. package/dist/ports/source-adapter.d.ts +43 -0
  171. package/dist/ports/source-adapter.d.ts.map +1 -0
  172. package/dist/ports/source-adapter.js +3 -0
  173. package/dist/ports/source-adapter.js.map +1 -0
  174. package/dist/ports/source-resolver.d.ts +19 -0
  175. package/dist/ports/source-resolver.d.ts.map +1 -0
  176. package/dist/ports/source-resolver.js +3 -0
  177. package/dist/ports/source-resolver.js.map +1 -0
  178. package/dist/ports/target-writer.d.ts +37 -0
  179. package/dist/ports/target-writer.d.ts.map +1 -0
  180. package/dist/ports/target-writer.js +3 -0
  181. package/dist/ports/target-writer.js.map +1 -0
  182. package/dist/ports/telemetry.d.ts +22 -0
  183. package/dist/ports/telemetry.d.ts.map +1 -0
  184. package/dist/ports/telemetry.js +11 -0
  185. package/dist/ports/telemetry.js.map +1 -0
  186. package/dist/ports/update-notifier.d.ts +22 -0
  187. package/dist/ports/update-notifier.d.ts.map +1 -0
  188. package/dist/ports/update-notifier.js +12 -0
  189. package/dist/ports/update-notifier.js.map +1 -0
  190. package/dist/ports/update-store.d.ts +25 -0
  191. package/dist/ports/update-store.d.ts.map +1 -0
  192. package/dist/ports/update-store.js +12 -0
  193. package/dist/ports/update-store.js.map +1 -0
  194. package/dist/public/schemas/apm.schema.json +59 -0
  195. package/dist/public/schemas/collection.schema.json +345 -0
  196. package/dist/public/schemas/default-hubs-config.schema.json +68 -0
  197. package/dist/public/schemas/hub-config.schema.json +389 -0
  198. package/dist/public/schemas/lockfile.schema.json +243 -0
  199. package/package.json +50 -0
@@ -0,0 +1,389 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/AmadeusITGroup/prompt-registry/blob/main/schemas/hub-config.schema.json",
4
+ "title": "Hub Configuration Schema",
5
+ "description": "JSON Schema for Prompt Registry hub configuration files",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "metadata",
10
+ "sources"
11
+ ],
12
+ "properties": {
13
+ "version": {
14
+ "type": "string",
15
+ "description": "Semantic version of the hub configuration format",
16
+ "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?$"
17
+ },
18
+ "metadata": {
19
+ "type": "object",
20
+ "description": "Hub metadata and descriptive information",
21
+ "required": [
22
+ "name",
23
+ "description",
24
+ "maintainer",
25
+ "updatedAt"
26
+ ],
27
+ "properties": {
28
+ "name": {
29
+ "type": "string",
30
+ "description": "Human-readable name of the hub",
31
+ "minLength": 1,
32
+ "maxLength": 100
33
+ },
34
+ "description": {
35
+ "type": "string",
36
+ "description": "Detailed description of the hub's purpose and content",
37
+ "minLength": 1,
38
+ "maxLength": 500
39
+ },
40
+ "maintainer": {
41
+ "type": "string",
42
+ "description": "Name or identifier of the hub maintainer",
43
+ "minLength": 1,
44
+ "maxLength": 100
45
+ },
46
+ "updatedAt": {
47
+ "type": "string",
48
+ "description": "ISO 8601 timestamp of last update",
49
+ "format": "date-time"
50
+ },
51
+ "checksum": {
52
+ "type": "string",
53
+ "description": "Optional integrity checksum for the hub configuration",
54
+ "pattern": "^(sha256|sha512):[a-f0-9]+$"
55
+ }
56
+ }
57
+ },
58
+ "sources": {
59
+ "type": "array",
60
+ "description": "List of bundle sources available in this hub",
61
+ "items": {
62
+ "type": "object",
63
+ "required": [
64
+ "id",
65
+ "type",
66
+ "enabled",
67
+ "priority"
68
+ ],
69
+ "properties": {
70
+ "id": {
71
+ "type": "string",
72
+ "description": "Unique identifier for the source",
73
+ "pattern": "^[a-zA-Z0-9-_]+$",
74
+ "minLength": 1,
75
+ "maxLength": 50
76
+ },
77
+ "type": {
78
+ "type": "string",
79
+ "description": "Type of the source repository (github, local, awesome-copilot, local-awesome-copilot, apm, local-apm, skills)",
80
+ "enum": [
81
+ "github",
82
+ "local",
83
+ "awesome-copilot",
84
+ "local-awesome-copilot",
85
+ "apm",
86
+ "local-apm",
87
+ "skills"
88
+ ]
89
+ },
90
+ "url": {
91
+ "type": "string",
92
+ "description": "URL or path to the source (optional if repository is specified)"
93
+ },
94
+ "repository": {
95
+ "type": "string",
96
+ "description": "GitHub repository in owner/repo format"
97
+ },
98
+ "branch": {
99
+ "type": "string",
100
+ "description": "Git branch name"
101
+ },
102
+ "name": {
103
+ "type": "string",
104
+ "description": "Human-readable name of the source"
105
+ },
106
+ "enabled": {
107
+ "type": "boolean",
108
+ "description": "Whether this source is currently active"
109
+ },
110
+ "priority": {
111
+ "type": "number",
112
+ "description": "Priority order for source resolution (higher = higher priority)",
113
+ "minimum": 0,
114
+ "maximum": 100
115
+ },
116
+ "config": {
117
+ "type": "object",
118
+ "description": "Source-specific configuration settings (e.g., branch, collectionsPath for awesome-copilot sources)",
119
+ "properties": {
120
+ "branch": {
121
+ "type": "string",
122
+ "description": "Git branch name (for git-based sources)"
123
+ },
124
+ "collectionsPath": {
125
+ "type": "string",
126
+ "description": "Path to collections directory (for awesome-copilot sources)"
127
+ },
128
+ "indexFile": {
129
+ "type": "string",
130
+ "description": "Index file name (for awesome-copilot sources)"
131
+ }
132
+ }
133
+ },
134
+ "metadata": {
135
+ "type": "object",
136
+ "description": "Additional source metadata",
137
+ "properties": {
138
+ "description": {
139
+ "type": "string",
140
+ "description": "Source description"
141
+ },
142
+ "homepage": {
143
+ "type": "string",
144
+ "description": "Source homepage URL"
145
+ },
146
+ "contact": {
147
+ "type": "string",
148
+ "description": "Contact information"
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ },
155
+ "profiles": {
156
+ "type": "array",
157
+ "description": "Predefined bundle profiles/collections",
158
+ "default": [],
159
+ "items": {
160
+ "type": "object",
161
+ "required": [
162
+ "id",
163
+ "name",
164
+ "description",
165
+ "bundles"
166
+ ],
167
+ "properties": {
168
+ "id": {
169
+ "type": "string",
170
+ "description": "Unique identifier for the profile",
171
+ "pattern": "^[a-zA-Z0-9-_]+$",
172
+ "minLength": 1,
173
+ "maxLength": 50
174
+ },
175
+ "name": {
176
+ "type": "string",
177
+ "description": "Human-readable name of the profile",
178
+ "minLength": 1,
179
+ "maxLength": 100
180
+ },
181
+ "description": {
182
+ "type": "string",
183
+ "description": "Description of the profile's purpose",
184
+ "minLength": 1,
185
+ "maxLength": 500
186
+ },
187
+ "icon": {
188
+ "type": "string",
189
+ "description": "Optional icon/emoji for the profile"
190
+ },
191
+ "active": {
192
+ "type": "boolean",
193
+ "description": "Whether this profile is currently active"
194
+ },
195
+ "createdAt": {
196
+ "type": "string",
197
+ "description": "ISO 8601 timestamp of creation",
198
+ "format": "date-time"
199
+ },
200
+ "updatedAt": {
201
+ "type": "string",
202
+ "description": "ISO 8601 timestamp of last update",
203
+ "format": "date-time"
204
+ },
205
+ "bundles": {
206
+ "type": "array",
207
+ "description": "List of bundles included in this profile",
208
+ "minItems": 1,
209
+ "items": {
210
+ "type": "object",
211
+ "required": [
212
+ "id",
213
+ "version",
214
+ "source",
215
+ "required"
216
+ ],
217
+ "properties": {
218
+ "id": {
219
+ "type": "string",
220
+ "description": "Bundle identifier",
221
+ "pattern": "^[\\w\\.\\-]+$",
222
+ "minLength": 1,
223
+ "maxLength": 200
224
+ },
225
+ "version": {
226
+ "type": "string",
227
+ "description": "Bundle version (semver or 'latest')",
228
+ "pattern": "^(\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?|latest)$"
229
+ },
230
+ "source": {
231
+ "type": "string",
232
+ "description": "Source ID where this bundle is available",
233
+ "pattern": "^[a-zA-Z0-9-_]+$",
234
+ "minLength": 1,
235
+ "maxLength": 50
236
+ },
237
+ "required": {
238
+ "type": "boolean",
239
+ "description": "Whether this bundle is mandatory for the profile"
240
+ }
241
+ }
242
+ }
243
+ },
244
+ "path": {
245
+ "type": "array",
246
+ "description": "Optional path hierarchy for organizing this profile in the UI",
247
+ "items": {
248
+ "type": "string",
249
+ "minLength": 1,
250
+ "maxLength": 50,
251
+ "pattern": "^[a-zA-Z0-9-_. ]+$"
252
+ }
253
+ }
254
+ }
255
+ }
256
+ },
257
+ "configuration": {
258
+ "type": "object",
259
+ "description": "Optional hub-level configuration settings",
260
+ "properties": {
261
+ "autoSync": {
262
+ "type": "boolean",
263
+ "description": "Enable automatic synchronization with hub sources"
264
+ },
265
+ "syncInterval": {
266
+ "type": "number",
267
+ "description": "Sync interval in seconds",
268
+ "minimum": 60,
269
+ "maximum": 86400
270
+ },
271
+ "strictMode": {
272
+ "type": "boolean",
273
+ "description": "Enable strict validation and security checks"
274
+ }
275
+ }
276
+ },
277
+ "telemetry": {
278
+ "type": "object",
279
+ "description": "Telemetry configuration for this hub",
280
+ "properties": {
281
+ "elasticSearch": {
282
+ "type": "object",
283
+ "description": "ES telemetry proxy configuration",
284
+ "required": ["node"],
285
+ "properties": {
286
+ "node": {
287
+ "type": "string",
288
+ "description": "ES telemetry proxy URL (e.g. https://es-proxy.internal:8080)",
289
+ "format": "uri"
290
+ },
291
+ "indexPrefix": {
292
+ "type": "string",
293
+ "description": "Custom index prefix (default: prompt-registry-telemetry)",
294
+ "pattern": "^[a-z0-9-]+$",
295
+ "minLength": 1,
296
+ "maxLength": 100
297
+ }
298
+ }
299
+ }
300
+ }
301
+ },
302
+ "engagement": {
303
+ "type": "object",
304
+ "description": "Engagement features configuration (telemetry, ratings, feedback)",
305
+ "properties": {
306
+ "enabled": {
307
+ "type": "boolean",
308
+ "description": "Enable engagement features for this hub"
309
+ },
310
+ "backend": {
311
+ "type": "object",
312
+ "description": "Backend configuration for engagement data storage",
313
+ "required": ["type"],
314
+ "properties": {
315
+ "type": {
316
+ "type": "string",
317
+ "description": "Backend type for engagement data",
318
+ "enum": ["file", "github-issues", "github-discussions", "api"]
319
+ },
320
+ "repository": {
321
+ "type": "string",
322
+ "description": "GitHub repository in owner/repo format (for github-issues or github-discussions backends)",
323
+ "pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$"
324
+ },
325
+ "apiUrl": {
326
+ "type": "string",
327
+ "description": "API endpoint URL (for api backend)",
328
+ "format": "uri"
329
+ }
330
+ }
331
+ },
332
+ "telemetry": {
333
+ "type": "object",
334
+ "description": "Telemetry configuration",
335
+ "properties": {
336
+ "enabled": {
337
+ "type": "boolean",
338
+ "description": "Enable telemetry collection"
339
+ },
340
+ "anonymize": {
341
+ "type": "boolean",
342
+ "description": "Anonymize telemetry data"
343
+ }
344
+ }
345
+ },
346
+ "ratings": {
347
+ "type": "object",
348
+ "description": "Rating configuration",
349
+ "properties": {
350
+ "enabled": {
351
+ "type": "boolean",
352
+ "description": "Enable rating features"
353
+ },
354
+ "ratingsUrl": {
355
+ "type": "string",
356
+ "description": "URL to pre-computed ratings.json file (static hosting)",
357
+ "format": "uri"
358
+ }
359
+ }
360
+ },
361
+ "feedback": {
362
+ "type": "object",
363
+ "description": "Feedback configuration",
364
+ "properties": {
365
+ "enabled": {
366
+ "type": "boolean",
367
+ "description": "Enable feedback features"
368
+ },
369
+ "requireRating": {
370
+ "type": "boolean",
371
+ "description": "Require rating when submitting feedback"
372
+ },
373
+ "maxLength": {
374
+ "type": "number",
375
+ "description": "Maximum feedback comment length",
376
+ "minimum": 100,
377
+ "maximum": 10000
378
+ },
379
+ "feedbackUrl": {
380
+ "type": "string",
381
+ "description": "URL to pre-computed feedbacks.json file (static hosting)",
382
+ "format": "uri"
383
+ }
384
+ }
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
@@ -0,0 +1,243 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/AmadeusITGroup/prompt-registry/schemas/lockfile.schema.json",
4
+ "title": "Prompt Registry Lockfile",
5
+ "description": "Schema for prompt-registry.lock.json files that track repository-level bundle installations",
6
+ "type": "object",
7
+ "required": [
8
+ "$schema",
9
+ "version",
10
+ "generatedAt",
11
+ "generatedBy",
12
+ "bundles",
13
+ "sources"
14
+ ],
15
+ "properties": {
16
+ "$schema": {
17
+ "type": "string",
18
+ "description": "JSON schema reference for validation",
19
+ "examples": [
20
+ "https://github.com/AmadeusITGroup/prompt-registry/schemas/lockfile.schema.json"
21
+ ]
22
+ },
23
+ "version": {
24
+ "type": "string",
25
+ "description": "Lockfile schema version",
26
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
27
+ "examples": [
28
+ "2.0.0"
29
+ ]
30
+ },
31
+ "generatedAt": {
32
+ "type": "string",
33
+ "description": "ISO 8601 timestamp when the lockfile was generated",
34
+ "format": "date-time",
35
+ "examples": [
36
+ "2026-01-13T10:30:00.000Z"
37
+ ]
38
+ },
39
+ "generatedBy": {
40
+ "type": "string",
41
+ "description": "Extension name and version that generated the lockfile",
42
+ "examples": [
43
+ "prompt-registry@1.0.0"
44
+ ]
45
+ },
46
+ "bundles": {
47
+ "type": "object",
48
+ "description": "Map of bundle IDs to their metadata",
49
+ "additionalProperties": {
50
+ "$ref": "#/definitions/bundleEntry"
51
+ }
52
+ },
53
+ "sources": {
54
+ "type": "object",
55
+ "description": "Map of source IDs to their configuration",
56
+ "additionalProperties": {
57
+ "$ref": "#/definitions/sourceEntry"
58
+ }
59
+ },
60
+ "hubs": {
61
+ "type": "object",
62
+ "description": "Optional map of hub IDs to their configuration",
63
+ "additionalProperties": {
64
+ "$ref": "#/definitions/hubEntry"
65
+ }
66
+ },
67
+ "profiles": {
68
+ "type": "object",
69
+ "description": "Optional map of profile IDs to their configuration",
70
+ "additionalProperties": {
71
+ "$ref": "#/definitions/profileEntry"
72
+ }
73
+ }
74
+ },
75
+ "additionalProperties": false,
76
+ "definitions": {
77
+ "bundleEntry": {
78
+ "type": "object",
79
+ "description": "Bundle entry in the lockfile",
80
+ "required": [
81
+ "version",
82
+ "sourceId",
83
+ "sourceType",
84
+ "installedAt",
85
+ "files"
86
+ ],
87
+ "properties": {
88
+ "version": {
89
+ "type": "string",
90
+ "description": "Semantic version of the installed bundle",
91
+ "examples": [
92
+ "1.0.0",
93
+ "2.1.3"
94
+ ]
95
+ },
96
+ "sourceId": {
97
+ "type": "string",
98
+ "description": "ID of the source this bundle was installed from",
99
+ "minLength": 1
100
+ },
101
+ "sourceType": {
102
+ "type": "string",
103
+ "description": "Type of the source",
104
+ "enum": [
105
+ "github",
106
+ "local",
107
+ "awesome-copilot",
108
+ "local-awesome-copilot",
109
+ "apm",
110
+ "local-apm"
111
+ ]
112
+ },
113
+ "installedAt": {
114
+ "type": "string",
115
+ "description": "ISO 8601 timestamp when bundle was installed",
116
+ "format": "date-time"
117
+ },
118
+ "commitMode": {
119
+ "type": "string",
120
+ "description": "DEPRECATED: Commit mode is now implicit based on which lockfile contains the entry. Bundles in prompt-registry.lock.json are implicitly 'commit' mode, bundles in prompt-registry.local.lock.json are implicitly 'local-only' mode. This field is retained for backward compatibility but should not be included in new entries.",
121
+ "enum": [
122
+ "commit",
123
+ "local-only"
124
+ ]
125
+ },
126
+ "checksum": {
127
+ "type": "string",
128
+ "description": "Optional checksum of the bundle archive"
129
+ },
130
+ "files": {
131
+ "type": "array",
132
+ "description": "List of installed files with their checksums",
133
+ "items": {
134
+ "$ref": "#/definitions/fileEntry"
135
+ }
136
+ }
137
+ },
138
+ "additionalProperties": false
139
+ },
140
+ "fileEntry": {
141
+ "type": "object",
142
+ "description": "File entry within a bundle",
143
+ "required": [
144
+ "path",
145
+ "checksum"
146
+ ],
147
+ "properties": {
148
+ "path": {
149
+ "type": "string",
150
+ "description": "Relative path from repository root",
151
+ "minLength": 1,
152
+ "examples": [
153
+ ".github/prompts/my-prompt.prompt.md",
154
+ ".github/agents/my-agent.agent.md"
155
+ ]
156
+ },
157
+ "checksum": {
158
+ "type": "string",
159
+ "description": "SHA256 checksum of the file contents",
160
+ "pattern": "^[a-f0-9]{64}$"
161
+ }
162
+ },
163
+ "additionalProperties": false
164
+ },
165
+ "sourceEntry": {
166
+ "type": "object",
167
+ "description": "Source configuration entry",
168
+ "required": [
169
+ "type",
170
+ "url"
171
+ ],
172
+ "properties": {
173
+ "type": {
174
+ "type": "string",
175
+ "description": "Source type",
176
+ "enum": [
177
+ "github",
178
+ "local",
179
+ "awesome-copilot",
180
+ "local-awesome-copilot",
181
+ "apm",
182
+ "local-apm"
183
+ ]
184
+ },
185
+ "url": {
186
+ "type": "string",
187
+ "description": "URL of the source",
188
+ "minLength": 1
189
+ },
190
+ "branch": {
191
+ "type": "string",
192
+ "description": "Optional Git branch for git-based sources"
193
+ }
194
+ },
195
+ "additionalProperties": false
196
+ },
197
+ "hubEntry": {
198
+ "type": "object",
199
+ "description": "Hub configuration entry",
200
+ "required": [
201
+ "name",
202
+ "url"
203
+ ],
204
+ "properties": {
205
+ "name": {
206
+ "type": "string",
207
+ "description": "Display name of the hub",
208
+ "minLength": 1
209
+ },
210
+ "url": {
211
+ "type": "string",
212
+ "description": "URL of the hub configuration",
213
+ "minLength": 1
214
+ }
215
+ },
216
+ "additionalProperties": false
217
+ },
218
+ "profileEntry": {
219
+ "type": "object",
220
+ "description": "Profile entry in the lockfile",
221
+ "required": [
222
+ "name",
223
+ "bundleIds"
224
+ ],
225
+ "properties": {
226
+ "name": {
227
+ "type": "string",
228
+ "description": "Display name of the profile",
229
+ "minLength": 1
230
+ },
231
+ "bundleIds": {
232
+ "type": "array",
233
+ "description": "List of bundle IDs included in this profile",
234
+ "items": {
235
+ "type": "string",
236
+ "minLength": 1
237
+ }
238
+ }
239
+ },
240
+ "additionalProperties": false
241
+ }
242
+ }
243
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@ai-primitives-hub/core",
3
+ "version": "0.0.1-alpha.1",
4
+ "description": "Core domain types and port interfaces for AI Primitives Hub. No dependency on other @ai-primitives-hub packages.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "license": "Apache-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/AmadeusITGroup/ai-primitives-hub.git",
11
+ "directory": "packages/core"
12
+ },
13
+ "keywords": [
14
+ "ai-primitives-hub",
15
+ "core",
16
+ "domain",
17
+ "ports"
18
+ ],
19
+ "author": {
20
+ "name": "Amadeus IT Group",
21
+ "email": "opensource@amadeus.com"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "dependencies": {
27
+ "js-yaml": "^4.1.1",
28
+ "semver": "^7.5.4"
29
+ },
30
+ "devDependencies": {
31
+ "@types/js-yaml": "^4.0.9",
32
+ "@types/node": "^22.0.0",
33
+ "@types/semver": "^7.5.6",
34
+ "@vitest/coverage-v8": "^4.1.7",
35
+ "typescript": "^5.9.3",
36
+ "vitest": "^4.1.7"
37
+ },
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "watch": "tsc --watch",
44
+ "lint": "eslint src test",
45
+ "lint:fix": "eslint src test --fix",
46
+ "test": "vitest run",
47
+ "test:watch": "vitest",
48
+ "test:coverage": "vitest run --coverage"
49
+ }
50
+ }