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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@olumi/assistants-sdk

v1.11.1

Published

Official TypeScript SDK for Olumi Assistants Service

Readme

Olumi Assistants SDK (TypeScript)

Official TypeScript SDK for the Olumi Assistants Service. Build AI-assisted decision-making tools with full type safety.

Installation

npm install @olumi/assistants-sdk
# or
pnpm add @olumi/assistants-sdk
# or
yarn add @olumi/assistants-sdk

Quick Start

import { OlumiClient } from "@olumi/assistants-sdk";

const client = new OlumiClient({
  apiKey: process.env.OLUMI_API_KEY!,
});

// Draft a decision graph
const result = await client.draftGraph({
  brief: "Should we expand to international markets?",
});

console.log(result.graph);
// {
//   schema: "graph.v1",
//   nodes: [
//     { id: "q1", type: "question", label: "Expand internationally?" },
//     { id: "o1", type: "option", label: "Yes - expand now" },
//     { id: "o2", type: "option", label: "No - focus domestically" }
//   ],
//   edges: [
//     { from: "q1", to: "o1" },
//     { from: "q1", to: "o2" }
//   ]
// }

API Reference

Client Configuration

const client = new OlumiClient({
  apiKey: string;        // Required: Your Olumi API key
  baseUrl?: string;      // Optional: API base URL (default: production)
  timeout?: number;      // Optional: Request timeout in ms (default: 60000)
});

Methods

draftGraph(request)

Generate a decision graph from a brief description.

const response = await client.draftGraph({
  brief: "Should we launch feature X?",
  attachments: [  // Optional
    {
      filename: "data.csv",
      content_type: "text/csv",
      data: "base64-encoded-content",
    },
  ],
});

// response: DraftGraphResponse
// {
//   schema: "draft-graph.v1",
//   graph: Graph,
//   confidence: number,
//   issues?: string[]
// }

suggestOptions(request)

Generate additional options for a question node.

const response = await client.suggestOptions({
  graph: existingGraph,
  question_id: "q1",
});

// response: { schema: "suggest-options.v1", suggestions: string[] }

clarifyBrief(request)

Get clarifying questions for an ambiguous brief.

const response = await client.clarifyBrief({
  brief: "Improve our product",
  previous_answers: {  // Optional
    "q1": "User retention",
  },
});

// response: ClarifyBriefResponse
// {
//   questions: [{ id, question, reason }],
//   ready: boolean,
//   confidence: number
// }

critiqueGraph(request)

Get quality feedback on a decision graph.

const response = await client.critiqueGraph({
  graph: myGraph,
  brief: "Original brief",  // Optional
  focus_areas: ["structure", "completeness"],  // Optional
});

// response: CritiqueGraphResponse
// {
//   overall_quality: "excellent" | "good" | "fair" | "poor",
//   issues: [{ severity, category, message, node_ids? }]
// }

explainDiff(request)

Get natural language explanation of graph changes.

const response = await client.explainDiff({
  before: originalGraph,
  after: modifiedGraph,
});

// response: ExplainDiffResponse
// {
//   summary: string,
//   changes: [{ type, node_id?, before?, after? }]
// }

evidencePack(request)

Generate supporting evidence for a node.

const response = await client.evidencePack({
  graph: myGraph,
  node_id: "o1",
});

// response: EvidencePackResponse
// {
//   node_id: string,
//   evidence: [{ type: "pro" | "con" | "context", text, confidence }]
// }

healthCheck()

Check service health.

const response = await client.healthCheck();
// { status: "ok", version: "1.5.0" }

Error Handling

The SDK throws typed errors for different failure modes:

import { OlumiAPIError, OlumiNetworkError, OlumiConfigError } from "@olumi/assistants-sdk";

try {
  const result = await client.draftGraph({ brief: "..." });
} catch (error) {
  if (error instanceof OlumiAPIError) {
    // 4xx/5xx from server
    console.error(`API error: ${error.message}`);
    console.error(`Status: ${error.statusCode}`);
    console.error(`Code: ${error.code}`);
    console.error(`Request ID: ${error.requestId}`);
  } else if (error instanceof OlumiNetworkError) {
    // Network failure, timeout, etc.
    console.error(`Network error: ${error.message}`);
  } else if (error instanceof OlumiConfigError) {
    // Invalid SDK configuration
    console.error(`Config error: ${error.message}`);
  }
}

TypeScript Support

Full TypeScript support with exported types:

import type {
  Graph,
  GraphNode,
  GraphEdge,
  DraftGraphRequest,
  DraftGraphResponse,
  // ... and more
} from "@olumi/assistants-sdk";

CEE v1 Helpers (Decision Engine)

The SDK includes a small, deterministic surface area for CEE v1 ("Controlled Evaluation Engine"):

  • createCEEClient – typed client for CEE endpoints.
  • buildDecisionStorySummary – metadata-only narrative summary.
  • buildCeeJourneySummary – aggregates per-envelope health and completeness.
  • buildCeeUiFlags – UI-ready booleans (high risk, truncation, disagreement, completeness).
  • buildCeeDecisionReviewPayload – compact payload suitable for "decision review" APIs.
  • isRetryableCEEError – classifies retryable CEE failures.

Recommended reading and examples:

  • Docs/CEE-v1.md – CEE endpoints, error shapes, and judgement policy.
  • Docs/CEE-recipes.md – canonical usage patterns (draft-only, draft+options, full journey).
  • sdk/typescript/src/examples/ceeJourneyExample.ts – simple CEE journey via SDK.
  • sdk/typescript/src/examples/ceeDecisionReviewExample.ts – Sandbox-style decision review payload example.
  • sdk/typescript/src/examples/ceeCalibrationExample.ts – small calibration snapshot helper focusing on quality bands, truncation, and validation issues.
  • Docs/CEE-sandbox-integration.md – how to integrate CEE into a Scenario/Sandbox-style Decision Review surface.

For contributors touching CEE helpers or contracts, also see Docs/CEE-maintainers-guide.md.

Examples

See examples/ directory for complete examples:

  • Basic usage
  • Error handling
  • Streaming responses
  • Multi-step workflows

License

MIT