psyclaw 0.26.3 → 0.27.4
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 +35 -8
- package/dist/apps/panel/index.html +58 -15
- package/dist/src/adapters/pi/extension.js +322 -120
- package/dist/src/adapters/pi/extension.js.map +1 -1
- package/dist/src/branding.d.ts +9 -0
- package/dist/src/branding.js +24 -1
- package/dist/src/branding.js.map +1 -1
- package/dist/src/chat.d.ts +3 -0
- package/dist/src/chat.js +17 -6
- package/dist/src/chat.js.map +1 -1
- package/dist/src/cli.js +20 -8
- package/dist/src/cli.js.map +1 -1
- package/dist/src/core/docx.js +2 -2
- package/dist/src/core/docx.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/panel/extension.js +3 -1
- package/dist/src/panel/extension.js.map +1 -1
- package/dist/src/panel/server.d.ts +2 -0
- package/dist/src/panel/server.js +66 -9
- package/dist/src/panel/server.js.map +1 -1
- package/dist/src/setup.d.ts +1 -1
- package/dist/src/setup.js +12 -4
- package/dist/src/setup.js.map +1 -1
- package/dist/src/skills/recommended.d.ts +84 -0
- package/dist/src/skills/recommended.js +339 -0
- package/dist/src/skills/recommended.js.map +1 -0
- package/dist/src/style/cli-ui.js +2 -1
- package/dist/src/style/cli-ui.js.map +1 -1
- package/dist/src/telemetry/export.d.ts +24 -0
- package/dist/src/telemetry/export.js +264 -0
- package/dist/src/telemetry/export.js.map +1 -0
- package/dist/src/tui/skill-manager.d.ts +49 -0
- package/dist/src/tui/skill-manager.js +133 -0
- package/dist/src/tui/skill-manager.js.map +1 -0
- package/dist/src/updates/registry.d.ts +1 -0
- package/dist/src/updates/registry.js +19 -0
- package/dist/src/updates/registry.js.map +1 -1
- package/dist/src/updates/update.d.ts +32 -4
- package/dist/src/updates/update.js +163 -6
- package/dist/src/updates/update.js.map +1 -1
- package/package.json +4 -3
- package/scripts/rebrand-pi.mjs +16 -12
- package/skills/core/citation-audit/SKILL.md +9 -9
- package/skills/core/evidence-capture/SKILL.md +9 -9
- package/skills/core/manifest.json +15 -15
- package/skills/core/research-brief/SKILL.md +8 -8
- package/skills/core/research-intake/SKILL.md +9 -9
- package/skills/recommended/catalog.json +163 -43
package/README.md
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
PsyClaw 是面向社会科学研究的 Pi 工作台。它把研究项目、证据来源、Claim-Evidence 账本、完整性门禁、人工裁决、可恢复工作流和本地面板接到官方 Pi runtime 上;它不替代统计软件,也不会把未经核验的引用、结果或审稿意见写成事实。
|
|
4
4
|
|
|
5
|
-
当前版本:`0.
|
|
5
|
+
当前版本:`0.27.4`。本仓库以 `psypi v0.4.1` 的完整工作台为功能基线完成改名;`psypi` 仓库保留为历史仓库,正式命令和后续发布均使用 `psyclaw`。
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
9
|
需要 Node.js `>=22.19.0`。官方 npm 源:
|
|
10
10
|
|
|
11
11
|
```powershell
|
|
12
|
-
npm install -g psyclaw@0.
|
|
12
|
+
npm install -g psyclaw@0.27.4
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
中国大陆网络较慢或无法访问官方源时:
|
|
16
16
|
|
|
17
17
|
```powershell
|
|
18
|
-
npm install -g psyclaw@0.
|
|
18
|
+
npm install -g psyclaw@0.27.4 --registry=https://registry.npmmirror.com
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
确认命令入口:
|
|
@@ -57,13 +57,23 @@ psyclaw brief
|
|
|
57
57
|
| 创建人工裁决模板 | `psyclaw hitl init` |
|
|
58
58
|
| 写研究移交记录 | `psyclaw handoff` |
|
|
59
59
|
| 扫描本机其他 Agent | `psyclaw agents` |
|
|
60
|
-
| 查看 Pi
|
|
61
|
-
| 更新 Pi
|
|
60
|
+
| 查看 PsyClaw 和内置 Pi 更新 | `psyclaw check-updates` |
|
|
61
|
+
| 更新 PsyClaw 和内置 Pi | `psyclaw update` |
|
|
62
|
+
| 导出脱敏使用路径 | 在对话中输入 `/trace` |
|
|
62
63
|
| 打开科研面板 | 在对话中输入 `/panel` |
|
|
63
64
|
| 查看或切换 Provider | 在对话中输入 `/provider` 或 `/provider <id>` |
|
|
64
65
|
| 管理启动横幅宠物 | `/pet status`、`/pet on`、`/pet off`(默认关闭) |
|
|
65
66
|
|
|
66
|
-
`psyclaw update`
|
|
67
|
+
`psyclaw update` 会更新 PsyClaw 整包,并同时安装该版本锁定、验证过的内置 Pi;它不会更新或删除系统中单独安装的 `pi` 命令。在源码仓库中运行时,命令会停止并提示通过 Git 更新,不会覆盖本地修改。
|
|
68
|
+
仅查看更新计划而不执行时,使用 `psyclaw update --check`。旧的 `--yes` 参数仍兼容,但不再需要。
|
|
69
|
+
|
|
70
|
+
### 导出使用路径
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
/trace
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
该斜杠命令直接在 PsyClaw 对话界面中使用,从当前项目的工作流日志和对应 Pi 会话中生成 OTLP/HTTP JSON,用于通过 OpenTelemetry Collector 导入 Langfuse 或 LangSmith。导出器只保留步骤类型、父子关系、时间、结果状态和版本;不包含对话正文、工具参数/输出、研究内容、原始 ID 或绝对路径。命令只写本地文件,不会自动上传。终端兼容入口仍为 `psyclaw traces export`。
|
|
67
77
|
|
|
68
78
|
## 开发者本地安装
|
|
69
79
|
|
|
@@ -74,7 +84,7 @@ npm link
|
|
|
74
84
|
psyclaw --help
|
|
75
85
|
```
|
|
76
86
|
|
|
77
|
-
开发阶段不需要执行 `psyclaw update
|
|
87
|
+
开发阶段不需要执行 `psyclaw update`。请通过 Git 同步仓库,再运行 `pnpm install` 和 `pnpm build`。
|
|
78
88
|
|
|
79
89
|
## 从旧 Python 版迁移
|
|
80
90
|
|
|
@@ -89,12 +99,29 @@ where.exe psyclaw
|
|
|
89
99
|
|
|
90
100
|
```powershell
|
|
91
101
|
npm uninstall -g psyclaw
|
|
92
|
-
npm install -g psyclaw@0.
|
|
102
|
+
npm install -g psyclaw@0.27.4
|
|
93
103
|
psyclaw --help
|
|
94
104
|
```
|
|
95
105
|
|
|
96
106
|
Python 的卸载器提示 `No files were found to uninstall` 时,不要手工删除不明目录;先用上述命令定位旧入口,再在对应 Python 环境中修复或移除它。
|
|
97
107
|
|
|
108
|
+
## 卸载
|
|
109
|
+
|
|
110
|
+
仅卸载 PsyClaw 程序,保留用户配置和历史会话:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm uninstall -g psyclaw
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
完全卸载 PsyClaw(同时删除模型配置、用户设置和历史会话):
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npm uninstall -g psyclaw
|
|
120
|
+
node -e 'const fs=require("node:fs"),os=require("node:os"),path=require("node:path");const target=path.join(os.homedir(),`.psy${"pi"}`);if(path.dirname(target)!==os.homedir())throw new Error("unsafe PsyClaw data path");fs.rmSync(target,{recursive:true,force:true});console.log(`removed ${target}`)'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
上述命令不会删除研究项目目录,因为其中可能包含论文、证据、原始数据和分析产物。如需删除某个项目,应单独确认该项目的准确路径后处理。单独全局安装的 `@earendil-works/pi-coding-agent` 不属于 PsyClaw 用户数据,上述命令不会删除它。
|
|
124
|
+
|
|
98
125
|
## 文档
|
|
99
126
|
|
|
100
127
|
- [PsyClaw v0.26.0 使用白皮书](docs/PsyClaw使用白皮书_v0.26.0.md)
|
|
@@ -1610,6 +1610,11 @@
|
|
|
1610
1610
|
<div id="recommended-mcps-shelf" class="capability-grid"><p class="detail-key">读取中…</p></div>
|
|
1611
1611
|
</div>
|
|
1612
1612
|
|
|
1613
|
+
<div style="margin-bottom:1.5rem;">
|
|
1614
|
+
<h3 style="font-size:1.1rem;margin-bottom:0.8rem;">外部工具</h3>
|
|
1615
|
+
<div id="external-tools-shelf" class="capability-grid"><p class="detail-key">读取中…</p></div>
|
|
1616
|
+
</div>
|
|
1617
|
+
|
|
1613
1618
|
<div>
|
|
1614
1619
|
<h3 style="font-size:1.1rem;margin-bottom:0.8rem;">⚙️ 已启用能力管理</h3>
|
|
1615
1620
|
<div id="enabled-shelf" class="overview-grid"><p class="detail-key">读取中…</p></div>
|
|
@@ -2157,16 +2162,23 @@ document.getElementById("decision-form").addEventListener("submit", async (e) =>
|
|
|
2157
2162
|
});
|
|
2158
2163
|
|
|
2159
2164
|
const DEFAULT_RECOMMENDED_SKILLS = [
|
|
2160
|
-
{ id: "markitdown", name: "MarkItDown", stage: "
|
|
2161
|
-
{ id: "
|
|
2162
|
-
{ id: "session-handoff", name: "Session Handoff", stage: "接力", description: "把长任务的目标、进度、阻塞和下一步写成可核验的交接状态。", sourceRef: "https://github.com/LHT666-hub/session-handoff" },
|
|
2165
|
+
{ id: "markitdown-bilibili", name: "MarkItDown + Bilibili", stage: "材料转换", description: "字幕优先、转录回退,把 B 站课程和讲座转成带来源状态的 Markdown。", sourceRef: "https://github.com/LHT666-hub/markItdown-pro" },
|
|
2166
|
+
{ id: "session-handoff", name: "Session Handoff", stage: "任务接力", description: "把长任务的目标、进度、阻塞和下一步写成可核验的交接状态。", sourceRef: "https://github.com/LHT666-hub/session-handoff" },
|
|
2163
2167
|
{ id: "zotero-translators", name: "Zotero Translators", stage: "题录", description: "从出版社和数据库页面提取规范题录、DOI、PDF 和补充材料。", sourceRef: "https://github.com/zotero/translators" },
|
|
2164
|
-
{ id: "scansci-pdf", name: "ScanSci PDF", stage: "
|
|
2165
|
-
{ id: "scholarbridge", name: "ScholarBridge", stage: "
|
|
2166
|
-
{ id: "mentorforge", name: "MentorForge", stage: "
|
|
2167
|
-
{ id: "supervisor-skills", name: "Supervisor-Skills", stage: "
|
|
2168
|
-
{ id: "openkb", name: "OpenKB", stage: "知识库", description: "
|
|
2169
|
-
{ id: "
|
|
2168
|
+
{ id: "scansci-pdf", name: "ScanSci PDF", stage: "全文获取", description: "按开放来源、官方接口和用户授权会话尝试获取论文全文。", sourceRef: "https://github.com/Rimagination/scansci-pdf" },
|
|
2169
|
+
{ id: "scholarbridge", name: "ScholarBridge", stage: "文献质控", description: "连接文献清单、PDF 完整性校验、哈希去重和 Zotero 交接。", sourceRef: "https://github.com/LHT666-hub/ScholarBridge" },
|
|
2170
|
+
{ id: "mentorforge", name: "MentorForge", stage: "方法蒸馏", description: "从学者主页、论文和全文信号卡中提炼可追问的科研方法论。", sourceRef: "https://github.com/qwqalice/MentorForge" },
|
|
2171
|
+
{ id: "supervisor-skills", name: "Supervisor-Skills", stage: "研究写作", description: "覆盖研究构思、调研、写作、图表、评审和投稿前检查的科研工作流。", sourceRef: "https://github.com/HKUSTDial/Supervisor-Skills" },
|
|
2172
|
+
{ id: "openkb", name: "OpenKB", stage: "知识库", description: "把异构资料编译成可链接、可检索、可持续更新的知识库。", sourceRef: "https://github.com/VectifyAI/OpenKB" },
|
|
2173
|
+
{ id: "corpus2skill", name: "Corpus2Skill", stage: "知识库", description: "将大规模语料编译成可导航的 Skill 树和文档索引。", sourceRef: "https://github.com/dukesun99/Corpus2Skill" },
|
|
2174
|
+
{ id: "academic-reference-matcher", name: "Academic Reference Matcher", stage: "引用核验", description: "逐条拆分 Claim、检索来源并输出 Claim–Reference 对照表。", sourceRef: "https://github.com/keros68/academic-reference-matcher" }
|
|
2175
|
+
,{ id: "pskoett-ai-skills", name: "pskoett AI Skills", stage: "经验沉淀", description: "把失败和纠正沉淀为候选经验,经过验证后晋升为规则或回归测试。", sourceRef: "https://github.com/pskoett/pskoett-ai-skills" }
|
|
2176
|
+
,{ id: "omnidistill", name: "OmniDistill", stage: "知识蒸馏", description: "以证据账本统一知识、启发式规则、工作流、反模式和边界。", sourceRef: "https://github.com/LHT666-hub/OmniDistill" }
|
|
2177
|
+
];
|
|
2178
|
+
|
|
2179
|
+
const DEFAULT_EXTERNAL_TOOLS = [
|
|
2180
|
+
{ id: "markitdown", name: "MarkItDown", stage: "材料转换", description: "把 PDF、Word、PPT、Excel、HTML 等转换为结构化 Markdown。它是独立 Python 工具,不作为 PsyClaw Skill 安装。", sourceRef: "https://github.com/microsoft/markitdown" },
|
|
2181
|
+
{ id: "smartplot", name: "SmartPlot", stage: "科研绘图", description: "科研绘图、样式统一、多面板组图和可见确认工具。它不是 PsyClaw Skill。", sourceRef: "https://smartplot.app" }
|
|
2170
2182
|
];
|
|
2171
2183
|
|
|
2172
2184
|
const DEFAULT_RECOMMENDED_MCPS = [
|
|
@@ -2183,7 +2195,8 @@ async function loadSkillsAndEcosystem() {
|
|
|
2183
2195
|
fetchJson("/api/enabled-capabilities").catch(() => ({ skills: [], mcp: [] }))
|
|
2184
2196
|
]);
|
|
2185
2197
|
|
|
2186
|
-
const skillItems = (skills &&
|
|
2198
|
+
const skillItems = (skills && Array.isArray(skills.items)) ? skills.items : DEFAULT_RECOMMENDED_SKILLS;
|
|
2199
|
+
const externalTools = (skills && Array.isArray(skills.externalTools)) ? skills.externalTools : DEFAULT_EXTERNAL_TOOLS;
|
|
2187
2200
|
const mcpItems = (mcps && mcps.items && mcps.items.length) ? mcps.items : DEFAULT_RECOMMENDED_MCPS;
|
|
2188
2201
|
|
|
2189
2202
|
recommendCache = { skill: skillItems, mcp: mcpItems };
|
|
@@ -2191,14 +2204,35 @@ async function loadSkillsAndEcosystem() {
|
|
|
2191
2204
|
|
|
2192
2205
|
renderCapabilityShelf("recommended-skills-shelf", "skill", recommendCache.skill);
|
|
2193
2206
|
renderCapabilityShelf("recommended-mcps-shelf", "mcp", recommendCache.mcp);
|
|
2207
|
+
renderExternalTools(externalTools);
|
|
2194
2208
|
renderEnabledList(enabled || { skills: [], mcp: [] });
|
|
2195
2209
|
} catch (err) {
|
|
2196
2210
|
recommendCache = { skill: DEFAULT_RECOMMENDED_SKILLS, mcp: DEFAULT_RECOMMENDED_MCPS };
|
|
2197
2211
|
renderCapabilityShelf("recommended-skills-shelf", "skill", recommendCache.skill);
|
|
2198
2212
|
renderCapabilityShelf("recommended-mcps-shelf", "mcp", recommendCache.mcp);
|
|
2213
|
+
renderExternalTools(DEFAULT_EXTERNAL_TOOLS);
|
|
2199
2214
|
}
|
|
2200
2215
|
}
|
|
2201
2216
|
|
|
2217
|
+
function renderExternalTools(items) {
|
|
2218
|
+
document.getElementById("external-tools-shelf").innerHTML = items.length
|
|
2219
|
+
? items.map(item => `
|
|
2220
|
+
<div class="capability-card">
|
|
2221
|
+
<div>
|
|
2222
|
+
<div class="capability-header">
|
|
2223
|
+
<span class="capability-title">${esc(item.name)}</span>
|
|
2224
|
+
<span class="pill neutral">${esc(item.stage || "外部工具")}</span>
|
|
2225
|
+
</div>
|
|
2226
|
+
<p class="capability-desc">${esc(item.description)}</p>
|
|
2227
|
+
</div>
|
|
2228
|
+
<div style="margin-top:0.8rem;border-top:1px solid var(--line);padding-top:0.6rem;">
|
|
2229
|
+
<a href="${esc(item.sourceRef)}" target="_blank" rel="noreferrer" style="font-size:0.78rem;">查看工具 ↗</a>
|
|
2230
|
+
</div>
|
|
2231
|
+
</div>
|
|
2232
|
+
`).join("")
|
|
2233
|
+
: `<p class="detail-key">没有外部工具</p>`;
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2202
2236
|
function renderCapabilityShelf(targetId, kind, items) {
|
|
2203
2237
|
document.getElementById(targetId).innerHTML = items.length
|
|
2204
2238
|
? items.map(item => {
|
|
@@ -2246,19 +2280,28 @@ function handleCardKey(e, kind, id) {
|
|
|
2246
2280
|
|
|
2247
2281
|
async function installCapability(kind, id) {
|
|
2248
2282
|
const item = (recommendCache[kind] || []).find(c => c.id === id);
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
if (
|
|
2283
|
+
if (!item) return;
|
|
2284
|
+
let scope;
|
|
2285
|
+
if (kind === "skill") {
|
|
2286
|
+
const choice = window.prompt("选择 Skill 安装位置:\n1. 项目目录(仅当前项目)\n2. 系统目录(所有项目)", "1");
|
|
2287
|
+
if (choice === null) return;
|
|
2288
|
+
scope = choice.trim() === "2" ? "user" : choice.trim() === "1" ? "project" : undefined;
|
|
2289
|
+
if (!scope) { alert("请输入 1 或 2"); return; }
|
|
2290
|
+
}
|
|
2291
|
+
const scopeLine = kind === "skill"
|
|
2292
|
+
? `\n\n安装位置:${scope === "user" ? "系统目录(所有项目)" : "项目目录(仅当前项目)"}`
|
|
2293
|
+
: "";
|
|
2294
|
+
if (!confirm(`将把安装任务交给当前模型:\n\n${item.sourceRef}${scopeLine}\n\n确认吗?`)) return;
|
|
2252
2295
|
|
|
2253
2296
|
try {
|
|
2254
2297
|
const res = await fetch("/api/install/execute", {
|
|
2255
2298
|
method: "POST",
|
|
2256
2299
|
headers: { "content-type": "application/json" },
|
|
2257
|
-
body: JSON.stringify({ kind, id, approved: true, actor: "researcher" })
|
|
2300
|
+
body: JSON.stringify({ kind, id, scope, approved: true, actor: "researcher" })
|
|
2258
2301
|
});
|
|
2259
2302
|
const data = await res.json();
|
|
2260
2303
|
if (!res.ok) throw new Error(data.error || "安装失败");
|
|
2261
|
-
alert(data.ok ? `安装成功!在终端输入 /reload 重新加载。` : `安装退出码:${data.exitCode}\n${data.output || ""}`);
|
|
2304
|
+
alert(data.queued ? `安装任务已交给当前模型。模型完成后请启用 Skill,并输入 /reload。` : data.ok ? `安装成功!在终端输入 /reload 重新加载。` : `安装退出码:${data.exitCode}\n${data.output || ""}`);
|
|
2262
2305
|
loadSkillsAndEcosystem();
|
|
2263
2306
|
} catch (e) { alert(e.message); }
|
|
2264
2307
|
}
|