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

clawql-ouroboros

v0.1.1

Published

Embeddable TypeScript evolutionary loop: Zod Seeds, Wonder/Reflect, Executor/Evaluator, ontology convergence, optional MCP tool shapes — use with any agent backend or job worker (Node ≥22).

Downloads

159

Readme

clawql-ouroboros

Specification-first evolutionary workflows in TypeScript — immutable Seeds (Zod), pluggable Wonder / Reflect and Executor / Evaluator, an EvolutionaryLoop that runs until ontology convergence (similarity, stagnation, oscillation, regression gates), plus optional MCP-oriented tool definitions and a background poller helper.

Works as a standalone npm library today. You do not need the ClawQL MCP server: bring your own EventStore, LLM calls inside Wonder/Reflect, and real side effects inside Executor. ClawQL uses this package as one consumer; others can embed the same loop in agents, job workers, or internal tools.

| Resource | Link | | -------- | ---- | | Long-form guide + copy-paste examples | docs/clawql-ouroboros.md | | Human-friendly overview (ClawQL docs site) | docs.clawql.com/ouroboros | | Source | packages/clawql-ouroboros | | Issues / discussions | ClawQL issues |

Requirements

  • Node.js ≥ 22
  • ESM ("type": "module") or bundlers that consume dual ESM + CJS builds

Install

Published registry (when this package is published to npm):

npm install clawql-ouroboros

Inside the ClawQL monorepo (workspace):

{ "dependencies": { "clawql-ouroboros": "workspace:*" } }

Before publish / for CI smoke tests — from a clone, build then install the tarball:

cd packages/clawql-ouroboros && npm run build && npm pack
# elsewhere: npm install /path/to/clawql-ouroboros-0.1.0.tgz

Installing the root repo with npm install github:danielsmithdevelopment/ClawQL pulls clawql-mcp, not this subpackage by name; use workspace:, a .tgz, or the registry once clawql-ouroboros is published.

What you get

| Export path | Use case | | ----------- | -------- | | clawql-ouroboros | SeedSchema, types, EvolutionaryLoop, ConvergenceCriteria, RegressionDetector, InMemoryEventStore, interfaces | | clawql-ouroboros/mcp-hooks | ouroborosMcpTools — Zod input schemas + async handlers for seed-from-document, run loop, lineage query (wire to @modelcontextprotocol/sdk yourself) | | clawql-ouroboros/poller | startSeedsPollersetInterval worker; you supply fetchPending(): Promise<Seed[]> and markFailed(seedId, err) |

Runtime dependencies: zod ^4, uuid ^11 (declared in this package’s package.json).

Minimal example

import {
  EvolutionaryLoop,
  InMemoryEventStore,
  SeedSchema,
} from "clawql-ouroboros";

const store = new InMemoryEventStore();

const seed = SeedSchema.parse({
  goal: "Produce a one-line greeting",
  task_type: "code",
  brownfield_context: {
    project_type: "greenfield",
    context_references: [],
    existing_patterns: [],
    existing_dependencies: [],
  },
  constraints: [],
  acceptance_criteria: ["Output mentions hello"],
  ontology_schema: {
    name: "GreetingOntology",
    description: "One field",
    fields: [
      {
        name: "greeting",
        field_type: "string",
        description: "friendly phrase",
        required: true,
      },
    ],
  },
  evaluation_principles: [],
  exit_conditions: [],
  metadata: {},
});

const loop = new EvolutionaryLoop(
  store,
  {
    wonder: async () => ({
      insights: [],
      suggested_refinements: [],
      requires_evolution: false,
    }),
  },
  { reflect: async () => ({ newSeedData: {}, rationale: "noop" }) },
  { execute: async () => "hello world" },
  {
    evaluate: async (_out, s) => ({
      final_approved: true,
      score: 0.95,
      ac_results: s.acceptance_criteria.map((c, i) => ({
        ac_index: i,
        ac_content: c,
        passed: true,
        evidence: "ok",
      })),
    }),
  },
  { minGenerations: 2, maxGenerations: 10, convergenceThreshold: 0.95 },
);

const result = await loop.run(seed);
// result.converged, result.generations, result.lineage, result.finalSeed

Per-run caps (e.g. from an HTTP handler):

await loop.run(seed, { maxGenerations: 5, convergenceThreshold: 0.92 });

More examples (convergence-only, MCP hooks, poller) are in the full guide.

What you implement

| Interface | Responsibility | | --------- | --------------- | | EventStore | Append events; getLineage(rootSeedId) returns a full OntologyLineage. Use InMemoryEventStore for tests; use Postgres/Redis/etc. for production. | | WonderEngine | Optional refinement signals after each generation (often LLM). | | ReflectEngine | Produces Partial<Seed> updates for the next generation (often LLM). | | Executor | Runs the task for the current seed — your API calls, sandboxes, or agent tool loop. | | Evaluator | Scores output vs acceptance criteria / principles — rules, tests, LLM, or mix. |

The library does not call OpenAI, Anthropic, or ClawQL by default; those belong in your adapters.

Relationship to Q00/ouroboros

The popular Python project is a full product (interview CLI, MCP plugin, PAL routing, Double Diamond execution, persistence, TUI, etc.). clawql-ouroboros is a small, embeddable TypeScript core: overlapping ideas (seed, wonder/reflect, convergence), not feature parity or a claim to be the “official” TS port. The clawql- prefix scopes naming to this ecosystem.

Current limitations (honest scope)

  • No built-in Postgres EventStore — implement append / getLineage yourself.
  • No built-in LLM — Wonder/Reflect/Evaluate are yours to wire.
  • No automatic registration on the clawql-mcp npm binary — that integration is optional and separate.

None of that blocks reusing the loop + types + convergence math in your own server today.

Scripts (contributors / clone)

npm run build -w clawql-ouroboros
npm run test -w clawql-ouroboros

License

Apache-2.0 — see LICENSE in this package.