@agentplugins/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
1
+ /**
2
+ * AgentPlugins Adapter Registry
3
+ *
4
+ * Central registry for all platform adapters.
5
+ * Adapters register themselves; the CLI and build system look them up here.
6
+ */
7
+ const adapterMap = new Map();
8
+ /**
9
+ * Register a platform adapter factory.
10
+ * Called by each adapter package during initialization.
11
+ */
12
+ export function registerAdapter(platform, factory) {
13
+ adapterMap.set(platform, factory);
14
+ }
15
+ /**
16
+ * Check if an adapter is registered for a platform.
17
+ */
18
+ export function hasAdapter(platform) {
19
+ return adapterMap.has(platform);
20
+ }
21
+ /**
22
+ * Load a platform adapter asynchronously.
23
+ */
24
+ export async function loadAdapter(platform) {
25
+ const factory = adapterMap.get(platform);
26
+ if (!factory) {
27
+ throw new Error(`No adapter registered for platform "${platform}". ` +
28
+ `Install the corresponding adapter package: npm install @agentplugins/adapter-${platform}`);
29
+ }
30
+ return factory();
31
+ }
32
+ /**
33
+ * Load all registered adapters.
34
+ */
35
+ export async function loadAllAdapters() {
36
+ const result = new Map();
37
+ for (const [platform, factory] of adapterMap) {
38
+ result.set(platform, await factory());
39
+ }
40
+ return result;
41
+ }
42
+ /**
43
+ * Get list of registered platforms.
44
+ */
45
+ export function getRegisteredPlatforms() {
46
+ return Array.from(adapterMap.keys());
47
+ }
48
+ /**
49
+ * Import and register all built-in adapters.
50
+ * This is a convenience function that auto-registers all official adapters.
51
+ */
52
+ export async function registerBuiltinAdapters() {
53
+ // Dynamic imports to avoid loading adapters that aren't installed
54
+ const builtinAdapters = [
55
+ { platform: 'claude', pkg: '@agentplugins/adapter-claude' },
56
+ { platform: 'codex', pkg: '@agentplugins/adapter-codex' },
57
+ { platform: 'copilot', pkg: '@agentplugins/adapter-copilot' },
58
+ { platform: 'gemini', pkg: '@agentplugins/adapter-gemini' },
59
+ { platform: 'kimi', pkg: '@agentplugins/adapter-kimi' },
60
+ { platform: 'opencode', pkg: '@agentplugins/adapter-opencode' },
61
+ { platform: 'pimono', pkg: '@agentplugins/adapter-pimono' },
62
+ ];
63
+ for (const { platform, pkg } of builtinAdapters) {
64
+ try {
65
+ // Use dynamic import that works in both ESM and bundled contexts
66
+ const mod = await import(/* @vite-ignore */ pkg);
67
+ if (mod.createAdapter) {
68
+ registerAdapter(platform, mod.createAdapter);
69
+ }
70
+ }
71
+ catch {
72
+ // Adapter package not installed — that's fine, skip it
73
+ }
74
+ }
75
+ }
76
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkD,CAAC;AAE7E;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAwB,EACxB,OAAuC;IAEvC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAwB;IACjD,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAwB;IACxD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,uCAAuC,QAAQ,KAAK;YACpD,gFAAgF,QAAQ,EAAE,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAmC,CAAC;IAC1D,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,UAAU,EAAE,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3
+ *
4
+ * The Port: Universal plugin interface abstracting across all AI agent harnesses.
5
+ * Think of this as the "LLVM IR" of AI agent plugins — one unified representation
6
+ * that compiles to any target platform.
7
+ */
8
+ export interface PluginManifest {
9
+ /** Plugin identifier — kebab-case, max 64 chars */
10
+ name: string;
11
+ /** Semantic version */
12
+ version: string;
13
+ /** Short description */
14
+ description: string;
15
+ displayName?: string;
16
+ author?: string | {
17
+ name: string;
18
+ email?: string;
19
+ url?: string;
20
+ };
21
+ homepage?: string;
22
+ repository?: string;
23
+ license?: string;
24
+ keywords?: string[];
25
+ /** Whether plugin is enabled by default (Claude, Kimi) */
26
+ defaultEnabled?: boolean;
27
+ skills?: Skill[];
28
+ hooks?: UniversalHooks;
29
+ mcpServers?: Record<string, MCPServerConfig>;
30
+ tools?: ToolDefinition[];
31
+ userConfig?: Record<string, UserConfigOption>;
32
+ metadata?: Record<string, unknown>;
33
+ settings?: UserConfigOption[];
34
+ /** Target platforms to compile for (if omitted, compiles for all) */
35
+ targets?: TargetPlatform[];
36
+ }
37
+ export type TargetPlatform = 'claude' | 'codex' | 'copilot' | 'gemini' | 'kimi' | 'opencode' | 'pimono';
38
+ export declare const ALL_TARGETS: TargetPlatform[];
39
+ export interface Skill {
40
+ name: string;
41
+ description: string;
42
+ /** Markdown content or path to SKILL.md */
43
+ content?: string;
44
+ /** File path (relative) to SKILL.md */
45
+ filePath?: string;
46
+ }
47
+ export interface MCPServerConfig {
48
+ command: string;
49
+ args?: string[];
50
+ env?: Record<string, string>;
51
+ transport?: 'stdio' | 'http';
52
+ }
53
+ export interface ToolDefinition {
54
+ name: string;
55
+ description: string;
56
+ parameters: ToolParameterSchema;
57
+ handler?: (args: Record<string, unknown>, ctx: ToolContext) => Promise<ToolResult>;
58
+ }
59
+ export interface ToolParameterSchema {
60
+ type: 'object';
61
+ properties: Record<string, ToolParameter>;
62
+ required?: string[];
63
+ }
64
+ export interface ToolParameter {
65
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
66
+ description?: string;
67
+ enum?: string[];
68
+ items?: ToolParameter;
69
+ properties?: Record<string, ToolParameter>;
70
+ required?: string[];
71
+ }
72
+ export interface ToolContext {
73
+ sessionId?: string;
74
+ messageId?: string;
75
+ agent?: string;
76
+ directory?: string;
77
+ worktree?: string;
78
+ }
79
+ export type ToolResult = string | {
80
+ title?: string;
81
+ output: string;
82
+ metadata?: Record<string, unknown>;
83
+ };
84
+ export interface UserConfigOption {
85
+ type: 'string' | 'number' | 'boolean' | 'directory' | 'file';
86
+ title: string;
87
+ description: string;
88
+ /** If true, value is stored in secure storage (keychain) */
89
+ sensitive?: boolean;
90
+ required?: boolean;
91
+ default?: unknown;
92
+ multiple?: boolean;
93
+ }
94
+ /** The maximal common hook subset across all platforms */
95
+ export interface UniversalHooks {
96
+ sessionStart?: HookDefinition;
97
+ sessionEnd?: HookDefinition;
98
+ userPromptSubmit?: HookDefinition;
99
+ userPromptExpansion?: HookDefinition;
100
+ preToolUse?: HookDefinition;
101
+ postToolUse?: HookDefinition;
102
+ postToolUseFailure?: HookDefinition;
103
+ permissionRequest?: HookDefinition;
104
+ permissionDenied?: HookDefinition;
105
+ subagentStart?: HookDefinition;
106
+ subagentStop?: HookDefinition;
107
+ preCompact?: HookDefinition;
108
+ postCompact?: HookDefinition;
109
+ stop?: HookDefinition;
110
+ stopFailure?: HookDefinition;
111
+ notification?: HookDefinition;
112
+ fileChanged?: HookDefinition;
113
+ cwdChanged?: HookDefinition;
114
+ setup?: HookDefinition;
115
+ }
116
+ /** Every universal hook name */
117
+ export type UniversalHookName = keyof UniversalHooks;
118
+ /** All universal hook names as an array */
119
+ export declare const UNIVERSAL_HOOK_NAMES: UniversalHookName[];
120
+ export interface HookDefinition {
121
+ /** Filter to narrow when the hook fires (tool name pattern, etc.) */
122
+ matcher?: string;
123
+ /** The handler implementation */
124
+ handler: HookHandler;
125
+ }
126
+ export type HookHandler = CommandHookHandler | HttpHookHandler | InlineHookHandler;
127
+ export interface CommandHookHandler {
128
+ type: 'command';
129
+ /** Shell command to execute */
130
+ command: string;
131
+ /** Optional status message shown while hook runs */
132
+ statusMessage?: string;
133
+ /** Shell to use */
134
+ shell?: 'bash' | 'powershell' | 'cmd';
135
+ }
136
+ export interface HttpHookHandler {
137
+ type: 'http';
138
+ /** URL to POST hook context to */
139
+ url: string;
140
+ /** Optional headers */
141
+ headers?: Record<string, string>;
142
+ }
143
+ export interface InlineHookHandler {
144
+ type: 'inline';
145
+ /** Inline function — will be wrapped for command-based platforms */
146
+ handler: (ctx: HookContext) => Promise<HookResult>;
147
+ }
148
+ export interface HookContext {
149
+ /** The hook event name */
150
+ event: string;
151
+ /** Current working directory */
152
+ cwd: string;
153
+ /** Session identifier */
154
+ sessionId?: string;
155
+ /** Active model name */
156
+ model?: string;
157
+ /** Permission mode */
158
+ permissionMode?: string;
159
+ /** For tool-related hooks: tool name */
160
+ toolName?: string;
161
+ /** For tool-related hooks: tool arguments */
162
+ toolInput?: unknown;
163
+ /** For prompt-related hooks: the user's prompt */
164
+ userPrompt?: string;
165
+ /** Session source (startup, resume, clear, compact) */
166
+ source?: string;
167
+ /** Path to transcript file */
168
+ transcriptPath?: string | null;
169
+ /** Agent identifier */
170
+ agentId?: string;
171
+ /** Agent type/profile */
172
+ agentType?: string;
173
+ /** Turn identifier */
174
+ turnId?: string;
175
+ }
176
+ export interface HookResult {
177
+ /** If false, stops further processing (blocking hooks) */
178
+ continue?: boolean;
179
+ /** System message surfaced in UI */
180
+ systemMessage?: string;
181
+ /** Additional context injected into session */
182
+ additionalContext?: string;
183
+ /** If true, blocks the operation */
184
+ block?: boolean;
185
+ /** Reason for blocking */
186
+ reason?: string;
187
+ /** Suppress tool output */
188
+ suppressOutput?: boolean;
189
+ }
190
+ export interface PlatformAdapter {
191
+ /** Internal name */
192
+ readonly name: TargetPlatform;
193
+ /** Human-readable name */
194
+ readonly displayName: string;
195
+ /** Which universal hooks this platform supports */
196
+ readonly supportedHooks: readonly UniversalHookName[];
197
+ /** Which handler types this platform supports */
198
+ readonly supportedHandlers: readonly HandlerType[];
199
+ /** Path to manifest file (relative to plugin root) */
200
+ readonly manifestPath: string;
201
+ /** Manifest file format (json, toml, etc.) */
202
+ readonly manifestFormat: 'json' | 'toml';
203
+ /** Validate a plugin for this platform, returning any issues */
204
+ validate(plugin: PluginManifest): ValidationIssue[];
205
+ /** Compile the universal plugin into platform-specific output */
206
+ compile(plugin: PluginManifest): AdapterOutput;
207
+ }
208
+ export type HandlerType = 'command' | 'http' | 'inline' | 'file';
209
+ export declare enum Severity {
210
+ ERROR = "error",
211
+ WARNING = "warning",
212
+ INFO = "info"
213
+ }
214
+ export interface ValidationIssue {
215
+ severity: Severity;
216
+ field?: string;
217
+ message: string;
218
+ suggestion?: string;
219
+ }
220
+ export interface AdapterOutput {
221
+ files: FileOutput[];
222
+ manifest: Record<string, unknown>;
223
+ warnings: string[];
224
+ issues: ValidationIssue[];
225
+ postInstall?: string[];
226
+ }
227
+ export interface FileOutput {
228
+ /** File path relative to plugin root */
229
+ path: string;
230
+ /** File content */
231
+ content: string;
232
+ }
233
+ export interface BuildConfig {
234
+ /** Path to plugin definition file */
235
+ entry: string;
236
+ /** Output directory */
237
+ outDir: string;
238
+ /** Target platforms (defaults to all) */
239
+ targets?: TargetPlatform[];
240
+ /** Whether to fail on warnings */
241
+ strict?: boolean;
242
+ /** Log level */
243
+ logLevel?: 'silent' | 'error' | 'warn' | 'info' | 'debug';
244
+ }
245
+ export type DeepPartial<T> = {
246
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
247
+ };
248
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,WAAW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AC;CAChE,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,45 @@
1
+ /**
2
+ * AgentPlugins Core Types
3
+ *
4
+ * The Port: Universal plugin interface abstracting across all AI agent harnesses.
5
+ * Think of this as the "LLVM IR" of AI agent plugins — one unified representation
6
+ * that compiles to any target platform.
7
+ */
8
+ export const ALL_TARGETS = [
9
+ 'claude',
10
+ 'codex',
11
+ 'copilot',
12
+ 'gemini',
13
+ 'kimi',
14
+ 'opencode',
15
+ 'pimono',
16
+ ];
17
+ /** All universal hook names as an array */
18
+ export const UNIVERSAL_HOOK_NAMES = [
19
+ 'sessionStart',
20
+ 'sessionEnd',
21
+ 'userPromptSubmit',
22
+ 'userPromptExpansion',
23
+ 'preToolUse',
24
+ 'postToolUse',
25
+ 'postToolUseFailure',
26
+ 'permissionRequest',
27
+ 'permissionDenied',
28
+ 'subagentStart',
29
+ 'subagentStop',
30
+ 'preCompact',
31
+ 'postCompact',
32
+ 'stop',
33
+ 'stopFailure',
34
+ 'notification',
35
+ 'fileChanged',
36
+ 'cwdChanged',
37
+ 'setup',
38
+ ];
39
+ export var Severity;
40
+ (function (Severity) {
41
+ Severity["ERROR"] = "error";
42
+ Severity["WARNING"] = "warning";
43
+ Severity["INFO"] = "info";
44
+ })(Severity || (Severity = {}));
45
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8CH,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,QAAQ;IACR,OAAO;IACP,SAAS;IACT,QAAQ;IACR,MAAM;IACN,UAAU;IACV,QAAQ;CACT,CAAC;AAsHF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACvD,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,qBAAqB;IACrB,YAAY;IACZ,aAAa;IACb,oBAAoB;IACpB,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,cAAc;IACd,YAAY;IACZ,aAAa;IACb,MAAM;IACN,aAAa;IACb,cAAc;IACd,aAAa;IACb,YAAY;IACZ,OAAO;CACR,CAAC;AA+GF,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,yBAAa,CAAA;AACf,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * AgentPlugins Validation Layer
3
+ *
4
+ * Catches cross-platform issues before compilation.
5
+ * Provides platform-specific and universal validators.
6
+ */
7
+ import { type PluginManifest, type ValidationIssue, type UniversalHookName, type TargetPlatform } from './types.js';
8
+ export declare function validateUniversal(plugin: PluginManifest): ValidationIssue[];
9
+ export interface PlatformConstraints {
10
+ maxNameLength: number;
11
+ supportsHttpHandler: boolean;
12
+ supportsInlineHandler: boolean;
13
+ supportsPromptHandler: boolean;
14
+ supportsMCPToolHandler: boolean;
15
+ maxDescriptionLength: number;
16
+ supportedHooks: readonly UniversalHookName[];
17
+ manifestPath: string;
18
+ requiresStrictValidation: boolean;
19
+ notes: string[];
20
+ }
21
+ export declare function getPlatformConstraints(platform: TargetPlatform): PlatformConstraints;
22
+ export declare function validateForPlatform(plugin: PluginManifest, platform: TargetPlatform): ValidationIssue[];
23
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAItB,KAAK,cAAc,EAEpB,MAAM,YAAY,CAAC;AAOpB,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,EAAE,CAiI3E;AA4CD,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,mBAAmB,CAsHpF;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,GACvB,eAAe,EAAE,CA0DnB"}