@agimon-ai/vibe-lint-plugin-doom-cli 0.0.1-alpha.3 → 0.0.1-alpha.31
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/index.d.cts +0 -7
- package/dist/index.d.cts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./_virtual/_rolldown/runtime.cjs");let t=require("node:fs");t=e.__toESM(t,1);let n=require("node:path");n=e.__toESM(n,1);let r=require("typescript");r=e.__toESM(r,1);const i
|
|
2
|
-
`):null}},o={name:`doom-cli`,rules:{"doom-cli-architecture":a},patterns:{ownership:{description:a.rule,includes:[`src/**/*.ts`,`package.json`]}},configs:{recommended:{rules:{"doom-cli-architecture":`error`}}}};exports.architecture=a,exports.default=o;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./_virtual/_rolldown/runtime.cjs");let t=require("node:fs");t=e.__toESM(t,1);let n=require("node:path");n=e.__toESM(n,1);let r=require("typescript");r=e.__toESM(r,1);const i=/* @__PURE__ */ new Set([`bin`,`cli`,`composition`,`builders`,`compiler`,`extensions`,`exports`,`prompts`]),a={preflight:!0,rule:`Keep Doompi cli ownership explicit in folders, imports, and package exports`,rationale:`Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.`,check(e,a){if(!t.default.existsSync(e))return null;let o=n.default.relative(a,e).replaceAll(n.default.sep,`/`),s=[];if(o.startsWith(`src/`)&&!i.has(o.split(`/`)[1])&&s.push(`Unsupported source folder: ${o}`),o.startsWith(`src/`)&&/\.[cm]?tsx?$/.test(o)){let i=r.default.createSourceFile(e,t.default.readFileSync(e,`utf8`),r.default.ScriptTarget.Latest,!0),c=t=>{let r=t.startsWith(`.`)?n.default.relative(a,n.default.resolve(n.default.dirname(e),t)).split(n.default.sep).join(`/`):void 0;(o.startsWith(`src/builders/`)||o.startsWith(`src/composition/`))&&r?.startsWith(`src/cli/`)&&s.push(`Subsystem code cannot depend on command handling: ${t}`),o.startsWith(`src/compiler/`)&&r&&/^src\/(?:cli|builders|composition)\//.test(r)&&s.push(`Compiler mechanics cannot depend on distribution policy: ${t}`)},l=e=>{if((r.default.isImportDeclaration(e)||r.default.isExportDeclaration(e))&&e.moduleSpecifier&&r.default.isStringLiteralLike(e.moduleSpecifier)){let t=e.moduleSpecifier.text;c(t),/doompi-(?:extension-contracts|web-contracts|kernel)(?:\/|$)/.test(t)&&s.push(`Removed package: ${t}`),t.includes(`/src/`)&&s.push(`Import a package capability export: ${t}`)}r.default.isCallExpression(e)&&e.expression.kind===r.default.SyntaxKind.ImportKeyword&&e.arguments[0]&&r.default.isStringLiteralLike(e.arguments[0])&&c(e.arguments[0].text),r.default.forEachChild(e,l)};l(i)}return s.length?[...new Set(s)].join(`
|
|
2
|
+
`):null}},o={preflight:!0,rule:`Keep the generated Pi dispatcher marker fixed at 1`,rationale:`Generated content determines freshness. Changing the ownership marker creates needless migration code.`,check(e,i){if(n.default.relative(i,e).replaceAll(n.default.sep,`/`)!==`src/builders/cli/piExtensionDispatcher/index.ts`||!t.default.existsSync(e))return null;let a=r.default.createSourceFile(e,t.default.readFileSync(e,`utf8`),r.default.ScriptTarget.Latest,!0);for(let e of a.statements)if(r.default.isVariableStatement(e)){for(let t of e.declarationList.declarations)if(r.default.isIdentifier(t.name)&&t.name.text===`PI_DISPATCHER_VERSION`)return t.initializer&&r.default.isNumericLiteral(t.initializer)&&t.initializer.text===`1`?null:`PI_DISPATCHER_VERSION must remain 1`}return`PI_DISPATCHER_VERSION must remain 1`}},s={name:`doom-cli`,rules:{"doom-cli-architecture":a,"stable-dispatcher-marker":o},patterns:{ownership:{description:a.rule,includes:[`src/**/*.ts`,`package.json`]}},configs:{recommended:{rules:{"doom-cli-architecture":`error`,"stable-dispatcher-marker":`error`}}}};exports.architecture=a,exports.default=s,exports.stableDispatcherMarker=o;
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["fs","path","ts"],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleDefinition, VibeLintPlugin } from '@agimon-ai/vibe-lint';\nimport ts from 'typescript';\nconst folders = new Set(['bin', 'cli', 'composition', 'builders', 'compiler', 'extensions', 'exports', 'prompts']);\nexport const architecture: RuleDefinition = {\n preflight: true,\n rule: 'Keep Doompi cli ownership explicit in folders, imports, and package exports',\n rationale:\n 'Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.',\n check(filePath, configRoot) {\n if (!fs.existsSync(filePath)) return null;\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n const problems: string[] = [];\n if (relative.startsWith('src/') && !folders.has(relative.split('/')[1]!))\n problems.push(`Unsupported source folder: ${relative}`);\n if (relative.startsWith('src/') && /\\.[cm]?tsx?$/.test(relative)) {\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n const checkReference = (reference: string): void => {\n const target = reference.startsWith('.')\n ? path\n .relative(configRoot, path.resolve(path.dirname(filePath), reference))\n .split(path.sep)\n .join('/')\n : undefined;\n if (\n (relative.startsWith('src/builders/') || relative.startsWith('src/composition/')) &&\n target?.startsWith('src/cli/')\n )\n problems.push(`Subsystem code cannot depend on command handling: ${reference}`);\n if (relative.startsWith('src/compiler/') && target && /^src\\/(?:cli|builders|composition)\\//.test(target))\n problems.push(`Compiler mechanics cannot depend on distribution policy: ${reference}`);\n };\n const visit = (node: ts.Node): void => {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n const reference = node.moduleSpecifier.text;\n checkReference(reference);\n if (/doompi-(?:extension-contracts|web-contracts|kernel)(?:\\/|$)/.test(reference))\n problems.push(`Removed package: ${reference}`);\n if (reference.includes('/src/')) problems.push(`Import a package capability export: ${reference}`);\n }\n if (\n ts.isCallExpression(node) &&\n node.expression.kind === ts.SyntaxKind.ImportKeyword &&\n node.arguments[0] &&\n ts.isStringLiteralLike(node.arguments[0])\n )\n checkReference(node.arguments[0].text);\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n return problems.length ? [...new Set(problems)].join('\\n') : null;\n },\n};\nconst plugin: VibeLintPlugin = {\n name: 'doom-cli',\n rules: {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["fs","path","ts","require_runtime","node_fs","node_path","typescript","folders","architecture","filePath","relative","configRoot","problems","source","checkReference","target","reference","visit","node","stableDispatcherMarker","statement","declaration","plugin"],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleDefinition, VibeLintPlugin } from '@agimon-ai/vibe-lint';\nimport ts from 'typescript';\nconst folders = new Set(['bin', 'cli', 'composition', 'builders', 'compiler', 'extensions', 'exports', 'prompts']);\nexport const architecture: RuleDefinition = {\n preflight: true,\n rule: 'Keep Doompi cli ownership explicit in folders, imports, and package exports',\n rationale:\n 'Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.',\n check(filePath, configRoot) {\n if (!fs.existsSync(filePath)) return null;\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n const problems: string[] = [];\n if (relative.startsWith('src/') && !folders.has(relative.split('/')[1]!))\n problems.push(`Unsupported source folder: ${relative}`);\n if (relative.startsWith('src/') && /\\.[cm]?tsx?$/.test(relative)) {\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n const checkReference = (reference: string): void => {\n const target = reference.startsWith('.')\n ? path\n .relative(configRoot, path.resolve(path.dirname(filePath), reference))\n .split(path.sep)\n .join('/')\n : undefined;\n if (\n (relative.startsWith('src/builders/') || relative.startsWith('src/composition/')) &&\n target?.startsWith('src/cli/')\n )\n problems.push(`Subsystem code cannot depend on command handling: ${reference}`);\n if (relative.startsWith('src/compiler/') && target && /^src\\/(?:cli|builders|composition)\\//.test(target))\n problems.push(`Compiler mechanics cannot depend on distribution policy: ${reference}`);\n };\n const visit = (node: ts.Node): void => {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n const reference = node.moduleSpecifier.text;\n checkReference(reference);\n if (/doompi-(?:extension-contracts|web-contracts|kernel)(?:\\/|$)/.test(reference))\n problems.push(`Removed package: ${reference}`);\n if (reference.includes('/src/')) problems.push(`Import a package capability export: ${reference}`);\n }\n if (\n ts.isCallExpression(node) &&\n node.expression.kind === ts.SyntaxKind.ImportKeyword &&\n node.arguments[0] &&\n ts.isStringLiteralLike(node.arguments[0])\n )\n checkReference(node.arguments[0].text);\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n return problems.length ? [...new Set(problems)].join('\\n') : null;\n },\n};\n\nexport const stableDispatcherMarker: RuleDefinition = {\n preflight: true,\n rule: 'Keep the generated Pi dispatcher marker fixed at 1',\n rationale: 'Generated content determines freshness. Changing the ownership marker creates needless migration code.',\n check(filePath, configRoot) {\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n if (relative !== 'src/builders/cli/piExtensionDispatcher/index.ts' || !fs.existsSync(filePath)) return null;\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n for (const statement of source.statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === 'PI_DISPATCHER_VERSION') {\n return declaration.initializer &&\n ts.isNumericLiteral(declaration.initializer) &&\n declaration.initializer.text === '1'\n ? null\n : 'PI_DISPATCHER_VERSION must remain 1';\n }\n }\n }\n return 'PI_DISPATCHER_VERSION must remain 1';\n },\n};\n\nconst plugin: VibeLintPlugin = {\n name: 'doom-cli',\n rules: {\n 'doom-cli-architecture': architecture,\n 'stable-dispatcher-marker': stableDispatcherMarker,\n },\n patterns: { ownership: { description: architecture.rule, includes: ['src/**/*.ts', 'package.json'] } },\n configs: {\n recommended: {\n rules: { 'doom-cli-architecture': 'error', 'stable-dispatcher-marker': 'error' },\n },\n },\n};\nexport default plugin;\n"],"mappings":"sRAKA,MAAMO,kBAAU,IAAI,IAAI,CAAC,MAAO,MAAO,cAAe,WAAY,WAAY,aAAc,UAAW,SAAS,CAAC,EACpGC,EAA+B,CAC1C,UAAW,GACX,KAAM,8EACN,UACE,sJACF,MAAM,EAAU,EAAY,CAC1B,GAAI,CAACR,EAAAA,QAAG,WAAWS,CAAQ,EAAG,OAAO,KACrC,IAAMC,EAAWT,EAAAA,QAAK,SAASU,EAAYF,CAAQ,CAAC,CAAC,WAAWR,EAAAA,QAAK,IAAK,GAAG,EACvEW,EAAqB,CAAC,EAG5B,GAFIF,EAAS,WAAW,MAAM,GAAK,CAACH,EAAQ,IAAIG,EAAS,MAAM,GAAG,CAAC,CAAC,EAAG,GACrEE,EAAS,KAAK,8BAA8BF,GAAU,EACpDA,EAAS,WAAW,MAAM,GAAK,eAAe,KAAKA,CAAQ,EAAG,CAChE,IAAMG,EAASX,EAAAA,QAAG,iBAAiBO,EAAUT,EAAAA,QAAG,aAAaS,EAAU,MAAM,EAAGP,EAAAA,QAAG,aAAa,OAAQ,EAAI,EACtGY,EAAkB,GAA4B,CAClD,IAAMC,EAASC,EAAU,WAAW,GAAG,EACnCf,EAAAA,QACG,SAASU,EAAYV,EAAAA,QAAK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K,IAAK,GAC/D,IAAM,mDAAqD,CAACD,EAAAA,QAAG,WAAWS,CAAQ,EAAG,OAAO,KACvG,IAAMI,EAASX,EAAAA,QAAG,iBAAiBO,EAAUT,EAAAA,QAAG,aAAaS,EAAU,MAAM,EAAGP,EAAAA,QAAG,aAAa,OAAQ,EAAI,EAC5G,IAAK,IAAMkB,KAAaP,EAAO,WAC7B,GAAKX,EAAAA,QAAG,oBAAoBkB,CAAS,EACrC,KAAK,IAAMC,KAAeD,EAAU,gBAAgB,aAClD,GAAIlB,EAAAA,QAAG,aAAamB,EAAY,IAAI,GAAKA,EAAY,KAAK,OAAS,wBACjE,OAAOA,EAAY,aACjBnB,EAAAA,QAAG,iBAAiBmB,EAAY,WAAW,GAC3CA,EAAY,YAAY,OAAS,IAC/B,KACA,qCAAA,CAIV,MAAO,qCACT,CACF,EAEMC,EAAyB,CAC7B,KAAM,WACN,MAAO,CACL,wBAAyBd,EACzB,2BAA4BW,CAC9B,EACA,SAAU,CAAE,UAAW,CAAE,YAAaX,EAAa,KAAM,SAAU,CAAC,cAAe,cAAc,CAAE,CAAE,EACrG,QAAS,CACP,YAAa,CACX,MAAO,CAAE,wBAAyB,QAAS,2BAA4B,OAAQ,CACjF,CACF,CACF"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RuleDefinition, VibeLintPlugin } from "@agimon-ai/vibe-lint";
|
|
2
2
|
//#region src/index.d.ts
|
|
3
3
|
export declare const architecture: RuleDefinition;
|
|
4
|
+
export declare const stableDispatcherMarker: RuleDefinition;
|
|
4
5
|
declare const plugin: VibeLintPlugin;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { plugin as default };
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;qBAMa,cAAc;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;qBAMa,cAAc;qBAuDd,wBAAwB;cAwB/B,QAAQ"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import e from"node:fs";import t from"node:path";import n from"typescript";const r
|
|
2
|
-
`):null}},a={name:`doom-cli`,rules:{"doom-cli-architecture":i},patterns:{ownership:{description:i.rule,includes:[`src/**/*.ts`,`package.json`]}},configs:{recommended:{rules:{"doom-cli-architecture":`error`}}}};export{i as architecture,a as
|
|
1
|
+
import e from"node:fs";import t from"node:path";import n from"typescript";const r=/* @__PURE__ */ new Set([`bin`,`cli`,`composition`,`builders`,`compiler`,`extensions`,`exports`,`prompts`]),i={preflight:!0,rule:`Keep Doompi cli ownership explicit in folders, imports, and package exports`,rationale:`Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.`,check(i,a){if(!e.existsSync(i))return null;let o=t.relative(a,i).replaceAll(t.sep,`/`),s=[];if(o.startsWith(`src/`)&&!r.has(o.split(`/`)[1])&&s.push(`Unsupported source folder: ${o}`),o.startsWith(`src/`)&&/\.[cm]?tsx?$/.test(o)){let r=n.createSourceFile(i,e.readFileSync(i,`utf8`),n.ScriptTarget.Latest,!0),c=e=>{let n=e.startsWith(`.`)?t.relative(a,t.resolve(t.dirname(i),e)).split(t.sep).join(`/`):void 0;(o.startsWith(`src/builders/`)||o.startsWith(`src/composition/`))&&n?.startsWith(`src/cli/`)&&s.push(`Subsystem code cannot depend on command handling: ${e}`),o.startsWith(`src/compiler/`)&&n&&/^src\/(?:cli|builders|composition)\//.test(n)&&s.push(`Compiler mechanics cannot depend on distribution policy: ${e}`)},l=e=>{if((n.isImportDeclaration(e)||n.isExportDeclaration(e))&&e.moduleSpecifier&&n.isStringLiteralLike(e.moduleSpecifier)){let t=e.moduleSpecifier.text;c(t),/doompi-(?:extension-contracts|web-contracts|kernel)(?:\/|$)/.test(t)&&s.push(`Removed package: ${t}`),t.includes(`/src/`)&&s.push(`Import a package capability export: ${t}`)}n.isCallExpression(e)&&e.expression.kind===n.SyntaxKind.ImportKeyword&&e.arguments[0]&&n.isStringLiteralLike(e.arguments[0])&&c(e.arguments[0].text),n.forEachChild(e,l)};l(r)}return s.length?[...new Set(s)].join(`
|
|
2
|
+
`):null}},a={preflight:!0,rule:`Keep the generated Pi dispatcher marker fixed at 1`,rationale:`Generated content determines freshness. Changing the ownership marker creates needless migration code.`,check(r,i){if(t.relative(i,r).replaceAll(t.sep,`/`)!==`src/builders/cli/piExtensionDispatcher/index.ts`||!e.existsSync(r))return null;let a=n.createSourceFile(r,e.readFileSync(r,`utf8`),n.ScriptTarget.Latest,!0);for(let e of a.statements)if(n.isVariableStatement(e)){for(let t of e.declarationList.declarations)if(n.isIdentifier(t.name)&&t.name.text===`PI_DISPATCHER_VERSION`)return t.initializer&&n.isNumericLiteral(t.initializer)&&t.initializer.text===`1`?null:`PI_DISPATCHER_VERSION must remain 1`}return`PI_DISPATCHER_VERSION must remain 1`}},o={name:`doom-cli`,rules:{"doom-cli-architecture":i,"stable-dispatcher-marker":a},patterns:{ownership:{description:i.rule,includes:[`src/**/*.ts`,`package.json`]}},configs:{recommended:{rules:{"doom-cli-architecture":`error`,"stable-dispatcher-marker":`error`}}}};export{i as architecture,o as default,a as stableDispatcherMarker};
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleDefinition, VibeLintPlugin } from '@agimon-ai/vibe-lint';\nimport ts from 'typescript';\nconst folders = new Set(['bin', 'cli', 'composition', 'builders', 'compiler', 'extensions', 'exports', 'prompts']);\nexport const architecture: RuleDefinition = {\n preflight: true,\n rule: 'Keep Doompi cli ownership explicit in folders, imports, and package exports',\n rationale:\n 'Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.',\n check(filePath, configRoot) {\n if (!fs.existsSync(filePath)) return null;\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n const problems: string[] = [];\n if (relative.startsWith('src/') && !folders.has(relative.split('/')[1]!))\n problems.push(`Unsupported source folder: ${relative}`);\n if (relative.startsWith('src/') && /\\.[cm]?tsx?$/.test(relative)) {\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n const checkReference = (reference: string): void => {\n const target = reference.startsWith('.')\n ? path\n .relative(configRoot, path.resolve(path.dirname(filePath), reference))\n .split(path.sep)\n .join('/')\n : undefined;\n if (\n (relative.startsWith('src/builders/') || relative.startsWith('src/composition/')) &&\n target?.startsWith('src/cli/')\n )\n problems.push(`Subsystem code cannot depend on command handling: ${reference}`);\n if (relative.startsWith('src/compiler/') && target && /^src\\/(?:cli|builders|composition)\\//.test(target))\n problems.push(`Compiler mechanics cannot depend on distribution policy: ${reference}`);\n };\n const visit = (node: ts.Node): void => {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n const reference = node.moduleSpecifier.text;\n checkReference(reference);\n if (/doompi-(?:extension-contracts|web-contracts|kernel)(?:\\/|$)/.test(reference))\n problems.push(`Removed package: ${reference}`);\n if (reference.includes('/src/')) problems.push(`Import a package capability export: ${reference}`);\n }\n if (\n ts.isCallExpression(node) &&\n node.expression.kind === ts.SyntaxKind.ImportKeyword &&\n node.arguments[0] &&\n ts.isStringLiteralLike(node.arguments[0])\n )\n checkReference(node.arguments[0].text);\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n return problems.length ? [...new Set(problems)].join('\\n') : null;\n },\n};\nconst plugin: VibeLintPlugin = {\n name: 'doom-cli',\n rules: {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["fs","path","ts","folders","architecture","filePath","relative","configRoot","problems","source","checkReference","target","reference","visit","node","stableDispatcherMarker","statement","declaration","plugin"],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleDefinition, VibeLintPlugin } from '@agimon-ai/vibe-lint';\nimport ts from 'typescript';\nconst folders = new Set(['bin', 'cli', 'composition', 'builders', 'compiler', 'extensions', 'exports', 'prompts']);\nexport const architecture: RuleDefinition = {\n preflight: true,\n rule: 'Keep Doompi cli ownership explicit in folders, imports, and package exports',\n rationale:\n 'Core owns reusable runtime logic. CLI builders and composition select and wire features. Feature-specific policies remain in their owning packages.',\n check(filePath, configRoot) {\n if (!fs.existsSync(filePath)) return null;\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n const problems: string[] = [];\n if (relative.startsWith('src/') && !folders.has(relative.split('/')[1]!))\n problems.push(`Unsupported source folder: ${relative}`);\n if (relative.startsWith('src/') && /\\.[cm]?tsx?$/.test(relative)) {\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n const checkReference = (reference: string): void => {\n const target = reference.startsWith('.')\n ? path\n .relative(configRoot, path.resolve(path.dirname(filePath), reference))\n .split(path.sep)\n .join('/')\n : undefined;\n if (\n (relative.startsWith('src/builders/') || relative.startsWith('src/composition/')) &&\n target?.startsWith('src/cli/')\n )\n problems.push(`Subsystem code cannot depend on command handling: ${reference}`);\n if (relative.startsWith('src/compiler/') && target && /^src\\/(?:cli|builders|composition)\\//.test(target))\n problems.push(`Compiler mechanics cannot depend on distribution policy: ${reference}`);\n };\n const visit = (node: ts.Node): void => {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n const reference = node.moduleSpecifier.text;\n checkReference(reference);\n if (/doompi-(?:extension-contracts|web-contracts|kernel)(?:\\/|$)/.test(reference))\n problems.push(`Removed package: ${reference}`);\n if (reference.includes('/src/')) problems.push(`Import a package capability export: ${reference}`);\n }\n if (\n ts.isCallExpression(node) &&\n node.expression.kind === ts.SyntaxKind.ImportKeyword &&\n node.arguments[0] &&\n ts.isStringLiteralLike(node.arguments[0])\n )\n checkReference(node.arguments[0].text);\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n return problems.length ? [...new Set(problems)].join('\\n') : null;\n },\n};\n\nexport const stableDispatcherMarker: RuleDefinition = {\n preflight: true,\n rule: 'Keep the generated Pi dispatcher marker fixed at 1',\n rationale: 'Generated content determines freshness. Changing the ownership marker creates needless migration code.',\n check(filePath, configRoot) {\n const relative = path.relative(configRoot, filePath).replaceAll(path.sep, '/');\n if (relative !== 'src/builders/cli/piExtensionDispatcher/index.ts' || !fs.existsSync(filePath)) return null;\n const source = ts.createSourceFile(filePath, fs.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest, true);\n for (const statement of source.statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === 'PI_DISPATCHER_VERSION') {\n return declaration.initializer &&\n ts.isNumericLiteral(declaration.initializer) &&\n declaration.initializer.text === '1'\n ? null\n : 'PI_DISPATCHER_VERSION must remain 1';\n }\n }\n }\n return 'PI_DISPATCHER_VERSION must remain 1';\n },\n};\n\nconst plugin: VibeLintPlugin = {\n name: 'doom-cli',\n rules: {\n 'doom-cli-architecture': architecture,\n 'stable-dispatcher-marker': stableDispatcherMarker,\n },\n patterns: { ownership: { description: architecture.rule, includes: ['src/**/*.ts', 'package.json'] } },\n configs: {\n recommended: {\n rules: { 'doom-cli-architecture': 'error', 'stable-dispatcher-marker': 'error' },\n },\n },\n};\nexport default plugin;\n"],"mappings":"0EAKA,MAAMG,kBAAU,IAAI,IAAI,CAAC,MAAO,MAAO,cAAe,WAAY,WAAY,aAAc,UAAW,SAAS,CAAC,EACpGC,EAA+B,CAC1C,UAAW,GACX,KAAM,8EACN,UACE,sJACF,MAAM,EAAU,EAAY,CAC1B,GAAI,CAACJ,E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ugin-doom-cli",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.31",
|
|
4
4
|
"description": "Architecture rules for Doompi cli packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"doompi",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"typescript": "6.0.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@agimon-ai/vibe-lint": "0.0.1-alpha.
|
|
47
|
-
"@types/node": "26.
|
|
48
|
-
"@vitest/coverage-v8": "5.0.
|
|
46
|
+
"@agimon-ai/vibe-lint": "0.0.1-alpha.45",
|
|
47
|
+
"@types/node": "26.6.2",
|
|
48
|
+
"@vitest/coverage-v8": "5.0.1",
|
|
49
49
|
"tsdown": "0.23.0",
|
|
50
|
-
"vitest": "5.0.
|
|
50
|
+
"vitest": "5.0.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@agimon-ai/vibe-lint": "0.0.1-alpha.
|
|
53
|
+
"@agimon-ai/vibe-lint": "0.0.1-alpha.45"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=22.19.0"
|
package/dist/index.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RuleDefinition, VibeLintPlugin } from "@agimon-ai/vibe-lint";
|
|
2
|
-
//#region src/index.d.ts
|
|
3
|
-
export declare const architecture: RuleDefinition;
|
|
4
|
-
declare const plugin: VibeLintPlugin;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { plugin as default };
|
|
7
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;qBAMa,cAAc;cAsDrB,QAAQ"}
|