@yep-ai/cli 1.2.2 → 1.2.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/README.md +37 -37
- package/lib/feishu/command.js +6 -4
- package/native/darwin-arm64/yep-feishu-node +0 -0
- package/native/darwin-x64/yep-feishu-node +0 -0
- package/native/feishu-manifest.json +8 -8
- package/native/linux-arm64/yep-feishu-node +0 -0
- package/native/linux-x64/yep-feishu-node +0 -0
- package/native/win32-arm64/yep-feishu-node.exe +0 -0
- package/native/win32-x64/yep-feishu-node.exe +0 -0
- package/package.json +1 -1
- package/lib/feishu/private-path.ps1 +0 -50
package/README.md
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
## 安装与使用
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npx --yes
|
|
8
|
+
npx --yes @yep-ai/cli@1.2.3 --help
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
用户可通过 npx 运行安装包,无需全局安装:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npx --yes
|
|
15
|
-
npx --yes
|
|
14
|
+
npx --yes @yep-ai/cli@1.2.3 --help
|
|
15
|
+
npx --yes @yep-ai/cli@1.2.3 device start
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
本包包含完整实现。`yep-cli` 是计划中的同版本入口包,当前尚未发布本项目版本,请使用 `@yep-ai/cli`。
|
|
@@ -26,31 +26,31 @@ npm install
|
|
|
26
26
|
npm run yep -- --help
|
|
27
27
|
npm run build:yep-node
|
|
28
28
|
npm run pack:cli
|
|
29
|
-
npm install --prefix ./tmp/yep-install ./dist/cli/scoped/yep-ai-cli-1.2.
|
|
29
|
+
npm install --prefix ./tmp/yep-install ./dist/cli/scoped/yep-ai-cli-1.2.3.tgz ./dist/cli/unscoped/yep-cli-1.2.3.tgz
|
|
30
30
|
./tmp/yep-install/node_modules/.bin/yep --version
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
完整实现包为 `scoped/yep-ai-cli-1.2.
|
|
33
|
+
完整实现包为 `scoped/yep-ai-cli-1.2.3.tgz`,入口包为 `unscoped/yep-cli-1.2.3.tgz`。本地验证时可一起指定两份文件,无需从 npm 下载实现包。输出的 `manifest.json` 记录包名、版本、依赖和 SHA-256。
|
|
34
34
|
|
|
35
35
|
## 市场与 Git 内容版本
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
npx --yes
|
|
39
|
-
npx --yes
|
|
40
|
-
npx --yes
|
|
41
|
-
npx --yes
|
|
42
|
-
npx --yes
|
|
43
|
-
npx --yes
|
|
44
|
-
npx --yes
|
|
45
|
-
npx --yes
|
|
46
|
-
npx --yes
|
|
47
|
-
npx --yes
|
|
48
|
-
npx --yes
|
|
49
|
-
npx --yes
|
|
50
|
-
npx --yes
|
|
51
|
-
npx --yes
|
|
52
|
-
npx --yes
|
|
53
|
-
npx --yes
|
|
38
|
+
npx --yes @yep-ai/cli@1.2.3 login --registry https://yep.nihao.cool
|
|
39
|
+
npx --yes @yep-ai/cli@1.2.3 whoami
|
|
40
|
+
npx --yes @yep-ai/cli@1.2.3 search assistant
|
|
41
|
+
npx --yes @yep-ai/cli@1.2.3 info @creator/demo
|
|
42
|
+
npx --yes @yep-ai/cli@1.2.3 client set codex,claude
|
|
43
|
+
npx --yes @yep-ai/cli@1.2.3 install @creator/demo --client codex
|
|
44
|
+
npx --yes @yep-ai/cli@1.2.3 list
|
|
45
|
+
npx --yes @yep-ai/cli@1.2.3 list --remote
|
|
46
|
+
npx --yes @yep-ai/cli@1.2.3 list --mine
|
|
47
|
+
npx --yes @yep-ai/cli@1.2.3 uninstall @creator/demo --client codex
|
|
48
|
+
npx --yes @yep-ai/cli@1.2.3 publish ./my-skill
|
|
49
|
+
npx --yes @yep-ai/cli@1.2.3 history @creator/demo
|
|
50
|
+
npx --yes @yep-ai/cli@1.2.3 diff @creator/demo --base published
|
|
51
|
+
npx --yes @yep-ai/cli@1.2.3 publish ./my-agent --kind agent
|
|
52
|
+
npx --yes @yep-ai/cli@1.2.3 submit @creator/demo --kind agent
|
|
53
|
+
npx --yes @yep-ai/cli@1.2.3 withdraw @creator/demo --kind agent
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
默认资源类型为 `skill`,也支持 `--kind agent|plugin`。Skill 私有保存后从网页申请共享审核;Agent/Plugin 的发布会提交审核。审核通过才进入公开市场。`history` 和 `diff` 访问服务端保留的真实 Git 版本。
|
|
@@ -60,10 +60,10 @@ npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.2.tgz yep withd
|
|
|
60
60
|
## 设备节点
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
npx --yes
|
|
64
|
-
npx --yes
|
|
65
|
-
npx --yes
|
|
66
|
-
npx --yes
|
|
63
|
+
npx --yes @yep-ai/cli@1.2.3 device login
|
|
64
|
+
npx --yes @yep-ai/cli@1.2.3 device start "/path/to/documents"
|
|
65
|
+
npx --yes @yep-ai/cli@1.2.3 device status
|
|
66
|
+
npx --yes @yep-ai/cli@1.2.3 device logout
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
设备通过 HTTPS 配对和 WSS 出站连接;网页批准设备后,还需在某场咨询中选择目录和权限。目录不会整体上传。最多指定 5 个目录;指定目录时仅提供受限内置命令。不指定目录时仅授权当前目录;必须显式使用 `--privacy system` 才启用完整系统终端,该终端拥有当前系统用户权限,可访问其他文件和网络,输入输出不经过文件脱敏。进程退出后节点离线,不安装后台服务。设备授权最长 24 小时,可以从网页或 CLI 撤销。
|
|
@@ -75,7 +75,7 @@ npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.2.tgz yep devic
|
|
|
75
75
|
原生程序随 npm 包一起分发,无需用户安装 Go。当前构建目标为 Windows x64 / ARM64、macOS Intel / Apple Silicon、Linux x64 / ARM64;Windows 需要支持 ConPTY 的 Windows 10 1809 / Server 2019 或更新版本。鸿蒙 / OpenHarmony 原生 ABI 尚未适配,不能将 Linux ARM64 包视为鸿蒙包。缺少原生程序时会明确提示并提供兼容的逐条命令模式;受限目录始终使用内置命令模式,不启动系统 Shell。
|
|
76
76
|
|
|
77
77
|
设备配对和网络通道使用 HTTPS / WSS;服务端保存令牌摘要,客户端每小时轮换设备令牌并保留短暂交接窗口,轮换不会延长原有 24 小时授权。客户端先持久化待交接凭据,断线后继续完成交接。TLS 在站点入口终止,集群内部连接不属于端到端加密。
|
|
78
|
-
指定启动目录时仅支持 `pwd`、`ls` / `dir`、`echo`、`cat` / `type`、`head`、`tail`、`grep` / `findstr`、`wc -l` 与终端内的 `cd`,不能使用管道、重定向或外部程序。已有旧版节点若提示不支持终端,请停止旧进程,将原启动命令中的 `yep` 替换为 `npx --yes
|
|
78
|
+
指定启动目录时仅支持 `pwd`、`ls` / `dir`、`echo`、`cat` / `type`、`head`、`tail`、`grep` / `findstr`、`wc -l` 与终端内的 `cd`,不能使用管道、重定向或外部程序。已有旧版节点若提示不支持终端,请停止旧进程,将原启动命令中的 `yep` 替换为 `npx --yes @yep-ai/cli@1.2.3`,保留原目录参数。
|
|
79
79
|
|
|
80
80
|
设备默认连接 `https://yep.nihao.cool`,使用本站时无需指定服务器。连接自建站点时可使用 `--server https://your-site.example`;只接受 HTTPS 源站(回环开发地址允许 HTTP),显式指定后记住该源站,令牌按源站隔离。市场登录不等于设备授权。
|
|
81
81
|
|
|
@@ -95,9 +95,9 @@ npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.2.tgz yep devic
|
|
|
95
95
|
|
|
96
96
|
市场凭据保存为 `~/.config/yep/config.json`;设备身份和各源站的授权保存在 `~/.config/yep/devices/`。目录权限 `0700`、凭据文件 `0600`;Windows 使用当前用户专属 ACL。市场和设备令牌分别管理。域名改变后需要在新源站重新登录、配对,不会把旧源站令牌发送到新地址。
|
|
97
97
|
|
|
98
|
-
执行 `npx --yes
|
|
98
|
+
执行 `npx --yes @yep-ai/cli@1.2.3 --help` 或 `npx --yes @yep-ai/cli@1.2.3 device --help` 查看全部选项。
|
|
99
99
|
|
|
100
|
-
## 本地脱敏(1.2.
|
|
100
|
+
## 本地脱敏(1.2.3)
|
|
101
101
|
|
|
102
102
|
默认 `device start` 为严格模式,无目录参数时仅授权当前目录;完整系统终端需显式 `--privacy system`,其输入输出不经过文件脱敏。读取、搜索、下载及发布前使用本机 Go 核心,规则修改不需要用户编译。
|
|
103
103
|
|
|
@@ -113,18 +113,18 @@ yep privacy export ./report.txt --out ./report.safe.txt --offline
|
|
|
113
113
|
|
|
114
114
|
支持 10 MiB 以内的 UTF-8 文本、源码、JSON/YAML/CSV;PDF、Office、图片、压缩包与其他无法解析为文本的文件默认允许原样传输。可在「设备节点 → 脱敏规则」选择阻断,或设置本地 `unsupportedFiles: block`;任一适用策略要求阻断时以阻断为准。原件不覆盖。任意 JS 脚本不在默认引擎中执行。检测不保证穷尽自然语言秘密,发送前仍需本机复核。详见仓库 `docs/privacy.md`。
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
CLI 及独立 Go 飞书节点版本为 1.2.3;使用 npm 正式包运行。
|
|
117
117
|
|
|
118
118
|
## 飞书智能体节点
|
|
119
119
|
|
|
120
120
|
飞书节点由独立的 Go 进程负责,与 `yep device start` 的设备、目录和权限分开管理。
|
|
121
121
|
|
|
122
122
|
```sh
|
|
123
|
-
npx --yes @yep-ai/cli@1.2.
|
|
124
|
-
npx --yes @yep-ai/cli@1.2.
|
|
125
|
-
npx --yes @yep-ai/cli@1.2.
|
|
126
|
-
npx --yes @yep-ai/cli@1.2.
|
|
127
|
-
npx --yes @yep-ai/cli@1.2.
|
|
123
|
+
npx --yes @yep-ai/cli@1.2.3 feishu setup --install-service
|
|
124
|
+
npx --yes @yep-ai/cli@1.2.3 feishu status
|
|
125
|
+
npx --yes @yep-ai/cli@1.2.3 feishu doctor --fix
|
|
126
|
+
npx --yes @yep-ai/cli@1.2.3 feishu restart
|
|
127
|
+
npx --yes @yep-ai/cli@1.2.3 feishu logs --follow
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
`setup` 自动打开平台授权页、飞书官方创建/授权二维码;完成扫码后保存节点专用凭据,启动长连接并检查权限。飞书官方扫码和企业管理员要求的审批需要本人完成。网页「飞书节点」也支持直接托管,关闭浏览器后继续运行。
|
|
@@ -133,8 +133,8 @@ npx --yes @yep-ai/cli@1.2.2 feishu logs --follow
|
|
|
133
133
|
|
|
134
134
|
`doctor --fix` 打开权限修复页并重新检查,不会代替飞书的授权审批。`feishu stop` 停止本机服务,`feishu remove` 撤销节点。系统服务使用当前用户的 systemd / LaunchAgent / Windows 任务计划程序;运行文件、凭据和日志独立保存。完整说明见仓库 `packages/yep-feishu-node/README.md`。
|
|
135
135
|
|
|
136
|
-
### Windows 配置权限修复(1.2.
|
|
136
|
+
### Windows 配置权限修复(1.2.3)
|
|
137
137
|
|
|
138
|
-
已有飞书配置目录或文件继承了 Windows 用户目录权限时,CLI
|
|
138
|
+
已有飞书配置目录或文件继承了 Windows 用户目录权限时,CLI 和 Go 服务使用同一套原生 Windows API 限制本人拥有的配置路径,只允许本人、SYSTEM 和 Administrators 访问。仅写入 DACL,保留所有者、主组、审计规则与配置内容,避免 1.2.2 中 `Set-Acl` 触发的 `SeSecurityPrivilege` 错误。此操作不依赖 PowerShell,也无需为修改审计规则提升权限;目录权限传递给子目录与文件,失败时显示 Windows 的具体原因。
|
|
139
139
|
|
|
140
|
-
从旧版升级后执行 `npx --yes @yep-ai/cli@1.2.
|
|
140
|
+
从旧版升级后执行 `npx --yes @yep-ai/cli@1.2.3 feishu setup`;不需要删除已有凭据或切换终端。PowerShell 启动配置中的 Docker 报错与飞书节点无关。
|
package/lib/feishu/command.js
CHANGED
|
@@ -9,7 +9,6 @@ import { setTimeout as delay } from "node:timers/promises";
|
|
|
9
9
|
import { service } from "./service.js";
|
|
10
10
|
|
|
11
11
|
const exec = promisify(execFile);
|
|
12
|
-
const windowsACLScript = fileURLToPath(new URL("./private-path.ps1", import.meta.url));
|
|
13
12
|
const help = `Yep 飞书智能体(独立 Go 服务)
|
|
14
13
|
yep feishu setup [--server https://yep.nihao.cool] [--app-id cli_…] [--all-group-messages] [--no-open] [--install-service]
|
|
15
14
|
yep feishu start [--foreground] [--install-service]
|
|
@@ -51,13 +50,16 @@ export async function privatePath(location, directory = false) {
|
|
|
51
50
|
throw new Error("飞书配置权限不安全,请设为目录 0700、文件 0600。");
|
|
52
51
|
if (process.platform === "win32") {
|
|
53
52
|
try {
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
const args = ["--secure-path", location];
|
|
54
|
+
if (directory) args.push("--directory");
|
|
55
|
+
await exec(await nativeBinary(), args, {
|
|
56
56
|
windowsHide: true,
|
|
57
57
|
timeout: 15000,
|
|
58
58
|
});
|
|
59
59
|
} catch (cause) {
|
|
60
|
-
|
|
60
|
+
const reason = cause.killed ? "Windows 权限操作超时。" :
|
|
61
|
+
String(cause.stderr || cause.message || "Windows 权限操作失败。").trim().slice(0, 800);
|
|
62
|
+
throw new Error(`无法保护飞书配置路径:${location}。\n${reason}`, { cause });
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
return st;
|
|
Binary file
|
|
Binary file
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"sourceSHA256": "
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"sourceSHA256": "dbfcf823a877ef52a63474260fdf7a4f12a02e76242df3929f87f5e907b106f8",
|
|
5
5
|
"files": {
|
|
6
6
|
"win32-x64/yep-feishu-node.exe": {
|
|
7
|
-
"sha256": "
|
|
7
|
+
"sha256": "a867ba4354f22cd6c4e4cd5dcb7e7615057a10cfac0cab7ee8878599a8392a5b",
|
|
8
8
|
"goos": "windows",
|
|
9
9
|
"goarch": "amd64"
|
|
10
10
|
},
|
|
11
11
|
"win32-arm64/yep-feishu-node.exe": {
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "2487dc77cb575302fe8fd0cc8c31fec0bd106a334041a366acec8ae677b8f420",
|
|
13
13
|
"goos": "windows",
|
|
14
14
|
"goarch": "arm64"
|
|
15
15
|
},
|
|
16
16
|
"darwin-x64/yep-feishu-node": {
|
|
17
|
-
"sha256": "
|
|
17
|
+
"sha256": "dfe1e42744e99fe2cf846c435995174b763917834ef9afc804b0d027522ab834",
|
|
18
18
|
"goos": "darwin",
|
|
19
19
|
"goarch": "amd64"
|
|
20
20
|
},
|
|
21
21
|
"darwin-arm64/yep-feishu-node": {
|
|
22
|
-
"sha256": "
|
|
22
|
+
"sha256": "ca36eccf1e85b9e0454536b8af8a04f1c04935ba86d63ff845a063ffe2799775",
|
|
23
23
|
"goos": "darwin",
|
|
24
24
|
"goarch": "arm64"
|
|
25
25
|
},
|
|
26
26
|
"linux-x64/yep-feishu-node": {
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "c564f52c7638291884d0dd2abb0900271c816df4b3449f7b98db93894d61c560",
|
|
28
28
|
"goos": "linux",
|
|
29
29
|
"goarch": "amd64"
|
|
30
30
|
},
|
|
31
31
|
"linux-arm64/yep-feishu-node": {
|
|
32
|
-
"sha256": "
|
|
32
|
+
"sha256": "2f4dd9ab86b80e8063b3a5709c072a16aff3b9b3178fe0c6e9970dd5975436ad",
|
|
33
33
|
"goos": "linux",
|
|
34
34
|
"goarch": "arm64"
|
|
35
35
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
$ErrorActionPreference = 'Stop'
|
|
2
|
-
$path = $env:YEP_FEISHU_ACL_PATH
|
|
3
|
-
$directory = $env:YEP_FEISHU_ACL_DIRECTORY -eq '1'
|
|
4
|
-
$item = Get-Item -LiteralPath $path -Force
|
|
5
|
-
if (($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -ne 0 -or $item.PSIsContainer -ne $directory) {
|
|
6
|
-
throw 'Unsafe Feishu configuration path'
|
|
7
|
-
}
|
|
8
|
-
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
|
9
|
-
$sid = $identity.User
|
|
10
|
-
$allowed = @($sid.Value, 'S-1-5-18', 'S-1-5-32-544')
|
|
11
|
-
$acl = Get-Acl -LiteralPath $path
|
|
12
|
-
$rules = $acl.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier])
|
|
13
|
-
$safe = $acl.AreAccessRulesProtected
|
|
14
|
-
$ownerAccess = $false
|
|
15
|
-
foreach ($rule in $rules) {
|
|
16
|
-
if ($rule.AccessControlType -eq 'Allow') {
|
|
17
|
-
if ($rule.IdentityReference.Value -notin $allowed) { $safe = $false }
|
|
18
|
-
if ($rule.IdentityReference.Value -eq $sid.Value -and
|
|
19
|
-
($rule.FileSystemRights -band [Security.AccessControl.FileSystemRights]::FullControl) -eq [Security.AccessControl.FileSystemRights]::FullControl -and
|
|
20
|
-
(!$directory -or ($rule.InheritanceFlags -band 3) -eq 3)) { $ownerAccess = $true }
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if ($safe -and $ownerAccess) { exit 0 }
|
|
24
|
-
|
|
25
|
-
# Repair only a path owned by this account (or its elevated Administrators token).
|
|
26
|
-
$owner = $acl.GetOwner([Security.Principal.SecurityIdentifier]).Value
|
|
27
|
-
$principal = [Security.Principal.WindowsPrincipal]::new($identity)
|
|
28
|
-
if ($owner -ne $sid.Value -and !($owner -eq 'S-1-5-32-544' -and $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))) {
|
|
29
|
-
throw 'Feishu configuration belongs to another account'
|
|
30
|
-
}
|
|
31
|
-
$acl.SetAccessRuleProtection($true, $false)
|
|
32
|
-
foreach ($rule in $acl.GetAccessRules($true, $false, [Security.Principal.SecurityIdentifier])) {
|
|
33
|
-
[void]$acl.RemoveAccessRuleSpecific($rule)
|
|
34
|
-
}
|
|
35
|
-
$inheritance = [Security.AccessControl.InheritanceFlags]::None
|
|
36
|
-
if ($directory) { $inheritance = [Security.AccessControl.InheritanceFlags]'ContainerInherit,ObjectInherit' }
|
|
37
|
-
foreach ($value in @($allowed | Select-Object -Unique)) {
|
|
38
|
-
$account = [Security.Principal.SecurityIdentifier]::new($value)
|
|
39
|
-
$rule = [Security.AccessControl.FileSystemAccessRule]::new($account, [Security.AccessControl.FileSystemRights]::FullControl, $inheritance, [Security.AccessControl.PropagationFlags]::None, [Security.AccessControl.AccessControlType]::Allow)
|
|
40
|
-
$acl.AddAccessRule($rule)
|
|
41
|
-
}
|
|
42
|
-
Set-Acl -LiteralPath $path -AclObject $acl
|
|
43
|
-
$actual = Get-Acl -LiteralPath $path
|
|
44
|
-
if (!$actual.AreAccessRulesProtected) { throw 'Feishu configuration ACL remains inherited' }
|
|
45
|
-
foreach ($rule in $actual.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier])) {
|
|
46
|
-
if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) {
|
|
47
|
-
throw 'Feishu configuration ACL remains shared'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exit 0
|