{"id":48183,"library":"intention-storage","title":"Intention Storage","description":"Intention Storage is a core package for the Intention Network, enabling devices to become members of such networks. It includes code to accept, search for counter intentions, and broadcast intentions to other storage. Version 0.3.39 is the latest stable release, with an unknown release cadence (likely infrequent). Key differentiators: it provides a decentralized communication mechanism for IoT devices to coordinate complex tasks without cloud dependency, supporting fail-safe chains and automatic exception resolution. Unlike traditional smart home systems, it focuses on intention-based communication rather than direct commands.","status":"active","version":"0.3.39","language":"javascript","source_language":"en","source_url":"https://github.com/MillerRabin/intention-storage","tags":["javascript"],"install":[{"cmd":"npm install intention-storage","lang":"bash","label":"npm"},{"cmd":"yarn add intention-storage","lang":"bash","label":"yarn"},{"cmd":"pnpm add intention-storage","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only: package uses ES modules. Named export.","wrong":"const IntentionStorage = require('intention-storage')","symbol":"IntentionStorage","correct":"import { IntentionStorage } from 'intention-storage'"},{"note":"Named export, not default. Types included.","wrong":"import Intention from 'intention-storage'","symbol":"Intention","correct":"import { Intention } from 'intention-storage'"},{"note":"ESM-only, named function export.","wrong":"const { createIntention } = require('intention-storage')","symbol":"createIntention","correct":"import { createIntention } from 'intention-storage'"}],"quickstart":{"code":"import { IntentionStorage, Intention } from 'intention-storage';\n\nconst storage = new IntentionStorage();\n\nconst intention: Intention = {\n  id: 'hot-water',\n  description: 'I want hot water',\n  target: 'kettle',\n  status: 'open'\n};\n\nstorage.broadcast(intention).then(() => {\n  console.log('Intention broadcasted');\n}).catch(err => {\n  console.error('Failed to broadcast:', err);\n});\n\n// Search for counter-intentions\nstorage.search({ status: 'open' }).then(results => {\n  console.log('Found intentions:', results);\n});","lang":"typescript","description":"Shows how to create a storage instance, broadcast an intention, and search for open intentions."},"warnings":[{"fix":"Use import syntax and ensure your project is configured for ESM (e.g., type: 'module' in package.json).","message":"Package is ESM-only; attempting to require it in CommonJS will throw an error.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Wrap broadcast calls in try/catch or use .catch() to handle rejection.","message":"Broadcast may fail if network is unavailable or if no other nodes are listening; errors must be handled.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Update to use async/await or .then() syntax.","message":"In version 0.2.x, the API used callbacks instead of Promises. Promises introduced breaking change.","severity":"breaking","affected_versions":">=0.3.0 <0.3.0"}],"env_vars":null,"search_vec":"'0.3.39':37 'accept':25 'automat':74 'base':87 'becom':16 'broadcast':31 'cadenc':47 'chain':72 'cloud':66 'code':23 'command':92 'communic':56,88 'complex':63 'coordin':62 'core':7 'counter':28 'decentr':55 'depend':67 'devic':14,60 'differenti':51 'direct':91 'enabl':13 'except':75 'fail':70 'fail-saf':69 'focus':83 'home':80 'includ':22 'infrequ':49 'intent':1,3,11,29,32,86 'intention-bas':85 'iot':59 'javascript':93 'key':50 'latest':40 'like':48 'mechan':57 'member':17 'network':12,20 'packag':8 'provid':53 'rather':89 'releas':42,46 'resolut':76 'safe':71 'search':26 'smart':79 'stabl':41 'storag':2,4,35 'support':68 'system':81 'task':64 'tradit':78 'unknown':45 'unlik':77 'version':36 'without':65","created_at":"2026-06-07T16:55:19.796682+00:00","updated_at":"2026-06-07T16:55:19.796682+00:00","problems":[{"fix":"Convert your project to ESM (add 'type': 'module' in package.json) or use dynamic import: const { IntentionStorage } = await import('intention-storage');","cause":"Package is ESM-only, but you're trying to require it in a CommonJS module.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/node_modules/intention-storage/index.js from /path/app.js not supported."},{"fix":"Use: import { IntentionStorage } from 'intention-storage';","cause":"You imported the module incorrectly, e.g., using default import instead of named import.","error":"TypeError: (intermediate value).broadcast is not a function"},{"fix":"Ensure network connectivity and that other Intention Storage nodes are running on the same network.","cause":"Broadcast failed because no network interface is available or no other nodes are present.","error":"UnhandledPromiseRejectionWarning: Error: Network unreachable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/MillerRabin/intention-storage","github":"https://github.com/MillerRabin/intention-storage","docs":null,"changelog":null,"pypi":null,"npm":"intention-storage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}