@inkeep/agents-api 0.0.0-dev-20260128074647 → 0.0.0-dev-20260128152604
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/flow.cjs +44 -44
- package/dist/.well-known/workflow/v1/flow.cjs.debug.json +2 -2
- package/dist/.well-known/workflow/v1/manifest.debug.json +14 -14
- package/dist/.well-known/workflow/v1/step.cjs +130 -130
- package/dist/.well-known/workflow/v1/step.cjs.debug.json +2 -2
- package/dist/_virtual/rolldown_runtime.js +7 -0
- package/dist/createApp.d.ts +2 -2
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/workflow/routes.d.ts +2 -2
- package/dist/domains/github/index.d.ts +3 -3
- package/dist/domains/github/routes/tokenExchange.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/evals/evaluationResults.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/mcp.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/run/services/TriggerService.js +34 -30
- package/dist/factory.d.ts +262 -262
- package/dist/index.d.ts +261 -261
- 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/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono15 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/conversations.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono15.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 hono17 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/evals/evaluationResults.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono17.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/index.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 { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types11 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_types11.BlankEnv, hono_types11.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types5 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_types5.BlankEnv, hono_types5.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { __require } from "../../../_virtual/rolldown_runtime.js";
|
|
1
2
|
import { getLogger as getLogger$1 } from "../../../logger.js";
|
|
2
3
|
import { env } from "../../../env.js";
|
|
3
4
|
import manageDbPool_default from "../../../data/db/manageDbPool.js";
|
|
4
5
|
import runDbClient_default from "../../../data/db/runDbClient.js";
|
|
6
|
+
import { tracer } from "../utils/tracer.js";
|
|
5
7
|
import { flushBatchProcessor } from "../../../instrumentation.js";
|
|
6
8
|
import { createSSEStreamHelper } from "../utils/stream-helpers.js";
|
|
7
9
|
import { ExecutionHandler } from "../handlers/executionHandler.js";
|
|
8
10
|
import { DEFAULT_NANGO_STORE_ID, JsonTransformer, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createTriggerInvocation, generateId, getConversationId, getCredentialReference, getCredentialStoreLookupKeyFromRetrievalParams, getFullProjectWithRelationIds, getTriggerById, interpolateTemplate, setActiveAgentForConversation, updateTriggerInvocationStatus, verifySignatureWithConfig, verifyTriggerAuth, withRef } from "@inkeep/agents-core";
|
|
9
|
-
import {
|
|
11
|
+
import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
|
|
10
12
|
import Ajv from "ajv";
|
|
11
13
|
|
|
12
14
|
//#region src/domains/run/services/TriggerService.ts
|
|
15
|
+
let waitUntil;
|
|
16
|
+
if (process.env.VERCEL) try {
|
|
17
|
+
({waitUntil} = __require("@vercel/functions"));
|
|
18
|
+
} catch {}
|
|
13
19
|
const logger = getLogger$1("TriggerService");
|
|
14
20
|
const ajv = new Ajv({ allErrors: true });
|
|
15
21
|
const credentialCache = /* @__PURE__ */ new Map();
|
|
@@ -314,19 +320,6 @@ async function dispatchExecution(params) {
|
|
|
314
320
|
invocationId,
|
|
315
321
|
conversationId
|
|
316
322
|
}, "Trigger invocation created");
|
|
317
|
-
trace.getTracer("trigger-service").startSpan("trigger.message_received", { attributes: {
|
|
318
|
-
"tenant.id": tenantId,
|
|
319
|
-
"project.id": projectId,
|
|
320
|
-
"agent.id": agentId,
|
|
321
|
-
"trigger.id": triggerId,
|
|
322
|
-
"trigger.invocation.id": invocationId,
|
|
323
|
-
"conversation.id": conversationId,
|
|
324
|
-
"invocation.type": "trigger",
|
|
325
|
-
"message.content": userMessageText,
|
|
326
|
-
"message.timestamp": (/* @__PURE__ */ new Date()).toISOString(),
|
|
327
|
-
"message.parts": JSON.stringify(messageParts)
|
|
328
|
-
} }, ROOT_CONTEXT).end();
|
|
329
|
-
await flushBatchProcessor();
|
|
330
323
|
const executionPromise = executeAgentAsync({
|
|
331
324
|
tenantId,
|
|
332
325
|
projectId,
|
|
@@ -338,11 +331,7 @@ async function dispatchExecution(params) {
|
|
|
338
331
|
messageParts,
|
|
339
332
|
resolvedRef
|
|
340
333
|
});
|
|
341
|
-
if (
|
|
342
|
-
waitUntil(executionPromise);
|
|
343
|
-
}).catch((err) => {
|
|
344
|
-
logger.error({ err }, "Failed to import @vercel/functions");
|
|
345
|
-
});
|
|
334
|
+
if (waitUntil) waitUntil(executionPromise);
|
|
346
335
|
else executionPromise.catch((error) => {
|
|
347
336
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
348
337
|
const errorStack = error instanceof Error ? error.stack : void 0;
|
|
@@ -375,18 +364,33 @@ async function dispatchExecution(params) {
|
|
|
375
364
|
*/
|
|
376
365
|
async function executeAgentAsync(params) {
|
|
377
366
|
const { tenantId, projectId, agentId, triggerId, invocationId, conversationId, userMessage, messageParts, resolvedRef } = params;
|
|
378
|
-
const tracer = trace.getTracer("trigger-service");
|
|
379
367
|
const baggage = propagation.createBaggage().setEntry("conversation.id", { value: conversationId }).setEntry("tenant.id", { value: tenantId }).setEntry("project.id", { value: projectId }).setEntry("agent.id", { value: agentId });
|
|
380
|
-
const ctxWithBaggage = propagation.setBaggage(
|
|
381
|
-
return tracer.startActiveSpan("trigger.execute_async", {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
368
|
+
const ctxWithBaggage = propagation.setBaggage(context.active(), baggage);
|
|
369
|
+
return tracer.startActiveSpan("trigger.execute_async", {
|
|
370
|
+
root: true,
|
|
371
|
+
attributes: {
|
|
372
|
+
"tenant.id": tenantId,
|
|
373
|
+
"project.id": projectId,
|
|
374
|
+
"agent.id": agentId,
|
|
375
|
+
"trigger.id": triggerId,
|
|
376
|
+
"trigger.invocation.id": invocationId,
|
|
377
|
+
"conversation.id": conversationId,
|
|
378
|
+
"invocation.type": "trigger"
|
|
379
|
+
}
|
|
380
|
+
}, ctxWithBaggage, async (span) => {
|
|
381
|
+
tracer.startSpan("trigger.message_received", { attributes: {
|
|
382
|
+
"tenant.id": tenantId,
|
|
383
|
+
"project.id": projectId,
|
|
384
|
+
"agent.id": agentId,
|
|
385
|
+
"trigger.id": triggerId,
|
|
386
|
+
"trigger.invocation.id": invocationId,
|
|
387
|
+
"conversation.id": conversationId,
|
|
388
|
+
"invocation.type": "trigger",
|
|
389
|
+
"message.content": userMessage,
|
|
390
|
+
"message.timestamp": (/* @__PURE__ */ new Date()).toISOString(),
|
|
391
|
+
"message.parts": JSON.stringify(messageParts)
|
|
392
|
+
} }, context.active()).end();
|
|
393
|
+
await flushBatchProcessor();
|
|
390
394
|
logger.info({
|
|
391
395
|
tenantId,
|
|
392
396
|
projectId,
|