@shepai/cli 1.180.0-pr548.764147 → 1.181.0-pr512.ba01d33

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 (402) hide show
  1. package/apis/json-schema/MessagingCommand.yaml +28 -0
  2. package/apis/json-schema/MessagingCommandType.yaml +17 -0
  3. package/apis/json-schema/MessagingConfig.yaml +40 -0
  4. package/apis/json-schema/MessagingFrameType.yaml +8 -0
  5. package/apis/json-schema/MessagingNotification.yaml +22 -0
  6. package/apis/json-schema/MessagingPlatform.yaml +7 -0
  7. package/apis/json-schema/MessagingPlatformConfig.yaml +38 -0
  8. package/apis/json-schema/Settings.yaml +3 -0
  9. package/dist/packages/core/src/application/ports/output/services/gateway-client.interface.d.ts +58 -0
  10. package/dist/packages/core/src/application/ports/output/services/gateway-client.interface.d.ts.map +1 -0
  11. package/dist/packages/core/src/application/ports/output/services/gateway-client.interface.js +10 -0
  12. package/dist/packages/core/src/application/ports/output/services/message-sender.interface.d.ts +18 -0
  13. package/dist/packages/core/src/application/ports/output/services/message-sender.interface.d.ts.map +1 -0
  14. package/dist/packages/core/src/application/ports/output/services/message-sender.interface.js +9 -0
  15. package/dist/packages/core/src/application/ports/output/services/messaging-service.interface.d.ts +34 -0
  16. package/dist/packages/core/src/application/ports/output/services/messaging-service.interface.d.ts.map +1 -0
  17. package/dist/packages/core/src/application/ports/output/services/messaging-service.interface.js +12 -0
  18. package/dist/packages/core/src/application/ports/output/services/telegram-client.interface.d.ts +19 -0
  19. package/dist/packages/core/src/application/ports/output/services/telegram-client.interface.d.ts.map +1 -0
  20. package/dist/packages/core/src/application/ports/output/services/telegram-client.interface.js +8 -0
  21. package/dist/packages/core/src/application/use-cases/messaging/begin-pairing.use-case.d.ts +46 -0
  22. package/dist/packages/core/src/application/use-cases/messaging/begin-pairing.use-case.d.ts.map +1 -0
  23. package/dist/packages/core/src/application/use-cases/messaging/begin-pairing.use-case.js +148 -0
  24. package/dist/packages/core/src/application/use-cases/messaging/confirm-pairing.use-case.d.ts +19 -0
  25. package/dist/packages/core/src/application/use-cases/messaging/confirm-pairing.use-case.d.ts.map +1 -0
  26. package/dist/packages/core/src/application/use-cases/messaging/confirm-pairing.use-case.js +63 -0
  27. package/dist/packages/core/src/application/use-cases/messaging/disconnect-messaging.use-case.d.ts +19 -0
  28. package/dist/packages/core/src/application/use-cases/messaging/disconnect-messaging.use-case.d.ts.map +1 -0
  29. package/dist/packages/core/src/application/use-cases/messaging/disconnect-messaging.use-case.js +65 -0
  30. package/dist/packages/core/src/domain/generated/output.d.ts +155 -0
  31. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  32. package/dist/packages/core/src/domain/generated/output.js +26 -0
  33. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  34. package/dist/packages/core/src/infrastructure/di/container.js +117 -0
  35. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +24 -0
  36. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  37. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +117 -0
  38. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-messaging-remote-control.d.ts +22 -0
  39. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-messaging-remote-control.d.ts.map +1 -0
  40. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-messaging-remote-control.js +62 -0
  41. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  42. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +43 -3
  43. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
  44. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +1 -4
  45. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  46. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +6 -11
  47. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.d.ts +2 -2
  48. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.d.ts.map +1 -1
  49. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.js +2 -2
  50. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  51. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +2 -3
  52. package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts +5 -16
  53. package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts.map +1 -1
  54. package/dist/packages/core/src/infrastructure/services/git/pr-branding.js +7 -38
  55. package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.d.ts +45 -0
  56. package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.d.ts.map +1 -0
  57. package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.js +100 -0
  58. package/dist/packages/core/src/infrastructure/services/messaging/command-executor.d.ts +53 -0
  59. package/dist/packages/core/src/infrastructure/services/messaging/command-executor.d.ts.map +1 -0
  60. package/dist/packages/core/src/infrastructure/services/messaging/command-executor.js +200 -0
  61. package/dist/packages/core/src/infrastructure/services/messaging/content-sanitizer.d.ts +23 -0
  62. package/dist/packages/core/src/infrastructure/services/messaging/content-sanitizer.d.ts.map +1 -0
  63. package/dist/packages/core/src/infrastructure/services/messaging/content-sanitizer.js +39 -0
  64. package/dist/packages/core/src/infrastructure/services/messaging/http-gateway.client.d.ts +19 -0
  65. package/dist/packages/core/src/infrastructure/services/messaging/http-gateway.client.d.ts.map +1 -0
  66. package/dist/packages/core/src/infrastructure/services/messaging/http-gateway.client.js +124 -0
  67. package/dist/packages/core/src/infrastructure/services/messaging/http-telegram.client.d.ts +18 -0
  68. package/dist/packages/core/src/infrastructure/services/messaging/http-telegram.client.d.ts.map +1 -0
  69. package/dist/packages/core/src/infrastructure/services/messaging/http-telegram.client.js +60 -0
  70. package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts +68 -0
  71. package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts.map +1 -0
  72. package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.js +262 -0
  73. package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.d.ts +78 -0
  74. package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.d.ts.map +1 -0
  75. package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.js +279 -0
  76. package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.d.ts +33 -0
  77. package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.d.ts.map +1 -0
  78. package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.js +79 -0
  79. package/dist/packages/core/src/infrastructure/services/messaging/stub-gateway.client.d.ts +12 -0
  80. package/dist/packages/core/src/infrastructure/services/messaging/stub-gateway.client.d.ts.map +1 -0
  81. package/dist/packages/core/src/infrastructure/services/messaging/stub-gateway.client.js +26 -0
  82. package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.d.ts +26 -0
  83. package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.d.ts.map +1 -0
  84. package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.js +49 -0
  85. package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.d.ts +28 -0
  86. package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.d.ts.map +1 -0
  87. package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.js +45 -0
  88. package/dist/packages/core/src/infrastructure/services/messaging/tunnel-protocol.d.ts +102 -0
  89. package/dist/packages/core/src/infrastructure/services/messaging/tunnel-protocol.d.ts.map +1 -0
  90. package/dist/packages/core/src/infrastructure/services/messaging/tunnel-protocol.js +16 -0
  91. package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.d.ts +39 -0
  92. package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.d.ts.map +1 -0
  93. package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.js +56 -0
  94. package/dist/src/presentation/cli/commands/_serve.command.d.ts.map +1 -1
  95. package/dist/src/presentation/cli/commands/_serve.command.js +6 -0
  96. package/dist/src/presentation/cli/commands/app/del.command.d.ts +14 -0
  97. package/dist/src/presentation/cli/commands/app/del.command.d.ts.map +1 -0
  98. package/dist/src/presentation/cli/commands/app/del.command.js +58 -0
  99. package/dist/src/presentation/cli/commands/app/index.d.ts +20 -0
  100. package/dist/src/presentation/cli/commands/app/index.d.ts.map +1 -0
  101. package/dist/src/presentation/cli/commands/app/index.js +33 -0
  102. package/dist/src/presentation/cli/commands/app/ls.command.d.ts +11 -0
  103. package/dist/src/presentation/cli/commands/app/ls.command.d.ts.map +1 -0
  104. package/dist/src/presentation/cli/commands/app/ls.command.js +74 -0
  105. package/dist/src/presentation/cli/commands/app/new.command.d.ts +17 -0
  106. package/dist/src/presentation/cli/commands/app/new.command.d.ts.map +1 -0
  107. package/dist/src/presentation/cli/commands/app/new.command.js +58 -0
  108. package/dist/src/presentation/cli/commands/app/resolve-application.d.ts +10 -0
  109. package/dist/src/presentation/cli/commands/app/resolve-application.d.ts.map +1 -0
  110. package/dist/src/presentation/cli/commands/app/resolve-application.js +33 -0
  111. package/dist/src/presentation/cli/commands/app/show.command.d.ts +11 -0
  112. package/dist/src/presentation/cli/commands/app/show.command.d.ts.map +1 -0
  113. package/dist/src/presentation/cli/commands/app/show.command.js +95 -0
  114. package/dist/src/presentation/cli/commands/settings/index.d.ts.map +1 -1
  115. package/dist/src/presentation/cli/commands/settings/index.js +3 -1
  116. package/dist/src/presentation/cli/commands/settings/messaging.command.d.ts +17 -0
  117. package/dist/src/presentation/cli/commands/settings/messaging.command.d.ts.map +1 -0
  118. package/dist/src/presentation/cli/commands/settings/messaging.command.js +187 -0
  119. package/dist/src/presentation/cli/index.js +2 -0
  120. package/dist/src/presentation/web/app/actions/messaging.d.ts +29 -0
  121. package/dist/src/presentation/web/app/actions/messaging.d.ts.map +1 -0
  122. package/dist/src/presentation/web/app/actions/messaging.js +55 -0
  123. package/dist/src/presentation/web/components/features/settings/messaging-settings-section.d.ts +6 -0
  124. package/dist/src/presentation/web/components/features/settings/messaging-settings-section.d.ts.map +1 -0
  125. package/dist/src/presentation/web/components/features/settings/messaging-settings-section.js +206 -0
  126. package/dist/src/presentation/web/components/features/settings/messaging-settings-section.stories.d.ts +17 -0
  127. package/dist/src/presentation/web/components/features/settings/messaging-settings-section.stories.d.ts.map +1 -0
  128. package/dist/src/presentation/web/components/features/settings/messaging-settings-section.stories.js +55 -0
  129. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  130. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +9 -2
  131. package/dist/src/presentation/web/dev-server.js +27 -0
  132. package/dist/translations/ar/cli.json +63 -0
  133. package/dist/translations/ar/web.json +2 -1
  134. package/dist/translations/de/cli.json +63 -0
  135. package/dist/translations/de/web.json +2 -1
  136. package/dist/translations/en/cli.json +63 -0
  137. package/dist/translations/en/web.json +13 -12
  138. package/dist/translations/es/cli.json +63 -0
  139. package/dist/translations/es/web.json +2 -1
  140. package/dist/translations/fr/cli.json +63 -0
  141. package/dist/translations/fr/web.json +2 -1
  142. package/dist/translations/he/cli.json +63 -0
  143. package/dist/translations/he/web.json +2 -1
  144. package/dist/translations/pt/cli.json +63 -0
  145. package/dist/translations/pt/web.json +2 -1
  146. package/dist/translations/ru/cli.json +63 -0
  147. package/dist/translations/ru/web.json +2 -1
  148. package/dist/translations/uk/cli.json +63 -0
  149. package/dist/translations/uk/web.json +2 -1
  150. package/dist/tsconfig.build.tsbuildinfo +1 -1
  151. package/package.json +3 -1
  152. package/web/.next/BUILD_ID +1 -1
  153. package/web/.next/build-manifest.json +2 -2
  154. package/web/.next/fallback-build-manifest.json +2 -2
  155. package/web/.next/prerender-manifest.json +3 -3
  156. package/web/.next/required-server-files.js +2 -2
  157. package/web/.next/required-server-files.json +2 -2
  158. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +32 -32
  159. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  160. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  161. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +30 -30
  162. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  163. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  164. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +33 -33
  165. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  166. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  167. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +41 -41
  168. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  169. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  170. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +41 -41
  171. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  172. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  173. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +31 -31
  174. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  175. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  176. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +31 -31
  177. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  178. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  179. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +30 -30
  180. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  181. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  182. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +33 -33
  183. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  184. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  185. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +41 -41
  186. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  187. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  188. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +41 -41
  189. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  190. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  191. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +30 -30
  192. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  193. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  194. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +31 -31
  195. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  196. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  197. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +31 -31
  198. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  199. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  200. package/web/.next/server/app/_global-error.html +2 -2
  201. package/web/.next/server/app/_global-error.rsc +1 -1
  202. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  203. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  204. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  205. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  206. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  207. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
  208. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  209. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  210. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  211. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  212. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  213. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  214. package/web/.next/server/app/application/[id]/page/server-reference-manifest.json +15 -15
  215. package/web/.next/server/app/application/[id]/page.js.nft.json +1 -1
  216. package/web/.next/server/app/application/[id]/page_client-reference-manifest.js +1 -1
  217. package/web/.next/server/app/features/page/server-reference-manifest.json +7 -7
  218. package/web/.next/server/app/features/page.js.nft.json +1 -1
  219. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  220. package/web/.next/server/app/settings/page/server-reference-manifest.json +65 -20
  221. package/web/.next/server/app/settings/page.js +1 -1
  222. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  223. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  224. package/web/.next/server/app/skills/page/server-reference-manifest.json +15 -15
  225. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  226. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  227. package/web/.next/server/app/tools/page/server-reference-manifest.json +13 -13
  228. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  229. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  230. package/web/.next/server/app/version/page/server-reference-manifest.json +7 -7
  231. package/web/.next/server/app/version/page.js.nft.json +1 -1
  232. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  233. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  234. package/web/.next/server/chunks/[root-of-the-server]__b2a4bfcc._.js +1 -1
  235. package/web/.next/server/chunks/[root-of-the-server]__b2a4bfcc._.js.map +1 -1
  236. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
  237. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  238. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  239. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  240. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  241. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  242. package/web/.next/server/chunks/ssr/{7f428_lucide-react_dist_esm_icons_5da25833._.js → 7f428_lucide-react_dist_esm_icons_469d51b7._.js} +2 -2
  243. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_469d51b7._.js.map +1 -0
  244. package/web/.next/server/chunks/ssr/[root-of-the-server]__013a0318._.js +1 -1
  245. package/web/.next/server/chunks/ssr/[root-of-the-server]__013a0318._.js.map +1 -1
  246. package/web/.next/server/chunks/ssr/[root-of-the-server]__17dadd08._.js +1 -1
  247. package/web/.next/server/chunks/ssr/[root-of-the-server]__17dadd08._.js.map +1 -1
  248. package/web/.next/server/chunks/ssr/[root-of-the-server]__1925bef0._.js +1 -1
  249. package/web/.next/server/chunks/ssr/[root-of-the-server]__1a9687c4._.js +1 -1
  250. package/web/.next/server/chunks/ssr/[root-of-the-server]__1a9687c4._.js.map +1 -1
  251. package/web/.next/server/chunks/ssr/[root-of-the-server]__24756fa9._.js +2 -2
  252. package/web/.next/server/chunks/ssr/[root-of-the-server]__24756fa9._.js.map +1 -1
  253. package/web/.next/server/chunks/ssr/[root-of-the-server]__42d066e1._.js +3 -0
  254. package/web/.next/server/chunks/ssr/[root-of-the-server]__42d066e1._.js.map +1 -0
  255. package/web/.next/server/chunks/ssr/[root-of-the-server]__4ee8be85._.js +1 -1
  256. package/web/.next/server/chunks/ssr/[root-of-the-server]__70986695._.js +1 -1
  257. package/web/.next/server/chunks/ssr/[root-of-the-server]__70986695._.js.map +1 -1
  258. package/web/.next/server/chunks/ssr/[root-of-the-server]__a5ea76a6._.js +1 -1
  259. package/web/.next/server/chunks/ssr/[root-of-the-server]__a5ea76a6._.js.map +1 -1
  260. package/web/.next/server/chunks/ssr/[root-of-the-server]__dd3e834e._.js +1 -1
  261. package/web/.next/server/chunks/ssr/[root-of-the-server]__dd3e834e._.js.map +1 -1
  262. package/web/.next/server/chunks/ssr/[root-of-the-server]__e265da61._.js +1 -1
  263. package/web/.next/server/chunks/ssr/[root-of-the-server]__f3ca7bea._.js +1 -1
  264. package/web/.next/server/chunks/ssr/[root-of-the-server]__f3ca7bea._.js.map +1 -1
  265. package/web/.next/server/chunks/ssr/{[root-of-the-server]__bb391c45._.js → [root-of-the-server]__f4f07ee6._.js} +2 -2
  266. package/web/.next/server/chunks/ssr/[root-of-the-server]__f4f07ee6._.js.map +1 -0
  267. package/web/.next/server/chunks/ssr/_0277d3b5._.js +1 -1
  268. package/web/.next/server/chunks/ssr/_0277d3b5._.js.map +1 -1
  269. package/web/.next/server/chunks/ssr/{_96718a00._.js → _1a4c514f._.js} +2 -2
  270. package/web/.next/server/chunks/ssr/{_96718a00._.js.map → _1a4c514f._.js.map} +1 -1
  271. package/web/.next/server/chunks/ssr/{_948d3cc6._.js → _33bab16e._.js} +2 -2
  272. package/web/.next/server/chunks/ssr/{_948d3cc6._.js.map → _33bab16e._.js.map} +1 -1
  273. package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
  274. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  275. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  276. package/web/.next/server/chunks/ssr/{_ff6f3257._.js → _5d41b1f7._.js} +2 -2
  277. package/web/.next/server/chunks/ssr/{_ff6f3257._.js.map → _5d41b1f7._.js.map} +1 -1
  278. package/web/.next/server/chunks/ssr/_708a9069._.js +3 -0
  279. package/web/.next/server/chunks/ssr/_708a9069._.js.map +1 -0
  280. package/web/.next/server/chunks/ssr/{_9df33116._.js → _81197d1b._.js} +2 -2
  281. package/web/.next/server/chunks/ssr/{_9df33116._.js.map → _81197d1b._.js.map} +1 -1
  282. package/web/.next/server/chunks/ssr/{_295fffde._.js → _86bb5eb1._.js} +6 -2
  283. package/web/.next/server/chunks/ssr/_86bb5eb1._.js.map +1 -0
  284. package/web/.next/server/chunks/ssr/_946a7fc6._.js +1 -1
  285. package/web/.next/server/chunks/ssr/_946a7fc6._.js.map +1 -1
  286. package/web/.next/server/chunks/ssr/_bad61758._.js +3 -0
  287. package/web/.next/server/chunks/ssr/_bad61758._.js.map +1 -0
  288. package/web/.next/server/chunks/ssr/{_ee88b448._.js → _ce70bfa0._.js} +2 -2
  289. package/web/.next/server/chunks/ssr/{_ee88b448._.js.map → _ce70bfa0._.js.map} +1 -1
  290. package/web/.next/server/chunks/ssr/_d7d82308._.js +3 -0
  291. package/web/.next/server/chunks/ssr/_d7d82308._.js.map +1 -0
  292. package/web/.next/server/chunks/ssr/_dd852eae._.js +3 -0
  293. package/web/.next/server/chunks/ssr/_dd852eae._.js.map +1 -0
  294. package/web/.next/server/chunks/ssr/_eff1b518._.js +1 -1
  295. package/web/.next/server/chunks/ssr/_eff1b518._.js.map +1 -1
  296. package/web/.next/server/chunks/ssr/_f227429a._.js +1 -1
  297. package/web/.next/server/chunks/ssr/_f227429a._.js.map +1 -1
  298. package/web/.next/server/chunks/ssr/_f6b812ec._.js +9 -0
  299. package/web/.next/server/chunks/ssr/_f6b812ec._.js.map +1 -0
  300. package/web/.next/server/chunks/ssr/_f86fc1bf._.js +1 -1
  301. package/web/.next/server/chunks/ssr/_f86fc1bf._.js.map +1 -1
  302. package/web/.next/server/chunks/ssr/_f8c55130._.js +1 -1
  303. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  304. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  305. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  306. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  307. package/web/.next/server/chunks/ssr/node_modules__pnpm_64cc95e9._.js +3 -0
  308. package/web/.next/server/chunks/ssr/node_modules__pnpm_64cc95e9._.js.map +1 -0
  309. package/web/.next/server/chunks/ssr/src_presentation_web_36f2bc45._.js +1 -1
  310. package/web/.next/server/chunks/ssr/src_presentation_web_36f2bc45._.js.map +1 -1
  311. package/web/.next/server/chunks/ssr/src_presentation_web_486908de._.js +1 -1
  312. package/web/.next/server/chunks/ssr/src_presentation_web_486908de._.js.map +1 -1
  313. package/web/.next/server/chunks/ssr/src_presentation_web_5c3596bc._.js +1 -1
  314. package/web/.next/server/chunks/ssr/src_presentation_web_5c3596bc._.js.map +1 -1
  315. package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js +1 -1
  316. package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js.map +1 -1
  317. package/web/.next/server/chunks/ssr/src_presentation_web_6326f81e._.js +1 -1
  318. package/web/.next/server/chunks/ssr/src_presentation_web_6326f81e._.js.map +1 -1
  319. package/web/.next/server/chunks/ssr/src_presentation_web_6b2fdcd8._.js +1 -1
  320. package/web/.next/server/chunks/ssr/src_presentation_web_6b2fdcd8._.js.map +1 -1
  321. package/web/.next/server/chunks/ssr/src_presentation_web_74703c9f._.js +1 -1
  322. package/web/.next/server/chunks/ssr/src_presentation_web_74703c9f._.js.map +1 -1
  323. package/web/.next/server/chunks/ssr/src_presentation_web_a8056dac._.js +1 -1
  324. package/web/.next/server/chunks/ssr/src_presentation_web_a8056dac._.js.map +1 -1
  325. package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js +1 -1
  326. package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js.map +1 -1
  327. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +3 -3
  328. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -1
  329. package/web/.next/server/chunks/ssr/src_presentation_web_b00bfb08._.js +1 -1
  330. package/web/.next/server/chunks/ssr/src_presentation_web_b00bfb08._.js.map +1 -1
  331. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  332. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  333. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js +1 -1
  334. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js.map +1 -1
  335. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  336. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  337. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  338. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  339. package/web/.next/server/chunks/ssr/src_presentation_web_f1edcf5e._.js +1 -1
  340. package/web/.next/server/chunks/ssr/src_presentation_web_f1edcf5e._.js.map +1 -1
  341. package/web/.next/server/chunks/ssr/src_presentation_web_f9436804._.js +1 -1
  342. package/web/.next/server/chunks/ssr/src_presentation_web_f9436804._.js.map +1 -1
  343. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
  344. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
  345. package/web/.next/server/pages/500.html +2 -2
  346. package/web/.next/server/server-reference-manifest.js +1 -1
  347. package/web/.next/server/server-reference-manifest.json +109 -64
  348. package/web/.next/static/chunks/0239d68df2738a2a.js +1 -0
  349. package/web/.next/static/chunks/{b17c2d874c373d4e.js → 05d641009a42e94b.js} +1 -1
  350. package/web/.next/static/chunks/{ee9a716c6424ff25.js → 0d04391861f2a381.js} +1 -1
  351. package/web/.next/static/chunks/{2a64d4b1a285fac5.js → 151d16c2c65a4356.js} +1 -1
  352. package/web/.next/static/chunks/19008d82be3a09a5.js +5 -0
  353. package/web/.next/static/chunks/{f7a55ba1f789c55f.js → 193d8b761fec697e.js} +1 -1
  354. package/web/.next/static/chunks/2bad6607c1e0f153.js +7 -0
  355. package/web/.next/static/chunks/{7c3fe3c694874dea.js → 32940aa08b947f66.js} +1 -1
  356. package/web/.next/static/chunks/{0a67d6e50e27452e.js → 368809962c4cd597.js} +1 -1
  357. package/web/.next/static/chunks/{8f783e12274578c2.js → 475e5bd4e8bafc6f.js} +1 -1
  358. package/web/.next/static/chunks/{c1559152cf2ab9c6.js → 55e59f912fff1858.js} +1 -1
  359. package/web/.next/static/chunks/{fcf27468f8026dbd.js → 66d72ca561bb91ca.js} +1 -1
  360. package/web/.next/static/chunks/6da04daaac881f27.js +1 -0
  361. package/web/.next/static/chunks/{2fe20598e1b4793a.js → 75eb5f94364a44bf.js} +2 -2
  362. package/web/.next/static/chunks/{e8444bf5f6c35f8b.js → 7bbe49d9daedd94d.js} +5 -1
  363. package/web/.next/static/chunks/{3ee4449e73eb4917.js → 83ea5b5b0d0a8477.js} +1 -1
  364. package/web/.next/static/chunks/8fe70d4e73e1fe31.css +1 -0
  365. package/web/.next/static/chunks/9d70c74c84d24724.js +1 -0
  366. package/web/.next/static/chunks/{010215070d22b4e6.js → a6d8276c88451abf.js} +2 -2
  367. package/web/.next/static/chunks/b3fa9a303332e7d6.js +3 -0
  368. package/web/.next/static/chunks/b9b3a6d83e07b213.js +1 -0
  369. package/web/.next/static/chunks/c92bc820f657f9d9.js +1 -0
  370. package/web/.next/static/chunks/dd5ab4e1762b5812.js +1 -0
  371. package/web/.next/static/chunks/{2ddda685a9100fd8.js → e7b870347bdfe35d.js} +1 -1
  372. package/web/.next/static/chunks/ecafea5bc026ed41.js +1 -0
  373. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_5da25833._.js.map +0 -1
  374. package/web/.next/server/chunks/ssr/[root-of-the-server]__a6f2b763._.js +0 -3
  375. package/web/.next/server/chunks/ssr/[root-of-the-server]__a6f2b763._.js.map +0 -1
  376. package/web/.next/server/chunks/ssr/[root-of-the-server]__bb391c45._.js.map +0 -1
  377. package/web/.next/server/chunks/ssr/_295fffde._.js.map +0 -1
  378. package/web/.next/server/chunks/ssr/_44531b76._.js +0 -9
  379. package/web/.next/server/chunks/ssr/_44531b76._.js.map +0 -1
  380. package/web/.next/server/chunks/ssr/_5bf2415e._.js +0 -7
  381. package/web/.next/server/chunks/ssr/_5bf2415e._.js.map +0 -1
  382. package/web/.next/server/chunks/ssr/_869a3a15._.js +0 -3
  383. package/web/.next/server/chunks/ssr/_869a3a15._.js.map +0 -1
  384. package/web/.next/server/chunks/ssr/_b227ff50._.js +0 -3
  385. package/web/.next/server/chunks/ssr/_b227ff50._.js.map +0 -1
  386. package/web/.next/server/chunks/ssr/_e071ba48._.js +0 -3
  387. package/web/.next/server/chunks/ssr/_e071ba48._.js.map +0 -1
  388. package/web/.next/server/chunks/ssr/node_modules__pnpm_747b43ac._.js +0 -3
  389. package/web/.next/server/chunks/ssr/node_modules__pnpm_747b43ac._.js.map +0 -1
  390. package/web/.next/static/chunks/06b9d6dbf635c370.css +0 -1
  391. package/web/.next/static/chunks/1ae0cf5be30ef398.js +0 -1
  392. package/web/.next/static/chunks/6ecbcce796343f44.js +0 -1
  393. package/web/.next/static/chunks/8492d8e0b5f9a4e8.js +0 -1
  394. package/web/.next/static/chunks/927442d2628f6e22.js +0 -1
  395. package/web/.next/static/chunks/9370d114ce5b69fb.js +0 -7
  396. package/web/.next/static/chunks/b2a010b2ba8710f4.js +0 -1
  397. package/web/.next/static/chunks/b99506a6f7bc2fa8.js +0 -1
  398. package/web/.next/static/chunks/d2182843a406b5a7.js +0 -5
  399. package/web/.next/static/chunks/edf812d5efffa096.js +0 -7
  400. /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → Rb8tiiSfY1LEpEkuZLtTr}/_buildManifest.js +0 -0
  401. /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → Rb8tiiSfY1LEpEkuZLtTr}/_clientMiddlewareManifest.json +0 -0
  402. /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → Rb8tiiSfY1LEpEkuZLtTr}/_ssgManifest.js +0 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Messaging Chat Relay
3
+ *
4
+ * Bridges messaging app chat ↔ Shep interactive agent sessions.
5
+ * When a user enters "chat mode" via /chat <feature_id>, their messages
6
+ * are relayed to the agent and agent responses are batched and sent back
7
+ * through the tunnel.
8
+ *
9
+ * Output batching: agent streaming output is buffered and flushed every
10
+ * N milliseconds (default 3s) to avoid flooding messaging platforms.
11
+ * Only one active relay per user at a time.
12
+ */
13
+ import type { IMessageSender } from '../../../application/ports/output/services/message-sender.interface.js';
14
+ /**
15
+ * Manages the bidirectional chat relay between messaging apps
16
+ * and Shep interactive agent sessions.
17
+ */
18
+ export declare class MessagingChatRelay {
19
+ private readonly sender;
20
+ private readonly bufferIntervalMs;
21
+ private activeRelay;
22
+ private buffer;
23
+ private bufferTimer;
24
+ constructor(sender: IMessageSender, bufferIntervalMs?: number);
25
+ /** Start a chat relay for a specific feature */
26
+ startRelay(featureId: string, chatId: string, platform: string, worktreePath?: string, unsubscribe?: () => void): string;
27
+ /** Get the worktree path of the active relay, if any. */
28
+ getActiveWorktreePath(): string | null;
29
+ /** End the active chat relay */
30
+ endRelay(): string;
31
+ /** Check if there is an active relay */
32
+ hasActiveRelay(): boolean;
33
+ /** Get the active relay's feature ID */
34
+ getActiveFeatureId(): string | null;
35
+ /**
36
+ * Buffer an agent response chunk and schedule a flush.
37
+ * Called when the agent produces output during a chat relay.
38
+ */
39
+ bufferAgentOutput(delta: string): void;
40
+ /** Flush any buffered output immediately (e.g., on stream completion) */
41
+ flushBuffer(): void;
42
+ /** Stop the relay and clean up all resources */
43
+ stop(): void;
44
+ }
45
+ //# sourceMappingURL=chat-relay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-relay.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/chat-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wEAAwE,CAAC;AAa7G;;;GAGG;AACH,qBAAa,kBAAkB;IAM3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IANnC,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,WAAW,CAA8C;gBAG9C,MAAM,EAAE,cAAc,EACtB,gBAAgB,GAAE,MAAmC;IAGxE,gDAAgD;IAChD,UAAU,CACR,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,YAAY,SAAK,EACjB,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,MAAM;IAWT,yDAAyD;IACzD,qBAAqB,IAAI,MAAM,GAAG,IAAI;IAItC,gCAAgC;IAChC,QAAQ,IAAI,MAAM;IAYlB,wCAAwC;IACxC,cAAc,IAAI,OAAO;IAIzB,wCAAwC;IACxC,kBAAkB,IAAI,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAatC,yEAAyE;IACzE,WAAW,IAAI,IAAI;IAkBnB,gDAAgD;IAChD,IAAI,IAAI,IAAI;CAKb"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Messaging Chat Relay
3
+ *
4
+ * Bridges messaging app chat ↔ Shep interactive agent sessions.
5
+ * When a user enters "chat mode" via /chat <feature_id>, their messages
6
+ * are relayed to the agent and agent responses are batched and sent back
7
+ * through the tunnel.
8
+ *
9
+ * Output batching: agent streaming output is buffered and flushed every
10
+ * N milliseconds (default 3s) to avoid flooding messaging platforms.
11
+ * Only one active relay per user at a time.
12
+ */
13
+ import { sanitizeForMessaging } from './content-sanitizer.js';
14
+ const DEFAULT_BUFFER_INTERVAL_MS = 3_000;
15
+ /**
16
+ * Manages the bidirectional chat relay between messaging apps
17
+ * and Shep interactive agent sessions.
18
+ */
19
+ export class MessagingChatRelay {
20
+ sender;
21
+ bufferIntervalMs;
22
+ activeRelay = null;
23
+ buffer = '';
24
+ bufferTimer = null;
25
+ constructor(sender, bufferIntervalMs = DEFAULT_BUFFER_INTERVAL_MS) {
26
+ this.sender = sender;
27
+ this.bufferIntervalMs = bufferIntervalMs;
28
+ }
29
+ /** Start a chat relay for a specific feature */
30
+ startRelay(featureId, chatId, platform, worktreePath = '', unsubscribe) {
31
+ // Tear down any previous relay (including its subscription).
32
+ if (this.activeRelay) {
33
+ this.flushBuffer();
34
+ this.activeRelay.unsubscribe?.();
35
+ }
36
+ this.activeRelay = { featureId, chatId, platform, worktreePath, unsubscribe };
37
+ return `Chat relay started for feature #${featureId}. Send messages here to talk to the agent. /end to stop.`;
38
+ }
39
+ /** Get the worktree path of the active relay, if any. */
40
+ getActiveWorktreePath() {
41
+ return this.activeRelay?.worktreePath ?? null;
42
+ }
43
+ /** End the active chat relay */
44
+ endRelay() {
45
+ if (!this.activeRelay) {
46
+ return 'No active chat relay.';
47
+ }
48
+ this.flushBuffer();
49
+ const fid = this.activeRelay.featureId;
50
+ this.activeRelay.unsubscribe?.();
51
+ this.activeRelay = null;
52
+ return `Chat relay ended for feature #${fid}.`;
53
+ }
54
+ /** Check if there is an active relay */
55
+ hasActiveRelay() {
56
+ return this.activeRelay !== null;
57
+ }
58
+ /** Get the active relay's feature ID */
59
+ getActiveFeatureId() {
60
+ return this.activeRelay?.featureId ?? null;
61
+ }
62
+ /**
63
+ * Buffer an agent response chunk and schedule a flush.
64
+ * Called when the agent produces output during a chat relay.
65
+ */
66
+ bufferAgentOutput(delta) {
67
+ if (!this.activeRelay)
68
+ return;
69
+ this.buffer += delta;
70
+ if (!this.bufferTimer) {
71
+ this.bufferTimer = setTimeout(() => {
72
+ this.flushBuffer();
73
+ }, this.bufferIntervalMs);
74
+ this.bufferTimer.unref();
75
+ }
76
+ }
77
+ /** Flush any buffered output immediately (e.g., on stream completion) */
78
+ flushBuffer() {
79
+ if (this.buffer && this.activeRelay) {
80
+ const notification = {
81
+ event: 'chat.response',
82
+ featureId: this.activeRelay.featureId,
83
+ title: '',
84
+ message: sanitizeForMessaging(this.buffer),
85
+ };
86
+ void this.sender.send(notification);
87
+ this.buffer = '';
88
+ }
89
+ if (this.bufferTimer) {
90
+ clearTimeout(this.bufferTimer);
91
+ this.bufferTimer = null;
92
+ }
93
+ }
94
+ /** Stop the relay and clean up all resources */
95
+ stop() {
96
+ this.flushBuffer();
97
+ this.activeRelay?.unsubscribe?.();
98
+ this.activeRelay = null;
99
+ }
100
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Messaging Command Executor
3
+ *
4
+ * Maps inbound MessagingCommand payloads from the Gateway tunnel
5
+ * to existing Shep use case invocations. This is the bridge between
6
+ * external messaging commands and the application layer.
7
+ *
8
+ * All commands are mapped to existing use cases — no new business logic
9
+ * is introduced here. The executor is a thin translation layer.
10
+ *
11
+ * Feature ID resolution: messaging commands use short IDs (first 8 chars
12
+ * of the UUID). The ShowFeatureUseCase and ResumeFeatureUseCase support
13
+ * prefix matching via findByIdPrefix. For approve/reject/stop, we resolve
14
+ * the feature first, then use its agentRunId.
15
+ */
16
+ import type { MessagingCommand } from '../../../domain/generated/output.js';
17
+ import type { IFeatureRepository } from '../../../application/ports/output/repositories/feature-repository.interface.js';
18
+ import type { ListFeaturesUseCase } from '../../../application/use-cases/features/list-features.use-case.js';
19
+ import type { ShowFeatureUseCase } from '../../../application/use-cases/features/show-feature.use-case.js';
20
+ import type { CreateFeatureUseCase } from '../../../application/use-cases/features/create/create-feature.use-case.js';
21
+ import type { ApproveAgentRunUseCase } from '../../../application/use-cases/agents/approve-agent-run.use-case.js';
22
+ import type { RejectAgentRunUseCase } from '../../../application/use-cases/agents/reject-agent-run.use-case.js';
23
+ import type { StopAgentRunUseCase } from '../../../application/use-cases/agents/stop-agent-run.use-case.js';
24
+ import type { ResumeFeatureUseCase } from '../../../application/use-cases/features/resume-feature.use-case.js';
25
+ import type { ListRepositoriesUseCase } from '../../../application/use-cases/repositories/list-repositories.use-case.js';
26
+ /**
27
+ * Execute messaging commands by delegating to existing use cases.
28
+ */
29
+ export declare class MessagingCommandExecutor {
30
+ private readonly featureRepo;
31
+ private readonly createFeature;
32
+ private readonly approveAgentRun;
33
+ private readonly rejectAgentRun;
34
+ private readonly stopAgentRun;
35
+ private readonly resumeFeature;
36
+ private readonly listFeatures;
37
+ private readonly showFeature;
38
+ private readonly listRepositories;
39
+ constructor(featureRepo: IFeatureRepository, createFeature: CreateFeatureUseCase, approveAgentRun: ApproveAgentRunUseCase, rejectAgentRun: RejectAgentRunUseCase, stopAgentRun: StopAgentRunUseCase, resumeFeature: ResumeFeatureUseCase, listFeatures: ListFeaturesUseCase, showFeature: ShowFeatureUseCase, listRepositories: ListRepositoriesUseCase);
40
+ /**
41
+ * Execute a messaging command and return a human-readable response.
42
+ */
43
+ execute(cmd: MessagingCommand): Promise<string>;
44
+ private handleNew;
45
+ private handleApprove;
46
+ private handleReject;
47
+ private handleStop;
48
+ private handleResume;
49
+ private handleStatus;
50
+ /** Resolve a feature by exact ID or prefix match */
51
+ private resolveFeature;
52
+ }
53
+ //# sourceMappingURL=command-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/command-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAW,MAAM,qCAAqC,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mEAAmE,CAAC;AAC7G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kEAAkE,CAAC;AAC3G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2EAA2E,CAAC;AACtH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qEAAqE,CAAC;AAClH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAC;AAChH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oEAAoE,CAAC;AAC/G,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2EAA2E,CAAC;AAkBzH;;GAEG;AACH,qBAAa,wBAAwB;IAEjC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBARhB,WAAW,EAAE,kBAAkB,EAC/B,aAAa,EAAE,oBAAoB,EACnC,eAAe,EAAE,sBAAsB,EACvC,cAAc,EAAE,qBAAqB,EACrC,YAAY,EAAE,mBAAmB,EACjC,aAAa,EAAE,oBAAoB,EACnC,YAAY,EAAE,mBAAmB,EACjC,WAAW,EAAE,kBAAkB,EAC/B,gBAAgB,EAAE,uBAAuB;IAG5D;;OAEG;IACG,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;YAqBvC,SAAS;YA0BT,aAAa;YAwBb,YAAY;YA2BZ,UAAU;YAwBV,YAAY;YAaZ,YAAY;IAkB1B,oDAAoD;YACtC,cAAc;CAM7B"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Messaging Command Executor
3
+ *
4
+ * Maps inbound MessagingCommand payloads from the Gateway tunnel
5
+ * to existing Shep use case invocations. This is the bridge between
6
+ * external messaging commands and the application layer.
7
+ *
8
+ * All commands are mapped to existing use cases — no new business logic
9
+ * is introduced here. The executor is a thin translation layer.
10
+ *
11
+ * Feature ID resolution: messaging commands use short IDs (first 8 chars
12
+ * of the UUID). The ShowFeatureUseCase and ResumeFeatureUseCase support
13
+ * prefix matching via findByIdPrefix. For approve/reject/stop, we resolve
14
+ * the feature first, then use its agentRunId.
15
+ */
16
+ const HELP_TEXT = `Available commands:
17
+ /new <description> — Create a new feature
18
+ /approve <id> — Approve gate on feature
19
+ /reject <id> [feedback] — Reject with feedback
20
+ /stop <id> — Stop agent on feature
21
+ /resume <id> — Resume paused feature
22
+ /status — List all active features
23
+ /status <id> — Show detail for feature
24
+ /help — Show this help text`;
25
+ /** Format a feature for display in messaging */
26
+ function formatFeature(f) {
27
+ const shortId = f.id.slice(0, 8);
28
+ return `#${shortId} "${f.name}" — ${f.lifecycle}`;
29
+ }
30
+ /**
31
+ * Execute messaging commands by delegating to existing use cases.
32
+ */
33
+ export class MessagingCommandExecutor {
34
+ featureRepo;
35
+ createFeature;
36
+ approveAgentRun;
37
+ rejectAgentRun;
38
+ stopAgentRun;
39
+ resumeFeature;
40
+ listFeatures;
41
+ showFeature;
42
+ listRepositories;
43
+ constructor(featureRepo, createFeature, approveAgentRun, rejectAgentRun, stopAgentRun, resumeFeature, listFeatures, showFeature, listRepositories) {
44
+ this.featureRepo = featureRepo;
45
+ this.createFeature = createFeature;
46
+ this.approveAgentRun = approveAgentRun;
47
+ this.rejectAgentRun = rejectAgentRun;
48
+ this.stopAgentRun = stopAgentRun;
49
+ this.resumeFeature = resumeFeature;
50
+ this.listFeatures = listFeatures;
51
+ this.showFeature = showFeature;
52
+ this.listRepositories = listRepositories;
53
+ }
54
+ /**
55
+ * Execute a messaging command and return a human-readable response.
56
+ */
57
+ async execute(cmd) {
58
+ switch (cmd.command) {
59
+ case 'new':
60
+ return this.handleNew(cmd);
61
+ case 'approve':
62
+ return this.handleApprove(cmd);
63
+ case 'reject':
64
+ return this.handleReject(cmd);
65
+ case 'stop':
66
+ return this.handleStop(cmd);
67
+ case 'resume':
68
+ return this.handleResume(cmd);
69
+ case 'status':
70
+ return this.handleStatus(cmd);
71
+ case 'help':
72
+ return HELP_TEXT;
73
+ default:
74
+ return `Unknown command: ${cmd.command}. Send /help for available commands.`;
75
+ }
76
+ }
77
+ async handleNew(cmd) {
78
+ if (!cmd.args) {
79
+ return 'Usage: /new <feature description>';
80
+ }
81
+ try {
82
+ // Resolve a default repository path from the first tracked repository
83
+ const repos = await this.listRepositories.execute();
84
+ if (repos.length === 0) {
85
+ return 'No repositories configured. Add a repository in the Shep UI first.';
86
+ }
87
+ const result = await this.createFeature.execute({
88
+ userInput: cmd.args,
89
+ repositoryPath: repos[0].path,
90
+ fast: true,
91
+ push: true,
92
+ openPr: true,
93
+ });
94
+ const shortId = result.feature.id.slice(0, 8);
95
+ return `Started: "${cmd.args}" — feature #${shortId}`;
96
+ }
97
+ catch (error) {
98
+ return `Failed to create feature: ${error instanceof Error ? error.message : String(error)}`;
99
+ }
100
+ }
101
+ async handleApprove(cmd) {
102
+ if (!cmd.featureId) {
103
+ return 'Usage: /approve <feature_id>';
104
+ }
105
+ try {
106
+ const feature = await this.resolveFeature(cmd.featureId);
107
+ if (!feature) {
108
+ return `Feature #${cmd.featureId} not found`;
109
+ }
110
+ if (!feature.agentRunId) {
111
+ return `Feature #${cmd.featureId} has no active agent run`;
112
+ }
113
+ const result = await this.approveAgentRun.execute(feature.agentRunId);
114
+ if (!result.approved) {
115
+ return `Cannot approve: ${result.reason}`;
116
+ }
117
+ return `Approved feature #${cmd.featureId}`;
118
+ }
119
+ catch (error) {
120
+ return `Failed to approve: ${error instanceof Error ? error.message : String(error)}`;
121
+ }
122
+ }
123
+ async handleReject(cmd) {
124
+ if (!cmd.featureId) {
125
+ return 'Usage: /reject <feature_id> [feedback]';
126
+ }
127
+ try {
128
+ const feature = await this.resolveFeature(cmd.featureId);
129
+ if (!feature) {
130
+ return `Feature #${cmd.featureId} not found`;
131
+ }
132
+ if (!feature.agentRunId) {
133
+ return `Feature #${cmd.featureId} has no active agent run`;
134
+ }
135
+ const result = await this.rejectAgentRun.execute(feature.agentRunId, cmd.args ?? 'Rejected via messaging');
136
+ if (!result.rejected) {
137
+ return `Cannot reject: ${result.reason}`;
138
+ }
139
+ return `Rejected feature #${cmd.featureId}${cmd.args ? ' with feedback' : ''}`;
140
+ }
141
+ catch (error) {
142
+ return `Failed to reject: ${error instanceof Error ? error.message : String(error)}`;
143
+ }
144
+ }
145
+ async handleStop(cmd) {
146
+ if (!cmd.featureId) {
147
+ return 'Usage: /stop <feature_id>';
148
+ }
149
+ try {
150
+ const feature = await this.resolveFeature(cmd.featureId);
151
+ if (!feature) {
152
+ return `Feature #${cmd.featureId} not found`;
153
+ }
154
+ if (!feature.agentRunId) {
155
+ return `Feature #${cmd.featureId} has no active agent run`;
156
+ }
157
+ const result = await this.stopAgentRun.execute(feature.agentRunId);
158
+ if (!result.stopped) {
159
+ return `Cannot stop: ${result.reason}`;
160
+ }
161
+ return `Stopped agent on feature #${cmd.featureId}`;
162
+ }
163
+ catch (error) {
164
+ return `Failed to stop: ${error instanceof Error ? error.message : String(error)}`;
165
+ }
166
+ }
167
+ async handleResume(cmd) {
168
+ if (!cmd.featureId) {
169
+ return 'Usage: /resume <feature_id>';
170
+ }
171
+ try {
172
+ await this.resumeFeature.execute(cmd.featureId);
173
+ return `Resumed feature #${cmd.featureId}`;
174
+ }
175
+ catch (error) {
176
+ return `Failed to resume: ${error instanceof Error ? error.message : String(error)}`;
177
+ }
178
+ }
179
+ async handleStatus(cmd) {
180
+ try {
181
+ if (cmd.featureId) {
182
+ const feature = await this.showFeature.execute(cmd.featureId);
183
+ return formatFeature(feature);
184
+ }
185
+ const features = await this.listFeatures.execute();
186
+ if (features.length === 0) {
187
+ return 'No active features.';
188
+ }
189
+ return features.map(formatFeature).join('\n');
190
+ }
191
+ catch (error) {
192
+ return `Failed to get status: ${error instanceof Error ? error.message : String(error)}`;
193
+ }
194
+ }
195
+ /** Resolve a feature by exact ID or prefix match */
196
+ async resolveFeature(featureId) {
197
+ return ((await this.featureRepo.findById(featureId)) ??
198
+ (await this.featureRepo.findByIdPrefix(featureId)));
199
+ }
200
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Content Sanitizer
3
+ *
4
+ * Sanitizes outbound messages to ensure no sensitive content
5
+ * (file paths, environment variables, code blocks, secrets)
6
+ * is transmitted through third-party messaging platforms.
7
+ *
8
+ * Security requirement FR-6: no source code, diffs, or file
9
+ * contents transmitted through messaging platforms.
10
+ */
11
+ /**
12
+ * Strip sensitive content from a message before sending to a messaging platform.
13
+ *
14
+ * Removes:
15
+ * - Absolute file paths
16
+ * - Environment variable assignments
17
+ * - Code blocks (fenced with backticks)
18
+ * - Potential secret patterns (API keys, tokens)
19
+ *
20
+ * Truncates to messaging-safe length.
21
+ */
22
+ export declare function sanitizeForMessaging(text: string): string;
23
+ //# sourceMappingURL=content-sanitizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-sanitizer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/content-sanitizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBzD"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Content Sanitizer
3
+ *
4
+ * Sanitizes outbound messages to ensure no sensitive content
5
+ * (file paths, environment variables, code blocks, secrets)
6
+ * is transmitted through third-party messaging platforms.
7
+ *
8
+ * Security requirement FR-6: no source code, diffs, or file
9
+ * contents transmitted through messaging platforms.
10
+ */
11
+ const MAX_MESSAGE_LENGTH = 4000;
12
+ /**
13
+ * Strip sensitive content from a message before sending to a messaging platform.
14
+ *
15
+ * Removes:
16
+ * - Absolute file paths
17
+ * - Environment variable assignments
18
+ * - Code blocks (fenced with backticks)
19
+ * - Potential secret patterns (API keys, tokens)
20
+ *
21
+ * Truncates to messaging-safe length.
22
+ */
23
+ export function sanitizeForMessaging(text) {
24
+ let sanitized = text;
25
+ // Strip absolute file paths (Unix and Windows)
26
+ sanitized = sanitized.replace(/(?:\/[\w.\-/]+){2,}/g, '[path]');
27
+ sanitized = sanitized.replace(/[A-Z]:\\[\w.\-\\]+/g, '[path]');
28
+ // Strip env-var-like patterns (KEY=value)
29
+ sanitized = sanitized.replace(/[A-Z_]{3,}=\S+/g, '[env]');
30
+ // Strip fenced code blocks
31
+ sanitized = sanitized.replace(/```[\s\S]*?```/g, '[code block]');
32
+ // Strip inline code that looks like file content
33
+ sanitized = sanitized.replace(/`[^`]{100,}`/g, '[code]');
34
+ // Truncate to messaging-safe length
35
+ if (sanitized.length > MAX_MESSAGE_LENGTH) {
36
+ sanitized = `${sanitized.slice(0, MAX_MESSAGE_LENGTH - 3)}...`;
37
+ }
38
+ return sanitized;
39
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * HTTP Gateway Client
3
+ *
4
+ * Concrete implementation of IGatewayClient that speaks the Commands.com
5
+ * Gateway OpenAPI (see https://github.com/Commands-com/gateway/blob/main/docs/openapi.yaml).
6
+ *
7
+ * This adapter is infrastructure — it knows about HTTP verbs, status codes,
8
+ * and the gateway's wire format. Callers receive domain objects only.
9
+ */
10
+ import type { IGatewayClient, FetchTokenInput, GatewayOAuthToken, CreateIntegrationRouteInput, GatewayIntegrationRoute } from '../../../application/ports/output/services/gateway-client.interface.js';
11
+ type FetchFn = typeof fetch;
12
+ export declare class HttpGatewayClient implements IGatewayClient {
13
+ private readonly fetchImpl;
14
+ constructor(fetchImpl?: FetchFn);
15
+ fetchAccessToken(input: FetchTokenInput): Promise<GatewayOAuthToken>;
16
+ createIntegrationRoute(gatewayUrl: string, accessToken: string, input: CreateIntegrationRouteInput): Promise<GatewayIntegrationRoute>;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=http-gateway.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-gateway.client.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/http-gateway.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,wEAAwE,CAAC;AAEhF,KAAK,OAAO,GAAG,OAAO,KAAK,CAAC;AAqB5B,qBACa,iBAAkB,YAAW,cAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,GAAE,OAAe;IAEjD,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA+CpE,sBAAsB,CAC1B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,uBAAuB,CAAC;CAsDpC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * HTTP Gateway Client
3
+ *
4
+ * Concrete implementation of IGatewayClient that speaks the Commands.com
5
+ * Gateway OpenAPI (see https://github.com/Commands-com/gateway/blob/main/docs/openapi.yaml).
6
+ *
7
+ * This adapter is infrastructure — it knows about HTTP verbs, status codes,
8
+ * and the gateway's wire format. Callers receive domain objects only.
9
+ */
10
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
16
+ var __metadata = (this && this.__metadata) || function (k, v) {
17
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
+ };
19
+ import { injectable } from 'tsyringe';
20
+ function stripTrailingSlash(url) {
21
+ return url.endsWith('/') ? url.slice(0, -1) : url;
22
+ }
23
+ async function readErrorBody(response) {
24
+ try {
25
+ const contentType = response.headers.get('content-type') ?? '';
26
+ if (contentType.includes('application/json')) {
27
+ const json = (await response.json());
28
+ const err = typeof json.error === 'string' ? json.error : undefined;
29
+ const msg = typeof json.message === 'string' ? json.message : undefined;
30
+ return err ?? msg ?? JSON.stringify(json);
31
+ }
32
+ return await response.text();
33
+ }
34
+ catch {
35
+ return '';
36
+ }
37
+ }
38
+ let HttpGatewayClient = class HttpGatewayClient {
39
+ fetchImpl;
40
+ constructor(fetchImpl = fetch) {
41
+ this.fetchImpl = fetchImpl;
42
+ }
43
+ async fetchAccessToken(input) {
44
+ const base = stripTrailingSlash(input.gatewayUrl);
45
+ const url = `${base}/oauth/token`;
46
+ const params = new URLSearchParams();
47
+ params.set('grant_type', 'client_credentials');
48
+ params.set('client_id', input.clientId);
49
+ if (input.clientSecret) {
50
+ params.set('client_secret', input.clientSecret);
51
+ }
52
+ if (input.scope) {
53
+ params.set('scope', input.scope);
54
+ }
55
+ const response = await this.fetchImpl(url, {
56
+ method: 'POST',
57
+ headers: { 'content-type': 'application/x-www-form-urlencoded' },
58
+ body: params.toString(),
59
+ });
60
+ if (!response.ok) {
61
+ const detail = await readErrorBody(response);
62
+ throw new Error(`Gateway /oauth/token failed with ${response.status}${detail ? `: ${detail}` : ''}`);
63
+ }
64
+ const body = (await response.json());
65
+ if (!body.access_token) {
66
+ throw new Error('Gateway /oauth/token response missing access_token');
67
+ }
68
+ const expiresInMs = Math.max(0, (body.expires_in ?? 0) * 1000);
69
+ return {
70
+ accessToken: body.access_token,
71
+ tokenType: body.token_type ?? 'Bearer',
72
+ expiresAt: Date.now() + expiresInMs,
73
+ refreshToken: body.refresh_token,
74
+ };
75
+ }
76
+ async createIntegrationRoute(gatewayUrl, accessToken, input) {
77
+ const base = stripTrailingSlash(gatewayUrl);
78
+ const url = `${base}/gateway/v1/integrations/routes`;
79
+ const payload = {
80
+ device_id: input.deviceId,
81
+ interface_type: input.interfaceType,
82
+ token_auth_mode: 'path',
83
+ };
84
+ if (input.routeToken !== undefined)
85
+ payload.route_token = input.routeToken;
86
+ if (input.tokenMaxAgeDays !== undefined)
87
+ payload.token_max_age_days = input.tokenMaxAgeDays;
88
+ if (input.maxBodyBytes !== undefined)
89
+ payload.max_body_bytes = input.maxBodyBytes;
90
+ if (input.deadlineMs !== undefined)
91
+ payload.deadline_ms = input.deadlineMs;
92
+ const response = await this.fetchImpl(url, {
93
+ method: 'POST',
94
+ headers: {
95
+ authorization: `Bearer ${accessToken}`,
96
+ 'content-type': 'application/json',
97
+ },
98
+ body: JSON.stringify(payload),
99
+ });
100
+ if (!response.ok) {
101
+ const detail = await readErrorBody(response);
102
+ throw new Error(`Gateway /gateway/v1/integrations/routes failed with ${response.status}${detail ? `: ${detail}` : ''}`);
103
+ }
104
+ const body = (await response.json());
105
+ const routeId = body.route?.route_id;
106
+ const publicUrl = body.public_url;
107
+ const routeToken = body.route_token;
108
+ if (!routeId || !publicUrl || !routeToken) {
109
+ throw new Error('Gateway route response missing route_id, public_url, or route_token');
110
+ }
111
+ return {
112
+ routeId,
113
+ routeToken,
114
+ publicUrl,
115
+ deviceId: body.route?.device_id ?? input.deviceId,
116
+ interfaceType: body.route?.interface_type ?? input.interfaceType,
117
+ };
118
+ }
119
+ };
120
+ HttpGatewayClient = __decorate([
121
+ injectable(),
122
+ __metadata("design:paramtypes", [Function])
123
+ ], HttpGatewayClient);
124
+ export { HttpGatewayClient };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * HTTP Telegram Client
3
+ *
4
+ * Thin adapter over the Telegram Bot API for sending messages. Only
5
+ * implements the surface needed for the remote control integration —
6
+ * sendMessage, with optional parse_mode.
7
+ *
8
+ * Reference: https://core.telegram.org/bots/api#sendmessage
9
+ */
10
+ import type { ITelegramClient, SendTelegramMessageInput } from '../../../application/ports/output/services/telegram-client.interface.js';
11
+ type FetchFn = typeof fetch;
12
+ export declare class HttpTelegramClient implements ITelegramClient {
13
+ private readonly fetchImpl;
14
+ constructor(fetchImpl?: FetchFn);
15
+ sendMessage(input: SendTelegramMessageInput): Promise<void>;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=http-telegram.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-telegram.client.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/http-telegram.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACzB,MAAM,yEAAyE,CAAC;AAEjF,KAAK,OAAO,GAAG,OAAO,KAAK,CAAC;AAI5B,qBACa,kBAAmB,YAAW,eAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,GAAE,OAAe;IAEjD,WAAW,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;CA8BlE"}