@yiyi_zhang/laoshi 0.2.0-beta.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +3 -2
- package/adapters/dsh/adapter.ts +22 -1
- package/adapters/dsh/dsh-runtime.ts +14 -3
- package/adapters/dsh/install.mjs +16 -4
- package/adapters/dsh/plugin/index.mjs +197 -18
- package/adapters/dsh/plugin/package.json +1 -1
- package/adapters/mogao/adapter.ts +10 -1
- package/adapters/mogao/mogao-runtime.ts +58 -23
- package/adapters/mogao/skill/setup.md +6 -0
- package/adapters/paseo/install.mjs +13 -4
- package/adapters/paseo/plugin/client/data.ts +13 -2
- package/adapters/paseo/plugin/client/detail.tsx +244 -4
- package/adapters/paseo/plugin/client/format.ts +25 -117
- package/adapters/paseo/plugin/client/overview.tsx +3 -3
- package/adapters/paseo/plugin/index.server.ts +2 -1
- package/adapters/paseo/plugin/package.json +1 -1
- package/adapters/paseo/plugin/paseo-plugin.json +1 -1
- package/adapters/paseo/plugin/server/handlers.ts +22 -4
- package/adapters/paseo/plugin/server/req.ts +17 -4
- package/adapters/paseo/plugin/shared/contracts.ts +28 -2
- package/adapters/paseo/plugin/shared/view-model.ts +425 -0
- package/bin/ensure-version.mjs +60 -0
- package/bin/req-doctor.mjs +5 -0
- package/bin/req.mjs +18 -0
- package/bin/start-pipeline.mjs +5 -0
- package/contracts/cli-json.md +3 -1
- package/docs/design/builtin-capabilities.md +2 -2
- package/docs/design/cli-adapter.md +1 -1
- package/docs/design/dsh-adapter.md +11 -11
- package/docs/design/shared-ui.md +43 -0
- package/docs/guide//345/234/250/346/221/270/351/253/230/344/270/212/344/275/277/347/224/250.md +2 -1
- package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +13 -8
- package/docs/guide//347/234/237/345/256/236/347/216/257/345/242/203/350/265/260/346/237/245.md +78 -0
- package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +36 -6
- package/engine/prompts/00-shared-context.md +7 -0
- package/engine/prompts/03-design.md +2 -0
- package/engine/prompts/04-design-review.md +5 -1
- package/engine/skill-fragments/defaults.md +5 -0
- package/engine/src/api.ts +11 -2
- package/engine/src/board.ts +435 -0
- package/engine/src/config.ts +23 -0
- package/engine/src/diagnose.ts +238 -0
- package/engine/src/doctor.ts +25 -0
- package/engine/src/estimate.ts +11 -0
- package/engine/src/extensions.ts +271 -0
- package/engine/src/handover-cmd.ts +47 -0
- package/engine/src/handover.ts +89 -0
- package/engine/src/history.ts +102 -0
- package/engine/src/joint.ts +49 -4
- package/engine/src/launch.ts +20 -5
- package/engine/src/main.ts +1 -1
- package/engine/src/messages.ts +58 -0
- package/engine/src/pipeline.ts +121 -5
- package/engine/src/platform.ts +6 -0
- package/engine/src/reply.ts +27 -6
- package/engine/src/semver.ts +21 -0
- package/engine/src/skills-render.ts +10 -1
- package/package.json +5 -2
- package/site-dist/404.html +2 -2
- package/site-dist/assets/{app.CXydUhZx.js → app.DZpVs0VH.js} +1 -1
- package/site-dist/assets/changelog.md.CdUYbro4.js +1 -0
- package/site-dist/assets/{changelog.md.BU-CvyJ1.lean.js → changelog.md.CdUYbro4.lean.js} +1 -1
- package/site-dist/assets/chunks/@localSearchIndexroot.CHr-ITwS.js +1 -0
- package/site-dist/assets/chunks/{VPLocalSearchBox.CIjDV0ax.js → VPLocalSearchBox.BHkmziy1.js} +1 -1
- package/site-dist/assets/chunks/{theme.CWtC1Kby.js → theme.BsPChbDE.js} +2 -2
- package/site-dist/assets/guide_dsh.md.D0XhcUHz.js +7 -0
- package/site-dist/assets/guide_dsh.md.D0XhcUHz.lean.js +7 -0
- package/site-dist/assets/{guide_getting-started.md.BxOxfic_.js → guide_getting-started.md.BDd3nU5n.js} +1 -1
- package/site-dist/assets/{guide_install.md.By4WxsJG.js → guide_install.md.SsIHMfUu.js} +7 -5
- package/site-dist/assets/{guide_install.md.By4WxsJG.lean.js → guide_install.md.SsIHMfUu.lean.js} +7 -5
- package/site-dist/assets/guide_maintainer.md.CvqvRle1.js +1 -0
- package/site-dist/assets/guide_maintainer.md.CvqvRle1.lean.js +1 -0
- package/site-dist/assets/{guide_mogao.md.S0eln1Pr.js → guide_mogao.md.TCu3lgE9.js} +2 -2
- package/site-dist/assets/{guide_mogao.md.S0eln1Pr.lean.js → guide_mogao.md.TCu3lgE9.lean.js} +2 -2
- package/site-dist/assets/guide_walkthrough.md.nj_PWP9Y.js +5 -0
- package/site-dist/assets/guide_walkthrough.md.nj_PWP9Y.lean.js +5 -0
- package/site-dist/assets/reference_contracts_cli-json.md.3iU9h4rw.js +1 -0
- package/site-dist/assets/reference_contracts_cli-json.md.3iU9h4rw.lean.js +1 -0
- package/site-dist/assets/{reference_design_builtin-capabilities.md.CZYtjo_v.js → reference_design_builtin-capabilities.md.k5NXkESv.js} +2 -2
- package/site-dist/assets/{reference_design_builtin-capabilities.md.CZYtjo_v.lean.js → reference_design_builtin-capabilities.md.k5NXkESv.lean.js} +2 -2
- package/site-dist/assets/{reference_design_cli-adapter.md.pJy3x6Un.js → reference_design_cli-adapter.md.C1lcDATP.js} +1 -1
- package/site-dist/assets/{reference_design_cli-adapter.md.pJy3x6Un.lean.js → reference_design_cli-adapter.md.C1lcDATP.lean.js} +1 -1
- package/site-dist/changelog.html +5 -5
- package/site-dist/guide/cli.html +4 -4
- package/site-dist/guide/dsh.html +8 -6
- 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 +11 -9
- package/site-dist/guide/intranet.html +4 -4
- package/site-dist/guide/maintainer.html +5 -5
- package/site-dist/guide/mogao.html +7 -7
- package/site-dist/guide/phases.html +4 -4
- package/site-dist/guide/project.html +4 -4
- package/site-dist/guide/user.html +4 -4
- package/site-dist/guide/walkthrough.html +34 -0
- 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 +4 -4
- 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 +4 -4
- package/site-dist/reference/contracts/notifier-event.html +4 -4
- 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 +4 -4
- package/site-dist/reference/contracts/usage-record.html +4 -4
- package/site-dist/reference/contracts/verify.html +4 -4
- package/site-dist/reference/design/adapter-guide.html +4 -4
- package/site-dist/reference/design/architecture.html +4 -4
- package/site-dist/reference/design/builtin-capabilities.html +6 -6
- package/site-dist/reference/design/cli-adapter.html +5 -5
- package/site-dist/reference/design/platform-vocabulary.html +4 -4
- package/site-dist/reference/scope.html +4 -4
- package/skills/laoshi/SKILL.md +1 -3
- package/skills/laoshi-setup/SKILL.md +1 -1
- package/ui/shared/view-model.ts +424 -0
- package/ui/web/board.ts +1126 -0
- package/site-dist/assets/changelog.md.BU-CvyJ1.js +0 -1
- package/site-dist/assets/chunks/@localSearchIndexroot.CfgJeQRO.js +0 -1
- package/site-dist/assets/guide_dsh.md.0X-eYB87.js +0 -5
- package/site-dist/assets/guide_dsh.md.0X-eYB87.lean.js +0 -5
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.js +0 -1
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.lean.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.lean.js +0 -1
- /package/site-dist/assets/{guide_getting-started.md.BxOxfic_.lean.js → guide_getting-started.md.BDd3nU5n.lean.js} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{_ as e,o as a,c as t,j as i,a as s}from"./chunks/framework.BetZR81g.js";const E=JSON.parse('{"title":"dsh 适配器(M4b 原型)","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/dsh.md","filePath":"guide/dsh.md","lastUpdated":null}'),h={name:"guide/dsh.md"};function n(d,l,k,r,p,o){return a(),t("div",null,[...l[0]||(l[0]=[i("div",null,[i("h1",{id:"dsh-适配器-m4b-原型",tabindex:"-1"},[s("dsh 适配器(M4b 原型) "),i("a",{class:"header-anchor",href:"#dsh-适配器-m4b-原型","aria-label":'Permalink to "dsh 适配器(M4b 原型)"'},"")]),i("p",null,[s("让 laoshi 运行在 DeepSeek Harness(dsh)上。设计见 "),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/dsh-adapter.md",target:"_blank",rel:"noreferrer"},"dsh-adapter"),s(",决定见 "),i("a",{href:"./../reference/adr/0008-capability-sources-and-platform-plugin"},"ADR 0008"),s(",摸底结果见 "),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/discovery/dsh/report.md",target:"_blank",rel:"noreferrer"},"dsh 摸底报告"),s("。")]),i("h2",{id:"组成",tabindex:"-1"},[s("组成 "),i("a",{class:"header-anchor",href:"#组成","aria-label":'Permalink to "组成"'},"")]),i("table",{tabindex:"0"},[i("thead",null,[i("tr",null,[i("th",null,"部分"),i("th",null,"位置"),i("th",null,"做什么")])]),i("tbody",null,[i("tr",null,[i("td",null,"插件"),i("td",null,[i("code",null,"plugin/"),s("(npm 包 "),i("code",null,"laoshi-dsh-plugin"),s(")")]),i("td",null,"运行在 dsh host 里:在对话下创建步骤 agent、向对话发定时消息、按策略回答步骤的审批请求,并把会话的创建、发送消息、取消、状态、历史转给 dsh 的会话控制器。不含流程逻辑")]),i("tr",null,[i("td",null,"运行时"),i("td",null,[i("code",null,"dsh-runtime.ts")]),i("td",null,[s("引擎一侧的 "),i("code",null,"AgentRuntime"),s(" 实现,只通过插件做事,不调用 dsh 的 "),i("code",null,"/api")])]),i("tr",null,[i("td",null,"本地通道"),i("td",null,[i("code",null,"plugin/channel.mjs")]),i("td",null,[s("两边共用的约定:插件在 "),i("code",null,"$DSH_HOME/laoshi/"),s(" 下监听本地 socket(Windows 上是命名管道),并写一个随机令牌,只有同一用户能读到,调用时必须带上")])]),i("tr",null,[i("td",null,"测试"),i("td",null,[i("code",null,"test/")]),i("td",null,[s("插件配上模拟的 dsh 服务,运行时通过真实的 socket 调用插件;属于 "),i("code",null,"npm test")])]),i("tr",null,[i("td",null,"端到端检查"),i("td",null,[i("code",null,"e2e/")]),i("td",null,[s("在真实的 dsh 上跑一条完整的流水线,只有模型是模拟的;需要装好 dsh,不属于 "),i("code",null,"npm test")])])])]),i("h2",{id:"使用",tabindex:"-1"},[s("使用 "),i("a",{class:"header-anchor",href:"#使用","aria-label":'Permalink to "使用"'},"")]),i("blockquote",null,[i("p",null,[s("内网(Windows,无 PowerShell)安装与验证见 "),i("a",{href:"./intranet"},"docs/intranet/install-verify.md"),s(":"),i("code",null,"intranet/install.mjs"),s(" 一次完成配置、插件安装与挂载、skill 渲染;"),i("code",null,"intranet/make-sample.mjs"),s(" 生成验证用的样例项目;安装包由 "),i("code",null,"scripts/pack-intranet.mjs"),s(" 生成(带 Windows 依赖,内网不需要 npm 源)。")])]),i("ol",null,[i("li",null,[i("p",null,"把插件装进 dsh 的 profile,并挂载:"),i("div",{class:"language-sh vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"sh"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"dsh"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," plugin"),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --profile"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," web"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," add"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," file:"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"<"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"laosh"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"i"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"/adapters/dsh/plugin")])])])]),i("p",null,[s("在 "),i("code",null,"$DSH_HOME/profiles/web/cordis.patch.yml"),s(" 末尾加上:")]),i("div",{class:"language-yaml vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"yaml"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"- "),i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"insert"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},":")]),s(`
|
|
2
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," - "),i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"id"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"laoshi-dsh")]),s(`
|
|
3
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}}," name"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"'laoshi-dsh-plugin'")]),s(`
|
|
4
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}}," config"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},":")]),s(`
|
|
5
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}}," approvals"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"ask"),i("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # ask:步骤的审批请求交给人(默认);allow:直接批准一次")])])])])]),i("li",null,[i("p",null,"laoshi 的配置里选择 dsh 适配器:"),i("div",{class:"language-json vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"json"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"platform"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"adapter"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"dsh"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } }")])])])])]),i("li",null,[i("p",null,[s("选择各角色的模型(可选,M4b):agent 的 "),i("code",null,"provider"),s(" 写成 "),i("code",null,"<dsh 的提供方>/<模型>"),s("(如 "),i("code",null,"deepseek/deepseek-reasoner"),s("),这个角色的步骤就用它;"),i("code",null,"thinkingOptionId"),s(" 作为推理强度。写 "),i("code",null,"dsh/chat-model"),s(" 时用对话的模型(安装脚本的默认值)。"),i("code",null,"laoshi doctor"),s(" 列出 dsh 中可用的模型,并逐个角色检查。")]),i("div",{class:"language-json vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"json"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"agents"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"builder"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"dsh/chat-model"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }, "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"reviewer"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"deepseek/deepseek-reasoner"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"thinkingOptionId"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"high"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } } }")])])])])]),i("li",null,[i("p",null,[s("在 dsh 的对话里发起流水线。引擎从 "),i("code",null,"DSH_SESSION_ID"),s(" 识别发起的对话,从 "),i("code",null,"DSH_HOME"),s(" 找到插件。对话的 shell 运行在会话目录中,所以仓库目录就是当前目录。")])])]),i("h2",{id:"原型的范围",tabindex:"-1"},[s("原型的范围 "),i("a",{class:"header-anchor",href:"#原型的范围","aria-label":'Permalink to "原型的范围"'},"")]),i("p",null,[s("已实现:"),i("code",null,"AgentRuntime"),s(" 的全部必需能力(核对发起的对话,创建、等待、追问、打断步骤 agent,续接,向对话发消息),以及定时消息和取消、审批(等人时 "),i("code",null,"wait"),s(" 返回 "),i("code",null,"permission"),s(")、工具调用记录(危险命令拦截、大目录搜索打断、最近活动)、用量。M2b 起,在新建的工作区中开发("),i("code",null,"--worktree"),s(")和由 laoshi 管理的服务使用 laoshi 的内置实现("),i("code",null,"git worktree"),s(",以及 "),i("code",null,".laoshi/services.json"),s(" 中定义的服务,见 "),i("a",{href:"./../reference/design/builtin-capabilities"},"builtin-capabilities"),s(")。")]),i("p",null,"还没有实现:"),i("table",{tabindex:"0"},[i("thead",null,[i("tr",null,[i("th",null,"能力"),i("th",null,"现在的行为"),i("th",null,"计划")])]),i("tbody",null,[i("tr",null,[i("td",null,"联合需求(几个仓库各建工作区)"),i("td",null,"用内置 worktree,单元测试覆盖了新建工作区,但还没有端到端检查"),i("td",null,"—")]),i("tr",null,[i("td",null,[s("定时任务的截止时间("),i("code",null,"expiresAt"),s(")")]),i("td",null,"忽略,在日志里说明"),i("td",null,"—")]),i("tr",null,[i("td",null,"额度、profile、provider 状态"),i("td",null,[s("返回 "),i("code",null,"null")]),i("td",null,"—")]),i("tr",null,[i("td",null,"Windows"),i("td",null,[s("运行时和插件按 Windows 写好(命名管道),但没有在 Windows 上跑过端到端检查;dsh 在 Windows 上的 shell 见"),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/discovery/dsh/report.md#%E5%86%85%E7%BD%91-windows-%E8%87%AA%E6%B5%8B%E7%BB%93%E6%9E%9C2026-10-30",target:"_blank",rel:"noreferrer"},"摸底报告")]),i("td",null,"内网验证")])])]),i("h2",{id:"端到端检查",tabindex:"-1"},[s("端到端检查 "),i("a",{class:"header-anchor",href:"#端到端检查","aria-label":'Permalink to "端到端检查"'},"")]),i("div",{class:"language-sh vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"sh"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"LAOSHI_E2E_DSH"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"=<"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"装有"),i("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," @deepseek-ai/dsh"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," 的目"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"录"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," node"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/dsh/e2e/run-e2e.mjs"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," [--out "),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"<"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"目"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"录"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"]"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," [--worktree]")])])])]),i("p",null,[s("加 "),i("code",null,"--worktree"),s(" 时,样例仓库在 main 上,带一个服务和一条准备命令("),i("code",null,".laoshi/services.json"),s(")。脚本通过启动器加 "),i("code",null,"--worktree"),s(" 启动流水线,额外检查以下几项:需求的工作区是安装目录下的 "),i("code",null,"git worktree"),s(";准备命令已运行;步骤 agent 在工作区中工作;验证前内置服务已启动并通过健康检查;流水线结束后服务已停止。")]),i("p",null,[s("脚本会做这些事:建一个独立的 "),i("code",null,"DSH_HOME"),s(",装上插件,用 "),i("code",null,"e2e/step-model.mjs"),s(" 模拟模型,启动 dsh;建一个对话;在对话里用 quick 档跑一条流水线;最后检查结果并写出 "),i("code",null,"report.md"),s("。")]),i("p",null,'模拟模型对每个步骤,通过 dsh 的 bash 工具写出产出文件和合格的结果文件,所以这个检查验证的是"引擎 → 插件 → dsh 子 agent → 文件 → 引擎"整条链路是否接通,不代表模型的能力。'),i("p",null,[s("最近一次结果(2026-11-01,Linux,dsh 0.2.2-alpha.2):不加参数时 8 项检查全部通过(M4b 时 Node 24.22 和 22.20 各跑一次,M2b 时 Node 24.22);加 "),i("code",null,"--worktree"),s(" 时 14 项全部通过(M2b,Node 24.22)。7 个步骤(方案设计 → 方案审核 → 代码实现 → 代码评审 → 提测说明 → 功能验证 → 完成报告)都以带标签的子 agent 挂在对话下,流水线状态为 "),i("code",null,"completed"),s(",进展和结束通知都发回了对话。")])],-1),i("p",{class:"source-note"},[s("本页由仓库中的 "),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/adapters/dsh/README.md"},"adapters/dsh/README.md"),s(" 生成。"),i("a",{href:"https://github.com/yiyisf/laoshi/edit/main/adapters/dsh/README.md"},"在 GitHub 上编辑")],-1)])])}const c=e(h,[["render",n]]);export{E as __pageData,c as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{_ as e,o as a,c as t,j as i,a as s}from"./chunks/framework.BetZR81g.js";const E=JSON.parse('{"title":"dsh 适配器(M4b 原型)","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"guide/dsh.md","filePath":"guide/dsh.md","lastUpdated":null}'),h={name:"guide/dsh.md"};function n(d,l,k,r,p,o){return a(),t("div",null,[...l[0]||(l[0]=[i("div",null,[i("h1",{id:"dsh-适配器-m4b-原型",tabindex:"-1"},[s("dsh 适配器(M4b 原型) "),i("a",{class:"header-anchor",href:"#dsh-适配器-m4b-原型","aria-label":'Permalink to "dsh 适配器(M4b 原型)"'},"")]),i("p",null,[s("让 laoshi 运行在 DeepSeek Harness(dsh)上。设计见 "),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/design/dsh-adapter.md",target:"_blank",rel:"noreferrer"},"dsh-adapter"),s(",决定见 "),i("a",{href:"./../reference/adr/0008-capability-sources-and-platform-plugin"},"ADR 0008"),s(",摸底结果见 "),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/discovery/dsh/report.md",target:"_blank",rel:"noreferrer"},"dsh 摸底报告"),s("。")]),i("h2",{id:"组成",tabindex:"-1"},[s("组成 "),i("a",{class:"header-anchor",href:"#组成","aria-label":'Permalink to "组成"'},"")]),i("table",{tabindex:"0"},[i("thead",null,[i("tr",null,[i("th",null,"部分"),i("th",null,"位置"),i("th",null,"做什么")])]),i("tbody",null,[i("tr",null,[i("td",null,"插件"),i("td",null,[i("code",null,"plugin/"),s("(npm 包 "),i("code",null,"laoshi-dsh-plugin"),s(")")]),i("td",null,"运行在 dsh host 里:在对话下创建步骤 agent、向对话发定时消息、按策略回答步骤的审批请求,并把会话的创建、发送消息、取消、状态、历史转给 dsh 的会话控制器。不含流程逻辑")]),i("tr",null,[i("td",null,"运行时"),i("td",null,[i("code",null,"dsh-runtime.ts")]),i("td",null,[s("引擎一侧的 "),i("code",null,"AgentRuntime"),s(" 实现,只通过插件做事,不调用 dsh 的 "),i("code",null,"/api")])]),i("tr",null,[i("td",null,"本地通道"),i("td",null,[i("code",null,"plugin/channel.mjs")]),i("td",null,[s("两边共用的约定:插件在 "),i("code",null,"$DSH_HOME/laoshi/"),s(" 下监听本地 socket(Windows 上是命名管道),并写一个随机令牌,只有同一用户能读到,调用时必须带上")])]),i("tr",null,[i("td",null,"测试"),i("td",null,[i("code",null,"test/")]),i("td",null,[s("插件配上模拟的 dsh 服务,运行时通过真实的 socket 调用插件;属于 "),i("code",null,"npm test")])]),i("tr",null,[i("td",null,"端到端检查"),i("td",null,[i("code",null,"e2e/")]),i("td",null,[s("在真实的 dsh 上跑一条完整的流水线,只有模型是模拟的;需要装好 dsh,不属于 "),i("code",null,"npm test")])])])]),i("h2",{id:"使用",tabindex:"-1"},[s("使用 "),i("a",{class:"header-anchor",href:"#使用","aria-label":'Permalink to "使用"'},"")]),i("blockquote",null,[i("p",null,[s("内网(Windows,无 PowerShell)安装与验证见 "),i("a",{href:"./intranet"},"docs/intranet/install-verify.md"),s(":"),i("code",null,"intranet/install.mjs"),s(" 一次完成配置、插件安装与挂载、skill 渲染;"),i("code",null,"intranet/make-sample.mjs"),s(" 生成验证用的样例项目;安装包由 "),i("code",null,"scripts/pack-intranet.mjs"),s(" 生成(带 Windows 依赖,内网不需要 npm 源)。")])]),i("ol",null,[i("li",null,[i("p",null,"把插件装进 dsh 的 profile,并挂载:"),i("div",{class:"language-sh vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"sh"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}},"dsh"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," plugin"),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}}," --profile"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," web"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," add"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," file:"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"<"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"laosh"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"i"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"/adapters/dsh/plugin")])])])]),i("p",null,[s("在 "),i("code",null,"$DSH_HOME/profiles/web/cordis.patch.yml"),s(" 末尾加上:")]),i("div",{class:"language-yaml vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"yaml"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"- "),i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"insert"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},":")]),s(`
|
|
2
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," - "),i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"id"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"laoshi-dsh")]),s(`
|
|
3
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}}," name"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"'laoshi-dsh-plugin'")]),s(`
|
|
4
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}}," config"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},":")]),s(`
|
|
5
|
-
`),i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}}," approvals"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"ask"),i("span",{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"}}," # ask:步骤的审批请求交给人(默认);allow:直接批准一次")])])])])]),i("li",null,[i("p",null,"laoshi 的配置里选择 dsh 适配器:"),i("div",{class:"language-json vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"json"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"platform"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"adapter"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"dsh"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } }")])])])])]),i("li",null,[i("p",null,[s("选择各角色的模型(可选,M4b):agent 的 "),i("code",null,"provider"),s(" 写成 "),i("code",null,"<dsh 的提供方>/<模型>"),s("(如 "),i("code",null,"deepseek/deepseek-reasoner"),s("),这个角色的步骤就用它;"),i("code",null,"thinkingOptionId"),s(" 作为推理强度。写 "),i("code",null,"dsh/chat-model"),s(" 时用对话的模型(安装脚本的默认值)。"),i("code",null,"laoshi doctor"),s(" 列出 dsh 中可用的模型,并逐个角色检查。")]),i("div",{class:"language-json vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"json"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"{ "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"agents"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"builder"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"dsh/chat-model"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," }, "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"reviewer"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": { "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"provider"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"deepseek/deepseek-reasoner"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},", "),i("span",{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"}},'"thinkingOptionId"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},": "),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"high"'),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," } } }")])])])])]),i("li",null,[i("p",null,[s("在 dsh 的对话里发起流水线。引擎从 "),i("code",null,"DSH_SESSION_ID"),s(" 识别发起的对话,从 "),i("code",null,"DSH_HOME"),s(" 找到插件。对话的 shell 运行在会话目录中,所以仓库目录就是当前目录。")])])]),i("h2",{id:"原型的范围",tabindex:"-1"},[s("原型的范围 "),i("a",{class:"header-anchor",href:"#原型的范围","aria-label":'Permalink to "原型的范围"'},"")]),i("p",null,[s("已实现:"),i("code",null,"AgentRuntime"),s(" 的全部必需能力(核对发起的对话,创建、等待、追问、打断步骤 agent,续接,向对话发消息),以及定时消息和取消、审批(等人时 "),i("code",null,"wait"),s(" 返回 "),i("code",null,"permission"),s(")、工具调用记录(危险命令拦截、大目录搜索打断、最近活动)、用量。M2b 起,在新建的工作区中开发("),i("code",null,"--worktree"),s(")和由 laoshi 管理的服务使用 laoshi 的内置实现("),i("code",null,"git worktree"),s(",以及 "),i("code",null,".laoshi/services.json"),s(" 中定义的服务,见 "),i("a",{href:"./../reference/design/builtin-capabilities"},"builtin-capabilities"),s(")。")]),i("p",null,"还没有实现:"),i("table",{tabindex:"0"},[i("thead",null,[i("tr",null,[i("th",null,"能力"),i("th",null,"现在的行为"),i("th",null,"计划")])]),i("tbody",null,[i("tr",null,[i("td",null,"联合需求(几个仓库各建工作区)"),i("td",null,"用内置 worktree,单元测试覆盖了新建工作区,但还没有端到端检查"),i("td",null,"—")]),i("tr",null,[i("td",null,[s("定时任务的截止时间("),i("code",null,"expiresAt"),s(")")]),i("td",null,"忽略,在日志里说明"),i("td",null,"—")]),i("tr",null,[i("td",null,"额度、profile、provider 状态"),i("td",null,[s("返回 "),i("code",null,"null")]),i("td",null,"—")]),i("tr",null,[i("td",null,"Windows"),i("td",null,[s("运行时和插件按 Windows 写好(命名管道),但没有在 Windows 上跑过端到端检查;dsh 在 Windows 上的 shell 见"),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/docs/discovery/dsh/report.md#%E5%86%85%E7%BD%91-windows-%E8%87%AA%E6%B5%8B%E7%BB%93%E6%9E%9C2026-10-30",target:"_blank",rel:"noreferrer"},"摸底报告")]),i("td",null,"内网验证")])])]),i("h2",{id:"端到端检查",tabindex:"-1"},[s("端到端检查 "),i("a",{class:"header-anchor",href:"#端到端检查","aria-label":'Permalink to "端到端检查"'},"")]),i("div",{class:"language-sh vp-adaptive-theme"},[i("button",{title:"Copy Code",class:"copy"}),i("span",{class:"lang"},"sh"),i("pre",{class:"shiki shiki-themes github-light github-dark vp-code",tabindex:"0","v-pre":""},[i("code",null,[i("span",{class:"line"},[i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"LAOSHI_E2E_DSH"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"=<"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"装有"),i("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," @deepseek-ai/dsh"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," 的目"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"录"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," node"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," adapters/dsh/e2e/run-e2e.mjs"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," [--out "),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},"<"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"目"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"录"),i("span",{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"}},">"),i("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},"]"),i("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," [--worktree]")])])])]),i("p",null,[s("加 "),i("code",null,"--worktree"),s(" 时,样例仓库在 main 上,带一个服务和一条准备命令("),i("code",null,".laoshi/services.json"),s(")。脚本通过启动器加 "),i("code",null,"--worktree"),s(" 启动流水线,额外检查以下几项:需求的工作区是安装目录下的 "),i("code",null,"git worktree"),s(";准备命令已运行;步骤 agent 在工作区中工作;验证前内置服务已启动并通过健康检查;流水线结束后服务已停止。")]),i("p",null,[s("脚本会做这些事:建一个独立的 "),i("code",null,"DSH_HOME"),s(",装上插件,用 "),i("code",null,"e2e/step-model.mjs"),s(" 模拟模型,启动 dsh;建一个对话;在对话里用 quick 档跑一条流水线;最后检查结果并写出 "),i("code",null,"report.md"),s("。")]),i("p",null,'模拟模型对每个步骤,通过 dsh 的 bash 工具写出产出文件和合格的结果文件,所以这个检查验证的是"引擎 → 插件 → dsh 子 agent → 文件 → 引擎"整条链路是否接通,不代表模型的能力。'),i("p",null,[s("最近一次结果(2026-11-01,Linux,dsh 0.2.2-alpha.2):不加参数时 8 项检查全部通过(M4b 时 Node 24.22 和 22.20 各跑一次,M2b 时 Node 24.22);加 "),i("code",null,"--worktree"),s(" 时 14 项全部通过(M2b,Node 24.22)。7 个步骤(方案设计 → 方案审核 → 代码实现 → 代码评审 → 提测说明 → 功能验证 → 完成报告)都以带标签的子 agent 挂在对话下,流水线状态为 "),i("code",null,"completed"),s(",进展和结束通知都发回了对话。")])],-1),i("p",{class:"source-note"},[s("本页由仓库中的 "),i("a",{href:"https://github.com/yiyisf/laoshi/blob/main/adapters/dsh/README.md"},"adapters/dsh/README.md"),s(" 生成。"),i("a",{href:"https://github.com/yiyisf/laoshi/edit/main/adapters/dsh/README.md"},"在 GitHub 上编辑")],-1)])])}const c=e(h,[["render",n]]);export{E as __pageData,c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as o,o as d,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,n,l,p){return d(),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>adapters/dsh/plugin/package.json</code> 和 <code>index.mjs</code> 的 <code>VERSION</code>、<code>adapters/paseo/plugin/package.json</code>,测试会检查 Paseo 插件);平台支持范围有变化时同时更新 <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></ol><p><strong>发布到 npm 失败时</strong>:GitHub Release 和其中的 <code>.tgz</code> 照常生成,只有 npm 那一步失败。日志里是 <code>E401</code>、<code>E403</code>、<code>ENEEDAUTH</code>、<code>E404</code> 的,检查 token 或 Trusted Publisher 设置;是 <code>TLOG_CREATE_ENTRY_ERROR ... (500)</code> 的,是 sigstore 写入来源证明时出错,与设置无关,过一段时间在 Actions → release → Run workflow 填同一个版本重跑。一直失败、又急着发布时,重跑时取消勾选 <code>provenance</code>,这一次不带来源证明发布(npm 上这个版本不显示来源证明)。 3. 文档站点:Settings → Pages → Source 选 "Deploy from a branch",分支 <code>gh-pages</code>,目录 <code>/</code>(<code>.github/workflows/site.yml</code> 在 main 更新时发布)。</p><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>;Paseo 另有需求插件 <code>plugin/</code>(<code>laoshi plugin</code>)和迁移 <code>migrate.ts</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=o(a,[["render",s]]);export{m as __pageData,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as o,o as d,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,n,l,p){return d(),t("div",null,[...e[0]||(e[0]=[c("",2)])])}const g=o(a,[["render",s]]);export{m 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 范围(字段名沿用 1.x,只对 Paseo 有意义,其他平台为 null 或忽略)")])]),l("tr",null,[l("td",null,[l("code",null,"req api list [--repo <目录>]")]),l("td",null,'这个仓库所有工作区中的需求,数组,每项见下面的"需求"')]),l("tr",null,[l("td",null,[l("code",null,"req api list --all")]),l("td",null,[e("本机记录过的所有需求("),l("a",{href:"./usage-record"},"需求索引"),e("),同上;目录已不在的 "),l("code",null,"present: false"),e("。1.14 起还包括:用 "),l("code",null,"--track"),e(" 登记、还在对齐中的需求("),l("code",null,"stage"),e(' 为"对齐中",没有 '),l("code",null,"spec.md"),e(" 时 "),l("code",null,"title"),e(" 取自 "),l("code",null,"alignment.md"),e("),以及索引里出现过的项目中没登记的需求")])]),l("tr",null,[l("td",null,[l("code",null,"req api status <需求> [--repo <目录>]")]),l("td",null,'一个需求的详情,见下面的"详情"')]),l("tr",null,[l("td",null,[l("code",null,"req api 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,"startedBy")]),l("td",null,[e("laoshi 起。发起人:状态文件的 "),l("code",null,"startedBy"),e(";还没运行过、或状态文件是更早的版本时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"repo")]),l("td",null,"需求所在的目录(有自己的工作区时是那个工作区)")]),l("tr",null,[l("td",null,[l("code",null,"sourceRepo"),e(" / "),l("code",null,"workspaceId")]),l("td",null,"有自己的工作区时:对话所在的目录、平台对这个工作区的引用(Paseo 上是工作区 ID);否则 null")]),l("tr",null,[l("td",null,[l("code",null,"featureDir"),e(" / "),l("code",null,"name"),e(" / "),l("code",null,"title")]),l("td",null,"功能目录、目录名、需求标题")]),l("tr",null,[l("td",null,[l("code",null,"type"),e(" / "),l("code",null,"profile"),e(" / "),l("code",null,"branch")]),l("td",null,[e("需求类型("),l("code",null,"defect"),e("、"),l("code",null,"refactor"),e("、"),l("code",null,"assessment"),e(" 或 null)、档位、分支")])]),l("tr",null,[l("td",null,[l("code",null,"stage")]),l("td",null,[e("与 "),l("code",null,"req list"),e(' 相同的阶段说明,如"开发中""等待确认方案""待验收"')])]),l("tr",null,[l("td",null,[l("code",null,"status")]),l("td",null,[e("状态文件的 "),l("code",null,"status"),e(";还没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"running")]),l("td",null,"后台进程是否在运行")]),l("tr",null,[l("td",null,[l("code",null,"phase")]),l("td",null,[l("code",null,"develop"),e(" / "),l("code",null,"verify")])]),l("tr",null,[l("td",null,[l("code",null,"attention")]),l("td",null,[e("需要人处理的事:"),l("code",null,"approval"),e("(确认方案)、"),l("code",null,"business"),e("(需求方决定)、"),l("code",null,"permission"),e("(1.13,步骤在等权限批准;"),l("code",null,"waiting.questions"),e(" 是要批准的操作,"),l("code",null,"waiting.agentId"),e(" 是那个 agent)、"),l("code",null,"interrupted"),e("(中断,可以继续)、"),l("code",null,"not_completed"),e("(结束但未完成)、"),l("code",null,"not_started"),e("(1.14,需求说明已确认超过 30 分钟、或已为它建好工作区,但流水线没有运行过);没有为 null")])]),l("tr",null,[l("td",null,[l("code",null,"waiting")]),l("td",null,[e("1.12 起。"),l("code",null,"attention"),e(" 不为 null 时:"),l("code",null,"since"),e("(从什么时候开始等)、"),l("code",null,"questions"),e("(需求方要回答的问题)、"),l("code",null,"reason"),e("(停止原因)、"),l("code",null,"card"),e("("),l("code",null,"{ system, id, url, requester }"),e(",从卡片开始的需求)、"),l("code",null,"canReply"),e("(能否用 "),l("code",null,"req api run reply <需求> <回复>"),e(" 把回复转给需求的对话)、"),l("code",null,"canStart"),e("(1.14,"),l("code",null,"not_started"),e(" 时为 true:可以用 "),l("code",null,"req api run start <需求>"),e(" 开始开发);否则为 null")])]),l("tr",null,[l("td",null,[l("code",null,"current")]),l("td",null,[e("正在运行的步骤 "),l("code",null,"[{ key, title, agentId }]")])]),l("tr",null,[l("td",null,[l("code",null,"updatedAt")]),l("td",null,"最近一次变化的时间")]),l("tr",null,[l("td",null,[l("code",null,"usage")]),l("td",null,[l("code",null,"{ steps, agentMinutes, inputTokens, outputTokens, costUsd }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"present")]),l("td",null,"目录是否还在")]),l("tr",null,[l("td",null,[l("code",null,"hasPrototype")]),l("td",null,[e("1.13 起。功能目录中有界面原型("),l("code",null,"prototype/"),e("),可以用原型审查页查看")])])])]),l("h2",{id:"详情-status",tabindex:"-1"},[e("详情("),l("code",null,"status"),e(") "),l("a",{class:"header-anchor",href:"#详情-status","aria-label":'Permalink to "详情(`status`)"'},"")]),l("p",null,'"需求"的全部字段,另加:'),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"含义")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"files")]),l("td",null,[e("功能目录中存在的、可以用 "),l("code",null,"req api file"),e(" 读取的文件")])]),l("tr",null,[l("td",null,[l("code",null,"run")]),l("td",null,[l("code",null,"{ attempt, startedAt, updatedAt, pid, phaseMode, stopReason, outcome, queuedSince, verifyAt, approval, originAgentId }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"steps")]),l("td",null,[e("每个步骤一项:"),l("code",null,"{ key, stepId, title, phase, attempt, round, agentId, startedAt, endedAt, minutes, outcome, result, error, usage }"),e(";"),l("code",null,"title"),e(' 是给人看的名称(如"代码评审(第 2 轮)"),'),l("code",null,"result"),e(' 是结论的文字(如"需要修改")')])]),l("tr",null,[l("td",null,[l("code",null,"gate")]),l("td",null,[e("质量门:状态文件中的 "),l("code",null,"gate")])]),l("tr",null,[l("td",null,[l("code",null,"estimate")]),l("td",null,[e("1.13 起。"),l("code",null,"{ basis, profile, typicalAgentMinutes, typicalTokens, usedAgentMinutes, usedTokens, leftMinutes, over }"),e(":按本机已完成的同档位需求(至少 3 个)的中位数估算;数据不够或已完成时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"joint")]),l("td",null,[e("联合需求的其他仓库:"),l("code",null,"[{ name, slug, repo, sourceRepo, branch, workspaceId, gate }]")])]),l("tr",null,[l("td",null,[l("code",null,"external")]),l("td",null,[e("外部系统中的卡片(1.9.0 起):"),l("code",null,"[{ name, id, url, status, syncedAt, pending, lastError }]"),e(";"),l("code",null,"pending"),e(" 是等待补发的调用数")])])])])],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/contracts/cli-json.md"},"contracts/cli-json.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/contracts/cli-json.md"},"在 GitHub 上编辑")],-1)])])}const g=t(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 范围(字段名沿用 1.x,只对 Paseo 有意义,其他平台为 null 或忽略)")])]),l("tr",null,[l("td",null,[l("code",null,"req api list [--repo <目录>]")]),l("td",null,'这个仓库所有工作区中的需求,数组,每项见下面的"需求"')]),l("tr",null,[l("td",null,[l("code",null,"req api list --all")]),l("td",null,[e("本机记录过的所有需求("),l("a",{href:"./usage-record"},"需求索引"),e("),同上;目录已不在的 "),l("code",null,"present: false"),e("。1.14 起还包括:用 "),l("code",null,"--track"),e(" 登记、还在对齐中的需求("),l("code",null,"stage"),e(' 为"对齐中",没有 '),l("code",null,"spec.md"),e(" 时 "),l("code",null,"title"),e(" 取自 "),l("code",null,"alignment.md"),e("),以及索引里出现过的项目中没登记的需求")])]),l("tr",null,[l("td",null,[l("code",null,"req api status <需求> [--repo <目录>]")]),l("td",null,'一个需求的详情,见下面的"详情"')]),l("tr",null,[l("td",null,[l("code",null,"req api 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,"startedBy")]),l("td",null,[e("laoshi 起。发起人:状态文件的 "),l("code",null,"startedBy"),e(";还没运行过、或状态文件是更早的版本时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"repo")]),l("td",null,"需求所在的目录(有自己的工作区时是那个工作区)")]),l("tr",null,[l("td",null,[l("code",null,"sourceRepo"),e(" / "),l("code",null,"workspaceId")]),l("td",null,"有自己的工作区时:对话所在的目录、平台对这个工作区的引用(Paseo 上是工作区 ID);否则 null")]),l("tr",null,[l("td",null,[l("code",null,"featureDir"),e(" / "),l("code",null,"name"),e(" / "),l("code",null,"title")]),l("td",null,"功能目录、目录名、需求标题")]),l("tr",null,[l("td",null,[l("code",null,"type"),e(" / "),l("code",null,"profile"),e(" / "),l("code",null,"branch")]),l("td",null,[e("需求类型("),l("code",null,"defect"),e("、"),l("code",null,"refactor"),e("、"),l("code",null,"assessment"),e(" 或 null)、档位、分支")])]),l("tr",null,[l("td",null,[l("code",null,"stage")]),l("td",null,[e("与 "),l("code",null,"req list"),e(' 相同的阶段说明,如"开发中""等待确认方案""待验收"')])]),l("tr",null,[l("td",null,[l("code",null,"status")]),l("td",null,[e("状态文件的 "),l("code",null,"status"),e(";还没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"running")]),l("td",null,"后台进程是否在运行")]),l("tr",null,[l("td",null,[l("code",null,"phase")]),l("td",null,[l("code",null,"develop"),e(" / "),l("code",null,"verify")])]),l("tr",null,[l("td",null,[l("code",null,"attention")]),l("td",null,[e("需要人处理的事:"),l("code",null,"approval"),e("(确认方案)、"),l("code",null,"business"),e("(需求方决定)、"),l("code",null,"permission"),e("(1.13,步骤在等权限批准;"),l("code",null,"waiting.questions"),e(" 是要批准的操作,"),l("code",null,"waiting.agentId"),e(" 是那个 agent)、"),l("code",null,"interrupted"),e("(中断,可以继续)、"),l("code",null,"not_completed"),e("(结束但未完成)、"),l("code",null,"not_started"),e("(1.14,需求说明已确认超过 30 分钟、或已为它建好工作区,但流水线没有运行过);没有为 null")])]),l("tr",null,[l("td",null,[l("code",null,"waiting")]),l("td",null,[e("1.12 起。"),l("code",null,"attention"),e(" 不为 null 时:"),l("code",null,"since"),e("(从什么时候开始等)、"),l("code",null,"questions"),e("(需求方要回答的问题)、"),l("code",null,"reason"),e("(停止原因)、"),l("code",null,"card"),e("("),l("code",null,"{ system, id, url, requester }"),e(",从卡片开始的需求)、"),l("code",null,"canReply"),e("(能否用 "),l("code",null,"req api run reply <需求> <回复>"),e(" 把回复转给需求的对话)、"),l("code",null,"canStart"),e("(1.14,"),l("code",null,"not_started"),e(" 时为 true:可以用 "),l("code",null,"req api run start <需求>"),e(" 开始开发);否则为 null")])]),l("tr",null,[l("td",null,[l("code",null,"current")]),l("td",null,[e("正在运行的步骤 "),l("code",null,"[{ key, title, agentId }]")])]),l("tr",null,[l("td",null,[l("code",null,"updatedAt")]),l("td",null,"最近一次变化的时间")]),l("tr",null,[l("td",null,[l("code",null,"usage")]),l("td",null,[l("code",null,"{ steps, agentMinutes, inputTokens, outputTokens, costUsd }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"present")]),l("td",null,"目录是否还在")]),l("tr",null,[l("td",null,[l("code",null,"hasPrototype")]),l("td",null,[e("1.13 起。功能目录中有界面原型("),l("code",null,"prototype/"),e("),可以用原型审查页查看")])])])]),l("h2",{id:"详情-status",tabindex:"-1"},[e("详情("),l("code",null,"status"),e(") "),l("a",{class:"header-anchor",href:"#详情-status","aria-label":'Permalink to "详情(`status`)"'},"")]),l("p",null,'"需求"的全部字段,另加:'),l("table",{tabindex:"0"},[l("thead",null,[l("tr",null,[l("th",null,"字段"),l("th",null,"含义")])]),l("tbody",null,[l("tr",null,[l("td",null,[l("code",null,"files")]),l("td",null,[e("功能目录中存在的、可以用 "),l("code",null,"req api file"),e(" 读取的文件")])]),l("tr",null,[l("td",null,[l("code",null,"run")]),l("td",null,[l("code",null,"{ attempt, startedAt, updatedAt, pid, phaseMode, stopReason, outcome, queuedSince, verifyAt, approval, originAgentId }"),e(";没运行过为 null")])]),l("tr",null,[l("td",null,[l("code",null,"steps")]),l("td",null,[e("每个步骤一项:"),l("code",null,"{ key, stepId, title, phase, attempt, round, agentId, startedAt, endedAt, minutes, outcome, result, error, usage }"),e(";"),l("code",null,"title"),e(' 是给人看的名称(如"代码评审(第 2 轮)"),'),l("code",null,"result"),e(' 是结论的文字(如"需要修改")')])]),l("tr",null,[l("td",null,[l("code",null,"gate")]),l("td",null,[e("质量门:状态文件中的 "),l("code",null,"gate")])]),l("tr",null,[l("td",null,[l("code",null,"estimate")]),l("td",null,[e("1.13 起。"),l("code",null,"{ basis, profile, typicalAgentMinutes, typicalTokens, usedAgentMinutes, usedTokens, leftMinutes, over }"),e(":按本机已完成的同档位需求(至少 3 个)的中位数估算;数据不够或已完成时为 null")])]),l("tr",null,[l("td",null,[l("code",null,"joint")]),l("td",null,[e("联合需求的其他仓库:"),l("code",null,"[{ name, slug, repo, sourceRepo, branch, workspaceId, gate }]")])]),l("tr",null,[l("td",null,[l("code",null,"external")]),l("td",null,[e("外部系统中的卡片(1.9.0 起):"),l("code",null,"[{ name, id, url, status, syncedAt, pending, lastError }]"),e(";"),l("code",null,"pending"),e(" 是等待补发的调用数")])])])])],-1),l("p",{class:"source-note"},[e("本页由仓库中的 "),l("a",{href:"https://github.com/yiyisf/laoshi/blob/main/contracts/cli-json.md"},"contracts/cli-json.md"),e(" 生成。"),l("a",{href:"https://github.com/yiyisf/laoshi/edit/main/contracts/cli-json.md"},"在 GitHub 上编辑")],-1)])])}const g=t(s,[["render",i]]);export{k as __pageData,g as default};
|
|
File without changes
|