@inkeep/agents-sdk 0.0.0-dev-20251008194140 → 0.0.0-dev-20251008200151
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 +29 -25
- package/dist/index.d.cts +27 -18
- package/dist/index.d.ts +27 -18
- package/dist/index.js +29 -25
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var agentsCore = require('@inkeep/agents-core');
|
|
4
|
+
var schemaConversion = require('@inkeep/agents-core/utils/schema-conversion');
|
|
4
5
|
var zod = require('zod');
|
|
5
6
|
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
@@ -56,11 +57,8 @@ var ArtifactComponent = class {
|
|
|
56
57
|
getDescription() {
|
|
57
58
|
return this.config.description;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
return this.config.
|
|
61
|
-
}
|
|
62
|
-
getFullProps() {
|
|
63
|
-
return this.config.fullProps;
|
|
60
|
+
getProps() {
|
|
61
|
+
return this.config.props;
|
|
64
62
|
}
|
|
65
63
|
// Public method to ensure artifact component exists in backend (with upsert behavior)
|
|
66
64
|
async init() {
|
|
@@ -91,8 +89,7 @@ var ArtifactComponent = class {
|
|
|
91
89
|
id: this.getId(),
|
|
92
90
|
name: this.config.name,
|
|
93
91
|
description: this.config.description,
|
|
94
|
-
|
|
95
|
-
fullProps: this.config.fullProps
|
|
92
|
+
props: this.config.props
|
|
96
93
|
};
|
|
97
94
|
logger.info({ artifactComponentData }, "artifactComponentData for create/update");
|
|
98
95
|
const updateResponse = await fetch(
|
|
@@ -580,6 +577,14 @@ var Agent = class {
|
|
|
580
577
|
props: comp.getProps()
|
|
581
578
|
};
|
|
582
579
|
}
|
|
580
|
+
if (comp && typeof comp === "object" && comp.props && schemaConversion.isZodSchema(comp.props)) {
|
|
581
|
+
return {
|
|
582
|
+
id: comp.id,
|
|
583
|
+
name: comp.name,
|
|
584
|
+
description: comp.description,
|
|
585
|
+
props: schemaConversion.convertZodToJsonSchemaWithPreview(comp.props)
|
|
586
|
+
};
|
|
587
|
+
}
|
|
583
588
|
return comp;
|
|
584
589
|
});
|
|
585
590
|
}
|
|
@@ -591,8 +596,15 @@ var Agent = class {
|
|
|
591
596
|
id: comp.getId(),
|
|
592
597
|
name: comp.getName(),
|
|
593
598
|
description: comp.getDescription(),
|
|
594
|
-
|
|
595
|
-
|
|
599
|
+
props: comp.getProps?.() || comp.props
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
if (comp && typeof comp === "object" && comp.props && schemaConversion.isZodSchema(comp.props)) {
|
|
603
|
+
return {
|
|
604
|
+
id: comp.id,
|
|
605
|
+
name: comp.name,
|
|
606
|
+
description: comp.description,
|
|
607
|
+
props: schemaConversion.convertZodToJsonSchemaWithPreview(comp.props)
|
|
596
608
|
};
|
|
597
609
|
}
|
|
598
610
|
return comp;
|
|
@@ -760,8 +772,7 @@ var Agent = class {
|
|
|
760
772
|
id: artifactComponent2.getId(),
|
|
761
773
|
name: artifactComponent2.getName(),
|
|
762
774
|
description: artifactComponent2.getDescription(),
|
|
763
|
-
|
|
764
|
-
fullProps: artifactComponent2.getFullProps?.() || artifactComponent2.fullProps
|
|
775
|
+
props: artifactComponent2.getProps?.() || artifactComponent2.props
|
|
765
776
|
} : artifactComponent2;
|
|
766
777
|
await this.createArtifactComponent(plainComponent);
|
|
767
778
|
}
|
|
@@ -831,8 +842,7 @@ var Agent = class {
|
|
|
831
842
|
id: component.id,
|
|
832
843
|
name: component.name,
|
|
833
844
|
description: component.description,
|
|
834
|
-
|
|
835
|
-
fullProps: component.fullProps,
|
|
845
|
+
props: component.props,
|
|
836
846
|
createdAt: component.createdAt,
|
|
837
847
|
updatedAt: component.updatedAt
|
|
838
848
|
}));
|
|
@@ -843,8 +853,7 @@ var Agent = class {
|
|
|
843
853
|
id: comp.getId(),
|
|
844
854
|
name: comp.getName(),
|
|
845
855
|
description: comp.getDescription(),
|
|
846
|
-
|
|
847
|
-
fullProps: comp.getFullProps?.() || comp.fullProps
|
|
856
|
+
props: comp.getProps?.() || comp.props
|
|
848
857
|
};
|
|
849
858
|
}
|
|
850
859
|
return comp;
|
|
@@ -973,8 +982,7 @@ var Agent = class {
|
|
|
973
982
|
id: artifactComponent2.id,
|
|
974
983
|
name: artifactComponent2.name,
|
|
975
984
|
description: artifactComponent2.description,
|
|
976
|
-
|
|
977
|
-
fullProps: artifactComponent2.fullProps
|
|
985
|
+
props: artifactComponent2.props
|
|
978
986
|
});
|
|
979
987
|
ac.setContext(this.tenantId, this.projectId);
|
|
980
988
|
await ac.init();
|
|
@@ -2995,28 +3003,24 @@ var Project = class {
|
|
|
2995
3003
|
let artifactComponentId;
|
|
2996
3004
|
let artifactComponentName;
|
|
2997
3005
|
let artifactComponentDescription;
|
|
2998
|
-
let
|
|
2999
|
-
let artifactComponentFullProps;
|
|
3006
|
+
let artifactComponentProps;
|
|
3000
3007
|
if (artifactComponent2.getId) {
|
|
3001
3008
|
artifactComponentId = artifactComponent2.getId();
|
|
3002
3009
|
artifactComponentName = artifactComponent2.getName();
|
|
3003
3010
|
artifactComponentDescription = artifactComponent2.getDescription() || "";
|
|
3004
|
-
|
|
3005
|
-
artifactComponentFullProps = artifactComponent2.getFullProps() || {};
|
|
3011
|
+
artifactComponentProps = artifactComponent2.getProps() || {};
|
|
3006
3012
|
} else {
|
|
3007
3013
|
artifactComponentId = artifactComponent2.id || (artifactComponent2.name ? artifactComponent2.name.toLowerCase().replace(/\s+/g, "-") : "");
|
|
3008
3014
|
artifactComponentName = artifactComponent2.name || "";
|
|
3009
3015
|
artifactComponentDescription = artifactComponent2.description || "";
|
|
3010
|
-
|
|
3011
|
-
artifactComponentFullProps = artifactComponent2.fullProps || {};
|
|
3016
|
+
artifactComponentProps = artifactComponent2.props || {};
|
|
3012
3017
|
}
|
|
3013
3018
|
if (!artifactComponentsObject[artifactComponentId] && artifactComponentName) {
|
|
3014
3019
|
artifactComponentsObject[artifactComponentId] = {
|
|
3015
3020
|
id: artifactComponentId,
|
|
3016
3021
|
name: artifactComponentName,
|
|
3017
3022
|
description: artifactComponentDescription,
|
|
3018
|
-
|
|
3019
|
-
fullProps: artifactComponentFullProps
|
|
3023
|
+
props: artifactComponentProps
|
|
3020
3024
|
};
|
|
3021
3025
|
}
|
|
3022
3026
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -38,8 +38,7 @@ interface ArtifactComponentInterface {
|
|
|
38
38
|
getId(): ArtifactComponentInsert['id'];
|
|
39
39
|
getName(): ArtifactComponentInsert['name'];
|
|
40
40
|
getDescription(): ArtifactComponentInsert['description'];
|
|
41
|
-
|
|
42
|
-
getFullProps(): ArtifactComponentInsert['fullProps'];
|
|
41
|
+
getProps(): ArtifactComponentInsert['props'];
|
|
43
42
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
44
43
|
}
|
|
45
44
|
declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
@@ -54,8 +53,7 @@ declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
|
54
53
|
getId(): string;
|
|
55
54
|
getName(): string;
|
|
56
55
|
getDescription(): string;
|
|
57
|
-
|
|
58
|
-
getFullProps(): ArtifactComponentInsert['fullProps'];
|
|
56
|
+
getProps(): ArtifactComponentInsert['props'];
|
|
59
57
|
init(): Promise<void>;
|
|
60
58
|
private upsertArtifactComponent;
|
|
61
59
|
}
|
|
@@ -88,8 +86,7 @@ interface ComponentConfig {
|
|
|
88
86
|
description: string;
|
|
89
87
|
}
|
|
90
88
|
interface ArtifactComponentConfig extends ComponentConfig {
|
|
91
|
-
|
|
92
|
-
fullProps: Record<string, unknown>;
|
|
89
|
+
props: Record<string, unknown>;
|
|
93
90
|
}
|
|
94
91
|
interface DataComponentConfig extends ComponentConfig {
|
|
95
92
|
props: Record<string, unknown>;
|
|
@@ -203,6 +200,19 @@ declare function externalAgent(config: ExternalAgentConfig): ExternalAgent;
|
|
|
203
200
|
*/
|
|
204
201
|
declare function externalAgents(configs: Record<string, ExternalAgentConfig>): Record<string, ExternalAgent>;
|
|
205
202
|
|
|
203
|
+
interface ArtifactComponentWithZodProps {
|
|
204
|
+
id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
description: string;
|
|
207
|
+
props?: z.ZodObject<any>;
|
|
208
|
+
}
|
|
209
|
+
interface DataComponentWithZodProps {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
description: string;
|
|
213
|
+
props?: z.ZodObject<any>;
|
|
214
|
+
}
|
|
215
|
+
|
|
206
216
|
/**
|
|
207
217
|
* Tool instance that may have additional metadata attached during agent processing
|
|
208
218
|
*/
|
|
@@ -260,8 +270,8 @@ interface AgentConfig extends Omit<AgentApiInsert, 'projectId'> {
|
|
|
260
270
|
type: 'conversation' | 'episodic' | 'short_term';
|
|
261
271
|
capacity?: number;
|
|
262
272
|
};
|
|
263
|
-
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface)[];
|
|
264
|
-
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface)[];
|
|
273
|
+
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
274
|
+
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
265
275
|
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
266
276
|
}
|
|
267
277
|
interface ToolConfig extends ToolInsert {
|
|
@@ -1024,15 +1034,14 @@ declare function mcpTool(config: MCPToolConfig$1): Tool;
|
|
|
1024
1034
|
* const productCard = artifactComponent({
|
|
1025
1035
|
* name: 'Product Card',
|
|
1026
1036
|
* description: 'Display product information',
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
* image: 'product.jpg'
|
|
1037
|
+
* props: {
|
|
1038
|
+
* type: 'object',
|
|
1039
|
+
* properties: {
|
|
1040
|
+
* title: { type: 'string', inPreview: true },
|
|
1041
|
+
* price: { type: 'string', inPreview: true },
|
|
1042
|
+
* description: { type: 'string' },
|
|
1043
|
+
* image: { type: 'string' }
|
|
1044
|
+
* }
|
|
1036
1045
|
* }
|
|
1037
1046
|
* });
|
|
1038
1047
|
* ```
|
|
@@ -1188,4 +1197,4 @@ declare const run: typeof Runner.run;
|
|
|
1188
1197
|
declare const stream: typeof Runner.stream;
|
|
1189
1198
|
declare const raceGraphs: typeof Runner.raceGraphs;
|
|
1190
1199
|
|
|
1191
|
-
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllAgentInterface, ArtifactComponent, type ArtifactComponentInterface, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, type CredentialReference, DataComponent, type DataComponentInterface, ExternalAgent, type ExternalAgentInterface, type ExtractCredentialIds, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UnionCredentialIds, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|
|
1200
|
+
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllAgentInterface, ArtifactComponent, type ArtifactComponentInterface, type ArtifactComponentWithZodProps, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, type CredentialReference, DataComponent, type DataComponentInterface, type DataComponentWithZodProps, ExternalAgent, type ExternalAgentInterface, type ExtractCredentialIds, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UnionCredentialIds, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,8 +38,7 @@ interface ArtifactComponentInterface {
|
|
|
38
38
|
getId(): ArtifactComponentInsert['id'];
|
|
39
39
|
getName(): ArtifactComponentInsert['name'];
|
|
40
40
|
getDescription(): ArtifactComponentInsert['description'];
|
|
41
|
-
|
|
42
|
-
getFullProps(): ArtifactComponentInsert['fullProps'];
|
|
41
|
+
getProps(): ArtifactComponentInsert['props'];
|
|
43
42
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
44
43
|
}
|
|
45
44
|
declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
@@ -54,8 +53,7 @@ declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
|
54
53
|
getId(): string;
|
|
55
54
|
getName(): string;
|
|
56
55
|
getDescription(): string;
|
|
57
|
-
|
|
58
|
-
getFullProps(): ArtifactComponentInsert['fullProps'];
|
|
56
|
+
getProps(): ArtifactComponentInsert['props'];
|
|
59
57
|
init(): Promise<void>;
|
|
60
58
|
private upsertArtifactComponent;
|
|
61
59
|
}
|
|
@@ -88,8 +86,7 @@ interface ComponentConfig {
|
|
|
88
86
|
description: string;
|
|
89
87
|
}
|
|
90
88
|
interface ArtifactComponentConfig extends ComponentConfig {
|
|
91
|
-
|
|
92
|
-
fullProps: Record<string, unknown>;
|
|
89
|
+
props: Record<string, unknown>;
|
|
93
90
|
}
|
|
94
91
|
interface DataComponentConfig extends ComponentConfig {
|
|
95
92
|
props: Record<string, unknown>;
|
|
@@ -203,6 +200,19 @@ declare function externalAgent(config: ExternalAgentConfig): ExternalAgent;
|
|
|
203
200
|
*/
|
|
204
201
|
declare function externalAgents(configs: Record<string, ExternalAgentConfig>): Record<string, ExternalAgent>;
|
|
205
202
|
|
|
203
|
+
interface ArtifactComponentWithZodProps {
|
|
204
|
+
id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
description: string;
|
|
207
|
+
props?: z.ZodObject<any>;
|
|
208
|
+
}
|
|
209
|
+
interface DataComponentWithZodProps {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
description: string;
|
|
213
|
+
props?: z.ZodObject<any>;
|
|
214
|
+
}
|
|
215
|
+
|
|
206
216
|
/**
|
|
207
217
|
* Tool instance that may have additional metadata attached during agent processing
|
|
208
218
|
*/
|
|
@@ -260,8 +270,8 @@ interface AgentConfig extends Omit<AgentApiInsert, 'projectId'> {
|
|
|
260
270
|
type: 'conversation' | 'episodic' | 'short_term';
|
|
261
271
|
capacity?: number;
|
|
262
272
|
};
|
|
263
|
-
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface)[];
|
|
264
|
-
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface)[];
|
|
273
|
+
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
274
|
+
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
265
275
|
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
266
276
|
}
|
|
267
277
|
interface ToolConfig extends ToolInsert {
|
|
@@ -1024,15 +1034,14 @@ declare function mcpTool(config: MCPToolConfig$1): Tool;
|
|
|
1024
1034
|
* const productCard = artifactComponent({
|
|
1025
1035
|
* name: 'Product Card',
|
|
1026
1036
|
* description: 'Display product information',
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
* image: 'product.jpg'
|
|
1037
|
+
* props: {
|
|
1038
|
+
* type: 'object',
|
|
1039
|
+
* properties: {
|
|
1040
|
+
* title: { type: 'string', inPreview: true },
|
|
1041
|
+
* price: { type: 'string', inPreview: true },
|
|
1042
|
+
* description: { type: 'string' },
|
|
1043
|
+
* image: { type: 'string' }
|
|
1044
|
+
* }
|
|
1036
1045
|
* }
|
|
1037
1046
|
* });
|
|
1038
1047
|
* ```
|
|
@@ -1188,4 +1197,4 @@ declare const run: typeof Runner.run;
|
|
|
1188
1197
|
declare const stream: typeof Runner.stream;
|
|
1189
1198
|
declare const raceGraphs: typeof Runner.raceGraphs;
|
|
1190
1199
|
|
|
1191
|
-
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllAgentInterface, ArtifactComponent, type ArtifactComponentInterface, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, type CredentialReference, DataComponent, type DataComponentInterface, ExternalAgent, type ExternalAgentInterface, type ExtractCredentialIds, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UnionCredentialIds, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|
|
1200
|
+
export { Agent, type AgentCanUseType, type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllAgentInterface, ArtifactComponent, type ArtifactComponentInterface, type ArtifactComponentWithZodProps, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, type CredentialReference, DataComponent, type DataComponentInterface, type DataComponentWithZodProps, ExternalAgent, type ExternalAgentInterface, type ExtractCredentialIds, type FetchDefinitionConfig, type GenerateOptions, type GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UnionCredentialIds, type UserMessage, agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getLogger, apiFetch, CredentialReferenceApiInsertSchema, MCPToolConfigSchema, createDatabaseClient, getProject } from '@inkeep/agents-core';
|
|
2
|
+
import { isZodSchema, convertZodToJsonSchemaWithPreview } from '@inkeep/agents-core/utils/schema-conversion';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
@@ -54,11 +55,8 @@ var ArtifactComponent = class {
|
|
|
54
55
|
getDescription() {
|
|
55
56
|
return this.config.description;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
return this.config.
|
|
59
|
-
}
|
|
60
|
-
getFullProps() {
|
|
61
|
-
return this.config.fullProps;
|
|
58
|
+
getProps() {
|
|
59
|
+
return this.config.props;
|
|
62
60
|
}
|
|
63
61
|
// Public method to ensure artifact component exists in backend (with upsert behavior)
|
|
64
62
|
async init() {
|
|
@@ -89,8 +87,7 @@ var ArtifactComponent = class {
|
|
|
89
87
|
id: this.getId(),
|
|
90
88
|
name: this.config.name,
|
|
91
89
|
description: this.config.description,
|
|
92
|
-
|
|
93
|
-
fullProps: this.config.fullProps
|
|
90
|
+
props: this.config.props
|
|
94
91
|
};
|
|
95
92
|
logger.info({ artifactComponentData }, "artifactComponentData for create/update");
|
|
96
93
|
const updateResponse = await fetch(
|
|
@@ -578,6 +575,14 @@ var Agent = class {
|
|
|
578
575
|
props: comp.getProps()
|
|
579
576
|
};
|
|
580
577
|
}
|
|
578
|
+
if (comp && typeof comp === "object" && comp.props && isZodSchema(comp.props)) {
|
|
579
|
+
return {
|
|
580
|
+
id: comp.id,
|
|
581
|
+
name: comp.name,
|
|
582
|
+
description: comp.description,
|
|
583
|
+
props: convertZodToJsonSchemaWithPreview(comp.props)
|
|
584
|
+
};
|
|
585
|
+
}
|
|
581
586
|
return comp;
|
|
582
587
|
});
|
|
583
588
|
}
|
|
@@ -589,8 +594,15 @@ var Agent = class {
|
|
|
589
594
|
id: comp.getId(),
|
|
590
595
|
name: comp.getName(),
|
|
591
596
|
description: comp.getDescription(),
|
|
592
|
-
|
|
593
|
-
|
|
597
|
+
props: comp.getProps?.() || comp.props
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
if (comp && typeof comp === "object" && comp.props && isZodSchema(comp.props)) {
|
|
601
|
+
return {
|
|
602
|
+
id: comp.id,
|
|
603
|
+
name: comp.name,
|
|
604
|
+
description: comp.description,
|
|
605
|
+
props: convertZodToJsonSchemaWithPreview(comp.props)
|
|
594
606
|
};
|
|
595
607
|
}
|
|
596
608
|
return comp;
|
|
@@ -758,8 +770,7 @@ var Agent = class {
|
|
|
758
770
|
id: artifactComponent2.getId(),
|
|
759
771
|
name: artifactComponent2.getName(),
|
|
760
772
|
description: artifactComponent2.getDescription(),
|
|
761
|
-
|
|
762
|
-
fullProps: artifactComponent2.getFullProps?.() || artifactComponent2.fullProps
|
|
773
|
+
props: artifactComponent2.getProps?.() || artifactComponent2.props
|
|
763
774
|
} : artifactComponent2;
|
|
764
775
|
await this.createArtifactComponent(plainComponent);
|
|
765
776
|
}
|
|
@@ -829,8 +840,7 @@ var Agent = class {
|
|
|
829
840
|
id: component.id,
|
|
830
841
|
name: component.name,
|
|
831
842
|
description: component.description,
|
|
832
|
-
|
|
833
|
-
fullProps: component.fullProps,
|
|
843
|
+
props: component.props,
|
|
834
844
|
createdAt: component.createdAt,
|
|
835
845
|
updatedAt: component.updatedAt
|
|
836
846
|
}));
|
|
@@ -841,8 +851,7 @@ var Agent = class {
|
|
|
841
851
|
id: comp.getId(),
|
|
842
852
|
name: comp.getName(),
|
|
843
853
|
description: comp.getDescription(),
|
|
844
|
-
|
|
845
|
-
fullProps: comp.getFullProps?.() || comp.fullProps
|
|
854
|
+
props: comp.getProps?.() || comp.props
|
|
846
855
|
};
|
|
847
856
|
}
|
|
848
857
|
return comp;
|
|
@@ -971,8 +980,7 @@ var Agent = class {
|
|
|
971
980
|
id: artifactComponent2.id,
|
|
972
981
|
name: artifactComponent2.name,
|
|
973
982
|
description: artifactComponent2.description,
|
|
974
|
-
|
|
975
|
-
fullProps: artifactComponent2.fullProps
|
|
983
|
+
props: artifactComponent2.props
|
|
976
984
|
});
|
|
977
985
|
ac.setContext(this.tenantId, this.projectId);
|
|
978
986
|
await ac.init();
|
|
@@ -2993,28 +3001,24 @@ var Project = class {
|
|
|
2993
3001
|
let artifactComponentId;
|
|
2994
3002
|
let artifactComponentName;
|
|
2995
3003
|
let artifactComponentDescription;
|
|
2996
|
-
let
|
|
2997
|
-
let artifactComponentFullProps;
|
|
3004
|
+
let artifactComponentProps;
|
|
2998
3005
|
if (artifactComponent2.getId) {
|
|
2999
3006
|
artifactComponentId = artifactComponent2.getId();
|
|
3000
3007
|
artifactComponentName = artifactComponent2.getName();
|
|
3001
3008
|
artifactComponentDescription = artifactComponent2.getDescription() || "";
|
|
3002
|
-
|
|
3003
|
-
artifactComponentFullProps = artifactComponent2.getFullProps() || {};
|
|
3009
|
+
artifactComponentProps = artifactComponent2.getProps() || {};
|
|
3004
3010
|
} else {
|
|
3005
3011
|
artifactComponentId = artifactComponent2.id || (artifactComponent2.name ? artifactComponent2.name.toLowerCase().replace(/\s+/g, "-") : "");
|
|
3006
3012
|
artifactComponentName = artifactComponent2.name || "";
|
|
3007
3013
|
artifactComponentDescription = artifactComponent2.description || "";
|
|
3008
|
-
|
|
3009
|
-
artifactComponentFullProps = artifactComponent2.fullProps || {};
|
|
3014
|
+
artifactComponentProps = artifactComponent2.props || {};
|
|
3010
3015
|
}
|
|
3011
3016
|
if (!artifactComponentsObject[artifactComponentId] && artifactComponentName) {
|
|
3012
3017
|
artifactComponentsObject[artifactComponentId] = {
|
|
3013
3018
|
id: artifactComponentId,
|
|
3014
3019
|
name: artifactComponentName,
|
|
3015
3020
|
description: artifactComponentDescription,
|
|
3016
|
-
|
|
3017
|
-
fullProps: artifactComponentFullProps
|
|
3021
|
+
props: artifactComponentProps
|
|
3018
3022
|
};
|
|
3019
3023
|
}
|
|
3020
3024
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-sdk",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20251008200151",
|
|
4
4
|
"description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"nanoid": "^5.1.5",
|
|
10
10
|
"zod": "^4.1.11",
|
|
11
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
11
|
+
"@inkeep/agents-core": "^0.0.0-dev-20251008200151"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/node": "^20.11.24",
|