@linxin666/dsh-remote-web-ui 0.4.5 → 0.4.6

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/index.js CHANGED
@@ -4000,12 +4000,12 @@ function mountOnce(packageName, fn) {
4000
4000
  /**
4001
4001
  * Run one piece of work outside the caller's async context.
4002
4002
  *
4003
- * The Host performs a settings mutation inside `hmr.runExclusive`, which marks
4004
- * the running async context with an AsyncLocalStorage store. Side effects that
4005
- * live on that path - writing `cordis.patch.yml`, the very file the HMR config
4006
- * watcher refreshes from - must not run under that mark, or the watcher's
4007
- * refresh can re-enter the exclusive transaction and be refused with "HMR
4008
- * transactions cannot be nested" (#1751, #1754).
4003
+ * A Host mutation that runs inside `hmr.runExclusive` marks the running async
4004
+ * context with an AsyncLocalStorage store. Side effects on that path that write
4005
+ * a file the HMR config watcher refreshes from - `cordis.patch.yml` above all -
4006
+ * must not run under that mark, or the watcher's refresh re-enters the
4007
+ * exclusive transaction and is refused with "HMR transactions cannot be nested"
4008
+ * (#1751, #1754, #1816).
4009
4009
  *
4010
4010
  * Deferring is NOT enough, and the earlier belt that this one replaces was
4011
4011
  * built on a disproven premise: Node propagates an AsyncLocalStorage store into
@@ -4027,7 +4027,7 @@ function mountOnce(packageName, fn) {
4027
4027
  * // -> undefined
4028
4028
  * ```
4029
4029
  *
4030
- * @module
4030
+ * @module dsh-web-shared/host/detached-work
4031
4031
  */
4032
4032
  /**
4033
4033
  * The escape hatch, created at module scope on purpose: a resource built while
@@ -4035,7 +4035,7 @@ function mountOnce(packageName, fn) {
4035
4035
  * instance is the only one the module ever needs. It carries no context of its
4036
4036
  * own, so every job run through it starts from the process's root context.
4037
4037
  */
4038
- const DETACHED = new AsyncResource("dsh-remote-web-ui:detached-work", { triggerAsyncId: 0 });
4038
+ const DETACHED = new AsyncResource("dsh-web:detached-work", { triggerAsyncId: 0 });
4039
4039
  /**
4040
4040
  * Run `work` outside the caller's AsyncLocalStorage context.
4041
4041
  *
@@ -4095,7 +4095,7 @@ function buildRemoteChannelBootScript(rules = REMOTE_CHANNEL_RULES) {
4095
4095
  }
4096
4096
  /** Boot-watchdog latch: one self-reload per session while the boot is broken. */
4097
4097
  const BOOT_WATCHDOG_KEY = "dsh-remote-boot-reload";
4098
- /** Total wait for the app's first conversation surface before the reload. */
4098
+ /** Post-load wait for the app's first conversation surface before the reload. */
4099
4099
  const BOOT_WATCHDOG_WAIT_MS = 15e3;
4100
4100
  /** Watchdog poll cadence. */
4101
4101
  const BOOT_WATCHDOG_POLL_MS = 1e3;
@@ -4110,7 +4110,7 @@ const BOOT_WATCHDOG_POLL_MS = 1e3;
4110
4110
  */
4111
4111
  function buildBootWatchdogScript(waitMs = BOOT_WATCHDOG_WAIT_MS, pollMs = BOOT_WATCHDOG_POLL_MS) {
4112
4112
  const key = JSON.stringify(BOOT_WATCHDOG_KEY);
4113
- return ";function wBoot(){try{return !!(w.document&&w.document.querySelector&&(w.document.querySelector(\"[data-conversation-scroll]\")||w.document.querySelector(\"[data-slot=\\\"conversation\\\"]\")))}catch(e){return false}}function wTick(n){try{if(wBoot()){try{w.sessionStorage.removeItem(" + key + ")}catch(e){}return}if(n<" + waitMs + "){w.setTimeout(function(){wTick(n+" + pollMs + ")}," + pollMs + ");return}var done=false;try{done=w.sessionStorage.getItem(" + key + ")===\"1\"}catch(e){}if(done)return;try{w.sessionStorage.setItem(" + key + ",\"1\")}catch(e){}w.location.reload()}catch(e){}}if(typeof w.setTimeout===\"function\")w.setTimeout(function(){wTick(0)}," + pollMs + ");";
4113
+ return ";function wBoot(){try{return !!(w.document&&w.document.querySelector&&(w.document.querySelector(\"[data-conversation-scroll]\")||w.document.querySelector(\"[data-slot=\\\"conversation\\\"]\")))}catch(e){return false}}function wTick(n){try{if(wBoot()){try{w.sessionStorage.removeItem(" + key + ")}catch(e){}return}if(!w.document||w.document.readyState!==\"complete\"){w.setTimeout(function(){wTick(0)}," + pollMs + ");return}if(n<" + waitMs + "){w.setTimeout(function(){wTick(n+" + pollMs + ")}," + pollMs + ");return}var done=false;try{done=w.sessionStorage.getItem(" + key + ")===\"1\"}catch(e){}if(done)return;try{w.sessionStorage.setItem(" + key + ",\"1\")}catch(e){}w.location.reload()}catch(e){}}if(typeof w.setTimeout===\"function\")w.setTimeout(function(){wTick(0)}," + pollMs + ");";
4114
4114
  }
4115
4115
  /** The script this plugin contributes; built once from the live rules. */
4116
4116
  const REMOTE_CHANNEL_BOOT_SCRIPT = buildRemoteChannelBootScript();
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-adapt.d.ts","sourceRoot":"","sources":["../../../src/client/mobile-adapt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,yDAAyD;IACzD,aAAa,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;IAClC,yDAAyD;IACzD,YAAY,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;IACjC;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAC,GAAG,IAAI,CAAA;IAC9C,wEAAwE;IACxE,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;IAC7B,4GAA4G;IAC5G,iBAAiB,IAAI,IAAI,CAAA;CAC1B;AAoQD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAi8BvC"}
1
+ {"version":3,"file":"mobile-adapt.d.ts","sourceRoot":"","sources":["../../../src/client/mobile-adapt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,yDAAyD;IACzD,aAAa,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;IAClC,yDAAyD;IACzD,YAAY,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;IACjC;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAC,GAAG,IAAI,CAAA;IAC9C,wEAAwE;IACxE,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;IAC7B,4GAA4G;IAC5G,iBAAiB,IAAI,IAAI,CAAA;CAC1B;AA+RD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAi8BvC"}
@@ -150,14 +150,41 @@ const ADAPT_CSS = [
150
150
  '[class$="_headerUtilities"]{display:none}',
151
151
  // v52 composer: the two lines (permission / model) stay stacked with zero
152
152
  // row gap; the command, context-meter and send/stop buttons float at the
153
- // left/right edges vertically centered over both lines.
153
+ // left/right edges vertically centered over both lines. "Both lines" is what
154
+ // makes _row the containing block for those three floats: _row is the one box
155
+ // that wraps the lines, so nothing between a float and _row may claim it.
154
156
  '[class$="_composerSeat"] [class$="_card"]{margin-bottom:1px}',
155
157
  '[class$="_composerSeat"] [class$="_row"]{flex-wrap:wrap;row-gap:0;padding:2px 8px 1px;position:relative}',
156
- '[class$="_composerSeat"] [class$="_add"]{position:absolute;left:8px;top:50%;transform:translateY(-50%)}',
158
+ // The attach button is the only file-picker entry on the portrait composer,
159
+ // and taking it out of flow costs it the paint order it had inline: a
160
+ // positioned sibling painted after it (the trailing line, see below) covers
161
+ // it and eats the taps on the covered half. Its own z-index makes the hit
162
+ // layer a property of the button instead of a side effect of a sibling
163
+ // (#1829). It clears the composer's own stacking ladder and stays far below
164
+ // the bottom-sheet menus (2147482000), which own the overlay above it.
165
+ '[class$="_composerSeat"] [class$="_add"]{position:absolute;left:8px;top:50%;transform:translateY(-50%);z-index:10}',
157
166
  '[class$="_composerSeat"] [class$="_modes"]{min-width:0;padding-left:38px}',
158
167
  // Model line left-aligned with the permission line (same command-button
159
168
  // clearance), rows stay tightly stacked.
160
- '[class$="_composerSeat"] [class$="_trailing"]{flex-basis:100%;position:relative;min-height:32px;justify-content:flex-start;padding-left:38px;padding-right:78px}',
169
+ // The trailing line is forced onto its own row at flex-basis:100% and carries
170
+ // 116px of side padding (38 left for the command button, 78 right for the
171
+ // send button). Under the default content-box that padding is ADDED to the
172
+ // 100% basis, so the line's own box overflowed the card by exactly 116px and
173
+ // dragged the absolutely-positioned send button out with it: on a 393px phone
174
+ // the card ended at x=367 while the button sat at x=433..467, past the
175
+ // viewport's right edge, which is the unreachable button the reporter
176
+ // measured (#1818). border-box contains the padding inside the basis, so the
177
+ // line stays within the card and the button lands back inside it.
178
+ //
179
+ // The line stays UNPOSITIONED on purpose. position:relative arrived here with
180
+ // the compact picker and outlived it, but this box is the LAST line only: as
181
+ // the nearest positioned ancestor it took the containing block from _row, so
182
+ // the send button and the context meter centered inside the trailing line
183
+ // instead of over both lines - the send button rode the input's bottom edge,
184
+ // out of line with the attach button - and, painted after the out-of-flow
185
+ // attach button, the line covered that button's lower half and swallowed the
186
+ // taps there (#1829).
187
+ '[class$="_composerSeat"] [class$="_trailing"]{box-sizing:border-box;flex-basis:100%;min-height:32px;justify-content:flex-start;padding-left:38px;padding-right:78px}',
161
188
  '[class$="_composerSeat"] [class$="_trailing"] *{font-size:12px}',
162
189
  // v54: smaller permission/model buttons (font + height). v79: the
163
190
  // permission trigger collapses to its shield icon on phones — the label
@@ -78,6 +78,11 @@ export interface PluginCardSeat {
78
78
  label?: () => string;
79
79
  /** Locale namespace the card renders with. */
80
80
  locale: string;
81
+ /**
82
+ * Child slots this card declares and renders. Forwarded to whichever seat
83
+ * the host renders; absent for a card that declares none.
84
+ */
85
+ children?: Record<string, unknown>;
81
86
  /** Business-face factory of the registration. */
82
87
  inject?: () => object;
83
88
  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M,CAAA;IACd,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,MAAM,CAAA;IACpB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,MAAM,CAAA;IACrB;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAUjE;AAWD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CA8DpF"}
@@ -111,12 +111,14 @@ export function installPluginCard(ctx, seat) {
111
111
  ...(seat.order === undefined ? {} : { order: seat.order }),
112
112
  ...(seat.label === undefined ? {} : { label: seat.label }),
113
113
  locale: seat.locale,
114
+ ...(seat.children === undefined ? {} : { children: seat.children }),
114
115
  ...(seat.inject === undefined ? {} : { inject }),
115
116
  }
116
117
  : {
117
118
  name: OFFICIAL_PLUGIN_CARD_SEAT,
118
119
  key: seat.bundle,
119
120
  locale: seat.locale,
121
+ ...(seat.children === undefined ? {} : { children: seat.children }),
120
122
  ...(seat.inject === undefined ? {} : { inject }),
121
123
  }), component);
122
124
  current = target;
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Run one piece of work outside the caller's async context.
3
3
  *
4
- * The Host performs a settings mutation inside `hmr.runExclusive`, which marks
5
- * the running async context with an AsyncLocalStorage store. Side effects that
6
- * live on that path - writing `cordis.patch.yml`, the very file the HMR config
7
- * watcher refreshes from - must not run under that mark, or the watcher's
8
- * refresh can re-enter the exclusive transaction and be refused with "HMR
9
- * transactions cannot be nested" (#1751, #1754).
4
+ * A Host mutation that runs inside `hmr.runExclusive` marks the running async
5
+ * context with an AsyncLocalStorage store. Side effects on that path that write
6
+ * a file the HMR config watcher refreshes from - `cordis.patch.yml` above all -
7
+ * must not run under that mark, or the watcher's refresh re-enters the
8
+ * exclusive transaction and is refused with "HMR transactions cannot be nested"
9
+ * (#1751, #1754, #1816).
10
10
  *
11
11
  * Deferring is NOT enough, and the earlier belt that this one replaces was
12
12
  * built on a disproven premise: Node propagates an AsyncLocalStorage store into
@@ -28,7 +28,7 @@
28
28
  * // -> undefined
29
29
  * ```
30
30
  *
31
- * @module
31
+ * @module dsh-web-shared/host/detached-work
32
32
  */
33
33
  /**
34
34
  * Run `work` outside the caller's AsyncLocalStorage context.
@@ -1 +1 @@
1
- {"version":3,"file":"detached-work.d.ts","sourceRoot":"","sources":["../../src/detached-work.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAYH;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAE/C"}
1
+ {"version":3,"file":"detached-work.d.ts","sourceRoot":"","sources":["../../src/detached-work.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAYH;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAE/C"}
@@ -1,12 +1,13 @@
1
+ // Generated by scripts/sync-shared.mjs from shared/host/detached-work.ts. Do not edit this copy; edit the shared source and run "node scripts/sync-shared.mjs".
1
2
  /**
2
3
  * Run one piece of work outside the caller's async context.
3
4
  *
4
- * The Host performs a settings mutation inside `hmr.runExclusive`, which marks
5
- * the running async context with an AsyncLocalStorage store. Side effects that
6
- * live on that path - writing `cordis.patch.yml`, the very file the HMR config
7
- * watcher refreshes from - must not run under that mark, or the watcher's
8
- * refresh can re-enter the exclusive transaction and be refused with "HMR
9
- * transactions cannot be nested" (#1751, #1754).
5
+ * A Host mutation that runs inside `hmr.runExclusive` marks the running async
6
+ * context with an AsyncLocalStorage store. Side effects on that path that write
7
+ * a file the HMR config watcher refreshes from - `cordis.patch.yml` above all -
8
+ * must not run under that mark, or the watcher's refresh re-enters the
9
+ * exclusive transaction and is refused with "HMR transactions cannot be nested"
10
+ * (#1751, #1754, #1816).
10
11
  *
11
12
  * Deferring is NOT enough, and the earlier belt that this one replaces was
12
13
  * built on a disproven premise: Node propagates an AsyncLocalStorage store into
@@ -28,7 +29,7 @@
28
29
  * // -> undefined
29
30
  * ```
30
31
  *
31
- * @module
32
+ * @module dsh-web-shared/host/detached-work
32
33
  */
33
34
  import { AsyncResource } from 'node:async_hooks';
34
35
  /**
@@ -37,7 +38,7 @@ import { AsyncResource } from 'node:async_hooks';
37
38
  * instance is the only one the module ever needs. It carries no context of its
38
39
  * own, so every job run through it starts from the process's root context.
39
40
  */
40
- const DETACHED = new AsyncResource('dsh-remote-web-ui:detached-work', { triggerAsyncId: 0 });
41
+ const DETACHED = new AsyncResource('dsh-web:detached-work', { triggerAsyncId: 0 });
41
42
  /**
42
43
  * Run `work` outside the caller's AsyncLocalStorage context.
43
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"remote-channel-boot.d.ts","sourceRoot":"","sources":["../../src/remote-channel-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAoD,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAErH;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,GAAE,kBAAyC,GAAG,MAAM,CAkKrG;AAED,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,2BAA2B,CAAA;AAQzD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,SAAwB,EAAE,MAAM,SAAwB,GAAG,MAAM,CAgB9G;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,EAAE,MAAuC,CAAA"}
1
+ {"version":3,"file":"remote-channel-boot.d.ts","sourceRoot":"","sources":["../../src/remote-channel-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAoD,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAErH;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,GAAE,kBAAyC,GAAG,MAAM,CAkKrG;AAED,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,2BAA2B,CAAA;AAQzD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,SAAwB,EAAE,MAAM,SAAwB,GAAG,MAAM,CAmB9G;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,EAAE,MAAuC,CAAA"}
@@ -200,7 +200,7 @@ export function buildRemoteChannelBootScript(rules = REMOTE_CHANNEL_RULES) {
200
200
  }
201
201
  /** Boot-watchdog latch: one self-reload per session while the boot is broken. */
202
202
  export const BOOT_WATCHDOG_KEY = 'dsh-remote-boot-reload';
203
- /** Total wait for the app's first conversation surface before the reload. */
203
+ /** Post-load wait for the app's first conversation surface before the reload. */
204
204
  const BOOT_WATCHDOG_WAIT_MS = 15_000;
205
205
  /** Watchdog poll cadence. */
206
206
  const BOOT_WATCHDOG_POLL_MS = 1_000;
@@ -221,6 +221,9 @@ export function buildBootWatchdogScript(waitMs = BOOT_WATCHDOG_WAIT_MS, pollMs =
221
221
  ';function wBoot(){try{return !!(w.document&&w.document.querySelector&&(w.document.querySelector("[data-conversation-scroll]")||w.document.querySelector("[data-slot=\\"conversation\\"]")))}catch(e){return false}}' +
222
222
  'function wTick(n){try{' +
223
223
  'if(wBoot()){try{w.sessionStorage.removeItem(' + key + ')}catch(e){}return}' +
224
+ // Parse-time installation must not spend the recovery budget downloading
225
+ // the initial scripts/styles over a slow remote link (issue #1845).
226
+ 'if(!w.document||w.document.readyState!=="complete"){w.setTimeout(function(){wTick(0)},' + pollMs + ');return}' +
224
227
  'if(n<' + waitMs + '){w.setTimeout(function(){wTick(n+' + pollMs + ')},' + pollMs + ');return}' +
225
228
  'var done=false;try{done=w.sessionStorage.getItem(' + key + ')==="1"}catch(e){}' +
226
229
  'if(done)return;' +
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-remote-web-ui",
3
3
  "description": "Scan-to-pair remote access for the dsh web GUI that shares one official interface: a QR beside the settings button pairs phones and PCs into the same Web GUI (a portrait-touch adaptation layer for phones, full desktop on PCs) through one-time tokens and revocable device sessions, with a LAN bind toggle, optional Cloudflare tunnel, and one-click family self-update",
4
- "version": "0.4.5",
4
+ "version": "0.4.6",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "engines": {
@@ -173,14 +173,41 @@ const ADAPT_CSS: readonly string[] = [
173
173
  '[class$="_headerUtilities"]{display:none}',
174
174
  // v52 composer: the two lines (permission / model) stay stacked with zero
175
175
  // row gap; the command, context-meter and send/stop buttons float at the
176
- // left/right edges vertically centered over both lines.
176
+ // left/right edges vertically centered over both lines. "Both lines" is what
177
+ // makes _row the containing block for those three floats: _row is the one box
178
+ // that wraps the lines, so nothing between a float and _row may claim it.
177
179
  '[class$="_composerSeat"] [class$="_card"]{margin-bottom:1px}',
178
180
  '[class$="_composerSeat"] [class$="_row"]{flex-wrap:wrap;row-gap:0;padding:2px 8px 1px;position:relative}',
179
- '[class$="_composerSeat"] [class$="_add"]{position:absolute;left:8px;top:50%;transform:translateY(-50%)}',
181
+ // The attach button is the only file-picker entry on the portrait composer,
182
+ // and taking it out of flow costs it the paint order it had inline: a
183
+ // positioned sibling painted after it (the trailing line, see below) covers
184
+ // it and eats the taps on the covered half. Its own z-index makes the hit
185
+ // layer a property of the button instead of a side effect of a sibling
186
+ // (#1829). It clears the composer's own stacking ladder and stays far below
187
+ // the bottom-sheet menus (2147482000), which own the overlay above it.
188
+ '[class$="_composerSeat"] [class$="_add"]{position:absolute;left:8px;top:50%;transform:translateY(-50%);z-index:10}',
180
189
  '[class$="_composerSeat"] [class$="_modes"]{min-width:0;padding-left:38px}',
181
190
  // Model line left-aligned with the permission line (same command-button
182
191
  // clearance), rows stay tightly stacked.
183
- '[class$="_composerSeat"] [class$="_trailing"]{flex-basis:100%;position:relative;min-height:32px;justify-content:flex-start;padding-left:38px;padding-right:78px}',
192
+ // The trailing line is forced onto its own row at flex-basis:100% and carries
193
+ // 116px of side padding (38 left for the command button, 78 right for the
194
+ // send button). Under the default content-box that padding is ADDED to the
195
+ // 100% basis, so the line's own box overflowed the card by exactly 116px and
196
+ // dragged the absolutely-positioned send button out with it: on a 393px phone
197
+ // the card ended at x=367 while the button sat at x=433..467, past the
198
+ // viewport's right edge, which is the unreachable button the reporter
199
+ // measured (#1818). border-box contains the padding inside the basis, so the
200
+ // line stays within the card and the button lands back inside it.
201
+ //
202
+ // The line stays UNPOSITIONED on purpose. position:relative arrived here with
203
+ // the compact picker and outlived it, but this box is the LAST line only: as
204
+ // the nearest positioned ancestor it took the containing block from _row, so
205
+ // the send button and the context meter centered inside the trailing line
206
+ // instead of over both lines - the send button rode the input's bottom edge,
207
+ // out of line with the attach button - and, painted after the out-of-flow
208
+ // attach button, the line covered that button's lower half and swallowed the
209
+ // taps there (#1829).
210
+ '[class$="_composerSeat"] [class$="_trailing"]{box-sizing:border-box;flex-basis:100%;min-height:32px;justify-content:flex-start;padding-left:38px;padding-right:78px}',
184
211
  '[class$="_composerSeat"] [class$="_trailing"] *{font-size:12px}',
185
212
  // v54: smaller permission/model buttons (font + height). v79: the
186
213
  // permission trigger collapses to its shield icon on phones — the label
@@ -86,6 +86,11 @@ export interface PluginCardSeat {
86
86
  label?: () => string
87
87
  /** Locale namespace the card renders with. */
88
88
  locale: string
89
+ /**
90
+ * Child slots this card declares and renders. Forwarded to whichever seat
91
+ * the host renders; absent for a card that declares none.
92
+ */
93
+ children?: Record<string, unknown>
89
94
  /** Business-face factory of the registration. */
90
95
  inject?: () => object
91
96
  /**
@@ -162,12 +167,14 @@ export function installPluginCard(ctx: PluginCardContext, seat: PluginCardSeat):
162
167
  ...(seat.order === undefined ? {} : { order: seat.order }),
163
168
  ...(seat.label === undefined ? {} : { label: seat.label }),
164
169
  locale: seat.locale,
170
+ ...(seat.children === undefined ? {} : { children: seat.children }),
165
171
  ...(seat.inject === undefined ? {} : { inject }),
166
172
  }
167
173
  : {
168
174
  name: OFFICIAL_PLUGIN_CARD_SEAT,
169
175
  key: seat.bundle,
170
176
  locale: seat.locale,
177
+ ...(seat.children === undefined ? {} : { children: seat.children }),
171
178
  ...(seat.inject === undefined ? {} : { inject }),
172
179
  }) as never, component) as () => void
173
180
  current = target
@@ -1,12 +1,13 @@
1
+ // Generated by scripts/sync-shared.mjs from shared/host/detached-work.ts. Do not edit this copy; edit the shared source and run "node scripts/sync-shared.mjs".
1
2
  /**
2
3
  * Run one piece of work outside the caller's async context.
3
4
  *
4
- * The Host performs a settings mutation inside `hmr.runExclusive`, which marks
5
- * the running async context with an AsyncLocalStorage store. Side effects that
6
- * live on that path - writing `cordis.patch.yml`, the very file the HMR config
7
- * watcher refreshes from - must not run under that mark, or the watcher's
8
- * refresh can re-enter the exclusive transaction and be refused with "HMR
9
- * transactions cannot be nested" (#1751, #1754).
5
+ * A Host mutation that runs inside `hmr.runExclusive` marks the running async
6
+ * context with an AsyncLocalStorage store. Side effects on that path that write
7
+ * a file the HMR config watcher refreshes from - `cordis.patch.yml` above all -
8
+ * must not run under that mark, or the watcher's refresh re-enters the
9
+ * exclusive transaction and is refused with "HMR transactions cannot be nested"
10
+ * (#1751, #1754, #1816).
10
11
  *
11
12
  * Deferring is NOT enough, and the earlier belt that this one replaces was
12
13
  * built on a disproven premise: Node propagates an AsyncLocalStorage store into
@@ -28,7 +29,7 @@
28
29
  * // -> undefined
29
30
  * ```
30
31
  *
31
- * @module
32
+ * @module dsh-web-shared/host/detached-work
32
33
  */
33
34
 
34
35
  import { AsyncResource } from 'node:async_hooks'
@@ -39,7 +40,7 @@ import { AsyncResource } from 'node:async_hooks'
39
40
  * instance is the only one the module ever needs. It carries no context of its
40
41
  * own, so every job run through it starts from the process's root context.
41
42
  */
42
- const DETACHED = new AsyncResource('dsh-remote-web-ui:detached-work', { triggerAsyncId: 0 })
43
+ const DETACHED = new AsyncResource('dsh-web:detached-work', { triggerAsyncId: 0 })
43
44
 
44
45
  /**
45
46
  * Run `work` outside the caller's AsyncLocalStorage context.
@@ -204,7 +204,7 @@ export function buildRemoteChannelBootScript(rules: RemoteChannelRules = REMOTE_
204
204
  /** Boot-watchdog latch: one self-reload per session while the boot is broken. */
205
205
  export const BOOT_WATCHDOG_KEY = 'dsh-remote-boot-reload'
206
206
 
207
- /** Total wait for the app's first conversation surface before the reload. */
207
+ /** Post-load wait for the app's first conversation surface before the reload. */
208
208
  const BOOT_WATCHDOG_WAIT_MS = 15_000
209
209
 
210
210
  /** Watchdog poll cadence. */
@@ -227,6 +227,9 @@ export function buildBootWatchdogScript(waitMs = BOOT_WATCHDOG_WAIT_MS, pollMs =
227
227
  ';function wBoot(){try{return !!(w.document&&w.document.querySelector&&(w.document.querySelector("[data-conversation-scroll]")||w.document.querySelector("[data-slot=\\"conversation\\"]")))}catch(e){return false}}' +
228
228
  'function wTick(n){try{' +
229
229
  'if(wBoot()){try{w.sessionStorage.removeItem(' + key + ')}catch(e){}return}' +
230
+ // Parse-time installation must not spend the recovery budget downloading
231
+ // the initial scripts/styles over a slow remote link (issue #1845).
232
+ 'if(!w.document||w.document.readyState!=="complete"){w.setTimeout(function(){wTick(0)},' + pollMs + ');return}' +
230
233
  'if(n<' + waitMs + '){w.setTimeout(function(){wTick(n+' + pollMs + ')},' + pollMs + ');return}' +
231
234
  'var done=false;try{done=w.sessionStorage.getItem(' + key + ')==="1"}catch(e){}' +
232
235
  'if(done)return;' +