@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.
Files changed (30) hide show
  1. package/dist/.well-known/workflow/v1/flow.cjs +44 -44
  2. package/dist/.well-known/workflow/v1/flow.cjs.debug.json +2 -2
  3. package/dist/.well-known/workflow/v1/manifest.debug.json +14 -14
  4. package/dist/.well-known/workflow/v1/step.cjs +130 -130
  5. package/dist/.well-known/workflow/v1/step.cjs.debug.json +2 -2
  6. package/dist/_virtual/rolldown_runtime.js +7 -0
  7. package/dist/createApp.d.ts +2 -2
  8. package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
  9. package/dist/domains/evals/routes/index.d.ts +2 -2
  10. package/dist/domains/evals/workflow/routes.d.ts +2 -2
  11. package/dist/domains/github/index.d.ts +3 -3
  12. package/dist/domains/github/routes/tokenExchange.d.ts +2 -2
  13. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  14. package/dist/domains/manage/routes/evals/evaluationResults.d.ts +2 -2
  15. package/dist/domains/manage/routes/index.d.ts +2 -2
  16. package/dist/domains/manage/routes/mcp.d.ts +2 -2
  17. package/dist/domains/mcp/routes/mcp.d.ts +2 -2
  18. package/dist/domains/run/services/TriggerService.js +34 -30
  19. package/dist/factory.d.ts +262 -262
  20. package/dist/index.d.ts +261 -261
  21. package/dist/middleware/evalsAuth.d.ts +2 -2
  22. package/dist/middleware/manageAuth.d.ts +2 -2
  23. package/dist/middleware/projectAccess.d.ts +2 -2
  24. package/dist/middleware/projectConfig.d.ts +3 -3
  25. package/dist/middleware/requirePermission.d.ts +2 -2
  26. package/dist/middleware/runAuth.d.ts +4 -4
  27. package/dist/middleware/sessionAuth.d.ts +3 -3
  28. package/dist/middleware/tenantAccess.d.ts +2 -2
  29. package/dist/middleware/tracing.d.ts +3 -3
  30. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
1
  import { OpenAPIHono } from "@hono/zod-openapi";
2
- import * as hono18 from "hono";
2
+ import * as hono15 from "hono";
3
3
 
4
4
  //#region src/domains/manage/routes/conversations.d.ts
5
- declare const app: OpenAPIHono<hono18.Env, {}, "/">;
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 hono14 from "hono";
2
+ import * as hono17 from "hono";
3
3
 
4
4
  //#region src/domains/manage/routes/evals/evaluationResults.d.ts
5
- declare const app: OpenAPIHono<hono14.Env, {}, "/">;
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 hono17 from "hono";
2
+ import * as hono16 from "hono";
3
3
 
4
4
  //#region src/domains/manage/routes/index.d.ts
5
- declare const app: OpenAPIHono<hono17.Env, {}, "/">;
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 hono_types14 from "hono/types";
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<hono_types14.BlankEnv, hono_types14.BlankSchema, "/">;
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 hono_types16 from "hono/types";
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<hono_types16.BlankEnv, hono_types16.BlankSchema, "/">;
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 { ROOT_CONTEXT, SpanStatusCode, propagation, trace } from "@opentelemetry/api";
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 (process.env.VERCEL) import("@vercel/functions").then(({ waitUntil }) => {
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(ROOT_CONTEXT, baggage);
381
- return tracer.startActiveSpan("trigger.execute_async", { 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
- } }, ctxWithBaggage, async (span) => {
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,