@vivantel/virage-agent-core
v0.1.3
Published
Shared base types and abstract class for Virage agent plugins — universal hook event model for Claude Code, GitHub Copilot, OpenAI Codex, and Google Antigravity
Maintainers
Readme
@vivantel/virage-agent-core
Shared base package for Virage agent plugins. Provides TypeScript types and the concrete BaseAgentPlugin class that all agent integrations extend.
What it provides
NormalizedEventName— union type of all 33 vendor-agnostic hook event namesVendorConfig— interface + four constants encoding vendor event mappings,packageName,pluginConfigDir, andprojectConfigDirfor all 4 vendorsBaseAgentPlugin— concrete class withsupportsEvent(),getVendorEventName(),getPrimaryEventName(), and a defaultconfigure()that recursively copies the plugin'splugin-config/directory toprojectConfigDir(content-compared, idempotent). Subclasses overrideconfigure()only for vendor-specific extras (e.g. MCP registration).- Common I/O types —
AgentHookInput,AgentHookOutput,PreToolUseInput/Output,AgentStopInput/Output,UserPromptSubmitInput/Output AgentConfigResult— the return type of every plugin'sconfigure()function
Installation
npm install @vivantel/virage-agent-coreUsage
For a plugin that only needs static files, no configure() override is required:
import {
BaseAgentPlugin,
type VendorConfig,
} from "@vivantel/virage-agent-core";
const MY_VENDOR_CONFIG: VendorConfig = {
vendor: "my-agent",
packageName: "@myorg/virage-agent-my-agent",
pluginConfigDir: "plugin-config",
projectConfigDir: ".my-agent",
// ...event mappings
};
export class MyAgentPlugin extends BaseAgentPlugin {
readonly name = "my-agent";
readonly label = "My Agent";
readonly vendorConfig = MY_VENDOR_CONFIG;
// configure() inherited: copies plugin-config/ → .my-agent/ in target project
}
const plugin = new MyAgentPlugin();
plugin.supportsEvent("pre_tool_use"); // → true
plugin.getPrimaryEventName("agent_stop"); // → "Stop"Supported vendor configs
| Constant | Vendor | Events |
|----------|--------|--------|
| CLAUDE_VENDOR_CONFIG | Claude Code | 30 |
| COPILOT_VENDOR_CONFIG | GitHub Copilot | 12 |
| CODEX_VENDOR_CONFIG | OpenAI Codex | 10 |
| ANTIGRAVITY_VENDOR_CONFIG | Google Antigravity | 5 |
Built-in agent packages
@vivantel/virage-agent-claude— Claude Code (.claude/commands + skills,.mcp.json)@vivantel/virage-agent-copilot— GitHub Copilot (.github/copilot/hooks + instructions)@vivantel/virage-agent-codex— OpenAI Codex (.codex/hooks.json)@vivantel/virage-agent-antigravity— Google Antigravity (.antigravity/hooks.json)
