@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.
- package/apis/json-schema/MessagingCommand.yaml +28 -0
- package/apis/json-schema/MessagingCommandType.yaml +17 -0
- package/apis/json-schema/MessagingConfig.yaml +40 -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 +38 -0
- package/apis/json-schema/Settings.yaml +3 -0
- package/dist/packages/core/src/application/ports/output/services/gateway-client.interface.d.ts +58 -0
- package/dist/packages/core/src/application/ports/output/services/gateway-client.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/gateway-client.interface.js +10 -0
- package/dist/packages/core/src/application/ports/output/services/message-sender.interface.d.ts +18 -0
- package/dist/packages/core/src/application/ports/output/services/message-sender.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/message-sender.interface.js +9 -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/application/ports/output/services/telegram-client.interface.d.ts +19 -0
- package/dist/packages/core/src/application/ports/output/services/telegram-client.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/telegram-client.interface.js +8 -0
- package/dist/packages/core/src/application/use-cases/messaging/begin-pairing.use-case.d.ts +46 -0
- package/dist/packages/core/src/application/use-cases/messaging/begin-pairing.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/messaging/begin-pairing.use-case.js +148 -0
- package/dist/packages/core/src/application/use-cases/messaging/confirm-pairing.use-case.d.ts +19 -0
- package/dist/packages/core/src/application/use-cases/messaging/confirm-pairing.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/messaging/confirm-pairing.use-case.js +63 -0
- package/dist/packages/core/src/application/use-cases/messaging/disconnect-messaging.use-case.d.ts +19 -0
- package/dist/packages/core/src/application/use-cases/messaging/disconnect-messaging.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/messaging/disconnect-messaging.use-case.js +65 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +155 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +26 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +117 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +24 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +117 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-messaging-remote-control.d.ts +22 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-messaging-remote-control.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-messaging-remote-control.js +62 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +43 -3
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +1 -4
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +6 -11
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.d.ts +2 -2
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.js +2 -2
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +2 -3
- package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts +5 -16
- package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/pr-branding.js +7 -38
- package/dist/packages/core/src/infrastructure/services/messaging/chat-relay.d.ts +45 -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 +100 -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/http-gateway.client.d.ts +19 -0
- package/dist/packages/core/src/infrastructure/services/messaging/http-gateway.client.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/http-gateway.client.js +124 -0
- package/dist/packages/core/src/infrastructure/services/messaging/http-telegram.client.d.ts +18 -0
- package/dist/packages/core/src/infrastructure/services/messaging/http-telegram.client.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/http-telegram.client.js +60 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts +68 -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 +262 -0
- package/dist/packages/core/src/infrastructure/services/messaging/messaging.service.d.ts +78 -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 +279 -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/packages/core/src/infrastructure/services/messaging/stub-gateway.client.d.ts +12 -0
- package/dist/packages/core/src/infrastructure/services/messaging/stub-gateway.client.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/stub-gateway.client.js +26 -0
- package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.d.ts +26 -0
- package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.js +49 -0
- package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.d.ts +28 -0
- package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.js +45 -0
- package/dist/packages/core/src/infrastructure/services/messaging/tunnel-protocol.d.ts +102 -0
- package/dist/packages/core/src/infrastructure/services/messaging/tunnel-protocol.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/tunnel-protocol.js +16 -0
- package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.d.ts +39 -0
- package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.js +56 -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/app/del.command.d.ts +14 -0
- package/dist/src/presentation/cli/commands/app/del.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/app/del.command.js +58 -0
- package/dist/src/presentation/cli/commands/app/index.d.ts +20 -0
- package/dist/src/presentation/cli/commands/app/index.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/app/index.js +33 -0
- package/dist/src/presentation/cli/commands/app/ls.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/app/ls.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/app/ls.command.js +74 -0
- package/dist/src/presentation/cli/commands/app/new.command.d.ts +17 -0
- package/dist/src/presentation/cli/commands/app/new.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/app/new.command.js +58 -0
- package/dist/src/presentation/cli/commands/app/resolve-application.d.ts +10 -0
- package/dist/src/presentation/cli/commands/app/resolve-application.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/app/resolve-application.js +33 -0
- package/dist/src/presentation/cli/commands/app/show.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/app/show.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/app/show.command.js +95 -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 +187 -0
- package/dist/src/presentation/cli/index.js +2 -0
- package/dist/src/presentation/web/app/actions/messaging.d.ts +29 -0
- package/dist/src/presentation/web/app/actions/messaging.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/messaging.js +55 -0
- package/dist/src/presentation/web/components/features/settings/messaging-settings-section.d.ts +6 -0
- package/dist/src/presentation/web/components/features/settings/messaging-settings-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/messaging-settings-section.js +206 -0
- package/dist/src/presentation/web/components/features/settings/messaging-settings-section.stories.d.ts +17 -0
- package/dist/src/presentation/web/components/features/settings/messaging-settings-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/messaging-settings-section.stories.js +55 -0
- package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.js +9 -2
- package/dist/src/presentation/web/dev-server.js +27 -0
- package/dist/translations/ar/cli.json +63 -0
- package/dist/translations/ar/web.json +2 -1
- package/dist/translations/de/cli.json +63 -0
- package/dist/translations/de/web.json +2 -1
- package/dist/translations/en/cli.json +63 -0
- package/dist/translations/en/web.json +13 -12
- package/dist/translations/es/cli.json +63 -0
- package/dist/translations/es/web.json +2 -1
- package/dist/translations/fr/cli.json +63 -0
- package/dist/translations/fr/web.json +2 -1
- package/dist/translations/he/cli.json +63 -0
- package/dist/translations/he/web.json +2 -1
- package/dist/translations/pt/cli.json +63 -0
- package/dist/translations/pt/web.json +2 -1
- package/dist/translations/ru/cli.json +63 -0
- package/dist/translations/ru/web.json +2 -1
- package/dist/translations/uk/cli.json +63 -0
- package/dist/translations/uk/web.json +2 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -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 +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +32 -32
- 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 +30 -30
- 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 +33 -33
- 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 +41 -41
- 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 +41 -41
- 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 +31 -31
- 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 +31 -31
- 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 +30 -30
- 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 +33 -33
- 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 +41 -41
- 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 +41 -41
- 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 +30 -30
- 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 +31 -31
- 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 +31 -31
- 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 +7 -7
- 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/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/application/[id]/page/server-reference-manifest.json +15 -15
- package/web/.next/server/app/application/[id]/page.js.nft.json +1 -1
- package/web/.next/server/app/application/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/features/page/server-reference-manifest.json +7 -7
- package/web/.next/server/app/features/page.js.nft.json +1 -1
- package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +65 -20
- package/web/.next/server/app/settings/page.js +1 -1
- 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 +15 -15
- 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 +13 -13
- 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 +7 -7
- 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]__b2a4bfcc._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__b2a4bfcc._.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/{7f428_lucide-react_dist_esm_icons_5da25833._.js → 7f428_lucide-react_dist_esm_icons_469d51b7._.js} +2 -2
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_469d51b7._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__013a0318._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__013a0318._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17dadd08._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17dadd08._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1925bef0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1a9687c4._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1a9687c4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24756fa9._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24756fa9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__42d066e1._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__42d066e1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4ee8be85._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__70986695._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__70986695._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a5ea76a6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a5ea76a6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dd3e834e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dd3e834e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e265da61._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f3ca7bea._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f3ca7bea._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__bb391c45._.js → [root-of-the-server]__f4f07ee6._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f4f07ee6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0277d3b5._.js +1 -1
- package/web/.next/server/chunks/ssr/_0277d3b5._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_96718a00._.js → _1a4c514f._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_96718a00._.js.map → _1a4c514f._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_948d3cc6._.js → _33bab16e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_948d3cc6._.js.map → _33bab16e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.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/{_ff6f3257._.js → _5d41b1f7._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ff6f3257._.js.map → _5d41b1f7._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_708a9069._.js +3 -0
- package/web/.next/server/chunks/ssr/_708a9069._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_9df33116._.js → _81197d1b._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_9df33116._.js.map → _81197d1b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_295fffde._.js → _86bb5eb1._.js} +6 -2
- package/web/.next/server/chunks/ssr/_86bb5eb1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_946a7fc6._.js +1 -1
- package/web/.next/server/chunks/ssr/_946a7fc6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_bad61758._.js +3 -0
- package/web/.next/server/chunks/ssr/_bad61758._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_ee88b448._.js → _ce70bfa0._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ee88b448._.js.map → _ce70bfa0._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_d7d82308._.js +3 -0
- package/web/.next/server/chunks/ssr/_d7d82308._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_dd852eae._.js +3 -0
- package/web/.next/server/chunks/ssr/_dd852eae._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_eff1b518._.js +1 -1
- package/web/.next/server/chunks/ssr/_eff1b518._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f227429a._.js +1 -1
- package/web/.next/server/chunks/ssr/_f227429a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f6b812ec._.js +9 -0
- package/web/.next/server/chunks/ssr/_f6b812ec._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_f86fc1bf._.js +1 -1
- package/web/.next/server/chunks/ssr/_f86fc1bf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f8c55130._.js +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/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_64cc95e9._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_64cc95e9._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_36f2bc45._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_36f2bc45._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_486908de._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_486908de._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5c3596bc._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5c3596bc._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6326f81e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6326f81e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6b2fdcd8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6b2fdcd8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_74703c9f._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_74703c9f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_a8056dac._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_a8056dac._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +3 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b00bfb08._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b00bfb08._.js.map +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_common_base-drawer_base-drawer_tsx_97dfbbc8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.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/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_f1edcf5e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_f1edcf5e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_f9436804._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_f9436804._.js.map +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.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 +109 -64
- package/web/.next/static/chunks/0239d68df2738a2a.js +1 -0
- package/web/.next/static/chunks/{b17c2d874c373d4e.js → 05d641009a42e94b.js} +1 -1
- package/web/.next/static/chunks/{ee9a716c6424ff25.js → 0d04391861f2a381.js} +1 -1
- package/web/.next/static/chunks/{2a64d4b1a285fac5.js → 151d16c2c65a4356.js} +1 -1
- package/web/.next/static/chunks/19008d82be3a09a5.js +5 -0
- package/web/.next/static/chunks/{f7a55ba1f789c55f.js → 193d8b761fec697e.js} +1 -1
- package/web/.next/static/chunks/2bad6607c1e0f153.js +7 -0
- package/web/.next/static/chunks/{7c3fe3c694874dea.js → 32940aa08b947f66.js} +1 -1
- package/web/.next/static/chunks/{0a67d6e50e27452e.js → 368809962c4cd597.js} +1 -1
- package/web/.next/static/chunks/{8f783e12274578c2.js → 475e5bd4e8bafc6f.js} +1 -1
- package/web/.next/static/chunks/{c1559152cf2ab9c6.js → 55e59f912fff1858.js} +1 -1
- package/web/.next/static/chunks/{fcf27468f8026dbd.js → 66d72ca561bb91ca.js} +1 -1
- package/web/.next/static/chunks/6da04daaac881f27.js +1 -0
- package/web/.next/static/chunks/{2fe20598e1b4793a.js → 75eb5f94364a44bf.js} +2 -2
- package/web/.next/static/chunks/{e8444bf5f6c35f8b.js → 7bbe49d9daedd94d.js} +5 -1
- package/web/.next/static/chunks/{3ee4449e73eb4917.js → 83ea5b5b0d0a8477.js} +1 -1
- package/web/.next/static/chunks/8fe70d4e73e1fe31.css +1 -0
- package/web/.next/static/chunks/9d70c74c84d24724.js +1 -0
- package/web/.next/static/chunks/{010215070d22b4e6.js → a6d8276c88451abf.js} +2 -2
- package/web/.next/static/chunks/b3fa9a303332e7d6.js +3 -0
- package/web/.next/static/chunks/b9b3a6d83e07b213.js +1 -0
- package/web/.next/static/chunks/c92bc820f657f9d9.js +1 -0
- package/web/.next/static/chunks/dd5ab4e1762b5812.js +1 -0
- package/web/.next/static/chunks/{2ddda685a9100fd8.js → e7b870347bdfe35d.js} +1 -1
- package/web/.next/static/chunks/ecafea5bc026ed41.js +1 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_5da25833._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a6f2b763._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a6f2b763._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bb391c45._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_295fffde._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_44531b76._.js +0 -9
- package/web/.next/server/chunks/ssr/_44531b76._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_5bf2415e._.js +0 -7
- package/web/.next/server/chunks/ssr/_5bf2415e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_869a3a15._.js +0 -3
- package/web/.next/server/chunks/ssr/_869a3a15._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_b227ff50._.js +0 -3
- package/web/.next/server/chunks/ssr/_b227ff50._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_e071ba48._.js +0 -3
- package/web/.next/server/chunks/ssr/_e071ba48._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_747b43ac._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_747b43ac._.js.map +0 -1
- package/web/.next/static/chunks/06b9d6dbf635c370.css +0 -1
- package/web/.next/static/chunks/1ae0cf5be30ef398.js +0 -1
- package/web/.next/static/chunks/6ecbcce796343f44.js +0 -1
- package/web/.next/static/chunks/8492d8e0b5f9a4e8.js +0 -1
- package/web/.next/static/chunks/927442d2628f6e22.js +0 -1
- package/web/.next/static/chunks/9370d114ce5b69fb.js +0 -7
- package/web/.next/static/chunks/b2a010b2ba8710f4.js +0 -1
- package/web/.next/static/chunks/b99506a6f7bc2fa8.js +0 -1
- package/web/.next/static/chunks/d2182843a406b5a7.js +0 -5
- package/web/.next/static/chunks/edf812d5efffa096.js +0 -7
- /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → Rb8tiiSfY1LEpEkuZLtTr}/_buildManifest.js +0 -0
- /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → Rb8tiiSfY1LEpEkuZLtTr}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → Rb8tiiSfY1LEpEkuZLtTr}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
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
|
+
const TELEGRAM_API_BASE = 'https://api.telegram.org';
|
|
21
|
+
let HttpTelegramClient = class HttpTelegramClient {
|
|
22
|
+
fetchImpl;
|
|
23
|
+
constructor(fetchImpl = fetch) {
|
|
24
|
+
this.fetchImpl = fetchImpl;
|
|
25
|
+
}
|
|
26
|
+
async sendMessage(input) {
|
|
27
|
+
if (!input.botToken)
|
|
28
|
+
throw new Error('Telegram botToken is required');
|
|
29
|
+
if (!input.chatId)
|
|
30
|
+
throw new Error('Telegram chatId is required');
|
|
31
|
+
const url = `${TELEGRAM_API_BASE}/bot${input.botToken}/sendMessage`;
|
|
32
|
+
const body = {
|
|
33
|
+
chat_id: input.chatId,
|
|
34
|
+
text: input.text,
|
|
35
|
+
};
|
|
36
|
+
if (input.parseMode)
|
|
37
|
+
body.parse_mode = input.parseMode;
|
|
38
|
+
const response = await this.fetchImpl(url, {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
headers: { 'content-type': 'application/json' },
|
|
41
|
+
body: JSON.stringify(body),
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
let detail = '';
|
|
45
|
+
try {
|
|
46
|
+
const json = (await response.json());
|
|
47
|
+
detail = json.description ?? '';
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// ignore
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Telegram sendMessage failed with ${response.status}${detail ? `: ${detail}` : ''}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
HttpTelegramClient = __decorate([
|
|
57
|
+
injectable(),
|
|
58
|
+
__metadata("design:paramtypes", [Function])
|
|
59
|
+
], HttpTelegramClient);
|
|
60
|
+
export { HttpTelegramClient };
|
package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Tunnel Adapter
|
|
3
|
+
*
|
|
4
|
+
* Manages the WebSocket tunnel connection to the Commands.com Gateway and
|
|
5
|
+
* translates its binary/text frames into a presentation-agnostic callback
|
|
6
|
+
* for the consuming messaging service.
|
|
7
|
+
*
|
|
8
|
+
* Protocol reference:
|
|
9
|
+
* https://github.com/Commands-com/gateway/blob/main/internal/gateway/integrations_tunnel.go
|
|
10
|
+
*
|
|
11
|
+
* Responsibilities:
|
|
12
|
+
* - Open an authenticated WebSocket (Bearer token on the upgrade headers)
|
|
13
|
+
* - Handle tunnel.connected → auto-activate the configured routes
|
|
14
|
+
* - Decode incoming tunnel.request frames and dispatch to `onRequest`
|
|
15
|
+
* - Send tunnel.response frames back with the handler's reply
|
|
16
|
+
* - Reconnect on disconnect with a small delay
|
|
17
|
+
*/
|
|
18
|
+
import WebSocket, { type ClientOptions } from 'ws';
|
|
19
|
+
import type { DecodedTunnelRequest, TunnelRequestResponse } from './tunnel-protocol.js';
|
|
20
|
+
export type TunnelRequestHandler = (request: DecodedTunnelRequest) => Promise<TunnelRequestResponse>;
|
|
21
|
+
/** Factory allowing tests to substitute an in-memory transport. */
|
|
22
|
+
export type WebSocketFactory = (url: string, options: ClientOptions) => WebSocket;
|
|
23
|
+
export interface MessagingTunnelAdapterDeps {
|
|
24
|
+
gatewayUrl: string;
|
|
25
|
+
accessToken: string;
|
|
26
|
+
deviceId: string;
|
|
27
|
+
/** Route IDs to claim after tunnel.connected arrives. */
|
|
28
|
+
routeIds: string[];
|
|
29
|
+
webSocketFactory?: WebSocketFactory;
|
|
30
|
+
}
|
|
31
|
+
export declare class MessagingTunnelAdapter {
|
|
32
|
+
private readonly deps;
|
|
33
|
+
private ws;
|
|
34
|
+
private requestHandler;
|
|
35
|
+
private pingTimer;
|
|
36
|
+
private reconnectTimer;
|
|
37
|
+
private connected;
|
|
38
|
+
private stopping;
|
|
39
|
+
private readonly activatedRoutes;
|
|
40
|
+
private readonly factory;
|
|
41
|
+
constructor(deps: MessagingTunnelAdapterDeps);
|
|
42
|
+
/** Register a handler for inbound tunnel.request frames. */
|
|
43
|
+
onRequest(handler: TunnelRequestHandler): void;
|
|
44
|
+
/** Whether the WebSocket tunnel is currently open. */
|
|
45
|
+
isConnected(): boolean;
|
|
46
|
+
/** Whether the given route has been activated on the tunnel. */
|
|
47
|
+
isRouteActivated(routeId: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Open the tunnel and resolve once the server has emitted tunnel.connected.
|
|
50
|
+
* Reconnects are silent (fire-and-forget).
|
|
51
|
+
*/
|
|
52
|
+
connect(): Promise<void>;
|
|
53
|
+
/** Close the tunnel permanently (no auto-reconnect). */
|
|
54
|
+
disconnect(): Promise<void>;
|
|
55
|
+
private handleRawFrame;
|
|
56
|
+
private handleConnected;
|
|
57
|
+
private handleActivateResult;
|
|
58
|
+
private handleRouteDeactivated;
|
|
59
|
+
private handleProtocolError;
|
|
60
|
+
private handleRequest;
|
|
61
|
+
private sendFrame;
|
|
62
|
+
private handleClose;
|
|
63
|
+
private startPing;
|
|
64
|
+
private stopPing;
|
|
65
|
+
private scheduleReconnect;
|
|
66
|
+
private clearReconnect;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=messaging-tunnel.adapter.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging-tunnel.adapter.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/messaging-tunnel.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,SAAS,EAAE,EAAE,KAAK,aAAa,EAAgB,MAAM,IAAI,CAAC;AACjE,OAAO,KAAK,EACV,oBAAoB,EAOpB,qBAAqB,EAGtB,MAAM,sBAAsB,CAAC;AAK9B,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,oBAAoB,KAC1B,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,mEAAmE;AACnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,KAAK,SAAS,CAAC;AAIlF,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAwBD,qBAAa,sBAAsB;IAUrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IATjC,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,cAAc,CAAqC;IAC3D,OAAO,CAAC,SAAS,CAA+C;IAChE,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;gBAEd,IAAI,EAAE,0BAA0B;IAI7D,4DAA4D;IAC5D,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAI9C,sDAAsD;IACtD,WAAW,IAAI,OAAO;IAItB,gEAAgE;IAChE,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI1C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC9B,wDAAwD;IAClD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAiBnB,cAAc;IA+B5B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,mBAAmB;YAIb,aAAa;IAmC3B,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Tunnel Adapter
|
|
3
|
+
*
|
|
4
|
+
* Manages the WebSocket tunnel connection to the Commands.com Gateway and
|
|
5
|
+
* translates its binary/text frames into a presentation-agnostic callback
|
|
6
|
+
* for the consuming messaging service.
|
|
7
|
+
*
|
|
8
|
+
* Protocol reference:
|
|
9
|
+
* https://github.com/Commands-com/gateway/blob/main/internal/gateway/integrations_tunnel.go
|
|
10
|
+
*
|
|
11
|
+
* Responsibilities:
|
|
12
|
+
* - Open an authenticated WebSocket (Bearer token on the upgrade headers)
|
|
13
|
+
* - Handle tunnel.connected → auto-activate the configured routes
|
|
14
|
+
* - Decode incoming tunnel.request frames and dispatch to `onRequest`
|
|
15
|
+
* - Send tunnel.response frames back with the handler's reply
|
|
16
|
+
* - Reconnect on disconnect with a small delay
|
|
17
|
+
*/
|
|
18
|
+
import WebSocket from 'ws';
|
|
19
|
+
const RECONNECT_DELAY_MS = 5_000;
|
|
20
|
+
const PING_INTERVAL_MS = 25_000;
|
|
21
|
+
const defaultFactory = (url, options) => new WebSocket(url, options);
|
|
22
|
+
function headersArrayToRecord(pairs) {
|
|
23
|
+
if (!pairs)
|
|
24
|
+
return {};
|
|
25
|
+
const out = {};
|
|
26
|
+
for (const [k, v] of pairs) {
|
|
27
|
+
out[k.toLowerCase()] = v;
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
function headersRecordToArray(record) {
|
|
32
|
+
if (!record)
|
|
33
|
+
return undefined;
|
|
34
|
+
return Object.entries(record);
|
|
35
|
+
}
|
|
36
|
+
function base64Encode(s) {
|
|
37
|
+
return Buffer.from(s, 'utf8').toString('base64');
|
|
38
|
+
}
|
|
39
|
+
function base64Decode(b64) {
|
|
40
|
+
return Buffer.from(b64, 'base64').toString('utf8');
|
|
41
|
+
}
|
|
42
|
+
export class MessagingTunnelAdapter {
|
|
43
|
+
deps;
|
|
44
|
+
ws = null;
|
|
45
|
+
requestHandler = null;
|
|
46
|
+
pingTimer = null;
|
|
47
|
+
reconnectTimer = null;
|
|
48
|
+
connected = false;
|
|
49
|
+
stopping = false;
|
|
50
|
+
activatedRoutes = new Set();
|
|
51
|
+
factory;
|
|
52
|
+
constructor(deps) {
|
|
53
|
+
this.deps = deps;
|
|
54
|
+
this.factory = deps.webSocketFactory ?? defaultFactory;
|
|
55
|
+
}
|
|
56
|
+
/** Register a handler for inbound tunnel.request frames. */
|
|
57
|
+
onRequest(handler) {
|
|
58
|
+
this.requestHandler = handler;
|
|
59
|
+
}
|
|
60
|
+
/** Whether the WebSocket tunnel is currently open. */
|
|
61
|
+
isConnected() {
|
|
62
|
+
return this.connected;
|
|
63
|
+
}
|
|
64
|
+
/** Whether the given route has been activated on the tunnel. */
|
|
65
|
+
isRouteActivated(routeId) {
|
|
66
|
+
return this.activatedRoutes.has(routeId);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Open the tunnel and resolve once the server has emitted tunnel.connected.
|
|
70
|
+
* Reconnects are silent (fire-and-forget).
|
|
71
|
+
*/
|
|
72
|
+
async connect() {
|
|
73
|
+
if (this.connected || this.stopping)
|
|
74
|
+
return;
|
|
75
|
+
const base = this.deps.gatewayUrl.replace(/^http/, 'ws').replace(/\/$/, '');
|
|
76
|
+
const url = `${base}/gateway/v1/integrations/tunnel/connect?device_id=${encodeURIComponent(this.deps.deviceId)}`;
|
|
77
|
+
const ws = this.factory(url, {
|
|
78
|
+
headers: { authorization: `Bearer ${this.deps.accessToken}` },
|
|
79
|
+
});
|
|
80
|
+
this.ws = ws;
|
|
81
|
+
await new Promise((resolve, reject) => {
|
|
82
|
+
const onceOpen = () => {
|
|
83
|
+
ws.off('error', onceError);
|
|
84
|
+
resolve();
|
|
85
|
+
};
|
|
86
|
+
const onceError = (err) => {
|
|
87
|
+
ws.off('open', onceOpen);
|
|
88
|
+
reject(err);
|
|
89
|
+
};
|
|
90
|
+
ws.once('open', onceOpen);
|
|
91
|
+
ws.once('error', onceError);
|
|
92
|
+
});
|
|
93
|
+
ws.on('message', (data) => {
|
|
94
|
+
this.handleRawFrame(data).catch(() => {
|
|
95
|
+
// Malformed frames are non-fatal.
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
ws.on('close', () => this.handleClose());
|
|
99
|
+
ws.on('error', () => {
|
|
100
|
+
// Errors also trigger close; avoid duplicate handling.
|
|
101
|
+
});
|
|
102
|
+
this.connected = true;
|
|
103
|
+
this.startPing();
|
|
104
|
+
}
|
|
105
|
+
/** Close the tunnel permanently (no auto-reconnect). */
|
|
106
|
+
async disconnect() {
|
|
107
|
+
this.stopping = true;
|
|
108
|
+
this.stopPing();
|
|
109
|
+
this.clearReconnect();
|
|
110
|
+
this.activatedRoutes.clear();
|
|
111
|
+
if (this.ws) {
|
|
112
|
+
try {
|
|
113
|
+
this.ws.close();
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// ignore
|
|
117
|
+
}
|
|
118
|
+
this.ws = null;
|
|
119
|
+
}
|
|
120
|
+
this.connected = false;
|
|
121
|
+
}
|
|
122
|
+
async handleRawFrame(data) {
|
|
123
|
+
const raw = typeof data === 'string' ? data : data.toString('utf8');
|
|
124
|
+
let frame;
|
|
125
|
+
try {
|
|
126
|
+
frame = JSON.parse(raw);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
switch (frame.type) {
|
|
132
|
+
case 'tunnel.connected':
|
|
133
|
+
this.handleConnected(frame);
|
|
134
|
+
return;
|
|
135
|
+
case 'tunnel.activate.result':
|
|
136
|
+
this.handleActivateResult(frame);
|
|
137
|
+
return;
|
|
138
|
+
case 'tunnel.request':
|
|
139
|
+
await this.handleRequest(frame);
|
|
140
|
+
return;
|
|
141
|
+
case 'tunnel.route_deactivated':
|
|
142
|
+
this.handleRouteDeactivated(frame);
|
|
143
|
+
return;
|
|
144
|
+
case 'tunnel.error':
|
|
145
|
+
this.handleProtocolError(frame);
|
|
146
|
+
return;
|
|
147
|
+
default:
|
|
148
|
+
// Unknown frame — silently drop per gateway forward-compat policy.
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
handleConnected(_frame) {
|
|
153
|
+
// Auto-activate every configured route. The gateway expects a single
|
|
154
|
+
// batched frame with a `routes` array — sending one-at-a-time with
|
|
155
|
+
// `route_id` is silently ignored.
|
|
156
|
+
if (this.deps.routeIds.length === 0)
|
|
157
|
+
return;
|
|
158
|
+
this.sendFrame({
|
|
159
|
+
type: 'tunnel.activate',
|
|
160
|
+
routes: [...this.deps.routeIds],
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
handleActivateResult(frame) {
|
|
164
|
+
// Gateway returns "active" for newly-activated routes. Treat any
|
|
165
|
+
// non-rejected status as success to be forward-compatible.
|
|
166
|
+
for (const entry of frame.results ?? []) {
|
|
167
|
+
if (entry.status && entry.status !== 'rejected') {
|
|
168
|
+
this.activatedRoutes.add(entry.route_id);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
handleRouteDeactivated(frame) {
|
|
173
|
+
this.activatedRoutes.delete(frame.route_id);
|
|
174
|
+
}
|
|
175
|
+
handleProtocolError(_frame) {
|
|
176
|
+
// No-op — recoverable errors are surfaced through reconnection.
|
|
177
|
+
}
|
|
178
|
+
async handleRequest(frame) {
|
|
179
|
+
if (!this.requestHandler) {
|
|
180
|
+
this.sendFrame({
|
|
181
|
+
type: 'tunnel.response',
|
|
182
|
+
request_id: frame.request_id,
|
|
183
|
+
status: 503,
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const decoded = {
|
|
188
|
+
requestId: frame.request_id,
|
|
189
|
+
routeId: frame.route_id,
|
|
190
|
+
method: frame.method,
|
|
191
|
+
path: frame.path,
|
|
192
|
+
headers: headersArrayToRecord(frame.headers),
|
|
193
|
+
body: frame.body_base64 ? base64Decode(frame.body_base64) : '',
|
|
194
|
+
};
|
|
195
|
+
let response;
|
|
196
|
+
try {
|
|
197
|
+
response = await this.requestHandler(decoded);
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
response = { status: 500 };
|
|
201
|
+
}
|
|
202
|
+
this.sendFrame({
|
|
203
|
+
type: 'tunnel.response',
|
|
204
|
+
request_id: frame.request_id,
|
|
205
|
+
status: response.status,
|
|
206
|
+
headers: headersRecordToArray(response.headers),
|
|
207
|
+
body_base64: response.body ? base64Encode(response.body) : undefined,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
sendFrame(frame) {
|
|
211
|
+
if (this.ws?.readyState !== WebSocket.OPEN)
|
|
212
|
+
return;
|
|
213
|
+
try {
|
|
214
|
+
this.ws.send(JSON.stringify(frame));
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
// ignore — close handler will reconnect
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
handleClose() {
|
|
221
|
+
this.connected = false;
|
|
222
|
+
this.activatedRoutes.clear();
|
|
223
|
+
this.stopPing();
|
|
224
|
+
if (!this.stopping) {
|
|
225
|
+
this.scheduleReconnect();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
startPing() {
|
|
229
|
+
this.pingTimer = setInterval(() => {
|
|
230
|
+
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
231
|
+
try {
|
|
232
|
+
this.ws.ping();
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// ignore
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}, PING_INTERVAL_MS);
|
|
239
|
+
this.pingTimer.unref?.();
|
|
240
|
+
}
|
|
241
|
+
stopPing() {
|
|
242
|
+
if (this.pingTimer) {
|
|
243
|
+
clearInterval(this.pingTimer);
|
|
244
|
+
this.pingTimer = null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
scheduleReconnect() {
|
|
248
|
+
this.clearReconnect();
|
|
249
|
+
this.reconnectTimer = setTimeout(() => {
|
|
250
|
+
this.connect().catch(() => {
|
|
251
|
+
// Will retry on the next close event.
|
|
252
|
+
});
|
|
253
|
+
}, RECONNECT_DELAY_MS);
|
|
254
|
+
this.reconnectTimer.unref?.();
|
|
255
|
+
}
|
|
256
|
+
clearReconnect() {
|
|
257
|
+
if (this.reconnectTimer) {
|
|
258
|
+
clearTimeout(this.reconnectTimer);
|
|
259
|
+
this.reconnectTimer = null;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messaging Service
|
|
3
|
+
*
|
|
4
|
+
* Core orchestrator for the external messaging remote control feature.
|
|
5
|
+
* Wires together:
|
|
6
|
+
* - Commands.com Gateway tunnel (inbound webhook delivery)
|
|
7
|
+
* - Telegram Bot API client (outbound replies + notifications)
|
|
8
|
+
* - Command executor (parses slash commands, runs use cases)
|
|
9
|
+
* - Notification emitter (debounced forwarding from the local event bus)
|
|
10
|
+
* - Chat relay (interactive agent ↔ messenger bridge)
|
|
11
|
+
* - Pairing auto-confirm (matches /pair <code> against pending codes)
|
|
12
|
+
*
|
|
13
|
+
* Lifecycle:
|
|
14
|
+
* 1. `isConfigured()` checks settings for required fields.
|
|
15
|
+
* 2. `start()` opens the tunnel and subscribes to the notification bus.
|
|
16
|
+
* 3. Inbound `tunnel.request` frames are parsed as Telegram Update objects
|
|
17
|
+
* and dispatched to either the pair confirm flow or the command executor.
|
|
18
|
+
* 4. `stop()` tears everything down.
|
|
19
|
+
*/
|
|
20
|
+
import type { IMessagingService } from '../../../application/ports/output/services/messaging-service.interface.js';
|
|
21
|
+
import type { MessagingNotification, MessagingConfig } from '../../../domain/generated/output.js';
|
|
22
|
+
import type { NotificationBus } from '../notifications/notification-bus.js';
|
|
23
|
+
import type { IFeatureRepository } from '../../../application/ports/output/repositories/feature-repository.interface.js';
|
|
24
|
+
import type { ListFeaturesUseCase } from '../../../application/use-cases/features/list-features.use-case.js';
|
|
25
|
+
import type { ShowFeatureUseCase } from '../../../application/use-cases/features/show-feature.use-case.js';
|
|
26
|
+
import type { CreateFeatureUseCase } from '../../../application/use-cases/features/create/create-feature.use-case.js';
|
|
27
|
+
import type { ApproveAgentRunUseCase } from '../../../application/use-cases/agents/approve-agent-run.use-case.js';
|
|
28
|
+
import type { RejectAgentRunUseCase } from '../../../application/use-cases/agents/reject-agent-run.use-case.js';
|
|
29
|
+
import type { StopAgentRunUseCase } from '../../../application/use-cases/agents/stop-agent-run.use-case.js';
|
|
30
|
+
import type { ResumeFeatureUseCase } from '../../../application/use-cases/features/resume-feature.use-case.js';
|
|
31
|
+
import type { ListRepositoriesUseCase } from '../../../application/use-cases/repositories/list-repositories.use-case.js';
|
|
32
|
+
import type { ConfirmMessagingPairingUseCase } from '../../../application/use-cases/messaging/confirm-pairing.use-case.js';
|
|
33
|
+
import type { ITelegramClient } from '../../../application/ports/output/services/telegram-client.interface.js';
|
|
34
|
+
import type { IInteractiveSessionService } from '../../../application/ports/output/services/interactive-session-service.interface.js';
|
|
35
|
+
interface MessagingServiceDeps {
|
|
36
|
+
config: MessagingConfig;
|
|
37
|
+
accessToken: string;
|
|
38
|
+
telegramClient: ITelegramClient;
|
|
39
|
+
/** Bot token the sender will use to reply to Telegram users. */
|
|
40
|
+
telegramBotToken?: string;
|
|
41
|
+
notificationBus: NotificationBus;
|
|
42
|
+
featureRepo: IFeatureRepository;
|
|
43
|
+
createFeature: CreateFeatureUseCase;
|
|
44
|
+
approveAgentRun: ApproveAgentRunUseCase;
|
|
45
|
+
rejectAgentRun: RejectAgentRunUseCase;
|
|
46
|
+
stopAgentRun: StopAgentRunUseCase;
|
|
47
|
+
resumeFeature: ResumeFeatureUseCase;
|
|
48
|
+
listFeatures: ListFeaturesUseCase;
|
|
49
|
+
showFeature: ShowFeatureUseCase;
|
|
50
|
+
listRepositories: ListRepositoriesUseCase;
|
|
51
|
+
confirmPairing: ConfirmMessagingPairingUseCase;
|
|
52
|
+
interactiveSessionService: IInteractiveSessionService;
|
|
53
|
+
}
|
|
54
|
+
export declare class MessagingService implements IMessagingService {
|
|
55
|
+
private readonly deps;
|
|
56
|
+
private tunnelAdapter;
|
|
57
|
+
private commandExecutor;
|
|
58
|
+
private notificationEmitter;
|
|
59
|
+
private chatRelay;
|
|
60
|
+
private sender;
|
|
61
|
+
private started;
|
|
62
|
+
constructor(deps: MessagingServiceDeps);
|
|
63
|
+
isConfigured(): boolean;
|
|
64
|
+
isConnected(): boolean;
|
|
65
|
+
start(): Promise<void>;
|
|
66
|
+
stop(): Promise<void>;
|
|
67
|
+
sendNotification(notification: MessagingNotification): Promise<void>;
|
|
68
|
+
private collectRouteIds;
|
|
69
|
+
private handleTunnelRequest;
|
|
70
|
+
private handleChatStart;
|
|
71
|
+
private handleChatEnd;
|
|
72
|
+
private handleChatMessage;
|
|
73
|
+
private platformForRoute;
|
|
74
|
+
private handlePairConfirm;
|
|
75
|
+
private sendReply;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=messaging.service.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2EAA2E,CAAC;AACnH,OAAO,KAAK,EAEV,qBAAqB,EACrB,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAa7C,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;AACzH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,sEAAsE,CAAC;AAC3H,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAC/G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qFAAqF,CAAC;AAGtI,UAAU,oBAAoB;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,eAAe,CAAC;IAChC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,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;IAC1C,cAAc,EAAE,8BAA8B,CAAC;IAC/C,yBAAyB,EAAE,0BAA0B,CAAC;CACvD;AAmCD,qBAAa,gBAAiB,YAAW,iBAAiB;IAQ5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPjC,OAAO,CAAC,aAAa,CAAuC;IAC5D,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,mBAAmB,CAA6C;IACxE,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,OAAO,CAAS;gBAEK,IAAI,EAAE,oBAAoB;IAEvD,YAAY,IAAI,OAAO;IAgBvB,WAAW,IAAI,OAAO;IAIhB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoDtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAerB,gBAAgB,CAAC,YAAY,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E,OAAO,CAAC,eAAe;YAQT,mBAAmB;YAiEnB,eAAe;YAgDf,aAAa;YAMb,iBAAiB;IAa/B,OAAO,CAAC,gBAAgB;YAOV,iBAAiB;YAyBjB,SAAS;CASxB"}
|