{"_id":"@delentia/delentia-os","_rev":"2-1fc171a975e0f93756deac7241e39252","name":"@delentia/delentia-os","dist-tags":{"latest":"1.4.0"},"versions":{"1.3.0":{"name":"@delentia/delentia-os","version":"1.3.0","keywords":["delentia","fdia","jitna","signedai","ai-governance","constitutional-ai","intent-centric","ai-agents","hexacore","recot"],"author":{"url":"https://delentia.com","name":"Delentia Labs","email":"founder@delentia.com"},"license":"Apache-2.0","_id":"@delentia/delentia-os@1.3.0","maintainers":[{"name":"ittiritsaengow","email":"ittirit720@gmail.com"}],"homepage":"https://delentia.com","bugs":{"url":"https://github.com/delentia-labs/delentia-os/issues"},"bin":{"delentia":"dist/cli/index.js"},"dist":{"shasum":"d6447dd3cbbef0cbe315d68d1b082c1caa6a5780","tarball":"https://registry.npmjs.org/@delentia/delentia-os/-/delentia-os-1.3.0.tgz","fileCount":70,"integrity":"sha512-ZihRlXfuzpaZvODhOzW2ZJu5cZ8UE/w9HnoI2EvOniBCoOqL3jcMXMBZxgQl8+Q94Vg/yIHVAjDuQVz+T7GJCA==","signatures":[{"sig":"MEUCIQD4ooeRQgvYfnFrkbFrx1dRi0hmGLAcNXbhORf/g2XCGwIgblFTlDIOsPddTrD8fukJ5wQTHO1UIYWux014D3AHg+E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120548},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"afd2cee00c65a93e59f2c1118d5ad1820e853e39","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"ittiritsaengow","email":"ittirit720@gmail.com"},"repository":{"url":"git+https://github.com/delentia-labs/delentia-os.git","type":"git","directory":"sdk-typescript"},"_npmVersion":"11.9.0","description":"TypeScript SDK + CLI for Delentia OS — FDIA scoring, JITNA packets, SignedAI tier selection, npx delentia CLI","directories":{},"_nodeVersion":"24.14.0","dependencies":{"ora":"^5.4.1","axios":"^1.7.0","boxen":"^5.1.2","chalk":"^4.1.2","enquirer":"^2.4.1","commander":"^12.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","ts-jest":"^29.0.0","typescript":"^5.4.0","@types/jest":"^29.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/delentia-os_1.3.0_1779950823588_0.7794365984154799","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@delentia/delentia-os","version":"1.4.0","description":"TypeScript SDK + CLI for Delentia OS — FDIA scoring, JITNA packets, SignedAI tier selection, npx delentia CLI","main":"dist/index.js","types":"dist/index.d.ts","bin":{"delentia":"dist/cli/index.js"},"scripts":{"build":"tsc","test":"jest","prepublishOnly":"npm run build"},"keywords":["delentia","fdia","jitna","signedai","ai-governance","constitutional-ai","intent-centric","ai-agents","hexacore","recot"],"author":{"name":"Delentia Labs","email":"founder@delentia.com","url":"https://delentia.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/delentia-labs/delentia-os.git","directory":"sdk-typescript"},"homepage":"https://delentia.com","bugs":{"url":"https://github.com/delentia-labs/delentia-os/issues"},"engines":{"node":">=16.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"typescript":"^5.4.0","@types/node":"^20.0.0","jest":"^29.0.0","@types/jest":"^29.0.0","ts-jest":"^29.0.0"},"dependencies":{"axios":"^1.7.0","chalk":"^4.1.2","ora":"^5.4.1","boxen":"^5.1.2","commander":"^12.0.0","enquirer":"^2.4.1"},"_id":"@delentia/delentia-os@1.4.0","gitHead":"dbe6895e5d89db6554481dfb1250b47d5d2a611c","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-FGuhttqJQMsXMXcJ+6LNhrj68vVA/Rtnv+5M1SqulCw1X3D8w9lj7BA0Fl/GsJbSOGnALF+EJ2yyrllO8VBJRA==","shasum":"e85b4f806f556d307ce35c468a4ad16d7c4d74ce","tarball":"https://registry.npmjs.org/@delentia/delentia-os/-/delentia-os-1.4.0.tgz","fileCount":70,"unpackedSize":120223,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC/E/muigFInwIxtmptB291x/OAbBOqdLzlXg1qneizaAiAJvJPJK4Ca1nWVIcm8ncb320QQc1paSUvzfjL9xoau5Q=="}]},"_npmUser":{"name":"ittiritsaengow","email":"ittirit720@gmail.com"},"directories":{},"maintainers":[{"name":"ittiritsaengow","email":"ittirit720@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/delentia-os_1.4.0_1780717429806_0.47439086100789485"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-28T06:47:03.442Z","modified":"2026-06-06T03:43:50.088Z","1.3.0":"2026-05-28T06:47:03.732Z","1.4.0":"2026-06-06T03:43:49.960Z"},"bugs":{"url":"https://github.com/delentia-labs/delentia-os/issues"},"author":{"name":"Delentia Labs","email":"founder@delentia.com","url":"https://delentia.com"},"license":"Apache-2.0","homepage":"https://delentia.com","keywords":["delentia","fdia","jitna","signedai","ai-governance","constitutional-ai","intent-centric","ai-agents","hexacore","recot"],"repository":{"type":"git","url":"git+https://github.com/delentia-labs/delentia-os.git","directory":"sdk-typescript"},"description":"TypeScript SDK + CLI for Delentia OS — FDIA scoring, JITNA packets, SignedAI tier selection, npx delentia CLI","maintainers":[{"name":"ittiritsaengow","email":"ittirit720@gmail.com"}],"readme":"# @delentia/delentia-os\n\n[![npm](https://img.shields.io/npm/v/@delentia/delentia-os?color=cb3837&logo=npm)](https://www.npmjs.com/package/@delentia/delentia-os)\n[![License](https://img.shields.io/badge/license-Apache%202.0-green)](https://github.com/delentia-labs/delentia-os/blob/main/LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)\n\n**TypeScript / JavaScript SDK for [RCT Platform](https://delentia.com)** — the world's first Intent-Centric AI Operating System with constitutional architecture.\n\n---\n\n## What is RCT Platform?\n\nRCT Platform provides:\n- **FDIA Formula** — `F = D^I × A` — constitutional scoring that governs AI freedom to act\n- **JITNA Packets** — Just-In-Time Need Analysis structured intent envelopes\n- **SignedAI Tiers** — HexaCore role assignment based on user tier and risk profile\n- **REST Client** — typed Axios wrapper for the delentia-os FastAPI backend\n\n---\n\n## Installation\n\n```bash\nnpm install @delentia/delentia-os\n# or\nyarn add @delentia/delentia-os\n# or\npnpm add @delentia/delentia-os\n```\n\n---\n\n## CLI — `npx rct`\n\nThe package ships a full command-line interface. Run without installing:\n\n```bash\nnpx @delentia/delentia-os --help\n```\n\nOr install globally for the `rct` command:\n\n```bash\nnpm install -g @delentia/delentia-os\nrct --help\n```\n\n### Commands\n\n| Command | Description |\n|---------|-------------|\n| `rct compile \"<intent>\"` | Compile intent → FDIA + JITNA + policy evaluation |\n| `rct status` | Show control plane metrics (requires running server) |\n| `rct init` | Interactive wizard → writes `.rct.json` config |\n| `rct fdia <d> <i> <a>` | Offline constitutional gate check |\n\n### Examples\n\n```bash\n# Check constitutional gate offline\nnpx @delentia/delentia-os fdia 0.9 0.95 1.0\n# ╭────── FDIA — Constitutional Gate PASSED ──────╮\n# │  F Score:  0.9048  Risk: LOW  Gate: 0.75 PASS ✔ │\n# ╰───────────────────────────────────────────────╯\n\n# Compile intent (requires delentia-os server running)\nnpx @delentia/delentia-os compile \"Refactor the authentication module\" --url http://localhost:8000\n\n# Interactive project setup\nnpx @delentia/delentia-os init\n\n# Server health + metrics\nnpx @delentia/delentia-os status\n```\n\n### `rct fdia` — Offline Mode\n\n```bash\nrct fdia <d> <i> <a> [--gate <threshold>] [--no-banner]\n```\n\n| Arg | Range | Description |\n|-----|-------|-------------|\n| `d` | 0.0–1.0 | Delta — change vector magnitude |\n| `i` | 0.0–1.0 | Identity — role confidence |\n| `a` | 0.0–1.0 | Architect gate (0=blocked, 1=approved) |\n| `--gate` | 0.0–1.0 | Minimum pass threshold (default: `0.75`) |\n\n---\n\n## Quick Start\n\n### FDIA Constitutional Formula\n\n```typescript\nimport { computeFDIA, meetsThreshold } from \"@delentia/delentia-os\";\n\n// Compute F = D^I × A\nconst result = computeFDIA(0.7, 0.9, 1.0);\nconsole.log(result);\n// {\n//   f: 0.667,\n//   d: 0.7, i: 0.9, a: 1.0,\n//   riskLevel: \"LOW\",\n//   isBlocked: false,\n//   explanation: \"F=0.667 = D^I × A = 0.70^0.90 × 1.00 → Risk=LOW\"\n// }\n\n// Check against governance threshold\nconst allowed = meetsThreshold(result, 0.5);\nconsole.log(allowed); // true\n```\n\n### JITNA Packet Construction\n\n```typescript\nimport { constructJITNA, serializeJITNA } from \"@delentia/delentia-os\";\n\nconst packet = constructJITNA({\n  intent: \"Refactor the authentication module\",\n  userTier: \"PRO\",\n  region: \"ASEAN\",\n});\n\nconsole.log(packet.packetId);     // \"jitna_<uuid>\"\nconsole.log(packet.scope.region); // \"ASEAN\"\n\nconst json = serializeJITNA(packet);\n```\n\n### SignedAI Tier Selection\n\n```typescript\nimport { selectSignedAITier } from \"@delentia/delentia-os\";\n\nconst selection = selectSignedAITier(\"PRO\", \"STRUCTURAL\");\nconsole.log(selection.roles);\n// [\"SUPREME_ARCHITECT\", \"LEAD_BUILDER\", \"JUNIOR_BUILDER\",\n//  \"SPECIALIST\", \"LIBRARIAN\", \"HUMANIZER\"]\nconsole.log(selection.maxParallelAgents); // 4\n```\n\n### REST Client (requires running delentia-os server)\n\n```typescript\nimport { RCTClient } from \"@delentia/delentia-os\";\n\nconst client = new RCTClient({\n  baseURL: \"https://your-rct-instance.com\",\n  apiKey: \"your-api-key\",\n});\n\n// Compile an intent\nconst compiled = await client.compile(\"Optimize database queries\");\nconsole.log(compiled.intent_id);\nconsole.log(compiled.risk_profile);\n\n// Evaluate against governance policies\nconst evaluation = await client.evaluatePolicy(compiled.intent_id);\nconsole.log(evaluation.decision); // \"approve\" | \"reject\" | \"require_approval\"\n\n// Get system metrics\nconst metrics = await client.getMetrics();\nconsole.log(metrics.total_intents);\n```\n\n---\n\n## API Reference\n\n### `computeFDIA(d, i, a): FDIAResult`\n\nCompute the constitutional FDIA score using `F = D^I × A`.\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `d` | `number` (0.0–1.0) | Delta — change vector magnitude |\n| `i` | `number` (0.0–1.0) | Identity — role confidence |\n| `a` | `number` (0.0–1.0) | Architect gate (0=blocked, 1=approved) |\n\nReturns `FDIAResult` with: `f`, `d`, `i`, `a`, `riskLevel`, `isBlocked`, `explanation`.\n\n---\n\n### `meetsThreshold(result, threshold): boolean`\n\nCheck if an `FDIAResult` meets the minimum freedom threshold.\n\n---\n\n### `constructJITNA(options): JITNAPacket`\n\nBuild a structured JITNA intent packet.\n\n| Option | Type | Default |\n|--------|------|---------|\n| `intent` | `string` | required |\n| `userTier` | `\"FREE\" \\| \"PRO\" \\| \"ENTERPRISE\"` | `\"FREE\"` |\n| `region` | `string` | `\"GLOBAL\"` |\n| `budgetTokens` | `number` | `4096` |\n\n---\n\n### `selectSignedAITier(tier, riskProfile): TierSelection`\n\nMap user tier + risk profile to HexaCore role assignments.\n\n| Tier | Roles | Max Parallel Agents |\n|------|-------|-------------------|\n| `FREE` | 4 roles | 2 |\n| `PRO` | 6 roles | 4 |\n| `ENTERPRISE` | 8 roles (full HexaCore) | 8 |\n\n---\n\n### `RCTClient`\n\nTyped Axios client for the delentia-os REST API.\n\n```typescript\nconst client = new RCTClient(config?: RCTClientConfig);\nawait client.compile(intentText: string): Promise<CompileResponse>\nawait client.evaluatePolicy(intentId: string): Promise<PolicyEvalResponse>\nawait client.getMetrics(): Promise<MetricsResponse>\n```\n\n---\n\n## TypeScript Support\n\nFull TypeScript support with bundled type declarations (`dist/index.d.ts`).\n\n```typescript\nimport type {\n  FDIAResult, FDIAScores, RiskLevel,\n  JITNAPacket, JITNAMeta,\n  TierSelection, UserTier, HexaCoreRole,\n  RCTClientConfig, CompileResponse,\n} from \"@delentia/delentia-os\";\n```\n\n---\n\n## Links\n\n- **Website**: [delentia.com](https://delentia.com)\n- **Python SDK (PyPI)**: [delentia-os](https://pypi.org/project/delentia-os/)\n- **GitHub**: [rctlabs/delentia-os](https://github.com/delentia-labs/delentia-os)\n- **Docs**: [rctlabs.github.io/delentia-os](https://rctlabs.github.io/delentia-os/)\n- **Issues**: [GitHub Issues](https://github.com/delentia-labs/delentia-os/issues)\n\n---\n\n## License\n\n[Apache 2.0](https://github.com/delentia-labs/delentia-os/blob/main/LICENSE) © Delentia Labs\n","readmeFilename":"README.md"}