@longzai-intelligence-plans/cli 0.0.1 → 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/dist/index.js +1 -1
- package/package.json +8 -13
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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,runPlansCheck as
|
|
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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-plans/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Longzai Intelligence Plans 工具 CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"check",
|
|
@@ -29,10 +29,7 @@
|
|
|
29
29
|
"build": "lzi-builder",
|
|
30
30
|
"build:prod": "NODE_ENV=production bun run build",
|
|
31
31
|
"prepublishOnly": "bun run build:prod",
|
|
32
|
-
"typecheck": "
|
|
33
|
-
"typecheck:app": "lzi-tsgo typecheck tsconfig/app.json",
|
|
34
|
-
"typecheck:node": "lzi-tsgo typecheck tsconfig/node.json",
|
|
35
|
-
"typecheck:test": "lzi-tsgo typecheck tsconfig/test.json",
|
|
32
|
+
"typecheck": "lzi-typecheck",
|
|
36
33
|
"lint": "lzi-lint lint",
|
|
37
34
|
"lint:fix": "lzi-lint fix",
|
|
38
35
|
"test": "bun test",
|
|
@@ -40,14 +37,12 @@
|
|
|
40
37
|
"test:coverage": "bun test --coverage"
|
|
41
38
|
},
|
|
42
39
|
"dependencies": {
|
|
43
|
-
"@longzai-intelligence-cli/core": "^0.0.
|
|
44
|
-
"@longzai-intelligence-cli/
|
|
45
|
-
"@longzai-intelligence-
|
|
46
|
-
"@longzai-intelligence-
|
|
47
|
-
"@longzai-intelligence-plans/
|
|
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",
|
|
48
46
|
"zod": "^4.4.3"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@types/bun": "latest"
|
|
52
47
|
}
|
|
53
48
|
}
|