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

@superinstance/equipment-cell-logic-distiller

v1.0.0

Published

Equipment that breaks down LLM logic into spreadsheet-visualized cells with tile decomposition

Downloads

150

Readme

@superinstance/equipment-cell-logic-distiller

Equipment that breaks down LLM logic into spreadsheet-visualized cells with tile decomposition.

Overview

CellLogicDistiller is an equipment module for the SuperInstance ecosystem that transforms LLM prompts and responses into structured, analyzable components. It extracts logical patterns, creates named tiles with full metadata, and generates spreadsheet-compatible visualizations.

Features

  • Logic Decomposition: Breaks down LLM logic into discrete, named tiles
  • Tile Metadata: Each tile contains:
    • data_origin - Where the data came from
    • decision_logic - The decision rules extracted
    • transformation - How data is transformed
    • confidence - Confidence score (0-1)
    • named_interface - Interface for accessing the tile
  • Spreadsheet Visualization: Converts tiles to Excel-compatible cell structures
  • Self-Documenting: Generates NLP descriptions for each tile
  • Reverse Engineering: Given a cell, explains what the logic does
  • Multiple Export Formats: CSV, JSON, HTML

Installation

npm install @superinstance/equipment-cell-logic-distiller

Quick Start

import { CellLogicDistiller, distill, visualize } from '@superinstance/equipment-cell-logic-distiller';

// Method 1: Using the quick function
const result = distill(
  'Analyze the customer data and identify high-value customers',
  'Based on the analysis, high-value customers are those with purchases > $1000...'
);

console.log(result.tiles); // Array of LogicTile
console.log(result.statistics); // Decomposition statistics

// Method 2: Using the class
const distiller = new CellLogicDistiller({
  minConfidence: 0.6,
  maxTiles: 50,
});

const { result, spreadsheet } = distiller.distillAndVisualize({
  prompt: 'Your prompt here',
  response: 'The LLM response here',
});

// Export to different formats
console.log(distiller.exportToCSV(spreadsheet));
console.log(distiller.exportToJSON(spreadsheet));
console.log(distiller.exportToHTML(spreadsheet));

API Reference

CellLogicDistiller

Main equipment class that implements the Equipment interface.

Constructor

new CellLogicDistiller(options?: DistillationOptions)

Options

interface DistillationOptions {
  /** Minimum confidence threshold for tiles (default: 0.5) */
  minConfidence?: number;
  
  /** Maximum number of tiles to extract (default: 100) */
  maxTiles?: number;
  
  /** Include NLP descriptions (default: true) */
  includeNlpDescriptions?: boolean;
  
  /** Include source positions (default: true) */
  includeSourcePositions?: boolean;
  
  /** Generate formal rules (default: true) */
  generateFormalRules?: boolean;
  
  /** Spreadsheet output format */
  spreadsheetFormat?: 'excel' | 'csv' | 'json' | 'html';
}

Methods

| Method | Description | |--------|-------------| | distill(input) | Distill LLM logic into tiles | | visualize(tiles, prompt?, response?) | Create spreadsheet from tiles | | distillAndVisualize(input) | One-step distillation and visualization | | reverseEngineerTile(tileId) | Get explanation for a tile | | reverseEngineerCell(cellId) | Get explanation for a cell | | explainLogic(tileId) | Natural language explanation | | exportToCSV(spreadsheet) | Export to CSV format | | exportToJSON(spreadsheet) | Export to JSON format | | exportToHTML(spreadsheet) | Export to HTML table | | generateSummary(tiles) | Generate summary report |

TileDecomposer

Core decomposition engine that extracts logic tiles from text.

import { TileDecomposer } from '@superinstance/equipment-cell-logic-distiller';

const decomposer = new TileDecomposer({ minConfidence: 0.6 });
const result = decomposer.decompose({
  prompt: 'Your prompt',
  response: 'LLM response',
});

SpreadsheetVisualizer

Converts logic tiles to spreadsheet formats.

import { SpreadsheetVisualizer } from '@superinstance/equipment-cell-logic-distiller';

const visualizer = new SpreadsheetVisualizer();
const spreadsheet = visualizer.visualize(tiles);
const csv = visualizer.toCSV(spreadsheet);
const html = visualizer.toHTML(spreadsheet);

Data Structures

LogicTile

interface LogicTile {
  id: string;
  name: string;
  dataOrigin: DataOrigin;
  decisionLogic: DecisionLogic;
  transformation: TransformationInfo;
  confidence: number;
  namedInterface: NamedInterface;
  nlpDescription: string;
  sourceSegment: string;
  sourcePosition: { start: number; end: number };
  dependencies: string[];
  outputType: TileType;
  inputType: TileType;
}

DecisionLogic

interface DecisionLogic {
  type: 'conditional' | 'selection' | 'ranking' | 'filtering' | 
        'aggregation' | 'generation' | 'verification';
  conditions: LogicCondition[];
  rule: string;
  formalRule?: string;
  extractionConfidence: number;
}

SpreadsheetCell

interface SpreadsheetCell {
  id: string;           // e.g., "A1", "B2"
  row: number;
  column: number;
  value: unknown;
  formula?: string;
  tileId: string;
  displayName: string;
  type: SpreadsheetCellType;
  formatting: CellFormatting;
  comments: string[];
  dependsOn: string[];
  visible: boolean;
  confidence: number;
}

Logic Types Detected

The distiller can extract the following logic types:

| Type | Description | Example Pattern | |------|-------------|-----------------| | conditional | If-then logic | "If X, then Y" | | selection | Selection from options | "Choose X from Y where Z" | | ranking | Ordering/sorting | "Rank X by Y" | | filtering | Filter operations | "Filter X by Y" | | aggregation | Summarization | "Calculate the sum of X" | | generation | Content generation | Numbered steps | | verification | Validation checks | "Verify that X" |

Reverse Engineering

You can reverse-engineer cells to understand their logic:

const distiller = new CellLogicDistiller();
const result = distiller.distill({ prompt, response });

// Get explanation for a specific tile
const explanation = distiller.reverseEngineerTile('tile_0_condition_value');
console.log(explanation);

// Explain in natural language
const nlpExplanation = distiller.explainLogic('tile_0_condition_value');
console.log(nlpExplanation);

Example output:

# Logic Explanation: Condition_value

## Overview
This tile represents a conditional operation. The rule is: "IF value > 100 THEN high_priority". 
It evaluates 1 condition(s):
  - value > 100

## Decision Logic
- **Type:** conditional
- **Rule:** IF value > 100 THEN high_priority

## Transformation
- **Type:** transform
- **Description:** Applies conditional logic

## Interface
```typescript
condition_value(value: any): any

## Integration with SuperInstance

This equipment integrates with the SuperInstance ecosystem:

```typescript
import { OriginCore } from '@superinstance/starter-agent';
import { CellLogicDistiller } from '@superinstance/equipment-cell-logic-distiller';

const agent = new OriginCore();
const distiller = new CellLogicDistiller();

// Register and equip
agent.registerEquipment(distiller);
await agent.equip('CellLogicDistiller');

// Use via agent
const result = distiller.distill({ prompt, response });

Equipment Metadata

| Property | Value | |----------|-------| | Slot | DISTILLATION | | Memory Cost | ~50MB | | CPU Impact | ~15% | | Latency | ~500ms |

License

MIT © SuperInstance Team

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a pull request.