@inkeep/agents-api 0.45.2 → 0.46.0
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/.well-known/workflow/v1/manifest.debug.json +6 -6
- package/dist/.well-known/workflow/v1/step.cjs +28 -62
- package/dist/createApp.d.ts +2 -2
- package/dist/createApp.js +3 -1
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/services/EvaluationService.js +3 -42
- package/dist/domains/evals/workflow/routes.d.ts +2 -2
- package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/invitations.d.ts +2 -2
- package/dist/domains/manage/routes/mcp.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/userOrganizations.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/run/a2a/client.d.ts +2 -0
- package/dist/domains/run/a2a/client.js +7 -5
- package/dist/domains/run/agents/Agent.js +4 -5
- package/dist/domains/run/agents/relationTools.js +3 -1
- package/dist/domains/run/agents/versions/v1/Phase1Config.js +1 -2
- package/dist/domains/run/handlers/executionHandler.js +12 -8
- package/dist/domains/run/services/AgentSession.js +1 -1
- package/dist/domains/run/utils/artifact-component-schema.d.ts +1 -5
- package/dist/domains/run/utils/artifact-component-schema.js +3 -38
- package/dist/domains/run/utils/schema-validation.d.ts +1 -19
- package/dist/domains/run/utils/schema-validation.js +1 -60
- package/dist/env.d.ts +2 -0
- package/dist/env.js +1 -0
- package/dist/factory.d.ts +21 -21
- package/dist/factory.js +1 -0
- package/dist/index.d.ts +20 -20
- package/dist/middleware/cors.d.ts +7 -2
- package/dist/middleware/cors.js +17 -2
- package/dist/middleware/evalsAuth.d.ts +2 -2
- package/dist/middleware/manageAuth.d.ts +2 -2
- package/dist/middleware/projectAccess.d.ts +2 -2
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/requirePermission.d.ts +2 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/sessionAuth.d.ts +3 -3
- package/dist/middleware/tenantAccess.d.ts +2 -2
- package/dist/middleware/tracing.d.ts +3 -3
- package/dist/utils/in-process-fetch.d.ts +22 -0
- package/dist/utils/in-process-fetch.js +32 -0
- package/package.json +6 -6
- package/dist/domains/run/utils/data-component-schema.d.ts +0 -2
- package/dist/domains/run/utils/data-component-schema.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"steps": {
|
|
3
|
-
"node_modules/.pnpm/workflow@4.0.1-beta.33_@aws-sdk+client-sts@3.970.0_@opentelemetry+api@1.9.0_@types+
|
|
3
|
+
"node_modules/.pnpm/workflow@4.0.1-beta.33_@aws-sdk+client-sts@3.970.0_@opentelemetry+api@1.9.0_@types+reac_162752afbc89dc886082698201e5b45d/node_modules/workflow/dist/internal/builtins.js": {
|
|
4
4
|
"__builtin_response_array_buffer": {
|
|
5
5
|
"stepId": "__builtin_response_array_buffer"
|
|
6
6
|
},
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"workflows": {
|
|
44
|
-
"src/domains/evals/workflow/functions/runDatasetItem.ts": {
|
|
45
|
-
"_runDatasetItemWorkflow": {
|
|
46
|
-
"workflowId": "workflow//src/domains/evals/workflow/functions/runDatasetItem.ts//_runDatasetItemWorkflow"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
44
|
"src/domains/evals/workflow/functions/evaluateConversation.ts": {
|
|
50
45
|
"_evaluateConversationWorkflow": {
|
|
51
46
|
"workflowId": "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
|
|
52
47
|
}
|
|
48
|
+
},
|
|
49
|
+
"src/domains/evals/workflow/functions/runDatasetItem.ts": {
|
|
50
|
+
"_runDatasetItemWorkflow": {
|
|
51
|
+
"workflowId": "workflow//src/domains/evals/workflow/functions/runDatasetItem.ts//_runDatasetItemWorkflow"
|
|
52
|
+
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -117196,7 +117196,7 @@ function getStepFunction(stepId) {
|
|
|
117196
117196
|
}
|
|
117197
117197
|
__name(getStepFunction, "getStepFunction");
|
|
117198
117198
|
|
|
117199
|
-
// ../node_modules/.pnpm/workflow@4.0.1-beta.33_@aws-sdk+client-sts@3.970.0_@opentelemetry+api@1.9.0_@types+
|
|
117199
|
+
// ../node_modules/.pnpm/workflow@4.0.1-beta.33_@aws-sdk+client-sts@3.970.0_@opentelemetry+api@1.9.0_@types+reac_162752afbc89dc886082698201e5b45d/node_modules/workflow/dist/internal/builtins.js
|
|
117200
117200
|
async function __builtin_response_array_buffer(res) {
|
|
117201
117201
|
return res.arrayBuffer();
|
|
117202
117202
|
}
|
|
@@ -127187,10 +127187,10 @@ var workAppGitHubMcpToolRepositoryAccessRelations = relations(workAppGitHubMcpTo
|
|
|
127187
127187
|
})
|
|
127188
127188
|
}));
|
|
127189
127189
|
|
|
127190
|
-
// ../node_modules/.pnpm/@hono+zod-openapi@1.2.0_hono@4.11.
|
|
127190
|
+
// ../node_modules/.pnpm/@hono+zod-openapi@1.2.0_hono@4.11.7_zod@4.3.6/node_modules/@hono/zod-openapi/dist/index.js
|
|
127191
127191
|
var import_zod_to_openapi = __toESM(require_dist(), 1);
|
|
127192
127192
|
|
|
127193
|
-
// ../node_modules/.pnpm/hono@4.11.
|
|
127193
|
+
// ../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/url.js
|
|
127194
127194
|
var tryDecode = /* @__PURE__ */ __name((str2, decoder) => {
|
|
127195
127195
|
try {
|
|
127196
127196
|
return decoder(str2);
|
|
@@ -127283,10 +127283,10 @@ var getQueryParams = /* @__PURE__ */ __name((url4, key) => {
|
|
|
127283
127283
|
}, "getQueryParams");
|
|
127284
127284
|
var decodeURIComponent_ = decodeURIComponent;
|
|
127285
127285
|
|
|
127286
|
-
// ../node_modules/.pnpm/hono@4.11.
|
|
127286
|
+
// ../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/request/constants.js
|
|
127287
127287
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
127288
127288
|
|
|
127289
|
-
// ../node_modules/.pnpm/hono@4.11.
|
|
127289
|
+
// ../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/utils/body.js
|
|
127290
127290
|
var parseBody = /* @__PURE__ */ __name(async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
127291
127291
|
const { all: all3 = false, dot = false } = options;
|
|
127292
127292
|
const headers2 = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
@@ -127365,7 +127365,7 @@ var handleParsingNestedValues = /* @__PURE__ */ __name((form, key, value) => {
|
|
|
127365
127365
|
});
|
|
127366
127366
|
}, "handleParsingNestedValues");
|
|
127367
127367
|
|
|
127368
|
-
// ../node_modules/.pnpm/hono@4.11.
|
|
127368
|
+
// ../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/request.js
|
|
127369
127369
|
var tryDecodeURIComponent = /* @__PURE__ */ __name((str2) => tryDecode(str2, decodeURIComponent_), "tryDecodeURIComponent");
|
|
127370
127370
|
var HonoRequest = class {
|
|
127371
127371
|
static {
|
|
@@ -127638,7 +127638,7 @@ var HonoRequest = class {
|
|
|
127638
127638
|
}
|
|
127639
127639
|
};
|
|
127640
127640
|
|
|
127641
|
-
// ../node_modules/.pnpm/hono@4.11.
|
|
127641
|
+
// ../node_modules/.pnpm/hono@4.11.7/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
127642
127642
|
var regExpMetaChars = new Set(".\\+*[^]$()");
|
|
127643
127643
|
|
|
127644
127644
|
// ../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
@@ -142640,7 +142640,7 @@ __name(date5, "date");
|
|
|
142640
142640
|
// ../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
142641
142641
|
config(en_default());
|
|
142642
142642
|
|
|
142643
|
-
// ../node_modules/.pnpm/@hono+zod-openapi@1.2.0_hono@4.11.
|
|
142643
|
+
// ../node_modules/.pnpm/@hono+zod-openapi@1.2.0_hono@4.11.7_zod@4.3.6/node_modules/@hono/zod-openapi/dist/index.js
|
|
142644
142644
|
(0, import_zod_to_openapi.extendZodWithOpenApi)(external_exports);
|
|
142645
142645
|
|
|
142646
142646
|
// ../packages/agents-core/dist/validation/dolt-schemas.js
|
|
@@ -145069,7 +145069,7 @@ crypto2 = globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL
|
|
|
145069
145069
|
globalThis.crypto ?? // Node.js >18
|
|
145070
145070
|
import("node:crypto").then((m4) => m4.webcrypto);
|
|
145071
145071
|
|
|
145072
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.
|
|
145072
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.7_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
145073
145073
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
145074
145074
|
var JSONRPC_VERSION = "2.0";
|
|
145075
145075
|
var AssertObjectSchema = custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
|
|
@@ -146655,7 +146655,7 @@ var ServerResultSchema = union2([
|
|
|
146655
146655
|
CreateTaskResultSchema
|
|
146656
146656
|
]);
|
|
146657
146657
|
|
|
146658
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.
|
|
146658
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.7_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
146659
146659
|
var SafeUrlSchema = url().superRefine((val, ctx) => {
|
|
146660
146660
|
if (!URL.canParse(val)) {
|
|
146661
146661
|
ctx.addIssue({
|
|
@@ -146800,7 +146800,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
146800
146800
|
token_type_hint: string2().optional()
|
|
146801
146801
|
}).strip();
|
|
146802
146802
|
|
|
146803
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.
|
|
146803
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.7_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
|
|
146804
146804
|
var OAuthError = class extends Error {
|
|
146805
146805
|
static {
|
|
146806
146806
|
__name(this, "OAuthError");
|
|
@@ -147101,6 +147101,7 @@ var envSchema = external_exports.object({
|
|
|
147101
147101
|
OAUTH_PROXY_PRODUCTION_URL: external_exports.string().optional().describe("OAuth proxy URL for production environment (used in local/preview environments)"),
|
|
147102
147102
|
INKEEP_AGENTS_MANAGE_UI_URL: external_exports.string().optional().describe("URL where the management UI is hosted"),
|
|
147103
147103
|
INKEEP_AGENTS_API_URL: external_exports.string().optional().describe("URL where the agents management API is running"),
|
|
147104
|
+
AUTH_COOKIE_DOMAIN: external_exports.string().optional().describe("Explicit cookie domain for cross-subdomain auth (e.g., .inkeep.com). Required when the API and UI do not share a common 3-part parent domain."),
|
|
147104
147105
|
GITHUB_MCP_API_KEY: external_exports.string().optional().describe("API key for the GitHub MCP")
|
|
147105
147106
|
});
|
|
147106
147107
|
var parseEnv = /* @__PURE__ */ __name(() => {
|
|
@@ -197260,7 +197261,7 @@ var logger13 = getLogger("JsonTransformer");
|
|
|
197260
197261
|
// ../packages/agents-core/dist/utils/json-parser.js
|
|
197261
197262
|
var import_traverse = __toESM(require_traverse(), 1);
|
|
197262
197263
|
|
|
197263
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.
|
|
197264
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.7_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
197264
197265
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
197265
197266
|
var import_ajv_formats = __toESM(require_dist3(), 1);
|
|
197266
197267
|
|
|
@@ -228778,6 +228779,7 @@ var envSchema2 = external_exports.object({
|
|
|
228778
228779
|
INKEEP_AGENTS_RUN_DATABASE_URL: external_exports.string().describe("PostgreSQL connection URL for the runtime database (Doltgres with Git version control)"),
|
|
228779
228780
|
INKEEP_AGENTS_MANAGE_UI_URL: external_exports.string().optional().describe("URL where the management UI is hosted"),
|
|
228780
228781
|
INKEEP_AGENTS_API_URL: external_exports.string().optional().default("http://localhost:3002").describe("URL where the agents management API is running"),
|
|
228782
|
+
AUTH_COOKIE_DOMAIN: external_exports.string().optional().describe("Explicit cookie domain for cross-subdomain auth (e.g., .inkeep.com). Required when the API and UI do not share a common 3-part parent domain."),
|
|
228781
228783
|
// Authentication
|
|
228782
228784
|
BETTER_AUTH_SECRET: external_exports.string().optional().describe("Secret key for Better Auth session encryption (change in production)"),
|
|
228783
228785
|
INKEEP_AGENTS_MANAGE_UI_USERNAME: external_exports.string().optional().refine((val) => !val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
|
|
@@ -228855,57 +228857,21 @@ var runDbClient = createAgentsRunDatabaseClient({
|
|
|
228855
228857
|
});
|
|
228856
228858
|
var runDbClient_default = runDbClient;
|
|
228857
228859
|
|
|
228858
|
-
// src/
|
|
228859
|
-
var
|
|
228860
|
-
function
|
|
228861
|
-
if (!
|
|
228862
|
-
|
|
228863
|
-
|
|
228864
|
-
}, "Invalid JSON schema provided, using string fallback");
|
|
228865
|
-
return external_exports.string();
|
|
228866
|
-
}
|
|
228867
|
-
switch (jsonSchema3.type) {
|
|
228868
|
-
case "object":
|
|
228869
|
-
if (jsonSchema3.properties) {
|
|
228870
|
-
const shape = {};
|
|
228871
|
-
const required3 = jsonSchema3.required || [];
|
|
228872
|
-
for (const [key, prop] of Object.entries(jsonSchema3.properties)) {
|
|
228873
|
-
const propSchema = prop;
|
|
228874
|
-
let zodType = jsonSchemaToZod3(propSchema);
|
|
228875
|
-
if (propSchema.description) {
|
|
228876
|
-
zodType = zodType.describe(String(propSchema.description));
|
|
228877
|
-
}
|
|
228878
|
-
if (!required3.includes(key)) {
|
|
228879
|
-
zodType = zodType.optional();
|
|
228880
|
-
}
|
|
228881
|
-
shape[key] = zodType;
|
|
228882
|
-
}
|
|
228883
|
-
return external_exports.object(shape);
|
|
228884
|
-
}
|
|
228885
|
-
return external_exports.record(external_exports.string(), external_exports.unknown());
|
|
228886
|
-
case "array": {
|
|
228887
|
-
const itemSchema = jsonSchema3.items ? jsonSchemaToZod3(jsonSchema3.items) : external_exports.unknown();
|
|
228888
|
-
return external_exports.array(itemSchema);
|
|
228860
|
+
// src/utils/in-process-fetch.ts
|
|
228861
|
+
var _appFetch;
|
|
228862
|
+
function getInProcessFetch() {
|
|
228863
|
+
if (!_appFetch) {
|
|
228864
|
+
if (process.env.ENVIRONMENT === "test") {
|
|
228865
|
+
return fetch;
|
|
228889
228866
|
}
|
|
228890
|
-
|
|
228891
|
-
return external_exports.string();
|
|
228892
|
-
case "number":
|
|
228893
|
-
return external_exports.number();
|
|
228894
|
-
case "integer":
|
|
228895
|
-
return external_exports.number().int();
|
|
228896
|
-
case "boolean":
|
|
228897
|
-
return external_exports.boolean();
|
|
228898
|
-
case "null":
|
|
228899
|
-
return external_exports.null();
|
|
228900
|
-
default:
|
|
228901
|
-
logger21.warn({
|
|
228902
|
-
unsupportedType: jsonSchema3.type,
|
|
228903
|
-
schema: jsonSchema3
|
|
228904
|
-
}, "Unsupported JSON schema type, using unknown validation");
|
|
228905
|
-
return external_exports.unknown();
|
|
228867
|
+
throw new Error("[in-process-fetch] App fetch not registered. Call registerAppFetch() during app initialization before handling requests.");
|
|
228906
228868
|
}
|
|
228869
|
+
return _appFetch;
|
|
228907
228870
|
}
|
|
228908
|
-
__name(
|
|
228871
|
+
__name(getInProcessFetch, "getInProcessFetch");
|
|
228872
|
+
|
|
228873
|
+
// src/domains/evals/services/EvaluationService.ts
|
|
228874
|
+
var logger21 = getLogger("EvaluationService");
|
|
228909
228875
|
var EvaluationService = class {
|
|
228910
228876
|
static {
|
|
228911
228877
|
__name(this, "EvaluationService");
|
|
@@ -228998,7 +228964,7 @@ var EvaluationService = class {
|
|
|
228998
228964
|
datasetRunId,
|
|
228999
228965
|
conversationId
|
|
229000
228966
|
}, "Running dataset item through chat API");
|
|
229001
|
-
const response = await
|
|
228967
|
+
const response = await getInProcessFetch()(chatUrl, {
|
|
229002
228968
|
method: "POST",
|
|
229003
228969
|
headers: headers2,
|
|
229004
228970
|
body: JSON.stringify(chatPayload)
|
|
@@ -229652,7 +229618,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229652
229618
|
const providerOptions = modelConfig?.providerOptions || {};
|
|
229653
229619
|
let resultSchema;
|
|
229654
229620
|
try {
|
|
229655
|
-
resultSchema =
|
|
229621
|
+
resultSchema = external_exports.fromJSONSchema(schema);
|
|
229656
229622
|
logger21.info({
|
|
229657
229623
|
schemaType: typeof schema,
|
|
229658
229624
|
schemaKeys: schema && typeof schema === "object" ? Object.keys(schema) : [],
|
package/dist/createApp.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AppConfig } from "./types/app.js";
|
|
2
2
|
import "./types/index.js";
|
|
3
3
|
import { Hono } from "hono";
|
|
4
|
-
import * as
|
|
4
|
+
import * as hono_types9 from "hono/types";
|
|
5
5
|
|
|
6
6
|
//#region src/createApp.d.ts
|
|
7
7
|
declare const isWebhookRoute: (path: string) => boolean;
|
|
8
|
-
declare function createAgentsHono(config: AppConfig): Hono<
|
|
8
|
+
declare function createAgentsHono(config: AppConfig): Hono<hono_types9.BlankEnv, hono_types9.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { createAgentsHono, isWebhookRoute };
|
package/dist/createApp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getLogger as getLogger$1 } from "./logger.js";
|
|
2
2
|
import { env } from "./env.js";
|
|
3
|
+
import { getInProcessFetch, registerAppFetch } from "./utils/in-process-fetch.js";
|
|
3
4
|
import { evalRoutes } from "./domains/evals/index.js";
|
|
4
5
|
import { workflowRoutes } from "./domains/evals/workflow/routes.js";
|
|
5
6
|
import { sessionAuth, sessionContext } from "./middleware/sessionAuth.js";
|
|
@@ -181,7 +182,7 @@ function createAgentsHono(config) {
|
|
|
181
182
|
headers: new Headers(c.req.raw.headers),
|
|
182
183
|
body: bodyBuffer
|
|
183
184
|
});
|
|
184
|
-
return
|
|
185
|
+
return getInProcessFetch()(forwardedRequest);
|
|
185
186
|
});
|
|
186
187
|
app.route("/evals", evalRoutes);
|
|
187
188
|
app.route("/work-apps/github", githubRoutes);
|
|
@@ -193,6 +194,7 @@ function createAgentsHono(config) {
|
|
|
193
194
|
});
|
|
194
195
|
const base = new Hono();
|
|
195
196
|
base.route("/", app);
|
|
197
|
+
registerAppFetch(base.request.bind(base));
|
|
196
198
|
return base;
|
|
197
199
|
}
|
|
198
200
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono3 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/datasetTriggers.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono3.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono5 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono5.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -3,6 +3,7 @@ import { env } from "../../../env.js";
|
|
|
3
3
|
import manageDbClient_default from "../../../data/db/manageDbClient.js";
|
|
4
4
|
import manageDbPool_default from "../../../data/db/manageDbPool.js";
|
|
5
5
|
import runDbClient_default from "../../../data/db/runDbClient.js";
|
|
6
|
+
import { getInProcessFetch } from "../../../utils/in-process-fetch.js";
|
|
6
7
|
import { ModelFactory, createEvaluationResult, createEvaluationRun, filterConversationsForJob, generateId, getConversationHistory, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluatorById, getFullAgent, getProjectScopedRef, resolveRef, updateEvaluationResult, withRef } from "@inkeep/agents-core";
|
|
7
8
|
import { generateObject, generateText } from "ai";
|
|
8
9
|
import { z } from "zod";
|
|
@@ -10,46 +11,6 @@ import { z } from "zod";
|
|
|
10
11
|
//#region src/domains/evals/services/EvaluationService.ts
|
|
11
12
|
const logger = getLogger$1("EvaluationService");
|
|
12
13
|
/**
|
|
13
|
-
* Converts JSON Schema objects to Zod schema types
|
|
14
|
-
*/
|
|
15
|
-
function jsonSchemaToZod(jsonSchema) {
|
|
16
|
-
if (!jsonSchema || typeof jsonSchema !== "object") {
|
|
17
|
-
logger.warn({ jsonSchema }, "Invalid JSON schema provided, using string fallback");
|
|
18
|
-
return z.string();
|
|
19
|
-
}
|
|
20
|
-
switch (jsonSchema.type) {
|
|
21
|
-
case "object":
|
|
22
|
-
if (jsonSchema.properties) {
|
|
23
|
-
const shape = {};
|
|
24
|
-
const required = jsonSchema.required || [];
|
|
25
|
-
for (const [key, prop] of Object.entries(jsonSchema.properties)) {
|
|
26
|
-
const propSchema = prop;
|
|
27
|
-
let zodType = jsonSchemaToZod(propSchema);
|
|
28
|
-
if (propSchema.description) zodType = zodType.describe(String(propSchema.description));
|
|
29
|
-
if (!required.includes(key)) zodType = zodType.optional();
|
|
30
|
-
shape[key] = zodType;
|
|
31
|
-
}
|
|
32
|
-
return z.object(shape);
|
|
33
|
-
}
|
|
34
|
-
return z.record(z.string(), z.unknown());
|
|
35
|
-
case "array": {
|
|
36
|
-
const itemSchema = jsonSchema.items ? jsonSchemaToZod(jsonSchema.items) : z.unknown();
|
|
37
|
-
return z.array(itemSchema);
|
|
38
|
-
}
|
|
39
|
-
case "string": return z.string();
|
|
40
|
-
case "number": return z.number();
|
|
41
|
-
case "integer": return z.number().int();
|
|
42
|
-
case "boolean": return z.boolean();
|
|
43
|
-
case "null": return z.null();
|
|
44
|
-
default:
|
|
45
|
-
logger.warn({
|
|
46
|
-
unsupportedType: jsonSchema.type,
|
|
47
|
-
schema: jsonSchema
|
|
48
|
-
}, "Unsupported JSON schema type, using unknown validation");
|
|
49
|
-
return z.unknown();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
14
|
* Service for running dataset items through the chat API endpoint
|
|
54
15
|
*/
|
|
55
16
|
var EvaluationService = class {
|
|
@@ -126,7 +87,7 @@ var EvaluationService = class {
|
|
|
126
87
|
datasetRunId,
|
|
127
88
|
conversationId
|
|
128
89
|
}, "Running dataset item through chat API");
|
|
129
|
-
const response = await
|
|
90
|
+
const response = await getInProcessFetch()(chatUrl, {
|
|
130
91
|
method: "POST",
|
|
131
92
|
headers: headers$1,
|
|
132
93
|
body: JSON.stringify(chatPayload)
|
|
@@ -698,7 +659,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
698
659
|
const providerOptions = modelConfig?.providerOptions || {};
|
|
699
660
|
let resultSchema;
|
|
700
661
|
try {
|
|
701
|
-
resultSchema =
|
|
662
|
+
resultSchema = z.fromJSONSchema(schema);
|
|
702
663
|
logger.info({
|
|
703
664
|
schemaType: typeof schema,
|
|
704
665
|
schemaKeys: schema && typeof schema === "object" ? Object.keys(schema) : [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types7 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/workflow/routes.d.ts
|
|
5
|
-
declare const workflowRoutes: Hono<
|
|
5
|
+
declare const workflowRoutes: Hono<hono_types7.BlankEnv, hono_types7.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { workflowRoutes };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono8 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/availableAgents.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono8.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono16 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/conversations.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono16.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono2 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono2.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import * as
|
|
3
|
+
import * as hono_types0 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/invitations.d.ts
|
|
6
6
|
declare const invitationsRoutes: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types0.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { invitationsRoutes as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types0 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/mcp.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import * as
|
|
3
|
+
import * as hono_types2 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/signoz.d.ts
|
|
6
6
|
declare const app: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types2.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { app as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import * as
|
|
3
|
+
import * as hono_types11 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/userOrganizations.d.ts
|
|
6
6
|
declare const userOrganizationsRoutes: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types11.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { userOrganizationsRoutes as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types12 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/mcp/routes/mcp.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types12.BlankEnv, hono_types12.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -20,6 +20,7 @@ interface A2AClientOptions {
|
|
|
20
20
|
retryConfig?: RetryConfig;
|
|
21
21
|
ref?: ResolvedRef;
|
|
22
22
|
headers?: Record<string, string>;
|
|
23
|
+
fetchFn?: typeof fetch;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* A2AClient is a TypeScript HTTP client for interacting with A2A-compliant agents.
|
|
@@ -64,6 +65,7 @@ declare class A2AClient {
|
|
|
64
65
|
private requestIdCounter;
|
|
65
66
|
private serviceEndpointUrl?;
|
|
66
67
|
private options;
|
|
68
|
+
private fetchFn;
|
|
67
69
|
/**
|
|
68
70
|
* Constructs an A2AClient instance.
|
|
69
71
|
* It initiates fetching the agent card from the provided agent baseUrl.
|
|
@@ -82,6 +82,7 @@ var A2AClient = class {
|
|
|
82
82
|
requestIdCounter = 1;
|
|
83
83
|
serviceEndpointUrl;
|
|
84
84
|
options;
|
|
85
|
+
fetchFn;
|
|
85
86
|
/**
|
|
86
87
|
* Constructs an A2AClient instance.
|
|
87
88
|
* It initiates fetching the agent card from the provided agent baseUrl.
|
|
@@ -92,6 +93,7 @@ var A2AClient = class {
|
|
|
92
93
|
*/
|
|
93
94
|
constructor(agentBaseUrl, options) {
|
|
94
95
|
this.agentBaseUrl = agentBaseUrl.replace(/\/$/, "");
|
|
96
|
+
this.fetchFn = options?.fetchFn ?? fetch;
|
|
95
97
|
this.options = {
|
|
96
98
|
retryConfig: {
|
|
97
99
|
strategy: "backoff",
|
|
@@ -117,7 +119,7 @@ var A2AClient = class {
|
|
|
117
119
|
agentBaseUrl: this.agentBaseUrl
|
|
118
120
|
}, "agentCardUrl");
|
|
119
121
|
try {
|
|
120
|
-
const response = await
|
|
122
|
+
const response = await this.fetchFn(url.toString(), { headers: {
|
|
121
123
|
Accept: "application/json",
|
|
122
124
|
...this.options.headers || {}
|
|
123
125
|
} });
|
|
@@ -144,7 +146,7 @@ var A2AClient = class {
|
|
|
144
146
|
const agentCardUrl = `${agentBaseUrl.replace(/\/$/, "")}/.well-known/agent.json`;
|
|
145
147
|
const url = new URL(agentCardUrl);
|
|
146
148
|
if (this.options.ref) url.searchParams.set("ref", this.options.ref.name);
|
|
147
|
-
const response = await
|
|
149
|
+
const response = await this.fetchFn(url.toString(), { headers: {
|
|
148
150
|
Accept: "application/json",
|
|
149
151
|
...this.options.headers || {}
|
|
150
152
|
} });
|
|
@@ -284,7 +286,7 @@ var A2AClient = class {
|
|
|
284
286
|
id: requestId
|
|
285
287
|
};
|
|
286
288
|
const httpResponse = await this.retry(async () => {
|
|
287
|
-
return
|
|
289
|
+
return this.fetchFn(endpoint, {
|
|
288
290
|
method: "POST",
|
|
289
291
|
headers: {
|
|
290
292
|
"Content-Type": "application/json",
|
|
@@ -347,7 +349,7 @@ var A2AClient = class {
|
|
|
347
349
|
params,
|
|
348
350
|
id: clientRequestId
|
|
349
351
|
};
|
|
350
|
-
const response = await
|
|
352
|
+
const response = await this.fetchFn(endpoint, {
|
|
351
353
|
method: "POST",
|
|
352
354
|
headers: {
|
|
353
355
|
"Content-Type": "application/json",
|
|
@@ -422,7 +424,7 @@ var A2AClient = class {
|
|
|
422
424
|
params,
|
|
423
425
|
id: clientRequestId
|
|
424
426
|
};
|
|
425
|
-
const response = await
|
|
427
|
+
const response = await this.fetchFn(endpoint, {
|
|
426
428
|
method: "POST",
|
|
427
429
|
headers: {
|
|
428
430
|
"Content-Type": "application/json",
|
|
@@ -18,7 +18,6 @@ import { pendingToolApprovalManager } from "../services/PendingToolApprovalManag
|
|
|
18
18
|
import { ResponseFormatter } from "../services/ResponseFormatter.js";
|
|
19
19
|
import { toolApprovalUiBus } from "../services/ToolApprovalUiBus.js";
|
|
20
20
|
import { generateToolId } from "../utils/agent-operations.js";
|
|
21
|
-
import { jsonSchemaToZod } from "../utils/data-component-schema.js";
|
|
22
21
|
import { ArtifactCreateSchema, ArtifactReferenceSchema } from "../utils/artifact-component-schema.js";
|
|
23
22
|
import { withJsonPostProcessing } from "../utils/json-postprocessor.js";
|
|
24
23
|
import { calculateBreakdownTotal, estimateTokens } from "../utils/token-estimator.js";
|
|
@@ -824,7 +823,7 @@ var Agent = class {
|
|
|
824
823
|
}, "Function not found in functions table");
|
|
825
824
|
continue;
|
|
826
825
|
}
|
|
827
|
-
const zodSchema =
|
|
826
|
+
const zodSchema = functionData.inputSchema ? z.fromJSONSchema(functionData.inputSchema) : z.string();
|
|
828
827
|
const toolPolicies = functionToolDef.toolPolicies;
|
|
829
828
|
const needsApproval = !!toolPolicies?.["*"]?.needsApproval || !!toolPolicies?.[functionToolDef.name]?.needsApproval;
|
|
830
829
|
const aiTool = tool({
|
|
@@ -1351,7 +1350,7 @@ var Agent = class {
|
|
|
1351
1350
|
}, "Processing tool override");
|
|
1352
1351
|
let inputSchema;
|
|
1353
1352
|
try {
|
|
1354
|
-
inputSchema = override.schema ?
|
|
1353
|
+
inputSchema = override.schema ? z.fromJSONSchema(override.schema) : toolDef.inputSchema;
|
|
1355
1354
|
} catch (schemaError) {
|
|
1356
1355
|
logger.error({
|
|
1357
1356
|
mcpToolName: mcpTool.name,
|
|
@@ -2120,8 +2119,8 @@ ${output}${structureHintsFormatted}`;
|
|
|
2120
2119
|
}
|
|
2121
2120
|
buildDataComponentsSchema() {
|
|
2122
2121
|
const componentSchemas = [];
|
|
2123
|
-
|
|
2124
|
-
const propsSchema =
|
|
2122
|
+
this.config.dataComponents?.forEach((dc) => {
|
|
2123
|
+
const propsSchema = dc.props ? z.fromJSONSchema(dc.props) : z.string();
|
|
2125
2124
|
componentSchemas.push(z.object({
|
|
2126
2125
|
id: z.string(),
|
|
2127
2126
|
name: z.literal(dc.name),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getLogger as getLogger$1 } from "../../../logger.js";
|
|
2
2
|
import manageDbPool_default from "../../../data/db/manageDbPool.js";
|
|
3
3
|
import runDbClient_default from "../../../data/db/runDbClient.js";
|
|
4
|
+
import { getInProcessFetch } from "../../../utils/in-process-fetch.js";
|
|
4
5
|
import { DELEGATION_TOOL_BACKOFF_EXPONENT, DELEGATION_TOOL_BACKOFF_INITIAL_INTERVAL_MS, DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS, DELEGATION_TOOL_BACKOFF_MAX_INTERVAL_MS } from "../constants/execution-limits/index.js";
|
|
5
6
|
import { toolSessionManager } from "./ToolSessionManager.js";
|
|
6
7
|
import { saveA2AMessageResponse } from "../data/conversations.js";
|
|
@@ -206,7 +207,8 @@ function createDelegateToAgentTool({ delegateConfig, callingAgentId, executionCo
|
|
|
206
207
|
exponent: DELEGATION_TOOL_BACKOFF_EXPONENT,
|
|
207
208
|
maxElapsedTime: DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS
|
|
208
209
|
}
|
|
209
|
-
}
|
|
210
|
+
},
|
|
211
|
+
...isInternal || isTeam ? { fetchFn: getInProcessFetch() } : {}
|
|
210
212
|
});
|
|
211
213
|
const messageToSend = {
|
|
212
214
|
role: "agent",
|
|
@@ -4,8 +4,7 @@ import thinking_preparation_default from "../../../../../templates/v1/phase1/thi
|
|
|
4
4
|
import tool_default from "../../../../../templates/v1/phase1/tool.js";
|
|
5
5
|
import artifact_default from "../../../../../templates/v1/shared/artifact.js";
|
|
6
6
|
import artifact_retrieval_guidance_default from "../../../../../templates/v1/shared/artifact-retrieval-guidance.js";
|
|
7
|
-
import { V1_BREAKDOWN_SCHEMA } from "@inkeep/agents-core";
|
|
8
|
-
import { convertZodToJsonSchema, isZodSchema } from "@inkeep/agents-core/utils/schema-conversion";
|
|
7
|
+
import { V1_BREAKDOWN_SCHEMA, convertZodToJsonSchema, isZodSchema } from "@inkeep/agents-core";
|
|
9
8
|
|
|
10
9
|
//#region src/domains/run/agents/versions/v1/Phase1Config.ts
|
|
11
10
|
var Phase1Config = class Phase1Config {
|