@tenonai/yew 1.3.0 → 1.4.0
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/CHANGELOG.md +23 -0
- package/README.md +1 -10
- package/dist/cli/app.js +1 -14
- package/dist/cli/main.js +0 -14
- package/dist/cli/send.js +1 -2
- package/dist/cli/service.js +1 -28
- package/dist/server/agent/context.js +2 -3
- package/dist/server/data-usage.js +1 -2
- package/dist/server/db/migrations.js +4 -0
- package/dist/server/http/api.js +3 -0
- package/dist/server/keys.js +5 -24
- package/dist/server/mcp-builtin.js +1 -2
- package/dist/server/paths.js +6 -15
- package/dist/server/settings.js +3 -0
- package/dist/server/skills.js +1 -2
- package/dist/server/tools/mail.js +1 -1
- package/dist/server/tools/registry.js +2 -2
- package/dist/shared/policy.js +3 -3
- package/package.json +1 -1
- package/web/dist/THIRD-PARTY-NOTICES.txt +1 -1
- package/web/dist/assets/index-B9oWPSod.css +1 -0
- package/web/dist/assets/index-C5qBMzFX.js +68 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-BtK_SzpF.css +0 -1
- package/web/dist/assets/index-C0rnUFI-.js +0 -68
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录 Yew(原名 Jig)各版本中用户能感知的变化。格式参照 [Keep a Changelog 1.1.0](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循[语义化版本 2.0.0](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [1.4.0] - 2026-11-18
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
|
|
9
|
+
- 侧栏底部站着吉祥物,旁边的气泡说眼下最要紧的一件事:几件事等你处理、哪个会话出错了或做完了等你核对、哪些会话在干活。说的是一件事或一个会话时,点气泡直接过去。刚打开时她先问候,夜里没事时打瞌睡。
|
|
10
|
+
- 打开 Yew 时有一秒左右的开场:标志画出来,吉祥物招手,下面列出连接、读取设置、会话和审批中心这几步。点一下或按任意键跳过;系统设了减少动态效果时不播。
|
|
11
|
+
- 会话和首页的背后多了一个很淡的「Yew」字标。
|
|
12
|
+
- 设置菜单里多了「吉祥物」,可以把侧栏的吉祥物和开场一起关掉。
|
|
13
|
+
|
|
14
|
+
### 变更
|
|
15
|
+
|
|
16
|
+
- 隐私政策和用户协议更新到 2.5:删去第 5 段末尾从 Jig 升级要删的数据那一句,Yew 不再碰 Jig 的数据。
|
|
17
|
+
|
|
18
|
+
### 移除
|
|
19
|
+
|
|
20
|
+
- Yew 不再认 Jig 的东西:不再把 `~/.jig` 搬到 `~/.yew`,不再从钥匙串里 Jig 的位置搬 Key,不再认 `JIG_HOME` 这类环境变量,不再替换 Jig 装的开机启动和启动图标,项目里的 `.jig/skills` 也不再读。还没从 Jig 换过来的,装好 Yew 后用 `yew key set` 重新填 Key,需要的话再运行 `yew service install`、`yew app install`。
|
|
21
|
+
|
|
22
|
+
### 修复
|
|
23
|
+
|
|
24
|
+
- 会话请你授权「管理 Yew」时,授权卡片上显示的是工具的内部名,现在显示「管理 Yew」。
|
|
25
|
+
- 技能设置里列的读取位置漏了项目里的 `.yew/skills`。
|
|
26
|
+
- 随包的第三方许可声明开头写的还是 Jig。
|
|
27
|
+
|
|
5
28
|
## [1.3.0] - 2026-11-18
|
|
6
29
|
|
|
7
30
|
### 新增
|
package/README.md
CHANGED
|
@@ -19,20 +19,11 @@ Yew 以 MIT 许可证开源,当前版本 1.3.0。能做什么见[更新记录]
|
|
|
19
19
|
|
|
20
20
|
从源码运行:克隆仓库后 `npm install`、`npm run build:web`、`npm link`。
|
|
21
21
|
|
|
22
|
-
### 从 Jig 升级
|
|
23
|
-
|
|
24
|
-
Yew 原名 Jig,2026-11-18 改名。从 Jig 升级:
|
|
25
|
-
|
|
26
|
-
1. 停掉正在运行的 Jig,换装新包:`npm uninstall -g @tenonai/jig`,再 `npm install -g @tenonai/yew`。命令改叫 `yew`。
|
|
27
|
-
2. 第一次运行 `yew` 时,数据目录 `~/.jig` 会搬到 `~/.yew`,原处留一个指向新目录的链接;API Key 第一次用到时从钥匙串里旧的位置搬过来。环境变量改叫 `YEW_HOME` 这类名字,旧的 `JIG_HOME` 这类仍然认。
|
|
28
|
-
3. 设过开机启动或启动图标的,各运行一次 `yew service install`、`yew app install`,换成 Yew 的,旧的 Jig 那份会一起撤掉。
|
|
29
|
-
4. 手机上的 Yew 是新的应用,要重新安装并重新配对;手机上原来的 Jig 应用连不上 Yew,可以卸掉。
|
|
30
|
-
|
|
31
22
|
## 手机端
|
|
32
23
|
|
|
33
24
|
手机上的 Yew 只连接你自己电脑上的 Yew:在电脑上显示二维码,手机扫码配对,之后在手机上看会话、处理审批中心里的事。两端经中继通信,内容端到端加密;默认用 Tenon AI 运行的中继,也可以自己部署(见 `relay/`)。
|
|
34
25
|
|
|
35
|
-
- 安卓:安装包(apk)在 [GitHub](https://github.com/dozybot001/Yew/releases) 和 [Gitee](https://gitee.com/dozybot/yew/releases) 的 Releases 里,由长沙榫卯人工智能科技有限公司签名。签名证书的 SHA-256 指纹是 `9F:F5:6E:EA:A8:3C:DC:01:BA:66:D8:79:23:9C:DE:5A:2A:69:C3:AE:D2:60:5C:D8:E1:B9:34:8D:BF:28:61:B2
|
|
26
|
+
- 安卓:安装包(apk)在 [GitHub](https://github.com/dozybot001/Yew/releases) 和 [Gitee](https://gitee.com/dozybot/yew/releases) 的 Releases 里,由长沙榫卯人工智能科技有限公司签名。签名证书的 SHA-256 指纹是 `9F:F5:6E:EA:A8:3C:DC:01:BA:66:D8:79:23:9C:DE:5A:2A:69:C3:AE:D2:60:5C:D8:E1:B9:34:8D:BF:28:61:B2`;这个指纹也公布在[官网的 Yew 页面](https://tenonai.cn/zh/products/yew/#android)上,可以对照;每个版本的说明里有安装包的 SHA-256。更新时系统如果提示签名不一致,不要安装。
|
|
36
27
|
- iPhone:还没有上架,之后经 TestFlight 和 App Store 发布。
|
|
37
28
|
|
|
38
29
|
## 隐私
|
package/dist/cli/app.js
CHANGED
|
@@ -4,7 +4,6 @@ import { homedir, tmpdir } from "node:os";
|
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { parseArgs } from "node:util";
|
|
7
|
-
import { fromJigEnv, JIG_APP, JIG_LAUNCHER } from "../server/from-jig.js";
|
|
8
7
|
import { VERSION } from "../shared/version.js";
|
|
9
8
|
import { EXIT_ERROR, EXIT_OK, UsageError } from "./io.js";
|
|
10
9
|
const HELP = `Usage: yew app <install|uninstall|status> [options]
|
|
@@ -98,24 +97,13 @@ exit 1
|
|
|
98
97
|
const SIZES = [16, 32, 128, 256, 512];
|
|
99
98
|
/** Where the launcher goes: the person's own Applications folder. */
|
|
100
99
|
export const appPath = (host) => join(host.homeDir, "Applications", "Yew.app");
|
|
101
|
-
/**
|
|
102
|
-
* Jig's launcher, from before Jig was renamed Yew: taken away when Yew's is made or removed. Only when
|
|
103
|
-
* it is the one Jig made, by the executable it has.
|
|
104
|
-
*/
|
|
105
|
-
function removeJigApp(host) {
|
|
106
|
-
const old = join(host.homeDir, "Applications", JIG_APP);
|
|
107
|
-
if (existsSync(join(old, "Contents", "MacOS", JIG_LAUNCHER))) {
|
|
108
|
-
rmSync(old, { recursive: true, force: true });
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
100
|
export const appInstalled = (host) => existsSync(join(appPath(host), "Contents", "MacOS", "yew-launcher"));
|
|
112
101
|
/** Makes Yew.app; returns whether its icon could be made (the app works without it). */
|
|
113
102
|
export function installApp(host, home, env) {
|
|
114
103
|
const app = appPath(host);
|
|
115
|
-
removeJigApp(host);
|
|
116
104
|
// Sessions' commands need your PATH; an app starts with a bare one.
|
|
117
105
|
const vars = { PATH: env.PATH ?? "/usr/bin:/bin" };
|
|
118
|
-
if (
|
|
106
|
+
if (env.YEW_HOME)
|
|
119
107
|
vars.YEW_HOME = home;
|
|
120
108
|
rmSync(app, { recursive: true, force: true });
|
|
121
109
|
const contents = join(app, "Contents");
|
|
@@ -156,7 +144,6 @@ export function installApp(host, home, env) {
|
|
|
156
144
|
}
|
|
157
145
|
export function uninstallApp(host) {
|
|
158
146
|
rmSync(appPath(host), { recursive: true, force: true });
|
|
159
|
-
removeJigApp(host);
|
|
160
147
|
}
|
|
161
148
|
export function appCommand(host = realAppHost()) {
|
|
162
149
|
return {
|
package/dist/cli/main.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { moveJigHome } from "../server/from-jig.js";
|
|
3
2
|
import { appCommand } from "./app.js";
|
|
4
3
|
import { exportCommand } from "./export.js";
|
|
5
4
|
import { keyCommand } from "./key.js";
|
|
@@ -42,17 +41,4 @@ const commands = [
|
|
|
42
41
|
};
|
|
43
42
|
}),
|
|
44
43
|
];
|
|
45
|
-
// Jig is now Yew: its data folder moves the first time Yew runs (blueprint, section 12).
|
|
46
|
-
try {
|
|
47
|
-
const move = moveJigHome(process.env);
|
|
48
|
-
if (move && "moved" in move) {
|
|
49
|
-
process.stderr.write(`yew: Jig is now Yew. Moved its data folder ${move.moved} to ${move.to} and left a link in its place.\n`);
|
|
50
|
-
}
|
|
51
|
-
else if (move && "busy" in move) {
|
|
52
|
-
process.stderr.write(`yew: Jig is still running from ${move.folder} (process ${move.busy}). Stop it, then start Yew again to move its data; until then Yew uses ${move.folder}.\n`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
process.stderr.write(`yew: could not move Jig's data folder: ${error.message}\n`);
|
|
57
|
-
}
|
|
58
44
|
process.exitCode = await run(process.argv.slice(2), { stdout: process.stdout, stderr: process.stderr, stdin: process.stdin, env: process.env }, commands);
|
package/dist/cli/send.js
CHANGED
|
@@ -73,8 +73,7 @@ export function sendCommand() {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
// Inside a session's shell the letter is that session's, with its quota, limits and hold.
|
|
76
|
-
const
|
|
77
|
-
const fromId = fromJigEnv(io.env, "SESSION")?.trim();
|
|
76
|
+
const fromId = io.env.YEW_SESSION?.trim();
|
|
78
77
|
let sender = { kind: "cli" };
|
|
79
78
|
if (fromId) {
|
|
80
79
|
try {
|
package/dist/cli/service.js
CHANGED
|
@@ -4,7 +4,6 @@ import { homedir, userInfo } from "node:os";
|
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { parseArgs } from "node:util";
|
|
7
|
-
import { fromJigEnv, JIG_SERVICE_LABEL, JIG_SERVICE_UNIT } from "../server/from-jig.js";
|
|
8
7
|
import { EXIT_ERROR, EXIT_OK, UsageError } from "./io.js";
|
|
9
8
|
import { serviceRunning } from "./serve.js";
|
|
10
9
|
const HELP = `Usage: yew service <install|uninstall|status> [options]
|
|
@@ -25,9 +24,6 @@ Options:
|
|
|
25
24
|
-h, --help Show this help
|
|
26
25
|
`;
|
|
27
26
|
export const SERVICE_LABEL = "cn.tenonai.apps.yew";
|
|
28
|
-
/** Jig's, Yew's earlier name (from-jig.ts): installing or removing Yew's takes it away. */
|
|
29
|
-
const JIG_LABEL = JIG_SERVICE_LABEL;
|
|
30
|
-
const JIG_UNIT = JIG_SERVICE_UNIT;
|
|
31
27
|
const UNIT = "yew.service";
|
|
32
28
|
export function realServiceHost() {
|
|
33
29
|
return {
|
|
@@ -112,27 +108,6 @@ export function serviceFile(host) {
|
|
|
112
108
|
throw new Error("yew service works on macOS and Linux.");
|
|
113
109
|
}
|
|
114
110
|
const target = (host) => `gui/${host.uid}/${SERVICE_LABEL}`;
|
|
115
|
-
/**
|
|
116
|
-
* Jig's login service, from before Jig was renamed Yew: stopped and removed when Yew's is installed
|
|
117
|
-
* or removed, so the two never both start.
|
|
118
|
-
*/
|
|
119
|
-
function removeJigService(host) {
|
|
120
|
-
if (host.platform === "darwin") {
|
|
121
|
-
const file = join(host.homeDir, "Library", "LaunchAgents", `${JIG_LABEL}.plist`);
|
|
122
|
-
if (!existsSync(file))
|
|
123
|
-
return;
|
|
124
|
-
host.run("launchctl", ["bootout", `gui/${host.uid}/${JIG_LABEL}`]);
|
|
125
|
-
rmSync(file, { force: true });
|
|
126
|
-
}
|
|
127
|
-
else if (host.platform === "linux") {
|
|
128
|
-
const file = join(host.homeDir, ".config", "systemd", "user", JIG_UNIT);
|
|
129
|
-
if (!existsSync(file))
|
|
130
|
-
return;
|
|
131
|
-
host.run("systemctl", ["--user", "disable", "--now", JIG_UNIT]);
|
|
132
|
-
rmSync(file, { force: true });
|
|
133
|
-
host.run("systemctl", ["--user", "daemon-reload"]);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
111
|
/** The service file is there and the system has it loaded (macOS) or enabled (Linux). */
|
|
137
112
|
export function serviceLoaded(host) {
|
|
138
113
|
return (existsSync(serviceFile(host)) &&
|
|
@@ -159,11 +134,10 @@ export function installService(host, home, env, options) {
|
|
|
159
134
|
const file = serviceFile(host);
|
|
160
135
|
const mac = host.platform === "darwin";
|
|
161
136
|
const log = join(home, "logs", "serve.log");
|
|
162
|
-
removeJigService(host);
|
|
163
137
|
mkdirSync(join(home, "logs"), { recursive: true, mode: 0o700 });
|
|
164
138
|
// Shell commands the sessions run need your PATH; launchd and systemd start with a bare one.
|
|
165
139
|
const vars = { PATH: env.PATH ?? "/usr/bin:/bin" };
|
|
166
|
-
if (
|
|
140
|
+
if (env.YEW_HOME)
|
|
167
141
|
vars.YEW_HOME = home;
|
|
168
142
|
mkdirSync(dirname(file), { recursive: true });
|
|
169
143
|
writeFileSync(file, mac ? launchAgent(host, vars, log) : systemdUnit(host, vars, log), {
|
|
@@ -192,7 +166,6 @@ export function uninstallService(host, options) {
|
|
|
192
166
|
const file = serviceFile(host);
|
|
193
167
|
const mac = host.platform === "darwin";
|
|
194
168
|
const had = existsSync(file);
|
|
195
|
-
removeJigService(host);
|
|
196
169
|
if (mac) {
|
|
197
170
|
if (options.stop)
|
|
198
171
|
host.run("launchctl", ["bootout", target(host)]);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { messageText } from "../../shared/messages.js";
|
|
2
|
-
import { isJigNote } from "../from-jig.js";
|
|
3
2
|
export const SUMMARY_HEADING = "[Summary of the earlier conversation, written by Yew when it shortened the context]";
|
|
4
3
|
export const REQUEST_HEADING = "[The latest message to you before that summary, word for word; it is still what you are working on]";
|
|
5
4
|
/** What Yew puts in front of its own messages to the model, which are stored like the person's. */
|
|
6
5
|
export const YEW_NOTE = "[From Yew, not from the person]";
|
|
7
|
-
/** Whether a stored message is one of Yew's own notes
|
|
8
|
-
export const isOwnNote = (text) => text.startsWith(YEW_NOTE)
|
|
6
|
+
/** Whether a stored message is one of Yew's own notes. */
|
|
7
|
+
export const isOwnNote = (text) => text.startsWith(YEW_NOTE);
|
|
9
8
|
function placeholder(call, timestamp) {
|
|
10
9
|
return {
|
|
11
10
|
role: "toolResult",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { lstatSync, readdirSync, realpathSync, rmdirSync, unlinkSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { conflict } from "./errors.js";
|
|
4
|
-
|
|
5
|
-
const DATABASE_FILES = new Set(["yew.db", "yew.db-wal", "yew.db-shm", ...JIG_DATABASE_FILES]);
|
|
4
|
+
const DATABASE_FILES = new Set(["yew.db", "yew.db-wal", "yew.db-shm"]);
|
|
6
5
|
const FOLDERS = { artifacts: "artifacts", logs: "logs", tmp: "temp" };
|
|
7
6
|
function entries(dir) {
|
|
8
7
|
try {
|
|
@@ -340,4 +340,8 @@ UPDATE approvals SET request = replace(replace(request, '"tool":"manage_jig"', '
|
|
|
340
340
|
UPDATE sessions SET rules = replace(rules, '"tool":"manage_jig"', '"tool":"manage_yew"')
|
|
341
341
|
WHERE rules LIKE '%manage_jig%';
|
|
342
342
|
DELETE FROM session_events;`,
|
|
343
|
+
// Yew no longer reads anything by Jig's names: Jig's notes in old conversations are rewritten once
|
|
344
|
+
// as Yew's, so they still count as Yew's own words and not the person's.
|
|
345
|
+
`UPDATE messages SET body = replace(body, '[From Jig, not from the person]', '[From Yew, not from the person]')
|
|
346
|
+
WHERE body LIKE '%[From Jig, not from the person]%';`,
|
|
343
347
|
];
|
package/dist/server/http/api.js
CHANGED
|
@@ -359,6 +359,9 @@ export function api(deps) {
|
|
|
359
359
|
const language = optEnum(fields, "language", ["system", "zh", "en"]);
|
|
360
360
|
if (language)
|
|
361
361
|
store.setSetting("language", language);
|
|
362
|
+
const mascot = optBoolean(fields, "mascot");
|
|
363
|
+
if (mascot !== undefined)
|
|
364
|
+
store.setSetting("mascot", mascot);
|
|
362
365
|
const workspaces = optArray(fields, "workspaces");
|
|
363
366
|
if (workspaces) {
|
|
364
367
|
store.setSetting("workspaces", parseWorkspaces(workspaces, readSettings(store).workspaces));
|
package/dist/server/keys.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { AsyncEntry } from "@napi-rs/keyring";
|
|
2
|
-
import { fromJigEnv, JIG_KEYCHAIN_SERVICE } from "./from-jig.js";
|
|
3
2
|
export const KEYCHAIN_SERVICE = "cn.tenonai.yew";
|
|
4
|
-
/** Where Jig, Yew's earlier name, kept them; a key found there moves over when first read. */
|
|
5
|
-
const JIG_SERVICE = JIG_KEYCHAIN_SERVICE;
|
|
6
3
|
/** The operating system keychain (macOS Keychain, Windows Credential Manager, Secret Service). */
|
|
7
4
|
export class KeychainStore {
|
|
8
5
|
#prefix;
|
|
@@ -10,35 +7,19 @@ export class KeychainStore {
|
|
|
10
7
|
constructor(prefix = "provider") {
|
|
11
8
|
this.#prefix = prefix;
|
|
12
9
|
}
|
|
13
|
-
#entry(name
|
|
14
|
-
return new AsyncEntry(
|
|
10
|
+
#entry(name) {
|
|
11
|
+
return new AsyncEntry(KEYCHAIN_SERVICE, `${this.#prefix}:${name}`);
|
|
15
12
|
}
|
|
16
13
|
async get(provider) {
|
|
17
|
-
|
|
18
|
-
if (key !== null && key !== undefined)
|
|
19
|
-
return key;
|
|
20
|
-
const old = this.#entry(provider, JIG_SERVICE);
|
|
21
|
-
const kept = await old.getPassword().catch(() => null);
|
|
22
|
-
if (kept === null || kept === undefined)
|
|
23
|
-
return null;
|
|
24
|
-
await this.#entry(provider).setPassword(kept);
|
|
25
|
-
await old.deleteCredential().catch(() => false);
|
|
26
|
-
return kept;
|
|
14
|
+
return (await this.#entry(provider).getPassword()) ?? null;
|
|
27
15
|
}
|
|
28
16
|
async set(provider, key) {
|
|
29
17
|
await this.#entry(provider).setPassword(key);
|
|
30
|
-
await this.#entry(provider, JIG_SERVICE)
|
|
31
|
-
.deleteCredential()
|
|
32
|
-
.catch(() => false);
|
|
33
18
|
}
|
|
34
19
|
async delete(provider) {
|
|
35
|
-
|
|
36
|
-
.deleteCredential()
|
|
37
|
-
.catch(() => false);
|
|
38
|
-
const hadOld = await this.#entry(provider, JIG_SERVICE)
|
|
20
|
+
return await this.#entry(provider)
|
|
39
21
|
.deleteCredential()
|
|
40
22
|
.catch(() => false);
|
|
41
|
-
return had || hadOld;
|
|
42
23
|
}
|
|
43
24
|
}
|
|
44
25
|
/**
|
|
@@ -48,7 +29,7 @@ export class KeychainStore {
|
|
|
48
29
|
* with them. With the switch off it starts with no keys and forgets what is saved when it stops.
|
|
49
30
|
*/
|
|
50
31
|
export function systemKeys(prefix = "provider", env = process.env) {
|
|
51
|
-
const off =
|
|
32
|
+
const off = env.YEW_KEYCHAIN === "off";
|
|
52
33
|
return off ? new MemoryKeyStore() : new KeychainStore(prefix);
|
|
53
34
|
}
|
|
54
35
|
/** For tests: keeps keys in memory. */
|
|
@@ -3,7 +3,6 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { fromJigEnv } from "./from-jig.js";
|
|
7
6
|
/**
|
|
8
7
|
* The MCP servers Yew sets up by itself (blueprint 6.10, item 38): a browser and control of this
|
|
9
8
|
* computer. Yew does not build these in; it runs two open-source servers.
|
|
@@ -54,7 +53,7 @@ export function presetMcp(yewHome, id) {
|
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
55
|
export function builtinMcp(yewHome, env = process.env) {
|
|
57
|
-
if (
|
|
56
|
+
if (env.YEW_MCP_BUILTIN === "off")
|
|
58
57
|
return {};
|
|
59
58
|
const modules = join(installDir(yewHome), "node_modules");
|
|
60
59
|
return {
|
package/dist/server/paths.js
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdirSync, realpathSync, statSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { isAbsolute, join, resolve } from "node:path";
|
|
4
4
|
import { invalid } from "./errors.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Yew's data directory: `YEW_HOME` when set, otherwise `~/.yew`. A folder from Jig, Yew's earlier
|
|
8
|
-
* name, counts until it has moved (from-jig.ts).
|
|
9
|
-
*/
|
|
5
|
+
/** Yew's data directory: `YEW_HOME` when set, otherwise `~/.yew`. */
|
|
10
6
|
export function yewHome(env = process.env, user = homedir()) {
|
|
11
|
-
const custom =
|
|
12
|
-
|
|
13
|
-
return resolve(custom);
|
|
14
|
-
const home = join(user, ".yew");
|
|
15
|
-
return unmovedJigHome(home, user) ?? home;
|
|
7
|
+
const custom = env.YEW_HOME;
|
|
8
|
+
return custom ? resolve(custom) : join(user, ".yew");
|
|
16
9
|
}
|
|
17
10
|
/** Creates the data directory readable only by the current user. */
|
|
18
11
|
export function ensureDir(path) {
|
|
19
12
|
mkdirSync(path, { recursive: true, mode: 0o700 });
|
|
20
13
|
return path;
|
|
21
14
|
}
|
|
22
|
-
/** The database file
|
|
15
|
+
/** The database file. */
|
|
23
16
|
export function dbPath(home) {
|
|
24
|
-
|
|
25
|
-
const jig = join(home, JIG_DATABASE);
|
|
26
|
-
return !existsSync(yew) && existsSync(jig) ? jig : yew;
|
|
17
|
+
return join(home, "yew.db");
|
|
27
18
|
}
|
|
28
19
|
/** Resolves `~`, requires an existing folder and stores its real path, so permission checks compare like with like. */
|
|
29
20
|
export function resolveWorkingFolder(path) {
|
package/dist/server/settings.js
CHANGED
|
@@ -31,6 +31,8 @@ export const SETTING_DEFAULTS = {
|
|
|
31
31
|
notify: { waiting: true, error: true, task: true, budget: true },
|
|
32
32
|
/** Skills switched off in the settings, each by its folder's real path (blueprint 6.10, item 35). */
|
|
33
33
|
disabledSkills: [],
|
|
34
|
+
/** The mascot at the foot of the sidebar and the opening animation (blueprint, section 12). */
|
|
35
|
+
mascot: true,
|
|
34
36
|
};
|
|
35
37
|
export function readSettings(store) {
|
|
36
38
|
const workspaces = store.getSetting("workspaces", SETTING_DEFAULTS.workspaces);
|
|
@@ -52,6 +54,7 @@ export function readSettings(store) {
|
|
|
52
54
|
: null,
|
|
53
55
|
notify: { ...SETTING_DEFAULTS.notify, ...store.getSetting("notify", SETTING_DEFAULTS.notify) },
|
|
54
56
|
disabledSkills: store.getSetting("disabledSkills", SETTING_DEFAULTS.disabledSkills),
|
|
57
|
+
mascot: store.getSetting("mascot", SETTING_DEFAULTS.mascot),
|
|
55
58
|
};
|
|
56
59
|
}
|
|
57
60
|
/** The decision log must be a Markdown file in an existing folder; `~` is expanded. */
|
package/dist/server/skills.js
CHANGED
|
@@ -2,7 +2,6 @@ import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "n
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { basename, isAbsolute, join } from "node:path";
|
|
4
4
|
import { invalid } from "./errors.js";
|
|
5
|
-
import { JIG_PROJECT_FOLDER } from "./from-jig.js";
|
|
6
5
|
import { errorResult, str, text } from "./tools/types.js";
|
|
7
6
|
const MAX_SKILLS = 200;
|
|
8
7
|
const MAX_SKILL_CHARS = 60_000;
|
|
@@ -102,7 +101,7 @@ export function skillFolders(cwd, yewHome, userHome = homedir()) {
|
|
|
102
101
|
if (userHome)
|
|
103
102
|
folders.push(join(userHome, ".claude", "skills"));
|
|
104
103
|
if (cwd) {
|
|
105
|
-
for (const local of [".agents", ".claude", ".yew"
|
|
104
|
+
for (const local of [".agents", ".claude", ".yew"])
|
|
106
105
|
folders.push(join(cwd, local, "skills"));
|
|
107
106
|
}
|
|
108
107
|
return folders;
|
|
@@ -294,7 +294,7 @@ const TEXT = { type: "string" };
|
|
|
294
294
|
* manage_yew: the model changes Yew itself (blueprint 6.2, item 10). One call, all changes; Yew plans it
|
|
295
295
|
* to rank how far it reaches and to show the person every change, then applies all or none.
|
|
296
296
|
*/
|
|
297
|
-
export const
|
|
297
|
+
export const manageYewTool = {
|
|
298
298
|
name: "manage_yew",
|
|
299
299
|
description: "Change Yew itself when the person asks or the work needs it: sessions (create a standing one, or change its name, team, role, model, working folder, permission mode, how it receives letters, letter quota, rights, pinned, archived), teams, scheduled tasks, and settings. Put every change in one call; Yew checks them, asks the person when a change needs it, and applies all or none. Sessions, teams and tasks are named by name or id. API keys, pairing and deleting data are the person's.",
|
|
300
300
|
parameters: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { editTool, readTool, writeTool } from "./files.js";
|
|
2
|
-
import { checkDecisionTool, finishTaskTool, listCardsTool, listSessionsTool,
|
|
2
|
+
import { checkDecisionTool, finishTaskTool, listCardsTool, listSessionsTool, manageYewTool, openSessionTool, postCardTool, sendLetterTool, updateCardTool, withdrawCardTool, } from "./mail.js";
|
|
3
3
|
import { askUserTool, delegateTool, todoTool } from "./misc.js";
|
|
4
4
|
import { globTool, grepTool } from "./search.js";
|
|
5
5
|
import { shellJobTool, shellTool } from "./shell.js";
|
|
@@ -20,7 +20,7 @@ export const ALL_TOOLS = [
|
|
|
20
20
|
checkDecisionTool,
|
|
21
21
|
openSessionTool,
|
|
22
22
|
finishTaskTool,
|
|
23
|
-
|
|
23
|
+
manageYewTool,
|
|
24
24
|
postCardTool,
|
|
25
25
|
updateCardTool,
|
|
26
26
|
withdrawCardTool,
|
package/dist/shared/policy.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The iPhone app carries the same paragraphs in its string catalog; test/ios.test.ts keeps them equal.
|
|
4
4
|
* A change raises the version and the date; earlier versions stay in Git.
|
|
5
5
|
*/
|
|
6
|
-
export const POLICY_VERSION = "2.
|
|
6
|
+
export const POLICY_VERSION = "2.5";
|
|
7
7
|
export const POLICY = {
|
|
8
8
|
zh: {
|
|
9
9
|
date: "2026 年 11 月 18 日",
|
|
@@ -12,7 +12,7 @@ export const POLICY = {
|
|
|
12
12
|
"保存在你电脑上的数据:会话、消息、工具调用记录、操作授权、会话之间的信件、你在审批中心做的决定、定时任务和设置存在 Yew 的数据目录(默认 ~/.yew)里的数据库中;服务商的 API Key,以及你在浏览器里登录 MCP 服务得到的访问令牌、刷新令牌和 Yew 为它注册的客户端,存在系统钥匙串里;MCP 服务的配置写在数据目录的 mcp.json 里,包括你填的密钥和你自己建的 Google 客户端的 ID 和密钥;超长的命令输出存在数据目录的 tmp 文件夹里;会话存下的产物(文档、页面、数据和图表)的各个版本存在数据目录的 artifacts 文件夹里。Yew 自带浏览器的资料(你在这个浏览器里登录过的网站的 Cookie、缓存和浏览记录)存在数据目录的 browser 文件夹里。用 yew service 设了开机启动时,运行日志(启动、出错和连接中继的记录,不含对话内容)存在数据目录的 logs 文件夹里。这些数据一直保存,直到你删除。你在设置里指定了审批记录文件时,Yew 把每个决定追加到那个文件里。",
|
|
13
13
|
"手机访问:你在电脑上打开「允许手机访问」后,电脑上的 Yew 连接中继服务,手机上的 Yew 经中继和它通信。默认的中继由榫卯 Tenon AI 运行,你也可以自己部署。两端之间端到端加密,中继只转发密文,看不到也不保存内容。榫卯 Tenon AI 运行的中继为保障网络安全记录连接日志:时间、IP 地址、请求的路径(其中有你电脑的标识,是它公钥的哈希)和状态,不含内容,保存 184 天后自动删除。中继服务器位于中国境内。电脑上的 Yew 记下配对的手机:名称、公钥、配对时间和最近连接的时间。iPhone 上的 Yew 把配对信息和自己的密钥存在 iOS 钥匙串里,只存在这台设备上。打开通知后,iPhone 把 Apple 给它的推送令牌经加密通道交给你的电脑保存;电脑把通知的内容为这台 iPhone 加密,经中继交给 Apple 的推送服务。中继和 Apple 经手推送令牌和密文,看不到通知的内容。安卓上的 Yew 把配对信息和自己的密钥存在应用的私有文件里,用 Android 密钥库里的密钥加密,只存在这台设备上,不进系统备份和换机传输。安卓上的 Yew 不使用推送服务,也没有推送令牌:打开通知后,它用一个前台服务在后台保持到中继的连接,电脑经端到端加密的通道把通知的内容发给手机,中继只转发密文;系统会为这条连接显示一条常驻通知,系统停掉 Yew 时收不到通知。扫描配对二维码时用到相机,画面只在手机上识别,不保存也不发出。手机上另记着通知的开关和已经看到的待办的编号,不含内容。",
|
|
14
14
|
"发给第三方的数据:你为会话选的模型服务商会收到发给它的对话内容,包括会话读到的文件、命令输出、MCP 工具返回的内容(比如你连接的邮箱、日历和云端硬盘里的邮件、日程和文件),以及会话使用浏览器和电脑操控工具时取得的网页内容和屏幕截图;屏幕截图会拍下当时屏幕上显示的内容,包括其他应用的窗口,这部分适用该服务商的隐私政策。默认服务商 DeepSeek 由中国公司深度求索提供,内容怎样处理和存放以它的隐私政策为准;你选境外服务商时,这些内容会发往境外。会话抓取网页或用自带浏览器打开网页时,网站会收到请求;在自带浏览器里登录过的网站,会收到带着你登录状态的请求。你配了搜索服务的密钥后,会话联网搜索时,这家搜索服务会收到查询词,适用该搜索服务的隐私政策;选境外的搜索服务(Tavily、Brave)时,查询词会发往境外。Yew 默认启动两个开源的 MCP 服务:浏览器(微软的 Playwright MCP)和电脑操控(computer-use-mcp),它们在你的电脑上运行,可以在设置里停用。这两个服务,以及你一键添加的、要在本机运行的常用服务,Yew 第一次使用时从 npm 下载安装,npm 会收到下载请求。你添加的 MCP 服务(写在 mcp.json 里)会收到会话调用它的工具时传的内容;你在浏览器里登录过的服务,会收到以你的账号发出的请求。这些服务适用各自的隐私政策;选境外的服务(比如 Google、Linear、Vercel)时,传给它的内容会发往境外。这些工具每次调用都先问你,你对某个工具选了「总是允许」后不再问;电脑操控的点击、输入和按键,以及 Yew 认出会发送、发布或删除东西的 MCP 工具,不能选「总是允许」,每次都问。",
|
|
15
|
-
"查询、导出与删除:你可以直接查看数据目录里的文件。删除某个服务商的 Key:在设置里删除,或运行 yew key delete;删除配对的手机:在电脑上的「手机访问」里移除,或在手机上断开配对;退出 MCP 服务的登录:在「MCP 服务」里点「退出登录」,服务支持时 Yew 先请它作废令牌,再删除本机保存的令牌;要确认授权已经撤销,到该服务的账号设置里查看或移除;删除自带浏览器的登录状态:删除数据目录的 browser 文件夹;删除全部数据:停掉 yew serve
|
|
15
|
+
"查询、导出与删除:你可以直接查看数据目录里的文件。删除某个服务商的 Key:在设置里删除,或运行 yew key delete;删除配对的手机:在电脑上的「手机访问」里移除,或在手机上断开配对;退出 MCP 服务的登录:在「MCP 服务」里点「退出登录」,服务支持时 Yew 先请它作废令牌,再删除本机保存的令牌;要确认授权已经撤销,到该服务的账号设置里查看或移除;删除自带浏览器的登录状态:删除数据目录的 browser 文件夹;删除全部数据:停掉 yew serve 后删除数据目录。",
|
|
16
16
|
"联系我们:support@tenonai.cn。",
|
|
17
17
|
],
|
|
18
18
|
terms: [
|
|
@@ -29,7 +29,7 @@ export const POLICY = {
|
|
|
29
29
|
"Data kept on your computer: sessions, messages, tool call records, permissions you granted, letters between sessions, the decisions you make in the approval center, scheduled tasks and settings are stored in a database in Yew's data folder (~/.yew by default); provider API keys, and the access tokens, refresh tokens and client registrations Yew gets when you sign in to an MCP server in your browser, are stored in the system keychain; MCP server settings are kept in mcp.json in the data folder, including keys you enter and the ID and secret of a Google client you created yourself; very long command output is stored in the tmp folder of the data folder; every version of the artifacts sessions save (documents, pages, data and charts) is stored in its artifacts folder. The profile of Yew's built-in browser (cookies, cache and history of the sites you signed in to there) is stored in the browser folder of the data folder. When you set Yew to start at login with yew service, its service log (start-up, errors and relay connection lines, without conversation content) is stored in the logs folder of the data folder. This data stays until you delete it. If you set a decision log file in Settings, Yew adds each decision to that file.",
|
|
30
30
|
"Phone access: when you turn on phone access on your computer, Yew on the computer connects to a relay, and Yew on your phone talks to it through the relay. The default relay is run by Tenon AI; you can also run your own. The two ends are encrypted end to end: the relay only passes ciphertext along and can neither read nor keep the content. For network security, the relay run by Tenon AI keeps a connection log: the time, the IP address, the path requested (which carries your computer's identifier, a hash of its public key) and the status, without content, deleted automatically after 184 days. The relay server is in mainland China. Yew on the computer records each paired phone: its name, public key, when it was paired and when it last connected. Yew on iPhone keeps the pairing and its own key in the iOS keychain, on that device only. With notifications on, Yew on iPhone gives the push token it got from Apple to your computer over the encrypted channel, and the computer keeps it; the computer encrypts what a notification says for that iPhone and hands it to Apple's push service through the relay. The relay and Apple handle the push token and the ciphertext, and cannot read what the notification says. Yew on Android keeps the pairing and its own key in a private file of the app, encrypted with a key in the Android Keystore, on that device only; it is left out of system backups and device transfers. Yew on Android uses no push service and has no push token: with notifications on, a foreground service keeps a connection to the relay open in the background, and the computer sends what a notification says to the phone over the end-to-end encrypted channel; the relay only passes ciphertext along. Android shows a standing notification for this connection, and notifications do not arrive while the system has stopped Yew. Scanning the pairing QR code uses the camera; the picture is read on the phone and is neither kept nor sent. The phone also remembers whether notifications are on and the ids of the items it has already seen, without their content.",
|
|
31
31
|
"Data sent to third parties: the model provider you choose for a session receives the conversation sent to it, including files the session read, command output, what MCP tools return (such as the emails, events and files in a mailbox, calendar or drive you connected), and the page content and screenshots a session obtains when it uses the browser and computer control tools; a screenshot captures whatever is on the screen at that moment, including other apps' windows; that provider's privacy policy applies. The default provider, DeepSeek, is a service of the Chinese company DeepSeek; how it handles and stores this content is set out in its privacy policy. If you choose a provider outside mainland China, this content goes abroad. When a session fetches a web page or opens one in the built-in browser, that site receives the request; a site you signed in to in the built-in browser receives requests that carry your sign-in. Once you save a key for a search service, that service receives the query when a session searches the web, and its privacy policy applies; with a search service outside mainland China (Tavily, Brave), the query goes abroad. By default Yew starts two open-source MCP servers: a browser (Microsoft's Playwright MCP) and computer control (computer-use-mcp). They run on your computer, and you can turn them off in Settings. Yew downloads and installs these two, and the common servers you add with one click that run on your computer, from npm the first time it uses them; npm receives the download request. An MCP server you add (it is written in mcp.json) receives what a session passes to its tools, and a service you signed in to in your browser receives requests made with your account. These services' own privacy policies apply; with a service outside mainland China (such as Google, Linear or Vercel), what is passed to it goes abroad. These tools ask you before each call, until you choose Always allow for a tool; the clicks, typing and key presses of computer control, and MCP tools that Yew recognizes as sending, publishing or deleting something, cannot be set to Always allow and ask every time.",
|
|
32
|
-
"Access, export and deletion: you can look at the files in the data folder directly. To delete a provider's key, delete it in Settings or run yew key delete; to remove a paired phone, remove it under Phone access on the computer, or unpair on the phone; to sign out of an MCP server, choose Sign out under MCP servers: where the service supports it, Yew first asks it to cancel the tokens, then deletes the ones kept on this computer; to make sure the access you granted is revoked, check or remove it in that service's account settings; to clear the built-in browser's sign-ins, delete the browser folder in the data folder; to delete everything, stop yew serve and delete the data folder.
|
|
32
|
+
"Access, export and deletion: you can look at the files in the data folder directly. To delete a provider's key, delete it in Settings or run yew key delete; to remove a paired phone, remove it under Phone access on the computer, or unpair on the phone; to sign out of an MCP server, choose Sign out under MCP servers: where the service supports it, Yew first asks it to cancel the tokens, then deletes the ones kept on this computer; to make sure the access you granted is revoked, check or remove it in that service's account settings; to clear the built-in browser's sign-ins, delete the browser folder in the data folder; to delete everything, stop yew serve and delete the data folder.",
|
|
33
33
|
"Contact: support@tenonai.cn.",
|
|
34
34
|
],
|
|
35
35
|
terms: [
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Yew's web interface is built from these packages. Each stays under its own license.
|
|
2
2
|
|
|
3
3
|
========================================================================
|
|
4
4
|
@ungap/structured-clone 1.4.0 (ISC)
|