diff --git a/dist/cli.d.ts b/dist/cli.d.ts deleted file mode 100644 index faaadd5..0000000 --- a/dist/cli.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -export {}; -//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/dist/cli.d.ts.map b/dist/cli.d.ts.map deleted file mode 100644 index f022439..0000000 --- a/dist/cli.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/cli.js b/dist/cli.js deleted file mode 100644 index df4b950..0000000 --- a/dist/cli.js +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const promises_1 = require("node:fs/promises"); -const inspection_1 = require("cultcache-ts/inspection"); -const huginn_eve_dsl_1 = require("./huginn-eve-dsl"); -async function main(args) { - const filePath = args[0]; - if (!filePath || args.includes("--help") || args.includes("-h")) { - process.stderr.write("Usage: huginn \n"); - process.exitCode = filePath ? 0 : 1; - return; - } - const bytes = await (0, promises_1.readFile)(filePath); - const inspection = (0, inspection_1.inspectCultCacheBytes)(filePath, bytes); - process.stdout.write(`${(0, huginn_eve_dsl_1.buildHuginnEveDsl)(inspection)}\n`); -} -void main(process.argv.slice(2)).catch((error) => { - process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`); - process.exitCode = 1; -}); diff --git a/dist/huginn-eve-dsl.d.ts b/dist/huginn-eve-dsl.d.ts deleted file mode 100644 index 4bee7a3..0000000 --- a/dist/huginn-eve-dsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CultCacheInspection } from "cultcache-ts/inspection"; -export declare function buildHuginnEveDsl(inspection: CultCacheInspection): string; -//# sourceMappingURL=huginn-eve-dsl.d.ts.map \ No newline at end of file diff --git a/dist/huginn-eve-dsl.d.ts.map b/dist/huginn-eve-dsl.d.ts.map deleted file mode 100644 index d311c37..0000000 --- a/dist/huginn-eve-dsl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"huginn-eve-dsl.d.ts","sourceRoot":"","sources":["../src/huginn-eve-dsl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAA0C,MAAM,yBAAyB,CAAC;AAE3G,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CA8BzE"} \ No newline at end of file diff --git a/dist/huginn-eve-dsl.js b/dist/huginn-eve-dsl.js deleted file mode 100644 index 2bbb10a..0000000 --- a/dist/huginn-eve-dsl.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.buildHuginnEveDsl = buildHuginnEveDsl; -function buildHuginnEveDsl(inspection) { - return [ - "# Huginn emits Eve DSL. Renderers compile and lower it.", - `surface cultcache.huginn.inspector ${quoteDsl("Huginn .cc Inspector")}`, - "version 1", - "", - "collection huginn.catalog.entries", - ...inspection.catalog.map((entry) => `item huginn.catalog.entries ${quoteDsl(renderCatalogEntry(entry))}`), - "", - "collection huginn.records.entries", - ...inspection.records.map((record) => `item huginn.records.entries ${quoteDsl(renderRecord(record))}`), - "", - "card source \"Source Witness\"", - `text ${quoteDsl(`file: ${inspection.filePath}`)}`, - `text ${quoteDsl(`format: ${inspection.format}`)}`, - `text ${quoteDsl(`bytes: ${inspection.fileSizeBytes}`)}`, - "text \".cc bytes are authority; Huginn only emits Eve DSL.\"", - "end", - "", - "card catalog \"Schema Catalog\"", - `text ${quoteDsl(`schemas: ${inspection.catalog.length}`)}`, - "list \"Catalog Entries\" bind huginn.catalog.entries", - "end", - "", - "card records \"Persisted Records\"", - `text ${quoteDsl(`records: ${inspection.records.length}`)}`, - "list \"Record Entries\" bind huginn.records.entries", - "end", - "", - ].join("\n"); -} -function renderCatalogEntry(entry) { - return [ - entry.schemaName, - entry.schemaVersion, - entry.schemaId, - `${entry.members.length} members`, - ].join(" | "); -} -function renderRecord(record) { - const status = record.payloadDecodeError ? `decode error: ${record.payloadDecodeError}` : "decoded"; - return [ - record.key, - record.schemaName, - record.storedAt, - `${record.payloadBytes} bytes`, - status, - ].join(" | "); -} -function quoteDsl(value) { - return JSON.stringify(value); -} diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index c4ae442..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { buildHuginnEveDsl } from "./huginn-eve-dsl"; -export { inspectCultCacheBytes } from "cultcache-ts/inspection"; -export type { CultCacheInspection, InspectedCatalogEntry, InspectedCatalogMember, InspectedRecord, } from "cultcache-ts/inspection"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map deleted file mode 100644 index 05b291f..0000000 --- a/dist/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,GAChB,MAAM,yBAAyB,CAAC"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index c1ce7d8..0000000 --- a/dist/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.inspectCultCacheBytes = exports.buildHuginnEveDsl = void 0; -var huginn_eve_dsl_1 = require("./huginn-eve-dsl"); -Object.defineProperty(exports, "buildHuginnEveDsl", { enumerable: true, get: function () { return huginn_eve_dsl_1.buildHuginnEveDsl; } }); -var inspection_1 = require("cultcache-ts/inspection"); -Object.defineProperty(exports, "inspectCultCacheBytes", { enumerable: true, get: function () { return inspection_1.inspectCultCacheBytes; } }); diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index c00f90a..0000000 --- a/package-lock.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@gamecult/huginn", - "version": "0.13.5", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@gamecult/huginn", - "version": "0.13.5", - "license": "MIT", - "dependencies": { - "cultcache-ts": "file:../CultLib/packages/cultcache-ts" - }, - "bin": { - "huginn": "dist/cli.js" - }, - "devDependencies": { - "@types/node": "^24.0.0", - "typescript": "^5.9.0" - } - }, - "../CultLib/packages/cultcache-ts": { - "version": "0.13.5", - "license": "MIT", - "dependencies": { - "@msgpack/msgpack": "^3.1.3", - "zod": "^3.25.76" - }, - "devDependencies": { - "@types/node": "^24.0.0", - "typescript": "^5.9.0" - } - }, - "node_modules/@types/node": { - "version": "24.12.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.2.tgz", - "integrity": "sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~7.16.0" - } - }, - "node_modules/cultcache-ts": { - "resolved": "../CultLib/packages/cultcache-ts", - "link": true - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "dev": true, - "license": "MIT" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 1492a3f..0000000 --- a/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@gamecult/huginn", - "version": "0.13.5", - "description": "Huginn .cc inspection and Eve projection surface for CultCache state.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "bin": { - "huginn": "dist/cli.js" - }, - "files": [ - "dist" - ], - "scripts": { - "build": "tsc -p tsconfig.json", - "typecheck": "tsc -p tsconfig.json --pretty false", - "test": "npm run build" - }, - "keywords": [ - "messagepack", - "schema", - "cache", - "persistence", - "zod", - "typescript" - ], - "author": "metacratic", - "license": "MIT", - "dependencies": { - "cultcache-ts": "file:../CultLib/packages/cultcache-ts" - }, - "devDependencies": { - "@types/node": "^24.0.0", - "typescript": "^5.9.0" - } -} diff --git a/src/cli.ts b/src/cli.ts deleted file mode 100644 index 2c76b0e..0000000 --- a/src/cli.ts +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node -import { readFile } from "node:fs/promises"; -import { inspectCultCacheBytes } from "cultcache-ts/inspection"; - -import { buildHuginnEveDsl } from "./huginn-eve-dsl"; - -async function main(args: string[]): Promise { - const filePath = args[0]; - if (!filePath || args.includes("--help") || args.includes("-h")) { - process.stderr.write("Usage: huginn \n"); - process.exitCode = filePath ? 0 : 1; - return; - } - - const bytes = await readFile(filePath); - const inspection = inspectCultCacheBytes(filePath, bytes); - process.stdout.write(`${buildHuginnEveDsl(inspection)}\n`); -} - -void main(process.argv.slice(2)).catch((error: unknown) => { - process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`); - process.exitCode = 1; -}); diff --git a/src/huginn-eve-dsl.ts b/src/huginn-eve-dsl.ts deleted file mode 100644 index c143966..0000000 --- a/src/huginn-eve-dsl.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { CultCacheInspection, InspectedCatalogEntry, InspectedRecord } from "cultcache-ts/inspection"; - -export function buildHuginnEveDsl(inspection: CultCacheInspection): string { - return [ - "# Huginn emits Eve DSL. Renderers compile and lower it.", - `surface cultcache.huginn.inspector ${quoteDsl("Huginn .cc Inspector")}`, - "version 1", - "", - "collection huginn.catalog.entries", - ...inspection.catalog.map((entry) => `item huginn.catalog.entries ${quoteDsl(renderCatalogEntry(entry))}`), - "", - "collection huginn.records.entries", - ...inspection.records.map((record) => `item huginn.records.entries ${quoteDsl(renderRecord(record))}`), - "", - "card source \"Source Witness\"", - `text ${quoteDsl(`file: ${inspection.filePath}`)}`, - `text ${quoteDsl(`format: ${inspection.format}`)}`, - `text ${quoteDsl(`bytes: ${inspection.fileSizeBytes}`)}`, - "text \".cc bytes are authority; Huginn only emits Eve DSL.\"", - "end", - "", - "card catalog \"Schema Catalog\"", - `text ${quoteDsl(`schemas: ${inspection.catalog.length}`)}`, - "list \"Catalog Entries\" bind huginn.catalog.entries", - "end", - "", - "card records \"Persisted Records\"", - `text ${quoteDsl(`records: ${inspection.records.length}`)}`, - "list \"Record Entries\" bind huginn.records.entries", - "end", - "", - ].join("\n"); -} - -function renderCatalogEntry(entry: InspectedCatalogEntry): string { - return [ - entry.schemaName, - entry.schemaVersion, - entry.schemaId, - `${entry.members.length} members`, - ].join(" | "); -} - -function renderRecord(record: InspectedRecord): string { - const status = record.payloadDecodeError ? `decode error: ${record.payloadDecodeError}` : "decoded"; - return [ - record.key, - record.schemaName, - record.storedAt, - `${record.payloadBytes} bytes`, - status, - ].join(" | "); -} - -function quoteDsl(value: string): string { - return JSON.stringify(value); -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 65afb40..0000000 --- a/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { buildHuginnEveDsl } from "./huginn-eve-dsl"; -export { inspectCultCacheBytes } from "cultcache-ts/inspection"; -export type { - CultCacheInspection, - InspectedCatalogEntry, - InspectedCatalogMember, - InspectedRecord, -} from "cultcache-ts/inspection"; diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 619e402..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "Node16", - "moduleResolution": "Node16", - "lib": [ - "ES2022" - ], - "strict": true, - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src/index.ts", - "src/huginn-eve-dsl.ts", - "src/cli.ts" - ], - "exclude": [ - "test/**/*.ts" - ] -}