@yiyi_zhang/laoshi 0.2.0-beta.1 → 0.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/adapters/cli/adapter.ts +53 -0
- package/adapters/cli/cli-runtime.ts +402 -0
- package/adapters/cli/drivers.ts +146 -0
- package/adapters/cli/install.mjs +28 -0
- package/adapters/cli/skill/setup.md +8 -0
- package/adapters/dsh/plugin/index.mjs +1 -1
- package/adapters/dsh/plugin/package.json +1 -1
- package/adapters/mogao/adapter.ts +1 -0
- package/adapters/mogao/install.mjs +1 -1
- package/adapters/mogao/make-expert.mjs +1 -0
- package/adapters/mogao/mogao-runtime.ts +98 -17
- package/adapters/paseo/adapter.ts +1 -1
- package/adapters/paseo/install.mjs +17 -5
- package/adapters/paseo/migrate.ts +267 -0
- package/adapters/paseo/plugin/OVERVIEW.md +9 -0
- package/adapters/paseo/plugin/client/config.tsx +216 -0
- package/adapters/paseo/plugin/client/data.ts +85 -0
- package/adapters/paseo/plugin/client/detail.tsx +342 -0
- package/adapters/paseo/plugin/client/format.ts +173 -0
- package/adapters/paseo/plugin/client/inbox.tsx +190 -0
- package/adapters/paseo/plugin/client/live.ts +161 -0
- package/adapters/paseo/plugin/client/markdown.tsx +220 -0
- package/adapters/paseo/plugin/client/models.tsx +117 -0
- package/adapters/paseo/plugin/client/nav.ts +22 -0
- package/adapters/paseo/plugin/client/overview.tsx +103 -0
- package/adapters/paseo/plugin/client/panel.tsx +56 -0
- package/adapters/paseo/plugin/client/review.tsx +80 -0
- package/adapters/paseo/plugin/client/row.tsx +63 -0
- package/adapters/paseo/plugin/client/settings.tsx +92 -0
- package/adapters/paseo/plugin/client/sidebar.tsx +27 -0
- package/adapters/paseo/plugin/client/stats.tsx +138 -0
- package/adapters/paseo/plugin/client/ui.tsx +278 -0
- package/adapters/paseo/plugin/client/web.ts +34 -0
- package/adapters/paseo/plugin/index.client.tsx +66 -0
- package/adapters/paseo/plugin/index.server.ts +61 -0
- package/adapters/paseo/plugin/package.json +22 -0
- package/adapters/paseo/plugin/paseo-plugin.json +6 -0
- package/adapters/paseo/plugin/server/handlers.ts +69 -0
- package/adapters/paseo/plugin/server/req.ts +105 -0
- package/adapters/paseo/plugin/shared/contracts.ts +286 -0
- package/adapters/paseo/plugin/shared/rk-colors.ts +35 -0
- package/adapters/paseo/plugin/tsconfig.json +16 -0
- package/adapters/paseo/plugin-cmd.mjs +233 -0
- package/bin/install.mjs +8 -7
- package/bin/req.mjs +10 -2
- package/contracts/README.md +1 -1
- package/contracts/agent-runtime.md +2 -2
- package/contracts/cli-json.md +4 -3
- package/contracts/notifier-event.md +2 -2
- package/contracts/state.md +2 -0
- package/contracts/usage-record.md +3 -3
- package/docs/design/adapter-guide.md +2 -1
- package/docs/design/cli-adapter.md +75 -0
- package/docs/design/compat-migration.md +2 -0
- package/docs/design/mogao-expert.md +3 -1
- package/docs/guide//345/234/250/346/221/270/351/253/230/344/270/212/344/275/277/347/224/250.md +132 -0
- package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +32 -3
- package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +4 -2
- package/docs/guide//351/241/271/347/233/256/345/256/232/345/210/266/344/270/216/350/277/220/350/241/214/350/247/204/345/210/231.md +1 -1
- package/engine/src/api.ts +4 -0
- package/engine/src/doctor.ts +3 -2
- package/engine/src/identity.ts +16 -1
- package/engine/src/main.ts +3 -1
- package/engine/src/messages.ts +1 -1
- package/engine/src/platform.ts +2 -0
- package/engine/src/runtime-loader.ts +14 -0
- package/engine/src/state.ts +2 -0
- package/engine/src/words.ts +1 -1
- package/package.json +2 -1
- package/site-dist/404.html +2 -2
- package/site-dist/assets/{app.DMAHANCl.js → app.CXydUhZx.js} +1 -1
- package/site-dist/assets/changelog.md.BU-CvyJ1.js +1 -0
- package/site-dist/assets/changelog.md.BU-CvyJ1.lean.js +1 -0
- package/site-dist/assets/chunks/@localSearchIndexroot.CfgJeQRO.js +1 -0
- package/site-dist/assets/chunks/{VPLocalSearchBox.COsLwqWS.js → VPLocalSearchBox.CIjDV0ax.js} +1 -1
- package/site-dist/assets/chunks/{theme.CeR3HD86.js → theme.CWtC1Kby.js} +2 -2
- package/site-dist/assets/guide_cli.md.BrXllHw9.js +2 -0
- package/site-dist/assets/guide_cli.md.BrXllHw9.lean.js +2 -0
- package/site-dist/assets/{guide_getting-started.md.Bytaz3L8.js → guide_getting-started.md.BxOxfic_.js} +1 -1
- package/site-dist/assets/guide_install.md.By4WxsJG.js +24 -0
- package/site-dist/assets/guide_install.md.By4WxsJG.lean.js +24 -0
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.js +1 -0
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.lean.js +1 -0
- package/site-dist/assets/guide_mogao.md.S0eln1Pr.js +10 -0
- package/site-dist/assets/guide_mogao.md.S0eln1Pr.lean.js +10 -0
- package/site-dist/assets/{guide_project.md.BIcaDhdS.js → guide_project.md.B2cmf8YF.js} +1 -1
- package/site-dist/assets/{guide_project.md.BIcaDhdS.lean.js → guide_project.md.B2cmf8YF.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_agent-runtime.md.DPE2FJFc.js +1 -0
- package/site-dist/assets/{reference_contracts_agent-runtime.md.TK7Lhwdf.lean.js → reference_contracts_agent-runtime.md.DPE2FJFc.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.js +1 -0
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.lean.js +1 -0
- package/site-dist/assets/{reference_contracts_index.md.dqNwNs6U.js → reference_contracts_index.md.B5P4FjRk.js} +1 -1
- package/site-dist/assets/{reference_contracts_index.md.dqNwNs6U.lean.js → reference_contracts_index.md.B5P4FjRk.lean.js} +1 -1
- package/site-dist/assets/{reference_contracts_notifier-event.md.D6we9wWS.js → reference_contracts_notifier-event.md.BeR8iODP.js} +1 -1
- package/site-dist/assets/{reference_contracts_notifier-event.md.D6we9wWS.lean.js → reference_contracts_notifier-event.md.BeR8iODP.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_state.md.DLygjkfs.js +1 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CgfMoYp0.js +10 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CgfMoYp0.lean.js +10 -0
- package/site-dist/assets/{reference_design_adapter-guide.md.BSziZJSM.js → reference_design_adapter-guide.md.B_P-spS5.js} +2 -2
- package/site-dist/assets/{reference_design_adapter-guide.md.BSziZJSM.lean.js → reference_design_adapter-guide.md.B_P-spS5.lean.js} +2 -2
- package/site-dist/assets/reference_design_cli-adapter.md.pJy3x6Un.js +13 -0
- package/site-dist/assets/reference_design_cli-adapter.md.pJy3x6Un.lean.js +13 -0
- package/site-dist/changelog.html +5 -5
- package/site-dist/guide/cli.html +31 -0
- package/site-dist/guide/dsh.html +5 -5
- package/site-dist/guide/getting-started.html +5 -5
- package/site-dist/guide/how-it-works.html +4 -4
- package/site-dist/guide/index.html +4 -4
- package/site-dist/guide/install.html +13 -8
- package/site-dist/guide/intranet.html +5 -5
- package/site-dist/guide/maintainer.html +5 -5
- package/site-dist/guide/mogao.html +39 -0
- package/site-dist/guide/phases.html +4 -4
- package/site-dist/guide/project.html +6 -6
- package/site-dist/guide/user.html +4 -4
- package/site-dist/hashmap.json +1 -1
- package/site-dist/index.html +4 -4
- package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +4 -4
- package/site-dist/reference/adr/0002-two-orchestration-modes.html +4 -4
- package/site-dist/reference/adr/0003-generate-once-then-lock.html +4 -4
- package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +4 -4
- package/site-dist/reference/adr/0005-skill-names.html +4 -4
- package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +4 -4
- package/site-dist/reference/adr/0007-one-install-many-repos.html +4 -4
- package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +4 -4
- package/site-dist/reference/adr/index.html +4 -4
- package/site-dist/reference/commands.html +4 -4
- package/site-dist/reference/config.html +4 -4
- package/site-dist/reference/contracts/agent-runtime.html +5 -5
- package/site-dist/reference/contracts/cli-json.html +5 -5
- package/site-dist/reference/contracts/feature-files.html +4 -4
- package/site-dist/reference/contracts/index.html +5 -5
- package/site-dist/reference/contracts/notifier-event.html +6 -6
- package/site-dist/reference/contracts/result-file.html +4 -4
- package/site-dist/reference/contracts/spec.html +4 -4
- package/site-dist/reference/contracts/state.html +5 -5
- package/site-dist/reference/contracts/usage-record.html +6 -6
- package/site-dist/reference/contracts/verify.html +4 -4
- package/site-dist/reference/design/adapter-guide.html +6 -6
- package/site-dist/reference/design/architecture.html +4 -4
- package/site-dist/reference/design/builtin-capabilities.html +4 -4
- package/site-dist/reference/design/cli-adapter.html +42 -0
- package/site-dist/reference/design/platform-vocabulary.html +4 -4
- package/site-dist/reference/scope.html +4 -4
- package/site-dist/assets/changelog.md.Q8QGpuBY.js +0 -1
- package/site-dist/assets/changelog.md.Q8QGpuBY.lean.js +0 -1
- package/site-dist/assets/chunks/@localSearchIndexroot.CQdjFK3w.js +0 -1
- package/site-dist/assets/guide_install.md.D7NiiOPu.js +0 -19
- package/site-dist/assets/guide_install.md.D7NiiOPu.lean.js +0 -19
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.js +0 -1
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.lean.js +0 -1
- package/site-dist/assets/reference_contracts_agent-runtime.md.TK7Lhwdf.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.lean.js +0 -1
- package/site-dist/assets/reference_contracts_state.md.DVHC4opX.js +0 -1
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.js +0 -10
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.lean.js +0 -10
- /package/site-dist/assets/{guide_getting-started.md.Bytaz3L8.lean.js → guide_getting-started.md.BxOxfic_.lean.js} +0 -0
- /package/site-dist/assets/{reference_contracts_state.md.DVHC4opX.lean.js → reference_contracts_state.md.DLygjkfs.lean.js} +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{_ as n,o as e,c as a,j as l,a as i}from"./chunks/framework.BetZR81g.js";const c=JSON.parse('{"title":"安装与升级","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/install.md","filePath":"guide/install.md","lastUpdated":null}'),t={name:"guide/install.md"};function h(d,s,o,u,r,k){return e(),a("div",null,[...s[0]||(s[0]=[l("div",null,[l("h1",{id:"安装与升级",tabindex:"-1"},[i("安装与升级 "),l("a",{class:"header-anchor",href:"#安装与升级","aria-label":'Permalink to "安装与升级"'},"")]),l("p",null,[i("本文面向负责安装的人:通常是开发同事,有经验的测试或产品同事也可以按步骤完成。每台机器只装一次(装在运行 agent 平台的那台机器上),之后这台机器上所有项目的对话都能使用 "),l("code",null,"/laoshi"),i("。")]),l("p",null,"laoshi 目前支持两个 agent 平台:"),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("a",{href:"https://paseo.sh",target:"_blank",rel:"noreferrer"},"Paseo"),i(" 0.11"),l("br"),l("code",null,"--platform paseo")]),l("td",null,"步骤 agent、工作区、服务、定时消息都由 Paseo daemon 提供")]),l("tr",null,[l("td",null,[i("DeepSeek Harness(dsh)"),l("br"),l("code",null,"--platform dsh")]),l("td",null,[i("步骤 agent 和定时消息由 laoshi 的 dsh 插件提供;工作区和服务用 laoshi 的内置实现("),l("code",null,"git worktree"),i("、"),l("code",null,".laoshi/services.json"),i(")")])])])]),l("h2",{id:"_1-安装布局",tabindex:"-1"},[i("1. 安装布局 "),l("a",{class:"header-anchor",href:"#_1-安装布局","aria-label":'Permalink to "1. 安装布局"'},"")]),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,"<npm 全局目录>/laoshi/ 程序(全局目录不可写时在 ~/.laoshi/npm 下)")]),i(`
|
|
2
|
-
`),l("span",{class:"line"},[l("span",null,"~/.laoshi/ 安装根(LAOSHI_HOME 可以换位置)")]),i(`
|
|
3
|
-
`),l("span",{class:"line"},[l("span",null,"├── config.json 安装级配置:平台、各角色的模型")]),i(`
|
|
4
|
-
`),l("span",{class:"line"},[l("span",null,"├── install.json 安装记录(--check、--uninstall 用)")]),i(`
|
|
5
|
-
`),l("span",{class:"line"},[l("span",null,"├── bin/laoshi(.cmd) laoshi 命令(不在 PATH 时用)")]),i(`
|
|
6
|
-
`),l("span",{class:"line"},[l("span",null,"├── prompts.local/ 本机提示词覆盖(可选)")]),i(`
|
|
7
|
-
`),l("span",{class:"line"},[l("span",null,"└── notifiers/ 外部通知模块(可选,见第 10 节)")]),i(`
|
|
8
|
-
`),l("span",{class:"line"},[l("span",null,"<skill 目录>/laoshi*/ 按平台渲染的 skill,带 .laoshi-install.json")])])])]),l("p",null,"skill 装到哪里由平台决定:"),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"平台"),l("th",null,"skill 目录")])]),l("tbody",null,[l("tr",null,[l("td",null,"Paseo"),l("td",null,[l("code",null,"~/.agents/skills"),i("(Codex、Pi、OpenCode 等读取),"),l("code",null,"~/.claude"),i(" 存在时还有 "),l("code",null,"~/.claude/skills")])]),l("tr",null,[l("td",null,"dsh"),l("td",null,[l("code",null,"$DSH_HOME/skills"),i("(默认 "),l("code",null,"~/.dsh/skills"),i(");dsh 插件装在 "),l("code",null,"$DSH_HOME/profiles/<profile>/node_modules/laoshi-dsh-plugin"),i(" 并挂载到 "),l("code",null,"cordis.patch.yml")])])])]),l("p",null,[l("code",null,"--target <目录>"),i(" 可以另外指定 skill 目录(可以写多次)。Windows 上 "),l("code",null,"~"),i(" 即 "),l("code",null,"%USERPROFILE%"),i("。安装器不使用符号链接,不需要管理员权限;在 Windows 上它只启动 "),l("code",null,"node"),i(" 和 "),l("code",null,"cmd.exe"),i(",不会启动 PowerShell。")]),l("h2",{id:"_2-前置条件",tabindex:"-1"},[i("2. 前置条件 "),l("a",{class:"header-anchor",href:"#_2-前置条件","aria-label":'Permalink to "2. 前置条件"'},"")]),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,"Node.js"),l("td",null,"22.19 或更新"),l("td",null,[l("code",null,"node -v")])]),l("tr",null,[l("td",null,"npm"),l("td",null,"Node.js 自带;公司网络用镜像(见第 3 节)"),l("td",null,[l("code",null,"npm -v")])]),l("tr",null,[l("td",null,"git"),l("td",null,"近期版本"),l("td",null,[l("code",null,"git --version")])]),l("tr",null,[l("td",null,"平台"),l("td",null,[i("Paseo 0.11 的 daemon 在运行;或已装好 dsh("),l("code",null,"dsh"),i(" 命令可用,或知道它的 "),l("code",null,"bin.js"),i(" 位置)")]),l("td",null,[i("Paseo:能在桌面端或 "),l("code",null,"http://localhost:6767/"),i(" 对话;dsh:能在网页端对话")])]),l("tr",null,[l("td",null,"模型"),l("td",null,"Paseo:Claude Code、Codex、OpenCode、Pi 至少一种已在 Paseo 中登录;dsh:对话用的模型能正常回答"),l("td",null,"用它开一个对话")])])]),l("h2",{id:"_3-首次安装",tabindex:"-1"},[i("3. 首次安装 "),l("a",{class:"header-anchor",href:"#_3-首次安装","aria-label":'Permalink to "3. 首次安装"'},"")]),l("p",null,[l("strong",null,"一步安装(推荐)。"),i(" 只需要 Node.js 和能访问的 npm 源:")]),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"}},"npx"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -y"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," @yiyi_zhang/laoshi@latest"),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("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 或 --platform paseo")])])])]),l("p",null,[i("它依次:检查 Node.js、npm 和 git;确定 npm 源;"),l("code",null,"npm install -g"),i(" 这个版本(全局目录不可写时装到 "),l("code",null,"~/.laoshi/npm"),i(",不需要 sudo);然后运行装好的那份程序的 "),l("code",null,"laoshi install"),i(",完成安装级配置、skill 和平台的设置。npx 的临时目录会被清理,所以安装记录和 skill 都指向 npm 装好的那份。再次运行就是升级。")]),l("p",null,[i("指定版本:"),l("code",null,"npx -y @yiyi_zhang/laoshi@0.1.1 install --platform dsh"),i("。")]),l("p",null,[l("strong",null,"公司内网(只有 npm 镜像)。"),i(" 加上镜像地址:")]),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"}},"npx"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -y"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --registry=https://npm.example.internal/"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," @yiyi_zhang/laoshi@latest"),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("ul",null,[l("li",null,[i("镜像地址会"),l("strong",null,"保存为本机的 npm 源"),i("(屏幕上会写出原来的值),以后 "),l("code",null,"laoshi upgrade"),i(" 也从镜像取。只想这一次用镜像时加 "),l("code",null,"--no-save-registry"),i("。本机原本就配好了镜像时不用写 "),l("code",null,"--registry"),i("。")]),l("li",null,[i("镜像上还没有这个版本(同步有延迟)时会直接说明,稍后再运行,或请管理镜像的同事同步 "),l("code",null,"laoshi"),i("。")]),l("li",null,[i("文档:装好后运行 "),l("code",null,"laoshi docs"),i(",在本机打开和这个版本一致的文档站点,不需要外网。")])]),l("p",null,[l("strong",null,"完全离线(连 npm 镜像也没有)。"),i(" 用带依赖的离线安装包,步骤见"),l("a",{href:"./intranet"},"内网安装与验证"),i("。")]),l("p",null,[l("strong",null,"已经有程序目录时"),i("(git 克隆、解压的安装包):在程序目录中 "),l("code",null,"npm ci --omit=dev"),i(",再运行 "),l("code",null,"node bin/req.mjs install --platform <平台>"),i("。")]),l("h3",{id:"安装选项",tabindex:"-1"},[i("安装选项 "),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("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"--platform <paseo|dsh>")]),l("td",null,"装到哪个平台。第一次安装时要写,之后沿用安装记录;和已装的平台不一致时会停下")]),l("tr",null,[l("td",null,[l("code",null,"--home <目录>")]),l("td",null,[i("安装根,默认 "),l("code",null,"LAOSHI_HOME"),i(" 或 "),l("code",null,"~/.laoshi")])]),l("tr",null,[l("td",null,[l("code",null,"--target <目录>")]),l("td",null,"另外把 skill 装到这个目录")]),l("tr",null,[l("td",null,[l("code",null,"--force")]),l("td",null,"覆盖同名的、不是 laoshi 装的 skill(默认跳过并列出)")]),l("tr",null,[l("td",null,[l("code",null,"--check")]),l("td",null,[i("只检查,不改动(也可以用 "),l("code",null,"laoshi check"),i(")")])]),l("tr",null,[l("td",null,[l("code",null,"--dry-run")]),l("td",null,"演练:显示要做的事,不写文件")]),l("tr",null,[l("td",null,[l("code",null,"--uninstall")]),l("td",null,"卸载(见第 8 节)")]),l("tr",null,[l("td",null,[l("code",null,"--registry <地址>"),i("、"),l("code",null,"--no-save-registry")]),l("td",null,[i("只用于一步安装和 "),l("code",null,"laoshi upgrade"),i(":这次用的 npm 源,是否保存")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--dsh-home <目录>")]),l("td",null,[i("dsh 的数据目录,默认 "),l("code",null,"DSH_HOME"),i(" 或 "),l("code",null,"~/.dsh")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--profile <名称>")]),l("td",null,[i("插件装进哪个 profile,默认 "),l("code",null,"web")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--dsh-bin <路径>")]),l("td",null,[i("dsh 的 "),l("code",null,"bin.js"),i(","),l("code",null,"dsh"),i(" 不在 PATH 中时写;"),l("code",null,"dsh plugin add"),i(" 失败时安装器直接复制插件")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--approvals ask|allow")]),l("td",null,[i("步骤 agent 的审批请求:"),l("code",null,"ask"),i(" 交给人(默认),"),l("code",null,"allow"),i(" 直接批准一次")])])])]),l("p",null,[i("同名 skill 的处理:带 "),l("code",null,".laoshi-install.json"),i(" 标记的是 laoshi 装的,会被更新;paseo-req-kit 装的(带 "),l("code",null,".req-kit-install.json"),i(")和别人放的都不覆盖,安装器会列出它们,确认后再用 "),l("code",null,"--force"),i("。")]),l("h2",{id:"_4-配置模型",tabindex:"-1"},[i("4. 配置模型 "),l("a",{class:"header-anchor",href:"#_4-配置模型","aria-label":'Permalink to "4. 配置模型"'},"")]),l("p",null,[i("各角色(builder 实现、reviewer 评审等)用的模型写在 "),l("code",null,"~/.laoshi/config.json"),i(" 的 "),l("code",null,"agents"),i(" 中,项目的 "),l("code",null,".laoshi.json"),i(" 可以覆盖。写法因平台而异。")]),l("h3",{id:"paseo",tabindex:"-1"},[i("Paseo "),l("a",{class:"header-anchor",href:"#paseo","aria-label":'Permalink to "Paseo"'},"")]),l("p",null,[i("运行 "),l("code",null,"laoshi configure"),i("(逐项选择)或 "),l("code",null,"laoshi configure --auto"),i("(按推荐选好:两个不同厂商的模型分别做 builder 和 reviewer,都用免确认模式)。")]),l("p",null,[l("strong",null,"推荐引用 Paseo 的 agent profile。"),i(' 在 Paseo 的 设置 → 本机 → Agents → Agent profiles 中建好"实现""评审"等 profile,配置中只写名称,之后换模型只需在 Paseo 中改 profile:')]),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":"#032F62","--shiki-dark":"#9ECBFF"}},'"agents"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": {")]),i(`
|
|
9
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "builder"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"platformProfile"'),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"}}," },")]),i(`
|
|
10
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "reviewer"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"platformProfile"'),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"}}," }")]),i(`
|
|
11
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"}")])])])]),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,"provider")]),l("td",null,[l("code",null,"<Paseo 中的 provider ID>/<模型 ID>"),i(",只在第一个 "),l("code",null,"/"),i(" 处拆分")])]),l("tr",null,[l("td",null,[l("code",null,"modeId")]),l("td",null,"agent 的模式。必须选不会停下来等待批准的模式;没有模式的 agent 不写")]),l("tr",null,[l("td",null,[l("code",null,"featureValues")]),l("td",null,"agent 的功能开关,目前只有 OpenCode 需要")]),l("tr",null,[l("td",null,[l("code",null,"thinkingOptionId")]),l("td",null,"可选,思考强度")])])]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"agent"),l("th",null,[l("code",null,"provider"),i(" 写法")]),l("th",null,"无人值守的设置")])]),l("tbody",null,[l("tr",null,[l("td",null,"Claude Code"),l("td",null,[l("code",null,"claude/<模型 ID>")]),l("td",null,[l("code",null,'"modeId": "bypassPermissions"')])]),l("tr",null,[l("td",null,"Codex"),l("td",null,[l("code",null,"codex/<模型 ID>")]),l("td",null,[l("code",null,'"modeId": "full-access"')])]),l("tr",null,[l("td",null,"OpenCode"),l("td",null,[l("code",null,"opencode/<上游>/<模型 ID>")]),l("td",null,[l("code",null,'"modeId": "build"'),i(" 加 "),l("code",null,'"featureValues": { "auto_accept": true }')])]),l("tr",null,[l("td",null,"Pi"),l("td",null,[l("code",null,"pi/<上游>/<模型 ID>")]),l("td",null,[i("不写 "),l("code",null,"modeId")])])])]),l("p",null,"聊天 agent(使用者对话的那一个)的用法:"),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"agent"),l("th",null,"如何触发")])]),l("tbody",null,[l("tr",null,[l("td",null,"Claude Code、OpenCode"),l("td",null,[l("code",null,"/laoshi 我想……")])]),l("tr",null,[l("td",null,"Pi"),l("td",null,[l("code",null,"/skill:laoshi 我想……")])]),l("tr",null,[l("td",null,"Codex"),l("td",null,'直接说"用 laoshi 帮我……"')])])]),l("p",null,"聊天 agent 需要能执行命令和访问本机网络(流水线要连接 daemon)。"),l("h3",{id:"dsh",tabindex:"-1"},[i("dsh "),l("a",{class:"header-anchor",href:"#dsh","aria-label":'Permalink to "dsh"'},"")]),l("p",null,[l("code",null,"provider"),i(" 写成 "),l("code",null,"<dsh 的提供方>/<模型>"),i(",这个角色的步骤就用它;"),l("code",null,"thinkingOptionId"),i(" 作为推理强度。"),l("code",null,"dsh/chat-model"),i(" 表示用对话的模型(安装器的默认值):")]),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":"#032F62","--shiki-dark":"#9ECBFF"}},'"agents"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": {")]),i(`
|
|
12
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "builder"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"dsh/chat-model"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," },")]),i(`
|
|
13
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "reviewer"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"deepseek/deepseek-reasoner"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"thinkingOptionId"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"high"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }")]),i(`
|
|
14
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"}")])])])]),l("p",null,[l("code",null,"laoshi doctor"),i(" 列出 dsh 中可用的模型并逐个角色检查。在 dsh 的对话里输入 "),l("code",null,"/laoshi 我想……"),i(" 开始;发起的对话由 dsh 提供的 "),l("code",null,"DSH_SESSION_ID"),i(" 识别。更多见"),l("a",{href:"./dsh"},"在 DeepSeek Harness 上使用"),i("。")]),l("h2",{id:"_5-体检和冒烟测试",tabindex:"-1"},[i("5. 体检和冒烟测试 "),l("a",{class:"header-anchor",href:"#_5-体检和冒烟测试","aria-label":'Permalink to "5. 体检和冒烟测试"'},"")]),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"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," doctor"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --no-project"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 安装、配置、平台、模型")]),i(`
|
|
15
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," doctor"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 在项目目录中:再检查这个项目")])])])]),l("p",null,[i("全部是 ✓ 或只有 ⚠ 即可继续,✗ 的项按提示处理。然后在一个测试项目中完整跑一遍:新开对话,输入 "),l("code",null,"/laoshi 在 README 末尾加一行版权声明"),i(",应走快速档,收到进展和完成通知,功能目录中各产物齐全,工作分支上有本地提交。")]),l("p",null,[i("Paseo 另有冒烟测试(在程序目录中运行):"),l("code",null,"npm run smoke -- check"),i(" 启动两个角色各一个小 agent,确认能写文件、能执行命令、不停下等权限。")]),l("h2",{id:"_6-升级和回退",tabindex:"-1"},[i("6. 升级和回退 "),l("a",{class:"header-anchor",href:"#_6-升级和回退","aria-label":'Permalink to "6. 升级和回退"'},"")]),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"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," upgrade"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 最新版本")]),i(`
|
|
16
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," upgrade"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," 0.1.0"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 指定版本(也用于回退到旧版本)")]),i(`
|
|
17
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," upgrade"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --registry"),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"}}," # 换 npm 源")])])])]),l("p",null,[i("它从 npm 装好新版本,再运行新版本的 "),l("code",null,"laoshi install"),i(",沿用安装记录中的平台和选项。配置、项目文件和功能目录不变。升级会原地替换程序文件,请在没有流水线运行时升级("),l("code",null,"laoshi list"),i(" 查看)。")]),l("p",null,[i("平台(Paseo、dsh)或 agent 升级之后,运行 "),l("code",null,"laoshi doctor"),i(" 确认版本在支持范围内、配置中的模型仍然存在。")]),l("h2",{id:"_7-和-paseo-req-kit-共存",tabindex:"-1"},[i("7. 和 paseo-req-kit 共存 "),l("a",{class:"header-anchor",href:"#_7-和-paseo-req-kit-共存","aria-label":'Permalink to "7. 和 paseo-req-kit 共存"'},"")]),l("p",null,"laoshi 是从 paseo-req-kit 抽出的平台无关版本,两者可以装在同一台机器上:"),l("ul",null,[l("li",null,[i("安装根不同("),l("code",null,"~/.laoshi"),i(" 和 "),l("code",null,"~/.req-kit"),i("),命令不同("),l("code",null,"laoshi"),i(" 和 "),l("code",null,"req"),i(";laoshi 也提供 "),l("code",null,"req"),i(" 别名,npm 全局安装时后装的那个生效)。")]),l("li",null,[i("只有 "),l("code",null,"~/.req-kit"),i(" 时,laoshi 会读取它;"),l("code",null,".requirement-pipeline.json"),i(" 也继续被读取,新项目用 "),l("code",null,".laoshi.json"),i("。")]),l("li",null,"同名 skill 不互相覆盖(见第 3 节)。")]),l("h2",{id:"_8-卸载",tabindex:"-1"},[i("8. 卸载 "),l("a",{class:"header-anchor",href:"#_8-卸载","aria-label":'Permalink to "8. 卸载"'},"")]),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"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --uninstall")])])])]),l("p",null,[i("删除 laoshi 装的 skill,dsh 上还会移除插件和 "),l("code",null,"cordis.patch.yml"),i(" 中的挂载。安装根("),l("code",null,"~/.laoshi"),i(")保留;确认不再使用后,"),l("code",null,"npm uninstall -g @yiyi_zhang/laoshi"),i(" 并手工删除 "),l("code",null,"~/.laoshi"),i("。各项目中的配置文件和功能目录保留,它们本身就是文档。")]),l("h2",{id:"_9-安全提示",tabindex:"-1"},[i("9. 安全提示 "),l("a",{class:"header-anchor",href:"#_9-安全提示","aria-label":'Permalink to "9. 安全提示"'},"")]),l("ul",null,[l("li",null,[i("步骤 agent 以免确认模式运行(dsh 上 "),l("code",null,"--approvals allow"),i(" 时同样),可以在本机执行命令。仓库和本机环境变量中不要放生产凭据;最好用专门的开发机或虚拟机。")]),l("li",null,"口令和密钥只放在环境变量中,不要写进配置文件。"),l("li",null,"流水线只做本地提交,合并和上线始终由人决定。")]),l("h2",{id:"_10-接入企业内部-im-可选",tabindex:"-1"},[i("10. 接入企业内部 IM(可选) "),l("a",{class:"header-anchor",href:"#_10-接入企业内部-im-可选","aria-label":'Permalink to "10. 接入企业内部 IM(可选)"'},"")]),l("p",null,'流水线默认只把消息发回发起的对话。希望"需要你决定""开发中断""已完成"等时刻在企业 IM 中也收到时,需要自己实现一个通知模块(laoshi 不内置任何 IM):'),l("ol",null,[l("li",null,[l("p",null,[i("把程序目录中的 "),l("code",null,"notifiers/im-template.mjs"),i(" 复制到 "),l("code",null,"~/.laoshi/notifiers/im.mjs"),i(",按其中的 TODO 实现发送(通常是向 IM 机器人的 webhook 发一个 HTTP 请求)。口令放在环境变量中。")])]),l("li",null,[l("p",null,[i("在 "),l("code",null,"~/.laoshi/config.json"),i("(或团队配置)中加上:")]),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":"#032F62","--shiki-dark":"#9ECBFF"}},'"notifiers"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": [")]),i(`
|
|
18
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"module"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"~/.laoshi/notifiers/im.mjs"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"events"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": ["),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"blocked"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"failed"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"completed"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"], "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"options"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"webhook"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"https://…"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } }")]),i(`
|
|
19
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"]")])])])])]),l("li",null,[l("p",null,[i("运行 "),l("code",null,"laoshi notify-test"),i("(可加 "),l("code",null,"--type blocked"),i(" 等)发一条测试消息。")])])]),l("p",null,[i("事件的类型和字段见 "),l("a",{href:"./../reference/contracts/notifier-event"},"contracts/notifier-event.md"),i("。通知失败只记日志,不影响流水线。项目配置("),l("code",null,".laoshi.json"),i(")中的 "),l("code",null,"notifiers"),i(" 会被忽略。")]),l("h2",{id:"_11-paseo-的需求插件",tabindex:"-1"},[i("11. Paseo 的需求插件 "),l("a",{class:"header-anchor",href:"#_11-paseo-的需求插件","aria-label":'Permalink to "11. Paseo 的需求插件"'},"")]),l("p",null,[i("在 Paseo 界面里看需求总览、进度和文档的插件目前仍由 paseo-req-kit 提供("),l("code",null,"req plugin install"),i("),计划在 0.1.0 之后迁入 laoshi。")])],-1),l("p",{class:"source-note"},[i("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/安装与升级.md"},"docs/guide/安装与升级.md"),i(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/安装与升级.md"},"在 GitHub 上编辑")],-1)])])}const g=n(t,[["render",h]]);export{c as __pageData,g as default};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{_ as n,o as e,c as a,j as l,a as i}from"./chunks/framework.BetZR81g.js";const c=JSON.parse('{"title":"安装与升级","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/install.md","filePath":"guide/install.md","lastUpdated":null}'),t={name:"guide/install.md"};function h(d,s,o,u,r,k){return e(),a("div",null,[...s[0]||(s[0]=[l("div",null,[l("h1",{id:"安装与升级",tabindex:"-1"},[i("安装与升级 "),l("a",{class:"header-anchor",href:"#安装与升级","aria-label":'Permalink to "安装与升级"'},"")]),l("p",null,[i("本文面向负责安装的人:通常是开发同事,有经验的测试或产品同事也可以按步骤完成。每台机器只装一次(装在运行 agent 平台的那台机器上),之后这台机器上所有项目的对话都能使用 "),l("code",null,"/laoshi"),i("。")]),l("p",null,"laoshi 目前支持两个 agent 平台:"),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("a",{href:"https://paseo.sh",target:"_blank",rel:"noreferrer"},"Paseo"),i(" 0.11"),l("br"),l("code",null,"--platform paseo")]),l("td",null,"步骤 agent、工作区、服务、定时消息都由 Paseo daemon 提供")]),l("tr",null,[l("td",null,[i("DeepSeek Harness(dsh)"),l("br"),l("code",null,"--platform dsh")]),l("td",null,[i("步骤 agent 和定时消息由 laoshi 的 dsh 插件提供;工作区和服务用 laoshi 的内置实现("),l("code",null,"git worktree"),i("、"),l("code",null,".laoshi/services.json"),i(")")])])])]),l("h2",{id:"_1-安装布局",tabindex:"-1"},[i("1. 安装布局 "),l("a",{class:"header-anchor",href:"#_1-安装布局","aria-label":'Permalink to "1. 安装布局"'},"")]),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,"<npm 全局目录>/laoshi/ 程序(全局目录不可写时在 ~/.laoshi/npm 下)")]),i(`
|
|
2
|
-
`),l("span",{class:"line"},[l("span",null,"~/.laoshi/ 安装根(LAOSHI_HOME 可以换位置)")]),i(`
|
|
3
|
-
`),l("span",{class:"line"},[l("span",null,"├── config.json 安装级配置:平台、各角色的模型")]),i(`
|
|
4
|
-
`),l("span",{class:"line"},[l("span",null,"├── install.json 安装记录(--check、--uninstall 用)")]),i(`
|
|
5
|
-
`),l("span",{class:"line"},[l("span",null,"├── bin/laoshi(.cmd) laoshi 命令(不在 PATH 时用)")]),i(`
|
|
6
|
-
`),l("span",{class:"line"},[l("span",null,"├── prompts.local/ 本机提示词覆盖(可选)")]),i(`
|
|
7
|
-
`),l("span",{class:"line"},[l("span",null,"└── notifiers/ 外部通知模块(可选,见第 10 节)")]),i(`
|
|
8
|
-
`),l("span",{class:"line"},[l("span",null,"<skill 目录>/laoshi*/ 按平台渲染的 skill,带 .laoshi-install.json")])])])]),l("p",null,"skill 装到哪里由平台决定:"),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"平台"),l("th",null,"skill 目录")])]),l("tbody",null,[l("tr",null,[l("td",null,"Paseo"),l("td",null,[l("code",null,"~/.agents/skills"),i("(Codex、Pi、OpenCode 等读取),"),l("code",null,"~/.claude"),i(" 存在时还有 "),l("code",null,"~/.claude/skills")])]),l("tr",null,[l("td",null,"dsh"),l("td",null,[l("code",null,"$DSH_HOME/skills"),i("(默认 "),l("code",null,"~/.dsh/skills"),i(");dsh 插件装在 "),l("code",null,"$DSH_HOME/profiles/<profile>/node_modules/laoshi-dsh-plugin"),i(" 并挂载到 "),l("code",null,"cordis.patch.yml")])])])]),l("p",null,[l("code",null,"--target <目录>"),i(" 可以另外指定 skill 目录(可以写多次)。Windows 上 "),l("code",null,"~"),i(" 即 "),l("code",null,"%USERPROFILE%"),i("。安装器不使用符号链接,不需要管理员权限;在 Windows 上它只启动 "),l("code",null,"node"),i(" 和 "),l("code",null,"cmd.exe"),i(",不会启动 PowerShell。")]),l("h2",{id:"_2-前置条件",tabindex:"-1"},[i("2. 前置条件 "),l("a",{class:"header-anchor",href:"#_2-前置条件","aria-label":'Permalink to "2. 前置条件"'},"")]),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,"Node.js"),l("td",null,"22.19 或更新"),l("td",null,[l("code",null,"node -v")])]),l("tr",null,[l("td",null,"npm"),l("td",null,"Node.js 自带;公司网络用镜像(见第 3 节)"),l("td",null,[l("code",null,"npm -v")])]),l("tr",null,[l("td",null,"git"),l("td",null,"近期版本"),l("td",null,[l("code",null,"git --version")])]),l("tr",null,[l("td",null,"平台"),l("td",null,[i("Paseo 0.11 的 daemon 在运行;或已装好 dsh("),l("code",null,"dsh"),i(" 命令可用,或知道它的 "),l("code",null,"bin.js"),i(" 位置)")]),l("td",null,[i("Paseo:能在桌面端或 "),l("code",null,"http://localhost:6767/"),i(" 对话;dsh:能在网页端对话")])]),l("tr",null,[l("td",null,"模型"),l("td",null,"Paseo:Claude Code、Codex、OpenCode、Pi 至少一种已在 Paseo 中登录;dsh:对话用的模型能正常回答"),l("td",null,"用它开一个对话")])])]),l("h2",{id:"_3-首次安装",tabindex:"-1"},[i("3. 首次安装 "),l("a",{class:"header-anchor",href:"#_3-首次安装","aria-label":'Permalink to "3. 首次安装"'},"")]),l("p",null,[l("strong",null,"一步安装(推荐)。"),i(" 只需要 Node.js 和能访问的 npm 源:")]),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"}},"npx"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -y"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," @yiyi_zhang/laoshi@latest"),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("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 或 --platform paseo")])])])]),l("p",null,[i("它依次:检查 Node.js、npm 和 git;确定 npm 源;"),l("code",null,"npm install -g"),i(" 这个版本(全局目录不可写时装到 "),l("code",null,"~/.laoshi/npm"),i(",不需要 sudo);然后运行装好的那份程序的 "),l("code",null,"laoshi install"),i(",完成安装级配置、skill 和平台的设置。npx 的临时目录会被清理,所以安装记录和 skill 都指向 npm 装好的那份。再次运行就是升级。")]),l("p",null,[i("指定版本:"),l("code",null,"npx -y @yiyi_zhang/laoshi@0.1.1 install --platform dsh"),i("。")]),l("p",null,[l("strong",null,"公司内网(只有 npm 镜像)。"),i(" 加上镜像地址:")]),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"}},"npx"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," -y"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --registry=https://npm.example.internal/"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," @yiyi_zhang/laoshi@latest"),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("ul",null,[l("li",null,[i("镜像地址会"),l("strong",null,"保存为本机的 npm 源"),i("(屏幕上会写出原来的值),以后 "),l("code",null,"laoshi upgrade"),i(" 也从镜像取。只想这一次用镜像时加 "),l("code",null,"--no-save-registry"),i("。本机原本就配好了镜像时不用写 "),l("code",null,"--registry"),i("。")]),l("li",null,[i("镜像上还没有这个版本(同步有延迟)时会直接说明,稍后再运行,或请管理镜像的同事同步 "),l("code",null,"laoshi"),i("。")]),l("li",null,[i("文档:装好后运行 "),l("code",null,"laoshi docs"),i(",在本机打开和这个版本一致的文档站点,不需要外网。")])]),l("p",null,[l("strong",null,"完全离线(连 npm 镜像也没有)。"),i(" 用带依赖的离线安装包,步骤见"),l("a",{href:"./intranet"},"内网安装与验证"),i("。")]),l("p",null,[l("strong",null,"已经有程序目录时"),i("(git 克隆、解压的安装包):在程序目录中 "),l("code",null,"npm ci --omit=dev"),i(",再运行 "),l("code",null,"node bin/req.mjs install --platform <平台>"),i("。")]),l("h3",{id:"安装选项",tabindex:"-1"},[i("安装选项 "),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("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"--platform <paseo|dsh>")]),l("td",null,"装到哪个平台。第一次安装时要写,之后沿用安装记录;和已装的平台不一致时会停下")]),l("tr",null,[l("td",null,[l("code",null,"--home <目录>")]),l("td",null,[i("安装根,默认 "),l("code",null,"LAOSHI_HOME"),i(" 或 "),l("code",null,"~/.laoshi")])]),l("tr",null,[l("td",null,[l("code",null,"--target <目录>")]),l("td",null,"另外把 skill 装到这个目录")]),l("tr",null,[l("td",null,[l("code",null,"--force")]),l("td",null,"覆盖同名的、不是 laoshi 装的 skill(默认跳过并列出)")]),l("tr",null,[l("td",null,[l("code",null,"--check")]),l("td",null,[i("只检查,不改动(也可以用 "),l("code",null,"laoshi check"),i(")")])]),l("tr",null,[l("td",null,[l("code",null,"--dry-run")]),l("td",null,"演练:显示要做的事,不写文件")]),l("tr",null,[l("td",null,[l("code",null,"--uninstall")]),l("td",null,"卸载(见第 8 节)")]),l("tr",null,[l("td",null,[l("code",null,"--registry <地址>"),i("、"),l("code",null,"--no-save-registry")]),l("td",null,[i("只用于一步安装和 "),l("code",null,"laoshi upgrade"),i(":这次用的 npm 源,是否保存")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--dsh-home <目录>")]),l("td",null,[i("dsh 的数据目录,默认 "),l("code",null,"DSH_HOME"),i(" 或 "),l("code",null,"~/.dsh")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--profile <名称>")]),l("td",null,[i("插件装进哪个 profile,默认 "),l("code",null,"web")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--dsh-bin <路径>")]),l("td",null,[i("dsh 的 "),l("code",null,"bin.js"),i(","),l("code",null,"dsh"),i(" 不在 PATH 中时写;"),l("code",null,"dsh plugin add"),i(" 失败时安装器直接复制插件")])]),l("tr",null,[l("td",null,[i("dsh:"),l("code",null,"--approvals ask|allow")]),l("td",null,[i("步骤 agent 的审批请求:"),l("code",null,"ask"),i(" 交给人(默认),"),l("code",null,"allow"),i(" 直接批准一次")])])])]),l("p",null,[i("同名 skill 的处理:带 "),l("code",null,".laoshi-install.json"),i(" 标记的是 laoshi 装的,会被更新;paseo-req-kit 装的(带 "),l("code",null,".req-kit-install.json"),i(")和别人放的都不覆盖,安装器会列出它们,确认后再用 "),l("code",null,"--force"),i("。")]),l("h2",{id:"_4-配置模型",tabindex:"-1"},[i("4. 配置模型 "),l("a",{class:"header-anchor",href:"#_4-配置模型","aria-label":'Permalink to "4. 配置模型"'},"")]),l("p",null,[i("各角色(builder 实现、reviewer 评审等)用的模型写在 "),l("code",null,"~/.laoshi/config.json"),i(" 的 "),l("code",null,"agents"),i(" 中,项目的 "),l("code",null,".laoshi.json"),i(" 可以覆盖。写法因平台而异。")]),l("h3",{id:"paseo",tabindex:"-1"},[i("Paseo "),l("a",{class:"header-anchor",href:"#paseo","aria-label":'Permalink to "Paseo"'},"")]),l("p",null,[i("运行 "),l("code",null,"laoshi configure"),i("(逐项选择)或 "),l("code",null,"laoshi configure --auto"),i("(按推荐选好:两个不同厂商的模型分别做 builder 和 reviewer,都用免确认模式)。")]),l("p",null,[l("strong",null,"推荐引用 Paseo 的 agent profile。"),i(' 在 Paseo 的 设置 → 本机 → Agents → Agent profiles 中建好"实现""评审"等 profile,配置中只写名称,之后换模型只需在 Paseo 中改 profile:')]),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":"#032F62","--shiki-dark":"#9ECBFF"}},'"agents"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": {")]),i(`
|
|
9
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "builder"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"platformProfile"'),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"}}," },")]),i(`
|
|
10
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "reviewer"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"platformProfile"'),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"}}," }")]),i(`
|
|
11
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"}")])])])]),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,"provider")]),l("td",null,[l("code",null,"<Paseo 中的 provider ID>/<模型 ID>"),i(",只在第一个 "),l("code",null,"/"),i(" 处拆分")])]),l("tr",null,[l("td",null,[l("code",null,"modeId")]),l("td",null,"agent 的模式。必须选不会停下来等待批准的模式;没有模式的 agent 不写")]),l("tr",null,[l("td",null,[l("code",null,"featureValues")]),l("td",null,"agent 的功能开关,目前只有 OpenCode 需要")]),l("tr",null,[l("td",null,[l("code",null,"thinkingOptionId")]),l("td",null,"可选,思考强度")])])]),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"agent"),l("th",null,[l("code",null,"provider"),i(" 写法")]),l("th",null,"无人值守的设置")])]),l("tbody",null,[l("tr",null,[l("td",null,"Claude Code"),l("td",null,[l("code",null,"claude/<模型 ID>")]),l("td",null,[l("code",null,'"modeId": "bypassPermissions"')])]),l("tr",null,[l("td",null,"Codex"),l("td",null,[l("code",null,"codex/<模型 ID>")]),l("td",null,[l("code",null,'"modeId": "full-access"')])]),l("tr",null,[l("td",null,"OpenCode"),l("td",null,[l("code",null,"opencode/<上游>/<模型 ID>")]),l("td",null,[l("code",null,'"modeId": "build"'),i(" 加 "),l("code",null,'"featureValues": { "auto_accept": true }')])]),l("tr",null,[l("td",null,"Pi"),l("td",null,[l("code",null,"pi/<上游>/<模型 ID>")]),l("td",null,[i("不写 "),l("code",null,"modeId")])])])]),l("p",null,"聊天 agent(使用者对话的那一个)的用法:"),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"agent"),l("th",null,"如何触发")])]),l("tbody",null,[l("tr",null,[l("td",null,"Claude Code、OpenCode"),l("td",null,[l("code",null,"/laoshi 我想……")])]),l("tr",null,[l("td",null,"Pi"),l("td",null,[l("code",null,"/skill:laoshi 我想……")])]),l("tr",null,[l("td",null,"Codex"),l("td",null,'直接说"用 laoshi 帮我……"')])])]),l("p",null,"聊天 agent 需要能执行命令和访问本机网络(流水线要连接 daemon)。"),l("h3",{id:"dsh",tabindex:"-1"},[i("dsh "),l("a",{class:"header-anchor",href:"#dsh","aria-label":'Permalink to "dsh"'},"")]),l("p",null,[l("code",null,"provider"),i(" 写成 "),l("code",null,"<dsh 的提供方>/<模型>"),i(",这个角色的步骤就用它;"),l("code",null,"thinkingOptionId"),i(" 作为推理强度。"),l("code",null,"dsh/chat-model"),i(" 表示用对话的模型(安装器的默认值):")]),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":"#032F62","--shiki-dark":"#9ECBFF"}},'"agents"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": {")]),i(`
|
|
12
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "builder"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"dsh/chat-model"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," },")]),i(`
|
|
13
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},' "reviewer"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"deepseek/deepseek-reasoner"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"thinkingOptionId"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"high"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }")]),i(`
|
|
14
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"}")])])])]),l("p",null,[l("code",null,"laoshi doctor"),i(" 列出 dsh 中可用的模型并逐个角色检查。在 dsh 的对话里输入 "),l("code",null,"/laoshi 我想……"),i(" 开始;发起的对话由 dsh 提供的 "),l("code",null,"DSH_SESSION_ID"),i(" 识别。更多见"),l("a",{href:"./dsh"},"在 DeepSeek Harness 上使用"),i("。")]),l("h2",{id:"_5-体检和冒烟测试",tabindex:"-1"},[i("5. 体检和冒烟测试 "),l("a",{class:"header-anchor",href:"#_5-体检和冒烟测试","aria-label":'Permalink to "5. 体检和冒烟测试"'},"")]),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"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," doctor"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --no-project"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 安装、配置、平台、模型")]),i(`
|
|
15
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," doctor"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 在项目目录中:再检查这个项目")])])])]),l("p",null,[i("全部是 ✓ 或只有 ⚠ 即可继续,✗ 的项按提示处理。然后在一个测试项目中完整跑一遍:新开对话,输入 "),l("code",null,"/laoshi 在 README 末尾加一行版权声明"),i(",应走快速档,收到进展和完成通知,功能目录中各产物齐全,工作分支上有本地提交。")]),l("p",null,[i("Paseo 另有冒烟测试(在程序目录中运行):"),l("code",null,"npm run smoke -- check"),i(" 启动两个角色各一个小 agent,确认能写文件、能执行命令、不停下等权限。")]),l("h2",{id:"_6-升级和回退",tabindex:"-1"},[i("6. 升级和回退 "),l("a",{class:"header-anchor",href:"#_6-升级和回退","aria-label":'Permalink to "6. 升级和回退"'},"")]),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"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," upgrade"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 最新版本")]),i(`
|
|
16
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," upgrade"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," 0.1.0"),l("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # 指定版本(也用于回退到旧版本)")]),i(`
|
|
17
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," upgrade"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --registry"),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"}}," # 换 npm 源")])])])]),l("p",null,[i("它从 npm 装好新版本,再运行新版本的 "),l("code",null,"laoshi install"),i(",沿用安装记录中的平台和选项。配置、项目文件和功能目录不变。升级会原地替换程序文件,请在没有流水线运行时升级("),l("code",null,"laoshi list"),i(" 查看)。")]),l("p",null,[i("平台(Paseo、dsh)或 agent 升级之后,运行 "),l("code",null,"laoshi doctor"),i(" 确认版本在支持范围内、配置中的模型仍然存在。")]),l("h2",{id:"_7-和-paseo-req-kit-共存",tabindex:"-1"},[i("7. 和 paseo-req-kit 共存 "),l("a",{class:"header-anchor",href:"#_7-和-paseo-req-kit-共存","aria-label":'Permalink to "7. 和 paseo-req-kit 共存"'},"")]),l("p",null,"laoshi 是从 paseo-req-kit 抽出的平台无关版本,两者可以装在同一台机器上:"),l("ul",null,[l("li",null,[i("安装根不同("),l("code",null,"~/.laoshi"),i(" 和 "),l("code",null,"~/.req-kit"),i("),命令不同("),l("code",null,"laoshi"),i(" 和 "),l("code",null,"req"),i(";laoshi 也提供 "),l("code",null,"req"),i(" 别名,npm 全局安装时后装的那个生效)。")]),l("li",null,[i("只有 "),l("code",null,"~/.req-kit"),i(" 时,laoshi 会读取它;"),l("code",null,".requirement-pipeline.json"),i(" 也继续被读取,新项目用 "),l("code",null,".laoshi.json"),i("。")]),l("li",null,"同名 skill 不互相覆盖(见第 3 节)。")]),l("h2",{id:"_8-卸载",tabindex:"-1"},[i("8. 卸载 "),l("a",{class:"header-anchor",href:"#_8-卸载","aria-label":'Permalink to "8. 卸载"'},"")]),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"}},"laoshi"),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," install"),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --uninstall")])])])]),l("p",null,[i("删除 laoshi 装的 skill,dsh 上还会移除插件和 "),l("code",null,"cordis.patch.yml"),i(" 中的挂载。安装根("),l("code",null,"~/.laoshi"),i(")保留;确认不再使用后,"),l("code",null,"npm uninstall -g @yiyi_zhang/laoshi"),i(" 并手工删除 "),l("code",null,"~/.laoshi"),i("。各项目中的配置文件和功能目录保留,它们本身就是文档。")]),l("h2",{id:"_9-安全提示",tabindex:"-1"},[i("9. 安全提示 "),l("a",{class:"header-anchor",href:"#_9-安全提示","aria-label":'Permalink to "9. 安全提示"'},"")]),l("ul",null,[l("li",null,[i("步骤 agent 以免确认模式运行(dsh 上 "),l("code",null,"--approvals allow"),i(" 时同样),可以在本机执行命令。仓库和本机环境变量中不要放生产凭据;最好用专门的开发机或虚拟机。")]),l("li",null,"口令和密钥只放在环境变量中,不要写进配置文件。"),l("li",null,"流水线只做本地提交,合并和上线始终由人决定。")]),l("h2",{id:"_10-接入企业内部-im-可选",tabindex:"-1"},[i("10. 接入企业内部 IM(可选) "),l("a",{class:"header-anchor",href:"#_10-接入企业内部-im-可选","aria-label":'Permalink to "10. 接入企业内部 IM(可选)"'},"")]),l("p",null,'流水线默认只把消息发回发起的对话。希望"需要你决定""开发中断""已完成"等时刻在企业 IM 中也收到时,需要自己实现一个通知模块(laoshi 不内置任何 IM):'),l("ol",null,[l("li",null,[l("p",null,[i("把程序目录中的 "),l("code",null,"notifiers/im-template.mjs"),i(" 复制到 "),l("code",null,"~/.laoshi/notifiers/im.mjs"),i(",按其中的 TODO 实现发送(通常是向 IM 机器人的 webhook 发一个 HTTP 请求)。口令放在环境变量中。")])]),l("li",null,[l("p",null,[i("在 "),l("code",null,"~/.laoshi/config.json"),i("(或团队配置)中加上:")]),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":"#032F62","--shiki-dark":"#9ECBFF"}},'"notifiers"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": [")]),i(`
|
|
18
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"module"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"~/.laoshi/notifiers/im.mjs"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"events"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": ["),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"blocked"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"failed"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"completed"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"], "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"options"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),l("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"webhook"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),l("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"https://…"'),l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } }")]),i(`
|
|
19
|
-
`),l("span",{class:"line"},[l("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"]")])])])])]),l("li",null,[l("p",null,[i("运行 "),l("code",null,"laoshi notify-test"),i("(可加 "),l("code",null,"--type blocked"),i(" 等)发一条测试消息。")])])]),l("p",null,[i("事件的类型和字段见 "),l("a",{href:"./../reference/contracts/notifier-event"},"contracts/notifier-event.md"),i("。通知失败只记日志,不影响流水线。项目配置("),l("code",null,".laoshi.json"),i(")中的 "),l("code",null,"notifiers"),i(" 会被忽略。")]),l("h2",{id:"_11-paseo-的需求插件",tabindex:"-1"},[i("11. Paseo 的需求插件 "),l("a",{class:"header-anchor",href:"#_11-paseo-的需求插件","aria-label":'Permalink to "11. Paseo 的需求插件"'},"")]),l("p",null,[i("在 Paseo 界面里看需求总览、进度和文档的插件目前仍由 paseo-req-kit 提供("),l("code",null,"req plugin install"),i("),计划在 0.1.0 之后迁入 laoshi。")])],-1),l("p",{class:"source-note"},[i("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/guide/安装与升级.md"},"docs/guide/安装与升级.md"),i(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/docs/guide/安装与升级.md"},"在 GitHub 上编辑")],-1)])])}const g=n(t,[["render",h]]);export{c as __pageData,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as d,o,c as t,a2 as c}from"./chunks/framework.BetZR81g.js";const m=JSON.parse('{"title":"维护者指南","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/maintainer.md","filePath":"guide/maintainer.md","lastUpdated":null}'),a={name:"guide/maintainer.md"};function s(i,e,r,l,n,p){return o(),t("div",null,[...e[0]||(e[0]=[c('<div><h1 id="维护者指南" tabindex="-1">维护者指南 <a class="header-anchor" href="#维护者指南" aria-label="Permalink to "维护者指南""></a></h1><p>面向维护 laoshi 本身的人:改提示词和 skill、发布新版本、处理复盘提交的问题。</p><h2 id="_1-改动之前" tabindex="-1">1. 改动之前 <a class="header-anchor" href="#_1-改动之前" aria-label="Permalink to "1. 改动之前""></a></h2><ul><li>先看 <a href="./../reference/scope">SCOPE.md</a>:新提议须服务于"帮助非专职开发的同事把一个需求从对齐做到可验收",至少有两个真实场景,并且无法通过项目配置或项目说明解决。</li><li>改动已有的设计决定(<a href="./../reference/adr/">docs/adr/</a>)时,新增一条 ADR 说明理由,并在旧的一条中注明被哪条取代。</li><li>界面的颜色、字体、组件按 <code>design/</code>(设计规范,见其中的 README)来;改了 <code>design/tokens.json</code>、<code>design/reference/components.css</code> 或 <code>design/examples/icons.js</code>,运行 <code>node scripts/tokens-build.mjs</code> 更新审查网页里的副本。</li><li>改动文件格式(spec、状态文件、结果文件、决策记录等)时,同时更新 <a href="./../reference/contracts/">contracts/</a>、代码和测试;状态文件的格式变化要加迁移(见 <code>contracts/state.md</code>)。</li></ul><h2 id="_2-改-skill-和提示词的规则" tabindex="-1">2. 改 skill 和提示词的规则 <a class="header-anchor" href="#_2-改-skill-和提示词的规则" aria-label="Permalink to "2. 改 skill 和提示词的规则""></a></h2><ul><li><strong>入口不调用入口</strong>。<code>/laoshi</code>、<code>/laoshi-setup</code>、<code>/laoshi-doctor</code>、<code>/laoshi-retro</code> 之间只能"告诉用户去运行",不能互相加载。</li><li><strong>路径用占位符</strong>:skill 中引用安装目录内的文件写 <code>{{REQ_KIT_ROOT}}/...</code>,启动命令写 <code>{{PIPELINE_LAUNCHER}}</code>,版本号写 <code>{{REQ_KIT_VERSION}}</code>。安装器会替换它们;<code>npm test</code> 会检查引用的文件都存在。</li><li><strong>不写平台的名字</strong>:引擎、提示词和 skill 中和平台有关的说法写成 <code>{{platform.<词>}}</code>(见 <a href="./../reference/design/platform-vocabulary">platform-vocabulary</a>),整段不同的写成 <code>{{fragment.<名称>}}</code>,各平台的片段放在适配器里(如 <code>adapters/paseo/skill/setup.md</code>)。<code>npm test</code> 会检查这些目录中没有平台的名字;确实需要时在那一行写 <code>platform-name:</code> 说明理由。</li><li><strong>frontmatter</strong> 只用 <code>name</code>、<code>description</code>,agent 专属的放在 <code>metadata</code> 下;<code>description</code> 中不要出现半角的 <code>: </code>。</li><li><strong>手册</strong>(<code>skills/laoshi/playbooks/*.md</code>)开头必须有"## 步骤"编号列表,<code>/laoshi</code> 会把它原样放进待办列表;新增手册要加进 <code>/laoshi</code> 的路由表。</li><li><strong>原则</strong>:增加一条原则需要至少两次真实失误作为依据,并且无法用 CI 或配置解决;总数不超过 10 条。原则的一句话版本写进 <code>principles/INDEX.md</code>,它同时被聊天和每个步骤的提示词使用。</li><li><strong>措辞</strong>:读者是有技术背景、但不读代码的使用者(测试、产品、项目经理)。讲需求和结果,不讲代码实现。</li></ul><h2 id="_3-验证改动" tabindex="-1">3. 验证改动 <a class="header-anchor" href="#_3-验证改动" aria-label="Permalink to "3. 验证改动""></a></h2><table tabindex="0"><thead><tr><th>改了什么</th><th>至少要做</th></tr></thead><tbody><tr><td>引擎代码</td><td><code>npm test</code>、<code>npm run typecheck</code></td></tr><tr><td>步骤提示词</td><td>上面两项 + <code>npm run eval</code>(至少跑受影响的用例),与上一次的结果对比</td></tr><tr><td>入口、手册、方法 skill、原则</td><td><code>npm test</code> + 对话评估中受影响的剧本(<code>evals/conversation/</code>)</td></tr><tr><td>安装器</td><td><code>npm test</code>(在临时 HOME 中测试),并在 Windows 上实际装一次(只用 cmd 或 Git Bash)</td></tr><tr><td>评估用例</td><td><code>npm run eval:self-check</code>(参考实现必须通过隐藏验收)</td></tr><tr><td>平台适配器</td><td><code>npm test</code>;dsh 另跑端到端检查 <code>node adapters/dsh/e2e/run-e2e.mjs --worktree</code>(见 <a href="./dsh">adapters/dsh/README.md</a>);Paseo 另跑 <code>npm run smoke -- check</code></td></tr><tr><td>文档站点</td><td><code>cd site && npm ci && npm run build</code>(会检查站内链接)</td></tr></tbody></table><p>提示词改动以评估结果为准:如实率(不夸大)不能下降;隐藏验收通过率、用时、轮次与上一次对比,变差时说明原因。</p><h2 id="_4-发布" tabindex="-1">4. 发布 <a class="header-anchor" href="#_4-发布" aria-label="Permalink to "4. 发布""></a></h2><p>版本号遵循语义化版本,从 <code>0.1.0</code> 开始,标签<strong>不带 <code>v</code> 前缀</strong>(例如 <code>0.1.0</code>、<code>0.2.0-beta.1</code>)。laoshi 和 paseo-req-kit 一样通过 npm 分发:使用者用 <code>npx -y @yiyi_zhang/laoshi@latest install</code> 安装,用 <code>laoshi upgrade</code> 升级,内网通过公司的 npm 镜像取得。</p><p>开发中的版本号带 <code>-dev</code>(如 <code>0.2.0-dev</code>),不会被发布。发布一个版本:</p><ol><li>在 <code>CHANGELOG.md</code> 中把这一版写成 <code>## <版本> - <日期></code> 一节:使用者会看到的变化在前,升级须知单独列出。发布流程用这一节作为 GitHub Release 的正文,没有这一节时停下。</li><li>把 <code>package.json</code> 的 <code>version</code> 改成这个版本(去掉 <code>-dev</code>);平台支持范围有变化时同时更新 <code>reqKit.paseo</code>。</li><li>跑完第 3 节中受影响的验证,并在 Windows 上实际装一次(<code>node scripts/check-package.mjs</code> 检查装出来的包)。</li><li>合并到 <code>main</code>。<code>.github/workflows/release.yml</code> 发现这个版本号还没有标签,就在这个提交上跑测试(Linux 和 Windows)、类型检查、评估自检,把文档站点构建进包里(<code>site-dist/</code>,<code>laoshi docs</code> 离线可用),<code>npm pack</code> 后用 <code>scripts/check-package.mjs</code> 按使用者的方式安装检查,再做 Windows 离线安装包。全部通过后才打上同名标签(不带 <code>v</code>),发布到 npm(预发布版用 <code>beta</code> 标签,正式版用 <code>latest</code>),并建 GitHub Release,附上 <code>.tgz</code> 和离线安装包。测试没通过时不会留下标签,把修复合到 <code>main</code> 就会用同一个版本号重新发布。</li><li>发布后把 <code>version</code> 改回下一个开发版本(如 <code>0.2.0-dev</code>)。</li></ol><p>也可以自己推送标签(<code>git push origin 0.1.0</code>)触发;重新发布已有的标签:GitHub → Actions → release → Run workflow,填版本号。npm 上发布错的版本用 <code>npm deprecate</code> 标注(npm 不允许重新发布同一版本号)。</p><p><strong>npm 发布的一次性设置</strong>:</p><ol><li>包名是带作用域的 <code>@yiyi_zhang/laoshi</code>(<code>laoshi</code> 在 npm 上不能使用),作用域 <code>yiyi_zhang</code> 就是发布者的 npm 用户名。在 npmjs.com 上用这个账号建一个 Granular Access Token:权限 Read and write,Packages 选 All packages,并勾选 <strong>Bypass two-factor authentication</strong>(CI 里没法输入一次性验证码)。在 GitHub 仓库的 Settings → Secrets and variables → Actions 中新建 secret <code>NPM_TOKEN</code>,值为这个 token。不要把 token 写进任何文件或发给别人。</li><li>第一次发布成功后,在 npmjs.com 的 <code>@yiyi_zhang/laoshi</code> 包设置 → Trusted Publisher 中添加 GitHub Actions:仓库 <code>yiyisf/laoshi</code>,工作流 <code>release.yml</code>。之后发布不再需要 token,可以删除 <code>NPM_TOKEN</code>。</li><li>文档站点:Settings → Pages → Source 选 "Deploy from a branch",分支 <code>gh-pages</code>,目录 <code>/</code>(<code>.github/workflows/site.yml</code> 在 main 更新时发布)。</li></ol><p><strong>企业私有仓库</strong>:只代理 npmjs 的不用做什么。需要单独发布到内网仓库时,从 GitHub Release 下载 <code>laoshi-<版本>.tgz</code>(或 <code>npm pack</code> 得到 <code>yiyi_zhang-laoshi-<版本>.tgz</code>),执行 <code>npm publish <这个文件> --registry <内网地址> --tag <同名标签></code>。完全没有 npm 镜像的环境用 GitHub Release 上的离线安装包(<code>laoshi-<版本>-<提交>-win32-x64.zip</code>,也可以自己运行 <code>node scripts/pack-intranet.mjs</code>),见<a href="./intranet">内网安装与验证</a>。</p><p><strong>对外约定</strong>:通知事件(<code>contracts/notifier-event.md</code>)由各团队自己的 IM 模块读取,同一 <code>schema</code> 内只增加字段;<code>laoshi</code> 的子命令和参数会被写进各团队的使用说明,改名时保留旧名一个主版本(<code>req</code> 是 <code>laoshi</code> 的别名)。<code>laoshi api</code> 的输出(<code>contracts/cli-json.md</code>)是插件和脚本读取的格式,同一 <code>schema</code> 内只增加字段。</p><h2 id="_5-处理复盘提交的问题" tabindex="-1">5. 处理复盘提交的问题 <a class="header-anchor" href="#_5-处理复盘提交的问题" aria-label="Permalink to "5. 处理复盘提交的问题""></a></h2><p><code>/laoshi-retro</code> 会把 laoshi 本身的问题写成报告草稿交给用户。收到后:</p><ol><li>能复现的,先加一个评估用例或对话剧本,确认它在当前版本失败。</li><li>修改后跑同一个评估,确认修好,并且其他用例没有变差。</li><li>在 CHANGELOG 中记录。</li></ol><h2 id="_6-目录速查" tabindex="-1">6. 目录速查 <a class="header-anchor" href="#_6-目录速查" aria-label="Permalink to "6. 目录速查""></a></h2><table tabindex="0"><thead><tr><th>目录</th><th>内容</th></tr></thead><tbody><tr><td><code>skills/</code></td><td>安装到各平台的 skill(安装时按平台渲染):入口、手册、方法、原则</td></tr><tr><td><code>principles/INDEX.md</code></td><td>原则索引</td></tr><tr><td><code>engine/src/</code></td><td>引擎:启动器、主流程、配置、状态与迁移、体检、评估运行器</td></tr><tr><td><code>engine/prompts/</code></td><td>步骤提示词(含 <code>00-shared-context.md</code> 和评审小组成员的 <code>panel-member.md</code>)</td></tr><tr><td><code>engine/test/</code></td><td>引擎测试,<code>fake-runtime.ts</code> 是模拟的平台</td></tr><tr><td><code>engine/src/builtin/</code></td><td>内置能力:<code>git worktree</code> 工作区、服务管理(平台不提供时使用)</td></tr><tr><td><code>engine/skill-fragments/</code></td><td>skill 中各平台共用的内置片段</td></tr><tr><td><code>adapters/<平台>/</code></td><td>平台适配器:<code>adapter.ts</code>(能力和用词)、运行时、<code>install.mjs</code>(安装器的平台部分);dsh 另有插件 <code>plugin/</code> 和端到端检查 <code>e2e/</code></td></tr><tr><td><code>bin/</code></td><td><code>laoshi</code> 命令、安装器(<code>install.mjs</code>)、一步安装(<code>bootstrap.mjs</code>)、<code>laoshi docs</code></td></tr><tr><td><code>site/</code></td><td>文档站点(VitePress);<code>site/scripts/sync-docs.mjs</code> 把 <code>docs/guide</code>、<code>contracts</code> 等复制进站点</td></tr><tr><td><code>test/</code></td><td>安装器、体检、skill 的测试</td></tr><tr><td><code>evals/</code></td><td>评估:样例仓库、用例、对话剧本</td></tr><tr><td><code>contracts/</code></td><td>文件格式约定</td></tr><tr><td><code>docs/adr/</code></td><td>设计决定</td></tr><tr><td><code>design/</code></td><td>界面设计规范:tokens、品牌手册、各界面规范、组件、效果图</td></tr></tbody></table></div><p class="source-note">本页由仓库中的 <a href="https://github.com/yiyisf/laoshi/blob/main/docs/guide/维护者指南.md">docs/guide/维护者指南.md</a> 生成。<a href="https://github.com/yiyisf/laoshi/edit/main/docs/guide/维护者指南.md">在 GitHub 上编辑</a></p>',2)])])}const g=d(a,[["render",s]]);export{m as __pageData,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as d,o,c as t,a2 as c}from"./chunks/framework.BetZR81g.js";const m=JSON.parse('{"title":"维护者指南","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/maintainer.md","filePath":"guide/maintainer.md","lastUpdated":null}'),a={name:"guide/maintainer.md"};function s(i,e,r,l,n,p){return o(),t("div",null,[...e[0]||(e[0]=[c("",2)])])}const g=d(a,[["render",s]]);export{m as __pageData,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t,o as d,c as o,a2 as c}from"./chunks/framework.BetZR81g.js";const g=JSON.parse('{"title":"AgentRuntime:引擎对 agent 平台的要求","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"reference/contracts/agent-runtime.md","filePath":"reference/contracts/agent-runtime.md","lastUpdated":null}'),a={name:"reference/contracts/agent-runtime.md"};function r(i,e,n,l,s,u){return d(),o("div",null,[...e[0]||(e[0]=[c('<div><h1 id="agentruntime-引擎对-agent-平台的要求" tabindex="-1">AgentRuntime:引擎对 agent 平台的要求 <a class="header-anchor" href="#agentruntime-引擎对-agent-平台的要求" aria-label="Permalink to "AgentRuntime:引擎对 agent 平台的要求""></a></h1><p>引擎(<code>engine/src</code>)只通过 <code>AgentRuntime</code>(<code>engine/src/runtime.ts</code>)与 agent 平台打交道。Paseo 是目前唯一的实现(<code>engine/src/paseo-runtime.ts</code>),测试用 <code>REQ_PIPELINE_FAKE_RUNTIME</code> 指向的假实现(<code>engine/test/fake-runtime.ts</code>)。要让 req-kit(以及之后的 laoshi)运行在别的 agent 平台上,就是为那个平台写一个 <code>AgentRuntime</code>。</p><p>本文说明:每个方法属于哪一级、没有它时现在的行为、以及适配器应该怎么做。<code>runtime.ts</code> 里的类型和注释是字段定义的准确来源,本文不重复。</p><h2 id="级别" tabindex="-1">级别 <a class="header-anchor" href="#级别" aria-label="Permalink to "级别""></a></h2><ul><li><strong>必需</strong>:没有就不能运行流水线。适配器必须实现。</li><li><strong>可选</strong>:平台没有时返回 <code>null</code>(或抛出),引擎按"现状"一栏处理。</li><li><strong>按需</strong>:只有对应功能被使用时才会调用(卡片接单、需求总览、联合需求、<code>--worktree</code>)。</li></ul><p>"现状"一栏记录的是引擎今天的真实行为,不是理想行为。标了 ⚠ 的是降级不够平滑、适配器作者需要特别注意的地方。</p><h2 id="必需" tabindex="-1">必需 <a class="header-anchor" href="#必需" aria-label="Permalink to "必需""></a></h2><table tabindex="0"><thead><tr><th>方法</th><th>要求</th><th>备注</th></tr></thead><tbody><tr><td><code>verifyOrigin(agentId, cwd)</code></td><td>确认发起流水线的会话存在,且工作目录是 <code>cwd</code>;不满足时抛出面向用户的原因</td><td>步骤 agent 要挂在发起会话下,平台给子 agent 的工作目录必须与会话一致(见 ADR 0001)。没有"会话"概念的平台,应在适配器里自行定义"发起者"并让此方法恒通过</td></tr><tr><td><code>startAgent(input)</code></td><td>按 <code>role</code>、<code>prompt</code>、<code>cwd</code>、<code>labels</code>、<code>profile</code> 创建一个步骤 agent;<code>parentAgentId</code> 非空时挂在该会话下;<code>workspaceId</code> 非空时放进该工作区</td><td>返回 <code>StepAgent</code></td></tr><tr><td><code>StepAgent.wait(timeoutMs)</code></td><td>等待当前回合结束,最多 <code>timeoutMs</code>;遇到权限请求时提前返回</td><td>返回值的 <code>status</code> 为 <code>idle</code> / <code>error</code> / <code>permission</code> / <code>timeout</code>;<code>usage</code> 平台不报告时为 <code>null</code></td></tr><tr><td><code>StepAgent.followUp(text)</code></td><td>在同一会话里开始新回合</td><td>用于"结果文件缺失,请补写"</td></tr><tr><td><code>StepAgent.archive()</code></td><td>归档该 agent</td><td></td></tr><tr><td><code>attachAgent(agentId)</code></td><td>接上一个之前(可能由另一个流水线进程)启动的 agent</td><td>续跑、重新接着等用</td></tr><tr><td><code>notifyAgent(agentId, text)</code></td><td>向已有会话投递一条消息,不打断它</td><td>进展、需要决定的问题、结论都靠它发回会话。⚠ 没有等价能力的平台,至少要写通知文件让使用者看到</td></tr><tr><td><code>interruptAgent(agentId, text)</code></td><td>打断当前回合,改为处理 <code>text</code></td><td>用于停止一个步骤</td></tr><tr><td><code>close()</code></td><td>释放连接</td><td></td></tr></tbody></table><h2 id="可选" tabindex="-1">可选 <a class="header-anchor" href="#可选" aria-label="Permalink to "可选""></a></h2><table tabindex="0"><thead><tr><th>方法</th><th>平台没有时</th><th>现状</th></tr></thead><tbody><tr><td><code>listProfiles()</code>(req-kit 1.x 叫 <code>listPaseoProfiles</code>)</td><td>返回 <code>null</code></td><td>只影响用 <code>platformProfile</code>(旧名 <code>paseoProfile</code>)引用平台档案的配置:解析不了就拒绝启动并说明。只用 <code>provider/model</code> 直配时不调用</td></tr><tr><td><code>listServices(target)</code></td><td>返回 <code>null</code></td><td>流水线调用时都带 <code>.catch(() => null)</code>,<code>null</code> 表示"不由平台管理服务",改用 <code>verify.md</code> 里的手工启动命令</td></tr><tr><td><code>startServices(target, names, timeoutMs)</code>、<code>stopServices(...)</code></td><td>—</td><td>只在 <code>listServices</code> 返回名字后才调用;失败时按启动失败报告给步骤</td></tr><tr><td><code>providerQuota(providers)</code></td><td>返回 <code>null</code></td><td>额度提醒关闭,不影响运行(<code>.catch(() => null)</code>)</td></tr><tr><td><code>recentActivity(agentId, limit)</code></td><td>返回 <code>null</code></td><td>查看进度时不附"最近动作"(<code>.catch(() => null)</code>)</td></tr><tr><td><code>runningTool(agentId)</code></td><td>返回 <code>null</code></td><td>关闭"打断搜索大目录命令"(1.13)(<code>.catch(() => null)</code>)</td></tr><tr><td><code>capabilities()</code></td><td>返回 <code>null</code></td><td>当作"未知",不做依赖这些工具的假设(<code>.catch(() => null)</code>)</td></tr><tr><td><code>providerStatus()</code></td><td>返回 <code>null</code></td><td>只在接单器体检时用;<code>null</code> 不报问题</td></tr><tr><td><code>scheduleMessage(input)</code></td><td>返回 <code>null</code></td><td>⚠ 流水线内部(等待提醒、自动继续、定时检查、预约验证)拿到 <code>null</code> 就不预约;但 <code>launch.ts</code> 的"预约开始"在拿到 <code>null</code> 时<strong>直接失败</strong>并提示"到时再启动"。其他平台需要本机定时器或让使用者手动继续(见下文"调度")</td></tr><tr><td><code>cancelSchedule(id)</code></td><td>—</td><td>下一次运行和暂停命令会调用它取消状态文件里记录的预约</td></tr></tbody></table><h2 id="按需" tabindex="-1">按需 <a class="header-anchor" href="#按需" aria-label="Permalink to "按需""></a></h2><table tabindex="0"><thead><tr><th>方法</th><th>用在哪里</th><th>备注</th></tr></thead><tbody><tr><td><code>createWorktree(request)</code>、<code>waitForWorkspaceSetup(id, timeoutMs)</code></td><td><code>--worktree</code>(<code>worktree.ts</code>)和联合需求(<code>joint.ts</code>)</td><td>⚠ 创建失败是硬错误。没有平台工作区的适配器,可以在适配器内用 <code>git worktree</code> 实现并返回 <code>{ workspaceId, directory }</code>;<code>waitForWorkspaceSetup</code> 可恒返回 <code>{ status: "none" }</code></td></tr><tr><td><code>startSessionAgent(input)</code></td><td>从卡片接单(<code>card-cmd.ts</code>):为需求新开一个顶层会话</td><td>没有则不能用接单器</td></tr><tr><td><code>scheduleNewAgent(input)</code></td><td>需求总览的定时发送(<code>digest.ts --schedule</code>)</td><td>返回 <code>null</code> 时该功能关闭</td></tr><tr><td><code>answerPermission(agentId, requestId, approve, reason)</code></td><td><code>laoshi permission <需求> approve|deny</code>(<code>permission-cmd.ts</code>):平台的审批不能在它自己的界面里回答、由对话问人时,laoshi 转达人的决定;<code>requestId</code> 为 <code>null</code> 表示现在等待的那一个</td><td>没有时,审批按平台自己的方式处理(如 Paseo、dsh 的界面)</td></tr></tbody></table><p>适配器还可以声明 <code>runsInChat</code>(<code>PlatformAdapter</code>):平台只在对话的一个轮次内保留对话的机器时,引擎不能在后台运行,<code>launch.ts</code> 让它在对话的命令里运行,给对话的消息(<code>notifyAgent</code>)写进 <code>chat.log</code> 并显示在命令输出里。状态文件记下运行引擎的机器(<code>host</code>),另一台机器上记录的进程不算还在运行。</p><h2 id="调度" tabindex="-1">调度 <a class="header-anchor" href="#调度" aria-label="Permalink to "调度""></a></h2><p>引擎里所有"以后再做"(预约开始、等待提醒、限流后自动继续、定时检查、预约验证)都表达为:<strong>在某个时间,向发起会话投递一条写明步骤的消息</strong>(ADR 0020)。适配器实现 <code>scheduleMessage</code> 时有三种选择:</p><ol><li>平台有等价的定时任务 → 直接映射(Paseo 的做法)。</li><li>平台没有 → 适配器自己保存计划,由一个常驻的本机进程到点调用 <code>notifyAgent</code>。</li><li>都做不到 → 返回 <code>null</code>,让引擎按上表"现状"处理。</li></ol><h2 id="一致性要求" tabindex="-1">一致性要求 <a class="header-anchor" href="#一致性要求" aria-label="Permalink to "一致性要求""></a></h2><p>新适配器至少应满足:</p><ul><li>通过 <code>engine/test</code> 中使用 <code>fake-runtime.ts</code> 的编排测试所覆盖的行为约定(步骤顺序、续跑、重新接着等、结果文件追问、打断)。读 <code>fake-runtime.ts</code> 可以看到引擎对每个方法的真实期望。</li><li><code>StepAgent.wait</code> 返回 <code>permission</code> 时,<code>pendingPermissions</code> 非空且有可读的 <code>title</code>。</li><li>步骤 agent 的创建要保证产物写在 <code>cwd</code> 下(ADR 0001 的问题:有的平台在传了 parent 时会改用 parent 的目录)。</li><li>不要让某个可选方法抛出未捕获的异常来表示"不支持",除非上表标了 ⚠;用 <code>null</code>。</li></ul><h2 id="计划中的修订-adr-0008-提议" tabindex="-1">计划中的修订(ADR 0008,提议) <a class="header-anchor" href="#计划中的修订-adr-0008-提议" aria-label="Permalink to "计划中的修订(ADR 0008,提议)""></a></h2><p><a href="./../adr/0008-capability-sources-and-platform-plugin">ADR 0008</a> 定下了以下修订的方向,将与实现一起提交,本文暂不改动:能力标明来源(平台 / 插件 / 内置 / 降级);新增"回答待处理的请求"与审批策略;<code>listPaseoProfiles</code> 改名为 <code>listProfiles</code>;<code>attachAgent</code> 改为"恢复步骤会话";引入 agent 事件模型,由核心推导 <code>wait</code>、活动和用量;把对话相关的能力拆为"对话通道"。</p><h2 id="中性化-laoshi-m2a–m2e-已处理" tabindex="-1">中性化(laoshi M2a–M2e 已处理) <a class="header-anchor" href="#中性化-laoshi-m2a–m2e-已处理" aria-label="Permalink to "中性化(laoshi M2a–M2e 已处理)""></a></h2><p>req-kit 1.x 里带 Paseo 字样的地方,laoshi 中已改为中性的名称:</p><ul><li>方法与字段:<code>listPaseoProfiles</code> → <code>listProfiles</code>(M2a),<code>capabilities().paseoTools</code> → <code>platformTools</code>(M2e)。<code>ServiceTarget</code>、<code>ManagedService</code> 本来就是中性的名字,只改了注释。</li><li>状态文件字段:<code>originAgentId</code>、<code>worktree.workspaceId</code>、<code>schedules[]</code> 在第 2 版中改名(M2d,见 <code>state.md</code>);对外契约不变。</li><li>面向使用者的文案和提示词:改用适配器的词汇表(M2e,<code>engine/src/words.ts</code>,见 <a href="./../design/platform-vocabulary">platform-vocabulary</a>);<code>engine/prompts/paseo-services.md</code> 改名为 <code>managed-services.md</code>。</li><li>会话识别:由适配器声明环境变量(<code>originEnv</code>,M2a)。</li><li>配置:<code>AgentProfile.paseoProfile</code> → <code>platformProfile</code>,<code>paseoServices</code> → <code>platformServices</code>,旧名继续读取(M2e);daemon 地址可写在 <code>platform.paseo</code> 中(M2c)。</li></ul><p><code>engine/test/platform.test.ts</code> 检查核心代码和提示词里不出现平台名(有意保留的旧字段名、对外契约字段,在那一行或上一行写明 <code>platform-name:</code> 和原因)。</p></div><p class="source-note">本页由仓库中的 <a href="https://github.com/yiyisf/laoshi/blob/main/contracts/agent-runtime.md">contracts/agent-runtime.md</a> 生成。<a href="https://github.com/yiyisf/laoshi/edit/main/contracts/agent-runtime.md">在 GitHub 上编辑</a></p>',2)])])}const p=t(a,[["render",r]]);export{g as __pageData,p as default};
|
|
@@ -1 +0,0 @@
|
|
|
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}'),s={name:"reference/contracts/cli-json.md"};function i(o,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 范围")])]),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 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> <需求> [--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("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,"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(s,[["render",i]]);export{k as __pageData,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
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}'),s={name:"reference/contracts/cli-json.md"};function i(o,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 范围")])]),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 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> <需求> [--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("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,"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(s,[["render",i]]);export{k as __pageData,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as d,o,c as t,a2 as c}from"./chunks/framework.BetZR81g.js";const h=JSON.parse('{"title":"state.json","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"reference/contracts/state.md","filePath":"reference/contracts/state.md","lastUpdated":null}'),r={name:"reference/contracts/state.md"};function a(s,e,n,i,l,u){return o(),t("div",null,[...e[0]||(e[0]=[c('<div><h1 id="state-json" tabindex="-1">state.json <a class="header-anchor" href="#state-json" aria-label="Permalink to "state.json""></a></h1><p>流水线的运行状态,位于 <code>docs/features/<目录>/.pipeline/state.json</code>,只由引擎写入,不提交。</p><h2 id="当前格式-version-2-laoshi-m2d-起-req-kit-1-x-为-version-1-见文末-第-1-版到第-2-版" tabindex="-1">当前格式:version 2(laoshi M2d 起;req-kit 1.x 为 version 1,见文末"第 1 版到第 2 版") <a class="header-anchor" href="#当前格式-version-2-laoshi-m2d-起-req-kit-1-x-为-version-1-见文末-第-1-版到第-2-版" aria-label="Permalink to "当前格式:version 2(laoshi M2d 起;req-kit 1.x 为 version 1,见文末"第 1 版到第 2 版")""></a></h2><table tabindex="0"><thead><tr><th>字段</th><th>类型</th><th>含义</th></tr></thead><tbody><tr><td><code>version</code></td><td>number</td><td>格式版本。没有这个字段的文件按 1 处理</td></tr><tr><td><code>repo</code></td><td>string</td><td>仓库目录(绝对路径)</td></tr><tr><td><code>featureDir</code></td><td>string</td><td>功能目录(相对路径,<code>/</code> 分隔)</td></tr><tr><td><code>status</code></td><td><code>running</code> | <code>waiting_for_business</code> | <code>failed</code> | <code>completed</code> | <code>phase_done</code> | <code>waiting_for_approval</code></td><td>当前状态。<code>waiting_for_business</code> 表示等待需求方决定;<code>phase_done</code>(1.7.0 起)表示研发阶段已完成、停在闸口等待测试验证;<code>waiting_for_approval</code>(1.8.0 起)表示方案已通过审核、等待需求方确认 <code>preview.md</code>,<code>--approve</code> 继续。旧引擎把不认识的状态当作可以继续的中断:<code>phase_done</code> 继续时直接做验证,<code>waiting_for_approval</code> 继续时不经确认直接写代码</td></tr><tr><td><code>attempt</code></td><td>number</td><td>第几次从方案设计开始</td></tr><tr><td><code>specHash</code></td><td>string</td><td>启动时 spec.md 的 sha256</td></tr><tr><td><code>originSessionId</code></td><td>string | null</td><td>发起流水线的对话(会话),通知发往这里。第 1 版叫 <code>originAgentId</code></td></tr><tr><td><code>pid</code></td><td>number</td><td>流水线进程</td></tr><tr><td><code>startedAt</code> / <code>updatedAt</code></td><td>ISO 时间</td><td></td></tr><tr><td><code>results</code></td><td>object</td><td>已完成步骤的结果,键为步骤键(如 <code>code_review-r2</code>)</td></tr><tr><td><code>history</code></td><td>array</td><td>每次步骤执行的记录:agent、起止时间、结果、错误;<code>usage</code>(可选,1.3.0 起)为 agent 报告的用量:<code>inputTokens</code>、<code>cachedInputTokens</code>、<code>outputTokens</code>、<code>totalCostUsd</code>,agent 没有报告时为 null 或缺少;<code>leftRunning</code>(可选,1.11 起)为 true 表示失败时 agent 可能还在运行,下一次运行这一步时先看它;<code>reattached</code>(可选,1.11 起)为接着等上一次 agent 的次数</td></tr><tr><td><code>stopReason</code> / <code>outcome</code></td><td>string | null</td><td>停止原因;最终结论</td></tr><tr><td><code>stopKind</code></td><td>string | null</td><td>可选,1.12 起。停下等人的原因代码:必要的决定 <code>approval</code>(确认方案)、<code>phase_gate</code>(研发完成,等待测试)、<code>business</code>(需求方决定)、<code>reproduce</code>(缺陷复现不了);中断 <code>timeout</code>、<code>agent_error</code>、<code>invalid_result</code>、<code>transient</code>、<code>stopped</code>、<code>process_exit</code>、<code>budget</code>(1.13,用完 token 预算)、<code>other</code>。运行中或完成时为 null</td></tr><tr><td><code>budget</code></td><td>object</td><td>可选,1.13 起,配置了 <code>budget.tokens</code> 时。<code>{ allowance, warnedAt }</code>:停下前允许用到的 tokens(预算,每次用完后继续再加一份);已经提醒过的那一档</td></tr><tr><td><code>waitingPermission</code></td><td>object | null</td><td>可选,1.13 起。步骤 agent 在等权限批准时:<code>{ agentId, stepTitle, requests, since }</code>;没有在等时为 null</td></tr><tr><td><code>recoveries</code></td><td>array</td><td>可选,1.12 起。流水线自己处理掉的问题(最多保留 200 条):<code>at</code>、<code>key</code>(步骤键)、<code>kind</code>(<code>retry</code> 重试 / <code>reattach</code> 接着等上一次的 agent / <code>reuse_result</code> 沿用上一次 agent 的结果 / <code>extend_timeout</code> 超时后多等一轮 / <code>redo</code> 新开 agent 重做 / <code>fallback</code> 换备用模型 / <code>auto_resume</code> 预约自动继续 / <code>quota_wait</code> 预约在额度恢复后继续 / <code>self_answer</code> 方案审核的问题由 builder 自答 / <code>stop_scan</code> 打断了搜索大目录的命令,1.13 起)、<code>detail</code></td></tr><tr><td><code>dangers</code></td><td>array</td><td>可选,1.14 起。步骤 agent 运行(或开始运行)的危险命令(<code>dangerGuard</code>,最多保留 50 条):<code>at</code>、<code>key</code>(步骤键)、<code>stepTitle</code>、<code>command</code>、<code>label</code>(如"推送到远程仓库")、<code>ran</code>(发现时已经运行完为 true,正在运行、已打断为 false)、<code>agentId</code>、<code>callId</code>(同一个调用只处理一次)</td></tr><tr><td><code>secretScans</code></td><td>array</td><td>可选,1.14 起。改代码的步骤之后的密钥扫描(<code>secretScan</code>),每个步骤、每次尝试保留最新一次:<code>key</code>、<code>attempt</code>、<code>at</code>、<code>findings</code>(<code>{ file, line, commit, kind, preview }</code>,<code>preview</code> 里的值已遮住)、<code>fixRounds</code>、<code>passed</code></td></tr><tr><td><code>profile</code></td><td><code>quick</code> | <code>standard</code></td><td>档位</td></tr><tr><td><code>branch</code></td><td>string | null</td><td>工作分支,启动时确定</td></tr><tr><td><code>milestones</code></td><td>string[]</td><td>已发送的进展通知,续跑时不重复发送</td></tr><tr><td><code>incremental</code></td><td>object | null</td><td>可选,1.3.0 起。需求变更或回答问题后的继续:<code>fromAttempt</code>(接着哪一次)、<code>reason</code>、<code>baseCommit</code>(本次开始时的提交,评审看这之后的改动)、<code>hadImplementation</code>(上一次是否已写过代码)。第一次运行和 <code>--restart</code> 为 null</td></tr><tr><td><code>worktree</code></td><td>object | null</td><td>可选,1.5.0 起。用 <code>--worktree</code> 启动、在为需求新建的工作区中开发时:<code>workspaceRef</code>(平台对这个工作区的引用,由适配器解释;Paseo 为工作区 ID,laoshi 内置 worktree 为 <code>dir:<目录></code>。第 1 版叫 <code>workspaceId</code>)、<code>sourceRepo</code>(对话所在的目录)。此时 <code>repo</code> 是新工作区的目录</td></tr><tr><td><code>wakeups</code></td><td>array</td><td>可选。这次运行在平台上预约的唤醒(定时任务):<code>ref</code>(平台的定时任务 ID)、<code>kind</code>(<code>reminder</code> 提醒 / <code>auto-resume</code> 自动继续 / <code>watchdog</code> 定时检查)、<code>at</code>。下一次运行或暂停命令会取消它们。第 1 版叫 <code>schedules</code>,其中 <code>ref</code> 叫 <code>id</code></td></tr><tr><td><code>adapter</code></td><td>object | null</td><td>可选,第 2 版起。这次运行用的平台适配器:<code>id</code>(如 <code>paseo</code>、<code>dsh</code>),便于排查</td></tr><tr><td><code>mode</code></td><td><code>engine</code> | <code>chat</code></td><td>可选,第 2 版起。谁编排步骤:引擎(缺省)或对话(模式 B,见 docs/design/in-chat-orchestration.md)</td></tr><tr><td><code>stepRequest</code></td><td>object | null</td><td>可选,第 2 版起,只用于模式 B:<code>{ key, since }</code>,等待对话中的 agent 执行的步骤</td></tr><tr><td><code>autoResumes</code></td><td>object | null</td><td>可选,1.6.0 起。<code>attempt</code>、<code>count</code>:这次尝试已经预约过几次自动继续</td></tr><tr><td><code>queuedSince</code></td><td>string | null</td><td>可选,1.6.0 起。正在排队(<code>maxConcurrentPipelines</code>)时为开始排队的时间</td></tr><tr><td><code>phases</code></td><td>object | null</td><td>可选,1.7.0 起。这次运行的执行方式:<code>mode</code>(<code>continuous</code> / <code>gated</code> / <code>develop-only</code>)、<code>environment</code>(<code>local</code> / <code>deployed</code>)、<code>defects</code>(<code>fix</code> / <code>handback</code> / <code>report</code>)。没有时按 <code>continuous</code>、<code>local</code>、<code>fix</code> 处理</td></tr><tr><td><code>phase</code></td><td><code>develop</code> | <code>verify</code></td><td>可选,1.7.0 起。当前阶段。用字符串而不是编号,以后增加阶段不用改格式</td></tr><tr><td><code>verifyAt</code></td><td>string | null</td><td>可选,1.7.0 起。<code>--verify-at</code>:研发完成后在这个时间开始测试验证</td></tr><tr><td><code>handbacks</code></td><td>number</td><td>可选,1.7.0 起。测试验证把缺陷退回研发阶段的次数(<code>defects</code> 为 <code>handback</code>),上限为档位的 <code>defectFix</code> 轮数</td></tr><tr><td><code>type</code></td><td><code>defect</code> | <code>refactor</code> | <code>assessment</code> | null</td><td>可选,1.8.0 起。spec 中"类型"对应的做法;新需求、小改动和配置关掉的类型为 null</td></tr><tr><td><code>codeBase</code></td><td>object | null</td><td>可选,1.8.0 起。<code>attempt</code>、<code>commit</code>:这次尝试在改动任何代码之前的提交,质量门的基线和范围检查从这里比较。尝试开始时就已经写过代码的旧记录为 <code>commit: null</code></td></tr><tr><td><code>joint</code></td><td>array | null</td><td>可选,1.8.0 起。联合需求(spec 的 <code>- 联合开发:</code>)中其他仓库的工作区:<code>name</code>(<code>relatedRepos</code> 中的名称)、<code>slug</code>(步骤键的后缀,如 <code>implement@backend</code>)、<code>sourceRepo</code>(切出工作区的那份检出)、<code>repo</code>(工作区目录)、<code>workspaceRef</code>(第 1 版叫 <code>workspaceId</code>)、<code>branch</code>、<code>specHash</code>(最近一次同步过去的 spec),以及这个仓库自己的 <code>codeBase</code> 和 <code>gate</code>(格式同顶层)。见 ADR 0025</td></tr><tr><td><code>approval</code></td><td>object | null</td><td>可选,1.8.0 起。方案确认点:<code>attempt</code>(哪一次尝试的方案)、<code>status</code>(<code>waiting</code> / <code>approved</code>)、<code>at</code>。需求变更后的新尝试需要重新确认</td></tr><tr><td><code>external</code></td><td>object | null</td><td>可选,1.9.0 起。外部系统中的卡片,按集成名称:<code>id</code>(卡片编号)、<code>url</code>、<code>status</code>(最近设置的状态)、<code>syncedAt</code>、<code>pending</code>(没有成功、等待补发的调用:<code>action</code> 为 <code>create</code> / <code>status</code>、<code>event</code>、<code>status</code>、<code>at</code>、<code>attempts</code>、<code>error</code>)。见 ADR 0028</td></tr><tr><td><code>pushed</code></td><td>array | null</td><td>可选,1.10 起。从卡片开始、配置了 <code>push</code> 的需求推送过的分支,每个仓库一条(主仓库在前):<code>repo</code>、<code>remote</code>、<code>branch</code>、<code>at</code>、<code>error</code>(成功时为 null;1.14 起,发现疑似密钥时不推送,<code>error</code> 写明原因)。见 ADR 0029</td></tr><tr><td><code>gate</code></td><td>object | null</td><td>可选,1.8.0 起。质量门:<code>baseline</code>(<code>attempt</code>、<code>commit</code>、<code>at</code>、<code>results</code>:每项检查改动前 <code>pass</code> / <code>fail</code>),<code>runs</code>(每次运行:<code>key</code> 步骤键、<code>attempt</code>、<code>at</code>、<code>checks</code>(<code>name</code>、<code>result</code>:<code>pass</code> / <code>fail</code> / <code>skipped</code>、<code>failedBefore</code>)、<code>newFailures</code>、<code>fixRounds</code>、<code>passed</code>)。各次运行的完整输出在 <code>.pipeline/checks/<步骤键>/</code></td></tr></tbody></table><p><code>wakeups[].kind</code> 在 1.7.0 起还可能是 <code>verify-start</code>(<code>--verify-at</code> 预约的测试验证开始),1.8.0 起还可能是 <code>approval-continue</code>(方案确认超时后按方案继续,<code>designApproval.autoContinueHours</code>)。<code>history</code> 中每条步骤记录在 1.7.0 起有可选的 <code>phase</code>(<code>develop</code> / <code>verify</code>),用于按阶段统计用时与用量;没有时按研发阶段统计。</p><h2 id="迁移" tabindex="-1">迁移 <a class="header-anchor" href="#迁移" aria-label="Permalink to "迁移""></a></h2><p>只增加可选字段(缺少时按默认值处理,旧版本引擎读到也不出错)时不提升版本,以便回滚到旧版本后仍能继续已有的流水线;在上表中注明"可选"和起始版本即可。</p><p>引擎(<code>engine/src/state.ts</code>)中 <code>STATE_VERSION</code> 是当前版本,<code>STATE_MIGRATIONS[n]</code> 把第 n 版升级到第 n+1 版。增加必需字段或改变已有字段的含义时:</p><ol><li><code>STATE_VERSION</code> 加 1。</li><li>在 <code>STATE_MIGRATIONS</code> 中加一个从旧版本到新版本的函数,为旧文件补上默认值。</li><li>在 <code>engine/test/state.test.ts</code> 中加一条迁移测试,更新本文件。</li></ol><h2 id="第-1-版到第-2-版-laoshi-m2d" tabindex="-1">第 1 版到第 2 版(laoshi M2d) <a class="header-anchor" href="#第-1-版到第-2-版-laoshi-m2d" aria-label="Permalink to "第 1 版到第 2 版(laoshi M2d)""></a></h2><p>只改名,值不变,流程语义不变(<a href="https://github.com/yiyisf/laoshi/blob/main/docs/design/state-v2.md" target="_blank" rel="noreferrer">state-v2</a>):<code>originAgentId</code> → <code>originSessionId</code>,<code>worktree.workspaceId</code> → <code>worktree.workspaceRef</code>,<code>joint[].workspaceId</code> → <code>joint[].workspaceRef</code>,<code>schedules[]</code> → <code>wakeups[]</code>(<code>id</code> → <code>ref</code>);另加可选的 <code>adapter</code>、<code>mode</code>、<code>stepRequest</code>。</p><ul><li>读到第 1 版时自动迁移并写回,原文件保留为 <code>state.json.bak-v1</code>。</li><li>文件属于一条<strong>还在运行</strong>的流水线(<code>status</code> 为 <code>running</code>,进程仍在,且不是当前进程)时,只在内存中迁移,不改写它的文件:那个进程(可能是 req-kit 1.x)还在按自己的格式写。它结束后,下一次读取时再迁移。</li><li>迁移是单向的:req-kit 1.x 读到第 2 版会拒绝运行。回滚时把 <code>state.json.bak-v1</code> 恢复为 <code>state.json</code>,再改用 1.x。</li><li>对外契约不随之改名(ADR 0004):<code>req api</code>(<a href="./cli-json">cli-json.md</a>)、通知事件(<a href="./notifier-event">notifier-event.md</a>)、使用记录与需求索引(<a href="./usage-record">usage-record.md</a>)仍为 <code>schema: 1</code>,仍输出 <code>originAgentId</code>、<code>workspaceId</code>,值取自 <code>originSessionId</code>、<code>workspaceRef</code>。</li></ul></div><p class="source-note">本页由仓库中的 <a href="https://github.com/yiyisf/laoshi/blob/main/contracts/state.md">contracts/state.md</a> 生成。<a href="https://github.com/yiyisf/laoshi/edit/main/contracts/state.md">在 GitHub 上编辑</a></p>',2)])])}const m=d(r,[["render",a]]);export{h as __pageData,m as default};
|