@deepseek-harness-tui/dsh-tui 0.9.1 → 0.9.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.
Files changed (214) hide show
  1. package/README.md +14 -4
  2. package/bin/dsh-tui.js +26 -4
  3. package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
  4. package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
  5. package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
  6. package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
  7. package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
  8. package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
  9. package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
  10. package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
  11. package/dsh-ecosystem-spec/registry/README.md +14 -14
  12. package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
  13. package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
  14. package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
  15. package/lib/types/commands.d.ts.map +1 -1
  16. package/lib/types/commands.js +7 -8
  17. package/lib/types/components/BalanceReportRow.d.ts +24 -0
  18. package/lib/types/components/BalanceReportRow.d.ts.map +1 -0
  19. package/lib/types/components/BalanceReportRow.js +87 -0
  20. package/lib/types/components/HistorySearchDialog.js +1 -1
  21. package/lib/types/components/MessageList.d.ts +3 -1
  22. package/lib/types/components/MessageList.d.ts.map +1 -1
  23. package/lib/types/components/MessageList.js +11 -7
  24. package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
  25. package/lib/types/components/PluginSceneBoundary.js +1 -1
  26. package/lib/types/components/PromptInput.d.ts.map +1 -1
  27. package/lib/types/components/PromptInput.js +16 -0
  28. package/lib/types/components/Whale.d.ts +15 -4
  29. package/lib/types/components/Whale.d.ts.map +1 -1
  30. package/lib/types/components/Whale.js +9 -8
  31. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +7 -1
  32. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  33. package/lib/types/components/messages/AssistantToolUseMessage.js +34 -4
  34. package/lib/types/deepseekBalance.d.ts +53 -0
  35. package/lib/types/deepseekBalance.d.ts.map +1 -0
  36. package/lib/types/deepseekBalance.js +86 -0
  37. package/lib/types/deepseekPricing.d.ts +82 -0
  38. package/lib/types/deepseekPricing.d.ts.map +1 -0
  39. package/lib/types/deepseekPricing.js +133 -0
  40. package/lib/types/dsh-adapter/channel.d.ts +46 -1
  41. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  42. package/lib/types/dsh-adapter/channel.js +84 -10
  43. package/lib/types/dsh-adapter/index.d.ts +5 -0
  44. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  45. package/lib/types/dsh-adapter/index.js +1 -0
  46. package/lib/types/dsh-adapter/packaged-skills.d.ts +9 -0
  47. package/lib/types/dsh-adapter/packaged-skills.d.ts.map +1 -1
  48. package/lib/types/dsh-adapter/packaged-skills.js +19 -4
  49. package/lib/types/dsh-adapter/plugin.d.ts +6 -0
  50. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  51. package/lib/types/dsh-adapter/plugin.js +122 -18
  52. package/lib/types/dsh-adapter/settings-sections.d.ts +1 -0
  53. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  54. package/lib/types/dsh-adapter/settings-sections.js +35 -2
  55. package/lib/types/history.d.ts +4 -3
  56. package/lib/types/history.d.ts.map +1 -1
  57. package/lib/types/history.js +66 -18
  58. package/lib/types/i18n.d.ts +122 -55
  59. package/lib/types/i18n.d.ts.map +1 -1
  60. package/lib/types/i18n.js +39 -18
  61. package/lib/types/ink/ink.d.ts.map +1 -1
  62. package/lib/types/ink/ink.js +67 -17
  63. package/lib/types/ink/root.d.ts +16 -0
  64. package/lib/types/ink/root.d.ts.map +1 -1
  65. package/lib/types/ink/root.js +2 -0
  66. package/lib/types/ink/terminal-querier.d.ts +8 -0
  67. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  68. package/lib/types/ink/terminal-querier.js +13 -0
  69. package/lib/types/ink/terminal.d.ts +42 -0
  70. package/lib/types/ink/terminal.d.ts.map +1 -1
  71. package/lib/types/ink/terminal.js +52 -2
  72. package/lib/types/plugin-spec/registry.d.ts +1 -1
  73. package/lib/types/plugin-spec/registry.js +1 -1
  74. package/lib/types/screens/Chat.d.ts.map +1 -1
  75. package/lib/types/screens/Chat.js +72 -37
  76. package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
  77. package/lib/types/screens/SessionBrowser.js +28 -13
  78. package/lib/types/screens/SessionTree.d.ts.map +1 -1
  79. package/lib/types/screens/SessionTree.js +33 -9
  80. package/lib/types/screens/Settings.d.ts +7 -5
  81. package/lib/types/screens/Settings.d.ts.map +1 -1
  82. package/lib/types/screens/Settings.js +206 -99
  83. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  84. package/lib/types/screens/StatusLine.js +32 -1
  85. package/lib/types/sessionHistory.d.ts +11 -0
  86. package/lib/types/sessionHistory.d.ts.map +1 -1
  87. package/lib/types/sessionHistory.js +29 -0
  88. package/lib/types/sessions/format.d.ts.map +1 -1
  89. package/lib/types/sessions/format.js +14 -4
  90. package/lib/types/tips.js +2 -2
  91. package/lib/types/tuiDisplayPrefs.d.ts +3 -0
  92. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  93. package/lib/types/tuiDisplayPrefs.js +1 -0
  94. package/lib/types/update.d.ts +66 -0
  95. package/lib/types/update.d.ts.map +1 -1
  96. package/lib/types/update.js +346 -3
  97. package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -21
  98. package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -44
  99. package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
  100. package/node_modules/@dsh-std/command/LICENSE +21 -21
  101. package/node_modules/@dsh-std/command/README.md +26 -26
  102. package/node_modules/@dsh-std/command/README.zh.md +28 -28
  103. package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
  104. package/node_modules/@dsh-std/command/package.json +22 -22
  105. package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  106. package/node_modules/@dsh-std/connection/LICENSE +21 -21
  107. package/node_modules/@dsh-std/connection/README.md +42 -42
  108. package/node_modules/@dsh-std/connection/README.zh.md +42 -42
  109. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  110. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  111. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  112. package/node_modules/@dsh-std/connection/package.json +20 -20
  113. package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  114. package/node_modules/@dsh-std/core/LICENSE +21 -21
  115. package/node_modules/@dsh-std/core/README.md +13 -13
  116. package/node_modules/@dsh-std/core/README.zh.md +13 -13
  117. package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  118. package/node_modules/@dsh-std/core/package.json +21 -21
  119. package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  120. package/node_modules/@dsh-std/manifest/LICENSE +21 -21
  121. package/node_modules/@dsh-std/manifest/README.md +5 -5
  122. package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  123. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  124. package/node_modules/@dsh-std/manifest/package.json +20 -20
  125. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  126. package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
  127. package/node_modules/@dsh-std/messages/LICENSE +21 -21
  128. package/node_modules/@dsh-std/messages/README.md +5 -5
  129. package/node_modules/@dsh-std/messages/README.zh.md +7 -7
  130. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
  131. package/node_modules/@dsh-std/messages/package.json +20 -20
  132. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
  133. package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  134. package/node_modules/@dsh-std/presentation/LICENSE +21 -21
  135. package/node_modules/@dsh-std/presentation/README.md +27 -27
  136. package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  137. package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  138. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  139. package/node_modules/@dsh-std/presentation/package.json +25 -25
  140. package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
  141. package/node_modules/@dsh-std/storage/LICENSE +21 -21
  142. package/node_modules/@dsh-std/storage/README.md +5 -5
  143. package/node_modules/@dsh-std/storage/README.zh.md +7 -7
  144. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
  145. package/node_modules/@dsh-std/storage/package.json +20 -20
  146. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
  147. package/package.json +95 -5
  148. package/skills/pr-comments/SKILL.md +1 -1
  149. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  150. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
  151. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
  152. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
  153. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  154. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  155. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  156. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
  157. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  158. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
  159. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
  160. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
  161. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  162. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
  163. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  164. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
  165. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
  166. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  167. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  168. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
  169. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  170. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  171. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
  172. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
  173. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  174. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  175. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  176. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
  177. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  178. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
  179. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
  180. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
  181. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  182. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
  183. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  184. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
  185. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
  186. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
  187. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  188. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
  189. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  190. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
  191. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
  192. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
  193. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  194. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
  195. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  196. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
  197. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
  198. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
  199. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  200. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  201. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  202. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
  203. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  204. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
  205. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
  206. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
  207. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  208. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
  209. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  210. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
  211. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
  212. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
  213. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  214. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 DSH Standard contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DSH Standard contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,5 +1,5 @@
1
- # @dsh-std/storage
2
-
3
- English | [中文](README.zh.md)
4
-
5
- This package defines the Community v0.15 `storage.dsh/v1alpha1` `LocalStorage` coordinates, negotiation definition, JSON data model, and operation validators. Concrete storage backends and product authorization interfaces are supplied by implementations.
1
+ # @dsh-std/storage
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ This package defines the Community v0.15 `storage.dsh/v1alpha1` `LocalStorage` coordinates, negotiation definition, JSON data model, and operation validators. Concrete storage backends and product authorization interfaces are supplied by implementations.
@@ -1,7 +1,7 @@
1
- # @dsh-std/storage
2
-
3
- [English](README.md) | 中文
4
-
5
- 规范见 [Local Component Storage](../../docs/proposals/storage.zh.md)。
6
-
7
- 本包定义 Community v0.15 的 `storage.dsh/v1alpha1` `LocalStorage` 协议坐标、协商 definition、JSON 数据类型和操作校验器。具体存储后端与产品授权界面由实现提供。
1
+ # @dsh-std/storage
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 规范见 [Local Component Storage](../../docs/proposals/storage.zh.md)。
6
+
7
+ 本包定义 Community v0.15 的 `storage.dsh/v1alpha1` `LocalStorage` 协议坐标、协商 definition、JSON 数据类型和操作校验器。具体存储后端与产品授权界面由实现提供。
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {\r\n ProtocolCatalog,\r\n ProtocolDefinition,\r\n ProtocolIssue,\r\n ProtocolSupport,\r\n} from '@dsh-std/core'\r\n\r\nexport const API_VERSION = 'storage.dsh/v1alpha1'\r\nexport const KIND = 'LocalStorage'\r\n\r\nexport const READ_PERMISSION = 'storage.local.read'\r\nexport const WRITE_PERMISSION = 'storage.local.write'\r\n\r\nexport type JsonPrimitive = null | boolean | number | string\r\nexport type JsonValue = JsonPrimitive | readonly JsonValue[] | { readonly [key: string]: JsonValue }\r\n\r\nexport interface LocalStorageGetInput {\r\n readonly key: string\r\n}\r\n\r\nexport interface LocalStorageGetOutput {\r\n readonly value: JsonValue | null\r\n}\r\n\r\nexport interface LocalStorageSetInput {\r\n readonly key: string\r\n readonly value: JsonValue\r\n}\r\n\r\nexport interface LocalStorageSetOutput {\r\n readonly stored: true\r\n}\r\n\r\nexport interface LocalStorageDeleteInput {\r\n readonly key: string\r\n}\r\n\r\nexport interface LocalStorageDeleteOutput {\r\n readonly deleted: boolean\r\n}\r\n\r\nexport interface LocalStorage {\r\n get(input: LocalStorageGetInput): LocalStorageGetOutput | Promise<LocalStorageGetOutput>\r\n set(input: LocalStorageSetInput): LocalStorageSetOutput | Promise<LocalStorageSetOutput>\r\n delete(input: LocalStorageDeleteInput): LocalStorageDeleteOutput | Promise<LocalStorageDeleteOutput>\r\n}\r\n\r\nexport type LocalStorageErrorCode =\r\n | 'PERMISSION_NOT_GRANTED'\r\n | 'INVALID_KEY'\r\n | 'INVALID_VALUE'\r\n | 'QUOTA_EXCEEDED'\r\n | 'STORAGE_UNAVAILABLE'\r\n\r\nexport const protocol: ProtocolDefinition = Object.freeze({\r\n apiVersion: API_VERSION,\r\n kind: KIND,\r\n validateRequirement: emptySpec,\r\n validateSupport: emptySpec,\r\n negotiate: negotiateProvider,\r\n})\r\n\r\nexport const support: ProtocolSupport = Object.freeze({\r\n apiVersion: API_VERSION,\r\n kind: KIND,\r\n})\r\n\r\nexport function register(catalog: ProtocolCatalog): () => void {\r\n return catalog.register(protocol)\r\n}\r\n\r\nexport function validateGetInput(value: unknown): asserts value is LocalStorageGetInput {\r\n const input = exactRecord(value, ['key'], 'LocalStorage.get input')\r\n key(input.key, 'LocalStorage.get input.key')\r\n}\r\n\r\nexport function validateSetInput(value: unknown): asserts value is LocalStorageSetInput {\r\n const input = exactRecord(value, ['key', 'value'], 'LocalStorage.set input')\r\n key(input.key, 'LocalStorage.set input.key')\r\n validateJsonValue(input.value, 'LocalStorage.set input.value')\r\n}\r\n\r\nexport function validateDeleteInput(value: unknown): asserts value is LocalStorageDeleteInput {\r\n const input = exactRecord(value, ['key'], 'LocalStorage.delete input')\r\n key(input.key, 'LocalStorage.delete input.key')\r\n}\r\n\r\nexport function validateGetOutput(value: unknown): asserts value is LocalStorageGetOutput {\r\n const output = exactRecord(value, ['value'], 'LocalStorage.get output')\r\n validateJsonValue(output.value, 'LocalStorage.get output.value')\r\n}\r\n\r\nexport function validateSetOutput(value: unknown): asserts value is LocalStorageSetOutput {\r\n const output = exactRecord(value, ['stored'], 'LocalStorage.set output')\r\n if (output.stored !== true) throw new TypeError('LocalStorage.set output.stored must be true')\r\n}\r\n\r\nexport function validateDeleteOutput(value: unknown): asserts value is LocalStorageDeleteOutput {\r\n const output = exactRecord(value, ['deleted'], 'LocalStorage.delete output')\r\n if (typeof output.deleted !== 'boolean') throw new TypeError('LocalStorage.delete output.deleted must be boolean')\r\n}\r\n\r\nexport function validateJsonValue(value: unknown, label = 'JSON value'): asserts value is JsonValue {\r\n jsonValue(value, label, new Set<object>())\r\n}\r\n\r\nfunction negotiateProvider(input: Parameters<NonNullable<ProtocolDefinition['negotiate']>>[0]) {\r\n const issues: ProtocolIssue[] = []\r\n const providers = new Map<string, string>()\r\n for (const row of input.requirements) {\r\n const candidates = input.supports.filter(candidate => candidate.participant !== row.participant)\r\n if (candidates.length === 0) {\r\n issues.push(Object.freeze({\r\n code: row.requirement.optional === true ? 'optional-support-missing' : 'required-support-missing',\r\n severity: row.requirement.optional === true ? 'warning' : 'error',\r\n participant: row.participant,\r\n message: `no participant supports ${API_VERSION} ${KIND}`,\r\n }))\r\n } else if (candidates.length > 1) {\r\n issues.push(Object.freeze({\r\n code: 'support-ambiguous',\r\n severity: 'error',\r\n participant: row.participant,\r\n message: `multiple participants support ${API_VERSION} ${KIND}`,\r\n }))\r\n } else {\r\n providers.set(row.participant, candidates[0]!.participant)\r\n }\r\n }\r\n return {\r\n agreement: Object.freeze({\r\n kind: 'LocalStorageBindings',\r\n providers: Object.freeze(Object.fromEntries([...providers].sort(([left], [right]) => left.localeCompare(right)))),\r\n }),\r\n issues: Object.freeze(issues),\r\n }\r\n}\r\n\r\nfunction emptySpec(value: unknown): undefined {\r\n if (value !== undefined) throw new TypeError(`${KIND} does not accept spec in v1alpha1`)\r\n return undefined\r\n}\r\n\r\nfunction jsonValue(value: unknown, label: string, ancestors: Set<object>): void {\r\n if (value === null || typeof value === 'boolean' || typeof value === 'string') return\r\n if (typeof value === 'number') {\r\n if (!Number.isFinite(value)) throw new TypeError(`${label} must contain only finite numbers`)\r\n return\r\n }\r\n if (typeof value !== 'object') throw new TypeError(`${label} must be a JSON value`)\r\n if (ancestors.has(value)) throw new TypeError(`${label} must not contain cycles`)\r\n ancestors.add(value)\r\n if (Array.isArray(value)) {\r\n for (const [index, item] of value.entries()) jsonValue(item, `${label}[${index}]`, ancestors)\r\n } else {\r\n const prototype = Object.getPrototypeOf(value)\r\n if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must contain only plain objects`)\r\n for (const [name, item] of Object.entries(value)) jsonValue(item, `${label}.${name}`, ancestors)\r\n }\r\n ancestors.delete(value)\r\n}\r\n\r\nfunction exactRecord(value: unknown, allowed: readonly string[], label: string): Record<string, unknown> {\r\n if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError(`${label} must be an object`)\r\n const record = value as Record<string, unknown>\r\n const unknown = Object.keys(record).filter(name => !allowed.includes(name))\r\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)\r\n for (const name of allowed) {\r\n if (!Object.hasOwn(record, name)) throw new TypeError(`${label}.${name} is required`)\r\n }\r\n return record\r\n}\r\n\r\nfunction key(value: unknown, label: string): asserts value is string {\r\n if (typeof value !== 'string' || value.length === 0) throw new TypeError(`${label} must be a non-empty string`)\r\n}\r\n"],"mappings":";AAOA,MAAa,cAAc;AAC3B,MAAa,OAAO;AAEpB,MAAa,kBAAkB;AAC/B,MAAa,mBAAmB;AA2ChC,MAAa,WAA+B,OAAO,OAAO;CACxD,YAAY;CACZ,MAAM;CACN,qBAAqB;CACrB,iBAAiB;CACjB,WAAW;AACb,CAAC;AAED,MAAa,UAA2B,OAAO,OAAO;CACpD,YAAY;CACZ,MAAM;AACR,CAAC;AAED,SAAgB,SAAS,SAAsC;CAC7D,OAAO,QAAQ,SAAS,QAAQ;AAClC;AAEA,SAAgB,iBAAiB,OAAuD;CAEtF,IADc,YAAY,OAAO,CAAC,KAAK,GAAG,wBAClC,CAAC,CAAC,KAAK,4BAA4B;AAC7C;AAEA,SAAgB,iBAAiB,OAAuD;CACtF,MAAM,QAAQ,YAAY,OAAO,CAAC,OAAO,O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ACvG,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG,MAAM,IAAI,UAAU,GAAG,MAAM,mBAAmB;CACzH,MAAM,SAAS;CACf,MAAM,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,QAAO,SAAQ,CAAC,QAAQ,SAAS,IAAI,CAAC;CAC1E,IAAI,QAAQ,SAAS,GAAG,MAAM,IAAI,UAAU,GAAG,MAAM,0BAA0B,KAAK,UAAU,QAAQ,EAAE,GAAG;CAC3G,KAAK,MAAM,QAAQ,SACjB,IAAI,CAAC,OAAO,OAAO,QAAQ,IAAI,GAAG,MAAM,IAAI,UAAU,GAAG,MAAM,GAAG,KAAK,aAAa;CAEtF,OAAO;AACT;AAEA,SAAS,IAAI,OAAgB,OAAwC;CACnE,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,GAAG,MAAM,IAAI,UAAU,GAAG,MAAM,4BAA4B;AAChH"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {\n ProtocolCatalog,\n ProtocolDefinition,\n ProtocolIssue,\n ProtocolSupport,\n} from '@dsh-std/core'\n\nexport const API_VERSION = 'storage.dsh/v1alpha1'\nexport const KIND = 'LocalStorage'\n\nexport const READ_PERMISSION = 'storage.local.read'\nexport const WRITE_PERMISSION = 'storage.local.write'\n\nexport type JsonPrimitive = null | boolean | number | string\nexport type JsonValue = JsonPrimitive | readonly JsonValue[] | { readonly [key: string]: JsonValue }\n\nexport interface LocalStorageGetInput {\n readonly key: string\n}\n\nexport interface LocalStorageGetOutput {\n readonly value: JsonValue | null\n}\n\nexport interface LocalStorageSetInput {\n readonly key: string\n readonly value: JsonValue\n}\n\nexport interface LocalStorageSetOutput {\n readonly stored: true\n}\n\nexport interface LocalStorageDeleteInput {\n readonly key: string\n}\n\nexport interface LocalStorageDeleteOutput {\n readonly deleted: boolean\n}\n\nexport interface LocalStorage {\n get(input: LocalStorageGetInput): LocalStorageGetOutput | Promise<LocalStorageGetOutput>\n set(input: LocalStorageSetInput): LocalStorageSetOutput | Promise<LocalStorageSetOutput>\n delete(input: LocalStorageDeleteInput): LocalStorageDeleteOutput | Promise<LocalStorageDeleteOutput>\n}\n\nexport type LocalStorageErrorCode =\n | 'PERMISSION_NOT_GRANTED'\n | 'INVALID_KEY'\n | 'INVALID_VALUE'\n | 'QUOTA_EXCEEDED'\n | 'STORAGE_UNAVAILABLE'\n\nexport const protocol: ProtocolDefinition = Object.freeze({\n apiVersion: API_VERSION,\n kind: KIND,\n validateRequirement: emptySpec,\n validateSupport: emptySpec,\n negotiate: negotiateProvider,\n})\n\nexport const support: ProtocolSupport = Object.freeze({\n apiVersion: API_VERSION,\n kind: KIND,\n})\n\nexport function register(catalog: ProtocolCatalog): () => void {\n return catalog.register(protocol)\n}\n\nexport function validateGetInput(value: unknown): asserts value is LocalStorageGetInput {\n const input = exactRecord(value, ['key'], 'LocalStorage.get input')\n key(input.key, 'LocalStorage.get input.key')\n}\n\nexport function validateSetInput(value: unknown): asserts value is LocalStorageSetInput {\n const input = exactRecord(value, ['key', 'value'], 'LocalStorage.set input')\n key(input.key, 'LocalStorage.set input.key')\n validateJsonValue(input.value, 'LocalStorage.set input.value')\n}\n\nexport function validateDeleteInput(value: unknown): asserts value is LocalStorageDeleteInput {\n const input = exactRecord(value, ['key'], 'LocalStorage.delete input')\n key(input.key, 'LocalStorage.delete input.key')\n}\n\nexport function validateGetOutput(value: unknown): asserts value is LocalStorageGetOutput {\n const output = exactRecord(value, ['value'], 'LocalStorage.get output')\n validateJsonValue(output.value, 'LocalStorage.get output.value')\n}\n\nexport function validateSetOutput(value: unknown): asserts value is LocalStorageSetOutput {\n const output = exactRecord(value, ['stored'], 'LocalStorage.set output')\n if (output.stored !== true) throw new TypeError('LocalStorage.set output.stored must be true')\n}\n\nexport function validateDeleteOutput(value: unknown): asserts value is LocalStorageDeleteOutput {\n const output = exactRecord(value, ['deleted'], 'LocalStorage.delete output')\n if (typeof output.deleted !== 'boolean') throw new TypeError('LocalStorage.delete output.deleted must be boolean')\n}\n\nexport function validateJsonValue(value: unknown, label = 'JSON value'): asserts value is JsonValue {\n jsonValue(value, label, new Set<object>())\n}\n\nfunction negotiateProvider(input: Parameters<NonNullable<ProtocolDefinition['negotiate']>>[0]) {\n const issues: ProtocolIssue[] = []\n const providers = new Map<string, string>()\n for (const row of input.requirements) {\n const candidates = input.supports.filter(candidate => candidate.participant !== row.participant)\n if (candidates.length === 0) {\n issues.push(Object.freeze({\n code: row.requirement.optional === true ? 'optional-support-missing' : 'required-support-missing',\n severity: row.requirement.optional === true ? 'warning' : 'error',\n participant: row.participant,\n message: `no participant supports ${API_VERSION} ${KIND}`,\n }))\n } else if (candidates.length > 1) {\n issues.push(Object.freeze({\n code: 'support-ambiguous',\n severity: 'error',\n participant: row.participant,\n message: `multiple participants support ${API_VERSION} ${KIND}`,\n }))\n } else {\n providers.set(row.participant, candidates[0]!.participant)\n }\n }\n return {\n agreement: Object.freeze({\n kind: 'LocalStorageBindings',\n providers: Object.freeze(Object.fromEntries([...providers].sort(([left], [right]) => left.localeCompare(right)))),\n }),\n issues: Object.freeze(issues),\n }\n}\n\nfunction emptySpec(value: unknown): undefined {\n if (value !== undefined) throw new TypeError(`${KIND} does not accept spec in v1alpha1`)\n return undefined\n}\n\nfunction jsonValue(value: unknown, label: string, ancestors: Set<object>): void {\n if (value === null || typeof value === 'boolean' || typeof value === 'string') return\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) throw new TypeError(`${label} must contain only finite numbers`)\n return\n }\n if (typeof value !== 'object') throw new TypeError(`${label} must be a JSON value`)\n if (ancestors.has(value)) throw new TypeError(`${label} must not contain cycles`)\n ancestors.add(value)\n if (Array.isArray(value)) {\n for (const [index, item] of value.entries()) jsonValue(item, `${label}[${index}]`, ancestors)\n } else {\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must contain only plain objects`)\n for (const [name, item] of Object.entries(value)) jsonValue(item, `${label}.${name}`, ancestors)\n }\n ancestors.delete(value)\n}\n\nfunction exactRecord(value: unknown, allowed: readonly string[], label: string): Record<string, unknown> {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError(`${label} must be an object`)\n const record = value as Record<string, unknown>\n const unknown = Object.keys(record).filter(name => !allowed.includes(name))\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)\n for (const name of allowed) {\n if (!Object.hasOwn(record, name)) throw new TypeError(`${label}.${name} is required`)\n }\n return record\n}\n\nfunction key(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || value.length === 0) throw new TypeError(`${label} must be a non-empty string`)\n}\n"],"mappings":";AAOA,MAAa,cAAc;AAC3B,MAAa,OAAO;AAEpB,MAAa,kBAAkB;AAC/B,MAAa,mBAAmB;AA2ChC,MAAa,WAA+B,OAAO,OAAO;CACxD,YAAY;CACZ,MAAM;CACN,qBAAqB;CACrB,iBAAiB;CACjB,WAAW;AACb,CAAC;AAED,MAAa,UAA2B,OAAO,OAAO;CACpD,YAAY;CACZ,MAAM;AACR,CAAC;AAED,SAAgB,SAAS,SAAsC;CAC7D,OAAO,QAAQ,SAAS,QAAQ;AAClC;AAEA,SAAgB,iBAAiB,OAAuD;CAEtF,IADc,YAAY,OAAO,CAAC,KAAK,GAAG,wBAClC,CAAC,CAAC,KAAK,4BAA4B;AAC7C;AAEA,SAAgB,iBAAiB,OAAuD;CACtF,MAAM,QAAQ,YAAY,OAAO,CAAC,OAAO,OAAO,GAAG,wBAAwB;CAC3E,IAAI,MAAM,KAAK,4BAA4B;CAC3C,kBAAkB,MAAM,OAAO,8BAA8B;AAC/D;AAEA,SAAgB,oBAAoB,OAA0D;CAE5F,IADc,YAAY,OAAO,CAAC,KAAK,GAAG,2BAClC,CAAC,CAAC,KAAK,+BAA+B;AAChD;AAEA,SAAgB,kBAAkB,OAAwD;CAExF,kBADe,YAAY,OAAO,CAAC,OAAO,GAAG,yBAC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A0B,KAAK,UAAU,QAAQ,EAAE,GAAG;CAC3G,KAAK,MAAM,QAAQ,SACjB,IAAI,CAAC,OAAO,OAAO,QAAQ,IAAI,GAAG,MAAM,IAAI,UAAU,GAAG,MAAM,GAAG,KAAK,aAAa;CAEtF,OAAO;AACT;AAEA,SAAS,IAAI,OAAgB,OAAwC;CACnE,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,GAAG,MAAM,IAAI,UAAU,GAAG,MAAM,4BAA4B;AAChH"}
@@ -1,20 +1,20 @@
1
- {
2
- "name": "@dsh-std/storage",
3
- "version": "0.1.0",
4
- "license": "MIT",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": { "types": "./lib/index.d.ts", "default": "./lib/index.js" },
10
- "./schema/local-storage-0.15.json": "./schema/local-storage-0.15.schema.json"
11
- },
12
- "files": ["lib", "schema", "CHANGELOG.md"],
13
- "scripts": {
14
- "build": "pnpm run typecheck && tsdown",
15
- "typecheck": "tsc -p tsconfig.json --noEmit",
16
- "test": "vitest run --passWithNoTests"
17
- },
18
- "dependencies": { "@dsh-std/core": "workspace:*" },
19
- "engines": { "node": "^22.19 || >=24" }
20
- }
1
+ {
2
+ "name": "@dsh-std/storage",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": { "types": "./lib/index.d.ts", "default": "./lib/index.js" },
10
+ "./schema/local-storage-0.15.json": "./schema/local-storage-0.15.schema.json"
11
+ },
12
+ "files": ["lib", "schema", "CHANGELOG.md"],
13
+ "scripts": {
14
+ "build": "pnpm run typecheck && tsdown",
15
+ "typecheck": "tsc -p tsconfig.json --noEmit",
16
+ "test": "vitest run --passWithNoTests"
17
+ },
18
+ "dependencies": { "@dsh-std/core": "workspace:*" },
19
+ "engines": { "node": "^22.19 || >=24" }
20
+ }
@@ -1,56 +1,56 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:dsh-std:storage:local-storage:0.15",
4
- "title": "LocalStorage v0.15 operations",
5
- "$defs": {
6
- "jsonValue": {
7
- "oneOf": [
8
- { "type": "null" },
9
- { "type": "boolean" },
10
- { "type": "number" },
11
- { "type": "string" },
12
- { "type": "array", "items": { "$ref": "#/$defs/jsonValue" } },
13
- { "type": "object", "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
14
- ]
15
- },
16
- "getInput": {
17
- "type": "object",
18
- "additionalProperties": false,
19
- "required": ["key"],
20
- "properties": { "key": { "type": "string", "minLength": 1 } }
21
- },
22
- "getOutput": {
23
- "type": "object",
24
- "additionalProperties": false,
25
- "required": ["value"],
26
- "properties": { "value": { "$ref": "#/$defs/jsonValue" } }
27
- },
28
- "setInput": {
29
- "type": "object",
30
- "additionalProperties": false,
31
- "required": ["key", "value"],
32
- "properties": {
33
- "key": { "type": "string", "minLength": 1 },
34
- "value": { "$ref": "#/$defs/jsonValue" }
35
- }
36
- },
37
- "setOutput": {
38
- "type": "object",
39
- "additionalProperties": false,
40
- "required": ["stored"],
41
- "properties": { "stored": { "const": true } }
42
- },
43
- "deleteInput": {
44
- "type": "object",
45
- "additionalProperties": false,
46
- "required": ["key"],
47
- "properties": { "key": { "type": "string", "minLength": 1 } }
48
- },
49
- "deleteOutput": {
50
- "type": "object",
51
- "additionalProperties": false,
52
- "required": ["deleted"],
53
- "properties": { "deleted": { "type": "boolean" } }
54
- }
55
- }
56
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:dsh-std:storage:local-storage:0.15",
4
+ "title": "LocalStorage v0.15 operations",
5
+ "$defs": {
6
+ "jsonValue": {
7
+ "oneOf": [
8
+ { "type": "null" },
9
+ { "type": "boolean" },
10
+ { "type": "number" },
11
+ { "type": "string" },
12
+ { "type": "array", "items": { "$ref": "#/$defs/jsonValue" } },
13
+ { "type": "object", "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
14
+ ]
15
+ },
16
+ "getInput": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["key"],
20
+ "properties": { "key": { "type": "string", "minLength": 1 } }
21
+ },
22
+ "getOutput": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["value"],
26
+ "properties": { "value": { "$ref": "#/$defs/jsonValue" } }
27
+ },
28
+ "setInput": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["key", "value"],
32
+ "properties": {
33
+ "key": { "type": "string", "minLength": 1 },
34
+ "value": { "$ref": "#/$defs/jsonValue" }
35
+ }
36
+ },
37
+ "setOutput": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["stored"],
41
+ "properties": { "stored": { "const": true } }
42
+ },
43
+ "deleteInput": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["key"],
47
+ "properties": { "key": { "type": "string", "minLength": 1 } }
48
+ },
49
+ "deleteOutput": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["deleted"],
53
+ "properties": { "deleted": { "type": "boolean" } }
54
+ }
55
+ }
56
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepseek-harness-tui/dsh-tui",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Claude Code style interactive TUI front door for DeepSeek Harness agents, built on the ported Ink core.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -19,7 +19,8 @@
19
19
  "#dsh-ecosystem-spec/tui-channel": "./dsh-ecosystem-spec/protocols/tui-channel.js"
20
20
  },
21
21
  "bin": {
22
- "dsh-tui": "./bin/dsh-tui.js"
22
+ "dsh-tui": "./bin/dsh-tui.js",
23
+ "dst": "./bin/dsh-tui.js"
23
24
  },
24
25
  "main": "lib/types/index.js",
25
26
  "types": "lib/types/index.d.ts",
@@ -98,7 +99,7 @@
98
99
  "prompt:debug": "node scripts/read-prompt-debug.mjs",
99
100
  "tui": "node --import tsx/esm scripts/run.ts",
100
101
  "smoke": "node --import tsx/esm scripts/smoke.tsx",
101
- "verify:build": "npm run verify:boundary && npm run verify:contract && npm run verify:herdr && npm run verify:manifest-deps && npm run verify:patch-surface && npm run verify:web-coexistence && npm run verify:plugin-spec && npm run verify:plugin-grants && npm run verify:plugin-storage && npm run verify:plugin-messages && npm run verify:plugin-ledger && npm run verify:plugin-commands && npm run verify:plugin-negotiation && npm run verify:plugin-lifecycle && npm run verify:packaged-presets && npm run verify:minimal-preset-tools && npm run verify:liangshen-bootstrap && npm run verify:wheel-selection && npm run verify:liangshen-instruction-hint && npm run verify:pointer-events && npm run verify:chat-overlay && npm run verify:i18n",
102
+ "verify:build": "npm run verify:boundary && npm run verify:contract && npm run verify:herdr && npm run verify:manifest-deps && npm run verify:patch-surface && npm run verify:web-coexistence && npm run verify:plugin-spec && npm run verify:plugin-grants && npm run verify:plugin-storage && npm run verify:plugin-messages && npm run verify:plugin-ledger && npm run verify:plugin-commands && npm run verify:plugin-negotiation && npm run verify:plugin-lifecycle && npm run verify:packaged-presets && npm run verify:history-search && npm run verify:skill-direct-invocation && npm run verify:minimal-preset-tools && npm run verify:liangshen-bootstrap && npm run verify:wheel-selection && npm run verify:liangshen-instruction-hint && npm run verify:pointer-events && npm run verify:chat-overlay && npm run verify:i18n && npm run verify:approval-visibility",
102
103
  "verify:boundary": "node --import tsx/esm scripts/verify-adapter-boundary.ts",
103
104
  "verify:i18n": "node --import tsx/esm scripts/verify-i18n.ts",
104
105
  "verify:contract": "node --import tsx/esm scripts/verify-upstream-contract.ts",
@@ -119,6 +120,7 @@
119
120
  "verify:bun-package": "node scripts/verify-bun-package.mjs",
120
121
  "verify:prompt-debug": "npm run build && node scripts/verify-prompt-debug.mjs",
121
122
  "verify:clipboard-image": "node --import tsx/esm scripts/verify-clipboard-image.ts",
123
+ "verify:history-search": "node --import tsx/esm scripts/verify-history-search.mjs",
122
124
  "verify:plugin-ledger": "node --import tsx/esm scripts/verify-plugin-ledger.ts",
123
125
  "verify:plugin-commands": "node --import tsx/esm scripts/verify-plugin-commands.ts",
124
126
  "verify:plugin-negotiation": "node --import tsx/esm scripts/verify-plugin-negotiation.ts",
@@ -128,8 +130,12 @@
128
130
  "verify:wheel-selection": "node --import tsx/esm scripts/verify-wheel-selection.ts",
129
131
  "verify:pointer-events": "node --import tsx/esm scripts/verify-pointer-events.ts",
130
132
  "verify:chat-overlay": "node --import tsx/esm scripts/verify-chat-overlay.ts",
133
+ "verify:approval-visibility": "node --import tsx/esm scripts/verify-approval-visibility.tsx",
134
+ "verify:skill-direct-invocation": "node --import tsx/esm scripts/verify-skill-direct-invocation.ts",
131
135
  "sync:profile": "node scripts/sync-profile.mjs",
132
- "sync:profile:check": "node scripts/sync-profile.mjs --check"
136
+ "sync:profile:check": "node scripts/sync-profile.mjs --check",
137
+ "bundle:installer": "node scripts/make-installer-bundle.mjs",
138
+ "bundle:standalone": "node scripts/make-standalone-bundle.mjs"
133
139
  },
134
140
  "peerDependencies": {
135
141
  "@deepseek-ai/cordis": "^4.0.1",
@@ -160,8 +166,92 @@
160
166
  "@deepseek-ai/dsh-workspace": "^0.1.0-rc.6 || ^0.1.1-rc.1",
161
167
  "@deepseek-ai/schemastery": "^3.18.1"
162
168
  },
169
+ "peerDependenciesMeta": {
170
+ "@deepseek-ai/cordis": {
171
+ "optional": true
172
+ },
173
+ "@deepseek-ai/dsh-agent": {
174
+ "optional": true
175
+ },
176
+ "@deepseek-ai/dsh-agent-instructions": {
177
+ "optional": true
178
+ },
179
+ "@deepseek-ai/dsh-agent-presets": {
180
+ "optional": true
181
+ },
182
+ "@deepseek-ai/dsh-atomic-write": {
183
+ "optional": true
184
+ },
185
+ "@deepseek-ai/dsh-commands": {
186
+ "optional": true
187
+ },
188
+ "@deepseek-ai/dsh-cordis-host-runner": {
189
+ "optional": true
190
+ },
191
+ "@deepseek-ai/dsh-invariants": {
192
+ "optional": true
193
+ },
194
+ "@deepseek-ai/dsh-llm": {
195
+ "optional": true
196
+ },
197
+ "@deepseek-ai/dsh-llm-pi-ai": {
198
+ "optional": true
199
+ },
200
+ "@deepseek-ai/dsh-persona": {
201
+ "optional": true
202
+ },
203
+ "@deepseek-ai/dsh-session": {
204
+ "optional": true
205
+ },
206
+ "@deepseek-ai/dsh-settings": {
207
+ "optional": true
208
+ },
209
+ "@deepseek-ai/dsh-skill": {
210
+ "optional": true
211
+ },
212
+ "@deepseek-ai/dsh-storage": {
213
+ "optional": true
214
+ },
215
+ "@deepseek-ai/dsh-storage-domain": {
216
+ "optional": true
217
+ },
218
+ "@deepseek-ai/dsh-storage-json": {
219
+ "optional": true
220
+ },
221
+ "@deepseek-ai/dsh-system-prompt": {
222
+ "optional": true
223
+ },
224
+ "@deepseek-ai/dsh-terminal": {
225
+ "optional": true
226
+ },
227
+ "@deepseek-ai/dsh-terminal-bash": {
228
+ "optional": true
229
+ },
230
+ "@deepseek-ai/dsh-tool-ask-user": {
231
+ "optional": true
232
+ },
233
+ "@deepseek-ai/dsh-tool-bash-persistent": {
234
+ "optional": true
235
+ },
236
+ "@deepseek-ai/dsh-tool-cordis": {
237
+ "optional": true
238
+ },
239
+ "@deepseek-ai/dsh-user-approval": {
240
+ "optional": true
241
+ },
242
+ "@deepseek-ai/dsh-user-questions": {
243
+ "optional": true
244
+ },
245
+ "@deepseek-ai/dsh-workspace": {
246
+ "optional": true
247
+ },
248
+ "@deepseek-ai/schemastery": {
249
+ "optional": true
250
+ }
251
+ },
163
252
  "dependencies": {
164
253
  "@alcalzone/ansi-tokenize": "^0.3.0",
254
+ "@earendil-works/pi-ai": "^0.82.1",
165
255
  "auto-bind": "^4.0.0 || ^5.0.0",
166
256
  "bidi-js": "^1.0.0",
167
257
  "chalk": "^5.0.0",
@@ -170,7 +260,6 @@
170
260
  "code-excerpt": "^3.0.0 || ^4.0.0",
171
261
  "diff": "^8.0.4",
172
262
  "dsh-working-activity": "^0.3.3",
173
- "@earendil-works/pi-ai": "^0.82.1",
174
263
  "emoji-regex": "^10.0.0",
175
264
  "figures": "^6.1.0",
176
265
  "get-east-asian-width": "^1.0.0",
@@ -251,6 +340,7 @@
251
340
  "@types/react-reconciler": "^0.33.0",
252
341
  "@types/semver": "^7.0.0",
253
342
  "@xterm/headless": "^6.0.0",
343
+ "tar": "^7.5.22",
254
344
  "tsx": "^4.0.0",
255
345
  "typescript": "^6.0.3",
256
346
  "yaml": "^2.9.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pr-comments
3
- description: Use when the user asks to review pull request comments, or when the /pr_comments command runs — fetch and analyze PR review comments on the current branch and summarize actionable items.
3
+ description: Use when the user asks to review pull request comments, or when the /pr-comments command runs — fetch and analyze PR review comments on the current branch and summarize actionable items.
4
4
  ---
5
5
 
6
6
  # Pull Request Comments Review
@@ -1,8 +1,8 @@
1
- # Changelog
2
-
3
- Changes to `@dsh-std/connection` are recorded here.
4
-
5
- ## 0.1.0 (draft)
6
-
7
- - Defined connection services, endpoint views, participant publication, capability bindings, and attachments.
8
- - Added an in-memory transport for protocol conformance and host integration tests.
1
+ # Changelog
2
+
3
+ Changes to `@dsh-std/connection` are recorded here.
4
+
5
+ ## 0.1.0 (draft)
6
+
7
+ - Defined connection services, endpoint views, participant publication, capability bindings, and attachments.
8
+ - Added an in-memory transport for protocol conformance and host integration tests.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 DSH Standard contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DSH Standard contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,42 +1,42 @@
1
- # @dsh-std/connection
2
-
3
- English | [中文](README.zh.md)
4
-
5
- The proposed design is documented in [Endpoint Connection](../../docs/proposals/endpoint-connection.zh.md). It separates the application-facing `ConnectionService` from the Connection Host provider SPI. The remainder of this page describes the current reference implementation, which does not yet complete that split.
6
-
7
- Host-provided communication service, two-endpoint capability negotiation, and implementation-neutral invocation for the DSH Standard.
8
-
9
- ## Endpoint offers
10
-
11
- An endpoint offer contains an endpoint identity, a revision, and the live participant declarations admitted by endpoint policy. It carries no component manifests, installation inventory, or plugin registry.
12
-
13
- `resolveConnection()` passes both sets of declarations to a caller-owned `ProtocolCatalog`. Each protocol definition owns its negotiation and may place invocation bindings in its agreement; connection does not impose consumer/provider semantics on every protocol. `defineCapabilityProtocol()` is an explicit helper for domain protocols that do use RPC-shaped bindings.
14
-
15
- Each invocation binding is participant-scoped and plan-revision-scoped. A client for one participant cannot discover or invoke bindings granted to another participant.
16
-
17
- ## Current reference API
18
-
19
- `StandardConnection` exposes endpoint identities, the active plan, consumer-scoped clients, plan-change observation, and close. `CapabilityClient.invoke()` returns an invocation id, a result promise, an asynchronous progress stream, and cancellation. Domain protocol packages own operation names and input, output, and progress values.
20
-
21
- `ConnectionBroker` selects one registered `ConnectionConnector` for an implementation-neutral target URI. Zero matches and multiple matches are both explicit errors. The broker does not expose the selected connector type through `StandardConnection`.
22
-
23
- These types are an early reference implementation. They do not require a TUI, Web UI, GUI, or business plugin to register and operate its own connector. The protocol direction places the broker, connector/provider registry, carrier, and wire behind a Connection Host's `ConnectionService`. A consumer submits a target and uses scoped typed clients for the negotiated protocols.
24
-
25
- A Connection Host may install or discover a remote service, own authentication, ports, forwarding and reconnection, and produce the `StandardConnection`. An SSH target facet contributes resolution and bootstrap integration while system OpenSSH or another provider may supply the physical SSH implementation. Applications do not observe the selected provider, ports, credentials, or wire.
26
-
27
- ## Lifecycle
28
-
29
- Renegotiation creates a complete new plan revision and publishes it atomically. An invocation admitted under the old revision retains its binding until settlement; later invocations use the new revision. Closing a connection cancels active work and rejects new work with `connection-closed`.
30
-
31
- Transport implementations must preserve invocation isolation, progress order, cancellation, and the error classification exposed by `ConnectionInvocationError`. They are also responsible for authenticating the peer and preventing one connection from reusing another connection's grants.
32
-
33
- ## Reference implementation
34
-
35
- The `@dsh-std/connection/memory` export provides a process-local implementation for tests, adapters, and conformance experiments. It demonstrates symmetric calls, progress, cancellation, isolation, and renegotiation. It is not a required carrier or a wire-format specification.
36
-
37
- ## Known Limitations and Deferred Work
38
-
39
- - The consumer-facing `ConnectionService` and Host provider SPI are not implemented in the current code yet.
40
- - The package does not yet standardize discovery, authentication, encryption, reconnect policy, framing, or serialization.
41
- - A connection has exactly two endpoints in `v1alpha1`; multi-party routing is composed from separate connections.
42
- - The capability helper requires one peer provider by default. Protocols that allow multiple providers must opt into and define that behavior explicitly.
1
+ # @dsh-std/connection
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ The proposed design is documented in [Endpoint Connection](../../docs/proposals/endpoint-connection.zh.md). It separates the application-facing `ConnectionService` from the Connection Host provider SPI. The remainder of this page describes the current reference implementation, which does not yet complete that split.
6
+
7
+ Host-provided communication service, two-endpoint capability negotiation, and implementation-neutral invocation for the DSH Standard.
8
+
9
+ ## Endpoint offers
10
+
11
+ An endpoint offer contains an endpoint identity, a revision, and the live participant declarations admitted by endpoint policy. It carries no component manifests, installation inventory, or plugin registry.
12
+
13
+ `resolveConnection()` passes both sets of declarations to a caller-owned `ProtocolCatalog`. Each protocol definition owns its negotiation and may place invocation bindings in its agreement; connection does not impose consumer/provider semantics on every protocol. `defineCapabilityProtocol()` is an explicit helper for domain protocols that do use RPC-shaped bindings.
14
+
15
+ Each invocation binding is participant-scoped and plan-revision-scoped. A client for one participant cannot discover or invoke bindings granted to another participant.
16
+
17
+ ## Current reference API
18
+
19
+ `StandardConnection` exposes endpoint identities, the active plan, consumer-scoped clients, plan-change observation, and close. `CapabilityClient.invoke()` returns an invocation id, a result promise, an asynchronous progress stream, and cancellation. Domain protocol packages own operation names and input, output, and progress values.
20
+
21
+ `ConnectionBroker` selects one registered `ConnectionConnector` for an implementation-neutral target URI. Zero matches and multiple matches are both explicit errors. The broker does not expose the selected connector type through `StandardConnection`.
22
+
23
+ These types are an early reference implementation. They do not require a TUI, Web UI, GUI, or business plugin to register and operate its own connector. The protocol direction places the broker, connector/provider registry, carrier, and wire behind a Connection Host's `ConnectionService`. A consumer submits a target and uses scoped typed clients for the negotiated protocols.
24
+
25
+ A Connection Host may install or discover a remote service, own authentication, ports, forwarding and reconnection, and produce the `StandardConnection`. An SSH target facet contributes resolution and bootstrap integration while system OpenSSH or another provider may supply the physical SSH implementation. Applications do not observe the selected provider, ports, credentials, or wire.
26
+
27
+ ## Lifecycle
28
+
29
+ Renegotiation creates a complete new plan revision and publishes it atomically. An invocation admitted under the old revision retains its binding until settlement; later invocations use the new revision. Closing a connection cancels active work and rejects new work with `connection-closed`.
30
+
31
+ Transport implementations must preserve invocation isolation, progress order, cancellation, and the error classification exposed by `ConnectionInvocationError`. They are also responsible for authenticating the peer and preventing one connection from reusing another connection's grants.
32
+
33
+ ## Reference implementation
34
+
35
+ The `@dsh-std/connection/memory` export provides a process-local implementation for tests, adapters, and conformance experiments. It demonstrates symmetric calls, progress, cancellation, isolation, and renegotiation. It is not a required carrier or a wire-format specification.
36
+
37
+ ## Known Limitations and Deferred Work
38
+
39
+ - The consumer-facing `ConnectionService` and Host provider SPI are not implemented in the current code yet.
40
+ - The package does not yet standardize discovery, authentication, encryption, reconnect policy, framing, or serialization.
41
+ - A connection has exactly two endpoints in `v1alpha1`; multi-party routing is composed from separate connections.
42
+ - The capability helper requires one peer provider by default. Protocols that allow multiple providers must opt into and define that behavior explicitly.