@inkeep/agents-core 0.52.0 → 0.53.1

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 (35) hide show
  1. package/dist/auth/auth-schema.d.ts +107 -107
  2. package/dist/auth/auth-validation-schemas.d.ts +152 -152
  3. package/dist/auth/auth.d.ts +22 -22
  4. package/dist/auth/permissions.d.ts +9 -9
  5. package/dist/client-exports.d.ts +5 -5
  6. package/dist/data-access/manage/agents.d.ts +31 -31
  7. package/dist/data-access/manage/artifactComponents.d.ts +14 -14
  8. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  9. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  10. package/dist/data-access/manage/functionTools.d.ts +12 -12
  11. package/dist/data-access/manage/skills.d.ts +13 -13
  12. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  13. package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
  14. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  15. package/dist/data-access/manage/subAgents.d.ts +21 -21
  16. package/dist/data-access/manage/tools.d.ts +24 -24
  17. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  18. package/dist/data-access/runtime/conversations.d.ts +16 -16
  19. package/dist/data-access/runtime/messages.d.ts +18 -18
  20. package/dist/data-access/runtime/organizations.d.ts +2 -0
  21. package/dist/data-access/runtime/organizations.js +6 -2
  22. package/dist/data-access/runtime/tasks.d.ts +5 -5
  23. package/dist/db/manage/manage-schema.d.ts +445 -445
  24. package/dist/db/runtime/runtime-schema.d.ts +292 -292
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.js +2 -2
  27. package/dist/middleware/no-auth.d.ts +2 -2
  28. package/dist/setup/setup.js +52 -14
  29. package/dist/utils/index.d.ts +2 -2
  30. package/dist/utils/index.js +2 -2
  31. package/dist/utils/slack-link-token.d.ts +33 -8
  32. package/dist/utils/slack-link-token.js +20 -9
  33. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  34. package/dist/validation/schemas.d.ts +1989 -1989
  35. package/package.json +1 -1
@@ -17,7 +17,7 @@ import { MockLanguageModel, createMockModel } from "./mock-provider.js";
17
17
  import { ModelFactory } from "./model-factory.js";
18
18
  import { retryWithBackoff } from "./retry.js";
19
19
  import { generateServiceToken, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken } from "./service-token-auth.js";
20
- import { SlackLinkTokenPayloadSchema, signSlackLinkToken, verifySlackLinkToken } from "./slack-link-token.js";
20
+ import { SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, signSlackLinkToken, verifySlackLinkToken } from "./slack-link-token.js";
21
21
  import { SlackAccessTokenPayloadSchema, isSlackUserToken, signSlackUserToken, verifySlackUserToken } from "./slack-user-token.js";
22
22
  import { parseSSEResponse } from "./sse-parser.js";
23
23
  import { signTempToken, verifyTempToken } from "./temp-jwt.js";
@@ -29,4 +29,4 @@ import { flushTraces, getTracer, setSpanWithError, unwrapError } from "./tracer-
29
29
  import { hashAuthenticationHeaders, hashTriggerHeaderValue, validateTriggerHeaderValue, verifySignatureWithConfig, verifyTriggerAuth } from "./trigger-auth.js";
30
30
  import { _resetWaitUntilCache, getWaitUntil } from "./wait-until.js";
31
31
 
32
- export { ERROR_DOCS_BASE_URL, ErrorCode, InternalServices, JsonTransformer, McpClient, MockLanguageModel, ModelFactory, PinoLogger, SlackAccessTokenPayloadSchema, SlackLinkTokenPayloadSchema, _resetWaitUntilCache, buildComposioMCPUrl, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateId, generateInternalServiceToken, generateServiceToken, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getInProcessFetch, getJwtSecret, getLogger, getMetadataFromApiKey, getTracer, getWaitUntil, handleApiError, hasIssuer, hashApiKey, hashAuthenticationHeaders, hashTriggerHeaderValue, initiateMcpOAuthFlow, interpolateTemplate, isApiKeyExpired, isComposioMCPServerAuthenticated, isInternalServiceToken, isSlackUserToken, isThirdPartyMCPServerAuthenticated, isUniqueConstraintError, isZodSchema, loggerFactory, maskApiKey, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
32
+ export { ERROR_DOCS_BASE_URL, ErrorCode, InternalServices, JsonTransformer, McpClient, MockLanguageModel, ModelFactory, PinoLogger, SlackAccessTokenPayloadSchema, SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, _resetWaitUntilCache, buildComposioMCPUrl, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateId, generateInternalServiceToken, generateServiceToken, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getInProcessFetch, getJwtSecret, getLogger, getMetadataFromApiKey, getTracer, getWaitUntil, handleApiError, hasIssuer, hashApiKey, hashAuthenticationHeaders, hashTriggerHeaderValue, initiateMcpOAuthFlow, interpolateTemplate, isApiKeyExpired, isComposioMCPServerAuthenticated, isInternalServiceToken, isSlackUserToken, isThirdPartyMCPServerAuthenticated, isUniqueConstraintError, isZodSchema, loggerFactory, maskApiKey, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
@@ -2,13 +2,22 @@ import { JwtVerifyResult } from "./jwt-helpers.js";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/utils/slack-link-token.d.ts
5
-
6
- /**
7
- * Zod schema for validating Slack link token JWT payload.
8
- * This is a stateless token used for the Slack-to-Inkeep account linking flow.
9
- * When a user runs `/inkeep link` in Slack, this JWT is generated and embedded
10
- * in a URL that the user visits to complete the linking.
11
- */
5
+ declare const SlackLinkIntentSchema: z.ZodObject<{
6
+ entryPoint: z.ZodEnum<{
7
+ mention: "mention";
8
+ question_command: "question_command";
9
+ run_command: "run_command";
10
+ }>;
11
+ question: z.ZodString;
12
+ channelId: z.ZodString;
13
+ threadTs: z.ZodOptional<z.ZodString>;
14
+ messageTs: z.ZodOptional<z.ZodString>;
15
+ agentIdentifier: z.ZodOptional<z.ZodString>;
16
+ agentId: z.ZodOptional<z.ZodString>;
17
+ projectId: z.ZodOptional<z.ZodString>;
18
+ responseUrl: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ type SlackLinkIntent = z.infer<typeof SlackLinkIntentSchema>;
12
21
  declare const SlackLinkTokenPayloadSchema: z.ZodObject<{
13
22
  iss: z.ZodLiteral<"inkeep-auth">;
14
23
  aud: z.ZodLiteral<"slack-link">;
@@ -24,6 +33,21 @@ declare const SlackLinkTokenPayloadSchema: z.ZodObject<{
24
33
  enterpriseId: z.ZodOptional<z.ZodString>;
25
34
  username: z.ZodOptional<z.ZodString>;
26
35
  }, z.core.$strip>;
36
+ intent: z.ZodOptional<z.ZodObject<{
37
+ entryPoint: z.ZodEnum<{
38
+ mention: "mention";
39
+ question_command: "question_command";
40
+ run_command: "run_command";
41
+ }>;
42
+ question: z.ZodString;
43
+ channelId: z.ZodString;
44
+ threadTs: z.ZodOptional<z.ZodString>;
45
+ messageTs: z.ZodOptional<z.ZodString>;
46
+ agentIdentifier: z.ZodOptional<z.ZodString>;
47
+ agentId: z.ZodOptional<z.ZodString>;
48
+ projectId: z.ZodOptional<z.ZodString>;
49
+ responseUrl: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>;
27
51
  }, z.core.$strip>;
28
52
  type SlackLinkTokenPayload = z.infer<typeof SlackLinkTokenPayloadSchema>;
29
53
  /**
@@ -35,6 +59,7 @@ interface SignSlackLinkTokenParams {
35
59
  slackUserId: string;
36
60
  slackEnterpriseId?: string;
37
61
  slackUsername?: string;
62
+ intent?: SlackLinkIntent;
38
63
  }
39
64
  /**
40
65
  * Result of verifying a Slack link token
@@ -54,4 +79,4 @@ declare function signSlackLinkToken(params: SignSlackLinkTokenParams): Promise<s
54
79
  */
55
80
  declare function verifySlackLinkToken(token: string): Promise<VerifySlackLinkTokenResult>;
56
81
  //#endregion
57
- export { SignSlackLinkTokenParams, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, VerifySlackLinkTokenResult, signSlackLinkToken, verifySlackLinkToken };
82
+ export { SignSlackLinkTokenParams, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, VerifySlackLinkTokenResult, signSlackLinkToken, verifySlackLinkToken };
@@ -8,12 +8,21 @@ const ISSUER = "inkeep-auth";
8
8
  const AUDIENCE = "slack-link";
9
9
  const TOKEN_USE = "slackLinkCode";
10
10
  const TOKEN_TTL = "10m";
11
- /**
12
- * Zod schema for validating Slack link token JWT payload.
13
- * This is a stateless token used for the Slack-to-Inkeep account linking flow.
14
- * When a user runs `/inkeep link` in Slack, this JWT is generated and embedded
15
- * in a URL that the user visits to complete the linking.
16
- */
11
+ const SlackLinkIntentSchema = z.object({
12
+ entryPoint: z.enum([
13
+ "mention",
14
+ "question_command",
15
+ "run_command"
16
+ ]),
17
+ question: z.string().min(1).max(2e3),
18
+ channelId: z.string().min(1),
19
+ threadTs: z.string().optional(),
20
+ messageTs: z.string().optional(),
21
+ agentIdentifier: z.string().optional(),
22
+ agentId: z.string().optional(),
23
+ projectId: z.string().optional(),
24
+ responseUrl: z.string().optional()
25
+ });
17
26
  const SlackLinkTokenPayloadSchema = z.object({
18
27
  iss: z.literal(ISSUER),
19
28
  aud: z.literal(AUDIENCE),
@@ -28,7 +37,8 @@ const SlackLinkTokenPayloadSchema = z.object({
28
37
  userId: z.string().min(1),
29
38
  enterpriseId: z.string().min(1).optional(),
30
39
  username: z.string().optional()
31
- })
40
+ }),
41
+ intent: SlackLinkIntentSchema.optional()
32
42
  });
33
43
  /**
34
44
  * Sign a Slack link JWT token for the device authorization flow.
@@ -52,7 +62,8 @@ async function signSlackLinkToken(params) {
52
62
  userId: params.slackUserId,
53
63
  ...params.slackEnterpriseId && { enterpriseId: params.slackEnterpriseId },
54
64
  ...params.slackUsername && { username: params.slackUsername }
55
- }
65
+ },
66
+ ...params.intent && { intent: params.intent }
56
67
  }
57
68
  });
58
69
  logger.debug({
@@ -109,4 +120,4 @@ async function verifySlackLinkToken(token) {
109
120
  }
110
121
 
111
122
  //#endregion
112
- export { SlackLinkTokenPayloadSchema, signSlackLinkToken, verifySlackLinkToken };
123
+ export { SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, signSlackLinkToken, verifySlackLinkToken };
@@ -1,10 +1,10 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import * as drizzle_zod0 from "drizzle-zod";
2
+ import * as drizzle_zod15 from "drizzle-zod";
3
3
  import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
4
4
 
5
5
  //#region src/validation/drizzle-schema-helpers.d.ts
6
- declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"select", T["_"]["columns"], drizzle_zod0.BuildRefine<T["_"]["columns"], undefined>, undefined>;
7
- declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"insert", T["_"]["columns"], drizzle_zod0.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
6
+ declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod15.BuildSchema<"select", T["_"]["columns"], drizzle_zod15.BuildRefine<T["_"]["columns"], undefined>, undefined>;
7
+ declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod15.BuildSchema<"insert", T["_"]["columns"], drizzle_zod15.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
8
8
  declare const createSelectSchema: typeof createSelectSchemaWithModifiers;
9
9
  declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
10
10
  /**