dsh-thesis 1.0.1 → 2.0.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.
- package/LICENSE +1 -1
- package/NOTICE.md +1 -1
- package/README.md +51 -86
- package/docs/autopilot.md +73 -0
- package/docs/config.md +113 -0
- package/{DESIGN.md → docs/design.md} +69 -74
- package/docs/host-api.md +49 -6
- package/docs/release.md +138 -0
- package/docs/tools.md +76 -0
- package/docs/troubleshooting.md +88 -0
- package/docs/usage.md +87 -0
- package/lib/autopilot/index.d.ts +38 -0
- package/lib/autopilot/index.js +159 -0
- package/lib/autopilot/intent.d.ts +40 -0
- package/lib/autopilot/intent.js +82 -0
- package/lib/autopilot/messages.d.ts +23 -0
- package/lib/autopilot/messages.js +36 -0
- package/lib/autopilot/types.d.ts +60 -0
- package/lib/autopilot/types.js +10 -0
- package/lib/codewalk/engine.d.ts +1 -1
- package/lib/codewalk/engine.js +1 -1
- package/lib/codewalk/gate.d.ts +1 -1
- package/lib/codewalk/gate.js +1 -1
- package/lib/codewalk/host-types.d.ts +2 -31
- package/lib/codewalk/prestep.js +3 -3
- package/lib/codewalk/tools.js +2 -2
- package/lib/config.d.ts +17 -0
- package/lib/config.js +9 -1
- package/lib/dedup/index.js +0 -6
- package/lib/gates/messages.d.ts +7 -6
- package/lib/gates/messages.js +8 -5
- package/lib/index.d.ts +3 -1
- package/lib/index.js +10 -7
- package/lib/ingest/index.d.ts +1 -1
- package/lib/ingest/index.js +1 -3
- package/lib/intake/gate-rules.d.ts +1 -2
- package/lib/intake/gate-rules.js +2 -2
- package/lib/intake/index.d.ts +0 -17
- package/lib/intake/index.js +0 -51
- package/lib/intake/questions.d.ts +1 -1
- package/lib/intake/questions.js +1 -1
- package/lib/memory/recall.d.ts +1 -2
- package/lib/memory/recall.js +2 -2
- package/lib/paper/lib/layout.d.ts +1 -1
- package/lib/paper/lib/layout.js +2 -2
- package/lib/paper/lib/ledger.d.ts +1 -1
- package/lib/paper/lib/ledger.js +1 -1
- package/lib/paper/register.d.ts +2 -2
- package/lib/paper/register.js +2 -8
- package/lib/paper/tools/decision.js +1 -1
- package/lib/paper/tools/init.d.ts +1 -1
- package/lib/paper/tools/init.js +1 -1
- package/lib/ppt/index.d.ts +1 -2
- package/lib/ppt/index.js +1 -2
- package/lib/shared/define-tool.d.ts +1 -1
- package/lib/shared/define-tool.js +1 -1
- package/lib/shared/message-source.d.ts +21 -0
- package/lib/shared/message-source.js +19 -0
- package/package.json +17 -17
- package/skills/code-walkthrough/SKILL.md +5 -3
- package/skills/thesis-defense/SKILL.md +1 -1
- package/skills/thesis-pipeline/SKILL.md +3 -3
- package/lib/codewalk/commands.d.ts +0 -23
- package/lib/codewalk/commands.js +0 -168
- package/lib/commands.d.ts +0 -33
- package/lib/commands.js +0 -60
- package/lib/dedup/commands.d.ts +0 -21
- package/lib/dedup/commands.js +0 -93
- package/lib/ingest/commands.d.ts +0 -23
- package/lib/ingest/commands.js +0 -74
- package/lib/paper/commands.d.ts +0 -13
- package/lib/paper/commands.js +0 -84
- package/lib/ppt/commands.d.ts +0 -28
- package/lib/ppt/commands.js +0 -71
package/lib/ppt/commands.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 斜杠命令 `/thesis-defense` 的**幻灯侧**输入解析。
|
|
3
|
-
*
|
|
4
|
-
* 命令名遵循 DSH 的 `[a-z][a-z0-9_-]*` 约束(kebab-case)。命令注册本身在
|
|
5
|
-
* 装配层(`src/index.ts`)完成:`/thesis-defense` 同时覆盖答辩幻灯与代码演练,
|
|
6
|
-
* 由装配层聚合两侧的处理器——这样 `ppt/` 与 `codewalk/` 之间没有反向依赖。
|
|
7
|
-
*
|
|
8
|
-
* @module dsh-thesis/ppt
|
|
9
|
-
*/
|
|
10
|
-
import { runPptAction } from "./actions.js";
|
|
11
|
-
async function safe(work) {
|
|
12
|
-
try {
|
|
13
|
-
return { kind: 'success', text: await work() };
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
return { kind: 'error', text: error instanceof Error ? error.message : String(error) };
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
/** 幻灯侧的子命令(与代码演练侧区分)。 */
|
|
20
|
-
export const PPT_SUBCOMMANDS = ['prepare', 'convert', 'check', 'guide'];
|
|
21
|
-
/** 把 `/thesis-defense <输入>` 的幻灯侧部分解析成工具参数。 */
|
|
22
|
-
export function parsePptCommandInput(rawInput) {
|
|
23
|
-
const tokens = rawInput.trim().split(/\s+/).filter(t => t !== '');
|
|
24
|
-
let action = 'outline';
|
|
25
|
-
let pages;
|
|
26
|
-
let audience;
|
|
27
|
-
let force = false;
|
|
28
|
-
for (const token of tokens) {
|
|
29
|
-
const lowered = token.toLowerCase();
|
|
30
|
-
if (lowered === 'prepare' || lowered === 'outline' || lowered === 'convert' || lowered === 'check' || lowered === 'guide') {
|
|
31
|
-
action = lowered === 'prepare' ? 'outline' : lowered;
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (lowered === 'undergrad' || lowered === 'master') {
|
|
35
|
-
audience = lowered;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (lowered === 'force' || lowered === '--force' || lowered === '-f') {
|
|
39
|
-
force = true;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
const number = Number.parseInt(token, 10);
|
|
43
|
-
if (Number.isFinite(number)) {
|
|
44
|
-
pages = number;
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
throw new Error(`无法识别的参数「${token}」。用法:/thesis-defense prepare [页数] [undergrad|master] [force]`
|
|
48
|
-
+ ' | convert | check | guide | new <原始项目路径> | status | check [里程碑]');
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
action,
|
|
52
|
-
...(pages !== undefined ? { pages } : {}),
|
|
53
|
-
...(audience !== undefined ? { audience } : {}),
|
|
54
|
-
...(force ? { force: true } : {}),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* 幻灯侧的命令处理器(由装配层在 `/thesis-defense` 下调度)。
|
|
59
|
-
*
|
|
60
|
-
* `rawInput` 仍是命令名之后的全部输入;本函数只关心幻灯侧子命令。
|
|
61
|
-
*/
|
|
62
|
-
export async function handlePptCommand(fs, options, invocation, deps = {}) {
|
|
63
|
-
return await safe(async () => {
|
|
64
|
-
const args = parsePptCommandInput(invocation.rawInput);
|
|
65
|
-
const outcome = await runPptAction(fs, invocation.agent.session.header.cwd, args, options, invocation.signal, deps);
|
|
66
|
-
return outcome.text;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/** 命令的展示元信息(装配层注册时使用)。 */
|
|
70
|
-
export const PPT_COMMAND_DESCRIPTION = '答辩幻灯:生成 Marp Markdown(prepare/outline)/ 执行外部转换(convert)/ 质量检查(check)/ 转换指引(guide)';
|
|
71
|
-
export const PPT_COMMAND_HINT = 'prepare | convert | check | guide [页数] [undergrad|master] [force]';
|