better-dsh 0.2.3 → 0.2.4-b

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.
Files changed (406) hide show
  1. package/cordis.patch.yml +47 -16
  2. package/docs/10_plans/2026-09-23-remote-execution-framework.md +236 -0
  3. package/docs/10_plans/2026-09-23-remote-framework-impl.md +2083 -0
  4. package/docs/50_test-reports/2026-09-06-write/345/267/245/345/205/267sandbox/345/215/207/347/272/247/351/200/217/344/274/240bug/345/244/215/345/217/221/345/217/212/346/214/202/350/265/267-/344/272/213/344/273/266/346/212/245/345/221/212.md +176 -0
  5. package/docs/50_test-reports/2026-09-08-hashline-edit-E_RANGE_UNVERIFIED/350/267/250/350/275/256/344/274/232/350/257/235/351/224/256/345/244/261/346/225/210-/350/257/212/346/226/255/346/212/245/345/221/212.md +226 -0
  6. package/docs/50_test-reports/2026-09-11-control-prompt-into-eval-description/345/256/236/346/265/213/346/212/245/345/221/212.md +222 -0
  7. package/docs/50_test-reports/2026-09-12-fs-scheme-resolution-/345/256/236/346/265/213/346/212/245/345/221/212.md +81 -0
  8. package/docs/50_test-reports/2026-09-12-url-schemes-grammar-matrix/344/270/216catalog-centralize-/345/256/236/346/265/213/346/212/245/345/221/212.md +234 -0
  9. package/docs/50_test-reports/2026-09-12-url-schemes-recallable-context-design/351/252/214/350/257/201/346/212/245/345/221/212.md +160 -0
  10. package/docs/50_test-reports/2026-09-12-url-schemes-recallable-context-/345/256/236/346/265/213/345/211/247/346/234/254.md +44 -0
  11. package/docs/50_test-reports/2026-09-12-url-schemes-recallable-context-/345/256/236/346/265/213/346/212/245/345/221/212.md +89 -0
  12. package/docs/50_test-reports/2026-09-12-url-schemes-/345/205/255scheme/345/206/222/347/203/237/344/270/216/350/276/271/347/225/214/345/256/236/346/265/213/346/212/245/345/221/212.md +198 -0
  13. package/docs/50_test-reports/2026-09-13-hashline-off/344/270/213scheme/345/217/257/350/276/276/346/200/247/345/267/245/345/205/267/351/235/242/344/270/215/345/257/271/347/247/260-/345/256/236/346/265/213/346/212/245/345/221/212.md +246 -0
  14. package/docs/50_test-reports/2026-09-13-preact-ui-shell/345/256/236/346/265/213/346/212/245/345/221/212.md +50 -0
  15. package/docs/50_test-reports/2026-09-14-4999-skill/346/270/205/345/215/225/344/270/216lsp-gate/345/256/236/346/265/213/346/212/245/345/221/212.md +63 -0
  16. package/docs/50_test-reports/2026-09-17-plugins/351/241/265/345/205/255/347/273/204/344/273/266/346/213/206/345/210/206/345/256/236/346/265/213/346/212/245/345/221/212.md +76 -0
  17. package/docs/50_test-reports/2026-09-23-remote-framework/345/256/236/346/265/213/346/212/245/345/221/212.md +92 -0
  18. package/docs/50_test-reports/2026-09-23-remote-framework/347/254/254/344/270/200/344/272/272/347/247/260/345/244/215/346/265/213/346/212/245/345/221/212.md +125 -0
  19. package/docs/50_test-reports/upstream-dsh-0.1.3-alpha.2-local-test-report.md +44 -0
  20. package/docs/50_test-reports/upstream-dsh-0.1.3-alpha.2-report.md +110 -0
  21. package/docs/50_test-reports/upstream-dsh-0.1.5-rc.2-local-test-report.md +79 -0
  22. package/docs/50_test-reports/v0.2.3b-hashline-content-locator/345/256/236/346/265/213/346/212/245/345/221/212.md +73 -0
  23. package/docs/50_test-reports/v0.2.3c-mobile-wave/345/256/236/346/265/213/346/212/245/345/221/212.md +47 -0
  24. package/docs/50_test-reports/v0.2.4-ios-focus-zoom-suppression/345/256/236/346/265/213/346/212/245/345/221/212.md +158 -0
  25. package/docs/specs/agent/spec.md +54 -0
  26. package/docs/specs/ast/spec.md +34 -0
  27. package/docs/specs/compaction-recall/spec.md +46 -0
  28. package/docs/specs/ctx/spec.md +107 -0
  29. package/docs/specs/dsh/spec.md +47 -0
  30. package/docs/specs/dvc/spec.md +87 -0
  31. package/docs/specs/escalation-guidance/spec.md +44 -0
  32. package/docs/specs/fs-scheme-resolution/spec.md +37 -0
  33. package/docs/specs/hash-edit/spec.md +41 -0
  34. package/docs/specs/http-read/spec.md +73 -0
  35. package/docs/specs/kernel-provisioning/spec.md +53 -0
  36. package/docs/specs/lsp/spec.md +121 -0
  37. package/docs/specs/mobile-layout/spec.md +108 -0
  38. package/docs/specs/model-failover/spec.md +20 -0
  39. package/docs/specs/plugins-page-components/spec.md +79 -0
  40. package/docs/specs/preact-ui-shell/spec.md +22 -0
  41. package/docs/specs/repl-dispatch-resilience/spec.md +21 -0
  42. package/docs/specs/skill/spec.md +58 -0
  43. package/docs/specs/tool-surface/spec.md +222 -0
  44. package/docs/specs/url-schema/spec.md +148 -0
  45. package/docs/specs/web-trust-fence/spec.md +43 -0
  46. package/docs/upstream-dsh-0.1.5-rc.2-report.md +156 -0
  47. package/dsh-docs/AGENTS.md +75 -0
  48. package/dsh-docs/agent-lifecycle.md +84 -0
  49. package/dsh-docs/agent-lifecycle.zh.md +86 -0
  50. package/dsh-docs/api-gateway.md +164 -0
  51. package/dsh-docs/api-gateway.zh.md +164 -0
  52. package/dsh-docs/architecture.md +150 -0
  53. package/dsh-docs/architecture.zh.md +154 -0
  54. package/dsh-docs/capability-seams.md +543 -0
  55. package/dsh-docs/capability-seams.zh.md +545 -0
  56. package/dsh-docs/config-catalog.md +3473 -0
  57. package/dsh-docs/config-catalog.zh.md +3474 -0
  58. package/dsh-docs/cookbook/adding-a-package.md +117 -0
  59. package/dsh-docs/cookbook/adding-a-package.zh.md +119 -0
  60. package/dsh-docs/cookbook/adding-a-remote-api.md +197 -0
  61. package/dsh-docs/cookbook/adding-a-remote-api.zh.md +197 -0
  62. package/dsh-docs/cookbook/adding-a-session-format-version.md +109 -0
  63. package/dsh-docs/cookbook/adding-a-session-format-version.zh.md +109 -0
  64. package/dsh-docs/cookbook/adding-a-settings-card.md +102 -0
  65. package/dsh-docs/cookbook/adding-a-settings-card.zh.md +102 -0
  66. package/dsh-docs/cookbook/adding-a-tool.md +101 -0
  67. package/dsh-docs/cookbook/adding-a-tool.zh.md +103 -0
  68. package/dsh-docs/cookbook/adding-a-vendored-package.md +59 -0
  69. package/dsh-docs/cookbook/adding-a-vendored-package.zh.md +59 -0
  70. package/dsh-docs/cookbook/adding-an-llm-adapter.md +43 -0
  71. package/dsh-docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
  72. package/dsh-docs/cookbook/extension-cookbook.md +132 -0
  73. package/dsh-docs/cookbook/extension-cookbook.zh.md +136 -0
  74. package/dsh-docs/cookbook/maintaining-dsh-code-review.md +64 -0
  75. package/dsh-docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  76. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  77. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  78. package/dsh-docs/cordis-api/context.md +364 -0
  79. package/dsh-docs/cordis-api/context.zh.md +366 -0
  80. package/dsh-docs/cordis-api/events.md +207 -0
  81. package/dsh-docs/cordis-api/events.zh.md +209 -0
  82. package/dsh-docs/cordis-api/fiber.md +375 -0
  83. package/dsh-docs/cordis-api/fiber.zh.md +377 -0
  84. package/dsh-docs/cordis-api/inherited.md +39 -0
  85. package/dsh-docs/cordis-api/registry.md +152 -0
  86. package/dsh-docs/cordis-api/registry.zh.md +154 -0
  87. package/dsh-docs/cordis-api/service.md +102 -0
  88. package/dsh-docs/cordis-api/service.zh.md +104 -0
  89. package/dsh-docs/cordis-primer.md +45 -0
  90. package/dsh-docs/cordis-primer.zh.md +51 -0
  91. package/dsh-docs/cordis-tutorial/01-first-plugin.md +95 -0
  92. package/dsh-docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
  93. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  94. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  95. package/dsh-docs/cordis-tutorial/03-services.md +98 -0
  96. package/dsh-docs/cordis-tutorial/03-services.zh.md +98 -0
  97. package/dsh-docs/cordis-tutorial/04-events.md +144 -0
  98. package/dsh-docs/cordis-tutorial/04-events.zh.md +144 -0
  99. package/dsh-docs/cordis-tutorial/05-config.md +84 -0
  100. package/dsh-docs/cordis-tutorial/05-config.zh.md +84 -0
  101. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
  102. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  103. package/dsh-docs/cordis-tutorial/07-into-the-harness.md +108 -0
  104. package/dsh-docs/cordis-tutorial/07-into-the-harness.zh.md +108 -0
  105. package/dsh-docs/cordis-tutorial/index.md +60 -0
  106. package/dsh-docs/cordis-tutorial/index.zh.md +62 -0
  107. package/dsh-docs/deepseek-llm-api-wire-extensions.md +163 -0
  108. package/dsh-docs/deepseek-llm-api-wire-extensions.zh.md +163 -0
  109. package/dsh-docs/defensive-patterns.md +33 -0
  110. package/dsh-docs/defensive-patterns.zh.md +35 -0
  111. package/dsh-docs/development.md +167 -0
  112. package/dsh-docs/development.zh.md +173 -0
  113. package/dsh-docs/event-producer-consumer.md +86 -0
  114. package/dsh-docs/event-producer-consumer.zh.md +88 -0
  115. package/dsh-docs/glossary.md +45 -0
  116. package/dsh-docs/glossary.zh.md +45 -0
  117. package/dsh-docs/graph-atlas.md +22 -0
  118. package/dsh-docs/graph-atlas.zh.md +24 -0
  119. package/dsh-docs/i18n/README.md +60 -0
  120. package/dsh-docs/i18n/README.zh.md +62 -0
  121. package/dsh-docs/i18n/style-samples.md +87 -0
  122. package/dsh-docs/i18n/terminology.md +214 -0
  123. package/dsh-docs/i18n/translation-prompt.md +263 -0
  124. package/dsh-docs/i18n/translation-rules.md +69 -0
  125. package/dsh-docs/i18n/translation-rules.zh.md +69 -0
  126. package/dsh-docs/module-graph.md +1411 -0
  127. package/dsh-docs/module-graph.zh.md +1413 -0
  128. package/dsh-docs/persistence-catalog.md +1075 -0
  129. package/dsh-docs/persistence-catalog.zh.md +1077 -0
  130. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  131. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  132. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  133. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  134. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  135. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  136. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  137. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  138. package/dsh-docs/postmortem/README.md +18 -0
  139. package/dsh-docs/postmortem/README.zh.md +18 -0
  140. package/dsh-docs/rescope.md +53 -0
  141. package/dsh-docs/rescope.zh.md +53 -0
  142. package/dsh-docs/session-format-status.md +47 -0
  143. package/dsh-docs/session-format-status.zh.md +47 -0
  144. package/dsh-docs/subsystems/README.md +61 -0
  145. package/dsh-docs/subsystems/README.zh.md +61 -0
  146. package/dsh-docs/subsystems/agent-team.md +207 -0
  147. package/dsh-docs/subsystems/agent-team.zh.md +207 -0
  148. package/dsh-docs/subsystems/approval.md +170 -0
  149. package/dsh-docs/subsystems/approval.zh.md +170 -0
  150. package/dsh-docs/subsystems/attachment.md +351 -0
  151. package/dsh-docs/subsystems/attachment.zh.md +351 -0
  152. package/dsh-docs/subsystems/client-modules.md +168 -0
  153. package/dsh-docs/subsystems/client-modules.zh.md +168 -0
  154. package/dsh-docs/subsystems/client-resources.md +91 -0
  155. package/dsh-docs/subsystems/client-resources.zh.md +91 -0
  156. package/dsh-docs/subsystems/code-runtime.md +195 -0
  157. package/dsh-docs/subsystems/code-runtime.zh.md +195 -0
  158. package/dsh-docs/subsystems/commands.md +219 -0
  159. package/dsh-docs/subsystems/commands.zh.md +219 -0
  160. package/dsh-docs/subsystems/compaction.md +238 -0
  161. package/dsh-docs/subsystems/compaction.zh.md +238 -0
  162. package/dsh-docs/subsystems/conversation.md +258 -0
  163. package/dsh-docs/subsystems/conversation.zh.md +258 -0
  164. package/dsh-docs/subsystems/core.md +1209 -0
  165. package/dsh-docs/subsystems/core.zh.md +1219 -0
  166. package/dsh-docs/subsystems/credentials.md +329 -0
  167. package/dsh-docs/subsystems/credentials.zh.md +329 -0
  168. package/dsh-docs/subsystems/extensions.md +382 -0
  169. package/dsh-docs/subsystems/extensions.zh.md +382 -0
  170. package/dsh-docs/subsystems/feedback.md +266 -0
  171. package/dsh-docs/subsystems/feedback.zh.md +266 -0
  172. package/dsh-docs/subsystems/filesystem.md +505 -0
  173. package/dsh-docs/subsystems/filesystem.zh.md +505 -0
  174. package/dsh-docs/subsystems/goal.md +277 -0
  175. package/dsh-docs/subsystems/goal.zh.md +277 -0
  176. package/dsh-docs/subsystems/invariants.md +88 -0
  177. package/dsh-docs/subsystems/invariants.zh.md +88 -0
  178. package/dsh-docs/subsystems/jobs.md +290 -0
  179. package/dsh-docs/subsystems/jobs.zh.md +290 -0
  180. package/dsh-docs/subsystems/llm-streaming.md +1080 -0
  181. package/dsh-docs/subsystems/llm-streaming.zh.md +1086 -0
  182. package/dsh-docs/subsystems/lsp.md +202 -0
  183. package/dsh-docs/subsystems/lsp.zh.md +202 -0
  184. package/dsh-docs/subsystems/permission-presets.md +131 -0
  185. package/dsh-docs/subsystems/permission-presets.zh.md +131 -0
  186. package/dsh-docs/subsystems/persistence.md +395 -0
  187. package/dsh-docs/subsystems/persistence.zh.md +395 -0
  188. package/dsh-docs/subsystems/plan.md +87 -0
  189. package/dsh-docs/subsystems/plan.zh.md +87 -0
  190. package/dsh-docs/subsystems/sandbox.md +220 -0
  191. package/dsh-docs/subsystems/sandbox.zh.md +220 -0
  192. package/dsh-docs/subsystems/schedule.md +192 -0
  193. package/dsh-docs/subsystems/schedule.zh.md +192 -0
  194. package/dsh-docs/subsystems/scope.md +59 -0
  195. package/dsh-docs/subsystems/scope.zh.md +59 -0
  196. package/dsh-docs/subsystems/session-projection.md +354 -0
  197. package/dsh-docs/subsystems/session-projection.zh.md +354 -0
  198. package/dsh-docs/subsystems/session-query.md +509 -0
  199. package/dsh-docs/subsystems/session-query.zh.md +509 -0
  200. package/dsh-docs/subsystems/session-reference.md +219 -0
  201. package/dsh-docs/subsystems/session-reference.zh.md +219 -0
  202. package/dsh-docs/subsystems/session-telemetry.md +194 -0
  203. package/dsh-docs/subsystems/session-telemetry.zh.md +194 -0
  204. package/dsh-docs/subsystems/session-title.md +204 -0
  205. package/dsh-docs/subsystems/session-title.zh.md +204 -0
  206. package/dsh-docs/subsystems/session.md +1155 -0
  207. package/dsh-docs/subsystems/session.zh.md +1159 -0
  208. package/dsh-docs/subsystems/settings.md +405 -0
  209. package/dsh-docs/subsystems/settings.zh.md +405 -0
  210. package/dsh-docs/subsystems/shell.md +303 -0
  211. package/dsh-docs/subsystems/shell.zh.md +303 -0
  212. package/dsh-docs/subsystems/sidebar-right.md +148 -0
  213. package/dsh-docs/subsystems/sidebar-right.zh.md +148 -0
  214. package/dsh-docs/subsystems/skills.md +354 -0
  215. package/dsh-docs/subsystems/skills.zh.md +354 -0
  216. package/dsh-docs/subsystems/slots.md +175 -0
  217. package/dsh-docs/subsystems/slots.zh.md +175 -0
  218. package/dsh-docs/subsystems/spill.md +117 -0
  219. package/dsh-docs/subsystems/spill.zh.md +117 -0
  220. package/dsh-docs/subsystems/storage.md +260 -0
  221. package/dsh-docs/subsystems/storage.zh.md +260 -0
  222. package/dsh-docs/subsystems/subagent.md +766 -0
  223. package/dsh-docs/subsystems/subagent.zh.md +770 -0
  224. package/dsh-docs/subsystems/subprocess.md +324 -0
  225. package/dsh-docs/subsystems/subprocess.zh.md +324 -0
  226. package/dsh-docs/subsystems/system-prompt.md +220 -0
  227. package/dsh-docs/subsystems/system-prompt.zh.md +220 -0
  228. package/dsh-docs/subsystems/terminal.md +184 -0
  229. package/dsh-docs/subsystems/terminal.zh.md +184 -0
  230. package/dsh-docs/subsystems/todo.md +32 -0
  231. package/dsh-docs/subsystems/todo.zh.md +32 -0
  232. package/dsh-docs/subsystems/token-meter.md +105 -0
  233. package/dsh-docs/subsystems/token-meter.zh.md +105 -0
  234. package/dsh-docs/subsystems/tools.md +720 -0
  235. package/dsh-docs/subsystems/tools.zh.md +720 -0
  236. package/dsh-docs/subsystems/typert.md +343 -0
  237. package/dsh-docs/subsystems/typert.zh.md +343 -0
  238. package/dsh-docs/subsystems/user-questions.md +178 -0
  239. package/dsh-docs/subsystems/user-questions.zh.md +178 -0
  240. package/dsh-docs/subsystems/web-client.md +95 -0
  241. package/dsh-docs/subsystems/web-client.zh.md +95 -0
  242. package/dsh-docs/subsystems/web-server.md +154 -0
  243. package/dsh-docs/subsystems/web-server.zh.md +154 -0
  244. package/dsh-docs/subsystems/web.md +206 -0
  245. package/dsh-docs/subsystems/web.zh.md +206 -0
  246. package/dsh-docs/subsystems/webhook.md +70 -0
  247. package/dsh-docs/subsystems/webhook.zh.md +70 -0
  248. package/dsh-docs/subsystems/workflow.md +278 -0
  249. package/dsh-docs/subsystems/workflow.zh.md +278 -0
  250. package/dsh-docs/subsystems/workspace.md +321 -0
  251. package/dsh-docs/subsystems/workspace.zh.md +321 -0
  252. package/dsh-docs/testing.md +54 -0
  253. package/dsh-docs/testing.zh.md +54 -0
  254. package/dsh-docs/tool-catalog.md +2225 -0
  255. package/dsh-docs/tool-catalog.zh.md +2233 -0
  256. package/dsh-docs/tool-execution-pipeline.md +62 -0
  257. package/dsh-docs/tool-execution-pipeline.zh.md +64 -0
  258. package/dsh-docs/user/develop/basic/config.md +106 -0
  259. package/dsh-docs/user/develop/basic/config.zh.md +106 -0
  260. package/dsh-docs/user/develop/basic/index.md +144 -0
  261. package/dsh-docs/user/develop/basic/index.zh.md +144 -0
  262. package/dsh-docs/user/develop/basic/publish.md +183 -0
  263. package/dsh-docs/user/develop/basic/publish.zh.md +183 -0
  264. package/dsh-docs/user/develop/basic/tool.md +52 -0
  265. package/dsh-docs/user/develop/basic/tool.zh.md +52 -0
  266. package/dsh-docs/user/develop/framework/events.md +143 -0
  267. package/dsh-docs/user/develop/framework/events.zh.md +143 -0
  268. package/dsh-docs/user/develop/framework/index.md +137 -0
  269. package/dsh-docs/user/develop/framework/index.zh.md +137 -0
  270. package/dsh-docs/user/develop/framework/service.md +148 -0
  271. package/dsh-docs/user/develop/framework/service.zh.md +150 -0
  272. package/dsh-docs/user/develop/practice/dynamic-cordis.md +15 -0
  273. package/dsh-docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
  274. package/dsh-docs/user/develop/practice/index.md +155 -0
  275. package/dsh-docs/user/develop/practice/index.zh.md +155 -0
  276. package/dsh-docs/user/develop/practice/llm-adapter.md +189 -0
  277. package/dsh-docs/user/develop/practice/llm-adapter.zh.md +189 -0
  278. package/dsh-docs/user/guide/github-review.md +102 -0
  279. package/dsh-docs/user/guide/github-review.zh.md +102 -0
  280. package/dsh-docs/user/guide/index.md +30 -0
  281. package/dsh-docs/user/guide/index.zh.md +30 -0
  282. package/dsh-docs/user/guide/mcp-memory.md +101 -0
  283. package/dsh-docs/user/guide/mcp-memory.zh.md +101 -0
  284. package/dsh-docs/user/guide/network-proxy.md +85 -0
  285. package/dsh-docs/user/guide/network-proxy.zh.md +85 -0
  286. package/dsh-docs/user/guide/providers.md +190 -0
  287. package/dsh-docs/user/guide/providers.zh.md +190 -0
  288. package/dsh-docs/user/guide/python-sdk.md +150 -0
  289. package/dsh-docs/user/guide/python-sdk.zh.md +150 -0
  290. package/dsh-docs/user/guide/schedule.md +21 -0
  291. package/dsh-docs/user/guide/schedule.zh.md +21 -0
  292. package/dsh-docs/user/index.md +11 -0
  293. package/dsh-docs/user/index.zh.md +11 -0
  294. package/dsh-docs/web-styling.md +29 -0
  295. package/dsh-docs/web-styling.zh.md +29 -0
  296. package/eval-description.md +33 -0
  297. package/lib/client/index.js +328 -89
  298. package/lib/compaction/index.d.ts +47 -0
  299. package/lib/compaction/index.js +159 -0
  300. package/lib/failover/index.d.ts +35 -0
  301. package/lib/failover/index.js +141 -0
  302. package/lib/fs-aware/sandbox-plugin.d.ts +71 -0
  303. package/lib/fs-aware/sandbox-plugin.js +249 -0
  304. package/lib/index.d.ts +10 -41
  305. package/lib/index.js +226 -8173
  306. package/lib/lsp-server-registry-946ysdqg.js +972 -0
  307. package/lib/lsp-server-registry-XU6aHSqZ.js +3 -0
  308. package/lib/mobile/plugin.d.ts +29 -0
  309. package/lib/mobile/plugin.js +54 -0
  310. package/lib/native-capture-x_Hos2e8.js +68 -0
  311. package/lib/py-sdk-Chvy92MB.js +178 -0
  312. package/lib/py-sdk.d.ts +19 -2
  313. package/lib/py-sdk.js +2 -2
  314. package/lib/remote/plugin.d.ts +24 -0
  315. package/lib/remote/plugin.js +1095 -0
  316. package/lib/url-schemes/index.d.ts +88 -0
  317. package/lib/url-schemes/index.js +7200 -0
  318. package/lib/web-trust-BO66y72w.js +361 -0
  319. package/lib/web-trust-CgpBoFv3.d.ts +106 -0
  320. package/lib/web-trust.d.ts +2 -0
  321. package/lib/web-trust.js +3 -0
  322. package/lib/wrap-Dr8XtIak.js +747 -0
  323. package/package.json +87 -56
  324. package/url-schemes-instruction.md +22 -0
  325. package/control-prompt.md +0 -37
  326. package/docs/50_test-reports/v0.1.8d_artifacts/README.md +0 -138
  327. package/docs/50_test-reports/v0.1.8d_artifacts/code-mode-repl-only.observation.md +0 -74
  328. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +0 -3890
  329. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +0 -544
  330. package/docs/50_test-reports/v0.1.8d_artifacts/functions.json +0 -592
  331. package/docs/50_test-reports/v0.1.8d_artifacts/skills-catalog.snapshot.md +0 -30
  332. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.output-schemas.json +0 -1236
  333. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.python.txt +0 -592
  334. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.typescript.txt +0 -516
  335. package/docs/50_test-reports/v0.1.8d_artifacts/wire-vs-transcription.diff.md +0 -54
  336. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.lock +0 -7
  337. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.toml +0 -6
  338. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +0 -8
  339. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/main.rs +0 -4
  340. package/docs/50_test-reports/v0.2.0b_artifacts/hashline-probe.md +0 -5
  341. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.lock +0 -7
  342. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.toml +0 -7
  343. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/build.rs +0 -4
  344. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/src/main.rs +0 -13
  345. package/docs/60_exploration-and-research/cordis-research.md +0 -350
  346. package/docs/60_exploration-and-research/dsh-web-profile-package-map.md +0 -186
  347. package/docs/60_exploration-and-research/dsh-web-ui-slot-system-research.md +0 -310
  348. package/docs/60_exploration-and-research/dsh-webui-strip-boundary-research.md +0 -300
  349. package/docs/60_exploration-and-research/ios-chat-app-bridge-research.md +0 -324
  350. package/docs/60_exploration-and-research/web-frontend-composability-research.md +0 -191
  351. package/docs/REPL-/345/267/245/345/205/267/350/260/203/347/224/250-/346/210/252/346/226/255/350/257/212/346/226/255.md +0 -110
  352. package/docs/adr/0001-bridge-tool-layer-not-service-layer.md +0 -14
  353. package/docs/adr/0002-masking-is-presentation-only.md +0 -15
  354. package/docs/plans/A2A-messaging-channel-test-archive.md +0 -256
  355. package/docs/plans/code-mode-vs-rlm-ipython-comparison.md +0 -137
  356. package/docs/plans/dashr-blueprint-review.md +0 -201
  357. package/docs/plans/dashr-blueprint.md +0 -561
  358. package/docs/plans/dashr-compaction-window-and-archive.md +0 -307
  359. package/docs/plans/dashr-profile-layer-feasibility.md +0 -367
  360. package/docs/plans/dashr-sandbox-escalation-semantics-gap.md +0 -171
  361. package/docs/plans/dashr-security-sandbox-analysis.md +0 -187
  362. package/docs/plans/dashr-surface-invariant-and-omp-imports.md +0 -97
  363. package/docs/plans/ipython-kernel-interactive-interface-test-report.md +0 -152
  364. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft.md +0 -146
  365. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v3.md +0 -50
  366. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v4.md +0 -79
  367. package/docs/plans/kernel-refactoring/Dash-vs-PrimeAgent-systemprompt-toolcatalog-comparison.md +0 -138
  368. package/docs/plans/kernel-refactoring/RLM-system-prompt-injection-gap-report.md +0 -161
  369. package/docs/plans/kernel-refactoring/V0.1.5-development-plan.md +0 -109
  370. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_dsh.md +0 -50
  371. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_prime.md +0 -113
  372. package/docs/plans/recallable-compaction.md +0 -147
  373. package/docs/plans/spike-tag-repro.mjs +0 -102
  374. package/docs/plans/upstream-analysis.md +0 -128
  375. package/docs/v0.1.8-improved-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -142
  376. package/docs/v0.1.8-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -193
  377. package/docs/v0.1.8b-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -96
  378. package/docs/v0.1.8c-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -127
  379. package/docs/v0.1.8d-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -150
  380. package/docs/v0.1.8d_artifacts/README.md +0 -138
  381. package/docs/v0.1.8d_artifacts/code-mode-repl-only.observation.md +0 -74
  382. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +0 -3890
  383. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +0 -544
  384. package/docs/v0.1.8d_artifacts/functions.json +0 -592
  385. package/docs/v0.1.8d_artifacts/skills-catalog.snapshot.md +0 -30
  386. package/docs/v0.1.8d_artifacts/tools-sdk.output-schemas.json +0 -1236
  387. package/docs/v0.1.8d_artifacts/tools-sdk.python.txt +0 -592
  388. package/docs/v0.1.8d_artifacts/tools-sdk.typescript.txt +0 -516
  389. package/docs/v0.1.8d_artifacts/wire-vs-transcription.diff.md +0 -54
  390. package/docs/v0.1.8e-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -224
  391. package/docs/v0.1.9a-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -168
  392. package/docs/v0.2.0b-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -123
  393. package/docs/v0.2.0b_artifacts/f2probe/Cargo.lock +0 -7
  394. package/docs/v0.2.0b_artifacts/f2probe/Cargo.toml +0 -6
  395. package/docs/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +0 -8
  396. package/docs/v0.2.0b_artifacts/f2probe/src/main.rs +0 -4
  397. package/docs/v0.2.0b_artifacts/hashline-probe.md +0 -5
  398. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.lock +0 -7
  399. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.toml +0 -7
  400. package/docs/v0.2.0b_artifacts/slowprobe/build.rs +0 -4
  401. package/docs/v0.2.0b_artifacts/slowprobe/src/main.rs +0 -13
  402. package/docs/v0.2.1-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -110
  403. package/docs/v0.2.1b-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -86
  404. package/docs/v0.2.1c-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -66
  405. package/lib/py-sdk-BCaOGYz7.d.ts +0 -125
  406. package/lib/py-sdk-CbgYiX8O.js +0 -691
@@ -0,0 +1,361 @@
1
+ import { Context } from "@deepseek-ai/cordis";
2
+ import z from "@deepseek-ai/schemastery";
3
+
4
+ //#region src/mobile/zoom-guard.ts
5
+ /**
6
+ * Whether a UA string + touch-capability pair is an iOS-class browser
7
+ * (design D2, mirroring Discourse `capabilities.isIOS`): iPhone/iPod/iPad,
8
+ * plus iPadOS 13+ desktop-Safari masquerade (`Macintosh` UA with a
9
+ * multi-touch digitizer). Deliberately NOT `pointer:coarse` — Android Chrome
10
+ * never focus-zooms and `maximum-scale` has historical side effects there,
11
+ * so the gate is tightened to the iOS family. UA-shape drift degrades
12
+ * benignly: a novel UA simply reads as non-iOS and no rewriting happens.
13
+ *
14
+ * @param ua - `navigator.userAgent`.
15
+ * @param maxTouchPoints - `navigator.maxTouchPoints` (0 when absent).
16
+ * @returns `true` for iOS-class browsers.
17
+ */
18
+ function isIOSClassUA(ua, maxTouchPoints) {
19
+ return /iPhone|iPod|iPad/.test(ua) || /Macintosh/.test(ua) && maxTouchPoints > 1;
20
+ }
21
+ /**
22
+ * Token-level merge of viewport directives into a viewport meta `content`
23
+ * string (design D4): existing tokens keep their positions, a token whose key
24
+ * (compared case-insensitively) is in `tokens` is REPLACED by the configured
25
+ * key=value, and configured keys not present are APPENDED in insertion order.
26
+ * Idempotent by construction — merging always re-derives from the input, so
27
+ * repeated evaluation cannot accumulate duplicates.
28
+ *
29
+ * mergeViewportTokens('width=device-width, initial-scale=1', T)
30
+ * → 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
31
+ * mergeViewportTokens('width=device-width, maximum-scale=5', T)
32
+ * → 'width=device-width, maximum-scale=1, user-scalable=no' // same-key override, position kept
33
+ *
34
+ * @param content - the stock (or stock-equivalent) content string.
35
+ * @param tokens - the directives to merge, keyed lowercase.
36
+ * @returns the merged content string.
37
+ */
38
+ function mergeViewportTokens(content, tokens) {
39
+ var out = [];
40
+ var seen = {};
41
+ var parts = content.split(",");
42
+ for (var i = 0; i < parts.length; i++) {
43
+ var part = parts[i];
44
+ var raw = (part === void 0 ? "" : part).replace(/^\s+|\s+$/g, "");
45
+ if (raw === "") continue;
46
+ var eq = raw.indexOf("=");
47
+ var key = eq < 0 ? raw : raw.slice(0, eq).replace(/^\s+|\s+$/g, "");
48
+ var hit = null;
49
+ for (var k in tokens) if (tokens.hasOwnProperty(k) && k.toLowerCase() === key.toLowerCase()) {
50
+ hit = k;
51
+ break;
52
+ }
53
+ if (hit === null) {
54
+ out[out.length] = raw;
55
+ continue;
56
+ }
57
+ out[out.length] = hit + "=" + tokens[hit];
58
+ seen[hit] = true;
59
+ }
60
+ for (var j in tokens) if (tokens.hasOwnProperty(j) && !seen[j]) out[out.length] = j + "=" + tokens[j];
61
+ return out.join(", ");
62
+ }
63
+ /**
64
+ * The double gate (design D2/D3 + the `zoomGuard` config): rewrite applies
65
+ * only on an iOS-class browser AND a narrow viewport AND a non-`off`
66
+ * `zoomGuard`. An absent payload (or absent key) means the `'meta'` default —
67
+ * the same default-on posture as the mobile leg itself — so only an explicit
68
+ * `'off'` disarms the guard. Unknown non-`off` values read as `'meta'`
69
+ * (schema validation makes them unreachable in production; benign here).
70
+ *
71
+ * @param config - the `__DASHR_MOBILE__` payload (only `zoomGuard` is read).
72
+ * @param isIOS - {@link isIOSClassUA} verdict for this page load.
73
+ * @param isNarrow - `matchMedia('(max-width: breakpoint-0.02px)')` verdict.
74
+ * @returns `true` when the viewport rewrite should be applied.
75
+ */
76
+ function shouldApplyZoomGuard(config, isIOS, isNarrow) {
77
+ if (!isIOS || !isNarrow) return false;
78
+ if (!config) return true;
79
+ return config.zoomGuard !== "off";
80
+ }
81
+ /**
82
+ * Standalone display-mode verdict (design D4 of change
83
+ * `2026-09-03-zoomguard-standalone-font-floor`): standalone PWAs HONOR
84
+ * `user-scalable=no` (the real-device pinch regression that motivated the
85
+ * display-mode split), so they must never enter the meta-rewrite path. Two
86
+ * sources, strict-`true` OR: the `(display-mode: standalone)` media query
87
+ * (primary) and legacy `navigator.standalone` (older iOS Safari exposes only
88
+ * the latter). Anything else — `undefined` (engine without the source),
89
+ * `false`, or truthy junk — reads as NOT standalone.
90
+ *
91
+ * @param mqMatchesStandalone - `matchMedia('(display-mode: standalone)').matches`.
92
+ * @param navStandalone - `navigator.standalone === true`.
93
+ * @returns `true` in standalone display mode (either source).
94
+ */
95
+ function isStandaloneDisplay(mqMatchesStandalone, navStandalone) {
96
+ return mqMatchesStandalone === true || navStandalone === true;
97
+ }
98
+ /**
99
+ * The 16px font floor stylesheet (design D3): iOS auto-zooms on focus into
100
+ * ANY control whose computed font-size is below 16px, so in standalone mode
101
+ * — where the meta rewrite is off the table (pinch must stay
102
+ * engine-available) — the floor IS the suppression. Scoped by the same
103
+ * breakpoint band the meta leg uses and derived the same way
104
+ * (`breakpoint - 0.02`: 768 → 767.98, 900 → 899.98); `!important` beats the
105
+ * 13/14px CSS module rules and the body inline var chain;
106
+ * `[contenteditable="true"]` matches only the editable state (React
107
+ * serializes `contentEditable={bool}` to the literal attribute value
108
+ * "true"/"false").
109
+ *
110
+ * @param breakpointPx - the configured `mobile.breakpoint` (raw — this
111
+ * function derives the `-0.02` band itself, do NOT pre-subtract).
112
+ * @returns the complete stylesheet text.
113
+ */
114
+ function buildFontFloorCss(breakpointPx) {
115
+ return "@media (max-width:" + (breakpointPx - .02) + "px){ input,textarea,select,[contenteditable=\"true\"]{ font-size:16px !important } }";
116
+ }
117
+ /**
118
+ * Build the boot script's zoomGuard section: the five decision predicates
119
+ * embedded via `toString()` plus the DOM state machine that applies them.
120
+ * The machine implements design D3/D4 with one discovered refinement —
121
+ *
122
+ * **The standalone fork (2026-09-03, change
123
+ * `2026-09-03-zoomguard-standalone-font-floor`).** Real-device datum:
124
+ * standalone (Add to Home Screen) iOS HONORS `user-scalable=no`, so the
125
+ * meta rewrite that is benign in-browser (pinch stays engine-controlled)
126
+ * kills pinch in the PWA — the user's primary surface. The section
127
+ * therefore forks right after the iOS gate, BEFORE any meta machinery: a
128
+ * one-shot startup verdict (display-mode never flips mid-session) via the
129
+ * `(display-mode: standalone)` MQ or legacy `navigator.standalone` (D4).
130
+ * Standalone → inject the `ios-zoom-font-floor` style element into the
131
+ * head (16px floor, media-query-scoped to the same breakpoint band, D3)
132
+ * and RETURN — no provisional meta, no reconcile observer, no ladder
133
+ * timer, no listeners, byte-identical stock meta (D1). The width dimension
134
+ * lives inside the stylesheet's media query, so the injection itself is
135
+ * NOT width-gated: a wide standalone load still gets the element; the rule
136
+ * simply does not match above the breakpoint. Browser mode runs the v0.2.4
137
+ * machinery unchanged.
138
+ * **Why reconciliation exists.** The webserver splices head injections
139
+ * immediately after the opening `<head>` tag, i.e. BEFORE the stock
140
+ * `<meta name="viewport">` in upstream's `index.html`. At boot-script time
141
+ * the stock meta is therefore NOT yet parsed, so the "meta missing"
142
+ * branch is the NORMAL path on the served shell, not an edge case. A
143
+ * provisional meta is created right away (the timing requirement: the
144
+ * suppressive tokens are live before any application bundle can focus an
145
+ * input), and a MutationObserver watches for the parser to insert the stock
146
+ * meta; the moment it appears, the guard records the true stock content,
147
+ * rewrites the STOCK meta (token merge, D4's actual semantics — restore
148
+ * later writes these exact bytes back), and removes the provisional one —
149
+ * leaving a single-meta document instead of relying on engines'
150
+ * unspecified multi-meta merge behavior. Engines without MutationObserver
151
+ * keep the provisional meta for the page's lifetime (degraded but still
152
+ * suppressive); the observer is never started once the stock meta was
153
+ * found synchronously.
154
+ *
155
+ * **Why the re-evaluation ladder exists (2026-09-03 rework, lead CDP
156
+ * finding on the 4999 instance).** The boot script runs during head parsing,
157
+ * BEFORE the engine applies the stock viewport meta — the layout viewport at
158
+ * first evaluation is the pre-meta engine default (980px observed), so
159
+ * `mq.matches` reads false on an initial narrow load, and the narrowing that
160
+ * follows meta application does NOT reliably dispatch `resize` to the page
161
+ * during load (headless Chrome: never). A ~10ms poll ladder therefore
162
+ * re-evaluates until the guard IS applied, `document.readyState` reaches
163
+ * `'complete'`, or ~2s elapse — the first layout always precedes deferred
164
+ * scripts, so the ladder lands the guard before any application bundle can
165
+ * focus an input. Steady-state ticks are idempotent no-ops; a wide load
166
+ * idles to the readyState stop and leaves no timer behind (a pending tick
167
+ * is also cancelled the moment the guard lands). MediaQuery `change` events
168
+ * (with the legacy `addListener` fallback) form a second re-evaluation
169
+ * channel alongside window `resize`.
170
+ *
171
+ * State machine (ES5, zero dependencies, synchronous first evaluation):
172
+ * `meta` is the element under management (provisional or reconciled stock),
173
+ * `stock` its recorded stock content, `mine` whether we created it,
174
+ * `applied` the last applied gate verdict. `apply(on)` is idempotent per
175
+ * state (no-op when the verdict is unchanged); merges always re-derive
176
+ * from the recorded stock, never from the live content, so resize storms
177
+ * cannot accumulate tokens. Non-iOS pages never wire any listener.
178
+ *
179
+ * Emitted only when the mobile payload exists and `zoomGuard !== 'off'`.
180
+ *
181
+ * @returns the inline section text (truthy `var` declarations + IIFE).
182
+ */
183
+ function buildZoomGuardSection() {
184
+ return [
185
+ `var ZI=${isIOSClassUA.toString()};`,
186
+ `var ZM=${mergeViewportTokens.toString()};`,
187
+ `var ZS=${shouldApplyZoomGuard.toString()};`,
188
+ `var ZD=${isStandaloneDisplay.toString()};`,
189
+ `var ZF=${buildFontFloorCss.toString()};`,
190
+ "(function(){",
191
+ "var m=window.__DASHR_MOBILE__;",
192
+ "var ios=ZI(navigator.userAgent,(navigator.maxTouchPoints||0));",
193
+ "if(!ios)return;",
194
+ "var bpx=(m&&typeof m.breakpoint==='number'&&m.breakpoint>0)?m.breakpoint:768;",
195
+ "var bp=bpx-0.02;",
196
+ "var sa=ZD((window.matchMedia&&window.matchMedia('(display-mode: standalone)').matches),(navigator.standalone===true));",
197
+ "if(sa){var f=document.createElement('style');f.setAttribute('id','ios-zoom-font-floor');f.setAttribute('data-plugin','better-dsh');f.setAttribute('data-plugin-css','better-dsh/zoom-font-floor');f.textContent=ZF(bpx);headEl().appendChild(f);return}",
198
+ "var mq=(typeof window.matchMedia==='function')?window.matchMedia('(max-width:'+bp+'px)'):null;",
199
+ "var T={'maximum-scale':'1','user-scalable':'no'};",
200
+ "var meta=null,stock=null,mine=false,applied=false,obs=null,lad=null,lN=0;",
201
+ "function findStock(){var s=document.getElementsByTagName('meta');for(var i=0;i<s.length;i++){var e=s[i];if(e!==meta&&(e.getAttribute('name')||'').toLowerCase()==='viewport')return e}return null}",
202
+ "function headEl(){return document.head||document.getElementsByTagName('head')[0]||document.documentElement}",
203
+ "function stopWatch(){if(obs){obs.disconnect();obs=null}}",
204
+ "function stopLadder(){if(lad){clearTimeout(lad);lad=null}}",
205
+ "function dropMine(){if(meta&&mine){if(meta.parentNode)meta.parentNode.removeChild(meta);meta=null;mine=false}}",
206
+ "function apply(on){",
207
+ "if(on===applied)return;",
208
+ "applied=on;",
209
+ "if(on)stopLadder();",
210
+ "if(on){",
211
+ "var el=findStock();",
212
+ "if(el){meta=el;mine=false;stock=el.getAttribute('content')||''}",
213
+ "else if(!meta){meta=document.createElement('meta');meta.setAttribute('name','viewport');mine=true;stock='';headEl().appendChild(meta)}",
214
+ "meta.setAttribute('content',ZM(stock,T));",
215
+ "if(mine&&typeof MutationObserver==='function'&&!obs){obs=new MutationObserver(check);obs.observe(document.documentElement,{childList:true,subtree:true})}",
216
+ "}else{",
217
+ "stopWatch();",
218
+ "if(!meta)return;",
219
+ "if(mine)dropMine();",
220
+ "else meta.setAttribute('content',stock);",
221
+ "}",
222
+ "}",
223
+ "function check(){",
224
+ "var el=findStock();",
225
+ "if(!el)return;",
226
+ "stopWatch();",
227
+ "stock=el.getAttribute('content')||'';",
228
+ "if(applied){dropMine();meta=el;mine=false;meta.setAttribute('content',ZM(stock,T))}",
229
+ "else{dropMine();meta=null;stock=null}",
230
+ "}",
231
+ "function re(){apply(ZS(m,true,mq?mq.matches:false))}",
232
+ "function tick(){",
233
+ "lad=null;",
234
+ "re();",
235
+ "if(applied)return;",
236
+ "lN++;",
237
+ "if(document.readyState==='complete'||lN>=200)return;",
238
+ "lad=setTimeout(tick,10);",
239
+ "}",
240
+ "re();",
241
+ "window.addEventListener('resize',re);",
242
+ "if(mq&&mq.addEventListener)mq.addEventListener('change',re);else if(mq&&mq.addListener)mq.addListener(re);",
243
+ "if(!applied&&typeof setTimeout==='function')lad=setTimeout(tick,10);",
244
+ "})()"
245
+ ].join("");
246
+ }
247
+
248
+ //#endregion
249
+ //#region src/web-trust.ts
250
+ /**
251
+ * The schema-level default for `trustedPageAuthorities` (v0.2.2a): derive
252
+ * from the DSH_TRUSTED_HOSTS environment — the SAME single source the
253
+ * fence leg's patch expression reads first — so ONE declaration (e.g. one
254
+ * `Environment=` line in the service unit) drives both legs with zero
255
+ * per-instance plugin config. Bare hostnames only: `location.hostname`
256
+ * carries no port, and `assertBareHostname` would reject a portful entry at
257
+ * boot, so portful/schematic entries are dropped here instead of thrown.
258
+ * Declared in the Config SCHEMA rather than the bundle patch row because a
259
+ * profile/home layer row with the same id whole-row-overrides the row's
260
+ * config object, while schema defaults fill per-key at plugin load and
261
+ * survive every overlay layer. An explicit configured value always wins.
262
+ *
263
+ * @param env - the raw DSH_TRUSTED_HOSTS value (whitespace-separated).
264
+ * @returns the bare-hostname authorities to trust by default.
265
+ */
266
+ function deriveDefaultPageAuthorities(env) {
267
+ return (env ?? "").split(/\s+/).filter((h) => h.length > 0 && !/[:/@?#]/.test(h));
268
+ }
269
+ /** Assert one configured authority is a bare hostname (no port/path/scheme). */
270
+ function assertBareHostname(entry) {
271
+ if (entry.length === 0 || /[:/@?#]/.test(entry)) throw new Error(`dashr-web-trust: trustedPageAuthorities entry ${JSON.stringify(entry)} is not a bare hostname (location.hostname carries no port; an entry with port/path would never match)`);
272
+ }
273
+ /** The IIFE framing shared by both legs (a throwing leg stays invisible). */
274
+ function frame(body) {
275
+ return [
276
+ "(function(){try{",
277
+ ...body,
278
+ "}catch(e){}})();"
279
+ ].join("");
280
+ }
281
+ /**
282
+ * Build the authorities-leg script. Pure: same config in, same script out —
283
+ * the unit tests pin the shape (authority match, no-overwrite guard,
284
+ * inert-when-empty).
285
+ *
286
+ * @param trustedPageAuthorities - the operator-declared hostnames.
287
+ * @returns the script text, or `undefined` when the list is empty (inject
288
+ * nothing — the feature is fully inert).
289
+ */
290
+ function buildTrustScript(trustedPageAuthorities) {
291
+ const authorities = [...trustedPageAuthorities ?? []];
292
+ if (authorities.length === 0) return void 0;
293
+ for (const entry of authorities) assertBareHostname(entry);
294
+ return frame([
295
+ "if(!window.__DSH_TRANSPORT__){",
296
+ `var h=location.hostname,a=${JSON.stringify(authorities)};`,
297
+ "for(var i=0;i<a.length;i++)if(a[i]===h){window.__DSH_TRANSPORT__={ownsHost:true};break}",
298
+ "}"
299
+ ]);
300
+ }
301
+ /**
302
+ * Build the mobile-leg script. Pure: same config in, same script out — the
303
+ * unit tests pin the shape (mobile global, tuned thresholds, zoomGuard
304
+ * section, disabled-when-off).
305
+ *
306
+ * @param mobile - the resolved mobile config.
307
+ * @returns the script text, or `undefined` when the feature is explicitly
308
+ * disabled (inject nothing).
309
+ */
310
+ function buildMobileScript(mobile) {
311
+ if (!(mobile?.enabled !== false)) return void 0;
312
+ const payload = {
313
+ enabled: true,
314
+ ...mobile?.swipeDistancePx !== void 0 ? { swipeDistancePx: mobile.swipeDistancePx } : {},
315
+ ...mobile?.dominanceRatio !== void 0 ? { dominanceRatio: mobile.dominanceRatio } : {},
316
+ ...mobile?.leftEdgeBandPx !== void 0 ? { leftEdgeBandPx: mobile.leftEdgeBandPx } : {},
317
+ ...mobile?.rightZoneRatio !== void 0 ? { rightZoneRatio: mobile.rightZoneRatio } : {},
318
+ ...mobile?.swipeVelocityPxPerMs !== void 0 ? { swipeVelocityPxPerMs: mobile.swipeVelocityPxPerMs } : {},
319
+ ...mobile?.zoomGuard !== void 0 ? { zoomGuard: mobile.zoomGuard } : {}
320
+ };
321
+ const body = [`window.__DASHR_MOBILE__=${JSON.stringify(payload)};`];
322
+ if (mobile?.zoomGuard !== "off") body.push(buildZoomGuardSection());
323
+ return frame(body);
324
+ }
325
+ /** Row config schema (schema-level default derives from `DSH_TRUSTED_HOSTS`). */
326
+ const Config = z.object({ trustedPageAuthorities: z.array(String).default(deriveDefaultPageAuthorities(process.env.DSH_TRUSTED_HOSTS)) });
327
+ /** Cordis plugin name. */
328
+ const name = "dashr-web-trust";
329
+ /**
330
+ * No static injects: `webServer` is composed conditionally inside
331
+ * {@link apply}, so the row loads (dormant) in compositions without one.
332
+ */
333
+ const inject = [];
334
+ /**
335
+ * Mount the authorities-leg injection: one `webserver/index-inject` listener
336
+ * pushing the rendered row.
337
+ * @param ctx - host plugin context.
338
+ * @param config - the row config.
339
+ */
340
+ function apply(ctx, config) {
341
+ const authorities = config?.trustedPageAuthorities;
342
+ ctx.inject(["webServer"], () => {
343
+ ctx.on("webserver/index-inject", (table) => {
344
+ const text = buildTrustScript(authorities);
345
+ if (text !== void 0) table.push({
346
+ kind: "script",
347
+ placement: "head",
348
+ text
349
+ });
350
+ });
351
+ });
352
+ }
353
+ var web_trust_default = {
354
+ name,
355
+ inject,
356
+ Config,
357
+ apply
358
+ };
359
+
360
+ //#endregion
361
+ export { deriveDefaultPageAuthorities as a, web_trust_default as c, buildTrustScript as i, apply as n, inject as o, buildMobileScript as r, name as s, Config as t };
@@ -0,0 +1,106 @@
1
+ import { Context } from "@deepseek-ai/cordis";
2
+ import z from "@deepseek-ai/schemastery";
3
+
4
+ //#region src/web-trust.d.ts
5
+
6
+ /**
7
+ * The schema-level default for `trustedPageAuthorities` (v0.2.2a): derive
8
+ * from the DSH_TRUSTED_HOSTS environment — the SAME single source the
9
+ * fence leg's patch expression reads first — so ONE declaration (e.g. one
10
+ * `Environment=` line in the service unit) drives both legs with zero
11
+ * per-instance plugin config. Bare hostnames only: `location.hostname`
12
+ * carries no port, and `assertBareHostname` would reject a portful entry at
13
+ * boot, so portful/schematic entries are dropped here instead of thrown.
14
+ * Declared in the Config SCHEMA rather than the bundle patch row because a
15
+ * profile/home layer row with the same id whole-row-overrides the row's
16
+ * config object, while schema defaults fill per-key at plugin load and
17
+ * survive every overlay layer. An explicit configured value always wins.
18
+ *
19
+ * @param env - the raw DSH_TRUSTED_HOSTS value (whitespace-separated).
20
+ * @returns the bare-hostname authorities to trust by default.
21
+ */
22
+ declare function deriveDefaultPageAuthorities(env: string | undefined): string[];
23
+ /** Mobile page-config knobs (the `dashr-mobile` row's config shape). */
24
+ interface MobileConfig {
25
+ enabled?: boolean;
26
+ swipeDistancePx?: number;
27
+ dominanceRatio?: number;
28
+ leftEdgeBandPx?: number;
29
+ rightZoneRatio?: number;
30
+ swipeVelocityPxPerMs?: number;
31
+ /**
32
+ * iOS focus auto-zoom suppression mode (change
33
+ * `2026-09-03-ios-focus-zoom-suppression`): `'meta'` (default) rewrites
34
+ * the viewport meta on iOS-class narrow viewports; `'off'` is the escape
35
+ * hatch. `'font'` (16px floor, solution A) is a RESERVED value slot,
36
+ * deliberately not in the schema enum — unimplemented values fail loud
37
+ * at config load rather than no-op silently.
38
+ */
39
+ zoomGuard?: 'meta' | 'off';
40
+ }
41
+ /** The `webserver/index-inject` row shape these features push. */
42
+ interface BootScriptRow {
43
+ kind: 'script';
44
+ placement: 'head';
45
+ text: string;
46
+ }
47
+ /**
48
+ * Build the authorities-leg script. Pure: same config in, same script out —
49
+ * the unit tests pin the shape (authority match, no-overwrite guard,
50
+ * inert-when-empty).
51
+ *
52
+ * @param trustedPageAuthorities - the operator-declared hostnames.
53
+ * @returns the script text, or `undefined` when the list is empty (inject
54
+ * nothing — the feature is fully inert).
55
+ */
56
+ declare function buildTrustScript(trustedPageAuthorities: readonly string[] | undefined): string | undefined;
57
+ /**
58
+ * Build the mobile-leg script. Pure: same config in, same script out — the
59
+ * unit tests pin the shape (mobile global, tuned thresholds, zoomGuard
60
+ * section, disabled-when-off).
61
+ *
62
+ * @param mobile - the resolved mobile config.
63
+ * @returns the script text, or `undefined` when the feature is explicitly
64
+ * disabled (inject nothing).
65
+ */
66
+ declare function buildMobileScript(mobile: MobileConfig | undefined): string | undefined;
67
+ /**
68
+ * `dashr-web-trust` row config schema. Only the authorities leg lives here —
69
+ * the mobile knobs are the `dashr-mobile` row's own config.
70
+ */
71
+ interface TrustConfig {
72
+ /** Hostnames this operator declares their own devices' pages run on. */
73
+ trustedPageAuthorities?: readonly string[];
74
+ }
75
+ /** Row config schema (schema-level default derives from `DSH_TRUSTED_HOSTS`). */
76
+ declare const Config: z<Schemastery.ObjectS<{
77
+ trustedPageAuthorities: z<string[], string[]>;
78
+ }>, Schemastery.ObjectT<{
79
+ trustedPageAuthorities: z<string[], string[]>;
80
+ }>>;
81
+ /** Cordis plugin name. */
82
+ declare const name = "dashr-web-trust";
83
+ /**
84
+ * No static injects: `webServer` is composed conditionally inside
85
+ * {@link apply}, so the row loads (dormant) in compositions without one.
86
+ */
87
+ declare const inject: string[];
88
+ /**
89
+ * Mount the authorities-leg injection: one `webserver/index-inject` listener
90
+ * pushing the rendered row.
91
+ * @param ctx - host plugin context.
92
+ * @param config - the row config.
93
+ */
94
+ declare function apply(ctx: Context, config: TrustConfig | undefined): void;
95
+ declare const _default: {
96
+ name: string;
97
+ inject: string[];
98
+ Config: z<Schemastery.ObjectS<{
99
+ trustedPageAuthorities: z<string[], string[]>;
100
+ }>, Schemastery.ObjectT<{
101
+ trustedPageAuthorities: z<string[], string[]>;
102
+ }>>;
103
+ apply: typeof apply;
104
+ };
105
+ //#endregion
106
+ export { _default as a, buildTrustScript as c, name as d, TrustConfig as i, deriveDefaultPageAuthorities as l, Config as n, apply as o, MobileConfig as r, buildMobileScript as s, BootScriptRow as t, inject as u };
@@ -0,0 +1,2 @@
1
+ import { a as _default, c as buildTrustScript, d as name, i as TrustConfig, l as deriveDefaultPageAuthorities, n as Config, o as apply, r as MobileConfig, s as buildMobileScript, t as BootScriptRow, u as inject } from "./web-trust-CgpBoFv3.js";
2
+ export { BootScriptRow, Config, MobileConfig, TrustConfig, apply, buildMobileScript, buildTrustScript, _default as default, deriveDefaultPageAuthorities, inject, name };
@@ -0,0 +1,3 @@
1
+ import { a as deriveDefaultPageAuthorities, c as web_trust_default, i as buildTrustScript, n as apply, o as inject, r as buildMobileScript, s as name, t as Config } from "./web-trust-BO66y72w.js";
2
+
3
+ export { Config, apply, buildMobileScript, buildTrustScript, web_trust_default as default, deriveDefaultPageAuthorities, inject, name };