@lengmoxxl/sdk 0.1.11 → 0.1.12
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.md +4 -2
- package/dist/types.d.ts +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,9 +125,11 @@ provider 要保证工作区 id 在所有 provider 的行中唯一识别。
|
|
|
125
125
|
`create` 默认使用 24 行 80 列。`size` 使用 `Size`,字段为整数:rows 2–300,cols 2–500。
|
|
126
126
|
|
|
127
127
|
`options.cwd` 使用绝对目录,省略时在后台进程的 HOME 下启动;
|
|
128
|
-
`options.env` 是额外给这个 shell
|
|
128
|
+
`options.env` 是额外给这个 shell 的环境变量,值都是字符串;
|
|
129
|
+
`options.label` 是调用方给这个会话起的名字。
|
|
129
130
|
|
|
130
|
-
`Session` 有 `id, title`、`pid, rows, cols`、`exit_code: number | null
|
|
131
|
+
`Session` 有 `id, title, label`、`pid, rows, cols`、`exit_code: number | null`;
|
|
132
|
+
`title` 是后台按 shell 与 pid 起的默认名,显示时用 `label ?? title`。
|
|
131
133
|
|
|
132
134
|
`Pty`:`id`、`onSnapshot(callback)`、`onData(callback)`、`write(data)`、`resize(size)`、
|
|
133
135
|
`detach()`(停止挂载,不关闭 shell)。
|
package/dist/types.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface WorkspaceActive {
|
|
|
25
25
|
machine: Machine;
|
|
26
26
|
sessionId: string;
|
|
27
27
|
workspaceId: string;
|
|
28
|
+
/** The workspace as the sidebar names it, for a view that has to title its own tabs. */
|
|
29
|
+
name: string;
|
|
28
30
|
}
|
|
29
31
|
/** Where a click on a file or a directory points, as the 'onclick' topic carries it. */
|
|
30
32
|
export interface FileClick {
|
|
@@ -50,14 +52,16 @@ export interface Size {
|
|
|
50
52
|
rows: number;
|
|
51
53
|
cols: number;
|
|
52
54
|
}
|
|
53
|
-
/** What a session is created with: the directory its shell opens in,
|
|
55
|
+
/** What a session is created with: the directory its shell opens in, what it is told besides the node's environment, and the name it is shown under. */
|
|
54
56
|
export interface PtyOptions {
|
|
55
57
|
cwd?: string;
|
|
56
58
|
env?: Record<string, string>;
|
|
59
|
+
label?: string;
|
|
57
60
|
}
|
|
58
61
|
export interface Session extends Size {
|
|
59
62
|
id: string;
|
|
60
63
|
title: string;
|
|
64
|
+
label: string | null;
|
|
61
65
|
pid: number;
|
|
62
66
|
exit_code: number | null;
|
|
63
67
|
}
|