@deepseek-ai/dsh-host-directory-picker-native 0.0.1-rc.2 → 0.0.1-rc.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-host-directory-picker-native",
3
3
  "description": "Native-OS-chooser backend of the directory-picker seam for the DeepSeek Harness web GUI host",
4
- "version": "0.0.1-rc.2",
4
+ "version": "0.0.1-rc.3",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -22,10 +22,6 @@
22
22
  "types": "./lib/types/invariant.d.ts",
23
23
  "default": "./lib/invariant.js"
24
24
  },
25
- "./client": {
26
- "types": "./lib/types/client/index.d.ts",
27
- "default": "./lib/client.js"
28
- },
29
25
  "./worker": {
30
26
  "types": "./lib/types/win32-dialog-worker.d.ts",
31
27
  "default": "./lib/worker.cjs"
@@ -37,40 +33,21 @@
37
33
  "lib/index.js",
38
34
  "lib/invariant.js",
39
35
  "lib/worker.cjs",
40
- "lib/client.js",
41
36
  "lib/types/**/*.d.ts"
42
37
  ],
43
38
  "license": "BSD-3-Clause",
44
39
  "dependencies": {
45
40
  "koffi": "^3.1.0",
46
- "@deepseek-ai/dsh-host-directory-picker": "^0.0.1-rc.2",
47
- "@deepseek-ai/dsh-native-command": "^0.0.1-rc.2"
41
+ "@deepseek-ai/dsh-host-directory-picker": "^0.0.1-rc.3",
42
+ "@deepseek-ai/dsh-native-command": "^0.0.1-rc.3"
48
43
  },
49
44
  "peerDependencies": {
50
- "react": "^18.2.0",
51
- "@deepseek-ai/dsh-client-runtime": "^0.0.1-rc.2",
52
- "@deepseek-ai/dsh-client-ui-slots": "^0.0.1-rc.2",
53
- "@deepseek-ai/dsh-client-ui-workspace": "^0.0.1-rc.2",
54
- "@deepseek-ai/cordis": "^4.0.1-rc.1",
55
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2"
45
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
46
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
56
47
  },
57
48
  "devDependencies": {
58
- "@types/react": "~18.3.1",
59
- "react": "^18.2.0",
60
49
  "tsx": "^4.19.2",
61
- "@deepseek-ai/dsh-client-runtime": "^0.0.1-rc.2",
62
- "@deepseek-ai/dsh-client-ui-slots": "^0.0.1-rc.2",
63
- "@deepseek-ai/dsh-client-ui-workspace": "^0.0.1-rc.2",
64
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
50
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
65
51
  "@deepseek-ai/cordis": "^4.0.1-rc.1"
66
- },
67
- "dsh": {
68
- "client": {
69
- "inject": [
70
- "@deepseek-ai/dsh-client-runtime",
71
- "@deepseek-ai/dsh-client-ui-workspace"
72
- ],
73
- "platform": "web"
74
- }
75
52
  }
76
53
  }
package/lib/client.js DELETED
@@ -1,82 +0,0 @@
1
- window.__ModuleLoader__.load({
2
- id: "@deepseek-ai/dsh-host-directory-picker-native",
3
- factory: (require) => {
4
- var module = { exports: {} };
5
- var exports = module.exports;
6
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
- let react = require("react");
8
- //#region lib/types/client/flow.js
9
- /**
10
- * The native picking occupant (package-internal; the `./client` surface
11
- * exposes only the Loader exports). Same-package tests exercise it directly
12
- * through this module.
13
- */
14
- /**
15
- * Renderless flow occupant: each rising `open` edge runs exactly one pick and
16
- * reports exactly one outcome; the ref arms once per open so re-renders (and
17
- * an adoption keeping `open` true while `busy`) never launch a second
18
- * chooser. The owner withdrawing `open` re-arms the next request.
19
- * @param props - owner conversation plus the injected pick call.
20
- * @returns nothing — the native chooser renders on the host display.
21
- */
22
- function NativeDirectoryFlow(props) {
23
- const { open, pick } = props;
24
- const armed = (0, react.useRef)(false);
25
- const outcome = (0, react.useRef)(props);
26
- outcome.current = props;
27
- const alive = (0, react.useRef)(true);
28
- (0, react.useEffect)(() => {
29
- alive.current = true;
30
- return () => {
31
- alive.current = false;
32
- };
33
- }, []);
34
- (0, react.useEffect)(() => {
35
- if (!open) {
36
- armed.current = false;
37
- return;
38
- }
39
- if (armed.current) return;
40
- armed.current = true;
41
- pick().then((path) => {
42
- if (!alive.current) return;
43
- if (path === null) outcome.current.onCancel();
44
- else outcome.current.onPicked(path);
45
- }, (reason) => {
46
- if (!alive.current) return;
47
- outcome.current.onError(reason instanceof Error ? reason.message : String(reason));
48
- });
49
- }, [open, pick]);
50
- return null;
51
- }
52
- //#endregion
53
- //#region lib/types/client/index.js
54
- /** Required services (cordis fiber inject): the slot registry and the wire-facing workspace service. */
55
- const inject = ["slots", "workspaces"];
56
- /**
57
- * Client plugin body: register the renderless native flow into both
58
- * directory-flow holes through `slots.inject()` because the ui-workspace
59
- * entries may activate later or replace their declarations.
60
- * @param ctx - client root context.
61
- */
62
- function apply(ctx) {
63
- const injected = () => ({ pick: () => ctx.workspaces.pickDirectory() });
64
- ctx.slots.inject("conversation.hero.workspace.directoryFlow", () => ctx.slots.inject("sidebar.workspaces.directoryFlow", function* () {
65
- yield ctx.slots.register({
66
- name: "conversation.hero.workspace.directoryFlow",
67
- inject: injected
68
- }, NativeDirectoryFlow);
69
- yield ctx.slots.register({
70
- name: "sidebar.workspaces.directoryFlow",
71
- inject: injected
72
- }, NativeDirectoryFlow);
73
- }));
74
- }
75
- //#endregion
76
- exports.apply = apply;
77
- exports.inject = inject;
78
- return module.exports;
79
- }
80
- });
81
-
82
- //# sourceMappingURL=client.js.map
@@ -1,17 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import type { DirectoryFlowOwnerProps } from '@deepseek-ai/dsh-client-ui-workspace/client';
3
- /** Injected face: the wire call the flow drives (bound in apply's closure). */
4
- export interface NativeFlowInjected {
5
- /** Ask the local Host to open its native single-directory chooser. */
6
- pick: () => Promise<string | null>;
7
- }
8
- /**
9
- * Renderless flow occupant: each rising `open` edge runs exactly one pick and
10
- * reports exactly one outcome; the ref arms once per open so re-renders (and
11
- * an adoption keeping `open` true while `busy`) never launch a second
12
- * chooser. The owner withdrawing `open` re-arms the next request.
13
- * @param props - owner conversation plus the injected pick call.
14
- * @returns nothing — the native chooser renders on the host display.
15
- */
16
- export declare function NativeDirectoryFlow(props: DirectoryFlowOwnerProps & NativeFlowInjected): ReactElement | null;
17
- //# sourceMappingURL=flow.d.ts.map
@@ -1,20 +0,0 @@
1
- /**
2
- * Browser half of the native directory-picker backend: fills ui-workspace's
3
- * two directory-flow holes with a renderless occupant that answers each
4
- * `open` by driving `host.pickDirectory` (the node half's OS chooser) and
5
- * reporting the one outcome — picked path, cancellation, or failure — back
6
- * through the owner conversation. Mounting this package therefore composes
7
- * both sides of the native interaction with one cordis.yml row; no client
8
- * code branches on a capability kind.
9
- */
10
- import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
11
- /** Required services (cordis fiber inject): the slot registry and the wire-facing workspace service. */
12
- export declare const inject: string[];
13
- /**
14
- * Client plugin body: register the renderless native flow into both
15
- * directory-flow holes through `slots.inject()` because the ui-workspace
16
- * entries may activate later or replace their declarations.
17
- * @param ctx - client root context.
18
- */
19
- export declare function apply(ctx: ClientContext): void;
20
- //# sourceMappingURL=index.d.ts.map