dshb-ui 0.0.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 +21 -0
- package/cordis.patch.yml +9 -0
- package/lib/client.js +1868 -0
- package/lib/client.js.map +1 -0
- package/lib/index-CLOUBKxU.d.ts +1125 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/picker.d.ts +10 -0
- package/lib/picker.js +58 -0
- package/lib/picker.js.map +1 -0
- package/package.json +48 -0
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis'\n\nexport const name = 'dshb-ui'\n\nexport function apply(_ctx: Context): void {}\n"],"mappings":";AAEA,MAAa,OAAO;AAEpB,SAAgB,MAAM,MAAqB,CAAC"}
|
package/lib/picker.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as Context } from "./index-CLOUBKxU.js";
|
|
2
|
+
import DirectoryPicker, { DirectoryPickerBrowseCapability } from "@deepseek-ai/dsh-host-directory-picker";
|
|
3
|
+
//#region src/picker.d.ts
|
|
4
|
+
declare class DshbDirectoryPicker extends DirectoryPicker {
|
|
5
|
+
constructor(ctx: Context);
|
|
6
|
+
capability(): DirectoryPickerBrowseCapability;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DshbDirectoryPicker as default };
|
|
10
|
+
//# sourceMappingURL=picker.d.ts.map
|
package/lib/picker.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { readdirSync } from "node:fs";
|
|
3
|
+
import DirectoryPicker from "@deepseek-ai/dsh-host-directory-picker";
|
|
4
|
+
//#region src/picker.ts
|
|
5
|
+
function entry(path, hidden) {
|
|
6
|
+
return {
|
|
7
|
+
name: path.split("/").filter(Boolean).pop() ?? "/",
|
|
8
|
+
path,
|
|
9
|
+
hidden
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
var DshbDirectoryPicker = class extends DirectoryPicker {
|
|
13
|
+
constructor(ctx) {
|
|
14
|
+
super(ctx);
|
|
15
|
+
}
|
|
16
|
+
capability() {
|
|
17
|
+
return {
|
|
18
|
+
kind: "browse",
|
|
19
|
+
list: async (path) => {
|
|
20
|
+
const target = path ?? homedir();
|
|
21
|
+
const entries = readdirSync(target, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort().map((name) => entry(`${target.replace(/\/+$/, "")}/${name}`, name.startsWith(".")));
|
|
22
|
+
const crumbs = [];
|
|
23
|
+
const parts = target.split("/").filter(Boolean);
|
|
24
|
+
let acc = "";
|
|
25
|
+
crumbs.push({
|
|
26
|
+
name: "/",
|
|
27
|
+
path: "/",
|
|
28
|
+
hidden: false
|
|
29
|
+
});
|
|
30
|
+
for (const part of parts) {
|
|
31
|
+
acc += `/${part}`;
|
|
32
|
+
crumbs.push({
|
|
33
|
+
name: part,
|
|
34
|
+
path: acc,
|
|
35
|
+
hidden: false
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
path: target,
|
|
40
|
+
home: homedir(),
|
|
41
|
+
crumbs,
|
|
42
|
+
entries,
|
|
43
|
+
truncated: false
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
createDirectory: async (path, name) => {
|
|
47
|
+
const { mkdirSync } = await import("node:fs");
|
|
48
|
+
const created = `${path.replace(/\/+$/, "")}/${name}`;
|
|
49
|
+
mkdirSync(created, { recursive: true });
|
|
50
|
+
return created;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { DshbDirectoryPicker as default };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.js","names":[],"sources":["../src/picker.ts"],"sourcesContent":["import { homedir } from 'node:os'\nimport { readdirSync } from 'node:fs'\nimport type { Context } from '@deepseek-ai/cordis'\nimport DirectoryPicker, { type DirectoryListing, type DirectoryEntry, type DirectoryPickerBrowseCapability } from '@deepseek-ai/dsh-host-directory-picker'\n\nfunction entry(path: string, hidden: boolean): DirectoryEntry {\n return { name: path.split('/').filter(Boolean).pop() ?? '/', path, hidden }\n}\n\nexport default class DshbDirectoryPicker extends DirectoryPicker {\n constructor(ctx: Context) {\n super(ctx)\n }\n\n capability(): DirectoryPickerBrowseCapability {\n return {\n kind: 'browse',\n list: async (path?: string): Promise<DirectoryListing> => {\n const target = path ?? homedir()\n const names = readdirSync(target, { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name)\n .sort()\n const entries = names.map((name) => entry(`${target.replace(/\\/+$/, '')}/${name}`, name.startsWith('.')))\n const crumbs: DirectoryEntry[] = []\n const parts = target.split('/').filter(Boolean)\n let acc = ''\n crumbs.push({ name: '/', path: '/', hidden: false })\n for (const part of parts) {\n acc += `/${part}`\n crumbs.push({ name: part, path: acc, hidden: false })\n }\n return { path: target, home: homedir(), crumbs, entries, truncated: false }\n },\n createDirectory: async (path: string, name: string): Promise<string> => {\n const { mkdirSync } = await import('node:fs')\n const created = `${path.replace(/\\/+$/, '')}/${name}`\n mkdirSync(created, { recursive: true })\n return created\n },\n }\n }\n}\n"],"mappings":";;;;AAKA,SAAS,MAAM,MAAc,QAAiC;CAC5D,OAAO;EAAE,MAAM,KAAK,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,KAAK;EAAK;EAAM;CAAO;AAC5E;AAEA,IAAqB,sBAArB,cAAiD,gBAAgB;CAC/D,YAAY,KAAc;EACxB,MAAM,GAAG;CACX;CAEA,aAA8C;EAC5C,OAAO;GACL,MAAM;GACN,MAAM,OAAO,SAA6C;IACxD,MAAM,SAAS,QAAQ,QAAQ;IAK/B,MAAM,UAJQ,YAAY,QAAQ,EAAE,eAAe,KAAK,CAAC,CAAC,CACvD,QAAQ,MAAM,EAAE,YAAY,CAAC,CAAC,CAC9B,KAAK,MAAM,EAAE,IAAI,CAAC,CAClB,KACiB,CAAC,CAAC,KAAK,SAAS,MAAM,GAAG,OAAO,QAAQ,QAAQ,EAAE,EAAE,GAAG,QAAQ,KAAK,WAAW,GAAG,CAAC,CAAC;IACxG,MAAM,SAA2B,CAAC;IAClC,MAAM,QAAQ,OAAO,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;IAC9C,IAAI,MAAM;IACV,OAAO,KAAK;KAAE,MAAM;KAAK,MAAM;KAAK,QAAQ;IAAM,CAAC;IACnD,KAAK,MAAM,QAAQ,OAAO;KACxB,OAAO,IAAI;KACX,OAAO,KAAK;MAAE,MAAM;MAAM,MAAM;MAAK,QAAQ;KAAM,CAAC;IACtD;IACA,OAAO;KAAE,MAAM;KAAQ,MAAM,QAAQ;KAAG;KAAQ;KAAS,WAAW;IAAM;GAC5E;GACA,iBAAiB,OAAO,MAAc,SAAkC;IACtE,MAAM,EAAE,cAAc,MAAM,OAAO;IACnC,MAAM,UAAU,GAAG,KAAK,QAAQ,QAAQ,EAAE,EAAE,GAAG;IAC/C,UAAU,SAAS,EAAE,WAAW,KAAK,CAAC;IACtC,OAAO;GACT;EACF;CACF;AACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dshb-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "DSHB 节点感知添加工作区 occupant 与节点管理设置页",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./client": "./lib/client.js",
|
|
10
|
+
"./picker": "./lib/picker.js",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"lib",
|
|
15
|
+
"cordis.patch.yml"
|
|
16
|
+
],
|
|
17
|
+
"dsh": {
|
|
18
|
+
"bundle": {
|
|
19
|
+
"patch": "./cordis.patch.yml"
|
|
20
|
+
},
|
|
21
|
+
"client": {
|
|
22
|
+
"platform": "web",
|
|
23
|
+
"inject": [
|
|
24
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
25
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
26
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
27
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
28
|
+
"@deepseek-ai/dsh-client-ui-layout"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@deepseek-ai/dsh-host-directory-picker": "^0.1.1-rc.2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
37
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
|
|
38
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.2",
|
|
39
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2",
|
|
40
|
+
"@types/react": "^19.0.0",
|
|
41
|
+
"react": "^19.0.0"
|
|
42
|
+
},
|
|
43
|
+
"types": "lib/index.d.ts",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsdown",
|
|
46
|
+
"typecheck": "tsc --noEmit"
|
|
47
|
+
}
|
|
48
|
+
}
|