@goodandready/dsh-messenger-gateway 0.4.28 → 0.4.29

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.
@@ -437,7 +437,7 @@ export async function handleGatewayCommand(gw, key, text, input) {
437
437
  }
438
438
 
439
439
  if (cmd === '/app' || cmd === '/dashboard') {
440
- const webAppUrl = gw.resolveWebAppUrl()
440
+ const webAppUrl = gw.resolveWebAppUrl?.() || ''
441
441
  if (!webAppUrl) {
442
442
  await reply('⚠️ Telegram Mini App URL is not configured. Set <code>telegram.webAppUrl</code> or <code>telegram.webhookUrl</code> in settings.')
443
443
  return { handled: true }
@@ -310,7 +310,7 @@ export async function runGatewayTurn(gw, chat, input, signal) {
310
310
  artifactPreviews: gw.tg().artifactPreviews !== false,
311
311
  artifactStore: gw.artifactStore,
312
312
  chatId: input.chatId,
313
- webAppUrl: gw.resolveWebAppUrl(),
313
+ webAppUrl: gw.resolveWebAppUrl?.() || '',
314
314
  })
315
315
  const answer = processed.text
316
316
  if (collector.reason?.kind === 'error') {
package/lib/gateway.js CHANGED
@@ -126,6 +126,22 @@ export class Gateway {
126
126
  this.apiHealth.recordSuccess()
127
127
  }
128
128
 
129
+ resolveWebAppUrl() {
130
+ const tg = this.tg() || {}
131
+ if (tg.webAppEnabled === false) return ''
132
+ if (tg.webAppUrl && String(tg.webAppUrl).trim()) return String(tg.webAppUrl).trim()
133
+ const hookUrl = String(tg.webhookUrl || '').trim()
134
+ if (hookUrl && hookUrl.startsWith('http')) {
135
+ try {
136
+ const u = new URL(hookUrl)
137
+ return `${u.origin}/dsh-messenger-gateway/webapp`
138
+ } catch {
139
+ // ignore malformed webhookUrl
140
+ }
141
+ }
142
+ return ''
143
+ }
144
+
129
145
  resolveLocale(input) {
130
146
  if (input?.locale) return input.locale
131
147
  const chatId = input?.chatId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-messenger-gateway",
3
- "version": "0.4.28",
3
+ "version": "0.4.29",
4
4
  "description": "Telegram messenger bridge for DeepSeek Harness: sessions, steer, homes, inline asks, notify bridge, and optional TTS voice notes.",
5
5
  "license": "MIT",
6
6
  "type": "module",