dsh-zju-lecture-note 2.2.5 → 2.2.7

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/lib/index.js CHANGED
@@ -148,9 +148,29 @@ function skillDir(skillName) {
148
148
  }
149
149
 
150
150
  const Config = Schema.object({
151
- python: Schema.string().default(""),
152
- timeoutMs: Schema.number().min(1000).max(900000).default(120000),
153
- registerSkill: Schema.boolean().default(true),
151
+ python: Schema.string()
152
+ .description(
153
+ "Python 解释器路径(默认留空):留空时依次尝试 DeepSeek Harness 自带的 Python、"
154
+ + "py -3、python、python3。只有自带解释器不可用,或你要固定某个虚拟环境时才填写绝对路径。",
155
+ )
156
+ .default("")
157
+ .volatile(),
158
+ timeoutMs: Schema.number()
159
+ .min(1000)
160
+ .max(900000)
161
+ .description(
162
+ "普通工具超时(毫秒,默认 120000):PDF / Typst 类工具至少 300000,"
163
+ + "投影下载与登录窗口至少 600000,改小不会绕过这些下限。",
164
+ )
165
+ .default(120000)
166
+ .volatile(),
167
+ registerSkill: Schema.boolean()
168
+ .description(
169
+ "注册随包 Skill(默认开启):关闭后 Agent 不再看到智云课堂讲义工作流与用户命令,"
170
+ + "但工具仍可调用;适合你自己已有一份同类 Skill 的情况。",
171
+ )
172
+ .default(true)
173
+ .volatile(),
154
174
  renderPdf: Schema.boolean()
155
175
  .description(
156
176
  "写入讲义后自动排成同名 PDF(默认开启):让阅读体验从 Markdown 提升到可打印的讲义。"
@@ -196,6 +216,20 @@ const Config = Schema.object({
196
216
  )
197
217
  .default(true)
198
218
  .volatile(),
219
+ typstPath: Schema.string()
220
+ .description(
221
+ "Typst 可执行文件(默认留空):留空时依次查找插件缓存、PATH 与常见安装目录;"
222
+ + "填写绝对路径可固定版本或使用自建二进制。",
223
+ )
224
+ .default("")
225
+ .volatile(),
226
+ typstMirror: Schema.string()
227
+ .description(
228
+ "Typst 下载镜像前缀(默认留空):例如 https://ghfast.top/;自动安装 Typst 时加在"
229
+ + " GitHub Release URL 前,留空直连 GitHub。",
230
+ )
231
+ .default("")
232
+ .volatile(),
199
233
  });
200
234
 
201
235
  /** Optional tool groups; every other tool belongs to the always-on transcript core. */
@@ -247,6 +281,35 @@ function featureFlags(config = {}) {
247
281
  embedSlideImages: enableSlides && value("embedSlideImages") === true,
248
282
  enableLoginTools: value("enableLoginTools") === true,
249
283
  typstAutoInstall: value("typstAutoInstall") !== false,
284
+ registerSkill: value("registerSkill") !== false,
285
+ };
286
+ }
287
+
288
+ /**
289
+ * Project the plugin configuration onto the Python bridge options.
290
+ *
291
+ * This runs once at start-up and again on every live settings edit, so the
292
+ * agent never keeps talking to a child process configured by a stale value.
293
+ * Strings are read through `readSetting` as well because `.volatile()` fields
294
+ * are `{ get() }` references too.
295
+ *
296
+ * @param {object} config plugin config (or `{}`)
297
+ * @returns {object} options accepted by {@link ZjuBridge}
298
+ */
299
+ function bridgeOptions(config = {}) {
300
+ const flags = featureFlags(config);
301
+ const timeout = Number(readSetting(config, "timeoutMs"));
302
+ return {
303
+ python: String(readSetting(config, "python") ?? ""),
304
+ timeoutMs: Number.isFinite(timeout) && timeout > 0 ? timeout : 120000,
305
+ enableSlides: flags.enableSlides,
306
+ embedSlideImages: flags.embedSlideImages,
307
+ enableStudyNotes: flags.enableStudyNotes,
308
+ enableLoginTools: flags.enableLoginTools,
309
+ renderPdf: flags.renderPdf,
310
+ typstAutoInstall: flags.typstAutoInstall,
311
+ typstPath: String(readSetting(config, "typstPath") ?? ""),
312
+ typstMirror: String(readSetting(config, "typstMirror") ?? ""),
250
313
  };
251
314
  }
252
315
 
@@ -269,6 +332,25 @@ const SLOW_TOOL_TIMEOUT_MS = 600000;
269
332
  /** Typst compiles a notebook and renders every page to PNG: also slow. */
270
333
  const COMPILE_TOOL_TIMEOUT_MS = 300000;
271
334
 
335
+ /** PDF-capable tools may trigger a one-time Typst download/compile. */
336
+ const PDF_TOOL_NAMES = new Set([
337
+ "zju_write_note",
338
+ "zju_check_note",
339
+ "zju_build_study_notes",
340
+ "zju_doctor",
341
+ ]);
342
+
343
+ /** Resolve one tool's effective timeout from the user setting and its floor. */
344
+ function toolTimeoutFor(toolName, timeoutMs) {
345
+ if (toolName === "zju_fetch_slides" || toolName === "zju_login") {
346
+ return Math.max(timeoutMs, SLOW_TOOL_TIMEOUT_MS);
347
+ }
348
+ if (PDF_TOOL_NAMES.has(toolName)) {
349
+ return Math.max(timeoutMs, COMPILE_TOOL_TIMEOUT_MS);
350
+ }
351
+ return timeoutMs;
352
+ }
353
+
272
354
  const SYSTEM_PROMPT = [
273
355
  "适用范围:仅处理浙大智云课堂(classroom.zju.edu.cn)回放与讲义任务;其他任务请忽略本段。",
274
356
  "主链路:把链接或 sub_id 直接交给 zju_fetch_transcript(默认 per_minute;长课 chunked;同一节课只抓一次,per_segment 仅在确实需要秒级时间戳时用)→ 可选 zju_extract_courseware → zju_write_note 一次写入。write_note 会自动命名、拒绝静默覆盖、修公式、校验,并按设置自动排版同名 PDF;不要再调 zju_parse_url,也不要对同一份讲义重复调 zju_check_note。",
@@ -276,7 +358,6 @@ const SYSTEM_PROMPT = [
276
358
  "例题/定理/定义/证明要写成行首标记([例] 标题 —— 正文 / [定理] … / [定义] … / [证明] …),"
277
359
  + "不要写成 `#### 例 1:…` 或 `**证明**`——那种写法在 PDF 里只是小标题和粗体,排不出方框(工具会报 pseudo_box 警告)。",
278
360
  "用户只说「整理这节课」时按完整链路一次做完,不要只交字幕摘要;只有明确说「只要速记 / 只要 Markdown」时才省略这些增强内容。",
279
- "ASR 可靠度低时按 Skill 的数学规范复算,并在讲义开头写明需要人工复核的时间点;公式必须符合 Skill 的「公式书写规范」。",
280
361
  "交付时给出 Markdown 路径;有 PDF 时一并给出 PDF 路径。不要声称看过自己无法查看的图片。",
281
362
  "隐私边界:登录态只在本机安全保存或进程内存中使用;工具不接受、也不回显 Cookie / 密码 / token 明文;不要向用户索要 Cookie,或把它写进对话、文件、命令。",
282
363
  "字幕先匿名;401/403 时先自动使用本机登录态;仍失败就调用 zju_login(url=<这节课链接>) 打开独立登录窗口,让用户在窗口里正常登录(成功后自动关闭并安全保存),然后重试字幕一次。不要让用户开开发者工具、手工配置 Cookie 文件,也不要把 401/403 直接归因校园网。",
@@ -328,15 +409,27 @@ function pdfFeatureRule(enabled) {
328
409
  + "用户要 PDF 时提示他在插件设置里打开「自动排版 PDF 讲义」。";
329
410
  }
330
411
 
331
- function studyFeatureRule(enabled) {
332
- return enabled
333
- ? "填空笔记已开启:写完讲义后默认再出一份填空版(用户只要 Markdown/PDF 或明确说不用时跳过)——"
334
- + "zju_build_study_notes(mode=draft) 先把讲义搬成底稿:底稿是**纯 Markdown**(公式保持 LaTeX,表格保持 Markdown),"
335
- + "你只需补 [直觉]/[练习]/[边注] 占位符、正文该挖空的地方写 ____,**不要重写全文**;"
336
- + "挖空别一处一处改:把所有 {old, new} 交给 mode=patch 一次写回(省掉十几次单条编辑);"
337
- + "然后 mode=compile 一次性转 Typst 并出 PDF(PDF 会落在底稿同目录)。排版规范交给 scholia-notes Skill。"
338
- : "填空笔记已关闭(插件设置 enableStudyNotes=false):本会话没有注册 zju_build_study_notes,"
412
+ function studyFeatureRule(enabled, skillEnabled = true) {
413
+ if (!enabled) {
414
+ return "填空笔记已关闭(插件设置 enableStudyNotes=false):本会话没有注册 zju_build_study_notes,"
339
415
  + "不要调用或假装调用;用户需要时提示他在插件设置里打开「填空式学习笔记」。";
416
+ }
417
+ const tail = skillEnabled
418
+ ? "排版规范交给 scholia-notes Skill。"
419
+ : "排版规范按工具说明与通用排版规范执行(随包 Skill 已关闭)。";
420
+ return "填空笔记已开启:写完讲义后默认再出一份填空版(用户只要 Markdown/PDF 或明确说不用时跳过)——"
421
+ + "zju_build_study_notes(mode=draft) 先把讲义搬成底稿:底稿是**纯 Markdown**(公式保持 LaTeX,表格保持 Markdown),"
422
+ + "你只需补 [直觉]/[练习]/[边注] 占位符、正文该挖空的地方写 ____,**不要重写全文**;"
423
+ + "挖空别一处一处改:把所有 {old, new} 交给 mode=patch 一次写回(省掉十几次单条编辑);"
424
+ + "然后 mode=compile 一次性转 Typst 并出 PDF(PDF 会落在底稿同目录)。" + tail;
425
+ }
426
+
427
+ function formulaFeatureRule(skillEnabled) {
428
+ return skillEnabled
429
+ ? "ASR 可靠度低时按 Skill 的数学规范复算,并在讲义开头写明需要人工复核的时间点;"
430
+ + "公式必须符合 Skill 的「公式书写规范」。"
431
+ : "ASR 可靠度低时按通用数学规范复算,并在讲义开头写明需要人工复核的时间点;"
432
+ + "公式使用标准 LaTeX,不臆造符号。";
340
433
  }
341
434
 
342
435
  function loginFeatureRule(enabled) {
@@ -352,15 +445,24 @@ function loginFeatureRule(enabled) {
352
445
  + "zju_read_browser_cookie,不要调用。" + core + "投影抓取也会自行解析登录态。";
353
446
  }
354
447
 
448
+ function skillFeatureRule(enabled) {
449
+ if (enabled) return "";
450
+ return "随包 Skill 未注册(插件设置 registerSkill=false):不要假设 zju-lecture-summarizer "
451
+ + "的详细规范可用,按本条提示与工具说明完成字幕 → 讲义链路;"
452
+ + "用户需要工作流说明时,告诉他可在设置里打开「注册随包 Skill」。";
453
+ }
454
+
355
455
  /** Build the (short) task prompt for one configuration. */
356
456
  function buildSystemPrompt(flags) {
357
457
  return [
358
458
  SYSTEM_PROMPT,
359
459
  slidesFeatureRule(flags.enableSlides, flags.embedSlideImages),
360
460
  pdfFeatureRule(flags.renderPdf),
361
- studyFeatureRule(flags.enableStudyNotes),
461
+ studyFeatureRule(flags.enableStudyNotes, flags.registerSkill),
462
+ formulaFeatureRule(flags.registerSkill),
362
463
  loginFeatureRule(flags.enableLoginTools),
363
- ].join("\n");
464
+ skillFeatureRule(flags.registerSkill),
465
+ ].filter(Boolean).join("\n");
364
466
  }
365
467
 
366
468
  const jsonOutput = {
@@ -516,12 +618,14 @@ function findShadowingSkillCopy(skillName) {
516
618
  *
517
619
  * @returns {void}
518
620
  */
519
- function warnOnShadowingSkillCopy(flags = featureFlags({})) {
621
+ function warnOnShadowingSkillCopy(flags = featureFlags({}), warned = new Set()) {
520
622
  for (const spec of SKILL_SPECS) {
521
623
  if (spec.when === "slides" && !flags.enableSlides) continue;
522
624
  if (spec.when === "study" && !flags.enableStudyNotes) continue;
625
+ if (warned.has(spec.name)) continue;
523
626
  const shadow = findShadowingSkillCopy(spec.name);
524
627
  if (!shadow) continue;
628
+ warned.add(spec.name);
525
629
  let stale = true;
526
630
  let bundledHash = "?";
527
631
  let shadowHash = "?";
@@ -545,52 +649,51 @@ function warnOnShadowingSkillCopy(flags = featureFlags({})) {
545
649
  }
546
650
 
547
651
  function apply(ctx, config = {}) {
548
- // One normalised feature object drives tools, skills and the prompt. The
549
- // optional modules default to off, so the verified transcript path never
550
- // pays for a login/cookie/screenshot/typst dependency it did not ask for.
551
- const flags = featureFlags(config);
552
- const timeoutMs = Number(readSetting(config, "timeoutMs")) > 0
553
- ? Number(readSetting(config, "timeoutMs"))
554
- : 120000;
555
- const bridge = new ZjuBridge({
556
- python: readSetting(config, "python"),
557
- timeoutMs,
558
- ...flags,
559
- });
652
+ // One normalised configuration drives tools, skills, prompt and Python
653
+ // child processes. `.volatile()` fields are live references, so the same
654
+ // reader is used at start-up and again after every settings edit.
655
+ const bridge = new ZjuBridge(bridgeOptions(config));
560
656
  ctx.effect(() => () => bridge.dispose());
561
657
 
562
- if (readSetting(config, "registerSkill") !== false) {
563
- const skills = readBundledSkills(flags);
564
- if (skills.length) {
565
- // Registration is synchronous, so it lands during apply() as the skill
566
- // registry expects. Disposal is owned by the plugin fiber.
567
- ctx.inject(["skills"], (ctx) => {
568
- for (const skill of skills) {
569
- ctx.skills.register(skill);
570
- }
571
- });
572
- warnOnShadowingSkillCopy(flags);
573
- } else {
574
- process.stderr.write("[zju-lecture] 未找到随包 Skill(skills/ 目录为空)\n");
658
+ let toolsScope = null;
659
+ let toolDisposers = [];
660
+ let toolSignature = "";
661
+ let skillsScope = null;
662
+ let skillDisposers = [];
663
+ let skillSignature = "";
664
+ const warnedShadowing = new Set();
665
+
666
+ /**
667
+ * Reconcile the registered tool set with the current configuration.
668
+ *
669
+ * dsh applies a volatile-only settings edit in place: it updates the refs
670
+ * and emits `loader/volatile-update` instead of re-running `apply()`. Without
671
+ * this listener a switch flipped in the GUI would only take effect after a
672
+ * full restart, even though the settings page says it was saved.
673
+ */
674
+ const syncTools = () => {
675
+ if (!toolsScope) return;
676
+ const tools = registerableTools(featureFlags(config));
677
+ const timeoutMs = bridge.timeoutMs;
678
+ // Only tool identity and timeout are baked into a registration; prompt-only
679
+ // switches must not churn the registry on every save.
680
+ const signature = JSON.stringify({
681
+ timeoutMs,
682
+ names: tools.map((tool) => tool.name),
683
+ });
684
+ if (signature === toolSignature) return;
685
+ toolSignature = signature;
686
+ for (const dispose of toolDisposers.splice(0).reverse()) {
687
+ try {
688
+ dispose();
689
+ } catch {
690
+ /* a tool may already have been unregistered with its scope */
691
+ }
575
692
  }
576
- }
577
-
578
- ctx.inject(["tools"], (ctx) => {
579
- for (const tool of registerableTools(flags)) {
693
+ for (const tool of tools) {
580
694
  const present = TOOL_PRESENT[tool.name] || { title: tool.name, kind: "read" };
581
- // PDF 链路可能先触发一次 Typst 下载(约 20 MB),所以写讲义 / 补排版与
582
- // 编译、安装一样给足时间;否则慢网下会把一次正常安装误判成超时。
583
- const pdfCapable = tool.name === "zju_write_note"
584
- || tool.name === "zju_check_note"
585
- || tool.name === "zju_build_study_notes"
586
- || tool.name === "zju_doctor";
587
- const slowTool = tool.name === "zju_fetch_slides" || tool.name === "zju_login";
588
- const toolTimeoutMs = slowTool
589
- ? Math.max(timeoutMs, SLOW_TOOL_TIMEOUT_MS)
590
- : pdfCapable
591
- ? Math.max(timeoutMs, COMPILE_TOOL_TIMEOUT_MS)
592
- : timeoutMs;
593
- ctx.tools.register(defineTool({
695
+ const toolTimeoutMs = toolTimeoutFor(tool.name, timeoutMs);
696
+ toolDisposers.push(toolsScope.tools.register(defineTool({
594
697
  name: tool.name,
595
698
  description: tool.description,
596
699
  parameters: tool.parameters,
@@ -606,17 +709,84 @@ function apply(ctx, config = {}) {
606
709
  const text = await bridge.call(tool.name, args ?? {}, { timeoutMs: toolTimeoutMs });
607
710
  return { text };
608
711
  },
609
- }));
712
+ })));
610
713
  }
714
+ };
715
+
716
+ /** Reconcile the in-memory Skill set with `enableSlides` / `enableStudyNotes`. */
717
+ const syncSkills = () => {
718
+ if (!skillsScope) return;
719
+ const flags = featureFlags(config);
720
+ const signature = JSON.stringify({
721
+ registerSkill: flags.registerSkill,
722
+ enableSlides: flags.enableSlides,
723
+ enableStudyNotes: flags.enableStudyNotes,
724
+ });
725
+ if (signature === skillSignature) return;
726
+ skillSignature = signature;
727
+ for (const dispose of skillDisposers.splice(0).reverse()) {
728
+ try {
729
+ dispose();
730
+ } catch {
731
+ /* the scope may already be torn down */
732
+ }
733
+ }
734
+ if (!flags.registerSkill) return;
735
+ const skills = readBundledSkills(flags);
736
+ if (!skills.length) {
737
+ process.stderr.write("[zju-lecture] 未找到随包 Skill(skills/ 目录为空)\n");
738
+ return;
739
+ }
740
+ // Registration is synchronous, so it lands during apply() as the skill
741
+ // registry expects. Disposal is owned by this plugin's fiber.
742
+ for (const skill of skills) {
743
+ skillDisposers.push(skillsScope.skills.register(skill));
744
+ }
745
+ warnOnShadowingSkillCopy(flags, warnedShadowing);
746
+ };
747
+
748
+ /**
749
+ * Apply a live settings edit to everything the agent can observe.
750
+ *
751
+ * The prompt reads the refs through a thunk on every assembly, so it needs
752
+ * no re-registration; tools, skills and the Python child environment do.
753
+ */
754
+ const resync = () => {
755
+ bridge.configure(bridgeOptions(config));
756
+ syncTools();
757
+ syncSkills();
758
+ };
759
+ if (typeof ctx.on === "function") {
760
+ ctx.on("loader/volatile-update", resync);
761
+ }
762
+
763
+ ctx.inject(["skills"], (scoped) => {
764
+ skillsScope = scoped;
765
+ syncSkills();
766
+ ctx.effect(() => () => {
767
+ skillsScope = null;
768
+ for (const dispose of skillDisposers.splice(0).reverse()) dispose?.();
769
+ });
770
+ });
771
+
772
+ ctx.inject(["tools"], (scoped) => {
773
+ toolsScope = scoped;
774
+ syncTools();
775
+ ctx.effect(() => () => {
776
+ toolsScope = null;
777
+ for (const dispose of toolDisposers.splice(0).reverse()) dispose?.();
778
+ });
611
779
  });
612
780
 
613
- ctx.inject(["systemPrompt"], (ctx) => {
781
+ ctx.inject(["systemPrompt"], (scoped) => {
614
782
  ctx.effect(() => {
615
- const dispose = ctx.systemPrompt.section({
783
+ const dispose = scoped.systemPrompt.section({
616
784
  name,
617
785
  order: 72,
618
786
  interpolate: false,
619
- text: buildSystemPrompt(flags),
787
+ // A thunk, not a string: dsh assembles the prompt for every request,
788
+ // so the model reads the settings that are current at that moment.
789
+ text: () => buildSystemPrompt(featureFlags(config)),
620
790
  });
621
791
  return () => {
622
792
  if (typeof dispose === "function") dispose();
@@ -629,6 +799,7 @@ export {
629
799
  Config,
630
800
  SYSTEM_PROMPT,
631
801
  apply,
802
+ bridgeOptions,
632
803
  buildSystemPrompt,
633
804
  featureFlags,
634
805
  name,
package/lib/tools.js CHANGED
@@ -1,5 +1,10 @@
1
1
  // 本文件由 tools/export_dsh_tools.py 自动生成,请勿手工编辑。
2
2
  // 数据源:mcp_server.py 的 TOOLS。
3
+ //
4
+ // 根级 additionalProperties 不在这里表达:dsh 的 defineTool 只接收
5
+ // 「属性名 -> schema」映射,没有根对象可以挂 strict。未知参数由
6
+ // mcp_server.handle_tool_call 在 dispatch 前强制拒绝("未知参数: …"),
7
+ // 两边不要各自维护一份白名单。
3
8
 
4
9
  export const ZJU_TOOLS = [
5
10
  {
@@ -83,6 +88,11 @@ export const ZJU_TOOLS = [
83
88
  "description": "是否折叠连续字节完全相同的截图(默认 true,只影响 PDF 页数,下载的原图都会保留)",
84
89
  "default": true,
85
90
  "type": "boolean"
91
+ },
92
+ "confirm": {
93
+ "description": "确认执行有副作用的操作(默认 false)。confirm=true 才批量下载截图(最多 2000 张)到工作区并合成 PDF;否则只返回清单,不写盘",
94
+ "default": false,
95
+ "type": "boolean"
86
96
  }
87
97
  }
88
98
  },
@@ -99,6 +109,11 @@ export const ZJU_TOOLS = [
99
109
  "description": "最多提取字符数(默认 10000 字符)",
100
110
  "default": 10000,
101
111
  "type": "integer"
112
+ },
113
+ "allow_outside_workspace": {
114
+ "description": "是否允许读取工作区之外的课件(默认 false)。显式设为 true 时仍拒绝凭据/浏览器数据/密钥文件,并在结果首行标注「已读取工作区外文件」",
115
+ "default": false,
116
+ "type": "boolean"
102
117
  }
103
118
  }
104
119
  },
@@ -124,7 +139,7 @@ export const ZJU_TOOLS = [
124
139
  },
125
140
  {
126
141
  "name": "zju_check_note",
127
- "description": "检查/修正已有讲义 Markdown 的公式与渲染规范(静态、不联网)。write_note 已自动检查,通常无需重复调用;只有手工改过文件时才用它修复。fix=true 自动修正机械问题并先备份;报告按问题类型聚合。pdf=true 时检查后重新排版一份同名 PDF。",
142
+ "description": "检查/修正已有讲义 Markdown 的公式与渲染规范(静态、不联网)。write_note 已自动检查,通常无需重复调用;只有手工改过文件时才用它修复。fix=true 自动修正机械问题并先备份;报告按问题类型聚合。pdf=true 时检查后重新排版一份同名 PDF。只处理工作区内的讲义。",
128
143
  "parameters": {
129
144
  "file_path": {
130
145
  "description": "讲义 Markdown 文件的绝对路径,或相对当前工作区的路径",
@@ -211,6 +226,11 @@ export const ZJU_TOOLS = [
211
226
  "description": "只清除本机保存的登录态与独立登录窗口配置,不打开窗口(默认 false)",
212
227
  "default": false,
213
228
  "type": "boolean"
229
+ },
230
+ "confirm": {
231
+ "description": "确认执行有副作用的操作(默认 false)。clear=true 时必须同时传 confirm=true 才会删除登录态与浏览器配置",
232
+ "default": false,
233
+ "type": "boolean"
214
234
  }
215
235
  }
216
236
  },
@@ -320,6 +340,11 @@ export const ZJU_TOOLS = [
320
340
  "description": "是否读取本机登录态检查可用性(默认否;不会回显凭据)",
321
341
  "default": false,
322
342
  "type": "boolean"
343
+ },
344
+ "confirm": {
345
+ "description": "确认执行有副作用的操作(默认 false)。install=true 时必须同时传 confirm=true 才会下载安装 Typst(约 20 MB)",
346
+ "default": false,
347
+ "type": "boolean"
323
348
  }
324
349
  }
325
350
  }
@@ -80,6 +80,11 @@
80
80
  "description": "是否折叠连续字节完全相同的截图(默认 true,只影响 PDF 页数,下载的原图都会保留)",
81
81
  "default": true,
82
82
  "type": "boolean"
83
+ },
84
+ "confirm": {
85
+ "description": "确认执行有副作用的操作(默认 false)。confirm=true 才批量下载截图(最多 2000 张)到工作区并合成 PDF;否则只返回清单,不写盘",
86
+ "default": false,
87
+ "type": "boolean"
83
88
  }
84
89
  }
85
90
  },
@@ -96,6 +101,11 @@
96
101
  "description": "最多提取字符数(默认 10000 字符)",
97
102
  "default": 10000,
98
103
  "type": "integer"
104
+ },
105
+ "allow_outside_workspace": {
106
+ "description": "是否允许读取工作区之外的课件(默认 false)。显式设为 true 时仍拒绝凭据/浏览器数据/密钥文件,并在结果首行标注「已读取工作区外文件」",
107
+ "default": false,
108
+ "type": "boolean"
99
109
  }
100
110
  }
101
111
  },
@@ -121,7 +131,7 @@
121
131
  },
122
132
  {
123
133
  "name": "zju_check_note",
124
- "description": "检查/修正已有讲义 Markdown 的公式与渲染规范(静态、不联网)。write_note 已自动检查,通常无需重复调用;只有手工改过文件时才用它修复。fix=true 自动修正机械问题并先备份;报告按问题类型聚合。pdf=true 时检查后重新排版一份同名 PDF。",
134
+ "description": "检查/修正已有讲义 Markdown 的公式与渲染规范(静态、不联网)。write_note 已自动检查,通常无需重复调用;只有手工改过文件时才用它修复。fix=true 自动修正机械问题并先备份;报告按问题类型聚合。pdf=true 时检查后重新排版一份同名 PDF。只处理工作区内的讲义。",
125
135
  "parameters": {
126
136
  "file_path": {
127
137
  "description": "讲义 Markdown 文件的绝对路径,或相对当前工作区的路径",
@@ -208,6 +218,11 @@
208
218
  "description": "只清除本机保存的登录态与独立登录窗口配置,不打开窗口(默认 false)",
209
219
  "default": false,
210
220
  "type": "boolean"
221
+ },
222
+ "confirm": {
223
+ "description": "确认执行有副作用的操作(默认 false)。clear=true 时必须同时传 confirm=true 才会删除登录态与浏览器配置",
224
+ "default": false,
225
+ "type": "boolean"
211
226
  }
212
227
  }
213
228
  },
@@ -317,6 +332,11 @@
317
332
  "description": "是否读取本机登录态检查可用性(默认否;不会回显凭据)",
318
333
  "default": false,
319
334
  "type": "boolean"
335
+ },
336
+ "confirm": {
337
+ "description": "确认执行有副作用的操作(默认 false)。install=true 时必须同时传 confirm=true 才会下载安装 Typst(约 20 MB)",
338
+ "default": false,
339
+ "type": "boolean"
320
340
  }
321
341
  }
322
342
  }