@easbot/plugin 0.2.43 → 0.2.45
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/dist/index.cjs +1 -1
- package/dist/index.d.cts +175 -13
- package/dist/index.d.ts +175 -13
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var k=require('zod'),types=require('@easbot/types');require('@easbot/sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var k__default=/*#__PURE__*/_interopDefault(k);function C(s){return {description:s.description,args:s.args,execute:s.execute}}C.schema=k__default.default;var a={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"},Oe=Object.values(o);var d=k.z.string().optional(),T=k.z.object({type:k.z.literal(a.Command),command:k.z.string(),if:d,shell:k.z.enum(["bash","powershell"]).optional(),timeout:k.z.number().positive().optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional(),async:k.z.boolean().optional()}),v=k.z.object({type:k.z.literal(a.Prompt),if:d,timeout:k.z.number().positive().optional(),model:k.z.string().optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional(),runMode:k.z.enum(["session","fork"]).optional(),system:k.z.string().optional(),parts:k.z.array(k.z.unknown())}),P=k.z.object({type:k.z.literal(a.Http),url:k.z.string(),if:d,timeout:k.z.number().positive().optional(),method:k.z.enum(["GET","POST","PUT","DELETE"]).optional(),headers:k.z.record(k.z.string(),k.z.string()).optional(),allowedEnvVars:k.z.array(k.z.string()).optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional()}),H=k.z.object({type:k.z.literal(a.Agent),if:d,timeout:k.z.number().positive().optional(),agent:k.z.string().optional(),model:k.z.string().optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional(),system:k.z.string().optional(),parts:k.z.array(k.z.unknown())}),w=k.z.object({type:k.z.literal(a.Function),handler:k.z.function()}),E=k.z.discriminatedUnion("type",[T,v,P,H,w]),M=k.z.object({event:k.z.string(),matcher:k.z.string().optional(),hooks:k.z.array(E)}),_e=k.z.record(k.z.string(),k.z.array(M)),n=k.z.string().min(1).describe("Session unique identifier"),r=k.z.string().min(1).describe("Message unique identifier"),u=k.z.string().min(1).describe("Tool call unique identifier"),p=k.z.string().optional().describe("Agent name"),c=k.z.string().optional().describe("Model identifier"),y=k.z.object({providerId:k.z.string().describe("Provider ID"),modelId:k.z.string().describe("Model ID"),api:k.z.object({id:k.z.string().describe("API ID"),npm:k.z.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),f=k.z.string().optional().describe("Working directory path"),j=k.z.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),R=k.z.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),z=k.z.object({sessionId:n,source:k.z.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:c,agent:p,cwd:f}),D=k.z.object({sessionId:n,reason:j,duration:k.z.number().positive().optional().describe("Session duration in milliseconds")}),A=k.z.object({sessionId:n,trigger:k.z.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:k.z.number().positive().describe("Current context length"),threshold:k.z.number().positive().describe("Trigger threshold")}),F=k.z.object({sessionId:n,summary:k.z.string().describe("Compaction summary"),previousLength:k.z.number().positive().describe("Previous context length"),newLength:k.z.number().positive().describe("New context length")}),O=k.z.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:c,agent:p}),G=k.z.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:c,agent:p,finishReason:R,tokens:k.z.object({input:k.z.number().int().nonnegative().optional(),output:k.z.number().int().nonnegative().optional(),total:k.z.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),W=k.z.object({sessionId:n,reason:k.z.string().describe("Stop reason")}),B=k.z.object({sessionId:n,error:k.z.string().describe("Error message"),errorType:k.z.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),L=k.z.enum(["user","assistant","system","tool"]),S=k.z.discriminatedUnion("type",[k.z.object({type:k.z.literal("text"),text:k.z.string().describe("Text content")}),k.z.object({type:k.z.literal("image"),source:k.z.object({type:k.z.enum(["base64","url"]),mime:k.z.string().optional().describe("File mime type"),data:k.z.string().describe("File base64 encoding data or url")})}),k.z.object({type:k.z.literal("file"),url:k.z.string().describe("File path"),filename:k.z.string().describe("File name"),mime:k.z.string().optional().describe("File mime type")})]),h=k.z.object({id:r,role:L,content:k.z.union([k.z.string(),k.z.array(S)]),name:k.z.string().optional().describe("Message sender name"),tool_call_id:u.optional().describe("Related tool call ID")}),_=k.z.object({sessionId:n,agent:p,model:c,messageId:r,message:k.z.object({id:r,role:k.z.literal("user"),content:k.z.union([k.z.string(),k.z.array(S)])}).describe("User message")}),q=k.z.object({sessionId:n,messages:k.z.array(h).describe("Messages to transform")}),U=k.z.object({sessionId:n,model:c,system:k.z.array(k.z.string()).describe("Current system prompt")}),l=k.z.record(k.z.string(),k.z.unknown()).describe("Tool call arguments"),N=k.z.object({title:k.z.string().optional().describe("Result title"),content:k.z.string().describe("Result content"),is_error:k.z.boolean().optional().describe("Is error result"),metadata:k.z.record(k.z.string(),k.z.unknown()).optional().describe("Extra metadata")}),Z=k.z.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:k.z.string().describe("Tool name"),callId:u,args:l}),V=k.z.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:k.z.string(),callId:u,args:l,result:N,duration:k.z.number().nonnegative().optional().describe("Execution duration in milliseconds")}),$=k.z.object({sessionId:n,tool:k.z.string(),callId:u,args:l,error:k.z.string().describe("Error message"),errorType:k.z.enum(["timeout","invalid_args","execution_error","permission_denied"])}),K=k.z.object({sessionId:n,toolID:k.z.string().describe("Tool ID"),definition:k.z.object({name:k.z.string(),description:k.z.string().optional(),parameters:k.z.record(k.z.string(),k.z.unknown()).optional()}).describe("Tool definition")}),J=k.z.object({sessionId:n,command:k.z.string().describe("Command name"),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).describe("Command arguments")}),Q=k.z.object({sessionId:n,command:k.z.string().describe("Command name"),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).optional(),result:k.z.object({info:k.z.unknown().optional().describe("Message info"),parts:k.z.array(k.z.unknown()).optional().describe("Message parts"),title:k.z.string().optional().describe("Result title"),metadata:k.z.record(k.z.string(),k.z.unknown()).optional().describe("Result metadata"),output:k.z.string().optional().describe("Result output"),success:k.z.boolean().optional().describe("Whether execution succeeded"),error:k.z.string().optional().describe("Error message if failed")}).describe("Command execution result")}),X=k.z.enum(["read","write","exec","admin"]),Y=k.z.object({tool:k.z.string().describe("Tool name requesting permission"),args:l.optional(),level:X.optional(),reason:k.z.string().optional().describe("Reason for permission request")}),ee=k.z.object({sessionId:n,request:Y}),te=k.z.object({sessionId:n,tool:k.z.string(),reason:k.z.string().optional()}),x=k.z.enum(["openai","anthropic","google","azure","custom"]),oe=k.z.object({temperature:k.z.number().min(0).max(2).optional(),topP:k.z.number().min(0).max(1).optional(),topK:k.z.number().int().positive().optional(),maxTokens:k.z.number().int().positive().optional(),stopSequences:k.z.array(k.z.string()).optional(),responseFormat:k.z.enum(["text","json_object"]).optional()}),ne=k.z.object({sessionId:n,agent:p,model:y,provider:x,params:oe.partial().optional()}),re=k.z.object({sessionId:n,agent:p,model:y,provider:x,headers:k.z.record(k.z.string(),k.z.string()).optional()}),se=k.z.object({cwd:f.describe("Working directory"),sessionId:n.optional(),callId:u.optional()}),ie=k.z.object({sessionId:n,messageId:r,partId:k.z.string().describe("Text part ID"),text:k.z.string().describe("Completed text")}),ae=k.z.object({sessionId:n,mode:k.z.enum(["agent","chat","query"]).describe("Build mode"),providerId:k.z.string().optional()}),pe=k.z.object({sessionId:n,context:k.z.object({messages:k.z.array(h),system:k.z.array(k.z.string()),metadata:k.z.record(k.z.string(),k.z.unknown())}).describe("Built context")}),me=k.z.object({gatewayID:k.z.string().describe("Gateway ID"),messageId:r,message:k.z.unknown().describe("Received message")}),ue=k.z.object({gatewayID:k.z.string(),messageId:r,message:k.z.unknown(),sessionId:n.optional()}),ce=k.z.object({gatewayID:k.z.string(),messageId:r,result:k.z.unknown().optional()}),de=k.z.object({gatewayID:k.z.string(),messageId:r,message:k.z.unknown(),target:k.z.string().optional().describe("Send target")}),le=k.z.object({gatewayID:k.z.string(),messageId:r,sessionId:n.optional(),channel:k.z.object({platform:k.z.string(),channelId:k.z.string()}),timestamp:k.z.number().describe("Delivery timestamp")}),ge=k.z.object({gatewayID:k.z.string(),messageId:r,sessionId:n.optional(),channel:k.z.object({platform:k.z.string(),channelId:k.z.string()}),timestamp:k.z.number().describe("Read timestamp")}),be=k.z.object({sessionId:n.optional(),timestamp:k.z.number().describe("Heartbeat timestamp"),name:k.z.string().optional().describe("Heartbeat name")}),Ie=k.z.object({sessionId:n.optional(),timestamp:k.z.number(),duration:k.z.number().nonnegative().optional()}),ye=k.z.object({taskID:k.z.string().describe("Task ID"),taskName:k.z.string().optional(),timestamp:k.z.number(),payload:k.z.record(k.z.string(),k.z.unknown()).optional()}),fe=k.z.object({taskID:k.z.string(),timestamp:k.z.number(),success:k.z.boolean(),result:k.z.record(k.z.string(),k.z.unknown()).optional(),error:k.z.string().optional()}),Se=k.z.object({taskId:k.z.string().describe("Command task unique identifier"),taskName:k.z.string().describe("Command task name"),command:k.z.string().describe("Command name"),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).optional().describe("Command arguments"),sessionId:k.z.string().optional().describe("Session ID"),timestamp:k.z.number().describe("Trigger timestamp")}),he=k.z.object({taskId:k.z.string(),timestamp:k.z.number(),success:k.z.boolean(),output:k.z.string().optional(),error:k.z.string().optional(),duration:k.z.number().describe("Execution duration in milliseconds")}),g=k.z.enum(["tool","scheduler","cli","api"]),xe=k.z.object({taskId:k.z.string().describe("Task unique identifier"),sessionId:k.z.string().describe("Session ID for this task"),source:g.describe("Task source: tool, scheduler, cli, api"),agentType:k.z.string().describe("Agent type to execute this task"),description:k.z.string().describe("Task description"),prompt:k.z.string().describe("Task prompt content"),timeout:k.z.number().positive().optional().describe("Task timeout in milliseconds")}),ke=k.z.object({taskId:k.z.string().describe("Task unique identifier"),sessionId:k.z.string().describe("Session ID for this task"),source:g.describe("Task source: tool, scheduler, cli, api")}),Ce=k.z.object({taskId:k.z.string(),sessionId:k.z.string(),source:g,step:k.z.number().describe("Current step number"),totalSteps:k.z.number().optional().describe("Total number of steps"),output:k.z.string().describe("Progress output content"),timestamp:k.z.number().describe("Progress timestamp")}),Te=k.z.object({taskId:k.z.string(),sessionId:k.z.string(),source:g,result:k.z.string().describe("Task result content"),duration:k.z.number().nonnegative().describe("Task duration in milliseconds"),attachments:k.z.array(k.z.unknown()).optional().describe("Task result attachments"),error:k.z.string().optional().describe("Error message if task failed"),agentType:k.z.string().optional().describe("Agent type that executed the task"),metadata:k.z.record(k.z.string(),k.z.unknown()).optional().describe("Additional metadata for the task result")}),ve=k.z.object({sessionId:k.z.string().describe("Session ID"),step:k.z.number().describe("Current step number"),lastUserId:k.z.string().describe("Last user message ID"),result:k.z.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),Pe=k.z.object({sessionId:k.z.string().describe("Session ID"),step:k.z.number().describe("Current step number"),lastUserId:k.z.string().describe("Last user message ID"),result:k.z.enum(["stop","continue"]).describe("Loop result: stop or continue")}),I={[o.SessionStart]:z,[o.SessionEnd]:D,[o.SessionCompacting]:A,[o.SessionCompact]:F,[o.StepStart]:O,[o.StepFinish]:G,[o.StepStop]:W,[o.StepStopFailure]:B,[o.MessageReceive]:_,[o.MessageTransform]:q,[o.SystemTransform]:U,[o.ToolBefore]:Z,[o.ToolAfter]:V,[o.ToolFailure]:$,[o.ToolDefinition]:K,[o.CommandBefore]:J,[o.CommandAfter]:Q,[o.PermissionAsk]:ee,[o.PermissionDenied]:te,[o.LlmParams]:ne,[o.LlmHeaders]:re,[o.ShellEnv]:se,[o.TextComplete]:ie,[o.ContextBuildBefore]:ae,[o.ContextBuildAfter]:pe,[o.GatewayMessageReceive]:me,[o.GatewayMessageProcess]:ue,[o.GatewayMessageComplete]:ce,[o.GatewayMessageSend]:de,[o.GatewayMessageDelivered]:le,[o.GatewayMessageRead]:ge,[o.HeartbeatTrigger]:be,[o.HeartbeatComplete]:Ie,[o.ScheduledTaskTrigger]:ye,[o.ScheduledTaskComplete]:fe,[o.CommandTrigger]:Se,[o.CommandComplete]:he,[o.TaskStart]:xe,[o.TaskRunning]:ke,[o.TaskProgress]:Ce,[o.TaskComplete]:Te,[o.LoopStart]:ve,[o.LoopEnd]:Pe};function qe(s){return I[s]}function Ue(s,b){let m=I[s];if(!m)throw new Error(`No schema found for event: ${s}`);return m.parse(b)}function Ne(s,b){let m=I[s];return m?m.safeParse(b):{success:false,error:new k.z.ZodError([{code:"custom",path:[],message:`No schema found for event: ${s}`}])}}var et=k.z.enum(["command","mcp","skill"]).describe("Command source"),He=k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).describe("Command arguments"),we=k.z.discriminatedUnion("type",[k.z.object({type:k.z.literal("text"),text:k.z.string().describe("Text content")}),k.z.object({type:k.z.literal("image"),source:k.z.object({type:k.z.enum(["base64","url"]),mime:k.z.string().describe("File mime type"),data:k.z.string().describe("File base64 encoding data or url")})}),k.z.object({type:k.z.literal("file"),url:k.z.string().describe("File path"),filename:k.z.string().describe("File name"),mime:k.z.string().optional().describe("File mime type")})]),tt=k.z.object({name:k.z.string().describe("Command name"),description:k.z.string().describe("Command description"),scope:k.z.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:k.z.string().optional().describe("Specified agent name"),model:k.z.string().optional().describe("Specified model"),hints:k.z.array(k.z.string()).optional().describe("Argument hints"),commandType:k.z.enum(["prompt","local"]).optional().describe("Command type"),hidden:k.z.boolean().optional().describe("Whether hidden")}),ot=k.z.object({sessionId:k.z.string().describe("Session ID"),directory:k.z.string().describe("Working directory"),model:k.z.string().optional().describe("Model identifier"),agent:k.z.string().optional().describe("Agent name"),arguments:He.describe("Command arguments")}),Ee=k.z.record(k.z.string(),k.z.unknown()).describe("Result metadata"),nt=k.z.object({title:k.z.string().describe("Result title"),metadata:Ee.describe("Result metadata"),output:k.z.string().describe("Result output"),parts:k.z.array(we).optional().describe("Result parts"),success:k.z.boolean().describe("Whether execution succeeded"),error:k.z.string().optional().describe("Error message if failed")}),rt=k.z.object({agent:k.z.object({name:k.z.string().describe("Agent name"),model:k.z.string().optional().describe("Agent model")}).optional().describe("Agent context")}),st=k.z.object({isEnabled:k.z.boolean().optional().describe("Is enabled check result")});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=H;exports.AgentSchema=p;exports.CallIDSchema=u;exports.CommandAfterInputSchema=Q;exports.CommandArgumentsSchema=He;exports.CommandBeforeInputSchema=J;exports.CommandCompleteInputSchema=he;exports.CommandExecuteResultMetadataSchema=Ee;exports.CommandExecuteResultSchema=nt;exports.CommandExecutionContextSchema=ot;exports.CommandExecutorSchema=T;exports.CommandInitContextSchema=rt;exports.CommandInitResultSchema=st;exports.CommandMetadataSchema=tt;exports.CommandPromptPartSchema=we;exports.CommandSourceSchema=et;exports.CommandTriggerInputSchema=Se;exports.ContentPartSchema=S;exports.ContextBuildAfterInputSchema=pe;exports.ContextBuildBeforeInputSchema=ae;exports.CwdSchema=f;exports.EndReasonSchema=j;exports.EventInputSchemas=I;exports.FinishReasonSchema=R;exports.FunctionExecutorSchema=w;exports.GatewayMessageCompleteInputSchema=ce;exports.GatewayMessageDeliveredInputSchema=le;exports.GatewayMessageProcessInputSchema=ue;exports.GatewayMessageReadInputSchema=ge;exports.GatewayMessageReceiveInputSchema=me;exports.GatewayMessageSendInputSchema=de;exports.HOOK_EVENTS=Oe;exports.HeartbeatCompleteInputSchema=Ie;exports.HeartbeatTriggerInputSchema=be;exports.HookEvent=o;exports.HookExecutorSchema=E;exports.HookMatcherSchema=M;exports.HookType=a;exports.HooksConfigSchema=_e;exports.HttpExecutorSchema=P;exports.LlmHeadersInputSchema=re;exports.LlmParamsInputSchema=ne;exports.LlmParamsSchema=oe;exports.LlmProviderSchema=x;exports.LoopEndInputSchema=Pe;exports.LoopStartInputSchema=ve;exports.MessageIDSchema=r;exports.MessageReceiveInputSchema=_;exports.MessageRoleSchema=L;exports.MessageSchema=h;exports.MessageTransformInputSchema=q;exports.ModelObjectSchema=y;exports.ModelSchema=c;exports.PermissionAskInputSchema=ee;exports.PermissionDeniedInputSchema=te;exports.PermissionLevelSchema=X;exports.PermissionRequestSchema=Y;exports.PromptExecutorSchema=v;exports.ScheduledTaskCompleteInputSchema=fe;exports.ScheduledTaskTriggerInputSchema=ye;exports.SessionCompactInputSchema=F;exports.SessionCompactingInputSchema=A;exports.SessionEndInputSchema=D;exports.SessionIDSchema=n;exports.SessionStartInputSchema=z;exports.ShellEnvInputSchema=se;exports.StepFinishInputSchema=G;exports.StepStartInputSchema=O;exports.StepStopFailureInputSchema=B;exports.StepStopInputSchema=W;exports.SystemTransformInputSchema=U;exports.TaskCompleteInputSchema=Te;exports.TaskProgressInputSchema=Ce;exports.TaskRunningInputSchema=ke;exports.TaskSourceSchema=g;exports.TaskStartInputSchema=xe;exports.TextCompleteInputSchema=ie;exports.ToolAfterInputSchema=V;exports.ToolArgsSchema=l;exports.ToolBeforeInputSchema=Z;exports.ToolDefinitionInputSchema=K;exports.ToolFailureInputSchema=$;exports.ToolResultSchema=N;exports.getEventInputSchema=qe;exports.safeValidateHookInput=Ne;exports.tool=C;exports.validateHookInput=Ue;
|
|
1
|
+
'use strict';var k=require('zod'),types=require('@easbot/types');require('@easbot/sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var k__default=/*#__PURE__*/_interopDefault(k);function T(s){return {description:s.description,args:s.args,execute:s.execute}}T.schema=k__default.default;var a={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"},Be=Object.values(o);var d=k.z.string().optional(),C=k.z.object({type:k.z.literal(a.Command),command:k.z.string(),if:d,shell:k.z.enum(["bash","powershell"]).optional(),timeout:k.z.number().positive().optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional(),async:k.z.boolean().optional()}),v=k.z.object({type:k.z.literal(a.Prompt),if:d,timeout:k.z.number().positive().optional(),model:k.z.string().optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional(),runMode:k.z.enum(["session","fork"]).optional(),system:k.z.string().optional(),parts:k.z.array(k.z.unknown())}),P=k.z.object({type:k.z.literal(a.Http),url:k.z.string(),if:d,timeout:k.z.number().positive().optional(),method:k.z.enum(["GET","POST","PUT","DELETE"]).optional(),headers:k.z.record(k.z.string(),k.z.string()).optional(),allowedEnvVars:k.z.array(k.z.string()).optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional()}),H=k.z.object({type:k.z.literal(a.Agent),if:d,timeout:k.z.number().positive().optional(),agent:k.z.string().optional(),model:k.z.string().optional(),statusMessage:k.z.string().optional(),once:k.z.boolean().optional(),system:k.z.string().optional(),parts:k.z.array(k.z.unknown())}),w=k.z.object({type:k.z.literal(a.Function),handler:k.z.function()}),E=k.z.discriminatedUnion("type",[C,v,P,H,w]),M=k.z.object({event:k.z.string(),matcher:k.z.string().optional(),hooks:k.z.array(E)}),Ne=k.z.record(k.z.string(),k.z.array(M)),n=k.z.string().min(1).describe("Session unique identifier"),r=k.z.string().min(1).describe("Message unique identifier"),u=k.z.string().min(1).describe("Tool call unique identifier"),p=k.z.string().optional().describe("Agent name"),c=k.z.string().optional().describe("Model identifier"),y=k.z.object({providerId:k.z.string().describe("Provider ID"),modelId:k.z.string().describe("Model ID"),api:k.z.object({id:k.z.string().describe("API ID"),npm:k.z.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),I=k.z.string().optional().describe("Working directory path"),j=k.z.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),D=k.z.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),z=k.z.object({sessionId:n,source:k.z.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:c,agent:p,cwd:I}),R=k.z.object({sessionId:n,reason:j,duration:k.z.number().positive().optional().describe("Session duration in milliseconds")}),A=k.z.object({sessionId:n,trigger:k.z.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:k.z.number().positive().describe("Current context length"),threshold:k.z.number().positive().describe("Trigger threshold")}),F=k.z.object({sessionId:n,summary:k.z.string().describe("Compaction summary"),previousLength:k.z.number().positive().describe("Previous context length"),newLength:k.z.number().positive().describe("New context length")}),O=k.z.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:c,agent:p}),G=k.z.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:c,agent:p,finishReason:D,tokens:k.z.object({input:k.z.number().int().nonnegative().optional(),output:k.z.number().int().nonnegative().optional(),total:k.z.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),W=k.z.object({sessionId:n,reason:k.z.string().describe("Stop reason")}),B=k.z.object({sessionId:n,error:k.z.string().describe("Error message"),errorType:k.z.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),L=k.z.enum(["user","assistant","system","tool"]),S=k.z.discriminatedUnion("type",[k.z.object({type:k.z.literal("text"),text:k.z.string().describe("Text content")}),k.z.object({type:k.z.literal("image"),source:k.z.object({type:k.z.enum(["base64","url"]),mime:k.z.string().optional().describe("File mime type"),data:k.z.string().describe("File base64 encoding data or url")})}),k.z.object({type:k.z.literal("file"),url:k.z.string().describe("File path"),filename:k.z.string().describe("File name"),mime:k.z.string().optional().describe("File mime type")})]),h=k.z.object({id:r,role:L,content:k.z.union([k.z.string(),k.z.array(S)]),name:k.z.string().optional().describe("Message sender name"),tool_call_id:u.optional().describe("Related tool call ID")}),_=k.z.object({sessionId:n,agent:p,model:c,messageId:r,message:k.z.object({id:r,role:k.z.literal("user"),content:k.z.union([k.z.string(),k.z.array(S)])}).describe("User message")}),q=k.z.object({sessionId:n,messages:k.z.array(h).describe("Messages to transform")}),U=k.z.object({sessionId:n,model:c,system:k.z.array(k.z.string()).describe("Current system prompt")}),l=k.z.record(k.z.string(),k.z.unknown()).describe("Tool call arguments"),N=k.z.object({title:k.z.string().optional().describe("Result title"),content:k.z.string().describe("Result content"),is_error:k.z.boolean().optional().describe("Is error result"),metadata:k.z.record(k.z.string(),k.z.unknown()).optional().describe("Extra metadata")}),Z=k.z.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:k.z.string().describe("Tool name"),callId:u,args:l}),V=k.z.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:k.z.string(),callId:u,args:l,result:N,duration:k.z.number().nonnegative().optional().describe("Execution duration in milliseconds")}),$=k.z.object({sessionId:n,tool:k.z.string(),callId:u,args:l,error:k.z.string().describe("Error message"),errorType:k.z.enum(["timeout","invalid_args","execution_error","permission_denied"])}),K=k.z.object({sessionId:n,toolID:k.z.string().describe("Tool ID"),definition:k.z.object({name:k.z.string(),description:k.z.string().optional(),parameters:k.z.record(k.z.string(),k.z.unknown()).optional()}).describe("Tool definition")}),J=k.z.object({sessionId:n,command:k.z.string().describe("Command name"),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).describe("Command arguments")}),Q=k.z.object({sessionId:n,command:k.z.string().describe("Command name"),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).optional(),result:k.z.object({info:k.z.unknown().optional().describe("Message info"),parts:k.z.array(k.z.unknown()).optional().describe("Message parts"),title:k.z.string().optional().describe("Result title"),metadata:k.z.record(k.z.string(),k.z.unknown()).optional().describe("Result metadata"),output:k.z.string().optional().describe("Result output"),success:k.z.boolean().optional().describe("Whether execution succeeded"),error:k.z.string().optional().describe("Error message if failed")}).describe("Command execution result")}),X=k.z.enum(["read","write","exec","admin"]),Y=k.z.object({tool:k.z.string().describe("Tool name requesting permission"),args:l.optional(),level:X.optional(),reason:k.z.string().optional().describe("Reason for permission request")}),ee=k.z.object({sessionId:n,request:Y}),te=k.z.object({sessionId:n,tool:k.z.string(),reason:k.z.string().optional()}),x=k.z.enum(["openai","anthropic","google","azure","custom"]),oe=k.z.object({temperature:k.z.number().min(0).max(2).optional(),topP:k.z.number().min(0).max(1).optional(),topK:k.z.number().int().positive().optional(),maxTokens:k.z.number().int().positive().optional(),stopSequences:k.z.array(k.z.string()).optional(),responseFormat:k.z.enum(["text","json_object"]).optional()}),ne=k.z.object({sessionId:n,agent:p,model:y,provider:x,params:oe.partial().optional()}),re=k.z.object({sessionId:n,agent:p,model:y,provider:x,headers:k.z.record(k.z.string(),k.z.string()).optional()}),se=k.z.object({cwd:I.describe("Working directory"),sessionId:n.optional(),callId:u.optional()}),ie=k.z.object({sessionId:n,messageId:r,partId:k.z.string().describe("Text part ID"),text:k.z.string().describe("Completed text")}),ae=k.z.object({sessionId:n,mode:k.z.enum(["agent","chat","query"]).describe("Build mode"),providerId:k.z.string().optional()}),pe=k.z.object({sessionId:n,context:k.z.object({messages:k.z.array(h),system:k.z.array(k.z.string()),metadata:k.z.record(k.z.string(),k.z.unknown())}).describe("Built context")}),me=k.z.object({gatewayID:k.z.string().describe("Gateway ID"),messageId:r,message:k.z.unknown().describe("Received message")}),ue=k.z.object({gatewayID:k.z.string(),messageId:r,message:k.z.unknown(),sessionId:n.optional()}),ce=k.z.object({gatewayID:k.z.string(),messageId:r,result:k.z.unknown().optional()}),de=k.z.object({gatewayID:k.z.string(),messageId:r,message:k.z.unknown(),target:k.z.string().optional().describe("Send target")}),le=k.z.object({gatewayID:k.z.string(),messageId:r,sessionId:n.optional(),channel:k.z.object({platform:k.z.string(),channelId:k.z.string()}),timestamp:k.z.number().describe("Delivery timestamp")}),ge=k.z.object({gatewayID:k.z.string(),messageId:r,sessionId:n.optional(),channel:k.z.object({platform:k.z.string(),channelId:k.z.string()}),timestamp:k.z.number().describe("Read timestamp")}),be=k.z.object({type:k.z.literal("command"),config:k.z.object({command:k.z.string(),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).optional()})}),fe=k.z.object({type:k.z.literal("heartbeat"),parts:k.z.array(k.z.unknown()),system:k.z.string().optional(),config:k.z.object({session:k.z.string().optional(),mode:k.z.enum(["session","fork"]).optional(),agent:k.z.string().optional(),model:k.z.string().optional(),tools:k.z.record(k.z.string(),k.z.boolean()).optional()}).optional()}),ye=k.z.object({type:k.z.literal("scheduler"),parts:k.z.array(k.z.unknown()),system:k.z.string().optional(),config:k.z.object({agentType:k.z.string().optional(),transport:k.z.enum(["stdio","http","websocket","cli"]).optional(),model:k.z.string().optional(),tools:k.z.record(k.z.string(),k.z.boolean()).optional()}).optional()}),Ie=k.z.object({taskId:k.z.string().describe("Heartbeat task ID"),timestamp:k.z.number().describe("Heartbeat timestamp"),name:k.z.string().optional().describe("Heartbeat name"),definition:fe.optional()}),Se=k.z.object({taskId:k.z.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:k.z.number(),duration:k.z.number().nonnegative().optional(),success:k.z.boolean().optional(),error:k.z.string().optional()}),he=k.z.object({taskId:k.z.string().describe("Task ID"),taskName:k.z.string().optional(),timestamp:k.z.number(),payload:k.z.record(k.z.string(),k.z.unknown()).optional(),definition:ye.optional()}),xe=k.z.object({taskId:k.z.string(),timestamp:k.z.number(),success:k.z.boolean(),result:k.z.record(k.z.string(),k.z.unknown()).optional(),error:k.z.string().optional()}),ke=k.z.object({taskId:k.z.string().describe("Command task unique identifier"),taskName:k.z.string().describe("Command task name"),command:k.z.string().describe("Command name"),arguments:k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).optional().describe("Command arguments"),timestamp:k.z.number().describe("Trigger timestamp"),definition:be.optional()}),Te=k.z.object({taskId:k.z.string(),timestamp:k.z.number(),success:k.z.boolean(),output:k.z.string().optional(),error:k.z.string().optional(),duration:k.z.number().describe("Execution duration in milliseconds")}),g=k.z.enum(["tool","scheduler","cli","api"]),Ce=k.z.object({taskId:k.z.string().describe("Task unique identifier"),sessionId:k.z.string().describe("Session ID for this task"),source:g.describe("Task source: tool, scheduler, cli, api"),agentType:k.z.string().describe("Agent type to execute this task"),description:k.z.string().describe("Task description"),prompt:k.z.string().describe("Task prompt content"),timeout:k.z.number().positive().optional().describe("Task timeout in milliseconds")}),ve=k.z.object({taskId:k.z.string().describe("Task unique identifier"),sessionId:k.z.string().describe("Session ID for this task"),source:g.describe("Task source: tool, scheduler, cli, api")}),Pe=k.z.object({taskId:k.z.string(),sessionId:k.z.string(),source:g,step:k.z.number().describe("Current step number"),totalSteps:k.z.number().optional().describe("Total number of steps"),output:k.z.string().describe("Progress output content"),timestamp:k.z.number().describe("Progress timestamp")}),He=k.z.object({taskId:k.z.string(),sessionId:k.z.string(),source:g,result:k.z.string().describe("Task result content"),duration:k.z.number().nonnegative().describe("Task duration in milliseconds"),attachments:k.z.array(k.z.unknown()).optional().describe("Task result attachments"),error:k.z.string().optional().describe("Error message if task failed"),agentType:k.z.string().optional().describe("Agent type that executed the task"),metadata:k.z.record(k.z.string(),k.z.unknown()).optional().describe("Additional metadata for the task result")}),we=k.z.object({sessionId:k.z.string().describe("Session ID"),step:k.z.number().describe("Current step number"),lastUserId:k.z.string().describe("Last user message ID"),result:k.z.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),Ee=k.z.object({sessionId:k.z.string().describe("Session ID"),step:k.z.number().describe("Current step number"),lastUserId:k.z.string().describe("Last user message ID"),result:k.z.enum(["stop","continue"]).describe("Loop result: stop or continue")}),f={[o.SessionStart]:z,[o.SessionEnd]:R,[o.SessionCompacting]:A,[o.SessionCompact]:F,[o.StepStart]:O,[o.StepFinish]:G,[o.StepStop]:W,[o.StepStopFailure]:B,[o.MessageReceive]:_,[o.MessageTransform]:q,[o.SystemTransform]:U,[o.ToolBefore]:Z,[o.ToolAfter]:V,[o.ToolFailure]:$,[o.ToolDefinition]:K,[o.CommandBefore]:J,[o.CommandAfter]:Q,[o.PermissionAsk]:ee,[o.PermissionDenied]:te,[o.LlmParams]:ne,[o.LlmHeaders]:re,[o.ShellEnv]:se,[o.TextComplete]:ie,[o.ContextBuildBefore]:ae,[o.ContextBuildAfter]:pe,[o.GatewayMessageReceive]:me,[o.GatewayMessageProcess]:ue,[o.GatewayMessageComplete]:ce,[o.GatewayMessageSend]:de,[o.GatewayMessageDelivered]:le,[o.GatewayMessageRead]:ge,[o.HeartbeatTrigger]:Ie,[o.HeartbeatComplete]:Se,[o.ScheduledTaskTrigger]:he,[o.ScheduledTaskComplete]:xe,[o.CommandTrigger]:ke,[o.CommandComplete]:Te,[o.TaskStart]:Ce,[o.TaskRunning]:ve,[o.TaskProgress]:Pe,[o.TaskComplete]:He,[o.LoopStart]:we,[o.LoopEnd]:Ee};function Ze(s){return f[s]}function Ve(s,b){let m=f[s];if(!m)throw new Error(`No schema found for event: ${s}`);return m.parse(b)}function $e(s,b){let m=f[s];return m?m.safeParse(b):{success:false,error:new k.z.ZodError([{code:"custom",path:[],message:`No schema found for event: ${s}`}])}}var nt=k.z.enum(["command","mcp","skill"]).describe("Command source"),Me=k.z.union([k.z.string(),k.z.record(k.z.string(),k.z.unknown())]).describe("Command arguments"),je=k.z.discriminatedUnion("type",[k.z.object({type:k.z.literal("text"),text:k.z.string().describe("Text content")}),k.z.object({type:k.z.literal("image"),source:k.z.object({type:k.z.enum(["base64","url"]),mime:k.z.string().describe("File mime type"),data:k.z.string().describe("File base64 encoding data or url")})}),k.z.object({type:k.z.literal("file"),url:k.z.string().describe("File path"),filename:k.z.string().describe("File name"),mime:k.z.string().optional().describe("File mime type")})]),rt=k.z.object({name:k.z.string().describe("Command name"),description:k.z.string().describe("Command description"),scope:k.z.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:k.z.string().optional().describe("Specified agent name"),model:k.z.string().optional().describe("Specified model"),hints:k.z.array(k.z.string()).optional().describe("Argument hints"),commandType:k.z.enum(["prompt","local"]).optional().describe("Command type"),hidden:k.z.boolean().optional().describe("Whether hidden")}),st=k.z.object({sessionId:k.z.string().describe("Session ID"),directory:k.z.string().describe("Working directory"),model:k.z.string().optional().describe("Model identifier"),agent:k.z.string().optional().describe("Agent name"),arguments:Me.describe("Command arguments")}),De=k.z.record(k.z.string(),k.z.unknown()).describe("Result metadata"),it=k.z.object({title:k.z.string().describe("Result title"),metadata:De.describe("Result metadata"),output:k.z.string().describe("Result output"),parts:k.z.array(je).optional().describe("Result parts"),success:k.z.boolean().describe("Whether execution succeeded"),error:k.z.string().optional().describe("Error message if failed")}),at=k.z.object({agent:k.z.object({name:k.z.string().describe("Agent name"),model:k.z.string().optional().describe("Agent model")}).optional().describe("Agent context")}),pt=k.z.object({isEnabled:k.z.boolean().optional().describe("Is enabled check result")});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=H;exports.AgentSchema=p;exports.CallIDSchema=u;exports.CommandAfterInputSchema=Q;exports.CommandArgumentsSchema=Me;exports.CommandBeforeInputSchema=J;exports.CommandCompleteInputSchema=Te;exports.CommandExecuteResultMetadataSchema=De;exports.CommandExecuteResultSchema=it;exports.CommandExecutionContextSchema=st;exports.CommandExecutorSchema=C;exports.CommandInitContextSchema=at;exports.CommandInitResultSchema=pt;exports.CommandMetadataSchema=rt;exports.CommandPromptPartSchema=je;exports.CommandSourceSchema=nt;exports.CommandTaskDefinitionSchema=be;exports.CommandTriggerInputSchema=ke;exports.ContentPartSchema=S;exports.ContextBuildAfterInputSchema=pe;exports.ContextBuildBeforeInputSchema=ae;exports.CwdSchema=I;exports.EndReasonSchema=j;exports.EventInputSchemas=f;exports.FinishReasonSchema=D;exports.FunctionExecutorSchema=w;exports.GatewayMessageCompleteInputSchema=ce;exports.GatewayMessageDeliveredInputSchema=le;exports.GatewayMessageProcessInputSchema=ue;exports.GatewayMessageReadInputSchema=ge;exports.GatewayMessageReceiveInputSchema=me;exports.GatewayMessageSendInputSchema=de;exports.HOOK_EVENTS=Be;exports.HeartbeatCompleteInputSchema=Se;exports.HeartbeatTaskDefinitionSchema=fe;exports.HeartbeatTriggerInputSchema=Ie;exports.HookEvent=o;exports.HookExecutorSchema=E;exports.HookMatcherSchema=M;exports.HookType=a;exports.HooksConfigSchema=Ne;exports.HttpExecutorSchema=P;exports.LlmHeadersInputSchema=re;exports.LlmParamsInputSchema=ne;exports.LlmParamsSchema=oe;exports.LlmProviderSchema=x;exports.LoopEndInputSchema=Ee;exports.LoopStartInputSchema=we;exports.MessageIDSchema=r;exports.MessageReceiveInputSchema=_;exports.MessageRoleSchema=L;exports.MessageSchema=h;exports.MessageTransformInputSchema=q;exports.ModelObjectSchema=y;exports.ModelSchema=c;exports.PermissionAskInputSchema=ee;exports.PermissionDeniedInputSchema=te;exports.PermissionLevelSchema=X;exports.PermissionRequestSchema=Y;exports.PromptExecutorSchema=v;exports.ScheduledTaskCompleteInputSchema=xe;exports.ScheduledTaskTriggerInputSchema=he;exports.SchedulerTaskDefinitionSchema=ye;exports.SessionCompactInputSchema=F;exports.SessionCompactingInputSchema=A;exports.SessionEndInputSchema=R;exports.SessionIDSchema=n;exports.SessionStartInputSchema=z;exports.ShellEnvInputSchema=se;exports.StepFinishInputSchema=G;exports.StepStartInputSchema=O;exports.StepStopFailureInputSchema=B;exports.StepStopInputSchema=W;exports.SystemTransformInputSchema=U;exports.TaskCompleteInputSchema=He;exports.TaskProgressInputSchema=Pe;exports.TaskRunningInputSchema=ve;exports.TaskSourceSchema=g;exports.TaskStartInputSchema=Ce;exports.TextCompleteInputSchema=ie;exports.ToolAfterInputSchema=V;exports.ToolArgsSchema=l;exports.ToolBeforeInputSchema=Z;exports.ToolDefinitionInputSchema=K;exports.ToolFailureInputSchema=$;exports.ToolResultSchema=N;exports.getEventInputSchema=Ze;exports.safeValidateHookInput=$e;exports.tool=T;exports.validateHookInput=Ve;
|
package/dist/index.d.cts
CHANGED
|
@@ -892,27 +892,103 @@ declare const GatewayMessageReadInputSchema: z$1.ZodObject<{
|
|
|
892
892
|
timestamp: z$1.ZodNumber;
|
|
893
893
|
}, z$1.core.$strip>;
|
|
894
894
|
type GatewayMessageReadInput = z$1.infer<typeof GatewayMessageReadInputSchema>;
|
|
895
|
+
declare const CommandTaskDefinitionSchema: z$1.ZodObject<{
|
|
896
|
+
type: z$1.ZodLiteral<"command">;
|
|
897
|
+
config: z$1.ZodObject<{
|
|
898
|
+
command: z$1.ZodString;
|
|
899
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
900
|
+
}, z$1.core.$strip>;
|
|
901
|
+
}, z$1.core.$strip>;
|
|
902
|
+
type CommandTaskDefinition = z$1.infer<typeof CommandTaskDefinitionSchema>;
|
|
903
|
+
declare const HeartbeatTaskDefinitionSchema: z$1.ZodObject<{
|
|
904
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
905
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
906
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
907
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
908
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
909
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
910
|
+
session: "session";
|
|
911
|
+
fork: "fork";
|
|
912
|
+
}>>;
|
|
913
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
914
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
915
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
916
|
+
}, z$1.core.$strip>>;
|
|
917
|
+
}, z$1.core.$strip>;
|
|
918
|
+
type HeartbeatTaskDefinition = z$1.infer<typeof HeartbeatTaskDefinitionSchema>;
|
|
919
|
+
declare const SchedulerTaskDefinitionSchema: z$1.ZodObject<{
|
|
920
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
921
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
922
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
923
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
924
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
925
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
926
|
+
http: "http";
|
|
927
|
+
stdio: "stdio";
|
|
928
|
+
websocket: "websocket";
|
|
929
|
+
cli: "cli";
|
|
930
|
+
}>>;
|
|
931
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
932
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
933
|
+
}, z$1.core.$strip>>;
|
|
934
|
+
}, z$1.core.$strip>;
|
|
935
|
+
type SchedulerTaskDefinition = z$1.infer<typeof SchedulerTaskDefinitionSchema>;
|
|
936
|
+
type TaskDefinition = CommandTaskDefinition | HeartbeatTaskDefinition | SchedulerTaskDefinition;
|
|
895
937
|
declare const HeartbeatTriggerInputSchema: z$1.ZodObject<{
|
|
896
|
-
|
|
938
|
+
taskId: z$1.ZodString;
|
|
897
939
|
timestamp: z$1.ZodNumber;
|
|
898
940
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
941
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
942
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
943
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
944
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
945
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
946
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
947
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
948
|
+
session: "session";
|
|
949
|
+
fork: "fork";
|
|
950
|
+
}>>;
|
|
951
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
952
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
953
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
954
|
+
}, z$1.core.$strip>>;
|
|
955
|
+
}, z$1.core.$strip>>;
|
|
899
956
|
}, z$1.core.$strip>;
|
|
900
957
|
type HeartbeatTriggerInput = z$1.infer<typeof HeartbeatTriggerInputSchema>;
|
|
901
958
|
declare const HeartbeatCompleteInputSchema: z$1.ZodObject<{
|
|
959
|
+
taskId: z$1.ZodString;
|
|
902
960
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
903
961
|
timestamp: z$1.ZodNumber;
|
|
904
962
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
963
|
+
success: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
964
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
905
965
|
}, z$1.core.$strip>;
|
|
906
966
|
type HeartbeatCompleteInput = z$1.infer<typeof HeartbeatCompleteInputSchema>;
|
|
907
967
|
declare const ScheduledTaskTriggerInputSchema: z$1.ZodObject<{
|
|
908
|
-
|
|
968
|
+
taskId: z$1.ZodString;
|
|
909
969
|
taskName: z$1.ZodOptional<z$1.ZodString>;
|
|
910
970
|
timestamp: z$1.ZodNumber;
|
|
911
971
|
payload: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
972
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
973
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
974
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
975
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
976
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
977
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
978
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
979
|
+
http: "http";
|
|
980
|
+
stdio: "stdio";
|
|
981
|
+
websocket: "websocket";
|
|
982
|
+
cli: "cli";
|
|
983
|
+
}>>;
|
|
984
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
985
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
986
|
+
}, z$1.core.$strip>>;
|
|
987
|
+
}, z$1.core.$strip>>;
|
|
912
988
|
}, z$1.core.$strip>;
|
|
913
989
|
type ScheduledTaskTriggerInput = z$1.infer<typeof ScheduledTaskTriggerInputSchema>;
|
|
914
990
|
declare const ScheduledTaskCompleteInputSchema: z$1.ZodObject<{
|
|
915
|
-
|
|
991
|
+
taskId: z$1.ZodString;
|
|
916
992
|
timestamp: z$1.ZodNumber;
|
|
917
993
|
success: z$1.ZodBoolean;
|
|
918
994
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
@@ -924,8 +1000,14 @@ declare const CommandTriggerInputSchema: z$1.ZodObject<{
|
|
|
924
1000
|
taskName: z$1.ZodString;
|
|
925
1001
|
command: z$1.ZodString;
|
|
926
1002
|
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
927
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
928
1003
|
timestamp: z$1.ZodNumber;
|
|
1004
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1005
|
+
type: z$1.ZodLiteral<"command">;
|
|
1006
|
+
config: z$1.ZodObject<{
|
|
1007
|
+
command: z$1.ZodString;
|
|
1008
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1009
|
+
}, z$1.core.$strip>;
|
|
1010
|
+
}, z$1.core.$strip>>;
|
|
929
1011
|
}, z$1.core.$strip>;
|
|
930
1012
|
type CommandTriggerInput = z$1.infer<typeof CommandTriggerInputSchema>;
|
|
931
1013
|
declare const CommandCompleteInputSchema: z$1.ZodObject<{
|
|
@@ -1403,23 +1485,57 @@ declare const EventInputSchemas: {
|
|
|
1403
1485
|
timestamp: z$1.ZodNumber;
|
|
1404
1486
|
}, z$1.core.$strip>;
|
|
1405
1487
|
readonly "scheduler.heartbeat.trigger": z$1.ZodObject<{
|
|
1406
|
-
|
|
1488
|
+
taskId: z$1.ZodString;
|
|
1407
1489
|
timestamp: z$1.ZodNumber;
|
|
1408
1490
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1491
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1492
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
1493
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1494
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1495
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1496
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
1497
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1498
|
+
session: "session";
|
|
1499
|
+
fork: "fork";
|
|
1500
|
+
}>>;
|
|
1501
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1502
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1503
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1504
|
+
}, z$1.core.$strip>>;
|
|
1505
|
+
}, z$1.core.$strip>>;
|
|
1409
1506
|
}, z$1.core.$strip>;
|
|
1410
1507
|
readonly "scheduler.heartbeat.complete": z$1.ZodObject<{
|
|
1508
|
+
taskId: z$1.ZodString;
|
|
1411
1509
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1412
1510
|
timestamp: z$1.ZodNumber;
|
|
1413
1511
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1512
|
+
success: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1513
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
1414
1514
|
}, z$1.core.$strip>;
|
|
1415
1515
|
readonly "scheduler.task.trigger": z$1.ZodObject<{
|
|
1416
|
-
|
|
1516
|
+
taskId: z$1.ZodString;
|
|
1417
1517
|
taskName: z$1.ZodOptional<z$1.ZodString>;
|
|
1418
1518
|
timestamp: z$1.ZodNumber;
|
|
1419
1519
|
payload: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1520
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1521
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
1522
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1523
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1524
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1525
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
1526
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1527
|
+
http: "http";
|
|
1528
|
+
stdio: "stdio";
|
|
1529
|
+
websocket: "websocket";
|
|
1530
|
+
cli: "cli";
|
|
1531
|
+
}>>;
|
|
1532
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1533
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1534
|
+
}, z$1.core.$strip>>;
|
|
1535
|
+
}, z$1.core.$strip>>;
|
|
1420
1536
|
}, z$1.core.$strip>;
|
|
1421
1537
|
readonly "scheduler.task.complete": z$1.ZodObject<{
|
|
1422
|
-
|
|
1538
|
+
taskId: z$1.ZodString;
|
|
1423
1539
|
timestamp: z$1.ZodNumber;
|
|
1424
1540
|
success: z$1.ZodBoolean;
|
|
1425
1541
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
@@ -1430,8 +1546,14 @@ declare const EventInputSchemas: {
|
|
|
1430
1546
|
taskName: z$1.ZodString;
|
|
1431
1547
|
command: z$1.ZodString;
|
|
1432
1548
|
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1433
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1434
1549
|
timestamp: z$1.ZodNumber;
|
|
1550
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1551
|
+
type: z$1.ZodLiteral<"command">;
|
|
1552
|
+
config: z$1.ZodObject<{
|
|
1553
|
+
command: z$1.ZodString;
|
|
1554
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1555
|
+
}, z$1.core.$strip>;
|
|
1556
|
+
}, z$1.core.$strip>>;
|
|
1435
1557
|
}, z$1.core.$strip>;
|
|
1436
1558
|
readonly "scheduler.command.complete": z$1.ZodObject<{
|
|
1437
1559
|
taskId: z$1.ZodString;
|
|
@@ -1801,20 +1923,54 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1801
1923
|
messageId: z$1.ZodString;
|
|
1802
1924
|
result: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1803
1925
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1804
|
-
|
|
1926
|
+
taskId: z$1.ZodString;
|
|
1805
1927
|
timestamp: z$1.ZodNumber;
|
|
1806
1928
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1929
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1930
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
1931
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1932
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1933
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1934
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
1935
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1936
|
+
session: "session";
|
|
1937
|
+
fork: "fork";
|
|
1938
|
+
}>>;
|
|
1939
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1940
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1941
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1942
|
+
}, z$1.core.$strip>>;
|
|
1943
|
+
}, z$1.core.$strip>>;
|
|
1807
1944
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1945
|
+
taskId: z$1.ZodString;
|
|
1808
1946
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1809
1947
|
timestamp: z$1.ZodNumber;
|
|
1810
1948
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1949
|
+
success: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1950
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
1811
1951
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1812
|
-
|
|
1952
|
+
taskId: z$1.ZodString;
|
|
1813
1953
|
taskName: z$1.ZodOptional<z$1.ZodString>;
|
|
1814
1954
|
timestamp: z$1.ZodNumber;
|
|
1815
1955
|
payload: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1956
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1957
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
1958
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1959
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1960
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1961
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
1962
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1963
|
+
http: "http";
|
|
1964
|
+
stdio: "stdio";
|
|
1965
|
+
websocket: "websocket";
|
|
1966
|
+
cli: "cli";
|
|
1967
|
+
}>>;
|
|
1968
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1969
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1970
|
+
}, z$1.core.$strip>>;
|
|
1971
|
+
}, z$1.core.$strip>>;
|
|
1816
1972
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1817
|
-
|
|
1973
|
+
taskId: z$1.ZodString;
|
|
1818
1974
|
timestamp: z$1.ZodNumber;
|
|
1819
1975
|
success: z$1.ZodBoolean;
|
|
1820
1976
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
@@ -1886,8 +2042,14 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1886
2042
|
taskName: z$1.ZodString;
|
|
1887
2043
|
command: z$1.ZodString;
|
|
1888
2044
|
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1889
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1890
2045
|
timestamp: z$1.ZodNumber;
|
|
2046
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
2047
|
+
type: z$1.ZodLiteral<"command">;
|
|
2048
|
+
config: z$1.ZodObject<{
|
|
2049
|
+
command: z$1.ZodString;
|
|
2050
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
2051
|
+
}, z$1.core.$strip>;
|
|
2052
|
+
}, z$1.core.$strip>>;
|
|
1891
2053
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1892
2054
|
taskId: z$1.ZodString;
|
|
1893
2055
|
timestamp: z$1.ZodNumber;
|
|
@@ -2227,4 +2389,4 @@ interface PluginDefinition {
|
|
|
2227
2389
|
'context.build.after'?: (input: ContextBuildAfterInput, output: HookOutputWrapper<ContextBuildAfterInput>) => Promise<void>;
|
|
2228
2390
|
}
|
|
2229
2391
|
|
|
2230
|
-
export { AgentExecutorSchema, type AgentHookDefinition, AgentSchema, 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 CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, CwdSchema, EndReasonSchema, EventInputSchemas, 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 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, 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 SessionCompactInput, SessionCompactInputSchema, type SessionCompactingInput, SessionCompactingInputSchema, type SessionEndInput, SessionEndInputSchema, SessionIDSchema, type SessionStartInput, SessionStartInputSchema, type ShellEnvInput, ShellEnvInputSchema, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, 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, getEventInputSchema, safeValidateHookInput, tool, validateHookInput };
|
|
2392
|
+
export { AgentExecutorSchema, type AgentHookDefinition, AgentSchema, 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, CwdSchema, EndReasonSchema, EventInputSchemas, 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, 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 StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, 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, getEventInputSchema, safeValidateHookInput, tool, validateHookInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -892,27 +892,103 @@ declare const GatewayMessageReadInputSchema: z$1.ZodObject<{
|
|
|
892
892
|
timestamp: z$1.ZodNumber;
|
|
893
893
|
}, z$1.core.$strip>;
|
|
894
894
|
type GatewayMessageReadInput = z$1.infer<typeof GatewayMessageReadInputSchema>;
|
|
895
|
+
declare const CommandTaskDefinitionSchema: z$1.ZodObject<{
|
|
896
|
+
type: z$1.ZodLiteral<"command">;
|
|
897
|
+
config: z$1.ZodObject<{
|
|
898
|
+
command: z$1.ZodString;
|
|
899
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
900
|
+
}, z$1.core.$strip>;
|
|
901
|
+
}, z$1.core.$strip>;
|
|
902
|
+
type CommandTaskDefinition = z$1.infer<typeof CommandTaskDefinitionSchema>;
|
|
903
|
+
declare const HeartbeatTaskDefinitionSchema: z$1.ZodObject<{
|
|
904
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
905
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
906
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
907
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
908
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
909
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
910
|
+
session: "session";
|
|
911
|
+
fork: "fork";
|
|
912
|
+
}>>;
|
|
913
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
914
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
915
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
916
|
+
}, z$1.core.$strip>>;
|
|
917
|
+
}, z$1.core.$strip>;
|
|
918
|
+
type HeartbeatTaskDefinition = z$1.infer<typeof HeartbeatTaskDefinitionSchema>;
|
|
919
|
+
declare const SchedulerTaskDefinitionSchema: z$1.ZodObject<{
|
|
920
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
921
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
922
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
923
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
924
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
925
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
926
|
+
http: "http";
|
|
927
|
+
stdio: "stdio";
|
|
928
|
+
websocket: "websocket";
|
|
929
|
+
cli: "cli";
|
|
930
|
+
}>>;
|
|
931
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
932
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
933
|
+
}, z$1.core.$strip>>;
|
|
934
|
+
}, z$1.core.$strip>;
|
|
935
|
+
type SchedulerTaskDefinition = z$1.infer<typeof SchedulerTaskDefinitionSchema>;
|
|
936
|
+
type TaskDefinition = CommandTaskDefinition | HeartbeatTaskDefinition | SchedulerTaskDefinition;
|
|
895
937
|
declare const HeartbeatTriggerInputSchema: z$1.ZodObject<{
|
|
896
|
-
|
|
938
|
+
taskId: z$1.ZodString;
|
|
897
939
|
timestamp: z$1.ZodNumber;
|
|
898
940
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
941
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
942
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
943
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
944
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
945
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
946
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
947
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
948
|
+
session: "session";
|
|
949
|
+
fork: "fork";
|
|
950
|
+
}>>;
|
|
951
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
952
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
953
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
954
|
+
}, z$1.core.$strip>>;
|
|
955
|
+
}, z$1.core.$strip>>;
|
|
899
956
|
}, z$1.core.$strip>;
|
|
900
957
|
type HeartbeatTriggerInput = z$1.infer<typeof HeartbeatTriggerInputSchema>;
|
|
901
958
|
declare const HeartbeatCompleteInputSchema: z$1.ZodObject<{
|
|
959
|
+
taskId: z$1.ZodString;
|
|
902
960
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
903
961
|
timestamp: z$1.ZodNumber;
|
|
904
962
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
963
|
+
success: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
964
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
905
965
|
}, z$1.core.$strip>;
|
|
906
966
|
type HeartbeatCompleteInput = z$1.infer<typeof HeartbeatCompleteInputSchema>;
|
|
907
967
|
declare const ScheduledTaskTriggerInputSchema: z$1.ZodObject<{
|
|
908
|
-
|
|
968
|
+
taskId: z$1.ZodString;
|
|
909
969
|
taskName: z$1.ZodOptional<z$1.ZodString>;
|
|
910
970
|
timestamp: z$1.ZodNumber;
|
|
911
971
|
payload: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
972
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
973
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
974
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
975
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
976
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
977
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
978
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
979
|
+
http: "http";
|
|
980
|
+
stdio: "stdio";
|
|
981
|
+
websocket: "websocket";
|
|
982
|
+
cli: "cli";
|
|
983
|
+
}>>;
|
|
984
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
985
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
986
|
+
}, z$1.core.$strip>>;
|
|
987
|
+
}, z$1.core.$strip>>;
|
|
912
988
|
}, z$1.core.$strip>;
|
|
913
989
|
type ScheduledTaskTriggerInput = z$1.infer<typeof ScheduledTaskTriggerInputSchema>;
|
|
914
990
|
declare const ScheduledTaskCompleteInputSchema: z$1.ZodObject<{
|
|
915
|
-
|
|
991
|
+
taskId: z$1.ZodString;
|
|
916
992
|
timestamp: z$1.ZodNumber;
|
|
917
993
|
success: z$1.ZodBoolean;
|
|
918
994
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
@@ -924,8 +1000,14 @@ declare const CommandTriggerInputSchema: z$1.ZodObject<{
|
|
|
924
1000
|
taskName: z$1.ZodString;
|
|
925
1001
|
command: z$1.ZodString;
|
|
926
1002
|
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
927
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
928
1003
|
timestamp: z$1.ZodNumber;
|
|
1004
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1005
|
+
type: z$1.ZodLiteral<"command">;
|
|
1006
|
+
config: z$1.ZodObject<{
|
|
1007
|
+
command: z$1.ZodString;
|
|
1008
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1009
|
+
}, z$1.core.$strip>;
|
|
1010
|
+
}, z$1.core.$strip>>;
|
|
929
1011
|
}, z$1.core.$strip>;
|
|
930
1012
|
type CommandTriggerInput = z$1.infer<typeof CommandTriggerInputSchema>;
|
|
931
1013
|
declare const CommandCompleteInputSchema: z$1.ZodObject<{
|
|
@@ -1403,23 +1485,57 @@ declare const EventInputSchemas: {
|
|
|
1403
1485
|
timestamp: z$1.ZodNumber;
|
|
1404
1486
|
}, z$1.core.$strip>;
|
|
1405
1487
|
readonly "scheduler.heartbeat.trigger": z$1.ZodObject<{
|
|
1406
|
-
|
|
1488
|
+
taskId: z$1.ZodString;
|
|
1407
1489
|
timestamp: z$1.ZodNumber;
|
|
1408
1490
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1491
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1492
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
1493
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1494
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1495
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1496
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
1497
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1498
|
+
session: "session";
|
|
1499
|
+
fork: "fork";
|
|
1500
|
+
}>>;
|
|
1501
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1502
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1503
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1504
|
+
}, z$1.core.$strip>>;
|
|
1505
|
+
}, z$1.core.$strip>>;
|
|
1409
1506
|
}, z$1.core.$strip>;
|
|
1410
1507
|
readonly "scheduler.heartbeat.complete": z$1.ZodObject<{
|
|
1508
|
+
taskId: z$1.ZodString;
|
|
1411
1509
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1412
1510
|
timestamp: z$1.ZodNumber;
|
|
1413
1511
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1512
|
+
success: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1513
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
1414
1514
|
}, z$1.core.$strip>;
|
|
1415
1515
|
readonly "scheduler.task.trigger": z$1.ZodObject<{
|
|
1416
|
-
|
|
1516
|
+
taskId: z$1.ZodString;
|
|
1417
1517
|
taskName: z$1.ZodOptional<z$1.ZodString>;
|
|
1418
1518
|
timestamp: z$1.ZodNumber;
|
|
1419
1519
|
payload: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1520
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1521
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
1522
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1523
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1524
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1525
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
1526
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1527
|
+
http: "http";
|
|
1528
|
+
stdio: "stdio";
|
|
1529
|
+
websocket: "websocket";
|
|
1530
|
+
cli: "cli";
|
|
1531
|
+
}>>;
|
|
1532
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1533
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1534
|
+
}, z$1.core.$strip>>;
|
|
1535
|
+
}, z$1.core.$strip>>;
|
|
1420
1536
|
}, z$1.core.$strip>;
|
|
1421
1537
|
readonly "scheduler.task.complete": z$1.ZodObject<{
|
|
1422
|
-
|
|
1538
|
+
taskId: z$1.ZodString;
|
|
1423
1539
|
timestamp: z$1.ZodNumber;
|
|
1424
1540
|
success: z$1.ZodBoolean;
|
|
1425
1541
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
@@ -1430,8 +1546,14 @@ declare const EventInputSchemas: {
|
|
|
1430
1546
|
taskName: z$1.ZodString;
|
|
1431
1547
|
command: z$1.ZodString;
|
|
1432
1548
|
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1433
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1434
1549
|
timestamp: z$1.ZodNumber;
|
|
1550
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1551
|
+
type: z$1.ZodLiteral<"command">;
|
|
1552
|
+
config: z$1.ZodObject<{
|
|
1553
|
+
command: z$1.ZodString;
|
|
1554
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1555
|
+
}, z$1.core.$strip>;
|
|
1556
|
+
}, z$1.core.$strip>>;
|
|
1435
1557
|
}, z$1.core.$strip>;
|
|
1436
1558
|
readonly "scheduler.command.complete": z$1.ZodObject<{
|
|
1437
1559
|
taskId: z$1.ZodString;
|
|
@@ -1801,20 +1923,54 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1801
1923
|
messageId: z$1.ZodString;
|
|
1802
1924
|
result: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1803
1925
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1804
|
-
|
|
1926
|
+
taskId: z$1.ZodString;
|
|
1805
1927
|
timestamp: z$1.ZodNumber;
|
|
1806
1928
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1929
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1930
|
+
type: z$1.ZodLiteral<"heartbeat">;
|
|
1931
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1932
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1933
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1934
|
+
session: z$1.ZodOptional<z$1.ZodString>;
|
|
1935
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1936
|
+
session: "session";
|
|
1937
|
+
fork: "fork";
|
|
1938
|
+
}>>;
|
|
1939
|
+
agent: z$1.ZodOptional<z$1.ZodString>;
|
|
1940
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1941
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1942
|
+
}, z$1.core.$strip>>;
|
|
1943
|
+
}, z$1.core.$strip>>;
|
|
1807
1944
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1945
|
+
taskId: z$1.ZodString;
|
|
1808
1946
|
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1809
1947
|
timestamp: z$1.ZodNumber;
|
|
1810
1948
|
duration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1949
|
+
success: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1950
|
+
error: z$1.ZodOptional<z$1.ZodString>;
|
|
1811
1951
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1812
|
-
|
|
1952
|
+
taskId: z$1.ZodString;
|
|
1813
1953
|
taskName: z$1.ZodOptional<z$1.ZodString>;
|
|
1814
1954
|
timestamp: z$1.ZodNumber;
|
|
1815
1955
|
payload: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1956
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
1957
|
+
type: z$1.ZodLiteral<"scheduler">;
|
|
1958
|
+
parts: z$1.ZodArray<z$1.ZodUnknown>;
|
|
1959
|
+
system: z$1.ZodOptional<z$1.ZodString>;
|
|
1960
|
+
config: z$1.ZodOptional<z$1.ZodObject<{
|
|
1961
|
+
agentType: z$1.ZodOptional<z$1.ZodString>;
|
|
1962
|
+
transport: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1963
|
+
http: "http";
|
|
1964
|
+
stdio: "stdio";
|
|
1965
|
+
websocket: "websocket";
|
|
1966
|
+
cli: "cli";
|
|
1967
|
+
}>>;
|
|
1968
|
+
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1969
|
+
tools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
|
|
1970
|
+
}, z$1.core.$strip>>;
|
|
1971
|
+
}, z$1.core.$strip>>;
|
|
1816
1972
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1817
|
-
|
|
1973
|
+
taskId: z$1.ZodString;
|
|
1818
1974
|
timestamp: z$1.ZodNumber;
|
|
1819
1975
|
success: z$1.ZodBoolean;
|
|
1820
1976
|
result: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
@@ -1886,8 +2042,14 @@ declare function getEventInputSchema(event: HookEvent): z$1.ZodObject<{
|
|
|
1886
2042
|
taskName: z$1.ZodString;
|
|
1887
2043
|
command: z$1.ZodString;
|
|
1888
2044
|
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
1889
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
1890
2045
|
timestamp: z$1.ZodNumber;
|
|
2046
|
+
definition: z$1.ZodOptional<z$1.ZodObject<{
|
|
2047
|
+
type: z$1.ZodLiteral<"command">;
|
|
2048
|
+
config: z$1.ZodObject<{
|
|
2049
|
+
command: z$1.ZodString;
|
|
2050
|
+
arguments: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>]>>;
|
|
2051
|
+
}, z$1.core.$strip>;
|
|
2052
|
+
}, z$1.core.$strip>>;
|
|
1891
2053
|
}, z$1.core.$strip> | z$1.ZodObject<{
|
|
1892
2054
|
taskId: z$1.ZodString;
|
|
1893
2055
|
timestamp: z$1.ZodNumber;
|
|
@@ -2227,4 +2389,4 @@ interface PluginDefinition {
|
|
|
2227
2389
|
'context.build.after'?: (input: ContextBuildAfterInput, output: HookOutputWrapper<ContextBuildAfterInput>) => Promise<void>;
|
|
2228
2390
|
}
|
|
2229
2391
|
|
|
2230
|
-
export { AgentExecutorSchema, type AgentHookDefinition, AgentSchema, 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 CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, CwdSchema, EndReasonSchema, EventInputSchemas, 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 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, 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 SessionCompactInput, SessionCompactInputSchema, type SessionCompactingInput, SessionCompactingInputSchema, type SessionEndInput, SessionEndInputSchema, SessionIDSchema, type SessionStartInput, SessionStartInputSchema, type ShellEnvInput, ShellEnvInputSchema, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, 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, getEventInputSchema, safeValidateHookInput, tool, validateHookInput };
|
|
2392
|
+
export { AgentExecutorSchema, type AgentHookDefinition, AgentSchema, 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, CwdSchema, EndReasonSchema, EventInputSchemas, 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, 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 StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, 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, getEventInputSchema, safeValidateHookInput, tool, validateHookInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import C,{z as z$1}from'zod';export{buildToolArgs,createTool,toolSchema as schema}from'@easbot/types';import'@easbot/sdk';function T(s){return {description:s.description,args:s.args,execute:s.execute}}T.schema=C;var p={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"},Ge=Object.values(o);var l=z$1.string().optional(),v=z$1.object({type:z$1.literal(p.Command),command:z$1.string(),if:l,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()}),P=z$1.object({type:z$1.literal(p.Prompt),if:l,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())}),H=z$1.object({type:z$1.literal(p.Http),url:z$1.string(),if:l,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()}),w=z$1.object({type:z$1.literal(p.Agent),if:l,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())}),E=z$1.object({type:z$1.literal(p.Function),handler:z$1.function()}),M=z$1.discriminatedUnion("type",[v,P,H,w,E]),j=z$1.object({event:z$1.string(),matcher:z$1.string().optional(),hooks:z$1.array(M)}),qe=z$1.record(z$1.string(),z$1.array(j)),n=z$1.string().min(1).describe("Session unique identifier"),r=z$1.string().min(1).describe("Message unique identifier"),c=z$1.string().min(1).describe("Tool call unique identifier"),m=z$1.string().optional().describe("Agent name"),d=z$1.string().optional().describe("Model identifier"),f=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"),S=z$1.string().optional().describe("Working directory path"),R=z$1.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),z=z$1.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),D=z$1.object({sessionId:n,source:z$1.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:d,agent:m,cwd:S}),A=z$1.object({sessionId:n,reason:R,duration:z$1.number().positive().optional().describe("Session duration in milliseconds")}),F=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")}),O=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")}),G=z$1.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:d,agent:m}),W=z$1.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:d,agent:m,finishReason:z,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")}),B=z$1.object({sessionId:n,reason:z$1.string().describe("Stop reason")}),L=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"]),h=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")})]),x=z$1.object({id:r,role:_,content:z$1.union([z$1.string(),z$1.array(h)]),name:z$1.string().optional().describe("Message sender name"),tool_call_id:c.optional().describe("Related tool call ID")}),q=z$1.object({sessionId:n,agent:m,model:d,messageId:r,message:z$1.object({id:r,role:z$1.literal("user"),content:z$1.union([z$1.string(),z$1.array(h)])}).describe("User message")}),U=z$1.object({sessionId:n,messages:z$1.array(x).describe("Messages to transform")}),N=z$1.object({sessionId:n,model:d,system:z$1.array(z$1.string()).describe("Current system prompt")}),g=z$1.record(z$1.string(),z$1.unknown()).describe("Tool call arguments"),Z=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")}),V=z$1.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:z$1.string().describe("Tool name"),callId:c,args:g}),$=z$1.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:z$1.string(),callId:c,args:g,result:Z,duration:z$1.number().nonnegative().optional().describe("Execution duration in milliseconds")}),K=z$1.object({sessionId:n,tool:z$1.string(),callId:c,args:g,error:z$1.string().describe("Error message"),errorType:z$1.enum(["timeout","invalid_args","execution_error","permission_denied"])}),J=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")}),Q=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")}),X=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")}),Y=z$1.enum(["read","write","exec","admin"]),ee=z$1.object({tool:z$1.string().describe("Tool name requesting permission"),args:g.optional(),level:Y.optional(),reason:z$1.string().optional().describe("Reason for permission request")}),te=z$1.object({sessionId:n,request:ee}),oe=z$1.object({sessionId:n,tool:z$1.string(),reason:z$1.string().optional()}),k=z$1.enum(["openai","anthropic","google","azure","custom"]),ne=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()}),re=z$1.object({sessionId:n,agent:m,model:f,provider:k,params:ne.partial().optional()}),se=z$1.object({sessionId:n,agent:m,model:f,provider:k,headers:z$1.record(z$1.string(),z$1.string()).optional()}),ie=z$1.object({cwd:S.describe("Working directory"),sessionId:n.optional(),callId:c.optional()}),ae=z$1.object({sessionId:n,messageId:r,partId:z$1.string().describe("Text part ID"),text:z$1.string().describe("Completed text")}),pe=z$1.object({sessionId:n,mode:z$1.enum(["agent","chat","query"]).describe("Build mode"),providerId:z$1.string().optional()}),me=z$1.object({sessionId:n,context:z$1.object({messages:z$1.array(x),system:z$1.array(z$1.string()),metadata:z$1.record(z$1.string(),z$1.unknown())}).describe("Built context")}),ue=z$1.object({gatewayID:z$1.string().describe("Gateway ID"),messageId:r,message:z$1.unknown().describe("Received message")}),ce=z$1.object({gatewayID:z$1.string(),messageId:r,message:z$1.unknown(),sessionId:n.optional()}),de=z$1.object({gatewayID:z$1.string(),messageId:r,result:z$1.unknown().optional()}),le=z$1.object({gatewayID:z$1.string(),messageId:r,message:z$1.unknown(),target:z$1.string().optional().describe("Send target")}),ge=z$1.object({gatewayID:z$1.string(),messageId:r,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Delivery timestamp")}),be=z$1.object({gatewayID:z$1.string(),messageId:r,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({sessionId:n.optional(),timestamp:z$1.number().describe("Heartbeat timestamp"),name:z$1.string().optional().describe("Heartbeat name")}),ye=z$1.object({sessionId:n.optional(),timestamp:z$1.number(),duration:z$1.number().nonnegative().optional()}),fe=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()}),Se=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()}),he=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"),sessionId:z$1.string().optional().describe("Session ID"),timestamp:z$1.number().describe("Trigger timestamp")}),xe=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")}),b=z$1.enum(["tool","scheduler","cli","api"]),ke=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:b.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")}),Ce=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:b.describe("Task source: tool, scheduler, cli, api")}),Te=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:b,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")}),ve=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:b,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")}),Pe=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")}),He=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")}),y={[o.SessionStart]:D,[o.SessionEnd]:A,[o.SessionCompacting]:F,[o.SessionCompact]:O,[o.StepStart]:G,[o.StepFinish]:W,[o.StepStop]:B,[o.StepStopFailure]:L,[o.MessageReceive]:q,[o.MessageTransform]:U,[o.SystemTransform]:N,[o.ToolBefore]:V,[o.ToolAfter]:$,[o.ToolFailure]:K,[o.ToolDefinition]:J,[o.CommandBefore]:Q,[o.CommandAfter]:X,[o.PermissionAsk]:te,[o.PermissionDenied]:oe,[o.LlmParams]:re,[o.LlmHeaders]:se,[o.ShellEnv]:ie,[o.TextComplete]:ae,[o.ContextBuildBefore]:pe,[o.ContextBuildAfter]:me,[o.GatewayMessageReceive]:ue,[o.GatewayMessageProcess]:ce,[o.GatewayMessageComplete]:de,[o.GatewayMessageSend]:le,[o.GatewayMessageDelivered]:ge,[o.GatewayMessageRead]:be,[o.HeartbeatTrigger]:Ie,[o.HeartbeatComplete]:ye,[o.ScheduledTaskTrigger]:fe,[o.ScheduledTaskComplete]:Se,[o.CommandTrigger]:he,[o.CommandComplete]:xe,[o.TaskStart]:ke,[o.TaskRunning]:Ce,[o.TaskProgress]:Te,[o.TaskComplete]:ve,[o.LoopStart]:Pe,[o.LoopEnd]:He};function Ue(s){return y[s]}function Ne(s,I){let u=y[s];if(!u)throw new Error(`No schema found for event: ${s}`);return u.parse(I)}function Ze(s,I){let u=y[s];return u?u.safeParse(I):{success:false,error:new z$1.ZodError([{code:"custom",path:[],message:`No schema found for event: ${s}`}])}}var tt=z$1.enum(["command","mcp","skill"]).describe("Command source"),we=z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments"),Ee=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")})]),ot=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")}),nt=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:we.describe("Command arguments")}),Me=z$1.record(z$1.string(),z$1.unknown()).describe("Result metadata"),rt=z$1.object({title:z$1.string().describe("Result title"),metadata:Me.describe("Result metadata"),output:z$1.string().describe("Result output"),parts:z$1.array(Ee).optional().describe("Result parts"),success:z$1.boolean().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}),st=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")}),it=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});export{w as AgentExecutorSchema,m as AgentSchema,c as CallIDSchema,X as CommandAfterInputSchema,we as CommandArgumentsSchema,Q as CommandBeforeInputSchema,xe as CommandCompleteInputSchema,Me as CommandExecuteResultMetadataSchema,rt as CommandExecuteResultSchema,nt as CommandExecutionContextSchema,v as CommandExecutorSchema,st as CommandInitContextSchema,it as CommandInitResultSchema,ot as CommandMetadataSchema,Ee as CommandPromptPartSchema,tt as CommandSourceSchema,he as CommandTriggerInputSchema,h as ContentPartSchema,me as ContextBuildAfterInputSchema,pe as ContextBuildBeforeInputSchema,S as CwdSchema,R as EndReasonSchema,y as EventInputSchemas,z as FinishReasonSchema,E as FunctionExecutorSchema,de as GatewayMessageCompleteInputSchema,ge as GatewayMessageDeliveredInputSchema,ce as GatewayMessageProcessInputSchema,be as GatewayMessageReadInputSchema,ue as GatewayMessageReceiveInputSchema,le as GatewayMessageSendInputSchema,Ge as HOOK_EVENTS,ye as HeartbeatCompleteInputSchema,Ie as HeartbeatTriggerInputSchema,o as HookEvent,M as HookExecutorSchema,j as HookMatcherSchema,p as HookType,qe as HooksConfigSchema,H as HttpExecutorSchema,se as LlmHeadersInputSchema,re as LlmParamsInputSchema,ne as LlmParamsSchema,k as LlmProviderSchema,He as LoopEndInputSchema,Pe as LoopStartInputSchema,r as MessageIDSchema,q as MessageReceiveInputSchema,_ as MessageRoleSchema,x as MessageSchema,U as MessageTransformInputSchema,f as ModelObjectSchema,d as ModelSchema,te as PermissionAskInputSchema,oe as PermissionDeniedInputSchema,Y as PermissionLevelSchema,ee as PermissionRequestSchema,P as PromptExecutorSchema,Se as ScheduledTaskCompleteInputSchema,fe as ScheduledTaskTriggerInputSchema,O as SessionCompactInputSchema,F as SessionCompactingInputSchema,A as SessionEndInputSchema,n as SessionIDSchema,D as SessionStartInputSchema,ie as ShellEnvInputSchema,W as StepFinishInputSchema,G as StepStartInputSchema,L as StepStopFailureInputSchema,B as StepStopInputSchema,N as SystemTransformInputSchema,ve as TaskCompleteInputSchema,Te as TaskProgressInputSchema,Ce as TaskRunningInputSchema,b as TaskSourceSchema,ke as TaskStartInputSchema,ae as TextCompleteInputSchema,$ as ToolAfterInputSchema,g as ToolArgsSchema,V as ToolBeforeInputSchema,J as ToolDefinitionInputSchema,K as ToolFailureInputSchema,Z as ToolResultSchema,Ue as getEventInputSchema,Ze as safeValidateHookInput,T as tool,Ne as validateHookInput};
|
|
1
|
+
import T,{z as z$1}from'zod';export{buildToolArgs,createTool,toolSchema as schema}from'@easbot/types';import'@easbot/sdk';function C(s){return {description:s.description,args:s.args,execute:s.execute}}C.schema=T;var p={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"},Le=Object.values(o);var l=z$1.string().optional(),v=z$1.object({type:z$1.literal(p.Command),command:z$1.string(),if:l,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()}),P=z$1.object({type:z$1.literal(p.Prompt),if:l,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())}),H=z$1.object({type:z$1.literal(p.Http),url:z$1.string(),if:l,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()}),w=z$1.object({type:z$1.literal(p.Agent),if:l,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())}),E=z$1.object({type:z$1.literal(p.Function),handler:z$1.function()}),M=z$1.discriminatedUnion("type",[v,P,H,w,E]),j=z$1.object({event:z$1.string(),matcher:z$1.string().optional(),hooks:z$1.array(M)}),Ze=z$1.record(z$1.string(),z$1.array(j)),n=z$1.string().min(1).describe("Session unique identifier"),r=z$1.string().min(1).describe("Message unique identifier"),c=z$1.string().min(1).describe("Tool call unique identifier"),m=z$1.string().optional().describe("Agent name"),d=z$1.string().optional().describe("Model identifier"),I=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"),S=z$1.string().optional().describe("Working directory path"),D=z$1.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),z=z$1.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),R=z$1.object({sessionId:n,source:z$1.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:d,agent:m,cwd:S}),A=z$1.object({sessionId:n,reason:D,duration:z$1.number().positive().optional().describe("Session duration in milliseconds")}),F=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")}),O=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")}),G=z$1.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:d,agent:m}),W=z$1.object({sessionId:n,messageId:r,userMessageId:r.optional().describe("User message ID for the current step"),model:d,agent:m,finishReason:z,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")}),B=z$1.object({sessionId:n,reason:z$1.string().describe("Stop reason")}),L=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"]),h=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")})]),x=z$1.object({id:r,role:_,content:z$1.union([z$1.string(),z$1.array(h)]),name:z$1.string().optional().describe("Message sender name"),tool_call_id:c.optional().describe("Related tool call ID")}),q=z$1.object({sessionId:n,agent:m,model:d,messageId:r,message:z$1.object({id:r,role:z$1.literal("user"),content:z$1.union([z$1.string(),z$1.array(h)])}).describe("User message")}),U=z$1.object({sessionId:n,messages:z$1.array(x).describe("Messages to transform")}),N=z$1.object({sessionId:n,model:d,system:z$1.array(z$1.string()).describe("Current system prompt")}),g=z$1.record(z$1.string(),z$1.unknown()).describe("Tool call arguments"),Z=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")}),V=z$1.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:z$1.string().describe("Tool name"),callId:c,args:g}),$=z$1.object({sessionId:n,userMessageId:r.optional().describe("User message ID for the current step"),tool:z$1.string(),callId:c,args:g,result:Z,duration:z$1.number().nonnegative().optional().describe("Execution duration in milliseconds")}),K=z$1.object({sessionId:n,tool:z$1.string(),callId:c,args:g,error:z$1.string().describe("Error message"),errorType:z$1.enum(["timeout","invalid_args","execution_error","permission_denied"])}),J=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")}),Q=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")}),X=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")}),Y=z$1.enum(["read","write","exec","admin"]),ee=z$1.object({tool:z$1.string().describe("Tool name requesting permission"),args:g.optional(),level:Y.optional(),reason:z$1.string().optional().describe("Reason for permission request")}),te=z$1.object({sessionId:n,request:ee}),oe=z$1.object({sessionId:n,tool:z$1.string(),reason:z$1.string().optional()}),k=z$1.enum(["openai","anthropic","google","azure","custom"]),ne=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()}),re=z$1.object({sessionId:n,agent:m,model:I,provider:k,params:ne.partial().optional()}),se=z$1.object({sessionId:n,agent:m,model:I,provider:k,headers:z$1.record(z$1.string(),z$1.string()).optional()}),ie=z$1.object({cwd:S.describe("Working directory"),sessionId:n.optional(),callId:c.optional()}),ae=z$1.object({sessionId:n,messageId:r,partId:z$1.string().describe("Text part ID"),text:z$1.string().describe("Completed text")}),pe=z$1.object({sessionId:n,mode:z$1.enum(["agent","chat","query"]).describe("Build mode"),providerId:z$1.string().optional()}),me=z$1.object({sessionId:n,context:z$1.object({messages:z$1.array(x),system:z$1.array(z$1.string()),metadata:z$1.record(z$1.string(),z$1.unknown())}).describe("Built context")}),ue=z$1.object({gatewayID:z$1.string().describe("Gateway ID"),messageId:r,message:z$1.unknown().describe("Received message")}),ce=z$1.object({gatewayID:z$1.string(),messageId:r,message:z$1.unknown(),sessionId:n.optional()}),de=z$1.object({gatewayID:z$1.string(),messageId:r,result:z$1.unknown().optional()}),le=z$1.object({gatewayID:z$1.string(),messageId:r,message:z$1.unknown(),target:z$1.string().optional().describe("Send target")}),ge=z$1.object({gatewayID:z$1.string(),messageId:r,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Delivery timestamp")}),be=z$1.object({gatewayID:z$1.string(),messageId:r,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Read timestamp")}),fe=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()})}),ye=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()}),Ie=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()}),Se=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:ye.optional()}),he=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()}),xe=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:Ie.optional()}),ke=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()}),Te=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:fe.optional()}),Ce=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")}),b=z$1.enum(["tool","scheduler","cli","api"]),ve=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:b.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")}),Pe=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:b.describe("Task source: tool, scheduler, cli, api")}),He=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:b,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")}),we=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:b,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")}),Ee=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")}),Me=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")}),y={[o.SessionStart]:R,[o.SessionEnd]:A,[o.SessionCompacting]:F,[o.SessionCompact]:O,[o.StepStart]:G,[o.StepFinish]:W,[o.StepStop]:B,[o.StepStopFailure]:L,[o.MessageReceive]:q,[o.MessageTransform]:U,[o.SystemTransform]:N,[o.ToolBefore]:V,[o.ToolAfter]:$,[o.ToolFailure]:K,[o.ToolDefinition]:J,[o.CommandBefore]:Q,[o.CommandAfter]:X,[o.PermissionAsk]:te,[o.PermissionDenied]:oe,[o.LlmParams]:re,[o.LlmHeaders]:se,[o.ShellEnv]:ie,[o.TextComplete]:ae,[o.ContextBuildBefore]:pe,[o.ContextBuildAfter]:me,[o.GatewayMessageReceive]:ue,[o.GatewayMessageProcess]:ce,[o.GatewayMessageComplete]:de,[o.GatewayMessageSend]:le,[o.GatewayMessageDelivered]:ge,[o.GatewayMessageRead]:be,[o.HeartbeatTrigger]:Se,[o.HeartbeatComplete]:he,[o.ScheduledTaskTrigger]:xe,[o.ScheduledTaskComplete]:ke,[o.CommandTrigger]:Te,[o.CommandComplete]:Ce,[o.TaskStart]:ve,[o.TaskRunning]:Pe,[o.TaskProgress]:He,[o.TaskComplete]:we,[o.LoopStart]:Ee,[o.LoopEnd]:Me};function Ve(s){return y[s]}function $e(s,f){let u=y[s];if(!u)throw new Error(`No schema found for event: ${s}`);return u.parse(f)}function Ke(s,f){let u=y[s];return u?u.safeParse(f):{success:false,error:new z$1.ZodError([{code:"custom",path:[],message:`No schema found for event: ${s}`}])}}var rt=z$1.enum(["command","mcp","skill"]).describe("Command source"),je=z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments"),De=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")})]),st=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")}),it=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:je.describe("Command arguments")}),ze=z$1.record(z$1.string(),z$1.unknown()).describe("Result metadata"),at=z$1.object({title:z$1.string().describe("Result title"),metadata:ze.describe("Result metadata"),output:z$1.string().describe("Result output"),parts:z$1.array(De).optional().describe("Result parts"),success:z$1.boolean().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}),pt=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")}),mt=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});export{w as AgentExecutorSchema,m as AgentSchema,c as CallIDSchema,X as CommandAfterInputSchema,je as CommandArgumentsSchema,Q as CommandBeforeInputSchema,Ce as CommandCompleteInputSchema,ze as CommandExecuteResultMetadataSchema,at as CommandExecuteResultSchema,it as CommandExecutionContextSchema,v as CommandExecutorSchema,pt as CommandInitContextSchema,mt as CommandInitResultSchema,st as CommandMetadataSchema,De as CommandPromptPartSchema,rt as CommandSourceSchema,fe as CommandTaskDefinitionSchema,Te as CommandTriggerInputSchema,h as ContentPartSchema,me as ContextBuildAfterInputSchema,pe as ContextBuildBeforeInputSchema,S as CwdSchema,D as EndReasonSchema,y as EventInputSchemas,z as FinishReasonSchema,E as FunctionExecutorSchema,de as GatewayMessageCompleteInputSchema,ge as GatewayMessageDeliveredInputSchema,ce as GatewayMessageProcessInputSchema,be as GatewayMessageReadInputSchema,ue as GatewayMessageReceiveInputSchema,le as GatewayMessageSendInputSchema,Le as HOOK_EVENTS,he as HeartbeatCompleteInputSchema,ye as HeartbeatTaskDefinitionSchema,Se as HeartbeatTriggerInputSchema,o as HookEvent,M as HookExecutorSchema,j as HookMatcherSchema,p as HookType,Ze as HooksConfigSchema,H as HttpExecutorSchema,se as LlmHeadersInputSchema,re as LlmParamsInputSchema,ne as LlmParamsSchema,k as LlmProviderSchema,Me as LoopEndInputSchema,Ee as LoopStartInputSchema,r as MessageIDSchema,q as MessageReceiveInputSchema,_ as MessageRoleSchema,x as MessageSchema,U as MessageTransformInputSchema,I as ModelObjectSchema,d as ModelSchema,te as PermissionAskInputSchema,oe as PermissionDeniedInputSchema,Y as PermissionLevelSchema,ee as PermissionRequestSchema,P as PromptExecutorSchema,ke as ScheduledTaskCompleteInputSchema,xe as ScheduledTaskTriggerInputSchema,Ie as SchedulerTaskDefinitionSchema,O as SessionCompactInputSchema,F as SessionCompactingInputSchema,A as SessionEndInputSchema,n as SessionIDSchema,R as SessionStartInputSchema,ie as ShellEnvInputSchema,W as StepFinishInputSchema,G as StepStartInputSchema,L as StepStopFailureInputSchema,B as StepStopInputSchema,N as SystemTransformInputSchema,we as TaskCompleteInputSchema,He as TaskProgressInputSchema,Pe as TaskRunningInputSchema,b as TaskSourceSchema,ve as TaskStartInputSchema,ae as TextCompleteInputSchema,$ as ToolAfterInputSchema,g as ToolArgsSchema,V as ToolBeforeInputSchema,J as ToolDefinitionInputSchema,K as ToolFailureInputSchema,Z as ToolResultSchema,Ve as getEventInputSchema,Ke as safeValidateHookInput,C as tool,$e as validateHookInput};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easbot/plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.45",
|
|
4
4
|
"description": "EASBot Plugin for client applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"axios": "^1.16.1",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@easbot/sdk": "0.2.
|
|
49
|
-
"@easbot/types": "0.2.
|
|
48
|
+
"@easbot/sdk": "0.2.45",
|
|
49
|
+
"@easbot/types": "0.2.45"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^25.6.2",
|