@elaraai/e3-api-client
v1.0.97
Published
East Execution Engine API Client - TypeScript client library for e3 API server
Readme
@elaraai/e3-api-client
TypeScript client library for e3 API servers.
Installation
npm install @elaraai/e3-api-clientOverview
Stateless functions for interacting with an e3 API server. Uses BEAST2 binary serialization for efficient request/response encoding.
API
Repository
import { repoStatus, repoGc } from '@elaraai/e3-api-client';
const status = await repoStatus('http://localhost:3000');
// { path: '/path/to/repo', objectCount: 42n, packageCount: 3n, workspaceCount: 2n }
// Keep each workspace's last 5 runs and 30 days of history; the server's
// defaults when `none`
const gcResult = await repoGc(url, { dryRun: true, minAge: none, keepRuns: some(5n), keepDays: some(30n) });
// { deletedRuns: 2n, deletedExecutions: 14n, deletedObjects: 0n, retainedObjects: 42n, bytesFreed: 0n, ... }Packages
import { packageList, packageImport, packageGet, packageExport, packageRemove } from '@elaraai/e3-api-client';
// List all packages
const packages = await packageList(url);
// [{ name: 'my-pkg', version: '1.0.0' }, ...]
// Import a package from zip bytes
const result = await packageImport(url, zipBytes);
// { name: 'my-pkg', version: '1.0.0', packageHash: 'abc123...', objectCount: 5n }
// Get package object
const pkg = await packageGet(url, 'my-pkg', '1.0.0');
// Export package as zip
const zip = await packageExport(url, 'my-pkg', '1.0.0');
// Remove package
await packageRemove(url, 'my-pkg', '1.0.0');Workspaces
import { workspaceList, workspaceCreate, workspaceGet, workspaceStatus, workspaceDeploy, workspaceRemove } from '@elaraai/e3-api-client';
// Create workspace
const info = await workspaceCreate(url, 'production');
// { name: 'production', deployed: false, packageName: null, packageVersion: null }
// Deploy package to workspace: the server runs the deploy as a job, which
// this polls, and answers what it decided for each record and index
const deployed = await workspaceDeploy(url, 'production', '[email protected]');
// { records: [{ record: 'records/plans', action: <mint | keep | migrate | reset | drop | refused> }], indexes: [...], warnings: [] }
// Get workspace status
const status = await workspaceStatus(url, 'production');
// { workspace: 'production', datasets: [...], tasks: [...], summary: { ... } }
// List workspaces
const workspaces = await workspaceList(url);A view that follows a few datasets asks for those alone:
workspaceStatus(url, repo, ws, options, { paths }) answers the datasets
named that the workspace has, and the tasks producing them, each as the whole
status gives it. It costs the server what the view binds, not the workspace.
A poll asks conditionally: workspaceStatusSince(url, repo, ws, etag, options,
query) answers the status with its ETag, and null while the status
answered under the tag it was given is current, which costs the server a read
of the workspace's revision and nothing else. The tag does not name the
runner's view of an execution recorded running, so a poll that must notice a
runner gone asks unconditionally (etag null) now and then. A poll gains
nothing from retrying a transient failure, since its next poll is its retry:
pollRequestOptions(options) gives it one attempt (NO_RETRY) unless the
caller set a policy of its own.
Datasets
import { datasetList, datasetListAt, datasetGet, datasetSet } from '@elaraai/e3-api-client';
import { encodeBeast2For, decodeBeast2For, StringType, variant } from '@elaraai/east';
// List root fields
const fields = await datasetList(url, 'production');
// ['inputs', 'tasks']
// List nested fields
const inputFields = await datasetListAt(url, 'production', [variant('field', 'inputs')]);
// ['config', 'data']
// Get dataset value (raw BEAST2 bytes)
const path = [variant('field', 'inputs'), variant('field', 'config')];
const bytes = await datasetGet(url, 'production', path);
const value = decodeBeast2For(StringType)(bytes);
// Set dataset value
const encoded = encodeBeast2For(StringType)('new value');
await datasetSet(url, 'production', path, encoded);datasetGet downloads a collection as the segment objects its manifest names,
a few at a time, checks each against its hash, and splices them into the value's
bytes, so no response carries more than one segment and a server whose host
caps its responses still serves a collection of any size.
A dataset that moves while it is read (a run writes a new value, and the old
one's objects can no longer be fetched) is read again. datasetGet starts over
from the new content, at most 3 times, and returns its hash.
datasetGetStream starts over only before it returns. Once it has returned a
hash, its chunks end in a DatasetHashMismatchError naming the content the
dataset holds now (currentHash), and the caller starts over. A manifest above
level 0, which only a newer e3 writes, is refused, naming the update to make.
A value named by its hash rather than by a dataset, such as a record's state at
a past commit, is read through the objects route the same way:
collectionGetStream streams a collection by its manifest's hash, and
objectGet reads any other value, which is one object. The caller picks by
the value's type. A client of a host's own routes reads a page with
parsePage, as datasetGetPage reads its own, and a JSON refusal with
parseErrorBody, so it throws the ApiError codes the rest of the client does.
Tasks
import { taskList, taskGet } from '@elaraai/e3-api-client';
// List tasks
const tasks = await taskList(url, 'production');
// [{ name: 'compute', hash: 'abc123...', role: <data | ui> }, ...]
// Get task details
const task = await taskGet(url, 'production', 'compute');
// { name: 'compute', hash: '...', body: <east program | command>, runner: <runtime>,
// inputs: [{ path, partition }], output: { path, kind }, role: <data | ui> }Execution
import { dataflowExecuteLaunch, dataflowExecute, dataflowGraph, taskLogs } from '@elaraai/e3-api-client';
// Start execution (non-blocking), re-running every task even where cached
await dataflowExecuteLaunch(url, 'production', { force: true });
// Execute and wait for result (blocking), re-running only the tasks named;
// a filter is one task's exact name, run with the tasks it depends on
const result = await dataflowExecute(url, 'production', { force: ['import_sales'] });
// { success: true, executed: 1n, cached: 0n, failed: 0n, tasks: [...], duration: 1.234 }
// Get dependency graph
const graph = await dataflowGraph(url, 'production');
// { tasks: [{ name: 'compute', inputs: [...], output: '...', dependsOn: [...] }] }
// Read task logs
const logs = await taskLogs(url, 'production', 'compute', { stream: 'stdout' });
// { data: '...', offset: 0n, size: 1024n, totalSize: 2048n, complete: false }Claude Code plugin
The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:
# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraaiLicense
BSL 1.1. See LICENSE.md.
Ecosystem
East: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.
- @elaraai/east: Core language SDK with type system, expressions, and reference JS compiler
East Node: Node.js platform functions for I/O, databases, and system operations.
- @elaraai/east-node-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
- @elaraai/east-node-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
- @elaraai/east-node-cli: CLI for running East IR programs in Node.js
East C: C11 native runtime for executing East IR. Distributed via npm (launcher + per-platform optional dependencies) and as tarballs on each GitHub Release.
- @elaraai/east-c-cli: npm launcher — installs the matching native binary as an optional dependency
east-c: Core runtime — type system, IR interpreter, builtins, serialization (Beast2, JSON, CSV, East text)east-c-std: Console, FileSystem, Fetch, Crypto, Time, Path, Randomeast-c-cli: CLI for running East IR programs natively
East Python: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.
- east-py: Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
- east-py-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
- east-py-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
- east-py-cli: CLI for running East IR programs in Python
- east-py-datascience (PyPI) + @elaraai/east-py-datascience (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
East UI: Typed UI component definitions and React renderer, plus VS Code preview.
- @elaraai/east-ui: 50+ typed UI components for layouts, forms, charts, tables, dialogs
- @elaraai/east-ui-components: React renderer with Chakra UI v3 styling
- @elaraai/e3-ui: e3 + UI bridge — Data bindings,
e3.ui()task, manifest - @elaraai/e3-ui-components: React Query hooks and preview components for the e3 API
- east-ui-preview: VS Code extension for live East UI component preview
e3 — East Execution Engine: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.
- @elaraai/e3: SDK for authoring e3 packages with typed tasks and pipelines
- @elaraai/e3-core: Object store, dataflow orchestrator, execution state
- @elaraai/e3-types: Shared type definitions for e3 packages
- @elaraai/e3-cli:
e3 repo,e3 package,e3 workspace,e3 dataflow run,e3 watch,e3 task logscommands - @elaraai/e3-api-client: HTTP client for remote e3 repositories
- @elaraai/e3-api-server: REST API server for e3 repositories
- @elaraai/e3-api-tests: Shared API compliance test suites
Links
About Elara
East is developed by Elara AI Pty Ltd, an AI-powered platform that creates economic digital twins of businesses that optimize performance. Elara combines business objectives, decisions and data to help organizations make data-driven decisions across operations, purchasing, sales and customer engagement, and project and investment planning. East powers the computational layer of Elara solutions, enabling the expression of complex business logic and data in a simple, type-safe and portable language.
Developed by Elara AI Pty Ltd.
Developed by Elara AI Pty Ltd
