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

octoflow-protocols

v1.0.1

Published

Shared protocols and contracts for OctoFlow memory and execution environments.

Readme

octoflow-protocols

Dependency-free contracts shared by OctoFlow packages. Use this package directly when you are implementing a custom cognitive memory backend, execution environment, AG-UI adapter, or React transport that must satisfy the same interfaces used by octoflow-core, octoflow-brain, and @octoflow/react.

Install

npm install octoflow-protocols

Node.js >=20 is required.

Use It When

  • You are writing a custom sandbox, runner, or execution backend.
  • You are writing a custom cognitive memory implementation.
  • You are writing a browser/client adapter that needs OctoFlow React or AG-UI shapes without importing the runtime.
  • You need stable type contracts without importing concrete runtime implementations.
  • You want version constants that let implementations fail fast on contract mismatch.

Most apps should install octoflow-core or octoflow-brain instead of importing this package directly.

What It Provides

| Contract | Includes | | ------------------------------ | ----------------------------------------------------------------------------------------------- | | Execution environment protocol | ExecutionEnvironment, ExecInput, ExecResult, SnapshotRef, EnvCapability. | | Memory protocol | CognitiveMemory, memory operation inputs/results, record types, replay types, embedder types. | | AG-UI protocol | AgUiCapabilities, OCTOFLOW_AGUI_CAPABILITIES, AGUI_COMPLIANCE_TARGET, lifecycle verifier result types. | | React transport contracts | OctoFlowChatEvent, OctoFlowUIMessage, approvals, sessions, provider catalog, transport capabilities. | | Version markers | EXECUTION_ENVIRONMENT_CONTRACT_VERSION, COGNITIVE_MEMORY_CONTRACT_VERSION. | | Shared close shape | CloseableResource for stores, layers, embedders, and other owned resources. |

Custom Execution Environment

import {
  EXECUTION_ENVIRONMENT_CONTRACT_VERSION,
  type EnvCapability,
  type ExecInput,
  type ExecResult,
  type ExecutionEnvironment,
} from 'octoflow-protocols';

class InternalSandboxEnvironment implements ExecutionEnvironment {
  readonly contractVersion = EXECUTION_ENVIRONMENT_CONTRACT_VERSION;
  readonly name = 'internal-sandbox';
  readonly capabilities: readonly EnvCapability[] = ['sdk-backed', 'sandboxed'];

  async exec(input: ExecInput): Promise<ExecResult> {
    // Dispatch to your sandbox API.
    return {
      stdout: '',
      stderr: '',
      exitCode: 0,
      truncated: false,
      timedOut: false,
      durationMs: 0,
    };
  }

  async cleanup(): Promise<void> {
    // Release pooled resources.
  }
}

Custom Memory Backend

import {
  COGNITIVE_MEMORY_CONTRACT_VERSION,
  type CognitiveMemory,
  type RecallInput,
  type RecallResult,
  type RememberInput,
  type RememberResult,
} from 'octoflow-protocols';

class MyMemoryBackend implements CognitiveMemory {
  readonly contractVersion = COGNITIVE_MEMORY_CONTRACT_VERSION;

  async remember(input: RememberInput): Promise<RememberResult> {
    throw new Error(`Implement remember for ${input.text}`);
  }

  async recall(input: RecallInput): Promise<RecallResult> {
    throw new Error(`Implement recall for ${input.query}`);
  }

  // Implement the remaining CognitiveMemory methods before using this class.
}

Implementations should hard-fail when the contract version they target does not match the runtime they attach to.

Learn More

Validate

npm run -w octoflow-protocols lint
npm run -w octoflow-protocols typecheck
npm run -w octoflow-protocols test

Status

Preview. Pin versions and read ../../CHANGELOG.md before depending on it in production.