@shepai/cli 1.163.0-pr511.366ece8 → 1.163.0-pr512.9a94785
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.
- package/apis/json-schema/MessagingCommand.yaml +28 -0
- package/apis/json-schema/MessagingCommandType.yaml +14 -0
- package/apis/json-schema/MessagingConfig.yaml +34 -0
- package/apis/json-schema/MessagingFrameType.yaml +8 -0
- package/apis/json-schema/MessagingNotification.yaml +22 -0
- package/apis/json-schema/MessagingPlatform.yaml +7 -0
- package/apis/json-schema/MessagingPlatformConfig.yaml +19 -0
- package/apis/json-schema/Settings.yaml +3 -0
- package/dist/packages/core/src/application/ports/output/services/messaging-service.interface.d.ts +34 -0
- package/dist/packages/core/src/application/ports/output/services/messaging-service.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/messaging-service.interface.js +12 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +120 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +23 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +59 -0
- package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.d.ts +43 -0
- package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.js +93 -0
- package/dist/packages/core/src/infrastructure/services/messaging/command-executor.d.ts +53 -0
- package/dist/packages/core/src/infrastructure/services/messaging/command-executor.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/command-executor.js +200 -0
- package/dist/packages/core/src/infrastructure/services/messaging/content-sanitizer.d.ts +23 -0
- package/dist/packages/core/src/infrastructure/services/messaging/content-sanitizer.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/content-sanitizer.js +39 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts +50 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.js +140 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.d.ts +58 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.js +104 -0
- package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.d.ts +33 -0
- package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.js +79 -0
- package/dist/src/presentation/cli/commands/_serve.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/_serve.command.js +6 -0
- package/dist/src/presentation/cli/commands/settings/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/index.js +3 -1
- package/dist/src/presentation/cli/commands/settings/messaging.command.d.ts +17 -0
- package/dist/src/presentation/cli/commands/settings/messaging.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/settings/messaging.command.js +161 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__beda892a._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__beda892a._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__563e4faf._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__563e4faf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__821a11c1._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__821a11c1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__98740ee4._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__98740ee4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba9f9e11._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba9f9e11._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e5ceba65._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e5ceba65._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0727935d._.js +1 -1
- package/web/.next/server/chunks/ssr/_0727935d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_075fae20._.js +1 -1
- package/web/.next/server/chunks/ssr/_075fae20._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0dc06d07._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_125c55af._.js +1 -1
- package/web/.next/server/chunks/ssr/_125c55af._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_ed99826e._.js → _17c3344c._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ed99826e._.js.map → _17c3344c._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_fb06d580._.js → _30ae6384._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_fb06d580._.js.map → _30ae6384._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_628621c7._.js +1 -1
- package/web/.next/server/chunks/ssr/_628621c7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_18ca0899._.js → _8dcb8b58._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_18ca0899._.js.map → _8dcb8b58._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_9412b27f._.js +1 -1
- package/web/.next/server/chunks/ssr/_9412b27f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ac4a3873._.js +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +46 -46
- package/web/.next/static/chunks/{d6ddde714cdc2efe.js → 0c18b8915d939a76.js} +1 -1
- package/web/.next/static/chunks/{5044bc870aa7b79f.js → 1d2e6f6e7aa59ee7.js} +2 -2
- package/web/.next/static/chunks/{e9310c34cd44a08e.js → 2354d39c63978576.js} +1 -1
- package/web/.next/static/chunks/{21acc5ea573082b6.js → 3deefc76ea55047c.js} +1 -1
- package/web/.next/static/chunks/{db14388056f49e6b.js → 47477ed4c5871747.js} +1 -1
- package/web/.next/static/chunks/{a3ee11f191a73592.js → 4b7456781c9b4ab5.js} +1 -1
- package/web/.next/static/chunks/{dbdd5bfd2c6dd329.js → 63cfaba0d8d962da.js} +1 -1
- package/web/.next/static/chunks/{8b37e6de79a3dd77.js → 74db65fa7bfb80bd.js} +1 -1
- package/web/.next/static/chunks/{bb103de647751269.js → a15e9c4b7af67476.js} +1 -1
- package/web/.next/static/chunks/{0597b8d09919ee4b.js → a3bedc7a2649d1e0.js} +1 -1
- package/web/.next/static/chunks/{e80f10ee969afbe3.js → ac36b3666208b529.js} +1 -1
- package/web/.next/static/chunks/{74828589e4309603.js → d5d91d64bdf8d21c.js} +2 -2
- package/web/.next/static/chunks/{20b904475fa8f8ee.js → dcd124591ee6580d.js} +1 -1
- package/web/.next/static/chunks/{824eb4327f11de2f.js → e9814323885535c3.js} +1 -1
- package/web/.next/static/chunks/{671241415d61f5cb.js → ee2e25620227d46a.js} +3 -3
- package/web/.next/static/chunks/{582a824f9edfff4b.js → f0f48245b38cd4fb.js} +1 -1
- /package/web/.next/static/{Zt9STnUCkSmOuts-wOHt7 → mCo4eb-j7a9M_HjR4zGyS}/_buildManifest.js +0 -0
- /package/web/.next/static/{Zt9STnUCkSmOuts-wOHt7 → mCo4eb-j7a9M_HjR4zGyS}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{Zt9STnUCkSmOuts-wOHt7 → mCo4eb-j7a9M_HjR4zGyS}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/messaging.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2EAA2E,CAAC;AACnH,OAAO,KAAK,EACV,qBAAqB,EAErB,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,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;AAEzH,UAAU,oBAAoB;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,eAAe,CAAC;IACjC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,oBAAoB,CAAC;IACpC,eAAe,EAAE,sBAAsB,CAAC;IACxC,cAAc,EAAE,qBAAqB,CAAC;IACtC,YAAY,EAAE,mBAAmB,CAAC;IAClC,aAAa,EAAE,oBAAoB,CAAC;IACpC,YAAY,EAAE,mBAAmB,CAAC;IAClC,WAAW,EAAE,kBAAkB,CAAC;IAChC,gBAAgB,EAAE,uBAAuB,CAAC;CAC3C;AAED,qBAAa,gBAAiB,YAAW,iBAAiB;IAO5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,OAAO,CAAC,aAAa,CAAuC;IAC5D,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,mBAAmB,CAA6C;IACxE,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,OAAO,CAAS;gBAEK,IAAI,EAAE,oBAAoB;IAEvD,YAAY,IAAI,OAAO;IASvB,WAAW,IAAI,OAAO;IAIhB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA6DtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAcrB,gBAAgB,CAAC,YAAY,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E,OAAO,CAAC,iBAAiB;CAW1B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Service
|
|
3
|
+
*
|
|
4
|
+
* Core orchestrator for the external messaging remote control feature.
|
|
5
|
+
* Implements IMessagingService and coordinates:
|
|
6
|
+
* - Tunnel connection to the Commands.com Gateway
|
|
7
|
+
* - Command execution (inbound commands → use cases)
|
|
8
|
+
* - Notification emission (lifecycle events → tunnel → phone)
|
|
9
|
+
* - Chat relay (bidirectional agent ↔ messaging)
|
|
10
|
+
*
|
|
11
|
+
* Lifecycle:
|
|
12
|
+
* 1. isConfigured() checks if Gateway URL and platform credentials exist
|
|
13
|
+
* 2. start() connects to the Gateway tunnel and wires up handlers
|
|
14
|
+
* 3. stop() disconnects and cleans up all resources
|
|
15
|
+
*/
|
|
16
|
+
import { MessagingTunnelAdapter } from './messaging-tunnel.adapter.js';
|
|
17
|
+
import { MessagingCommandExecutor } from './command-executor.js';
|
|
18
|
+
import { MessagingNotificationEmitter } from './notification-emitter.js';
|
|
19
|
+
import { MessagingChatRelay } from './chat-relay.js';
|
|
20
|
+
export class MessagingService {
|
|
21
|
+
deps;
|
|
22
|
+
tunnelAdapter = null;
|
|
23
|
+
commandExecutor = null;
|
|
24
|
+
notificationEmitter = null;
|
|
25
|
+
chatRelay = null;
|
|
26
|
+
started = false;
|
|
27
|
+
constructor(deps) {
|
|
28
|
+
this.deps = deps;
|
|
29
|
+
}
|
|
30
|
+
isConfigured() {
|
|
31
|
+
const { config } = this.deps;
|
|
32
|
+
if (!config.enabled || !config.gatewayUrl)
|
|
33
|
+
return false;
|
|
34
|
+
const hasTelegram = config.telegram?.enabled && config.telegram.paired;
|
|
35
|
+
const hasWhatsApp = config.whatsapp?.enabled && config.whatsapp.paired;
|
|
36
|
+
return !!(hasTelegram ?? hasWhatsApp);
|
|
37
|
+
}
|
|
38
|
+
isConnected() {
|
|
39
|
+
return this.tunnelAdapter?.isConnected() ?? false;
|
|
40
|
+
}
|
|
41
|
+
async start() {
|
|
42
|
+
if (this.started || !this.isConfigured())
|
|
43
|
+
return;
|
|
44
|
+
const { config, authToken, notificationBus, featureRepo } = this.deps;
|
|
45
|
+
// Create tunnel adapter
|
|
46
|
+
this.tunnelAdapter = new MessagingTunnelAdapter(config.gatewayUrl, authToken);
|
|
47
|
+
// Create command executor
|
|
48
|
+
this.commandExecutor = new MessagingCommandExecutor(featureRepo, this.deps.createFeature, this.deps.approveAgentRun, this.deps.rejectAgentRun, this.deps.stopAgentRun, this.deps.resumeFeature, this.deps.listFeatures, this.deps.showFeature, this.deps.listRepositories);
|
|
49
|
+
// Create notification emitter
|
|
50
|
+
this.notificationEmitter = new MessagingNotificationEmitter(this.tunnelAdapter, notificationBus, config.debounceMs ?? 5_000);
|
|
51
|
+
// Create chat relay
|
|
52
|
+
this.chatRelay = new MessagingChatRelay(this.tunnelAdapter, config.chatBufferMs ?? 3_000);
|
|
53
|
+
// Wire up command handling
|
|
54
|
+
this.tunnelAdapter.onCommand(async (cmd) => {
|
|
55
|
+
// Handle chat control commands
|
|
56
|
+
if (cmd.type === 'chat_control') {
|
|
57
|
+
return this.handleChatControl(cmd);
|
|
58
|
+
}
|
|
59
|
+
// Handle chat messages (relay to active session)
|
|
60
|
+
if (cmd.type === 'chat_message' && this.chatRelay?.hasActiveRelay()) {
|
|
61
|
+
// In a full implementation, this would relay to the interactive session.
|
|
62
|
+
// For now, we acknowledge receipt.
|
|
63
|
+
return 'Message received (chat relay processing).';
|
|
64
|
+
}
|
|
65
|
+
// Handle regular commands
|
|
66
|
+
return this.commandExecutor.execute(cmd);
|
|
67
|
+
});
|
|
68
|
+
// Connect to the Gateway
|
|
69
|
+
try {
|
|
70
|
+
await this.tunnelAdapter.connect();
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Connection failure is non-fatal — reconnection is automatic
|
|
74
|
+
}
|
|
75
|
+
// Start notification forwarding
|
|
76
|
+
this.notificationEmitter.start();
|
|
77
|
+
this.started = true;
|
|
78
|
+
}
|
|
79
|
+
async stop() {
|
|
80
|
+
if (!this.started)
|
|
81
|
+
return;
|
|
82
|
+
this.notificationEmitter?.stop();
|
|
83
|
+
this.chatRelay?.stop();
|
|
84
|
+
await this.tunnelAdapter?.disconnect();
|
|
85
|
+
this.tunnelAdapter = null;
|
|
86
|
+
this.commandExecutor = null;
|
|
87
|
+
this.notificationEmitter = null;
|
|
88
|
+
this.chatRelay = null;
|
|
89
|
+
this.started = false;
|
|
90
|
+
}
|
|
91
|
+
async sendNotification(notification) {
|
|
92
|
+
this.tunnelAdapter?.sendNotification(notification);
|
|
93
|
+
}
|
|
94
|
+
handleChatControl(cmd) {
|
|
95
|
+
if (!this.chatRelay)
|
|
96
|
+
return 'Chat relay not available.';
|
|
97
|
+
if (cmd.command === 'new' && cmd.featureId) {
|
|
98
|
+
// /chat <feature_id> → start relay
|
|
99
|
+
return this.chatRelay.startRelay(cmd.featureId, cmd.chatId, cmd.platform);
|
|
100
|
+
}
|
|
101
|
+
// /end → stop relay
|
|
102
|
+
return this.chatRelay.endRelay();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Notification Emitter
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to Shep's existing NotificationEventBus and pushes
|
|
5
|
+
* events through the Gateway tunnel for delivery to messaging apps.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Debouncing: events for the same feature+type are collapsed within
|
|
9
|
+
* a configurable window (default 5s) to avoid flooding
|
|
10
|
+
* - Content sanitization: all messages are scrubbed of paths, code, and secrets
|
|
11
|
+
* - Gate events are never debounced — delivered immediately
|
|
12
|
+
*/
|
|
13
|
+
import type { NotificationBus } from '../notifications/notification-bus.js';
|
|
14
|
+
import type { MessagingTunnelAdapter } from './messaging-tunnel.adapter.js';
|
|
15
|
+
/**
|
|
16
|
+
* Subscribes to the notification event bus and forwards events
|
|
17
|
+
* to the messaging tunnel for delivery to the user's phone.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MessagingNotificationEmitter {
|
|
20
|
+
private readonly tunnelAdapter;
|
|
21
|
+
private readonly notificationBus;
|
|
22
|
+
private readonly debounceMs;
|
|
23
|
+
private debounceTimers;
|
|
24
|
+
private listening;
|
|
25
|
+
private handler;
|
|
26
|
+
constructor(tunnelAdapter: MessagingTunnelAdapter, notificationBus: NotificationBus, debounceMs?: number);
|
|
27
|
+
/** Start listening for notification events */
|
|
28
|
+
start(): void;
|
|
29
|
+
/** Stop listening for notification events */
|
|
30
|
+
stop(): void;
|
|
31
|
+
private emitDebounced;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=notification-emitter.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/messaging/notification-emitter.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-emitter.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/notification-emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAI5E;;;GAGG;AACH,qBAAa,4BAA4B;IAMrC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAP7B,OAAO,CAAC,cAAc,CAAoD;IAC1E,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAqD;gBAGjD,aAAa,EAAE,sBAAsB,EACrC,eAAe,EAAE,eAAe,EAChC,UAAU,GAAE,MAA4B;IAG3D,8CAA8C;IAC9C,KAAK,IAAI,IAAI;IAwBb,6CAA6C;IAC7C,IAAI,IAAI,IAAI;IAgBZ,OAAO,CAAC,aAAa;CAiBtB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Notification Emitter
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to Shep's existing NotificationEventBus and pushes
|
|
5
|
+
* events through the Gateway tunnel for delivery to messaging apps.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Debouncing: events for the same feature+type are collapsed within
|
|
9
|
+
* a configurable window (default 5s) to avoid flooding
|
|
10
|
+
* - Content sanitization: all messages are scrubbed of paths, code, and secrets
|
|
11
|
+
* - Gate events are never debounced — delivered immediately
|
|
12
|
+
*/
|
|
13
|
+
import { sanitizeForMessaging } from './content-sanitizer.js';
|
|
14
|
+
const DEFAULT_DEBOUNCE_MS = 5_000;
|
|
15
|
+
/**
|
|
16
|
+
* Subscribes to the notification event bus and forwards events
|
|
17
|
+
* to the messaging tunnel for delivery to the user's phone.
|
|
18
|
+
*/
|
|
19
|
+
export class MessagingNotificationEmitter {
|
|
20
|
+
tunnelAdapter;
|
|
21
|
+
notificationBus;
|
|
22
|
+
debounceMs;
|
|
23
|
+
debounceTimers = new Map();
|
|
24
|
+
listening = false;
|
|
25
|
+
handler = null;
|
|
26
|
+
constructor(tunnelAdapter, notificationBus, debounceMs = DEFAULT_DEBOUNCE_MS) {
|
|
27
|
+
this.tunnelAdapter = tunnelAdapter;
|
|
28
|
+
this.notificationBus = notificationBus;
|
|
29
|
+
this.debounceMs = debounceMs;
|
|
30
|
+
}
|
|
31
|
+
/** Start listening for notification events */
|
|
32
|
+
start() {
|
|
33
|
+
if (this.listening)
|
|
34
|
+
return;
|
|
35
|
+
this.handler = (event) => {
|
|
36
|
+
const notification = {
|
|
37
|
+
event: event.eventType,
|
|
38
|
+
featureId: event.featureId,
|
|
39
|
+
title: event.featureName,
|
|
40
|
+
message: sanitizeForMessaging(event.message),
|
|
41
|
+
};
|
|
42
|
+
// Gate/approval events are always delivered immediately
|
|
43
|
+
if (event.eventType === 'waiting_approval') {
|
|
44
|
+
this.tunnelAdapter.sendNotification(notification);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.emitDebounced(event.featureId, event.eventType, notification);
|
|
48
|
+
};
|
|
49
|
+
this.notificationBus.on('notification', this.handler);
|
|
50
|
+
this.listening = true;
|
|
51
|
+
}
|
|
52
|
+
/** Stop listening for notification events */
|
|
53
|
+
stop() {
|
|
54
|
+
if (!this.listening)
|
|
55
|
+
return;
|
|
56
|
+
if (this.handler) {
|
|
57
|
+
this.notificationBus.off('notification', this.handler);
|
|
58
|
+
this.handler = null;
|
|
59
|
+
}
|
|
60
|
+
// Clear all pending debounce timers
|
|
61
|
+
for (const timer of this.debounceTimers.values()) {
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
}
|
|
64
|
+
this.debounceTimers.clear();
|
|
65
|
+
this.listening = false;
|
|
66
|
+
}
|
|
67
|
+
emitDebounced(featureId, eventType, notification) {
|
|
68
|
+
const key = `${featureId}:${eventType}`;
|
|
69
|
+
const existing = this.debounceTimers.get(key);
|
|
70
|
+
if (existing)
|
|
71
|
+
clearTimeout(existing);
|
|
72
|
+
const timer = setTimeout(() => {
|
|
73
|
+
this.tunnelAdapter.sendNotification(notification);
|
|
74
|
+
this.debounceTimers.delete(key);
|
|
75
|
+
}, this.debounceMs);
|
|
76
|
+
timer.unref();
|
|
77
|
+
this.debounceTimers.set(key, timer);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_serve.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/_serve.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"_serve.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/_serve.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AA8B1D;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAuE5C"}
|
|
@@ -68,6 +68,11 @@ export function createServeCommand() {
|
|
|
68
68
|
// Start auto-archive watcher
|
|
69
69
|
initializeAutoArchiveWatcher(featureRepo);
|
|
70
70
|
getAutoArchiveWatcher().start();
|
|
71
|
+
// Start messaging service if configured
|
|
72
|
+
const messagingService = container.resolve('IMessagingService');
|
|
73
|
+
if (messagingService.isConfigured()) {
|
|
74
|
+
await messagingService.start();
|
|
75
|
+
}
|
|
71
76
|
// Graceful shutdown handler — identical pattern to ui.command.ts
|
|
72
77
|
let isShuttingDown = false;
|
|
73
78
|
const shutdown = async () => {
|
|
@@ -79,6 +84,7 @@ export function createServeCommand() {
|
|
|
79
84
|
forceExit.unref();
|
|
80
85
|
getNotificationWatcher().stop();
|
|
81
86
|
getAutoArchiveWatcher().stop();
|
|
87
|
+
await messagingService.stop();
|
|
82
88
|
const deploymentService = container.resolve('IDeploymentService');
|
|
83
89
|
deploymentService.stopAll();
|
|
84
90
|
await service.stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAwB/C"}
|
|
@@ -22,6 +22,7 @@ import { createIdeCommand } from './ide.command.js';
|
|
|
22
22
|
import { createWorkflowCommand } from './workflow.command.js';
|
|
23
23
|
import { createModelCommand } from './model.command.js';
|
|
24
24
|
import { createLanguageCommand } from './language.command.js';
|
|
25
|
+
import { createMessagingCommand } from './messaging.command.js';
|
|
25
26
|
import { onboardingWizard } from '../../../tui/wizards/onboarding/onboarding.wizard.js';
|
|
26
27
|
import { messages } from '../../ui/index.js';
|
|
27
28
|
import { getCliI18n } from '../../i18n.js';
|
|
@@ -37,7 +38,8 @@ export function createSettingsCommand() {
|
|
|
37
38
|
.addCommand(createIdeCommand())
|
|
38
39
|
.addCommand(createWorkflowCommand())
|
|
39
40
|
.addCommand(createModelCommand())
|
|
40
|
-
.addCommand(createLanguageCommand())
|
|
41
|
+
.addCommand(createLanguageCommand())
|
|
42
|
+
.addCommand(createMessagingCommand());
|
|
41
43
|
// Default action: launch the full setup wizard when no subcommand is given
|
|
42
44
|
cmd.action(async () => {
|
|
43
45
|
try {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Configuration Command
|
|
3
|
+
*
|
|
4
|
+
* Configures external messaging remote control via Telegram or WhatsApp
|
|
5
|
+
* through the Commands.com Gateway.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* shep settings messaging # Interactive setup wizard
|
|
9
|
+
* shep settings messaging status # Show connection status
|
|
10
|
+
* shep settings messaging disconnect # Disconnect messaging
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
/**
|
|
14
|
+
* Create the messaging configuration command.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createMessagingCommand(): Command;
|
|
17
|
+
//# sourceMappingURL=messaging.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/messaging.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAsFhD"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Configuration Command
|
|
3
|
+
*
|
|
4
|
+
* Configures external messaging remote control via Telegram or WhatsApp
|
|
5
|
+
* through the Commands.com Gateway.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* shep settings messaging # Interactive setup wizard
|
|
9
|
+
* shep settings messaging status # Show connection status
|
|
10
|
+
* shep settings messaging disconnect # Disconnect messaging
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import { select, input, confirm } from '@inquirer/prompts';
|
|
14
|
+
import { container } from '../../../../../packages/core/src/infrastructure/di/container.js';
|
|
15
|
+
import { UpdateSettingsUseCase } from '../../../../../packages/core/src/application/use-cases/settings/update-settings.use-case.js';
|
|
16
|
+
import { getSettings, resetSettings, initializeSettings, } from '../../../../../packages/core/src/infrastructure/services/settings.service.js';
|
|
17
|
+
import { messages } from '../../ui/index.js';
|
|
18
|
+
import { shepTheme } from '../../../tui/themes/shep.theme.js';
|
|
19
|
+
/**
|
|
20
|
+
* Create the messaging configuration command.
|
|
21
|
+
*/
|
|
22
|
+
export function createMessagingCommand() {
|
|
23
|
+
const cmd = new Command('messaging')
|
|
24
|
+
.description('Configure messaging remote control (Telegram/WhatsApp)')
|
|
25
|
+
.addHelpText('after', `
|
|
26
|
+
Examples:
|
|
27
|
+
$ shep settings messaging Interactive setup wizard
|
|
28
|
+
$ shep settings messaging status Show connection status
|
|
29
|
+
$ shep settings messaging disconnect Disconnect messaging`)
|
|
30
|
+
.action(async () => {
|
|
31
|
+
try {
|
|
32
|
+
await runMessagingWizard();
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
36
|
+
if (err.message.includes('force closed') || err.message.includes('User force closed')) {
|
|
37
|
+
messages.info('Messaging setup cancelled.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
messages.error('Failed to configure messaging', err);
|
|
41
|
+
process.exitCode = 1;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
cmd
|
|
45
|
+
.command('status')
|
|
46
|
+
.description('Show messaging connection status')
|
|
47
|
+
.action(() => {
|
|
48
|
+
const settings = getSettings();
|
|
49
|
+
const mc = settings.messaging;
|
|
50
|
+
if (!mc?.enabled) {
|
|
51
|
+
messages.info('Messaging remote control is not configured.');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
console.log(`\nMessaging Remote Control`);
|
|
55
|
+
console.log(` Gateway: ${mc.gatewayUrl ?? 'not set'}`);
|
|
56
|
+
console.log(` Enabled: ${mc.enabled}`);
|
|
57
|
+
if (mc.telegram) {
|
|
58
|
+
console.log(` Telegram: ${mc.telegram.enabled ? 'enabled' : 'disabled'} (${mc.telegram.paired ? 'paired' : 'not paired'})`);
|
|
59
|
+
}
|
|
60
|
+
if (mc.whatsapp) {
|
|
61
|
+
console.log(` WhatsApp: ${mc.whatsapp.enabled ? 'enabled' : 'disabled'} (${mc.whatsapp.paired ? 'paired' : 'not paired'})`);
|
|
62
|
+
}
|
|
63
|
+
console.log('');
|
|
64
|
+
});
|
|
65
|
+
cmd
|
|
66
|
+
.command('disconnect')
|
|
67
|
+
.description('Disconnect all messaging platforms')
|
|
68
|
+
.action(async () => {
|
|
69
|
+
try {
|
|
70
|
+
const settings = getSettings();
|
|
71
|
+
settings.messaging = {
|
|
72
|
+
enabled: false,
|
|
73
|
+
debounceMs: 5000,
|
|
74
|
+
chatBufferMs: 3000,
|
|
75
|
+
};
|
|
76
|
+
const useCase = container.resolve(UpdateSettingsUseCase);
|
|
77
|
+
const updated = await useCase.execute(settings);
|
|
78
|
+
resetSettings();
|
|
79
|
+
initializeSettings(updated);
|
|
80
|
+
messages.success('Messaging remote control disconnected.');
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
messages.error('Failed to disconnect messaging', error instanceof Error ? error : new Error(String(error)));
|
|
84
|
+
process.exitCode = 1;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return cmd;
|
|
88
|
+
}
|
|
89
|
+
async function runMessagingWizard() {
|
|
90
|
+
const settings = getSettings();
|
|
91
|
+
const platform = await select({
|
|
92
|
+
message: 'Which platform would you like to connect?',
|
|
93
|
+
choices: [
|
|
94
|
+
{ name: 'Telegram', value: 'telegram' },
|
|
95
|
+
{ name: 'WhatsApp', value: 'whatsapp' },
|
|
96
|
+
{ name: 'Disconnect all', value: 'disconnect' },
|
|
97
|
+
],
|
|
98
|
+
theme: shepTheme,
|
|
99
|
+
});
|
|
100
|
+
if (platform === 'disconnect') {
|
|
101
|
+
settings.messaging = {
|
|
102
|
+
enabled: false,
|
|
103
|
+
debounceMs: 5000,
|
|
104
|
+
chatBufferMs: 3000,
|
|
105
|
+
};
|
|
106
|
+
const useCase = container.resolve(UpdateSettingsUseCase);
|
|
107
|
+
const updated = await useCase.execute(settings);
|
|
108
|
+
resetSettings();
|
|
109
|
+
initializeSettings(updated);
|
|
110
|
+
messages.success('Messaging remote control disconnected.');
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
// Get Gateway URL
|
|
114
|
+
const gatewayUrl = await input({
|
|
115
|
+
message: 'Enter your Gateway URL:',
|
|
116
|
+
default: settings.messaging?.gatewayUrl ?? '',
|
|
117
|
+
validate: (value) => {
|
|
118
|
+
if (!value.trim())
|
|
119
|
+
return 'Gateway URL is required';
|
|
120
|
+
try {
|
|
121
|
+
new URL(value);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return 'Please enter a valid URL (e.g., https://my-gateway.railway.app)';
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
theme: shepTheme,
|
|
129
|
+
});
|
|
130
|
+
const platformConfig = {
|
|
131
|
+
enabled: true,
|
|
132
|
+
paired: false,
|
|
133
|
+
chatId: undefined,
|
|
134
|
+
};
|
|
135
|
+
// Update settings
|
|
136
|
+
settings.messaging = {
|
|
137
|
+
...settings.messaging,
|
|
138
|
+
enabled: true,
|
|
139
|
+
gatewayUrl,
|
|
140
|
+
debounceMs: settings.messaging?.debounceMs ?? 5000,
|
|
141
|
+
chatBufferMs: settings.messaging?.chatBufferMs ?? 3000,
|
|
142
|
+
[platform]: platformConfig,
|
|
143
|
+
};
|
|
144
|
+
const useCase = container.resolve(UpdateSettingsUseCase);
|
|
145
|
+
const updated = await useCase.execute(settings);
|
|
146
|
+
resetSettings();
|
|
147
|
+
initializeSettings(updated);
|
|
148
|
+
messages.success(`${platform === 'telegram' ? 'Telegram' : 'WhatsApp'} messaging configured.`);
|
|
149
|
+
messages.info('Next steps:');
|
|
150
|
+
console.log(' 1. Deploy the Commands.com Gateway (if not already running)');
|
|
151
|
+
console.log(' 2. Create integration routes on the Gateway for this platform');
|
|
152
|
+
console.log(` 3. Restart the Shep daemon to activate messaging`);
|
|
153
|
+
const shouldTest = await confirm({
|
|
154
|
+
message: 'Would you like to test the connection?',
|
|
155
|
+
default: false,
|
|
156
|
+
theme: shepTheme,
|
|
157
|
+
});
|
|
158
|
+
if (shouldTest) {
|
|
159
|
+
messages.info('Connection test will be available after daemon restart with messaging enabled.');
|
|
160
|
+
}
|
|
161
|
+
}
|