api or storage; pure transformation belongs to util; reusable domain behavior is addressed through lib.LibraryName.ElementKey.member.
Use lib for new shared-library calls. The older libs alias is deprecated and
is marked accordingly in editor hints. Existing calls and exported type references
remain supported; the alias resolves to the same library members.
Libraries use named exports in JS and TS. The permanent @default element exposes lib.LibraryName.member, with lib.LibraryName['@default'].member as the same binding. Unexported declarations stay local to their element. @default export names cannot match any element key, including exported types. Use named export declarations or local named export clauses; ES default exports, module imports, external re-exports and source CommonJS exports are unsupported.
Context and control
api.getExecutionId() to correlate the current execution with traces, logs, and operations history.
Nested execution
options: { executionHost: 'remote' } when the child must run through the separate Sandbox host.
Calls inherit the caller’s remaining deadline and nesting is limited to five levels. A local child also receives the caller’s cancellation signal. Remote calls require at least one second of remaining time. Use a library when you only need shared business logic within the current execution.
Utilities
api.* aliases.
SHA-1/SHA-256/MD5, HMAC sign/verify, randomBytes, randomInt and timing-safe
comparisons return values synchronously. They do not require await.
String byte limits use UTF-8. Invalid types/options throw
TypeError; size/range
violations throw RangeError. Unsupported extra arguments are rejected for these
bounded helpers. Limits apply to individual calls; they do not guarantee a total
CPU or memory budget for the Component. UUID, JWT and base64 helpers also remain
synchronous.
Asynchronous crypto can reduce time spent blocking request processing; it does not
limit CPU consumption. Key import and data conversion still have a cost,
especially for encrypted private keys or large payloads.
Agents
Theagent namespace exposes Agent, run, inbox, plugin, and Assistant-thread operations to approved runtime code. Exact operations and authorization are shown in the generated editor declarations and Platform API reference.
The technical key @default is available only in JS/TS libraries. Ordinary DEFAULT nodes keep their existing qualified paths and order. TypeScript type names use the short namespace; the bracket alias exposes runtime values. Primitive exports are captured at initialization; expose functions for mutable state.
Every JS/TS library includes a permanent @default, initially a documentation comment only. The API rejects renaming, deleting or replacing it. Node order affects editor sorting; proxy dependency resolution does not require an earlier node. See Libraries for complete authoring and consumption examples.
