Install
agentlet-core is not yet published to npm. Today, install it by cloning the repository and building it locally.
Clone and build
Section titled “Clone and build”git clone https://github.com/agentlet/agentlet-core.gitcd agentlet-corenpm installnpm run buildThis creates:
dist/agentlet-core.js: development version (IIFE global, also usable viarequire('agentlet-core'))dist/agentlet-core.esm.js: ES module version, used by bundlers thatimportthe packagedist/agentlet-core.min.js: production versiondist/bookmarklet.js: bookmarklet versiondist/bookmarklet.html: installation page
Future: install as a package dependency
Section titled “Future: install as a package dependency”As of version 2.0.0, the package ships the built dist output instead of raw src sources. Once published, install it like any other npm dependency:
npm install agentlet-core// The default export is the class.import AgentletCore from 'agentlet-core';import { Dialog, FormExtractor } from 'agentlet-core';// Exposes the module namespace rather than the class itself, so read the// class off `default`. This matches the browser global, where the class is// `window.AgentletCore.default`.const { default: AgentletCore, Dialog } = require('agentlet-core');Named exports such as Dialog, FormExtractor, and TableExtractor behave identically on both paths.
Consumers will not need their own bundler rule to transpile agentlet-core’s sources (for example a babel-loader rule targeting node_modules/agentlet-core): the package is pre-built, so a bundler only needs to resolve and include it as-is.
The package also ships hand-written TypeScript declarations for window.agentlet, the Module base class, and the core config, usable from both JavaScript and TypeScript agentlets. See TypeScript.
Source: agentlet-core README.md, sections “Getting started” and “Using agentlet-core as a package dependency”.