Skip to content

@makaio/services-log-import

Central registry for log importers from adapters and extensions.

┌─────────────────────────────────────────────────────────────┐
│ LogImportRegistry │
│ Manages registration lifecycle for LogImporter instances │
│ Coordinates LogImportOrchestrator per registered importer │
└─────────────────────────────────────────────────────────────┘
┌──────────────────────┐ ┌──────────────────────────────────┐
│ Adapter importers │ │ Extension importers │
│ id: adapterId │ │ id: 'package:{name}' │
└──────────────────────┘ └──────────────────────────────────┘

src/log-import-registry.ts

Central registry that:

  • Accepts LogImporterRegistration entries from adapters and extensions
  • Creates and manages LogImportOrchestrator instances per importer
  • Tracks whether orchestrators were started by the registry (managed lifecycle)
interface LogImporterRegistration {
id: string; // adapterId or 'package:{name}'
adapterName: string; // e.g., 'claude-code-cli'
displayName: string; // e.g., 'Claude Code'
source: 'adapter' | 'extension';
importer: LogImporter<unknown, unknown>;
logFilePattern: string; // e.g., '**\/session.jsonl'
supportsManualImport?: boolean;
orchestratorFactory?: OrchestratorFactory;
}
import { LogImportRegistry } from '@makaio/services-log-import';
const registry = new LogImportRegistry({ bus });
await registry.init();
await registry.register({
id: 'my-adapter',
adapterName: 'claude-code-cli',
displayName: 'Claude Code',
source: 'adapter',
importer: myAdapterImporter,
logFilePattern: '**/session.jsonl',
});
// Cleanup on shutdown
await registry.destroy();

init() registers the bus handlers and capability subscription; destroy() stops/disposes managed orchestrators and unsubscribes those handlers. Registering importers alone does not install the bus surface.

  • Root exports include LogImportRegistry, createLogImportContributionProcessor, LogImporterRegistration, OrchestratorFactory, LogImporterInfo, storage registration helpers, and the package lifecycle token.
  • ./log-import and ./namespace are side-effect entries for registering the log-import bus surface.
  • ./schemas exports the bus schema objects used by the namespace and handlers.

Part of the Makaio AI Framework