@codenanny/core
v0.4.0
Published
Core library for codenanny: sqlite + FTS5 ingest of Claude Code transcripts, narrative timeline API, resume-bundle generator, disk reconciler. End users want the `codenanny` CLI package instead.
Maintainers
Readme
@codenanny/core
Core library for codenanny. Most users want the CLI package, not this.
Ingests Claude Code JSONL transcripts, indexes them with sqlite + FTS5, captures every file write/edit/read (including file-creating Bash commands), and exposes an HTTP/JS API for the unified narrative timeline, resume-bundle generation, and disk-path reconciler.
This package is the engine behind the user-facing codenanny CLI. It's published separately so plugkit hosts can embed the core directly.
Install
npm install @codenanny/coreEnd-user looking to run codenanny? Install the CLI instead:
npm install -g codenanny
codenanny serveAs a standalone server
import express from 'express';
import Database from 'better-sqlite3';
import { createHost } from '@codenanny/plugkit';
import codenanny from '@codenanny/core';
const app = express();
const db = new Database('codenanny.db');
const host = createHost({ app, db });
host.register(codenanny({ mountPath: '/' }));
app.listen(7700, () => console.log('codenanny live at http://localhost:7700'));As a plugkit module inside a host app
Same API — just mount it on a path:
host.register(codenanny({ mountPath: '/sessions' }));Library API (for hosts and other modules)
import { createApi } from '@codenanny/core';
const api = createApi(db);
api.sessions.list({ limit: 100 })
api.sessions.get(id)
api.sessions.prompts(id)
api.sessions.files(id)
api.sessions.byPath(path, { mode: 'auto', limit: 50 }) // disk reconciler
api.files.byProject(projectId)
api.files.recent(100)
api.projects.list()
api.search('my query', { limit: 50 })
api.stats()import { resumeBundle } from '@codenanny/core';
const bundle = resumeBundle(api, sessionId, { turns: 6, maxTurnChars: 4000 });
// bundle.formatted is a paste-ready markdown blob.HTTP API
GET /api/sessions?limit=&project_id=GET /api/sessions/:id— session + prompts + filesGET /api/sessions/:id/resume?format=text|json&turns=N— resume bundleGET /api/files/recent?limit=GET /api/files/by-path?path=&mode=exact|prefix|auto&limit=— disk reconcilerGET /api/projectsGET /api/search?q=&limit=GET /api/statsGET /api/events— SSE stream ofsession:updated,project:created,ready
License
MIT. Created by nobleglitch.
