Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AIPexStudio AIPex SkillExecutor

From Leeroopedia
Knowledge Sources
Domains Code_Sandboxing, Skill_Management
Last Updated 2026-10-24 12:00 GMT

Overview

Concrete executor that runs skill scripts in a QuickJS VM sandbox, manages tool registration from skills, and provides tool invocation for the agent.

Description

The SkillExecutor class manages the execution of skill scripts in the QuickJS sandbox. On initialization it sets up ZenFS, QuickJS runtime, and runs storage migration. The `executeScript` method reads script content from ZenFS, creates a `SkillAPIBridge` for the skill, and executes in the VM via `quickjs.execute()`. The `getRegisteredTools` method returns tools registered by skills via the `registerTool()` API bridge function. The `executeTool` method invokes a registered tool's handler. All execution goes through the QuickJS VM with ZenFS-backed file access and SSRF-guarded fetch.

Usage

  • Execute a skill script: `await skillExecutor.executeScript("my-skill", "scripts/main.js", { args })`
  • Get skill-registered tools: `const tools = skillExecutor.getRegisteredTools()`
  • Invoke a skill tool: `await skillExecutor.executeTool("custom_tool", { param: "value" })`

Code Reference

Source Location

  • Repository: AIPex
  • File: packages/browser-runtime/src/skill/lib/services/skill-executor.ts
  • Lines: L13-209 (class), L214 (singleton)

Signature

export class SkillExecutor {
  async initialize(): Promise<void>
  async executeScript(skillName: string, scriptPath: string, args?: any): Promise<any>
  getRegisteredTools(): ToolDefinition[]
  getTool(name: string): ToolDefinition | undefined
  async executeTool(name: string, args: any): Promise<any>
  async destroy(): Promise<void>
}

interface ToolDefinition {
  name: string;
  description: string;
  inputSchema: any;
  handler: (args: any) => Promise<any>;
}

// Singleton: export const skillExecutor = new SkillExecutor();

Import

import { skillExecutor } from "@aipexstudio/browser-runtime";

I/O Contract

Inputs

Name Type Required Description
skillName string Yes Skill name to execute script from
scriptPath string Yes Path to script within skill (e.g., "scripts/main.js")
args any No Arguments passed to skill's main() function
name string Yes (executeTool) Registered tool name

Outputs

Name Type Description
returns any Return value from skill's main() or module.exports
getRegisteredTools ToolDefinition[] Tools registered by all skills

Usage Examples

Execute a Skill Script

import { skillExecutor } from "@aipexstudio/browser-runtime";

await skillExecutor.initialize();

const result = await skillExecutor.executeScript(
  "skill-creator-browser",
  "scripts/init_skill.js",
  { name: "my-new-skill", description: "A custom skill" }
);
console.log("Script result:", result);

Use Skill-Registered Tools

const tools = skillExecutor.getRegisteredTools();
console.log(`${tools.length} skill tools available`);

// Invoke a skill-defined tool
const result = await skillExecutor.executeTool("custom_search", {
  query: "test",
});

Related Pages

Implements Principle

Uses Heuristics

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment