@longzai-intelligence-plans/cli 0.0.0-stage → 0.0.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/README.md +2 -2
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2 -0
- package/dist/rolldown-runtime-DCIJsbUY.js +2 -0
- package/package.json +51 -4
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @longzai-intelligence-plans/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
bin `lzi-plans`。子命令 `check` 校验各仓 `docs/plans` 归档的元信息与命名形态,另导出 docs 平台插件契约 `plansPlugin`(`plans-check` 与 `plans-template` 两命令)。判据口径 exit 0 过 / 1 违规 / 2 门禁拦截。
|
package/dist/index.d.ts
ADDED
|
@@ -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,runPlansCheck as o}from"@longzai-intelligence-plans/ledger";import*as s from"zod";import{loadLziPlansConfig as c,parseLziPlansConfig as l}from"@longzai-intelligence-plans/config";import{resolve as u}from"node:path";import{definePlugin as d,pluginCommand as f}from"@longzai-intelligence-docs/core";function p(){return u(process.cwd())}async function m(e){let t=await c(e===void 0?{}:{configPath:e});return t.ok?{config:t.config,configFilePath:t.configFilePath}:{config:l(void 0),configFilePath:null}}function h(e){process.stdout.write(`[INFO] ${e}\n`)}function g(e){process.stdout.write(`[SUCCESS] ${e}\n`)}function _(e){process.stdout.write(`${e}\n`)}function v(e){process.stderr.write(`错误: ${e}\n`),process.exit(1)}function y(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:s.looseObject({format:s.enum([`text`,`json`]).optional(),config:s.string().optional()}),action:async(e,t)=>{let n=t[0]===void 0?p():b(t[0]),{config:r}=await m(e.config),i=await o({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){_(t.file);for(let e of t.errors)_(` ${e}`)}i.ok||(e.format!==`json`&&v(`plans 检查未通过 ${i.violationFileCount}/${i.fileCount}`),process.exit(1)),e.format!==`json`&&(h(`scope 注册面 ${r.scopes.length} 个`),g(`plans 检查通过 ${i.fileCount} 件`))}})}function b(e){return e.startsWith(`/`)?e:`${process.cwd()}/${e}`}function x(e){y(e)}const S=d({name:`plans`,version:`0.1.0`,commands:[()=>w(),()=>T()]}),C={scopes:[{key:`root`,title:`全局`,paths:[`.`],registryDir:`docs/plans`}]};function w(){return f({name:`plans-check`,description:`docs/plans 归档元信息与命名形态检查——frontmatter、文件名与日期目录一致性`,schema:s.object({}),action:async()=>{let e=await o({root:process.cwd(),config:C});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 T(){return f({name:`plans-template`,description:`plan 归档元信息契约——frontmatter 字段与命名形态,agent 机读`,schema:s.object({}),action:async()=>{process.stdout.write(`${JSON.stringify({fields:a,naming:i},null,2)}\n`)}})}async function E(){let t=e({name:`lzi-plans`,description:`Longzai Intelligence Plans CLI(plan 归档 · 元信息门禁)`,version:`0.0.1`,interaction:n,color:r});x(t),await t.parseAsync(process.argv)}await E();export{S as plansPlugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-plans/cli",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
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": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
|
|
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",
|
|
36
|
+
"lint": "lzi-lint lint",
|
|
37
|
+
"lint:fix": "lzi-lint fix",
|
|
38
|
+
"test": "bun test",
|
|
39
|
+
"test:watch": "bun test --watch",
|
|
40
|
+
"test:coverage": "bun test --coverage"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@longzai-intelligence-cli/core": "^0.0.12",
|
|
44
|
+
"@longzai-intelligence-cli/standard": "^0.0.12",
|
|
45
|
+
"@longzai-intelligence-docs/core": "0.0.16",
|
|
46
|
+
"@longzai-intelligence-plans/config": "0.0.1",
|
|
47
|
+
"@longzai-intelligence-plans/ledger": "0.0.1",
|
|
48
|
+
"zod": "^4.4.3"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/bun": "latest"
|
|
52
|
+
}
|
|
53
|
+
}
|