@easbot/types 0.2.35 → 0.2.36

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 CHANGED
@@ -1 +1 @@
1
- 'use strict';var zod=require('zod');var g=(n=>(n.HTTP="http",n.WEBSOCKET="websocket",n.GRPC="grpc",n.TCP="tcp",n.UDP="udp",n))(g||{}),u=(r=>(r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r.HEAD="HEAD",r.OPTIONS="OPTIONS",r))(u||{}),m=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(m||{}),d=(n=>(n.CONNECTING="connecting",n.OPEN="open",n.CLOSING="closing",n.CLOSED="closed",n.ERROR="error",n))(d||{}),l=(n=>(n.TEXT="text",n.BINARY="binary",n.JSON="json",n.PING="ping",n.PONG="pong",n))(l||{}),p=(e=>(e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e))(p||{});var b=(r=>(r.INITIALIZING="initializing",r.IDLE="idle",r.RUNNING="running",r.SUSPENDED="suspended",r.STOPPING="stopping",r.STOPPED="stopped",r.ERROR="error",r))(b||{});var f=(a=>(a.TEXT="text",a.IMAGE="image",a.FILE="file",a.AUDIO="audio",a.VIDEO="video",a.SYSTEM="system",a))(f||{}),x=(c=>(c.USER="user",c.AGENT="agent",c.SYSTEM="system",c))(x||{});var E={};function Y(i){return {description:i.description,args:i.args,execute:i.execute}}var j=zod.z;function W(i){return zod.z.object(i)}var R={provider:"easbot-local",model:"bge-base-zh-v1.5",batchSize:32},T={maxResults:3,minScore:.1,hybrid:{enabled:true,vectorWeight:.7,textWeight:.3}},I={onBoot:true,onSearch:true,onSessionStart:true,intervalMs:3e5},C={batchSize:50,ignorePatterns:["node_modules/**","dist/**","build/**",".git/**","__pycache__/**","*.min.js","*.min.ts"],incremental:true},A={languages:["ts","tsx","js","py","rs","go","c","cpp","csharp","java","scala","ruby","php","zig"],lazyLoad:true},S={chunkSize:1024,chunkOverlap:102,minChunkLength:100};function h(i,o){return `${i}/easbot/${o}`}function k(i,o){return `${i}/.easbot/${o}`}var N=[{type:"person",rule:"A human individual, role holder, or named actor."},{type:"organization",rule:"A company, team, institution, or formal group."},{type:"location",rule:"A place, region, site, facility, or spatial scope."},{type:"concept",rule:"An abstract idea, theme, method, policy, or principle."},{type:"object",rule:"A tangible or digital thing, product, artifact, or resource."},{type:"document",rule:"A report, note, page, paper, guideline, or formal text artifact."},{type:"process",rule:"A workflow, procedure, lifecycle, or repeatable sequence of steps."},{type:"task",rule:"A specific action item, issue, requirement, or objective."},{type:"metric",rule:"A measurable quantity, KPI, target value, or indicator."},{type:"time",rule:"A date, period, schedule marker, deadline, or temporal reference."},{type:"event",rule:"A notable milestone, release, incident, meeting, or time-bounded activity."},{type:"keyword",rule:"A compact fallback term when no stronger category applies."}],D=[{type:"is_a",rule:"Source is a subtype or instance of target."},{type:"part_of",rule:"Source is a component/subset of target."},{type:"has_attribute",rule:"Source has target as a key property or characteristic."},{type:"located_in",rule:"Source is physically or logically located in target."},{type:"occurs_in",rule:"Source event/process happens during or within target context/time/place."},{type:"causes",rule:"Source contributes to or causes target."},{type:"influences",rule:"Source affects target without strict causality."},{type:"owned_by",rule:"Source belongs to or is controlled by target."},{type:"member_of",rule:"Source person/entity is a member of target group."},{type:"uses",rule:"Source uses target as a dependency or tool."},{type:"depends_on",rule:"Source requires target to work or complete."},{type:"related_to",rule:"Weak but useful semantic relation when others do not fit."},{type:"defines",rule:"Source document or concept defines target entity."},{type:"referenced_in",rule:"Source entity is referenced or mentioned in target document."},{type:"used_by",rule:"Source entity is used by target process or concept."},{type:"relates_to",rule:"Source concept is semantically related to target concept."}];exports.AgentState=b;exports.DEFAULT_EMBEDDING_CONFIG=R;exports.DEFAULT_INDEXER_CONFIG=C;exports.DEFAULT_NOTE_CHUNK_CONFIG=S;exports.DEFAULT_PARSER_CONFIG=A;exports.DEFAULT_SEARCH_CONFIG=T;exports.DEFAULT_SYNC_CONFIG=I;exports.GRAPH_ENTITY_TYPE_DEFINITIONS=N;exports.GRAPH_RELATION_TYPE_DEFINITIONS=D;exports.GatewayTypes=E;exports.HTTPMethod=u;exports.HTTPStatusCode=m;exports.HttpStatus=p;exports.MessageSender=x;exports.MessageType=f;exports.Protocol=g;exports.WebSocketMessageType=l;exports.WebSocketState=d;exports.buildToolArgs=W;exports.createTool=Y;exports.getDefaultDatabasePath=h;exports.getWorkspaceDatabasePath=k;exports.toolSchema=j;
1
+ 'use strict';var zod=require('zod');var g=(n=>(n.HTTP="http",n.WEBSOCKET="websocket",n.GRPC="grpc",n.TCP="tcp",n.UDP="udp",n))(g||{}),u=(r=>(r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r.HEAD="HEAD",r.OPTIONS="OPTIONS",r))(u||{}),m=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(m||{}),d=(n=>(n.CONNECTING="connecting",n.OPEN="open",n.CLOSING="closing",n.CLOSED="closed",n.ERROR="error",n))(d||{}),l=(n=>(n.TEXT="text",n.BINARY="binary",n.JSON="json",n.PING="ping",n.PONG="pong",n))(l||{}),p=(e=>(e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e))(p||{});var b=(r=>(r.INITIALIZING="initializing",r.IDLE="idle",r.RUNNING="running",r.SUSPENDED="suspended",r.STOPPING="stopping",r.STOPPED="stopped",r.ERROR="error",r))(b||{});var f=(a=>(a.TEXT="text",a.IMAGE="image",a.FILE="file",a.AUDIO="audio",a.VIDEO="video",a.SYSTEM="system",a))(f||{}),x=(c=>(c.USER="user",c.AGENT="agent",c.SYSTEM="system",c))(x||{});var E={};function Y(i){return {description:i.description,args:i.args,execute:i.execute}}var j=zod.z;function W(i){return zod.z.object(i)}var R={provider:"easbot-local",model:"bge-base-zh-v1.5",batchSize:32},T={maxResults:3,minScore:.1,hybrid:{enabled:true,vectorWeight:.7,textWeight:.3}},I={onBoot:true,onSearch:true,onSessionStart:true,intervalMs:3e5},C={batchSize:50,ignorePatterns:["node_modules/**","dist/**","build/**",".git/**","__pycache__/**","*.min.js","*.min.ts"],incremental:true},A={languages:["ts","tsx","js","py","rs","go","c","cpp","csharp","java","scala","ruby","php","zig"],lazyLoad:true},S={chunkSize:1024,chunkOverlap:102,minChunkLength:100};function h(i,o){return `${i}/easbot/${o}`}function k(i,o){return `${i}/.easbot/${o}`}var N=[{type:"person",rule:"A human individual, role holder, or named actor."},{type:"organization",rule:"A company, team, institution, or formal group."},{type:"location",rule:"A place, region, site, facility, or spatial scope."},{type:"concept",rule:"An abstract idea, theme, method, policy, or principle."},{type:"object",rule:"A tangible or digital thing, product, artifact, or resource."},{type:"document",rule:"A report, note, page, paper, guideline, or formal text artifact."},{type:"process",rule:"A workflow, procedure, lifecycle, or repeatable sequence of steps."},{type:"task",rule:"A specific action item, issue, requirement, or objective."},{type:"metric",rule:"A measurable quantity, KPI, target value, or indicator."},{type:"time",rule:"A date, period, schedule marker, deadline, or temporal reference."},{type:"event",rule:"A notable milestone, release, incident, meeting, or time-bounded activity."},{type:"keyword",rule:"A compact fallback term when no stronger category applies."}],v=[{type:"is_a",rule:"Source is a subtype or instance of target."},{type:"part_of",rule:"Source is a component/subset of target."},{type:"has_attribute",rule:"Source has target as a key property or characteristic."},{type:"located_in",rule:"Source is physically or logically located in target."},{type:"occurs_in",rule:"Source event/process happens during or within target context/time/place."},{type:"causes",rule:"Source contributes to or causes target."},{type:"influences",rule:"Source affects target without strict causality."},{type:"owned_by",rule:"Source belongs to or is controlled by target."},{type:"member_of",rule:"Source person/entity is a member of target group."},{type:"uses",rule:"Source uses target as a dependency or tool."},{type:"depends_on",rule:"Source requires target to work or complete."},{type:"related_to",rule:"Weak but useful semantic relation when others do not fit."},{type:"defines",rule:"Source document or concept defines target entity."},{type:"referenced_in",rule:"Source entity is referenced or mentioned in target document."},{type:"used_by",rule:"Source entity is used by target process or concept."},{type:"relates_to",rule:"Source concept is semantically related to target concept."}];exports.AgentState=b;exports.DEFAULT_EMBEDDING_CONFIG=R;exports.DEFAULT_INDEXER_CONFIG=C;exports.DEFAULT_NOTE_CHUNK_CONFIG=S;exports.DEFAULT_PARSER_CONFIG=A;exports.DEFAULT_SEARCH_CONFIG=T;exports.DEFAULT_SYNC_CONFIG=I;exports.GRAPH_ENTITY_TYPE_DEFINITIONS=N;exports.GRAPH_RELATION_TYPE_DEFINITIONS=v;exports.GatewayTypes=E;exports.HTTPMethod=u;exports.HTTPStatusCode=m;exports.HttpStatus=p;exports.MessageSender=x;exports.MessageType=f;exports.Protocol=g;exports.WebSocketMessageType=l;exports.WebSocketState=d;exports.buildToolArgs=W;exports.createTool=Y;exports.getDefaultDatabasePath=h;exports.getWorkspaceDatabasePath=k;exports.toolSchema=j;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import { EasbotClient } from '@easbot/sdk';
1
2
  import { z } from 'zod';
2
3
  import { EmbeddingModel, LanguageModel, RerankingModel } from 'ai';
3
4
 
@@ -545,6 +546,10 @@ interface TaskExecutionResult {
545
546
  logs: TaskLog[];
546
547
  }
547
548
 
549
+ interface AgentModel {
550
+ modelID: string;
551
+ providerID: string;
552
+ }
548
553
  type AgentPromptPart = {
549
554
  type: 'text';
550
555
  text: string;
@@ -557,29 +562,32 @@ type AgentPromptPart = {
557
562
  data: string | URL | Uint8Array;
558
563
  mime?: string;
559
564
  };
565
+ interface AgentInput {
566
+ source: string;
567
+ title: string;
568
+ agent?: string;
569
+ model?: AgentModel;
570
+ tools?: Record<string, boolean>;
571
+ system?: string;
572
+ parts: AgentPromptPart[];
573
+ }
574
+ interface AgentResult {
575
+ title: string;
576
+ output: string;
577
+ metadata: Record<string, unknown>;
578
+ }
579
+ type AgentCallback = (result: AgentResult) => Promise<void>;
580
+
560
581
  type RunMode = 'ephemeral' | 'persistent';
561
582
  type TransportType = 'stdio' | 'http' | 'websocket' | 'cli';
562
583
  type SubAgentStatus = 'idle' | 'starting' | 'running' | 'busy' | 'stopping' | 'stopped' | 'error';
563
- interface SubAgentModel {
564
- modelID: string;
565
- providerID: string;
566
- }
567
- interface SubAgentInput {
568
- source: string;
569
- title: string;
584
+ interface SubAgentInput extends AgentInput {
570
585
  agent: string;
571
586
  sessionId?: string;
572
- model?: SubAgentModel;
573
- parts?: AgentPromptPart[];
574
- system?: string;
575
- tools?: Record<string, boolean>;
576
587
  syncMessages?: boolean;
577
588
  config?: Partial<SubAgentConfig>;
578
589
  }
579
- interface SubAgentResult {
580
- title: string;
581
- output: string;
582
- metadata: Record<string, unknown>;
590
+ interface SubAgentResult extends AgentResult {
583
591
  userMessage?: unknown;
584
592
  assistantMessage?: unknown;
585
593
  }
@@ -600,7 +608,7 @@ interface SubAgentConfig {
600
608
  cwd?: string;
601
609
  mcpServers?: string[];
602
610
  agentConfig?: {
603
- model?: SubAgentModel;
611
+ model?: AgentModel;
604
612
  system?: string;
605
613
  tools?: Record<string, boolean>;
606
614
  };
@@ -638,6 +646,8 @@ interface SubAgentHandler {
638
646
  checkHealth?(): Promise<boolean>;
639
647
  }
640
648
 
649
+ type LocalAgentInput = AgentInput;
650
+ type LocalAgentResult = AgentResult;
641
651
  type GatewayMessagePromptPart = AgentPromptPart;
642
652
  type MessageType = 'input' | 'output' | 'system' | 'control';
643
653
  type PlatformType = 'telegram' | 'discord' | 'slack' | 'feishu' | 'wechat' | 'webchat' | 'signal' | 'nostr' | 'whatsapp' | 'tui' | 'api' | 'web' | 'desktop';
@@ -782,8 +792,15 @@ interface IHookRegistry {
782
792
  data?: unknown;
783
793
  }): Promise<void>;
784
794
  }
795
+ interface ILocalAgentRunner {
796
+ run(input: AgentInput): Promise<AgentResult>;
797
+ }
798
+ interface ILocalAgentRunner {
799
+ run(input: LocalAgentInput): Promise<LocalAgentResult>;
800
+ }
785
801
  interface AgentAdapter {
786
802
  subAgentRunner: ISubAgentRunner;
803
+ localAgentRunner: ILocalAgentRunner;
787
804
  hookRegistry: {
788
805
  triggerEvent<T = unknown>(event: string, input: T, context?: Record<string, unknown>): Promise<{
789
806
  success: boolean;
@@ -793,6 +810,7 @@ interface AgentAdapter {
793
810
  };
794
811
  global: IGlobal;
795
812
  instance: IInstance;
813
+ sdk: EasbotClient;
796
814
  }
797
815
  interface IGatewayServer {
798
816
  start(): Promise<void>;
@@ -823,13 +841,16 @@ type gateway_IGatewayServer = IGatewayServer;
823
841
  type gateway_IGlobal = IGlobal;
824
842
  type gateway_IHookRegistry = IHookRegistry;
825
843
  type gateway_IInstance = IInstance;
844
+ type gateway_ILocalAgentRunner = ILocalAgentRunner;
845
+ type gateway_LocalAgentInput = LocalAgentInput;
846
+ type gateway_LocalAgentResult = LocalAgentResult;
826
847
  type gateway_MessageContext = MessageContext;
827
848
  type gateway_MessageMetadata = MessageMetadata;
828
849
  type gateway_MessageStorage = MessageStorage;
829
850
  type gateway_MessageType = MessageType;
830
851
  type gateway_PlatformType = PlatformType;
831
852
  declare namespace gateway {
832
- export type { gateway_AgentAdapter as AgentAdapter, gateway_AgentInfo as AgentInfo, gateway_ChannelInfo as ChannelInfo, gateway_ChannelListResponse as ChannelListResponse, gateway_ChannelPluginInfo as ChannelPluginInfo, gateway_GatewayConfig as GatewayConfig, gateway_GatewayHookHandler as GatewayHookHandler, gateway_GatewayMessage as GatewayMessage, gateway_GatewayMessageDeliveredInput as GatewayMessageDeliveredInput, gateway_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReadInput as GatewayMessageReadInput, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, gateway_GatewayMessageSendInput as GatewayMessageSendInput, gateway_GatewayServerConfig as GatewayServerConfig, gateway_IGatewayServer as IGatewayServer, gateway_IGlobal as IGlobal, gateway_IHookRegistry as IHookRegistry, gateway_IInstance as IInstance, gateway_MessageContext as MessageContext, gateway_MessageMetadata as MessageMetadata, gateway_MessageStorage as MessageStorage, gateway_MessageType as MessageType, gateway_PlatformType as PlatformType };
853
+ export type { gateway_AgentAdapter as AgentAdapter, gateway_AgentInfo as AgentInfo, gateway_ChannelInfo as ChannelInfo, gateway_ChannelListResponse as ChannelListResponse, gateway_ChannelPluginInfo as ChannelPluginInfo, gateway_GatewayConfig as GatewayConfig, gateway_GatewayHookHandler as GatewayHookHandler, gateway_GatewayMessage as GatewayMessage, gateway_GatewayMessageDeliveredInput as GatewayMessageDeliveredInput, gateway_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReadInput as GatewayMessageReadInput, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, gateway_GatewayMessageSendInput as GatewayMessageSendInput, gateway_GatewayServerConfig as GatewayServerConfig, gateway_IGatewayServer as IGatewayServer, gateway_IGlobal as IGlobal, gateway_IHookRegistry as IHookRegistry, gateway_IInstance as IInstance, gateway_ILocalAgentRunner as ILocalAgentRunner, gateway_LocalAgentInput as LocalAgentInput, gateway_LocalAgentResult as LocalAgentResult, gateway_MessageContext as MessageContext, gateway_MessageMetadata as MessageMetadata, gateway_MessageStorage as MessageStorage, gateway_MessageType as MessageType, gateway_PlatformType as PlatformType };
833
854
  }
834
855
 
835
856
  type ShellFunction = (input: Uint8Array) => Uint8Array;
@@ -910,6 +931,13 @@ declare function createTool<Args extends Record<string, z.ZodTypeAny>>(input: {
910
931
  };
911
932
  declare const toolSchema: typeof z;
912
933
  declare function buildToolArgs<T extends Record<string, z.ZodTypeAny>>(schema: T): z.ZodObject<T>;
934
+ interface ITool {
935
+ id: string;
936
+ name: string;
937
+ description: string;
938
+ args: Record<string, z.ZodTypeAny>;
939
+ execute(args: Record<string, unknown>, context: ToolContext): Promise<string>;
940
+ }
913
941
 
914
942
  interface EmbeddingConfig {
915
943
  provider: 'easbot-local' | 'local' | 'openai' | 'ollama';
@@ -1133,4 +1161,4 @@ type PromptPart = {
1133
1161
  mime?: string;
1134
1162
  };
1135
1163
 
1136
- export { type AgentAction, type AgentAdapter, AgentCapability, type AgentCreate, type AgentExecute, type AgentExecutionResult, type AgentInfo, type AgentPromptPart, type AgentQuery, AgentState, type AgentStatistics, type AgentStatusInfo, type AgentUpdate, type ApiResponse, ApiResponseBuilder, type ApiResult, type AskInput, type AuthInfo, type BaseKnowledgeConfig, type BaseSearchResult, type ChannelInfo, type ChannelListResponse, type ChannelPluginInfo, type CodebaseKnowledgeConfig, type CodebaseKnowledgeConfigWithModels, DEFAULT_EMBEDDING_CONFIG, DEFAULT_INDEXER_CONFIG, DEFAULT_NOTE_CHUNK_CONFIG, DEFAULT_PARSER_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SYNC_CONFIG, type DatabaseConfig, type EasbotShell, type EasbotShellError, type EasbotShellOutput, type EasbotShellPromise, type EmbeddingConfig, type ErrorDetails, type ErrorMessageMode, type ErrorResponse, type FilterExpression, type FilterRule, GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS, type GatewayConfig, type GatewayHookHandler, type GatewayMessage, type GatewayMessageDeliveredInput, type GatewayMessagePromptPart, type GatewayMessageReadInput, type GatewayMessageReceiveInput, type GatewayMessageSendInput, type GatewayServerConfig, gateway as GatewayTypes, type GraphLlmConfig, HTTPMethod, type HTTPRequestConfig, type HTTPResponseConfig, HTTPStatusCode, HttpStatus, type HybridSearchConfig, type IGatewayServer, type IGlobal, type IHookRegistry, type IInstance, type ISubAgentRunner, type IndexerConfig, type KnowledgeSearchOptions, type KnowledgeSearchSource, type Language, type LlmConfig, type MemoryKnowledgeConfig, type MemoryKnowledgeConfigWithModels, type MessageAttachment, type MessageContext, type MessageMetadata, type MessageQuery, type MessageReaction, type MessageSend, MessageSender, type MessageStorage, MessageType$1 as MessageType, type NoteKnowledgeConfig, type NoteKnowledgeConfigWithModels, type NoteKnowledgeSource, type OAuth2Token, type PageParams, type PageResult, type ParserConfig, type PlatformType, type PromptPart, Protocol, type RequestOptions, type RerankLlmConfig, type RetryRequest, type RunMode, type SearchConfig, type SessionCreate, type SessionInfo, type SessionMessage, type SessionQuery, type SessionStatistics, SessionStatus, type SessionUpdate, type ShellExpression, type ShellFunction, type SortingField, type SubAgentConfig, type SubAgentEvent, type SubAgentHandler, type SubAgentInput, type SubAgentInstance, type SubAgentModel, type SubAgentResult, type SubAgentStatus, type SuccessMessageMode, type SyncConfig, type TaskCreate, type TaskExecutionResult, type TaskInfo, type TaskLog, TaskPriority, type TaskQuery, TaskStatus, type TaskStep, type TaskUpdate, type ToolContext, type ToolDefinition, type ToolFunction, type TransportType, type UploadFileParams, type UploadFileResult, type WebSocketConnectionConfig, type WebSocketEvent, type WebSocketMessage, WebSocketMessageType, WebSocketState, buildToolArgs, createTool, getDefaultDatabasePath, getWorkspaceDatabasePath, toolSchema };
1164
+ export { type AgentAction, type AgentAdapter, type AgentCallback, AgentCapability, type AgentCreate, type AgentExecute, type AgentExecutionResult, type AgentInfo, type AgentInput, type AgentModel, type AgentPromptPart, type AgentQuery, type AgentResult, AgentState, type AgentStatistics, type AgentStatusInfo, type AgentUpdate, type ApiResponse, ApiResponseBuilder, type ApiResult, type AskInput, type AuthInfo, type BaseKnowledgeConfig, type BaseSearchResult, type ChannelInfo, type ChannelListResponse, type ChannelPluginInfo, type CodebaseKnowledgeConfig, type CodebaseKnowledgeConfigWithModels, DEFAULT_EMBEDDING_CONFIG, DEFAULT_INDEXER_CONFIG, DEFAULT_NOTE_CHUNK_CONFIG, DEFAULT_PARSER_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SYNC_CONFIG, type DatabaseConfig, type EasbotShell, type EasbotShellError, type EasbotShellOutput, type EasbotShellPromise, type EmbeddingConfig, type ErrorDetails, type ErrorMessageMode, type ErrorResponse, type FilterExpression, type FilterRule, GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS, type GatewayConfig, type GatewayHookHandler, type GatewayMessage, type GatewayMessageDeliveredInput, type GatewayMessagePromptPart, type GatewayMessageReadInput, type GatewayMessageReceiveInput, type GatewayMessageSendInput, type GatewayServerConfig, gateway as GatewayTypes, type GraphLlmConfig, HTTPMethod, type HTTPRequestConfig, type HTTPResponseConfig, HTTPStatusCode, HttpStatus, type HybridSearchConfig, type IGatewayServer, type IGlobal, type IHookRegistry, type IInstance, type ISubAgentRunner, type ITool, type IndexerConfig, type KnowledgeSearchOptions, type KnowledgeSearchSource, type Language, type LlmConfig, type MemoryKnowledgeConfig, type MemoryKnowledgeConfigWithModels, type MessageAttachment, type MessageContext, type MessageMetadata, type MessageQuery, type MessageReaction, type MessageSend, MessageSender, type MessageStorage, MessageType$1 as MessageType, type NoteKnowledgeConfig, type NoteKnowledgeConfigWithModels, type NoteKnowledgeSource, type OAuth2Token, type PageParams, type PageResult, type ParserConfig, type PlatformType, type PromptPart, Protocol, type RequestOptions, type RerankLlmConfig, type RetryRequest, type RunMode, type SearchConfig, type SessionCreate, type SessionInfo, type SessionMessage, type SessionQuery, type SessionStatistics, SessionStatus, type SessionUpdate, type ShellExpression, type ShellFunction, type SortingField, type SubAgentConfig, type SubAgentEvent, type SubAgentHandler, type SubAgentInput, type SubAgentInstance, type SubAgentResult, type SubAgentStatus, type SuccessMessageMode, type SyncConfig, type TaskCreate, type TaskExecutionResult, type TaskInfo, type TaskLog, TaskPriority, type TaskQuery, TaskStatus, type TaskStep, type TaskUpdate, type ToolContext, type ToolDefinition, type ToolFunction, type TransportType, type UploadFileParams, type UploadFileResult, type WebSocketConnectionConfig, type WebSocketEvent, type WebSocketMessage, WebSocketMessageType, WebSocketState, buildToolArgs, createTool, getDefaultDatabasePath, getWorkspaceDatabasePath, toolSchema };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { EasbotClient } from '@easbot/sdk';
1
2
  import { z } from 'zod';
2
3
  import { EmbeddingModel, LanguageModel, RerankingModel } from 'ai';
3
4
 
@@ -545,6 +546,10 @@ interface TaskExecutionResult {
545
546
  logs: TaskLog[];
546
547
  }
547
548
 
549
+ interface AgentModel {
550
+ modelID: string;
551
+ providerID: string;
552
+ }
548
553
  type AgentPromptPart = {
549
554
  type: 'text';
550
555
  text: string;
@@ -557,29 +562,32 @@ type AgentPromptPart = {
557
562
  data: string | URL | Uint8Array;
558
563
  mime?: string;
559
564
  };
565
+ interface AgentInput {
566
+ source: string;
567
+ title: string;
568
+ agent?: string;
569
+ model?: AgentModel;
570
+ tools?: Record<string, boolean>;
571
+ system?: string;
572
+ parts: AgentPromptPart[];
573
+ }
574
+ interface AgentResult {
575
+ title: string;
576
+ output: string;
577
+ metadata: Record<string, unknown>;
578
+ }
579
+ type AgentCallback = (result: AgentResult) => Promise<void>;
580
+
560
581
  type RunMode = 'ephemeral' | 'persistent';
561
582
  type TransportType = 'stdio' | 'http' | 'websocket' | 'cli';
562
583
  type SubAgentStatus = 'idle' | 'starting' | 'running' | 'busy' | 'stopping' | 'stopped' | 'error';
563
- interface SubAgentModel {
564
- modelID: string;
565
- providerID: string;
566
- }
567
- interface SubAgentInput {
568
- source: string;
569
- title: string;
584
+ interface SubAgentInput extends AgentInput {
570
585
  agent: string;
571
586
  sessionId?: string;
572
- model?: SubAgentModel;
573
- parts?: AgentPromptPart[];
574
- system?: string;
575
- tools?: Record<string, boolean>;
576
587
  syncMessages?: boolean;
577
588
  config?: Partial<SubAgentConfig>;
578
589
  }
579
- interface SubAgentResult {
580
- title: string;
581
- output: string;
582
- metadata: Record<string, unknown>;
590
+ interface SubAgentResult extends AgentResult {
583
591
  userMessage?: unknown;
584
592
  assistantMessage?: unknown;
585
593
  }
@@ -600,7 +608,7 @@ interface SubAgentConfig {
600
608
  cwd?: string;
601
609
  mcpServers?: string[];
602
610
  agentConfig?: {
603
- model?: SubAgentModel;
611
+ model?: AgentModel;
604
612
  system?: string;
605
613
  tools?: Record<string, boolean>;
606
614
  };
@@ -638,6 +646,8 @@ interface SubAgentHandler {
638
646
  checkHealth?(): Promise<boolean>;
639
647
  }
640
648
 
649
+ type LocalAgentInput = AgentInput;
650
+ type LocalAgentResult = AgentResult;
641
651
  type GatewayMessagePromptPart = AgentPromptPart;
642
652
  type MessageType = 'input' | 'output' | 'system' | 'control';
643
653
  type PlatformType = 'telegram' | 'discord' | 'slack' | 'feishu' | 'wechat' | 'webchat' | 'signal' | 'nostr' | 'whatsapp' | 'tui' | 'api' | 'web' | 'desktop';
@@ -782,8 +792,15 @@ interface IHookRegistry {
782
792
  data?: unknown;
783
793
  }): Promise<void>;
784
794
  }
795
+ interface ILocalAgentRunner {
796
+ run(input: AgentInput): Promise<AgentResult>;
797
+ }
798
+ interface ILocalAgentRunner {
799
+ run(input: LocalAgentInput): Promise<LocalAgentResult>;
800
+ }
785
801
  interface AgentAdapter {
786
802
  subAgentRunner: ISubAgentRunner;
803
+ localAgentRunner: ILocalAgentRunner;
787
804
  hookRegistry: {
788
805
  triggerEvent<T = unknown>(event: string, input: T, context?: Record<string, unknown>): Promise<{
789
806
  success: boolean;
@@ -793,6 +810,7 @@ interface AgentAdapter {
793
810
  };
794
811
  global: IGlobal;
795
812
  instance: IInstance;
813
+ sdk: EasbotClient;
796
814
  }
797
815
  interface IGatewayServer {
798
816
  start(): Promise<void>;
@@ -823,13 +841,16 @@ type gateway_IGatewayServer = IGatewayServer;
823
841
  type gateway_IGlobal = IGlobal;
824
842
  type gateway_IHookRegistry = IHookRegistry;
825
843
  type gateway_IInstance = IInstance;
844
+ type gateway_ILocalAgentRunner = ILocalAgentRunner;
845
+ type gateway_LocalAgentInput = LocalAgentInput;
846
+ type gateway_LocalAgentResult = LocalAgentResult;
826
847
  type gateway_MessageContext = MessageContext;
827
848
  type gateway_MessageMetadata = MessageMetadata;
828
849
  type gateway_MessageStorage = MessageStorage;
829
850
  type gateway_MessageType = MessageType;
830
851
  type gateway_PlatformType = PlatformType;
831
852
  declare namespace gateway {
832
- export type { gateway_AgentAdapter as AgentAdapter, gateway_AgentInfo as AgentInfo, gateway_ChannelInfo as ChannelInfo, gateway_ChannelListResponse as ChannelListResponse, gateway_ChannelPluginInfo as ChannelPluginInfo, gateway_GatewayConfig as GatewayConfig, gateway_GatewayHookHandler as GatewayHookHandler, gateway_GatewayMessage as GatewayMessage, gateway_GatewayMessageDeliveredInput as GatewayMessageDeliveredInput, gateway_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReadInput as GatewayMessageReadInput, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, gateway_GatewayMessageSendInput as GatewayMessageSendInput, gateway_GatewayServerConfig as GatewayServerConfig, gateway_IGatewayServer as IGatewayServer, gateway_IGlobal as IGlobal, gateway_IHookRegistry as IHookRegistry, gateway_IInstance as IInstance, gateway_MessageContext as MessageContext, gateway_MessageMetadata as MessageMetadata, gateway_MessageStorage as MessageStorage, gateway_MessageType as MessageType, gateway_PlatformType as PlatformType };
853
+ export type { gateway_AgentAdapter as AgentAdapter, gateway_AgentInfo as AgentInfo, gateway_ChannelInfo as ChannelInfo, gateway_ChannelListResponse as ChannelListResponse, gateway_ChannelPluginInfo as ChannelPluginInfo, gateway_GatewayConfig as GatewayConfig, gateway_GatewayHookHandler as GatewayHookHandler, gateway_GatewayMessage as GatewayMessage, gateway_GatewayMessageDeliveredInput as GatewayMessageDeliveredInput, gateway_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReadInput as GatewayMessageReadInput, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, gateway_GatewayMessageSendInput as GatewayMessageSendInput, gateway_GatewayServerConfig as GatewayServerConfig, gateway_IGatewayServer as IGatewayServer, gateway_IGlobal as IGlobal, gateway_IHookRegistry as IHookRegistry, gateway_IInstance as IInstance, gateway_ILocalAgentRunner as ILocalAgentRunner, gateway_LocalAgentInput as LocalAgentInput, gateway_LocalAgentResult as LocalAgentResult, gateway_MessageContext as MessageContext, gateway_MessageMetadata as MessageMetadata, gateway_MessageStorage as MessageStorage, gateway_MessageType as MessageType, gateway_PlatformType as PlatformType };
833
854
  }
834
855
 
835
856
  type ShellFunction = (input: Uint8Array) => Uint8Array;
@@ -910,6 +931,13 @@ declare function createTool<Args extends Record<string, z.ZodTypeAny>>(input: {
910
931
  };
911
932
  declare const toolSchema: typeof z;
912
933
  declare function buildToolArgs<T extends Record<string, z.ZodTypeAny>>(schema: T): z.ZodObject<T>;
934
+ interface ITool {
935
+ id: string;
936
+ name: string;
937
+ description: string;
938
+ args: Record<string, z.ZodTypeAny>;
939
+ execute(args: Record<string, unknown>, context: ToolContext): Promise<string>;
940
+ }
913
941
 
914
942
  interface EmbeddingConfig {
915
943
  provider: 'easbot-local' | 'local' | 'openai' | 'ollama';
@@ -1133,4 +1161,4 @@ type PromptPart = {
1133
1161
  mime?: string;
1134
1162
  };
1135
1163
 
1136
- export { type AgentAction, type AgentAdapter, AgentCapability, type AgentCreate, type AgentExecute, type AgentExecutionResult, type AgentInfo, type AgentPromptPart, type AgentQuery, AgentState, type AgentStatistics, type AgentStatusInfo, type AgentUpdate, type ApiResponse, ApiResponseBuilder, type ApiResult, type AskInput, type AuthInfo, type BaseKnowledgeConfig, type BaseSearchResult, type ChannelInfo, type ChannelListResponse, type ChannelPluginInfo, type CodebaseKnowledgeConfig, type CodebaseKnowledgeConfigWithModels, DEFAULT_EMBEDDING_CONFIG, DEFAULT_INDEXER_CONFIG, DEFAULT_NOTE_CHUNK_CONFIG, DEFAULT_PARSER_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SYNC_CONFIG, type DatabaseConfig, type EasbotShell, type EasbotShellError, type EasbotShellOutput, type EasbotShellPromise, type EmbeddingConfig, type ErrorDetails, type ErrorMessageMode, type ErrorResponse, type FilterExpression, type FilterRule, GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS, type GatewayConfig, type GatewayHookHandler, type GatewayMessage, type GatewayMessageDeliveredInput, type GatewayMessagePromptPart, type GatewayMessageReadInput, type GatewayMessageReceiveInput, type GatewayMessageSendInput, type GatewayServerConfig, gateway as GatewayTypes, type GraphLlmConfig, HTTPMethod, type HTTPRequestConfig, type HTTPResponseConfig, HTTPStatusCode, HttpStatus, type HybridSearchConfig, type IGatewayServer, type IGlobal, type IHookRegistry, type IInstance, type ISubAgentRunner, type IndexerConfig, type KnowledgeSearchOptions, type KnowledgeSearchSource, type Language, type LlmConfig, type MemoryKnowledgeConfig, type MemoryKnowledgeConfigWithModels, type MessageAttachment, type MessageContext, type MessageMetadata, type MessageQuery, type MessageReaction, type MessageSend, MessageSender, type MessageStorage, MessageType$1 as MessageType, type NoteKnowledgeConfig, type NoteKnowledgeConfigWithModels, type NoteKnowledgeSource, type OAuth2Token, type PageParams, type PageResult, type ParserConfig, type PlatformType, type PromptPart, Protocol, type RequestOptions, type RerankLlmConfig, type RetryRequest, type RunMode, type SearchConfig, type SessionCreate, type SessionInfo, type SessionMessage, type SessionQuery, type SessionStatistics, SessionStatus, type SessionUpdate, type ShellExpression, type ShellFunction, type SortingField, type SubAgentConfig, type SubAgentEvent, type SubAgentHandler, type SubAgentInput, type SubAgentInstance, type SubAgentModel, type SubAgentResult, type SubAgentStatus, type SuccessMessageMode, type SyncConfig, type TaskCreate, type TaskExecutionResult, type TaskInfo, type TaskLog, TaskPriority, type TaskQuery, TaskStatus, type TaskStep, type TaskUpdate, type ToolContext, type ToolDefinition, type ToolFunction, type TransportType, type UploadFileParams, type UploadFileResult, type WebSocketConnectionConfig, type WebSocketEvent, type WebSocketMessage, WebSocketMessageType, WebSocketState, buildToolArgs, createTool, getDefaultDatabasePath, getWorkspaceDatabasePath, toolSchema };
1164
+ export { type AgentAction, type AgentAdapter, type AgentCallback, AgentCapability, type AgentCreate, type AgentExecute, type AgentExecutionResult, type AgentInfo, type AgentInput, type AgentModel, type AgentPromptPart, type AgentQuery, type AgentResult, AgentState, type AgentStatistics, type AgentStatusInfo, type AgentUpdate, type ApiResponse, ApiResponseBuilder, type ApiResult, type AskInput, type AuthInfo, type BaseKnowledgeConfig, type BaseSearchResult, type ChannelInfo, type ChannelListResponse, type ChannelPluginInfo, type CodebaseKnowledgeConfig, type CodebaseKnowledgeConfigWithModels, DEFAULT_EMBEDDING_CONFIG, DEFAULT_INDEXER_CONFIG, DEFAULT_NOTE_CHUNK_CONFIG, DEFAULT_PARSER_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SYNC_CONFIG, type DatabaseConfig, type EasbotShell, type EasbotShellError, type EasbotShellOutput, type EasbotShellPromise, type EmbeddingConfig, type ErrorDetails, type ErrorMessageMode, type ErrorResponse, type FilterExpression, type FilterRule, GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS, type GatewayConfig, type GatewayHookHandler, type GatewayMessage, type GatewayMessageDeliveredInput, type GatewayMessagePromptPart, type GatewayMessageReadInput, type GatewayMessageReceiveInput, type GatewayMessageSendInput, type GatewayServerConfig, gateway as GatewayTypes, type GraphLlmConfig, HTTPMethod, type HTTPRequestConfig, type HTTPResponseConfig, HTTPStatusCode, HttpStatus, type HybridSearchConfig, type IGatewayServer, type IGlobal, type IHookRegistry, type IInstance, type ISubAgentRunner, type ITool, type IndexerConfig, type KnowledgeSearchOptions, type KnowledgeSearchSource, type Language, type LlmConfig, type MemoryKnowledgeConfig, type MemoryKnowledgeConfigWithModels, type MessageAttachment, type MessageContext, type MessageMetadata, type MessageQuery, type MessageReaction, type MessageSend, MessageSender, type MessageStorage, MessageType$1 as MessageType, type NoteKnowledgeConfig, type NoteKnowledgeConfigWithModels, type NoteKnowledgeSource, type OAuth2Token, type PageParams, type PageResult, type ParserConfig, type PlatformType, type PromptPart, Protocol, type RequestOptions, type RerankLlmConfig, type RetryRequest, type RunMode, type SearchConfig, type SessionCreate, type SessionInfo, type SessionMessage, type SessionQuery, type SessionStatistics, SessionStatus, type SessionUpdate, type ShellExpression, type ShellFunction, type SortingField, type SubAgentConfig, type SubAgentEvent, type SubAgentHandler, type SubAgentInput, type SubAgentInstance, type SubAgentResult, type SubAgentStatus, type SuccessMessageMode, type SyncConfig, type TaskCreate, type TaskExecutionResult, type TaskInfo, type TaskLog, TaskPriority, type TaskQuery, TaskStatus, type TaskStep, type TaskUpdate, type ToolContext, type ToolDefinition, type ToolFunction, type TransportType, type UploadFileParams, type UploadFileResult, type WebSocketConnectionConfig, type WebSocketEvent, type WebSocketMessage, WebSocketMessageType, WebSocketState, buildToolArgs, createTool, getDefaultDatabasePath, getWorkspaceDatabasePath, toolSchema };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import {z}from'zod';var u=(n=>(n.HTTP="http",n.WEBSOCKET="websocket",n.GRPC="grpc",n.TCP="tcp",n.UDP="udp",n))(u||{}),m=(r=>(r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r.HEAD="HEAD",r.OPTIONS="OPTIONS",r))(m||{}),d=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(d||{}),l=(n=>(n.CONNECTING="connecting",n.OPEN="open",n.CLOSING="closing",n.CLOSED="closed",n.ERROR="error",n))(l||{}),p=(n=>(n.TEXT="text",n.BINARY="binary",n.JSON="json",n.PING="ping",n.PONG="pong",n))(p||{}),b=(e=>(e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e))(b||{});var f=(r=>(r.INITIALIZING="initializing",r.IDLE="idle",r.RUNNING="running",r.SUSPENDED="suspended",r.STOPPING="stopping",r.STOPPED="stopped",r.ERROR="error",r))(f||{});var x=(o=>(o.TEXT="text",o.IMAGE="image",o.FILE="file",o.AUDIO="audio",o.VIDEO="video",o.SYSTEM="system",o))(x||{}),y=(g=>(g.USER="user",g.AGENT="agent",g.SYSTEM="system",g))(y||{});var R={};function j(i){return {description:i.description,args:i.args,execute:i.execute}}var W=z;function V(i){return z.object(i)}var T={provider:"easbot-local",model:"bge-base-zh-v1.5",batchSize:32},I={maxResults:3,minScore:.1,hybrid:{enabled:true,vectorWeight:.7,textWeight:.3}},C={onBoot:true,onSearch:true,onSessionStart:true,intervalMs:3e5},A={batchSize:50,ignorePatterns:["node_modules/**","dist/**","build/**",".git/**","__pycache__/**","*.min.js","*.min.ts"],incremental:true},S={languages:["ts","tsx","js","py","rs","go","c","cpp","csharp","java","scala","ruby","php","zig"],lazyLoad:true},h={chunkSize:1024,chunkOverlap:102,minChunkLength:100};function k(i,c){return `${i}/easbot/${c}`}function N(i,c){return `${i}/.easbot/${c}`}var D=[{type:"person",rule:"A human individual, role holder, or named actor."},{type:"organization",rule:"A company, team, institution, or formal group."},{type:"location",rule:"A place, region, site, facility, or spatial scope."},{type:"concept",rule:"An abstract idea, theme, method, policy, or principle."},{type:"object",rule:"A tangible or digital thing, product, artifact, or resource."},{type:"document",rule:"A report, note, page, paper, guideline, or formal text artifact."},{type:"process",rule:"A workflow, procedure, lifecycle, or repeatable sequence of steps."},{type:"task",rule:"A specific action item, issue, requirement, or objective."},{type:"metric",rule:"A measurable quantity, KPI, target value, or indicator."},{type:"time",rule:"A date, period, schedule marker, deadline, or temporal reference."},{type:"event",rule:"A notable milestone, release, incident, meeting, or time-bounded activity."},{type:"keyword",rule:"A compact fallback term when no stronger category applies."}],v=[{type:"is_a",rule:"Source is a subtype or instance of target."},{type:"part_of",rule:"Source is a component/subset of target."},{type:"has_attribute",rule:"Source has target as a key property or characteristic."},{type:"located_in",rule:"Source is physically or logically located in target."},{type:"occurs_in",rule:"Source event/process happens during or within target context/time/place."},{type:"causes",rule:"Source contributes to or causes target."},{type:"influences",rule:"Source affects target without strict causality."},{type:"owned_by",rule:"Source belongs to or is controlled by target."},{type:"member_of",rule:"Source person/entity is a member of target group."},{type:"uses",rule:"Source uses target as a dependency or tool."},{type:"depends_on",rule:"Source requires target to work or complete."},{type:"related_to",rule:"Weak but useful semantic relation when others do not fit."},{type:"defines",rule:"Source document or concept defines target entity."},{type:"referenced_in",rule:"Source entity is referenced or mentioned in target document."},{type:"used_by",rule:"Source entity is used by target process or concept."},{type:"relates_to",rule:"Source concept is semantically related to target concept."}];export{f as AgentState,T as DEFAULT_EMBEDDING_CONFIG,A as DEFAULT_INDEXER_CONFIG,h as DEFAULT_NOTE_CHUNK_CONFIG,S as DEFAULT_PARSER_CONFIG,I as DEFAULT_SEARCH_CONFIG,C as DEFAULT_SYNC_CONFIG,D as GRAPH_ENTITY_TYPE_DEFINITIONS,v as GRAPH_RELATION_TYPE_DEFINITIONS,R as GatewayTypes,m as HTTPMethod,d as HTTPStatusCode,b as HttpStatus,y as MessageSender,x as MessageType,u as Protocol,p as WebSocketMessageType,l as WebSocketState,V as buildToolArgs,j as createTool,k as getDefaultDatabasePath,N as getWorkspaceDatabasePath,W as toolSchema};
1
+ import {z}from'zod';var u=(n=>(n.HTTP="http",n.WEBSOCKET="websocket",n.GRPC="grpc",n.TCP="tcp",n.UDP="udp",n))(u||{}),m=(r=>(r.GET="GET",r.POST="POST",r.PUT="PUT",r.DELETE="DELETE",r.PATCH="PATCH",r.HEAD="HEAD",r.OPTIONS="OPTIONS",r))(m||{}),d=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(d||{}),l=(n=>(n.CONNECTING="connecting",n.OPEN="open",n.CLOSING="closing",n.CLOSED="closed",n.ERROR="error",n))(l||{}),p=(n=>(n.TEXT="text",n.BINARY="binary",n.JSON="json",n.PING="ping",n.PONG="pong",n))(p||{}),b=(e=>(e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e))(b||{});var f=(r=>(r.INITIALIZING="initializing",r.IDLE="idle",r.RUNNING="running",r.SUSPENDED="suspended",r.STOPPING="stopping",r.STOPPED="stopped",r.ERROR="error",r))(f||{});var x=(o=>(o.TEXT="text",o.IMAGE="image",o.FILE="file",o.AUDIO="audio",o.VIDEO="video",o.SYSTEM="system",o))(x||{}),y=(g=>(g.USER="user",g.AGENT="agent",g.SYSTEM="system",g))(y||{});var R={};function j(i){return {description:i.description,args:i.args,execute:i.execute}}var W=z;function V(i){return z.object(i)}var T={provider:"easbot-local",model:"bge-base-zh-v1.5",batchSize:32},I={maxResults:3,minScore:.1,hybrid:{enabled:true,vectorWeight:.7,textWeight:.3}},C={onBoot:true,onSearch:true,onSessionStart:true,intervalMs:3e5},A={batchSize:50,ignorePatterns:["node_modules/**","dist/**","build/**",".git/**","__pycache__/**","*.min.js","*.min.ts"],incremental:true},S={languages:["ts","tsx","js","py","rs","go","c","cpp","csharp","java","scala","ruby","php","zig"],lazyLoad:true},h={chunkSize:1024,chunkOverlap:102,minChunkLength:100};function k(i,c){return `${i}/easbot/${c}`}function N(i,c){return `${i}/.easbot/${c}`}var v=[{type:"person",rule:"A human individual, role holder, or named actor."},{type:"organization",rule:"A company, team, institution, or formal group."},{type:"location",rule:"A place, region, site, facility, or spatial scope."},{type:"concept",rule:"An abstract idea, theme, method, policy, or principle."},{type:"object",rule:"A tangible or digital thing, product, artifact, or resource."},{type:"document",rule:"A report, note, page, paper, guideline, or formal text artifact."},{type:"process",rule:"A workflow, procedure, lifecycle, or repeatable sequence of steps."},{type:"task",rule:"A specific action item, issue, requirement, or objective."},{type:"metric",rule:"A measurable quantity, KPI, target value, or indicator."},{type:"time",rule:"A date, period, schedule marker, deadline, or temporal reference."},{type:"event",rule:"A notable milestone, release, incident, meeting, or time-bounded activity."},{type:"keyword",rule:"A compact fallback term when no stronger category applies."}],D=[{type:"is_a",rule:"Source is a subtype or instance of target."},{type:"part_of",rule:"Source is a component/subset of target."},{type:"has_attribute",rule:"Source has target as a key property or characteristic."},{type:"located_in",rule:"Source is physically or logically located in target."},{type:"occurs_in",rule:"Source event/process happens during or within target context/time/place."},{type:"causes",rule:"Source contributes to or causes target."},{type:"influences",rule:"Source affects target without strict causality."},{type:"owned_by",rule:"Source belongs to or is controlled by target."},{type:"member_of",rule:"Source person/entity is a member of target group."},{type:"uses",rule:"Source uses target as a dependency or tool."},{type:"depends_on",rule:"Source requires target to work or complete."},{type:"related_to",rule:"Weak but useful semantic relation when others do not fit."},{type:"defines",rule:"Source document or concept defines target entity."},{type:"referenced_in",rule:"Source entity is referenced or mentioned in target document."},{type:"used_by",rule:"Source entity is used by target process or concept."},{type:"relates_to",rule:"Source concept is semantically related to target concept."}];export{f as AgentState,T as DEFAULT_EMBEDDING_CONFIG,A as DEFAULT_INDEXER_CONFIG,h as DEFAULT_NOTE_CHUNK_CONFIG,S as DEFAULT_PARSER_CONFIG,I as DEFAULT_SEARCH_CONFIG,C as DEFAULT_SYNC_CONFIG,v as GRAPH_ENTITY_TYPE_DEFINITIONS,D as GRAPH_RELATION_TYPE_DEFINITIONS,R as GatewayTypes,m as HTTPMethod,d as HTTPStatusCode,b as HttpStatus,y as MessageSender,x as MessageType,u as Protocol,p as WebSocketMessageType,l as WebSocketState,V as buildToolArgs,j as createTool,k as getDefaultDatabasePath,N as getWorkspaceDatabasePath,W as toolSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easbot/types",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "description": "Shared types library for EASBOT ecosystem",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -45,7 +45,8 @@
45
45
  "@ai-sdk/provider-utils": "^4.0.27",
46
46
  "ai": "^6.0.176",
47
47
  "axios": "^1.16.1",
48
- "zod": "^4.4.3"
48
+ "zod": "^4.4.3",
49
+ "@easbot/sdk": "0.2.36"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@biomejs/biome": "^2.4.14",