@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
@@ -1,10 +1,10 @@
1
1
  import{_ as n,o as s,c as e,j as l,a}from"./chunks/framework.BetZR81g.js";const k=JSON.parse('{"title":"在摸高上使用","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/mogao.md","filePath":"guide/mogao.md","lastUpdated":null}'),t={name:"guide/mogao.md"};function o(d,i,h,u,r,c){return s(),e("div",null,[...i[0]||(i[0]=[l("div",null,[l("h1",{id:"在摸高上使用",tabindex:"-1"},[a("在摸高上使用 "),l("a",{class:"header-anchor",href:"#在摸高上使用","aria-label":'Permalink to "在摸高上使用"'},"​")]),l("p",null,[a("本文面向在摸高上使用 laoshi 专家的人:提交专家的人、第一次使用的人、日常提需求的测试、产品、项目经理。laoshi 在摸高上的工作方式和 Paseo、dsh 一样:在对话里把需求谈清楚、写成需求说明并确认,之后由一组 agent 完成方案、实现、评审、验证和报告,每个要拍板的地方都停下来等人。设计见 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/mogao-expert.md",target:"_blank",rel:"noreferrer"},"mogao-expert"),a(",适配器见 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/adapters/mogao/README.md",target:"_blank",rel:"noreferrer"},"adapters/mogao"),a("。")]),l("h2",{id:"_1-先了解摸高的三个特点",tabindex:"-1"},[a("1. 先了解摸高的三个特点 "),l("a",{class:"header-anchor",href:"#_1-先了解摸高的三个特点","aria-label":'Permalink to "1. 先了解摸高的三个特点"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"特点"),l("th",null,"对使用的影响")])]),l("tbody",null,[l("tr",null,[l("td",null,[a("每个对话轮次一台新机器,只有 "),l("code",null,"/data/workspace"),a("(工作区)和 "),l("code",null,"/data/.aimax"),a(" 会保留")]),l("td",null,[a("laoshi 装在工作区的 "),l("code",null,"/data/workspace/.laoshi"),a(","),l("strong",null,"一个工作区只装一次"),a(";代码库也要放在工作区里(例如 "),l("code",null,"/data/workspace/<项目>"),a("),否则下一轮就没了")])]),l("tr",null,[l("td",null,"流水线在对话执行的命令里运行,轮次结束就停下"),l("td",null,'运行期间不要结束这一轮对话;被打断了,下一轮说"继续",做完的步骤不会重做')]),l("tr",null,[l("td",null,"没有定时任务,也不能主动给对话发消息"),l("td",null,"预约启动、定时提醒、自动继续都用不了;进展显示在命令输出里,由对话转告你")])])]),l("h2",{id:"_2-提交专家-维护者做一次",tabindex:"-1"},[a("2. 提交专家(维护者做一次) "),l("a",{class:"header-anchor",href:"#_2-提交专家-维护者做一次","aria-label":'Permalink to "2. 提交专家(维护者做一次)"'},"​")]),l("p",null,[a("专家是一组按摸高渲染好的 skill,加一份介绍 "),l("code",null,"EXPERT.md"),a("。要用"),l("strong",null,"已经发布到 npm 的版本"),a("生成,因为第一次使用时会从内网 npm 镜像安装同一个版本:")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"git"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," checkout"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}}," <"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"版本标"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"签"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 例如 0.2.0-beta.1")]),a(`
2
2
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"npm"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install")]),a(`
3
- `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/mogao/make-expert.mjs"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 生成 dist-expert/laoshi-expert-<版本>/ 和同名 zip")])])])]),l("p",null,[a("把 "),l("code",null,"laoshi-expert-<版本>"),a(" 里的 skill 按摸高的专家格式提交到平台。包含的入口:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"入口"),l("th",null,"什么时候用")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"/laoshi")]),l("td",null,"提需求、查进度、继续、验收,日常都从这里开始")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-setup")]),l("td",null,"项目接入:每个代码库第一次用之前做一次,项目的构建、测试方式变了再做一次")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-doctor")]),l("td",null,"体检:安装、平台、项目检查是否正常")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-retro")]),l("td",null,"复盘:把 laoshi 本身的问题整理成报告")])])]),l("p",null,"另外还有方法 skill(访谈、需求说明、验收标准、如实报告等)和原则 skill,由入口按需使用。"),l("h2",{id:"_3-第一次使用-自动安装",tabindex:"-1"},[a("3. 第一次使用:自动安装 "),l("a",{class:"header-anchor",href:"#_3-第一次使用-自动安装","aria-label":'Permalink to "3. 第一次使用:自动安装"'},"​")]),l("p",null,[a("不需要单独的安装步骤。第一次在对话里用 "),l("code",null,"/laoshi"),a("(或其他入口)时,入口 skill 会先检查工作区里的 laoshi 是不是专家对应的版本,不是就从内网 npm 镜像安装,并写好安装级配置。大约一分钟,之后同一个工作区里的所有对话直接使用;专家换了新版本,下一次使用时自动换上。")]),l("p",null,"装好后的布局:"),l("div",{class:"language-text vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"text"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",null,"/data/workspace/.laoshi/")]),a(`
3
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/mogao/make-expert.mjs"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 生成 dist-expert/laoshi-expert-<版本>/ 和同名 zip")])])])]),l("p",null,[a("把 "),l("code",null,"laoshi-expert-<版本>"),a(" 里的 skill 按摸高的专家格式提交到平台。包含的入口:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"入口"),l("th",null,"什么时候用")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"/laoshi")]),l("td",null,"提需求、查进度、继续、验收,日常都从这里开始")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-setup")]),l("td",null,"项目接入:每个代码库第一次用之前做一次,项目的构建、测试方式变了再做一次")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-doctor")]),l("td",null,"体检:安装、平台、项目检查是否正常")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-retro")]),l("td",null,"复盘:把 laoshi 本身的问题整理成报告")])])]),l("p",null,"另外还有方法 skill(访谈、需求说明、验收标准、如实报告等)和原则 skill,由入口按需使用。"),l("h2",{id:"_3-第一次使用-自动安装",tabindex:"-1"},[a("3. 第一次使用:自动安装 "),l("a",{class:"header-anchor",href:"#_3-第一次使用-自动安装","aria-label":'Permalink to "3. 第一次使用:自动安装"'},"​")]),l("p",null,[a("不需要单独的安装步骤。第一次在对话里用 "),l("code",null,"/laoshi"),a("(或其他入口)时,入口 skill 会先检查工作区里的 laoshi 是不是专家对应的版本,不是就从内网 npm 镜像安装,并写好安装级配置。大约一分钟,之后同一个工作区里的所有对话直接使用。专家换了新版本,下一次使用时自动换上:专家里每条 laoshi 命令都带着它要求的版本("),l("code",null,"LAOSHI_WANT_VERSION=<版本> node …"),a("),工作区装的不是这个版本时,命令会先装上再执行。换版本请换整个专家包("),l("code",null,"make-expert.mjs"),a(" 生成),不要手工改专家里的版本号:版本号写在很多条命令里,漏改一处就会装回旧版本。")]),l("p",null,"装好后的布局:"),l("div",{class:"language-text vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"text"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",null,"/data/workspace/.laoshi/")]),a(`
4
4
  `),l("span",{class:"line"},[l("span",null,"├── npm/node_modules/@yiyi_zhang/laoshi/ 程序")]),a(`
5
5
  `),l("span",{class:"line"},[l("span",null,"├── config.json 安装级配置(平台 mogao、各角色的模型)")]),a(`
6
6
  `),l("span",{class:"line"},[l("span",null,"├── skills/ 按摸高渲染的 skill(和专家里的一样)")]),a(`
7
7
  `),l("span",{class:"line"},[l("span",null,"├── mogao/agents/ 每个步骤 agent 的记录(提示词、输出、工具调用)")]),a(`
8
8
  `),l("span",{class:"line"},[l("span",null,"└── tools/ 项目需要、沙箱里没有的工具(自己放)")])])])]),l("p",null,[a("不需要设置 "),l("code",null,"LAOSHI_HOME"),a(":程序装在安装根的 "),l("code",null,"npm"),a(" 目录里,laoshi 据此找到安装根。")]),l("p",null,[l("strong",null,"安装失败时"),a(":把对话里的输出发给开发同事。常见原因是内网镜像还没同步到这个版本(刚发布的版本要等镜像同步),这时可以手动安装:")]),l("ol",null,[l("li",null,[l("p",null,[a("从 GitHub Release 下载 "),l("code",null,"laoshi-<版本>.tgz"),a(",上传到 "),l("code",null,"/data/workspace"),a("。")])]),l("li",null,[l("p",null,"在对话里执行:"),l("div",{class:"language-bash vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"bash"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"npm"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --prefix"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/.laoshi/npm"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --no-audit"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --no-fund"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/laoshi-"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"<"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"版"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"本"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},".tgz")]),a(`
9
9
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/.laoshi/npm/node_modules/@yiyi_zhang/laoshi/bin/req.mjs"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --platform"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," mogao"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --home"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/.laoshi")])])])])]),l("li",null,[l("p",null,[a("用 "),l("code",null,"/laoshi-doctor"),a(" 体检。")])])]),l("h2",{id:"_4-项目接入-每个代码库一次",tabindex:"-1"},[a("4. 项目接入:每个代码库一次 "),l("a",{class:"header-anchor",href:"#_4-项目接入-每个代码库一次","aria-label":'Permalink to "4. 项目接入:每个代码库一次"'},"​")]),l("ol",null,[l("li",null,[a("把代码库放到工作区里,例如 "),l("code",null,"git clone <内网仓库地址> /data/workspace/<项目>"),a("。")]),l("li",null,[a("在对话里说明项目目录,运行 "),l("code",null,"/laoshi-setup"),a("。它会在项目根目录生成或更新项目说明、验证方法(实际运行其中的命令)、工作区设置和项目配置,确认后提交。")]),l("li",null,[a("用 "),l("code",null,"/laoshi-doctor"),a(" 确认项目检查全部正常。")])]),l("p",null,[l("strong",null,"构建工具"),a(":摸高的沙箱自带的工具很少(例如没有 mvn、gradle),而且每轮的 "),l("code",null,"PATH"),a(" 都会重置。项目要用的工具装到 "),l("code",null,"/data/workspace/.laoshi/tools/<工具>"),a(",命令里写完整路径。例如 Maven:")]),l("div",{class:"language-bash vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"bash"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}},"# 解压到 /data/workspace/.laoshi/tools/maven,本地仓库放在 /data/workspace/.laoshi/tools/m2")]),a(`
10
- `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"/data/workspace/.laoshi/tools/maven/bin/mvn"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -Dmaven.repo.local=/data/workspace/.laoshi/tools/m2"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," test")])])])]),l("p",null,[l("code",null,"/laoshi-setup"),a(" 写进 "),l("code",null,"verify.md"),a(" 和 "),l("code",null,".laoshi/services.json"),a(" 的命令也要这样写。")]),l("p",null,"同一个工作区里的多个代码库共用一份安装,每个代码库各做一次项目接入。"),l("h2",{id:"_5-日常使用",tabindex:"-1"},[a("5. 日常使用 "),l("a",{class:"header-anchor",href:"#_5-日常使用","aria-label":'Permalink to "5. 日常使用"'},"​")]),l("h3",{id:"提需求",tabindex:"-1"},[a("提需求 "),l("a",{class:"header-anchor",href:"#提需求","aria-label":'Permalink to "提需求"'},"​")]),l("p",null,[a("在项目目录的对话里输入 "),l("code",null,"/laoshi"),a(",说你要做什么。laoshi 先和你把需求谈清楚,写成需求说明请你确认;确认后流水线开始:方案 → 实现 → 评审 → 验证 → 报告。")]),l("h3",{id:"流水线运行期间",tabindex:"-1"},[a("流水线运行期间 "),l("a",{class:"header-anchor",href:"#流水线运行期间","aria-label":'Permalink to "流水线运行期间"'},"​")]),l("ul",null,[l("li",null,[a("启动、继续、确认方案后继续、开始测试验证这几条命令"),l("strong",null,"会一直运行"),a(",直到需要人决定(方案确认、业务问题、等待批准)或做完。对话会持续查看命令输出,把进展转告你。")]),l("li",null,[a("这期间"),l("strong",null,"不要结束这一轮对话"),a("。如果对话轮次结束了(你关掉了对话、或者超过了平台的时限),流水线就停在当时那一步。")]),l("li",null,[a('下一轮在对话里说"继续"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi resume <需求>"),a("),从停下的地方接着做;做完的步骤不会重做,做到一半的步骤会接上原来的 agent 会话。")])]),l("h3",{id:"等待批准",tabindex:"-1"},[a("等待批准 "),l("a",{class:"header-anchor",href:"#等待批准","aria-label":'Permalink to "等待批准"'},"​")]),l("p",null,[a("步骤 agent 执行平台规定要批准的命令时(按工作区 "),l("code",null,".aimax/config.yaml"),a(' 的命令黑名单),这一步会停下。对话会把要批准的操作原样告诉你,问你批准还是拒绝,然后结束这一轮。你下一轮回答"批准"或"拒绝"(可以说明理由),对话运行 '),l("code",null,"laoshi permission <需求> approve"),a("(或 "),l("code",null,"deny"),a("),转达决定并接着运行。")]),l("p",null,[a("laoshi 自己也会拦截危险命令,例如读出平台凭据的环境变量("),l("code",null,"echo $XXX_TOKEN"),a("、"),l("code",null,"printenv"),a(");工具输出写进日志前会先脱敏。")]),l("h3",{id:"需要以后再做的事",tabindex:"-1"},[a("需要以后再做的事 "),l("a",{class:"header-anchor",href:"#需要以后再做的事","aria-label":'Permalink to "需要以后再做的事"'},"​")]),l("p",null,'摸高上没有定时任务。laoshi 提示"到时再继续"的事情,到时在对话里说"继续"即可。'),l("h3",{id:"查进度、验收",tabindex:"-1"},[a("查进度、验收 "),l("a",{class:"header-anchor",href:"#查进度、验收","aria-label":'Permalink to "查进度、验收"'},"​")]),l("p",null,[a('随时在对话里问"进度怎么样"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi status"),a(")。流水线做完后会给出报告和验收清单,验收方式见"),l("a",{href:"./user#验收"},"使用者指南"),a("。")]),l("h2",{id:"_6-配置",tabindex:"-1"},[a("6. 配置 "),l("a",{class:"header-anchor",href:"#_6-配置","aria-label":'Permalink to "6. 配置"'},"​")]),l("p",null,[a("安装级配置在 "),l("code",null,"/data/workspace/.laoshi/config.json"),a(",摸高相关的部分写在 "),l("code",null,"platform.mogao"),a(" 下,一般不用改:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"默认"),l("th",null,"说明")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"command")]),l("td",null,[l("code",null,"aimax")]),l("td",null,[a("平台命令行(不在 "),l("code",null,"PATH"),a(" 中时写完整路径)")])]),l("tr",null,[l("td",null,[l("code",null,"dataDir")]),l("td",null,[l("code",null,"/data")]),l("td",null,[a("平台的数据目录("),l("code",null,"aimax -d"),a(")")])]),l("tr",null,[l("td",null,[l("code",null,"runTimeoutMinutes")]),l("td",null,"240"),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 的上限(引擎另有每一步的时限)")])]),l("tr",null,[l("td",null,[l("code",null,"pluginsConfig")]),l("td",null,"无"),l("td",null,[a("给步骤 agent 的 "),l("code",null,"--plugins-config"),a(",让步骤里也能用平台插件(如知识库)")])])])]),l("p",null,[a("各角色默认都用对话的模型("),l("code",null,"mogao/chat-model"),a(")。")]),l("h2",{id:"_7-常见问题",tabindex:"-1"},[a("7. 常见问题 "),l("a",{class:"header-anchor",href:"#_7-常见问题","aria-label":'Permalink to "7. 常见问题"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"现象"),l("th",null,"原因和处理")])]),l("tbody",null,[l("tr",null,[l("td",null,"第一次使用装不上"),l("td",null,"内网镜像还没有这个版本,或镜像暂时不通;按第 3 节手动安装")]),l("tr",null,[l("td",null,[a("体检说找不到 "),l("code",null,"aimax")]),l("td",null,[a("平台命令行不在 "),l("code",null,"PATH"),a(" 中;在 "),l("code",null,"platform.mogao.command"),a(" 写它的完整路径")])]),l("tr",null,[l("td",null,"流水线停在某一步,对话已经结束"),l("td",null,'正常:下一轮说"继续"')]),l("tr",null,[l("td",null,'某一步提示"单次运行的上限"'),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 超过了 "),l("code",null,"runTimeoutMinutes"),a(';说"继续"会接着这个步骤的会话做,频繁出现时调大这个值')])]),l("tr",null,[l("td",null,[a("构建命令找不到(如 "),l("code",null,"mvn: command not found"),a(")")]),l("td",null,"工具没装在工作区或命令没写完整路径;见第 4 节")]),l("tr",null,[l("td",null,"想知道某一步 agent 做了什么"),l("td",null,[l("code",null,"/data/workspace/.laoshi/mogao/agents/<id>/"),a(" 下有它的提示词、输出和工具调用记录")])])])]),l("h2",{id:"_8-用量",tabindex:"-1"},[a("8. 用量 "),l("a",{class:"header-anchor",href:"#_8-用量","aria-label":'Permalink to "8. 用量"'},"​")]),l("p",null,[a("每次 "),l("code",null,"aimax run"),a("(每一步、每次续接)平台的系统提示约 1.4 万 token,没有缓存命中。需求越大、评审轮次越多,步骤越多,用量也越大;"),l("code",null,"laoshi stats"),a(" 可以看每个需求的用时和 token。")])],-1),l("p",{class:"source-note"},[a("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/在摸高上使用.md"},"docs/guide/在摸高上使用.md"),a(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/在摸高上使用.md"},"在 GitHub 上编辑")],-1)])])}const g=n(t,[["render",o]]);export{k as __pageData,g as default};
10
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"/data/workspace/.laoshi/tools/maven/bin/mvn"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -Dmaven.repo.local=/data/workspace/.laoshi/tools/m2"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," test")])])])]),l("p",null,[l("code",null,"/laoshi-setup"),a(" 写进 "),l("code",null,"verify.md"),a(" 和 "),l("code",null,".laoshi/services.json"),a(" 的命令也要这样写。")]),l("p",null,"同一个工作区里的多个代码库共用一份安装,每个代码库各做一次项目接入。"),l("h2",{id:"_5-日常使用",tabindex:"-1"},[a("5. 日常使用 "),l("a",{class:"header-anchor",href:"#_5-日常使用","aria-label":'Permalink to "5. 日常使用"'},"​")]),l("h3",{id:"提需求",tabindex:"-1"},[a("提需求 "),l("a",{class:"header-anchor",href:"#提需求","aria-label":'Permalink to "提需求"'},"​")]),l("p",null,[a("在项目目录的对话里输入 "),l("code",null,"/laoshi"),a(",说你要做什么。laoshi 先和你把需求谈清楚,写成需求说明请你确认;确认后流水线开始:方案 → 实现 → 评审 → 验证 → 报告。")]),l("h3",{id:"流水线运行期间",tabindex:"-1"},[a("流水线运行期间 "),l("a",{class:"header-anchor",href:"#流水线运行期间","aria-label":'Permalink to "流水线运行期间"'},"​")]),l("ul",null,[l("li",null,[a("启动、继续、确认方案后继续、开始测试验证这几条命令"),l("strong",null,"会一直运行"),a(",直到需要人决定(方案确认、业务问题、等待批准)或做完。对话会持续查看命令输出,把进展转告你。")]),l("li",null,[a("这期间"),l("strong",null,"不要结束这一轮对话"),a("。如果对话轮次结束了(你关掉了对话、或者超过了平台的时限),流水线就停在当时那一步。")]),l("li",null,[a('下一轮在对话里说"继续"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi resume <需求>"),a("),从停下的地方接着做;做完的步骤不会重做,做到一半的步骤会接上原来的 agent 会话。")])]),l("h3",{id:"等待批准",tabindex:"-1"},[a("等待批准 "),l("a",{class:"header-anchor",href:"#等待批准","aria-label":'Permalink to "等待批准"'},"​")]),l("p",null,[a("步骤 agent 执行平台规定要批准的命令时(按工作区 "),l("code",null,".aimax/config.yaml"),a(' 的命令黑名单),这一步会停下。对话会把要批准的操作原样告诉你,问你批准还是拒绝,然后结束这一轮。你下一轮回答"批准"或"拒绝"(可以说明理由),对话运行 '),l("code",null,"laoshi permission <需求> approve"),a("(或 "),l("code",null,"deny"),a("),转达决定并接着运行。")]),l("p",null,[a("laoshi 自己也会拦截危险命令,例如读出平台凭据的环境变量("),l("code",null,"echo $XXX_TOKEN"),a("、"),l("code",null,"printenv"),a(");工具输出写进日志前会先脱敏。")]),l("h3",{id:"需要以后再做的事",tabindex:"-1"},[a("需要以后再做的事 "),l("a",{class:"header-anchor",href:"#需要以后再做的事","aria-label":'Permalink to "需要以后再做的事"'},"​")]),l("p",null,'摸高上没有定时任务。laoshi 提示"到时再继续"的事情,到时在对话里说"继续"即可。'),l("h3",{id:"查进度、验收",tabindex:"-1"},[a("查进度、验收 "),l("a",{class:"header-anchor",href:"#查进度、验收","aria-label":'Permalink to "查进度、验收"'},"​")]),l("p",null,[a('随时在对话里问"进度怎么样"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi status"),a(")。流水线做完后会给出报告和验收清单,验收方式见"),l("a",{href:"./user#验收"},"使用者指南"),a("。")]),l("h2",{id:"_6-配置",tabindex:"-1"},[a("6. 配置 "),l("a",{class:"header-anchor",href:"#_6-配置","aria-label":'Permalink to "6. 配置"'},"​")]),l("p",null,[a("安装级配置在 "),l("code",null,"/data/workspace/.laoshi/config.json"),a(",摸高相关的部分写在 "),l("code",null,"platform.mogao"),a(" 下,一般不用改:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"默认"),l("th",null,"说明")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"command")]),l("td",null,[l("code",null,"aimax")]),l("td",null,[a("平台命令行(不在 "),l("code",null,"PATH"),a(" 中时写完整路径)")])]),l("tr",null,[l("td",null,[l("code",null,"dataDir")]),l("td",null,[l("code",null,"/data")]),l("td",null,[a("平台的数据目录("),l("code",null,"aimax -d"),a(")")])]),l("tr",null,[l("td",null,[l("code",null,"runTimeoutMinutes")]),l("td",null,"240"),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 的上限(引擎另有每一步的时限)")])]),l("tr",null,[l("td",null,[l("code",null,"pluginsConfig")]),l("td",null,"无"),l("td",null,[a("给步骤 agent 的 "),l("code",null,"--plugins-config"),a(",让步骤里也能用平台插件(如知识库)")])])])]),l("p",null,[a("各角色默认都用对话的模型("),l("code",null,"mogao/chat-model"),a(")。")]),l("h2",{id:"_7-常见问题",tabindex:"-1"},[a("7. 常见问题 "),l("a",{class:"header-anchor",href:"#_7-常见问题","aria-label":'Permalink to "7. 常见问题"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"现象"),l("th",null,"原因和处理")])]),l("tbody",null,[l("tr",null,[l("td",null,"第一次使用装不上"),l("td",null,"内网镜像还没有这个版本,或镜像暂时不通;按第 3 节手动安装")]),l("tr",null,[l("td",null,[a("体检说找不到 "),l("code",null,"aimax")]),l("td",null,[a("平台命令行不在 "),l("code",null,"PATH"),a(" 中;在 "),l("code",null,"platform.mogao.command"),a(" 写它的完整路径")])]),l("tr",null,[l("td",null,"流水线停在某一步,对话已经结束"),l("td",null,'正常:下一轮说"继续"')]),l("tr",null,[l("td",null,'某一步提示"单次运行的上限"'),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 超过了 "),l("code",null,"runTimeoutMinutes"),a(';说"继续"会接着这个步骤的会话做,频繁出现时调大这个值')])]),l("tr",null,[l("td",null,[a("构建命令找不到(如 "),l("code",null,"mvn: command not found"),a(")")]),l("td",null,"工具没装在工作区或命令没写完整路径;见第 4 节")]),l("tr",null,[l("td",null,'某一步因"上下文超出"失败'),l("td",null,[a("步骤读入的内容太多(例如解压、列出依赖包)。重做时 laoshi 会提醒 agent 过滤输出、从已写下的产物接着做;连续失败时把这一步 "),l("code",null,"run-N.out"),a(" 末尾的报错发给开发同事")])]),l("tr",null,[l("td",null,"想知道某一步 agent 做了什么"),l("td",null,[l("code",null,"/data/workspace/.laoshi/mogao/agents/<id>/"),a(" 下有它的提示词、输出和工具调用记录")])])])]),l("h2",{id:"_8-用量",tabindex:"-1"},[a("8. 用量 "),l("a",{class:"header-anchor",href:"#_8-用量","aria-label":'Permalink to "8. 用量"'},"​")]),l("p",null,[a("每次 "),l("code",null,"aimax run"),a("(每一步、每次续接)平台的系统提示约 1.4 万 token,没有缓存命中。需求越大、评审轮次越多,步骤越多,用量也越大;"),l("code",null,"laoshi stats"),a(" 可以看每个需求的用时和 token。")])],-1),l("p",{class:"source-note"},[a("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/在摸高上使用.md"},"docs/guide/在摸高上使用.md"),a(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/在摸高上使用.md"},"在 GitHub 上编辑")],-1)])])}const g=n(t,[["render",o]]);export{k as __pageData,g as default};
@@ -1,10 +1,10 @@
1
1
  import{_ as n,o as s,c as e,j as l,a}from"./chunks/framework.BetZR81g.js";const k=JSON.parse('{"title":"在摸高上使用","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/mogao.md","filePath":"guide/mogao.md","lastUpdated":null}'),t={name:"guide/mogao.md"};function o(d,i,h,u,r,c){return s(),e("div",null,[...i[0]||(i[0]=[l("div",null,[l("h1",{id:"在摸高上使用",tabindex:"-1"},[a("在摸高上使用 "),l("a",{class:"header-anchor",href:"#在摸高上使用","aria-label":'Permalink to "在摸高上使用"'},"​")]),l("p",null,[a("本文面向在摸高上使用 laoshi 专家的人:提交专家的人、第一次使用的人、日常提需求的测试、产品、项目经理。laoshi 在摸高上的工作方式和 Paseo、dsh 一样:在对话里把需求谈清楚、写成需求说明并确认,之后由一组 agent 完成方案、实现、评审、验证和报告,每个要拍板的地方都停下来等人。设计见 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/mogao-expert.md",target:"_blank",rel:"noreferrer"},"mogao-expert"),a(",适配器见 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/adapters/mogao/README.md",target:"_blank",rel:"noreferrer"},"adapters/mogao"),a("。")]),l("h2",{id:"_1-先了解摸高的三个特点",tabindex:"-1"},[a("1. 先了解摸高的三个特点 "),l("a",{class:"header-anchor",href:"#_1-先了解摸高的三个特点","aria-label":'Permalink to "1. 先了解摸高的三个特点"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"特点"),l("th",null,"对使用的影响")])]),l("tbody",null,[l("tr",null,[l("td",null,[a("每个对话轮次一台新机器,只有 "),l("code",null,"/data/workspace"),a("(工作区)和 "),l("code",null,"/data/.aimax"),a(" 会保留")]),l("td",null,[a("laoshi 装在工作区的 "),l("code",null,"/data/workspace/.laoshi"),a(","),l("strong",null,"一个工作区只装一次"),a(";代码库也要放在工作区里(例如 "),l("code",null,"/data/workspace/<项目>"),a("),否则下一轮就没了")])]),l("tr",null,[l("td",null,"流水线在对话执行的命令里运行,轮次结束就停下"),l("td",null,'运行期间不要结束这一轮对话;被打断了,下一轮说"继续",做完的步骤不会重做')]),l("tr",null,[l("td",null,"没有定时任务,也不能主动给对话发消息"),l("td",null,"预约启动、定时提醒、自动继续都用不了;进展显示在命令输出里,由对话转告你")])])]),l("h2",{id:"_2-提交专家-维护者做一次",tabindex:"-1"},[a("2. 提交专家(维护者做一次) "),l("a",{class:"header-anchor",href:"#_2-提交专家-维护者做一次","aria-label":'Permalink to "2. 提交专家(维护者做一次)"'},"​")]),l("p",null,[a("专家是一组按摸高渲染好的 skill,加一份介绍 "),l("code",null,"EXPERT.md"),a("。要用"),l("strong",null,"已经发布到 npm 的版本"),a("生成,因为第一次使用时会从内网 npm 镜像安装同一个版本:")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"git"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," checkout"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}}," <"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"版本标"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"签"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 例如 0.2.0-beta.1")]),a(`
2
2
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"npm"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install")]),a(`
3
- `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/mogao/make-expert.mjs"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 生成 dist-expert/laoshi-expert-<版本>/ 和同名 zip")])])])]),l("p",null,[a("把 "),l("code",null,"laoshi-expert-<版本>"),a(" 里的 skill 按摸高的专家格式提交到平台。包含的入口:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"入口"),l("th",null,"什么时候用")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"/laoshi")]),l("td",null,"提需求、查进度、继续、验收,日常都从这里开始")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-setup")]),l("td",null,"项目接入:每个代码库第一次用之前做一次,项目的构建、测试方式变了再做一次")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-doctor")]),l("td",null,"体检:安装、平台、项目检查是否正常")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-retro")]),l("td",null,"复盘:把 laoshi 本身的问题整理成报告")])])]),l("p",null,"另外还有方法 skill(访谈、需求说明、验收标准、如实报告等)和原则 skill,由入口按需使用。"),l("h2",{id:"_3-第一次使用-自动安装",tabindex:"-1"},[a("3. 第一次使用:自动安装 "),l("a",{class:"header-anchor",href:"#_3-第一次使用-自动安装","aria-label":'Permalink to "3. 第一次使用:自动安装"'},"​")]),l("p",null,[a("不需要单独的安装步骤。第一次在对话里用 "),l("code",null,"/laoshi"),a("(或其他入口)时,入口 skill 会先检查工作区里的 laoshi 是不是专家对应的版本,不是就从内网 npm 镜像安装,并写好安装级配置。大约一分钟,之后同一个工作区里的所有对话直接使用;专家换了新版本,下一次使用时自动换上。")]),l("p",null,"装好后的布局:"),l("div",{class:"language-text vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"text"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",null,"/data/workspace/.laoshi/")]),a(`
3
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/mogao/make-expert.mjs"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 生成 dist-expert/laoshi-expert-<版本>/ 和同名 zip")])])])]),l("p",null,[a("把 "),l("code",null,"laoshi-expert-<版本>"),a(" 里的 skill 按摸高的专家格式提交到平台。包含的入口:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"入口"),l("th",null,"什么时候用")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"/laoshi")]),l("td",null,"提需求、查进度、继续、验收,日常都从这里开始")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-setup")]),l("td",null,"项目接入:每个代码库第一次用之前做一次,项目的构建、测试方式变了再做一次")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-doctor")]),l("td",null,"体检:安装、平台、项目检查是否正常")]),l("tr",null,[l("td",null,[l("code",null,"/laoshi-retro")]),l("td",null,"复盘:把 laoshi 本身的问题整理成报告")])])]),l("p",null,"另外还有方法 skill(访谈、需求说明、验收标准、如实报告等)和原则 skill,由入口按需使用。"),l("h2",{id:"_3-第一次使用-自动安装",tabindex:"-1"},[a("3. 第一次使用:自动安装 "),l("a",{class:"header-anchor",href:"#_3-第一次使用-自动安装","aria-label":'Permalink to "3. 第一次使用:自动安装"'},"​")]),l("p",null,[a("不需要单独的安装步骤。第一次在对话里用 "),l("code",null,"/laoshi"),a("(或其他入口)时,入口 skill 会先检查工作区里的 laoshi 是不是专家对应的版本,不是就从内网 npm 镜像安装,并写好安装级配置。大约一分钟,之后同一个工作区里的所有对话直接使用。专家换了新版本,下一次使用时自动换上:专家里每条 laoshi 命令都带着它要求的版本("),l("code",null,"LAOSHI_WANT_VERSION=<版本> node …"),a("),工作区装的不是这个版本时,命令会先装上再执行。换版本请换整个专家包("),l("code",null,"make-expert.mjs"),a(" 生成),不要手工改专家里的版本号:版本号写在很多条命令里,漏改一处就会装回旧版本。")]),l("p",null,"装好后的布局:"),l("div",{class:"language-text vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"text"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",null,"/data/workspace/.laoshi/")]),a(`
4
4
  `),l("span",{class:"line"},[l("span",null,"├── npm/node_modules/@yiyi_zhang/laoshi/ 程序")]),a(`
5
5
  `),l("span",{class:"line"},[l("span",null,"├── config.json 安装级配置(平台 mogao、各角色的模型)")]),a(`
6
6
  `),l("span",{class:"line"},[l("span",null,"├── skills/ 按摸高渲染的 skill(和专家里的一样)")]),a(`
7
7
  `),l("span",{class:"line"},[l("span",null,"├── mogao/agents/ 每个步骤 agent 的记录(提示词、输出、工具调用)")]),a(`
8
8
  `),l("span",{class:"line"},[l("span",null,"└── tools/ 项目需要、沙箱里没有的工具(自己放)")])])])]),l("p",null,[a("不需要设置 "),l("code",null,"LAOSHI_HOME"),a(":程序装在安装根的 "),l("code",null,"npm"),a(" 目录里,laoshi 据此找到安装根。")]),l("p",null,[l("strong",null,"安装失败时"),a(":把对话里的输出发给开发同事。常见原因是内网镜像还没同步到这个版本(刚发布的版本要等镜像同步),这时可以手动安装:")]),l("ol",null,[l("li",null,[l("p",null,[a("从 GitHub Release 下载 "),l("code",null,"laoshi-<版本>.tgz"),a(",上传到 "),l("code",null,"/data/workspace"),a("。")])]),l("li",null,[l("p",null,"在对话里执行:"),l("div",{class:"language-bash vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"bash"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"npm"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --prefix"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/.laoshi/npm"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --no-audit"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --no-fund"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/laoshi-"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"<"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"版"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"本"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},".tgz")]),a(`
9
9
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/.laoshi/npm/node_modules/@yiyi_zhang/laoshi/bin/req.mjs"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --platform"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," mogao"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --home"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," /data/workspace/.laoshi")])])])])]),l("li",null,[l("p",null,[a("用 "),l("code",null,"/laoshi-doctor"),a(" 体检。")])])]),l("h2",{id:"_4-项目接入-每个代码库一次",tabindex:"-1"},[a("4. 项目接入:每个代码库一次 "),l("a",{class:"header-anchor",href:"#_4-项目接入-每个代码库一次","aria-label":'Permalink to "4. 项目接入:每个代码库一次"'},"​")]),l("ol",null,[l("li",null,[a("把代码库放到工作区里,例如 "),l("code",null,"git clone <内网仓库地址> /data/workspace/<项目>"),a("。")]),l("li",null,[a("在对话里说明项目目录,运行 "),l("code",null,"/laoshi-setup"),a("。它会在项目根目录生成或更新项目说明、验证方法(实际运行其中的命令)、工作区设置和项目配置,确认后提交。")]),l("li",null,[a("用 "),l("code",null,"/laoshi-doctor"),a(" 确认项目检查全部正常。")])]),l("p",null,[l("strong",null,"构建工具"),a(":摸高的沙箱自带的工具很少(例如没有 mvn、gradle),而且每轮的 "),l("code",null,"PATH"),a(" 都会重置。项目要用的工具装到 "),l("code",null,"/data/workspace/.laoshi/tools/<工具>"),a(",命令里写完整路径。例如 Maven:")]),l("div",{class:"language-bash vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"bash"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}},"# 解压到 /data/workspace/.laoshi/tools/maven,本地仓库放在 /data/workspace/.laoshi/tools/m2")]),a(`
10
- `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"/data/workspace/.laoshi/tools/maven/bin/mvn"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -Dmaven.repo.local=/data/workspace/.laoshi/tools/m2"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," test")])])])]),l("p",null,[l("code",null,"/laoshi-setup"),a(" 写进 "),l("code",null,"verify.md"),a(" 和 "),l("code",null,".laoshi/services.json"),a(" 的命令也要这样写。")]),l("p",null,"同一个工作区里的多个代码库共用一份安装,每个代码库各做一次项目接入。"),l("h2",{id:"_5-日常使用",tabindex:"-1"},[a("5. 日常使用 "),l("a",{class:"header-anchor",href:"#_5-日常使用","aria-label":'Permalink to "5. 日常使用"'},"​")]),l("h3",{id:"提需求",tabindex:"-1"},[a("提需求 "),l("a",{class:"header-anchor",href:"#提需求","aria-label":'Permalink to "提需求"'},"​")]),l("p",null,[a("在项目目录的对话里输入 "),l("code",null,"/laoshi"),a(",说你要做什么。laoshi 先和你把需求谈清楚,写成需求说明请你确认;确认后流水线开始:方案 → 实现 → 评审 → 验证 → 报告。")]),l("h3",{id:"流水线运行期间",tabindex:"-1"},[a("流水线运行期间 "),l("a",{class:"header-anchor",href:"#流水线运行期间","aria-label":'Permalink to "流水线运行期间"'},"​")]),l("ul",null,[l("li",null,[a("启动、继续、确认方案后继续、开始测试验证这几条命令"),l("strong",null,"会一直运行"),a(",直到需要人决定(方案确认、业务问题、等待批准)或做完。对话会持续查看命令输出,把进展转告你。")]),l("li",null,[a("这期间"),l("strong",null,"不要结束这一轮对话"),a("。如果对话轮次结束了(你关掉了对话、或者超过了平台的时限),流水线就停在当时那一步。")]),l("li",null,[a('下一轮在对话里说"继续"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi resume <需求>"),a("),从停下的地方接着做;做完的步骤不会重做,做到一半的步骤会接上原来的 agent 会话。")])]),l("h3",{id:"等待批准",tabindex:"-1"},[a("等待批准 "),l("a",{class:"header-anchor",href:"#等待批准","aria-label":'Permalink to "等待批准"'},"​")]),l("p",null,[a("步骤 agent 执行平台规定要批准的命令时(按工作区 "),l("code",null,".aimax/config.yaml"),a(' 的命令黑名单),这一步会停下。对话会把要批准的操作原样告诉你,问你批准还是拒绝,然后结束这一轮。你下一轮回答"批准"或"拒绝"(可以说明理由),对话运行 '),l("code",null,"laoshi permission <需求> approve"),a("(或 "),l("code",null,"deny"),a("),转达决定并接着运行。")]),l("p",null,[a("laoshi 自己也会拦截危险命令,例如读出平台凭据的环境变量("),l("code",null,"echo $XXX_TOKEN"),a("、"),l("code",null,"printenv"),a(");工具输出写进日志前会先脱敏。")]),l("h3",{id:"需要以后再做的事",tabindex:"-1"},[a("需要以后再做的事 "),l("a",{class:"header-anchor",href:"#需要以后再做的事","aria-label":'Permalink to "需要以后再做的事"'},"​")]),l("p",null,'摸高上没有定时任务。laoshi 提示"到时再继续"的事情,到时在对话里说"继续"即可。'),l("h3",{id:"查进度、验收",tabindex:"-1"},[a("查进度、验收 "),l("a",{class:"header-anchor",href:"#查进度、验收","aria-label":'Permalink to "查进度、验收"'},"​")]),l("p",null,[a('随时在对话里问"进度怎么样"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi status"),a(")。流水线做完后会给出报告和验收清单,验收方式见"),l("a",{href:"./user#验收"},"使用者指南"),a("。")]),l("h2",{id:"_6-配置",tabindex:"-1"},[a("6. 配置 "),l("a",{class:"header-anchor",href:"#_6-配置","aria-label":'Permalink to "6. 配置"'},"​")]),l("p",null,[a("安装级配置在 "),l("code",null,"/data/workspace/.laoshi/config.json"),a(",摸高相关的部分写在 "),l("code",null,"platform.mogao"),a(" 下,一般不用改:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"默认"),l("th",null,"说明")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"command")]),l("td",null,[l("code",null,"aimax")]),l("td",null,[a("平台命令行(不在 "),l("code",null,"PATH"),a(" 中时写完整路径)")])]),l("tr",null,[l("td",null,[l("code",null,"dataDir")]),l("td",null,[l("code",null,"/data")]),l("td",null,[a("平台的数据目录("),l("code",null,"aimax -d"),a(")")])]),l("tr",null,[l("td",null,[l("code",null,"runTimeoutMinutes")]),l("td",null,"240"),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 的上限(引擎另有每一步的时限)")])]),l("tr",null,[l("td",null,[l("code",null,"pluginsConfig")]),l("td",null,"无"),l("td",null,[a("给步骤 agent 的 "),l("code",null,"--plugins-config"),a(",让步骤里也能用平台插件(如知识库)")])])])]),l("p",null,[a("各角色默认都用对话的模型("),l("code",null,"mogao/chat-model"),a(")。")]),l("h2",{id:"_7-常见问题",tabindex:"-1"},[a("7. 常见问题 "),l("a",{class:"header-anchor",href:"#_7-常见问题","aria-label":'Permalink to "7. 常见问题"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"现象"),l("th",null,"原因和处理")])]),l("tbody",null,[l("tr",null,[l("td",null,"第一次使用装不上"),l("td",null,"内网镜像还没有这个版本,或镜像暂时不通;按第 3 节手动安装")]),l("tr",null,[l("td",null,[a("体检说找不到 "),l("code",null,"aimax")]),l("td",null,[a("平台命令行不在 "),l("code",null,"PATH"),a(" 中;在 "),l("code",null,"platform.mogao.command"),a(" 写它的完整路径")])]),l("tr",null,[l("td",null,"流水线停在某一步,对话已经结束"),l("td",null,'正常:下一轮说"继续"')]),l("tr",null,[l("td",null,'某一步提示"单次运行的上限"'),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 超过了 "),l("code",null,"runTimeoutMinutes"),a(';说"继续"会接着这个步骤的会话做,频繁出现时调大这个值')])]),l("tr",null,[l("td",null,[a("构建命令找不到(如 "),l("code",null,"mvn: command not found"),a(")")]),l("td",null,"工具没装在工作区或命令没写完整路径;见第 4 节")]),l("tr",null,[l("td",null,"想知道某一步 agent 做了什么"),l("td",null,[l("code",null,"/data/workspace/.laoshi/mogao/agents/<id>/"),a(" 下有它的提示词、输出和工具调用记录")])])])]),l("h2",{id:"_8-用量",tabindex:"-1"},[a("8. 用量 "),l("a",{class:"header-anchor",href:"#_8-用量","aria-label":'Permalink to "8. 用量"'},"​")]),l("p",null,[a("每次 "),l("code",null,"aimax run"),a("(每一步、每次续接)平台的系统提示约 1.4 万 token,没有缓存命中。需求越大、评审轮次越多,步骤越多,用量也越大;"),l("code",null,"laoshi stats"),a(" 可以看每个需求的用时和 token。")])],-1),l("p",{class:"source-note"},[a("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/在摸高上使用.md"},"docs/guide/在摸高上使用.md"),a(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/在摸高上使用.md"},"在 GitHub 上编辑")],-1)])])}const g=n(t,[["render",o]]);export{k as __pageData,g as default};
10
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"/data/workspace/.laoshi/tools/maven/bin/mvn"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -Dmaven.repo.local=/data/workspace/.laoshi/tools/m2"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," test")])])])]),l("p",null,[l("code",null,"/laoshi-setup"),a(" 写进 "),l("code",null,"verify.md"),a(" 和 "),l("code",null,".laoshi/services.json"),a(" 的命令也要这样写。")]),l("p",null,"同一个工作区里的多个代码库共用一份安装,每个代码库各做一次项目接入。"),l("h2",{id:"_5-日常使用",tabindex:"-1"},[a("5. 日常使用 "),l("a",{class:"header-anchor",href:"#_5-日常使用","aria-label":'Permalink to "5. 日常使用"'},"​")]),l("h3",{id:"提需求",tabindex:"-1"},[a("提需求 "),l("a",{class:"header-anchor",href:"#提需求","aria-label":'Permalink to "提需求"'},"​")]),l("p",null,[a("在项目目录的对话里输入 "),l("code",null,"/laoshi"),a(",说你要做什么。laoshi 先和你把需求谈清楚,写成需求说明请你确认;确认后流水线开始:方案 → 实现 → 评审 → 验证 → 报告。")]),l("h3",{id:"流水线运行期间",tabindex:"-1"},[a("流水线运行期间 "),l("a",{class:"header-anchor",href:"#流水线运行期间","aria-label":'Permalink to "流水线运行期间"'},"​")]),l("ul",null,[l("li",null,[a("启动、继续、确认方案后继续、开始测试验证这几条命令"),l("strong",null,"会一直运行"),a(",直到需要人决定(方案确认、业务问题、等待批准)或做完。对话会持续查看命令输出,把进展转告你。")]),l("li",null,[a("这期间"),l("strong",null,"不要结束这一轮对话"),a("。如果对话轮次结束了(你关掉了对话、或者超过了平台的时限),流水线就停在当时那一步。")]),l("li",null,[a('下一轮在对话里说"继续"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi resume <需求>"),a("),从停下的地方接着做;做完的步骤不会重做,做到一半的步骤会接上原来的 agent 会话。")])]),l("h3",{id:"等待批准",tabindex:"-1"},[a("等待批准 "),l("a",{class:"header-anchor",href:"#等待批准","aria-label":'Permalink to "等待批准"'},"​")]),l("p",null,[a("步骤 agent 执行平台规定要批准的命令时(按工作区 "),l("code",null,".aimax/config.yaml"),a(' 的命令黑名单),这一步会停下。对话会把要批准的操作原样告诉你,问你批准还是拒绝,然后结束这一轮。你下一轮回答"批准"或"拒绝"(可以说明理由),对话运行 '),l("code",null,"laoshi permission <需求> approve"),a("(或 "),l("code",null,"deny"),a("),转达决定并接着运行。")]),l("p",null,[a("laoshi 自己也会拦截危险命令,例如读出平台凭据的环境变量("),l("code",null,"echo $XXX_TOKEN"),a("、"),l("code",null,"printenv"),a(");工具输出写进日志前会先脱敏。")]),l("h3",{id:"需要以后再做的事",tabindex:"-1"},[a("需要以后再做的事 "),l("a",{class:"header-anchor",href:"#需要以后再做的事","aria-label":'Permalink to "需要以后再做的事"'},"​")]),l("p",null,'摸高上没有定时任务。laoshi 提示"到时再继续"的事情,到时在对话里说"继续"即可。'),l("h3",{id:"查进度、验收",tabindex:"-1"},[a("查进度、验收 "),l("a",{class:"header-anchor",href:"#查进度、验收","aria-label":'Permalink to "查进度、验收"'},"​")]),l("p",null,[a('随时在对话里问"进度怎么样"('),l("code",null,"/laoshi"),a(" 会运行 "),l("code",null,"laoshi status"),a(")。流水线做完后会给出报告和验收清单,验收方式见"),l("a",{href:"./user#验收"},"使用者指南"),a("。")]),l("h2",{id:"_6-配置",tabindex:"-1"},[a("6. 配置 "),l("a",{class:"header-anchor",href:"#_6-配置","aria-label":'Permalink to "6. 配置"'},"​")]),l("p",null,[a("安装级配置在 "),l("code",null,"/data/workspace/.laoshi/config.json"),a(",摸高相关的部分写在 "),l("code",null,"platform.mogao"),a(" 下,一般不用改:")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"默认"),l("th",null,"说明")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"command")]),l("td",null,[l("code",null,"aimax")]),l("td",null,[a("平台命令行(不在 "),l("code",null,"PATH"),a(" 中时写完整路径)")])]),l("tr",null,[l("td",null,[l("code",null,"dataDir")]),l("td",null,[l("code",null,"/data")]),l("td",null,[a("平台的数据目录("),l("code",null,"aimax -d"),a(")")])]),l("tr",null,[l("td",null,[l("code",null,"runTimeoutMinutes")]),l("td",null,"240"),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 的上限(引擎另有每一步的时限)")])]),l("tr",null,[l("td",null,[l("code",null,"pluginsConfig")]),l("td",null,"无"),l("td",null,[a("给步骤 agent 的 "),l("code",null,"--plugins-config"),a(",让步骤里也能用平台插件(如知识库)")])])])]),l("p",null,[a("各角色默认都用对话的模型("),l("code",null,"mogao/chat-model"),a(")。")]),l("h2",{id:"_7-常见问题",tabindex:"-1"},[a("7. 常见问题 "),l("a",{class:"header-anchor",href:"#_7-常见问题","aria-label":'Permalink to "7. 常见问题"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"现象"),l("th",null,"原因和处理")])]),l("tbody",null,[l("tr",null,[l("td",null,"第一次使用装不上"),l("td",null,"内网镜像还没有这个版本,或镜像暂时不通;按第 3 节手动安装")]),l("tr",null,[l("td",null,[a("体检说找不到 "),l("code",null,"aimax")]),l("td",null,[a("平台命令行不在 "),l("code",null,"PATH"),a(" 中;在 "),l("code",null,"platform.mogao.command"),a(" 写它的完整路径")])]),l("tr",null,[l("td",null,"流水线停在某一步,对话已经结束"),l("td",null,'正常:下一轮说"继续"')]),l("tr",null,[l("td",null,'某一步提示"单次运行的上限"'),l("td",null,[a("一次 "),l("code",null,"aimax run"),a(" 超过了 "),l("code",null,"runTimeoutMinutes"),a(';说"继续"会接着这个步骤的会话做,频繁出现时调大这个值')])]),l("tr",null,[l("td",null,[a("构建命令找不到(如 "),l("code",null,"mvn: command not found"),a(")")]),l("td",null,"工具没装在工作区或命令没写完整路径;见第 4 节")]),l("tr",null,[l("td",null,'某一步因"上下文超出"失败'),l("td",null,[a("步骤读入的内容太多(例如解压、列出依赖包)。重做时 laoshi 会提醒 agent 过滤输出、从已写下的产物接着做;连续失败时把这一步 "),l("code",null,"run-N.out"),a(" 末尾的报错发给开发同事")])]),l("tr",null,[l("td",null,"想知道某一步 agent 做了什么"),l("td",null,[l("code",null,"/data/workspace/.laoshi/mogao/agents/<id>/"),a(" 下有它的提示词、输出和工具调用记录")])])])]),l("h2",{id:"_8-用量",tabindex:"-1"},[a("8. 用量 "),l("a",{class:"header-anchor",href:"#_8-用量","aria-label":'Permalink to "8. 用量"'},"​")]),l("p",null,[a("每次 "),l("code",null,"aimax run"),a("(每一步、每次续接)平台的系统提示约 1.4 万 token,没有缓存命中。需求越大、评审轮次越多,步骤越多,用量也越大;"),l("code",null,"laoshi stats"),a(" 可以看每个需求的用时和 token。")])],-1),l("p",{class:"source-note"},[a("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/在摸高上使用.md"},"docs/guide/在摸高上使用.md"),a(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/在摸高上使用.md"},"在 GitHub 上编辑")],-1)])])}const g=n(t,[["render",o]]);export{k as __pageData,g as default};
@@ -0,0 +1,5 @@
1
+ import{_ as i,o as n,c as a,j as l,a as e}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"Paseo Web 与 dsh 真实环境插件走查清单","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/walkthrough.md","filePath":"guide/walkthrough.md","lastUpdated":null}'),d={name:"guide/walkthrough.md"};function t(h,s,o,u,r,c){return n(),a("div",null,[...s[0]||(s[0]=[l("div",null,[l("h1",{id:"paseo-web-与-dsh-真实环境插件走查清单",tabindex:"-1"},[e("Paseo Web 与 dsh 真实环境插件走查清单 "),l("a",{class:"header-anchor",href:"#paseo-web-与-dsh-真实环境插件走查清单","aria-label":'Permalink to "Paseo Web 与 dsh 真实环境插件走查清单"'},"​")]),l("p",null,[e("本清单用于在"),l("strong",null,"真实运行的 Paseo Web 端"),e("与**内网 dsh(Node 24)**环境中,对 laoshi 插件、共享 Web 需求看板及核心流程扩展进行端到端人工走查。如遇到问题,请记录「结果/截图」并按文末方式打包诊断信息反馈。")]),l("hr"),l("h2",{id:"_1-前置条件与安装确认",tabindex:"-1"},[e("1. 前置条件与安装确认 "),l("a",{class:"header-anchor",href:"#_1-前置条件与安装确认","aria-label":'Permalink to "1. 前置条件与安装确认"'},"​")]),l("h3",{id:"_1-1-运行环境",tabindex:"-1"},[e("1.1 运行环境 "),l("a",{class:"header-anchor",href:"#_1-1-运行环境","aria-label":'Permalink to "1.1 运行环境"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"平台"),l("th",null,"支持范围 / 环境要求"),l("th",null,"参考说明")])]),l("tbody",null,[l("tr",null,[l("td",null,"Paseo(Web 端优先)"),l("td",null,[e("Paseo daemon "),l("code",null,">=0.11.0 <0.18.0"),e("(见根目录 "),l("code",null,"package.json"),e(" 的 "),l("code",null,"reqKit.paseo"),e(");Node.js "),l("code",null,">=22")]),l("td",null,[l("a",{href:"./install"},"安装与升级")])]),l("tr",null,[l("td",null,"DeepSeek Harness(dsh)"),l("td",null,[e("dsh "),l("code",null,">=0.2.0 <0.3.0"),e("(见 "),l("code",null,"reqKit.dsh"),e(");内网要求 "),l("strong",null,"Node 24"),e(";Windows 下禁止依赖 PowerShell")]),l("td",null,[l("a",{href:"./dsh"},"dsh 适配器说明"),e("、"),l("a",{href:"./intranet"},"内网安装与验证")])])])]),l("h3",{id:"_1-2-安装与插件启用",tabindex:"-1"},[e("1.2 安装与插件启用 "),l("a",{class:"header-anchor",href:"#_1-2-安装与插件启用","aria-label":'Permalink to "1.2 安装与插件启用"'},"​")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}},"# Paseo(同时安装/刷新 Paseo Web 插件)")]),e(`
2
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --platform"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," paseo"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --with-plugin")]),e(`
3
+ `),l("span",{class:"line"}),e(`
4
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}},"# dsh(默认开启托管 Web 看板 board: true)")]),e(`
5
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --platform"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," dsh")])])])]),l("blockquote",null,[l("p",null,[e("内网离线安装包部署 dsh 请参考 "),l("a",{href:"./intranet"},"内网安装与验证"),e("。若 Paseo daemon 在安装时未启动,先启动 daemon 后可执行 "),l("code",null,"laoshi plugin install --yes"),e(" 完成挂载。")])]),l("h3",{id:"_1-3-laoshi-doctor-期望输出",tabindex:"-1"},[e("1.3 "),l("code",null,"laoshi doctor"),e(" 期望输出 "),l("a",{class:"header-anchor",href:"#_1-3-laoshi-doctor-期望输出","aria-label":'Permalink to "1.3 `laoshi doctor` 期望输出"'},"​")]),l("p",null,[e("在测试项目目录运行 "),l("code",null,"laoshi doctor"),e(",确认以下关键项均正常("),l("code",null,"✓"),e("):")]),l("ul",null,[l("li",null,[l("strong",null,"配置与核心"),e(":配置分层正确;若项目配置开启了 "),l("code",null,"reviewPanel"),e(",检查多厂商模型互补性;若有受控流程扩展("),l("code",null,"extensions"),e("),校验 "),l("code",null,"skill"),e(" 路径存在;若未登记 "),l("code",null,"relatedRepos"),e(" 且存在同级 git 仓库,应提示可用 "),l("code",null,"/laoshi-setup"),e(" 自动发现登记。")]),l("li",null,[l("strong",null,"Paseo"),e(":显示已连接 daemon 且版本在支持范围内,"),l("code",null,"laoshi"),e(" 插件已安装并运行。")]),l("li",null,[l("strong",null,"dsh"),e(":显示已连接 "),l("code",null,"laoshi"),e(" dsh 插件(socket 或 Windows 命名管道)、版本在支持范围内、可用模型提供方,以及"),l("strong",null,"托管需求看板运行地址"),e("(如 "),l("code",null,"需求看板运行中:http://127.0.0.1:<端口>/"),e(")。")])]),l("hr"),l("h2",{id:"_2-逐项走查清单",tabindex:"-1"},[e("2. 逐项走查清单 "),l("a",{class:"header-anchor",href:"#_2-逐项走查清单","aria-label":'Permalink to "2. 逐项走查清单"'},"​")]),l("p",null,"请在 Paseo Web 插件页面与 dsh 托管看板(以及对应项目对话)中依次验证下表每一项:"),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"项目"),l("th",null,"操作"),l("th",null,"期望结果"),l("th",null,"结果 / 截图")])]),l("tbody",null,[l("tr",null,[l("td",null,"1. 总览分组与「需要你处理」(X1)"),l("td",null,"准备至少 1 个处于等待确认方案或业务问题的需求,打开 Paseo Web 插件总览与 dsh 需求看板首页"),l("td",null,[e("全部界面文案统一为中文;首页 Bento KPI 数字准确;「需要你处理」区置顶展示等待时长("),l("code",null,"等了 …"),e(")、紧急程度提示、影响说明与主操作按钮")]),l("td")]),l("tr",null,[l("td",null,"2. 基础操作(确认/停止/继续/验证)"),l("td",null,"对对应状态的需求分别执行「确认方案」「停止」「继续」「开始测试验证」(本地或已部署环境)"),l("td",null,"操作二次确认弹窗正常;执行后状态与 6 站放行轨实时更新;「停止」会中断后台进程与当前步骤,「继续」沿用已完成步骤"),l("td")]),l("tr",null,[l("td",null,"3. 验收工作台与一键试用(X2)"),l("td",null,"打开已完成或待验收需求详情:Web 看板切至「验收工作台」,Paseo 点「一键试用」「验收清单」"),l("td",null,[e("点「一键启动试用」返回可访问地址与测试说明;逐条勾选 AC(全部通过或标记不通过+原因)后提交,生成并提交 "),l("code",null,"acceptance.md"),e(";点「停止试用」可停止服务")]),l("td")]),l("tr",null,[l("td",null,"4. 进度预估与预算提醒(X3)"),l("td",null,[e("本机累计至少 3 个同档位已完成需求后:启动 1 个新需求(接近 "),l("code",null,"budget.tokens"),e("),并查看进行中需求详情")]),l("td",null,"新需求启动日志给出历史中位数用时/token 与预算提醒;详情页展示已用时长、tokens 及预计剩余时间"),l("td")]),l("tr",null,[l("td",null,"5. 联合开发与多仓视图(X7)"),l("td",null,[e("在配置了 "),l("code",null,"relatedRepos"),e("(可选 "),l("code",null,"maxJointRepos"),e(" > 2)且 "),l("code",null,"spec.md"),e(" 带 "),l("code",null,"- 联合开发:…"),e(" 的项目中运行联合需求并打开详情")]),l("td",null,[e("详情页展示每个联合仓库名称、分支、工作区路径与质量门通过状态徽标;"),l("code",null,"/laoshi-setup"),e(" 能列出同级 git 仓库供勾选")]),l("td")]),l("tr",null,[l("td",null,"6. 发起改需求(X5)"),l("td",null,"在 Web 看板「变更与接手」页签或 Paseo 详情页点「改需求」,输入变更说明并确认发送"),l("td",null,[e("原对话收到 "),l("code",null,"【需求开发流水线通知 · 需求方要改需求】"),e(" 通知;若流水线在运行则引导先停止,按对齐流程更新 "),l("code",null,"spec.md"),e(" 版本并追加 "),l("code",null,"changes.md")]),l("td")]),l("tr",null,[l("td",null,"7. 变更历史与转交接手(X5)"),l("td",null,[e("在 Web 看板「变更与接手」页签或 Paseo「变更历史与负责人」区块展开变更记录、查看 "),l("code",null,"spec.md"),e(" 提交 diff,并提交「转交」给另一同事")]),l("td",null,[e("列表与详情显示更新后的当前负责人;"),l("code",null,"changes.md"),e(" 倒序折叠可读;git diff 以绿增/红删高亮显示改动行;"),l("code",null,".pipeline/owner.json"),e(" 保留完整转交历史")]),l("td")]),l("tr",null,[l("td",null,[e("8. dsh 定时任务 "),l("code",null,"expiresAt")]),l("td",null,[e("通过带到期时间("),l("code",null,"expiresAt"),e(")的预约或测试脚本在 dsh 上创建周期定时任务")]),l("td",null,[e("到达 "),l("code",null,"expiresAt"),e(" 后 dsh 插件自动取消定时任务(dsh "),l("code",null,"0.2.2-rc.5+"),e(" 调用 "),l("code",null,"schedule.edit"),e(",旧版调用 "),l("code",null,"schedule.delete"),e("),不再继续触发")]),l("td")]),l("tr",null,[l("td",null,[e("9. dsh "),l("code",null,"scheduleNewAgent")]),l("td",null,[e("运行 "),l("code",null,'laoshi digest --schedule "0 9 * * 1"'),e(" 预约需求总览,再执行 "),l("code",null,"laoshi digest --cancel <ID>")]),l("td",null,[e("dsh 插件新建独立会话并绑定 cron 定时任务,返回 "),l("code",null,"dsh:<sessionId>/<id>"),e(";取消后对应定时任务被删除")]),l("td")]),l("tr",null,[l("td",null,"10. 只读模式拦截"),l("td",null,[e("在 Paseo 插件设置打开 "),l("code",null,"readOnly"),e("(或启动 "),l("code",null,"laoshi board --read-only"),e(")后尝试点击操作/验收/改需求/转交按钮")]),l("td",null,[e("界面隐藏写操作表单与按钮;直接调用后端接口("),l("code",null,"run"),e(" / "),l("code",null,"/api/action"),e(" / "),l("code",null,"/api/try"),e(" / "),l("code",null,"/api/acceptance"),e(")也返回只读拒绝,不修改任何状态")]),l("td")]),l("tr",null,[l("td",null,"11. Windows 受控流程扩展(M3)"),l("td",null,[e("在 Windows 项目 "),l("code",null,".laoshi.json"),e(" 配置 "),l("code",null,"extensions"),e("(含 "),l("code",null,'kind: "script"'),e(" 及双引号参数命令,挂载 "),l("code",null,'after: "handoff"'),e(")后运行流水线")]),l("td",null,[e("脚本通过 "),l("code",null,"cmd.exe"),e("(不启动 PowerShell)正常执行,注入 "),l("code",null,"LAOSHI_*"),e(" 环境变量,日志完整写入 "),l("code",null,".pipeline/extensions/<id>.log")]),l("td")])])]),l("blockquote",null,[l("p",null,[l("strong",null,"当前已知未接入 dsh 项说明"),e(":dsh 的"),l("strong",null,"事件流替代轮询"),e("与**浏览器能力检测("),l("code",null,"capabilities"),e(")**目前仍按降级路径运行,待在真实 dsh 环境中确认对应插件 API 后再单独补齐。")])]),l("hr"),l("h2",{id:"_3-dsh-自动化端到端脚本-可选",tabindex:"-1"},[e("3. dsh 自动化端到端脚本(可选) "),l("a",{class:"header-anchor",href:"#_3-dsh-自动化端到端脚本-可选","aria-label":'Permalink to "3. dsh 自动化端到端脚本(可选)"'},"​")]),l("p",null,[e("如果内网机器已安装 "),l("code",null,"@deepseek-ai/dsh"),e(",可先用模拟模型跑通底层链路:")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"LAOSHI_E2E_DSH"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"=<"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"装有"),l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," @deepseek-ai/dsh"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," 的目"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"录"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/dsh/e2e/run-e2e.mjs"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --worktree")])])])]),l("p",null,"检查全部通过后再结合上表走查真实模型与插件 Web 界面效果。"),l("hr"),l("h2",{id:"_4-问题排查与反馈",tabindex:"-1"},[e("4. 问题排查与反馈 "),l("a",{class:"header-anchor",href:"#_4-问题排查与反馈","aria-label":'Permalink to "4. 问题排查与反馈"'},"​")]),l("p",null,[e("若走查中任一项未通过或流水线中断,请运行以下命令打包现场信息(日志与配置会自动脱敏),连同"),l("strong",null,[e("走查表结果、页面截图、"),l("code",null,"laoshi doctor"),e(" 输出")]),e("一并发给维护者:")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," diagnose"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}}," <"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"需求名"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"称"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --out"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," ./diagnose-output")])])])])],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/真实环境走查.md"},"docs/guide/真实环境走查.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/真实环境走查.md"},"在 GitHub 上编辑")],-1)])])}const g=i(d,[["render",t]]);export{p as __pageData,g as default};
@@ -0,0 +1,5 @@
1
+ import{_ as i,o as n,c as a,j as l,a as e}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"Paseo Web 与 dsh 真实环境插件走查清单","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/walkthrough.md","filePath":"guide/walkthrough.md","lastUpdated":null}'),d={name:"guide/walkthrough.md"};function t(h,s,o,u,r,c){return n(),a("div",null,[...s[0]||(s[0]=[l("div",null,[l("h1",{id:"paseo-web-与-dsh-真实环境插件走查清单",tabindex:"-1"},[e("Paseo Web 与 dsh 真实环境插件走查清单 "),l("a",{class:"header-anchor",href:"#paseo-web-与-dsh-真实环境插件走查清单","aria-label":'Permalink to "Paseo Web 与 dsh 真实环境插件走查清单"'},"​")]),l("p",null,[e("本清单用于在"),l("strong",null,"真实运行的 Paseo Web 端"),e("与**内网 dsh(Node 24)**环境中,对 laoshi 插件、共享 Web 需求看板及核心流程扩展进行端到端人工走查。如遇到问题,请记录「结果/截图」并按文末方式打包诊断信息反馈。")]),l("hr"),l("h2",{id:"_1-前置条件与安装确认",tabindex:"-1"},[e("1. 前置条件与安装确认 "),l("a",{class:"header-anchor",href:"#_1-前置条件与安装确认","aria-label":'Permalink to "1. 前置条件与安装确认"'},"​")]),l("h3",{id:"_1-1-运行环境",tabindex:"-1"},[e("1.1 运行环境 "),l("a",{class:"header-anchor",href:"#_1-1-运行环境","aria-label":'Permalink to "1.1 运行环境"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"平台"),l("th",null,"支持范围 / 环境要求"),l("th",null,"参考说明")])]),l("tbody",null,[l("tr",null,[l("td",null,"Paseo(Web 端优先)"),l("td",null,[e("Paseo daemon "),l("code",null,">=0.11.0 <0.18.0"),e("(见根目录 "),l("code",null,"package.json"),e(" 的 "),l("code",null,"reqKit.paseo"),e(");Node.js "),l("code",null,">=22")]),l("td",null,[l("a",{href:"./install"},"安装与升级")])]),l("tr",null,[l("td",null,"DeepSeek Harness(dsh)"),l("td",null,[e("dsh "),l("code",null,">=0.2.0 <0.3.0"),e("(见 "),l("code",null,"reqKit.dsh"),e(");内网要求 "),l("strong",null,"Node 24"),e(";Windows 下禁止依赖 PowerShell")]),l("td",null,[l("a",{href:"./dsh"},"dsh 适配器说明"),e("、"),l("a",{href:"./intranet"},"内网安装与验证")])])])]),l("h3",{id:"_1-2-安装与插件启用",tabindex:"-1"},[e("1.2 安装与插件启用 "),l("a",{class:"header-anchor",href:"#_1-2-安装与插件启用","aria-label":'Permalink to "1.2 安装与插件启用"'},"​")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}},"# Paseo(同时安装/刷新 Paseo Web 插件)")]),e(`
2
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --platform"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," paseo"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --with-plugin")]),e(`
3
+ `),l("span",{class:"line"}),e(`
4
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}},"# dsh(默认开启托管 Web 看板 board: true)")]),e(`
5
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --platform"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," dsh")])])])]),l("blockquote",null,[l("p",null,[e("内网离线安装包部署 dsh 请参考 "),l("a",{href:"./intranet"},"内网安装与验证"),e("。若 Paseo daemon 在安装时未启动,先启动 daemon 后可执行 "),l("code",null,"laoshi plugin install --yes"),e(" 完成挂载。")])]),l("h3",{id:"_1-3-laoshi-doctor-期望输出",tabindex:"-1"},[e("1.3 "),l("code",null,"laoshi doctor"),e(" 期望输出 "),l("a",{class:"header-anchor",href:"#_1-3-laoshi-doctor-期望输出","aria-label":'Permalink to "1.3 `laoshi doctor` 期望输出"'},"​")]),l("p",null,[e("在测试项目目录运行 "),l("code",null,"laoshi doctor"),e(",确认以下关键项均正常("),l("code",null,"✓"),e("):")]),l("ul",null,[l("li",null,[l("strong",null,"配置与核心"),e(":配置分层正确;若项目配置开启了 "),l("code",null,"reviewPanel"),e(",检查多厂商模型互补性;若有受控流程扩展("),l("code",null,"extensions"),e("),校验 "),l("code",null,"skill"),e(" 路径存在;若未登记 "),l("code",null,"relatedRepos"),e(" 且存在同级 git 仓库,应提示可用 "),l("code",null,"/laoshi-setup"),e(" 自动发现登记。")]),l("li",null,[l("strong",null,"Paseo"),e(":显示已连接 daemon 且版本在支持范围内,"),l("code",null,"laoshi"),e(" 插件已安装并运行。")]),l("li",null,[l("strong",null,"dsh"),e(":显示已连接 "),l("code",null,"laoshi"),e(" dsh 插件(socket 或 Windows 命名管道)、版本在支持范围内、可用模型提供方,以及"),l("strong",null,"托管需求看板运行地址"),e("(如 "),l("code",null,"需求看板运行中:http://127.0.0.1:<端口>/"),e(")。")])]),l("hr"),l("h2",{id:"_2-逐项走查清单",tabindex:"-1"},[e("2. 逐项走查清单 "),l("a",{class:"header-anchor",href:"#_2-逐项走查清单","aria-label":'Permalink to "2. 逐项走查清单"'},"​")]),l("p",null,"请在 Paseo Web 插件页面与 dsh 托管看板(以及对应项目对话)中依次验证下表每一项:"),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"项目"),l("th",null,"操作"),l("th",null,"期望结果"),l("th",null,"结果 / 截图")])]),l("tbody",null,[l("tr",null,[l("td",null,"1. 总览分组与「需要你处理」(X1)"),l("td",null,"准备至少 1 个处于等待确认方案或业务问题的需求,打开 Paseo Web 插件总览与 dsh 需求看板首页"),l("td",null,[e("全部界面文案统一为中文;首页 Bento KPI 数字准确;「需要你处理」区置顶展示等待时长("),l("code",null,"等了 …"),e(")、紧急程度提示、影响说明与主操作按钮")]),l("td")]),l("tr",null,[l("td",null,"2. 基础操作(确认/停止/继续/验证)"),l("td",null,"对对应状态的需求分别执行「确认方案」「停止」「继续」「开始测试验证」(本地或已部署环境)"),l("td",null,"操作二次确认弹窗正常;执行后状态与 6 站放行轨实时更新;「停止」会中断后台进程与当前步骤,「继续」沿用已完成步骤"),l("td")]),l("tr",null,[l("td",null,"3. 验收工作台与一键试用(X2)"),l("td",null,"打开已完成或待验收需求详情:Web 看板切至「验收工作台」,Paseo 点「一键试用」「验收清单」"),l("td",null,[e("点「一键启动试用」返回可访问地址与测试说明;逐条勾选 AC(全部通过或标记不通过+原因)后提交,生成并提交 "),l("code",null,"acceptance.md"),e(";点「停止试用」可停止服务")]),l("td")]),l("tr",null,[l("td",null,"4. 进度预估与预算提醒(X3)"),l("td",null,[e("本机累计至少 3 个同档位已完成需求后:启动 1 个新需求(接近 "),l("code",null,"budget.tokens"),e("),并查看进行中需求详情")]),l("td",null,"新需求启动日志给出历史中位数用时/token 与预算提醒;详情页展示已用时长、tokens 及预计剩余时间"),l("td")]),l("tr",null,[l("td",null,"5. 联合开发与多仓视图(X7)"),l("td",null,[e("在配置了 "),l("code",null,"relatedRepos"),e("(可选 "),l("code",null,"maxJointRepos"),e(" > 2)且 "),l("code",null,"spec.md"),e(" 带 "),l("code",null,"- 联合开发:…"),e(" 的项目中运行联合需求并打开详情")]),l("td",null,[e("详情页展示每个联合仓库名称、分支、工作区路径与质量门通过状态徽标;"),l("code",null,"/laoshi-setup"),e(" 能列出同级 git 仓库供勾选")]),l("td")]),l("tr",null,[l("td",null,"6. 发起改需求(X5)"),l("td",null,"在 Web 看板「变更与接手」页签或 Paseo 详情页点「改需求」,输入变更说明并确认发送"),l("td",null,[e("原对话收到 "),l("code",null,"【需求开发流水线通知 · 需求方要改需求】"),e(" 通知;若流水线在运行则引导先停止,按对齐流程更新 "),l("code",null,"spec.md"),e(" 版本并追加 "),l("code",null,"changes.md")]),l("td")]),l("tr",null,[l("td",null,"7. 变更历史与转交接手(X5)"),l("td",null,[e("在 Web 看板「变更与接手」页签或 Paseo「变更历史与负责人」区块展开变更记录、查看 "),l("code",null,"spec.md"),e(" 提交 diff,并提交「转交」给另一同事")]),l("td",null,[e("列表与详情显示更新后的当前负责人;"),l("code",null,"changes.md"),e(" 倒序折叠可读;git diff 以绿增/红删高亮显示改动行;"),l("code",null,".pipeline/owner.json"),e(" 保留完整转交历史")]),l("td")]),l("tr",null,[l("td",null,[e("8. dsh 定时任务 "),l("code",null,"expiresAt")]),l("td",null,[e("通过带到期时间("),l("code",null,"expiresAt"),e(")的预约或测试脚本在 dsh 上创建周期定时任务")]),l("td",null,[e("到达 "),l("code",null,"expiresAt"),e(" 后 dsh 插件自动取消定时任务(dsh "),l("code",null,"0.2.2-rc.5+"),e(" 调用 "),l("code",null,"schedule.edit"),e(",旧版调用 "),l("code",null,"schedule.delete"),e("),不再继续触发")]),l("td")]),l("tr",null,[l("td",null,[e("9. dsh "),l("code",null,"scheduleNewAgent")]),l("td",null,[e("运行 "),l("code",null,'laoshi digest --schedule "0 9 * * 1"'),e(" 预约需求总览,再执行 "),l("code",null,"laoshi digest --cancel <ID>")]),l("td",null,[e("dsh 插件新建独立会话并绑定 cron 定时任务,返回 "),l("code",null,"dsh:<sessionId>/<id>"),e(";取消后对应定时任务被删除")]),l("td")]),l("tr",null,[l("td",null,"10. 只读模式拦截"),l("td",null,[e("在 Paseo 插件设置打开 "),l("code",null,"readOnly"),e("(或启动 "),l("code",null,"laoshi board --read-only"),e(")后尝试点击操作/验收/改需求/转交按钮")]),l("td",null,[e("界面隐藏写操作表单与按钮;直接调用后端接口("),l("code",null,"run"),e(" / "),l("code",null,"/api/action"),e(" / "),l("code",null,"/api/try"),e(" / "),l("code",null,"/api/acceptance"),e(")也返回只读拒绝,不修改任何状态")]),l("td")]),l("tr",null,[l("td",null,"11. Windows 受控流程扩展(M3)"),l("td",null,[e("在 Windows 项目 "),l("code",null,".laoshi.json"),e(" 配置 "),l("code",null,"extensions"),e("(含 "),l("code",null,'kind: "script"'),e(" 及双引号参数命令,挂载 "),l("code",null,'after: "handoff"'),e(")后运行流水线")]),l("td",null,[e("脚本通过 "),l("code",null,"cmd.exe"),e("(不启动 PowerShell)正常执行,注入 "),l("code",null,"LAOSHI_*"),e(" 环境变量,日志完整写入 "),l("code",null,".pipeline/extensions/<id>.log")]),l("td")])])]),l("blockquote",null,[l("p",null,[l("strong",null,"当前已知未接入 dsh 项说明"),e(":dsh 的"),l("strong",null,"事件流替代轮询"),e("与**浏览器能力检测("),l("code",null,"capabilities"),e(")**目前仍按降级路径运行,待在真实 dsh 环境中确认对应插件 API 后再单独补齐。")])]),l("hr"),l("h2",{id:"_3-dsh-自动化端到端脚本-可选",tabindex:"-1"},[e("3. dsh 自动化端到端脚本(可选) "),l("a",{class:"header-anchor",href:"#_3-dsh-自动化端到端脚本-可选","aria-label":'Permalink to "3. dsh 自动化端到端脚本(可选)"'},"​")]),l("p",null,[e("如果内网机器已安装 "),l("code",null,"@deepseek-ai/dsh"),e(",可先用模拟模型跑通底层链路:")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"LAOSHI_E2E_DSH"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"=<"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"装有"),l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," @deepseek-ai/dsh"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," 的目"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"录"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," node"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/dsh/e2e/run-e2e.mjs"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --worktree")])])])]),l("p",null,"检查全部通过后再结合上表走查真实模型与插件 Web 界面效果。"),l("hr"),l("h2",{id:"_4-问题排查与反馈",tabindex:"-1"},[e("4. 问题排查与反馈 "),l("a",{class:"header-anchor",href:"#_4-问题排查与反馈","aria-label":'Permalink to "4. 问题排查与反馈"'},"​")]),l("p",null,[e("若走查中任一项未通过或流水线中断,请运行以下命令打包现场信息(日志与配置会自动脱敏),连同"),l("strong",null,[e("走查表结果、页面截图、"),l("code",null,"laoshi doctor"),e(" 输出")]),e("一并发给维护者:")]),l("div",{class:"language-sh vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"sh"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," diagnose"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}}," <"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"需求名"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"称"),l("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --out"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," ./diagnose-output")])])])])],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/真实环境走查.md"},"docs/guide/真实环境走查.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/真实环境走查.md"},"在 GitHub 上编辑")],-1)])])}const g=i(d,[["render",t]]);export{p as __pageData,g as default};
@@ -0,0 +1 @@
1
+ import{_ as t,o as d,c as u,j as l,a as e}from"./chunks/framework.BetZR81g.js";const k=JSON.parse('{"title":"给程序用的 JSON 输出:req api","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"reference/contracts/cli-json.md","filePath":"reference/contracts/cli-json.md","lastUpdated":null}'),o={name:"reference/contracts/cli-json.md"};function s(i,n,a,r,c,p){return d(),u("div",null,[...n[0]||(n[0]=[l("div",null,[l("h1",{id:"给程序用的-json-输出-req-api",tabindex:"-1"},[e("给程序用的 JSON 输出:"),l("code",null,"req api"),e(),l("a",{class:"header-anchor",href:"#给程序用的-json-输出-req-api","aria-label":'Permalink to "给程序用的 JSON 输出:`req api`"'},"​")]),l("p",null,[e("1.9.0 起。平台插件(如 Paseo 插件)和其他程序通过 "),l("code",null,"req api"),e(" 读取需求、执行管理操作,不直接读写状态文件。每个命令输出一行 JSON:")]),l("div",{class:"language-json vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"json"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"schema"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},"1"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"kitVersion"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"1.9.0"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"data"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#B31D28","--shiki-light-font-style":"italic","--shiki-dark":"#FDAEB7","--shiki-dark-font-style":"italic"}},"…"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }")])])])]),l("p",null,"出错时退出码为 1:"),l("div",{class:"language-json vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"json"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"schema"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},"1"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"kitVersion"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"1.9.0"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"error"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"code"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"not_found"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"message"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"没有找到需求……"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } }")])])])]),l("p",null,[l("code",null,"code"),e(":"),l("code",null,"bad_arguments"),e("(参数不对)、"),l("code",null,"not_found"),e("(目录或需求不存在)、"),l("code",null,"not_allowed"),e("(不允许的文件或命令)、"),l("code",null,"failed"),e("(其他错误)。")]),l("p",null,[l("code",null,"schema"),e(" 只在不兼容的修改时增加;新增字段不改变 "),l("code",null,"schema"),e(",读取方应忽略不认识的字段。")]),l("h2",{id:"命令",tabindex:"-1"},[e("命令 "),l("a",{class:"header-anchor",href:"#命令","aria-label":'Permalink to "命令"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"命令"),l("th",null,[l("code",null,"data")])])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"req api version")]),l("td",null,[l("code",null,"{ kitVersion, kitRoot, apiSchema, paseo, featuresDir }"),e(":"),l("code",null,"paseo"),e(" 是这个版本支持的 Paseo 范围(字段名沿用 1.x,只对 Paseo 有意义,其他平台为 null 或忽略)")])]),l("tr",null,[l("td",null,[l("code",null,"req api list [--repo <目录>]")]),l("td",null,'这个仓库所有工作区中的需求,数组,每项见下面的"需求"')]),l("tr",null,[l("td",null,[l("code",null,"req api list --all")]),l("td",null,[e("本机记录过的所有需求("),l("a",{href:"./usage-record"},"需求索引"),e("),同上;目录已不在的 "),l("code",null,"present: false"),e("。1.14 起还包括:用 "),l("code",null,"--track"),e(" 登记、还在对齐中的需求("),l("code",null,"stage"),e(' 为"对齐中",没有 '),l("code",null,"spec.md"),e(" 时 "),l("code",null,"title"),e(" 取自 "),l("code",null,"alignment.md"),e("),以及索引里出现过的项目中没登记的需求")])]),l("tr",null,[l("td",null,[l("code",null,"req api status <需求> [--repo <目录>]")]),l("td",null,'一个需求的详情,见下面的"详情"')]),l("tr",null,[l("td",null,[l("code",null,"req api history <需求> [--repo <目录>]")]),l("td",null,[e("需求的变更历史与负责人:"),l("code",null,"{ specVersion, changes: [{ title, body }], commits: [{ commit, date, author, subject, diff, truncated }], owner: { owner, history } }")])]),l("tr",null,[l("td",null,[l("code",null,"req api file <需求> <文件> [--repo <目录>]")]),l("td",null,[l("code",null,"{ featureDir, file, size, truncated, content }"),e(";只能读取功能目录中的文档(见下),最多 512 KB")])]),l("tr",null,[l("td",null,[l("code",null,"req api stats [--since 30d] [--month 2026-10]")]),l("td",null,[l("code",null,"req stats --json"),e(" 的内容,见 "),l("a",{href:"./usage-record"},"使用记录")])]),l("tr",null,[l("td",null,[l("code",null,"req api index [--rebuild <目录>…] [--prune]")]),l("td",null,[e("不带选项:索引的全部条目;"),l("code",null,"--rebuild"),e(":"),l("code",null,"{ scanned, registered, pruned, total }")])]),l("tr",null,[l("td",null,[l("code",null,"req api run <approve|stop|resume|verify|sync|reply|start|try|handover> <需求> [--repo <目录>] [选项]")]),l("td",null,[l("code",null,"{ command, featureDir, ok, exitCode, message }"),e("。在 "),l("code",null,"--repo"),e("(默认当前目录)中执行与 "),l("code",null,"req <命令> <需求>"),e(" 完全相同的操作;"),l("code",null,"ok"),e(" 为 false 时退出码为 1。"),l("code",null,"start"),e("(1.14):在项目主目录中自动加 "),l("code",null,"--worktree"),e("(上次已建好工作区的接着用),并把进展发回登记时的对话;"),l("code",null,"reply --change <需求> <改动内容>"),e(":从看板/插件发起改需求通知对话先停下再对齐变化;"),l("code",null,"handover <需求> <接手人> [--note <说明>]"),e(":转交负责人到 "),l("code",null,".pipeline/owner.json")])]),l("tr",null,[l("td",null,[l("code",null,"req api models")]),l("td",null,[e("1.12 起。"),l("code",null,"{ current, choices, recommended }"),e(":本机配置中现在的 "),l("code",null,"agents"),e(";daemon 上能无人值守运行的选择("),l("code",null,"{ id, label, provider, profile }"),e(",Paseo profile 在前);按推荐的 "),l("code",null,"agents"),e("。连不上 daemon 时报错")])]),l("tr",null,[l("td",null,[l("code",null,"req api config [--repo <目录>] [--machine]")]),l("td",null,[e("1.12 起。"),l("code",null,"{ sources, ignored, error, repo, groups }"),e(":"),l("code",null,"sources"),e(" 是生效的配置文件("),l("code",null,"layer"),e(" 为 "),l("code",null,"machine"),e(" / "),l("code",null,"team"),e(" / "),l("code",null,"project"),e(",按叠加顺序);"),l("code",null,"groups"),e(" 按主题分组,每项 "),l("code",null,"{ key, label, description, display, value, setBy, scope, changed }"),e(":"),l("code",null,"display"),e(" 是用大白话写的值,"),l("code",null,"value"),e(" 中看起来像密钥的值和个人账号替换为 "),l("code",null,"••••"),e(","),l("code",null,"setBy"),e(" 是写了它的文件,"),l("code",null,"changed"),e(" 表示与默认值不同。配置有错误时 "),l("code",null,"error"),e(" 写明原因,值按各文件所写。"),l("code",null,"--machine"),e(" 不看项目配置")])]),l("tr",null,[l("td",null,[l("code",null,"req api set-agents --json <设置>")]),l("td",null,[e("1.12 起。"),l("code",null,"{ ok, message }"),e("。"),l("code",null,"<设置>"),e(" 是 "),l("code",null,"{ builder, reviewer, fallback }"),e("("),l("code",null,"fallback"),e(" 可以为 null),检查后写入本机配置的 "),l("code",null,"agents"),e(",原文件备份")])]),l("tr",null,[l("td",null,[l("code",null,"req api watchdog [--by plugin|factory] [--dry-run]")]),l("td",null,[e("1.13 起。"),l("code",null,"{ checked, resumed, failed, skipped }"),e(':把本机"运行中但后台进程已不在"的需求直接继续('),l("code",null,"req resume"),e(")。每个进程只继续一次,每个需求 24 小时内最多 3 次;"),l("code",null,"--by plugin"),e(" 同时记下插件在检查(流水线据此不再预约对话的定时检查)")])]),l("tr",null,[l("td",null,[l("code",null,"req api review-url <需求> [--repo <目录>] [--read-only] [--page check]")]),l("td",null,[e("1.13 起;"),l("code",null,"--page check"),e("(1.14)给出同一服务上的验收清单页地址(需要 "),l("code",null,"spec.md"),e("),"),l("code",null,"--page code"),e("(1.14)给出代码审查页地址(需要已经写过代码)。"),l("code",null,"{ url, readOnly }"),e(":这个需求的原型审查页地址(需要时在后台启动审查页的服务)。"),l("code",null,"--read-only"),e(" 的地址只能看,不能提交意见或确认方案。需求不在本机的需求索引中或还没有 "),l("code",null,"prototype/"),e(" 时报 "),l("code",null,"not_found")])])])]),l("p",null,[l("code",null,"<需求>"),e(" 的写法与 "),l("code",null,"req status"),e(" 相同:功能目录、目录名或名称中能唯一确定的一部分。需求在为它新建的工作区中开发时,"),l("code",null,"--repo"),e(" 写对话所在的目录或那个工作区都可以。")]),l("p",null,[l("code",null,"req api file"),e(" 能读取的文件:"),l("code",null,"spec.md"),e("、"),l("code",null,"alignment.md"),e("、"),l("code",null,"spec-review.md"),e("、"),l("code",null,"changes.md"),e("、"),l("code",null,"decisions.tsv"),e("、"),l("code",null,"design.md"),e("、"),l("code",null,"design-review.md"),e("、"),l("code",null,"preview.md"),e("、"),l("code",null,"contract.md"),e("、"),l("code",null,"diagnosis.md"),e("、"),l("code",null,"assessment.md"),e("、"),l("code",null,"implementation.md"),e("、"),l("code",null,"progress.md"),e("、"),l("code",null,"code-review.md"),e("、"),l("code",null,"handoff.md"),e("、"),l("code",null,"service-start.md"),e("、"),l("code",null,"verification.md"),e("、"),l("code",null,"report.md"),e("、"),l("code",null,"acceptance.md"),e("、"),l("code",null,"lessons.tsv"),e("。")]),l("h2",{id:"需求-list-的每一项",tabindex:"-1"},[e("需求("),l("code",null,"list"),e(" 的每一项) "),l("a",{class:"header-anchor",href:"#需求-list-的每一项","aria-label":'Permalink to "需求(`list` 的每一项)"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"含义")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"key")]),l("td",null,"需求在本机的标识(对话所在目录 + 功能目录)")]),l("tr",null,[l("td",null,[l("code",null,"project")]),l("td",null,"项目名:对话所在目录的目录名")]),l("tr",null,[l("td",null,[l("code",null,"codebase")]),l("td",null,[e("laoshi M2c 起。需求所属的代码库:"),l("code",null,"{ root, remote }"),e(","),l("code",null,"root"),e(" 是主检出目录(需求自己的 worktree 归属它的原仓库),"),l("code",null,"remote"),e(" 是 origin 的地址(去掉凭据),没有时为 null(ADR 0007)")])]),l("tr",null,[l("td",null,[l("code",null,"startedBy")]),l("td",null,[e("laoshi 起。发起人:状态文件的 "),l("code",null,"startedBy"),e(";还没运行过、或状态文件是更早的版本时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"owner")]),l("td",null,[e("转交接手后的当前负责人("),l("code",null,".pipeline/owner.json"),e(" 中的 "),l("code",null,"owner"),e(");未转交过时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"repo")]),l("td",null,"需求所在的目录(有自己的工作区时是那个工作区)")]),l("tr",null,[l("td",null,[l("code",null,"sourceRepo"),e(" / "),l("code",null,"workspaceId")]),l("td",null,"有自己的工作区时:对话所在的目录、平台对这个工作区的引用(Paseo 上是工作区 ID);否则 null")]),l("tr",null,[l("td",null,[l("code",null,"featureDir"),e(" / "),l("code",null,"name"),e(" / "),l("code",null,"title")]),l("td",null,"功能目录、目录名、需求标题")]),l("tr",null,[l("td",null,[l("code",null,"type"),e(" / "),l("code",null,"profile"),e(" / "),l("code",null,"branch")]),l("td",null,[e("需求类型("),l("code",null,"defect"),e("、"),l("code",null,"refactor"),e("、"),l("code",null,"assessment"),e(" 或 null)、档位、分支")])]),l("tr",null,[l("td",null,[l("code",null,"stage")]),l("td",null,[e("与 "),l("code",null,"req list"),e(' 相同的阶段说明,如"开发中""等待确认方案""待验收"')])]),l("tr",null,[l("td",null,[l("code",null,"status")]),l("td",null,[e("状态文件的 "),l("code",null,"status"),e(";还没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"running")]),l("td",null,"后台进程是否在运行")]),l("tr",null,[l("td",null,[l("code",null,"phase")]),l("td",null,[l("code",null,"develop"),e(" / "),l("code",null,"verify")])]),l("tr",null,[l("td",null,[l("code",null,"attention")]),l("td",null,[e("需要人处理的事:"),l("code",null,"approval"),e("(确认方案)、"),l("code",null,"business"),e("(需求方决定)、"),l("code",null,"permission"),e("(1.13,步骤在等权限批准;"),l("code",null,"waiting.questions"),e(" 是要批准的操作,"),l("code",null,"waiting.agentId"),e(" 是那个 agent)、"),l("code",null,"interrupted"),e("(中断,可以继续)、"),l("code",null,"not_completed"),e("(结束但未完成)、"),l("code",null,"not_started"),e("(1.14,需求说明已确认超过 30 分钟、或已为它建好工作区,但流水线没有运行过);没有为 null")])]),l("tr",null,[l("td",null,[l("code",null,"waiting")]),l("td",null,[e("1.12 起。"),l("code",null,"attention"),e(" 不为 null 时:"),l("code",null,"since"),e("(从什么时候开始等)、"),l("code",null,"questions"),e("(需求方要回答的问题)、"),l("code",null,"reason"),e("(停止原因)、"),l("code",null,"card"),e("("),l("code",null,"{ system, id, url, requester }"),e(",从卡片开始的需求)、"),l("code",null,"canReply"),e("(能否用 "),l("code",null,"req api run reply <需求> <回复>"),e(" 把回复转给需求的对话)、"),l("code",null,"canStart"),e("(1.14,"),l("code",null,"not_started"),e(" 时为 true:可以用 "),l("code",null,"req api run start <需求>"),e(" 开始开发);否则为 null")])]),l("tr",null,[l("td",null,[l("code",null,"current")]),l("td",null,[e("正在运行的步骤 "),l("code",null,"[{ key, title, agentId }]")])]),l("tr",null,[l("td",null,[l("code",null,"updatedAt")]),l("td",null,"最近一次变化的时间")]),l("tr",null,[l("td",null,[l("code",null,"usage")]),l("td",null,[l("code",null,"{ steps, agentMinutes, inputTokens, outputTokens, costUsd }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"present")]),l("td",null,"目录是否还在")]),l("tr",null,[l("td",null,[l("code",null,"hasPrototype")]),l("td",null,[e("1.13 起。功能目录中有界面原型("),l("code",null,"prototype/"),e("),可以用原型审查页查看")])])])]),l("h2",{id:"详情-status",tabindex:"-1"},[e("详情("),l("code",null,"status"),e(") "),l("a",{class:"header-anchor",href:"#详情-status","aria-label":'Permalink to "详情(`status`)"'},"​")]),l("p",null,'"需求"的全部字段,另加:'),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"含义")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"files")]),l("td",null,[e("功能目录中存在的、可以用 "),l("code",null,"req api file"),e(" 读取的文件")])]),l("tr",null,[l("td",null,[l("code",null,"run")]),l("td",null,[l("code",null,"{ attempt, startedAt, updatedAt, pid, phaseMode, stopReason, outcome, queuedSince, verifyAt, approval, originAgentId }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"steps")]),l("td",null,[e("每个步骤一项:"),l("code",null,"{ key, stepId, title, phase, attempt, round, agentId, startedAt, endedAt, minutes, outcome, result, error, usage }"),e(";"),l("code",null,"title"),e(' 是给人看的名称(如"代码评审(第 2 轮)"),'),l("code",null,"result"),e(' 是结论的文字(如"需要修改")')])]),l("tr",null,[l("td",null,[l("code",null,"gate")]),l("td",null,[e("质量门:状态文件中的 "),l("code",null,"gate")])]),l("tr",null,[l("td",null,[l("code",null,"estimate")]),l("td",null,[e("1.13 起。"),l("code",null,"{ basis, profile, typicalAgentMinutes, typicalTokens, usedAgentMinutes, usedTokens, leftMinutes, over }"),e(":按本机已完成的同档位需求(至少 3 个)的中位数估算;数据不够或已完成时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"joint")]),l("td",null,[e("联合需求的其他仓库:"),l("code",null,"[{ name, slug, repo, sourceRepo, branch, workspaceId, gate }]")])]),l("tr",null,[l("td",null,[l("code",null,"external")]),l("td",null,[e("外部系统中的卡片(1.9.0 起):"),l("code",null,"[{ name, id, url, status, syncedAt, pending, lastError }]"),e(";"),l("code",null,"pending"),e(" 是等待补发的调用数")])])])])],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/contracts/cli-json.md"},"contracts/cli-json.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/contracts/cli-json.md"},"在 GitHub 上编辑")],-1)])])}const g=t(o,[["render",s]]);export{k as __pageData,g as default};
@@ -0,0 +1 @@
1
+ import{_ as t,o as d,c as u,j as l,a as e}from"./chunks/framework.BetZR81g.js";const k=JSON.parse('{"title":"给程序用的 JSON 输出:req api","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"reference/contracts/cli-json.md","filePath":"reference/contracts/cli-json.md","lastUpdated":null}'),o={name:"reference/contracts/cli-json.md"};function s(i,n,a,r,c,p){return d(),u("div",null,[...n[0]||(n[0]=[l("div",null,[l("h1",{id:"给程序用的-json-输出-req-api",tabindex:"-1"},[e("给程序用的 JSON 输出:"),l("code",null,"req api"),e(),l("a",{class:"header-anchor",href:"#给程序用的-json-输出-req-api","aria-label":'Permalink to "给程序用的 JSON 输出:`req api`"'},"​")]),l("p",null,[e("1.9.0 起。平台插件(如 Paseo 插件)和其他程序通过 "),l("code",null,"req api"),e(" 读取需求、执行管理操作,不直接读写状态文件。每个命令输出一行 JSON:")]),l("div",{class:"language-json vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"json"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"schema"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},"1"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"kitVersion"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"1.9.0"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"data"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#B31D28","--shiki-light-font-style":"italic","--shiki-dark":"#FDAEB7","--shiki-dark-font-style":"italic"}},"…"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }")])])])]),l("p",null,"出错时退出码为 1:"),l("div",{class:"language-json vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"json"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"schema"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},"1"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"kitVersion"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"1.9.0"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"error"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"code"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"not_found"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"message"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"没有找到需求……"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } }")])])])]),l("p",null,[l("code",null,"code"),e(":"),l("code",null,"bad_arguments"),e("(参数不对)、"),l("code",null,"not_found"),e("(目录或需求不存在)、"),l("code",null,"not_allowed"),e("(不允许的文件或命令)、"),l("code",null,"failed"),e("(其他错误)。")]),l("p",null,[l("code",null,"schema"),e(" 只在不兼容的修改时增加;新增字段不改变 "),l("code",null,"schema"),e(",读取方应忽略不认识的字段。")]),l("h2",{id:"命令",tabindex:"-1"},[e("命令 "),l("a",{class:"header-anchor",href:"#命令","aria-label":'Permalink to "命令"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"命令"),l("th",null,[l("code",null,"data")])])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"req api version")]),l("td",null,[l("code",null,"{ kitVersion, kitRoot, apiSchema, paseo, featuresDir }"),e(":"),l("code",null,"paseo"),e(" 是这个版本支持的 Paseo 范围(字段名沿用 1.x,只对 Paseo 有意义,其他平台为 null 或忽略)")])]),l("tr",null,[l("td",null,[l("code",null,"req api list [--repo <目录>]")]),l("td",null,'这个仓库所有工作区中的需求,数组,每项见下面的"需求"')]),l("tr",null,[l("td",null,[l("code",null,"req api list --all")]),l("td",null,[e("本机记录过的所有需求("),l("a",{href:"./usage-record"},"需求索引"),e("),同上;目录已不在的 "),l("code",null,"present: false"),e("。1.14 起还包括:用 "),l("code",null,"--track"),e(" 登记、还在对齐中的需求("),l("code",null,"stage"),e(' 为"对齐中",没有 '),l("code",null,"spec.md"),e(" 时 "),l("code",null,"title"),e(" 取自 "),l("code",null,"alignment.md"),e("),以及索引里出现过的项目中没登记的需求")])]),l("tr",null,[l("td",null,[l("code",null,"req api status <需求> [--repo <目录>]")]),l("td",null,'一个需求的详情,见下面的"详情"')]),l("tr",null,[l("td",null,[l("code",null,"req api history <需求> [--repo <目录>]")]),l("td",null,[e("需求的变更历史与负责人:"),l("code",null,"{ specVersion, changes: [{ title, body }], commits: [{ commit, date, author, subject, diff, truncated }], owner: { owner, history } }")])]),l("tr",null,[l("td",null,[l("code",null,"req api file <需求> <文件> [--repo <目录>]")]),l("td",null,[l("code",null,"{ featureDir, file, size, truncated, content }"),e(";只能读取功能目录中的文档(见下),最多 512 KB")])]),l("tr",null,[l("td",null,[l("code",null,"req api stats [--since 30d] [--month 2026-10]")]),l("td",null,[l("code",null,"req stats --json"),e(" 的内容,见 "),l("a",{href:"./usage-record"},"使用记录")])]),l("tr",null,[l("td",null,[l("code",null,"req api index [--rebuild <目录>…] [--prune]")]),l("td",null,[e("不带选项:索引的全部条目;"),l("code",null,"--rebuild"),e(":"),l("code",null,"{ scanned, registered, pruned, total }")])]),l("tr",null,[l("td",null,[l("code",null,"req api run <approve|stop|resume|verify|sync|reply|start|try|handover> <需求> [--repo <目录>] [选项]")]),l("td",null,[l("code",null,"{ command, featureDir, ok, exitCode, message }"),e("。在 "),l("code",null,"--repo"),e("(默认当前目录)中执行与 "),l("code",null,"req <命令> <需求>"),e(" 完全相同的操作;"),l("code",null,"ok"),e(" 为 false 时退出码为 1。"),l("code",null,"start"),e("(1.14):在项目主目录中自动加 "),l("code",null,"--worktree"),e("(上次已建好工作区的接着用),并把进展发回登记时的对话;"),l("code",null,"reply --change <需求> <改动内容>"),e(":从看板/插件发起改需求通知对话先停下再对齐变化;"),l("code",null,"handover <需求> <接手人> [--note <说明>]"),e(":转交负责人到 "),l("code",null,".pipeline/owner.json")])]),l("tr",null,[l("td",null,[l("code",null,"req api models")]),l("td",null,[e("1.12 起。"),l("code",null,"{ current, choices, recommended }"),e(":本机配置中现在的 "),l("code",null,"agents"),e(";daemon 上能无人值守运行的选择("),l("code",null,"{ id, label, provider, profile }"),e(",Paseo profile 在前);按推荐的 "),l("code",null,"agents"),e("。连不上 daemon 时报错")])]),l("tr",null,[l("td",null,[l("code",null,"req api config [--repo <目录>] [--machine]")]),l("td",null,[e("1.12 起。"),l("code",null,"{ sources, ignored, error, repo, groups }"),e(":"),l("code",null,"sources"),e(" 是生效的配置文件("),l("code",null,"layer"),e(" 为 "),l("code",null,"machine"),e(" / "),l("code",null,"team"),e(" / "),l("code",null,"project"),e(",按叠加顺序);"),l("code",null,"groups"),e(" 按主题分组,每项 "),l("code",null,"{ key, label, description, display, value, setBy, scope, changed }"),e(":"),l("code",null,"display"),e(" 是用大白话写的值,"),l("code",null,"value"),e(" 中看起来像密钥的值和个人账号替换为 "),l("code",null,"••••"),e(","),l("code",null,"setBy"),e(" 是写了它的文件,"),l("code",null,"changed"),e(" 表示与默认值不同。配置有错误时 "),l("code",null,"error"),e(" 写明原因,值按各文件所写。"),l("code",null,"--machine"),e(" 不看项目配置")])]),l("tr",null,[l("td",null,[l("code",null,"req api set-agents --json <设置>")]),l("td",null,[e("1.12 起。"),l("code",null,"{ ok, message }"),e("。"),l("code",null,"<设置>"),e(" 是 "),l("code",null,"{ builder, reviewer, fallback }"),e("("),l("code",null,"fallback"),e(" 可以为 null),检查后写入本机配置的 "),l("code",null,"agents"),e(",原文件备份")])]),l("tr",null,[l("td",null,[l("code",null,"req api watchdog [--by plugin|factory] [--dry-run]")]),l("td",null,[e("1.13 起。"),l("code",null,"{ checked, resumed, failed, skipped }"),e(':把本机"运行中但后台进程已不在"的需求直接继续('),l("code",null,"req resume"),e(")。每个进程只继续一次,每个需求 24 小时内最多 3 次;"),l("code",null,"--by plugin"),e(" 同时记下插件在检查(流水线据此不再预约对话的定时检查)")])]),l("tr",null,[l("td",null,[l("code",null,"req api review-url <需求> [--repo <目录>] [--read-only] [--page check]")]),l("td",null,[e("1.13 起;"),l("code",null,"--page check"),e("(1.14)给出同一服务上的验收清单页地址(需要 "),l("code",null,"spec.md"),e("),"),l("code",null,"--page code"),e("(1.14)给出代码审查页地址(需要已经写过代码)。"),l("code",null,"{ url, readOnly }"),e(":这个需求的原型审查页地址(需要时在后台启动审查页的服务)。"),l("code",null,"--read-only"),e(" 的地址只能看,不能提交意见或确认方案。需求不在本机的需求索引中或还没有 "),l("code",null,"prototype/"),e(" 时报 "),l("code",null,"not_found")])])])]),l("p",null,[l("code",null,"<需求>"),e(" 的写法与 "),l("code",null,"req status"),e(" 相同:功能目录、目录名或名称中能唯一确定的一部分。需求在为它新建的工作区中开发时,"),l("code",null,"--repo"),e(" 写对话所在的目录或那个工作区都可以。")]),l("p",null,[l("code",null,"req api file"),e(" 能读取的文件:"),l("code",null,"spec.md"),e("、"),l("code",null,"alignment.md"),e("、"),l("code",null,"spec-review.md"),e("、"),l("code",null,"changes.md"),e("、"),l("code",null,"decisions.tsv"),e("、"),l("code",null,"design.md"),e("、"),l("code",null,"design-review.md"),e("、"),l("code",null,"preview.md"),e("、"),l("code",null,"contract.md"),e("、"),l("code",null,"diagnosis.md"),e("、"),l("code",null,"assessment.md"),e("、"),l("code",null,"implementation.md"),e("、"),l("code",null,"progress.md"),e("、"),l("code",null,"code-review.md"),e("、"),l("code",null,"handoff.md"),e("、"),l("code",null,"service-start.md"),e("、"),l("code",null,"verification.md"),e("、"),l("code",null,"report.md"),e("、"),l("code",null,"acceptance.md"),e("、"),l("code",null,"lessons.tsv"),e("。")]),l("h2",{id:"需求-list-的每一项",tabindex:"-1"},[e("需求("),l("code",null,"list"),e(" 的每一项) "),l("a",{class:"header-anchor",href:"#需求-list-的每一项","aria-label":'Permalink to "需求(`list` 的每一项)"'},"​")]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"含义")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"key")]),l("td",null,"需求在本机的标识(对话所在目录 + 功能目录)")]),l("tr",null,[l("td",null,[l("code",null,"project")]),l("td",null,"项目名:对话所在目录的目录名")]),l("tr",null,[l("td",null,[l("code",null,"codebase")]),l("td",null,[e("laoshi M2c 起。需求所属的代码库:"),l("code",null,"{ root, remote }"),e(","),l("code",null,"root"),e(" 是主检出目录(需求自己的 worktree 归属它的原仓库),"),l("code",null,"remote"),e(" 是 origin 的地址(去掉凭据),没有时为 null(ADR 0007)")])]),l("tr",null,[l("td",null,[l("code",null,"startedBy")]),l("td",null,[e("laoshi 起。发起人:状态文件的 "),l("code",null,"startedBy"),e(";还没运行过、或状态文件是更早的版本时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"owner")]),l("td",null,[e("转交接手后的当前负责人("),l("code",null,".pipeline/owner.json"),e(" 中的 "),l("code",null,"owner"),e(");未转交过时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"repo")]),l("td",null,"需求所在的目录(有自己的工作区时是那个工作区)")]),l("tr",null,[l("td",null,[l("code",null,"sourceRepo"),e(" / "),l("code",null,"workspaceId")]),l("td",null,"有自己的工作区时:对话所在的目录、平台对这个工作区的引用(Paseo 上是工作区 ID);否则 null")]),l("tr",null,[l("td",null,[l("code",null,"featureDir"),e(" / "),l("code",null,"name"),e(" / "),l("code",null,"title")]),l("td",null,"功能目录、目录名、需求标题")]),l("tr",null,[l("td",null,[l("code",null,"type"),e(" / "),l("code",null,"profile"),e(" / "),l("code",null,"branch")]),l("td",null,[e("需求类型("),l("code",null,"defect"),e("、"),l("code",null,"refactor"),e("、"),l("code",null,"assessment"),e(" 或 null)、档位、分支")])]),l("tr",null,[l("td",null,[l("code",null,"stage")]),l("td",null,[e("与 "),l("code",null,"req list"),e(' 相同的阶段说明,如"开发中""等待确认方案""待验收"')])]),l("tr",null,[l("td",null,[l("code",null,"status")]),l("td",null,[e("状态文件的 "),l("code",null,"status"),e(";还没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"running")]),l("td",null,"后台进程是否在运行")]),l("tr",null,[l("td",null,[l("code",null,"phase")]),l("td",null,[l("code",null,"develop"),e(" / "),l("code",null,"verify")])]),l("tr",null,[l("td",null,[l("code",null,"attention")]),l("td",null,[e("需要人处理的事:"),l("code",null,"approval"),e("(确认方案)、"),l("code",null,"business"),e("(需求方决定)、"),l("code",null,"permission"),e("(1.13,步骤在等权限批准;"),l("code",null,"waiting.questions"),e(" 是要批准的操作,"),l("code",null,"waiting.agentId"),e(" 是那个 agent)、"),l("code",null,"interrupted"),e("(中断,可以继续)、"),l("code",null,"not_completed"),e("(结束但未完成)、"),l("code",null,"not_started"),e("(1.14,需求说明已确认超过 30 分钟、或已为它建好工作区,但流水线没有运行过);没有为 null")])]),l("tr",null,[l("td",null,[l("code",null,"waiting")]),l("td",null,[e("1.12 起。"),l("code",null,"attention"),e(" 不为 null 时:"),l("code",null,"since"),e("(从什么时候开始等)、"),l("code",null,"questions"),e("(需求方要回答的问题)、"),l("code",null,"reason"),e("(停止原因)、"),l("code",null,"card"),e("("),l("code",null,"{ system, id, url, requester }"),e(",从卡片开始的需求)、"),l("code",null,"canReply"),e("(能否用 "),l("code",null,"req api run reply <需求> <回复>"),e(" 把回复转给需求的对话)、"),l("code",null,"canStart"),e("(1.14,"),l("code",null,"not_started"),e(" 时为 true:可以用 "),l("code",null,"req api run start <需求>"),e(" 开始开发);否则为 null")])]),l("tr",null,[l("td",null,[l("code",null,"current")]),l("td",null,[e("正在运行的步骤 "),l("code",null,"[{ key, title, agentId }]")])]),l("tr",null,[l("td",null,[l("code",null,"updatedAt")]),l("td",null,"最近一次变化的时间")]),l("tr",null,[l("td",null,[l("code",null,"usage")]),l("td",null,[l("code",null,"{ steps, agentMinutes, inputTokens, outputTokens, costUsd }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"present")]),l("td",null,"目录是否还在")]),l("tr",null,[l("td",null,[l("code",null,"hasPrototype")]),l("td",null,[e("1.13 起。功能目录中有界面原型("),l("code",null,"prototype/"),e("),可以用原型审查页查看")])])])]),l("h2",{id:"详情-status",tabindex:"-1"},[e("详情("),l("code",null,"status"),e(") "),l("a",{class:"header-anchor",href:"#详情-status","aria-label":'Permalink to "详情(`status`)"'},"​")]),l("p",null,'"需求"的全部字段,另加:'),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"含义")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"files")]),l("td",null,[e("功能目录中存在的、可以用 "),l("code",null,"req api file"),e(" 读取的文件")])]),l("tr",null,[l("td",null,[l("code",null,"run")]),l("td",null,[l("code",null,"{ attempt, startedAt, updatedAt, pid, phaseMode, stopReason, outcome, queuedSince, verifyAt, approval, originAgentId }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"steps")]),l("td",null,[e("每个步骤一项:"),l("code",null,"{ key, stepId, title, phase, attempt, round, agentId, startedAt, endedAt, minutes, outcome, result, error, usage }"),e(";"),l("code",null,"title"),e(' 是给人看的名称(如"代码评审(第 2 轮)"),'),l("code",null,"result"),e(' 是结论的文字(如"需要修改")')])]),l("tr",null,[l("td",null,[l("code",null,"gate")]),l("td",null,[e("质量门:状态文件中的 "),l("code",null,"gate")])]),l("tr",null,[l("td",null,[l("code",null,"estimate")]),l("td",null,[e("1.13 起。"),l("code",null,"{ basis, profile, typicalAgentMinutes, typicalTokens, usedAgentMinutes, usedTokens, leftMinutes, over }"),e(":按本机已完成的同档位需求(至少 3 个)的中位数估算;数据不够或已完成时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"joint")]),l("td",null,[e("联合需求的其他仓库:"),l("code",null,"[{ name, slug, repo, sourceRepo, branch, workspaceId, gate }]")])]),l("tr",null,[l("td",null,[l("code",null,"external")]),l("td",null,[e("外部系统中的卡片(1.9.0 起):"),l("code",null,"[{ name, id, url, status, syncedAt, pending, lastError }]"),e(";"),l("code",null,"pending"),e(" 是等待补发的调用数")])])])])],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/contracts/cli-json.md"},"contracts/cli-json.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/contracts/cli-json.md"},"在 GitHub 上编辑")],-1)])])}const g=t(o,[["render",s]]);export{k as __pageData,g as default};
@@ -1,7 +1,7 @@
1
- import{_ as i,o as n,c as a,j as l,a as e}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"laoshi 内置能力:worktree、服务、本机调度","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"reference/design/builtin-capabilities.md","filePath":"reference/design/builtin-capabilities.md","lastUpdated":null}'),o={name:"reference/design/builtin-capabilities.md"};function t(d,s,r,u,c,h){return n(),a("div",null,[...s[0]||(s[0]=[l("div",null,[l("h1",{id:"laoshi-内置能力-worktree、服务、本机调度",tabindex:"-1"},[e("laoshi 内置能力:worktree、服务、本机调度 "),l("a",{class:"header-anchor",href:"#laoshi-内置能力-worktree、服务、本机调度","aria-label":'Permalink to "laoshi 内置能力:worktree、服务、本机调度"'},"​")]),l("ul",null,[l("li",null,[e("状态:worktree 与服务"),l("strong",null,"已实现"),e("(M2b,"),l("code",null,"engine/src/builtin/"),e(");本机调度"),l("strong",null,"已设计,未实现")]),l("li",null,[e("依据:"),l("a",{href:"./../adr/0008-capability-sources-and-platform-plugin"},"ADR 0008"),e(" 决定 3")]),l("li",null,[e("相关:"),l("a",{href:"./adapter-guide"},"adapter-guide §2"),e("、"),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/dsh-adapter.md",target:"_blank",rel:"noreferrer"},"dsh-adapter")])]),l("p",null,[e("这三项能力与平台无关。req-kit 里它们由 Paseo 提供;换到别的平台时,laoshi 自己实现一次,不让每个适配器各写一遍。适配器在能力声明里把来源写成 "),l("code",null,"builtin"),e(" 就会用上这些实现:运行时层("),l("code",null,"runtime-loader.ts"),e(")先用内置实现替换适配器运行时里对应的方法("),l("code",null,"withBuiltins"),e("),再统一降级仍然缺失的能力("),l("code",null,"withCapabilities"),e(")。Paseo 适配器继续使用 Paseo 自己的工作区、"),l("code",null,"paseo.json"),e(" 服务和定时任务;dsh 适配器的 worktree 和服务用内置实现。")]),l("h2",{id:"_1-代码库里的定义-laoshi-services-json",tabindex:"-1"},[e("1. 代码库里的定义:"),l("code",null,".laoshi/services.json"),e(),l("a",{class:"header-anchor",href:"#_1-代码库里的定义-laoshi-services-json","aria-label":'Permalink to "1. 代码库里的定义:`.laoshi/services.json`"'},"​")]),l("p",null,[e("按 "),l("a",{href:"./../adr/0007-one-install-many-repos"},"ADR 0007"),e(",代码库里只放专属配置。服务和新工作区的准备命令写在 "),l("code",null,".laoshi/services.json"),e(",要提交到仓库:")]),l("div",{class:"language-json vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"json"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{")]),e(`
1
+ import{_ as i,o as n,c as a,j as l,a as e}from"./chunks/framework.BetZR81g.js";const p=JSON.parse('{"title":"laoshi 内置能力:worktree、服务、本机调度","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"reference/design/builtin-capabilities.md","filePath":"reference/design/builtin-capabilities.md","lastUpdated":null}'),o={name:"reference/design/builtin-capabilities.md"};function t(d,s,r,u,c,h){return n(),a("div",null,[...s[0]||(s[0]=[l("div",null,[l("h1",{id:"laoshi-内置能力-worktree、服务、本机调度",tabindex:"-1"},[e("laoshi 内置能力:worktree、服务、本机调度 "),l("a",{class:"header-anchor",href:"#laoshi-内置能力-worktree、服务、本机调度","aria-label":'Permalink to "laoshi 内置能力:worktree、服务、本机调度"'},"​")]),l("ul",null,[l("li",null,[e("状态:worktree 与服务"),l("strong",null,"已实现"),e("(M2b,"),l("code",null,"engine/src/builtin/"),e(");本机调度"),l("strong",null,"不做"),e("(2026-11-21 决定:Paseo 与 dsh 均自带定时任务,命令行适配器已冻结,设计保留供参考)")]),l("li",null,[e("依据:"),l("a",{href:"./../adr/0008-capability-sources-and-platform-plugin"},"ADR 0008"),e(" 决定 3")]),l("li",null,[e("相关:"),l("a",{href:"./adapter-guide"},"adapter-guide §2"),e("、"),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/dsh-adapter.md",target:"_blank",rel:"noreferrer"},"dsh-adapter")])]),l("p",null,[e("这三项能力与平台无关。req-kit 里它们由 Paseo 提供;换到别的平台时,laoshi 自己实现一次,不让每个适配器各写一遍。适配器在能力声明里把来源写成 "),l("code",null,"builtin"),e(" 就会用上这些实现:运行时层("),l("code",null,"runtime-loader.ts"),e(")先用内置实现替换适配器运行时里对应的方法("),l("code",null,"withBuiltins"),e("),再统一降级仍然缺失的能力("),l("code",null,"withCapabilities"),e(")。Paseo 适配器继续使用 Paseo 自己的工作区、"),l("code",null,"paseo.json"),e(" 服务和定时任务;dsh 适配器的 worktree 和服务用内置实现。")]),l("h2",{id:"_1-代码库里的定义-laoshi-services-json",tabindex:"-1"},[e("1. 代码库里的定义:"),l("code",null,".laoshi/services.json"),e(),l("a",{class:"header-anchor",href:"#_1-代码库里的定义-laoshi-services-json","aria-label":'Permalink to "1. 代码库里的定义:`.laoshi/services.json`"'},"​")]),l("p",null,[e("按 "),l("a",{href:"./../adr/0007-one-install-many-repos"},"ADR 0007"),e(",代码库里只放专属配置。服务和新工作区的准备命令写在 "),l("code",null,".laoshi/services.json"),e(",要提交到仓库:")]),l("div",{class:"language-json vp-adaptive-theme"},[l("button",{title:"Copy Code",class:"copy"}),l("span",{class:"lang"},"json"),l("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[l("code",null,[l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{")]),e(`
2
2
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "setup"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": ["),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"npm ci"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"node scripts/copy-env.mjs"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"],")]),e(`
3
3
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "services"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": {")]),e(`
4
4
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "web"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"command"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"npm run dev -- --port {PORT}"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"health"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"/healthz"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," },")]),e(`
5
5
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "api"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"command"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"node server.js"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"port"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},"4100"),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }")]),e(`
6
6
  `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }")]),e(`
7
- `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"}")])])])]),l("ul",null,[l("li",null,[l("code",null,"setup"),e(":新建 worktree 后按顺序执行。一条失败就停下,后面的不再执行。可以只写一条字符串。")]),l("li",null,[l("code",null,"services.<名称>.command"),e(":启动服务的命令。")]),l("li",null,[l("code",null,"port"),e(":可选。不写时 laoshi 分配一个空闲端口,同一工作区以后沿用这个端口(只要它还空着),这样服务的地址不会变;写了就用固定端口,被占用时报错。")]),l("li",null,[l("code",null,"health"),e(":可选,以 "),l("code",null,"/"),e(" 开头的 HTTP 路径。写了就以 HTTP 回应码低于 500 为就绪;没写时,端口能连上就算就绪。")]),l("li",null,[e("端口的传法:命令里的 "),l("code",null,"{PORT}"),e(" 会被替换成端口号,同时设置环境变量 "),l("code",null,"PORT"),e(" 和 "),l("code",null,"LAOSHI_PORT"),e("。")]),l("li",null,[e("准备命令可以读到两个环境变量:"),l("code",null,"LAOSHI_SOURCE_CHECKOUT_PATH"),e("(对话所在的原仓库)和 "),l("code",null,"LAOSHI_WORKTREE_PATH"),e("(新工作区)。")])]),l("p",null,[l("strong",null,"shell"),e(":命令用系统默认的 shell 执行,Windows 上是 "),l("code",null,"cmd.exe"),e(",其他系统是 "),l("code",null,"/bin/sh"),e("。"),l("strong",null,"任何情况下都不启动 PowerShell"),e(",因为内网机器上它会被直接禁止运行。所以命令最好写成普通的程序调用,例如 "),l("code",null,"node scripts/x.mjs"),e(",在各个系统上都一样能用。"),l("code",null,"/laoshi-setup"),e(" 会为使用内置服务的平台写 "),l("code",null,".laoshi/services.json"),e(",需要复制本地配置时用 "),l("code",null,"skills/laoshi-setup/templates/copy-local-files.mjs"),e("(读 "),l("code",null,"LAOSHI_SOURCE_CHECKOUT_PATH"),e(");Paseo 的辅助脚本在 "),l("code",null,"adapters/paseo/skill/templates/"),e(",也认 "),l("code",null,"LAOSHI_PORT"),e(" 和 "),l("code",null,"LAOSHI_SOURCE_CHECKOUT_PATH"),e("。")]),l("p",null,[l("code",null,"laoshi doctor"),e(" 的项目一节会检查这个文件:格式、服务是否用了分配的端口、文件是否已提交(只在平台用内置能力时检查)。")]),l("h2",{id:"_2-worktree-已实现",tabindex:"-1"},[e("2. worktree(已实现) "),l("a",{class:"header-anchor",href:"#_2-worktree-已实现","aria-label":'Permalink to "2. worktree(已实现)"'},"​")]),l("ul",null,[l("li",null,[l("strong",null,"新建"),e("("),l("code",null,"createWorktree"),e("):运行 "),l("code",null,"git worktree add -b <分支> <目录> <起点>"),e(",目录在安装目录下:"),l("code",null,"<kitHome>/worktrees/<仓库名>-<哈希>/<分支>"),e("。"),l("code",null,"kitHome"),e(" 目前是 "),l("code",null,"REQ_KIT_HOME"),e(",没有设置时为 "),l("code",null,"~/.req-kit"),e(";到 M2c 改为 "),l("code",null,"LAOSHI_HOME"),e("。")]),l("li",null,[l("strong",null,"工作区 ID"),e(":"),l("code",null,"dir:"),e(" 加上目录的真实路径,任何进程拿到它都能找回目录。引擎把工作区 ID 当作不透明的字符串保存在状态里,不需要改动。")]),l("li",null,[l("strong",null,"准备命令"),e(":在后台运行("),l("code",null,"setup-runner.mjs"),e(",只依赖 "),l("code",null,"node"),e("),所以新建工作区的启动器不必等它。状态和输出记在 "),l("code",null,"<kitHome>/workspaces/<目录名>-<哈希>/setup.json"),e(" 与 "),l("code",null,"setup.log"),e("。"),l("code",null,"waitForWorkspaceSetup"),e(" 轮询这个状态文件;没有准备命令时立即返回 "),l("code",null,"none"),e(";运行准备命令的进程意外退出时报告失败。")]),l("li",null,[l("strong",null,"接手已有目录"),e("("),l("code",null,"openWorkspace"),e("):直接返回这个目录的工作区 ID。")]),l("li",null,[e("步骤 agent 在 worktree 目录中工作:引擎本来就把 "),l("code",null,"cwd"),e(" 设为工作区目录。dsh 插件按这个 "),l("code",null,"cwd"),e(" 创建子 agent,已在真实 dsh 上验证。")])]),l("h2",{id:"_3-服务管理-已实现",tabindex:"-1"},[e("3. 服务管理(已实现) "),l("a",{class:"header-anchor",href:"#_3-服务管理-已实现","aria-label":'Permalink to "3. 服务管理(已实现)"'},"​")]),l("ul",null,[l("li",null,[l("strong",null,"范围"),e(":服务属于某个工作区。这个工作区可以是需求自己的 worktree("),l("code",null,"{ workspaceId }"),e("),也可以是对话所在的目录("),l("code",null,"{ agentId }"),e("),后者的目录由运行时的 "),l("code",null,"agentDirectory"),e(" 给出(dsh 通过插件的 "),l("code",null,"session"),e(" 读到)。")]),l("li",null,[l("strong",null,"跨进程"),e(":每个服务由一个小的运行器("),l("code",null,"service-runner.mjs"),e(",只依赖 node)以 detached 方式启动,与引擎分离运行。运行器通过管道读取服务的输出,追加到同目录的 "),l("code",null,"<名称>.log"),e(";服务退出时,运行器记下退出码再退出。不把日志文件直接交给 detached 的服务,是因为在 Windows 上这样会丢失服务的输出(CI 实测)。记录写在 "),l("code",null,"<kitHome>/workspaces/<…>/services/<名称>.json"),e(",内容是运行器的进程号、端口、命令和退出码。所以 "),l("code",null,"req try"),e(" 启动的服务,以后的 "),l("code",null,"req try --stop"),e(" 可以停掉,引擎退出后退出码也能记下来。")]),l("li",null,[l("strong",null,"启动"),e("("),l("code",null,"startServices"),e("):先停掉同名服务,保证运行的是当前代码;再分配端口、启动,然后等每个服务就绪或退出,最多等 "),l("code",null,"serviceReadySeconds"),e("。返回值与 Paseo 一致:地址、端口、是否在运行、健康状态、退出码,以及输出的最后 40 行。")]),l("li",null,[l("strong",null,"停止"),e(":结束运行器的整个进程树(运行器、shell 和服务)。Windows 用 "),l("code",null,"taskkill /T /F"),e(";其他系统向进程组发送 SIGTERM,5 秒后仍在则发 SIGKILL。运行器以 detached 方式启动,所以它自成一个进程组,服务也在这个组里。")]),l("li",null,[l("strong",null,"已知限制"),e(":进程号可能被系统复用,所以停止前不能确认它还是原来的服务进程;绑定 "),l("code",null,"0.0.0.0"),e(" 的服务,空闲端口按 "),l("code",null,"127.0.0.1"),e(" 检查。")])]),l("h2",{id:"_4-本机调度-设计-未实现",tabindex:"-1"},[e("4. 本机调度(设计,未实现) "),l("a",{class:"header-anchor",href:"#_4-本机调度-设计-未实现","aria-label":'Permalink to "4. 本机调度(设计,未实现)"'},"​")]),l("p",null,[l("strong",null,"什么时候需要"),e(":平台和插件都没有定时任务时才需要。dsh 的定时消息来自插件,Paseo 有自己的定时任务,所以现在两个适配器都用不上它。第一个用户会是 M3 的无头 CLI 运行时。引擎里用到定时的地方有:预约启动("),l("code",null,"launch.ts"),e(")、守护检查("),l("code",null,"main.ts"),e(","),l("code",null,"cronEvery"),e(")、等待提醒和自动继续("),l("code",null,"pipeline.ts"),e(")、需求总览定时发送("),l("code",null,"digest.ts"),e(","),l("code",null,"scheduleNewAgent"),e(")。")]),l("p",null,[l("strong",null,"做法"),e(":用一个本机常驻的调度进程,按需启动,没有任务时自己退出。")]),l("ul",null,[l("li",null,[l("strong",null,"任务"),e(":每个定时任务存成一个文件 "),l("code",null,"<kitHome>/schedules/<id>.json"),e(",内容是一次性时间或 cron 表达式、时区、截止时间、目标和配置路径。目标分两种:发消息给某个对话("),l("code",null,"scheduleMessage"),e("),或启动新 agent("),l("code",null,"scheduleNewAgent"),e(")。ID 用 "),l("code",null,"local:<uuid>"),e(";取消("),l("code",null,"cancelSchedule"),e(")就是删除这个文件。")]),l("li",null,[l("strong",null,"调度进程"),e(":"),l("code",null,"node engine/src/builtin/scheduler.mjs"),e(",以 detached 方式运行,同一个安装目录只有一个实例:用 "),l("code",null,"<kitHome>/schedules/.lock"),e(" 记录进程号,锁里的进程不在了就接管。它每 30 秒检查一次到期的任务,到期后按任务里的配置创建运行时,调用 "),l("code",null,"notifyAgent"),e(" 或 "),l("code",null,"startSessionAgent"),e(";一次性任务执行后删除,周期任务过了截止时间也删除。没有任务时退出。")]),l("li",null,[l("strong",null,"按需拉起"),e(":每次创建定时任务时,以及引擎的每个入口(启动、"),l("code",null,"doctor"),e("、"),l("code",null,"req"),e(" 子命令)发现还有任务但调度进程不在时,都把它拉起来。这样不需要开机自启,也不用碰系统级的计划任务。")]),l("li",null,[l("strong",null,"错过的时间点"),e("(调度进程不在时到期的): "),l("ul",null,[l("li",null,[e("一次性任务在 6 小时内补发一次,与 Paseo 适配器设的有效期一致;超过 6 小时不再发,在日志里说明,并在下次 "),l("code",null,"doctor"),e(" 中提示。")]),l("li",null,"周期任务只补最近的一次。")])]),l("li",null,[l("strong",null,"可见性"),e(":"),l("code",null,"doctor"),e(" 列出待执行的任务和调度进程的状态;能力表中 "),l("code",null,"scheduling"),e(' 的来源显示为"laoshi 内置"。')])]),l("p",null,[l("strong",null,"放弃的做法"),e(":")]),l("ul",null,[l("li",null,[e("用系统的计划任务(cron、Windows 的 "),l("code",null,"schtasks"),e("):各系统差异大;内网机器的权限不确定;任务会留在 laoshi 之外,卸载、迁移时容易遗漏。")]),l("li",null,"让引擎进程自己计时:预约启动和需求总览要在引擎退出之后才到点,引擎不在时没人发。")]),l("p",null,[l("strong",null,"待定"),e(":")]),l("ul",null,[l("li",null,"调度进程以谁的身份、带哪些环境变量运行。它继承的是最初拉起它的那个进程的环境;配置里引用的环境变量,比如凭据,执行任务时必须读得到。"),l("li",null,'机器休眠后醒来时,补发的规则沿用上面"错过的时间点"的做法。')]),l("p",null,"实现时连同测试一起做。测试用一个可注入的时钟,覆盖一次性、cron、截止时间、补发、单实例和接管这几种情况。")],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/builtin-capabilities.md"},"docs/design/builtin-capabilities.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/design/builtin-capabilities.md"},"在 GitHub 上编辑")],-1)])])}const g=i(o,[["render",t]]);export{p as __pageData,g as default};
7
+ `),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"}")])])])]),l("ul",null,[l("li",null,[l("code",null,"setup"),e(":新建 worktree 后按顺序执行。一条失败就停下,后面的不再执行。可以只写一条字符串。")]),l("li",null,[l("code",null,"services.<名称>.command"),e(":启动服务的命令。")]),l("li",null,[l("code",null,"port"),e(":可选。不写时 laoshi 分配一个空闲端口,同一工作区以后沿用这个端口(只要它还空着),这样服务的地址不会变;写了就用固定端口,被占用时报错。")]),l("li",null,[l("code",null,"health"),e(":可选,以 "),l("code",null,"/"),e(" 开头的 HTTP 路径。写了就以 HTTP 回应码低于 500 为就绪;没写时,端口能连上就算就绪。")]),l("li",null,[e("端口的传法:命令里的 "),l("code",null,"{PORT}"),e(" 会被替换成端口号,同时设置环境变量 "),l("code",null,"PORT"),e(" 和 "),l("code",null,"LAOSHI_PORT"),e("。")]),l("li",null,[e("准备命令可以读到两个环境变量:"),l("code",null,"LAOSHI_SOURCE_CHECKOUT_PATH"),e("(对话所在的原仓库)和 "),l("code",null,"LAOSHI_WORKTREE_PATH"),e("(新工作区)。")])]),l("p",null,[l("strong",null,"shell"),e(":命令用系统默认的 shell 执行,Windows 上是 "),l("code",null,"cmd.exe"),e(",其他系统是 "),l("code",null,"/bin/sh"),e("。"),l("strong",null,"任何情况下都不启动 PowerShell"),e(",因为内网机器上它会被直接禁止运行。所以命令最好写成普通的程序调用,例如 "),l("code",null,"node scripts/x.mjs"),e(",在各个系统上都一样能用。"),l("code",null,"/laoshi-setup"),e(" 会为使用内置服务的平台写 "),l("code",null,".laoshi/services.json"),e(",需要复制本地配置时用 "),l("code",null,"skills/laoshi-setup/templates/copy-local-files.mjs"),e("(读 "),l("code",null,"LAOSHI_SOURCE_CHECKOUT_PATH"),e(");Paseo 的辅助脚本在 "),l("code",null,"adapters/paseo/skill/templates/"),e(",也认 "),l("code",null,"LAOSHI_PORT"),e(" 和 "),l("code",null,"LAOSHI_SOURCE_CHECKOUT_PATH"),e("。")]),l("p",null,[l("code",null,"laoshi doctor"),e(" 的项目一节会检查这个文件:格式、服务是否用了分配的端口、文件是否已提交(只在平台用内置能力时检查)。")]),l("h2",{id:"_2-worktree-已实现",tabindex:"-1"},[e("2. worktree(已实现) "),l("a",{class:"header-anchor",href:"#_2-worktree-已实现","aria-label":'Permalink to "2. worktree(已实现)"'},"​")]),l("ul",null,[l("li",null,[l("strong",null,"新建"),e("("),l("code",null,"createWorktree"),e("):运行 "),l("code",null,"git worktree add -b <分支> <目录> <起点>"),e(",目录在安装目录下:"),l("code",null,"<kitHome>/worktrees/<仓库名>-<哈希>/<分支>"),e("。"),l("code",null,"kitHome"),e(" 目前是 "),l("code",null,"REQ_KIT_HOME"),e(",没有设置时为 "),l("code",null,"~/.req-kit"),e(";到 M2c 改为 "),l("code",null,"LAOSHI_HOME"),e("。")]),l("li",null,[l("strong",null,"工作区 ID"),e(":"),l("code",null,"dir:"),e(" 加上目录的真实路径,任何进程拿到它都能找回目录。引擎把工作区 ID 当作不透明的字符串保存在状态里,不需要改动。")]),l("li",null,[l("strong",null,"准备命令"),e(":在后台运行("),l("code",null,"setup-runner.mjs"),e(",只依赖 "),l("code",null,"node"),e("),所以新建工作区的启动器不必等它。状态和输出记在 "),l("code",null,"<kitHome>/workspaces/<目录名>-<哈希>/setup.json"),e(" 与 "),l("code",null,"setup.log"),e("。"),l("code",null,"waitForWorkspaceSetup"),e(" 轮询这个状态文件;没有准备命令时立即返回 "),l("code",null,"none"),e(";运行准备命令的进程意外退出时报告失败。")]),l("li",null,[l("strong",null,"接手已有目录"),e("("),l("code",null,"openWorkspace"),e("):直接返回这个目录的工作区 ID。")]),l("li",null,[e("步骤 agent 在 worktree 目录中工作:引擎本来就把 "),l("code",null,"cwd"),e(" 设为工作区目录。dsh 插件按这个 "),l("code",null,"cwd"),e(" 创建子 agent,已在真实 dsh 上验证。")])]),l("h2",{id:"_3-服务管理-已实现",tabindex:"-1"},[e("3. 服务管理(已实现) "),l("a",{class:"header-anchor",href:"#_3-服务管理-已实现","aria-label":'Permalink to "3. 服务管理(已实现)"'},"​")]),l("ul",null,[l("li",null,[l("strong",null,"范围"),e(":服务属于某个工作区。这个工作区可以是需求自己的 worktree("),l("code",null,"{ workspaceId }"),e("),也可以是对话所在的目录("),l("code",null,"{ agentId }"),e("),后者的目录由运行时的 "),l("code",null,"agentDirectory"),e(" 给出(dsh 通过插件的 "),l("code",null,"session"),e(" 读到)。")]),l("li",null,[l("strong",null,"跨进程"),e(":每个服务由一个小的运行器("),l("code",null,"service-runner.mjs"),e(",只依赖 node)以 detached 方式启动,与引擎分离运行。运行器通过管道读取服务的输出,追加到同目录的 "),l("code",null,"<名称>.log"),e(";服务退出时,运行器记下退出码再退出。不把日志文件直接交给 detached 的服务,是因为在 Windows 上这样会丢失服务的输出(CI 实测)。记录写在 "),l("code",null,"<kitHome>/workspaces/<…>/services/<名称>.json"),e(",内容是运行器的进程号、端口、命令和退出码。所以 "),l("code",null,"req try"),e(" 启动的服务,以后的 "),l("code",null,"req try --stop"),e(" 可以停掉,引擎退出后退出码也能记下来。")]),l("li",null,[l("strong",null,"启动"),e("("),l("code",null,"startServices"),e("):先停掉同名服务,保证运行的是当前代码;再分配端口、启动,然后等每个服务就绪或退出,最多等 "),l("code",null,"serviceReadySeconds"),e("。返回值与 Paseo 一致:地址、端口、是否在运行、健康状态、退出码,以及输出的最后 40 行。")]),l("li",null,[l("strong",null,"停止"),e(":结束运行器的整个进程树(运行器、shell 和服务)。Windows 用 "),l("code",null,"taskkill /T /F"),e(";其他系统向进程组发送 SIGTERM,5 秒后仍在则发 SIGKILL。运行器以 detached 方式启动,所以它自成一个进程组,服务也在这个组里。")]),l("li",null,[l("strong",null,"已知限制"),e(":进程号可能被系统复用,所以停止前不能确认它还是原来的服务进程;绑定 "),l("code",null,"0.0.0.0"),e(" 的服务,空闲端口按 "),l("code",null,"127.0.0.1"),e(" 检查。")])]),l("h2",{id:"_4-本机调度-设计归档-不做",tabindex:"-1"},[e("4. 本机调度(设计归档,不做) "),l("a",{class:"header-anchor",href:"#_4-本机调度-设计归档-不做","aria-label":'Permalink to "4. 本机调度(设计归档,不做)"'},"​")]),l("p",null,[l("strong",null,"什么时候需要"),e(":平台和插件都没有定时任务时才需要。dsh 的定时消息来自插件,Paseo 有自己的定时任务,所以现在两个适配器都用不上它。第一个用户会是 M3 的无头 CLI 运行时。引擎里用到定时的地方有:预约启动("),l("code",null,"launch.ts"),e(")、守护检查("),l("code",null,"main.ts"),e(","),l("code",null,"cronEvery"),e(")、等待提醒和自动继续("),l("code",null,"pipeline.ts"),e(")、需求总览定时发送("),l("code",null,"digest.ts"),e(","),l("code",null,"scheduleNewAgent"),e(")。")]),l("p",null,[l("strong",null,"做法"),e(":用一个本机常驻的调度进程,按需启动,没有任务时自己退出。")]),l("ul",null,[l("li",null,[l("strong",null,"任务"),e(":每个定时任务存成一个文件 "),l("code",null,"<kitHome>/schedules/<id>.json"),e(",内容是一次性时间或 cron 表达式、时区、截止时间、目标和配置路径。目标分两种:发消息给某个对话("),l("code",null,"scheduleMessage"),e("),或启动新 agent("),l("code",null,"scheduleNewAgent"),e(")。ID 用 "),l("code",null,"local:<uuid>"),e(";取消("),l("code",null,"cancelSchedule"),e(")就是删除这个文件。")]),l("li",null,[l("strong",null,"调度进程"),e(":"),l("code",null,"node engine/src/builtin/scheduler.mjs"),e(",以 detached 方式运行,同一个安装目录只有一个实例:用 "),l("code",null,"<kitHome>/schedules/.lock"),e(" 记录进程号,锁里的进程不在了就接管。它每 30 秒检查一次到期的任务,到期后按任务里的配置创建运行时,调用 "),l("code",null,"notifyAgent"),e(" 或 "),l("code",null,"startSessionAgent"),e(";一次性任务执行后删除,周期任务过了截止时间也删除。没有任务时退出。")]),l("li",null,[l("strong",null,"按需拉起"),e(":每次创建定时任务时,以及引擎的每个入口(启动、"),l("code",null,"doctor"),e("、"),l("code",null,"req"),e(" 子命令)发现还有任务但调度进程不在时,都把它拉起来。这样不需要开机自启,也不用碰系统级的计划任务。")]),l("li",null,[l("strong",null,"错过的时间点"),e("(调度进程不在时到期的): "),l("ul",null,[l("li",null,[e("一次性任务在 6 小时内补发一次,与 Paseo 适配器设的有效期一致;超过 6 小时不再发,在日志里说明,并在下次 "),l("code",null,"doctor"),e(" 中提示。")]),l("li",null,"周期任务只补最近的一次。")])]),l("li",null,[l("strong",null,"可见性"),e(":"),l("code",null,"doctor"),e(" 列出待执行的任务和调度进程的状态;能力表中 "),l("code",null,"scheduling"),e(' 的来源显示为"laoshi 内置"。')])]),l("p",null,[l("strong",null,"放弃的做法"),e(":")]),l("ul",null,[l("li",null,[e("用系统的计划任务(cron、Windows 的 "),l("code",null,"schtasks"),e("):各系统差异大;内网机器的权限不确定;任务会留在 laoshi 之外,卸载、迁移时容易遗漏。")]),l("li",null,"让引擎进程自己计时:预约启动和需求总览要在引擎退出之后才到点,引擎不在时没人发。")]),l("p",null,[l("strong",null,"待定"),e(":")]),l("ul",null,[l("li",null,"调度进程以谁的身份、带哪些环境变量运行。它继承的是最初拉起它的那个进程的环境;配置里引用的环境变量,比如凭据,执行任务时必须读得到。"),l("li",null,'机器休眠后醒来时,补发的规则沿用上面"错过的时间点"的做法。')]),l("p",null,"实现时连同测试一起做。测试用一个可注入的时钟,覆盖一次性、cron、截止时间、补发、单实例和接管这几种情况。")],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/builtin-capabilities.md"},"docs/design/builtin-capabilities.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/design/builtin-capabilities.md"},"在 GitHub 上编辑")],-1)])])}const g=i(o,[["render",t]]);export{p as __pageData,g as default};