@longzai-intelligence-plans/cli 0.0.0-stage → 0.0.2

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # @longzai-intelligence-plans/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ bin `lzi-plans`。子命令 `check` 校验各仓 `docs/plans` 归档的元信息与命名形态,另导出 docs 平台插件契约 `plansPlugin`(`plans-check` 与 `plans-template` 两命令)。判据口径 exit 0 过 / 1 违规 / 2 门禁拦截。
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bun
2
+ import "./rolldown-runtime-DCIJsbUY.js";
3
+ /**
4
+ * plans 内置插件——契约适配层
5
+ *
6
+ * 引擎核不搬家——本文件仅将归档检查命令包装为 docs 平台插件契约形态,供
7
+ * lzi-docs 宿主经 plugins.plans 声明装载。CLI 侧直接消费引擎核不变
8
+ */
9
+ declare const plansPlugin: import("@longzai-intelligence-docs/core").DocsPlugin;
10
+ export { plansPlugin };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ import"./rolldown-runtime-DCIJsbUY.js";import{createCli as e,defineCommand as t}from"@longzai-intelligence-cli/core";import{clackInteraction as n,picocolorsColor as r}from"@longzai-intelligence-cli/standard";import{NAMING_CONTRACT as i,TEMPLATE_FIELDS as a,buildPlanExport as o,runPlansCheck as s}from"@longzai-intelligence-plans/ledger";import*as c from"zod";import{loadLziPlansConfig as l,parseLziPlansConfig as u}from"@longzai-intelligence-plans/config";import{resolve as d}from"node:path";import{createDynamicServeHost as f,registerServeCommand as p}from"@longzai-intelligence-cli/serve-kit";import{definePlugin as m,pluginCommand as h}from"@longzai-intelligence-docs/core";function g(){return d(process.cwd())}async function _(e){let t=await l(e===void 0?{}:{configPath:e});return t.ok?{config:t.config,configFilePath:t.configFilePath}:{config:u(void 0),configFilePath:null}}function v(e){process.stdout.write(`[INFO] ${e}\n`)}function y(e){process.stdout.write(`[SUCCESS] ${e}\n`)}function b(e){process.stdout.write(`${e}\n`)}function x(e){process.stderr.write(`错误: ${e}\n`),process.exit(1)}function S(e){t(e,{name:`check`,description:`归档元信息与命名形态检查——docs/plans frontmatter、文件名与日期目录一致性`,arguments:[{signature:`[path]`,description:`目标仓路径,缺省为当前仓`}],options:[{flags:`--format <format>`,description:`text | json`},{flags:`--config <path>`,description:`显式配置路径`}],schema:c.looseObject({format:c.enum([`text`,`json`]).optional(),config:c.string().optional()}),action:async(e,t)=>{let n=t[0]===void 0?g():C(t[0]),{config:r}=await _(e.config),i=await s({root:n,config:r});if(e.format===`json`)process.stdout.write(`${JSON.stringify({command:`plans:check`,ok:i.ok,fileCount:i.fileCount,violationFileCount:i.violationFileCount,scopes:i.scopes},null,2)}\n`);else for(let e of i.scopes)for(let t of e.findings){b(t.file);for(let e of t.errors)b(` ${e}`)}i.ok||(e.format!==`json`&&x(`plans 检查未通过 ${i.violationFileCount}/${i.fileCount}`),process.exit(1)),e.format!==`json`&&(v(`scope 注册面 ${r.scopes.length} 个`),y(`plans 检查通过 ${i.fileCount} 件`))}})}function C(e){return e.startsWith(`/`)?e:`${process.cwd()}/${e}`}function w(e){t(e,{name:`export`,description:`导出计划归档结构化登记为 JSON 投影,供进度板数据面消费`,options:[{flags:`--format <format>`,description:`输出格式,当前仅支持 json`},{flags:`--scope <scope>`,description:`限定 scope`},{flags:`--config <path>`,description:`显式配置路径`}],schema:c.looseObject({format:c.enum([`json`]).optional(),scope:c.string().optional(),config:c.string().optional()}),action:async e=>{let t=g(),{config:n}=await _(e.config);e.scope!==void 0&&!n.scopes.some(t=>t.key===e.scope)&&x(`scope「${e.scope}」未登记`);let r=o({config:n,root:t,scopeKey:e.scope});process.stdout.write(`${JSON.stringify(r,null,2)}\n`)}})}function T(e){p(e,f({domain:`plans`,defaultPort:3669,serviceName:`plans-desktop-host`,producer:`longzai-intelligence-plans`,loadServeApp:()=>import(`@longzai-intelligence-plans-private/desktop-host/serve`).then(e=>e.createPlansServeApp())}))}function E(e){S(e),w(e),T(e)}const D=m({name:`plans`,version:`0.1.0`,commands:[()=>k(),()=>A()]}),O={scopes:[{key:`root`,title:`全局`,paths:[`.`],registryDir:`docs/plans`}]};function k(){return h({name:`plans-check`,description:`docs/plans 归档元信息与命名形态检查——frontmatter、文件名与日期目录一致性`,schema:c.object({}),action:async()=>{let e=await s({root:process.cwd(),config:O});for(let t of e.scopes)for(let e of t.findings)for(let t of e.errors)process.stderr.write(`[plans] ${e.file} ${t}\n`);e.violationFileCount>0&&process.exit(1)}})}function A(){return h({name:`plans-template`,description:`plan 归档元信息契约——frontmatter 字段与命名形态,agent 机读`,schema:c.object({}),action:async()=>{process.stdout.write(`${JSON.stringify({fields:a,naming:i},null,2)}\n`)}})}async function j(){let t=e({name:`lzi-plans`,description:`Longzai Intelligence Plans CLI(plan 归档 · 元信息门禁)`,version:`0.0.2`,interaction:n,color:r});E(t),await t.parseAsync(process.argv)}await j();export{D as plansPlugin};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ import"node:module";export{};
package/package.json CHANGED
@@ -1,6 +1,48 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-plans/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Longzai Intelligence Plans 工具 CLI",
5
+ "keywords": [
6
+ "check",
7
+ "cli",
8
+ "longzai-intelligence",
9
+ "plans",
10
+ "registry"
11
+ ],
12
+ "license": "UNLICENSED",
13
+ "bin": {
14
+ "lzi-plans": "./dist/index.js"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "type": "module",
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js"
26
+ }
27
+ },
28
+ "scripts": {
29
+ "build": "lzi-builder",
30
+ "build:prod": "NODE_ENV=production bun run build",
31
+ "prepublishOnly": "bun run build:prod",
32
+ "typecheck": "lzi-typecheck",
33
+ "lint": "lzi-lint lint",
34
+ "lint:fix": "lzi-lint fix",
35
+ "test": "bun test",
36
+ "test:watch": "bun test --watch",
37
+ "test:coverage": "bun test --coverage"
38
+ },
39
+ "dependencies": {
40
+ "@longzai-intelligence-cli/core": "^0.0.18",
41
+ "@longzai-intelligence-cli/serve-kit": "^0.0.18",
42
+ "@longzai-intelligence-cli/standard": "^0.0.18",
43
+ "@longzai-intelligence-docs/core": "0.0.29",
44
+ "@longzai-intelligence-plans/config": "0.0.2",
45
+ "@longzai-intelligence-plans/ledger": "0.0.2",
46
+ "zod": "^4.4.3"
47
+ }
48
+ }