Scan your whole stack
From OX Research Newsroom
Are you using @procedures/client?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.68.7
@procedures/client was last scanned on 24 Nov 2026 at version 0.68.7. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.68.7 LATEST | 24 Nov 2026 | No rules fired |
| 0.68.6 | 24 Nov 2026 | No rules fired |
| 0.68.5 | 24 Nov 2026 | No rules fired |
| 0.68.4 | 24 Nov 2026 | Not shown |
| 0.68.3 | 24 Nov 2026 | Not shown |
Findings for v0.68.7. 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.68.7; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Universal protocol-agnostic RPC client/server with middleware composition, type-safe procedures, streaming and procedure-as-data.
The core depends on no other package of the repository. The procedure components are in @procedures/splay, the data structures in @procedures/collections, and the program store with the storage layer in @procedures/store.
@procedures/client is the foundational package of the Mark ecosystem, providing a complete RPC framework with:
npm install @procedures/client
npm installs zod and ws with it. The HTTP server transport needs express 4 or 5 (an optional peer dependency).
import "@procedures/client/register" registers the control flow (client.chain and the others) and procedure.define, get, list and delete in the global registry. createRegistry() adds them to each new registry.
client.trace runs the steps of a client.chain program one at a time, and gives one row for each step with its result. A step that can write does not run, and the procedure asks for a capability without writes. Thus a read-only face can serve it. The procedure reference gives the rows and the input fields upTo and sampleLimit.
graph TB
subgraph "Application Layer"
Procedures[Procedure System<br/>Type-safe RPC definitions]
Events[Event Bus<br/>Pub/sub messaging]
end
subgraph "Client/Server Core"
Client[Universal Client<TContext><br/>Protocol-agnostic RPC]
Server[Universal Server<br/>Handler registry]
Middleware[Middleware Chain<br/>Composable behaviors]
end
subgraph "Transport Layer"
HTTP[HTTP Transport<br/>RESTful + POST-only]
WebSocket[WebSocket Transport<br/>Bidirectional streaming]
Local[Local Transport<br/>In-process calls]
Mock[Mock Transport<br/>Testing]
end
Procedures --> Client
Procedures --> Server
Events -.-> Client
Client --> Middleware
Server --> Middleware
Middleware --> HTTP
Middleware --> WebSocket
Middleware --> Local
Middleware --> Mock
sequenceDiagram
participant App as Application
participant Client as Client
participant MW as Middleware Chain
participant Transport as Transport
participant Server as Server
participant Handler as Procedure Handler
App->>Client: call(method, payload)
Client->>MW: compose middleware
MW->>MW: retry, cache, timeout, auth...
MW->>Transport: send(message)
Transport->>Server: HTTP/WS/etc
Server->>Handler: execute handler
Handler-->>Server: result
Server-->>Transport: response
Transport-->>MW: response stream
MW-->>Client: unwrap/validate
Client-->>App: result
The Client class provides protocol-agnostic RPC with type-safe middleware composition:
Client<TContext>.use().withContext()Type-safe RPC procedure definitions with:
Onion-model middleware with:
Client<BaseContext & RetryContext & ...>)A host controls which procedures its callers reach, also through nested calls. See docs/POLICY.md.
expose: the procedures that the callers of a server can reach.client.chain) calls only exposed procedures.metadata.calls. With strictCalls, a procedure that declares nothing calls only exposed procedures.maxDepth: the highest depth of a nested call. The default is 64. A deeper call gets FORBIDDEN with the reason depth.timeoutInterceptor, tracingInterceptor, metricsInterceptor.The client uses @opentelemetry/api only. The API does nothing until the program registers an SDK, for example with startNodeTelemetry() of @mark1russell7/otel-ts/node.
traceparent, tracestate and baggage into the metadata of the call.traceparent and tracestate that the caller gave in the metadata of the call. For example, mark gives the variables TRACEPARENT and TRACESTATE of its environment there.tracingInterceptor makes a host span for a call of a host, and an internal span for a nested call. The handler runs in the context of its span.@procedures/peer reads it from a trusted caller.traceparent of its own ids, as before.@procedures/collections: data structures (List, Map, Set, Queue) and composable behaviors (LRU, TTL, bounded, evented).@procedures/splay: the procedure components, serializable UI descriptors (defineComponent, simpleComponent, streamingComponent).@procedures/store: the program store (procedure.store, load, sync), ApiStorage, HybridStorage and the synced registry.import { Client, HttpTransport } from "@procedures/client";
const client = new Client({
transport: new HttpTransport({ baseUrl: "https://api.example.com" })
})
.use(createRetryMiddleware({ maxRetries: 3 }))
.use(createAuthMiddleware({ token: "abc123" }));
// RPC call
const user = await client.call({ service: "users", operation: "get" }, { id: "123" });
// Streaming
for await (const event of client.stream({ service: "events", operation: "watch" }, {})) {
console.log(event);
}
import { defineProcedure, registerProcedures } from "client";
import * as z from "zod";
const getUserProcedure = defineProcedure({
path: ["users", "get"],
input: z.object({ id: z.string() }),
output: z.object({ id: z.string(), name: z.string() }),
handler: async ({ id }, ctx) => {
return await db.users.findById(id);
},
});
registerProcedures([getUserProcedure]);
callerOf(...modules) gives a function that runs the procedures of the modules. It makes the registry of the modules at the first call, and it does not use the global registry. Each call gives one value: the output, or the last item of a stream.
import { callerOf } from "@procedures/client";
import { ghModule } from "@procedures/gh";
const gh = callerOf(ghModule);
const runs = await gh<RunList>(["gh", "run", "list"], { repo: "owner/name" });
A peer with a state, for example a daemon, keeps its procedures in its own process. peerModule reads the manifest of the peer through procedure.manifest. It gives a module with a stub for each entry. The handler of each stub sends the call to the peer over HTTP.
import { readFileSync } from "node:fs";
import { createRegistry, peerModule } from "@procedures/client";
const jobs = await peerModule({
name: "jobs",
namespaces: ["jobs"],
// The module reads the address at each call: a peer gets a new port or token when it starts again
address: () => {
const { url, token } = JSON.parse(readFileSync("/run/jobs/discovery.json", "utf8"));
return { url, token };
},
});
const registry = createRegistry(jobs);
namespaces, the module forwards each namespace except client, procedure and handle (HOST_NAMESPACES), because each host has them.prefix puts a path in front of each local path. With ["jobs"], the entry queue.add becomes jobs.queue.add.signal stops the read of the manifest, for example AbortSignal.timeout(5000) for a peer that does not answer. Each call of a stub takes the signal of its own context.procedure.manifest. A host that has the client module (createRegistry()) has it. Another registry can register manifestProcedure.forwardedModule(manifest, call, options) makes the same stubs with another transport.A database, a service or a page of a browser is not JSON. A procedure that opens such an object keeps it in the handle scope of its caller. It gives a handle: { "handle": "h_<32 hex digits>" }. The procedures that take the handle get the object from the same scope.
import { handleModule, handleSchema, handleScopeOf } from "@procedures/client";
const open = createProcedure()
.path(["db", "open"])
.input(z.object({ path: z.string() }))
.output(z.object({ handle: z.string() }))
.handler(async ({ path }, ctx) => handleScopeOf(ctx).open("sqlite.Database", openDatabase(path), { label: path }))
.build();
const query = createProcedure()
.path(["db", "query"])
.input(z.object({ db: z.object({ handle: z.string() }), sql: z.string() }))
.handler(async ({ db, sql }, ctx) => handleScopeOf(ctx).get<Database>(db, "sqlite.Database").all(sql))
.build();
const registry = createRegistry({ name: "db", procedures: [open, query], requires: [handleModule] });
HandleScope to each owner. Each MCP session and each WebSocket connection has its own scope. The end of the session or the close of the connection closes each object of its scope.handleModule adds handle.list and handle.close. handle.list gives the open objects of the caller. handle.close closes one.close option of the open. Without it, the scope uses Symbol.asyncDispose, Symbol.dispose or a close() method.handles of the MCP transport and of WebSocketServerTransport sets maxHandles (64 by default) and idleMs. An object that no call used for idleMs closes.NOT_ACCEPTABLE.handleSchema(kind) gives the JSON Schema of a handle. Its keyword x-procedures-handle gives the kind of the object.VALIDATION_ERROR is for a handle that is not open. RATE_LIMITED is for a full scope. NOT_ACCEPTABLE is for a face that keeps no handles.handle.*. The handles of a host stay in the host.class Client<TContext = {}>Universal RPC client with type-safe middleware composition.
Constructor:
new Client(options: ClientOptions | Transport)
interface ClientOptions {
transport: Transport;
defaultMetadata?: Metadata;
throwOnError?: boolean; // default: true
}
Methods:
// Add middleware (returns new typed client)
use<TProvides>(middleware: ClientMiddleware): Client<TContext & TProvides>
// Create child client with additional context
withContext<TAdditional>(context: TAdditional): Client<TContext & TAdditional>
// Make RPC call (request/response)
call<TReq, TRes>(method: Method, payload: TReq, options?: CallOptions): Promise<TRes>
// Make streaming RPC call
stream<TReq, TRes>(method: Method, payload: TReq, options?: CallOptions): AsyncIterable<TRes>
// Execute procedure by path or reference
exec<TOutput>(refOrPath: ProcedureRef | ProcedurePath, input?: unknown): Promise<TOutput>
// Nested route API (batch calls with middleware overrides)
route<TRoute>(request: CallRequest<TRoute>): Promise<CallResponse<TRoute>>
routeStream<TRoute>(request: CallRequest<TRoute>): StreamingCallResponse<TRoute>
// Register validation schema (requires Zod middleware)
schema(method: Method, schemas: { input?: ZodSchema; output?: ZodSchema }): this
// Set custom procedure registry
useRegistry(registry: ProcedureRegistry): this
// Close transport
close(): Promise<void>
HttpTransportnew HttpTransport(options: HttpTransportOptions)
interface HttpTransportOptions {
baseUrl: string;
urlStrategy?: UrlStrategy; // default: defaultUrlPattern
httpMethodStrategy?: HttpMethodStrategy; // default: postOnlyStrategy
headerConverter?: HeaderConverter;
defaultHeaders?: Record<string, string>;
timeout?: Duration; // the time to the first item
credentials?: "include" | "same-origin" | "omit"; // the credentials mode of fetch
requestInit?: Omit<RequestInit, "method" | "headers" | "body" | "signal">;
fetch?: typeof fetch; // default: globalThis.fetch
}
An application with a cookie session on another origin sets credentials: "include". The browser then sends the cookies of the server with each call. The server must permit the origin of the page with credentials (CORS). Refer to "Procedure handler without a framework".
const client = new Client(new HttpTransport({ baseUrl: "https://api.example.com/api", credentials: "include" }));
WebSocketTransportFind 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.