@agimon-ai/vibe-lint-plugin-doom-cli 0.0.1-alpha.30 → 0.0.1-alpha.32

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.
@@ -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};\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,MAAM,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E,UAAW,CAAE,YAAa,EAAa,KAAM,SAAU,CAAC,cAAe,cAAc,CAAE,CAAE,EACrG,QAAS,CACP,YAAa,CACX,MAAO,CAAE,wBAAyB,QAAS,2BAA4B,OAAQ,CACjF,CACF,CACF"}
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: {\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ACjE,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"}
@@ -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};\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,MAAM,kBAAU,IAAI,IAAI,CAAC,MAAO,MAAO,cAAe,WAAY,WAAY,aAAc,UAAW,SAAS,CAAC,EACpG,EAA+B,CAC1C,UAAW,GACX,KAAM,8EACN,UACE,sJACF,MAAM,EAAU,EAAY,CAC1B,GAAI,CAAC,EAAG,WAAW,CAAQ,EAAG,OAAO,KACrC,IAAM,EAAW,EAAK,SAAS,EAAY,CAAQ,CAAC,CAAC,WAAW,EAAK,IAAK,GAAG,EACvE,EAAqB,CAAC,EAG5B,GAFI,EAAS,WAAW,MAAM,GAAK,CAAC,EAAQ,IAAI,EAAS,MAAM,GAAG,CAAC,CAAC,EAAG,GACrE,EAAS,KAAK,8BAA8B,GAAU,EACpD,EAAS,WAAW,MAAM,GAAK,eAAe,KAAK,CAAQ,EAAG,CAChE,IAAM,EAAS,EAAG,iBAAiB,EAAU,EAAG,aAAa,EAAU,MAAM,EAAG,EAAG,aAAa,OAAQ,EAAI,EACtG,EAAkB,GAA4B,CAClD,IAAM,EAAS,EAAU,WAAW,GAAG,EACnC,EACG,SAAS,EAAY,EAAK,QAAQ,EAAK,QAAQ,CAAQ,EAAG,CAAS,CAAC,CAAC,CACrE,MAAM,EAAK,GAAG,CAAC,CACf,KAAK,GAAG,EACX,IAAA,IAED,EAAS,WAAW,eAAe,GAAK,EAAS,WAAW,kBAAkB,IAC/E,GAAQ,WAAW,UAAU,GAE7B,EAAS,KAAK,qDAAqD,GAAW,EAC5E,EAAS,WAAW,eAAe,GAAK,GAAU,uCAAuC,KAAK,CAAM,GACtG,EAAS,KAAK,4DAA4D,GAAW,CACzF,EACM,EAAS,GAAwB,CACrC,IACG,EA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,EACA,SAAU,CAAE,UAAW,CAAE,YAAa,EAAa,KAAM,SAAU,CAAC,cAAe,cAAc,CAAE,CAAE,EACrG,QAAS,CACP,YAAa,CACX,MAAO,CAAE,wBAAyB,QAAS,2BAA4B,OAAQ,CACjF,CACF,CACF"}
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: { 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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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/vibe-lint-plugin-doom-cli",
3
- "version": "0.0.1-alpha.30",
3
+ "version": "0.0.1-alpha.32",
4
4
  "description": "Architecture rules for Doompi cli packages",
5
5
  "keywords": [
6
6
  "doompi",