@inkeep/agents-run-api 0.0.0-dev-20251125151505 → 0.0.0-dev-20251125185858
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-FVKDJKKZ.js → SandboxExecutorFactory-A2LTPE2X.js} +1 -1
- package/dist/{chunk-M46DFVYB.js → chunk-BQB27EXW.js} +3 -3
- package/dist/{chunk-IYG4HUQ6.js → chunk-CDYXP4BN.js} +1 -1
- package/dist/{chunk-AZFBQY6E.js → chunk-QOUOKHYQ.js} +1 -1
- package/dist/{chunk-IVALDC72.js → chunk-SUUSOBLI.js} +1 -1
- package/dist/{chunk-V4RNZ6BX.js → chunk-W6UIBREL.js} +1 -1
- package/dist/{conversations-NZLQK64L.js → conversations-33GSAG2C.js} +1 -1
- package/dist/dbClient-47AP7OHJ.js +1 -0
- package/dist/index.cjs +128 -130
- package/dist/index.js +46 -47
- package/dist/instrumentation.cjs +19 -19
- package/dist/instrumentation.js +1 -1
- package/package.json +6 -4
- package/dist/dbClient-BXOIYVCJ.js +0 -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-SUUSOBLI.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-W6UIBREL.js';
|
|
2
|
+
import { CONVERSATION_HISTORY_DEFAULT_LIMIT } from './chunk-SUUSOBLI.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-47AP7OHJ.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-CDYXP4BN.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,4 +1,4 @@
|
|
|
1
|
-
import { env } from './chunk-
|
|
1
|
+
import { env } from './chunk-CDYXP4BN.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 +1 @@
|
|
|
1
|
-
export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-
|
|
1
|
+
export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-BQB27EXW.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { dbClient_default as default } from './chunk-W6UIBREL.js';
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var agentsCore = require('@inkeep/agents-core');
|
|
6
|
-
var
|
|
6
|
+
var zodOpenapi = require('@hono/zod-openapi');
|
|
7
7
|
var s3 = require('fs');
|
|
8
8
|
var o3 = require('path');
|
|
9
9
|
var schema = require('@inkeep/agents-core/db/schema');
|
|
@@ -13,7 +13,6 @@ var crypto2 = require('crypto');
|
|
|
13
13
|
var os = require('os');
|
|
14
14
|
var sandbox = require('@vercel/sandbox');
|
|
15
15
|
var otel = require('@hono/otel');
|
|
16
|
-
var zodOpenapi = require('@hono/zod-openapi');
|
|
17
16
|
var api = require('@opentelemetry/api');
|
|
18
17
|
var hono = require('hono');
|
|
19
18
|
var cors = require('hono/cors');
|
|
@@ -61,7 +60,6 @@ function _interopNamespace(e) {
|
|
|
61
60
|
return Object.freeze(n);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
var z8__default = /*#__PURE__*/_interopDefault(z8);
|
|
65
63
|
var s3__namespace = /*#__PURE__*/_interopNamespace(s3);
|
|
66
64
|
var o3__namespace = /*#__PURE__*/_interopNamespace(o3);
|
|
67
65
|
var schema__namespace = /*#__PURE__*/_interopNamespace(schema);
|
|
@@ -84,29 +82,29 @@ var envSchema, parseEnv, env;
|
|
|
84
82
|
var init_env = __esm({
|
|
85
83
|
"src/env.ts"() {
|
|
86
84
|
agentsCore.loadEnvironmentFiles();
|
|
87
|
-
envSchema =
|
|
88
|
-
NODE_ENV:
|
|
89
|
-
ENVIRONMENT:
|
|
90
|
-
DATABASE_URL:
|
|
91
|
-
INKEEP_AGENTS_RUN_API_URL:
|
|
92
|
-
AGENTS_MANAGE_UI_URL:
|
|
93
|
-
LOG_LEVEL:
|
|
94
|
-
NANGO_SERVER_URL:
|
|
95
|
-
NANGO_SECRET_KEY:
|
|
96
|
-
ANTHROPIC_API_KEY:
|
|
97
|
-
OPENAI_API_KEY:
|
|
98
|
-
GOOGLE_GENERATIVE_AI_API_KEY:
|
|
99
|
-
INKEEP_AGENTS_RUN_API_BYPASS_SECRET:
|
|
100
|
-
INKEEP_AGENTS_JWT_SIGNING_SECRET:
|
|
101
|
-
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY:
|
|
102
|
-
OTEL_BSP_SCHEDULE_DELAY:
|
|
103
|
-
OTEL_BSP_MAX_EXPORT_BATCH_SIZE:
|
|
85
|
+
envSchema = zodOpenapi.z.object({
|
|
86
|
+
NODE_ENV: zodOpenapi.z.enum(["development", "production", "test"]).optional(),
|
|
87
|
+
ENVIRONMENT: zodOpenapi.z.enum(["development", "production", "pentest", "test"]).optional().default("development"),
|
|
88
|
+
DATABASE_URL: zodOpenapi.z.string().optional(),
|
|
89
|
+
INKEEP_AGENTS_RUN_API_URL: zodOpenapi.z.string().optional().default("http://localhost:3003"),
|
|
90
|
+
AGENTS_MANAGE_UI_URL: zodOpenapi.z.string().optional().default("http://localhost:3000"),
|
|
91
|
+
LOG_LEVEL: zodOpenapi.z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
|
|
92
|
+
NANGO_SERVER_URL: zodOpenapi.z.string().optional().default("https://api.nango.dev"),
|
|
93
|
+
NANGO_SECRET_KEY: zodOpenapi.z.string().optional(),
|
|
94
|
+
ANTHROPIC_API_KEY: zodOpenapi.z.string(),
|
|
95
|
+
OPENAI_API_KEY: zodOpenapi.z.string().optional(),
|
|
96
|
+
GOOGLE_GENERATIVE_AI_API_KEY: zodOpenapi.z.string().optional(),
|
|
97
|
+
INKEEP_AGENTS_RUN_API_BYPASS_SECRET: zodOpenapi.z.string().optional(),
|
|
98
|
+
INKEEP_AGENTS_JWT_SIGNING_SECRET: zodOpenapi.z.string().optional(),
|
|
99
|
+
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY: zodOpenapi.z.string().optional(),
|
|
100
|
+
OTEL_BSP_SCHEDULE_DELAY: zodOpenapi.z.coerce.number().optional().default(500),
|
|
101
|
+
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: zodOpenapi.z.coerce.number().optional().default(64)
|
|
104
102
|
});
|
|
105
103
|
parseEnv = () => {
|
|
106
104
|
try {
|
|
107
105
|
return envSchema.parse(process.env);
|
|
108
106
|
} catch (error) {
|
|
109
|
-
if (error instanceof
|
|
107
|
+
if (error instanceof zodOpenapi.z.ZodError) {
|
|
110
108
|
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
111
109
|
throw new Error(
|
|
112
110
|
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
@@ -6244,11 +6242,11 @@ var init_execution_limits = __esm({
|
|
|
6244
6242
|
init_defaults();
|
|
6245
6243
|
init_defaults();
|
|
6246
6244
|
agentsCore.loadEnvironmentFiles();
|
|
6247
|
-
constantsSchema =
|
|
6245
|
+
constantsSchema = zodOpenapi.z.object(
|
|
6248
6246
|
Object.fromEntries(
|
|
6249
6247
|
Object.keys(executionLimitsDefaults).map((key) => [
|
|
6250
6248
|
`AGENTS_${key}`,
|
|
6251
|
-
|
|
6249
|
+
zodOpenapi.z.coerce.number().optional()
|
|
6252
6250
|
])
|
|
6253
6251
|
)
|
|
6254
6252
|
);
|
|
@@ -10533,12 +10531,12 @@ ${conversationHistory}
|
|
|
10533
10531
|
Previous updates sent to user:
|
|
10534
10532
|
${previousSummaries.map((s4, i3) => `${i3 + 1}. ${s4}`).join("\n")}
|
|
10535
10533
|
` : "";
|
|
10536
|
-
const selectionSchema =
|
|
10534
|
+
const selectionSchema = zodOpenapi.z.object(
|
|
10537
10535
|
Object.fromEntries([
|
|
10538
10536
|
[
|
|
10539
10537
|
"no_relevant_updates",
|
|
10540
|
-
|
|
10541
|
-
no_updates:
|
|
10538
|
+
zodOpenapi.z.object({
|
|
10539
|
+
no_updates: zodOpenapi.z.boolean().default(true)
|
|
10542
10540
|
}).optional().describe(
|
|
10543
10541
|
"Use when nothing substantially new to report. Should only use on its own."
|
|
10544
10542
|
)
|
|
@@ -10672,8 +10670,8 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
10672
10670
|
if (component.detailsSchema && "properties" in component.detailsSchema) {
|
|
10673
10671
|
return this.buildZodSchemaFromJson(component.detailsSchema);
|
|
10674
10672
|
}
|
|
10675
|
-
return
|
|
10676
|
-
label:
|
|
10673
|
+
return zodOpenapi.z.object({
|
|
10674
|
+
label: zodOpenapi.z.string().describe(
|
|
10677
10675
|
'A short 3-5 word phrase, that is a descriptive label for the update component. This Label must be EXTREMELY unique to represent the UNIQUE update we are providing. The ACTUAL finding or result, not the action. What specific information was discovered? (e.g., "Slack requires OAuth 2.0 setup", "Found 5 integration methods", "API rate limit is 100/minute"). Include the actual detail or insight, not just that you searched or processed. CRITICAL: Only use facts explicitly found in the activities - NEVER invent names, people, organizations, or details that are not present in the actual tool results.'
|
|
10678
10676
|
)
|
|
10679
10677
|
});
|
|
@@ -10683,56 +10681,56 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
10683
10681
|
*/
|
|
10684
10682
|
buildZodSchemaFromJson(jsonSchema) {
|
|
10685
10683
|
const properties = {};
|
|
10686
|
-
properties.label =
|
|
10684
|
+
properties.label = zodOpenapi.z.string().describe(
|
|
10687
10685
|
'A short 3-5 word phrase, that is a descriptive label for the update component. This Label must be EXTREMELY unique to represent the UNIQUE update we are providing. The SPECIFIC finding, result, or insight discovered (e.g., "Slack bot needs workspace admin role", "Found ingestion requires 3 steps", "Channel history limited to 10k messages"). State the ACTUAL information found, not that you searched. What did you LEARN or DISCOVER? What specific detail is now known? CRITICAL: Only use facts explicitly found in the activities - NEVER invent names, people, organizations, or details that are not present in the actual tool results.'
|
|
10688
10686
|
);
|
|
10689
10687
|
for (const [key, value] of Object.entries(jsonSchema.properties)) {
|
|
10690
10688
|
let zodType;
|
|
10691
10689
|
if (value.enum && Array.isArray(value.enum)) {
|
|
10692
10690
|
if (value.enum.length === 1) {
|
|
10693
|
-
zodType =
|
|
10691
|
+
zodType = zodOpenapi.z.literal(value.enum[0]);
|
|
10694
10692
|
} else {
|
|
10695
10693
|
const [first, ...rest] = value.enum;
|
|
10696
|
-
zodType =
|
|
10694
|
+
zodType = zodOpenapi.z.enum([first, ...rest]);
|
|
10697
10695
|
}
|
|
10698
10696
|
} else if (value.type === "string") {
|
|
10699
|
-
zodType =
|
|
10697
|
+
zodType = zodOpenapi.z.string();
|
|
10700
10698
|
if (value.minLength) zodType = zodType.min(value.minLength);
|
|
10701
10699
|
if (value.maxLength) zodType = zodType.max(value.maxLength);
|
|
10702
10700
|
if (value.format === "email") zodType = zodType.email();
|
|
10703
10701
|
if (value.format === "url" || value.format === "uri")
|
|
10704
10702
|
zodType = zodType.url();
|
|
10705
10703
|
} else if (value.type === "number" || value.type === "integer") {
|
|
10706
|
-
zodType = value.type === "integer" ?
|
|
10704
|
+
zodType = value.type === "integer" ? zodOpenapi.z.number().int() : zodOpenapi.z.number();
|
|
10707
10705
|
if (value.minimum !== void 0) zodType = zodType.min(value.minimum);
|
|
10708
10706
|
if (value.maximum !== void 0) zodType = zodType.max(value.maximum);
|
|
10709
10707
|
} else if (value.type === "boolean") {
|
|
10710
|
-
zodType =
|
|
10708
|
+
zodType = zodOpenapi.z.boolean();
|
|
10711
10709
|
} else if (value.type === "array") {
|
|
10712
10710
|
if (value.items) {
|
|
10713
10711
|
if (value.items.enum && Array.isArray(value.items.enum)) {
|
|
10714
10712
|
const [first, ...rest] = value.items.enum;
|
|
10715
|
-
zodType =
|
|
10713
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.enum([first, ...rest]));
|
|
10716
10714
|
} else if (value.items.type === "string") {
|
|
10717
|
-
zodType =
|
|
10715
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.string());
|
|
10718
10716
|
} else if (value.items.type === "number") {
|
|
10719
|
-
zodType =
|
|
10717
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.number());
|
|
10720
10718
|
} else if (value.items.type === "boolean") {
|
|
10721
|
-
zodType =
|
|
10719
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.boolean());
|
|
10722
10720
|
} else if (value.items.type === "object") {
|
|
10723
|
-
zodType =
|
|
10721
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.any()));
|
|
10724
10722
|
} else {
|
|
10725
|
-
zodType =
|
|
10723
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.any());
|
|
10726
10724
|
}
|
|
10727
10725
|
} else {
|
|
10728
|
-
zodType =
|
|
10726
|
+
zodType = zodOpenapi.z.array(zodOpenapi.z.any());
|
|
10729
10727
|
}
|
|
10730
10728
|
if (value.minItems) zodType = zodType.min(value.minItems);
|
|
10731
10729
|
if (value.maxItems) zodType = zodType.max(value.maxItems);
|
|
10732
10730
|
} else if (value.type === "object") {
|
|
10733
|
-
zodType =
|
|
10731
|
+
zodType = zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.any());
|
|
10734
10732
|
} else {
|
|
10735
|
-
zodType =
|
|
10733
|
+
zodType = zodOpenapi.z.any();
|
|
10736
10734
|
}
|
|
10737
10735
|
if (value.description) {
|
|
10738
10736
|
zodType = zodType.describe(value.description);
|
|
@@ -10742,7 +10740,7 @@ ${this.statusUpdateState?.config.prompt?.trim() || ""}`;
|
|
|
10742
10740
|
}
|
|
10743
10741
|
properties[key] = zodType;
|
|
10744
10742
|
}
|
|
10745
|
-
return
|
|
10743
|
+
return zodOpenapi.z.object(properties);
|
|
10746
10744
|
}
|
|
10747
10745
|
/**
|
|
10748
10746
|
* Extract user-visible activities with rich formatting and complete information
|
|
@@ -10973,9 +10971,9 @@ Make it specific and relevant.`;
|
|
|
10973
10971
|
};
|
|
10974
10972
|
} else {
|
|
10975
10973
|
const model = agentsCore.ModelFactory.createModel(modelToUse);
|
|
10976
|
-
const schema2 =
|
|
10977
|
-
name:
|
|
10978
|
-
description:
|
|
10974
|
+
const schema2 = zodOpenapi.z.object({
|
|
10975
|
+
name: zodOpenapi.z.string().describe("Concise, descriptive name for the artifact"),
|
|
10976
|
+
description: zodOpenapi.z.string().describe("Brief description of the artifact's relevance to the user's question")
|
|
10979
10977
|
});
|
|
10980
10978
|
const { object } = await tracer.startActiveSpan(
|
|
10981
10979
|
"agent_session.generate_artifact_metadata",
|
|
@@ -12111,7 +12109,7 @@ var logger12 = agentsCore.getLogger("DataComponentSchema");
|
|
|
12111
12109
|
function jsonSchemaToZod(jsonSchema) {
|
|
12112
12110
|
if (!jsonSchema || typeof jsonSchema !== "object") {
|
|
12113
12111
|
logger12.warn({ jsonSchema }, "Invalid JSON schema provided, using string fallback");
|
|
12114
|
-
return
|
|
12112
|
+
return zodOpenapi.z.string();
|
|
12115
12113
|
}
|
|
12116
12114
|
switch (jsonSchema.type) {
|
|
12117
12115
|
case "object":
|
|
@@ -12120,22 +12118,22 @@ function jsonSchemaToZod(jsonSchema) {
|
|
|
12120
12118
|
for (const [key, prop] of Object.entries(jsonSchema.properties)) {
|
|
12121
12119
|
shape[key] = jsonSchemaToZod(prop);
|
|
12122
12120
|
}
|
|
12123
|
-
return
|
|
12121
|
+
return zodOpenapi.z.object(shape);
|
|
12124
12122
|
}
|
|
12125
|
-
return
|
|
12123
|
+
return zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown());
|
|
12126
12124
|
case "array": {
|
|
12127
|
-
const itemSchema = jsonSchema.items ? jsonSchemaToZod(jsonSchema.items) :
|
|
12128
|
-
return
|
|
12125
|
+
const itemSchema = jsonSchema.items ? jsonSchemaToZod(jsonSchema.items) : zodOpenapi.z.unknown();
|
|
12126
|
+
return zodOpenapi.z.array(itemSchema);
|
|
12129
12127
|
}
|
|
12130
12128
|
case "string":
|
|
12131
|
-
return
|
|
12129
|
+
return zodOpenapi.z.string();
|
|
12132
12130
|
case "number":
|
|
12133
12131
|
case "integer":
|
|
12134
|
-
return
|
|
12132
|
+
return zodOpenapi.z.number();
|
|
12135
12133
|
case "boolean":
|
|
12136
|
-
return
|
|
12134
|
+
return zodOpenapi.z.boolean();
|
|
12137
12135
|
case "null":
|
|
12138
|
-
return
|
|
12136
|
+
return zodOpenapi.z.null();
|
|
12139
12137
|
default:
|
|
12140
12138
|
logger12.warn(
|
|
12141
12139
|
{
|
|
@@ -12144,7 +12142,7 @@ function jsonSchemaToZod(jsonSchema) {
|
|
|
12144
12142
|
},
|
|
12145
12143
|
"Unsupported JSON schema type, using unknown validation"
|
|
12146
12144
|
);
|
|
12147
|
-
return
|
|
12145
|
+
return zodOpenapi.z.unknown();
|
|
12148
12146
|
}
|
|
12149
12147
|
}
|
|
12150
12148
|
|
|
@@ -12391,9 +12389,9 @@ var ArtifactReferenceSchema = class _ArtifactReferenceSchema {
|
|
|
12391
12389
|
* Get the standard Zod schema for artifact reference components
|
|
12392
12390
|
*/
|
|
12393
12391
|
static getSchema() {
|
|
12394
|
-
return
|
|
12395
|
-
id:
|
|
12396
|
-
name:
|
|
12392
|
+
return zodOpenapi.z.object({
|
|
12393
|
+
id: zodOpenapi.z.string(),
|
|
12394
|
+
name: zodOpenapi.z.literal("Artifact"),
|
|
12397
12395
|
props: jsonSchemaToZod(_ArtifactReferenceSchema.ARTIFACT_PROPS_SCHEMA)
|
|
12398
12396
|
});
|
|
12399
12397
|
}
|
|
@@ -12444,9 +12442,9 @@ var ArtifactCreateSchema = class {
|
|
|
12444
12442
|
},
|
|
12445
12443
|
required: ["id", "tool_call_id", "type", "base_selector"]
|
|
12446
12444
|
};
|
|
12447
|
-
return
|
|
12448
|
-
id:
|
|
12449
|
-
name:
|
|
12445
|
+
return zodOpenapi.z.object({
|
|
12446
|
+
id: zodOpenapi.z.string(),
|
|
12447
|
+
name: zodOpenapi.z.literal(`ArtifactCreate_${component.name}`),
|
|
12450
12448
|
props: jsonSchemaToZod(propsSchema)
|
|
12451
12449
|
});
|
|
12452
12450
|
});
|
|
@@ -13231,7 +13229,7 @@ var createTransferToAgentTool = ({
|
|
|
13231
13229
|
const toolDescription = generateTransferToolDescription(transferConfig);
|
|
13232
13230
|
return ai.tool({
|
|
13233
13231
|
description: toolDescription,
|
|
13234
|
-
inputSchema:
|
|
13232
|
+
inputSchema: zodOpenapi.z.object({}),
|
|
13235
13233
|
execute: async () => {
|
|
13236
13234
|
const activeSpan = api.trace.getActiveSpan();
|
|
13237
13235
|
if (activeSpan) {
|
|
@@ -13286,7 +13284,7 @@ function createDelegateToAgentTool({
|
|
|
13286
13284
|
}) {
|
|
13287
13285
|
return ai.tool({
|
|
13288
13286
|
description: generateDelegateToolDescription(delegateConfig),
|
|
13289
|
-
inputSchema:
|
|
13287
|
+
inputSchema: zodOpenapi.z.object({ message: zodOpenapi.z.string() }),
|
|
13290
13288
|
execute: async (input, context) => {
|
|
13291
13289
|
const delegationId = `del_${agentsCore.generateId()}`;
|
|
13292
13290
|
const activeSpan = api.trace.getActiveSpan();
|
|
@@ -15646,9 +15644,9 @@ var Agent = class {
|
|
|
15646
15644
|
getArtifactTools() {
|
|
15647
15645
|
return ai.tool({
|
|
15648
15646
|
description: "Call this tool to get the complete artifact data with the given artifactId. This retrieves the full artifact content (not just the summary). Only use this when you need the complete artifact data and the summary shown in your context is insufficient.",
|
|
15649
|
-
inputSchema:
|
|
15650
|
-
artifactId:
|
|
15651
|
-
toolCallId:
|
|
15647
|
+
inputSchema: zodOpenapi.z.object({
|
|
15648
|
+
artifactId: zodOpenapi.z.string().describe("The unique identifier of the artifact to get."),
|
|
15649
|
+
toolCallId: zodOpenapi.z.string().describe("The tool call ID associated with this artifact.")
|
|
15652
15650
|
}),
|
|
15653
15651
|
execute: async ({ artifactId, toolCallId }) => {
|
|
15654
15652
|
logger19.info({ artifactId, toolCallId }, "get_artifact_full executed");
|
|
@@ -15675,9 +15673,9 @@ var Agent = class {
|
|
|
15675
15673
|
createThinkingCompleteTool() {
|
|
15676
15674
|
return ai.tool({
|
|
15677
15675
|
description: "\u{1F6A8} CRITICAL: Call this tool IMMEDIATELY when you have gathered enough information to answer the user. This is MANDATORY - you CANNOT provide text responses in thinking mode, only tool calls. Call thinking_complete as soon as you have sufficient data to generate a structured response.",
|
|
15678
|
-
inputSchema:
|
|
15679
|
-
complete:
|
|
15680
|
-
summary:
|
|
15676
|
+
inputSchema: zodOpenapi.z.object({
|
|
15677
|
+
complete: zodOpenapi.z.boolean().describe("ALWAYS set to true - marks end of research phase"),
|
|
15678
|
+
summary: zodOpenapi.z.string().describe(
|
|
15681
15679
|
"Brief summary of what information was gathered and why it is sufficient to answer the user"
|
|
15682
15680
|
)
|
|
15683
15681
|
}),
|
|
@@ -16368,9 +16366,9 @@ ${output}${structureHintsFormatted}`;
|
|
|
16368
16366
|
this.config.dataComponents.forEach((dc) => {
|
|
16369
16367
|
const propsSchema = jsonSchemaToZod(dc.props);
|
|
16370
16368
|
componentSchemas.push(
|
|
16371
|
-
|
|
16372
|
-
id:
|
|
16373
|
-
name:
|
|
16369
|
+
zodOpenapi.z.object({
|
|
16370
|
+
id: zodOpenapi.z.string(),
|
|
16371
|
+
name: zodOpenapi.z.literal(dc.name),
|
|
16374
16372
|
props: propsSchema
|
|
16375
16373
|
})
|
|
16376
16374
|
);
|
|
@@ -16387,7 +16385,7 @@ ${output}${structureHintsFormatted}`;
|
|
|
16387
16385
|
if (componentSchemas.length === 1) {
|
|
16388
16386
|
dataComponentsSchema = componentSchemas[0];
|
|
16389
16387
|
} else {
|
|
16390
|
-
dataComponentsSchema =
|
|
16388
|
+
dataComponentsSchema = zodOpenapi.z.union(
|
|
16391
16389
|
componentSchemas
|
|
16392
16390
|
);
|
|
16393
16391
|
}
|
|
@@ -16429,8 +16427,8 @@ ${output}${structureHintsFormatted}`;
|
|
|
16429
16427
|
const streamResult = ai.streamObject({
|
|
16430
16428
|
...structuredModelSettings,
|
|
16431
16429
|
messages: phase2Messages,
|
|
16432
|
-
schema:
|
|
16433
|
-
dataComponents:
|
|
16430
|
+
schema: zodOpenapi.z.object({
|
|
16431
|
+
dataComponents: zodOpenapi.z.array(dataComponentsSchema)
|
|
16434
16432
|
}),
|
|
16435
16433
|
experimental_telemetry: {
|
|
16436
16434
|
isEnabled: true,
|
|
@@ -16500,8 +16498,8 @@ ${output}${structureHintsFormatted}`;
|
|
|
16500
16498
|
withJsonPostProcessing2({
|
|
16501
16499
|
...structuredModelSettings,
|
|
16502
16500
|
messages: phase2Messages,
|
|
16503
|
-
schema:
|
|
16504
|
-
dataComponents:
|
|
16501
|
+
schema: zodOpenapi.z.object({
|
|
16502
|
+
dataComponents: zodOpenapi.z.array(dataComponentsSchema)
|
|
16505
16503
|
}),
|
|
16506
16504
|
experimental_telemetry: {
|
|
16507
16505
|
isEnabled: true,
|
|
@@ -17342,14 +17340,14 @@ app.openapi(
|
|
|
17342
17340
|
description: "Agent Card for A2A discovery",
|
|
17343
17341
|
content: {
|
|
17344
17342
|
"application/json": {
|
|
17345
|
-
schema:
|
|
17346
|
-
name:
|
|
17347
|
-
description:
|
|
17348
|
-
url:
|
|
17349
|
-
version:
|
|
17350
|
-
defaultInputModes:
|
|
17351
|
-
defaultOutputModes:
|
|
17352
|
-
skills:
|
|
17343
|
+
schema: zodOpenapi.z.object({
|
|
17344
|
+
name: zodOpenapi.z.string(),
|
|
17345
|
+
description: zodOpenapi.z.string().optional(),
|
|
17346
|
+
url: zodOpenapi.z.string(),
|
|
17347
|
+
version: zodOpenapi.z.string(),
|
|
17348
|
+
defaultInputModes: zodOpenapi.z.array(zodOpenapi.z.string()),
|
|
17349
|
+
defaultOutputModes: zodOpenapi.z.array(zodOpenapi.z.string()),
|
|
17350
|
+
skills: zodOpenapi.z.array(zodOpenapi.z.any())
|
|
17353
17351
|
})
|
|
17354
17352
|
}
|
|
17355
17353
|
}
|
|
@@ -18621,36 +18619,36 @@ var chatCompletionsRoute = zodOpenapi.createRoute({
|
|
|
18621
18619
|
body: {
|
|
18622
18620
|
content: {
|
|
18623
18621
|
"application/json": {
|
|
18624
|
-
schema:
|
|
18625
|
-
model:
|
|
18626
|
-
messages:
|
|
18627
|
-
|
|
18628
|
-
role:
|
|
18629
|
-
content:
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
type:
|
|
18634
|
-
text:
|
|
18622
|
+
schema: zodOpenapi.z.object({
|
|
18623
|
+
model: zodOpenapi.z.string().describe("The model to use for the completion"),
|
|
18624
|
+
messages: zodOpenapi.z.array(
|
|
18625
|
+
zodOpenapi.z.object({
|
|
18626
|
+
role: zodOpenapi.z.enum(["system", "user", "assistant", "function", "tool"]).describe("The role of the message"),
|
|
18627
|
+
content: zodOpenapi.z.union([
|
|
18628
|
+
zodOpenapi.z.string(),
|
|
18629
|
+
zodOpenapi.z.array(
|
|
18630
|
+
zodOpenapi.z.strictObject({
|
|
18631
|
+
type: zodOpenapi.z.string(),
|
|
18632
|
+
text: zodOpenapi.z.string().optional()
|
|
18635
18633
|
})
|
|
18636
18634
|
)
|
|
18637
18635
|
]).describe("The message content"),
|
|
18638
|
-
name:
|
|
18636
|
+
name: zodOpenapi.z.string().optional().describe("The name of the message sender")
|
|
18639
18637
|
})
|
|
18640
18638
|
).describe("The conversation messages"),
|
|
18641
|
-
temperature:
|
|
18642
|
-
top_p:
|
|
18643
|
-
n:
|
|
18644
|
-
stream:
|
|
18645
|
-
max_tokens:
|
|
18646
|
-
presence_penalty:
|
|
18647
|
-
frequency_penalty:
|
|
18648
|
-
logit_bias:
|
|
18649
|
-
user:
|
|
18650
|
-
conversationId:
|
|
18651
|
-
tools:
|
|
18652
|
-
runConfig:
|
|
18653
|
-
headers:
|
|
18639
|
+
temperature: zodOpenapi.z.number().optional().describe("Controls randomness (0-1)"),
|
|
18640
|
+
top_p: zodOpenapi.z.number().optional().describe("Controls nucleus sampling"),
|
|
18641
|
+
n: zodOpenapi.z.number().optional().describe("Number of completions to generate"),
|
|
18642
|
+
stream: zodOpenapi.z.boolean().optional().describe("Whether to stream the response"),
|
|
18643
|
+
max_tokens: zodOpenapi.z.number().optional().describe("Maximum tokens to generate"),
|
|
18644
|
+
presence_penalty: zodOpenapi.z.number().optional().describe("Presence penalty (-2 to 2)"),
|
|
18645
|
+
frequency_penalty: zodOpenapi.z.number().optional().describe("Frequency penalty (-2 to 2)"),
|
|
18646
|
+
logit_bias: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.number()).optional().describe("Token logit bias"),
|
|
18647
|
+
user: zodOpenapi.z.string().optional().describe("User identifier"),
|
|
18648
|
+
conversationId: zodOpenapi.z.string().optional().describe("Conversation ID for multi-turn chat"),
|
|
18649
|
+
tools: zodOpenapi.z.array(zodOpenapi.z.string()).optional().describe("Available tools"),
|
|
18650
|
+
runConfig: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional().describe("Run configuration"),
|
|
18651
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional().describe(
|
|
18654
18652
|
"Headers data for template processing (validated against context config schema)"
|
|
18655
18653
|
)
|
|
18656
18654
|
})
|
|
@@ -18661,14 +18659,14 @@ var chatCompletionsRoute = zodOpenapi.createRoute({
|
|
|
18661
18659
|
responses: {
|
|
18662
18660
|
200: {
|
|
18663
18661
|
description: "Streaming chat completion response in Server-Sent Events format",
|
|
18664
|
-
headers:
|
|
18665
|
-
"Content-Type":
|
|
18666
|
-
"Cache-Control":
|
|
18667
|
-
Connection:
|
|
18662
|
+
headers: zodOpenapi.z.object({
|
|
18663
|
+
"Content-Type": zodOpenapi.z.string().default("text/event-stream"),
|
|
18664
|
+
"Cache-Control": zodOpenapi.z.string().default("no-cache"),
|
|
18665
|
+
Connection: zodOpenapi.z.string().default("keep-alive")
|
|
18668
18666
|
}),
|
|
18669
18667
|
content: {
|
|
18670
18668
|
"text/event-stream": {
|
|
18671
|
-
schema:
|
|
18669
|
+
schema: zodOpenapi.z.string().describe("Server-Sent Events stream with chat completion chunks")
|
|
18672
18670
|
}
|
|
18673
18671
|
}
|
|
18674
18672
|
},
|
|
@@ -18676,13 +18674,13 @@ var chatCompletionsRoute = zodOpenapi.createRoute({
|
|
|
18676
18674
|
description: "Invalid request context or parameters",
|
|
18677
18675
|
content: {
|
|
18678
18676
|
"application/json": {
|
|
18679
|
-
schema:
|
|
18680
|
-
error:
|
|
18681
|
-
details:
|
|
18682
|
-
|
|
18683
|
-
field:
|
|
18684
|
-
message:
|
|
18685
|
-
value:
|
|
18677
|
+
schema: zodOpenapi.z.object({
|
|
18678
|
+
error: zodOpenapi.z.string(),
|
|
18679
|
+
details: zodOpenapi.z.array(
|
|
18680
|
+
zodOpenapi.z.object({
|
|
18681
|
+
field: zodOpenapi.z.string(),
|
|
18682
|
+
message: zodOpenapi.z.string(),
|
|
18683
|
+
value: zodOpenapi.z.unknown().optional()
|
|
18686
18684
|
})
|
|
18687
18685
|
).optional()
|
|
18688
18686
|
})
|
|
@@ -18693,8 +18691,8 @@ var chatCompletionsRoute = zodOpenapi.createRoute({
|
|
|
18693
18691
|
description: "Agent or agent not found",
|
|
18694
18692
|
content: {
|
|
18695
18693
|
"application/json": {
|
|
18696
|
-
schema:
|
|
18697
|
-
error:
|
|
18694
|
+
schema: zodOpenapi.z.object({
|
|
18695
|
+
error: zodOpenapi.z.string()
|
|
18698
18696
|
})
|
|
18699
18697
|
}
|
|
18700
18698
|
}
|
|
@@ -18703,9 +18701,9 @@ var chatCompletionsRoute = zodOpenapi.createRoute({
|
|
|
18703
18701
|
description: "Internal server error",
|
|
18704
18702
|
content: {
|
|
18705
18703
|
"application/json": {
|
|
18706
|
-
schema:
|
|
18707
|
-
error:
|
|
18708
|
-
message:
|
|
18704
|
+
schema: zodOpenapi.z.object({
|
|
18705
|
+
error: zodOpenapi.z.string(),
|
|
18706
|
+
message: zodOpenapi.z.string()
|
|
18709
18707
|
})
|
|
18710
18708
|
}
|
|
18711
18709
|
}
|
|
@@ -19556,7 +19554,7 @@ var getServer = async (headers2, executionContext, conversationId, credentialSto
|
|
|
19556
19554
|
"send-query-to-agent",
|
|
19557
19555
|
`Send a query to the ${agent.name} agent. The agent has the following description: ${agent.description}`,
|
|
19558
19556
|
{
|
|
19559
|
-
query:
|
|
19557
|
+
query: zodOpenapi.z.string().describe("The query to send to the agent")
|
|
19560
19558
|
},
|
|
19561
19559
|
async ({ query }) => {
|
|
19562
19560
|
try {
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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-QOUOKHYQ.js';
|
|
2
|
+
import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-BQB27EXW.js';
|
|
3
|
+
import { dbClient_default } from './chunk-W6UIBREL.js';
|
|
4
|
+
import { env } from './chunk-CDYXP4BN.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-SUUSOBLI.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
|
-
import { OpenAPIHono, createRoute, z
|
|
9
|
+
import { OpenAPIHono, createRoute, z } from '@hono/zod-openapi';
|
|
10
10
|
import { trace, propagation, context, SpanStatusCode } from '@opentelemetry/api';
|
|
11
11
|
import { Hono } from 'hono';
|
|
12
12
|
import { cors } from 'hono/cors';
|
|
@@ -14,7 +14,6 @@ import { HTTPException } from 'hono/http-exception';
|
|
|
14
14
|
import { requestId } from 'hono/request-id';
|
|
15
15
|
import { createMiddleware } from 'hono/factory';
|
|
16
16
|
import { swaggerUI } from '@hono/swagger-ui';
|
|
17
|
-
import z5, { z } from 'zod';
|
|
18
17
|
import { streamSSE, stream } from 'hono/streaming';
|
|
19
18
|
import { createUIMessageStream, JsonToSseTransformStream, parsePartialJson, generateObject, tool, streamText, generateText, streamObject } from 'ai';
|
|
20
19
|
import jmespath from 'jmespath';
|
|
@@ -5580,7 +5579,7 @@ var createTransferToAgentTool = ({
|
|
|
5580
5579
|
const toolDescription = generateTransferToolDescription(transferConfig);
|
|
5581
5580
|
return tool({
|
|
5582
5581
|
description: toolDescription,
|
|
5583
|
-
inputSchema:
|
|
5582
|
+
inputSchema: z.object({}),
|
|
5584
5583
|
execute: async () => {
|
|
5585
5584
|
const activeSpan = trace.getActiveSpan();
|
|
5586
5585
|
if (activeSpan) {
|
|
@@ -5635,7 +5634,7 @@ function createDelegateToAgentTool({
|
|
|
5635
5634
|
}) {
|
|
5636
5635
|
return tool({
|
|
5637
5636
|
description: generateDelegateToolDescription(delegateConfig),
|
|
5638
|
-
inputSchema:
|
|
5637
|
+
inputSchema: z.object({ message: z.string() }),
|
|
5639
5638
|
execute: async (input, context) => {
|
|
5640
5639
|
const delegationId = `del_${generateId()}`;
|
|
5641
5640
|
const activeSpan = trace.getActiveSpan();
|
|
@@ -7653,7 +7652,7 @@ var Agent = class {
|
|
|
7653
7652
|
if (functionToolsData.length === 0) {
|
|
7654
7653
|
return functionTools;
|
|
7655
7654
|
}
|
|
7656
|
-
const { SandboxExecutorFactory } = await import('./SandboxExecutorFactory-
|
|
7655
|
+
const { SandboxExecutorFactory } = await import('./SandboxExecutorFactory-A2LTPE2X.js');
|
|
7657
7656
|
const sandboxExecutor = SandboxExecutorFactory.getInstance();
|
|
7658
7657
|
for (const functionToolDef of functionToolsData) {
|
|
7659
7658
|
const functionId = functionToolDef.functionId;
|
|
@@ -7947,7 +7946,7 @@ var Agent = class {
|
|
|
7947
7946
|
inputSchema: tool3.inputSchema || tool3.parameters || {},
|
|
7948
7947
|
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."
|
|
7949
7948
|
}));
|
|
7950
|
-
const { getConversationScopedArtifacts } = await import('./conversations-
|
|
7949
|
+
const { getConversationScopedArtifacts } = await import('./conversations-33GSAG2C.js');
|
|
7951
7950
|
const historyConfig = this.config.conversationHistoryConfig ?? createDefaultConversationHistoryConfig();
|
|
7952
7951
|
const referenceArtifacts = await getConversationScopedArtifacts({
|
|
7953
7952
|
tenantId: this.config.tenantId,
|
|
@@ -11297,29 +11296,29 @@ var chatDataStreamRoute = createRoute({
|
|
|
11297
11296
|
body: {
|
|
11298
11297
|
content: {
|
|
11299
11298
|
"application/json": {
|
|
11300
|
-
schema: z
|
|
11301
|
-
model: z
|
|
11302
|
-
messages: z
|
|
11303
|
-
z
|
|
11304
|
-
role: z
|
|
11305
|
-
content: z
|
|
11306
|
-
parts: z
|
|
11307
|
-
z
|
|
11308
|
-
type: z
|
|
11309
|
-
z
|
|
11310
|
-
z
|
|
11299
|
+
schema: z.object({
|
|
11300
|
+
model: z.string().optional(),
|
|
11301
|
+
messages: z.array(
|
|
11302
|
+
z.object({
|
|
11303
|
+
role: z.enum(["system", "user", "assistant", "function", "tool"]),
|
|
11304
|
+
content: z.any(),
|
|
11305
|
+
parts: z.array(
|
|
11306
|
+
z.object({
|
|
11307
|
+
type: z.union([
|
|
11308
|
+
z.enum(["text", "image", "audio", "video", "file"]),
|
|
11309
|
+
z.string().regex(/^data-/, 'Type must start with "data-"')
|
|
11311
11310
|
]),
|
|
11312
|
-
text: z
|
|
11311
|
+
text: z.string().optional()
|
|
11313
11312
|
})
|
|
11314
11313
|
).optional()
|
|
11315
11314
|
})
|
|
11316
11315
|
),
|
|
11317
|
-
id: z
|
|
11318
|
-
conversationId: z
|
|
11319
|
-
stream: z
|
|
11320
|
-
max_tokens: z
|
|
11321
|
-
headers: z
|
|
11322
|
-
runConfig: z
|
|
11316
|
+
id: z.string().optional(),
|
|
11317
|
+
conversationId: z.string().optional(),
|
|
11318
|
+
stream: z.boolean().optional().describe("Whether to stream the response").default(true),
|
|
11319
|
+
max_tokens: z.number().optional().describe("Maximum tokens to generate"),
|
|
11320
|
+
headers: z.record(z.string(), z.unknown()).optional().describe("Headers data for template processing"),
|
|
11321
|
+
runConfig: z.record(z.string(), z.unknown()).optional().describe("Run configuration")
|
|
11323
11322
|
})
|
|
11324
11323
|
}
|
|
11325
11324
|
}
|
|
@@ -11328,9 +11327,9 @@ var chatDataStreamRoute = createRoute({
|
|
|
11328
11327
|
responses: {
|
|
11329
11328
|
200: {
|
|
11330
11329
|
description: "Streamed chat completion",
|
|
11331
|
-
headers: z
|
|
11332
|
-
"Content-Type": z
|
|
11333
|
-
"x-vercel-ai-data-stream": z
|
|
11330
|
+
headers: z.object({
|
|
11331
|
+
"Content-Type": z.string().default("text/plain; charset=utf-8"),
|
|
11332
|
+
"x-vercel-ai-data-stream": z.string().default("v1")
|
|
11334
11333
|
})
|
|
11335
11334
|
},
|
|
11336
11335
|
...commonGetErrorResponses
|
|
@@ -11543,11 +11542,11 @@ var toolApprovalRoute = createRoute({
|
|
|
11543
11542
|
body: {
|
|
11544
11543
|
content: {
|
|
11545
11544
|
"application/json": {
|
|
11546
|
-
schema: z
|
|
11547
|
-
conversationId: z
|
|
11548
|
-
toolCallId: z
|
|
11549
|
-
approved: z
|
|
11550
|
-
reason: z
|
|
11545
|
+
schema: z.object({
|
|
11546
|
+
conversationId: z.string().describe("The conversation ID"),
|
|
11547
|
+
toolCallId: z.string().describe("The tool call ID to respond to"),
|
|
11548
|
+
approved: z.boolean().describe("Whether the tool execution is approved"),
|
|
11549
|
+
reason: z.string().optional().describe("Optional reason for the decision")
|
|
11551
11550
|
})
|
|
11552
11551
|
}
|
|
11553
11552
|
}
|
|
@@ -11558,9 +11557,9 @@ var toolApprovalRoute = createRoute({
|
|
|
11558
11557
|
description: "Tool approval response processed successfully",
|
|
11559
11558
|
content: {
|
|
11560
11559
|
"application/json": {
|
|
11561
|
-
schema: z
|
|
11562
|
-
success: z
|
|
11563
|
-
message: z
|
|
11560
|
+
schema: z.object({
|
|
11561
|
+
success: z.boolean(),
|
|
11562
|
+
message: z.string().optional()
|
|
11564
11563
|
})
|
|
11565
11564
|
}
|
|
11566
11565
|
}
|
|
@@ -11569,8 +11568,8 @@ var toolApprovalRoute = createRoute({
|
|
|
11569
11568
|
description: "Bad request - invalid tool call ID or conversation ID",
|
|
11570
11569
|
content: {
|
|
11571
11570
|
"application/json": {
|
|
11572
|
-
schema: z
|
|
11573
|
-
error: z
|
|
11571
|
+
schema: z.object({
|
|
11572
|
+
error: z.string()
|
|
11574
11573
|
})
|
|
11575
11574
|
}
|
|
11576
11575
|
}
|
|
@@ -11579,8 +11578,8 @@ var toolApprovalRoute = createRoute({
|
|
|
11579
11578
|
description: "Tool call not found or already processed",
|
|
11580
11579
|
content: {
|
|
11581
11580
|
"application/json": {
|
|
11582
|
-
schema: z
|
|
11583
|
-
error: z
|
|
11581
|
+
schema: z.object({
|
|
11582
|
+
error: z.string()
|
|
11584
11583
|
})
|
|
11585
11584
|
}
|
|
11586
11585
|
}
|
|
@@ -11589,9 +11588,9 @@ var toolApprovalRoute = createRoute({
|
|
|
11589
11588
|
description: "Internal server error",
|
|
11590
11589
|
content: {
|
|
11591
11590
|
"application/json": {
|
|
11592
|
-
schema: z
|
|
11593
|
-
error: z
|
|
11594
|
-
message: z
|
|
11591
|
+
schema: z.object({
|
|
11592
|
+
error: z.string(),
|
|
11593
|
+
message: z.string()
|
|
11595
11594
|
})
|
|
11596
11595
|
}
|
|
11597
11596
|
}
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -10,33 +10,33 @@ var sdkNode = require('@opentelemetry/sdk-node');
|
|
|
10
10
|
var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
|
11
11
|
var semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
12
12
|
var agentsCore = require('@inkeep/agents-core');
|
|
13
|
-
var
|
|
13
|
+
var zodOpenapi = require('@hono/zod-openapi');
|
|
14
14
|
|
|
15
15
|
// src/instrumentation.ts
|
|
16
16
|
agentsCore.loadEnvironmentFiles();
|
|
17
|
-
var envSchema =
|
|
18
|
-
NODE_ENV:
|
|
19
|
-
ENVIRONMENT:
|
|
20
|
-
DATABASE_URL:
|
|
21
|
-
INKEEP_AGENTS_RUN_API_URL:
|
|
22
|
-
AGENTS_MANAGE_UI_URL:
|
|
23
|
-
LOG_LEVEL:
|
|
24
|
-
NANGO_SERVER_URL:
|
|
25
|
-
NANGO_SECRET_KEY:
|
|
26
|
-
ANTHROPIC_API_KEY:
|
|
27
|
-
OPENAI_API_KEY:
|
|
28
|
-
GOOGLE_GENERATIVE_AI_API_KEY:
|
|
29
|
-
INKEEP_AGENTS_RUN_API_BYPASS_SECRET:
|
|
30
|
-
INKEEP_AGENTS_JWT_SIGNING_SECRET:
|
|
31
|
-
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY:
|
|
32
|
-
OTEL_BSP_SCHEDULE_DELAY:
|
|
33
|
-
OTEL_BSP_MAX_EXPORT_BATCH_SIZE:
|
|
17
|
+
var envSchema = zodOpenapi.z.object({
|
|
18
|
+
NODE_ENV: zodOpenapi.z.enum(["development", "production", "test"]).optional(),
|
|
19
|
+
ENVIRONMENT: zodOpenapi.z.enum(["development", "production", "pentest", "test"]).optional().default("development"),
|
|
20
|
+
DATABASE_URL: zodOpenapi.z.string().optional(),
|
|
21
|
+
INKEEP_AGENTS_RUN_API_URL: zodOpenapi.z.string().optional().default("http://localhost:3003"),
|
|
22
|
+
AGENTS_MANAGE_UI_URL: zodOpenapi.z.string().optional().default("http://localhost:3000"),
|
|
23
|
+
LOG_LEVEL: zodOpenapi.z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
|
|
24
|
+
NANGO_SERVER_URL: zodOpenapi.z.string().optional().default("https://api.nango.dev"),
|
|
25
|
+
NANGO_SECRET_KEY: zodOpenapi.z.string().optional(),
|
|
26
|
+
ANTHROPIC_API_KEY: zodOpenapi.z.string(),
|
|
27
|
+
OPENAI_API_KEY: zodOpenapi.z.string().optional(),
|
|
28
|
+
GOOGLE_GENERATIVE_AI_API_KEY: zodOpenapi.z.string().optional(),
|
|
29
|
+
INKEEP_AGENTS_RUN_API_BYPASS_SECRET: zodOpenapi.z.string().optional(),
|
|
30
|
+
INKEEP_AGENTS_JWT_SIGNING_SECRET: zodOpenapi.z.string().optional(),
|
|
31
|
+
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY: zodOpenapi.z.string().optional(),
|
|
32
|
+
OTEL_BSP_SCHEDULE_DELAY: zodOpenapi.z.coerce.number().optional().default(500),
|
|
33
|
+
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: zodOpenapi.z.coerce.number().optional().default(64)
|
|
34
34
|
});
|
|
35
35
|
var parseEnv = () => {
|
|
36
36
|
try {
|
|
37
37
|
return envSchema.parse(process.env);
|
|
38
38
|
} catch (error) {
|
|
39
|
-
if (error instanceof
|
|
39
|
+
if (error instanceof zodOpenapi.z.ZodError) {
|
|
40
40
|
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
41
41
|
throw new Error(
|
|
42
42
|
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
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-QOUOKHYQ.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-20251125185858",
|
|
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",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"@hono/node-server": "^1.14.3",
|
|
25
25
|
"@hono/otel": "^0.4.0",
|
|
26
26
|
"@hono/swagger-ui": "^0.5.1",
|
|
27
|
-
"@hono/zod-openapi": "^1.0.2",
|
|
28
27
|
"@openrouter/ai-sdk-provider": "^1.2.0",
|
|
29
28
|
"@opentelemetry/api": "^1.9.0",
|
|
30
29
|
"@opentelemetry/auto-instrumentations-node": "^0.64.1",
|
|
@@ -54,8 +53,11 @@
|
|
|
54
53
|
"pino": "^9.11.0",
|
|
55
54
|
"traverse": "^0.6.11",
|
|
56
55
|
"ts-pattern": "^5.7.1",
|
|
57
|
-
"
|
|
58
|
-
|
|
56
|
+
"@inkeep/agents-core": "^0.0.0-dev-20251125185858"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@hono/zod-openapi": "^1.1.5",
|
|
60
|
+
"zod": "^4.1.11"
|
|
59
61
|
},
|
|
60
62
|
"optionalDependencies": {
|
|
61
63
|
"keytar": "^7.9.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { dbClient_default as default } from './chunk-V4RNZ6BX.js';
|