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

logic-sdk

Latest version: v0.7.5

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: franpromano
0 Stars
0 Forks
15 Versions
2.6K Downloads
TypeScript Repo language

Scan summary

logic-sdk was last scanned on 29 Nov 2026 at version 0.7.5. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 15 versions; the latest 5 were published within 5 days (25–29 Nov 2026).
  • Findings: No rules fired in version 0.7.5.
  • Downloads: 2,611 downloads.

Versions

15 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.7.5 LATEST 29 Nov 2026 No rules fired
0.7.4 27 Nov 2026 No rules fired
0.7.3 27 Nov 2026 No rules fired
0.7.2 26 Nov 2026 Not shown
0.7.1 25 Nov 2026 Not shown

No rules fired in 0.7.5

Findings

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

README

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

Logic SDK

Business logic for TypeScript apps, as queries, mutations, actions, events, jobs and crons.

Write the layer between your routes and your database once, as plain declarations. Call it from an HTTP route, a Server Action, a queue worker, a script, a test or an AI agent: same rules, same transaction, same events.

Install

npm i logic-sdk zod

Node 24+, Bun or Cloudflare Workers. Postgres or SQLite on a disk for mutations, through Drizzle or any ORM that can run SQL in a transaction.

Quick start

Declare your types once, and who may do what:

// src/logic.ts
export const { query, mutation, action, event, listener, createRegistry } = init<Config>();

// src/policies.ts: sync type guards over the scope
export const anyone = () => true;
export const member = (s: Scope): s is MemberScope => s.actor !== null;
export const staff = (s: Scope): s is StaffScope => s.actor !== null && s.actor.role !== "guest";

Write a module:

// src/bookings/mutations.ts
/** Confirm a pending booking */
export const confirm = mutation({
  input: z.object({ bookingId: z.uuid() }),
  output: Booking,
  // Who may call it, on every call
  authorize: staff,

  async handler(ctx, input) {
    const booking = await findBooking(ctx, input.bookingId);
    if (booking.status !== "pending") {
      throw ctx.errors.reject("not_pending");
    }

    // Another module, in the same transaction
    await ctx.run(availability.hold, rangeOf(booking));

    // Delivered to listeners only after commit
    ctx.emit(confirmed, { bookingId: input.bookingId });

    return setStatus(ctx, booking.id, "confirmed");
  },
});

Register your modules and call them from anywhere:

// src/registry.ts
export const registry = createRegistry({
  modules: { bookings, availability },
  database: { adapter: drizzleAdapter(db) },
  services: { mailer, payments },
});

// a route, a job, a script, a test
const caller = registry.as({ actor, accountId });
await caller.run(bookings.confirm, { bookingId });

Work that must not be lost goes through a jobs adapter. Listeners, scheduled calls and crons all use it:

const database = drizzleAdapter(db);

export const registry = createRegistry({
  modules: { bookings, availability },
  database: { adapter: database },
  jobs: { adapter: databaseQueue(), scope: { store, load } },
});

// a listener, with tries
export const sendConfirmation = listener({ event: () => confirmed, attempts: 3, handler });

// a cron: a listener for the clock
export const sendDigest = cron({ schedule: "0 8 * * MON-FRI", scope: { kind: "system", job: "digest" }, handler: (ctx) => ctx.run(mailDigest) });

// later, from a mutation, committed with it
ctx.schedule(remindGuest, { bookingId }, { at: dayBefore(booking.checkIn) });

What you get

  • One transaction across modules. A failure anywhere rolls back everything, even if someone catches it.
  • Side effects after commit. Mutations emit events; listeners send the email once the data is safe.
  • Jobs, three ways. Your Postgres or SQLite as the queue (databaseQueue, with work() as the worker on Node), Cloudflare Queues alone, or an outbox in front of a queue. All but in-process can run a job twice, so make them idempotent.
  • Lost races retried. Deadlocks and serialization failures re-run the mutation in a fresh transaction: three tries, or database: { adapter, transactionAttempts }.
  • Who is calling, everywhere. The scope reaches every nested call and listener, and policies narrow its type.
  • Authorization on every call. authorize runs whoever calls: HTTP, an agent, a job or another function. Record rules are sync can* predicates the CLI checks.
  • Internal by default. A function reaches clients only when you publish it: in your oRPC router or an agent's tools, which refuse one without authorize, or from your own route, which should only call functions that have one.
  • Agents included. toAITool gives an agent your functions, under the same policies and transactions as your API, one function at a time.
  • Settings in one place. Declare config once, fill it from env at the entry, read ctx.config anywhere. The CLI fails the build if a module reads env.
  • Errors without HTTP. ctx.errors.reject, conflict, notFound, deny; adapters map them to statuses.
  • Tests without mocks. Each test is a real transaction on a real database, always rolled back.
  • No magic. No decorators, classes, codegen, build step or AsyncLocalStorage.

Adapters

Import
logic-sdk/drizzle/pg The database adapter, databaseQueue, outbox and failedJobs
logic-sdk/postgres databaseQueue, outbox and failedJobs on Postgres with any ORM
logic-sdk/drizzle/sqlite The same on SQLite: drizzleAdapter(() => drizzle("app.db"))
logic-sdk/sqlite databaseQueue, outbox and failedJobs on SQLite with any ORM
logic-sdk/cloudflare Cloudflare Queues and Cron Triggers
logic-sdk/node work(registry): a worker for jobs and crons in a long-running process
logic-sdk/fetch toResponse: a domain error as an HTTP response, for your own routes
logic-sdk/orpc toORPCProcedure: a function as an oRPC v2 procedure, for your router
logic-sdk/ai AI SDK tools: agents run your functions with the same rules
logic-sdk/testing Rolled-back test transactions, stubs, frozen time

CLI

npm i -D @logic-sdk/cli
npx logic-sdk list                   # every function, its kind and policy
logic-sdk show bookings.confirm      # schemas, what it runs and emits, who calls it
logic-sdk graph --format mermaid     # who runs whom, who reacts to which event

Read-only, --json everywhere, exit codes for scripts. The logic-sdk command ships with the main package and hands off to @logic-sdk/cli, so apps that don't use the CLI never download it.

Examples

  • examples/shop: start here. A shop written once and run on Node, Cloudflare Workers and Next.js, with an AI assistant.
  • examples/bookings: a bigger app. Six modules, Hono, Postgres, and a race test on real Postgres.

Docs

The docs site lives in apps/web (bun run --filter web dev). Start with the introduction and the quickstart. The agent skill, skills/logic-sdk/SKILL.md, ships in the package: the short version for coding agents.

Repository

bun install
bun run test    # build, typecheck, lint, package checks, all tests

packages/logic-sdk is the library, tested with bun test. examples/bookings runs on PGlite by default and on real Postgres with DATABASE_URL (bun run test:pg), which CI always sets. examples/shop also runs its Worker inside workerd. Decisions and their reasons are in DESIGN.md; what's next is in ROADMAP.md.

License

MIT

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 logic-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

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?

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

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