@easbot/types 0.2.25 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +55 -8
- package/dist/index.d.ts +55 -8
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var zod=require('zod');var g=(
|
|
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;
|
package/dist/index.d.cts
CHANGED
|
@@ -594,7 +594,7 @@ interface SubAgentConfig {
|
|
|
594
594
|
uri?: string;
|
|
595
595
|
command?: string;
|
|
596
596
|
args?: string[];
|
|
597
|
-
env?: Record<string, string>;
|
|
597
|
+
env?: Record<string, string | undefined>;
|
|
598
598
|
timeout?: number;
|
|
599
599
|
maxConcurrent?: number;
|
|
600
600
|
cwd?: string;
|
|
@@ -651,7 +651,7 @@ interface GatewayMessage {
|
|
|
651
651
|
interface MessageMetadata {
|
|
652
652
|
channel: ChannelInfo;
|
|
653
653
|
context?: MessageContext;
|
|
654
|
-
agent?:
|
|
654
|
+
agent?: string;
|
|
655
655
|
[key: string]: unknown;
|
|
656
656
|
}
|
|
657
657
|
interface ChannelInfo {
|
|
@@ -659,6 +659,8 @@ interface ChannelInfo {
|
|
|
659
659
|
channelId: string;
|
|
660
660
|
userId?: string;
|
|
661
661
|
chatId?: string;
|
|
662
|
+
chatType?: string;
|
|
663
|
+
chatTitle?: string;
|
|
662
664
|
[key: string]: unknown;
|
|
663
665
|
}
|
|
664
666
|
interface ChannelPluginInfo {
|
|
@@ -684,7 +686,7 @@ interface AgentInfo {
|
|
|
684
686
|
[key: string]: unknown;
|
|
685
687
|
}
|
|
686
688
|
interface GatewayMessageReceiveInput {
|
|
687
|
-
|
|
689
|
+
id: string;
|
|
688
690
|
sessionId: string;
|
|
689
691
|
type: MessageType;
|
|
690
692
|
content: string | GatewayMessagePromptPart[];
|
|
@@ -693,13 +695,50 @@ interface GatewayMessageReceiveInput {
|
|
|
693
695
|
channelId?: string;
|
|
694
696
|
chatId?: string;
|
|
695
697
|
userId?: string;
|
|
698
|
+
chatType?: string;
|
|
699
|
+
chatTitle?: string;
|
|
696
700
|
};
|
|
697
701
|
replyToMessageId?: string;
|
|
698
702
|
timestamp?: number;
|
|
703
|
+
processorId?: string;
|
|
704
|
+
agent?: string;
|
|
705
|
+
}
|
|
706
|
+
interface GatewayMessageSendInput {
|
|
707
|
+
id: string;
|
|
708
|
+
sessionId: string;
|
|
709
|
+
type: MessageType;
|
|
710
|
+
content?: GatewayMessagePromptPart[];
|
|
711
|
+
channel: {
|
|
712
|
+
platform: string;
|
|
713
|
+
channelId: string;
|
|
714
|
+
};
|
|
715
|
+
proactive: boolean;
|
|
716
|
+
replyToMessageId?: string;
|
|
717
|
+
timestamp: number;
|
|
718
|
+
processorId?: string;
|
|
719
|
+
agent?: string;
|
|
720
|
+
}
|
|
721
|
+
interface GatewayMessageDeliveredInput {
|
|
722
|
+
id: string;
|
|
723
|
+
sessionId: string;
|
|
724
|
+
channel: {
|
|
725
|
+
platform: string;
|
|
726
|
+
channelId: string;
|
|
727
|
+
};
|
|
728
|
+
timestamp: number;
|
|
729
|
+
}
|
|
730
|
+
interface GatewayMessageReadInput {
|
|
731
|
+
id: string;
|
|
732
|
+
sessionId: string;
|
|
733
|
+
channel: {
|
|
734
|
+
platform: string;
|
|
735
|
+
channelId: string;
|
|
736
|
+
};
|
|
737
|
+
timestamp: number;
|
|
699
738
|
}
|
|
700
739
|
interface MessageStorage {
|
|
701
740
|
store(msg: GatewayMessageReceiveInput): Promise<void>;
|
|
702
|
-
updateStatus(
|
|
741
|
+
updateStatus(id: string, status: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
703
742
|
}
|
|
704
743
|
interface IGlobal {
|
|
705
744
|
Path: {
|
|
@@ -744,10 +783,15 @@ interface IHookRegistry {
|
|
|
744
783
|
}
|
|
745
784
|
interface AgentAdapter {
|
|
746
785
|
subAgentRunner: ISubAgentRunner;
|
|
747
|
-
hookRegistry:
|
|
786
|
+
hookRegistry: {
|
|
787
|
+
triggerEvent<T = unknown>(event: string, input: T, context?: Record<string, unknown>): Promise<{
|
|
788
|
+
success: boolean;
|
|
789
|
+
output: T;
|
|
790
|
+
modified: boolean;
|
|
791
|
+
}>;
|
|
792
|
+
};
|
|
748
793
|
global: IGlobal;
|
|
749
794
|
instance: IInstance;
|
|
750
|
-
setMessageStorage(storage: MessageStorage): void;
|
|
751
795
|
}
|
|
752
796
|
interface IGatewayServer {
|
|
753
797
|
start(): Promise<void>;
|
|
@@ -768,8 +812,11 @@ type gateway_ChannelPluginInfo = ChannelPluginInfo;
|
|
|
768
812
|
type gateway_GatewayConfig = GatewayConfig;
|
|
769
813
|
type gateway_GatewayHookHandler = GatewayHookHandler;
|
|
770
814
|
type gateway_GatewayMessage = GatewayMessage;
|
|
815
|
+
type gateway_GatewayMessageDeliveredInput = GatewayMessageDeliveredInput;
|
|
771
816
|
type gateway_GatewayMessagePromptPart = GatewayMessagePromptPart;
|
|
817
|
+
type gateway_GatewayMessageReadInput = GatewayMessageReadInput;
|
|
772
818
|
type gateway_GatewayMessageReceiveInput = GatewayMessageReceiveInput;
|
|
819
|
+
type gateway_GatewayMessageSendInput = GatewayMessageSendInput;
|
|
773
820
|
type gateway_GatewayServerConfig = GatewayServerConfig;
|
|
774
821
|
type gateway_IGatewayServer = IGatewayServer;
|
|
775
822
|
type gateway_IGlobal = IGlobal;
|
|
@@ -781,7 +828,7 @@ type gateway_MessageStorage = MessageStorage;
|
|
|
781
828
|
type gateway_MessageType = MessageType;
|
|
782
829
|
type gateway_PlatformType = PlatformType;
|
|
783
830
|
declare namespace gateway {
|
|
784
|
-
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_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, 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 };
|
|
831
|
+
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 };
|
|
785
832
|
}
|
|
786
833
|
|
|
787
834
|
type ShellFunction = (input: Uint8Array) => Uint8Array;
|
|
@@ -1085,4 +1132,4 @@ type PromptPart = {
|
|
|
1085
1132
|
mime?: string;
|
|
1086
1133
|
};
|
|
1087
1134
|
|
|
1088
|
-
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 GatewayMessagePromptPart, type GatewayMessageReceiveInput, 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 };
|
|
1135
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -594,7 +594,7 @@ interface SubAgentConfig {
|
|
|
594
594
|
uri?: string;
|
|
595
595
|
command?: string;
|
|
596
596
|
args?: string[];
|
|
597
|
-
env?: Record<string, string>;
|
|
597
|
+
env?: Record<string, string | undefined>;
|
|
598
598
|
timeout?: number;
|
|
599
599
|
maxConcurrent?: number;
|
|
600
600
|
cwd?: string;
|
|
@@ -651,7 +651,7 @@ interface GatewayMessage {
|
|
|
651
651
|
interface MessageMetadata {
|
|
652
652
|
channel: ChannelInfo;
|
|
653
653
|
context?: MessageContext;
|
|
654
|
-
agent?:
|
|
654
|
+
agent?: string;
|
|
655
655
|
[key: string]: unknown;
|
|
656
656
|
}
|
|
657
657
|
interface ChannelInfo {
|
|
@@ -659,6 +659,8 @@ interface ChannelInfo {
|
|
|
659
659
|
channelId: string;
|
|
660
660
|
userId?: string;
|
|
661
661
|
chatId?: string;
|
|
662
|
+
chatType?: string;
|
|
663
|
+
chatTitle?: string;
|
|
662
664
|
[key: string]: unknown;
|
|
663
665
|
}
|
|
664
666
|
interface ChannelPluginInfo {
|
|
@@ -684,7 +686,7 @@ interface AgentInfo {
|
|
|
684
686
|
[key: string]: unknown;
|
|
685
687
|
}
|
|
686
688
|
interface GatewayMessageReceiveInput {
|
|
687
|
-
|
|
689
|
+
id: string;
|
|
688
690
|
sessionId: string;
|
|
689
691
|
type: MessageType;
|
|
690
692
|
content: string | GatewayMessagePromptPart[];
|
|
@@ -693,13 +695,50 @@ interface GatewayMessageReceiveInput {
|
|
|
693
695
|
channelId?: string;
|
|
694
696
|
chatId?: string;
|
|
695
697
|
userId?: string;
|
|
698
|
+
chatType?: string;
|
|
699
|
+
chatTitle?: string;
|
|
696
700
|
};
|
|
697
701
|
replyToMessageId?: string;
|
|
698
702
|
timestamp?: number;
|
|
703
|
+
processorId?: string;
|
|
704
|
+
agent?: string;
|
|
705
|
+
}
|
|
706
|
+
interface GatewayMessageSendInput {
|
|
707
|
+
id: string;
|
|
708
|
+
sessionId: string;
|
|
709
|
+
type: MessageType;
|
|
710
|
+
content?: GatewayMessagePromptPart[];
|
|
711
|
+
channel: {
|
|
712
|
+
platform: string;
|
|
713
|
+
channelId: string;
|
|
714
|
+
};
|
|
715
|
+
proactive: boolean;
|
|
716
|
+
replyToMessageId?: string;
|
|
717
|
+
timestamp: number;
|
|
718
|
+
processorId?: string;
|
|
719
|
+
agent?: string;
|
|
720
|
+
}
|
|
721
|
+
interface GatewayMessageDeliveredInput {
|
|
722
|
+
id: string;
|
|
723
|
+
sessionId: string;
|
|
724
|
+
channel: {
|
|
725
|
+
platform: string;
|
|
726
|
+
channelId: string;
|
|
727
|
+
};
|
|
728
|
+
timestamp: number;
|
|
729
|
+
}
|
|
730
|
+
interface GatewayMessageReadInput {
|
|
731
|
+
id: string;
|
|
732
|
+
sessionId: string;
|
|
733
|
+
channel: {
|
|
734
|
+
platform: string;
|
|
735
|
+
channelId: string;
|
|
736
|
+
};
|
|
737
|
+
timestamp: number;
|
|
699
738
|
}
|
|
700
739
|
interface MessageStorage {
|
|
701
740
|
store(msg: GatewayMessageReceiveInput): Promise<void>;
|
|
702
|
-
updateStatus(
|
|
741
|
+
updateStatus(id: string, status: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
703
742
|
}
|
|
704
743
|
interface IGlobal {
|
|
705
744
|
Path: {
|
|
@@ -744,10 +783,15 @@ interface IHookRegistry {
|
|
|
744
783
|
}
|
|
745
784
|
interface AgentAdapter {
|
|
746
785
|
subAgentRunner: ISubAgentRunner;
|
|
747
|
-
hookRegistry:
|
|
786
|
+
hookRegistry: {
|
|
787
|
+
triggerEvent<T = unknown>(event: string, input: T, context?: Record<string, unknown>): Promise<{
|
|
788
|
+
success: boolean;
|
|
789
|
+
output: T;
|
|
790
|
+
modified: boolean;
|
|
791
|
+
}>;
|
|
792
|
+
};
|
|
748
793
|
global: IGlobal;
|
|
749
794
|
instance: IInstance;
|
|
750
|
-
setMessageStorage(storage: MessageStorage): void;
|
|
751
795
|
}
|
|
752
796
|
interface IGatewayServer {
|
|
753
797
|
start(): Promise<void>;
|
|
@@ -768,8 +812,11 @@ type gateway_ChannelPluginInfo = ChannelPluginInfo;
|
|
|
768
812
|
type gateway_GatewayConfig = GatewayConfig;
|
|
769
813
|
type gateway_GatewayHookHandler = GatewayHookHandler;
|
|
770
814
|
type gateway_GatewayMessage = GatewayMessage;
|
|
815
|
+
type gateway_GatewayMessageDeliveredInput = GatewayMessageDeliveredInput;
|
|
771
816
|
type gateway_GatewayMessagePromptPart = GatewayMessagePromptPart;
|
|
817
|
+
type gateway_GatewayMessageReadInput = GatewayMessageReadInput;
|
|
772
818
|
type gateway_GatewayMessageReceiveInput = GatewayMessageReceiveInput;
|
|
819
|
+
type gateway_GatewayMessageSendInput = GatewayMessageSendInput;
|
|
773
820
|
type gateway_GatewayServerConfig = GatewayServerConfig;
|
|
774
821
|
type gateway_IGatewayServer = IGatewayServer;
|
|
775
822
|
type gateway_IGlobal = IGlobal;
|
|
@@ -781,7 +828,7 @@ type gateway_MessageStorage = MessageStorage;
|
|
|
781
828
|
type gateway_MessageType = MessageType;
|
|
782
829
|
type gateway_PlatformType = PlatformType;
|
|
783
830
|
declare namespace gateway {
|
|
784
|
-
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_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, 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 };
|
|
831
|
+
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 };
|
|
785
832
|
}
|
|
786
833
|
|
|
787
834
|
type ShellFunction = (input: Uint8Array) => Uint8Array;
|
|
@@ -1085,4 +1132,4 @@ type PromptPart = {
|
|
|
1085
1132
|
mime?: string;
|
|
1086
1133
|
};
|
|
1087
1134
|
|
|
1088
|
-
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 GatewayMessagePromptPart, type GatewayMessageReceiveInput, 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 };
|
|
1135
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z}from'zod';var u=(
|
|
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};
|