@deepseek-ai/dsh-api-workspace-controller 0.1.2-alpha.2
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +56 -0
- package/README.zh.md +56 -0
- package/lib/client.js +415 -0
- package/lib/index.js +726 -0
- package/lib/invariant.js +13 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +552 -0
- package/lib/typert.remote-client.d.ts +44 -0
- package/lib/typert.remote-client.js +371 -0
- package/lib/types/client/index.d.ts +45 -0
- package/lib/types/client/index.js +70 -0
- package/lib/types/client/model.d.ts +140 -0
- package/lib/types/client/model.js +292 -0
- package/lib/types/client/service.d.ts +88 -0
- package/lib/types/client/service.js +63 -0
- package/lib/types/commands.d.ts +49 -0
- package/lib/types/commands.js +144 -0
- package/lib/types/directory-picker.d.ts +49 -0
- package/lib/types/directory-picker.js +179 -0
- package/lib/types/feed.d.ts +34 -0
- package/lib/types/feed.js +175 -0
- package/lib/types/index.d.ts +64 -0
- package/lib/types/index.js +145 -0
- package/lib/types/invariant.d.ts +9 -0
- package/lib/types/invariant.js +12 -0
- package/lib/types/types.d.ts +132 -0
- package/lib/types/types.js +8 -0
- package/package.json +99 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe request, result, and state-stream vocabulary for the Workspace
|
|
3
|
+
* and directory-picking Remote namespaces this package owns. The picking seam
|
|
4
|
+
* declares its own listing types, so they are re-exported here rather than
|
|
5
|
+
* restated: a browser consumer reads the very declaration the backend answers.
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
8
|
+
import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types';
|
|
9
|
+
export type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types';
|
|
10
|
+
export type { DirectoryEntry, DirectoryListing } from '@deepseek-ai/dsh-host-directory-picker/types';
|
|
11
|
+
/** One durable Workspace projected for browser consumers. */
|
|
12
|
+
export interface WorkspaceView {
|
|
13
|
+
readonly workspaceId: WorkspaceId;
|
|
14
|
+
/** Canonical host directory path. */
|
|
15
|
+
readonly path: string;
|
|
16
|
+
/** User-visible title. */
|
|
17
|
+
readonly title: string;
|
|
18
|
+
/** Sessions accounted to this Workspace in manual order. */
|
|
19
|
+
readonly sessionIds: readonly SessionId[];
|
|
20
|
+
/** ISO-8601 creation instant. */
|
|
21
|
+
readonly createdAt: string;
|
|
22
|
+
/** ISO-8601 last-mutation instant. */
|
|
23
|
+
readonly updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
26
|
+
interface RemoteErrorDetailsMap {
|
|
27
|
+
/** The requested directory cannot back a Workspace. */
|
|
28
|
+
'workspace/invalid-path': {
|
|
29
|
+
readonly path: string;
|
|
30
|
+
};
|
|
31
|
+
/** Another Workspace already uses the requested name. */
|
|
32
|
+
'workspace/name-conflict': {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
};
|
|
35
|
+
/** The Session or its anchor is not in the Workspace's manual order. */
|
|
36
|
+
'workspace/move-invalid': {
|
|
37
|
+
readonly workspaceId: WorkspaceId;
|
|
38
|
+
readonly sessionId: SessionId;
|
|
39
|
+
readonly beforeSessionId?: SessionId;
|
|
40
|
+
};
|
|
41
|
+
/** The verb needs an interaction the composed backend does not serve. */
|
|
42
|
+
'directory-picker/unavailable': {
|
|
43
|
+
readonly capability: string;
|
|
44
|
+
};
|
|
45
|
+
/** The target is not fully qualified, or the backend cannot list it. */
|
|
46
|
+
'directory-picker/unreadable': {
|
|
47
|
+
readonly path: string;
|
|
48
|
+
};
|
|
49
|
+
/** A child of that name is already there. */
|
|
50
|
+
'directory-picker/exists': {
|
|
51
|
+
readonly path: string;
|
|
52
|
+
};
|
|
53
|
+
/** The parent is not fully qualified, the name is not one segment, or creation failed. */
|
|
54
|
+
'directory-picker/create-failed': {
|
|
55
|
+
readonly path: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Existing directory requested for Workspace adoption. */
|
|
60
|
+
export interface WorkspaceCreateRequest {
|
|
61
|
+
readonly path: string;
|
|
62
|
+
}
|
|
63
|
+
/** Created or previously registered Workspace. */
|
|
64
|
+
export interface WorkspaceCreateValue {
|
|
65
|
+
readonly workspace: WorkspaceView;
|
|
66
|
+
readonly created: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** Workspace title mutation. */
|
|
69
|
+
export interface WorkspaceRenameRequest {
|
|
70
|
+
readonly workspaceId: WorkspaceId;
|
|
71
|
+
readonly title: string;
|
|
72
|
+
}
|
|
73
|
+
/** Workspace mutation returning the complete changed row. */
|
|
74
|
+
export interface WorkspaceValue {
|
|
75
|
+
readonly workspace: WorkspaceView;
|
|
76
|
+
}
|
|
77
|
+
/** Workspace registration deletion. */
|
|
78
|
+
export interface WorkspaceDeleteRequest {
|
|
79
|
+
readonly workspaceId: WorkspaceId;
|
|
80
|
+
}
|
|
81
|
+
/** Receipt after one Workspace registration is deleted. */
|
|
82
|
+
export interface WorkspaceDeleteValue {
|
|
83
|
+
readonly deleted: true;
|
|
84
|
+
}
|
|
85
|
+
/** DOM-insertBefore-like Workspace order mutation. */
|
|
86
|
+
export interface WorkspaceInsertBeforeRequest {
|
|
87
|
+
readonly workspaceId: WorkspaceId;
|
|
88
|
+
readonly beforeWorkspaceId?: WorkspaceId;
|
|
89
|
+
}
|
|
90
|
+
/** Complete Workspace registry order after a mutation. */
|
|
91
|
+
export interface WorkspaceOrderValue {
|
|
92
|
+
readonly workspaceIds: readonly WorkspaceId[];
|
|
93
|
+
}
|
|
94
|
+
/** DOM-insertBefore-like Session membership order mutation. */
|
|
95
|
+
export interface WorkspaceInsertSessionBeforeRequest {
|
|
96
|
+
readonly workspaceId: WorkspaceId;
|
|
97
|
+
readonly sessionId: SessionId;
|
|
98
|
+
readonly beforeSessionId?: SessionId;
|
|
99
|
+
}
|
|
100
|
+
/** Session requested for archival from Workspace grouping surfaces. */
|
|
101
|
+
export interface WorkspaceArchiveSessionRequest {
|
|
102
|
+
readonly sessionId: SessionId;
|
|
103
|
+
}
|
|
104
|
+
/** Complete archived Session set after a mutation. */
|
|
105
|
+
export interface WorkspaceArchiveValue {
|
|
106
|
+
readonly archivedSessionIds: readonly SessionId[];
|
|
107
|
+
}
|
|
108
|
+
/** Complete reconnect baseline for Workspace browser state. */
|
|
109
|
+
export interface WorkspaceBaseline {
|
|
110
|
+
readonly items: readonly WorkspaceView[];
|
|
111
|
+
readonly archivedSessionIds: readonly SessionId[];
|
|
112
|
+
}
|
|
113
|
+
/** One ordered Workspace change after a generation's baseline. */
|
|
114
|
+
export type WorkspaceFollowIncrement = {
|
|
115
|
+
readonly type: 'upsert';
|
|
116
|
+
readonly workspace: WorkspaceView;
|
|
117
|
+
} | {
|
|
118
|
+
readonly type: 'remove';
|
|
119
|
+
readonly workspaceId: WorkspaceId;
|
|
120
|
+
} | {
|
|
121
|
+
readonly type: 'order';
|
|
122
|
+
readonly workspaceIds: readonly WorkspaceId[];
|
|
123
|
+
} | {
|
|
124
|
+
readonly type: 'archived';
|
|
125
|
+
readonly archivedSessionIds: readonly SessionId[];
|
|
126
|
+
};
|
|
127
|
+
/** Workspace state stream; every generation starts with exactly one baseline. */
|
|
128
|
+
export type WorkspaceFollowFrame = {
|
|
129
|
+
readonly type: 'baseline';
|
|
130
|
+
readonly value: WorkspaceBaseline;
|
|
131
|
+
} | WorkspaceFollowIncrement;
|
|
132
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe request, result, and state-stream vocabulary for the Workspace
|
|
3
|
+
* and directory-picking Remote namespaces this package owns. The picking seam
|
|
4
|
+
* declares its own listing types, so they are re-exported here rather than
|
|
5
|
+
* restated: a browser consumer reads the very declaration the backend answers.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-api-workspace-controller",
|
|
3
|
+
"description": "Workspace Remote commands and reconnect-safe state transport",
|
|
4
|
+
"version": "0.1.2-alpha.2",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/api/workspace-controller"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./types": {
|
|
26
|
+
"types": "./lib/types/types.d.ts",
|
|
27
|
+
"default": "./lib/types/types.js"
|
|
28
|
+
},
|
|
29
|
+
"./client": {
|
|
30
|
+
"types": "./lib/types/client/index.d.ts",
|
|
31
|
+
"default": "./lib/client.js"
|
|
32
|
+
},
|
|
33
|
+
"./typert": {
|
|
34
|
+
"types": "./lib/typert.host.d.ts",
|
|
35
|
+
"default": "./lib/typert.host.js"
|
|
36
|
+
},
|
|
37
|
+
"./remote": {
|
|
38
|
+
"types": "./lib/typert.remote-client.d.ts",
|
|
39
|
+
"default": "./lib/typert.remote-client.js"
|
|
40
|
+
},
|
|
41
|
+
"./src/*": "./src/*",
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"dsh": {
|
|
45
|
+
"client": {
|
|
46
|
+
"external": [
|
|
47
|
+
"@deepseek-ai/dsh-api-gateway/client"
|
|
48
|
+
],
|
|
49
|
+
"inject": [
|
|
50
|
+
"@deepseek-ai/dsh-api-gateway",
|
|
51
|
+
"@deepseek-ai/dsh-client-connection"
|
|
52
|
+
],
|
|
53
|
+
"platform": "web"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"lib/index.js",
|
|
58
|
+
"lib/invariant.js",
|
|
59
|
+
"lib/client.js",
|
|
60
|
+
"lib/types/**/*.js",
|
|
61
|
+
"lib/types/**/*.d.ts",
|
|
62
|
+
"lib/typert.host.js",
|
|
63
|
+
"lib/typert.host.d.ts",
|
|
64
|
+
"lib/typert.remote-client.js",
|
|
65
|
+
"lib/typert.remote-client.d.ts"
|
|
66
|
+
],
|
|
67
|
+
"license": "MIT",
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"zod": "^4.4.3",
|
|
70
|
+
"@deepseek-ai/dsh-deque": "^0.1.2-alpha.2"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
74
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.2-alpha.2",
|
|
75
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-alpha.2",
|
|
76
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
77
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
78
|
+
"@deepseek-ai/dsh-host-directory-picker": "^0.1.2-alpha.2",
|
|
79
|
+
"@deepseek-ai/dsh-storage-domain": "^0.1.2-alpha.2",
|
|
80
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.2-alpha.2",
|
|
81
|
+
"@deepseek-ai/dsh-workspace": "^0.1.2-alpha.2"
|
|
82
|
+
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
85
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-alpha.2",
|
|
86
|
+
"@deepseek-ai/dsh-client-store": "^0.1.2-alpha.2",
|
|
87
|
+
"@deepseek-ai/dsh-host-directory-picker": "^0.1.2-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.2-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
90
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
91
|
+
"@deepseek-ai/dsh-storage-domain": "^0.1.2-alpha.2",
|
|
92
|
+
"@deepseek-ai/dsh-workspace": "^0.1.2-alpha.2",
|
|
93
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.2-alpha.2"
|
|
94
|
+
},
|
|
95
|
+
"scripts": {
|
|
96
|
+
"bundle": "tsdown",
|
|
97
|
+
"watch": "tsdown --watch"
|
|
98
|
+
}
|
|
99
|
+
}
|