Scan your whole stack
From OX Research Newsroom
Are you using logic-sdk?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.7.5
logic-sdk was last scanned on 29 Nov 2026 at version 0.7.5. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 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 |
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.
The publisher’s own README, as collected from the registry.
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.
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.
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) });
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.database: { adapter, transactionAttempts }.authorize runs whoever calls: HTTP, an agent, a job or another function. Record rules are sync can* predicates the CLI checks.authorize, or from your own route, which should only call functions that have one.toAITool gives an agent your functions, under the same policies and transactions as your API, one function at a time.config once, fill it from env at the entry, read ctx.config anywhere. The CLI fails the build if a module reads env.ctx.errors.reject, conflict, notFound, deny; adapters map them to statuses.AsyncLocalStorage.| 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 |
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/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.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.
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.
MIT
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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.