@inkeep/agents-sdk 0.0.0-dev-20250910233151 → 0.0.0-dev-20250910233441

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1089,75 +1089,27 @@ function dataComponent(config) {
1089
1089
  }
1090
1090
 
1091
1091
  // src/environment-settings.ts
1092
- var globalSettingKeys = /* @__PURE__ */ new Set();
1093
- function registerSettingKeys(settingIds) {
1094
- settingIds.forEach((id) => globalSettingKeys.add(id));
1095
- }
1096
- function getAllEnvironmentSettingKeys() {
1097
- return Array.from(globalSettingKeys);
1098
- }
1099
1092
  function createEnvironmentSettings(environments) {
1100
- const environmentMap = environments;
1101
- const environmentNames = Object.keys(environments);
1102
- const allEnvironments = Object.values(environments);
1103
1093
  return {
1104
1094
  getEnvironmentSetting: async (key) => {
1105
- if (environmentNames.length === 0) {
1106
- throw new Error(
1107
- `No environments provided to createEnvironmentSettings().
1108
-
1109
- You must pass environments as an object: createEnvironmentSettings({ development, production })`
1110
- );
1111
- }
1112
- const currentEnv = process.env.NODE_ENV || "development";
1113
- const matchingEnv = environmentMap[currentEnv];
1114
- if (!matchingEnv) {
1095
+ const currentEnv = process.env.INKEEP_ENV || "development";
1096
+ const env = environments[currentEnv];
1097
+ if (!env) {
1115
1098
  throw new Error(
1116
- `Environment '${currentEnv}' not found.
1117
-
1118
- Available environments: ${environmentNames.join(", ")}
1119
- Set NODE_ENV to one of the available environments or add a '${currentEnv}' environment.`
1099
+ `Environment '${currentEnv}' not found. Available: ${Object.keys(environments).join(", ")}`
1120
1100
  );
1121
1101
  }
1122
- if (!matchingEnv.credentials?.[key]) {
1102
+ const credential2 = env.credentials?.[key];
1103
+ if (!credential2) {
1123
1104
  throw new Error(
1124
- `Credential environment setting '${key}' not found in environment '${currentEnv}'.
1125
-
1126
- `
1105
+ `Credential '${String(key)}' not found in environment '${currentEnv}'`
1127
1106
  );
1128
1107
  }
1129
- return matchingEnv.credentials[key];
1130
- },
1131
- getEnvironmentSettingKeys: () => {
1132
- if (allEnvironments.length === 0) return [];
1133
- if (allEnvironments.length === 1)
1134
- return Object.keys(allEnvironments[0].credentials || {});
1135
- let commonKeys = new Set(
1136
- Object.keys(allEnvironments[0].credentials || {})
1137
- );
1138
- for (let i = 1; i < allEnvironments.length; i++) {
1139
- const envKeys = new Set(
1140
- Object.keys(allEnvironments[i].credentials || {})
1141
- );
1142
- commonKeys = new Set([...commonKeys].filter((key) => envKeys.has(key)));
1143
- }
1144
- return Array.from(commonKeys);
1145
- },
1146
- hasEnvironmentSetting: (key) => {
1147
- if (allEnvironments.length === 0) return false;
1148
- if (allEnvironments.length === 1)
1149
- return !!(allEnvironments[0].credentials && key in allEnvironments[0].credentials);
1150
- return allEnvironments.every(
1151
- (env) => env.credentials && key in env.credentials
1152
- );
1108
+ return credential2;
1153
1109
  }
1154
1110
  };
1155
1111
  }
1156
1112
  function registerEnvironmentSettings(config) {
1157
- if (config.credentials) {
1158
- const settingIds = Object.keys(config.credentials);
1159
- registerSettingKeys(settingIds);
1160
- }
1161
1113
  return config;
1162
1114
  }
1163
1115
  var logger5 = agentsCore.getLogger("external-agent-builder");
@@ -2937,7 +2889,6 @@ exports.dataComponent = dataComponent;
2937
2889
  exports.externalAgent = externalAgent;
2938
2890
  exports.externalAgents = externalAgents;
2939
2891
  exports.generateGraph = generateGraph;
2940
- exports.getAllEnvironmentSettingKeys = getAllEnvironmentSettingKeys;
2941
2892
  exports.mcpServer = mcpServer;
2942
2893
  exports.mcpTool = mcpTool;
2943
2894
  exports.raceGraphs = raceGraphs;
package/dist/index.d.cts CHANGED
@@ -605,21 +605,14 @@ interface EnvironmentSettingsConfig {
605
605
  [settingId: string]: CredentialReferenceApiInsert;
606
606
  };
607
607
  }
608
- /**
609
- * Get all registered setting keys across all environments
610
- */
611
- declare function getAllEnvironmentSettingKeys(): string[];
612
608
  /**
613
609
  * Create a setting helper with TypeScript autocomplete
614
- * Automatically infers environment names from object keys
615
610
  */
616
611
  declare function createEnvironmentSettings<T extends Record<string, EnvironmentSettingsConfig>>(environments: T): {
617
- getEnvironmentSetting: <K extends string>(key: K) => Promise<CredentialReferenceApiInsert>;
618
- getEnvironmentSettingKeys: () => string[];
619
- hasEnvironmentSetting: (key: string) => key is string;
612
+ getEnvironmentSetting: (key: keyof NonNullable<T[keyof T]["credentials"]>) => Promise<CredentialReferenceApiInsert>;
620
613
  };
621
614
  /**
622
- * Create type-safe environment configurations with setting registration
615
+ * Create type-safe environment configurations
623
616
  */
624
617
  declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig>(config: T): T;
625
618
 
@@ -859,4 +852,4 @@ declare const run: typeof Runner.run;
859
852
  declare const stream: typeof Runner.stream;
860
853
  declare const raceGraphs: typeof Runner.raceGraphs;
861
854
 
862
- export { Agent, type AgentConfig, AgentError, AgentGraph, 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, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, generateGraph, getAllEnvironmentSettingKeys, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, tool, transfer };
855
+ export { Agent, type AgentConfig, AgentError, AgentGraph, 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, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, generateGraph, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, tool, transfer };
package/dist/index.d.ts CHANGED
@@ -605,21 +605,14 @@ interface EnvironmentSettingsConfig {
605
605
  [settingId: string]: CredentialReferenceApiInsert;
606
606
  };
607
607
  }
608
- /**
609
- * Get all registered setting keys across all environments
610
- */
611
- declare function getAllEnvironmentSettingKeys(): string[];
612
608
  /**
613
609
  * Create a setting helper with TypeScript autocomplete
614
- * Automatically infers environment names from object keys
615
610
  */
616
611
  declare function createEnvironmentSettings<T extends Record<string, EnvironmentSettingsConfig>>(environments: T): {
617
- getEnvironmentSetting: <K extends string>(key: K) => Promise<CredentialReferenceApiInsert>;
618
- getEnvironmentSettingKeys: () => string[];
619
- hasEnvironmentSetting: (key: string) => key is string;
612
+ getEnvironmentSetting: (key: keyof NonNullable<T[keyof T]["credentials"]>) => Promise<CredentialReferenceApiInsert>;
620
613
  };
621
614
  /**
622
- * Create type-safe environment configurations with setting registration
615
+ * Create type-safe environment configurations
623
616
  */
624
617
  declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig>(config: T): T;
625
618
 
@@ -859,4 +852,4 @@ declare const run: typeof Runner.run;
859
852
  declare const stream: typeof Runner.stream;
860
853
  declare const raceGraphs: typeof Runner.raceGraphs;
861
854
 
862
- export { Agent, type AgentConfig, AgentError, AgentGraph, 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, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, generateGraph, getAllEnvironmentSettingKeys, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, tool, transfer };
855
+ export { Agent, type AgentConfig, AgentError, AgentGraph, 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, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, generateGraph, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, tool, transfer };
package/dist/index.js CHANGED
@@ -927,75 +927,27 @@ function dataComponent(config) {
927
927
  }
928
928
 
929
929
  // src/environment-settings.ts
930
- var globalSettingKeys = /* @__PURE__ */ new Set();
931
- function registerSettingKeys(settingIds) {
932
- settingIds.forEach((id) => globalSettingKeys.add(id));
933
- }
934
- function getAllEnvironmentSettingKeys() {
935
- return Array.from(globalSettingKeys);
936
- }
937
930
  function createEnvironmentSettings(environments) {
938
- const environmentMap = environments;
939
- const environmentNames = Object.keys(environments);
940
- const allEnvironments = Object.values(environments);
941
931
  return {
942
932
  getEnvironmentSetting: async (key) => {
943
- if (environmentNames.length === 0) {
944
- throw new Error(
945
- `No environments provided to createEnvironmentSettings().
946
-
947
- You must pass environments as an object: createEnvironmentSettings({ development, production })`
948
- );
949
- }
950
- const currentEnv = process.env.NODE_ENV || "development";
951
- const matchingEnv = environmentMap[currentEnv];
952
- if (!matchingEnv) {
933
+ const currentEnv = process.env.INKEEP_ENV || "development";
934
+ const env = environments[currentEnv];
935
+ if (!env) {
953
936
  throw new Error(
954
- `Environment '${currentEnv}' not found.
955
-
956
- Available environments: ${environmentNames.join(", ")}
957
- Set NODE_ENV to one of the available environments or add a '${currentEnv}' environment.`
937
+ `Environment '${currentEnv}' not found. Available: ${Object.keys(environments).join(", ")}`
958
938
  );
959
939
  }
960
- if (!matchingEnv.credentials?.[key]) {
940
+ const credential2 = env.credentials?.[key];
941
+ if (!credential2) {
961
942
  throw new Error(
962
- `Credential environment setting '${key}' not found in environment '${currentEnv}'.
963
-
964
- `
943
+ `Credential '${String(key)}' not found in environment '${currentEnv}'`
965
944
  );
966
945
  }
967
- return matchingEnv.credentials[key];
968
- },
969
- getEnvironmentSettingKeys: () => {
970
- if (allEnvironments.length === 0) return [];
971
- if (allEnvironments.length === 1)
972
- return Object.keys(allEnvironments[0].credentials || {});
973
- let commonKeys = new Set(
974
- Object.keys(allEnvironments[0].credentials || {})
975
- );
976
- for (let i = 1; i < allEnvironments.length; i++) {
977
- const envKeys = new Set(
978
- Object.keys(allEnvironments[i].credentials || {})
979
- );
980
- commonKeys = new Set([...commonKeys].filter((key) => envKeys.has(key)));
981
- }
982
- return Array.from(commonKeys);
983
- },
984
- hasEnvironmentSetting: (key) => {
985
- if (allEnvironments.length === 0) return false;
986
- if (allEnvironments.length === 1)
987
- return !!(allEnvironments[0].credentials && key in allEnvironments[0].credentials);
988
- return allEnvironments.every(
989
- (env) => env.credentials && key in env.credentials
990
- );
946
+ return credential2;
991
947
  }
992
948
  };
993
949
  }
994
950
  function registerEnvironmentSettings(config) {
995
- if (config.credentials) {
996
- const settingIds = Object.keys(config.credentials);
997
- registerSettingKeys(settingIds);
998
- }
999
951
  return config;
1000
952
  }
1001
953
  var logger4 = getLogger("external-agent-builder");
@@ -2757,4 +2709,4 @@ var run = Runner.run.bind(Runner);
2757
2709
  var stream = Runner.stream.bind(Runner);
2758
2710
  var raceGraphs = Runner.raceGraphs.bind(Runner);
2759
2711
 
2760
- export { Agent, AgentGraph, ArtifactComponent, DataComponent, ExternalAgent, Runner, agent, agentGraph, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, generateGraph, getAllEnvironmentSettingKeys, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, tool, transfer };
2712
+ export { Agent, AgentGraph, ArtifactComponent, DataComponent, ExternalAgent, Runner, agent, agentGraph, artifactComponent, createEnvironmentSettings, credential, dataComponent, externalAgent, externalAgents, generateGraph, mcpServer, mcpTool, raceGraphs, registerEnvironmentSettings, run, stream, tool, transfer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.0.0-dev-20250910233151",
3
+ "version": "0.0.0-dev-20250910233441",
4
4
  "description": "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.5",
11
- "@inkeep/agents-core": "^0.0.0-dev-20250910233151"
11
+ "@inkeep/agents-core": "^0.0.0-dev-20250910233441"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@biomejs/biome": "2.1.4",