@easbot/plugin 0.3.32 → 0.3.37
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.
- package/README.en.md +128 -60
- package/README.md +116 -47
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +193 -205
- package/dist/index.d.ts +193 -205
- package/dist/index.mjs +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -206,6 +206,12 @@ declare const HookMatcherSchema: z$1.ZodObject<{
|
|
|
206
206
|
type: z$1.ZodLiteral<"function">;
|
|
207
207
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
208
208
|
}, z$1.core.$strip>], "type">>;
|
|
209
|
+
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
210
|
+
timeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
211
|
+
failurePolicy: z$1.ZodOptional<z$1.ZodEnum<{
|
|
212
|
+
"fail-open": "fail-open";
|
|
213
|
+
"fail-closed": "fail-closed";
|
|
214
|
+
}>>;
|
|
209
215
|
}, z$1.core.$strip>;
|
|
210
216
|
type HookMatcher = z$1.infer<typeof HookMatcherSchema>;
|
|
211
217
|
declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodObject<{
|
|
@@ -268,6 +274,12 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
268
274
|
type: z$1.ZodLiteral<"function">;
|
|
269
275
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
270
276
|
}, z$1.core.$strip>], "type">>;
|
|
277
|
+
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
278
|
+
timeoutMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
279
|
+
failurePolicy: z$1.ZodOptional<z$1.ZodEnum<{
|
|
280
|
+
"fail-open": "fail-open";
|
|
281
|
+
"fail-closed": "fail-closed";
|
|
282
|
+
}>>;
|
|
271
283
|
}, z$1.core.$strip>>>;
|
|
272
284
|
type HooksConfig = z$1.infer<typeof HooksConfigSchema>;
|
|
273
285
|
declare const SessionIDSchema: z$1.ZodString;
|
|
@@ -1961,11 +1973,6 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1961
1973
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1962
1974
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1963
1975
|
cwd: z$1.ZodOptional<z$1.ZodString>;
|
|
1964
|
-
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1965
|
-
gatewayID: z$1.ZodString;
|
|
1966
|
-
messageId: z$1.ZodString;
|
|
1967
|
-
message: z$1.ZodUnknown;
|
|
1968
|
-
target: z$1.ZodOptional<z$1.ZodString>;
|
|
1969
1976
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1970
1977
|
sessionId: z$1.ZodString;
|
|
1971
1978
|
reason: z$1.ZodEnum<{
|
|
@@ -1977,11 +1984,6 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1977
1984
|
cancelled: "cancelled";
|
|
1978
1985
|
}>;
|
|
1979
1986
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1980
|
-
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1981
|
-
sessionId: z$1.ZodString;
|
|
1982
|
-
summary: z$1.ZodString;
|
|
1983
|
-
previousLength: z$1.ZodNumber;
|
|
1984
|
-
newLength: z$1.ZodNumber;
|
|
1985
1987
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1986
1988
|
sessionId: z$1.ZodString;
|
|
1987
1989
|
trigger: z$1.ZodEnum<{
|
|
@@ -1991,6 +1993,11 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1991
1993
|
}>;
|
|
1992
1994
|
contextLength: z$1.ZodNumber;
|
|
1993
1995
|
threshold: z$1.ZodNumber;
|
|
1996
|
+
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1997
|
+
sessionId: z$1.ZodString;
|
|
1998
|
+
summary: z$1.ZodString;
|
|
1999
|
+
previousLength: z$1.ZodNumber;
|
|
2000
|
+
newLength: z$1.ZodNumber;
|
|
1994
2001
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1995
2002
|
sessionId: z$1.ZodString;
|
|
1996
2003
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -2180,6 +2187,50 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
2180
2187
|
cwd: z$1.ZodOptional<z$1.ZodString>;
|
|
2181
2188
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2182
2189
|
callId: z$1.ZodOptional<z$1.ZodString>;
|
|
2190
|
+
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2191
|
+
sessionId: z$1.ZodString;
|
|
2192
|
+
mode: z$1.ZodEnum<{
|
|
2193
|
+
agent: "agent";
|
|
2194
|
+
chat: "chat";
|
|
2195
|
+
query: "query";
|
|
2196
|
+
}>;
|
|
2197
|
+
providerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2198
|
+
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2199
|
+
sessionId: z$1.ZodString;
|
|
2200
|
+
context: z$1.ZodObject<{
|
|
2201
|
+
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
2202
|
+
id: z$1.ZodString;
|
|
2203
|
+
role: z$1.ZodEnum<{
|
|
2204
|
+
system: "system";
|
|
2205
|
+
user: "user";
|
|
2206
|
+
assistant: "assistant";
|
|
2207
|
+
tool: "tool";
|
|
2208
|
+
}>;
|
|
2209
|
+
content: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
2210
|
+
type: z$1.ZodLiteral<"text">;
|
|
2211
|
+
text: z$1.ZodString;
|
|
2212
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2213
|
+
type: z$1.ZodLiteral<"image">;
|
|
2214
|
+
source: z$1.ZodObject<{
|
|
2215
|
+
type: z$1.ZodEnum<{
|
|
2216
|
+
url: "url";
|
|
2217
|
+
base64: "base64";
|
|
2218
|
+
}>;
|
|
2219
|
+
mime: z$1.ZodOptional<z$1.ZodString>;
|
|
2220
|
+
data: z$1.ZodString;
|
|
2221
|
+
}, z$1.core.$strip>;
|
|
2222
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2223
|
+
type: z$1.ZodLiteral<"file">;
|
|
2224
|
+
url: z$1.ZodString;
|
|
2225
|
+
filename: z$1.ZodString;
|
|
2226
|
+
mime: z$1.ZodOptional<z$1.ZodString>;
|
|
2227
|
+
}, z$1.core.$strip>], "type">>]>;
|
|
2228
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
2229
|
+
tool_call_id: z$1.ZodOptional<z$1.ZodString>;
|
|
2230
|
+
}, z$1.core.$strip>>;
|
|
2231
|
+
system: z$1.ZodArray<z$1.ZodString>;
|
|
2232
|
+
metadata: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
2233
|
+
}, z$1.core.$strip>;
|
|
2183
2234
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2184
2235
|
gatewayID: z$1.ZodString;
|
|
2185
2236
|
messageId: z$1.ZodString;
|
|
@@ -2193,6 +2244,29 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
2193
2244
|
gatewayID: z$1.ZodString;
|
|
2194
2245
|
messageId: z$1.ZodString;
|
|
2195
2246
|
result: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
2247
|
+
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2248
|
+
gatewayID: z$1.ZodString;
|
|
2249
|
+
messageId: z$1.ZodString;
|
|
2250
|
+
message: z$1.ZodUnknown;
|
|
2251
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
2252
|
+
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2253
|
+
gatewayID: z$1.ZodString;
|
|
2254
|
+
messageId: z$1.ZodString;
|
|
2255
|
+
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2256
|
+
channel: z$1.ZodObject<{
|
|
2257
|
+
platform: z$1.ZodString;
|
|
2258
|
+
channelId: z$1.ZodString;
|
|
2259
|
+
}, z$1.core.$strip>;
|
|
2260
|
+
timestamp: z$1.ZodNumber;
|
|
2261
|
+
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2262
|
+
gatewayID: z$1.ZodString;
|
|
2263
|
+
messageId: z$1.ZodString;
|
|
2264
|
+
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2265
|
+
channel: z$1.ZodObject<{
|
|
2266
|
+
platform: z$1.ZodString;
|
|
2267
|
+
channelId: z$1.ZodString;
|
|
2268
|
+
}, z$1.core.$strip>;
|
|
2269
|
+
timestamp: z$1.ZodNumber;
|
|
2196
2270
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2197
2271
|
taskId: z$1.ZodString;
|
|
2198
2272
|
timestamp: z$1.ZodNumber;
|
|
@@ -2246,68 +2320,6 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
2246
2320
|
success: z$1.ZodBoolean;
|
|
2247
2321
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2248
2322
|
error: z$1.ZodOptional<z$1.ZodString>;
|
|
2249
|
-
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2250
|
-
sessionId: z$1.ZodString;
|
|
2251
|
-
mode: z$1.ZodEnum<{
|
|
2252
|
-
agent: "agent";
|
|
2253
|
-
chat: "chat";
|
|
2254
|
-
query: "query";
|
|
2255
|
-
}>;
|
|
2256
|
-
providerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2257
|
-
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2258
|
-
sessionId: z$1.ZodString;
|
|
2259
|
-
context: z$1.ZodObject<{
|
|
2260
|
-
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
2261
|
-
id: z$1.ZodString;
|
|
2262
|
-
role: z$1.ZodEnum<{
|
|
2263
|
-
system: "system";
|
|
2264
|
-
user: "user";
|
|
2265
|
-
assistant: "assistant";
|
|
2266
|
-
tool: "tool";
|
|
2267
|
-
}>;
|
|
2268
|
-
content: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
2269
|
-
type: z$1.ZodLiteral<"text">;
|
|
2270
|
-
text: z$1.ZodString;
|
|
2271
|
-
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2272
|
-
type: z$1.ZodLiteral<"image">;
|
|
2273
|
-
source: z$1.ZodObject<{
|
|
2274
|
-
type: z$1.ZodEnum<{
|
|
2275
|
-
url: "url";
|
|
2276
|
-
base64: "base64";
|
|
2277
|
-
}>;
|
|
2278
|
-
mime: z$1.ZodOptional<z$1.ZodString>;
|
|
2279
|
-
data: z$1.ZodString;
|
|
2280
|
-
}, z$1.core.$strip>;
|
|
2281
|
-
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2282
|
-
type: z$1.ZodLiteral<"file">;
|
|
2283
|
-
url: z$1.ZodString;
|
|
2284
|
-
filename: z$1.ZodString;
|
|
2285
|
-
mime: z$1.ZodOptional<z$1.ZodString>;
|
|
2286
|
-
}, z$1.core.$strip>], "type">>]>;
|
|
2287
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
2288
|
-
tool_call_id: z$1.ZodOptional<z$1.ZodString>;
|
|
2289
|
-
}, z$1.core.$strip>>;
|
|
2290
|
-
system: z$1.ZodArray<z$1.ZodString>;
|
|
2291
|
-
metadata: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
2292
|
-
}, z$1.core.$strip>;
|
|
2293
|
-
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2294
|
-
gatewayID: z$1.ZodString;
|
|
2295
|
-
messageId: z$1.ZodString;
|
|
2296
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2297
|
-
channel: z$1.ZodObject<{
|
|
2298
|
-
platform: z$1.ZodString;
|
|
2299
|
-
channelId: z$1.ZodString;
|
|
2300
|
-
}, z$1.core.$strip>;
|
|
2301
|
-
timestamp: z$1.ZodNumber;
|
|
2302
|
-
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2303
|
-
gatewayID: z$1.ZodString;
|
|
2304
|
-
messageId: z$1.ZodString;
|
|
2305
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2306
|
-
channel: z$1.ZodObject<{
|
|
2307
|
-
platform: z$1.ZodString;
|
|
2308
|
-
channelId: z$1.ZodString;
|
|
2309
|
-
}, z$1.core.$strip>;
|
|
2310
|
-
timestamp: z$1.ZodNumber;
|
|
2311
2323
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
2312
2324
|
taskId: z$1.ZodString;
|
|
2313
2325
|
taskName: z$1.ZodString;
|
|
@@ -2868,29 +2880,54 @@ interface SkillDefinition extends SkillMetadata {
|
|
|
2868
2880
|
init?: (context?: SkillInitContext) => Promise<SkillInitResult>;
|
|
2869
2881
|
}
|
|
2870
2882
|
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
type
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2883
|
+
declare const PLUGIN_ID_PATTERN: RegExp;
|
|
2884
|
+
declare const PLUGIN_VERSION_PATTERN: RegExp;
|
|
2885
|
+
declare const PLUGIN_CAPABILITIES: readonly ["hooks", "commands", "tools", "agents", "skills", "auth", "event", "config"];
|
|
2886
|
+
type PluginCapability = (typeof PLUGIN_CAPABILITIES)[number];
|
|
2887
|
+
declare const PLUGIN_DEFINITION_KEYS: readonly ["hooks", "commands", "tools", "agents", "skills", "auth", "event", "config"];
|
|
2888
|
+
declare const PLUGIN_HOOK_FAILURE_POLICIES: readonly ["fail-open", "fail-closed"];
|
|
2889
|
+
type PluginHookFailurePolicy = (typeof PLUGIN_HOOK_FAILURE_POLICIES)[number];
|
|
2890
|
+
declare const PLUGIN_ENTRY_EXTENSIONS: readonly [".mjs", ".js", ".cjs"];
|
|
2891
|
+
declare const PLUGIN_ENTRY_NAMES: readonly ["default", "Plugin", "plugin"];
|
|
2892
|
+
declare const PLUGIN_HOOK_EXECUTOR_TYPES: readonly ["command", "prompt", "http", "agent", "function"];
|
|
2893
|
+
declare function isValidPluginId(id: unknown): id is string;
|
|
2894
|
+
declare function isValidPluginEntry(entry: unknown): entry is string;
|
|
2895
|
+
declare const PluginManifestSchema: z.ZodObject<{
|
|
2896
|
+
name: z.ZodString;
|
|
2897
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2898
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2899
|
+
entry: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
|
|
2900
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2901
|
+
event: "event";
|
|
2902
|
+
hooks: "hooks";
|
|
2903
|
+
config: "config";
|
|
2904
|
+
tools: "tools";
|
|
2905
|
+
commands: "commands";
|
|
2906
|
+
agents: "agents";
|
|
2907
|
+
skills: "skills";
|
|
2908
|
+
auth: "auth";
|
|
2909
|
+
}>>>;
|
|
2910
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2911
|
+
}, z.core.$strip>;
|
|
2912
|
+
type PluginManifest = z.infer<typeof PluginManifestSchema>;
|
|
2913
|
+
type ManifestValidationResult = {
|
|
2914
|
+
ok: true;
|
|
2915
|
+
manifest: PluginManifest;
|
|
2916
|
+
} | {
|
|
2917
|
+
ok: false;
|
|
2918
|
+
errors: string[];
|
|
2919
|
+
};
|
|
2920
|
+
declare function validatePluginManifest(input: unknown): ManifestValidationResult;
|
|
2921
|
+
type DefinitionValidationResult = {
|
|
2922
|
+
ok: true;
|
|
2923
|
+
} | {
|
|
2924
|
+
ok: false;
|
|
2925
|
+
reason: string;
|
|
2926
|
+
};
|
|
2927
|
+
interface DefinitionValidationOptions {
|
|
2928
|
+
capabilities?: readonly PluginCapability[];
|
|
2888
2929
|
}
|
|
2889
|
-
declare function
|
|
2890
|
-
declare function unregisterMarketplace(id: string): boolean;
|
|
2891
|
-
declare function listMarketplaces(): MarketplaceDefinition[];
|
|
2892
|
-
declare function findMarketplace(id: string): MarketplaceDefinition | null;
|
|
2893
|
-
declare function findMarketplacesByCategory(category: MarketplaceCategory): MarketplaceDefinition[];
|
|
2930
|
+
declare function validatePluginDefinition(def: unknown, options?: DefinitionValidationOptions): DefinitionValidationResult;
|
|
2894
2931
|
|
|
2895
2932
|
type PluginInput = {
|
|
2896
2933
|
client: ReturnType<typeof createEasbotClient>;
|
|
@@ -2901,135 +2938,86 @@ type PluginInput = {
|
|
|
2901
2938
|
$: EasbotShell;
|
|
2902
2939
|
};
|
|
2903
2940
|
type Plugin = (input: PluginInput) => Promise<PluginDefinition>;
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
} | {
|
|
2918
|
-
type: 'select';
|
|
2919
|
-
key: string;
|
|
2920
|
-
message: string;
|
|
2921
|
-
options: Array<{
|
|
2922
|
-
label: string;
|
|
2923
|
-
value: string;
|
|
2924
|
-
hint?: string;
|
|
2925
|
-
}>;
|
|
2926
|
-
condition?: (inputs: Record<string, string>) => boolean;
|
|
2927
|
-
}>;
|
|
2928
|
-
authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>;
|
|
2929
|
-
} | {
|
|
2930
|
-
type: 'api';
|
|
2941
|
+
interface TextPrompt {
|
|
2942
|
+
type: 'text';
|
|
2943
|
+
key: string;
|
|
2944
|
+
message: string;
|
|
2945
|
+
placeholder?: string;
|
|
2946
|
+
validate?: (value: string) => string | undefined;
|
|
2947
|
+
condition?: (inputs: Record<string, string>) => boolean;
|
|
2948
|
+
}
|
|
2949
|
+
interface SelectPrompt {
|
|
2950
|
+
type: 'select';
|
|
2951
|
+
key: string;
|
|
2952
|
+
message: string;
|
|
2953
|
+
options: Array<{
|
|
2931
2954
|
label: string;
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
label: string;
|
|
2945
|
-
value: string;
|
|
2946
|
-
hint?: string;
|
|
2947
|
-
}>;
|
|
2948
|
-
condition?: (inputs: Record<string, string>) => boolean;
|
|
2949
|
-
}>;
|
|
2950
|
-
authorize?(inputs?: Record<string, string>): Promise<{
|
|
2951
|
-
type: 'success';
|
|
2952
|
-
key: string;
|
|
2953
|
-
provider?: string;
|
|
2954
|
-
} | {
|
|
2955
|
-
type: 'failed';
|
|
2956
|
-
}>;
|
|
2957
|
-
})[];
|
|
2955
|
+
value: string;
|
|
2956
|
+
hint?: string;
|
|
2957
|
+
}>;
|
|
2958
|
+
condition?: (inputs: Record<string, string>) => boolean;
|
|
2959
|
+
}
|
|
2960
|
+
type AuthPrompt = TextPrompt | SelectPrompt;
|
|
2961
|
+
type AuthApiResult = {
|
|
2962
|
+
type: 'success';
|
|
2963
|
+
key: string;
|
|
2964
|
+
provider?: string;
|
|
2965
|
+
} | {
|
|
2966
|
+
type: 'failed';
|
|
2958
2967
|
};
|
|
2959
|
-
type
|
|
2968
|
+
type AuthCredential = {
|
|
2969
|
+
refresh: string;
|
|
2970
|
+
access: string;
|
|
2971
|
+
expires: number;
|
|
2972
|
+
accountId?: string;
|
|
2973
|
+
} | {
|
|
2974
|
+
key: string;
|
|
2975
|
+
};
|
|
2976
|
+
type AuthCallbackResult = ({
|
|
2977
|
+
type: 'success';
|
|
2978
|
+
provider?: string;
|
|
2979
|
+
} & AuthCredential) | {
|
|
2980
|
+
type: 'failed';
|
|
2981
|
+
};
|
|
2982
|
+
type AuthOAuthResult = {
|
|
2960
2983
|
url: string;
|
|
2961
2984
|
instructions: string;
|
|
2962
2985
|
} & ({
|
|
2963
2986
|
method: 'auto';
|
|
2964
|
-
callback(): Promise<
|
|
2965
|
-
type: 'success';
|
|
2966
|
-
provider?: string;
|
|
2967
|
-
} & ({
|
|
2968
|
-
refresh: string;
|
|
2969
|
-
access: string;
|
|
2970
|
-
expires: number;
|
|
2971
|
-
accountId?: string;
|
|
2972
|
-
} | {
|
|
2973
|
-
key: string;
|
|
2974
|
-
})) | {
|
|
2975
|
-
type: 'failed';
|
|
2976
|
-
}>;
|
|
2987
|
+
callback(): Promise<AuthCallbackResult>;
|
|
2977
2988
|
} | {
|
|
2978
2989
|
method: 'code';
|
|
2979
|
-
callback(code: string): Promise<
|
|
2980
|
-
type: 'success';
|
|
2981
|
-
provider?: string;
|
|
2982
|
-
} & ({
|
|
2983
|
-
refresh: string;
|
|
2984
|
-
access: string;
|
|
2985
|
-
expires: number;
|
|
2986
|
-
accountId?: string;
|
|
2987
|
-
} | {
|
|
2988
|
-
key: string;
|
|
2989
|
-
})) | {
|
|
2990
|
-
type: 'failed';
|
|
2991
|
-
}>;
|
|
2990
|
+
callback(code: string): Promise<AuthCallbackResult>;
|
|
2992
2991
|
});
|
|
2992
|
+
interface OAuthAuthMethod {
|
|
2993
|
+
type: 'oauth';
|
|
2994
|
+
label: string;
|
|
2995
|
+
prompts?: AuthPrompt[];
|
|
2996
|
+
authorize(inputs?: Record<string, string>): Promise<AuthOAuthResult>;
|
|
2997
|
+
}
|
|
2998
|
+
interface ApiAuthMethod {
|
|
2999
|
+
type: 'api';
|
|
3000
|
+
label: string;
|
|
3001
|
+
prompts?: AuthPrompt[];
|
|
3002
|
+
authorize?(inputs?: Record<string, string>): Promise<AuthApiResult>;
|
|
3003
|
+
}
|
|
3004
|
+
type AuthMethod = OAuthAuthMethod | ApiAuthMethod;
|
|
3005
|
+
type AuthHook = {
|
|
3006
|
+
provider: string;
|
|
3007
|
+
loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, unknown>>;
|
|
3008
|
+
methods: AuthMethod[];
|
|
3009
|
+
};
|
|
2993
3010
|
interface PluginDefinition {
|
|
2994
3011
|
hooks?: HookMatcher[];
|
|
2995
3012
|
commands?: Record<string, CommandDefinition>;
|
|
2996
3013
|
agents?: Record<string, AgentDefinition>;
|
|
2997
3014
|
skills?: Record<string, SkillDefinition>;
|
|
2998
3015
|
tools?: Record<string, ToolDefinition>;
|
|
2999
|
-
marketplace?: Record<string, MarketplaceEntry>;
|
|
3000
3016
|
event?: (input: {
|
|
3001
3017
|
event: Event;
|
|
3002
3018
|
}) => Promise<void>;
|
|
3003
|
-
config?: (input: Config) => Promise<void>;
|
|
3019
|
+
config?: (input: Readonly<Config>) => Promise<void>;
|
|
3004
3020
|
auth?: AuthHook;
|
|
3005
|
-
'session.start'?: (input: SessionStartInput, output: HookOutputWrapper<GatewayMessageSendInput>) => Promise<void>;
|
|
3006
|
-
'session.end'?: (input: SessionEndInput, output: HookOutputWrapper<SessionEndInput>) => Promise<void>;
|
|
3007
|
-
'session.compact'?: (input: SessionCompactInput, output: HookOutputWrapper<SessionCompactInput>) => Promise<void>;
|
|
3008
|
-
'session.compacting'?: (input: SessionCompactingInput, output: HookOutputWrapper<SessionCompactingInput>) => Promise<void>;
|
|
3009
|
-
'message.receive'?: (input: MessageReceiveInput, output: HookOutputWrapper<MessageReceiveInput>) => Promise<void>;
|
|
3010
|
-
'message.transform'?: (input: MessageTransformInput, output: HookOutputWrapper<MessageTransformInput>) => Promise<void>;
|
|
3011
|
-
'system.transform'?: (input: SystemTransformInput, output: HookOutputWrapper<SystemTransformInput>) => Promise<void>;
|
|
3012
|
-
'tool.before'?: (input: ToolBeforeInput, output: HookOutputWrapper<ToolBeforeInput>) => Promise<void>;
|
|
3013
|
-
'tool.after'?: (input: ToolAfterInput, output: HookOutputWrapper<ToolAfterInput>) => Promise<void>;
|
|
3014
|
-
'tool.failure'?: (input: ToolFailureInput, output: HookOutputWrapper<ToolFailureInput>) => Promise<void>;
|
|
3015
|
-
'tool.definition'?: (input: ToolDefinitionInput, output: HookOutputWrapper<ToolDefinitionInput>) => Promise<void>;
|
|
3016
|
-
'command.before'?: (input: CommandBeforeInput, output: HookOutputWrapper<CommandBeforeInput>) => Promise<void>;
|
|
3017
|
-
'command.after'?: (input: CommandAfterInput, output: HookOutputWrapper<CommandAfterInput>) => Promise<void>;
|
|
3018
|
-
'permission.ask'?: (input: PermissionAskInput, output: HookOutputWrapper<PermissionAskInput>) => Promise<void>;
|
|
3019
|
-
'permission.denied'?: (input: PermissionDeniedInput, output: HookOutputWrapper<PermissionDeniedInput>) => Promise<void>;
|
|
3020
|
-
'llm.params'?: (input: LlmParamsInput, output: HookOutputWrapper<LlmParamsInput>) => Promise<void>;
|
|
3021
|
-
'llm.headers'?: (input: LlmHeadersInput, output: HookOutputWrapper<LlmHeadersInput>) => Promise<void>;
|
|
3022
|
-
'shell.env'?: (input: ShellEnvInput, output: HookOutputWrapper<ShellEnvInput>) => Promise<void>;
|
|
3023
|
-
'gateway.message.receive'?: (input: GatewayMessageReceiveInput, output: HookOutputWrapper<GatewayMessageReceiveInput>) => Promise<void>;
|
|
3024
|
-
'gateway.message.process'?: (input: GatewayMessageProcessInput, output: HookOutputWrapper<GatewayMessageProcessInput>) => Promise<void>;
|
|
3025
|
-
'gateway.message.complete'?: (input: GatewayMessageCompleteInput, output: HookOutputWrapper<GatewayMessageCompleteInput>) => Promise<void>;
|
|
3026
|
-
'gateway.message.send'?: (input: GatewayMessageSendInput, output: HookOutputWrapper<GatewayMessageSendInput>) => Promise<void>;
|
|
3027
|
-
'scheduler.heartbeat.trigger'?: (input: HeartbeatTriggerInput, output: HookOutputWrapper<HeartbeatTriggerInput>) => Promise<void>;
|
|
3028
|
-
'scheduler.heartbeat.complete'?: (input: HeartbeatCompleteInput, output: HookOutputWrapper<HeartbeatCompleteInput>) => Promise<void>;
|
|
3029
|
-
'scheduler.task.trigger'?: (input: ScheduledTaskTriggerInput, output: HookOutputWrapper<ScheduledTaskTriggerInput>) => Promise<void>;
|
|
3030
|
-
'scheduler.task.complete'?: (input: ScheduledTaskCompleteInput, output: HookOutputWrapper<ScheduledTaskCompleteInput>) => Promise<void>;
|
|
3031
|
-
'context.build.before'?: (input: ContextBuildBeforeInput, output: HookOutputWrapper<ContextBuildBeforeInput>) => Promise<void>;
|
|
3032
|
-
'context.build.after'?: (input: ContextBuildAfterInput, output: HookOutputWrapper<ContextBuildAfterInput>) => Promise<void>;
|
|
3033
3021
|
}
|
|
3034
3022
|
|
|
3035
|
-
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, AgentSchema, type AgentScope, AgentScopeSchema, type AuthHook, type
|
|
3023
|
+
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, AgentSchema, type AgentScope, AgentScopeSchema, type ApiAuthMethod, type AuthApiResult, type AuthCallbackResult, type AuthCredential, type AuthHook, type AuthMethod, type AuthOAuthResult, type AuthPrompt, CallIDSchema, type CommandAfterInput, CommandAfterInputSchema, type CommandBeforeInput, CommandBeforeInputSchema, type CommandCompleteInput, CommandCompleteInputSchema, CommandExecutorSchema, type CommandHookDefinition, type CommandTaskDefinition, CommandTaskDefinitionSchema, type CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, type CreationCompleteInput, CreationCompleteInputSchema, type CreationRequestInput, CreationRequestInputSchema, CwdSchema, type DefinitionValidationOptions, type DefinitionValidationResult, EndReasonSchema, EventInputSchemas, type EvolutionCompleteInput, EvolutionCompleteInputSchema, type EvolutionRequestInput, EvolutionRequestInputSchema, FinishReasonSchema, FunctionExecutorSchema, type FunctionHookDefinition, type GatewayMessageCompleteInput, GatewayMessageCompleteInputSchema, type GatewayMessageDeliveredInput, GatewayMessageDeliveredInputSchema, type GatewayMessageProcessInput, GatewayMessageProcessInputSchema, type GatewayMessageReadInput, GatewayMessageReadInputSchema, type GatewayMessageReceiveInput, GatewayMessageReceiveInputSchema, type GatewayMessageSendInput, GatewayMessageSendInputSchema, HOOK_EVENTS, type HeartbeatCompleteInput, HeartbeatCompleteInputSchema, type HeartbeatTaskDefinition, HeartbeatTaskDefinitionSchema, type HeartbeatTriggerInput, HeartbeatTriggerInputSchema, type HookChainResult, type HookContext, type HookDefinition, type HookError, HookEvent, type HookExecutionDetail, type HookExecutor, type HookExecutorOutput, type HookExecutorRegistry, HookExecutorSchema, type HookHandler, type HookInfo, type HookInitResult, type HookMatcher, HookMatcherSchema, type HookMessageCallback, type HookOutputWrapper, type HookResult, HookType, type HooksConfig, HooksConfigSchema, HttpExecutorSchema, type HttpHookDefinition, type LlmHeadersInput, LlmHeadersInputSchema, type LlmParamsInput, LlmParamsInputSchema, LlmParamsSchema, LlmProviderSchema, type LoopEndInput, LoopEndInputSchema, type LoopStartInput, LoopStartInputSchema, type ManifestValidationResult, MessageIDSchema, type MessageReceiveInput, MessageReceiveInputSchema, MessageRoleSchema, MessageSchema, type MessageTransformInput, MessageTransformInputSchema, ModelObjectSchema, ModelSchema, type OAuthAuthMethod, PLUGIN_CAPABILITIES, PLUGIN_DEFINITION_KEYS, PLUGIN_ENTRY_EXTENSIONS, PLUGIN_ENTRY_NAMES, PLUGIN_HOOK_EXECUTOR_TYPES, PLUGIN_HOOK_FAILURE_POLICIES, PLUGIN_ID_PATTERN, PLUGIN_VERSION_PATTERN, PartIDSchema, type PermissionAskInput, PermissionAskInputSchema, type PermissionDeniedInput, PermissionDeniedInputSchema, PermissionLevelSchema, PermissionRequestSchema, type Plugin, type PluginCapability, type PluginDefinition, type PluginHookFailurePolicy, type PluginInput, type PluginManifest, PluginManifestSchema, type ProcessorErrorInput, ProcessorErrorInputSchema, type ProcessorFinishInput, ProcessorFinishInputSchema, type ProcessorReasoningDeltaInput, ProcessorReasoningDeltaInputSchema, type ProcessorReasoningEndInput, ProcessorReasoningEndInputSchema, type ProcessorReasoningStartInput, ProcessorReasoningStartInputSchema, type ProcessorStartInput, ProcessorStartInputSchema, type ProcessorStepFinishInput, ProcessorStepFinishInputSchema, type ProcessorStepStartInput, ProcessorStepStartInputSchema, type ProcessorTextDeltaInput, ProcessorTextDeltaInputSchema, type ProcessorTextEndInput, ProcessorTextEndInputSchema, type ProcessorTextStartInput, ProcessorTextStartInputSchema, type ProcessorToolCallInput, ProcessorToolCallInputSchema, type ProcessorToolErrorInput, ProcessorToolErrorInputSchema, type ProcessorToolInputStartInput, ProcessorToolInputStartInputSchema, type ProcessorToolResultInput, ProcessorToolResultInputSchema, PromptExecutorSchema, type PromptHookDefinition, type ScheduledTaskCompleteInput, ScheduledTaskCompleteInputSchema, type ScheduledTaskTriggerInput, ScheduledTaskTriggerInputSchema, type SchedulerTaskDefinition, SchedulerTaskDefinitionSchema, type SelectPrompt, type SessionCompactInput, SessionCompactInputSchema, type SessionCompactingInput, SessionCompactingInputSchema, type SessionEndInput, SessionEndInputSchema, SessionIDSchema, type SessionStartInput, SessionStartInputSchema, type ShellEnvInput, ShellEnvInputSchema, type SkillDefinition, type SkillInitContext, SkillInitContextSchema, type SkillInitResult, SkillInitResultSchema, type SkillMetadata, SkillMetadataSchema, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, type TaskDefinition, type TaskProgressInput, TaskProgressInputSchema, type TaskRunningInput, TaskRunningInputSchema, type TaskSource, TaskSourceSchema, type TaskStartInput, TaskStartInputSchema, type TextPrompt, type ToolAfterInput, ToolAfterInputSchema, ToolArgsSchema, type ToolBeforeInput, ToolBeforeInputSchema, type ToolDefinitionInput, ToolDefinitionInputSchema, type ToolFailureInput, ToolFailureInputSchema, ToolResultSchema, getEventInputSchema, isValidPluginEntry, isValidPluginId, safeValidateHookInput, tool, validateHookInput, validatePluginDefinition, validatePluginManifest };
|