@openbkn/dsh-business-context 0.1.5-rc.1

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 (46) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +42 -0
  3. package/README.zh.md +42 -0
  4. package/cordis.patch.yml +3 -0
  5. package/lib/client.js +7553 -0
  6. package/lib/index.js +1788 -0
  7. package/lib/typert.host.d.ts +3 -0
  8. package/lib/typert.host.js +624 -0
  9. package/lib/typert.remote-client.d.ts +40 -0
  10. package/lib/typert.remote-client.js +435 -0
  11. package/lib/types/auth.d.ts +42 -0
  12. package/lib/types/business-context-service.d.ts +126 -0
  13. package/lib/types/business-graph-model.d.ts +34 -0
  14. package/lib/types/business-network-catalog.d.ts +8 -0
  15. package/lib/types/client/BoundNetworkBadge.d.ts +37 -0
  16. package/lib/types/client/OpenBknContextToolView.d.ts +4 -0
  17. package/lib/types/client/OpenBknEntry.d.ts +9 -0
  18. package/lib/types/client/OpenBknOverlay.d.ts +16 -0
  19. package/lib/types/client/ProvenanceOverlay.d.ts +33 -0
  20. package/lib/types/client/SuggestionDock.d.ts +12 -0
  21. package/lib/types/client/TurnProvenanceActions.d.ts +13 -0
  22. package/lib/types/client/index.d.ts +11 -0
  23. package/lib/types/client/network-directory.d.ts +13 -0
  24. package/lib/types/client/openbkn-ui-controller.d.ts +51 -0
  25. package/lib/types/client/suggestion-dock-controller.d.ts +22 -0
  26. package/lib/types/client/turn-provenance-controller.d.ts +14 -0
  27. package/lib/types/config.d.ts +30 -0
  28. package/lib/types/dsh-session-binding.d.ts +26 -0
  29. package/lib/types/dsh-session-provenance.d.ts +27 -0
  30. package/lib/types/index.d.ts +33 -0
  31. package/lib/types/interaction-references.d.ts +15 -0
  32. package/lib/types/managed-session-policy.d.ts +18 -0
  33. package/lib/types/native-mcp-provenance.d.ts +17 -0
  34. package/lib/types/network-capability-profile.d.ts +26 -0
  35. package/lib/types/openbkn-cli-subprocess.d.ts +50 -0
  36. package/lib/types/openbkn-mcp-manager.d.ts +32 -0
  37. package/lib/types/platform-reader.d.ts +51 -0
  38. package/lib/types/provenance-handle.d.ts +5 -0
  39. package/lib/types/provenance-view.d.ts +11 -0
  40. package/lib/types/scoped-business-context.d.ts +10 -0
  41. package/lib/types/session-binding.d.ts +35 -0
  42. package/lib/types/suggested-prompts.d.ts +3 -0
  43. package/lib/types/turn-provenance.d.ts +25 -0
  44. package/lib/types/types.d.ts +111 -0
  45. package/lib/types/workspace-binding-registry.d.ts +40 -0
  46. package/package.json +131 -0
@@ -0,0 +1,40 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ TypertRemoteContribution,
5
+ } from '@deepseek-ai/dsh-typert-protocol'
6
+ import type { AuthSnapshot, BusinessNetworkBinding, BusinessNetworkSummary, ProvenanceHandle, ProvenanceView } from '@openbkn/dsh-business-context/types'
7
+
8
+ declare module '@deepseek-ai/dsh-typert-protocol' {
9
+ interface TypertRemoteNamespace$6f70656e626b6e427573696e657373436f6e74657874 {
10
+ beginLogin: (signal?: AbortSignal) => Promise<RemoteResult<readonly BusinessNetworkSummary[]>>
11
+ bindNetwork: (sessionId: SessionId, networkId: string, signal?: AbortSignal) => Promise<RemoteResult<BusinessNetworkBinding>>
12
+ bindNetworkWorkspace: (networkId: string, workspacePath: string, signal?: AbortSignal) => Promise<RemoteResult<BusinessNetworkSummary>>
13
+ configureToken: (token: string, signal?: AbortSignal) => Promise<RemoteResult<readonly BusinessNetworkSummary[]>>
14
+ getNetworkBinding: (sessionId: SessionId) => Promise<RemoteResult<BusinessNetworkBinding | undefined>>
15
+ getSessionSuggestions: (sessionId: SessionId) => Promise<RemoteResult<readonly string[]>>
16
+ getTurnProvenance: (sessionId: SessionId, messageId: string) => Promise<RemoteResult<ProvenanceHandle | undefined>>
17
+ getTurnProvenanceView: (sessionId: SessionId, messageId: string, signal?: AbortSignal) => Promise<RemoteResult<ProvenanceView | undefined>>
18
+ listNetworks: (signal?: AbortSignal) => Promise<RemoteResult<readonly BusinessNetworkSummary[]>>
19
+ status: (signal?: AbortSignal) => Promise<RemoteResult<AuthSnapshot>>
20
+ }
21
+ interface TypertRemoteMap {
22
+ 'openbknBusinessContext/beginLogin': (signal?: AbortSignal) => Promise<RemoteResult<readonly BusinessNetworkSummary[]>>
23
+ 'openbknBusinessContext/bindNetwork': (sessionId: SessionId, networkId: string, signal?: AbortSignal) => Promise<RemoteResult<BusinessNetworkBinding>>
24
+ 'openbknBusinessContext/bindNetworkWorkspace': (networkId: string, workspacePath: string, signal?: AbortSignal) => Promise<RemoteResult<BusinessNetworkSummary>>
25
+ 'openbknBusinessContext/configureToken': (token: string, signal?: AbortSignal) => Promise<RemoteResult<readonly BusinessNetworkSummary[]>>
26
+ 'openbknBusinessContext/getNetworkBinding': (sessionId: SessionId) => Promise<RemoteResult<BusinessNetworkBinding | undefined>>
27
+ 'openbknBusinessContext/getSessionSuggestions': (sessionId: SessionId) => Promise<RemoteResult<readonly string[]>>
28
+ 'openbknBusinessContext/getTurnProvenance': (sessionId: SessionId, messageId: string) => Promise<RemoteResult<ProvenanceHandle | undefined>>
29
+ 'openbknBusinessContext/getTurnProvenanceView': (sessionId: SessionId, messageId: string, signal?: AbortSignal) => Promise<RemoteResult<ProvenanceView | undefined>>
30
+ 'openbknBusinessContext/listNetworks': (signal?: AbortSignal) => Promise<RemoteResult<readonly BusinessNetworkSummary[]>>
31
+ 'openbknBusinessContext/status': (signal?: AbortSignal) => Promise<RemoteResult<AuthSnapshot>>
32
+ }
33
+ interface TypertRemoteNamespaceMap {
34
+ 'openbknBusinessContext': TypertRemoteNamespace$6f70656e626b6e427573696e657373436f6e74657874
35
+ }
36
+ }
37
+
38
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
39
+ export default TYPERT_REMOTE
40
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,435 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _openbkn_dsh_business_context_openbknBusinessContext_beginLogin_result$schema$value
5
+ const _openbkn_dsh_business_context_openbknBusinessContext_beginLogin_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_beginLogin_result$schema$value ??= z.array(z.object({
6
+ 'id': z.string().readonly(),
7
+ 'displayName': z.string().readonly(),
8
+ 'description': z.union([z.undefined(), z.string()]).readonly().optional(),
9
+ 'workspacePath': z.union([z.undefined(), z.string()]).readonly().optional(),
10
+ })))
11
+ let _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_0$schema$value
12
+ const _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
13
+ let _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_1$schema$value
14
+ const _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_1$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_1$schema$value ??= z.string())
15
+ let _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_result$schema$value
16
+ const _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_result$schema$value ??= z.object({
17
+ 'platformBaseUrl': z.string().readonly(),
18
+ 'knowledgeNetworkId': z.string().readonly(),
19
+ 'displayName': z.string().readonly(),
20
+ }))
21
+ let _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_0$schema$value
22
+ const _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_0$schema$value ??= z.string())
23
+ let _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_1$schema$value
24
+ const _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_1$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_1$schema$value ??= z.string())
25
+ let _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_result$schema$value
26
+ const _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_result$schema$value ??= z.object({
27
+ 'id': z.string().readonly(),
28
+ 'displayName': z.string().readonly(),
29
+ 'description': z.union([z.undefined(), z.string()]).readonly().optional(),
30
+ 'workspacePath': z.union([z.undefined(), z.string()]).readonly().optional(),
31
+ }))
32
+ let _openbkn_dsh_business_context_openbknBusinessContext_configureToken_parameter_0$schema$value
33
+ const _openbkn_dsh_business_context_openbknBusinessContext_configureToken_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_configureToken_parameter_0$schema$value ??= z.string())
34
+ let _openbkn_dsh_business_context_openbknBusinessContext_configureToken_result$schema$value
35
+ const _openbkn_dsh_business_context_openbknBusinessContext_configureToken_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_configureToken_result$schema$value ??= z.array(z.object({
36
+ 'id': z.string().readonly(),
37
+ 'displayName': z.string().readonly(),
38
+ 'description': z.union([z.undefined(), z.string()]).readonly().optional(),
39
+ 'workspacePath': z.union([z.undefined(), z.string()]).readonly().optional(),
40
+ })))
41
+ let _openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_parameter_0$schema$value
42
+ const _openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
43
+ let _openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_result$schema$value
44
+ const _openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_result$schema$value ??= z.union([z.undefined(), z.object({
45
+ 'platformBaseUrl': z.string().readonly(),
46
+ 'knowledgeNetworkId': z.string().readonly(),
47
+ 'displayName': z.string().readonly(),
48
+ })]))
49
+ let _openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_parameter_0$schema$value
50
+ const _openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
51
+ let _openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_result$schema$value
52
+ const _openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_result$schema$value ??= z.array(z.string()))
53
+ let _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_0$schema$value
54
+ const _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
55
+ let _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_1$schema$value
56
+ const _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_1$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_1$schema$value ??= z.string())
57
+ let _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_result$schema$value
58
+ const _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_result$schema$value ??= z.union([z.undefined(), z.object({
59
+ 'schemaVersion': z.literal(1).readonly(),
60
+ 'interactionId': z.string().readonly(),
61
+ 'requestIds': z.array(z.string()).readonly(),
62
+ 'traceIds': z.array(z.string()).readonly(),
63
+ 'receiptIds': z.array(z.string()).readonly(),
64
+ 'status': z.union([z.literal("completed"), z.literal("failed")]).readonly(),
65
+ 'partial': z.boolean().readonly(),
66
+ })]))
67
+ let _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_0$schema$value
68
+ const _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_0$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
69
+ let _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_1$schema$value
70
+ const _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_1$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_1$schema$value ??= z.string())
71
+ let _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_result$schema$value
72
+ const _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_result$schema$value ??= z.union([z.undefined(), z.object({
73
+ 'interactionId': z.string().readonly(),
74
+ 'execution': z.object({
75
+ 'status': z.union([z.undefined(), z.string()]).readonly().optional(),
76
+ 'operations': z.array(z.object({
77
+ 'id': z.string().readonly(),
78
+ 'label': z.string().readonly(),
79
+ 'protocol': z.union([z.undefined(), z.string()]).readonly().optional(),
80
+ 'status': z.union([z.undefined(), z.string()]).readonly().optional(),
81
+ 'startedAt': z.union([z.undefined(), z.string()]).readonly().optional(),
82
+ 'finishedAt': z.union([z.undefined(), z.string()]).readonly().optional(),
83
+ 'requestId': z.union([z.undefined(), z.string()]).readonly().optional(),
84
+ 'traceId': z.union([z.undefined(), z.string()]).readonly().optional(),
85
+ 'receiptId': z.union([z.undefined(), z.string()]).readonly().optional(),
86
+ })).readonly(),
87
+ }).readonly(),
88
+ 'business': z.union([z.object({
89
+ 'kind': z.literal("unavailable").readonly(),
90
+ }), z.object({
91
+ 'kind': z.literal("ready").readonly(),
92
+ 'operations': z.array(z.object({
93
+ 'id': z.string().readonly(),
94
+ 'attempt': z.number().readonly(),
95
+ 'toolName': z.string().readonly(),
96
+ 'knowledgeNetworkId': z.union([z.undefined(), z.string()]).readonly().optional(),
97
+ 'status': z.union([z.literal("resolved"), z.literal("ambiguous"), z.literal("unresolved"), z.literal("not_evaluable")]).readonly(),
98
+ 'elements': z.array(z.object({
99
+ 'kind': z.union([z.literal("object"), z.literal("relation"), z.literal("action"), z.literal("property"), z.literal("logic"), z.literal("metric")]).readonly(),
100
+ 'id': z.string().readonly(),
101
+ 'name': z.string().readonly(),
102
+ 'parentId': z.union([z.undefined(), z.string()]).readonly().optional(),
103
+ 'field': z.union([z.undefined(), z.string()]).readonly().optional(),
104
+ })).readonly(),
105
+ 'missingFacts': z.array(z.string()).readonly(),
106
+ })).readonly(),
107
+ 'conversationContext': z.array(z.object({
108
+ 'knowledgeNetworkId': z.string().readonly(),
109
+ 'sourceInteractionId': z.string().readonly(),
110
+ 'sourceOperationId': z.string().readonly(),
111
+ })).readonly(),
112
+ 'derivedFacts': z.array(z.object({
113
+ 'rule': z.string().readonly(),
114
+ 'sourceOperationId': z.string().readonly(),
115
+ 'operationId': z.string().readonly(),
116
+ 'elementId': z.string().readonly(),
117
+ })).readonly(),
118
+ 'contextRelations': z.array(z.object({
119
+ 'id': z.string().readonly(),
120
+ 'knowledgeNetworkId': z.string().readonly(),
121
+ 'name': z.string().readonly(),
122
+ 'sourceObjectId': z.string().readonly(),
123
+ 'targetObjectId': z.string().readonly(),
124
+ })).readonly(),
125
+ })]).readonly(),
126
+ 'evidence': z.object({
127
+ 'kind': z.literal("unavailable").readonly(),
128
+ }).readonly(),
129
+ })]))
130
+ let _openbkn_dsh_business_context_openbknBusinessContext_listNetworks_result$schema$value
131
+ const _openbkn_dsh_business_context_openbknBusinessContext_listNetworks_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_listNetworks_result$schema$value ??= z.array(z.object({
132
+ 'id': z.string().readonly(),
133
+ 'displayName': z.string().readonly(),
134
+ 'description': z.union([z.undefined(), z.string()]).readonly().optional(),
135
+ 'workspacePath': z.union([z.undefined(), z.string()]).readonly().optional(),
136
+ })))
137
+ let _openbkn_dsh_business_context_openbknBusinessContext_status_result$schema$value
138
+ const _openbkn_dsh_business_context_openbknBusinessContext_status_result$schema = () => (_openbkn_dsh_business_context_openbknBusinessContext_status_result$schema$value ??= z.union([z.object({
139
+ 'kind': z.literal("authenticated").readonly(),
140
+ 'baseUrl': z.string().readonly(),
141
+ 'userId': z.union([z.undefined(), z.string()]).readonly().optional(),
142
+ 'username': z.union([z.undefined(), z.string()]).readonly().optional(),
143
+ }), z.object({
144
+ 'kind': z.literal("authentication-required").readonly(),
145
+ 'baseUrl': z.string().readonly(),
146
+ }), z.object({
147
+ 'kind': z.literal("platform-mismatch").readonly(),
148
+ 'expectedBaseUrl': z.string().readonly(),
149
+ 'actualBaseUrl': z.string().readonly(),
150
+ })]))
151
+
152
+ export const TYPERT_REMOTE = {
153
+ package: '@openbkn/dsh-business-context',
154
+ descriptors: [
155
+ {
156
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/beginLogin',
157
+ service: 'openbknBusinessContext',
158
+ namespace: 'openbknBusinessContext',
159
+ method: 'beginLogin',
160
+ implementation: 'remoteBeginLogin',
161
+ invocation: { kind: 'direct' },
162
+ parameters: [
163
+ ],
164
+ cancellation: { parameter: 'signal' },
165
+ result: {
166
+ mode: 'strict',
167
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/beginLogin:result',
168
+ create: _openbkn_dsh_business_context_openbknBusinessContext_beginLogin_result$schema,
169
+ },
170
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":104,"column":9},
171
+ },
172
+ {
173
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/bindNetwork',
174
+ service: 'openbknBusinessContext',
175
+ namespace: 'openbknBusinessContext',
176
+ method: 'bindNetwork',
177
+ implementation: 'remoteBindNetwork',
178
+ invocation: { kind: 'direct' },
179
+ parameters: [
180
+ {
181
+ name: 'sessionId',
182
+ wire: 'sessionId',
183
+ source: 'json',
184
+ codec: {
185
+ mode: 'strict',
186
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/bindNetwork:sessionId',
187
+ create: _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_0$schema,
188
+ },
189
+ },
190
+ {
191
+ name: 'networkId',
192
+ wire: 'networkId',
193
+ source: 'json',
194
+ codec: {
195
+ mode: 'strict',
196
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/bindNetwork:networkId',
197
+ create: _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_parameter_1$schema,
198
+ },
199
+ },
200
+ ],
201
+ cancellation: { parameter: 'signal' },
202
+ result: {
203
+ mode: 'strict',
204
+ typeSymbol: '@openbkn/dsh-business-context/types#BusinessNetworkBinding',
205
+ create: _openbkn_dsh_business_context_openbknBusinessContext_bindNetwork_result$schema,
206
+ },
207
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":296,"column":9},
208
+ },
209
+ {
210
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/bindNetworkWorkspace',
211
+ service: 'openbknBusinessContext',
212
+ namespace: 'openbknBusinessContext',
213
+ method: 'bindNetworkWorkspace',
214
+ implementation: 'remoteBindNetworkWorkspace',
215
+ invocation: { kind: 'direct' },
216
+ parameters: [
217
+ {
218
+ name: 'networkId',
219
+ wire: 'networkId',
220
+ source: 'json',
221
+ codec: {
222
+ mode: 'strict',
223
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/bindNetworkWorkspace:networkId',
224
+ create: _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_0$schema,
225
+ },
226
+ },
227
+ {
228
+ name: 'workspacePath',
229
+ wire: 'workspacePath',
230
+ source: 'json',
231
+ codec: {
232
+ mode: 'strict',
233
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/bindNetworkWorkspace:workspacePath',
234
+ create: _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_parameter_1$schema,
235
+ },
236
+ },
237
+ ],
238
+ cancellation: { parameter: 'signal' },
239
+ result: {
240
+ mode: 'strict',
241
+ typeSymbol: '@openbkn/dsh-business-context/types#BusinessNetworkSummary',
242
+ create: _openbkn_dsh_business_context_openbknBusinessContext_bindNetworkWorkspace_result$schema,
243
+ },
244
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":274,"column":9},
245
+ },
246
+ {
247
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/configureToken',
248
+ service: 'openbknBusinessContext',
249
+ namespace: 'openbknBusinessContext',
250
+ method: 'configureToken',
251
+ implementation: 'remoteConfigureToken',
252
+ invocation: { kind: 'direct' },
253
+ parameters: [
254
+ {
255
+ name: 'token',
256
+ wire: 'token',
257
+ source: 'json',
258
+ codec: {
259
+ mode: 'strict',
260
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/configureToken:token',
261
+ create: _openbkn_dsh_business_context_openbknBusinessContext_configureToken_parameter_0$schema,
262
+ },
263
+ },
264
+ ],
265
+ cancellation: { parameter: 'signal' },
266
+ result: {
267
+ mode: 'strict',
268
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/configureToken:result',
269
+ create: _openbkn_dsh_business_context_openbknBusinessContext_configureToken_result$schema,
270
+ },
271
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":116,"column":9},
272
+ },
273
+ {
274
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/getNetworkBinding',
275
+ service: 'openbknBusinessContext',
276
+ namespace: 'openbknBusinessContext',
277
+ method: 'getNetworkBinding',
278
+ implementation: 'remoteGetNetworkBinding',
279
+ invocation: { kind: 'direct' },
280
+ parameters: [
281
+ {
282
+ name: 'sessionId',
283
+ wire: 'sessionId',
284
+ source: 'json',
285
+ codec: {
286
+ mode: 'strict',
287
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getNetworkBinding:sessionId',
288
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_parameter_0$schema,
289
+ },
290
+ },
291
+ ],
292
+ result: {
293
+ mode: 'strict',
294
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getNetworkBinding:result',
295
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getNetworkBinding_result$schema,
296
+ },
297
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":135,"column":3},
298
+ },
299
+ {
300
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/getSessionSuggestions',
301
+ service: 'openbknBusinessContext',
302
+ namespace: 'openbknBusinessContext',
303
+ method: 'getSessionSuggestions',
304
+ implementation: 'remoteGetSessionSuggestions',
305
+ invocation: { kind: 'direct' },
306
+ parameters: [
307
+ {
308
+ name: 'sessionId',
309
+ wire: 'sessionId',
310
+ source: 'json',
311
+ codec: {
312
+ mode: 'strict',
313
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getSessionSuggestions:sessionId',
314
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_parameter_0$schema,
315
+ },
316
+ },
317
+ ],
318
+ result: {
319
+ mode: 'strict',
320
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getSessionSuggestions:result',
321
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getSessionSuggestions_result$schema,
322
+ },
323
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":216,"column":3},
324
+ },
325
+ {
326
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenance',
327
+ service: 'openbknBusinessContext',
328
+ namespace: 'openbknBusinessContext',
329
+ method: 'getTurnProvenance',
330
+ implementation: 'remoteGetTurnProvenance',
331
+ invocation: { kind: 'direct' },
332
+ parameters: [
333
+ {
334
+ name: 'sessionId',
335
+ wire: 'sessionId',
336
+ source: 'json',
337
+ codec: {
338
+ mode: 'strict',
339
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenance:sessionId',
340
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_0$schema,
341
+ },
342
+ },
343
+ {
344
+ name: 'messageId',
345
+ wire: 'messageId',
346
+ source: 'json',
347
+ codec: {
348
+ mode: 'strict',
349
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenance:messageId',
350
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_parameter_1$schema,
351
+ },
352
+ },
353
+ ],
354
+ result: {
355
+ mode: 'strict',
356
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenance:result',
357
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenance_result$schema,
358
+ },
359
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":145,"column":3},
360
+ },
361
+ {
362
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenanceView',
363
+ service: 'openbknBusinessContext',
364
+ namespace: 'openbknBusinessContext',
365
+ method: 'getTurnProvenanceView',
366
+ implementation: 'remoteGetTurnProvenanceView',
367
+ invocation: { kind: 'direct' },
368
+ parameters: [
369
+ {
370
+ name: 'sessionId',
371
+ wire: 'sessionId',
372
+ source: 'json',
373
+ codec: {
374
+ mode: 'strict',
375
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenanceView:sessionId',
376
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_0$schema,
377
+ },
378
+ },
379
+ {
380
+ name: 'messageId',
381
+ wire: 'messageId',
382
+ source: 'json',
383
+ codec: {
384
+ mode: 'strict',
385
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenanceView:messageId',
386
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_parameter_1$schema,
387
+ },
388
+ },
389
+ ],
390
+ cancellation: { parameter: 'signal' },
391
+ result: {
392
+ mode: 'strict',
393
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/getTurnProvenanceView:result',
394
+ create: _openbkn_dsh_business_context_openbknBusinessContext_getTurnProvenanceView_result$schema,
395
+ },
396
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":159,"column":9},
397
+ },
398
+ {
399
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/listNetworks',
400
+ service: 'openbknBusinessContext',
401
+ namespace: 'openbknBusinessContext',
402
+ method: 'listNetworks',
403
+ implementation: 'remoteListNetworks',
404
+ invocation: { kind: 'direct' },
405
+ parameters: [
406
+ ],
407
+ cancellation: { parameter: 'signal' },
408
+ result: {
409
+ mode: 'strict',
410
+ typeSymbol: '@openbkn/dsh-business-context#openbknBusinessContext/listNetworks:result',
411
+ create: _openbkn_dsh_business_context_openbknBusinessContext_listNetworks_result$schema,
412
+ },
413
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":229,"column":9},
414
+ },
415
+ {
416
+ id: '@openbkn/dsh-business-context#openbknBusinessContext/status',
417
+ service: 'openbknBusinessContext',
418
+ namespace: 'openbknBusinessContext',
419
+ method: 'status',
420
+ implementation: 'remoteStatus',
421
+ invocation: { kind: 'direct' },
422
+ parameters: [
423
+ ],
424
+ cancellation: { parameter: 'signal' },
425
+ result: {
426
+ mode: 'strict',
427
+ typeSymbol: '@openbkn/dsh-business-context/types#AuthSnapshot',
428
+ create: _openbkn_dsh_business_context_openbknBusinessContext_status_result$schema,
429
+ },
430
+ sourceLocation: {"file":"packages/openbkn-business-context/src/business-context-service.ts","line":81,"column":9},
431
+ },
432
+ ],
433
+ }
434
+
435
+ export default TYPERT_REMOTE
@@ -0,0 +1,42 @@
1
+ /** A deliberately narrow process boundary around the installed OpenBKN CLI. */
2
+ export interface OpenBknCli {
3
+ run(args: readonly string[], signal?: AbortSignal): Promise<CliResult>;
4
+ }
5
+ /** Process result exposed only inside the Host authentication coordinator. */
6
+ export interface CliResult {
7
+ readonly code: number;
8
+ readonly stdout: string;
9
+ readonly stderr: string;
10
+ }
11
+ import type { AuthSnapshot } from './types.js';
12
+ export type { AuthSnapshot } from './types.js';
13
+ /** Thrown when the CLI cannot provide a trustworthy authentication status. */
14
+ export declare class OpenBknCliError extends Error {
15
+ constructor(message: string);
16
+ }
17
+ /**
18
+ * Owns authentication lifecycle decisions. OpenBKN CLI remains the credential
19
+ * store and refresh authority. Its token value is read only after an exact
20
+ * platform fence and is returned only to Host-side credential synchronization.
21
+ */
22
+ export declare class AuthCoordinator {
23
+ private readonly cli;
24
+ private readonly baseUrl;
25
+ constructor(cli: OpenBknCli, baseUrl: string);
26
+ /** Read the active CLI session and fence it to this plugin's configured platform. */
27
+ status(signal?: AbortSignal): Promise<AuthSnapshot>;
28
+ /**
29
+ * Ask the CLI to initiate its normal local-browser OAuth flow. The plugin
30
+ * deliberately does not use `--no-browser`: that variant requires a human
31
+ * to paste an OAuth callback into stdin, while DSH's managed subprocess has
32
+ * no terminal input surface. Its human-facing output is not persisted here.
33
+ */
34
+ beginLogin(): Promise<void>;
35
+ /**
36
+ * Read one refreshed token for the configured, authenticated platform.
37
+ * Callers must immediately write it to DSH credentials and must never expose
38
+ * this value through a Remote result, UI state, diagnostics, or logs.
39
+ */
40
+ readToken(signal?: AbortSignal): Promise<string>;
41
+ }
42
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1,126 @@
1
+ import { Context } from '@deepseek-ai/cordis';
2
+ import type { Agent } from '@deepseek-ai/dsh-agent';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
5
+ import { Config, type Config as PluginConfig } from './config.js';
6
+ import type { BindBusinessNetworkResult, BusinessNetworkBinding } from './session-binding.js';
7
+ import type { AuthSnapshot, BusinessNetworkSummary, ProvenanceHandle, ProvenanceView } from './types.js';
8
+ declare module '@deepseek-ai/cordis' {
9
+ interface Context {
10
+ /** Host-owned bridge used by the later OpenBKN client UI to select a business network. */
11
+ openbknBusinessContext: OpenBknBusinessContextService;
12
+ }
13
+ }
14
+ declare module '@deepseek-ai/dsh-typert-protocol' {
15
+ interface RemoteErrorDetailsMap {
16
+ 'openbkn/authentication-required': {
17
+ readonly baseUrl: string;
18
+ };
19
+ 'openbkn/connection-failed': {
20
+ readonly baseUrl: string;
21
+ readonly layer: 'context-loader-mcp' | 'platform-api';
22
+ };
23
+ 'openbkn/platform-unavailable': {
24
+ readonly baseUrl: string;
25
+ };
26
+ 'openbkn/provenance-license-required': {
27
+ readonly edition: string;
28
+ };
29
+ }
30
+ }
31
+ /**
32
+ * Owns the only selection transition: append the immutable DSH session event,
33
+ * then activate the model tool only inside that Agent scope. The browser UI
34
+ * will call this service through its host bridge in the next slice.
35
+ */
36
+ export declare class OpenBknBusinessContextService extends TypertRemoteService {
37
+ readonly config: PluginConfig;
38
+ static inject: string[];
39
+ static Config: import("@deepseek-ai/schemastery").default<Config>;
40
+ private readonly mounted;
41
+ private readonly capabilityProfiles;
42
+ private mcpManagerInstance;
43
+ constructor(ctx: Context, config: PluginConfig);
44
+ /**
45
+ * Return the CLI-authenticated state and synchronize its token into the
46
+ * DSH credential vault when needed. The token stays Host-only throughout.
47
+ * A pre-existing manually configured DSH credential remains a fallback for
48
+ * deployments without a usable CLI login.
49
+ */
50
+ remoteStatus(signal: AbortSignal): Promise<AuthSnapshot>;
51
+ /** Start the CLI's configured-platform browser login, then synchronize and verify it. */
52
+ remoteBeginLogin(signal: AbortSignal): Promise<readonly BusinessNetworkSummary[]>;
53
+ /**
54
+ * Save one user-entered token to DSH's credential provider, connect the
55
+ * standard MCP client by reference, then return only visible network DTOs.
56
+ */
57
+ remoteConfigureToken(token: string, signal: AbortSignal): Promise<readonly BusinessNetworkSummary[]>;
58
+ /** Read the immutable network identity already recorded on one live DSH session. */
59
+ remoteGetNetworkBinding(sessionId: SessionId): BusinessNetworkBinding | undefined;
60
+ /** Read only the provenance already committed for one finalized assistant message. */
61
+ remoteGetTurnProvenance(sessionId: SessionId, messageId: string): ProvenanceHandle | undefined;
62
+ /**
63
+ * Resolve the selected turn's provenance on demand through the fixed
64
+ * platform OSDK catalogue. The browser receives a bounded presentation DTO,
65
+ * never raw MCP output, OSDK routes, or credentials.
66
+ */
67
+ remoteGetTurnProvenanceView(sessionId: SessionId, messageId: string, signal: AbortSignal): Promise<ProvenanceView | undefined>;
68
+ /** Return the one optional, draft-only introduction for an empty bound session. */
69
+ remoteGetSessionSuggestions(sessionId: SessionId): readonly string[];
70
+ /** List only the business networks authorized by the managed OpenBKN token. */
71
+ remoteListNetworks(signal: AbortSignal): Promise<readonly BusinessNetworkSummary[]>;
72
+ /** A successful MCP initial handshake plus OSDK catalogue read is the connection test. */
73
+ private listNetworksAfterAuthentication;
74
+ /** Persist a selected local DSH workspace only after the network is authorized. */
75
+ remoteBindNetworkWorkspace(networkId: string, workspacePath: string, signal: AbortSignal): Promise<BusinessNetworkSummary>;
76
+ /**
77
+ * Bind this exact live Agent to one network already confirmed visible by the
78
+ * configured CLI identity. The Client provides only the opaque network id;
79
+ * display data and platform routing are re-derived on the Host.
80
+ */
81
+ remoteBindNetwork(sessionId: SessionId, networkId: string, signal: AbortSignal): Promise<BusinessNetworkBinding>;
82
+ /** Persist one network selection, reject conflicts, then scope the capability to this Agent. */
83
+ bind(agent: Agent, requested: BusinessNetworkBinding): BindBusinessNetworkResult;
84
+ private mountIfBound;
85
+ /**
86
+ * Project one user-approved workspace association into a newly live native
87
+ * DSH session. A missing or ambiguous association deliberately leaves the
88
+ * native session untouched.
89
+ */
90
+ private bindWorkspaceNetworkIfUnique;
91
+ /**
92
+ * Reconcile the CLI-owned credential before a bound business turn reaches
93
+ * its first model step. This is the only per-turn lifecycle point: later
94
+ * tool-planning steps retain the same connection and do not re-authenticate.
95
+ */
96
+ private refreshManagedMcpAtTurnStart;
97
+ /** Persist only an explicitly completed OpenBKN interaction when its turn ends. */
98
+ private captureTurnProvenance;
99
+ private ensureMcpConnection;
100
+ private refreshMcpConnection;
101
+ private mcpManager;
102
+ private authCoordinator;
103
+ /** Synchronize exactly one configured-platform CLI token into DSH credentials. */
104
+ private synchronizeCliCredential;
105
+ /** Historical private seam retained for unit fixtures; it now returns the Host HTTP reader, never a Python OSDK process. */
106
+ private platformReader;
107
+ /** Resolve only the DSH-managed token; legacy environment variables are not silently migrated. */
108
+ private resolveOpenBknToken;
109
+ }
110
+ /**
111
+ * A permission_denied gate is only a license statement when the deployment is
112
+ * verifiably unlicensed; an enterprise deployment that still denies the read
113
+ * has a domain-authorization problem instead, and must not be told to upgrade.
114
+ * Capabilities being unreachable leaves the cause undetermined: report the
115
+ * generic unavailable failure rather than guessing an upgrade path.
116
+ */
117
+ export declare function provenanceLicenseDecision(license: {
118
+ edition?: string;
119
+ licensed?: boolean;
120
+ } | undefined): {
121
+ readonly kind: 'license-required';
122
+ readonly edition: string;
123
+ } | {
124
+ readonly kind: 'unavailable';
125
+ };
126
+ //# sourceMappingURL=business-context-service.d.ts.map