@inkeep/agents-core 0.32.2 → 0.33.1
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 +52 -39
- package/dist/index.js +52 -39
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -215730,9 +215730,11 @@ var ContextConfigBuilder = class {
|
|
|
215730
215730
|
const credentialReferenceId = credentialReference?.id || rest.credentialReferenceId;
|
|
215731
215731
|
processedContextVariables[key] = {
|
|
215732
215732
|
...rest,
|
|
215733
|
-
responseSchema: convertZodToJsonSchema(definition.responseSchema)
|
|
215734
|
-
credentialReferenceId
|
|
215733
|
+
responseSchema: convertZodToJsonSchema(definition.responseSchema)
|
|
215735
215734
|
};
|
|
215735
|
+
if (credentialReferenceId !== void 0) {
|
|
215736
|
+
processedContextVariables[key].credentialReferenceId = credentialReferenceId;
|
|
215737
|
+
}
|
|
215736
215738
|
logger2.debug(
|
|
215737
215739
|
{
|
|
215738
215740
|
contextVariableKey: key,
|
|
@@ -215958,22 +215960,39 @@ function headers(options) {
|
|
|
215958
215960
|
}
|
|
215959
215961
|
function fetchDefinition(options) {
|
|
215960
215962
|
const fetchConfig = options.fetchConfig;
|
|
215961
|
-
|
|
215963
|
+
const result = {
|
|
215962
215964
|
id: options.id,
|
|
215963
|
-
name: options.name,
|
|
215964
215965
|
trigger: options.trigger,
|
|
215965
215966
|
fetchConfig: {
|
|
215966
|
-
url: fetchConfig.url
|
|
215967
|
-
method: fetchConfig.method,
|
|
215968
|
-
headers: fetchConfig.headers,
|
|
215969
|
-
body: fetchConfig.body,
|
|
215970
|
-
transform: fetchConfig.transform,
|
|
215971
|
-
timeout: fetchConfig.timeout
|
|
215967
|
+
url: fetchConfig.url
|
|
215972
215968
|
},
|
|
215973
|
-
responseSchema: options.responseSchema
|
|
215974
|
-
defaultValue: options.defaultValue,
|
|
215975
|
-
credentialReferenceId: options.credentialReference?.id
|
|
215969
|
+
responseSchema: options.responseSchema
|
|
215976
215970
|
};
|
|
215971
|
+
if (options.name !== void 0) {
|
|
215972
|
+
result.name = options.name;
|
|
215973
|
+
}
|
|
215974
|
+
if (options.defaultValue !== void 0) {
|
|
215975
|
+
result.defaultValue = options.defaultValue;
|
|
215976
|
+
}
|
|
215977
|
+
if (fetchConfig.method !== void 0) {
|
|
215978
|
+
result.fetchConfig.method = fetchConfig.method;
|
|
215979
|
+
}
|
|
215980
|
+
if (fetchConfig.headers !== void 0) {
|
|
215981
|
+
result.fetchConfig.headers = fetchConfig.headers;
|
|
215982
|
+
}
|
|
215983
|
+
if (fetchConfig.transform !== void 0) {
|
|
215984
|
+
result.fetchConfig.transform = fetchConfig.transform;
|
|
215985
|
+
}
|
|
215986
|
+
if (fetchConfig.body !== void 0) {
|
|
215987
|
+
result.fetchConfig.body = fetchConfig.body;
|
|
215988
|
+
}
|
|
215989
|
+
if (fetchConfig.timeout !== void 0) {
|
|
215990
|
+
result.fetchConfig.timeout = fetchConfig.timeout;
|
|
215991
|
+
}
|
|
215992
|
+
if (options.credentialReference?.id !== void 0) {
|
|
215993
|
+
result.credentialReferenceId = options.credentialReference.id;
|
|
215994
|
+
}
|
|
215995
|
+
return result;
|
|
215977
215996
|
}
|
|
215978
215997
|
var logger3 = getLogger("template-engine");
|
|
215979
215998
|
var _TemplateEngine = class _TemplateEngine {
|
|
@@ -216324,7 +216343,7 @@ var CredentialStuffer = class {
|
|
|
216324
216343
|
credentialStoreHeaders = await this.getCredentials(context, storeReference, mcpType);
|
|
216325
216344
|
}
|
|
216326
216345
|
if (!credentialStoreHeaders) {
|
|
216327
|
-
return credentialsFromHeaders ? credentialsFromHeaders.headers : {};
|
|
216346
|
+
return credentialsFromHeaders ? credentialsFromHeaders.headers : { ...headers2 };
|
|
216328
216347
|
}
|
|
216329
216348
|
const combinedHeaders = {
|
|
216330
216349
|
...credentialStoreHeaders.headers,
|
|
@@ -216355,8 +216374,8 @@ var CredentialStuffer = class {
|
|
|
216355
216374
|
};
|
|
216356
216375
|
}
|
|
216357
216376
|
};
|
|
216358
|
-
var
|
|
216359
|
-
path.dirname(
|
|
216377
|
+
var FILENAME = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
216378
|
+
path.dirname(FILENAME);
|
|
216360
216379
|
function createTestDatabaseClientNoMigrations() {
|
|
216361
216380
|
const client = new pglite.PGlite();
|
|
216362
216381
|
const db = pglite$1.drizzle(client, { schema: schema_exports });
|
|
@@ -216817,9 +216836,8 @@ var upsertExternalAgent = (db) => async (params) => {
|
|
|
216817
216836
|
throw new Error("Failed to update external agent - no rows affected");
|
|
216818
216837
|
}
|
|
216819
216838
|
return updated;
|
|
216820
|
-
} else {
|
|
216821
|
-
return await createExternalAgent(db)(params.data);
|
|
216822
216839
|
}
|
|
216840
|
+
return await createExternalAgent(db)(params.data);
|
|
216823
216841
|
};
|
|
216824
216842
|
var deleteExternalAgent = (db) => async (params) => {
|
|
216825
216843
|
try {
|
|
@@ -217080,12 +217098,11 @@ var upsertFunctionTool = (db) => async (params) => {
|
|
|
217080
217098
|
functionId: params.data.functionId
|
|
217081
217099
|
}
|
|
217082
217100
|
});
|
|
217083
|
-
} else {
|
|
217084
|
-
return await createFunctionTool(db)({
|
|
217085
|
-
data: params.data,
|
|
217086
|
-
scopes
|
|
217087
|
-
});
|
|
217088
217101
|
}
|
|
217102
|
+
return await createFunctionTool(db)({
|
|
217103
|
+
data: params.data,
|
|
217104
|
+
scopes
|
|
217105
|
+
});
|
|
217089
217106
|
};
|
|
217090
217107
|
var getFunctionToolsForSubAgent = (db) => {
|
|
217091
217108
|
return async (params) => {
|
|
@@ -218064,9 +218081,8 @@ var upsertSubAgent = (db) => async (params) => {
|
|
|
218064
218081
|
throw new Error("Failed to update agent - no rows affected");
|
|
218065
218082
|
}
|
|
218066
218083
|
return updated;
|
|
218067
|
-
} else {
|
|
218068
|
-
return await createSubAgent(db)(params.data);
|
|
218069
218084
|
}
|
|
218085
|
+
return await createSubAgent(db)(params.data);
|
|
218070
218086
|
};
|
|
218071
218087
|
var deleteSubAgent = (db) => async (params) => {
|
|
218072
218088
|
await db.delete(subAgents).where(
|
|
@@ -218998,13 +219014,13 @@ var McpClient = class {
|
|
|
218998
219014
|
}
|
|
218999
219015
|
if (selectedTools === void 0) {
|
|
219000
219016
|
return availableTools;
|
|
219001
|
-
}
|
|
219017
|
+
}
|
|
219018
|
+
if (selectedTools.length === 0) {
|
|
219002
219019
|
return [];
|
|
219003
|
-
} else {
|
|
219004
|
-
const toolNames = availableTools.map((tool2) => tool2.name);
|
|
219005
|
-
this.validateSelectedTools(toolNames, selectedTools);
|
|
219006
|
-
return availableTools.filter((tool2) => selectedTools.includes(tool2.name));
|
|
219007
219020
|
}
|
|
219021
|
+
const toolNames = availableTools.map((tool2) => tool2.name);
|
|
219022
|
+
this.validateSelectedTools(toolNames, selectedTools);
|
|
219023
|
+
return availableTools.filter((tool2) => selectedTools.includes(tool2.name));
|
|
219008
219024
|
}
|
|
219009
219025
|
async tools() {
|
|
219010
219026
|
const tools2 = await this.selectTools();
|
|
@@ -219419,9 +219435,8 @@ var upsertCredentialReference = (db) => async (params) => {
|
|
|
219419
219435
|
throw new Error("Failed to update credential reference - no rows affected");
|
|
219420
219436
|
}
|
|
219421
219437
|
return updated;
|
|
219422
|
-
} else {
|
|
219423
|
-
return await createCredentialReference(db)(params.data);
|
|
219424
219438
|
}
|
|
219439
|
+
return await createCredentialReference(db)(params.data);
|
|
219425
219440
|
};
|
|
219426
219441
|
|
|
219427
219442
|
// src/data-access/tools.ts
|
|
@@ -219741,9 +219756,8 @@ var upsertTool = (db) => async (params) => {
|
|
|
219741
219756
|
headers: params.data.headers
|
|
219742
219757
|
}
|
|
219743
219758
|
});
|
|
219744
|
-
} else {
|
|
219745
|
-
return await createTool(db)(params.data);
|
|
219746
219759
|
}
|
|
219760
|
+
return await createTool(db)(params.data);
|
|
219747
219761
|
};
|
|
219748
219762
|
|
|
219749
219763
|
// src/data-access/agents.ts
|
|
@@ -220680,9 +220694,8 @@ var upsertArtifactComponent = (db) => async (params) => {
|
|
|
220680
220694
|
props: params.data.props
|
|
220681
220695
|
}
|
|
220682
220696
|
});
|
|
220683
|
-
} else {
|
|
220684
|
-
return await createArtifactComponent(db)(params.data);
|
|
220685
220697
|
}
|
|
220698
|
+
return await createArtifactComponent(db)(params.data);
|
|
220686
220699
|
};
|
|
220687
220700
|
|
|
220688
220701
|
// src/validation/render-validation.ts
|
|
@@ -221012,9 +221025,8 @@ var upsertDataComponent = (db) => async (params) => {
|
|
|
221012
221025
|
props: params.data.props
|
|
221013
221026
|
}
|
|
221014
221027
|
});
|
|
221015
|
-
} else {
|
|
221016
|
-
return await createDataComponent(db)(params.data);
|
|
221017
221028
|
}
|
|
221029
|
+
return await createDataComponent(db)(params.data);
|
|
221018
221030
|
};
|
|
221019
221031
|
|
|
221020
221032
|
// src/data-access/agentFull.ts
|
|
@@ -225289,7 +225301,8 @@ function filterContextToSchemaKeys(validatedContext, headersSchema) {
|
|
|
225289
225301
|
if (filteredHeaders !== null && filteredHeaders !== void 0) {
|
|
225290
225302
|
if (typeof filteredHeaders === "object" && Object.keys(filteredHeaders).length > 0) {
|
|
225291
225303
|
return filteredHeaders;
|
|
225292
|
-
}
|
|
225304
|
+
}
|
|
225305
|
+
if (typeof filteredHeaders !== "object") {
|
|
225293
225306
|
return filteredHeaders;
|
|
225294
225307
|
}
|
|
225295
225308
|
}
|
package/dist/index.js
CHANGED
|
@@ -213063,9 +213063,11 @@ var ContextConfigBuilder = class {
|
|
|
213063
213063
|
const credentialReferenceId = credentialReference?.id || rest.credentialReferenceId;
|
|
213064
213064
|
processedContextVariables[key] = {
|
|
213065
213065
|
...rest,
|
|
213066
|
-
responseSchema: convertZodToJsonSchema(definition.responseSchema)
|
|
213067
|
-
credentialReferenceId
|
|
213066
|
+
responseSchema: convertZodToJsonSchema(definition.responseSchema)
|
|
213068
213067
|
};
|
|
213068
|
+
if (credentialReferenceId !== void 0) {
|
|
213069
|
+
processedContextVariables[key].credentialReferenceId = credentialReferenceId;
|
|
213070
|
+
}
|
|
213069
213071
|
logger.debug(
|
|
213070
213072
|
{
|
|
213071
213073
|
contextVariableKey: key,
|
|
@@ -213291,22 +213293,39 @@ function headers(options) {
|
|
|
213291
213293
|
}
|
|
213292
213294
|
function fetchDefinition(options) {
|
|
213293
213295
|
const fetchConfig = options.fetchConfig;
|
|
213294
|
-
|
|
213296
|
+
const result = {
|
|
213295
213297
|
id: options.id,
|
|
213296
|
-
name: options.name,
|
|
213297
213298
|
trigger: options.trigger,
|
|
213298
213299
|
fetchConfig: {
|
|
213299
|
-
url: fetchConfig.url
|
|
213300
|
-
method: fetchConfig.method,
|
|
213301
|
-
headers: fetchConfig.headers,
|
|
213302
|
-
body: fetchConfig.body,
|
|
213303
|
-
transform: fetchConfig.transform,
|
|
213304
|
-
timeout: fetchConfig.timeout
|
|
213300
|
+
url: fetchConfig.url
|
|
213305
213301
|
},
|
|
213306
|
-
responseSchema: options.responseSchema
|
|
213307
|
-
defaultValue: options.defaultValue,
|
|
213308
|
-
credentialReferenceId: options.credentialReference?.id
|
|
213302
|
+
responseSchema: options.responseSchema
|
|
213309
213303
|
};
|
|
213304
|
+
if (options.name !== void 0) {
|
|
213305
|
+
result.name = options.name;
|
|
213306
|
+
}
|
|
213307
|
+
if (options.defaultValue !== void 0) {
|
|
213308
|
+
result.defaultValue = options.defaultValue;
|
|
213309
|
+
}
|
|
213310
|
+
if (fetchConfig.method !== void 0) {
|
|
213311
|
+
result.fetchConfig.method = fetchConfig.method;
|
|
213312
|
+
}
|
|
213313
|
+
if (fetchConfig.headers !== void 0) {
|
|
213314
|
+
result.fetchConfig.headers = fetchConfig.headers;
|
|
213315
|
+
}
|
|
213316
|
+
if (fetchConfig.transform !== void 0) {
|
|
213317
|
+
result.fetchConfig.transform = fetchConfig.transform;
|
|
213318
|
+
}
|
|
213319
|
+
if (fetchConfig.body !== void 0) {
|
|
213320
|
+
result.fetchConfig.body = fetchConfig.body;
|
|
213321
|
+
}
|
|
213322
|
+
if (fetchConfig.timeout !== void 0) {
|
|
213323
|
+
result.fetchConfig.timeout = fetchConfig.timeout;
|
|
213324
|
+
}
|
|
213325
|
+
if (options.credentialReference?.id !== void 0) {
|
|
213326
|
+
result.credentialReferenceId = options.credentialReference.id;
|
|
213327
|
+
}
|
|
213328
|
+
return result;
|
|
213310
213329
|
}
|
|
213311
213330
|
var logger2 = getLogger("template-engine");
|
|
213312
213331
|
var _TemplateEngine = class _TemplateEngine {
|
|
@@ -213643,7 +213662,7 @@ var CredentialStuffer = class {
|
|
|
213643
213662
|
credentialStoreHeaders = await this.getCredentials(context, storeReference, mcpType);
|
|
213644
213663
|
}
|
|
213645
213664
|
if (!credentialStoreHeaders) {
|
|
213646
|
-
return credentialsFromHeaders ? credentialsFromHeaders.headers : {};
|
|
213665
|
+
return credentialsFromHeaders ? credentialsFromHeaders.headers : { ...headers2 };
|
|
213647
213666
|
}
|
|
213648
213667
|
const combinedHeaders = {
|
|
213649
213668
|
...credentialStoreHeaders.headers,
|
|
@@ -213674,8 +213693,8 @@ var CredentialStuffer = class {
|
|
|
213674
213693
|
};
|
|
213675
213694
|
}
|
|
213676
213695
|
};
|
|
213677
|
-
var
|
|
213678
|
-
dirname(
|
|
213696
|
+
var FILENAME = fileURLToPath(import.meta.url);
|
|
213697
|
+
dirname(FILENAME);
|
|
213679
213698
|
function createTestDatabaseClientNoMigrations() {
|
|
213680
213699
|
const client = new PGlite();
|
|
213681
213700
|
const db = drizzle$1(client, { schema: schema_exports });
|
|
@@ -213955,9 +213974,8 @@ var upsertExternalAgent = (db) => async (params) => {
|
|
|
213955
213974
|
throw new Error("Failed to update external agent - no rows affected");
|
|
213956
213975
|
}
|
|
213957
213976
|
return updated;
|
|
213958
|
-
} else {
|
|
213959
|
-
return await createExternalAgent(db)(params.data);
|
|
213960
213977
|
}
|
|
213978
|
+
return await createExternalAgent(db)(params.data);
|
|
213961
213979
|
};
|
|
213962
213980
|
var deleteExternalAgent = (db) => async (params) => {
|
|
213963
213981
|
try {
|
|
@@ -214218,12 +214236,11 @@ var upsertFunctionTool = (db) => async (params) => {
|
|
|
214218
214236
|
functionId: params.data.functionId
|
|
214219
214237
|
}
|
|
214220
214238
|
});
|
|
214221
|
-
} else {
|
|
214222
|
-
return await createFunctionTool(db)({
|
|
214223
|
-
data: params.data,
|
|
214224
|
-
scopes
|
|
214225
|
-
});
|
|
214226
214239
|
}
|
|
214240
|
+
return await createFunctionTool(db)({
|
|
214241
|
+
data: params.data,
|
|
214242
|
+
scopes
|
|
214243
|
+
});
|
|
214227
214244
|
};
|
|
214228
214245
|
var getFunctionToolsForSubAgent = (db) => {
|
|
214229
214246
|
return async (params) => {
|
|
@@ -215202,9 +215219,8 @@ var upsertSubAgent = (db) => async (params) => {
|
|
|
215202
215219
|
throw new Error("Failed to update agent - no rows affected");
|
|
215203
215220
|
}
|
|
215204
215221
|
return updated;
|
|
215205
|
-
} else {
|
|
215206
|
-
return await createSubAgent(db)(params.data);
|
|
215207
215222
|
}
|
|
215223
|
+
return await createSubAgent(db)(params.data);
|
|
215208
215224
|
};
|
|
215209
215225
|
var deleteSubAgent = (db) => async (params) => {
|
|
215210
215226
|
await db.delete(subAgents).where(
|
|
@@ -215979,13 +215995,13 @@ var McpClient = class {
|
|
|
215979
215995
|
}
|
|
215980
215996
|
if (selectedTools === void 0) {
|
|
215981
215997
|
return availableTools;
|
|
215982
|
-
}
|
|
215998
|
+
}
|
|
215999
|
+
if (selectedTools.length === 0) {
|
|
215983
216000
|
return [];
|
|
215984
|
-
} else {
|
|
215985
|
-
const toolNames = availableTools.map((tool2) => tool2.name);
|
|
215986
|
-
this.validateSelectedTools(toolNames, selectedTools);
|
|
215987
|
-
return availableTools.filter((tool2) => selectedTools.includes(tool2.name));
|
|
215988
216001
|
}
|
|
216002
|
+
const toolNames = availableTools.map((tool2) => tool2.name);
|
|
216003
|
+
this.validateSelectedTools(toolNames, selectedTools);
|
|
216004
|
+
return availableTools.filter((tool2) => selectedTools.includes(tool2.name));
|
|
215989
216005
|
}
|
|
215990
216006
|
async tools() {
|
|
215991
216007
|
const tools2 = await this.selectTools();
|
|
@@ -216400,9 +216416,8 @@ var upsertCredentialReference = (db) => async (params) => {
|
|
|
216400
216416
|
throw new Error("Failed to update credential reference - no rows affected");
|
|
216401
216417
|
}
|
|
216402
216418
|
return updated;
|
|
216403
|
-
} else {
|
|
216404
|
-
return await createCredentialReference(db)(params.data);
|
|
216405
216419
|
}
|
|
216420
|
+
return await createCredentialReference(db)(params.data);
|
|
216406
216421
|
};
|
|
216407
216422
|
|
|
216408
216423
|
// src/data-access/tools.ts
|
|
@@ -216722,9 +216737,8 @@ var upsertTool = (db) => async (params) => {
|
|
|
216722
216737
|
headers: params.data.headers
|
|
216723
216738
|
}
|
|
216724
216739
|
});
|
|
216725
|
-
} else {
|
|
216726
|
-
return await createTool(db)(params.data);
|
|
216727
216740
|
}
|
|
216741
|
+
return await createTool(db)(params.data);
|
|
216728
216742
|
};
|
|
216729
216743
|
|
|
216730
216744
|
// src/data-access/agents.ts
|
|
@@ -217557,9 +217571,8 @@ var upsertArtifactComponent = (db) => async (params) => {
|
|
|
217557
217571
|
props: params.data.props
|
|
217558
217572
|
}
|
|
217559
217573
|
});
|
|
217560
|
-
} else {
|
|
217561
|
-
return await createArtifactComponent(db)(params.data);
|
|
217562
217574
|
}
|
|
217575
|
+
return await createArtifactComponent(db)(params.data);
|
|
217563
217576
|
};
|
|
217564
217577
|
var getDataComponent = (db) => async (params) => {
|
|
217565
217578
|
const result = await db.query.dataComponents.findFirst({
|
|
@@ -217784,9 +217797,8 @@ var upsertDataComponent = (db) => async (params) => {
|
|
|
217784
217797
|
props: params.data.props
|
|
217785
217798
|
}
|
|
217786
217799
|
});
|
|
217787
|
-
} else {
|
|
217788
|
-
return await createDataComponent(db)(params.data);
|
|
217789
217800
|
}
|
|
217801
|
+
return await createDataComponent(db)(params.data);
|
|
217790
217802
|
};
|
|
217791
217803
|
|
|
217792
217804
|
// src/data-access/agentFull.ts
|
|
@@ -222061,7 +222073,8 @@ function filterContextToSchemaKeys(validatedContext, headersSchema) {
|
|
|
222061
222073
|
if (filteredHeaders !== null && filteredHeaders !== void 0) {
|
|
222062
222074
|
if (typeof filteredHeaders === "object" && Object.keys(filteredHeaders).length > 0) {
|
|
222063
222075
|
return filteredHeaders;
|
|
222064
|
-
}
|
|
222076
|
+
}
|
|
222077
|
+
if (typeof filteredHeaders !== "object") {
|
|
222065
222078
|
return filteredHeaders;
|
|
222066
222079
|
}
|
|
222067
222080
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|