@inkeep/agents-sdk 0.0.0-dev-20250912172534 → 0.0.0-dev-20250912184011
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 +527 -13
- package/dist/index.d.cts +223 -11
- package/dist/index.d.ts +223 -11
- package/dist/index.js +522 -14
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MCPToolConfig as MCPToolConfig$1, CredentialReferenceApiInsert, MCPTransportType, CredentialReferenceSelect, AgentApiInsert, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, ToolInsert, McpTransportConfig, ArtifactComponentInsert, DataComponentInsert } from '@inkeep/agents-core';
|
|
1
|
+
import { MCPToolConfig as MCPToolConfig$1, CredentialReferenceApiInsert, MCPTransportType, CredentialReferenceSelect, AgentApiInsert, AgentStopWhen, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, GraphStopWhen, ToolInsert, McpTransportConfig, ArtifactComponentInsert, DataComponentInsert, StopWhen, FullProjectDefinition } from '@inkeep/agents-core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
interface ToolInterface {
|
|
@@ -195,9 +195,7 @@ interface AgentConfig extends Omit<AgentApiInsert, 'projectId'> {
|
|
|
195
195
|
structuredOutput?: ModelSettings;
|
|
196
196
|
summarizer?: ModelSettings;
|
|
197
197
|
};
|
|
198
|
-
stopWhen?:
|
|
199
|
-
stepCountIs?: number;
|
|
200
|
-
};
|
|
198
|
+
stopWhen?: AgentStopWhen;
|
|
201
199
|
memory?: {
|
|
202
200
|
type: 'conversation' | 'episodic' | 'short_term';
|
|
203
201
|
capacity?: number;
|
|
@@ -341,9 +339,7 @@ interface GraphConfig {
|
|
|
341
339
|
tenantId?: string;
|
|
342
340
|
contextConfig?: any;
|
|
343
341
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
344
|
-
stopWhen?:
|
|
345
|
-
transferCountIs?: number;
|
|
346
|
-
};
|
|
342
|
+
stopWhen?: GraphStopWhen;
|
|
347
343
|
graphPrompt?: string;
|
|
348
344
|
models?: {
|
|
349
345
|
base?: ModelSettings;
|
|
@@ -625,9 +621,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
625
621
|
/**
|
|
626
622
|
* Get the graph's stopWhen configuration
|
|
627
623
|
*/
|
|
628
|
-
getStopWhen():
|
|
629
|
-
transferCountIs?: number;
|
|
630
|
-
};
|
|
624
|
+
getStopWhen(): GraphStopWhen;
|
|
631
625
|
/**
|
|
632
626
|
* Get the graph's status updates configuration
|
|
633
627
|
*/
|
|
@@ -709,10 +703,206 @@ declare class AgentGraph implements GraphInterface {
|
|
|
709
703
|
private createExternalAgents;
|
|
710
704
|
}
|
|
711
705
|
|
|
706
|
+
/**
|
|
707
|
+
* Project configuration interface for the SDK
|
|
708
|
+
*/
|
|
709
|
+
interface ProjectConfig {
|
|
710
|
+
id: string;
|
|
711
|
+
name: string;
|
|
712
|
+
description?: string;
|
|
713
|
+
tenantId?: string;
|
|
714
|
+
models?: {
|
|
715
|
+
base?: ModelSettings;
|
|
716
|
+
structuredOutput?: ModelSettings;
|
|
717
|
+
summarizer?: ModelSettings;
|
|
718
|
+
};
|
|
719
|
+
stopWhen?: StopWhen;
|
|
720
|
+
graphs?: () => AgentGraph[];
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Project interface for operations
|
|
724
|
+
*/
|
|
725
|
+
interface ProjectInterface {
|
|
726
|
+
init(): Promise<void>;
|
|
727
|
+
setConfig(tenantId: string, apiUrl: string): void;
|
|
728
|
+
getId(): string;
|
|
729
|
+
getName(): string;
|
|
730
|
+
getDescription(): string | undefined;
|
|
731
|
+
getTenantId(): string;
|
|
732
|
+
getModels(): ProjectConfig['models'];
|
|
733
|
+
getStopWhen(): ProjectConfig['stopWhen'];
|
|
734
|
+
getGraphs(): AgentGraph[];
|
|
735
|
+
addGraph(graph: AgentGraph): void;
|
|
736
|
+
removeGraph(id: string): boolean;
|
|
737
|
+
getStats(): {
|
|
738
|
+
projectId: string;
|
|
739
|
+
tenantId: string;
|
|
740
|
+
graphCount: number;
|
|
741
|
+
initialized: boolean;
|
|
742
|
+
};
|
|
743
|
+
validate(): {
|
|
744
|
+
valid: boolean;
|
|
745
|
+
errors: string[];
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Project class for managing agent projects
|
|
750
|
+
*
|
|
751
|
+
* Projects are the top-level organizational unit that contains graphs, agents, and shared configurations.
|
|
752
|
+
* They provide model inheritance and execution limits that cascade down to graphs and agents.
|
|
753
|
+
*
|
|
754
|
+
* @example
|
|
755
|
+
* ```typescript
|
|
756
|
+
* const myProject = new Project({
|
|
757
|
+
* id: 'customer-support-project',
|
|
758
|
+
* name: 'Customer Support System',
|
|
759
|
+
* description: 'Multi-agent customer support system',
|
|
760
|
+
* models: {
|
|
761
|
+
* base: { model: 'gpt-4o-mini' },
|
|
762
|
+
* structuredOutput: { model: 'gpt-4o' }
|
|
763
|
+
* },
|
|
764
|
+
* stopWhen: {
|
|
765
|
+
* transferCountIs: 10,
|
|
766
|
+
* stepCountIs: 50
|
|
767
|
+
* }
|
|
768
|
+
* });
|
|
769
|
+
*
|
|
770
|
+
* await myProject.init();
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
declare class Project implements ProjectInterface {
|
|
774
|
+
private projectId;
|
|
775
|
+
private projectName;
|
|
776
|
+
private projectDescription?;
|
|
777
|
+
private tenantId;
|
|
778
|
+
private baseURL;
|
|
779
|
+
private initialized;
|
|
780
|
+
private models?;
|
|
781
|
+
private stopWhen?;
|
|
782
|
+
private graphs;
|
|
783
|
+
private graphMap;
|
|
784
|
+
constructor(config: ProjectConfig);
|
|
785
|
+
/**
|
|
786
|
+
* Set or update the configuration (tenantId and apiUrl)
|
|
787
|
+
* This is used by the CLI to inject configuration from inkeep.config.ts
|
|
788
|
+
*/
|
|
789
|
+
setConfig(tenantId: string, apiUrl: string): void;
|
|
790
|
+
/**
|
|
791
|
+
* Initialize the project and create/update it in the backend using full project approach
|
|
792
|
+
*/
|
|
793
|
+
init(): Promise<void>;
|
|
794
|
+
/**
|
|
795
|
+
* Get the project ID
|
|
796
|
+
*/
|
|
797
|
+
getId(): string;
|
|
798
|
+
/**
|
|
799
|
+
* Get the project name
|
|
800
|
+
*/
|
|
801
|
+
getName(): string;
|
|
802
|
+
/**
|
|
803
|
+
* Get the project description
|
|
804
|
+
*/
|
|
805
|
+
getDescription(): string | undefined;
|
|
806
|
+
/**
|
|
807
|
+
* Get the tenant ID
|
|
808
|
+
*/
|
|
809
|
+
getTenantId(): string;
|
|
810
|
+
/**
|
|
811
|
+
* Get the project's model configuration
|
|
812
|
+
*/
|
|
813
|
+
getModels(): ProjectConfig['models'];
|
|
814
|
+
/**
|
|
815
|
+
* Set the project's model configuration
|
|
816
|
+
*/
|
|
817
|
+
setModels(models: ProjectConfig['models']): void;
|
|
818
|
+
/**
|
|
819
|
+
* Get the project's stopWhen configuration
|
|
820
|
+
*/
|
|
821
|
+
getStopWhen(): ProjectConfig['stopWhen'];
|
|
822
|
+
/**
|
|
823
|
+
* Set the project's stopWhen configuration
|
|
824
|
+
*/
|
|
825
|
+
setStopWhen(stopWhen: ProjectConfig['stopWhen']): void;
|
|
826
|
+
/**
|
|
827
|
+
* Get all graphs in the project
|
|
828
|
+
*/
|
|
829
|
+
getGraphs(): AgentGraph[];
|
|
830
|
+
/**
|
|
831
|
+
* Get a graph by ID
|
|
832
|
+
*/
|
|
833
|
+
getGraph(id: string): AgentGraph | undefined;
|
|
834
|
+
/**
|
|
835
|
+
* Add a graph to the project
|
|
836
|
+
*/
|
|
837
|
+
addGraph(graph: AgentGraph): void;
|
|
838
|
+
/**
|
|
839
|
+
* Remove a graph from the project
|
|
840
|
+
*/
|
|
841
|
+
removeGraph(id: string): boolean;
|
|
842
|
+
/**
|
|
843
|
+
* Get project statistics
|
|
844
|
+
*/
|
|
845
|
+
getStats(): {
|
|
846
|
+
projectId: string;
|
|
847
|
+
tenantId: string;
|
|
848
|
+
graphCount: number;
|
|
849
|
+
initialized: boolean;
|
|
850
|
+
};
|
|
851
|
+
/**
|
|
852
|
+
* Validate the project configuration
|
|
853
|
+
*/
|
|
854
|
+
validate(): {
|
|
855
|
+
valid: boolean;
|
|
856
|
+
errors: string[];
|
|
857
|
+
};
|
|
858
|
+
/**
|
|
859
|
+
* Convert the Project to FullProjectDefinition format
|
|
860
|
+
*/
|
|
861
|
+
private toFullProjectDefinition;
|
|
862
|
+
/**
|
|
863
|
+
* Convert project configuration to API format
|
|
864
|
+
*/
|
|
865
|
+
private toApiFormat;
|
|
866
|
+
}
|
|
867
|
+
|
|
712
868
|
/**
|
|
713
869
|
* Helper function to create graphs - OpenAI style
|
|
714
870
|
*/
|
|
715
871
|
declare function agentGraph(config: GraphConfig): AgentGraph;
|
|
872
|
+
/**
|
|
873
|
+
* Helper function to create projects - OpenAI style
|
|
874
|
+
*
|
|
875
|
+
* Projects are the top-level organizational unit that contains graphs, agents, and shared configurations.
|
|
876
|
+
* They provide model inheritance and execution limits that cascade down to graphs and agents.
|
|
877
|
+
*
|
|
878
|
+
* @param config - Project configuration
|
|
879
|
+
* @returns A new Project instance
|
|
880
|
+
*
|
|
881
|
+
* @example
|
|
882
|
+
* ```typescript
|
|
883
|
+
* const customerSupport = project({
|
|
884
|
+
* id: 'customer-support-project',
|
|
885
|
+
* name: 'Customer Support System',
|
|
886
|
+
* description: 'Multi-agent customer support system',
|
|
887
|
+
* models: {
|
|
888
|
+
* base: { model: 'gpt-4o-mini' },
|
|
889
|
+
* structuredOutput: { model: 'gpt-4o' }
|
|
890
|
+
* },
|
|
891
|
+
* stopWhen: {
|
|
892
|
+
* transferCountIs: 10,
|
|
893
|
+
* stepCountIs: 50
|
|
894
|
+
* },
|
|
895
|
+
* graphs: () => [
|
|
896
|
+
* agentGraph({
|
|
897
|
+
* id: 'support-graph',
|
|
898
|
+
* name: 'Support Graph',
|
|
899
|
+
* // ... graph config
|
|
900
|
+
* })
|
|
901
|
+
* ]
|
|
902
|
+
* });
|
|
903
|
+
* ```
|
|
904
|
+
*/
|
|
905
|
+
declare function project(config: ProjectConfig): Project;
|
|
716
906
|
/**
|
|
717
907
|
* Creates a new agent with stable ID enforcement.
|
|
718
908
|
*
|
|
@@ -879,6 +1069,28 @@ declare function createEnvironmentSettings<T extends Record<string, EnvironmentS
|
|
|
879
1069
|
*/
|
|
880
1070
|
declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig>(config: T): T;
|
|
881
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* Client-side functions for interacting with the Full Project API
|
|
1074
|
+
* These functions make HTTP requests to the server instead of direct database calls
|
|
1075
|
+
*/
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Create a full project via HTTP API
|
|
1079
|
+
*/
|
|
1080
|
+
declare function createFullProjectViaAPI(tenantId: string, apiUrl: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Update a full project via HTTP API (upsert behavior)
|
|
1083
|
+
*/
|
|
1084
|
+
declare function updateFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Get a full project via HTTP API
|
|
1087
|
+
*/
|
|
1088
|
+
declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<FullProjectDefinition | null>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Delete a full project via HTTP API
|
|
1091
|
+
*/
|
|
1092
|
+
declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<void>;
|
|
1093
|
+
|
|
882
1094
|
declare class Runner {
|
|
883
1095
|
/**
|
|
884
1096
|
* Run a graph until completion, handling transfers and tool calls
|
|
@@ -916,4 +1128,4 @@ declare const run: typeof Runner.run;
|
|
|
916
1128
|
declare const stream: typeof Runner.stream;
|
|
917
1129
|
declare const raceGraphs: typeof Runner.raceGraphs;
|
|
918
1130
|
|
|
919
|
-
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AllAgentInterface, ArtifactComponent, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, DataComponent, ExternalAgent, type ExternalAgentInterface, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, type ModelSettings, ModelSettingsSchema, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StatusComponent, type StatusUpdateSettings, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, transfer };
|
|
1131
|
+
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AllAgentInterface, ArtifactComponent, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, DataComponent, ExternalAgent, type ExternalAgentInterface, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, type ModelSettings, ModelSettingsSchema, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StatusComponent, type StatusUpdateSettings, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, getFullProjectViaAPI, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MCPToolConfig as MCPToolConfig$1, CredentialReferenceApiInsert, MCPTransportType, CredentialReferenceSelect, AgentApiInsert, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, ToolInsert, McpTransportConfig, ArtifactComponentInsert, DataComponentInsert } from '@inkeep/agents-core';
|
|
1
|
+
import { MCPToolConfig as MCPToolConfig$1, CredentialReferenceApiInsert, MCPTransportType, CredentialReferenceSelect, AgentApiInsert, AgentStopWhen, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, GraphStopWhen, ToolInsert, McpTransportConfig, ArtifactComponentInsert, DataComponentInsert, StopWhen, FullProjectDefinition } from '@inkeep/agents-core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
interface ToolInterface {
|
|
@@ -195,9 +195,7 @@ interface AgentConfig extends Omit<AgentApiInsert, 'projectId'> {
|
|
|
195
195
|
structuredOutput?: ModelSettings;
|
|
196
196
|
summarizer?: ModelSettings;
|
|
197
197
|
};
|
|
198
|
-
stopWhen?:
|
|
199
|
-
stepCountIs?: number;
|
|
200
|
-
};
|
|
198
|
+
stopWhen?: AgentStopWhen;
|
|
201
199
|
memory?: {
|
|
202
200
|
type: 'conversation' | 'episodic' | 'short_term';
|
|
203
201
|
capacity?: number;
|
|
@@ -341,9 +339,7 @@ interface GraphConfig {
|
|
|
341
339
|
tenantId?: string;
|
|
342
340
|
contextConfig?: any;
|
|
343
341
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
344
|
-
stopWhen?:
|
|
345
|
-
transferCountIs?: number;
|
|
346
|
-
};
|
|
342
|
+
stopWhen?: GraphStopWhen;
|
|
347
343
|
graphPrompt?: string;
|
|
348
344
|
models?: {
|
|
349
345
|
base?: ModelSettings;
|
|
@@ -625,9 +621,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
625
621
|
/**
|
|
626
622
|
* Get the graph's stopWhen configuration
|
|
627
623
|
*/
|
|
628
|
-
getStopWhen():
|
|
629
|
-
transferCountIs?: number;
|
|
630
|
-
};
|
|
624
|
+
getStopWhen(): GraphStopWhen;
|
|
631
625
|
/**
|
|
632
626
|
* Get the graph's status updates configuration
|
|
633
627
|
*/
|
|
@@ -709,10 +703,206 @@ declare class AgentGraph implements GraphInterface {
|
|
|
709
703
|
private createExternalAgents;
|
|
710
704
|
}
|
|
711
705
|
|
|
706
|
+
/**
|
|
707
|
+
* Project configuration interface for the SDK
|
|
708
|
+
*/
|
|
709
|
+
interface ProjectConfig {
|
|
710
|
+
id: string;
|
|
711
|
+
name: string;
|
|
712
|
+
description?: string;
|
|
713
|
+
tenantId?: string;
|
|
714
|
+
models?: {
|
|
715
|
+
base?: ModelSettings;
|
|
716
|
+
structuredOutput?: ModelSettings;
|
|
717
|
+
summarizer?: ModelSettings;
|
|
718
|
+
};
|
|
719
|
+
stopWhen?: StopWhen;
|
|
720
|
+
graphs?: () => AgentGraph[];
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Project interface for operations
|
|
724
|
+
*/
|
|
725
|
+
interface ProjectInterface {
|
|
726
|
+
init(): Promise<void>;
|
|
727
|
+
setConfig(tenantId: string, apiUrl: string): void;
|
|
728
|
+
getId(): string;
|
|
729
|
+
getName(): string;
|
|
730
|
+
getDescription(): string | undefined;
|
|
731
|
+
getTenantId(): string;
|
|
732
|
+
getModels(): ProjectConfig['models'];
|
|
733
|
+
getStopWhen(): ProjectConfig['stopWhen'];
|
|
734
|
+
getGraphs(): AgentGraph[];
|
|
735
|
+
addGraph(graph: AgentGraph): void;
|
|
736
|
+
removeGraph(id: string): boolean;
|
|
737
|
+
getStats(): {
|
|
738
|
+
projectId: string;
|
|
739
|
+
tenantId: string;
|
|
740
|
+
graphCount: number;
|
|
741
|
+
initialized: boolean;
|
|
742
|
+
};
|
|
743
|
+
validate(): {
|
|
744
|
+
valid: boolean;
|
|
745
|
+
errors: string[];
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Project class for managing agent projects
|
|
750
|
+
*
|
|
751
|
+
* Projects are the top-level organizational unit that contains graphs, agents, and shared configurations.
|
|
752
|
+
* They provide model inheritance and execution limits that cascade down to graphs and agents.
|
|
753
|
+
*
|
|
754
|
+
* @example
|
|
755
|
+
* ```typescript
|
|
756
|
+
* const myProject = new Project({
|
|
757
|
+
* id: 'customer-support-project',
|
|
758
|
+
* name: 'Customer Support System',
|
|
759
|
+
* description: 'Multi-agent customer support system',
|
|
760
|
+
* models: {
|
|
761
|
+
* base: { model: 'gpt-4o-mini' },
|
|
762
|
+
* structuredOutput: { model: 'gpt-4o' }
|
|
763
|
+
* },
|
|
764
|
+
* stopWhen: {
|
|
765
|
+
* transferCountIs: 10,
|
|
766
|
+
* stepCountIs: 50
|
|
767
|
+
* }
|
|
768
|
+
* });
|
|
769
|
+
*
|
|
770
|
+
* await myProject.init();
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
declare class Project implements ProjectInterface {
|
|
774
|
+
private projectId;
|
|
775
|
+
private projectName;
|
|
776
|
+
private projectDescription?;
|
|
777
|
+
private tenantId;
|
|
778
|
+
private baseURL;
|
|
779
|
+
private initialized;
|
|
780
|
+
private models?;
|
|
781
|
+
private stopWhen?;
|
|
782
|
+
private graphs;
|
|
783
|
+
private graphMap;
|
|
784
|
+
constructor(config: ProjectConfig);
|
|
785
|
+
/**
|
|
786
|
+
* Set or update the configuration (tenantId and apiUrl)
|
|
787
|
+
* This is used by the CLI to inject configuration from inkeep.config.ts
|
|
788
|
+
*/
|
|
789
|
+
setConfig(tenantId: string, apiUrl: string): void;
|
|
790
|
+
/**
|
|
791
|
+
* Initialize the project and create/update it in the backend using full project approach
|
|
792
|
+
*/
|
|
793
|
+
init(): Promise<void>;
|
|
794
|
+
/**
|
|
795
|
+
* Get the project ID
|
|
796
|
+
*/
|
|
797
|
+
getId(): string;
|
|
798
|
+
/**
|
|
799
|
+
* Get the project name
|
|
800
|
+
*/
|
|
801
|
+
getName(): string;
|
|
802
|
+
/**
|
|
803
|
+
* Get the project description
|
|
804
|
+
*/
|
|
805
|
+
getDescription(): string | undefined;
|
|
806
|
+
/**
|
|
807
|
+
* Get the tenant ID
|
|
808
|
+
*/
|
|
809
|
+
getTenantId(): string;
|
|
810
|
+
/**
|
|
811
|
+
* Get the project's model configuration
|
|
812
|
+
*/
|
|
813
|
+
getModels(): ProjectConfig['models'];
|
|
814
|
+
/**
|
|
815
|
+
* Set the project's model configuration
|
|
816
|
+
*/
|
|
817
|
+
setModels(models: ProjectConfig['models']): void;
|
|
818
|
+
/**
|
|
819
|
+
* Get the project's stopWhen configuration
|
|
820
|
+
*/
|
|
821
|
+
getStopWhen(): ProjectConfig['stopWhen'];
|
|
822
|
+
/**
|
|
823
|
+
* Set the project's stopWhen configuration
|
|
824
|
+
*/
|
|
825
|
+
setStopWhen(stopWhen: ProjectConfig['stopWhen']): void;
|
|
826
|
+
/**
|
|
827
|
+
* Get all graphs in the project
|
|
828
|
+
*/
|
|
829
|
+
getGraphs(): AgentGraph[];
|
|
830
|
+
/**
|
|
831
|
+
* Get a graph by ID
|
|
832
|
+
*/
|
|
833
|
+
getGraph(id: string): AgentGraph | undefined;
|
|
834
|
+
/**
|
|
835
|
+
* Add a graph to the project
|
|
836
|
+
*/
|
|
837
|
+
addGraph(graph: AgentGraph): void;
|
|
838
|
+
/**
|
|
839
|
+
* Remove a graph from the project
|
|
840
|
+
*/
|
|
841
|
+
removeGraph(id: string): boolean;
|
|
842
|
+
/**
|
|
843
|
+
* Get project statistics
|
|
844
|
+
*/
|
|
845
|
+
getStats(): {
|
|
846
|
+
projectId: string;
|
|
847
|
+
tenantId: string;
|
|
848
|
+
graphCount: number;
|
|
849
|
+
initialized: boolean;
|
|
850
|
+
};
|
|
851
|
+
/**
|
|
852
|
+
* Validate the project configuration
|
|
853
|
+
*/
|
|
854
|
+
validate(): {
|
|
855
|
+
valid: boolean;
|
|
856
|
+
errors: string[];
|
|
857
|
+
};
|
|
858
|
+
/**
|
|
859
|
+
* Convert the Project to FullProjectDefinition format
|
|
860
|
+
*/
|
|
861
|
+
private toFullProjectDefinition;
|
|
862
|
+
/**
|
|
863
|
+
* Convert project configuration to API format
|
|
864
|
+
*/
|
|
865
|
+
private toApiFormat;
|
|
866
|
+
}
|
|
867
|
+
|
|
712
868
|
/**
|
|
713
869
|
* Helper function to create graphs - OpenAI style
|
|
714
870
|
*/
|
|
715
871
|
declare function agentGraph(config: GraphConfig): AgentGraph;
|
|
872
|
+
/**
|
|
873
|
+
* Helper function to create projects - OpenAI style
|
|
874
|
+
*
|
|
875
|
+
* Projects are the top-level organizational unit that contains graphs, agents, and shared configurations.
|
|
876
|
+
* They provide model inheritance and execution limits that cascade down to graphs and agents.
|
|
877
|
+
*
|
|
878
|
+
* @param config - Project configuration
|
|
879
|
+
* @returns A new Project instance
|
|
880
|
+
*
|
|
881
|
+
* @example
|
|
882
|
+
* ```typescript
|
|
883
|
+
* const customerSupport = project({
|
|
884
|
+
* id: 'customer-support-project',
|
|
885
|
+
* name: 'Customer Support System',
|
|
886
|
+
* description: 'Multi-agent customer support system',
|
|
887
|
+
* models: {
|
|
888
|
+
* base: { model: 'gpt-4o-mini' },
|
|
889
|
+
* structuredOutput: { model: 'gpt-4o' }
|
|
890
|
+
* },
|
|
891
|
+
* stopWhen: {
|
|
892
|
+
* transferCountIs: 10,
|
|
893
|
+
* stepCountIs: 50
|
|
894
|
+
* },
|
|
895
|
+
* graphs: () => [
|
|
896
|
+
* agentGraph({
|
|
897
|
+
* id: 'support-graph',
|
|
898
|
+
* name: 'Support Graph',
|
|
899
|
+
* // ... graph config
|
|
900
|
+
* })
|
|
901
|
+
* ]
|
|
902
|
+
* });
|
|
903
|
+
* ```
|
|
904
|
+
*/
|
|
905
|
+
declare function project(config: ProjectConfig): Project;
|
|
716
906
|
/**
|
|
717
907
|
* Creates a new agent with stable ID enforcement.
|
|
718
908
|
*
|
|
@@ -879,6 +1069,28 @@ declare function createEnvironmentSettings<T extends Record<string, EnvironmentS
|
|
|
879
1069
|
*/
|
|
880
1070
|
declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig>(config: T): T;
|
|
881
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* Client-side functions for interacting with the Full Project API
|
|
1074
|
+
* These functions make HTTP requests to the server instead of direct database calls
|
|
1075
|
+
*/
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Create a full project via HTTP API
|
|
1079
|
+
*/
|
|
1080
|
+
declare function createFullProjectViaAPI(tenantId: string, apiUrl: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Update a full project via HTTP API (upsert behavior)
|
|
1083
|
+
*/
|
|
1084
|
+
declare function updateFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Get a full project via HTTP API
|
|
1087
|
+
*/
|
|
1088
|
+
declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<FullProjectDefinition | null>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Delete a full project via HTTP API
|
|
1091
|
+
*/
|
|
1092
|
+
declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<void>;
|
|
1093
|
+
|
|
882
1094
|
declare class Runner {
|
|
883
1095
|
/**
|
|
884
1096
|
* Run a graph until completion, handling transfers and tool calls
|
|
@@ -916,4 +1128,4 @@ declare const run: typeof Runner.run;
|
|
|
916
1128
|
declare const stream: typeof Runner.stream;
|
|
917
1129
|
declare const raceGraphs: typeof Runner.raceGraphs;
|
|
918
1130
|
|
|
919
|
-
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AllAgentInterface, ArtifactComponent, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, DataComponent, ExternalAgent, type ExternalAgentInterface, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, type ModelSettings, ModelSettingsSchema, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StatusComponent, type StatusUpdateSettings, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, transfer };
|
|
1131
|
+
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AllAgentInterface, ArtifactComponent, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, DataComponent, ExternalAgent, type ExternalAgentInterface, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, type ModelSettings, ModelSettingsSchema, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StatusComponent, type StatusUpdateSettings, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, getFullProjectViaAPI, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|