{"_id":"@alsania-io/scribe","name":"@alsania-io/scribe","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alsania-io/scribe","version":"0.1.0","description":"Markdown-based audit logging with redaction for Alsania ecosystem","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","dev":"tsc --watch","clean":"rm -rf dist","prepublishOnly":"npm run build"},"keywords":["logging","audit","markdown","redaction","alsania","scribe"],"author":{"name":"Alsania I/O","email":"admin@alsania-io.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alsania-dev/alsania-io-utils.git"},"engines":{"node":">=18.0.0"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.0.0"},"gitHead":"db32871ef13ff20ccf69e74a63dec3ccaf7ff1db","_id":"@alsania-io/scribe@0.1.0","bugs":{"url":"https://github.com/alsania-dev/alsania-io-utils/issues"},"homepage":"https://github.com/alsania-dev/alsania-io-utils#readme","_nodeVersion":"24.14.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-d/+B54cUA/KBDL4i1xKoDOEsWJFRwI7i4iZVMAoFRiEkAEkXR8tT6kMlfxDc+tRTSU4fnJD2krJ3O7ritXOJig==","shasum":"1a95dfb71b4c5ebaf6ce89a0b84b575477184a26","tarball":"https://registry.npmjs.org/@alsania-io/scribe/-/scribe-0.1.0.tgz","fileCount":6,"unpackedSize":28280,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCUh0H/mZdrncyc286QNXYRmDfgKfg7P9HF4Uc21gs7EAIhAMkt0lqwanu4RRM3VUV0/eRGtUOF0cCdf2draWvlbx68"}]},"_npmUser":{"name":"sigmasauer07","email":"sigma.sauer07@gmail.com"},"directories":{},"maintainers":[{"name":"sigmasauer07","email":"sigma.sauer07@gmail.com"},{"name":"echo-dev","email":"alsaniasoftware@gmail.com"},{"name":"sigmasauer-dev","email":"sigmasauer.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/scribe_0.1.0_1784583069019_0.9980550628173996"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T21:31:08.765Z","0.1.0":"2026-07-20T21:31:09.165Z","modified":"2026-07-20T21:31:09.550Z"},"maintainers":[{"name":"sigmasauer07","email":"sigma.sauer07@gmail.com"},{"name":"echo-dev","email":"alsaniasoftware@gmail.com"},{"name":"sigmasauer-dev","email":"sigmasauer.dev@gmail.com"}],"description":"Markdown-based audit logging with redaction for Alsania ecosystem","homepage":"https://github.com/alsania-dev/alsania-io-utils#readme","keywords":["logging","audit","markdown","redaction","alsania","scribe"],"repository":{"type":"git","url":"git+https://github.com/alsania-dev/alsania-io-utils.git"},"author":{"name":"Alsania I/O","email":"admin@alsania-io.com"},"bugs":{"url":"https://github.com/alsania-dev/alsania-io-utils/issues"},"license":"MIT","readme":"# @alsania-io/scribe\n\n> Markdown-based audit logging with redaction for Alsania ecosystem\n\n## Features\n\n- 📝 **Markdown-based logs** — Human-readable, version-control friendly\n- 🔒 **Automatic redaction** — Sensitive fields (API keys, passwords, tokens) are redacted\n- 📅 **Session-based organization** — Logs organized by date and session\n- 🔗 **Anchoring support** — SHA3-256 hashing for on-chain verification\n- 🎨 **Configurable templates** — Customizable header and entry formats\n- 🚀 **Zero dependencies** — Pure TypeScript, no external dependencies\n\n## Installation\n\n```bash\nnpm install @alsania-io/scribe\n```\n\n## Quick Start\n\n```typescript\nimport { Scribe } from '@alsania-io/scribe';\n\nconst scribe = new Scribe({\n  root: './logs',\n  redact: ['Authorization', 'api_key', 'password']\n});\n\n// Start a session\nscribe.session('session-123', {\n  owner: 'Sigma',\n  model: 'echo-cloud',\n  mcpUrl: 'http://localhost:8050/mcp'\n});\n\n// Log different types of entries\nscribe.prompt('What is the meaning of life?');\nscribe.response('The meaning of life is 42.');\nscribe.toolCall('calculator', { expression: '2 + 2' }, 4);\nscribe.error('Something went wrong');\nscribe.event('connection_established', { peer: 'Aegis' });\n\n// Get the latest log file\nconst latest = scribe.getLatestLog();\nconsole.log(`Log file: ${latest}`);\n\n// Anchor the log (for on-chain verification)\nconst anchor = scribe.anchorLatest();\nconsole.log(`Hash: ${anchor.hash}`);\n\n// Get all anchors\nconst anchors = scribe.getAnchors();\nconsole.log(anchors);\n```\n\n## Configuration\n\n```typescript\nconst config = {\n  // Root directory for logs\n  root: './logs',\n  \n  // Log format (only 'markdown' for now)\n  mode: 'markdown',\n  \n  // Automatically log tokens and patches\n  autoLogTokens: true,\n  autoLogPatches: true,\n  \n  // Fields to redact\n  redact: ['Authorization', 'api_key', 'password', 'secret'],\n  \n  // Header template for new sessions\n  headerTemplate: `# Scribe — {{date}} ({{session}})\n  \n**Owner:** {{owner}}\n**Model:** {{model}}\n**MCP:** {{mcp}}\n\n---`,\n  \n  // Entry template\n  entryTemplate: `## {{time}} — {{type}}\n  \n{{content}}\n`\n};\n```\n\n## API\n\n### `new Scribe(config?)`\nCreate a new Scribe instance.\n\n### `scribe.session(id, context?)`\nStart a new session. All subsequent logs will be written to this session.\n\n### `scribe.prompt(content, metadata?)`\nLog a user prompt.\n\n### `scribe.response(content, metadata?)`\nLog an AI response.\n\n### `scribe.toolCall(toolName, args, result?)`\nLog a tool call with arguments and result.\n\n### `scribe.error(message, stack?, metadata?)`\nLog an error with optional stack trace.\n\n### `scribe.event(name, data?)`\nLog a custom event.\n\n### `scribe.write(entry)`\nWrite a raw entry.\n\n### `scribe.getLatestLog()`\nGet the path to the latest log file.\n\n### `scribe.hashLog(filePath)`\nCompute SHA3-256 hash of a log file.\n\n### `scribe.anchorLatest()`\nAnchor the latest log file (creates an anchor record).\n\n### `scribe.getAnchors()`\nGet all anchor records.\n\n## Integration with Alsania Projects\n\n### AlsaniaMCP\n```typescript\nimport { Scribe } from '@alsania-io/scribe';\n\nconst scribe = new Scribe({ root: '/var/log/alsaniamcp' });\nscribe.session(serverId, { owner: 'Sigma', model: 'echo-cloud' });\n```\n\n### DevConX\n```typescript\nimport { Scribe } from '@alsania-io/scribe';\n\nconst scribe = new Scribe({ root: '~/.devcon/logs' });\nscribe.session(extensionSession, { owner: 'Sigma' });\n```\n\n### Nyx\n```typescript\nimport { Scribe } from '@alsania-io/scribe';\n\nconst scribe = new Scribe({ root: '~/.nyx/logs' });\nscribe.session(browserSession, { owner: 'Sigma' });\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-d99c4b18594fd9e3444a44056d5ac908"}