Registry / communication / intention-storage

intention-storage

JSON →
library0.3.39jsnpmunverified

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.

npm install intention-storage
INSTALL
IMPORT
SIG · INTENTION-STORAGE
I
intention-storage
communicationjavascriptv0.3.39
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IntentionStorage
✓ import { IntentionStorage } from 'intention-storage'
✗ const IntentionStorage = require('intention-storage')
ESM-only: package uses ES modules. Named export.
Intention
✓ import { Intention } from 'intention-storage'
✗ import Intention from 'intention-storage'
Named export, not default. Types included.
createIntention
✓ import { createIntention } from 'intention-storage'
✗ const { createIntention } = require('intention-storage')
ESM-only, named function export.

Shows how to create a storage instance, broadcast an intention, and search for open intentions.

import { IntentionStorage, Intention } from 'intention-storage'; const storage = new IntentionStorage(); const intention: Intention = { id: 'hot-water', description: 'I want hot water', target: 'kettle', status: 'open' }; storage.broadcast(intention).then(() => { console.log('Intention broadcasted'); }).catch(err => { console.error('Failed to broadcast:', err); }); // Search for counter-intentions storage.search({ status: 'open' }).then(results => { console.log('Found intentions:', results); });
Debug
Known issues
gotchaPackage is ESM-only; attempting to require it in CommonJS will throw an error.
fix
Use import syntax and ensure your project is configured for ESM (e.g., type: 'module' in package.json).
affects: >=0.3.0
gotchaBroadcast may fail if network is unavailable or if no other nodes are listening; errors must be handled.
fix
Wrap broadcast calls in try/catch or use .catch() to handle rejection.
affects: >=0.3.0
breakingIn version 0.2.x, the API used callbacks instead of Promises. Promises introduced breaking change.
fix
Update to use async/await or .then() syntax.
affects: >=0.3.0 <0.3.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/node_modules/intention-storage/index.js from /path/app.js not supported.
Package is ESM-only, but you're trying to require it in a CommonJS module.
fix
Convert your project to ESM (add 'type': 'module' in package.json) or use dynamic import: const { IntentionStorage } = await import('intention-storage');
TypeError: (intermediate value).broadcast is not a function
You imported the module incorrectly, e.g., using default import instead of named import.
fix
Use: import { IntentionStorage } from 'intention-storage';
UnhandledPromiseRejectionWarning: Error: Network unreachable
Broadcast failed because no network interface is available or no other nodes are present.
fix
Ensure network connectivity and that other Intention Storage nodes are running on the same network.
Upgrade
Version history
0.3.39latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
intention-storage — npm install intention-storage · libregistry