@easynet/agent-common
v1.0.64
Published
Shared runtime utilities for Easynet agent projects
Readme
@easynet/agent-common
Introduction
@easynet/agent-common is the shared base package for the Easynet agent repos. It owns process-level context, event bus primitives, common config helpers, and a small set of shared subpath APIs used by the other packages.
Exposed Interfaces
| Export | Type | Purpose |
| --- | --- | --- |
| createAgentContext | root | Create an isolated agent context. |
| getDefaultAgentContext | root | Access the process default context. |
| AgentContextTokens | root | Stable tokens shared across repos. |
| createAgentEventBus | root | Create the shared event bus. |
| createConsoleAgentEventListener | root | Console event listener. |
| createProgressAgentEventListener | root | Progress-oriented event listener. |
| @easynet/agent-common/config | subpath | Config and YAML helpers. |
| @easynet/agent-common/cli | subpath | CLI helpers. |
| @easynet/agent-common/connectivity | subpath | Connectivity helpers. |
| @easynet/agent-common/context | subpath | Context APIs. |
| @easynet/agent-common/events | subpath | Event APIs. |
| @easynet/agent-common/npm | subpath | npm helpers. |
| @easynet/agent-common/security-store | subpath | Secret storage helpers. |
| @easynet/agent-common/testing | subpath | Testing helpers. |
| @easynet/agent-common/utils | subpath | Shared utilities. |
Configuration
This repo does not define one fixed YAML schema. It provides shared config helpers used by other repos.
import { loadYamlFile } from "@easynet/agent-common/config";
const config = await loadYamlFile("./config/app.yaml");Usage
npm i @easynet/agent-commonimport {
createAgentContext,
createAgentEventBus,
AgentContextTokens,
} from "@easynet/agent-common";
const ctx = createAgentContext();
const bus = createAgentEventBus();
ctx.set(AgentContextTokens.EventBus, bus);