ThingTalk is a declarative, rule-based distributed programming language for virtual assistants, developed by Stanford Open Virtual Assistant Lab. This package (v2.1.1, not semver: minor bumps can break library APIs) provides the grammar, just-in-time compiler, interface for SMT-based program analysis, natural language translation, and runtime libraries. It connects web services and IoT devices via 'when-get-do' statements, leveraging Thingpedia API primitives. Differentiators: unique focus on virtual assistants, crowdsourced API repository, and non-semver versioning where minor versions may introduce breaking API changes. Release cadence: irregular, with major version bumps for language incompatibility, minor for library changes, patch for bug fixes.
npm install thingtalkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles a ThingTalk program that monitors Washington Post articles, translates to Chinese, and posts to Facebook.
Specify dependency as "thingtalk": "~2.1.0" in package.json to allow only patch updates.
Use named imports like `import { compile } from 'thingtalk'` instead of `import compile from 'thingtalk'`.Use `compileWithTranslation` instead.
Pass `{ libraryVersion: '2.1.0' }` in options when compiling for older clients.Ensure each statement ends with a semicolon and uses correct triple arrow syntax: `=> @service.function(params)`. Refer to ThingTalk language specification.
Run `npm install thingtalk` and use `import { compile } from 'thingtalk'` (ESM) or ensure your bundler supports ESM. For CommonJS, use dynamic import: `const { compile } = await import('thingtalk')`.Replace `import compile from 'thingtalk'` with `import { compile } from 'thingtalk'`.Pass `{ libraryVersion: '2.1.0' }` in the compile options to output syntax compatible with the older client.