Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@oxap/sdk

Latest version: v0.1.0-alpha.45

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
npm package Publisher: lsm
0 Stars
0 Forks
13 Versions
2.5K Downloads
Zig Repo language

Scan summary

@oxap/sdk was last scanned on 27 Nov 2026 at version 0.1.0-alpha.45. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 13 versions; the latest 5 were published within 6 days (22–27 Nov 2026).
  • Findings: No rules fired in version 0.1.0-alpha.45.
  • Downloads: 2,481 downloads.

Versions

13 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0-alpha.45 LATEST 27 Nov 2026 No rules fired
0.1.0-alpha.44 25 Nov 2026 No rules fired
0.1.0-alpha.43 23 Nov 2026 No rules fired
0.1.0-alpha.42 22 Nov 2026 Not shown
0.1.0-alpha.41 22 Nov 2026 Not shown

No rules fired in 0.1.0-alpha.45

Findings

Findings for v0.1.0-alpha.45. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0-alpha.45; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

OAP TypeScript SDK

TypeScript SDK published as @oxap/sdk. The default client spawns oxap serve --config <generated-server.json> and speaks OAP v0.1 on both profiles: agent sessions and authentication on agent-control-core, direct inference and provider model discovery on model-provider-core.

createOapClient() is the preferred entry point. createMakaiClient() remains an alias for it.

Installation

npm install @oxap/sdk

No release has been published yet; until one is, install from a checkout of this repository.

The package is a library and ships no executable, so you also need the runtime binary. It optionally depends on @oxap/cli at its own version, which carries the runtime for the platform; failing that, it uses a local build under zig-out/bin/oxap or zig/zig-out/bin/oxap, then oxap on PATH, and the oapx names keep resolving in every step. See Configuration for explicit binary resolver options.

Quick start

Create a client, resolve a model, send one chat message, and print the assistant response.

import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient();

  try {
    const { model } = await client.models.resolve({
      provider_id: "anthropic",
      api: "anthropic-messages",
      model_id: "claude-sonnet-4-5",
    });

    const response = await client.provider.complete({
      model_ref: model.model_ref,
      messages: [{ role: "user", content: "Write a haiku about streams." }],
      options: { max_tokens: 128 },
    });

    const content = response.message.content;
    console.log(typeof content === "string" ? content : JSON.stringify(content, null, 2));
  } finally {
    await client.close();
  }
}

main().catch((error: unknown) => {
  console.error(error);
  process.exitCode = 1;
});

Streaming completions

Use client.provider.stream(...) for provider-level streaming. It is the SDK's streaming form of complete; each text_delta contains newly generated text.

import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient();

  try {
    const { model } = await client.models.resolve({
      provider_id: "anthropic",
      api: "anthropic-messages",
      model_id: "claude-sonnet-4-5",
    });

    for await (const event of client.provider.stream({
      model_ref: model.model_ref,
      messages: [{ role: "user", content: "Explain lock-free queues in one paragraph." }],
      options: { max_tokens: 256 },
    })) {
      switch (event.type) {
        case "message_start":
          console.error(`Streaming ${event.provider_id ?? "provider"}/${event.model_id ?? "model"}`);
          break;
        case "text_delta":
          process.stdout.write(event.delta);
          break;
        case "thinking_delta":
          // Reasoning output is surfaced separately from normal text.
          break;
        case "tool_call":
          console.error(`\nTool call requested: ${event.name}(${event.arguments_json})`);
          break;
        case "message_end":
          process.stdout.write("\n");
          console.error("Stop reason:", event.stop_reason);
          break;
        case "error":
          throw new Error(event.message);
      }
    }
  } finally {
    await client.close();
  }
}

void main();

If you are migrating from an API that used client.complete({ stream: true }), the equivalent call is client.provider.stream(request); non-streaming calls use client.provider.complete(request).

Agent runs and model switching

Use client.agent.run(...) for an agent session, or client.agent.stream(...) for lifecycle and content events. A run naming options.session_id opens that session the first time and submits into it after that, so a later run carries only the new messages: the endpoint keeps the history. A session's tools, reasoning_effort and max_tokens are fixed when it opens; a later run that omits them keeps them, and one that names different ones fails with OapUnsupportedFeatureError. switchModel(sessionId, modelRef) changes the selected model of an open session; runSelected(sessionId, messages) uses that selection on the next run. An agent request's tools are provided to the session at open (action.tools.provide), owned by the SDK's participant sdk; when the model calls one, the SDK runs its execute callback and answers with action.call.resolve.request, and a tool without execute is answered with an error. Against an endpoint that does not advertise action.tools.provide, a request with tools fails with OapUnsupportedFeatureError before the open rather than having its tools ignored, and once a tool has run, an auto_once auth failure is not retried, so the tool is not run twice. The stream yields tool_execution_start and tool_execution_end for every call, the endpoint's own tools included. An agent run's reasoning_effort becomes the session's reasoning level and max_tokens (an integer from 1 to 4294967295) the oapx output limit, both at open, the output limit only on the oapx.agent endpoint that reads it (elsewhere OapUnsupportedFeatureError); temperature and reasoning_effort: "minimal" fail with OapUnsupportedFeatureError, since the agent loop takes no temperature and runs minimal as low. The open also turns off the loop's request_user_input tool, which the SDK cannot answer, and an abort stops waiting on a tool that is still running. Direct provider calls may carry declaration-only tools, but client-side execute callbacks are unsupported there.

import { createOapClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createOapClient();

  try {
    const { model } = await client.models.resolve({
      provider_id: "anthropic",
      api: "anthropic-messages",
      model_id: "claude-sonnet-4-5",
    });

    const response = await client.agent.run({
      model_ref: model.model_ref,
      messages: [{ role: "user", content: "Say hello." }],
    });

    console.log(response.message.content);
  } finally {
    await client.close();
  }
}

void main();

For agent streaming, iterate over client.agent.stream(request) and handle agent_start, content deltas, and the terminal agent_end event. Tools with an execute callback run in your process when the endpoint advertises action.tools.provide.

Agent model discovery

client.agent.models is a compatibility alias for the provider model catalog exposed as client.models on the same OAP connection.

import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient();

  // Both read the provider model catalog on the same OAP connection:
  const { models } = await client.models.list();
  const { models: agentModels } = await client.agent.models.list();

  void models;
  void agentModels;
}

void main;

Prefer client.models when you only need model discovery. Use client.agent.models when chaining discovery with an agent call on the same namespace.

Auth

Use client.auth.listProviders() to inspect auth state, and client.auth.login(providerId, handlers) to start a browser login flow. Token material and manual-code answers stay within the runtime; no answer travels in an OAP envelope. A flow requiring manual input without a host-owned input path fails with auth_input_unavailable. openai-codex offers two ways at once: its URL is the ChatGPT sign-in, which returns to a localhost:1455 callback the runtime listens on, and its instructions also give https://auth.openai.com/codex/device and a one-time code for signing in from any other device, which needs device code login turned on in ChatGPT's security settings (or by a workspace admin). Whichever finishes first completes the login. anthropic signs in through a browser on the same computer: its URL returns to a localhost callback the runtime listens on (macOS and Linux). Where no browser can reach that computer, give the runtime a Claude subscription token, such as one from claude setup-token, as ANTHROPIC_AUTH_TOKEN in its environment.

import { createMakaiClient, type MakaiAuthEvent } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient();

  try {
    const providers = await client.auth.listProviders();
    const anthropic = providers.find((provider) => provider.id === "anthropic");

    if (anthropic?.auth_status !== "authenticated") {
      await client.auth.login("anthropic", {
        onEvent(event: MakaiAuthEvent): void {
          if (event.type === "auth_url") {
            console.log(`Open ${event.url}`);
            if (event.instructions) console.log(event.instructions);
          } else if (event.type === "progress") {
            console.log(event.message);
          }
        },
      });
    }
  } finally {
    await client.close();
  }
}

void main();

You can also configure automatic one-shot auth retry for provider and agent calls:

import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient({
    auth: {
      auth_retry_policy: "auto_once",
      handlers: {
        onEvent: (event) => {
          if (event.type === "auth_url") console.log(`Open ${event.url}`);
        },
      },
    },
  });

  try {
    // Calls that hit auth_required can now trigger one login attempt automatically.
  } finally {
    await client.close();
  }
}

void main();

Models

Models are discovered through client.models. Use model_ref from the returned descriptor in completion and agent requests. Treat model_ref as opaque; do not parse or construct it in application code.

import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient();

  try {
    const { models, fetched_at_ms, cache_max_age_ms } = await client.models.list({
      provider_id: "anthropic",
      include_login_required: true,
    });

    console.log(`Fetched ${models.length} models at ${new Date(fetched_at_ms).toISOString()}`);
    console.log(`Cache max age: ${cache_max_age_ms}ms`);

    for (const model of models) {
      console.log(`${model.display_name}: ${model.model_ref} [${model.auth_status}]`);
    }

    const resolved = await client.models.resolve({
      provider_id: "anthropic",
      api: "anthropic-messages",
      model_id: "claude-sonnet-4-5",
    });

    console.log("Use this model_ref:", resolved.model.model_ref);
  } finally {
    await client.close();
  }
}

void main();

Configuration

createOapClient(...) and createMakaiClient(...) accept stdio transport and binary resolver options.

Explicit binary path
import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient({
    resolver: {
      binaryPath: "/opt/oapx/bin/oapx",
    },
  });

  try {
    // Use client.provider, client.agent, client.auth, or client.models here.
  } finally {
    await client.close();
  }
}

void main();

You can also set OXAP_SDK_BINARY_PATH=/opt/oxap/bin/oxap, which outranks the legacy OAP_SDK_BINARY_PATH=/opt/oapx/bin/oapx.

Download from URL with checksum
import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient({
    resolver: {
      binaryUrl: "https://example.com/releases/oapx-darwin-arm64",
      checksumSha256: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      cacheDir: "/tmp/oapx-bin-cache",
    },
  });

  try {
    // Use client.provider, client.agent, client.auth, or client.models here.
  } finally {
    await client.close();
  }
}

void main();

Environment variable equivalents are OXAP_SDK_BINARY_URL and OXAP_SDK_BINARY_SHA256, with the legacy OAP_SDK_BINARY_URL and OAP_SDK_BINARY_SHA256 still read. Each environment URL takes the checksum written beside it, so a checksum is never borrowed across the two pairs; checksumSha256 from the resolver options is the fallback for any URL, and a URL passed as resolver.binaryUrl takes either environment checksum, the OXAP one first, then checksumSha256.

PATH lookup and local builds

With no resolver options, the SDK checks, in order:

  1. The platform package @oxap/cli installs (@oxap/cli-<platform>-<arch>), then the legacy @oap-sdk/cli-<platform>-<arch>, when present: oxap, then oapx in each
  2. ./zig-out/bin/oxap, ./zig/zig-out/bin/oxap, ./zig-out/bin/oapx, then ./zig/zig-out/bin/oapx
  3. oxap on PATH, then oapx

On Windows each name carries an .exe suffix.

Step 1 outranks both local build paths, so an installed platform package wins over a fresh zig build. It arrives as the optional dependency @oxap/cli at the SDK's own version, so a plain install gets a runtime unless the platform is unsupported; npm skips an optional dependency it cannot satisfy. Set OXAP_SDK_BINARY_PATH (or resolver.binaryPath) to pin an exact binary; the legacy OAP_SDK_BINARY_PATH still resolves.

The client initializes the agent profile and describes the provider profile. responseTimeoutMs bounds the reply to each request; frameTimeoutMs bounds auth event waits. A running agent run or provider inference has no idle limit by default, because a tool or a reasoning model can be silent for minutes; set idleTimeoutMs to give up after that long without an event, which also cancels the run, or pass an AbortSignal to stop it yourself. A failed connection closes the spawned process.

import { createMakaiClient } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient({
    // Optional transport settings:
    args: ["serve", "agent,provider", "--stdio"],
    cwd: process.cwd(),
    env: { ...process.env, OAPX_LOG: "info" },
    handshakeTimeoutMs: 2_000,
    responseTimeoutMs: 30_000,
    frameTimeoutMs: 30_000,
  });

  try {
    // Use client.provider, client.agent, client.auth, or client.models here.
  } finally {
    await client.close();
  }
}

void main();

args can name a harness backend instead, such as ["serve", "agent", "--stdio", "--backend", "claude"]. Such an endpoint serves the agent profile alone: the client connects to it and runs agents through it, and client.provider and client.models fail with OapUnsupportedFeatureError. The SDK does not answer permission requests yet, so a run on a backend that asks one waits until a timeout or an abort ends it.

Close clients when done:

async function closeClient(client: { close(): Promise<void> }): Promise<void> {
  await client.close();
}

Cancellation

Pass an AbortSignal as options.signal to cancel a provider or agent call; these reject with an Error whose name is "AbortError". client.auth.login(providerId, handlers, { signal }) also accepts a signal and reports cancellation as MakaiAuthError with kind: "cancelled".

import { createMakaiClient, isAbortError } from "@oxap/sdk";

async function main(): Promise<void> {
  const client = await createMakaiClient();
  const { model } = await client.models.resolve({
    provider_id: "anthropic",
    api: "anthropic-messages",
    model_id: "claude-sonnet-4-5",
  });

  const controller = new AbortController();
  setTimeout(() => controller.abort(), 5_000);

  try {
    for await (const event of client.provider.stream({
      model_ref: model.model_ref,
      messages: [{ role: "user", content: "Explain lock-free queues." }],
      options: { signal: controller.signal },
    })) {
      if (event.type === "text_delta") process.stdout.write(event.delta);
    }
  } catch (error: unknown) {
    if (!isAbortError(error)) throw error;
  }
}

void main;

Leaving an OAP stream early also cancels it: the SDK sends a best-effort inference.cancel.request for direct inference or run.cancel.request for an agent run.

Error handling

The SDK exports error classes for common failure surfaces:

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @oxap/sdk

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Frame 2085668439 (1)
Group 1261154229