@yiyi_zhang/laoshi 0.2.0-beta.3 → 0.3.0

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 (139) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +3 -2
  3. package/adapters/dsh/adapter.ts +22 -1
  4. package/adapters/dsh/dsh-runtime.ts +14 -3
  5. package/adapters/dsh/install.mjs +16 -4
  6. package/adapters/dsh/plugin/index.mjs +197 -18
  7. package/adapters/dsh/plugin/package.json +1 -1
  8. package/adapters/mogao/adapter.ts +10 -1
  9. package/adapters/mogao/mogao-runtime.ts +58 -23
  10. package/adapters/mogao/skill/setup.md +6 -0
  11. package/adapters/paseo/install.mjs +13 -4
  12. package/adapters/paseo/plugin/client/data.ts +13 -2
  13. package/adapters/paseo/plugin/client/detail.tsx +244 -4
  14. package/adapters/paseo/plugin/client/format.ts +25 -117
  15. package/adapters/paseo/plugin/client/overview.tsx +3 -3
  16. package/adapters/paseo/plugin/index.server.ts +2 -1
  17. package/adapters/paseo/plugin/package.json +1 -1
  18. package/adapters/paseo/plugin/paseo-plugin.json +1 -1
  19. package/adapters/paseo/plugin/server/handlers.ts +22 -4
  20. package/adapters/paseo/plugin/server/req.ts +17 -4
  21. package/adapters/paseo/plugin/shared/contracts.ts +28 -2
  22. package/adapters/paseo/plugin/shared/view-model.ts +425 -0
  23. package/bin/ensure-version.mjs +60 -0
  24. package/bin/req-doctor.mjs +5 -0
  25. package/bin/req.mjs +18 -0
  26. package/bin/start-pipeline.mjs +5 -0
  27. package/contracts/cli-json.md +3 -1
  28. package/docs/design/builtin-capabilities.md +2 -2
  29. package/docs/design/cli-adapter.md +1 -1
  30. package/docs/design/dsh-adapter.md +11 -11
  31. package/docs/design/shared-ui.md +43 -0
  32. package/docs/guide//345/234/250/346/221/270/351/253/230/344/270/212/344/275/277/347/224/250.md +2 -1
  33. package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +13 -8
  34. package/docs/guide//347/234/237/345/256/236/347/216/257/345/242/203/350/265/260/346/237/245.md +78 -0
  35. package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +36 -6
  36. package/engine/prompts/00-shared-context.md +7 -0
  37. package/engine/prompts/03-design.md +2 -0
  38. package/engine/prompts/04-design-review.md +5 -1
  39. package/engine/skill-fragments/defaults.md +5 -0
  40. package/engine/src/api.ts +11 -2
  41. package/engine/src/board.ts +435 -0
  42. package/engine/src/config.ts +23 -0
  43. package/engine/src/diagnose.ts +238 -0
  44. package/engine/src/doctor.ts +25 -0
  45. package/engine/src/estimate.ts +11 -0
  46. package/engine/src/extensions.ts +271 -0
  47. package/engine/src/handover-cmd.ts +47 -0
  48. package/engine/src/handover.ts +89 -0
  49. package/engine/src/history.ts +102 -0
  50. package/engine/src/joint.ts +49 -4
  51. package/engine/src/launch.ts +20 -5
  52. package/engine/src/main.ts +1 -1
  53. package/engine/src/messages.ts +58 -0
  54. package/engine/src/pipeline.ts +121 -5
  55. package/engine/src/platform.ts +6 -0
  56. package/engine/src/reply.ts +27 -6
  57. package/engine/src/semver.ts +21 -0
  58. package/engine/src/skills-render.ts +10 -1
  59. package/package.json +5 -2
  60. package/site-dist/404.html +2 -2
  61. package/site-dist/assets/{app.CXydUhZx.js → app.DZpVs0VH.js} +1 -1
  62. package/site-dist/assets/changelog.md.CdUYbro4.js +1 -0
  63. package/site-dist/assets/{changelog.md.BU-CvyJ1.lean.js → changelog.md.CdUYbro4.lean.js} +1 -1
  64. package/site-dist/assets/chunks/@localSearchIndexroot.CHr-ITwS.js +1 -0
  65. package/site-dist/assets/chunks/{VPLocalSearchBox.CIjDV0ax.js → VPLocalSearchBox.BHkmziy1.js} +1 -1
  66. package/site-dist/assets/chunks/{theme.CWtC1Kby.js → theme.BsPChbDE.js} +2 -2
  67. package/site-dist/assets/guide_dsh.md.D0XhcUHz.js +7 -0
  68. package/site-dist/assets/guide_dsh.md.D0XhcUHz.lean.js +7 -0
  69. package/site-dist/assets/{guide_getting-started.md.BxOxfic_.js → guide_getting-started.md.BDd3nU5n.js} +1 -1
  70. package/site-dist/assets/{guide_install.md.By4WxsJG.js → guide_install.md.SsIHMfUu.js} +7 -5
  71. package/site-dist/assets/{guide_install.md.By4WxsJG.lean.js → guide_install.md.SsIHMfUu.lean.js} +7 -5
  72. package/site-dist/assets/guide_maintainer.md.CvqvRle1.js +1 -0
  73. package/site-dist/assets/guide_maintainer.md.CvqvRle1.lean.js +1 -0
  74. package/site-dist/assets/{guide_mogao.md.S0eln1Pr.js → guide_mogao.md.TCu3lgE9.js} +2 -2
  75. package/site-dist/assets/{guide_mogao.md.S0eln1Pr.lean.js → guide_mogao.md.TCu3lgE9.lean.js} +2 -2
  76. package/site-dist/assets/guide_walkthrough.md.nj_PWP9Y.js +5 -0
  77. package/site-dist/assets/guide_walkthrough.md.nj_PWP9Y.lean.js +5 -0
  78. package/site-dist/assets/reference_contracts_cli-json.md.3iU9h4rw.js +1 -0
  79. package/site-dist/assets/reference_contracts_cli-json.md.3iU9h4rw.lean.js +1 -0
  80. package/site-dist/assets/{reference_design_builtin-capabilities.md.CZYtjo_v.js → reference_design_builtin-capabilities.md.k5NXkESv.js} +2 -2
  81. package/site-dist/assets/{reference_design_builtin-capabilities.md.CZYtjo_v.lean.js → reference_design_builtin-capabilities.md.k5NXkESv.lean.js} +2 -2
  82. package/site-dist/assets/{reference_design_cli-adapter.md.pJy3x6Un.js → reference_design_cli-adapter.md.C1lcDATP.js} +1 -1
  83. package/site-dist/assets/{reference_design_cli-adapter.md.pJy3x6Un.lean.js → reference_design_cli-adapter.md.C1lcDATP.lean.js} +1 -1
  84. package/site-dist/changelog.html +5 -5
  85. package/site-dist/guide/cli.html +4 -4
  86. package/site-dist/guide/dsh.html +8 -6
  87. package/site-dist/guide/getting-started.html +5 -5
  88. package/site-dist/guide/how-it-works.html +4 -4
  89. package/site-dist/guide/index.html +4 -4
  90. package/site-dist/guide/install.html +11 -9
  91. package/site-dist/guide/intranet.html +4 -4
  92. package/site-dist/guide/maintainer.html +5 -5
  93. package/site-dist/guide/mogao.html +7 -7
  94. package/site-dist/guide/phases.html +4 -4
  95. package/site-dist/guide/project.html +4 -4
  96. package/site-dist/guide/user.html +4 -4
  97. package/site-dist/guide/walkthrough.html +34 -0
  98. package/site-dist/hashmap.json +1 -1
  99. package/site-dist/index.html +4 -4
  100. package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +4 -4
  101. package/site-dist/reference/adr/0002-two-orchestration-modes.html +4 -4
  102. package/site-dist/reference/adr/0003-generate-once-then-lock.html +4 -4
  103. package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +4 -4
  104. package/site-dist/reference/adr/0005-skill-names.html +4 -4
  105. package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +4 -4
  106. package/site-dist/reference/adr/0007-one-install-many-repos.html +4 -4
  107. package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +4 -4
  108. package/site-dist/reference/adr/index.html +4 -4
  109. package/site-dist/reference/commands.html +4 -4
  110. package/site-dist/reference/config.html +4 -4
  111. package/site-dist/reference/contracts/agent-runtime.html +4 -4
  112. package/site-dist/reference/contracts/cli-json.html +5 -5
  113. package/site-dist/reference/contracts/feature-files.html +4 -4
  114. package/site-dist/reference/contracts/index.html +4 -4
  115. package/site-dist/reference/contracts/notifier-event.html +4 -4
  116. package/site-dist/reference/contracts/result-file.html +4 -4
  117. package/site-dist/reference/contracts/spec.html +4 -4
  118. package/site-dist/reference/contracts/state.html +4 -4
  119. package/site-dist/reference/contracts/usage-record.html +4 -4
  120. package/site-dist/reference/contracts/verify.html +4 -4
  121. package/site-dist/reference/design/adapter-guide.html +4 -4
  122. package/site-dist/reference/design/architecture.html +4 -4
  123. package/site-dist/reference/design/builtin-capabilities.html +6 -6
  124. package/site-dist/reference/design/cli-adapter.html +5 -5
  125. package/site-dist/reference/design/platform-vocabulary.html +4 -4
  126. package/site-dist/reference/scope.html +4 -4
  127. package/skills/laoshi/SKILL.md +1 -3
  128. package/skills/laoshi-setup/SKILL.md +1 -1
  129. package/ui/shared/view-model.ts +424 -0
  130. package/ui/web/board.ts +1126 -0
  131. package/site-dist/assets/changelog.md.BU-CvyJ1.js +0 -1
  132. package/site-dist/assets/chunks/@localSearchIndexroot.CfgJeQRO.js +0 -1
  133. package/site-dist/assets/guide_dsh.md.0X-eYB87.js +0 -5
  134. package/site-dist/assets/guide_dsh.md.0X-eYB87.lean.js +0 -5
  135. package/site-dist/assets/guide_maintainer.md.Da1ffqxm.js +0 -1
  136. package/site-dist/assets/guide_maintainer.md.Da1ffqxm.lean.js +0 -1
  137. package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.js +0 -1
  138. package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.lean.js +0 -1
  139. /package/site-dist/assets/{guide_getting-started.md.BxOxfic_.lean.js → guide_getting-started.md.BDd3nU5n.lean.js} +0 -0
@@ -14,6 +14,7 @@ import {
14
14
  type ReviewPanelMember,
15
15
  } from "./config.js";
16
16
  import { changedFiles, changedSince, checkApplies, headCommit, logName, matchesPath, runCheck, tail } from "./gate.js";
17
+ import { buildAiExtensionPrompt, type ExtensionHook, runScriptExtension, selectExtensions } from "./extensions.js";
17
18
  import { activeJoint, ensureJointRepos, loadProjectChecks, type StepTarget, syncJointDocs } from "./joint.js";
18
19
  import { playbookSection, promptSections, stepTitle } from "./playbooks.js";
19
20
  import {
@@ -879,13 +880,24 @@ async function runStep(
879
880
  }
880
881
  }
881
882
 
883
+ /** The agent's context (its model's window) filled up: a new agent repeating the same reads fails the same way. */
884
+ const CONTEXT_FULL =
885
+ /context.{0,30}(length|window|limit|exceed|overflow|too (long|large))|maximum context|prompt is too long|too many tokens|token.{0,20}(limit|exceed)|上下文.{0,10}(超|满|过长|溢出)|超出.{0,10}上下文/i;
886
+
887
+ export function isContextFull(message: string): boolean {
888
+ return CONTEXT_FULL.test(message);
889
+ }
890
+
882
891
  /** Tells the next agent of a step that an earlier one stopped part way. */
883
892
  function withRetryNote(extras: StepExtras, message: string): StepExtras {
884
893
  return {
885
894
  ...extras,
886
895
  contextLines: [
887
896
  ...(extras.contextLines ?? []).filter((l) => !l.startsWith("自动重试:")),
888
- `自动重试:本步骤上一次中断了(${message.slice(0, 200)})。工作区里可能留有上一次没做完的改动,先用 git status 和 git diff 查看,在此基础上继续,不要重复提交`,
897
+ `自动重试:本步骤上一次中断了(${message.slice(0, 200)})。工作区里可能留有上一次没做完的改动,先用 git status 和 git diff 查看,在此基础上继续,不要重复提交` +
898
+ (isContextFull(message)
899
+ ? "。上一次是因为上下文占满而失败:这次严格按\"控制读入的内容量\"做,命令输出一律过滤后再看,不要解压或列出依赖包,先看已经写下的产物和 progress.md,接着它做,不要从头重新调查"
900
+ : ""),
889
901
  ],
890
902
  };
891
903
  }
@@ -1983,11 +1995,97 @@ function acceptanceLines(ctx: PipelineContext, target?: StepTarget): string[] {
1983
1995
  return lines;
1984
1996
  }
1985
1997
 
1998
+ /** Controlled flow extensions (M3): runs configured AI/script steps attached after a fixed core stage. */
1999
+ async function runExtensionsAfter(ctx: PipelineContext, hook: ExtensionHook): Promise<void> {
2000
+ const steps = selectExtensions(ctx.config.extensions ?? [], {
2001
+ after: hook,
2002
+ profile: ctx.state.profile,
2003
+ type: ctx.state.type,
2004
+ });
2005
+ for (const ext of steps) {
2006
+ const key = `ext:${ext.id}`;
2007
+ if (ctx.state.results[key]) continue;
2008
+ if (ext.kind === "script") {
2009
+ ctx.log(`执行脚本扩展「${ext.title}」(${ext.id},触发点:${hook} 之后)`);
2010
+ const res = runScriptExtension(ext, { repo: ctx.repo, featureDir: ctx.featureDir });
2011
+ ctx.state.results[key] = {
2012
+ kind: "script",
2013
+ hook,
2014
+ ok: res.ok,
2015
+ exitCode: res.exitCode,
2016
+ logFile: path.relative(ctx.repo, res.logFile),
2017
+ };
2018
+ save(ctx);
2019
+ if (!res.ok) {
2020
+ const msg = `脚本执行失败(退出码 ${res.exitCode ?? "未知"}),日志见 ${res.logFile}`;
2021
+ if (ext.onFailure === "warn") {
2022
+ ctx.log(`⚠ 扩展「${ext.title}」${msg},按 onFailure=warn 继续`);
2023
+ } else {
2024
+ throw new StepFailure(`扩展:${ext.title}`, msg);
2025
+ }
2026
+ } else {
2027
+ ctx.log(`完成脚本扩展「${ext.title}」(${ext.id})`);
2028
+ }
2029
+ continue;
2030
+ }
2031
+
2032
+ ctx.log(`执行 AI 扩展「${ext.title}」(${ext.id},触发点:${hook} 之后)`);
2033
+ const role = ext.role ?? "builder";
2034
+ const profile = ctx.config.agents[role];
2035
+ const prompt = buildAiExtensionPrompt(ext, { repo: ctx.repo, featureDir: ctx.featureDir });
2036
+ const title = `${featureName(ctx.featureDir)} · 扩展:${ext.title}`;
2037
+ const agent = await ctx.runtime.startAgent({
2038
+ role,
2039
+ title,
2040
+ prompt,
2041
+ cwd: ctx.repo,
2042
+ labels: {
2043
+ "requirement-pipeline": featureName(ctx.featureDir),
2044
+ "pipeline-step": key,
2045
+ },
2046
+ parentAgentId: ctx.config.attachToOriginChat ? ctx.state.originSessionId : null,
2047
+ profile,
2048
+ workspaceId: ctx.state.worktree?.workspaceRef ?? null,
2049
+ });
2050
+ const deadline = Date.now() + (ext.timeoutMinutes ?? 30) * 60_000;
2051
+ let outcome: WaitOutcome = { status: "timeout", error: null, lastMessage: null, pendingPermissions: [] };
2052
+ try {
2053
+ while (Date.now() < deadline) {
2054
+ const chunk = Math.min(ctx.config.waitChunkSeconds * 1000, Math.max(1000, deadline - Date.now()));
2055
+ outcome = await agent.wait(chunk);
2056
+ if (outcome.status !== "timeout") break;
2057
+ }
2058
+ } finally {
2059
+ if (ctx.config.archiveStepAgents) {
2060
+ await agent.archive().catch((err: Error) => ctx.log(`归档扩展 agent 失败:${err.message}`));
2061
+ }
2062
+ }
2063
+ ctx.state.results[key] = {
2064
+ kind: "ai",
2065
+ hook,
2066
+ status: outcome.status,
2067
+ message: outcome.lastMessage ? outcome.lastMessage.slice(0, 500) : null,
2068
+ };
2069
+ save(ctx);
2070
+ if (outcome.status !== "idle") {
2071
+ const reason = outcome.error ?? (outcome.status === "timeout" ? "执行超时" : `状态为 ${outcome.status}`);
2072
+ if (ext.onFailure === "warn") {
2073
+ ctx.log(`⚠ AI 扩展「${ext.title}」未成功(${reason}),按 onFailure=warn 继续`);
2074
+ } else {
2075
+ throw new StepFailure(`扩展:${ext.title}`, reason);
2076
+ }
2077
+ } else {
2078
+ ctx.log(`完成 AI 扩展「${ext.title}」(${ext.id})`);
2079
+ }
2080
+ }
2081
+ }
2082
+
1986
2083
  /** Assessment: read-only research → assessment.md → independent review ⇄ revise. */
1987
2084
  async function assessmentPhase(ctx: PipelineContext): Promise<void> {
1988
2085
  const rounds = ctx.config.profiles[ctx.state.profile].rounds;
1989
2086
  recordCodeBase(ctx);
1990
2087
  await runStep(ctx, "design");
2088
+ await runExtensionsAfter(ctx, "design");
1991
2089
  for (let r = 1; r <= rounds.designReview; r++) {
1992
2090
  const review = await runReview(ctx, "design_review", r, rounds.designReview);
1993
2091
  if (review.verdict === "approved") break;
@@ -1997,6 +2095,7 @@ async function assessmentPhase(ctx: PipelineContext): Promise<void> {
1997
2095
  }
1998
2096
  await runStep(ctx, "design_revise", r, rounds.designReview);
1999
2097
  }
2098
+ await runExtensionsAfter(ctx, "design_review");
2000
2099
  }
2001
2100
 
2002
2101
  /**
@@ -2051,6 +2150,7 @@ async function developPhase(ctx: PipelineContext): Promise<Record<string, unknow
2051
2150
  // Fixing what could not be reproduced is guessing: ask for what is missing.
2052
2151
  throw new BusinessDecisionNeeded(design.questions as string[], "reproduce");
2053
2152
  }
2153
+ await runExtensionsAfter(ctx, "design");
2054
2154
 
2055
2155
  let designRounds = 0;
2056
2156
  for (let r = 1; r <= rounds.designReview; r++) {
@@ -2065,6 +2165,7 @@ async function developPhase(ctx: PipelineContext): Promise<Record<string, unknow
2065
2165
  // the implementer reads both the review and the revision record.
2066
2166
  await runStep(ctx, "design_revise", r, rounds.designReview);
2067
2167
  }
2168
+ await runExtensionsAfter(ctx, "design_review");
2068
2169
  confirmDesign(ctx);
2069
2170
  const slices = implementationSlices(ctx);
2070
2171
  await milestone(
@@ -2096,6 +2197,7 @@ async function developPhase(ctx: PipelineContext): Promise<Record<string, unknow
2096
2197
  };
2097
2198
  // Joint requirement: every repository is implemented at the same time, against the contract.
2098
2199
  await allOrFirstError([implementHere(), ...joint.map((t) => runStep(ctx, "implement", null, null, { gate: true, target: t }))]);
2200
+ await runExtensionsAfter(ctx, "implement");
2099
2201
 
2100
2202
  const reviewLoop = async (target?: StepTarget) => {
2101
2203
  for (let r = 1; r <= rounds.codeReview; r++) {
@@ -2106,7 +2208,9 @@ async function developPhase(ctx: PipelineContext): Promise<Record<string, unknow
2106
2208
  }
2107
2209
  };
2108
2210
  await allOrFirstError([reviewLoop(), ...joint.map((t) => reviewLoop(t))]);
2211
+ await runExtensionsAfter(ctx, "code_review");
2109
2212
  await runStep(ctx, "handoff", null, null, { contextLines: jointLines(ctx) });
2213
+ await runExtensionsAfter(ctx, "handoff");
2110
2214
  return design;
2111
2215
  }
2112
2216
 
@@ -2156,15 +2260,20 @@ async function verifyPhase(ctx: PipelineContext, design: Record<string, unknown>
2156
2260
  const joint = jointTargets(ctx);
2157
2261
  const jointContext = joint.length > 0 ? { contextLines: jointLines(ctx) } : {};
2158
2262
  const verification = await runStep(ctx, "verify", null, null, jointContext);
2159
- if (verification.result !== "defects_found") return false;
2263
+ if (verification.result !== "defects_found") {
2264
+ await runExtensionsAfter(ctx, "verify");
2265
+ return false;
2266
+ }
2160
2267
  if (phases.defects === "report") {
2161
2268
  ctx.log("验证发现了问题,按设置只记录、不修复,直接写报告。");
2269
+ await runExtensionsAfter(ctx, "verify");
2162
2270
  return false;
2163
2271
  }
2164
2272
  if (phases.defects === "handback") {
2165
2273
  const used = ctx.state.handbacks ?? 0;
2166
2274
  if (used < rounds.defectFix) return true;
2167
2275
  ctx.log(`已经退回研发 ${used} 次(上限 ${rounds.defectFix}),不再退回,问题写进报告。`);
2276
+ await runExtensionsAfter(ctx, "verify");
2168
2277
  return false;
2169
2278
  }
2170
2279
  await milestone(ctx, "fixing-defects", `验证中发现了一些问题,正在修复并重新验证(最多 ${rounds.defectFix} 轮)。`);
@@ -2177,6 +2286,7 @@ async function verifyPhase(ctx: PipelineContext, design: Record<string, unknown>
2177
2286
  if (recheck.result === "pass") break;
2178
2287
  found = recheck;
2179
2288
  }
2289
+ await runExtensionsAfter(ctx, "verify");
2180
2290
  return false;
2181
2291
  }
2182
2292
 
@@ -2293,7 +2403,7 @@ async function flow(ctx: PipelineContext): Promise<Record<string, unknown>> {
2293
2403
  await assessmentPhase(ctx);
2294
2404
  const changed = changedOutsideFeature(ctx) ?? [];
2295
2405
  if (changed.length > 0) ctx.log(`评估期间功能目录之外有文件被改动:${changed.join("、")}`);
2296
- return runStep(ctx, "report", null, null, {
2406
+ const report = await runStep(ctx, "report", null, null, {
2297
2407
  contextLines: [
2298
2408
  ...usageLines(ctx),
2299
2409
  ...(changed.length > 0
@@ -2301,6 +2411,8 @@ async function flow(ctx: PipelineContext): Promise<Record<string, unknown>> {
2301
2411
  : []),
2302
2412
  ],
2303
2413
  });
2414
+ await runExtensionsAfter(ctx, "report");
2415
+ return report;
2304
2416
  }
2305
2417
  for (;;) {
2306
2418
  const design = await developPhase(ctx);
@@ -2308,9 +2420,11 @@ async function flow(ctx: PipelineContext): Promise<Record<string, unknown>> {
2308
2420
  if (phaseOf(ctx) !== "verify") {
2309
2421
  if (phases.mode === "develop-only") {
2310
2422
  await stopManagedServices(ctx);
2311
- return runStep(ctx, "report", null, null, {
2423
+ const report = await runStep(ctx, "report", null, null, {
2312
2424
  contextLines: [...reportLines(ctx), "只做研发:本次不做测试验证,完成报告按本步骤说明中“只做研发时”一节写成研发报告"],
2313
2425
  });
2426
+ await runExtensionsAfter(ctx, "report");
2427
+ return report;
2314
2428
  }
2315
2429
  if (phases.mode === "gated") {
2316
2430
  const at = ctx.state.verifyAt ? new Date(ctx.state.verifyAt) : null;
@@ -2328,7 +2442,9 @@ async function flow(ctx: PipelineContext): Promise<Record<string, unknown>> {
2328
2442
  await handBack(ctx);
2329
2443
  }
2330
2444
  await stopManagedServices(ctx);
2331
- return runStep(ctx, "report", null, null, { contextLines: reportLines(ctx) });
2445
+ const report = await runStep(ctx, "report", null, null, { contextLines: reportLines(ctx) });
2446
+ await runExtensionsAfter(ctx, "report");
2447
+ return report;
2332
2448
  }
2333
2449
 
2334
2450
  export async function runPipeline(ctx: PipelineContext): Promise<PipelineOutcome> {
@@ -68,6 +68,12 @@ export interface PlatformAdapter {
68
68
  * in the background: it runs in the chat's command, which shows what it tells the chat.
69
69
  */
70
70
  runsInChat?: boolean;
71
+ /**
72
+ * The skills are handed over with a fixed laoshi version (a platform's expert, installed on first
73
+ * use): every command in them carries it (LAOSHI_WANT_VERSION), and an installed laoshi of another
74
+ * version installs that one first (bin/ensure-version.mjs).
75
+ */
76
+ pinVersion?: boolean;
71
77
  /** Heading of the platform section in `doctor`. */
72
78
  doctorTitle: string;
73
79
  /** The platform section of `doctor` (connection, versions, profiles), when not --offline. */
@@ -1,34 +1,55 @@
1
1
  // `req reply <需求> <回复>` (1.12): passes an answer written in the plugin's inbox to the
2
2
  // requirement's chat, which handles it as if the user had typed it there. Nothing else changes:
3
3
  // the chat updates the requirement and continues the pipeline itself.
4
+ import path from "node:path";
4
5
  import { locate } from "./api.js";
5
6
  import { DEFAULT_CONFIG, loadConfig, type PipelineConfig } from "./config.js";
6
- import { defaultConfigPath } from "./locations.js";
7
- import { pluginReplyMessage } from "./messages.js";
7
+ import { defaultConfigPath, KIT_ROOT } from "./locations.js";
8
+ import { changeRequestMessage, pluginReplyMessage } from "./messages.js";
8
9
  import { loadRuntimeFactory, wordsFor } from "./runtime-loader.js";
9
10
  import { readIndex } from "./records.js";
10
- import { readState, statePath } from "./state.js";
11
+ import { engineAlive, readState, statePath } from "./state.js";
11
12
 
12
13
  async function main(argvIn: string[]): Promise<number> {
13
14
  // 1.14 --acceptance: the checklist page found problems; the text is the whole notice.
14
15
  // 1.14 --notice: a notice of the background check (no run needed: the chat it was aligned in).
16
+ // X5 --change: requester submitted a requirement change from the board or plugin.
15
17
  const acceptance = argvIn.includes("--acceptance");
16
18
  const notice = argvIn.includes("--notice");
17
- const argv = argvIn.filter((a) => a !== "--acceptance" && a !== "--notice");
19
+ const change = argvIn.includes("--change");
20
+ const argv = argvIn.filter((a) => a !== "--acceptance" && a !== "--notice" && a !== "--change");
18
21
  const [feature, ...words] = argv;
19
22
  const text = words.join(" ").trim();
20
23
  if (!feature || !text) {
21
- console.error("用法:req reply <需求> <回复内容>");
24
+ console.error("用法:req reply [--change] <需求> <回复或改动内容>");
22
25
  return 2;
23
26
  }
24
27
  const { repo, featureDir } = locate(process.cwd(), feature);
25
28
  const state = readState(statePath(repo, featureDir));
26
- if (notice) {
29
+ if (notice || change) {
27
30
  const chat = state?.originSessionId ?? readIndex().find((e) => e.featureDir === featureDir && [e.repo, e.sourceRepo].includes(repo))?.chatAgentId ?? null;
28
31
  if (!chat) {
29
32
  console.error("这个需求没有登记过对话,没有可以转达的对话。");
30
33
  return 1;
31
34
  }
35
+ if (change) {
36
+ const reqBin = path.join(KIT_ROOT, "bin", "req.mjs");
37
+ const stopCommand = `node "${reqBin}" stop ${featureDir}`;
38
+ const resumeCommand = `node "${reqBin}" resume ${featureDir}`;
39
+ const running = Boolean(state && state.status === "running" && engineAlive(state));
40
+ return deliver(
41
+ repo,
42
+ chat,
43
+ changeRequestMessage({
44
+ featureDir,
45
+ text: text.slice(0, 8000),
46
+ stopCommand,
47
+ resumeCommand,
48
+ running,
49
+ }),
50
+ "已转给这个需求的对话,它会和你确认变化、更新需求说明后继续开发。",
51
+ );
52
+ }
32
53
  return deliver(repo, chat, text.slice(0, 8000), "已转给这个需求的对话。");
33
54
  }
34
55
  if (!state || (!acceptance && state.status !== "waiting_for_business" && state.status !== "waiting_for_approval")) {
@@ -1,5 +1,26 @@
1
1
  // Version ranges (requiredVersion in the config, a platform's supported range).
2
2
 
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { KIT_ROOT } from "./locations.js";
6
+
7
+ /** Extracts the first semver core (with optional prerelease) from version output like "tool 0.36.0" or "v0.2.2-alpha.2". */
8
+ export function extractSemver(raw: string): string | null {
9
+ const m = /\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\b/.exec(raw);
10
+ return m ? m[1] : null;
11
+ }
12
+
13
+ /** Supported version range declared for a platform in package.json (`reqKit.<platformId>`), or null. */
14
+ export function supportedPlatformRange(platformId: string, root: string = KIT_ROOT): string | null {
15
+ try {
16
+ const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")) as { reqKit?: Record<string, unknown> };
17
+ const range = pkg.reqKit?.[platformId];
18
+ return typeof range === "string" && range.trim() ? range.trim() : null;
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+
3
24
  /** Minimal "x.y.z satisfies '>=a.b.c <d.e.f'" for the ranges req-kit declares. */
4
25
  export function satisfies(version: string, range: string): boolean {
5
26
  const parse = (v: string) => v.replace(/^v/, "").split(/[-+]/)[0].split(".").map((n) => Number(n) || 0);
@@ -18,6 +18,8 @@ import { type PlatformWords, renderWords } from "./words.js";
18
18
  export const SKILLS_DIR = path.join(KIT_ROOT, "skills");
19
19
  /** laoshi's own /laoshi-setup sections, for platforms whose services are laoshi's builtin ones. */
20
20
  export const BUILTIN_SETUP = path.join(ENGINE_DIR, "skill-fragments", "setup-builtin.md");
21
+ /** Sections every platform gets unless its own skill file has a block of the same name. */
22
+ export const DEFAULT_FRAGMENTS = path.join(ENGINE_DIR, "skill-fragments", "defaults.md");
21
23
 
22
24
  export interface SkillValues {
23
25
  root: string;
@@ -25,6 +27,8 @@ export interface SkillValues {
25
27
  version: string;
26
28
  words: PlatformWords;
27
29
  fragments: Record<string, string>;
30
+ /** How the skills start laoshi's scripts: "node", or with the version they need ("LAOSHI_WANT_VERSION=… node"). */
31
+ node?: string;
28
32
  }
29
33
 
30
34
  /** "<!-- fragment: name -->" blocks of a fragments file, by name. */
@@ -59,7 +63,8 @@ export function skillValues(config?: unknown, root: string = KIT_ROOT): SkillVal
59
63
  launcher: path.join(root, path.relative(KIT_ROOT, LAUNCHER)),
60
64
  version: kitVersion(),
61
65
  words: wordsFor(config),
62
- fragments: { ...builtin, ...own },
66
+ fragments: { ...parseFragments(fs.readFileSync(DEFAULT_FRAGMENTS, "utf8")), ...builtin, ...own },
67
+ node: adapter.pinVersion ? `LAOSHI_WANT_VERSION=${kitVersion()} node` : "node",
63
68
  };
64
69
  }
65
70
 
@@ -71,8 +76,12 @@ export function renderSkillText(text: string, v: SkillValues): string {
71
76
  if (!m) lines.push(line);
72
77
  else if (v.fragments[m[1]]) lines.push(v.fragments[m[1]]);
73
78
  }
79
+ const node = v.node ?? "node";
74
80
  const filled = lines
75
81
  .join("\n")
82
+ // Commands that start laoshi's own scripts (not `node -p …` and the like).
83
+ .replaceAll('node "{{REQ_KIT_ROOT}}', `${node} "{{REQ_KIT_ROOT}}`)
84
+ .replaceAll('node "{{PIPELINE_LAUNCHER}}', `${node} "{{PIPELINE_LAUNCHER}}`)
76
85
  .replaceAll("{{REQ_KIT_ROOT}}", v.root.split(path.sep).join("/"))
77
86
  .replaceAll("{{PIPELINE_LAUNCHER}}", v.launcher.split(path.sep).join("/"))
78
87
  .replaceAll("{{REQ_KIT_VERSION}}", v.version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yiyi_zhang/laoshi",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.3.0",
4
4
  "description": "laoshi:给测试、产品、项目经理用的需求开发体系。在 agent 平台(Paseo、DeepSeek Harness)的对话中对齐需求,由一组 AI agent 在后台完成设计、实现、评审和验证。",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,7 +24,9 @@
24
24
  "node": ">=22"
25
25
  },
26
26
  "reqKit": {
27
- "paseo": ">=0.11.0 <0.12.0"
27
+ "paseo": ">=0.11.0 <0.18.0",
28
+ "dsh": ">=0.2.0 <0.3.0",
29
+ "mogao": ">=0.36.0 <1.0.0"
28
30
  },
29
31
  "bin": {
30
32
  "laoshi": "bin/req.mjs",
@@ -58,6 +60,7 @@
58
60
  "adapters/*/skill/**",
59
61
  "adapters/dsh/plugin/",
60
62
  "adapters/paseo/plugin/",
63
+ "ui/",
61
64
  "adapters/dsh/intranet/",
62
65
  "skills/",
63
66
  "principles/",
@@ -9,7 +9,7 @@
9
9
  <link rel="preload stylesheet" href="/assets/style.BX2ZxxqY.css" as="style">
10
10
  <link rel="preload stylesheet" href="/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/assets/app.CXydUhZx.js"></script>
12
+ <script type="module" src="/assets/app.DZpVs0VH.js"></script>
13
13
  <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
14
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
15
15
  <meta name="theme-color" content="#a8e01f">
@@ -21,7 +21,7 @@
21
21
  </head>
22
22
  <body>
23
23
  <div id="app"></div>
24
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"changelog.md\":\"BU-CvyJ1\",\"guide_cli.md\":\"BrXllHw9\",\"guide_dsh.md\":\"0X-eYB87\",\"guide_getting-started.md\":\"BxOxfic_\",\"guide_how-it-works.md\":\"CkvlSgxO\",\"guide_index.md\":\"D67QX_Vi\",\"guide_install.md\":\"By4WxsJG\",\"guide_intranet.md\":\"Bz0sAHK0\",\"guide_maintainer.md\":\"Da1ffqxm\",\"guide_mogao.md\":\"S0eln1Pr\",\"guide_phases.md\":\"Cw0A9Vb1\",\"guide_project.md\":\"B2cmf8YF\",\"guide_user.md\":\"B66TQvIA\",\"index.md\":\"CrBM3tiI\",\"reference_adr_0001-new-repo-core-and-adapters.md\":\"CjNHHmrf\",\"reference_adr_0002-two-orchestration-modes.md\":\"CHD05agO\",\"reference_adr_0003-generate-once-then-lock.md\":\"BaRiZfXT\",\"reference_adr_0004-external-contracts-stay-stable.md\":\"DUJ7CTV1\",\"reference_adr_0005-skill-names.md\":\"DuBVd1tl\",\"reference_adr_0006-deterministic-engine-platform-capabilities.md\":\"Dcrnx1-L\",\"reference_adr_0007-one-install-many-repos.md\":\"C78cd4_P\",\"reference_adr_0008-capability-sources-and-platform-plugin.md\":\"B4vBkIDS\",\"reference_adr_index.md\":\"Dx8sPsjs\",\"reference_commands.md\":\"BFJRjNju\",\"reference_config.md\":\"Dt_TJ2y9\",\"reference_contracts_agent-runtime.md\":\"DPE2FJFc\",\"reference_contracts_cli-json.md\":\"D6vfWOD9\",\"reference_contracts_feature-files.md\":\"9n332kF_\",\"reference_contracts_index.md\":\"B5P4FjRk\",\"reference_contracts_notifier-event.md\":\"BeR8iODP\",\"reference_contracts_result-file.md\":\"BmCaSlEu\",\"reference_contracts_spec.md\":\"CDQYgJz7\",\"reference_contracts_state.md\":\"DLygjkfs\",\"reference_contracts_usage-record.md\":\"CgfMoYp0\",\"reference_contracts_verify.md\":\"CkJy8LXk\",\"reference_design_adapter-guide.md\":\"B_P-spS5\",\"reference_design_architecture.md\":\"Bfoc-F2B\",\"reference_design_builtin-capabilities.md\":\"CZYtjo_v\",\"reference_design_cli-adapter.md\":\"pJy3x6Un\",\"reference_design_platform-vocabulary.md\":\"xWGv5QO8\",\"reference_scope.md\":\"aUo6vISB\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"laoshi\",\"titleTemplate\":\":title · laoshi\",\"description\":\"在 agent 平台(Paseo、DeepSeek Harness)中用对话对齐需求,由一组 AI agent 在后台完成设计、实现、评审和验证。给测试、产品、项目经理用的需求开发体系。\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"rk\":{\"version\":\"0.2.0-beta.3\",\"beta\":true,\"releases\":5,\"stable\":2,\"adrs\":8},\"logo\":{\"light\":\"/logo-light.svg\",\"dark\":\"/logo.svg\",\"alt\":\"laoshi\"},\"siteTitle\":\"laoshi\",\"nav\":[{\"text\":\"指南\",\"link\":\"/guide/\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/commands\",\"activeMatch\":\"^/reference/\"},{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"v0.2.0-beta.3\",\"items\":[{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"GitHub Releases\",\"link\":\"https://github.com/yiyisf/laoshi/releases\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"开始\",\"items\":[{\"text\":\"laoshi 是什么\",\"link\":\"/guide/\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"工作原理\",\"link\":\"/guide/how-it-works\"}]},{\"text\":\"使用\",\"items\":[{\"text\":\"使用者指南\",\"link\":\"/guide/user\"},{\"text\":\"分阶段执行与提测\",\"link\":\"/guide/phases\"}]},{\"text\":\"安装与维护\",\"items\":[{\"text\":\"安装与升级\",\"link\":\"/guide/install\"},{\"text\":\"在 DeepSeek Harness 上使用\",\"link\":\"/guide/dsh\"},{\"text\":\"在摸高上使用\",\"link\":\"/guide/mogao\"},{\"text\":\"只用命令行 agent\",\"link\":\"/guide/cli\"},{\"text\":\"内网安装与验证\",\"link\":\"/guide/intranet\"},{\"text\":\"项目定制与运行规则\",\"link\":\"/guide/project\"},{\"text\":\"维护者指南\",\"link\":\"/guide/maintainer\"}]}],\"/reference/\":[{\"text\":\"参考\",\"items\":[{\"text\":\"命令\",\"link\":\"/reference/commands\"},{\"text\":\"配置项\",\"link\":\"/reference/config\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]},{\"text\":\"文件格式约定\",\"collapsed\":false,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/contracts/\"},{\"text\":\"需求说明 spec.md\",\"link\":\"/reference/contracts/spec\"},{\"text\":\"状态文件 state.json\",\"link\":\"/reference/contracts/state\"},{\"text\":\"结果文件\",\"link\":\"/reference/contracts/result-file\"},{\"text\":\"功能目录中的文件\",\"link\":\"/reference/contracts/feature-files\"},{\"text\":\"验证方法 verify.md\",\"link\":\"/reference/contracts/verify\"},{\"text\":\"外部通知事件\",\"link\":\"/reference/contracts/notifier-event\"},{\"text\":\"laoshi api 的 JSON 输出\",\"link\":\"/reference/contracts/cli-json\"},{\"text\":\"agent 平台运行时\",\"link\":\"/reference/contracts/agent-runtime\"},{\"text\":\"需求索引与使用记录\",\"link\":\"/reference/contracts/usage-record\"}]},{\"text\":\"设计\",\"collapsed\":true,\"items\":[{\"text\":\"架构\",\"link\":\"/reference/design/architecture\"},{\"text\":\"平台用词\",\"link\":\"/reference/design/platform-vocabulary\"},{\"text\":\"内置能力\",\"link\":\"/reference/design/builtin-capabilities\"},{\"text\":\"编写平台适配器\",\"link\":\"/reference/design/adapter-guide\"},{\"text\":\"命令行 agent 适配器\",\"link\":\"/reference/design/cli-adapter\"}]},{\"text\":\"设计决定(ADR)\",\"collapsed\":true,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/adr/\"},{\"text\":\"0001 新建 laoshi 库:核心与平台适配器分开\",\"link\":\"/reference/adr/0001-new-repo-core-and-adapters\"},{\"text\":\"0002 两种编排模式:外部引擎与会话内编排\",\"link\":\"/reference/adr/0002-two-orchestration-modes\"},{\"text\":\"0003 适配器只在安装时生成一次并锁定\",\"link\":\"/reference/adr/0003-generate-once-then-lock\"},{\"text\":\"0004 对外契约在迁移中保持稳定\",\"link\":\"/reference/adr/0004-external-contracts-stay-stable\"},{\"text\":\"0005 入口 skill 命名\",\"link\":\"/reference/adr/0005-skill-names\"},{\"text\":\"0006 确定性引擎 + 平台能力层:先手写,后生成\",\"link\":\"/reference/adr/0006-deterministic-engine-platform-capabilities\"},{\"text\":\"0007 一次安装,多库共用;库内只放专属配置\",\"link\":\"/reference/adr/0007-one-install-many-repos\"},{\"text\":\"0008 能力按来源分层,平台插件作为适配器的一部分\",\"link\":\"/reference/adr/0008-capability-sources-and-platform-plugin\"}]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/yiyisf/laoshi\"}],\"editLink\":{\"pattern\":\"https://github.com/yiyisf/laoshi/edit/main/site/:path\",\"text\":\"在 GitHub 上编辑此页\"},\"footer\":{\"message\":\"以 MIT 许可发布。laoshi 可运行在 Paseo、DeepSeek Harness 等 agent 平台上。\",\"copyright\":\"Copyright © 2026 yiyisf\"},\"search\":{\"provider\":\"local\",\"options\":{\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"noResultsText\":\"没有找到相关结果\",\"resetButtonTitle\":\"清除\",\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\",\"closeText\":\"关闭\"}}}}},\"outline\":{\"level\":[2,3],\"label\":\"本页内容\"},\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"lastUpdated\":{\"text\":\"最后更新\"},\"returnToTopLabel\":\"回到顶部\",\"sidebarMenuLabel\":\"目录\",\"darkModeSwitchLabel\":\"外观\",\"lightModeSwitchTitle\":\"切换到浅色\",\"darkModeSwitchTitle\":\"切换到深色\",\"externalLinkIcon\":true,\"notFound\":{\"title\":\"页面不存在\",\"quote\":\"这个页面可能已经移动或删除。\",\"linkText\":\"回到首页\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
24
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"changelog.md\":\"CdUYbro4\",\"guide_cli.md\":\"BrXllHw9\",\"guide_dsh.md\":\"D0XhcUHz\",\"guide_getting-started.md\":\"BDd3nU5n\",\"guide_how-it-works.md\":\"CkvlSgxO\",\"guide_index.md\":\"D67QX_Vi\",\"guide_install.md\":\"SsIHMfUu\",\"guide_intranet.md\":\"Bz0sAHK0\",\"guide_maintainer.md\":\"CvqvRle1\",\"guide_mogao.md\":\"TCu3lgE9\",\"guide_phases.md\":\"Cw0A9Vb1\",\"guide_project.md\":\"B2cmf8YF\",\"guide_user.md\":\"B66TQvIA\",\"guide_walkthrough.md\":\"nj_PWP9Y\",\"index.md\":\"CrBM3tiI\",\"reference_adr_0001-new-repo-core-and-adapters.md\":\"CjNHHmrf\",\"reference_adr_0002-two-orchestration-modes.md\":\"CHD05agO\",\"reference_adr_0003-generate-once-then-lock.md\":\"BaRiZfXT\",\"reference_adr_0004-external-contracts-stay-stable.md\":\"DUJ7CTV1\",\"reference_adr_0005-skill-names.md\":\"DuBVd1tl\",\"reference_adr_0006-deterministic-engine-platform-capabilities.md\":\"Dcrnx1-L\",\"reference_adr_0007-one-install-many-repos.md\":\"C78cd4_P\",\"reference_adr_0008-capability-sources-and-platform-plugin.md\":\"B4vBkIDS\",\"reference_adr_index.md\":\"Dx8sPsjs\",\"reference_commands.md\":\"BFJRjNju\",\"reference_config.md\":\"Dt_TJ2y9\",\"reference_contracts_agent-runtime.md\":\"DPE2FJFc\",\"reference_contracts_cli-json.md\":\"3iU9h4rw\",\"reference_contracts_feature-files.md\":\"9n332kF_\",\"reference_contracts_index.md\":\"B5P4FjRk\",\"reference_contracts_notifier-event.md\":\"BeR8iODP\",\"reference_contracts_result-file.md\":\"BmCaSlEu\",\"reference_contracts_spec.md\":\"CDQYgJz7\",\"reference_contracts_state.md\":\"DLygjkfs\",\"reference_contracts_usage-record.md\":\"CgfMoYp0\",\"reference_contracts_verify.md\":\"CkJy8LXk\",\"reference_design_adapter-guide.md\":\"B_P-spS5\",\"reference_design_architecture.md\":\"Bfoc-F2B\",\"reference_design_builtin-capabilities.md\":\"k5NXkESv\",\"reference_design_cli-adapter.md\":\"C1lcDATP\",\"reference_design_platform-vocabulary.md\":\"xWGv5QO8\",\"reference_scope.md\":\"aUo6vISB\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"laoshi\",\"titleTemplate\":\":title · laoshi\",\"description\":\"在 agent 平台(Paseo、DeepSeek Harness)中用对话对齐需求,由一组 AI agent 在后台完成设计、实现、评审和验证。给测试、产品、项目经理用的需求开发体系。\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"rk\":{\"version\":\"0.3.0\",\"beta\":false,\"releases\":7,\"stable\":4,\"adrs\":8},\"logo\":{\"light\":\"/logo-light.svg\",\"dark\":\"/logo.svg\",\"alt\":\"laoshi\"},\"siteTitle\":\"laoshi\",\"nav\":[{\"text\":\"指南\",\"link\":\"/guide/\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/commands\",\"activeMatch\":\"^/reference/\"},{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"v0.3.0\",\"items\":[{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"GitHub Releases\",\"link\":\"https://github.com/yiyisf/laoshi/releases\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"开始\",\"items\":[{\"text\":\"laoshi 是什么\",\"link\":\"/guide/\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"工作原理\",\"link\":\"/guide/how-it-works\"}]},{\"text\":\"使用\",\"items\":[{\"text\":\"使用者指南\",\"link\":\"/guide/user\"},{\"text\":\"分阶段执行与提测\",\"link\":\"/guide/phases\"}]},{\"text\":\"安装与维护\",\"items\":[{\"text\":\"安装与升级\",\"link\":\"/guide/install\"},{\"text\":\"在 DeepSeek Harness 上使用\",\"link\":\"/guide/dsh\"},{\"text\":\"在摸高上使用\",\"link\":\"/guide/mogao\"},{\"text\":\"只用命令行 agent\",\"link\":\"/guide/cli\"},{\"text\":\"内网安装与验证\",\"link\":\"/guide/intranet\"},{\"text\":\"项目定制与运行规则\",\"link\":\"/guide/project\"},{\"text\":\"维护者指南\",\"link\":\"/guide/maintainer\"},{\"text\":\"真实环境走查清单\",\"link\":\"/guide/walkthrough\"}]}],\"/reference/\":[{\"text\":\"参考\",\"items\":[{\"text\":\"命令\",\"link\":\"/reference/commands\"},{\"text\":\"配置项\",\"link\":\"/reference/config\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]},{\"text\":\"文件格式约定\",\"collapsed\":false,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/contracts/\"},{\"text\":\"需求说明 spec.md\",\"link\":\"/reference/contracts/spec\"},{\"text\":\"状态文件 state.json\",\"link\":\"/reference/contracts/state\"},{\"text\":\"结果文件\",\"link\":\"/reference/contracts/result-file\"},{\"text\":\"功能目录中的文件\",\"link\":\"/reference/contracts/feature-files\"},{\"text\":\"验证方法 verify.md\",\"link\":\"/reference/contracts/verify\"},{\"text\":\"外部通知事件\",\"link\":\"/reference/contracts/notifier-event\"},{\"text\":\"laoshi api 的 JSON 输出\",\"link\":\"/reference/contracts/cli-json\"},{\"text\":\"agent 平台运行时\",\"link\":\"/reference/contracts/agent-runtime\"},{\"text\":\"需求索引与使用记录\",\"link\":\"/reference/contracts/usage-record\"}]},{\"text\":\"设计\",\"collapsed\":true,\"items\":[{\"text\":\"架构\",\"link\":\"/reference/design/architecture\"},{\"text\":\"平台用词\",\"link\":\"/reference/design/platform-vocabulary\"},{\"text\":\"内置能力\",\"link\":\"/reference/design/builtin-capabilities\"},{\"text\":\"编写平台适配器\",\"link\":\"/reference/design/adapter-guide\"},{\"text\":\"命令行 agent 适配器\",\"link\":\"/reference/design/cli-adapter\"}]},{\"text\":\"设计决定(ADR)\",\"collapsed\":true,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/adr/\"},{\"text\":\"0001 新建 laoshi 库:核心与平台适配器分开\",\"link\":\"/reference/adr/0001-new-repo-core-and-adapters\"},{\"text\":\"0002 两种编排模式:外部引擎与会话内编排\",\"link\":\"/reference/adr/0002-two-orchestration-modes\"},{\"text\":\"0003 适配器只在安装时生成一次并锁定\",\"link\":\"/reference/adr/0003-generate-once-then-lock\"},{\"text\":\"0004 对外契约在迁移中保持稳定\",\"link\":\"/reference/adr/0004-external-contracts-stay-stable\"},{\"text\":\"0005 入口 skill 命名\",\"link\":\"/reference/adr/0005-skill-names\"},{\"text\":\"0006 确定性引擎 + 平台能力层:先手写,后生成\",\"link\":\"/reference/adr/0006-deterministic-engine-platform-capabilities\"},{\"text\":\"0007 一次安装,多库共用;库内只放专属配置\",\"link\":\"/reference/adr/0007-one-install-many-repos\"},{\"text\":\"0008 能力按来源分层,平台插件作为适配器的一部分\",\"link\":\"/reference/adr/0008-capability-sources-and-platform-plugin\"}]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/yiyisf/laoshi\"}],\"editLink\":{\"pattern\":\"https://github.com/yiyisf/laoshi/edit/main/site/:path\",\"text\":\"在 GitHub 上编辑此页\"},\"footer\":{\"message\":\"以 MIT 许可发布。laoshi 可运行在 Paseo、DeepSeek Harness 等 agent 平台上。\",\"copyright\":\"Copyright © 2026 yiyisf\"},\"search\":{\"provider\":\"local\",\"options\":{\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"noResultsText\":\"没有找到相关结果\",\"resetButtonTitle\":\"清除\",\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\",\"closeText\":\"关闭\"}}}}},\"outline\":{\"level\":[2,3],\"label\":\"本页内容\"},\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"lastUpdated\":{\"text\":\"最后更新\"},\"returnToTopLabel\":\"回到顶部\",\"sidebarMenuLabel\":\"目录\",\"darkModeSwitchLabel\":\"外观\",\"lightModeSwitchTitle\":\"切换到浅色\",\"darkModeSwitchTitle\":\"切换到深色\",\"externalLinkIcon\":true,\"notFound\":{\"title\":\"页面不存在\",\"quote\":\"这个页面可能已经移动或删除。\",\"linkText\":\"回到首页\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
25
25
 
26
26
  </body>
27
27
  </html>
@@ -1 +1 @@
1
- import{R as p}from"./chunks/theme.CWtC1Kby.js";import{R as s,a4 as i,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,d as v,u as R,v as w,s as y,ae as C,af as P,ag as b,a3 as E}from"./chunks/framework.BetZR81g.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
1
+ import{R as p}from"./chunks/theme.BsPChbDE.js";import{R as s,a4 as i,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,d as v,u as R,v as w,s as y,ae as C,af as P,ag as b,a3 as E}from"./chunks/framework.BetZR81g.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
@@ -0,0 +1 @@
1
+ import{_ as o,o as a,c as d,a2 as t}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"更新记录","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"changelog.md","filePath":"changelog.md","lastUpdated":null}'),l={name:"changelog.md"};function c(i,e,s,r,n,h){return a(),d("div",null,[...e[0]||(e[0]=[t('<div><h1 id="更新记录" tabindex="-1">更新记录 <a class="header-anchor" href="#更新记录" aria-label="Permalink to &quot;更新记录&quot;">​</a></h1><p>laoshi 的版本号遵循语义化版本,从 0.1.0 开始;每一版的标题写成 <code>## &lt;版本&gt; - &lt;日期&gt;</code>。每一版先写使用者会看到的变化,再写升级须知。laoshi 之前的历史见 paseo-req-kit 的更新记录(laoshi 从它的 1.15.0 抽出)。</p><h2 id="_0-3-0-2026-11-24" tabindex="-1">0.3.0 - 2026-11-24 <a class="header-anchor" href="#_0-3-0-2026-11-24" aria-label="Permalink to &quot;0.3.0 - 2026-11-24&quot;">​</a></h2><p>正式版(npm <code>latest</code> 标签):新增共享 Web 需求看板与验收工作台、全链路变更历史与转交、受控流程扩展、多仓库联合开发增强、预算预估与多模型评审检查,并将 Paseo(<code>0.11–0.17</code>)需求插件与 DeepSeek Harness(<code>dsh 0.2.2-alpha.2</code> / <code>0.2.2-rc.5</code>)宿主适配及文档补齐。安装:<code>npx -y @yiyi_zhang/laoshi@latest install --platform &lt;平台&gt;</code>。</p><h3 id="使用者会看到的变化" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>共享 Web 需求看板与验收工作台(<code>laoshi board</code>)</strong>:任意平台均可运行 <code>laoshi board</code> 打开本机实时中文 Bento 需求看板;支持总览分组、「需要你处理」置顶、需求详情 6 站放行轨,以及验收工作台(一键试用启停、逐条 AC 勾选与提交 <code>acceptance.md</code> 结论、证据预览)。安装时可通过 <code>dsh</code> 自动托管看板(默认启用 <code>board: true</code>,<code>--no-board</code> / <code>--board-port</code> 可选配置,<code>laoshi doctor</code> 直接显示访问地址)。</li><li><strong>改需求、变更历史与转交接手</strong>:Web 看板「变更与接手」页签、Paseo 插件详情页及 CLI(<code>laoshi reply --change</code>、<code>laoshi handover</code>)支持在需求推进中发起改需求、倒序查看 <code>changes.md</code> 变更历史与 <code>spec.md</code> 提交 diff(绿增/红删高亮),并支持转交接手及完整交接记录(<code>.pipeline/owner.json</code>)。</li><li><strong>受控流程扩展(<code>extensions</code>)</strong>:支持在项目配置 <code>.laoshi.json</code> 中向固定主阶段后挂载受控的 AI/skill 或脚本扩展步骤(注入 <code>LAOSHI_*</code> 环境变量,日志保留在 <code>.pipeline/extensions/</code>),并保持 Windows 下 <code>cmd.exe</code> 兼容。</li><li><strong>多仓库联合开发增强</strong>:支持配置 <code>maxJointRepos</code>(1–10),<code>/laoshi-setup</code> 自动发现同级 Git 仓库辅助配置,需求详情页直观展示各关联仓库分支、工作区路径与质量门状态。</li><li><strong>预算预估与多模型评审检查</strong>:开工前与看板详情提供历史同档位耗时 / token 预算预估及超预算提醒;启用多模型评审小组但配置缺失或仅单个提供方时由 <code>laoshi doctor</code> 提前告警。</li><li><strong>Paseo <code>0.11–0.17</code> 实机适配与插件体验</strong>:支持 <code>laoshi install --platform paseo --with-plugin</code> 一步部署并加载 Paseo 插件,插件与 Web 看板共享状态分组与文案,修复 Paseo 0.17 下服务端打包运行时缺少 <code>import.meta.url</code> 导致的插件 RPC 报错。</li><li><strong>dsh <code>0.2.2-rc.5</code> 适配与定时能力补齐</strong>:插件实现 <code>schedule</code> 的 <code>expiresAt</code> 到期自动取消及 <code>scheduleNewAgent</code> 独立定时会话;双版本兼容 <code>dsh 0.2.2-alpha.2</code> 与 <code>0.2.2-rc.5</code> 的 <code>startActivation</code>、<code>subagents.interrupt</code>、<code>schedule.create</code>/<code>edit</code>(含 <code>cron.time_zone</code>)与 <code>sessions.events</code>。</li><li><strong>摸高与通知体验打磨</strong>:摸高超长追问/打断消息写入文件兜底,同主机中断轮次自动续接;全部停顿通知统一附上【停下原因】与【下一步请说】提示;新增《Paseo Web 与 dsh 真实环境插件走查清单》及版本范围守护。</li></ul><h3 id="升级须知" tabindex="-1">升级须知 <a class="header-anchor" href="#升级须知" aria-label="Permalink to &quot;升级须知&quot;">​</a></h3><ul><li><strong>Paseo</strong>:运行 <code>laoshi upgrade</code> 升级到 <code>0.3.0</code>(支持 Paseo <code>0.11–0.17</code>;安装过插件时自动同步刷新并重载)。如果使用了非默认 <code>--home</code>,请在守护进程中设置 <code>LAOSHI_HOME</code> 或在 Paseo「设置 → 插件 → <code>laoshi 需求</code>」填写安装根路径。</li><li><strong>DeepSeek Harness(dsh)</strong>:运行 <code>laoshi upgrade</code> 升级到 <code>0.3.0</code>,同步更新 <code>laoshi-dsh-plugin</code>(同时兼容 <code>0.2.2-alpha.2</code> 与 <code>0.2.2-rc.5+</code>),并默认随宿主开启托管看板(可通过 <code>--no-board</code> 关闭)。</li><li><strong>摸高</strong>:替换为本版本 Release 附带的 <code>laoshi-expert-0.3.0.zip</code>(或运行 <code>node adapters/mogao/make-expert.mjs</code> 重新生成)。</li></ul><h2 id="_0-2-0-2026-11-21" tabindex="-1">0.2.0 - 2026-11-21 <a class="header-anchor" href="#_0-2-0-2026-11-21" aria-label="Permalink to &quot;0.2.0 - 2026-11-21&quot;">​</a></h2><p>正式版(npm <code>latest</code> 标签):汇总 0.2.0-beta.1~beta.3 的全部功能(摸高适配器与专家包、Paseo 需求插件迁入、<code>laoshi migrate</code>、<code>laoshi permission</code>),并补充摸高版本自检、进程组清理、上下文控制、<code>laoshi diagnose</code> 脱敏诊断包与 Release 自动附带摸高专家包。安装:<code>npx -y @yiyi_zhang/laoshi@latest install --platform &lt;平台&gt;</code>。</p><h3 id="使用者会看到的变化-1" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化-1" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>诊断包(<code>laoshi diagnose &lt;需求&gt; [--out &lt;目录&gt;]</code>)</strong>:一键导出已脱敏的排查目录(状态、流水线日志尾部、步骤结果、步骤输出与回调事件、脱敏配置与环境摘要),方便压缩后发给维护者定位问题。</li><li><strong>摸高:启动后不再&quot;去后台、有进展通知你&quot;</strong>:摸高上流水线在对话的命令里运行,对话一结束就停止。入口 skill 里启动后的说明改为摸高自己的一节(命令不会马上返回、不要结束这一轮对话、持续查看输出并转述);命令输出也不再写&quot;已在后台启动&quot;&quot;进展会发回对话&quot;,安静超过 3 分钟时再提醒一次&quot;流水线仍在运行&quot;。</li><li><strong>摸高:结束一次运行时连它启动的进程一起结束</strong>:每次 <code>aimax run</code> 单独成一个进程组,结束时整组结束,步骤里留下的服务、构建守护进程不再残留;收到 <code>done</code> 回调后留 2 秒等待完整输出,避免抢跑拿到不完整回复与用量。</li><li><strong>步骤控制读入的内容量</strong>:步骤提示词要求命令输出先过滤再看、不整包解压或列出依赖包、读源码先搜索定位(有的模型实际上下文只有十万 token 左右);因上下文占满失败重做时,告诉新的 agent 换做法,从已写下的产物接着做。方案写明依赖相关结论的依据(命令和关键输出),方案审核照着重跑核实、每个结论只核实一次、<code>javap</code> 不看常量池和字节码。</li><li><strong>摸高:专家要求的版本由命令自己保证</strong>:专家里每条 laoshi 命令都带上它要求的版本(<code>LAOSHI_WANT_VERSION</code>),工作区装的不是这个版本时,命令先从 npm 镜像装上再执行;安装失败时不会在子脚本里重复尝试,更新平台设置失败时给出明确警告。</li><li><strong>发布产物附带摸高专家包</strong>:GitHub Release 除 <code>.tgz</code> 与 Windows 离线包外,同时附带该版本生成的 <code>laoshi-expert-0.2.0.zip</code>。</li></ul><h3 id="升级须知-1" tabindex="-1">升级须知 <a class="header-anchor" href="#升级须知-1" aria-label="Permalink to &quot;升级须知&quot;">​</a></h3><ul><li><strong>摸高</strong>:直接替换为本版本 Release 附带的 <code>laoshi-expert-0.2.0.zip</code>(或运行 <code>node adapters/mogao/make-expert.mjs</code> 生成),不要手工修改旧专家包里的版本号。</li><li><strong>Paseo / dsh</strong>:运行 <code>laoshi upgrade</code> 即可升级到 <code>0.2.0</code>(Paseo 需求插件会顺带更新)。</li></ul><h2 id="_0-2-0-beta-3-2026-11-11" tabindex="-1">0.2.0-beta.3 - 2026-11-11 <a class="header-anchor" href="#_0-2-0-beta-3-2026-11-11" aria-label="Permalink to &quot;0.2.0-beta.3 - 2026-11-11&quot;">​</a></h2><p>预发布版(npm 的 <code>beta</code> 标签,<code>latest</code> 仍是 0.1.1):摸高的回调按平台文档的格式解析,步骤做完后靠 <code>done</code> 及时进入下一步,工具调用和用量能收到。安装:<code>npx -y @yiyi_zhang/laoshi@beta install --platform &lt;平台&gt;</code>。</p><h3 id="使用者会看到的变化-2" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化-2" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>摸高:回调按平台文档的格式解析</strong>:工具调用(包在 <code>progress</code> 事件里)现在收得到,危险命令拦截和&quot;最近活动&quot;在摸高上开始生效;用量从 <code>usage</code> 字段读并计入缓存命中;<code>error</code> 回调也表示运行结束;上一版启动、这一版接着等的步骤也能靠 <code>done</code> 及时结束。</li></ul><h3 id="升级须知-2" tabindex="-1">升级须知 <a class="header-anchor" href="#升级须知-2" aria-label="Permalink to &quot;升级须知&quot;">​</a></h3><ul><li>摸高:专家包要换成这个版本生成的(入口 skill 里写着要装的版本),第一次使用时会装上 0.2.0-beta.3;用 <code>node -p &quot;require(&#39;/data/workspace/.laoshi/npm/node_modules/@yiyi_zhang/laoshi/package.json&#39;).version&quot;</code> 确认。</li></ul><h2 id="_0-2-0-beta-2-2026-11-10" tabindex="-1">0.2.0-beta.2 - 2026-11-10 <a class="header-anchor" href="#_0-2-0-beta-2-2026-11-10" aria-label="Permalink to &quot;0.2.0-beta.2 - 2026-11-10&quot;">​</a></h2><p>预发布版(npm 的 <code>beta</code> 标签,<code>latest</code> 仍是 0.1.1):修复摸高上步骤做完要等很久才进入下一步的问题;新增不需要平台的命令行 agent 适配器、<code>laoshi migrate</code> 和随 laoshi 发布的 Paseo 需求插件。安装:<code>npx -y @yiyi_zhang/laoshi@beta install --platform &lt;平台&gt;</code>。</p><h3 id="使用者会看到的变化-3" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化-3" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>发起人</strong>:状态文件和 <code>laoshi api list</code> 记下每个需求的发起人(<code>startedBy</code>,第一次运行时为谁运行,之后不改)。</li><li><strong>使用者取平台给的身份</strong>:平台提供使用者时(摸高的 <code>AIMAX_USER_NAME</code>)优先用它,<code>LAOSHI_USER</code> 仍然最优先;<code>laoshi doctor</code> 显示使用者从哪里来。</li><li><strong>安装</strong>:程序装在安装根的 <code>npm</code> 目录里时(摸高专家就这样安装),不再提示&quot;需要设置环境变量 LAOSHI_HOME&quot;。</li><li><strong>命令行 agent(不需要平台)</strong>(<code>laoshi install --platform cli</code>):步骤 agent 是 Claude Code(<code>claude -p</code>)或 Codex(<code>codex exec</code>)的一次运行,追问和打断用会话续接,工具调用来自命令行的事件流(危险命令拦截照常工作);进展用 <code>laoshi status</code> 查看。第一版,真实命令行上的验证待做。</li><li><strong>摸高:步骤做完后马上进入下一步</strong>:agent 做完但 <code>aimax run</code> 进程不退出时,以完整的输出或平台回调的 <code>done</code> 为准结束这一步,并结束残留的进程(之前要等到平台结束后台命令、再继续时才进入下一步)。</li><li><strong>Paseo 的需求插件随 laoshi 发布</strong>:<code>laoshi plugin install|status|remove</code>(从 paseo-req-kit 迁入,插件 id 改为 <code>laoshi</code>);安装、升级时顺带更新插件。</li><li><strong><code>laoshi migrate</code></strong>:从 paseo-req-kit 1.x 迁移本机的配置、使用记录、需求索引和需求状态;默认只预览,<code>--apply</code> 执行,<code>--rollback</code> 回滚;旧目录不动。</li><li><strong>文档</strong>:新增《在摸高上使用》《只用命令行 agent》。</li></ul><h3 id="升级须知-3" tabindex="-1">升级须知 <a class="header-anchor" href="#升级须知-3" aria-label="Permalink to &quot;升级须知&quot;">​</a></h3><ul><li>摸高:专家包要按这个版本重新生成(<code>node adapters/mogao/make-expert.mjs</code>),入口 skill 第一次使用时会换上这个版本。</li><li>Paseo:装过 paseo-req-kit 插件的,可以改装 laoshi 插件(<code>laoshi plugin install</code>),确认可用后用 <code>req plugin remove</code> 移除旧的。</li></ul><h2 id="_0-2-0-beta-1-2026-11-07" tabindex="-1">0.2.0-beta.1 - 2026-11-07 <a class="header-anchor" href="#_0-2-0-beta-1-2026-11-07" aria-label="Permalink to &quot;0.2.0-beta.1 - 2026-11-07&quot;">​</a></h2><p>预发布版(npm 的 <code>beta</code> 标签,<code>latest</code> 仍是 0.1.1):支持摸高,用来在摸高沙箱里验证专家。安装:<code>npx -y @yiyi_zhang/laoshi@beta install --platform &lt;平台&gt;</code>。</p><h3 id="使用者会看到的变化-4" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化-4" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>支持摸高</strong>(<code>laoshi install --platform mogao</code>):每一步是摸高的一个独立 agent(<code>aimax run</code>),审批用摸高的人工审批,工具调用和用量来自摸高的进度回调。引擎在对话的命令里运行,进展显示在命令输出里;对话轮次结束打断的运行,下一轮用继续命令接着做。</li><li><strong>摸高专家</strong>:<code>node adapters/mogao/make-expert.mjs</code> 生成提交给摸高的专家(按摸高渲染的 skill 和介绍);入口 skill 第一次使用时把 laoshi 装到工作区,并说明在摸高上命令会一直运行到停下、等待批准怎么回答、工具装在工作区。</li><li><strong>安装根</strong>:没有 <code>LAOSHI_HOME</code> 时,程序装在 <code>&lt;安装根&gt;/npm</code> 下就用这个安装根(每个对话轮次换机器的平台上不能依赖 <code>~</code>)。</li><li><strong><code>laoshi permission &lt;需求&gt; approve|deny [理由]</code></strong>:在对话里批准或拒绝步骤等待批准的操作,并接着运行(摸高上用)。</li><li><strong>危险命令拦截</strong>:读出凭据环境变量(如 <code>echo $XXX_TOKEN</code>、<code>printenv</code>)算作危险操作。</li></ul><h2 id="_0-1-1-2026-11-05" tabindex="-1">0.1.1 - 2026-11-05 <a class="header-anchor" href="#_0-1-1-2026-11-05" aria-label="Permalink to &quot;0.1.1 - 2026-11-05&quot;">​</a></h2><p>在 npm 上的包名改为 <strong><code>@yiyi_zhang/laoshi</code></strong>:<code>laoshi</code> 这个名字在 npm 上不能使用,0.1.0 只发布到了 GitHub Release,没有发布到 npm。其余内容与 0.1.0 相同。</p><h3 id="升级须知-4" tabindex="-1">升级须知 <a class="header-anchor" href="#升级须知-4" aria-label="Permalink to &quot;升级须知&quot;">​</a></h3><ul><li>安装命令:<code>npx -y @yiyi_zhang/laoshi@latest install --platform dsh|paseo</code>(内网加 <code>--registry=&lt;镜像地址&gt;</code>)。装好后的命令仍是 <code>laoshi</code>(别名 <code>req</code>),skill 仍是 <code>/laoshi</code> 等。</li><li>公司的 npm 镜像需要能同步 <code>@yiyi_zhang</code> 作用域下的包。</li><li>用 GitHub Release 上 0.1.0 的 <code>.tgz</code> 或离线包装过的机器,运行一次上面的安装命令即可换成 npm 上的版本。</li></ul><h2 id="_0-1-0-2026-11-05" tabindex="-1">0.1.0 - 2026-11-05 <a class="header-anchor" href="#_0-1-0-2026-11-05" aria-label="Permalink to &quot;0.1.0 - 2026-11-05&quot;">​</a></h2><p>第一个正式版:paseo-req-kit 的需求开发体系,抽成不绑定平台的工具包,支持 Paseo 和 DeepSeek Harness。</p><h3 id="使用者会看到的变化-5" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化-5" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>新的名字和命令</strong>:对话中的入口是 <code>/laoshi</code>、<code>/laoshi-setup</code>、<code>/laoshi-doctor</code>、<code>/laoshi-retro</code>;终端命令是 <code>laoshi</code>(<code>req</code> 是它的别名)。</li><li><strong>支持 DeepSeek Harness(dsh)</strong>:步骤 agent 作为子会话挂在发起的对话下,进展和结果发回对话;各角色可以各用一个 dsh 中的模型(<code>&lt;提供方&gt;/&lt;模型&gt;</code>,<code>dsh/chat-model</code> 用对话的模型);<code>laoshi doctor</code> 列出可用的模型并逐个角色检查。</li><li><strong>内置工作区和服务</strong>:平台不提供时,laoshi 用 <code>git worktree</code> 为需求新建工作区,并按 <code>.laoshi/services.json</code> 启动、检查、停止项目的服务(每个工作区独立端口)。</li><li><strong>一步安装</strong>:<code>npx -y @yiyi_zhang/laoshi@latest install --platform dsh|paseo</code>;公司内网加 <code>--registry=&lt;镜像地址&gt;</code>;<code>laoshi upgrade</code> 升级或回退;<code>laoshi install --check</code>、<code>--uninstall</code>。Windows 上只用 cmd 和 Git Bash。</li><li><strong>离线安装包</strong>:完全没有 npm 源的机器,用 GitHub Release 上带 Windows 依赖的离线安装包,步骤见&quot;内网安装与验证&quot;。</li><li><strong>文档站点</strong>:<a href="https://yiyisf.github.io/laoshi/" target="_blank" rel="noreferrer">https://yiyisf.github.io/laoshi/</a> ;<code>laoshi docs</code> 在本机打开和装的版本一致的文档(不需要外网)。</li><li><strong>体检</strong>:<code>laoshi doctor</code> 的&quot;安装&quot;一节检查 skill 是否已是这个版本的,并从 npm 源查询有没有新版本。</li><li><strong>使用记录带上代码库和使用者</strong>:使用记录、通知事件和 <code>laoshi api list</code> 中增加了代码库(目录、远程地址)和使用者(<code>LAOSHI_USER</code> 或安装级配置的 <code>user</code>)。</li></ul><h3 id="升级须知-从-paseo-req-kit" tabindex="-1">升级须知(从 paseo-req-kit) <a class="header-anchor" href="#升级须知-从-paseo-req-kit" aria-label="Permalink to &quot;升级须知(从 paseo-req-kit)&quot;">​</a></h3><ul><li>laoshi 和 paseo-req-kit 可以装在同一台机器上,互不覆盖:安装根是 <code>~/.laoshi</code>(只有 <code>~/.req-kit</code> 时读取它),项目配置是 <code>.laoshi.json</code>(<code>.requirement-pipeline.json</code> 继续被读取)。</li><li>状态文件升到第 2 版:第一次读到旧的状态文件时自动迁移,原文件留作 <code>.bak-v1</code>;正在运行的流水线只在内存中迁移。</li><li>配置中的 <code>paseoProfile</code>、<code>paseoServices</code> 改名为 <code>platformProfile</code>、<code>platformServices</code>,旧名继续有效。</li><li>Paseo 的需求插件暂时仍由 paseo-req-kit 提供,计划在 0.1.0 之后迁入。</li></ul></div><p class="source-note">本页由仓库中的 <a href="https://github.com/yiyisf/laoshi/blob/main/CHANGELOG.md">CHANGELOG.md</a> 生成。<a href="https://github.com/yiyisf/laoshi/edit/main/CHANGELOG.md">在 GitHub 上编辑</a></p>',2)])])}const u=o(l,[["render",c]]);export{p as __pageData,u as default};
@@ -1 +1 @@
1
- import{_ as o,o as a,c as l,a2 as t}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"更新记录","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"changelog.md","filePath":"changelog.md","lastUpdated":null}'),i={name:"changelog.md"};function d(s,e,c,r,n,h){return a(),l("div",null,[...e[0]||(e[0]=[t("",2)])])}const u=o(i,[["render",d]]);export{p as __pageData,u as default};
1
+ import{_ as o,o as a,c as d,a2 as t}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"更新记录","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"changelog.md","filePath":"changelog.md","lastUpdated":null}'),l={name:"changelog.md"};function c(i,e,s,r,n,h){return a(),d("div",null,[...e[0]||(e[0]=[t("",2)])])}const u=o(l,[["render",c]]);export{p as __pageData,u as default};