@mgravey/loom-coding
v0.2.0
Published
Reusable coding sessions with prompts, follow-ups, cancellation, transcripts, tools, and runtime dispatch for Loom.js.
Maintainers
Readme
@mgravey/loom-coding
High-level reusable coding sessions for Loom.js, including prompts, streamed events, follow-ups, cancellation, transcripts, custom tools, and optional runtime dispatch.
pnpm add @mgravey/loom-codingimport { createCodingSession } from '@mgravey/loom-coding';
const session = createCodingSession({ model, tools });Models that implement compact() can opt into provider-native context compaction:
const session = createCodingSession({
model,
tools,
transcript,
contextCheckpoint: savedCheckpoint,
contextCompaction: { maximumCharacters: 500_000 },
});
session.subscribe((event) => {
if (event.type === 'context-compacted') saveCheckpoint(event.checkpoint);
});The public transcript remains complete. A checkpoint contains opaque model items plus the number of
leading transcript entries they replace; persist both together. Compaction is disabled unless
contextCompaction is supplied.
See the getting-started guide for a complete in-memory example.
Licensed under MPL-2.0.
