import { type ToolContext, type ToolHandlerActionPolicyContext } from "@voyant-travel/tools"; import { z } from "zod"; import { snapshotAndSendQuoteInputSchema } from "./service/quote-delivery.js"; import { insertQuoteProductSchema, pipelineListQuerySchema, quoteListQuerySchema, sendQuoteVersionSchema, stageListQuerySchema } from "./validation.js"; export interface QuotesToolServices { listQuotes(query: z.infer): Promise; getQuoteById(id: string): Promise; listPipelines(query: z.infer): Promise; listStages(query: z.infer): Promise; createQuote(input: z.infer, admitted: ToolHandlerActionPolicyContext): Promise; addQuoteProduct(quoteId: string, input: z.infer): Promise; snapshotQuoteVersion(quoteId: string): Promise; sendQuoteVersion(quoteVersionId: string, input: z.infer): Promise; acceptQuoteVersion(quoteVersionId: string): Promise; declineQuoteVersion(quoteVersionId: string): Promise; } export interface QuoteDeliveryToolServices { snapshotAndSendQuote(input: z.infer, admitted: ToolHandlerActionPolicyContext): Promise; } export type QuotesToolContext = ToolContext & { quotes?: QuotesToolServices; quoteDelivery?: QuoteDeliveryToolServices; }; export declare const snapshotAndSendQuoteOutputSchema: z.ZodObject<{ quoteVersion: z.ZodObject<{ id: z.ZodString; quoteId: z.ZodString; label: z.ZodNullable; status: z.ZodEnum<{ draft: "draft"; sent: "sent"; accepted: "accepted"; declined: "declined"; superseded: "superseded"; expired: "expired"; }>; supersedesId: z.ZodNullable; tripSnapshotId: z.ZodNullable; validUntil: z.ZodNullable; currency: z.ZodString; subtotalAmountCents: z.ZodNumber; taxAmountCents: z.ZodNumber; totalAmountCents: z.ZodNumber; notes: z.ZodNullable; sentAt: z.ZodNullable; viewedAt: z.ZodNullable; decidedAt: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; archivedAt: z.ZodNullable; }, z.core.$strip>; proposalUrl: z.ZodString; delivery: z.ZodObject<{ id: z.ZodString; status: z.ZodEnum<{ sent: "sent"; pending: "pending"; failed: "failed"; cancelled: "cancelled"; }>; channel: z.ZodEnum<{ email: "email"; sms: "sms"; }>; provider: z.ZodString; providerMessageId: z.ZodNullable; toAddress: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; export declare const SNAPSHOT_AND_SEND_QUOTE_HANDLER_POLICY: { readonly capabilityId: "@voyant-travel/quotes#proposal-extension.tool.snapshot-and-send-quote"; readonly capabilityVersion: "v2"; readonly canonicalName: "snapshot_and_send_quote"; readonly actionPolicy: { readonly id: "@voyant-travel/quotes#proposal-extension.action.snapshot-and-send-quote"; readonly capabilityId: "@voyant-travel/quotes#proposal-extension.action.snapshot-and-send-quote"; readonly version: "v2"; readonly kind: "execute"; readonly targetType: "quote"; readonly commandTargetField: "quoteId"; readonly targetLifecycle: "existing"; readonly existingTarget: { readonly durability: "handler-command-result-v1"; }; readonly risk: "high"; readonly ledger: "required"; readonly approval: "required"; readonly reversible: false; }; }; export declare const listQuotesTool: import("@voyant-travel/tools").ToolDefinition<{ limit: number; offset: number; personId?: string | undefined; organizationId?: string | undefined; pipelineId?: string | undefined; stageId?: string | undefined; ownerId?: string | undefined; status?: "open" | "won" | "lost" | "archived" | undefined; search?: string | undefined; }, { data: { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; }[]; total: number; limit: number; offset: number; }, QuotesToolContext>; export declare const getQuoteTool: import("@voyant-travel/tools").ToolDefinition<{ id: string; }, { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; } | null, QuotesToolContext>; export declare const listQuotePipelinesTool: import("@voyant-travel/tools").ToolDefinition<{ limit: number; offset: number; entityType?: "organization" | "person" | "quote" | "activity" | undefined; }, { data: { id: string; entityType: "organization" | "person" | "quote" | "activity"; name: string; isDefault: boolean; sortOrder: number; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }, QuotesToolContext>; export declare const listQuoteStagesTool: import("@voyant-travel/tools").ToolDefinition<{ limit: number; offset: number; pipelineId?: string | undefined; }, { data: { id: string; pipelineId: string; name: string; sortOrder: number; probability: number | null; isClosed: boolean; isWon: boolean; isLost: boolean; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }, QuotesToolContext>; /** * A quote opens in the `open` state, always. * * `insertQuoteSchema` is the HTTP-facing shape and carries the whole lifecycle: * `status`, `acceptedVersionId`, `lostReason`. Passing it through would let a * caller create a quote already marked `won` with an `acceptedVersionId`, * skipping `accept_quote_version` and its checks that a version was actually * sent, that no other version is accepted, and that competing versions get * closed. Acceptance and closure are transitions, not creation inputs. */ export declare const createQuoteToolInputSchema: z.ZodObject<{ description: z.ZodOptional>; tags: z.ZodDefault>; title: z.ZodString; pipelineId: z.ZodString; personId: z.ZodOptional>; organizationId: z.ZodOptional>; stageId: z.ZodString; ownerId: z.ZodOptional>; valueAmountCents: z.ZodOptional>; valueCurrency: z.ZodOptional>; paxCount: z.ZodOptional>; expectedCloseDate: z.ZodOptional>; source: z.ZodOptional>; sourceRef: z.ZodOptional>; }, z.core.$strict>; export declare const createQuoteTool: import("@voyant-travel/tools").ToolDefinition<{ tags: string[]; title: string; pipelineId: string; stageId: string; description?: string | null | undefined; personId?: string | null | undefined; organizationId?: string | null | undefined; ownerId?: string | null | undefined; valueAmountCents?: number | null | undefined; valueCurrency?: string | null | undefined; paxCount?: number | null | undefined; expectedCloseDate?: string | null | undefined; source?: string | null | undefined; sourceRef?: string | null | undefined; }, { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; }, QuotesToolContext>; export declare const addQuoteProductTool: import("@voyant-travel/tools").ToolDefinition<{ nameSnapshot: string; quantity: number; quoteId: string; productId?: string | null | undefined; supplierServiceId?: string | null | undefined; description?: string | null | undefined; unitPriceAmountCents?: number | null | undefined; costAmountCents?: number | null | undefined; currency?: string | null | undefined; discountAmountCents?: number | null | undefined; }, { id: string; quoteId: string; productId: string | null; supplierServiceId: string | null; nameSnapshot: string; description: string | null; quantity: number; unitPriceAmountCents: number | null; costAmountCents: number | null; currency: string | null; discountAmountCents: number | null; createdAt: string; updatedAt: string; }, QuotesToolContext>; export declare const snapshotQuoteVersionTool: import("@voyant-travel/tools").ToolDefinition<{ quoteId: string; }, { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; } | null, QuotesToolContext>; export declare const sendQuoteVersionTool: import("@voyant-travel/tools").ToolDefinition<{ quoteVersionId: string; validUntil?: string | null | undefined; }, { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; } | null, QuotesToolContext>; export declare const snapshotAndSendQuoteTool: import("@voyant-travel/tools").ToolDefinition<{ quoteId: string; to: string; templateSlug: string; channel: "email" | "sms"; data: Record; validUntil?: string | null | undefined; }, { quoteVersion: { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; }; proposalUrl: string; delivery: { id: string; status: "sent" | "pending" | "failed" | "cancelled"; channel: "email" | "sms"; provider: string; providerMessageId: string | null; toAddress: string; }; }, QuotesToolContext>; export declare const acceptQuoteVersionTool: import("@voyant-travel/tools").ToolDefinition<{ quoteVersionId: string; }, { quote: { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; }; quoteVersion: { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; }; closedQuoteVersions: { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; }[]; } | null, QuotesToolContext>; export declare const declineQuoteVersionTool: import("@voyant-travel/tools").ToolDefinition<{ quoteVersionId: string; }, { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; } | null, QuotesToolContext>; export declare const quotesTools: readonly [import("@voyant-travel/tools").ToolDefinition<{ limit: number; offset: number; personId?: string | undefined; organizationId?: string | undefined; pipelineId?: string | undefined; stageId?: string | undefined; ownerId?: string | undefined; status?: "open" | "won" | "lost" | "archived" | undefined; search?: string | undefined; }, { data: { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; }[]; total: number; limit: number; offset: number; }, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ id: string; }, { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; } | null, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ limit: number; offset: number; entityType?: "organization" | "person" | "quote" | "activity" | undefined; }, { data: { id: string; entityType: "organization" | "person" | "quote" | "activity"; name: string; isDefault: boolean; sortOrder: number; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ limit: number; offset: number; pipelineId?: string | undefined; }, { data: { id: string; pipelineId: string; name: string; sortOrder: number; probability: number | null; isClosed: boolean; isWon: boolean; isLost: boolean; createdAt: string; updatedAt: string; }[]; total: number; limit: number; offset: number; }, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ tags: string[]; title: string; pipelineId: string; stageId: string; description?: string | null | undefined; personId?: string | null | undefined; organizationId?: string | null | undefined; ownerId?: string | null | undefined; valueAmountCents?: number | null | undefined; valueCurrency?: string | null | undefined; paxCount?: number | null | undefined; expectedCloseDate?: string | null | undefined; source?: string | null | undefined; sourceRef?: string | null | undefined; }, { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; }, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ nameSnapshot: string; quantity: number; quoteId: string; productId?: string | null | undefined; supplierServiceId?: string | null | undefined; description?: string | null | undefined; unitPriceAmountCents?: number | null | undefined; costAmountCents?: number | null | undefined; currency?: string | null | undefined; discountAmountCents?: number | null | undefined; }, { id: string; quoteId: string; productId: string | null; supplierServiceId: string | null; nameSnapshot: string; description: string | null; quantity: number; unitPriceAmountCents: number | null; costAmountCents: number | null; currency: string | null; discountAmountCents: number | null; createdAt: string; updatedAt: string; }, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ quoteId: string; }, { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; } | null, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ quoteVersionId: string; validUntil?: string | null | undefined; }, { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; } | null, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ quoteId: string; to: string; templateSlug: string; channel: "email" | "sms"; data: Record; validUntil?: string | null | undefined; }, { quoteVersion: { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; }; proposalUrl: string; delivery: { id: string; status: "sent" | "pending" | "failed" | "cancelled"; channel: "email" | "sms"; provider: string; providerMessageId: string | null; toAddress: string; }; }, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ quoteVersionId: string; }, { quote: { id: string; title: string; personId: string | null; organizationId: string | null; pipelineId: string; stageId: string; ownerId: string | null; status: "open" | "won" | "lost" | "archived"; acceptedVersionId: string | null; valueAmountCents: number | null; valueCurrency: string | null; paxCount: number | null; expectedCloseDate: string | null; source: string | null; sourceRef: string | null; lostReason: string | null; tags: string[]; customFields: Record>; description: string | null; createdBy: string | null; updatedBy: string | null; createdAt: string; updatedAt: string; stageChangedAt: string; closedAt: string | null; }; quoteVersion: { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; }; closedQuoteVersions: { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; }[]; } | null, QuotesToolContext>, import("@voyant-travel/tools").ToolDefinition<{ quoteVersionId: string; }, { id: string; quoteId: string; label: string | null; status: "draft" | "sent" | "accepted" | "declined" | "superseded" | "expired"; supersedesId: string | null; tripSnapshotId: string | null; validUntil: string | null; currency: string; subtotalAmountCents: number; taxAmountCents: number; totalAmountCents: number; notes: string | null; sentAt: string | null; viewedAt: string | null; decidedAt: string | null; createdAt: string; updatedAt: string; archivedAt: string | null; } | null, QuotesToolContext>];