@bevel-software/platform-core-backend 0.25.2 → 0.27.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 (733) hide show
  1. package/agent-guide/access-control.md +251 -0
  2. package/agent-guide/conventions.md +35 -0
  3. package/agent-guide/directory-structure.md +145 -0
  4. package/agent-guide/finding-things.md +7 -0
  5. package/agent-guide/html-views.md +83 -0
  6. package/agent-guide/introduction.md +27 -0
  7. package/agent-guide/new-knowledge-base.md +24 -0
  8. package/agent-guide/skills.md +47 -0
  9. package/agent-guide/tool-manuals.md +227 -0
  10. package/agent-guide/where-a-new-file-goes.md +36 -0
  11. package/dist/assets.d.ts +26 -0
  12. package/dist/assets.d.ts.map +1 -1
  13. package/dist/assets.js +35 -2
  14. package/dist/assets.js.map +1 -1
  15. package/dist/core/catalog-revision.d.ts +19 -1
  16. package/dist/core/catalog-revision.d.ts.map +1 -1
  17. package/dist/core/catalog-revision.js +14 -3
  18. package/dist/core/catalog-revision.js.map +1 -1
  19. package/dist/core/core-ports.d.ts +11 -0
  20. package/dist/core/core-ports.d.ts.map +1 -1
  21. package/dist/core/core-ports.js.map +1 -1
  22. package/dist/core/create-core-server.d.ts +5 -0
  23. package/dist/core/create-core-server.d.ts.map +1 -1
  24. package/dist/core/create-core-server.js +65 -3
  25. package/dist/core/create-core-server.js.map +1 -1
  26. package/dist/core/create-core-services.d.ts +35 -0
  27. package/dist/core/create-core-services.d.ts.map +1 -1
  28. package/dist/core/create-core-services.js +114 -12
  29. package/dist/core/create-core-services.js.map +1 -1
  30. package/dist/core/lifecycle.d.ts +16 -1
  31. package/dist/core/lifecycle.d.ts.map +1 -1
  32. package/dist/core/lifecycle.js +18 -1
  33. package/dist/core/lifecycle.js.map +1 -1
  34. package/dist/core-config.d.ts +21 -0
  35. package/dist/core-config.d.ts.map +1 -1
  36. package/dist/core-config.js +22 -1
  37. package/dist/core-config.js.map +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -2
  41. package/dist/index.js.map +1 -1
  42. package/dist/modules/access/access-control.interface.d.ts +17 -0
  43. package/dist/modules/access/access-control.interface.d.ts.map +1 -1
  44. package/dist/modules/access/access-control.service.d.ts +2 -0
  45. package/dist/modules/access/access-control.service.d.ts.map +1 -1
  46. package/dist/modules/access/access-control.service.js +27 -0
  47. package/dist/modules/access/access-control.service.js.map +1 -1
  48. package/dist/modules/access/directory-sync-bot.js +1 -1
  49. package/dist/modules/access/directory-sync-bot.js.map +1 -1
  50. package/dist/modules/agent-guide/agent-guide.d.ts +145 -0
  51. package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -0
  52. package/dist/modules/agent-guide/agent-guide.js +199 -0
  53. package/dist/modules/agent-guide/agent-guide.js.map +1 -0
  54. package/dist/modules/agent-guide/agent-guide.tools.d.ts +24 -0
  55. package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -0
  56. package/dist/modules/agent-guide/agent-guide.tools.js +100 -0
  57. package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -0
  58. package/dist/modules/agent-guide/index.d.ts +4 -0
  59. package/dist/modules/agent-guide/index.d.ts.map +1 -0
  60. package/dist/modules/agent-guide/index.js +4 -0
  61. package/dist/modules/agent-guide/index.js.map +1 -0
  62. package/dist/modules/agent-instructions/agent-instructions.routes.d.ts +3 -2
  63. package/dist/modules/agent-instructions/agent-instructions.routes.d.ts.map +1 -1
  64. package/dist/modules/agent-instructions/agent-instructions.routes.js +3 -2
  65. package/dist/modules/agent-instructions/agent-instructions.routes.js.map +1 -1
  66. package/dist/modules/agent-instructions/compose.d.ts +14 -6
  67. package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
  68. package/dist/modules/agent-instructions/compose.js +28 -8
  69. package/dist/modules/agent-instructions/compose.js.map +1 -1
  70. package/dist/modules/agent-instructions/index.d.ts +1 -1
  71. package/dist/modules/agent-instructions/index.d.ts.map +1 -1
  72. package/dist/modules/agent-instructions/index.js +1 -1
  73. package/dist/modules/agent-instructions/index.js.map +1 -1
  74. package/dist/modules/agent-instructions/shared-file-rules.d.ts +10 -50
  75. package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
  76. package/dist/modules/agent-instructions/shared-file-rules.js +51 -104
  77. package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
  78. package/dist/modules/audit/agent-audit.service.d.ts +21 -2
  79. package/dist/modules/audit/agent-audit.service.d.ts.map +1 -1
  80. package/dist/modules/audit/agent-audit.service.js +43 -2
  81. package/dist/modules/audit/agent-audit.service.js.map +1 -1
  82. package/dist/modules/audit/agent-connection.routes.d.ts +34 -0
  83. package/dist/modules/audit/agent-connection.routes.d.ts.map +1 -0
  84. package/dist/modules/audit/agent-connection.routes.js +38 -0
  85. package/dist/modules/audit/agent-connection.routes.js.map +1 -0
  86. package/dist/modules/audit/audit.contract.d.ts +24 -0
  87. package/dist/modules/audit/audit.contract.d.ts.map +1 -1
  88. package/dist/modules/audit/audit.contract.js.map +1 -1
  89. package/dist/modules/audit/index.d.ts +1 -0
  90. package/dist/modules/audit/index.d.ts.map +1 -1
  91. package/dist/modules/audit/index.js +1 -0
  92. package/dist/modules/audit/index.js.map +1 -1
  93. package/dist/modules/auth/account.routes.d.ts.map +1 -1
  94. package/dist/modules/auth/account.routes.js +10 -3
  95. package/dist/modules/auth/account.routes.js.map +1 -1
  96. package/dist/modules/auth/auth.middleware.d.ts +7 -0
  97. package/dist/modules/auth/auth.middleware.d.ts.map +1 -1
  98. package/dist/modules/auth/auth.middleware.js +1 -1
  99. package/dist/modules/auth/auth.middleware.js.map +1 -1
  100. package/dist/modules/code-mode/code-mode.tool.d.ts.map +1 -1
  101. package/dist/modules/code-mode/code-mode.tool.js +11 -3
  102. package/dist/modules/code-mode/code-mode.tool.js.map +1 -1
  103. package/dist/modules/database/core-schema.d.ts +96 -0
  104. package/dist/modules/database/core-schema.d.ts.map +1 -1
  105. package/dist/modules/database/core-schema.js +32 -3
  106. package/dist/modules/database/core-schema.js.map +1 -1
  107. package/dist/modules/embed/account-link.service.d.ts +42 -0
  108. package/dist/modules/embed/account-link.service.d.ts.map +1 -0
  109. package/dist/modules/embed/account-link.service.js +50 -0
  110. package/dist/modules/embed/account-link.service.js.map +1 -0
  111. package/dist/modules/embed/embed-link.d.ts +58 -0
  112. package/dist/modules/embed/embed-link.d.ts.map +1 -0
  113. package/dist/modules/embed/embed-link.js +160 -0
  114. package/dist/modules/embed/embed-link.js.map +1 -0
  115. package/dist/modules/embed/embed.errors.d.ts +30 -0
  116. package/dist/modules/embed/embed.errors.d.ts.map +1 -0
  117. package/dist/modules/embed/embed.errors.js +42 -0
  118. package/dist/modules/embed/embed.errors.js.map +1 -0
  119. package/dist/modules/embed/embed.interface.d.ts +204 -0
  120. package/dist/modules/embed/embed.interface.d.ts.map +1 -0
  121. package/dist/modules/embed/embed.interface.js +2 -0
  122. package/dist/modules/embed/embed.interface.js.map +1 -0
  123. package/dist/modules/embed/embed.routes.d.ts +59 -0
  124. package/dist/modules/embed/embed.routes.d.ts.map +1 -0
  125. package/dist/modules/embed/embed.routes.js +343 -0
  126. package/dist/modules/embed/embed.routes.js.map +1 -0
  127. package/dist/modules/embed/embed.service.d.ts +169 -0
  128. package/dist/modules/embed/embed.service.d.ts.map +1 -0
  129. package/dist/modules/embed/embed.service.js +627 -0
  130. package/dist/modules/embed/embed.service.js.map +1 -0
  131. package/dist/modules/embed/embed.tools.d.ts +51 -0
  132. package/dist/modules/embed/embed.tools.d.ts.map +1 -0
  133. package/dist/modules/embed/embed.tools.js +170 -0
  134. package/dist/modules/embed/embed.tools.js.map +1 -0
  135. package/dist/modules/embed/mcp-app.d.ts +64 -0
  136. package/dist/modules/embed/mcp-app.d.ts.map +1 -0
  137. package/dist/modules/embed/mcp-app.js +147 -0
  138. package/dist/modules/embed/mcp-app.js.map +1 -0
  139. package/dist/modules/embed/mcp-app.routes.d.ts +21 -0
  140. package/dist/modules/embed/mcp-app.routes.d.ts.map +1 -0
  141. package/dist/modules/embed/mcp-app.routes.js +36 -0
  142. package/dist/modules/embed/mcp-app.routes.js.map +1 -0
  143. package/dist/modules/github-app/github-app.connection.d.ts +15 -0
  144. package/dist/modules/github-app/github-app.connection.d.ts.map +1 -1
  145. package/dist/modules/github-app/github-app.connection.js +34 -3
  146. package/dist/modules/github-app/github-app.connection.js.map +1 -1
  147. package/dist/modules/kb-fs/locking-filesystem.d.ts +65 -0
  148. package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -1
  149. package/dist/modules/kb-fs/locking-filesystem.js +300 -0
  150. package/dist/modules/kb-fs/locking-filesystem.js.map +1 -1
  151. package/dist/modules/kb-sync/kb-sync.interface.d.ts +5 -0
  152. package/dist/modules/kb-sync/kb-sync.interface.d.ts.map +1 -1
  153. package/dist/modules/kb-sync/kb-sync.service.d.ts.map +1 -1
  154. package/dist/modules/kb-sync/kb-sync.service.js +6 -0
  155. package/dist/modules/kb-sync/kb-sync.service.js.map +1 -1
  156. package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
  157. package/dist/modules/mcp/mcp-auth.middleware.js +2 -1
  158. package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
  159. package/dist/modules/mcp/mcp.service.d.ts +57 -3
  160. package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
  161. package/dist/modules/mcp/mcp.service.js +177 -24
  162. package/dist/modules/mcp/mcp.service.js.map +1 -1
  163. package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +24 -0
  164. package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
  165. package/dist/modules/mcp/oauth/bevel-oauth-provider.js +32 -4
  166. package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
  167. package/dist/modules/mcp/tool-schema-guard.d.ts +105 -0
  168. package/dist/modules/mcp/tool-schema-guard.d.ts.map +1 -0
  169. package/dist/modules/mcp/tool-schema-guard.js +171 -0
  170. package/dist/modules/mcp/tool-schema-guard.js.map +1 -0
  171. package/dist/modules/onboarding/onboarding.contract.d.ts +80 -0
  172. package/dist/modules/onboarding/onboarding.contract.d.ts.map +1 -0
  173. package/dist/modules/onboarding/onboarding.contract.js +7 -0
  174. package/dist/modules/onboarding/onboarding.contract.js.map +1 -0
  175. package/dist/modules/onboarding/onboarding.routes.d.ts +18 -0
  176. package/dist/modules/onboarding/onboarding.routes.d.ts.map +1 -0
  177. package/dist/modules/onboarding/onboarding.routes.js +81 -0
  178. package/dist/modules/onboarding/onboarding.routes.js.map +1 -0
  179. package/dist/modules/onboarding/starter-pack.service.d.ts +213 -0
  180. package/dist/modules/onboarding/starter-pack.service.d.ts.map +1 -0
  181. package/dist/modules/onboarding/starter-pack.service.js +492 -0
  182. package/dist/modules/onboarding/starter-pack.service.js.map +1 -0
  183. package/dist/modules/onboarding/starter-packs.d.ts +78 -0
  184. package/dist/modules/onboarding/starter-packs.d.ts.map +1 -0
  185. package/dist/modules/onboarding/starter-packs.js +156 -0
  186. package/dist/modules/onboarding/starter-packs.js.map +1 -0
  187. package/dist/modules/plugins/index.d.ts +1 -1
  188. package/dist/modules/plugins/index.d.ts.map +1 -1
  189. package/dist/modules/plugins/index.js +1 -1
  190. package/dist/modules/plugins/index.js.map +1 -1
  191. package/dist/modules/plugins/plugin-provision.service.d.ts +19 -0
  192. package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
  193. package/dist/modules/plugins/plugin-provision.service.js +18 -1
  194. package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
  195. package/dist/modules/plugins/plugins.routes.d.ts +0 -36
  196. package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
  197. package/dist/modules/plugins/plugins.routes.js +31 -0
  198. package/dist/modules/plugins/plugins.routes.js.map +1 -1
  199. package/dist/modules/plugins/plugins.tools.d.ts +36 -2
  200. package/dist/modules/plugins/plugins.tools.d.ts.map +1 -1
  201. package/dist/modules/plugins/plugins.tools.js +71 -14
  202. package/dist/modules/plugins/plugins.tools.js.map +1 -1
  203. package/dist/modules/settings/deployment-settings.service.d.ts +34 -7
  204. package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
  205. package/dist/modules/settings/deployment-settings.service.js +148 -54
  206. package/dist/modules/settings/deployment-settings.service.js.map +1 -1
  207. package/dist/modules/settings/repository-source.d.ts +1 -0
  208. package/dist/modules/settings/repository-source.d.ts.map +1 -1
  209. package/dist/modules/settings/repository-source.js +3 -3
  210. package/dist/modules/settings/repository-source.js.map +1 -1
  211. package/dist/modules/settings/setup.routes.d.ts.map +1 -1
  212. package/dist/modules/settings/setup.routes.js +3 -6
  213. package/dist/modules/settings/setup.routes.js.map +1 -1
  214. package/dist/modules/skills/skills.tools.d.ts.map +1 -1
  215. package/dist/modules/skills/skills.tools.js +103 -43
  216. package/dist/modules/skills/skills.tools.js.map +1 -1
  217. package/dist/modules/tool-auth/connection-key-rejection.d.ts +10 -1
  218. package/dist/modules/tool-auth/connection-key-rejection.d.ts.map +1 -1
  219. package/dist/modules/tool-auth/connection-key-rejection.js +11 -3
  220. package/dist/modules/tool-auth/connection-key-rejection.js.map +1 -1
  221. package/dist/modules/tool-auth/external-api-key.interface.d.ts +8 -0
  222. package/dist/modules/tool-auth/external-api-key.interface.d.ts.map +1 -1
  223. package/dist/modules/tool-auth/external-api-key.service.d.ts +24 -2
  224. package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
  225. package/dist/modules/tool-auth/external-api-key.service.js +59 -2
  226. package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
  227. package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
  228. package/dist/modules/tool-auth/tool-auth.middleware.js +9 -4
  229. package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -1
  230. package/dist/modules/tool-helpers/index.d.ts +28 -1
  231. package/dist/modules/tool-helpers/index.d.ts.map +1 -1
  232. package/dist/modules/tool-helpers/index.js +28 -1
  233. package/dist/modules/tool-helpers/index.js.map +1 -1
  234. package/dist/modules/tool-helpers/route-argument-check.d.ts +10 -0
  235. package/dist/modules/tool-helpers/route-argument-check.d.ts.map +1 -0
  236. package/dist/modules/tool-helpers/route-argument-check.js +132 -0
  237. package/dist/modules/tool-helpers/route-argument-check.js.map +1 -0
  238. package/dist/modules/tool-helpers/route-tool-schemas.d.ts +89 -0
  239. package/dist/modules/tool-helpers/route-tool-schemas.d.ts.map +1 -0
  240. package/dist/modules/tool-helpers/route-tool-schemas.js +113 -0
  241. package/dist/modules/tool-helpers/route-tool-schemas.js.map +1 -0
  242. package/dist/modules/tool-helpers/tool-def.d.ts +71 -0
  243. package/dist/modules/tool-helpers/tool-def.d.ts.map +1 -1
  244. package/dist/modules/tool-helpers/tool-def.js +70 -6
  245. package/dist/modules/tool-helpers/tool-def.js.map +1 -1
  246. package/dist/modules/tool-helpers/tool-handler.d.ts +46 -6
  247. package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -1
  248. package/dist/modules/tool-helpers/tool-handler.js +157 -8
  249. package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
  250. package/dist/modules/tool-helpers/tool.contract.d.ts +9 -0
  251. package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
  252. package/dist/modules/tool-helpers/tool.contract.js.map +1 -1
  253. package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +23 -4
  254. package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
  255. package/dist/modules/tool-manuals/tool-manuals.contract.js.map +1 -1
  256. package/dist/modules/tool-manuals/tool-manuals.service.d.ts +4 -0
  257. package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
  258. package/dist/modules/tool-manuals/tool-manuals.service.js +14 -0
  259. package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
  260. package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +7 -0
  261. package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
  262. package/dist/modules/tool-manuals/tool-manuals.tools.js +77 -38
  263. package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
  264. package/dist/modules/tool-registry/description-length.d.ts +20 -16
  265. package/dist/modules/tool-registry/description-length.d.ts.map +1 -1
  266. package/dist/modules/tool-registry/description-length.js +50 -30
  267. package/dist/modules/tool-registry/description-length.js.map +1 -1
  268. package/dist/modules/tool-registry/guide-first.d.ts +27 -0
  269. package/dist/modules/tool-registry/guide-first.d.ts.map +1 -0
  270. package/dist/modules/tool-registry/guide-first.js +40 -0
  271. package/dist/modules/tool-registry/guide-first.js.map +1 -0
  272. package/dist/modules/tool-registry/tool-registry.d.ts +6 -0
  273. package/dist/modules/tool-registry/tool-registry.d.ts.map +1 -1
  274. package/dist/modules/tool-registry/tool-registry.js +9 -2
  275. package/dist/modules/tool-registry/tool-registry.js.map +1 -1
  276. package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts +449 -0
  277. package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +1 -0
  278. package/dist/modules/workflow/agent-tools/change-request-read-shape.js +481 -0
  279. package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +1 -0
  280. package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts +126 -0
  281. package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +1 -0
  282. package/dist/modules/workflow/agent-tools/change-request-read.tools.js +611 -0
  283. package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +1 -0
  284. package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +12 -1
  285. package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -1
  286. package/dist/modules/workflow/agent-tools/change-request-summary.js +5 -1
  287. package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -1
  288. package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +8 -1
  289. package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
  290. package/dist/modules/workflow/agent-tools/workflow.tools.js +133 -37
  291. package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
  292. package/dist/modules/workflow/file-lock.service.d.ts +29 -5
  293. package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
  294. package/dist/modules/workflow/file-lock.service.js +62 -5
  295. package/dist/modules/workflow/file-lock.service.js.map +1 -1
  296. package/dist/modules/workflow/git/git.service.d.ts +282 -14
  297. package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
  298. package/dist/modules/workflow/git/git.service.js +627 -126
  299. package/dist/modules/workflow/git/git.service.js.map +1 -1
  300. package/dist/modules/workflow/git/merge-commit.d.ts +73 -0
  301. package/dist/modules/workflow/git/merge-commit.d.ts.map +1 -0
  302. package/dist/modules/workflow/git/merge-commit.js +89 -0
  303. package/dist/modules/workflow/git/merge-commit.js.map +1 -0
  304. package/dist/modules/workflow/git/node-git-runner.d.ts +15 -0
  305. package/dist/modules/workflow/git/node-git-runner.d.ts.map +1 -1
  306. package/dist/modules/workflow/git/node-git-runner.js +78 -6
  307. package/dist/modules/workflow/git/node-git-runner.js.map +1 -1
  308. package/dist/modules/workflow/git/pull-request.service.d.ts +94 -1
  309. package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
  310. package/dist/modules/workflow/git/pull-request.service.js +332 -37
  311. package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
  312. package/dist/modules/workflow/pending-commits.service.d.ts +15 -0
  313. package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
  314. package/dist/modules/workflow/pending-commits.service.js +25 -1
  315. package/dist/modules/workflow/pending-commits.service.js.map +1 -1
  316. package/dist/modules/workflow/pending-commits.worker.d.ts +6 -1
  317. package/dist/modules/workflow/pending-commits.worker.d.ts.map +1 -1
  318. package/dist/modules/workflow/pending-commits.worker.js +23 -6
  319. package/dist/modules/workflow/pending-commits.worker.js.map +1 -1
  320. package/dist/modules/workflow/recovery-bot.js +1 -1
  321. package/dist/modules/workflow/recovery-bot.js.map +1 -1
  322. package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts +35 -0
  323. package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -1
  324. package/dist/modules/workflow/review-workflow/review-workflow.service.js +180 -13
  325. package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
  326. package/dist/modules/workflow/sanitize-error.d.ts +16 -0
  327. package/dist/modules/workflow/sanitize-error.d.ts.map +1 -1
  328. package/dist/modules/workflow/sanitize-error.js +45 -0
  329. package/dist/modules/workflow/sanitize-error.js.map +1 -1
  330. package/dist/modules/workflow/workflow.routes.d.ts +6 -2
  331. package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
  332. package/dist/modules/workflow/workflow.routes.js +7 -2
  333. package/dist/modules/workflow/workflow.routes.js.map +1 -1
  334. package/dist/modules/workflow/workflow.service.d.ts +187 -15
  335. package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
  336. package/dist/modules/workflow/workflow.service.js +808 -106
  337. package/dist/modules/workflow/workflow.service.js.map +1 -1
  338. package/dist/modules/workspace/agent-download.builder.d.ts +105 -0
  339. package/dist/modules/workspace/agent-download.builder.d.ts.map +1 -0
  340. package/dist/modules/workspace/agent-download.builder.js +238 -0
  341. package/dist/modules/workspace/agent-download.builder.js.map +1 -0
  342. package/dist/modules/workspace/agent-download.routes.d.ts +77 -0
  343. package/dist/modules/workspace/agent-download.routes.d.ts.map +1 -0
  344. package/dist/modules/workspace/agent-download.routes.js +156 -0
  345. package/dist/modules/workspace/agent-download.routes.js.map +1 -0
  346. package/dist/modules/workspace/agent-download.store.d.ts +225 -0
  347. package/dist/modules/workspace/agent-download.store.d.ts.map +1 -0
  348. package/dist/modules/workspace/agent-download.store.js +423 -0
  349. package/dist/modules/workspace/agent-download.store.js.map +1 -0
  350. package/dist/modules/workspace/agent-upload.store.d.ts +10 -1
  351. package/dist/modules/workspace/agent-upload.store.d.ts.map +1 -1
  352. package/dist/modules/workspace/agent-upload.store.js +16 -6
  353. package/dist/modules/workspace/agent-upload.store.js.map +1 -1
  354. package/dist/modules/workspace/file-readers/raw-mime.d.ts +6 -0
  355. package/dist/modules/workspace/file-readers/raw-mime.d.ts.map +1 -0
  356. package/dist/modules/workspace/file-readers/raw-mime.js +38 -0
  357. package/dist/modules/workspace/file-readers/raw-mime.js.map +1 -0
  358. package/dist/modules/workspace/file-readers/text-reader.d.ts +5 -5
  359. package/dist/modules/workspace/file-readers/text-reader.d.ts.map +1 -1
  360. package/dist/modules/workspace/file-readers/text-reader.js +5 -8
  361. package/dist/modules/workspace/file-readers/text-reader.js.map +1 -1
  362. package/dist/modules/workspace/first-run.d.ts +111 -0
  363. package/dist/modules/workspace/first-run.d.ts.map +1 -0
  364. package/dist/modules/workspace/first-run.js +181 -0
  365. package/dist/modules/workspace/first-run.js.map +1 -0
  366. package/dist/modules/workspace/move-links.d.ts +92 -0
  367. package/dist/modules/workspace/move-links.d.ts.map +1 -0
  368. package/dist/modules/workspace/move-links.js +173 -0
  369. package/dist/modules/workspace/move-links.js.map +1 -0
  370. package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
  371. package/dist/modules/workspace/startup/steps/seed-tree.js +24 -39
  372. package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
  373. package/dist/modules/workspace/startup/steps/template-files.step.d.ts +58 -52
  374. package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
  375. package/dist/modules/workspace/startup/steps/template-files.step.js +209 -223
  376. package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
  377. package/dist/modules/workspace/startup/steps/template-source.d.ts +5 -3
  378. package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
  379. package/dist/modules/workspace/startup/steps/template-source.js +5 -3
  380. package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
  381. package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
  382. package/dist/modules/workspace/workspace.routes.js +63 -22
  383. package/dist/modules/workspace/workspace.routes.js.map +1 -1
  384. package/dist/modules/workspace/workspace.service.d.ts +75 -2
  385. package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
  386. package/dist/modules/workspace/workspace.service.js +197 -24
  387. package/dist/modules/workspace/workspace.service.js.map +1 -1
  388. package/dist/modules/workspace/workspace.tools.d.ts +68 -1
  389. package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
  390. package/dist/modules/workspace/workspace.tools.js +642 -71
  391. package/dist/modules/workspace/workspace.tools.js.map +1 -1
  392. package/dist/modules/write-access/write-access.d.ts.map +1 -1
  393. package/dist/modules/write-access/write-access.js +9 -0
  394. package/dist/modules/write-access/write-access.js.map +1 -1
  395. package/dist/shared/domain-errors.d.ts +84 -1
  396. package/dist/shared/domain-errors.d.ts.map +1 -1
  397. package/dist/shared/domain-errors.js +100 -12
  398. package/dist/shared/domain-errors.js.map +1 -1
  399. package/dist/shared/git.contract.d.ts +10 -1
  400. package/dist/shared/git.contract.d.ts.map +1 -1
  401. package/dist/shared/git.contract.js.map +1 -1
  402. package/dist/shared/hidden-tools.d.ts +44 -0
  403. package/dist/shared/hidden-tools.d.ts.map +1 -0
  404. package/dist/shared/hidden-tools.js +13 -0
  405. package/dist/shared/hidden-tools.js.map +1 -0
  406. package/dist/shared/utf8-text.d.ts +15 -0
  407. package/dist/shared/utf8-text.d.ts.map +1 -0
  408. package/dist/shared/utf8-text.js +20 -0
  409. package/dist/shared/utf8-text.js.map +1 -0
  410. package/dist/tenancy/static-tenant-source.d.ts +2 -1
  411. package/dist/tenancy/static-tenant-source.d.ts.map +1 -1
  412. package/dist/tenancy/static-tenant-source.js +9 -2
  413. package/dist/tenancy/static-tenant-source.js.map +1 -1
  414. package/kb-template/.bevelignore +0 -5
  415. package/mcp-app/page.html +349 -0
  416. package/migrations/0017_atlassian_account_links.sql +37 -0
  417. package/migrations/meta/0017_snapshot.json +2396 -0
  418. package/migrations/meta/_journal.json +8 -1
  419. package/package.json +6 -3
  420. package/src/__tests__/kb-layout-config.test.ts +10 -100
  421. package/src/__tests__/packaged-assets-ship.test.ts +66 -0
  422. package/src/assets.ts +38 -2
  423. package/src/core/__tests__/catalog-revision.test.ts +40 -0
  424. package/src/core/__tests__/gated-boot.test.ts +1 -0
  425. package/src/core/__tests__/lifecycle.test.ts +14 -0
  426. package/src/core/catalog-revision.ts +15 -2
  427. package/src/core/core-ports.ts +11 -0
  428. package/src/core/create-core-server.ts +78 -3
  429. package/src/core/create-core-services.ts +168 -10
  430. package/src/core/lifecycle.ts +28 -2
  431. package/src/core-config.ts +24 -1
  432. package/src/index.ts +2 -2
  433. package/src/modules/access/__tests__/access-control.atref-batch.test.ts +58 -0
  434. package/src/modules/access/__tests__/access-control.platform-restore.test.ts +8 -7
  435. package/src/modules/access/__tests__/access-control.service.test.ts +19 -0
  436. package/src/modules/access/__tests__/access-personal-plugin.test.ts +1 -18
  437. package/src/modules/access/access-control.interface.ts +28 -0
  438. package/src/modules/access/access-control.service.ts +37 -0
  439. package/src/modules/access/directory-sync-bot.ts +1 -1
  440. package/src/modules/agent-guide/__tests__/agent-guide.test.ts +386 -0
  441. package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +207 -0
  442. package/src/modules/agent-guide/agent-guide.tools.ts +122 -0
  443. package/src/modules/agent-guide/agent-guide.ts +300 -0
  444. package/src/modules/agent-guide/index.ts +22 -0
  445. package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +39 -118
  446. package/src/modules/agent-instructions/agent-instructions.routes.ts +3 -2
  447. package/src/modules/agent-instructions/compose.ts +26 -8
  448. package/src/modules/agent-instructions/index.ts +0 -3
  449. package/src/modules/agent-instructions/shared-file-rules.ts +50 -112
  450. package/src/modules/audit/__tests__/agent-audit.service.test.ts +64 -4
  451. package/src/modules/audit/__tests__/agent-connection.routes.test.ts +102 -0
  452. package/src/modules/audit/agent-audit.service.ts +58 -3
  453. package/src/modules/audit/agent-connection.routes.ts +56 -0
  454. package/src/modules/audit/audit.contract.ts +26 -0
  455. package/src/modules/audit/index.ts +1 -0
  456. package/src/modules/auth/__tests__/account.routes.test.ts +5 -3
  457. package/src/modules/auth/account.routes.ts +10 -3
  458. package/src/modules/auth/auth.middleware.ts +1 -1
  459. package/src/modules/code-mode/__tests__/code-mode.tool.test.ts +18 -2
  460. package/src/modules/code-mode/code-mode.tool.ts +13 -2
  461. package/src/modules/database/core-schema.ts +33 -3
  462. package/src/modules/embed/__tests__/account-links.migration.test.ts +98 -0
  463. package/src/modules/embed/__tests__/embed-link.test.ts +122 -0
  464. package/src/modules/embed/__tests__/embed.routes.test.ts +362 -0
  465. package/src/modules/embed/__tests__/embed.service.lock.test.ts +193 -0
  466. package/src/modules/embed/__tests__/embed.service.test.ts +805 -0
  467. package/src/modules/embed/__tests__/embed.tools.test.ts +304 -0
  468. package/src/modules/embed/__tests__/mcp-app.test.ts +207 -0
  469. package/src/modules/embed/account-link.service.ts +76 -0
  470. package/src/modules/embed/embed-link.ts +180 -0
  471. package/src/modules/embed/embed.errors.ts +43 -0
  472. package/src/modules/embed/embed.interface.ts +203 -0
  473. package/src/modules/embed/embed.routes.ts +363 -0
  474. package/src/modules/embed/embed.service.ts +705 -0
  475. package/src/modules/embed/embed.tools.ts +206 -0
  476. package/src/modules/embed/mcp-app.routes.ts +41 -0
  477. package/src/modules/embed/mcp-app.ts +173 -0
  478. package/src/modules/github-app/__tests__/github-app.test.ts +76 -0
  479. package/src/modules/github-app/github-app.connection.ts +38 -4
  480. package/src/modules/kb-fs/__tests__/move-with-edits.test.ts +304 -0
  481. package/src/modules/kb-fs/locking-filesystem.ts +287 -0
  482. package/src/modules/kb-sync/__tests__/kb-sync.service.test.ts +35 -0
  483. package/src/modules/kb-sync/kb-sync.interface.ts +2 -0
  484. package/src/modules/kb-sync/kb-sync.service.ts +6 -0
  485. package/src/modules/mcp/__tests__/bevel-oauth-provider.test.ts +68 -11
  486. package/src/modules/mcp/__tests__/fake-downstream-mcp-server.ts +14 -3
  487. package/src/modules/mcp/__tests__/mcp-proxy-helpers.test.ts +37 -2
  488. package/src/modules/mcp/__tests__/mcp.app.e2e.test.ts +200 -0
  489. package/src/modules/mcp/__tests__/mcp.e2e.test.ts +252 -0
  490. package/src/modules/mcp/__tests__/mcp.service.test.ts +42 -24
  491. package/src/modules/mcp/__tests__/tool-call-interface.e2e.test.ts +499 -0
  492. package/src/modules/mcp/__tests__/tool-schema-guard.test.ts +266 -0
  493. package/src/modules/mcp/mcp-auth.middleware.ts +2 -1
  494. package/src/modules/mcp/mcp.service.ts +218 -31
  495. package/src/modules/mcp/oauth/bevel-oauth-provider.ts +42 -4
  496. package/src/modules/mcp/tool-schema-guard.ts +196 -0
  497. package/src/modules/onboarding/__tests__/onboarding.routes.test.ts +163 -0
  498. package/src/modules/onboarding/__tests__/starter-pack.service.test.ts +635 -0
  499. package/src/modules/onboarding/__tests__/starter-packs.test.ts +169 -0
  500. package/src/modules/onboarding/onboarding.contract.ts +85 -0
  501. package/src/modules/onboarding/onboarding.routes.ts +85 -0
  502. package/src/modules/onboarding/starter-pack.service.ts +580 -0
  503. package/src/modules/onboarding/starter-packs.ts +182 -0
  504. package/src/modules/plugins/__tests__/plugins.tools.test.ts +177 -4
  505. package/src/modules/plugins/index.ts +1 -0
  506. package/src/modules/plugins/plugin-provision.service.ts +22 -1
  507. package/src/modules/plugins/plugins.routes.ts +29 -0
  508. package/src/modules/plugins/plugins.tools.ts +75 -15
  509. package/src/modules/settings/__tests__/deployment-settings.service.test.ts +176 -56
  510. package/src/modules/settings/__tests__/repository-source.test.ts +9 -0
  511. package/src/modules/settings/deployment-settings.service.ts +144 -55
  512. package/src/modules/settings/repository-source.ts +4 -4
  513. package/src/modules/settings/setup.routes.ts +3 -6
  514. package/src/modules/skills/__tests__/skills.tools.description.test.ts +95 -0
  515. package/src/modules/skills/skills.tools.ts +112 -46
  516. package/src/modules/tool-auth/__tests__/connection-key-rejection.test.ts +32 -0
  517. package/src/modules/tool-auth/__tests__/external-api-key.service.test.ts +65 -0
  518. package/src/modules/tool-auth/connection-key-rejection.ts +13 -3
  519. package/src/modules/tool-auth/external-api-key.interface.ts +9 -0
  520. package/src/modules/tool-auth/external-api-key.service.ts +61 -4
  521. package/src/modules/tool-auth/tool-auth.middleware.ts +13 -4
  522. package/src/modules/tool-helpers/__tests__/branch-declaration.test.ts +502 -0
  523. package/src/modules/tool-helpers/__tests__/route-argument-check.test.ts +337 -0
  524. package/src/modules/tool-helpers/index.ts +34 -1
  525. package/src/modules/tool-helpers/route-argument-check.ts +149 -0
  526. package/src/modules/tool-helpers/route-tool-schemas.ts +171 -0
  527. package/src/modules/tool-helpers/tool-def.ts +132 -7
  528. package/src/modules/tool-helpers/tool-handler.ts +196 -8
  529. package/src/modules/tool-helpers/tool.contract.ts +9 -0
  530. package/src/modules/tool-manuals/__tests__/tool-manuals.detail.route.test.ts +57 -0
  531. package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +73 -4
  532. package/src/modules/tool-manuals/tool-manuals.contract.ts +24 -4
  533. package/src/modules/tool-manuals/tool-manuals.service.ts +17 -0
  534. package/src/modules/tool-manuals/tool-manuals.tools.ts +86 -38
  535. package/src/modules/tool-registry/__tests__/own-tool-schemas.test.ts +173 -0
  536. package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +81 -66
  537. package/src/modules/tool-registry/description-length.ts +57 -32
  538. package/src/modules/tool-registry/guide-first.ts +41 -0
  539. package/src/modules/tool-registry/tool-registry.ts +9 -2
  540. package/src/modules/workflow/__tests__/apply-failure.test.ts +6 -1
  541. package/src/modules/workflow/__tests__/file-lock.service.deletion-gate.test.ts +104 -0
  542. package/src/modules/workflow/__tests__/pending-commits.repository-replaced.test.ts +66 -0
  543. package/src/modules/workflow/__tests__/pending-commits.worker.test.ts +31 -2
  544. package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +110 -6
  545. package/src/modules/workflow/__tests__/sanitize-error.test.ts +89 -1
  546. package/src/modules/workflow/__tests__/workflow.routes.push-refused.test.ts +202 -0
  547. package/src/modules/workflow/__tests__/workflow.service.branch-in-use.test.ts +6 -6
  548. package/src/modules/workflow/__tests__/workflow.service.delete-branch.test.ts +1026 -0
  549. package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +468 -10
  550. package/src/modules/workflow/__tests__/workflow.service.folder-proposals.test.ts +4 -0
  551. package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +5 -4
  552. package/src/modules/workflow/__tests__/workflow.service.update-from-target.test.ts +54 -2
  553. package/src/modules/workflow/agent-tools/__tests__/change-request-read-shape.test.ts +705 -0
  554. package/src/modules/workflow/agent-tools/__tests__/change-request-read.tools.test.ts +1554 -0
  555. package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +150 -4
  556. package/src/modules/workflow/agent-tools/change-request-read-shape.ts +712 -0
  557. package/src/modules/workflow/agent-tools/change-request-read.tools.ts +759 -0
  558. package/src/modules/workflow/agent-tools/change-request-summary.ts +5 -1
  559. package/src/modules/workflow/agent-tools/workflow.tools.ts +137 -35
  560. package/src/modules/workflow/file-lock.service.ts +67 -5
  561. package/src/modules/workflow/git/__tests__/git.service.appliedChange.test.ts +285 -0
  562. package/src/modules/workflow/git/__tests__/git.service.changedFilesForPr.test.ts +124 -0
  563. package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +164 -0
  564. package/src/modules/workflow/git/__tests__/git.service.mergeChangeRequest.test.ts +334 -0
  565. package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +48 -1
  566. package/src/modules/workflow/git/__tests__/node-git-runner.test.ts +231 -2
  567. package/src/modules/workflow/git/__tests__/pull-request.service.list-fetch.test.ts +72 -2
  568. package/src/modules/workflow/git/__tests__/pull-request.service.placeholder.test.ts +24 -2
  569. package/src/modules/workflow/git/__tests__/pull-request.service.test.ts +620 -1
  570. package/src/modules/workflow/git/git.service.ts +714 -133
  571. package/src/modules/workflow/git/merge-commit.ts +88 -0
  572. package/src/modules/workflow/git/node-git-runner.ts +82 -7
  573. package/src/modules/workflow/git/pull-request.service.ts +380 -54
  574. package/src/modules/workflow/pending-commits.service.ts +29 -1
  575. package/src/modules/workflow/pending-commits.worker.ts +24 -6
  576. package/src/modules/workflow/recovery-bot.ts +1 -1
  577. package/src/modules/workflow/review-workflow/__tests__/approval-states.test.ts +7 -1
  578. package/src/modules/workflow/review-workflow/__tests__/merge-records-own-commit.test.ts +407 -0
  579. package/src/modules/workflow/review-workflow/review-workflow.service.ts +191 -12
  580. package/src/modules/workflow/sanitize-error.ts +50 -0
  581. package/src/modules/workflow/workflow.routes.ts +7 -2
  582. package/src/modules/workflow/workflow.service.ts +886 -112
  583. package/src/modules/workspace/__tests__/agent-downloads.test.ts +823 -0
  584. package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +4 -3
  585. package/src/modules/workspace/__tests__/first-run.test.ts +234 -0
  586. package/src/modules/workspace/__tests__/git-internals.security.test.ts +5 -2
  587. package/src/modules/workspace/__tests__/md-links.test.ts +353 -0
  588. package/src/modules/workspace/__tests__/move-links.test.ts +261 -0
  589. package/src/modules/workspace/__tests__/rest-tool-arguments.test.ts +219 -0
  590. package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +3 -0
  591. package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +102 -0
  592. package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +52 -5
  593. package/src/modules/workspace/__tests__/workspace.routes.folder-zip-access.test.ts +190 -0
  594. package/src/modules/workspace/__tests__/workspace.routes.move-platform-files.test.ts +21 -10
  595. package/src/modules/workspace/__tests__/workspace.service.forget-clone-races.test.ts +8 -4
  596. package/src/modules/workspace/__tests__/workspace.service.test.ts +50 -8
  597. package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +33 -55
  598. package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +44 -1
  599. package/src/modules/workspace/__tests__/workspace.tools.test.ts +664 -34
  600. package/src/modules/workspace/agent-download.builder.ts +308 -0
  601. package/src/modules/workspace/agent-download.routes.ts +183 -0
  602. package/src/modules/workspace/agent-download.store.ts +533 -0
  603. package/src/modules/workspace/agent-upload.store.ts +23 -7
  604. package/src/modules/workspace/file-readers/raw-mime.ts +40 -0
  605. package/src/modules/workspace/file-readers/text-reader.ts +5 -8
  606. package/src/modules/workspace/first-run.ts +222 -0
  607. package/src/modules/workspace/move-links.ts +237 -0
  608. package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +191 -489
  609. package/src/modules/workspace/startup/steps/seed-tree.ts +23 -38
  610. package/src/modules/workspace/startup/steps/template-files.step.ts +217 -249
  611. package/src/modules/workspace/startup/steps/template-source.ts +5 -3
  612. package/src/modules/workspace/workspace.routes.ts +64 -22
  613. package/src/modules/workspace/workspace.service.ts +202 -25
  614. package/src/modules/workspace/workspace.tools.ts +707 -68
  615. package/src/modules/write-access/__tests__/write-access.test.ts +13 -0
  616. package/src/modules/write-access/write-access.ts +9 -0
  617. package/src/shared/domain-errors.ts +123 -11
  618. package/src/shared/git.contract.ts +8 -1
  619. package/src/shared/hidden-tools.ts +45 -0
  620. package/src/shared/utf8-text.ts +21 -0
  621. package/src/tenancy/__tests__/static-tenant-source.test.ts +1 -0
  622. package/src/tenancy/static-tenant-source.ts +10 -2
  623. package/starter-packs/README.md +103 -0
  624. package/starter-packs/engineering/KnowledgeBase/About us.md +9 -0
  625. package/starter-packs/engineering/KnowledgeBase/Architecture.md +9 -0
  626. package/starter-packs/engineering/KnowledgeBase/Glossary.md +9 -0
  627. package/starter-packs/engineering/KnowledgeBase/How we ship.md +9 -0
  628. package/starter-packs/engineering/Plugins/engineering-starter/LICENSE +21 -0
  629. package/starter-packs/engineering/Plugins/engineering-starter/SOURCE.md +20 -0
  630. package/starter-packs/engineering/Plugins/engineering-starter/access.md +19 -0
  631. package/starter-packs/engineering/Plugins/engineering-starter/plugin.json +10 -0
  632. package/starter-packs/engineering/Plugins/engineering-starter/skills/office-hours/SKILL.md +171 -0
  633. package/starter-packs/engineering/Plugins/engineering-starter/skills/office-hours/sections/phase-2a-startup-diagnostic.md +157 -0
  634. package/starter-packs/engineering/Plugins/engineering-starter/skills/office-hours/sections/phase-2b-builder-brainstorm.md +39 -0
  635. package/starter-packs/engineering/Plugins/engineering-starter/skills/plan-ceo-review/SKILL.md +144 -0
  636. package/starter-packs/engineering/Plugins/engineering-starter/skills/plan-eng-review/SKILL.md +144 -0
  637. package/starter-packs/engineering/Plugins/engineering-starter/skills/review/SKILL.md +80 -0
  638. package/starter-packs/engineering/Plugins/engineering-starter/skills/review/checklist.md +184 -0
  639. package/starter-packs/engineering/pack.yaml +11 -0
  640. package/starter-packs/general/KnowledgeBase/About us.md +9 -0
  641. package/starter-packs/general/KnowledgeBase/Glossary.md +9 -0
  642. package/starter-packs/general/KnowledgeBase/How we work.md +9 -0
  643. package/starter-packs/general/Plugins/general-starter/LICENSE +202 -0
  644. package/starter-packs/general/Plugins/general-starter/SOURCE.md +10 -0
  645. package/starter-packs/general/Plugins/general-starter/access.md +19 -0
  646. package/starter-packs/general/Plugins/general-starter/plugin.json +10 -0
  647. package/starter-packs/general/Plugins/general-starter/skills/memory-management/SKILL.md +332 -0
  648. package/starter-packs/general/Plugins/general-starter/skills/productivity-start/SKILL.md +163 -0
  649. package/starter-packs/general/Plugins/general-starter/skills/productivity-update/SKILL.md +167 -0
  650. package/starter-packs/general/Plugins/general-starter/skills/task-management/SKILL.md +83 -0
  651. package/starter-packs/general/pack.yaml +10 -0
  652. package/starter-packs/operations/KnowledgeBase/Glossary.md +9 -0
  653. package/starter-packs/operations/KnowledgeBase/How we work.md +9 -0
  654. package/starter-packs/operations/KnowledgeBase/Processes.md +9 -0
  655. package/starter-packs/operations/KnowledgeBase/Tools we use.md +9 -0
  656. package/starter-packs/operations/KnowledgeBase/Vendors.md +9 -0
  657. package/starter-packs/operations/Plugins/operations-starter/LICENSE +202 -0
  658. package/starter-packs/operations/Plugins/operations-starter/SOURCE.md +10 -0
  659. package/starter-packs/operations/Plugins/operations-starter/access.md +19 -0
  660. package/starter-packs/operations/Plugins/operations-starter/plugin.json +10 -0
  661. package/starter-packs/operations/Plugins/operations-starter/skills/capacity-plan/SKILL.md +111 -0
  662. package/starter-packs/operations/Plugins/operations-starter/skills/change-request/SKILL.md +119 -0
  663. package/starter-packs/operations/Plugins/operations-starter/skills/compliance-tracking/SKILL.md +44 -0
  664. package/starter-packs/operations/Plugins/operations-starter/skills/process-doc/SKILL.md +80 -0
  665. package/starter-packs/operations/Plugins/operations-starter/skills/process-optimization/SKILL.md +39 -0
  666. package/starter-packs/operations/Plugins/operations-starter/skills/risk-assessment/SKILL.md +40 -0
  667. package/starter-packs/operations/Plugins/operations-starter/skills/runbook/SKILL.md +85 -0
  668. package/starter-packs/operations/Plugins/operations-starter/skills/status-report/SKILL.md +75 -0
  669. package/starter-packs/operations/Plugins/operations-starter/skills/vendor-review/SKILL.md +102 -0
  670. package/starter-packs/operations/pack.yaml +12 -0
  671. package/starter-packs/sales/KnowledgeBase/About us.md +9 -0
  672. package/starter-packs/sales/KnowledgeBase/Customers.md +9 -0
  673. package/starter-packs/sales/KnowledgeBase/Glossary.md +9 -0
  674. package/starter-packs/sales/KnowledgeBase/How we sell.md +9 -0
  675. package/starter-packs/sales/KnowledgeBase/Objections.md +9 -0
  676. package/starter-packs/sales/KnowledgeBase/Pricing.md +9 -0
  677. package/starter-packs/sales/Plugins/sales-starter/LICENSE +202 -0
  678. package/starter-packs/sales/Plugins/sales-starter/SOURCE.md +10 -0
  679. package/starter-packs/sales/Plugins/sales-starter/access.md +19 -0
  680. package/starter-packs/sales/Plugins/sales-starter/plugin.json +10 -0
  681. package/starter-packs/sales/Plugins/sales-starter/skills/account-context/SKILL.md +94 -0
  682. package/starter-packs/sales/Plugins/sales-starter/skills/account-plan/SKILL.md +95 -0
  683. package/starter-packs/sales/Plugins/sales-starter/skills/account-research/SKILL.md +99 -0
  684. package/starter-packs/sales/Plugins/sales-starter/skills/account-tiering/SKILL.md +101 -0
  685. package/starter-packs/sales/Plugins/sales-starter/skills/call-prep/SKILL.md +111 -0
  686. package/starter-packs/sales/Plugins/sales-starter/skills/call-summary/SKILL.md +111 -0
  687. package/starter-packs/sales/Plugins/sales-starter/skills/close-plan/SKILL.md +106 -0
  688. package/starter-packs/sales/Plugins/sales-starter/skills/competitive-intelligence/SKILL.md +102 -0
  689. package/starter-packs/sales/Plugins/sales-starter/skills/create-an-asset/SKILL.md +105 -0
  690. package/starter-packs/sales/Plugins/sales-starter/skills/crm-hygiene-check/SKILL.md +103 -0
  691. package/starter-packs/sales/Plugins/sales-starter/skills/customer-health/SKILL.md +108 -0
  692. package/starter-packs/sales/Plugins/sales-starter/skills/customer-voice/SKILL.md +94 -0
  693. package/starter-packs/sales/Plugins/sales-starter/skills/daily-briefing/SKILL.md +61 -0
  694. package/starter-packs/sales/Plugins/sales-starter/skills/deal-advance-gap/SKILL.md +102 -0
  695. package/starter-packs/sales/Plugins/sales-starter/skills/deal-review/SKILL.md +105 -0
  696. package/starter-packs/sales/Plugins/sales-starter/skills/deal-signals/SKILL.md +96 -0
  697. package/starter-packs/sales/Plugins/sales-starter/skills/deal-slip-scenario/SKILL.md +104 -0
  698. package/starter-packs/sales/Plugins/sales-starter/skills/draft-outreach/SKILL.md +116 -0
  699. package/starter-packs/sales/Plugins/sales-starter/skills/end-of-day/SKILL.md +114 -0
  700. package/starter-packs/sales/Plugins/sales-starter/skills/expansion-whitespace/SKILL.md +97 -0
  701. package/starter-packs/sales/Plugins/sales-starter/skills/forecast/SKILL.md +100 -0
  702. package/starter-packs/sales/Plugins/sales-starter/skills/handle-objection/SKILL.md +93 -0
  703. package/starter-packs/sales/Plugins/sales-starter/skills/inbox-sweep/SKILL.md +114 -0
  704. package/starter-packs/sales/Plugins/sales-starter/skills/lead-triage/SKILL.md +106 -0
  705. package/starter-packs/sales/Plugins/sales-starter/skills/log-activity/SKILL.md +111 -0
  706. package/starter-packs/sales/Plugins/sales-starter/skills/pipeline-review/SKILL.md +97 -0
  707. package/starter-packs/sales/Plugins/sales-starter/skills/renewal-radar/SKILL.md +95 -0
  708. package/starter-packs/sales/Plugins/sales-starter/skills/rep-context/SKILL.md +90 -0
  709. package/starter-packs/sales/Plugins/sales-starter/skills/route-lead/SKILL.md +111 -0
  710. package/starter-packs/sales/Plugins/sales-starter/skills/sales-setup/SKILL.md +200 -0
  711. package/starter-packs/sales/Plugins/sales-starter/skills/schedule-meeting/SKILL.md +99 -0
  712. package/starter-packs/sales/Plugins/sales-starter/skills/stakeholder-map/SKILL.md +107 -0
  713. package/starter-packs/sales/Plugins/sales-starter/skills/team-pipeline/SKILL.md +105 -0
  714. package/starter-packs/sales/Plugins/sales-starter/skills/update-opportunity/SKILL.md +112 -0
  715. package/starter-packs/sales/Plugins/sales-starter/skills/weekly-wrap/SKILL.md +90 -0
  716. package/starter-packs/sales/Plugins/sales-starter/skills/win-loss-review/SKILL.md +88 -0
  717. package/starter-packs/sales/pack.yaml +13 -0
  718. package/starter-packs/support/KnowledgeBase/Escalations.md +9 -0
  719. package/starter-packs/support/KnowledgeBase/Glossary.md +9 -0
  720. package/starter-packs/support/KnowledgeBase/Known issues.md +9 -0
  721. package/starter-packs/support/KnowledgeBase/Products.md +9 -0
  722. package/starter-packs/support/KnowledgeBase/Tone of voice.md +9 -0
  723. package/starter-packs/support/Plugins/support-starter/LICENSE +202 -0
  724. package/starter-packs/support/Plugins/support-starter/SOURCE.md +10 -0
  725. package/starter-packs/support/Plugins/support-starter/access.md +19 -0
  726. package/starter-packs/support/Plugins/support-starter/plugin.json +10 -0
  727. package/starter-packs/support/Plugins/support-starter/skills/customer-escalation/SKILL.md +246 -0
  728. package/starter-packs/support/Plugins/support-starter/skills/customer-research/SKILL.md +250 -0
  729. package/starter-packs/support/Plugins/support-starter/skills/draft-response/SKILL.md +416 -0
  730. package/starter-packs/support/Plugins/support-starter/skills/kb-article/SKILL.md +350 -0
  731. package/starter-packs/support/Plugins/support-starter/skills/ticket-triage/SKILL.md +273 -0
  732. package/starter-packs/support/pack.yaml +12 -0
  733. package/kb-template/AGENTS.md +0 -730
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed.service.js","sourceRoot":"","sources":["../../../src/modules/embed/embed.service.ts"],"names":[],"mappings":"AAAA,OAAO,EA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C,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { Router, RequestHandler } from 'express';
2
+ import type { IToolRegistry } from '../tool-registry/tool.contract.js';
3
+ import type { ToolHandlerFactory } from '../tool-helpers/tool-handler.js';
4
+ import type { KbContext } from '../../shared/kb-context.js';
5
+ import type { ReadForTool } from '../workspace/workspace.tools.js';
6
+ import type { IEmbedService } from './embed.interface.js';
7
+ import { type ToolDescriptionNotes } from '../workspace/agent-access.gate.js';
8
+ /** The tool name, in one place: the app manifest keys its view by it. */
9
+ export declare const OPEN_PAGE_TOOL = "open_page";
10
+ /** What `open_page` answers when the deployment cannot be framed. */
11
+ export declare const HTTP_DEPLOYMENT_NOTE: string;
12
+ /** What a path outside the knowledge base is told. */
13
+ export declare const OUTSIDE_REPO: (kbDirName: string) => string;
14
+ export interface EmbedToolsDeps {
15
+ embedService: IEmbedService;
16
+ kb: KbContext;
17
+ /** `read_file`'s own read — see {@link ReadForTool}. */
18
+ readForTool: ReadForTool;
19
+ /** Whether a chat host's sandbox can load from this deployment's public address at all (https). */
20
+ canBeReached: () => boolean;
21
+ /** The file's address in the app, for the answer and for the view's fallback link. */
22
+ appUrlFor: (repoRelative: string, slug?: string) => string;
23
+ /** The notes a deployment registers for the gated tools — `read_file`'s, and so this tool's. */
24
+ notes: ToolDescriptionNotes;
25
+ }
26
+ /**
27
+ * `open_page`: the knowledge-base page, in the chat.
28
+ *
29
+ * The tool answers the file's TEXT exactly as `read_file` does — the same
30
+ * read hook, the same access gate, the same refusals — and adds the address
31
+ * of an embedded view that renders the page with the app's own renderer, so a
32
+ * host that supports MCP Apps shows it inline and lets the reader edit it or
33
+ * propose a change. A host that does not support them shows the text and the
34
+ * app address, and nothing errors: the answer stands on its own.
35
+ *
36
+ * `read_file` is deliberately untouched (Decision 2). Carrying a view on it
37
+ * would mint a token and render an iframe on every read an agent makes, for
38
+ * every file it reads while thinking.
39
+ *
40
+ * No `branch` argument, by decision: the embedded view is editable, and an
41
+ * editable embed targets the default branch only. The branch it rendered
42
+ * comes back in the answer so nothing is implied.
43
+ */
44
+ export declare function registerEmbedTools(registry: IToolRegistry, router: Router, toolAuth: RequestHandler, toolHandler: ToolHandlerFactory, deps: EmbedToolsDeps): void;
45
+ /**
46
+ * `path` as a repo-relative path, or null when it names nothing inside the
47
+ * knowledge base. Accepts it with or without the `<kbDir>/` prefix and with
48
+ * or without a leading slash, which is what `read_file` documents.
49
+ */
50
+ export declare function toRepoRelative(path: string, kbDirName: string): string | null;
51
+ //# sourceMappingURL=embed.tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed.tools.d.ts","sourceRoot":"","sources":["../../../src/modules/embed/embed.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGhG,yEAAyE;AACzE,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,QAGP,CAAC;AAE3B,sDAAsD;AACtD,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,KAAG,MACiD,CAAC;AAEnG,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,aAAa,CAAC;IAC5B,EAAE,EAAE,SAAS,CAAC;IACd,wDAAwD;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,mGAAmG;IACnG,YAAY,EAAE,MAAM,OAAO,CAAC;IAC5B,sFAAsF;IACtF,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3D,gGAAgG;IAChG,KAAK,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,kBAAkB,EAC/B,IAAI,EAAE,cAAc,GACnB,IAAI,CAwHN;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAe7E"}
@@ -0,0 +1,170 @@
1
+ import { ToolError } from '../tool-helpers/tool.contract.js';
2
+ import { toolDef } from '../tool-helpers/tool-def.js';
3
+ import { requireExternalSource } from '../tool-auth/tool-auth.middleware.js';
4
+ import { SESSION_ID_INPUT } from '../workspace/agent-access.gate.js';
5
+ import { sessionIdInputOf } from '../workspace/workspace.tools.js';
6
+ /** The tool name, in one place: the app manifest keys its view by it. */
7
+ export const OPEN_PAGE_TOOL = 'open_page';
8
+ /** What `open_page` answers when the deployment cannot be framed. */
9
+ export const HTTP_DEPLOYMENT_NOTE = 'This deployment is reached over plain http, so no chat host can show the page inline — ' +
10
+ 'an embedded view needs an https deployment. The page is above, and its address in the app ' +
11
+ 'opens the whole thing.';
12
+ /** What a path outside the knowledge base is told. */
13
+ export const OUTSIDE_REPO = (kbDirName) => `open_page shows a knowledge-base page, so \`path\` has to name a file under \`${kbDirName}/\`.`;
14
+ /**
15
+ * `open_page`: the knowledge-base page, in the chat.
16
+ *
17
+ * The tool answers the file's TEXT exactly as `read_file` does — the same
18
+ * read hook, the same access gate, the same refusals — and adds the address
19
+ * of an embedded view that renders the page with the app's own renderer, so a
20
+ * host that supports MCP Apps shows it inline and lets the reader edit it or
21
+ * propose a change. A host that does not support them shows the text and the
22
+ * app address, and nothing errors: the answer stands on its own.
23
+ *
24
+ * `read_file` is deliberately untouched (Decision 2). Carrying a view on it
25
+ * would mint a token and render an iframe on every read an agent makes, for
26
+ * every file it reads while thinking.
27
+ *
28
+ * No `branch` argument, by decision: the embedded view is editable, and an
29
+ * editable embed targets the default branch only. The branch it rendered
30
+ * comes back in the answer so nothing is implied.
31
+ */
32
+ export function registerEmbedTools(registry, router, toolAuth, toolHandler, deps) {
33
+ const { kbDirName } = deps.kb;
34
+ const DESCRIPTION = 'Show a knowledge-base page to the person you are talking to, rendered inside this chat. ' +
35
+ 'Returns the same `{ path, content }` `read_file` returns — the page as text, for you to read — ' +
36
+ 'plus `embedUrl` (the view the chat renders), `appUrl` (the page in the app), and `branch` ' +
37
+ "(always the default branch). The rendered view uses the app's own renderer for the file's type, " +
38
+ 'and offers the reader Edit when they may write the page and Propose changes when they may not, ' +
39
+ 'as that same person — not as you. Use it when somebody wants to SEE or FIX a page; use `read_file` ' +
40
+ 'when you only need to read one yourself. A chat host that cannot render a view shows the text, ' +
41
+ 'so calling this is never worse than reading.';
42
+ const def = toolDef({
43
+ name: OPEN_PAGE_TOOL,
44
+ description: DESCRIPTION + deps.notes.gatedToolNote(),
45
+ path: `/api/agent/tools/${OPEN_PAGE_TOOL}`,
46
+ inputs: {
47
+ type: 'object',
48
+ properties: {
49
+ path: {
50
+ type: 'string',
51
+ minLength: 1,
52
+ description: `Path of the page to show, under \`${kbDirName}/\` (e.g. \`${kbDirName}/KnowledgeBase/Foo.md\`), ` +
53
+ 'with or without a leading slash — a path without that prefix is placed under ' +
54
+ `\`${kbDirName}/\`. The page is always shown from the default branch.`,
55
+ },
56
+ heading: {
57
+ type: 'string',
58
+ description: 'Optional: the anchor slug of one heading (e.g. `problem-statement`) the view should open at. ' +
59
+ 'The whole page is shown either way — this only says where to start reading.',
60
+ },
61
+ // As `read_file` takes it: the read is `read_file`'s own, and a
62
+ // deployment whose read hook wants the session must be able to get it.
63
+ sessionId: SESSION_ID_INPUT,
64
+ },
65
+ required: ['path'],
66
+ additionalProperties: false,
67
+ },
68
+ outputs: {
69
+ type: 'object',
70
+ properties: {
71
+ path: { type: 'string', description: 'The path that was shown (echoes the input).' },
72
+ content: { type: 'string', description: "The page's text, exactly as `read_file` answers it." },
73
+ embedUrl: {
74
+ type: 'string',
75
+ description: 'The address of the view the chat renders. Absent when this deployment cannot be framed — ' +
76
+ 'see `note`.',
77
+ },
78
+ appUrl: { type: 'string', description: "The page's address in the app." },
79
+ branch: { type: 'string', description: 'The branch the page was rendered from — the default branch.' },
80
+ note: {
81
+ type: 'string',
82
+ description: 'Present only when there is no `embedUrl`: why there is no embedded view.',
83
+ },
84
+ },
85
+ required: ['path', 'content', 'appUrl', 'branch'],
86
+ },
87
+ tags: ['workspace'],
88
+ });
89
+ // EXTERNAL only. The view exists for a chat somewhere else; the in-app
90
+ // agent's reader is already looking at the app, where every page is a
91
+ // click away — handing it an iframe of the page it is standing on would be
92
+ // a tool that cannot help.
93
+ registry.registerExternalTool(def);
94
+ // The read is `read_file`'s own, so what the agent reads about it is too:
95
+ // the note a deployment registers for the gated tools, and the `sessionId`
96
+ // description with its note — applied now and on every later registration,
97
+ // exactly as the file tools apply them (`sessionIdInputOf` is theirs).
98
+ const redescribe = () => {
99
+ def.description = DESCRIPTION + deps.notes.gatedToolNote();
100
+ const sessionId = sessionIdInputOf(def);
101
+ if (sessionId)
102
+ sessionId.description = deps.notes.sessionIdDescription();
103
+ };
104
+ redescribe();
105
+ deps.notes.onChange(redescribe);
106
+ router.post(`/agent/tools/${OPEN_PAGE_TOOL}`, toolAuth,
107
+ // Registered external-only above; the route holds the same line, so an
108
+ // in-process agent that guessed the endpoint is refused here too.
109
+ requireExternalSource, toolHandler(async (args, ctx) => {
110
+ const raw = typeof args.path === 'string' ? args.path.trim() : '';
111
+ if (!raw)
112
+ throw new ToolError('`path` is required.', 400);
113
+ const heading = typeof args.heading === 'string' && args.heading.trim() ? args.heading.trim() : undefined;
114
+ const repoRelative = toRepoRelative(raw, kbDirName);
115
+ if (repoRelative === null)
116
+ throw new ToolError(OUTSIDE_REPO(kbDirName), 400);
117
+ const branch = deps.kb.defaultBranch;
118
+ const wsPath = `${kbDirName}/${repoRelative}`;
119
+ // The read comes FIRST, and it is `read_file`'s own: a path the caller
120
+ // may not read, or one that is not there, is refused here in the words
121
+ // `read_file` refuses it — and no token is minted, because the mint is
122
+ // below this line.
123
+ const result = await deps.readForTool(branch, wsPath, ctx);
124
+ const content = result.kind === 'text' ? result.text : result.kind === 'image' ? result.note : result.message;
125
+ const appUrl = deps.appUrlFor(repoRelative, heading);
126
+ // No view on a plain-http deployment (Decision 8): a host's https
127
+ // sandbox cannot load from it. The text and the app address are still
128
+ // the answer, and the tool says why there is no view rather than
129
+ // handing back an address no host can open.
130
+ if (!deps.canBeReached()) {
131
+ return { path: raw, content, appUrl, branch, note: HTTP_DEPLOYMENT_NOTE };
132
+ }
133
+ // Minted for the identity THIS MCP session authenticated — the
134
+ // signed-in user, or the owner of the connection key the agent carries.
135
+ // Whoever is in the chat therefore sees and may change exactly what
136
+ // that person may, and the audit log attributes it to them.
137
+ const { embedUrl } = await deps.embedService.mintForUser({
138
+ userId: ctx.user.id,
139
+ reference: heading ? `${repoRelative}#${heading}` : repoRelative,
140
+ });
141
+ return { path: raw, content, embedUrl, appUrl, branch };
142
+ }));
143
+ }
144
+ /**
145
+ * `path` as a repo-relative path, or null when it names nothing inside the
146
+ * knowledge base. Accepts it with or without the `<kbDir>/` prefix and with
147
+ * or without a leading slash, which is what `read_file` documents.
148
+ */
149
+ export function toRepoRelative(path, kbDirName) {
150
+ // A backslash is refused, not read as a separator — `read_file`'s contract,
151
+ // and a token must never name a file other than the one the caller wrote.
152
+ if (path.includes('\\'))
153
+ return null;
154
+ const norm = path.replace(/^\.?\/+/, '').replace(/\/+$/, '');
155
+ if (!norm)
156
+ return null;
157
+ const rel = norm === kbDirName ? '' : norm.startsWith(`${kbDirName}/`) ? norm.slice(kbDirName.length + 1) : norm;
158
+ if (!rel)
159
+ return null;
160
+ // Traversal and the odd segment are refused HERE rather than deeper: the
161
+ // path is about to become part of a signed token, and a token is the one
162
+ // place a bad path would outlive the request that sent it.
163
+ // eslint-disable-next-line no-control-regex
164
+ if (/[\x00-\x1f\x7f]/.test(rel))
165
+ return null;
166
+ if (!rel.split('/').every((seg) => seg !== '' && seg !== '.' && seg !== '..'))
167
+ return null;
168
+ return rel;
169
+ }
170
+ //# sourceMappingURL=embed.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed.tools.js","sourceRoot":"","sources":["../../../src/modules/embed/embed.tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAMtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAA6B,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAC/B,yFAAyF;IACzF,4FAA4F;IAC5F,wBAAwB,CAAC;AAE3B,sDAAsD;AACtD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAU,EAAE,CACxD,iFAAiF,SAAS,MAAM,CAAC;AAenG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAuB,EACvB,MAAc,EACd,QAAwB,EACxB,WAA+B,EAC/B,IAAoB;IAEpB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9B,MAAM,WAAW,GACf,0FAA0F;QAC1F,iGAAiG;QACjG,4FAA4F;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ACb,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { type McpAppManifest, type McpAppResource } from '@bevel-software/platform-mcp-core';
2
+ /**
3
+ * The `ui://` URI of the one view this deployment serves, NAMED BY ITS
4
+ * CONTENT: `ui://hexis/page-<hash>.html`, the hash being the view's own
5
+ * bytes.
6
+ *
7
+ * A host caches a view by its URI, and a changed view under an unchanged
8
+ * URI is served stale until the host happens to refetch — which is what
9
+ * Claude did after the view was rewritten (#391): it kept rendering the
10
+ * view it had cached, the one that goes blank. With the content in the
11
+ * name, every change to the view is a new URI, so no host can keep serving
12
+ * the old one. The prefix is stable so a reader can still tell what the
13
+ * resource is.
14
+ */
15
+ export declare const OPEN_PAGE_VIEW_URI_PREFIX = "ui://hexis/page-";
16
+ /** The URI the view with these bytes is served under. */
17
+ export declare function openPageViewUri(text: string): string;
18
+ /** The MCP App views a deployment serves — the port the MCP endpoint, the manifest route and the catalog revision consume. */
19
+ export interface IMcpAppService {
20
+ /** The manifest: which tools carry a view, and the views themselves. */
21
+ manifest(): Promise<McpAppManifest>;
22
+ /** One view by its `ui://` address, or null when this deployment serves none at it. */
23
+ resource(uri: string): Promise<McpAppResource | null>;
24
+ }
25
+ /**
26
+ * The deployment's MCP Apps, built once per process: which tools carry a
27
+ * view, and the views themselves with the sandbox metadata the host needs.
28
+ *
29
+ * Read once and cached — the file ships with the package and cannot change
30
+ * under a running process, and `resources/read` is on the handshake path of
31
+ * every connection that renders a page.
32
+ */
33
+ export declare class McpAppService implements IMcpAppService {
34
+ private readonly config;
35
+ private cached;
36
+ constructor(config: {
37
+ /** The deployment's public frontend address — the ONE origin the view may reach. */
38
+ readonly publicFrontendUrl: string;
39
+ /** Where the view's file lives. The packaged `mcp-app/` folder unless a test says otherwise. */
40
+ readonly viewDir?: string;
41
+ });
42
+ /** Every app this deployment serves. Empty only if the packaged view is unreadable. */
43
+ manifest(): Promise<McpAppManifest>;
44
+ /** One view by URI, or null when this deployment serves none under it. */
45
+ resource(uri: string): Promise<McpAppResource | null>;
46
+ private build;
47
+ }
48
+ /**
49
+ * `url`'s origin, or null when it does not parse. Only the origin: a
50
+ * `connectDomains` / `resourceDomains` entry is an origin, and a path or a
51
+ * credential in one is either ignored or rejected by the host.
52
+ */
53
+ export declare function originOf(url: string): string | null;
54
+ /**
55
+ * Whether a public address can be reached from inside a host's sandbox at all.
56
+ *
57
+ * Hosts run an MCP App's view in a sandboxed, https iframe, and no browser
58
+ * will let an https document load scripts from, or fetch from, a plain-http
59
+ * origin. So a deployment reached over http has no embedded view —
60
+ * `open_page` still answers the page's text and its address in the app, and
61
+ * says why there is nothing rendered (see Decision 8).
62
+ */
63
+ export declare function isSandboxReachableOrigin(url: string): boolean;
64
+ //# sourceMappingURL=mcp-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-app.d.ts","sourceRoot":"","sources":["../../../src/modules/embed/mcp-app.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mCAAmC,CAAC;AAO3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAKD,8HAA8H;AAC9H,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,uFAAuF;IACvF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CACvD;AAED;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,cAAc;IAIhD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHzB,OAAO,CAAC,MAAM,CAAwC;gBAGnC,MAAM,EAAE;QACvB,oFAAoF;QACpF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;QACnC,gGAAgG;QAChG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;KAC3B;IAGH,uFAAuF;IACvF,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAInC,0EAA0E;IACpE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;YAK7C,KAAK;CA+DpB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAM7D"}
@@ -0,0 +1,147 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFile } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { MCP_APP_MIME_TYPE, } from '@bevel-software/platform-mcp-core';
5
+ import { mcpAppDir } from '../../assets.js';
6
+ import { logger } from '../../shared/logging.js';
7
+ import { OPEN_PAGE_TOOL } from './embed.tools.js';
8
+ const log = logger('embed');
9
+ /**
10
+ * The `ui://` URI of the one view this deployment serves, NAMED BY ITS
11
+ * CONTENT: `ui://hexis/page-<hash>.html`, the hash being the view's own
12
+ * bytes.
13
+ *
14
+ * A host caches a view by its URI, and a changed view under an unchanged
15
+ * URI is served stale until the host happens to refetch — which is what
16
+ * Claude did after the view was rewritten (#391): it kept rendering the
17
+ * view it had cached, the one that goes blank. With the content in the
18
+ * name, every change to the view is a new URI, so no host can keep serving
19
+ * the old one. The prefix is stable so a reader can still tell what the
20
+ * resource is.
21
+ */
22
+ export const OPEN_PAGE_VIEW_URI_PREFIX = 'ui://hexis/page-';
23
+ /** The URI the view with these bytes is served under. */
24
+ export function openPageViewUri(text) {
25
+ return `${OPEN_PAGE_VIEW_URI_PREFIX}${createHash('sha256').update(text).digest('hex').slice(0, 12)}.html`;
26
+ }
27
+ /** The view's file inside the packaged `mcp-app/` folder. */
28
+ const OPEN_PAGE_VIEW_FILE = 'page.html';
29
+ /**
30
+ * The deployment's MCP Apps, built once per process: which tools carry a
31
+ * view, and the views themselves with the sandbox metadata the host needs.
32
+ *
33
+ * Read once and cached — the file ships with the package and cannot change
34
+ * under a running process, and `resources/read` is on the handshake path of
35
+ * every connection that renders a page.
36
+ */
37
+ export class McpAppService {
38
+ config;
39
+ cached = null;
40
+ constructor(config) {
41
+ this.config = config;
42
+ }
43
+ /** Every app this deployment serves. Empty only if the packaged view is unreadable. */
44
+ manifest() {
45
+ return (this.cached ??= this.build());
46
+ }
47
+ /** One view by URI, or null when this deployment serves none under it. */
48
+ async resource(uri) {
49
+ const { resources } = await this.manifest();
50
+ return resources.find((r) => r.uri === uri) ?? null;
51
+ }
52
+ async build() {
53
+ const file = path.join(this.config.viewDir ?? mcpAppDir(), OPEN_PAGE_VIEW_FILE);
54
+ let text;
55
+ try {
56
+ text = await readFile(file, 'utf8');
57
+ }
58
+ catch (err) {
59
+ // No view, no app. Advertising a `resourceUri` whose resource cannot be
60
+ // read would have a host preload a failure and show an empty frame
61
+ // where the tool's text used to be; with no manifest `open_page` is an
62
+ // ordinary tool answering ordinary text, which is the graceful shape.
63
+ log.error(`could not read the MCP App view at ${file}; ` +
64
+ `open_page will carry no view: ${err instanceof Error ? err.message : String(err)}`);
65
+ return { tools: {}, resources: [] };
66
+ }
67
+ const origin = originOf(this.config.publicFrontendUrl);
68
+ const uri = openPageViewUri(text);
69
+ return {
70
+ tools: { [OPEN_PAGE_TOOL]: { resourceUri: uri } },
71
+ resources: [
72
+ {
73
+ uri,
74
+ name: 'knowledge-base-page',
75
+ title: 'Knowledge base page',
76
+ description: "The knowledge-base page an agent opened, rendered by the app's own renderer for its type, " +
77
+ 'with Edit for a writer and Propose changes for everybody else.',
78
+ mimeType: MCP_APP_MIME_TYPE,
79
+ text,
80
+ ui: {
81
+ // EXACTLY this deployment's own public origin, and nothing else,
82
+ // for the two things the view asks of the host's sandbox:
83
+ // FETCHING the build manifest and the token-only embed API
84
+ // (`connectDomains`), and LOADING the embed bundle's scripts and
85
+ // stylesheets and the bytes the renderers draw
86
+ // (`resourceDomains`). No `frameDomains`: the view frames
87
+ // nothing. Claude's host drops that field and pins the sandbox's
88
+ // `frame-src` to `'self'`, which turned a framed `/embed` into a
89
+ // blank box — so the view loads the deployment's embed bundle
90
+ // into its own document instead. A knowledge-base HTML page
91
+ // still renders through the renderer's `srcdoc` sandbox, which
92
+ // that policy allows.
93
+ csp: {
94
+ connectDomains: origin ? [origin] : [],
95
+ resourceDomains: origin ? [origin] : [],
96
+ },
97
+ // Deliberately NO `domain`. The field asks the host for a
98
+ // dedicated sandbox origin, and the specification leaves its
99
+ // format and validation to each host ("servers MUST consult
100
+ // host-specific documentation") — a value one host accepts,
101
+ // another may reject, and a rejected resource is a view that
102
+ // never renders. This view keeps no storage and has no OAuth
103
+ // callback, so it needs no stable origin of its own; the host's
104
+ // default sandbox is the right one.
105
+ // The framed page draws its own surface; a second border around
106
+ // it reads as a box inside a box.
107
+ prefersBorder: false,
108
+ },
109
+ },
110
+ ],
111
+ };
112
+ }
113
+ }
114
+ /**
115
+ * `url`'s origin, or null when it does not parse. Only the origin: a
116
+ * `connectDomains` / `resourceDomains` entry is an origin, and a path or a
117
+ * credential in one is either ignored or rejected by the host.
118
+ */
119
+ export function originOf(url) {
120
+ try {
121
+ const origin = new URL(url).origin;
122
+ // An address that parses but has no web origin (`file:`, `data:`) is
123
+ // serialised as the literal "null" — not an origin a host's CSP can name.
124
+ return origin === 'null' ? null : origin;
125
+ }
126
+ catch {
127
+ return null;
128
+ }
129
+ }
130
+ /**
131
+ * Whether a public address can be reached from inside a host's sandbox at all.
132
+ *
133
+ * Hosts run an MCP App's view in a sandboxed, https iframe, and no browser
134
+ * will let an https document load scripts from, or fetch from, a plain-http
135
+ * origin. So a deployment reached over http has no embedded view —
136
+ * `open_page` still answers the page's text and its address in the app, and
137
+ * says why there is nothing rendered (see Decision 8).
138
+ */
139
+ export function isSandboxReachableOrigin(url) {
140
+ try {
141
+ return new URL(url).protocol === 'https:';
142
+ }
143
+ catch {
144
+ return false;
145
+ }
146
+ }
147
+ //# sourceMappingURL=mcp-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-app.js","sourceRoot":"","sources":["../../../src/modules/embed/mcp-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,iBAAiB,GAGlB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAE5D,yDAAyD;AACzD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,GAAG,yBAAyB,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC;AAC5G,CAAC;AAED,6DAA6D;AAC7D,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAUxC;;;;;;;GAOG;AACH,MAAM,OAAO,aAAa;IAIL;IAHX,MAAM,GAAmC,IAAI,CAAC;IAEtD,YACmB,MAKhB;QALgB,WAAM,GAAN,MAAM,CAKtB;IACA,CAAC;IAEJ,uFAAuF;IACvF,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,QAAQ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@
1
+ import express, { type RequestHandler } from 'express';
2
+ import type { McpAppManifest } from '@bevel-software/platform-mcp-core';
3
+ /**
4
+ * The deployment's MCP Apps over REST, for the LOCAL MCP server.
5
+ *
6
+ * `hexis-mcp` bridges a host to this deployment over HTTP: it discovers the
7
+ * tools as a UTCP manual, which has nowhere to carry a view, and it serves
8
+ * `resources/read` itself. So it needs the manifest — which tools carry a
9
+ * view, and the view's HTML and sandbox metadata — as data. One route, one
10
+ * answer, so the local server advertises the same apps the hosted endpoint
11
+ * does without knowing what any of them render.
12
+ *
13
+ * `manualAuth` for the same reason `all-tools` and `catalog-revision` use it:
14
+ * this is the agent surface, reached with a connection key or an exchanged
15
+ * grant. Nothing here is per-caller — every connection gets the same view —
16
+ * so the credential is a door, not a filter.
17
+ */
18
+ export declare function createMcpAppRoutes(apps: {
19
+ manifest(): Promise<McpAppManifest>;
20
+ }, manualAuth: RequestHandler): express.Router;
21
+ //# sourceMappingURL=mcp-app.routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-app.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/embed/mcp-app.routes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE;IAAE,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC,CAAA;CAAE,EAC7C,UAAU,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAmBhB"}
@@ -0,0 +1,36 @@
1
+ import express from 'express';
2
+ /**
3
+ * The deployment's MCP Apps over REST, for the LOCAL MCP server.
4
+ *
5
+ * `hexis-mcp` bridges a host to this deployment over HTTP: it discovers the
6
+ * tools as a UTCP manual, which has nowhere to carry a view, and it serves
7
+ * `resources/read` itself. So it needs the manifest — which tools carry a
8
+ * view, and the view's HTML and sandbox metadata — as data. One route, one
9
+ * answer, so the local server advertises the same apps the hosted endpoint
10
+ * does without knowing what any of them render.
11
+ *
12
+ * `manualAuth` for the same reason `all-tools` and `catalog-revision` use it:
13
+ * this is the agent surface, reached with a connection key or an exchanged
14
+ * grant. Nothing here is per-caller — every connection gets the same view —
15
+ * so the credential is a door, not a filter.
16
+ */
17
+ export function createMcpAppRoutes(apps, manualAuth) {
18
+ const router = express.Router();
19
+ router.get('/agent/mcp-app', manualAuth, async (_req, res) => {
20
+ try {
21
+ const manifest = await apps.manifest();
22
+ // The view's HTML rides the manifest rather than sitting behind a
23
+ // second round trip per resource: it is one small static file, the
24
+ // local server needs all of it before it can declare the capability at
25
+ // all, and a second fetch is a second thing that can half-fail.
26
+ res.setHeader('Cache-Control', 'no-store');
27
+ res.json(manifest);
28
+ }
29
+ catch (err) {
30
+ console.error('[embed] could not build the MCP App manifest:', err);
31
+ res.status(500).json({ error: 'Something went wrong.' });
32
+ }
33
+ });
34
+ return router;
35
+ }
36
+ //# sourceMappingURL=mcp-app.routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-app.routes.js","sourceRoot":"","sources":["../../../src/modules/embed/mcp-app.routes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAgC,MAAM,SAAS,CAAC;AAGvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAA6C,EAC7C,UAA0B;IAE1B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAC3D,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACvC,kEAAkE;YAClE,mEAAmE;YACnE,uEAAuE;YACvE,gEAAgE;YAChE,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;YAC3C,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,CAAC,CAAC;YACpE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -44,6 +44,13 @@ export declare class GitHubAppConnection implements GitHubAppRepository {
44
44
  private renewing;
45
45
  /** The last renewal failed: how many in a row have, and until when GitHub is not asked again. */
46
46
  private failed;
47
+ /**
48
+ * The settings that were empty the last time no token could be asked for,
49
+ * so the log says so ONCE per state and not before every git call. A
50
+ * deployment in this state used to run for hours with every push failing
51
+ * and nothing in the log naming the cause.
52
+ */
53
+ private saidUnaskable;
47
54
  constructor(opts: GitHubAppConnectionOptions);
48
55
  /** The app the deployment acts as, or null while any part of it is missing. */
49
56
  credentials(read?: SettingReader): GitHubAppCredentials | null;
@@ -80,9 +87,17 @@ export declare class GitHubAppConnection implements GitHubAppRepository {
80
87
  * `asked` is for an admin waiting on the answer itself (the setup screen
81
88
  * listing repositories, proving a connection): GitHub is asked whatever
82
89
  * is remembered, and the failure is thrown.
90
+ *
91
+ * `refused` is the git runner reporting that the host threw out the token
92
+ * in hand. However much time the clock gives it, that token is dead: it is
93
+ * dropped first, so nothing presents it again, and GitHub is asked for
94
+ * another the way `asked` asks — now, and with the failure thrown. A
95
+ * renewal that fails leaves NO token, which is what tells the runner not
96
+ * to run the command again with the one the host just refused.
83
97
  */
84
98
  prepare(opts?: {
85
99
  asked?: boolean;
100
+ refused?: boolean;
86
101
  }): Promise<void>;
87
102
  /**
88
103
  * The repositories the deployment may be pointed at: those the
@@ -1 +1 @@
1
- {"version":3,"file":"github-app.connection.d.ts","sourceRo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AAI,GAAE,aAA8B,GAAG,OAAO;IAIvD;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,aAA8B,GAAG,OAAO;IAU1E,KAAK,IAAI,MAAM,GAAG,IAAI;IAMtB;;;;;;;;;;;;;;;;;OAiBG;IACG,OAAO,CAAC,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB5D;;;;;OAKG;IACG,YAAY,IAAI,OAAO,CAAC;QAAE,YAAY,EAAE,sBAAsB,EAAE,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;IAQxF,yFAAyF;IACzF,MAAM,IAAI,IAAI;YAKA,KAAK;IAmBnB,OAAO,CAAC,MAAM;CAGf"}
1
+ {"version":3,"file":"github-app.connection.d.ts","sourceRoot":"","sources":["../../../src/modules/github-app/github-app.connection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAQhC,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D;AAED,MAAM,WAAW,0BAA0B;IACzC,wDAAwD;IACxD,IAAI,EAAE,aAAa,CAAC;IACpB,6GAA6G;IAC7G,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAClD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,mBAAoB,YAAW,mBAAmB;IAkBjD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAjBjC,OAAO,CAAC,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