@inkeep/agents-api 0.0.0-dev-20260206214018 → 0.0.0-dev-20260207220105

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 (42) hide show
  1. package/dist/.well-known/workflow/v1/manifest.debug.json +19 -19
  2. package/dist/.well-known/workflow/v1/step.cjs +27 -26
  3. package/dist/createApp.d.ts +2 -2
  4. package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
  5. package/dist/domains/evals/routes/index.d.ts +2 -2
  6. package/dist/domains/evals/workflow/routes.d.ts +2 -2
  7. package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
  8. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  9. package/dist/domains/manage/routes/index.d.ts +2 -2
  10. package/dist/domains/manage/routes/invitations.d.ts +2 -2
  11. package/dist/domains/manage/routes/mcp.d.ts +2 -2
  12. package/dist/domains/manage/routes/passwordResetLinks.d.ts +2 -2
  13. package/dist/domains/manage/routes/signoz.d.ts +2 -2
  14. package/dist/domains/manage/routes/users.d.ts +2 -2
  15. package/dist/domains/mcp/routes/mcp.d.ts +2 -2
  16. package/dist/domains/run/agents/Agent.d.ts +41 -15
  17. package/dist/domains/run/agents/Agent.js +127 -281
  18. package/dist/domains/run/agents/generateTaskHandler.js +10 -5
  19. package/dist/domains/run/agents/types.d.ts +2 -1
  20. package/dist/domains/run/agents/versions/v1/{Phase1Config.d.ts → PromptConfig.d.ts} +5 -4
  21. package/dist/domains/run/agents/versions/v1/{Phase1Config.js → PromptConfig.js} +36 -19
  22. package/dist/factory.d.ts +20 -20
  23. package/dist/index.d.ts +18 -18
  24. package/dist/middleware/evalsAuth.d.ts +2 -2
  25. package/dist/middleware/manageAuth.d.ts +2 -2
  26. package/dist/middleware/projectConfig.d.ts +3 -3
  27. package/dist/middleware/requirePermission.d.ts +2 -2
  28. package/dist/middleware/runAuth.d.ts +4 -4
  29. package/dist/middleware/sessionAuth.d.ts +3 -3
  30. package/dist/middleware/tenantAccess.d.ts +2 -2
  31. package/dist/middleware/tracing.d.ts +3 -3
  32. package/dist/templates/v1/prompt/system-prompt.js +5 -0
  33. package/dist/templates/v1/{phase1 → prompt}/tool.js +1 -1
  34. package/dist/templates/v1/shared/artifact-retrieval-guidance.js +1 -1
  35. package/dist/templates/v1/{phase2 → shared}/data-component.js +1 -1
  36. package/dist/templates/v1/{phase2 → shared}/data-components.js +1 -1
  37. package/package.json +5 -5
  38. package/dist/domains/run/agents/versions/v1/Phase2Config.d.ts +0 -33
  39. package/dist/domains/run/agents/versions/v1/Phase2Config.js +0 -341
  40. package/dist/templates/v1/phase1/system-prompt.js +0 -5
  41. package/dist/templates/v1/phase1/thinking-preparation.js +0 -5
  42. package/dist/templates/v1/phase2/system-prompt.js +0 -5
@@ -1,19 +1,5 @@
1
1
  {
2
2
  "steps": {
3
- "src/domains/evals/workflow/functions/runDatasetItem.ts": {
4
- "callChatApiStep": {
5
- "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//callChatApiStep"
6
- },
7
- "createRelationStep": {
8
- "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//createRelationStep"
9
- },
10
- "executeEvaluatorStep": {
11
- "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//executeEvaluatorStep"
12
- },
13
- "logStep": {
14
- "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//logStep"
15
- }
16
- },
17
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": {
18
4
  "__builtin_response_array_buffer": {
19
5
  "stepId": "__builtin_response_array_buffer"
@@ -38,18 +24,32 @@
38
24
  "logStep": {
39
25
  "stepId": "step//src/domains/evals/workflow/functions/evaluateConversation.ts//logStep"
40
26
  }
27
+ },
28
+ "src/domains/evals/workflow/functions/runDatasetItem.ts": {
29
+ "callChatApiStep": {
30
+ "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//callChatApiStep"
31
+ },
32
+ "createRelationStep": {
33
+ "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//createRelationStep"
34
+ },
35
+ "executeEvaluatorStep": {
36
+ "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//executeEvaluatorStep"
37
+ },
38
+ "logStep": {
39
+ "stepId": "step//src/domains/evals/workflow/functions/runDatasetItem.ts//logStep"
40
+ }
41
41
  }
42
42
  },
43
43
  "workflows": {
44
- "src/domains/evals/workflow/functions/evaluateConversation.ts": {
45
- "_evaluateConversationWorkflow": {
46
- "workflowId": "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
47
- }
48
- },
49
44
  "src/domains/evals/workflow/functions/runDatasetItem.ts": {
50
45
  "_runDatasetItemWorkflow": {
51
46
  "workflowId": "workflow//src/domains/evals/workflow/functions/runDatasetItem.ts//_runDatasetItemWorkflow"
52
47
  }
48
+ },
49
+ "src/domains/evals/workflow/functions/evaluateConversation.ts": {
50
+ "_evaluateConversationWorkflow": {
51
+ "workflowId": "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
52
+ }
53
53
  }
54
54
  }
55
55
  }
@@ -117228,32 +117228,6 @@ var schemaValidationDefaults = {
117228
117228
  CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT: 1e4
117229
117229
  };
117230
117230
 
117231
- // ../packages/agents-core/dist/types/utility.js
117232
- var TOOL_STATUS_VALUES = [
117233
- "healthy",
117234
- "unhealthy",
117235
- "unknown",
117236
- "needs_auth",
117237
- "unavailable"
117238
- ];
117239
- var VALID_RELATION_TYPES = [
117240
- "transfer",
117241
- "delegate"
117242
- ];
117243
- var MCPTransportType = {
117244
- streamableHttp: "streamable_http",
117245
- sse: "sse"
117246
- };
117247
- var MCPServerType = {
117248
- nango: "nango",
117249
- generic: "generic"
117250
- };
117251
- var CredentialStoreType = {
117252
- memory: "memory",
117253
- keychain: "keychain",
117254
- nango: "nango"
117255
- };
117256
-
117257
117231
  // ../packages/agents-core/dist/_virtual/rolldown_runtime.js
117258
117232
  var __defProp2 = Object.defineProperty;
117259
117233
  var __exportAll = /* @__PURE__ */ __name((all3, symbols) => {
@@ -127194,6 +127168,32 @@ var workAppGitHubMcpToolRepositoryAccessRelations = relations(workAppGitHubMcpTo
127194
127168
  })
127195
127169
  }));
127196
127170
 
127171
+ // ../packages/agents-core/dist/types/utility.js
127172
+ var TOOL_STATUS_VALUES = [
127173
+ "healthy",
127174
+ "unhealthy",
127175
+ "unknown",
127176
+ "needs_auth",
127177
+ "unavailable"
127178
+ ];
127179
+ var VALID_RELATION_TYPES = [
127180
+ "transfer",
127181
+ "delegate"
127182
+ ];
127183
+ var MCPTransportType = {
127184
+ streamableHttp: "streamable_http",
127185
+ sse: "sse"
127186
+ };
127187
+ var MCPServerType = {
127188
+ nango: "nango",
127189
+ generic: "generic"
127190
+ };
127191
+ var CredentialStoreType = {
127192
+ memory: "memory",
127193
+ keychain: "keychain",
127194
+ nango: "nango"
127195
+ };
127196
+
127197
127197
  // ../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
127198
127198
  var import_zod_to_openapi = __toESM(require_dist(), 1);
127199
127199
 
@@ -144323,6 +144323,7 @@ var FetchDefinitionSchema = external_exports.object({
144323
144323
  }),
144324
144324
  credential: CredentialReferenceApiInsertSchema.optional()
144325
144325
  }).openapi("FetchDefinition");
144326
+ var HeadersSchema = external_exports.record(external_exports.string(), external_exports.string("All header values must be strings"), "Must be valid JSON object");
144326
144327
  var ContextConfigSelectSchema = createSelectSchema2(contextConfigs).extend({
144327
144328
  headersSchema: external_exports.any().optional().openapi({
144328
144329
  type: "object",
@@ -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 hono_types0 from "hono/types";
4
+ import * as hono_types1 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<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
8
+ declare function createAgentsHono(config: AppConfig): Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { createAgentsHono, isWebhookRoute };
@@ -1,7 +1,7 @@
1
1
  import { OpenAPIHono } from "@hono/zod-openapi";
2
- import * as hono14 from "hono";
2
+ import * as hono15 from "hono";
3
3
 
4
4
  //#region src/domains/evals/routes/datasetTriggers.d.ts
5
- declare const app: OpenAPIHono<hono14.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 hono15 from "hono";
2
+ import * as hono17 from "hono";
3
3
 
4
4
  //#region src/domains/evals/routes/index.d.ts
5
- declare const app: OpenAPIHono<hono15.Env, {}, "/">;
5
+ declare const app: OpenAPIHono<hono17.Env, {}, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types5 from "hono/types";
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<hono_types5.BlankEnv, hono_types5.BlankSchema, "/">;
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 hono16 from "hono";
2
+ import * as hono4 from "hono";
3
3
 
4
4
  //#region src/domains/manage/routes/availableAgents.d.ts
5
- declare const app: OpenAPIHono<hono16.Env, {}, "/">;
5
+ declare const app: OpenAPIHono<hono4.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 hono18 from "hono";
2
+ import * as hono16 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<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 hono17 from "hono";
2
+ import * as hono18 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<hono18.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 hono_types7 from "hono/types";
3
+ import * as hono_types13 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
- }, hono_types7.BlankSchema, "/">;
8
+ }, hono_types13.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { invitationsRoutes as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types8 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_types8.BlankEnv, hono_types8.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types11.BlankEnv, hono_types11.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 hono_types10 from "hono/types";
3
+ import * as hono_types9 from "hono/types";
4
4
 
5
5
  //#region src/domains/manage/routes/passwordResetLinks.d.ts
6
6
  declare const passwordResetLinksRoutes: Hono<{
7
7
  Variables: ManageAppVariables;
8
- }, hono_types10.BlankSchema, "/">;
8
+ }, hono_types9.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { passwordResetLinksRoutes as default };
@@ -1,10 +1,10 @@
1
1
  import { ManageAppVariables } from "../../../types/app.js";
2
2
  import { Hono } from "hono";
3
- import * as hono_types14 from "hono/types";
3
+ import * as hono_types10 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
- }, hono_types14.BlankSchema, "/">;
8
+ }, hono_types10.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 hono_types11 from "hono/types";
3
+ import * as hono_types14 from "hono/types";
4
4
 
5
5
  //#region src/domains/manage/routes/users.d.ts
6
6
  declare const usersRoutes: Hono<{
7
7
  Variables: ManageAppVariables;
8
- }, hono_types11.BlankSchema, "/">;
8
+ }, hono_types14.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { usersRoutes as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types12 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_types12.BlankEnv, hono_types12.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types5.BlankEnv, hono_types5.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { SandboxConfig } from "../types/executionContext.js";
2
2
  import { StreamHelper } from "../utils/stream-helpers.js";
3
- import { AgentConversationHistoryConfig, Artifact, ArtifactComponentApiInsert, CredentialStoreRegistry, DataComponentApiInsert, FullExecutionContext, McpTool, Models, ResolvedRef, SubAgentStopWhen } from "@inkeep/agents-core";
4
- import { ToolSet } from "ai";
3
+ import { AgentConversationHistoryConfig, Artifact, ArtifactComponentApiInsert, CredentialStoreRegistry, DataComponentApiInsert, FullExecutionContext, McpTool, MessageContent, Models, ResolvedRef, SubAgentStopWhen } from "@inkeep/agents-core";
4
+ import { FinishReason, StepResult, ToolSet } from "ai";
5
5
 
6
6
  //#region src/domains/run/agents/Agent.d.ts
7
7
 
@@ -15,6 +15,40 @@ declare function hasToolCallWithPrefix(prefix: string): ({
15
15
  }: {
16
16
  steps: Array<any>;
17
17
  }) => any;
18
+ /**
19
+ * Shape of a generation response after all Promise-based getters have been resolved.
20
+ *
21
+ * The AI SDK's `GenerateTextResult` and `StreamTextResult` classes expose properties
22
+ * like `text`, `steps`, `finishReason`, and `output` as **prototype getters** — not
23
+ * own enumerable properties. When one of these class instances is spread with `{ ...result }`,
24
+ * the spread operator copies only own enumerable properties and silently drops the getters,
25
+ * causing those fields to become `undefined` on the resulting plain object.
26
+ *
27
+ * This type represents the safely-resolved plain object produced by
28
+ * `resolveGenerationResponse`, where every needed getter has been awaited and
29
+ * assigned as a concrete own property.
30
+ */
31
+ interface ResolvedGenerationResponse {
32
+ steps: Array<StepResult<ToolSet>>;
33
+ text: string;
34
+ finishReason: FinishReason;
35
+ output?: any;
36
+ object?: any;
37
+ formattedContent?: MessageContent | null;
38
+ }
39
+ /**
40
+ * Resolves a generation response from either `generateText` or `streamText` into
41
+ * a plain object with all needed values as own properties.
42
+ *
43
+ * **Why this exists:** The AI SDK returns class instances whose key properties
44
+ * (`text`, `steps`, `finishReason`, `output`) are prototype getters.
45
+ * `StreamTextResult` getters return `PromiseLike` values; `GenerateTextResult`
46
+ * getters return direct values. In both cases, the spread operator `{ ...result }`
47
+ * silently drops them. This function uses `Promise.resolve()` to safely resolve
48
+ * both styles, then spreads them as explicit own properties so downstream code
49
+ * (and further spreads) never loses them.
50
+ */
51
+ declare function resolveGenerationResponse(response: Record<string, unknown>): Promise<ResolvedGenerationResponse>;
18
52
  type AgentConfig = {
19
53
  id: string;
20
54
  tenantId: string;
@@ -112,7 +146,7 @@ declare class Agent {
112
146
  */
113
147
  private sanitizeToolsForAISDK;
114
148
  /**
115
- * Get the primary model settings for text generation and thinking
149
+ * Get the primary model settings for text generation
116
150
  * Requires model to be configured at project level
117
151
  */
118
152
  private getPrimaryModel;
@@ -186,14 +220,11 @@ declare class Agent {
186
220
  */
187
221
  private hasAgentArtifactComponents;
188
222
  /**
189
- * Build adaptive system prompt for Phase 2 structured output generation
190
- * based on configured data components and artifact components across the agent
223
+ * Get the client's current time formatted in their timezone
191
224
  */
192
225
  private getClientCurrentTime;
193
- private buildPhase2SystemPrompt;
194
226
  private buildSystemPrompt;
195
227
  private getArtifactTools;
196
- private createThinkingCompleteTool;
197
228
  private getDefaultTools;
198
229
  private getStreamRequestId;
199
230
  private applyToolOverrides;
@@ -221,7 +252,7 @@ declare class Agent {
221
252
  streamRequestId: string;
222
253
  apiKey?: string;
223
254
  };
224
- }): Promise<any>;
255
+ }): Promise<ResolvedGenerationResponse>;
225
256
  /**
226
257
  * Setup generation context and initialize streaming helper
227
258
  */
@@ -254,12 +285,7 @@ declare class Agent {
254
285
  private setupStreamParser;
255
286
  private buildTelemetryConfig;
256
287
  private buildBaseGenerationConfig;
257
- private buildReasoningFlow;
258
288
  private buildDataComponentsSchema;
259
- private calculatePhase2Timeout;
260
- private buildPhase2Messages;
261
- private executeStreamingPhase2;
262
- private executeNonStreamingPhase2;
263
289
  private formatFinalResponse;
264
290
  private handleGenerationError;
265
291
  /**
@@ -267,8 +293,8 @@ declare class Agent {
267
293
  * Performs full cleanup of compression state when agent/session is ending
268
294
  */
269
295
  cleanupCompression(): void;
296
+ private handleStreamGeneration;
270
297
  private processStreamEvents;
271
- private formatStreamingResponse;
272
298
  }
273
299
  //#endregion
274
- export { Agent, AgentConfig, DelegateRelation, ExternalAgentRelationConfig, TeamAgentRelationConfig, ToolType, hasToolCallWithPrefix };
300
+ export { Agent, AgentConfig, DelegateRelation, ExternalAgentRelationConfig, ResolvedGenerationResponse, TeamAgentRelationConfig, ToolType, hasToolCallWithPrefix, resolveGenerationResponse };