Skip to content

Sigmodx/sdk-typescript

Repository files navigation

@sigmodx/sdk — TypeScript / JavaScript SDK

TypeScript SDK for Sigmodx — audit infrastructure for AI agents making consequential decisions.

Installation

npm install @sigmodx/sdk
# or
yarn add @sigmodx/sdk

Quickstart

import { SigmodxClient, AgentBlockedError } from '@sigmodx/sdk';

const client = new SigmodxClient({
  apiKey: 'your-api-key',
  agentId: 'your-agent-uuid'
});

const inputHash = client.hashInputs({
  invoiceId: 'INV-2026-0042',
  vendorId:  'VENDOR-4821',
  amount:    32000
});

try {
  const result = await client.submitInvoiceDecision({
    decisionType: 'approve',
    inputHash,
    rationale: 'Invoice matches PO. Vendor in good standing.',
    invoiceAmount: 32000,
    vendorId: 'VENDOR-4821'
  });

  console.log(result.decisionEventId);
  console.log(result.agentState); // 'ALLOW' | 'LIMIT' | 'BLOCK'

  // Later — record what happened
  await client.recordOutcome(result.decisionEventId, 'processed');

} catch (e) {
  if (e instanceof AgentBlockedError) {
    // Agent is BLOCK — do not execute
    console.error('Agent blocked:', e.reason);
  }
}

Links

About

TypeScript SDK for Sigmodx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors