@easbot/types 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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;
@@ -556,30 +561,48 @@ type AgentPromptPart = {
556
561
  type: 'file';
557
562
  data: string | URL | Uint8Array;
558
563
  mime?: string;
564
+ } | {
565
+ type: 'memory';
566
+ status: 'pending' | 'processing' | 'completed' | 'failed' | 'skipped';
567
+ time: {
568
+ start: number;
569
+ end?: number;
570
+ };
571
+ result?: string;
572
+ error?: string;
573
+ reason?: string;
559
574
  };
575
+ interface AgentInput {
576
+ source: string;
577
+ title: string;
578
+ agent?: string;
579
+ model?: AgentModel;
580
+ tools?: Record<string, boolean>;
581
+ system?: string;
582
+ parts: AgentPromptPart[];
583
+ metadata?: Record<string, unknown>;
584
+ }
585
+ interface AgentResult {
586
+ title: string;
587
+ output: string;
588
+ metadata: AgentResultMetadata;
589
+ }
590
+ interface AgentResultMetadata {
591
+ sessionId?: string;
592
+ [key: string]: unknown;
593
+ }
594
+ type AgentCallback = (result: AgentResult) => Promise<void>;
595
+
560
596
  type RunMode = 'ephemeral' | 'persistent';
561
597
  type TransportType = 'stdio' | 'http' | 'websocket' | 'cli';
562
598
  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;
599
+ interface SubAgentInput extends AgentInput {
570
600
  agent: string;
571
601
  sessionId?: string;
572
- model?: SubAgentModel;
573
- parts?: AgentPromptPart[];
574
- system?: string;
575
- tools?: Record<string, boolean>;
576
602
  syncMessages?: boolean;
577
603
  config?: Partial<SubAgentConfig>;
578
604
  }
579
- interface SubAgentResult {
580
- title: string;
581
- output: string;
582
- metadata: Record<string, unknown>;
605
+ interface SubAgentResult extends AgentResult {
583
606
  userMessage?: unknown;
584
607
  assistantMessage?: unknown;
585
608
  }
@@ -600,7 +623,7 @@ interface SubAgentConfig {
600
623
  cwd?: string;
601
624
  mcpServers?: string[];
602
625
  agentConfig?: {
603
- model?: SubAgentModel;
626
+ model?: AgentModel;
604
627
  system?: string;
605
628
  tools?: Record<string, boolean>;
606
629
  };
@@ -638,6 +661,8 @@ interface SubAgentHandler {
638
661
  checkHealth?(): Promise<boolean>;
639
662
  }
640
663
 
664
+ type LocalAgentInput = AgentInput;
665
+ type LocalAgentResult = AgentResult;
641
666
  type GatewayMessagePromptPart = AgentPromptPart;
642
667
  type MessageType = 'input' | 'output' | 'system' | 'control';
643
668
  type PlatformType = 'telegram' | 'discord' | 'slack' | 'feishu' | 'wechat' | 'webchat' | 'signal' | 'nostr' | 'whatsapp' | 'tui' | 'api' | 'web' | 'desktop';
@@ -782,8 +807,15 @@ interface IHookRegistry {
782
807
  data?: unknown;
783
808
  }): Promise<void>;
784
809
  }
810
+ interface ILocalAgentRunner {
811
+ run(input: AgentInput): Promise<AgentResult>;
812
+ }
813
+ interface ILocalAgentRunner {
814
+ run(input: LocalAgentInput): Promise<LocalAgentResult>;
815
+ }
785
816
  interface AgentAdapter {
786
817
  subAgentRunner: ISubAgentRunner;
818
+ localAgentRunner: ILocalAgentRunner;
787
819
  hookRegistry: {
788
820
  triggerEvent<T = unknown>(event: string, input: T, context?: Record<string, unknown>): Promise<{
789
821
  success: boolean;
@@ -793,6 +825,7 @@ interface AgentAdapter {
793
825
  };
794
826
  global: IGlobal;
795
827
  instance: IInstance;
828
+ sdk: EasbotClient;
796
829
  }
797
830
  interface IGatewayServer {
798
831
  start(): Promise<void>;
@@ -823,13 +856,16 @@ type gateway_IGatewayServer = IGatewayServer;
823
856
  type gateway_IGlobal = IGlobal;
824
857
  type gateway_IHookRegistry = IHookRegistry;
825
858
  type gateway_IInstance = IInstance;
859
+ type gateway_ILocalAgentRunner = ILocalAgentRunner;
860
+ type gateway_LocalAgentInput = LocalAgentInput;
861
+ type gateway_LocalAgentResult = LocalAgentResult;
826
862
  type gateway_MessageContext = MessageContext;
827
863
  type gateway_MessageMetadata = MessageMetadata;
828
864
  type gateway_MessageStorage = MessageStorage;
829
865
  type gateway_MessageType = MessageType;
830
866
  type gateway_PlatformType = PlatformType;
831
867
  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 };
868
+ 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
869
  }
834
870
 
835
871
  type ShellFunction = (input: Uint8Array) => Uint8Array;
@@ -879,8 +915,8 @@ type AskInput = {
879
915
  metadata: Record<string, unknown>;
880
916
  };
881
917
  type ToolContext = {
882
- sessionID: string;
883
- messageID: string;
918
+ sessionId: string;
919
+ messageId: string;
884
920
  agent: string;
885
921
  directory: string;
886
922
  worktree: string;
@@ -910,6 +946,13 @@ declare function createTool<Args extends Record<string, z.ZodTypeAny>>(input: {
910
946
  };
911
947
  declare const toolSchema: typeof z;
912
948
  declare function buildToolArgs<T extends Record<string, z.ZodTypeAny>>(schema: T): z.ZodObject<T>;
949
+ interface ITool {
950
+ id: string;
951
+ name: string;
952
+ description: string;
953
+ args: Record<string, z.ZodTypeAny>;
954
+ execute(args: Record<string, unknown>, context: ToolContext): Promise<string>;
955
+ }
913
956
 
914
957
  interface EmbeddingConfig {
915
958
  provider: 'easbot-local' | 'local' | 'openai' | 'ollama';
@@ -1133,4 +1176,4 @@ type PromptPart = {
1133
1176
  mime?: string;
1134
1177
  };
1135
1178
 
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 };
1179
+ 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, type AgentResultMetadata, 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;
@@ -556,30 +561,48 @@ type AgentPromptPart = {
556
561
  type: 'file';
557
562
  data: string | URL | Uint8Array;
558
563
  mime?: string;
564
+ } | {
565
+ type: 'memory';
566
+ status: 'pending' | 'processing' | 'completed' | 'failed' | 'skipped';
567
+ time: {
568
+ start: number;
569
+ end?: number;
570
+ };
571
+ result?: string;
572
+ error?: string;
573
+ reason?: string;
559
574
  };
575
+ interface AgentInput {
576
+ source: string;
577
+ title: string;
578
+ agent?: string;
579
+ model?: AgentModel;
580
+ tools?: Record<string, boolean>;
581
+ system?: string;
582
+ parts: AgentPromptPart[];
583
+ metadata?: Record<string, unknown>;
584
+ }
585
+ interface AgentResult {
586
+ title: string;
587
+ output: string;
588
+ metadata: AgentResultMetadata;
589
+ }
590
+ interface AgentResultMetadata {
591
+ sessionId?: string;
592
+ [key: string]: unknown;
593
+ }
594
+ type AgentCallback = (result: AgentResult) => Promise<void>;
595
+
560
596
  type RunMode = 'ephemeral' | 'persistent';
561
597
  type TransportType = 'stdio' | 'http' | 'websocket' | 'cli';
562
598
  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;
599
+ interface SubAgentInput extends AgentInput {
570
600
  agent: string;
571
601
  sessionId?: string;
572
- model?: SubAgentModel;
573
- parts?: AgentPromptPart[];
574
- system?: string;
575
- tools?: Record<string, boolean>;
576
602
  syncMessages?: boolean;
577
603
  config?: Partial<SubAgentConfig>;
578
604
  }
579
- interface SubAgentResult {
580
- title: string;
581
- output: string;
582
- metadata: Record<string, unknown>;
605
+ interface SubAgentResult extends AgentResult {
583
606
  userMessage?: unknown;
584
607
  assistantMessage?: unknown;
585
608
  }
@@ -600,7 +623,7 @@ interface SubAgentConfig {
600
623
  cwd?: string;
601
624
  mcpServers?: string[];
602
625
  agentConfig?: {
603
- model?: SubAgentModel;
626
+ model?: AgentModel;
604
627
  system?: string;
605
628
  tools?: Record<string, boolean>;
606
629
  };
@@ -638,6 +661,8 @@ interface SubAgentHandler {
638
661
  checkHealth?(): Promise<boolean>;
639
662
  }
640
663
 
664
+ type LocalAgentInput = AgentInput;
665
+ type LocalAgentResult = AgentResult;
641
666
  type GatewayMessagePromptPart = AgentPromptPart;
642
667
  type MessageType = 'input' | 'output' | 'system' | 'control';
643
668
  type PlatformType = 'telegram' | 'discord' | 'slack' | 'feishu' | 'wechat' | 'webchat' | 'signal' | 'nostr' | 'whatsapp' | 'tui' | 'api' | 'web' | 'desktop';
@@ -782,8 +807,15 @@ interface IHookRegistry {
782
807
  data?: unknown;
783
808
  }): Promise<void>;
784
809
  }
810
+ interface ILocalAgentRunner {
811
+ run(input: AgentInput): Promise<AgentResult>;
812
+ }
813
+ interface ILocalAgentRunner {
814
+ run(input: LocalAgentInput): Promise<LocalAgentResult>;
815
+ }
785
816
  interface AgentAdapter {
786
817
  subAgentRunner: ISubAgentRunner;
818
+ localAgentRunner: ILocalAgentRunner;
787
819
  hookRegistry: {
788
820
  triggerEvent<T = unknown>(event: string, input: T, context?: Record<string, unknown>): Promise<{
789
821
  success: boolean;
@@ -793,6 +825,7 @@ interface AgentAdapter {
793
825
  };
794
826
  global: IGlobal;
795
827
  instance: IInstance;
828
+ sdk: EasbotClient;
796
829
  }
797
830
  interface IGatewayServer {
798
831
  start(): Promise<void>;
@@ -823,13 +856,16 @@ type gateway_IGatewayServer = IGatewayServer;
823
856
  type gateway_IGlobal = IGlobal;
824
857
  type gateway_IHookRegistry = IHookRegistry;
825
858
  type gateway_IInstance = IInstance;
859
+ type gateway_ILocalAgentRunner = ILocalAgentRunner;
860
+ type gateway_LocalAgentInput = LocalAgentInput;
861
+ type gateway_LocalAgentResult = LocalAgentResult;
826
862
  type gateway_MessageContext = MessageContext;
827
863
  type gateway_MessageMetadata = MessageMetadata;
828
864
  type gateway_MessageStorage = MessageStorage;
829
865
  type gateway_MessageType = MessageType;
830
866
  type gateway_PlatformType = PlatformType;
831
867
  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 };
868
+ 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
869
  }
834
870
 
835
871
  type ShellFunction = (input: Uint8Array) => Uint8Array;
@@ -879,8 +915,8 @@ type AskInput = {
879
915
  metadata: Record<string, unknown>;
880
916
  };
881
917
  type ToolContext = {
882
- sessionID: string;
883
- messageID: string;
918
+ sessionId: string;
919
+ messageId: string;
884
920
  agent: string;
885
921
  directory: string;
886
922
  worktree: string;
@@ -910,6 +946,13 @@ declare function createTool<Args extends Record<string, z.ZodTypeAny>>(input: {
910
946
  };
911
947
  declare const toolSchema: typeof z;
912
948
  declare function buildToolArgs<T extends Record<string, z.ZodTypeAny>>(schema: T): z.ZodObject<T>;
949
+ interface ITool {
950
+ id: string;
951
+ name: string;
952
+ description: string;
953
+ args: Record<string, z.ZodTypeAny>;
954
+ execute(args: Record<string, unknown>, context: ToolContext): Promise<string>;
955
+ }
913
956
 
914
957
  interface EmbeddingConfig {
915
958
  provider: 'easbot-local' | 'local' | 'openai' | 'ollama';
@@ -1133,4 +1176,4 @@ type PromptPart = {
1133
1176
  mime?: string;
1134
1177
  };
1135
1178
 
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 };
1179
+ 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, type AgentResultMetadata, 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.37",
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.37"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@biomejs/biome": "^2.4.14",