@yiyi_zhang/laoshi 0.1.1 → 0.2.0-beta.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/CHANGELOG.md +32 -0
- package/adapters/cli/adapter.ts +53 -0
- package/adapters/cli/cli-runtime.ts +402 -0
- package/adapters/cli/drivers.ts +146 -0
- package/adapters/cli/install.mjs +28 -0
- package/adapters/cli/skill/setup.md +8 -0
- package/adapters/dsh/plugin/index.mjs +1 -1
- package/adapters/dsh/plugin/package.json +1 -1
- package/adapters/mogao/adapter.ts +47 -0
- package/adapters/mogao/install.mjs +31 -0
- package/adapters/mogao/make-expert.mjs +64 -0
- package/adapters/mogao/mogao-runtime.ts +506 -0
- package/adapters/mogao/skill/setup.md +21 -0
- package/adapters/paseo/adapter.ts +1 -1
- package/adapters/paseo/install.mjs +17 -5
- package/adapters/paseo/migrate.ts +267 -0
- package/adapters/paseo/plugin/OVERVIEW.md +9 -0
- package/adapters/paseo/plugin/client/config.tsx +216 -0
- package/adapters/paseo/plugin/client/data.ts +85 -0
- package/adapters/paseo/plugin/client/detail.tsx +342 -0
- package/adapters/paseo/plugin/client/format.ts +173 -0
- package/adapters/paseo/plugin/client/inbox.tsx +190 -0
- package/adapters/paseo/plugin/client/live.ts +161 -0
- package/adapters/paseo/plugin/client/markdown.tsx +220 -0
- package/adapters/paseo/plugin/client/models.tsx +117 -0
- package/adapters/paseo/plugin/client/nav.ts +22 -0
- package/adapters/paseo/plugin/client/overview.tsx +103 -0
- package/adapters/paseo/plugin/client/panel.tsx +56 -0
- package/adapters/paseo/plugin/client/review.tsx +80 -0
- package/adapters/paseo/plugin/client/row.tsx +63 -0
- package/adapters/paseo/plugin/client/settings.tsx +92 -0
- package/adapters/paseo/plugin/client/sidebar.tsx +27 -0
- package/adapters/paseo/plugin/client/stats.tsx +138 -0
- package/adapters/paseo/plugin/client/ui.tsx +278 -0
- package/adapters/paseo/plugin/client/web.ts +34 -0
- package/adapters/paseo/plugin/index.client.tsx +66 -0
- package/adapters/paseo/plugin/index.server.ts +61 -0
- package/adapters/paseo/plugin/package.json +22 -0
- package/adapters/paseo/plugin/paseo-plugin.json +6 -0
- package/adapters/paseo/plugin/server/handlers.ts +69 -0
- package/adapters/paseo/plugin/server/req.ts +105 -0
- package/adapters/paseo/plugin/shared/contracts.ts +286 -0
- package/adapters/paseo/plugin/shared/rk-colors.ts +35 -0
- package/adapters/paseo/plugin/tsconfig.json +16 -0
- package/adapters/paseo/plugin-cmd.mjs +233 -0
- package/bin/install.mjs +12 -5
- package/bin/req.mjs +18 -2
- package/contracts/README.md +1 -1
- package/contracts/agent-runtime.md +5 -2
- package/contracts/cli-json.md +4 -3
- package/contracts/notifier-event.md +2 -2
- package/contracts/state.md +2 -0
- package/contracts/usage-record.md +3 -3
- package/docs/design/adapter-guide.md +2 -1
- package/docs/design/cli-adapter.md +75 -0
- package/docs/design/compat-migration.md +2 -0
- package/docs/design/mogao-expert.md +103 -0
- package/docs/guide//345/234/250/346/221/270/351/253/230/344/270/212/344/275/277/347/224/250.md +132 -0
- package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +32 -3
- package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +4 -2
- package/docs/guide//351/241/271/347/233/256/345/256/232/345/210/266/344/270/216/350/277/220/350/241/214/350/247/204/345/210/231.md +1 -1
- package/engine/src/api.ts +9 -5
- package/engine/src/code-review.ts +2 -2
- package/engine/src/control.ts +6 -6
- package/engine/src/danger-guard.ts +7 -0
- package/engine/src/doctor.ts +4 -3
- package/engine/src/features.ts +2 -2
- package/engine/src/identity.ts +16 -1
- package/engine/src/integration-cmd.ts +2 -2
- package/engine/src/launch.ts +44 -6
- package/engine/src/locations.ts +15 -1
- package/engine/src/main.ts +6 -1
- package/engine/src/messages.ts +1 -1
- package/engine/src/permission-cmd.ts +56 -0
- package/engine/src/platform.ts +7 -0
- package/engine/src/preflight.ts +2 -2
- package/engine/src/runtime-loader.ts +16 -0
- package/engine/src/runtime.ts +5 -0
- package/engine/src/skills-render.ts +10 -6
- package/engine/src/state.ts +25 -1
- package/engine/src/words.ts +1 -1
- package/package.json +2 -1
- package/site-dist/404.html +2 -2
- package/site-dist/assets/{app.Df99UgrJ.js → app.D2ywvSfZ.js} +1 -1
- package/site-dist/assets/changelog.md.EDul9PkX.js +1 -0
- package/site-dist/assets/changelog.md.EDul9PkX.lean.js +1 -0
- package/site-dist/assets/chunks/@localSearchIndexroot.Dr_jsw66.js +1 -0
- package/site-dist/assets/chunks/{VPLocalSearchBox.IEhP6Gw5.js → VPLocalSearchBox.ClWffKqN.js} +1 -1
- package/site-dist/assets/chunks/{theme.DHubfO7g.js → theme.tbt16E5a.js} +2 -2
- package/site-dist/assets/guide_cli.md.BrXllHw9.js +2 -0
- package/site-dist/assets/guide_cli.md.BrXllHw9.lean.js +2 -0
- package/site-dist/assets/{guide_getting-started.md.BZTWiHhH.js → guide_getting-started.md.qAp5hWCl.js} +1 -1
- package/site-dist/assets/{guide_getting-started.md.BZTWiHhH.lean.js → guide_getting-started.md.qAp5hWCl.lean.js} +1 -1
- package/site-dist/assets/guide_install.md.By4WxsJG.js +24 -0
- package/site-dist/assets/guide_install.md.By4WxsJG.lean.js +24 -0
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.js +1 -0
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.lean.js +1 -0
- package/site-dist/assets/guide_mogao.md.S0eln1Pr.js +10 -0
- package/site-dist/assets/guide_mogao.md.S0eln1Pr.lean.js +10 -0
- package/site-dist/assets/{guide_project.md.BIcaDhdS.js → guide_project.md.B2cmf8YF.js} +1 -1
- package/site-dist/assets/{guide_project.md.BIcaDhdS.lean.js → guide_project.md.B2cmf8YF.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_agent-runtime.md.DPE2FJFc.js +1 -0
- package/site-dist/assets/{reference_contracts_agent-runtime.md.Bu8q-uGl.lean.js → reference_contracts_agent-runtime.md.DPE2FJFc.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.js +1 -0
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.lean.js +1 -0
- package/site-dist/assets/{reference_contracts_index.md.dqNwNs6U.js → reference_contracts_index.md.B5P4FjRk.js} +1 -1
- package/site-dist/assets/{reference_contracts_index.md.dqNwNs6U.lean.js → reference_contracts_index.md.B5P4FjRk.lean.js} +1 -1
- package/site-dist/assets/{reference_contracts_notifier-event.md.D6we9wWS.js → reference_contracts_notifier-event.md.BeR8iODP.js} +1 -1
- package/site-dist/assets/{reference_contracts_notifier-event.md.D6we9wWS.lean.js → reference_contracts_notifier-event.md.BeR8iODP.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_state.md.DLygjkfs.js +1 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CgfMoYp0.js +10 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CgfMoYp0.lean.js +10 -0
- package/site-dist/assets/{reference_design_adapter-guide.md.BSziZJSM.js → reference_design_adapter-guide.md.B_P-spS5.js} +2 -2
- package/site-dist/assets/{reference_design_adapter-guide.md.BSziZJSM.lean.js → reference_design_adapter-guide.md.B_P-spS5.lean.js} +2 -2
- package/site-dist/assets/reference_design_cli-adapter.md.pJy3x6Un.js +13 -0
- package/site-dist/assets/reference_design_cli-adapter.md.pJy3x6Un.lean.js +13 -0
- package/site-dist/changelog.html +5 -5
- package/site-dist/guide/cli.html +31 -0
- package/site-dist/guide/dsh.html +5 -5
- package/site-dist/guide/getting-started.html +5 -5
- package/site-dist/guide/how-it-works.html +4 -4
- package/site-dist/guide/index.html +4 -4
- package/site-dist/guide/install.html +13 -8
- package/site-dist/guide/intranet.html +5 -5
- package/site-dist/guide/maintainer.html +5 -5
- package/site-dist/guide/mogao.html +39 -0
- package/site-dist/guide/phases.html +4 -4
- package/site-dist/guide/project.html +6 -6
- package/site-dist/guide/user.html +4 -4
- package/site-dist/hashmap.json +1 -1
- package/site-dist/index.html +4 -4
- package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +4 -4
- package/site-dist/reference/adr/0002-two-orchestration-modes.html +4 -4
- package/site-dist/reference/adr/0003-generate-once-then-lock.html +4 -4
- package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +4 -4
- package/site-dist/reference/adr/0005-skill-names.html +4 -4
- package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +4 -4
- package/site-dist/reference/adr/0007-one-install-many-repos.html +4 -4
- package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +4 -4
- package/site-dist/reference/adr/index.html +4 -4
- package/site-dist/reference/commands.html +4 -4
- package/site-dist/reference/config.html +4 -4
- package/site-dist/reference/contracts/agent-runtime.html +5 -5
- package/site-dist/reference/contracts/cli-json.html +5 -5
- package/site-dist/reference/contracts/feature-files.html +4 -4
- package/site-dist/reference/contracts/index.html +5 -5
- package/site-dist/reference/contracts/notifier-event.html +6 -6
- package/site-dist/reference/contracts/result-file.html +4 -4
- package/site-dist/reference/contracts/spec.html +4 -4
- package/site-dist/reference/contracts/state.html +5 -5
- package/site-dist/reference/contracts/usage-record.html +6 -6
- package/site-dist/reference/contracts/verify.html +4 -4
- package/site-dist/reference/design/adapter-guide.html +6 -6
- package/site-dist/reference/design/architecture.html +4 -4
- package/site-dist/reference/design/builtin-capabilities.html +4 -4
- package/site-dist/reference/design/cli-adapter.html +42 -0
- package/site-dist/reference/design/platform-vocabulary.html +4 -4
- package/site-dist/reference/scope.html +4 -4
- package/skills/laoshi/SKILL.md +3 -0
- package/skills/laoshi-doctor/SKILL.md +2 -0
- package/skills/laoshi-retro/SKILL.md +2 -0
- package/skills/laoshi-setup/SKILL.md +3 -0
- package/site-dist/assets/changelog.md.Df8vFhjK.js +0 -1
- package/site-dist/assets/changelog.md.Df8vFhjK.lean.js +0 -1
- package/site-dist/assets/chunks/@localSearchIndexroot.n-0kN-N0.js +0 -1
- package/site-dist/assets/guide_install.md.D7NiiOPu.js +0 -19
- package/site-dist/assets/guide_install.md.D7NiiOPu.lean.js +0 -19
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.js +0 -1
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.lean.js +0 -1
- package/site-dist/assets/reference_contracts_agent-runtime.md.Bu8q-uGl.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.lean.js +0 -1
- package/site-dist/assets/reference_contracts_state.md.DVHC4opX.js +0 -1
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.js +0 -10
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.lean.js +0 -10
- /package/site-dist/assets/{reference_contracts_state.md.DVHC4opX.lean.js → reference_contracts_state.md.DLygjkfs.lean.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!-- laoshi: the command-line adapter's sections of the entry skills. There is no platform: step agents are runs of claude / codex, nothing is sent back to the chat, and there is no scheduling. -->
|
|
2
|
+
<!-- fragment: launchNote -->
|
|
3
|
+
|
|
4
|
+
**用命令行 agent(Claude Code、Codex)运行时不一样的地方:**
|
|
5
|
+
- 步骤 agent 是在后台运行的 `claude -p` / `codex exec`,**不会**出现在这个对话的子 agent 列表里;流水线也**不会**把通知发进这个对话。启动后告诉用户:开发在后台进行,想知道进展时说"做到哪了",你就运行状态命令(`status`)并转述。
|
|
6
|
+
- 需要人决定的地方(方案确认、业务问题)、流水线停下或做完,都只体现在状态命令的输出里(以及团队配置的外部通知,如 IM)。用户问进展时,先运行状态命令,再按上面"收到通知时"的同一套做法处理。
|
|
7
|
+
- 命令行的非交互模式不会停下来等待批准;某一步因为权限不够失败时,请用户检查安装级配置中这个角色的 `modeId`。
|
|
8
|
+
- 没有定时任务:预约启动、定时提醒、自动继续都用不了。需要以后再做的事,告诉用户到时说"继续"。
|
|
@@ -14,7 +14,7 @@ import { channelPaths, dshHome } from "./channel.mjs";
|
|
|
14
14
|
export const name = "laoshi-dsh";
|
|
15
15
|
export const inject = ["agents", "subagents", "schedule", "approval", "sessionController", "llm"];
|
|
16
16
|
|
|
17
|
-
const VERSION = "0.
|
|
17
|
+
const VERSION = "0.2.0-beta.2";
|
|
18
18
|
const SHELL_TOOLS = new Set(["bash", "pwsh"]);
|
|
19
19
|
const SEARCH_TOOLS = new Set(["grep", "glob"]);
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laoshi-dsh-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-beta.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "laoshi's plugin for the DeepSeek Harness host: creates step agents under the chat, schedules messages, answers approvals by policy, and serves the laoshi engine over a local socket (ADR 0008).",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// The 摸高 adapter (docs/design/mogao-expert.md, form B1): step agents are runs of the platform's
|
|
2
|
+
// command line (`aimax run`), approvals are the platform's HITL answered through laoshi, tool calls
|
|
3
|
+
// and usage come from the platform's progress callback. Worktrees and services are laoshi's builtin
|
|
4
|
+
// ones. The platform keeps a chat's machine for one turn, so the engine runs in the chat's command.
|
|
5
|
+
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import type { PlatformAdapter } from "../../engine/src/platform.js";
|
|
10
|
+
import { mogaoSettings } from "./mogao-runtime.js";
|
|
11
|
+
|
|
12
|
+
export const mogaoAdapter: PlatformAdapter = {
|
|
13
|
+
id: "mogao",
|
|
14
|
+
displayName: "摸高",
|
|
15
|
+
createRuntime: async (input) => (await import("./mogao-runtime.js")).createRuntime(input),
|
|
16
|
+
capabilities: {
|
|
17
|
+
services: "builtin",
|
|
18
|
+
worktree: "builtin",
|
|
19
|
+
activity: "platform",
|
|
20
|
+
runningTool: "platform",
|
|
21
|
+
toolCalls: "platform",
|
|
22
|
+
},
|
|
23
|
+
originEnv: { id: "AIMAX_SESSION_ID" },
|
|
24
|
+
userEnv: "AIMAX_USER_NAME",
|
|
25
|
+
runsInChat: true,
|
|
26
|
+
skillSetup: path.join(path.dirname(fileURLToPath(import.meta.url)), "skill", "setup.md"),
|
|
27
|
+
words: {
|
|
28
|
+
name: "摸高",
|
|
29
|
+
chat: "摸高的对话",
|
|
30
|
+
schedule: "定时任务(摸高上没有,到时请在对话里说\"继续\")",
|
|
31
|
+
approvePermission: "在对话里回答\"批准\"或\"拒绝\",对话会运行 `laoshi permission <需求> approve`(或 `deny`)并接着做",
|
|
32
|
+
signIn: "检查摸高的模型配置",
|
|
33
|
+
origin: "摸高提供的 `AIMAX_SESSION_ID`",
|
|
34
|
+
connectFix: "确认在摸高的对话里运行,并且 `aimax` 命令可用(`aimax --version`)。",
|
|
35
|
+
},
|
|
36
|
+
doctorTitle: "摸高(aimax 命令行)",
|
|
37
|
+
async doctorPlatform({ config, tools }) {
|
|
38
|
+
const settings = mogaoSettings(config);
|
|
39
|
+
const r = spawnSync(settings.command, ["--version"], { encoding: "utf8", timeout: 20_000 });
|
|
40
|
+
if (r.error || r.status !== 0) {
|
|
41
|
+
tools.report("fail", `运行 ${settings.command} --version 失败:${r.error?.message ?? (r.stderr || r.stdout).trim()}`, "在摸高的对话或沙箱里运行;不在 PATH 中时在安装级配置的 platform.mogao.command 写上它的完整路径");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
tools.report("ok", `aimax ${(r.stdout || "").trim()}(数据目录 ${settings.dataDir},单次运行上限 ${settings.runTimeoutMinutes} 分钟)`);
|
|
45
|
+
if (!process.env.AIMAX_SESSION_ID) tools.info("没有 AIMAX_SESSION_ID:不在摸高的对话里运行,进展只写入日志");
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// laoshi installer, 摸高 part (bin/install.mjs). The platform loads skills from the expert that is
|
|
2
|
+
// submitted to it, so the skills rendered for 摸高 go into the install root's skills directory: that
|
|
3
|
+
// directory is the expert's skill package. Nothing else to install: step agents use `aimax`.
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
export const id = "mogao";
|
|
7
|
+
|
|
8
|
+
/** Installer options this platform reads (bin/install.mjs passes them through). */
|
|
9
|
+
export const options = {};
|
|
10
|
+
|
|
11
|
+
/** The install-level config's platform section for a new installation. */
|
|
12
|
+
export function platformConfig() {
|
|
13
|
+
return { adapter: "mogao", mogao: { dataDir: "/data" } };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Every step on the platform's model (`aimax run` takes the chat's). */
|
|
17
|
+
export const defaultAgents = { builder: { provider: "mogao/chat-model" }, reviewer: { provider: "mogao/chat-model" } };
|
|
18
|
+
|
|
19
|
+
/** The expert's skill package: <install root>/skills. */
|
|
20
|
+
export function skillTargets(args, config, env = process.env, home) {
|
|
21
|
+
const root = home ?? path.resolve(env.LAOSHI_HOME ?? path.join(env.HOME ?? "", ".laoshi"));
|
|
22
|
+
const dir = path.join(root, "skills");
|
|
23
|
+
return [{ dir, label: `专家的 skill 目录 ${dir}(提交到摸高的专家用这个目录)` }];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function setup({ report }) {
|
|
27
|
+
report("info", "步骤 agent 用摸高的 aimax 命令运行;在摸高上安装根放在工作区 /data/workspace/.laoshi,程序装在它的 npm 目录里,命令据此找到安装根(专家第一次使用时就这样安装)");
|
|
28
|
+
return ["把上面专家的 skill 目录提交为摸高的专家(或在对话里加载它)", "体检:laoshi doctor --no-project"];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function uninstall() {}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Builds the 摸高 expert: laoshi's skills rendered for 摸高, as they will run there (the program in
|
|
3
|
+
// the workspace, /data/workspace/.laoshi/npm/node_modules/<package>, installed on first use by the
|
|
4
|
+
// skills themselves), and a short description of the expert. The result is what is submitted to the
|
|
5
|
+
// platform as the expert (a directory and a zip of it).
|
|
6
|
+
//
|
|
7
|
+
// node adapters/mogao/make-expert.mjs [--out <dir>]
|
|
8
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { parseArgs } from "node:util";
|
|
13
|
+
|
|
14
|
+
const kit = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
15
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(kit, "package.json"), "utf8"));
|
|
16
|
+
const { values } = parseArgs({ options: { out: { type: "string", default: path.join(kit, "dist-expert") } } });
|
|
17
|
+
const WORKSPACE_HOME = "/data/workspace/.laoshi";
|
|
18
|
+
const programRoot = `${WORKSPACE_HOME}/npm/node_modules/${pkg.name}`;
|
|
19
|
+
const name = `laoshi-expert-${pkg.version}`;
|
|
20
|
+
const out = path.resolve(values.out, name);
|
|
21
|
+
fs.rmSync(out, { recursive: true, force: true });
|
|
22
|
+
fs.mkdirSync(out, { recursive: true });
|
|
23
|
+
|
|
24
|
+
const config = path.join(out, ".render-config.json");
|
|
25
|
+
fs.writeFileSync(config, JSON.stringify({ platform: { adapter: "mogao" } }));
|
|
26
|
+
const tsx = path.join(kit, "node_modules", "tsx", "dist", "cli.mjs");
|
|
27
|
+
const r = spawnSync(process.execPath, [tsx, path.join(kit, "engine", "src", "skills-render.ts"), "--out", path.join(out, "skills"), "--config", config, "--root", programRoot], { encoding: "utf8" });
|
|
28
|
+
fs.rmSync(config);
|
|
29
|
+
if (r.status !== 0) {
|
|
30
|
+
console.error(r.stderr || r.stdout);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const skills = fs.readdirSync(path.join(out, "skills")).filter((d) => fs.existsSync(path.join(out, "skills", d, "SKILL.md")));
|
|
35
|
+
const describe = (d) => /^description:\s*(.+)$/m.exec(fs.readFileSync(path.join(out, "skills", d, "SKILL.md"), "utf8"))?.[1] ?? "";
|
|
36
|
+
fs.writeFileSync(
|
|
37
|
+
path.join(out, "EXPERT.md"),
|
|
38
|
+
[
|
|
39
|
+
`# laoshi 需求开发专家(${pkg.version})`,
|
|
40
|
+
"",
|
|
41
|
+
"给测试、产品、项目经理用:在对话里把需求谈清楚、写成需求说明并确认,之后由一组 agent 完成方案、实现、评审、验证和报告,每个要拍板的地方都停下来等人。",
|
|
42
|
+
"",
|
|
43
|
+
"- 入口:`/laoshi`(需求开发)、`/laoshi-setup`(项目接入,每个项目一次)、`/laoshi-doctor`(体检)、`/laoshi-retro`(复盘)",
|
|
44
|
+
`- 第一次使用时,入口 skill 会从内网 npm 镜像把 \`${pkg.name}@${pkg.version}\` 装到 \`${WORKSPACE_HOME}\`(约一分钟),之后每个对话直接使用`,
|
|
45
|
+
"- 每一步是摸高的一个独立 agent(`aimax run`);需要批准的操作走摸高的人工审批;进度和用量来自摸高的回调",
|
|
46
|
+
"- 使用说明(第一次使用、项目接入、运行期间不要结束对话、等待批准怎么回答、常见问题):https://yiyisf.github.io/laoshi/guide/mogao",
|
|
47
|
+
"",
|
|
48
|
+
"## 包含的 skill",
|
|
49
|
+
"",
|
|
50
|
+
"| skill | 作用 |",
|
|
51
|
+
"| --- | --- |",
|
|
52
|
+
...skills.sort().map((d) => `| \`${d}\` | ${describe(d).replace(/\|/g, "\\|")} |`),
|
|
53
|
+
"",
|
|
54
|
+
].join("\n"),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const zip = path.resolve(values.out, `${name}.zip`);
|
|
58
|
+
fs.rmSync(zip, { force: true });
|
|
59
|
+
try {
|
|
60
|
+
execFileSync("zip", ["-qr", zip, name], { cwd: path.resolve(values.out) });
|
|
61
|
+
console.log(`已生成专家:${out}\n压缩包:${zip}`);
|
|
62
|
+
} catch {
|
|
63
|
+
console.log(`已生成专家:${out}(没有 zip 命令,未打包)`);
|
|
64
|
+
}
|