@cogenta/agents 0.2.1 → 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.
Files changed (242) hide show
  1. package/dist/agents/builtins.d.ts +51 -0
  2. package/dist/agents/builtins.d.ts.map +1 -0
  3. package/dist/agents/builtins.js +190 -0
  4. package/dist/agents/builtins.js.map +1 -0
  5. package/dist/agents/orchestrator.d.ts +98 -0
  6. package/dist/agents/orchestrator.d.ts.map +1 -0
  7. package/dist/agents/orchestrator.js +286 -0
  8. package/dist/agents/orchestrator.js.map +1 -0
  9. package/dist/agents/store.d.ts +71 -0
  10. package/dist/agents/store.d.ts.map +1 -0
  11. package/dist/agents/store.js +211 -0
  12. package/dist/agents/store.js.map +1 -0
  13. package/dist/agents/types.d.ts +10 -0
  14. package/dist/agents/types.d.ts.map +1 -1
  15. package/dist/assist/agent-identity.d.ts +44 -0
  16. package/dist/assist/agent-identity.d.ts.map +1 -0
  17. package/dist/assist/agent-identity.js +136 -0
  18. package/dist/assist/agent-identity.js.map +1 -0
  19. package/dist/assist/chat.d.ts +2 -0
  20. package/dist/assist/chat.d.ts.map +1 -1
  21. package/dist/assist/chat.js +14 -5
  22. package/dist/assist/chat.js.map +1 -1
  23. package/dist/assist/classify.d.ts +3 -2
  24. package/dist/assist/classify.d.ts.map +1 -1
  25. package/dist/assist/classify.js +30 -11
  26. package/dist/assist/classify.js.map +1 -1
  27. package/dist/assist/faq.d.ts +3 -2
  28. package/dist/assist/faq.d.ts.map +1 -1
  29. package/dist/assist/faq.js +31 -13
  30. package/dist/assist/faq.js.map +1 -1
  31. package/dist/assist/runtime.d.ts +8 -2
  32. package/dist/assist/runtime.d.ts.map +1 -1
  33. package/dist/assist/runtime.js +2 -2
  34. package/dist/assist/runtime.js.map +1 -1
  35. package/dist/assist/toolset.d.ts +10 -0
  36. package/dist/assist/toolset.d.ts.map +1 -1
  37. package/dist/assist/toolset.js +36 -8
  38. package/dist/assist/toolset.js.map +1 -1
  39. package/dist/assist/usage.d.ts +58 -0
  40. package/dist/assist/usage.d.ts.map +1 -0
  41. package/dist/assist/usage.js +53 -0
  42. package/dist/assist/usage.js.map +1 -0
  43. package/dist/assist/writing.d.ts +10 -9
  44. package/dist/assist/writing.d.ts.map +1 -1
  45. package/dist/assist/writing.js +126 -58
  46. package/dist/assist/writing.js.map +1 -1
  47. package/dist/audit/with-audit.d.ts +13 -0
  48. package/dist/audit/with-audit.d.ts.map +1 -1
  49. package/dist/audit/with-audit.js +6 -0
  50. package/dist/audit/with-audit.js.map +1 -1
  51. package/dist/autonomy/levels.d.ts +37 -0
  52. package/dist/autonomy/levels.d.ts.map +1 -0
  53. package/dist/autonomy/levels.js +51 -0
  54. package/dist/autonomy/levels.js.map +1 -0
  55. package/dist/conversations/store.d.ts +62 -0
  56. package/dist/conversations/store.d.ts.map +1 -0
  57. package/dist/conversations/store.js +0 -0
  58. package/dist/conversations/store.js.map +1 -0
  59. package/dist/identity/context.d.ts +8 -0
  60. package/dist/identity/context.d.ts.map +1 -1
  61. package/dist/identity/context.js +19 -4
  62. package/dist/identity/context.js.map +1 -1
  63. package/dist/identity/markdown.d.ts +38 -0
  64. package/dist/identity/markdown.d.ts.map +1 -0
  65. package/dist/identity/markdown.js +85 -0
  66. package/dist/identity/markdown.js.map +1 -0
  67. package/dist/index.d.ts +62 -5
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +33 -3
  70. package/dist/index.js.map +1 -1
  71. package/dist/progress/job-store.d.ts +41 -0
  72. package/dist/progress/job-store.d.ts.map +1 -0
  73. package/dist/progress/job-store.js +44 -0
  74. package/dist/progress/job-store.js.map +1 -0
  75. package/dist/progress/types.d.ts +21 -0
  76. package/dist/progress/types.d.ts.map +1 -0
  77. package/dist/progress/types.js +3 -0
  78. package/dist/progress/types.js.map +1 -0
  79. package/dist/prompts/render.d.ts +23 -0
  80. package/dist/prompts/render.d.ts.map +1 -0
  81. package/dist/prompts/render.js +35 -0
  82. package/dist/prompts/render.js.map +1 -0
  83. package/dist/prompts/seeds.d.ts +34 -0
  84. package/dist/prompts/seeds.d.ts.map +1 -0
  85. package/dist/prompts/seeds.js +166 -0
  86. package/dist/prompts/seeds.js.map +1 -0
  87. package/dist/prompts/store.d.ts +8 -0
  88. package/dist/prompts/store.d.ts.map +1 -0
  89. package/dist/prompts/store.js +153 -0
  90. package/dist/prompts/store.js.map +1 -0
  91. package/dist/prompts/types.d.ts +51 -0
  92. package/dist/prompts/types.d.ts.map +1 -0
  93. package/dist/prompts/types.js +24 -0
  94. package/dist/prompts/types.js.map +1 -0
  95. package/dist/providers/anthropic.d.ts +26 -3
  96. package/dist/providers/anthropic.d.ts.map +1 -1
  97. package/dist/providers/anthropic.js +60 -12
  98. package/dist/providers/anthropic.js.map +1 -1
  99. package/dist/providers/catalog.d.ts +41 -0
  100. package/dist/providers/catalog.d.ts.map +1 -0
  101. package/dist/providers/catalog.js +85 -0
  102. package/dist/providers/catalog.js.map +1 -0
  103. package/dist/providers/content-parts.d.ts +12 -0
  104. package/dist/providers/content-parts.d.ts.map +1 -0
  105. package/dist/providers/content-parts.js +18 -0
  106. package/dist/providers/content-parts.js.map +1 -0
  107. package/dist/providers/defaults.d.ts +44 -0
  108. package/dist/providers/defaults.d.ts.map +1 -0
  109. package/dist/providers/defaults.js +72 -0
  110. package/dist/providers/defaults.js.map +1 -0
  111. package/dist/providers/google.d.ts +20 -3
  112. package/dist/providers/google.d.ts.map +1 -1
  113. package/dist/providers/google.js +53 -12
  114. package/dist/providers/google.js.map +1 -1
  115. package/dist/providers/openai.d.ts +36 -4
  116. package/dist/providers/openai.d.ts.map +1 -1
  117. package/dist/providers/openai.js +113 -21
  118. package/dist/providers/openai.js.map +1 -1
  119. package/dist/providers/registry.d.ts +38 -21
  120. package/dist/providers/registry.d.ts.map +1 -1
  121. package/dist/providers/registry.js +64 -8
  122. package/dist/providers/registry.js.map +1 -1
  123. package/dist/providers/request-signal.d.ts +18 -0
  124. package/dist/providers/request-signal.d.ts.map +1 -0
  125. package/dist/providers/request-signal.js +21 -0
  126. package/dist/providers/request-signal.js.map +1 -0
  127. package/dist/providers/resolve.d.ts +13 -0
  128. package/dist/providers/resolve.d.ts.map +1 -0
  129. package/dist/providers/resolve.js +30 -0
  130. package/dist/providers/resolve.js.map +1 -0
  131. package/dist/providers/store.d.ts +70 -0
  132. package/dist/providers/store.d.ts.map +1 -0
  133. package/dist/providers/store.js +308 -0
  134. package/dist/providers/store.js.map +1 -0
  135. package/dist/providers/tool-names.d.ts +9 -0
  136. package/dist/providers/tool-names.d.ts.map +1 -0
  137. package/dist/providers/tool-names.js +56 -0
  138. package/dist/providers/tool-names.js.map +1 -0
  139. package/dist/providers/types.d.ts +87 -3
  140. package/dist/providers/types.d.ts.map +1 -1
  141. package/dist/rag/reference-documents/ingest.d.ts +22 -0
  142. package/dist/rag/reference-documents/ingest.d.ts.map +1 -0
  143. package/dist/rag/reference-documents/ingest.js +69 -0
  144. package/dist/rag/reference-documents/ingest.js.map +1 -0
  145. package/dist/rag/reference-documents/store.d.ts +23 -0
  146. package/dist/rag/reference-documents/store.d.ts.map +1 -0
  147. package/dist/rag/reference-documents/store.js +140 -0
  148. package/dist/rag/reference-documents/store.js.map +1 -0
  149. package/dist/rag/reference-documents/types.d.ts +52 -0
  150. package/dist/rag/reference-documents/types.d.ts.map +1 -0
  151. package/dist/rag/reference-documents/types.js +32 -0
  152. package/dist/rag/reference-documents/types.js.map +1 -0
  153. package/dist/runtime/loop.d.ts +29 -7
  154. package/dist/runtime/loop.d.ts.map +1 -1
  155. package/dist/runtime/loop.js +209 -44
  156. package/dist/runtime/loop.js.map +1 -1
  157. package/dist/runtime/retry.d.ts +2 -0
  158. package/dist/runtime/retry.d.ts.map +1 -1
  159. package/dist/runtime/retry.js +1 -0
  160. package/dist/runtime/retry.js.map +1 -1
  161. package/dist/runtime/types.d.ts +14 -3
  162. package/dist/runtime/types.d.ts.map +1 -1
  163. package/dist/site-plan/analyse-brief.d.ts +8 -0
  164. package/dist/site-plan/analyse-brief.d.ts.map +1 -1
  165. package/dist/site-plan/analyse-brief.js +17 -8
  166. package/dist/site-plan/analyse-brief.js.map +1 -1
  167. package/dist/site-plan/approval.d.ts +2 -2
  168. package/dist/site-plan/approval.d.ts.map +1 -1
  169. package/dist/site-plan/approval.js +34 -4
  170. package/dist/site-plan/approval.js.map +1 -1
  171. package/dist/site-plan/content-model.d.ts +14 -0
  172. package/dist/site-plan/content-model.d.ts.map +1 -1
  173. package/dist/site-plan/content-model.js +51 -9
  174. package/dist/site-plan/content-model.js.map +1 -1
  175. package/dist/site-plan/demo-content.d.ts.map +1 -1
  176. package/dist/site-plan/demo-content.js +1 -4
  177. package/dist/site-plan/demo-content.js.map +1 -1
  178. package/dist/site-plan/propose-plan.d.ts +10 -0
  179. package/dist/site-plan/propose-plan.d.ts.map +1 -1
  180. package/dist/site-plan/propose-plan.js +25 -1
  181. package/dist/site-plan/propose-plan.js.map +1 -1
  182. package/dist/site-plan/site-context.d.ts +81 -0
  183. package/dist/site-plan/site-context.d.ts.map +1 -0
  184. package/dist/site-plan/site-context.js +76 -0
  185. package/dist/site-plan/site-context.js.map +1 -0
  186. package/dist/site-plan/skin-candidates.d.ts +13 -1
  187. package/dist/site-plan/skin-candidates.d.ts.map +1 -1
  188. package/dist/site-plan/skin-candidates.js +15 -0
  189. package/dist/site-plan/skin-candidates.js.map +1 -1
  190. package/dist/site-plan/structural-gaps.d.ts +32 -0
  191. package/dist/site-plan/structural-gaps.d.ts.map +1 -0
  192. package/dist/site-plan/structural-gaps.js +77 -0
  193. package/dist/site-plan/structural-gaps.js.map +1 -0
  194. package/dist/site-plan/types.d.ts +7 -0
  195. package/dist/site-plan/types.d.ts.map +1 -1
  196. package/dist/skills/frontmatter.d.ts +19 -1
  197. package/dist/skills/frontmatter.d.ts.map +1 -1
  198. package/dist/skills/frontmatter.js +29 -5
  199. package/dist/skills/frontmatter.js.map +1 -1
  200. package/dist/skills/library.d.ts +133 -0
  201. package/dist/skills/library.d.ts.map +1 -0
  202. package/dist/skills/library.js +332 -0
  203. package/dist/skills/library.js.map +1 -0
  204. package/dist/skills/types.d.ts +8 -1
  205. package/dist/skills/types.d.ts.map +1 -1
  206. package/dist/skin/generate.d.ts +22 -1
  207. package/dist/skin/generate.d.ts.map +1 -1
  208. package/dist/skin/generate.js +60 -5
  209. package/dist/skin/generate.js.map +1 -1
  210. package/dist/theme-creator/propose-theme.d.ts +83 -0
  211. package/dist/theme-creator/propose-theme.d.ts.map +1 -0
  212. package/dist/theme-creator/propose-theme.js +234 -0
  213. package/dist/theme-creator/propose-theme.js.map +1 -0
  214. package/dist/tools/core/agent-delegate.d.ts +8 -5
  215. package/dist/tools/core/agent-delegate.d.ts.map +1 -1
  216. package/dist/tools/core/agent-delegate.js +16 -6
  217. package/dist/tools/core/agent-delegate.js.map +1 -1
  218. package/dist/tools/core/content-browse.d.ts +74 -0
  219. package/dist/tools/core/content-browse.d.ts.map +1 -0
  220. package/dist/tools/core/content-browse.js +63 -0
  221. package/dist/tools/core/content-browse.js.map +1 -0
  222. package/dist/tools/core/content-schema.d.ts +86 -0
  223. package/dist/tools/core/content-schema.d.ts.map +1 -0
  224. package/dist/tools/core/content-schema.js +83 -0
  225. package/dist/tools/core/content-schema.js.map +1 -0
  226. package/dist/tools/core/deps-scan.d.ts +25 -0
  227. package/dist/tools/core/deps-scan.d.ts.map +1 -0
  228. package/dist/tools/core/deps-scan.js +85 -0
  229. package/dist/tools/core/deps-scan.js.map +1 -0
  230. package/dist/tools/core/media.d.ts +18 -2
  231. package/dist/tools/core/media.d.ts.map +1 -1
  232. package/dist/tools/core/media.js +8 -2
  233. package/dist/tools/core/media.js.map +1 -1
  234. package/dist/tools/core/not-found-log.d.ts +44 -0
  235. package/dist/tools/core/not-found-log.d.ts.map +1 -0
  236. package/dist/tools/core/not-found-log.js +32 -0
  237. package/dist/tools/core/not-found-log.js.map +1 -0
  238. package/dist/tools/core/redirects.d.ts +51 -0
  239. package/dist/tools/core/redirects.d.ts.map +1 -0
  240. package/dist/tools/core/redirects.js +50 -0
  241. package/dist/tools/core/redirects.js.map +1 -0
  242. package/package.json +6 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-gaps.js","sourceRoot":"","sources":["../../src/site-plan/structural-gaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAIvC;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAU,CAAA;AA0B7E,MAAM,aAAa,GAA2B;IAC5C;QACE,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,sEAAsE;QAC/E,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE;QACvC,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE;QACtC,MAAM,EAAE;YACN,EAAE,EAAE,8DAA8D;YAClE,EAAE,EAAE,uGAAuG;SAC5G;KACF;IACD;QACE,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,uDAAuD;QAChE,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,kBAAkB,EAAE;QACrD,IAAI,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,kBAAkB,EAAE;QACpD,MAAM,EAAE;YACN,EAAE,EAAE,+EAA+E;YACnF,EAAE,EAAE,6FAA6F;SAClG;KACF;IACD;QACE,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,mFAAmF;QAC5F,KAAK,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,8BAA8B,EAAE;QACnE,IAAI,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,8BAA8B,EAAE;QAClE,MAAM,EAAE;YACN,EAAE,EAAE,gGAAgG;YACpG,EAAE,EAAE,+HAA+H;SACp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,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;YACjC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC"}
@@ -2,6 +2,7 @@ import type { SkinTokens } from '@cogenta/render';
2
2
  import type { CollectionDefinition } from '@cogenta/schema';
3
3
  import type { DocumentFormat } from '../documents/extract-text.js';
4
4
  import type { DetectedConstraint } from './constraints.js';
5
+ import type { StructuralGapSuggestion } from './structural-gaps.js';
5
6
  /**
6
7
  * The shapes L19's four agents pass between each other.
7
8
  *
@@ -80,6 +81,12 @@ export interface SitePlanDraft {
80
81
  readonly demoContent: readonly DemoEntry[];
81
82
  /** What was removed or flagged because it contradicted an explicit constraint. */
82
83
  readonly violations: readonly ConstraintViolation[];
84
+ /**
85
+ * Usual pages this plan, and the site it would join, still lack —
86
+ * contact, a legal notice, a privacy policy (fiche 60 task 5). Its own
87
+ * reviewable section, never applied on its own (R6).
88
+ */
89
+ readonly structuralGaps: readonly StructuralGapSuggestion[];
83
90
  readonly warnings: readonly string[];
84
91
  }
85
92
  export interface ConstraintViolation {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/site-plan/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;;;;;;;;GASG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,UAAU,EAAE,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AA;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAA;IAC3C,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IACxC,QAAQ,CAAC,WAAW,EAAE,SAAS,SAAS,EAAE,CAAA;IAC1C,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACnD;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAA;IACvC,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sGAAsG;IACtG,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
@@ -1,11 +1,29 @@
1
1
  import type { SkillMetadata } from './types.js';
2
2
  /**
3
- * Deliberately not a YAML parser (R9: no new dependency for three flat
3
+ * Deliberately not a YAML parser (R9: no new dependency for a handful of flat
4
4
  * string fields) — `---\nkey: value\n---\nbody`, one `key: value` per line,
5
5
  * nothing nested.
6
+ *
7
+ * `version` is deliberately **not** required (L24 task 4): a real
8
+ * Claude Code/Codex `SKILL.md` — see any `SKILL.md` under this very repo's
9
+ * `.claude/skills/` directory — only ever carries `name` and `description`.
10
+ * Requiring a third field
11
+ * this format doesn't have would refuse the exact copy-paste this task exists
12
+ * to support. `file-store.ts`'s marketplace registry (L7) still writes a
13
+ * `version` (it needs one, to compare installed-vs-available), so this parser
14
+ * keeps reading it when present — it is just never demanded.
6
15
  */
7
16
  export declare function parseSkillFile(path: string, raw: string): {
8
17
  readonly metadata: SkillMetadata;
9
18
  readonly instructions: string;
10
19
  };
20
+ /**
21
+ * The inverse of `parseSkillFile` — renders a skill back to `SKILL.md` text.
22
+ * Used by `library.ts` to write the canonical on-disk form of a skill edited
23
+ * through the structured `AgentSkillStore` contract. Field order (`name`,
24
+ * `description`, then `version` only if present) matches every real
25
+ * Claude Code/Codex skill this project has seen, so a file this function
26
+ * writes reads exactly like one a human would have written by hand.
27
+ */
28
+ export declare function renderSkillFile(metadata: SkillMetadata, instructions: string): string;
11
29
  //# sourceMappingURL=frontmatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/skills/frontmatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAI/C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV;IAAE,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAsCrE"}
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/skills/frontmatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAI/C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV;IAAE,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAsCrE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAKrF"}
@@ -1,9 +1,18 @@
1
1
  import { CogentaError } from '@cogenta/core';
2
- const REQUIRED_FIELDS = ['name', 'version', 'description'];
2
+ const REQUIRED_FIELDS = ['name', 'description'];
3
3
  /**
4
- * Deliberately not a YAML parser (R9: no new dependency for three flat
4
+ * Deliberately not a YAML parser (R9: no new dependency for a handful of flat
5
5
  * string fields) — `---\nkey: value\n---\nbody`, one `key: value` per line,
6
6
  * nothing nested.
7
+ *
8
+ * `version` is deliberately **not** required (L24 task 4): a real
9
+ * Claude Code/Codex `SKILL.md` — see any `SKILL.md` under this very repo's
10
+ * `.claude/skills/` directory — only ever carries `name` and `description`.
11
+ * Requiring a third field
12
+ * this format doesn't have would refuse the exact copy-paste this task exists
13
+ * to support. `file-store.ts`'s marketplace registry (L7) still writes a
14
+ * `version` (it needs one, to compare installed-vs-available), so this parser
15
+ * keeps reading it when present — it is just never demanded.
7
16
  */
8
17
  export function parseSkillFile(path, raw) {
9
18
  const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(raw);
@@ -11,7 +20,7 @@ export function parseSkillFile(path, raw) {
11
20
  throw new CogentaError({
12
21
  code: 'SKILL_DEFINITION_INVALID',
13
22
  message: `"${path}" has no --- frontmatter block.`,
14
- hint: 'Start the file with --- \\n name: ... \\n version: ... \\n description: ... \\n ---',
23
+ hint: 'Start the file with --- \\n name: ... \\n description: ... \\n ---',
15
24
  });
16
25
  }
17
26
  const [, frontmatter = '', body = ''] = match;
@@ -31,16 +40,31 @@ export function parseSkillFile(path, raw) {
31
40
  throw new CogentaError({
32
41
  code: 'SKILL_DEFINITION_INVALID',
33
42
  message: `"${path}" is missing required frontmatter field(s): ${missing.join(', ')}.`,
34
- hint: 'A skill needs name, version and description in its frontmatter.',
43
+ hint: 'A skill needs at least name and description in its frontmatter.',
35
44
  });
36
45
  }
37
46
  return {
38
47
  metadata: {
39
48
  name: fields.name,
40
- version: fields.version,
41
49
  description: fields.description,
50
+ ...(fields.version === undefined ? {} : { version: fields.version }),
42
51
  },
43
52
  instructions: body.trim(),
44
53
  };
45
54
  }
55
+ /**
56
+ * The inverse of `parseSkillFile` — renders a skill back to `SKILL.md` text.
57
+ * Used by `library.ts` to write the canonical on-disk form of a skill edited
58
+ * through the structured `AgentSkillStore` contract. Field order (`name`,
59
+ * `description`, then `version` only if present) matches every real
60
+ * Claude Code/Codex skill this project has seen, so a file this function
61
+ * writes reads exactly like one a human would have written by hand.
62
+ */
63
+ export function renderSkillFile(metadata, instructions) {
64
+ const lines = [`name: ${metadata.name}`, `description: ${metadata.description}`];
65
+ if (metadata.version !== undefined)
66
+ lines.splice(1, 0, `version: ${metadata.version}`);
67
+ const body = instructions.trim();
68
+ return `---\n${lines.join('\n')}\n---\n\n${body}\n`;
69
+ }
46
70
  //# sourceMappingURL=frontmatter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/skills/frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG5C,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAU,CAAA;AAEnE;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,GAAW;IAEX,MAAM,KAAK,GAAG,6CAA6C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACrE,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,YAAY,CAAC;YACrB,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,IAAI,IAAI,iCAAiC;YAClD,IAAI,EAAE,qFAAqF;SAC5F,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,CAAC,EAAE,WAAW,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAA;IAE7C,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,SAAQ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xE,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC,IAAc;YAC3B,WAAW,EAAE,MAAM,CAAC,WAAqB;YACzC,GAAG,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SACrE;QACD,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE;KAC1B,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,QAAuB,EAAE,YAAoB;IAC3E,MAAM,KAAK,GAAG,CAAC,SAAS,QAAQ,CAAC,IAAI,EAAE,EAAE,gBAAgB,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IAChF,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IACtF,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,CAAA;IAChC,OAAO,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAA;AACrD,CAAC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * The standard reference-folder layout (fiche 57), matching the real Claude
3
+ * Code/Anthropic skill convention: sub-folders under a skill's own
4
+ * directory, all optional, `SKILL.md` the only thing required at the root.
5
+ * `references/` is documents consulted on demand, `scripts/` executable
6
+ * utilities, `assets/` templates/images/files used as-is — none of these are
7
+ * automatically read into an agent's context (see `AgentSkillStore`'s module
8
+ * doc for why); they exist for a human, or a future `skill.read_resource`
9
+ * tool, to reach for on purpose.
10
+ */
11
+ export declare const SKILL_RESOURCE_DIRS: readonly ['references', 'scripts', 'assets'];
12
+ export type SkillResourceDir = (typeof SKILL_RESOURCE_DIRS)[number];
13
+ export interface SkillResource {
14
+ /** Relative to the skill's own directory, e.g. `"references/style-guide.md"`. Forward slashes always, on every OS. */
15
+ readonly path: string;
16
+ readonly size: number;
17
+ readonly updatedAt: string;
18
+ }
19
+ /**
20
+ * L22 task 1bis's "Skills" screen — a **different concept** from
21
+ * `skills/file-store.ts`'s `SkillStore`/`Skill`, which is L7's marketplace
22
+ * registry (a signed, distributable folder with resource files, gated by
23
+ * pre-check + review). This one is what the lot actually describes: "un
24
+ * skill est un texte d'instruction nommé... qu'un agent charge dans son
25
+ * contexte" — a short, site-authored piece of prompt text ("comment rédiger
26
+ * un article"), never installed from anywhere, never signed, edited
27
+ * in-place from the admin. Naming it `AgentSkill`/`AgentSkillStore` (this
28
+ * file lives in the same `skills/` directory as the marketplace one on
29
+ * purpose — they are siblings, not a replacement) keeps the two distinct in
30
+ * every import site rather than overloading `Skill`/`SkillStore`.
31
+ *
32
+ * **Storage format, changed in L24 task 4**: originally one JSON file per
33
+ * record (`<id>.json`). Now `<dir>/<id>/SKILL.md` (frontmatter + body),
34
+ * reusing `parseSkillFile`/`renderSkillFile` from `frontmatter.ts` rather
35
+ * than a second parser — the same format `file-store.ts`'s marketplace
36
+ * registry already speaks, and the format a real Claude Code/Codex skill
37
+ * ships in. This is what makes L24 task 4's acceptance criterion possible:
38
+ * a `SKILL.md` copied verbatim from `.claude/skills/` (or any other
39
+ * standard agent) is a valid `name`+`description`+body skill the moment it
40
+ * is dropped into this store's directory and given a matching `.meta.json`
41
+ * (or, read without one at all — see `readRecord` below).
42
+ *
43
+ * The fields this store needs that a portable `SKILL.md` has no room for
44
+ * (`enabledByDefault`, `builtin`, `createdAt`, `updatedAt`) are **not**
45
+ * folded into the frontmatter. Two options were open here (see
46
+ * `docs/lots/L24-langgraph-agents-avances.md` task 4): extra frontmatter
47
+ * keys (the parser already ignores keys it does not know), or a sidecar
48
+ * meta file. This store picks the sidecar (`.meta.json`, next to
49
+ * `SKILL.md`) **on purpose**: the whole point of this migration is
50
+ * portability — a skill authored here should export as a clean `SKILL.md`
51
+ * with nothing Cogenta-specific in it, and a `SKILL.md` imported here
52
+ * should not have its author's own frontmatter fields overwritten by this
53
+ * store's bookkeeping. Gluing `enabledByDefault`/`builtin`/timestamps into
54
+ * the frontmatter would make every skill this store ever touches carry
55
+ * Cogenta-only keys forever, defeating that.
56
+ */
57
+ export interface AgentSkill {
58
+ readonly id: string;
59
+ readonly name: string;
60
+ readonly description: string;
61
+ readonly instructions: string;
62
+ /**
63
+ * The exact `SKILL.md` text on disk (frontmatter + body), rendered by
64
+ * `renderSkillFile` — what the admin's raw-Markdown editor (L24 task 4)
65
+ * reads and writes, and what a "copy this skill out" action would hand
66
+ * someone verbatim. Always the canonical rendering of `name`/`description`/
67
+ * `instructions` below: this store has one source of truth (the structured
68
+ * fields on `AgentSkillStore`'s contract, kept stable for its 11 existing
69
+ * call sites), and `content` is a derived, always-consistent view of it —
70
+ * never a second, independently-edited copy that could drift.
71
+ */
72
+ readonly content: string;
73
+ /**
74
+ * "Par défaut, un nouvel agent hérite de tous les skills du site" (L22 task
75
+ * 1bis) — a new agent's `AgentDeclaration.skills` is seeded with every
76
+ * skill whose `enabledByDefault` is true at the moment it is created
77
+ * (`agents/orchestrator.ts`'s creation path reads this), so the field stays
78
+ * a plain inclusion list (contract C's own documented shape) while still
79
+ * producing the lot's "inherit everything, exclude what you don't want"
80
+ * behaviour from the admin's point of view.
81
+ */
82
+ readonly enabledByDefault: boolean;
83
+ readonly builtin: boolean;
84
+ readonly createdAt: string;
85
+ readonly updatedAt: string;
86
+ }
87
+ export interface AgentSkillInput {
88
+ readonly name: string;
89
+ readonly description: string;
90
+ readonly instructions: string;
91
+ readonly enabledByDefault?: boolean;
92
+ }
93
+ export type AgentSkillPatch = Partial<AgentSkillInput>;
94
+ export interface AgentSkillStore {
95
+ list(): Promise<readonly AgentSkill[]>;
96
+ get(id: string): Promise<AgentSkill | undefined>;
97
+ create(input: AgentSkillInput, builtin?: boolean): Promise<AgentSkill>;
98
+ update(id: string, patch: AgentSkillPatch): Promise<AgentSkill>;
99
+ /** Refuses to remove a builtin (`AGENT_SKILL_BUILTIN_UNDELETABLE`). */
100
+ remove(id: string): Promise<void>;
101
+ /**
102
+ * Every file under the skill's directory except `SKILL.md`/`.meta.json` —
103
+ * `references/`, `scripts/`, `assets/`, and (for a skill imported from
104
+ * outside this store, which never had to follow the standard layout) any
105
+ * other file that happens to sit there too. Throws `AGENT_SKILL_UNKNOWN`
106
+ * for an unknown id. A skill created before this fiche, with no
107
+ * sub-folders yet, returns an empty list — never an error.
108
+ */
109
+ listResources(id: string): Promise<readonly SkillResource[]>;
110
+ /**
111
+ * Writes (or overwrites) a reference file. `relativePath` must start with
112
+ * one of `SKILL_RESOURCE_DIRS` — anything else, or a path that tries to
113
+ * escape the skill's own directory, is refused with
114
+ * `AGENT_SKILL_RESOURCE_INVALID`. Throws `AGENT_SKILL_UNKNOWN` for an
115
+ * unknown skill id.
116
+ */
117
+ addResource(id: string, relativePath: string, content: string | Uint8Array): Promise<SkillResource>;
118
+ /**
119
+ * Throws `AGENT_SKILL_RESOURCE_INVALID` for a path outside the three
120
+ * standard folders, `AGENT_SKILL_RESOURCE_UNKNOWN` for a path that names
121
+ * no file, and `AGENT_SKILL_UNKNOWN` for an unknown skill id.
122
+ */
123
+ removeResource(id: string, relativePath: string): Promise<void>;
124
+ }
125
+ export interface FileAgentSkillStoreOptions {
126
+ readonly dir: string;
127
+ readonly now?: () => Date;
128
+ }
129
+ export declare function createFileAgentSkillStore(options: FileAgentSkillStoreOptions): AgentSkillStore;
130
+ /** L22 task 1bis: "au minimum ces trois" — content writing, a basic security review, and site-structure/menu management. */
131
+ export declare function builtinAgentSkillSeeds(): readonly AgentSkillInput[];
132
+ export declare function ensureBuiltinAgentSkills(store: AgentSkillStore): Promise<void>;
133
+ //# sourceMappingURL=library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/skills/library.ts"],"names":[],"mappings":"AASA;;;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tC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAChD,MAAM,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACtE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC/D,uEAAuE;IACvE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAA;IAC5D;;;;;;OAMG;IACH,WAAW,CACT,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GAAG,UAAU,GAC3B,OAAO,CAAC,aAAa,CAAC,CAAA;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChE;AAiED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;CAC1B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,eAAe,CA6O9F;AAED,4HAA4H;AAC5H,wBAAgB,sBAAsB,IAAI,SAAS,eAAe,EAAE,CAkCnE;AAED,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpF"}
@@ -0,0 +1,332 @@
1
+ import { mkdir, readdir, readFile, rm, stat, writeFile } from 'node:fs/promises';
2
+ import { dirname, join, relative } from 'node:path';
3
+ import { CogentaError } from '@cogenta/core';
4
+ import { parseSkillFile, renderSkillFile } from './frontmatter.js';
5
+ const SKILL_FILE = 'SKILL.md';
6
+ const META_FILE = '.meta.json';
7
+ /**
8
+ * The standard reference-folder layout (fiche 57), matching the real Claude
9
+ * Code/Anthropic skill convention: sub-folders under a skill's own
10
+ * directory, all optional, `SKILL.md` the only thing required at the root.
11
+ * `references/` is documents consulted on demand, `scripts/` executable
12
+ * utilities, `assets/` templates/images/files used as-is — none of these are
13
+ * automatically read into an agent's context (see `AgentSkillStore`'s module
14
+ * doc for why); they exist for a human, or a future `skill.read_resource`
15
+ * tool, to reach for on purpose.
16
+ */
17
+ export const SKILL_RESOURCE_DIRS = ['references', 'scripts', 'assets'];
18
+ function slugify(name) {
19
+ const slug = name
20
+ .toLowerCase()
21
+ .normalize('NFKD')
22
+ .replace(/[\u0300-\u036f]/gu, '')
23
+ .replace(/[^a-z0-9]+/gu, '-')
24
+ .replace(/^-+|-+$/gu, '');
25
+ return slug.length > 0 ? slug : 'skill';
26
+ }
27
+ function skillUnknown(id) {
28
+ return new CogentaError({
29
+ code: 'AGENT_SKILL_UNKNOWN',
30
+ message: `No skill with id "${id}".`,
31
+ hint: 'Check the id against `list()`, or create it first.',
32
+ });
33
+ }
34
+ function resourcePathInvalid(relativePath) {
35
+ return new CogentaError({
36
+ code: 'AGENT_SKILL_RESOURCE_INVALID',
37
+ message: `"${relativePath}" is not a valid resource path.`,
38
+ hint: `A resource path must be "<folder>/<file>" where <folder> is one of: ${SKILL_RESOURCE_DIRS.join(', ')}.`,
39
+ });
40
+ }
41
+ function resourceUnknown(id, relativePath) {
42
+ return new CogentaError({
43
+ code: 'AGENT_SKILL_RESOURCE_UNKNOWN',
44
+ message: `No resource "${relativePath}" on skill "${id}".`,
45
+ hint: 'Check the path against `listResources()`.',
46
+ });
47
+ }
48
+ /**
49
+ * Validates and normalises a caller-supplied resource path into the segments
50
+ * `join()` should use. Refuses anything that is not "<one of the three
51
+ * standard dirs>/<at least one more segment>" — no bare dir, no `.`/`..`
52
+ * segment (which is what actually matters: it is what would let a caller
53
+ * escape the skill's own directory; the standard-dir prefix check on its own
54
+ * would not catch `references/../../../etc/passwd`).
55
+ */
56
+ function resourceSegments(relativePath) {
57
+ const normalised = relativePath.replaceAll('\\', '/').trim();
58
+ const segments = normalised.split('/').filter((segment) => segment.length > 0);
59
+ const [first, ...rest] = segments;
60
+ if (first === undefined || rest.length === 0)
61
+ throw resourcePathInvalid(relativePath);
62
+ if (!SKILL_RESOURCE_DIRS.includes(first)) {
63
+ throw resourcePathInvalid(relativePath);
64
+ }
65
+ if (segments.some((segment) => segment === '.' || segment === '..')) {
66
+ throw resourcePathInvalid(relativePath);
67
+ }
68
+ return segments;
69
+ }
70
+ export function createFileAgentSkillStore(options) {
71
+ const now = options.now ?? (() => new Date());
72
+ const ready = mkdir(options.dir, { recursive: true });
73
+ function dirFor(id) {
74
+ return join(options.dir, id);
75
+ }
76
+ function skillFileFor(id) {
77
+ return join(dirFor(id), SKILL_FILE);
78
+ }
79
+ function metaFileFor(id) {
80
+ return join(dirFor(id), META_FILE);
81
+ }
82
+ /**
83
+ * Reads a skill without ever failing on a missing `.meta.json` — a folder
84
+ * dropped in by hand (a `SKILL.md` copied straight from `.claude/skills/`,
85
+ * exactly what L24 task 4's acceptance test does) is a perfectly good
86
+ * skill, just one this store has never seen before; it gets the same
87
+ * defaults `create()` would give a new one, and a `.meta.json` is written
88
+ * back the next time it is updated. A `.meta.json` that exists but will
89
+ * not parse *is* treated as corruption, and reported as such.
90
+ */
91
+ async function readMeta(id) {
92
+ try {
93
+ const raw = await readFile(metaFileFor(id), 'utf8');
94
+ return JSON.parse(raw);
95
+ }
96
+ catch (error) {
97
+ if (error.code === 'ENOENT') {
98
+ const at = now().toISOString();
99
+ return { enabledByDefault: true, builtin: false, createdAt: at, updatedAt: at };
100
+ }
101
+ throw new CogentaError({
102
+ code: 'INTERNAL',
103
+ message: `Could not read metadata for skill "${id}".`,
104
+ hint: 'The .meta.json file may be corrupted; consider removing and recreating the skill.',
105
+ cause: error,
106
+ });
107
+ }
108
+ }
109
+ async function readRecord(id) {
110
+ let raw;
111
+ try {
112
+ raw = await readFile(skillFileFor(id), 'utf8');
113
+ }
114
+ catch (error) {
115
+ if (error.code === 'ENOENT')
116
+ return null;
117
+ throw new CogentaError({
118
+ code: 'INTERNAL',
119
+ message: `Could not read skill record "${id}".`,
120
+ hint: 'The file may be corrupted; consider removing it.',
121
+ cause: error,
122
+ });
123
+ }
124
+ const { metadata, instructions } = parseSkillFile(skillFileFor(id), raw);
125
+ const meta = await readMeta(id);
126
+ return {
127
+ id,
128
+ name: metadata.name,
129
+ description: metadata.description,
130
+ instructions,
131
+ content: raw,
132
+ enabledByDefault: meta.enabledByDefault,
133
+ builtin: meta.builtin,
134
+ createdAt: meta.createdAt,
135
+ updatedAt: meta.updatedAt,
136
+ };
137
+ }
138
+ async function writeRecord(id, metadata, instructions, meta) {
139
+ await mkdir(dirFor(id), { recursive: true });
140
+ const content = renderSkillFile(metadata, instructions);
141
+ await writeFile(skillFileFor(id), content, 'utf8');
142
+ await writeFile(metaFileFor(id), JSON.stringify(meta, null, 2), 'utf8');
143
+ return {
144
+ id,
145
+ name: metadata.name,
146
+ description: metadata.description,
147
+ instructions: instructions.trim(),
148
+ content,
149
+ ...meta,
150
+ };
151
+ }
152
+ return {
153
+ async list() {
154
+ await ready;
155
+ const entries = await readdir(options.dir, { withFileTypes: true }).catch(() => []);
156
+ const skills = [];
157
+ for (const entry of entries) {
158
+ if (!entry.isDirectory())
159
+ continue;
160
+ try {
161
+ const record = await readRecord(entry.name);
162
+ if (record !== null)
163
+ skills.push(record);
164
+ }
165
+ catch {
166
+ // A folder without a valid SKILL.md (or with a corrupted sidecar)
167
+ // is not a skill this store can serve — skip it rather than fail
168
+ // the whole listing, same posture as the marketplace's
169
+ // `file-store.ts`.
170
+ }
171
+ }
172
+ return skills.sort((a, b) => a.name.localeCompare(b.name));
173
+ },
174
+ async get(id) {
175
+ await ready;
176
+ const record = await readRecord(id);
177
+ return record ?? undefined;
178
+ },
179
+ async create(input, builtin = false) {
180
+ await ready;
181
+ const id = slugify(input.name);
182
+ const existing = await readRecord(id);
183
+ if (existing !== null) {
184
+ throw new CogentaError({
185
+ code: 'AGENT_SKILL_DUPLICATE',
186
+ message: `A skill named "${input.name}" already exists.`,
187
+ hint: 'Choose a different name, or edit the existing skill instead.',
188
+ });
189
+ }
190
+ const at = now().toISOString();
191
+ const created = await writeRecord(id, { name: input.name, description: input.description }, input.instructions, {
192
+ enabledByDefault: input.enabledByDefault ?? true,
193
+ builtin,
194
+ createdAt: at,
195
+ updatedAt: at,
196
+ });
197
+ // Standard reference-folder layout (fiche 57 task 1) — created empty,
198
+ // alongside SKILL.md/.meta.json, so the admin's "Reference files"
199
+ // section always has somewhere real to upload into.
200
+ await Promise.all(SKILL_RESOURCE_DIRS.map((resourceDir) => mkdir(join(dirFor(id), resourceDir), { recursive: true })));
201
+ return created;
202
+ },
203
+ async update(id, patch) {
204
+ await ready;
205
+ const existing = await readRecord(id);
206
+ if (existing === null)
207
+ throw skillUnknown(id);
208
+ return writeRecord(id, {
209
+ name: patch.name ?? existing.name,
210
+ description: patch.description ?? existing.description,
211
+ }, patch.instructions ?? existing.instructions, {
212
+ enabledByDefault: patch.enabledByDefault ?? existing.enabledByDefault,
213
+ builtin: existing.builtin,
214
+ createdAt: existing.createdAt,
215
+ updatedAt: now().toISOString(),
216
+ });
217
+ },
218
+ async remove(id) {
219
+ await ready;
220
+ const existing = await readRecord(id);
221
+ if (existing === null)
222
+ throw skillUnknown(id);
223
+ if (existing.builtin) {
224
+ throw new CogentaError({
225
+ code: 'AGENT_SKILL_BUILTIN_UNDELETABLE',
226
+ message: `"${existing.name}" is a built-in skill and cannot be removed.`,
227
+ hint: 'Edit its instructions instead, or exclude it from a specific agent.',
228
+ });
229
+ }
230
+ await rm(dirFor(id), { recursive: true, force: true });
231
+ },
232
+ async listResources(id) {
233
+ await ready;
234
+ const existing = await readRecord(id);
235
+ if (existing === null)
236
+ throw skillUnknown(id);
237
+ const skillDir = dirFor(id);
238
+ const entries = await readdir(skillDir, { withFileTypes: true, recursive: true }).catch(() => []);
239
+ const resources = [];
240
+ for (const entry of entries) {
241
+ if (!entry.isFile())
242
+ continue;
243
+ const absolute = join(entry.parentPath, entry.name);
244
+ const relativePath = relative(skillDir, absolute).replaceAll('\\', '/');
245
+ if (relativePath === SKILL_FILE || relativePath === META_FILE)
246
+ continue;
247
+ const info = await stat(absolute);
248
+ resources.push({ path: relativePath, size: info.size, updatedAt: info.mtime.toISOString() });
249
+ }
250
+ return resources.sort((a, b) => a.path.localeCompare(b.path));
251
+ },
252
+ async addResource(id, relativePath, content) {
253
+ await ready;
254
+ const existing = await readRecord(id);
255
+ if (existing === null)
256
+ throw skillUnknown(id);
257
+ const segments = resourceSegments(relativePath);
258
+ const target = join(dirFor(id), ...segments);
259
+ await mkdir(dirname(target), { recursive: true });
260
+ if (typeof content === 'string') {
261
+ await writeFile(target, content, 'utf8');
262
+ }
263
+ else {
264
+ await writeFile(target, content);
265
+ }
266
+ const info = await stat(target);
267
+ return { path: segments.join('/'), size: info.size, updatedAt: info.mtime.toISOString() };
268
+ },
269
+ async removeResource(id, relativePath) {
270
+ await ready;
271
+ const existing = await readRecord(id);
272
+ if (existing === null)
273
+ throw skillUnknown(id);
274
+ const segments = resourceSegments(relativePath);
275
+ const target = join(dirFor(id), ...segments);
276
+ try {
277
+ await rm(target);
278
+ }
279
+ catch (error) {
280
+ if (error.code === 'ENOENT') {
281
+ throw resourceUnknown(id, relativePath);
282
+ }
283
+ throw error;
284
+ }
285
+ },
286
+ };
287
+ }
288
+ /** L22 task 1bis: "au minimum ces trois" — content writing, a basic security review, and site-structure/menu management. */
289
+ export function builtinAgentSkillSeeds() {
290
+ return [
291
+ {
292
+ name: 'Content writing',
293
+ description: 'How to write and edit site content in this CMS’s voice.',
294
+ instructions: [
295
+ 'Write in clear, concise prose. Prefer short paragraphs and active voice.',
296
+ 'Match the tone already used by the site’s existing published content when you can see it.',
297
+ 'Never invent facts about the site, its products, or its people — if you do not know, say so or ask.',
298
+ 'When proposing a draft, give it a real title and, where the collection has one, a short excerpt.',
299
+ ].join('\n'),
300
+ enabledByDefault: true,
301
+ },
302
+ {
303
+ name: 'Basic security review',
304
+ description: 'How to read a dependency scan and report findings without alarmism.',
305
+ instructions: [
306
+ 'When reviewing deps.scan output, group findings by package and explain in one line why an unpinned version is a risk (the next install can silently change behaviour).',
307
+ 'Never claim a specific vulnerability exists unless a tool result actually named one.',
308
+ 'Recommend pinning to the currently installed version as the safest default fix.',
309
+ ].join('\n'),
310
+ enabledByDefault: true,
311
+ },
312
+ {
313
+ name: 'Site structure and menus',
314
+ description: 'How to reason about this site’s navigation and information architecture.',
315
+ instructions: [
316
+ 'Before proposing a menu or structure change, read the site’s current collections and their routes.',
317
+ 'Keep navigation shallow — prefer two levels over three where the content allows it.',
318
+ 'Never remove an existing menu entry without saying so explicitly in your summary.',
319
+ ].join('\n'),
320
+ enabledByDefault: true,
321
+ },
322
+ ];
323
+ }
324
+ export async function ensureBuiltinAgentSkills(store) {
325
+ const existing = await store.list();
326
+ const byName = new Set(existing.map((skill) => skill.name));
327
+ for (const seed of builtinAgentSkillSeeds()) {
328
+ if (!byName.has(seed.name))
329
+ await store.create(seed, true);
330
+ }
331
+ }
332
+ //# sourceMappingURL=library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/skills/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGlE,MAAM,UAAU,GAAG,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