import { Command } from "commander";
import { z } from "zod";

//#region src/schemas/sources.d.ts

declare const GlobalSourcesSchema: z.ZodObject<{
  gmail: z.ZodOptional<z.ZodObject<{
    type: z.ZodLiteral<"gmail">;
    query: z.ZodString;
    enabled: z.ZodDefault<z.ZodBoolean>;
  }, "strip", z.ZodTypeAny, {
    type: "gmail";
    query: string;
    enabled: boolean;
  }, {
    type: "gmail";
    query: string;
    enabled?: boolean | undefined;
  }>>;
  calendar: z.ZodOptional<z.ZodObject<{
    enabled: z.ZodDefault<z.ZodBoolean>;
  }, "strip", z.ZodTypeAny, {
    enabled: boolean;
  }, {
    enabled?: boolean | undefined;
  }>>;
  transcripts: z.ZodOptional<z.ZodObject<{
    type: z.ZodLiteral<"transcript">;
    paths: z.ZodArray<z.ZodString, "many">;
    extensions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    enabled: z.ZodDefault<z.ZodBoolean>;
  }, "strip", z.ZodTypeAny, {
    type: "transcript";
    enabled: boolean;
    paths: string[];
    extensions: string[];
  }, {
    type: "transcript";
    paths: string[];
    enabled?: boolean | undefined;
    extensions?: string[] | undefined;
  }>>;
  version: z.ZodDefault<z.ZodNumber>;
  created: z.ZodString;
}, "strip", z.ZodTypeAny, {
  version: number;
  created: string;
  gmail?: {
    type: "gmail";
    query: string;
    enabled: boolean;
  } | undefined;
  calendar?: {
    enabled: boolean;
  } | undefined;
  transcripts?: {
    type: "transcript";
    enabled: boolean;
    paths: string[];
    extensions: string[];
  } | undefined;
}, {
  created: string;
  gmail?: {
    type: "gmail";
    query: string;
    enabled?: boolean | undefined;
  } | undefined;
  calendar?: {
    enabled?: boolean | undefined;
  } | undefined;
  transcripts?: {
    type: "transcript";
    paths: string[];
    enabled?: boolean | undefined;
    extensions?: string[] | undefined;
  } | undefined;
  version?: number | undefined;
}>;
type GlobalSources = z.infer<typeof GlobalSourcesSchema>;
//# sourceMappingURL=sources.d.ts.map
//#endregion
//#region src/schemas/main-facts.d.ts
declare const MainFactsSchema: z.ZodObject<{
  name: z.ZodString;
  domain: z.ZodOptional<z.ZodString>;
  email: z.ZodOptional<z.ZodString>;
  phone: z.ZodOptional<z.ZodString>;
  industry: z.ZodOptional<z.ZodString>;
  relationship_stage: z.ZodEnum<["prospect", "active", "churned", "paused"]>;
  deal_value: z.ZodOptional<z.ZodNumber>;
  currency: z.ZodDefault<z.ZodString>;
  primary_contact: z.ZodOptional<z.ZodString>;
  timezone: z.ZodOptional<z.ZodString>;
  tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
  created: z.ZodEffects<z.ZodString, string, unknown>;
  updated: z.ZodEffects<z.ZodString, string, unknown>;
}, "strip", z.ZodTypeAny, {
  created: string;
  name: string;
  relationship_stage: "prospect" | "active" | "churned" | "paused";
  currency: string;
  tags: string[];
  updated: string;
  domain?: string | undefined;
  email?: string | undefined;
  phone?: string | undefined;
  industry?: string | undefined;
  deal_value?: number | undefined;
  primary_contact?: string | undefined;
  timezone?: string | undefined;
}, {
  name: string;
  relationship_stage: "prospect" | "active" | "churned" | "paused";
  created?: unknown;
  domain?: string | undefined;
  email?: string | undefined;
  phone?: string | undefined;
  industry?: string | undefined;
  deal_value?: number | undefined;
  currency?: string | undefined;
  primary_contact?: string | undefined;
  timezone?: string | undefined;
  tags?: string[] | undefined;
  updated?: unknown;
}>;
type MainFacts = z.infer<typeof MainFactsSchema>;
//# sourceMappingURL=main-facts.d.ts.map
//#endregion
//#region src/schemas/interaction.d.ts
declare const InteractionEntrySchema: z.ZodObject<{
  date: z.ZodString;
  type: z.ZodEnum<["Email", "Call", "Meeting", "Note", "Demo", "Proposal", "Contract", "Other"]>;
  direction: z.ZodOptional<z.ZodEnum<["inbound", "outbound"]>>;
  with: z.ZodString;
  subject: z.ZodOptional<z.ZodString>;
  summary: z.ZodString;
  nextSteps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
  /** Relative links (from the customer dir) to converted attachment Markdown. */
  attachments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
  sourceRef: z.ZodString;
  synced: z.ZodString;
}, "strip", z.ZodTypeAny, {
  date: string;
  type: "Email" | "Call" | "Meeting" | "Note" | "Demo" | "Proposal" | "Contract" | "Other";
  with: string;
  summary: string;
  nextSteps: string[];
  sourceRef: string;
  synced: string;
  direction?: "inbound" | "outbound" | undefined;
  subject?: string | undefined;
  attachments?: string[] | undefined;
}, {
  date: string;
  type: "Email" | "Call" | "Meeting" | "Note" | "Demo" | "Proposal" | "Contract" | "Other";
  with: string;
  summary: string;
  sourceRef: string;
  synced: string;
  direction?: "inbound" | "outbound" | undefined;
  subject?: string | undefined;
  nextSteps?: string[] | undefined;
  attachments?: string[] | undefined;
}>;
type InteractionEntry = z.infer<typeof InteractionEntrySchema>;
//# sourceMappingURL=interaction.d.ts.map
//#endregion
//#region src/schemas/pipeline.d.ts
declare const PipelineDealSchema: z.ZodObject<{
  name: z.ZodString;
  stage: z.ZodEnum<["lead", "qualified", "proposal", "negotiation", "won", "lost"]>;
  value: z.ZodOptional<z.ZodNumber>;
  currency: z.ZodDefault<z.ZodString>;
  probability: z.ZodOptional<z.ZodNumber>;
  close_date: z.ZodOptional<z.ZodString>;
  notes: z.ZodOptional<z.ZodString>;
  updated: z.ZodString;
}, "strip", z.ZodTypeAny, {
  name: string;
  currency: string;
  updated: string;
  stage: "lead" | "qualified" | "proposal" | "negotiation" | "won" | "lost";
  value?: number | undefined;
  probability?: number | undefined;
  close_date?: string | undefined;
  notes?: string | undefined;
}, {
  name: string;
  updated: string;
  stage: "lead" | "qualified" | "proposal" | "negotiation" | "won" | "lost";
  value?: number | undefined;
  currency?: string | undefined;
  probability?: number | undefined;
  close_date?: string | undefined;
  notes?: string | undefined;
}>;
type PipelineDeal = z.infer<typeof PipelineDealSchema>;
//# sourceMappingURL=pipeline.d.ts.map
//#endregion
//#region src/schemas/ticket.d.ts
declare const TicketStatusSchema: z.ZodEnum<["open", "in-progress", "waiting", "resolved", "closed"]>;
declare const TicketPrioritySchema: z.ZodEnum<["urgent", "high", "normal", "low"]>;
declare const TicketSchema: z.ZodObject<{
  id: z.ZodString;
  title: z.ZodString;
  status: z.ZodEnum<["open", "in-progress", "waiting", "resolved", "closed"]>;
  priority: z.ZodDefault<z.ZodEnum<["urgent", "high", "normal", "low"]>>;
  assignee: z.ZodOptional<z.ZodString>;
  created: z.ZodString;
  slaDue: z.ZodOptional<z.ZodString>;
  resolved: z.ZodOptional<z.ZodString>;
  description: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
  status: "open" | "in-progress" | "waiting" | "resolved" | "closed";
  created: string;
  id: string;
  title: string;
  priority: "urgent" | "high" | "normal" | "low";
  resolved?: string | undefined;
  assignee?: string | undefined;
  slaDue?: string | undefined;
  description?: string | undefined;
}, {
  status: "open" | "in-progress" | "waiting" | "resolved" | "closed";
  created: string;
  id: string;
  title: string;
  resolved?: string | undefined;
  priority?: "urgent" | "high" | "normal" | "low" | undefined;
  assignee?: string | undefined;
  slaDue?: string | undefined;
  description?: string | undefined;
}>;
type Ticket = z.infer<typeof TicketSchema>;
type TicketStatus = z.infer<typeof TicketStatusSchema>;
type TicketPriority = z.infer<typeof TicketPrioritySchema>;
//# sourceMappingURL=ticket.d.ts.map
//#endregion
//#region src/schemas/quote.d.ts
declare const QuoteLineItemSchema: z.ZodObject<{
  description: z.ZodString;
  quantity: z.ZodNumber;
  unitPrice: z.ZodNumber;
  total: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
  description: string;
  quantity: number;
  unitPrice: number;
  total: number;
}, {
  description: string;
  quantity: number;
  unitPrice: number;
  total: number;
}>;
declare const QuoteSchema: z.ZodObject<{
  quoteNumber: z.ZodString;
  slug: z.ZodString;
  dealName: z.ZodString;
  lineItems: z.ZodArray<z.ZodObject<{
    description: z.ZodString;
    quantity: z.ZodNumber;
    unitPrice: z.ZodNumber;
    total: z.ZodNumber;
  }, "strip", z.ZodTypeAny, {
    description: string;
    quantity: number;
    unitPrice: number;
    total: number;
  }, {
    description: string;
    quantity: number;
    unitPrice: number;
    total: number;
  }>, "many">;
  subtotal: z.ZodNumber;
  vatPercent: z.ZodNumber;
  vat: z.ZodNumber;
  total: z.ZodNumber;
  currency: z.ZodDefault<z.ZodString>;
  createdAt: z.ZodString;
  validUntilDays: z.ZodDefault<z.ZodNumber>;
  validUntil: z.ZodString;
  status: z.ZodDefault<z.ZodEnum<["draft", "sent", "viewed", "accepted", "declined"]>>;
  viewedAt: z.ZodOptional<z.ZodString>;
  acceptedAt: z.ZodOptional<z.ZodString>;
  htmlPath: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
  status: "draft" | "sent" | "viewed" | "accepted" | "declined";
  currency: string;
  total: number;
  quoteNumber: string;
  slug: string;
  dealName: string;
  lineItems: {
    description: string;
    quantity: number;
    unitPrice: number;
    total: number;
  }[];
  subtotal: number;
  vatPercent: number;
  vat: number;
  createdAt: string;
  validUntilDays: number;
  validUntil: string;
  viewedAt?: string | undefined;
  acceptedAt?: string | undefined;
  htmlPath?: string | undefined;
}, {
  total: number;
  quoteNumber: string;
  slug: string;
  dealName: string;
  lineItems: {
    description: string;
    quantity: number;
    unitPrice: number;
    total: number;
  }[];
  subtotal: number;
  vatPercent: number;
  vat: number;
  createdAt: string;
  validUntil: string;
  status?: "draft" | "sent" | "viewed" | "accepted" | "declined" | undefined;
  currency?: string | undefined;
  validUntilDays?: number | undefined;
  viewedAt?: string | undefined;
  acceptedAt?: string | undefined;
  htmlPath?: string | undefined;
}>;
type QuoteLineItem = z.infer<typeof QuoteLineItemSchema>;
type Quote = z.infer<typeof QuoteSchema>;
//# sourceMappingURL=quote.d.ts.map
//#endregion
//#region src/schemas/kb-article.d.ts
declare const KbArticleSchema: z.ZodObject<{
  id: z.ZodString;
  title: z.ZodString;
  category: z.ZodDefault<z.ZodString>;
  tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
  public: z.ZodDefault<z.ZodBoolean>;
  createdAt: z.ZodString;
  updatedAt: z.ZodString;
  sourceTicketId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
  tags: string[];
  id: string;
  title: string;
  createdAt: string;
  category: string;
  public: boolean;
  updatedAt: string;
  sourceTicketId?: string | undefined;
}, {
  id: string;
  title: string;
  createdAt: string;
  updatedAt: string;
  tags?: string[] | undefined;
  category?: string | undefined;
  public?: boolean | undefined;
  sourceTicketId?: string | undefined;
}>;
type KbArticleMeta = z.infer<typeof KbArticleSchema>;
type KbArticle = KbArticleMeta & {
  body: string;
};
//# sourceMappingURL=kb-article.d.ts.map
//#endregion
//#region src/schemas/survey.d.ts
declare const SurveyDefinitionSchema: z.ZodObject<{
  id: z.ZodString;
  type: z.ZodDefault<z.ZodEnum<["nps", "csat", "ces"]>>;
  question: z.ZodString;
  scale: z.ZodDefault<z.ZodObject<{
    min: z.ZodDefault<z.ZodNumber>;
    max: z.ZodDefault<z.ZodNumber>;
  }, "strip", z.ZodTypeAny, {
    min: number;
    max: number;
  }, {
    min?: number | undefined;
    max?: number | undefined;
  }>>;
  includeComment: z.ZodDefault<z.ZodBoolean>;
  commentPrompt: z.ZodOptional<z.ZodString>;
  createdAt: z.ZodString;
}, "strip", z.ZodTypeAny, {
  type: "nps" | "csat" | "ces";
  id: string;
  createdAt: string;
  question: string;
  scale: {
    min: number;
    max: number;
  };
  includeComment: boolean;
  commentPrompt?: string | undefined;
}, {
  id: string;
  createdAt: string;
  question: string;
  type?: "nps" | "csat" | "ces" | undefined;
  scale?: {
    min?: number | undefined;
    max?: number | undefined;
  } | undefined;
  includeComment?: boolean | undefined;
  commentPrompt?: string | undefined;
}>;
declare const SurveyResponseSchema: z.ZodObject<{
  surveyId: z.ZodString;
  slug: z.ZodString;
  contactEmail: z.ZodString;
  score: z.ZodNumber;
  comment: z.ZodOptional<z.ZodString>;
  respondedAt: z.ZodString;
  token: z.ZodString;
  sentAt: z.ZodString;
}, "strip", z.ZodTypeAny, {
  slug: string;
  surveyId: string;
  contactEmail: string;
  score: number;
  respondedAt: string;
  token: string;
  sentAt: string;
  comment?: string | undefined;
}, {
  slug: string;
  surveyId: string;
  contactEmail: string;
  score: number;
  respondedAt: string;
  token: string;
  sentAt: string;
  comment?: string | undefined;
}>;
type SurveyDefinition = z.infer<typeof SurveyDefinitionSchema>;
type SurveyResponse = z.infer<typeof SurveyResponseSchema>;
//# sourceMappingURL=survey.d.ts.map
//#endregion
//#region src/commands/create.d.ts
declare function createCustomer(opts: {
  name: string;
  domain?: string;
  email?: string;
  dataDir?: string;
}): Promise<{
  id: string;
  dir: string;
}>;
//#endregion
//#region src/commands/backup.d.ts
interface BackupManifest {
  version: "1";
  createdAt: string;
  dxcrmVersion: string;
  directories: string[];
  customerCount: number;
  fileCount: number;
  totalBytes: number;
  sha256: string;
  encrypted: boolean;
  retentionTier?: "daily" | "weekly" | "monthly";
}
declare function runBackup(output?: string, dataDir?: string, opts?: {
  encrypt?: boolean;
  remote?: string;
}): Promise<BackupManifest | null>;
//#endregion
//#region src/commands/audit.d.ts
declare function runAudit(opts: {
  slug?: string;
  actor?: string;
  limit?: number;
  tail?: boolean;
}, dataDir?: string): Promise<void>;
//#endregion
//#region src/commands/validate.d.ts
declare function runValidate(opts: {
  fix?: boolean;
}, dataDir: string): Promise<void>;
//#endregion
//#region src/fs/customer-dir.d.ts
declare function customerExists(dataDir: string, slug: string): boolean;
/** List all customer slugs (immediate subdirectories of customers/). */

declare function readMainFacts(dataDir: string, slug: string): Promise<MainFacts>;
//# sourceMappingURL=customer-dir.d.ts.map
//#endregion
//#region src/fs/audit-log.d.ts
interface AuditEntry {
  timestamp: string;
  actor: string;
  tool: string;
  slug: string;
  summary: string;
}
declare function readAuditLog(dataDir: string): AuditEntry[];
declare function filterAuditLog(entries: AuditEntry[], opts: {
  slug?: string;
  actor?: string;
  limit?: number;
}): AuditEntry[];
//# sourceMappingURL=audit-log.d.ts.map
//#endregion
//#region src/core/rbac.d.ts
type Role = "admin" | "manager" | "rep";
interface RbacConfig {
  actors: Record<string, Role>;
  default?: Role;
  owned_customers?: Record<string, string[]>;
  /** Field-level ACL: field name → roles allowed to see it. Others get it redacted. */
  field_acl?: Record<string, Role[]>;
}
declare function getRbacConfig(dataDir: string): RbacConfig;
declare function getRole(dataDir: string, actor: string): Role;
declare function canSeeCustomer(dataDir: string, actor: string, slug: string): boolean;
/**
 * Build a once-loaded predicate for which customers `actor` may see. Equivalent
 * to calling canSeeCustomer per slug, but reads/parses rbac.json a single time
 * (and uses O(1) Set membership) — for hot loops like list_customers.
 */
//#endregion
//#region src/core/session-store.d.ts
interface Session {
  customerSlug: string;
  customerName: string;
  startedAt: string;
  owner?: string;
}
declare function setSession(s: Session): void;
declare function getSession(): Session | null;
declare function clearSession(): void;
//# sourceMappingURL=session-store.d.ts.map
//#endregion
//#region src/version.d.ts
declare const VERSION = "0.1.0";
//# sourceMappingURL=version.d.ts.map

//#endregion
export { type GlobalSources, type InteractionEntry, type KbArticle, type MainFacts, type PipelineDeal, type QuoteLineItem, type Quote as QuoteRecord, type SurveyDefinition, type SurveyResponse, type TicketPriority, type Ticket as TicketRecord, type TicketStatus, VERSION, canSeeCustomer, clearSession, createCustomer, customerExists, filterAuditLog, getRbacConfig, getRole, getSession, readAuditLog, readMainFacts, runAudit, runBackup, runValidate, setSession };
//# sourceMappingURL=index-FzDsNSSb.d.ts.map