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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@felan-ai/ext-session-title

v0.3.1

Published

Portable automatic session title generation for Felan

Downloads

909

Readme

@felan-ai/ext-session-title

Portable automatic session-name generation for Felan hosts.

The extension waits for the first user prompt, asks the host to generate a bounded title, and persists it through pi.setSessionName(). It skips named, resumed, forked, and previously used sessions. Generation is detached from the main turn and cancelled during session shutdown. The host's prepare() method decides which Pi modes are supported, including headless modes.

formatSessionTerminalTitle() returns a control-character-free terminal title containing the session name alone, or the working-directory basename when the session is unnamed. TUI hosts can use it for every terminal-title refresh.

Hosts provide SessionTitleHost so credentials, model access, billing, and external persistence remain outside this package. prepare() can decline a mode and can provide preferredModel when its model policy differs from the current Pi model. The host must treat the prompt and generated title as untrusted data.

import { createSessionTitleExtension } from '@felan-ai/ext-session-title';

const extension = createSessionTitleExtension({
  prepare: async ({ currentModel, prompt }) => {
    if (!currentModel) return undefined;
    return {
      prompt,
      provider: currentModel.provider,
      models: await modelRuntime.getAvailable(currentModel.provider),
    };
  },
  complete: ({ model, context, options }) => modelRuntime.completeSimple(model, context, options),
  reportError: (failure) => console.error('session title failed', failure.stage, failure.error),
  reportSkip: (skip) => console.debug('session title skipped', skip.reason),
});

The extension reports every skipped attempt through reportSkip and every failed attempt through reportError, then retries transient failures on the next prompt (up to 3 attempts per session by default). Pass { maxAttempts: 1 } for a single-attempt host policy. Hosts should persist these signals somewhere durable: the TUI toast fallback is transient and never reaches the session transcript.

The default policy limits the input to 4,000 characters, uses at most 64 output tokens, allows no retries or cache retention, and times out after 30 seconds. It selects a text-capable low-tier model for the host-selected provider, preferring the session's current model when eligible. If no low-tier model is available, it selects the cheapest text-capable model. Generated titles are normalized to 80 characters.

Development

pnpm --filter @felan-ai/ext-session-title build
pnpm --filter @felan-ai/ext-session-title type-check
pnpm --filter @felan-ai/ext-session-title test

The package is independent of the local TUI, Supabase, and cloud runtime.