npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@maverick-spirit/talk-track

v0.0.4

Published

A tool for logging and archiving conversation data for AI applications.

Downloads

203

Readme

@maverick-spirit/talk-track

Talk-Track is a logging tool for recording full conversation sessions between users and AI, allowing you to log multiple back-and-forth messages within a single JSON file for each session.

Installation

Install Talk-Track from npm:

npm install @maverick-spirit/talk-track

Usage

Configuring Talk-Track

To configure Talk-Track dynamically, use the config method. You can enable or disable console logging by setting debug to true or false.

Example

const talkTrack = require('@maverick-spirit/talk-track');

// Enable debug logging
await talkTrack.config({ debug: true });

Basic Logging

Once configured, you can start logging messages. Simply use the log method and provide a role and message. All messages in a session will be stored in a single JSON file with a unique timestamp.

Example

talkTrack.log({
  role: 'user',
  message: 'Hello, Talk-Track!'
});

talkTrack.log({
  role: 'AI',
  message: 'Hello! How can I assist you today?'
});

Directory Structure

Talk-Track saves logs to the following directory structure:

./.maverick-spirit/talk-track/<timestamp>.json

Each log file is named by the session start timestamp and contains an array of conversation entries, allowing you to store a full back-and-forth conversation in one file.

API

talkTrack.config({ debug: boolean })

Configures Talk-Track with custom settings.

  • debug: boolean — Enables or disables console logging. Set debug: true to allow console logs during logging operations.

Example

await talkTrack.config({ debug: true });

talkTrack.log({ role, message })

Logs a message with the specified role and content in the active conversation file for the session.

  • role: string — Represents the source or type of the message. Flexible to accept any string, allowing custom roles like 'user', 'AI', 'system', 'admin', etc.
  • message: string — The message text.

Example in TypeScript

talkTrack.log({
  role: 'user',
  message: 'Can you explain quantum mechanics?'
});

talkTrack.log({
  role: 'AI',
  message: 'Quantum mechanics studies the behavior of particles on an atomic level...'
});

Example Output

A single JSON file for a session with multiple messages:

[
  {
    "timestamp": "2024-11-05T10:30:00.000Z",
    "processId": "a1b2c3d4-5e6f-7g8h-9i10j11k12l13",
    "role": "user",
    "message": "Hello, Talk-Track!"
  },
  {
    "timestamp": "2024-11-05T10:30:10.000Z",
    "processId": "a1b2c3d4-5e6f-7g8h-9i10j11k12l13",
    "role": "AI",
    "message": "Hello! How can I assist you today?"
  },
  {
    "timestamp": "2024-11-05T10:30:20.000Z",
    "processId": "a1b2c3d4-5e6f-7g8h-9i10j11k12l13",
    "role": "user",
    "message": "Can you explain quantum mechanics?"
  }
]

License

MIT License. See the LICENSE file for more information.


With Talk-Track, you can log entire conversations in one organized file, simplifying tracking, debugging, and reviewing interactions.