{"_id":"@aimf/shared","_rev":"2-9b81fde8833b0f5d5e6ed2e492fc1e0d","name":"@aimf/shared","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@aimf/shared","version":"0.1.0","keywords":["aimf","shared","utilities","types"],"author":{"name":"AIMF Team"},"license":"MIT","_id":"@aimf/shared@0.1.0","maintainers":[{"name":"vetriselvans","email":"vetriselvans029@gmail.com"}],"homepage":"https://github.com/aimf/aimf-framework#readme","bugs":{"url":"https://github.com/aimf/aimf-framework/issues"},"dist":{"shasum":"5a1a5bd52482c3f952e37b87e05f852665f5c517","tarball":"https://registry.npmjs.org/@aimf/shared/-/shared-0.1.0.tgz","fileCount":82,"integrity":"sha512-KM1RGnndnxREiVymXmUPEwksG2+rmR2QRHrnjTI7uHnr9qMIvEDDh1LpmIdX5isoo3yDXUEo5o45reIBzA2RkA==","signatures":[{"sig":"MEUCICZktLL2b5X8WloRXb6WqEksucAWapHLRb74YewMDunFAiEAy6S7dfMo73y22BWCpcqxnzDidv9A7NPw03cVf4G+cW0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":117632},"main":"dist/index.js","type":"module","_from":"file:aimf-shared-0.1.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types/*":{"types":"./dist/types/*.d.ts","import":"./dist/types/*.js"},"./utils/*":{"types":"./dist/utils/*.d.ts","import":"./dist/utils/*.js"},"./errors/*":{"types":"./dist/errors/*.d.ts","import":"./dist/errors/*.js"},"./constants/*":{"types":"./dist/constants/*.d.ts","import":"./dist/constants/*.js"}},"scripts":{"dev":"tsc --watch","build":"tsc","clean":"rimraf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"vetriselvans","email":"vetriselvans029@gmail.com"},"_resolved":"C:\\Users\\I9159~1.LAP\\AppData\\Local\\Temp\\35de690ea689a98440168acb59300dbe\\aimf-shared-0.1.0.tgz","_integrity":"sha512-KM1RGnndnxREiVymXmUPEwksG2+rmR2QRHrnjTI7uHnr9qMIvEDDh1LpmIdX5isoo3yDXUEo5o45reIBzA2RkA==","repository":{"url":"git+https://github.com/aimf/aimf-framework.git","type":"git","directory":"packages/shared"},"_npmVersion":"10.9.0","description":"Shared utilities, types, and constants for AIMF","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","typescript":"^5.7.2","@types/node":"^22.10.1"},"_npmOperationalInternal":{"tmp":"tmp/shared_0.1.0_1765128986184_0.8233029743186582","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aimf/shared","version":"0.1.1","description":"Shared utilities, types, and constants for AIMF","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types/*":{"types":"./dist/types/*.d.ts","import":"./dist/types/*.js"},"./utils/*":{"types":"./dist/utils/*.d.ts","import":"./dist/utils/*.js"},"./errors/*":{"types":"./dist/errors/*.d.ts","import":"./dist/errors/*.js"},"./constants/*":{"types":"./dist/constants/*.d.ts","import":"./dist/constants/*.js"}},"devDependencies":{"@types/node":"^22.10.1","rimraf":"^6.0.1","typescript":"^5.7.2"},"repository":{"type":"git","url":"git+https://github.com/open-kit-aimf/aimf-framework.git","directory":"packages/shared"},"keywords":["aimf","shared","utilities","types"],"author":{"name":"AIMF Team"},"license":"MIT","scripts":{"build":"tsc","dev":"tsc --watch","clean":"rimraf dist","typecheck":"tsc --noEmit"},"_id":"@aimf/shared@0.1.1","bugs":{"url":"https://github.com/open-kit-aimf/aimf-framework/issues"},"homepage":"https://github.com/open-kit-aimf/aimf-framework#readme","_integrity":"sha512-61ZqIIFeVvFnkU/+UddWQl5nAwZs2PEaf2hOHlFwnNayY6GNCTtqf6fK1T1HB3iFn5sRquvNQvaEsdHsFUW/jA==","_resolved":"C:\\Users\\I9159~1.LAP\\AppData\\Local\\Temp\\ddb717f15633986fdffc505990faba2f\\aimf-shared-0.1.1.tgz","_from":"file:aimf-shared-0.1.1.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-61ZqIIFeVvFnkU/+UddWQl5nAwZs2PEaf2hOHlFwnNayY6GNCTtqf6fK1T1HB3iFn5sRquvNQvaEsdHsFUW/jA==","shasum":"38fe86ff359558d9e55ce789c542703839476c5e","tarball":"https://registry.npmjs.org/@aimf/shared/-/shared-0.1.1.tgz","fileCount":82,"unpackedSize":117641,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDleB0IncxRFuelzZteUKRrMZuKxyQcyNxOIX22nQwZWgIgbZeh67qKfcCpqmA7Kz97tXzFfBDw78eOiM6G5iOBgHE="}]},"_npmUser":{"name":"vetriselvans","email":"vetriselvans029@gmail.com"},"directories":{},"maintainers":[{"name":"vetriselvans","email":"vetriselvans029@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/shared_0.1.1_1765130852120_0.25321848903694"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-07T17:36:26.008Z","modified":"2025-12-07T18:07:32.473Z","0.1.0":"2025-12-07T17:36:26.323Z","0.1.1":"2025-12-07T18:07:32.275Z"},"bugs":{"url":"https://github.com/open-kit-aimf/aimf-framework/issues"},"author":{"name":"AIMF Team"},"license":"MIT","homepage":"https://github.com/open-kit-aimf/aimf-framework#readme","keywords":["aimf","shared","utilities","types"],"repository":{"type":"git","url":"git+https://github.com/open-kit-aimf/aimf-framework.git","directory":"packages/shared"},"description":"Shared utilities, types, and constants for AIMF","maintainers":[{"name":"vetriselvans","email":"vetriselvans029@gmail.com"}],"readme":"# @aimf/shared\r\n\r\nCore utilities, types, and constants for the AI-MCP Framework (AIMF).\r\n\r\n## Installation\r\n\r\n```bash\r\npnpm add @aimf/shared\r\n```\r\n\r\n## Usage\r\n\r\n### Types\r\n\r\n```typescript\r\nimport type { \r\n  // NCP Protocol\r\n  NcpRequest, \r\n  NcpResponse, \r\n  NcpEnvelope,\r\n  NcpEndpoint,\r\n  \r\n  // Storage\r\n  StorageRecord,\r\n  NeuralHash,\r\n  MerkleProof,\r\n  VerificationResult,\r\n  \r\n  // Security\r\n  ZtniIdentity,\r\n  AuthRequest,\r\n  AuthResponse,\r\n  \r\n  // Events\r\n  NeuralEvent,\r\n  EventSubscription,\r\n  \r\n  // Manifest\r\n  NeuralManifest,\r\n} from \"@aimf/shared\";\r\n\r\nconst request: NcpRequest = {\r\n  jsonrpc: \"2.0\",\r\n  id: \"1\",\r\n  method: \"neural.store\",\r\n  params: { content: \"Hello, World!\" },\r\n};\r\n```\r\n\r\n### Error Handling\r\n\r\n```typescript\r\nimport { AimfError, ErrorCode } from \"@aimf/shared\";\r\n\r\nthrow new AimfError(\r\n  ErrorCode.VALIDATION_ERROR,\r\n  \"Invalid input\",\r\n  { field: \"name\" }\r\n);\r\n```\r\n\r\n### Utilities\r\n\r\n```typescript\r\nimport { \r\n  generateId, \r\n  computeHash, \r\n  isNcpRequest,\r\n  encodeBase64,\r\n  decodeBase64,\r\n  encodeFloat32Array,\r\n  decodeFloat32Array,\r\n} from \"@aimf/shared\";\r\n\r\nconst id = generateId();\r\nconst hash = computeHash(\"content\");\r\nconst isValid = isNcpRequest(message);\r\n\r\n// Encode/decode embeddings\r\nconst embedding = new Float32Array([0.1, 0.2, 0.3]);\r\nconst encoded = encodeFloat32Array(embedding);\r\nconst decoded = decodeFloat32Array(encoded);\r\n```\r\n\r\n### Constants\r\n\r\n```typescript\r\nimport { NCP_METHODS, DEFAULT_TIMEOUTS } from \"@aimf/shared\";\r\n\r\nconsole.log(NCP_METHODS.STORE); // \"neural.store\"\r\nconsole.log(DEFAULT_TIMEOUTS.REQUEST); // 30000\r\n```\r\n\r\n## Type Categories\r\n\r\n### NCP Protocol Types\r\n- `NcpRequest`, `NcpResponse`, `NcpNotification` - JSON-RPC 2.0 messages\r\n- `NcpEnvelope` - Enterprise message wrapper with neural verification\r\n- `NcpEndpoint`, `NcpHop` - Routing types\r\n- `NcpTransportConfig` - Transport configuration\r\n\r\n### Storage Types  \r\n- `StorageRecord` - Neural-verified storage record\r\n- `NeuralHash` - Dual-hash verification structure\r\n- `MerkleProof` - Merkle tree proof for verification\r\n- `StorageQuery`, `StorageResult` - Query types\r\n- `VerificationResult` - Verification operation result\r\n\r\n### Security Types\r\n- `ZtniIdentity` - Zero-Trust Neural Identity\r\n- `Role`, `Permission`, `Policy` - RBAC types\r\n- `AuthRequest`, `AuthResponse` - Authentication types\r\n- `Certificate`, `VerificationProof` - Credential types\r\n\r\n### Event Types\r\n- `NeuralEvent` - Neural-verified event\r\n- `EventSubscription` - Subscription configuration\r\n- `EventSchema` - Event schema with compatibility\r\n- `EventTopic`, `ConsumerGroup` - Topic management\r\n\r\n### Manifest Types\r\n- `NeuralManifest` - Full package manifest\r\n- `ManifestCapabilities`, `NeuralRequirements` - Capability declarations\r\n- `PackageRegistryEntry` - Registry types\r\n\r\n## Exports\r\n\r\n- **Types**: NCP, Storage, Security, Events, Manifest, Common\r\n- **Errors**: AimfError class, ErrorCode enum, error factories\r\n- **Constants**: Protocol constants, default configuration values\r\n- **Utilities**: Hash, ID, validation, encoding helpers\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}