@yiyi_zhang/laoshi 0.0.0-stage → 0.1.1
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 +35 -0
- package/LICENSE +21 -0
- package/README.md +60 -2
- package/SCOPE.md +13 -0
- package/adapters/dsh/adapter.ts +75 -0
- package/adapters/dsh/dsh-runtime.ts +242 -0
- package/adapters/dsh/install.mjs +97 -0
- package/adapters/dsh/intranet/install.mjs +15 -0
- package/adapters/dsh/intranet/make-sample.mjs +52 -0
- package/adapters/dsh/plugin/channel.d.mts +2 -0
- package/adapters/dsh/plugin/channel.mjs +31 -0
- package/adapters/dsh/plugin/index.d.mts +3 -0
- package/adapters/dsh/plugin/index.mjs +292 -0
- package/adapters/dsh/plugin/package.json +18 -0
- package/adapters/paseo/adapter.ts +96 -0
- package/adapters/paseo/daemon-check.ts +80 -0
- package/adapters/paseo/daemon-version.ts +64 -0
- package/adapters/paseo/doctor.ts +161 -0
- package/adapters/paseo/install.mjs +30 -0
- package/adapters/paseo/paseo-json.ts +73 -0
- package/adapters/paseo/paseo-profiles.ts +127 -0
- package/adapters/paseo/paseo-runtime.ts +507 -0
- package/adapters/paseo/settings.ts +22 -0
- package/adapters/paseo/skill/setup.md +26 -0
- package/adapters/paseo/skill/templates/copy-local-files.mjs +32 -0
- package/adapters/paseo/skill/templates/with-port.mjs +36 -0
- package/adapters/paseo/smoke-test.ts +203 -0
- package/bin/bootstrap.mjs +170 -0
- package/bin/install.mjs +245 -0
- package/bin/locate.mjs +22 -0
- package/bin/req-docs.d.mts +5 -0
- package/bin/req-docs.mjs +167 -0
- package/bin/req-doctor.mjs +21 -0
- package/bin/req.mjs +236 -0
- package/bin/start-pipeline +21 -0
- package/bin/start-pipeline.mjs +22 -0
- package/config.example.json +134 -0
- package/contracts/README.md +21 -0
- package/contracts/agent-runtime.md +83 -0
- package/contracts/cli-json.md +76 -0
- package/contracts/feature-files.md +148 -0
- package/contracts/notifier-event.md +90 -0
- package/contracts/result-file.md +21 -0
- package/contracts/spec.md +37 -0
- package/contracts/state.md +69 -0
- package/contracts/usage-record.md +72 -0
- package/contracts/verify.md +41 -0
- package/docs/adr/0001-new-repo-core-and-adapters.md +20 -0
- package/docs/adr/0002-two-orchestration-modes.md +20 -0
- package/docs/adr/0003-generate-once-then-lock.md +20 -0
- package/docs/adr/0004-external-contracts-stay-stable.md +19 -0
- package/docs/adr/0005-skill-names.md +26 -0
- package/docs/adr/0006-deterministic-engine-platform-capabilities.md +42 -0
- package/docs/adr/0007-one-install-many-repos.md +63 -0
- package/docs/adr/0008-capability-sources-and-platform-plugin.md +81 -0
- package/docs/adr/README.md +14 -0
- package/docs/design/adapter-guide.md +90 -0
- package/docs/design/architecture.md +104 -0
- package/docs/design/builtin-capabilities.md +72 -0
- package/docs/design/compat-migration.md +65 -0
- package/docs/design/dsh-adapter.md +145 -0
- package/docs/design/in-chat-orchestration.md +67 -0
- package/docs/design/init-bootstrap.md +83 -0
- package/docs/design/internal-platform-adapter.md +76 -0
- package/docs/design/platform-discovery.md +117 -0
- package/docs/design/platform-vocabulary.md +44 -0
- package/docs/design/state-v2.md +71 -0
- package/docs/guide//344/275/277/347/224/250/350/200/205/346/214/207/345/215/227.md +130 -0
- package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +211 -0
- package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +86 -0
- 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 +595 -0
- package/docs/intranet/install-verify.md +278 -0
- package/engine/prompts/00-shared-context.md +107 -0
- package/engine/prompts/02-spec-review.md +46 -0
- package/engine/prompts/03-design.md +77 -0
- package/engine/prompts/03a-design-proposal.md +30 -0
- package/engine/prompts/04-design-review.md +73 -0
- package/engine/prompts/04b-design-revise.md +56 -0
- package/engine/prompts/05-implement.md +72 -0
- package/engine/prompts/06-code-review.md +81 -0
- package/engine/prompts/07-review-fix.md +41 -0
- package/engine/prompts/07b-handoff.md +45 -0
- package/engine/prompts/08-service-start.md +59 -0
- package/engine/prompts/09-verify.md +90 -0
- package/engine/prompts/10-defect-fix.md +41 -0
- package/engine/prompts/10b-reverify.md +43 -0
- package/engine/prompts/11-report.md +112 -0
- package/engine/prompts/browser-verify.md +14 -0
- package/engine/prompts/incremental.md +24 -0
- package/engine/prompts/joint.md +55 -0
- package/engine/prompts/managed-services.md +9 -0
- package/engine/prompts/panel-member.md +38 -0
- package/engine/prompts/related-repos.md +7 -0
- package/engine/prompts/review-axis-spec.md +10 -0
- package/engine/prompts/review-axis-standards.md +11 -0
- package/engine/prompts/types/assessment.md +41 -0
- package/engine/prompts/types/defect.md +55 -0
- package/engine/prompts/types/refactor.md +39 -0
- package/engine/prompts/ui-check.md +15 -0
- package/engine/prompts/verify-deployed.md +14 -0
- package/engine/skill-fragments/setup-builtin.md +24 -0
- package/engine/src/activity.ts +131 -0
- package/engine/src/api.ts +655 -0
- package/engine/src/builtin/index.ts +30 -0
- package/engine/src/builtin/project-services.ts +66 -0
- package/engine/src/builtin/service-runner.mjs +35 -0
- package/engine/src/builtin/services.ts +264 -0
- package/engine/src/builtin/setup-runner.mjs +26 -0
- package/engine/src/builtin/workspace.ts +139 -0
- package/engine/src/card-cmd.ts +505 -0
- package/engine/src/card.ts +541 -0
- package/engine/src/checklist-cmd.ts +37 -0
- package/engine/src/checklist.ts +254 -0
- package/engine/src/cli-args.ts +228 -0
- package/engine/src/code-review.ts +421 -0
- package/engine/src/codeowners.ts +87 -0
- package/engine/src/config-view.ts +310 -0
- package/engine/src/config.ts +862 -0
- package/engine/src/configure.ts +343 -0
- package/engine/src/control.ts +257 -0
- package/engine/src/danger-guard.ts +180 -0
- package/engine/src/digest.ts +141 -0
- package/engine/src/doctor.ts +410 -0
- package/engine/src/estimate.ts +95 -0
- package/engine/src/eval.ts +325 -0
- package/engine/src/factory.ts +545 -0
- package/engine/src/features.ts +311 -0
- package/engine/src/gate.ts +157 -0
- package/engine/src/git.ts +30 -0
- package/engine/src/identity.ts +72 -0
- package/engine/src/index-cmd.ts +34 -0
- package/engine/src/integration-cmd.ts +161 -0
- package/engine/src/integrations.ts +485 -0
- package/engine/src/joint.ts +173 -0
- package/engine/src/launch.ts +443 -0
- package/engine/src/lessons.ts +74 -0
- package/engine/src/locations.ts +83 -0
- package/engine/src/main.ts +390 -0
- package/engine/src/messages.ts +472 -0
- package/engine/src/notifiers.ts +114 -0
- package/engine/src/notify-test.ts +108 -0
- package/engine/src/outcomes.ts +145 -0
- package/engine/src/paths.ts +10 -0
- package/engine/src/pipeline.ts +2517 -0
- package/engine/src/platform.ts +121 -0
- package/engine/src/playbooks.ts +46 -0
- package/engine/src/preflight.ts +352 -0
- package/engine/src/prompts.ts +76 -0
- package/engine/src/queue.ts +61 -0
- package/engine/src/records.ts +403 -0
- package/engine/src/reply.ts +81 -0
- package/engine/src/review-assets/app.css +339 -0
- package/engine/src/review-assets/app.html +107 -0
- package/engine/src/review-assets/app.js +958 -0
- package/engine/src/review-assets/check.css +12 -0
- package/engine/src/review-assets/check.html +61 -0
- package/engine/src/review-assets/check.js +341 -0
- package/engine/src/review-assets/code.css +16 -0
- package/engine/src/review-assets/code.html +58 -0
- package/engine/src/review-assets/code.js +497 -0
- package/engine/src/review-assets/rk-icons.js +98 -0
- package/engine/src/review-assets/rk-tokens.css +252 -0
- package/engine/src/review-assets/rk.css +254 -0
- package/engine/src/review.ts +771 -0
- package/engine/src/runtime-loader.ts +110 -0
- package/engine/src/runtime.ts +186 -0
- package/engine/src/scan-guard.ts +132 -0
- package/engine/src/schedule-time.ts +51 -0
- package/engine/src/secret-scan.ts +177 -0
- package/engine/src/semver.ts +31 -0
- package/engine/src/skills-render.ts +104 -0
- package/engine/src/spec-review.ts +99 -0
- package/engine/src/state.ts +506 -0
- package/engine/src/stats.ts +810 -0
- package/engine/src/steps.ts +269 -0
- package/engine/src/try.ts +135 -0
- package/engine/src/ui-check-page.js +208 -0
- package/engine/src/ui-check.ts +366 -0
- package/engine/src/usage.ts +67 -0
- package/engine/src/watchdog.ts +139 -0
- package/engine/src/words.ts +95 -0
- package/engine/src/worktree.ts +227 -0
- package/notifiers/im-template.mjs +86 -0
- package/package.json +78 -4
- package/principles/INDEX.md +11 -0
- package/site-dist/404.html +27 -0
- package/site-dist/assets/app.Df99UgrJ.js +1 -0
- package/site-dist/assets/changelog.md.Df8vFhjK.js +1 -0
- package/site-dist/assets/changelog.md.Df8vFhjK.lean.js +1 -0
- package/site-dist/assets/chunks/@localSearchIndexroot.n-0kN-N0.js +1 -0
- package/site-dist/assets/chunks/VPLocalSearchBox.IEhP6Gw5.js +9 -0
- package/site-dist/assets/chunks/framework.BetZR81g.js +20 -0
- package/site-dist/assets/chunks/theme.DHubfO7g.js +2 -0
- package/site-dist/assets/guide_dsh.md.0X-eYB87.js +5 -0
- package/site-dist/assets/guide_dsh.md.0X-eYB87.lean.js +5 -0
- package/site-dist/assets/guide_getting-started.md.BZTWiHhH.js +1 -0
- package/site-dist/assets/guide_getting-started.md.BZTWiHhH.lean.js +1 -0
- package/site-dist/assets/guide_how-it-works.md.CkvlSgxO.js +25 -0
- package/site-dist/assets/guide_how-it-works.md.CkvlSgxO.lean.js +1 -0
- package/site-dist/assets/guide_index.md.D67QX_Vi.js +1 -0
- package/site-dist/assets/guide_index.md.D67QX_Vi.lean.js +1 -0
- package/site-dist/assets/guide_install.md.D7NiiOPu.js +19 -0
- package/site-dist/assets/guide_install.md.D7NiiOPu.lean.js +19 -0
- package/site-dist/assets/guide_intranet.md.Bz0sAHK0.js +9 -0
- package/site-dist/assets/guide_intranet.md.Bz0sAHK0.lean.js +9 -0
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.js +1 -0
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.lean.js +1 -0
- package/site-dist/assets/guide_phases.md.Cw0A9Vb1.js +1 -0
- package/site-dist/assets/guide_phases.md.Cw0A9Vb1.lean.js +1 -0
- package/site-dist/assets/guide_project.md.BIcaDhdS.js +77 -0
- package/site-dist/assets/guide_project.md.BIcaDhdS.lean.js +77 -0
- package/site-dist/assets/guide_user.md.B66TQvIA.js +1 -0
- package/site-dist/assets/guide_user.md.B66TQvIA.lean.js +1 -0
- package/site-dist/assets/index.md.CrBM3tiI.js +1 -0
- package/site-dist/assets/index.md.CrBM3tiI.lean.js +1 -0
- package/site-dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/site-dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/site-dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/site-dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/site-dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/site-dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/site-dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/site-dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/site-dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/site-dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/site-dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/site-dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/site-dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/site-dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/site-dist/assets/reference_adr_0001-new-repo-core-and-adapters.md.CjNHHmrf.js +1 -0
- package/site-dist/assets/reference_adr_0001-new-repo-core-and-adapters.md.CjNHHmrf.lean.js +1 -0
- package/site-dist/assets/reference_adr_0002-two-orchestration-modes.md.CHD05agO.js +1 -0
- package/site-dist/assets/reference_adr_0002-two-orchestration-modes.md.CHD05agO.lean.js +1 -0
- package/site-dist/assets/reference_adr_0003-generate-once-then-lock.md.BaRiZfXT.js +1 -0
- package/site-dist/assets/reference_adr_0003-generate-once-then-lock.md.BaRiZfXT.lean.js +1 -0
- package/site-dist/assets/reference_adr_0004-external-contracts-stay-stable.md.DUJ7CTV1.js +1 -0
- package/site-dist/assets/reference_adr_0004-external-contracts-stay-stable.md.DUJ7CTV1.lean.js +1 -0
- package/site-dist/assets/reference_adr_0005-skill-names.md.DuBVd1tl.js +1 -0
- package/site-dist/assets/reference_adr_0005-skill-names.md.DuBVd1tl.lean.js +1 -0
- package/site-dist/assets/reference_adr_0006-deterministic-engine-platform-capabilities.md.Dcrnx1-L.js +1 -0
- package/site-dist/assets/reference_adr_0006-deterministic-engine-platform-capabilities.md.Dcrnx1-L.lean.js +1 -0
- package/site-dist/assets/reference_adr_0007-one-install-many-repos.md.C78cd4_P.js +1 -0
- package/site-dist/assets/reference_adr_0007-one-install-many-repos.md.C78cd4_P.lean.js +1 -0
- package/site-dist/assets/reference_adr_0008-capability-sources-and-platform-plugin.md.B4vBkIDS.js +1 -0
- package/site-dist/assets/reference_adr_0008-capability-sources-and-platform-plugin.md.B4vBkIDS.lean.js +1 -0
- package/site-dist/assets/reference_adr_index.md.Dx8sPsjs.js +1 -0
- package/site-dist/assets/reference_adr_index.md.Dx8sPsjs.lean.js +1 -0
- package/site-dist/assets/reference_commands.md.BFJRjNju.js +1 -0
- package/site-dist/assets/reference_commands.md.BFJRjNju.lean.js +1 -0
- package/site-dist/assets/reference_config.md.Dt_TJ2y9.js +6 -0
- package/site-dist/assets/reference_config.md.Dt_TJ2y9.lean.js +1 -0
- package/site-dist/assets/reference_contracts_agent-runtime.md.Bu8q-uGl.js +1 -0
- package/site-dist/assets/reference_contracts_agent-runtime.md.Bu8q-uGl.lean.js +1 -0
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.js +1 -0
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.lean.js +1 -0
- package/site-dist/assets/reference_contracts_feature-files.md.9n332kF_.js +26 -0
- package/site-dist/assets/reference_contracts_feature-files.md.9n332kF_.lean.js +26 -0
- package/site-dist/assets/reference_contracts_index.md.dqNwNs6U.js +1 -0
- package/site-dist/assets/reference_contracts_index.md.dqNwNs6U.lean.js +1 -0
- package/site-dist/assets/reference_contracts_notifier-event.md.D6we9wWS.js +24 -0
- package/site-dist/assets/reference_contracts_notifier-event.md.D6we9wWS.lean.js +24 -0
- package/site-dist/assets/reference_contracts_result-file.md.BmCaSlEu.js +1 -0
- package/site-dist/assets/reference_contracts_result-file.md.BmCaSlEu.lean.js +1 -0
- package/site-dist/assets/reference_contracts_spec.md.CDQYgJz7.js +8 -0
- package/site-dist/assets/reference_contracts_spec.md.CDQYgJz7.lean.js +8 -0
- package/site-dist/assets/reference_contracts_state.md.DVHC4opX.js +1 -0
- package/site-dist/assets/reference_contracts_state.md.DVHC4opX.lean.js +1 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.js +10 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.lean.js +10 -0
- package/site-dist/assets/reference_contracts_verify.md.CkJy8LXk.js +29 -0
- package/site-dist/assets/reference_contracts_verify.md.CkJy8LXk.lean.js +29 -0
- package/site-dist/assets/reference_design_adapter-guide.md.BSziZJSM.js +16 -0
- package/site-dist/assets/reference_design_adapter-guide.md.BSziZJSM.lean.js +16 -0
- package/site-dist/assets/reference_design_architecture.md.Bfoc-F2B.js +23 -0
- package/site-dist/assets/reference_design_architecture.md.Bfoc-F2B.lean.js +23 -0
- package/site-dist/assets/reference_design_builtin-capabilities.md.CZYtjo_v.js +7 -0
- package/site-dist/assets/reference_design_builtin-capabilities.md.CZYtjo_v.lean.js +7 -0
- package/site-dist/assets/reference_design_platform-vocabulary.md.xWGv5QO8.js +3 -0
- package/site-dist/assets/reference_design_platform-vocabulary.md.xWGv5QO8.lean.js +3 -0
- package/site-dist/assets/reference_scope.md.aUo6vISB.js +1 -0
- package/site-dist/assets/reference_scope.md.aUo6vISB.lean.js +1 -0
- package/site-dist/assets/style.BX2ZxxqY.css +1 -0
- package/site-dist/changelog.html +30 -0
- package/site-dist/favicon.svg +10 -0
- package/site-dist/guide/dsh.html +34 -0
- package/site-dist/guide/getting-started.html +30 -0
- package/site-dist/guide/how-it-works.html +54 -0
- package/site-dist/guide/index.html +30 -0
- package/site-dist/guide/install.html +48 -0
- package/site-dist/guide/intranet.html +38 -0
- package/site-dist/guide/maintainer.html +30 -0
- package/site-dist/guide/phases.html +30 -0
- package/site-dist/guide/project.html +106 -0
- package/site-dist/guide/user.html +30 -0
- package/site-dist/hashmap.json +1 -0
- package/site-dist/index.html +30 -0
- package/site-dist/logo-light.svg +6 -0
- package/site-dist/logo.svg +6 -0
- package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +30 -0
- package/site-dist/reference/adr/0002-two-orchestration-modes.html +30 -0
- package/site-dist/reference/adr/0003-generate-once-then-lock.html +30 -0
- package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +30 -0
- package/site-dist/reference/adr/0005-skill-names.html +30 -0
- package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +30 -0
- package/site-dist/reference/adr/0007-one-install-many-repos.html +30 -0
- package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +30 -0
- package/site-dist/reference/adr/index.html +30 -0
- package/site-dist/reference/commands.html +30 -0
- package/site-dist/reference/config.html +35 -0
- package/site-dist/reference/contracts/agent-runtime.html +30 -0
- package/site-dist/reference/contracts/cli-json.html +30 -0
- package/site-dist/reference/contracts/feature-files.html +55 -0
- package/site-dist/reference/contracts/index.html +30 -0
- package/site-dist/reference/contracts/notifier-event.html +53 -0
- package/site-dist/reference/contracts/result-file.html +30 -0
- package/site-dist/reference/contracts/spec.html +37 -0
- package/site-dist/reference/contracts/state.html +30 -0
- package/site-dist/reference/contracts/usage-record.html +39 -0
- package/site-dist/reference/contracts/verify.html +58 -0
- package/site-dist/reference/design/adapter-guide.html +45 -0
- package/site-dist/reference/design/architecture.html +52 -0
- package/site-dist/reference/design/builtin-capabilities.html +36 -0
- package/site-dist/reference/design/platform-vocabulary.html +32 -0
- package/site-dist/reference/scope.html +30 -0
- package/site-dist/vp-icons.css +1 -0
- package/skills/acceptance-criteria/SKILL.md +61 -0
- package/skills/laoshi/SKILL.md +108 -0
- package/skills/laoshi/playbooks/accept.md +65 -0
- package/skills/laoshi/playbooks/change.md +51 -0
- package/skills/laoshi/playbooks/incident.md +55 -0
- package/skills/laoshi/playbooks/new.md +96 -0
- package/skills/laoshi/playbooks/small.md +48 -0
- package/skills/laoshi/playbooks/status.md +41 -0
- package/skills/laoshi/playbooks/takeover.md +51 -0
- package/skills/laoshi/playbooks/unattended.md +101 -0
- package/skills/laoshi/playbooks/verify.md +57 -0
- package/skills/laoshi-doctor/SKILL.md +36 -0
- package/skills/laoshi-retro/SKILL.md +81 -0
- package/skills/laoshi-setup/SKILL.md +107 -0
- package/skills/laoshi-setup/templates/copy-local-files.mjs +32 -0
- package/skills/principle-delete-before-add/SKILL.md +33 -0
- package/skills/principle-dont-block-on-humans/SKILL.md +35 -0
- package/skills/principle-fix-root-cause/SKILL.md +33 -0
- package/skills/principle-prove-it-works/SKILL.md +33 -0
- package/skills/principle-report-honestly/SKILL.md +33 -0
- package/skills/principle-speak-to-reader/SKILL.md +33 -0
- package/skills/principle-this-requirement-only/SKILL.md +33 -0
- package/skills/requirement-interview/SKILL.md +97 -0
- package/skills/result-report/SKILL.md +34 -0
- package/skills/spec-writing/SKILL.md +58 -0
- package/skills/spec-writing/spec-template.md +109 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 更新记录
|
|
2
|
+
|
|
3
|
+
laoshi 的版本号遵循语义化版本,从 0.1.0 开始;每一版的标题写成 `## <版本> - <日期>`。每一版先写使用者会看到的变化,再写升级须知。laoshi 之前的历史见 paseo-req-kit 的更新记录(laoshi 从它的 1.15.0 抽出)。
|
|
4
|
+
|
|
5
|
+
## 0.1.1 - 2026-11-05
|
|
6
|
+
|
|
7
|
+
在 npm 上的包名改为 **`@yiyi_zhang/laoshi`**:`laoshi` 这个名字在 npm 上不能使用,0.1.0 只发布到了 GitHub Release,没有发布到 npm。其余内容与 0.1.0 相同。
|
|
8
|
+
|
|
9
|
+
### 升级须知
|
|
10
|
+
|
|
11
|
+
- 安装命令:`npx -y @yiyi_zhang/laoshi@latest install --platform dsh|paseo`(内网加 `--registry=<镜像地址>`)。装好后的命令仍是 `laoshi`(别名 `req`),skill 仍是 `/laoshi` 等。
|
|
12
|
+
- 公司的 npm 镜像需要能同步 `@yiyi_zhang` 作用域下的包。
|
|
13
|
+
- 用 GitHub Release 上 0.1.0 的 `.tgz` 或离线包装过的机器,运行一次上面的安装命令即可换成 npm 上的版本。
|
|
14
|
+
|
|
15
|
+
## 0.1.0 - 2026-11-05
|
|
16
|
+
|
|
17
|
+
第一个正式版:paseo-req-kit 的需求开发体系,抽成不绑定平台的工具包,支持 Paseo 和 DeepSeek Harness。
|
|
18
|
+
|
|
19
|
+
### 使用者会看到的变化
|
|
20
|
+
|
|
21
|
+
- **新的名字和命令**:对话中的入口是 `/laoshi`、`/laoshi-setup`、`/laoshi-doctor`、`/laoshi-retro`;终端命令是 `laoshi`(`req` 是它的别名)。
|
|
22
|
+
- **支持 DeepSeek Harness(dsh)**:步骤 agent 作为子会话挂在发起的对话下,进展和结果发回对话;各角色可以各用一个 dsh 中的模型(`<提供方>/<模型>`,`dsh/chat-model` 用对话的模型);`laoshi doctor` 列出可用的模型并逐个角色检查。
|
|
23
|
+
- **内置工作区和服务**:平台不提供时,laoshi 用 `git worktree` 为需求新建工作区,并按 `.laoshi/services.json` 启动、检查、停止项目的服务(每个工作区独立端口)。
|
|
24
|
+
- **一步安装**:`npx -y @yiyi_zhang/laoshi@latest install --platform dsh|paseo`;公司内网加 `--registry=<镜像地址>`;`laoshi upgrade` 升级或回退;`laoshi install --check`、`--uninstall`。Windows 上只用 cmd 和 Git Bash。
|
|
25
|
+
- **离线安装包**:完全没有 npm 源的机器,用 GitHub Release 上带 Windows 依赖的离线安装包,步骤见"内网安装与验证"。
|
|
26
|
+
- **文档站点**:https://yiyisf.github.io/laoshi/ ;`laoshi docs` 在本机打开和装的版本一致的文档(不需要外网)。
|
|
27
|
+
- **体检**:`laoshi doctor` 的"安装"一节检查 skill 是否已是这个版本的,并从 npm 源查询有没有新版本。
|
|
28
|
+
- **使用记录带上代码库和使用者**:使用记录、通知事件和 `laoshi api list` 中增加了代码库(目录、远程地址)和使用者(`LAOSHI_USER` 或安装级配置的 `user`)。
|
|
29
|
+
|
|
30
|
+
### 升级须知(从 paseo-req-kit)
|
|
31
|
+
|
|
32
|
+
- laoshi 和 paseo-req-kit 可以装在同一台机器上,互不覆盖:安装根是 `~/.laoshi`(只有 `~/.req-kit` 时读取它),项目配置是 `.laoshi.json`(`.requirement-pipeline.json` 继续被读取)。
|
|
33
|
+
- 状态文件升到第 2 版:第一次读到旧的状态文件时自动迁移,原文件留作 `.bak-v1`;正在运行的流水线只在内存中迁移。
|
|
34
|
+
- 配置中的 `paseoProfile`、`paseoServices` 改名为 `platformProfile`、`platformServices`,旧名继续有效。
|
|
35
|
+
- Paseo 的需求插件暂时仍由 paseo-req-kit 提供,计划在 0.1.0 之后迁入。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yiyisf
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,61 @@
|
|
|
1
|
-
#
|
|
1
|
+
# laoshi(老师)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**让非专职开发的同事,在任何 agent 平台上,把一个需求从对齐做到可验收。**
|
|
4
|
+
|
|
5
|
+
laoshi 是从 [paseo-req-kit](https://github.com/yiyisf/paseo-req-kit)(req-kit)中抽取出来的、与 agent 平台无关的需求开发体系:用对话对齐需求,由一组分工明确的 agent 完成方案设计、实现、评审和验证,每一步都有产出文件和验收门,流程由程序保证,而不是由 AI 或人即兴发挥。
|
|
6
|
+
|
|
7
|
+
> **状态:准备发布 0.1.0。** 支持 Paseo 和 DeepSeek Harness(dsh)。核心从 req-kit 1.15.0 抽取,平台相关的部分都在 `adapters/` 下(见[移植记录](docs/porting-log.md)、[实施计划](docs/extraction/plan.md))。Paseo 的需求插件界面暂时仍由 paseo-req-kit 提供。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
与 paseo-req-kit 一样从 npm 分发,一步安装:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx -y @yiyi_zhang/laoshi@latest install --platform dsh # 或 --platform paseo
|
|
15
|
+
# 公司内网只有 npm 镜像时:
|
|
16
|
+
npx -y --registry=https://npm.example.internal/ @yiyi_zhang/laoshi@latest install --platform dsh
|
|
17
|
+
laoshi doctor --no-project
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
它先用 npm 全局安装 laoshi(全局目录不可写时装到 `~/.laoshi/npm`),再运行装好的那份的 `laoshi install`:写入安装级配置(安装根默认 `~/.laoshi`,可用 `LAOSHI_HOME` 指定),把 skill 按平台渲染后装进平台读取 skill 的目录,并完成平台需要的设置(dsh:安装并挂载 laoshi 的 dsh 插件)。升级:`laoshi upgrade`(回到旧版本:`laoshi upgrade <版本>`)。卸载:`laoshi install --uninstall`。连 npm 镜像也没有时,用离线安装包(见 [docs/intranet/install-verify.md](docs/intranet/install-verify.md))。
|
|
21
|
+
|
|
22
|
+
## 设计思路
|
|
23
|
+
|
|
24
|
+
- **核心(core)**:流程剧本、步骤与结果文件、状态机、质量门、使用数据、集成。不依赖任何 agent 平台。
|
|
25
|
+
- **能力契约**:核心对平台的要求,写在 [contracts/agent-runtime.md](contracts/agent-runtime.md),分必需 / 可选 / 按需三级,并写明没有某项能力时的降级行为。
|
|
26
|
+
- **适配器(adapter)**:每个平台一个(Paseo、你们内部的 agent 平台、Claude Code 等)。内置的初始化 skill 会探测平台现状,生成适配并自检,由人确认后锁定版本,而不是每次运行时现场生成。
|
|
27
|
+
|
|
28
|
+
## 目录
|
|
29
|
+
|
|
30
|
+
| 路径 | 内容 |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `engine/` | 流水线引擎:`src/` 程序、`prompts/` 步骤提示词、`test/` 场景测试(`fake-runtime.ts` 模拟平台) |
|
|
33
|
+
| `adapters/` | 平台适配器,配置 `platform.adapter` 选择使用哪个。`paseo/`:Paseo 运行时、profile、`paseo.json`、daemon 检查;`dsh/`:DeepSeek Harness 运行时与 laoshi 的 dsh 插件(M4b 原型) |
|
|
34
|
+
| `skills/`、`principles/` | 入口 skill、方法 skill、原则 |
|
|
35
|
+
| `bin/` | `laoshi`(别名 `req`)、`start-pipeline` 命令;`install.mjs` 安装器(平台各自的部分在 `adapters/<id>/install.mjs`) |
|
|
36
|
+
| `evals/` | 端到端评估:样例仓库、隐藏验收测试 |
|
|
37
|
+
| `design/`、`notifiers/` | 设计系统(审查网页用)、外部通知模板 |
|
|
38
|
+
| `contracts/` | 文件格式与平台能力契约(req-kit 1.15.0,尚待中性化) |
|
|
39
|
+
| `docs/design/` | 架构、适配器指南、平台词汇表、初始化与自生长、会话内编排、状态 v2、兼容迁移 |
|
|
40
|
+
| `docs/adr/` | 设计决定 |
|
|
41
|
+
| `docs/discovery/` | 各平台的摸底报告与探针(目前有 [dsh](docs/discovery/dsh/report.md)) |
|
|
42
|
+
| `docs/extraction/` | 从 req-kit 抽取的资产清单与[实施计划](docs/extraction/plan.md) |
|
|
43
|
+
| [SCOPE.md](SCOPE.md) | 范围 |
|
|
44
|
+
|
|
45
|
+
## 与 req-kit 的关系
|
|
46
|
+
|
|
47
|
+
- 抽取完成并回归通过前,req-kit 只修缺陷,新功能先进 laoshi。
|
|
48
|
+
- 之后 `paseo-req-kit` 会成为依赖 laoshi 与 Paseo 适配器的薄分发包,保留 `req` 命令,已安装的用户通过升级迁移。
|
|
49
|
+
|
|
50
|
+
## 开发
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install
|
|
54
|
+
npm run typecheck
|
|
55
|
+
npm test # 引擎场景测试(模拟平台)与 skill 校验
|
|
56
|
+
npm run eval:self-check # 评估用例的参考实现能否通过隐藏验收
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 许可证
|
|
60
|
+
|
|
61
|
+
MIT
|
package/SCOPE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 范围
|
|
2
|
+
|
|
3
|
+
**laoshi 帮助非专职开发的同事(测试、产品、项目经理等),在本地仓库中,借助任意 agent 平台,把一个需求从对齐做到可验收。**
|
|
4
|
+
|
|
5
|
+
新的提议须同时满足下面三条才会考虑:
|
|
6
|
+
|
|
7
|
+
1. 服务于上面这个目标,而不是通用的编码提效。
|
|
8
|
+
2. 至少有两个真实的使用场景。
|
|
9
|
+
3. 无法通过项目配置或项目说明解决。
|
|
10
|
+
|
|
11
|
+
针对某一个 agent 平台才有意义的能力(例如某平台的插件界面),放在对应适配器里,不进核心。
|
|
12
|
+
|
|
13
|
+
被拒绝的提议记录在 `.out-of-scope/` 中,避免反复讨论。(目录在第一条被拒绝的提议出现时再建。)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// The DeepSeek Harness adapter (laoshi M4b prototype, interface from M2a). Everything goes through
|
|
2
|
+
// laoshi's dsh plugin; worktrees and services are laoshi's builtin ones (M2b); what neither offers
|
|
3
|
+
// is degraded by the core (ADR 0008).
|
|
4
|
+
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import type { AgentProfile } from "../../engine/src/config.js";
|
|
7
|
+
import type { PlatformAdapter } from "../../engine/src/platform.js";
|
|
8
|
+
import type { DshModels } from "./dsh-runtime.js";
|
|
9
|
+
import { channelPaths, dshHome } from "./plugin/channel.mjs";
|
|
10
|
+
|
|
11
|
+
export const dshAdapter: PlatformAdapter = {
|
|
12
|
+
id: "dsh",
|
|
13
|
+
displayName: "DeepSeek Harness(dsh)",
|
|
14
|
+
createRuntime: async (input) => (await import("./dsh-runtime.js")).createRuntime(input),
|
|
15
|
+
capabilities: {
|
|
16
|
+
services: "builtin",
|
|
17
|
+
worktree: "builtin",
|
|
18
|
+
scheduling: "plugin",
|
|
19
|
+
sessionAgent: "plugin",
|
|
20
|
+
activity: "plugin",
|
|
21
|
+
runningTool: "plugin",
|
|
22
|
+
toolCalls: "plugin",
|
|
23
|
+
providerStatus: "plugin",
|
|
24
|
+
},
|
|
25
|
+
originEnv: { id: "DSH_SESSION_ID" },
|
|
26
|
+
words: {
|
|
27
|
+
name: "dsh",
|
|
28
|
+
chat: "dsh 的对话",
|
|
29
|
+
schedule: "dsh 定时任务",
|
|
30
|
+
approvePermission: "在 dsh 的界面中打开这个对话的子 agent「{agent}」,查看并批准这个请求(或拒绝)",
|
|
31
|
+
signIn: "检查 dsh 中这个模型的配置",
|
|
32
|
+
connectFix: "确认 dsh 正在运行,并已用 `dsh plugin add` 安装、在 `cordis.patch.yml` 中挂载 laoshi 的 dsh 插件。",
|
|
33
|
+
},
|
|
34
|
+
doctorTitle: "DeepSeek Harness(dsh)与 laoshi 插件",
|
|
35
|
+
async doctorPlatform({ config, configPath, tools }) {
|
|
36
|
+
const { CHAT_MODEL, dshEnv, pluginClient, stepModel } = await import("./dsh-runtime.js");
|
|
37
|
+
let raw: unknown = config;
|
|
38
|
+
if (!raw) {
|
|
39
|
+
try {
|
|
40
|
+
raw = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
41
|
+
} catch {
|
|
42
|
+
// The config section reports it.
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const env = dshEnv(raw);
|
|
46
|
+
const paths = channelPaths(dshHome(env));
|
|
47
|
+
try {
|
|
48
|
+
const call = pluginClient(env, 10_000);
|
|
49
|
+
const hello = await call<{ plugin: string; approvals: string }>("hello");
|
|
50
|
+
tools.report("ok", `已连接 laoshi 的 dsh 插件 ${hello.plugin}(${paths.socket}),审批策略:${hello.approvals}`);
|
|
51
|
+
const listed = await call<DshModels>("models").catch(() => null);
|
|
52
|
+
if (!listed) {
|
|
53
|
+
tools.report("warn", "插件没有列出 dsh 的模型(插件版本较旧?)", "重新运行安装脚本,更新 laoshi 的 dsh 插件后重启 dsh");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const names = listed.providers.flatMap((p) => p.models.map((m) => `${p.provider}/${m.id}`));
|
|
57
|
+
tools.info(`dsh 中可用的模型:${names.length ? names.join("、") : "(无)"}。agent 的 provider 写成"<提供方>/<模型>"即可让这个角色用它;写 ${CHAT_MODEL} 时用对话的模型`);
|
|
58
|
+
const agents = (config as { agents?: Record<string, AgentProfile | null | undefined> } | null)?.agents ?? {};
|
|
59
|
+
for (const role of ["builder", "reviewer", "fallback"]) {
|
|
60
|
+
const profile = agents[role];
|
|
61
|
+
if (!profile) continue;
|
|
62
|
+
const model = stepModel(profile);
|
|
63
|
+
if (!model) tools.report("ok", `${role}:用对话的模型`);
|
|
64
|
+
else if (names.includes(`${model.provider}/${model.model}`)) tools.report("ok", `${role}:${model.provider}/${model.model}${model.reasoningEffort ? `(推理强度 ${model.reasoningEffort})` : ""}`);
|
|
65
|
+
else tools.report("fail", `${role} 用的模型 ${model.provider}/${model.model} 在 dsh 中不存在`, `改成上面列出的模型之一,或写 ${CHAT_MODEL} 用对话的模型`);
|
|
66
|
+
}
|
|
67
|
+
} catch (error) {
|
|
68
|
+
tools.report(
|
|
69
|
+
"fail",
|
|
70
|
+
(error as Error).message,
|
|
71
|
+
"启动 dsh;确认 laoshi-dsh-plugin 已用 dsh plugin add 安装,并在 cordis.patch.yml 中挂载(见 adapters/dsh/README.md)",
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// The engine's runtime for the DeepSeek Harness (dsh), M4b prototype (docs/design/dsh-adapter.md).
|
|
2
|
+
// Everything goes through laoshi's dsh plugin (adapters/dsh/plugin) over its local socket; the
|
|
3
|
+
// engine never calls dsh's /api (ADR 0008: the plugin calls on the engine's behalf).
|
|
4
|
+
//
|
|
5
|
+
// Worktrees and services are laoshi's builtin ones (engine/src/builtin, laoshi M2b): the methods
|
|
6
|
+
// below are placeholders the runtime layer replaces. Each role can run on its own dsh model
|
|
7
|
+
// (stepModel). Not yet: provider quota, platform agent profiles, recurring schedules' expiry.
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import net from "node:net";
|
|
10
|
+
import type { RunningTool } from "../../engine/src/scan-guard.js";
|
|
11
|
+
import type { ToolCall } from "../../engine/src/danger-guard.js";
|
|
12
|
+
import { samePath } from "../../engine/src/paths.js";
|
|
13
|
+
import type { AgentProfile } from "../../engine/src/config.js";
|
|
14
|
+
import type { AgentRuntime, RuntimeFactory, StepAgent, WaitOutcome } from "../../engine/src/runtime.js";
|
|
15
|
+
import { localTimeZone } from "../../engine/src/schedule-time.js";
|
|
16
|
+
import type { AgentUsage } from "../../engine/src/usage.js";
|
|
17
|
+
import { channelPaths, dshHome } from "./plugin/channel.mjs";
|
|
18
|
+
|
|
19
|
+
/** One call to the plugin. */
|
|
20
|
+
export type PluginCall = <T = Record<string, unknown>>(method: string, params?: Record<string, unknown>) => Promise<T>;
|
|
21
|
+
|
|
22
|
+
export class PluginUnavailableError extends Error {}
|
|
23
|
+
|
|
24
|
+
/** A client for the plugin's socket: one connection per call, newline-delimited JSON. */
|
|
25
|
+
export function pluginClient(env: NodeJS.ProcessEnv = process.env, timeoutMs = 60_000): PluginCall {
|
|
26
|
+
const paths = channelPaths(dshHome(env));
|
|
27
|
+
let count = 0;
|
|
28
|
+
return (method, params = {}) =>
|
|
29
|
+
new Promise((resolve, reject) => {
|
|
30
|
+
let token: string;
|
|
31
|
+
try {
|
|
32
|
+
token = fs.readFileSync(paths.token, "utf8").trim();
|
|
33
|
+
} catch {
|
|
34
|
+
reject(new PluginUnavailableError(`没有找到 laoshi 的 dsh 插件(${paths.token} 不存在):请确认 dsh 已启动,并已安装、挂载 laoshi-dsh-plugin`));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const socket = net.connect(paths.socket);
|
|
38
|
+
let buffer = "";
|
|
39
|
+
const timer = setTimeout(() => {
|
|
40
|
+
socket.destroy();
|
|
41
|
+
reject(new Error(`laoshi 的 dsh 插件没有在 ${timeoutMs / 1000} 秒内回应(${method})`));
|
|
42
|
+
}, timeoutMs);
|
|
43
|
+
socket.setEncoding("utf8");
|
|
44
|
+
socket.on("data", (chunk) => {
|
|
45
|
+
buffer += chunk;
|
|
46
|
+
const nl = buffer.indexOf("\n");
|
|
47
|
+
if (nl < 0) return;
|
|
48
|
+
clearTimeout(timer);
|
|
49
|
+
socket.end();
|
|
50
|
+
const reply = JSON.parse(buffer.slice(0, nl)) as { ok: boolean; result?: unknown; error?: string };
|
|
51
|
+
if (reply.ok) resolve(reply.result as never);
|
|
52
|
+
else reject(new Error(`dsh 插件:${reply.error}`));
|
|
53
|
+
});
|
|
54
|
+
socket.on("error", (e) => {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
reject(new PluginUnavailableError(`连不上 laoshi 的 dsh 插件(${paths.socket}):${e.message}。请确认 dsh 正在运行`));
|
|
57
|
+
});
|
|
58
|
+
socket.write(`${JSON.stringify({ id: ++count, token, method, params })}\n`);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface Status {
|
|
63
|
+
exists: boolean;
|
|
64
|
+
running?: boolean;
|
|
65
|
+
pendingPermissions?: Array<{ id: string; title: string }>;
|
|
66
|
+
usage?: { uncachedInputTokens?: number; outputTokens?: number; cacheReadTokens?: number; cacheWriteTokens?: number } | null;
|
|
67
|
+
error?: string | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** dsh's token usage in the engine's terms. */
|
|
71
|
+
export function toAgentUsage(u: Status["usage"]): AgentUsage | null {
|
|
72
|
+
if (!u) return null;
|
|
73
|
+
const cached = u.cacheReadTokens ?? 0;
|
|
74
|
+
return { inputTokens: (u.uncachedInputTokens ?? 0) + cached + (u.cacheWriteTokens ?? 0), cachedInputTokens: cached, outputTokens: u.outputTokens ?? 0 };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** laoshi's "use the chat's model" for a role on dsh (what the installer writes). */
|
|
78
|
+
export const CHAT_MODEL = "dsh/chat-model";
|
|
79
|
+
|
|
80
|
+
/** A provider route and its models, as the plugin lists them. */
|
|
81
|
+
export interface DshModels {
|
|
82
|
+
providers: Array<{ provider: string; name: string; models: Array<{ id: string; name: string }> }>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The model a role's settings ask for on dsh: provider "<dsh provider route>/<model id>", reasoning
|
|
87
|
+
* effort from thinkingOptionId. Null for the chat's own model (CHAT_MODEL, or no provider).
|
|
88
|
+
*/
|
|
89
|
+
export function stepModel(profile: AgentProfile | undefined): { provider: string; model: string; reasoningEffort?: string } | null {
|
|
90
|
+
const route = profile?.provider?.trim();
|
|
91
|
+
if (!route || route === CHAT_MODEL) return null;
|
|
92
|
+
const slash = route.indexOf("/");
|
|
93
|
+
if (slash <= 0 || slash === route.length - 1) return null;
|
|
94
|
+
return { provider: route.slice(0, slash), model: route.slice(slash + 1), ...(profile?.thinkingOptionId ? { reasoningEffort: profile.thinkingOptionId } : {}) };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Schedule IDs carry the session, which the plugin needs to cancel them. */
|
|
98
|
+
const scheduleId = (sessionId: string, id: string) => `dsh:${sessionId}/${id}`;
|
|
99
|
+
function parseScheduleId(id: string): { sessionId: string; id: string } | null {
|
|
100
|
+
const m = /^dsh:([^/]+)\/(.+)$/.exec(id);
|
|
101
|
+
return m ? { sessionId: m[1], id: m[2] } : null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
|
|
105
|
+
|
|
106
|
+
export function createRuntimeWithClient(call: PluginCall, log: (message: string) => void, pollMs = 1000): AgentRuntime {
|
|
107
|
+
const stepAgent = (id: string): StepAgent => ({
|
|
108
|
+
id,
|
|
109
|
+
async wait(timeoutMs: number): Promise<WaitOutcome> {
|
|
110
|
+
const deadline = Date.now() + timeoutMs;
|
|
111
|
+
for (;;) {
|
|
112
|
+
const s = await call<Status>("status", { sessionId: id });
|
|
113
|
+
const base = { error: null, lastMessage: null, pendingPermissions: [], usage: toAgentUsage(s.usage) };
|
|
114
|
+
if (!s.exists) return { ...base, status: "error", error: `dsh 中找不到会话 ${id}` };
|
|
115
|
+
if (s.pendingPermissions?.length) return { ...base, status: "permission", pendingPermissions: s.pendingPermissions };
|
|
116
|
+
if (!s.running) {
|
|
117
|
+
const { text } = await call<{ text: string | null }>("lastMessage", { sessionId: id }).catch(() => ({ text: null }));
|
|
118
|
+
if (s.error) return { ...base, lastMessage: text, status: "error", error: s.error };
|
|
119
|
+
return { ...base, lastMessage: text, status: "idle" };
|
|
120
|
+
}
|
|
121
|
+
if (Date.now() >= deadline) return { ...base, status: "timeout" };
|
|
122
|
+
await sleep(Math.min(pollMs, Math.max(0, deadline - Date.now())));
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
async followUp(text: string): Promise<void> {
|
|
126
|
+
await call("prompt", { sessionId: id, text });
|
|
127
|
+
},
|
|
128
|
+
async archive(): Promise<void> {
|
|
129
|
+
// dsh keeps step agents in the chat's list of child agents; nothing to archive.
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const toolCalls = async (agentId: string): Promise<ToolCall[] | null> =>
|
|
134
|
+
(await call<{ calls: ToolCall[] }>("toolCalls", { sessionId: agentId }).catch(() => null))?.calls ?? null;
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
async verifyOrigin(agentId, cwd) {
|
|
138
|
+
const s = await call<{ exists: boolean; cwd?: string | null }>("session", { sessionId: agentId });
|
|
139
|
+
if (!s.exists) throw new Error(`dsh 中找不到发起流水线的对话 ${agentId}(可能已被删除)。`);
|
|
140
|
+
const real = (p: string) => (fs.existsSync(p) ? fs.realpathSync(p) : p);
|
|
141
|
+
if (s.cwd && !samePath(real(s.cwd), real(cwd))) {
|
|
142
|
+
throw new Error(`发起流水线的对话的工作目录是 ${s.cwd},与仓库目录 ${cwd} 不一致:请在项目目录的对话中发起。`);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
async startAgent(input) {
|
|
147
|
+
// A requirement's own worktree (builtin, "dir:<directory>"): the step works in input.cwd, which is it.
|
|
148
|
+
if (!input.parentAgentId) {
|
|
149
|
+
const { sessionId } = await call<{ sessionId: string }>("startSession", { cwd: input.cwd, prompt: input.prompt });
|
|
150
|
+
return stepAgent(sessionId);
|
|
151
|
+
}
|
|
152
|
+
const model = stepModel(input.profile);
|
|
153
|
+
const { childId } = await call<{ childId: string }>("spawn", { parent: input.parentAgentId, label: input.title, prompt: input.prompt, cwd: input.cwd, ...(model ? { model } : {}) });
|
|
154
|
+
return stepAgent(childId);
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
attachAgent: (agentId) => stepAgent(agentId),
|
|
158
|
+
|
|
159
|
+
async startSessionAgent(input) {
|
|
160
|
+
return (await call<{ sessionId: string }>("startSession", { cwd: input.cwd, prompt: input.prompt })).sessionId;
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
async notifyAgent(agentId, text) {
|
|
164
|
+
await call("prompt", { sessionId: agentId, text });
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
async interruptAgent(agentId, text) {
|
|
168
|
+
await call("interrupt", { sessionId: agentId, text });
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
async agentDirectory(agentId) {
|
|
172
|
+
const s = await call<{ exists: boolean; cwd?: string | null }>("session", { sessionId: agentId });
|
|
173
|
+
return s.exists ? (s.cwd ?? null) : null;
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
listProfiles: async () => null,
|
|
177
|
+
listServices: async () => null,
|
|
178
|
+
startServices: async () => {
|
|
179
|
+
throw new Error("dsh 不管理服务");
|
|
180
|
+
},
|
|
181
|
+
stopServices: async () => undefined,
|
|
182
|
+
createWorktree: async () => {
|
|
183
|
+
throw new Error("dsh 适配器(原型)还不支持在新建的工作区中开发(--worktree)");
|
|
184
|
+
},
|
|
185
|
+
waitForWorkspaceSetup: async () => ({ status: "none", error: null }),
|
|
186
|
+
providerQuota: async () => null,
|
|
187
|
+
|
|
188
|
+
async recentActivity(agentId, limit) {
|
|
189
|
+
const calls = await toolCalls(agentId);
|
|
190
|
+
return calls ? calls.slice(-limit).map((c) => ({ at: c.startedAt, text: c.kind === "shell" ? `运行命令:${c.text}` : `${c.kind}:${c.text}` })) : null;
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
async runningTool(agentId): Promise<RunningTool | null> {
|
|
194
|
+
const running = (await toolCalls(agentId))?.filter((c) => c.status === "running").at(-1);
|
|
195
|
+
return running ? { kind: running.kind, text: running.text, startedAt: running.startedAt, callId: running.callId } : null;
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
toolCalls,
|
|
199
|
+
capabilities: async () => null,
|
|
200
|
+
async providerStatus() {
|
|
201
|
+
// dsh's provider routes with an adapter are ready to use; "dsh" stands for the chat's own model.
|
|
202
|
+
const listed = await call<DshModels>("models").catch(() => null);
|
|
203
|
+
if (!listed) return null;
|
|
204
|
+
return [{ provider: CHAT_MODEL.split("/")[0], status: "ready" }, ...listed.providers.map((p) => ({ provider: p.provider, status: p.models.length > 0 ? "ready" : "no_models" }))];
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
async scheduleMessage(input) {
|
|
208
|
+
if (input.expiresAt) log("dsh 的定时任务不能设截止时间:这条定时消息会一直有效,直到被取消");
|
|
209
|
+
const { id } = await call<{ id: string }>("schedule", {
|
|
210
|
+
sessionId: input.agentId,
|
|
211
|
+
title: input.name,
|
|
212
|
+
prompt: input.prompt,
|
|
213
|
+
...(input.cron ? { cron: input.cron, timeZone: localTimeZone() } : { at: input.at?.toISOString() }),
|
|
214
|
+
});
|
|
215
|
+
return scheduleId(input.agentId, id);
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
scheduleNewAgent: async () => null,
|
|
219
|
+
|
|
220
|
+
async cancelSchedule(id) {
|
|
221
|
+
const parsed = parseScheduleId(id);
|
|
222
|
+
if (parsed) await call("cancelSchedule", { sessionId: parsed.sessionId, id: parsed.id });
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
close: async () => undefined,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The environment for reaching the plugin: platform.dsh.home in the install-level config (laoshi M2c)
|
|
231
|
+
* names dsh's home directory when it is not DSH_HOME's (or ~/.dsh).
|
|
232
|
+
*/
|
|
233
|
+
export function dshEnv(config: unknown, env: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
|
|
234
|
+
const home = (config as { platform?: { dsh?: { home?: unknown } } } | null)?.platform?.dsh?.home;
|
|
235
|
+
return typeof home === "string" && home.trim() ? { ...env, DSH_HOME: home.trim() } : env;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export const createRuntime: RuntimeFactory = async ({ config, log }) => {
|
|
239
|
+
const call = pluginClient(dshEnv(config));
|
|
240
|
+
await call("hello");
|
|
241
|
+
return createRuntimeWithClient(call, log);
|
|
242
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// laoshi installer, dsh part (bin/install.mjs): where dsh reads skills, and laoshi's dsh plugin
|
|
2
|
+
// installed and mounted in a dsh profile. Plain Node.js; reaches an npm-installed `dsh` through
|
|
3
|
+
// cmd.exe on Windows, never PowerShell.
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
|
|
9
|
+
export const id = "dsh";
|
|
10
|
+
|
|
11
|
+
/** Installer options this platform reads (bin/install.mjs passes them through). */
|
|
12
|
+
export const options = {
|
|
13
|
+
"dsh-home": { type: "string" },
|
|
14
|
+
profile: { type: "string" },
|
|
15
|
+
"dsh-bin": { type: "string" },
|
|
16
|
+
approvals: { type: "string" },
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const slash = (p) => p.split(path.sep).join("/");
|
|
20
|
+
|
|
21
|
+
function dshHomeOf(args, config, env) {
|
|
22
|
+
return path.resolve(args["dsh-home"] ?? config?.platform?.dsh?.home ?? env.DSH_HOME ?? path.join(os.homedir(), ".dsh"));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The install-level config's platform section for a new installation. */
|
|
26
|
+
export function platformConfig(args, env = process.env) {
|
|
27
|
+
return { adapter: "dsh", dsh: { home: slash(dshHomeOf(args, null, env)), profile: args.profile ?? "web" } };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The agents of a new installation: every step on the chat's model (doctor lists the others). */
|
|
31
|
+
export const defaultAgents = { builder: { provider: "dsh/chat-model" }, reviewer: { provider: "dsh/chat-model" } };
|
|
32
|
+
|
|
33
|
+
/** Where dsh reads skills: its home's skills directory. */
|
|
34
|
+
export function skillTargets(args, config, env = process.env) {
|
|
35
|
+
const dir = path.join(dshHomeOf(args, config, env), "skills");
|
|
36
|
+
return [{ dir, label: `dsh 的 skill 目录 ${dir}` }];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Installs and mounts laoshi's dsh plugin. */
|
|
40
|
+
export function setup({ kit, args, config, env = process.env, dry, report }) {
|
|
41
|
+
const dshHome = dshHomeOf(args, config, env);
|
|
42
|
+
const profile = args.profile ?? config?.platform?.dsh?.profile ?? "web";
|
|
43
|
+
const approvals = args.approvals ?? "ask";
|
|
44
|
+
if (!["ask", "allow"].includes(approvals)) throw new Error("--approvals 只能是 ask 或 allow");
|
|
45
|
+
if (!fs.existsSync(dshHome)) report("warn", `dsh 的目录 ${dshHome} 还不存在`, "先启动一次 dsh,或用 --dsh-home 指定");
|
|
46
|
+
const profileDir = path.join(dshHome, "profiles", profile);
|
|
47
|
+
const plugin = path.join(kit, "adapters", "dsh", "plugin");
|
|
48
|
+
const installed = path.join(profileDir, "node_modules", "laoshi-dsh-plugin");
|
|
49
|
+
let added = false;
|
|
50
|
+
if (!dry) {
|
|
51
|
+
const cli = ["plugin", "--profile", profile, "add", `file:${slash(plugin)}`];
|
|
52
|
+
const childEnv = { ...env, DSH_HOME: dshHome };
|
|
53
|
+
try {
|
|
54
|
+
if (args["dsh-bin"]) execFileSync(process.execPath, [path.resolve(args["dsh-bin"]), ...cli], { env: childEnv, stdio: "pipe", windowsHide: true });
|
|
55
|
+
else if (process.platform === "win32") execFileSync(env.ComSpec ?? "cmd.exe", ["/d", "/s", "/c", ["dsh", ...cli].join(" ")], { env: childEnv, stdio: "pipe", windowsHide: true });
|
|
56
|
+
else execFileSync("dsh", cli, { env: childEnv, stdio: "pipe" });
|
|
57
|
+
added = true;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
const reason = String(error.stderr || error.message || "").trim().split("\n").at(-1) || `退出码 ${error.status ?? "未知"}`;
|
|
60
|
+
report("info", `dsh plugin add 没有成功(${reason}),改为直接复制到 profile`);
|
|
61
|
+
}
|
|
62
|
+
if (!added) {
|
|
63
|
+
fs.rmSync(installed, { recursive: true, force: true });
|
|
64
|
+
fs.mkdirSync(path.dirname(installed), { recursive: true });
|
|
65
|
+
fs.cpSync(plugin, installed, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
report("ok", added ? `已用 dsh plugin add 把 laoshi 的插件装进 profile ${profile}` : `laoshi 的插件放到 ${installed}`);
|
|
69
|
+
|
|
70
|
+
const patchFile = path.join(profileDir, "cordis.patch.yml");
|
|
71
|
+
// dsh writes the file with an empty flow list ("[]"); entries go into a block list instead.
|
|
72
|
+
const current = (fs.existsSync(patchFile) ? fs.readFileSync(patchFile, "utf8") : "").replace(/^\s*\[\]\s*$/m, "");
|
|
73
|
+
if (current.includes("laoshi-dsh-plugin")) report("ok", `${patchFile} 中已挂载插件,不改动(审批策略以文件中的为准)`);
|
|
74
|
+
else {
|
|
75
|
+
if (!dry) {
|
|
76
|
+
fs.mkdirSync(profileDir, { recursive: true });
|
|
77
|
+
const block = `- insert:\n - id: laoshi-dsh\n name: 'laoshi-dsh-plugin'\n config:\n approvals: ${approvals}\n`;
|
|
78
|
+
fs.writeFileSync(patchFile, `${current}${current && !current.endsWith("\n") ? "\n" : ""}${block}`);
|
|
79
|
+
}
|
|
80
|
+
report("ok", `在 ${patchFile} 末尾挂载插件(审批策略 ${approvals})`);
|
|
81
|
+
}
|
|
82
|
+
return [`重启 dsh(profile ${profile}),让插件生效`];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Removes laoshi's dsh plugin and its mount. */
|
|
86
|
+
export function uninstall({ args, config, env = process.env, report }) {
|
|
87
|
+
const dshHome = dshHomeOf(args, config, env);
|
|
88
|
+
const profile = args.profile ?? config?.platform?.dsh?.profile ?? "web";
|
|
89
|
+
const profileDir = path.join(dshHome, "profiles", profile);
|
|
90
|
+
fs.rmSync(path.join(profileDir, "node_modules", "laoshi-dsh-plugin"), { recursive: true, force: true });
|
|
91
|
+
const patchFile = path.join(profileDir, "cordis.patch.yml");
|
|
92
|
+
if (fs.existsSync(patchFile)) {
|
|
93
|
+
const text = fs.readFileSync(patchFile, "utf8").replace(/- insert:\n\s+- id: laoshi-dsh\n(?:\s{6,}.*\n?)*/m, "");
|
|
94
|
+
fs.writeFileSync(patchFile, text);
|
|
95
|
+
}
|
|
96
|
+
report("ok", `已从 dsh 的 profile ${profile} 移除 laoshi 的插件`);
|
|
97
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// laoshi on DeepSeek Harness (dsh), one machine: the same as `laoshi install --platform dsh`
|
|
3
|
+
// (bin/install.mjs), kept so the intranet steps (docs/intranet/install-verify.md) stay the same.
|
|
4
|
+
//
|
|
5
|
+
// node adapters/dsh/intranet/install.mjs [--home <LAOSHI_HOME>] [--dsh-home <DSH_HOME>] [--profile web]
|
|
6
|
+
// [--dsh-bin <path to dsh's bin.js>] [--approvals ask|allow] [--skills-dir <dir>] [--dry-run]
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const kit = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
|
|
12
|
+
const args = process.argv.slice(2).map((a) => (a === "--skills-dir" ? "--target" : a));
|
|
13
|
+
if (!args.includes("--profile")) args.push("--profile", "web");
|
|
14
|
+
const r = spawnSync(process.execPath, [path.join(kit, "bin", "install.mjs"), "--platform", "dsh", ...args], { stdio: "inherit", windowsHide: true });
|
|
15
|
+
process.exit(r.status ?? 1);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// A small sample repository for verifying laoshi on the intranet (docs/intranet/install-verify.md):
|
|
3
|
+
// a git repo on main with a function and its tests, an HTTP service, .laoshi/services.json (a
|
|
4
|
+
// setup command and the service) and .laoshi.json (the quality gate's check). Only needs Node.js and git.
|
|
5
|
+
//
|
|
6
|
+
// node adapters/dsh/intranet/make-sample.mjs <directory> [--name <project name>]
|
|
7
|
+
import { execFileSync } from "node:child_process";
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { parseArgs } from "node:util";
|
|
11
|
+
|
|
12
|
+
const { values, positionals } = parseArgs({ allowPositionals: true, options: { name: { type: "string" } } });
|
|
13
|
+
if (positionals.length !== 1) {
|
|
14
|
+
console.error("用法:node make-sample.mjs <目录> [--name <项目名>]");
|
|
15
|
+
process.exit(2);
|
|
16
|
+
}
|
|
17
|
+
const dir = path.resolve(positionals[0]);
|
|
18
|
+
if (fs.existsSync(dir) && fs.readdirSync(dir).length > 0) {
|
|
19
|
+
console.error(`${dir} 已存在且不为空:换一个目录`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
const name = values.name ?? path.basename(dir);
|
|
23
|
+
const files = {
|
|
24
|
+
"package.json": JSON.stringify({ name, version: "1.0.0", private: true, type: "module", scripts: { test: "node --test test/", start: "node server.mjs" } }, null, 2),
|
|
25
|
+
"README.md": `# ${name}\n\nlaoshi 内网验证用的样例项目:一个文本工具函数(src/text.mjs)和一个小的 HTTP 服务(server.mjs)。\n\n- 测试:\`npm test\`\n- 启动服务:\`node server.mjs 3000\`(端口也可以用环境变量 PORT),健康检查 \`/healthz\`,接口 \`/api/title?text=...\`\n`,
|
|
26
|
+
"src/text.mjs": `// Text helpers.\n\n/** Capitalizes the first letter of every word: "hello world" -> "Hello World". */\nexport function titleCase(text) {\n return text\n .split(" ")\n .map((w) => (w ? w[0].toUpperCase() + w.slice(1) : w))\n .join(" ");\n}\n`,
|
|
27
|
+
"test/text.test.mjs": `import assert from "node:assert/strict";\nimport { test } from "node:test";\nimport { titleCase } from "../src/text.mjs";\n\ntest("titleCase capitalizes each word", () => {\n assert.equal(titleCase("hello world"), "Hello World");\n});\n`,
|
|
28
|
+
"server.mjs": `import http from "node:http";\nimport { titleCase } from "./src/text.mjs";\n\nconst port = Number(process.argv[2] ?? process.env.PORT ?? 3000);\nhttp\n .createServer((req, res) => {\n const url = new URL(req.url, "http://localhost");\n if (url.pathname === "/healthz") return res.end("ok");\n if (url.pathname === "/api/title") {\n res.setHeader("content-type", "application/json; charset=utf-8");\n return res.end(JSON.stringify({ result: titleCase(url.searchParams.get("text") ?? "") }));\n }\n res.statusCode = 404;\n res.end("not found");\n })\n .listen(port, "127.0.0.1", () => console.log(\`listening on \${port}\`));\n`,
|
|
29
|
+
".laoshi/services.json": JSON.stringify(
|
|
30
|
+
{ setup: ['node -e "require(\'fs\').writeFileSync(\'setup-done.txt\', String(process.env.LAOSHI_SOURCE_CHECKOUT_PATH))"'], services: { web: { command: "node server.mjs {PORT}", health: "/healthz" } } },
|
|
31
|
+
null,
|
|
32
|
+
2,
|
|
33
|
+
),
|
|
34
|
+
".laoshi.json": JSON.stringify({ defaultProfile: "quick", checks: [{ name: "单元测试", command: "npm test" }] }, null, 2),
|
|
35
|
+
".gitignore": "node_modules/\nsetup-done.txt\ndocs/features/*/.pipeline/\n",
|
|
36
|
+
};
|
|
37
|
+
for (const [rel, text] of Object.entries(files)) {
|
|
38
|
+
fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true });
|
|
39
|
+
fs.writeFileSync(path.join(dir, rel), text.endsWith("\n") ? text : `${text}\n`);
|
|
40
|
+
}
|
|
41
|
+
const git = (...args) => execFileSync("git", args, { cwd: dir, stdio: "ignore", windowsHide: true });
|
|
42
|
+
git("init", "-q");
|
|
43
|
+
git("checkout", "-q", "-b", "main");
|
|
44
|
+
try {
|
|
45
|
+
execFileSync("git", ["config", "user.name"], { cwd: dir, stdio: "ignore" });
|
|
46
|
+
} catch {
|
|
47
|
+
git("config", "user.name", "laoshi 验证");
|
|
48
|
+
git("config", "user.email", "laoshi-verify@localhost");
|
|
49
|
+
}
|
|
50
|
+
git("add", "-A");
|
|
51
|
+
git("commit", "-q", "-m", "样例项目");
|
|
52
|
+
console.log(`已建好样例项目 ${dir}(分支 main,已提交)`);
|