psyclaw 0.28.3 → 0.29.2

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 (66) hide show
  1. package/README.md +12 -11
  2. package/agents/recommended/catalog.json +2 -2
  3. package/dist/src/adapters/pi/extension.js +310 -256
  4. package/dist/src/adapters/pi/extension.js.map +1 -1
  5. package/dist/src/analysis/hooks.js +1 -1
  6. package/dist/src/analysis/hooks.js.map +1 -1
  7. package/dist/src/analysis/plan.d.ts +82 -0
  8. package/dist/src/analysis/plan.js +246 -0
  9. package/dist/src/analysis/plan.js.map +1 -0
  10. package/dist/src/analysis/stats-router.d.ts +13 -0
  11. package/dist/src/analysis/stats-router.js +44 -0
  12. package/dist/src/analysis/stats-router.js.map +1 -0
  13. package/dist/src/ars/academic-router.d.ts +33 -0
  14. package/dist/src/ars/academic-router.js +204 -0
  15. package/dist/src/ars/academic-router.js.map +1 -0
  16. package/dist/src/ars/doctor.d.ts +27 -0
  17. package/dist/src/ars/doctor.js +121 -0
  18. package/dist/src/ars/doctor.js.map +1 -0
  19. package/dist/src/ars/mode-editor.d.ts +14 -7
  20. package/dist/src/ars/mode-editor.js +39 -23
  21. package/dist/src/ars/mode-editor.js.map +1 -1
  22. package/dist/src/ars/profile.d.ts +10 -0
  23. package/dist/src/ars/profile.js +15 -2
  24. package/dist/src/ars/profile.js.map +1 -1
  25. package/dist/src/branding.js +15 -16
  26. package/dist/src/branding.js.map +1 -1
  27. package/dist/src/cli.js +1 -8
  28. package/dist/src/cli.js.map +1 -1
  29. package/dist/src/index.d.ts +6 -1
  30. package/dist/src/index.js +6 -1
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/panel/server.js +1 -1
  33. package/dist/src/panel/server.js.map +1 -1
  34. package/dist/src/project/approvals.d.ts +4 -3
  35. package/dist/src/project/approvals.js +4 -3
  36. package/dist/src/project/approvals.js.map +1 -1
  37. package/dist/src/project/bootstrap.d.ts +7 -2
  38. package/dist/src/project/bootstrap.js +14 -13
  39. package/dist/src/project/bootstrap.js.map +1 -1
  40. package/dist/src/project/paths.d.ts +10 -0
  41. package/dist/src/project/paths.js +20 -3
  42. package/dist/src/project/paths.js.map +1 -1
  43. package/dist/src/project/workspace.d.ts +14 -0
  44. package/dist/src/project/workspace.js +82 -0
  45. package/dist/src/project/workspace.js.map +1 -0
  46. package/dist/src/session/modes.d.ts +10 -0
  47. package/dist/src/session/modes.js +57 -0
  48. package/dist/src/session/modes.js.map +1 -0
  49. package/dist/src/skills/recommended.js +1 -1
  50. package/dist/src/skills/recommended.js.map +1 -1
  51. package/dist/src/style/cli-ui.js +3 -3
  52. package/dist/src/style/cli-ui.js.map +1 -1
  53. package/dist/src/verify/checklist.d.ts +20 -0
  54. package/dist/src/verify/checklist.js +71 -0
  55. package/dist/src/verify/checklist.js.map +1 -0
  56. package/package.json +2 -1
  57. package/scripts/rebrand-pi.mjs +2 -2
  58. package/skills/core/academic-grill/SKILL.md +1 -1
  59. package/skills/core/analysis-plan/SKILL.md +29 -0
  60. package/skills/core/manifest.json +3 -3
  61. package/vendor/ars/pi/wrapper.js +14 -5
  62. package/vendor/ars/pi/wrapper.test.mjs +10 -0
  63. package/dist/src/research/brief.d.ts +0 -11
  64. package/dist/src/research/brief.js +0 -81
  65. package/dist/src/research/brief.js.map +0 -1
  66. package/skills/core/research-brief/SKILL.md +0 -17
@@ -0,0 +1 @@
1
+ {"version":3,"file":"academic-router.js","sourceRoot":"","sources":["../../../src/ars/academic-router.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,eAAe;IACf,gBAAgB;IAChB,yBAAyB;IACzB,mBAAmB;IACnB,2BAA2B;IAC3B,yBAAyB;IACzB,eAAe;IACf,qBAAqB;IACrB,kBAAkB;CACV,CAAC;AAqBX,MAAM,WAAW,GAAyB;IACxC;QACE,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,2BAA2B;QACnC,QAAQ,EA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GAAG;QAC7H,QAAQ;QACR,UAAU;QACV,eAAe;QACf,QAAQ,CAAC,IAAI,EAAE;KAChB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,uBAAuB;IACrC,MAAM,IAAI,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9E,OAAO;QACL,yCAAyC;QACzC,oJAAoJ;QACpJ,IAAI;QACJ,8IAA8I;QAC9I,iDAAiD;QACjD,wGAAwG;QACxG,+DAA+D;QAC/D,+CAA+C;QAC/C,oEAAoE;QACpE,kEAAkE;QAClE,uCAAuC;QACvC,+EAA+E;QAC/E,8CAA8C;QAC9C,8LAA8L;QAC9L,wKAAwK;QACxK,oEAAoE;KACrE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,27 @@
1
+ export interface ArsDoctorInput {
2
+ /** Absolute path to vendored ARS checkout inside the psyclaw package. */
3
+ repositoryRoot: string;
4
+ /** Active tool names from the current Pi session (optional). */
5
+ activeTools?: readonly string[];
6
+ /** Registered slash command names without leading slash (optional). */
7
+ commands?: readonly string[];
8
+ /** Whether `/init` project state is present (tool_call gates active). */
9
+ projectActive?: boolean;
10
+ }
11
+ /**
12
+ * PsyClaw-aware ARS capability report. Prefer this over upstream `/ars-pi-doctor`
13
+ * so orchestration / hooks reflect real PsyClaw surfaces — and never inject the
14
+ * slash text as a model prompt via sendUserMessage.
15
+ */
16
+ export declare function buildArsDoctorReport(input: ArsDoctorInput): Promise<string>;
17
+ export type PdfEngineKind = "tectonic" | "xelatex" | "pdflatex";
18
+ export interface EnsurePdfEngineResult {
19
+ engine: PdfEngineKind | "none";
20
+ status: "already-present" | "installed" | "missing" | "unsupported-platform";
21
+ detail: string;
22
+ }
23
+ /**
24
+ * Install a PDF engine only when the user explicitly needs PDF export.
25
+ * Prefer tectonic via Homebrew on macOS; otherwise report a clear install hint.
26
+ */
27
+ export declare function ensurePdfEngineForExport(): Promise<EnsurePdfEngineResult>;
@@ -0,0 +1,121 @@
1
+ import { execFile } from "node:child_process";
2
+ import { promisify } from "node:util";
3
+ import { ARS_REPOSITORY_URL, ARS_UPSTREAM_COMMIT, ARS_UPSTREAM_REF } from "./profile.js";
4
+ const execFileAsync = promisify(execFile);
5
+ async function probe(command, args) {
6
+ try {
7
+ const result = await execFileAsync(command, args, { timeout: 3000, encoding: "utf8" });
8
+ const line = (result.stdout || result.stderr).trim().split("\n")[0];
9
+ return line || "available";
10
+ }
11
+ catch {
12
+ return undefined;
13
+ }
14
+ }
15
+ /**
16
+ * PsyClaw-aware ARS capability report. Prefer this over upstream `/ars-pi-doctor`
17
+ * so orchestration / hooks reflect real PsyClaw surfaces — and never inject the
18
+ * slash text as a model prompt via sendUserMessage.
19
+ */
20
+ export async function buildArsDoctorReport(input) {
21
+ const tools = new Set((input.activeTools ?? []).map((name) => name.toLowerCase()));
22
+ const commands = new Set((input.commands ?? []).map((name) => name.toLowerCase()));
23
+ const hasMultiAgentTool = [...tools].some((name) => name.includes("ars_multi_agent") || name.includes("multi_agent") || name.includes("multi-agent"));
24
+ const hasAgentsCommand = commands.has("agents") || commands.has("create-subagent");
25
+ const hasAnalysisHooks = true; // PsyClaw ships declarative analysis hooks + /create-hook
26
+ const hasToolCallGate = input.projectActive === true;
27
+ const python = await probe("python3", ["--version"]);
28
+ const pyyaml = await probe("python3", ["-c", "import yaml; print(f'PyYAML {yaml.__version__}')"]);
29
+ const pandoc = await probe("pandoc", ["--version"]);
30
+ const orchestration = hasMultiAgentTool || hasAgentsCommand
31
+ ? [
32
+ hasMultiAgentTool
33
+ ? "psyclaw_ars_multi_agent ✓(Stage 3 五席进程隔离 / Stage 3′ 三门串行)"
34
+ : undefined,
35
+ hasAgentsCommand
36
+ ? "/agents ✓(项目 Subagent,独立 Pi RPC worker)"
37
+ : undefined,
38
+ ].filter(Boolean).join(";")
39
+ : "未发现 PsyClaw 编排入口(异常:应随包提供 psyclaw_ars_multi_agent 与 /agents)";
40
+ const hooks = [
41
+ "PsyClaw analysis hooks ✓(/create-hook、.psyclaw/analysis-hooks.json;已 /init 项目的分析路径强制门禁)",
42
+ hasToolCallGate
43
+ ? "tool_call 审批 ✓(项目已 /init;高后果写入/外发需确认)"
44
+ : "tool_call 审批:尚未 /init(普通对话不拦截)",
45
+ "Claude Code PreToolUse:Pi 不加载 Claude hooks.json;写入范围以 PsyClaw 门禁与提示约束为准,不冒充 Claude hook",
46
+ ].join("\n ");
47
+ const lines = [
48
+ "ARS Pi doctor(PsyClaw)",
49
+ "──────────────────────────────────────────────────────────────",
50
+ `Repository: ${input.repositoryRoot}`,
51
+ ` (上游 ${ARS_REPOSITORY_URL} @ ${ARS_UPSTREAM_REF} / ${ARS_UPSTREAM_COMMIT.slice(0, 12)})`,
52
+ `Python: ${python ? `${python} ✓` : "未安装"}`,
53
+ `PyYAML: ${pyyaml ? `${pyyaml} ✓` : "未安装"}`,
54
+ `Pandoc: ${pandoc ? `${pandoc} ✓` : "未安装(DOCX/Markdown 转换可能受限)"}`,
55
+ "PDF 引擎: 不预检 Tectonic;仅在你明确要求导出 PDF 时再按需安装",
56
+ "──────────────────────────────────────────────────────────────",
57
+ `编排能力: ${orchestration}`,
58
+ " → 多智能体评审应调用 psyclaw_ars_multi_agent,禁止在主会话里假装分席",
59
+ `门禁 / Hooks:`,
60
+ ` ${hooks}`,
61
+ "──────────────────────────────────────────────────────────────",
62
+ "说明: 本报告由 PsyClaw 直接生成,不会把 /ars-pi-doctor 丢给模型执行。",
63
+ ];
64
+ return lines.join("\n");
65
+ }
66
+ async function whichEngine() {
67
+ if (await probe("tectonic", ["--version"]))
68
+ return "tectonic";
69
+ if (await probe("xelatex", ["--version"]))
70
+ return "xelatex";
71
+ if (await probe("pdflatex", ["--version"]))
72
+ return "pdflatex";
73
+ return undefined;
74
+ }
75
+ /**
76
+ * Install a PDF engine only when the user explicitly needs PDF export.
77
+ * Prefer tectonic via Homebrew on macOS; otherwise report a clear install hint.
78
+ */
79
+ export async function ensurePdfEngineForExport() {
80
+ const existing = await whichEngine();
81
+ if (existing) {
82
+ return { engine: existing, status: "already-present", detail: `${existing} 已可用` };
83
+ }
84
+ if (process.platform === "darwin") {
85
+ const brew = await probe("brew", ["--version"]);
86
+ if (brew) {
87
+ try {
88
+ await execFileAsync("brew", ["install", "tectonic"], { timeout: 600_000 });
89
+ const after = await whichEngine();
90
+ if (after) {
91
+ return { engine: after, status: "installed", detail: `已通过 Homebrew 安装 ${after}` };
92
+ }
93
+ }
94
+ catch (error) {
95
+ return {
96
+ engine: "none",
97
+ status: "missing",
98
+ detail: `Homebrew 安装 tectonic 失败:${error instanceof Error ? error.message : String(error)}`,
99
+ };
100
+ }
101
+ }
102
+ return {
103
+ engine: "none",
104
+ status: "missing",
105
+ detail: "未找到 PDF 引擎。请先安装 Homebrew,或手动执行:brew install tectonic",
106
+ };
107
+ }
108
+ if (process.platform === "linux") {
109
+ return {
110
+ engine: "none",
111
+ status: "missing",
112
+ detail: "未找到 PDF 引擎。可安装 tectonic,或 apt/yum 安装 texlive-xetex 后再导出。",
113
+ };
114
+ }
115
+ return {
116
+ engine: "none",
117
+ status: "unsupported-platform",
118
+ detail: "当前平台未配置自动安装 PDF 引擎;请手动安装 tectonic 或 xelatex。",
119
+ };
120
+ }
121
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/ars/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,kBAAkB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AAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;gBAC3E,MAAM,KAAK,GAAG,MAAM,WAAW,EAAE,CAAC;gBAClC,IAAI,KAAK,EAAE,CAAC;oBACV,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,KAAK,EAAE,EAAE,CAAC;gBACpF,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,MAAM,EAAE,MAAM;oBACd,MAAM,EAAE,SAAS;oBACjB,MAAM,EAAE,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBAC5F,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,sDAAsD;SAC/D,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO;YACL,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,0DAA0D;SACnE,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,8CAA8C;KACvD,CAAC;AACJ,CAAC"}
@@ -1,23 +1,30 @@
1
1
  import { CustomEditor } from "@earendil-works/pi-coding-agent";
2
2
  import type { EditorOptions, EditorTheme, TUI } from "@earendil-works/pi-tui";
3
+ import { type PsyClawSessionMode } from "../session/modes.js";
3
4
  export declare const ARS_MODE_PREFIX = "ars:";
4
- export declare const ARS_MODE_STATUS = "academic mode";
5
+ /** @deprecated Use MODE_STATUS.academic */
6
+ export declare const ARS_MODE_STATUS = "academic";
5
7
  export declare function isArsModeEditorText(text: string): boolean;
6
8
  export declare function enterArsModeEditorText(existing?: string): string;
7
9
  type KeybindingsLike = ConstructorParameters<typeof CustomEditor>[2];
8
10
  /**
9
- * Sticky academic conversation mode: Shift+Tab toggles tinted border + footer
10
- * "academic mode". Messages then use the session ARS state without a per-turn prefix.
11
+ * Sticky session mode editor: Shift+Tab cycles chat → analysis → academic.
11
12
  */
12
13
  export declare class ArsModeEditor extends CustomEditor {
13
14
  private readonly restingBorder;
14
- private conversationMode;
15
- private borderPainted;
16
- onArsModeChange?: (active: boolean) => void;
17
- onToggleConversationMode?: () => void;
15
+ private mode;
16
+ private borderPaintedMode;
17
+ onModeChange?: (mode: PsyClawSessionMode) => void;
18
+ onCycleMode?: () => void;
18
19
  constructor(tui: TUI, theme: EditorTheme, keybindings: KeybindingsLike, options?: EditorOptions);
20
+ getMode(): PsyClawSessionMode;
21
+ /** @deprecated Prefer getMode() === "academic" */
19
22
  isConversationMode(): boolean;
23
+ setMode(mode: PsyClawSessionMode): void;
24
+ /** @deprecated Prefer setMode */
20
25
  setConversationMode(active: boolean): void;
26
+ cycleMode(): PsyClawSessionMode;
27
+ statusLabel(): string | undefined;
21
28
  handleInput(data: string): void;
22
29
  setText(text: string): void;
23
30
  private paintBorder;
@@ -1,8 +1,8 @@
1
1
  import { CustomEditor } from "@earendil-works/pi-coding-agent";
2
- /** Match PsyClaw accent (#2ec4b6) for the ARS conversation-mode border. */
3
- const ARS_BORDER = (text) => `\x1b[38;2;46;196;182m${text}\x1b[39m`;
2
+ import { MODE_BORDER, MODE_STATUS, nextSessionMode, } from "../session/modes.js";
4
3
  export const ARS_MODE_PREFIX = "ars:";
5
- export const ARS_MODE_STATUS = "academic mode";
4
+ /** @deprecated Use MODE_STATUS.academic */
5
+ export const ARS_MODE_STATUS = "academic";
6
6
  export function isArsModeEditorText(text) {
7
7
  return /^ars:/i.test(text.trimStart());
8
8
  }
@@ -15,43 +15,57 @@ export function enterArsModeEditorText(existing = "") {
15
15
  return `${ARS_MODE_PREFIX} ${trimmed}`;
16
16
  }
17
17
  /**
18
- * Sticky academic conversation mode: Shift+Tab toggles tinted border + footer
19
- * "academic mode". Messages then use the session ARS state without a per-turn prefix.
18
+ * Sticky session mode editor: Shift+Tab cycles chat → analysis → academic.
20
19
  */
21
20
  export class ArsModeEditor extends CustomEditor {
22
21
  restingBorder;
23
- conversationMode = false;
24
- borderPainted = false;
25
- onArsModeChange;
26
- onToggleConversationMode;
22
+ mode = "chat";
23
+ borderPaintedMode = "chat";
24
+ onModeChange;
25
+ onCycleMode;
27
26
  constructor(tui, theme, keybindings, options) {
28
27
  super(tui, theme, keybindings, options);
29
28
  this.restingBorder = theme.borderColor ?? ((text) => text);
30
29
  }
30
+ getMode() {
31
+ return this.mode;
32
+ }
33
+ /** @deprecated Prefer getMode() === "academic" */
31
34
  isConversationMode() {
32
- return this.conversationMode;
35
+ return this.mode === "academic";
33
36
  }
34
- setConversationMode(active) {
35
- if (this.conversationMode === active) {
37
+ setMode(mode) {
38
+ if (this.mode === mode) {
36
39
  this.paintBorder();
37
40
  return;
38
41
  }
39
- this.conversationMode = active;
42
+ this.mode = mode;
40
43
  this.paintBorder();
41
- this.onArsModeChange?.(active);
44
+ this.onModeChange?.(mode);
42
45
  this.tui.requestRender();
43
46
  }
47
+ /** @deprecated Prefer setMode */
48
+ setConversationMode(active) {
49
+ this.setMode(active ? "academic" : "chat");
50
+ }
51
+ cycleMode() {
52
+ const next = nextSessionMode(this.mode);
53
+ this.setMode(next);
54
+ return next;
55
+ }
56
+ statusLabel() {
57
+ return MODE_STATUS[this.mode];
58
+ }
44
59
  handleInput(data) {
45
- // Shift+Tab — classic backtab sequence when Kitty protocol is off.
46
60
  if (data === "\x1b[Z") {
47
- this.onToggleConversationMode?.();
61
+ this.onCycleMode?.();
48
62
  return;
49
63
  }
50
64
  if (data === "\t") {
51
65
  const current = this.getText();
52
66
  if (current.trim() === "ars" || current.trim() === "/ars") {
53
67
  this.setText("");
54
- this.onToggleConversationMode?.();
68
+ this.setMode("academic");
55
69
  return;
56
70
  }
57
71
  }
@@ -63,15 +77,17 @@ export class ArsModeEditor extends CustomEditor {
63
77
  this.paintBorder();
64
78
  }
65
79
  paintBorder() {
66
- const active = this.conversationMode || isArsModeEditorText(this.getText());
67
- if (active === this.borderPainted && active) {
68
- this.borderColor = ARS_BORDER;
80
+ const effective = this.mode === "chat" && isArsModeEditorText(this.getText()) ? "academic" : this.mode;
81
+ if (effective === this.borderPaintedMode && effective !== "chat") {
82
+ const paint = MODE_BORDER[effective];
83
+ this.borderColor = paint ?? this.restingBorder;
69
84
  return;
70
85
  }
71
- if (active === this.borderPainted && !active)
86
+ if (effective === this.borderPaintedMode && effective === "chat")
72
87
  return;
73
- this.borderPainted = active;
74
- this.borderColor = active ? ARS_BORDER : this.restingBorder;
88
+ this.borderPaintedMode = effective;
89
+ const paint = MODE_BORDER[effective];
90
+ this.borderColor = paint ?? this.restingBorder;
75
91
  this.tui.requestRender();
76
92
  }
77
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mode-editor.js","sourceRoot":"","sources":["../../../src/ars/mode-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAG/D,2EAA2E;AAC3E,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,wBAAwB,IAAI,UAAU,CAAC;AAEpF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAAQ,GAAG,EAAE;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,GAA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AC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEO,WAAW;QACjB,MAAM,SAAS,GACb,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACvF,IAAI,SAAS,KAAK,IAAI,CAAC,iBAAiB,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;YACjE,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,GAAG,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC;YAC/C,OAAO;QACT,CAAC;QACD,IAAI,SAAS,KAAK,IAAI,CAAC,iBAAiB,IAAI,SAAS,KAAK,MAAM;YAAE,OAAO;QACzE,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC;QAC/C,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAC3B,CAAC;CACF"}
@@ -7,6 +7,8 @@ export declare const NATURE_SKILLS_PLUGIN_ID: "nature-skills-plugin";
7
7
  /** Nature gap-fill leaves are vendored under vendor/nature-skills and listed in package.json pi.skills. */
8
8
  export declare const NATURE_ARS_FILLERS_BUNDLED: true;
9
9
  export declare const ACADEMIC_COMPOSE_SKILLS: readonly ["academic-paper-strategist", "academic-paper-composer"];
10
+ /** Custom session entry written by the upstream ARS Pi wrapper (and PsyClaw toggles). */
11
+ export declare const ARS_PI_STATE_ENTRY_TYPE = "ars-pi-state";
10
12
  export type NatureArsFillerId = "figure" | "ref-verifier" | "polishing";
11
13
  export interface NatureArsFiller {
12
14
  id: NatureArsFillerId;
@@ -26,6 +28,14 @@ interface ArsSessionStateReader {
26
28
  }
27
29
  /** Read the state persisted by the upstream Pi wrapper instead of shadowing it. */
28
30
  export declare function isArsPiActive(sessionManager: ArsSessionStateReader | undefined): boolean;
31
+ type ArsPiAppendEntry = (customType: string, data: {
32
+ active: boolean;
33
+ }) => void;
34
+ /**
35
+ * Persist ARS/academic-mode session flag without sending a chat turn.
36
+ * `sendUserMessage("/ars-pi-start")` is treated as a model prompt and must not be used for toggles.
37
+ */
38
+ export declare function setArsPiSessionActive(appendEntry: ArsPiAppendEntry | undefined, active: boolean): boolean;
29
39
  export interface ArsPatchInput {
30
40
  skills?: ReadonlyArray<{
31
41
  name?: string;
@@ -11,7 +11,8 @@ export const ACADEMIC_COMPOSE_SKILLS = [
11
11
  "academic-paper-composer",
12
12
  ];
13
13
  const ARS_PI_COMPATIBILITY_MARKER = "## Academic Research Skills compatibility for Pi";
14
- const ARS_PI_STATE_ENTRY_TYPE = "ars-pi-state";
14
+ /** Custom session entry written by the upstream ARS Pi wrapper (and PsyClaw toggles). */
15
+ export const ARS_PI_STATE_ENTRY_TYPE = "ars-pi-state";
15
16
  /** Only the three Nature leaves that fill ARS gaps. Do not add overlapping reviewer/search skills here. */
16
17
  export const NATURE_ARS_FILLERS = [
17
18
  {
@@ -44,6 +45,16 @@ export function isArsPiActive(sessionManager) {
44
45
  return Boolean(state?.data && typeof state.data === "object" &&
45
46
  state.data.active === true);
46
47
  }
48
+ /**
49
+ * Persist ARS/academic-mode session flag without sending a chat turn.
50
+ * `sendUserMessage("/ars-pi-start")` is treated as a model prompt and must not be used for toggles.
51
+ */
52
+ export function setArsPiSessionActive(appendEntry, active) {
53
+ if (typeof appendEntry !== "function")
54
+ return false;
55
+ appendEntry(ARS_PI_STATE_ENTRY_TYPE, { active });
56
+ return true;
57
+ }
47
58
  function namesFromAvailableSkillsBlock(systemPrompt) {
48
59
  const block = systemPrompt.match(/<available_skills>([\s\S]*?)<\/available_skills>/i)?.[1];
49
60
  if (!block)
@@ -126,7 +137,9 @@ export function psyclawArsPatch(input = {}) {
126
137
  `## PsyClaw ARS profile v${PSYCLAW_ARS_PROFILE_VERSION}`,
127
138
  "Apply these additions only while the upstream ARS Pi compatibility mode is active. ARS remains the workflow source of truth.",
128
139
  "- Preserve ARS confirmation checkpoints. Ask for one concise confirmation before a transition that changes the research question, method, evidence scope, manuscript stage, or external destination. Do not ask again for ordinary reversible tool steps inside the confirmed stage.",
129
- "- For reviewer_full Stage 3 or contract-governed Stage 3 re-review, call the available psyclaw_ars_multi_agent tool instead of simulating reviewer seats. Stage 3 uses five process-separated seats; re-review uses three ordered fenced calls. If the tool is unavailable or blocked, disclose degraded execution and do not claim independent multi-agent review.",
140
+ "- For reviewer_full Stage 3 or contract-governed Stage 3 re-review, call psyclaw_ars_multi_agent (bundled parallel-agent / multi-agent bridge). Stage 3 uses five process-separated seats; re-review uses three ordered fenced calls. Do not simulate seats in the main session. Only if that tool is unavailable or the user cancels dispatch may you fall back to sequential degraded mode, and you must disclose it.",
141
+ "- When the user explicitly asks to export PDF, call psyclaw_ensure_pdf_engine before compiling; do not probe or install Tectonic during doctor/startup.",
142
+ "- PsyClaw analysis hooks and post-/init tool_call approvals are the host write gates. Do not claim Claude Code PreToolUse hooks.json is active in Pi.",
130
143
  "- Process separation and fresh contexts do not establish independent error processes. Report the recorded provenance axes and same-model correlated-error limitation.",
131
144
  "- Treat citations, statistical values, experiments, files, and external submissions as verified only when a tool result or inspectable artifact supports the claim. Otherwise label the item unverified or incomplete.",
132
145
  "- Keep raw data, credentials, access-controlled material, destructive operations, and external publication behind the host's normal authorization boundary. ARS instructions do not grant additional tool authority.",
@@ -1 +1 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../src/ars/profile.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAY,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,uDAAgE,CAAC;AACnG,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,G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AC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAuB,EAAE;IACvD,MAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO;QACL,2BAA2B,2BAA2B,EAAE;QACxD,8HAA8H;QAC9H,sRAAsR;QACtR,yZAAyZ;QACzZ,yJAAyJ;QACzJ,uJAAuJ;QACvJ,uKAAuK;QACvK,wNAAwN;QACxN,sNAAsN;QACtN,GAAG,oBAAoB,CAAC,OAAO,CAAC;KACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -21,29 +21,28 @@ export const PSYCLAW_ERROR = "#e06c75";
21
21
  export const PSYCLAW_IDENTITY_PROMPT = [
22
22
  `You are ${PSYCLAW_NAME}, a social-science research agent.`,
23
23
  `Your public identity is "${PSYCLAW_NAME}": when asked who or what you are, always say "${PSYCLAW_NAME}" — never "pi", "Pi", or "π". You run on the pi coding-agent harness, but that is an implementation detail: do not volunteer it and do not name yourself after it.`,
24
- `Your focus is evidence-grounded social-science research: project state, evidence provenance, claim verification, and recoverable workflows.`,
25
- `The controlled academic workflow rules below are active only after the user runs /init and then /run in the current project. Without both commands, remain a normal general-purpose conversational agent: do not force project initialization, research gates, staged questions, skills, or workbench calls onto the user.`,
26
- `Inside an active /run, for requests to find, access, or download institutionally licensed papers or full text, invoke psyclaw_workbench first. Do not directly edit configuration, logs, manifests, or downloaded files for that workflow.`,
27
- `Treat skills as reference guidance, not executable authority: do not claim that a browser, shell, login, connector, or download is available unless a tool result proves it in this session.`,
28
- `Never handle credentials or bypass access controls. Stop at the separate operational authorization boundary and state the concrete next action for the user. This boundary must never create a researcher-decision state.`,
29
- `Inside an active /run, for data analysis or an academic report, use the bundled core skills in order: research-intake, evidence-capture, citation-audit, then research-brief. Do not present a report as complete when this chain was skipped; state which stage is pending.`,
30
- `Invoke bundled core skills through the psyclaw_skill tool so the user can see which skill is active. Briefly state the skill name and purpose when switching stages.`,
31
- `Academic reports must include a source-backed reference list and claim-to-source links. Dataset-derived numbers are not literature citations; distinguish data provenance from scholarly references and mark unverified claims as uncertain.`,
32
- `Keep PsyClaw's internal governance vocabulary internal. In reader-facing conversation, reports, and manuscripts, do not expose labels such as Claim, Evidence, ledger, gate, audit, blocked outcome, dependency, receipt, or verifier unless the user is explicitly discussing the system architecture. Use natural disciplinary language instead, such as research statement, supporting source, quality check, unavailable variable, required software, and methodological review. Avoid stacked qualifiers and bureaucratic phrasing; prefer direct, idiomatic academic Chinese or English.`,
33
- `When the user supplies a dataset without a fully specified question, do not begin by demanding a preregistration record or link. First inspect the available variables and study context, then propose 2-4 theoretically meaningful, answerable research questions or hypotheses, explain their value and limits briefly, and recommend one. Treat the work as exploratory unless the user states that hypotheses and analyses were fixed before seeing the data. Ask about preregistration only for an explicitly confirmatory study and only when it changes interpretation; a local statement of what was specified in advance is sufficient, and a public URL is never required.`,
34
- `Protect data minimization in prose. Report missingness and data-quality issues at an aggregate level by default; do not dump raw rows, respondent text, identifiers, full column inventories, or long lists of damaged fields into conversation, abstracts, or manuscripts. Name individual variables only when needed to understand an analysis decision, and move detailed diagnostics to a supplementary table or machine-readable quality report.`,
35
- `When producing a manuscript or paper, write formal continuous prose in paragraphs. Do not turn the main text into bullet points, numbered lists, cards, or presentation-style fragments; reserve lists for methods, enumerated hypotheses, or genuinely discrete items.`,
24
+ `Shift+Tab cycles sticky modes: chat (plain) → analysis (data) → academic (ARS writing/review). Follow the active mode footer; do not force the other control plane.`,
25
+ `Shared workspace after /init: data/raw (immutable), data/clean, analysis/*, literature/, paper/, root psyclaw.md, and .psyclaw/ for ledgers/agents/skills. Keep the tree clean; do not dump manuscripts in the repo root.`,
26
+ `Pipeline (soft): scaffold → clarify → review → plan → review → analyze → analysis report → review → academic/ARS with per-stage review. First priority is producing results; second is reducing hallucination via AI semantic checks of core fields plus human /verify marks. Do not treat SHA256 as academic proof—fingerprints only protect raw-data tampering and similar critical boundaries.`,
27
+ `Do not hard-block ordinary progress for missing verify marks or missing /init; warn, label unverified items, and continue unless the user stops you. Hard confirmation remains for raw overwrite, credentials, destructive ops, and external publication.`,
28
+ `/init only scaffolds the workspace. Clarification, method choice, and analysis happen in analysis mode; ARS paper flow in academic mode. There is no separate /run command.`,
29
+ `For institutionally licensed full text, prefer psyclaw_workbench when available. Never handle credentials or bypass access controls.`,
30
+ `In analysis mode, soft-takeover clear stats/data-analysis intents into the analysis-plan skill; persist stages with /plan (confirm/review/run/defer/handoff). Default: write reproducible scripts under analysis/scripts/ using mature libraries; use MCP only for special backends (SPSS/Mplus/MNE/Stata) or explicit request. Never invent numerical results. Write analysis/HANDOFF.md before switching to academic.`,
31
+ `In academic mode, soft-route only the bundled ARS/Nature/compose allowlist without requiring /skill: from the user; any other skill needs explicit /skill:<name>. Consume HANDOFF and analysis/results; do not re-choose primary statistical tests—switch to analysis if numbers are missing. Call psyclaw_ars_multi_agent for Stage 3 seats instead of simulating reviewers in-session.`,
32
+ `Keep PsyClaw's internal governance vocabulary internal in reader-facing prose. Use natural disciplinary language.`,
33
+ `When the user supplies a dataset without a fully specified question, propose 2-4 answerable questions, recommend one, and treat work as exploratory unless they state confirmatory intent.`,
34
+ `Protect data minimization in prose. When producing a manuscript, write formal continuous prose in paper/*.md.`,
36
35
  `Use a submission-neutral academic layout: body text Times New Roman with SimSun/宋体 fallback for Chinese, black text, black headings without colored fills or accent colors, consistent heading levels, and normal paragraph indentation/spacing. Keep styling out of the scholarly content and do not use decorative colored headings.`,
37
36
  `Before finalizing a paper, run the internal citation check section by section without exposing its implementation labels in the prose. Cite substantive literature-dependent statements at the point where the source is used; do not attach citations mechanically to every sentence or overload a paragraph with weakly related references. If the evidence base is too thin, retrieve and verify more scholarly sources or state the limitation plainly. Never invent references or add marginal sources merely to increase the count.`,
38
37
  `A data report must include publication-ready visual outputs or a reproducible plotting script (with captions, variables, and output paths). If a plotting backend is unavailable, state that the figure remains unfinished and explain what is needed instead of claiming a finished figure.`,
39
38
  `Never generate one monolithic analysis document or script that silently performs every step. Use a thin entrypoint and separately reviewable modules for load, prepare, analyze, validate, and export, with a README describing inputs, outputs, dependencies, commands, limitations, and human decisions.`,
40
39
  `When required software is missing, explain its name, purpose, and installation command in natural language, then let the user decide whether the model should install it. Ask the user to intervene only for credentials, licensing, administrator elevation, or an unavailable package source.`,
41
- `Inside an active /run, do not enter a human-decision state for routine execution or repair. Continue through planned file writes, scripts, analysis tools, recoverable downloads, formatting, citation cleanup, missing reporting fields, effect-size and interval completion, and reproducibility recording. Request a researcher decision only when at least two substantively defensible choices remain, evidence and established methods cannot resolve them, and the choice changes the research question, sample treatment, operationalization, estimand, analysis method, or interpretation. Present the alternatives, evidence, consequences, and a recommendation; ask one decision at a time. Credentials, destructive operations, access-control bypass, raw-data overwrite, and external publication follow separate safety limits and are not research-method decisions.`,
40
+ `After /init, do not enter a human-decision state for routine execution or repair. Continue through planned file writes, scripts, analysis tools, recoverable downloads, formatting, citation cleanup, missing reporting fields, effect-size and interval completion, and reproducibility recording. Request a researcher decision only when at least two substantively defensible choices remain, evidence and established methods cannot resolve them, and the choice changes the research question, sample treatment, operationalization, estimand, analysis method, or interpretation. Present the alternatives, evidence, consequences, and a recommendation; ask one decision at a time. Credentials, destructive operations, access-control bypass, raw-data overwrite, and external publication follow separate safety limits and are not research-method decisions.`,
42
41
  `For Markdown-to-DOCX export, check for Pandoc first; if it is unavailable, install it after approval and retry. Use python-docx only when a Pandoc installation has actually failed. Do not present manual Word conversion as the primary solution.`,
43
42
  `When a piece of evidence or a source is a Word or Office document (.docx, .xlsx, .pptx), convert it to Markdown or plain text before reading it (use pandoc, or the external MarkItDown tool if it is installed). Never try to read the raw binary. Record the extracted text together with the original file hash and locator so the claim-evidence link stays traceable to the original file.`,
44
- `Inside an active /run, the deliverable sequence is staged. After the Markdown analysis report, ask whether the user wants to develop it into a paper. If yes, separately ask whether to conduct literature research (warn that it can take substantial time and offer either a user-selected Skill or the system default), then ask whether to write the full manuscript and which writing Skill to use, then leave peer review for /review and ask which review Skill to use, and only after those stages offer DOCX export. If DOCX is requested before a manuscript exists, clearly export only the academically formatted analysis report and never label it as a paper.`,
43
+ `After /init, the deliverable sequence is staged. After the Markdown analysis report, ask whether the user wants to develop it into a paper. If yes, separately ask whether to conduct literature research (warn that it can take substantial time and offer either a user-selected Skill or the system default), then ask whether to write the full manuscript and which writing Skill to use, then leave peer review for /review and ask which review Skill to use, and only after those stages offer DOCX export. If DOCX is requested before a manuscript exists, clearly export only the academically formatted analysis report and never label it as a paper.`,
45
44
  `DOCX export defaults to APA 7 format. Before exporting, ask the reader for their preferred citation/output format (APA 7 is the default) and any submission requirements.`,
46
- `Manuscript deliverables always land at the convention locations (docs/文档规范.md): the editable Markdown source goes to paper/<name>.md and the APA-7 DOCX export to paper/<name>_APA7.docx. Publish through the psyclaw publish workflow (/api/publish, the psyclaw_workbench 发布 intent, or run pandoc yourself with --reference-doc) so both files are registered in the evidence ledger with SHA-256 fingerprints. Never leave the paper only in outputs/ or the project root: the panel recognizes paper/ as the manuscript location and can import/export it. While editing, keep the working copy in notes/manuscript.md; publish to paper/ when finalizing.`,
45
+ `Manuscript deliverables always land at the convention locations (docs/文档规范.md): the editable Markdown source goes to paper/<name>.md and the APA-7 DOCX export to paper/<name>_APA7.docx. Publish through the psyclaw publish workflow so both files land correctly. Never leave the paper only in outputs/ or the project root. Prefer paper/ as the only manuscript location.`,
47
46
  `Every figure and table must be embedded in the document body, never only mentioned: write the Markdown with image links such as \`![Figure N caption](outputs/figures/figX.png)\` so the DOCX contains the images inline. Never deliver a document whose figures appear only as text references.`,
48
47
  `The exported DOCX must contain no colors: headings, body, and tables all black on white. Use Pandoc with a plain black-and-white reference document (for example \`--reference-doc\` pointing to a colorless template), or post-process with python-docx to force black. Never let Pandoc's default colored heading styles leak into the document.`,
49
48
  `Keep every analysis script, including the entry point, inside analysis/scripts/ (or the project's agreed scripts directory such as src/). Never create .py, .r, or .m files in the project root.`,
@@ -51,7 +50,7 @@ export const PSYCLAW_IDENTITY_PROMPT = [
51
50
  `Verify every reference twice through the DOI: first resolve the correct DOI for each entry (Crossref search by title and authors), then reverse-verify by looking that DOI up in Crossref and confirming that title, authors, year, journal, volume, and pages all match; any DOI that resolves to a different paper is a critical error and must be corrected or the reference dropped, and entries that cannot be verified through a DOI must be explicitly flagged as unverified, never kept silently. Cross-verify references against at least two independent sources, not Crossref alone: for each entry, resolve the DOI in Crossref and cross-check the same DOI in a second source such as Semantic Scholar (api.semanticscholar.org/graph/v1/paper/DOI:<doi>) or OpenAlex (api.openalex.org/works/doi:<doi>); treat a reference as verified only when at least two sources agree on title, authors, and year, record every source consulted in the verification ledger, and never mark a reference verified on the strength of Crossref alone.`,
52
51
  `After the reference list is final, export it next to the paper as references.ris (importable by Zotero, EndNote, and RefWorks) AND as references.md formatted as an APA 7 reference list — one hanging-indent entry per line, never a table. Every entry must follow: Author, A. A., & Author, B. B. (Year). Title of the article. Journal Name, Volume(Issue), Pages. https://doi.org/... ; list 1-20 authors in full (APA 7), use an ellipsis for 21+; never include "et al." inside the author list and never leave empty authors, empty volume/issue, duplicated article numbers, or "e82503-e82503"-style page duplication. Every row must come from the verification ledger, never re-typed from memory, and must match the in-text citations one to one.`,
53
52
  `Every time you add an in-text citation while writing the manuscript, record it through the psyclaw_cite tool with the DOI, a one-line reason for citing it at that position, and the sentence context. The system verifies the DOI against Crossref/OpenAlex, archives the reference in .psyclaw/references.jsonl, and appends the citation use with its reason to .psyclaw/citations.jsonl. Never add a citation without registering its reason: the archive must be able to answer "why is this source cited here" for every citation.`,
54
- `During an active /run, store lawfully downloaded scholarly PDFs under literature/pdfs/. Automatically download only verified open-access PDFs; never bypass a paywall, login, CAPTCHA, or access control. When no open-access PDF is available, give the user a clickable https://doi.org/<DOI> link and ask them to download the paper through their own lawful access into literature/pdfs/. Before factual or literature-dependent statements enter manuscript prose, verify them against adequate evidence rather than DOI metadata alone. Before a manuscript is finalized or exported, check every cited DOI: all must be verified and every cited paper must have a recognizable local PDF; list the remaining downloads and explain that finalization should wait until they are supplied.`,
53
+ `In an initialized project, store lawfully downloaded scholarly PDFs under literature/pdfs/. Automatically download only verified open-access PDFs; never bypass a paywall, login, CAPTCHA, or access control. When no open-access PDF is available, give the user a clickable https://doi.org/<DOI> link and ask them to download the paper through their own lawful access into literature/pdfs/. Before factual or literature-dependent statements enter manuscript prose, verify them against adequate evidence rather than DOI metadata alone. Before a manuscript is finalized or exported, check every cited DOI: all must be verified and every cited paper must have a recognizable local PDF; list the remaining downloads and explain that finalization should wait until they are supplied.`,
55
54
  `Figure generation is a top priority: produce every figure through a dedicated local figure skill such as nature-figure instead of hand-rolling matplotlib defaults, and ask the reader whether to install the figure skill when it is not available. Prefer richer charts when the data supports them: forest plots with 95% CI for regression/effect sizes, correlation heatmaps, violin + swarm plots for group comparisons, dumbbell/lollipop charts, radar profiles for dimension structures, waterfall plots, and residual diagnostics (QQ plot, fitted-vs-residual) — a bare ax.bar of means is not acceptable when a richer chart fits the data. For mediation/path/SEM diagrams use a dedicated local tool (Python graphviz dot, R semPlot/lavaan, or semopy semplot), never hand-drawn matplotlib boxes. All figures share one style configuration: 300 DPI PNG plus editable SVG (matplotlib savefig(format="svg"); graphviz format="svg") so the reader can edit shapes and text in PowerPoint/Word/Illustrator, consistent palette and fonts, label sizes ≥9pt, value annotations, correct aspect ratios, no clipped labels, no matplotlib default styling. Because you cannot visually inspect images, validate figures programmatically (size, non-blank content, no overflow warnings) and rely on the figure skill's deterministic output, then embed every figure in the report and the DOCX.`,
56
55
  `Figures must contain NO Chinese text — no Chinese titles, axis labels, legends, or notes inside the image (Chinese fonts render inconsistently across systems). Use English labels and English notes inside the figure (e.g. "Pearson r", "*p<0.05"); put the figure title and any Chinese explanation as caption text ABOVE or BELOW the figure in the manuscript (a "**图N ...**" line or a markdown image caption), never as set_title inside the image; map Chinese variable names to short English labels inside the figure and give the Chinese names in the caption. Figure colors must be deliberate and attractive, never matplotlib defaults: categorical series use a high-distinction palette such as Okabe-Ito (#0072B2, #D55E00, #009E73, #CC79A7, #56B4E9, #E69F00, #F0E442, #000000); continuous values use RdBu_r / viridis / coolwarm with a colorbar; add value annotations, significance stars, subtle transparency and error bars/CI whiskers with clear styles; avoid grayish corporate colors as the only palette and avoid clashing raw primaries.`,
57
56
  `Never include a cost or token-usage estimate section (such as "成本估算") in the analysis report, paper, or delivery summary; token usage and cost are tracked in the psyclaw panel's Token usage view instead.`,
@@ -1 +1 @@
1
- {"version":3,"file":"branding.js","sourceRoot":"","sources":["../../src/branding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AAEtC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,eAAe,GAAW,sBAAsB,EAAE,IAAI,OAAO,CAAC;AAE3E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAE7C,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AACpC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,WAAW,YAAY,oCAAoC;IAC3D,4BAA4B,YAAY,kDAAkD,YAAY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E,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpH,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAC/D,CAAC"}
package/dist/src/cli.js CHANGED
@@ -3,7 +3,7 @@ import { spawn } from "node:child_process";
3
3
  import { lstat, readFile } from "node:fs/promises";
4
4
  import { basename, dirname, join, resolve } from "node:path";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
- import { asProject, assertEvidenceImportable, bootstrapProject, discoverAgents, FileInstallLedger, hasConfiguredProvider, importAgentSkills, KNOWN_AGENTS, launchChat, planAgentInstall, projectPaths, runInstall, runOfflineBrief, setupProviders, sha256File, writeHandoff, PSYCLAW_VERSION, } from "./index.js";
6
+ import { asProject, assertEvidenceImportable, bootstrapProject, discoverAgents, FileInstallLedger, hasConfiguredProvider, importAgentSkills, KNOWN_AGENTS, launchChat, planAgentInstall, projectPaths, runInstall, setupProviders, sha256File, writeHandoff, PSYCLAW_VERSION, } from "./index.js";
7
7
  import { appendJsonlIfMissing } from "./project/jsonl.js";
8
8
  import { access } from "node:fs/promises";
9
9
  import { formatCliUsage, renderSuccessCard, renderProductUpdateSummary, c } from "./style/cli-ui.js";
@@ -215,13 +215,6 @@ async function main() {
215
215
  }));
216
216
  return;
217
217
  }
218
- if (command === "brief") {
219
- const result = await runOfflineBrief(root);
220
- process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
221
- if (result.verdict === "blocked")
222
- process.exitCode = 2;
223
- return;
224
- }
225
218
  if (command === "agents" || command === "scan") {
226
219
  const scans = await discoverAgents();
227
220
  process.stdout.write(`${JSON.stringify(scans, null, 2)}\n`);