@cogenta/agents 0.1.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 (293) hide show
  1. package/dist/agents/define.d.ts +9 -0
  2. package/dist/agents/define.d.ts.map +1 -0
  3. package/dist/agents/define.js +25 -0
  4. package/dist/agents/define.js.map +1 -0
  5. package/dist/agents/registry.d.ts +29 -0
  6. package/dist/agents/registry.d.ts.map +1 -0
  7. package/dist/agents/registry.js +50 -0
  8. package/dist/agents/registry.js.map +1 -0
  9. package/dist/agents/types.d.ts +36 -0
  10. package/dist/agents/types.d.ts.map +1 -0
  11. package/dist/agents/types.js +2 -0
  12. package/dist/agents/types.js.map +1 -0
  13. package/dist/audit/types.d.ts +23 -0
  14. package/dist/audit/types.d.ts.map +1 -0
  15. package/dist/audit/types.js +2 -0
  16. package/dist/audit/types.js.map +1 -0
  17. package/dist/audit/with-audit.d.ts +34 -0
  18. package/dist/audit/with-audit.d.ts.map +1 -0
  19. package/dist/audit/with-audit.js +65 -0
  20. package/dist/audit/with-audit.js.map +1 -0
  21. package/dist/autonomy/approval-queue.d.ts +13 -0
  22. package/dist/autonomy/approval-queue.d.ts.map +1 -0
  23. package/dist/autonomy/approval-queue.js +56 -0
  24. package/dist/autonomy/approval-queue.js.map +1 -0
  25. package/dist/autonomy/types.d.ts +36 -0
  26. package/dist/autonomy/types.d.ts.map +1 -0
  27. package/dist/autonomy/types.js +2 -0
  28. package/dist/autonomy/types.js.map +1 -0
  29. package/dist/autonomy/with-autonomy.d.ts +25 -0
  30. package/dist/autonomy/with-autonomy.d.ts.map +1 -0
  31. package/dist/autonomy/with-autonomy.js +77 -0
  32. package/dist/autonomy/with-autonomy.js.map +1 -0
  33. package/dist/budget/kill-switch.d.ts +14 -0
  34. package/dist/budget/kill-switch.d.ts.map +1 -0
  35. package/dist/budget/kill-switch.js +20 -0
  36. package/dist/budget/kill-switch.js.map +1 -0
  37. package/dist/budget/tracker.d.ts +15 -0
  38. package/dist/budget/tracker.d.ts.map +1 -0
  39. package/dist/budget/tracker.js +68 -0
  40. package/dist/budget/tracker.js.map +1 -0
  41. package/dist/budget/types.d.ts +35 -0
  42. package/dist/budget/types.d.ts.map +1 -0
  43. package/dist/budget/types.js +2 -0
  44. package/dist/budget/types.js.map +1 -0
  45. package/dist/eval/assert-threshold.d.ts +15 -0
  46. package/dist/eval/assert-threshold.d.ts.map +1 -0
  47. package/dist/eval/assert-threshold.js +27 -0
  48. package/dist/eval/assert-threshold.js.map +1 -0
  49. package/dist/eval/compare-prompt-versions.d.ts +17 -0
  50. package/dist/eval/compare-prompt-versions.d.ts.map +1 -0
  51. package/dist/eval/compare-prompt-versions.js +20 -0
  52. package/dist/eval/compare-prompt-versions.js.map +1 -0
  53. package/dist/eval/run-suite.d.ts +4 -0
  54. package/dist/eval/run-suite.d.ts.map +1 -0
  55. package/dist/eval/run-suite.js +18 -0
  56. package/dist/eval/run-suite.js.map +1 -0
  57. package/dist/eval/scorers.d.ts +13 -0
  58. package/dist/eval/scorers.d.ts.map +1 -0
  59. package/dist/eval/scorers.js +33 -0
  60. package/dist/eval/scorers.js.map +1 -0
  61. package/dist/eval/types.d.ts +27 -0
  62. package/dist/eval/types.d.ts.map +1 -0
  63. package/dist/eval/types.js +2 -0
  64. package/dist/eval/types.js.map +1 -0
  65. package/dist/identity/constitution.d.ts +17 -0
  66. package/dist/identity/constitution.d.ts.map +1 -0
  67. package/dist/identity/constitution.js +33 -0
  68. package/dist/identity/constitution.js.map +1 -0
  69. package/dist/identity/context.d.ts +49 -0
  70. package/dist/identity/context.d.ts.map +1 -0
  71. package/dist/identity/context.js +67 -0
  72. package/dist/identity/context.js.map +1 -0
  73. package/dist/index.d.ts +99 -0
  74. package/dist/index.d.ts.map +1 -0
  75. package/dist/index.js +55 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/memory/file-store.d.ts +6 -0
  78. package/dist/memory/file-store.d.ts.map +1 -0
  79. package/dist/memory/file-store.js +94 -0
  80. package/dist/memory/file-store.js.map +1 -0
  81. package/dist/memory/from-approval.d.ts +20 -0
  82. package/dist/memory/from-approval.d.ts.map +1 -0
  83. package/dist/memory/from-approval.js +38 -0
  84. package/dist/memory/from-approval.js.map +1 -0
  85. package/dist/memory/memory-store.d.ts +4 -0
  86. package/dist/memory/memory-store.d.ts.map +1 -0
  87. package/dist/memory/memory-store.js +55 -0
  88. package/dist/memory/memory-store.js.map +1 -0
  89. package/dist/memory/types.d.ts +67 -0
  90. package/dist/memory/types.d.ts.map +1 -0
  91. package/dist/memory/types.js +2 -0
  92. package/dist/memory/types.js.map +1 -0
  93. package/dist/privacy/assert-provider-allowed.d.ts +10 -0
  94. package/dist/privacy/assert-provider-allowed.d.ts.map +1 -0
  95. package/dist/privacy/assert-provider-allowed.js +20 -0
  96. package/dist/privacy/assert-provider-allowed.js.map +1 -0
  97. package/dist/privacy/redact-fields.d.ts +11 -0
  98. package/dist/privacy/redact-fields.d.ts.map +1 -0
  99. package/dist/privacy/redact-fields.js +26 -0
  100. package/dist/privacy/redact-fields.js.map +1 -0
  101. package/dist/privacy/redact-text.d.ts +4 -0
  102. package/dist/privacy/redact-text.d.ts.map +1 -0
  103. package/dist/privacy/redact-text.js +26 -0
  104. package/dist/privacy/redact-text.js.map +1 -0
  105. package/dist/privacy/types.d.ts +23 -0
  106. package/dist/privacy/types.d.ts.map +1 -0
  107. package/dist/privacy/types.js +2 -0
  108. package/dist/privacy/types.js.map +1 -0
  109. package/dist/providers/anthropic.d.ts +57 -0
  110. package/dist/providers/anthropic.d.ts.map +1 -0
  111. package/dist/providers/anthropic.js +130 -0
  112. package/dist/providers/anthropic.js.map +1 -0
  113. package/dist/providers/google.d.ts +63 -0
  114. package/dist/providers/google.d.ts.map +1 -0
  115. package/dist/providers/google.js +144 -0
  116. package/dist/providers/google.js.map +1 -0
  117. package/dist/providers/openai.d.ts +56 -0
  118. package/dist/providers/openai.d.ts.map +1 -0
  119. package/dist/providers/openai.js +143 -0
  120. package/dist/providers/openai.js.map +1 -0
  121. package/dist/providers/registry.d.ts +31 -0
  122. package/dist/providers/registry.d.ts.map +1 -0
  123. package/dist/providers/registry.js +35 -0
  124. package/dist/providers/registry.js.map +1 -0
  125. package/dist/providers/types.d.ts +63 -0
  126. package/dist/providers/types.d.ts.map +1 -0
  127. package/dist/providers/types.js +10 -0
  128. package/dist/providers/types.js.map +1 -0
  129. package/dist/rag/chunking/chunk-document.d.ts +13 -0
  130. package/dist/rag/chunking/chunk-document.d.ts.map +1 -0
  131. package/dist/rag/chunking/chunk-document.js +51 -0
  132. package/dist/rag/chunking/chunk-document.js.map +1 -0
  133. package/dist/rag/chunking/incremental.d.ts +19 -0
  134. package/dist/rag/chunking/incremental.d.ts.map +1 -0
  135. package/dist/rag/chunking/incremental.js +24 -0
  136. package/dist/rag/chunking/incremental.js.map +1 -0
  137. package/dist/rag/chunking/types.d.ts +34 -0
  138. package/dist/rag/chunking/types.d.ts.map +1 -0
  139. package/dist/rag/chunking/types.js +2 -0
  140. package/dist/rag/chunking/types.js.map +1 -0
  141. package/dist/rag/embeddings/hashing-provider.d.ts +22 -0
  142. package/dist/rag/embeddings/hashing-provider.d.ts.map +1 -0
  143. package/dist/rag/embeddings/hashing-provider.js +53 -0
  144. package/dist/rag/embeddings/hashing-provider.js.map +1 -0
  145. package/dist/rag/embeddings/types.d.ts +16 -0
  146. package/dist/rag/embeddings/types.d.ts.map +1 -0
  147. package/dist/rag/embeddings/types.js +2 -0
  148. package/dist/rag/embeddings/types.js.map +1 -0
  149. package/dist/rag/index/bm25.d.ts +4 -0
  150. package/dist/rag/index/bm25.d.ts.map +1 -0
  151. package/dist/rag/index/bm25.js +38 -0
  152. package/dist/rag/index/bm25.js.map +1 -0
  153. package/dist/rag/index/memory-index.d.ts +12 -0
  154. package/dist/rag/index/memory-index.d.ts.map +1 -0
  155. package/dist/rag/index/memory-index.js +44 -0
  156. package/dist/rag/index/memory-index.js.map +1 -0
  157. package/dist/rag/index/rrf.d.ts +9 -0
  158. package/dist/rag/index/rrf.d.ts.map +1 -0
  159. package/dist/rag/index/rrf.js +20 -0
  160. package/dist/rag/index/rrf.js.map +1 -0
  161. package/dist/rag/index/types.d.ts +48 -0
  162. package/dist/rag/index/types.d.ts.map +1 -0
  163. package/dist/rag/index/types.js +2 -0
  164. package/dist/rag/index/types.js.map +1 -0
  165. package/dist/rag/index/vector-rank.d.ts +4 -0
  166. package/dist/rag/index/vector-rank.d.ts.map +1 -0
  167. package/dist/rag/index/vector-rank.js +27 -0
  168. package/dist/rag/index/vector-rank.js.map +1 -0
  169. package/dist/reversibility/diff.d.ts +17 -0
  170. package/dist/reversibility/diff.d.ts.map +1 -0
  171. package/dist/reversibility/diff.js +39 -0
  172. package/dist/reversibility/diff.js.map +1 -0
  173. package/dist/reversibility/receipt-store.d.ts +9 -0
  174. package/dist/reversibility/receipt-store.d.ts.map +1 -0
  175. package/dist/reversibility/receipt-store.js +34 -0
  176. package/dist/reversibility/receipt-store.js.map +1 -0
  177. package/dist/reversibility/revert.d.ts +18 -0
  178. package/dist/reversibility/revert.d.ts.map +1 -0
  179. package/dist/reversibility/revert.js +38 -0
  180. package/dist/reversibility/revert.js.map +1 -0
  181. package/dist/reversibility/types.d.ts +25 -0
  182. package/dist/reversibility/types.d.ts.map +1 -0
  183. package/dist/reversibility/types.js +2 -0
  184. package/dist/reversibility/types.js.map +1 -0
  185. package/dist/reversibility/with-receipts.d.ts +19 -0
  186. package/dist/reversibility/with-receipts.d.ts.map +1 -0
  187. package/dist/reversibility/with-receipts.js +35 -0
  188. package/dist/reversibility/with-receipts.js.map +1 -0
  189. package/dist/runtime/loop.d.ts +11 -0
  190. package/dist/runtime/loop.d.ts.map +1 -0
  191. package/dist/runtime/loop.js +116 -0
  192. package/dist/runtime/loop.js.map +1 -0
  193. package/dist/runtime/repetition.d.ts +16 -0
  194. package/dist/runtime/repetition.d.ts.map +1 -0
  195. package/dist/runtime/repetition.js +38 -0
  196. package/dist/runtime/repetition.js.map +1 -0
  197. package/dist/runtime/retry.d.ts +22 -0
  198. package/dist/runtime/retry.d.ts.map +1 -0
  199. package/dist/runtime/retry.js +69 -0
  200. package/dist/runtime/retry.js.map +1 -0
  201. package/dist/runtime/types.d.ts +78 -0
  202. package/dist/runtime/types.d.ts.map +1 -0
  203. package/dist/runtime/types.js +2 -0
  204. package/dist/runtime/types.js.map +1 -0
  205. package/dist/sandbox/types.d.ts +20 -0
  206. package/dist/sandbox/types.d.ts.map +1 -0
  207. package/dist/sandbox/types.js +2 -0
  208. package/dist/sandbox/types.js.map +1 -0
  209. package/dist/sandbox/with-sandbox.d.ts +26 -0
  210. package/dist/sandbox/with-sandbox.d.ts.map +1 -0
  211. package/dist/sandbox/with-sandbox.js +41 -0
  212. package/dist/sandbox/with-sandbox.js.map +1 -0
  213. package/dist/skills/file-store.d.ts +13 -0
  214. package/dist/skills/file-store.d.ts.map +1 -0
  215. package/dist/skills/file-store.js +73 -0
  216. package/dist/skills/file-store.js.map +1 -0
  217. package/dist/skills/frontmatter.d.ts +11 -0
  218. package/dist/skills/frontmatter.d.ts.map +1 -0
  219. package/dist/skills/frontmatter.js +46 -0
  220. package/dist/skills/frontmatter.js.map +1 -0
  221. package/dist/skills/types.d.ts +19 -0
  222. package/dist/skills/types.d.ts.map +1 -0
  223. package/dist/skills/types.js +2 -0
  224. package/dist/skills/types.js.map +1 -0
  225. package/dist/skin/generate.d.ts +22 -0
  226. package/dist/skin/generate.d.ts.map +1 -0
  227. package/dist/skin/generate.js +144 -0
  228. package/dist/skin/generate.js.map +1 -0
  229. package/dist/subagents/run-subagent.d.ts +10 -0
  230. package/dist/subagents/run-subagent.d.ts.map +1 -0
  231. package/dist/subagents/run-subagent.js +24 -0
  232. package/dist/subagents/run-subagent.js.map +1 -0
  233. package/dist/subagents/types.d.ts +13 -0
  234. package/dist/subagents/types.d.ts.map +1 -0
  235. package/dist/subagents/types.js +2 -0
  236. package/dist/subagents/types.js.map +1 -0
  237. package/dist/subagents/validate.d.ts +8 -0
  238. package/dist/subagents/validate.d.ts.map +1 -0
  239. package/dist/subagents/validate.js +32 -0
  240. package/dist/subagents/validate.js.map +1 -0
  241. package/dist/tools/core/agent-delegate.d.ts +34 -0
  242. package/dist/tools/core/agent-delegate.d.ts.map +1 -0
  243. package/dist/tools/core/agent-delegate.js +41 -0
  244. package/dist/tools/core/agent-delegate.js.map +1 -0
  245. package/dist/tools/core/content.d.ts +81 -0
  246. package/dist/tools/core/content.d.ts.map +1 -0
  247. package/dist/tools/core/content.js +121 -0
  248. package/dist/tools/core/content.js.map +1 -0
  249. package/dist/tools/core/http-fetch.d.ts +33 -0
  250. package/dist/tools/core/http-fetch.d.ts.map +1 -0
  251. package/dist/tools/core/http-fetch.js +63 -0
  252. package/dist/tools/core/http-fetch.js.map +1 -0
  253. package/dist/tools/core/media.d.ts +38 -0
  254. package/dist/tools/core/media.d.ts.map +1 -0
  255. package/dist/tools/core/media.js +93 -0
  256. package/dist/tools/core/media.js.map +1 -0
  257. package/dist/tools/core/site-config.d.ts +19 -0
  258. package/dist/tools/core/site-config.d.ts.map +1 -0
  259. package/dist/tools/core/site-config.js +37 -0
  260. package/dist/tools/core/site-config.js.map +1 -0
  261. package/dist/tools/define.d.ts +12 -0
  262. package/dist/tools/define.d.ts.map +1 -0
  263. package/dist/tools/define.js +28 -0
  264. package/dist/tools/define.js.map +1 -0
  265. package/dist/tools/manifest.d.ts +19 -0
  266. package/dist/tools/manifest.d.ts.map +1 -0
  267. package/dist/tools/manifest.js +70 -0
  268. package/dist/tools/manifest.js.map +1 -0
  269. package/dist/tools/registry.d.ts +8 -0
  270. package/dist/tools/registry.d.ts.map +1 -0
  271. package/dist/tools/registry.js +20 -0
  272. package/dist/tools/registry.js.map +1 -0
  273. package/dist/tools/types.d.ts +51 -0
  274. package/dist/tools/types.d.ts.map +1 -0
  275. package/dist/tools/types.js +2 -0
  276. package/dist/tools/types.js.map +1 -0
  277. package/dist/trace/capture.d.ts +19 -0
  278. package/dist/trace/capture.d.ts.map +1 -0
  279. package/dist/trace/capture.js +31 -0
  280. package/dist/trace/capture.js.map +1 -0
  281. package/dist/trace/file-store.d.ts +12 -0
  282. package/dist/trace/file-store.d.ts.map +1 -0
  283. package/dist/trace/file-store.js +78 -0
  284. package/dist/trace/file-store.js.map +1 -0
  285. package/dist/trace/memory-store.d.ts +9 -0
  286. package/dist/trace/memory-store.d.ts.map +1 -0
  287. package/dist/trace/memory-store.js +36 -0
  288. package/dist/trace/memory-store.js.map +1 -0
  289. package/dist/trace/types.d.ts +37 -0
  290. package/dist/trace/types.d.ts.map +1 -0
  291. package/dist/trace/types.js +2 -0
  292. package/dist/trace/types.js.map +1 -0
  293. package/package.json +44 -0
@@ -0,0 +1,46 @@
1
+ import { CogentaError } from '@cogenta/core';
2
+ const REQUIRED_FIELDS = ['name', 'version', 'description'];
3
+ /**
4
+ * Deliberately not a YAML parser (R9: no new dependency for three flat
5
+ * string fields) — `---\nkey: value\n---\nbody`, one `key: value` per line,
6
+ * nothing nested.
7
+ */
8
+ export function parseSkillFile(path, raw) {
9
+ const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(raw);
10
+ if (match === null) {
11
+ throw new CogentaError({
12
+ code: 'SKILL_DEFINITION_INVALID',
13
+ message: `"${path}" has no --- frontmatter block.`,
14
+ hint: 'Start the file with --- \\n name: ... \\n version: ... \\n description: ... \\n ---',
15
+ });
16
+ }
17
+ const [, frontmatter = '', body = ''] = match;
18
+ const fields = {};
19
+ for (const line of frontmatter.split('\n')) {
20
+ if (line.trim() === '')
21
+ continue;
22
+ const separatorIndex = line.indexOf(':');
23
+ if (separatorIndex === -1)
24
+ continue;
25
+ const key = line.slice(0, separatorIndex).trim();
26
+ const value = line.slice(separatorIndex + 1).trim();
27
+ fields[key] = value;
28
+ }
29
+ const missing = REQUIRED_FIELDS.filter((field) => fields[field] === undefined);
30
+ if (missing.length > 0) {
31
+ throw new CogentaError({
32
+ code: 'SKILL_DEFINITION_INVALID',
33
+ message: `"${path}" is missing required frontmatter field(s): ${missing.join(', ')}.`,
34
+ hint: 'A skill needs name, version and description in its frontmatter.',
35
+ });
36
+ }
37
+ return {
38
+ metadata: {
39
+ name: fields.name,
40
+ version: fields.version,
41
+ description: fields.description,
42
+ },
43
+ instructions: body.trim(),
44
+ };
45
+ }
46
+ //# sourceMappingURL=frontmatter.js.map
@@ -0,0 +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;QAChC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACxC,IAAI,cAAc,KAAK,CAAC,CAAC;YAAE,SAAQ;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,EAAE,CAAA;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACnD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAA;IAC9E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,YAAY,CAAC;YACrB,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,IAAI,IAAI,+CAA+C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YACrF,IAAI,EAAE,iEAAiE;SACxE,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC,IAAc;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAiB;YACjC,WAAW,EAAE,MAAM,CAAC,WAAqB;SAC1C;QACD,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE;KAC1B,CAAA;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ export interface SkillMetadata {
2
+ readonly name: string;
3
+ readonly version: string;
4
+ readonly description: string;
5
+ }
6
+ /** A skill's instructions text plus the names of the resource files sitting alongside it — the resources themselves are read by the caller, on demand, only for the files it actually needs. */
7
+ export interface Skill extends SkillMetadata {
8
+ readonly instructions: string;
9
+ readonly dir: string;
10
+ readonly resources: readonly string[];
11
+ }
12
+ export interface SkillStore {
13
+ list(): Promise<readonly SkillMetadata[]>;
14
+ /** Reads one skill's instructions in full — the "on demand" half of "chargé à la demande" (never done for every skill up front). */
15
+ load(name: string): Promise<Skill>;
16
+ /** Copies a skill folder from `sourceDir` into the store, under its own declared name. */
17
+ install(sourceDir: string): Promise<SkillMetadata>;
18
+ }
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/skills/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,gMAAgM;AAChM,MAAM,WAAW,KAAM,SAAQ,aAAa;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,IAAI,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAA;IACzC,oIAAoI;IACpI,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;IAClC,0FAA0F;IAC1F,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CACnD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/skills/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { type SkinTokens } from '@cogenta/render';
2
+ import type { ProviderClient } from '../providers/types.js';
3
+ export interface GenerateSkinOptions {
4
+ readonly client: ProviderClient;
5
+ readonly model: string;
6
+ /** Free text: sector, mood, audience, optional brand colours. */
7
+ readonly description: string;
8
+ readonly blueprintLabel: string;
9
+ /** "trois tentatives" by default. */
10
+ readonly maxAttempts?: number;
11
+ }
12
+ export type GenerateSkinResult = {
13
+ readonly ok: true;
14
+ readonly tokens: SkinTokens;
15
+ readonly attempts: number;
16
+ } | {
17
+ readonly ok: false;
18
+ readonly attempts: number;
19
+ readonly reason: string;
20
+ };
21
+ export declare function generateSkin(options: GenerateSkinOptions): Promise<GenerateSkinResult>;
22
+ //# sourceMappingURL=generate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/skin/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,UAAU,EAIhB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAkE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC7E;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAmD9E,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyC5F"}
@@ -0,0 +1,144 @@
1
+ import { CogentaError, isCogentaError } from '@cogenta/core';
2
+ import { CONTRAST_PAIRS, DENSITIES, TOKEN_GROUPS, TOKEN_SPECS, validateSkin, } from '@cogenta/render';
3
+ /**
4
+ * L9 task 7 (`create-cogenta`) / task 9 (`cogenta skin generate`): "L'IA ne
5
+ * produit pas de CSS. Elle remplit le schéma de tokens du contrat D."
6
+ * Generation, validation and the three-attempt correction loop — validation
7
+ * itself is not reimplemented here: `validateSkin` (`@cogenta/render`)
8
+ * already does hard-refusal contrast/scale/completeness/motion checks with
9
+ * actionable `hint`s on every `CogentaError` it throws, written (its own
10
+ * source comment says so) for exactly this — "the author is a model, which
11
+ * can only correct what the message actually measures." This module's only
12
+ * job is to turn that hint into the next attempt's correction prompt.
13
+ *
14
+ * Lives in `@cogenta/agents` rather than `@cogenta/render` or
15
+ * `create-cogenta`: the retry-on-model-feedback loop is an AI-orchestration
16
+ * concern (this package's own domain — providers, retry, structured
17
+ * generation), not a rendering concern, and both `create-cogenta` (the
18
+ * installer) and `@cogenta/cli` (`cogenta skin generate`, task 9) need to
19
+ * call it without either depending on the other. `@cogenta/render` owns
20
+ * contract D and stays the single source of truth this validates against.
21
+ */
22
+ const KIND_HINT = {
23
+ color: 'a hex, rgb() or hsl() colour, fully opaque if it is ever used as a background',
24
+ length: 'a CSS length with a unit, e.g. "0.25rem" or "16px"',
25
+ duration: 'a CSS duration with a unit, e.g. "200ms"',
26
+ ratio: 'a number greater than 1',
27
+ text: 'a short string (a font stack, an easing keyword, a CSS box-shadow value)',
28
+ boolean: 'true or false',
29
+ density: `one of: ${DENSITIES.join(', ')}`,
30
+ };
31
+ /**
32
+ * Describes contract D's token schema by reading the same `TOKEN_SPECS`/
33
+ * `CONTRAST_PAIRS` that `validateSkin` checks against, rather than a
34
+ * hand-duplicated copy of the shape — the prompt and the validator cannot
35
+ * drift apart.
36
+ */
37
+ function describeTokenSchema() {
38
+ const byGroup = new Map();
39
+ for (const spec of TOKEN_SPECS) {
40
+ const list = byGroup.get(spec.group) ?? [];
41
+ list.push(`"${spec.name}": ${KIND_HINT[spec.kind] ?? 'a string'}`);
42
+ byGroup.set(spec.group, list);
43
+ }
44
+ const groups = TOKEN_GROUPS.map((group) => ` "${group}": { ${(byGroup.get(group) ?? []).join(', ')} }`);
45
+ const contrastLines = CONTRAST_PAIRS.map((pair) => `color.${pair.foreground} on color.${pair.background} must reach WCAG 2.2 AA contrast for ${pair.size} text`);
46
+ return [
47
+ 'Return a single JSON object with exactly these top-level keys, and no others:',
48
+ '{',
49
+ groups.join(',\n'),
50
+ '}',
51
+ '',
52
+ 'Hard requirements, checked automatically before this skin is accepted:',
53
+ ...contrastLines.map((line) => `- ${line}`),
54
+ '- font.scale must be greater than 1, so each step of the type scale is strictly larger than the one before it.',
55
+ '- motion.reduced must be true.',
56
+ '- Every key listed above must be present, with no extra key added.',
57
+ ].join('\n');
58
+ }
59
+ const DEFAULT_MAX_ATTEMPTS = 3;
60
+ const MAX_TOKENS = 2000;
61
+ function buildPrompt(options, correction) {
62
+ const lines = [
63
+ 'You are configuring the visual design tokens of a Cogenta CMS site.',
64
+ 'You do not write CSS or markup — only the JSON data below.',
65
+ `Site type: ${options.blueprintLabel}.`,
66
+ `Description from the site owner: ${options.description}`,
67
+ '',
68
+ describeTokenSchema(),
69
+ '',
70
+ 'Reply with ONLY the JSON object. No prose, no markdown code fence, no explanation.',
71
+ ];
72
+ if (correction !== undefined) {
73
+ lines.push('', `Your previous attempt was rejected: ${correction}`, 'Fix it and reply again with ONLY the corrected JSON object.');
74
+ }
75
+ return lines.join('\n');
76
+ }
77
+ function notJson(reason) {
78
+ return new CogentaError({
79
+ code: 'SKIN_GENERATION_RESPONSE_NOT_JSON',
80
+ message: `The model's response was not a single JSON object: ${reason}.`,
81
+ hint: 'Reply with ONLY a JSON object matching the requested token schema — no prose, no markdown fence.',
82
+ });
83
+ }
84
+ function extractJson(content) {
85
+ if (content === null)
86
+ throw notJson('the response was empty');
87
+ const trimmed = content.trim();
88
+ const start = trimmed.indexOf('{');
89
+ const end = trimmed.lastIndexOf('}');
90
+ if (start === -1 || end === -1 || end < start)
91
+ throw notJson('no JSON object was found');
92
+ try {
93
+ return JSON.parse(trimmed.slice(start, end + 1));
94
+ }
95
+ catch (error) {
96
+ throw notJson(error instanceof Error ? error.message : String(error));
97
+ }
98
+ }
99
+ function correctionFor(error) {
100
+ return error.hint === undefined ? error.message : `${error.message} ${error.hint}`;
101
+ }
102
+ export async function generateSkin(options) {
103
+ const maxAttempts = options.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
104
+ let correction;
105
+ let lastReason = 'no attempt was made';
106
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
107
+ let content;
108
+ try {
109
+ const response = await options.client.chat({
110
+ model: options.model,
111
+ messages: [{ role: 'user', content: buildPrompt(options, correction) }],
112
+ maxTokens: MAX_TOKENS,
113
+ });
114
+ content = response.content;
115
+ }
116
+ catch (error) {
117
+ lastReason = `model call failed: ${error instanceof Error ? error.message : String(error)}`;
118
+ correction = lastReason;
119
+ continue;
120
+ }
121
+ let candidate;
122
+ try {
123
+ candidate = extractJson(content);
124
+ }
125
+ catch {
126
+ lastReason = 'the model did not return a JSON object';
127
+ correction =
128
+ 'Your previous response was not a single JSON object. Reply with ONLY the JSON object — no prose, no markdown fence.';
129
+ continue;
130
+ }
131
+ try {
132
+ const tokens = validateSkin(candidate);
133
+ return { ok: true, tokens, attempts: attempt };
134
+ }
135
+ catch (error) {
136
+ if (!isCogentaError(error))
137
+ throw error;
138
+ lastReason = error.message;
139
+ correction = correctionFor(error);
140
+ }
141
+ }
142
+ return { ok: false, attempts: maxAttempts, reason: lastReason };
143
+ }
144
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/skin/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EACL,cAAc,EACd,SAAS,EAET,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,iBAAiB,CAAA;AAGxB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,SAAS,GAAqC;IAClD,KAAK,EAAE,+EAA+E;IACtF,MAAM,EAAE,oDAAoD;IAC5D,QAAQ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AC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;YAC3F,UAAU,GAAG,UAAU,CAAA;YACvB,SAAQ;QACV,CAAC;QAED,IAAI,SAAkB,CAAA;QACtB,IAAI,CAAC;YACH,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,UAAU,GAAG,wCAAwC,CAAA;YACrD,UAAU;gBACR,qHAAqH,CAAA;YACvH,SAAQ;QACV,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;YACtC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;gBAAE,MAAM,KAAK,CAAA;YACvC,UAAU,GAAG,KAAK,CAAC,OAAO,CAAA;YAC1B,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AACjE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { RunAgentLoopInput, RunResult } from '../runtime/types.js';
2
+ /**
3
+ * Runs a sub-agent's own loop with its own manifest, budget and kill switch
4
+ * (all already isolated per call, since `runAgentLoop` never shares state
5
+ * across invocations) and turns a thrown failure into data instead of an
6
+ * exception, so a sub-agent's crash cannot pollute — or stop — its parent's
7
+ * own run.
8
+ */
9
+ export declare function runSubagent(input: RunAgentLoopInput): Promise<RunResult>;
10
+ //# sourceMappingURL=run-subagent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-subagent.d.ts","sourceRoot":"","sources":["../../src/subagents/run-subagent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEvE;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAa9E"}
@@ -0,0 +1,24 @@
1
+ import { runAgentLoop } from '../runtime/loop.js';
2
+ /**
3
+ * Runs a sub-agent's own loop with its own manifest, budget and kill switch
4
+ * (all already isolated per call, since `runAgentLoop` never shares state
5
+ * across invocations) and turns a thrown failure into data instead of an
6
+ * exception, so a sub-agent's crash cannot pollute — or stop — its parent's
7
+ * own run.
8
+ */
9
+ export async function runSubagent(input) {
10
+ try {
11
+ return await runAgentLoop(input);
12
+ }
13
+ catch (error) {
14
+ return {
15
+ messages: input.messages,
16
+ steps: [],
17
+ finalText: null,
18
+ stopReason: 'errored',
19
+ usage: { inputTokens: 0, outputTokens: 0 },
20
+ error: error instanceof Error ? error.message : String(error),
21
+ };
22
+ }
23
+ }
24
+ //# sourceMappingURL=run-subagent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-subagent.js","sourceRoot":"","sources":["../../src/subagents/run-subagent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAwB;IACxD,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,SAAS;YACrB,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;YAC1C,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The one slice of `defineAgent` (Contract C) task 11 actually needs: enough
3
+ * to check `subagent.tools ⊆ parent.tools` before anything runs. The rest of
4
+ * an agent's declaration (identity, model, skills, autonomy, budget, memory,
5
+ * triggers) belongs to later tasks and is deliberately not modelled here.
6
+ */
7
+ export interface AgentToolsDeclaration {
8
+ readonly name: string;
9
+ readonly tools: readonly string[];
10
+ /** Names of other declarations in the same set this agent may delegate to. */
11
+ readonly subagents?: readonly string[];
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/subagents/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/subagents/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { AgentToolsDeclaration } from './types.js';
2
+ /**
3
+ * `subagent.tools ⊆ parent.tools`, checked once for the whole declared set —
4
+ * at load time, never at call time (the lot's own wording: an invalid
5
+ * declaration must stop the agent from loading at all, not fail mid-run).
6
+ */
7
+ export declare function validateSubagentTools(agents: readonly AgentToolsDeclaration[]): void;
8
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/subagents/validate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,GAAG,IAAI,CA0BpF"}
@@ -0,0 +1,32 @@
1
+ import { CogentaError } from '@cogenta/core';
2
+ /**
3
+ * `subagent.tools ⊆ parent.tools`, checked once for the whole declared set —
4
+ * at load time, never at call time (the lot's own wording: an invalid
5
+ * declaration must stop the agent from loading at all, not fail mid-run).
6
+ */
7
+ export function validateSubagentTools(agents) {
8
+ const byName = new Map(agents.map((agent) => [agent.name, agent]));
9
+ for (const agent of agents) {
10
+ for (const subagentName of agent.subagents ?? []) {
11
+ const subagent = byName.get(subagentName);
12
+ if (subagent === undefined) {
13
+ throw new CogentaError({
14
+ code: 'AGENT_SUBAGENT_UNKNOWN',
15
+ message: `"${agent.name}" declares sub-agent "${subagentName}", which is not in this agent set.`,
16
+ hint: 'Declare the sub-agent alongside its parent before validating, or remove it from `subagents`.',
17
+ });
18
+ }
19
+ const parentTools = new Set(agent.tools);
20
+ const excess = subagent.tools.filter((tool) => !parentTools.has(tool));
21
+ if (excess.length > 0) {
22
+ throw new CogentaError({
23
+ code: 'AGENT_SUBAGENT_TOOLS_NOT_SUBSET',
24
+ message: `Sub-agent "${subagentName}" has tools not granted to its parent "${agent.name}": ${excess.join(', ')}.`,
25
+ hint: 'A sub-agent can never see more than its parent — grant the tool to the parent too, or remove it from the sub-agent.',
26
+ details: { parent: agent.name, subagent: subagentName, excess },
27
+ });
28
+ }
29
+ }
30
+ }
31
+ }
32
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/subagents/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG5C;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAwC;IAC5E,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CA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ExecutableTool } from '../../runtime/types.js';
4
+ import type { ToolDefinition } from '../types.js';
5
+ export interface AgentDelegateToolOptions {
6
+ /** For messages only — which sub-agent this instance delegates to. */
7
+ readonly subagentName: string;
8
+ readonly client: ProviderClient;
9
+ /** The sub-agent's own manifest — built (elsewhere) from its own `tools`, already checked to be a subset of the parent's via `validateSubagentTools`. */
10
+ readonly tools: readonly ExecutableTool[];
11
+ readonly system?: string;
12
+ readonly maxTokens: number;
13
+ readonly maxSteps?: number;
14
+ }
15
+ declare const AgentDelegateInputSchema: z.ZodObject<{
16
+ task: z.ZodString;
17
+ }, z.core.$strip>;
18
+ export type AgentDelegateInput = z.infer<typeof AgentDelegateInputSchema>;
19
+ declare const AgentDelegateOutputSchema: z.ZodObject<{
20
+ finalText: z.ZodNullable<z.ZodString>;
21
+ stopReason: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export type AgentDelegateOutput = z.infer<typeof AgentDelegateOutputSchema>;
24
+ /**
25
+ * `agent.delegate` — hands one task to a sub-agent's own `runAgentLoop` run,
26
+ * with its own manifest and budget (both fixed at construction, one instance
27
+ * per delegating agent, same pattern as `http.fetch`'s per-agent domain
28
+ * list). `runSubagent` (task 11) is what keeps a sub-agent's crash from
29
+ * propagating: this tool's `execute` never throws for that reason, only for
30
+ * an input/output schema mismatch, which is the manifest's job to catch.
31
+ */
32
+ export declare function createAgentDelegateTool(options: AgentDelegateToolOptions): ToolDefinition<AgentDelegateInput, AgentDelegateOutput>;
33
+ export {};
34
+ //# sourceMappingURL=agent-delegate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-delegate.d.ts","sourceRoot":"","sources":["../../../src/tools/core/agent-delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,WAAW,wBAAwB;IACvC,sEAAsE;IACtE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,yJAAyJ;IACzJ,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAA;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,QAAA,MAAM,wBAAwB;;iBAAiC,CAAA;AAC/D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,QAAA,MAAM,yBAAyB;;;iBAG7B,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,cAAc,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAwBzD"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import { runSubagent } from '../../subagents/run-subagent.js';
3
+ import { defineTool } from '../define.js';
4
+ const AgentDelegateInputSchema = z.object({ task: z.string() });
5
+ const AgentDelegateOutputSchema = z.object({
6
+ finalText: z.string().nullable(),
7
+ stopReason: z.string(),
8
+ });
9
+ /**
10
+ * `agent.delegate` — hands one task to a sub-agent's own `runAgentLoop` run,
11
+ * with its own manifest and budget (both fixed at construction, one instance
12
+ * per delegating agent, same pattern as `http.fetch`'s per-agent domain
13
+ * list). `runSubagent` (task 11) is what keeps a sub-agent's crash from
14
+ * propagating: this tool's `execute` never throws for that reason, only for
15
+ * an input/output schema mismatch, which is the manifest's job to catch.
16
+ */
17
+ export function createAgentDelegateTool(options) {
18
+ return defineTool({
19
+ name: 'agent.delegate',
20
+ version: '1.0.0',
21
+ description: `Delegate one task to the "${options.subagentName}" sub-agent.`,
22
+ input: AgentDelegateInputSchema,
23
+ output: AgentDelegateOutputSchema,
24
+ permissions: ['agent.delegate'],
25
+ sideEffects: false,
26
+ reversible: false,
27
+ cost: 'high',
28
+ async execute(input) {
29
+ const result = await runSubagent({
30
+ client: options.client,
31
+ messages: [{ role: 'user', content: input.task }],
32
+ tools: options.tools,
33
+ maxTokens: options.maxTokens,
34
+ ...(options.system === undefined ? {} : { system: options.system }),
35
+ ...(options.maxSteps === undefined ? {} : { maxSteps: options.maxSteps }),
36
+ });
37
+ return { finalText: result.finalText, stopReason: result.stopReason };
38
+ },
39
+ });
40
+ }
41
+ //# sourceMappingURL=agent-delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-delegate.js","sourceRoot":"","sources":["../../../src/tools/core/agent-delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAczC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAG/D,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAA;AAGF;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAiC;IAEjC,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,6BAA6B,OAAO,CAAC,YAAY,cAAc;QAC5E,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,yBAAyB;QACjC,WAAW,EAAE,CAAC,gBAAgB,CAAC;QAC/B,WAAW,EAAE,KAAK;QAClB,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,MAAM;QACZ,KAAK,CAAC,OAAO,CAAC,KAAK;YACjB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;gBAC/B,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;gBACjD,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;gBACnE,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;aAC1E,CAAC,CAAA;YAEF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAA;QACvE,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ import type { ToolDefinition } from '../types.js';
3
+ /**
4
+ * The narrow slice of `@cogenta/api`'s `ContentService` these tools actually
5
+ * call — declared locally rather than imported so `@cogenta/agents` does not
6
+ * pull in `@cogenta/api`'s full dependency graph (GraphQL, WebAuthn) just to
7
+ * describe four method signatures. A real `ContentService` instance already
8
+ * satisfies this structurally; wiring one in is the runtime assembly's job
9
+ * (where `defineAgent` configs become live tool instances), not this
10
+ * module's.
11
+ */
12
+ export interface ContentAccessContext {
13
+ readonly actor: {
14
+ readonly id: string | null;
15
+ readonly roles: readonly string[];
16
+ };
17
+ }
18
+ export interface ContentReadOptions {
19
+ readonly state: 'published' | 'working';
20
+ readonly depth: number;
21
+ }
22
+ export interface ContentServiceLike {
23
+ read(context: ContentAccessContext, collection: string, id: string, options: ContentReadOptions): Promise<Record<string, unknown>>;
24
+ create(context: ContentAccessContext, collection: string, input: {
25
+ readonly values: Readonly<Record<string, unknown>>;
26
+ readonly locale?: string;
27
+ }, options: ContentReadOptions): Promise<Record<string, unknown>>;
28
+ update(context: ContentAccessContext, collection: string, id: string, input: {
29
+ readonly values: Readonly<Record<string, unknown>>;
30
+ }, options: ContentReadOptions): Promise<Record<string, unknown>>;
31
+ publish(context: ContentAccessContext, collection: string, id: string, input: {
32
+ readonly publishedBy?: string | null;
33
+ }, options: ContentReadOptions): Promise<Record<string, unknown>>;
34
+ remove(context: ContentAccessContext, collection: string, id: string): Promise<void>;
35
+ }
36
+ declare const ReadInputSchema: z.ZodObject<{
37
+ collection: z.ZodString;
38
+ id: z.ZodString;
39
+ state: z.ZodOptional<z.ZodEnum<{
40
+ published: "published";
41
+ working: "working";
42
+ }>>;
43
+ }, z.core.$strip>;
44
+ type ReadInput = z.infer<typeof ReadInputSchema>;
45
+ /**
46
+ * `content.read` — the service is the actual permission gate (it calls
47
+ * `PermissionLayer.assert` internally against the collection's own
48
+ * `read`/`publish` roles); this tool only shapes the call and never
49
+ * second-guesses what the service decides.
50
+ */
51
+ export declare function createContentReadTool(service: ContentServiceLike): ToolDefinition<ReadInput, Record<string, unknown>>;
52
+ declare const WriteDraftInputSchema: z.ZodObject<{
53
+ collection: z.ZodString;
54
+ id: z.ZodOptional<z.ZodString>;
55
+ values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
56
+ locale: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ type WriteDraftInput = z.infer<typeof WriteDraftInputSchema>;
59
+ /**
60
+ * `content.write_draft` — creates a new working entry when `id` is absent,
61
+ * updates the existing one otherwise. Never touches the published state;
62
+ * that is `content.publish`'s job alone, matching `ContentService` keeping
63
+ * `create`/`update` and `publish` as distinct operations.
64
+ */
65
+ export declare function createContentWriteDraftTool(service: ContentServiceLike): ToolDefinition<WriteDraftInput, Record<string, unknown>>;
66
+ declare const PublishInputSchema: z.ZodObject<{
67
+ collection: z.ZodString;
68
+ id: z.ZodString;
69
+ }, z.core.$strip>;
70
+ type PublishInput = z.infer<typeof PublishInputSchema>;
71
+ export declare function createContentPublishTool(service: ContentServiceLike): ToolDefinition<PublishInput, Record<string, unknown>>;
72
+ declare const DeleteInputSchema: z.ZodObject<{
73
+ collection: z.ZodString;
74
+ id: z.ZodString;
75
+ }, z.core.$strip>;
76
+ type DeleteInput = z.infer<typeof DeleteInputSchema>;
77
+ export declare function createContentDeleteTool(service: ContentServiceLike): ToolDefinition<DeleteInput, {
78
+ ok: boolean;
79
+ }>;
80
+ export {};
81
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/tools/core/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAA;CAClF;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CACF,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,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