Registry / llm-agents / thingtalk

thingtalk

JSON →
library2.1.1jsnpmunverified

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.

llm-agentsgcpazure
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.

ESM only since v2; no default export

import { compile } from 'thingtalk'

Grammar is a named export, not default

import { Grammar } from 'thingtalk'

Ast is a type; use 'import type' in TypeScript to avoid runtime import

import type { Ast } from 'thingtalk'

Compiles a ThingTalk program that monitors Washington Post articles, translates to Chinese, and posts to Facebook.

import { compile } from 'thingtalk'; const code = ` monitor(@com.washingtonpost.get_article(section=enum world)) => @com.yandex.translate.translate(target_language="zh", text=title) => @com.facebook.post(status=$result); `; try { const compiled = compile(code, { locale: 'en-US', timezone: 'America/Los_Angeles' }); console.log('Compiled program:', JSON.stringify(compiled, null, 2)); } catch (err) { console.error('Compilation failed:', err); }
thingtalk --version
Debug
Known footguns
breakingMinor version bumps can break library APIs. Use tilde version ranges.
gotchaNo default export; all exports are named.
deprecatedThe `translate` function has been deprecated in favor of `compileWithTranslation`.
gotchaThingTalk syntax generated by a newer version may not parse with an older client. Specify library version for compatibility.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
19 hits · last 30 days
gptbot
3
ahrefsbot
3
claudebot
3
amazonbot
2
bingbot
1
bytedance
1
Resources