@deepseek-harness-tui/dsh-tui 0.8.4 → 0.8.5

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 (174) hide show
  1. package/bin/dsh-tui.js +0 -0
  2. package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
  3. package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
  4. package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
  5. package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
  6. package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
  7. package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
  8. package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
  9. package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
  10. package/dsh-ecosystem-spec/registry/README.md +14 -14
  11. package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
  12. package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
  13. package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
  14. package/lib/types/activityPrefs.d.ts +10 -0
  15. package/lib/types/activityPrefs.d.ts.map +1 -1
  16. package/lib/types/activityPrefs.js +17 -0
  17. package/lib/types/components/MessageList.d.ts +4 -1
  18. package/lib/types/components/MessageList.d.ts.map +1 -1
  19. package/lib/types/components/MessageList.js +4 -4
  20. package/lib/types/components/SplitDiffView.d.ts +3 -1
  21. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  22. package/lib/types/components/SplitDiffView.js +12 -5
  23. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
  24. package/lib/types/components/StreamingMarkdown.js +10 -2
  25. package/lib/types/components/activityFrames.d.ts +7 -28
  26. package/lib/types/components/activityFrames.d.ts.map +1 -1
  27. package/lib/types/components/activityFrames.js +7 -94
  28. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  29. package/lib/types/components/messages/AssistantThinkingMessage.js +1 -1
  30. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +4 -1
  31. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  32. package/lib/types/components/messages/AssistantToolUseMessage.js +14 -3
  33. package/lib/types/dsh-adapter/channel.d.ts +17 -0
  34. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  35. package/lib/types/dsh-adapter/channel.js +161 -19
  36. package/lib/types/dsh-adapter/index.d.ts +5 -0
  37. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  38. package/lib/types/dsh-adapter/index.js +19 -0
  39. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  40. package/lib/types/dsh-adapter/plugin.js +176 -4
  41. package/lib/types/dsh-adapter/settings-sections.d.ts +13 -0
  42. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  43. package/lib/types/dsh-adapter/settings-sections.js +31 -6
  44. package/lib/types/ink/ink.d.ts +9 -0
  45. package/lib/types/ink/ink.d.ts.map +1 -1
  46. package/lib/types/ink/ink.js +24 -1
  47. package/lib/types/screens/Chat.d.ts.map +1 -1
  48. package/lib/types/screens/Chat.js +34 -4
  49. package/lib/types/screens/Settings.d.ts.map +1 -1
  50. package/lib/types/screens/Settings.js +109 -50
  51. package/lib/types/screens/StatusLine.d.ts +8 -0
  52. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  53. package/lib/types/screens/StatusLine.js +62 -39
  54. package/lib/types/settings-sections.d.ts +1 -1
  55. package/lib/types/settings-sections.d.ts.map +1 -1
  56. package/lib/types/tips.js +2 -2
  57. package/lib/types/tuiDisplayPrefs.d.ts +47 -0
  58. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -0
  59. package/lib/types/tuiDisplayPrefs.js +60 -0
  60. package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
  61. package/node_modules/@dsh-std/command/LICENSE +21 -21
  62. package/node_modules/@dsh-std/command/README.md +26 -26
  63. package/node_modules/@dsh-std/command/README.zh.md +28 -28
  64. package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
  65. package/node_modules/@dsh-std/command/package.json +22 -22
  66. package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  67. package/node_modules/@dsh-std/connection/LICENSE +21 -21
  68. package/node_modules/@dsh-std/connection/README.md +42 -42
  69. package/node_modules/@dsh-std/connection/README.zh.md +42 -42
  70. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  71. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  72. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  73. package/node_modules/@dsh-std/connection/package.json +20 -20
  74. package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  75. package/node_modules/@dsh-std/core/LICENSE +21 -21
  76. package/node_modules/@dsh-std/core/README.md +13 -13
  77. package/node_modules/@dsh-std/core/README.zh.md +13 -13
  78. package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  79. package/node_modules/@dsh-std/core/package.json +21 -21
  80. package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  81. package/node_modules/@dsh-std/manifest/LICENSE +21 -21
  82. package/node_modules/@dsh-std/manifest/README.md +5 -5
  83. package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  84. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  85. package/node_modules/@dsh-std/manifest/package.json +20 -20
  86. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  87. package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
  88. package/node_modules/@dsh-std/messages/LICENSE +21 -21
  89. package/node_modules/@dsh-std/messages/README.md +5 -5
  90. package/node_modules/@dsh-std/messages/README.zh.md +7 -7
  91. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
  92. package/node_modules/@dsh-std/messages/package.json +20 -20
  93. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
  94. package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  95. package/node_modules/@dsh-std/presentation/LICENSE +21 -21
  96. package/node_modules/@dsh-std/presentation/README.md +27 -27
  97. package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  98. package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  99. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  100. package/node_modules/@dsh-std/presentation/package.json +25 -25
  101. package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
  102. package/node_modules/@dsh-std/storage/LICENSE +21 -21
  103. package/node_modules/@dsh-std/storage/README.md +5 -5
  104. package/node_modules/@dsh-std/storage/README.zh.md +7 -7
  105. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
  106. package/node_modules/@dsh-std/storage/package.json +20 -20
  107. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
  108. package/package.json +6 -3
  109. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  110. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
  111. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
  112. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
  113. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  114. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  115. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  116. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
  117. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  118. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
  119. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
  120. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
  121. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  122. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
  123. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  124. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
  125. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
  126. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  127. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  128. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
  129. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  130. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  131. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
  132. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
  133. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  134. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  135. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  136. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
  137. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  138. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
  139. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
  140. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
  141. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  142. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
  143. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  144. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
  145. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
  146. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
  147. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  148. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
  149. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  150. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
  151. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
  152. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
  153. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  154. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
  155. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  156. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
  157. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
  158. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
  159. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  160. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  161. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  162. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
  163. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  164. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
  165. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
  166. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
  167. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  168. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
  169. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  170. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
  171. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
  172. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
  173. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  174. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
package/bin/dsh-tui.js CHANGED
File without changes
@@ -1,13 +1,13 @@
1
- import type { ApiReference, ProtocolCatalog, ProtocolDefinition } from '@dsh-std/core'
2
- export { registerTuiContributionExtensions } from './tui-contributions.js'
3
- export * from './tui-channel.js'
4
-
5
- export const DECISION_EVENTS: Readonly<ApiReference & {
6
- apiVersion: 'tui.dsh/v1alpha1'
7
- kind: 'DecisionEvents'
8
- }>
9
-
10
- export const decisionEventsDefinition: ProtocolDefinition
11
- export const profileDefinitions: readonly ProtocolDefinition[]
12
-
13
- export function registerProfileProtocols(catalog: ProtocolCatalog): () => void
1
+ import type { ApiReference, ProtocolCatalog, ProtocolDefinition } from '@dsh-std/core'
2
+ export { registerTuiContributionExtensions } from './tui-contributions.js'
3
+ export * from './tui-channel.js'
4
+
5
+ export const DECISION_EVENTS: Readonly<ApiReference & {
6
+ apiVersion: 'tui.dsh/v1alpha1'
7
+ kind: 'DecisionEvents'
8
+ }>
9
+
10
+ export const decisionEventsDefinition: ProtocolDefinition
11
+ export const profileDefinitions: readonly ProtocolDefinition[]
12
+
13
+ export function registerProfileProtocols(catalog: ProtocolCatalog): () => void
@@ -1,59 +1,59 @@
1
- /** dsh-TUI private protocol definitions evaluated by @dsh-std/core. */
2
-
3
- export { registerTuiContributionExtensions } from './tui-contributions.js'
4
- export * from './tui-channel.js'
5
- import { tuiChannelDefinition } from './tui-channel.js'
6
-
7
- export const DECISION_EVENTS = Object.freeze({
8
- apiVersion: 'tui.dsh/v1alpha1',
9
- kind: 'DecisionEvents',
10
- })
11
-
12
- function featureSupport(value, label) {
13
- if (value === undefined) return Object.freeze({ features: Object.freeze([]) })
14
- if (typeof value !== 'object' || value === null || Array.isArray(value)) {
15
- throw new TypeError(`${label} support spec must be an object`)
16
- }
17
- const unknown = Object.keys(value).filter(key => key !== 'features' && !key.startsWith('x-'))
18
- if (unknown.length > 0) throw new TypeError(`${label} support spec contains unknown field ${JSON.stringify(unknown[0])}`)
19
- if (value.features !== undefined && (!Array.isArray(value.features)
20
- || value.features.some(feature => typeof feature !== 'string' || feature.trim() === ''))) {
21
- throw new TypeError(`${label} support spec.features must be an array of non-empty strings`)
22
- }
23
- return Object.freeze({ features: Object.freeze([...(value.features ?? [])].sort()) })
24
- }
25
-
26
- function providerDefinition(reference, label) {
27
- return Object.freeze({
28
- ...reference,
29
- validateRequirement(value) {
30
- if (value !== undefined) throw new TypeError(`${label} requirement does not accept spec in manifest v0.15`)
31
- return undefined
32
- },
33
- validateSupport(value) { return featureSupport(value, label) },
34
- negotiate(input) {
35
- const providers = [...new Set(input.supports.map(row => row.participant))].sort()
36
- const issues = input.requirements.flatMap(row => providers.length === 0
37
- ? [{
38
- code: row.requirement.optional === true ? 'optional-support-missing' : 'required-support-missing',
39
- severity: row.requirement.optional === true ? 'warning' : 'error',
40
- participant: row.participant,
41
- message: `${label} has no provider in this negotiation scope`,
42
- }]
43
- : [])
44
- return { agreement: Object.freeze({ providers: Object.freeze(providers) }), issues: Object.freeze(issues) }
45
- },
46
- })
47
- }
48
-
49
- export const decisionEventsDefinition = providerDefinition(DECISION_EVENTS, 'DecisionEvents')
50
-
51
- export const profileDefinitions = Object.freeze([
52
- decisionEventsDefinition,
53
- tuiChannelDefinition,
54
- ])
55
-
56
- export function registerProfileProtocols(catalog) {
57
- const disposers = profileDefinitions.map(definition => catalog.register(definition))
58
- return () => { for (const dispose of disposers.reverse()) dispose() }
59
- }
1
+ /** dsh-TUI private protocol definitions evaluated by @dsh-std/core. */
2
+
3
+ export { registerTuiContributionExtensions } from './tui-contributions.js'
4
+ export * from './tui-channel.js'
5
+ import { tuiChannelDefinition } from './tui-channel.js'
6
+
7
+ export const DECISION_EVENTS = Object.freeze({
8
+ apiVersion: 'tui.dsh/v1alpha1',
9
+ kind: 'DecisionEvents',
10
+ })
11
+
12
+ function featureSupport(value, label) {
13
+ if (value === undefined) return Object.freeze({ features: Object.freeze([]) })
14
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) {
15
+ throw new TypeError(`${label} support spec must be an object`)
16
+ }
17
+ const unknown = Object.keys(value).filter(key => key !== 'features' && !key.startsWith('x-'))
18
+ if (unknown.length > 0) throw new TypeError(`${label} support spec contains unknown field ${JSON.stringify(unknown[0])}`)
19
+ if (value.features !== undefined && (!Array.isArray(value.features)
20
+ || value.features.some(feature => typeof feature !== 'string' || feature.trim() === ''))) {
21
+ throw new TypeError(`${label} support spec.features must be an array of non-empty strings`)
22
+ }
23
+ return Object.freeze({ features: Object.freeze([...(value.features ?? [])].sort()) })
24
+ }
25
+
26
+ function providerDefinition(reference, label) {
27
+ return Object.freeze({
28
+ ...reference,
29
+ validateRequirement(value) {
30
+ if (value !== undefined) throw new TypeError(`${label} requirement does not accept spec in manifest v0.15`)
31
+ return undefined
32
+ },
33
+ validateSupport(value) { return featureSupport(value, label) },
34
+ negotiate(input) {
35
+ const providers = [...new Set(input.supports.map(row => row.participant))].sort()
36
+ const issues = input.requirements.flatMap(row => providers.length === 0
37
+ ? [{
38
+ code: row.requirement.optional === true ? 'optional-support-missing' : 'required-support-missing',
39
+ severity: row.requirement.optional === true ? 'warning' : 'error',
40
+ participant: row.participant,
41
+ message: `${label} has no provider in this negotiation scope`,
42
+ }]
43
+ : [])
44
+ return { agreement: Object.freeze({ providers: Object.freeze(providers) }), issues: Object.freeze(issues) }
45
+ },
46
+ })
47
+ }
48
+
49
+ export const decisionEventsDefinition = providerDefinition(DECISION_EVENTS, 'DecisionEvents')
50
+
51
+ export const profileDefinitions = Object.freeze([
52
+ decisionEventsDefinition,
53
+ tuiChannelDefinition,
54
+ ])
55
+
56
+ export function registerProfileProtocols(catalog) {
57
+ const disposers = profileDefinitions.map(definition => catalog.register(definition))
58
+ return () => { for (const dispose of disposers.reverse()) dispose() }
59
+ }
@@ -1,15 +1,15 @@
1
- export const TUI_CHANNEL_HTTP_API_VERSION: 'tui.dsh/v1alpha1'
2
- export const TUI_CHANNEL_HTTP_KIND: 'ChannelEndpoint'
3
- export const TUI_CHANNEL_HTTP_HEALTH_PATH: '/dsh-tui/v1/health'
4
- export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH: '/dsh-tui/v1/endpoint'
5
- export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH: '/dsh-tui/v1/connection'
6
-
7
- export interface TuiChannelEndpointDescriptor {
8
- readonly apiVersion: typeof TUI_CHANNEL_HTTP_API_VERSION
9
- readonly kind: typeof TUI_CHANNEL_HTTP_KIND
10
- readonly origin: string
11
- readonly connection: typeof TUI_CHANNEL_HTTP_WEBSOCKET_PATH
12
- }
13
-
14
- export function createTuiChannelEndpointDescriptor(origin: string): TuiChannelEndpointDescriptor
15
- export function validateTuiChannelEndpointDescriptor(value: unknown): TuiChannelEndpointDescriptor
1
+ export const TUI_CHANNEL_HTTP_API_VERSION: 'tui.dsh/v1alpha1'
2
+ export const TUI_CHANNEL_HTTP_KIND: 'ChannelEndpoint'
3
+ export const TUI_CHANNEL_HTTP_HEALTH_PATH: '/dsh-tui/v1/health'
4
+ export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH: '/dsh-tui/v1/endpoint'
5
+ export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH: '/dsh-tui/v1/connection'
6
+
7
+ export interface TuiChannelEndpointDescriptor {
8
+ readonly apiVersion: typeof TUI_CHANNEL_HTTP_API_VERSION
9
+ readonly kind: typeof TUI_CHANNEL_HTTP_KIND
10
+ readonly origin: string
11
+ readonly connection: typeof TUI_CHANNEL_HTTP_WEBSOCKET_PATH
12
+ }
13
+
14
+ export function createTuiChannelEndpointDescriptor(origin: string): TuiChannelEndpointDescriptor
15
+ export function validateTuiChannelEndpointDescriptor(value: unknown): TuiChannelEndpointDescriptor
@@ -1,32 +1,32 @@
1
- export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
2
- export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
3
- export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
4
- export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
5
- export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
6
-
7
- export function createTuiChannelEndpointDescriptor(origin) {
8
- const normalized = new URL(origin)
9
- if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
10
- throw new TypeError('TUI Channel endpoint origin must use http or https')
11
- }
12
- normalized.pathname = '/'
13
- normalized.search = ''
14
- normalized.hash = ''
15
- return Object.freeze({
16
- apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
17
- kind: TUI_CHANNEL_HTTP_KIND,
18
- origin: normalized.toString().replace(/\/$/u, ''),
19
- connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
20
- })
21
- }
22
-
23
- export function validateTuiChannelEndpointDescriptor(value) {
24
- if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
25
- if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
26
- throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
27
- }
28
- if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
29
- createTuiChannelEndpointDescriptor(value.origin)
30
- if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
31
- return value
32
- }
1
+ export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
2
+ export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
3
+ export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
4
+ export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
5
+ export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
6
+
7
+ export function createTuiChannelEndpointDescriptor(origin) {
8
+ const normalized = new URL(origin)
9
+ if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
10
+ throw new TypeError('TUI Channel endpoint origin must use http or https')
11
+ }
12
+ normalized.pathname = '/'
13
+ normalized.search = ''
14
+ normalized.hash = ''
15
+ return Object.freeze({
16
+ apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
17
+ kind: TUI_CHANNEL_HTTP_KIND,
18
+ origin: normalized.toString().replace(/\/$/u, ''),
19
+ connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
20
+ })
21
+ }
22
+
23
+ export function validateTuiChannelEndpointDescriptor(value) {
24
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
25
+ if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
26
+ throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
27
+ }
28
+ if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
29
+ createTuiChannelEndpointDescriptor(value.origin)
30
+ if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
31
+ return value
32
+ }
@@ -1,59 +1,59 @@
1
- import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
2
-
3
- export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
4
-
5
- export const TUI_CHANNEL: Readonly<ApiReference & {
6
- apiVersion: 'tui.dsh/v1alpha1'
7
- kind: 'Channel'
8
- }>
9
- export const TUI_CHANNEL_WIRE_REVISION: 6
10
- export const TUI_CHANNEL_FEATURES: readonly string[]
11
-
12
- export interface TuiChannelRequirementSpec {
13
- readonly wireRevision: number
14
- readonly features: readonly string[]
15
- }
16
- export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
17
-
18
- export interface TuiChannelSnapshot {
19
- readonly wireRevision: number
20
- readonly channelId: string
21
- readonly version: number
22
- readonly state: Readonly<Record<string, JsonValue>>
23
- }
24
-
25
- export interface TuiChannelWorkspaceFlowChoice {
26
- readonly id: string
27
- readonly label: string
28
- readonly description?: string
29
- readonly badge?: string
30
- readonly action: string
31
- readonly input?: {
32
- readonly action: string
33
- readonly initialValue?: string
34
- readonly placeholder?: string
35
- }
36
- }
37
-
38
- export type TuiChannelWorkspaceFlowResult =
39
- | { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
40
- | { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
41
-
42
- export type TuiChannelInput =
43
- | { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
44
- | { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
45
- | { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
46
- | { readonly operation: 'close'; readonly value: { readonly channelId: string } }
47
-
48
- export interface TuiChannelInvokeOutput {
49
- readonly value: JsonValue
50
- readonly valueDefined?: boolean
51
- readonly snapshot?: TuiChannelSnapshot
52
- }
53
-
54
- export const tuiChannelDefinition: ProtocolDefinition
55
- export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
56
- export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
57
- export function validateTuiChannelInput(operation: string, value: unknown): object
58
- export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
59
- export function validateTuiChannelOutput(operation: string, value: unknown): object
1
+ import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
2
+
3
+ export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
4
+
5
+ export const TUI_CHANNEL: Readonly<ApiReference & {
6
+ apiVersion: 'tui.dsh/v1alpha1'
7
+ kind: 'Channel'
8
+ }>
9
+ export const TUI_CHANNEL_WIRE_REVISION: 6
10
+ export const TUI_CHANNEL_FEATURES: readonly string[]
11
+
12
+ export interface TuiChannelRequirementSpec {
13
+ readonly wireRevision: number
14
+ readonly features: readonly string[]
15
+ }
16
+ export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
17
+
18
+ export interface TuiChannelSnapshot {
19
+ readonly wireRevision: number
20
+ readonly channelId: string
21
+ readonly version: number
22
+ readonly state: Readonly<Record<string, JsonValue>>
23
+ }
24
+
25
+ export interface TuiChannelWorkspaceFlowChoice {
26
+ readonly id: string
27
+ readonly label: string
28
+ readonly description?: string
29
+ readonly badge?: string
30
+ readonly action: string
31
+ readonly input?: {
32
+ readonly action: string
33
+ readonly initialValue?: string
34
+ readonly placeholder?: string
35
+ }
36
+ }
37
+
38
+ export type TuiChannelWorkspaceFlowResult =
39
+ | { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
40
+ | { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
41
+
42
+ export type TuiChannelInput =
43
+ | { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
44
+ | { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
45
+ | { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
46
+ | { readonly operation: 'close'; readonly value: { readonly channelId: string } }
47
+
48
+ export interface TuiChannelInvokeOutput {
49
+ readonly value: JsonValue
50
+ readonly valueDefined?: boolean
51
+ readonly snapshot?: TuiChannelSnapshot
52
+ }
53
+
54
+ export const tuiChannelDefinition: ProtocolDefinition
55
+ export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
56
+ export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
57
+ export function validateTuiChannelInput(operation: string, value: unknown): object
58
+ export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
59
+ export function validateTuiChannelOutput(operation: string, value: unknown): object