import { JwtVerifyResult } from "./jwt-helpers.js";
import { z } from "zod";

//#region src/utils/slack-link-token.d.ts
declare const SlackLinkIntentSchema: z.ZodObject<{
  entryPoint: z.ZodEnum<{
    mention: "mention";
    question_command: "question_command";
    run_command: "run_command";
    dm: "dm";
  }>;
  question: z.ZodString;
  channelId: z.ZodString;
  threadTs: z.ZodOptional<z.ZodString>;
  messageTs: z.ZodOptional<z.ZodString>;
  agentIdentifier: z.ZodOptional<z.ZodString>;
  agentId: z.ZodOptional<z.ZodString>;
  projectId: z.ZodOptional<z.ZodString>;
  responseUrl: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SlackLinkIntent = z.infer<typeof SlackLinkIntentSchema>;
declare const SlackLinkTokenPayloadSchema: z.ZodObject<{
  iss: z.ZodLiteral<"inkeep-auth">;
  aud: z.ZodLiteral<"slack-link">;
  sub: z.ZodString;
  iat: z.ZodNumber;
  exp: z.ZodNumber;
  jti: z.ZodOptional<z.ZodString>;
  tokenUse: z.ZodLiteral<"slackLinkCode">;
  tenantId: z.ZodString;
  slack: z.ZodObject<{
    teamId: z.ZodString;
    userId: z.ZodString;
    enterpriseId: z.ZodOptional<z.ZodString>;
    username: z.ZodOptional<z.ZodString>;
  }, z.core.$strip>;
  intent: z.ZodOptional<z.ZodObject<{
    entryPoint: z.ZodEnum<{
      mention: "mention";
      question_command: "question_command";
      run_command: "run_command";
      dm: "dm";
    }>;
    question: z.ZodString;
    channelId: z.ZodString;
    threadTs: z.ZodOptional<z.ZodString>;
    messageTs: z.ZodOptional<z.ZodString>;
    agentIdentifier: z.ZodOptional<z.ZodString>;
    agentId: z.ZodOptional<z.ZodString>;
    projectId: z.ZodOptional<z.ZodString>;
    responseUrl: z.ZodOptional<z.ZodString>;
  }, z.core.$strip>>;
}, z.core.$strip>;
type SlackLinkTokenPayload = z.infer<typeof SlackLinkTokenPayloadSchema>;
/**
 * Parameters for generating a Slack link token
 */
interface SignSlackLinkTokenParams {
  tenantId: string;
  slackTeamId: string;
  slackUserId: string;
  slackEnterpriseId?: string;
  slackUsername?: string;
  intent?: SlackLinkIntent;
}
/**
 * Result of verifying a Slack link token
 */
type VerifySlackLinkTokenResult = JwtVerifyResult<SlackLinkTokenPayload>;
/**
 * Sign a Slack link JWT token for the device authorization flow.
 * Token expires in 10 minutes.
 *
 * This token is generated when a user runs `/inkeep link` in Slack
 * and is verified when they visit the dashboard link page.
 */
declare function signSlackLinkToken(params: SignSlackLinkTokenParams): Promise<string>;
/**
 * Verify and decode a Slack link JWT token.
 * Validates signature, expiration, issuer, audience, and schema.
 */
declare function verifySlackLinkToken(token: string): Promise<VerifySlackLinkTokenResult>;
//#endregion
export { SignSlackLinkTokenParams, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, VerifySlackLinkTokenResult, signSlackLinkToken, verifySlackLinkToken };