@deepseek-ai/dsh-api-remotes 0.2.1-alpha.1 → 0.2.1-alpha.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.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/lib/client.js +19392 -9763
- package/lib/index.js +26 -12
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/index.js +4 -2
- package/lib/types/remote-events.d.ts +20 -0
- package/lib/types/remote-events.js +9 -5
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +46 -43
package/lib/index.js
CHANGED
|
@@ -13,6 +13,10 @@ import { isJsonValue } from "@deepseek-ai/dsh-util-values";
|
|
|
13
13
|
/**
|
|
14
14
|
* Host events this application forwards without renaming. The explicit mode is
|
|
15
15
|
* both the Host dispatch strategy and the legal key set of `ctx.remote.$on`.
|
|
16
|
+
* An `emit` entry declares readers of the resources its payload carries, or
|
|
17
|
+
* none to touch the built-in `global` resource; it reaches a non-owner Peer
|
|
18
|
+
* only when access control allows it. Each notification names one resource
|
|
19
|
+
* identity or none, and collection changes travel on follow streams instead.
|
|
16
20
|
*/
|
|
17
21
|
const API_REMOTE_FORWARDED_EVENTS = [
|
|
18
22
|
{
|
|
@@ -25,23 +29,28 @@ const API_REMOTE_FORWARDED_EVENTS = [
|
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
event: "api-session/activity",
|
|
28
|
-
mode: "emit"
|
|
32
|
+
mode: "emit",
|
|
33
|
+
resources: { session: (sessionId) => sessionId }
|
|
29
34
|
},
|
|
30
35
|
{
|
|
31
36
|
event: "api-session/added",
|
|
32
|
-
mode: "emit"
|
|
37
|
+
mode: "emit",
|
|
38
|
+
resources: { session: (summary) => summary.sessionId }
|
|
33
39
|
},
|
|
34
40
|
{
|
|
35
41
|
event: "api-session/error",
|
|
36
|
-
mode: "emit"
|
|
42
|
+
mode: "emit",
|
|
43
|
+
resources: { session: (sessionId) => sessionId }
|
|
37
44
|
},
|
|
38
45
|
{
|
|
39
46
|
event: "api-session/removed",
|
|
40
|
-
mode: "emit"
|
|
47
|
+
mode: "emit",
|
|
48
|
+
resources: { session: (sessionId) => sessionId }
|
|
41
49
|
},
|
|
42
50
|
{
|
|
43
51
|
event: "api-session/status",
|
|
44
|
-
mode: "emit"
|
|
52
|
+
mode: "emit",
|
|
53
|
+
resources: { session: (sessionId) => sessionId }
|
|
45
54
|
},
|
|
46
55
|
{
|
|
47
56
|
event: "commands/change",
|
|
@@ -137,13 +146,18 @@ function apply(ctx) {
|
|
|
137
146
|
function remoteEventSource(ctx) {
|
|
138
147
|
return (signal) => {
|
|
139
148
|
const queue = new RemoteEventQueue();
|
|
140
|
-
const disposers = API_REMOTE_FORWARDED_EVENTS.map((
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
const disposers = API_REMOTE_FORWARDED_EVENTS.map((entry) => {
|
|
150
|
+
const { event, mode } = entry;
|
|
151
|
+
if (mode === "emit") {
|
|
152
|
+
const resources = "resources" in entry ? entry.resources : void 0;
|
|
153
|
+
return ctx.on(event, ((...args) => {
|
|
154
|
+
queue.push({
|
|
155
|
+
event,
|
|
156
|
+
args: assertJsonArgs(event, args),
|
|
157
|
+
...resources === void 0 ? {} : { resources }
|
|
158
|
+
});
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
147
161
|
return ctx.on(event, (function(request, next) {
|
|
148
162
|
const carrierAgent = carrierKeyOf(this);
|
|
149
163
|
if (carrierAgent === void 0) return next();
|
|
@@ -3,7 +3,7 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
3
3
|
export type {} from '@deepseek-ai/dsh-client-product-analytics/remote';
|
|
4
4
|
import type { ClientRemote } from '@deepseek-ai/dsh-api-gateway/client';
|
|
5
5
|
export type { ClientRemote } from '@deepseek-ai/dsh-api-gateway/client';
|
|
6
|
-
export type { BundleInfo, BundleRowInfo, ChangeResult, IncompatiblePlugin, InspectOptions, InstallBundleOptions, InstallSpecKind, ManagementError, PackageResult, PluginChange, PluginEntryId, PluginInfo, PluginInspectProblem, PluginInstallCancellation, PluginInstallFailureKind, PluginInstallLogChunk, PluginInstallProgress, PluginInstallRequestId, PluginRegistries, PluginSpecInspection, ReadOnlyReason, Registry, } from '@deepseek-ai/dsh-plugin-manager/types';
|
|
6
|
+
export type { BundleInfo, BundleRowInfo, ChangeResult, IncompatiblePlugin, InspectOptions, InstallBundleOptions, InstallSpecKind, ManagementError, PackageResult, PluginChange, PluginEntryId, PluginInfo, PluginInspectProblem, PluginInstallCancellation, PluginInstallFailureKind, PluginInstallLogChunk, PluginInstallProgress, PluginInstallRequestId, PluginRegistries, PluginSpecInspection, ReadOnlyReason, Registry, RestartReason, } from '@deepseek-ai/dsh-plugin-manager/types';
|
|
7
7
|
export type {} from '@deepseek-ai/dsh-plugin-manager/remote';
|
|
8
8
|
export type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/remote';
|
|
9
9
|
export type { PluginInventorySnapshot } from '@deepseek-ai/dsh-host-plugin-inventory/types';
|
|
@@ -56,7 +56,7 @@ export type {} from '@deepseek-ai/dsh-cordis-host-runner/remote';
|
|
|
56
56
|
export type { ApprovalRequestId, CordisHalfState, CordisDynamicPackageId, CordisDynamicPluginId, CordisDynamicPluginRunId, CordisDynamicRunMode, CordisInspectMethodManifest, CordisInspectPlatform, CordisInspectProviderManifest, CordisInspectProviderView, CordisInspectQueryRequest, CordisInspectQueryResolution, CordisInspectQueryResolved, CordisInspectRequestId, CordisInspectResolveAck, CordisRunDiagnostic, CordisRunStatus, DynamicCordisClientSource, DynamicCordisHostHalfResult, DynamicCordisInventoryRow, DynamicCordisInvokeResult, DynamicCordisPackage, DynamicCordisRequestResolved, DynamicCordisResolveAck, DynamicCordisRetracted, DynamicCordisRunRequest, DynamicCordisRunResolution, DynamicCordisRunAttempt, DynamicCordisRunResponse, DynamicCordisStopResponse, DynamicCordisUndefineReceipt, RequestRunOutcome, } from '@deepseek-ai/dsh-cordis-host-runner/types';
|
|
57
57
|
export type { CredentialInfo } from '@deepseek-ai/dsh-credentials/types';
|
|
58
58
|
export type { SettingsDescribeValue, SettingsNamespaceView, SettingsPathOpView, SettingsSecretView, } from '@deepseek-ai/dsh-settings/types';
|
|
59
|
-
export type { LlmConfigurableProvider, LlmDiscoveredModel, LlmModelDiscoveryRequest, LlmProviderInfo, } from '@deepseek-ai/dsh-llm/types';
|
|
59
|
+
export type { LlmConfigurableProvider, LlmDiscoveredModel, LlmModelDiscoveryRequest, LlmNativeAuth, LlmProviderInfo, } from '@deepseek-ai/dsh-llm/types';
|
|
60
60
|
export type { FileReferenceCandidate } from '@deepseek-ai/dsh-file-reference/types';
|
|
61
61
|
export type { SessionReferenceMentionCandidate } from '@deepseek-ai/dsh-session-reference/types';
|
|
62
62
|
export type { RemoteErrorCode, RemoteErrorDetailsMap, RemoteFailure, RemoteResult, } from '@deepseek-ai/dsh-typert-protocol';
|
package/lib/types/index.js
CHANGED
|
@@ -15,10 +15,12 @@ export function apply(ctx) {
|
|
|
15
15
|
function remoteEventSource(ctx) {
|
|
16
16
|
return (signal) => {
|
|
17
17
|
const queue = new RemoteEventQueue();
|
|
18
|
-
const disposers = API_REMOTE_FORWARDED_EVENTS.map((
|
|
18
|
+
const disposers = API_REMOTE_FORWARDED_EVENTS.map((entry) => {
|
|
19
|
+
const { event, mode } = entry;
|
|
19
20
|
if (mode === 'emit') {
|
|
21
|
+
const resources = 'resources' in entry ? entry.resources : undefined;
|
|
20
22
|
return ctx.on(event, ((...args) => {
|
|
21
|
-
queue.push({ event, args: assertJsonArgs(event, args) });
|
|
23
|
+
queue.push({ event, args: assertJsonArgs(event, args), ...resources === undefined ? {} : { resources } });
|
|
22
24
|
}));
|
|
23
25
|
}
|
|
24
26
|
return ctx.on(event, (function (request, next) {
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
* could drift; `./types.ts` derives the type projection from it and stays
|
|
6
6
|
* type-only.
|
|
7
7
|
*/
|
|
8
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
8
9
|
/**
|
|
9
10
|
* Host events this application forwards without renaming. The explicit mode is
|
|
10
11
|
* both the Host dispatch strategy and the legal key set of `ctx.remote.$on`.
|
|
12
|
+
* An `emit` entry declares readers of the resources its payload carries, or
|
|
13
|
+
* none to touch the built-in `global` resource; it reaches a non-owner Peer
|
|
14
|
+
* only when access control allows it. Each notification names one resource
|
|
15
|
+
* identity or none, and collection changes travel on follow streams instead.
|
|
11
16
|
*/
|
|
12
17
|
export declare const API_REMOTE_FORWARDED_EVENTS: readonly [{
|
|
13
18
|
readonly event: "agent-preset/selected";
|
|
@@ -18,18 +23,33 @@ export declare const API_REMOTE_FORWARDED_EVENTS: readonly [{
|
|
|
18
23
|
}, {
|
|
19
24
|
readonly event: "api-session/activity";
|
|
20
25
|
readonly mode: "emit";
|
|
26
|
+
readonly resources: {
|
|
27
|
+
readonly session: (sessionId: SessionId) => SessionId;
|
|
28
|
+
};
|
|
21
29
|
}, {
|
|
22
30
|
readonly event: "api-session/added";
|
|
23
31
|
readonly mode: "emit";
|
|
32
|
+
readonly resources: {
|
|
33
|
+
readonly session: (summary: import("@deepseek-ai/dsh-api-session-controller/types").SessionSummary) => SessionId;
|
|
34
|
+
};
|
|
24
35
|
}, {
|
|
25
36
|
readonly event: "api-session/error";
|
|
26
37
|
readonly mode: "emit";
|
|
38
|
+
readonly resources: {
|
|
39
|
+
readonly session: (sessionId: SessionId) => SessionId;
|
|
40
|
+
};
|
|
27
41
|
}, {
|
|
28
42
|
readonly event: "api-session/removed";
|
|
29
43
|
readonly mode: "emit";
|
|
44
|
+
readonly resources: {
|
|
45
|
+
readonly session: (sessionId: SessionId) => SessionId;
|
|
46
|
+
};
|
|
30
47
|
}, {
|
|
31
48
|
readonly event: "api-session/status";
|
|
32
49
|
readonly mode: "emit";
|
|
50
|
+
readonly resources: {
|
|
51
|
+
readonly session: (sessionId: SessionId) => SessionId;
|
|
52
|
+
};
|
|
33
53
|
}, {
|
|
34
54
|
readonly event: "commands/change";
|
|
35
55
|
readonly mode: "emit";
|
|
@@ -8,15 +8,19 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Host events this application forwards without renaming. The explicit mode is
|
|
10
10
|
* both the Host dispatch strategy and the legal key set of `ctx.remote.$on`.
|
|
11
|
+
* An `emit` entry declares readers of the resources its payload carries, or
|
|
12
|
+
* none to touch the built-in `global` resource; it reaches a non-owner Peer
|
|
13
|
+
* only when access control allows it. Each notification names one resource
|
|
14
|
+
* identity or none, and collection changes travel on follow streams instead.
|
|
11
15
|
*/
|
|
12
16
|
export const API_REMOTE_FORWARDED_EVENTS = [
|
|
13
17
|
{ event: 'agent-preset/selected', mode: 'emit' },
|
|
14
18
|
{ event: 'approval/request', mode: 'waterfall' },
|
|
15
|
-
{ event: 'api-session/activity', mode: 'emit' },
|
|
16
|
-
{ event: 'api-session/added', mode: 'emit' },
|
|
17
|
-
{ event: 'api-session/error', mode: 'emit' },
|
|
18
|
-
{ event: 'api-session/removed', mode: 'emit' },
|
|
19
|
-
{ event: 'api-session/status', mode: 'emit' },
|
|
19
|
+
{ event: 'api-session/activity', mode: 'emit', resources: { session: (sessionId) => sessionId } },
|
|
20
|
+
{ event: 'api-session/added', mode: 'emit', resources: { session: (summary) => summary.sessionId } },
|
|
21
|
+
{ event: 'api-session/error', mode: 'emit', resources: { session: (sessionId) => sessionId } },
|
|
22
|
+
{ event: 'api-session/removed', mode: 'emit', resources: { session: (sessionId) => sessionId } },
|
|
23
|
+
{ event: 'api-session/status', mode: 'emit', resources: { session: (sessionId) => sessionId } },
|
|
20
24
|
{ event: 'commands/change', mode: 'emit' },
|
|
21
25
|
{ event: 'deepseek-account/session-expired', mode: 'emit' },
|
|
22
26
|
{ event: 'deepseek-account/model-sign-in-required', mode: 'emit' },
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-api-remotes",
|
|
3
3
|
"description": "Remote BFF assembly for application-selected Host capabilities",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"default": "./lib/types/types.js"
|
|
28
28
|
},
|
|
29
29
|
"./src/*": "./src/*",
|
|
30
|
-
"./package.json": "./package.json"
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
"./locale/*.json": "./locale/*.json"
|
|
31
32
|
},
|
|
32
33
|
"dsh": {
|
|
33
34
|
"client": {
|
|
@@ -40,57 +41,59 @@
|
|
|
40
41
|
},
|
|
41
42
|
"license": "MIT",
|
|
42
43
|
"files": [
|
|
44
|
+
"locale/*.json",
|
|
43
45
|
"lib/index.js",
|
|
44
46
|
"lib/client.js",
|
|
45
47
|
"lib/types/**/*.js",
|
|
46
48
|
"lib/types/**/*.d.ts"
|
|
47
49
|
],
|
|
48
50
|
"dependencies": {
|
|
49
|
-
"@deepseek-ai/dsh-deque": "0.2.1-alpha.
|
|
50
|
-
"@deepseek-ai/dsh-util-values": "0.2.1-alpha.
|
|
51
|
+
"@deepseek-ai/dsh-deque": "0.2.1-alpha.3",
|
|
52
|
+
"@deepseek-ai/dsh-util-values": "0.2.1-alpha.3"
|
|
51
53
|
},
|
|
52
54
|
"peerDependencies": {
|
|
53
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
54
|
-
"@deepseek-ai/dsh-scope": "0.2.1-alpha.
|
|
55
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-scope": "0.2.1-alpha.3"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
57
|
-
"
|
|
58
|
-
"@deepseek-ai/dsh-agent": "0.2.1-alpha.
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-api-job-controller": "0.2.1-alpha.
|
|
61
|
-
"@deepseek-ai/dsh-api-
|
|
62
|
-
"@deepseek-ai/dsh-api-
|
|
63
|
-
"@deepseek-ai/dsh-api-
|
|
64
|
-
"@deepseek-ai/dsh-api-workspace-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-client-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-file-reference": "0.2.1-alpha.
|
|
71
|
-
"@deepseek-ai/dsh-goal": "0.2.1-alpha.
|
|
72
|
-
"@deepseek-ai/dsh-host-plugin-inventory": "0.2.1-alpha.
|
|
73
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
74
|
-
"@deepseek-ai/dsh-message-feedback": "0.2.1-alpha.
|
|
75
|
-
"@deepseek-ai/dsh-permission-presets": "0.2.1-alpha.
|
|
76
|
-
"@deepseek-ai/dsh-schedule": "0.2.1-alpha.
|
|
77
|
-
"@deepseek-ai/dsh-scope": "0.2.1-alpha.
|
|
78
|
-
"@deepseek-ai/dsh-session
|
|
79
|
-
"@deepseek-ai/dsh-
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
83
|
-
"@deepseek-ai/dsh-user-approval": "0.2.1-alpha.
|
|
84
|
-
"@deepseek-ai/dsh-user-questions": "0.2.1-alpha.
|
|
85
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
86
|
-
"
|
|
87
|
-
"@deepseek-ai/dsh-
|
|
88
|
-
"@deepseek-ai/dsh-
|
|
89
|
-
"@deepseek-ai/dsh-
|
|
90
|
-
"@deepseek-ai/dsh-
|
|
91
|
-
"@deepseek-ai/dsh-
|
|
92
|
-
"@deepseek-ai/dsh-
|
|
93
|
-
"@deepseek-ai/dsh-
|
|
59
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
|
|
60
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.1-alpha.3",
|
|
61
|
+
"@deepseek-ai/dsh-api-gateway": "0.2.1-alpha.3",
|
|
62
|
+
"@deepseek-ai/dsh-api-job-controller": "0.2.1-alpha.3",
|
|
63
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.1-alpha.3",
|
|
64
|
+
"@deepseek-ai/dsh-api-settings-controller": "0.2.1-alpha.3",
|
|
65
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.2.1-alpha.3",
|
|
66
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.1-alpha.3",
|
|
67
|
+
"@deepseek-ai/dsh-client-connection": "0.2.1-alpha.3",
|
|
68
|
+
"@deepseek-ai/dsh-client-file-upload": "0.2.1-alpha.3",
|
|
69
|
+
"@deepseek-ai/dsh-commands": "0.2.1-alpha.3",
|
|
70
|
+
"@deepseek-ai/dsh-cordis-host-runner": "0.2.1-alpha.3",
|
|
71
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-alpha.3",
|
|
72
|
+
"@deepseek-ai/dsh-file-reference": "0.2.1-alpha.3",
|
|
73
|
+
"@deepseek-ai/dsh-goal": "0.2.1-alpha.3",
|
|
74
|
+
"@deepseek-ai/dsh-host-plugin-inventory": "0.2.1-alpha.3",
|
|
75
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
|
|
76
|
+
"@deepseek-ai/dsh-message-feedback": "0.2.1-alpha.3",
|
|
77
|
+
"@deepseek-ai/dsh-permission-presets": "0.2.1-alpha.3",
|
|
78
|
+
"@deepseek-ai/dsh-schedule": "0.2.1-alpha.3",
|
|
79
|
+
"@deepseek-ai/dsh-scope": "0.2.1-alpha.3",
|
|
80
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.3",
|
|
81
|
+
"@deepseek-ai/dsh-session-reference": "0.2.1-alpha.3",
|
|
82
|
+
"@deepseek-ai/dsh-settings": "0.2.1-alpha.3",
|
|
83
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
|
|
84
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.3",
|
|
85
|
+
"@deepseek-ai/dsh-user-approval": "0.2.1-alpha.3",
|
|
86
|
+
"@deepseek-ai/dsh-user-questions": "0.2.1-alpha.3",
|
|
87
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
88
|
+
"zod": "4.4.3",
|
|
89
|
+
"@deepseek-ai/dsh-command-feedback": "0.2.1-alpha.3",
|
|
90
|
+
"@deepseek-ai/dsh-api-terminal-controller": "0.2.1-alpha.3",
|
|
91
|
+
"@deepseek-ai/dsh-plugin-manager": "0.2.1-alpha.3",
|
|
92
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-alpha.3",
|
|
93
|
+
"@deepseek-ai/dsh-office-to-pdf": "0.2.1-alpha.3",
|
|
94
|
+
"@deepseek-ai/dsh-api-account-controller": "0.2.1-alpha.3",
|
|
95
|
+
"@deepseek-ai/dsh-deepseek-account": "0.2.1-alpha.3",
|
|
96
|
+
"@deepseek-ai/dsh-client-product-analytics": "0.2.1-alpha.3"
|
|
94
97
|
},
|
|
95
98
|
"scripts": {
|
|
96
99
|
"bundle": "tsdown",
|