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

@cutie-crypto/connector-core

v0.6.1

Published

Cutie Connector core protocol types and shared abstractions (Node.js only — HTTP transport uses node:https/http)

Downloads

1,550

Readme

@cutie-crypto/connector-core

Cutie Connector core protocol + connection runtime + PlatformAdapter contract.

Node.js only. Uses node:http / node:https / node:url / Buffer.

What this package gives you

  • Protocol envelopes: TaskPush / HelloOk / HeartbeatAck / ServerMessage / RegisterResult / TaskResultMessage
  • HTTP client: register(serverUrl, RegisterParams) / fetchStrategyKnowledge(serverUrl, token) / buildFormData / post / get
  • Connection runtime: ConnectorConnection class — WS loop / heartbeat / task dispatch / upgrade trigger
  • Adapter contract: CorePlatformAdapter<C> — 6 methods you implement to plug a new platform

How to write a new adapter

import type {
  CorePlatformAdapter,
  AgentResult,
  SafetyTemplates,
} from '@cutie-crypto/connector-core';

interface MyConfig {
  endpoint: string;
}

export class EchoAdapter implements CorePlatformAdapter<MyConfig> {
  readonly id = 'echo';
  private config: MyConfig | null = null;

  attachConfig(config: MyConfig): void {
    this.config = config;
  }

  async callAgent(message: string, _model: string): Promise<AgentResult> {
    return { answer: `echo: ${message}`, latency_ms: 1 };
  }

  async selfUpgrade(_targetVersion: string): Promise<void> {
    // No-op. Real adapter would: download new version, replace binary,
    // process.exit(0) to let supervisor (systemd / PM2 / Zylos) restart.
  }

  augmentHeartbeat(envelope: Record<string, unknown>): Record<string, unknown> {
    return envelope;
  }

  getCapabilities(): string[] {
    return [];
  }

  applySafetyTemplates(_templates: SafetyTemplates): void {
    // OpenClaw / Hermes write to workspace files.
    // CLI-style adapters (Claude / Codex) cache here, splice into prompt later.
  }
}

The 8 design constraints (Phase 0.2)

These are the contracts connector-core upholds so any adapter (OpenClaw, Hermes, future Claude / Codex CLI integration) plugs in without touching core:

  1. AI call abstraction: adapter.callAgent(message, model) → {answer, latency_ms}. Core does not assume HTTP / CLI.
  2. Config layering: top-level holds shared fields; platform-specific config is the generic C parameter on CorePlatformAdapter<C>. Each adapter sees only its own config type.
  3. Safety template dispatch: adapter.applySafetyTemplates({agents_md, soul_md, canary_token?}) — core delivers what server's register returns; adapter decides how to land it (file vs cache). Called only after pairing/setup succeeds.
  4. Self-upgrade: adapter.selfUpgrade(targetVersion) — adapter chooses install method. Core does not hardcode npm install.
  5. Process management: core does not assume systemd / PM2 / launchd. Adapter's selfUpgrade typically process.exit(0) to let supervisor restart.
  6. Unified agent_status: core builds heartbeat with agent_status; adapter's augmentHeartbeat adds backward-compat fields (e.g. openclaw_status mirroring agent_status).
  7. README + dummy adapter: see the compilable EchoAdapter example above in How to write a new adapter.
  8. Capability flags: register form / heartbeat envelope carry optional capabilities: string[]. Adapter returns [] today; future adapters declare e.g. ['sandbox=srt', 'runtime=claude'].

When to call applySafetyTemplates

Only after register HTTP response returns templates. Never during install / post-install hooks — there's no pair_token yet, so the templates haven't been generated by Cutie Server.

Runtime requirements

Node.js >= 18.