@deepseek-ai/dsh-client-test-runtime 0.0.1-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.
- package/LICENSE +28 -0
- package/README.i18n.yaml +6 -0
- package/README.md +24 -0
- package/README.zh.md +24 -0
- package/lib/index.js +1259 -0
- package/lib/invariant.js +25 -0
- package/lib/types/fixtures.d.ts +46 -0
- package/lib/types/index.d.ts +194 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/locale-env.d.ts +9 -0
- package/lib/types/sessions.d.ts +263 -0
- package/lib/types/settings-scope.d.ts +25 -0
- package/lib/types/snapshot.d.ts +14 -0
- package/lib/types/translate.d.ts +16 -0
- package/lib/types/workspaces.d.ts +109 -0
- package/package.json +61 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { DirectoryListing, IWorkspaces, SessionId, SnapshotStore, WorkspaceId, WorkspaceListState, WorkspaceView } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { Stabilizer } from './fixtures.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Workspaces test double. Implements the same IWorkspaces face features
|
|
5
|
+
* receive as `ctx.workspaces`, so a production face change breaks this
|
|
6
|
+
* double at compile time. Every action records into {@link
|
|
7
|
+
* TestWorkspaces.calls}; defaults are inert echoes — feature tests needing
|
|
8
|
+
* richer behavior replace them via {@link TestWorkspaces.stub}.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TestWorkspaces implements IWorkspaces {
|
|
11
|
+
private readonly stabilize;
|
|
12
|
+
/** The useWorkspaces standard feed. */
|
|
13
|
+
readonly list: SnapshotStore<WorkspaceListState>;
|
|
14
|
+
/** Calls observed on the action face, newest last. */
|
|
15
|
+
readonly calls: {
|
|
16
|
+
method: string;
|
|
17
|
+
args: unknown[];
|
|
18
|
+
}[];
|
|
19
|
+
/** Replaceable action seat: feature tests may stub richer behavior. */
|
|
20
|
+
private readonly stubs;
|
|
21
|
+
/**
|
|
22
|
+
* @param stabilize - the owning runtime's act wrapper.
|
|
23
|
+
*/
|
|
24
|
+
constructor(stabilize: Stabilizer);
|
|
25
|
+
/**
|
|
26
|
+
* Update the workspace list state through an immer draft.
|
|
27
|
+
* @param mutate - draft mutator.
|
|
28
|
+
*/
|
|
29
|
+
update(mutate: (draft: WorkspaceListState) => void): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Replace an action's behavior (the recorded call is still appended first).
|
|
32
|
+
* @param method - action name (e.g. 'connectWorkspace').
|
|
33
|
+
* @param impl - replacement behavior.
|
|
34
|
+
*/
|
|
35
|
+
stub(method: string, impl: (...args: unknown[]) => unknown): void;
|
|
36
|
+
/**
|
|
37
|
+
* Connect a workspace to its reusable/new blank session (recorded). The
|
|
38
|
+
* default resolves the workspace id back as the session id; stub for
|
|
39
|
+
* cross-session flows.
|
|
40
|
+
* @param workspaceId - target workspace.
|
|
41
|
+
* @returns the connected session id.
|
|
42
|
+
*/
|
|
43
|
+
connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
|
|
44
|
+
/**
|
|
45
|
+
* New-session flow (recorded; stubbed behavior runs when installed).
|
|
46
|
+
* @param workspaceId - optional explicit workspace target.
|
|
47
|
+
*/
|
|
48
|
+
startSession(workspaceId?: WorkspaceId): void;
|
|
49
|
+
/**
|
|
50
|
+
* Create a Workspace (recorded). The default echoes a view derived from
|
|
51
|
+
* the input; stub for failure or list-coupled flows.
|
|
52
|
+
* @param input - the Host create payload.
|
|
53
|
+
* @returns the created Workspace view.
|
|
54
|
+
*/
|
|
55
|
+
create(input: {
|
|
56
|
+
path: string;
|
|
57
|
+
}): Promise<WorkspaceView>;
|
|
58
|
+
/**
|
|
59
|
+
* Open a path with the host OS default application (recorded; default no-op).
|
|
60
|
+
* @param path - host-resolvable path.
|
|
61
|
+
*/
|
|
62
|
+
openPath(path: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Directory picker (recorded). The default cancels (null); stub to select.
|
|
65
|
+
* @returns the picked path, or null.
|
|
66
|
+
*/
|
|
67
|
+
pickDirectory(): Promise<string | null>;
|
|
68
|
+
/**
|
|
69
|
+
* Browse listing (recorded). The default serves an empty home level; stub
|
|
70
|
+
* to shape a tree.
|
|
71
|
+
* @param path - absolute directory to list; absent lists the home level.
|
|
72
|
+
* @returns the level's listing.
|
|
73
|
+
*/
|
|
74
|
+
listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>;
|
|
75
|
+
/**
|
|
76
|
+
* Browse child creation (recorded). The default joins parent and name.
|
|
77
|
+
* @param path - absolute existing parent directory.
|
|
78
|
+
* @param name - single path segment.
|
|
79
|
+
* @returns the created directory's absolute path.
|
|
80
|
+
*/
|
|
81
|
+
createDirectory(path: string, name: string): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Rename a Workspace (recorded). The default echoes a minimal view.
|
|
84
|
+
* @param workspaceId - target workspace.
|
|
85
|
+
* @param title - new title.
|
|
86
|
+
* @returns the updated view.
|
|
87
|
+
*/
|
|
88
|
+
rename(workspaceId: WorkspaceId, title: string): Promise<WorkspaceView>;
|
|
89
|
+
/**
|
|
90
|
+
* Delete a Workspace (recorded; default no-op).
|
|
91
|
+
* @param workspaceId - target workspace.
|
|
92
|
+
*/
|
|
93
|
+
delete(workspaceId: WorkspaceId): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Move an accounted session (recorded). The default echoes a minimal view.
|
|
96
|
+
* @param workspaceId - target workspace.
|
|
97
|
+
* @param sessionId - session to move.
|
|
98
|
+
* @param beforeSessionId - anchor; omitted appends.
|
|
99
|
+
* @returns the updated view.
|
|
100
|
+
*/
|
|
101
|
+
insertSessionBefore(workspaceId: WorkspaceId, sessionId: SessionId, beforeSessionId?: SessionId): Promise<WorkspaceView>;
|
|
102
|
+
/**
|
|
103
|
+
* Archive a session (recorded). The default mirrors the production face's
|
|
104
|
+
* observable effect: the id joins the list state's archive set.
|
|
105
|
+
* @param sessionId - session to archive.
|
|
106
|
+
*/
|
|
107
|
+
archiveSession(sessionId: SessionId): Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-client-test-runtime",
|
|
3
|
+
"description": "jsdom slot test runtime: real Cordis Context + SlotsService + web-react renderer with test-owned session/workspace doubles for feature specs",
|
|
4
|
+
"version": "0.0.1-rc.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "restricted"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/client/test-runtime"
|
|
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
|
+
"./src/*": "./src/*",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"license": "BSD-3-Clause",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@testing-library/dom": "^10.4.1",
|
|
31
|
+
"@testing-library/react": "^16.3.2",
|
|
32
|
+
"vitest": "^4.1.8"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.2.0",
|
|
36
|
+
"react-dom": "^18.2.0",
|
|
37
|
+
"@deepseek-ai/dsh-client-runtime": "^0.0.1-rc.1",
|
|
38
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.0.1-rc.1",
|
|
39
|
+
"@deepseek-ai/dsh-client-web-react": "^0.0.1-rc.1",
|
|
40
|
+
"@deepseek-ai/dsh-host-apiproxy": "^0.0.1-rc.1",
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/react": "~18.3.1",
|
|
46
|
+
"@types/react-dom": "~18.3.0",
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"react-dom": "^18.2.0",
|
|
49
|
+
"@deepseek-ai/dsh-client-runtime": "^0.0.1-rc.1",
|
|
50
|
+
"@deepseek-ai/dsh-client-web-react": "^0.0.1-rc.1",
|
|
51
|
+
"@deepseek-ai/dsh-host-apiproxy": "^0.0.1-rc.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.0.1-rc.1",
|
|
53
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.1"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"lib/index.js",
|
|
58
|
+
"lib/invariant.js",
|
|
59
|
+
"lib/types/**/*.d.ts"
|
|
60
|
+
]
|
|
61
|
+
}
|