{"_id":"@ai-operations/shared-types","name":"@ai-operations/shared-types","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ai-operations/shared-types","version":"0.1.0","description":"Core TypeScript types and schemas for AI Operations OS — tasks, workflows, approvals, receipts, SPARK learning","private":false,"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","clean":"rm -rf dist"},"devDependencies":{"typescript":"^5.7.0"},"repository":{"type":"git","url":"git+https://github.com/zanderone1980/ai-operations-os.git","directory":"packages/shared-types"},"bugs":{"url":"https://github.com/zanderone1980/ai-operations-os/issues"},"author":{"name":"Alex Pinkevich","email":"alex@zanderpinkdesign.com"},"license":"MIT","publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"keywords":["ai-ops","ai-agents","workflow","automation","safety"],"_id":"@ai-operations/shared-types@0.1.0","gitHead":"5479e60c372e0d4d5269e3fd1f87915563e9a87d","homepage":"https://github.com/zanderone1980/ai-operations-os#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-CDuP5jEhBnXO5xWk/PkjjuszJolJqRyPVBj8mNkclNdS+tMlrs95jOxTcpPHcNxnxMtO03TXgLRjBDFcGxCM2w==","shasum":"9b85bc9fca33f37b9b3723a7d54e31b89b372f4c","tarball":"https://registry.npmjs.org/@ai-operations/shared-types/-/shared-types-0.1.0.tgz","fileCount":66,"unpackedSize":160353,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIECHdw1TBRiDYSh1I2kk7mg9Li9uXVxrXVrFl+MwVRGiAiEAzSEyXzWvCmS5Ov5qCVBhL/uJVST05+SBxVUdxcI0hxo="}]},"_npmUser":{"name":"alexpinkone","email":"pinkevich1980@gmail.com"},"directories":{},"maintainers":[{"name":"alexpinkone","email":"pinkevich1980@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/shared-types_0.1.0_1773153556198_0.10729678474987336"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-10T14:39:16.095Z","0.1.0":"2026-03-10T14:39:16.333Z","modified":"2026-03-10T14:39:16.624Z"},"maintainers":[{"name":"alexpinkone","email":"pinkevich1980@gmail.com"}],"description":"Core TypeScript types and schemas for AI Operations OS — tasks, workflows, approvals, receipts, SPARK learning","homepage":"https://github.com/zanderone1980/ai-operations-os#readme","keywords":["ai-ops","ai-agents","workflow","automation","safety"],"repository":{"type":"git","url":"git+https://github.com/zanderone1980/ai-operations-os.git","directory":"packages/shared-types"},"author":{"name":"Alex Pinkevich","email":"alex@zanderpinkdesign.com"},"bugs":{"url":"https://github.com/zanderone1980/ai-operations-os/issues"},"license":"MIT","readme":"# @ai-operations/shared-types\n\n> Core data models, JSON schemas, and receipt cryptography for AI Operations OS.\n\nPart of [AI Operations OS](https://github.com/zanderone1980/ai-operations-os) — autonomous business workflow orchestration with safety enforcement.\n\n## Install\n\n```\nnpm install @ai-operations/shared-types\n```\n\n## Quick Start\n\n```ts\nimport { createTask, createWorkflowRun, createStep, verifyReceiptChain } from '@ai-operations/shared-types';\n\nconst task = createTask({ source: 'email', title: 'Reply to John' });\nconst run = createWorkflowRun(task.id, 'email-reply', [\n  createStep('gmail', 'send', { to: 'john@example.com', body: 'On it!' }),\n]);\n```\n\n## API\n\n### Types\n\n#### `Task`\nThe universal work item. Every email, calendar event, social mention, store order, or manual request becomes a Task.\n\n- `TaskSource` — `'email' | 'calendar' | 'social' | 'store' | 'manual'`\n- `TaskIntent` — `'reply' | 'schedule' | 'post' | 'fulfill' | 'refund' | 'escalate' | 'ignore' | 'unknown'`\n- `TaskPriority` — `'urgent' | 'high' | 'normal' | 'low'`\n- `TaskStatus` — `'pending' | 'planned' | 'running' | 'awaiting_approval' | 'completed' | 'failed'`\n\n#### `WorkflowRun` / `WorkflowStep`\nExecution tracking for multi-step automations. A Task triggers a WorkflowRun with ordered steps.\n\n#### `ActionReceipt`\nCryptographically signed proof of execution. Receipts are hash-chained (SHA-256 + HMAC-SHA256) for tamper detection.\n\n#### `Approval`\nHuman-in-the-loop gate with risk level, preview, decision, and optional TTL.\n\n#### `PolicyRule` / `PolicyConfig`\nBusiness rule definitions with autonomy levels (`'auto' | 'approve' | 'deny'`).\n\n### Factory Functions\n\n#### `createTask(partial): Task`\nCreate a new Task with sensible defaults. Requires `source` and `title`.\n\n#### `createWorkflowRun(taskId, workflowType, steps): WorkflowRun`\nCreate a new WorkflowRun with ordered steps in `'queued'` state.\n\n#### `createStep(connector, operation, input?): WorkflowStep`\nCreate a single workflow step definition for use with `createWorkflowRun`.\n\n### Receipt Cryptography\n\n```ts\nimport { computeReceiptHash, signReceipt, verifyReceipt, verifyReceiptChain, GENESIS_HASH } from '@ai-operations/shared-types';\n\nconst hash = computeReceiptHash(receiptData);       // SHA-256 content hash\nconst sig  = signReceipt(hash, 'hmac-key');          // HMAC-SHA256 signature\nconst ok   = verifyReceipt(receipt, 'hmac-key');     // Verify single receipt\nconst chain = verifyReceiptChain(receipts, 'hmac-key'); // { valid, brokenAt?, reason? }\n```\n\n### JSON Schemas\n\nJSON Schema draft-07 definitions for runtime validation and OpenAPI generation:\n\n```ts\nimport { TaskSchema, ApprovalSchema, ActionReceiptSchema, WorkflowRunSchema, SCHEMAS } from '@ai-operations/shared-types';\n\n// SCHEMAS is a registry: { Task, Approval, ActionReceipt, WorkflowStep, WorkflowRun }\n```\n\n## Related Packages\n\n- [`@ai-operations/ops-core`](../ops-core) — Workflow engine consuming these types\n- [`@ai-operations/ops-storage`](../ops-storage) — SQLite persistence for tasks, workflows, approvals\n- [`@ai-operations/ops-policy`](../ops-policy) — Policy rules built on PolicyConfig\n- [`@ai-operations/codebot-adapter`](../codebot-adapter) — Receipt building and chain verification\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-36788c089b2408acdb74e046c506ffa1"}