psyclaw 0.28.1 → 0.28.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.
Files changed (135) hide show
  1. package/README.md +5 -5
  2. package/agents/recommended/catalog.json +1 -1
  3. package/dist/src/adapters/pi/extension.js +79 -25
  4. package/dist/src/adapters/pi/extension.js.map +1 -1
  5. package/dist/src/ars/keybindings.d.ts +13 -0
  6. package/dist/src/ars/keybindings.js +50 -0
  7. package/dist/src/ars/keybindings.js.map +1 -0
  8. package/dist/src/ars/mode-editor.d.ts +25 -0
  9. package/dist/src/ars/mode-editor.js +78 -0
  10. package/dist/src/ars/mode-editor.js.map +1 -0
  11. package/dist/src/ars/profile.d.ts +4 -1
  12. package/dist/src/ars/profile.js +23 -6
  13. package/dist/src/ars/profile.js.map +1 -1
  14. package/dist/src/chat.js +3 -0
  15. package/dist/src/chat.js.map +1 -1
  16. package/dist/src/panel/server.js +1 -1
  17. package/dist/src/panel/server.js.map +1 -1
  18. package/package.json +10 -3
  19. package/vendor/academic-paper-skills/LICENSE +21 -0
  20. package/vendor/academic-paper-skills/NOTICE.md +7 -0
  21. package/vendor/academic-paper-skills/PSYCLAW_SOURCE.json +14 -0
  22. package/vendor/academic-paper-skills/academic-paper-composer/SKILL.md +840 -0
  23. package/vendor/academic-paper-skills/academic-paper-composer/references/section_guides.md +675 -0
  24. package/vendor/academic-paper-skills/academic-paper-composer/references/writing_standards.md +629 -0
  25. package/vendor/academic-paper-skills/academic-paper-composer/scripts/chapter_quality_check.py +470 -0
  26. package/vendor/academic-paper-skills/academic-paper-composer/scripts/final_evaluation.py +550 -0
  27. package/vendor/academic-paper-skills/academic-paper-strategist/SKILL.md +670 -0
  28. package/vendor/academic-paper-skills/academic-paper-strategist/references/quality_standards.md +336 -0
  29. package/vendor/academic-paper-skills/academic-paper-strategist/references/search_strategy.md +459 -0
  30. package/vendor/academic-paper-skills/academic-paper-strategist/scripts/evaluate_samples.py +300 -0
  31. package/vendor/academic-paper-skills/academic-paper-strategist/scripts/gap_analysis.py +399 -0
  32. package/vendor/ars/pi/wrapper.js +9 -0
  33. package/vendor/nature-skills/LICENSE +201 -0
  34. package/vendor/nature-skills/NOTICE.md +7 -0
  35. package/vendor/nature-skills/PSYCLAW_SOURCE.json +19 -0
  36. package/vendor/nature-skills/skills/nature-figure/README.md +107 -0
  37. package/vendor/nature-skills/skills/nature-figure/README_EN.md +107 -0
  38. package/vendor/nature-skills/skills/nature-figure/SKILL.md +154 -0
  39. package/vendor/nature-skills/skills/nature-figure/agents/openai.yaml +4 -0
  40. package/vendor/nature-skills/skills/nature-figure/evals/evals.json +325 -0
  41. package/vendor/nature-skills/skills/nature-figure/manifest.yaml +103 -0
  42. package/vendor/nature-skills/skills/nature-figure/references/ai-graphical-abstract-workflow.md +129 -0
  43. package/vendor/nature-skills/skills/nature-figure/references/api.md +576 -0
  44. package/vendor/nature-skills/skills/nature-figure/references/asset-adaptation.md +72 -0
  45. package/vendor/nature-skills/skills/nature-figure/references/backend-selection.md +118 -0
  46. package/vendor/nature-skills/skills/nature-figure/references/chart-types.md +348 -0
  47. package/vendor/nature-skills/skills/nature-figure/references/common-patterns.md +371 -0
  48. package/vendor/nature-skills/skills/nature-figure/references/demos.md +58 -0
  49. package/vendor/nature-skills/skills/nature-figure/references/design-theory.md +467 -0
  50. package/vendor/nature-skills/skills/nature-figure/references/figure-contract.md +122 -0
  51. package/vendor/nature-skills/skills/nature-figure/references/figure-legend-conventions.md +90 -0
  52. package/vendor/nature-skills/skills/nature-figure/references/multipanel-evidence-architecture.md +268 -0
  53. package/vendor/nature-skills/skills/nature-figure/references/nature-2026-observations.md +124 -0
  54. package/vendor/nature-skills/skills/nature-figure/references/nature-article-requirements.md +149 -0
  55. package/vendor/nature-skills/skills/nature-figure/references/openrouter-image-generation.md +141 -0
  56. package/vendor/nature-skills/skills/nature-figure/references/qa-contract.md +344 -0
  57. package/vendor/nature-skills/skills/nature-figure/references/r-template-index.md +66 -0
  58. package/vendor/nature-skills/skills/nature-figure/references/r-workflow.md +234 -0
  59. package/vendor/nature-skills/skills/nature-figure/references/template-catalog.md +33 -0
  60. package/vendor/nature-skills/skills/nature-figure/references/tutorials.md +260 -0
  61. package/vendor/nature-skills/skills/nature-figure/requirements.txt +1 -0
  62. package/vendor/nature-skills/skills/nature-figure/scripts/audit_figure_collisions.py +742 -0
  63. package/vendor/nature-skills/skills/nature-figure/scripts/audit_panel_alignment.py +933 -0
  64. package/vendor/nature-skills/skills/nature-figure/scripts/audit_pdf_text.py +152 -0
  65. package/vendor/nature-skills/skills/nature-figure/scripts/figure_safety.py +50 -0
  66. package/vendor/nature-skills/skills/nature-figure/scripts/generate_openrouter_schematic.py +260 -0
  67. package/vendor/nature-skills/skills/nature-figure/scripts/nature_figure_backend.py +93 -0
  68. package/vendor/nature-skills/skills/nature-figure/scripts/panel_alignment.R +188 -0
  69. package/vendor/nature-skills/skills/nature-figure/scripts/plot_templates.py +604 -0
  70. package/vendor/nature-skills/skills/nature-figure/scripts/validate_figure.py +835 -0
  71. package/vendor/nature-skills/skills/nature-figure/static/core/contract.md +55 -0
  72. package/vendor/nature-skills/skills/nature-figure/static/core/stance.md +41 -0
  73. package/vendor/nature-skills/skills/nature-figure/static/fragments/backend/python.md +56 -0
  74. package/vendor/nature-skills/skills/nature-figure/static/fragments/backend/r.md +63 -0
  75. package/vendor/nature-skills/skills/nature-figure/tests/test_figure_safety.py +209 -0
  76. package/vendor/nature-skills/skills/nature-polishing/README.md +58 -0
  77. package/vendor/nature-skills/skills/nature-polishing/README_EN.md +58 -0
  78. package/vendor/nature-skills/skills/nature-polishing/SKILL.md +111 -0
  79. package/vendor/nature-skills/skills/nature-polishing/agents/openai.yaml +4 -0
  80. package/vendor/nature-skills/skills/nature-polishing/manifest.yaml +101 -0
  81. package/vendor/nature-skills/skills/nature-polishing/references/latex-layout.md +211 -0
  82. package/vendor/nature-skills/skills/nature-polishing/references/nat-comms-2025-diction.md +73 -0
  83. package/vendor/nature-skills/skills/nature-polishing/references/phrasebank-playbook.md +175 -0
  84. package/vendor/nature-skills/skills/nature-polishing/references/published-article-patterns.md +126 -0
  85. package/vendor/nature-skills/skills/nature-polishing/references/section-moves.md +252 -0
  86. package/vendor/nature-skills/skills/nature-polishing/references/style-guardrails.md +94 -0
  87. package/vendor/nature-skills/skills/nature-polishing/references/writing-strategy.md +160 -0
  88. package/vendor/nature-skills/skills/nature-polishing/static/core/failure-modes.md +29 -0
  89. package/vendor/nature-skills/skills/nature-polishing/static/core/output-format.md +21 -0
  90. package/vendor/nature-skills/skills/nature-polishing/static/core/stance.md +26 -0
  91. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/generic.md +17 -0
  92. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nat-comms.md +38 -0
  93. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nat-mach-intell.md +102 -0
  94. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nature.md +19 -0
  95. package/vendor/nature-skills/skills/nature-polishing/static/fragments/language/en.md +19 -0
  96. package/vendor/nature-skills/skills/nature-polishing/static/fragments/language/zh-to-en.md +19 -0
  97. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/algorithmic.md +18 -0
  98. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/hypothesis.md +17 -0
  99. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/methods.md +35 -0
  100. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/research.md +29 -0
  101. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/review.md +17 -0
  102. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/abstract.md +26 -0
  103. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/conclusion.md +15 -0
  104. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/discussion.md +48 -0
  105. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/intro.md +33 -0
  106. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/methods.md +26 -0
  107. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/results.md +61 -0
  108. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/title.md +17 -0
  109. package/vendor/nature-skills/skills/nature-ref-verifier/README.md +44 -0
  110. package/vendor/nature-skills/skills/nature-ref-verifier/README_EN.md +44 -0
  111. package/vendor/nature-skills/skills/nature-ref-verifier/SKILL.md +196 -0
  112. package/vendor/nature-skills/skills/nature-ref-verifier/agents/openai.yaml +4 -0
  113. package/vendor/nature-skills/skills/nature-ref-verifier/manifest.yaml +19 -0
  114. package/vendor/nature-skills/skills/nature-ref-verifier/references/common-patterns.md +96 -0
  115. package/vendor/nature-skills/skills/nature-shared/README.md +43 -0
  116. package/vendor/nature-skills/skills/nature-shared/README_EN.md +43 -0
  117. package/vendor/nature-skills/skills/nature-shared/SKILL.md +33 -0
  118. package/vendor/nature-skills/skills/nature-shared/agents/openai.yaml +6 -0
  119. package/vendor/nature-skills/skills/nature-shared/core/consistency-sweep.md +122 -0
  120. package/vendor/nature-skills/skills/nature-shared/core/discussion-argument-language.md +192 -0
  121. package/vendor/nature-skills/skills/nature-shared/core/ethics.md +88 -0
  122. package/vendor/nature-skills/skills/nature-shared/core/main-text-discipline.md +179 -0
  123. package/vendor/nature-skills/skills/nature-shared/core/nature-abstract.md +171 -0
  124. package/vendor/nature-skills/skills/nature-shared/core/nature-introduction.md +164 -0
  125. package/vendor/nature-skills/skills/nature-shared/core/nature-results-discussion.md +215 -0
  126. package/vendor/nature-skills/skills/nature-shared/core/paper-type-taxonomy.md +41 -0
  127. package/vendor/nature-skills/skills/nature-shared/core/reader-workflow.md +21 -0
  128. package/vendor/nature-skills/skills/nature-shared/core/research-compliance.md +192 -0
  129. package/vendor/nature-skills/skills/nature-shared/core/terminology-ledger.md +58 -0
  130. package/vendor/nature-skills/skills/nature-shared/journal-formats/nat-comms.md +139 -0
  131. package/vendor/nature-skills/skills/nature-shared/journal-formats/nature-machine-intelligence.md +431 -0
  132. package/vendor/nature-skills/skills/nature-shared/journal-formats/nature.md +313 -0
  133. package/vendor/nature-skills/skills/nature-shared/manifest.yaml +52 -0
  134. package/vendor/nature-skills/skills/nature-shared/scripts/check_consistency.py +273 -0
  135. package/vendor/nature-skills/skills/nature-shared/tests/test_check_consistency.py +63 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@ PsyClaw 是面向社会科学研究的智能体工作台。它把研究项目、
4
4
 
5
5
  PsyClaw 自有代码使用 MIT 许可证;随 npm 包内置的 Academic Research Skills 位于 `vendor/ars`,保持上游署名并单独遵循 CC BY-NC 4.0,仅限非商业用途。
6
6
 
7
- 当前版本:`0.28.1`。正式命令、用户配置目录和后续发布统一使用 `psyclaw`。
7
+ 当前版本:`0.28.3`。正式命令、用户配置目录和后续发布统一使用 `psyclaw`。
8
8
 
9
9
  ## 发布流程
10
10
 
@@ -21,19 +21,19 @@ RELEASE_MESSAGE="release: describe the change" pnpm release:push
21
21
  需要 Node.js `>=22.19.0`。官方 npm 源:
22
22
 
23
23
  ```powershell
24
- npm install -g psyclaw@0.28.1
24
+ npm install -g psyclaw@0.28.3
25
25
  ```
26
26
 
27
27
  如果本机 npm 配置把 registry 误写成带有 `~/` 的地址,请显式指定官方源:
28
28
 
29
29
  ```bash
30
- npm install -g psyclaw@0.28.1 --registry=https://registry.npmjs.org/
30
+ npm install -g psyclaw@0.28.3 --registry=https://registry.npmjs.org/
31
31
  ```
32
32
 
33
33
  中国大陆网络较慢或无法访问官方源时:
34
34
 
35
35
  ```powershell
36
- npm install -g psyclaw@0.28.1 --registry=https://registry.npmmirror.com
36
+ npm install -g psyclaw@0.28.3 --registry=https://registry.npmmirror.com
37
37
  ```
38
38
 
39
39
  PsyClaw 的 npm 发布包直接携带 Windows x64/arm64 版 `ripgrep` 和 `fd`,Windows 启动时直接使用包内可执行文件,不再联网下载。其他平台缺少这两个工具时仍由锁定的 Pi 原生工具管理器处理:代理环境走 GitHub 官方 API 与 Release,国内 npm registry 环境统一走国内镜像。
@@ -92,7 +92,7 @@ psyclaw brief
92
92
  | 创建项目能力 | `/create-skill`、`/create-hook`、`/create-rule`、`/create-subagent`(均先预览并确认) |
93
93
  | 运行自定义只读角色 | `/agents --agent <id> <task>` 或 `/agents --agents <id,...> <task>`(最多四个隔离 worker) |
94
94
  | 调用已加载 Skill | `/skill:<name>` |
95
- | 使用 PsyClaw ARS | `/ars doctor`,然后 `/ars full <task>` 或 `/ars start` |
95
+ | 使用 PsyClaw ARS | `Shift+Tab` 进入 academic mode(底栏显示);thinking level 改用 `Ctrl+Shift+Tab`;也可用 `/ars doctor` / `/ars full <task>` |
96
96
  | 管理 Plugin | `/plugin`;终端使用 `psyclaw plugin install|remove|list` |
97
97
  | 调用已配置 MCP | 模型通过 `psyclaw_mcp` 自动发现并调用 `.psyclaw/mcp/*.json` 中启用的服务器 |
98
98
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "psyclaw/recommended-agents/v1",
3
- "documentVersion": "0.28.1",
3
+ "documentVersion": "0.28.3",
4
4
  "syncedAt": "2026-09-06",
5
5
  "sourceDocument": "bundled literature/review subagents",
6
6
  "sourceRef": "bundled",
@@ -21,6 +21,7 @@ import { enabledLocalSkillPaths, enabledLocalPromptPaths, readUserSkillState, sc
21
21
  import { RuntimeMcpRegistry, setUserMcpConfigEnabled, } from "../../integrations/mcp-runtime.js";
22
22
  import { SecretInputComponent, ProviderPickerComponent, } from "../../tui/provider-picker.js";
23
23
  import { ARS_REPOSITORY_URL, ARS_UPSTREAM_COMMIT, ARS_UPSTREAM_REF, PSYCLAW_ARS_PROFILE_VERSION, detectNatureArsFillers, formatNatureArsFillerStatus, isArsPiActive, isArsPiTurn, psyclawArsPatch, } from "../../ars/profile.js";
24
+ import { ArsModeEditor, ARS_MODE_STATUS, isArsModeEditorText } from "../../ars/mode-editor.js";
24
25
  const PARADIGMS = new Set([
25
26
  "survey-observational",
26
27
  "qualitative-thematic",
@@ -1117,6 +1118,36 @@ export default function psyclawExtension(pi) {
1117
1118
  const developerCommands = process.env.PSYCLAW_DEVELOPER_COMMANDS === "1";
1118
1119
  const legacyTestApi = typeof pi.registerTool !== "function";
1119
1120
  const runtimeMcps = new RuntimeMcpRegistry();
1121
+ let arsModeEditor;
1122
+ let arsUiContext;
1123
+ const applyArsUiMode = (active, opts) => {
1124
+ arsModeEditor?.setConversationMode(active);
1125
+ arsUiContext?.ui.setStatus("ars", active ? ARS_MODE_STATUS : undefined);
1126
+ if (opts?.syncSession === false || !arsUiContext)
1127
+ return;
1128
+ const sessionActive = isArsPiActive(arsUiContext.sessionManager);
1129
+ if (active && !sessionActive) {
1130
+ pi.sendUserMessage("/ars-pi-start", {
1131
+ ...(!arsUiContext.isIdle() ? { deliverAs: "followUp" } : {}),
1132
+ expandPromptTemplates: true,
1133
+ });
1134
+ }
1135
+ else if (!active && sessionActive) {
1136
+ pi.sendUserMessage("/ars-pi-stop", {
1137
+ ...(!arsUiContext.isIdle() ? { deliverAs: "followUp" } : {}),
1138
+ expandPromptTemplates: true,
1139
+ });
1140
+ }
1141
+ };
1142
+ if (!legacyTestApi && typeof pi.registerShortcut === "function") {
1143
+ pi.registerShortcut("shift+tab", {
1144
+ description: "Toggle academic mode",
1145
+ handler: () => {
1146
+ const next = !(arsModeEditor?.isConversationMode() ?? isArsPiActive(arsUiContext?.sessionManager));
1147
+ applyArsUiMode(next);
1148
+ },
1149
+ });
1150
+ }
1120
1151
  if (!legacyTestApi && typeof pi.on === "function")
1121
1152
  pi.on("resources_discover", async (event) => {
1122
1153
  const enabled = await enabledRecommendedSkillPaths(event.cwd);
@@ -1152,6 +1183,27 @@ export default function psyclawExtension(pi) {
1152
1183
  })}`,
1153
1184
  };
1154
1185
  });
1186
+ if (!legacyTestApi && typeof pi.on === "function")
1187
+ pi.on("session_start", (_event, ctx) => {
1188
+ arsUiContext = ctx;
1189
+ if (!ctx.hasUI || typeof ctx.ui.setEditorComponent !== "function")
1190
+ return;
1191
+ ctx.ui.setEditorComponent((tui, theme, keybindings) => {
1192
+ const editor = new ArsModeEditor(tui, theme, keybindings);
1193
+ arsModeEditor = editor;
1194
+ editor.onArsModeChange = (active) => {
1195
+ ctx.ui.setStatus("ars", active ? ARS_MODE_STATUS : undefined);
1196
+ };
1197
+ editor.onToggleConversationMode = () => {
1198
+ applyArsUiMode(!editor.isConversationMode());
1199
+ };
1200
+ const restore = isArsPiActive(ctx.sessionManager);
1201
+ editor.setConversationMode(restore);
1202
+ if (restore)
1203
+ ctx.ui.setStatus("ars", ARS_MODE_STATUS);
1204
+ return editor;
1205
+ });
1206
+ });
1155
1207
  if (!legacyTestApi && typeof pi.on === "function")
1156
1208
  pi.on("input", (event, ctx) => {
1157
1209
  if (event.source === "extension")
@@ -1161,18 +1213,6 @@ export default function psyclawExtension(pi) {
1161
1213
  ctx.ui.notify("PsyClaw 已统一隐藏底层登录命令。请使用 /provider 配置、切换或更新模型凭据。", "info");
1162
1214
  return { action: "handled" };
1163
1215
  });
1164
- if (!legacyTestApi && typeof pi.on === "function")
1165
- pi.on("input", async (event, ctx) => {
1166
- if (event.source === "extension" || isArsPiActive(ctx.sessionManager))
1167
- return;
1168
- if (!/^\/(?:ars-[a-z0-9-]+|skill:(?:deep-research|academic-paper|academic-paper-reviewer|academic-pipeline))(?:\s|$)/i.test(event.text.trim()))
1169
- return;
1170
- if (!ctx.hasUI)
1171
- return { action: "handled" };
1172
- const approved = await ctx.ui.confirm("启用 ARS?", `来源:${ARS_REPOSITORY_URL} @ ${ARS_UPSTREAM_REF}\n许可:CC BY-NC 4.0,仅限非商业用途。关键研究阶段仍会请求确认。`);
1173
- if (!approved)
1174
- return { action: "handled" };
1175
- });
1176
1216
  if (!legacyTestApi && typeof pi.on === "function")
1177
1217
  pi.on("tool_call", async (event, ctx) => {
1178
1218
  const run = await readControlledRun(ctx.cwd);
@@ -1451,29 +1491,35 @@ export default function psyclawExtension(pi) {
1451
1491
  });
1452
1492
  if (!legacyTestApi)
1453
1493
  pi.registerCommand("ars", {
1454
- description: "启动或管理 PsyClaw ARS 模式",
1494
+ description: "切换 academic mode,或管理 doctor/start/full/stop",
1455
1495
  handler: async (args, ctx) => {
1456
1496
  try {
1457
- const [action = "status", ...rest] = args.trim().split(/\s+/).filter(Boolean);
1497
+ const [action, ...rest] = args.trim().split(/\s+/).filter(Boolean);
1498
+ // Bare /ars → sticky academic mode (same as Shift+Tab on). No profile popup.
1499
+ if (!action) {
1500
+ if (!ctx.hasUI) {
1501
+ ctx.ui.notify("当前环境无编辑器;请改用 Shift+Tab 或 /ars start。", "info");
1502
+ return;
1503
+ }
1504
+ arsUiContext = ctx;
1505
+ applyArsUiMode(true);
1506
+ return;
1507
+ }
1458
1508
  if (action === "status") {
1459
1509
  ctx.ui.notify([
1460
1510
  `PsyClaw ARS profile v${PSYCLAW_ARS_PROFILE_VERSION}`,
1461
- "模式:轻量 ARS(不要求 /init 或 /run)",
1511
+ "模式:academic mode(Shift+Tab 切换;开启后直接对话)",
1512
+ "Thinking:Ctrl+Shift+Tab(Shift+Tab 已让给 academic mode)",
1462
1513
  `来源:${ARS_REPOSITORY_URL} @ ${ARS_UPSTREAM_REF} (${ARS_UPSTREAM_COMMIT.slice(0, 12)})`,
1463
- "入口:/ars doctor,/ars start,/ars full <task>,/ars stop",
1514
+ "入口:Shift+Tab,/ars doctor,/ars start,/ars full <task>,/ars stop",
1464
1515
  formatNatureArsFillerStatus(natureFillersFromCommandContext(ctx)),
1465
1516
  ].join("\n"), "info");
1466
1517
  return;
1467
1518
  }
1468
1519
  if (action === "install") {
1469
- ctx.ui.notify("ARS 可直接使用:运行 /ars start /ars full <task>。", "info");
1520
+ ctx.ui.notify("ARS Nature/compose 技能已内置:按 Shift+Tab 进入 academic mode。", "info");
1470
1521
  return;
1471
1522
  }
1472
- if ((action === "start" || action === "full") && !isArsPiActive(ctx.sessionManager)) {
1473
- const approved = await ctx.ui.confirm("启用 ARS?", `来源:${ARS_REPOSITORY_URL} @ ${ARS_UPSTREAM_REF}\n许可:CC BY-NC 4.0,仅限非商业用途。关键研究阶段仍会请求确认。`);
1474
- if (!approved)
1475
- return;
1476
- }
1477
1523
  const upstreamCommand = action === "doctor"
1478
1524
  ? "/ars-pi-doctor"
1479
1525
  : action === "start"
@@ -1484,11 +1530,19 @@ export default function psyclawExtension(pi) {
1484
1530
  ? `/ars-full${rest.length > 0 ? ` ${rest.join(" ")}` : ""}`
1485
1531
  : undefined;
1486
1532
  if (!upstreamCommand) {
1487
- ctx.ui.notify("Usage: /ars [status|doctor|start|full <task>|stop]", "info");
1533
+ ctx.ui.notify("Usage: /ars [status|doctor|start|full <task>|stop] 或按 Shift+Tab 切换 academic mode", "info");
1488
1534
  return;
1489
1535
  }
1490
- if (action === "doctor" || action === "full" || action === "start") {
1491
- ctx.ui.notify(formatNatureArsFillerStatus(natureFillersFromCommandContext(ctx)), "info");
1536
+ if (action === "start") {
1537
+ arsUiContext = ctx;
1538
+ applyArsUiMode(true, { syncSession: false });
1539
+ }
1540
+ if (action === "stop") {
1541
+ arsUiContext = ctx;
1542
+ applyArsUiMode(false, { syncSession: false });
1543
+ if (ctx.hasUI && isArsModeEditorText(ctx.ui.getEditorText?.() ?? "")) {
1544
+ ctx.ui.setEditorText("");
1545
+ }
1492
1546
  }
1493
1547
  // A queued prompt does not get a fresh system prompt in Pi. Wait so the
1494
1548
  // upstream wrapper can activate ARS and inject its compatibility note.