@inkeep/agents-api 0.0.0-dev-20260212083055 → 0.0.0-dev-20260212092330

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 (44) hide show
  1. package/dist/.well-known/workflow/v1/manifest.debug.json +19 -19
  2. package/dist/.well-known/workflow/v1/step.cjs +390 -220
  3. package/dist/createApp.d.ts +2 -2
  4. package/dist/createApp.js +12 -1
  5. package/dist/data/db/manageDbClient.d.ts +2 -2
  6. package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
  7. package/dist/domains/evals/services/EvaluationService.d.ts +0 -5
  8. package/dist/domains/evals/services/EvaluationService.js +2 -51
  9. package/dist/domains/evals/workflow/routes.d.ts +2 -2
  10. package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
  11. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  12. package/dist/domains/manage/routes/index.d.ts +2 -2
  13. package/dist/domains/manage/routes/invitations.d.ts +2 -2
  14. package/dist/domains/manage/routes/mcp.d.ts +2 -2
  15. package/dist/domains/manage/routes/passwordResetLinks.d.ts +2 -2
  16. package/dist/domains/manage/routes/signoz.d.ts +2 -2
  17. package/dist/domains/manage/routes/users.d.ts +2 -2
  18. package/dist/domains/mcp/routes/mcp.d.ts +2 -2
  19. package/dist/domains/run/agents/relationTools.d.ts +2 -2
  20. package/dist/domains/run/utils/token-estimator.d.ts +2 -2
  21. package/dist/domains/work-apps/index.d.ts +13 -0
  22. package/dist/domains/work-apps/index.js +23 -0
  23. package/dist/factory.d.ts +263 -263
  24. package/dist/index.d.ts +262 -262
  25. package/dist/middleware/cors.d.ts +6 -1
  26. package/dist/middleware/cors.js +27 -1
  27. package/dist/middleware/evalsAuth.d.ts +2 -2
  28. package/dist/middleware/index.d.ts +3 -2
  29. package/dist/middleware/index.js +3 -2
  30. package/dist/middleware/manageAuth.d.ts +2 -2
  31. package/dist/middleware/manageAuth.js +16 -1
  32. package/dist/middleware/projectAccess.d.ts +2 -2
  33. package/dist/middleware/projectConfig.d.ts +3 -3
  34. package/dist/middleware/requirePermission.d.ts +2 -2
  35. package/dist/middleware/runAuth.d.ts +4 -4
  36. package/dist/middleware/runAuth.js +71 -1
  37. package/dist/middleware/sessionAuth.d.ts +3 -3
  38. package/dist/middleware/tenantAccess.d.ts +2 -2
  39. package/dist/middleware/tracing.d.ts +3 -3
  40. package/dist/middleware/workAppsAuth.d.ts +7 -0
  41. package/dist/middleware/workAppsAuth.js +52 -0
  42. package/dist/openapi.d.ts +5 -0
  43. package/dist/openapi.js +6 -1
  44. package/package.json +5 -5
@@ -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_types13 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_types13.BlankEnv, hono_types13.BlankSchema, "/">;
8
+ declare function createAgentsHono(config: AppConfig): Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { createAgentsHono, isWebhookRoute };
package/dist/createApp.js CHANGED
@@ -7,12 +7,14 @@ import { flushBatchProcessor } from "./instrumentation.js";
7
7
  import { manageRoutes } from "./domains/manage/index.js";
8
8
  import mcp_default from "./domains/mcp/routes/mcp.js";
9
9
  import { runRoutes } from "./domains/run/index.js";
10
- import { authCorsConfig, defaultCorsConfig, playgroundCorsConfig, runCorsConfig, signozCorsConfig } from "./middleware/cors.js";
10
+ import { workAppsRoutes } from "./domains/work-apps/index.js";
11
+ import { authCorsConfig, defaultCorsConfig, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./middleware/cors.js";
11
12
  import { errorHandler } from "./middleware/errorHandler.js";
12
13
  import { manageApiKeyAuth } from "./middleware/manageAuth.js";
13
14
  import { manageRefMiddleware, oauthRefMiddleware, runRefMiddleware, writeProtectionMiddleware } from "./middleware/ref.js";
14
15
  import { runApiKeyAuth, runApiKeyAuthExcept } from "./middleware/runAuth.js";
15
16
  import { requireTenantAccess } from "./middleware/tenantAccess.js";
17
+ import { workAppsAuth } from "./middleware/workAppsAuth.js";
16
18
  import "./middleware/index.js";
17
19
  import { branchScopedDbMiddleware } from "./middleware/branchScopedDb.js";
18
20
  import { evalApiKeyAuth } from "./middleware/evalsAuth.js";
@@ -52,9 +54,11 @@ function createAgentsHono(config) {
52
54
  app.use("/run/*", cors(runCorsConfig));
53
55
  app.use("/manage/tenants/*/playground/token", cors(playgroundCorsConfig));
54
56
  app.use("/manage/tenants/*/signoz/*", cors(signozCorsConfig));
57
+ app.use("/work-apps/*", cors(workAppsCorsConfig));
55
58
  app.use("*", async (c, next) => {
56
59
  if (auth && c.req.path.startsWith("/api/auth/")) return next();
57
60
  if (c.req.path.startsWith("/run/")) return next();
61
+ if (c.req.path.startsWith("/work-apps/")) return next();
58
62
  if (c.req.path.includes("/playground/token")) return next();
59
63
  if (c.req.path.includes("/signoz/")) return next();
60
64
  if (c.req.path.includes("/work-apps/github/")) return next();
@@ -69,6 +73,10 @@ function createAgentsHono(config) {
69
73
  c.set("auth", auth);
70
74
  await next();
71
75
  });
76
+ app.use("/work-apps/*", async (c, next) => {
77
+ c.set("auth", auth);
78
+ await next();
79
+ });
72
80
  app.use("/run/*", async (c, next) => {
73
81
  if (sandboxConfig) c.set("sandboxConfig", sandboxConfig);
74
82
  await next();
@@ -185,6 +193,9 @@ function createAgentsHono(config) {
185
193
  });
186
194
  app.route("/evals", evalRoutes);
187
195
  app.route("/work-apps/github", githubRoutes);
196
+ app.use("/work-apps/slack/workspaces/*", workAppsAuth);
197
+ app.use("/work-apps/slack/users/*", workAppsAuth);
198
+ app.route("/work-apps", workAppsRoutes);
188
199
  app.route("/mcp", mcp_default);
189
200
  setupOpenAPIRoutes(app);
190
201
  app.use("/run/*", async (_c, next) => {
@@ -1,6 +1,6 @@
1
- import * as _inkeep_agents_core0 from "@inkeep/agents-core";
1
+ import * as _inkeep_agents_core3 from "@inkeep/agents-core";
2
2
 
3
3
  //#region src/data/db/manageDbClient.d.ts
4
- declare const manageDbClient: _inkeep_agents_core0.AgentsManageDatabaseClient;
4
+ declare const manageDbClient: _inkeep_agents_core3.AgentsManageDatabaseClient;
5
5
  //#endregion
6
6
  export { manageDbClient as default };
@@ -1,7 +1,7 @@
1
1
  import { OpenAPIHono } from "@hono/zod-openapi";
2
- import * as hono17 from "hono";
2
+ import * as hono14 from "hono";
3
3
 
4
4
  //#region src/domains/evals/routes/datasetTriggers.d.ts
5
- declare const app: OpenAPIHono<hono17.Env, {}, "/">;
5
+ declare const app: OpenAPIHono<hono14.Env, {}, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -43,11 +43,6 @@ declare class EvaluationService {
43
43
  * Extract messages from dataset item input
44
44
  */
45
45
  private extractMessagesFromDatasetItem;
46
- /**
47
- * Parse SSE (Server-Sent Events) response from chat API
48
- * Handles text deltas, error operations, and other data operations
49
- */
50
- private parseSSEResponse;
51
46
  /**
52
47
  * Run an evaluation job based on an evaluation job config
53
48
  * Filters conversations based on jobFilters and runs evaluations with configured evaluators
@@ -3,7 +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 { ModelFactory, createEvaluationResult, createEvaluationRun, filterConversationsForJob, generateId, getConversationHistory, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluatorById, getFullAgent, getProjectScopedRef, resolveRef, updateEvaluationResult, withRef } from "@inkeep/agents-core";
6
+ import { ModelFactory, createEvaluationResult, createEvaluationRun, filterConversationsForJob, generateId, getConversationHistory, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluatorById, getFullAgent, getProjectScopedRef, parseSSEResponse, resolveRef, updateEvaluationResult, withRef } from "@inkeep/agents-core";
7
7
  import { generateObject, generateText } from "ai";
8
8
  import { z } from "zod";
9
9
 
@@ -105,8 +105,7 @@ var EvaluationService = class {
105
105
  error: `Chat API error: ${response.status} ${response.statusText}`
106
106
  };
107
107
  }
108
- const responseText = await response.text();
109
- const parseResult = this.parseSSEResponse(responseText);
108
+ const parseResult = parseSSEResponse(await response.text());
110
109
  if (parseResult.error) {
111
110
  logger.error({
112
111
  datasetItemId: datasetItem.id,
@@ -314,54 +313,6 @@ Generate the next user message:`;
314
313
  return null;
315
314
  }
316
315
  /**
317
- * Parse SSE (Server-Sent Events) response from chat API
318
- * Handles text deltas, error operations, and other data operations
319
- */
320
- parseSSEResponse(sseText) {
321
- let textContent = "";
322
- let hasError = false;
323
- let errorMessage = "";
324
- const lines = sseText.split("\n").filter((line) => line.startsWith("data: "));
325
- for (const line of lines) try {
326
- const data = JSON.parse(line.slice(6));
327
- if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
328
- const delta = data.choices[0].delta;
329
- if (delta.content) textContent += delta.content;
330
- if (delta.content && typeof delta.content === "string") try {
331
- const parsedContent = JSON.parse(delta.content);
332
- if (parsedContent.type === "data-operation" && parsedContent.data?.type === "error") {
333
- hasError = true;
334
- errorMessage = parsedContent.data.message || "Unknown error occurred";
335
- logger.warn({
336
- errorMessage,
337
- errorData: parsedContent.data
338
- }, "Received error operation from chat API");
339
- }
340
- } catch {}
341
- } else if (data.type === "text-delta" && data.delta) textContent += data.delta;
342
- else if (data.type === "data-operation" && data.data?.type === "error") {
343
- hasError = true;
344
- errorMessage = data.data.message || "Unknown error occurred";
345
- logger.warn({
346
- errorMessage,
347
- errorData: data.data
348
- }, "Received error operation from chat API");
349
- } else if (data.type === "error") {
350
- hasError = true;
351
- errorMessage = data.message || "Unknown error occurred";
352
- logger.warn({
353
- errorMessage,
354
- errorData: data
355
- }, "Received error event from chat API");
356
- } else if (data.content) textContent += typeof data.content === "string" ? data.content : JSON.stringify(data.content);
357
- } catch {}
358
- if (hasError) return {
359
- text: textContent.trim(),
360
- error: errorMessage
361
- };
362
- return { text: textContent.trim() };
363
- }
364
- /**
365
316
  * Run an evaluation job based on an evaluation job config
366
317
  * Filters conversations based on jobFilters and runs evaluations with configured evaluators
367
318
  */
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types5 from "hono/types";
2
+ import * as hono_types10 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_types10.BlankEnv, hono_types10.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { workflowRoutes };
@@ -1,7 +1,7 @@
1
1
  import { OpenAPIHono } from "@hono/zod-openapi";
2
- import * as hono0 from "hono";
2
+ import * as hono2 from "hono";
3
3
 
4
4
  //#region src/domains/manage/routes/availableAgents.d.ts
5
- declare const app: OpenAPIHono<hono0.Env, {}, "/">;
5
+ declare const app: OpenAPIHono<hono2.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 hono3 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<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 hono6 from "hono";
2
+ import * as hono5 from "hono";
3
3
 
4
4
  //#region src/domains/manage/routes/index.d.ts
5
- declare const app: OpenAPIHono<hono6.Env, {}, "/">;
5
+ declare const app: OpenAPIHono<hono5.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_types1 from "hono/types";
3
+ import * as hono_types6 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_types1.BlankSchema, "/">;
8
+ }, hono_types6.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { invitationsRoutes as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types2 from "hono/types";
2
+ import * as hono_types7 from "hono/types";
3
3
 
4
4
  //#region src/domains/manage/routes/mcp.d.ts
5
- declare const app: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types7.BlankEnv, hono_types7.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_types8 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_types8.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_types4 from "hono/types";
3
+ import * as hono_types12 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_types4.BlankSchema, "/">;
8
+ }, hono_types12.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_types7 from "hono/types";
3
+ import * as hono_types3 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_types7.BlankSchema, "/">;
8
+ }, hono_types3.BlankSchema, "/">;
9
9
  //#endregion
10
10
  export { usersRoutes as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types9 from "hono/types";
2
+ import * as hono_types4 from "hono/types";
3
3
 
4
4
  //#region src/domains/mcp/routes/mcp.d.ts
5
- declare const app: Hono<hono_types9.BlankEnv, hono_types9.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,6 +1,6 @@
1
1
  import { AgentConfig, DelegateRelation } from "./Agent.js";
2
2
  import { InternalRelation } from "../utils/project.js";
3
- import * as _inkeep_agents_core1 from "@inkeep/agents-core";
3
+ import * as _inkeep_agents_core0 from "@inkeep/agents-core";
4
4
  import { CredentialStoreRegistry, FullExecutionContext } from "@inkeep/agents-core";
5
5
  import * as ai0 from "ai";
6
6
 
@@ -44,7 +44,7 @@ declare function createDelegateToAgentTool({
44
44
  message: string;
45
45
  }, {
46
46
  toolCallId: any;
47
- result: _inkeep_agents_core1.Message | _inkeep_agents_core1.Task;
47
+ result: _inkeep_agents_core0.Message | _inkeep_agents_core0.Task;
48
48
  }>;
49
49
  /**
50
50
  * Parameters for building a transfer relation config
@@ -1,4 +1,4 @@
1
- import * as _inkeep_agents_core3 from "@inkeep/agents-core";
1
+ import * as _inkeep_agents_core2 from "@inkeep/agents-core";
2
2
  import { BreakdownComponentDef, ContextBreakdown, calculateBreakdownTotal, createEmptyBreakdown } from "@inkeep/agents-core";
3
3
 
4
4
  //#region src/domains/run/utils/token-estimator.d.ts
@@ -17,7 +17,7 @@ interface AssembleResult {
17
17
  /** The assembled prompt string */
18
18
  prompt: string;
19
19
  /** Token breakdown for each component */
20
- breakdown: _inkeep_agents_core3.ContextBreakdown;
20
+ breakdown: _inkeep_agents_core2.ContextBreakdown;
21
21
  }
22
22
  //#endregion
23
23
  export { AssembleResult, type BreakdownComponentDef, type ContextBreakdown, calculateBreakdownTotal, createEmptyBreakdown, estimateTokens };
@@ -0,0 +1,13 @@
1
+ import { OpenAPIHono } from "@hono/zod-openapi";
2
+ import { WorkAppsVariables } from "@inkeep/agents-work-apps/slack";
3
+
4
+ //#region src/domains/work-apps/index.d.ts
5
+
6
+ declare function createWorkAppsRoutes(): OpenAPIHono<{
7
+ Variables: WorkAppsVariables;
8
+ }, {}, "/">;
9
+ declare const workAppsRoutes: OpenAPIHono<{
10
+ Variables: WorkAppsVariables;
11
+ }, {}, "/">;
12
+ //#endregion
13
+ export { createWorkAppsRoutes, workAppsRoutes };
@@ -0,0 +1,23 @@
1
+ import { OpenAPIHono } from "@hono/zod-openapi";
2
+ import { slackRoutes } from "@inkeep/agents-work-apps/slack";
3
+
4
+ //#region src/domains/work-apps/index.ts
5
+ /**
6
+ * Work Apps Domain
7
+ *
8
+ * Modular integration layer for third-party work applications (Slack, GitHub, etc.)
9
+ * Work app implementations are in @inkeep/agents-work-apps package.
10
+ *
11
+ * Each work app is mounted as a sub-route:
12
+ * - /work-apps/slack/* - Slack workspace installation, user linking, commands
13
+ * - /work-apps/github/* - GitHub integration (mounted separately in createApp)
14
+ */
15
+ function createWorkAppsRoutes() {
16
+ const app = new OpenAPIHono();
17
+ app.route("/slack", slackRoutes);
18
+ return app;
19
+ }
20
+ const workAppsRoutes = createWorkAppsRoutes();
21
+
22
+ //#endregion
23
+ export { createWorkAppsRoutes, workAppsRoutes };