@longzai-intelligence-agent-tools/core 0.0.7 → 0.0.8

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.d.ts CHANGED
@@ -127,17 +127,22 @@ declare const IDE_OUTPUT_DIRS: Readonly<Record<AgentType, string>>;
127
127
  */
128
128
  declare const GENERATED_FILE_SUFFIX: '.generated';
129
129
  /**
130
- * 根指令文件入口引导文本
130
+ * 根指令文件生成区起始标记
131
131
  *
132
- * 根指令文件(CLAUDE.md / AGENTS.md)生成两份:
132
+ * 根指令文件(CLAUDE.md / AGENTS.md)采用单文件标记区锚定方案:
133
+ * 合成内容包裹在一对固定标记之间,工具只改标记之间的内容,
134
+ * 标记之外的手写内容永不触碰。
133
135
  *
134
- * 1. <原名>.generated.md:真正的合成产物(共同 + 独有内容),文件名带后缀标识。
135
- * 2. <原名>(如 CLAUDE.md):入口文件,正文为此引导文本,指向对应的 .generated.md。
136
+ * 标记使用 HTML 注释格式,对 IDE 与 markdown 渲染均不可见,
137
+ * 不污染正文渲染,但工具可据此定位生成区边界。
138
+ */
139
+ declare const GENERATED_BLOCK_BEGIN: '<!-- BEGIN Lzi Generated(工具维护,请勿手改;修改请编辑 .lzi/ 真源后运行 sync) -->';
140
+ /**
141
+ * 根指令文件生成区结束标记
136
142
  *
137
- * 引导文本由工具固定生成(非真源内容),{{generatedFile}} 占位符替换为 .generated.md 文件名。
138
- * 入口文件保留原名是因为 IDE 以此为读取入口,实际内容载体是 .generated.md。
143
+ * {@link GENERATED_BLOCK_BEGIN} 成对使用,界定生成区尾部。
139
144
  */
140
- declare const ROOT_ENTRY_TEMPLATE: '必须阅读 {{generatedFile}}。';
145
+ declare const GENERATED_BLOCK_END: '<!-- END Lzi Generated -->';
141
146
  /**
142
147
  * 内置合成规则表
143
148
  *
@@ -202,4 +207,4 @@ declare const AUTO_AGENT_KEYWORD: 'auto';
202
207
  */
203
208
  declare const detectAgentTypes: (projectRoot: string) => Promise<readonly AgentType[]>;
204
209
  //#endregion
205
- export { AUTO_AGENT_KEYWORD, type AgentToolsConfig, type AgentType, BUILTIN_PLACEHOLDERS, CATEGORY_RULES, COMMON_SOURCE, type Category, type CategoryRule, DEFAULT_SOURCES, ENV_KEYS, GENERATED_FILE_SUFFIX, IDE_OUTPUT_DIRS, LZI_DIR, ROOT_ENTRY_TEMPLATE, SYNTHESIS_RULES, type SynthesisMode, type SynthesisRule, VALID_AGENTS, type VendorRule, detectAgentTypes };
210
+ export { AUTO_AGENT_KEYWORD, type AgentToolsConfig, type AgentType, BUILTIN_PLACEHOLDERS, CATEGORY_RULES, COMMON_SOURCE, type Category, type CategoryRule, DEFAULT_SOURCES, ENV_KEYS, GENERATED_BLOCK_BEGIN, GENERATED_BLOCK_END, GENERATED_FILE_SUFFIX, IDE_OUTPUT_DIRS, LZI_DIR, SYNTHESIS_RULES, type SynthesisMode, type SynthesisRule, VALID_AGENTS, type VendorRule, detectAgentTypes };
package/dist/index.js CHANGED
@@ -39,4 +39,4 @@ import"./rolldown-runtime-BqT_7tdF.js";import{stat as e}from"node:fs/promises";i
39
39
  # frontmatter 各 IDE 不同(claude paths / trae alwaysApply+globs),见 docs/vendors/
40
40
  `,"skills/.gitkeep":`# 此目录存放技能真源
41
41
  # 命名约定:<base>.md(共同)+ <base>.<type>.md(某 IDE 独有)
42
- `},r=`.lzi`,i=`agents/agent.md`,a={claude:`.claude`,trae:`.trae`,zcode:`.zcode`},o=`.generated`,s=`必须阅读 {{generatedFile}}。`,c={claude:[{output:`CLAUDE.md`,commonSource:i,agentSource:`agents/agent.claude.md`}],trae:[{output:`CLAUDE.md`,commonSource:i,agentSource:`agents/agent.claude.md`},{output:`AGENTS.md`,commonSource:i,agentSource:`agents/agent.trae.md`}],zcode:[{output:`AGENTS.md`,commonSource:i,agentSource:`agents/agent.zcode.md`}]},l={commands:{claude:{ideRoot:a.claude,mode:`append`},trae:{ideRoot:a.trae,mode:`append`},zcode:{ideRoot:a.zcode,mode:`append`}},rules:{claude:{ideRoot:a.claude,mode:`prepend`},trae:{ideRoot:a.trae,mode:`prepend`},zcode:{ideRoot:a.zcode,mode:`prepend`}},skills:{claude:{ideRoot:a.claude,mode:`append`},trae:{ideRoot:a.trae,mode:`append`},zcode:{ideRoot:a.zcode,mode:`append`}}},u=[`claude`,`trae`,`zcode`],d={AGENT_TYPE:`LZI_AGENT_TYPE`,PLACEHOLDER_PREFIX:`LZI_PLACEHOLDER_`},f={DATE:()=>new Date().toISOString().slice(0,10),PROJECT_NAME:()=>process.cwd().split(`/`).pop()??``},p=`auto`,m=async t=>{try{return await e(t),!0}catch{return!1}},h=async e=>{let n=t(e,r);if(!await m(n))return[];let i=[];for(let e of u){let r=c[e];(await Promise.all(r.map(async e=>m(t(n,e.agentSource))))).some(e=>e)&&i.push(e)}return i};export{p as AUTO_AGENT_KEYWORD,f as BUILTIN_PLACEHOLDERS,l as CATEGORY_RULES,i as COMMON_SOURCE,n as DEFAULT_SOURCES,d as ENV_KEYS,o as GENERATED_FILE_SUFFIX,a as IDE_OUTPUT_DIRS,r as LZI_DIR,s as ROOT_ENTRY_TEMPLATE,c as SYNTHESIS_RULES,u as VALID_AGENTS,h as detectAgentTypes};
42
+ `},r=`.lzi`,i=`agents/agent.md`,a={claude:`.claude`,trae:`.trae`,zcode:`.zcode`},o=`.generated`,s=`<!-- BEGIN Lzi Generated(工具维护,请勿手改;修改请编辑 .lzi/ 真源后运行 sync) -->`,c=`<!-- END Lzi Generated -->`,l={claude:[{output:`CLAUDE.md`,commonSource:i,agentSource:`agents/agent.claude.md`}],trae:[{output:`CLAUDE.md`,commonSource:i,agentSource:`agents/agent.claude.md`},{output:`AGENTS.md`,commonSource:i,agentSource:`agents/agent.trae.md`}],zcode:[{output:`AGENTS.md`,commonSource:i,agentSource:`agents/agent.zcode.md`}]},u={commands:{claude:{ideRoot:a.claude,mode:`append`},trae:{ideRoot:a.trae,mode:`append`},zcode:{ideRoot:a.zcode,mode:`append`}},rules:{claude:{ideRoot:a.claude,mode:`prepend`},trae:{ideRoot:a.trae,mode:`prepend`},zcode:{ideRoot:a.zcode,mode:`prepend`}},skills:{claude:{ideRoot:a.claude,mode:`append`},trae:{ideRoot:a.trae,mode:`append`},zcode:{ideRoot:a.zcode,mode:`append`}}},d=[`claude`,`trae`,`zcode`],f={AGENT_TYPE:`LZI_AGENT_TYPE`,PLACEHOLDER_PREFIX:`LZI_PLACEHOLDER_`},p={DATE:()=>new Date().toISOString().slice(0,10),PROJECT_NAME:()=>process.cwd().split(`/`).pop()??``},m=`auto`,h=async t=>{try{return await e(t),!0}catch{return!1}},g=async e=>{let n=t(e,r);if(!await h(n))return[];let i=[];for(let e of d){let r=l[e];(await Promise.all(r.map(async e=>h(t(n,e.agentSource))))).some(e=>e)&&i.push(e)}return i};export{m as AUTO_AGENT_KEYWORD,p as BUILTIN_PLACEHOLDERS,u as CATEGORY_RULES,i as COMMON_SOURCE,n as DEFAULT_SOURCES,f as ENV_KEYS,s as GENERATED_BLOCK_BEGIN,c as GENERATED_BLOCK_END,o as GENERATED_FILE_SUFFIX,a as IDE_OUTPUT_DIRS,r as LZI_DIR,l as SYNTHESIS_RULES,d as VALID_AGENTS,g as detectAgentTypes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-agent-tools/core",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -17,12 +17,12 @@
17
17
  },
18
18
  "scripts": {
19
19
  "build": "lzi-builder",
20
- "build:prod": "NODE_ENV=production lzi-builder",
20
+ "build:prod": "NODE_ENV=production bun run build",
21
21
  "prepublishOnly": "bun run build:prod",
22
22
  "typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
23
- "typecheck:app": "tsgo --noEmit -p tsconfig/app.json",
24
- "typecheck:node": "tsgo --noEmit -p tsconfig/node.json",
25
- "typecheck:test": "tsgo --noEmit -p tsconfig/test.json",
23
+ "typecheck:app": "lzi-tsgo typecheck tsconfig/app.json",
24
+ "typecheck:node": "lzi-tsgo typecheck tsconfig/node.json",
25
+ "typecheck:test": "lzi-tsgo typecheck tsconfig/test.json",
26
26
  "lint": "oxlint && oxfmt --check",
27
27
  "lint:fix": "oxlint --fix && oxfmt",
28
28
  "test": "bun test",