@sitecoreai-labs/sitecoreai-cli 0.0.4 → 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 (1387) hide show
  1. package/AGENTS.md +146 -55
  2. package/README.md +372 -325
  3. package/dist/agents/api/agents.d.ts +27 -0
  4. package/dist/agents/api/agents.js +70 -0
  5. package/dist/agents/api/catalog.d.ts +8 -0
  6. package/dist/agents/api/catalog.js +33 -0
  7. package/dist/agents/api/custom-mcps.d.ts +26 -0
  8. package/dist/agents/api/custom-mcps.js +53 -0
  9. package/dist/agents/api/html-templates.d.ts +35 -0
  10. package/dist/agents/api/html-templates.js +116 -0
  11. package/dist/agents/api/request.d.ts +28 -0
  12. package/dist/agents/api/request.js +207 -0
  13. package/dist/agents/api/runs.d.ts +31 -0
  14. package/dist/agents/api/runs.js +82 -0
  15. package/dist/agents/api/schema.d.ts +182 -0
  16. package/dist/agents/api/schema.js +10 -0
  17. package/dist/agents/api/schemas.d.ts +37 -0
  18. package/dist/agents/api/schemas.js +95 -0
  19. package/dist/agents/api/skills.d.ts +25 -0
  20. package/dist/agents/api/skills.js +55 -0
  21. package/dist/agents/api/spaces.d.ts +34 -0
  22. package/dist/agents/api/spaces.js +72 -0
  23. package/dist/agents/api/tools.d.ts +4 -0
  24. package/dist/agents/api/tools.js +18 -0
  25. package/dist/agents/api/widgets.d.ts +32 -0
  26. package/dist/agents/api/widgets.js +89 -0
  27. package/dist/agents/client.d.ts +18 -0
  28. package/dist/agents/client.js +28 -0
  29. package/dist/agents/index.d.ts +31 -0
  30. package/dist/agents/index.js +51 -0
  31. package/dist/agents/recipe/agent.diff.d.ts +4 -0
  32. package/dist/agents/recipe/agent.diff.js +55 -0
  33. package/dist/agents/recipe/agent.kind.d.ts +12 -0
  34. package/dist/agents/recipe/agent.kind.js +107 -0
  35. package/dist/agents/recipe/agent.schema.d.ts +26 -0
  36. package/dist/agents/recipe/agent.schema.js +42 -0
  37. package/dist/agents/recipe/client.d.ts +4 -0
  38. package/dist/agents/recipe/client.js +15 -0
  39. package/dist/agents/recipe/converge.d.ts +11 -0
  40. package/dist/agents/recipe/converge.js +32 -0
  41. package/dist/agents/recipe/custom-mcp.kind.d.ts +4 -0
  42. package/dist/agents/recipe/custom-mcp.kind.js +42 -0
  43. package/dist/agents/recipe/custom-mcp.schema.d.ts +11 -0
  44. package/dist/agents/recipe/custom-mcp.schema.js +15 -0
  45. package/dist/agents/recipe/html-template.kind.d.ts +4 -0
  46. package/dist/agents/recipe/html-template.kind.js +50 -0
  47. package/dist/agents/recipe/html-template.schema.d.ts +13 -0
  48. package/dist/agents/recipe/html-template.schema.js +17 -0
  49. package/dist/agents/recipe/index.d.ts +43 -0
  50. package/dist/agents/recipe/index.js +81 -0
  51. package/dist/agents/recipe/schema.kind.d.ts +4 -0
  52. package/dist/agents/recipe/schema.kind.js +50 -0
  53. package/dist/agents/recipe/schema.schema.d.ts +15 -0
  54. package/dist/agents/recipe/schema.schema.js +21 -0
  55. package/dist/agents/recipe/skill.kind.d.ts +4 -0
  56. package/dist/agents/recipe/skill.kind.js +48 -0
  57. package/dist/agents/recipe/skill.schema.d.ts +14 -0
  58. package/dist/agents/recipe/skill.schema.js +18 -0
  59. package/dist/agents/recipe/widget.kind.d.ts +4 -0
  60. package/dist/agents/recipe/widget.kind.js +49 -0
  61. package/dist/agents/recipe/widget.schema.d.ts +20 -0
  62. package/dist/agents/recipe/widget.schema.js +23 -0
  63. package/dist/agents/session/index.d.ts +50 -0
  64. package/dist/agents/session/index.js +127 -0
  65. package/dist/agents/session/playwright-login.d.ts +11 -0
  66. package/dist/agents/session/playwright-login.js +169 -0
  67. package/dist/agents/session/types.d.ts +72 -0
  68. package/dist/agents/session/types.js +26 -0
  69. package/dist/agents/tasks/agent.d.ts +27 -0
  70. package/dist/agents/tasks/agent.js +183 -0
  71. package/dist/agents/tasks/index.d.ts +14 -0
  72. package/dist/agents/tasks/index.js +30 -0
  73. package/dist/agents/tasks/resources.d.ts +39 -0
  74. package/dist/agents/tasks/resources.js +219 -0
  75. package/dist/agents/tasks/session.d.ts +6 -0
  76. package/dist/agents/tasks/session.js +63 -0
  77. package/dist/agents/tasks/shared.d.ts +38 -0
  78. package/dist/agents/tasks/shared.js +72 -0
  79. package/dist/agents/tasks/space.d.ts +12 -0
  80. package/dist/agents/tasks/space.js +55 -0
  81. package/dist/brand/api/auth.d.ts +58 -0
  82. package/dist/brand/api/auth.js +141 -0
  83. package/dist/brand/api/client.d.ts +40 -0
  84. package/dist/brand/api/client.js +83 -0
  85. package/dist/brand/api/types.d.ts +119 -0
  86. package/dist/brand/api/types.js +9 -0
  87. package/dist/brand/credential.d.ts +55 -0
  88. package/dist/brand/credential.js +87 -0
  89. package/dist/brand/documents/list.d.ts +85 -0
  90. package/dist/brand/documents/list.js +53 -0
  91. package/dist/brand/documents/upload.d.ts +113 -0
  92. package/dist/brand/documents/upload.js +106 -0
  93. package/dist/brand/index.d.ts +33 -0
  94. package/dist/brand/index.js +76 -0
  95. package/dist/brand/kits/create.d.ts +58 -0
  96. package/dist/brand/kits/create.js +68 -0
  97. package/dist/brand/kits/list.d.ts +53 -0
  98. package/dist/brand/kits/list.js +36 -0
  99. package/dist/brand/kits/sections.d.ts +156 -0
  100. package/dist/brand/kits/sections.js +80 -0
  101. package/dist/brand/pipeline/run.d.ts +58 -0
  102. package/dist/brand/pipeline/run.js +63 -0
  103. package/dist/brand/recipe/client.d.ts +4 -0
  104. package/dist/brand/recipe/client.js +24 -0
  105. package/dist/brand/recipe/diff.d.ts +4 -0
  106. package/dist/brand/recipe/diff.js +74 -0
  107. package/dist/brand/recipe/index.d.ts +10 -0
  108. package/dist/brand/recipe/index.js +20 -0
  109. package/dist/brand/recipe/kind.d.ts +4 -0
  110. package/dist/brand/recipe/kind.js +0 -0
  111. package/dist/brand/recipe/schema.d.ts +54 -0
  112. package/dist/brand/recipe/schema.js +59 -0
  113. package/dist/brand/review/format-json.d.ts +33 -0
  114. package/dist/brand/review/format-json.js +36 -0
  115. package/dist/brand/review/format-sarif.d.ts +64 -0
  116. package/dist/brand/review/format-sarif.js +77 -0
  117. package/dist/brand/review/format-text.d.ts +24 -0
  118. package/dist/brand/review/format-text.js +60 -0
  119. package/dist/brand/review/generate.d.ts +37 -0
  120. package/dist/brand/review/generate.js +146 -0
  121. package/dist/brand/review/outcomes.d.ts +43 -0
  122. package/dist/brand/review/outcomes.js +58 -0
  123. package/dist/brand/seed.d.ts +81 -0
  124. package/dist/brand/seed.js +151 -0
  125. package/dist/brand/tasks/login.d.ts +37 -0
  126. package/dist/brand/tasks/login.js +192 -0
  127. package/dist/brand/tasks/review.d.ts +111 -0
  128. package/dist/brand/tasks/review.js +310 -0
  129. package/dist/brief/api/brief-types.d.ts +64 -0
  130. package/dist/brief/api/brief-types.js +103 -0
  131. package/dist/brief/api/briefs.d.ts +66 -0
  132. package/dist/brief/api/briefs.js +58 -0
  133. package/dist/brief/api/comments.d.ts +43 -0
  134. package/dist/brief/api/comments.js +29 -0
  135. package/dist/brief/api/request.d.ts +5 -0
  136. package/dist/brief/api/request.js +83 -0
  137. package/dist/brief/api/schema.d.ts +158 -0
  138. package/dist/brief/api/schema.js +18 -0
  139. package/dist/brief/api/tasks.d.ts +41 -0
  140. package/dist/brief/api/tasks.js +24 -0
  141. package/dist/brief/api/types.d.ts +17 -0
  142. package/dist/brief/api/types.js +21 -0
  143. package/dist/brief/auth.d.ts +44 -0
  144. package/dist/brief/auth.js +101 -0
  145. package/dist/brief/client.d.ts +25 -0
  146. package/dist/brief/client.js +56 -0
  147. package/dist/brief/index.d.ts +31 -0
  148. package/dist/brief/index.js +53 -0
  149. package/dist/brief/recipe/client.d.ts +4 -0
  150. package/dist/brief/recipe/client.js +52 -0
  151. package/dist/brief/recipe/diff.d.ts +4 -0
  152. package/dist/brief/recipe/diff.js +74 -0
  153. package/dist/brief/recipe/index.d.ts +10 -0
  154. package/dist/brief/recipe/index.js +23 -0
  155. package/dist/brief/recipe/kind.d.ts +4 -0
  156. package/dist/brief/recipe/kind.js +114 -0
  157. package/dist/brief/recipe/schema.d.ts +152 -0
  158. package/dist/brief/recipe/schema.js +99 -0
  159. package/dist/brief/tasks/index.d.ts +128 -0
  160. package/dist/brief/tasks/index.js +286 -0
  161. package/dist/campaigns/api/deliverables.d.ts +37 -0
  162. package/dist/campaigns/api/deliverables.js +30 -0
  163. package/dist/campaigns/api/projects.d.ts +49 -0
  164. package/dist/campaigns/api/projects.js +45 -0
  165. package/dist/campaigns/api/request.d.ts +5 -0
  166. package/dist/campaigns/api/request.js +119 -0
  167. package/dist/campaigns/api/schema.d.ts +144 -0
  168. package/dist/campaigns/api/schema.js +22 -0
  169. package/dist/campaigns/api/tasks.d.ts +42 -0
  170. package/dist/campaigns/api/tasks.js +68 -0
  171. package/dist/campaigns/api/types.d.ts +17 -0
  172. package/dist/campaigns/api/types.js +27 -0
  173. package/dist/campaigns/api/users.d.ts +13 -0
  174. package/dist/campaigns/api/users.js +16 -0
  175. package/dist/campaigns/auth.d.ts +19 -0
  176. package/dist/campaigns/auth.js +86 -0
  177. package/dist/campaigns/client.d.ts +25 -0
  178. package/dist/campaigns/client.js +48 -0
  179. package/dist/campaigns/index.d.ts +29 -0
  180. package/dist/campaigns/index.js +47 -0
  181. package/dist/campaigns/recipe/client.d.ts +4 -0
  182. package/dist/campaigns/recipe/client.js +41 -0
  183. package/dist/campaigns/recipe/diff.d.ts +4 -0
  184. package/dist/campaigns/recipe/diff.js +119 -0
  185. package/dist/campaigns/recipe/index.d.ts +10 -0
  186. package/dist/campaigns/recipe/index.js +19 -0
  187. package/dist/campaigns/recipe/kind.d.ts +4 -0
  188. package/dist/campaigns/recipe/kind.js +217 -0
  189. package/dist/campaigns/recipe/schema.d.ts +79 -0
  190. package/dist/campaigns/recipe/schema.js +67 -0
  191. package/dist/campaigns/tasks/index.d.ts +124 -0
  192. package/dist/campaigns/tasks/index.js +271 -0
  193. package/dist/cli.d.ts +0 -1
  194. package/dist/cli.js +84 -63
  195. package/dist/commands/agents/index.d.ts +28 -0
  196. package/dist/commands/agents/index.js +289 -0
  197. package/dist/commands/agents/sync.d.ts +13 -0
  198. package/dist/commands/agents/sync.js +139 -0
  199. package/dist/commands/audit/all.d.ts +2 -0
  200. package/dist/commands/audit/all.js +26 -0
  201. package/dist/commands/audit/alt-text-missing.d.ts +2 -0
  202. package/dist/commands/audit/alt-text-missing.js +19 -0
  203. package/dist/commands/audit/baseline.d.ts +2 -0
  204. package/dist/commands/audit/baseline.js +75 -0
  205. package/dist/commands/audit/broken-images.d.ts +2 -0
  206. package/dist/commands/audit/broken-images.js +25 -0
  207. package/dist/commands/audit/broken-links.d.ts +2 -0
  208. package/dist/commands/audit/broken-links.js +18 -0
  209. package/dist/commands/audit/datasource-missing.d.ts +2 -0
  210. package/dist/commands/audit/datasource-missing.js +19 -0
  211. package/dist/commands/audit/dead-templates.d.ts +2 -0
  212. package/dist/commands/audit/dead-templates.js +18 -0
  213. package/dist/commands/audit/duplicates.d.ts +2 -0
  214. package/dist/commands/audit/duplicates.js +21 -0
  215. package/dist/commands/audit/empty-items.d.ts +2 -0
  216. package/dist/commands/audit/empty-items.js +19 -0
  217. package/dist/commands/audit/empty-links.d.ts +2 -0
  218. package/dist/commands/audit/empty-links.js +25 -0
  219. package/dist/commands/audit/empty-roles.d.ts +2 -0
  220. package/dist/commands/audit/empty-roles.js +18 -0
  221. package/dist/commands/audit/fallback-drift.d.ts +2 -0
  222. package/dist/commands/audit/fallback-drift.js +22 -0
  223. package/dist/commands/audit/find-replace.d.ts +2 -0
  224. package/dist/commands/audit/find-replace.js +27 -0
  225. package/dist/commands/audit/heavy-templates.d.ts +2 -0
  226. package/dist/commands/audit/heavy-templates.js +19 -0
  227. package/dist/commands/audit/history.d.ts +2 -0
  228. package/dist/commands/audit/history.js +44 -0
  229. package/dist/commands/audit/index.d.ts +2 -0
  230. package/dist/commands/audit/index.js +100 -0
  231. package/dist/commands/audit/language-data.d.ts +2 -0
  232. package/dist/commands/audit/language-data.js +24 -0
  233. package/dist/commands/audit/large-fields.d.ts +2 -0
  234. package/dist/commands/audit/large-fields.js +21 -0
  235. package/dist/commands/audit/missing-meta.d.ts +2 -0
  236. package/dist/commands/audit/missing-meta.js +22 -0
  237. package/dist/commands/audit/orphans.d.ts +2 -0
  238. package/dist/commands/audit/orphans.js +22 -0
  239. package/dist/commands/audit/page-design-orphans.d.ts +2 -0
  240. package/dist/commands/audit/page-design-orphans.js +18 -0
  241. package/dist/commands/audit/personalization-broken.d.ts +2 -0
  242. package/dist/commands/audit/personalization-broken.js +18 -0
  243. package/dist/commands/audit/references.d.ts +2 -0
  244. package/dist/commands/audit/references.js +27 -0
  245. package/dist/commands/audit/role-bloat.d.ts +2 -0
  246. package/dist/commands/audit/role-bloat.js +19 -0
  247. package/dist/commands/audit/shared.d.ts +7 -0
  248. package/dist/commands/audit/shared.js +32 -0
  249. package/dist/commands/audit/site-residue.d.ts +2 -0
  250. package/dist/commands/audit/site-residue.js +22 -0
  251. package/dist/commands/audit/slug-conflicts.d.ts +2 -0
  252. package/dist/commands/audit/slug-conflicts.js +20 -0
  253. package/dist/commands/audit/stale-content.d.ts +2 -0
  254. package/dist/commands/audit/stale-content.js +21 -0
  255. package/dist/commands/audit/stale-users.d.ts +2 -0
  256. package/dist/commands/audit/stale-users.js +21 -0
  257. package/dist/commands/audit/stale-workflow.d.ts +2 -0
  258. package/dist/commands/audit/stale-workflow.js +19 -0
  259. package/dist/commands/audit/suite.d.ts +2 -0
  260. package/dist/commands/audit/suite.js +31 -0
  261. package/dist/commands/audit/template-dependencies.d.ts +2 -0
  262. package/dist/commands/audit/template-dependencies.js +22 -0
  263. package/dist/commands/audit/translation-coverage.d.ts +2 -0
  264. package/dist/commands/audit/translation-coverage.js +22 -0
  265. package/dist/commands/audit/unused-media.d.ts +2 -0
  266. package/dist/commands/audit/unused-media.js +21 -0
  267. package/dist/commands/brand/docs.d.ts +9 -0
  268. package/dist/commands/brand/docs.js +168 -0
  269. package/dist/commands/brand/index.d.ts +13 -0
  270. package/dist/commands/brand/index.js +37 -0
  271. package/dist/commands/brand/ingest-enrich.d.ts +3 -0
  272. package/dist/commands/brand/ingest-enrich.js +71 -0
  273. package/dist/commands/brand/kits.d.ts +18 -0
  274. package/dist/commands/brand/kits.js +361 -0
  275. package/dist/commands/brand/review.d.ts +13 -0
  276. package/dist/commands/brand/review.js +65 -0
  277. package/dist/commands/brand/seed.d.ts +9 -0
  278. package/dist/commands/brand/seed.js +136 -0
  279. package/dist/commands/brand/sync.d.ts +11 -0
  280. package/dist/commands/brand/sync.js +128 -0
  281. package/dist/commands/brief/comments.d.ts +11 -0
  282. package/dist/commands/brief/comments.js +55 -0
  283. package/dist/commands/brief/delete.d.ts +10 -0
  284. package/dist/commands/brief/delete.js +40 -0
  285. package/dist/commands/brief/index.d.ts +19 -0
  286. package/dist/commands/brief/index.js +53 -0
  287. package/dist/commands/brief/list.d.ts +2 -0
  288. package/dist/commands/brief/list.js +19 -0
  289. package/dist/commands/brief/set-status.d.ts +10 -0
  290. package/dist/commands/brief/set-status.js +33 -0
  291. package/dist/commands/brief/show.d.ts +2 -0
  292. package/dist/commands/brief/show.js +19 -0
  293. package/dist/commands/brief/sync.d.ts +12 -0
  294. package/dist/commands/brief/sync.js +121 -0
  295. package/dist/commands/brief/todos.d.ts +9 -0
  296. package/dist/commands/brief/todos.js +28 -0
  297. package/dist/commands/brief/types.d.ts +16 -0
  298. package/dist/commands/brief/types.js +129 -0
  299. package/dist/commands/campaign/index.d.ts +2 -0
  300. package/dist/commands/campaign/index.js +309 -0
  301. package/dist/commands/campaign/sync.d.ts +12 -0
  302. package/dist/commands/campaign/sync.js +121 -0
  303. package/dist/commands/cleanup/archive.d.ts +2 -0
  304. package/dist/commands/cleanup/archive.js +21 -0
  305. package/dist/commands/cleanup/dead-templates.d.ts +2 -0
  306. package/dist/commands/cleanup/dead-templates.js +21 -0
  307. package/dist/commands/cleanup/duplicates.d.ts +2 -0
  308. package/dist/commands/cleanup/duplicates.js +49 -0
  309. package/dist/commands/cleanup/empty-folders.d.ts +2 -0
  310. package/dist/commands/cleanup/empty-folders.js +18 -0
  311. package/dist/commands/cleanup/field-set.d.ts +2 -0
  312. package/dist/commands/cleanup/field-set.js +44 -0
  313. package/dist/commands/cleanup/find-replace.d.ts +2 -0
  314. package/dist/commands/cleanup/find-replace.js +35 -0
  315. package/dist/commands/cleanup/index.d.ts +2 -0
  316. package/dist/commands/cleanup/index.js +48 -0
  317. package/dist/commands/cleanup/language-versions.d.ts +2 -0
  318. package/dist/commands/cleanup/language-versions.js +25 -0
  319. package/dist/commands/cleanup/rename.d.ts +2 -0
  320. package/dist/commands/cleanup/rename.js +32 -0
  321. package/dist/commands/cleanup/roles.d.ts +2 -0
  322. package/dist/commands/cleanup/roles.js +20 -0
  323. package/dist/commands/cleanup/shared.d.ts +2 -0
  324. package/dist/commands/cleanup/shared.js +15 -0
  325. package/dist/commands/cleanup/site-residue.d.ts +2 -0
  326. package/dist/commands/cleanup/site-residue.js +32 -0
  327. package/dist/commands/cleanup/slug-conflicts.d.ts +2 -0
  328. package/dist/commands/cleanup/slug-conflicts.js +54 -0
  329. package/dist/commands/cleanup/subtree.d.ts +2 -0
  330. package/dist/commands/cleanup/subtree.js +25 -0
  331. package/dist/commands/cleanup/users.d.ts +2 -0
  332. package/dist/commands/cleanup/users.js +23 -0
  333. package/dist/commands/cleanup/versions.d.ts +2 -0
  334. package/dist/commands/cleanup/versions.js +42 -0
  335. package/dist/commands/cleanup/workflow.d.ts +2 -0
  336. package/dist/commands/cleanup/workflow.js +40 -0
  337. package/dist/commands/config.d.ts +0 -1
  338. package/dist/commands/config.js +3 -3
  339. package/dist/commands/content/index.d.ts +2 -0
  340. package/dist/commands/content/index.js +11 -0
  341. package/dist/commands/content/version/index.d.ts +2 -0
  342. package/dist/commands/content/version/index.js +19 -0
  343. package/dist/commands/content/version/inspect.d.ts +2 -0
  344. package/dist/commands/content/version/inspect.js +22 -0
  345. package/dist/commands/content/version/set-never-publish.d.ts +2 -0
  346. package/dist/commands/content/version/set-never-publish.js +40 -0
  347. package/dist/commands/content/version/set-validity.d.ts +2 -0
  348. package/dist/commands/content/version/set-validity.js +30 -0
  349. package/dist/commands/deploy/deployments.d.ts +0 -1
  350. package/dist/commands/deploy/deployments.js +9 -9
  351. package/dist/commands/deploy/editing-host.d.ts +0 -1
  352. package/dist/commands/deploy/editing-host.js +25 -13
  353. package/dist/commands/deploy/environments/deployments.d.ts +0 -1
  354. package/dist/commands/deploy/environments/deployments.js +3 -3
  355. package/dist/commands/deploy/environments/index.d.ts +0 -1
  356. package/dist/commands/deploy/environments/index.js +1 -0
  357. package/dist/commands/deploy/environments/mutations.d.ts +0 -1
  358. package/dist/commands/deploy/environments/mutations.js +18 -17
  359. package/dist/commands/deploy/environments/queries.d.ts +1 -1
  360. package/dist/commands/deploy/environments/queries.js +29 -8
  361. package/dist/commands/deploy/environments/variables.d.ts +0 -1
  362. package/dist/commands/deploy/environments/variables.js +9 -8
  363. package/dist/commands/deploy/environments.d.ts +0 -1
  364. package/dist/commands/deploy/index.d.ts +0 -1
  365. package/dist/commands/deploy/index.js +1 -1
  366. package/dist/commands/deploy/logs.d.ts +0 -1
  367. package/dist/commands/deploy/logs.js +4 -4
  368. package/dist/commands/deploy/organizations.d.ts +0 -1
  369. package/dist/commands/deploy/organizations.js +5 -5
  370. package/dist/commands/deploy/projects.d.ts +0 -1
  371. package/dist/commands/deploy/projects.js +32 -20
  372. package/dist/commands/deploy/shared.d.ts +0 -1
  373. package/dist/commands/deploy/shared.js +1 -0
  374. package/dist/commands/deploy/site.d.ts +2 -3
  375. package/dist/commands/deploy/site.js +6 -5
  376. package/dist/commands/deploy/source-control.d.ts +0 -1
  377. package/dist/commands/deploy/source-control.js +13 -13
  378. package/dist/commands/deploy.d.ts +0 -1
  379. package/dist/commands/explain/index.d.ts +14 -0
  380. package/dist/commands/explain/index.js +25 -0
  381. package/dist/commands/explain/orphan-site.d.ts +11 -0
  382. package/dist/commands/explain/orphan-site.js +36 -0
  383. package/dist/commands/explain/why-blocked.d.ts +13 -0
  384. package/dist/commands/explain/why-blocked.js +42 -0
  385. package/dist/commands/health.d.ts +2 -0
  386. package/dist/commands/health.js +28 -0
  387. package/dist/commands/history.d.ts +0 -1
  388. package/dist/commands/history.js +11 -42
  389. package/dist/commands/init.d.ts +0 -1
  390. package/dist/commands/init.js +42 -8
  391. package/dist/commands/login.d.ts +11 -1
  392. package/dist/commands/login.js +35 -4
  393. package/dist/commands/logout.d.ts +0 -1
  394. package/dist/commands/logout.js +3 -3
  395. package/dist/commands/mcp/serve.d.ts +27 -0
  396. package/dist/commands/mcp/serve.js +120 -0
  397. package/dist/commands/mcp/tools.d.ts +8 -0
  398. package/dist/commands/mcp/tools.js +75 -0
  399. package/dist/commands/mcp.d.ts +2 -0
  400. package/dist/commands/mcp.js +23 -0
  401. package/dist/commands/policy.d.ts +16 -0
  402. package/dist/commands/policy.js +296 -0
  403. package/dist/commands/publish/all.d.ts +2 -0
  404. package/dist/commands/publish/all.js +41 -0
  405. package/dist/commands/publish/cancel.d.ts +2 -0
  406. package/dist/commands/publish/cancel.js +25 -0
  407. package/dist/commands/publish/history.d.ts +2 -0
  408. package/dist/commands/publish/history.js +34 -0
  409. package/dist/commands/publish/index.d.ts +2 -0
  410. package/dist/commands/publish/index.js +30 -0
  411. package/dist/commands/publish/item.d.ts +2 -0
  412. package/dist/commands/publish/item.js +55 -0
  413. package/dist/commands/publish/status.d.ts +2 -0
  414. package/dist/commands/publish/status.js +34 -0
  415. package/dist/commands/publish/unpublish.d.ts +2 -0
  416. package/dist/commands/publish/unpublish.js +52 -0
  417. package/dist/commands/recipe/index.d.ts +0 -1
  418. package/dist/commands/recipe/index.js +19 -15
  419. package/dist/commands/serialization/index.d.ts +0 -1
  420. package/dist/commands/serialization/index.js +14 -9
  421. package/dist/commands/serialization/package.d.ts +0 -1
  422. package/dist/commands/serialization/package.js +3 -3
  423. package/dist/commands/setup-client.d.ts +17 -0
  424. package/dist/commands/setup-client.js +148 -0
  425. package/dist/commands/shared.d.ts +72 -2
  426. package/dist/commands/shared.js +151 -24
  427. package/dist/commands/shell.d.ts +0 -1
  428. package/dist/commands/shell.js +1 -1
  429. package/dist/commands/status.d.ts +0 -1
  430. package/dist/commands/status.js +3 -3
  431. package/dist/commands/sync.d.ts +23 -0
  432. package/dist/commands/sync.js +154 -0
  433. package/dist/commands/telemetry.d.ts +0 -1
  434. package/dist/commands/telemetry.js +40 -2
  435. package/dist/commands/topics/index.d.ts +5 -0
  436. package/dist/commands/topics/index.js +102 -0
  437. package/dist/commands/webhook/create.d.ts +2 -0
  438. package/dist/commands/webhook/create.js +52 -0
  439. package/dist/commands/webhook/delete.d.ts +2 -0
  440. package/dist/commands/webhook/delete.js +20 -0
  441. package/dist/commands/webhook/event-types.d.ts +2 -0
  442. package/dist/commands/webhook/event-types.js +22 -0
  443. package/dist/commands/webhook/index.d.ts +2 -0
  444. package/dist/commands/webhook/index.js +33 -0
  445. package/dist/commands/webhook/inspect.d.ts +2 -0
  446. package/dist/commands/webhook/inspect.js +17 -0
  447. package/dist/commands/webhook/list.d.ts +2 -0
  448. package/dist/commands/webhook/list.js +24 -0
  449. package/dist/commands/webhook/shared.d.ts +2 -0
  450. package/dist/commands/webhook/shared.js +11 -0
  451. package/dist/commands/workflow/advance.d.ts +2 -0
  452. package/dist/commands/workflow/advance.js +22 -0
  453. package/dist/commands/workflow/apply.d.ts +2 -0
  454. package/dist/commands/workflow/apply.js +22 -0
  455. package/dist/commands/workflow/assigned.d.ts +2 -0
  456. package/dist/commands/workflow/assigned.js +21 -0
  457. package/dist/commands/workflow/index.d.ts +2 -0
  458. package/dist/commands/workflow/index.js +35 -0
  459. package/dist/commands/workflow/inspect.d.ts +2 -0
  460. package/dist/commands/workflow/inspect.js +17 -0
  461. package/dist/commands/workflow/list-commands.d.ts +2 -0
  462. package/dist/commands/workflow/list-commands.js +17 -0
  463. package/dist/commands/workflow/list-defs.d.ts +2 -0
  464. package/dist/commands/workflow/list-defs.js +17 -0
  465. package/dist/commands/workflow/reset.d.ts +2 -0
  466. package/dist/commands/workflow/reset.js +20 -0
  467. package/dist/commands/workflow/shared.d.ts +3 -0
  468. package/dist/commands/workflow/shared.js +12 -0
  469. package/dist/commands/workflow/status.d.ts +2 -0
  470. package/dist/commands/workflow/status.js +18 -0
  471. package/dist/config/env-overrides.d.ts +0 -1
  472. package/dist/config/env-overrides.js +41 -5
  473. package/dist/config/index.d.ts +15 -3
  474. package/dist/config/index.js +43 -3
  475. package/dist/config/modules.d.ts +0 -1
  476. package/dist/config/modules.js +2 -2
  477. package/dist/config/paths.d.ts +0 -1
  478. package/dist/config/paths.js +11 -2
  479. package/dist/config/root-config.d.ts +24 -1
  480. package/dist/config/root-config.js +84 -7
  481. package/dist/config/schema.json +113 -25
  482. package/dist/config/types.d.ts +228 -13
  483. package/dist/config/types.js +1 -1
  484. package/dist/config/validation.d.ts +1 -4
  485. package/dist/content/api/version-fields.d.ts +129 -0
  486. package/dist/content/api/version-fields.js +193 -0
  487. package/dist/content/index.d.ts +15 -0
  488. package/dist/content/index.js +40 -0
  489. package/dist/content/tasks/shared.d.ts +86 -0
  490. package/dist/content/tasks/shared.js +130 -0
  491. package/dist/content/tasks/version-inspect.d.ts +13 -0
  492. package/dist/content/tasks/version-inspect.js +56 -0
  493. package/dist/content/tasks/version-never-publish.d.ts +16 -0
  494. package/dist/content/tasks/version-never-publish.js +115 -0
  495. package/dist/content/tasks/version-validity.d.ts +24 -0
  496. package/dist/content/tasks/version-validity.js +159 -0
  497. package/dist/deploy/api/client-naming.d.ts +80 -0
  498. package/dist/deploy/api/client-naming.js +124 -0
  499. package/dist/deploy/api/client.d.ts +72 -0
  500. package/dist/deploy/api/client.js +72 -0
  501. package/dist/deploy/api/clients.d.ts +126 -0
  502. package/dist/deploy/api/clients.js +89 -0
  503. package/dist/deploy/api/common/headers.d.ts +0 -1
  504. package/dist/deploy/api/common/request.d.ts +0 -5
  505. package/dist/deploy/api/common/request.js +93 -120
  506. package/dist/deploy/api/common/transport-events.d.ts +31 -0
  507. package/dist/deploy/api/common/transport-events.js +24 -0
  508. package/dist/deploy/api/common/types.d.ts +60 -1
  509. package/dist/deploy/api/deployment-logs.d.ts +0 -1
  510. package/dist/deploy/api/deployment-logs.js +5 -5
  511. package/dist/deploy/api/deployments.d.ts +1 -2
  512. package/dist/deploy/api/deployments.js +22 -20
  513. package/dist/deploy/api/environments.d.ts +28 -2
  514. package/dist/deploy/api/environments.js +103 -20
  515. package/dist/deploy/api/index.d.ts +31 -9
  516. package/dist/deploy/api/index.js +129 -22
  517. package/dist/deploy/api/logs.d.ts +1 -2
  518. package/dist/deploy/api/logs.js +9 -7
  519. package/dist/deploy/api/organizations.d.ts +1 -2
  520. package/dist/deploy/api/organizations.js +8 -7
  521. package/dist/deploy/api/projects.d.ts +19 -4
  522. package/dist/deploy/api/projects.js +75 -13
  523. package/dist/deploy/api/source-control.d.ts +1 -2
  524. package/dist/deploy/api/source-control.js +25 -24
  525. package/dist/deploy/api.d.ts +0 -1
  526. package/dist/deploy/context.d.ts +52 -0
  527. package/dist/deploy/context.js +234 -0
  528. package/dist/deploy/index.d.ts +11 -0
  529. package/dist/deploy/index.js +38 -0
  530. package/dist/deploy/tasks/deployment-result.d.ts +0 -1
  531. package/dist/deploy/tasks/deployments.d.ts +0 -1
  532. package/dist/deploy/tasks/deployments.js +12 -11
  533. package/dist/deploy/tasks/editing-host.d.ts +0 -1
  534. package/dist/deploy/tasks/editing-host.js +48 -18
  535. package/dist/deploy/tasks/environments.d.ts +3 -3
  536. package/dist/deploy/tasks/environments.js +108 -24
  537. package/dist/deploy/tasks/health.d.ts +23 -0
  538. package/dist/deploy/tasks/health.js +181 -0
  539. package/dist/deploy/tasks/logs.d.ts +0 -1
  540. package/dist/deploy/tasks/logs.js +4 -4
  541. package/dist/deploy/tasks/organizations.d.ts +0 -1
  542. package/dist/deploy/tasks/organizations.js +5 -5
  543. package/dist/deploy/tasks/projects.d.ts +6 -2
  544. package/dist/deploy/tasks/projects.js +61 -42
  545. package/dist/deploy/tasks/shared.d.ts +9 -52
  546. package/dist/deploy/tasks/shared.js +46 -222
  547. package/dist/deploy/tasks/site-bind.d.ts +1 -2
  548. package/dist/deploy/tasks/site-bind.js +7 -7
  549. package/dist/deploy/tasks/site.d.ts +2 -3
  550. package/dist/deploy/tasks/site.js +4 -4
  551. package/dist/deploy/tasks/source-control.d.ts +0 -1
  552. package/dist/deploy/tasks/source-control.js +14 -14
  553. package/dist/deploy/tasks/transport-spinner.d.ts +5 -0
  554. package/dist/deploy/tasks/transport-spinner.js +118 -0
  555. package/dist/deploy/tasks/types.d.ts +16 -3
  556. package/dist/deploy/tasks/types.js +1 -1
  557. package/dist/hygiene/api/client.d.ts +294 -0
  558. package/dist/hygiene/api/client.js +827 -0
  559. package/dist/hygiene/api/graphql.d.ts +4 -0
  560. package/dist/hygiene/api/graphql.js +18 -0
  561. package/dist/hygiene/audit-suite.d.ts +84 -0
  562. package/dist/hygiene/audit-suite.js +95 -0
  563. package/dist/hygiene/baseline.d.ts +56 -0
  564. package/dist/hygiene/baseline.js +248 -0
  565. package/dist/hygiene/cache.d.ts +35 -0
  566. package/dist/hygiene/cache.js +179 -0
  567. package/dist/hygiene/history.d.ts +70 -0
  568. package/dist/hygiene/history.js +148 -0
  569. package/dist/hygiene/index.d.ts +128 -0
  570. package/dist/hygiene/index.js +168 -0
  571. package/dist/hygiene/output-adapters.d.ts +49 -0
  572. package/dist/hygiene/output-adapters.js +270 -0
  573. package/dist/hygiene/tasks/audit/all.d.ts +58 -0
  574. package/dist/hygiene/tasks/audit/all.js +274 -0
  575. package/dist/hygiene/tasks/audit/alt-text-missing.d.ts +27 -0
  576. package/dist/hygiene/tasks/audit/alt-text-missing.js +87 -0
  577. package/dist/hygiene/tasks/audit/baseline.d.ts +66 -0
  578. package/dist/hygiene/tasks/audit/baseline.js +185 -0
  579. package/dist/hygiene/tasks/audit/broken-images.d.ts +41 -0
  580. package/dist/hygiene/tasks/audit/broken-images.js +183 -0
  581. package/dist/hygiene/tasks/audit/broken-links.d.ts +53 -0
  582. package/dist/hygiene/tasks/audit/broken-links.js +121 -0
  583. package/dist/hygiene/tasks/audit/datasource-missing.d.ts +44 -0
  584. package/dist/hygiene/tasks/audit/datasource-missing.js +146 -0
  585. package/dist/hygiene/tasks/audit/dead-templates.d.ts +46 -0
  586. package/dist/hygiene/tasks/audit/dead-templates.js +216 -0
  587. package/dist/hygiene/tasks/audit/duplicates.d.ts +48 -0
  588. package/dist/hygiene/tasks/audit/duplicates.js +94 -0
  589. package/dist/hygiene/tasks/audit/empty-items.d.ts +24 -0
  590. package/dist/hygiene/tasks/audit/empty-items.js +53 -0
  591. package/dist/hygiene/tasks/audit/empty-links.d.ts +37 -0
  592. package/dist/hygiene/tasks/audit/empty-links.js +145 -0
  593. package/dist/hygiene/tasks/audit/empty-roles.d.ts +41 -0
  594. package/dist/hygiene/tasks/audit/empty-roles.js +51 -0
  595. package/dist/hygiene/tasks/audit/fallback-drift.d.ts +53 -0
  596. package/dist/hygiene/tasks/audit/fallback-drift.js +115 -0
  597. package/dist/hygiene/tasks/audit/find-replace.d.ts +75 -0
  598. package/dist/hygiene/tasks/audit/find-replace.js +142 -0
  599. package/dist/hygiene/tasks/audit/heavy-templates.d.ts +46 -0
  600. package/dist/hygiene/tasks/audit/heavy-templates.js +73 -0
  601. package/dist/hygiene/tasks/audit/history.d.ts +30 -0
  602. package/dist/hygiene/tasks/audit/history.js +161 -0
  603. package/dist/hygiene/tasks/audit/language-data.d.ts +55 -0
  604. package/dist/hygiene/tasks/audit/language-data.js +126 -0
  605. package/dist/hygiene/tasks/audit/large-fields.d.ts +48 -0
  606. package/dist/hygiene/tasks/audit/large-fields.js +84 -0
  607. package/dist/hygiene/tasks/audit/missing-meta.d.ts +57 -0
  608. package/dist/hygiene/tasks/audit/missing-meta.js +97 -0
  609. package/dist/hygiene/tasks/audit/orphans.d.ts +47 -0
  610. package/dist/hygiene/tasks/audit/orphans.js +78 -0
  611. package/dist/hygiene/tasks/audit/page-design-orphans.d.ts +24 -0
  612. package/dist/hygiene/tasks/audit/page-design-orphans.js +80 -0
  613. package/dist/hygiene/tasks/audit/personalization-broken.d.ts +25 -0
  614. package/dist/hygiene/tasks/audit/personalization-broken.js +96 -0
  615. package/dist/hygiene/tasks/audit/references.d.ts +70 -0
  616. package/dist/hygiene/tasks/audit/references.js +142 -0
  617. package/dist/hygiene/tasks/audit/role-bloat.d.ts +42 -0
  618. package/dist/hygiene/tasks/audit/role-bloat.js +64 -0
  619. package/dist/hygiene/tasks/audit/site-residue.d.ts +39 -0
  620. package/dist/hygiene/tasks/audit/site-residue.js +164 -0
  621. package/dist/hygiene/tasks/audit/slug-conflicts.d.ts +58 -0
  622. package/dist/hygiene/tasks/audit/slug-conflicts.js +87 -0
  623. package/dist/hygiene/tasks/audit/stale-content.d.ts +68 -0
  624. package/dist/hygiene/tasks/audit/stale-content.js +133 -0
  625. package/dist/hygiene/tasks/audit/stale-users.d.ts +54 -0
  626. package/dist/hygiene/tasks/audit/stale-users.js +83 -0
  627. package/dist/hygiene/tasks/audit/stale-workflow.d.ts +50 -0
  628. package/dist/hygiene/tasks/audit/stale-workflow.js +109 -0
  629. package/dist/hygiene/tasks/audit/suite-run.d.ts +28 -0
  630. package/dist/hygiene/tasks/audit/suite-run.js +46 -0
  631. package/dist/hygiene/tasks/audit/template-dependencies.d.ts +72 -0
  632. package/dist/hygiene/tasks/audit/template-dependencies.js +97 -0
  633. package/dist/hygiene/tasks/audit/translation-coverage.d.ts +64 -0
  634. package/dist/hygiene/tasks/audit/translation-coverage.js +123 -0
  635. package/dist/hygiene/tasks/audit/unused-media.d.ts +58 -0
  636. package/dist/hygiene/tasks/audit/unused-media.js +144 -0
  637. package/dist/hygiene/tasks/browse.d.ts +49 -0
  638. package/dist/hygiene/tasks/browse.js +50 -0
  639. package/dist/hygiene/tasks/cleanup/archive-purge.d.ts +50 -0
  640. package/dist/hygiene/tasks/cleanup/archive-purge.js +129 -0
  641. package/dist/hygiene/tasks/cleanup/dead-templates.d.ts +74 -0
  642. package/dist/hygiene/tasks/cleanup/dead-templates.js +247 -0
  643. package/dist/hygiene/tasks/cleanup/duplicates.d.ts +86 -0
  644. package/dist/hygiene/tasks/cleanup/duplicates.js +189 -0
  645. package/dist/hygiene/tasks/cleanup/empty-folders.d.ts +75 -0
  646. package/dist/hygiene/tasks/cleanup/empty-folders.js +165 -0
  647. package/dist/hygiene/tasks/cleanup/field-set.d.ts +108 -0
  648. package/dist/hygiene/tasks/cleanup/field-set.js +230 -0
  649. package/dist/hygiene/tasks/cleanup/find-replace.d.ts +77 -0
  650. package/dist/hygiene/tasks/cleanup/find-replace.js +180 -0
  651. package/dist/hygiene/tasks/cleanup/language-version-add.d.ts +74 -0
  652. package/dist/hygiene/tasks/cleanup/language-version-add.js +136 -0
  653. package/dist/hygiene/tasks/cleanup/rename.d.ts +78 -0
  654. package/dist/hygiene/tasks/cleanup/rename.js +152 -0
  655. package/dist/hygiene/tasks/cleanup/roles.d.ts +58 -0
  656. package/dist/hygiene/tasks/cleanup/roles.js +177 -0
  657. package/dist/hygiene/tasks/cleanup/site-residue.d.ts +55 -0
  658. package/dist/hygiene/tasks/cleanup/site-residue.js +247 -0
  659. package/dist/hygiene/tasks/cleanup/slug-conflicts.d.ts +126 -0
  660. package/dist/hygiene/tasks/cleanup/slug-conflicts.js +296 -0
  661. package/dist/hygiene/tasks/cleanup/subtree-prune.d.ts +40 -0
  662. package/dist/hygiene/tasks/cleanup/subtree-prune.js +113 -0
  663. package/dist/hygiene/tasks/cleanup/subtree.d.ts +123 -0
  664. package/dist/hygiene/tasks/cleanup/subtree.js +312 -0
  665. package/dist/hygiene/tasks/cleanup/users.d.ts +48 -0
  666. package/dist/hygiene/tasks/cleanup/users.js +92 -0
  667. package/dist/hygiene/tasks/cleanup/versions-archive.d.ts +57 -0
  668. package/dist/hygiene/tasks/cleanup/versions-archive.js +162 -0
  669. package/dist/hygiene/tasks/cleanup/versions-prune.d.ts +76 -0
  670. package/dist/hygiene/tasks/cleanup/versions-prune.js +194 -0
  671. package/dist/hygiene/tasks/cleanup/workflow-advance.d.ts +76 -0
  672. package/dist/hygiene/tasks/cleanup/workflow-advance.js +185 -0
  673. package/dist/hygiene/tasks/cleanup/workflow-apply.d.ts +97 -0
  674. package/dist/hygiene/tasks/cleanup/workflow-apply.js +310 -0
  675. package/dist/hygiene/tasks/explain/orphan-site.d.ts +53 -0
  676. package/dist/hygiene/tasks/explain/orphan-site.js +83 -0
  677. package/dist/hygiene/tasks/explain/why-blocked.d.ts +81 -0
  678. package/dist/hygiene/tasks/explain/why-blocked.js +149 -0
  679. package/dist/hygiene/tasks/reference-kind.d.ts +47 -0
  680. package/dist/hygiene/tasks/reference-kind.js +73 -0
  681. package/dist/hygiene/tasks/shared.d.ts +350 -0
  682. package/dist/hygiene/tasks/shared.js +532 -0
  683. package/dist/mcp/auth.d.ts +80 -0
  684. package/dist/mcp/auth.js +165 -0
  685. package/dist/mcp/build-registry.d.ts +12 -0
  686. package/dist/mcp/build-registry.js +75 -0
  687. package/dist/mcp/descriptions.d.ts +22 -0
  688. package/dist/mcp/descriptions.js +113 -0
  689. package/dist/mcp/dispatch.d.ts +44 -0
  690. package/dist/mcp/dispatch.js +110 -0
  691. package/dist/mcp/errors.d.ts +31 -0
  692. package/dist/mcp/errors.js +117 -0
  693. package/dist/mcp/http.d.ts +42 -0
  694. package/dist/mcp/http.js +128 -0
  695. package/dist/mcp/logging.d.ts +28 -0
  696. package/dist/mcp/logging.js +78 -0
  697. package/dist/mcp/prompts/workflows.d.ts +13 -0
  698. package/dist/mcp/prompts/workflows.js +171 -0
  699. package/dist/mcp/redact.d.ts +11 -0
  700. package/dist/mcp/redact.js +35 -0
  701. package/dist/mcp/registry.d.ts +84 -0
  702. package/dist/mcp/registry.js +62 -0
  703. package/dist/mcp/resources/brand.d.ts +20 -0
  704. package/dist/mcp/resources/brand.js +514 -0
  705. package/dist/mcp/resources/env.d.ts +10 -0
  706. package/dist/mcp/resources/env.js +120 -0
  707. package/dist/mcp/resources/help.d.ts +10 -0
  708. package/dist/mcp/resources/help.js +475 -0
  709. package/dist/mcp/resources/recipes.d.ts +13 -0
  710. package/dist/mcp/resources/recipes.js +270 -0
  711. package/dist/mcp/schemas/common.d.ts +22 -0
  712. package/dist/mcp/schemas/common.js +43 -0
  713. package/dist/mcp/server.d.ts +26 -0
  714. package/dist/mcp/server.js +88 -0
  715. package/dist/mcp/tools/access-check.d.ts +11 -0
  716. package/dist/mcp/tools/access-check.js +47 -0
  717. package/dist/mcp/tools/agents-recipe.d.ts +2 -0
  718. package/dist/mcp/tools/agents-recipe.js +139 -0
  719. package/dist/mcp/tools/agents.d.ts +2 -0
  720. package/dist/mcp/tools/agents.js +148 -0
  721. package/dist/mcp/tools/audit.d.ts +41 -0
  722. package/dist/mcp/tools/audit.js +584 -0
  723. package/dist/mcp/tools/bootstrap.d.ts +8 -0
  724. package/dist/mcp/tools/bootstrap.js +200 -0
  725. package/dist/mcp/tools/brand-recipe.d.ts +2 -0
  726. package/dist/mcp/tools/brand-recipe.js +123 -0
  727. package/dist/mcp/tools/brand.d.ts +28 -0
  728. package/dist/mcp/tools/brand.js +549 -0
  729. package/dist/mcp/tools/brief-recipe.d.ts +2 -0
  730. package/dist/mcp/tools/brief-recipe.js +123 -0
  731. package/dist/mcp/tools/brief.d.ts +16 -0
  732. package/dist/mcp/tools/brief.js +388 -0
  733. package/dist/mcp/tools/browse.d.ts +9 -0
  734. package/dist/mcp/tools/browse.js +57 -0
  735. package/dist/mcp/tools/campaign-recipe.d.ts +2 -0
  736. package/dist/mcp/tools/campaign-recipe.js +125 -0
  737. package/dist/mcp/tools/campaign.d.ts +20 -0
  738. package/dist/mcp/tools/campaign.js +342 -0
  739. package/dist/mcp/tools/cleanup.d.ts +22 -0
  740. package/dist/mcp/tools/cleanup.js +608 -0
  741. package/dist/mcp/tools/deploy.d.ts +19 -0
  742. package/dist/mcp/tools/deploy.js +797 -0
  743. package/dist/mcp/tools/explain.d.ts +2 -0
  744. package/dist/mcp/tools/explain.js +132 -0
  745. package/dist/mcp/tools/inspector.d.ts +12 -0
  746. package/dist/mcp/tools/inspector.js +101 -0
  747. package/dist/mcp/tools/onboard.d.ts +11 -0
  748. package/dist/mcp/tools/onboard.js +65 -0
  749. package/dist/mcp/tools/publish.d.ts +30 -0
  750. package/dist/mcp/tools/publish.js +173 -0
  751. package/dist/mcp/tools/recipe-sync.d.ts +2 -0
  752. package/dist/mcp/tools/recipe-sync.js +117 -0
  753. package/dist/mcp/tools/recipe.d.ts +18 -0
  754. package/dist/mcp/tools/recipe.js +250 -0
  755. package/dist/mcp/tools/serialization.d.ts +17 -0
  756. package/dist/mcp/tools/serialization.js +282 -0
  757. package/dist/mcp/tools/webhook.d.ts +12 -0
  758. package/dist/mcp/tools/webhook.js +246 -0
  759. package/dist/mcp/tools/workflow.d.ts +21 -0
  760. package/dist/mcp/tools/workflow.js +436 -0
  761. package/dist/policy/access-check.d.ts +56 -0
  762. package/dist/policy/access-check.js +160 -0
  763. package/dist/policy/allow-write.d.ts +37 -0
  764. package/dist/policy/allow-write.js +78 -0
  765. package/dist/policy/authorize.d.ts +36 -0
  766. package/dist/policy/authorize.js +102 -0
  767. package/dist/policy/caller.d.ts +23 -0
  768. package/dist/policy/caller.js +66 -0
  769. package/dist/policy/enforce.d.ts +25 -0
  770. package/dist/policy/enforce.js +57 -0
  771. package/dist/policy/enroll.d.ts +57 -0
  772. package/dist/policy/enroll.js +101 -0
  773. package/dist/policy/environment.d.ts +35 -0
  774. package/dist/policy/environment.js +44 -0
  775. package/dist/policy/identity.d.ts +24 -0
  776. package/dist/policy/identity.js +58 -0
  777. package/dist/policy/index.d.ts +22 -0
  778. package/dist/policy/index.js +42 -0
  779. package/dist/policy/operations.d.ts +24 -0
  780. package/dist/policy/operations.js +37 -0
  781. package/dist/policy/organization.d.ts +62 -0
  782. package/dist/policy/organization.js +97 -0
  783. package/dist/policy/paths.d.ts +21 -0
  784. package/dist/policy/paths.js +46 -0
  785. package/dist/policy/resolve.d.ts +15 -0
  786. package/dist/policy/resolve.js +67 -0
  787. package/dist/policy/schema.d.ts +137 -0
  788. package/dist/policy/schema.js +92 -0
  789. package/dist/policy/store.d.ts +25 -0
  790. package/dist/policy/store.js +85 -0
  791. package/dist/policy/types.d.ts +52 -0
  792. package/dist/policy/types.js +22 -0
  793. package/dist/program.d.ts +35 -0
  794. package/dist/program.js +131 -0
  795. package/dist/publishing/api/auth.d.ts +49 -0
  796. package/dist/publishing/api/auth.js +173 -0
  797. package/dist/publishing/api/client.d.ts +5 -0
  798. package/dist/publishing/api/client.js +153 -0
  799. package/dist/publishing/api/languages.d.ts +61 -0
  800. package/dist/publishing/api/languages.js +116 -0
  801. package/dist/publishing/api/path-resolver.d.ts +10 -0
  802. package/dist/publishing/api/path-resolver.js +76 -0
  803. package/dist/publishing/api/sites.d.ts +23 -0
  804. package/dist/publishing/api/sites.js +27 -0
  805. package/dist/publishing/api/types.d.ts +166 -0
  806. package/dist/publishing/api/types.js +17 -0
  807. package/dist/publishing/index.d.ts +25 -0
  808. package/dist/publishing/index.js +51 -0
  809. package/dist/publishing/job-diagnostics.d.ts +44 -0
  810. package/dist/publishing/job-diagnostics.js +87 -0
  811. package/dist/publishing/job-watcher.d.ts +33 -0
  812. package/dist/publishing/job-watcher.js +118 -0
  813. package/dist/publishing/tasks/all.d.ts +41 -0
  814. package/dist/publishing/tasks/all.js +234 -0
  815. package/dist/publishing/tasks/cancel.d.ts +18 -0
  816. package/dist/publishing/tasks/cancel.js +147 -0
  817. package/dist/publishing/tasks/history.d.ts +22 -0
  818. package/dist/publishing/tasks/history.js +85 -0
  819. package/dist/publishing/tasks/item.d.ts +69 -0
  820. package/dist/publishing/tasks/item.js +194 -0
  821. package/dist/publishing/tasks/status.d.ts +17 -0
  822. package/dist/publishing/tasks/status.js +74 -0
  823. package/dist/publishing/tasks/unpublish.d.ts +69 -0
  824. package/dist/publishing/tasks/unpublish.js +546 -0
  825. package/dist/recipe/api/auth.d.ts +1 -2
  826. package/dist/recipe/api/auth.js +1 -1
  827. package/dist/recipe/api/authoring-client.d.ts +9 -3
  828. package/dist/recipe/api/authoring-client.js +101 -17
  829. package/dist/recipe/api/client.d.ts +50 -1
  830. package/dist/recipe/api/graphql.d.ts +2 -3
  831. package/dist/recipe/api/graphql.js +1 -1
  832. package/dist/recipe/api/ref-encoding.d.ts +0 -1
  833. package/dist/recipe/api/ref-encoding.js +5 -5
  834. package/dist/recipe/api/site-discovery.d.ts +1 -2
  835. package/dist/recipe/api/sites-client.d.ts +6 -3
  836. package/dist/recipe/api/sites-client.js +11 -8
  837. package/dist/recipe/cache.d.ts +0 -1
  838. package/dist/recipe/compile/component-section.d.ts +1 -2
  839. package/dist/recipe/compile/component-section.js +2 -2
  840. package/dist/recipe/compile/component-template.d.ts +0 -1
  841. package/dist/recipe/compile/component-template.js +15 -19
  842. package/dist/recipe/compile/content-item.d.ts +42 -22
  843. package/dist/recipe/compile/content-item.js +198 -46
  844. package/dist/recipe/compile/content-template.d.ts +0 -1
  845. package/dist/recipe/compile/content-template.js +25 -1
  846. package/dist/recipe/compile/design-parameters-template.d.ts +13 -0
  847. package/dist/recipe/compile/design-parameters-template.js +92 -0
  848. package/dist/recipe/compile/enumeration.d.ts +0 -1
  849. package/dist/recipe/compile/enumeration.js +4 -4
  850. package/dist/recipe/compile/page-design.d.ts +0 -1
  851. package/dist/recipe/compile/page-design.js +1 -1
  852. package/dist/recipe/compile/page-template.d.ts +30 -0
  853. package/dist/recipe/compile/page-template.js +121 -0
  854. package/dist/recipe/compile/page.d.ts +26 -0
  855. package/dist/recipe/compile/page.js +184 -0
  856. package/dist/recipe/compile/partial-design.d.ts +0 -1
  857. package/dist/recipe/compile/partial-design.js +1 -1
  858. package/dist/recipe/compile/placeholder.d.ts +23 -0
  859. package/dist/recipe/compile/placeholder.js +32 -0
  860. package/dist/recipe/compile/section-definition.d.ts +0 -1
  861. package/dist/recipe/compile/shared.d.ts +52 -7
  862. package/dist/recipe/compile/shared.js +55 -15
  863. package/dist/recipe/compile/site-template.d.ts +0 -1
  864. package/dist/recipe/compile/site-template.js +1 -1
  865. package/dist/recipe/compile/site.d.ts +0 -1
  866. package/dist/recipe/compile/site.js +1 -1
  867. package/dist/recipe/compile/webhook-authorization.d.ts +23 -0
  868. package/dist/recipe/compile/webhook-authorization.js +116 -0
  869. package/dist/recipe/compile/workflow.d.ts +46 -0
  870. package/dist/recipe/compile/workflow.js +368 -0
  871. package/dist/recipe/compile.d.ts +19 -3
  872. package/dist/recipe/compile.js +297 -11
  873. package/dist/recipe/ensure-marker-field.d.ts +25 -0
  874. package/dist/recipe/ensure-marker-field.js +140 -0
  875. package/dist/recipe/execute.d.ts +19 -2
  876. package/dist/recipe/execute.js +39 -8
  877. package/dist/recipe/guids.d.ts +106 -9
  878. package/dist/recipe/guids.js +126 -15
  879. package/dist/recipe/index.d.ts +11 -5
  880. package/dist/recipe/index.js +46 -23
  881. package/dist/recipe/io.d.ts +0 -1
  882. package/dist/recipe/io.js +33 -10
  883. package/dist/recipe/ir/operations.d.ts +66 -4
  884. package/dist/recipe/ir/operations.js +55 -2
  885. package/dist/recipe/ir/sitecore-templates.d.ts +87 -1
  886. package/dist/recipe/ir/sitecore-templates.js +94 -1
  887. package/dist/recipe/layout/emit.d.ts +22 -3
  888. package/dist/recipe/layout/emit.js +18 -7
  889. package/dist/recipe/layout/parse.d.ts +164 -0
  890. package/dist/recipe/layout/parse.js +295 -0
  891. package/dist/recipe/layout/templates-mapping.d.ts +0 -1
  892. package/dist/recipe/marker.d.ts +28 -0
  893. package/dist/recipe/marker.js +37 -0
  894. package/dist/recipe/plan.d.ts +9 -2
  895. package/dist/recipe/plan.js +195 -19
  896. package/dist/recipe/policy.d.ts +0 -1
  897. package/dist/recipe/policy.js +19 -1
  898. package/dist/recipe/read-current.d.ts +109 -0
  899. package/dist/recipe/read-current.js +1285 -0
  900. package/dist/recipe/recipe-kind.d.ts +4 -0
  901. package/dist/recipe/recipe-kind.js +217 -0
  902. package/dist/recipe/rollback-log.d.ts +52 -0
  903. package/dist/recipe/rollback-log.js +90 -0
  904. package/dist/recipe/rollback.d.ts +12 -1
  905. package/dist/recipe/rollback.js +32 -7
  906. package/dist/recipe/sandbox/load.d.ts +17 -0
  907. package/dist/recipe/sandbox/load.js +145 -0
  908. package/dist/recipe/sandbox/recipe-runner.cjs +49 -0
  909. package/dist/recipe/sandbox/transpile.d.ts +17 -0
  910. package/dist/recipe/sandbox/transpile.js +46 -0
  911. package/dist/recipe/schema/field-types.d.ts +3 -4
  912. package/dist/recipe/schema/recipe.d.ts +1631 -213
  913. package/dist/recipe/schema/recipe.js +576 -37
  914. package/dist/recipe/schema/source-fields.d.ts +0 -1
  915. package/dist/recipe/tasks/compile.d.ts +1 -2
  916. package/dist/recipe/tasks/compile.js +14 -4
  917. package/dist/recipe/tasks/diff.d.ts +1 -2
  918. package/dist/recipe/tasks/placeholder-allow.d.ts +0 -1
  919. package/dist/recipe/tasks/placeholder-allow.js +3 -7
  920. package/dist/recipe/tasks/plan.d.ts +3 -4
  921. package/dist/recipe/tasks/plan.js +5 -5
  922. package/dist/recipe/tasks/prune-defaults.d.ts +1 -2
  923. package/dist/recipe/tasks/prune-defaults.js +6 -7
  924. package/dist/recipe/tasks/push.d.ts +1 -2
  925. package/dist/recipe/tasks/push.js +46 -6
  926. package/dist/recipe/tasks/shared.d.ts +21 -4
  927. package/dist/recipe/tasks/shared.js +34 -21
  928. package/dist/recipe/unstable.d.ts +18 -0
  929. package/dist/recipe/unstable.js +36 -0
  930. package/dist/recipe/validate.d.ts +51 -2
  931. package/dist/recipe/validate.js +162 -15
  932. package/dist/scripting/connect.d.ts +24 -0
  933. package/dist/scripting/connect.js +17 -0
  934. package/dist/scripting/helpers/multilist.d.ts +26 -0
  935. package/dist/scripting/helpers/multilist.js +75 -0
  936. package/dist/scripting/index.d.ts +20 -0
  937. package/dist/scripting/index.js +57 -0
  938. package/dist/serialization/api/auth.d.ts +57 -0
  939. package/dist/serialization/api/auth.js +433 -0
  940. package/dist/serialization/api/client.d.ts +41 -0
  941. package/dist/serialization/api/client.js +41 -0
  942. package/dist/serialization/api/graphql.d.ts +11 -0
  943. package/dist/serialization/api/history.d.ts +8 -0
  944. package/dist/serialization/api/index.d.ts +23 -0
  945. package/dist/serialization/api/index.js +64 -0
  946. package/dist/serialization/api/items.d.ts +7 -0
  947. package/dist/serialization/api/items.js +132 -0
  948. package/dist/serialization/api/publish.d.ts +43 -0
  949. package/dist/serialization/api/publish.js +67 -0
  950. package/dist/serialization/api/roles.d.ts +8 -0
  951. package/dist/serialization/api/types.d.ts +65 -0
  952. package/dist/serialization/api/types.js +2 -0
  953. package/dist/serialization/api/users.d.ts +8 -0
  954. package/dist/serialization/commands.d.ts +0 -1
  955. package/dist/serialization/compare.d.ts +0 -1
  956. package/dist/serialization/context.d.ts +25 -0
  957. package/dist/serialization/context.js +58 -0
  958. package/dist/serialization/field-filter.d.ts +0 -1
  959. package/dist/serialization/filesystem-store/constants.d.ts +0 -1
  960. package/dist/serialization/filesystem-store/items.d.ts +0 -1
  961. package/dist/serialization/filesystem-store/items.js +1 -1
  962. package/dist/serialization/filesystem-store/roles.d.ts +1 -2
  963. package/dist/serialization/filesystem-store/users.d.ts +1 -2
  964. package/dist/serialization/filesystem-store/utils.d.ts +0 -1
  965. package/dist/serialization/index.d.ts +12 -0
  966. package/dist/serialization/index.js +32 -0
  967. package/dist/serialization/item-path.d.ts +0 -1
  968. package/dist/serialization/item-path.js +3 -3
  969. package/dist/serialization/path-provider.d.ts +0 -1
  970. package/dist/serialization/path-provider.js +4 -4
  971. package/dist/serialization/signature.d.ts +0 -1
  972. package/dist/serialization/tasks/diff.d.ts +0 -1
  973. package/dist/serialization/tasks/diff.js +176 -48
  974. package/dist/serialization/tasks/env/constants.d.ts +13 -1
  975. package/dist/serialization/tasks/env/constants.js +64 -1
  976. package/dist/serialization/tasks/env/deploy-token.d.ts +0 -1
  977. package/dist/serialization/tasks/env/deploy-token.js +69 -17
  978. package/dist/serialization/tasks/env/init/auth.d.ts +11 -3
  979. package/dist/serialization/tasks/env/init/auth.js +19 -17
  980. package/dist/serialization/tasks/env/init/deploy-lookup.d.ts +1 -2
  981. package/dist/serialization/tasks/env/init/deploy-lookup.js +18 -5
  982. package/dist/serialization/tasks/env/init.d.ts +0 -1
  983. package/dist/serialization/tasks/env/init.js +18 -12
  984. package/dist/serialization/tasks/env/logout.d.ts +0 -1
  985. package/dist/serialization/tasks/env/logout.js +13 -6
  986. package/dist/serialization/tasks/env/onboard.d.ts +40 -0
  987. package/dist/serialization/tasks/env/onboard.js +53 -0
  988. package/dist/serialization/tasks/env/setup-clients.d.ts +24 -0
  989. package/dist/serialization/tasks/env/setup-clients.js +119 -0
  990. package/dist/serialization/tasks/env/setup-env.d.ts +54 -0
  991. package/dist/serialization/tasks/env/setup-env.js +216 -0
  992. package/dist/serialization/tasks/env/setup-org-client.d.ts +21 -0
  993. package/dist/serialization/tasks/env/setup-org-client.js +146 -0
  994. package/dist/serialization/tasks/env/status.d.ts +0 -1
  995. package/dist/serialization/tasks/env/status.js +36 -11
  996. package/dist/serialization/tasks/helpers/collect.d.ts +1 -2
  997. package/dist/serialization/tasks/helpers/collect.js +22 -15
  998. package/dist/serialization/tasks/helpers/commands.d.ts +0 -1
  999. package/dist/serialization/tasks/helpers/filesystem.d.ts +0 -1
  1000. package/dist/serialization/tasks/helpers/filesystem.js +4 -4
  1001. package/dist/serialization/tasks/helpers/items.d.ts +0 -1
  1002. package/dist/serialization/tasks/helpers/sitecore.d.ts +1 -2
  1003. package/dist/serialization/tasks/helpers/sitecore.js +2 -2
  1004. package/dist/serialization/tasks/info.d.ts +0 -1
  1005. package/dist/serialization/tasks/package.d.ts +0 -1
  1006. package/dist/serialization/tasks/package.js +21 -16
  1007. package/dist/serialization/tasks/pull.d.ts +0 -1
  1008. package/dist/serialization/tasks/pull.js +24 -9
  1009. package/dist/serialization/tasks/push.d.ts +0 -1
  1010. package/dist/serialization/tasks/push.js +27 -11
  1011. package/dist/serialization/tasks/roles.d.ts +2 -2
  1012. package/dist/serialization/tasks/roles.js +9 -9
  1013. package/dist/serialization/tasks/shared.d.ts +9 -16
  1014. package/dist/serialization/tasks/shared.js +14 -44
  1015. package/dist/serialization/tasks/types.d.ts +44 -4
  1016. package/dist/serialization/tasks/types.js +1 -1
  1017. package/dist/serialization/tasks/users.d.ts +2 -2
  1018. package/dist/serialization/tasks/users.js +9 -9
  1019. package/dist/serialization/tasks/validate.d.ts +0 -1
  1020. package/dist/serialization/tasks/validate.js +2 -2
  1021. package/dist/serialization/tasks/watch.d.ts +0 -1
  1022. package/dist/serialization/tasks/watch.js +9 -8
  1023. package/dist/serialization/tree-spec.d.ts +0 -1
  1024. package/dist/serialization/tree-spec.js +21 -21
  1025. package/dist/serialization/types.d.ts +0 -1
  1026. package/dist/serialization/wildcard.d.ts +0 -1
  1027. package/dist/serialization/wildcard.js +2 -2
  1028. package/dist/serialization/yaml.d.ts +0 -1
  1029. package/dist/serialization/yaml.js +1 -1
  1030. package/dist/shared/browser.d.ts +0 -1
  1031. package/dist/shared/cli-options.d.ts +0 -1
  1032. package/dist/shared/cli-tasks.d.ts +1 -2
  1033. package/dist/shared/cli-tasks.js +2 -2
  1034. package/dist/shared/client-credential.d.ts +82 -0
  1035. package/dist/shared/client-credential.js +117 -0
  1036. package/dist/shared/concurrency.d.ts +20 -0
  1037. package/dist/shared/concurrency.js +67 -0
  1038. package/dist/shared/config-template.d.ts +0 -1
  1039. package/dist/shared/credential-matrix.d.ts +83 -0
  1040. package/dist/shared/credential-matrix.js +65 -0
  1041. package/dist/shared/env-tier.d.ts +2 -0
  1042. package/dist/shared/env-tier.js +31 -0
  1043. package/dist/shared/envelope.d.ts +69 -0
  1044. package/dist/shared/envelope.js +84 -0
  1045. package/dist/shared/errors.d.ts +79 -9
  1046. package/dist/shared/errors.js +49 -11
  1047. package/dist/shared/graphql.d.ts +2 -3
  1048. package/dist/shared/graphql.js +31 -15
  1049. package/dist/shared/history.d.ts +25 -1
  1050. package/dist/shared/history.js +35 -1
  1051. package/dist/shared/human-only-operations.d.ts +28 -0
  1052. package/dist/shared/human-only-operations.js +33 -0
  1053. package/dist/shared/keychain.d.ts +68 -1
  1054. package/dist/shared/keychain.js +416 -46
  1055. package/dist/shared/logger.d.ts +2 -1
  1056. package/dist/shared/logger.js +12 -1
  1057. package/dist/shared/output.d.ts +0 -1
  1058. package/dist/shared/prompt.d.ts +0 -1
  1059. package/dist/shared/prompt.js +2 -2
  1060. package/dist/shared/publish-audit.d.ts +154 -0
  1061. package/dist/shared/publish-audit.js +52 -0
  1062. package/dist/shared/publish-consent.d.ts +104 -0
  1063. package/dist/shared/publish-consent.js +148 -0
  1064. package/dist/shared/redact.d.ts +0 -1
  1065. package/dist/shared/redact.js +4 -2
  1066. package/dist/shared/region.d.ts +96 -0
  1067. package/dist/shared/region.js +129 -0
  1068. package/dist/shared/rwlock.d.ts +43 -0
  1069. package/dist/shared/rwlock.js +110 -0
  1070. package/dist/shared/spinner.d.ts +0 -1
  1071. package/dist/shared/style.d.ts +0 -1
  1072. package/dist/shared/telemetry.d.ts +15 -2
  1073. package/dist/shared/telemetry.js +59 -34
  1074. package/dist/shared/topics.d.ts +33 -0
  1075. package/dist/shared/topics.js +151 -0
  1076. package/dist/shared/validate.d.ts +0 -1
  1077. package/dist/shared/validate.js +18 -3
  1078. package/dist/sites/api/collections.d.ts +0 -1
  1079. package/dist/sites/api/jobs.d.ts +0 -1
  1080. package/dist/sites/api/languages.d.ts +0 -1
  1081. package/dist/sites/api/request.d.ts +0 -1
  1082. package/dist/sites/api/request.js +13 -4
  1083. package/dist/sites/api/sites.d.ts +44 -1
  1084. package/dist/sites/api/sites.js +42 -1
  1085. package/dist/sites/api/types.d.ts +0 -1
  1086. package/dist/sites/index.d.ts +25 -0
  1087. package/dist/sites/index.js +44 -0
  1088. package/dist/sync/aggregate-kinds.d.ts +7 -0
  1089. package/dist/sync/aggregate-kinds.js +32 -0
  1090. package/dist/sync/aggregate.d.ts +100 -0
  1091. package/dist/sync/aggregate.js +173 -0
  1092. package/dist/sync/engine.d.ts +28 -0
  1093. package/dist/sync/engine.js +38 -0
  1094. package/dist/sync/index.d.ts +18 -0
  1095. package/dist/sync/index.js +25 -0
  1096. package/dist/sync/io.d.ts +8 -0
  1097. package/dist/sync/io.js +52 -0
  1098. package/dist/sync/kind.d.ts +80 -0
  1099. package/dist/sync/kind.js +2 -0
  1100. package/dist/sync/plan.d.ts +55 -0
  1101. package/dist/sync/plan.js +27 -0
  1102. package/dist/sync/registry.d.ts +7 -0
  1103. package/dist/sync/registry.js +36 -0
  1104. package/dist/webhooks/api/client.d.ts +134 -0
  1105. package/dist/webhooks/api/client.js +326 -0
  1106. package/dist/webhooks/api/graphql.d.ts +4 -0
  1107. package/dist/webhooks/api/graphql.js +18 -0
  1108. package/dist/webhooks/api/templates.d.ts +41 -0
  1109. package/dist/webhooks/api/templates.js +78 -0
  1110. package/dist/webhooks/index.d.ts +16 -0
  1111. package/dist/webhooks/index.js +43 -0
  1112. package/dist/webhooks/tasks/create.d.ts +58 -0
  1113. package/dist/webhooks/tasks/create.js +127 -0
  1114. package/dist/webhooks/tasks/delete.d.ts +14 -0
  1115. package/dist/webhooks/tasks/delete.js +57 -0
  1116. package/dist/webhooks/tasks/event-types.d.ts +21 -0
  1117. package/dist/webhooks/tasks/event-types.js +32 -0
  1118. package/dist/webhooks/tasks/inspect.d.ts +12 -0
  1119. package/dist/webhooks/tasks/inspect.js +65 -0
  1120. package/dist/webhooks/tasks/list.d.ts +29 -0
  1121. package/dist/webhooks/tasks/list.js +41 -0
  1122. package/dist/webhooks/tasks/shared.d.ts +35 -0
  1123. package/dist/webhooks/tasks/shared.js +38 -0
  1124. package/dist/workflow/api/client.d.ts +208 -0
  1125. package/dist/workflow/api/client.js +421 -0
  1126. package/dist/workflow/api/graphql.d.ts +4 -0
  1127. package/dist/workflow/api/graphql.js +18 -0
  1128. package/dist/workflow/api/resolve-command.d.ts +27 -0
  1129. package/dist/workflow/api/resolve-command.js +26 -0
  1130. package/dist/workflow/index.d.ts +18 -0
  1131. package/dist/workflow/index.js +37 -0
  1132. package/dist/workflow/tasks/advance.d.ts +39 -0
  1133. package/dist/workflow/tasks/advance.js +182 -0
  1134. package/dist/workflow/tasks/apply.d.ts +47 -0
  1135. package/dist/workflow/tasks/apply.js +193 -0
  1136. package/dist/workflow/tasks/assigned.d.ts +33 -0
  1137. package/dist/workflow/tasks/assigned.js +41 -0
  1138. package/dist/workflow/tasks/inspect.d.ts +60 -0
  1139. package/dist/workflow/tasks/inspect.js +171 -0
  1140. package/dist/workflow/tasks/list-commands.d.ts +21 -0
  1141. package/dist/workflow/tasks/list-commands.js +54 -0
  1142. package/dist/workflow/tasks/list-defs.d.ts +21 -0
  1143. package/dist/workflow/tasks/list-defs.js +28 -0
  1144. package/dist/workflow/tasks/reset.d.ts +33 -0
  1145. package/dist/workflow/tasks/reset.js +137 -0
  1146. package/dist/workflow/tasks/shared.d.ts +75 -0
  1147. package/dist/workflow/tasks/shared.js +124 -0
  1148. package/dist/workflow/tasks/status.d.ts +21 -0
  1149. package/dist/workflow/tasks/status.js +41 -0
  1150. package/package.json +102 -8
  1151. package/dist/cli.d.ts.map +0 -1
  1152. package/dist/commands/config.d.ts.map +0 -1
  1153. package/dist/commands/deploy/deployments.d.ts.map +0 -1
  1154. package/dist/commands/deploy/editing-host.d.ts.map +0 -1
  1155. package/dist/commands/deploy/environments/deployments.d.ts.map +0 -1
  1156. package/dist/commands/deploy/environments/index.d.ts.map +0 -1
  1157. package/dist/commands/deploy/environments/mutations.d.ts.map +0 -1
  1158. package/dist/commands/deploy/environments/queries.d.ts.map +0 -1
  1159. package/dist/commands/deploy/environments/variables.d.ts.map +0 -1
  1160. package/dist/commands/deploy/environments.d.ts.map +0 -1
  1161. package/dist/commands/deploy/index.d.ts.map +0 -1
  1162. package/dist/commands/deploy/logs.d.ts.map +0 -1
  1163. package/dist/commands/deploy/organizations.d.ts.map +0 -1
  1164. package/dist/commands/deploy/projects.d.ts.map +0 -1
  1165. package/dist/commands/deploy/shared.d.ts.map +0 -1
  1166. package/dist/commands/deploy/site.d.ts.map +0 -1
  1167. package/dist/commands/deploy/source-control.d.ts.map +0 -1
  1168. package/dist/commands/deploy.d.ts.map +0 -1
  1169. package/dist/commands/history.d.ts.map +0 -1
  1170. package/dist/commands/init.d.ts.map +0 -1
  1171. package/dist/commands/login.d.ts.map +0 -1
  1172. package/dist/commands/logout.d.ts.map +0 -1
  1173. package/dist/commands/recipe/index.d.ts.map +0 -1
  1174. package/dist/commands/serialization/index.d.ts.map +0 -1
  1175. package/dist/commands/serialization/package.d.ts.map +0 -1
  1176. package/dist/commands/shared.d.ts.map +0 -1
  1177. package/dist/commands/shell.d.ts.map +0 -1
  1178. package/dist/commands/status.d.ts.map +0 -1
  1179. package/dist/commands/telemetry.d.ts.map +0 -1
  1180. package/dist/config/env-overrides.d.ts.map +0 -1
  1181. package/dist/config/index.d.ts.map +0 -1
  1182. package/dist/config/modules.d.ts.map +0 -1
  1183. package/dist/config/paths.d.ts.map +0 -1
  1184. package/dist/config/root-config.d.ts.map +0 -1
  1185. package/dist/config/types.d.ts.map +0 -1
  1186. package/dist/config/validation.d.ts.map +0 -1
  1187. package/dist/deploy/api/common/headers.d.ts.map +0 -1
  1188. package/dist/deploy/api/common/index.d.ts +0 -4
  1189. package/dist/deploy/api/common/index.d.ts.map +0 -1
  1190. package/dist/deploy/api/common/index.js +0 -19
  1191. package/dist/deploy/api/common/request.d.ts.map +0 -1
  1192. package/dist/deploy/api/common/types.d.ts.map +0 -1
  1193. package/dist/deploy/api/common.d.ts +0 -2
  1194. package/dist/deploy/api/common.d.ts.map +0 -1
  1195. package/dist/deploy/api/common.js +0 -17
  1196. package/dist/deploy/api/deployment-logs.d.ts.map +0 -1
  1197. package/dist/deploy/api/deployments.d.ts.map +0 -1
  1198. package/dist/deploy/api/environments.d.ts.map +0 -1
  1199. package/dist/deploy/api/index.d.ts.map +0 -1
  1200. package/dist/deploy/api/logs.d.ts.map +0 -1
  1201. package/dist/deploy/api/organizations.d.ts.map +0 -1
  1202. package/dist/deploy/api/projects.d.ts.map +0 -1
  1203. package/dist/deploy/api/source-control.d.ts.map +0 -1
  1204. package/dist/deploy/api.d.ts.map +0 -1
  1205. package/dist/deploy/tasks/deployment-result.d.ts.map +0 -1
  1206. package/dist/deploy/tasks/deployments.d.ts.map +0 -1
  1207. package/dist/deploy/tasks/editing-host.d.ts.map +0 -1
  1208. package/dist/deploy/tasks/environments.d.ts.map +0 -1
  1209. package/dist/deploy/tasks/index.d.ts +0 -10
  1210. package/dist/deploy/tasks/index.d.ts.map +0 -1
  1211. package/dist/deploy/tasks/index.js +0 -25
  1212. package/dist/deploy/tasks/logs.d.ts.map +0 -1
  1213. package/dist/deploy/tasks/organizations.d.ts.map +0 -1
  1214. package/dist/deploy/tasks/projects.d.ts.map +0 -1
  1215. package/dist/deploy/tasks/shared.d.ts.map +0 -1
  1216. package/dist/deploy/tasks/site-bind.d.ts.map +0 -1
  1217. package/dist/deploy/tasks/site.d.ts.map +0 -1
  1218. package/dist/deploy/tasks/source-control.d.ts.map +0 -1
  1219. package/dist/deploy/tasks/types.d.ts.map +0 -1
  1220. package/dist/deploy/tasks.d.ts +0 -3
  1221. package/dist/deploy/tasks.d.ts.map +0 -1
  1222. package/dist/deploy/tasks.js +0 -18
  1223. package/dist/recipe/api/auth.d.ts.map +0 -1
  1224. package/dist/recipe/api/authoring-client.d.ts.map +0 -1
  1225. package/dist/recipe/api/client.d.ts.map +0 -1
  1226. package/dist/recipe/api/graphql.d.ts.map +0 -1
  1227. package/dist/recipe/api/ref-encoding.d.ts.map +0 -1
  1228. package/dist/recipe/api/site-discovery.d.ts.map +0 -1
  1229. package/dist/recipe/api/sites-client.d.ts.map +0 -1
  1230. package/dist/recipe/cache.d.ts.map +0 -1
  1231. package/dist/recipe/compile/component-section.d.ts.map +0 -1
  1232. package/dist/recipe/compile/component-template.d.ts.map +0 -1
  1233. package/dist/recipe/compile/content-item.d.ts.map +0 -1
  1234. package/dist/recipe/compile/content-template.d.ts.map +0 -1
  1235. package/dist/recipe/compile/enumeration.d.ts.map +0 -1
  1236. package/dist/recipe/compile/page-design.d.ts.map +0 -1
  1237. package/dist/recipe/compile/parameters-template.d.ts +0 -14
  1238. package/dist/recipe/compile/parameters-template.d.ts.map +0 -1
  1239. package/dist/recipe/compile/parameters-template.js +0 -92
  1240. package/dist/recipe/compile/partial-design.d.ts.map +0 -1
  1241. package/dist/recipe/compile/section-definition.d.ts.map +0 -1
  1242. package/dist/recipe/compile/shared.d.ts.map +0 -1
  1243. package/dist/recipe/compile/site-template.d.ts.map +0 -1
  1244. package/dist/recipe/compile/site.d.ts.map +0 -1
  1245. package/dist/recipe/compile.d.ts.map +0 -1
  1246. package/dist/recipe/execute.d.ts.map +0 -1
  1247. package/dist/recipe/guids.d.ts.map +0 -1
  1248. package/dist/recipe/index.d.ts.map +0 -1
  1249. package/dist/recipe/io.d.ts.map +0 -1
  1250. package/dist/recipe/ir/operations.d.ts.map +0 -1
  1251. package/dist/recipe/ir/sitecore-templates.d.ts.map +0 -1
  1252. package/dist/recipe/layout/emit.d.ts.map +0 -1
  1253. package/dist/recipe/layout/templates-mapping.d.ts.map +0 -1
  1254. package/dist/recipe/plan.d.ts.map +0 -1
  1255. package/dist/recipe/policy.d.ts.map +0 -1
  1256. package/dist/recipe/rollback.d.ts.map +0 -1
  1257. package/dist/recipe/schema/field-types.d.ts.map +0 -1
  1258. package/dist/recipe/schema/recipe.d.ts.map +0 -1
  1259. package/dist/recipe/schema/source-fields.d.ts.map +0 -1
  1260. package/dist/recipe/tasks/compile.d.ts.map +0 -1
  1261. package/dist/recipe/tasks/diff.d.ts.map +0 -1
  1262. package/dist/recipe/tasks/index.d.ts +0 -9
  1263. package/dist/recipe/tasks/index.d.ts.map +0 -1
  1264. package/dist/recipe/tasks/index.js +0 -13
  1265. package/dist/recipe/tasks/placeholder-allow.d.ts.map +0 -1
  1266. package/dist/recipe/tasks/plan.d.ts.map +0 -1
  1267. package/dist/recipe/tasks/prune-defaults.d.ts.map +0 -1
  1268. package/dist/recipe/tasks/push.d.ts.map +0 -1
  1269. package/dist/recipe/tasks/shared.d.ts.map +0 -1
  1270. package/dist/recipe/validate.d.ts.map +0 -1
  1271. package/dist/serialization/commands.d.ts.map +0 -1
  1272. package/dist/serialization/compare.d.ts.map +0 -1
  1273. package/dist/serialization/field-filter.d.ts.map +0 -1
  1274. package/dist/serialization/filesystem-store/constants.d.ts.map +0 -1
  1275. package/dist/serialization/filesystem-store/index.d.ts +0 -4
  1276. package/dist/serialization/filesystem-store/index.d.ts.map +0 -1
  1277. package/dist/serialization/filesystem-store/index.js +0 -15
  1278. package/dist/serialization/filesystem-store/items.d.ts.map +0 -1
  1279. package/dist/serialization/filesystem-store/roles.d.ts.map +0 -1
  1280. package/dist/serialization/filesystem-store/users.d.ts.map +0 -1
  1281. package/dist/serialization/filesystem-store/utils.d.ts.map +0 -1
  1282. package/dist/serialization/filesystem-store.d.ts +0 -2
  1283. package/dist/serialization/filesystem-store.d.ts.map +0 -1
  1284. package/dist/serialization/filesystem-store.js +0 -17
  1285. package/dist/serialization/item-path.d.ts.map +0 -1
  1286. package/dist/serialization/path-provider.d.ts.map +0 -1
  1287. package/dist/serialization/signature.d.ts.map +0 -1
  1288. package/dist/serialization/sitecore-api/auth.d.ts +0 -31
  1289. package/dist/serialization/sitecore-api/auth.d.ts.map +0 -1
  1290. package/dist/serialization/sitecore-api/auth.js +0 -319
  1291. package/dist/serialization/sitecore-api/graphql.d.ts +0 -12
  1292. package/dist/serialization/sitecore-api/graphql.d.ts.map +0 -1
  1293. package/dist/serialization/sitecore-api/history.d.ts +0 -9
  1294. package/dist/serialization/sitecore-api/history.d.ts.map +0 -1
  1295. package/dist/serialization/sitecore-api/index.d.ts +0 -7
  1296. package/dist/serialization/sitecore-api/index.d.ts.map +0 -1
  1297. package/dist/serialization/sitecore-api/index.js +0 -22
  1298. package/dist/serialization/sitecore-api/items.d.ts +0 -8
  1299. package/dist/serialization/sitecore-api/items.d.ts.map +0 -1
  1300. package/dist/serialization/sitecore-api/items.js +0 -132
  1301. package/dist/serialization/sitecore-api/publish.d.ts +0 -14
  1302. package/dist/serialization/sitecore-api/publish.d.ts.map +0 -1
  1303. package/dist/serialization/sitecore-api/publish.js +0 -43
  1304. package/dist/serialization/sitecore-api/roles.d.ts +0 -9
  1305. package/dist/serialization/sitecore-api/roles.d.ts.map +0 -1
  1306. package/dist/serialization/sitecore-api/users.d.ts +0 -9
  1307. package/dist/serialization/sitecore-api/users.d.ts.map +0 -1
  1308. package/dist/serialization/sitecore-api.d.ts +0 -2
  1309. package/dist/serialization/sitecore-api.d.ts.map +0 -1
  1310. package/dist/serialization/sitecore-api.js +0 -17
  1311. package/dist/serialization/tasks/diff.d.ts.map +0 -1
  1312. package/dist/serialization/tasks/env/constants.d.ts.map +0 -1
  1313. package/dist/serialization/tasks/env/deploy-token.d.ts.map +0 -1
  1314. package/dist/serialization/tasks/env/index.d.ts +0 -5
  1315. package/dist/serialization/tasks/env/index.d.ts.map +0 -1
  1316. package/dist/serialization/tasks/env/index.js +0 -11
  1317. package/dist/serialization/tasks/env/init/auth.d.ts.map +0 -1
  1318. package/dist/serialization/tasks/env/init/deploy-lookup.d.ts.map +0 -1
  1319. package/dist/serialization/tasks/env/init.d.ts.map +0 -1
  1320. package/dist/serialization/tasks/env/logout.d.ts.map +0 -1
  1321. package/dist/serialization/tasks/env/status.d.ts.map +0 -1
  1322. package/dist/serialization/tasks/env.d.ts +0 -2
  1323. package/dist/serialization/tasks/env.d.ts.map +0 -1
  1324. package/dist/serialization/tasks/env.js +0 -17
  1325. package/dist/serialization/tasks/helpers/collect.d.ts.map +0 -1
  1326. package/dist/serialization/tasks/helpers/commands.d.ts.map +0 -1
  1327. package/dist/serialization/tasks/helpers/filesystem.d.ts.map +0 -1
  1328. package/dist/serialization/tasks/helpers/index.d.ts +0 -6
  1329. package/dist/serialization/tasks/helpers/index.d.ts.map +0 -1
  1330. package/dist/serialization/tasks/helpers/index.js +0 -13
  1331. package/dist/serialization/tasks/helpers/items.d.ts.map +0 -1
  1332. package/dist/serialization/tasks/helpers/sitecore.d.ts.map +0 -1
  1333. package/dist/serialization/tasks/helpers.d.ts +0 -2
  1334. package/dist/serialization/tasks/helpers.d.ts.map +0 -1
  1335. package/dist/serialization/tasks/helpers.js +0 -17
  1336. package/dist/serialization/tasks/index.d.ts +0 -8
  1337. package/dist/serialization/tasks/index.d.ts.map +0 -1
  1338. package/dist/serialization/tasks/index.js +0 -19
  1339. package/dist/serialization/tasks/info.d.ts.map +0 -1
  1340. package/dist/serialization/tasks/package.d.ts.map +0 -1
  1341. package/dist/serialization/tasks/pull.d.ts.map +0 -1
  1342. package/dist/serialization/tasks/push.d.ts.map +0 -1
  1343. package/dist/serialization/tasks/roles.d.ts.map +0 -1
  1344. package/dist/serialization/tasks/shared.d.ts.map +0 -1
  1345. package/dist/serialization/tasks/types.d.ts.map +0 -1
  1346. package/dist/serialization/tasks/users.d.ts.map +0 -1
  1347. package/dist/serialization/tasks/validate.d.ts.map +0 -1
  1348. package/dist/serialization/tasks/watch.d.ts.map +0 -1
  1349. package/dist/serialization/tasks.d.ts +0 -4
  1350. package/dist/serialization/tasks.d.ts.map +0 -1
  1351. package/dist/serialization/tasks.js +0 -19
  1352. package/dist/serialization/tree-spec.d.ts.map +0 -1
  1353. package/dist/serialization/types.d.ts.map +0 -1
  1354. package/dist/serialization/wildcard.d.ts.map +0 -1
  1355. package/dist/serialization/yaml.d.ts.map +0 -1
  1356. package/dist/shared/browser.d.ts.map +0 -1
  1357. package/dist/shared/cli-options.d.ts.map +0 -1
  1358. package/dist/shared/cli-tasks.d.ts.map +0 -1
  1359. package/dist/shared/config-template.d.ts.map +0 -1
  1360. package/dist/shared/env.d.ts +0 -28
  1361. package/dist/shared/env.d.ts.map +0 -1
  1362. package/dist/shared/env.js +0 -38
  1363. package/dist/shared/errors.d.ts.map +0 -1
  1364. package/dist/shared/graphql.d.ts.map +0 -1
  1365. package/dist/shared/history.d.ts.map +0 -1
  1366. package/dist/shared/keychain.d.ts.map +0 -1
  1367. package/dist/shared/logger.d.ts.map +0 -1
  1368. package/dist/shared/output.d.ts.map +0 -1
  1369. package/dist/shared/prompt.d.ts.map +0 -1
  1370. package/dist/shared/redact.d.ts.map +0 -1
  1371. package/dist/shared/spinner.d.ts.map +0 -1
  1372. package/dist/shared/style.d.ts.map +0 -1
  1373. package/dist/shared/telemetry.d.ts.map +0 -1
  1374. package/dist/shared/validate.d.ts.map +0 -1
  1375. package/dist/sites/api/collections.d.ts.map +0 -1
  1376. package/dist/sites/api/index.d.ts +0 -26
  1377. package/dist/sites/api/index.d.ts.map +0 -1
  1378. package/dist/sites/api/index.js +0 -55
  1379. package/dist/sites/api/jobs.d.ts.map +0 -1
  1380. package/dist/sites/api/languages.d.ts.map +0 -1
  1381. package/dist/sites/api/request.d.ts.map +0 -1
  1382. package/dist/sites/api/sites.d.ts.map +0 -1
  1383. package/dist/sites/api/types.d.ts.map +0 -1
  1384. /package/dist/serialization/{sitecore-api → api}/graphql.js +0 -0
  1385. /package/dist/serialization/{sitecore-api → api}/history.js +0 -0
  1386. /package/dist/serialization/{sitecore-api → api}/roles.js +0 -0
  1387. /package/dist/serialization/{sitecore-api → api}/users.js +0 -0
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ /**
3
+ * Resolves the environment binding for `scai mcp serve` and packages
4
+ * everything tool handlers need into a single `McpContext`.
5
+ *
6
+ * One server instance, ONE bound/default env — but, since the
7
+ * multi-environment ("Option B") redesign, every environment-scoped
8
+ * tool call may target ANY configured environment. The bound env is
9
+ * the default; `resolveEnvBinding` resolves any other env on demand.
10
+ *
11
+ * Two-phase resolution so the stdio transport can answer the MCP
12
+ * `initialize` handshake before any keychain access happens:
13
+ *
14
+ * 1. `resolveMcpEnv` — synchronous, reads the config file from disk
15
+ * and validates the named environment. Throws on missing config
16
+ * or unknown env so startup fails fast and loudly.
17
+ *
18
+ * 2. `createMcpContextProvider` — returns a memoized async getter
19
+ * that fetches the deploy token from the OS keychain on first
20
+ * invocation. Tool dispatchers `await` this; concurrent first
21
+ * calls share the same in-flight promise so the keychain prompt
22
+ * surfaces once, not per-call. Failures are not cached, so a
23
+ * subsequent tool call retries after the operator unlocks the
24
+ * keychain or runs `scai setup login`.
25
+ *
26
+ * Per-call retargeting: `resolveEnvBinding(configPath, envName)`
27
+ * resolves any environment on demand and is memoized per
28
+ * `configPath::envName` so a retargeted tool call doesn't re-mint a
29
+ * deploy token on every invocation. The bound `McpContext` is a
30
+ * superset of an `EnvBinding`, so handlers can treat either uniformly.
31
+ *
32
+ * The Authoring API access token is acquired lazily on first use —
33
+ * recipe and serialization tools handle their own OAuth flow because
34
+ * the authoring credentials may differ from the deploy credentials.
35
+ */
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.resolveToolBinding = exports.__resetEnvBindingCacheForTests = exports.resolveEnvBinding = exports.bindMcpEnvironment = exports.createMcpContextProvider = exports.resolveMcpEnv = void 0;
38
+ const environment_1 = require("../policy/environment");
39
+ const keychain_1 = require("../shared/keychain");
40
+ const errors_1 = require("../shared/errors");
41
+ const resolveMcpEnv = (options) => {
42
+ return (0, environment_1.resolveEnvironment)({
43
+ config: options.configPath,
44
+ environmentName: options.environmentName,
45
+ // Startup binding: `runMcpServe` enrolls the bound env into the
46
+ // workspace policy right after this resolves, so skip the gate here.
47
+ // Per-call retargeting (`resolveEnvBinding`) stays enforced.
48
+ skipPolicy: true,
49
+ });
50
+ };
51
+ exports.resolveMcpEnv = resolveMcpEnv;
52
+ const fetchDeployToken = async (resolved) => {
53
+ const token = (await (0, keychain_1.getDeployToken)(resolved.envName)) ?? resolved.environment.deployToken;
54
+ if (!token) {
55
+ throw (0, errors_1.createScaiError)(`Deploy token not found for environment '${resolved.envName}'.`, "AUTH_REQUIRED", {
56
+ hint: "Run `scai setup login` for this environment in a separate terminal, then re-invoke the tool.",
57
+ });
58
+ }
59
+ return token;
60
+ };
61
+ const createMcpContextProvider = (resolved, configPath) => {
62
+ let cached;
63
+ let pending;
64
+ return async () => {
65
+ if (cached)
66
+ return cached;
67
+ if (pending)
68
+ return pending;
69
+ pending = (async () => {
70
+ const deployToken = await fetchDeployToken(resolved);
71
+ const ctx = {
72
+ envName: resolved.envName,
73
+ configPath,
74
+ resolved,
75
+ allowWriteEnabled: resolved.environment.allowWrite === true,
76
+ deployToken,
77
+ };
78
+ cached = ctx;
79
+ return ctx;
80
+ })();
81
+ try {
82
+ return await pending;
83
+ }
84
+ finally {
85
+ if (!cached)
86
+ pending = undefined;
87
+ }
88
+ };
89
+ };
90
+ exports.createMcpContextProvider = createMcpContextProvider;
91
+ const bindMcpEnvironment = async (options) => {
92
+ const resolved = (0, exports.resolveMcpEnv)(options);
93
+ const provider = (0, exports.createMcpContextProvider)(resolved, options.configPath ?? process.cwd());
94
+ return provider();
95
+ };
96
+ exports.bindMcpEnvironment = bindMcpEnvironment;
97
+ /**
98
+ * Per-call environment resolution for the multi-env ("Option B") MCP
99
+ * server. Resolves ANY configured environment on demand — its config,
100
+ * deploy token, and allowWrite flag — into an `EnvBinding`.
101
+ *
102
+ * Generalizes what `bindMcpEnvironment` does for the single bound env:
103
+ * a tool handler that receives an explicit `environmentName` input
104
+ * resolves it here instead of using the bound default.
105
+ *
106
+ * Memoized per `configPath::envName` so a stream of retargeted calls
107
+ * doesn't re-read the config or re-mint a deploy token each time.
108
+ * Failures are NOT cached — a missing token throws `AUTH_REQUIRED`, and
109
+ * the next call retries after the operator runs `scai setup login`.
110
+ */
111
+ const bindingCache = new Map();
112
+ const bindingPending = new Map();
113
+ const resolveEnvBinding = async (configPath, envName) => {
114
+ const key = `${configPath}::${envName}`;
115
+ const cached = bindingCache.get(key);
116
+ if (cached)
117
+ return cached;
118
+ const inFlight = bindingPending.get(key);
119
+ if (inFlight)
120
+ return inFlight;
121
+ const pending = (async () => {
122
+ const resolved = (0, environment_1.resolveEnvironment)({ config: configPath, environmentName: envName });
123
+ const deployToken = await fetchDeployToken(resolved);
124
+ const binding = {
125
+ envName: resolved.envName,
126
+ resolved,
127
+ allowWriteEnabled: resolved.environment.allowWrite === true,
128
+ deployToken,
129
+ };
130
+ bindingCache.set(key, binding);
131
+ return binding;
132
+ })();
133
+ bindingPending.set(key, pending);
134
+ try {
135
+ return await pending;
136
+ }
137
+ finally {
138
+ bindingPending.delete(key);
139
+ }
140
+ };
141
+ exports.resolveEnvBinding = resolveEnvBinding;
142
+ /**
143
+ * Test-only — clears the per-`configPath::envName` binding cache so
144
+ * memoization state doesn't leak across `describe` blocks.
145
+ */
146
+ const __resetEnvBindingCacheForTests = () => {
147
+ bindingCache.clear();
148
+ bindingPending.clear();
149
+ };
150
+ exports.__resetEnvBindingCacheForTests = __resetEnvBindingCacheForTests;
151
+ /**
152
+ * Resolve the `EnvBinding` an environment-scoped tool should operate
153
+ * against. When `environmentName` is omitted (the common case), returns
154
+ * the bound `McpContext` itself — it IS an `EnvBinding` — so behavior is
155
+ * byte-for-byte identical to the pre-Option-B single-env server. When
156
+ * set, resolves (and memoizes) the named environment via
157
+ * `resolveEnvBinding`.
158
+ */
159
+ const resolveToolBinding = async (context, environmentName) => {
160
+ if (!environmentName || environmentName === context.envName) {
161
+ return context;
162
+ }
163
+ return (0, exports.resolveEnvBinding)(context.configPath, environmentName);
164
+ };
165
+ exports.resolveToolBinding = resolveToolBinding;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Single-source-of-truth assembly for the MCP registry.
3
+ *
4
+ * Lives in its own file so both the runtime server and the offline
5
+ * `scai mcp tools list / schema` inspector commands share the same
6
+ * registration order — without needing a live `McpContext`.
7
+ *
8
+ * The inspector commands instantiate a registry from this helper, then
9
+ * walk the descriptors directly; no SDK wiring required.
10
+ */
11
+ import { McpRegistry } from "./registry";
12
+ export declare const buildScaiMcpRegistry: () => McpRegistry;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * Single-source-of-truth assembly for the MCP registry.
4
+ *
5
+ * Lives in its own file so both the runtime server and the offline
6
+ * `scai mcp tools list / schema` inspector commands share the same
7
+ * registration order — without needing a live `McpContext`.
8
+ *
9
+ * The inspector commands instantiate a registry from this helper, then
10
+ * walk the descriptors directly; no SDK wiring required.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.buildScaiMcpRegistry = void 0;
14
+ const registry_1 = require("./registry");
15
+ const access_check_1 = require("./tools/access-check");
16
+ const audit_1 = require("./tools/audit");
17
+ const bootstrap_1 = require("./tools/bootstrap");
18
+ const browse_1 = require("./tools/browse");
19
+ const brand_1 = require("./tools/brand");
20
+ const brand_recipe_1 = require("./tools/brand-recipe");
21
+ const brief_1 = require("./tools/brief");
22
+ const brief_recipe_1 = require("./tools/brief-recipe");
23
+ const campaign_1 = require("./tools/campaign");
24
+ const campaign_recipe_1 = require("./tools/campaign-recipe");
25
+ const agents_1 = require("./tools/agents");
26
+ const agents_recipe_1 = require("./tools/agents-recipe");
27
+ const cleanup_1 = require("./tools/cleanup");
28
+ const deploy_1 = require("./tools/deploy");
29
+ const publish_1 = require("./tools/publish");
30
+ const serialization_1 = require("./tools/serialization");
31
+ const recipe_1 = require("./tools/recipe");
32
+ const recipe_sync_1 = require("./tools/recipe-sync");
33
+ const explain_1 = require("./tools/explain");
34
+ const inspector_1 = require("./tools/inspector");
35
+ const onboard_1 = require("./tools/onboard");
36
+ const webhook_1 = require("./tools/webhook");
37
+ const workflow_1 = require("./tools/workflow");
38
+ const brand_2 = require("./resources/brand");
39
+ const help_1 = require("./resources/help");
40
+ const env_1 = require("./resources/env");
41
+ const recipes_1 = require("./resources/recipes");
42
+ const workflows_1 = require("./prompts/workflows");
43
+ const buildScaiMcpRegistry = () => {
44
+ const registry = new registry_1.McpRegistry();
45
+ (0, bootstrap_1.registerBootstrapTools)(registry);
46
+ (0, access_check_1.registerAccessCheckTools)(registry);
47
+ (0, browse_1.registerBrowseTools)(registry);
48
+ (0, onboard_1.registerOnboardTools)(registry);
49
+ (0, deploy_1.registerDeployTools)(registry);
50
+ (0, serialization_1.registerSerializationTools)(registry);
51
+ (0, recipe_1.registerRecipeTools)(registry);
52
+ (0, recipe_sync_1.registerRecipeSyncTools)(registry);
53
+ (0, workflow_1.registerWorkflowTools)(registry);
54
+ (0, webhook_1.registerWebhookTools)(registry);
55
+ (0, audit_1.registerAuditTools)(registry);
56
+ (0, explain_1.registerExplainTools)(registry);
57
+ (0, cleanup_1.registerCleanupTools)(registry);
58
+ (0, publish_1.registerPublishingTools)(registry);
59
+ (0, brand_1.registerBrandTools)(registry);
60
+ (0, brand_recipe_1.registerBrandRecipeTools)(registry);
61
+ (0, brief_1.registerBriefTools)(registry);
62
+ (0, brief_recipe_1.registerBriefRecipeTools)(registry);
63
+ (0, campaign_1.registerCampaignTools)(registry);
64
+ (0, campaign_recipe_1.registerCampaignRecipeTools)(registry);
65
+ (0, agents_1.registerAgentsTools)(registry);
66
+ (0, agents_recipe_1.registerAgentsRecipeTools)(registry);
67
+ (0, inspector_1.registerInspectorTools)(registry);
68
+ (0, help_1.registerHelpResources)(registry);
69
+ (0, env_1.registerEnvironmentResources)(registry);
70
+ (0, recipes_1.registerRecipeResources)(registry);
71
+ (0, brand_2.registerBrandResources)(registry);
72
+ (0, workflows_1.registerWorkflowPrompts)(registry);
73
+ return registry;
74
+ };
75
+ exports.buildScaiMcpRegistry = buildScaiMcpRegistry;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Hand-authored tool descriptions, indexed by tool name.
3
+ *
4
+ * Single audit point for the agent-facing copy. Style:
5
+ * - Action verb first.
6
+ * - Sentence 1: what the tool does (incl. output shape).
7
+ * - Sentence 2: when to reach for it (preconditions for writes,
8
+ * reversibility callout for destructive operations).
9
+ *
10
+ * No CLI flag references. No `scai` brand prefix (already namespaced
11
+ * by tool name).
12
+ *
13
+ * Tools that front an unstable surface (brand, brief, campaign, agents —
14
+ * reverse-engineered, no SemVer stability promise) lead with an
15
+ * `[unstable]` tag so an agent sees the signal before selecting the
16
+ * tool. The matching SDK subpaths live under `./unstable/*`.
17
+ */
18
+ export declare const TOOL_DESCRIPTIONS: Record<string, string>;
19
+ export declare const verifyDescriptions: (names: string[]) => {
20
+ missing: string[];
21
+ tooShort: string[];
22
+ };
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ /**
3
+ * Hand-authored tool descriptions, indexed by tool name.
4
+ *
5
+ * Single audit point for the agent-facing copy. Style:
6
+ * - Action verb first.
7
+ * - Sentence 1: what the tool does (incl. output shape).
8
+ * - Sentence 2: when to reach for it (preconditions for writes,
9
+ * reversibility callout for destructive operations).
10
+ *
11
+ * No CLI flag references. No `scai` brand prefix (already namespaced
12
+ * by tool name).
13
+ *
14
+ * Tools that front an unstable surface (brand, brief, campaign, agents —
15
+ * reverse-engineered, no SemVer stability promise) lead with an
16
+ * `[unstable]` tag so an agent sees the signal before selecting the
17
+ * tool. The matching SDK subpaths live under `./unstable/*`.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.verifyDescriptions = exports.TOOL_DESCRIPTIONS = void 0;
21
+ exports.TOOL_DESCRIPTIONS = {
22
+ // Bootstrap
23
+ scai_overview: "Returns the server version, the bound environment, the available tool domains, the registered Resource URIs, and whether writes are permitted — plus the discovery map: every configured environment and organization, each with its four-credential matrix (deploy / cmClient / brand / brief). Call this first from a cold start so subsequent decisions know what surface is reachable and which environments are credentialed.",
24
+ environment_status: "Probes the bound environment for live health, deploy-token freshness, and the most recent deployment summary. Use this when you need a quick health pulse before scheduling work against the environment.",
25
+ access_check: "Preflights an environment before you operate against it: resolves the config, workspace-policy, and credential gates in one offline call and returns every blocker at once — each with a structured remediation classified by who fixes it (agent / needs-human-terminal). Call this when a tool fails with AUTH_REQUIRED or POLICY_DENIED, or before targeting an environment you have not used yet, instead of discovering blockers one failed call at a time.",
26
+ content_browse: "Enumerates the content tree under a path — a bounded-depth walk of item children returning each item's name, path, id, and template id. Read-only and traversal-based, so it works on environments with no provisioned search index. Use it to answer 'what templates / renderings / items do I have under X' in one call instead of bending a quality audit to the job.",
27
+ environment_onboard: "Stands up a new environment profile in sitecoreai.cli.json from supplied identity (organization / project / environment ids + CM host), then runs the access preflight and reports what remains — policy enrollment and the human-only credential step. Write-gated. This is the agent-drivable half of environment setup; resolve the identity first with the deploy tools or scai_overview. Does not mint credentials or log in — those are human-terminal-only.",
28
+ // Deploy — organization + projects + envs
29
+ deploy_organization_inspect: "Fetches the organization profile, the health probe, and the active license in a single call, returning { organization, health, license }. Use this when you need a one-shot snapshot of the owning org before drilling into projects.",
30
+ deploy_project_inspect: "Lists projects (no projectId) or returns the project + its environments + the project limitation (projectId given). Returns { projects } or { project, environments, limitation }. Use this to navigate from organization down to a specific project's environments.",
31
+ deploy_project_manage: "Creates, updates, or deletes an XM Cloud project via a discriminated { action } input. Requires allowWrite: true. Deletes are irreversible and cascade to all environments under the project — confirm with the user before invoking the delete action.",
32
+ deploy_environment_inspect: "Lists environments (no environmentId) or returns the environment + variables + recent deployments + restart status + live health probe when an environmentId is given. Use this for any read-side environment workflow before composing a write.",
33
+ deploy_environment_lifecycle: "Drives environment-lifecycle writes via a discriminated { action } input — create, update, delete, restart, promote, or regenerate-context. Requires allowWrite: true. Restart and promote are recoverable; delete is irreversible and tears down all data in the env.",
34
+ deploy_environment_variables: "Upserts or deletes a single environment variable identified by name and target. Requires allowWrite: true. Use this for runtime config changes; the variables list itself is reachable through deploy_environment_inspect.",
35
+ deploy_repository_manage: "Links or unlinks a source-control repository ref at either scope=environment or scope=project. Requires allowWrite: true. Unlinking does not delete the repository — it stops future deploys from auto-pulling until a new link is set. Project-level links are the inherited default for newly-created environments under that project.",
36
+ // Deploy — deployments
37
+ deploy_run_inspect: "Lists recent deployments (no deploymentId) or returns the deployment + status + logs (deploymentId given). Use this to read deployment progress, surface failures to the user, or pull logs for diagnosis after a failed deploy.",
38
+ deploy_run_start: "Starts a deployment for an environment against an already-uploaded source reference. Requires allowWrite: true. The MCP server does not handle the multipart upload itself — supply a sourceReference from a prior CLI-side upload.",
39
+ deploy_run_cancel: "Cancels an in-flight deployment by id. Requires allowWrite: true. A cancellation request is best-effort — the underlying job may still complete if the cancel request races with the final post-deploy steps.",
40
+ // Deploy — source control
41
+ deploy_source_control_inspect: "Inspects source-control surface area via a discriminated { scope } input — integrations, providers, repository, or templates. Returns the listing or detail object that matches the requested scope. No writes; safe to call iteratively while assembling a plan.",
42
+ deploy_source_control_manage: "Performs source-control writes via a discriminated { action } input — create-repository, create-repository-github, delete-integration, or validate-repository. Requires allowWrite: true. Delete-integration is destructive and severs every linked environment in one call.",
43
+ // Serialization
44
+ serialization_inspect: "Inspects the configured serialization modules for the bound environment. With a path, narrows to a single subtree explanation. Returns the module list, excluded fields, and per-subtree configuration. No tenant calls; reads only the local config and filesystem.",
45
+ serialization_sync: "Synchronizes serialized items between the local filesystem and a Sitecore environment via a discriminated { direction } input — pull, push, or diff. push and diff-with-push require allowWrite: true. Long-running; finishes-then-returns (no streaming progress in v1).",
46
+ serialization_validate: "Validates the serialization module configuration and the local filesystem state for the bound environment. Returns { valid, modules, errors }. Use this before serialization_sync to catch config-shape problems early.",
47
+ serialization_publish: "Publishes the item at the given path (and optional descendants/languages) on the bound environment's master database. Requires allowWrite: true. Publish jobs run server-side asynchronously; the tool returns the job receipt for follow-up status checks.",
48
+ // Recipe
49
+ recipe_compile: "Compiles a recipe (file path or inline TypeScript source) to its Operation IR. Returns the IR JSON in structuredContent. Does NOT write to disk even if the CLI version supports a --output flag. No tenant access — recompile if the recipe lands in a different tenant tree.",
50
+ recipe_diff: "Builds a diff plan between a recipe (or pre-compiled IR) and the bound tenant. Returns the diff plan with per-action change descriptions. Read-only; safe to call as part of an exploratory review before recipe_push.",
51
+ recipe_plan: "Builds an execution plan from a pre-compiled IR against the bound tenant. Returns the plan summary + actions. Use this after recipe_compile when you want the agent to review a frozen plan before pushing.",
52
+ recipe_push: "Executes a recipe against the bound tenant. Compiles in-memory if given a recipe source, plans against the tenant, then applies the plan unless whatIf is true. Requires allowWrite: true. Returns the per-action execution result list.",
53
+ // Recipe sync — cross-domain aggregate
54
+ recipe_sync: "Pull, diff, or push every enumerable recipe kind in one call via a discriminated { verb } input — the cross-domain aggregate. `pull` enumerates every brand kit and brief type on the environment and writes each as a recipe file under the workspace directory; `status` diffs every workspace recipe against the environment; `push` converges them all (dry-run unless whatIf is false). Requires allowWrite: true — `pull` writes recipe files and `push` mutates the tenant. Reach for the per-instance brand_recipe_* / brief_recipe_* tools to target a single kit or type; use this when you want the whole environment captured or converged at once.",
55
+ // Inspector
56
+ tools_list: "Returns the names + descriptions + auth class of every tool registered on this MCP server. Use this for human debugging or when an agent needs to discover the available action surface without an external manifest.",
57
+ tools_schema: "Returns the Zod-derived JSON schema for one tool (name given) or all tools. Use this when an agent's tool-use planner needs the input-shape contract beyond what list-tools exposes.",
58
+ // Workflow
59
+ workflow_inspect: "Read-side workflow surface over a discriminated { verb } input — `inspect` (auto-routes: a Workflow-templated ref returns the full definition tree (states/commands/actions/validations), any other ref returns one item's workflow + state + available commands), `list-commands` (transitions available on one item), `list-defs` (workflow definitions on the tenant), `status` (per-site rollup from XM Apps REST), or `assigned` (search items by workflow state). The `item` field on verb='inspect' accepts a GUID, content-tree path, OR a workflow display/item name (case-insensitive). Returns a discriminated `{ kind: 'item' | 'definition', ... }` envelope on the inspect verb — branch on `result.kind` before reading further. No writes; use this to plan a workflow action before invoking workflow_lifecycle.",
60
+ workflow_lifecycle: "Mutating workflow surface over a discriminated { verb } input — `advance` (move one item through a named command), `reset` (force an item back to its workflow's initial state — bypasses validation actions), `bulk-advance` (sweep items matched by stale-days / from-state / root and advance each via a named command), or `apply-workflow` (attach a workflow + set initial state on an item that isn't yet under workflow). Every verb requires allowWrite: true. Pair with workflow_inspect first to confirm state shape + command names; pass the `whatIf` flag for plan-only mode where supported.",
61
+ // Audit
62
+ audit_inspect: "Read-side audit surface over a discriminated { verb } input — `list` (registered audit names), `run` (one audit, or `audit: 'all'` for the consolidated run), `history-capture` (run `all` and persist a snapshot under .scai/audit-history/), `history-list` (snapshots on disk), or `history-diff` (compare two snapshots by fingerprint). Common scope flags (root/limit/since/owner/exclude/baseline) live at the top level; audit-specific options ride along in the `auditOptions` bag. No tenant mutations — pair with audit_baseline for write-side baseline management.",
63
+ audit_baseline: "Manage the per-env audit baseline file at .scai/audit-baseline-<envName>.json via a discriminated { verb } — `show` (current ignored fingerprints), `update` (run audits and fold every current finding into the baseline; pass `resetFirst: true` to replace rather than merge), `remove` (drop one fingerprint from one audit), or `reset` (clear one audit or all). Writes target the local baseline file only — never the tenant — but still require allowWrite: true so a stray call can't quietly erase an accepted-findings set.",
64
+ audit_suite_run: "Execute a YAML-defined audit suite by file path. Loads the suite, applies its include/exclude + per-audit options, optionally enables baseline filtering, expands {date}/{datetime}/{env}/{suite} tokens in the output path, and runs every selected audit through `runAuditAll`. Read-only — suites themselves can't mutate the tenant. Use `only` to scope a re-run after a targeted fix.",
65
+ // Explain — composed-audit answers
66
+ explain: "Answer a specific operator question by composing several audits via a discriminated { verb } input — `why-blocked` lists every inbound reference that would block a delete of `itemId` (audit references + audit template-dependencies, sorted by kind); `orphan-site` lists the residue a deleted `site` left behind and flags trees still referenced by live content (audit site-residue + audit references). Read-only. Reach for this instead of running the underlying audits by hand when triaging a failed delete or planning a site-residue cleanup.",
67
+ // Cleanup
68
+ cleanup_preview: "Plan a cleanup operation without mutating the tenant — runs the chosen `verb` with whatIf: true and returns the per-action plan list. Same input shape as cleanup_execute so the agent can show the user the diff first, then re-invoke cleanup_execute with the same arguments after authorization. Safe to call iteratively while tuning scope flags.",
69
+ cleanup_execute: "Execute a destructive hygiene cleanup verb. Covers versions-prune, versions-archive, archive-purge, dead-templates, duplicates, empty-folders, find-replace, roles, site-residue, subtree, users, workflow-advance — every verb in the `scai hygiene cleanup` CLI group. Requires allowWrite: true. Honors per-verb blast-radius caps (`maxDeletions`, `limit`, `maxAdvances`) and the global `whatIf` flag for plan-only mode; pair with cleanup_preview when the user wants to see the plan before authorizing.",
70
+ // Publishing (SAI Publishing API)
71
+ publish_inspect: "Reads publishing-job state from the SAI Publishing API: a single job by id, the list of currently queued/running jobs, or the local audit log (env-level history). Use this before any cancel call so the operator knows what's in flight. Returns structured job records; never mints scope tokens (those come from CLI dry-runs, out-of-band).",
72
+ publish_lifecycle: "Mutating publishing operations. v1 exposes only `cancel` — the safety-improving op that stops a running publish. Submission verbs (`submit_item` / `submit_all` / `unpublish`) are intentionally CLI-only because publishing pushes content to Experience Edge and the consent model requires a token minted from a human-driven dry-run. Use `publish_inspect verb='list-running'` to find a jobId to cancel; cancellation is recoverable via resubmission.",
73
+ // Brief (Content Operations)
74
+ brief_inspect: "[unstable] Read-side Content Operations Brief surface over a discriminated { verb } input — `list` (briefs in tenant), `show` (one brief by id, with nested to-dos/comments/references), `types` (brief schema templates with field definitions and aiIntent hints), `todos` (across briefs or filtered by briefId), or `comments` (across briefs or filtered by briefId). 'Todo' is the Content Operations UI label for the Brief API's wire `tasks` resource. No writes; safe to call as part of plan assembly before any future brief_manage operation.",
75
+ brief_manage: "[unstable] Mutating Content Operations Brief surface over a discriminated { resource, verb } input. `resource: 'brief-type'` supports `create` (POST a new type from a full body), `update` (PUT-replace by id; no PATCH — read first if preserving fields), and `delete` (irreversible). `resource: 'brief'` supports `set-status` — move a brief to Draft | InReview | Approved | Canceled | Archived (a brief must leave Draft before it can be linked to a campaign) — and `delete` (irreversible; SDK `deleteBrief`). `resource: 'comment'` supports `create` — post a comment to a brief via `commentText` (UNVERIFIED: the write body is a best guess; smoke-test before relying on it). Requires allowWrite: true. Brief-type `name` must match /^[A-Za-z][A-Za-z0-9_]*$/. Brief `create` remains SDK/CLI-only.",
76
+ // Campaign (Orchestrate)
77
+ campaign_inspect: "[unstable] Read-side Orchestrate campaign surface over a discriminated { verb } input — `list` (campaigns in tenant), `show` (one campaign by id, with deliverables and tasks inline), `tasks` (tasks under a deliverable), `task` (one task by id), or `users` (the member directory that resolves the Auth0 subjects on members and assignees). A campaign is an Orchestrate `project`; projects own deliverables, deliverables own tasks. No writes.",
78
+ campaign_manage: "[unstable] Mutating Orchestrate campaign surface over a discriminated { resource, verb } input — `resource: 'campaign'|'deliverable'` support verbs `create` and `delete`; `resource: 'task'` supports `create`, `update` (PUT full-replacement, no PATCH), and `delete`. Requires allowWrite: true. Deliverable/task writes need `campaignId` (and `deliverableId` for tasks); update/task-delete need `taskId`. The `delete` verb is irreversible and hits Orchestrate DELETE endpoints that were never captured during reverse-engineering — they are wired optimistically per REST conventions and remain UNVERIFIED; smoke-test before relying on them. Pass whatIf: true for a plan-only dry run.",
79
+ // Agentic Studio
80
+ agents_inspect: "[unstable] Read-side Agentic Studio surface over a discriminated { verb } input — `agents`, `skills`, `tools` (the platform tool catalog), `widgets`, `schemas`, `mcps` (registered custom MCP servers), or `status` (browser-session validity and endpoint). Returns { verb, result }. Call this to survey what an environment's Agentic Studio contains before composing a run. No writes.",
81
+ agents_run: "[unstable] Runs an Agentic Studio agent by slug against a fresh space and returns the agent's streamed output collected to text. Requires allowWrite: true — a run creates a space and consumes model usage. Find the slug with agents_inspect verb='agents'.",
82
+ agents_recipe_inspect: "[unstable] Pulls or diffs an Agentic Studio resource as a declarative recipe over a { kind, verb } input — `kind` is agent | skill | widget | custom-mcp; `verb='pull'` captures the resource named `name`, `verb='diff'` plans the convergence of `recipe` onto live state. Returns { kind, verb, recipe } or { kind, verb, plan }. No writes.",
83
+ agents_recipe_push: "[unstable] Converges an Agentic Studio resource onto a recipe over a { kind, recipe } input. Requires allowWrite: true; pass whatIf: true for a plan-only dry run. The `agent` kind creates or updates; `skill`/`widget`/`custom-mcp` are create-only (an existing one is left unchanged).",
84
+ // Webhook
85
+ webhook_inspect: "Read-side webhook handler surface over a discriminated { verb } input — `list` (handler items under /sitecore/system/Webhooks or a workflow state), `get` (one handler's full field detail), or `event-types` (catalog of strings the tenant accepts for the `events` field on webhook_manage create). Use `event-types` to discover valid event names BEFORE invoking webhook_manage — typos otherwise surface only at create-time with a generic 'unknown event type' error.",
86
+ webhook_manage: "Mutating webhook handler surface — `create` (item/publish event handler or workflow submit/validation action) or `delete` (any webhook item by id or path). Requires allowWrite: true. Workflow webhooks attach at a workflow state's Actions subfolder; pass the state's content-tree path via `onState`.",
87
+ // Brand — Brand Management + Documents + Pipeline + Brand Review
88
+ brand_inspect: "[unstable] Read-side brand kit surface over a discriminated { verb } input — list-kits, get-kit, list-sections (with names + UUIDs), list-fields (subsections with their AI intent + populated value), list-docs, get-doc (useful for polling pipeline progress). Sections only appear after BrandIngestion + EnrichSections pipelines have run; freshly-created kits return an empty section list.",
89
+ brand_manage: "[unstable] Mutating brand kit surface over a discriminated { action } input — create-kit, publish-kit (PATCH status; required before pipelines populate sections), delete-kit, upload-doc (by URL only — local-file upload has no working path on the documents API), delete-doc, run-ingestion (BrandIngestionPipeline), run-enrichment (EnrichSectionsPipeline; required after ingestion to populate sections), seed (the full 7-step composite that creates + uploads + publishes + ingests + enriches + polls for completion), or update-field (direct PATCH of a single field's value, bypassing the AI pipeline — the reliable population path for AI-generated kits whose synthesized PDF didn't survive Sitecore's parser). Requires allowWrite: true. The seed action is long-running (5–15 min) and emits MCP progress notifications throughout. For agents creating kits for real brands, fetch scai://help/brand-kit-generation first — it documents BOTH the seed flow (real brand-guide PDF) and the direct-PATCH flow (synthesized / AI-generated kits, where Chrome and WeasyPrint PDFs both fail ingestion). For file format constraints see scai://help/brand-file-formats.",
90
+ brand_review: "[unstable] Score content against a brand kit using AI. Returns an overall 1–5 score plus per-section + per-field breakdowns with explanations and improvement suggestions. The kit must already have populated sections — call brand_manage with action=seed (or pre-existing brand_inspect verb=list-sections on a populated kit) first. Headline agent-loop op for evaluating marketing copy, page content, or PR drafts; pair with the file path in `label` so SARIF / CI aggregators can attribute findings to source files.",
91
+ brand_recipe_inspect: "[unstable] Read-side of the brand-kit recipe surface over a discriminated { verb } input. verb=pull captures a live brand kit as a declarative recipe (a clean, schema'd description — kit metadata plus section/field values, no server UUIDs). verb=diff compares a recipe against the live kit and returns the plan (create / update / noop changes). Both are read-only; neither writes. Use pull to snapshot a kit, diff to preview what a push would do.",
92
+ brand_recipe_push: "[unstable] Converge a brand kit onto a declarative recipe. Computes the plan, then — unless whatIf — applies it: full orchestration via seedBrandKit (create → upload → publish → ingest → enrich) when the kit is absent, then per-field value convergence. Requires allowWrite: true to mutate; pass whatIf: true for a dry-run that returns the plan without writing. When the recipe carries documents for a not-yet-created kit, push triggers paid AI pipeline runs (~5–15 min).",
93
+ brief_recipe_inspect: "[unstable] Pull or diff a Sitecore Content Operations brief type as a declarative recipe. verb='pull' captures the live brief type named `name` as a clean recipe; verb='diff' compares a given recipe against the live type and returns the convergence plan. Read-only — neither verb writes.",
94
+ brief_recipe_push: "[unstable] Push a brief-type recipe — converge a Sitecore Content Operations brief type onto the given declarative recipe. Creates the brief type when absent or PUT-replaces it when present. Write tool: gated by `allowWrite`; pass `whatIf: true` for a dry-run that returns the plan without writing.",
95
+ campaign_recipe_inspect: "[unstable] Pull or diff a Sitecore Orchestrate campaign as a declarative recipe. verb='pull' captures the live campaign named `campaignName` (its project, deliverables, and tasks) as a clean recipe with server ids dropped. verb='diff' compares a given recipe against the live campaign and returns the convergence plan. Neither verb writes.",
96
+ campaign_recipe_push: "[unstable] Push a campaign recipe — converge a Sitecore Orchestrate campaign onto the recipe. Creates the campaign when absent, creates missing deliverables and tasks, and updates existing tasks. Additive: a recipe omitting a deliverable or task never removes it. Gated by `allowWrite`; `whatIf` returns the plan without writing.",
97
+ };
98
+ const verifyDescriptions = (names) => {
99
+ const missing = [];
100
+ const tooShort = [];
101
+ for (const name of names) {
102
+ const description = exports.TOOL_DESCRIPTIONS[name];
103
+ if (!description) {
104
+ missing.push(name);
105
+ continue;
106
+ }
107
+ if (description.length < 50) {
108
+ tooShort.push(name);
109
+ }
110
+ }
111
+ return { missing, tooShort };
112
+ };
113
+ exports.verifyDescriptions = verifyDescriptions;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Tool dispatch — wraps each registered handler with:
3
+ *
4
+ * 1. Concurrency via an in-house read/write lock. The stdio transport
5
+ * receives requests one-at-a-time, but the SDK does not serialize
6
+ * tool calls on its own. Multiple read tools (`*_inspect`,
7
+ * `environment_status`, …) run concurrently; writes are exclusive
8
+ * against everything. Writer preference keeps a queued
9
+ * `recipe_push` from starving behind a stream of reads.
10
+ *
11
+ * v1 used a single Promise-chain mutex that serialized every tool
12
+ * call. The rwlock keeps the write-time correctness guarantee
13
+ * (mutations don't observe each other's half-applied state) while
14
+ * letting read fan-out cost what it should.
15
+ *
16
+ * 2. The per-call `allowWrite` gate. Write-typed tools that receive
17
+ * `allowWrite !== true` short-circuit to an INPUT_INVALID envelope
18
+ * before the handler runs — no side effects, no library import.
19
+ *
20
+ * 3. The cancellation gate. The SDK's `RequestHandlerExtra.signal`
21
+ * fires `aborted` when the client sends `notifications/cancelled`.
22
+ * We thread that signal through to the handler (and the handler
23
+ * plumbs it into the library). When the handler returns AND
24
+ * `signal.aborted` is true, we convert the result to a `CANCELLED`
25
+ * envelope so the client sees consistent typed-error shape rather
26
+ * than a half-applied success.
27
+ *
28
+ * 4. Error envelope conversion. Anything the handler throws (or any
29
+ * ScaiError it returns by raising) lands in `toolResultFromError`
30
+ * and crosses the wire as `{ isError: true, content, structuredContent }`.
31
+ */
32
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
33
+ import type { McpContext } from "./auth";
34
+ import type { ToolDescriptor, ToolExtra } from "./registry";
35
+ export interface DispatchOptions {
36
+ context: McpContext;
37
+ extra: ToolExtra;
38
+ }
39
+ export declare const dispatchTool: (descriptor: ToolDescriptor, input: Record<string, unknown>, options: DispatchOptions) => Promise<CallToolResult>;
40
+ /**
41
+ * Test-only helper to reset the dispatch lock between tests so the
42
+ * rwlock's pending-queue state doesn't carry across `describe` blocks.
43
+ */
44
+ export declare const __resetDispatchLockForTests: () => void;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ /**
3
+ * Tool dispatch — wraps each registered handler with:
4
+ *
5
+ * 1. Concurrency via an in-house read/write lock. The stdio transport
6
+ * receives requests one-at-a-time, but the SDK does not serialize
7
+ * tool calls on its own. Multiple read tools (`*_inspect`,
8
+ * `environment_status`, …) run concurrently; writes are exclusive
9
+ * against everything. Writer preference keeps a queued
10
+ * `recipe_push` from starving behind a stream of reads.
11
+ *
12
+ * v1 used a single Promise-chain mutex that serialized every tool
13
+ * call. The rwlock keeps the write-time correctness guarantee
14
+ * (mutations don't observe each other's half-applied state) while
15
+ * letting read fan-out cost what it should.
16
+ *
17
+ * 2. The per-call `allowWrite` gate. Write-typed tools that receive
18
+ * `allowWrite !== true` short-circuit to an INPUT_INVALID envelope
19
+ * before the handler runs — no side effects, no library import.
20
+ *
21
+ * 3. The cancellation gate. The SDK's `RequestHandlerExtra.signal`
22
+ * fires `aborted` when the client sends `notifications/cancelled`.
23
+ * We thread that signal through to the handler (and the handler
24
+ * plumbs it into the library). When the handler returns AND
25
+ * `signal.aborted` is true, we convert the result to a `CANCELLED`
26
+ * envelope so the client sees consistent typed-error shape rather
27
+ * than a half-applied success.
28
+ *
29
+ * 4. Error envelope conversion. Anything the handler throws (or any
30
+ * ScaiError it returns by raising) lands in `toolResultFromError`
31
+ * and crosses the wire as `{ isError: true, content, structuredContent }`.
32
+ */
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.__resetDispatchLockForTests = exports.dispatchTool = void 0;
35
+ const errors_1 = require("../shared/errors");
36
+ const allow_write_1 = require("../policy/allow-write");
37
+ const rwlock_1 = require("../shared/rwlock");
38
+ const auth_1 = require("./auth");
39
+ const errors_2 = require("./errors");
40
+ const common_1 = require("./schemas/common");
41
+ const redact_1 = require("./redact");
42
+ const lock = new rwlock_1.RwLock();
43
+ const cancelledEnvelope = (toolName) => (0, errors_2.toolResultFromError)((0, errors_1.createScaiError)(`Tool '${toolName}' was cancelled by the client.`, "CANCELLED", {
44
+ hint: "Re-invoke the same tool to resume; partially-applied writes (if any) are documented in the tool result.",
45
+ }));
46
+ const dispatchTool = async (descriptor, input, options) => {
47
+ const run = async () => {
48
+ // Short-circuit if the client already cancelled while waiting on the
49
+ // lock. Holding the lock for the no-op return is negligible.
50
+ if (options.extra.signal.aborted) {
51
+ return cancelledEnvelope(descriptor.name);
52
+ }
53
+ try {
54
+ if (descriptor.auth === "write") {
55
+ const allowWrite = input["allowWrite"] === true;
56
+ if (!allowWrite) {
57
+ throw (0, errors_1.createScaiError)(`Tool '${descriptor.name}' is a write operation. Set 'allowWrite: true' to authorize the change.`, "INPUT_INVALID", { hint: common_1.ALLOW_WRITE_ERROR_HINT });
58
+ }
59
+ // Multi-env ("Option B") boundary gate: when a write tool is
60
+ // retargeted at another environment via `environmentName`, the
61
+ // per-env `denyMcpElevation` opt-out of the TARGET env must be
62
+ // honored — the handler's own `ensureMcpElevationAllowed` call
63
+ // (where present) uses the bound context's root, so it would
64
+ // otherwise check the wrong environment. Resolving against the
65
+ // bound env (no `environmentName`) is unchanged: dispatch adds
66
+ // no gate, the handler keeps doing its own check as before.
67
+ const target = input["environmentName"];
68
+ if (typeof target === "string" && target !== options.context.envName) {
69
+ const binding = await (0, auth_1.resolveEnvBinding)(options.context.configPath, target);
70
+ (0, allow_write_1.ensureMcpElevationAllowed)(binding.resolved.root, binding.envName);
71
+ }
72
+ }
73
+ const result = await descriptor.handler(input, options.context, options.extra);
74
+ // If the handler returned a non-error result but the client
75
+ // cancelled while it ran, convert it to a CANCELLED envelope so
76
+ // the client doesn't see "success" for work it asked to stop.
77
+ if (options.extra.signal.aborted && !result.isError) {
78
+ return cancelledEnvelope(descriptor.name);
79
+ }
80
+ if (result.isError) {
81
+ return result;
82
+ }
83
+ if (result.structuredContent) {
84
+ return {
85
+ ...result,
86
+ structuredContent: (0, redact_1.redactStructured)(result.structuredContent),
87
+ };
88
+ }
89
+ return result;
90
+ }
91
+ catch (error) {
92
+ // AbortError from an aborted library call surfaces as a thrown
93
+ // DOMException-shaped error. Coerce to CANCELLED for the envelope.
94
+ if (options.extra.signal.aborted) {
95
+ return cancelledEnvelope(descriptor.name);
96
+ }
97
+ return (0, errors_2.toolResultFromError)(error);
98
+ }
99
+ };
100
+ return descriptor.auth === "write" ? lock.withWrite(run) : lock.withRead(run);
101
+ };
102
+ exports.dispatchTool = dispatchTool;
103
+ /**
104
+ * Test-only helper to reset the dispatch lock between tests so the
105
+ * rwlock's pending-queue state doesn't carry across `describe` blocks.
106
+ */
107
+ const __resetDispatchLockForTests = () => {
108
+ lock.reset();
109
+ };
110
+ exports.__resetDispatchLockForTests = __resetDispatchLockForTests;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Maps `ScaiError` (and unknown thrown values) onto the MCP
3
+ * `CallToolResult` error envelope shape consumed by every tool handler.
4
+ *
5
+ * Envelope:
6
+ * - `isError: true`
7
+ * - `content[0]`: text composed as "What happened. Why. Next."
8
+ * - `structuredContent`: typed `{ code, exitCode, what, why, hint, docsUri? }`
9
+ *
10
+ * Both the text body and the structured content flow through
11
+ * `redactStructured` so secrets that leaked into error messages never
12
+ * cross the wire.
13
+ */
14
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
15
+ import { type Remediation, type ScaiErrorCode } from "../shared/errors";
16
+ export interface ToolErrorEnvelope {
17
+ code: ScaiErrorCode;
18
+ exitCode: number;
19
+ what: string;
20
+ why: string;
21
+ hint?: string;
22
+ next: string;
23
+ /**
24
+ * Machine-actionable remediation when the error carries one — lets the
25
+ * agent route the failure (`actor`: act itself / hand to a human /
26
+ * retry) without parsing the prose `next` line.
27
+ */
28
+ remediation?: Remediation;
29
+ docsUri?: string;
30
+ }
31
+ export declare const toolResultFromError: (error: unknown) => CallToolResult;