@easbot/plugin 0.3.28 → 0.3.29
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 +1 -1
- package/README.md +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +169 -113
- package/dist/index.d.ts +169 -113
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/README.en.md
CHANGED
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var v=require('zod'),types=require('@easbot/types');require('@easbot/sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var v__default=/*#__PURE__*/_interopDefault(v);function M(r){return {description:r.description,args:r.args,execute:r.execute}}M.schema=v__default.default;var m={Command:"command",Prompt:"prompt",Http:"http",Agent:"agent",Function:"function"},o={SessionStart:"session.start",SessionEnd:"session.end",SessionCompacting:"session.compacting",SessionCompact:"session.compact",StepStart:"step.start",StepFinish:"step.finish",StepStop:"step.stop",StepStopFailure:"step.stop.failure",MessageReceive:"message.receive",MessageTransform:"message.transform",SystemTransform:"system.transform",ToolBefore:"tool.before",ToolAfter:"tool.after",ToolFailure:"tool.failure",ToolDefinition:"tool.definition",CommandBefore:"command.before",CommandAfter:"command.after",PermissionAsk:"permission.ask",PermissionDenied:"permission.denied",LlmParams:"llm.params",LlmHeaders:"llm.headers",ShellEnv:"shell.env",TextComplete:"text.complete",GatewayMessageReceive:"gateway.message.receive",GatewayMessageProcess:"gateway.message.process",GatewayMessageComplete:"gateway.message.complete",GatewayMessageSend:"gateway.message.send",GatewayMessageDelivered:"gateway.message.delivered",GatewayMessageRead:"gateway.message.read",HeartbeatTrigger:"scheduler.heartbeat.trigger",HeartbeatComplete:"scheduler.heartbeat.complete",ScheduledTaskTrigger:"scheduler.task.trigger",ScheduledTaskComplete:"scheduler.task.complete",CommandTrigger:"scheduler.command.trigger",CommandComplete:"scheduler.command.complete",ContextBuildBefore:"context.build.before",ContextBuildAfter:"context.build.after",TaskStart:"task.start",TaskRunning:"task.running",TaskProgress:"task.progress",TaskComplete:"task.complete",LoopStart:"loop.start",LoopEnd:"loop.end",CreationRequest:"creation.request",CreationComplete:"creation.complete",EvolutionRequest:"evolution.request",EvolutionComplete:"evolution.complete"},Qe=Object.values(o);var b=v.z.string().optional(),P=v.z.object({type:v.z.literal(m.Command),command:v.z.string(),if:b,shell:v.z.enum(["bash","powershell"]).optional(),timeout:v.z.number().positive().optional(),statusMessage:v.z.string().optional(),once:v.z.boolean().optional(),async:v.z.boolean().optional()}),w=v.z.object({type:v.z.literal(m.Prompt),if:b,timeout:v.z.number().positive().optional(),model:v.z.string().optional(),statusMessage:v.z.string().optional(),once:v.z.boolean().optional(),runMode:v.z.enum(["session","fork"]).optional(),system:v.z.string().optional(),parts:v.z.array(v.z.unknown())}),H=v.z.object({type:v.z.literal(m.Http),url:v.z.string(),if:b,timeout:v.z.number().positive().optional(),method:v.z.enum(["GET","POST","PUT","DELETE"]).optional(),headers:v.z.record(v.z.string(),v.z.string()).optional(),allowedEnvVars:v.z.array(v.z.string()).optional(),statusMessage:v.z.string().optional(),once:v.z.boolean().optional()}),E=v.z.object({type:v.z.literal(m.Agent),if:b,timeout:v.z.number().positive().optional(),agent:v.z.string().optional(),model:v.z.string().optional(),statusMessage:v.z.string().optional(),once:v.z.boolean().optional(),system:v.z.string().optional(),parts:v.z.array(v.z.unknown())}),A=v.z.object({type:v.z.literal(m.Function),handler:v.z.function()}),j=v.z.discriminatedUnion("type",[P,w,H,E,A]),D=v.z.object({event:v.z.string(),matcher:v.z.string().optional(),hooks:v.z.array(j)}),ot=v.z.record(v.z.string(),v.z.array(D)),n=v.z.string().min(1).describe("Session unique identifier"),i=v.z.string().min(1).describe("Message unique identifier"),g=v.z.string().min(1).describe("Tool call unique identifier"),c=v.z.string().optional().describe("Agent name"),f=v.z.string().optional().describe("Model identifier"),h=v.z.object({providerId:v.z.string().describe("Provider ID"),modelId:v.z.string().describe("Model ID"),api:v.z.object({id:v.z.string().describe("API ID"),npm:v.z.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),x=v.z.string().optional().describe("Working directory path"),R=v.z.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),z=v.z.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),F=v.z.object({sessionId:n,source:v.z.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:f,agent:c,cwd:x}),O=v.z.object({sessionId:n,reason:R,duration:v.z.number().positive().optional().describe("Session duration in milliseconds")}),G=v.z.object({sessionId:n,trigger:v.z.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:v.z.number().positive().describe("Current context length"),threshold:v.z.number().positive().describe("Trigger threshold")}),W=v.z.object({sessionId:n,summary:v.z.string().describe("Compaction summary"),previousLength:v.z.number().positive().describe("Previous context length"),newLength:v.z.number().positive().describe("New context length")}),B=v.z.object({sessionId:n,messageId:i,userMessageId:i.optional().describe("User message ID for the current step"),model:f,agent:c}),L=v.z.object({sessionId:n,messageId:i,userMessageId:i.optional().describe("User message ID for the current step"),model:f,agent:c,finishReason:z,tokens:v.z.object({input:v.z.number().int().nonnegative().optional(),output:v.z.number().int().nonnegative().optional(),total:v.z.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),q=v.z.object({sessionId:n,reason:v.z.string().describe("Stop reason")}),_=v.z.object({sessionId:n,error:v.z.string().describe("Error message"),errorType:v.z.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),U=v.z.enum(["user","assistant","system","tool"]),k=v.z.discriminatedUnion("type",[v.z.object({type:v.z.literal("text"),text:v.z.string().describe("Text content")}),v.z.object({type:v.z.literal("image"),source:v.z.object({type:v.z.enum(["base64","url"]),mime:v.z.string().optional().describe("File mime type"),data:v.z.string().describe("File base64 encoding data or url")})}),v.z.object({type:v.z.literal("file"),url:v.z.string().describe("File path"),filename:v.z.string().describe("File name"),mime:v.z.string().optional().describe("File mime type")})]),C=v.z.object({id:i,role:U,content:v.z.union([v.z.string(),v.z.array(k)]),name:v.z.string().optional().describe("Message sender name"),tool_call_id:g.optional().describe("Related tool call ID")}),N=v.z.object({sessionId:n,agent:c,model:f,messageId:i,message:v.z.object({id:i,role:v.z.literal("user"),content:v.z.union([v.z.string(),v.z.array(k)])}).describe("User message")}),$=v.z.object({sessionId:n,messages:v.z.array(C).describe("Messages to transform")}),Z=v.z.object({sessionId:n,model:f,system:v.z.array(v.z.string()).describe("Current system prompt")}),y=v.z.record(v.z.string(),v.z.unknown()).describe("Tool call arguments"),V=v.z.object({title:v.z.string().optional().describe("Result title"),content:v.z.string().describe("Result content"),is_error:v.z.boolean().optional().describe("Is error result"),metadata:v.z.record(v.z.string(),v.z.unknown()).optional().describe("Extra metadata")}),K=v.z.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:v.z.string().describe("Tool name"),callId:g,args:y}),J=v.z.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:v.z.string(),callId:g,args:y,result:V,duration:v.z.number().nonnegative().optional().describe("Execution duration in milliseconds")}),Q=v.z.object({sessionId:n,tool:v.z.string(),callId:g,args:y,error:v.z.string().describe("Error message"),errorType:v.z.enum(["timeout","invalid_args","execution_error","permission_denied"])}),X=v.z.object({sessionId:n,toolID:v.z.string().describe("Tool ID"),definition:v.z.object({name:v.z.string(),description:v.z.string().optional(),parameters:v.z.record(v.z.string(),v.z.unknown()).optional()}).describe("Tool definition")}),Y=v.z.object({sessionId:n,command:v.z.string().describe("Command name"),arguments:v.z.union([v.z.string(),v.z.record(v.z.string(),v.z.unknown())]).describe("Command arguments")}),ee=v.z.object({sessionId:n,command:v.z.string().describe("Command name"),arguments:v.z.union([v.z.string(),v.z.record(v.z.string(),v.z.unknown())]).optional(),result:v.z.object({info:v.z.unknown().optional().describe("Message info"),parts:v.z.array(v.z.unknown()).optional().describe("Message parts"),title:v.z.string().optional().describe("Result title"),metadata:v.z.record(v.z.string(),v.z.unknown()).optional().describe("Result metadata"),output:v.z.string().optional().describe("Result output"),success:v.z.boolean().optional().describe("Whether execution succeeded"),error:v.z.string().optional().describe("Error message if failed")}).describe("Command execution result")}),te=v.z.enum(["read","write","exec","admin"]),oe=v.z.object({tool:v.z.string().describe("Tool name requesting permission"),args:y.optional(),level:te.optional(),reason:v.z.string().optional().describe("Reason for permission request")}),ne=v.z.object({sessionId:n,request:oe}),re=v.z.object({sessionId:n,tool:v.z.string(),reason:v.z.string().optional()}),T=v.z.enum(["openai","anthropic","google","azure","custom"]),se=v.z.object({temperature:v.z.number().min(0).max(2).optional(),topP:v.z.number().min(0).max(1).optional(),topK:v.z.number().int().positive().optional(),maxTokens:v.z.number().int().positive().optional(),stopSequences:v.z.array(v.z.string()).optional(),responseFormat:v.z.enum(["text","json_object"]).optional()}),ie=v.z.object({sessionId:n,agent:c,model:h,provider:T,params:se.partial().optional()}),ae=v.z.object({sessionId:n,agent:c,model:h,provider:T,headers:v.z.record(v.z.string(),v.z.string()).optional()}),pe=v.z.object({cwd:x.describe("Working directory"),sessionId:n.optional(),callId:g.optional()}),me=v.z.object({sessionId:n,messageId:i,partId:v.z.string().describe("Text part ID"),text:v.z.string().describe("Completed text")}),ce=v.z.object({sessionId:n,mode:v.z.enum(["agent","chat","query"]).describe("Build mode"),providerId:v.z.string().optional()}),ue=v.z.object({sessionId:n,context:v.z.object({messages:v.z.array(C),system:v.z.array(v.z.string()),metadata:v.z.record(v.z.string(),v.z.unknown())}).describe("Built context")}),le=v.z.object({gatewayID:v.z.string().describe("Gateway ID"),messageId:i,message:v.z.unknown().describe("Received message")}),de=v.z.object({gatewayID:v.z.string(),messageId:i,message:v.z.unknown(),sessionId:n.optional()}),ge=v.z.object({gatewayID:v.z.string(),messageId:i,result:v.z.unknown().optional()}),fe=v.z.object({gatewayID:v.z.string(),messageId:i,message:v.z.unknown(),target:v.z.string().optional().describe("Send target")}),be=v.z.object({gatewayID:v.z.string(),messageId:i,sessionId:n.optional(),channel:v.z.object({platform:v.z.string(),channelId:v.z.string()}),timestamp:v.z.number().describe("Delivery timestamp")}),ye=v.z.object({gatewayID:v.z.string(),messageId:i,sessionId:n.optional(),channel:v.z.object({platform:v.z.string(),channelId:v.z.string()}),timestamp:v.z.number().describe("Read timestamp")}),Se=v.z.object({type:v.z.literal("command"),config:v.z.object({command:v.z.string(),arguments:v.z.union([v.z.string(),v.z.record(v.z.string(),v.z.unknown())]).optional()})}),Ie=v.z.object({type:v.z.literal("heartbeat"),parts:v.z.array(v.z.unknown()),system:v.z.string().optional(),config:v.z.object({session:v.z.string().optional(),mode:v.z.enum(["session","fork"]).optional(),agent:v.z.string().optional(),model:v.z.string().optional(),tools:v.z.record(v.z.string(),v.z.boolean()).optional()}).optional()}),he=v.z.object({type:v.z.literal("scheduler"),parts:v.z.array(v.z.unknown()),system:v.z.string().optional(),config:v.z.object({agentType:v.z.string().optional(),transport:v.z.enum(["stdio","http","websocket","cli"]).optional(),model:v.z.string().optional(),tools:v.z.record(v.z.string(),v.z.boolean()).optional()}).optional()}),xe=v.z.object({taskId:v.z.string().describe("Heartbeat task ID"),timestamp:v.z.number().describe("Heartbeat timestamp"),name:v.z.string().optional().describe("Heartbeat name"),definition:Ie.optional()}),ke=v.z.object({taskId:v.z.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:v.z.number(),duration:v.z.number().nonnegative().optional(),success:v.z.boolean().optional(),error:v.z.string().optional()}),Ce=v.z.object({taskId:v.z.string().describe("Task ID"),taskName:v.z.string().optional(),timestamp:v.z.number(),payload:v.z.record(v.z.string(),v.z.unknown()).optional(),definition:he.optional()}),Te=v.z.object({taskId:v.z.string(),timestamp:v.z.number(),success:v.z.boolean(),result:v.z.record(v.z.string(),v.z.unknown()).optional(),error:v.z.string().optional()}),ve=v.z.object({taskId:v.z.string().describe("Command task unique identifier"),taskName:v.z.string().describe("Command task name"),command:v.z.string().describe("Command name"),arguments:v.z.union([v.z.string(),v.z.record(v.z.string(),v.z.unknown())]).optional().describe("Command arguments"),timestamp:v.z.number().describe("Trigger timestamp"),definition:Se.optional()}),Me=v.z.object({taskId:v.z.string(),timestamp:v.z.number(),success:v.z.boolean(),output:v.z.string().optional(),error:v.z.string().optional(),duration:v.z.number().describe("Execution duration in milliseconds")}),S=v.z.enum(["tool","scheduler","cli","api"]),Pe=v.z.object({taskId:v.z.string().describe("Task unique identifier"),sessionId:v.z.string().describe("Session ID for this task"),source:S.describe("Task source: tool, scheduler, cli, api"),agentType:v.z.string().describe("Agent type to execute this task"),description:v.z.string().describe("Task description"),prompt:v.z.string().describe("Task prompt content"),timeout:v.z.number().positive().optional().describe("Task timeout in milliseconds")}),we=v.z.object({taskId:v.z.string().describe("Task unique identifier"),sessionId:v.z.string().describe("Session ID for this task"),source:S.describe("Task source: tool, scheduler, cli, api")}),He=v.z.object({taskId:v.z.string(),sessionId:v.z.string(),source:S,step:v.z.number().describe("Current step number"),totalSteps:v.z.number().optional().describe("Total number of steps"),output:v.z.string().describe("Progress output content"),timestamp:v.z.number().describe("Progress timestamp")}),Ee=v.z.object({taskId:v.z.string(),sessionId:v.z.string(),source:S,result:v.z.string().describe("Task result content"),duration:v.z.number().nonnegative().describe("Task duration in milliseconds"),attachments:v.z.array(v.z.unknown()).optional().describe("Task result attachments"),error:v.z.string().optional().describe("Error message if task failed"),agentType:v.z.string().optional().describe("Agent type that executed the task"),metadata:v.z.record(v.z.string(),v.z.unknown()).optional().describe("Additional metadata for the task result")}),Ae=v.z.object({sessionId:v.z.string().describe("Session ID"),step:v.z.number().describe("Current step number"),lastUserId:v.z.string().describe("Last user message ID"),result:v.z.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),je=v.z.object({sessionId:v.z.string().describe("Session ID"),step:v.z.number().describe("Current step number"),lastUserId:v.z.string().describe("Last user message ID"),result:v.z.enum(["stop","continue"]).describe("Loop result: stop or continue")}),De=v.z.object({requestId:v.z.string(),kind:v.z.enum(["create-skill","create-workflow","create-bundle"]),requirement:v.z.string(),hints:v.z.array(v.z.string()),origin:v.z.object({source:v.z.enum(["human","tool","scheduler","namespace"]).optional(),timestamp:v.z.number().int().nonnegative()})}),Re=v.z.object({requestId:v.z.string(),status:v.z.enum(["success","failed"]),specId:v.z.string().optional(),durationMs:v.z.number().int().nonnegative(),error:v.z.string().optional()}),ze=v.z.object({dryRun:v.z.boolean()}),Fe=v.z.object({status:v.z.enum(["success","failed","awaiting-approval"]),applied:v.z.number().int().nonnegative().optional(),awaitingApproval:v.z.number().int().nonnegative().optional(),error:v.z.string().optional()}),I={[o.SessionStart]:F,[o.SessionEnd]:O,[o.SessionCompacting]:G,[o.SessionCompact]:W,[o.StepStart]:B,[o.StepFinish]:L,[o.StepStop]:q,[o.StepStopFailure]:_,[o.MessageReceive]:N,[o.MessageTransform]:$,[o.SystemTransform]:Z,[o.ToolBefore]:K,[o.ToolAfter]:J,[o.ToolFailure]:Q,[o.ToolDefinition]:X,[o.CommandBefore]:Y,[o.CommandAfter]:ee,[o.PermissionAsk]:ne,[o.PermissionDenied]:re,[o.LlmParams]:ie,[o.LlmHeaders]:ae,[o.ShellEnv]:pe,[o.TextComplete]:me,[o.ContextBuildBefore]:ce,[o.ContextBuildAfter]:ue,[o.GatewayMessageReceive]:le,[o.GatewayMessageProcess]:de,[o.GatewayMessageComplete]:ge,[o.GatewayMessageSend]:fe,[o.GatewayMessageDelivered]:be,[o.GatewayMessageRead]:ye,[o.HeartbeatTrigger]:xe,[o.HeartbeatComplete]:ke,[o.ScheduledTaskTrigger]:Ce,[o.ScheduledTaskComplete]:Te,[o.CommandTrigger]:ve,[o.CommandComplete]:Me,[o.TaskStart]:Pe,[o.TaskRunning]:we,[o.TaskProgress]:He,[o.TaskComplete]:Ee,[o.LoopStart]:Ae,[o.LoopEnd]:je,[o.CreationRequest]:De,[o.CreationComplete]:Re,[o.EvolutionRequest]:ze,[o.EvolutionComplete]:Fe};function nt(r){return I[r]}function rt(r,l){let d=I[r];if(!d)throw new Error(`No schema found for event: ${r}`);return d.parse(l)}function st(r,l){let d=I[r];return d?d.safeParse(l):{success:false,error:new v.z.ZodError([{code:"custom",path:[],message:`No schema found for event: ${r}`}])}}var gt=v.z.enum(["command","mcp","skill"]).describe("Command source"),Oe=v.z.union([v.z.string(),v.z.record(v.z.string(),v.z.unknown())]).describe("Command arguments"),Ge=v.z.discriminatedUnion("type",[v.z.object({type:v.z.literal("text"),text:v.z.string().describe("Text content")}),v.z.object({type:v.z.literal("image"),source:v.z.object({type:v.z.enum(["base64","url"]),mime:v.z.string().describe("File mime type"),data:v.z.string().describe("File base64 encoding data or url")})}),v.z.object({type:v.z.literal("file"),url:v.z.string().describe("File path"),filename:v.z.string().describe("File name"),mime:v.z.string().optional().describe("File mime type")})]),ft=v.z.object({name:v.z.string().describe("Command name"),description:v.z.string().describe("Command description"),scope:v.z.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:v.z.string().optional().describe("Specified agent name"),model:v.z.string().optional().describe("Specified model"),hints:v.z.array(v.z.string()).optional().describe("Argument hints"),commandType:v.z.enum(["prompt","local"]).optional().describe("Command type"),hidden:v.z.boolean().optional().describe("Whether hidden")}),bt=v.z.object({sessionId:v.z.string().describe("Session ID"),directory:v.z.string().describe("Working directory"),model:v.z.string().optional().describe("Model identifier"),agent:v.z.string().optional().describe("Agent name"),arguments:Oe.describe("Command arguments")}),We=v.z.record(v.z.string(),v.z.unknown()).describe("Result metadata"),yt=v.z.object({title:v.z.string().describe("Result title"),metadata:We.describe("Result metadata"),output:v.z.string().describe("Result output"),parts:v.z.array(Ge).optional().describe("Result parts"),success:v.z.boolean().describe("Whether execution succeeded"),error:v.z.string().optional().describe("Error message if failed")}),St=v.z.object({agent:v.z.object({name:v.z.string().describe("Agent name"),model:v.z.string().optional().describe("Agent model")}).optional().describe("Agent context")}),It=v.z.object({isEnabled:v.z.boolean().optional().describe("Is enabled check result")});var Le=v.z.enum(["subagent","primary","all"]),qe=v.z.enum(["general","coder","all"]),_e=v.z.object({providerId:v.z.string().min(1).describe("Model provider ID"),modelId:v.z.string().min(1).describe("Model ID")}),Ht=v.z.object({name:v.z.string().min(1).describe("Unique agent name"),description:v.z.string().optional().describe("When to use this agent"),mode:Le.optional().describe("Agent mode"),hidden:v.z.boolean().optional().describe("Hide from @ autocomplete menu"),scope:qe.optional().describe("Agent scope (general / coder / all)"),model:_e.optional().describe("Default model"),variant:v.z.string().optional().describe("Default model variant"),temperature:v.z.number().min(0).max(2).optional().describe("Sampling temperature"),topP:v.z.number().min(0).max(1).optional().describe("Top-p sampling"),prompt:v.z.string().optional().describe("System prompt"),permission:types.AgentPermissionSchema.optional().describe("Tool permissions"),steps:v.z.number().int().positive().optional().describe("Maximum execution steps"),color:v.z.union([v.z.string().regex(/^#[0-9a-fA-F]{6}$/),v.z.enum(["primary","secondary","accent","success","warning","error","info"])]).optional().describe("UI color (hex code or theme name)"),options:v.z.record(v.z.string(),v.z.unknown()).optional().describe("Additional options")}).meta({ref:"PluginAgent"});var Ft=v.z.object({name:v.z.string().min(1).describe("Unique skill name"),description:v.z.string().min(1).describe("When to use this skill"),scope:v.z.enum(["general","coder","all"]).optional().describe("Context mode scope")}),Ot=v.z.object({agent:v.z.object({name:v.z.string().describe("Agent name"),model:v.z.string().optional().describe("Agent model")}).optional().describe("Agent context")}),Gt=v.z.object({isEnabled:v.z.boolean().optional().describe("Is enabled check result")});var u=new Map;function Nt(r){if(u.has(r.id))throw new Error(`Marketplace with id "${r.id}" already registered`);u.set(r.id,r);}function $t(r){return u.delete(r)}function Zt(){return Array.from(u.values()).map(r=>r)}function Vt(r){return u.get(r)??null}function Kt(r){return Array.from(u.values()).filter(l=>l.category===r)}Object.defineProperty(exports,"AgentPermissionSchema",{enumerable:true,get:function(){return types.AgentPermissionSchema}});Object.defineProperty(exports,"PermissionActionSchema",{enumerable:true,get:function(){return types.PermissionActionSchema}});Object.defineProperty(exports,"PermissionRuleSchema",{enumerable:true,get:function(){return types.PermissionRuleSchema}});Object.defineProperty(exports,"buildToolArgs",{enumerable:true,get:function(){return types.buildToolArgs}});Object.defineProperty(exports,"createTool",{enumerable:true,get:function(){return types.createTool}});Object.defineProperty(exports,"schema",{enumerable:true,get:function(){return types.toolSchema}});exports.AgentExecutorSchema=E;exports.AgentMetadataSchema=Ht;exports.AgentModeSchema=Le;exports.AgentModelSchema=_e;exports.AgentSchema=c;exports.AgentScopeSchema=qe;exports.CallIDSchema=g;exports.CommandAfterInputSchema=ee;exports.CommandArgumentsSchema=Oe;exports.CommandBeforeInputSchema=Y;exports.CommandCompleteInputSchema=Me;exports.CommandExecuteResultMetadataSchema=We;exports.CommandExecuteResultSchema=yt;exports.CommandExecutionContextSchema=bt;exports.CommandExecutorSchema=P;exports.CommandInitContextSchema=St;exports.CommandInitResultSchema=It;exports.CommandMetadataSchema=ft;exports.CommandPromptPartSchema=Ge;exports.CommandSourceSchema=gt;exports.CommandTaskDefinitionSchema=Se;exports.CommandTriggerInputSchema=ve;exports.ContentPartSchema=k;exports.ContextBuildAfterInputSchema=ue;exports.ContextBuildBeforeInputSchema=ce;exports.CreationCompleteInputSchema=Re;exports.CreationRequestInputSchema=De;exports.CwdSchema=x;exports.EndReasonSchema=R;exports.EventInputSchemas=I;exports.EvolutionCompleteInputSchema=Fe;exports.EvolutionRequestInputSchema=ze;exports.FinishReasonSchema=z;exports.FunctionExecutorSchema=A;exports.GatewayMessageCompleteInputSchema=ge;exports.GatewayMessageDeliveredInputSchema=be;exports.GatewayMessageProcessInputSchema=de;exports.GatewayMessageReadInputSchema=ye;exports.GatewayMessageReceiveInputSchema=le;exports.GatewayMessageSendInputSchema=fe;exports.HOOK_EVENTS=Qe;exports.HeartbeatCompleteInputSchema=ke;exports.HeartbeatTaskDefinitionSchema=Ie;exports.HeartbeatTriggerInputSchema=xe;exports.HookEvent=o;exports.HookExecutorSchema=j;exports.HookMatcherSchema=D;exports.HookType=m;exports.HooksConfigSchema=ot;exports.HttpExecutorSchema=H;exports.LlmHeadersInputSchema=ae;exports.LlmParamsInputSchema=ie;exports.LlmParamsSchema=se;exports.LlmProviderSchema=T;exports.LoopEndInputSchema=je;exports.LoopStartInputSchema=Ae;exports.MessageIDSchema=i;exports.MessageReceiveInputSchema=N;exports.MessageRoleSchema=U;exports.MessageSchema=C;exports.MessageTransformInputSchema=$;exports.ModelObjectSchema=h;exports.ModelSchema=f;exports.PermissionAskInputSchema=ne;exports.PermissionDeniedInputSchema=re;exports.PermissionLevelSchema=te;exports.PermissionRequestSchema=oe;exports.PromptExecutorSchema=w;exports.ScheduledTaskCompleteInputSchema=Te;exports.ScheduledTaskTriggerInputSchema=Ce;exports.SchedulerTaskDefinitionSchema=he;exports.SessionCompactInputSchema=W;exports.SessionCompactingInputSchema=G;exports.SessionEndInputSchema=O;exports.SessionIDSchema=n;exports.SessionStartInputSchema=F;exports.ShellEnvInputSchema=pe;exports.SkillInitContextSchema=Ot;exports.SkillInitResultSchema=Gt;exports.SkillMetadataSchema=Ft;exports.StepFinishInputSchema=L;exports.StepStartInputSchema=B;exports.StepStopFailureInputSchema=_;exports.StepStopInputSchema=q;exports.SystemTransformInputSchema=Z;exports.TaskCompleteInputSchema=Ee;exports.TaskProgressInputSchema=He;exports.TaskRunningInputSchema=we;exports.TaskSourceSchema=S;exports.TaskStartInputSchema=Pe;exports.TextCompleteInputSchema=me;exports.ToolAfterInputSchema=J;exports.ToolArgsSchema=y;exports.ToolBeforeInputSchema=K;exports.ToolDefinitionInputSchema=X;exports.ToolFailureInputSchema=Q;exports.ToolResultSchema=V;exports.findMarketplace=Vt;exports.findMarketplacesByCategory=Kt;exports.getEventInputSchema=nt;exports.listMarketplaces=Zt;exports.registerMarketplace=Nt;exports.safeValidateHookInput=st;exports.tool=M;exports.unregisterMarketplace=$t;exports.validateHookInput=rt;
|
|
1
|
+
'use strict';var H=require('zod'),types=require('@easbot/types');require('@easbot/sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var H__default=/*#__PURE__*/_interopDefault(H);function M(r){return {description:r.description,args:r.args,execute:r.execute}}M.schema=H__default.default;var c={Command:"command",Prompt:"prompt",Http:"http",Agent:"agent",Function:"function"},o={SessionStart:"session.start",SessionEnd:"session.end",SessionCompacting:"session.compacting",SessionCompact:"session.compact",StepStart:"step.start",StepFinish:"step.finish",StepStop:"step.stop",StepStopFailure:"step.stop.failure",MessageReceive:"message.receive",MessageTransform:"message.transform",SystemTransform:"system.transform",ToolBefore:"tool.before",ToolAfter:"tool.after",ToolFailure:"tool.failure",ToolDefinition:"tool.definition",CommandBefore:"command.before",CommandAfter:"command.after",PermissionAsk:"permission.ask",PermissionDenied:"permission.denied",LlmParams:"llm.params",LlmHeaders:"llm.headers",ShellEnv:"shell.env",TextComplete:"text.complete",GatewayMessageReceive:"gateway.message.receive",GatewayMessageProcess:"gateway.message.process",GatewayMessageComplete:"gateway.message.complete",GatewayMessageSend:"gateway.message.send",GatewayMessageDelivered:"gateway.message.delivered",GatewayMessageRead:"gateway.message.read",HeartbeatTrigger:"scheduler.heartbeat.trigger",HeartbeatComplete:"scheduler.heartbeat.complete",ScheduledTaskTrigger:"scheduler.task.trigger",ScheduledTaskComplete:"scheduler.task.complete",CommandTrigger:"scheduler.command.trigger",CommandComplete:"scheduler.command.complete",ContextBuildBefore:"context.build.before",ContextBuildAfter:"context.build.after",TaskStart:"task.start",TaskRunning:"task.running",TaskProgress:"task.progress",TaskComplete:"task.complete",LoopStart:"loop.start",LoopEnd:"loop.end",CreationRequest:"creation.request",CreationComplete:"creation.complete",EvolutionRequest:"evolution.request",EvolutionComplete:"evolution.complete"},Xe=Object.values(o);var b=H.z.string().optional(),P=H.z.object({type:H.z.literal(c.Command),command:H.z.string(),if:b,shell:H.z.enum(["bash","powershell"]).optional(),timeout:H.z.number().positive().optional(),statusMessage:H.z.string().optional(),once:H.z.boolean().optional(),async:H.z.boolean().optional()}),w=H.z.object({type:H.z.literal(c.Prompt),if:b,timeout:H.z.number().positive().optional(),model:H.z.string().optional(),statusMessage:H.z.string().optional(),once:H.z.boolean().optional(),runMode:H.z.enum(["session","fork"]).optional(),system:H.z.string().optional(),parts:H.z.array(H.z.unknown()),onMessage:H.z.custom(r=>typeof r=="function").optional()}),E=H.z.object({type:H.z.literal(c.Http),url:H.z.string(),if:b,timeout:H.z.number().positive().optional(),method:H.z.enum(["GET","POST","PUT","DELETE"]).optional(),headers:H.z.record(H.z.string(),H.z.string()).optional(),allowedEnvVars:H.z.array(H.z.string()).optional(),statusMessage:H.z.string().optional(),once:H.z.boolean().optional()}),D=H.z.object({type:H.z.literal(c.Agent),if:b,timeout:H.z.number().positive().optional(),agent:H.z.string().optional(),model:H.z.string().optional(),statusMessage:H.z.string().optional(),once:H.z.boolean().optional(),system:H.z.string().optional(),parts:H.z.array(H.z.unknown()),onMessage:H.z.custom(r=>typeof r=="function").optional()}),A=H.z.object({type:H.z.literal(c.Function),handler:H.z.function()}),j=H.z.discriminatedUnion("type",[P,w,E,D,A]),R=H.z.object({event:H.z.string(),matcher:H.z.string().optional(),hooks:H.z.array(j)}),nt=H.z.record(H.z.string(),H.z.array(R)),n=H.z.string().min(1).describe("Session unique identifier"),x=H.z.string().min(1).describe("Part unique identifier"),i=H.z.string().min(1).describe("Message unique identifier"),g=H.z.string().min(1).describe("Tool call unique identifier"),m=H.z.string().optional().describe("Agent name"),f=H.z.string().optional().describe("Model identifier"),h=H.z.object({providerId:H.z.string().describe("Provider ID"),modelId:H.z.string().describe("Model ID"),api:H.z.object({id:H.z.string().describe("API ID"),npm:H.z.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),k=H.z.string().optional().describe("Working directory path"),z=H.z.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),O=H.z.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),F=H.z.object({sessionId:n,source:H.z.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:f,agent:m,cwd:k}),W=H.z.object({sessionId:n,reason:z,duration:H.z.number().positive().optional().describe("Session duration in milliseconds")}),G=H.z.object({sessionId:n,trigger:H.z.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:H.z.number().positive().describe("Current context length"),threshold:H.z.number().positive().describe("Trigger threshold")}),B=H.z.object({sessionId:n,summary:H.z.string().describe("Compaction summary"),previousLength:H.z.number().positive().describe("Previous context length"),newLength:H.z.number().positive().describe("New context length")}),L=H.z.object({sessionId:n,messageId:i,partId:x.optional().describe("step-start part ID (created by processor before hook trigger)"),userMessageId:i.optional().describe("User message ID for the current step"),model:f,agent:m}),q=H.z.object({sessionId:n,messageId:i,partId:x.optional().describe("step-finish part ID (created by processor before hook trigger)"),userMessageId:i.optional().describe("User message ID for the current step"),model:f,agent:m,finishReason:O,tokens:H.z.object({input:H.z.number().int().nonnegative().optional(),output:H.z.number().int().nonnegative().optional(),total:H.z.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),_=H.z.object({sessionId:n,reason:H.z.string().describe("Stop reason")}),U=H.z.object({sessionId:n,error:H.z.string().describe("Error message"),errorType:H.z.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),N=H.z.enum(["user","assistant","system","tool"]),C=H.z.discriminatedUnion("type",[H.z.object({type:H.z.literal("text"),text:H.z.string().describe("Text content")}),H.z.object({type:H.z.literal("image"),source:H.z.object({type:H.z.enum(["base64","url"]),mime:H.z.string().optional().describe("File mime type"),data:H.z.string().describe("File base64 encoding data or url")})}),H.z.object({type:H.z.literal("file"),url:H.z.string().describe("File path"),filename:H.z.string().describe("File name"),mime:H.z.string().optional().describe("File mime type")})]),T=H.z.object({id:i,role:N,content:H.z.union([H.z.string(),H.z.array(C)]),name:H.z.string().optional().describe("Message sender name"),tool_call_id:g.optional().describe("Related tool call ID")}),$=H.z.object({sessionId:n,agent:m,model:f,messageId:i,message:H.z.object({id:i,role:H.z.literal("user"),content:H.z.union([H.z.string(),H.z.array(C)])}).describe("User message")}),Z=H.z.object({sessionId:n,messages:H.z.array(T).describe("Messages to transform")}),V=H.z.object({sessionId:n,model:f,system:H.z.array(H.z.string()).describe("Current system prompt")}),y=H.z.record(H.z.string(),H.z.unknown()).describe("Tool call arguments"),K=H.z.object({title:H.z.string().optional().describe("Result title"),content:H.z.string().describe("Result content"),is_error:H.z.boolean().optional().describe("Is error result"),metadata:H.z.record(H.z.string(),H.z.unknown()).optional().describe("Extra metadata")}),J=H.z.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:H.z.string().describe("Tool name"),callId:g,args:y}),Q=H.z.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:H.z.string(),callId:g,args:y,result:K,duration:H.z.number().nonnegative().optional().describe("Execution duration in milliseconds")}),X=H.z.object({sessionId:n,tool:H.z.string(),callId:g,args:y,error:H.z.string().describe("Error message"),errorType:H.z.enum(["timeout","invalid_args","execution_error","permission_denied"])}),Y=H.z.object({sessionId:n,toolID:H.z.string().describe("Tool ID"),definition:H.z.object({name:H.z.string(),description:H.z.string().optional(),parameters:H.z.record(H.z.string(),H.z.unknown()).optional()}).describe("Tool definition")}),ee=H.z.object({sessionId:n,command:H.z.string().describe("Command name"),arguments:H.z.union([H.z.string(),H.z.record(H.z.string(),H.z.unknown())]).describe("Command arguments")}),te=H.z.object({sessionId:n,command:H.z.string().describe("Command name"),arguments:H.z.union([H.z.string(),H.z.record(H.z.string(),H.z.unknown())]).optional(),result:H.z.object({info:H.z.unknown().optional().describe("Message info"),parts:H.z.array(H.z.unknown()).optional().describe("Message parts"),title:H.z.string().optional().describe("Result title"),metadata:H.z.record(H.z.string(),H.z.unknown()).optional().describe("Result metadata"),output:H.z.string().optional().describe("Result output"),success:H.z.boolean().optional().describe("Whether execution succeeded"),error:H.z.string().optional().describe("Error message if failed")}).describe("Command execution result")}),oe=H.z.enum(["read","write","exec","admin"]),ne=H.z.object({tool:H.z.string().describe("Tool name requesting permission"),args:y.optional(),level:oe.optional(),reason:H.z.string().optional().describe("Reason for permission request")}),re=H.z.object({sessionId:n,request:ne}),se=H.z.object({sessionId:n,tool:H.z.string(),reason:H.z.string().optional()}),v=H.z.enum(["openai","anthropic","google","azure","custom"]),ie=H.z.object({temperature:H.z.number().min(0).max(2).optional(),topP:H.z.number().min(0).max(1).optional(),topK:H.z.number().int().positive().optional(),maxTokens:H.z.number().int().positive().optional(),stopSequences:H.z.array(H.z.string()).optional(),responseFormat:H.z.enum(["text","json_object"]).optional()}),ae=H.z.object({sessionId:n,agent:m,model:h,provider:v,params:ie.partial().optional()}),pe=H.z.object({sessionId:n,agent:m,model:h,provider:v,headers:H.z.record(H.z.string(),H.z.string()).optional()}),ce=H.z.object({cwd:k.describe("Working directory"),sessionId:n.optional(),callId:g.optional()}),me=H.z.object({sessionId:n,messageId:i,partId:H.z.string().describe("Text part ID"),text:H.z.string().describe("Completed text")}),ue=H.z.object({sessionId:n,mode:H.z.enum(["agent","chat","query"]).describe("Build mode"),providerId:H.z.string().optional()}),le=H.z.object({sessionId:n,context:H.z.object({messages:H.z.array(T),system:H.z.array(H.z.string()),metadata:H.z.record(H.z.string(),H.z.unknown())}).describe("Built context")}),de=H.z.object({gatewayID:H.z.string().describe("Gateway ID"),messageId:i,message:H.z.unknown().describe("Received message")}),ge=H.z.object({gatewayID:H.z.string(),messageId:i,message:H.z.unknown(),sessionId:n.optional()}),fe=H.z.object({gatewayID:H.z.string(),messageId:i,result:H.z.unknown().optional()}),be=H.z.object({gatewayID:H.z.string(),messageId:i,message:H.z.unknown(),target:H.z.string().optional().describe("Send target")}),ye=H.z.object({gatewayID:H.z.string(),messageId:i,sessionId:n.optional(),channel:H.z.object({platform:H.z.string(),channelId:H.z.string()}),timestamp:H.z.number().describe("Delivery timestamp")}),Se=H.z.object({gatewayID:H.z.string(),messageId:i,sessionId:n.optional(),channel:H.z.object({platform:H.z.string(),channelId:H.z.string()}),timestamp:H.z.number().describe("Read timestamp")}),Ie=H.z.object({type:H.z.literal("command"),config:H.z.object({command:H.z.string(),arguments:H.z.union([H.z.string(),H.z.record(H.z.string(),H.z.unknown())]).optional()})}),xe=H.z.object({type:H.z.literal("heartbeat"),parts:H.z.array(H.z.unknown()),system:H.z.string().optional(),config:H.z.object({session:H.z.string().optional(),mode:H.z.enum(["session","fork"]).optional(),agent:H.z.string().optional(),model:H.z.string().optional(),tools:H.z.record(H.z.string(),H.z.boolean()).optional()}).optional()}),he=H.z.object({type:H.z.literal("scheduler"),parts:H.z.array(H.z.unknown()),system:H.z.string().optional(),config:H.z.object({agentType:H.z.string().optional(),transport:H.z.enum(["stdio","http","websocket","cli"]).optional(),model:H.z.string().optional(),tools:H.z.record(H.z.string(),H.z.boolean()).optional()}).optional()}),ke=H.z.object({taskId:H.z.string().describe("Heartbeat task ID"),timestamp:H.z.number().describe("Heartbeat timestamp"),name:H.z.string().optional().describe("Heartbeat name"),definition:xe.optional()}),Ce=H.z.object({taskId:H.z.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:H.z.number(),duration:H.z.number().nonnegative().optional(),success:H.z.boolean().optional(),error:H.z.string().optional()}),Te=H.z.object({taskId:H.z.string().describe("Task ID"),taskName:H.z.string().optional(),timestamp:H.z.number(),payload:H.z.record(H.z.string(),H.z.unknown()).optional(),definition:he.optional()}),ve=H.z.object({taskId:H.z.string(),timestamp:H.z.number(),success:H.z.boolean(),result:H.z.record(H.z.string(),H.z.unknown()).optional(),error:H.z.string().optional()}),He=H.z.object({taskId:H.z.string().describe("Command task unique identifier"),taskName:H.z.string().describe("Command task name"),command:H.z.string().describe("Command name"),arguments:H.z.union([H.z.string(),H.z.record(H.z.string(),H.z.unknown())]).optional().describe("Command arguments"),timestamp:H.z.number().describe("Trigger timestamp"),definition:Ie.optional()}),Me=H.z.object({taskId:H.z.string(),timestamp:H.z.number(),success:H.z.boolean(),output:H.z.string().optional(),error:H.z.string().optional(),duration:H.z.number().describe("Execution duration in milliseconds")}),S=H.z.enum(["tool","scheduler","cli","api"]),Pe=H.z.object({taskId:H.z.string().describe("Task unique identifier"),sessionId:H.z.string().describe("Session ID for this task"),source:S.describe("Task source: tool, scheduler, cli, api"),agentType:H.z.string().describe("Agent type to execute this task"),description:H.z.string().describe("Task description"),prompt:H.z.string().describe("Task prompt content"),timeout:H.z.number().positive().optional().describe("Task timeout in milliseconds")}),we=H.z.object({taskId:H.z.string().describe("Task unique identifier"),sessionId:H.z.string().describe("Session ID for this task"),source:S.describe("Task source: tool, scheduler, cli, api")}),Ee=H.z.object({taskId:H.z.string(),sessionId:H.z.string(),source:S,step:H.z.number().describe("Current step number"),totalSteps:H.z.number().optional().describe("Total number of steps"),output:H.z.string().describe("Progress output content"),timestamp:H.z.number().describe("Progress timestamp")}),De=H.z.object({taskId:H.z.string(),sessionId:H.z.string(),source:S,result:H.z.string().describe("Task result content"),duration:H.z.number().nonnegative().describe("Task duration in milliseconds"),attachments:H.z.array(H.z.unknown()).optional().describe("Task result attachments"),error:H.z.string().optional().describe("Error message if task failed"),agentType:H.z.string().optional().describe("Agent type that executed the task"),metadata:H.z.record(H.z.string(),H.z.unknown()).optional().describe("Additional metadata for the task result")}),Ae=H.z.object({sessionId:H.z.string().describe("Session ID"),step:H.z.number().describe("Current step number"),lastUserId:H.z.string().describe("Last user message ID"),result:H.z.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),je=H.z.object({sessionId:H.z.string().describe("Session ID"),step:H.z.number().describe("Current step number"),lastUserId:H.z.string().describe("Last user message ID"),result:H.z.enum(["stop","continue"]).describe("Loop result: stop or continue")}),Re=H.z.object({requestId:H.z.string(),kind:H.z.enum(["create-skill","create-workflow","create-bundle"]),requirement:H.z.string(),hints:H.z.array(H.z.string()),origin:H.z.object({source:H.z.enum(["human","tool","scheduler","namespace"]).optional(),timestamp:H.z.number().int().nonnegative()})}),ze=H.z.object({requestId:H.z.string(),status:H.z.enum(["success","failed"]),specId:H.z.string().optional(),durationMs:H.z.number().int().nonnegative(),error:H.z.string().optional()}),Oe=H.z.object({dryRun:H.z.boolean()}),Fe=H.z.object({status:H.z.enum(["success","failed","awaiting-approval"]),applied:H.z.number().int().nonnegative().optional(),awaitingApproval:H.z.number().int().nonnegative().optional(),error:H.z.string().optional()}),I={[o.SessionStart]:F,[o.SessionEnd]:W,[o.SessionCompacting]:G,[o.SessionCompact]:B,[o.StepStart]:L,[o.StepFinish]:q,[o.StepStop]:_,[o.StepStopFailure]:U,[o.MessageReceive]:$,[o.MessageTransform]:Z,[o.SystemTransform]:V,[o.ToolBefore]:J,[o.ToolAfter]:Q,[o.ToolFailure]:X,[o.ToolDefinition]:Y,[o.CommandBefore]:ee,[o.CommandAfter]:te,[o.PermissionAsk]:re,[o.PermissionDenied]:se,[o.LlmParams]:ae,[o.LlmHeaders]:pe,[o.ShellEnv]:ce,[o.TextComplete]:me,[o.ContextBuildBefore]:ue,[o.ContextBuildAfter]:le,[o.GatewayMessageReceive]:de,[o.GatewayMessageProcess]:ge,[o.GatewayMessageComplete]:fe,[o.GatewayMessageSend]:be,[o.GatewayMessageDelivered]:ye,[o.GatewayMessageRead]:Se,[o.HeartbeatTrigger]:ke,[o.HeartbeatComplete]:Ce,[o.ScheduledTaskTrigger]:Te,[o.ScheduledTaskComplete]:ve,[o.CommandTrigger]:He,[o.CommandComplete]:Me,[o.TaskStart]:Pe,[o.TaskRunning]:we,[o.TaskProgress]:Ee,[o.TaskComplete]:De,[o.LoopStart]:Ae,[o.LoopEnd]:je,[o.CreationRequest]:Re,[o.CreationComplete]:ze,[o.EvolutionRequest]:Oe,[o.EvolutionComplete]:Fe};function rt(r){return I[r]}function st(r,l){let d=I[r];if(!d)throw new Error(`No schema found for event: ${r}`);return d.parse(l)}function it(r,l){let d=I[r];return d?d.safeParse(l):{success:false,error:new H.z.ZodError([{code:"custom",path:[],message:`No schema found for event: ${r}`}])}}var ft=H.z.enum(["command","mcp","skill"]).describe("Command source"),We=H.z.union([H.z.string(),H.z.record(H.z.string(),H.z.unknown())]).describe("Command arguments"),Ge=H.z.discriminatedUnion("type",[H.z.object({type:H.z.literal("text"),text:H.z.string().describe("Text content")}),H.z.object({type:H.z.literal("image"),source:H.z.object({type:H.z.enum(["base64","url"]),mime:H.z.string().describe("File mime type"),data:H.z.string().describe("File base64 encoding data or url")})}),H.z.object({type:H.z.literal("file"),url:H.z.string().describe("File path"),filename:H.z.string().describe("File name"),mime:H.z.string().optional().describe("File mime type")})]),bt=H.z.object({name:H.z.string().describe("Command name"),description:H.z.string().describe("Command description"),scope:H.z.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:H.z.string().optional().describe("Specified agent name"),model:H.z.string().optional().describe("Specified model"),hints:H.z.array(H.z.string()).optional().describe("Argument hints"),commandType:H.z.enum(["prompt","local"]).optional().describe("Command type"),hidden:H.z.boolean().optional().describe("Whether hidden")}),yt=H.z.object({sessionId:H.z.string().describe("Session ID"),directory:H.z.string().describe("Working directory"),model:H.z.string().optional().describe("Model identifier"),agent:H.z.string().optional().describe("Agent name"),arguments:We.describe("Command arguments")}),Be=H.z.record(H.z.string(),H.z.unknown()).describe("Result metadata"),St=H.z.object({title:H.z.string().describe("Result title"),metadata:Be.describe("Result metadata"),output:H.z.string().describe("Result output"),parts:H.z.array(Ge).optional().describe("Result parts"),success:H.z.boolean().describe("Whether execution succeeded"),error:H.z.string().optional().describe("Error message if failed")}),It=H.z.object({agent:H.z.object({name:H.z.string().describe("Agent name"),model:H.z.string().optional().describe("Agent model")}).optional().describe("Agent context")}),xt=H.z.object({isEnabled:H.z.boolean().optional().describe("Is enabled check result")});var qe=H.z.enum(["subagent","primary","all"]),_e=H.z.enum(["general","coder","all"]),Ue=H.z.object({providerId:H.z.string().min(1).describe("Model provider ID"),modelId:H.z.string().min(1).describe("Model ID")}),Et=H.z.object({name:H.z.string().min(1).describe("Unique agent name"),description:H.z.string().optional().describe("When to use this agent"),mode:qe.optional().describe("Agent mode"),hidden:H.z.boolean().optional().describe("Hide from @ autocomplete menu"),scope:_e.optional().describe("Agent scope (general / coder / all)"),model:Ue.optional().describe("Default model"),variant:H.z.string().optional().describe("Default model variant"),temperature:H.z.number().min(0).max(2).optional().describe("Sampling temperature"),topP:H.z.number().min(0).max(1).optional().describe("Top-p sampling"),prompt:H.z.string().optional().describe("System prompt"),permission:types.AgentPermissionSchema.optional().describe("Tool permissions"),steps:H.z.number().int().positive().optional().describe("Maximum execution steps"),color:H.z.union([H.z.string().regex(/^#[0-9a-fA-F]{6}$/),H.z.enum(["primary","secondary","accent","success","warning","error","info"])]).optional().describe("UI color (hex code or theme name)"),options:H.z.record(H.z.string(),H.z.unknown()).optional().describe("Additional options")}).meta({ref:"PluginAgent"});var Ft=H.z.object({name:H.z.string().min(1).describe("Unique skill name"),description:H.z.string().min(1).describe("When to use this skill"),scope:H.z.enum(["general","coder","all"]).optional().describe("Context mode scope")}),Wt=H.z.object({agent:H.z.object({name:H.z.string().describe("Agent name"),model:H.z.string().optional().describe("Agent model")}).optional().describe("Agent context")}),Gt=H.z.object({isEnabled:H.z.boolean().optional().describe("Is enabled check result")});var u=new Map;function $t(r){if(u.has(r.id))throw new Error(`Marketplace with id "${r.id}" already registered`);u.set(r.id,r);}function Zt(r){return u.delete(r)}function Vt(){return Array.from(u.values()).map(r=>r)}function Kt(r){return u.get(r)??null}function Jt(r){return Array.from(u.values()).filter(l=>l.category===r)}Object.defineProperty(exports,"AgentPermissionSchema",{enumerable:true,get:function(){return types.AgentPermissionSchema}});Object.defineProperty(exports,"PermissionActionSchema",{enumerable:true,get:function(){return types.PermissionActionSchema}});Object.defineProperty(exports,"PermissionRuleSchema",{enumerable:true,get:function(){return types.PermissionRuleSchema}});Object.defineProperty(exports,"buildToolArgs",{enumerable:true,get:function(){return types.buildToolArgs}});Object.defineProperty(exports,"createTool",{enumerable:true,get:function(){return types.createTool}});Object.defineProperty(exports,"schema",{enumerable:true,get:function(){return types.toolSchema}});exports.AgentExecutorSchema=D;exports.AgentMetadataSchema=Et;exports.AgentModeSchema=qe;exports.AgentModelSchema=Ue;exports.AgentSchema=m;exports.AgentScopeSchema=_e;exports.CallIDSchema=g;exports.CommandAfterInputSchema=te;exports.CommandArgumentsSchema=We;exports.CommandBeforeInputSchema=ee;exports.CommandCompleteInputSchema=Me;exports.CommandExecuteResultMetadataSchema=Be;exports.CommandExecuteResultSchema=St;exports.CommandExecutionContextSchema=yt;exports.CommandExecutorSchema=P;exports.CommandInitContextSchema=It;exports.CommandInitResultSchema=xt;exports.CommandMetadataSchema=bt;exports.CommandPromptPartSchema=Ge;exports.CommandSourceSchema=ft;exports.CommandTaskDefinitionSchema=Ie;exports.CommandTriggerInputSchema=He;exports.ContentPartSchema=C;exports.ContextBuildAfterInputSchema=le;exports.ContextBuildBeforeInputSchema=ue;exports.CreationCompleteInputSchema=ze;exports.CreationRequestInputSchema=Re;exports.CwdSchema=k;exports.EndReasonSchema=z;exports.EventInputSchemas=I;exports.EvolutionCompleteInputSchema=Fe;exports.EvolutionRequestInputSchema=Oe;exports.FinishReasonSchema=O;exports.FunctionExecutorSchema=A;exports.GatewayMessageCompleteInputSchema=fe;exports.GatewayMessageDeliveredInputSchema=ye;exports.GatewayMessageProcessInputSchema=ge;exports.GatewayMessageReadInputSchema=Se;exports.GatewayMessageReceiveInputSchema=de;exports.GatewayMessageSendInputSchema=be;exports.HOOK_EVENTS=Xe;exports.HeartbeatCompleteInputSchema=Ce;exports.HeartbeatTaskDefinitionSchema=xe;exports.HeartbeatTriggerInputSchema=ke;exports.HookEvent=o;exports.HookExecutorSchema=j;exports.HookMatcherSchema=R;exports.HookType=c;exports.HooksConfigSchema=nt;exports.HttpExecutorSchema=E;exports.LlmHeadersInputSchema=pe;exports.LlmParamsInputSchema=ae;exports.LlmParamsSchema=ie;exports.LlmProviderSchema=v;exports.LoopEndInputSchema=je;exports.LoopStartInputSchema=Ae;exports.MessageIDSchema=i;exports.MessageReceiveInputSchema=$;exports.MessageRoleSchema=N;exports.MessageSchema=T;exports.MessageTransformInputSchema=Z;exports.ModelObjectSchema=h;exports.ModelSchema=f;exports.PartIDSchema=x;exports.PermissionAskInputSchema=re;exports.PermissionDeniedInputSchema=se;exports.PermissionLevelSchema=oe;exports.PermissionRequestSchema=ne;exports.PromptExecutorSchema=w;exports.ScheduledTaskCompleteInputSchema=ve;exports.ScheduledTaskTriggerInputSchema=Te;exports.SchedulerTaskDefinitionSchema=he;exports.SessionCompactInputSchema=B;exports.SessionCompactingInputSchema=G;exports.SessionEndInputSchema=W;exports.SessionIDSchema=n;exports.SessionStartInputSchema=F;exports.ShellEnvInputSchema=ce;exports.SkillInitContextSchema=Wt;exports.SkillInitResultSchema=Gt;exports.SkillMetadataSchema=Ft;exports.StepFinishInputSchema=q;exports.StepStartInputSchema=L;exports.StepStopFailureInputSchema=U;exports.StepStopInputSchema=_;exports.SystemTransformInputSchema=V;exports.TaskCompleteInputSchema=De;exports.TaskProgressInputSchema=Ee;exports.TaskRunningInputSchema=we;exports.TaskSourceSchema=S;exports.TaskStartInputSchema=Pe;exports.TextCompleteInputSchema=me;exports.ToolAfterInputSchema=Q;exports.ToolArgsSchema=y;exports.ToolBeforeInputSchema=J;exports.ToolDefinitionInputSchema=Y;exports.ToolFailureInputSchema=X;exports.ToolResultSchema=K;exports.findMarketplace=Kt;exports.findMarketplacesByCategory=Jt;exports.getEventInputSchema=rt;exports.listMarketplaces=Vt;exports.registerMarketplace=$t;exports.safeValidateHookInput=it;exports.tool=M;exports.unregisterMarketplace=Zt;exports.validateHookInput=st;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command, Auth, Provider, createEasbotClient, Project, Event, Config } from '@easbot/sdk';
|
|
2
|
+
import * as _easbot_types from '@easbot/types';
|
|
2
3
|
import { ToolContext, EasbotShell, ToolDefinition } from '@easbot/types';
|
|
3
4
|
export { AgentPermission, AgentPermissionSchema, AskInput, EasbotShell, EasbotShellError, EasbotShellOutput, EasbotShellPromise, PermissionActionSchema, PermissionRuleSchema, ShellExpression, ShellFunction, ToolContext, ToolDefinition, ToolFunction as ToolFn, ToolFunction, buildToolArgs, createTool, toolSchema as schema } from '@easbot/types';
|
|
4
5
|
import z, { z as z$1 } from 'zod';
|
|
@@ -16,116 +17,6 @@ declare namespace tool {
|
|
|
16
17
|
var schema: typeof z;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
declare const HookType: {
|
|
20
|
-
readonly Command: "command";
|
|
21
|
-
readonly Prompt: "prompt";
|
|
22
|
-
readonly Http: "http";
|
|
23
|
-
readonly Agent: "agent";
|
|
24
|
-
readonly Function: "function";
|
|
25
|
-
};
|
|
26
|
-
type HookType = (typeof HookType)[keyof typeof HookType];
|
|
27
|
-
declare const HookEvent: {
|
|
28
|
-
readonly SessionStart: "session.start";
|
|
29
|
-
readonly SessionEnd: "session.end";
|
|
30
|
-
readonly SessionCompacting: "session.compacting";
|
|
31
|
-
readonly SessionCompact: "session.compact";
|
|
32
|
-
readonly StepStart: "step.start";
|
|
33
|
-
readonly StepFinish: "step.finish";
|
|
34
|
-
readonly StepStop: "step.stop";
|
|
35
|
-
readonly StepStopFailure: "step.stop.failure";
|
|
36
|
-
readonly MessageReceive: "message.receive";
|
|
37
|
-
readonly MessageTransform: "message.transform";
|
|
38
|
-
readonly SystemTransform: "system.transform";
|
|
39
|
-
readonly ToolBefore: "tool.before";
|
|
40
|
-
readonly ToolAfter: "tool.after";
|
|
41
|
-
readonly ToolFailure: "tool.failure";
|
|
42
|
-
readonly ToolDefinition: "tool.definition";
|
|
43
|
-
readonly CommandBefore: "command.before";
|
|
44
|
-
readonly CommandAfter: "command.after";
|
|
45
|
-
readonly PermissionAsk: "permission.ask";
|
|
46
|
-
readonly PermissionDenied: "permission.denied";
|
|
47
|
-
readonly LlmParams: "llm.params";
|
|
48
|
-
readonly LlmHeaders: "llm.headers";
|
|
49
|
-
readonly ShellEnv: "shell.env";
|
|
50
|
-
readonly TextComplete: "text.complete";
|
|
51
|
-
readonly GatewayMessageReceive: "gateway.message.receive";
|
|
52
|
-
readonly GatewayMessageProcess: "gateway.message.process";
|
|
53
|
-
readonly GatewayMessageComplete: "gateway.message.complete";
|
|
54
|
-
readonly GatewayMessageSend: "gateway.message.send";
|
|
55
|
-
readonly GatewayMessageDelivered: "gateway.message.delivered";
|
|
56
|
-
readonly GatewayMessageRead: "gateway.message.read";
|
|
57
|
-
readonly HeartbeatTrigger: "scheduler.heartbeat.trigger";
|
|
58
|
-
readonly HeartbeatComplete: "scheduler.heartbeat.complete";
|
|
59
|
-
readonly ScheduledTaskTrigger: "scheduler.task.trigger";
|
|
60
|
-
readonly ScheduledTaskComplete: "scheduler.task.complete";
|
|
61
|
-
readonly CommandTrigger: "scheduler.command.trigger";
|
|
62
|
-
readonly CommandComplete: "scheduler.command.complete";
|
|
63
|
-
readonly ContextBuildBefore: "context.build.before";
|
|
64
|
-
readonly ContextBuildAfter: "context.build.after";
|
|
65
|
-
readonly TaskStart: "task.start";
|
|
66
|
-
readonly TaskRunning: "task.running";
|
|
67
|
-
readonly TaskProgress: "task.progress";
|
|
68
|
-
readonly TaskComplete: "task.complete";
|
|
69
|
-
readonly LoopStart: "loop.start";
|
|
70
|
-
readonly LoopEnd: "loop.end";
|
|
71
|
-
readonly CreationRequest: "creation.request";
|
|
72
|
-
readonly CreationComplete: "creation.complete";
|
|
73
|
-
readonly EvolutionRequest: "evolution.request";
|
|
74
|
-
readonly EvolutionComplete: "evolution.complete";
|
|
75
|
-
};
|
|
76
|
-
type HookEvent = (typeof HookEvent)[keyof typeof HookEvent];
|
|
77
|
-
declare const HOOK_EVENTS: ("session.start" | "session.end" | "session.compacting" | "session.compact" | "step.start" | "step.finish" | "step.stop" | "step.stop.failure" | "message.receive" | "message.transform" | "system.transform" | "tool.before" | "tool.after" | "tool.failure" | "tool.definition" | "command.before" | "command.after" | "permission.ask" | "permission.denied" | "llm.params" | "llm.headers" | "shell.env" | "text.complete" | "gateway.message.receive" | "gateway.message.process" | "gateway.message.complete" | "gateway.message.send" | "gateway.message.delivered" | "gateway.message.read" | "scheduler.heartbeat.trigger" | "scheduler.heartbeat.complete" | "scheduler.task.trigger" | "scheduler.task.complete" | "scheduler.command.trigger" | "scheduler.command.complete" | "context.build.before" | "context.build.after" | "task.start" | "task.running" | "task.progress" | "task.complete" | "loop.start" | "loop.end" | "creation.request" | "creation.complete" | "evolution.request" | "evolution.complete")[];
|
|
78
|
-
interface HookContext {
|
|
79
|
-
sessionId?: string;
|
|
80
|
-
agent?: string;
|
|
81
|
-
model?: string;
|
|
82
|
-
cwd?: string;
|
|
83
|
-
abort?: AbortSignal;
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
}
|
|
86
|
-
interface HookOutputWrapper<T = unknown> {
|
|
87
|
-
modified: boolean;
|
|
88
|
-
input: T;
|
|
89
|
-
output?: Record<string, unknown>;
|
|
90
|
-
}
|
|
91
|
-
type HookHandler<T = unknown> = (input: T, context: HookContext) => Promise<HookOutputWrapper<T>> | HookOutputWrapper<T>;
|
|
92
|
-
interface HookResult {
|
|
93
|
-
success?: boolean;
|
|
94
|
-
skipped?: boolean;
|
|
95
|
-
output?: unknown;
|
|
96
|
-
error?: string;
|
|
97
|
-
stdout?: string;
|
|
98
|
-
stderr?: string;
|
|
99
|
-
exitCode?: number;
|
|
100
|
-
duration?: number;
|
|
101
|
-
}
|
|
102
|
-
interface HookExecutionDetail {
|
|
103
|
-
index: number;
|
|
104
|
-
hookType: string;
|
|
105
|
-
hookName: string;
|
|
106
|
-
matched: boolean;
|
|
107
|
-
skipped: boolean;
|
|
108
|
-
success: boolean;
|
|
109
|
-
modified: boolean;
|
|
110
|
-
duration: number;
|
|
111
|
-
output?: unknown;
|
|
112
|
-
}
|
|
113
|
-
interface HookError {
|
|
114
|
-
index: number;
|
|
115
|
-
hookName: string;
|
|
116
|
-
error: string;
|
|
117
|
-
stack?: string;
|
|
118
|
-
}
|
|
119
|
-
interface HookChainResult<T = unknown> {
|
|
120
|
-
success: boolean;
|
|
121
|
-
output: T;
|
|
122
|
-
modified: boolean;
|
|
123
|
-
aborted: boolean;
|
|
124
|
-
details: HookExecutionDetail[];
|
|
125
|
-
errors: HookError[];
|
|
126
|
-
duration: number;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
20
|
declare const CommandExecutorSchema: z$1.ZodObject<{
|
|
130
21
|
type: z$1.ZodLiteral<"command">;
|
|
131
22
|
command: z$1.ZodString;
|
|
@@ -140,6 +31,7 @@ declare const CommandExecutorSchema: z$1.ZodObject<{
|
|
|
140
31
|
async: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
141
32
|
}, z$1.core.$strip>;
|
|
142
33
|
type CommandHookDefinition = z$1.infer<typeof CommandExecutorSchema>;
|
|
34
|
+
type HookMessageCallback = (message: Record<string, unknown>) => void | Promise<void>;
|
|
143
35
|
declare const PromptExecutorSchema: z$1.ZodObject<{
|
|
144
36
|
type: z$1.ZodLiteral<"prompt">;
|
|
145
37
|
if: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -153,8 +45,11 @@ declare const PromptExecutorSchema: z$1.ZodObject<{
|
|
|
153
45
|
}>>;
|
|
154
46
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
155
47
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
48
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
156
49
|
}, z$1.core.$strip>;
|
|
157
|
-
type PromptHookDefinition = z$1.infer<typeof PromptExecutorSchema
|
|
50
|
+
type PromptHookDefinition = Omit<z$1.infer<typeof PromptExecutorSchema>, 'onMessage'> & {
|
|
51
|
+
onMessage?: HookMessageCallback;
|
|
52
|
+
};
|
|
158
53
|
declare const HttpExecutorSchema: z$1.ZodObject<{
|
|
159
54
|
type: z$1.ZodLiteral<"http">;
|
|
160
55
|
url: z$1.ZodString;
|
|
@@ -182,8 +77,11 @@ declare const AgentExecutorSchema: z$1.ZodObject<{
|
|
|
182
77
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
183
78
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
184
79
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
80
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
185
81
|
}, z$1.core.$strip>;
|
|
186
|
-
type AgentHookDefinition = z$1.infer<typeof AgentExecutorSchema
|
|
82
|
+
type AgentHookDefinition = Omit<z$1.infer<typeof AgentExecutorSchema>, 'onMessage'> & {
|
|
83
|
+
onMessage?: HookMessageCallback;
|
|
84
|
+
};
|
|
187
85
|
declare const FunctionExecutorSchema: z$1.ZodObject<{
|
|
188
86
|
type: z$1.ZodLiteral<"function">;
|
|
189
87
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -214,6 +112,7 @@ declare const HookExecutorSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
214
112
|
}>>;
|
|
215
113
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
216
114
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
115
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
217
116
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
218
117
|
type: z$1.ZodLiteral<"http">;
|
|
219
118
|
url: z$1.ZodString;
|
|
@@ -239,6 +138,7 @@ declare const HookExecutorSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
239
138
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
240
139
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
241
140
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
141
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
242
142
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
243
143
|
type: z$1.ZodLiteral<"function">;
|
|
244
144
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -272,6 +172,7 @@ declare const HookMatcherSchema: z$1.ZodObject<{
|
|
|
272
172
|
}>>;
|
|
273
173
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
274
174
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
175
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
275
176
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
276
177
|
type: z$1.ZodLiteral<"http">;
|
|
277
178
|
url: z$1.ZodString;
|
|
@@ -297,6 +198,7 @@ declare const HookMatcherSchema: z$1.ZodObject<{
|
|
|
297
198
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
298
199
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
299
200
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
201
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
300
202
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
301
203
|
type: z$1.ZodLiteral<"function">;
|
|
302
204
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -331,6 +233,7 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
331
233
|
}>>;
|
|
332
234
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
333
235
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
236
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
334
237
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
335
238
|
type: z$1.ZodLiteral<"http">;
|
|
336
239
|
url: z$1.ZodString;
|
|
@@ -356,6 +259,7 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
356
259
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
357
260
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
358
261
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
262
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
359
263
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
360
264
|
type: z$1.ZodLiteral<"function">;
|
|
361
265
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -363,6 +267,7 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
363
267
|
}, z$1.core.$strip>>>;
|
|
364
268
|
type HooksConfig = z$1.infer<typeof HooksConfigSchema>;
|
|
365
269
|
declare const SessionIDSchema: z$1.ZodString;
|
|
270
|
+
declare const PartIDSchema: z$1.ZodString;
|
|
366
271
|
declare const MessageIDSchema: z$1.ZodString;
|
|
367
272
|
declare const CallIDSchema: z$1.ZodString;
|
|
368
273
|
declare const AgentSchema: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -437,6 +342,7 @@ type SessionCompactInput = z$1.infer<typeof SessionCompactInputSchema>;
|
|
|
437
342
|
declare const StepStartInputSchema: z$1.ZodObject<{
|
|
438
343
|
sessionId: z$1.ZodString;
|
|
439
344
|
messageId: z$1.ZodString;
|
|
345
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
440
346
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
441
347
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
442
348
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -445,6 +351,7 @@ type StepStartInput = z$1.infer<typeof StepStartInputSchema>;
|
|
|
445
351
|
declare const StepFinishInputSchema: z$1.ZodObject<{
|
|
446
352
|
sessionId: z$1.ZodString;
|
|
447
353
|
messageId: z$1.ZodString;
|
|
354
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
448
355
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
449
356
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
450
357
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -1199,6 +1106,7 @@ declare const EventInputSchemas: {
|
|
|
1199
1106
|
readonly "step.start": z$1.ZodObject<{
|
|
1200
1107
|
sessionId: z$1.ZodString;
|
|
1201
1108
|
messageId: z$1.ZodString;
|
|
1109
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1202
1110
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1203
1111
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1204
1112
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -1206,6 +1114,7 @@ declare const EventInputSchemas: {
|
|
|
1206
1114
|
readonly "step.finish": z$1.ZodObject<{
|
|
1207
1115
|
sessionId: z$1.ZodString;
|
|
1208
1116
|
messageId: z$1.ZodString;
|
|
1117
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1209
1118
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1210
1119
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1211
1120
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -1773,12 +1682,14 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1773
1682
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1774
1683
|
sessionId: z$1.ZodString;
|
|
1775
1684
|
messageId: z$1.ZodString;
|
|
1685
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1776
1686
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1777
1687
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1778
1688
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1779
1689
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1780
1690
|
sessionId: z$1.ZodString;
|
|
1781
1691
|
messageId: z$1.ZodString;
|
|
1692
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1782
1693
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1783
1694
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1784
1695
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -2264,6 +2175,151 @@ declare function safeValidateHookInput<T extends HookEvent>(event: T, input: unk
|
|
|
2264
2175
|
error: z$1.ZodError;
|
|
2265
2176
|
};
|
|
2266
2177
|
|
|
2178
|
+
declare const HookType: {
|
|
2179
|
+
readonly Command: "command";
|
|
2180
|
+
readonly Prompt: "prompt";
|
|
2181
|
+
readonly Http: "http";
|
|
2182
|
+
readonly Agent: "agent";
|
|
2183
|
+
readonly Function: "function";
|
|
2184
|
+
};
|
|
2185
|
+
type HookType = (typeof HookType)[keyof typeof HookType];
|
|
2186
|
+
declare const HookEvent: {
|
|
2187
|
+
readonly SessionStart: "session.start";
|
|
2188
|
+
readonly SessionEnd: "session.end";
|
|
2189
|
+
readonly SessionCompacting: "session.compacting";
|
|
2190
|
+
readonly SessionCompact: "session.compact";
|
|
2191
|
+
readonly StepStart: "step.start";
|
|
2192
|
+
readonly StepFinish: "step.finish";
|
|
2193
|
+
readonly StepStop: "step.stop";
|
|
2194
|
+
readonly StepStopFailure: "step.stop.failure";
|
|
2195
|
+
readonly MessageReceive: "message.receive";
|
|
2196
|
+
readonly MessageTransform: "message.transform";
|
|
2197
|
+
readonly SystemTransform: "system.transform";
|
|
2198
|
+
readonly ToolBefore: "tool.before";
|
|
2199
|
+
readonly ToolAfter: "tool.after";
|
|
2200
|
+
readonly ToolFailure: "tool.failure";
|
|
2201
|
+
readonly ToolDefinition: "tool.definition";
|
|
2202
|
+
readonly CommandBefore: "command.before";
|
|
2203
|
+
readonly CommandAfter: "command.after";
|
|
2204
|
+
readonly PermissionAsk: "permission.ask";
|
|
2205
|
+
readonly PermissionDenied: "permission.denied";
|
|
2206
|
+
readonly LlmParams: "llm.params";
|
|
2207
|
+
readonly LlmHeaders: "llm.headers";
|
|
2208
|
+
readonly ShellEnv: "shell.env";
|
|
2209
|
+
readonly TextComplete: "text.complete";
|
|
2210
|
+
readonly GatewayMessageReceive: "gateway.message.receive";
|
|
2211
|
+
readonly GatewayMessageProcess: "gateway.message.process";
|
|
2212
|
+
readonly GatewayMessageComplete: "gateway.message.complete";
|
|
2213
|
+
readonly GatewayMessageSend: "gateway.message.send";
|
|
2214
|
+
readonly GatewayMessageDelivered: "gateway.message.delivered";
|
|
2215
|
+
readonly GatewayMessageRead: "gateway.message.read";
|
|
2216
|
+
readonly HeartbeatTrigger: "scheduler.heartbeat.trigger";
|
|
2217
|
+
readonly HeartbeatComplete: "scheduler.heartbeat.complete";
|
|
2218
|
+
readonly ScheduledTaskTrigger: "scheduler.task.trigger";
|
|
2219
|
+
readonly ScheduledTaskComplete: "scheduler.task.complete";
|
|
2220
|
+
readonly CommandTrigger: "scheduler.command.trigger";
|
|
2221
|
+
readonly CommandComplete: "scheduler.command.complete";
|
|
2222
|
+
readonly ContextBuildBefore: "context.build.before";
|
|
2223
|
+
readonly ContextBuildAfter: "context.build.after";
|
|
2224
|
+
readonly TaskStart: "task.start";
|
|
2225
|
+
readonly TaskRunning: "task.running";
|
|
2226
|
+
readonly TaskProgress: "task.progress";
|
|
2227
|
+
readonly TaskComplete: "task.complete";
|
|
2228
|
+
readonly LoopStart: "loop.start";
|
|
2229
|
+
readonly LoopEnd: "loop.end";
|
|
2230
|
+
readonly CreationRequest: "creation.request";
|
|
2231
|
+
readonly CreationComplete: "creation.complete";
|
|
2232
|
+
readonly EvolutionRequest: "evolution.request";
|
|
2233
|
+
readonly EvolutionComplete: "evolution.complete";
|
|
2234
|
+
};
|
|
2235
|
+
type HookEvent = (typeof HookEvent)[keyof typeof HookEvent];
|
|
2236
|
+
declare const HOOK_EVENTS: ("session.start" | "session.end" | "session.compacting" | "session.compact" | "step.start" | "step.finish" | "step.stop" | "step.stop.failure" | "message.receive" | "message.transform" | "system.transform" | "tool.before" | "tool.after" | "tool.failure" | "tool.definition" | "command.before" | "command.after" | "permission.ask" | "permission.denied" | "llm.params" | "llm.headers" | "shell.env" | "text.complete" | "gateway.message.receive" | "gateway.message.process" | "gateway.message.complete" | "gateway.message.send" | "gateway.message.delivered" | "gateway.message.read" | "scheduler.heartbeat.trigger" | "scheduler.heartbeat.complete" | "scheduler.task.trigger" | "scheduler.task.complete" | "scheduler.command.trigger" | "scheduler.command.complete" | "context.build.before" | "context.build.after" | "task.start" | "task.running" | "task.progress" | "task.complete" | "loop.start" | "loop.end" | "creation.request" | "creation.complete" | "evolution.request" | "evolution.complete")[];
|
|
2237
|
+
interface HookContext {
|
|
2238
|
+
sessionId?: string;
|
|
2239
|
+
agent?: string;
|
|
2240
|
+
model?: string;
|
|
2241
|
+
cwd?: string;
|
|
2242
|
+
abort?: AbortSignal;
|
|
2243
|
+
[key: string]: unknown;
|
|
2244
|
+
}
|
|
2245
|
+
interface HookOutputWrapper<T = unknown> {
|
|
2246
|
+
modified: boolean;
|
|
2247
|
+
input: T;
|
|
2248
|
+
output?: Record<string, unknown>;
|
|
2249
|
+
}
|
|
2250
|
+
type HookHandler<T = unknown> = (input: T, context: HookContext) => Promise<HookOutputWrapper<T>> | HookOutputWrapper<T>;
|
|
2251
|
+
interface HookResult {
|
|
2252
|
+
success?: boolean;
|
|
2253
|
+
skipped?: boolean;
|
|
2254
|
+
output?: unknown;
|
|
2255
|
+
error?: string;
|
|
2256
|
+
stdout?: string;
|
|
2257
|
+
stderr?: string;
|
|
2258
|
+
exitCode?: number;
|
|
2259
|
+
duration?: number;
|
|
2260
|
+
}
|
|
2261
|
+
interface HookExecutor {
|
|
2262
|
+
readonly type: string;
|
|
2263
|
+
canExecute(hook: unknown): boolean;
|
|
2264
|
+
execute(definition: HookDefinition, input: HookOutputWrapper, context?: HookContext): Promise<HookExecutorOutput>;
|
|
2265
|
+
}
|
|
2266
|
+
interface HookExecutorOutput {
|
|
2267
|
+
success: boolean;
|
|
2268
|
+
modified: boolean;
|
|
2269
|
+
input?: unknown;
|
|
2270
|
+
output?: unknown;
|
|
2271
|
+
error?: string;
|
|
2272
|
+
stdout?: string;
|
|
2273
|
+
stderr?: string;
|
|
2274
|
+
exitCode?: number;
|
|
2275
|
+
duration?: number;
|
|
2276
|
+
metadata?: Record<string, unknown>;
|
|
2277
|
+
}
|
|
2278
|
+
interface HookExecutorRegistry {
|
|
2279
|
+
register(executor: HookExecutor): void;
|
|
2280
|
+
getExecutor(definition: HookDefinition): HookExecutor | undefined;
|
|
2281
|
+
execute(definition: HookDefinition, input: HookOutputWrapper, context?: HookContext): Promise<HookExecutorOutput>;
|
|
2282
|
+
}
|
|
2283
|
+
interface HookExecutionDetail {
|
|
2284
|
+
index: number;
|
|
2285
|
+
hookType: string;
|
|
2286
|
+
hookName: string;
|
|
2287
|
+
matched: boolean;
|
|
2288
|
+
skipped: boolean;
|
|
2289
|
+
success: boolean;
|
|
2290
|
+
modified: boolean;
|
|
2291
|
+
duration: number;
|
|
2292
|
+
output?: unknown;
|
|
2293
|
+
}
|
|
2294
|
+
interface HookError {
|
|
2295
|
+
index: number;
|
|
2296
|
+
hookName: string;
|
|
2297
|
+
error: string;
|
|
2298
|
+
stack?: string;
|
|
2299
|
+
}
|
|
2300
|
+
interface HookChainResult<T = unknown> {
|
|
2301
|
+
success: boolean;
|
|
2302
|
+
output: T;
|
|
2303
|
+
modified: boolean;
|
|
2304
|
+
aborted: boolean;
|
|
2305
|
+
details: HookExecutionDetail[];
|
|
2306
|
+
errors: HookError[];
|
|
2307
|
+
duration: number;
|
|
2308
|
+
}
|
|
2309
|
+
interface HookInfo {
|
|
2310
|
+
name: string;
|
|
2311
|
+
init(): Promise<HookInitResult>;
|
|
2312
|
+
dispose?: () => Promise<void> | void;
|
|
2313
|
+
}
|
|
2314
|
+
type HookInitResult = {
|
|
2315
|
+
scope?: _easbot_types.Scope;
|
|
2316
|
+
isEnabled?: () => boolean | Promise<boolean>;
|
|
2317
|
+
handlers: Array<{
|
|
2318
|
+
name: HookEvent;
|
|
2319
|
+
handler: HookHandler<unknown>;
|
|
2320
|
+
}>;
|
|
2321
|
+
};
|
|
2322
|
+
|
|
2267
2323
|
declare const CommandSourceSchema: z$1.ZodEnum<{
|
|
2268
2324
|
command: "command";
|
|
2269
2325
|
mcp: "mcp";
|
|
@@ -2794,4 +2850,4 @@ interface PluginDefinition {
|
|
|
2794
2850
|
'context.build.after'?: (input: ContextBuildAfterInput, output: HookOutputWrapper<ContextBuildAfterInput>) => Promise<void>;
|
|
2795
2851
|
}
|
|
2796
2852
|
|
|
2797
|
-
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, type AgentModel, AgentModelSchema, AgentSchema, type AgentScope, AgentScopeSchema, type AuthHook, type AuthOuathResult, CallIDSchema, type CommandAfterInput, CommandAfterInputSchema, type CommandArguments, CommandArgumentsSchema, type CommandBeforeInput, CommandBeforeInputSchema, type CommandCompleteInput, CommandCompleteInputSchema, type CommandDefinition, type CommandExecuteResult, type CommandExecuteResultMetadata, CommandExecuteResultMetadataSchema, CommandExecuteResultSchema, type CommandExecutionContext, CommandExecutionContextSchema, CommandExecutorSchema, type CommandHookDefinition, type CommandInitContext, CommandInitContextSchema, type CommandInitResult, CommandInitResultSchema, type CommandMetadata, CommandMetadataSchema, type CommandPromptPart, CommandPromptPartSchema, type CommandSource, CommandSourceSchema, type CommandTaskDefinition, CommandTaskDefinitionSchema, type CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, type CreationCompleteInput, CreationCompleteInputSchema, type CreationRequestInput, CreationRequestInputSchema, CwdSchema, 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, HookExecutorSchema, type HookHandler, type HookMatcher, HookMatcherSchema, 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 MarketplaceCategory, type MarketplaceDefinition, type MarketplaceEntry, MessageIDSchema, type MessageReceiveInput, MessageReceiveInputSchema, MessageRoleSchema, MessageSchema, type MessageTransformInput, MessageTransformInputSchema, ModelObjectSchema, ModelSchema, type PermissionAskInput, PermissionAskInputSchema, type PermissionDeniedInput, PermissionDeniedInputSchema, PermissionLevelSchema, PermissionRequestSchema, type Plugin, type PluginDefinition, type PluginInput, PromptExecutorSchema, type PromptHookDefinition, type ScheduledTaskCompleteInput, ScheduledTaskCompleteInputSchema, type ScheduledTaskTriggerInput, ScheduledTaskTriggerInputSchema, type SchedulerTaskDefinition, SchedulerTaskDefinitionSchema, 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 SkillScope, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type StoreSourceType, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, type TaskDefinition, type TaskProgressInput, TaskProgressInputSchema, type TaskRunningInput, TaskRunningInputSchema, type TaskSource, TaskSourceSchema, type TaskStartInput, TaskStartInputSchema, type TextCompleteInput, TextCompleteInputSchema, type ToolAfterInput, ToolAfterInputSchema, ToolArgsSchema, type ToolBeforeInput, ToolBeforeInputSchema, type ToolDefinitionInput, ToolDefinitionInputSchema, type ToolFailureInput, ToolFailureInputSchema, ToolResultSchema, findMarketplace, findMarketplacesByCategory, getEventInputSchema, listMarketplaces, registerMarketplace, safeValidateHookInput, tool, unregisterMarketplace, validateHookInput };
|
|
2853
|
+
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, type AgentModel, AgentModelSchema, AgentSchema, type AgentScope, AgentScopeSchema, type AuthHook, type AuthOuathResult, CallIDSchema, type CommandAfterInput, CommandAfterInputSchema, type CommandArguments, CommandArgumentsSchema, type CommandBeforeInput, CommandBeforeInputSchema, type CommandCompleteInput, CommandCompleteInputSchema, type CommandDefinition, type CommandExecuteResult, type CommandExecuteResultMetadata, CommandExecuteResultMetadataSchema, CommandExecuteResultSchema, type CommandExecutionContext, CommandExecutionContextSchema, CommandExecutorSchema, type CommandHookDefinition, type CommandInitContext, CommandInitContextSchema, type CommandInitResult, CommandInitResultSchema, type CommandMetadata, CommandMetadataSchema, type CommandPromptPart, CommandPromptPartSchema, type CommandSource, CommandSourceSchema, type CommandTaskDefinition, CommandTaskDefinitionSchema, type CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, type CreationCompleteInput, CreationCompleteInputSchema, type CreationRequestInput, CreationRequestInputSchema, CwdSchema, 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 MarketplaceCategory, type MarketplaceDefinition, type MarketplaceEntry, MessageIDSchema, type MessageReceiveInput, MessageReceiveInputSchema, MessageRoleSchema, MessageSchema, type MessageTransformInput, MessageTransformInputSchema, ModelObjectSchema, ModelSchema, PartIDSchema, type PermissionAskInput, PermissionAskInputSchema, type PermissionDeniedInput, PermissionDeniedInputSchema, PermissionLevelSchema, PermissionRequestSchema, type Plugin, type PluginDefinition, type PluginInput, PromptExecutorSchema, type PromptHookDefinition, type ScheduledTaskCompleteInput, ScheduledTaskCompleteInputSchema, type ScheduledTaskTriggerInput, ScheduledTaskTriggerInputSchema, type SchedulerTaskDefinition, SchedulerTaskDefinitionSchema, 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 SkillScope, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type StoreSourceType, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, type TaskDefinition, type TaskProgressInput, TaskProgressInputSchema, type TaskRunningInput, TaskRunningInputSchema, type TaskSource, TaskSourceSchema, type TaskStartInput, TaskStartInputSchema, type TextCompleteInput, TextCompleteInputSchema, type ToolAfterInput, ToolAfterInputSchema, ToolArgsSchema, type ToolBeforeInput, ToolBeforeInputSchema, type ToolDefinitionInput, ToolDefinitionInputSchema, type ToolFailureInput, ToolFailureInputSchema, ToolResultSchema, findMarketplace, findMarketplacesByCategory, getEventInputSchema, listMarketplaces, registerMarketplace, safeValidateHookInput, tool, unregisterMarketplace, validateHookInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command, Auth, Provider, createEasbotClient, Project, Event, Config } from '@easbot/sdk';
|
|
2
|
+
import * as _easbot_types from '@easbot/types';
|
|
2
3
|
import { ToolContext, EasbotShell, ToolDefinition } from '@easbot/types';
|
|
3
4
|
export { AgentPermission, AgentPermissionSchema, AskInput, EasbotShell, EasbotShellError, EasbotShellOutput, EasbotShellPromise, PermissionActionSchema, PermissionRuleSchema, ShellExpression, ShellFunction, ToolContext, ToolDefinition, ToolFunction as ToolFn, ToolFunction, buildToolArgs, createTool, toolSchema as schema } from '@easbot/types';
|
|
4
5
|
import z, { z as z$1 } from 'zod';
|
|
@@ -16,116 +17,6 @@ declare namespace tool {
|
|
|
16
17
|
var schema: typeof z;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
declare const HookType: {
|
|
20
|
-
readonly Command: "command";
|
|
21
|
-
readonly Prompt: "prompt";
|
|
22
|
-
readonly Http: "http";
|
|
23
|
-
readonly Agent: "agent";
|
|
24
|
-
readonly Function: "function";
|
|
25
|
-
};
|
|
26
|
-
type HookType = (typeof HookType)[keyof typeof HookType];
|
|
27
|
-
declare const HookEvent: {
|
|
28
|
-
readonly SessionStart: "session.start";
|
|
29
|
-
readonly SessionEnd: "session.end";
|
|
30
|
-
readonly SessionCompacting: "session.compacting";
|
|
31
|
-
readonly SessionCompact: "session.compact";
|
|
32
|
-
readonly StepStart: "step.start";
|
|
33
|
-
readonly StepFinish: "step.finish";
|
|
34
|
-
readonly StepStop: "step.stop";
|
|
35
|
-
readonly StepStopFailure: "step.stop.failure";
|
|
36
|
-
readonly MessageReceive: "message.receive";
|
|
37
|
-
readonly MessageTransform: "message.transform";
|
|
38
|
-
readonly SystemTransform: "system.transform";
|
|
39
|
-
readonly ToolBefore: "tool.before";
|
|
40
|
-
readonly ToolAfter: "tool.after";
|
|
41
|
-
readonly ToolFailure: "tool.failure";
|
|
42
|
-
readonly ToolDefinition: "tool.definition";
|
|
43
|
-
readonly CommandBefore: "command.before";
|
|
44
|
-
readonly CommandAfter: "command.after";
|
|
45
|
-
readonly PermissionAsk: "permission.ask";
|
|
46
|
-
readonly PermissionDenied: "permission.denied";
|
|
47
|
-
readonly LlmParams: "llm.params";
|
|
48
|
-
readonly LlmHeaders: "llm.headers";
|
|
49
|
-
readonly ShellEnv: "shell.env";
|
|
50
|
-
readonly TextComplete: "text.complete";
|
|
51
|
-
readonly GatewayMessageReceive: "gateway.message.receive";
|
|
52
|
-
readonly GatewayMessageProcess: "gateway.message.process";
|
|
53
|
-
readonly GatewayMessageComplete: "gateway.message.complete";
|
|
54
|
-
readonly GatewayMessageSend: "gateway.message.send";
|
|
55
|
-
readonly GatewayMessageDelivered: "gateway.message.delivered";
|
|
56
|
-
readonly GatewayMessageRead: "gateway.message.read";
|
|
57
|
-
readonly HeartbeatTrigger: "scheduler.heartbeat.trigger";
|
|
58
|
-
readonly HeartbeatComplete: "scheduler.heartbeat.complete";
|
|
59
|
-
readonly ScheduledTaskTrigger: "scheduler.task.trigger";
|
|
60
|
-
readonly ScheduledTaskComplete: "scheduler.task.complete";
|
|
61
|
-
readonly CommandTrigger: "scheduler.command.trigger";
|
|
62
|
-
readonly CommandComplete: "scheduler.command.complete";
|
|
63
|
-
readonly ContextBuildBefore: "context.build.before";
|
|
64
|
-
readonly ContextBuildAfter: "context.build.after";
|
|
65
|
-
readonly TaskStart: "task.start";
|
|
66
|
-
readonly TaskRunning: "task.running";
|
|
67
|
-
readonly TaskProgress: "task.progress";
|
|
68
|
-
readonly TaskComplete: "task.complete";
|
|
69
|
-
readonly LoopStart: "loop.start";
|
|
70
|
-
readonly LoopEnd: "loop.end";
|
|
71
|
-
readonly CreationRequest: "creation.request";
|
|
72
|
-
readonly CreationComplete: "creation.complete";
|
|
73
|
-
readonly EvolutionRequest: "evolution.request";
|
|
74
|
-
readonly EvolutionComplete: "evolution.complete";
|
|
75
|
-
};
|
|
76
|
-
type HookEvent = (typeof HookEvent)[keyof typeof HookEvent];
|
|
77
|
-
declare const HOOK_EVENTS: ("session.start" | "session.end" | "session.compacting" | "session.compact" | "step.start" | "step.finish" | "step.stop" | "step.stop.failure" | "message.receive" | "message.transform" | "system.transform" | "tool.before" | "tool.after" | "tool.failure" | "tool.definition" | "command.before" | "command.after" | "permission.ask" | "permission.denied" | "llm.params" | "llm.headers" | "shell.env" | "text.complete" | "gateway.message.receive" | "gateway.message.process" | "gateway.message.complete" | "gateway.message.send" | "gateway.message.delivered" | "gateway.message.read" | "scheduler.heartbeat.trigger" | "scheduler.heartbeat.complete" | "scheduler.task.trigger" | "scheduler.task.complete" | "scheduler.command.trigger" | "scheduler.command.complete" | "context.build.before" | "context.build.after" | "task.start" | "task.running" | "task.progress" | "task.complete" | "loop.start" | "loop.end" | "creation.request" | "creation.complete" | "evolution.request" | "evolution.complete")[];
|
|
78
|
-
interface HookContext {
|
|
79
|
-
sessionId?: string;
|
|
80
|
-
agent?: string;
|
|
81
|
-
model?: string;
|
|
82
|
-
cwd?: string;
|
|
83
|
-
abort?: AbortSignal;
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
}
|
|
86
|
-
interface HookOutputWrapper<T = unknown> {
|
|
87
|
-
modified: boolean;
|
|
88
|
-
input: T;
|
|
89
|
-
output?: Record<string, unknown>;
|
|
90
|
-
}
|
|
91
|
-
type HookHandler<T = unknown> = (input: T, context: HookContext) => Promise<HookOutputWrapper<T>> | HookOutputWrapper<T>;
|
|
92
|
-
interface HookResult {
|
|
93
|
-
success?: boolean;
|
|
94
|
-
skipped?: boolean;
|
|
95
|
-
output?: unknown;
|
|
96
|
-
error?: string;
|
|
97
|
-
stdout?: string;
|
|
98
|
-
stderr?: string;
|
|
99
|
-
exitCode?: number;
|
|
100
|
-
duration?: number;
|
|
101
|
-
}
|
|
102
|
-
interface HookExecutionDetail {
|
|
103
|
-
index: number;
|
|
104
|
-
hookType: string;
|
|
105
|
-
hookName: string;
|
|
106
|
-
matched: boolean;
|
|
107
|
-
skipped: boolean;
|
|
108
|
-
success: boolean;
|
|
109
|
-
modified: boolean;
|
|
110
|
-
duration: number;
|
|
111
|
-
output?: unknown;
|
|
112
|
-
}
|
|
113
|
-
interface HookError {
|
|
114
|
-
index: number;
|
|
115
|
-
hookName: string;
|
|
116
|
-
error: string;
|
|
117
|
-
stack?: string;
|
|
118
|
-
}
|
|
119
|
-
interface HookChainResult<T = unknown> {
|
|
120
|
-
success: boolean;
|
|
121
|
-
output: T;
|
|
122
|
-
modified: boolean;
|
|
123
|
-
aborted: boolean;
|
|
124
|
-
details: HookExecutionDetail[];
|
|
125
|
-
errors: HookError[];
|
|
126
|
-
duration: number;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
20
|
declare const CommandExecutorSchema: z$1.ZodObject<{
|
|
130
21
|
type: z$1.ZodLiteral<"command">;
|
|
131
22
|
command: z$1.ZodString;
|
|
@@ -140,6 +31,7 @@ declare const CommandExecutorSchema: z$1.ZodObject<{
|
|
|
140
31
|
async: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
141
32
|
}, z$1.core.$strip>;
|
|
142
33
|
type CommandHookDefinition = z$1.infer<typeof CommandExecutorSchema>;
|
|
34
|
+
type HookMessageCallback = (message: Record<string, unknown>) => void | Promise<void>;
|
|
143
35
|
declare const PromptExecutorSchema: z$1.ZodObject<{
|
|
144
36
|
type: z$1.ZodLiteral<"prompt">;
|
|
145
37
|
if: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -153,8 +45,11 @@ declare const PromptExecutorSchema: z$1.ZodObject<{
|
|
|
153
45
|
}>>;
|
|
154
46
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
155
47
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
48
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
156
49
|
}, z$1.core.$strip>;
|
|
157
|
-
type PromptHookDefinition = z$1.infer<typeof PromptExecutorSchema
|
|
50
|
+
type PromptHookDefinition = Omit<z$1.infer<typeof PromptExecutorSchema>, 'onMessage'> & {
|
|
51
|
+
onMessage?: HookMessageCallback;
|
|
52
|
+
};
|
|
158
53
|
declare const HttpExecutorSchema: z$1.ZodObject<{
|
|
159
54
|
type: z$1.ZodLiteral<"http">;
|
|
160
55
|
url: z$1.ZodString;
|
|
@@ -182,8 +77,11 @@ declare const AgentExecutorSchema: z$1.ZodObject<{
|
|
|
182
77
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
183
78
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
184
79
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
80
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
185
81
|
}, z$1.core.$strip>;
|
|
186
|
-
type AgentHookDefinition = z$1.infer<typeof AgentExecutorSchema
|
|
82
|
+
type AgentHookDefinition = Omit<z$1.infer<typeof AgentExecutorSchema>, 'onMessage'> & {
|
|
83
|
+
onMessage?: HookMessageCallback;
|
|
84
|
+
};
|
|
187
85
|
declare const FunctionExecutorSchema: z$1.ZodObject<{
|
|
188
86
|
type: z$1.ZodLiteral<"function">;
|
|
189
87
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -214,6 +112,7 @@ declare const HookExecutorSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
214
112
|
}>>;
|
|
215
113
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
216
114
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
115
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
217
116
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
218
117
|
type: z$1.ZodLiteral<"http">;
|
|
219
118
|
url: z$1.ZodString;
|
|
@@ -239,6 +138,7 @@ declare const HookExecutorSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
|
239
138
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
240
139
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
241
140
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
141
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
242
142
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
243
143
|
type: z$1.ZodLiteral<"function">;
|
|
244
144
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -272,6 +172,7 @@ declare const HookMatcherSchema: z$1.ZodObject<{
|
|
|
272
172
|
}>>;
|
|
273
173
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
274
174
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
175
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
275
176
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
276
177
|
type: z$1.ZodLiteral<"http">;
|
|
277
178
|
url: z$1.ZodString;
|
|
@@ -297,6 +198,7 @@ declare const HookMatcherSchema: z$1.ZodObject<{
|
|
|
297
198
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
298
199
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
299
200
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
201
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
300
202
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
301
203
|
type: z$1.ZodLiteral<"function">;
|
|
302
204
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -331,6 +233,7 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
331
233
|
}>>;
|
|
332
234
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
333
235
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
236
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
334
237
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
335
238
|
type: z$1.ZodLiteral<"http">;
|
|
336
239
|
url: z$1.ZodString;
|
|
@@ -356,6 +259,7 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
356
259
|
once: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
357
260
|
system: z$1.ZodOptional<z$1.ZodString>;
|
|
358
261
|
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
262
|
+
onMessage: z$1.ZodOptional<z$1.ZodCustom<HookMessageCallback, HookMessageCallback>>;
|
|
359
263
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
360
264
|
type: z$1.ZodLiteral<"function">;
|
|
361
265
|
handler: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
|
|
@@ -363,6 +267,7 @@ declare const HooksConfigSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.Z
|
|
|
363
267
|
}, z$1.core.$strip>>>;
|
|
364
268
|
type HooksConfig = z$1.infer<typeof HooksConfigSchema>;
|
|
365
269
|
declare const SessionIDSchema: z$1.ZodString;
|
|
270
|
+
declare const PartIDSchema: z$1.ZodString;
|
|
366
271
|
declare const MessageIDSchema: z$1.ZodString;
|
|
367
272
|
declare const CallIDSchema: z$1.ZodString;
|
|
368
273
|
declare const AgentSchema: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -437,6 +342,7 @@ type SessionCompactInput = z$1.infer<typeof SessionCompactInputSchema>;
|
|
|
437
342
|
declare const StepStartInputSchema: z$1.ZodObject<{
|
|
438
343
|
sessionId: z$1.ZodString;
|
|
439
344
|
messageId: z$1.ZodString;
|
|
345
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
440
346
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
441
347
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
442
348
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -445,6 +351,7 @@ type StepStartInput = z$1.infer<typeof StepStartInputSchema>;
|
|
|
445
351
|
declare const StepFinishInputSchema: z$1.ZodObject<{
|
|
446
352
|
sessionId: z$1.ZodString;
|
|
447
353
|
messageId: z$1.ZodString;
|
|
354
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
448
355
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
449
356
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
450
357
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -1199,6 +1106,7 @@ declare const EventInputSchemas: {
|
|
|
1199
1106
|
readonly "step.start": z$1.ZodObject<{
|
|
1200
1107
|
sessionId: z$1.ZodString;
|
|
1201
1108
|
messageId: z$1.ZodString;
|
|
1109
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1202
1110
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1203
1111
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1204
1112
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -1206,6 +1114,7 @@ declare const EventInputSchemas: {
|
|
|
1206
1114
|
readonly "step.finish": z$1.ZodObject<{
|
|
1207
1115
|
sessionId: z$1.ZodString;
|
|
1208
1116
|
messageId: z$1.ZodString;
|
|
1117
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1209
1118
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1210
1119
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1211
1120
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -1773,12 +1682,14 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1773
1682
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1774
1683
|
sessionId: z$1.ZodString;
|
|
1775
1684
|
messageId: z$1.ZodString;
|
|
1685
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1776
1686
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1777
1687
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1778
1688
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1779
1689
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1780
1690
|
sessionId: z$1.ZodString;
|
|
1781
1691
|
messageId: z$1.ZodString;
|
|
1692
|
+
partId: z$1.ZodOptional<z$1.ZodString>;
|
|
1782
1693
|
userMessageId: z$1.ZodOptional<z$1.ZodString>;
|
|
1783
1694
|
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1784
1695
|
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -2264,6 +2175,151 @@ declare function safeValidateHookInput<T extends HookEvent>(event: T, input: unk
|
|
|
2264
2175
|
error: z$1.ZodError;
|
|
2265
2176
|
};
|
|
2266
2177
|
|
|
2178
|
+
declare const HookType: {
|
|
2179
|
+
readonly Command: "command";
|
|
2180
|
+
readonly Prompt: "prompt";
|
|
2181
|
+
readonly Http: "http";
|
|
2182
|
+
readonly Agent: "agent";
|
|
2183
|
+
readonly Function: "function";
|
|
2184
|
+
};
|
|
2185
|
+
type HookType = (typeof HookType)[keyof typeof HookType];
|
|
2186
|
+
declare const HookEvent: {
|
|
2187
|
+
readonly SessionStart: "session.start";
|
|
2188
|
+
readonly SessionEnd: "session.end";
|
|
2189
|
+
readonly SessionCompacting: "session.compacting";
|
|
2190
|
+
readonly SessionCompact: "session.compact";
|
|
2191
|
+
readonly StepStart: "step.start";
|
|
2192
|
+
readonly StepFinish: "step.finish";
|
|
2193
|
+
readonly StepStop: "step.stop";
|
|
2194
|
+
readonly StepStopFailure: "step.stop.failure";
|
|
2195
|
+
readonly MessageReceive: "message.receive";
|
|
2196
|
+
readonly MessageTransform: "message.transform";
|
|
2197
|
+
readonly SystemTransform: "system.transform";
|
|
2198
|
+
readonly ToolBefore: "tool.before";
|
|
2199
|
+
readonly ToolAfter: "tool.after";
|
|
2200
|
+
readonly ToolFailure: "tool.failure";
|
|
2201
|
+
readonly ToolDefinition: "tool.definition";
|
|
2202
|
+
readonly CommandBefore: "command.before";
|
|
2203
|
+
readonly CommandAfter: "command.after";
|
|
2204
|
+
readonly PermissionAsk: "permission.ask";
|
|
2205
|
+
readonly PermissionDenied: "permission.denied";
|
|
2206
|
+
readonly LlmParams: "llm.params";
|
|
2207
|
+
readonly LlmHeaders: "llm.headers";
|
|
2208
|
+
readonly ShellEnv: "shell.env";
|
|
2209
|
+
readonly TextComplete: "text.complete";
|
|
2210
|
+
readonly GatewayMessageReceive: "gateway.message.receive";
|
|
2211
|
+
readonly GatewayMessageProcess: "gateway.message.process";
|
|
2212
|
+
readonly GatewayMessageComplete: "gateway.message.complete";
|
|
2213
|
+
readonly GatewayMessageSend: "gateway.message.send";
|
|
2214
|
+
readonly GatewayMessageDelivered: "gateway.message.delivered";
|
|
2215
|
+
readonly GatewayMessageRead: "gateway.message.read";
|
|
2216
|
+
readonly HeartbeatTrigger: "scheduler.heartbeat.trigger";
|
|
2217
|
+
readonly HeartbeatComplete: "scheduler.heartbeat.complete";
|
|
2218
|
+
readonly ScheduledTaskTrigger: "scheduler.task.trigger";
|
|
2219
|
+
readonly ScheduledTaskComplete: "scheduler.task.complete";
|
|
2220
|
+
readonly CommandTrigger: "scheduler.command.trigger";
|
|
2221
|
+
readonly CommandComplete: "scheduler.command.complete";
|
|
2222
|
+
readonly ContextBuildBefore: "context.build.before";
|
|
2223
|
+
readonly ContextBuildAfter: "context.build.after";
|
|
2224
|
+
readonly TaskStart: "task.start";
|
|
2225
|
+
readonly TaskRunning: "task.running";
|
|
2226
|
+
readonly TaskProgress: "task.progress";
|
|
2227
|
+
readonly TaskComplete: "task.complete";
|
|
2228
|
+
readonly LoopStart: "loop.start";
|
|
2229
|
+
readonly LoopEnd: "loop.end";
|
|
2230
|
+
readonly CreationRequest: "creation.request";
|
|
2231
|
+
readonly CreationComplete: "creation.complete";
|
|
2232
|
+
readonly EvolutionRequest: "evolution.request";
|
|
2233
|
+
readonly EvolutionComplete: "evolution.complete";
|
|
2234
|
+
};
|
|
2235
|
+
type HookEvent = (typeof HookEvent)[keyof typeof HookEvent];
|
|
2236
|
+
declare const HOOK_EVENTS: ("session.start" | "session.end" | "session.compacting" | "session.compact" | "step.start" | "step.finish" | "step.stop" | "step.stop.failure" | "message.receive" | "message.transform" | "system.transform" | "tool.before" | "tool.after" | "tool.failure" | "tool.definition" | "command.before" | "command.after" | "permission.ask" | "permission.denied" | "llm.params" | "llm.headers" | "shell.env" | "text.complete" | "gateway.message.receive" | "gateway.message.process" | "gateway.message.complete" | "gateway.message.send" | "gateway.message.delivered" | "gateway.message.read" | "scheduler.heartbeat.trigger" | "scheduler.heartbeat.complete" | "scheduler.task.trigger" | "scheduler.task.complete" | "scheduler.command.trigger" | "scheduler.command.complete" | "context.build.before" | "context.build.after" | "task.start" | "task.running" | "task.progress" | "task.complete" | "loop.start" | "loop.end" | "creation.request" | "creation.complete" | "evolution.request" | "evolution.complete")[];
|
|
2237
|
+
interface HookContext {
|
|
2238
|
+
sessionId?: string;
|
|
2239
|
+
agent?: string;
|
|
2240
|
+
model?: string;
|
|
2241
|
+
cwd?: string;
|
|
2242
|
+
abort?: AbortSignal;
|
|
2243
|
+
[key: string]: unknown;
|
|
2244
|
+
}
|
|
2245
|
+
interface HookOutputWrapper<T = unknown> {
|
|
2246
|
+
modified: boolean;
|
|
2247
|
+
input: T;
|
|
2248
|
+
output?: Record<string, unknown>;
|
|
2249
|
+
}
|
|
2250
|
+
type HookHandler<T = unknown> = (input: T, context: HookContext) => Promise<HookOutputWrapper<T>> | HookOutputWrapper<T>;
|
|
2251
|
+
interface HookResult {
|
|
2252
|
+
success?: boolean;
|
|
2253
|
+
skipped?: boolean;
|
|
2254
|
+
output?: unknown;
|
|
2255
|
+
error?: string;
|
|
2256
|
+
stdout?: string;
|
|
2257
|
+
stderr?: string;
|
|
2258
|
+
exitCode?: number;
|
|
2259
|
+
duration?: number;
|
|
2260
|
+
}
|
|
2261
|
+
interface HookExecutor {
|
|
2262
|
+
readonly type: string;
|
|
2263
|
+
canExecute(hook: unknown): boolean;
|
|
2264
|
+
execute(definition: HookDefinition, input: HookOutputWrapper, context?: HookContext): Promise<HookExecutorOutput>;
|
|
2265
|
+
}
|
|
2266
|
+
interface HookExecutorOutput {
|
|
2267
|
+
success: boolean;
|
|
2268
|
+
modified: boolean;
|
|
2269
|
+
input?: unknown;
|
|
2270
|
+
output?: unknown;
|
|
2271
|
+
error?: string;
|
|
2272
|
+
stdout?: string;
|
|
2273
|
+
stderr?: string;
|
|
2274
|
+
exitCode?: number;
|
|
2275
|
+
duration?: number;
|
|
2276
|
+
metadata?: Record<string, unknown>;
|
|
2277
|
+
}
|
|
2278
|
+
interface HookExecutorRegistry {
|
|
2279
|
+
register(executor: HookExecutor): void;
|
|
2280
|
+
getExecutor(definition: HookDefinition): HookExecutor | undefined;
|
|
2281
|
+
execute(definition: HookDefinition, input: HookOutputWrapper, context?: HookContext): Promise<HookExecutorOutput>;
|
|
2282
|
+
}
|
|
2283
|
+
interface HookExecutionDetail {
|
|
2284
|
+
index: number;
|
|
2285
|
+
hookType: string;
|
|
2286
|
+
hookName: string;
|
|
2287
|
+
matched: boolean;
|
|
2288
|
+
skipped: boolean;
|
|
2289
|
+
success: boolean;
|
|
2290
|
+
modified: boolean;
|
|
2291
|
+
duration: number;
|
|
2292
|
+
output?: unknown;
|
|
2293
|
+
}
|
|
2294
|
+
interface HookError {
|
|
2295
|
+
index: number;
|
|
2296
|
+
hookName: string;
|
|
2297
|
+
error: string;
|
|
2298
|
+
stack?: string;
|
|
2299
|
+
}
|
|
2300
|
+
interface HookChainResult<T = unknown> {
|
|
2301
|
+
success: boolean;
|
|
2302
|
+
output: T;
|
|
2303
|
+
modified: boolean;
|
|
2304
|
+
aborted: boolean;
|
|
2305
|
+
details: HookExecutionDetail[];
|
|
2306
|
+
errors: HookError[];
|
|
2307
|
+
duration: number;
|
|
2308
|
+
}
|
|
2309
|
+
interface HookInfo {
|
|
2310
|
+
name: string;
|
|
2311
|
+
init(): Promise<HookInitResult>;
|
|
2312
|
+
dispose?: () => Promise<void> | void;
|
|
2313
|
+
}
|
|
2314
|
+
type HookInitResult = {
|
|
2315
|
+
scope?: _easbot_types.Scope;
|
|
2316
|
+
isEnabled?: () => boolean | Promise<boolean>;
|
|
2317
|
+
handlers: Array<{
|
|
2318
|
+
name: HookEvent;
|
|
2319
|
+
handler: HookHandler<unknown>;
|
|
2320
|
+
}>;
|
|
2321
|
+
};
|
|
2322
|
+
|
|
2267
2323
|
declare const CommandSourceSchema: z$1.ZodEnum<{
|
|
2268
2324
|
command: "command";
|
|
2269
2325
|
mcp: "mcp";
|
|
@@ -2794,4 +2850,4 @@ interface PluginDefinition {
|
|
|
2794
2850
|
'context.build.after'?: (input: ContextBuildAfterInput, output: HookOutputWrapper<ContextBuildAfterInput>) => Promise<void>;
|
|
2795
2851
|
}
|
|
2796
2852
|
|
|
2797
|
-
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, type AgentModel, AgentModelSchema, AgentSchema, type AgentScope, AgentScopeSchema, type AuthHook, type AuthOuathResult, CallIDSchema, type CommandAfterInput, CommandAfterInputSchema, type CommandArguments, CommandArgumentsSchema, type CommandBeforeInput, CommandBeforeInputSchema, type CommandCompleteInput, CommandCompleteInputSchema, type CommandDefinition, type CommandExecuteResult, type CommandExecuteResultMetadata, CommandExecuteResultMetadataSchema, CommandExecuteResultSchema, type CommandExecutionContext, CommandExecutionContextSchema, CommandExecutorSchema, type CommandHookDefinition, type CommandInitContext, CommandInitContextSchema, type CommandInitResult, CommandInitResultSchema, type CommandMetadata, CommandMetadataSchema, type CommandPromptPart, CommandPromptPartSchema, type CommandSource, CommandSourceSchema, type CommandTaskDefinition, CommandTaskDefinitionSchema, type CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, type CreationCompleteInput, CreationCompleteInputSchema, type CreationRequestInput, CreationRequestInputSchema, CwdSchema, 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, HookExecutorSchema, type HookHandler, type HookMatcher, HookMatcherSchema, 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 MarketplaceCategory, type MarketplaceDefinition, type MarketplaceEntry, MessageIDSchema, type MessageReceiveInput, MessageReceiveInputSchema, MessageRoleSchema, MessageSchema, type MessageTransformInput, MessageTransformInputSchema, ModelObjectSchema, ModelSchema, type PermissionAskInput, PermissionAskInputSchema, type PermissionDeniedInput, PermissionDeniedInputSchema, PermissionLevelSchema, PermissionRequestSchema, type Plugin, type PluginDefinition, type PluginInput, PromptExecutorSchema, type PromptHookDefinition, type ScheduledTaskCompleteInput, ScheduledTaskCompleteInputSchema, type ScheduledTaskTriggerInput, ScheduledTaskTriggerInputSchema, type SchedulerTaskDefinition, SchedulerTaskDefinitionSchema, 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 SkillScope, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type StoreSourceType, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, type TaskDefinition, type TaskProgressInput, TaskProgressInputSchema, type TaskRunningInput, TaskRunningInputSchema, type TaskSource, TaskSourceSchema, type TaskStartInput, TaskStartInputSchema, type TextCompleteInput, TextCompleteInputSchema, type ToolAfterInput, ToolAfterInputSchema, ToolArgsSchema, type ToolBeforeInput, ToolBeforeInputSchema, type ToolDefinitionInput, ToolDefinitionInputSchema, type ToolFailureInput, ToolFailureInputSchema, ToolResultSchema, findMarketplace, findMarketplacesByCategory, getEventInputSchema, listMarketplaces, registerMarketplace, safeValidateHookInput, tool, unregisterMarketplace, validateHookInput };
|
|
2853
|
+
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, type AgentModel, AgentModelSchema, AgentSchema, type AgentScope, AgentScopeSchema, type AuthHook, type AuthOuathResult, CallIDSchema, type CommandAfterInput, CommandAfterInputSchema, type CommandArguments, CommandArgumentsSchema, type CommandBeforeInput, CommandBeforeInputSchema, type CommandCompleteInput, CommandCompleteInputSchema, type CommandDefinition, type CommandExecuteResult, type CommandExecuteResultMetadata, CommandExecuteResultMetadataSchema, CommandExecuteResultSchema, type CommandExecutionContext, CommandExecutionContextSchema, CommandExecutorSchema, type CommandHookDefinition, type CommandInitContext, CommandInitContextSchema, type CommandInitResult, CommandInitResultSchema, type CommandMetadata, CommandMetadataSchema, type CommandPromptPart, CommandPromptPartSchema, type CommandSource, CommandSourceSchema, type CommandTaskDefinition, CommandTaskDefinitionSchema, type CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, type CreationCompleteInput, CreationCompleteInputSchema, type CreationRequestInput, CreationRequestInputSchema, CwdSchema, 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 MarketplaceCategory, type MarketplaceDefinition, type MarketplaceEntry, MessageIDSchema, type MessageReceiveInput, MessageReceiveInputSchema, MessageRoleSchema, MessageSchema, type MessageTransformInput, MessageTransformInputSchema, ModelObjectSchema, ModelSchema, PartIDSchema, type PermissionAskInput, PermissionAskInputSchema, type PermissionDeniedInput, PermissionDeniedInputSchema, PermissionLevelSchema, PermissionRequestSchema, type Plugin, type PluginDefinition, type PluginInput, PromptExecutorSchema, type PromptHookDefinition, type ScheduledTaskCompleteInput, ScheduledTaskCompleteInputSchema, type ScheduledTaskTriggerInput, ScheduledTaskTriggerInputSchema, type SchedulerTaskDefinition, SchedulerTaskDefinitionSchema, 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 SkillScope, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type StoreSourceType, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, type TaskDefinition, type TaskProgressInput, TaskProgressInputSchema, type TaskRunningInput, TaskRunningInputSchema, type TaskSource, TaskSourceSchema, type TaskStartInput, TaskStartInputSchema, type TextCompleteInput, TextCompleteInputSchema, type ToolAfterInput, ToolAfterInputSchema, ToolArgsSchema, type ToolBeforeInput, ToolBeforeInputSchema, type ToolDefinitionInput, ToolDefinitionInputSchema, type ToolFailureInput, ToolFailureInputSchema, ToolResultSchema, findMarketplace, findMarketplacesByCategory, getEventInputSchema, listMarketplaces, registerMarketplace, safeValidateHookInput, tool, unregisterMarketplace, validateHookInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import M,{z as z$1}from'zod';import {AgentPermissionSchema}from'@easbot/types';export{AgentPermissionSchema,PermissionActionSchema,PermissionRuleSchema,buildToolArgs,createTool,toolSchema as schema}from'@easbot/types';import'@easbot/sdk';function P(r){return {description:r.description,args:r.args,execute:r.execute}}P.schema=M;var c={Command:"command",Prompt:"prompt",Http:"http",Agent:"agent",Function:"function"},o={SessionStart:"session.start",SessionEnd:"session.end",SessionCompacting:"session.compacting",SessionCompact:"session.compact",StepStart:"step.start",StepFinish:"step.finish",StepStop:"step.stop",StepStopFailure:"step.stop.failure",MessageReceive:"message.receive",MessageTransform:"message.transform",SystemTransform:"system.transform",ToolBefore:"tool.before",ToolAfter:"tool.after",ToolFailure:"tool.failure",ToolDefinition:"tool.definition",CommandBefore:"command.before",CommandAfter:"command.after",PermissionAsk:"permission.ask",PermissionDenied:"permission.denied",LlmParams:"llm.params",LlmHeaders:"llm.headers",ShellEnv:"shell.env",TextComplete:"text.complete",GatewayMessageReceive:"gateway.message.receive",GatewayMessageProcess:"gateway.message.process",GatewayMessageComplete:"gateway.message.complete",GatewayMessageSend:"gateway.message.send",GatewayMessageDelivered:"gateway.message.delivered",GatewayMessageRead:"gateway.message.read",HeartbeatTrigger:"scheduler.heartbeat.trigger",HeartbeatComplete:"scheduler.heartbeat.complete",ScheduledTaskTrigger:"scheduler.task.trigger",ScheduledTaskComplete:"scheduler.task.complete",CommandTrigger:"scheduler.command.trigger",CommandComplete:"scheduler.command.complete",ContextBuildBefore:"context.build.before",ContextBuildAfter:"context.build.after",TaskStart:"task.start",TaskRunning:"task.running",TaskProgress:"task.progress",TaskComplete:"task.complete",LoopStart:"loop.start",LoopEnd:"loop.end",CreationRequest:"creation.request",CreationComplete:"creation.complete",EvolutionRequest:"evolution.request",EvolutionComplete:"evolution.complete"},Xe=Object.values(o);var y=z$1.string().optional(),w=z$1.object({type:z$1.literal(c.Command),command:z$1.string(),if:y,shell:z$1.enum(["bash","powershell"]).optional(),timeout:z$1.number().positive().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),async:z$1.boolean().optional()}),H=z$1.object({type:z$1.literal(c.Prompt),if:y,timeout:z$1.number().positive().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),runMode:z$1.enum(["session","fork"]).optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown())}),E=z$1.object({type:z$1.literal(c.Http),url:z$1.string(),if:y,timeout:z$1.number().positive().optional(),method:z$1.enum(["GET","POST","PUT","DELETE"]).optional(),headers:z$1.record(z$1.string(),z$1.string()).optional(),allowedEnvVars:z$1.array(z$1.string()).optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional()}),A=z$1.object({type:z$1.literal(c.Agent),if:y,timeout:z$1.number().positive().optional(),agent:z$1.string().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown())}),j=z$1.object({type:z$1.literal(c.Function),handler:z$1.function()}),D=z$1.discriminatedUnion("type",[w,H,E,A,j]),R=z$1.object({event:z$1.string(),matcher:z$1.string().optional(),hooks:z$1.array(D)}),nt=z$1.record(z$1.string(),z$1.array(R)),n=z$1.string().min(1).describe("Session unique identifier"),i=z$1.string().min(1).describe("Message unique identifier"),f=z$1.string().min(1).describe("Tool call unique identifier"),u=z$1.string().optional().describe("Agent name"),b=z$1.string().optional().describe("Model identifier"),x=z$1.object({providerId:z$1.string().describe("Provider ID"),modelId:z$1.string().describe("Model ID"),api:z$1.object({id:z$1.string().describe("API ID"),npm:z$1.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),k=z$1.string().optional().describe("Working directory path"),z=z$1.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),F=z$1.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),O=z$1.object({sessionId:n,source:z$1.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:b,agent:u,cwd:k}),G=z$1.object({sessionId:n,reason:z,duration:z$1.number().positive().optional().describe("Session duration in milliseconds")}),W=z$1.object({sessionId:n,trigger:z$1.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:z$1.number().positive().describe("Current context length"),threshold:z$1.number().positive().describe("Trigger threshold")}),B=z$1.object({sessionId:n,summary:z$1.string().describe("Compaction summary"),previousLength:z$1.number().positive().describe("Previous context length"),newLength:z$1.number().positive().describe("New context length")}),L=z$1.object({sessionId:n,messageId:i,userMessageId:i.optional().describe("User message ID for the current step"),model:b,agent:u}),q=z$1.object({sessionId:n,messageId:i,userMessageId:i.optional().describe("User message ID for the current step"),model:b,agent:u,finishReason:F,tokens:z$1.object({input:z$1.number().int().nonnegative().optional(),output:z$1.number().int().nonnegative().optional(),total:z$1.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),_=z$1.object({sessionId:n,reason:z$1.string().describe("Stop reason")}),U=z$1.object({sessionId:n,error:z$1.string().describe("Error message"),errorType:z$1.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),N=z$1.enum(["user","assistant","system","tool"]),C=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().optional().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),T=z$1.object({id:i,role:N,content:z$1.union([z$1.string(),z$1.array(C)]),name:z$1.string().optional().describe("Message sender name"),tool_call_id:f.optional().describe("Related tool call ID")}),$=z$1.object({sessionId:n,agent:u,model:b,messageId:i,message:z$1.object({id:i,role:z$1.literal("user"),content:z$1.union([z$1.string(),z$1.array(C)])}).describe("User message")}),Z=z$1.object({sessionId:n,messages:z$1.array(T).describe("Messages to transform")}),V=z$1.object({sessionId:n,model:b,system:z$1.array(z$1.string()).describe("Current system prompt")}),S=z$1.record(z$1.string(),z$1.unknown()).describe("Tool call arguments"),K=z$1.object({title:z$1.string().optional().describe("Result title"),content:z$1.string().describe("Result content"),is_error:z$1.boolean().optional().describe("Is error result"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Extra metadata")}),J=z$1.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:z$1.string().describe("Tool name"),callId:f,args:S}),Q=z$1.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:z$1.string(),callId:f,args:S,result:K,duration:z$1.number().nonnegative().optional().describe("Execution duration in milliseconds")}),X=z$1.object({sessionId:n,tool:z$1.string(),callId:f,args:S,error:z$1.string().describe("Error message"),errorType:z$1.enum(["timeout","invalid_args","execution_error","permission_denied"])}),Y=z$1.object({sessionId:n,toolID:z$1.string().describe("Tool ID"),definition:z$1.object({name:z$1.string(),description:z$1.string().optional(),parameters:z$1.record(z$1.string(),z$1.unknown()).optional()}).describe("Tool definition")}),ee=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments")}),te=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional(),result:z$1.object({info:z$1.unknown().optional().describe("Message info"),parts:z$1.array(z$1.unknown()).optional().describe("Message parts"),title:z$1.string().optional().describe("Result title"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Result metadata"),output:z$1.string().optional().describe("Result output"),success:z$1.boolean().optional().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}).describe("Command execution result")}),oe=z$1.enum(["read","write","exec","admin"]),ne=z$1.object({tool:z$1.string().describe("Tool name requesting permission"),args:S.optional(),level:oe.optional(),reason:z$1.string().optional().describe("Reason for permission request")}),re=z$1.object({sessionId:n,request:ne}),se=z$1.object({sessionId:n,tool:z$1.string(),reason:z$1.string().optional()}),v=z$1.enum(["openai","anthropic","google","azure","custom"]),ie=z$1.object({temperature:z$1.number().min(0).max(2).optional(),topP:z$1.number().min(0).max(1).optional(),topK:z$1.number().int().positive().optional(),maxTokens:z$1.number().int().positive().optional(),stopSequences:z$1.array(z$1.string()).optional(),responseFormat:z$1.enum(["text","json_object"]).optional()}),ae=z$1.object({sessionId:n,agent:u,model:x,provider:v,params:ie.partial().optional()}),pe=z$1.object({sessionId:n,agent:u,model:x,provider:v,headers:z$1.record(z$1.string(),z$1.string()).optional()}),me=z$1.object({cwd:k.describe("Working directory"),sessionId:n.optional(),callId:f.optional()}),ce=z$1.object({sessionId:n,messageId:i,partId:z$1.string().describe("Text part ID"),text:z$1.string().describe("Completed text")}),ue=z$1.object({sessionId:n,mode:z$1.enum(["agent","chat","query"]).describe("Build mode"),providerId:z$1.string().optional()}),le=z$1.object({sessionId:n,context:z$1.object({messages:z$1.array(T),system:z$1.array(z$1.string()),metadata:z$1.record(z$1.string(),z$1.unknown())}).describe("Built context")}),de=z$1.object({gatewayID:z$1.string().describe("Gateway ID"),messageId:i,message:z$1.unknown().describe("Received message")}),ge=z$1.object({gatewayID:z$1.string(),messageId:i,message:z$1.unknown(),sessionId:n.optional()}),fe=z$1.object({gatewayID:z$1.string(),messageId:i,result:z$1.unknown().optional()}),be=z$1.object({gatewayID:z$1.string(),messageId:i,message:z$1.unknown(),target:z$1.string().optional().describe("Send target")}),ye=z$1.object({gatewayID:z$1.string(),messageId:i,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Delivery timestamp")}),Se=z$1.object({gatewayID:z$1.string(),messageId:i,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Read timestamp")}),Ie=z$1.object({type:z$1.literal("command"),config:z$1.object({command:z$1.string(),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional()})}),he=z$1.object({type:z$1.literal("heartbeat"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({session:z$1.string().optional(),mode:z$1.enum(["session","fork"]).optional(),agent:z$1.string().optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),xe=z$1.object({type:z$1.literal("scheduler"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({agentType:z$1.string().optional(),transport:z$1.enum(["stdio","http","websocket","cli"]).optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),ke=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),timestamp:z$1.number().describe("Heartbeat timestamp"),name:z$1.string().optional().describe("Heartbeat name"),definition:he.optional()}),Ce=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:z$1.number(),duration:z$1.number().nonnegative().optional(),success:z$1.boolean().optional(),error:z$1.string().optional()}),Te=z$1.object({taskId:z$1.string().describe("Task ID"),taskName:z$1.string().optional(),timestamp:z$1.number(),payload:z$1.record(z$1.string(),z$1.unknown()).optional(),definition:xe.optional()}),ve=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),result:z$1.record(z$1.string(),z$1.unknown()).optional(),error:z$1.string().optional()}),Me=z$1.object({taskId:z$1.string().describe("Command task unique identifier"),taskName:z$1.string().describe("Command task name"),command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional().describe("Command arguments"),timestamp:z$1.number().describe("Trigger timestamp"),definition:Ie.optional()}),Pe=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),output:z$1.string().optional(),error:z$1.string().optional(),duration:z$1.number().describe("Execution duration in milliseconds")}),I=z$1.enum(["tool","scheduler","cli","api"]),we=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:I.describe("Task source: tool, scheduler, cli, api"),agentType:z$1.string().describe("Agent type to execute this task"),description:z$1.string().describe("Task description"),prompt:z$1.string().describe("Task prompt content"),timeout:z$1.number().positive().optional().describe("Task timeout in milliseconds")}),He=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:I.describe("Task source: tool, scheduler, cli, api")}),Ee=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:I,step:z$1.number().describe("Current step number"),totalSteps:z$1.number().optional().describe("Total number of steps"),output:z$1.string().describe("Progress output content"),timestamp:z$1.number().describe("Progress timestamp")}),Ae=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:I,result:z$1.string().describe("Task result content"),duration:z$1.number().nonnegative().describe("Task duration in milliseconds"),attachments:z$1.array(z$1.unknown()).optional().describe("Task result attachments"),error:z$1.string().optional().describe("Error message if task failed"),agentType:z$1.string().optional().describe("Agent type that executed the task"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional metadata for the task result")}),je=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),De=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["stop","continue"]).describe("Loop result: stop or continue")}),Re=z$1.object({requestId:z$1.string(),kind:z$1.enum(["create-skill","create-workflow","create-bundle"]),requirement:z$1.string(),hints:z$1.array(z$1.string()),origin:z$1.object({source:z$1.enum(["human","tool","scheduler","namespace"]).optional(),timestamp:z$1.number().int().nonnegative()})}),ze=z$1.object({requestId:z$1.string(),status:z$1.enum(["success","failed"]),specId:z$1.string().optional(),durationMs:z$1.number().int().nonnegative(),error:z$1.string().optional()}),Fe=z$1.object({dryRun:z$1.boolean()}),Oe=z$1.object({status:z$1.enum(["success","failed","awaiting-approval"]),applied:z$1.number().int().nonnegative().optional(),awaitingApproval:z$1.number().int().nonnegative().optional(),error:z$1.string().optional()}),h={[o.SessionStart]:O,[o.SessionEnd]:G,[o.SessionCompacting]:W,[o.SessionCompact]:B,[o.StepStart]:L,[o.StepFinish]:q,[o.StepStop]:_,[o.StepStopFailure]:U,[o.MessageReceive]:$,[o.MessageTransform]:Z,[o.SystemTransform]:V,[o.ToolBefore]:J,[o.ToolAfter]:Q,[o.ToolFailure]:X,[o.ToolDefinition]:Y,[o.CommandBefore]:ee,[o.CommandAfter]:te,[o.PermissionAsk]:re,[o.PermissionDenied]:se,[o.LlmParams]:ae,[o.LlmHeaders]:pe,[o.ShellEnv]:me,[o.TextComplete]:ce,[o.ContextBuildBefore]:ue,[o.ContextBuildAfter]:le,[o.GatewayMessageReceive]:de,[o.GatewayMessageProcess]:ge,[o.GatewayMessageComplete]:fe,[o.GatewayMessageSend]:be,[o.GatewayMessageDelivered]:ye,[o.GatewayMessageRead]:Se,[o.HeartbeatTrigger]:ke,[o.HeartbeatComplete]:Ce,[o.ScheduledTaskTrigger]:Te,[o.ScheduledTaskComplete]:ve,[o.CommandTrigger]:Me,[o.CommandComplete]:Pe,[o.TaskStart]:we,[o.TaskRunning]:He,[o.TaskProgress]:Ee,[o.TaskComplete]:Ae,[o.LoopStart]:je,[o.LoopEnd]:De,[o.CreationRequest]:Re,[o.CreationComplete]:ze,[o.EvolutionRequest]:Fe,[o.EvolutionComplete]:Oe};function rt(r){return h[r]}function st(r,d){let g=h[r];if(!g)throw new Error(`No schema found for event: ${r}`);return g.parse(d)}function it(r,d){let g=h[r];return g?g.safeParse(d):{success:false,error:new z$1.ZodError([{code:"custom",path:[],message:`No schema found for event: ${r}`}])}}var ft=z$1.enum(["command","mcp","skill"]).describe("Command source"),Ge=z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments"),We=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),bt=z$1.object({name:z$1.string().describe("Command name"),description:z$1.string().describe("Command description"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:z$1.string().optional().describe("Specified agent name"),model:z$1.string().optional().describe("Specified model"),hints:z$1.array(z$1.string()).optional().describe("Argument hints"),commandType:z$1.enum(["prompt","local"]).optional().describe("Command type"),hidden:z$1.boolean().optional().describe("Whether hidden")}),yt=z$1.object({sessionId:z$1.string().describe("Session ID"),directory:z$1.string().describe("Working directory"),model:z$1.string().optional().describe("Model identifier"),agent:z$1.string().optional().describe("Agent name"),arguments:Ge.describe("Command arguments")}),Be=z$1.record(z$1.string(),z$1.unknown()).describe("Result metadata"),St=z$1.object({title:z$1.string().describe("Result title"),metadata:Be.describe("Result metadata"),output:z$1.string().describe("Result output"),parts:z$1.array(We).optional().describe("Result parts"),success:z$1.boolean().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}),It=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),ht=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var qe=z$1.enum(["subagent","primary","all"]),_e=z$1.enum(["general","coder","all"]),Ue=z$1.object({providerId:z$1.string().min(1).describe("Model provider ID"),modelId:z$1.string().min(1).describe("Model ID")}),Et=z$1.object({name:z$1.string().min(1).describe("Unique agent name"),description:z$1.string().optional().describe("When to use this agent"),mode:qe.optional().describe("Agent mode"),hidden:z$1.boolean().optional().describe("Hide from @ autocomplete menu"),scope:_e.optional().describe("Agent scope (general / coder / all)"),model:Ue.optional().describe("Default model"),variant:z$1.string().optional().describe("Default model variant"),temperature:z$1.number().min(0).max(2).optional().describe("Sampling temperature"),topP:z$1.number().min(0).max(1).optional().describe("Top-p sampling"),prompt:z$1.string().optional().describe("System prompt"),permission:AgentPermissionSchema.optional().describe("Tool permissions"),steps:z$1.number().int().positive().optional().describe("Maximum execution steps"),color:z$1.union([z$1.string().regex(/^#[0-9a-fA-F]{6}$/),z$1.enum(["primary","secondary","accent","success","warning","error","info"])]).optional().describe("UI color (hex code or theme name)"),options:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional options")}).meta({ref:"PluginAgent"});var Ot=z$1.object({name:z$1.string().min(1).describe("Unique skill name"),description:z$1.string().min(1).describe("When to use this skill"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope")}),Gt=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),Wt=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var l=new Map;function $t(r){if(l.has(r.id))throw new Error(`Marketplace with id "${r.id}" already registered`);l.set(r.id,r);}function Zt(r){return l.delete(r)}function Vt(){return Array.from(l.values()).map(r=>r)}function Kt(r){return l.get(r)??null}function Jt(r){return Array.from(l.values()).filter(d=>d.category===r)}export{A as AgentExecutorSchema,Et as AgentMetadataSchema,qe as AgentModeSchema,Ue as AgentModelSchema,u as AgentSchema,_e as AgentScopeSchema,f as CallIDSchema,te as CommandAfterInputSchema,Ge as CommandArgumentsSchema,ee as CommandBeforeInputSchema,Pe as CommandCompleteInputSchema,Be as CommandExecuteResultMetadataSchema,St as CommandExecuteResultSchema,yt as CommandExecutionContextSchema,w as CommandExecutorSchema,It as CommandInitContextSchema,ht as CommandInitResultSchema,bt as CommandMetadataSchema,We as CommandPromptPartSchema,ft as CommandSourceSchema,Ie as CommandTaskDefinitionSchema,Me as CommandTriggerInputSchema,C as ContentPartSchema,le as ContextBuildAfterInputSchema,ue as ContextBuildBeforeInputSchema,ze as CreationCompleteInputSchema,Re as CreationRequestInputSchema,k as CwdSchema,z as EndReasonSchema,h as EventInputSchemas,Oe as EvolutionCompleteInputSchema,Fe as EvolutionRequestInputSchema,F as FinishReasonSchema,j as FunctionExecutorSchema,fe as GatewayMessageCompleteInputSchema,ye as GatewayMessageDeliveredInputSchema,ge as GatewayMessageProcessInputSchema,Se as GatewayMessageReadInputSchema,de as GatewayMessageReceiveInputSchema,be as GatewayMessageSendInputSchema,Xe as HOOK_EVENTS,Ce as HeartbeatCompleteInputSchema,he as HeartbeatTaskDefinitionSchema,ke as HeartbeatTriggerInputSchema,o as HookEvent,D as HookExecutorSchema,R as HookMatcherSchema,c as HookType,nt as HooksConfigSchema,E as HttpExecutorSchema,pe as LlmHeadersInputSchema,ae as LlmParamsInputSchema,ie as LlmParamsSchema,v as LlmProviderSchema,De as LoopEndInputSchema,je as LoopStartInputSchema,i as MessageIDSchema,$ as MessageReceiveInputSchema,N as MessageRoleSchema,T as MessageSchema,Z as MessageTransformInputSchema,x as ModelObjectSchema,b as ModelSchema,re as PermissionAskInputSchema,se as PermissionDeniedInputSchema,oe as PermissionLevelSchema,ne as PermissionRequestSchema,H as PromptExecutorSchema,ve as ScheduledTaskCompleteInputSchema,Te as ScheduledTaskTriggerInputSchema,xe as SchedulerTaskDefinitionSchema,B as SessionCompactInputSchema,W as SessionCompactingInputSchema,G as SessionEndInputSchema,n as SessionIDSchema,O as SessionStartInputSchema,me as ShellEnvInputSchema,Gt as SkillInitContextSchema,Wt as SkillInitResultSchema,Ot as SkillMetadataSchema,q as StepFinishInputSchema,L as StepStartInputSchema,U as StepStopFailureInputSchema,_ as StepStopInputSchema,V as SystemTransformInputSchema,Ae as TaskCompleteInputSchema,Ee as TaskProgressInputSchema,He as TaskRunningInputSchema,I as TaskSourceSchema,we as TaskStartInputSchema,ce as TextCompleteInputSchema,Q as ToolAfterInputSchema,S as ToolArgsSchema,J as ToolBeforeInputSchema,Y as ToolDefinitionInputSchema,X as ToolFailureInputSchema,K as ToolResultSchema,Kt as findMarketplace,Jt as findMarketplacesByCategory,rt as getEventInputSchema,Vt as listMarketplaces,$t as registerMarketplace,it as safeValidateHookInput,P as tool,Zt as unregisterMarketplace,st as validateHookInput};
|
|
1
|
+
import M,{z as z$1}from'zod';import {AgentPermissionSchema}from'@easbot/types';export{AgentPermissionSchema,PermissionActionSchema,PermissionRuleSchema,buildToolArgs,createTool,toolSchema as schema}from'@easbot/types';import'@easbot/sdk';function P(r){return {description:r.description,args:r.args,execute:r.execute}}P.schema=M;var m={Command:"command",Prompt:"prompt",Http:"http",Agent:"agent",Function:"function"},o={SessionStart:"session.start",SessionEnd:"session.end",SessionCompacting:"session.compacting",SessionCompact:"session.compact",StepStart:"step.start",StepFinish:"step.finish",StepStop:"step.stop",StepStopFailure:"step.stop.failure",MessageReceive:"message.receive",MessageTransform:"message.transform",SystemTransform:"system.transform",ToolBefore:"tool.before",ToolAfter:"tool.after",ToolFailure:"tool.failure",ToolDefinition:"tool.definition",CommandBefore:"command.before",CommandAfter:"command.after",PermissionAsk:"permission.ask",PermissionDenied:"permission.denied",LlmParams:"llm.params",LlmHeaders:"llm.headers",ShellEnv:"shell.env",TextComplete:"text.complete",GatewayMessageReceive:"gateway.message.receive",GatewayMessageProcess:"gateway.message.process",GatewayMessageComplete:"gateway.message.complete",GatewayMessageSend:"gateway.message.send",GatewayMessageDelivered:"gateway.message.delivered",GatewayMessageRead:"gateway.message.read",HeartbeatTrigger:"scheduler.heartbeat.trigger",HeartbeatComplete:"scheduler.heartbeat.complete",ScheduledTaskTrigger:"scheduler.task.trigger",ScheduledTaskComplete:"scheduler.task.complete",CommandTrigger:"scheduler.command.trigger",CommandComplete:"scheduler.command.complete",ContextBuildBefore:"context.build.before",ContextBuildAfter:"context.build.after",TaskStart:"task.start",TaskRunning:"task.running",TaskProgress:"task.progress",TaskComplete:"task.complete",LoopStart:"loop.start",LoopEnd:"loop.end",CreationRequest:"creation.request",CreationComplete:"creation.complete",EvolutionRequest:"evolution.request",EvolutionComplete:"evolution.complete"},Ye=Object.values(o);var y=z$1.string().optional(),w=z$1.object({type:z$1.literal(m.Command),command:z$1.string(),if:y,shell:z$1.enum(["bash","powershell"]).optional(),timeout:z$1.number().positive().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),async:z$1.boolean().optional()}),E=z$1.object({type:z$1.literal(m.Prompt),if:y,timeout:z$1.number().positive().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),runMode:z$1.enum(["session","fork"]).optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown()),onMessage:z$1.custom(r=>typeof r=="function").optional()}),D=z$1.object({type:z$1.literal(m.Http),url:z$1.string(),if:y,timeout:z$1.number().positive().optional(),method:z$1.enum(["GET","POST","PUT","DELETE"]).optional(),headers:z$1.record(z$1.string(),z$1.string()).optional(),allowedEnvVars:z$1.array(z$1.string()).optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional()}),A=z$1.object({type:z$1.literal(m.Agent),if:y,timeout:z$1.number().positive().optional(),agent:z$1.string().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown()),onMessage:z$1.custom(r=>typeof r=="function").optional()}),j=z$1.object({type:z$1.literal(m.Function),handler:z$1.function()}),R=z$1.discriminatedUnion("type",[w,E,D,A,j]),z=z$1.object({event:z$1.string(),matcher:z$1.string().optional(),hooks:z$1.array(R)}),rt=z$1.record(z$1.string(),z$1.array(z)),n=z$1.string().min(1).describe("Session unique identifier"),h=z$1.string().min(1).describe("Part unique identifier"),i=z$1.string().min(1).describe("Message unique identifier"),f=z$1.string().min(1).describe("Tool call unique identifier"),u=z$1.string().optional().describe("Agent name"),b=z$1.string().optional().describe("Model identifier"),k=z$1.object({providerId:z$1.string().describe("Provider ID"),modelId:z$1.string().describe("Model ID"),api:z$1.object({id:z$1.string().describe("API ID"),npm:z$1.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),C=z$1.string().optional().describe("Working directory path"),O=z$1.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),F=z$1.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),W=z$1.object({sessionId:n,source:z$1.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:b,agent:u,cwd:C}),G=z$1.object({sessionId:n,reason:O,duration:z$1.number().positive().optional().describe("Session duration in milliseconds")}),B=z$1.object({sessionId:n,trigger:z$1.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:z$1.number().positive().describe("Current context length"),threshold:z$1.number().positive().describe("Trigger threshold")}),L=z$1.object({sessionId:n,summary:z$1.string().describe("Compaction summary"),previousLength:z$1.number().positive().describe("Previous context length"),newLength:z$1.number().positive().describe("New context length")}),q=z$1.object({sessionId:n,messageId:i,partId:h.optional().describe("step-start part ID (created by processor before hook trigger)"),userMessageId:i.optional().describe("User message ID for the current step"),model:b,agent:u}),_=z$1.object({sessionId:n,messageId:i,partId:h.optional().describe("step-finish part ID (created by processor before hook trigger)"),userMessageId:i.optional().describe("User message ID for the current step"),model:b,agent:u,finishReason:F,tokens:z$1.object({input:z$1.number().int().nonnegative().optional(),output:z$1.number().int().nonnegative().optional(),total:z$1.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),U=z$1.object({sessionId:n,reason:z$1.string().describe("Stop reason")}),N=z$1.object({sessionId:n,error:z$1.string().describe("Error message"),errorType:z$1.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),$=z$1.enum(["user","assistant","system","tool"]),T=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().optional().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),v=z$1.object({id:i,role:$,content:z$1.union([z$1.string(),z$1.array(T)]),name:z$1.string().optional().describe("Message sender name"),tool_call_id:f.optional().describe("Related tool call ID")}),Z=z$1.object({sessionId:n,agent:u,model:b,messageId:i,message:z$1.object({id:i,role:z$1.literal("user"),content:z$1.union([z$1.string(),z$1.array(T)])}).describe("User message")}),V=z$1.object({sessionId:n,messages:z$1.array(v).describe("Messages to transform")}),K=z$1.object({sessionId:n,model:b,system:z$1.array(z$1.string()).describe("Current system prompt")}),S=z$1.record(z$1.string(),z$1.unknown()).describe("Tool call arguments"),J=z$1.object({title:z$1.string().optional().describe("Result title"),content:z$1.string().describe("Result content"),is_error:z$1.boolean().optional().describe("Is error result"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Extra metadata")}),Q=z$1.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:z$1.string().describe("Tool name"),callId:f,args:S}),X=z$1.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:z$1.string(),callId:f,args:S,result:J,duration:z$1.number().nonnegative().optional().describe("Execution duration in milliseconds")}),Y=z$1.object({sessionId:n,tool:z$1.string(),callId:f,args:S,error:z$1.string().describe("Error message"),errorType:z$1.enum(["timeout","invalid_args","execution_error","permission_denied"])}),ee=z$1.object({sessionId:n,toolID:z$1.string().describe("Tool ID"),definition:z$1.object({name:z$1.string(),description:z$1.string().optional(),parameters:z$1.record(z$1.string(),z$1.unknown()).optional()}).describe("Tool definition")}),te=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments")}),oe=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional(),result:z$1.object({info:z$1.unknown().optional().describe("Message info"),parts:z$1.array(z$1.unknown()).optional().describe("Message parts"),title:z$1.string().optional().describe("Result title"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Result metadata"),output:z$1.string().optional().describe("Result output"),success:z$1.boolean().optional().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}).describe("Command execution result")}),ne=z$1.enum(["read","write","exec","admin"]),re=z$1.object({tool:z$1.string().describe("Tool name requesting permission"),args:S.optional(),level:ne.optional(),reason:z$1.string().optional().describe("Reason for permission request")}),se=z$1.object({sessionId:n,request:re}),ie=z$1.object({sessionId:n,tool:z$1.string(),reason:z$1.string().optional()}),H=z$1.enum(["openai","anthropic","google","azure","custom"]),ae=z$1.object({temperature:z$1.number().min(0).max(2).optional(),topP:z$1.number().min(0).max(1).optional(),topK:z$1.number().int().positive().optional(),maxTokens:z$1.number().int().positive().optional(),stopSequences:z$1.array(z$1.string()).optional(),responseFormat:z$1.enum(["text","json_object"]).optional()}),pe=z$1.object({sessionId:n,agent:u,model:k,provider:H,params:ae.partial().optional()}),ce=z$1.object({sessionId:n,agent:u,model:k,provider:H,headers:z$1.record(z$1.string(),z$1.string()).optional()}),me=z$1.object({cwd:C.describe("Working directory"),sessionId:n.optional(),callId:f.optional()}),ue=z$1.object({sessionId:n,messageId:i,partId:z$1.string().describe("Text part ID"),text:z$1.string().describe("Completed text")}),le=z$1.object({sessionId:n,mode:z$1.enum(["agent","chat","query"]).describe("Build mode"),providerId:z$1.string().optional()}),de=z$1.object({sessionId:n,context:z$1.object({messages:z$1.array(v),system:z$1.array(z$1.string()),metadata:z$1.record(z$1.string(),z$1.unknown())}).describe("Built context")}),ge=z$1.object({gatewayID:z$1.string().describe("Gateway ID"),messageId:i,message:z$1.unknown().describe("Received message")}),fe=z$1.object({gatewayID:z$1.string(),messageId:i,message:z$1.unknown(),sessionId:n.optional()}),be=z$1.object({gatewayID:z$1.string(),messageId:i,result:z$1.unknown().optional()}),ye=z$1.object({gatewayID:z$1.string(),messageId:i,message:z$1.unknown(),target:z$1.string().optional().describe("Send target")}),Se=z$1.object({gatewayID:z$1.string(),messageId:i,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Delivery timestamp")}),Ie=z$1.object({gatewayID:z$1.string(),messageId:i,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Read timestamp")}),xe=z$1.object({type:z$1.literal("command"),config:z$1.object({command:z$1.string(),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional()})}),he=z$1.object({type:z$1.literal("heartbeat"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({session:z$1.string().optional(),mode:z$1.enum(["session","fork"]).optional(),agent:z$1.string().optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),ke=z$1.object({type:z$1.literal("scheduler"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({agentType:z$1.string().optional(),transport:z$1.enum(["stdio","http","websocket","cli"]).optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),Ce=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),timestamp:z$1.number().describe("Heartbeat timestamp"),name:z$1.string().optional().describe("Heartbeat name"),definition:he.optional()}),Te=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:z$1.number(),duration:z$1.number().nonnegative().optional(),success:z$1.boolean().optional(),error:z$1.string().optional()}),ve=z$1.object({taskId:z$1.string().describe("Task ID"),taskName:z$1.string().optional(),timestamp:z$1.number(),payload:z$1.record(z$1.string(),z$1.unknown()).optional(),definition:ke.optional()}),He=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),result:z$1.record(z$1.string(),z$1.unknown()).optional(),error:z$1.string().optional()}),Me=z$1.object({taskId:z$1.string().describe("Command task unique identifier"),taskName:z$1.string().describe("Command task name"),command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional().describe("Command arguments"),timestamp:z$1.number().describe("Trigger timestamp"),definition:xe.optional()}),Pe=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),output:z$1.string().optional(),error:z$1.string().optional(),duration:z$1.number().describe("Execution duration in milliseconds")}),I=z$1.enum(["tool","scheduler","cli","api"]),we=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:I.describe("Task source: tool, scheduler, cli, api"),agentType:z$1.string().describe("Agent type to execute this task"),description:z$1.string().describe("Task description"),prompt:z$1.string().describe("Task prompt content"),timeout:z$1.number().positive().optional().describe("Task timeout in milliseconds")}),Ee=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:I.describe("Task source: tool, scheduler, cli, api")}),De=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:I,step:z$1.number().describe("Current step number"),totalSteps:z$1.number().optional().describe("Total number of steps"),output:z$1.string().describe("Progress output content"),timestamp:z$1.number().describe("Progress timestamp")}),Ae=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:I,result:z$1.string().describe("Task result content"),duration:z$1.number().nonnegative().describe("Task duration in milliseconds"),attachments:z$1.array(z$1.unknown()).optional().describe("Task result attachments"),error:z$1.string().optional().describe("Error message if task failed"),agentType:z$1.string().optional().describe("Agent type that executed the task"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional metadata for the task result")}),je=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),Re=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["stop","continue"]).describe("Loop result: stop or continue")}),ze=z$1.object({requestId:z$1.string(),kind:z$1.enum(["create-skill","create-workflow","create-bundle"]),requirement:z$1.string(),hints:z$1.array(z$1.string()),origin:z$1.object({source:z$1.enum(["human","tool","scheduler","namespace"]).optional(),timestamp:z$1.number().int().nonnegative()})}),Oe=z$1.object({requestId:z$1.string(),status:z$1.enum(["success","failed"]),specId:z$1.string().optional(),durationMs:z$1.number().int().nonnegative(),error:z$1.string().optional()}),Fe=z$1.object({dryRun:z$1.boolean()}),We=z$1.object({status:z$1.enum(["success","failed","awaiting-approval"]),applied:z$1.number().int().nonnegative().optional(),awaitingApproval:z$1.number().int().nonnegative().optional(),error:z$1.string().optional()}),x={[o.SessionStart]:W,[o.SessionEnd]:G,[o.SessionCompacting]:B,[o.SessionCompact]:L,[o.StepStart]:q,[o.StepFinish]:_,[o.StepStop]:U,[o.StepStopFailure]:N,[o.MessageReceive]:Z,[o.MessageTransform]:V,[o.SystemTransform]:K,[o.ToolBefore]:Q,[o.ToolAfter]:X,[o.ToolFailure]:Y,[o.ToolDefinition]:ee,[o.CommandBefore]:te,[o.CommandAfter]:oe,[o.PermissionAsk]:se,[o.PermissionDenied]:ie,[o.LlmParams]:pe,[o.LlmHeaders]:ce,[o.ShellEnv]:me,[o.TextComplete]:ue,[o.ContextBuildBefore]:le,[o.ContextBuildAfter]:de,[o.GatewayMessageReceive]:ge,[o.GatewayMessageProcess]:fe,[o.GatewayMessageComplete]:be,[o.GatewayMessageSend]:ye,[o.GatewayMessageDelivered]:Se,[o.GatewayMessageRead]:Ie,[o.HeartbeatTrigger]:Ce,[o.HeartbeatComplete]:Te,[o.ScheduledTaskTrigger]:ve,[o.ScheduledTaskComplete]:He,[o.CommandTrigger]:Me,[o.CommandComplete]:Pe,[o.TaskStart]:we,[o.TaskRunning]:Ee,[o.TaskProgress]:De,[o.TaskComplete]:Ae,[o.LoopStart]:je,[o.LoopEnd]:Re,[o.CreationRequest]:ze,[o.CreationComplete]:Oe,[o.EvolutionRequest]:Fe,[o.EvolutionComplete]:We};function st(r){return x[r]}function it(r,d){let g=x[r];if(!g)throw new Error(`No schema found for event: ${r}`);return g.parse(d)}function at(r,d){let g=x[r];return g?g.safeParse(d):{success:false,error:new z$1.ZodError([{code:"custom",path:[],message:`No schema found for event: ${r}`}])}}var bt=z$1.enum(["command","mcp","skill"]).describe("Command source"),Ge=z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments"),Be=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),yt=z$1.object({name:z$1.string().describe("Command name"),description:z$1.string().describe("Command description"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:z$1.string().optional().describe("Specified agent name"),model:z$1.string().optional().describe("Specified model"),hints:z$1.array(z$1.string()).optional().describe("Argument hints"),commandType:z$1.enum(["prompt","local"]).optional().describe("Command type"),hidden:z$1.boolean().optional().describe("Whether hidden")}),St=z$1.object({sessionId:z$1.string().describe("Session ID"),directory:z$1.string().describe("Working directory"),model:z$1.string().optional().describe("Model identifier"),agent:z$1.string().optional().describe("Agent name"),arguments:Ge.describe("Command arguments")}),Le=z$1.record(z$1.string(),z$1.unknown()).describe("Result metadata"),It=z$1.object({title:z$1.string().describe("Result title"),metadata:Le.describe("Result metadata"),output:z$1.string().describe("Result output"),parts:z$1.array(Be).optional().describe("Result parts"),success:z$1.boolean().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}),xt=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),ht=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var _e=z$1.enum(["subagent","primary","all"]),Ue=z$1.enum(["general","coder","all"]),Ne=z$1.object({providerId:z$1.string().min(1).describe("Model provider ID"),modelId:z$1.string().min(1).describe("Model ID")}),Dt=z$1.object({name:z$1.string().min(1).describe("Unique agent name"),description:z$1.string().optional().describe("When to use this agent"),mode:_e.optional().describe("Agent mode"),hidden:z$1.boolean().optional().describe("Hide from @ autocomplete menu"),scope:Ue.optional().describe("Agent scope (general / coder / all)"),model:Ne.optional().describe("Default model"),variant:z$1.string().optional().describe("Default model variant"),temperature:z$1.number().min(0).max(2).optional().describe("Sampling temperature"),topP:z$1.number().min(0).max(1).optional().describe("Top-p sampling"),prompt:z$1.string().optional().describe("System prompt"),permission:AgentPermissionSchema.optional().describe("Tool permissions"),steps:z$1.number().int().positive().optional().describe("Maximum execution steps"),color:z$1.union([z$1.string().regex(/^#[0-9a-fA-F]{6}$/),z$1.enum(["primary","secondary","accent","success","warning","error","info"])]).optional().describe("UI color (hex code or theme name)"),options:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional options")}).meta({ref:"PluginAgent"});var Wt=z$1.object({name:z$1.string().min(1).describe("Unique skill name"),description:z$1.string().min(1).describe("When to use this skill"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope")}),Gt=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),Bt=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var l=new Map;function Zt(r){if(l.has(r.id))throw new Error(`Marketplace with id "${r.id}" already registered`);l.set(r.id,r);}function Vt(r){return l.delete(r)}function Kt(){return Array.from(l.values()).map(r=>r)}function Jt(r){return l.get(r)??null}function Qt(r){return Array.from(l.values()).filter(d=>d.category===r)}export{A as AgentExecutorSchema,Dt as AgentMetadataSchema,_e as AgentModeSchema,Ne as AgentModelSchema,u as AgentSchema,Ue as AgentScopeSchema,f as CallIDSchema,oe as CommandAfterInputSchema,Ge as CommandArgumentsSchema,te as CommandBeforeInputSchema,Pe as CommandCompleteInputSchema,Le as CommandExecuteResultMetadataSchema,It as CommandExecuteResultSchema,St as CommandExecutionContextSchema,w as CommandExecutorSchema,xt as CommandInitContextSchema,ht as CommandInitResultSchema,yt as CommandMetadataSchema,Be as CommandPromptPartSchema,bt as CommandSourceSchema,xe as CommandTaskDefinitionSchema,Me as CommandTriggerInputSchema,T as ContentPartSchema,de as ContextBuildAfterInputSchema,le as ContextBuildBeforeInputSchema,Oe as CreationCompleteInputSchema,ze as CreationRequestInputSchema,C as CwdSchema,O as EndReasonSchema,x as EventInputSchemas,We as EvolutionCompleteInputSchema,Fe as EvolutionRequestInputSchema,F as FinishReasonSchema,j as FunctionExecutorSchema,be as GatewayMessageCompleteInputSchema,Se as GatewayMessageDeliveredInputSchema,fe as GatewayMessageProcessInputSchema,Ie as GatewayMessageReadInputSchema,ge as GatewayMessageReceiveInputSchema,ye as GatewayMessageSendInputSchema,Ye as HOOK_EVENTS,Te as HeartbeatCompleteInputSchema,he as HeartbeatTaskDefinitionSchema,Ce as HeartbeatTriggerInputSchema,o as HookEvent,R as HookExecutorSchema,z as HookMatcherSchema,m as HookType,rt as HooksConfigSchema,D as HttpExecutorSchema,ce as LlmHeadersInputSchema,pe as LlmParamsInputSchema,ae as LlmParamsSchema,H as LlmProviderSchema,Re as LoopEndInputSchema,je as LoopStartInputSchema,i as MessageIDSchema,Z as MessageReceiveInputSchema,$ as MessageRoleSchema,v as MessageSchema,V as MessageTransformInputSchema,k as ModelObjectSchema,b as ModelSchema,h as PartIDSchema,se as PermissionAskInputSchema,ie as PermissionDeniedInputSchema,ne as PermissionLevelSchema,re as PermissionRequestSchema,E as PromptExecutorSchema,He as ScheduledTaskCompleteInputSchema,ve as ScheduledTaskTriggerInputSchema,ke as SchedulerTaskDefinitionSchema,L as SessionCompactInputSchema,B as SessionCompactingInputSchema,G as SessionEndInputSchema,n as SessionIDSchema,W as SessionStartInputSchema,me as ShellEnvInputSchema,Gt as SkillInitContextSchema,Bt as SkillInitResultSchema,Wt as SkillMetadataSchema,_ as StepFinishInputSchema,q as StepStartInputSchema,N as StepStopFailureInputSchema,U as StepStopInputSchema,K as SystemTransformInputSchema,Ae as TaskCompleteInputSchema,De as TaskProgressInputSchema,Ee as TaskRunningInputSchema,I as TaskSourceSchema,we as TaskStartInputSchema,ue as TextCompleteInputSchema,X as ToolAfterInputSchema,S as ToolArgsSchema,Q as ToolBeforeInputSchema,ee as ToolDefinitionInputSchema,Y as ToolFailureInputSchema,J as ToolResultSchema,Jt as findMarketplace,Qt as findMarketplacesByCategory,st as getEventInputSchema,Kt as listMarketplaces,Zt as registerMarketplace,at as safeValidateHookInput,P as tool,Vt as unregisterMarketplace,it as validateHookInput};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easbot/plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
4
4
|
"description": "EASBot Plugin for client applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"zod": "^4.4.3",
|
|
42
|
-
"@easbot/
|
|
43
|
-
"@easbot/
|
|
42
|
+
"@easbot/sdk": "0.3.29",
|
|
43
|
+
"@easbot/types": "0.3.29"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^25.9.5",
|