@intelliweave/embedded 2.0.72-beta.5 → 2.0.72-beta.6

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.
@@ -456,8 +456,16 @@ declare class KnowledgeBase {
456
456
  lastResults: KnowledgeBaseItem[];
457
457
  /** Individual knowledge base entries added manually by the application */
458
458
  manualEntries: KnowledgeBaseItem[];
459
+ /** If true, allows using globally defined sources from the browser window events */
460
+ allowWindowSources: boolean;
461
+ /** If true, allows using knowledge specified in the global configuration object */
462
+ allowGlobalConfigSources: boolean;
459
463
  /** Constructor */
460
464
  constructor(ai: IntelliWeave);
465
+ /** Ensures the internal knowledge is set correctly */
466
+ ensureInternalKnowledge(): void;
467
+ /** Clears all knowledge back to the default */
468
+ reset(): void;
461
469
  /**
462
470
  * Register a new knowledge base source. You can pass either just a query function, or an ID and a query function.
463
471
  *
@@ -983,6 +991,43 @@ declare class IntelliWeaveMessageParser {
983
991
  toolResult(toolCallInstanceID: string): TokenWindowGroupItemSection | null;
984
992
  }
985
993
 
994
+ /** Handles subagents. This allows your Persona to use other Personas as tools. */
995
+ declare class SubAgents {
996
+ /** Reference to the main IntelliWeave instance */
997
+ ai: IntelliWeave;
998
+ /** Constructor */
999
+ constructor(ai: IntelliWeave);
1000
+ /** Subagents */
1001
+ subagents: SubAgentConfig[];
1002
+ /** Cached subagents */
1003
+ cachedSubagents: Record<string, IntelliWeave>;
1004
+ /** Register a sub-agent */
1005
+ register(config: SubAgentConfig): void;
1006
+ /** Unregister subagent */
1007
+ remove(id: string): void;
1008
+ /** Run the subagent */
1009
+ runQuery(config: SubAgentConfig, query: string): Promise<string>;
1010
+ }
1011
+ /** Sub-agent config */
1012
+ interface SubAgentConfig {
1013
+ /** ID of the sub-agent */
1014
+ id: string;
1015
+ /** API key for the persona. If not specified, uses the same api key as the main agent. */
1016
+ apiKey?: string;
1017
+ /** Name of the sub-agent */
1018
+ name?: string;
1019
+ /** Instructions for the main agent to use this sub agent */
1020
+ usageInstructions?: string;
1021
+ /** If true, will remove all Persona knowledge entries */
1022
+ clearExistingKnowledge?: boolean;
1023
+ /** Extra knowledge base sources for the sub-agent */
1024
+ knowledge?: KnowledgeFetcher;
1025
+ /** Optional extra configuration for the subagent instance */
1026
+ config?: Partial<WebWeaverGPTConfig>;
1027
+ /** Called when the subagent is loaded */
1028
+ onAgentLoaded?: (agent: IntelliWeave) => Promise<void> | void;
1029
+ }
1030
+
986
1031
  /** Built-in action flags for the persona */
987
1032
  interface BuiltInActionFlags {
988
1033
  /** Allows the AI to display follow-up suggestions */
@@ -1058,6 +1103,8 @@ interface WebWeaverGPTConfig {
1058
1103
  flags?: BuiltInActionFlags;
1059
1104
  /** Allow custom chat provider */
1060
1105
  onCreateProvider?: (config: ChatBaseConfig) => ChatBase;
1106
+ /** Subagents */
1107
+ subagents?: SubAgentConfig[];
1061
1108
  }
1062
1109
  /**
1063
1110
  * IntelliWeave interface, loads a Persona from the hub and allows you to interact with it. This is the main entry point into the IntelliWeave
@@ -1085,6 +1132,8 @@ declare class IntelliWeave extends EventTarget {
1085
1132
  conversationID: string;
1086
1133
  /** Knowledge database interface */
1087
1134
  knowledgeBase: KnowledgeBase;
1135
+ /** Subagent interface */
1136
+ subAgents: SubAgents;
1088
1137
  /** Last KB search that was performed */
1089
1138
  private _lastKBsearch;
1090
1139
  /** If set, the next time a request is made this is the KB result items that will be used, once-off. */
@@ -1145,7 +1194,10 @@ declare class IntelliWeave extends EventTarget {
1145
1194
  /** @private Called when the AI wants to run a KB action */
1146
1195
  toolRunKBAction(kb: KnowledgeBaseItem, input: any): Promise<any>;
1147
1196
  /** Submit an analytics event asynchronously. These events are for use in the Conversation Analytics code. For anonymous statistic analysis, use track() instead. */
1197
+ private activeAnalyticsPromises;
1148
1198
  submitAnalyticsEvent(data: any): void;
1199
+ /** Wait for all analytics events to finish */
1200
+ waitForAnalytics(): Promise<void>;
1149
1201
  /** Reset the conversation */
1150
1202
  resetConversation(): void;
1151
1203
  /** Insert a message as if the assistant has written it */