🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@orangecheck/agent-vercel

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orangecheck/agent-vercel

Wrap Vercel AI SDK tool() invocations with OC Agent scope enforcement and emit a signed agent-action envelope per tool execution. Provider-agnostic — works under Anthropic, OpenAI, Cohere, etc.

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
14
-22.22%
Maintainers
1
Weekly downloads
 
Created
Source

@orangecheck/agent-vercel

Wrap Vercel AI SDK tool() invocations with OC Agent scope enforcement and emit a signed agent-action envelope per tool execution. Provider-agnostic — works under Anthropic, OpenAI, Cohere, or any other model the AI SDK speaks.

Why

The Vercel AI SDK has converged on a clean tool({description, parameters, execute}) primitive that serializes naturally across providers. A single adapter at this layer covers a large fraction of teams shipping production agents.

This module wraps execute so every successful call produces a signed agent-action envelope citing the active delegation:

  • Pre-call: scope check (vercel:tool(verb=<verb>) against the delegation; refuses if not admissible).
  • Canonicalize the (verb, args, callId) tuple, BIP-322 sign as the agent address, emit envelope.
  • Run the real handler.
  • Return both the result (back to the model via the SDK) and the envelope (for your audit pipeline).

Status

v0.0.1 · in design. API shape is stable; the canonicalization layout ({args, call_id, verb} lexicographic, RFC 8785 canonical JSON, trailing LF) is locked. Production wiring with specific AI-SDK releases is intentionally not baked in — ocTool() is provider/SDK-agnostic so you can call it from any release of ai you're already on.

Install

npm i @orangecheck/agent-vercel
# peer deps:
npm i @orangecheck/agent-core @orangecheck/agent-signer

Quickstart

import { tool } from 'ai';
import { ocTool } from '@orangecheck/agent-vercel';

const invoiceCreate = ocTool({
    verb:        'invoice.create',
    description: 'create a new invoice',
    parameters:  invoiceSchema,
    execute:     async (args) => myInvoiceCreateImpl(args),
});

const tools = {
    'invoice.create': tool({
        description: invoiceCreate.description,
        parameters:  invoiceCreate.parameters as never,
        execute: async (args, { toolCallId }) => {
            const { result, action } = await invoiceCreate.execute(args, {
                agent, delegation, callId: toolCallId,
            });
            await yourAuditPipeline.append(action);
            return result;
        },
    }),
};

const { text } = await generateText({
    model: anthropic('claude-sonnet-4-6'),
    tools,
    prompt: 'invoice acme for $14.20',
});

The pattern: ocTool defines the OC-Agent-shaped wrapper; the AI SDK's tool() calls into that wrapper plus your audit pipeline.

What gets stamped

Stamp's content.hash is a SHA-256 of:

{
  "args":    <canonical JSON of args>,
  "call_id": "<sdk-assigned tool call id>",
  "verb":    "<verb>"
}

Default scope_exercised is vercel:tool(verb=<verb>). Override via scopeExercised.

API

  • canonicalizeToolCall(call) — RFC 8785 canonical bytes.
  • toolCallHash(call)sha256:<64-hex>.
  • stampToolCall(input) — sign without executing.
  • ocTool({verb, parameters, description, execute}) — provider-agnostic wrapped tool.

License

MIT.

Keywords

bitcoin

FAQs

Package last updated on 03 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts