{"_id":"@affectively/aeon-preferences","_rev":"5-0aa16cd3afe932e0ce6b69a086ca5cbc","name":"@affectively/aeon-preferences","dist-tags":{"latest":"5.0.0"},"versions":{"1.0.0":{"name":"@affectively/aeon-preferences","version":"1.0.0","_id":"@affectively/aeon-preferences@1.0.0","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"dist":{"shasum":"ecdff3edf2e36ca82cb010bf1702b3d34d6d3753","tarball":"https://registry.npmjs.org/@affectively/aeon-preferences/-/aeon-preferences-1.0.0.tgz","fileCount":8,"integrity":"sha512-nng3UiyLqBfHtc4t/jjnTTKAu80i5ZDpGYso8CMtJ3vFQEcVtZvbz+v9by2lV+hQ7oevXCD/viOZRVQx5Dc6Yw==","signatures":[{"sig":"MEQCIBiiba4iY/32eKqC3b4kIwngtZgshtyQMkwYKLxc9fk7AiBaQH+lHOMxDF1S72B4rB40WcbC6clh43UrFIcnY9pU+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10887},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"a4549b63103e836c5d87318c4864c616f73ad9a4","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir ./dist"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"_npmVersion":"11.8.0","description":"Federated user preferences via Dash DB for the Aeon ecosystem.","directories":{},"_nodeVersion":"25.5.0","dependencies":{"zod":"^3.22.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/aeon-preferences_1.0.0_1772751045890_0.3054124585370812","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"1.0.1":{"name":"@affectively/aeon-preferences","version":"1.0.1","_id":"@affectively/aeon-preferences@1.0.1","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"dist":{"shasum":"dd86d150501bea0e2e7eba3cb0cbd61861f4ae20","tarball":"https://registry.npmjs.org/@affectively/aeon-preferences/-/aeon-preferences-1.0.1.tgz","fileCount":19,"integrity":"sha512-CSJVtupBxBaAe3tB6GNEzTo/biSfrY/eCDyOgJ58qFZ5WSZ+WIEjRu44j1AlopWGstW6pe7q/h3v3328ll/B2A==","signatures":[{"sig":"MEQCIAyYM7G6kOq3t8aYbEY5a6MKJ69eFMQPujqv6H1jDCoKAiB4n7A3Mp1LFli6mtLG+dRuGAkueUVrSWt4okfza17uXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":207270},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"d68de8a9f438507be4270bd25c5c0c883f1e3cb8","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir ./dist"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"_npmVersion":"11.8.0","description":"Federated user preferences via Dash DB for the Aeon ecosystem.","directories":{},"_nodeVersion":"25.5.0","dependencies":{"zod":"^3.22.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/aeon-preferences_1.0.1_1772751091745_0.3166391297928415","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"1.0.2":{"name":"@affectively/aeon-preferences","version":"1.0.2","_id":"@affectively/aeon-preferences@1.0.2","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"dist":{"shasum":"e6ae420e6fdae48a1708ccd20e0dd2ccaf05533b","tarball":"https://registry.npmjs.org/@affectively/aeon-preferences/-/aeon-preferences-1.0.2.tgz","fileCount":20,"integrity":"sha512-ywU5HULKmGJlx6qKCHJrLQ5baFIcrF810GW0DOgogX1wc3N+5Z5+QJD2hzP1zcUx79blQifY+stiOUOfhf+Qxg==","signatures":[{"sig":"MEQCIA3zVd7kIKhnTRHp6XCqytbh3SR4xBjWutMSdd2e0/G0AiAoHkAWsy9X3JFFYNFaOKtVMoV4dOkwua29kHDExJh4JQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":212373},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir ./dist"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"_npmVersion":"11.8.0","description":"Federated user preferences via Dash DB for the Aeon ecosystem.","directories":{},"_nodeVersion":"25.5.0","dependencies":{"zod":"^3.22.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/aeon-preferences_1.0.2_1772755476029_0.7759901325375578","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"5.0.0":{"name":"@affectively/aeon-preferences","version":"5.0.0","_id":"@affectively/aeon-preferences@5.0.0","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"dist":{"shasum":"1e50bf2ebe34a7a5f0d6bbd7d80e30e117d30e3e","tarball":"https://registry.npmjs.org/@affectively/aeon-preferences/-/aeon-preferences-5.0.0.tgz","fileCount":25,"integrity":"sha512-iJpO4Vh1MbYTe7EUYoh8V5lGa1JLxrxJC3bXGc2MYT2aDdCwtpQFHR+h9oW0X4Sc1KsqA7wtolEhaukfrodOXQ==","signatures":[{"sig":"MEYCIQCWrzRFy+vWKF2LYvMiWa97xxeni5ovm/bFfjvizGvw0wIhAJ8LZniBH+CcDfLuAMQzTx6kJTFZ5ktiHZoSdrcyPYNC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":173468},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --external react --external react-dom"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"_npmVersion":"11.8.0","description":"Federated user preferences via Dash DB for the Aeon ecosystem.","directories":{},"_nodeVersion":"25.5.0","dependencies":{"zod":"^3.22.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/react":"^18.0.0"},"peerDependencies":{"react":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/aeon-preferences_5.0.0_1773156117272_0.03303796464173292","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."}},"time":{"created":"2026-03-05T22:50:45.678Z","modified":"2026-03-27T19:58:54.997Z","1.0.0":"2026-03-05T22:50:46.026Z","1.0.1":"2026-03-05T22:51:31.928Z","1.0.2":"2026-03-06T00:04:36.183Z","5.0.0":"2026-03-10T15:21:57.417Z"},"description":"Federated user preferences via Dash DB for the Aeon ecosystem.","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"readme":"# @affectively/aeon-preferences\n\nA unified, federated user preferences store for the entire Aeon ecosystem. Backed by Dash DB (via `dashrelay`), it provides real-time, cross-device sync of user settings, access controls, entitlements, and highly sensitive encrypted custodial wallets.\n\n## Features\n\n- **Federated State:** Powered by Yjs and DashRelay. Update a preference on your phone, and it instantly applies to your desktop shell.\n- **Granular Namespaces:** Strict path-based separation for Apps, Sites, and MCPs (e.g., `namespaces[\"app://remote.fun.language-decoder\"]`). Games and tools can read/write their own isolated settings without polluting global state.\n- **Zero-Knowledge Vault:** A dedicated `vault` namespace designed exclusively for highly sensitive data like Agent Wallets and Custodial Keys. Enforces client-side ZK-encryption before transmission to the relay.\n- **UCAN Authorized:** Built from the ground up to support UCAN capability delegations. You can grant an Agent the `preferences/read` capability, or explicitly restrict a third-party app to `namespace/write:app://my-game`.\n- **Goodchild Flags Integration:** Native support for merging global `aeon-flags` broadcasts with user-overridden feature flags.\n- **React & MCP Ready:** Ships with a `<PreferencesProvider>` for instant React reactivity, and pre-built MCP tools (`get_aeon_preferences`, `update_aeon_preferences`) for immediate Agent integration.\n\n## Installation\n\n```bash\nnpm install @affectively/aeon-preferences\n```\n\n## Schema Overview\n\nThe federated graph is structured using strict Zod validation.\n\n```typescript\nexport const AeonPreferencesSchema = z.object({\n  theme: z.object({ mode: z.string(), cssOverrides: z.string() }),\n  security: z.object({ disabledApps: z.array(z.string()), disabledMcps: z.array(z.string()) }),\n  stargate: z.object({ autoConnect: z.boolean(), defaultRelay: z.string() }),\n  locale: z.object({ timezone: z.string(), language: z.string() }),\n  agent: z.object({ persona: z.string(), pronouns: z.string() }),\n  \n  // Feature Flags\n  flags: z.record(z.boolean()),\n\n  // Granular hierarchical storage for Apps, Sites, and MCPs\n  namespaces: z.record(z.any()),\n\n  // Highly sensitive custodial wallets and keys (Must be ZK-encrypted)\n  vault: z.record(z.string()), \n});\n```\n\n## Usage\n\n### 1. The React Provider\n\nWrap your application to make it reactive to the federated Dash DB.\n\n```tsx\nimport { PreferencesProvider, useAeonPreferences } from '@affectively/aeon-preferences';\n// ... initialization of DashPreferencesStore ...\n\nfunction App() {\n  return (\n    <PreferencesProvider store={myDashStore}>\n      <Dashboard />\n    </PreferencesProvider>\n  );\n}\n\nfunction Dashboard() {\n  const { preferences, updatePreferences } = useAeonPreferences();\n\n  return (\n    <div className={preferences.theme.mode === 'dark' ? 'bg-black' : 'bg-white'}>\n      <button onClick={() => updatePreferences({ theme: { mode: 'dark' } })}>\n        Enable Dark Mode\n      </button>\n    </div>\n  );\n}\n```\n\n### 2. The Federated Store (Dash DB)\n\nInstantiate the store with your DashRelay client and UCAN token.\n\n```typescript\nimport { DashPreferencesStore } from '@affectively/aeon-preferences';\n\nconst store = new DashPreferencesStore({\n  relayClient: dashRelayClient,\n  ucan: { token: 'eyJhbG...' }, // Requires 'preferences/write'\n  zkKeys: { publicKey: '...', privateKey: '...' }, // Required for Vault access\n  graphPath: 'user/preferences'\n});\n```\n\n### 3. Agent Integration (MCP Tools)\n\nProvide your AI Agents with direct access to user preferences.\n\n```typescript\nimport { createPreferencesMcpTools } from '@affectively/aeon-preferences';\n\nconst tools = createPreferencesMcpTools(store);\n// Register these tools with your MCP Server or Kernel\n```\n\n## Security & Scoping\n\n- **Global vs Namespace:** Global preferences (`theme`, `locale`) require `preferences/write` capabilities. Applications should request scoped access like `namespace/write:app://my-game`.\n- **The Vault:** Any interaction with the `vault` requires a distinct `vault/write` or `vault/read` UCAN capability, preventing rogue apps from accessing sensitive key material.\n\n## License\n\nUNLICENSED - Taylor William Buley\n","readmeFilename":"README.md"}