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

@claudiv/core

v0.4.2

Published

Claudiv core engine — types, FQN, differ, context engine, executor, projector, plan processor

Readme

@claudiv/core

Core engine for the Claudiv declarative AI interaction platform

Overview

@claudiv/core provides the foundational types, parsers, and engines for the Claudiv platform. Interface-first component model with FQN addressing, diff-based change detection, context-driven prompt assembly, and headless Claude execution.

Installation

npm install @claudiv/core

Exports

Types (types.ts)

All type definitions: FQN, ComponentDefinition, InterfaceDefinition, DependencyDefinition, CdmlDiffResult, PlanDirective, ContextManifest, AssembledPrompt, and more.

SDK Types (sdk-types.ts)

ClaudivSDK and FrameworkDetector interfaces for building framework-specific SDKs.

FQN Parser (fqn.ts)

  • parseFQN(raw) -- Parse FQN string into structured parts
  • resolveFQN(fqn, scope, registry) -- Resolve to component reference
  • buildFQN(element, ancestors) -- Build FQN from DOM position
  • stringifyFQN(fqn) -- Convert back to string

Differ (differ.ts)

  • diffCdml(old, new) -- Structural diff of two CDML documents
  • getChangedElements(diff) -- Extract only changed elements

Context Engine (context-engine.ts)

  • assembleContext(change, scope, manifest, registry, root) -- Full prompt assembly
  • resolveScope(manifest, path) -- Resolve scope chain from context manifest

Context Parser (context-parser.ts)

  • parseContextManifest(content) -- Parse .claudiv/context.cdml
  • loadContextManifest(path) -- Load from file
  • serializeContextManifest(manifest) -- Serialize back to CDML

Executor (executor.ts)

  • executeClaudeHeadless(prompt, config) -- CLI or API mode execution

Projector (projector.ts)

  • projectFacets(dep, interface) -- View-filtered interface projection
  • resolveProjectedDependencies(component, scope, registry)
  • formatProjectedInterfaces(projections) -- Format for prompt inclusion

Plan Processor (plan-processor.ts)

  • detectPlanDirectives($) -- Find plan attributes/elements
  • parsePlanQuestions($) -- Parse plan:questions block
  • generatePlanQuestions(questions) -- Generate CDML block
  • questionsToFacts(questions, source) -- Convert answers to facts
  • buildPlanPrompt(directive) -- Build expansion prompt

Scanner (scanner.ts)

  • scanProject(root, detector) -- Scan existing project
  • generateCdmlFromScan(name, files, root) -- Generate CDML skeleton

Environment (environment.ts)

  • detectEnvironmentFiles(base, platform?, arch?, distro?)
  • mergeEnvironmentCascade(files) -- Element-level merge with overrides

Project Registry (project.ts)

  • loadProject(manifestPath) -- Load project manifest and build registry
  • resolveComponent(fqn, registry) -- Lookup component by FQN
  • resolveInterface(fqn, registry) -- Get interface only

Aspects (aspects.ts)

  • parseAspect(content, path) -- Parse aspect file
  • discoverAspects(dirs) -- Find aspect files by naming convention
  • getAspectRelevantFacets(type) -- Get relevant facets for aspect type
  • linkAspects(components, aspects) -- Attach aspects to components

Parser (parser.ts)

  • parseSpecFile(content) -- Parse CDML into structured form
  • extractInterface($), extractConstraints($), extractDependencies($)
  • extractScopeConstraints($, element) -- Siblings as locked constraints
  • buildPromptContext(component) -- Simple standalone context builder

Hierarchy Helpers

  • buildElementPath(), buildScopeChain(), getSiblingElements()
  • getChildElementNames(), buildFQNFromPosition(), extractFullContent()

Development

pnpm install
pnpm run build

License

MIT