@shepai/cli 1.181.0 → 1.182.0-pr512.369be8e
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/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 +3 -3
- package/web/.next/required-server-files.json +3 -3
- 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/{_da028026._.js → _1c03437e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_da028026._.js.map → _1c03437e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_655cc4fd._.js → _49838974._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_655cc4fd._.js.map → _49838974._.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/_708a9069._.js +3 -0
- package/web/.next/server/chunks/ssr/_708a9069._.js.map +1 -0
- 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/{_fbf4db9c._.js → _b6df235f._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_fbf4db9c._.js.map → _b6df235f._.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/{_e5753970._.js → _c5357cf5._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_e5753970._.js.map → _c5357cf5._.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/{_5bb39227._.js → _fa95e517._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5bb39227._.js.map → _fa95e517._.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/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +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_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/{b40755bc75789277.js → 101e7888c4b7e328.js} +1 -1
- package/web/.next/static/chunks/{53f9385d4a447ad4.js → 18fa374b1b856687.js} +2 -2
- package/web/.next/static/chunks/{7c3fe3c694874dea.js → 32940aa08b947f66.js} +1 -1
- package/web/.next/static/chunks/{ae94e98b7163890b.js → 42d86b3a628702b0.js} +1 -1
- package/web/.next/static/chunks/6da04daaac881f27.js +1 -0
- package/web/.next/static/chunks/6f9ba92ee19bcbd7.js +5 -0
- package/web/.next/static/chunks/{25bbd99fa3dcc0b2.js → 79a8ec8b8de391f8.js} +1 -1
- package/web/.next/static/chunks/{e8444bf5f6c35f8b.js → 7bbe49d9daedd94d.js} +5 -1
- package/web/.next/static/chunks/{d8e96baa3feb79cb.js → 7e0cb9a6e06f075f.js} +1 -1
- package/web/.next/static/chunks/87b197ebd301232a.js +3 -0
- package/web/.next/static/chunks/8fe70d4e73e1fe31.css +1 -0
- package/web/.next/static/chunks/{6ad23a3ac827b65b.js → b3051a00d29f0f0f.js} +1 -1
- package/web/.next/static/chunks/b6b07ccbccda00e2.js +7 -0
- package/web/.next/static/chunks/b9b3a6d83e07b213.js +1 -0
- package/web/.next/static/chunks/c92bc820f657f9d9.js +1 -0
- package/web/.next/static/chunks/{e11508a76f5fca98.js → d436ca26f19e7c42.js} +1 -1
- package/web/.next/static/chunks/{5635fe220632fced.js → d8505faa90c97f2b.js} +1 -1
- package/web/.next/static/chunks/{d7310881615cb55b.js → e2b0da48f8e15118.js} +1 -1
- package/web/.next/static/chunks/{443c0073e58878d8.js → e3ecbef934b77afa.js} +1 -1
- package/web/.next/static/chunks/{b6ddc3e5f64bef7f.js → e6fc771fc21a0b62.js} +1 -1
- package/web/.next/static/chunks/ecafea5bc026ed41.js +1 -0
- package/web/.next/static/chunks/{fe29d30a75e697ed.js → f28fa2d7fa19eee6.js} +1 -1
- package/web/.next/static/chunks/f79d32f56056c680.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/15951ad67a810e2c.js +0 -5
- package/web/.next/static/chunks/1ae0cf5be30ef398.js +0 -1
- package/web/.next/static/chunks/7a9d8b705c0f8d2d.js +0 -7
- package/web/.next/static/chunks/8492d8e0b5f9a4e8.js +0 -1
- package/web/.next/static/chunks/927442d2628f6e22.js +0 -1
- package/web/.next/static/chunks/b99506a6f7bc2fa8.js +0 -1
- package/web/.next/static/chunks/be165be5db7a6054.js +0 -7
- package/web/.next/static/chunks/e65f14d14ad46a32.js +0 -1
- /package/web/.next/static/{_PzlF7w3QzhaBsMnhT75_ → i04ZwSXpTvkppxSePII4p}/_buildManifest.js +0 -0
- /package/web/.next/static/{_PzlF7w3QzhaBsMnhT75_ → i04ZwSXpTvkppxSePII4p}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{_PzlF7w3QzhaBsMnhT75_ → i04ZwSXpTvkppxSePII4p}/_ssgManifest.js +0 -0
|
@@ -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
|
+
sender;
|
|
21
|
+
notificationBus;
|
|
22
|
+
debounceMs;
|
|
23
|
+
debounceTimers = new Map();
|
|
24
|
+
listening = false;
|
|
25
|
+
handler = null;
|
|
26
|
+
constructor(sender, notificationBus, debounceMs = DEFAULT_DEBOUNCE_MS) {
|
|
27
|
+
this.sender = sender;
|
|
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
|
+
void this.sender.send(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
|
+
void this.sender.send(notification);
|
|
74
|
+
this.debounceTimers.delete(key);
|
|
75
|
+
}, this.debounceMs);
|
|
76
|
+
timer.unref();
|
|
77
|
+
this.debounceTimers.set(key, timer);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub Gateway Client
|
|
3
|
+
*
|
|
4
|
+
* Returns deterministic fake responses for E2E tests where no real
|
|
5
|
+
* Commands.com Gateway is available. Activated via SHEP_MOCK_GATEWAY=1.
|
|
6
|
+
*/
|
|
7
|
+
import type { IGatewayClient, FetchTokenInput, GatewayOAuthToken, CreateIntegrationRouteInput, GatewayIntegrationRoute } from '../../../application/ports/output/services/gateway-client.interface.js';
|
|
8
|
+
export declare class StubGatewayClient implements IGatewayClient {
|
|
9
|
+
fetchAccessToken(_input: FetchTokenInput): Promise<GatewayOAuthToken>;
|
|
10
|
+
createIntegrationRoute(gatewayUrl: string, _accessToken: string, input: CreateIntegrationRouteInput): Promise<GatewayIntegrationRoute>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=stub-gateway.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub-gateway.client.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/stub-gateway.client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,wEAAwE,CAAC;AAEhF,qBAAa,iBAAkB,YAAW,cAAc;IAChD,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQrE,sBAAsB,CAC1B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,uBAAuB,CAAC;CAWpC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub Gateway Client
|
|
3
|
+
*
|
|
4
|
+
* Returns deterministic fake responses for E2E tests where no real
|
|
5
|
+
* Commands.com Gateway is available. Activated via SHEP_MOCK_GATEWAY=1.
|
|
6
|
+
*/
|
|
7
|
+
export class StubGatewayClient {
|
|
8
|
+
async fetchAccessToken(_input) {
|
|
9
|
+
return {
|
|
10
|
+
accessToken: 'stub-access-token',
|
|
11
|
+
tokenType: 'Bearer',
|
|
12
|
+
expiresAt: Date.now() + 3600 * 1000,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
async createIntegrationRoute(gatewayUrl, _accessToken, input) {
|
|
16
|
+
const routeId = `stub-route-${input.interfaceType}`;
|
|
17
|
+
const routeToken = `stub-token-${Date.now()}`;
|
|
18
|
+
return {
|
|
19
|
+
routeId,
|
|
20
|
+
routeToken,
|
|
21
|
+
publicUrl: `${gatewayUrl}/integrations/${routeId}/${routeToken}`,
|
|
22
|
+
deviceId: input.deviceId,
|
|
23
|
+
interfaceType: input.interfaceType,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram Message Sender
|
|
3
|
+
*
|
|
4
|
+
* Concrete IMessageSender that delivers notifications to a paired Telegram
|
|
5
|
+
* chat via the Telegram Bot API. Looks up the bot token + chat id from the
|
|
6
|
+
* messaging config on every send so that pairing changes propagate without
|
|
7
|
+
* restarting the daemon.
|
|
8
|
+
*
|
|
9
|
+
* This sender silently no-ops when Telegram is not paired — callers don't
|
|
10
|
+
* need to guard individually.
|
|
11
|
+
*/
|
|
12
|
+
import type { IMessageSender } from '../../../application/ports/output/services/message-sender.interface.js';
|
|
13
|
+
import type { ITelegramClient } from '../../../application/ports/output/services/telegram-client.interface.js';
|
|
14
|
+
import type { MessagingNotification } from '../../../domain/generated/output.js';
|
|
15
|
+
export interface TelegramMessageSenderConfig {
|
|
16
|
+
botToken: string;
|
|
17
|
+
chatId: string;
|
|
18
|
+
}
|
|
19
|
+
export type TelegramConfigResolver = () => TelegramMessageSenderConfig | null;
|
|
20
|
+
export declare class TelegramMessageSender implements IMessageSender {
|
|
21
|
+
private readonly telegramClient;
|
|
22
|
+
private readonly resolveConfig;
|
|
23
|
+
constructor(telegramClient: ITelegramClient, resolveConfig: TelegramConfigResolver);
|
|
24
|
+
send(notification: MessagingNotification): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=telegram-message-sender.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/messaging/telegram-message-sender.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telegram-message-sender.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/telegram-message-sender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wEAAwE,CAAC;AAC7G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAC/G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAEjF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAU9E,qBAAa,qBAAsB,YAAW,cAAc;IAExD,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,cAAc,EAAE,eAAe,EAC/B,aAAa,EAAE,sBAAsB;IAGlD,IAAI,CAAC,YAAY,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAmB/D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram Message Sender
|
|
3
|
+
*
|
|
4
|
+
* Concrete IMessageSender that delivers notifications to a paired Telegram
|
|
5
|
+
* chat via the Telegram Bot API. Looks up the bot token + chat id from the
|
|
6
|
+
* messaging config on every send so that pairing changes propagate without
|
|
7
|
+
* restarting the daemon.
|
|
8
|
+
*
|
|
9
|
+
* This sender silently no-ops when Telegram is not paired — callers don't
|
|
10
|
+
* need to guard individually.
|
|
11
|
+
*/
|
|
12
|
+
function formatNotification(notification) {
|
|
13
|
+
const lines = [];
|
|
14
|
+
if (notification.title)
|
|
15
|
+
lines.push(`*${notification.title}*`);
|
|
16
|
+
if (notification.message)
|
|
17
|
+
lines.push(notification.message);
|
|
18
|
+
if (notification.event && !notification.title)
|
|
19
|
+
lines.push(`[${notification.event}]`);
|
|
20
|
+
return lines.join('\n');
|
|
21
|
+
}
|
|
22
|
+
export class TelegramMessageSender {
|
|
23
|
+
telegramClient;
|
|
24
|
+
resolveConfig;
|
|
25
|
+
constructor(telegramClient, resolveConfig) {
|
|
26
|
+
this.telegramClient = telegramClient;
|
|
27
|
+
this.resolveConfig = resolveConfig;
|
|
28
|
+
}
|
|
29
|
+
async send(notification) {
|
|
30
|
+
const config = this.resolveConfig();
|
|
31
|
+
if (!config?.botToken || !config.chatId)
|
|
32
|
+
return;
|
|
33
|
+
const text = formatNotification(notification);
|
|
34
|
+
if (!text.trim())
|
|
35
|
+
return;
|
|
36
|
+
try {
|
|
37
|
+
await this.telegramClient.sendMessage({
|
|
38
|
+
botToken: config.botToken,
|
|
39
|
+
chatId: config.chatId,
|
|
40
|
+
text,
|
|
41
|
+
parseMode: 'Markdown',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Delivery failures are non-fatal — the daemon keeps running and
|
|
46
|
+
// future notifications will retry on their own cadence.
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram Webhook Parser
|
|
3
|
+
*
|
|
4
|
+
* Converts a raw Telegram `Update` object (posted to our webhook ingress URL)
|
|
5
|
+
* into a domain-level ChatMessage that the messaging service can dispatch.
|
|
6
|
+
*
|
|
7
|
+
* Reference: https://core.telegram.org/bots/api#update
|
|
8
|
+
*
|
|
9
|
+
* We only care about the `message` variant for now — inline queries,
|
|
10
|
+
* callback queries, edited messages, and channel posts are all ignored and
|
|
11
|
+
* return `null`, which causes the tunnel adapter to reply 200 without
|
|
12
|
+
* further side effects.
|
|
13
|
+
*/
|
|
14
|
+
export interface ParsedTelegramMessage {
|
|
15
|
+
chatId: string;
|
|
16
|
+
/** Telegram user ID of the sender. */
|
|
17
|
+
senderId?: string;
|
|
18
|
+
/** Username without leading @. */
|
|
19
|
+
senderUsername?: string;
|
|
20
|
+
text: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseTelegramUpdate(rawBody: string): ParsedTelegramMessage | null;
|
|
23
|
+
export interface PairCommand {
|
|
24
|
+
code: string;
|
|
25
|
+
}
|
|
26
|
+
/** Match `/pair 123456` (with optional `@botname` suffix). */
|
|
27
|
+
export declare function parsePairCommand(text: string): PairCommand | null;
|
|
28
|
+
//# sourceMappingURL=telegram-webhook.parser.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telegram-webhook.parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/telegram-webhook.parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAYD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAuBjF;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAID,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAIjE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram Webhook Parser
|
|
3
|
+
*
|
|
4
|
+
* Converts a raw Telegram `Update` object (posted to our webhook ingress URL)
|
|
5
|
+
* into a domain-level ChatMessage that the messaging service can dispatch.
|
|
6
|
+
*
|
|
7
|
+
* Reference: https://core.telegram.org/bots/api#update
|
|
8
|
+
*
|
|
9
|
+
* We only care about the `message` variant for now — inline queries,
|
|
10
|
+
* callback queries, edited messages, and channel posts are all ignored and
|
|
11
|
+
* return `null`, which causes the tunnel adapter to reply 200 without
|
|
12
|
+
* further side effects.
|
|
13
|
+
*/
|
|
14
|
+
export function parseTelegramUpdate(rawBody) {
|
|
15
|
+
if (!rawBody)
|
|
16
|
+
return null;
|
|
17
|
+
let update;
|
|
18
|
+
try {
|
|
19
|
+
update = JSON.parse(rawBody);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const message = update.message;
|
|
25
|
+
if (!message)
|
|
26
|
+
return null;
|
|
27
|
+
const chatId = message.chat?.id !== undefined ? String(message.chat.id) : undefined;
|
|
28
|
+
const text = typeof message.text === 'string' ? message.text : '';
|
|
29
|
+
if (!chatId || !text)
|
|
30
|
+
return null;
|
|
31
|
+
return {
|
|
32
|
+
chatId,
|
|
33
|
+
senderId: message.from?.id !== undefined ? String(message.from.id) : undefined,
|
|
34
|
+
senderUsername: message.from?.username,
|
|
35
|
+
text,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const PAIR_REGEX = /^\/pair(?:@\w+)?\s+(\d{6})\b/;
|
|
39
|
+
/** Match `/pair 123456` (with optional `@botname` suffix). */
|
|
40
|
+
export function parsePairCommand(text) {
|
|
41
|
+
const match = text.trim().match(PAIR_REGEX);
|
|
42
|
+
if (!match)
|
|
43
|
+
return null;
|
|
44
|
+
return { code: match[1] };
|
|
45
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commands.com Gateway tunnel protocol types.
|
|
3
|
+
*
|
|
4
|
+
* Matches the frame shapes sent and received by the Go implementation at
|
|
5
|
+
* https://github.com/Commands-com/gateway/blob/main/internal/gateway/integrations_tunnel.go
|
|
6
|
+
*
|
|
7
|
+
* Frame flow:
|
|
8
|
+
* server → client: tunnel.connected (after WebSocket open)
|
|
9
|
+
* client → server: tunnel.activate (claim a route)
|
|
10
|
+
* server → client: tunnel.activate.result (ok / error)
|
|
11
|
+
* server → client: tunnel.request (forwarded webhook)
|
|
12
|
+
* client → server: tunnel.response (reply to forwarded webhook)
|
|
13
|
+
* server → client: tunnel.route_deactivated (route revoked)
|
|
14
|
+
* server → client: tunnel.error (any protocol error)
|
|
15
|
+
*/
|
|
16
|
+
export interface TunnelConnectedFrame {
|
|
17
|
+
type: 'tunnel.connected';
|
|
18
|
+
device_id: string;
|
|
19
|
+
at?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Client → server: claim one or more routes on the live tunnel.
|
|
23
|
+
*
|
|
24
|
+
* The gateway's frame shape (see
|
|
25
|
+
* internal/gateway/integrations_tunnel.go:handleTunnelActivate) expects
|
|
26
|
+
* a `routes` array of route_id strings (or objects with `route_id`), NOT
|
|
27
|
+
* a single `route_id` field. An earlier Shep build sent the singular form
|
|
28
|
+
* and the gateway silently ignored it, which is why no routes were ever
|
|
29
|
+
* activated and every public webhook returned 503.
|
|
30
|
+
*/
|
|
31
|
+
export interface TunnelActivateFrame {
|
|
32
|
+
type: 'tunnel.activate';
|
|
33
|
+
request_id?: string;
|
|
34
|
+
routes: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Server → client: per-route activation results.
|
|
38
|
+
*
|
|
39
|
+
* Again the real gateway returns a `results` array (one entry per route),
|
|
40
|
+
* not a flat `{ route_id, ok }` pair.
|
|
41
|
+
*/
|
|
42
|
+
export interface TunnelActivateResultEntry {
|
|
43
|
+
route_id: string;
|
|
44
|
+
status: string;
|
|
45
|
+
/** Present when status === "rejected". */
|
|
46
|
+
error?: {
|
|
47
|
+
code: string;
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface TunnelActivateResultFrame {
|
|
52
|
+
type: 'tunnel.activate.result';
|
|
53
|
+
request_id?: string;
|
|
54
|
+
results: TunnelActivateResultEntry[];
|
|
55
|
+
}
|
|
56
|
+
export interface TunnelRequestFrame {
|
|
57
|
+
type: 'tunnel.request';
|
|
58
|
+
request_id: string;
|
|
59
|
+
route_id: string;
|
|
60
|
+
method: string;
|
|
61
|
+
path: string;
|
|
62
|
+
/** HTTP headers as [name, value] pairs. */
|
|
63
|
+
headers?: [string, string][];
|
|
64
|
+
/** Base64-encoded request body. */
|
|
65
|
+
body_base64?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface TunnelResponseFrame {
|
|
68
|
+
type: 'tunnel.response';
|
|
69
|
+
request_id: string;
|
|
70
|
+
status: number;
|
|
71
|
+
headers?: [string, string][];
|
|
72
|
+
/** Base64-encoded response body. */
|
|
73
|
+
body_base64?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface TunnelRouteDeactivatedFrame {
|
|
76
|
+
type: 'tunnel.route_deactivated';
|
|
77
|
+
route_id: string;
|
|
78
|
+
reason?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface TunnelErrorFrame {
|
|
81
|
+
type: 'tunnel.error';
|
|
82
|
+
error: string;
|
|
83
|
+
}
|
|
84
|
+
export type TunnelInboundFrame = TunnelConnectedFrame | TunnelActivateResultFrame | TunnelRequestFrame | TunnelRouteDeactivatedFrame | TunnelErrorFrame;
|
|
85
|
+
export type TunnelOutboundFrame = TunnelActivateFrame | TunnelResponseFrame;
|
|
86
|
+
/** Higher-level, decoded request presented to the consuming handler. */
|
|
87
|
+
export interface DecodedTunnelRequest {
|
|
88
|
+
requestId: string;
|
|
89
|
+
routeId: string;
|
|
90
|
+
method: string;
|
|
91
|
+
path: string;
|
|
92
|
+
headers: Record<string, string>;
|
|
93
|
+
/** Decoded UTF-8 body; empty string if no body. */
|
|
94
|
+
body: string;
|
|
95
|
+
}
|
|
96
|
+
/** Response returned by the handler for a decoded request. */
|
|
97
|
+
export interface TunnelRequestResponse {
|
|
98
|
+
status: number;
|
|
99
|
+
headers?: Record<string, string>;
|
|
100
|
+
body?: string;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=tunnel-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-protocol.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/tunnel-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,yBAAyB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC7B,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC7B,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,kBAAkB,GAC1B,oBAAoB,GACpB,yBAAyB,GACzB,kBAAkB,GAClB,2BAA2B,GAC3B,gBAAgB,CAAC;AAErB,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAE5E,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commands.com Gateway tunnel protocol types.
|
|
3
|
+
*
|
|
4
|
+
* Matches the frame shapes sent and received by the Go implementation at
|
|
5
|
+
* https://github.com/Commands-com/gateway/blob/main/internal/gateway/integrations_tunnel.go
|
|
6
|
+
*
|
|
7
|
+
* Frame flow:
|
|
8
|
+
* server → client: tunnel.connected (after WebSocket open)
|
|
9
|
+
* client → server: tunnel.activate (claim a route)
|
|
10
|
+
* server → client: tunnel.activate.result (ok / error)
|
|
11
|
+
* server → client: tunnel.request (forwarded webhook)
|
|
12
|
+
* client → server: tunnel.response (reply to forwarded webhook)
|
|
13
|
+
* server → client: tunnel.route_deactivated (route revoked)
|
|
14
|
+
* server → client: tunnel.error (any protocol error)
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Cloud API Webhook Parser
|
|
3
|
+
*
|
|
4
|
+
* Converts a raw WhatsApp Business Cloud webhook payload into a domain-level
|
|
5
|
+
* ChatMessage, matching the same contract as the Telegram parser so the
|
|
6
|
+
* messaging service can dispatch both uniformly.
|
|
7
|
+
*
|
|
8
|
+
* Reference: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/payload-examples
|
|
9
|
+
*
|
|
10
|
+
* A minimal incoming text message looks like:
|
|
11
|
+
*
|
|
12
|
+
* {
|
|
13
|
+
* "object": "whatsapp_business_account",
|
|
14
|
+
* "entry": [{
|
|
15
|
+
* "changes": [{
|
|
16
|
+
* "value": {
|
|
17
|
+
* "messages": [{
|
|
18
|
+
* "from": "15551234567",
|
|
19
|
+
* "id": "wamid.xxx",
|
|
20
|
+
* "timestamp": "1234567890",
|
|
21
|
+
* "type": "text",
|
|
22
|
+
* "text": { "body": "hello" }
|
|
23
|
+
* }]
|
|
24
|
+
* }
|
|
25
|
+
* }]
|
|
26
|
+
* }]
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* We only parse the first text message in the first change. Status updates
|
|
30
|
+
* (delivery receipts, read receipts) and non-text types are ignored and
|
|
31
|
+
* return null.
|
|
32
|
+
*/
|
|
33
|
+
export interface ParsedWhatsAppMessage {
|
|
34
|
+
chatId: string;
|
|
35
|
+
senderId?: string;
|
|
36
|
+
text: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function parseWhatsAppUpdate(rawBody: string): ParsedWhatsAppMessage | null;
|
|
39
|
+
//# sourceMappingURL=whatsapp-webhook.parser.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatsapp-webhook.parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/messaging/whatsapp-webhook.parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAoBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAuBjF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Cloud API Webhook Parser
|
|
3
|
+
*
|
|
4
|
+
* Converts a raw WhatsApp Business Cloud webhook payload into a domain-level
|
|
5
|
+
* ChatMessage, matching the same contract as the Telegram parser so the
|
|
6
|
+
* messaging service can dispatch both uniformly.
|
|
7
|
+
*
|
|
8
|
+
* Reference: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/payload-examples
|
|
9
|
+
*
|
|
10
|
+
* A minimal incoming text message looks like:
|
|
11
|
+
*
|
|
12
|
+
* {
|
|
13
|
+
* "object": "whatsapp_business_account",
|
|
14
|
+
* "entry": [{
|
|
15
|
+
* "changes": [{
|
|
16
|
+
* "value": {
|
|
17
|
+
* "messages": [{
|
|
18
|
+
* "from": "15551234567",
|
|
19
|
+
* "id": "wamid.xxx",
|
|
20
|
+
* "timestamp": "1234567890",
|
|
21
|
+
* "type": "text",
|
|
22
|
+
* "text": { "body": "hello" }
|
|
23
|
+
* }]
|
|
24
|
+
* }
|
|
25
|
+
* }]
|
|
26
|
+
* }]
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* We only parse the first text message in the first change. Status updates
|
|
30
|
+
* (delivery receipts, read receipts) and non-text types are ignored and
|
|
31
|
+
* return null.
|
|
32
|
+
*/
|
|
33
|
+
export function parseWhatsAppUpdate(rawBody) {
|
|
34
|
+
if (!rawBody)
|
|
35
|
+
return null;
|
|
36
|
+
let update;
|
|
37
|
+
try {
|
|
38
|
+
update = JSON.parse(rawBody);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const change = update.entry?.[0]?.changes?.[0]?.value;
|
|
44
|
+
const message = change?.messages?.[0];
|
|
45
|
+
if (message?.type !== 'text')
|
|
46
|
+
return null;
|
|
47
|
+
const text = message.text?.body;
|
|
48
|
+
const from = message.from;
|
|
49
|
+
if (!text || !from)
|
|
50
|
+
return null;
|
|
51
|
+
return {
|
|
52
|
+
chatId: from,
|
|
53
|
+
senderId: from,
|
|
54
|
+
text,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -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();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Delete Command
|
|
3
|
+
*
|
|
4
|
+
* Soft-deletes an application and stops any active session.
|
|
5
|
+
*
|
|
6
|
+
* Usage: shep app del <id> [--force]
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* $ shep app del a1b2c3d4
|
|
10
|
+
* $ shep app del a1b2c3d4 --force
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
export declare function createDelCommand(): Command;
|
|
14
|
+
//# sourceMappingURL=del.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"del.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/app/del.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,gBAAgB,IAAI,OAAO,CAyC1C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Delete Command
|
|
3
|
+
*
|
|
4
|
+
* Soft-deletes an application and stops any active session.
|
|
5
|
+
*
|
|
6
|
+
* Usage: shep app del <id> [--force]
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* $ shep app del a1b2c3d4
|
|
10
|
+
* $ shep app del a1b2c3d4 --force
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import { container } from '../../../../../packages/core/src/infrastructure/di/container.js';
|
|
14
|
+
import { DeleteApplicationUseCase } from '../../../../../packages/core/src/application/use-cases/applications/delete-application.use-case.js';
|
|
15
|
+
import { colors, messages } from '../../ui/index.js';
|
|
16
|
+
import { confirm } from '@inquirer/prompts';
|
|
17
|
+
import { resolveApplication } from './resolve-application.js';
|
|
18
|
+
import { getCliI18n } from '../../i18n.js';
|
|
19
|
+
export function createDelCommand() {
|
|
20
|
+
const t = getCliI18n().t;
|
|
21
|
+
return new Command('del')
|
|
22
|
+
.description(t('cli:commands.app.del.description'))
|
|
23
|
+
.argument('<id>', t('cli:commands.app.del.idArgument'))
|
|
24
|
+
.option('-f, --force', t('cli:commands.app.del.forceOption'))
|
|
25
|
+
.action(async (id, options) => {
|
|
26
|
+
try {
|
|
27
|
+
const resolved = await resolveApplication(id);
|
|
28
|
+
if ('error' in resolved) {
|
|
29
|
+
messages.error(resolved.error);
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const app = resolved.application;
|
|
34
|
+
if (!options.force) {
|
|
35
|
+
const confirmed = await confirm({
|
|
36
|
+
message: t('cli:commands.app.del.confirmDelete', { name: app.name }),
|
|
37
|
+
default: false,
|
|
38
|
+
});
|
|
39
|
+
if (!confirmed) {
|
|
40
|
+
messages.info(t('cli:commands.app.del.cancelled'));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const deleteUseCase = container.resolve(DeleteApplicationUseCase);
|
|
45
|
+
await deleteUseCase.execute(app.id);
|
|
46
|
+
messages.newline();
|
|
47
|
+
messages.success(t('cli:commands.app.del.appDeleted'));
|
|
48
|
+
console.log(` ${colors.muted(t('cli:commands.app.del.nameLabel'))} ${app.name}`);
|
|
49
|
+
console.log(` ${colors.muted(t('cli:commands.app.del.slugLabel'))} ${app.slug}`);
|
|
50
|
+
messages.newline();
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
54
|
+
messages.error(t('cli:commands.app.del.failedToDelete'), err);
|
|
55
|
+
process.exitCode = 1;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Command
|
|
3
|
+
*
|
|
4
|
+
* Top-level app command with subcommands for managing applications.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep app [subcommand]
|
|
8
|
+
*
|
|
9
|
+
* Subcommands:
|
|
10
|
+
* shep app ls List applications
|
|
11
|
+
* shep app show <id> Display details of an application
|
|
12
|
+
* shep app new <desc> Create a new application
|
|
13
|
+
* shep app del <id> Delete an application
|
|
14
|
+
*/
|
|
15
|
+
import { Command } from 'commander';
|
|
16
|
+
/**
|
|
17
|
+
* Create the app command with all subcommands
|
|
18
|
+
*/
|
|
19
|
+
export declare function createAppCommand(): Command;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAU1C"}
|