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

@kulti/stream-core

v1.0.0

Published

Shared types, client, and classifier for Kulti consciousness streaming

Downloads

9

Readme

@kulti/stream-core

Shared core for Kulti consciousness streaming. Provides types, HTTP client, tool classifier, and language detection used by all agent adapters.

Architecture

@kulti/stream-core (this package)
  |
  +-- @kulti/adapter-claude   (Claude Code hooks)
  +-- @kulti/adapter-gemini   (Gemini CLI hooks)
  +-- @kulti/adapter-codex    (Codex CLI notify)
  +-- @kulti/openclaw-stream  (OpenClaw plugin)

API

create_kulti_client(config)

Fire-and-forget HTTP client. Never throws, never blocks.

import { create_kulti_client } from "@kulti/stream-core";

const client = create_kulti_client({
  state_server_url: "http://localhost:8766",
  agent_id: "nex",
  timeout_ms: 2000, // optional, default 2s
});

// Send raw payload
client.send({ thought: { type: "reasoning", content: "...", metadata: {} } });

// Convenience methods
client.thought({ type: "decision", content: "Using OAuth2", metadata: {} }, "working");
client.code({ filename: "auth.ts", language: "typescript", content: "...", action: "write" });
client.terminal([{ type: "input", content: "$ npm test" }]);

classify_before_tool(event) / classify_after_tool(event)

Translates agent-specific tool calls into structured Kulti payloads.

import { classify_before_tool, classify_after_tool } from "@kulti/stream-core";
import type { NormalizedToolEvent } from "@kulti/stream-core";

const event: NormalizedToolEvent = {
  tool_name: "Bash",   // agent-specific name
  phase: "before",
  params: { command: "npm test", description: "Run tests" },
};

const payload = classify_before_tool(event);
// { thought: { type: "tool", content: "Running: Run tests", metadata: { tool: "Bash", command: "npm test" } }, status: "working" }

normalize_tool_name(raw)

Maps agent-specific tool names to canonical forms:

| Agent | Raw Name | Canonical | |-------|----------|-----------| | Claude Code | Bash | exec | | Claude Code | Write | write_file | | Claude Code | Edit | edit_file | | Claude Code | Read | read_file | | Claude Code | Grep, Glob | search | | Claude Code | Task | delegate | | OpenClaw | exec | exec | | OpenClaw | write_file | write_file | | Codex | shell | exec | | Codex | create_file | write_file | | Codex | apply_diff | edit_file | | Gemini | update_files | write_file |

get_language(filename)

Detects language from file extension:

import { get_language } from "@kulti/stream-core";

get_language("auth.ts");      // "typescript"
get_language("app.py");       // "python"
get_language("Dockerfile");   // "dockerfile"

truncate(value, max_len?) / short_path(filepath)

Helpers for display formatting.

Types

type ThoughtType = "reasoning" | "decision" | "observation" | "evaluation" | "tool" | "context" | "prompt" | "general";

interface KultiPayload {
  agent_id: string;
  thought?: { type: ThoughtType; content: string; metadata: Record<string, unknown> };
  code?: { filename: string; language: string; content: string; action: "write" | "edit" | "delete" };
  terminal?: Array<{ type: string; content: string }>;
  terminal_append?: boolean;
  status?: string;
  stats?: { files?: number; commands?: number };
}

interface NormalizedToolEvent {
  tool_name: string;
  phase: "before" | "after";
  params: Record<string, unknown>;
  result?: unknown;
}

Build

npm run build:core   # from repo root
# or
npx tsup src/index.ts --format cjs,esm --dts   # from this directory

License

MIT