@goodandready/dsh-messenger-gateway 0.4.1 → 0.4.3
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/lib/client.js +28 -10
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// dsh-messenger-gateway — browser (client) half.
|
|
2
2
|
// Settings card on Plugins → Plugin settings tab (settings.plugin.item).
|
|
3
|
-
// Config managed via reactive ctx.
|
|
3
|
+
// Config managed via reactive ctx.configForms snapshot.
|
|
4
4
|
|
|
5
5
|
window.__ModuleLoader__.load({
|
|
6
6
|
id: '@goodandready/dsh-messenger-gateway',
|
|
@@ -565,8 +565,8 @@ window.__ModuleLoader__.load({
|
|
|
565
565
|
}, [])
|
|
566
566
|
|
|
567
567
|
const scope = React.useMemo(() => {
|
|
568
|
-
const
|
|
569
|
-
return
|
|
568
|
+
const configForms = ctx?.get?.('configForms') || ctx?.configForms
|
|
569
|
+
return configForms ? configForms.get(NS) : undefined
|
|
570
570
|
}, [ctx])
|
|
571
571
|
|
|
572
572
|
const snapshot = React.useSyncExternalStore(
|
|
@@ -1584,7 +1584,7 @@ window.__ModuleLoader__.load({
|
|
|
1584
1584
|
function refreshMirrorUntilVisible(ctx) {
|
|
1585
1585
|
const visible = () => {
|
|
1586
1586
|
try {
|
|
1587
|
-
const s = (ctx?.get && ctx.get('lanSettings')) || (ctx?.get && ctx.get('
|
|
1587
|
+
const s = (ctx?.get && ctx.get('lanSettings')) || (ctx?.get && ctx.get('configForms')) || ctx?.configForms
|
|
1588
1588
|
const view = s?.describe?.()?.getSnapshot?.()?.view
|
|
1589
1589
|
return !!view && Array.isArray(view.namespaces) && view.namespaces.some((row) => row.ns === NS)
|
|
1590
1590
|
} catch (_) {
|
|
@@ -1597,10 +1597,10 @@ window.__ModuleLoader__.load({
|
|
|
1597
1597
|
if (visible() || tries >= 15) { clearInterval(timer); return }
|
|
1598
1598
|
tries += 1
|
|
1599
1599
|
try {
|
|
1600
|
-
const s = (ctx?.get && ctx.get('lanSettings')) || (ctx?.get && ctx.get('
|
|
1600
|
+
const s = (ctx?.get && ctx.get('lanSettings')) || (ctx?.get && ctx.get('configForms')) || ctx?.configForms
|
|
1601
1601
|
s?.describe?.()?.load?.()
|
|
1602
1602
|
} catch (_) {
|
|
1603
|
-
/* safe fallback if
|
|
1603
|
+
/* safe fallback if configForms is not yet attached to container */
|
|
1604
1604
|
}
|
|
1605
1605
|
}, 1000)
|
|
1606
1606
|
return () => clearInterval(timer)
|
|
@@ -1662,9 +1662,27 @@ window.__ModuleLoader__.load({
|
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
|
|
1665
|
-
//
|
|
1666
|
-
//
|
|
1667
|
-
//
|
|
1665
|
+
// Plugin-list seat (current core, 0.1.6-alpha.2): the Plugins page lists this
|
|
1666
|
+
// entry as a card and opens the entry's own page with the settings form. The
|
|
1667
|
+
// label is a static string on purpose — it is resolved while the page renders,
|
|
1668
|
+
// and a locale lookup there would take the whole client batch down with it.
|
|
1669
|
+
registerSlotWhenReady('plugins.item', () => {
|
|
1670
|
+
const slots = ctx?.get?.('slots') || ctx?.slots
|
|
1671
|
+
return slots.register(
|
|
1672
|
+
{
|
|
1673
|
+
name: 'plugins.item',
|
|
1674
|
+
id: ROW_ID,
|
|
1675
|
+
order: 60,
|
|
1676
|
+
label: () => 'Messenger gateway',
|
|
1677
|
+
locale: NS,
|
|
1678
|
+
inject: () => ({ ctx }),
|
|
1679
|
+
},
|
|
1680
|
+
(props) => React.createElement(ErrorBoundary, null, React.createElement(PluginCard, { ...props, ctx: (props && props.ctx) || ctx }))
|
|
1681
|
+
)
|
|
1682
|
+
})
|
|
1683
|
+
|
|
1684
|
+
// Row seat and the legacy seats stay as fallbacks so settings never become
|
|
1685
|
+
// unreachable.
|
|
1668
1686
|
registerSlotWhenReady('plugins.row.config', () => {
|
|
1669
1687
|
const slots = ctx?.get?.('slots') || ctx?.slots
|
|
1670
1688
|
return slots.register(
|
|
@@ -1692,7 +1710,7 @@ window.__ModuleLoader__.load({
|
|
|
1692
1710
|
})
|
|
1693
1711
|
}
|
|
1694
1712
|
|
|
1695
|
-
module.exports = { apply, inject: ['slots', 'locale', '
|
|
1713
|
+
module.exports = { apply, inject: ['slots', 'locale', 'configForms'] }
|
|
1696
1714
|
return module.exports
|
|
1697
1715
|
},
|
|
1698
1716
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-messenger-gateway",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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",
|