@inkeep/agents-core 0.0.0-dev-20260211235751 → 0.0.0-dev-20260212003026
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/auth/auth.d.ts +1 -1
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/data-access/index.d.ts +1 -2
- package/dist/data-access/index.js +1 -2
- package/dist/data-access/runtime/conversations.d.ts +7 -7
- package/dist/data-access/runtime/tasks.d.ts +2 -2
- package/dist/db/manage/manage-schema.d.ts +378 -378
- package/dist/db/runtime/runtime-schema.d.ts +240 -974
- package/dist/db/runtime/runtime-schema.js +2 -77
- package/dist/index.d.ts +3 -7
- package/dist/index.js +3 -7
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +1 -4
- package/dist/utils/trigger-auth.d.ts +1 -1
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas.d.ts +47 -1557
- package/dist/validation/schemas.js +2 -26
- package/drizzle/runtime/meta/_journal.json +0 -7
- package/package.json +1 -1
- package/dist/data-access/runtime/workAppSlack.d.ts +0 -55
- package/dist/data-access/runtime/workAppSlack.js +0 -146
- package/dist/utils/slack-link-token.d.ts +0 -57
- package/dist/utils/slack-link-token.js +0 -112
- package/dist/utils/slack-user-token.d.ts +0 -65
- package/dist/utils/slack-user-token.js +0 -129
- package/dist/utils/sse-parser.d.ts +0 -35
- package/dist/utils/sse-parser.js +0 -71
- package/drizzle/runtime/0012_add-slack-work-app-tables.sql +0 -114
- package/drizzle/runtime/meta/0012_snapshot.json +0 -3600
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { schemaValidationDefaults } from "../constants/schema-validation/defaults.js";
|
|
2
2
|
import { agents, artifactComponents, contextConfigs, credentialReferences, dataComponents, dataset, datasetItem, datasetRunConfig, datasetRunConfigAgentRelations, evaluationJobConfig, evaluationJobConfigEvaluatorRelations, evaluationRunConfig, evaluationRunConfigEvaluationSuiteConfigRelations, evaluationSuiteConfig, evaluationSuiteConfigEvaluatorRelations, evaluator, externalAgents, functionTools, functions, projects, subAgentArtifactComponents, subAgentDataComponents, subAgentExternalAgentRelations, subAgentFunctionToolRelations, subAgentRelations, subAgentTeamAgentRelations, subAgentToolRelations, subAgents, tools, triggers } from "../db/manage/manage-schema.js";
|
|
3
|
-
import { apiKeys, contextCache, conversations, datasetRun, datasetRunConversationRelations, evaluationResult, evaluationRun, ledgerArtifacts, messages, projectMetadata, taskRelations, tasks, triggerInvocations, workAppGitHubInstallations, workAppGitHubMcpToolRepositoryAccess, workAppGitHubProjectRepositoryAccess, workAppGitHubRepositories
|
|
3
|
+
import { apiKeys, contextCache, conversations, datasetRun, datasetRunConversationRelations, evaluationResult, evaluationRun, ledgerArtifacts, messages, projectMetadata, taskRelations, tasks, triggerInvocations, workAppGitHubInstallations, workAppGitHubMcpToolRepositoryAccess, workAppGitHubProjectRepositoryAccess, workAppGitHubRepositories } from "../db/runtime/runtime-schema.js";
|
|
4
4
|
import { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from "../types/utility.js";
|
|
5
5
|
import { jmespathString, validateJMESPathSecure, validateRegex } from "../utils/jmespath-utils.js";
|
|
6
6
|
import { ResolvedRefSchema } from "./dolt-schemas.js";
|
|
@@ -1464,30 +1464,6 @@ const WorkAppGitHubAccessGetResponseSchema = z.object({
|
|
|
1464
1464
|
mode: WorkAppGitHubAccessModeSchema,
|
|
1465
1465
|
repositories: z.array(WorkAppGitHubRepositorySelectSchema)
|
|
1466
1466
|
});
|
|
1467
|
-
const WorkAppSlackWorkspaceStatusSchema = z.enum([
|
|
1468
|
-
"active",
|
|
1469
|
-
"suspended",
|
|
1470
|
-
"disconnected"
|
|
1471
|
-
]);
|
|
1472
|
-
const WorkAppSlackWorkspaceSelectSchema = createSelectSchema(workAppSlackWorkspaces);
|
|
1473
|
-
const WorkAppSlackWorkspaceInsertSchema = createInsertSchema(workAppSlackWorkspaces).omit({
|
|
1474
|
-
createdAt: true,
|
|
1475
|
-
updatedAt: true
|
|
1476
|
-
}).extend({ status: WorkAppSlackWorkspaceStatusSchema.optional().default("active") });
|
|
1477
|
-
const WorkAppSlackWorkspaceUpdateSchema = WorkAppSlackWorkspaceInsertSchema.partial();
|
|
1478
|
-
const WorkAppSlackUserMappingSelectSchema = createSelectSchema(workAppSlackUserMappings);
|
|
1479
|
-
const WorkAppSlackUserMappingInsertSchema = createInsertSchema(workAppSlackUserMappings).omit({
|
|
1480
|
-
createdAt: true,
|
|
1481
|
-
updatedAt: true,
|
|
1482
|
-
linkedAt: true
|
|
1483
|
-
}).extend({ clientId: z.string().optional().default("work-apps-slack") });
|
|
1484
|
-
const WorkAppSlackUserMappingUpdateSchema = WorkAppSlackUserMappingInsertSchema.partial();
|
|
1485
|
-
const WorkAppSlackChannelAgentConfigSelectSchema = createSelectSchema(workAppSlackChannelAgentConfigs);
|
|
1486
|
-
const WorkAppSlackChannelAgentConfigInsertSchema = createInsertSchema(workAppSlackChannelAgentConfigs).omit({
|
|
1487
|
-
createdAt: true,
|
|
1488
|
-
updatedAt: true
|
|
1489
|
-
});
|
|
1490
|
-
const WorkAppSlackChannelAgentConfigUpdateSchema = WorkAppSlackChannelAgentConfigInsertSchema.partial();
|
|
1491
1467
|
|
|
1492
1468
|
//#endregion
|
|
1493
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AgentWithinContextOfProjectSelectResponse, AgentWithinContextOfProjectSelectSchema, AgentWithinContextOfProjectSelectSchemaWithRelationIds, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ComponentJoinSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, DataPartSchema, DatasetApiInsertSchema, DatasetApiSelectSchema, DatasetApiUpdateSchema, DatasetInsertSchema, DatasetItemApiInsertSchema, DatasetItemApiSelectSchema, DatasetItemApiUpdateSchema, DatasetItemInsertSchema, DatasetItemSelectSchema, DatasetItemUpdateSchema, DatasetRunApiInsertSchema, DatasetRunApiSelectSchema, DatasetRunApiUpdateSchema, DatasetRunConfigAgentRelationInsertSchema, DatasetRunConfigAgentRelationSelectSchema, DatasetRunConfigAgentRelationUpdateSchema, DatasetRunConfigApiInsertSchema, DatasetRunConfigApiSelectSchema, DatasetRunConfigApiUpdateSchema, DatasetRunConfigInsertSchema, DatasetRunConfigSelectSchema, DatasetRunConfigUpdateSchema, DatasetRunConversationRelationApiInsertSchema, DatasetRunConversationRelationApiSelectSchema, DatasetRunConversationRelationApiUpdateSchema, DatasetRunConversationRelationInsertSchema, DatasetRunConversationRelationSelectSchema, DatasetRunConversationRelationUpdateSchema, DatasetRunInsertSchema, DatasetRunItemSchema, DatasetRunSelectSchema, DatasetRunUpdateSchema, DatasetSelectSchema, DatasetUpdateSchema, ErrorResponseSchema, EvaluationJobConfigApiInsertSchema, EvaluationJobConfigApiSelectSchema, EvaluationJobConfigApiUpdateSchema, EvaluationJobConfigEvaluatorRelationApiInsertSchema, EvaluationJobConfigEvaluatorRelationApiSelectSchema, EvaluationJobConfigEvaluatorRelationApiUpdateSchema, EvaluationJobConfigEvaluatorRelationInsertSchema, EvaluationJobConfigEvaluatorRelationSelectSchema, EvaluationJobConfigEvaluatorRelationUpdateSchema, EvaluationJobConfigInsertSchema, EvaluationJobConfigSelectSchema, EvaluationJobConfigUpdateSchema, EvaluationJobFilterCriteriaSchema, EvaluationResultApiInsertSchema, EvaluationResultApiSelectSchema, EvaluationResultApiUpdateSchema, EvaluationResultInsertSchema, EvaluationResultSelectSchema, EvaluationResultUpdateSchema, EvaluationRunApiInsertSchema, EvaluationRunApiSelectSchema, EvaluationRunApiUpdateSchema, EvaluationRunConfigApiInsertSchema, EvaluationRunConfigApiSelectSchema, EvaluationRunConfigApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationUpdateSchema, EvaluationRunConfigInsertSchema, EvaluationRunConfigSelectSchema, EvaluationRunConfigUpdateSchema, EvaluationRunConfigWithSuiteConfigsApiSelectSchema, EvaluationRunInsertSchema, EvaluationRunSelectSchema, EvaluationRunUpdateSchema, EvaluationSuiteConfigApiInsertSchema, EvaluationSuiteConfigApiSelectSchema, EvaluationSuiteConfigApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationApiInsertSchema, EvaluationSuiteConfigEvaluatorRelationApiSelectSchema, EvaluationSuiteConfigEvaluatorRelationApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationInsertSchema, EvaluationSuiteConfigEvaluatorRelationSelectSchema, EvaluationSuiteConfigEvaluatorRelationUpdateSchema, EvaluationSuiteConfigInsertSchema, EvaluationSuiteConfigSelectSchema, EvaluationSuiteConfigUpdateSchema, EvaluatorApiInsertSchema, EvaluatorApiSelectSchema, EvaluatorApiUpdateSchema, EvaluatorInsertSchema, EvaluatorSelectSchema, EvaluatorUpdateSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FilePartSchema, FullAgentAgentInsertSchema, FullAgentSubAgentSelectSchema, FullAgentSubAgentSelectSchemaWithRelationIds, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FullProjectSelectResponse, FullProjectSelectSchema, FullProjectSelectSchemaWithRelationIds, FullProjectSelectWithRelationIdsResponse, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PaginationWithRefQueryParamsSchema, PartSchema, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectMetadataInsertSchema, ProjectMetadataSelectSchema, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RefQueryParamSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, ResourceIdSchema, SignatureSourceSchema, SignatureValidationOptionsSchema, SignatureVerificationConfigSchema, SignedComponentSchema, SimulationAgentSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, StringRecordSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentFunctionToolRelationApiInsertSchema, SubAgentFunctionToolRelationApiSelectSchema, SubAgentFunctionToolRelationInsertSchema, SubAgentFunctionToolRelationListResponse, SubAgentFunctionToolRelationResponse, SubAgentFunctionToolRelationSelectSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, TextPartSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerAuthHeaderInputSchema, TriggerAuthHeaderStoredSchema, TriggerAuthHeaderUpdateSchema, TriggerAuthenticationInputSchema, TriggerAuthenticationSchema, TriggerAuthenticationStoredSchema, TriggerAuthenticationUpdateSchema, TriggerBatchConversationEvaluationSchema, TriggerConversationEvaluationSchema, TriggerDatasetRunSchema, TriggerEvaluationJobSchema, TriggerInsertSchema, TriggerInvocationApiInsertSchema, TriggerInvocationApiSelectSchema, TriggerInvocationApiUpdateSchema, TriggerInvocationInsertSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationSelectSchema, TriggerInvocationStatusEnum, TriggerInvocationUpdateSchema, TriggerListResponse, TriggerOutputTransformSchema, TriggerResponse, TriggerSelectSchema, TriggerUpdateSchema, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, URL_SAFE_ID_PATTERN, WorkAppGitHubAccessGetResponseSchema, WorkAppGitHubAccessModeSchema, WorkAppGitHubAccessSetRequestSchema, WorkAppGitHubAccessSetResponseSchema, WorkAppGitHubAccountTypeSchema, WorkAppGitHubInstallationApiInsertSchema, WorkAppGitHubInstallationInsertSchema, WorkAppGitHubInstallationSelectSchema, WorkAppGitHubInstallationStatusSchema, WorkAppGitHubMcpToolRepositoryAccessSelectSchema, WorkAppGitHubProjectRepositoryAccessSelectSchema, WorkAppGitHubRepositoryApiInsertSchema, WorkAppGitHubRepositoryInsertSchema, WorkAppGitHubRepositorySelectSchema, WorkAppGithubInstallationApiSelectSchema, WorkAppSlackChannelAgentConfigInsertSchema, WorkAppSlackChannelAgentConfigSelectSchema, WorkAppSlackChannelAgentConfigUpdateSchema, WorkAppSlackUserMappingInsertSchema, WorkAppSlackUserMappingSelectSchema, WorkAppSlackUserMappingUpdateSchema, WorkAppSlackWorkspaceInsertSchema, WorkAppSlackWorkspaceSelectSchema, WorkAppSlackWorkspaceStatusSchema, WorkAppSlackWorkspaceUpdateSchema, canDelegateToExternalAgentInsertSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentInsertSchema, canDelegateToTeamAgentSchema, canRelateToInternalSubAgentSchema };
|
|
1469
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AgentWithinContextOfProjectSelectResponse, AgentWithinContextOfProjectSelectSchema, AgentWithinContextOfProjectSelectSchemaWithRelationIds, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ComponentJoinSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, DataPartSchema, DatasetApiInsertSchema, DatasetApiSelectSchema, DatasetApiUpdateSchema, DatasetInsertSchema, DatasetItemApiInsertSchema, DatasetItemApiSelectSchema, DatasetItemApiUpdateSchema, DatasetItemInsertSchema, DatasetItemSelectSchema, DatasetItemUpdateSchema, DatasetRunApiInsertSchema, DatasetRunApiSelectSchema, DatasetRunApiUpdateSchema, DatasetRunConfigAgentRelationInsertSchema, DatasetRunConfigAgentRelationSelectSchema, DatasetRunConfigAgentRelationUpdateSchema, DatasetRunConfigApiInsertSchema, DatasetRunConfigApiSelectSchema, DatasetRunConfigApiUpdateSchema, DatasetRunConfigInsertSchema, DatasetRunConfigSelectSchema, DatasetRunConfigUpdateSchema, DatasetRunConversationRelationApiInsertSchema, DatasetRunConversationRelationApiSelectSchema, DatasetRunConversationRelationApiUpdateSchema, DatasetRunConversationRelationInsertSchema, DatasetRunConversationRelationSelectSchema, DatasetRunConversationRelationUpdateSchema, DatasetRunInsertSchema, DatasetRunItemSchema, DatasetRunSelectSchema, DatasetRunUpdateSchema, DatasetSelectSchema, DatasetUpdateSchema, ErrorResponseSchema, EvaluationJobConfigApiInsertSchema, EvaluationJobConfigApiSelectSchema, EvaluationJobConfigApiUpdateSchema, EvaluationJobConfigEvaluatorRelationApiInsertSchema, EvaluationJobConfigEvaluatorRelationApiSelectSchema, EvaluationJobConfigEvaluatorRelationApiUpdateSchema, EvaluationJobConfigEvaluatorRelationInsertSchema, EvaluationJobConfigEvaluatorRelationSelectSchema, EvaluationJobConfigEvaluatorRelationUpdateSchema, EvaluationJobConfigInsertSchema, EvaluationJobConfigSelectSchema, EvaluationJobConfigUpdateSchema, EvaluationJobFilterCriteriaSchema, EvaluationResultApiInsertSchema, EvaluationResultApiSelectSchema, EvaluationResultApiUpdateSchema, EvaluationResultInsertSchema, EvaluationResultSelectSchema, EvaluationResultUpdateSchema, EvaluationRunApiInsertSchema, EvaluationRunApiSelectSchema, EvaluationRunApiUpdateSchema, EvaluationRunConfigApiInsertSchema, EvaluationRunConfigApiSelectSchema, EvaluationRunConfigApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationUpdateSchema, EvaluationRunConfigInsertSchema, EvaluationRunConfigSelectSchema, EvaluationRunConfigUpdateSchema, EvaluationRunConfigWithSuiteConfigsApiSelectSchema, EvaluationRunInsertSchema, EvaluationRunSelectSchema, EvaluationRunUpdateSchema, EvaluationSuiteConfigApiInsertSchema, EvaluationSuiteConfigApiSelectSchema, EvaluationSuiteConfigApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationApiInsertSchema, EvaluationSuiteConfigEvaluatorRelationApiSelectSchema, EvaluationSuiteConfigEvaluatorRelationApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationInsertSchema, EvaluationSuiteConfigEvaluatorRelationSelectSchema, EvaluationSuiteConfigEvaluatorRelationUpdateSchema, EvaluationSuiteConfigInsertSchema, EvaluationSuiteConfigSelectSchema, EvaluationSuiteConfigUpdateSchema, EvaluatorApiInsertSchema, EvaluatorApiSelectSchema, EvaluatorApiUpdateSchema, EvaluatorInsertSchema, EvaluatorSelectSchema, EvaluatorUpdateSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FilePartSchema, FullAgentAgentInsertSchema, FullAgentSubAgentSelectSchema, FullAgentSubAgentSelectSchemaWithRelationIds, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FullProjectSelectResponse, FullProjectSelectSchema, FullProjectSelectSchemaWithRelationIds, FullProjectSelectWithRelationIdsResponse, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PaginationWithRefQueryParamsSchema, PartSchema, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectMetadataInsertSchema, ProjectMetadataSelectSchema, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RefQueryParamSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, ResourceIdSchema, SignatureSourceSchema, SignatureValidationOptionsSchema, SignatureVerificationConfigSchema, SignedComponentSchema, SimulationAgentSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, StringRecordSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentFunctionToolRelationApiInsertSchema, SubAgentFunctionToolRelationApiSelectSchema, SubAgentFunctionToolRelationInsertSchema, SubAgentFunctionToolRelationListResponse, SubAgentFunctionToolRelationResponse, SubAgentFunctionToolRelationSelectSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, TextPartSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerAuthHeaderInputSchema, TriggerAuthHeaderStoredSchema, TriggerAuthHeaderUpdateSchema, TriggerAuthenticationInputSchema, TriggerAuthenticationSchema, TriggerAuthenticationStoredSchema, TriggerAuthenticationUpdateSchema, TriggerBatchConversationEvaluationSchema, TriggerConversationEvaluationSchema, TriggerDatasetRunSchema, TriggerEvaluationJobSchema, TriggerInsertSchema, TriggerInvocationApiInsertSchema, TriggerInvocationApiSelectSchema, TriggerInvocationApiUpdateSchema, TriggerInvocationInsertSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationSelectSchema, TriggerInvocationStatusEnum, TriggerInvocationUpdateSchema, TriggerListResponse, TriggerOutputTransformSchema, TriggerResponse, TriggerSelectSchema, TriggerUpdateSchema, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, URL_SAFE_ID_PATTERN, WorkAppGitHubAccessGetResponseSchema, WorkAppGitHubAccessModeSchema, WorkAppGitHubAccessSetRequestSchema, WorkAppGitHubAccessSetResponseSchema, WorkAppGitHubAccountTypeSchema, WorkAppGitHubInstallationApiInsertSchema, WorkAppGitHubInstallationInsertSchema, WorkAppGitHubInstallationSelectSchema, WorkAppGitHubInstallationStatusSchema, WorkAppGitHubMcpToolRepositoryAccessSelectSchema, WorkAppGitHubProjectRepositoryAccessSelectSchema, WorkAppGitHubRepositoryApiInsertSchema, WorkAppGitHubRepositoryInsertSchema, WorkAppGitHubRepositorySelectSchema, WorkAppGithubInstallationApiSelectSchema, canDelegateToExternalAgentInsertSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentInsertSchema, canDelegateToTeamAgentSchema, canRelateToInternalSubAgentSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-core",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260212003026",
|
|
4
4
|
"description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { workAppSlackChannelAgentConfigs, workAppSlackUserMappings, workAppSlackWorkspaces } from "../../db/runtime/runtime-schema.js";
|
|
2
|
-
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
3
|
-
|
|
4
|
-
//#region src/data-access/runtime/workAppSlack.d.ts
|
|
5
|
-
type WorkAppSlackWorkspaceInsert = typeof workAppSlackWorkspaces.$inferInsert;
|
|
6
|
-
type WorkAppSlackWorkspaceSelect = typeof workAppSlackWorkspaces.$inferSelect;
|
|
7
|
-
type WorkAppSlackUserMappingInsert = typeof workAppSlackUserMappings.$inferInsert;
|
|
8
|
-
type WorkAppSlackUserMappingSelect = typeof workAppSlackUserMappings.$inferSelect;
|
|
9
|
-
type WorkAppSlackChannelAgentConfigInsert = typeof workAppSlackChannelAgentConfigs.$inferInsert;
|
|
10
|
-
type WorkAppSlackChannelAgentConfigSelect = typeof workAppSlackChannelAgentConfigs.$inferSelect;
|
|
11
|
-
declare const createWorkAppSlackWorkspace: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackWorkspaceInsert, "id" | "createdAt" | "updatedAt">) => Promise<WorkAppSlackWorkspaceSelect>;
|
|
12
|
-
declare const findWorkAppSlackWorkspaceByTeamId: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
13
|
-
/**
|
|
14
|
-
* Find a workspace by Slack team ID only (without tenant filter).
|
|
15
|
-
* Slack team IDs are globally unique, so this is safe for resolving
|
|
16
|
-
* the tenant from an incoming Slack event where tenant is unknown.
|
|
17
|
-
*/
|
|
18
|
-
declare const findWorkAppSlackWorkspaceBySlackTeamId: (db: AgentsRunDatabaseClient) => (slackTeamId: string) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
19
|
-
/**
|
|
20
|
-
* Find a workspace by its Nango connection ID.
|
|
21
|
-
*
|
|
22
|
-
* One Nango connection = one OAuth token = one Slack workspace.
|
|
23
|
-
* The nangoConnectionId should be globally unique (not per-tenant).
|
|
24
|
-
* The schema has a unique constraint on nangoConnectionId ensuring this.
|
|
25
|
-
*/
|
|
26
|
-
declare const findWorkAppSlackWorkspaceByNangoConnectionId: (db: AgentsRunDatabaseClient) => (nangoConnectionId: string) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
27
|
-
declare const listWorkAppSlackWorkspacesByTenant: (db: AgentsRunDatabaseClient) => (tenantId: string) => Promise<WorkAppSlackWorkspaceSelect[]>;
|
|
28
|
-
declare const updateWorkAppSlackWorkspace: (db: AgentsRunDatabaseClient) => (id: string, data: Partial<Pick<WorkAppSlackWorkspaceInsert, "status" | "slackTeamName">>) => Promise<WorkAppSlackWorkspaceSelect | null>;
|
|
29
|
-
declare const deleteWorkAppSlackWorkspace: (db: AgentsRunDatabaseClient) => (id: string) => Promise<boolean>;
|
|
30
|
-
declare const deleteWorkAppSlackWorkspaceByNangoConnectionId: (db: AgentsRunDatabaseClient) => (nangoConnectionId: string) => Promise<boolean>;
|
|
31
|
-
declare const findWorkAppSlackUserMapping: (db: AgentsRunDatabaseClient) => (tenantId: string, slackUserId: string, slackTeamId: string, clientId?: string) => Promise<WorkAppSlackUserMappingSelect | null>;
|
|
32
|
-
declare const findWorkAppSlackUserMappingByInkeepUserId: (db: AgentsRunDatabaseClient) => (inkeepUserId: string) => Promise<WorkAppSlackUserMappingSelect[]>;
|
|
33
|
-
/**
|
|
34
|
-
* Find a user mapping by Slack user ID and team ID only (ignores tenant).
|
|
35
|
-
* Use this when you need to find the user's tenant from their mapping.
|
|
36
|
-
*/
|
|
37
|
-
declare const findWorkAppSlackUserMappingBySlackUser: (db: AgentsRunDatabaseClient) => (slackUserId: string, slackTeamId: string, clientId?: string) => Promise<WorkAppSlackUserMappingSelect | null>;
|
|
38
|
-
declare const listWorkAppSlackUserMappingsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<WorkAppSlackUserMappingSelect[]>;
|
|
39
|
-
declare const createWorkAppSlackUserMapping: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackUserMappingInsert, "id" | "clientId" | "createdAt" | "updatedAt"> & {
|
|
40
|
-
clientId?: string;
|
|
41
|
-
}) => Promise<WorkAppSlackUserMappingSelect>;
|
|
42
|
-
declare const deleteWorkAppSlackUserMapping: (db: AgentsRunDatabaseClient) => (tenantId: string, slackUserId: string, slackTeamId: string, clientId?: string) => Promise<boolean>;
|
|
43
|
-
declare const deleteAllWorkAppSlackUserMappingsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string, clientId?: string) => Promise<number>;
|
|
44
|
-
declare const createWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackChannelAgentConfigInsert, "id" | "createdAt" | "updatedAt">) => Promise<WorkAppSlackChannelAgentConfigSelect>;
|
|
45
|
-
declare const findWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string, slackChannelId: string) => Promise<WorkAppSlackChannelAgentConfigSelect | null>;
|
|
46
|
-
declare const listWorkAppSlackChannelAgentConfigsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<WorkAppSlackChannelAgentConfigSelect[]>;
|
|
47
|
-
/**
|
|
48
|
-
* Atomic upsert using onConflictDoUpdate to avoid TOCTOU race conditions.
|
|
49
|
-
* Uses the unique constraint on (tenantId, slackTeamId, slackChannelId).
|
|
50
|
-
*/
|
|
51
|
-
declare const upsertWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (data: Omit<WorkAppSlackChannelAgentConfigInsert, "id" | "createdAt" | "updatedAt">) => Promise<WorkAppSlackChannelAgentConfigSelect>;
|
|
52
|
-
declare const deleteWorkAppSlackChannelAgentConfig: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string, slackChannelId: string) => Promise<boolean>;
|
|
53
|
-
declare const deleteAllWorkAppSlackChannelAgentConfigsByTeam: (db: AgentsRunDatabaseClient) => (tenantId: string, slackTeamId: string) => Promise<number>;
|
|
54
|
-
//#endregion
|
|
55
|
-
export { WorkAppSlackChannelAgentConfigInsert, WorkAppSlackChannelAgentConfigSelect, WorkAppSlackUserMappingInsert, WorkAppSlackUserMappingSelect, WorkAppSlackWorkspaceInsert, WorkAppSlackWorkspaceSelect, createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, updateWorkAppSlackWorkspace, upsertWorkAppSlackChannelAgentConfig };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { workAppSlackChannelAgentConfigs, workAppSlackUserMappings, workAppSlackWorkspaces } from "../../db/runtime/runtime-schema.js";
|
|
2
|
-
import { and, eq } from "drizzle-orm";
|
|
3
|
-
import { nanoid } from "nanoid";
|
|
4
|
-
|
|
5
|
-
//#region src/data-access/runtime/workAppSlack.ts
|
|
6
|
-
const DEFAULT_CLIENT_ID = "work-apps-slack";
|
|
7
|
-
const createWorkAppSlackWorkspace = (db) => async (data) => {
|
|
8
|
-
const id = `wsw_${nanoid(21)}`;
|
|
9
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10
|
-
const [result] = await db.insert(workAppSlackWorkspaces).values({
|
|
11
|
-
id,
|
|
12
|
-
...data,
|
|
13
|
-
createdAt: now,
|
|
14
|
-
updatedAt: now
|
|
15
|
-
}).returning();
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
|
-
const findWorkAppSlackWorkspaceByTeamId = (db) => async (tenantId, slackTeamId) => {
|
|
19
|
-
return (await db.select().from(workAppSlackWorkspaces).where(and(eq(workAppSlackWorkspaces.tenantId, tenantId), eq(workAppSlackWorkspaces.slackTeamId, slackTeamId))).limit(1))[0] || null;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Find a workspace by Slack team ID only (without tenant filter).
|
|
23
|
-
* Slack team IDs are globally unique, so this is safe for resolving
|
|
24
|
-
* the tenant from an incoming Slack event where tenant is unknown.
|
|
25
|
-
*/
|
|
26
|
-
const findWorkAppSlackWorkspaceBySlackTeamId = (db) => async (slackTeamId) => {
|
|
27
|
-
return (await db.select().from(workAppSlackWorkspaces).where(eq(workAppSlackWorkspaces.slackTeamId, slackTeamId)).limit(1))[0] || null;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Find a workspace by its Nango connection ID.
|
|
31
|
-
*
|
|
32
|
-
* One Nango connection = one OAuth token = one Slack workspace.
|
|
33
|
-
* The nangoConnectionId should be globally unique (not per-tenant).
|
|
34
|
-
* The schema has a unique constraint on nangoConnectionId ensuring this.
|
|
35
|
-
*/
|
|
36
|
-
const findWorkAppSlackWorkspaceByNangoConnectionId = (db) => async (nangoConnectionId) => {
|
|
37
|
-
return (await db.select().from(workAppSlackWorkspaces).where(eq(workAppSlackWorkspaces.nangoConnectionId, nangoConnectionId)))[0] || null;
|
|
38
|
-
};
|
|
39
|
-
const listWorkAppSlackWorkspacesByTenant = (db) => async (tenantId) => {
|
|
40
|
-
return db.select().from(workAppSlackWorkspaces).where(eq(workAppSlackWorkspaces.tenantId, tenantId));
|
|
41
|
-
};
|
|
42
|
-
const updateWorkAppSlackWorkspace = (db) => async (id, data) => {
|
|
43
|
-
const [result] = await db.update(workAppSlackWorkspaces).set({
|
|
44
|
-
...data,
|
|
45
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
46
|
-
}).where(eq(workAppSlackWorkspaces.id, id)).returning();
|
|
47
|
-
return result || null;
|
|
48
|
-
};
|
|
49
|
-
const deleteWorkAppSlackWorkspace = (db) => async (id) => {
|
|
50
|
-
return (await db.delete(workAppSlackWorkspaces).where(eq(workAppSlackWorkspaces.id, id)).returning()).length > 0;
|
|
51
|
-
};
|
|
52
|
-
const deleteWorkAppSlackWorkspaceByNangoConnectionId = (db) => async (nangoConnectionId) => {
|
|
53
|
-
return (await db.delete(workAppSlackWorkspaces).where(eq(workAppSlackWorkspaces.nangoConnectionId, nangoConnectionId)).returning()).length > 0;
|
|
54
|
-
};
|
|
55
|
-
const findWorkAppSlackUserMapping = (db) => async (tenantId, slackUserId, slackTeamId, clientId = DEFAULT_CLIENT_ID) => {
|
|
56
|
-
return (await db.select().from(workAppSlackUserMappings).where(and(eq(workAppSlackUserMappings.tenantId, tenantId), eq(workAppSlackUserMappings.clientId, clientId), eq(workAppSlackUserMappings.slackUserId, slackUserId), eq(workAppSlackUserMappings.slackTeamId, slackTeamId))).limit(1))[0] || null;
|
|
57
|
-
};
|
|
58
|
-
const findWorkAppSlackUserMappingByInkeepUserId = (db) => async (inkeepUserId) => {
|
|
59
|
-
return db.select().from(workAppSlackUserMappings).where(eq(workAppSlackUserMappings.inkeepUserId, inkeepUserId));
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Find a user mapping by Slack user ID and team ID only (ignores tenant).
|
|
63
|
-
* Use this when you need to find the user's tenant from their mapping.
|
|
64
|
-
*/
|
|
65
|
-
const findWorkAppSlackUserMappingBySlackUser = (db) => async (slackUserId, slackTeamId, clientId = DEFAULT_CLIENT_ID) => {
|
|
66
|
-
return (await db.select().from(workAppSlackUserMappings).where(and(eq(workAppSlackUserMappings.clientId, clientId), eq(workAppSlackUserMappings.slackUserId, slackUserId), eq(workAppSlackUserMappings.slackTeamId, slackTeamId))).limit(1))[0] || null;
|
|
67
|
-
};
|
|
68
|
-
const listWorkAppSlackUserMappingsByTeam = (db) => async (tenantId, slackTeamId) => {
|
|
69
|
-
return db.select().from(workAppSlackUserMappings).where(and(eq(workAppSlackUserMappings.tenantId, tenantId), eq(workAppSlackUserMappings.slackTeamId, slackTeamId)));
|
|
70
|
-
};
|
|
71
|
-
const createWorkAppSlackUserMapping = (db) => async (data) => {
|
|
72
|
-
const id = `wsum_${nanoid(21)}`;
|
|
73
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
74
|
-
const [result] = await db.insert(workAppSlackUserMappings).values({
|
|
75
|
-
id,
|
|
76
|
-
clientId: data.clientId || DEFAULT_CLIENT_ID,
|
|
77
|
-
...data,
|
|
78
|
-
linkedAt: now,
|
|
79
|
-
createdAt: now,
|
|
80
|
-
updatedAt: now
|
|
81
|
-
}).returning();
|
|
82
|
-
return result;
|
|
83
|
-
};
|
|
84
|
-
const deleteWorkAppSlackUserMapping = (db) => async (tenantId, slackUserId, slackTeamId, clientId = DEFAULT_CLIENT_ID) => {
|
|
85
|
-
return (await db.delete(workAppSlackUserMappings).where(and(eq(workAppSlackUserMappings.tenantId, tenantId), eq(workAppSlackUserMappings.clientId, clientId), eq(workAppSlackUserMappings.slackUserId, slackUserId), eq(workAppSlackUserMappings.slackTeamId, slackTeamId))).returning()).length > 0;
|
|
86
|
-
};
|
|
87
|
-
const deleteAllWorkAppSlackUserMappingsByTeam = (db) => async (tenantId, slackTeamId, clientId = DEFAULT_CLIENT_ID) => {
|
|
88
|
-
return (await db.delete(workAppSlackUserMappings).where(and(eq(workAppSlackUserMappings.tenantId, tenantId), eq(workAppSlackUserMappings.clientId, clientId), eq(workAppSlackUserMappings.slackTeamId, slackTeamId))).returning()).length;
|
|
89
|
-
};
|
|
90
|
-
const createWorkAppSlackChannelAgentConfig = (db) => async (data) => {
|
|
91
|
-
const id = `wscac_${nanoid(21)}`;
|
|
92
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
93
|
-
const [result] = await db.insert(workAppSlackChannelAgentConfigs).values({
|
|
94
|
-
id,
|
|
95
|
-
...data,
|
|
96
|
-
createdAt: now,
|
|
97
|
-
updatedAt: now
|
|
98
|
-
}).returning();
|
|
99
|
-
return result;
|
|
100
|
-
};
|
|
101
|
-
const findWorkAppSlackChannelAgentConfig = (db) => async (tenantId, slackTeamId, slackChannelId) => {
|
|
102
|
-
return (await db.select().from(workAppSlackChannelAgentConfigs).where(and(eq(workAppSlackChannelAgentConfigs.tenantId, tenantId), eq(workAppSlackChannelAgentConfigs.slackTeamId, slackTeamId), eq(workAppSlackChannelAgentConfigs.slackChannelId, slackChannelId))).limit(1))[0] || null;
|
|
103
|
-
};
|
|
104
|
-
const listWorkAppSlackChannelAgentConfigsByTeam = (db) => async (tenantId, slackTeamId) => {
|
|
105
|
-
return db.select().from(workAppSlackChannelAgentConfigs).where(and(eq(workAppSlackChannelAgentConfigs.tenantId, tenantId), eq(workAppSlackChannelAgentConfigs.slackTeamId, slackTeamId)));
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Atomic upsert using onConflictDoUpdate to avoid TOCTOU race conditions.
|
|
109
|
-
* Uses the unique constraint on (tenantId, slackTeamId, slackChannelId).
|
|
110
|
-
*/
|
|
111
|
-
const upsertWorkAppSlackChannelAgentConfig = (db) => async (data) => {
|
|
112
|
-
const id = `wscac_${nanoid(21)}`;
|
|
113
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
114
|
-
const [result] = await db.insert(workAppSlackChannelAgentConfigs).values({
|
|
115
|
-
id,
|
|
116
|
-
...data,
|
|
117
|
-
createdAt: now,
|
|
118
|
-
updatedAt: now
|
|
119
|
-
}).onConflictDoUpdate({
|
|
120
|
-
target: [
|
|
121
|
-
workAppSlackChannelAgentConfigs.tenantId,
|
|
122
|
-
workAppSlackChannelAgentConfigs.slackTeamId,
|
|
123
|
-
workAppSlackChannelAgentConfigs.slackChannelId
|
|
124
|
-
],
|
|
125
|
-
set: {
|
|
126
|
-
projectId: data.projectId,
|
|
127
|
-
agentId: data.agentId,
|
|
128
|
-
agentName: data.agentName,
|
|
129
|
-
slackChannelName: data.slackChannelName,
|
|
130
|
-
slackChannelType: data.slackChannelType,
|
|
131
|
-
enabled: data.enabled,
|
|
132
|
-
configuredByUserId: data.configuredByUserId,
|
|
133
|
-
updatedAt: now
|
|
134
|
-
}
|
|
135
|
-
}).returning();
|
|
136
|
-
return result;
|
|
137
|
-
};
|
|
138
|
-
const deleteWorkAppSlackChannelAgentConfig = (db) => async (tenantId, slackTeamId, slackChannelId) => {
|
|
139
|
-
return (await db.delete(workAppSlackChannelAgentConfigs).where(and(eq(workAppSlackChannelAgentConfigs.tenantId, tenantId), eq(workAppSlackChannelAgentConfigs.slackTeamId, slackTeamId), eq(workAppSlackChannelAgentConfigs.slackChannelId, slackChannelId))).returning()).length > 0;
|
|
140
|
-
};
|
|
141
|
-
const deleteAllWorkAppSlackChannelAgentConfigsByTeam = (db) => async (tenantId, slackTeamId) => {
|
|
142
|
-
return (await db.delete(workAppSlackChannelAgentConfigs).where(and(eq(workAppSlackChannelAgentConfigs.tenantId, tenantId), eq(workAppSlackChannelAgentConfigs.slackTeamId, slackTeamId))).returning()).length;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
//#endregion
|
|
146
|
-
export { createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, updateWorkAppSlackWorkspace, upsertWorkAppSlackChannelAgentConfig };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { JwtVerifyResult } from "./jwt-helpers.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
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
|
-
*/
|
|
12
|
-
declare const SlackLinkTokenPayloadSchema: z.ZodObject<{
|
|
13
|
-
iss: z.ZodLiteral<"inkeep-auth">;
|
|
14
|
-
aud: z.ZodLiteral<"slack-link">;
|
|
15
|
-
sub: z.ZodString;
|
|
16
|
-
iat: z.ZodNumber;
|
|
17
|
-
exp: z.ZodNumber;
|
|
18
|
-
jti: z.ZodOptional<z.ZodString>;
|
|
19
|
-
tokenUse: z.ZodLiteral<"slackLinkCode">;
|
|
20
|
-
tenantId: z.ZodString;
|
|
21
|
-
slack: z.ZodObject<{
|
|
22
|
-
teamId: z.ZodString;
|
|
23
|
-
userId: z.ZodString;
|
|
24
|
-
enterpriseId: z.ZodOptional<z.ZodString>;
|
|
25
|
-
username: z.ZodOptional<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
type SlackLinkTokenPayload = z.infer<typeof SlackLinkTokenPayloadSchema>;
|
|
29
|
-
/**
|
|
30
|
-
* Parameters for generating a Slack link token
|
|
31
|
-
*/
|
|
32
|
-
interface SignSlackLinkTokenParams {
|
|
33
|
-
tenantId: string;
|
|
34
|
-
slackTeamId: string;
|
|
35
|
-
slackUserId: string;
|
|
36
|
-
slackEnterpriseId?: string;
|
|
37
|
-
slackUsername?: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Result of verifying a Slack link token
|
|
41
|
-
*/
|
|
42
|
-
type VerifySlackLinkTokenResult = JwtVerifyResult<SlackLinkTokenPayload>;
|
|
43
|
-
/**
|
|
44
|
-
* Sign a Slack link JWT token for the device authorization flow.
|
|
45
|
-
* Token expires in 10 minutes.
|
|
46
|
-
*
|
|
47
|
-
* This token is generated when a user runs `/inkeep link` in Slack
|
|
48
|
-
* and is verified when they visit the dashboard link page.
|
|
49
|
-
*/
|
|
50
|
-
declare function signSlackLinkToken(params: SignSlackLinkTokenParams): Promise<string>;
|
|
51
|
-
/**
|
|
52
|
-
* Verify and decode a Slack link JWT token.
|
|
53
|
-
* Validates signature, expiration, issuer, audience, and schema.
|
|
54
|
-
*/
|
|
55
|
-
declare function verifySlackLinkToken(token: string): Promise<VerifySlackLinkTokenResult>;
|
|
56
|
-
//#endregion
|
|
57
|
-
export { SignSlackLinkTokenParams, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, VerifySlackLinkTokenResult, signSlackLinkToken, verifySlackLinkToken };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { getLogger } from "./logger.js";
|
|
2
|
-
import { signJwt, verifyJwt } from "./jwt-helpers.js";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
//#region src/utils/slack-link-token.ts
|
|
6
|
-
const logger = getLogger("slack-link-token");
|
|
7
|
-
const ISSUER = "inkeep-auth";
|
|
8
|
-
const AUDIENCE = "slack-link";
|
|
9
|
-
const TOKEN_USE = "slackLinkCode";
|
|
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
|
-
*/
|
|
17
|
-
const SlackLinkTokenPayloadSchema = z.object({
|
|
18
|
-
iss: z.literal(ISSUER),
|
|
19
|
-
aud: z.literal(AUDIENCE),
|
|
20
|
-
sub: z.string().min(1),
|
|
21
|
-
iat: z.number(),
|
|
22
|
-
exp: z.number(),
|
|
23
|
-
jti: z.string().optional(),
|
|
24
|
-
tokenUse: z.literal(TOKEN_USE),
|
|
25
|
-
tenantId: z.string().min(1),
|
|
26
|
-
slack: z.object({
|
|
27
|
-
teamId: z.string().min(1),
|
|
28
|
-
userId: z.string().min(1),
|
|
29
|
-
enterpriseId: z.string().min(1).optional(),
|
|
30
|
-
username: z.string().optional()
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Sign a Slack link JWT token for the device authorization flow.
|
|
35
|
-
* Token expires in 10 minutes.
|
|
36
|
-
*
|
|
37
|
-
* This token is generated when a user runs `/inkeep link` in Slack
|
|
38
|
-
* and is verified when they visit the dashboard link page.
|
|
39
|
-
*/
|
|
40
|
-
async function signSlackLinkToken(params) {
|
|
41
|
-
try {
|
|
42
|
-
const token = await signJwt({
|
|
43
|
-
issuer: ISSUER,
|
|
44
|
-
subject: `slack:${params.slackTeamId}:${params.slackUserId}`,
|
|
45
|
-
audience: AUDIENCE,
|
|
46
|
-
expiresIn: TOKEN_TTL,
|
|
47
|
-
claims: {
|
|
48
|
-
tokenUse: TOKEN_USE,
|
|
49
|
-
tenantId: params.tenantId,
|
|
50
|
-
slack: {
|
|
51
|
-
teamId: params.slackTeamId,
|
|
52
|
-
userId: params.slackUserId,
|
|
53
|
-
...params.slackEnterpriseId && { enterpriseId: params.slackEnterpriseId },
|
|
54
|
-
...params.slackUsername && { username: params.slackUsername }
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
logger.debug({
|
|
59
|
-
tenantId: params.tenantId,
|
|
60
|
-
slackTeamId: params.slackTeamId,
|
|
61
|
-
slackUserId: params.slackUserId
|
|
62
|
-
}, "Generated Slack link token");
|
|
63
|
-
return token;
|
|
64
|
-
} catch (error) {
|
|
65
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
66
|
-
logger.error({
|
|
67
|
-
error,
|
|
68
|
-
errorMessage
|
|
69
|
-
}, "Failed to generate Slack link token");
|
|
70
|
-
throw new Error(`Failed to generate Slack link token: ${errorMessage}`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Verify and decode a Slack link JWT token.
|
|
75
|
-
* Validates signature, expiration, issuer, audience, and schema.
|
|
76
|
-
*/
|
|
77
|
-
async function verifySlackLinkToken(token) {
|
|
78
|
-
const result = await verifyJwt(token, {
|
|
79
|
-
issuer: ISSUER,
|
|
80
|
-
audience: AUDIENCE
|
|
81
|
-
});
|
|
82
|
-
if (!result.valid || !result.payload) {
|
|
83
|
-
logger.warn({ error: result.error }, "Slack link token verification failed");
|
|
84
|
-
return {
|
|
85
|
-
valid: false,
|
|
86
|
-
error: result.error
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
const parseResult = SlackLinkTokenPayloadSchema.safeParse(result.payload);
|
|
90
|
-
if (!parseResult.success) {
|
|
91
|
-
logger.warn({
|
|
92
|
-
payload: result.payload,
|
|
93
|
-
issues: parseResult.error.issues
|
|
94
|
-
}, "Invalid Slack link token: schema validation failed");
|
|
95
|
-
return {
|
|
96
|
-
valid: false,
|
|
97
|
-
error: `Invalid token schema: ${parseResult.error.issues.map((e) => e.message).join(", ")}`
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
logger.debug({
|
|
101
|
-
tenantId: parseResult.data.tenantId,
|
|
102
|
-
slackTeamId: parseResult.data.slack.teamId,
|
|
103
|
-
slackUserId: parseResult.data.slack.userId
|
|
104
|
-
}, "Successfully verified Slack link token");
|
|
105
|
-
return {
|
|
106
|
-
valid: true,
|
|
107
|
-
payload: parseResult.data
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
//#endregion
|
|
112
|
-
export { SlackLinkTokenPayloadSchema, signSlackLinkToken, verifySlackLinkToken };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { JwtVerifyResult } from "./jwt-helpers.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/utils/slack-user-token.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Zod schema for validating Slack user access token JWT payload.
|
|
8
|
-
* This is the canonical schema from the work_apps_slack spec.
|
|
9
|
-
*/
|
|
10
|
-
declare const SlackAccessTokenPayloadSchema: z.ZodObject<{
|
|
11
|
-
iss: z.ZodLiteral<"inkeep-auth">;
|
|
12
|
-
aud: z.ZodLiteral<"inkeep-api">;
|
|
13
|
-
sub: z.ZodString;
|
|
14
|
-
iat: z.ZodNumber;
|
|
15
|
-
exp: z.ZodNumber;
|
|
16
|
-
jti: z.ZodOptional<z.ZodString>;
|
|
17
|
-
tokenUse: z.ZodLiteral<"slackUser">;
|
|
18
|
-
act: z.ZodObject<{
|
|
19
|
-
sub: z.ZodLiteral<"inkeep-work-app-slack">;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
tenantId: z.ZodString;
|
|
22
|
-
slack: z.ZodObject<{
|
|
23
|
-
teamId: z.ZodString;
|
|
24
|
-
userId: z.ZodString;
|
|
25
|
-
enterpriseId: z.ZodOptional<z.ZodString>;
|
|
26
|
-
email: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
type SlackAccessTokenPayload = z.infer<typeof SlackAccessTokenPayloadSchema>;
|
|
30
|
-
/**
|
|
31
|
-
* Parameters for generating a Slack user token
|
|
32
|
-
*/
|
|
33
|
-
interface SignSlackUserTokenParams {
|
|
34
|
-
inkeepUserId: string;
|
|
35
|
-
tenantId: string;
|
|
36
|
-
slackTeamId: string;
|
|
37
|
-
slackUserId: string;
|
|
38
|
-
slackEnterpriseId?: string;
|
|
39
|
-
slackEmail?: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Result of verifying a Slack user token
|
|
43
|
-
*/
|
|
44
|
-
type VerifySlackUserTokenResult = JwtVerifyResult<SlackAccessTokenPayload>;
|
|
45
|
-
/**
|
|
46
|
-
* Sign a Slack user JWT token for calling Manage/Run APIs.
|
|
47
|
-
* Token expires in 5 minutes.
|
|
48
|
-
*
|
|
49
|
-
* This token is used when Slack runtime logic needs to call:
|
|
50
|
-
* - Manage API (list projects, list agents)
|
|
51
|
-
* - Run API (POST /run/api/chat)
|
|
52
|
-
*/
|
|
53
|
-
declare function signSlackUserToken(params: SignSlackUserTokenParams): Promise<string>;
|
|
54
|
-
/**
|
|
55
|
-
* Verify and decode a Slack user JWT token.
|
|
56
|
-
* Validates signature, expiration, issuer, audience, and schema.
|
|
57
|
-
*/
|
|
58
|
-
declare function verifySlackUserToken(token: string): Promise<VerifySlackUserTokenResult>;
|
|
59
|
-
/**
|
|
60
|
-
* Check if a token looks like a Slack user JWT (quick check before full verification).
|
|
61
|
-
* Returns true if the token has the expected issuer and tokenUse.
|
|
62
|
-
*/
|
|
63
|
-
declare function isSlackUserToken(token: string): boolean;
|
|
64
|
-
//#endregion
|
|
65
|
-
export { SignSlackUserTokenParams, SlackAccessTokenPayload, SlackAccessTokenPayloadSchema, VerifySlackUserTokenResult, isSlackUserToken, signSlackUserToken, verifySlackUserToken };
|