@yep-ai/cli 1.2.1 → 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 CHANGED
@@ -5,14 +5,14 @@
5
5
  ## 安装与使用
6
6
 
7
7
  ```sh
8
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep --help
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 --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep --help
15
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep device start
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.1.tgz ./dist/cli/unscoped/yep-cli-1.2.1.tgz
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.1.tgz`,入口包为 `unscoped/yep-cli-1.2.1.tgz`。本地验证时可一起指定两份文件,无需从 npm 下载实现包。输出的 `manifest.json` 记录包名、版本、依赖和 SHA-256。
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 --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep login --registry https://yep.nihao.cool
39
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep whoami
40
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep search assistant
41
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep info @creator/demo
42
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep client set codex,claude
43
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep install @creator/demo --client codex
44
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep list
45
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep list --remote
46
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep list --mine
47
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep uninstall @creator/demo --client codex
48
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep publish ./my-skill
49
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep history @creator/demo
50
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep diff @creator/demo --base published
51
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep publish ./my-agent --kind agent
52
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep submit @creator/demo --kind agent
53
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep withdraw @creator/demo --kind agent
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.1.tgz yep withd
60
60
  ## 设备节点
61
61
 
62
62
  ```sh
63
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep device login
64
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep device start "/path/to/documents"
65
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep device status
66
- npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep device logout
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.1.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 --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep`,保留原目录参数。
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.1.tgz yep devic
95
95
 
96
96
  市场凭据保存为 `~/.config/yep/config.json`;设备身份和各源站的授权保存在 `~/.config/yep/devices/`。目录权限 `0700`、凭据文件 `0600`;Windows 使用当前用户专属 ACL。市场和设备令牌分别管理。域名改变后需要在新源站重新登录、配对,不会把旧源站令牌发送到新地址。
97
97
 
98
- 执行 `npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep --help` 或 `npx --yes --package=https://yep.nihao.cool/downloads/yep-cli-1.2.1.tgz yep device --help` 查看全部选项。
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.1)
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
- 本仓库已准备 1.2.1;npm 发布与网站部署完成后,对应远程版本命令才可使用。
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.1 feishu setup --install-service
124
- npx --yes @yep-ai/cli@1.2.1 feishu status
125
- npx --yes @yep-ai/cli@1.2.1 feishu doctor --fix
126
- npx --yes @yep-ai/cli@1.2.1 feishu restart
127
- npx --yes @yep-ai/cli@1.2.1 feishu logs --follow
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` 自动打开平台授权页、飞书官方创建/授权二维码;完成扫码后保存节点专用凭据,启动长连接并检查权限。飞书官方扫码和企业管理员要求的审批需要本人完成。网页「飞书节点」也支持直接托管,关闭浏览器后继续运行。
@@ -132,3 +132,9 @@ npx --yes @yep-ai/cli@1.2.1 feishu logs --follow
132
132
  在网页选择允许的私聊用户、群和回复规则。机器人消息需显式允许发送方机器人,而且必须 @ 本机器人,防止循环回复。群消息只处理白名单群;默认只回复 @ 消息,可选择关键词或群内全部消息(后者需额外权限)。当前支持文本收发、会话上下文、自动回复和消息处理记录,用户画像与知识库暂未接入回复。
133
133
 
134
134
  `doctor --fix` 打开权限修复页并重新检查,不会代替飞书的授权审批。`feishu stop` 停止本机服务,`feishu remove` 撤销节点。系统服务使用当前用户的 systemd / LaunchAgent / Windows 任务计划程序;运行文件、凭据和日志独立保存。完整说明见仓库 `packages/yep-feishu-node/README.md`。
135
+
136
+ ### Windows 配置权限修复(1.2.3)
137
+
138
+ 已有飞书配置目录或文件继承了 Windows 用户目录权限时,CLI 和 Go 服务使用同一套原生 Windows API 限制本人拥有的配置路径,只允许本人、SYSTEM 和 Administrators 访问。仅写入 DACL,保留所有者、主组、审计规则与配置内容,避免 1.2.2 中 `Set-Acl` 触发的 `SeSecurityPrivilege` 错误。此操作不依赖 PowerShell,也无需为修改审计规则提升权限;目录权限传递给子目录与文件,失败时显示 Windows 的具体原因。
139
+
140
+ 从旧版升级后执行 `npx --yes @yep-ai/cli@1.2.3 feishu setup`;不需要删除已有凭据或切换终端。PowerShell 启动配置中的 Docker 报错与飞书节点无关。
@@ -49,32 +49,25 @@ export async function privatePath(location, directory = false) {
49
49
  )
50
50
  throw new Error("飞书配置权限不安全,请设为目录 0700、文件 0600。");
51
51
  if (process.platform === "win32") {
52
- const script =
53
- "$ErrorActionPreference='Stop'; $acl=Get-Acl -LiteralPath $env:YEP_FEISHU_ACL_PATH; if(-not $acl.AreAccessRulesProtected){exit 2}; $sid=[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value; foreach($r in $acl.Access){if($r.AccessControlType -eq 'Allow'){$s=$r.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier]).Value;if($s -ne $sid -and $s -ne 'S-1-5-18' -and $s -ne 'S-1-5-32-544'){exit 3}}}";
54
- await exec(
55
- "powershell.exe",
56
- ["-NoProfile", "-NonInteractive", "-Command", script],
57
- {
58
- env: { ...process.env, YEP_FEISHU_ACL_PATH: location },
52
+ try {
53
+ const args = ["--secure-path", location];
54
+ if (directory) args.push("--directory");
55
+ await exec(await nativeBinary(), args, {
59
56
  windowsHide: true,
60
- },
61
- );
57
+ timeout: 15000,
58
+ });
59
+ } catch (cause) {
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 });
63
+ }
62
64
  }
63
65
  return st;
64
66
  }
65
67
  async function protect(location, directory = false) {
66
68
  if (process.platform !== "win32")
67
69
  return fs.chmod(location, directory ? 0o700 : 0o600);
68
- const script =
69
- "$ErrorActionPreference='Stop';$p=$env:YEP_FEISHU_ACL_PATH;$acl=Get-Acl -LiteralPath $p;$acl.SetAccessRuleProtection($true,$false);$sid=[System.Security.Principal.WindowsIdentity]::GetCurrent().User;$r=New-Object System.Security.AccessControl.FileSystemAccessRule($sid,'FullControl','Allow');$acl.SetAccessRule($r);Set-Acl -LiteralPath $p -AclObject $acl";
70
- await exec(
71
- "powershell.exe",
72
- ["-NoProfile", "-NonInteractive", "-Command", script],
73
- {
74
- env: { ...process.env, YEP_FEISHU_ACL_PATH: location },
75
- windowsHide: true,
76
- },
77
- );
70
+ await privatePath(location, directory);
78
71
  }
79
72
  async function privateWrite(location, value) {
80
73
  const temp = location + "." + randomUUID();
Binary file
Binary file
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "1.2.0",
4
- "sourceSHA256": "219834c05c18424d9caf09b3871c59b69ce556dcf9e8963120493ec7447c9534",
3
+ "version": "1.2.3",
4
+ "sourceSHA256": "dbfcf823a877ef52a63474260fdf7a4f12a02e76242df3929f87f5e907b106f8",
5
5
  "files": {
6
6
  "win32-x64/yep-feishu-node.exe": {
7
- "sha256": "4b3e1c702d983aebd2fddb9686da9b944dfb4a4efc214180c81a19c6d7cd8d5c",
7
+ "sha256": "a867ba4354f22cd6c4e4cd5dcb7e7615057a10cfac0cab7ee8878599a8392a5b",
8
8
  "goos": "windows",
9
9
  "goarch": "amd64"
10
10
  },
11
11
  "win32-arm64/yep-feishu-node.exe": {
12
- "sha256": "402f753d18fb4e09dfd3f440553d2164e3cae85e0eef2aa658872e2732413ec9",
12
+ "sha256": "2487dc77cb575302fe8fd0cc8c31fec0bd106a334041a366acec8ae677b8f420",
13
13
  "goos": "windows",
14
14
  "goarch": "arm64"
15
15
  },
16
16
  "darwin-x64/yep-feishu-node": {
17
- "sha256": "a5f2c64081d8cde42ca5d65a2b783d404c88e02b96e05f59768e3a232a7b71fb",
17
+ "sha256": "dfe1e42744e99fe2cf846c435995174b763917834ef9afc804b0d027522ab834",
18
18
  "goos": "darwin",
19
19
  "goarch": "amd64"
20
20
  },
21
21
  "darwin-arm64/yep-feishu-node": {
22
- "sha256": "994611d04d5e18a8b906b9b4a75d02d8e8381d459c703eb6e98b75514f84ac42",
22
+ "sha256": "ca36eccf1e85b9e0454536b8af8a04f1c04935ba86d63ff845a063ffe2799775",
23
23
  "goos": "darwin",
24
24
  "goarch": "arm64"
25
25
  },
26
26
  "linux-x64/yep-feishu-node": {
27
- "sha256": "86ddf8a4981410cc363d45ab1c9e304b6f1d95ea67903f8c18184cab1d5b8ebe",
27
+ "sha256": "c564f52c7638291884d0dd2abb0900271c816df4b3449f7b98db93894d61c560",
28
28
  "goos": "linux",
29
29
  "goarch": "amd64"
30
30
  },
31
31
  "linux-arm64/yep-feishu-node": {
32
- "sha256": "85cc788a0d07f0bfb1e403a7cdbf5fd7944304469c117b5cbf0c822586b392b9",
32
+ "sha256": "2f4dd9ab86b80e8063b3a5709c072a16aff3b9b3178fe0c6e9970dd5975436ad",
33
33
  "goos": "linux",
34
34
  "goarch": "arm64"
35
35
  }
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yep-ai/cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Yep Marketplace unified CLI: skills, agents, plugins and authorized device nodes.",
5
5
  "type": "module",
6
6
  "bin": {