@inkeep/agents-run-api 0.0.0-dev-20251125155922 → 0.0.0-dev-20251125203032
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/{SandboxExecutorFactory-A2LTPE2X.js → SandboxExecutorFactory-2N27SE3B.js} +1 -1
- package/dist/{chunk-BQB27EXW.js → chunk-4PN6SRDA.js} +3 -3
- package/dist/{chunk-W6UIBREL.js → chunk-NCTCH6YU.js} +1 -1
- package/dist/{chunk-QOUOKHYQ.js → chunk-UC2EPLSW.js} +1 -1
- package/dist/{conversations-33GSAG2C.js → conversations-UAU7DKRQ.js} +1 -1
- package/dist/dbClient-MG2R7BZ4.js +1 -0
- package/dist/index.cjs +31 -15
- package/dist/index.js +37 -21
- package/dist/instrumentation.cjs +1 -1
- package/dist/instrumentation.js +1 -1
- package/package.json +2 -2
- package/dist/dbClient-47AP7OHJ.js +0 -1
- package/dist/{chunk-CDYXP4BN.js → chunk-KBZIYCPJ.js} +1 -1
- package/dist/{chunk-SUUSOBLI.js → chunk-THWNUGWP.js} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLogger } from './chunk-A2S7GSHL.js';
|
|
2
|
-
import { FUNCTION_TOOL_SANDBOX_POOL_TTL_MS, FUNCTION_TOOL_SANDBOX_MAX_USE_COUNT, FUNCTION_TOOL_SANDBOX_CLEANUP_INTERVAL_MS, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, FUNCTION_TOOL_SANDBOX_MAX_OUTPUT_SIZE_BYTES, FUNCTION_TOOL_SANDBOX_QUEUE_WAIT_TIMEOUT_MS } from './chunk-
|
|
2
|
+
import { FUNCTION_TOOL_SANDBOX_POOL_TTL_MS, FUNCTION_TOOL_SANDBOX_MAX_USE_COUNT, FUNCTION_TOOL_SANDBOX_CLEANUP_INTERVAL_MS, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, FUNCTION_TOOL_SANDBOX_MAX_OUTPUT_SIZE_BYTES, FUNCTION_TOOL_SANDBOX_QUEUE_WAIT_TIMEOUT_MS } from './chunk-THWNUGWP.js';
|
|
3
3
|
import { spawn } from 'child_process';
|
|
4
4
|
import crypto, { createHash } from 'crypto';
|
|
5
5
|
import { mkdirSync, existsSync, rmSync, writeFileSync } from 'fs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { dbClient_default } from './chunk-
|
|
2
|
-
import { CONVERSATION_HISTORY_DEFAULT_LIMIT } from './chunk-
|
|
1
|
+
import { dbClient_default } from './chunk-NCTCH6YU.js';
|
|
2
|
+
import { CONVERSATION_HISTORY_DEFAULT_LIMIT } from './chunk-THWNUGWP.js';
|
|
3
3
|
import { CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, createMessage, generateId, getConversationHistory } from '@inkeep/agents-core';
|
|
4
4
|
|
|
5
5
|
function createDefaultConversationHistoryConfig(mode = "full") {
|
|
@@ -208,7 +208,7 @@ async function getConversationScopedArtifacts(params) {
|
|
|
208
208
|
return [];
|
|
209
209
|
}
|
|
210
210
|
const { getLedgerArtifacts } = await import('@inkeep/agents-core');
|
|
211
|
-
const dbClient = (await import('./dbClient-
|
|
211
|
+
const dbClient = (await import('./dbClient-MG2R7BZ4.js')).default;
|
|
212
212
|
const visibleTaskIds = visibleMessages.map((msg) => msg.taskId).filter((taskId) => Boolean(taskId));
|
|
213
213
|
const referenceArtifacts = [];
|
|
214
214
|
for (const taskId of visibleTaskIds) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { env } from './chunk-
|
|
1
|
+
import { env } from './chunk-KBZIYCPJ.js';
|
|
2
2
|
import { F, u, R, x, T, h, U, L, or, C, Vr, ce, ur, P } from './chunk-SBJLXGYG.js';
|
|
3
3
|
import { createDatabaseClient } from '@inkeep/agents-core';
|
|
4
4
|
import * as schema from '@inkeep/agents-core/db/schema';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { env } from './chunk-
|
|
1
|
+
import { env } from './chunk-KBZIYCPJ.js';
|
|
2
2
|
import { getLogger } from './chunk-A2S7GSHL.js';
|
|
3
3
|
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
|
|
4
4
|
import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from '@opentelemetry/baggage-span-processor';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-
|
|
1
|
+
export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-4PN6SRDA.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { dbClient_default as default } from './chunk-NCTCH6YU.js';
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var agentsCore = require('@inkeep/agents-core');
|
|
6
5
|
var zodOpenapi = require('@hono/zod-openapi');
|
|
6
|
+
var agentsCore = require('@inkeep/agents-core');
|
|
7
7
|
var s3 = require('fs');
|
|
8
8
|
var o3 = require('path');
|
|
9
9
|
var schema = require('@inkeep/agents-core/db/schema');
|
|
@@ -13731,7 +13731,14 @@ var Phase1Config = class _Phase1Config {
|
|
|
13731
13731
|
throw new Error("System prompt template not loaded");
|
|
13732
13732
|
}
|
|
13733
13733
|
let systemPrompt = systemPromptTemplate;
|
|
13734
|
-
|
|
13734
|
+
if (config.corePrompt && config.corePrompt.trim()) {
|
|
13735
|
+
systemPrompt = systemPrompt.replace("{{CORE_INSTRUCTIONS}}", config.corePrompt);
|
|
13736
|
+
} else {
|
|
13737
|
+
systemPrompt = systemPrompt.replace(
|
|
13738
|
+
/<core_instructions>\s*\{\{CORE_INSTRUCTIONS\}\}\s*<\/core_instructions>/g,
|
|
13739
|
+
""
|
|
13740
|
+
);
|
|
13741
|
+
}
|
|
13735
13742
|
const agentContextSection = this.generateAgentContextSection(config.prompt);
|
|
13736
13743
|
systemPrompt = systemPrompt.replace("{{AGENT_CONTEXT_SECTION}}", agentContextSection);
|
|
13737
13744
|
const toolData = this.isToolDataArray(config.tools) ? config.tools : _Phase1Config.convertMcpToolsToToolData(config.tools);
|
|
@@ -13761,7 +13768,7 @@ var Phase1Config = class _Phase1Config {
|
|
|
13761
13768
|
return systemPrompt;
|
|
13762
13769
|
}
|
|
13763
13770
|
generateAgentContextSection(prompt) {
|
|
13764
|
-
if (!prompt) {
|
|
13771
|
+
if (!prompt || prompt.trim() === "") {
|
|
13765
13772
|
return "";
|
|
13766
13773
|
}
|
|
13767
13774
|
return `
|
|
@@ -14445,7 +14452,7 @@ ${componentDescriptions}`;
|
|
|
14445
14452
|
dataComponentXml = dataComponentXml.replace("{{COMPONENT_NAME}}", dataComponent.name);
|
|
14446
14453
|
dataComponentXml = dataComponentXml.replace(
|
|
14447
14454
|
"{{COMPONENT_DESCRIPTION}}",
|
|
14448
|
-
dataComponent.description
|
|
14455
|
+
dataComponent.description || ""
|
|
14449
14456
|
);
|
|
14450
14457
|
dataComponentXml = dataComponentXml.replace(
|
|
14451
14458
|
"{{COMPONENT_PROPS_SCHEMA}}",
|
|
@@ -14541,7 +14548,14 @@ ${artifact_retrieval_guidance_default}
|
|
|
14541
14548
|
artifactComponents
|
|
14542
14549
|
);
|
|
14543
14550
|
let phase2Prompt = system_prompt_default2;
|
|
14544
|
-
|
|
14551
|
+
if (corePrompt && corePrompt.trim()) {
|
|
14552
|
+
phase2Prompt = phase2Prompt.replace("{{CORE_INSTRUCTIONS}}", corePrompt);
|
|
14553
|
+
} else {
|
|
14554
|
+
phase2Prompt = phase2Prompt.replace(
|
|
14555
|
+
/<core_instructions>\s*\{\{CORE_INSTRUCTIONS\}\}\s*<\/core_instructions>/g,
|
|
14556
|
+
""
|
|
14557
|
+
);
|
|
14558
|
+
}
|
|
14545
14559
|
phase2Prompt = phase2Prompt.replace("{{DATA_COMPONENTS_SECTION}}", dataComponentsSection);
|
|
14546
14560
|
phase2Prompt = phase2Prompt.replace("{{ARTIFACTS_SECTION}}", artifactsSection);
|
|
14547
14561
|
phase2Prompt = phase2Prompt.replace("{{ARTIFACT_GUIDANCE_SECTION}}", artifactGuidance);
|
|
@@ -15507,8 +15521,8 @@ var Agent = class {
|
|
|
15507
15521
|
const hasAgentArtifactComponents = await this.hasAgentArtifactComponents();
|
|
15508
15522
|
const conversationId = runtimeContext?.metadata?.conversationId || runtimeContext?.contextId;
|
|
15509
15523
|
const resolvedContext = conversationId ? await this.getResolvedContext(conversationId) : null;
|
|
15510
|
-
let processedPrompt = this.config.prompt;
|
|
15511
|
-
if (resolvedContext) {
|
|
15524
|
+
let processedPrompt = this.config.prompt || "";
|
|
15525
|
+
if (resolvedContext && this.config.prompt) {
|
|
15512
15526
|
try {
|
|
15513
15527
|
processedPrompt = agentsCore.TemplateEngine.render(this.config.prompt, resolvedContext, {
|
|
15514
15528
|
strict: false,
|
|
@@ -15554,8 +15568,8 @@ var Agent = class {
|
|
|
15554
15568
|
this.setConversationId(conversationId);
|
|
15555
15569
|
}
|
|
15556
15570
|
const resolvedContext = conversationId ? await this.getResolvedContext(conversationId) : null;
|
|
15557
|
-
let processedPrompt = this.config.prompt;
|
|
15558
|
-
if (resolvedContext) {
|
|
15571
|
+
let processedPrompt = this.config.prompt || "";
|
|
15572
|
+
if (resolvedContext && this.config.prompt) {
|
|
15559
15573
|
try {
|
|
15560
15574
|
processedPrompt = agentsCore.TemplateEngine.render(this.config.prompt, resolvedContext, {
|
|
15561
15575
|
strict: false,
|
|
@@ -16761,7 +16775,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
16761
16775
|
return relation;
|
|
16762
16776
|
})
|
|
16763
16777
|
);
|
|
16764
|
-
const prompt = "prompt" in config.agentSchema ? config.agentSchema.prompt : "";
|
|
16778
|
+
const prompt = "prompt" in config.agentSchema ? config.agentSchema.prompt || void 0 : "";
|
|
16765
16779
|
const models = "models" in config.agentSchema ? config.agentSchema.models : void 0;
|
|
16766
16780
|
const stopWhen = "stopWhen" in config.agentSchema ? config.agentSchema.stopWhen : void 0;
|
|
16767
16781
|
const toolsForAgentResult = await Promise.all(
|
|
@@ -16800,7 +16814,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
16800
16814
|
baseUrl: config.baseUrl,
|
|
16801
16815
|
apiKey: config.apiKey,
|
|
16802
16816
|
name: relation.name,
|
|
16803
|
-
description: relation.description,
|
|
16817
|
+
description: relation.description || void 0,
|
|
16804
16818
|
prompt: "",
|
|
16805
16819
|
delegateRelations: [],
|
|
16806
16820
|
subAgentRelations: [],
|
|
@@ -16903,7 +16917,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
16903
16917
|
projectId: config.projectId,
|
|
16904
16918
|
agentId: config.agentId,
|
|
16905
16919
|
name: relation.name,
|
|
16906
|
-
description: relation.description,
|
|
16920
|
+
description: relation.description || void 0,
|
|
16907
16921
|
prompt: "",
|
|
16908
16922
|
delegateRelations: targetDelegateRelationsConfig,
|
|
16909
16923
|
subAgentRelations: [],
|
|
@@ -16924,7 +16938,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
16924
16938
|
baseUrl: config.baseUrl,
|
|
16925
16939
|
apiKey: config.apiKey,
|
|
16926
16940
|
name: relation.name,
|
|
16927
|
-
description: relation.description,
|
|
16941
|
+
description: relation.description || void 0,
|
|
16928
16942
|
prompt: "",
|
|
16929
16943
|
delegateRelations: [],
|
|
16930
16944
|
// Simplified - no nested relations
|
|
@@ -17122,7 +17136,9 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
17122
17136
|
} catch (error) {
|
|
17123
17137
|
console.error("Task handler error:", error);
|
|
17124
17138
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
17125
|
-
const isConnectionRefused = errorMessage.includes(
|
|
17139
|
+
const isConnectionRefused = errorMessage.includes(
|
|
17140
|
+
"Connection refused. Please check if the MCP server is running."
|
|
17141
|
+
);
|
|
17126
17142
|
return {
|
|
17127
17143
|
status: {
|
|
17128
17144
|
state: agentsCore.TaskState.Failed,
|
|
@@ -17174,7 +17190,7 @@ var createTaskHandlerConfig = async (params) => {
|
|
|
17174
17190
|
baseUrl: params.baseUrl,
|
|
17175
17191
|
apiKey: params.apiKey,
|
|
17176
17192
|
name: subAgent.name,
|
|
17177
|
-
description: subAgent.description,
|
|
17193
|
+
description: subAgent.description || void 0,
|
|
17178
17194
|
conversationHistoryConfig: effectiveConversationHistoryConfig,
|
|
17179
17195
|
contextConfigId: agent?.contextConfigId || void 0,
|
|
17180
17196
|
sandboxConfig: params.sandboxConfig
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { flushBatchProcessor } from './chunk-
|
|
2
|
-
import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-
|
|
3
|
-
import { dbClient_default } from './chunk-
|
|
4
|
-
import { env } from './chunk-
|
|
1
|
+
import { flushBatchProcessor } from './chunk-UC2EPLSW.js';
|
|
2
|
+
import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-4PN6SRDA.js';
|
|
3
|
+
import { dbClient_default } from './chunk-NCTCH6YU.js';
|
|
4
|
+
import { env } from './chunk-KBZIYCPJ.js';
|
|
5
5
|
import { getLogger } from './chunk-A2S7GSHL.js';
|
|
6
|
-
import { SESSION_CLEANUP_INTERVAL_MS, AGENT_EXECUTION_MAX_CONSECUTIVE_ERRORS, SESSION_TOOL_RESULT_CACHE_TIMEOUT_MS, STREAM_MAX_LIFETIME_MS, STREAM_BUFFER_MAX_SIZE_BYTES, STREAM_TEXT_GAP_THRESHOLD_MS, ARTIFACT_GENERATION_MAX_RETRIES, ARTIFACT_SESSION_MAX_PENDING, STATUS_UPDATE_DEFAULT_INTERVAL_SECONDS, STATUS_UPDATE_DEFAULT_NUM_EVENTS, ARTIFACT_SESSION_MAX_PREVIOUS_SUMMARIES, AGENT_EXECUTION_MAX_GENERATION_STEPS, FUNCTION_TOOL_SANDBOX_VCPUS_DEFAULT, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, LLM_GENERATION_MAX_ALLOWED_TIMEOUT_MS, ARTIFACT_GENERATION_BACKOFF_INITIAL_MS, ARTIFACT_GENERATION_BACKOFF_MAX_MS, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_STREAMING, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_NON_STREAMING, LLM_GENERATION_SUBSEQUENT_CALL_TIMEOUT_MS, DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS, DELEGATION_TOOL_BACKOFF_EXPONENT, DELEGATION_TOOL_BACKOFF_MAX_INTERVAL_MS, DELEGATION_TOOL_BACKOFF_INITIAL_INTERVAL_MS, STREAM_PARSER_MAX_SNAPSHOT_SIZE, STREAM_PARSER_MAX_STREAMED_SIZE, STREAM_PARSER_MAX_COLLECTED_PARTS } from './chunk-
|
|
6
|
+
import { SESSION_CLEANUP_INTERVAL_MS, AGENT_EXECUTION_MAX_CONSECUTIVE_ERRORS, SESSION_TOOL_RESULT_CACHE_TIMEOUT_MS, STREAM_MAX_LIFETIME_MS, STREAM_BUFFER_MAX_SIZE_BYTES, STREAM_TEXT_GAP_THRESHOLD_MS, ARTIFACT_GENERATION_MAX_RETRIES, ARTIFACT_SESSION_MAX_PENDING, STATUS_UPDATE_DEFAULT_INTERVAL_SECONDS, STATUS_UPDATE_DEFAULT_NUM_EVENTS, ARTIFACT_SESSION_MAX_PREVIOUS_SUMMARIES, AGENT_EXECUTION_MAX_GENERATION_STEPS, FUNCTION_TOOL_SANDBOX_VCPUS_DEFAULT, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, LLM_GENERATION_MAX_ALLOWED_TIMEOUT_MS, ARTIFACT_GENERATION_BACKOFF_INITIAL_MS, ARTIFACT_GENERATION_BACKOFF_MAX_MS, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_STREAMING, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_NON_STREAMING, LLM_GENERATION_SUBSEQUENT_CALL_TIMEOUT_MS, DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS, DELEGATION_TOOL_BACKOFF_EXPONENT, DELEGATION_TOOL_BACKOFF_MAX_INTERVAL_MS, DELEGATION_TOOL_BACKOFF_INITIAL_INTERVAL_MS, STREAM_PARSER_MAX_SNAPSHOT_SIZE, STREAM_PARSER_MAX_STREAMED_SIZE, STREAM_PARSER_MAX_COLLECTED_PARTS } from './chunk-THWNUGWP.js';
|
|
7
7
|
import { getTracer, HeadersScopeSchema, getRequestExecutionContext, createApiError, getAgentWithDefaultSubAgent, contextValidationMiddleware, getConversationId, getFullAgent, createOrGetConversation, getActiveAgentForConversation, setActiveAgentForConversation, getSubAgentById, handleContextResolution, createMessage, generateId, commonGetErrorResponses, loggerFactory, getConversation, createDefaultCredentialStores, CredentialStoreRegistry, createTask, getTask, updateTask, setSpanWithError, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, updateConversation, handleApiError, TaskState, getAgentById, getProject, setActiveAgentForThread, getRelatedAgentsForAgent, getExternalAgentsForSubAgent, getTeamAgentsForSubAgent, getToolsForAgent, getDataComponentsForAgent, getArtifactComponentsForAgent, dbResultToMcpTool, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, ModelFactory, verifyTempToken, validateAndGetApiKey, verifyServiceToken, validateTargetAgent, ContextResolver, CredentialStuffer, MCPServerType, getCredentialReference, McpClient, getFunctionToolsForSubAgent, getFunction, getContextConfigById, getFullAgentDefinition, TemplateEngine, listTaskIdsByContextId, getLedgerArtifacts, agentHasArtifactComponents, upsertLedgerArtifact, MCPTransportType, SPAN_KEYS, headers, generateServiceToken } from '@inkeep/agents-core';
|
|
8
8
|
import { otel } from '@hono/otel';
|
|
9
9
|
import { OpenAPIHono, createRoute, z } from '@hono/zod-openapi';
|
|
@@ -6079,7 +6079,14 @@ var Phase1Config = class _Phase1Config {
|
|
|
6079
6079
|
throw new Error("System prompt template not loaded");
|
|
6080
6080
|
}
|
|
6081
6081
|
let systemPrompt = systemPromptTemplate;
|
|
6082
|
-
|
|
6082
|
+
if (config.corePrompt && config.corePrompt.trim()) {
|
|
6083
|
+
systemPrompt = systemPrompt.replace("{{CORE_INSTRUCTIONS}}", config.corePrompt);
|
|
6084
|
+
} else {
|
|
6085
|
+
systemPrompt = systemPrompt.replace(
|
|
6086
|
+
/<core_instructions>\s*\{\{CORE_INSTRUCTIONS\}\}\s*<\/core_instructions>/g,
|
|
6087
|
+
""
|
|
6088
|
+
);
|
|
6089
|
+
}
|
|
6083
6090
|
const agentContextSection = this.generateAgentContextSection(config.prompt);
|
|
6084
6091
|
systemPrompt = systemPrompt.replace("{{AGENT_CONTEXT_SECTION}}", agentContextSection);
|
|
6085
6092
|
const toolData = this.isToolDataArray(config.tools) ? config.tools : _Phase1Config.convertMcpToolsToToolData(config.tools);
|
|
@@ -6109,7 +6116,7 @@ var Phase1Config = class _Phase1Config {
|
|
|
6109
6116
|
return systemPrompt;
|
|
6110
6117
|
}
|
|
6111
6118
|
generateAgentContextSection(prompt) {
|
|
6112
|
-
if (!prompt) {
|
|
6119
|
+
if (!prompt || prompt.trim() === "") {
|
|
6113
6120
|
return "";
|
|
6114
6121
|
}
|
|
6115
6122
|
return `
|
|
@@ -6793,7 +6800,7 @@ ${componentDescriptions}`;
|
|
|
6793
6800
|
dataComponentXml = dataComponentXml.replace("{{COMPONENT_NAME}}", dataComponent.name);
|
|
6794
6801
|
dataComponentXml = dataComponentXml.replace(
|
|
6795
6802
|
"{{COMPONENT_DESCRIPTION}}",
|
|
6796
|
-
dataComponent.description
|
|
6803
|
+
dataComponent.description || ""
|
|
6797
6804
|
);
|
|
6798
6805
|
dataComponentXml = dataComponentXml.replace(
|
|
6799
6806
|
"{{COMPONENT_PROPS_SCHEMA}}",
|
|
@@ -6889,7 +6896,14 @@ ${artifact_retrieval_guidance_default}
|
|
|
6889
6896
|
artifactComponents
|
|
6890
6897
|
);
|
|
6891
6898
|
let phase2Prompt = system_prompt_default2;
|
|
6892
|
-
|
|
6899
|
+
if (corePrompt && corePrompt.trim()) {
|
|
6900
|
+
phase2Prompt = phase2Prompt.replace("{{CORE_INSTRUCTIONS}}", corePrompt);
|
|
6901
|
+
} else {
|
|
6902
|
+
phase2Prompt = phase2Prompt.replace(
|
|
6903
|
+
/<core_instructions>\s*\{\{CORE_INSTRUCTIONS\}\}\s*<\/core_instructions>/g,
|
|
6904
|
+
""
|
|
6905
|
+
);
|
|
6906
|
+
}
|
|
6893
6907
|
phase2Prompt = phase2Prompt.replace("{{DATA_COMPONENTS_SECTION}}", dataComponentsSection);
|
|
6894
6908
|
phase2Prompt = phase2Prompt.replace("{{ARTIFACTS_SECTION}}", artifactsSection);
|
|
6895
6909
|
phase2Prompt = phase2Prompt.replace("{{ARTIFACT_GUIDANCE_SECTION}}", artifactGuidance);
|
|
@@ -7652,7 +7666,7 @@ var Agent = class {
|
|
|
7652
7666
|
if (functionToolsData.length === 0) {
|
|
7653
7667
|
return functionTools;
|
|
7654
7668
|
}
|
|
7655
|
-
const { SandboxExecutorFactory } = await import('./SandboxExecutorFactory-
|
|
7669
|
+
const { SandboxExecutorFactory } = await import('./SandboxExecutorFactory-2N27SE3B.js');
|
|
7656
7670
|
const sandboxExecutor = SandboxExecutorFactory.getInstance();
|
|
7657
7671
|
for (const functionToolDef of functionToolsData) {
|
|
7658
7672
|
const functionId = functionToolDef.functionId;
|
|
@@ -7855,8 +7869,8 @@ var Agent = class {
|
|
|
7855
7869
|
const hasAgentArtifactComponents = await this.hasAgentArtifactComponents();
|
|
7856
7870
|
const conversationId = runtimeContext?.metadata?.conversationId || runtimeContext?.contextId;
|
|
7857
7871
|
const resolvedContext = conversationId ? await this.getResolvedContext(conversationId) : null;
|
|
7858
|
-
let processedPrompt = this.config.prompt;
|
|
7859
|
-
if (resolvedContext) {
|
|
7872
|
+
let processedPrompt = this.config.prompt || "";
|
|
7873
|
+
if (resolvedContext && this.config.prompt) {
|
|
7860
7874
|
try {
|
|
7861
7875
|
processedPrompt = TemplateEngine.render(this.config.prompt, resolvedContext, {
|
|
7862
7876
|
strict: false,
|
|
@@ -7902,8 +7916,8 @@ var Agent = class {
|
|
|
7902
7916
|
this.setConversationId(conversationId);
|
|
7903
7917
|
}
|
|
7904
7918
|
const resolvedContext = conversationId ? await this.getResolvedContext(conversationId) : null;
|
|
7905
|
-
let processedPrompt = this.config.prompt;
|
|
7906
|
-
if (resolvedContext) {
|
|
7919
|
+
let processedPrompt = this.config.prompt || "";
|
|
7920
|
+
if (resolvedContext && this.config.prompt) {
|
|
7907
7921
|
try {
|
|
7908
7922
|
processedPrompt = TemplateEngine.render(this.config.prompt, resolvedContext, {
|
|
7909
7923
|
strict: false,
|
|
@@ -7946,7 +7960,7 @@ var Agent = class {
|
|
|
7946
7960
|
inputSchema: tool3.inputSchema || tool3.parameters || {},
|
|
7947
7961
|
usageGuidelines: name.startsWith("transfer_to_") || name.startsWith("delegate_to_") ? `Use this tool to ${name.startsWith("transfer_to_") ? "transfer" : "delegate"} to another agent when appropriate.` : "Use this tool when appropriate for the task at hand."
|
|
7948
7962
|
}));
|
|
7949
|
-
const { getConversationScopedArtifacts } = await import('./conversations-
|
|
7963
|
+
const { getConversationScopedArtifacts } = await import('./conversations-UAU7DKRQ.js');
|
|
7950
7964
|
const historyConfig = this.config.conversationHistoryConfig ?? createDefaultConversationHistoryConfig();
|
|
7951
7965
|
const referenceArtifacts = await getConversationScopedArtifacts({
|
|
7952
7966
|
tenantId: this.config.tenantId,
|
|
@@ -9109,7 +9123,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9109
9123
|
return relation;
|
|
9110
9124
|
})
|
|
9111
9125
|
);
|
|
9112
|
-
const prompt = "prompt" in config.agentSchema ? config.agentSchema.prompt : "";
|
|
9126
|
+
const prompt = "prompt" in config.agentSchema ? config.agentSchema.prompt || void 0 : "";
|
|
9113
9127
|
const models = "models" in config.agentSchema ? config.agentSchema.models : void 0;
|
|
9114
9128
|
const stopWhen = "stopWhen" in config.agentSchema ? config.agentSchema.stopWhen : void 0;
|
|
9115
9129
|
const toolsForAgentResult = await Promise.all(
|
|
@@ -9148,7 +9162,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9148
9162
|
baseUrl: config.baseUrl,
|
|
9149
9163
|
apiKey: config.apiKey,
|
|
9150
9164
|
name: relation.name,
|
|
9151
|
-
description: relation.description,
|
|
9165
|
+
description: relation.description || void 0,
|
|
9152
9166
|
prompt: "",
|
|
9153
9167
|
delegateRelations: [],
|
|
9154
9168
|
subAgentRelations: [],
|
|
@@ -9251,7 +9265,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9251
9265
|
projectId: config.projectId,
|
|
9252
9266
|
agentId: config.agentId,
|
|
9253
9267
|
name: relation.name,
|
|
9254
|
-
description: relation.description,
|
|
9268
|
+
description: relation.description || void 0,
|
|
9255
9269
|
prompt: "",
|
|
9256
9270
|
delegateRelations: targetDelegateRelationsConfig,
|
|
9257
9271
|
subAgentRelations: [],
|
|
@@ -9272,7 +9286,7 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9272
9286
|
baseUrl: config.baseUrl,
|
|
9273
9287
|
apiKey: config.apiKey,
|
|
9274
9288
|
name: relation.name,
|
|
9275
|
-
description: relation.description,
|
|
9289
|
+
description: relation.description || void 0,
|
|
9276
9290
|
prompt: "",
|
|
9277
9291
|
delegateRelations: [],
|
|
9278
9292
|
// Simplified - no nested relations
|
|
@@ -9470,7 +9484,9 @@ var createTaskHandler = (config, credentialStoreRegistry) => {
|
|
|
9470
9484
|
} catch (error) {
|
|
9471
9485
|
console.error("Task handler error:", error);
|
|
9472
9486
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
9473
|
-
const isConnectionRefused = errorMessage.includes(
|
|
9487
|
+
const isConnectionRefused = errorMessage.includes(
|
|
9488
|
+
"Connection refused. Please check if the MCP server is running."
|
|
9489
|
+
);
|
|
9474
9490
|
return {
|
|
9475
9491
|
status: {
|
|
9476
9492
|
state: TaskState.Failed,
|
|
@@ -9522,7 +9538,7 @@ var createTaskHandlerConfig = async (params) => {
|
|
|
9522
9538
|
baseUrl: params.baseUrl,
|
|
9523
9539
|
apiKey: params.apiKey,
|
|
9524
9540
|
name: subAgent.name,
|
|
9525
|
-
description: subAgent.description,
|
|
9541
|
+
description: subAgent.description || void 0,
|
|
9526
9542
|
conversationHistoryConfig: effectiveConversationHistoryConfig,
|
|
9527
9543
|
contextConfigId: agent?.contextConfigId || void 0,
|
|
9528
9544
|
sandboxConfig: params.sandboxConfig
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -9,8 +9,8 @@ var resources = require('@opentelemetry/resources');
|
|
|
9
9
|
var sdkNode = require('@opentelemetry/sdk-node');
|
|
10
10
|
var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
|
11
11
|
var semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
12
|
-
var agentsCore = require('@inkeep/agents-core');
|
|
13
12
|
var zodOpenapi = require('@hono/zod-openapi');
|
|
13
|
+
var agentsCore = require('@inkeep/agents-core');
|
|
14
14
|
|
|
15
15
|
// src/instrumentation.ts
|
|
16
16
|
agentsCore.loadEnvironmentFiles();
|
package/dist/instrumentation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator, flushBatchProcessor } from './chunk-
|
|
1
|
+
export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator, flushBatchProcessor } from './chunk-UC2EPLSW.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20251125203032",
|
|
4
4
|
"description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"pino": "^9.11.0",
|
|
54
54
|
"traverse": "^0.6.11",
|
|
55
55
|
"ts-pattern": "^5.7.1",
|
|
56
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
56
|
+
"@inkeep/agents-core": "^0.0.0-dev-20251125203032"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@hono/zod-openapi": "^1.1.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { dbClient_default as default } from './chunk-W6UIBREL.js';
|