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

@codespar/types

Latest version: v0.11.9

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
npm package Publisher: codespar-npm, dangazineu
2 Stars
2 Forks
11 Versions
3.9K Downloads
TypeScript Repo language

Scan summary

@codespar/types was last scanned on 24 Nov 2026 at version 0.11.9. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 11 versions; the latest 2 were published within 5 days (20–24 Nov 2026).
  • Findings: No rules fired in version 0.11.9.
  • Downloads: 3,852 downloads.

Versions

11 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.11.9 LATEST 24 Nov 2026 No rules fired
0.11.8 20 Nov 2026 No rules fired
0.11.7 30 Oct 2026 No rules fired
0.11.6 30 Oct 2026 Not shown
0.11.5 24 Oct 2026 Not shown

No rules fired in 0.11.9

Findings

Findings for v0.11.9. 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.11.9; other versions have their own rules, not their own score.

README

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

@codespar/types

Zero-dependency TypeScript package defining the shared session interface hierarchy for CodeSpar runtimes.

Any runtime that implements SessionBase — the managed CodeSpar backend, Anthropic Managed Agents, a self-hosted server, or a test double — is a first-class citizen in the SDK ecosystem. The contract is the only coupling between runtimes and the tools that run on top of them.

Install

npm install @codespar/types

Interfaces

SessionBase

The minimal interface any runtime must implement.

import type { SessionBase } from "@codespar/types";

interface SessionBase {
  readonly id: string;
  readonly status: "active" | "closed" | "error";

  execute(toolName: string, params: Record<string, unknown>): Promise<ToolResult>;
  send(message: string): Promise<SendResult>;
  sendStream(message: string): AsyncIterable<StreamEvent>;
  connections(): Promise<BaseConnection[]>;
  close(): Promise<void>;
}
Session

The codespar-specific extension of SessionBase, used when a session was created through the managed CodeSpar API.

import type { Session } from "@codespar/types";

interface Session extends SessionBase {
  proxyExecute(request: ProxyRequest): Promise<ProxyResult>;
  authorize(serverId: string, config: AuthConfig): Promise<AuthResult>;

  // Tool discovery + connection wizard (codespar_discover / codespar_manage_connections)
  discover(useCase: string, options?: DiscoverOptions): Promise<DiscoverResult>;
  connectionWizard(options: ConnectionWizardOptions): Promise<ConnectionWizardResult>;

  // Meta-tool wrappers — typed payloads, same wire as session.execute(...)
  charge(args: ChargeArgs): Promise<ChargeResult>;
  ship(args: ShipArgs): Promise<ShipResult>;
  shop(args: ShopArgs): Promise<ShopResult>;

  // Async settlement (codespar_charge / codespar_pay)
  paymentStatus(toolCallId: string): Promise<PaymentStatusResult>;
  paymentStatusStream(
    toolCallId: string,
    options: PaymentStatusStreamOptions,
  ): Promise<PaymentStatusResult>;

  // Async verification (codespar_kyc)
  verificationStatus(toolCallId: string): Promise<VerificationStatusResult>;
  verificationStatusStream(
    toolCallId: string,
    options: VerificationStatusStreamOptions,
  ): Promise<VerificationStatusResult>;

  mcp?: {
    url: string;
    headers: Record<string, string>;
  };
}
isCodesparSession

Type guard to narrow a SessionBase to Session when you need codespar-specific methods.

import { isCodesparSession } from "@codespar/types";

function useSession(session: SessionBase) {
  if (isCodesparSession(session)) {
    // session is Session here — proxyExecute, authorize, mcp available
    const config = session.mcp;
  }
}

Wire types

Type Description
ToolResult Return value of execute() — success, data, error, duration, server, tool
SendResult Return value of send() — message, tool_calls, iterations
StreamEvent Union of events yielded by sendStream() — user_message, assistant_text, tool_use, tool_result, done, error
BaseConnection Entry from connections() — id, connected
ServerConnection Extended connection with name and provider metadata
ProxyRequest Input to proxyExecute() — server, endpoint, method, body, headers
ProxyResult Return value of proxyExecute() — status, data, headers, duration, proxy_call_id
AuthConfig Input to authorize() — redirectUri, scopes?
AuthResult Return value of authorize() — linkToken, authorizeUrl, expiresAt
DiscoverOptions / DiscoverResult / DiscoverToolMatch / DiscoverPlanStep Wire shapes for session.discover(...) (codespar_discover)
ConnectionWizardOptions / ConnectionWizardResult / ConnectionStatusRow Wire shapes for session.connectionWizard(...) (codespar_manage_connections)
ChargeArgs / ChargeBuyer / ChargeResult Wire shapes for session.charge(...) (codespar_charge, inbound)
ShipArgs / ShipAddress / ShipItem / ShipResult Wire shapes for session.ship(...) (codespar_ship)
ShopArgs / ShopSearchArgs / ShopCheckoutArgs / ShopStatusArgs / ShopOffer / ShopVariant / ShopResult / ShopSearchResult / ShopCheckoutResult / ShopStatusResult / ShopCheckoutStatus Wire shapes for session.shop(...) (codespar_shop) — discriminated on action. Canonical spec: docs/codespar-shop-contract.md
PaymentStatus / PaymentStatusResult / PaymentStatusEvent Wire shapes for session.paymentStatus(toolCallId) — async webhook correlation
PaymentStatusStreamOptions Options for session.paymentStatusStream(...) — onUpdate?, signal?
VerificationStatus / VerificationStatusResult / VerificationStatusEvent Wire shapes for session.verificationStatus(toolCallId) — async KYC poll
VerificationStatusStreamOptions Options for session.verificationStatusStream(...) — onUpdate?, signal?

The typed meta-tool facades (shop(), charge(), ship(), …) require a runtime that implements the meta-tool. These wire types are the contract; the facade in @codespar/sdk is a client over execute("codespar_<tool>", args). Against a self-hosted runtime with no registered implementation for that meta-tool, the call returns Tool not registered. The types + facade are MIT and self-hostable; the implementation is registered by the runtime the SDK points at.

Conformance testing

@codespar/types ships a runContractSuite helper under a /testing subpath export. It registers a Vitest test suite that exercises the five SessionBase methods against a live HTTP endpoint.

// my-runtime.test.ts
import { runContractSuite } from "@codespar/types/testing";

// Skip unless the env vars are present
const apiKey = process.env["MY_RUNTIME_API_KEY"];
const baseUrl = process.env["MY_RUNTIME_BASE_URL"] ?? "http://localhost:3000";

if (apiKey) {
  runContractSuite(baseUrl, apiKey);
}

The suite opens a session via POST /v1/sessions with Authorization: Bearer <apiKey> and body { servers: [], user_id: "contract-suite" }. Every leg asserts the 201 body carries id, status: "active", the posted user_id, servers (a string[] that includes every posted id) and a parseable created_at — the fields @codespar/sdk builds its session from. Then it validates:

  • execute() calls a registered tool and returns a ToolResult
  • send() returns a SendResult with a message field
  • sendStream() yields well-typed StreamEvents including a done event
  • connections() answers 2xx with { servers }, each entry carrying id and connected (tools, when present, must be an array)
  • close() transitions session.status to "closed"

See docs/custom-session-runtime.md for a full implementation guide.

Need more?

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT — codespar.dev

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 @codespar/types

References

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

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229