Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v1.2.0 - Agent Plugin & Agent Experience (AX) ✨

Latest

Choose a tag to compare

@TarekRaafat TarekRaafat released this 08 Feb 12:28
· 3 commits to master since this release

Eleva.js v1.2.0 - Agent Plugin & Agent Experience (AX) ✨

This release introduces the Agent plugin for AI/LLM integration, Store emitter events for cross-plugin observability, and a comprehensive Agent Experience (AX) layer — making Eleva the first lightweight framework with built-in AI agent support.


✨ New: Agent Plugin (~3.5KB gzipped)

A first-class integration surface for LLMs, AI agents, and automation scripts.

Feature Details
Action Registry Register, unregister, execute, and introspect named actions with optional typed schemas
Command Bus Dispatch structured commands ({ type, target?, payload? }) to multiple handlers
Audit Logging Automatic log entries for every action, command, and event — with configurable rotation and filtering
Permissions Per-scope allow-lists for actions and commands; permissive (default) and strict modes
State Inspection inspect(), snapshot(), and diff() for component registry introspection
Reactive Signals agent.actionCount and agent.lastActivity signals for template-driven monitoring
Auto-cleanup Actions and command handlers registered in setup() are automatically cleaned up on unmount

Quick Example

import Eleva from "eleva";
import { Agent } from "eleva/plugins/agent";

const app = new Eleva("MyApp");
app.use(Agent);

app.component("Dashboard", {
  setup({ agent }) {
    agent.register("getStats", async () => {
      return { users: 42, uptime: "99.9%" };
    });

    return { agent };
  },
  template: (ctx) => `
    <p>Actions: ${ctx.agent.actionCount.value}</p>
    <button @click="() => agent.execute('getStats')">Run</button>
  `
});

✨ New: Store Emitter Events

Event When
store:dispatch Before action execution
store:mutate After successful execution
store:error On action failure
store:register Module registered
store:unregister Module removed

All events fire via eleva.emitter, enabling the Agent plugin to capture Store activity natively with emitterEvents: ["store:"].


✨ New: AX Verification System

Component Purpose
bun run verify:ax One-command pipeline: build → test → manifest validation
Docs/Source Parity Test Verifies agent-manifest.json stays in sync with source and types
AX CI Workflow GitHub Actions triggered on PRs when AI-facing files change

✨ New: Golden AI Examples

Example Description
Counter Reactive signal, increment handler, @click binding (~15 lines)
Todo App Signal array, add/remove/toggle, list rendering with key (~40 lines)
Agent Actions Action registry, schema, execute, audit log display (~50 lines)

⚠️ Breaking Changes

Change Migration
CDN Plugin Globals app.use(ElevaAgentPlugin.Agent)app.use(ElevaAgent)
app.use(ElevaRouterPlugin.Router, {...})app.use(ElevaRouter, {...})
app.use(ElevaStorePlugin.Store, {...})app.use(ElevaStore, {...})
app.use(ElevaAttrPlugin.Attr)app.use(ElevaAttr)

Note: ESM, CJS, and CDN bundled (ElevaPlugins.Agent) imports are unchanged. Only individual plugin UMD globals changed.


📦 Build & Packaging

Change Details
Agent Plugin Exports eleva/plugins/agent subpath with ESM, CJS, UMD, and TypeScript declarations
UMD Simplification Individual plugins export direct defaults instead of namespace objects
Validation Scripts validate:publint and validate:types for pre-publish quality gates

📝 Documentation

  • Agent Plugin — Three new pages: Overview, Patterns (15 examples), and API Reference
  • Store Plugin — New "Emitter Events" section in API Reference
  • LLM Docs — Enhanced llms.txt and llms-full.txt with contract metadata, AI recipes, and golden examples
  • CONTRIBUTING.md — New "AI & Agent Experience (AX)" section for contributors

📦 Version Updates

Component Version Change
Eleva (core) 1.2.0 New release
Store Plugin 1.2.0 Added emitter events
Agent Plugin 1.0.0 New plugin
Router Plugin 1.1.1 Unchanged
Attr Plugin 1.1.1 Unchanged

📥 Installation

npm install [email protected]
<!-- CDN -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

<!-- Agent Plugin (individual) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/plugins/agent.umd.min.js"></script>

📚 Documentation


🙏 Thank You

Thank you to everyone using Eleva.js! This release marks a milestone — Eleva is now the first lightweight framework with built-in AI agent support. Your feedback drives these improvements. If you encounter any issues, please open an issue.

See the Full Changelog for complete details.