New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ai-operations/shared-types

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-operations/shared-types

Core TypeScript types and schemas for AI Operations OS — tasks, workflows, approvals, receipts, SPARK learning

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@ai-operations/shared-types

Core data models, JSON schemas, and receipt cryptography for AI Operations OS.

Part of AI Operations OS — autonomous business workflow orchestration with safety enforcement.

Install

npm install @ai-operations/shared-types

Quick Start

import { createTask, createWorkflowRun, createStep, verifyReceiptChain } from '@ai-operations/shared-types';

const task = createTask({ source: 'email', title: 'Reply to John' });
const run = createWorkflowRun(task.id, 'email-reply', [
  createStep('gmail', 'send', { to: 'john@example.com', body: 'On it!' }),
]);

API

Types

Task

The universal work item. Every email, calendar event, social mention, store order, or manual request becomes a Task.

  • TaskSource'email' | 'calendar' | 'social' | 'store' | 'manual'
  • TaskIntent'reply' | 'schedule' | 'post' | 'fulfill' | 'refund' | 'escalate' | 'ignore' | 'unknown'
  • TaskPriority'urgent' | 'high' | 'normal' | 'low'
  • TaskStatus'pending' | 'planned' | 'running' | 'awaiting_approval' | 'completed' | 'failed'

WorkflowRun / WorkflowStep

Execution tracking for multi-step automations. A Task triggers a WorkflowRun with ordered steps.

ActionReceipt

Cryptographically signed proof of execution. Receipts are hash-chained (SHA-256 + HMAC-SHA256) for tamper detection.

Approval

Human-in-the-loop gate with risk level, preview, decision, and optional TTL.

PolicyRule / PolicyConfig

Business rule definitions with autonomy levels ('auto' | 'approve' | 'deny').

Factory Functions

createTask(partial): Task

Create a new Task with sensible defaults. Requires source and title.

createWorkflowRun(taskId, workflowType, steps): WorkflowRun

Create a new WorkflowRun with ordered steps in 'queued' state.

createStep(connector, operation, input?): WorkflowStep

Create a single workflow step definition for use with createWorkflowRun.

Receipt Cryptography

import { computeReceiptHash, signReceipt, verifyReceipt, verifyReceiptChain, GENESIS_HASH } from '@ai-operations/shared-types';

const hash = computeReceiptHash(receiptData);       // SHA-256 content hash
const sig  = signReceipt(hash, 'hmac-key');          // HMAC-SHA256 signature
const ok   = verifyReceipt(receipt, 'hmac-key');     // Verify single receipt
const chain = verifyReceiptChain(receipts, 'hmac-key'); // { valid, brokenAt?, reason? }

JSON Schemas

JSON Schema draft-07 definitions for runtime validation and OpenAPI generation:

import { TaskSchema, ApprovalSchema, ActionReceiptSchema, WorkflowRunSchema, SCHEMAS } from '@ai-operations/shared-types';

// SCHEMAS is a registry: { Task, Approval, ActionReceipt, WorkflowStep, WorkflowRun }

License

MIT

Keywords

ai-ops

FAQs

Package last updated on 10 Mar 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